parameters: (dtype: DtypeObj)
return_statement: return (
              is_numeric_dtype(dtype) and not is_complex_dtype(dtype)
          ) or needs_i8_conversion(dtype)
docstring: Helper function to determine if dtype is valid for
          nsmallest/nlargest methods
docstring_summary: Helper function to determine if dtype is valid for
          nsmallest/nlargest methods
docstring_tokens: Helper function to determine if dtype is valid for nsmallest / nlargest methods
function: def is_valid_dtype_n_method(dtype: DtypeObj) -> bool:
          """
          Helper function to determine if dtype is valid for
          nsmallest/nlargest methods
          """
          return (
              is_numeric_dtype(dtype) and not is_complex_dtype(dtype)
          ) or needs_i8_conversion(dtype)
function_tokens: def is_valid_dtype_n_method ( dtype : DtypeObj ) -> bool : return ( is_numeric_dtype ( dtype ) and not is_complex_dtype ( dtype ) ) or needs_i8_conversion ( dtype )