code: def test_generate_kernels(
      n_kernels, n_timestamps, kernel_sizes, seed
  ):
      """Test the generated kernels."""
      kernel_sizes = np.asarray(kernel_sizes)
      weights, lengths, biases, dilations, paddings = generate_kernels(
          n_kernels, n_timestamps, kernel_sizes, seed
      )
      # Check shapes
      assert weights.shape == (n_kernels, max(kernel_sizes))
      for arr in (lengths, biases, dilations, paddings):
          assert arr.shape == (n_kernels,)
  
      # Check range of values
      assert np.all(np.isin(lengths, kernel_sizes))
      assert np.all(np.logical_and(-1 <= biases, biases <= 1))
      (n_timestamps - 1) // (min(kernel_sizes) - 1)
      upper_bound_dilation = (n_timestamps - 1) // (
          min(kernel_sizes) - 1
      )
      assert np.all(
          np.logical_and(
              1 <= dilations, dilations <= upper_bound_dilation
          )
      )
      upper_bound_padding = (
          (lengths - 1) * (n_timestamps - 1) // (min(kernel_sizes) - 1)
      ) // 2
      assert np.all(
          np.logical_and(0 <= paddings, paddings <= upper_bound_padding)
      )
  
      # Check zero mean of weights
      np.testing.assert_allclose(
          weights.mean(axis=1), 0, rtol=0, atol=1e-5
      )
  
file_path: pyts/pyts/transformation/tests/test_rocket.py
imports: import numpy
  import pytest
  import re
  from pyts.transformation.rocket import generate_kernels, apply_one_kernel_one_sample, apply_all_kernels
  from pyts.transformation import ROCKET
label_desc: Use image node_id 1 for calling a global function with example usage: test_generate_kernels(n_kernels, n_timestamps, kernel_sizes, seed) without return types