def check_py_syntax(src_path, dst_path):
    """Check the Python syntax."""
    if not os.path.exists(src_path):
        os.makedirs(dst_path)
    good = []
    bad = []
    for file_name in glob.glob(os.path.join(src_path, '*.mochi')):
        mod_name = os.path.splitext(os.path.basename(file_name))[0]
        py_file_name = make_target_file_name(file_name, dst_path, 'py')
        with TempDir(src_path):
            try:
                make_py_source_file(mochi_file_name=file_name,
                                    python_file_name=py_file_name,
                                    mochi_env=MONKEY_PATCH_ENV,
                                    add_init=True, show_tokens=False)
            except __HOLE__ as err:
                print('#' * 30)
                print('Error in module', mod_name)
                print('#' * 30)
                print(err)
                bad.append(mod_name)
                continue
        with TempDir(dst_path):
            try:
                py_compile.compile('{}.py'.format(mod_name), doraise=True)
            except Exception as err:  # pylint: disable=broad-except
                print('#' * 30)
                print('Error in module', mod_name)
                print('#' * 30)
                print(err)
                bad.append(mod_name)
                continue
        good.append(mod_name)

    print('good', good)
    print('bad', bad)
dataset/ETHPy150Open i2y/mochi/tests/check_py_source.py/check_py_syntax