code: def _all_are_type(elements, target_type):
      """Checks that all the given elements are the target type.
  
      Args:
        elements: A list of objects.
        target_type: The Python class which all elemenets need to be an instance of.
  
      Returns:
        True if every object in `elements` is an instance of `target_type`, and
        False otherwise.
      """
      return all(isinstance(elem, target_type) for elem in elements)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import itertools
  from magenta.pipelines import pipeline
  import six
label_desc: Use image node_id 1 for calling a global function with example usage: _all_are_type(elements, target_type) and returns: all