def addValueToOutput(depth, keyInput, output, value):
 depthStart = ('  ' * depth)
 output.write(('%s%s:' % (depthStart, keyInput)))
 if (value.__class__ == dict):
  output.write('\n')
  keys = value.keys()
  keys.sort()
  for key in keys:
   addValueToOutput((depth + 1), key, output, value[key])
  return
 if (value.__class__ == list):
  output.write('\n')
  for (elementIndex, element) in enumerate(value):
   addValueToOutput((depth + 1), elementIndex, output, element)
  return
 output.write((' %s\n' % value))

def addValueToOutput ( depth , keyInput , output , value ) : depthStart = ( '  ' * depth ) output . write ( ( '%s%s:' % ( depthStart , keyInput ) ) ) if ( value . __class__ == dict ) : output . write ( '\n' ) keys = value . keys ( ) keys . sort ( ) for key in keys : addValueToOutput ( ( depth + 1 ) , key , output , value [ key ] ) return if ( value . __class__ == list ) : output . write ( '\n' ) for ( elementIndex , element ) in enumerate ( value ) : addValueToOutput ( ( depth + 1 ) , elementIndex , output , element ) return output . write ( ( ' %s\n' % value ) )
add value to the output .