def __init__(self, name, context=None):
"""Initializes an instance of a CloudML Job.
Args:
name: the name of the job. It can be an operation full name
("projects/[project_id]/jobs/[operation_name]") or just [operation_name].
context: an optional Context object providing project_id and credentials.
"""
super(Job, self).__init__(name)
if context is None:
context = datalab.Context.default()
self._context = context
self._api = discovery.build('ml', 'v1', credentials=self._context.credentials)
if not name.startswith('projects/'):
name = 'projects/' + self._context.project_id + '/jobs/' + name
self._name = name
self._refresh_state()
评论列表
文章目录