code: def get_substring_from_offsets(
      text: str,
      start: Optional[int],
      end: Optional[int],
      byte_offset: bool = USE_BYTE_OFFSET,
  ) -> str:
      """
      Access substring of a text using byte offset, if the switch is turned on.
      Otherwise return substring as the usual text[start:end]
      """
      text = text.encode("utf8") if byte_offset else text
      out = text[start:end]
      return out.decode("utf8") if byte_offset else out
  
imports: import builtins
  import json
  import os
  import unicodedata
  from typing import Any, List, Optional, Tuple
label_desc: Use image node_id 3 for calling a global function with example usage: get_substring_from_offsets(text, start, end, byte_offset) and returns: unknown