                  'label', 'help_text', 'style',
                  'error_messages', 'validators', 'allow_null', 'allow_blank',
                  'choices'
              }
              for key in list(field_kwargs.keys()):
                  if key not in valid_kwargs:
                      field_kwargs.pop(key)
  
          if not issubclass(field_class, ModelField):
              # `model_field` is only valid for the fallback case of
 
</s> remove             six.text_type(key): key for key in self.choices.keys()
 </s> add             six.text_type(key): key for key in self.choices </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'] </s> remove             actions = set(callback.actions.keys())
 </s> add             actions = set(callback.actions) </s> remove         for parent_class in [model] + list(model._meta.parents.keys()):
 </s> add         for parent_class in [model] + list(model._meta.parents): </s> remove         for key in self._data.keys():
 </s> add         for key in self._data:
            for key in list(field_kwargs):
                  'label', 'help_text', 'style',
                  'error_messages', 'validators', 'allow_null', 'allow_blank',
                  'choices'
              }
            for key in list(field_kwargs):
                  if key not in valid_kwargs:
                      field_kwargs.pop(key)
  
          if not issubclass(field_class, ModelField):
              # `model_field` is only valid for the fallback case of
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/serializers.py