# Path: easy_karabiner/query.py
# class DefinitionBucket(object):
#     """This class is used to store global `Definition` objects,
#     so we can create a `Definition` object from anywhere,
#     and found it by the original value used to define.
#     """
#     def __init__(self):
#         self.buckets = {
#             'filter': {},
#             'key': {},
#         }
# 
#     @classmethod
#     def get_instance(cls, reset=False):
#         if not hasattr(cls, '_instance') or reset:
#             cls._instance = cls()
#         return cls._instance
# 
#     @classmethod
#     def get_all_definitions(cls):
#         list_of_defos = [d.values() for d in cls.get_instance().buckets.values()]
#         defos = set(chain.from_iterable(chain.from_iterable(list_of_defos)))
#         return sorted(defos, key=lambda f: (f.get_def_tag_name(), f.get_name()))
# 
#     @classmethod
#     def put(cls, category, name, definitions):
#         cls.get_instance().buckets[category][name] = definitions
# 
#     @classmethod
#     def get(cls, category, name):
#         return cls.get_instance().buckets[category].get(name)
# 
#     @classmethod
#     def has(cls, category, name):
#         return name in cls.get_instance().buckets[category]
# 
#     @classmethod
#     def clear(cls):
#         cls.get_instance(reset=True)


from easy_karabiner.query import DefinitionBucket
from easy_karabiner.parse import *
            PointingButton::LEFT, KeyCode::VK_OPEN_URL_760efb2
          </autogen>
        </block>
        <block>
          <uielementrole_only>custom_ui</uielementrole_only>
          <autogen> __KeyToKey__
            KeyCode::E, ModifierFlag::OPTION_L, ModifierFlag::NONE,
            KeyCode::VK_OPEN_URL_Finder
          </autogen>
        </block>
        <block>
          <device_only>
            DeviceVendor::built_in_keyboard_and_trackpad_VENDOR,
            DeviceProduct::built_in_keyboard_and_trackpad_PRODUCT
          </device_only>
          <modifier_only>ModifierFlag::COMMAND_L</modifier_only>
          <only>Finder</only>
          <autogen> __FlipScrollWheel__
            Option::FLIPSCROLLWHEEL_VERTICAL
          </autogen>
        </block>
        <block>
          <only>VIRTUALMACHINE</only>
          <autogen> __KeyToKey__
            KeyCode::F, ModifierFlag::CONTROL_L, ModifierFlag::COMMAND_L, ModifierFlag::NONE,
            KeyCode::F, ModifierFlag::COMMAND_L
          </autogen>
        </block>
    '''


# Path: easy_karabiner/query.py
# class DefinitionBucket(object):
#     """This class is used to store global `Definition` objects,
#     so we can create a `Definition` object from anywhere,
#     and found it by the original value used to define.
#     """
#     def __init__(self):
#         self.buckets = {
#             'filter': {},
#             'key': {},
#         }
# 
#     @classmethod
#     def get_instance(cls, reset=False):
#         if not hasattr(cls, '_instance') or reset:
#             cls._instance = cls()
#         return cls._instance
# 
#     @classmethod
#     def get_all_definitions(cls):
#         list_of_defos = [d.values() for d in cls.get_instance().buckets.values()]
#         defos = set(chain.from_iterable(chain.from_iterable(list_of_defos)))
#         return sorted(defos, key=lambda f: (f.get_def_tag_name(), f.get_name()))
# 
#     @classmethod
#     def put(cls, category, name, definitions):
#         cls.get_instance().buckets[category][name] = definitions
# 
#     @classmethod
#     def get(cls, category, name):
#         return cls.get_instance().buckets[category].get(name)
# 
#     @classmethod
#     def has(cls, category, name):
#         return name in cls.get_instance().buckets[category]
# 
#     @classmethod
#     def clear(cls):
#         cls.get_instance(reset=True)


# Path: tests/test_parse.py
from easy_karabiner.query import DefinitionBucket
from easy_karabiner.parse import *

            PointingButton::LEFT, KeyCode::VK_OPEN_URL_760efb2
          </autogen>
        </block>
        <block>
          <uielementrole_only>custom_ui</uielementrole_only>
          <autogen> __KeyToKey__
            KeyCode::E, ModifierFlag::OPTION_L, ModifierFlag::NONE,
            KeyCode::VK_OPEN_URL_Finder
          </autogen>
        </block>
        <block>
          <device_only>
            DeviceVendor::built_in_keyboard_and_trackpad_VENDOR,
            DeviceProduct::built_in_keyboard_and_trackpad_PRODUCT
          </device_only>
          <modifier_only>ModifierFlag::COMMAND_L</modifier_only>
          <only>Finder</only>
          <autogen> __FlipScrollWheel__
            Option::FLIPSCROLLWHEEL_VERTICAL
          </autogen>
        </block>
        <block>
          <only>VIRTUALMACHINE</only>
          <autogen> __KeyToKey__
            KeyCode::F, ModifierFlag::CONTROL_L, ModifierFlag::COMMAND_L, ModifierFlag::NONE,
            KeyCode::F, ModifierFlag::COMMAND_L
          </autogen>
        </block>
    '''


    DefinitionBucket.clear()