code: def write(filename, data):
      
      with open(filename, 'w') as fh:
          fh.write(bibdatabase2bibtex(data))
docs: Create a new BibTeX file.
  
      :param filename: The name of the BibTeX file to write.
      :param data: A ``bibtexparser.BibDatabase`` object.