prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Pylint: W0223
  ```bash
  mmpose/models/detectors/bottom_up.py:19:0: W0223: Method 'simple_test' is abstract in class 'BasePose' but is not overridden (abstract-method)
  mmpose/models/detectors/top_down.py:18:0: W0223: Method 'simple_test' is abstract in class 'BasePose' but is not overridden (abstract-method)
  ```
  
  </issue>
  <code>
  [start of mmpose/models/detectors/base.py]
  1 from abc import ABCMeta, abstractmethod
  2 from collections import OrderedDict
  3 
  4 import torch
  5 import torch.distributed as dist
  6 import torch.nn as nn
  7 
  8 
  9 class BasePose(nn.Module):
  10     """Base class for pose detectors.
  11 
  12     All recognizers should subclass it.
  13     All subclass should overwrite:
  14         Methods:`forward_train`, supporting to forward when training.
  15         Methods:`forward_test`, supporting to forward when testing.
  16 
  17     Args:
  18         backbone (dict): Backbone modules to extract feature.
  19         head (dict): Head modules to give output.
  20         train_cfg (dict): Config for training. Default: None.
  21         test_cfg (dict): Config for testing. Default: None.
  22     """
  23 
  24     __metaclass__ = ABCMeta
  25 
  26     @abstractmethod
  27     def forward_train(self, img, img_metas, **kwargs):
  28         """Defines the computation performed at training."""
  29 
  30     @abstractmethod
  31     def forward_test(self, img, img_metas, **kwargs):
  32         """Defines the computation performed at testing."""
  33 
  34     @abstractmethod
  35     def simple_test(self, img, img_metas, **kwargs):
  36         """Simple test function."""
  37 
  38     @abstractmethod
  39     def forward(self, img, img_metas, return_loss=True, **kwargs):
  40         """Forward function."""
  41 
  42     @staticmethod
  43     def _parse_losses(losses):
  44         """Parse the raw outputs (losses) of the network.
  45 
  46         Args:
  47             losses (dict): Raw output of the network, which usually contain
  48                 losses and other necessary information.
  49 
  50         Returns:
  51             tuple[Tensor, dict]: (loss, log_vars), loss is the loss tensor
  52                 which may be a weighted sum of all losses, log_vars contains
  53                 all the variables to be sent to the logger.
  54         """
  55         log_vars = OrderedDict()
  56         for loss_name, loss_value in losses.items():
  57             if isinstance(loss_value, torch.Tensor):
  58                 log_vars[loss_name] = loss_value.mean()
  59             elif isinstance(loss_value, float):
  60                 log_vars[loss_name] = loss_value
  61             elif isinstance(loss_value, list):
  62                 log_vars[loss_name] = sum(_loss.mean() for _loss in loss_value)
  63             else:
  64                 raise TypeError(
  65                     f'{loss_name} is not a tensor or list of tensors or float')
  66 
  67         loss = sum(_value for _key, _value in log_vars.items()
  68                    if 'loss' in _key)
  69 
  70         log_vars['loss'] = loss
  71         for loss_name, loss_value in log_vars.items():
  72             # reduce loss when distributed training
  73             if not isinstance(loss_value, float):
  74                 if dist.is_available() and dist.is_initialized():
  75                     loss_value = loss_value.data.clone()
  76                     dist.all_reduce(loss_value.div_(dist.get_world_size()))
  77                 log_vars[loss_name] = loss_value.item()
  78             else:
  79                 log_vars[loss_name] = loss_value
  80 
  81         return loss, log_vars
  82 
  83     def train_step(self, data_batch, optimizer, **kwargs):
  84         """The iteration step during training.
  85 
  86         This method defines an iteration step during training, except for the
  87         back propagation and optimizer updating, which are done in an optimizer
  88         hook. Note that in some complicated cases or models, the whole process
  89         including back propagation and optimizer updating is also defined in
  90         this method, such as GAN.
  91 
  92         Args:
  93             data_batch (dict): The output of dataloader.
  94             optimizer (:obj:`torch.optim.Optimizer` | dict): The optimizer of
  95                 runner is passed to ``train_step()``. This argument is unused
  96                 and reserved.
  97 
  98         Returns:
  99             dict: It should contain at least 3 keys: ``loss``, ``log_vars``,
  100                 ``num_samples``.
  101                 ``loss`` is a tensor for back propagation, which can be a
  102                 weighted sum of multiple losses.
  103                 ``log_vars`` contains all the variables to be sent to the
  104                 logger.
  105                 ``num_samples`` indicates the batch size (when the model is
  106                 DDP, it means the batch size on each GPU), which is used for
  107                 averaging the logs.
  108         """
  109         losses = self.forward(**data_batch)
  110 
  111         loss, log_vars = self._parse_losses(losses)
  112 
  113         outputs = dict(
  114             loss=loss,
  115             log_vars=log_vars,
  116             num_samples=len(next(iter(data_batch.values()))))
  117 
  118         return outputs
  119 
  120     def val_step(self, data_batch, optimizer, **kwargs):
  121         """The iteration step during validation.
  122 
  123         This method shares the same signature as :func:`train_step`, but used
  124         during val epochs. Note that the evaluation after training epochs is
  125         not implemented with this method, but an evaluation hook.
  126         """
  127         results = self.forward(return_loss=False, **data_batch)
  128 
  129         outputs = dict(results=results)
  130 
  131         return outputs
  132 
  133     @abstractmethod
  134     def show_result(self, **kwargs):
  135         """Visualize the results."""
  136         raise NotImplementedError
  137
  [end of mmpose/models/detectors/base.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/mmpose/models/detectors/base.py b/mmpose/models/detectors/base.py
  --- a/mmpose/models/detectors/base.py
  +++ b/mmpose/models/detectors/base.py
  @@ -31,10 +31,6 @@
       def forward_test(self, img, img_metas, **kwargs):
           """Defines the computation performed at testing."""
   
  -    @abstractmethod
  -    def simple_test(self, img, img_metas, **kwargs):
  -        """Simple test function."""
  -
       @abstractmethod
       def forward(self, img, img_metas, return_loss=True, **kwargs):
           """Forward function."""
  
verification_info: {"golden_diff": "diff --git a/mmpose/models/detectors/base.py b/mmpose/models/detectors/base.py\n--- a/mmpose/models/detectors/base.py\n+++ b/mmpose/models/detectors/base.py\n@@ -31,10 +31,6 @@\n     def forward_test(self, img, img_metas, **kwargs):\n         \"\"\"Defines the computation performed at testing.\"\"\"\n \n-    @abstractmethod\n-    def simple_test(self, img, img_metas, **kwargs):\n-        \"\"\"Simple test function.\"\"\"\n-\n     @abstractmethod\n     def forward(self, img, img_metas, return_loss=True, **kwargs):\n         \"\"\"Forward function.\"\"\"\n", "issue": "Pylint: W0223\n```bash\r\nmmpose/models/detectors/bottom_up.py:19:0: W0223: Method 'simple_test' is abstract in class 'BasePose' but is not overridden (abstract-method)\r\nmmpose/models/detectors/top_down.py:18:0: W0223: Method 'simple_test' is abstract in class 'BasePose' but is not overridden (abstract-method)\r\n```\n", "before_files": [{"content": "from abc import ABCMeta, abstractmethod\nfrom collections import OrderedDict\n\nimport torch\nimport torch.distributed as dist\nimport torch.nn as nn\n\n\nclass BasePose(nn.Module):\n    \"\"\"Base class for pose detectors.\n\n    All recognizers should subclass it.\n    All subclass should overwrite:\n        Methods:`forward_train`, supporting to forward when training.\n        Methods:`forward_test`, supporting to forward when testing.\n\n    Args:\n        backbone (dict): Backbone modules to extract feature.\n        head (dict): Head modules to give output.\n        train_cfg (dict): Config for training. Default: None.\n        test_cfg (dict): Config for testing. Default: None.\n    \"\"\"\n\n    __metaclass__ = ABCMeta\n\n    @abstractmethod\n    def forward_train(self, img, img_metas, **kwargs):\n        \"\"\"Defines the computation performed at training.\"\"\"\n\n    @abstractmethod\n    def forward_test(self, img, img_metas, **kwargs):\n        \"\"\"Defines the computation performed at testing.\"\"\"\n\n    @abstractmethod\n    def simple_test(self, img, img_metas, **kwargs):\n        \"\"\"Simple test function.\"\"\"\n\n    @abstractmethod\n    def forward(self, img, img_metas, return_loss=True, **kwargs):\n        \"\"\"Forward function.\"\"\"\n\n    @staticmethod\n    def _parse_losses(losses):\n        \"\"\"Parse the raw outputs (losses) of the network.\n\n        Args:\n            losses (dict): Raw output of the network, which usually contain\n                losses and other necessary information.\n\n        Returns:\n            tuple[Tensor, dict]: (loss, log_vars), loss is the loss tensor\n                which may be a weighted sum of all losses, log_vars contains\n                all the variables to be sent to the logger.\n        \"\"\"\n        log_vars = OrderedDict()\n        for loss_name, loss_value in losses.items():\n            if isinstance(loss_value, torch.Tensor):\n                log_vars[loss_name] = loss_value.mean()\n            elif isinstance(loss_value, float):\n                log_vars[loss_name] = loss_value\n            elif isinstance(loss_value, list):\n                log_vars[loss_name] = sum(_loss.mean() for _loss in loss_value)\n            else:\n                raise TypeError(\n                    f'{loss_name} is not a tensor or list of tensors or float')\n\n        loss = sum(_value for _key, _value in log_vars.items()\n                   if 'loss' in _key)\n\n        log_vars['loss'] = loss\n        for loss_name, loss_value in log_vars.items():\n            # reduce loss when distributed training\n            if not isinstance(loss_value, float):\n                if dist.is_available() and dist.is_initialized():\n                    loss_value = loss_value.data.clone()\n                    dist.all_reduce(loss_value.div_(dist.get_world_size()))\n                log_vars[loss_name] = loss_value.item()\n            else:\n                log_vars[loss_name] = loss_value\n\n        return loss, log_vars\n\n    def train_step(self, data_batch, optimizer, **kwargs):\n        \"\"\"The iteration step during training.\n\n        This method defines an iteration step during training, except for the\n        back propagation and optimizer updating, which are done in an optimizer\n        hook. Note that in some complicated cases or models, the whole process\n        including back propagation and optimizer updating is also defined in\n        this method, such as GAN.\n\n        Args:\n            data_batch (dict): The output of dataloader.\n            optimizer (:obj:`torch.optim.Optimizer` | dict): The optimizer of\n                runner is passed to ``train_step()``. This argument is unused\n                and reserved.\n\n        Returns:\n            dict: It should contain at least 3 keys: ``loss``, ``log_vars``,\n                ``num_samples``.\n                ``loss`` is a tensor for back propagation, which can be a\n                weighted sum of multiple losses.\n                ``log_vars`` contains all the variables to be sent to the\n                logger.\n                ``num_samples`` indicates the batch size (when the model is\n                DDP, it means the batch size on each GPU), which is used for\n                averaging the logs.\n        \"\"\"\n        losses = self.forward(**data_batch)\n\n        loss, log_vars = self._parse_losses(losses)\n\n        outputs = dict(\n            loss=loss,\n            log_vars=log_vars,\n            num_samples=len(next(iter(data_batch.values()))))\n\n        return outputs\n\n    def val_step(self, data_batch, optimizer, **kwargs):\n        \"\"\"The iteration step during validation.\n\n        This method shares the same signature as :func:`train_step`, but used\n        during val epochs. Note that the evaluation after training epochs is\n        not implemented with this method, but an evaluation hook.\n        \"\"\"\n        results = self.forward(return_loss=False, **data_batch)\n\n        outputs = dict(results=results)\n\n        return outputs\n\n    @abstractmethod\n    def show_result(self, **kwargs):\n        \"\"\"Visualize the results.\"\"\"\n        raise NotImplementedError\n", "path": "mmpose/models/detectors/base.py"}]}