def METHOD_NAME(self):
    self.load_definitions()
    for jid in range(pygame.joystick.get_count()):
        joy = pygame.joystick.Joystick(jid)
        self.log("Found joystick (%s)" % (joy.get_name(),))
        for joydef in self.joydefs:
            if 'match' not in joydef:
                self.log('{} has no match patterns, ignoring.'.format(
                    joydef['path']), 0)
                continue
            for pattern in joydef['match']:
                if fnmatch.fnmatch(joy.get_name().lower(),
                                   pattern.lower()):
                    self.log('Using {} ("{}" matches pattern "{}")'.format(
                        joydef['path'], joy.get_name(), pattern))
                    self.joystick = controls.Joystick(joy, joydef)
                    return
    print('{}: Failed to find matching joystick.'.format(__name__))