<s> from __future__ import absolute_import <EOL> from __future__ import unicode_literals <EOL> def insert_metric_ids ( db , metric_ids ) : <EOL> values = [ [ x ] for x in metric_ids ] <EOL> db . executemany ( "<STR_LIT>" , values ) <EOL> def insert_metric_values ( db , metric_values , metric_mapping , commit ) : <EOL> values = [ <EOL> [ commit . sha , metric_mapping [ metric_name ] , commit . date , value ] <EOL> for metric_name , value in metric_values . items ( ) <EOL> ] <EOL> db . executemany ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' , <EOL> values , <EOL> ) <EOL> def insert_metric_changes ( db , metrics , metric_mapping , commit ) : <EOL> """<STR_LIT>""" <EOL> values = [ <EOL> [ commit . sha , metric_mapping [ metric . name ] , metric . value ] <EOL> for metric in metrics <EOL> if metric . value != <NUM_LIT:0> <EOL> ] <EOL> db . executemany ( <EOL> '<STR_LIT>' , <EOL> values , <EOL> ) </s>
