def door_from_loc(env, loc):
    """
    Get the door index for a given location
    The door indices correspond to: right, down, left, up
    """

    if loc == 'east' or loc == 'front':
        return (2, 1), 2
    if loc == 'south' or loc == 'right':
        return (1, 2), 3
    if loc == 'west' or loc == 'behind':
        return (0, 1), 0
    if loc == 'north' or loc == 'left':
        return (1, 0), 1

    assert False, 'door without location'