(path)
return namespace
Run the given script and return its symbols.

    The path of the script is interpreted relatively to the current
    script directory. If it points to an directory, then it will be
    assumed that the script to load is a file named 'cook.py'.

    Loading the same script multiple times will not execute it more
    than once - instead the last result will be returned.

    A RuntimeError will be raised if a cycle is detected.
Run the given script and return its symbols.
Run the given script and return its symbols .
def load(path):
    """Run the given script and return its symbols.

    The path of the script is interpreted relatively to the current
    script directory. If it points to an directory, then it will be
    assumed that the script to load is a file named 'cook.py'.

    Loading the same script multiple times will not execute it more
    than once - instead the last result will be returned.

    A RuntimeError will be raised if a cycle is detected.
    """
    path = abspath(resolve(path))
    if isdir(path):
        directory = path
        path = join(directory, 'BUILD.py')
    else:
        directory = dirname(path)

    if path in executing:
        raise RuntimeError('detected cyclic dependency at "{}"'.format(path))
    if path in loaded:
        return loaded[path]
    if not isfile(path):
        raise FileNotFoundError(path)

    events.on_load(path)
    directories.append(directory)
    executing.add(path)

    with open(path) as f:
        content = f.read()
    symbols = {'__file__': path}
    exec(compile(content, path, 'exec'), symbols)

    directories.pop()
    executing.remove(path)
    events.on_loaded(path)

    namespace = Script(path, symbols)
    loaded[path] = namespace
    return namespace
def load ( path ) : path = abspath ( resolve ( path ) ) if isdir ( path ) : directory = path path = join ( directory , 'BUILD.py' ) else : directory = dirname ( path ) if path in executing : raise RuntimeError ( 'detected cyclic dependency at "{}"' . format ( path ) ) if path in loaded : return loaded [ path ] if not isfile ( path ) : raise FileNotFoundError ( path ) events . on_load ( path ) directories . append ( directory ) executing . add ( path ) with open ( path ) as f : content = f . read ( ) symbols = { '__file__' : path } exec ( compile ( content , path , 'exec' ) , symbols ) directories . pop ( ) executing . remove ( path ) events . on_loaded ( path ) namespace = Script ( path , symbols ) loaded [ path ] = namespace return namespace