def get_belns_handle(client, username=None, password=None):
(username, password) = get_user_creds(username, password)<EOL>sys_db = client.db("<STR_LIT>", username=username, password=password)<EOL>try:<EOL><INDENT>if username and password:<EOL><INDENT>belns_db = sys_db.create_database(<EOL>name=belns_db_name,<EOL>users=[{"<STR_LIT:username>": username, "<STR_LIT:password>": password, "<STR_LIT>": True}],<EOL>)<EOL><DEDENT>else:<EOL><INDENT>belns_db = sys_db.create_database(name=belns_db_name)<EOL><DEDENT><DEDENT>except arango.exceptions.DatabaseCreateError:<EOL><INDENT>if username and password:<EOL><INDENT>belns_db = client.db(belns_db_name, username=username, password=password)<EOL><DEDENT>else:<EOL><INDENT>belns_db = client.db(belns_db_name)<EOL><DEDENT><DEDENT>try:<EOL><INDENT>belns_db.create_collection(belns_metadata_name)<EOL><DEDENT>except Exception:<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>equiv_nodes = belns_db.create_collection(<EOL>equiv_nodes_name, index_bucket_count=<NUM_LIT:64><EOL>)<EOL>equiv_nodes.add_hash_index(fields=["<STR_LIT:name>"], unique=True)<EOL><DEDENT>except Exception:<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>belns_db.create_collection(equiv_edges_name, edge=True, index_bucket_count=<NUM_LIT:64>)<EOL><DEDENT>except Exception:<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>ortholog_nodes = belns_db.create_collection(<EOL>ortholog_nodes_name, index_bucket_count=<NUM_LIT:64><EOL>)<EOL>ortholog_nodes.add_hash_index(fields=["<STR_LIT:name>"], unique=True)<EOL><DEDENT>except Exception:<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>belns_db.create_collection(<EOL>ortholog_edges_name, edge=True, index_bucket_count=<NUM_LIT:64><EOL>)<EOL><DEDENT>except Exception:<EOL><INDENT>pass<EOL><DEDENT>return belns_db<EOL>
Get BEL namespace arango db handle