(self, other, exclude_worldbody=False, dry_run=False)
Attaches another element of the same spec to this element.

    All children of `other` will be treated as children of this element.
    All XML attributes which are defined in `other` but not defined in this
    element will be copied over, and any conflicting XML attribute value causes
    an error. After the attachment, any XML attribute modified in this element
    will also affect `other` and vice versa.

    Children of this element which are not a repeated elements will also be
    attached by the corresponding children of `other`.

    Args:
      other: Another Element with the same spec.
      exclude_worldbody: (optional) A boolean. If `True`, then don't do anything
        if `other` is a worldbody.
      dry_run: (optional) A boolean, if `True` only verify that the operation
        is valid without actually committing any change.

    Raises:
      ValueError: If `other` has a different spec, or if there are conflicting
        XML attribute values.
Attaches another element of the same spec to this element.
Attaches another element of the same spec to this element .
def _attach(self, other, exclude_worldbody=False, dry_run=False):
    """Attaches another element of the same spec to this element.

    All children of `other` will be treated as children of this element.
    All XML attributes which are defined in `other` but not defined in this
    element will be copied over, and any conflicting XML attribute value causes
    an error. After the attachment, any XML attribute modified in this element
    will also affect `other` and vice versa.

    Children of this element which are not a repeated elements will also be
    attached by the corresponding children of `other`.

    Args:
      other: Another Element with the same spec.
      exclude_worldbody: (optional) A boolean. If `True`, then don't do anything
        if `other` is a worldbody.
      dry_run: (optional) A boolean, if `True` only verify that the operation
        is valid without actually committing any change.

    Raises:
      ValueError: If `other` has a different spec, or if there are conflicting
        XML attribute values.
    """
    self._check_valid_attachment(other)
    if exclude_worldbody and other.tag == constants.WORLDBODY:
      return
    if dry_run:
      self._check_conflicting_attributes(other, copying=False)
    else:
      self._attachments[other.namescope] = other
      self._sync_attributes(other, copying=False)
    self._attach_children(other, exclude_worldbody, dry_run)
    if other.tag != constants.WORLDBODY and not dry_run:
      other._alias_attributes_dict(self._attributes)
def _attach ( self , other , exclude_worldbody = False , dry_run = False ) : self . _check_valid_attachment ( other ) if exclude_worldbody and other . tag == constants . WORLDBODY : return if dry_run : self . _check_conflicting_attributes ( other , copying = False ) else : self . _attachments [ other . namescope ] = other self . _sync_attributes ( other , copying = False ) self . _attach_children ( other , exclude_worldbody , dry_run ) if other . tag != constants . WORLDBODY and not dry_run : other . _alias_attributes_dict ( self . _attributes )