<s> import os <EOL> import sqlite3 <EOL> def main ( ) : <EOL> """<STR_LIT>""" <EOL> db_dir = os . path . join ( "<STR_LIT:..>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> eve_db_file = os . path . join ( db_dir , "<STR_LIT>" ) <EOL> system_jumps_file = os . path . join ( db_dir , "<STR_LIT>" ) <EOL> system_description_file = os . path . join ( db_dir , "<STR_LIT>" ) <EOL> with sqlite3 . connect ( eve_db_file ) as sql_con : <EOL> cursor = sql_con . cursor ( ) <EOL> result = cursor . execute ( '<STR_LIT>' ) <EOL> with open ( system_jumps_file , "<STR_LIT:w>" ) as f_out : <EOL> for row in result . fetchall ( ) : <EOL> f_out . write ( "<STR_LIT>" . format ( row [ <NUM_LIT:0> ] , row [ <NUM_LIT:1> ] ) ) <EOL> result = cursor . execute ( '<STR_LIT>' ) <EOL> with open ( system_description_file , "<STR_LIT:w>" ) as f_out : <EOL> for row in result . fetchall ( ) : <EOL> region_id = row [ <NUM_LIT:0> ] <EOL> system_id = row [ <NUM_LIT:1> ] <EOL> system_name = row [ <NUM_LIT:2> ] <EOL> security = float ( row [ <NUM_LIT:3> ] ) <EOL> query = cursor . execute ( <EOL> '<STR_LIT>' , <EOL> ( region_id , ) <EOL> ) <EOL> system_class = query . fetchone ( ) <EOL> if system_class : <EOL> system_class = system_class [ <NUM_LIT:0> ] <EOL> else : <EOL> query = cursor . execute ( <EOL> '<STR_LIT>' , <EOL> ( system_id , ) <EOL> ) <EOL> system_class = query . fetchone ( ) <EOL> if system_class : <EOL> system_class = system_class [ <NUM_LIT:0> ] <EOL> else : <EOL> system_class = "<STR_LIT>" <EOL> if system_class != "<STR_LIT>" : <EOL> if system_class in [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:6> , <NUM_LIT:12> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:15> , <NUM_LIT:16> , <NUM_LIT> , <NUM_LIT> ] : <EOL> system_class = "<STR_LIT>" . format ( system_class ) <EOL> else : <EOL> if <NUM_LIT> <= security : <EOL> system_class = "<STR_LIT>" <EOL> elif <NUM_LIT:0> <= security < <NUM_LIT> : <EOL> system_class = "<STR_LIT>" <EOL> else : <EOL> system_class = "<STR_LIT>" <EOL> if security < <NUM_LIT:0> : <EOL> security_format = "<STR_LIT>" . format ( security ) <EOL> elif <NUM_LIT:0> <= security <= <NUM_LIT:0.1> : <EOL> security_format = "<STR_LIT>" <EOL> else : <EOL> security_format = "<STR_LIT>" . format ( security ) <EOL> f_out . write ( "<STR_LIT>" . format ( system_id , system_name , system_class , security_format ) ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
