<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update(self, symbol, item, metadata=None, chunk_range=None, upsert=False, audit=None, **kwargs):
 """ Overwrites data in DB with data in item for the given symbol. Is idempotent Parameters symbol: str the symbol for the given item in the DB item: DataFrame or Series the data to update metadata: ? optional per symbol metadata chunk_range: None, or a range object If a range is specified, it will clear/delete the data within the range and overwrite it with the data in item. This allows the user to update with data that might only be a subset of the original data. upsert: bool if True, will write the data even if the symbol does not exist. audit: dict optional audit information kwargs: optional keyword args passed to write during an upsert. Includes: chunk_size chunker """

        sym = self._get_symbol_info(symbol)
        if not sym:
            if upsert:
                return self.write(symbol, item, metadata=metadata, audit=audit, **kwargs)
            else:
                raise NoDataFoundException("Symbol does not exist.")
        if audit is not None:
            audit['symbol'] = symbol
            audit['action'] = 'update'
        if chunk_range is not None:
            if len(CHUNKER_MAP[sym[CHUNKER]].filter(item, chunk_range)) == 0:
                raise Exception('Range must be inclusive of data')
            self.__update(sym, item, metadata=metadata, combine_method=self.serializer.combine, chunk_range=chunk_range, audit=audit)
        else:
            self.__update(sym, item, metadata=metadata, combine_method=lambda old, new: new, chunk_range=chunk_range, audit=audit)