def _role_type_to_db_type(type_):
with db_connect() as db_conn:<EOL><INDENT>with db_conn.cursor() as cursor:<EOL><INDENT>cursor.execute("""<STR_LIT>""")<EOL>db_types = cursor.fetchone()[<NUM_LIT:0>]<EOL><DEDENT><DEDENT>return dict(list(zip(cnxepub.ATTRIBUTED_ROLE_KEYS, db_types)))[type_]<EOL>
Translates a role type (a value found in
    ``cnxepub.ATTRIBUTED_ROLE_KEYS``) to a database compatible
    value for ``role_types``.