Utilities#
Cake offers basic utilities pre-written for its users to use, these are usually designed to help assist users with writing there own versions of our elements in the module.
- cake.utils.solve_if_possible(__x_v: Any, /, **kwds) Any[source]#
Attempts to solve a given value if possible else returns original value.
>>> f = Sqrt(Variable('x') + 3) >>> f Sqrt(x + 3) >>> utils.solve_if_possible(f, x=6) Real(3.0) >>> utils.solve_if_possible(Real(5), x=3) Real(5.0)