human
Complete the below
def makeTextNotes(replaceTxtNotes):

    ''''Create a function useful to handle text[::optional_note] values.
    replaceTxtNotes is a format string, which can include the following
    values: %(text)s and %(notes)s.
    Portions of the text can be conditionally excluded, if one of the
    values is absent. E.g.: <if notes>[%(notes)s]</if notes> will be replaced
    with \'[notes]\' if notes exists, or by an empty string otherwise.
    The returned function is suitable be passed as applyToValues argument
    of the makeObject2Txt function.'
    '''
assistant
#Here is the Python program you requested.
    def _replacer(s):
        outS = replaceTxtNotes
        if (not isinstance(s, (unicode, str))):
            return s
        ssplit = s.split('::', 1)
        text = ssplit[0]
        keysDict = {}
        if text:
            keysDict['text'] = True
        outS = outS.replace('%(text)s', text)
        if (len(ssplit) == 2):
            keysDict['notes'] = True
            outS = outS.replace('%(notes)s', ssplit[1])
        else:
            outS = outS.replace('%(notes)s', u'')
        def _excludeFalseConditionals(matchobj):
            if (matchobj.group(1) in keysDict):
                return matchobj.group(2)
            return u''
        while re_conditional.search(outS):
            outS = re_conditional.sub(_excludeFalseConditionals, outS)
        return outS
    return _replacer