code: def test_generalised_signature_method():
      """Check that dimension and dim of output are correct."""
      # Build an array X, note that this is [n_sample, n_channels, length] shape.
      import esig
  
      n_channels = 3
      depth = 4
      X = np.random.randn(5, n_channels, 10)
  
      # Check the global dimension comes out correctly
      method = SignatureTransformer(depth=depth, window_name="global")
      assert (
          method.fit_transform(X).shape[1]
          == esig.sigdim(n_channels + 1, depth) - 1
      )
  
      # Check dyadic dim
      method = SignatureTransformer(
          depth=depth, window_name="dyadic", window_depth=3
      )
      assert (
          method.fit_transform(X).shape[1]
          == (esig.sigdim(n_channels + 1, depth) - 1) * 15
      )
  
      # Ensure an example
      X = np.array([[0, 1], [2, 3], [1, 1]]).reshape(-1, 2, 3)
      method = SignatureTransformer(depth=2, window_name="global")
      true_arr = np.array(
          [
              [
                  1.0,
                  2.0,
                  1.0,
                  0.5,
                  1.33333333,
                  -0.5,
                  0.66666667,
                  2.0,
                  -1.0,
                  1.5,
                  3.0,
                  0.5,
              ]
          ]
      )
      assert np.allclose(method.fit_transform(X), true_arr)
  
imports: import numpy
  import pytest
  from sktime.tests.test_switch import run_test_for_class
  from sktime.transformations.panel.signature_based import SignatureTransformer
label_desc: Use image node_id 1 for calling a global function with example usage: test_generalised_signature_method() without return types