code: def _check_inputs(frequency, recency=None, T=None, monetary_value=None):
      
      if recency is not None:
          if T is not None and np.any(recency > T):
              raise ValueError("Some values in recency vector are larger than T vector.")
          if np.any(recency[frequency == 0] != 0):
              raise ValueError("There exist non-zero recency values when frequency is zero.")
          if np.any(recency < 0):
              raise ValueError("There exist negative recency (ex: last order set before first order)")
          if any(x.shape[0] == 0 for x in [recency, frequency, T]):
              raise ValueError("There exists a zero length vector in one of frequency, recency or T.")
      if np.sum((frequency - frequency.astype(int)) ** 2) != 0:
          raise ValueError("There exist non-integer values in the frequency vector.")
      if monetary_value is not None and np.any(monetary_value <= 0):
          raise ValueError("There exist non-positive values in the monetary_value vector.")
docs: Check validity of inputs.
  
      Raises ValueError when checks failed.
  
      Parameters
      ----------
      frequency: array_like
          the frequency vector of customers' purchases (denoted x in literature).
      recency: array_like, optional
          the recency vector of customers' purchases (denoted t_x in literature).
      T: array_like, optional
          the vector of customers' age (time since first purchase)
      monetary_value: array_like, optional
          the monetary value vector of customer's purchases (denoted m in literature).