code: def test_columns(unittest):
      import dtale.global_state as global_state
  
      global_state.clear_store()
      data_id, duplicates_type = "1", "columns"
  
      data = {data_id: duplicates_data()}
      build_data_inst(data)
  
      builder = DuplicateCheck(
          data_id, duplicates_type, {"keep": "first"}
      )
      unittest.assertEqual(builder.test(), {"Foo": ["foo"]})
      new_data_id = builder.execute()
      unittest.assertEqual(
          list(global_state.get_data(new_data_id).columns),
          ["Foo", "fOo", "foO", "bar"],
      )
  
      data = {data_id: duplicates_data()}
      build_data_inst(data)
  
      builder = DuplicateCheck(
          data_id, duplicates_type, {"keep": "last"}
      )
      unittest.assertEqual(builder.test(), {"foo": ["Foo"]})
      new_data_id = builder.execute()
      unittest.assertEqual(
          list(global_state.get_data(new_data_id).columns),
          ["foo", "fOo", "foO", "bar"],
      )
  
      data = {data_id: duplicates_data()}
      build_data_inst(data)
  
      builder = DuplicateCheck(
          data_id, duplicates_type, {"keep": "none"}
      )
      unittest.assertEqual(builder.test(), {"Foo": ["foo"]})
      new_data_id = builder.execute()
      unittest.assertEqual(
          list(global_state.get_data(new_data_id).columns),
          ["fOo", "foO", "bar"],
      )
  
      data = {
          data_id: duplicates_data().drop(["fOo", "foO", "bar"], axis=1)
      }
      build_data_inst(data)
  
      builder = DuplicateCheck(
          data_id, duplicates_type, {"keep": "none"}
      )
      with pytest.raises(RemoveAllDataException):
          builder.execute()
  
      data = {data_id: non_duplicate_data()}
      build_data_inst(data)
  
      builder = DuplicateCheck(
          data_id, duplicates_type, {"keep": "none"}
      )
      with pytest.raises(NoDuplicatesException):
          builder.checker.remove(data[data_id])
  
file_path: dtale/tests/dtale/test_duplicates.py
imports: import json
  import pandas
  import pytest
  from dtale.duplicate_checks import DuplicateCheck, NoDuplicatesException, NoDuplicatesToShowException, RemoveAllDataException
  from tests.dtale.test_views import app
  from tests.dtale import build_data_inst, build_dtypes
label_desc: Use image node_id 3 for calling a global function with example usage: test_columns(unittest) without return types