code: def take_2d_multi(
      arr,
      indexer,
      out=None,
      fill_value=np.nan,
      mask_info=None,
      allow_fill=True,
  ):
      """
      Specialized Cython take which sets NaN values in one pass
      """
      if indexer is None or (indexer[0] is None and indexer[1] is None):
          row_idx = np.arange(arr.shape[0], dtype=np.int64)
          col_idx = np.arange(arr.shape[1], dtype=np.int64)
          indexer = row_idx, col_idx
          dtype, fill_value = arr.dtype, arr.dtype.type()
      else:
          row_idx, col_idx = indexer
          if row_idx is None:
              row_idx = np.arange(arr.shape[0], dtype=np.int64)
          else:
              row_idx = ensure_int64(row_idx)
          if col_idx is None:
              col_idx = np.arange(arr.shape[1], dtype=np.int64)
          else:
              col_idx = ensure_int64(col_idx)
          indexer = row_idx, col_idx
          if not allow_fill:
              dtype, fill_value = arr.dtype, arr.dtype.type()
              mask_info = None, False
          else:
              # check for promotion based on types only (do this first because
              # it's faster than computing a mask)
              dtype, fill_value = maybe_promote(arr.dtype, fill_value)
              if dtype != arr.dtype and (
                  out is None or out.dtype != dtype
              ):
                  # check if promotion is actually required based on indexer
                  if mask_info is not None:
                      (row_mask, col_mask), (
                          row_needs,
                          col_needs,
                      ) = mask_info
                  else:
                      row_mask = row_idx == -1
                      col_mask = col_idx == -1
                      row_needs = row_mask.any()
                      col_needs = col_mask.any()
                      mask_info = (row_mask, col_mask), (
                          row_needs,
                          col_needs,
                      )
                  if row_needs or col_needs:
                      if out is not None and out.dtype != dtype:
                          raise TypeError(
                              "Incompatible type for fill_value"
                          )
                  else:
                      # if not, then depromote, set fill_value to dummy
                      # (it won't be used but we don't want the cython code
                      # to crash when trying to cast it to dtype)
                      dtype, fill_value = arr.dtype, arr.dtype.type()
  
      # at this point, it's guaranteed that dtype can hold both the arr values
      # and the fill_value
      if out is None:
          out_shape = len(row_idx), len(col_idx)
          out = np.empty(out_shape, dtype=dtype)
  
      func = _take_2d_multi_dict.get(
          (arr.dtype.name, out.dtype.name), None
      )
      if func is None and arr.dtype != out.dtype:
          func = _take_2d_multi_dict.get(
              (out.dtype.name, out.dtype.name), None
          )
          if func is not None:
              func = _convert_wrapper(func, out.dtype)
      if func is None:
  
          def func(arr, indexer, out, fill_value=np.nan):
              _take_2d_multi_object(
                  arr,
                  indexer,
                  out,
                  fill_value=fill_value,
                  mask_info=mask_info,
              )
  
      func(arr, indexer, out=out, fill_value=fill_value)
      return out
  
imports: from __future__ import division
  from textwrap import dedent
  from warnings import catch_warnings, simplefilter, warn
  import numpy
  from pandas._libs import algos, hashtable, lib
  from pandas._libs.tslib import iNaT
  from pandas.util._decorators import Appender, Substitution, deprecate_kwarg
  from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike, maybe_promote
  from pandas.core.dtypes.common import ensure_float64, ensure_int64, ensure_object, ensure_platform_int, ensure_uint64, is_array_like, is_bool_dtype, is_categorical_dtype, is_complex_dtype, is_datetime64_any_dtype, is_datetime64tz_dtype, is_datetimelike, is_extension_array_dtype, is_float_dtype, is_integer_dtype, is_interval_dtype, is_list_like, is_numeric_dtype, is_object_dtype, is_period_dtype, is_scalar, is_signed_integer_dtype, is_sparse, is_timedelta64_dtype, is_unsigned_integer_dtype, needs_i8_conversion
  from pandas.core.dtypes.generic import ABCIndex, ABCIndexClass, ABCSeries
  from pandas.core.dtypes.missing import isna, na_value_for_dtype
  from pandas.core import common
label_desc: Use image node_id 25 for calling a global function with example usage: take_2d_multi(arr, indexer, out, fill_value, mask_info, allow_fill) and returns: out