def insert_fake_data(db, tablename, **kw):
 column_names = []
 column_value_placeholders = []
 column_values = []
 for (k, v) in kw.items():
  column_names.append(k)
  column_value_placeholders.append('%s')
  column_values.append(v)
 column_names = ', '.join(column_names)
 column_value_placeholders = ', '.join(column_value_placeholders)
 db.run('INSERT INTO {} ({}) VALUES ({})'.format(tablename, column_names, column_value_placeholders), column_values)
 return kw

def insert_fake_data ( db , tablename , ** kw ) : column_names = [ ] column_value_placeholders = [ ] column_values = [ ] for ( k , v ) in kw . items ( ) : column_names . append ( k ) column_value_placeholders . append ( '%s' ) column_values . append ( v ) column_names = ', ' . join ( column_names ) column_value_placeholders = ', ' . join ( column_value_placeholders ) db . run ( 'INSERT INTO {} ({}) VALUES ({})' . format ( tablename , column_names , column_value_placeholders ) , column_values ) return kw
insert fake data into the database .