def find_compatible_door_in_regions(world, door, regions, player):
    if (door.type in [DoorType.Hole, DoorType.Warp, DoorType.Logical]):
        return (door.dest, door)
    for region in regions:
        for proposed_door in get_doors(world, region, player):
            if doors_compatible(door, proposed_door):
                return (region, proposed_door)
    return (None, None)
def find_compatible_door_in_regions(world, door, regions, player):
    if (door.type in [DoorType.Hole, DoorType.Warp, DoorType.Logical]):
        return (door.dest, door)
    for region in regions:
        for proposed_door in get_doors(world, region, player):
            if doors_compatible(door, proposed_door):
                return (region, proposed_door)
    return (None, None)