code: def _deep_flatten(items):
      """Returns a list of objects, flattening sublists/subtuples along the way.
  
      Example: _deep_flatten([1, (2, 3, (4, 5), [6, 7]), [[[8]]]]) would return
      the list [1, 2, 3, 4, 5, 6, 7, 8].
  
      Args:
        items: An iterable. If elements of this iterable are lists or tuples, they
            will be (recursively) flattened until non-list non-tuple objects are
            reached.
  
      Returns:
        A list of non-list, non-tuple objects.
      """
  
      def _flat_gen(xs):
          for x in xs:
              if isinstance(x, (list, tuple)):
                  for y in _flat_gen(x):
                      yield y
              else:
                  yield x
  
      return list(_flat_gen(items))
  
file_path: trax/trax/models/research/rezero.py
imports: from trax import layers
  from trax.fastmath import numpy
label_desc: Use image node_id 10 for calling a global function with example usage: _deep_flatten(items) and returns: list