code: def whitespace_clean(text):
      text = re.sub(r"\s+", " ", text)
      text = text.strip()
      return text
  
imports: import json
  import os
  import unicodedata
  from functools import lru_cache
  from typing import List, Optional, Tuple
  import regex
  from ...tokenization_utils import AddedToken, PreTrainedTokenizer, _is_control, _is_punctuation, _is_whitespace
  from ...utils import logging
label_desc: Use image node_id 3 for calling a global function with example usage: whitespace_clean(text) and returns: text