  import copy
  import datetime
  import decimal
  import inspect
  import re
  import uuid
  
  from django.conf import settings
  from django.core.exceptions import ValidationError as DjangoValidationError
 
</s> remove         # Allow either single or paired choices style:
        # choices = [1, 2, 3]
        # choices = [(1, 'First'), (2, 'Second'), (3, 'Third')]
        pairs = [
            isinstance(item, (list, tuple)) and len(item) == 2
            for item in choices
        ]
        if all(pairs):
            self.choices = OrderedDict([(key, display_value) for key, display_value in choices])
        else:
            self.choices = OrderedDict([(item, item) for item in choices])
 </s> add         flat_choices = [self.flatten_choice(c) for c in choices]
        self.choices = OrderedDict(itertools.chain(*flat_choices))
import itertools
  import copy
  import datetime
  import decimal
  import inspect
import itertools
  import re
  import uuid
  
  from django.conf import settings
  from django.core.exceptions import ValidationError as DjangoValidationError
keep keep keep add keep keep keep keep keep
 Add support for grouped choices.

This also adds support for mixing single and paired choices:
```
[
    ('poor', 'Poor quality'),
    'medium',
    ('good', 'Good quality'),
]
``` 
rest_framework/fields.py