]>
crepu.dev Git - config.git/blob - djavu-asus/elpy/rpc-venv/lib/python3.11/site-packages/jedi/common.py
1 from contextlib
import contextmanager
5 def monkeypatch(obj
, attribute_name
, new_value
):
7 Like pytest's monkeypatch, but as a value manager.
9 old_value
= getattr(obj
, attribute_name
)
11 setattr(obj
, attribute_name
, new_value
)
14 setattr(obj
, attribute_name
, old_value
)
17 def indent_block(text
, indention
=' '):
18 """This function indents a text block with a default of four spaces."""
20 while text
and text
[-1] == '\n':
23 lines
= text
.split('\n')
24 return '\n'.join(map(lambda s
: indention
+ s
, lines
)) + temp