<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cap(self):
 """ "Caps" the construction of the pipeline, signifying that no more inputs and outputs are expected to be added and therefore the input and output nodes can be created along with the provenance. """

        to_cap = (self._inputnodes, self._outputnodes, self._prov)
        if to_cap == (None, None, None):
            self._inputnodes = {
                f: self._make_inputnode(f) for f in self.input_frequencies}
            self._outputnodes = {
                f: self._make_outputnode(f) for f in self.output_frequencies}
            self._prov = self._gen_prov()
        elif None in to_cap:
            raise ArcanaError(
                "If one of _inputnodes, _outputnodes or _prov is not None then"
                " they all should be in {}".format(self))