code: def from_string(cls, pid):
      
      try:
        id_, ip_port = pid.split('@')
        ip, port = ip_port.split(':')
        port = int(port)
      except ValueError:
        raise ValueError('Invalid PID: %s' % pid)
      return cls(ip, port, id_)
docs: Parse a PID from its string representation.
  
      PIDs may be represented as name@ip:port, e.g.
  
      .. code-block:: python
  
          pid = PID.from_string('master(1)@192.168.33.2:5051')
  
      :param pid: A string representation of a pid.
      :type pid: ``str``
      :return: The parsed pid.
      :rtype: :class:`PID`
      :raises: ``ValueError`` should the string not be of the correct syntax.