def METHOD_NAME(chars):
    """
    Convert a set of characters into an string to be used in a Python
    regular expression's bracket expression (e.g. \u0062\u0064-\u006f).
    """
    ranges = []
    for _, seq in groupby_sequences(chars, ord):
        seq = list(seq)
        beg = seq[0]
        end = seq[-1]
        ranges.append(py_unicode_range_literal(beg, end))
    return "r'" + "".join(ranges) + "'"