code: def random_choice(device, a, size, p):
      if device.xp is chainerx:
          return device.send(
              numpy.random.choice(a, size=size, p=chainerx.to_numpy(p))
          )
      return device.xp.random.choice(a, size=size, p=p)
  
file_path: chainer/examples/wavenet/generate.py
imports: import argparse
  import chainer
  import chainerx
  import librosa
  import numpy
  import tqdm
  from net import UpsampleNet
  from net import WaveNet
  from utils import MuLaw
  from utils import Preprocess
label_desc: Use image node_id 1 for calling a global function with example usage: random_choice(device, a, size, p) and returns: device, device