code: def get_package_update_list(package_name, version):
      package_version = semantic_version.Version.coerce(version)
      package_data = get_pypi_package_data(package_name)
      version_data = get_pypi_package_data(package_name, version)
      current_release = ''
      current_release_license = ''
      latest_release = ''
      latest_release_license = ''
      major_updates = []
      minor_updates = []
      patch_updates = []
      pre_releases = []
      non_semantic_versions = []
      if package_data:
          latest_release = package_data['info']['version']
          latest_release_license = package_data['info']['license'] if package_data['info']['license'] else ''
          for release, info in package_data['releases'].items():
              parsed_release = parse(release)
              upload_time = None
              if info:
                  upload_time = datetime.strptime(info[0]['upload_time'], "%Y-%m-%dT%H:%M:%S")
              try:
                  release_version = semantic_version.Version.coerce(release)
                  if not parsed_release.is_prerelease:
                      if release_version in semantic_version.Spec(">=%s" % package_version.next_major()):
                          major_updates.append({
                              'version': release,
                              'upload_time': upload_time,
                          })
                      elif release_version in semantic_version.Spec(">=%s,<%s" % (package_version.next_minor(), package_version.next_major())):
                          minor_updates.append({
                              'version': release,
                              'upload_time': upload_time,
                          })
                      elif release_version in semantic_version.Spec(">=%s,<%s" % (package_version.next_patch(), package_version.next_minor())):
                          patch_updates.append({
                              'version': release,
                              'upload_time': upload_time,
                          })
                  else:
                      pre_releases.append({
                          'version': release,
                          'upload_time': upload_time
                      })
              except ValueError:
                  non_semantic_versions.append({'version': release, 'upload_time': upload_time})
      if version_data:
          current_release = version_data['info']['version']
          current_release_license = version_data['info']['license'] if version_data['info']['license'] else ''
      newer_releases = len(major_updates + minor_updates + patch_updates)
      return {
          'current_release': current_release,
          'current_release_license': current_release_license,
          'latest_release': latest_release,
          'latest_release_license': latest_release_license,
          'newer_releases': newer_releases,
          'pre_releases': len(pre_releases),
          'major_updates': sorted(major_updates, key=lambda x: semantic_version.Version.coerce(x['version']), reverse=True),
          'minor_updates': sorted(minor_updates, key=lambda x: semantic_version.Version.coerce(x['version']), reverse=True),
          'patch_updates': sorted(patch_updates, key=lambda x: semantic_version.Version.coerce(x['version']), reverse=True),
          'pre_release_updates': sorted(pre_releases, key=lambda x: semantic_version.Version.coerce(x['version']), reverse=True),
          'non_semantic_versions': non_semantic_versions,
      }