code: def flatten(obj, result=None):
      """Return flattened version of (possibly nested) iterable object."""
      if not isinstance(obj, Iterable | Sized) or isinstance(obj, str):
          return obj
      if result is None:
          result = []
      for item in obj:
          if not isinstance(item, Iterable | Sized) or isinstance(
              item, str
          ):
              result.append(item)
          else:
              flatten(item, result)
      return tuple(result)
  
imports: import sys
  import uuid
  import warnings
  from collections import defaultdict, deque
  from collections.abc import Iterable, Iterator, Sized
  from itertools import chain, tee
  import networkx
label_desc: Use image node_id 1 for calling a global function with example usage: flatten(obj, result) and returns: tuple, obj