code: def raise_for_nan(value, method: str) -> None:
      if lib.is_float(value) and np.isnan(value):
          raise ValueError(
              f"Cannot perform logical '{method}' with floating NaN"
          )
  
imports: from __future__ import annotations
  import numpy
  from pandas._libs import lib, missing
label_desc: Use image node_id 4 for calling a global function with example usage: raise_for_nan(value, method) without return types