def filter_matchable_fields(cite_keys, bib_dbs, desired_fields=["eprint", "doi"]):
    """Select bibtex entries which have certain desired fields.

    To look up an entry in a different database, we need a
    well-known identifier like a DOI or arXiv identifier.  This
    function will select those entries which have enough info (by
    having desired fields) that we can search for them in another DB.
    The return is a mapping from bibkeys to their bib entries, where
    the entries have been stripped down to only the desired well-known
    identifiers.

    Parameters
    ----------
    cite_keys: array of string
      Bibtex keys to filter

    bib_dbs: array of `bibtexparser.bibdatabase.BibDatabase`

    desired_fields: array of string, optional [default: `['eprint', 'doi']`]
      Fields whose presence lets us search in another DB.

    Returns
    -------
    key_mapping: dict
      For a key `ads_key`, the value is a dict which is a filtered bib
      entry.  This resulting dict has keys coming from
      `desired_fields`.  For example, you can access
      `key_mapping[ads_key]['doi']`.
    """

    key_mapping = {}
    for ads_key in cite_keys:
        for bib_db in bib_dbs:
            if ads_key in bib_db.entries_dict:
                entry = bib_db.entries_dict[ads_key]
                filtered_entry = {
                    field: val for field, val in entry.items() if field in desired_fields
                }
                if len(filtered_entry) > 0:
                    key_mapping[ads_key] = filtered_entry

    return key_mapping