code: async def get_next_expansion(self) -> Optional[Point2]:
          
  
          closest = None
          distance = math.inf
          for el in self.expansion_locations:
              def is_near_to_expansion(t):
                  return t.position.distance_to(el) < self.EXPANSION_GAP_THRESHOLD
  
              if any(map(is_near_to_expansion, self.townhalls)):
                  # already taken
                  continue
  
              startp = self._game_info.player_start_location
              d = await self._client.query_pathing(startp, el)
              if d is None:
                  continue
  
              if d < distance:
                  distance = d
                  closest = el
  
          return closest
docs: Find next expansion location.