def METHOD_NAME(r):
    if not isinstance(r, rrule):
        r = parse_rrule(r)
    info = vars(r)
    j = {}
    for field, value in info.items():
        if isinstance(value, tuple) and len(value) == 1:
            value = value[0]
        if field[0] == "_":
            fieldname = field[1:]
        else:
            continue
        if fieldname.startswith("by") and value is not None:
            if fieldname == "byweekday":
                value = str(weekday_map[value])
            j[fieldname] = value
        elif fieldname == "freq":
            j[fieldname] = freq_map[value]
        elif fieldname in ["dtstart", "interval", "wkst", "count", "until"]:  # tzinfo?
            j[fieldname] = value
    return j