def sample(problem, N, num_levels, grid_jump, optimal_trajectories=None, local_optimization=False):
    """Generates model inputs using for Method of Morris.
    
    Returns a NumPy matrix containing the model inputs required for Method of
    Morris.  The resulting matrix has N rows and D columns, where D is the
    number of parameters.  These model inputs are intended to be used with
    :func:`SALib.analyze.morris.analyze`.
    
    Three variants of Morris' sampling for elementary effects is supported:
    
    - Vanilla Morris
    - Optimised trajectories when optimal_trajectories is set (using 
      Campolongo's enhancements from 2007 and optionally Ruano's enhancement from 2012)
    - Groups with optimised trajectories when optimal_trajectores is set and 
      the problem definition specifies groups
    
    At present, optimised trajectories is implemented using a brute-force
    approach, which can be very slow, especially if you require more than four
    trajectories.  Note that the number of factors makes little difference,
    but the ratio between number of optimal trajectories and the sample size
    results in an exponentially increasing number of scores that must be
    computed to find the optimal combination of trajectories.  We suggest going
    no higher than 4 from a pool of 100 samples.
    
    Update: With local_optimization = True, it is possible to go higher than the previously suggested 4 from 100.
    
    Parameters
    ----------
    problem : dict
        The problem definition
    N : int
        The number of samples to generate
    num_levels : int
        The number of grid levels
    grid_jump : int
        The grid jump size
    optimal_trajectories : int
        The number of optimal trajectories to sample (between 2 and N)
    local_optimization : bool
        Flag whether to use local optimization according to Ruano et al. (2012) 
        Speeds up the process tremendously for bigger N and num_levels.
        Stating this variable to be true causes the function to ignore gurobi.
    """
    if grid_jump >= num_levels:
        raise ValueError("grid_jump must be less than num_levels")

    if problem.get('groups'):
        sample = sample_groups(problem, N, num_levels, grid_jump)
    else:
        sample = sample_oat(problem, N, num_levels, grid_jump)

    if optimal_trajectories:
        
        assert type(optimal_trajectories) == int, \
            "Number of optimal trajectories should be an integer"
        
        if optimal_trajectories < 2:
            raise ValueError("The number of optimal trajectories must be set to 2 or more.")            
        if optimal_trajectories >= N:
            raise ValueError("The number of optimal trajectories should be less than the number of samples.")
        
        if _has_gurobi == False and local_optimization == False and 10 > optimal_trajectories:
            raise ValueError("Running optimal trajectories greater than values of 10 will take a long time.")
                
        sample = compute_optimised_trajectories(problem, 
                                                sample, 
                                                N, 
                                                optimal_trajectories,
                                                local_optimization)
        
    scale_samples(sample, problem['bounds'])
    return sample
dataset/ETHPy150Open SALib/SALib/SALib/sample/morris.py/sample/swapped operands of `>`