def wrapkern(obj): if isinstance(obj, ArithmeticModel): return obj elif callable(obj): return ArithmeticFunctionModel(obj) return ArithmeticConstantModel(obj, 'kernel')
def wrapobj(obj): if isinstance(obj, ArithmeticModel): return obj return ArithmeticFunctionModel(obj)