def _param_from_config(key, data):
 param = {}
 if isinstance(data, dict):
  for (k, v) in six.iteritems(data):
   param.update(_param_from_config('{0}.{1}'.format(key, k), v))
 elif (isinstance(data, list) or isinstance(data, tuple)):
  for (idx, conf_item) in enumerate(data):
   prefix = '{0}.{1}'.format(key, idx)
   param.update(_param_from_config(prefix, conf_item))
 elif isinstance(data, bool):
  param.update({key: str(data).lower()})
 else:
  param.update({key: data})
 return param

def _param_from_config ( key , data ) : param = { } if isinstance ( data , dict ) : for ( k , v ) in six . iteritems ( data ) : param . update ( _param_from_config ( '{0}.{1}' . format ( key , k ) , v ) ) elif ( isinstance ( data , list ) or isinstance ( data , tuple ) ) : for ( idx , conf_item ) in enumerate ( data ) : prefix = '{0}.{1}' . format ( key , idx ) param . update ( _param_from_config ( prefix , conf_item ) ) elif isinstance ( data , bool ) : param . update ( { key : str ( data ) . lower ( ) } ) else : param . update ( { key : data } ) return param
return ec2 api parameters based on the given config data .