def _process_path_prefix(path_prefix):
 _validate_path(path_prefix)
 if (not _GCS_PATH_PREFIX_REGEX.match(path_prefix)):
  raise ValueError(('Path prefix should have format /bucket, /bucket/, or /bucket/prefix but got %s.' % path_prefix))
 bucket_name_end = path_prefix.find('/', 1)
 bucket = path_prefix
 prefix = None
 if (bucket_name_end != (-1)):
  bucket = path_prefix[:bucket_name_end]
  prefix = (path_prefix[(bucket_name_end + 1):] or None)
 return (bucket, prefix)

def _process_path_prefix ( path_prefix ) : _validate_path ( path_prefix ) if ( not _GCS_PATH_PREFIX_REGEX . match ( path_prefix ) ) : raise ValueError ( ( 'Path prefix should have format /bucket, /bucket/, or /bucket/prefix but got %s.' % path_prefix ) ) bucket_name_end = path_prefix . find ( '/' , 1 ) bucket = path_prefix prefix = None if ( bucket_name_end != ( - 1 ) ) : bucket = path_prefix [ : bucket_name_end ] prefix = ( path_prefix [ ( bucket_name_end + 1 ) : ] or None ) return ( bucket , prefix )
validate and process a google cloud stoarge path prefix .