<s> '''<STR_LIT:U+0020>''' <EOL> from __future__ import print_function , unicode_literals <EOL> from yaml import safe_load <EOL> import logging <EOL> from pprint import pformat <EOL> log = logging . getLogger ( __name__ ) <EOL> def try_eval ( value ) : <EOL> "<STR_LIT>" <EOL> try : <EOL> return safe_load ( value ) <EOL> except : <EOL> return value <EOL> def set_nested_key ( dct , key , value ) : <EOL> """<STR_LIT>""" <EOL> keys = key . split ( '<STR_LIT:.>' ) <EOL> next_key = keys . pop ( <NUM_LIT:0> ) <EOL> while keys : <EOL> dct = dct . setdefault ( next_key , { } ) <EOL> next_key = keys . pop ( <NUM_LIT:0> ) <EOL> dct [ next_key ] = value <EOL> pass <EOL> def pformat2 ( value ) : <EOL> pvalue = pformat ( value , width = <NUM_LIT> ) . split ( '<STR_LIT:\n>' ) <EOL> sep = '<STR_LIT:\n>' + '<STR_LIT:U+0020>' * <NUM_LIT> <EOL> return sep . join ( pvalue ) <EOL> def print_opts ( category , data , opts , file = None ) : <EOL> '<STR_LIT>' <EOL> if not any ( opt in data for opt in opts ) : <EOL> return <EOL> print ( '<STR_LIT>' % category , file = file ) <EOL> print ( '<STR_LIT:->' * len ( category ) , file = file ) <EOL> for opt in opts : <EOL> if opt in data : <EOL> value = data . get ( opt ) <EOL> print ( "<STR_LIT>" % ( opt , pformat2 ( value ) ) , file = file ) </s>
