def status_to_code(status): try: return coll_status.keys()[list(coll_status.values()).index(status)] except: return -1