(provider, user_id, job_name, script, task_ids,
                      user_project, unique_job_id)
return job_metadata
Allow provider to extract job-specific metadata from command-line args.

  Args:
    provider: job service provider
    user_id: user submitting the job
    job_name: name for the job
    script: the script to run
    task_ids: a set of the task-ids for all tasks in the job
    user_project: name of the project to be billed for the request
    unique_job_id: generate a unique job id

  Returns:
    A dictionary of job-specific metadata (such as job id, name, etc.)
Allow provider to extract job-specific metadata from command-line args.
Allow provider to extract job - specific metadata from command - line args .
def _get_job_metadata(provider, user_id, job_name, script, task_ids,
                      user_project, unique_job_id):
  """Allow provider to extract job-specific metadata from command-line args.

  Args:
    provider: job service provider
    user_id: user submitting the job
    job_name: name for the job
    script: the script to run
    task_ids: a set of the task-ids for all tasks in the job
    user_project: name of the project to be billed for the request
    unique_job_id: generate a unique job id

  Returns:
    A dictionary of job-specific metadata (such as job id, name, etc.)
  """
  create_time = dsub_util.replace_timezone(datetime.datetime.now(),
                                           dateutil.tz.tzlocal())
  user_id = user_id or dsub_util.get_os_user()
  job_metadata = provider.prepare_job_metadata(script.name, job_name, user_id)
  if unique_job_id:
    job_metadata['job-id'] = uuid.uuid4().hex
  else:
    # Build the job-id. We want the job-id to be expressive while also
    # having a low-likelihood of collisions.
    #
    # For expressiveness, we:
    # * use the job name (truncated at 10 characters).
    # * insert the user-id
    # * add a datetime value
    # To have a high likelihood of uniqueness, the datetime value is out to
    # hundredths of a second.
    #
    # The full job-id is:
    #   <job-name>--<user-id>--<timestamp>
    job_metadata['job-id'] = '%s--%s--%s' % (
        job_metadata['job-name'][:10], job_metadata['user-id'],
        create_time.strftime('%y%m%d-%H%M%S-%f')[:16])

  job_metadata['create-time'] = create_time
  job_metadata['script'] = script
  job_metadata['user-project'] = user_project
  if task_ids:
    job_metadata['task-ids'] = dsub_util.compact_interval_string(list(task_ids))

  return job_metadata
def _get_job_metadata ( provider , user_id , job_name , script , task_ids , user_project , unique_job_id ) : create_time = dsub_util . replace_timezone ( datetime . datetime . now ( ) , dateutil . tz . tzlocal ( ) ) user_id = user_id or dsub_util . get_os_user ( ) job_metadata = provider . prepare_job_metadata ( script . name , job_name , user_id ) if unique_job_id : job_metadata [ 'job-id' ] = uuid . uuid4 ( ) . hex else : # Build the job-id. We want the job-id to be expressive while also # having a low-likelihood of collisions. # # For expressiveness, we: # * use the job name (truncated at 10 characters). # * insert the user-id # * add a datetime value # To have a high likelihood of uniqueness, the datetime value is out to # hundredths of a second. # # The full job-id is: #   <job-name>--<user-id>--<timestamp> job_metadata [ 'job-id' ] = '%s--%s--%s' % ( job_metadata [ 'job-name' ] [ : 10 ] , job_metadata [ 'user-id' ] , create_time . strftime ( '%y%m%d-%H%M%S-%f' ) [ : 16 ] ) job_metadata [ 'create-time' ] = create_time job_metadata [ 'script' ] = script job_metadata [ 'user-project' ] = user_project if task_ids : job_metadata [ 'task-ids' ] = dsub_util . compact_interval_string ( list ( task_ids ) ) return job_metadata