code: def _remove_layer_and_reconnect(self, layer):
          
          successors = self.get_successors(layer)
          predecessors = self.get_predecessors(layer)
          # remove layer's edges
          for succ in successors:
              self._remove_edge(layer, succ)
          for pred in predecessors:
              self._remove_edge(pred, layer)
  
          # connect predecessors and successors
          for pred in predecessors:
              for succ in successors:
                  self._add_edge(pred, succ)
  
          # remove layer in the data structures
          self.layer_list.remove(layer)
          self.keras_layer_map.pop(layer)
  
          # re-assign input and output layers if layer happens to be an
          # input / output layer
          if layer in self.input_layers:
              idx = self.input_layers.index(layer)
              self.input_layers.pop(idx)
              for pred in predecessors:
                  self.input_layers.insert(idx, pred)
                  idx += 1
          if layer in self.output_layers:
              idx = self.output_layers.index(layer)
              self.output_layers.pop(idx)
              for succ in successors:
                  self.output_layers.insert(idx, succ)
                  idx += 1
docs: Remove the layer, and reconnect each of its predecessor to each of
          its successor