code: def __query_for_doc_offset_df(
      self, offset_df: pd.DataFrame, doc_idx: int
  ) -> pd.DataFrame:
      try:
          doc_offset_df = offset_df.loc[doc_idx]
      except KeyError:
          return pd.DataFrame([])
      if type(doc_offset_df) == pd.Series:
          return pd.DataFrame([dict(doc_offset_df)])
      return doc_offset_df
  
imports: import dataclasses
  from typing import Iterable, Optional, Callable, Union
  import flashtext
  import numpy
  import spacy
  import pandas
  from scattertext.contextual_embeddings.doc_splitter import doc_sentence_splitter
  from scattertext.features.FeatsFromSpacyDoc import FeatsFromSpacyDoc
  from scattertext.OffsetCorpus import OffsetCorpus
  from tqdm.auto import tqdm
  from scattertext.ParsedCorpus import ParsedCorpus
  from scattertext.contextual_embeddings.corpus_runing_stats import CorpusRunningStats
label_desc: Use image node_id 6 for calling the CorpusRunningStatsFactory obj's underlying member method code with example usage: obj.__query_for_doc_offset_df(offset_df, doc_idx) and returns: doc_offset_df, pd, pd