def MakeGcsObjectOrPathUri(uri):
    'Creates Google Cloud Storage URI for an object or a path.\n\n  Raises storage_util.InvalidObjectNameError if a path contains only bucket\n  name.\n\n  Args:\n    uri: a string to a Google Cloud Storage object or a path. Can be a gs:// or\n         an https:// variant.\n\n  Returns:\n    Google Cloud Storage URI for an object or a path.\n  '
    obj_ref = resources.REGISTRY.Parse(uri)
    if hasattr(obj_ref, 'object'):
        return 'gs://{0}/{1}'.format(obj_ref.bucket, obj_ref.object)
    else:
        raise storage_util.InvalidObjectNameError(uri, 'Missing object name')
Creates Google Cloud Storage URI for an object or a path.

Raises storage_util.InvalidObjectNameError if a path contains only bucket
name.

Args:
  uri: a string to a Google Cloud Storage object or a path. Can be a gs:// or
       an https:// variant.

Returns:
  Google Cloud Storage URI for an object or a path.
def MakeGcsObjectOrPathUri(uri):
    'Creates Google Cloud Storage URI for an object or a path.\n\n  Raises storage_util.InvalidObjectNameError if a path contains only bucket\n  name.\n\n  Args:\n    uri: a string to a Google Cloud Storage object or a path. Can be a gs:// or\n         an https:// variant.\n\n  Returns:\n    Google Cloud Storage URI for an object or a path.\n  '
    obj_ref = resources.REGISTRY.Parse(uri)
    if hasattr(obj_ref, 'object'):
        return 'gs://{0}/{1}'.format(obj_ref.bucket, obj_ref.object)
    else:
        raise storage_util.InvalidObjectNameError(uri, 'Missing object name')