code: def replace_digits(
      s: TextSeries, symbols: str = " ", only_blocks=True
  ) -> TextSeries:
      """
      Replace all digits with symbols.
  
      By default, only replaces "blocks" of digits, i.e tokens composed of only
      numbers.
  
      When `only_blocks` is set to ´False´, replaces all digits.
  
      Parameters
      ----------
      s : :class:`texthero._types.TextSeries`
  
      symbols : str, optional, default=" "
          Symbols to replace
  
      only_blocks : bool, optional, default=True
          When set to False, replace all digits.
  
      Examples
      --------
      >>> import texthero as hero
      >>> import pandas as pd
      >>> s = pd.Series("1234 falcon9")
      >>> hero.preprocessing.replace_digits(s, "X")
      0    X falcon9
      dtype: object
      >>> hero.preprocessing.replace_digits(s, "X", only_blocks=False)
      0    X falconX
      dtype: object
      """
  
      if only_blocks:
          pattern = r"\b\d+\b"
          return s.str.replace(pattern, symbols)
      else:
          return s.str.replace(r"\d+", symbols)
  
imports: from gensim.models.phrases import Phrases
  import re
  import string
  from typing import Optional, Set
  import unicodedata
  import numpy
  import pandas
  from texthero._types import TokenSeries, TextSeries, InputSeries
  from typing import List, Callable, Union
  import warnings
label_desc: Use image node_id 3 for calling a global function with example usage: replace_digits(s, symbols, only_blocks) and returns: s, s