code: def _to_numpy(Z):
          
          if isinstance(Z, list):
              return [Classifier._to_numpy(z) for z in Z]
          else:
              return Classifier._to_numpy(Z)
docs: Converts a None, list, np.ndarray, or torch.Tensor to np.ndarray