def get_group_dataset_counts():
 query = search.PackageSearchQuery()
 q = {'q': '+capacity:public', 'fl': 'groups', 'facet.field': ['groups', 'owner_org'], 'facet.limit': (-1), 'rows': 1}
 query.run(q)
 return query.facets

def get_group_dataset_counts ( ) : query = search . PackageSearchQuery ( ) q = { 'q' : '+capacity:public' , 'fl' : 'groups' , 'facet.field' : [ 'groups' , 'owner_org' ] , 'facet.limit' : ( - 1 ) , 'rows' : 1 } query . run ( q ) return query . facets
for all public groups .