<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def import_localities(path, delimiter=';'):
 """ Import localities from a CSV file. :param path: Path to the CSV file containing the localities. """


    creates = []
    updates = []

    with open(path, mode="r") as infile:
        reader = csv.DictReader(infile, delimiter=str(delimiter))

        with atomic():
            for row in reader:
                row['point'] = Point(float(row['longitude']),
                                     float(row['latitude']))
                locality, created = Locality.objects.update_or_create(
                    id=row['id'],
                    defaults=row
                )
                if created:
                    creates.append(locality)
                else:
                    updates.append(locality)

    return creates, updates