code: def create_chunks(
      wav1,
      wav2,
      background,
      sample_rate=16000,
      time_resolution=0.01,
      example_length=5,
      speech1=False,
      speech2=False,
      low_background=0.05,
      high_background=0.15,
      max_pause=16000,
  ):
      """This method creates augmented data for training the VAD.
      It sums up two delayed sources + a noise background.
  
  
      Arguments
      ---------
      wav1 : torch.tensor
          The waveform for source 1.
      wav2 : torch.tensor
          The waveform for source 2.
      background : torch.tensor
          The waveform for background noise.
      sample_rate: int
          The sample rate of the input waveforms.
      time_resolution:
          Time resolution of the targets (in seconds)-
      example_length: float
          Duration (in seconds) of the existing chunk.
      speech1: bool
          If True, source 1 is assumed to be a speech signal. The targets
          will be put to 1 for all the duration on the speech signal.
      speech2: bool
          If True, source 2 is assumed to be a speech signal. The targets
          will be put to 1 for all the duration of the speech signal.
      low_background: float
          The amplitude of the background is randomly sampled between
          low_background and high_background.
      high_background: float
          See above.
      max_pause: int
          Max pause in samples between the two sources.
  
      Returns
      -------
      wavs: torch.tensor
          The generated speech signal.
      target: torch.tensor
          The new targets corresponding to the generated signal.
      lengths: torch.tensor
          relative lengths of each chunk.
      """
  
      # Random selection of the background amplitude
      background_amp = (
          random.random() * (high_background - low_background)
          + low_background
      )
  
      # Adding the background
      wav = background_amp * (torch.rand_like(background) - 0.5)
      background = torch.roll(background, 1, dims=-1)
      wav = wav + background_amp * background
  
      # Adding the first source
      wav, target, lengths, end_chunk = add_chunk(
          wav1,
          wav,
          initialize_targets(wav1, sample_rate, time_resolution),
          sample_rate=sample_rate,
          time_resolution=time_resolution,
          example_length=example_length,
          speech=speech1,
      )
  
      # Choosing the lag of the second source
      begin_sample = torch.randint(
          low=end_chunk, high=end_chunk + max_pause, size=(1,)
      ).item()
  
      # Adding the second source
      wav, target, lengths, end_sample = add_chunk(
          wav2,
          wav,
          target,
          chunk_shift=begin_sample,
          sample_rate=sample_rate,
          time_resolution=time_resolution,
          example_length=example_length,
          speech=speech2,
      )
  
      wav = wav.transpose(1, 2).reshape(
          wav.shape[0] * wav.shape[2], wav.shape[1]
      )
      target = target.transpose(1, 2).reshape(
          target.shape[0] * target.shape[2], target.shape[1]
      )
      lengths = lengths.reshape([lengths.shape[0] * lengths.shape[1]])
      return wav, target, lengths
  
imports: import torch
  import torchaudio
  import random
label_desc: Use image node_id 4 for calling a global function with example usage: create_chunks(wav1, wav2, background, sample_rate, time_resolution, example_length, speech1, speech2, low_background, high_background, max_pause) and returns: wav,  target,  lengths