parameters: (bot_id, current_frame, planets, move)
return_statement: return optimal_planet
docstring: Find a planet which the ship tried to go to. We try to find it by looking at the angle that the ship moved
      with and the angle between the ship and the planet.
      :param bot_id: id of bot to imitate
      :param current_frame: current frame
      :param planets: planets data
      :param move: current move to analyze
      :return: id of the planet that ship was moving towards
docstring_summary: Find a planet which the ship tried to go to. We try to find it by looking at the angle that the ship moved
      with and the angle between the ship and the planet.
      :param bot_id: id of bot to imitate
      :param current_frame: current frame
      :param planets: planets data
      :param move: current move to analyze
      :return: id of the planet that ship was moving towards
docstring_tokens: Find a planet which the ship tried to go to . We try to find it by looking at the angle that the ship moved with and the angle between the ship and the planet . : param bot_id : id of bot to imitate : param current_frame : current frame : param planets : planets data : param move : current move to analyze : return : id of the planet that ship was moving towards
function: def find_target_planet(bot_id, current_frame, planets, move):
      """
      Find a planet which the ship tried to go to. We try to find it by looking at the angle that the ship moved
      with and the angle between the ship and the planet.
      :param bot_id: id of bot to imitate
      :param current_frame: current frame
      :param planets: planets data
      :param move: current move to analyze
      :return: id of the planet that ship was moving towards
      """
  
      if move['type'] == 'dock':
          # If the move was to dock, we know the planet we wanted to move towards
          return move['planet_id']
      if move['type'] != 'thrust':
          # If the move was not "thrust" (i.e. it was "undock"), there is no angle to analyze
          return -1
  
      ship_angle = move['angle']
      ship_data = current_frame['ships'][bot_id][str(move['shipId'])]
      ship_x = ship_data['x']
      ship_y = ship_data['y']
  
      optimal_planet = -1
      optimal_angle = -1
      for planet_data in planets:
          planet_id = str(planet_data['id'])
          if planet_id not in current_frame['planets'] or current_frame['planets'][planet_id]['health'] <= 0:
              continue
  
          planet_x = planet_data['x']
          planet_y = planet_data['y']
          a = angle(planet_x - ship_x, planet_y - ship_y)
          # We try to find the planet with minimal angle distance
          if optimal_planet == -1 or angle_dist(ship_angle, a) < angle_dist(ship_angle, optimal_angle):
              optimal_planet = planet_id
              optimal_angle = a
  
      return optimal_planet
function_tokens: def find_target_planet ( bot_id , current_frame , planets , move ) : if move [ 'type' ] == 'dock' : # If the move was to dock, we know the planet we wanted to move towards return move [ 'planet_id' ] if move [ 'type' ] != 'thrust' : # If the move was not "thrust" (i.e. it was "undock"), there is no angle to analyze return - 1 ship_angle = move [ 'angle' ] ship_data = current_frame [ 'ships' ] [ bot_id ] [ str ( move [ 'shipId' ] ) ] ship_x = ship_data [ 'x' ] ship_y = ship_data [ 'y' ] optimal_planet = - 1 optimal_angle = - 1 for planet_data in planets : planet_id = str ( planet_data [ 'id' ] ) if planet_id not in current_frame [ 'planets' ] or current_frame [ 'planets' ] [ planet_id ] [ 'health' ] <= 0 : continue planet_x = planet_data [ 'x' ] planet_y = planet_data [ 'y' ] a = angle ( planet_x - ship_x , planet_y - ship_y ) # We try to find the planet with minimal angle distance if optimal_planet == - 1 or angle_dist ( ship_angle , a ) < angle_dist ( ship_angle , optimal_angle ) : optimal_planet = planet_id optimal_angle = a return optimal_planet