code: def bibtex(self):
          
          m = max(itertools.chain(map(len, self), [0]))
          fields = ("  %s = {%s}" % (k.ljust(m), self[k]) for k in self)
          return "@%s{%s,\n%s\n}" % (
              getattr(self.genre, 'value', self.genre), self.id, ",\n".join(fields))
docs: Represent the source in BibTeX format.
  
          :return: string encoding the source in BibTeX syntax.