{
    "content": [
        {
            "type": "text",
            "text": "# _functools (pydoc)\n\n**Summary:** functools - Tools that operate on functions.\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **FUNCTIONS** (1 lines) — 2 subsections\n  - cmp_to_key (2 lines)\n  - reduce (9 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\nfunctools - Tools that operate on functions.\n\n### FUNCTIONS\n\n#### cmp_to_key\n\nConvert a cmp= function into a key= function.\n\n#### reduce\n\nreduce(function, iterable[, initial]) -> value\n\nApply a function of two arguments cumulatively to the items of a sequence\nor iterable, from left to right, so as to reduce the iterable to a single\nvalue.  For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates\n((((1+2)+3)+4)+5).  If initial is present, it is placed before the items\nof the iterable in the calculation, and serves as a default when the\niterable is empty.\n\n### FILE\n\n(built-in)\n\n"
        }
    ],
    "structuredContent": {
        "command": "_functools",
        "section": "",
        "mode": "pydoc",
        "summary": "functools - Tools that operate on functions.",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "FUNCTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "cmp_to_key",
                        "lines": 2
                    },
                    {
                        "name": "reduce",
                        "lines": 9
                    }
                ]
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}