code: def _select_columns_or_index(df, columns_or_index):
      """
      Returns a DataFrame with columns corresponding to each
      column or index level in columns_or_index.  If included,
      the column corresponding to the index level is named _index.
  
      This is the local (non-collection) version of
      ``dask.core.DataFrame._select_columns_or_index``.
      """
  
      def _is_column_label_reference(df, key):
          return (
              np.isscalar(key) or isinstance(key, tuple)
          ) and key in df.columns
  
      # Ensure columns_or_index is a list
      columns_or_index = (
          columns_or_index
          if isinstance(columns_or_index, list)
          else [columns_or_index]
      )
  
      column_names = [
          n
          for n in columns_or_index
          if _is_column_label_reference(df, n)
      ]
  
      selected_df = df[column_names]
      if _contains_index_name(df, columns_or_index):
          # Index name was included
          selected_df = selected_df.assign(_index=df.index)
  
      return selected_df
  
imports: from __future__ import annotations
  import math
  import pickle
  import warnings
  from functools import partial, wraps
  import numpy
  import pandas
  from pandas.api.types import is_dtype_equal
  from tlz import merge_sorted, unique
  from dask.base import is_dask_collection, tokenize
  from dask.dataframe import methods
  from dask.dataframe.core import DataFrame, Index, Series, _concat, _deprecated_kwarg, _Frame, _maybe_from_pandas, is_broadcastable, map_partitions, new_dd_object, prefix_reduction, suffix_reduction
  from dask.dataframe.dispatch import group_split_dispatch, hash_object_dispatch
  from dask.dataframe.io import from_pandas
  from dask.dataframe.shuffle import partitioning_index, rearrange_by_divisions, shuffle, shuffle_group
  from dask.dataframe.utils import asciitable, check_meta, is_dataframe_like, is_series_like, make_meta, strip_unknown_categories
  from dask.highlevelgraph import HighLevelGraph
  from dask.layers import BroadcastJoinLayer
  from dask.utils import M, apply, get_default_shuffle_method
label_desc: Use image node_id 27 for calling a global function with example usage: _select_columns_or_index(df, columns_or_index) and returns: selected_df, unknown