Return a Universally Unique Identifier (UUID) object represented by
    the specified string.

    @param value: a string representation of a UUID.
    @param strict: indicate whether the specified string MUST be of a
        valid UUID representation.

    @return: a UUID object.

def string_to_uuid(value, strict=True):
    """
    Return a Universally Unique Identifier (UUID) object represented by
    the specified string.

    @param value: a string representation of a UUID.
    @param strict: indicate whether the specified string MUST be of a
        valid UUID representation.

    @return: a UUID object.
    """
    try:
        return None if is_undefined(value) else uuid.UUID(value)
    except ValueError, error:
        if strict:
            raise error