@compute.register(Expr, object)
def compute_single_object(expr, o, **kwargs):
 ts = set([x for x in expr._subterms() if isinstance(x, Symbol)])
 if (len(ts) == 1):
  return compute(expr, {first(ts): o}, **kwargs)
 else:
  raise ValueError(('Give compute dictionary input, got %s' % str(o)))

@ compute . register ( Expr , object ) def compute_single_object ( expr , o , ** kwargs ) : ts = set ( [ x for x in expr . _subterms ( ) if isinstance ( x , Symbol ) ] ) if ( len ( ts ) == 1 ) : return compute ( expr , { first ( ts ) : o } , ** kwargs ) else : raise ValueError ( ( 'Give compute dictionary input, got %s' % str ( o ) ) )
compute against single input assumes that only one symbol exists in expression .