parameters: (dtype: DtypeObj, has_none_blocks: bool)
docstring: Find the NA value to go with this dtype.
docstring_summary: Find the NA value to go with this dtype.
docstring_tokens: Find the NA value to go with this dtype .
function: def _dtype_to_na_value(dtype: DtypeObj, has_none_blocks: bool):
      """
      Find the NA value to go with this dtype.
      """
      if isinstance(dtype, ExtensionDtype):
          return dtype.na_value
      elif dtype.kind in ["m", "M"]:
          return dtype.type("NaT")
      elif dtype.kind in ["f", "c"]:
          return dtype.type("NaN")
      elif dtype.kind == "b":
          # different from missing.na_value_for_dtype
          return None
      elif dtype.kind in ["i", "u"]:
          if not has_none_blocks:
              # different from missing.na_value_for_dtype
              return None
          return np.nan
      elif dtype.kind == "O":
          return np.nan
      raise NotImplementedError
function_tokens: def _dtype_to_na_value ( dtype : DtypeObj , has_none_blocks : bool ) : if isinstance ( dtype , ExtensionDtype ) : return dtype . na_value elif dtype . kind in [ "m" , "M" ] : return dtype . type ( "NaT" ) elif dtype . kind in [ "f" , "c" ] : return dtype . type ( "NaN" ) elif dtype . kind == "b" : # different from missing.na_value_for_dtype return None elif dtype . kind in [ "i" , "u" ] : if not has_none_blocks : # different from missing.na_value_for_dtype return None return np . nan elif dtype . kind == "O" : return np . nan raise NotImplementedError