code: def execute(cls, ctx: Union[dict, Context], op: "LabelBinarize"):
      y = ctx[op.y.key]
      if hasattr(y, "raw"):
          # SparseNDArray
          y = y.raw
      if isinstance(op.classes, ENTITY_TYPE):
          classes = ctx[op.classes.key]
      else:
          classes = op.classes
      y_type = op.y_type
      sparse_output = op.sparse_output
      pos_label = op.pos_label
      neg_label = op.neg_label
      pos_switch = op.pos_switch
  
      n_samples = y.shape[0] if sp.issparse(y) else len(y)
      n_classes = len(classes)
      sorted_class = np.sort(classes)
  
      if y_type in ("binary", "multiclass"):
          # pick out the known labels from y
          y_in_classes = np.in1d(y, classes)
          y_seen = y[y_in_classes]
          indices = np.searchsorted(sorted_class, y_seen)
          indptr = np.hstack((0, np.cumsum(y_in_classes)))
  
          data = np.empty_like(indices)
          data.fill(pos_label)
          Y = sp.csr_matrix(
              (data, indices, indptr), shape=(n_samples, n_classes)
          )
      elif y_type == "multilabel-indicator":
          Y = sp.csr_matrix(y)
          if pos_label != 1:
              data = np.empty_like(Y.data)
              data.fill(pos_label)
              Y.data = data
      else:  # pragma: no cover
          raise ValueError(
              "%s target data is not supported with label binarization"
              % y_type
          )
  
      if not sparse_output:
          Y = Y.toarray()
          Y = Y.astype(int, copy=False)
  
          if neg_label != 0:
              Y[Y == 0] = neg_label
  
          if pos_switch:
              Y[Y == pos_label] = 0
      else:
          Y.data = Y.data.astype(int, copy=False)
  
      # preserve label ordering
      if np.any(classes != sorted_class):
          indices = np.searchsorted(sorted_class, classes)
          Y = Y[:, indices]
  
      if y_type == "binary":
          if sparse_output:
              Y = Y.getcol(-1)
          else:
              Y = Y[:, -1].reshape((-1, 1))
  
      if sp.issparse(Y):
          Y = SparseNDArray(Y)
      ctx[op.outputs[0].key] = Y
  
imports: from typing import Union
  import numpy
  import scipy.sparse
  from sklearn.base import BaseEstimator, TransformerMixin
  from sklearn.preprocessing import label_binarize
  from sklearn.utils.sparsefuncs import min_max_axis
  from ...None import execute, fetch
  from ...None import opcodes
  from ...None import tensor
  from ...core import ENTITY_TYPE, OutputType, recursive_tile
  from ...core.context import get_context, Context
  from ...lib.sparse import SparseNDArray
  from ...serialization.serializables import AnyField, BoolField, Int32Field, StringField
  from ...tensor.core import TensorOrder
  from ...typing import TileableType
  from ..operands import LearnOperand, LearnOperandMixin
  from ..utils import column_or_1d
  from ..utils._encode import _unique, _encode
  from ..utils.multiclass import unique_labels, type_of_target
  from ..utils.validation import _num_samples, check_is_fitted, check_array
label_desc: Use image node_id 4 for calling the LabelBinarize obj's underlying member method code with example usage: obj.execute(cls, ctx, op) without return types