code: def handle(self):
      
      # Parse the Nailgun request portion.
      _, _, arguments, environment = NailgunProtocol.parse_request(self.request)
  
      # N.B. the first and second nailgun request arguments (working_dir and command) are currently
      # ignored in favor of a get_buildroot() call within LocalPantsRunner.run() and an assumption
      # that anyone connecting to this nailgun server always intends to run pants itself.
  
      # Prepend the command to our arguments so it aligns with the expected sys.argv format of python
      # (e.g. [list', '::'] -> ['./pants', 'list', '::']).
      arguments.insert(0, './pants')
  
      self.logger.info('handling pailgun request: `{}`'.format(' '.join(arguments)))
      self.logger.debug('pailgun request environment: %s', environment)
  
      # Execute the requested command with optional daemon-side profiling.
      with maybe_profiled(environment.get('PANTSD_PROFILE')):
        self._run_pants(self.request, arguments, environment)
  
      # NB: This represents the end of pantsd's involvement in the request, but the request will
      # continue to run post-fork.
      self.logger.info('pailgun request completed: `{}`'.format(' '.join(arguments)))
docs: Request handler for a single Pailgun request.