Update lineno and column based on `str`.
338392
function updatePosition(str) {
    var lines = str.match(/\n/g);
    if (lines) lineno += lines.length;
    var i = str.lastIndexOf('\n');
    column = ~i ? str.length - i : column + str.length;
  }
679122
def adjust_lineno(filename, lineno, name):
    
    line = linecache.getline(filename, lineno)
    # Hack warning: might be fooled by comments
    rx = re.compile(r'\b%s\b' % re.escape(name) if name != '*' else '[*]')
    while line and not rx.search(line):
        lineno += 1
        line = linecache.getline(filename, lineno)
    return lineno
721429
def update(self, *a, **ka):
        
        prefix = ''
        if a and isinstance(a[0], basestring):
            prefix = a[0].strip('.') + '.'
            a = a[1:]
        for key, value in dict(*a, **ka).items():
            self[prefix + key] = value
1110365
def update_eol(self, os_name):
        """"""
        os_name = to_text_string(os_name)
        value = {"nt": "CRLF", "posix": "LF"}.get(os_name, "CR")
        self.set_value(value)
1032632
def fillNoneValues(column):
    
    if column.dtype == object:
        column.fillna('', inplace=True)
    return column
446034
def _update_settings(self, dialect):
        """"""

        # the first parameter is the dialect itself --> ignore
        for parameter in self.csv_params[2:]:
            pname, ptype, plabel, phelp = parameter

            widget = self._widget_from_p(pname, ptype)

            if ptype is types.TupleType:
                ptype = types.ObjectType

            digest = Digest(acceptable_types=[ptype])

            if pname == 'self.has_header':
                if self.has_header is not None:
                    widget.SetValue(digest(self.has_header))
            else:
                value = getattr(dialect, pname)
                widget.SetValue(digest(value))
1300633
def charindex(self, line, column):
        """"""
        #Make sure that we have chars and lines to work from if this
        #gets called before linenum() does.
        if len(self._lines) == 0:
            self.linenum(1)

        if line < len(self._chars):
            return self._chars[line - 1] + column
        else:
            return len(self.refstring)
791380
def _updateNumbers(self, linenumers):
        
        b = self.blockCount()
        c = b - linenumers
        if c > 0:
            # remove lines numbers
            for _ in range(c):
                # remove last line:
                self.setFocus()
                storeCursorPos = self.textCursor()
                self.moveCursor(
                    QtGui.QTextCursor.End,
                    QtGui.QTextCursor.MoveAnchor)
                self.moveCursor(
                    QtGui.QTextCursor.StartOfLine,
                    QtGui.QTextCursor.MoveAnchor)
                self.moveCursor(
                    QtGui.QTextCursor.End,
                    QtGui.QTextCursor.KeepAnchor)
                self.textCursor().removeSelectedText()
                self.textCursor().deletePreviousChar()
                self.setTextCursor(storeCursorPos)
        elif c < 0:
            # add line numbers
            for i in range(-c):
                self.appendPlainText(str(b + i + 1))
1207864
def find_column(t):
    """"""
    pos = t.lexer.lexpos
    data = t.lexer.lexdata
    last_cr = data.rfind('\n', 0, pos)
    if last_cr < 0:
        last_cr = -1
    column = pos - last_cr
    return column
429090
def update(d, e):
    """"""
    res = copy.copy(d)
    res.update(e)
    return res
186989
def update(data_df, cal_dict, param, bound, start, end):
    ''''''
    from collections import OrderedDict

    if param not in cal_dict['parameters']:
        cal_dict['parameters'][param] = OrderedDict()
    if bound not in cal_dict['parameters'][param]:
        cal_dict['parameters'][param][bound] = OrderedDict()

    cal_dict['parameters'][param][bound]['start'] = start
    cal_dict['parameters'][param][bound]['end']   = end

    return cal_dict
687931
def alter_change_column(self, table, column, field):
        """"""
        return self._update_column(table, column, lambda a, b: b)
1341118
def _stringify_column(self, column_index):
        '''
        
        '''
        table_column = TableTranspose(self.table)[column_index]
        prior_cell = None
        for row_index in range(self.start[0], self.end[0]):
            cell, changed = self._check_interpret_cell(table_column[row_index], prior_cell, row_index, column_index)
            if changed:
                table_column[row_index] = cell
            prior_cell = cell
786903
def _todo_do_update(self, line):
        ""
        table, line = self.get_table_params(line)
        hkey, line = line.split(" ", 1)
        expected, attr = self.get_expected(line)

        if attr[0] == '-':
            op, attr = attr.split(" ", 1)
            op = op[1]
        else:
            op = "u"

        if attr[0] == '+':
            ret, attr = attr.split(" ", 1)
            ret = ret[1:]
        else:
            ret = "ALL_NEW"

        if ',' in hkey:
            hkey, rkey = hkey.split(",", 1)
        else:
            rkey = None

        item = table.new_item(hash_key=self.get_typed_key_value(table, hkey), range_key=self.get_typed_key_value(table, rkey, False))

        attr = json.loads(attr.strip())
        for name in attr.keys():
            value = attr[name]
            if isinstance(value, list):
                value = set(value)

            if op == 'a':
                item.add_attribute(name, value)
            elif op == 'd':
                item.delete_attribute(name, value)
            else:
                item.put_attribute(name, value)

        self.pprint(item)
        updated = item.save(expected_value=expected or None, return_values=ret)
        self.pprint(updated)

        if self.consumed:
            print "consumed units:", item.consumed_units
286340
def update(self, table, columns, values, where):
        
        # Unpack WHERE clause dictionary into tuple
        where_col, where_val = where

        # Create column string from list of values
        cols = get_col_val_str(columns, query_type='update')

        # Concatenate statement
        statement = "UPDATE {0} SET {1} WHERE {2}='{3}'".format(wrap(table), cols, where_col, where_val)

        # Execute statement
        self._cursor.execute(statement, values)
        self._printer('\tMySQL cols (' + str(len(values)) + ') successfully UPDATED')
111488
def text_has_changed(self, text):
        """"""
        text = to_text_string(text)
        if text:
            self.lineno = int(text)
        else:
            self.lineno = None
976371
def column_list(string):
    """"""
    try:
        columns = list(map(int, string.split(',')))
    except ValueError as e:
        raise argparse.ArgumentTypeError(*e.args)
    for column in columns:
        if column < 1:
            raise argparse.ArgumentTypeError(
                'Invalid column {!r}: column numbers start at 1.'
                .format(column))
    return columns