<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def qstring(option):
 """Custom quoting method for jinja."""

    if (re.match(NODE_ATTR_RE, option) is None and
            re.match(CHEF_CONST_RE, option) is None):
        return "'%s'" % option
    else:
        return option