code: def filter_dictionary(
      text_docs: List[str],
      no_below: int = 10,
      no_above: float = 0.2,
      **kwargs,
  ):
      """Filters words outside specified frequency thresholds.
  
      Args:
          text_docs: A list of list of words from a document, can include n-grams up to 3.
          no_below: Keep tokens which are contained in at least no_below documents.
              Default is 10.
          no_above: Keep tokens which are contained in no more than no_above portion of
              documents (fraction of total corpus size). Default is 0.2.
          **kwargs: Other arguments to be passed to gensim.corpora.Dictionary.filter_extremes
  
      Returns:
          dictionary: Gensim Dictionary encapsulates the mapping between normalized words
              and their integer ids.
          corpus: Bag of Words (BoW) representation of documents (token_id, token_count).
      """
      dictionary = _compat["gensim"].corpora.Dictionary(text_docs)  # type: ignore
      dictionary.filter_extremes(
          no_below=no_below, no_above=no_above, **kwargs
      )
      corpus = [dictionary.doc2bow(doc) for doc in text_docs]
      return dictionary, corpus
  
imports: import re
  import string
  import warnings
  from types import GeneratorType
  from typing import List, Optional, Any, Iterable, TYPE_CHECKING
  import pandas
  from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
  from data_describe.text import text_preprocessing
  from data_describe.compat import _requires, _compat
label_desc: Use image node_id 15 for calling a global function with example usage: filter_dictionary(text_docs, no_below, no_above) and returns: dictionary,  corpus