code: def process_loc_indexes(inp, indexes, fetch_index: bool = True):
      ndim = inp.ndim
  
      if not isinstance(indexes, tuple):
          indexes = (indexes,)
      if len(indexes) < ndim:
          indexes += (slice(None),) * (ndim - len(indexes))
      if len(indexes) > ndim:
          raise IndexingError("Too many indexers")
  
      new_indexes = []
      for ax, index in enumerate(indexes):
          if isinstance(
              index, (list, np.ndarray, pd.Series, ENTITY_TYPE)
          ):
              if not isinstance(index, ENTITY_TYPE):
                  index = np.asarray(index)
              elif fetch_index:
                  index = asarray(index)
                  if ax == 1:
                      # do not support tensor index on axis 1
                      # because if so, the dtypes and columns_value would be unknown
                      try:
                          index = index.fetch()
                      except (RuntimeError, ValueError):
                          raise NotImplementedError(
                              "indexer on axis columns cannot be non-executed tensor"
                          )
          new_indexes.append(index)
  
      return new_indexes
  
imports: from numbers import Integral
  from typing import Dict
  import numpy
  import pandas
  from pandas.core.dtypes.cast import find_common_type
  from pandas.core.indexing import IndexingError
  from .iloc import DataFrameIlocSetItem
  from ...None import opcodes
  from ...core import ENTITY_TYPE, OutputType
  from ...core.operand import OperandStage
  from ...serialization.serializables import KeyField, ListField, AnyField
  from ...tensor.datasource import asarray
  from ...tensor.utils import calc_sliced_size, filter_inputs
  from ...utils import lazy_import, is_full_slice
  from ..core import IndexValue, DATAFRAME_TYPE
  from ..operands import DataFrameOperand, DataFrameOperandMixin
  from ..utils import parse_index, is_index_value_identical
  from .index_lib import DataFrameLocIndexesHandler
label_desc: Use image node_id 1 for calling a global function with example usage: process_loc_indexes(inp, indexes, fetch_index) and returns: new_indexes