code: def _ensure_format(rule, attribute, res_dict):
      
      if rule == 'type:uuid' or (rule == 'type:uuid_or_none' and
                                 res_dict[attribute]):
          res_dict[attribute] = uuidify(res_dict[attribute])
      elif rule == 'type:uuid_list':
          if not res_dict[attribute]:
              res_dict[attribute] = []
          else:
              temp_list = res_dict[attribute].split(':')
              res_dict[attribute] = []
              for item in temp_list:
                  res_dict[attribute].append = uuidify(item)
      elif rule == 'type:string_or_none' and res_dict[attribute] == "":
          res_dict[attribute] = None
docs: Verifies that attribute in res_dict is properly formatted.
  
      Since, in the .ini-files, lists are specified as ':' separated text and
      UUID values can be plain integers we need to transform any such values
      into proper format. Empty strings are converted to None if validator
      specifies that None value is accepted.