code: def detect_outliers(
      embedding: Union[np.ndarray, pd.DataFrame],
      name: str = "data",
      contamination: float = 0.25,
      gamma: float = 0.35,
      xy_extent: Union[Tuple, None] = None,
      xy=(8, 3),
      xytext=(5, 1),
      figsize=(17, 10),
      border=1,
  ):
      """Train and plot outlier detection algorithms on embedding.
  
      example adapted from https://scikit-learn.org/stable/auto_examples/neighbors/plot_lof_outlier_detection.html
  
      Args:
          embedding (Union[np.ndarray, pd.DataFrame]): embedding of the data
          name (str, optional): optional name. Defaults to "data".
          contamination (float, optional): contamination parameter. Defaults to 0.25.
          gamma (float, optional): gamma parameter for OneClassSVM. Defaults to 0.35.
          xy_extent (Tuple, optional): if given, sets extent one wishes to plot (ie, zoom in). Defaults to None.
          xy (tuple, optional): annotation pointer (to center of outlier or any other point). Defaults to (8, 3).
          xytext (tuple, optional): annotation text coordinates. Defaults to (5, 1).
          figsize (tuple, optional): size of figure. Defaults to (17, 10).
          border (int, optional): border around extent. Defaults to 1.
  
      Returns:
          Tuple: Tuple of fit classifier dicts, fig, plot axes
      """
      # xy_extent = ((0,10), (-2, 10))
      # assumes umap has been run on g and finds decision boundary in projection.
      # trains a set of outlier and unsupervised models on the embedding.
      # Define "classifiers" to be used
      classifiers = {
          "Outlier": neighbors.LocalOutlierFactor(
              contamination=contamination, novelty=True
          ),
          "Empirical Covariance": EllipticEnvelope(
              support_fraction=1.0, contamination=contamination
          ),
          "Robust Covariance (Minimum Covariance Determinant)": EllipticEnvelope(
              contamination=contamination
          ),
          "OCSVM": OneClassSVM(nu=contamination, gamma=gamma),
      }
      logger.info("-" * 120)
      for i, (clf_name, clf) in enumerate(classifiers.items()):
          logger.info(f"Fitting {clf_name}:")
          clf.fit(embedding)
  
      fig, ax = plot_outliers(
          embedding,
          classifiers,
          name,
          xy_extent,
          figsize,
          xy,
          xytext,
          border,
      )
      logger.info("-" * 100)
  
      return classifiers, fig, ax
  
imports: from typing import Union, Tuple
  import pandas
  import logging
label_desc: Use image node_id 4 for calling a global function with example usage: detect_outliers(embedding, name, contamination, gamma, xy_extent, xy, xytext, figsize, border) and returns: classifiers,  fig,  ax