def register_names_to_del(self, names):
        """
        Register names of fields that should not be pickled.

        Parameters
        ----------
        names : iterable
            A collection of strings indicating names of fields on ts
            object that should not be pickled.

        Notes
        -----
        All names registered will be deleted from the dictionary returned
        by the model's `__getstate__` method (unless a particular model
        overrides this method).
        """
        if isinstance(names, six.string_types):
            names = [names]
        try:
            assert all(isinstance(n, six.string_types) for n in iter(names))
        except (TypeError, __HOLE__):
            reraise_as(ValueError('Invalid names argument'))
        # Quick check in case __init__ was never called, e.g. by a derived
        # class.
        if not hasattr(self, 'names_to_del'):
            self.names_to_del = set()
        self.names_to_del = self.names_to_del.union(names)
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/models/model.py/Model.register_names_to_del