def has_connection(self, lane_index_1, lane_index_2):
        """
        Return True if lane 1 is the previous lane of lane 2
        """
        if lane_index_1[1] in self.graph:
            if lane_index_2[1] in self.graph[lane_index_1[1]]:
                return True
        return False

        Return True if lane 1 is the previous lane of lane 2
        
metadrive/component/road_network/base_road_network.py