docs: def validate_string(option, value):
      """Validates that 'value' is an instance of `basestring` for Python 2
      or `str` for Python 3.
      """
      if isinstance(value, string_type):
          return value
      raise TypeError("Wrong type for %s, value must be "
                      "an instance of %s" % (option, string_type.__name__))