<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def delete(filename, identifier):
 """ Delete an entry in a BibTeX file. :param filename: The name of the BibTeX file to edit. :param identifier: The id of the entry to delete, in the BibTeX file. """

    # Get current bibtex
    with open(filename, 'r') as fh:
        bibtex = bibtexparser.load(fh)

    # Delete the bibtex entry
    # TODO: Not working
    try:
        del bibtex.entries_dict[identifier]
    except KeyError:
        pass

    # Write the resulting BibTeX
    write(filename, bibtex)