code: def _compute_optimised_trajectories(
      problem: Dict,
      input_sample: int,
      N: int,
      k_choices: int,
      local_optimization: bool = False,
  ) -> np.ndarray:
      """
      Calls the procedure to compute the optimum k_choices of trajectories
      from the input_sample.
      If there are groups, then this procedure allocates the groups to the
      correct call here.
  
      Parameters
      ---------
      problem : dict
          The problem definition
      input_sample :
      N : int
          The number of samples to generate
      k_choices : int
          The number of optimal trajectories
      local_optimization : bool, default=False
          If true, uses local optimisation heuristic
      """
      if local_optimization is False and k_choices > 10:
          msg = "Running optimal trajectories greater than values of 10 \
                  will take a long time."
          raise ValueError(msg)
  
      if np.any((input_sample < 0) | (input_sample > 1)):
          raise ValueError(
              "Input sample must be scaled between 0 and 1"
          )
  
      num_groups = len(set(problem["groups"]))
      num_params = problem["num_vars"]
  
      strategy = _choose_optimization_strategy(local_optimization)
      context = SampleMorris(strategy)
  
      output = context.sample(
          input_sample, N, num_params, k_choices, num_groups
      )
  
      return output
  
imports: import numpy
  from typing import Dict
  import numpy.random
  import warnings
  from .local import LocalOptimisation
  from .brute import BruteForce
  from .strategy import SampleMorris
  from SALib.sample import common_args
  from SALib.util import scale_samples, read_param_file, compute_groups_matrix, _define_problem_with_groups, _compute_delta, _check_groups
label_desc: Use image node_id 7 for calling a global function with example usage: _compute_optimised_trajectories(problem, input_sample, N, k_choices, local_optimization) and returns: output