code: def test_formula_inputs():
      # Check we can send in fields of type 'S', 'U', 'O' for factor levels
      level_names = ["red", "green", "blue"]
      for field_type in ("S", "U", "O"):
          levels = np.array(level_names, dtype=field_type)
          f = F.Factor("myname", levels)
          assert f.levels == level_names
      # Sending in byte objects
      levels = [L.encode() for L in level_names]
      f = F.Factor("myname", levels)
      assert f.levels == level_names
  
imports: from warnings import catch_warnings, simplefilter
  import numpy
  import pytest
  import sympy
  from numpy.core.records import fromrecords
  from numpy.testing import assert_almost_equal, assert_array_equal
  from sympy.utilities.lambdify import implemented_function
  from nipy.utils import VisibleDeprecationWarning
  from ..None import formulae
  from ..formulae import Term, terms
label_desc: Use image node_id 18 for calling a global function with example usage: test_formula_inputs() without return types