code: def test_pandas_Categorical_from_codes():
      if not have_pandas_categorical:
          return
      c = pandas_Categorical_from_codes([1, 1, 0, -1], ["a", "b"])
      assert np.all(np.asarray(c)[:-1] == ["b", "b", "a"])
      assert np.isnan(np.asarray(c)[-1])
  
imports: import sys
  import numpy
  import six
  from six.moves import cStringIO
  from .compat import optional_dep_ok
label_desc: Use image node_id 24 for calling a global function with example usage: test_pandas_Categorical_from_codes() without return types