code: def test_categorize():
      codes = _generate_codes(TEST_DF_1, ["category"])
      assert codes == {"category": ["a", "b", "c"]}
  
      df = _categorize(TEST_DF_1, ["category"], codes)
      assert list(df["category"]) == [1, 2, 3, 1, 0, 3]
  
      df = _categorize(TEST_DF_2, ["category"], codes)
      assert list(df["category"]) == [0, 0, 0]
  
file_path: lightning-flash/tests/tabular/classification/test_data.py
imports: from pathlib import Path
  from unittest.mock import Mock
  import numpy
  import pytest
  from flash.core.data.io.input import DataKeys
  from flash.core.utilities.imports import _TOPIC_TABULAR_AVAILABLE
label_desc: Use image node_id 1 for calling a global function with example usage: test_categorize() without return types