code: def _nanpercentile_1d(values, mask, q, na_value, interpolation):
      """
      Wraper for np.percentile that skips missing values, specialized to
      1-dimensional case.
  
      Parameters
      ----------
      values : array over which to find quantiles
      mask : ndarray[bool]
          locations in values that should be considered missing
      q : scalar or array of quantile indices to find
      na_value : scalar
          value to return for empty or all-null values
      interpolation : str
  
      Returns
      -------
      quantiles : scalar or array
      """
      # mask is Union[ExtensionArray, ndarray]
      values = values[~mask]
  
      if len(values) == 0:
          if lib.is_scalar(q):
              return na_value
          else:
              return np.array([na_value] * len(q), dtype=values.dtype)
  
      return np.percentile(values, q, interpolation=interpolation)
  
imports: from distutils.version import LooseVersion
  import functools
  import itertools
  import operator
  import warnings
  import numpy
  from pandas._libs import iNaT, lib, tslibs
  import pandas.compat
  from pandas.core.dtypes.cast import _int64_max, maybe_upcast_putmask
  from pandas.core.dtypes.common import _get_dtype, is_any_int_dtype, is_bool_dtype, is_complex, is_complex_dtype, is_datetime64_dtype, is_datetime64tz_dtype, is_datetime_or_timedelta_dtype, is_float, is_float_dtype, is_integer, is_integer_dtype, is_numeric_dtype, is_object_dtype, is_scalar, is_timedelta64_dtype, pandas_dtype
  from pandas.core.dtypes.dtypes import DatetimeTZDtype
  from pandas.core.dtypes.missing import isna, na_value_for_dtype, notna
  import pandas.core.common
  from pandas.core.config import get_option
label_desc: Use image node_id 34 for calling a global function with example usage: _nanpercentile_1d(values, mask, q, na_value, interpolation) and returns: np, na_value, np