'Reset the SQL sequences after new objects are imported'

def after_import(self, dataset, result, using_transactions, dry_run, **kwargs):

    if ((not dry_run) and any(((r.import_type == RowResult.IMPORT_TYPE_NEW) for r in result.rows))):
        connection = connections[DEFAULT_DB_ALIAS]
        sequence_sql = connection.ops.sequence_reset_sql(no_style(), [self._meta.model])
        if sequence_sql:
            cursor = connection.cursor()
            try:
                for line in sequence_sql:
                    cursor.execute(line)
            finally:
                cursor.close()
