code: def get_subgraph(self, subvertices, normalize=False):
          if normalize:
              revorder = dict((j, i) for i, j in enumerate(subvertices))
              new_edges = []
              old_edge_indexes = []
              for counter, (i, j) in enumerate(self.edges):
                  new_i = revorder.get(i)
                  if new_i is None:
                      continue
                  new_j = revorder.get(j)
                  if new_j is None:
                      continue
                  new_edges.append((new_i, new_j))
                  old_edge_indexes.append(counter)
              order = list(range(len(new_edges)))
              order.sort( key=(lambda i: tuple(sorted(new_edges[i]))) )
              new_edges = [new_edges[i] for i in order]
              old_edge_indexes = [old_edge_indexes[i] for i in order]
              result = Graph(new_edges, num_vertices=len(subvertices))
              result._old_vertex_indexes = np.array(subvertices, dtype=int)
              result._old_edge_indexes = np.array(old_edge_indexes, dtype=int)
          else:
              subvertices = set(subvertices)
              old_edge_indexes = np.array([
                  i for i, edge in enumerate(self.edges)
                  if edge.issubset(subvertices)
              ], dtype=int)
              new_edges = tuple(self.edges[i] for i in old_edge_indexes)
              result = Graph(new_edges, self.num_vertices)
              result._old_edge_indexes = old_edge_indexes
          return result