code: def headless(args):
      
      user_process_pid = args['pid']
      stdout_master_fd = args['stdout_master_fd']
      stderr_master_fd = args['stderr_master_fd']
  
      try:
          run = wandb.wandb_run.Run.from_environment_or_defaults()
          run.enable_logging()
  
          api = wandb.apis.InternalApi()
          api.set_current_run_id(run.id)
  
          rm = wandb.run_manager.RunManager(
              api, run, cloud=args['cloud'],
              port=args['port'])
          rm.wrap_existing_process(
              user_process_pid, stdout_master_fd, stderr_master_fd)
      except Exception as e:
          util.sentry_reraise(e)
docs: Headless mode is where we start a monitoring / syncing
      process to watch an already-running user process. It's like
      `wandb run` for a user process that has already started.
  
      The user process that calls this waits for a signal that
      everything is ready, which is sent at the end of rm.wrap_existing_process