code: def update_arc_indexes(geometry, merged_arcs, old_arcs):
      
      if geometry['type'] in ('Point', 'MultiPoint'):
          return
  
      elif geometry['type'] == 'LineString':
          for arc_index, old_arc in enumerate(geometry['arcs']):
              geometry['arcs'][arc_index] = len(merged_arcs)
              merged_arcs.append(old_arcs[old_arc])
  
      elif geometry['type'] == 'Polygon':
          for ring in geometry['arcs']:
              for arc_index, old_arc in enumerate(ring):
                  ring[arc_index] = len(merged_arcs)
                  merged_arcs.append(old_arcs[old_arc])
  
      elif geometry['type'] == 'MultiLineString':
          for part in geometry['arcs']:
              for arc_index, old_arc in enumerate(part):
                  part[arc_index] = len(merged_arcs)
                  merged_arcs.append(old_arcs[old_arc])
  
      elif geometry['type'] == 'MultiPolygon':
          for part in geometry['arcs']:
              for ring in part:
                  for arc_index, old_arc in enumerate(ring):
                      ring[arc_index] = len(merged_arcs)
                      merged_arcs.append(old_arcs[old_arc])
  
      else:
          raise NotImplementedError("Can't do %s geometries" % geometry['type'])
docs: Updated geometry arc indexes, and add arcs to merged_arcs along the way.
  
          Arguments are modified in-place, and nothing is returned.