class_docstr: A class the mimicks the output of a classifier or regressor to
  allow testing of functionality that depends on it without
  inference overhead.
class_docstr_tok: ["A","class","the","mimicks","the","output","of","a","classifier","or","regressor","to","allow","testing","of","functionality","that","depends","on","it","without","inference","overhead","."]
docstr: Generates labels by sampling random integers in range(0, n_classes+1).
docstr_tok: ["Generates","labels","by","sampling","random","integers","in","range","(","0",",","n_classes+1",")","."]
code: def _generate_labels(
      self, sz: Optional[tuple] = None, *args, **kwargs
  ) -> np.ndarray:
      """
      Generates labels by sampling random integers in range(0, n_classes+1).
      """
      if sz:
          sz += (self.out_dim,)
      return np.random.randint(0, self.out_dim + 1, size=sz)
  
file_path: alibi/alibi/tests/utils.py
imports: from contextlib import contextmanager
  from typing import Optional
  import numpy
label_desc: Use image node_id 4 for calling the MockPredictor obj's underlying member method code with example usage: obj._generate_labels(sz) and returns: np