(mjcf_elements)
return namespace, named_index
Returns `namespace` and `named_index` for `mjcf_elements`.

  Args:
    mjcf_elements: Either an `mjcf.Element`, or an iterable of `mjcf.Element`
        of the same kind.

  Returns:
    A tuple of `(namespace, named_indices)` where
      -`namespace` is the Mujoco element type (eg: 'geom', 'body', etc.)
      -`named_indices` are the names of `mjcf_elements`, either as a single
        string or an iterable of strings depending on whether `mjcf_elements`
        was an `mjcf.Element` or an iterable of `mjcf_Element`s.

  Raises:
      ValueError: If `mjcf_elements` cannot be bound to this Physics.
Returns `namespace` and `named_index` for `mjcf_elements`.
Returns namespace and named_index for mjcf_elements .
def names_from_elements(mjcf_elements):
  """Returns `namespace` and `named_index` for `mjcf_elements`.

  Args:
    mjcf_elements: Either an `mjcf.Element`, or an iterable of `mjcf.Element`
        of the same kind.

  Returns:
    A tuple of `(namespace, named_indices)` where
      -`namespace` is the Mujoco element type (eg: 'geom', 'body', etc.)
      -`named_indices` are the names of `mjcf_elements`, either as a single
        string or an iterable of strings depending on whether `mjcf_elements`
        was an `mjcf.Element` or an iterable of `mjcf_Element`s.

  Raises:
      ValueError: If `mjcf_elements` cannot be bound to this Physics.
  """
  if isinstance(mjcf_elements, collections.abc.Iterable):
    elements_tuple = tuple(mjcf_elements)
    if elements_tuple:
      namespace = _get_namespace(elements_tuple[0])
    else:
      return None, None
    for element in elements_tuple:
      element_namespace = _get_namespace(element)
      if element_namespace != namespace:
        raise ValueError('Cannot bind to a collection containing multiple '
                         'element types ({!r} != {!r}).'
                         .format(element_namespace, namespace))
    named_index = [element.full_identifier for element in elements_tuple]
  else:
    namespace = _get_namespace(mjcf_elements)
    named_index = mjcf_elements.full_identifier

  return namespace, named_index
def names_from_elements ( mjcf_elements ) : if isinstance ( mjcf_elements , collections . abc . Iterable ) : elements_tuple = tuple ( mjcf_elements ) if elements_tuple : namespace = _get_namespace ( elements_tuple [ 0 ] ) else : return None , None for element in elements_tuple : element_namespace = _get_namespace ( element ) if element_namespace != namespace : raise ValueError ( 'Cannot bind to a collection containing multiple ' 'element types ({!r} != {!r}).' . format ( element_namespace , namespace ) ) named_index = [ element . full_identifier for element in elements_tuple ] else : namespace = _get_namespace ( mjcf_elements ) named_index = mjcf_elements . full_identifier return namespace , named_index