def METHOD_NAME(cloudpath):
  global ALLOWED_PROTOCOLS
  error = UnsupportedProtocolError(cloudpath_error(cloudpath))
  (proto, cloudpath) = pop_protocol(cloudpath)
  if proto is None:
    raise error # e.g. ://test_bucket, test_bucket, wow//test_bucket
  fmt, protocol = None, None
  if proto not in (ALLOWED_PROTOCOLS + ALLOWED_FORMATS):
    cloudfiles.paths.update_aliases_from_file()
    ALLOWED_PROTOCOLS = cloudfiles.paths.ALLOWED_PROTOCOLS
  if proto in ALLOWED_PROTOCOLS:
    fmt = 'precomputed'
    protocol = proto 
  elif proto in ALLOWED_FORMATS:
    fmt = proto
  (proto, cloudpath) = pop_protocol(cloudpath)
  if proto not in (ALLOWED_PROTOCOLS + ALLOWED_FORMATS):
    cloudfiles.paths.update_aliases_from_file()
    ALLOWED_PROTOCOLS = cloudfiles.paths.ALLOWED_PROTOCOLS
  if proto in ALLOWED_FORMATS:
    raise error # e.g. gs://graphene://
  elif proto in ALLOWED_PROTOCOLS:
    if protocol is None:
      protocol = proto
    else:
      raise error # e.g. gs://gs:// 
  (proto, cloudpath) = pop_protocol(cloudpath)
  if proto is not None:
    raise error # e.g. gs://gs://gs://
  if protocol is None:
    raise error
  return (fmt, protocol, cloudpath)