def __init__(self, name, context=None): """Initializes an instance of a DataSet. Args: name: the name of the dataset, as a string or (project_id, dataset_id) tuple. context: an optional Context object providing project_id and credentials. If a specific project id or credentials are unspecified, the default ones configured at the global level are used. Raises: Exception if the name is invalid. """ if context is None: context = gcp.Context.default() self._context = context self._api = _api.Api(context) self._name_parts = _utils.parse_dataset_name(name, self._api.project_id) self._full_name = '%s:%s' % self._name_parts self._info = None try: self._info = self._get_info() except gcp._util.RequestException: pass