code: def _generate_kernels(n_timepoints, num_kernels, n_columns, seed):
      if seed is not None:
          np.random.seed(seed)
  
      candidate_lengths = np.array((7, 9, 11), dtype=np.int32)
      lengths = np.random.choice(candidate_lengths, num_kernels).astype(
          np.int32
      )
  
      num_channel_indices = np.zeros(num_kernels, dtype=np.int32)
      for i in range(num_kernels):
          limit = min(n_columns, lengths[i])
          num_channel_indices[i] = 2 ** np.random.uniform(
              0, np.log2(limit + 1)
          )
  
      channel_indices = np.zeros(
          num_channel_indices.sum(), dtype=np.int32
      )
  
      weights = np.zeros(
          np.int32(
              np.dot(
                  lengths.astype(np.float32),
                  num_channel_indices.astype(np.float32),
              )
          ),
          dtype=np.float32,
      )
      biases = np.zeros(num_kernels, dtype=np.float32)
      dilations = np.zeros(num_kernels, dtype=np.int32)
      paddings = np.zeros(num_kernels, dtype=np.int32)
  
      a1 = 0  # for weights
      a2 = 0  # for channel_indices
  
      for i in range(num_kernels):
          _length = lengths[i]
          _num_channel_indices = num_channel_indices[i]
  
          _weights = np.random.normal(
              0, 1, _num_channel_indices * _length
          ).astype(np.float32)
  
          b1 = a1 + (_num_channel_indices * _length)
          b2 = a2 + _num_channel_indices
  
          a3 = 0  # for weights (per channel)
          for _ in range(_num_channel_indices):
              b3 = a3 + _length
              _weights[a3:b3] = _weights[a3:b3] - _weights[a3:b3].mean()
              a3 = b3
  
          weights[a1:b1] = _weights
  
          channel_indices[a2:b2] = np.random.choice(
              np.arange(0, n_columns),
              _num_channel_indices,
              replace=False,
          )
  
          biases[i] = np.random.uniform(-1, 1)
  
          dilation = 2 ** np.random.uniform(
              0, np.log2((n_timepoints - 1) / (_length - 1))
          )
          dilation = np.int32(dilation)
          dilations[i] = dilation
  
          padding = (
              ((_length - 1) * dilation) // 2
              if np.random.randint(2) == 1
              else 0
          )
          paddings[i] = padding
  
          a1 = b1
          a2 = b2
  
      return (
          weights,
          lengths,
          biases,
          dilations,
          paddings,
          num_channel_indices,
          channel_indices,
      )
  
imports: import numpy
  from sktime.utils.numba.njit import njit
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 1 for calling a global function with example usage: _generate_kernels(n_timepoints, num_kernels, n_columns, seed) and returns: weights,  lengths,  biases,  dilations,  paddings,  num_channel_indices,  channel_indices