def ListKeyMetadata(self, callback, prefix=None, marker=None,
                      maxkeys=None, fields=None):
    def _OnCompletedGet(response):
      if response.error:
        raise response.error

      ns = '{http://s3.amazonaws.com/doc/2006-03-01/}'
      item_element = '%sContents' % ns
      key_element = '%sKey' % ns

      # build dictionary of wanted fields with ns prefix.
      wanted = {}
      for f in fields:
        wanted['%s%s' % (ns, f)] = f

      results = {}
      bucket_list = ElementTree.XML(response.body)
      for item in bucket_list.iter(item_element):
        item_result = {}
        key = item.find(key_element).text
        assert key is not None, item
        for p in item.iter():
          if p.tag in wanted:
            item_result[wanted[p.tag]] = p.text
        results[key] = item_result
      callback(results)

    params = dict()
    if prefix:
      params['prefix'] = prefix
    if marker:
      params['marker'] = marker
    if maxkeys is not None:
      params['max-keys'] = maxkeys

    self._async_s3_conn.make_request('GET', bucket=self._bucket_name, key='', params=params, callback=_OnCompletedGet)
List files in a S3 bucket and return metadata fields.
dataset/ETHPy150Open viewfinderco/viewfinder/backend/storage/s3_object_store.py/S3ObjectStore.ListKeyMetadata