code: def _get_parameters(times, *params):
      """Gets parameter values at at specified `times`."""
      res = []
      for param in params:
          if (
              hasattr(param, "is_piecewise_constant")
              and param.is_piecewise_constant
          ):
              jump_locations = param.jump_locations()
              if jump_locations.shape.rank > 1:
                  # Shape [num_times, dim]
                  res.append(tf.transpose(param(times)))
              else:
                  # When rank is 1, this means that this is a correlation matrix parameter
                  # and no transpose is necessary
                  # Shape [num_times, dim]
                  res.append(param(times))
          elif callable(param):
              # Used only in drift and volatility computation.
              # Here `times` is of shape [1]
              t = tf.squeeze(times)
              # The result has to have shape [1] + param.shape
              res.append(tf.expand_dims(param(t), 0))
          else:
              res.append(
                  param
                  + tf.zeros(
                      times.shape + param.shape, dtype=times.dtype
                  )
              )
      return res
  
imports: from typing import Callable, Union, Tuple, Optional
  import tensorflow.compat.v2
  from tf_quant_finance import types
  from tf_quant_finance import utils
  from tf_quant_finance.math import gradient
  from tf_quant_finance.math import piecewise
  from tf_quant_finance.math import random
  from tf_quant_finance.models import euler_sampling
  from tf_quant_finance.models import generic_ito_process
  from tf_quant_finance.models import utils
label_desc: Use image node_id 1 for calling a global function with example usage: _get_parameters(times) and returns: res