code: def test_fillna_with_scalar(self, null_locs):
      shape = (4, 4)
      num_cells = shape[0] * shape[1]
  
      floats = np.arange(num_cells, dtype=float).reshape(shape)
      floats[null_locs] = np.nan
      float_fillval = 999.0
      float_expected = np.where(null_locs, float_fillval, floats)
      float_expected_zero = np.where(null_locs, 0.0, floats)
  
      dates = (
          np.arange(num_cells, dtype="i8")
          .view("M8[D]")
          .astype("M8[ns]")
          .reshape(shape)
      )
      dates[null_locs] = NaTns
      date_fillval = np.datetime64("2014-01-02", "ns")
      date_expected = np.where(null_locs, date_fillval, dates)
  
      strs = (
          np.arange(num_cells).astype(str).astype(object).reshape(shape)
      )
      strs[null_locs] = None
      str_fillval = "filled"
      str_expected = np.where(null_locs, str_fillval, strs)
  
      ints = np.arange(num_cells, dtype="i8").reshape(shape)
      ints[null_locs] = -1
      int_fillval = 777
      int_expected = np.where(null_locs, int_fillval, ints)
  
      terms = {
          "floats": Floats().fillna(float_fillval),
          # Make sure we accept integer as a fill value on float-dtype
          # factors.
          "floats_fill_zero": Floats().fillna(0),
          "dates": Dates().fillna(date_fillval),
          "strs": Strs().fillna(str_fillval),
          "ints": Ints().fillna(int_fillval),
      }
  
      expected = {
          "floats": float_expected,
          "floats_fill_zero": float_expected_zero,
          "dates": date_expected,
          "strs": self.make_labelarray(str_expected),
          "ints": int_expected,
      }
  
      self.check_terms(
          terms,
          expected,
          initial_workspace={
              Floats(): floats,
              Dates(): dates,
              Strs(): self.make_labelarray(strs),
              Ints(): ints,
          },
          mask=self.build_mask(self.ones_mask(shape=(4, 4))),
      )
  
imports: import numpy
  from zipline.lib.labelarray import LabelArray
  from zipline.pipeline import Classifier, Factor, Filter
  from zipline.testing import parameter_space
  from zipline.utils.numpy_utils import categorical_dtype, datetime64ns_dtype, float64_dtype, int64_dtype, NaTns
  from .base import BaseUSEquityPipelineTestCase
label_desc: Use image node_id 1 for calling the FillNATestCase obj's underlying member method code with example usage: obj.test_fillna_with_scalar(null_locs) without return types