<s> import os . path <EOL> import uuid <EOL> import base64 <EOL> ROOT = os . path . abspath ( os . path . dirname ( __file__ ) ) <EOL> if os . path . exists ( '<STR_LIT>' ) : <EOL> config_path = '<STR_LIT>' <EOL> else : <EOL> config_path = os . path . join ( ROOT , '<STR_LIT>' ) <EOL> try : <EOL> import json <EOL> except ImportError : <EOL> import simplejson as json <EOL> try : <EOL> config_file = file ( config_path ) . read ( ) <EOL> config = json . loads ( config_file ) <EOL> except : <EOL> config = { } <EOL> config [ '<STR_LIT>' ] = base64 . b64encode ( uuid . uuid4 ( ) . bytes + uuid . uuid4 ( ) . bytes ) <EOL> generated_config_path = os . path . join ( ROOT , '<STR_LIT>' ) <EOL> with open ( generated_config_path , '<STR_LIT>' ) as f : <EOL> config_contents = json . dumps ( config , indent = <NUM_LIT:4> ) <EOL> f . write ( config_contents ) </s>
