<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_file(filename, mime=False):
 """" Accepts a filename and returns the detected filetype. Return value is the mimetype if mime=True, otherwise a human readable name. 'application/pdf' """

    m = _get_magic_type(mime)
    return m.from_file(filename)