code: def test_samples_to_frames(samples, hop_length, n_fft):
      frames = librosa.samples_to_frames(
          samples, hop_length=hop_length, n_fft=n_fft
      )
      samples = np.asanyarray(samples)
      assert frames.shape == samples.shape
      assert frames.ndim == samples.ndim
      if n_fft is None:
          assert np.allclose(samples, frames * hop_length)
      else:
          assert np.allclose(
              (samples - n_fft // 2) // hop_length, frames
          )
  
imports: import os
  import sys
  import warnings
  import librosa
  import numpy
  import pytest
label_desc: Use image node_id 2 for calling a global function with example usage: test_samples_to_frames(samples, hop_length, n_fft) without return types