def get_content_type(filename):
 return (mimetypes.guess_type(filename)[0] or 'application/octet-stream')

def get_content_type ( filename ) : return ( mimetypes . guess_type ( filename ) [ 0 ] or 'application/octet-stream' )
returns the full content type string with charset for a mimetype .