def METHOD_NAME(aiida_profile_clean, aiida_localhost, tmp_path):
    """
    Create an export with some orm.CalculationNode and Data nodes and import it after having
    cleaned the database. Verify that the nodes and their attributes are restored
    properly after importing the created export archive
    """
    from aiida.common.links import LinkType
    test_label = 'Test structure'
    test_cell = [[8.34, 0.0, 0.0], [0.298041701839357, 8.53479766274308, 0.0],
                 [0.842650688117053, 0.47118495164127, 10.6965192730702]]
    test_kinds = [{
        'symbols': ['Fe'],
        'weights': [1.0],
        'mass': 55.845,
        'name': 'Fe'
    }, {
        'symbols': ['S'],
        'weights': [1.0],
        'mass': 32.065,
        'name': 'S'
    }]
    structure = orm.StructureData(cell=test_cell)
    structure.append_atom(symbols=['Fe'], position=[0, 0, 0])
    structure.append_atom(symbols=['S'], position=[2, 2, 2])
    structure.label = test_label
    structure.store()
    parent_process = orm.CalculationNode()
    parent_process.base.attributes.set('key', 'value')
    parent_process.store()
    child_calculation = orm.CalculationNode()
    child_calculation.base.attributes.set('key', 'value')
    remote_folder = orm.RemoteData(computer=aiida_localhost, remote_path='/').store()
    remote_folder.base.links.add_incoming(parent_process, link_type=LinkType.CREATE, link_label='link')
    child_calculation.base.links.add_incoming(remote_folder, link_type=LinkType.INPUT_CALC, link_label='link')
    child_calculation.store()
    structure.base.links.add_incoming(child_calculation, link_type=LinkType.CREATE, link_label='link')
    parent_process.seal()
    child_calculation.seal()
    archive_path = tmp_path / 'archive.aiida'
    nodes = [structure, child_calculation, parent_process, remote_folder]
    create_archive(nodes, filename=archive_path)
    # Check that we have the expected number of nodes in the database
    assert orm.QueryBuilder().append(orm.Node).count() == len(nodes)
    # Clean the database and verify there are no nodes left
    aiida_profile_clean.clear_profile()
    assert orm.QueryBuilder().append(orm.Node).count() == 0
    # After importing we should have the original number of nodes again
    import_archive(archive_path)
    assert orm.QueryBuilder().append(orm.Node).count() == len(nodes)
    # Verify that orm.CalculationNodes have non-empty attribute dictionaries
    builder = orm.QueryBuilder().append(orm.CalculationNode)
    for [calculation] in builder.iterall():
        assert isinstance(calculation.base.attributes.all, dict)
        assert len(calculation.base.attributes.all) != 0
    # Verify that the structure data maintained its label, cell and kinds
    builder = orm.QueryBuilder().append(orm.StructureData)
    for [structure] in builder.iterall():
        assert structure.label == test_label
        # Check that they are almost the same, within numerical precision
        assert np.abs(np.array(structure.cell) - np.array(test_cell)).max() < 1.e-12
    builder = orm.QueryBuilder().append(orm.StructureData, project=['attributes.kinds'])
    for [kinds] in builder.iterall():
        assert len(kinds) == 2
        for kind in kinds:
            assert kind in test_kinds
    # Check that there is a StructureData that is an output of a orm.CalculationNode
    builder = orm.QueryBuilder()
    builder.append(orm.CalculationNode, project=['uuid'], tag='calculation')
    builder.append(orm.StructureData, with_incoming='calculation')
    assert len(builder.all()) > 0
    # Check that there is a RemoteData that is a child and parent of a orm.CalculationNode
    builder = orm.QueryBuilder()
    builder.append(orm.CalculationNode, tag='parent')
    builder.append(orm.RemoteData, project=['uuid'], with_incoming='parent', tag='remote')
    builder.append(orm.CalculationNode, with_incoming='remote')
    assert len(builder.all()) > 0