code: def package_version(package_name: str) -> typing.Optional[str]:
      
  
      try:
          return pkg_resources.get_distribution(package_name).version
      except (pkg_resources.DistributionNotFound, AttributeError):
          return None
docs: Returns package version as a string, or None if it couldn't be found.