@classmethod
  def detect_process(cls, headers):
    """Returns tuple of process, legacy or None, None if not process originating."""

    try:
      if 'Libprocess-From' in headers:
        return PID.from_string(headers['Libprocess-From']), False
      elif 'User-Agent' in headers and headers['User-Agent'].startswith('libprocess/'):
        return PID.from_string(headers['User-Agent'][len('libprocess/'):]), True
    except __HOLE__ as e:
      log.error('Failed to detect process: %r' % e)
      pass

    return None, None
dataset/ETHPy150Open wickman/compactor/compactor/httpd.py/WireProtocolMessageHandler.detect_process