prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  [FollowPath] position_update log frequency
  position_update log entries for FollowPath appear too often, like every 1.5 seconds, with distance changes from 1 meter to 5 meter depend on the random speed. It's kind of unnecessarily spam the terminal.
  
  An interval of 5 seconds or 10 meter should be more relevant.
  
  
  </issue>
  <code>
  [start of pokemongo_bot/base_task.py]
  1 import logging
  2 
  3 
  4 class BaseTask(object):
  5   TASK_API_VERSION = 1
  6 
  7   def __init__(self, bot, config):
  8     """
  9 
  10     :param bot:
  11     :type bot: pokemongo_bot.PokemonGoBot
  12     :param config:
  13     :return:
  14     """
  15     self.bot = bot
  16     self.config = config
  17     self._validate_work_exists()
  18     self.logger = logging.getLogger(type(self).__name__)
  19     self.enabled = config.get('enabled', True)
  20     self.initialize()
  21 
  22   def _validate_work_exists(self):
  23     method = getattr(self, 'work', None)
  24     if not method or not callable(method):
  25       raise NotImplementedError('Missing "work" method')
  26 
  27   def emit_event(self, event, sender=None, level='info', formatted='', data={}):
  28     if not sender:
  29       sender=self
  30     self.bot.event_manager.emit(
  31       event,
  32       sender=sender,
  33       level=level,
  34       formatted=formatted,
  35       data=data
  36     )
  37 
  38   def initialize(self):
  39     pass
  40
  [end of pokemongo_bot/base_task.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/pokemongo_bot/base_task.py b/pokemongo_bot/base_task.py
  --- a/pokemongo_bot/base_task.py
  +++ b/pokemongo_bot/base_task.py
  @@ -1,5 +1,7 @@
   import logging
   
  +import time
  +
   
   class BaseTask(object):
     TASK_API_VERSION = 1
  @@ -17,6 +19,7 @@
       self._validate_work_exists()
       self.logger = logging.getLogger(type(self).__name__)
       self.enabled = config.get('enabled', True)
  +    self.last_log_time = time.time()
       self.initialize()
   
     def _validate_work_exists(self):
  @@ -27,13 +30,17 @@
     def emit_event(self, event, sender=None, level='info', formatted='', data={}):
       if not sender:
         sender=self
  -    self.bot.event_manager.emit(
  -      event,
  -      sender=sender,
  -      level=level,
  -      formatted=formatted,
  -      data=data
  -    )
  +
  +    # Print log only if X seconds are passed from last log
  +    if (time.time() - self.last_log_time) > self.config.get('log_interval', 0):
  +      self.last_log_time = time.time()
  +      self.bot.event_manager.emit(
  +        event,
  +        sender=sender,
  +        level=level,
  +        formatted=formatted,
  +        data=data
  +      )
   
     def initialize(self):
       pass
  
verification_info: {"golden_diff": "diff --git a/pokemongo_bot/base_task.py b/pokemongo_bot/base_task.py\n--- a/pokemongo_bot/base_task.py\n+++ b/pokemongo_bot/base_task.py\n@@ -1,5 +1,7 @@\n import logging\n \n+import time\n+\n \n class BaseTask(object):\n   TASK_API_VERSION = 1\n@@ -17,6 +19,7 @@\n     self._validate_work_exists()\n     self.logger = logging.getLogger(type(self).__name__)\n     self.enabled = config.get('enabled', True)\n+    self.last_log_time = time.time()\n     self.initialize()\n \n   def _validate_work_exists(self):\n@@ -27,13 +30,17 @@\n   def emit_event(self, event, sender=None, level='info', formatted='', data={}):\n     if not sender:\n       sender=self\n-    self.bot.event_manager.emit(\n-      event,\n-      sender=sender,\n-      level=level,\n-      formatted=formatted,\n-      data=data\n-    )\n+\n+    # Print log only if X seconds are passed from last log\n+    if (time.time() - self.last_log_time) > self.config.get('log_interval', 0):\n+      self.last_log_time = time.time()\n+      self.bot.event_manager.emit(\n+        event,\n+        sender=sender,\n+        level=level,\n+        formatted=formatted,\n+        data=data\n+      )\n \n   def initialize(self):\n     pass\n", "issue": "[FollowPath] position_update log frequency\nposition_update log entries for FollowPath appear too often, like every 1.5 seconds, with distance changes from 1 meter to 5 meter depend on the random speed. It's kind of unnecessarily spam the terminal.\n\nAn interval of 5 seconds or 10 meter should be more relevant.\n\n", "before_files": [{"content": "import logging\n\n\nclass BaseTask(object):\n  TASK_API_VERSION = 1\n\n  def __init__(self, bot, config):\n    \"\"\"\n\n    :param bot:\n    :type bot: pokemongo_bot.PokemonGoBot\n    :param config:\n    :return:\n    \"\"\"\n    self.bot = bot\n    self.config = config\n    self._validate_work_exists()\n    self.logger = logging.getLogger(type(self).__name__)\n    self.enabled = config.get('enabled', True)\n    self.initialize()\n\n  def _validate_work_exists(self):\n    method = getattr(self, 'work', None)\n    if not method or not callable(method):\n      raise NotImplementedError('Missing \"work\" method')\n\n  def emit_event(self, event, sender=None, level='info', formatted='', data={}):\n    if not sender:\n      sender=self\n    self.bot.event_manager.emit(\n      event,\n      sender=sender,\n      level=level,\n      formatted=formatted,\n      data=data\n    )\n\n  def initialize(self):\n    pass\n", "path": "pokemongo_bot/base_task.py"}]}