code: def sample(problem, seed=None):
      """Generates model inputs using a fractional factorial sample.
  
      Returns a NumPy matrix containing the model inputs required for a
      fractional factorial analysis.
      The resulting matrix has D columns, where D is smallest power of 2 that is
      greater than the number of parameters.
      These model inputs are intended to be used with
      :func:`SALib.analyze.ff.analyze`.
  
      The problem file is padded with a number of dummy variables called
      ``dummy_0`` required for this procedure. These dummy variables can be used
      as a check for errors in the analyze procedure.
  
      This algorithm is an implementation of that contained in Saltelli et al
      [`Saltelli et al. 2008 <http://doi.org/10.1002/9780470725184>`_]
  
      Parameters
      ----------
      problem : dict
          The problem definition
      seed : int
          Seed to generate a random number
  
      Returns
      -------
      sample : :class:`numpy.array`
  
      References
      ----------
      1. Saltelli, A., Ratto, M., Andres, T., Campolongo, F.,
         Cariboni, J., Gatelli, D., Saisana, M., Tarantola, S., 2008.
         Global Sensitivity Analysis: The Primer.
         Wiley, West Sussex, U.K.
         http://doi.org/10.1002/9780470725184
      """
      if seed:
          np.random.seed(seed)
      contrast = generate_contrast(problem)
      sample = np.array((contrast + 1.0) / 2, dtype=float)
      problem = extend_bounds(problem)
  
      sample = scale_samples(sample, problem)
      return sample
  
file_path: SALib/src/SALib/sample/ff.py
imports: from scipy.linalg import hadamard
  import numpy
  from .None import common_args
  from ..util import scale_samples, read_param_file
label_desc: Use image node_id 4 for calling a global function with example usage: sample(problem, seed) and returns: sample