def load_from_path(path):
if os.path.isdir(path):<EOL><INDENT>paths = discover(path)<EOL><DEDENT>else:<EOL><INDENT>paths = [path]<EOL><DEDENT>for path in paths:<EOL><INDENT>name = os.path.basename(os.path.splitext(path)[<NUM_LIT:0>])<EOL>imp.load_source(name, path)<EOL><DEDENT>
Load a spec from a given path, discovering specs if a directory is given.