code: def _is_valid_type(element):
      if (
          isinstance(element, tuple)
          and len(element) == 2
          and hasattr(element[0], "dtype")
          and hasattr(element[1], "dtype")
      ):
          return True
      elif hasattr(element, "dtype"):
          return True
      return False
  
imports: import chainer
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: _is_valid_type(element) and returns: False, True, True