def fill_package_digests(generated_project: Project) -> Project:
for package_version in chain(generated_project.pipfile_lock.packages, generated_project.pipfile_lock.dev_packages):<EOL><INDENT>if package_version.hashes:<EOL><INDENT>continue<EOL><DEDENT>if package_version.index:<EOL><INDENT>scanned_hashes = package_version.index.get_package_hashes(<EOL>package_version.name, package_version.locked_version<EOL>)<EOL><DEDENT>else:<EOL><INDENT>for source in generated_project.pipfile.meta.sources.values():<EOL><INDENT>try:<EOL><INDENT>scanned_hashes = source.get_package_hashes(package_version.name, package_version.locked_version)<EOL>break<EOL><DEDENT>except Exception:<EOL><INDENT>continue<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT><DEDENT>for entry in scanned_hashes:<EOL><INDENT>package_version.hashes.append("<STR_LIT>" + entry["<STR_LIT>"])<EOL><DEDENT><DEDENT>return generated_project<EOL>
Temporary fill package digests stated in Pipfile.lock.