code: def process_token(
      token: str, replace: List[Tuple[str, str]] = [("#", "")]
  ) -> str:
      """
      Replaces special characters in the tokens
  
      Parameters
      ----------
      token:
          token which potentially contains special characters
  
      replace:
          list of tuples `(s1, s2)`, where all occurances of s1 are replaced by s2
  
      Returns
      ---------
      processed_token:
          processed token whose special character has been replaced
  
      Note
      ----
          Only applies to characters in the original input token.
  
      Examples
      --------
      >>> from cleanlab.internal.token_classification_utils import process_token
      >>> token = "#Comment"
      >>> process_token("#Comment")
      'Comment'
  
      Specify custom replacement rules
  
      >>> replace = [("C", "a"), ("a", "C")]
      >>> process_token("Cleanlab", replace)
      'aleCnlCb'
      """
      replace_dict = {re.escape(k): v for (k, v) in replace}
      pattern = "|".join(replace_dict.keys())
      compiled_pattern = re.compile(pattern)
      replacement = lambda match: replace_dict[
          re.escape(match.group(0))
      ]
      processed_token = compiled_pattern.sub(replacement, token)
      return processed_token
  
file_path: cleanlab/cleanlab/internal/token_classification_utils.py
imports: from __future__ import annotations
  import re
  import string
  import numpy
  from termcolor import colored
  from typing import List, Optional, Callable, Tuple, TypeVar, TYPE_CHECKING
label_desc: Use image node_id 3 for calling a global function with example usage: process_token(token, replace) and returns: processed_token