(self, layernames, detach=True)
Retains a list of a layers at once.
Retains a list of a layers at once.
Retains a list of a layers at once .
def retain_layers(self, layernames, detach=True):
        '''
        Retains a list of a layers at once.
        '''
        self.add_hooks(layernames)
        for layername in layernames:
            aka = layername
            if not isinstance(aka, str):
                layername, aka = layername
            if aka not in self._retained:
                self._retained[aka] = None
                self._detach_retained[aka] = detach
def retain_layers ( self , layernames , detach = True ) : self . add_hooks ( layernames ) for layername in layernames : aka = layername if not isinstance ( aka , str ) : layername , aka = layername if aka not in self . _retained : self . _retained [ aka ] = None self . _detach_retained [ aka ] = detach