prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Add information about Dataset to Tasks endpoint
  ## Current Behavior
  
  Tasks endpoint returns list of all Tasks **without** information about their Datasets.
  
  ## Expected Behavior
  
  Each Task returned by this endpoint should also contain information about its Dataset.
  
  ## Tasks to do
  
  - [ ] Add Dataset key to the Task returned by Tasks endpoint.
  
  ## Additional comment
  
  Dataset key will be fine only if there will be an endpoint that will return all Datasets available in MedTagger.
  
  </issue>
  <code>
  [start of backend/medtagger/api/tasks/serializers.py]
  1 """Module responsible for storage of serializers used in Tasks endpoints."""
  2 from flask_restplus import fields
  3 
  4 from medtagger.api import api
  5 from medtagger.definitions import LabelTool
  6 
  7 out__label_tag = api.model('Label Tag model', {
  8     'key': fields.String(),
  9     'name': fields.String(),
  10     'actions_ids': fields.List(fields.Integer(),
  11                                attribute=lambda label_tag: [action.id for action in label_tag.actions]),
  12     'tools': fields.List(fields.String(), description='Available tools for Label Tag',
  13                          enum=[tool.name for tool in LabelTool],
  14                          attribute=lambda label_tag: [tool.name for tool in label_tag.tools]),
  15 })
  16 
  17 in__label_tag = api.model('Label Tag model', {
  18     'key': fields.String(),
  19     'name': fields.String(),
  20     'actions_ids': fields.List(fields.Integer()),
  21     'tools': fields.List(fields.String(), description='Available tools for Label Tag',
  22                          enum=[tool.name for tool in LabelTool]),
  23 })
  24 
  25 out__task = api.model('Task model', {
  26     'key': fields.String(),
  27     'name': fields.String(),
  28     'image_path': fields.String(),
  29     'tags': fields.List(fields.Nested(out__label_tag), attribute='available_tags'),
  30 })
  31 
  32 in__task = api.model('New Task model', {
  33     'key': fields.String(),
  34     'name': fields.String(),
  35     'image_path': fields.String(),
  36     'datasets_keys': fields.List(fields.String()),
  37     'tags': fields.List(fields.Nested(in__label_tag), attribute='available_tags'),
  38 })
  39
  [end of backend/medtagger/api/tasks/serializers.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/backend/medtagger/api/tasks/serializers.py b/backend/medtagger/api/tasks/serializers.py
  --- a/backend/medtagger/api/tasks/serializers.py
  +++ b/backend/medtagger/api/tasks/serializers.py
  @@ -27,6 +27,7 @@
       'name': fields.String(),
       'image_path': fields.String(),
       'tags': fields.List(fields.Nested(out__label_tag), attribute='available_tags'),
  +    'datasets_keys': fields.List(fields.String(), attribute=lambda task: [dataset.key for dataset in task.datasets]),
   })
   
   in__task = api.model('New Task model', {
  
verification_info: {"golden_diff": "diff --git a/backend/medtagger/api/tasks/serializers.py b/backend/medtagger/api/tasks/serializers.py\n--- a/backend/medtagger/api/tasks/serializers.py\n+++ b/backend/medtagger/api/tasks/serializers.py\n@@ -27,6 +27,7 @@\n     'name': fields.String(),\n     'image_path': fields.String(),\n     'tags': fields.List(fields.Nested(out__label_tag), attribute='available_tags'),\n+    'datasets_keys': fields.List(fields.String(), attribute=lambda task: [dataset.key for dataset in task.datasets]),\n })\n \n in__task = api.model('New Task model', {\n", "issue": "Add information about Dataset to Tasks endpoint\n## Current Behavior\r\n\r\nTasks endpoint returns list of all Tasks **without** information about their Datasets.\r\n\r\n## Expected Behavior\r\n\r\nEach Task returned by this endpoint should also contain information about its Dataset.\r\n\r\n## Tasks to do\r\n\r\n- [ ] Add Dataset key to the Task returned by Tasks endpoint.\r\n\r\n## Additional comment\r\n\r\nDataset key will be fine only if there will be an endpoint that will return all Datasets available in MedTagger.\n", "before_files": [{"content": "\"\"\"Module responsible for storage of serializers used in Tasks endpoints.\"\"\"\nfrom flask_restplus import fields\n\nfrom medtagger.api import api\nfrom medtagger.definitions import LabelTool\n\nout__label_tag = api.model('Label Tag model', {\n    'key': fields.String(),\n    'name': fields.String(),\n    'actions_ids': fields.List(fields.Integer(),\n                               attribute=lambda label_tag: [action.id for action in label_tag.actions]),\n    'tools': fields.List(fields.String(), description='Available tools for Label Tag',\n                         enum=[tool.name for tool in LabelTool],\n                         attribute=lambda label_tag: [tool.name for tool in label_tag.tools]),\n})\n\nin__label_tag = api.model('Label Tag model', {\n    'key': fields.String(),\n    'name': fields.String(),\n    'actions_ids': fields.List(fields.Integer()),\n    'tools': fields.List(fields.String(), description='Available tools for Label Tag',\n                         enum=[tool.name for tool in LabelTool]),\n})\n\nout__task = api.model('Task model', {\n    'key': fields.String(),\n    'name': fields.String(),\n    'image_path': fields.String(),\n    'tags': fields.List(fields.Nested(out__label_tag), attribute='available_tags'),\n})\n\nin__task = api.model('New Task model', {\n    'key': fields.String(),\n    'name': fields.String(),\n    'image_path': fields.String(),\n    'datasets_keys': fields.List(fields.String()),\n    'tags': fields.List(fields.Nested(in__label_tag), attribute='available_tags'),\n})\n", "path": "backend/medtagger/api/tasks/serializers.py"}]}