code: def test_crop():
      """Test TFR cropping."""
      data = np.zeros((3, 4, 5))
      times = np.array([0.1, 0.2, 0.3, 0.4, 0.5])
      freqs = np.array([0.10, 0.20, 0.30, 0.40])
      info = mne.create_info(
          ["MEG 001", "MEG 002", "MEG 003"],
          1000.0,
          ["mag", "mag", "mag"],
      )
      tfr = AverageTFR(
          info,
          data=data,
          times=times,
          freqs=freqs,
          nave=20,
          comment="test",
          method="crazy-tfr",
      )
  
      tfr.crop(tmin=0.2)
      assert_array_equal(tfr.times, [0.2, 0.3, 0.4, 0.5])
      assert tfr.data.ndim == 3
      assert tfr.data.shape[-1] == 4
  
      tfr.crop(fmax=0.3)
      assert_array_equal(tfr.freqs, [0.1, 0.2, 0.3])
      assert tfr.data.ndim == 3
      assert tfr.data.shape[-2] == 3
  
      tfr.crop(tmin=0.3, tmax=0.4, fmin=0.1, fmax=0.2)
      assert_array_equal(tfr.times, [0.3, 0.4])
      assert tfr.data.ndim == 3
      assert tfr.data.shape[-1] == 2
      assert_array_equal(tfr.freqs, [0.1, 0.2])
      assert tfr.data.shape[-2] == 2
  
imports: import datetime
  import re
  from itertools import product
  from pathlib import Path
  import matplotlib.pyplot
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal, assert_equal
  from scipy.signal import morlet2
  import mne
  from mne import Epochs, EpochsArray, Info, Transform, create_info, pick_types, read_events
  from mne.io import read_raw_fif
  from mne.tests.test_epochs import assert_metadata_equal
  from mne.time_frequency import tfr_array_morlet, tfr_array_multitaper
  from mne.time_frequency.tfr import AverageTFR, EpochsTFR, _compute_tfr, _make_dpss, combine_tfr, cwt, fwhm, morlet, read_tfrs, tfr_morlet, tfr_multitaper, write_tfrs
  from mne.utils import catch_logging, grand_average
  from mne.viz.utils import _fake_click, _fake_keypress, _fake_scroll
label_desc: Use image node_id 6 for calling a global function with example usage: test_crop() without return types