Checks if any value in x occurs more than once

    :param x: the time series to calculate the feature of
    :type x: numpy.ndarray
    :return: the value of this feature
    :return type: bool
420451
def has_duplicate(x):
    
    if not isinstance(x, (np.ndarray, pd.Series)):
        x = np.asarray(x)
    return x.size != np.unique(x).size
497464
def twice(self):
        
        def check(): #pylint: disable=missing-docstring
            return super(SinonExpectation, self).calledTwice
        self.valid_list.append(check)
        return self
1050734
def predict(self, X):
        
        X_ = self._check_array(X)
        return exp(dot(X_, self._coef))
538095
def has_duplicate_min(x):
    
    if not isinstance(x, (np.ndarray, pd.Series)):
        x = np.asarray(x)
    return np.sum(x == np.min(x)) >= 2
310047
def _unique(x):
    
    if x is None or len(x) == 0:
        return np.array([], dtype=np.int64)
    # WARNING: only keep positive values.
    # cluster=-1 means "unclustered".
    x = _as_array(x)
    x = x[x >= 0]
    bc = np.bincount(x)
    return np.nonzero(bc)[0]
619143
def checkFinite(value, name='value'):
        
        if math.isnan(value):
            raise GraphError('Encountered NaN %s' % (name,))
        elif math.isinf(value):
            raise GraphError('Encountered infinite %s' % (name,))
        return value
758914
def once(self):
        
        def check(): #pylint: disable=missing-docstring
            return super(SinonExpectation, self).calledOnce
        self.valid_list.append(check)
        return self
321901
def x(self):
        '''
        
        '''
        if None not in (self.x_min, self.x_max, self.x_step) and \
                self.x_min != self.x_max:
            x = np.arange(self.x_min, self.x_max+self.x_step-self.y_step*0.1, self.x_step)
        else:
            x = np.array([])
        return x
1292008
def one_over_x_like(x):
    
    if np.any(x < 0):
        return -np.Inf
    else:
        return -np.sum(np.log(x))
549473
def verify(self, x):
        
        if type(x) != type(self.data):
            raise TypeError("Input expected to be of type %s, got %s." %
                            (type(self.data).__name__, type(x).__name__))
        elif isinstance(x, np.ndarray):
            if x.ndim != 2:
                raise ValueError('Streamed array data must be two-dimensional')
            elif x.shape[1] != self.data.shape[1]:
                raise ValueError("Streamed array data expeced to have %d columns, "
                                 "got %d." % (self.data.shape[1], x.shape[1]))
        elif util.pd and isinstance(x, util.pd.DataFrame) and list(x.columns) != list(self.data.columns):
            raise IndexError("Input expected to have columns %s, got %s" %
                             (list(self.data.columns), list(x.columns)))
        elif isinstance(x, dict):
            if any(c not in x for c in self.data):
                raise IndexError("Input expected to have columns %s, got %s" %
                                 (sorted(self.data.keys()), sorted(x.keys())))
            elif len(set(len(v) for v in x.values())) > 1:
                raise ValueError("Input columns expected to have the "
                                 "same number of rows.")
161251
def valid_time(x: str) -> bool:
    
    if isinstance(x, str) and (
        re.match(TIME_PATTERN1, x) or re.match(TIME_PATTERN2, x)
    ):
        return True
    else:
        return False
767269
def any(self, axis=0, *args, **kwargs):
        
        nv.validate_any(args, kwargs)

        values = self.sp_values

        if len(values) != len(self) and np.any(self.fill_value):
            return True

        return values.any().item()
1001725
def X(self, value):
        """"""
        if isinstance(value, (int, float,
                              long, types.NoneType)):
            self._x = value
1181560
def is_timeseries(nc, variable):
    '''
    
    '''

    # x, y, z, t(o)
    # X(o)
    dims = nc.variables[variable].dimensions

    cmatrix = coordinate_dimension_matrix(nc)
    for req in ('x', 'y', 't'):
        if req not in cmatrix:
            return False
    if len(cmatrix['x']) != 0:
        return False
    if len(cmatrix['y']) != 0:
        return False
    if 'z' in cmatrix and len(cmatrix['z']) != 0:
        return False
    timevar = get_time_variable(nc)

    # time has to be a coordinate variable in this case
    if cmatrix['t'] != (timevar,):
        return False
    if dims == cmatrix['t']:
        return True
    return False
1030311
def _check_input(self, X):
        
        if np.ndim(X) == 1:
            X = np.reshape(X, (1, -1))

        if X.ndim != 2:
            raise ValueError("Your data is not a 2D matrix. "
                             "Actual size: {0}".format(X.shape))

        if X.shape[1] != self.data_dimensionality:
            raise ValueError("Your data size != weight dim: {0}, "
                             "expected {1}".format(X.shape[1],
                                                   self.data_dimensionality))
        return X
1096009
def F(self, x):
        
        if isinstance(x, np.ndarray):
            nfwvals = np.ones_like(x)
            inds1 = np.where(x < 1)
            inds2 = np.where(x > 1)
            nfwvals[inds1] = (1 - x[inds1] ** 2) ** -.5 * np.arctanh((1 - x[inds1] ** 2) ** .5)
            nfwvals[inds2] = (x[inds2] ** 2 - 1) ** -.5 * np.arctan((x[inds2] ** 2 - 1) ** .5)
            return nfwvals

        elif isinstance(x, float) or isinstance(x, int):
            if x == 1:
                return 1
            if x < 1:
                return (1 - x ** 2) ** -.5 * np.arctanh((1 - x ** 2) ** .5)
            else:
                return (x ** 2 - 1) ** -.5 * np.arctan((x ** 2 - 1) ** .5)
429144
def assert_daily(var):
    """

    t0, t1 = var.time[:2]

    # This won't work for non-standard calendars. Needs to be implemented in xarray. Comment for now
    if isinstance(t0.values, np.datetime64):
        if pd.infer_freq(var.time.to_pandas()) != 'D':
            raise ValueError("time series is not recognized as daily.")

    # Check that the first time step is one day.
    if np.timedelta64(dt.timedelta(days=1)) != (t1 - t0).data:
        raise ValueError("time series is not daily.")

    # Check that the series has the same time step throughout
    if not var.time.to_pandas().is_monotonic_increasing:
        raise ValueError("time index is not monotonically increasing.")