code: def sync_apply(
      tensor_dict: Dict[str, tf.Tensor],
      func: Callable,
      concat_axis: int = 1,
  ) -> Dict[str, tf.Tensor]:
      """
      Return a function that applies synchronously the provided func on the
      provided dictionnary of tensor. This means that func is applied to the
      concatenation of the tensors in tensor_dict. This is useful for
      performing random operation that needs the same drawn value on multiple
      tensor, such as a random time-crop on both input data and label (the
      same crop should be applied to both input data and label, so random
      crop cannot be applied separately on each of them).
  
      Note:
          All tensor are assumed to be the same shape.
  
      Parameters:
          tensor_dict (Dict[str, tf.Tensor]):
              A dictionary of tensor.
          func (Callable):
              Function to be applied to the concatenation of the tensors in
              `tensor_dict`.
          concat_axis (int):
              (Optional) The axis on which to perform the concatenation.
  
      Returns:
          Dict[str, tf.Tensor]:
              Processed tensors dictionary with the same name (keys) as input
              tensor_dict.
      """
      if concat_axis not in {0, 1}:
          raise NotImplementedError(
              "Function only implemented for concat_axis equal to 0 or 1"
          )
      tensor_list = list(tensor_dict.values())
      concat_tensor = tf.concat(tensor_list, concat_axis)
      processed_concat_tensor = func(concat_tensor)
      tensor_shape = tf.shape(list(tensor_dict.values())[0])
      D = tensor_shape[concat_axis]
      if concat_axis == 0:
          return {
              name: processed_concat_tensor[
                  index * D : (index + 1) * D, :, :
              ]
              for index, name in enumerate(tensor_dict)
          }
      return {
          name: processed_concat_tensor[
              :, index * D : (index + 1) * D, :
          ]
          for index, name in enumerate(tensor_dict)
      }
  
file_path: spleeter/spleeter/utils/tensor.py
imports: from typing import Any, Callable, Dict
  import pandas
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: sync_apply(tensor_dict, func, concat_axis) and returns: unknown, unknown