code: def get_sinusoid(
      *,
      frequency: float = 300,
      sample_rate: int = 16000,
      duration: float = 1,  # seconds
      n_channels: int = 1,
      dtype: Union[str, torch.dtype] = "float32",
      device: Union[str, torch.device] = "cpu",
      channels_first: bool = True,
  ):
      """Generate pseudo audio data with sine wave.
  
      Args:
          frequency: Frequency of sine wave
          sample_rate: Sampling rate
          duration: Length of the resulting Tensor in seconds.
          n_channels: Number of channels
          dtype: Torch dtype
          device: device
  
      Returns:
          Tensor: shape of (n_channels, sample_rate * duration)
      """
      if isinstance(dtype, str):
          dtype = getattr(torch, dtype)
      pie2 = 2 * 3.141592653589793
      end = pie2 * frequency * duration
      num_frames = int(sample_rate * duration)
      # Randomize the initial phase. (except the first channel)
      theta0 = pie2 * torch.randn(
          n_channels, 1, dtype=torch.float32, device=device
      )
      theta0[0, :] = 0
      theta = torch.linspace(
          0, end, num_frames, dtype=torch.float32, device=device
      )
      theta = theta0 + theta
      tensor = torch.sin(theta, out=None)
      if not channels_first:
          tensor = tensor.t()
      return convert_tensor_encoding(tensor, dtype)
  
file_path: audio/test/torchaudio_unittest/common_utils/data_utils.py
imports: import os.path
  from typing import Optional, Union
  import torch
label_desc: Use image node_id 4 for calling a global function with example usage: get_sinusoid() and returns: convert_tensor_encoding