def number_observer(t=None, targets=None):
from ecell4_base.core import NumberObserver, FixedIntervalNumberObserver, TimingNumberObserver<EOL>if t is None:<EOL><INDENT>return NumberObserver(targets)<EOL><DEDENT>elif isinstance(t, numbers.Number):<EOL><INDENT>return FixedIntervalNumberObserver(t, targets)<EOL><DEDENT>elif hasattr(t, '<STR_LIT>'):<EOL><INDENT>if targets is not None:<EOL><INDENT>return TimingNumberObserver(t, targets)<EOL><DEDENT>else:<EOL><INDENT>return TimingNumberObserver(t)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>
Return a number observer. If t is None, return NumberObserver. If t is a number,
return FixedIntervalNumberObserver. If t is an iterable (a list of numbers), return
TimingNumberObserver.

Parameters
----------
t : float, list or tuple, optional. default None
    A timing of the observation. See above.
targets : list or tuple, optional. default None
    A list of strings suggesting Species observed.

Returns
-------
obs : NumberObserver, FixedIntervalNumberObserver or TimingNumberObserver