<commit_before>import os
import re

from .base import Base

class Source(Base):

    def __init__(self, vim):
        Base.__init__(self, vim)

        self.name = 'minisnip'
        self.mark = '[minisnip]'
        self.min_pattern_length = 0
        self.minisnip_dir = '~/.vim/minisnip' # FIXME: self.vim.eval('g:minisnip_dir')
        self.snippets = os.listdir(os.path.expanduser(self.minisnip_dir))

    def gather_candidates(self, context):
        ft = context['filetype']
        ft_reg = '^_(' + format(ft.replace('.', '|')) + ')_'

        candidates = []<commit_msg>Delay the execution<commit_after>import os
import re

from .base import Base

class Source(Base):

    def __init__(self, vim):
        Base.__init__(self, vim)

        self.name = 'minisnip'
        self.mark = '[minisnip]'
        self.min_pattern_length = 0
        self.minisnip_dir = None
        self.snippets = []

    def gather_candidates(self, context):
        if not self.minisnip_dir:
            self.minisnip_dir = self.vim.eval('g:minisnip_dir')
            self.snippets = os.listdir(os.path.expanduser(self.minisnip_dir))

        ft = context['filetype']
        ft_reg = '^_(' + format(ft.replace('.', '|')) + ')_'

        candidates = []
{'fraction_non_alphanumeric': 0.1421647819063005, 'fraction_numerical': 0.0016155088852988692, 'mean_word_length': 2.560344827586207, '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': '5318495', 'n_tokens_mistral': 448, 'n_tokens_neox': 416, 'n_words': 76}