def _get_weight_from_distance(distances: pd.Series) -> pd.Series:
  """Transforms non-negative distances to weights in the range (0, 1].

  This function transforms distances to weights between zero (exclusive) and one (inclusive).
  Distances closer to 0 get weight close to 1.0, and the weights drop off as distances increase.

  Args:
    distances: pd.Series of non-negative float values representing distances between notes and raters.

  Returns:
    pd.Series of rating weights corresponding to the input distances.
  """
  normalizationFactor = np.percentile(distances, c.tagPercentileForNormalization)
  return 1.0 / (1 + (distances / normalizationFactor) ** 5)
Transforms non-negative distances to weights in the range (0, 1].

  This function transforms distances to weights between zero (exclusive) and one (inclusive).
  Distances closer to 0 get weight close to 1.0, and the weights drop off as distances increase.

  Args:
    distances: pd.Series of non-negative float values representing distances between notes and raters.

  Returns:
    pd.Series of rating weights corresponding to the input distances.
  
sourcecode/scoring/tag_filter.py