<commit_before>import json
import urllib2, urllib
import logging
logging.basicConfig()
logger = logging.getLogger('pbs_bullet.notifier')

class Notifier(object):
    def __init__(self, name, pb_token):
        self.token = pb_token
        self.name = name
        self.iden = self.create_listener()

    def create_listener(self):
        """
        Register this device to receive pushbullet notifications,
        and if successful return the identifier.
        """
        data = urllib.urlencode({'nickname':self.name, 'type':'streaming'})
        logger.debug("Adding %s to pushbullet." % self.name)
        request = urllib2.Request('https://api.pushbullet.com/v2/devices', data, headers={
            'Authorization':"Bearer %s" % self.token,
            'Accept':'*/*'
        })
        try:
            resp = urllib2.urlopen(request)
            return json.load(resp)['iden']<commit_msg>register as stream type<commit_after>import json
import urllib2, urllib
import logging
logging.basicConfig()
logger = logging.getLogger('pbs_bullet.notifier')

class Notifier(object):
    def __init__(self, name, pb_token):
        self.token = pb_token
        self.name = name
        self.iden = self.create_listener()

    def create_listener(self):
        """
        Register this device to receive pushbullet notifications,
        and if successful return the identifier.
        """
        data = urllib.urlencode({'nickname':self.name, 'type':'stream'})
        logger.debug("Adding %s to pushbullet." % self.name)
        request = urllib2.Request('https://api.pushbullet.com/v2/devices', data, headers={
            'Authorization':"Bearer %s" % self.token,
            'Accept':'*/*'
        })
        try:
            resp = urllib2.urlopen(request)
            return json.load(resp)['iden']
{'fraction_non_alphanumeric': 0.12589729431253452, 'fraction_numerical': 0.004417448923246825, 'mean_word_length': 2.63855421686747, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '309191', 'n_tokens_mistral': 535, 'n_tokens_neox': 526, 'n_words': 118}