'Validate inputs to the model.
Parameters
t : array_like
times of observations
x : array_like (optional)
values observed at each time
sigma : float or array_like (optional)
errors in values x
Returns
t, x, sigma : array_like, float or None
validated and perhaps modified versions of inputs'

def validate_input(self, t, x=None, sigma=None):

    t = np.asarray(t, dtype=float)
    if (x is not None):
        x = np.asarray(x)
    if (sigma is not None):
        sigma = np.asarray(sigma)
    t = np.array(t)
    if (t.ndim != 1):
        raise ValueError(u't    must    be    a    one-dimensional    array')
    (unq_t, unq_ind, unq_inv) = np.unique(t, return_index=True, return_inverse=True)
    if (x is None):
        if (sigma is not None):
            raise ValueError(u'If    sigma    is    specified,    x    must    be    specified')
        else:
            sigma = 1
        if (len(unq_t) == len(t)):
            x = np.ones_like(t)
        else:
            x = np.bincount(unq_inv)
        t = unq_t
    else:
        x = np.asarray(x)
        if (x.shape not in [(), (1,), (t.size,)]):
            raise ValueError(u'x    does    not    match    shape    of    t')
        x += np.zeros_like(t)
        if (len(unq_t) != len(t)):
            raise ValueError(u'Repeated    values    in    t    not    supported    when    x    is    specified')
        t = unq_t
        x = x[unq_ind]
    if (sigma is None):
        sigma = 1
    else:
        sigma = np.asarray(sigma)
        if (sigma.shape not in [(), (1,), (t.size,)]):
            raise ValueError(u'sigma    does    not    match    the    shape    of    x')
    return (t, x, sigma)
