code: def set_environment(self, environment=None):
          
          if environment is None:
              environment = os.environ
          environment[env.RUN_ID] = self.id
          environment[env.RESUME] = self.resume
          if self.storage_id:
              environment[env.RUN_STORAGE_ID] = self.storage_id
          environment[env.MODE] = self.mode
          environment[env.RUN_DIR] = self.dir
  
          if self.group:
              environment[env.RUN_GROUP] = self.group
          if self.job_type:
              environment[env.JOB_TYPE] = self.job_type
          if self.wandb_dir:
              environment[env.DIR] = self.wandb_dir
          if self.sweep_id is not None:
              environment[env.SWEEP_ID] = self.sweep_id
          if self.program is not None:
              environment[env.PROGRAM] = self.program
          if self.args is not None:
              environment[env.ARGS] = json.dumps(self.args)
          if self.name_and_description is not None:
              environment[env.DESCRIPTION] = self.name_and_description
          if len(self.tags) > 0:
              environment[env.TAGS] = ",".join(self.tags)
docs: Set environment variables needed to reconstruct this object inside
          a user scripts (eg. in `wandb.init()`).