class_docstr: Runs jobs locally as a subprocess.
  
  Args:
      submit_options (str): options appended before the command.
      resources (list[str]): list of resources that will be passed as
          SHERPA_RESOURCE environment variable. If no resource is 
          available '' will be passed.
class_docstr_tok: ["Runs","jobs","locally","as","a","subprocess",".","Args",":","submit_options","(","str",")",":","options","appended","before","the","command",".","resources","(","list","[","str","]",")",":","list","of","resources","that","will","be","passed","as","SHERPA_RESOURCE","environment","variable",".","If","no","resource","is","available","``","will","be","passed","."]
code: def submit_job(self, command, env={}, job_name=""):
      outdir = os.path.join(self.output_dir, "jobs")
      if not os.path.isdir(outdir):
          os.mkdir(outdir)
  
      env.update(os.environ.copy())
      if self.resources is not None:
          env["SHERPA_RESOURCE"] = str(self.resources.pop())
      else:
          env["SHERPA_RESOURCE"] = ""
  
      f = open(os.path.join(outdir, "{}.out".format(job_name)), "w")
      optns = (
          self.submit_options.split(" ") if self.submit_options else []
      )
      process = subprocess.Popen(
          optns + command, env=env, stderr=f, stdout=f
      )
      self.jobs[process.pid] = process
      self.output_files[process.pid] = f
      if self.resources is not None:
          self.resource_by_job[process.pid] = env["SHERPA_RESOURCE"]
      return process.pid
  
imports: import subprocess
  import re
  import sys
  import os
  import logging
label_desc: Use image node_id 2 for calling the LocalScheduler obj's underlying member method code with example usage: obj.submit_job(command, env, job_name) and returns: process