code: def load_bucket_inventory(
          client, inventory_bucket, inventory_prefix, versioned, ifilters):
      
      now = datetime.datetime.now()
      key_prefix = "%s/%s" % (inventory_prefix, now.strftime('%Y-%m-'))
      keys = client.list_objects(
          Bucket=inventory_bucket, Prefix=key_prefix).get('Contents', [])
      keys = [k['Key'] for k in keys if k['Key'].endswith('.json')]
      keys.sort()
      if not keys:
          # no manifest delivery
          return None
      latest_manifest = keys[-1]
      manifest = client.get_object(Bucket=inventory_bucket, Key=latest_manifest)
      manifest_data = json.load(manifest['Body'])
  
      # schema as column name to column index mapping
      schema = dict([(k, i) for i, k in enumerate(
          [n.strip() for n in manifest_data['fileSchema'].split(',')])])
  
      processor = functools.partial(
          load_manifest_file, client, inventory_bucket,
          schema, versioned, ifilters)
      generators = map(processor, manifest_data.get('files', ()))
      return random_chain(generators)
docs: Given an inventory location for a bucket, return an iterator over keys
  
      on the most recent delivered manifest.