code: def _weight_data_matrix(
      data_matrix: torch.Tensor,
      window_type: str,
      data_transformation: Optional[str] = None,
  ) -> torch.Tensor:
      window_length_in_samp = data_matrix[0].shape[0]
      window = get_window(
          window_type, window_length_in_samp, device=data_matrix.device
      )
      if (
          data_transformation is not None
          and data_transformation == "group_delay"
      ):
          window *= torch.arange(
              window_length_in_samp, device=data_matrix.device
          ).float()
      return data_matrix * window
  
imports: import functools
  import logging
  from io import BytesIO
  from typing import Any, List, Optional, Union
  import torch
  import torch.nn.functional
  import torchaudio
  from packaging import version
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import DEFAULT_AUDIO_TENSOR_LENGTH
  from ludwig.utils.types import TorchAudioTuple
label_desc: Use image node_id 21 for calling a global function with example usage: _weight_data_matrix(data_matrix, window_type, data_transformation) and returns: unknown