def content_type(filename):
    ct = 'text/plain'
    ct_guess = mimetypes.guess_type(filename)

    if ct_guess[0] is not None:
        ct = ct_guess[0]

    return ct
Takes a guess at what the desired mime type might be for the requested file.
dataset/ETHPy150Open toastdriven/itty/itty.py/content_type