def extract_gcs_tokens(full_object_name):
 bucket_name = None
 object_name = None
 tokens = full_object_name.split('/')
 if (len(tokens) < 3):
  logging.error("Malformed GCS path '{0}'. Aborting GCS operation.".format(full_object_name))
  return (bucket_name, object_name)
 bucket_name = tokens[2]
 object_name = ''
 for token in tokens[3:(-1)]:
  object_name += (token + '/')
 object_name += tokens[(-1)]
 return (bucket_name, object_name)

def extract_gcs_tokens ( full_object_name ) : bucket_name = None object_name = None tokens = full_object_name . split ( '/' ) if ( len ( tokens ) < 3 ) : logging . error ( "Malformed GCS path '{0}'. Aborting GCS operation." . format ( full_object_name ) ) return ( bucket_name , object_name ) bucket_name = tokens [ 2 ] object_name = '' for token in tokens [ 3 : ( - 1 ) ] : object_name += ( token + '/' ) object_name += tokens [ ( - 1 ) ] return ( bucket_name , object_name )
extracts the bucket and object name from a full gcs path .