class_docstr: Manages issues related to near-duplicate examples.
class_docstr_tok: ["Manages","issues","related","to","near-duplicate","examples","."]
code: def find_issues(
      self,
      features: Optional[npt.NDArray] = None,
      **kwargs,
  ) -> None:
      knn_graph = self._process_knn_graph_from_inputs(kwargs)
      old_knn_metric = self.datalab.get_info("statistics").get(
          "knn_metric"
      )
      metric_changes = self.metric and self.metric != old_knn_metric
  
      if knn_graph is None or metric_changes:
          if features is None:
              raise ValueError(
                  "If a knn_graph is not provided, features must be provided to fit a new knn."
              )
          if self.metric is None:
              self.metric = (
                  "cosine" if features.shape[1] > 3 else "euclidean"
              )
          knn = NearestNeighbors(n_neighbors=self.k, metric=self.metric)
  
          if self.metric and self.metric != knn.metric:
              warnings.warn(
                  f"Metric {self.metric} does not match metric {knn.metric} used to fit knn. "
                  "Most likely an existing NearestNeighbors object was passed in, but a different "
                  "metric was specified."
              )
          self.metric = knn.metric
  
          try:
              check_is_fitted(knn)
          except NotFittedError:
              knn.fit(features)
  
          knn_graph = knn.kneighbors_graph(mode="distance")
      N = knn_graph.shape[0]
      nn_distances = knn_graph.data.reshape(N, -1)[:, 0]
      median_nn_distance = max(
          np.median(nn_distances), np.finfo(np.float_).eps
      )  # avoid threshold = 0
      self.near_duplicate_sets = self._neighbors_within_radius(
          knn_graph, self.threshold, median_nn_distance
      )
  
      # Flag every example in a near-duplicate set as a near-duplicate issue
      all_near_duplicates = np.unique(
          np.concatenate(self.near_duplicate_sets)
      )
      is_issue_column = np.zeros(N, dtype=bool)
      is_issue_column[all_near_duplicates] = True
      temperature = 1.0 / median_nn_distance
      scores = _compute_scores_with_exp_transform(
          nn_distances, temperature=temperature
      )
      self.issues = pd.DataFrame(
          {
              f"is_{self.issue_name}_issue": is_issue_column,
              self.issue_score_key: scores,
          },
      )
  
      self.summary = self.make_summary(score=scores.mean())
      self.info = self.collect_info(
          knn_graph=knn_graph, median_nn_distance=median_nn_distance
      )
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Optional, Union
  import warnings
  import numpy
  import pandas
  from scipy.sparse import csr_matrix
  from sklearn.neighbors import NearestNeighbors
  from sklearn.exceptions import NotFittedError
  from sklearn.utils.validation import check_is_fitted
  from cleanlab.datalab.internal.issue_manager import IssueManager
label_desc: Use image node_id 2 for calling the NearDuplicateIssueManager obj's underlying member method code with example usage: obj.find_issues(features) without return types