code: def _unit_variance_scale(f: np.ndarray) -> np.ndarray:
      """Rescales a feature to have a unit variance."""
      f_nan_max = np.nanmax(f)
      f_nan_min = np.nanmin(f)
      if np.isnan(f_nan_max) or np.isnan(f_nan_min):
          raise ValueError("Continuous feature all missing.")
      if f_nan_max == f_nan_min:
          ret = np.full_like(f, np.nan, dtype=float)
          ret[~np.isnan(f)] = 0
          return ret
      return (f - np.nanmean(f)) / np.nanstd(f, ddof=1)
  
imports: import functools
  import itertools
  import math
  from typing import Any, List, Optional, Tuple, Union
  import uuid
  import numpy
  import pandas
  import scipy.special
  import sklearn.neighbors
label_desc: Use image node_id 7 for calling a global function with example usage: _unit_variance_scale(f) and returns: unknown, ret