code: def _compute_scores_with_exp_transform(
      nn_distances: np.ndarray, temperature: float
  ) -> np.ndarray:
      r"""Compute near-duplicate scores from nearest neighbor distances.
  
      This is a non-linear transformation of the nearest neighbor distances that
      maps distances to scores in the range [0, 1].
  
      Note
      ----
  
      This transformation is given by the following formula:
  
      .. math::
  
          \text{score}(d, t) = 1 - e^{-dt}
  
      where :math:`d` is the nearest neighbor distance and :math:`t > 0` is a temperature parameter.
  
      Parameters
      ----------
      nn_distances :
          The nearest neighbor distances for each example.
  
      Returns
      -------
      scores :
          The near-duplicate scores for each example. The scores are in the range [0, 1].
          A lower score indicates that an example is more likely to be a near-duplicate than
          an example with a higher score.
          A score of 0 indicates that an example has an exact duplicate.
      """
      if temperature <= 0:
          raise ValueError("Temperature must be greater than 0.")
  
      scores = 1 - np.exp(-temperature * nn_distances)
      return scores
  
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 1 for calling a global function with example usage: _compute_scores_with_exp_transform(nn_distances, temperature) and returns: scores