{
    "content": [
        {
            "type": "text",
            "text": "# cProfile (pydoc)\n\n**Summary:** cProfile\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **MODULE REFERENCE** (8 lines)\n- **DESCRIPTION** (3 lines)\n- **CLASSES** (3 lines) — 1 subsections\n  - class Profile (93 lines)\n- **FUNCTIONS** (1 lines) — 2 subsections\n  - run (10 lines)\n  - runctx (5 lines)\n- **DATA** (2 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\ncProfile\n\n### MODULE REFERENCE\n\nhttps://docs.python.org/3.10/library/cprofile.html\n\nThe following documentation is automatically generated from the Python\nsource files.  It may be incomplete, incorrect or include features that\nare considered implementation detail and may vary between Python\nimplementations.  When in doubt, consult the module reference at the\nlocation listed above.\n\n### DESCRIPTION\n\nPython interface for the 'lsprof' profiler.\nCompatible with the 'profile' module.\n\n### CLASSES\n\nlsprof.Profiler(builtins.object)\nProfile\n\n#### class Profile\n\n|  Profile(timer=None, timeunit=None, subcalls=True, builtins=True)\n|\n|  Builds a profiler object using the specified timer function.\n|  The default timer is a fast built-in one based on real time.\n|  For custom timer functions returning integers, timeunit can\n|  be a float specifying a scale (i.e. how long each integer unit\n|  is, in seconds).\n|\n|  Method resolution order:\n|      Profile\n|      lsprof.Profiler\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  enter(self)\n|\n|  exit(self, *excinfo)\n|\n|  createstats(self)\n|\n|  dumpstats(self, file)\n|\n|  printstats(self, sort=-1)\n|\n|  run(self, cmd)\n|\n|  runcall(self, func, /, *args, kw)\n|      # This method is more useful to profile a single function call.\n|\n|  runctx(self, cmd, globals, locals)\n|\n|  snapshotstats(self)\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from lsprof.Profiler:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  clear(...)\n|      clear()\n|\n|      Clear all profiling information collected so far.\n|\n|  disable(...)\n|      disable()\n|\n|      Stop collecting profiling information.\n|\n|  enable(...)\n|      enable(subcalls=True, builtins=True)\n|\n|      Start collecting profiling information.\n|      If 'subcalls' is True, also records for each function\n|      statistics separated according to its current caller.\n|      If 'builtins' is True, records the time spent in\n|      built-in functions separately from their caller.\n|\n|  getstats(self, /)\n|      list of profilerentry objects.\n|\n|      getstats() -> list of profilerentry objects\n|\n|      Return all information collected by the profiler.\n|      Each profilerentry is a tuple-like object with the\n|      following attributes:\n|\n|          code          code object\n|          callcount     how many times this was called\n|          reccallcount  how many times called recursively\n|          totaltime     total time in this entry\n|          inlinetime    inline time in this entry (not in subcalls)\n|          calls         details of the calls\n|\n|      The calls attribute is either None or a list of\n|      profilersubentry objects:\n|\n|          code          called code object\n|          callcount     how many times this is called\n|          reccallcount  how many times this is called recursively\n|          totaltime     total time spent in this call\n|          inlinetime    inline time (not in further subcalls)\n\n### FUNCTIONS\n\n#### run\n\nRun statement under profiler optionally saving results in filename\n\nThis function takes a single argument that can be passed to the\n\"exec\" statement, and an optional file name.  In all cases this\nroutine attempts to \"exec\" its first argument and gather profiling\nstatistics from the execution. If no file name is present, then this\nfunction automatically prints a simple profiling report, sorted by the\nstandard name string (file/line/function-name) that is presented in\neach line.\n\n#### runctx\n\nRun statement under profiler, supplying your own globals and locals,\noptionally saving results in filename.\n\nstatement and filename have the same semantics as profile.run\n\n### DATA\n\nall = ['run', 'runctx', 'Profile']\n\n### FILE\n\n/usr/lib/python3.10/cProfile.py\n\n"
        }
    ],
    "structuredContent": {
        "command": "cProfile",
        "section": "",
        "mode": "pydoc",
        "summary": "cProfile",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "MODULE REFERENCE",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "CLASSES",
                "lines": 3,
                "subsections": [
                    {
                        "name": "class Profile",
                        "lines": 93
                    }
                ]
            },
            {
                "name": "FUNCTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "run",
                        "lines": 10
                    },
                    {
                        "name": "runctx",
                        "lines": 5
                    }
                ]
            },
            {
                "name": "DATA",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}