code: def _get_expected_reduction_dtype(
      self, arr, op_name: str, skipna: bool
  ):
      if is_float_dtype(arr.dtype):
          cmp_dtype = arr.dtype.name
      elif op_name in ["mean", "median", "var", "std", "skew"]:
          cmp_dtype = "Float64"
      elif op_name in ["max", "min"]:
          cmp_dtype = arr.dtype.name
      elif arr.dtype in ["Int64", "UInt64"]:
          cmp_dtype = arr.dtype.name
      elif is_signed_integer_dtype(arr.dtype):
          # TODO: Why does Window Numpy 2.0 dtype depend on skipna?
          cmp_dtype = (
              "Int32"
              if (
                  is_platform_windows()
                  and (not np_version_gt2 or not skipna)
              )
              or not IS64
              else "Int64"
          )
      elif is_unsigned_integer_dtype(arr.dtype):
          cmp_dtype = (
              "UInt32"
              if (
                  is_platform_windows()
                  and (not np_version_gt2 or not skipna)
              )
              or not IS64
              else "UInt64"
          )
      elif arr.dtype.kind == "b":
          if op_name in ["mean", "median", "var", "std", "skew"]:
              cmp_dtype = "Float64"
          elif op_name in ["min", "max"]:
              cmp_dtype = "boolean"
          elif op_name in ["sum", "prod"]:
              cmp_dtype = (
                  "Int32"
                  if (
                      is_platform_windows()
                      and (not np_version_gt2 or not skipna)
                  )
                  or not IS64
                  else "Int64"
              )
          else:
              raise TypeError("not supposed to reach this")
      else:
          raise TypeError("not supposed to reach this")
      return cmp_dtype
  
imports: import warnings
  import numpy
  import pytest
  from pandas.compat import IS64, is_platform_windows
  from pandas.compat.numpy import np_version_gt2
  from pandas.core.dtypes.common import is_float_dtype, is_signed_integer_dtype, is_unsigned_integer_dtype
  import pandas
  import pandas._testing
  from pandas.core.arrays.boolean import BooleanDtype
  from pandas.core.arrays.floating import Float32Dtype, Float64Dtype
  from pandas.core.arrays.integer import Int8Dtype, Int16Dtype, Int32Dtype, Int64Dtype, UInt8Dtype, UInt16Dtype, UInt32Dtype, UInt64Dtype
  from pandas.tests.extension import base
label_desc: Use image node_id 8 for calling the TestMaskedArrays obj's underlying member method code with example usage: obj._get_expected_reduction_dtype(arr, op_name, skipna) and returns: cmp_dtype