code: def test_min_max_with_nan(self, values, categories, function, skipna):
      # GH 25303
      cat = Categorical(values, categories=categories, ordered=True)
      result = getattr(cat, function)(skipna=skipna)
  
      if skipna is False:
          assert result is np.nan
      else:
          expected = (
              categories[0] if function == "min" else categories[2]
          )
          assert result == expected
  
imports: import re
  import sys
  import numpy
  import pytest
  from pandas.compat import PYPY
  from pandas import Categorical, CategoricalDtype, DataFrame, Index, NaT, Series, date_range
  import pandas._testing
  from pandas.api.types import is_scalar
label_desc: Use image node_id 5 for calling the TestCategoricalAnalytics obj's underlying member method code with example usage: obj.test_min_max_with_nan(values, categories, function, skipna) without return types