class_docstr: Base class for input data adapter.
  In order to simplify the training code path, all the input data
  object will be converted to a `generator` if possible.
  The sample usage of this class is like:
  
  ```
  x = list(range(100))
  adapter_cls = [ArrayDataAdapter, ..., ListsOfScalarsDataAdapter]
  applicable_adapters = [cls for cls in adapter_cls if cls.can_handle(x)]
  if len(applicable_adapters) != 1:
    raise ValueError("Expect only one adapter class to handle the input")
  dataset = applicable_adapters[0](x).get_dataset()
  for data in dataset():
    # training
  ```
docstr: Whether the current DataAdapter could handle the input x and y.
  Structure wise, x and y can be single object, or list of objects if there
  multiple input/output, or dictionary of objects when the input/output are
  named.
  Arguments:
    x: input features.
    y: target labels. Note that y could be None in the case of prediction.
  Returns:
    boolean
docstr_tok: ["Whether","the","current","DataAdapter","could","handle","the","input","x","and","y",".","Structure","wise",",","x","and","y","can","be","single","object",",","or","list","of","objects","if","there","multiple","input\/output",",","or","dictionary","of","objects","when","the","input\/output","are","named",".","Arguments",":","x",":","input","features",".","y",":","target","labels",".","Note","that","y","could","be","None","in","the","case","of","prediction",".","Returns",":","boolean"]
code: def can_handle(x, y=None):
      """Whether the current DataAdapter could handle the input x and y.
      Structure wise, x and y can be single object, or list of objects if there
      multiple input/output, or dictionary of objects when the input/output are
      named.
      Arguments:
        x: input features.
        y: target labels. Note that y could be None in the case of prediction.
      Returns:
        boolean
      """
      raise NotImplementedError
  
file_path: elegy/elegy/data/data_adapter.py
imports: import abc
  import typing
  import six
label_desc: Use image node_id 1 for calling the DataAdapter obj's underlying member method code with example usage: obj.can_handle(x, y) without return types