@@ -0,0 +1,1142 @@
+#!/usr/bin/env python%0Aimport cPickle as pickle%0Afrom time import time%0Afrom datetime import datetime%0A%0Afrom .data import ObjectStore%0Afrom ..features.mapping import FEATURE_MAPPERS%0A%0Aimport logging%0Alog = logging.getLogger()%0A%0Aclass Classifier(object):%0A    mid = 'models:classifiers'%0A    def __init__(self, name):%0A        self.name = name%0A        dm = ObjectStore.Get(self.mid).fetch(name)%0A        if dm:%0A            # undo the data store encoding here - it's really binary data%0A            self.model = pickle.loads(dm%5B'data'%5D.encode('utf-8'))%0A            self.mapper = FEATURE_MAPPERS%5Bdm%5B'mapping'%5D%5B'name'%5D%5D(**dm%5B'mapping'%5D%5B'params'%5D)%0A        else:%0A            raise Exception('No classifier for name (%25s) in store', self.name)%0A%0A    @classmethod%0A    def create(cls, name, mapping, data, metadata = %7B%7D):%0A        timestamp = datetime.fromtimestamp(time()).strftime('%25Y-%25m-%25d %25H:%25M:%25S')%0A        log.info('Storing classifier model (%25s)...', name)%0A        ObjectStore.Get(cls.mid).save(%7B%0A            '_id': name,%0A            'created_at': timestamp,%0A            'mapping': mapping,%0A            'data': data,%0A            'metadata': metadata%0A        %7D)%0A

Fix more missing modules