parameters: (dataset_or_iterator)
docstring: Returns the type signature for elements of the input dataset / iterator.
  
    Args:
      dataset_or_iterator: A `tf.data.Dataset` or an `tf.data.Iterator`.
  
    Returns:
      A (nested) structure of `tf.TypeSpec` objects matching the structure of an
      element of `dataset_or_iterator` and specifying the type of individual
      components.
  
    Raises:
      TypeError: If input is not a `tf.data.Dataset` or an `tf.data.Iterator`
        object.
docstring_summary: Returns the type signature for elements of the input dataset / iterator.
docstring_tokens: Returns the type signature for elements of the input dataset / iterator .
function: def get_structure(dataset_or_iterator):
    """Returns the type signature for elements of the input dataset / iterator.
  
    Args:
      dataset_or_iterator: A `tf.data.Dataset` or an `tf.data.Iterator`.
  
    Returns:
      A (nested) structure of `tf.TypeSpec` objects matching the structure of an
      element of `dataset_or_iterator` and specifying the type of individual
      components.
  
    Raises:
      TypeError: If input is not a `tf.data.Dataset` or an `tf.data.Iterator`
        object.
    """
    try:
      return dataset_or_iterator.element_spec  # pylint: disable=protected-access
    except AttributeError:
      raise TypeError(f"Invalid `dataset_or_iterator`. `dataset_or_iterator` "
                      f"must be a `tf.data.Dataset` or tf.data.Iterator object, "
                      f"but got {type(dataset_or_iterator)}.")
function_tokens: def get_structure ( dataset_or_iterator ) : try : return dataset_or_iterator . element_spec # pylint: disable=protected-access except AttributeError : raise TypeError ( f"Invalid `dataset_or_iterator`. `dataset_or_iterator` " f"must be a `tf.data.Dataset` or tf.data.Iterator object, " f"but got {type(dataset_or_iterator)}." )