# Buggy code
def use(self, user, target):
    """Applies this technique's effects as defined in the "effect" column of the technique
    database. This method will execute a function with the same name as the effect defined in
    the database. If you want to add a new effect, simply create a new function under the
    Technique class with the name of the effect you define in monster.db.

    :param user: The core.components.monster.Monster object that used this technique.
    :param target: The core.components.monter.Monster object that we are using this
        technique on.

    :type user: core.components.monster.Monster
    :type target: core.components.monster.Monster

    :rtype: bool
    :returns: If technique was successful or not

    **Examples:**

    >>> poison_tech = Technique("Poison Sting")
    >>> bulbatux.learn(poison_tech)
    >>>
    >>> bulbatux.moves[0].use(user=bulbatux, target=tuxmander)
    """
    # Loop through all the effects of this technique and execute the effect's function.
    # TODO: more robust API
    successful = False
    for effect in self.effect:
        if getattr(self, str(effect))(user, target):
            successful = True

    return successful


# Traceback (KeyError)
Traceback (most recent call last):
File "./tuxemon.py", line 60, in <module>
main()
File "/tmp/Tuxemon/tuxemon/core/main.py", line 109, in main
control.main()
File "/tmp/Tuxemon/tuxemon/core/control.py", line 512, in main
self.main_loop()
File "/tmp/Tuxemon/tuxemon/core/control.py", line 573, in main_loop
self.update(time_delta)
File "/tmp/Tuxemon/tuxemon/core/control.py", line 203, in update
state.update(dt)
File "/tmp/Tuxemon/tuxemon/core/states/combat/combat.py", line 156, in update
self.update_phase()
File "/tmp/Tuxemon/tuxemon/core/states/combat/combat.py", line 328, in update_phase
self.handle_action_queue()
File "/tmp/Tuxemon/tuxemon/core/states/combat/combat.py", line 338, in handle_action_queue
self.check_party_hp()
File "/tmp/Tuxemon/tuxemon/core/states/combat/combat.py", line 614, in check_party_hp
self.faint_monster(monster)
File "/tmp/Tuxemon/tuxemon/core/states/combat/combat.py", line 581, in faint_monster
awarded_exp = monster.total_experience/monster.level/len(self._damage_map[monster])
KeyError: <core.components.monster.Monster object at 0x7fb24236ddd0>

# Fixed code
def use(self, user, target):
    """Applies this technique's effects as defined in the "effect" column of the technique
    database. This method will execute a function with the same name as the effect defined in
    the database. If you want to add a new effect, simply create a new function under the
    Technique class with the name of the effect you define in monster.db.

    :param user: The core.components.monster.Monster object that used this technique.
    :param target: The core.components.monter.Monster object that we are using this
        technique on.

    :type user: core.components.monster.Monster
    :type target: core.components.monster.Monster

    :rtype: bool
    :returns: If technique was successful or not

    **Examples:**

    >>> poison_tech = Technique("technique_poison_sting")
    >>> bulbatux.learn(poison_tech)
    >>>
    >>> bulbatux.moves[0].use(user=bulbatux, target=tuxmander)
    """
    # Loop through all the effects of this technique and execute the effect's function.
    # TODO: more robust API
    successful = False
    for effect in self.effect:
        if getattr(self, str(effect))(user, target):
            successful = True

    return successful