code: def _string_check(self, value, allow_list=False):
          '''
          Based on the string-checking code from the SafeConfigParser's set()
          function, this enforces string values for config options.
          '''
          if self._optcre is self.OPTCRE or value:
              is_list = isinstance(value, list)
              if is_list and not allow_list:
                  raise TypeError('option value cannot be a list unless allow_list is True')
              elif not is_list:
                  value = [value]
              if not all(isinstance(x, six.string_types) for x in value):
                  raise TypeError('option values must be strings'f _string_check(self, value, allow_list=False):
          '''
          Based on the string-checking code from the SafeConfigParser's set()
          function, this enforces string values for config options.
          '''
          if self._optcre is self.OPTCRE or value:
              is_list = isinstance(value, list)
              if is_list and not allow_list:
                  raise TypeError('option value cannot be a list unless allow_list is True')
              elif not is_list:
                  value = [value]
              if not all(isinstance(x, six.string_types) for x in value):
                  raise TypeError('option values must be strings')
docs: Based on the string-checking code from the SafeConfigParser's set()
          function, this enforces string values for config options.