prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Typo fix
  https://github.com/mlflow/mlflow/blob/9724c83bd8f0100c465e68e30651a9727de42ce0/dev/show_package_release_dates.py#L49
  
  `package_legnth` -> `package_length`
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `dev/show_package_release_dates.py`
  Content:
  ```
  1 import os
  2 import json
  3 import sys
  4 import subprocess
  5 import requests
  6 from concurrent.futures import ThreadPoolExecutor
  7 import traceback
  8 
  9 
  10 def get_distributions():
  11     res = subprocess.check_output(
  12         [sys.executable, "-m", "pip", "list", "--format", "json"], text=True
  13     )
  14     return [(pkg["name"], pkg["version"]) for pkg in json.loads(res)]
  15 
  16 
  17 def get_release_date(package, version):
  18     resp = requests.get(f"https://pypi.python.org/pypi/{package}/json", timeout=10)
  19     if not resp.ok:
  20         return ""
  21 
  22     matched = [dist_files for ver, dist_files in resp.json()["releases"].items() if ver == version]
  23     if (not matched) or (not matched[0]):
  24         return ""
  25 
  26     upload_time = matched[0][0]["upload_time"]
  27     return upload_time.split("T")[0]  # return year-month-day
  28 
  29 
  30 def get_longest_string_length(array):
  31     return len(max(array, key=len))
  32 
  33 
  34 def safe_result(future, if_error=""):
  35     try:
  36         return future.result()
  37     except Exception:
  38         traceback.print_exc()
  39         return if_error
  40 
  41 
  42 def main():
  43     distributions = get_distributions()
  44     with ThreadPoolExecutor(max_workers=min(32, os.cpu_count() + 4)) as executor:
  45         futures = [executor.submit(get_release_date, pkg, ver) for pkg, ver in distributions]
  46         release_dates = [safe_result(f) for f in futures]
  47 
  48     packages, versions = list(zip(*distributions))
  49     package_legnth = get_longest_string_length(packages)
  50     version_length = get_longest_string_length(versions)
  51     release_date_length = len("Release Date")
  52     print("Package".ljust(package_legnth), "Version".ljust(version_length), "Release Date")
  53     print("-" * (package_legnth + version_length + release_date_length + 2))
  54     for package, version, release_date in sorted(
  55         zip(packages, versions, release_dates),
  56         # Sort by release date in descending order
  57         key=lambda x: x[2],
  58         reverse=True,
  59     ):
  60         print(
  61             package.ljust(package_legnth),
  62             version.ljust(version_length),
  63             release_date.ljust(release_date_length),
  64         )
  65 
  66 
  67 if __name__ == "__main__":
  68     main()
  69
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/dev/show_package_release_dates.py b/dev/show_package_release_dates.py
  --- a/dev/show_package_release_dates.py
  +++ b/dev/show_package_release_dates.py
  @@ -46,11 +46,11 @@
           release_dates = [safe_result(f) for f in futures]
   
       packages, versions = list(zip(*distributions))
  -    package_legnth = get_longest_string_length(packages)
  +    package_length = get_longest_string_length(packages)
       version_length = get_longest_string_length(versions)
       release_date_length = len("Release Date")
  -    print("Package".ljust(package_legnth), "Version".ljust(version_length), "Release Date")
  -    print("-" * (package_legnth + version_length + release_date_length + 2))
  +    print("Package".ljust(package_length), "Version".ljust(version_length), "Release Date")
  +    print("-" * (package_length + version_length + release_date_length + 2))
       for package, version, release_date in sorted(
           zip(packages, versions, release_dates),
           # Sort by release date in descending order
  @@ -58,7 +58,7 @@
           reverse=True,
       ):
           print(
  -            package.ljust(package_legnth),
  +            package.ljust(package_length),
               version.ljust(version_length),
               release_date.ljust(release_date_length),
           )
  
verification_info: {"golden_diff": "diff --git a/dev/show_package_release_dates.py b/dev/show_package_release_dates.py\n--- a/dev/show_package_release_dates.py\n+++ b/dev/show_package_release_dates.py\n@@ -46,11 +46,11 @@\n         release_dates = [safe_result(f) for f in futures]\n \n     packages, versions = list(zip(*distributions))\n-    package_legnth = get_longest_string_length(packages)\n+    package_length = get_longest_string_length(packages)\n     version_length = get_longest_string_length(versions)\n     release_date_length = len(\"Release Date\")\n-    print(\"Package\".ljust(package_legnth), \"Version\".ljust(version_length), \"Release Date\")\n-    print(\"-\" * (package_legnth + version_length + release_date_length + 2))\n+    print(\"Package\".ljust(package_length), \"Version\".ljust(version_length), \"Release Date\")\n+    print(\"-\" * (package_length + version_length + release_date_length + 2))\n     for package, version, release_date in sorted(\n         zip(packages, versions, release_dates),\n         # Sort by release date in descending order\n@@ -58,7 +58,7 @@\n         reverse=True,\n     ):\n         print(\n-            package.ljust(package_legnth),\n+            package.ljust(package_length),\n             version.ljust(version_length),\n             release_date.ljust(release_date_length),\n         )\n", "issue": "Typo fix\nhttps://github.com/mlflow/mlflow/blob/9724c83bd8f0100c465e68e30651a9727de42ce0/dev/show_package_release_dates.py#L49\r\n\r\n`package_legnth` -> `package_length`\n", "before_files": [{"content": "import os\nimport json\nimport sys\nimport subprocess\nimport requests\nfrom concurrent.futures import ThreadPoolExecutor\nimport traceback\n\n\ndef get_distributions():\n    res = subprocess.check_output(\n        [sys.executable, \"-m\", \"pip\", \"list\", \"--format\", \"json\"], text=True\n    )\n    return [(pkg[\"name\"], pkg[\"version\"]) for pkg in json.loads(res)]\n\n\ndef get_release_date(package, version):\n    resp = requests.get(f\"https://pypi.python.org/pypi/{package}/json\", timeout=10)\n    if not resp.ok:\n        return \"\"\n\n    matched = [dist_files for ver, dist_files in resp.json()[\"releases\"].items() if ver == version]\n    if (not matched) or (not matched[0]):\n        return \"\"\n\n    upload_time = matched[0][0][\"upload_time\"]\n    return upload_time.split(\"T\")[0]  # return year-month-day\n\n\ndef get_longest_string_length(array):\n    return len(max(array, key=len))\n\n\ndef safe_result(future, if_error=\"\"):\n    try:\n        return future.result()\n    except Exception:\n        traceback.print_exc()\n        return if_error\n\n\ndef main():\n    distributions = get_distributions()\n    with ThreadPoolExecutor(max_workers=min(32, os.cpu_count() + 4)) as executor:\n        futures = [executor.submit(get_release_date, pkg, ver) for pkg, ver in distributions]\n        release_dates = [safe_result(f) for f in futures]\n\n    packages, versions = list(zip(*distributions))\n    package_legnth = get_longest_string_length(packages)\n    version_length = get_longest_string_length(versions)\n    release_date_length = len(\"Release Date\")\n    print(\"Package\".ljust(package_legnth), \"Version\".ljust(version_length), \"Release Date\")\n    print(\"-\" * (package_legnth + version_length + release_date_length + 2))\n    for package, version, release_date in sorted(\n        zip(packages, versions, release_dates),\n        # Sort by release date in descending order\n        key=lambda x: x[2],\n        reverse=True,\n    ):\n        print(\n            package.ljust(package_legnth),\n            version.ljust(version_length),\n            release_date.ljust(release_date_length),\n        )\n\n\nif __name__ == \"__main__\":\n    main()\n", "path": "dev/show_package_release_dates.py"}], "after_files": [{"content": "import os\nimport json\nimport sys\nimport subprocess\nimport requests\nfrom concurrent.futures import ThreadPoolExecutor\nimport traceback\n\n\ndef get_distributions():\n    res = subprocess.check_output(\n        [sys.executable, \"-m\", \"pip\", \"list\", \"--format\", \"json\"], text=True\n    )\n    return [(pkg[\"name\"], pkg[\"version\"]) for pkg in json.loads(res)]\n\n\ndef get_release_date(package, version):\n    resp = requests.get(f\"https://pypi.python.org/pypi/{package}/json\", timeout=10)\n    if not resp.ok:\n        return \"\"\n\n    matched = [dist_files for ver, dist_files in resp.json()[\"releases\"].items() if ver == version]\n    if (not matched) or (not matched[0]):\n        return \"\"\n\n    upload_time = matched[0][0][\"upload_time\"]\n    return upload_time.split(\"T\")[0]  # return year-month-day\n\n\ndef get_longest_string_length(array):\n    return len(max(array, key=len))\n\n\ndef safe_result(future, if_error=\"\"):\n    try:\n        return future.result()\n    except Exception:\n        traceback.print_exc()\n        return if_error\n\n\ndef main():\n    distributions = get_distributions()\n    with ThreadPoolExecutor(max_workers=min(32, os.cpu_count() + 4)) as executor:\n        futures = [executor.submit(get_release_date, pkg, ver) for pkg, ver in distributions]\n        release_dates = [safe_result(f) for f in futures]\n\n    packages, versions = list(zip(*distributions))\n    package_length = get_longest_string_length(packages)\n    version_length = get_longest_string_length(versions)\n    release_date_length = len(\"Release Date\")\n    print(\"Package\".ljust(package_length), \"Version\".ljust(version_length), \"Release Date\")\n    print(\"-\" * (package_length + version_length + release_date_length + 2))\n    for package, version, release_date in sorted(\n        zip(packages, versions, release_dates),\n        # Sort by release date in descending order\n        key=lambda x: x[2],\n        reverse=True,\n    ):\n        print(\n            package.ljust(package_length),\n            version.ljust(version_length),\n            release_date.ljust(release_date_length),\n        )\n\n\nif __name__ == \"__main__\":\n    main()\n", "path": "dev/show_package_release_dates.py"}]}