Remove the faces and vertices for given segments, keeping all others.

        Args:
            segments_to_remove: a list of segnments whose vertices will be removed
189317
def remove_segments(self, segments_to_remove):
        ''' 
        '''
        v_ind = self.vertex_indices_in_segments(segments_to_remove)
        self.segm = {name: faces for name, faces in self.segm.iteritems() if name not in segments_to_remove}
        self.remove_vertices(v_ind)
45578
def remove_vertex(self, vertex):
        
        try:
            self.vertices.pop(vertex)
        except KeyError:
            raise GraphInsertError("Vertex %s doesn't exist." % (vertex,))
        if vertex in self.nodes:
            self.nodes.pop(vertex)
        for element in self.vertices:
            if vertex in self.vertices[element]:
                self.vertices[element].remove(vertex)
        edges = []  # List for edges that include vertex
        for element in self.edges:
            if vertex in element:
                edges.append(element)
        for element in edges:
            del self.edges[element]
2326
def remove_edges(self, from_idx, to_idx, symmetric=False, copy=False):
    ''''''
    flat_inds = self._pairs.dot((self._num_vertices, 1))
    # convert to sorted order and flatten
    to_remove = (np.minimum(from_idx, to_idx) * self._num_vertices
                 + np.maximum(from_idx, to_idx))
    mask = np.in1d(flat_inds, to_remove, invert=True)
    res = self.copy() if copy else self
    res._pairs = res._pairs[mask]
    res._offdiag_mask = res._offdiag_mask[mask]
    return res
1210939
def remove_edge(self, p_from, p_to, p_remove_unconnected_nodes=True):
        
        if self.has_edge(p_from, p_to):
            self._edges[p_from].remove(p_to)

        try:
            del self._edge_numbers[(p_from, p_to)]
        except KeyError:
            return None

        if p_remove_unconnected_nodes:
            if self.is_isolated(p_from):
                self.remove_node(p_from)

            if self.is_isolated(p_to):
                self.remove_node(p_to)
1224472
def keep_vertices(self, indices_to_keep, ret_kept_edges=False):
        '''
        

        '''

        if self.v is None:
            return

        initial_num_verts = self.v.shape[0]
        if self.e is not None:
            initial_num_edges = self.e.shape[0]
            e_indices_to_keep = self.all_edges_with_verts(indices_to_keep, as_boolean=True)

        self.v = self.v[indices_to_keep]
        if self.e is not None:
            v_old_to_new = np.zeros(initial_num_verts, dtype=int)
            e_old_to_new = np.zeros(initial_num_edges, dtype=int)

            v_old_to_new[indices_to_keep] = np.arange(len(indices_to_keep), dtype=int)
            self.e = v_old_to_new[self.e[e_indices_to_keep]]
            e_old_to_new[e_indices_to_keep] = np.arange(self.e.shape[0], dtype=int)
        else:
            e_indices_to_keep = []

        return np.nonzero(e_indices_to_keep)[0] if ret_kept_edges else self
579381
private Graph<K, VV, EV> removeVertices(DataSet<Vertex<K, VV>> verticesToBeRemoved) {

		DataSet<Vertex<K, VV>> newVertices = getVertices().coGroup(verticesToBeRemoved).where(0).equalTo(0)
				.with(new VerticesRemovalCoGroup<>()).name("Remove vertices");

		DataSet <Edge< K, EV>> newEdges = newVertices.join(getEdges()).where(0).equalTo(0)
				// if the edge source was removed, the edge will also be removed
				.with(new ProjectEdgeToBeRemoved<>()).name("Edges to be removed")
				// if the edge target was removed, the edge will also be removed
				.join(newVertices).where(1).equalTo(0)
				.with(new ProjectEdge<>()).name("Remove edges");

		return new Graph<>(newVertices, newEdges, context);
	}
302647
def _prepPointsForSegments(points):
    
    while 1:
        point = points[-1]
        if point.segmentType:
            break
        else:
            point = points.pop()
            points.insert(0, point)
            continue
        break
763896
def remove_subsegment(self, subsegment):
        
        super(Segment, self).remove_subsegment(subsegment)
        self.decrement_subsegments_size()
1240434
def delete(self, moveIssuesTo=None):
        
        params = {}
        if moveIssuesTo is not None:
            params['moveIssuesTo'] = moveIssuesTo

        super(Component, self).delete(params)
1186029
def _get_segments(self):
        
        points = list(self.points)
        segments = [[]]
        lastWasOffCurve = False
        firstIsMove = points[0].type == "move"
        for point in points:
            segments[-1].append(point)
            if point.type != "offcurve":
                segments.append([])
            lastWasOffCurve = point.type == "offcurve"
        if len(segments[-1]) == 0:
            del segments[-1]
        if lastWasOffCurve and firstIsMove:
            # ignore trailing off curves
            del segments[-1]
        if lastWasOffCurve and not firstIsMove:
            segment = segments.pop(-1)
            segment.extend(segments[0])
            del segments[0]
            segments.append(segment)
        if not lastWasOffCurve and not firstIsMove:
            segment = segments.pop(0)
            segments.append(segment)
        # wrap into segments
        wrapped = []
        for points in segments:
            s = self.segmentClass()
            s._setPoints(points)
            self._setContourInSegment(s)
            wrapped.append(s)
        return wrapped
204311
def remove_nodes(self, indices):
        

        self.molecule.remove_sites(indices)
        self.graph.remove_nodes_from(indices)

        mapping = {}
        for correct, current in enumerate(sorted(self.graph.nodes)):
            mapping[current] = correct

        nx.relabel_nodes(self.graph, mapping, copy=False)
        self.set_node_attributes()
573597
public void moveSegmentOut(final String sequenceName, final List<SegmentIdWithShardSpec> identifiers)
  {
    synchronized (segments) {
      final SegmentsForSequence activeSegmentsForSequence = segments.get(sequenceName);
      if (activeSegmentsForSequence == null) {
        throw new ISE("WTF?! Asked to remove segments for sequenceName[%s] which doesn't exist...", sequenceName);
      }

      for (final SegmentIdWithShardSpec identifier : identifiers) {
        log.info("Moving segment[%s] out of active list.", identifier);
        final long key = identifier.getInterval().getStartMillis();
        final SegmentsOfInterval segmentsOfInterval = activeSegmentsForSequence.get(key);
        if (segmentsOfInterval == null ||
            segmentsOfInterval.getAppendingSegment() == null ||
            !segmentsOfInterval.getAppendingSegment().getSegmentIdentifier().equals(identifier)) {
          throw new ISE("WTF?! Asked to remove segment[%s] that didn't exist...", identifier);
        }
        segmentsOfInterval.finishAppendingToCurrentActiveSegment(SegmentWithState::finishAppending);
      }
    }
  }
779638
def remove_overlap(self, also_remove_contiguous: bool = False) -> None:
        
        overlap = True
        while overlap:
            overlap = self._remove_overlap_sub(also_remove_contiguous)
        self._sort()
559858
def verts_in_common(self, segments):
        
        verts_by_segm = self.verts_by_segm
        return sorted(reduce(lambda s0, s1: s0.intersection(s1),
                             [set(verts_by_segm[segm]) for segm in segments]))
1368515
function(segments) {
        var previousSegment = [-1, -1];
        var segmentIndicesToRemove = [];
        var cleanedSegmentArray = [];
        var i, ii;
        for (i = 0, ii = segments.length; i < ii; ++i) {
            if (!(previousSegment[0] <= segments[i][0] &&
                    previousSegment[1] >= segments[i][1])) {
                cleanedSegmentArray.push(segments[i]);
            }
            previousSegment = segments[i];
        }

        segments.length = 0;
        for (i = 0, ii = cleanedSegmentArray.length; i < ii; ++i) {
            segments.push(cleanedSegmentArray[i]);
        }
    }
1358764
def merge_and_fit(self, segment):
        
        self.points = sort_segment_points(self.points, segment.points)
        return self
144123
def reset_segments(segmentA=nil, segmentB=nil)
      if !segmentA
        @segments = [:days, :hours, :minutes, :seconds]
      elsif !segmentB
        case segmentA
        when Array
          @segments = segmentA.map{ |p| (p.to_s.downcase.chomp('s') + 's').to_sym }
          raise ArgumentError unless @segments.all?{ |s| SEGMENTS.include?(s) }
        else
          f = SEGMENTS.index(segmentA)
          @segments = SEGMENTS[f..0]
        end
      else # segmentA && segmentB
        f = SEGMENTS.index(segmentA)
        t = SEGMENTS.index(segmentB)
        @segments = SEGMENTS[f..t]
      end
    end