def METHOD_NAME(val):
    """
    Single-quote values that contain special characters, specifically to be used in YAML context (.yeb files)
    Single quotes inside the string are escaped by doubling them.
    (see: http://symfony.com/doc/current/components/yaml/yaml_format.html#strings)
    """
    if isinstance(val, string_type):
        if "'" in val or YAML_SPECIAL_CHARS.intersection(val):
            val = "'%s'" % val.replace("'", "''")
    return val