code: def pure_tone(
      freq: float, sr: float = 128, dur: float = 4, device=None
  ):
      """
      Return a pure tone, i.e. cosine.
  
      Args:
          freq (float): frequency (in Hz)
          sr (float): sample rate (in Hz)
          dur (float): duration (in seconds)
      """
      time = torch.arange(int(sr * dur), device=device).float() / sr
      return torch.cos(2 * math.pi * freq * time)
  
file_path: julius/julius/core.py
imports: import math
  import typing
  import torch
  from torch.nn import functional
label_desc: Use image node_id 7 for calling a global function with example usage: pure_tone(freq, sr, dur, device) and returns: torch