

def copy_tmp(tablename):
    cursor = connection.cursor()
    print(('copying data from table ' + tablename))
    cursor.execute('DROP TABLE IF EXISTS tmp_{t};'.format(t=tablename))
    cursor.execute('CREATE TABLE tmp_{t} (LIKE {t});'.format(t=tablename))
    cursor.execute('INSERT INTO tmp_{t} SELECT * FROM {t};'.format(t=tablename))

dataset/ETHPy150Open opencivicdata/pupa/pupa/cli/commands/dbinit.py copy_tmp/original