code: def get_option_choices(opt_name, opt_value, default_value, all_choices):
      
  
      choices = []
      if isinstance(opt_value, six.string_types):
          choices = [opt_value]
      elif isinstance(opt_value, (list, tuple)):
          choices = list(opt_value)
      elif opt_value is None:
          choices = default_value
      else:
          raise InvalidOption('Option %s has invalid'
                              ' value: %s' % (opt_name, opt_value))
      if 'all' in choices:
          choices = all_choices
      for item in choices:
          if item not in all_choices:
              raise InvalidOption('Choices of option %s contains invalid'
                                  ' item: %s' % (opt_name, item))
      return choices
docs: Generate possible choices for the option `opt_name`
      limited to `opt_value` value with default value
      as `default_value`