code: def __call__(self, alt: F) -> F:
      bn_name = self.name or alt.__name__
  
      try:
          bn_func = getattr(bn, bn_name)
      except (AttributeError, NameError):  # pragma: no cover
          bn_func = None
  
      @functools.wraps(alt)
      def f(
          values: np.ndarray,
          *,
          axis: AxisInt | None = None,
          skipna: bool = True,
          **kwds,
      ):
          if len(self.kwargs) > 0:
              for k, v in self.kwargs.items():
                  if k not in kwds:
                      kwds[k] = v
  
          if values.size == 0 and kwds.get("min_count") is None:
              # We are empty, returning NA for our type
              # Only applies for the default `min_count` of None
              # since that affects how empty arrays are handled.
              # TODO(GH-18976) update all the nanops methods to
              # correctly handle empty inputs and remove this check.
              # It *may* just be `var`
              return _na_for_min_count(values, axis)
  
          if (
              _USE_BOTTLENECK
              and skipna
              and _bn_ok_dtype(values.dtype, bn_name)
          ):
              if kwds.get("mask", None) is None:
                  # `mask` is not recognised by bottleneck, would raise
                  #  TypeError if called
                  kwds.pop("mask", None)
                  result = bn_func(values, axis=axis, **kwds)
  
                  # prefer to treat inf/-inf as NA, but must compute the func
                  # twice :(
                  if _has_infs(result):
                      result = alt(
                          values, axis=axis, skipna=skipna, **kwds
                      )
              else:
                  result = alt(values, axis=axis, skipna=skipna, **kwds)
          else:
              result = alt(values, axis=axis, skipna=skipna, **kwds)
  
          return result
  
      return cast(F, f)
  
imports: from __future__ import annotations
  import functools
  import itertools
  import operator
  from typing import Any, Callable, cast
  import warnings
  import numpy
  from pandas._config import get_option
  from pandas._libs import NaT, NaTType, iNaT, lib
  from pandas._typing import ArrayLike, AxisInt, CorrelationMethod, Dtype, DtypeObj, F, Scalar, Shape, npt
  from pandas.compat._optional import import_optional_dependency
  from pandas.util._exceptions import find_stack_level
  from pandas.core.dtypes.common import is_any_int_dtype, is_bool_dtype, is_complex, is_datetime64_any_dtype, is_float, is_float_dtype, is_integer, is_integer_dtype, is_numeric_dtype, is_object_dtype, is_scalar, is_timedelta64_dtype, needs_i8_conversion, pandas_dtype
  from pandas.core.dtypes.dtypes import PeriodDtype
  from pandas.core.dtypes.missing import isna, na_value_for_dtype, notna
  from pandas.core.construction import extract_array
label_desc: Use image node_id 2 for calling the bottleneck_switch obj's underlying member method code with example usage: obj.__call__(alt) and returns: cast, result, _na_for_min_count