def METHOD_NAME():
    project_root = Path.cwd()
    pipfile_path = project_root / "Pipfile"
    if not pipfile_path.exists():
        raise FileNotFoundError("Pipfile not found.")
    pipfile = toml.load(pipfile_path)
    for key in ["packages", "dev-packages"]:
        if not is_pipfile_packages(pipfile[key]):
            raise TypeError("Failed to cast to PipfilePackages: " + str(pipfile[key]))
        pipfile[key] = fix_package_version(pipfile[key])
        # プロジェクト内のPythonファイルでimportされているがPipfile内には存在しないパッケージをPipfileの「packages」セクションに追加する
        if key == "packages":
            pipfile[key] |= get_missing_packages(
                get_imported_packages(project_root), get_pipfile_packages(pipfile)
            )
    with open(pipfile_path, "w") as f:
        toml.dump(pipfile, f)