code: def na_value_for_dtype(dtype, compat=True):
      """
      Return a dtype compat na value
  
      Parameters
      ----------
      dtype : string / dtype
      compat : boolean, default True
  
      Returns
      -------
      np.dtype or a pandas dtype
  
      Examples
      --------
      >>> na_value_for_dtype(np.dtype('int64'))
      0
      >>> na_value_for_dtype(np.dtype('int64'), compat=False)
      nan
      >>> na_value_for_dtype(np.dtype('float64'))
      nan
      >>> na_value_for_dtype(np.dtype('bool'))
      False
      >>> na_value_for_dtype(np.dtype('datetime64[ns]'))
      NaT
      """
      dtype = pandas_dtype(dtype)
  
      if is_extension_array_dtype(dtype):
          return dtype.na_value
      if (
          is_datetime64_dtype(dtype)
          or is_datetime64tz_dtype(dtype)
          or is_timedelta64_dtype(dtype)
          or is_period_dtype(dtype)
      ):
          return NaT
      elif is_float_dtype(dtype):
          return np.nan
      elif is_integer_dtype(dtype):
          if compat:
              return 0
          return np.nan
      elif is_bool_dtype(dtype):
          return False
      return np.nan
  
file_path: catboost/contrib/python/pandas/py2/pandas/core/dtypes/missing.py
imports: import numpy
  from pandas._libs import lib, missing
  from pandas._libs.tslibs import NaT, iNaT
  from .common import _NS_DTYPE, _TD_DTYPE, ensure_object, is_bool_dtype, is_complex_dtype, is_datetime64_dtype, is_datetime64tz_dtype, is_datetimelike, is_datetimelike_v_numeric, is_dtype_equal, is_extension_array_dtype, is_float_dtype, is_integer_dtype, is_object_dtype, is_period_dtype, is_scalar, is_string_dtype, is_string_like_dtype, is_timedelta64_dtype, needs_i8_conversion, pandas_dtype
  from .generic import ABCDatetimeArray, ABCExtensionArray, ABCGeneric, ABCIndexClass, ABCMultiIndex, ABCSeries, ABCTimedeltaArray
  from .inference import is_list_like
label_desc: Use image node_id 12 for calling a global function with example usage: na_value_for_dtype(dtype, compat) and returns: np, dtype, NaT, np, np, int, False