prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Path changes in cleanup scripts
  In `mephisto/scripts/mturk/cleanup.py`:  broken imports line 11-15 with the change from `core` and `providers` into `abstraction` - can also submit a PR if that's easier!
  
  </issue>
  <code>
  [start of mephisto/scripts/mturk/cleanup.py]
  1 #!/usr/bin/env python3
  2 
  3 # Copyright (c) Facebook, Inc. and its affiliates.
  4 # This source code is licensed under the MIT license found in the
  5 # LICENSE file in the root directory of this source tree.
  6 
  7 """
  8 Utility script that finds, expires, and disposes HITs that may not
  9 have been taking down during a run that exited improperly.
  10 """
  11 from mephisto.providers.mturk.mturk_utils import (
  12     get_outstanding_hits,
  13     expire_and_dispose_hits,
  14 )
  15 from mephisto.core.local_database import LocalMephistoDB
  16 
  17 db = LocalMephistoDB()
  18 
  19 all_requesters = db.find_requesters(provider_type="mturk")
  20 all_requesters += db.find_requesters(provider_type="mturk_sandbox")
  21 
  22 print("You have the following requesters available for mturk and mturk sandbox:")
  23 r_names = [r.requester_name for r in all_requesters]
  24 print(sorted(r_names))
  25 
  26 use_name = input("Enter the name of the requester to clear HITs from:\n>> ")
  27 while use_name not in r_names:
  28     use_name = input(
  29         f"Sorry, {use_name} is not in the requester list. "
  30         f"The following are valid: {r_names}\n"
  31         f"Select one:\n>> "
  32     )
  33 
  34 requester = db.find_requesters(requester_name=use_name)[0]
  35 client = requester._get_client(requester._requester_name)
  36 
  37 outstanding_hit_types = get_outstanding_hits(client)
  38 num_hit_types = len(outstanding_hit_types.keys())
  39 sum_hits = sum([len(outstanding_hit_types[x]) for x in outstanding_hit_types.keys()])
  40 
  41 all_hits = []
  42 for hit_type in outstanding_hit_types.keys():
  43     all_hits += outstanding_hit_types[hit_type]
  44 
  45 broken_hits = [
  46     h
  47     for h in all_hits
  48     if h["NumberOfAssignmentsCompleted"] == 0 and h["HITStatus"] != "Reviewable"
  49 ]
  50 
  51 print(
  52     f"The requester {use_name} has {num_hit_types} outstanding HIT "
  53     f"types, with {len(broken_hits)} suspected active or broken HITs.\n"
  54     "This may include tasks that are still in-flight, but also "
  55     "tasks that have already expired but have not been disposed of yet."
  56 )
  57 
  58 run_type = input("Would you like to cleanup by (t)itle, or just clean up (a)ll?\n>> ")
  59 use_hits = None
  60 
  61 while use_hits is None:
  62     if run_type.lower().startswith("t"):
  63         use_hits = []
  64         for hit_type in outstanding_hit_types.keys():
  65             cur_title = outstanding_hit_types[hit_type][0]["Title"]
  66             print(f"HIT TITLE: {cur_title}")
  67             print(f"HIT COUNT: {len(outstanding_hit_types[hit_type])}")
  68             should_clear = input(
  69                 "Should we cleanup this hit type? (y)es for yes, anything else for no: "
  70                 "\n>> "
  71             )
  72             if should_clear.lower().startswith("y"):
  73                 use_hits += outstanding_hit_types[hit_type]
  74     elif run_type.lower().startswith("a"):
  75         use_hits = all_hits
  76     else:
  77         run_type = input("Options are (t)itle, or (a)ll:\n>> ")
  78 
  79 print(f"Disposing {len(use_hits)} HITs.")
  80 remaining_hits = expire_and_dispose_hits(client, use_hits)
  81 
  82 if len(remaining_hits) == 0:
  83     print("Disposed!")
  84 else:
  85     print(
  86         f"After disposing, {len(remaining_hits)} could not be disposed.\n"
  87         f"These may not have been reviewed yet, or are being actively worked on.\n"
  88         "They have been expired though, so please try to dispose later."
  89         "The first 20 dispose errors are added below:"
  90     )
  91     print([h["dispose_exception"] for h in remaining_hits[:20]])
  92
  [end of mephisto/scripts/mturk/cleanup.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/mephisto/scripts/mturk/cleanup.py b/mephisto/scripts/mturk/cleanup.py
  --- a/mephisto/scripts/mturk/cleanup.py
  +++ b/mephisto/scripts/mturk/cleanup.py
  @@ -8,11 +8,11 @@
   Utility script that finds, expires, and disposes HITs that may not
   have been taking down during a run that exited improperly.
   """
  -from mephisto.providers.mturk.mturk_utils import (
  +from mephisto.abstractions.providers.mturk.mturk_utils import (
       get_outstanding_hits,
       expire_and_dispose_hits,
   )
  -from mephisto.core.local_database import LocalMephistoDB
  +from mephisto.abstractions.databases.local_database import LocalMephistoDB
   
   db = LocalMephistoDB()
  
verification_info: {"golden_diff": "diff --git a/mephisto/scripts/mturk/cleanup.py b/mephisto/scripts/mturk/cleanup.py\n--- a/mephisto/scripts/mturk/cleanup.py\n+++ b/mephisto/scripts/mturk/cleanup.py\n@@ -8,11 +8,11 @@\n Utility script that finds, expires, and disposes HITs that may not\n have been taking down during a run that exited improperly.\n \"\"\"\n-from mephisto.providers.mturk.mturk_utils import (\n+from mephisto.abstractions.providers.mturk.mturk_utils import (\n     get_outstanding_hits,\n     expire_and_dispose_hits,\n )\n-from mephisto.core.local_database import LocalMephistoDB\n+from mephisto.abstractions.databases.local_database import LocalMephistoDB\n \n db = LocalMephistoDB()\n", "issue": "Path changes in cleanup scripts\nIn `mephisto/scripts/mturk/cleanup.py`:  broken imports line 11-15 with the change from `core` and `providers` into `abstraction` - can also submit a PR if that's easier!\n", "before_files": [{"content": "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\"\"\"\nUtility script that finds, expires, and disposes HITs that may not\nhave been taking down during a run that exited improperly.\n\"\"\"\nfrom mephisto.providers.mturk.mturk_utils import (\n    get_outstanding_hits,\n    expire_and_dispose_hits,\n)\nfrom mephisto.core.local_database import LocalMephistoDB\n\ndb = LocalMephistoDB()\n\nall_requesters = db.find_requesters(provider_type=\"mturk\")\nall_requesters += db.find_requesters(provider_type=\"mturk_sandbox\")\n\nprint(\"You have the following requesters available for mturk and mturk sandbox:\")\nr_names = [r.requester_name for r in all_requesters]\nprint(sorted(r_names))\n\nuse_name = input(\"Enter the name of the requester to clear HITs from:\\n>> \")\nwhile use_name not in r_names:\n    use_name = input(\n        f\"Sorry, {use_name} is not in the requester list. \"\n        f\"The following are valid: {r_names}\\n\"\n        f\"Select one:\\n>> \"\n    )\n\nrequester = db.find_requesters(requester_name=use_name)[0]\nclient = requester._get_client(requester._requester_name)\n\noutstanding_hit_types = get_outstanding_hits(client)\nnum_hit_types = len(outstanding_hit_types.keys())\nsum_hits = sum([len(outstanding_hit_types[x]) for x in outstanding_hit_types.keys()])\n\nall_hits = []\nfor hit_type in outstanding_hit_types.keys():\n    all_hits += outstanding_hit_types[hit_type]\n\nbroken_hits = [\n    h\n    for h in all_hits\n    if h[\"NumberOfAssignmentsCompleted\"] == 0 and h[\"HITStatus\"] != \"Reviewable\"\n]\n\nprint(\n    f\"The requester {use_name} has {num_hit_types} outstanding HIT \"\n    f\"types, with {len(broken_hits)} suspected active or broken HITs.\\n\"\n    \"This may include tasks that are still in-flight, but also \"\n    \"tasks that have already expired but have not been disposed of yet.\"\n)\n\nrun_type = input(\"Would you like to cleanup by (t)itle, or just clean up (a)ll?\\n>> \")\nuse_hits = None\n\nwhile use_hits is None:\n    if run_type.lower().startswith(\"t\"):\n        use_hits = []\n        for hit_type in outstanding_hit_types.keys():\n            cur_title = outstanding_hit_types[hit_type][0][\"Title\"]\n            print(f\"HIT TITLE: {cur_title}\")\n            print(f\"HIT COUNT: {len(outstanding_hit_types[hit_type])}\")\n            should_clear = input(\n                \"Should we cleanup this hit type? (y)es for yes, anything else for no: \"\n                \"\\n>> \"\n            )\n            if should_clear.lower().startswith(\"y\"):\n                use_hits += outstanding_hit_types[hit_type]\n    elif run_type.lower().startswith(\"a\"):\n        use_hits = all_hits\n    else:\n        run_type = input(\"Options are (t)itle, or (a)ll:\\n>> \")\n\nprint(f\"Disposing {len(use_hits)} HITs.\")\nremaining_hits = expire_and_dispose_hits(client, use_hits)\n\nif len(remaining_hits) == 0:\n    print(\"Disposed!\")\nelse:\n    print(\n        f\"After disposing, {len(remaining_hits)} could not be disposed.\\n\"\n        f\"These may not have been reviewed yet, or are being actively worked on.\\n\"\n        \"They have been expired though, so please try to dispose later.\"\n        \"The first 20 dispose errors are added below:\"\n    )\n    print([h[\"dispose_exception\"] for h in remaining_hits[:20]])\n", "path": "mephisto/scripts/mturk/cleanup.py"}]}