MCPcopy
hub / github.com/psf/black / is_valid_index

Function is_valid_index

src/black/trans.py:2570–2576  ·  src/black/trans.py::is_valid_index

Returns: True iff @idx is positive AND seq[@idx] does NOT raise an IndexError.

(idx: int)

Source from the content-addressed store, hash-verified

2568 class="st">"""
2569
2570 def is_valid_index(idx: int) -> bool:
2571 class="st">"""
2572 Returns:
2573 True iff @idx is positive AND seq[@idx] does NOT raise an
2574 IndexError.
2575 class="st">"""
2576 return 0 <= idx < len(seq)
2577
2578 return is_valid_index

Callers 15

do_matchMethod · 0.85
_validate_msgMethod · 0.85
do_matchMethod · 0.85
do_splitter_matchMethod · 0.85
do_transformMethod · 0.85
_get_break_idxMethod · 0.85
passes_all_checksMethod · 0.85
_return_matchMethod · 0.85
_else_matchMethod · 0.85
_assert_matchMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected