def _decode_configurations_from_api(configurations):
 results = []
 for c in configurations:
  result = {}
  if hasattr(c, 'classification'):
   result['Classification'] = c.classification
  if getattr(c, 'configurations', None):
   result['Configurations'] = _decode_configurations_from_api(c.configurations)
  result['Properties'] = dict(((kv.key, kv.value) for kv in getattr(c, 'properties', [])))
  results.append(result)
 return results

def _decode_configurations_from_api ( configurations ) : results = [ ] for c in configurations : result = { } if hasattr ( c , 'classification' ) : result [ 'Classification' ] = c . classification if getattr ( c , 'configurations' , None ) : result [ 'Configurations' ] = _decode_configurations_from_api ( c . configurations ) result [ 'Properties' ] = dict ( ( ( kv . key , kv . value ) for kv in getattr ( c , 'properties' , [ ] ) ) ) results . append ( result ) return results
recursively convert configurations object from describe_cluster() back into simple data structure .