code: def coerce(self, value):
          
          if not isinstance(value, compat.basestring):
  
              value = str(value)
  
          if not self._re.match(value):
  
              raise ValueError(
                  "The value {0} does not match the pattern {1}".format(
                      value,
                      self.pattern,
                  )
              )
  
          return value
docs: Convert a value into a pattern matched string value.
  
          All string values are matched against a regex before they are
          considered acceptable values.
  
          Args:
              value (any): The value to coerce.
  
          Raises:
              ValueError: If the value is not an acceptable value.
  
          Returns:
              str: The pattern matched value represented.