def parse_templates(template_lines):
    o = {}
    for line in template_lines:
        if line not in ' = ':
            continue

        k, v = line.strip().split(' = ')
        if not k.startswith('catalog.'):
            continue

        parts = k.split('.')

        region, service, key = parts[1:4]

        region_ref = o.get(region, {})
        service_ref = region_ref.get(service, {})
        service_ref[key] = v

        region_ref[service] = service_ref
        o[region] = region_ref

    return o
dataset/ETHPy150Open softlayer/jumpgate/jumpgate/identity/drivers/sl/auth_tokens_v3.py/parse_templates/swapped operands of `not in`