def __init__()

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


  def __init__(self, job_id: str, config, previous_job_id=None) -> None:
      """Class to create Pub/Sub related cloud resources.

      Used to create a topic and a subscription. 
      Topic name identical to job_id and subscription is `sub-` + job_id.

      Args: 
          config: 
            Contains the structure defined by the Config.yaml file. 
          job_id: 
            The name of the job, which becomes the name of the pubsub topic.

      Raises:
        None

      `project_id` is set  based on config, env, or argv in that order.
      """
      self.config = config
      self.job_id = job_id

      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

      """
      Sending messages to the same region ensures they are received in order
      even when multiple publishers are used.
      """
      publisher_options = pubsub_v1.types.PublisherOptions(enable_message_ordering=True)
      client_options = {"api_endpoint": f'{self.config["region"]}-pubsub.googleapis.com:443'}
      self.publisher = pubsub_v1.PublisherClient(
          publisher_options=publisher_options, client_options=client_options
      )