code: def _use_inf_as_na(key):
      
      from pandas._config import get_option
      flag = get_option(key)
      if flag:
          globals()['_isna'] = _isna_old
      else:
          globals()['_isna'] = _isna_new
docs: Option change callback for na/inf behaviour
      Choose which replacement for numpy.isnan / -numpy.isfinite is used.
  
      Parameters
      ----------
      flag: bool
          True means treat None, NaN, INF, -INF as null (old way),
          False means None and NaN are null, but INF, -INF are not null
          (new way).
  
      Notes
      -----
      This approach to setting global module values is discussed and
      approved here:
  
      * http://stackoverflow.com/questions/4859217/
        programmatically-creating-variables-in-python/4859312#4859312