<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def init_sources(path):
 """ initializes array of groups and their associated js files """

    for f in dir_list(path):
        if(os.path.splitext(f)[1][1:] == config.source_ext):
            print "Source file discovered: %s" % (f)
            script = Script(f)
            if (script.filename not in config.sources.keys()):
                config.sources[script.path] = script
                parse.parse_dependencies(script,script)