def __init__()

in python-batch/batch.py [0:0]


  def __init__(self, job_id: str, config, env_vars) -> None:
    """
    Class to create all cloud resources for Batch Jobs

    Args:
      job_id: an arbitrary string to name the job.
      config: data structure from YAML to represent everything in the config file.

    Returns:
      None
    """
    self.config = config
    self.job_id = job_id
    self.env_vars = env_vars
    
    #set  "project_id"  based on config, env, or argv in that order.
  
    if self.config["project_id"]: 
      self.project_id = self.config["project_id"] 
    if os.environ.get('GOOGLE_CLOUD_PROJECT'): 
      self.project_id  = os.environ.get('GOOGLE_CLOUD_PROJECT') 
    if FLAGS.project_id:
      self.project_id = FLAGS.project_id

    self.client = batch_v1.BatchServiceClient()