code: def _str_to_unicode(text, encoding=None, errors="strict"):
      if encoding is None:
          encoding = "utf-8"
      if isinstance(text, bytes):
          return text.decode(encoding, errors)
      return text
  
imports: import html
  import os
  import re
  from shutil import copyfile
  from typing import List, Optional, Tuple
  import regex
  from ...tokenization_utils import PreTrainedTokenizer
  from ...utils import logging
label_desc: Use image node_id 2 for calling a global function with example usage: _str_to_unicode(text, encoding, errors) and returns: text, text