We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Functional Test 1 - Effect expiry 
We want to check that the effect can expire. This would be as follows:

Place an avatar on the map in one of the cells.
Place a pickup somewhere.
Make a move in some direction, towards the pickup.
Call `avatar.pickup.effect.onturn()` 10 times until the effect expires.
Make sure that the avatar holds *no effect* (not pickup!).

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `aimmo-game/simulation/effects.py`
Content:
```
1 from abc import ABCMeta, abstractmethod
2 
3 import math
4 
5 import sys
6 
7 
8 class _Effect(object):
9     __metaclass__ = ABCMeta
10 
11     def __init__(self, avatar):
12         self._avatar = avatar
13         self.is_expired = False
14 
15     @abstractmethod
16     def on_turn(self):
17         raise NotImplementedError()
18 
19 
20 class _TimedEffect(_Effect):
21     __metaclass__ = ABCMeta
22     EFFECT_TIME = 10
23 
24     def __init__(self, *args):
25         super(_TimedEffect, self).__init__(*args)
26         self._time_remaining = self.EFFECT_TIME
27 
28     def remove(self):
29         try:
30             self._avatar.effects.remove(self)
31         except KeyError as e:
32             raise KeyError("The avatar object does not exist! Cannot remove the effect.")
33 
34     def on_turn(self):
35         self._time_remaining -= 1
36         if self._time_remaining <= 0:
37             self.is_expired = True
38 
39 
40 class InvulnerabilityPickupEffect(_TimedEffect):
41     def __init__(self, *args):
42         super(InvulnerabilityPickupEffect, self).__init__(*args)
43         self._avatar.resistance += 1000
44 
45     def remove(self):
46         super(InvulnerabilityPickupEffect, self).remove()
47         self._avatar.resistance -= 1000
48 
49 
50 class DamageBoostPickupEffect(_TimedEffect):
51     def __init__(self, damage_boost, *args):
52         # For now we have no maximum damage boost constraints, so infinity needs to be casted into a max int.
53         if math.isinf(damage_boost):
54             damage_boost = sys.maxsize
55 
56         self._damage_boost = int(round(damage_boost))
57         super(DamageBoostPickupEffect, self).__init__(*args)
58         self._avatar.attack_strength += self._damage_boost
59 
60     def remove(self):
61         super(DamageBoostPickupEffect, self).remove()
62         self._avatar.attack_strength -= self._damage_boost
63
```
--- 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()

```

diff --git a/aimmo-game/simulation/effects.py b/aimmo-game/simulation/effects.py
--- a/aimmo-game/simulation/effects.py
+++ b/aimmo-game/simulation/effects.py
@@ -1,9 +1,10 @@
 from abc import ABCMeta, abstractmethod
 
 import math
-
 import sys
 
+INVULNERABILITY_RESISTANCE = 1000
+
 
 class _Effect(object):
     __metaclass__ = ABCMeta
@@ -40,11 +41,11 @@
 class InvulnerabilityPickupEffect(_TimedEffect):
     def __init__(self, *args):
         super(InvulnerabilityPickupEffect, self).__init__(*args)
-        self._avatar.resistance += 1000
+        self._avatar.resistance += INVULNERABILITY_RESISTANCE
 
     def remove(self):
         super(InvulnerabilityPickupEffect, self).remove()
-        self._avatar.resistance -= 1000
+        self._avatar.resistance -= INVULNERABILITY_RESISTANCE
 
 
 class DamageBoostPickupEffect(_TimedEffect):

{"golden_diff": "diff --git a/aimmo-game/simulation/effects.py b/aimmo-game/simulation/effects.py\n--- a/aimmo-game/simulation/effects.py\n+++ b/aimmo-game/simulation/effects.py\n@@ -1,9 +1,10 @@\n from abc import ABCMeta, abstractmethod\n \n import math\n-\n import sys\n \n+INVULNERABILITY_RESISTANCE = 1000\n+\n \n class _Effect(object):\n     __metaclass__ = ABCMeta\n@@ -40,11 +41,11 @@\n class InvulnerabilityPickupEffect(_TimedEffect):\n     def __init__(self, *args):\n         super(InvulnerabilityPickupEffect, self).__init__(*args)\n-        self._avatar.resistance += 1000\n+        self._avatar.resistance += INVULNERABILITY_RESISTANCE\n \n     def remove(self):\n         super(InvulnerabilityPickupEffect, self).remove()\n-        self._avatar.resistance -= 1000\n+        self._avatar.resistance -= INVULNERABILITY_RESISTANCE\n \n \n class DamageBoostPickupEffect(_TimedEffect):\n", "issue": "Functional Test 1 - Effect expiry \nWe want to check that the effect can expire. This would be as follows:\n\nPlace an avatar on the map in one of the cells.\nPlace a pickup somewhere.\nMake a move in some direction, towards the pickup.\nCall `avatar.pickup.effect.onturn()` 10 times until the effect expires.\nMake sure that the avatar holds *no effect* (not pickup!).\n", "before_files": [{"content": "from abc import ABCMeta, abstractmethod\n\nimport math\n\nimport sys\n\n\nclass _Effect(object):\n    __metaclass__ = ABCMeta\n\n    def __init__(self, avatar):\n        self._avatar = avatar\n        self.is_expired = False\n\n    @abstractmethod\n    def on_turn(self):\n        raise NotImplementedError()\n\n\nclass _TimedEffect(_Effect):\n    __metaclass__ = ABCMeta\n    EFFECT_TIME = 10\n\n    def __init__(self, *args):\n        super(_TimedEffect, self).__init__(*args)\n        self._time_remaining = self.EFFECT_TIME\n\n    def remove(self):\n        try:\n            self._avatar.effects.remove(self)\n        except KeyError as e:\n            raise KeyError(\"The avatar object does not exist! Cannot remove the effect.\")\n\n    def on_turn(self):\n        self._time_remaining -= 1\n        if self._time_remaining <= 0:\n            self.is_expired = True\n\n\nclass InvulnerabilityPickupEffect(_TimedEffect):\n    def __init__(self, *args):\n        super(InvulnerabilityPickupEffect, self).__init__(*args)\n        self._avatar.resistance += 1000\n\n    def remove(self):\n        super(InvulnerabilityPickupEffect, self).remove()\n        self._avatar.resistance -= 1000\n\n\nclass DamageBoostPickupEffect(_TimedEffect):\n    def __init__(self, damage_boost, *args):\n        # For now we have no maximum damage boost constraints, so infinity needs to be casted into a max int.\n        if math.isinf(damage_boost):\n            damage_boost = sys.maxsize\n\n        self._damage_boost = int(round(damage_boost))\n        super(DamageBoostPickupEffect, self).__init__(*args)\n        self._avatar.attack_strength += self._damage_boost\n\n    def remove(self):\n        super(DamageBoostPickupEffect, self).remove()\n        self._avatar.attack_strength -= self._damage_boost\n", "path": "aimmo-game/simulation/effects.py"}], "after_files": [{"content": "from abc import ABCMeta, abstractmethod\n\nimport math\nimport sys\n\nINVULNERABILITY_RESISTANCE = 1000\n\n\nclass _Effect(object):\n    __metaclass__ = ABCMeta\n\n    def __init__(self, avatar):\n        self._avatar = avatar\n        self.is_expired = False\n\n    @abstractmethod\n    def on_turn(self):\n        raise NotImplementedError()\n\n\nclass _TimedEffect(_Effect):\n    __metaclass__ = ABCMeta\n    EFFECT_TIME = 10\n\n    def __init__(self, *args):\n        super(_TimedEffect, self).__init__(*args)\n        self._time_remaining = self.EFFECT_TIME\n\n    def remove(self):\n        try:\n            self._avatar.effects.remove(self)\n        except KeyError as e:\n            raise KeyError(\"The avatar object does not exist! Cannot remove the effect.\")\n\n    def on_turn(self):\n        self._time_remaining -= 1\n        if self._time_remaining <= 0:\n            self.is_expired = True\n\n\nclass InvulnerabilityPickupEffect(_TimedEffect):\n    def __init__(self, *args):\n        super(InvulnerabilityPickupEffect, self).__init__(*args)\n        self._avatar.resistance += INVULNERABILITY_RESISTANCE\n\n    def remove(self):\n        super(InvulnerabilityPickupEffect, self).remove()\n        self._avatar.resistance -= INVULNERABILITY_RESISTANCE\n\n\nclass DamageBoostPickupEffect(_TimedEffect):\n    def __init__(self, damage_boost, *args):\n        # For now we have no maximum damage boost constraints, so infinity needs to be casted into a max int.\n        if math.isinf(damage_boost):\n            damage_boost = sys.maxsize\n\n        self._damage_boost = int(round(damage_boost))\n        super(DamageBoostPickupEffect, self).__init__(*args)\n        self._avatar.attack_strength += self._damage_boost\n\n    def remove(self):\n        super(DamageBoostPickupEffect, self).remove()\n        self._avatar.attack_strength -= self._damage_boost\n", "path": "aimmo-game/simulation/effects.py"}]}