#NEWLINE# def guess_mimetype( filename ) : #NEWLINE# #INDENT# "\n    Guesses the mimetype of a file, based on the filename\n\n    >>> guess_mimetype('example.txt')\n    'text/plain'\n    >>> guess_mimetype('/foo/bar/example')\n    'application/octet-stream'\n    " #NEWLINE# fn = os . path . basename ( filename ) #NEWLINE# return ( mimetypes . guess_type ( filename ) [ 0 ] or 'application/octet-stream' )