code: def _get_epsilon(x, s, epsilon, n):
      if epsilon is None:
          h = EPS ** (1.0 / s) * np.maximum(np.abs(np.asarray(x)), 0.1)
      else:
          if np.isscalar(epsilon):
              h = np.empty(n)
              h.fill(epsilon)
          else:  # pragma : no cover
              h = np.asarray(epsilon)
              if h.shape != x.shape:
                  raise ValueError(
                      "If h is not a scalar it must have the same"
                      " shape as x."
                  )
      return np.asarray(h)
  
file_path: statsmodels/statsmodels/tools/numdiff.py
imports: import numpy
  from statsmodels.compat.pandas import Appender, Substitution
label_desc: Use image node_id 1 for calling a global function with example usage: _get_epsilon(x, s, epsilon, n) and returns: np