'Return the most appropriate Response class from a file name'

def from_filename(self, filename):

    (mimetype, encoding) = self.mimetypes.guess_type(filename)
    if (mimetype and (not encoding)):
        return self.from_mimetype(mimetype)
    else:
        return Response
