class_docstr: Instrument based filter and mapper provider.
code: def time_crop(self, sample: Dict) -> Dict:
      def start(sample):
          """mid_segment_start"""
          return tf.cast(
              tf.maximum(
                  tf.shape(sample[self._spectrogram_key])[0] / 2
                  - self._parent._T / 2,
                  0,
              ),
              tf.int32,
          )
  
      return dict(
          sample,
          **{
              self._spectrogram_key: sample[self._spectrogram_key][
                  start(sample) : start(sample) + self._parent._T, :, :
              ]
          },
      )
  
imports: import os
  import time
  from os.path import exists
  from os.path import sep
  from typing import Any, Dict, List, Optional, Tuple
  import tensorflow
  from .audio.adapter import AudioAdapter
  from .audio.convertor import db_uint_spectrogram_to_gain, spectrogram_to_db_uint
  from .audio.spectrogram import compute_spectrogram_tf, random_pitch_shift, random_time_stretch
  from .utils.logging import logger
  from .utils.tensor import check_tensor_shape, dataset_from_csv, set_tensor_shape, sync_apply
label_desc: Use image node_id 8 for calling the InstrumentDatasetBuilder obj's underlying member method code with example usage: obj.time_crop(sample) and returns: dict, tf