# Path: pytaxize/ids/format_helpers.py
# def _make_id(id_, name, rank, type_):
#     uri = None
#     if id_ is not None:
#         uri = _make_id_uri(rank, type_, id_)
# 
#     return {"id": id_, "name": name, "rank": rank, "uri": uri}


from pygbif import species
from .format_helpers import _make_id


def gbif_query_for_single_name(name, rank):
    response = species.name_usage(name=name, rank=rank.upper())["results"]
    return response


def process_gbif_response(list_of_response_dicts, rank):
    key = rank + "Key"
    extracted_ids = list(
        map(

# Path: pytaxize/ids/format_helpers.py
# def _make_id(id_, name, rank, type_):
#     uri = None
#     if id_ is not None:
#         uri = _make_id_uri(rank, type_, id_)
# 
#     return {"id": id_, "name": name, "rank": rank, "uri": uri}


# Path: pytaxize/ids/gbif_helpers.py
from pygbif import species
from .format_helpers import _make_id



def gbif_query_for_single_name(name, rank):
    response = species.name_usage(name=name, rank=rank.upper())["results"]
    return response


def process_gbif_response(list_of_response_dicts, rank):
    key = rank + "Key"
    extracted_ids = list(
        map(

            lambda x: _make_id(x.get(key, None), x.get(rank, None), rank, "gbif"),