def create_community(name): global communities community = Community() cid = new_integer_key(communities) community.set('cid', cid) community.set('name', name) communities[cid] = community return community