Created distance function since calculating this occurs in multiple places in the code.
Created a match_speed function to reduce the comlexity of update_boids again. Also, I slightly changed the indention inside update_boids
Created class_boid.py where I will create a boid class and then move the various relevant functions from the main body there as methods.
Removed the various neighbouring loops and replaced them with a single loop.
Shortened the variables names and changed the spacing between some lines to try and make the code a little more readable.
Created method fly_towards_middle in the boid class which will replace the one in boids.py
Created a distance method for the class boid. While it's debatable if this should be an "internal" property of the boid I think it will make the code more readable this way.
Created fly_away_from_nearby method in the boid class to replace the function in boids.py.