def _find_dirs(metadata):
 ret = {}
 for (bucket_name, data) in six.iteritems(metadata):
  if (bucket_name not in ret):
   ret[bucket_name] = set()
  for path in [k['Key'] for k in data]:
   prefix = ''
   for part in path.split('/')[:(-1)]:
    directory = ((prefix + part) + '/')
    ret[bucket_name].add(directory)
    prefix = directory
 return ret

def _find_dirs ( metadata ) : ret = { } for ( bucket_name , data ) in six . iteritems ( metadata ) : if ( bucket_name not in ret ) : ret [ bucket_name ] = set ( ) for path in [ k [ 'Key' ] for k in data ] : prefix = '' for part in path . split ( '/' ) [ : ( - 1 ) ] : directory = ( ( prefix + part ) + '/' ) ret [ bucket_name ] . add ( directory ) prefix = directory return ret
looks for all the directories in the s3 bucket cache metadata .