class_docstr: An `Executor` takes a `ScenarioState` which has a bunch of requests.
  Issue them to the API and return the results.
class_docstr_tok: ["An","`","Executor","`","takes","a","`","ScenarioState","`","which","has","a","bunch","of","requests",".","Issue","them","to","the","API","and","return","the","results","."]
code: def __init__(self, execution_spec: ExecutionSpec):
      self.execution_spec = execution_spec
  
      self.service: Service
      if execution_spec.local:
          assert (
              execution_spec.local_path
          ), "local=True. Need to specify a value for `local_path`."
          hlog(
              f"Running locally in root mode with local path: {execution_spec.local_path}"
          )
          self.service = ServerService(
              base_path=execution_spec.local_path,
              root_mode=True,
              mongo_uri=execution_spec.mongo_uri,
          )
      else:
          assert (
              execution_spec.url
          ), "local=False. Need to specify the URL of proxy server (`url`)."
          self.service = RemoteService(self.execution_spec.url)
  
file_path: H2O/h2o_hf/helm/src/helm/benchmark/executor.py
imports: from typing import Optional
  from dataclasses import dataclass, replace
  from helm.common.general import parallel_map
  from helm.common.hierarchical_logger import htrack, hlog
  from helm.common.request import RequestResult, Sequence
  from helm.common.authentication import Authentication
  from helm.proxy.services.remote_service import RemoteService
  from helm.proxy.services.server_service import ServerService
  from helm.proxy.services.service import Service
  from helm.benchmark.adaptation.scenario_state import ScenarioState
  from helm.benchmark.adaptation.request_state import RequestState
label_desc: Use image node_id 1 to create a new Executor object  with example: obj = Executor(execution_spec)