class_docstr: Adapter that handles python generators and iterators.
class_docstr_tok: ["Adapter","that","handles","python","generators","and","iterators","."]
code: def can_handle(x, y=None):
      return (hasattr(x, "__next__") or hasattr(x, "next")) and hasattr(
          x, "__iter__"
      )
  
file_path: elegy/elegy/data/generator_adapter.py
imports: import itertools
  import typing
  from .data_adapter import DataAdapter
  from .utils import assert_not_namedtuple, flatten, is_none_or_empty, pack_x_y_sample_weight, unpack_x_y_sample_weight
label_desc: Use image node_id 1 for calling the GeneratorDataAdapter obj's underlying member method code with example usage: obj.can_handle(x, y) and returns: unknown