code: def _prepare_tfr(data, decim, pick_ori, Ws, K, source_ori):
      """Prepare TFR source localization."""
      n_times = data[:, :, ::decim].shape[2]
      n_freqs = len(Ws)
      n_sources = K.shape[0]
      is_free_ori = False
      if source_ori == FIFF.FIFFV_MNE_FREE_ORI and pick_ori is None:
          is_free_ori = True
          n_sources //= 3
  
      shape = (n_sources, n_freqs, n_times)
      return shape, is_free_ori
  
imports: import numpy
  from .._fiff.constants import FIFF
  from .._fiff.pick import pick_info
  from ..baseline import _log_rescale, rescale
  from ..epochs import Epochs
  from ..event import make_fixed_length_events
  from ..evoked import EvokedArray
  from ..fixes import _safe_svd
  from ..label import BiHemiLabel, Label
  from ..parallel import parallel_func
  from ..source_estimate import _make_stc
  from ..time_frequency.multitaper import _compute_mt_params, _mt_spectra, _psd_from_mt, _psd_from_mt_adaptive
  from ..time_frequency.tfr import cwt, morlet
  from ..utils import ProgressBar, _check_option, _pl, _validate_type, logger, verbose
  from .inverse import INVERSE_METHODS, _assemble_kernel, _check_or_prepare, _check_ori, _pick_channels_inverse_operator, _subject_from_inverse, combine_xyz
label_desc: Use image node_id 4 for calling a global function with example usage: _prepare_tfr(data, decim, pick_ori, Ws, K, source_ori) and returns: shape,  is_free_ori