          elif isinstance(ret.get(index), dict):
              ret[index][key] = value
          else:
              ret[index] = MultiValueDict({key: [value]})
      return [ret[item] for item in sorted(ret.keys())]
  
  
  def parse_html_dict(dictionary, prefix=''):
      """
      Used to support dictionary values in HTML forms.
 
</s> remove                 for key in queryset.query.annotations.keys()
 </s> add                 for key in queryset.query.annotations </s> remove         elif not self.params or list(self.params.keys()) == ['q']:
 </s> add         elif not self.params or list(self.params) == ['q']: </s> remove             actions = set(callback.actions.keys())
 </s> add             actions = set(callback.actions) </s> remove         for key in kwargs.keys():
 </s> add         for key in kwargs: </s> remove         columns = [key for key in header.keys() if key != 'url']
        details = [key for key in header.keys() if key != 'url']
 </s> add         columns = [key for key in header if key != 'url']
        details = [key for key in header if key != 'url']
    return [ret[item] for item in sorted(ret)]
          elif isinstance(ret.get(index), dict):
              ret[index][key] = value
          else:
              ret[index] = MultiValueDict({key: [value]})
    return [ret[item] for item in sorted(ret)]
  
  
  def parse_html_dict(dictionary, prefix=''):
      """
      Used to support dictionary values in HTML forms.
keep keep keep keep replace keep keep keep keep keep
 Perfer iter(dict) over iter(dict.keys()) (#5736)

Calling dict.keys() is unnecessary. The two are functionally equivalent
on modern Pythons.

Inspired by Lennart Regebro's talk "Prehistoric Patterns in Python" from
PyCon 2017.

https://www.youtube.com/watch?v=V5-JH23Vk0I 
rest_framework/utils/html.py