<commit_before>"""
Triggers API.
"""
from pax.exceptions import PaxException
import logging

log = logging.getLogger('djax')

class TriggerClient(object):
    """
    Client for Triggers API.
    """
    def __init__(self,axilent_connection):
        self.api = axilent_connection.http_client('axilent.triggers')
    
    def trigger(self,category,action,profile=None,variables={},environment={},identity={}):
        """
        Sends a trigger to Axilent.
        """
        log.debug('Sending trigger with profile:%s' % unicode(profile))
        self.api.trigger(data={'category':category,
                               'action':action,
                               'profile':profile,
                               'variables':variables,
                               'environment':environment,
                               'identity':identity},
                               local_param_check=False)


    def profile(self):
        """
        Gets a profile to use with triggers and content channels.
        """
        return self.api.profile()
<commit_msg>properly unpacking profile id from server.<commit_after>"""
Triggers API.
"""
from pax.exceptions import PaxException
import logging

log = logging.getLogger('djax')

class TriggerClient(object):
    """
    Client for Triggers API.
    """
    def __init__(self,axilent_connection):
        self.api = axilent_connection.http_client('axilent.triggers')
    
    def trigger(self,category,action,profile=None,variables={},environment={},identity={}):
        """
        Sends a trigger to Axilent.
        """
        self.api.trigger(data={'category':category,
                               'action':action,
                               'profile':profile,
                               'variables':variables,
                               'environment':environment,
                               'identity':identity},
                               local_param_check=False)


    def profile(self):
        """
        Gets a profile to use with triggers and content channels.
        """
        return self.api.profile()['profile']

{'fraction_non_alphanumeric': 0.11200378071833648, 'fraction_numerical': 0.0, 'mean_word_length': 1.8378016085790885, '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': '5582594', 'n_tokens_mistral': 533, 'n_tokens_neox': 523, 'n_words': 108}