<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def language(fname, is_ext=False):
 """Return an instance of the language class that fname is suited for. Searches through the module langs for the class that matches up with fname. If is_ext is True then fname will be taken to be the extension for a language. """


    global _langmapping

    # Normalize the fname so that it looks like an extension.
    if is_ext:
        fname = '.' + fname
    _, ext = os.path.splitext(fname)

    return _langmapping[ext]()