def _direction_action(self, delta):
    """For required movement direction vector returns appropriate action."""
    all_directions = [
        football_action_set.action_top,
        football_action_set.action_top_left,
        football_action_set.action_left,
        football_action_set.action_bottom_left,
        football_action_set.action_bottom,
        football_action_set.action_bottom_right,
        football_action_set.action_right,
        football_action_set.action_top_right
    ]
    all_directions_vec = [(0, -1), (-1, -1), (-1, 0), (-1, 1), (0, 1), (1, 1),
                          (1, 0), (1, -1)]
    all_directions_vec = [
        np.array(v) / np.linalg.norm(np.array(v)) for v in all_directions_vec
    ]
    best_direction = np.argmax([np.dot(delta, v) for v in all_directions_vec])
    return all_directions[best_direction]
For required movement direction vector returns appropriate action.
gfootball/env/players/bot.py