<commit_before>'''
Render the pillar data
'''

# Import python libs
import os
import copy
import collections

# Import Salt libs
import salt.loader
import salt.fileclient
import salt.minion

class Pillar(object):
    '''
    Read over the pillar top files and render the pillar data
    '''
    def __init__(self, opts, grains):
        # use the local file client
        self.opts = copy.deepcopy(opts)
        self.opts['file_roots'] = self.opts['pillar_roots']
        self.opts['file_client'] = 'local'
        self.opts['grains'] = grains
        self.client = salt.fileclient.get_file_client(self.opts)
        self.matcher = salt.minion.Matcher(self.opts)
        self.rend = salt.loader.render(opts, {})

    def _get_envs(self):
        '''
        Pull the file server environments out of the master options
        '''
        envs = set(['base'])
        if 'file_roots' in self.opts:
            envs.update(self.opts['file_roots'].keys())
        return envs

    def template_shebang(self, template):
        '''
        Check the template shebang line and return the renderer
        '''
        # Open up the first line of the sls template
        line = ''
        with open(template, 'r') as f:
            line = f.readline()
        # Check if it starts with a shebang
        if line.startswith('#!'):
            # pull out the shebang data
            trend = line.strip()[2:]
            # If the specified renderer exists, use it, or fallback<commit_msg>Add id to pillar object<commit_after>'''
Render the pillar data
'''

# Import python libs
import os
import copy
import collections

# Import Salt libs
import salt.loader
import salt.fileclient
import salt.minion

class Pillar(object):
    '''
    Read over the pillar top files and render the pillar data
    '''
    def __init__(self, opts, grains, id_):
        # use the local file client
        self.opts = copy.deepcopy(opts)
        self.opts['file_roots'] = self.opts['pillar_roots']
        self.opts['file_client'] = 'local'
        self.opts['grains'] = grains
        self.opts['id'] = id_
        self.client = salt.fileclient.get_file_client(self.opts)
        self.matcher = salt.minion.Matcher(self.opts)
        self.rend = salt.loader.render(opts, {})

    def _get_envs(self):
        '''
        Pull the file server environments out of the master options
        '''
        envs = set(['base'])
        if 'file_roots' in self.opts:
            envs.update(self.opts['file_roots'].keys())
        return envs

    def template_shebang(self, template):
        '''
        Check the template shebang line and return the renderer
        '''
        # Open up the first line of the sls template
        line = ''
        with open(template, 'r') as f:
            line = f.readline()
        # Check if it starts with a shebang
        if line.startswith('#!'):
            # pull out the shebang data
            trend = line.strip()[2:]
            # If the specified renderer exists, use it, or fallback
{'fraction_non_alphanumeric': 0.1067509145327569, 'fraction_numerical': 0.0006651147322913202, 'mean_word_length': 2.2624728850325377, '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': '1301586', 'n_tokens_mistral': 888, 'n_tokens_neox': 862, 'n_words': 274}