import copy


def duplicatePointsAndCircles(records):
    """Find points and circles with multiple vertexes and move each to its own record.

    Rarely we will get a record with a circle that has multiple vertexes. This could
    also happen with points (although never seen). If we find this, duplicate the
    record and move each vertex into its own record for more uniform handling.

    Args:
        records (list): Lest of all geometry records.

    Returns:
        list: All the records with possibly new records for the separated
        vertexes.
    """
    newRecords = []

    for record in records:
        overlayGeoOptions = record['overlay_geometry_options']

        if (overlayGeoOptions in [7, 8, 9, 10]):
            # Circles and points. Usually (except in 1 case seen in the wild with circles)
            # only have one vertext. If more, duplicate the record and add extras
            # one per record.
            if len(record['vertex_list']) == 1:
                newRecords.append(record)
            else:
                vertexList = copy.deepcopy(record['vertex_list'])                
                for v in vertexList:
                    recordCopy = copy.deepcopy(record)
                    recordCopy['vertex_list'] = [v]
                    newRecords.append(recordCopy)
        else:
            newRecords.append(record)
        
    return newRecords