class_docstr: Mixin for user-defined rolling-window Terms.
  
  Implements `_compute` in terms of a user-defined `compute` function, which
  is mapped over the input windows.
  
  Used by CustomFactor, CustomFilter, CustomClassifier, etc.
docstr: Call the user's `compute` function on each window with a pre-built
  output array.
docstr_tok: ["Call","the","user","'s","`","compute","`","function","on","each","window","with","a","pre-built","output","array","."]
code: def _compute(self, windows, dates, assets, mask):
      """
      Call the user's `compute` function on each window with a pre-built
      output array.
      """
      format_inputs = self._format_inputs
      compute = self.compute
      params = self.params
      ndim = self.ndim
  
      shape = (len(mask), 1) if ndim == 1 else mask.shape
      out = self._allocate_output(windows, shape)
  
      with self.ctx:
          for idx, date in enumerate(dates):
              # Never apply a mask to 1D outputs.
              out_mask = array([True]) if ndim == 1 else mask[idx]
  
              # Mask our inputs as usual.
              inputs_mask = mask[idx]
  
              masked_assets = assets[inputs_mask]
              out_row = out[idx][out_mask]
              inputs = format_inputs(windows, inputs_mask)
  
              compute(date, masked_assets, out_row, *inputs, **params)
              out[idx][out_mask] = out_row
      return out
  
imports: from textwrap import dedent
  from numpy import array, full, recarray, vstack
  from pandas import NaT
  from catalyst.errors import WindowLengthNotPositive, UnsupportedDataType, NoFurtherDataError
  from catalyst.utils.control_flow import nullctx
  from catalyst.utils.input_validation import expect_types
  from catalyst.utils.sharedoc import format_docstring, PIPELINE_ALIAS_NAME_DOC, PIPELINE_DOWNSAMPLING_FREQUENCY_DOC
  from catalyst.utils.pandas_utils import nearest_unequal_elements
  from .downsample_helpers import select_sampling_indices, expect_downsample_frequency
  from .sentinels import NotSpecified
  from .term import Term
label_desc: Use image node_id 5 for calling the CustomTermMixin obj's underlying member method code with example usage: obj._compute(windows, dates, assets, mask) and returns: out