AI Slop Code RIsk Monitor

python-trio/trio

Trio – a friendly Python library for async concurrency and I/O

31.1 High pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for python-trio/trio, a Python project with 7,346 GitHub stars. SynthScan examined 52,273 lines of code across 185 source files, recording 1749 pattern matches distributed across 18 syntactic categories. The legacy adjusted pattern signal is 31.1 (High pattern signal); it is not an authorship estimate.

Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.

31.1
Adjusted Signal
31.1
Raw Pattern Score
100%
Time Factor
2026-10-06
Last Push
7.3K
Stars
Python
Language
52.3K
Lines of Code
185
Files
1.7K
Pattern Hits
2026-10-12
Scan Date
0.34
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 48.7/100 · MEDIUM

Can maintainers explain intent, assumptions, and trade-offs? 679 finding(s).

Hallucinated Dependency & Supply Chain Risk 45.5/100 · MEDIUM

Are imports declared and package/API names verified? 987 finding(s).

Agent Over-Engineering Ratio 50.0/100 · HIGH

Are wrappers, guards, and repeated structures necessary? 542 finding(s).

PR Review Velocity Impact 86.5/100 · CRITICAL

Which changes need focused human review? 1749 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 0HIGH 62MEDIUM 18LOW 1669

Directory Score Breakdown

This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.

Pattern Findings

The scanner identified 1749 distinct pattern matches across 18 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.

Unused Imports984 hits · 616 pts
SeverityFileLineSnippetContext
LOWdocs/source/conf.py19CODE
LOWdocs/source/conf.py35CODE
LOWdocs/source/local_customization.py1CODE
LOWdocs/source/local_customization.py5CODE
LOWdocs/source/local_customization.py8CODE
LOWdocs/source/local_customization.py8CODE
LOWdocs/source/local_customization.py8CODE
LOWdocs/source/local_customization.py8CODE
LOWdocs/source/typevars.py6CODE
LOWsrc/trio/_signals.py1CODE
LOWsrc/trio/_path.py1CODE
LOWsrc/trio/_highlevel_open_unix_stream.py1CODE
LOWsrc/trio/_ssl.py1CODE
LOWsrc/trio/_highlevel_open_tcp_listeners.py1CODE
LOWsrc/trio/_socket.py1CODE
LOWsrc/trio/_abc.py1CODE
LOWsrc/trio/_subprocess.py1CODE
LOWsrc/trio/_highlevel_serve_listeners.py1CODE
LOWsrc/trio/_channel.py1CODE
LOWsrc/trio/_timeouts.py1CODE
LOWsrc/trio/to_thread.py1CODE
LOWsrc/trio/to_thread.py1CODE
LOWsrc/trio/_deprecate.py1CODE
LOWsrc/trio/_windows_pipes.py1CODE
LOWsrc/trio/__init__.py3CODE
LOWsrc/trio/__init__.py22CODE
LOWsrc/trio/__init__.py26CODE
LOWsrc/trio/__init__.py26CODE
LOWsrc/trio/__init__.py26CODE
LOWsrc/trio/__init__.py26CODE
LOWsrc/trio/__init__.py26CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py50CODE
LOWsrc/trio/__init__.py51CODE
LOWsrc/trio/__init__.py51CODE
LOWsrc/trio/__init__.py51CODE
LOWsrc/trio/__init__.py56CODE
LOWsrc/trio/__init__.py56CODE
LOWsrc/trio/__init__.py57CODE
LOWsrc/trio/__init__.py57CODE
LOWsrc/trio/__init__.py61CODE
LOWsrc/trio/__init__.py61CODE
LOWsrc/trio/__init__.py65CODE
LOWsrc/trio/__init__.py66CODE
LOWsrc/trio/__init__.py67CODE
LOWsrc/trio/__init__.py68CODE
924 more matches not shown…
Hyper-Verbose Identifiers459 hits · 431 pts
SeverityFileLineSnippetContext
LOWdocs/source/conf.py147def autodoc_process_signature(CODE
LOWdocs/source/conf.py181def autodoc_process_docstring(CODE
LOWsrc/trio/_path.py92def _wrap_method_path_iterable(CODE
LOWsrc/trio/_ssl.py869 async def wait_send_all_might_not_block(self) -> None:STRING
LOWsrc/trio/_socket.py101def set_custom_hostname_resolver(CODE
LOWsrc/trio/_socket.py135def set_custom_socket_factory(CODE
LOWsrc/trio/_socket.py386def _sniff_sockopts_for_fileno(CODE
LOWsrc/trio/_socket.py433def _make_simple_sock_method_wrapper(CODE
LOWsrc/trio/_abc.py357 async def wait_send_all_might_not_block(self) -> None:CODE
LOWsrc/trio/_windows_pipes.py73 async def wait_send_all_might_not_block(self) -> None:CODE
LOWsrc/trio/_highlevel_generic.py98 async def wait_send_all_might_not_block(self) -> None:CODE
LOWsrc/trio/_highlevel_ssl_helpers.py80async def open_ssl_over_tcp_listeners(CODE
LOWsrc/trio/_threads.py87async def wait_all_threads_completed() -> None:CODE
LOWsrc/trio/_threads.py126def current_default_thread_limiter() -> CapacityLimiter:CODE
LOWsrc/trio/_threads.py366 def report_back_in_trio_thread_fn(result: outcome.Outcome[RetT]) -> None:CODE
LOWsrc/trio/_threads.py367 def do_release_then_return_result() -> RetT:CODE
LOWsrc/trio/_threads.py461def from_thread_check_cancelled() -> None:CODE
LOWsrc/trio/_util.py63 def _return_value_looks_like_wrong_library(value: object) -> bool:CODE
LOWsrc/trio/_util.py344def raise_single_exception_from_group(CODE
LOWsrc/trio/_dtls.py121def part_of_handshake_untrusted(packet: bytes) -> bool:CODE
LOWsrc/trio/_dtls.py128def is_client_hello_untrusted(packet: bytes) -> bool:CODE
LOWsrc/trio/_dtls.py210def decode_handshake_fragment_untrusted(payload: bytes) -> HandshakeFragment:CODE
LOWsrc/trio/_dtls.py240def encode_handshake_fragment(hsf: HandshakeFragment) -> bytes:CODE
LOWsrc/trio/_dtls.py251def decode_client_hello_untrusted(packet: bytes) -> tuple[int, bytes, bytes]:CODE
LOWsrc/trio/_dtls.py676async def handle_client_hello_untrusted(CODE
LOWsrc/trio/_sync.py293 def acquire_on_behalf_of_nowait(self, borrower: Task | object) -> None:CODE
LOWsrc/trio/_unix_pipes.py155 async def wait_send_all_might_not_block(self) -> None:CODE
LOWsrc/trio/_highlevel_socket.py44def _translate_socket_errors_to_stream_errors() -> Generator[None, None, None]:CODE
LOWsrc/trio/_highlevel_socket.py126 async def wait_send_all_might_not_block(self) -> None:CODE
LOWsrc/trio/_tests/test_scheduler_determinism.py27def test_the_trio_scheduler_is_not_deterministic() -> None:CODE
LOWsrc/trio/_tests/test_scheduler_determinism.py33def test_the_trio_scheduler_is_deterministic_if_seeded(CODE
LOWsrc/trio/_tests/test_highlevel_open_unix_stream.py40async def test_open_with_bad_filename_type(filename: float) -> None:CODE
LOWsrc/trio/_tests/test_testing_raisesgroup.py75def test_incorrect_number_exceptions() -> None:CODE
LOWsrc/trio/_tests/test_testing_raisesgroup.py260def test_catch_unwrapped_exceptions() -> None:CODE
LOWsrc/trio/_tests/test_testing_raisesgroup.py400def test_unwrapped_match_check() -> None:CODE
LOWsrc/trio/_tests/test_testing_raisesgroup.py683def test_suggestion_on_nested_and_brief_error() -> None:CODE
LOWsrc/trio/_tests/test_testing_raisesgroup.py748def test_assert_message_nested() -> None:CODE
LOWsrc/trio/_tests/test_testing_raisesgroup.py835def test_check_no_patched_repr() -> None:CODE
LOWsrc/trio/_tests/test_testing_raisesgroup.py895def test_brief_error_on_one_fail() -> None:CODE
LOWsrc/trio/_tests/test_testing_raisesgroup.py1087def test_raisesgroup_tostring() -> None:CODE
LOWsrc/trio/_tests/test_testing_raisesgroup.py1117def test_raisesgroup_matcher_deprecation() -> None:CODE
LOWsrc/trio/_tests/test_exports.py39def _ensure_mypy_cache_updated() -> None:CODE
LOWsrc/trio/_tests/test_exports.py68def test_core_is_properly_reexported() -> None:CODE
LOWsrc/trio/_tests/test_exports.py141def test_static_tool_sees_all_symbols(tool: str, modname: str, tmp_path: Path) -> None:CODE
LOWsrc/trio/_tests/test_exports.py269def test_static_tool_sees_class_members(CODE
LOWsrc/trio/_tests/test_exports.py612def test_pyright_recognizes_init_attributes() -> None:CODE
LOWsrc/trio/_tests/test_tracing.py40async def test_task_iter_await_frames() -> None:CODE
LOWsrc/trio/_tests/test_tracing.py57async def test_task_iter_await_frames_async_gen() -> None:CODE
LOWsrc/trio/_tests/test_tracing.py74async def test_closed_task_iter_await_frames() -> None:CODE
LOWsrc/trio/_tests/test_signals.py17async def test_open_signal_receiver() -> None:CODE
LOWsrc/trio/_tests/test_signals.py41async def test_open_signal_receiver_restore_handler_after_one_bad_signal() -> None:CODE
LOW⚡src/trio/_tests/test_signals.py53def test_open_signal_receiver_empty_fail() -> None:CODE
LOW⚡src/trio/_tests/test_signals.py59async def test_open_signal_receiver_restore_handler_after_duplicate_signal() -> None:CODE
LOW⚡src/trio/_tests/test_signals.py67async def test_catch_signals_wrong_thread() -> None:CODE
LOW⚡src/trio/_tests/test_signals.py76async def test_open_signal_receiver_conflict() -> None:CODE
LOW⚡src/trio/_tests/test_signals.py86async def wait_run_sync_soon_idempotent_queue_barrier() -> None:CODE
LOW⚡src/trio/_tests/test_signals.py93async def test_open_signal_receiver_no_starvation() -> None:CODE
LOWsrc/trio/_tests/test_signals.py124async def test_catch_signals_race_condition_on_exit() -> None:CODE
LOWsrc/trio/_tests/test_highlevel_ssl_helpers.py78async def test_open_ssl_over_tcp_stream_and_everything_else(CODE
LOWsrc/trio/_tests/test_highlevel_ssl_helpers.py152async def test_open_ssl_over_tcp_listeners() -> None:CODE
399 more matches not shown…
Empty Error Handlers31 hits · 155 pts
SeverityFileLineSnippetContext
HIGHsrc/trio/_socket.py506except (OSError, TypeError):CODE
HIGHsrc/trio/_socket.py1020except BlockingIOError:CODE
HIGHsrc/trio/_subprocess.py180except OSError: # pragma: no coverCODE
HIGHsrc/trio/_subprocess.py726except trio.BrokenResourceError:CODE
HIGHsrc/trio/_channel.py240except trio.WouldBlock:CODE
HIGHsrc/trio/_channel.py394except trio.WouldBlock:CODE
HIGHsrc/trio/_threads.py518except RuntimeError:CODE
HIGHsrc/trio/_dtls.py707except (OSError, trio.ClosedResourceError):CODE
HIGHsrc/trio/_dtls.py1010except (SSL.WantReadError, SSL.Error):CODE
HIGHsrc/trio/_highlevel_socket.py383except OSError:CODE
HIGHsrc/trio/_tests/test_highlevel_ssl_helpers.py39except trio.BrokenResourceError:CODE
HIGHsrc/trio/_tests/test_unix_pipes.py54except BlockingIOError:CODE
HIGHsrc/trio/_tests/test_socket.py1196except FileNotFoundError:CODE
HIGHsrc/trio/_tests/test_socket.py1211except BlockingIOError:CODE
HIGHsrc/trio/_tests/test_socket.py719except (AttributeError, OSError):CODE
HIGHsrc/trio/_tests/test_dtls.py523except BadPacket:CODE
HIGHsrc/trio/_tests/test_dtls.py203except RuntimeError: # pragma: no coverCODE
HIGHsrc/trio/_tests/test_channel.py354except trio.WouldBlock:CODE
HIGHsrc/trio/_core/_mock_clock.py119except AttributeError:CODE
HIGHsrc/trio/_core/_asyncgens.py146except StopIteration:CODE
HIGHsrc/trio/_core/_wakeup_socketpair.py49except BlockingIOError:CODE
HIGHsrc/trio/_core/_io_windows.py603except KeyError:CODE
HIGHsrc/trio/_core/_run.py143except ImportError:CODE
HIGHsrc/trio/_core/_ki.py183except KeyError:CODE
HIGHsrc/trio/_core/_ki.py140except KeyError:CODE
HIGHsrc/trio/_core/_tests/test_run.py1590except _core.RunFinishedError:CODE
HIGHsrc/trio/_core/_tests/test_io.py32except BlockingIOError:CODE
HIGHsrc/trio/_core/_tests/test_io.py40except BlockingIOError:CODE
HIGHsrc/trio/_subprocess_platform/waitid.py87except OSError:CODE
HIGHsrc/trio/testing/_check_streams.py403except _core.BrokenResourceError: # pragma: no coverCODE
HIGHsrc/trio/testing/_check_streams.py386except _core.BrokenResourceError: # pragma: no coverCODE
Over-Commented Block140 hits · 136 pts
SeverityFileLineSnippetContext
LOWtest-requirements.txt1# This file was autogenerated by uv via the following command:COMMENT
LOWtest-requirements.txt21certifi==2026.7.22COMMENT
LOWtest-requirements.txt41 # via -r test-requirements.inCOMMENT
LOWtest-requirements.txt61 # viaCOMMENT
LOWtest-requirements.txt81librt==0.16.0 ; implementation_name == 'cpython' and platform_python_implementation != 'PyPy'COMMENT
LOWtest-requirements.txt101packaging==26.3COMMENT
LOWtest-requirements.txt121 # via -r test-requirements.inCOMMENT
LOWtest-requirements.txt161 # via sphinxCOMMENT
LOWtest-requirements.txt181trustme==1.2.1COMMENT
LOWtest-requirements.txt201 # exceptiongroupCOMMENT
LOWdocs-requirements.txt1# This file was autogenerated by uv via the following command:COMMENT
LOWdocs-requirements.txt21click==8.5.0COMMENT
LOWdocs-requirements.txt41jinja2==3.1.6COMMENT
LOWdocs-requirements.txt61 # via sphinxCOMMENT
LOWdocs-requirements.txt81 # sphinx-rtd-themeCOMMENT
LOWdocs-requirements.txt101 # via sphinxCOMMENT
LOWtox.ini1[tox]COMMENT
LOWci.sh61 flags="--skip-ssl-imports"COMMENT
LOWci.sh81 if [ "$LSP_EXTRACT_FILE" != "" ]; thenCOMMENT
LOWdocs/source/conf.py1#!/usr/bin/env python3COMMENT
LOWdocs/source/conf.py101# methods to help it resolve links.COMMENT
LOWdocs/source/conf.py361COMMENT
LOWdocs/source/conf.py401# -- Options for HTMLHelp output ------------------------------------------COMMENT
LOWsrc/trio/_signals.py21# the only available API.COMMENT
LOWsrc/trio/_signals.py41# manipulate signal state (e.g. setting SIG_IGN) which as far as Python isCOMMENT
LOWsrc/trio/_ssl.py21 Ts = TypeVarTuple("Ts")COMMENT
LOWsrc/trio/_ssl.py41#COMMENT
LOWsrc/trio/_ssl.py61# might require some arbitrary sequence of sends and receives from the remoteCOMMENT
LOWsrc/trio/_ssl.py81# handshake, and then to turn around and do a second handshake (=COMMENT
LOWsrc/trio/_ssl.py101# it does a handshake, which remember is a process with multiple roundCOMMENT
LOWsrc/trio/_ssl.py121# *exactly that method call* later – in particular, if a 'write' failed, weCOMMENT
LOWsrc/trio/_ssl.py141# task calling receive_some, those two tasks might end up both wanting to callCOMMENT
LOWsrc/trio/_ssl.py161COMMENT
LOWsrc/trio/_ssl.py181# Ideally, when the user calls SSLStream.receive_some() with no argument, thenCOMMENT
LOWsrc/trio/_ssl.py481 #COMMENT
LOWsrc/trio/_ssl.py541 #COMMENT
LOWsrc/trio/_ssl.py561 # might have to do, and any given operation might requireCOMMENT
LOWsrc/trio/_ssl.py581 # we have to do both is very unusual (only during aCOMMENT
LOWsrc/trio/_ssl.py601 try:COMMENT
LOWsrc/trio/_ssl.py801 await self.transport_stream.aclose()COMMENT
LOWsrc/trio/_ssl.py821 # time. (Like e.g. anyone using Python ssl in synchronous mode.)COMMENT
LOWsrc/trio/_ssl.py841 # to _retry will do is send the close_notify alert, so that'sCOMMENT
LOWsrc/trio/_ssl.py881 # task calling self.receive_some -> transport_stream.send_all, inCOMMENT
LOWsrc/trio/_highlevel_open_tcp_listeners.py21# Having the backlog too low can cause practical problems (a perfectly healthyCOMMENT
LOWsrc/trio/_socket.py41# and the return type of several methods in SocketType will depend on those. TypeshedCOMMENT
LOWsrc/trio/_socket.py221 family,COMMENT
LOWsrc/trio/_socket.py981 # '"kwargs" member of ParamSpec is valid only when used with **kwargs parameter'COMMENT
LOWsrc/trio/_socket.py1001 # for read *before* we call accept, then we'll be waitingCOMMENT
LOWsrc/trio/_socket.py1041 async def connect(self, address: AddressFormat) -> None:COMMENT
LOWsrc/trio/_socket.py1061 #COMMENT
LOWsrc/trio/_socket.py1081 # confirmed this is true there:COMMENT
LOWsrc/trio/_socket.py1101 # We can't really cancel a connect, and the socket is in anCOMMENT
LOWsrc/trio/_socket.py1321 # Intentionally omitted:COMMENT
LOWsrc/trio/_subprocess.py61 # this workaround is needed on:COMMENT
LOWsrc/trio/_subprocess.py781 else:COMMENT
LOWsrc/trio/__init__.py1"""Trio - A friendly Python library for async concurrency and I/O"""COMMENT
LOWsrc/trio/_dtls.py101COMMENT
LOWsrc/trio/_dtls.py281 #COMMENT
LOWsrc/trio/_dtls.py481 if packet:COMMENT
LOWsrc/trio/_dtls.py501# second ClientHello, this time with the magic cookie included, and after weCOMMENT
80 more matches not shown…
Cross-File Repetition18 hits · 90 pts
SeverityFileLineSnippetContext
HIGHsrc/trio/_core/_generated_io_windows.py0block until the kernel reports that the given object is readable. on unix systems, ``fd`` must either be an integer fileSTRING
HIGHsrc/trio/_core/_io_windows.py0block until the kernel reports that the given object is readable. on unix systems, ``fd`` must either be an integer fileSTRING
HIGHsrc/trio/_core/_io_kqueue.py0block until the kernel reports that the given object is readable. on unix systems, ``fd`` must either be an integer fileSTRING
HIGHsrc/trio/_core/_generated_io_epoll.py0block until the kernel reports that the given object is readable. on unix systems, ``fd`` must either be an integer fileSTRING
HIGHsrc/trio/_core/_io_epoll.py0block until the kernel reports that the given object is readable. on unix systems, ``fd`` must either be an integer fileSTRING
HIGHsrc/trio/_core/_generated_io_kqueue.py0block until the kernel reports that the given object is readable. on unix systems, ``fd`` must either be an integer fileSTRING
HIGHsrc/trio/_core/_generated_io_windows.py0block until the kernel reports that the given object is writable. see `wait_readable` for the definition of ``fd``. :raiSTRING
HIGHsrc/trio/_core/_io_windows.py0block until the kernel reports that the given object is writable. see `wait_readable` for the definition of ``fd``. :raiSTRING
HIGHsrc/trio/_core/_io_kqueue.py0block until the kernel reports that the given object is writable. see `wait_readable` for the definition of ``fd``. :raiSTRING
HIGHsrc/trio/_core/_generated_io_epoll.py0block until the kernel reports that the given object is writable. see `wait_readable` for the definition of ``fd``. :raiSTRING
HIGHsrc/trio/_core/_io_epoll.py0block until the kernel reports that the given object is writable. see `wait_readable` for the definition of ``fd``. :raiSTRING
HIGHsrc/trio/_core/_generated_io_kqueue.py0block until the kernel reports that the given object is writable. see `wait_readable` for the definition of ``fd``. :raiSTRING
HIGHsrc/trio/_core/_generated_io_windows.py0notify waiters of the given object that it will be closed. call this before closing a file descriptor (on unix) or sockeSTRING
HIGHsrc/trio/_core/_io_kqueue.py0notify waiters of the given object that it will be closed. call this before closing a file descriptor (on unix) or sockeSTRING
HIGHsrc/trio/_core/_generated_io_epoll.py0notify waiters of the given object that it will be closed. call this before closing a file descriptor (on unix) or sockeSTRING
HIGHsrc/trio/_core/_io_epoll.py0notify waiters of the given object that it will be closed. call this before closing a file descriptor (on unix) or sockeSTRING
HIGHsrc/trio/_core/_generated_io_kqueue.py0notify waiters of the given object that it will be closed. call this before closing a file descriptor (on unix) or sockeSTRING
HIGHsrc/trio/_core/_io_windows.py0notify waiters of the given object that it will be closed. call this before closing a file descriptor (on unix) or sockeSTRING
Docstring Block Structure10 hits · 50 pts
SeverityFileLineSnippetContext
HIGHsrc/trio/_highlevel_open_unix_stream.py41Opens a connection to the specified `Unix domain socket <https://en.wikipedia.org/wiki/Unix_domain_socket>`__. STRING
HIGHsrc/trio/_highlevel_open_tcp_listeners.py63Create :class:`SocketListener` objects to listen for TCP connections. Args: port (int): The port to listen oSTRING
HIGHsrc/trio/_abc.py438Wait until there is data available on this stream, and then return some of it. A return value of ``b""`STRING
HIGHsrc/trio/_subprocess.py314Execute a child program in a new process. After construction, you can interact with the child process by writing daSTRING
HIGHsrc/trio/_subprocess.py477Run ``command`` in a subprocess and wait for it to complete. This function can be called in two different ways. STRING
HIGHsrc/trio/_subprocess.py830Execute a child program in a new process. After construction, you can interact with the child process by wrSTRING
HIGHsrc/trio/_subprocess.py893Run ``command`` in a subprocess and wait for it to complete. This function can be called in two different wSTRING
HIGHsrc/trio/_threads.py264Convert a blocking operation into an async operation using a thread. These two lines are equivalent:: syncSTRING
HIGHsrc/trio/_highlevel_open_tcp_stream.py192Connect to the given host and port over TCP. If the given ``host`` has multiple IP addresses associated with it, thSTRING
HIGHsrc/trio/_core/_run.py2432Run a Trio-flavored async function, and return the result. Calling:: run(async_fn, *args) is the equivSTRING
Deep Nesting44 hits · 35 pts
SeverityFileLineSnippetContext
LOWdocs/source/typevars.py21CODE
LOWsrc/trio/_ssl.py461CODE
LOWsrc/trio/_highlevel_open_tcp_listeners.py57CODE
LOWsrc/trio/_channel.py521CODE
LOWsrc/trio/_channel.py594CODE
LOWsrc/trio/_threads.py257CODE
LOWsrc/trio/_dtls.py356CODE
LOWsrc/trio/_dtls.py744CODE
LOWsrc/trio/_dtls.py411CODE
LOWsrc/trio/_dtls.py932CODE
LOWsrc/trio/_unix_pipes.py130CODE
LOWsrc/trio/_unix_pipes.py161CODE
LOWsrc/trio/_highlevel_socket.py109CODE
LOWsrc/trio/_tests/test_highlevel_open_unix_stream.py55CODE
LOWsrc/trio/_tests/test_exports.py141CODE
LOWsrc/trio/_tests/test_exports.py269CODE
LOWsrc/trio/_tests/test_signals.py93CODE
LOWsrc/trio/_tests/test_socket.py620CODE
LOWsrc/trio/_tests/test_socket.py764CODE
LOWsrc/trio/_tests/test_socket.py840CODE
LOWsrc/trio/_tests/test_socket.py926CODE
LOWsrc/trio/_tests/test_dtls.py141CODE
LOWsrc/trio/_tests/test_dtls.py507CODE
LOWsrc/trio/_tests/test_dtls.py155CODE
LOWsrc/trio/_tests/test_ssl.py105CODE
LOWsrc/trio/_tests/test_ssl.py279CODE
LOWsrc/trio/_tests/check_type_completeness.py116CODE
LOWsrc/trio/_core/_io_kqueue.py246CODE
LOWsrc/trio/_core/_io_windows.py558CODE
LOWsrc/trio/_core/_run.py2713CODE
LOWsrc/trio/_core/_run.py477CODE
LOWsrc/trio/_core/_run.py632CODE
LOWsrc/trio/_core/_run.py761CODE
LOWsrc/trio/_core/_run.py1558CODE
LOWsrc/trio/_core/_tests/test_run.py459CODE
LOWsrc/trio/_core/_tests/test_run.py512CODE
LOWsrc/trio/_core/_tests/test_io.py388CODE
LOWsrc/trio/_core/_tests/test_guest_mode.py48CODE
LOWsrc/trio/_core/_tests/test_windows.py121CODE
LOWsrc/trio/_tools/mypy_annotate.py85CODE
LOWsrc/trio/_tools/sync_requirements.py41CODE
LOWsrc/trio/testing/_raises_group.py513CODE
LOWsrc/trio/testing/_raises_group.py794CODE
LOWsrc/trio/testing/_raises_group.py945CODE
Modern Structural Boilerplate18 hits · 18 pts
SeverityFileLineSnippetContext
LOWsrc/trio/_socket.py610 def set_inheritable(self, inheritable: bool) -> None:STRING
LOWsrc/trio/_socket.py871 def set_inheritable(self, inheritable: bool) -> None:CODE
LOWsrc/trio/to_thread.py4__all__ = ["current_default_thread_limiter", "run_sync"]CODE
LOWsrc/trio/from_thread.py13__all__ = ["check_cancelled", "run", "run_sync"]CODE
LOWsrc/trio/_dtls.py408 def set_first_record_number(self, n: int) -> None:CODE
LOWsrc/trio/_dtls.py859 def _set_replaced(self) -> None:CODE
LOWsrc/trio/_dtls.py1105 def set_ciphertext_mtu(self, new_mtu: int) -> None:CODE
LOWsrc/trio/_dtls.py1372def set_ssl_context_options(ctx: SSL.Context) -> None:CODE
LOWsrc/trio/_core/_generated_io_windows.py24__all__ = [CODE
LOWsrc/trio/_core/_generated_instrumentation.py14__all__ = ["add_instrument", "remove_instrument"]CODE
LOWsrc/trio/_core/_generated_io_epoll.py18__all__ = ["notify_closing", "wait_readable", "wait_writable"]CODE
LOWsrc/trio/_core/_io_epoll.py264 def _update_registrations(self, fd: int) -> None:CODE
LOWsrc/trio/_core/_generated_io_kqueue.py24__all__ = [CODE
LOWsrc/trio/_core/_generated_run.py23__all__ = [CODE
LOW⚡src/trio/_core/_tests/test_guest_mode.py214 def set_deadline(cscope: trio.CancelScope, new_deadline: float) -> None:CODE
LOW⚡src/trio/_core/_tests/test_guest_mode.py357 def set_deadline(cscope: trio.CancelScope, new_deadline: float) -> None:CODE
LOWsrc/trio/testing/_raises_group.py976 def set_result(self, expected: int, actual: int, result: str | None) -> None:CODE
LOWsrc/trio/testing/_fake_net.py575 def set_inheritable(self, inheritable: bool) -> None:CODE
Decorative Section Separators6 hits · 18 pts
SeverityFileLineSnippetContext
MEDIUMsrc/trio/_highlevel_socket.py214# =====================COMMENT
MEDIUMsrc/trio/_highlevel_socket.py217# -----------------COMMENT
MEDIUMsrc/trio/_highlevel_socket.py258# -----------COMMENT
MEDIUMsrc/trio/_highlevel_socket.py305# ------------------COMMENT
MEDIUMsrc/trio/_core/_io_epoll.py42# ----------------------COMMENT
MEDIUMsrc/trio/_core/_io_epoll.py123# -----------------------------COMMENT
Cross-Language Confusion3 hits · 18 pts
SeverityFileLineSnippetContext
HIGHsrc/trio/_tests/test_socket.py644 got = await sock._resolve_address_nocp((null, 80), local=True)CODE
HIGHsrc/trio/_tests/test_socket.py647 got = await sock._resolve_address_nocp((null, 80), local=False)CODE
HIGHsrc/trio/_core/_windows_cffi.py135 # this is wrong (it's not always null)COMMENT
AI Slop Vocabulary8 hits · 16 pts
SeverityFileLineSnippetContext
MEDIUMci.sh15# Curl's built-in retry system is not very robust; it gives up on lots ofCOMMENT
MEDIUMsrc/trio/_ssl.py167# Definitely keep an eye on Cory's TLS API ideas on security-sig etc.COMMENT
LOWsrc/trio/_highlevel_open_tcp_listeners.py43# so this is unnecessary -- we can just pass in "infinity" and get the maximumCOMMENT
LOWsrc/trio/_util.py120 # function. So we have to just call it and then check whether theCOMMENT
MEDIUMsrc/trio/_dtls.py64# comprehensive collection look here:COMMENT
LOWsrc/trio/_dtls.py339# just pass it through unchanged. (Fortunately, the payload is only a single hash value,COMMENT
LOWsrc/trio/_core/_io_windows.py153# IOCTL_AFD_POLL. This means we can't just use the wait_overlapped machinery.COMMENT
LOWsrc/trio/_core/_io_windows.py358 # If this is not a Komodia-intercepted socket, we can just useCOMMENT
Self-Referential Comments5 hits · 15 pts
SeverityFileLineSnippetContext
MEDIUMdocs/source/conf.py6# This file is execfile()d with the current directory set to itsCOMMENT
MEDIUMsrc/trio/_version.py1# This file is imported from __init__.py and parsed by setuptoolsCOMMENT
MEDIUMsrc/trio/_core/_tests/test_run.py2103 # This function isn't testing task_status, it's using task_status as aCOMMENT
MEDIUMsrc/trio/_core/_tests/test_run.py2346 # This function is async so that we have access to a task object we canCOMMENT
MEDIUMsrc/trio/_tools/gen_exports.py239 # Create the function definition including the bodyCOMMENT
Excessive Try-Catch Wrapping7 hits · 8 pts
SeverityFileLineSnippetContext
LOWdocs/source/tutorial/echo-server.py28 except Exception as exc:CODE
LOWsrc/trio/_tests/test_ssl.py144 except Exception as exc:CODE
LOWsrc/trio/_tests/test_threads.py244 except Exception:CODE
LOWsrc/trio/_core/_thread_cache.py68 except Exception: # pragma: no coverCODE
LOWsrc/trio/_core/_exceptions.py62 except Exception:STRING
MEDIUMsrc/trio/_core/_tests/test_run.py940def unstarted_task() -> None:CODE
LOWsrc/trio/_core/_tests/test_exceptiongroup_gc.py43 except Exception as exc:CODE
Slop Phrases5 hits · 6 pts
SeverityFileLineSnippetContext
LOWsrc/trio/_ssl.py458 # comments, though, just make sure to think carefully if you ever have toSTRING
LOWsrc/trio/_file_io.py36# This list is also in the docs, make sure to keep them in syncCOMMENT
LOWsrc/trio/_file_io.py58# This list is also in the docs, make sure to keep them in syncCOMMENT
LOWsrc/trio/_tests/test_unix_pipes.py45 # make sure to write >PIPE_BUF bytes each time, which disablesCOMMENT
LOWsrc/trio/_core/_thread_cache.py82 # Just need to make sure to call it correctlyCOMMENT
Dead Code3 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMsrc/trio/_tests/test_channel.py582CODE
MEDIUMsrc/trio/_tests/test_channel.py733CODE
MEDIUMsrc/trio/_tests/test_channel.py467CODE
Overly Generic Function Names4 hits · 4 pts
SeverityFileLineSnippetContext
LOW…cs/source/reference-core/thread-contextvars-example.py24async def handle_request(current_user_id):CODE
LOWdocs/source/reference-core/contextvar-example.py18async def handle_request(tag):CODE
LOW…_tests/test_deprecate_strict_exception_groups_false.py35 def helper(fun: Callable[[], Awaitable[None]], num: int) -> None:CODE
LOWsrc/trio/_tests/test_subprocess.py655 async def do_stuff() -> None:CODE
Example Usage Blocks3 hits · 4 pts
SeverityFileLineSnippetContext
LOWpyproject.toml246# Usage:STRING
LOWsrc/trio/_socket.py53# Usage:COMMENT
LOWsrc/trio/_core/_tests/tutil.py92# Example usage:COMMENT
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippetContext
LOWsrc/trio/_dtls.py730 # Check if we have an existing associationCOMMENT