chunk_id stringlengths 36 36 | source stringclasses 35
values | source_url stringlengths 0 290 | upstream_license stringclasses 1
value | document_id stringlengths 36 36 | chunk_index int64 0 324k | retrieved_at stringclasses 2
values | chunker_version stringclasses 4
values | content_hash stringlengths 15 64 | content stringlengths 50 44.7k | namespace stringclasses 9
values | source_name stringclasses 35
values | raw_text stringlengths 50 44.7k | cleaned_text stringlengths 50 44.7k | tags stringclasses 49
values | collection_name stringclasses 11
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d1a846d6-d290-4717-a190-4c7ad1784d2b | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 36,069 | supabase-export-v2 | e1e8f22cb51245ac | .. figure:: tachyon-flamegraph.png :alt: Tachyon interactive flame graph :align: center :width: 100%
The flame graph visualization shows call stacks as nested rectangles, with
width proportional to time spent. The sidebar displays runtime statistics,
GIL metrics, and hotspot functions. | trusted_official_docs | CPython Docs | .. figure:: tachyon-flamegraph.png :alt: Tachyon interactive flame graph :align: center :width: 100%
The flame graph visualization shows call stacks as nested rectangles, with
width proportional to time spent. The sidebar displays runtime statistics,
GIL metrics, and hotspot functions. | .. figure:: tachyon-flamegraph.png :alt: Tachyon interactive flame graph :align: center :width: 100%
The flame graph visualization shows call stacks as nested rectangles, with
width proportional to time spent. The sidebar displays runtime statistics,
GIL metrics, and hotspot functions. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d2624837-bef1-4fc6-b51b-fcd67b60e196 | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 35,818 | supabase-export-v2 | 3b2a36841ceb771d | counts**, not direct measurements. Tachyon counts how many times each function appears in the collected samples, then multiplies by the sampling interval to estimate time.
For example, with a 10 kHz sampling rate over a 10-second profile,
Tachyon collects approximately 100,000 samples. If a function appears in 5,000
sa... | trusted_official_docs | CPython Docs | counts**, not direct measurements. Tachyon counts how many times each function appears in the collected samples, then multiplies by the sampling interval to estimate time.
For example, with a 10 kHz sampling rate over a 10-second profile,
Tachyon collects approximately 100,000 samples. If a function appears in 5,000
sa... | counts**, not direct measurements. Tachyon counts how many times each function appears in the collected samples, then multiplies by the sampling interval to estimate time.
For example, with a 10 kHz sampling rate over a 10-second profile,
Tachyon collects approximately 100,000 samples. If a function appears in 5,000
sa... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d354115f-31f7-4cf3-adc8-5a81c6e620b7 | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 36,103 | supabase-export-v2 | ca67af9103a0696e | .. figure:: tachyon-gecko-flamegraph.png :alt: Firefox Profiler Flame Graph view :align: center :width: 100%
The Flame Graph visualization shows call stacks as nested rectangles. Functions names are visible in the call hierarchy. | trusted_official_docs | CPython Docs | .. figure:: tachyon-gecko-flamegraph.png :alt: Firefox Profiler Flame Graph view :align: center :width: 100%
The Flame Graph visualization shows call stacks as nested rectangles. Functions names are visible in the call hierarchy. | .. figure:: tachyon-gecko-flamegraph.png :alt: Firefox Profiler Flame Graph view :align: center :width: 100%
The Flame Graph visualization shows call stacks as nested rectangles. Functions names are visible in the call hierarchy. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d37a198e-4f3e-42f3-be14-6b9be1cc13b9 | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 36,102 | supabase-export-v2 | 37466921feaaac3e | shows the complete call hierarchy with sample counts and percentages. The sidebar displays detailed statistics for the selected function including running time and sample distribution.
.. figure:: tachyon-gecko-flamegraph.png
:alt: Firefox Profiler Flame Graph view
:align: center
:width: 100% | trusted_official_docs | CPython Docs | shows the complete call hierarchy with sample counts and percentages. The sidebar displays detailed statistics for the selected function including running time and sample distribution.
.. figure:: tachyon-gecko-flamegraph.png
:alt: Firefox Profiler Flame Graph view
:align: center
:width: 100% | shows the complete call hierarchy with sample counts and percentages. The sidebar displays detailed statistics for the selected function including running time and sample distribution.
.. figure:: tachyon-gecko-flamegraph.png
:alt: Firefox Profiler Flame Graph view
:align: center
:width: 100% | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d3b374ef-b7b2-4c7e-811d-331dce603a41 | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 35,997 | supabase-export-v2 | a7a53ca685c5d1dd | is sleeping, blocked on I/O, or waiting for a lock are discarded. The resulting profile shows where CPU cycles are consumed, filtering out idle time.
CPU mode is useful when you want to focus on computational hotspots without
being distracted by I/O waits. If your program alternates between computation
and network call... | trusted_official_docs | CPython Docs | is sleeping, blocked on I/O, or waiting for a lock are discarded. The resulting profile shows where CPU cycles are consumed, filtering out idle time.
CPU mode is useful when you want to focus on computational hotspots without
being distracted by I/O waits. If your program alternates between computation
and network call... | is sleeping, blocked on I/O, or waiting for a lock are discarded. The resulting profile shows where CPU cycles are consumed, filtering out idle time.
CPU mode is useful when you want to focus on computational hotspots without
being distracted by I/O waits. If your program alternates between computation
and network call... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d4e0c2ec-6433-4e4a-b198-a12cbb9fe8ee | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 35,954 | supabase-export-v2 | 6164eb1bde9fce9e | instruction like ``LOAD_ATTR`` is specialized at runtime into a more efficient variant like ``LOAD_ATTR_INSTANCE_VALUE``, the profiler shows both the specialized name and the base instruction.
Opcode information appears in several output formats: | trusted_official_docs | CPython Docs | instruction like ``LOAD_ATTR`` is specialized at runtime into a more efficient variant like ``LOAD_ATTR_INSTANCE_VALUE``, the profiler shows both the specialized name and the base instruction.
Opcode information appears in several output formats: | instruction like ``LOAD_ATTR`` is specialized at runtime into a more efficient variant like ``LOAD_ATTR_INSTANCE_VALUE``, the profiler shows both the specialized name and the base instruction.
Opcode information appears in several output formats: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d53077cc-4848-4e24-86de-edc0ac643e49 | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 36,233 | supabase-export-v2 | 275b1f2960a33b9d | .. option:: --blocking
Pause the target process during each sample. This ensures consistent
stack traces at the cost of slowing down the target. Use with longer
intervals (1000 µs or higher) to minimize impact. See :ref:`blocking-mode`
for details. | trusted_official_docs | CPython Docs | .. option:: --blocking
Pause the target process during each sample. This ensures consistent
stack traces at the cost of slowing down the target. Use with longer
intervals (1000 µs or higher) to minimize impact. See :ref:`blocking-mode`
for details. | .. option:: --blocking
Pause the target process during each sample. This ensures consistent
stack traces at the cost of slowing down the target. Use with longer
intervals (1000 µs or higher) to minimize impact. See :ref:`blocking-mode`
for details. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d53ced69-3f44-4c39-b679-bcdfc7ca62fd | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 35,807 | supabase-export-v2 | 06205c918190aa2e | .. image:: ../../Lib/profiling/sampling/_assets/tachyon-logo.png :alt: Tachyon logo :align: center :width: 300px
The :mod:`!profiling.sampling` module, named **Tachyon**, provides statistical
profiling of Python programs through periodic stack sampling. Tachyon can
run scripts directly or attach to any running Python p... | trusted_official_docs | CPython Docs | .. image:: ../../Lib/profiling/sampling/_assets/tachyon-logo.png :alt: Tachyon logo :align: center :width: 300px
The :mod:`!profiling.sampling` module, named **Tachyon**, provides statistical
profiling of Python programs through periodic stack sampling. Tachyon can
run scripts directly or attach to any running Python p... | .. image:: ../../Lib/profiling/sampling/_assets/tachyon-logo.png :alt: Tachyon logo :align: center :width: 300px
The :mod:`!profiling.sampling` module, named **Tachyon**, provides statistical
profiling of Python programs through periodic stack sampling. Tachyon can
run scripts directly or attach to any running Python p... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d58e75a6-3303-4c92-b22e-4e2bba09adf6 | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 35,962 | supabase-export-v2 | f39dbb6f588480fe | python -m profiling.sampling run --realtime-stats script.py
This shows the actual achieved sampling rate, which may be lower than requested
if the profiler cannot keep up. The statistics help verify that profiling is
working correctly and that sufficient samples are being collected. See
:ref:`sampling-efficiency` for d... | trusted_official_docs | CPython Docs | python -m profiling.sampling run --realtime-stats script.py
This shows the actual achieved sampling rate, which may be lower than requested
if the profiler cannot keep up. The statistics help verify that profiling is
working correctly and that sufficient samples are being collected. See
:ref:`sampling-efficiency` for d... | python -m profiling.sampling run --realtime-stats script.py
This shows the actual achieved sampling rate, which may be lower than requested
if the profiler cannot keep up. The statistics help verify that profiling is
working correctly and that sufficient samples are being collected. See
:ref:`sampling-efficiency` for d... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d63815e2-66f1-4179-812d-3a07582efb26 | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 36,160 | supabase-export-v2 | f853fbd51998465a | hotter or cooler over time. When enabled, increasing metrics appear in green and decreasing metrics appear in red, comparing each update to the previous one.
:kbd:`h` or :kbd:`?`
Show the help screen with all available commands. | trusted_official_docs | CPython Docs | hotter or cooler over time. When enabled, increasing metrics appear in green and decreasing metrics appear in red, comparing each update to the previous one.
:kbd:`h` or :kbd:`?`
Show the help screen with all available commands. | hotter or cooler over time. When enabled, increasing metrics appear in green and decreasing metrics appear in red, comparing each update to the previous one.
:kbd:`h` or :kbd:`?`
Show the help screen with all available commands. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d67f347a-3d2a-4099-ad6d-020e5c332302 | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 36,087 | supabase-export-v2 | b66f0dfa91edc6c6 | - **Red**: Functions consuming more time (regressions). Lighter shades indicate modest increases, while darker shades show severe regressions.
- **Blue**: Functions consuming less time (improvements). Lighter shades for
modest reductions, darker shades for significant speedups. | trusted_official_docs | CPython Docs | - **Red**: Functions consuming more time (regressions). Lighter shades indicate modest increases, while darker shades show severe regressions.
- **Blue**: Functions consuming less time (improvements). Lighter shades for
modest reductions, darker shades for significant speedups. | - **Red**: Functions consuming more time (regressions). Lighter shades indicate modest increases, while darker shades show severe regressions.
- **Blue**: Functions consuming less time (improvements). Lighter shades for
modest reductions, darker shades for significant speedups. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d8348d30-8418-4276-81f4-3fdcdc48a343 | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 36,074 | supabase-export-v2 | 5224bfe16e5bfb89 | time spent. Hovering over a rectangle shows details about that function including source code context, and clicking zooms into that portion of the call tree.
The flame graph interface includes: | trusted_official_docs | CPython Docs | time spent. Hovering over a rectangle shows details about that function including source code context, and clicking zooms into that portion of the call tree.
The flame graph interface includes: | time spent. Hovering over a rectangle shows details about that function including source code context, and clicking zooms into that portion of the call tree.
The flame graph interface includes: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d9366b6e-5144-4044-b79d-76ec6b2afdaa | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 35,925 | supabase-export-v2 | 6669c790bb151522 | usage. Lower rates reduce profiler overhead but may miss short-lived functions. For most applications, the default rate provides a good balance between accuracy and overhead.
The :option:`--duration` option (:option:`-d`) sets how long to profile in seconds. By
default, profiling continues until the target process exit... | trusted_official_docs | CPython Docs | usage. Lower rates reduce profiler overhead but may miss short-lived functions. For most applications, the default rate provides a good balance between accuracy and overhead.
The :option:`--duration` option (:option:`-d`) sets how long to profile in seconds. By
default, profiling continues until the target process exit... | usage. Lower rates reduce profiler overhead but may miss short-lived functions. For most applications, the default rate provides a good balance between accuracy and overhead.
The :option:`--duration` option (:option:`-d`) sets how long to profile in seconds. By
default, profiling continues until the target process exit... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
daadfb32-ec6a-4949-9bea-9d72cc982e68 | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 36,079 | supabase-export-v2 | ec1741e9e89ad865 | These statistics help identify GIL contention and understand how time is distributed between Python execution, native code, and waiting.
Flame graphs are particularly effective for identifying deep call stacks and
understanding the hierarchical structure of time consumption. Wide rectangles
at the top indicate function... | trusted_official_docs | CPython Docs | These statistics help identify GIL contention and understand how time is distributed between Python execution, native code, and waiting.
Flame graphs are particularly effective for identifying deep call stacks and
understanding the hierarchical structure of time consumption. Wide rectangles
at the top indicate function... | These statistics help identify GIL contention and understand how time is distributed between Python execution, native code, and waiting.
Flame graphs are particularly effective for identifying deep call stacks and
understanding the hierarchical structure of time consumption. Wide rectangles
at the top indicate function... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ddb2f7ab-9db7-4d15-8303-a49d788cc06f | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 35,924 | supabase-export-v2 | 5bf27c79fdfc963f | python -m profiling.sampling run -r 20khz script.py
Higher rates capture more samples and provide finer-grained data at the
cost of slightly higher profiler CPU usage. Lower rates reduce profiler
overhead but may miss short-lived functions. For most applications, the
default rate provides a good balance between accurac... | trusted_official_docs | CPython Docs | python -m profiling.sampling run -r 20khz script.py
Higher rates capture more samples and provide finer-grained data at the
cost of slightly higher profiler CPU usage. Lower rates reduce profiler
overhead but may miss short-lived functions. For most applications, the
default rate provides a good balance between accurac... | python -m profiling.sampling run -r 20khz script.py
Higher rates capture more samples and provide finer-grained data at the
cost of slightly higher profiler CPU usage. Lower rates reduce profiler
overhead but may miss short-lived functions. For most applications, the
default rate provides a good balance between accurac... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
de471bff-ee75-4f27-9bba-febb5fbcd59e | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 35,956 | supabase-export-v2 | fd75f89058e7d91d | instruction-level statistics for the selected function, accessible via keyboard navigation - **Gecko format**: Opcode transitions are emitted as interval markers in the Firefox Profiler timeline
This level of detail is particularly useful for: | trusted_official_docs | CPython Docs | instruction-level statistics for the selected function, accessible via keyboard navigation - **Gecko format**: Opcode transitions are emitted as interval markers in the Firefox Profiler timeline
This level of detail is particularly useful for: | instruction-level statistics for the selected function, accessible via keyboard navigation - **Gecko format**: Opcode transitions are emitted as interval markers in the Firefox Profiler timeline
This level of detail is particularly useful for: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dee8f0e1-ab1f-4c83-b60d-c5f3b2179f19 | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 36,082 | supabase-export-v2 | f23cdfead33d60b0 | compare two profiling runs to highlight where performance changed. This helps identify regressions introduced by code changes and validate that optimizations achieved their intended effect::
# Capture baseline profile
python -m profiling.sampling run --binary -o baseline.bin script.py | trusted_official_docs | CPython Docs | compare two profiling runs to highlight where performance changed. This helps identify regressions introduced by code changes and validate that optimizations achieved their intended effect::
# Capture baseline profile
python -m profiling.sampling run --binary -o baseline.bin script.py | compare two profiling runs to highlight where performance changed. This helps identify regressions introduced by code changes and validate that optimizations achieved their intended effect::
# Capture baseline profile
python -m profiling.sampling run --binary -o baseline.bin script.py | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dfb0dd7b-38da-4cc5-8763-6cbbb8e846be | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 35,935 | supabase-export-v2 | a32594c367767781 | scenarios because it imposes virtually zero overhead on the target application: the profiled program runs at full speed and is unaware it is being observed.
However, non-blocking sampling can occasionally produce incomplete or
inconsistent stack traces in applications with many generators or coroutines
that rapidly swi... | trusted_official_docs | CPython Docs | scenarios because it imposes virtually zero overhead on the target application: the profiled program runs at full speed and is unaware it is being observed.
However, non-blocking sampling can occasionally produce incomplete or
inconsistent stack traces in applications with many generators or coroutines
that rapidly swi... | scenarios because it imposes virtually zero overhead on the target application: the profiled program runs at full speed and is unaware it is being observed.
However, non-blocking sampling can occasionally produce incomplete or
inconsistent stack traces in applications with many generators or coroutines
that rapidly swi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e18ad46d-b08e-41d8-b638-55de75601aed | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 36,023 | supabase-export-v2 | f966bd65e56f168e | (after ``raise`` but before being caught), or when code is executing inside an ``except`` block where exception information is still present in the thread state.
The following example illustrates which code regions are captured: | trusted_official_docs | CPython Docs | (after ``raise`` but before being caught), or when code is executing inside an ``except`` block where exception information is still present in the thread state.
The following example illustrates which code regions are captured: | (after ``raise`` but before being caught), or when code is executing inside an ``except`` block where exception information is still present in the thread state.
The following example illustrates which code regions are captured: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e50565fc-a445-4e1b-88c6-ace24afd0972 | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 35,955 | supabase-export-v2 | 91582acb300dce60 | Opcode information appears in several output formats:
- **Flame graphs**: Hovering over a frame displays a tooltip with a bytecode
instruction breakdown, showing which opcodes consumed time in that function
- **Heatmap**: Expandable bytecode panels per source line show instruction
breakdown with specialization percen... | trusted_official_docs | CPython Docs | Opcode information appears in several output formats:
- **Flame graphs**: Hovering over a frame displays a tooltip with a bytecode
instruction breakdown, showing which opcodes consumed time in that function
- **Heatmap**: Expandable bytecode panels per source line show instruction
breakdown with specialization percen... | Opcode information appears in several output formats:
- **Flame graphs**: Hovering over a frame displays a tooltip with a bytecode
instruction breakdown, showing which opcodes consumed time in that function
- **Heatmap**: Expandable bytecode panels per source line show instruction
breakdown with specialization percen... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e6c1e7d2-874d-460e-9edf-089cbd9e67cc | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 36,181 | supabase-export-v2 | c5fb4f8dc76f8fe7 | Task markers and stack reconstruction -------------------------------------
In async-aware profiles, you will see ``<task>`` frames that mark boundaries
between asyncio tasks. These are synthetic frames inserted by the profiler to
show the task structure. The task name appears as the function name in these
frames. | trusted_official_docs | CPython Docs | Task markers and stack reconstruction -------------------------------------
In async-aware profiles, you will see ``<task>`` frames that mark boundaries
between asyncio tasks. These are synthetic frames inserted by the profiler to
show the task structure. The task name appears as the function name in these
frames. | Task markers and stack reconstruction -------------------------------------
In async-aware profiles, you will see ``<task>`` frames that mark boundaries
between asyncio tasks. These are synthetic frames inserted by the profiler to
show the task structure. The task name appears as the function name in these
frames. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e6d0a07b-2430-40c3-a573-dff61f3e9a99 | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 36,162 | supabase-export-v2 | 7b019d11089d63cb | :kbd:`Down`) Navigate through opcode entries in the opcode panel (when ``--opcodes`` is enabled). These keys scroll through the instruction-level statistics for the currently selected function.
When profiling finishes (duration expires or target process exits), the display
shows a "PROFILING COMPLETE" banner and freeze... | trusted_official_docs | CPython Docs | :kbd:`Down`) Navigate through opcode entries in the opcode panel (when ``--opcodes`` is enabled). These keys scroll through the instruction-level statistics for the currently selected function.
When profiling finishes (duration expires or target process exits), the display
shows a "PROFILING COMPLETE" banner and freeze... | :kbd:`Down`) Navigate through opcode entries in the opcode panel (when ``--opcodes`` is enabled). These keys scroll through the instruction-level statistics for the currently selected function.
When profiling finishes (duration expires or target process exits), the display
shows a "PROFILING COMPLETE" banner and freeze... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e795510c-ac6a-4f58-976b-1250494c40d2 | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 35,904 | supabase-export-v2 | 2896750b90b6556c | - Running as root - Having the ``CAP_SYS_PTRACE`` capability - Adjusting the Yama ptrace scope: ``/proc/sys/kernel/yama/ptrace_scope``
The default ptrace_scope of 1 restricts ptrace to parent processes only. To
allow attaching to any process owned by the same user, set it to 0:: | trusted_official_docs | CPython Docs | - Running as root - Having the ``CAP_SYS_PTRACE`` capability - Adjusting the Yama ptrace scope: ``/proc/sys/kernel/yama/ptrace_scope``
The default ptrace_scope of 1 restricts ptrace to parent processes only. To
allow attaching to any process owned by the same user, set it to 0:: | - Running as root - Having the ``CAP_SYS_PTRACE`` capability - Adjusting the Yama ptrace scope: ``/proc/sys/kernel/yama/ptrace_scope``
The default ptrace_scope of 1 restricts ptrace to parent processes only. To
allow attaching to any process owned by the same user, set it to 0:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e7dd13e9-8ca4-459d-9cc0-64f20bd1a588 | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 36,138 | supabase-export-v2 | f4f4facbe4d19833 | Live mode (:option:`--live`) provides a terminal-based real-time view of profiling data, similar to the ``top`` command for system processes::
python -m profiling.sampling run --live script.py
python -m profiling.sampling attach --live 12345 | trusted_official_docs | CPython Docs | Live mode (:option:`--live`) provides a terminal-based real-time view of profiling data, similar to the ``top`` command for system processes::
python -m profiling.sampling run --live script.py
python -m profiling.sampling attach --live 12345 | Live mode (:option:`--live`) provides a terminal-based real-time view of profiling data, similar to the ``top`` command for system processes::
python -m profiling.sampling run --live script.py
python -m profiling.sampling attach --live 12345 | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e9694ad9-94c9-45cd-9fa4-939e1ea57b7f | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 35,975 | supabase-export-v2 | 5e9e53bef1927090 | Each subprocess receives its own output file. The filename is derived from the specified output path (or the default) with the subprocess's process ID appended:
- If you specify ``-o profile.html``, subprocesses produce ``profile_12345.html``,
``profile_12346.html``, and so on
- With default output, subprocesses produ... | trusted_official_docs | CPython Docs | Each subprocess receives its own output file. The filename is derived from the specified output path (or the default) with the subprocess's process ID appended:
- If you specify ``-o profile.html``, subprocesses produce ``profile_12345.html``,
``profile_12346.html``, and so on
- With default output, subprocesses produ... | Each subprocess receives its own output file. The filename is derived from the specified output path (or the default) with the subprocess's process ID appended:
- If you specify ``-o profile.html``, subprocesses produce ``profile_12345.html``,
``profile_12346.html``, and so on
- With default output, subprocesses produ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
eb9f3d51-42e0-405b-9eb7-4ee4b63c5d97 | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 35,996 | supabase-export-v2 | c004fe8953a266f1 | python -m profiling.sampling run --mode=cpu script.py
Samples taken while the thread is sleeping, blocked on I/O, or waiting for
a lock are discarded. The resulting profile shows where CPU cycles are consumed,
filtering out idle time. | trusted_official_docs | CPython Docs | python -m profiling.sampling run --mode=cpu script.py
Samples taken while the thread is sleeping, blocked on I/O, or waiting for
a lock are discarded. The resulting profile shows where CPU cycles are consumed,
filtering out idle time. | python -m profiling.sampling run --mode=cpu script.py
Samples taken while the thread is sleeping, blocked on I/O, or waiting for
a lock are discarded. The resulting profile shows where CPU cycles are consumed,
filtering out idle time. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ebcf1d8d-dbdc-4d9a-996e-23e8a770c11a | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 36,039 | supabase-export-v2 | 9aef67f203cb3d3a | Output appears on stdout by default::
Profile Stats (Mode: wall):
nsamples sample% tottime (ms) cumul% cumtime (ms) filename:lineno(function)
234/892 11.7% 234.00 44.6% 892.00 server.py:145(handle_request)
156/156 7.8% 156.00 7.8% 156.00 <built-in>:0(socket.recv)
98/421 4.9% 98.00 21.1% 421.00 parser.py:67(parse_me... | trusted_official_docs | CPython Docs | Output appears on stdout by default::
Profile Stats (Mode: wall):
nsamples sample% tottime (ms) cumul% cumtime (ms) filename:lineno(function)
234/892 11.7% 234.00 44.6% 892.00 server.py:145(handle_request)
156/156 7.8% 156.00 7.8% 156.00 <built-in>:0(socket.recv)
98/421 4.9% 98.00 21.1% 421.00 parser.py:67(parse_me... | Output appears on stdout by default::
Profile Stats (Mode: wall):
nsamples sample% tottime (ms) cumul% cumtime (ms) filename:lineno(function)
234/892 11.7% 234.00 44.6% 892.00 server.py:145(handle_request)
156/156 7.8% 156.00 7.8% 156.00 <built-in>:0(socket.recv)
98/421 4.9% 98.00 21.1% 421.00 parser.py:67(parse_me... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ebe3f749-c234-4637-8774-37c6c8091cef | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 36,100 | supabase-export-v2 | caa4af089b3a1557 | For this reason, the :option:`--mode` option is not available with Gecko format; all relevant data is captured automatically.
.. figure:: tachyon-gecko-calltree.png
:alt: Firefox Profiler Call Tree view
:align: center
:width: 100% | trusted_official_docs | CPython Docs | For this reason, the :option:`--mode` option is not available with Gecko format; all relevant data is captured automatically.
.. figure:: tachyon-gecko-calltree.png
:alt: Firefox Profiler Call Tree view
:align: center
:width: 100% | For this reason, the :option:`--mode` option is not available with Gecko format; all relevant data is captured automatically.
.. figure:: tachyon-gecko-calltree.png
:alt: Firefox Profiler Call Tree view
:align: center
:width: 100% | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ee355251-48f0-4284-bdc7-8629213a8d3c | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 36,111 | supabase-export-v2 | cd997a18f8677c6a | on your source code. Lines are color-coded from cool (few samples) to hot (many samples). Navigation buttons (▲▼) let you jump between callers and callees.
Unlike other formats that produce a single file, heatmap output creates a
directory containing HTML files for each profiled source file. If no output
path is specif... | trusted_official_docs | CPython Docs | on your source code. Lines are color-coded from cool (few samples) to hot (many samples). Navigation buttons (▲▼) let you jump between callers and callees.
Unlike other formats that produce a single file, heatmap output creates a
directory containing HTML files for each profiled source file. If no output
path is specif... | on your source code. Lines are color-coded from cool (few samples) to hot (many samples). Navigation buttons (▲▼) let you jump between callers and callees.
Unlike other formats that produce a single file, heatmap output creates a
directory containing HTML files for each profiled source file. If no output
path is specif... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f18c928d-57b2-444e-8bdc-c91d6abbf3f6 | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 35,998 | supabase-export-v2 | a8fc88af197ddf62 | hotspots without being distracted by I/O waits. If your program alternates between computation and network calls, CPU mode reveals which computational sections are most expensive.
Comparing wall-clock and CPU profiles
------------------------------------- | trusted_official_docs | CPython Docs | hotspots without being distracted by I/O waits. If your program alternates between computation and network calls, CPU mode reveals which computational sections are most expensive.
Comparing wall-clock and CPU profiles
------------------------------------- | hotspots without being distracted by I/O waits. If your program alternates between computation and network calls, CPU mode reveals which computational sections are most expensive.
Comparing wall-clock and CPU profiles
------------------------------------- | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f3fd9514-efb2-4b56-bc0c-4fe6cff27eb1 | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 36,035 | supabase-export-v2 | ab704eac266d3e07 | The pstats format (:option:`--pstats`) produces a text table similar to what deterministic profilers generate. This is the default output format::
python -m profiling.sampling run script.py
python -m profiling.sampling run --pstats script.py | trusted_official_docs | CPython Docs | The pstats format (:option:`--pstats`) produces a text table similar to what deterministic profilers generate. This is the default output format::
python -m profiling.sampling run script.py
python -m profiling.sampling run --pstats script.py | The pstats format (:option:`--pstats`) produces a text table similar to what deterministic profilers generate. This is the default output format::
python -m profiling.sampling run script.py
python -m profiling.sampling run --pstats script.py | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f6847c10-604d-4e4c-b6e4-f4589c604a42 | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 36,143 | supabase-export-v2 | 050d0f6c84901fbe | on Unix-like systems but not on Windows. The terminal must be at least 60 columns wide and 12 lines tall; larger terminals display more columns.
The header displays the top 3 hottest functions, sampling efficiency metrics,
and thread status statistics (GIL held percentage, CPU usage, GC time). The
main table shows func... | trusted_official_docs | CPython Docs | on Unix-like systems but not on Windows. The terminal must be at least 60 columns wide and 12 lines tall; larger terminals display more columns.
The header displays the top 3 hottest functions, sampling efficiency metrics,
and thread status statistics (GIL held percentage, CPU usage, GC time). The
main table shows func... | on Unix-like systems but not on Windows. The terminal must be at least 60 columns wide and 12 lines tall; larger terminals display more columns.
The header displays the top 3 hottest functions, sampling efficiency metrics,
and thread status statistics (GIL held percentage, CPU usage, GC time). The
main table shows func... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f72b1893-bfc2-4894-8782-423ab89d8b5b | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 35,810 | supabase-export-v2 | 4b871339cb4e3e79 | instrumenting every function call and return as deterministic profilers do, Tachyon reads the call stack at regular intervals to record what code is currently running.
This approach rests on a simple principle: functions that consume significant
CPU time will appear frequently in the collected samples. By gathering tho... | trusted_official_docs | CPython Docs | instrumenting every function call and return as deterministic profilers do, Tachyon reads the call stack at regular intervals to record what code is currently running.
This approach rests on a simple principle: functions that consume significant
CPU time will appear frequently in the collected samples. By gathering tho... | instrumenting every function call and return as deterministic profilers do, Tachyon reads the call stack at regular intervals to record what code is currently running.
This approach rests on a simple principle: functions that consume significant
CPU time will appear frequently in the collected samples. By gathering tho... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f7926501-3480-4bb5-904e-4e04f6c6ed85 | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 35,812 | supabase-export-v2 | cae1695c7e65d64a | .. only:: html
The following interactive visualization demonstrates how sampling profiling
works. Press **Play** to watch a Python program execute, and observe how the
profiler periodically captures snapshots of the call stack. Adjust the
**sample interval** to see how sampling frequency affects the results. | trusted_official_docs | CPython Docs | .. only:: html
The following interactive visualization demonstrates how sampling profiling
works. Press **Play** to watch a Python program execute, and observe how the
profiler periodically captures snapshots of the call stack. Adjust the
**sample interval** to see how sampling frequency affects the results. | .. only:: html
The following interactive visualization demonstrates how sampling profiling
works. Press **Play** to watch a Python program execute, and observe how the
profiler periodically captures snapshots of the call stack. Adjust the
**sample interval** to see how sampling frequency affects the results. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f9eaba20-5ddb-41d7-b94f-6fc2852dc523 | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 35,829 | supabase-export-v2 | ef460f1c9f01c33e | without the application ever knowing it was observed. The trade-off is that very short-lived functions may be missed if they happen to complete between samples.
Statistical profiling excels at answering the question, "Where is my program
spending time?" It reveals hotspots and bottlenecks in production code where
deter... | trusted_official_docs | CPython Docs | without the application ever knowing it was observed. The trade-off is that very short-lived functions may be missed if they happen to complete between samples.
Statistical profiling excels at answering the question, "Where is my program
spending time?" It reveals hotspots and bottlenecks in production code where
deter... | without the application ever knowing it was observed. The trade-off is that very short-lived functions may be missed if they happen to complete between samples.
Statistical profiling excels at answering the question, "Where is my program
spending time?" It reveals hotspots and bottlenecks in production code where
deter... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fc6898d0-d6f5-40f8-ab6f-f1fd90d4a02e | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 36,110 | supabase-export-v2 | 4abc61b5c650df7c | .. figure:: tachyon-heatmap.png :alt: Tachyon heatmap visualization :align: center :width: 100%
The heatmap overlays sample counts directly on your source code. Lines are
color-coded from cool (few samples) to hot (many samples). Navigation
buttons (▲▼) let you jump between callers and callees. | trusted_official_docs | CPython Docs | .. figure:: tachyon-heatmap.png :alt: Tachyon heatmap visualization :align: center :width: 100%
The heatmap overlays sample counts directly on your source code. Lines are
color-coded from cool (few samples) to hot (many samples). Navigation
buttons (▲▼) let you jump between callers and callees. | .. figure:: tachyon-heatmap.png :alt: Tachyon heatmap visualization :align: center :width: 100%
The heatmap overlays sample counts directly on your source code. Lines are
color-coded from cool (few samples) to hot (many samples). Navigation
buttons (▲▼) let you jump between callers and callees. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fd5d8c6b-4000-460b-af4a-533935c10477 | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 35,989 | supabase-export-v2 | 95f13e2a836c1c17 | Wall-clock mode ---------------
Wall-clock mode (:option:`--mode`\ ``=wall``) captures all samples regardless of what the
thread is doing. This is the default mode and provides a complete picture of
where time passes during program execution:: | trusted_official_docs | CPython Docs | Wall-clock mode ---------------
Wall-clock mode (:option:`--mode`\ ``=wall``) captures all samples regardless of what the
thread is doing. This is the default mode and provides a complete picture of
where time passes during program execution:: | Wall-clock mode ---------------
Wall-clock mode (:option:`--mode`\ ``=wall``) captures all samples regardless of what the
thread is doing. This is the default mode and provides a complete picture of
where time passes during program execution:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fd7113c2-f33e-46a6-af0a-f757b6aea43b | CPython Docs | file://datasets/cpython/Doc/library/profiling.sampling.rst | unknown | 6cd88c34-20e3-456f-85bb-73037efbca1d | 36,130 | supabase-export-v2 | 6e0d5d1d9efb9eed | Record and replay workflow ==========================
The binary format combined with the replay command enables a record-and-replay
workflow that separates data capture from analysis. Rather than generating
visualizations during profiling, you capture raw data to a compact binary file
and convert it to different forma... | trusted_official_docs | CPython Docs | Record and replay workflow ==========================
The binary format combined with the replay command enables a record-and-replay
workflow that separates data capture from analysis. Rather than generating
visualizations during profiling, you capture raw data to a compact binary file
and convert it to different forma... | Record and replay workflow ==========================
The binary format combined with the replay command enables a record-and-replay
workflow that separates data capture from analysis. Rather than generating
visualizations during profiling, you capture raw data to a compact binary file
and convert it to different forma... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
049af631-36ac-4369-8252-186fff84c3b6 | CPython Docs | file://datasets/cpython/Doc/library/pty.rst | unknown | 63741e60-7739-4773-bd89-d42d812ee03d | 36,299 | supabase-export-v2 | 400d4c6b55c9cc69 | if possible, or emulation code for generic Unix systems. Return a pair of file descriptors ``(master, slave)``, for the master and the slave end, respectively.
.. function:: spawn(argv[, master_read[, stdin_read]]) | trusted_official_docs | CPython Docs | if possible, or emulation code for generic Unix systems. Return a pair of file descriptors ``(master, slave)``, for the master and the slave end, respectively.
.. function:: spawn(argv[, master_read[, stdin_read]]) | if possible, or emulation code for generic Unix systems. Return a pair of file descriptors ``(master, slave)``, for the master and the slave end, respectively.
.. function:: spawn(argv[, master_read[, stdin_read]]) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
11220ca0-23ab-46f2-b726-52d65f8f572a | CPython Docs | file://datasets/cpython/Doc/library/pty.rst | unknown | 63741e60-7739-4773-bd89-d42d812ee03d | 36,295 | supabase-export-v2 | eb06f83b15a4959c | The returned file descriptor *fd* is :ref:`non-inheritable <fd_inheritance>`.
.. warning:: On macOS the use of this function is unsafe when mixed with using
higher-level system APIs, and that includes using :mod:`urllib.request`. | trusted_official_docs | CPython Docs | The returned file descriptor *fd* is :ref:`non-inheritable <fd_inheritance>`.
.. warning:: On macOS the use of this function is unsafe when mixed with using
higher-level system APIs, and that includes using :mod:`urllib.request`. | The returned file descriptor *fd* is :ref:`non-inheritable <fd_inheritance>`.
.. warning:: On macOS the use of this function is unsafe when mixed with using
higher-level system APIs, and that includes using :mod:`urllib.request`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1144c298-37f5-428c-8424-85e876c2c290 | CPython Docs | file://datasets/cpython/Doc/library/pty.rst | unknown | 63741e60-7739-4773-bd89-d42d812ee03d | 36,298 | supabase-export-v2 | da5922a0a0649067 | .. function:: openpty()
Open a new pseudo-terminal pair, using :func:`os.openpty` if possible, or
emulation code for generic Unix systems. Return a pair of file descriptors
``(master, slave)``, for the master and the slave end, respectively. | trusted_official_docs | CPython Docs | .. function:: openpty()
Open a new pseudo-terminal pair, using :func:`os.openpty` if possible, or
emulation code for generic Unix systems. Return a pair of file descriptors
``(master, slave)``, for the master and the slave end, respectively. | .. function:: openpty()
Open a new pseudo-terminal pair, using :func:`os.openpty` if possible, or
emulation code for generic Unix systems. Return a pair of file descriptors
``(master, slave)``, for the master and the slave end, respectively. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
15ad9868-e528-4906-96b1-e9c6a0ad8267 | CPython Docs | file://datasets/cpython/Doc/library/pty.rst | unknown | 63741e60-7739-4773-bd89-d42d812ee03d | 36,291 | supabase-export-v2 | 74b07418f4f58426 | This code is mainly tested on Linux, FreeBSD, and macOS (it is supposed to work on other POSIX platforms but it's not been thoroughly tested).
The :mod:`!pty` module defines the following functions: | trusted_official_docs | CPython Docs | This code is mainly tested on Linux, FreeBSD, and macOS (it is supposed to work on other POSIX platforms but it's not been thoroughly tested).
The :mod:`!pty` module defines the following functions: | This code is mainly tested on Linux, FreeBSD, and macOS (it is supposed to work on other POSIX platforms but it's not been thoroughly tested).
The :mod:`!pty` module defines the following functions: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1ba7138c-4e23-4264-8bb6-b8ff312abbb3 | CPython Docs | file://datasets/cpython/Doc/library/pty.rst | unknown | 63741e60-7739-4773-bd89-d42d812ee03d | 36,294 | supabase-export-v2 | 1156e76fc4f639ac | *pid* of the child, and *fd* is a file descriptor connected to the child's controlling terminal (and also to the child's standard input and output).
The returned file descriptor *fd* is :ref:`non-inheritable <fd_inheritance>`. | trusted_official_docs | CPython Docs | *pid* of the child, and *fd* is a file descriptor connected to the child's controlling terminal (and also to the child's standard input and output).
The returned file descriptor *fd* is :ref:`non-inheritable <fd_inheritance>`. | *pid* of the child, and *fd* is a file descriptor connected to the child's controlling terminal (and also to the child's standard input and output).
The returned file descriptor *fd* is :ref:`non-inheritable <fd_inheritance>`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
27f99667-d6e1-4b35-b318-57919cab2182 | CPython Docs | file://datasets/cpython/Doc/library/pty.rst | unknown | 63741e60-7739-4773-bd89-d42d812ee03d | 36,305 | supabase-export-v2 | e0a7e238d3704dc6 | the child process will quit without any input, *spawn* will then loop forever. If *master_read* signals EOF the same behavior results (on linux at least).
Return the exit status value from :func:`os.waitpid` on the child process. | trusted_official_docs | CPython Docs | the child process will quit without any input, *spawn* will then loop forever. If *master_read* signals EOF the same behavior results (on linux at least).
Return the exit status value from :func:`os.waitpid` on the child process. | the child process will quit without any input, *spawn* will then loop forever. If *master_read* signals EOF the same behavior results (on linux at least).
Return the exit status value from :func:`os.waitpid` on the child process. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
39a215c6-f40e-4397-a6ea-4849c3de5822 | CPython Docs | file://datasets/cpython/Doc/library/pty.rst | unknown | 63741e60-7739-4773-bd89-d42d812ee03d | 36,311 | supabase-export-v2 | 0434f5ae021f5a7c | following program acts like the Unix command :manpage:`script(1)`, using a pseudo-terminal to record all input and output of a terminal session in a "typescript". ::
import argparse
import os
import pty
import sys
import time | trusted_official_docs | CPython Docs | following program acts like the Unix command :manpage:`script(1)`, using a pseudo-terminal to record all input and output of a terminal session in a "typescript". ::
import argparse
import os
import pty
import sys
import time | following program acts like the Unix command :manpage:`script(1)`, using a pseudo-terminal to record all input and output of a terminal session in a "typescript". ::
import argparse
import os
import pty
import sys
import time | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4078880a-021c-47fe-a3d6-2e6d72e6b783 | CPython Docs | file://datasets/cpython/Doc/library/pty.rst | unknown | 63741e60-7739-4773-bd89-d42d812ee03d | 36,313 | supabase-export-v2 | 51f0a1544cc1ccf5 | parser = argparse.ArgumentParser() parser.add_argument('-a', dest='append', action='store_true') parser.add_argument('-p', dest='use_python', action='store_true') parser.add_argument('filename', nargs='?', default='typescript') options = parser.parse_args()
shell = sys.executable if options.use_python else os.environ.g... | trusted_official_docs | CPython Docs | parser = argparse.ArgumentParser() parser.add_argument('-a', dest='append', action='store_true') parser.add_argument('-p', dest='use_python', action='store_true') parser.add_argument('filename', nargs='?', default='typescript') options = parser.parse_args()
shell = sys.executable if options.use_python else os.environ.g... | parser = argparse.ArgumentParser() parser.add_argument('-a', dest='append', action='store_true') parser.add_argument('-p', dest='use_python', action='store_true') parser.add_argument('filename', nargs='?', default='typescript') options = parser.parse_args()
shell = sys.executable if options.use_python else os.environ.g... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
489b570d-6f0f-496e-8420-de207cc77200 | CPython Docs | file://datasets/cpython/Doc/library/pty.rst | unknown | 63741e60-7739-4773-bd89-d42d812ee03d | 36,304 | supabase-export-v2 | 447b60b93881902b | master file descriptor to read output from the child process, and *stdin_read* is passed file descriptor 0, to read from the parent process's standard input.
Returning an empty byte string from either callback is interpreted as an
end-of-file (EOF) condition, and that callback will not be called after
that. If *stdin... | trusted_official_docs | CPython Docs | master file descriptor to read output from the child process, and *stdin_read* is passed file descriptor 0, to read from the parent process's standard input.
Returning an empty byte string from either callback is interpreted as an
end-of-file (EOF) condition, and that callback will not be called after
that. If *stdin... | master file descriptor to read output from the child process, and *stdin_read* is passed file descriptor 0, to read from the parent process's standard input.
Returning an empty byte string from either callback is interpreted as an
end-of-file (EOF) condition, and that callback will not be called after
that. If *stdin... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5b5563da-a4a6-4ff6-ba00-bfae20ed5cfa | CPython Docs | file://datasets/cpython/Doc/library/pty.rst | unknown | 63741e60-7739-4773-bd89-d42d812ee03d | 36,314 | supabase-export-v2 | d074903cc86d5be6 | shell = sys.executable if options.use_python else os.environ.get('SHELL', 'sh') filename = options.filename mode = 'ab' if options.append else 'wb'
with open(filename, mode) as script:
def read(fd):
data = os.read(fd, 1024)
script.write(data)
return data | trusted_official_docs | CPython Docs | shell = sys.executable if options.use_python else os.environ.get('SHELL', 'sh') filename = options.filename mode = 'ab' if options.append else 'wb'
with open(filename, mode) as script:
def read(fd):
data = os.read(fd, 1024)
script.write(data)
return data | shell = sys.executable if options.use_python else os.environ.get('SHELL', 'sh') filename = options.filename mode = 'ab' if options.append else 'wb'
with open(filename, mode) as script:
def read(fd):
data = os.read(fd, 1024)
script.write(data)
return data | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a711b99b-4df7-4e2b-a7e1-899b87fcfffd | CPython Docs | file://datasets/cpython/Doc/library/pty.rst | unknown | 63741e60-7739-4773-bd89-d42d812ee03d | 36,301 | supabase-export-v2 | e52f050a239c9ec9 | reading from the controlling terminal. It is expected that the process spawned behind the pty will eventually terminate, and when it does *spawn* will return.
A loop copies STDIN of the current process to the child and data received
from the child to STDOUT of the current process. It is not signaled to the
child if S... | trusted_official_docs | CPython Docs | reading from the controlling terminal. It is expected that the process spawned behind the pty will eventually terminate, and when it does *spawn* will return.
A loop copies STDIN of the current process to the child and data received
from the child to STDOUT of the current process. It is not signaled to the
child if S... | reading from the controlling terminal. It is expected that the process spawned behind the pty will eventually terminate, and when it does *spawn* will return.
A loop copies STDIN of the current process to the child and data received
from the child to STDOUT of the current process. It is not signaled to the
child if S... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b83de6a0-9d51-4747-8ffc-24f381c68a24 | CPython Docs | file://datasets/cpython/Doc/library/pty.rst | unknown | 63741e60-7739-4773-bd89-d42d812ee03d | 36,303 | supabase-export-v2 | c5abed5c476d367c | string. In order to force spawn to return before the child process exits an empty byte array should be returned to signal end of file.
The default implementation for both functions will read and return up to 1024
bytes each time the function is called. The *master_read* callback is passed
the pseudoterminal’s master ... | trusted_official_docs | CPython Docs | string. In order to force spawn to return before the child process exits an empty byte array should be returned to signal end of file.
The default implementation for both functions will read and return up to 1024
bytes each time the function is called. The *master_read* callback is passed
the pseudoterminal’s master ... | string. In order to force spawn to return before the child process exits an empty byte array should be returned to signal end of file.
The default implementation for both functions will read and return up to 1024
bytes each time the function is called. The *master_read* callback is passed
the pseudoterminal’s master ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dc8c345b-2fdf-41c3-89c5-6be62137d721 | CPython Docs | file://datasets/cpython/Doc/library/pty.rst | unknown | 63741e60-7739-4773-bd89-d42d812ee03d | 36,302 | supabase-export-v2 | 834e8188ebb1eedc | received from the child to STDOUT of the current process. It is not signaled to the child if STDIN of the current process closes down.
The functions *master_read* and *stdin_read* are passed a file descriptor
which they should read from, and they should always return a byte string. In
order to force spawn to return b... | trusted_official_docs | CPython Docs | received from the child to STDOUT of the current process. It is not signaled to the child if STDIN of the current process closes down.
The functions *master_read* and *stdin_read* are passed a file descriptor
which they should read from, and they should always return a byte string. In
order to force spawn to return b... | received from the child to STDOUT of the current process. It is not signaled to the child if STDIN of the current process closes down.
The functions *master_read* and *stdin_read* are passed a file descriptor
which they should read from, and they should always return a byte string. In
order to force spawn to return b... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e02fbe1d-d8bf-4d85-8361-9cc6524c38d8 | CPython Docs | file://datasets/cpython/Doc/library/pty.rst | unknown | 63741e60-7739-4773-bd89-d42d812ee03d | 36,300 | supabase-export-v2 | d782c25a91881ce9 | .. function:: spawn(argv[, master_read[, stdin_read]])
Spawn a process, and connect its controlling terminal with the current
process's standard io. This is often used to baffle programs which insist on
reading from the controlling terminal. It is expected that the process
spawned behind the pty will eventually term... | trusted_official_docs | CPython Docs | .. function:: spawn(argv[, master_read[, stdin_read]])
Spawn a process, and connect its controlling terminal with the current
process's standard io. This is often used to baffle programs which insist on
reading from the controlling terminal. It is expected that the process
spawned behind the pty will eventually term... | .. function:: spawn(argv[, master_read[, stdin_read]])
Spawn a process, and connect its controlling terminal with the current
process's standard io. This is often used to baffle programs which insist on
reading from the controlling terminal. It is expected that the process
spawned behind the pty will eventually term... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e3dfae11-af22-4094-bca6-9339686e52e2 | CPython Docs | file://datasets/cpython/Doc/library/pty.rst | unknown | 63741e60-7739-4773-bd89-d42d812ee03d | 36,296 | supabase-export-v2 | 7e9d25f3f04bd7d1 | .. warning:: On macOS the use of this function is unsafe when mixed with using higher-level system APIs, and that includes using :mod:`urllib.request`.
.. versionchanged:: 3.15
The returned file descriptor is now made non-inheritable. | trusted_official_docs | CPython Docs | .. warning:: On macOS the use of this function is unsafe when mixed with using higher-level system APIs, and that includes using :mod:`urllib.request`.
.. versionchanged:: 3.15
The returned file descriptor is now made non-inheritable. | .. warning:: On macOS the use of this function is unsafe when mixed with using higher-level system APIs, and that includes using :mod:`urllib.request`.
.. versionchanged:: 3.15
The returned file descriptor is now made non-inheritable. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
eafe5b4e-e80b-4d5c-ad11-edddc57bcfcc | CPython Docs | file://datasets/cpython/Doc/library/pty.rst | unknown | 63741e60-7739-4773-bd89-d42d812ee03d | 36,290 | supabase-export-v2 | ab567e4ed4e9d22b | .. availability:: Unix.
Pseudo-terminal handling is highly platform dependent. This code is mainly
tested on Linux, FreeBSD, and macOS (it is supposed to work on other POSIX
platforms but it's not been thoroughly tested). | trusted_official_docs | CPython Docs | .. availability:: Unix.
Pseudo-terminal handling is highly platform dependent. This code is mainly
tested on Linux, FreeBSD, and macOS (it is supposed to work on other POSIX
platforms but it's not been thoroughly tested). | .. availability:: Unix.
Pseudo-terminal handling is highly platform dependent. This code is mainly
tested on Linux, FreeBSD, and macOS (it is supposed to work on other POSIX
platforms but it's not been thoroughly tested). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f0a5da84-dcd7-4081-83a9-64182ea0c8c6 | CPython Docs | file://datasets/cpython/Doc/library/pty.rst | unknown | 63741e60-7739-4773-bd89-d42d812ee03d | 36,293 | supabase-export-v2 | f57c7348a7bd3fcd | .. function:: fork()
Fork. Connect the child's controlling terminal to a pseudo-terminal. Return
value is ``(pid, fd)``. Note that the child gets *pid* 0, and the *fd* is
*invalid*. The parent's return value is the *pid* of the child, and *fd* is a
file descriptor connected to the child's controlling terminal (and a... | trusted_official_docs | CPython Docs | .. function:: fork()
Fork. Connect the child's controlling terminal to a pseudo-terminal. Return
value is ``(pid, fd)``. Note that the child gets *pid* 0, and the *fd* is
*invalid*. The parent's return value is the *pid* of the child, and *fd* is a
file descriptor connected to the child's controlling terminal (and a... | .. function:: fork()
Fork. Connect the child's controlling terminal to a pseudo-terminal. Return
value is ``(pid, fd)``. Note that the child gets *pid* 0, and the *fd* is
*invalid*. The parent's return value is the *pid* of the child, and *fd* is a
file descriptor connected to the child's controlling terminal (and a... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
046bdddf-872b-4cd0-8a6b-8f76d3247faa | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,326 | supabase-export-v2 | de5ea0f6b7dfb498 | The functions fall into categories that perform object comparisons, logical operations, mathematical operations and sequence operations.
The object comparison functions are useful for all objects, and are named after
the rich comparison operators they support: | trusted_official_docs | CPython Docs | The functions fall into categories that perform object comparisons, logical operations, mathematical operations and sequence operations.
The object comparison functions are useful for all objects, and are named after
the rich comparison operators they support: | The functions fall into categories that perform object comparisons, logical operations, mathematical operations and sequence operations.
The object comparison functions are useful for all objects, and are named after
the rich comparison operators they support: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1212fc73-2192-492e-8cab-76b660024eb1 | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,423 | supabase-export-v2 | f03a2a3cc445f734 | 5), ('orange', 1)] >>> getcount = itemgetter(1) >>> list(map(getcount, inventory)) [3, 2, 5, 1] >>> sorted(inventory, key=getcount) [('orange', 1), ('banana', 2), ('apple', 3), ('pear', 5)]
.. function:: methodcaller(name, /, *args, **kwargs) | trusted_official_docs | CPython Docs | 5), ('orange', 1)] >>> getcount = itemgetter(1) >>> list(map(getcount, inventory)) [3, 2, 5, 1] >>> sorted(inventory, key=getcount) [('orange', 1), ('banana', 2), ('apple', 3), ('pear', 5)]
.. function:: methodcaller(name, /, *args, **kwargs) | 5), ('orange', 1)] >>> getcount = itemgetter(1) >>> list(map(getcount, inventory)) [3, 2, 5, 1] >>> sorted(inventory, key=getcount) [('orange', 1), ('banana', 2), ('apple', 3), ('pear', 5)]
.. function:: methodcaller(name, /, *args, **kwargs) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
13ef113a-97bf-4527-829c-d84c85dd3800 | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,419 | supabase-export-v2 | eb4d9a3a761d71b4 | def itemgetter(*items): if len(items) == 1: item = items[0] def g(obj): return obj[item] else: def g(obj): return tuple(obj[item] for item in items) return g
The items can be any type accepted by the operand's :meth:`~object.__getitem__`
method. Dictionaries accept any :term:`hashable` value. Lists, tuples, and
strin... | trusted_official_docs | CPython Docs | def itemgetter(*items): if len(items) == 1: item = items[0] def g(obj): return obj[item] else: def g(obj): return tuple(obj[item] for item in items) return g
The items can be any type accepted by the operand's :meth:`~object.__getitem__`
method. Dictionaries accept any :term:`hashable` value. Lists, tuples, and
strin... | def itemgetter(*items): if len(items) == 1: item = items[0] def g(obj): return obj[item] else: def g(obj): return tuple(obj[item] for item in items) return g
The items can be any type accepted by the operand's :meth:`~object.__getitem__`
method. Dictionaries accept any :term:`hashable` value. Lists, tuples, and
strin... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
15ba3d45-0350-4ee7-bf5f-bdbe047f5a8d | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,328 | supabase-export-v2 | 28c95ef6be817f25 | function:: lt(a, b) le(a, b) eq(a, b) ne(a, b) ge(a, b) gt(a, b) __lt__(a, b) __le__(a, b) __eq__(a, b) __ne__(a, b) __ge__(a, b) __gt__(a, b)
Perform "rich comparisons" between *a* and *b*. Specifically, ``lt(a, b)`` is
equivalent to ``a < b``, ``le(a, b)`` is equivalent to ``a <= b``, ``eq(a,
b)`` is equivalent to ... | trusted_official_docs | CPython Docs | function:: lt(a, b) le(a, b) eq(a, b) ne(a, b) ge(a, b) gt(a, b) __lt__(a, b) __le__(a, b) __eq__(a, b) __ne__(a, b) __ge__(a, b) __gt__(a, b)
Perform "rich comparisons" between *a* and *b*. Specifically, ``lt(a, b)`` is
equivalent to ``a < b``, ``le(a, b)`` is equivalent to ``a <= b``, ``eq(a,
b)`` is equivalent to ... | function:: lt(a, b) le(a, b) eq(a, b) ne(a, b) ge(a, b) gt(a, b) __lt__(a, b) __le__(a, b) __eq__(a, b) __ne__(a, b) __ge__(a, b) __gt__(a, b)
Perform "rich comparisons" between *a* and *b*. Specifically, ``lt(a, b)`` is
equivalent to ``a < b``, ``le(a, b)`` is equivalent to ``a <= b``, ``eq(a,
b)`` is equivalent to ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1ca23123-372b-4e5d-b6be-f104a5fdf7b6 | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,436 | supabase-export-v2 | 6f5b3c41c0a2f3ef | in two separate steps. The in-place functions listed below only do the first step, calling the in-place method. The second step, assignment, is not handled.
For immutable targets such as strings, numbers, and tuples, the updated
value is computed, but not assigned back to the input variable: | trusted_official_docs | CPython Docs | in two separate steps. The in-place functions listed below only do the first step, calling the in-place method. The second step, assignment, is not handled.
For immutable targets such as strings, numbers, and tuples, the updated
value is computed, but not assigned back to the input variable: | in two separate steps. The in-place functions listed below only do the first step, calling the in-place method. The second step, assignment, is not handled.
For immutable targets such as strings, numbers, and tuples, the updated
value is computed, but not assigned back to the input variable: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
273e737d-4f02-4dcf-81be-a42b4f3ae17a | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,414 | supabase-export-v2 | 932ac63707e50c45 | .. function:: itemgetter(item) itemgetter(*items)
Return a callable object that fetches *item* from its operand using the
operand's :meth:`~object.__getitem__` method. If multiple items are specified,
returns a tuple of lookup values. For example: | trusted_official_docs | CPython Docs | .. function:: itemgetter(item) itemgetter(*items)
Return a callable object that fetches *item* from its operand using the
operand's :meth:`~object.__getitem__` method. If multiple items are specified,
returns a tuple of lookup values. For example: | .. function:: itemgetter(item) itemgetter(*items)
Return a callable object that fetches *item* from its operand using the
operand's :meth:`~object.__getitem__` method. If multiple items are specified,
returns a tuple of lookup values. For example: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
28166d53-4445-4a96-b2e4-82b91f76a742 | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,420 | supabase-export-v2 | 20dff0ee4f0779a3 | can be any type accepted by the operand's :meth:`~object.__getitem__` method. Dictionaries accept any :term:`hashable` value. Lists, tuples, and strings accept an index or a slice:
>>> itemgetter(1)('ABCDEFG')
'B'
>>> itemgetter(1, 3, 5)('ABCDEFG')
('B', 'D', 'F')
>>> itemgetter(slice(2, None))('ABCDEFG')
'CDEFG'
... | trusted_official_docs | CPython Docs | can be any type accepted by the operand's :meth:`~object.__getitem__` method. Dictionaries accept any :term:`hashable` value. Lists, tuples, and strings accept an index or a slice:
>>> itemgetter(1)('ABCDEFG')
'B'
>>> itemgetter(1, 3, 5)('ABCDEFG')
('B', 'D', 'F')
>>> itemgetter(slice(2, None))('ABCDEFG')
'CDEFG'
... | can be any type accepted by the operand's :meth:`~object.__getitem__` method. Dictionaries accept any :term:`hashable` value. Lists, tuples, and strings accept an index or a slice:
>>> itemgetter(1)('ABCDEFG')
'B'
>>> itemgetter(1, 3, 5)('ABCDEFG')
('B', 'D', 'F')
>>> itemgetter(slice(2, None))('ABCDEFG')
'CDEFG'
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2c9c87b1-ca57-4ce2-97d6-765a7fd2684b | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,355 | supabase-export-v2 | 6aaad3a540da3479 | Return *a* converted to an integer. Equivalent to ``a.__index__()``.
.. versionchanged:: 3.10
The result always has exact type :class:`int`. Previously, the result
could have been an instance of a subclass of ``int``. | trusted_official_docs | CPython Docs | Return *a* converted to an integer. Equivalent to ``a.__index__()``.
.. versionchanged:: 3.10
The result always has exact type :class:`int`. Previously, the result
could have been an instance of a subclass of ``int``. | Return *a* converted to an integer. Equivalent to ``a.__index__()``.
.. versionchanged:: 3.10
The result always has exact type :class:`int`. Previously, the result
could have been an instance of a subclass of ``int``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
31fe6a05-3b4b-4f7e-a2a7-60306373bf36 | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,425 | supabase-export-v2 | 1a4259874c8f32e1 | the method *name* on its operand. If additional arguments and/or keyword arguments are given, they will be given to the method as well. For example:
* After ``f = methodcaller('name')``, the call ``f(b)`` returns ``b.name()``. | trusted_official_docs | CPython Docs | the method *name* on its operand. If additional arguments and/or keyword arguments are given, they will be given to the method as well. For example:
* After ``f = methodcaller('name')``, the call ``f(b)`` returns ``b.name()``. | the method *name* on its operand. If additional arguments and/or keyword arguments are given, they will be given to the method as well. For example:
* After ``f = methodcaller('name')``, the call ``f(b)`` returns ``b.name()``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
370bff94-1331-4118-a503-1d4b36135023 | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,406 | supabase-export-v2 | 2e7c947fd526ed4c | .. function:: attrgetter(attr) attrgetter(*attrs)
Return a callable object that fetches *attr* from its operand. If more than one attribute is requested, returns a tuple of attributes. The attribute names can also contain dots. For example: | trusted_official_docs | CPython Docs | .. function:: attrgetter(attr) attrgetter(*attrs)
Return a callable object that fetches *attr* from its operand. If more than one attribute is requested, returns a tuple of attributes. The attribute names can also contain dots. For example: | .. function:: attrgetter(attr) attrgetter(*attrs)
Return a callable object that fetches *attr* from its operand. If more than one attribute is requested, returns a tuple of attributes. The attribute names can also contain dots. For example: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
38b00ddf-a7ed-4465-a8b6-bca8e11ae05f | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,439 | supabase-export-v2 | 8e5036b1c1c69845 | For mutable targets such as lists and dictionaries, the in-place method will perform the update, so no subsequent assignment is necessary:
>>> s = ['h', 'e', 'l', 'l', 'o']
>>> iadd(s, [' ', 'w', 'o', 'r', 'l', 'd'])
['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd']
>>> s
['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', ... | trusted_official_docs | CPython Docs | For mutable targets such as lists and dictionaries, the in-place method will perform the update, so no subsequent assignment is necessary:
>>> s = ['h', 'e', 'l', 'l', 'o']
>>> iadd(s, [' ', 'w', 'o', 'r', 'l', 'd'])
['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd']
>>> s
['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', ... | For mutable targets such as lists and dictionaries, the in-place method will perform the update, so no subsequent assignment is necessary:
>>> s = ['h', 'e', 'l', 'l', 'o']
>>> iadd(s, [' ', 'w', 'o', 'r', 'l', 'd'])
['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd']
>>> s
['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3a3ef738-c2d2-4264-b6ce-d903680414af | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,432 | supabase-export-v2 | b757890506e0ce5f | This table shows how abstract operations correspond to operator symbols in the Python syntax and the functions in the :mod:`!operator` module.
+-----------------------+-------------------------+---------------------------------------+
| Operation | Syntax | Function |
+=======================+=========================+... | trusted_official_docs | CPython Docs | This table shows how abstract operations correspond to operator symbols in the Python syntax and the functions in the :mod:`!operator` module.
+-----------------------+-------------------------+---------------------------------------+
| Operation | Syntax | Function |
+=======================+=========================+... | This table shows how abstract operations correspond to operator symbols in the Python syntax and the functions in the :mod:`!operator` module.
+-----------------------+-------------------------+---------------------------------------+
| Operation | Syntax | Function |
+=======================+=========================+... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3f4e782c-b8e5-47b9-959f-8fadd37fb496 | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,329 | supabase-export-v2 | fff29f0643c321e6 | these functions can return any value, which may or may not be interpretable as a Boolean value. See :ref:`comparisons` for more information about rich comparisons.
The logical operations are also generally applicable to all objects, and support
truth tests, identity tests, and boolean operations: | trusted_official_docs | CPython Docs | these functions can return any value, which may or may not be interpretable as a Boolean value. See :ref:`comparisons` for more information about rich comparisons.
The logical operations are also generally applicable to all objects, and support
truth tests, identity tests, and boolean operations: | these functions can return any value, which may or may not be interpretable as a Boolean value. See :ref:`comparisons` for more information about rich comparisons.
The logical operations are also generally applicable to all objects, and support
truth tests, identity tests, and boolean operations: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4df4a638-d472-468b-94e5-fdb4a58fac71 | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,434 | supabase-export-v2 | befde762ee084801 | In-place Operators ------------------
Many operations have an "in-place" version. Listed below are functions
providing a more primitive access to in-place operators than the usual syntax
does; for example, the :term:`statement` ``x += y`` is equivalent to
``x = operator.iadd(x, y)``. Another way to put it is to say tha... | trusted_official_docs | CPython Docs | In-place Operators ------------------
Many operations have an "in-place" version. Listed below are functions
providing a more primitive access to in-place operators than the usual syntax
does; for example, the :term:`statement` ``x += y`` is equivalent to
``x = operator.iadd(x, y)``. Another way to put it is to say tha... | In-place Operators ------------------
Many operations have an "in-place" version. Listed below are functions
providing a more primitive access to in-place operators than the usual syntax
does; for example, the :term:`statement` ``x += y`` is equivalent to
``x = operator.iadd(x, y)``. Another way to put it is to say tha... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
52ac6a6e-fbde-4ed0-a330-3309633ef86b | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,422 | supabase-export-v2 | 22355380b7aacc42 | Example of using :func:`itemgetter` to retrieve specific fields from a tuple record:
>>> inventory = [('apple', 3), ('banana', 2), ('pear', 5), ('orange', 1)]
>>> getcount = itemgetter(1)
>>> list(map(getcount, inventory))
[3, 2, 5, 1]
>>> sorted(inventory, key=getcount)
[('orange', 1), ('banana', 2), ('apple', 3)... | trusted_official_docs | CPython Docs | Example of using :func:`itemgetter` to retrieve specific fields from a tuple record:
>>> inventory = [('apple', 3), ('banana', 2), ('pear', 5), ('orange', 1)]
>>> getcount = itemgetter(1)
>>> list(map(getcount, inventory))
[3, 2, 5, 1]
>>> sorted(inventory, key=getcount)
[('orange', 1), ('banana', 2), ('apple', 3)... | Example of using :func:`itemgetter` to retrieve specific fields from a tuple record:
>>> inventory = [('apple', 3), ('banana', 2), ('pear', 5), ('orange', 1)]
>>> getcount = itemgetter(1)
>>> list(map(getcount, inventory))
[3, 2, 5, 1]
>>> sorted(inventory, key=getcount)
[('orange', 1), ('banana', 2), ('apple', 3)... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
544d06b2-d109-4dc8-9837-c602d13ce1de | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,440 | supabase-export-v2 | e5b4f25f9b80d7d1 | 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'] >>> s ['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd']
.. function:: iadd(a, b)
__iadd__(a, b) | trusted_official_docs | CPython Docs | 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'] >>> s ['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd']
.. function:: iadd(a, b)
__iadd__(a, b) | 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'] >>> s ['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd']
.. function:: iadd(a, b)
__iadd__(a, b) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
54cfbf3c-9137-41f8-bd8d-afa0cdf8f5b0 | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,407 | supabase-export-v2 | 10b0c939104df405 | *attr* from its operand. If more than one attribute is requested, returns a tuple of attributes. The attribute names can also contain dots. For example:
* After ``f = attrgetter('name')``, the call ``f(b)`` returns ``b.name``. | trusted_official_docs | CPython Docs | *attr* from its operand. If more than one attribute is requested, returns a tuple of attributes. The attribute names can also contain dots. For example:
* After ``f = attrgetter('name')``, the call ``f(b)`` returns ``b.name``. | *attr* from its operand. If more than one attribute is requested, returns a tuple of attributes. The attribute names can also contain dots. For example:
* After ``f = attrgetter('name')``, the call ``f(b)`` returns ``b.name``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6c92d1a7-6156-4dc5-a522-af440307c383 | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,327 | supabase-export-v2 | db6e0b8d8bb8cbcb | The object comparison functions are useful for all objects, and are named after the rich comparison operators they support:
.. function:: lt(a, b)
le(a, b)
eq(a, b)
ne(a, b)
ge(a, b)
gt(a, b)
__lt__(a, b)
__le__(a, b)
__eq__(a, b)
__ne__(a, b)
__ge__(a, b)
__gt__(a, b) | trusted_official_docs | CPython Docs | The object comparison functions are useful for all objects, and are named after the rich comparison operators they support:
.. function:: lt(a, b)
le(a, b)
eq(a, b)
ne(a, b)
ge(a, b)
gt(a, b)
__lt__(a, b)
__le__(a, b)
__eq__(a, b)
__ne__(a, b)
__ge__(a, b)
__gt__(a, b) | The object comparison functions are useful for all objects, and are named after the rich comparison operators they support:
.. function:: lt(a, b)
le(a, b)
eq(a, b)
ne(a, b)
ge(a, b)
gt(a, b)
__lt__(a, b)
__le__(a, b)
__eq__(a, b)
__ne__(a, b)
__ge__(a, b)
__gt__(a, b) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
85458278-3eb9-4ec0-93ba-f1d2f6109de4 | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,421 | supabase-export-v2 | 8585fa3037888756 | >>> itemgetter(1)('ABCDEFG') 'B' >>> itemgetter(1, 3, 5)('ABCDEFG') ('B', 'D', 'F') >>> itemgetter(slice(2, None))('ABCDEFG') 'CDEFG' >>> soldier = dict(rank='captain', name='dotterbart') >>> itemgetter('rank')(soldier) 'captain'
Example of using :func:`itemgetter` to retrieve specific fields from a
tuple record: | trusted_official_docs | CPython Docs | >>> itemgetter(1)('ABCDEFG') 'B' >>> itemgetter(1, 3, 5)('ABCDEFG') ('B', 'D', 'F') >>> itemgetter(slice(2, None))('ABCDEFG') 'CDEFG' >>> soldier = dict(rank='captain', name='dotterbart') >>> itemgetter('rank')(soldier) 'captain'
Example of using :func:`itemgetter` to retrieve specific fields from a
tuple record: | >>> itemgetter(1)('ABCDEFG') 'B' >>> itemgetter(1, 3, 5)('ABCDEFG') ('B', 'D', 'F') >>> itemgetter(slice(2, None))('ABCDEFG') 'CDEFG' >>> soldier = dict(rank='captain', name='dotterbart') >>> itemgetter('rank')(soldier) 'captain'
Example of using :func:`itemgetter` to retrieve specific fields from a
tuple record: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
869323d1-6020-4635-a3fc-799fb643d699 | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,412 | supabase-export-v2 | 3207d990a73800d0 | string') if len(items) == 1: attr = items[0] def g(obj): return resolve_attr(obj, attr) else: def g(obj): return tuple(resolve_attr(obj, attr) for attr in items) return g
def resolve_attr(obj, attr):
for name in attr.split("."):
obj = getattr(obj, name)
return obj | trusted_official_docs | CPython Docs | string') if len(items) == 1: attr = items[0] def g(obj): return resolve_attr(obj, attr) else: def g(obj): return tuple(resolve_attr(obj, attr) for attr in items) return g
def resolve_attr(obj, attr):
for name in attr.split("."):
obj = getattr(obj, name)
return obj | string') if len(items) == 1: attr = items[0] def g(obj): return resolve_attr(obj, attr) else: def g(obj): return tuple(resolve_attr(obj, attr) for attr in items) return g
def resolve_attr(obj, attr):
for name in attr.split("."):
obj = getattr(obj, name)
return obj | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9101505c-a550-4bed-860d-2b17d6e2c444 | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,424 | supabase-export-v2 | 781369376199f8fb | .. function:: methodcaller(name, /, *args, **kwargs)
Return a callable object that calls the method *name* on its operand. If
additional arguments and/or keyword arguments are given, they will be given
to the method as well. For example: | trusted_official_docs | CPython Docs | .. function:: methodcaller(name, /, *args, **kwargs)
Return a callable object that calls the method *name* on its operand. If
additional arguments and/or keyword arguments are given, they will be given
to the method as well. For example: | .. function:: methodcaller(name, /, *args, **kwargs)
Return a callable object that calls the method *name* on its operand. If
additional arguments and/or keyword arguments are given, they will be given
to the method as well. For example: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9f0831f9-6b6a-471a-b04a-864687d378e7 | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,435 | supabase-export-v2 | b6c5a9ae76d3367a | Another way to put it is to say that ``z = operator.iadd(x, y)`` is equivalent to the compound statement ``z = x; z += y``.
In those examples, note that when an in-place method is called, the computation
and assignment are performed in two separate steps. The in-place functions
listed below only do the first step, call... | trusted_official_docs | CPython Docs | Another way to put it is to say that ``z = operator.iadd(x, y)`` is equivalent to the compound statement ``z = x; z += y``.
In those examples, note that when an in-place method is called, the computation
and assignment are performed in two separate steps. The in-place functions
listed below only do the first step, call... | Another way to put it is to say that ``z = operator.iadd(x, y)`` is equivalent to the compound statement ``z = x; z += y``.
In those examples, note that when an in-place method is called, the computation
and assignment are performed in two separate steps. The in-place functions
listed below only do the first step, call... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b196698c-d962-464f-b92e-1a6f9a7c381e | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,411 | supabase-export-v2 | 509268474a7f1735 | Equivalent to::
def attrgetter(*items):
if any(not isinstance(item, str) for item in items):
raise TypeError('attribute name must be a string')
if len(items) == 1:
attr = items[0]
def g(obj):
return resolve_attr(obj, attr)
else:
def g(obj):
return tuple(resolve_attr(obj, attr) for attr in items)
return g | trusted_official_docs | CPython Docs | Equivalent to::
def attrgetter(*items):
if any(not isinstance(item, str) for item in items):
raise TypeError('attribute name must be a string')
if len(items) == 1:
attr = items[0]
def g(obj):
return resolve_attr(obj, attr)
else:
def g(obj):
return tuple(resolve_attr(obj, attr) for attr in items)
return g | Equivalent to::
def attrgetter(*items):
if any(not isinstance(item, str) for item in items):
raise TypeError('attribute name must be a string')
if len(items) == 1:
attr = items[0]
def g(obj):
return resolve_attr(obj, attr)
else:
def g(obj):
return tuple(resolve_attr(obj, attr) for attr in items)
return g | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
badd3d12-d120-4790-bf5a-443089786455 | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,331 | supabase-export-v2 | 3afbcc748e9dc875 | .. function:: not_(obj) __not__(obj)
Return the outcome of :keyword:`not` *obj*. (Note that there is no
:meth:`!__not__` method for object instances; only the interpreter core defines
this operation. The result is affected by the :meth:`~object.__bool__` and
:meth:`~object.__len__` methods.) | trusted_official_docs | CPython Docs | .. function:: not_(obj) __not__(obj)
Return the outcome of :keyword:`not` *obj*. (Note that there is no
:meth:`!__not__` method for object instances; only the interpreter core defines
this operation. The result is affected by the :meth:`~object.__bool__` and
:meth:`~object.__len__` methods.) | .. function:: not_(obj) __not__(obj)
Return the outcome of :keyword:`not` *obj*. (Note that there is no
:meth:`!__not__` method for object instances; only the interpreter core defines
this operation. The result is affected by the :meth:`~object.__bool__` and
:meth:`~object.__len__` methods.) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c07348e4-3a64-4f4c-b4fa-1bb42eaee78f | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,398 | supabase-export-v2 | 5d2cd55e6b364f22 | .. function:: length_hint(obj, default=0)
Return an estimated length for the object *obj*. First try to return its
actual length, then an estimate using :meth:`object.__length_hint__`, and
finally return the default value. | trusted_official_docs | CPython Docs | .. function:: length_hint(obj, default=0)
Return an estimated length for the object *obj*. First try to return its
actual length, then an estimate using :meth:`object.__length_hint__`, and
finally return the default value. | .. function:: length_hint(obj, default=0)
Return an estimated length for the object *obj*. First try to return its
actual length, then an estimate using :meth:`object.__length_hint__`, and
finally return the default value. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d298dd3e-a594-4c00-8ab2-28a59a4ec8e7 | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,325 | supabase-export-v2 | 00f832b8e06fc1bd | underscores. For backward compatibility, many of these have a variant with the double underscores kept. The variants without the double underscores are preferred for clarity.
The functions fall into categories that perform object comparisons, logical
operations, mathematical operations and sequence operations. | trusted_official_docs | CPython Docs | underscores. For backward compatibility, many of these have a variant with the double underscores kept. The variants without the double underscores are preferred for clarity.
The functions fall into categories that perform object comparisons, logical
operations, mathematical operations and sequence operations. | underscores. For backward compatibility, many of these have a variant with the double underscores kept. The variants without the double underscores are preferred for clarity.
The functions fall into categories that perform object comparisons, logical
operations, mathematical operations and sequence operations. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e3eacb11-1ca8-4f26-9113-1844e2d86e35 | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,404 | supabase-export-v2 | d43adedbccc9757d | .. versionadded:: 3.11
The :mod:`!operator` module also defines tools for generalized attribute and item
lookups. These are useful for making fast field extractors as arguments for
:func:`map`, :func:`sorted`, :meth:`itertools.groupby`, or other functions that
expect a function argument. | trusted_official_docs | CPython Docs | .. versionadded:: 3.11
The :mod:`!operator` module also defines tools for generalized attribute and item
lookups. These are useful for making fast field extractors as arguments for
:func:`map`, :func:`sorted`, :meth:`itertools.groupby`, or other functions that
expect a function argument. | .. versionadded:: 3.11
The :mod:`!operator` module also defines tools for generalized attribute and item
lookups. These are useful for making fast field extractors as arguments for
:func:`map`, :func:`sorted`, :meth:`itertools.groupby`, or other functions that
expect a function argument. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e96b9b99-25e2-4621-985d-00a5acbd7931 | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,438 | supabase-export-v2 | 65586ab6c3deeb37 | >>> a = 'hello' >>> iadd(a, ' world') 'hello world' >>> a 'hello'
For mutable targets such as lists and dictionaries, the in-place method
will perform the update, so no subsequent assignment is necessary: | trusted_official_docs | CPython Docs | >>> a = 'hello' >>> iadd(a, ' world') 'hello world' >>> a 'hello'
For mutable targets such as lists and dictionaries, the in-place method
will perform the update, so no subsequent assignment is necessary: | >>> a = 'hello' >>> iadd(a, ' world') 'hello world' >>> a 'hello'
For mutable targets such as lists and dictionaries, the in-place method
will perform the update, so no subsequent assignment is necessary: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ee8f9504-d6fa-4349-8655-5e29f53f3c4f | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,415 | supabase-export-v2 | 51b401e3d744d37d | object that fetches *item* from its operand using the operand's :meth:`~object.__getitem__` method. If multiple items are specified, returns a tuple of lookup values. For example:
* After ``f = itemgetter(2)``, the call ``f(r)`` returns ``r[2]``. | trusted_official_docs | CPython Docs | object that fetches *item* from its operand using the operand's :meth:`~object.__getitem__` method. If multiple items are specified, returns a tuple of lookup values. For example:
* After ``f = itemgetter(2)``, the call ``f(r)`` returns ``r[2]``. | object that fetches *item* from its operand using the operand's :meth:`~object.__getitem__` method. If multiple items are specified, returns a tuple of lookup values. For example:
* After ``f = itemgetter(2)``, the call ``f(r)`` returns ``r[2]``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fd394bea-fad1-4011-8a3f-c2a1179d0944 | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,437 | supabase-export-v2 | 8072dccc83ecc781 | For immutable targets such as strings, numbers, and tuples, the updated value is computed, but not assigned back to the input variable:
>>> a = 'hello'
>>> iadd(a, ' world')
'hello world'
>>> a
'hello' | trusted_official_docs | CPython Docs | For immutable targets such as strings, numbers, and tuples, the updated value is computed, but not assigned back to the input variable:
>>> a = 'hello'
>>> iadd(a, ' world')
'hello world'
>>> a
'hello' | For immutable targets such as strings, numbers, and tuples, the updated value is computed, but not assigned back to the input variable:
>>> a = 'hello'
>>> iadd(a, ' world')
'hello world'
>>> a
'hello' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ff423ea2-44d2-455a-80fe-f9b755ff0846 | CPython Docs | file://datasets/cpython/Doc/library/operator.rst | unknown | 75ad6c61-0254-42cb-a6de-9b10b9187bd6 | 36,324 | supabase-export-v2 | f68ec2027c0cb0eb | --------------
The :mod:`!operator` module exports a set of efficient functions corresponding to
the intrinsic operators of Python. For example, ``operator.add(x, y)`` is
equivalent to the expression ``x+y``. Many function names are those used for
special methods, without the double underscores. For backward compatibil... | trusted_official_docs | CPython Docs | --------------
The :mod:`!operator` module exports a set of efficient functions corresponding to
the intrinsic operators of Python. For example, ``operator.add(x, y)`` is
equivalent to the expression ``x+y``. Many function names are those used for
special methods, without the double underscores. For backward compatibil... | --------------
The :mod:`!operator` module exports a set of efficient functions corresponding to
the intrinsic operators of Python. For example, ``operator.add(x, y)`` is
equivalent to the expression ``x+y``. Many function names are those used for
special methods, without the double underscores. For backward compatibil... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
01a508ca-b3d7-4a07-9fbf-960e619843e8 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-subprocess.rst | unknown | 1c0d9f28-7251-4097-b500-13210691b254 | 36,534 | supabase-export-v2 | 305a21ea52a9d217 | Interact with process:
1. send data to *stdin* (if *input* is not ``None``);
2. closes *stdin*;
3. read data from *stdout* and *stderr*, until EOF is reached;
4. wait for process to terminate. | trusted_official_docs | CPython Docs | Interact with process:
1. send data to *stdin* (if *input* is not ``None``);
2. closes *stdin*;
3. read data from *stdout* and *stderr*, until EOF is reached;
4. wait for process to terminate. | Interact with process:
1. send data to *stdin* (if *input* is not ``None``);
2. closes *stdin*;
3. read data from *stdout* and *stderr*, until EOF is reached;
4. wait for process to terminate. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
05372167-06c7-4ff0-9ed9-e00cecf5731c | CPython Docs | file://datasets/cpython/Doc/library/asyncio-subprocess.rst | unknown | 1c0d9f28-7251-4097-b500-13210691b254 | 36,539 | supabase-export-v2 | c2cbfc0cc7287c4d | created with ``stdin=PIPE``. Similarly, to get anything other than ``None`` in the result tuple, the process has to be created with ``stdout=PIPE`` and/or ``stderr=PIPE`` arguments.
Note, that the data read is buffered in memory, so do not use
this method if the data size is large or unlimited. | trusted_official_docs | CPython Docs | created with ``stdin=PIPE``. Similarly, to get anything other than ``None`` in the result tuple, the process has to be created with ``stdout=PIPE`` and/or ``stderr=PIPE`` arguments.
Note, that the data read is buffered in memory, so do not use
this method if the data size is large or unlimited. | created with ``stdin=PIPE``. Similarly, to get anything other than ``None`` in the result tuple, the process has to be created with ``stdout=PIPE`` and/or ``stderr=PIPE`` arguments.
Note, that the data read is buffered in memory, so do not use
this method if the data size is large or unlimited. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0b90f6bf-7b90-43c8-8c26-d5a8f9f8bd3b | CPython Docs | file://datasets/cpython/Doc/library/asyncio-subprocess.rst | unknown | 1c0d9f28-7251-4097-b500-13210691b254 | 36,502 | supabase-export-v2 | 39e37157a7ee21e1 | :func:`shlex.quote` function can be used to properly escape whitespace and special shell characters in strings that are going to be used to construct shell commands.
.. versionchanged:: 3.10
Removed the *loop* parameter. | trusted_official_docs | CPython Docs | :func:`shlex.quote` function can be used to properly escape whitespace and special shell characters in strings that are going to be used to construct shell commands.
.. versionchanged:: 3.10
Removed the *loop* parameter. | :func:`shlex.quote` function can be used to properly escape whitespace and special shell characters in strings that are going to be used to construct shell commands.
.. versionchanged:: 3.10
Removed the *loop* parameter. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
15435336-c3e8-4ae7-bd4f-2a049c48c2f3 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-subprocess.rst | unknown | 1c0d9f28-7251-4097-b500-13210691b254 | 36,521 | supabase-export-v2 | 1f94eb4e1e81cea2 | This class is designed to have a similar API to the :class:`subprocess.Popen` class, but there are some notable differences:
* unlike Popen, Process instances do not have an equivalent to
the :meth:`~subprocess.Popen.poll` method; | trusted_official_docs | CPython Docs | This class is designed to have a similar API to the :class:`subprocess.Popen` class, but there are some notable differences:
* unlike Popen, Process instances do not have an equivalent to
the :meth:`~subprocess.Popen.poll` method; | This class is designed to have a similar API to the :class:`subprocess.Popen` class, but there are some notable differences:
* unlike Popen, Process instances do not have an equivalent to
the :meth:`~subprocess.Popen.poll` method; | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1f3121b7-2cf6-45af-a391-cd3a5a738c82 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-subprocess.rst | unknown | 1c0d9f28-7251-4097-b500-13210691b254 | 36,517 | supabase-export-v2 | e40d1a3bec2a36dc | Interacting with Subprocesses =============================
Both :func:`create_subprocess_exec` and :func:`create_subprocess_shell`
functions return instances of the *Process* class. *Process* is a high-level
wrapper that allows communicating with subprocesses and watching for
their completion. | trusted_official_docs | CPython Docs | Interacting with Subprocesses =============================
Both :func:`create_subprocess_exec` and :func:`create_subprocess_shell`
functions return instances of the *Process* class. *Process* is a high-level
wrapper that allows communicating with subprocesses and watching for
their completion. | Interacting with Subprocesses =============================
Both :func:`create_subprocess_exec` and :func:`create_subprocess_shell`
functions return instances of the *Process* class. *Process* is a high-level
wrapper that allows communicating with subprocesses and watching for
their completion. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2eac6a42-3c51-4ebb-92d0-958274f4e2f3 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-subprocess.rst | unknown | 1c0d9f28-7251-4097-b500-13210691b254 | 36,483 | supabase-export-v2 | 983fc1363b148dba | it is easy to execute and monitor multiple subprocesses in parallel. It is indeed trivial to modify the above example to run several commands simultaneously::
async def main():
await asyncio.gather(
run('ls /zzz'),
run('sleep 1; echo "hello"')) | trusted_official_docs | CPython Docs | it is easy to execute and monitor multiple subprocesses in parallel. It is indeed trivial to modify the above example to run several commands simultaneously::
async def main():
await asyncio.gather(
run('ls /zzz'),
run('sleep 1; echo "hello"')) | it is easy to execute and monitor multiple subprocesses in parallel. It is indeed trivial to modify the above example to run several commands simultaneously::
async def main():
await asyncio.gather(
run('ls /zzz'),
run('sleep 1; echo "hello"')) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
34c459b7-cd61-417e-a260-a79bb8c157a5 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-subprocess.rst | unknown | 1c0d9f28-7251-4097-b500-13210691b254 | 36,515 | supabase-export-v2 | 789ee61bb0d78e57 | .. data:: asyncio.subprocess.DEVNULL :module:
Special value that can be used as the *stdin*, *stdout* or *stderr* argument
to process creation functions. It indicates that the special file
:data:`os.devnull` will be used for the corresponding subprocess stream. | trusted_official_docs | CPython Docs | .. data:: asyncio.subprocess.DEVNULL :module:
Special value that can be used as the *stdin*, *stdout* or *stderr* argument
to process creation functions. It indicates that the special file
:data:`os.devnull` will be used for the corresponding subprocess stream. | .. data:: asyncio.subprocess.DEVNULL :module:
Special value that can be used as the *stdin*, *stdout* or *stderr* argument
to process creation functions. It indicates that the special file
:data:`os.devnull` will be used for the corresponding subprocess stream. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3d053d93-81f8-447f-ae9d-48e769cf3bd1 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-subprocess.rst | unknown | 1c0d9f28-7251-4097-b500-13210691b254 | 36,520 | supabase-export-v2 | 530e38d9b25e1c0f | An object that wraps OS processes created by the :func:`~asyncio.create_subprocess_exec` and :func:`~asyncio.create_subprocess_shell` functions.
This class is designed to have a similar API to the
:class:`subprocess.Popen` class, but there are some
notable differences: | trusted_official_docs | CPython Docs | An object that wraps OS processes created by the :func:`~asyncio.create_subprocess_exec` and :func:`~asyncio.create_subprocess_shell` functions.
This class is designed to have a similar API to the
:class:`subprocess.Popen` class, but there are some
notable differences: | An object that wraps OS processes created by the :func:`~asyncio.create_subprocess_exec` and :func:`~asyncio.create_subprocess_shell` functions.
This class is designed to have a similar API to the
:class:`subprocess.Popen` class, but there are some
notable differences: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4d157f39-11a2-49bc-8387-2d8714025c9f | CPython Docs | file://datasets/cpython/Doc/library/asyncio-subprocess.rst | unknown | 1c0d9f28-7251-4097-b500-13210691b254 | 36,482 | supabase-export-v2 | 945a2017a7bf8465 | ['ls /zzz' exited with 1] [stderr] ls: /zzz: No such file or directory
Because all asyncio subprocess functions are asynchronous and asyncio
provides many tools to work with such functions, it is easy to execute
and monitor multiple subprocesses in parallel. It is indeed trivial
to modify the above example to run sever... | trusted_official_docs | CPython Docs | ['ls /zzz' exited with 1] [stderr] ls: /zzz: No such file or directory
Because all asyncio subprocess functions are asynchronous and asyncio
provides many tools to work with such functions, it is easy to execute
and monitor multiple subprocesses in parallel. It is indeed trivial
to modify the above example to run sever... | ['ls /zzz' exited with 1] [stderr] ls: /zzz: No such file or directory
Because all asyncio subprocess functions are asynchronous and asyncio
provides many tools to work with such functions, it is easy to execute
and monitor multiple subprocesses in parallel. It is indeed trivial
to modify the above example to run sever... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
59471c49-84d7-4a00-acaf-940cf606781b | CPython Docs | file://datasets/cpython/Doc/library/asyncio-subprocess.rst | unknown | 1c0d9f28-7251-4097-b500-13210691b254 | 36,582 | supabase-export-v2 | f683ffbcc1752194 | # Create the subprocess; redirect the standard output # into a pipe. proc = await asyncio.create_subprocess_exec( sys.executable, '-c', code, stdout=asyncio.subprocess.PIPE)
# Read one line of output. data = await proc.stdout.readline()
line = data.decode('ascii').rstrip() | trusted_official_docs | CPython Docs | # Create the subprocess; redirect the standard output # into a pipe. proc = await asyncio.create_subprocess_exec( sys.executable, '-c', code, stdout=asyncio.subprocess.PIPE)
# Read one line of output. data = await proc.stdout.readline()
line = data.decode('ascii').rstrip() | # Create the subprocess; redirect the standard output # into a pipe. proc = await asyncio.create_subprocess_exec( sys.executable, '-c', code, stdout=asyncio.subprocess.PIPE)
# Read one line of output. data = await proc.stdout.readline()
line = data.decode('ascii').rstrip() | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6ff80ff1-68ea-44cb-a825-373769af16b4 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-subprocess.rst | unknown | 1c0d9f28-7251-4097-b500-13210691b254 | 36,523 | supabase-export-v2 | 35c9c6c999ae8788 | * the :meth:`~asyncio.subprocess.Process.communicate` and :meth:`~asyncio.subprocess.Process.wait` methods don't have a *timeout* parameter: use the :func:`~asyncio.wait_for` function;
* the :meth:`Process.wait() <asyncio.subprocess.Process.wait>` method
is asynchronous, whereas :meth:`subprocess.Popen.wait` method
i... | trusted_official_docs | CPython Docs | * the :meth:`~asyncio.subprocess.Process.communicate` and :meth:`~asyncio.subprocess.Process.wait` methods don't have a *timeout* parameter: use the :func:`~asyncio.wait_for` function;
* the :meth:`Process.wait() <asyncio.subprocess.Process.wait>` method
is asynchronous, whereas :meth:`subprocess.Popen.wait` method
i... | * the :meth:`~asyncio.subprocess.Process.communicate` and :meth:`~asyncio.subprocess.Process.wait` methods don't have a *timeout* parameter: use the :func:`~asyncio.wait_for` function;
* the :meth:`Process.wait() <asyncio.subprocess.Process.wait>` method
is asynchronous, whereas :meth:`subprocess.Popen.wait` method
i... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
794150a9-b5b3-4764-9974-e276f772aefd | CPython Docs | file://datasets/cpython/Doc/library/asyncio-subprocess.rst | unknown | 1c0d9f28-7251-4097-b500-13210691b254 | 36,559 | supabase-export-v2 | d55803ef7740a4dd | .. warning::
Use the :meth:`communicate` method rather than
:attr:`process.stdin.write() <stdin>`,
:attr:`await process.stdout.read() <stdout>` or
:attr:`await process.stderr.read() <stderr>`. This avoids deadlocks due to streams pausing reading or writing
and blocking the child process. | trusted_official_docs | CPython Docs | .. warning::
Use the :meth:`communicate` method rather than
:attr:`process.stdin.write() <stdin>`,
:attr:`await process.stdout.read() <stdout>` or
:attr:`await process.stderr.read() <stderr>`. This avoids deadlocks due to streams pausing reading or writing
and blocking the child process. | .. warning::
Use the :meth:`communicate` method rather than
:attr:`process.stdin.write() <stdin>`,
:attr:`await process.stdout.read() <stdout>` or
:attr:`await process.stderr.read() <stderr>`. This avoids deadlocks due to streams pausing reading or writing
and blocking the child process. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7ef066e5-0945-4e22-8bd7-0051913bd090 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-subprocess.rst | unknown | 1c0d9f28-7251-4097-b500-13210691b254 | 36,531 | supabase-export-v2 | 85f993153800f2cb | .. note::
This method can deadlock when using ``stdout=PIPE`` or
``stderr=PIPE`` and the child process generates so much output
that it blocks waiting for the OS pipe buffer to accept
more data. Use the :meth:`communicate` method when using pipes
to avoid this condition. | trusted_official_docs | CPython Docs | .. note::
This method can deadlock when using ``stdout=PIPE`` or
``stderr=PIPE`` and the child process generates so much output
that it blocks waiting for the OS pipe buffer to accept
more data. Use the :meth:`communicate` method when using pipes
to avoid this condition. | .. note::
This method can deadlock when using ``stdout=PIPE`` or
``stderr=PIPE`` and the child process generates so much output
that it blocks waiting for the OS pipe buffer to accept
more data. Use the :meth:`communicate` method when using pipes
to avoid this condition. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
839aa60a-cd46-4af8-b98b-df8459d60ab0 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-subprocess.rst | unknown | 1c0d9f28-7251-4097-b500-13210691b254 | 36,537 | supabase-export-v2 | b25aa0a5f63b0e06 | Return a tuple ``(stdout_data, stderr_data)``.
If either :exc:`BrokenPipeError` or :exc:`ConnectionResetError`
exception is raised when writing *input* into *stdin*, the
exception is ignored. This condition occurs when the process
exits before all data are written into *stdin*. | trusted_official_docs | CPython Docs | Return a tuple ``(stdout_data, stderr_data)``.
If either :exc:`BrokenPipeError` or :exc:`ConnectionResetError`
exception is raised when writing *input* into *stdin*, the
exception is ignored. This condition occurs when the process
exits before all data are written into *stdin*. | Return a tuple ``(stdout_data, stderr_data)``.
If either :exc:`BrokenPipeError` or :exc:`ConnectionResetError`
exception is raised when writing *input* into *stdin*, the
exception is ignored. This condition occurs when the process
exits before all data are written into *stdin*. | python, official-docs, cpython, P0 | Local_Trusted_Corpus |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.