      def flatten_data(self, data):
          """Given a data dictionary {<key>: <value_list>}, returns a flattened dictionary
          with information provided by the method "is_a_list"."""
          flatdata = dict()
          for key, attr_value in data.items():
              if self.is_a_list(key):
                  if isinstance(attr_value, list):
                      flatdata[key] = attr_value
                  else:
                      flatdata[key] = [attr_value]
              else:
                  if isinstance(attr_value, list):
                      flatdata[key] = attr_value[0]
                  else:
                      flatdata[key] = attr_value 
 
</s> remove                 if isinstance(attr_value, list):
                    flatdata[key] = attr_value[0]
 </s> add                 if val_list:
                    flatdata[key] = val_list[0] </s> remove                     flatdata[key] = attr_value 
 </s> add                     # If the list is empty, but the parameter is not a list,
                    # we strip this parameter.
                    data.pop(key) </s> remove     def is_a_list(self, key, val):
 </s> add     def is_a_list(self, key, val_list): </s> remove         # Flatening data and removing EMPTY_VALUEs from the lists
 </s> add         # removing EMPTY_VALUEs from the lists and flatening the data 
        for key, val_list in data.items():
            self.remove_empty_val(val_list)
        for key, val_list in data.items():
            if self.is_a_list(key, val_list):
                flatdata[key] = val_list
      def flatten_data(self, data):
          """Given a data dictionary {<key>: <value_list>}, returns a flattened dictionary
          with information provided by the method "is_a_list"."""
          flatdata = dict()
        for key, val_list in data.items():
            if self.is_a_list(key, val_list):
                flatdata[key] = val_list
        for key, val_list in data.items():
            if self.is_a_list(key, val_list):
                flatdata[key] = val_list
        for key, val_list in data.items():
            if self.is_a_list(key, val_list):
                flatdata[key] = val_list
        for key, val_list in data.items():
            if self.is_a_list(key, val_list):
                flatdata[key] = val_list
        for key, val_list in data.items():
            if self.is_a_list(key, val_list):
                flatdata[key] = val_list
        for key, val_list in data.items():
            if self.is_a_list(key, val_list):
                flatdata[key] = val_list
              else:
                  if isinstance(attr_value, list):
                      flatdata[key] = attr_value[0]
                  else:
                      flatdata[key] = attr_value 
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
 documentation + tests + debugging for formparsers 
djangorestframework/parsers.py