<s> import sys <EOL> sys . path . append ( "<STR_LIT>" ) <EOL> import bandicoot as bc <EOL> import glob <EOL> import multiprocessing as mp <EOL> import os <EOL> records_path = '<STR_LIT>' <EOL> antenna_file = '<STR_LIT>' <EOL> number_of_processors = <NUM_LIT:8> <EOL> def load_and_compute ( f ) : <EOL> user_id = os . path . basename ( f ) [ : - <NUM_LIT:4> ] <EOL> try : <EOL> B = bc . read_csv ( user_id , records_path , antenna_file , describe = False ) <EOL> metrics_dic = bc . utils . all ( B ) <EOL> except Exception as e : <EOL> metrics_dic = { '<STR_LIT:name>' : user_id , '<STR_LIT:error>' : True } <EOL> return metrics_dic <EOL> user_list = sorted ( glob . glob ( records_path + '<STR_LIT>' ) ) <EOL> indicators = [ ] <EOL> pool = mp . Pool ( number_of_processors ) <EOL> indicators = pool . map_async ( load_and_compute , user_list ) <EOL> indicators = indicators . get ( ) <EOL> pool . close ( ) <EOL> pool . join ( ) <EOL> bc . io . to_csv ( indicators , '<STR_LIT>' ) </s>
