code: def rename_file(pdf, bibitem):
      
      year = _get_bib_element(bibitem, "year")
      author = _get_bib_element(bibitem, "author")
      if author:
          author = author.split(",")[0]
      title = _get_bib_element(bibitem, "title")
      l = [i for i in (year, author, title) if i]
      filename = "-".join(l) + ".pdf"
      newfile = pdf.replace(os.path.basename(pdf), filename)
      logger.info('Renaming {in_} to {out}'.format(in_=pdf, out=newfile))
      os.rename(pdf, newfile)
docs: Attempt to rename pdf according to bibitem.