'Imports data from ``tablib.Dataset``. Refer to :doc:`import_workflow`
for a more complete description of the whole import process.
:param row: A ``dict`` of the row to import
:param instance_loader: The instance loader to be used to load the row
:param using_transactions: If ``using_transactions`` is set, a transaction
is being used to wrap the import
:param dry_run: If ``dry_run`` is set, or error occurs, transaction
will be rolled back.'

def import_row(self, row, instance_loader, using_transactions=True, dry_run=False, **kwargs):

    row_result = self.get_row_result_class()()
    try:
        self.before_import_row(row, **kwargs)
        (instance, new) = self.get_or_init_instance(instance_loader, row)
        self.after_import_instance(instance, new, **kwargs)
        if new:
            row_result.import_type = RowResult.IMPORT_TYPE_NEW
        else:
            row_result.import_type = RowResult.IMPORT_TYPE_UPDATE
        row_result.new_record = new
        original = deepcopy(instance)
        diff = Diff(self, original, new)
        if self.for_delete(row, instance):
            if new:
                row_result.import_type = RowResult.IMPORT_TYPE_SKIP
                diff.compare_with(self, None, dry_run)
            else:
                row_result.import_type = RowResult.IMPORT_TYPE_DELETE
                self.delete_instance(instance, using_transactions, dry_run)
                diff.compare_with(self, None, dry_run)
        else:
            self.import_obj(instance, row, dry_run)
            if self.skip_row(instance, original):
                row_result.import_type = RowResult.IMPORT_TYPE_SKIP
            else:
                with transaction.atomic():
                    self.save_instance(instance, using_transactions, dry_run)
                self.save_m2m(instance, row, using_transactions, dry_run)
            diff.compare_with(self, instance, dry_run)
        row_result.diff = diff.as_html()
        if (row_result.import_type != RowResult.IMPORT_TYPE_SKIP):
            row_result.object_id = instance.pk
            row_result.object_repr = force_text(instance)
        self.after_import_row(row, row_result, **kwargs)
    except Exception as e:
        row_result.import_type = RowResult.IMPORT_TYPE_ERROR
        if (not isinstance(e, TransactionManagementError)):
            logging.exception(e)
        tb_info = traceback.format_exc()
        row_result.errors.append(self.get_error_result_class()(e, tb_info, row))
    return row_result
