code: def _format_task_uri(fmt, job_metadata, task_metadata):
    
  
    values = {
        'job-id': None,
        'task-id': 'task',
        'job-name': None,
        'user-id': None,
        'task-attempt': None
    }
    for key in values:
      values[key] = task_metadata.get(key) or job_metadata.get(key) or values[key]
  
    return fmt.format(**values)
docs: Returns a URI with placeholders replaced by metadata values.