def from_oct(args):
    """Create a new oct project

    :param Namespace args: the command line arguments
    """
    project_name = args.name
    env = Environment(loader=PackageLoader('oct.utilities', 'templates'))

    config_content = env.get_template('configuration/config.json').render(script_name='v_user.py')
    script_content = env.get_template('scripts/v_user.j2').render()

    try:
        os.makedirs(project_name)
        os.makedirs(os.path.join(project_name, 'test_scripts'))
        os.makedirs(os.path.join(project_name, 'templates'))
        os.makedirs(os.path.join(project_name, 'templates', 'img'))

        shutil.copytree(os.path.join(BASE_DIR, 'templates', 'css'),
                        os.path.join(project_name, 'templates', 'css'))
        shutil.copytree(os.path.join(BASE_DIR, 'templates', 'javascript'),
                        os.path.join(project_name, 'templates', 'scripts'))

        shutil.copy(os.path.join(BASE_DIR, 'templates', 'html', 'report.html'),
                    os.path.join(project_name, 'templates'))
    except OSError:
        print('ERROR: can not create directory for %r' % project_name, file=sys.stderr)
        raise
    with open(os.path.join(project_name, 'config.json'), 'w') as f:
        f.write(config_content)
    with open(os.path.join(project_name, 'test_scripts', 'v_user.py'), 'w') as f:
        f.write(script_content)
dataset/ETHPy150Open TheGhouls/oct/oct/utilities/newproject.py/from_oct/original