Defuse the fused activation layers in the network.
490965
def defuse_activation(self):
        
        idx, nb_layers = 0, len(self.layer_list)
        while idx < nb_layers:
            layer = self.layer_list[idx]
            k_layer = self.keras_layer_map[layer]
            if (isinstance(k_layer, _keras.layers.TimeDistributed)):
                k_layer = k_layer.layer
            if (isinstance(k_layer, _keras.layers.Conv2D) or
                isinstance(k_layer, _keras.layers.Conv1D) or
                isinstance(k_layer, _keras.layers.SeparableConv2D) or
                isinstance(k_layer, _keras.layers.SeparableConv1D) or
                isinstance(k_layer, _keras.layers.Dense)):

                func_name = k_layer.activation.func_name if six.PY2 else \
                        k_layer.activation.__name__

                if func_name != 'linear':
                    # Create new layer
                    new_layer = layer + '__activation__'
                    new_keras_layer = _keras.layers.core.Activation(func_name)
                    # insert new layer after it
                    self._insert_layer_after(idx, new_layer, new_keras_layer)
                    idx += 1
                    nb_layers += 1
            idx += 1
131028
def purgeDeletedWidgets():
        """"""
        toremove = []
        for field in AbstractEditorWidget.funit_fields:
            if sip.isdeleted(field):
                toremove.append(field)
        for field in toremove:
            AbstractEditorWidget.funit_fields.remove(field)

        toremove = []
        for field in AbstractEditorWidget.tunit_fields:
            if sip.isdeleted(field):
                toremove.append(field)
        for field in toremove:
            AbstractEditorWidget.tunit_fields.remove(field)
1355412
def _cleanup(self, ref):
        ''
        self.transitor_states[self._weakref_holder[ref]] -= 1
        del self._weakref_holder[ref]
842648
def destroy
      return unless Feature.bfd_enabled?
      [:interval,
       :ipv4_interval,
       :ipv6_interval,
       :fabricpath_interval,
       :echo_interface,
       :echo_rx_interval,
       :ipv4_echo_rx_interval,
       :ipv6_echo_rx_interval,
       :fabricpath_vlan,
       :slow_timer,
       :ipv4_slow_timer,
       :ipv6_slow_timer,
       :fabricpath_slow_timer,
       :startup_timer,
      ].each do |prop|
        send("#{prop}=", send("default_#{prop}")) if
          send prop
      end
      set_args_keys_default
    end
983446
def release(self):
        """"""
        self.clear()

        if hasattr(self, "functions"):
            del self.functions

        if hasattr(self, "lib") and self.lib is not None:
            self.lib._jit_destroy_state(self.state)
            self.lib = None
575546
def reset(self):
        
        self.__matrix = np.array([])
        self.__networks = np.array([])
1307479
async def delete(self):
        """"""
        interface = self._data['interface']
        data = await interface._handler.unlink_subnet(
            system_id=interface.node.system_id, id=interface.id, _id=self.id)
        interface._data['links'] = list(data['links'])
        interface._orig_data['links'] = copy.deepcopy(interface._data['links'])
892152
def destroy(self):
        """"""
        self.unregister_signals()
        for index in self.indexes:
            index.destroy()
        self.indexes = []
226800
def purge(self):
        
        try:
            self._device.setblocking(0)
            while(self._device.recv(1)):
                pass
        except socket.error as err:
            pass
        finally:
            self._device.setblocking(1)
812071
def remove_lp(self,layer):
        
        for this_node in self.node.findall('linguisticProcessors'):
            if this_node.get('layer') == layer:
                self.node.remove(this_node)
                break
1161066
private void destroyConnectionFactories(boolean destroyImmediately) {

        lock.writeLock().lock();
        try {
            if (isInitialized.get()) {
                // Mark all connection factories as disabled
                isInitialized.set(false);

                // Destroy the connection factories
                conMgrSvc.deleteObserver(this);
                conMgrSvc.destroyConnectionFactories();

                conMgrSvc = null;
            }
        } finally {
            lock.writeLock().unlock();
        }
    }
1095372
def _prune(self):
        
        done = False
        while not done:
            done = True
            for node in [node for node in self.nodes.values() if node.intermediate]:
                if not [dep for dep in self.nodes.values() if dep.previous == node.volume]:
                    # logger.debug("Removing unnecessary node %s", node)
                    del self.nodes[node.volume]
                    done = False
910152
def _cleanupConnections(senderkey, signal):
    """"""
    try:
        receivers = connections[senderkey][signal]
    except:
        pass
    else:
        if not receivers:
            # No more connected receivers. Therefore, remove the signal.
            try:
                signals = connections[senderkey]
            except KeyError:
                pass
            else:
                del signals[signal]
                if not signals:
                    # No more signal connections. Therefore, remove the sender.
                    _removeSender(senderkey)
1037390
def off(self):
        
        for device in self:
            if isinstance(device, (OutputDevice, CompositeOutputDevice)):
                device.off()
1181470
def remove_dependency_layer(self):
        
        if self.dependency_layer is not None:
            this_node = self.dependency_layer.get_node()
            self.root.remove(this_node)
            self.dependency_layer = self.my_dependency_extractor = None

        if self.header is not None:
            self.header.remove_lp('deps')
410299
def delete_network(self, network):
        """"""
        n_res = MechResource(network['id'], a_const.NETWORK_RESOURCE,
                             a_const.DELETE)
        self.provision_queue.put(n_res)
1303605
def _cleanup(self, domains):
        """"""
        for option in domains.values():
            try:
                os.remove(option['pot'])
            except (IOError, OSError):
                # It is not a problem if we can't actually remove the temporary file
                pass