code: def _encoded_data(data):
      expected = []
      for nam, col in data.items():
          if hasattr(col, "cat"):
              for cat in col.cat.categories[1:]:
                  name = f"{nam}={cat}"
                  s = pd.Series(col == cat, dtype=np.float64)
                  expected.append((name, s))
          else:
              expected.append((nam, col))
  
      expected_data = pd.DataFrame.from_dict(OrderedDict(expected))
      return expected_data
  
file_path: scikit-survival/tests/test_preprocessing.py
imports: from collections import OrderedDict
  import numpy
  from numpy.testing import assert_array_equal
  import pandas
  import pandas.testing
  import pytest
  from sksurv.preprocessing import OneHotEncoder
label_desc: Use image node_id 1 for calling a global function with example usage: _encoded_data(data) and returns: expected_data