def to_potential(f):
if   is_potential(f): return f<EOL>elif f is Ellipsis:   return identity<EOL>elif pimms.is_array(f, '<STR_LIT>'): return const_potential(f)<EOL>elif isinstance(f, tuple) and len(f) == <NUM_LIT:2>: return PotentialLambda(f[<NUM_LIT:0>], f[<NUM_LIT:1>])<EOL>else: raise ValueError('<STR_LIT>')<EOL>
to_potential(f) yields f if f is a potential function; if f is not, but f can be converted to
  a potential function, that conversion is performed then the result is yielded.
to_potential(Ellipsis) yields a potential function whose output is simply its input (i.e., the
  identity function).
to_potential(None) is equivalent to to_potential(0).

The following can be converted into potential functions:
  * Anything for which pimms.is_array(x, 'number') yields True (i.e., arrays of constants).
  * Any tuple (g, h) where g(x) yields a potential value and h(x) yields a jacobian matrix for
    the parameter vector x.