def evaluate_object(obj, params):
 if isinstance(obj, basestring):
  return parse_string(obj, params)
 elif isinstance(obj, list):
  new_list = []
  for item in obj:
   new_list.append(evaluate_object(item, params))
  return new_list
 elif isinstance(obj, dict):
  new_dict = {}
  for key in obj:
   new_dict[key] = evaluate_object(obj[key], params)
  return new_dict
 else:
  return copy.deepcopy(obj)

def evaluate_object ( obj , params ) : if isinstance ( obj , basestring ) : return parse_string ( obj , params ) elif isinstance ( obj , list ) : new_list = [ ] for item in obj : new_list . append ( evaluate_object ( item , params ) ) return new_list elif isinstance ( obj , dict ) : new_dict = { } for key in obj : new_dict [ key ] = evaluate_object ( obj [ key ] , params ) return new_dict else : return copy . deepcopy ( obj )
returns a copy of obj after parsing strings in it using params .