def create_directory()

in neural/utils_mous.py [0:0]


def create_directory(path, overwrite=False):
    '''Create (or check for, or overwrite) directory.
    Input:
        path (str): path of the repository to be created
        overwrite (bool): default False
    '''
    # if it is not there, create it
    if not os.path.exists(path):
        os.makedirs(path)

    # if it is there and overwrite, remove then recreate
    if os.path.exists(path) and overwrite:
        shutil.rmtree(path)
        os.makedirs(path)