<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def prepare_arrays(sim=None, obs=None, node=None, skip_nan=False):
 """Prepare and return two |numpy| arrays based on the given arguments. Note that many functions provided by module |statstools| apply function |prepare_arrays| internally (e.g. |nse|). But you can also apply it manually, as shown in the following examples. Function |prepare_arrays| can extract time series data from |Node| objects. To set up an example for this, we define a initialization time period and prepare a |Node| object: Next, we assign values the `simulation` and the `observation` sequences (to do so for the `observation` sequence requires a little trick, as its values are normally supposed to be read from a file):
 Now we can pass the node object to function |prepare_arrays| and get the (unmodified) time series data: 1.0, nan, nan, nan, 2.0, 3.0 4.0, 5.0, nan, nan, nan, 6.0 Alternatively, we can pass directly any iterables (e.g. |list| and |tuple| objects) containing the `simulated` and `observed` data: 1.0, nan, nan, nan, 2.0, 3.0 4.0, 5.0, nan, nan, nan, 6.0 The optional `skip_nan` flag allows to skip all values, which are no numbers. Note that only those pairs of `simulated` and `observed` values are returned which do not contain any `nan`: 1.0, 3.0 4.0, 6.0 The final examples show the error messages returned in case of invalid combinations of input arguments: Traceback (most recent call last):
 ValueError: Neither a `Node` object is passed to argument `node` nor \ are arrays passed to arguments `sim` and `obs`. Traceback (most recent call last):
 ValueError: Values are passed to both arguments `sim` and `node`, \ which is not allowed. Traceback (most recent call last):
 ValueError: Values are passed to both arguments `obs` and `node`, \ which is not allowed. Traceback (most recent call last):
 ValueError: A value is passed to argument `sim` but \ no value is passed to argument `obs`. Traceback (most recent call last):
 ValueError: A value is passed to argument `obs` but \ no value is passed to argument `sim`. """

    if node:
        if sim is not None:
            raise ValueError(
                'Values are passed to both arguments `sim` and `node`, '
                'which is not allowed.')
        if obs is not None:
            raise ValueError(
                'Values are passed to both arguments `obs` and `node`, '
                'which is not allowed.')
        sim = node.sequences.sim.series
        obs = node.sequences.obs.series
    elif (sim is not None) and (obs is None):
        raise ValueError(
            'A value is passed to argument `sim` '
            'but no value is passed to argument `obs`.')
    elif (obs is not None) and (sim is None):
        raise ValueError(
            'A value is passed to argument `obs` '
            'but no value is passed to argument `sim`.')
    elif (sim is None) and (obs is None):
        raise ValueError(
            'Neither a `Node` object is passed to argument `node` nor '
            'are arrays passed to arguments `sim` and `obs`.')
    sim = numpy.asarray(sim)
    obs = numpy.asarray(obs)
    if skip_nan:
        idxs = ~numpy.isnan(sim) * ~numpy.isnan(obs)
        sim = sim[idxs]
        obs = obs[idxs]
    return sim, obs