code: def sample(
      problem: Dict,
      N: int,
      delta: float = 0.01,
      seed: int = None,
      skip_values: int = 1024,
  ) -> np.ndarray:
      """
      Generate matrix of samples for Derivative-based Global Sensitivity Measure (DGSM).
  
      Start from a QMC (Sobol') sequence and finite difference with delta % steps
  
      Parameters
      ----------
      problem : dict
          SALib problem specification
      N : int
          Number of samples
      delta : float
          Finite difference step size (percent)
      seed : int or None
          Random seed value
      skip_values : int
          How many values of the Sobol sequence to skip
  
      Returns
      -------
      np.array : DGSM sequence
  
      References
      ----------
      1. Sobol', I.M., Kucherenko, S., 2009.
         Derivative based global sensitivity measures and their link with
         global sensitivity indices.
         Mathematics and Computers in Simulation 79, 3009-3017.
         https://doi.org/10.1016/j.matcom.2009.01.023
  
      2. Sobol', I.M., Kucherenko, S., 2010.
         Derivative based global sensitivity measures.
         Procedia - Social and Behavioral Sciences 2, 7745-7746.
         https://doi.org/10.1016/j.sbspro.2010.05.208
      """
      if seed:
          np.random.seed(seed)
  
      D = problem["num_vars"]
      bounds = problem["bounds"]
  
      # Create base sequence - could be any type of sampling
      base_sequence = sobol_sequence.sample(N + skip_values, D)
  
      # scale before finite differencing
      base_sequence = scale_samples(base_sequence, problem)
  
      dgsm_sequence = np.empty([N * (D + 1), D])
  
      index = 0
      for i in range(skip_values, N + skip_values):
          # Copy the initial point
          dgsm_sequence[index, :] = base_sequence[i, :]
  
          index += 1
          for j in range(D):
              temp = np.zeros(D)
              bnd_j = bounds[j]
              temp[j] = base_sequence[i, j] * delta
              dgsm_sequence[index, :] = base_sequence[i, :] + temp
              dgsm_sequence[index, j] = min(
                  dgsm_sequence[index, j], bnd_j[1]
              )
              dgsm_sequence[index, j] = max(
                  dgsm_sequence[index, j], bnd_j[0]
              )
              index += 1
  
      return dgsm_sequence
  
file_path: SALib/src/SALib/sample/finite_diff.py
imports: from typing import Dict
  import numpy
  from .None import common_args
  from .None import sobol_sequence
  from ..util import scale_samples, read_param_file
label_desc: Use image node_id 1 for calling a global function with example usage: sample(problem, N, delta, seed, skip_values) and returns: dgsm_sequence