<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def dynare_import(filename,full_output=False, debug=False):
    '''Imports model defined in specified file'''
    import os
    basename = os.path.basename(filename)
    fname = re.compile('(.*)\.(.*)').match(basename).group(1)
    f = open(filename)
    txt = f.read()
    model = parse_dynare_text(txt,full_output=full_output, debug=debug)
    model.name = fname
    return model