Cosine Similarity Python Code For Snake Game