def direction(self, other):
        """Find the direction (North, South, East or West) of the other
        location from this one."""
        if other == None:
            return None
        loc = [0, 0, 0]
        loc[0] = other.x_coord - self.x_coord
        loc[1] = other.y_coord - self.y_coord
        loc[2] = other.z_coord - self.z_coord
        max_value = max(list(map(abs, loc)))
        max_direction = 0
        if max_value in loc:
            max_direction = loc.index(max_value)
        else:
            max_direction = loc.index(-1 * max_value)
        # check up/down first
        if max_direction == 1:
            if loc[1] > 0:
                return Dir.UP
            return Dir.DOWN
        if max_direction == 0:
            if loc[0] > 0:
                return Dir.EAST
            return Dir.WEST
        if loc[2] > 0:
            return Dir.SOUTH
        return Dir.NORTH
dataset/ETHPy150Open katharosada/botchallenge/client/botchallenge/robot.py/Location.direction/original