'save to file'

def save(self, name=None):

    import pickle
    name = (name if name else self.name)
    fun = self.func
    del self.func
    pickle.dump(self, open((name + '.pkl'), 'wb'))
    self.func = fun
    return self
