def __init__(self, url_string):
    self.scheme = None
    self.bucket_name = None
    self.object_name = None
    self.generation = None
    self.delim = '/'
    provider_match = PROVIDER_REGEX.match(url_string)
    bucket_match = BUCKET_REGEX.match(url_string)
    if provider_match:
      self.scheme = provider_match.group('provider')
    elif bucket_match:
      self.scheme = bucket_match.group('provider')
      self.bucket_name = bucket_match.group('bucket')
      if (not ContainsWildcard(self.bucket_name) and
          (not BUCKET_NAME_RE.match(self.bucket_name) or
           TOO_LONG_DNS_NAME_COMP.search(self.bucket_name))):
        raise InvalidUrlError('Invalid bucket name in URL "%s"' % url_string)
    else:
      object_match = OBJECT_REGEX.match(url_string)
      if object_match:
        self.scheme = object_match.group('provider')
        self.bucket_name = object_match.group('bucket')
        self.object_name = object_match.group('object')
        if self.scheme == 'gs':
          generation_match = GS_GENERATION_REGEX.match(self.object_name)
          if generation_match:
            self.object_name = generation_match.group('object')
            self.generation = generation_match.group('generation')
        elif self.scheme == 's3':
          version_match = S3_VERSION_REGEX.match(self.object_name)
          if version_match:
            self.object_name = version_match.group('object')
            self.generation = version_match.group('version_id')
      else:
        raise InvalidUrlError(
            url_string % 'CloudUrl: URL string %s did not match URL regex')
dataset/ETHPy150Open GoogleCloudPlatform/gsutil/gslib/storage_url.py/_CloudUrl.__init__/swapped operands of `%`