code: def sample(cls, x, num=None):
      if isinstance(x, list):
          return np.random.choice(x, size=num, replace=False)
      elif isinstance(x, int):
          return np.random.randint(0, x, size=num)
  
label_desc: Use image node_id 1 for calling the Model obj's underlying member method code with example usage: obj.sample(cls, x, num) and returns: np, np