Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/psf/black
/ functions
Functions
1,067 in github.com/psf/black
⨍
Functions
1,067
◇
Types & classes
148
↳
Endpoints
29
↓ 1 callers
Method
show
Pretty-prints a given string of `code`. Convenience method for debugging.
tests/data/miscellaneous/debug_visitor.py:26
↓ 1 callers
Function
shutdown
Cancel all pending tasks on `loop`, wait for them, and close the loop.
src/black/concurrency.py:47
↓ 1 callers
Method
simplify_dfa
(self, dfa: List["DFAState"])
src/blib2to3/pgen2/pgen.py:267
↓ 1 callers
Function
skip_mark
(tests: FrozenSet[str])
tests/optional.py:115
↓ 1 callers
Function
stack_copy
Nodeless stack copy.
src/blib2to3/pgen2/parse.py:53
↓ 1 callers
Function
stringify_ast
Simple visitor generating strings to compare ASTs by content.
src/black/parsing.py:211
↓ 1 callers
Function
strip_specifier_set
Strip minor versions for some specifiers in the specifier set. For background on version specifiers, see PEP 440: https://peps.python.org/pep
src/black/files.py:188
↓ 1 callers
Function
sub_twice
Replace `regex` with `replacement` twice on `original`. This is used by string normalization to perform replaces on overlapping matches.
src/black/strings.py:35
↓ 1 callers
Method
switch_to
(self, ilabel: int)
src/blib2to3/pgen2/parse.py:75
↓ 1 callers
Function
test
()
src/blib2to3/pgen2/literals.py:58
↓ 1 callers
Function
test_idempotent_any_syntatically_valid_python
( src_contents: str, mode: black.FileMode )
scripts/fuzz.py:41
↓ 1 callers
Function
tokenize
The tokenize() function accepts two parameters: one representing the input stream, and one providing an output mechanism for tokenize().
src/blib2to3/pgen2/tokenize.py:203
↓ 1 callers
Function
tokenize_loop
(readline, tokeneater)
src/blib2to3/pgen2/tokenize.py:223
↓ 1 callers
Method
unifystate
(self, old: "DFAState", new: "DFAState")
src/blib2to3/pgen2/pgen.py:409
↓ 1 callers
Function
unmask_cell
Remove replacements from cell. For example "9b20" foo = bar becomes %%time foo = bar
src/black/handle_ipynb_magics.py:269
↓ 1 callers
Method
untokenize
(self, iterable: Iterable[TokenInfo])
src/blib2to3/pgen2/tokenize.py:250
↓ 1 callers
Function
validate_cell
Check that cell does not already contain TransformerManager transformations, or non-Python cell magics, which might cause tokenizer_rt to break be
src/black/__init__.py:942
↓ 1 callers
Function
validate_metadata
If notebook is marked as non-Python, don't format it. All notebook metadata fields are optional, see https://nbformat.readthedocs.io/en/lates
src/black/__init__.py:1005
↓ 1 callers
Method
visit_default
Default `visit_*()` implementation. Recurses to children of `node`.
src/black/nodes.py:171
↓ 1 callers
Function
whitespace
Return whitespace prefix if needed for the given `leaf`. `complex_subscript` signals whether the given leaf is part of a subscription which h
src/black/nodes.py:178
Function
A
()
tests/data/preview/long_strings__regression.py:333
Method
AnEquallyLonelyMethod
A multiline method docstring
tests/data/miscellaneous/docstring_no_string_normalization.py:5
Function
B
()
tests/data/preview/long_strings__regression.py:334
Method
BMethod
(self)
tests/data/miscellaneous/force_pyi.py:9
Function
C
()
tests/data/preview/long_strings__regression.py:335
Function
D
()
tests/data/preview/long_strings__regression.py:336
Function
E
()
tests/data/preview/long_strings__regression.py:337
Function
F
()
tests/data/preview/long_strings__regression.py:338
Function
G
()
tests/data/preview/long_strings__regression.py:339
Function
ISEOF
(x: int)
src/blib2to3/pgen2/token.py:93
Function
ISNONTERMINAL
(x: int)
src/blib2to3/pgen2/token.py:89
Function
ISTERMINAL
(x: int)
src/blib2to3/pgen2/token.py:85
Function
__await__
()
tests/data/simple_cases/function.py:95
Method
__bool__
Return True if the line has leaves or comments.
src/black/lines.py:474
Method
__call__
StringTransformer instances have a call signature that mirrors that of the Transformer type. Raises: CannotTrans
src/black/trans.py:237
Method
__call__
(self)
tests/data/simple_cases/function2.py:45
Method
__contains__
Provide `Preview.FEATURE in Mode` syntax that mirrors the ``preview`` flag. The argument is not checked and features are not differe
src/black/mode.py:198
Method
__deepcopy__
(self: _P, memo: Any)
src/blib2to3/pytree.py:109
Method
__eq__
Compare two nodes for equality. This calls the method _eq().
src/blib2to3/pytree.py:84
Method
__eq__
(self, other: Any)
src/blib2to3/pgen2/pgen.py:414
Method
__init__
(self, cell_magic: Optional[CellMagic] = None)
src/black/handle_ipynb_magics.py:342
Method
__init__
(self)
src/black/handle_ipynb_magics.py:384
Method
__init__
(self, mode: Mode, features: Collection[Feature])
src/black/linegen.py:96
Method
__init__
(self, line_length: int, normalize_strings: bool)
src/black/trans.py:199
Method
__init__
(self)
src/black/trans.py:2249
Method
__init__
(self, value: T)
src/black/rusty.py:12
Method
__init__
(self, e: E)
src/black/rusty.py:20
Method
__init__
Initializer. Takes a type constant (a symbol number >= 256), a sequence of child nodes, and an optional context keyword argu
src/blib2to3/pytree.py:247
Method
__init__
Initializer. Takes a type constant (a token number < 256), a string value, and an optional context keyword argument.
src/blib2to3/pytree.py:400
Method
__init__
Initializer. Takes optional type, content, and name. The type, if given must be a token type (< 256). If not given, this m
src/blib2to3/pytree.py:602
Method
__init__
Initializer. Takes optional type, content, and name. The type, if given, must be a symbol type (>= 256). If the type is No
src/blib2to3/pytree.py:653
Method
__init__
Initializer. Args: content: optional sequence of subsequences of patterns; if absent, matches one n
src/blib2to3/pytree.py:735
Method
__init__
Initializer. The argument is either a pattern or None. If it is None, this only matches an empty sequence (effectively '$'
src/blib2to3/pytree.py:929
Method
__init__
Initializer. Creates an attribute for each grammar symbol (nonterminal), whose value is the symbol's type (an int >= 256).
src/blib2to3/pygram.py:25
Method
__init__
(self, generator: Any)
src/blib2to3/pgen2/driver.py:63
Method
__init__
(self, grammar: Grammar, logger: Optional[Logger] = None)
src/blib2to3/pgen2/driver.py:120
Method
__init__
(self, parser: "Parser", ilabels: List[int], context: Context)
src/blib2to3/pgen2/parse.py:61
Method
__init__
( self, msg: Text, type: Optional[int], value: Optional[Text], context: Context )
src/blib2to3/pgen2/parse.py:133
Method
__init__
(self)
src/blib2to3/pgen2/tokenize.py:238
Method
__init__
(self)
src/blib2to3/pgen2/grammar.py:85
Method
__init__
(self, filename: Path, stream: Optional[IO[Text]] = None)
src/blib2to3/pgen2/pgen.py:39
Method
__init__
(self)
src/blib2to3/pgen2/pgen.py:381
Method
__init__
(self, nfaset: Dict[NFAState, Any], final: NFAState)
src/blib2to3/pgen2/pgen.py:395
Method
__init__
(self)
tests/test_black.py:114
Method
__init__
(self)
tests/test_black.py:121
Method
__init__
(self)
tests/data/simple_cases/comments.py:70
Method
__init__
(self)
tests/data/simple_cases/class_methods_new_line.py:8
Method
__init__
(self)
tests/data/simple_cases/class_methods_new_line.py:12
Method
__init__
(self)
tests/data/simple_cases/class_methods_new_line.py:16
Method
__init__
(self)
tests/data/simple_cases/class_methods_new_line.py:21
Method
__init__
(self)
tests/data/simple_cases/class_methods_new_line.py:25
Method
__init__
(self)
tests/data/simple_cases/class_methods_new_line.py:30
Method
__init__
(self)
tests/data/simple_cases/class_methods_new_line.py:36
Method
__init__
(self)
tests/data/simple_cases/class_methods_new_line.py:44
Method
__init__
(self)
tests/data/simple_cases/class_methods_new_line.py:57
Method
__init__
(self)
tests/data/simple_cases/class_methods_new_line.py:63
Method
__init__
(self)
tests/data/simple_cases/class_methods_new_line.py:70
Method
__init__
(self)
tests/data/simple_cases/class_methods_new_line.py:76
Method
__init__
(self)
tests/data/simple_cases/class_methods_new_line.py:83
Method
__init__
(self)
tests/data/simple_cases/class_methods_new_line.py:91
Method
__init__
(self)
tests/data/simple_cases/class_methods_new_line.py:99
Method
__iter__
(self)
src/blib2to3/pgen2/driver.py:89
Method
__new__
Constructor that prevents BasePattern from being instantiated.
src/blib2to3/pytree.py:531
Method
__next__
(self)
src/blib2to3/pgen2/driver.py:92
Method
__post_init__
(self)
src/black/mode.py:188
Method
__repr__
Return a canonical string representation.
src/blib2to3/pytree.py:277
Method
__repr__
Return a canonical string representation.
src/blib2to3/pytree.py:429
Method
__repr__
(self)
src/blib2to3/pytree.py:536
Method
__str__
Render the line.
src/black/lines.py:458
Method
__str__
Render a color report of the current state. Use `click.unstyle` to remove colors.
src/black/report.py:79
Method
__str__
Return a pretty string representation. This reproduces the input source exactly.
src/blib2to3/pytree.py:286
Method
__str__
Return a pretty string representation. This reproduces the input source exactly.
src/blib2to3/pytree.py:440
Method
_eq
Compare two nodes for equality.
src/blib2to3/pytree.py:294
Method
_eq
Compare two nodes for equality.
src/blib2to3/pytree.py:448
Method
_init_host
(self, parsed)
tests/data/simple_cases/comments2.py:152
Function
_legacy_listen_examples
()
tests/data/preview/long_strings__regression.py:400
Method
_mocked_calls
()
tests/test_black.py:493
Method
_new_wrapper
( output: io.StringIO, io_TextIOWrapper: Type[io.TextIOWrapper] )
tests/test_black.py:1381
Function
_rhs
Wraps calls to `right_hand_split`. The calls increasingly `omit` right-hand trailers (bracket pairs with content), meaning th
src/black/linegen.py:538
Method
_submatch
Match the pattern's content to the node's children. This assumes the node type matches and self.content is not None. Return
src/blib2to3/pytree.py:633
← previous
next →
401–500 of 1,067, ranked by callers