import copy


def convert_to_simple(graph):
  """Drop duplicate edges, recording multiplicity in the "order" property."""
  g = copy.copy(graph)
  g.es['order'] = 1
  g.simplify(multiple=True, loops=False, combine_edges='sum')
  g.es['order'] = [int(x) for x in g.es['order']]
  return g