def METHOD_NAME(op, msg, rules, parent_id):
    nonlocal rule_id
    my_id = rule_id
    rule_id = rule_id + 1
    rule = {
        "id": my_id,
        "requirement_id": parent_id,
        "path": ["outside"],
        "operator": op,
        "msg": msg,
    }
    if isinstance(rules, list):
        rule["operands"] = [METHOD_NAME(*ruleset, my_id) for ruleset in rules]
    else:
        rule["operands"] = [1, "x"]
    return rule