def restore_from_tmp(tablename):
    print('restoring data to table ' + tablename)
    cursor = connection.cursor()
    cursor.execute("INSERT INTO {t} SELECT * FROM tmp_{t};".format(t=tablename))
    cursor.execute("DROP TABLE IF EXISTS tmp_{t};".format(t=tablename))
dataset/ETHPy150Open opencivicdata/pupa/pupa/cli/commands/dbinit.py/restore_from_tmp/original