check if a cell (i, j) can be put into self._output
199619
def _check_cell_validity(self, i, j):
        
        if i >= len(self._output):
            return True
        if j >= len(self._output[i]):
            return True
        if self._output[i][j] is None:
            return True
        return False
661762
def cells(options = {}, &block)
      cell_regex = /^cell_([0-9]+)_/

      options ||= { }

      result = block_given? ? yield : (options[:values] || [''])

      cell_options = result.map { {} }
      common_options = {}

      options.each do |k,v|
        # if the option starts with 'cell_#_' then apply it accordingly.
        if (m = cell_regex.match(k.to_s))
          k = k.to_s[m[0].length..-1].to_sym
          cell_options[m[1].to_i - 1][k] = v

        # the 'column' option applies only to the first cell.
        elsif k == :column
          cell_options[0][k] = v

        # everything else applies to all cells, unless overridden explicitly.
        elsif k != :values
          common_options[k] = v
        end
      end

      cell_options.each_with_index do |opt,idx|
        cell common_options.merge(opt).merge( { value: result[idx] } )
      end
    end
987714
def _code_cell(self, source):
        """"""
        input, output = self._prompt.to_cell(source)
        return {'cell_type': 'code',
                'input': input,
                'output': output}
637852
def isIn(row, col_name, arg, dm, df, con=None):
    
    #grade = df.apply(func, args=(validation_name, arg, dm), axis=1)
    cell_value = row[col_name]
    cell_value = str(cell_value)
    if not cell_value:
        return None
    elif cell_value == 'None':
        return None
    elif cell_value == 'nan':
        return None
    elif not con:
        return None
    # if it's in another table
    cell_values = [v.strip(" ") for v in cell_value.split(":")]
    if "." in arg:
        table_name, table_col_name = arg.split(".")
        if table_name not in con.tables:
            return None
            #return "Must contain a value from {} table. Missing {} table.".format(table_name, table_name)
        if table_col_name not in con.tables[table_name].df.columns:
            return '{} table is missing "{}" column, which is required for validating "{}" column'.format(table_name, table_col_name, col_name)
        possible_values = con.tables[table_name].df[table_col_name].unique()
        for value in cell_values:
            if value not in possible_values:
                trunc_possible_values = [val.replace(' ', '') for val in possible_values if val]
                trunc_cell_value = cell_value.replace(' ', '')
                if trunc_cell_value not in trunc_possible_values:
                    if trunc_cell_value != value:
                        return 'This value (long): "{}" is not found in: {} column in {} table.  Also (short): {} is not in {}'.format(value, table_col_name, table_name, trunc_cell_value, arg)
                    else:
                        return 'This value: "{}" is not found in: {} column in {} table'.format(value, table_col_name, table_name)
                    break
    # if it's in the present table:
    else:
        possible_values = df[arg].unique()
        for value in cell_values:
            if value not in possible_values:
                return 'This value: "{}" is not found in: {} column'.format(value, arg)
                break
    return None
8479
private void internalAdd(Cell cell)
    {
        if (cells.length == size)
            cells = Arrays.copyOf(cells, Math.max(MINIMAL_CAPACITY, size * 3 / 2 + 1));
        cells[size++] = cell;
    }
501315
def is_cell_separator(self, cursor=None, block=None):
        """"""
        assert cursor is not None or block is not None
        if cursor is not None:
            cursor0 = QTextCursor(cursor)
            cursor0.select(QTextCursor.BlockUnderCursor)
            text = to_text_string(cursor0.selectedText())
        else:
            text = to_text_string(block.text())
        if self.cell_separators is None:
            return False
        else:
            return text.lstrip().startswith(self.cell_separators)
449322
function (cell) {
            try {
                var start = domUtils.getXY(cell).x + cell.offsetWidth,
                    rows = this.table.rows, cells , returns = [];
                for (var i = 0; i < this.rowsNum; i++) {
                    cells = rows[i].cells;
                    for (var j = 0, tmpCell; tmpCell = cells[j++];) {
                        var tmpStart = domUtils.getXY(tmpCell).x;
                        if (tmpStart > start) break;
                        if (tmpStart == start && tmpCell.colSpan == 1) {
                            returns.push(tmpCell);
                            break;
                        }
                    }
                }
                return returns;
            } catch (e) {
                showError(e);
            }
        }
861124
private void reconcileWith(int i, Cell cell)
    {
        cells[i] = cell.reconcile(cells[i]);
    }
1185172
def _cells(nb):
    """"""
    if nb.nbformat < 4:
        for ws in nb.worksheets:
            for cell in ws.cells:
                yield cell
    else:
        for cell in nb.cells:
            yield cell
809702
def cell_ends_with_code(lines):
    """"""
    if not lines:
        return False
    if not lines[-1].strip():
        return False
    if lines[-1].startswith('#'):
        return False
    return True
1315955
def _output_format(out,
                   operation):
    '''
    
    '''
    return [s.split()[1:] for s in out
            if s.startswith(operation)]
702294
def make_sh_output(value, output_script, witness=False):
    '''
    
    '''
    return _make_output(
        value=utils.i2le_padded(value, 8),
        output_script=make_sh_output_script(output_script, witness))
361455
def get_cell_type(cell):
    '''
    
    '''
    cell_type = None
    if isinstance(cell, basestring) and cell:
        cell_type = basestring
    elif isinstance(cell, (int, float)):
        cell_type = (int, float)

    return cell_type
437652
def insert_cells(cells, pos_dict, ft_name, append=False):
    ""
    idx = get_insert_idx(pos_dict, ft_name)
    if append or idx == -1: cells += [get_doc_cell(ft_name), get_empty_cell()]
    else:
        cells.insert(idx, get_doc_cell(ft_name))
        cells.insert(idx+1, get_empty_cell())
        pos_dict = update_pos(pos_dict, ft_name, 2)
    return cells, pos_dict
791361
def check_output(args):
    """"""
    log.debug('run: %s', args)
    out = subprocess.check_output(args=args).decode('utf-8')
    log.debug('out: %r', out)
    return out
1093849
def run_cell(self):
        """"""
        text, line = self.get_current_editor().get_cell_as_executable_code()
        self._run_cell_text(text, line)
772052
def process_cell(self, row, column, cell):
        
        value, field = self.parse_cell(cell)

        if value or field:
            return {'col':column, 'field':field, 'value':value}
        else:
            return {}