code: def to_stereo(waveform: np.ndarray) -> np.ndarray:
      """
      Convert a waveform to stereo by duplicating if mono, or truncating
      if too many channels.
  
      Parameters:
          waveform (np.ndarray):
              a `(N, d)` numpy array.
  
      Returns:
          np.ndarray:
              A stereo waveform as a `(N, 1)` numpy array.
      """
      if waveform.shape[1] == 1:
          return np.repeat(waveform, 2, axis=-1)
      if waveform.shape[1] > 2:
          return waveform[:, :2]
      return waveform
  
file_path: spleeter/spleeter/audio/convertor.py
imports: import numpy
  import tensorflow
  from ..utils.tensor import from_float32_to_uint8, from_uint8_to_float32
label_desc: Use image node_id 2 for calling a global function with example usage: to_stereo(waveform) and returns: waveform, np, waveform