def encode_mv(vals):
    """For multivalues, values are wrapped in '$' and separated using ';'
    Literal '$' values are represented with '$$'"""
    s = ""
    for val in vals:
        val = val.replace('$', '$$')
        if len(s) > 0:
            s += ';'
        s += '$' + val + '$'

    return s
dataset/ETHPy150Open splunk/splunk-sdk-python/examples/custom_search/bin/usercount.py/encode_mv/original