<commit_before>import bz2
import urllib2
from datetime import datetime
import xml.etree.cElementTree as etree

from idiokit import threado, timer
from abusehelper.core import bot, events, utils

def decode(s, encodings=('ascii', 'utf8', 'latin1')):
    for encoding in encodings:
        try:
                return s.decode(encoding)
        except UnicodeDecodeError:
                pass
    return s.decode('ascii', 'ignore')

class HeadRequest(urllib2.Request):
    def get_method(self):
        return "HEAD"

class PhishtankBot(bot.PollingBot):
    application_key = bot.Param("Registered application key for Phistank.")
    feed_url = bot.Param(default="http://data.phishtank.com/data/%s/online-valid.xml.bz2")

    def __init__(self, *args, **keys):
        bot.PollingBot.__init__(self, *args, **keys)
        self.full_feed = self.feed_url % self.application_key<commit_msg>phistankbot: Removed unnecessary encodings from decode()<commit_after>import bz2
import urllib2
from datetime import datetime
import xml.etree.cElementTree as etree

from idiokit import threado, timer
from abusehelper.core import bot, events, utils

def decode(s, encodings=['latin1']):
    for encoding in encodings:
        try:
            return s.decode(encoding)
        except UnicodeDecodeError:
            pass
    return s.decode('utf-8', 'ignore')

class HeadRequest(urllib2.Request):
    def get_method(self):
        return "HEAD"

class PhishtankBot(bot.PollingBot):
    application_key = bot.Param("Registered application key for Phistank.")
    feed_url = bot.Param(default="http://data.phishtank.com/data/%s/online-valid.xml.bz2")

    def __init__(self, *args, **keys):
        bot.PollingBot.__init__(self, *args, **keys)
        self.full_feed = self.feed_url % self.application_key
{'fraction_non_alphanumeric': 0.10961968680089486, 'fraction_numerical': 0.006711409395973154, 'mean_word_length': 3.5989717223650386, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '2747081', 'n_tokens_mistral': 575, 'n_tokens_neox': 560, 'n_words': 136}