def guess_extension(amimetype, normalize=False):
ext = _mimes.guess_extension(amimetype)<EOL>if ext and normalize:<EOL><INDENT>ext = {'<STR_LIT>': '<STR_LIT>', '<STR_LIT>': '<STR_LIT>'}.get(ext, ext)<EOL>from invenio.legacy.bibdocfile.api_normalizer import normalize_format<EOL>return normalize_format(ext)<EOL><DEDENT>return ext<EOL>
Tries to guess extension for a mimetype.

@param amimetype: name of a mimetype
@time amimetype: string
@return: the extension
@rtype: string