id
int64
20
338k
vocab_size
int64
2
671
ast_levels
int64
4
32
nloc
int64
1
451
n_ast_nodes
int64
12
5.6k
n_identifiers
int64
1
186
n_ast_errors
int64
0
10
n_words
int64
2
2.17k
n_whitespaces
int64
2
13.8k
fun_name
stringlengths
2
73
commit_message
stringlengths
51
15.3k
url
stringlengths
31
59
code
stringlengths
51
31k
ast_errors
stringlengths
0
1.46k
token_counts
int64
6
3.32k
file_name
stringlengths
5
56
language
stringclasses
1 value
path
stringlengths
7
134
commit_id
stringlengths
40
40
repo
stringlengths
3
28
complexity
int64
1
153
286,618
106
18
73
549
30
0
178
729
get_orders
[IMPROVE] Fix Docstring formatting/Fix missing, incomplete type hints (#3412) * Fixes * Update stocks_helper.py * update git-actions set-output to new format * Update stocks_helper.py * Update terminal_helper.py * removed LineAnnotateDrawer from qa_view * lint * few changes * updates * sdk a...
https://github.com/OpenBB-finance/OpenBBTerminal.git
def get_orders() -> Tuple[str, DataFrame]: url_orders = ( "https://eresearch.fidelity.com/eresearch/gotoBL/fidelityTopOrders.jhtml" ) text_soup_url_orders = BeautifulSoup( requests.get(url_orders, headers={"User-Agent": get_user_agent()}).text, "lxml" ) l_orders = [] l_ord...
318
fidelity_model.py
Python
openbb_terminal/stocks/discovery/fidelity_model.py
59d8b36bb0467a1a99513b10e8b8471afaa56fd6
OpenBBTerminal
9
9,882
25
18
13
134
17
0
29
260
activate
feat: star routing (#3900) * feat(proto): adjust proto for star routing (#3844) * feat(proto): adjust proto for star routing * feat(proto): generate proto files * feat(grpc): refactor grpclet interface (#3846) * feat: refactor connection pool for star routing (#3872) * feat(k8s): add more labels to k8s ...
https://github.com/jina-ai/jina.git
def activate(self): if self.head_pea is not None: for shard_id in self.peas_args['peas']: for pea_idx, pea_args in enumerate(self.peas_args['peas'][shard_id]): worker_host = self.get_worker_host( pea_args, self.shards[shard_id]._pe...
88
__init__.py
Python
jina/peapods/pods/__init__.py
933415bfa1f9eb89f935037014dfed816eb9815d
jina
4
21,797
6
6
4
22
4
0
6
20
is_super_table
Update tomlkit==0.9.2 Used: python -m invoke vendoring.update --package=tomlkit
https://github.com/pypa/pipenv.git
def is_super_table(self) -> bool: return self._is_super_table
12
items.py
Python
pipenv/vendor/tomlkit/items.py
8faa74cdc9da20cfdcc69f5ec29b91112c95b4c9
pipenv
1
290,736
5
6
4
17
2
0
5
12
async_reset_adapter
Minor refactor of zha config flow (#82200) * Minor refactor of zha config flow * Move ZhaRadioManager to a separate module
https://github.com/home-assistant/core.git
async def async_reset_adapter(self) -> None:
24
radio_manager.py
Python
homeassistant/components/zha/radio_manager.py
bb64b39d0e6d41f531af9c63b69d1ce243a2751b
core
1
107,162
51
12
19
294
25
0
58
317
test_align_labels
ENH: implement and use base layout_engine for more flexible layout.
https://github.com/matplotlib/matplotlib.git
def test_align_labels(): fig, (ax3, ax1, ax2) = plt.subplots(3, 1, layout="constrained", figsize=(6.4, 8), gridspec_kw={"height_ratios": (1, 1, 0.7)}) ax1....
200
test_constrainedlayout.py
Python
lib/matplotlib/tests/test_constrainedlayout.py
ec4dfbc3c83866f487ff0bc9c87b0d43a1c02b22
matplotlib
1
261,039
18
11
6
93
12
0
20
42
test_convert_to_numpy_error
ENH Adds Array API support to LinearDiscriminantAnalysis (#22554) Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org> Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
https://github.com/scikit-learn/scikit-learn.git
def test_convert_to_numpy_error(): xp = pytest.importorskip("numpy.array_api") xp_ = _AdjustableNameAPITestWrapper(xp, "wrapped.array_api") X = xp_.asarray([1.2, 3.4]) with pytest.raises(ValueError, match="Supported namespaces are:"): _convert_to_numpy(X, xp=xp_)
57
test_array_api.py
Python
sklearn/utils/tests/test_array_api.py
2710a9e7eefd2088ce35fd2fb6651d5f97e5ef8b
scikit-learn
1
20,592
6
8
5
33
4
0
6
20
validate
check point progress on only bringing in pip==22.0.4 (#4966) * vendor in pip==22.0.4 * updating vendor packaging version * update pipdeptree to fix pipenv graph with new version of pip. * Vendoring of pip-shims 0.7.0 * Vendoring of requirementslib 1.6.3 * Update pip index safety restrictions patch for p...
https://github.com/pypa/pipenv.git
def validate(self, validateTrace=None) -> None: self._checkRecursion([])
19
core.py
Python
pipenv/patched/notpip/_vendor/pyparsing/core.py
f3166e673fe8d40277b804d35d77dcdb760fc3b3
pipenv
1
34,912
16
10
5
38
4
0
18
48
has_length
[Trainer] Deeper length checks for IterableDatasetShard (#15539) * Unused import * Make `has_length()` torch-independent to use in callbacks * Update src/transformers/trainer_utils.py Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> Co-authored-by: Sylvain Gugger <35901082+sgugger...
https://github.com/huggingface/transformers.git
def has_length(dataset): try: return len(dataset) is not None except TypeError: # TypeError: len() of unsized object return False
21
trainer_utils.py
Python
src/transformers/trainer_utils.py
75b13f82e91d03bed88bf6cf0e2efb85346fb311
transformers
2
281,596
114
11
21
213
10
0
159
294
about_us
Terminal Wide Rich (#1161) * My idea for how we handle Rich moving forward * remove independent consoles * FIxed pylint issues * add a few vars * Switched print to console * More transitions * Changed more prints * Replaced all prints * Fixing tabulate * Finished replace tabulate * Finish...
https://github.com/OpenBB-finance/OpenBBTerminal.git
def about_us(): console.print( f"{Fore.GREEN}Thanks for using Gamestonk Terminal. This is our way!{Style.RESET_ALL}\n" "\n" f"{Fore.CYAN}Join our community on discord: {Style.RESET_ALL}https://discord.gg/Up2QGbMKHY\n" f"{Fore.CYAN}Follow our twitter for updates: {Style.RESET_ALL...
38
terminal_helper.py
Python
gamestonk_terminal/terminal_helper.py
82747072c511beb1b2672846ae2ee4aec53eb562
OpenBBTerminal
1
243,947
12
6
10
45
9
0
14
29
parse_requirements
[Enhancement] Upgrade isort in pre-commit hook (#7130) * upgrade isort to v5.10.1 * replace known_standard_library with extra_standard_library * upgrade isort to v5.10.1 replace known_standard_library with extra_standard_library * imports order changes
https://github.com/open-mmlab/mmdetection.git
def parse_requirements(fname='requirements.txt', with_version=True): import re import sys from os.path import exists require_fpath = fname
41
setup.py
Python
setup.py
40505a5b6daa03632691b433197810f528231d26
mmdetection
1
4,970
30
15
11
123
10
0
36
165
decode
source salesforce: use utf8 by default and iso as fallback (#12576) * use utf8 by default and iso as fallback * test both * add comment * Bump version
https://github.com/airbytehq/airbyte.git
def decode(self, chunk): if self.encoding == DEFAULT_ENCODING: try: decoded = chunk.decode(self.encoding) return decoded except UnicodeDecodeError as e: self.encoding = "ISO-8859-1" self.logger.info(f"Could not deco...
66
streams.py
Python
airbyte-integrations/connectors/source-salesforce/source_salesforce/streams.py
22b67d85281252bcbe9e8923c7a973803cff9d4c
airbyte
3
156,236
10
8
7
48
8
0
10
47
_frag_subset
Remove pyarrow-legacy engine from parquet API (#8835) * remove pyarrow-legacy * Small fixup * Small fixup for pyarrow < 5 Co-authored-by: Jim Crist-Harif <jcristharif@gmail.com>
https://github.com/dask/dask.git
def _frag_subset(old_frag, row_groups): return old_frag.format.make_fragment( old_frag.path, old_frag.filesystem, old_frag.partition_expression, row_groups=row_groups, )
32
arrow.py
Python
dask/dataframe/io/parquet/arrow.py
0b36d7fcaf54ee9a78fff4b07f124cb0c8741cdf
dask
1
213,241
25
10
6
104
12
0
31
53
lars_update
added methods inplace_arrays_supported and inplace_variables_supported, and updated all gradient methods to use inplace by default only if the backend supports this. Also updated inplace methods to raise exceptions when the backend does not support it.
https://github.com/unifyai/ivy.git
def lars_update(ws, dcdws, lr, decay_lambda=0, inplace=None, stop_gradients=True): ws_norm = ws.vector_norm() lr = _ivy.stable_divide(ws_norm * lr, dcdws.vector_norm()) if decay_lambda > 0: lr /= (ws_norm * decay_lambda) return gradient_descent_update(ws, dcdws, lr, inplace, stop_gradients)...
71
gradients.py
Python
ivy/core/gradients.py
d5b29bf3c74b116fd18192239abba21af9efaf69
ivy
2
256,644
25
11
13
90
9
0
28
96
get_document_store
Pylint: solve or silence locally rare warnings (#2170) * Remove invalid-envvar-default and logging-too-many-args * Remove import-self, access-member-before-definition and deprecated-argument * Remove used-before-assignment by restructuring type import * Remove unneeded-not * Silence unnecessary-lambda (it'...
https://github.com/deepset-ai/haystack.git
def get_document_store(self) -> Optional[BaseDocumentStore]: matches = self.get_nodes_by_class(class_type=BaseDocumentStore) if len(matches) > 1: raise Exception(f"Multiple Document Stores found in Pipeline: {matches}") if len(matches) == 0: return None e...
52
base.py
Python
haystack/pipelines/base.py
8de1aa3e4304ddbfcd9f5a7c3cfd60dab84e73e3
haystack
3
21,648
76
15
40
444
44
0
117
473
compatible_abstract_dep
Vendor in latest requirements lib and pip-shims in order to drop packaging and resolve differences in sourcing it.
https://github.com/pypa/pipenv.git
def compatible_abstract_dep(self, other): from .requirements import Requirement if len(self.candidates) == 1 and next(iter(self.candidates)).editable: return self elif len(other.candidates) == 1 and next(iter(other.candidates)).editable: return other ne...
285
dependencies.py
Python
pipenv/vendor/requirementslib/models/dependencies.py
8a4d2eb130fd173466310f59df607ea59bfc44a5
pipenv
15
76,993
21
11
9
78
9
0
25
104
get_list_filter
Add internationalisation UI to modeladmin Includes changes from #6230 Co-Authored-By: Dan Braghis <dan@zerolab.org>
https://github.com/wagtail/wagtail.git
def get_list_filter(self, request): list_filter = self.list_filter if ( getattr(settings, "WAGTAIL_I18N_ENABLED", False) and issubclass(self.model, TranslatableMixin) and "locale" not in list_filter ): list_filter += ("locale",) ...
47
options.py
Python
wagtail/contrib/modeladmin/options.py
483b7d27b3a16bfb7098bcbd581d951f1370b0dc
wagtail
4
42,123
187
18
42
589
47
0
328
779
_default_color
Fix: shifting margins caused by multiple rugplots (#2953) * Fix: shifting margins caused by multiple rugplots This fix prevents margins from increasing when multiple rugplots are added to the same `ax`, even if `expand_margins` is `False`. As a minimum reproducible example: ```py import seaborn as sns; sns....
https://github.com/mwaskom/seaborn.git
def _default_color(method, hue, color, kws): if hue is not None: # This warning is probably user-friendly, but it's currently triggered # in a FacetGrid context and I don't want to mess with that logic right now # if color is not None: # msg = "`color` is ignored when `hue...
355
utils.py
Python
seaborn/utils.py
708122389feb683aaf143339ab279de04c5f6f08
seaborn
13
259,441
15
11
4
54
10
0
17
52
predict
ENH migrate GLMs / TweedieRegressor to linear loss (#22548) Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org> Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
https://github.com/scikit-learn/scikit-learn.git
def predict(self, X): # check_array is done in _linear_predictor raw_prediction = self._linear_predictor(X) y_pred = self._linear_loss.base_loss.link.inverse(raw_prediction) return y_pred
32
glm.py
Python
sklearn/linear_model/_glm/glm.py
75a94f518f7bd7d0bf581ffb67d9f961e3c4efbc
scikit-learn
1
252,676
5
6
2
26
3
0
5
12
transport_protocol
Unify proxy modes, introduce UDP protocol detection. (#5556) * [modes] new unified syntax * [modes] full coverage udp.py * [modes] mypy and coverage * [modes] split mode_spec into two files * [modes] adjust DNS layer * [modes] add udp layer decision * [modes] use 1:1 ServerInstances * [modes] fix ...
https://github.com/mitmproxy/mitmproxy.git
def transport_protocol(self) -> Literal["tcp", "udp"]:
13
mode_specs.py
Python
mitmproxy/proxy/mode_specs.py
1706a9b9fe8c8157824df22634d97c3d695a495d
mitmproxy
1
142,621
13
11
14
60
8
0
16
28
test_core_worker_error_message
[api] Annotate as public / move ray-core APIs to _private and add enforcement rule (#25695) Enable checking of the ray core module, excluding serve, workflows, and tune, in ./ci/lint/check_api_annotations.py. This required moving many files to ray._private and associated fixes.
https://github.com/ray-project/ray.git
def test_core_worker_error_message(): script = proc = run_string_as_driver_nonblocking(script) err_str = proc.stderr.read().decode("ascii") assert "Hello there" in err_str, err_str
33
test_output.py
Python
python/ray/tests/test_output.py
43aa2299e6623c8f8c7c4a1b80133459d0aa68b0
ray
1
100,955
62
15
18
289
25
0
78
282
_add_latest_live
Bug fixes - PhazeA tooltip spacing - Graph live cache bug
https://github.com/deepfakes/faceswap.git
def _add_latest_live(self, session_id, loss, timestamps): logger.debug("Adding live data to cache: (session_id: %s, loss: %s, timestamps: %s)", session_id, loss.shape, timestamps.shape) if not np.any(loss) and not np.any(timestamps): return cache = self...
177
event_reader.py
Python
lib/gui/analysis/event_reader.py
e2fc0703709a08f64f3aee44a5c78f9e71ebdb92
faceswap
6
276,210
11
12
5
47
9
0
11
30
_get_var_list
Reformatting the codebase with black. PiperOrigin-RevId: 450093126
https://github.com/keras-team/keras.git
def _get_var_list(model): var_list, _, _ = tf.__internal__.tracking.ObjectGraphView( model ).serialize_object_graph() return var_list
28
saved_model_experimental.py
Python
keras/saving/saved_model_experimental.py
84afc5193d38057e2e2badf9c889ea87d80d8fbf
keras
1
111,200
14
10
4
69
11
1
14
31
test_noun_chunks_is_parsed
Add a noun chunker for Finnish (#10214) with test cases
https://github.com/explosion/spaCy.git
def test_noun_chunks_is_parsed(fi_tokenizer): doc = fi_tokenizer("Tämä on testi") with pytest.raises(ValueError): list(doc.noun_chunks) @pytest.mark.parametrize( "text,pos,deps,heads,expected_noun_chunks", FI_NP_TEST_EXAMPLES )
@pytest.mark.parametrize( "text,pos,deps,heads,expected_noun_chunks", FI_NP_TEST_EXAMPLES )
26
test_noun_chunks.py
Python
spacy/tests/lang/fi/test_noun_chunks.py
e9c26f2ee9f03c2aa6b7cd724f4c0b3717507211
spaCy
1
267,812
6
6
3
21
3
0
6
20
option_name
ansible-test - Use more native type hints. (#78435) * ansible-test - Use more native type hints. Simple search and replace to switch from comments to native type hints for return types of functions with no arguments. * ansible-test - Use more native type hints. Conversion of simple single-line function annota...
https://github.com/ansible/ansible.git
def option_name(self) -> str: return '--target-python'
10
__init__.py
Python
test/lib/ansible_test/_internal/cli/parsers/__init__.py
3eb0485dd92c88cc92152d3656d94492db44b183
ansible
1
203,157
7
10
3
52
10
0
7
28
test_response_resolver_match_class_based_view
Adjusted CBV resolver_match example in testing tools docs. The view_class is available on the view callback, allowing that to be checked, rather than the __name__.
https://github.com/django/django.git
def test_response_resolver_match_class_based_view(self): response = self.client.get('/accounts/') self.assertIs(response.resolver_match.func.view_class, RedirectView)
30
tests.py
Python
tests/test_client/tests.py
d15a10afb51619faf14e678deae7dcda720413d9
django
1
160,273
16
9
7
109
10
0
23
48
test_array_keys_use_private_array
API: Allow newaxis indexing for `array_api` arrays (#21377) * TST: Add test checking if newaxis indexing works for `array_api` Also removes previous check against newaxis indexing, which is now outdated * TST, BUG: Allow `None` in `array_api` indexing Introduces test for validating flat indexing when `None` i...
https://github.com/numpy/numpy.git
def test_array_keys_use_private_array(): a = ones((0, 0), dtype=bool_) assert a[a].shape == (0,) a = ones((0,), dtype=bool_) key = ones((0, 0), dtype=bool_) with pytest.raises(IndexError): a[key]
70
test_array_object.py
Python
numpy/array_api/tests/test_array_object.py
befef7b26773eddd2b656a3ab87f504e6cc173db
numpy
1
176,627
13
9
5
65
10
1
15
29
path_graph
Adjust the usage of nodes_or_number decorator (#5599) * recorrect typo in decorators.py * Update tests to show troubles in current code * fix troubles with usage of nodes_or_number * fix typo * remove nodes_or_number where that makes sense * Reinclude nodes_or_numbers and add some tests for nonstandard ...
https://github.com/networkx/networkx.git
def path_graph(n, create_using=None): _, nodes = n G = empty_graph(nodes, create_using) G.add_edges_from(pairwise(nodes)) return G @nodes_or_number(0)
@nodes_or_number(0)
34
classic.py
Python
networkx/generators/classic.py
de1d00f20e0bc14f1cc911b3486e50225a8fa168
networkx
1
20,567
11
7
5
28
3
0
11
15
enable_all_warnings
check point progress on only bringing in pip==22.0.4 (#4966) * vendor in pip==22.0.4 * updating vendor packaging version * update pipdeptree to fix pipenv graph with new version of pip. * Vendoring of pip-shims 0.7.0 * Vendoring of requirementslib 1.6.3 * Update pip index safety restrictions patch for p...
https://github.com/pypa/pipenv.git
def enable_all_warnings() -> None: __diag__.enable_all_warnings() # hide abstract class del __config_flags
12
core.py
Python
pipenv/patched/notpip/_vendor/pyparsing/core.py
f3166e673fe8d40277b804d35d77dcdb760fc3b3
pipenv
1
102,297
24
9
7
95
12
0
28
43
sample_inputs_linalg_invertible
Remove random_fullrank_matrix_distinc_singular_value (#68183) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/68183 We do so in favour of `make_fullrank_matrices_with_distinct_singular_values` as this latter one not only has an even longer name, but also generates inputs correctly for them to ...
https://github.com/pytorch/pytorch.git
def sample_inputs_linalg_invertible(op_info, device, dtype, requires_grad=False, **kwargs): make_fn = make_fullrank_matrices_with_distinct_singular_values make_arg = partial(make_fn, dtype=dtype, device=device, requires_grad=requires_grad) batches = [(), (0, ), (2, ), (1, 1)] ns = [5, 0]
76
common_methods_invocations.py
Python
torch/testing/_internal/common_methods_invocations.py
baeca11a21e285d66ec3e4103c29dfd0b0245b85
pytorch
1
176,135
17
14
16
165
5
0
30
143
test_edgeql_functions_array_agg_20
Filter out nulls when calling array_agg and enumerate (#3325) Fixes #3324.
https://github.com/edgedb/edgedb.git
async def test_edgeql_functions_array_agg_20(self): await self.assert_query_result( r, tb.bag([{"te": [3000]}, {"te": []}, {"te": []}, {"te": []}]), ) await self.assert_query_result( r, tb.bag( [{"te": [3000, 3000]}, {"te": [3000]}...
100
test_edgeql_functions.py
Python
tests/test_edgeql_functions.py
dac3c0e8e2aa5f978bcf56e69b50cfde1bdbc91f
edgedb
1
22,298
14
14
6
95
8
0
20
62
registerLabels
refactor: clean code Signed-off-by: slowy07 <slowy.arfy@gmail.com>
https://github.com/geekcomputers/Python.git
def registerLabels(): for i in range(len(tokens)): if tokens[i].t == "label": jumps[tokens[i].token] = i elif tokens[i].t == "subprogram": jumps[tokens[i].token] = i
58
assembler.py
Python
Assembler/assembler.py
f0af0c43340763724f139fa68aa1e5a9ffe458b4
Python
4
31,490
19
12
10
61
7
0
22
80
cls_token
Fix properties of unset special tokens in non verbose mode (#17797) Co-authored-by: SaulLu <55560583+SaulLu@users.noreply.github.com>
https://github.com/huggingface/transformers.git
def cls_token(self) -> str: if self._cls_token is None: if self.verbose: logger.error("Using cls_token, but it is not set yet.") return None return str(self._cls_token)
35
tokenization_utils_base.py
Python
src/transformers/tokenization_utils_base.py
3eed5530ec74bb60ad9f8f612717d0f6ccf820f2
transformers
3
283,097
12
14
4
99
16
1
14
21
get_yf_currency_list
Add YahooFinance to forex load (#1544) * Load yf forex * Fix linting * Adding forex dictionary * Fix tests failing * Fix tests failing * Remove inheritance to oanda model * Adding -s to --source * Addressed comments * Fix tests * Fix oanda menu entry * Add av api limit error handling *...
https://github.com/OpenBB-finance/OpenBBTerminal.git
def get_yf_currency_list() -> List: path = os.path.join(os.path.dirname(__file__), "data/yahoofinance_forex.json") return sorted(list(set(pd.read_json(path)["from_symbol"]))) YF_CURRENCY_LIST = get_yf_currency_list() @log_start_end(log=logger)
@log_start_end(log=logger)
45
forex_helper.py
Python
gamestonk_terminal/forex/forex_helper.py
93aba1e2cdb90cf91787b4a999aa63d5a91b9a3d
OpenBBTerminal
1
300,059
33
11
17
146
15
0
38
120
test_chime_can_be_played
Add buttons to Ring chime devices to play ding and motion chimes (#71370) Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
https://github.com/home-assistant/core.git
async def test_chime_can_be_played(hass, requests_mock): await setup_platform(hass, Platform.BUTTON) # Mocks the response for playing a test sound requests_mock.post( "https://api.ring.com/clients_api/chimes/123456/play_sound", text="SUCCESS", ) await hass.services.async_call( ...
83
test_button.py
Python
tests/components/ring/test_button.py
c22cf3b3d2e4d079499473500abf8a73e5b80163
core
1
153,527
5
8
2
26
4
0
5
11
is_reduce_function
REFACTOR-#4322: Move is_reduce_fn outside of groupby_agg. (#4323) Co-authored-by: Dmitry Chigarev <dchigarev@users.noreply.github.com> Co-authored-by: Yaroslav Igoshev <Poolliver868@mail.ru> Signed-off-by: mvashishtha <mahesh@ponder.io>
https://github.com/modin-project/modin.git
def is_reduce_function(fn): return _is_reduce_function_with_depth(fn, depth=0)
15
groupby.py
Python
modin/core/dataframe/algebra/groupby.py
b0c1e646a2462a3d20430ea8bc02194acca1248a
modin
1
20,440
108
24
56
609
30
0
193
1,512
get_tokens_unprocessed
check point progress on only bringing in pip==22.0.4 (#4966) * vendor in pip==22.0.4 * updating vendor packaging version * update pipdeptree to fix pipenv graph with new version of pip. * Vendoring of pip-shims 0.7.0 * Vendoring of requirementslib 1.6.3 * Update pip index safety restrictions patch for p...
https://github.com/pypa/pipenv.git
def get_tokens_unprocessed(self, text=None, context=None): tokendefs = self._tokens if not context: ctx = LexerContext(text, 0) statetokens = tokendefs['root'] else: ctx = context statetokens = tokendefs[ctx.stack[-1]] text = c...
373
lexer.py
Python
pipenv/patched/notpip/_vendor/pygments/lexer.py
f3166e673fe8d40277b804d35d77dcdb760fc3b3
pipenv
20
102,045
10
11
5
43
6
0
10
35
items_queued
Extract: Implement re-align/2nd pass - implement configurable re-align function in extract - update locales + documentation - re-factor align._base and split to separate modules - move normalization method to plugin parent - bugfix: FAN use zeros for pre-processing crop - lint AlignedFilter
https://github.com/deepfakes/faceswap.git
def items_queued(self) -> bool: with self._queue_lock: return self._active and bool(self._queued)
24
processing.py
Python
plugins/extract/align/_base/processing.py
9e2026f6feba4fc1d60e0d985cbc1ba9c44a4848
faceswap
2
320,611
10
11
2
46
6
0
10
16
other_tabs
Fixes qutebrowser/qutebrowser#6967 by adding win id param in _tabs & using it in delete_tabs As delete_tab was assuming that completion column contains window ID, it was showing exception in case of tab-focus, as it doesn't have the window ID in completion column. So instead a new parameter named current_win_id is use...
https://github.com/qutebrowser/qutebrowser.git
def other_tabs(*, info): return _tabs(win_id_filter=lambda win_id: win_id != info.win_id, current_win_id=info.win_id)
28
miscmodels.py
Python
qutebrowser/completion/models/miscmodels.py
57155e329ada002245ab3fac45d906f6707c14cf
qutebrowser
1
311,839
15
14
6
73
11
0
16
59
speed_count
Add missing type hints to homekit_controller (#65368)
https://github.com/home-assistant/core.git
def speed_count(self) -> int: return round( min(self.service[CharacteristicsTypes.ROTATION_SPEED].maxValue or 100, 100) / max(1, self.service[CharacteristicsTypes.ROTATION_SPEED].minStep or 0) )
47
fan.py
Python
homeassistant/components/homekit_controller/fan.py
9f5d77e0df957c20a2af574d706140786f0a551a
core
3
211,031
47
17
29
255
22
0
73
396
update
[MOT] Add OC_SORT tracker (#6272) * add ocsort tracker * add ocsort deploy * merge develop * fix ocsort tracker codes * fix doc, test=document_fix * fix doc, test=document_fix
https://github.com/PaddlePaddle/PaddleDetection.git
def update(self, bbox): if bbox is not None: if self.last_observation.sum() >= 0: # no previous observation previous_box = None for i in range(self.delta_t): dt = self.delta_t - i if self.age - dt in self.observations:...
156
ocsort_tracker.py
Python
deploy/pptracking/python/mot/tracker/ocsort_tracker.py
c84153a355d9855fe55cf51d203b8b24e7d884e5
PaddleDetection
6
34,175
24
14
7
123
15
0
30
55
blackify
Copies and docstring styling (#15202) * Style docstrings when making/checking copies * Polish
https://github.com/huggingface/transformers.git
def blackify(code): has_indent = len(get_indent(code)) > 0 if has_indent: code = f"class Bla:\n{code}" result = black.format_str(code, mode=black.FileMode([black.TargetVersion.PY35], line_length=119)) result, _ = style_docstrings_in_code(result) return result[len("class Bla:\n") :] if h...
72
check_copies.py
Python
utils/check_copies.py
1144d336b689d1710534b245697e41be7a168075
transformers
3
156,746
11
7
3
46
7
0
12
33
clip
Don't include docs in ``Array`` methods, just refer to module docs (#9244) Co-authored-by: James Bourbeau <jrbourbeau@users.noreply.github.com>
https://github.com/dask/dask.git
def clip(self, min=None, max=None): from dask.array.ufunc import clip return clip(self, min, max)
31
core.py
Python
dask/array/core.py
2820bae493a49cb1d0a6e376985c5473b8f04fa8
dask
1
166,580
60
12
4
164
28
0
78
90
__doc__
TYP: CallableDynamicDoc (#46786) * TYP: CallableDynamicDoc * using cast * tighten NDFrameIndexerBase * dtype and clarification for _IndexingMixinT Co-authored-by: Matthew Roeschke <emailformattr@gmail.com>
https://github.com/pandas-dev/pandas.git
def __doc__(self) -> str: # type: ignore[override] opts_desc = _describe_option("all", _print_desc=False) opts_list = pp_options_list(list(_registered_options.keys())) return self.__doc_tmpl__.format(opts_desc=opts_desc, opts_list=opts_list) _get_option_tmpl = _set_option_tmpl = _describe...
45
config.py
Python
pandas/_config/config.py
3e3bb9028b48aa7e42592b1d4a518197f4dbf6de
pandas
1
215,959
10
10
2
54
9
0
10
16
_get_svc_list
Update to latest ``pyupgrade`` hook. Stop skipping it on CI. Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
https://github.com/saltstack/salt.git
def _get_svc_list(name="*", status=None): return sorted(os.path.basename(el) for el in _get_svc_path(name, status))
33
runit.py
Python
salt/modules/runit.py
f2a783643de61cac1ff3288b40241e5ce6e1ddc8
salt
2
101,443
14
15
4
87
10
0
14
53
sections
Bugfix: convert - Gif Writer - Fix non-launch error on Gif Writer - convert plugins - linting - convert/fs_media/preview/queue_manager - typing - Change convert items from dict to Dataclass
https://github.com/deepfakes/faceswap.git
def sections(self) -> List[str]: return sorted(set(plugin.split(".")[0] for plugin in self._config.config.sections() if plugin.split(".")[0] != "writer"))
51
preview.py
Python
tools/preview/preview.py
1022651eb8a7741014f5d2ec7cbfe882120dfa5f
faceswap
3
261,252
30
16
12
191
15
0
54
136
svd_flip
DOC Ensures that svd_flip passes numpydoc validation (#24581) Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
https://github.com/scikit-learn/scikit-learn.git
def svd_flip(u, v, u_based_decision=True): if u_based_decision: # columns of u, rows of v max_abs_cols = np.argmax(np.abs(u), axis=0) signs = np.sign(u[max_abs_cols, range(u.shape[1])]) u *= signs v *= signs[:, np.newaxis] else: # rows of v, columns of u ...
127
extmath.py
Python
sklearn/utils/extmath.py
97057d329da1786aa03206251aab68bf51312390
scikit-learn
2
259,807
73
12
16
215
21
0
102
195
precision_recall_curve
FIX compute precision-recall at 100% recall (#23214) Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com> Co-authored-by: jeremiedbb <jeremiedbb@yahoo.fr>
https://github.com/scikit-learn/scikit-learn.git
def precision_recall_curve(y_true, probas_pred, *, pos_label=None, sample_weight=None): fps, tps, thresholds = _binary_clf_curve( y_true, probas_pred, pos_label=pos_label, sample_weight=sample_weight ) ps = tps + fps precision = np.divide(tps, ps, where=(ps != 0)) # When no positive l...
140
_ranking.py
Python
sklearn/metrics/_ranking.py
32c53bc69cc0d1f142700dd6c02281a000b855b9
scikit-learn
2
76,599
26
15
8
132
18
0
27
98
test_page_move_page_position_to_the_same_position
Fix permission error when sorting pages having page type restrictions
https://github.com/wagtail/wagtail.git
def test_page_move_page_position_to_the_same_position(self): response = self.client.post( reverse("wagtailadmin_pages:set_page_position", args=(self.child_1.id,)) + "?position=0" ) self.assertEqual(response.status_code, 200) # Ensure page order does not c...
77
test_reorder_page.py
Python
wagtail/admin/tests/pages/test_reorder_page.py
128b319b9990c01ddcda3f827cf9961a050971ac
wagtail
1
292,870
10
9
4
37
7
0
10
42
async_start
Fix dhcp None hostname (#67289) * Fix dhcp None hostname * Test handle None hostname
https://github.com/home-assistant/core.git
async def async_start(self): self._unsub = async_dispatcher_connect( self.hass, CONNECTED_DEVICE_REGISTERED, self._async_process_device_data )
22
__init__.py
Python
homeassistant/components/dhcp/__init__.py
d9abd5efea9a847dd54e5cda80aec29a0ffcabaa
core
1
100,563
13
9
19
51
7
0
14
42
_get_free_vram
Refactor lib.gpu_stats (#1218) * inital gpu_stats refactor * Add dummy CPU Backend * Update Sphinx documentation
https://github.com/deepfakes/faceswap.git
def _get_free_vram(self) -> List[float]: vram = self._all_vram self._log("debug", f"GPU VRAM free: {vram}") return vram
27
amd.py
Python
lib/gpu_stats/amd.py
bdbbad4d310fb606b6f412aa81e9f57ccd994e97
faceswap
1
284,059
56
13
49
346
35
0
66
529
call_cr
Replaces coingecko deprecated commands (#1650) * removes cgproducts and cgplatforms and replaces with cr * add ignore word * added .openbb script * reverted crypto change * doc * failing tests * trying chart and fixed minh issues * Create barh * Fix ticker labels * fix test * loanscan mo...
https://github.com/OpenBB-finance/OpenBBTerminal.git
def call_cr(self, other_args): parser = argparse.ArgumentParser( prog="cr", add_help=False, formatter_class=argparse.ArgumentDefaultsHelpFormatter, description=, ) parser.add_argument( "-t", "--type", d...
196
overview_controller.py
Python
openbb_terminal/cryptocurrency/overview/overview_controller.py
670402396e7e25e95bd6497affb143565d9bd4ea
OpenBBTerminal
4
311,262
52
11
35
297
24
0
89
269
test_write_current_mode
Allow homekit_controller to set Ecobee's mode (#65032)
https://github.com/home-assistant/core.git
async def test_write_current_mode(hass, utcnow): helper = await setup_test_component(hass, create_service_with_ecobee_mode) service = helper.accessory.services.first(service_type=ServicesTypes.THERMOSTAT) # Helper will be for the primary entity, which is the service. Make a helper for the sensor. ...
176
test_select.py
Python
tests/components/homekit_controller/test_select.py
a65694457a8c9357d890877144be69f3179bc632
core
1
189,969
22
11
4
72
10
0
23
62
ghost_to
Prevent TransformMatchingTex from crashing when there is nothing to fade (#2846) * Prevent TransformMatchingTex from crashing when there is nothing to fade Fixes #2845 and adds tests. I originally tried to make FadeTransformPieces not crash if it was given two Mobjects with no submobjects, but I couldn't quite g...
https://github.com/ManimCommunity/manim.git
def ghost_to(self, source, target): # mobject.replace() does not work if the target has no points. if target.get_num_points() or target.submobjects: source.replace(target, stretch=self.stretch, dim_to_match=self.dim_to_match) source.set_opacity(0)
45
transform.py
Python
manim/animation/transform.py
c4f1d202a9c858da930e4515d44ce0910740f1b2
manim
3
96,045
15
11
8
73
11
0
15
87
test_orderby_tag
ref(metrics): Cleans up metrics API (#31541) Hacks out the `MockingDataSource`, and moves the `SnubaDataSource` into its own module
https://github.com/getsentry/sentry.git
def test_orderby_tag(self): response = self.get_response( self.project.organization.slug, field=["sum(sentry.sessions.session)", "environment"], groupBy="environment", orderBy="environment", ) assert response.status_code == 400
43
test_organization_metrics.py
Python
tests/sentry/api/endpoints/test_organization_metrics.py
c79220f4fae984e531b4ec9cecae0ff2c4d0b7ae
sentry
1
124,306
22
13
14
80
10
0
29
68
render
[Core] Add HTML reprs for `ClientContext` and `WorkerContext` (#25730)
https://github.com/ray-project/ray.git
def render(self, **kwargs) -> str: rendered = self.template for key, value in kwargs.items(): rendered = rendered.replace("{{ " + key + " }}", value if value else "") return rendered
47
render.py
Python
python/ray/widgets/render.py
ea47d97a548504bdb6ff1afdb1021b0bc54d5dfa
ray
3
154,519
58
12
14
221
27
0
73
194
reduce
REFACTOR-#5009: use RayWrapper.materialize instead of ray.get (#5010) Signed-off-by: Myachev <anatoly.myachev@intel.com>
https://github.com/modin-project/modin.git
def reduce(self, first, others, func, axis=0, **kwargs): # TODO: Try to use `axis` parameter of cudf.concat join_func = ( cudf.DataFrame.join if not axis else lambda x, y: cudf.concat([x, y]) ) if not isinstance(others[0], int): other_dfs = RayWrapper.mat...
148
gpu_manager.py
Python
modin/core/execution/ray/implementations/cudf_on_ray/partitioning/gpu_manager.py
1dc16415333bf2428ee2b1f4d31ff94e66b9a0a6
modin
6
94,414
27
14
16
237
28
0
33
169
test_instance_url_mismatch
feat(Jira): Plugin issue migration endpoint (#37577) * feat(jira): Plugin issue migration endpoint
https://github.com/getsentry/sentry.git
def test_instance_url_mismatch(self): self.plugin.set_option("instance_url", "https://hellboy.atlassian.net", self.project) group = self.create_group(message="Hello world", culprit="foo.bar") plugin_issue = GroupMeta.objects.create( key=f"{self.plugin.slug}:tid", group_id=gr...
132
test_integration.py
Python
tests/sentry/integrations/jira/test_integration.py
f5e5a3b1ed97383e0699aff9eb0363e9eb5db479
sentry
1
258,673
10
9
14
61
12
0
11
23
test_estimator_does_not_support_feature_names
TST Better info when checking for no warnings in tests (#22362)
https://github.com/scikit-learn/scikit-learn.git
def test_estimator_does_not_support_feature_names(): pytest.importorskip("pandas") X, y = datasets.load_iris(as_frame=True, return_X_y=True) all_feature_names = set(X.columns)
114
test_from_model.py
Python
sklearn/feature_selection/tests/test_from_model.py
9f85c9d44965b764f40169ef2917e5f7a798684f
scikit-learn
2
295,967
84
12
20
260
29
1
111
224
test_auto_purge_disabled
Reduce memory pressure during database migration (#69628)
https://github.com/home-assistant/core.git
def test_auto_purge_disabled(hass_recorder): hass = hass_recorder({CONF_AUTO_PURGE: False}) original_tz = dt_util.DEFAULT_TIME_ZONE tz = dt_util.get_time_zone("Europe/Copenhagen") dt_util.set_default_time_zone(tz) # Purging is scheduled to happen at 4:12am every day. We want # to verify ...
@pytest.mark.parametrize("enable_statistics", [True])
141
test_init.py
Python
tests/components/recorder/test_init.py
66f0a3816a7341f0726a01f4dfdbd1ff47c27d1b
core
1
126,482
31
14
13
66
8
0
32
123
get_entrypoint_task_id
[workflow] Change `step` to `task` in workflow. (#27330) * change step to task Signed-off-by: Yi Cheng <74173148+iycheng@users.noreply.github.com> * fix comments Signed-off-by: Yi Cheng <74173148+iycheng@users.noreply.github.com> * fix comments Signed-off-by: Yi Cheng <74173148+iycheng@users.noreply.git...
https://github.com/ray-project/ray.git
def get_entrypoint_task_id(self) -> TaskID: # empty TaskID represents the workflow driver try: return self._locate_output_task_id("") except Exception as e: raise ValueError( "Fail to get entrypoint task ID from workflow" f"[id={se...
31
workflow_storage.py
Python
python/ray/workflow/workflow_storage.py
a9697722cf188ebb9b257ad7a4a6c43ece32c546
ray
2
259,225
38
16
8
149
17
0
45
77
test_ohe_infrequent_three_levels_drop_infrequent_errors
ENH Adds infrequent categories to OneHotEncoder (#16018) * ENH Completely adds infrequent categories * STY Linting * STY Linting * DOC Improves wording * DOC Lint * BUG Fixes * CLN Address comments * CLN Address comments * DOC Uses math to description float min_frequency * DOC Adds comment r...
https://github.com/scikit-learn/scikit-learn.git
def test_ohe_infrequent_three_levels_drop_infrequent_errors(drop): X_train = np.array([["a"] * 5 + ["b"] * 20 + ["c"] * 10 + ["d"] * 3]).T ohe = OneHotEncoder( handle_unknown="infrequent_if_exist", sparse=False, max_categories=3, drop=drop ) msg = f"Unable to drop category {drop[0]!r} from...
82
test_encoders.py
Python
sklearn/preprocessing/tests/test_encoders.py
7f0006c8aad1a09621ad19c3db19c3ff0555a183
scikit-learn
1
101,223
10
9
4
56
12
0
10
43
_kwarg_mapping
lib.align updates: - alignments.py - Add typed dicts for imported alignments - Explicitly check for presence of thumb value in alignments dict - linting - detected_face.py - Typing - Linting - Legacy support for pre-aligned face - Update dependencies to new property names
https://github.com/deepfakes/faceswap.git
def _kwarg_mapping(self) -> Dict[str, Union[int, Tuple[int, int]]]: return dict(ksize=self._kernel_size, sigmaX=self._sigma)
38
detected_face.py
Python
lib/align/detected_face.py
5e73437be47f2410439a3c6716de96354e6a0c94
faceswap
1
19,019
40
13
19
205
23
0
47
236
_log_dataset_tag
Evaluation Default evaluator (#5092) * init Signed-off-by: Weichen Xu <weichen.xu@databricks.com> * update Signed-off-by: Weichen Xu <weichen.xu@databricks.com> * update Signed-off-by: Weichen Xu <weichen.xu@databricks.com> * update Signed-off-by: Weichen Xu <weichen.xu@databricks.com> * update...
https://github.com/mlflow/mlflow.git
def _log_dataset_tag(self, client, run_id, model_uuid): existing_dataset_metadata_str = client.get_run(run_id).data.tags.get( "mlflow.datasets", "[]" ) dataset_metadata_list = json.loads(existing_dataset_metadata_str) for metadata in dataset_metadata_list: ...
124
base.py
Python
mlflow/models/evaluation/base.py
964f5ab75098c55f028f8acfeeae05df35ea68d5
mlflow
5
155,526
181
17
71
743
58
0
298
816
percentile
Replace `interpolation` with `method` and `method` with `internal_method` (#8525) Following the change in numpy 1.22.0 Co-authored-by: James Bourbeau <jrbourbeau@users.noreply.github.com>
https://github.com/dask/dask.git
def percentile(a, q, method="linear", internal_method="default", **kwargs): from .dispatch import percentile_lookup as _percentile from .utils import array_safe, meta_from_array allowed_internal_methods = ["default", "dask", "tdigest"] if method in allowed_internal_methods: warnings.warn(...
460
percentile.py
Python
dask/array/percentile.py
3c46e89aea2af010e69049cd638094fea2ddd576
dask
14
19,867
26
11
6
58
10
0
31
90
_dictionary
check point progress on only bringing in pip==22.0.4 (#4966) * vendor in pip==22.0.4 * updating vendor packaging version * update pipdeptree to fix pipenv graph with new version of pip. * Vendoring of pip-shims 0.7.0 * Vendoring of requirementslib 1.6.3 * Update pip index safety restrictions patch for p...
https://github.com/pypa/pipenv.git
def _dictionary(self) -> Dict[str, Any]: # NOTE: Dictionaries are not populated if not loaded. So, conditionals # are not needed here. retval = {} for variant in OVERRIDE_ORDER: retval.update(self._config[variant]) return retval
35
configuration.py
Python
pipenv/patched/notpip/_internal/configuration.py
f3166e673fe8d40277b804d35d77dcdb760fc3b3
pipenv
2
248,619
18
9
10
115
10
0
20
91
test_second_upgrade_from_same_user
Add more tests for room upgrades (#13074) Signed-off-by: Sean Quah <seanq@element.io>
https://github.com/matrix-org/synapse.git
def test_second_upgrade_from_same_user(self) -> None: channel1 = self._upgrade_room() self.assertEqual(200, channel1.code, channel1.result) channel2 = self._upgrade_room(expire_cache=False) self.assertEqual(200, channel2.code, channel2.result) self.assertEqual( ...
72
test_upgrade_room.py
Python
tests/rest/client/test_upgrade_room.py
99d3931974e65865d1102ee79d7b7e2b017a3180
synapse
1
33,812
95
13
20
280
22
0
128
336
shift_tokens_right
Update serving signatures and make sure we actually use them (#19034) * Override save() to use the serving signature as the default * Replace int32 with int64 in all our serving signatures * Remember one very important line so as not to break every test at once * Dtype fix for TFLED * dtype fix for shift_t...
https://github.com/huggingface/transformers.git
def shift_tokens_right(self, input_ids, start_token_id=None): if start_token_id is None: start_token_id = self.generator.config.decoder_start_token_id assert start_token_id is not None, ( "self.generator.config.decoder_start_token_id has to be defined. In Rag we...
179
modeling_tf_rag.py
Python
src/transformers/models/rag/modeling_tf_rag.py
2322eb8e2f9765cb73f59b324cc46a0e9cfe803f
transformers
2
8,165
46
13
23
276
29
0
65
162
test_render_config
Added tests for init_config and render_config CLI commands (#2551)
https://github.com/ludwig-ai/ludwig.git
def test_render_config(tmpdir): user_config_path = os.path.join(tmpdir, "config.yaml") input_features = [ number_feature(), number_feature(), category_feature(encoder={"vocab_size": 3}), category_feature(encoder={"vocab_size": 3}), ] output_features = [category_featu...
170
test_cli.py
Python
tests/integration_tests/test_cli.py
5a25d1f2a914c849cf978573c5993411151bc447
ludwig
1
167,440
23
10
19
100
16
0
27
70
parse_date_fields
TYP: more return annotations for io/* (#47524) * TYP: more return annotations for io/* * import future
https://github.com/pandas-dev/pandas.git
def parse_date_fields(year_col, month_col, day_col) -> npt.NDArray[np.object_]: warnings.warn( , # noqa: E501 FutureWarning, stacklevel=find_stack_level(), ) year_col = _maybe_cast(year_col) month_col = _maybe_cast(month_col) day_col = _maybe_cast(day_col) return p...
63
date_converters.py
Python
pandas/io/date_converters.py
e48c9c3973286e257f6da1966c91806d86b917e0
pandas
1
259,239
51
16
15
311
26
1
65
116
test_ohe_infrequent_two_levels_drop_frequent
ENH Adds infrequent categories to OneHotEncoder (#16018) * ENH Completely adds infrequent categories * STY Linting * STY Linting * DOC Improves wording * DOC Lint * BUG Fixes * CLN Address comments * CLN Address comments * DOC Uses math to description float min_frequency * DOC Adds comment r...
https://github.com/scikit-learn/scikit-learn.git
def test_ohe_infrequent_two_levels_drop_frequent(drop): X_train = np.array([["a"] * 5 + ["b"] * 20 + ["c"] * 10 + ["d"] * 3]).T ohe = OneHotEncoder( handle_unknown="infrequent_if_exist", sparse=False, max_categories=2, drop=drop ).fit(X_train) assert_array_equal(ohe.drop_idx_, [0]) X_...
@pytest.mark.parametrize("drop", [["a"], ["d"]])
165
test_encoders.py
Python
sklearn/preprocessing/tests/test_encoders.py
7f0006c8aad1a09621ad19c3db19c3ff0555a183
scikit-learn
1
281,449
72
15
40
419
42
0
90
286
get_newsletters
Terminal Wide Rich (#1161) * My idea for how we handle Rich moving forward * remove independent consoles * FIxed pylint issues * add a few vars * Switched print to console * More transitions * Changed more prints * Replaced all prints * Fixing tabulate * Finished replace tabulate * Finish...
https://github.com/OpenBB-finance/OpenBBTerminal.git
def get_newsletters() -> pd.DataFrame: urls = [ "https://defiweekly.substack.com/archive", "https://newsletter.thedefiant.io/archive", "https://thedailygwei.substack.com/archive", "https://todayindefi.substack.com/archive", "https://newsletter.banklesshq.com/archive", ...
242
substack_model.py
Python
gamestonk_terminal/cryptocurrency/defi/substack_model.py
82747072c511beb1b2672846ae2ee4aec53eb562
OpenBBTerminal
6
259,455
20
13
7
92
11
0
24
77
test_family_deprecation
ENH migrate GLMs / TweedieRegressor to linear loss (#22548) Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org> Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
https://github.com/scikit-learn/scikit-learn.git
def test_family_deprecation(est, family): with pytest.warns(FutureWarning, match="`family` was deprecated"): if isinstance(family, str): assert est.family == family else: assert est.family.__class__ == family.__class__ assert est.family.power == family.power
56
test_glm.py
Python
sklearn/linear_model/_glm/tests/test_glm.py
75a94f518f7bd7d0bf581ffb67d9f961e3c4efbc
scikit-learn
2
266,324
24
9
7
89
13
0
28
57
load_module
ansible-test - Fix plugin loading. This fixes a traceback when loading plugins that use dataclasses.
https://github.com/ansible/ansible.git
def load_module(path, name): # type: (str, str) -> None if name in sys.modules: return spec = importlib.util.spec_from_file_location(name, path) module = importlib.util.module_from_spec(spec) sys.modules[name] = module # noinspection PyUnresolvedReferences spec.loader.exec_module(...
54
util.py
Python
test/lib/ansible_test/_internal/util.py
7e814dd4db22d94ee61aaa57b7be630a9cdb598e
ansible
2
249,400
50
12
22
227
15
0
87
283
test_list_user_devices
Implement MSC3852: Expose `last_seen_user_agent` to users for their own devices; also expose to Admin API (#13549)
https://github.com/matrix-org/synapse.git
def test_list_user_devices(self) -> None: # Request all devices of "other user" channel = self.make_request( "GET", f"/_synapse/admin/v2/users/{self.other_user_id}/devices", access_token=self.admin_user_token, ) self.assertEqual(200, channel.c...
127
test_user.py
Python
tests/rest/admin/test_user.py
f9f03426de338ae1879e174f63adf698bbfc3a4b
synapse
1
42,585
14
12
5
79
7
0
16
59
wiki_dict
Support both iso639-3 codes and BCP-47 language tags (#3060) * Add support for iso639-3 language codes * Add support for retired language codes * Move langnames.py to the top-level * Add langcode() function * Add iso639retired dictionary * Improve wrapper functions * Add module docstring with doctest...
https://github.com/nltk/nltk.git
def wiki_dict(self, lines): return { pair[1]: pair[0].split("/")[-1] for pair in [line.strip().split("\t") for line in lines] }
48
bcp47.py
Python
nltk/corpus/reader/bcp47.py
f019fbedb3d2b6a2e6b58ec1b38db612b106568b
nltk
3
267,625
51
12
11
106
11
1
68
202
_fail_on_undefined
Move undefined check from concat to finalize (#78165) * Move undefined check from concat to finalize In the classic Jinja2's Environment str() is called on the return value of the finalize method to potentially trigger the undefined error. That is not the case in NativeEnvironment where string conversion of the r...
https://github.com/ansible/ansible.git
def _fail_on_undefined(data): if isinstance(data, Mapping): for value in data.values(): _fail_on_undefined(value) elif is_sequence(data): for item in data: _fail_on_undefined(item) else: if isinstance(data, StrictUndefined): # To actually rais...
@_unroll_iterator
58
__init__.py
Python
lib/ansible/template/__init__.py
17d52c8d647c4181922db42c91dc2828cdd79387
ansible
6
276,923
41
17
14
128
7
0
48
122
ask_to_proceed_with_overwrite
Reformatting the codebase with black. PiperOrigin-RevId: 450093126
https://github.com/keras-team/keras.git
def ask_to_proceed_with_overwrite(filepath): overwrite = ( input("[WARNING] %s already exists - overwrite? " "[y/n]" % (filepath)) .strip() .lower() ) while overwrite not in ("y", "n"): overwrite = ( input('Enter "y" (overwrite) or "n" ' "(cancel).").strip()....
67
io_utils.py
Python
keras/utils/io_utils.py
84afc5193d38057e2e2badf9c889ea87d80d8fbf
keras
3
107,813
33
15
12
148
8
0
51
140
_strip_comment
Support quoted strings in matplotlibrc This enables using the comment character # within strings. Closes #19288. Superseeds #22565.
https://github.com/matplotlib/matplotlib.git
def _strip_comment(s): pos = 0 while True: quote_pos = s.find('"', pos) hash_pos = s.find('#', pos) if quote_pos < 0: without_comment = s if hash_pos < 0 else s[:hash_pos] return without_comment.strip() elif 0 <= hash_pos < quote_pos: retu...
89
__init__.py
Python
lib/matplotlib/cbook/__init__.py
7c378a8f3f30ce57c874a851f3af8af58f1ffdf6
matplotlib
5
316,438
9
10
21
45
6
0
9
18
test_default_discovery_abort_on_new_unique_flow
Search/replace RESULT_TYPE_* by FlowResultType enum (#74642)
https://github.com/home-assistant/core.git
async def test_default_discovery_abort_on_new_unique_flow(hass, manager): mock_integration(hass, MockModule("comp")) mock_entity_platform(hass, "config_flow.comp", None)
165
test_config_entries.py
Python
tests/test_config_entries.py
7cd68381f1d4f58930ffd631dfbfc7159d459832
core
1
309,019
7
10
2
38
2
0
7
13
_rear_left_tire_pressure_supported
Use SensorEntityDescription in Mazda integration (#63423) * Use SensorEntityDescription in Mazda integration * Change lambdas to functions * Minor fixes * Address review comments
https://github.com/home-assistant/core.git
def _rear_left_tire_pressure_supported(data): return data["status"]["tirePressure"]["rearLeftTirePressurePsi"] is not None
20
sensor.py
Python
homeassistant/components/mazda/sensor.py
8915b73f724b58e93284a823c0d2e99fbfc13e84
core
1
286,572
33
10
24
139
15
0
37
188
_get_base_market_data_info
[IMPROVE] Fix Docstring formatting/Fix missing, incomplete type hints (#3412) * Fixes * Update stocks_helper.py * update git-actions set-output to new format * Update stocks_helper.py * Update terminal_helper.py * removed LineAnnotateDrawer from qa_view * lint * few changes * updates * sdk a...
https://github.com/OpenBB-finance/OpenBBTerminal.git
def _get_base_market_data_info(self) -> Union[Dict[str, Any], Any]: market_dct = {} market_data = self.coin.get("market_data", {}) for stat in [ "total_supply", "max_supply", "circulating_supply", "price_change_percentage_24h", ...
84
pycoingecko_model.py
Python
openbb_terminal/cryptocurrency/due_diligence/pycoingecko_model.py
59d8b36bb0467a1a99513b10e8b8471afaa56fd6
OpenBBTerminal
2
276,919
20
8
4
31
5
0
21
43
is_interactive_logging_enabled
Reformatting the codebase with black. PiperOrigin-RevId: 450093126
https://github.com/keras-team/keras.git
def is_interactive_logging_enabled(): # Use `getattr` in case `INTERACTIVE_LOGGING` # does not have the `enable` attribute. return getattr( INTERACTIVE_LOGGING, "enable", keras_logging.INTERACTIVE_LOGGING_DEFAULT )
16
io_utils.py
Python
keras/utils/io_utils.py
84afc5193d38057e2e2badf9c889ea87d80d8fbf
keras
1
26,585
18
12
5
79
10
0
21
44
check_permissions_for_custom_prices
Custom prices (#9393) * Add price_override to CheckoutLine model * Allow to define custom price in checkout mutations * Apply code review suggestions * Use custom price when generating checkout payload * Use price override when calculating prices for checkout * Update populatedb - create checkout with c...
https://github.com/saleor/saleor.git
def check_permissions_for_custom_prices(app, lines): if any(["price" in line for line in lines]) and ( not app or not app.has_perm(CheckoutPermissions.HANDLE_CHECKOUTS) ): raise PermissionDenied(permissions=[CheckoutPermissions.HANDLE_CHECKOUTS])
48
utils.py
Python
saleor/graphql/checkout/mutations/utils.py
620569b3a2466e8dda80df20a11b99ec0bec8c7c
saleor
5
249,085
37
10
23
191
17
0
52
246
test_update_no_display_name
Use literals in place of `HTTPStatus` constants in tests (#13469)
https://github.com/matrix-org/synapse.git
def test_update_no_display_name(self) -> None: # Set iniital display name. update = {"display_name": "new display"} self.get_success( self.handler.update_device( self.other_user, self.other_user_device_id, update ) ) channel = sel...
119
test_device.py
Python
tests/rest/admin/test_device.py
c97042f7eef3748e17c90e48a4122389a89c4735
synapse
1
314,793
7
8
3
42
6
1
7
12
device2_zone_slave
Rewrite SoundTouch tests to use mocked payloads (#72984)
https://github.com/home-assistant/core.git
def device2_zone_slave() -> str: return load_fixture("soundtouch/device2_getZone_slave.xml") @pytest.fixture(scope="session")
@pytest.fixture(scope="session")
12
conftest.py
Python
tests/components/soundtouch/conftest.py
efbd47c828c6c2e1cd967df2a4cefd2b00c60c25
core
1
300,061
18
9
7
95
11
0
24
45
test_entity_registry
Add buttons to Ring chime devices to play ding and motion chimes (#71370) Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
https://github.com/home-assistant/core.git
async def test_entity_registry(hass, requests_mock): await setup_platform(hass, Platform.BUTTON) entity_registry = er.async_get(hass) entry = entity_registry.async_get("button.downstairs_play_chime_ding") assert entry.unique_id == "123456-play-chime-ding" entry = entity_registry.async_get("bu...
53
test_button.py
Python
tests/components/ring/test_button.py
c22cf3b3d2e4d079499473500abf8a73e5b80163
core
1
308,131
74
15
33
331
22
0
90
464
test_no_mode_no_state
Add deconz current hvac operation to thermostate based on "state" (#59989) * deconz - add current hvac operation to thermostate based on "state" * deconz - extend current hvac operation to thermostate based on "state" and "mode" * Add tests for current hvac action * Add boost mode as special case * format ...
https://github.com/home-assistant/core.git
async def test_no_mode_no_state(hass, aioclient_mock, mock_deconz_websocket): data = { "sensors": { "0": { "config": { "battery": 25, "heatsetpoint": 2222, "mode": None, "preset": "auto", ...
181
test_climate.py
Python
tests/components/deconz/test_climate.py
7a6897c7578dffd6b67f57747ebd81b67b153e01
core
1
303,576
24
12
6
83
9
0
28
49
test_parse_mapping_physical_address
Add tests for the HDMI-CEC integration (#75094) * Add basic tests to the HDMI-CEC component * Add tests for the HDMI-CEC switch component * Add test for watchdog code * Start adding tests for the HDMI-CEC media player platform Also some cleanup and code move. * Add more tests for media_player And cle...
https://github.com/home-assistant/core.git
def test_parse_mapping_physical_address(mapping, expected): result = parse_mapping(mapping) result = [ (r[0], str(r[1]) if isinstance(r[1], PhysicalAddress) else r[1]) for r in result ] assert result == expected # Test Setup
55
test_init.py
Python
tests/components/hdmi_cec/test_init.py
7cd4be1310b3f76398b4404d3f4ecb26b9533cee
core
3
176,214
85
10
28
418
23
0
169
423
test_from_scipy_sparse_array_parallel_edges
Use scipy.sparse array datastructure (#5139) * Step 1: use sparse arrays in nx.to_scipy_sparse_matrix. Seems like a reasonable place to start. nx.to_scipy_sparse_matrix is one of the primary interfaces to scipy.sparse from within NetworkX. * 1: Use np.outer instead of mult col/row vectors Fix two instances ...
https://github.com/networkx/networkx.git
def test_from_scipy_sparse_array_parallel_edges(self): A = sp.sparse.csr_array([[1, 1], [1, 2]]) # First, with a simple graph, each integer entry in the adjacency # matrix is interpreted as the weight of a single edge in the graph. expected = nx.DiGraph() edges = [(0, 0)...
287
test_convert_scipy.py
Python
networkx/tests/test_convert_scipy.py
5dfd57af2a141a013ae3753e160180b82bec9469
networkx
3
147,843
72
17
40
245
27
1
92
357
train_one_step
[RLlib] Rewrite PPO to use training_iteration + enable DD-PPO for Win32. (#23673)
https://github.com/ray-project/ray.git
def train_one_step(trainer, train_batch, policies_to_train=None) -> Dict: config = trainer.config workers = trainer.workers local_worker = workers.local_worker() num_sgd_iter = config.get("num_sgd_iter", 1) sgd_minibatch_size = config.get("sgd_minibatch_size", 0) learn_timer = trainer._ti...
@DeveloperAPI
151
train_ops.py
Python
rllib/execution/train_ops.py
00922817b66ee14ba215972a98f416f3d6fef1ba
ray
5
291,630
11
11
4
55
11
0
11
32
device_class
Simplify use of binary sensor device classes in MySensors (#82946)
https://github.com/home-assistant/core.git
def device_class(self) -> BinarySensorDeviceClass | None: pres = self.gateway.const.Presentation return SENSORS.get(pres(self.child_type).name)
33
binary_sensor.py
Python
homeassistant/components/mysensors/binary_sensor.py
c36dd1778022defb11854532851ee5af10734313
core
1
127,496
6
6
3
22
4
0
6
20
scheme
[Datasets] Rename `PathPartitionScheme` as `Partitioning` (#28397)
https://github.com/ray-project/ray.git
def scheme(self) -> Partitioning: return self._scheme
12
partitioning.py
Python
python/ray/data/datasource/partitioning.py
15f30de59327acee491fb0d5a51e5e1f6b194929
ray
1
20,193
6
6
3
22
4
0
6
20
user_state_dir
check point progress on only bringing in pip==22.0.4 (#4966) * vendor in pip==22.0.4 * updating vendor packaging version * update pipdeptree to fix pipenv graph with new version of pip. * Vendoring of pip-shims 0.7.0 * Vendoring of requirementslib 1.6.3 * Update pip index safety restrictions patch for p...
https://github.com/pypa/pipenv.git
def user_state_dir(self) -> str: return self.user_data_dir
12
android.py
Python
pipenv/patched/notpip/_vendor/platformdirs/android.py
f3166e673fe8d40277b804d35d77dcdb760fc3b3
pipenv
1
300,899
48
15
26
242
18
0
69
307
test_deconz_events_bad_unique_id
Clean up accessing device_registry helpers via hass (#72031)
https://github.com/home-assistant/core.git
async def test_deconz_events_bad_unique_id(hass, aioclient_mock, mock_deconz_websocket): data = { "sensors": { "1": { "name": "Switch 1 no unique id", "type": "ZHASwitch", "state": {"buttonevent": 1000}, "config": {}, ...
135
test_deconz_event.py
Python
tests/components/deconz/test_deconz_event.py
c3d19f38274935ab8f784e6fbeb7c5959a551074
core
1
118,169
193
13
146
1,388
31
0
596
1,619
test_version_managing
join_learn_process in test comments in migraion env.py
https://github.com/mindsdb/mindsdb.git
def test_version_managing(self, data_handler): # set up df = pd.DataFrame([ {'a': 1, 'b': dt.datetime(2020, 1, 1)}, {'a': 2, 'b': dt.datetime(2020, 1, 2)}, {'a': 1, 'b': dt.datetime(2020, 1, 3)}, ]) self.set_handler(data_handler, name='pg', tables={'t...
761
test_project_structure.py
Python
tests/unit/test_project_structure.py
0628b7dd82debc0998c86f6ad7b46f23374b35b6
mindsdb
5
3,800
20
10
6
93
16
0
23
65
test_less_jobs
🎉 🎉 Source FB Marketing: performance and reliability fixes (#9805) * Facebook Marketing performance improvement * add comments and little refactoring * fix integration tests with the new config * improve job status handling, limit concurrency to 10 * fix campaign jobs, refactor manager * big refactori...
https://github.com/airbytehq/airbyte.git
def test_less_jobs(self, api, started_job, batch): jobs = [started_job for _ in range(49)] update_in_batch(api=api, jobs=jobs) assert started_job.update_job.call_count == 49 assert len(api.new_batch.return_value) == 49 batch.execute.assert_called_once()
60
test_async_job.py
Python
airbyte-integrations/connectors/source-facebook-marketing/unit_tests/test_async_job.py
a3aae8017a0a40ff2006e2567f71dccb04c997a5
airbyte
2
212,520
6
8
6
31
5
0
6
20
app_paths
Normalize built-in types and remove `Unknown` (#12252) * Use lower case names for built-in types Also incidentally apply TypeAlias marker. * Drop `Unknown` in favour of consistent usage of `Any` * Enable lazy annotations in conftest.py
https://github.com/bokeh/bokeh.git
def app_paths(self) -> set[str]: return set(self._applications)
18
tornado.py
Python
bokeh/server/tornado.py
528d85e642340ef30ec91f30b65c7c43370f648d
bokeh
1
281,551
18
11
20
129
13
0
25
60
print_help
Terminal Wide Rich (#1161) * My idea for how we handle Rich moving forward * remove independent consoles * FIxed pylint issues * add a few vars * Switched print to console * More transitions * Changed more prints * Replaced all prints * Fixing tabulate * Finished replace tabulate * Finish...
https://github.com/OpenBB-finance/OpenBBTerminal.git
def print_help(self): has_option_start = "" if self.options else "[unvl]" has_option_end = "" if self.options else "[/unvl]" help_text = f console.print(text=help_text, menu="Stocks - Options - Payoff")
40
payoff_controller.py
Python
gamestonk_terminal/stocks/options/payoff_controller.py
82747072c511beb1b2672846ae2ee4aec53eb562
OpenBBTerminal
3
113,521
16
12
8
60
7
0
17
49
absolute_scope
Mutable V3 (Stage 1) - Label namespace and utilities (#5194)
https://github.com/microsoft/nni.git
def absolute_scope(self) -> str: if self.path is None: raise ValueError(f'label_scope "{self.scope_name}" is not entered yet.') return '/'.join(self.path)
30
utils.py
Python
nni/mutable/utils.py
6641d309ac6e98c69295ac3d59bf7fa23bdb6588
nni
2
297,162
21
9
8
87
16
0
25
49
test_with_stop
Blebox add thermoBox to climate (#81090) Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
https://github.com/home-assistant/core.git
async def test_with_stop(gatebox, hass): feature_mock, entity_id = gatebox opening_to_stop_feature_mock(feature_mock) feature_mock.has_stop = True await async_setup_entity(hass, entity_id) state = hass.states.get(entity_id) supported_features = state.attributes[ATTR_SUPPORTED_FEATURES] ...
53
test_cover.py
Python
tests/components/blebox/test_cover.py
923fa473e171fcdf396556ea200612e378f9b0a5
core
1