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","."]
code: def __call__(self, *args, **kwargs):
      # can specify size s.t. multiple predictions/batches of predictions are returned
  
      if hasattr(args[0], "shape"):
          sz = args[0].shape[:-1]
      else:
          raise ValueError(
              "Predictor expects the input to have attribute .shape!"
          )
  
      if self.out_type == "proba" or self.out_type == "probability":
          return self._generate_probas(sz, *args, **kwargs)
  
      elif self.out_type == "class":
          return self._generate_labels(sz, *args, **kwargs)
  
      elif (
          self.out_type == "raw"
          or self.out_type == "log_loss"
          or self.out_type == "continuous"
      ):
          return self._generate_logits(sz, *args, **kwargs)
  
file_path: alibi/alibi/tests/utils.py
imports: from contextlib import contextmanager
  from typing import Optional
  import numpy
label_desc: Use image node_id 2 for calling the MockPredictor obj's underlying member method code with example usage: obj.__call__() and returns: self, self, self