code: def is_constant(x):
      """Test ``x`` for constancy.
  
      Determine whether a vector is composed of all of the same elements
      and nothing else.
  
      Parameters
      ----------
      x : array-like, shape=(n_samples,)
          The time series vector.
  
      Examples
      --------
      >>> import numpy as np
      >>> x = np.array([1, 2, 3])
      >>> y = np.ones(3)
      >>> [is_constant(x), is_constant(y)]
      [False, True]
      """
      x = column_or_1d(x)  # type: np.ndarray
      return (x == x[0]).all()
  
file_path: pmdarima/pmdarima/arima/utils.py
imports: from sklearn.utils.validation import column_or_1d
  import numpy
  import warnings
  from ..None import context_managers
  from ..utils import get_callable
  from ..utils.array import diff, check_endog
  from ..compat.numpy import DTYPE
  from .None import stationarity
  from .None import seasonality
label_desc: Use image node_id 1 for calling a global function with example usage: is_constant(x) and returns: unknown