def _closest_opponent_to_object(self, o):
    """For a given object returns the closest opponent.

    Args:
      o: Source object.

    Returns:
      Closest opponent."""
    min_d = None
    closest = None
    for p in self._observation['right_team']:
      d = self._object_distance(o, p)
      if min_d is None or d < min_d:
        min_d = d
        closest = p
    assert closest is not None
    return closest
For a given object returns the closest opponent.

    Args:
      o: Source object.

    Returns:
      Closest opponent.
gfootball/env/players/bot.py