from typing import OrderedDict


def name_val_transform(obj: dict):
    """Transform a dictionary in the form {"name": name, "value": value} into {name: value}"""

    if not isinstance(obj, (dict, OrderedDict)):
        return obj

    namekey = None
    valuekey = None

    keys = list(obj.keys())

    for key in keys:
        if 'name' in key.lower():
            namekey = key
            break

    if not namekey:
        return obj

    for key in keys:
        if key != namekey:
            valuekey = key
            break

    return OrderedDict({obj[namekey]: obj[valuekey]})