_job.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:pydatalab 作者: googledatalab 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号