<commit_before>#-*- encoding: utf-8
"""
Base class for extension modules to inherit.
"""
from helpers import *

class Command:
    def __init__(self, app):
        self.app = app
        self.init()

    def init(self):
        pass<commit_msg>Added capability to bind key to run method.<commit_after>#-*- encoding: utf-8
"""
Base class for extension modules to inherit.
"""
from helpers import *

class Command:
    def __init__(self, app):
        self.app = app
        self.init()

    def init(self):
        pass

    def bind_key(self, key):
        """Shortcut for binding run method to a key."""
        self.app.set_key_binding(key, self._proxy_run)
        
    def _proxy_run(self):
        self.run(self.app, self.app.get_editor())
{'fraction_non_alphanumeric': 0.12096774193548387, 'fraction_numerical': 0.002688172043010753, 'mean_word_length': 2.5476190476190474, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1395799', 'n_tokens_mistral': 231, 'n_tokens_neox': 227, 'n_words': 71}