import random


def e2e_slot_to_hotel_slot(slot):
    """Map an E2E slot onto a slot in the Hotel domain. If there are multiple tokens in the corresponding category
    in the Hotel domain, randomly pick one from that category.
    """

    slot_map = {
        'food': ['address', 'phone', 'postcode'],
        'customerrating': ['address', 'phone', 'postcode'],
        'familyfriendly': ['acceptscreditcards', 'dogsallowed', 'hasinternet'],
        'eattype': ['type']
    }

    if slot in slot_map:
        if len(slot_map[slot]) == 1:
            return slot_map[slot][0]
        else:
            return random.choice(slot_map[slot])
    else:
        return slot