code: def test_select_columns(ray_start_regular_shared):
      # Test pandas and arrow
      df = pd.DataFrame(
          {"col1": [1, 2, 3], "col2": [2, 3, 4], "col3": [3, 4, 5]}
      )
      ds1 = ray.data.from_pandas(df)
  
      ds2 = ds1.map_batches(
          lambda pa: pa, batch_size=1, batch_format="pyarrow"
      )
  
      for each_ds in [ds1, ds2]:
          assert each_ds.select_columns(cols=[]).take(1) == [{}]
          assert each_ds.select_columns(
              cols=["col1", "col2", "col3"]
          ).take(1) == [{"col1": 1, "col2": 2, "col3": 3}]
          assert each_ds.select_columns(cols=["col1", "col2"]).take(
              1
          ) == [{"col1": 1, "col2": 2}]
          assert each_ds.select_columns(cols=["col2", "col1"]).take(
              1
          ) == [{"col1": 1, "col2": 2}]
          # Test selecting columns with duplicates
          assert each_ds.select_columns(
              cols=["col1", "col2", "col2"]
          ).schema().names == [
              "col1",
              "col2",
              "col2",
          ]
          # Test selecting a column that is not in the dataset schema
          with pytest.raises(KeyError):
              each_ds.select_columns(
                  cols=["col1", "col2", "dummy_col"]
              ).materialize()
  
imports: import itertools
  import math
  import os
  import signal
  import threading
  import time
  from typing import Iterator
  import numpy
  import pandas
  import pyarrow
  import pyarrow.parquet
  import pytest
  import ray
  from ray._private.test_utils import wait_for_condition
  from ray.data.block import BlockAccessor
  from ray.data.context import DataContext
  from ray.data.tests.conftest import *
  from ray.data.tests.util import column_udf, column_udf_class, extract_values
  from ray.tests.conftest import *
label_desc: Use image node_id 9 for calling a global function with example usage: test_select_columns(ray_start_regular_shared) without return types