code: def _update_offsets(
      self,
      new_metadata_idx_store,
      new_metadata_offsets,
      new_term_idx_store,
      new_term_offsets,
  ):
      term_offsets = (
          self._term_offsets
          if new_term_offsets is None
          else new_term_offsets
      )
      metadata_offsets = (
          self._metadata_offsets
          if new_metadata_offsets is None
          else new_metadata_offsets
      )
      if new_term_idx_store is not None:
          term_offsets = {
              k: term_offsets[k] for k in new_term_idx_store.values()
          }
  
      if new_metadata_idx_store is not None:
          metadata_offsets = {
              k: metadata_offsets[k]
              for k in new_metadata_idx_store.values()
          }
      return metadata_offsets, term_offsets
  
file_path: scattertext/scattertext/OffsetCorpus.py
imports: from copy import copy
  from scattertext.ParsedCorpus import ParsedCorpus
label_desc: Use image node_id 4 for calling the OffsetCorpus obj's underlying member method code with example usage: obj._update_offsets(new_metadata_idx_store, new_metadata_offsets, new_term_idx_store, new_term_offsets) and returns: metadata_offsets,  term_offsets