      # Allow single, paired or grouped choices style:
      # choices = [1, 2, 3]
      # choices = [(1, 'First'), (2, 'Second'), (3, 'Third')]
      # choices = [('Category', ((1, 'First'), (2, 'Second'))), (3, 'Third')]
      ret = OrderedDict()
      for choice in choices:
          if not isinstance(choice, (list, tuple)):
              # single choice
              ret[choice] = choice
          else:
 
</s> remove         choices = list(OrderedDict.fromkeys(field.choices))  # preserve order and remove duplicates
 </s> add         choices = list(dict.fromkeys(field.choices))  # preserve order and remove duplicates </s> remove     ret = OrderedDict()
 </s> add     ret = {} </s> remove         ret = OrderedDict()
 </s> add         ret = {} </s> remove         expected = OrderedDict([(1, 'Red Color'), (2, 'Yellow Color'), (3, 'Green Color')])
 </s> add         expected = {1: 'Red Color', 2: 'Yellow Color', 3: 'Green Color'} </s> remove         expected = OrderedDict([(1, 'My Red Color'), (2, 'My Yellow Color'), (3, 'My Green Color')])
 </s> add         expected = {1: 'My Red Color', 2: 'My Yellow Color', 3: 'My Green Color'}
    ret = {}
      # Allow single, paired or grouped choices style:
      # choices = [1, 2, 3]
      # choices = [(1, 'First'), (2, 'Second'), (3, 'Third')]
      # choices = [('Category', ((1, 'First'), (2, 'Second'))), (3, 'Third')]
    ret = {}
      for choice in choices:
          if not isinstance(choice, (list, tuple)):
              # single choice
              ret[choice] = choice
          else:
keep keep keep keep replace keep keep keep keep keep
 Replaced `OrderedDict` with `dict` (#8964) 
rest_framework/fields.py