def test_postprocess_nodes_large_batch(monkeypatch):
    """
    Test processing nodes with a large batch size (greater than 10,000 words).
    """
    original_max = base_module.MAX_WORDS_PER_BATCH
    monkeypatch.setattr(
        base_module, "MAX_WORDS_PER_BATCH", 20000
    )  # Increase batch size for testing

    try:
        nodes = [
            NodeWithScore(node=TextNode(text="word " * 5000), score=0),  # 5000 words
            NodeWithScore(node=TextNode(text="word " * 6000), score=0),  # 6000 words
            NodeWithScore(node=TextNode(text="word " * 7000), score=0),  # 7000 words
        ]
        qb = QueryBundle(query_str="test query")
        obj = AIMonRerank(api_key="testkey", top_n=3)
        result = obj._postprocess_nodes(nodes, qb)

        scores = [node.score for node in result]
        assert scores == sorted(scores, reverse=True)

    finally:
        # Restore original value after test
        monkeypatch.setattr(base_module, "MAX_WORDS_PER_BATCH", original_max)

    Test processing nodes with a large batch size (greater than 10,000 words).
    
llama-index-integrations/postprocessor/llama-index-postprocessor-aimon-rerank/tests/test_postprocessor_aimon_rerank.py