code: def test_patsy_missing_data():
      # Test pandas-style first
      data = cpunish.load_pandas().data
      data.loc[0, "INCOME"] = np.nan
      res = ols("EXECUTIONS ~ SOUTH + INCOME", data=data).fit()
      res2 = res.predict(data)
      # First record will be dropped during fit, but not during predict
      assert_equal(res.fittedvalues, res2[1:])
  
      # Non-pandas version
      data = cpunish.load_pandas().data
      data.loc[0, "INCOME"] = None
      data = data.to_records(index=False)
      with warnings.catch_warnings(record=True) as w:
          warnings.simplefilter("always")
          res2 = res.predict(data)
          assert "ValueWarning" in repr(w[-1].message)
          assert "nan values have been dropped" in repr(w[-1].message)
      # First record will be dropped in both cases
      assert_equal(res.fittedvalues, res2, check_index_type=False)
  
imports: from statsmodels.compat.pandas import assert_series_equal
  from io import StringIO
  import warnings
  import numpy
  import numpy.testing
  import pandas
  import patsy
  import pytest
  from statsmodels.datasets import cpunish
  from statsmodels.datasets.longley import load, load_pandas
  from statsmodels.formula.api import ols
  from statsmodels.formula.formulatools import make_hypotheses_matrices
  from statsmodels.tools import add_constant
  from statsmodels.tools.testing import assert_equal
label_desc: Use image node_id 6 for calling a global function with example usage: test_patsy_missing_data() without return types