<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def file_modified(event):
 """ react to file events """

    if re.match(config.file_regex,event.name) or (event.name in config.sources.keys()):
        print "Change detected to: %s" % (event.name)
        config.stack = []
        script = config.sources[event.name]
        if script.extension == config.source_ext:
            parse.parse_file(script)
        else:
            parse.parse_parents(script)