(self, other)
Checks whether another element is semantically equivalent to this one.

    Two elements are considered equivalent if they have the same
    specification (i.e. same tag appearing in the same context), the same
    attribute values, and all of their children are equivalent. The ordering
    of non-repeated children is not important for this comparison, while
    the ordering of repeated children are important only amongst the same
    type* of children. In other words, for two bodies to be considered
    equivalent, their child sites must appear in the same order, and their
    child geoms must appear in the same order, but permutations between sites
    and geoms are disregarded. (The only exception is in tendon definition,
    where strict ordering of all children is necessary for equivalence.)

    *Note that the notion of "same type" in this function is very loose:
    for example different actuator element subtypes are treated as separate
    types when children ordering is considered. Therefore, two <actuator>
    elements might be considered equivalent even though they result in different
    orderings of `mjData.ctrl` when compiled. As it stands, this function
    is designed primarily as a testing aid and should not be used to guarantee
    that models are actually identical.

    Args:
      other: An `mjcf.Element`

    Returns:
      `True` if `other` element is semantically equivalent to this one.
Checks whether another element is semantically equivalent to this one.
Checks whether another element is semantically equivalent to this one .
def is_same_as(self, other):
    """Checks whether another element is semantically equivalent to this one.

    Two elements are considered equivalent if they have the same
    specification (i.e. same tag appearing in the same context), the same
    attribute values, and all of their children are equivalent. The ordering
    of non-repeated children is not important for this comparison, while
    the ordering of repeated children are important only amongst the same
    type* of children. In other words, for two bodies to be considered
    equivalent, their child sites must appear in the same order, and their
    child geoms must appear in the same order, but permutations between sites
    and geoms are disregarded. (The only exception is in tendon definition,
    where strict ordering of all children is necessary for equivalence.)

    *Note that the notion of "same type" in this function is very loose:
    for example different actuator element subtypes are treated as separate
    types when children ordering is considered. Therefore, two <actuator>
    elements might be considered equivalent even though they result in different
    orderings of `mjData.ctrl` when compiled. As it stands, this function
    is designed primarily as a testing aid and should not be used to guarantee
    that models are actually identical.

    Args:
      other: An `mjcf.Element`

    Returns:
      `True` if `other` element is semantically equivalent to this one.
    """
    if other is None or other.spec != self._spec:
      return False

    for attribute_name in self._spec.attributes.keys():
      attribute = self._attributes[attribute_name]
      other_attribute = getattr(other, attribute_name)
      if isinstance(attribute.value, base.Element):
        if attribute.value.full_identifier != other_attribute.full_identifier:
          return False
      elif not np.all(attribute.value == other_attribute):
        return False

    if (self._parent and
        self._parent.tag == constants.TENDON and
        self._parent.parent == self.root):
      return self._tendon_has_same_children_as(other)
    else:
      return self._has_same_children_as(other)
def is_same_as ( self , other ) : if other is None or other . spec != self . _spec : return False for attribute_name in self . _spec . attributes . keys ( ) : attribute = self . _attributes [ attribute_name ] other_attribute = getattr ( other , attribute_name ) if isinstance ( attribute . value , base . Element ) : if attribute . value . full_identifier != other_attribute . full_identifier : return False elif not np . all ( attribute . value == other_attribute ) : return False if ( self . _parent and self . _parent . tag == constants . TENDON and self . _parent . parent == self . root ) : return self . _tendon_has_same_children_as ( other ) else : return self . _has_same_children_as ( other )