code: def test_signal_framing():
      # tap length = 1
      taps, delay = 0, 1
      X = ComplexTensor(
          torch.rand(2, 10, 6, 20), torch.rand(2, 10, 6, 20)
      )
      X2 = signal_framing(X, taps + 1, 1, delay, do_padding=False)
      assert FC.allclose(X, X2.squeeze(-1))
  
      # tap length > 1, no padding
      taps, delay = 5, 3
      X = ComplexTensor(
          torch.rand(2, 10, 6, 20), torch.rand(2, 10, 6, 20)
      )
      X2 = signal_framing(X, taps + 1, 1, delay, do_padding=False)
      assert X2.shape == torch.Size(
          [2, 10, 6, 20 - taps - delay + 1, taps + 1]
      )
      assert FC.allclose(X2[..., 0], X[..., : 20 - taps - delay + 1])
  
      # tap length > 1, padding
      taps, delay = 5, 3
      X = ComplexTensor(
          torch.rand(2, 10, 6, 20), torch.rand(2, 10, 6, 20)
      )
      X2 = signal_framing(X, taps + 1, 1, delay, do_padding=True)
      assert X2.shape == torch.Size([2, 10, 6, 20, taps + 1])
      assert FC.allclose(X2[..., -1], X)
  
file_path: espnet/test/espnet2/enh/layers/test_enh_layers.py
imports: import numpy
  import pytest
  import torch
  import torch_complex.functional
  from packaging.version import parse
  from torch_complex.tensor import ComplexTensor
  from espnet2.enh.layers.beamformer import generalized_eigenvalue_decomposition, get_rtf, gev_phase_correction, signal_framing
  from espnet2.enh.layers.complex_utils import solve
  from espnet2.layers.stft import Stft
label_desc: Use image node_id 2 for calling a global function with example usage: test_signal_framing() without return types