original_docstring: 
      Gets the neighbours of the current asteroid in a spherical radius
  
      :param df: Dataframe view. Has to contain [i, orbital.T, pos]
      :param current_asteroid: asteroid to select neighbours from
      :param radius: in which radius (euclidian) to consider the rocks as neighbours
      :return: list of dicts of neighbouring asteroids
      
docstring: Gets the neighbours of the current asteroid in a spherical radius
docstring_tokens: Gets the neighbours of the current asteroid in a spherical radius
code: def sphere_neighbours(df: pd.DataFrame, current_asteroid: dict, radius: int = 100):
      """
      Gets the neighbours of the current asteroid in a spherical radius
  
      :param df: Dataframe view. Has to contain [i, orbital.T, pos]
      :param current_asteroid: asteroid to select neighbours from
      :param radius: in which radius (euclidian) to consider the rocks as neighbours
      :return: list of dicts of neighbouring asteroids
      """
      # Init
      index_exclusion = df.index.isin([current_asteroid['i']])
      df = df[~index_exclusion]
  
      # Filters out asteroids that are already way out of range
      current_orbital_period = current_asteroid['orbital.T']
      orbital_range = 1000
      filtered_df = df.loc[df['orbital.T'].between(current_orbital_period - orbital_range,
                                                   current_orbital_period + orbital_range)]
  
      # Get xyz coords for filtered asteroids
      cur_pos = current_asteroid['pos']
      pos_list = filtered_df['pos'].to_list()
  
      # Calculate rocks within spherical range
      dist = cdist(pos_list, [cur_pos], metric='euclidean')
      mask = dist <= radius
      neighbours_df = filtered_df.loc[mask]
      return neighbours_df.to_dict('records')
code_tokens: def sphere_neighbours ( df : pd . DataFrame , current_asteroid : dict , radius : int = 100 ) : index_exclusion = df . index . isin ( [ current_asteroid [ 'i' ] ] ) df = df [ ~ index_exclusion ] current_orbital_period = current_asteroid [ 'orbital.T' ] orbital_range = 1000 filtered_df = df . loc [ df [ 'orbital.T' ] . between ( current_orbital_period - orbital_range , current_orbital_period + orbital_range ) ] cur_pos = current_asteroid [ 'pos' ] pos_list = filtered_df [ 'pos' ] . to_list ( ) dist = cdist ( pos_list , [ cur_pos ] , metric = 'euclidean' ) mask = dist <= radius neighbours_df = filtered_df . loc [ mask ] return neighbours_df . to_dict ( 'records' )
short_docstring: Gets the neighbours of the current asteroid in a spherical radius
short_docstring_tokens: Gets the neighbours of the current asteroid in a spherical radius
comment: """
      Gets the neighbours of the current asteroid in a spherical radius
  
      :param df: Dataframe view. Has to contain [i, orbital.T, pos]
      :param current_asteroid: asteroid to select neighbours from
      :param radius: in which radius (euclidian) to consider the rocks as neighbours
      :return: list of dicts of neighbouring asteroids
      """$SEP$# Init$SEP$# Filters out asteroids that are already way out of range$SEP$# Get xyz coords for filtered asteroids$SEP$# Calculate rocks within spherical range