observe()

auglib.observe.observe(x)[source]

Convenient function to observe a value.

Returns x() if x is of type auglib.observe.Base, otherwise just x.

Parameters

x (typing.Union[typing.Any, auglib.core.observe.Base]) – (observable) object

Return type

typing.Any

Returns

observed value

Examples

>>> import auglib
>>> auglib.seed(1)
>>> observe(99)
99
>>> o = IntUni(low=0, high=5)
>>> observe(o)
5
>>> observe(o)
3