def find_parameters(instance, fields=None):
 if (fields is None):
  fields = NODES[('%s-widget' % instance.data['type'])].FIELDS.keys()
 params = []
 for field in fields:
  data = instance.data['properties'][field]
  if ((field == 'sla') and (not instance.sla_enabled)):
   continue
  if isinstance(data, list):
   params.extend(find_json_parameters(data))
  elif isinstance(data, basestring):
   for match in Template.pattern.finditer(data):
    name = match.group('braced')
    if (name is not None):
     params.append(name)
 return params

def find_parameters ( instance , fields = None ) : if ( fields is None ) : fields = NODES [ ( '%s-widget' % instance . data [ 'type' ] ) ] . FIELDS . keys ( ) params = [ ] for field in fields : data = instance . data [ 'properties' ] [ field ] if ( ( field == 'sla' ) and ( not instance . sla_enabled ) ) : continue if isinstance ( data , list ) : params . extend ( find_json_parameters ( data ) ) elif isinstance ( data , basestring ) : for match in Template . pattern . finditer ( data ) : name = match . group ( 'braced' ) if ( name is not None ) : params . append ( name ) return params
find parameters in the given fields .