code: def test_loadarff_dataframe():
      contents = "".join(EXPECTED_NO_QUOTES)
      with StringIO(contents) as fp:
          actual_df = loadarff(fp)
  
      expected_df = pd.DataFrame.from_dict(
          OrderedDict(
              [
                  (
                      "attr_nominal",
                      pd.Series(
                          pd.Categorical.from_codes(
                              [1, 2, 0, -1, 2, 1],
                              ["beer", "water", "wine"],
                          )
                      ),
                  ),
                  (
                      "attr_nominal_spaces",
                      pd.Series(
                          pd.Categorical.from_codes(
                              [2, 0, -1, 1, 0, 1],
                              ["hard liquor", "mate", "red wine"],
                          )
                      ),
                  ),
              ]
          )
      )
  
      tm.assert_frame_equal(expected_df, actual_df, check_exact=True)
  
file_path: scikit-survival/tests/test_io.py
imports: from collections import OrderedDict
  from io import StringIO
  import numpy
  import pandas
  import pandas.testing
  import pytest
  from sksurv.io import loadarff, writearff
  from sksurv.testing import FixtureParameterFactory
label_desc: Use image node_id 1 for calling a global function with example usage: test_loadarff_dataframe() without return types