code: def maybe_operate_rowwise(func: F) -> F:
      """
      NumPy operations on C-contiguous ndarrays with axis=1 can be
      very slow if axis 1 >> axis 0.
      Operate row-by-row and concatenate the results.
      """
  
      @functools.wraps(func)
      def newfunc(
          values: np.ndarray, *, axis: AxisInt | None = None, **kwargs
      ):
          if (
              axis == 1
              and values.ndim == 2
              and values.flags["C_CONTIGUOUS"]
              # only takes this path for wide arrays (long dataframes), for threshold see
              # https://github.com/pandas-dev/pandas/pull/43311#issuecomment-974891737
              and (values.shape[1] / 1000) > values.shape[0]
              and values.dtype != object
              and values.dtype != bool
          ):
              arrs = list(values)
              if kwargs.get("mask") is not None:
                  mask = kwargs.pop("mask")
                  results = [
                      func(arrs[i], mask=mask[i], **kwargs)
                      for i in range(len(arrs))
                  ]
              else:
                  results = [func(x, **kwargs) for x in arrs]
              return np.array(results)
  
          return func(values, axis=axis, **kwargs)
  
      return cast(F, newfunc)
  
imports: from __future__ import annotations
  import functools
  import itertools
  import operator
  from typing import Any, Callable, cast
  import warnings
  import numpy
  from pandas._config import get_option
  from pandas._libs import NaT, NaTType, iNaT, lib
  from pandas._typing import ArrayLike, AxisInt, CorrelationMethod, Dtype, DtypeObj, F, Scalar, Shape, npt
  from pandas.compat._optional import import_optional_dependency
  from pandas.util._exceptions import find_stack_level
  from pandas.core.dtypes.common import is_any_int_dtype, is_bool_dtype, is_complex, is_datetime64_any_dtype, is_float, is_float_dtype, is_integer, is_integer_dtype, is_numeric_dtype, is_object_dtype, is_scalar, is_timedelta64_dtype, needs_i8_conversion, pandas_dtype
  from pandas.core.dtypes.dtypes import PeriodDtype
  from pandas.core.dtypes.missing import isna, na_value_for_dtype, notna
  from pandas.core.construction import extract_array
label_desc: Use image node_id 11 for calling a global function with example usage: maybe_operate_rowwise(func) and returns: cast, func, np