<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def Append(self, component=None, **kwarg):
 """Append a new pathspec component to this pathspec."""

    if component is None:
      component = self.__class__(**kwarg)

    if self.HasField("pathtype"):
      self.last.nested_path = component
    else:
      for k, v in iteritems(kwarg):
        setattr(self, k, v)

      self.SetRawData(component.GetRawData())

    return self