def parse_gs_handle(gs_handle):
 if gs_handle.startswith('/'):
  filesystem = gs_handle[1:].split('/', 1)[0]
  if (filesystem == 'gs'):
   gs_handle = gs_handle[4:]
  else:
   raise BackupValidationException(('Unsupported filesystem: %s' % filesystem))
 tokens = gs_handle.split('/', 1)
 return ((tokens[0], '') if (len(tokens) == 1) else tuple(tokens))

def parse_gs_handle ( gs_handle ) : if gs_handle . startswith ( '/' ) : filesystem = gs_handle [ 1 : ] . split ( '/' , 1 ) [ 0 ] if ( filesystem == 'gs' ) : gs_handle = gs_handle [ 4 : ] else : raise BackupValidationException ( ( 'Unsupported filesystem: %s' % filesystem ) ) tokens = gs_handle . split ( '/' , 1 ) return ( ( tokens [ 0 ] , '' ) if ( len ( tokens ) == 1 ) else tuple ( tokens ) )
splits [/gs/]?bucket_name[/folder]*[/file]? to .