code: def unique_count(X):
      """Numba unique value count function for a 1d numpy array.
  
      np.unique() is supported by numba, but the return_counts parameter is not.
  
      Parameters
      ----------
      X : 1d numpy array
          A 1d numpy array of values
  
      Returns
      -------
      unique : 1d numpy array
          The unique values in X
      counts : 1d numpy array
          The occurrence count for each unique value in X
      """
      if X.shape[0] > 0:
          X = np.sort(X)
          unique = np.zeros(X.shape[0])
          unique[0] = X[0]
          counts = np.zeros(X.shape[0], dtype=np.int_)
          counts[0] = 1
          unique_count = 0
  
          for i in X[1:]:
              if i != unique[unique_count]:
                  unique_count += 1
                  unique[unique_count] = i
                  counts[unique_count] = 1
              else:
                  counts[unique_count] += 1
          return unique[: unique_count + 1], counts[: unique_count + 1]
      return None, np.zeros(0, dtype=np.int_)
  
file_path: sktime/sktime/utils/numba/general.py
imports: from sktime.utils.validation._dependencies import _check_soft_dependencies
  import numpy
  import sktime.utils.numba.stats
  from sktime.utils.numba.njit import njit
label_desc: Use image node_id 1 for calling a global function with example usage: unique_count(X) and returns: None,  np, unique,  counts