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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
291,567 | 40 | 10 | 11 | 173 | 9 | 0 | 56 | 181 | test_valid_country | Add valid country tests to workday sensors (#82799)
fixes undefined | https://github.com/home-assistant/core.git | def test_valid_country(self):
# Invalid UTF-8, must not contain U+D800 to U+DFFF
with pytest.raises(vol.Invalid):
binary_sensor.valid_country("\ud800")
with pytest.raises(vol.Invalid):
binary_sensor.valid_country("\udfff")
# Country MUST NOT be empty
... | 90 | test_binary_sensor.py | Python | tests/components/workday/test_binary_sensor.py | eb25968b31dcf76d6790cee99ff30ead3d27b8af | core | 2 | |
216,560 | 12 | 9 | 3 | 50 | 6 | 1 | 15 | 20 | _pyeapi_conn | Deprecated netmiko_conn and pyeapi_conn in napalm_mod.py as these function should not be called from the CLI | https://github.com/saltstack/salt.git | def _pyeapi_conn(**kwargs):
pyeapi_kwargs = pyeapi_nxos_api_args(**kwargs)
return __salt__["pyeapi.get_connection"](**pyeapi_kwargs)
# ----------------------------------------------------------------------------------------------------------------------
# callable functions
# ----------------------------... | @proxy_napalm_wrap | 23 | napalm_mod.py | Python | salt/modules/napalm_mod.py | d8305bfaa7b98d898f5963b01ca75f277c266322 | salt | 1 |
80,135 | 45 | 13 | 39 | 638 | 18 | 0 | 61 | 402 | test_blocks_and_data_not_operated_on_intact | Add tests for streamfield migration helpers
Currently failing due to wagtail-factories being broken on Wagtail 4.1: https://github.com/wagtail/wagtail-factories/issues/65 | https://github.com/wagtail/wagtail.git | def test_blocks_and_data_not_operated_on_intact(self):
altered_raw_data = apply_changes_to_raw_data(
raw_data=self.raw_data,
block_path_str="nestedstruct.stream1",
operation=RenameStreamChildrenOperation(
old_name="char1", new_name="renamed1"
... | 394 | test_nested_structures.py | Python | wagtail/tests/streamfield_migrations/test_nested_structures.py | ad65741b94f36fbe793cf15f0ab002482070cdb6 | wagtail | 3 | |
246,920 | 18 | 6 | 27 | 15 | 2 | 0 | 19 | 40 | test_third_party_rules | Replace assertEquals and friends with non-deprecated versions. (#12092) | https://github.com/matrix-org/synapse.git | def test_third_party_rules(self):
# patch the rules module with a Mock which will return False for some event
# types | 194 | test_third_party_rules.py | Python | tests/rest/client/test_third_party_rules.py | 02d708568b476f2f7716000b35c0adfa4cbd31b3 | synapse | 2 | |
275,783 | 40 | 9 | 20 | 203 | 21 | 0 | 44 | 232 | get_config | Reformatting the codebase with black.
PiperOrigin-RevId: 450093126 | https://github.com/keras-team/keras.git | def get_config(self):
json_word_counts = json.dumps(self.word_counts)
json_word_docs = json.dumps(self.word_docs)
json_index_docs = json.dumps(self.index_docs)
json_word_index = json.dumps(self.word_index)
json_index_word = json.dumps(self.index_word)
return {
... | 121 | text.py | Python | keras/preprocessing/text.py | 84afc5193d38057e2e2badf9c889ea87d80d8fbf | keras | 1 | |
169,041 | 50 | 12 | 21 | 192 | 18 | 0 | 75 | 277 | _process_converter | TYP: Autotyping (#48191)
* annotate-magics
* annotate-imprecise-magics
* none-return
* scalar-return
* pyi files
* ignore vendored file
* manual changes
* ignore pyright in pickle_compat (these errors would be legit if the current __new__ methods were called but I think these pickle tests call old... | https://github.com/pandas-dev/pandas.git | def _process_converter(self, f, filt=None) -> None:
if filt is None:
filt = lambda col, c: True
obj = self.obj
assert obj is not None # for mypy
needs_new_obj = False
new_obj = {}
for i, (col, c) in enumerate(obj.items()):
if filt(col, ... | 122 | _json.py | Python | pandas/io/json/_json.py | 54347fe684e0f7844bf407b1fb958a5269646825 | pandas | 6 | |
257,510 | 7 | 6 | 109 | 13 | 1 | 0 | 7 | 13 | tutorial14_query_classifier | Tutorial 14 edit (#2663)
* Rewrite Tutorial 14 for increased user-friendliness
* Update Tutorial14 .py file to match .ipynb file
* Update Documentation & Code Style
* unblock the ci
* ignore error in jitterbit/get-changed-files
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.nore... | https://github.com/deepset-ai/haystack.git | def tutorial14_query_classifier():
# Useful for framing headers | 728 | Tutorial14_Query_Classifier.py | Python | tutorials/Tutorial14_Query_Classifier.py | b87c0c950b2243f47fb249aa3865d4c46edb16df | haystack | 5 | |
273,362 | 11 | 10 | 6 | 68 | 9 | 0 | 15 | 41 | listify_tensors | Reformatting the codebase with black.
PiperOrigin-RevId: 450093126 | https://github.com/keras-team/keras.git | def listify_tensors(x):
if tf.is_tensor(x):
x = x.numpy()
if isinstance(x, np.ndarray):
x = x.tolist()
return x
| 40 | preprocessing_utils.py | Python | keras/layers/preprocessing/preprocessing_utils.py | 84afc5193d38057e2e2badf9c889ea87d80d8fbf | keras | 3 | |
42,118 | 27 | 10 | 4 | 219 | 21 | 0 | 27 | 90 | tick_params | Adding Grid.tick_params() method. (#2944)
* Adding Grid.tick_params() method.
* Address PR comments.
* Add What's New entry.
* Switch tick_params() test to use pad. | https://github.com/mwaskom/seaborn.git | def tick_params(self, axis='both', **kwargs):
for ax in self.figure.axes:
ax.tick_params(axis=axis, **kwargs)
return self
_facet_docs = dict(
data=dedent(),
rowcol=dedent(),
rowcol_order=dedent(),
col_wrap=dedent(),
share_xy=dedent(),
height=dedent(),
... | 35 | axisgrid.py | Python | seaborn/axisgrid.py | 72d1322ee583eb481346e5e661c2998c8a7445dd | seaborn | 2 | |
178,331 | 23 | 13 | 13 | 89 | 10 | 0 | 29 | 140 | isDebianPackagePython | Plugins: Avoid warning from pkg_resources for deprecated versions
* We don't care about these, and this warning makes it look like
we are doing something wrong. | https://github.com/Nuitka/Nuitka.git | def isDebianPackagePython():
if not isLinux():
return False
if python_version < 0x300:
return hasattr(sys, "_multiarch")
else:
with withNoDeprecationWarning():
try:
from distutils.dir_util import _multiarch
except ImportError:
... | 49 | PythonFlavors.py | Python | nuitka/PythonFlavors.py | 51e4ae8239bd7824ec3c117780be82e1193b2f7a | Nuitka | 4 | |
314,865 | 38 | 10 | 15 | 225 | 23 | 0 | 67 | 118 | test_pushed_variable_status_change | Add tests for LCN sensor and binary_sensor platforms (#67263) | https://github.com/home-assistant/core.git | async def test_pushed_variable_status_change(hass, entry, lcn_connection):
device_connection = get_device_connection(hass, (0, 7, False), entry)
address = LcnAddr(0, 7, False)
# push status variable
inp = ModStatusVar(address, Var.VAR1, VarValue.from_celsius(42))
await device_connection.async_... | 148 | test_sensor.py | Python | tests/components/lcn/test_sensor.py | b7b8feda0ffb7487954545c96c50e7f64e2195bc | core | 1 | |
243,060 | 13 | 9 | 3 | 59 | 7 | 0 | 13 | 34 | textsize | add textbbox and textlength to ImageDraw2 and update tests | https://github.com/python-pillow/Pillow.git | def textsize(self, text, font):
deprecate("textsize", 10, "textbbox or textlength")
return self.draw.textsize(text, font=font.font, __internal__=True)
| 37 | ImageDraw2.py | Python | src/PIL/ImageDraw2.py | 1bf87556ef9953eeea5751714d87bdcc98b49702 | Pillow | 1 | |
100,727 | 24 | 13 | 15 | 105 | 13 | 0 | 28 | 102 | _check_valid_data | Bugfixes:
- Stats graph - Handle NaNs in data
- logger - de-elevate matplotlib font messages | https://github.com/deepfakes/faceswap.git | def _check_valid_data(self) -> bool:
logger.debug("Validating data. %s",
{key: len(val) for key, val in self._display_data.stats.items()})
if any(len(val) == 0 # pylint:disable=len-as-condition
for val in self._display_data.stats.values()):
retur... | 64 | popup_session.py | Python | lib/gui/popup_session.py | afec52309326304f4323029039e49bfcf928ef43 | faceswap | 4 | |
268,720 | 37 | 10 | 5 | 71 | 7 | 0 | 47 | 112 | cgroupns_option_supported | ansible-test - Improve container management. (#78550)
See changelogs/fragments/ansible-test-container-management.yml for details. | https://github.com/ansible/ansible.git | def cgroupns_option_supported(self) -> bool:
if self.engine == 'docker':
# Docker added support for the `--cgroupns` option in version 20.10.
# Both the client and server must support the option to use it.
# See: https://docs.docker.com/engine/release-notes/#20100
... | 42 | docker_util.py | Python | test/lib/ansible_test/_internal/docker_util.py | cda16cc5e9aa8703fb4e1ac0a0be6b631d9076cc | ansible | 3 | |
216,118 | 60 | 14 | 28 | 379 | 20 | 0 | 78 | 280 | test_remove_not_installed | Fix exception in yumpkg.remove for not installed package | https://github.com/saltstack/salt.git | def test_remove_not_installed():
name = "foo"
list_pkgs_mock = MagicMock(return_value={})
cmd_mock = MagicMock(
return_value={"pid": 12345, "retcode": 0, "stdout": "", "stderr": ""}
)
salt_mock = {
"cmd.run_all": cmd_mock,
"lowpkg.version_cmp": rpm.version_cmp,
"... | 212 | test_yumpkg.py | Python | tests/pytests/unit/modules/test_yumpkg.py | 8ea5342cbde034383938e244cdb16a0bf8a777e8 | salt | 1 | |
177,017 | 18 | 8 | 8 | 100 | 7 | 0 | 21 | 77 | test_naive_lowest_common_ancestor2 | Naive lowest common ancestor implementation (#5736)
* Add naive lca methods
* Naive algorithm implementation for LCA
* Modify naive lca functions
* Correct parameters of nx.ancestors
* Update lowest_common_ancestors.py
* Parametrize tests
* Apply suggestions from code review
Co-authored-by: Dan Sc... | https://github.com/networkx/networkx.git | def test_naive_lowest_common_ancestor2(self):
G = nx.DiGraph()
G.add_edge(0, 1)
G.add_edge(2, 0)
G.add_edge(2, 3)
G.add_edge(4, 0)
G.add_edge(5, 2)
assert naive_lca(G, 1, 3) == 2
| 64 | test_lowest_common_ancestors.py | Python | networkx/algorithms/tests/test_lowest_common_ancestors.py | b2f91c34a23058dd70b41784af0d87890216026a | networkx | 1 | |
141,325 | 17 | 9 | 3 | 73 | 8 | 0 | 18 | 39 | all | [Data/AIR] Move `TensorExtension` to `ray.air` for use in other packages (#25517)
Moves Tensor extensions to ray.air to facilitate their use in other Ray libraries (AIR, Serve). | https://github.com/ray-project/ray.git | def all(self, axis=None, out=None, keepdims=False):
result = self._tensor.all(axis=axis, out=out, keepdims=keepdims)
return result if axis is None else TensorArray(result)
| 49 | pandas.py | Python | python/ray/air/util/tensor_extensions/pandas.py | e0a63f770f9afd6eda2d4da9bf508067429585ae | ray | 2 | |
46,701 | 23 | 13 | 9 | 103 | 9 | 0 | 27 | 118 | redirect_or_json | Add details drawer to Grid View (#22123)
* make UI and tree work with mapped tasks
basic slide drawer
reformat grid background colors
improve rendering and add selected dag run
fix hover and extra prop
switch from drawer to details section
add tooltip info to details
use API
make side panel col... | https://github.com/apache/airflow.git | def redirect_or_json(origin, msg, status=""):
if request.headers.get('Accept') == 'application/json':
return {'status': status, 'message': msg}
else:
if status:
flash(msg, status)
else:
flash(msg)
return redirect(origin)
############################... | 56 | views.py | Python | airflow/www/views.py | 2bb26a38070a4b949bfb210ef1d5644e016e373a | airflow | 3 | |
164,472 | 24 | 12 | 15 | 141 | 13 | 0 | 31 | 78 | test_assert_extension_array_equal_less_precise | ⬆️ UPGRADE: Autoupdate pre-commit config (#45752)
Co-authored-by: MarcoGorelli <MarcoGorelli@users.noreply.github.com> | https://github.com/pandas-dev/pandas.git | def test_assert_extension_array_equal_less_precise(decimals):
rtol = 0.5 * 10**-decimals
arr1 = SparseArray([0.5, 0.123456])
arr2 = SparseArray([0.5, 0.123457])
if decimals >= 5:
msg =
with pytest.raises(AssertionError, match=msg):
tm.assert_extension_array_equal(arr1, arr... | 89 | test_assert_extension_array_equal.py | Python | pandas/tests/util/test_assert_extension_array_equal.py | 419331c598a097896edae40bc0687e4127f97b6b | pandas | 2 | |
34,808 | 47 | 11 | 7 | 150 | 21 | 0 | 57 | 113 | register_for_auto_class | Save code of registered custom models (#15379)
* Allow dynamic modules to use relative imports
* Work for configs
* Fix last merge conflict
* Save code of registered custom objects
* Map strings to strings
* Fix test
* Add tokenizer
* Rework tests
* Tests
* Ignore fixtures py files for tests... | https://github.com/huggingface/transformers.git | def register_for_auto_class(cls, auto_class="FlaxAutoModel"):
if not isinstance(auto_class, str):
auto_class = auto_class.__name__
import transformers.models.auto as auto_module
if not hasattr(auto_module, auto_class):
raise ValueError(f"{auto_class} is not a v... | 52 | modeling_flax_utils.py | Python | src/transformers/modeling_flax_utils.py | 44b21f117bcf71e3d88a11c3523c94b27949fdbf | transformers | 3 | |
125,444 | 26 | 13 | 7 | 102 | 12 | 1 | 30 | 74 | process_dict_for_yaml_dump | [Serve] Fix Formatting of Error Messages printed in `serve status` (#26578) | https://github.com/ray-project/ray.git | def process_dict_for_yaml_dump(data):
for k, v in data.items():
if isinstance(v, dict):
data[k] = process_dict_for_yaml_dump(v)
elif isinstance(v, str):
data[k] = remove_ansi_escape_sequences(v)
return data
@click.group(help="CLI for managing Serve instances on a... | @click.group(help="CLI for managing Serve instances on a Ray cluster.") | 53 | scripts.py | Python | python/ray/serve/scripts.py | b856daebbdc923a216ce412be477c61e6cc5707e | ray | 4 |
247,436 | 77 | 12 | 48 | 391 | 20 | 0 | 138 | 577 | test_redact_relation_thread | Invalidate caches when an event with a relation is redacted. (#12121)
The caches for the target of the relation must be cleared
so that the bundled aggregations are re-calculated after
the redaction is processed. | https://github.com/matrix-org/synapse.git | def test_redact_relation_thread(self) -> None:
channel = self._send_relation(
RelationTypes.THREAD,
EventTypes.Message,
content={"body": "reply 1", "msgtype": "m.text"},
)
self.assertEqual(200, channel.code, channel.json_body)
unredacted_event... | 238 | test_relations.py | Python | tests/rest/client/test_relations.py | f63bedef07360216a8de71dc38f00f1aea503903 | synapse | 1 | |
20,848 | 18 | 12 | 8 | 67 | 8 | 0 | 23 | 80 | _extra_width | 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 _extra_width(self) -> int:
width = 0
if self.box and self.show_edge:
width += 2
if self.box:
width += len(self.columns) - 1
return width
| 40 | table.py | Python | pipenv/patched/notpip/_vendor/rich/table.py | f3166e673fe8d40277b804d35d77dcdb760fc3b3 | pipenv | 4 | |
159,357 | 6 | 7 | 3 | 27 | 3 | 0 | 6 | 20 | required_packages | Add Logistic Regression to our NLU classifiers. (#10650)
* added-logistic-regression
* added
* d0h! gotta copy the imports correctly
* run black
* black issues fixed
* stash
* added tolerance hyperparam
* added random seed
* fixed testing path
* ran black
* use joblib directly
* insura... | https://github.com/RasaHQ/rasa.git | def required_packages() -> List[Text]:
return ["sklearn"]
| 14 | logistic_regression_classifier.py | Python | rasa/nlu/classifiers/logistic_regression_classifier.py | dc762814317ce46873a5226ee09033031a7d3604 | rasa | 1 | |
136,360 | 33 | 12 | 9 | 94 | 9 | 0 | 36 | 123 | delete_job | [Jobs] Add DELETE endpoint (#30056)
Adds a DELETE endpoint to the REST API, SDK and CLI for Ray Jobs.
Before this, there was no way to delete the job info from the cluster, so the memory could potentially grow without bound.
Deleting a job immediately deletes all its associated info (status, metadata) from memor... | https://github.com/ray-project/ray.git | async def delete_job(self, job_id):
job_status = await self._job_info_client.get_status(job_id)
if job_status is None or not job_status.is_terminal():
raise RuntimeError(
f"Attempted to delete job '{job_id}', "
f"but it is in a non-terminal state {jo... | 50 | job_manager.py | Python | dashboard/modules/job/job_manager.py | 1639914ba5a37ed56a644fdb4c712f6da064746c | ray | 3 | |
290,402 | 17 | 11 | 9 | 91 | 11 | 0 | 20 | 92 | async_media_play_pause | Update mypy to 0.990 (#81783)
* Update mypy to 0.990
* Remove type ignore - overriding attr with property (13475)
* Remove type ignores - hasattr (13544)
* Adjust type ignore - assignment (13549)
* New error code - type-abstract (13785)
* Disable annotation-unchecked (13851) | https://github.com/home-assistant/core.git | async def async_media_play_pause(self) -> None:
if hasattr(self, "media_play_pause"):
await self.hass.async_add_executor_job(self.media_play_pause)
return
if self.state == MediaPlayerState.PLAYING:
await self.async_media_pause()
else:
awa... | 51 | __init__.py | Python | homeassistant/components/media_player/__init__.py | 0c8eeaa6436b04ba6da46bccab8b11523f314d9b | core | 3 | |
180,405 | 134 | 15 | 113 | 1,287 | 38 | 0 | 279 | 1,685 | test_component_functions | Wrap dataframe (#1571)
* add suport for table cell wrapping
* revert pkginfo change
* revert pkginfo change
* fixed tests
* formatting
* type hint
Co-authored-by: Abubakar Abid <abubakar@huggingface.co> | https://github.com/gradio-app/gradio.git | def test_component_functions(self):
x_data = [["Tim", 12, False], ["Jan", 24, True]]
dataframe_input = gr.Dataframe(headers=["Name", "Age", "Member"])
output = dataframe_input.preprocess(x_data)
self.assertEqual(output["Age"][1], 24)
self.assertEqual(output["Member"][0],... | 780 | test_components.py | Python | test/test_components.py | 8710d3a079d38b857620ec6f1bb4d261ae242263 | gradio | 1 | |
108,514 | 33 | 12 | 11 | 130 | 17 | 0 | 44 | 166 | _sci | Cleanup documentation generation for pyplot
- remove the awkward `pyplot.plotting()` function, which only served
as a namespace to take up the docs for pyplot and output them via
`.. autofunction`
- Instead generate the same information using `.. autosummary::`. We
have to list the desired methods here explicitl... | https://github.com/matplotlib/matplotlib.git | def _sci(self, im):
_api.check_isinstance(
(mpl.contour.ContourSet, mcoll.Collection, mimage.AxesImage),
im=im)
if isinstance(im, mpl.contour.ContourSet):
if im.collections[0] not in self._children:
raise ValueError("ContourSet must be in curr... | 81 | _base.py | Python | lib/matplotlib/axes/_base.py | 032316bc6c7798fca6c82de24167c975f237687f | matplotlib | 4 | |
113,697 | 23 | 10 | 11 | 113 | 12 | 0 | 36 | 63 | hook_to_dtype_layout | fix(speedup): support for a special torchscript op 'aten::to.layout' with no corresponding torch.to (#5178) | https://github.com/microsoft/nni.git | def hook_to_dtype_layout(positional, keyword, undetermined, undetermined_special_treat):
assert 'layout' not in undetermined
assert 'pin_memory' not in undetermined
assert 'non_blocking' not in undetermined
to_layout = arg_trans_layout(keyword['layout'])
del keyword['layout']
del keyword['... | 73 | jit_translate.py | Python | nni/compression/pytorch/speedup/jit_translate.py | 9a289ec21a40d870c0b80b93651d72a6693f7386 | nni | 1 | |
265,901 | 30 | 16 | 19 | 180 | 28 | 0 | 34 | 299 | test_cache_multiple_objects | Closes #10560: New global search (#10676)
* Initial work on new search backend
* Clean up search backends
* Return only the most relevant result per object
* Clear any pre-existing cached entries on cache()
* #6003: Implement global search functionality for custom field values
* Tweak field weights & do... | https://github.com/netbox-community/netbox.git | def test_cache_multiple_objects(self):
sites = Site.objects.all()
search_backend.cache(sites)
content_type = ContentType.objects.get_for_model(Site)
self.assertEqual(
CachedValue.objects.filter(object_type=content_type).count(),
len(SiteIndex.fields) * s... | 116 | test_search.py | Python | netbox/netbox/tests/test_search.py | 9628dead07ccef9608b32906aa8194bc948e5a09 | netbox | 3 | |
270,669 | 12 | 9 | 5 | 54 | 8 | 0 | 14 | 53 | _get_trainable_state | Reformatting the codebase with black.
PiperOrigin-RevId: 450093126 | https://github.com/keras-team/keras.git | def _get_trainable_state(self):
trainable_state = weakref.WeakKeyDictionary()
for layer in self._flatten_layers():
trainable_state[layer] = layer.trainable
return trainable_state
| 32 | base_layer.py | Python | keras/engine/base_layer.py | 84afc5193d38057e2e2badf9c889ea87d80d8fbf | keras | 2 | |
215,761 | 27 | 12 | 10 | 182 | 9 | 0 | 39 | 85 | _acl_changes | [merge jam] Master port 49261 - consul modules (#58101)
* add consul states and acl function present/absent
* add consul to states doc index
* refact/fix consul states
* fix doc, fix states
* fix name parameter for acl_changes
* fixing pylint errors
* small changes after review by @rallytime
* fix... | https://github.com/saltstack/salt.git | def _acl_changes(name, id=None, type=None, rules=None, consul_url=None, token=None):
info = __salt__["consul.acl_info"](id=id, token=token, consul_url=consul_url)
if info["res"] and info["data"][0]["Name"] != name:
return True
elif info["res"] and info["data"][0]["Rules"] != rules:
ret... | 112 | consul.py | Python | salt/states/consul.py | fb825aa760fa0585a2c8fdafc6e62be8aec8cecf | salt | 7 | |
181,898 | 32 | 17 | 10 | 128 | 12 | 0 | 41 | 97 | generate_export_pipeline_code | Revert "Deployed 7ccda9a with MkDocs version: 1.3.0"
This reverts commit bd9629c40e01241766197119b581a99409b07068. | https://github.com/EpistasisLab/tpot.git | def generate_export_pipeline_code(pipeline_tree, operators):
steps = _process_operator(pipeline_tree, operators)
# number of steps in a pipeline
num_step = len(steps)
if num_step > 1:
pipeline_text = "make_pipeline(\n{STEPS}\n)".format(
STEPS=_indent(",\n".join(steps), 4)
... | 71 | export_utils.py | Python | tpot/export_utils.py | 388616b6247ca4ea8de4e2f340d6206aee523541 | tpot | 2 | |
158,190 | 43 | 13 | 15 | 274 | 26 | 0 | 62 | 142 | load_data_imdb | [PaddlePaddle] Merge master into Paddle branch (#1186)
* change 15.2 title in chinese version (#1109)
change title ’15.2. 情感分析:使用递归神经网络‘ to ’15.2. 情感分析:使用循环神经网络‘
* 修改部分语义表述 (#1105)
* Update r0.17.5 (#1120)
* Bump versions in installation
* 94行typo: (“bert.mall”)->(“bert.small”) (#1129)
* line 313: "b... | https://github.com/d2l-ai/d2l-zh.git | def load_data_imdb(batch_size, num_steps=500):
data_dir = d2l.download_extract('aclImdb', 'aclImdb')
train_data = read_imdb(data_dir, True)
test_data = read_imdb(data_dir, False)
train_tokens = d2l.tokenize(train_data[0], token='word')
test_tokens = d2l.tokenize(test_data[0], token='word')
... | 180 | mxnet.py | Python | d2l/mxnet.py | b64b41d8c1ac23c43f7a4e3f9f6339d6f0012ab2 | d2l-zh | 3 | |
35,453 | 95 | 11 | 9 | 138 | 12 | 0 | 129 | 158 | get_tests_dir | [Test refactor 1/5] Per-folder tests reorganization (#15725)
* Per-folder tests reorganization
Co-authored-by: sgugger <sylvain.gugger@gmail.com>
Co-authored-by: Stas Bekman <stas@stason.org> | https://github.com/huggingface/transformers.git | def get_tests_dir(append_path=None):
# this function caller's __file__
caller__file__ = inspect.stack()[1][1]
tests_dir = os.path.abspath(os.path.dirname(caller__file__))
while not tests_dir.endswith("tests"):
tests_dir = os.path.dirname(tests_dir)
if append_path:
return os.pa... | 75 | testing_utils.py | Python | src/transformers/testing_utils.py | 29c10a41d04f855c433a6cde7797b325651417d2 | transformers | 3 | |
89,803 | 14 | 9 | 7 | 61 | 12 | 0 | 17 | 45 | _should_operate | feat(hybrid-cloud): Create a base parser and middleware for webhooks (#42267)
See [HC-468](https://getsentry.atlassian.net/browse/HC-468)
Requires https://github.com/getsentry/sentry/pull/42260
This PR establishes the base parser that will be inherited from to
forward webhooks to the appropriate integration. It... | https://github.com/getsentry/sentry.git | def _should_operate(self, request) -> bool:
is_correct_silo = SiloMode.get_current_mode() == SiloMode.CONTROL
is_external = request.path.startswith(self.webhook_prefix)
return is_correct_silo and is_external
| 37 | integration_control.py | Python | src/sentry/middleware/integrations/integration_control.py | d8609112d6e2f373692b414acff6d4a2f7466750 | sentry | 2 | |
2,278 | 55 | 11 | 41 | 351 | 24 | 0 | 79 | 299 | set | replaced all methods of usermanager class,
working login
Co-Authored By: Ionesio | https://github.com/OpenMined/PySyft.git | def set(self, **kwargs) -> None: # nosec
attributes = {}
user_id = kwargs["user_id"]
user = self.first(id_int=int(user_id))
if not user:
raise UserNotFoundError
for k, v in kwargs.items():
if k in user.__attr_searchable__:
attrib... | 205 | user_manager.py | Python | packages/syft/src/syft/core/node/common/node_manager/user_manager.py | 066545e8a88e842aa7d0a5d57bac88716001bced | PySyft | 10 | |
124,671 | 67 | 15 | 25 | 217 | 25 | 0 | 105 | 415 | _optimize_stages | Object GC for block splitting inside the dataset splitting (#26196)
The pipeline will spill objects when splitting the dataset into multiple equal parts.
Co-authored-by: Ubuntu <ubuntu@ip-172-31-32-136.us-west-2.compute.internal> | https://github.com/ray-project/ray.git | def _optimize_stages(self):
context = DatasetContext.get_current()
if not context.optimize_fuse_stages:
self._optimized_stages = self._stages
return
# This dummy dataset will be used to get a set of optimized stages.
dummy_ds = Dataset(
Exec... | 138 | dataset_pipeline.py | Python | python/ray/data/dataset_pipeline.py | 45ba0e3cacbf4f38b9724437798c75341c2ddc7c | ray | 4 | |
38,287 | 31 | 11 | 11 | 58 | 6 | 0 | 37 | 110 | num_layers | Black preview (#17217)
* Black preview
* Fixup too!
* Fix check copies
* Use the same version as the CI
* Bump black | https://github.com/huggingface/transformers.git | def num_layers(self) -> int:
if not hasattr(self._config, "num_layers"):
raise AttributeError(
"could not find the number of layers attribute in the model configuration, override the num_layers"
" property of the model OnnxConfig to solve this"
)
... | 31 | config.py | Python | src/transformers/onnx/config.py | afe5d42d8d1d80af911ed980c2936bfe887078f6 | transformers | 2 | |
248,496 | 9 | 11 | 6 | 50 | 9 | 0 | 10 | 68 | _get_canonical_alias | Reduce the amount of state we pull from the DB (#12811) | https://github.com/matrix-org/synapse.git | def _get_canonical_alias(self):
return self.get_success(
self._storage_controllers.state.get_current_state_event(
self.room_id, EventTypes.CanonicalAlias, ""
)
)
| 30 | test_directory.py | Python | tests/handlers/test_directory.py | e3163e2e11cf8bffa4cb3e58ac0b86a83eca314c | synapse | 1 | |
242,493 | 23 | 12 | 10 | 137 | 8 | 0 | 28 | 122 | histogram | Document that histogram() uses 256 bins per channel | https://github.com/python-pillow/Pillow.git | def histogram(self, mask=None, extrema=None):
self.load()
if mask:
mask.load()
return self.im.histogram((0, 0), mask.im)
if self.mode in ("I", "F"):
if extrema is None:
extrema = self.getextrema()
return self.im.histogram(e... | 84 | Image.py | Python | src/PIL/Image.py | de968dd920eaa3d1a27877059c6bbb9043a9d26b | Pillow | 4 | |
300,734 | 33 | 21 | 24 | 204 | 24 | 0 | 42 | 434 | async_step_onvif_devices | Decouple stream options from PyAV options (#71247)
Co-authored-by: Allen Porter <allen.porter@gmail.com> | https://github.com/home-assistant/core.git | async def async_step_onvif_devices(self, user_input=None):
if user_input is not None:
self.options[CONF_EXTRA_ARGUMENTS] = user_input[CONF_EXTRA_ARGUMENTS]
self.options[CONF_RTSP_TRANSPORT] = user_input[CONF_RTSP_TRANSPORT]
return self.async_create_entry(title="", da... | 134 | config_flow.py | Python | homeassistant/components/onvif/config_flow.py | 617b0d04dcab521ce3b68b4f4956c1f341f6ea60 | core | 2 | |
9,888 | 6 | 7 | 7 | 28 | 4 | 0 | 6 | 20 | uses_before_args | 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 uses_before_args(self) -> Namespace:
return self.peas_args['uses_before']
| 15 | __init__.py | Python | jina/peapods/pods/__init__.py | 933415bfa1f9eb89f935037014dfed816eb9815d | jina | 1 | |
102,397 | 5 | 6 | 19 | 23 | 5 | 0 | 5 | 8 | no_batch_dim_reference_fn | [rnn/gru] no batch dim (#70442)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/60585
TODO:
* [x] Doc updates
Pull Request resolved: https://github.com/pytorch/pytorch/pull/70442
Reviewed By: zou3519
Differential Revision: D33460427
Pulled By: jbschlosser
fbshipit-source-id: c64d9624c305d90570c79d11a285... | https://github.com/pytorch/pytorch.git | def no_batch_dim_reference_fn(m, p, *args, **kwargs):
| 152 | common_modules.py | Python | torch/testing/_internal/common_modules.py | 6eba936082a641be8ece156f70c0f5c435f7a7aa | pytorch | 9 | |
107,534 | 10 | 10 | 4 | 47 | 5 | 0 | 10 | 54 | fix_minus | Properly capitalize "Unicode".
See e.g. https://en.wikipedia.org/wiki/Unicode,
https://docs.python.org/3/howto/unicode.html.
Also associated minor doc cleanups. | https://github.com/matplotlib/matplotlib.git | def fix_minus(s):
return (s.replace('-', '\N{MINUS SIGN}')
if mpl.rcParams['axes.unicode_minus']
else s)
| 26 | ticker.py | Python | lib/matplotlib/ticker.py | 88cb4c9d0aa1e790fc4689ca7e68725bf851bf63 | matplotlib | 2 | |
248,369 | 92 | 13 | 26 | 284 | 31 | 0 | 125 | 441 | test_prune_gap_if_dummy_remote | Pull out less state when handling gaps mk2 (#12852) | https://github.com/matrix-org/synapse.git | def test_prune_gap_if_dummy_remote(self):
body = self.helper.send_event(
self.room_id, type=EventTypes.Dummy, content={}, tok=self.token
)
local_message_event_id = body["event_id"]
self.assert_extremities([local_message_event_id])
# Advance the clock for ma... | 167 | test_events.py | Python | tests/storage/test_events.py | b83bc5fab57b37f75a79d02213d6032c586fd36e | synapse | 1 | |
215,549 | 219 | 19 | 107 | 1,087 | 60 | 0 | 431 | 2,121 | sign_in | Use salt.channel.client instead of salt.transport.client | https://github.com/saltstack/salt.git | def sign_in(self, timeout=60, safe=True, tries=1, channel=None):
auth = {}
auth_timeout = self.opts.get("auth_timeout", None)
if auth_timeout is not None:
timeout = auth_timeout
auth_safemode = self.opts.get("auth_safemode", None)
if auth_safemode is not Non... | 626 | crypt.py | Python | salt/crypt.py | 70972c8016ff5d6fbdd7f83776077b0936f60dea | salt | 22 | |
101,595 | 32 | 15 | 10 | 168 | 21 | 0 | 41 | 138 | _get_count_and_filelist | Overhaul sort:
- Standardize image data reading and writing
- Optimize loading (just one pass required)
- Make all sort groups binnable (to greater or lesser results)
- Add sort by pitch
- Deprecate multiple options
- linting, docs + locales | https://github.com/deepfakes/faceswap.git | def _get_count_and_filelist(self, fast_count, count):
if isinstance(self.location, (list, tuple)):
file_list = self.location
else:
file_list = get_image_paths(self.location)
self._file_list = [fname for fname in file_list
if os.path.sp... | 105 | image.py | Python | lib/image.py | 98d01760e469fd2108eed8d0b0a1ba6297c3177c | faceswap | 5 | |
271,005 | 28 | 11 | 9 | 145 | 17 | 0 | 31 | 105 | test_adapt_doesnt_overwrite_input_shape | Reformatting the codebase with black.
PiperOrigin-RevId: 450093126 | https://github.com/keras-team/keras.git | def test_adapt_doesnt_overwrite_input_shape(self):
# Shape: (3, 1, 2)
adapt_dataset = np.array(
[[[1.0, 2.0]], [[3.0, 4.0]], [[5.0, 6.0]]], dtype=np.float32
)
layer = AddingPreprocessingLayer(input_shape=[1, 2])
layer.adapt(adapt_dataset)
model = ke... | 108 | base_preprocessing_layer_test.py | Python | keras/engine/base_preprocessing_layer_test.py | 84afc5193d38057e2e2badf9c889ea87d80d8fbf | keras | 1 | |
47,665 | 40 | 12 | 21 | 186 | 25 | 0 | 49 | 256 | test_deps_sorted | Replace usage of `DummyOperator` with `EmptyOperator` (#22974)
* Replace usage of `DummyOperator` with `EmptyOperator` | https://github.com/apache/airflow.git | def test_deps_sorted(self):
from airflow.operators.empty import EmptyOperator
from airflow.sensors.external_task import ExternalTaskSensor
execution_date = datetime(2020, 1, 1)
with DAG(dag_id="test_deps_sorted", start_date=execution_date) as dag:
task1 = ExternalTa... | 109 | test_dag_serialization.py | Python | tests/serialization/test_dag_serialization.py | 49e336ae0302b386a2f47269a6d13988382d975f | airflow | 1 | |
176,169 | 11 | 8 | 4 | 41 | 5 | 0 | 13 | 25 | tetrahedral_graph | Docstrings for the small.py module (#5240)
* added description for the first 5 small graphs
* modified descriptions based on comment and added description for two more functions
* added doctrings to all the functions
* Minor touchups.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu> | https://github.com/networkx/networkx.git | def tetrahedral_graph(create_using=None):
G = complete_graph(4, create_using)
G.name = "Platonic Tetrahedral graph"
return G
| 23 | small.py | Python | networkx/generators/small.py | dec723f072eb997a497a159dbe8674cd39999ee9 | networkx | 1 | |
155,297 | 62 | 16 | 18 | 252 | 35 | 0 | 78 | 178 | test_zero_copy_export_for_primitives | REFACTOR-#5303: Fix code scanning alert - Unused local variable (#5304)
Signed-off-by: Myachev <anatoly.myachev@intel.com>
Co-authored-by: Mahesh Vashishtha <mvashishtha@users.noreply.github.com> | https://github.com/modin-project/modin.git | def test_zero_copy_export_for_primitives(data_has_nulls):
data = get_data_of_all_types(
has_nulls=data_has_nulls, include_dtypes=["int", "uint", "float"]
)
at = pa.Table.from_pydict(data)
md_df = from_arrow(at)
protocol_df = md_df.__dataframe__(allow_copy=False)
for i, col in enum... | 151 | test_protocol.py | Python | modin/test/interchange/dataframe_protocol/hdk/test_protocol.py | eb99c500a40c5565012e3fe83c5e6ef333d1b487 | modin | 2 | |
259,734 | 41 | 11 | 8 | 188 | 21 | 1 | 48 | 80 | test_minibatch_nmf_negative_beta_loss | FEA Online implementation of non-negative matrix factorization (#16948)
Co-authored-by: Tom Dupré la Tour <tom.dupre-la-tour@m4x.org>
Co-authored-by: jeremie du boisberranger <jeremiedbb@yahoo.fr>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@use... | https://github.com/scikit-learn/scikit-learn.git | def test_minibatch_nmf_negative_beta_loss(beta_loss):
rng = np.random.RandomState(0)
X = rng.normal(size=(6, 5))
X[X < 0] = 0
nmf = MiniBatchNMF(beta_loss=beta_loss, random_state=0)
msg = "When beta_loss <= 0 and X contains zeros, the solver may diverge."
with pytest.raises(ValueError, ma... | @pytest.mark.parametrize(
["Estimator", "solver"],
[[NMF, {"solver": "cd"}], [NMF, {"solver": "mu"}], [MiniBatchNMF, {}]],
) | 71 | test_nmf.py | Python | sklearn/decomposition/tests/test_nmf.py | 69132ebbd39f070590ca01813340b5b12c0d02ab | scikit-learn | 1 |
246,283 | 19 | 8 | 3 | 42 | 7 | 0 | 19 | 39 | get_logcontext_id | Add missing type hints to synapse.replication. (#11938) | https://github.com/matrix-org/synapse.git | def get_logcontext_id(self) -> str:
# by default, we just use the command name.
return self.NAME
SC = TypeVar("SC", bound="_SimpleCommand")
| 12 | commands.py | Python | synapse/replication/tcp/commands.py | d0e78af35e519ff76bd23e786007f3e7130d90f7 | synapse | 1 | |
145,235 | 58 | 9 | 7 | 231 | 18 | 1 | 80 | 338 | _get_gpu_complaint | [KubeRay] Format autoscaling config based on RayCluster CR (#22348)
Closes #21655. At the start of each autoscaler iteration, we read the Ray Cluster CR from K8s and use it to extract the autoscaling config. | https://github.com/ray-project/ray.git | def _get_gpu_complaint() -> str:
return (
"Detected GPUs in container resources for group small-group."
"To ensure Ray and the autoscaler are aware of the GPUs,"
" set the `--num-gpus` rayStartParam."
)
PARAM_ARGS = ",".join(
[
"ray_cr_in",
"expected_config_out... | @pytest.mark.parametrize(PARAM_ARGS, TEST_DATA) | 13 | test_autoscaling_config.py | Python | docker/kuberay-autoscaler/test_autoscaling_config.py | a402e956a4e1ebe9bc4e2b404536466967c497af | ray | 1 |
261,761 | 26 | 12 | 8 | 100 | 17 | 0 | 29 | 61 | test_kbinsdiscretizer_wrong_strategy_with_weights | ENH add support for sample_weight in KBinsDiscretizer with strategy="quantile" (#24935)
Co-authored-by: seladus <clement.blancovolle@insa-rouen.fr>
Co-authored-by: Seladus <71873495+Seladus@users.noreply.github.com>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com> | https://github.com/scikit-learn/scikit-learn.git | def test_kbinsdiscretizer_wrong_strategy_with_weights(strategy):
sample_weight = np.ones(shape=(len(X)))
est = KBinsDiscretizer(n_bins=3, strategy=strategy)
err_msg = (
"`sample_weight` was provided but it can only be used with strategy='quantile'."
)
with pytest.raises(ValueError, matc... | 60 | test_discretization.py | Python | sklearn/preprocessing/tests/test_discretization.py | 1f3c1be77a5b15d6bc1a5bfd9eb64315928679b1 | scikit-learn | 1 | |
156,511 | 11 | 8 | 17 | 26 | 4 | 0 | 11 | 25 | __dask_graph__ | Collection Protocol (#8674)
[PEP 544](https://www.python.org/dev/peps/pep-0544/) introduces the `Protocol` class to the `typing` module in Python 3.8 (the soon be the minimum supported version, https://github.com/dask/community/issues/213). Writing new Dask collections for [dask-awkward](https://github.com/ContinuumIO... | https://github.com/dask/dask.git | def __dask_graph__(self) -> Mapping:
raise NotImplementedError("Inheriting class must implement this method.")
| 13 | typing.py | Python | dask/typing.py | 1e783d9a714160e968936cb22d54d085959ab09e | dask | 1 | |
309,557 | 50 | 18 | 27 | 240 | 18 | 0 | 62 | 383 | test_notify_credential_profile | Upgrade boto3 to 1.20.24 + aiobotocore to 2.1.0 (#64045) | https://github.com/home-assistant/core.git | async def test_notify_credential_profile(hass):
with async_patch("aiobotocore.session.AioSession", new=MockAioSession):
await async_setup_component(
hass,
"aws",
{
"aws": {
"notify": [
{
... | 131 | test_init.py | Python | tests/components/aws/test_init.py | b17860a7dd283d54bc452e5dca23532d05822589 | core | 1 | |
288,027 | 31 | 11 | 6 | 61 | 5 | 0 | 36 | 97 | model | Refactor apcupsd to use config flow (#64809)
* Add Config Flow to APCUPSd integration and remove YAML support.
* Hide the binary sensor if user does not select STATFLAG resource.
* Add tests for config flows.
* Simplify config flow code.
* Spell fix.
* Fix pylint warnings.
* Simplify the code for con... | https://github.com/home-assistant/core.git | def model(self) -> str | None:
# Different UPS models may report slightly different keys for model, here we
# try them all.
for model_key in ("APCMODEL", "MODEL"):
if model_key in self.status:
return self.status[model_key]
return None
| 35 | __init__.py | Python | homeassistant/components/apcupsd/__init__.py | 52307708c843b947a2d631f2fe7ddaa8bd9a90d7 | core | 3 | |
46,209 | 2 | 6 | 17 | 12 | 1 | 0 | 2 | 5 | lazy_add_provider_discovered_options_to_connection_form | Add generic connection type (#22310)
See https://github.com/apache/airflow/discussions/20350. | https://github.com/apache/airflow.git | def lazy_add_provider_discovered_options_to_connection_form():
| 102 | views.py | Python | airflow/www/views.py | 6d1d53b780c48297fa2e6d8e075fdaa0f0f42e22 | airflow | 2 | |
275,864 | 43 | 14 | 9 | 88 | 13 | 0 | 50 | 109 | _legacy_weights | Reformatting the codebase with black.
PiperOrigin-RevId: 450093126 | https://github.com/keras-team/keras.git | def _legacy_weights(layer):
weights = layer.trainable_weights + layer.non_trainable_weights
if any(not isinstance(w, tf.Variable) for w in weights):
raise NotImplementedError(
f"Save or restore weights that is not an instance of `tf.Variable` is "
f"not supported in h5, use ... | 45 | hdf5_format.py | Python | keras/saving/hdf5_format.py | 84afc5193d38057e2e2badf9c889ea87d80d8fbf | keras | 3 | |
104,754 | 153 | 23 | 55 | 669 | 35 | 0 | 280 | 1,003 | _create_builder_config | fix outdated docstring about default dataset config (#4186) | https://github.com/huggingface/datasets.git | def _create_builder_config(self, name=None, custom_features=None, **config_kwargs) -> Tuple[BuilderConfig, str]:
builder_config = None
# try default config
if name is None and self.BUILDER_CONFIGS and not config_kwargs:
if self.DEFAULT_CONFIG_NAME is not None:
... | 320 | builder.py | Python | src/datasets/builder.py | 27973e4fcf45c16dc9f81f18459ce54e4165aa2a | datasets | 21 | |
3,358 | 52 | 15 | 18 | 387 | 29 | 0 | 71 | 141 | test_valid_incremental_read_with_no_interval | CDK: Fix typing errors (#9037)
* fix typing, drop AirbyteLogger
* format
* bump the version
* use logger instead of fixture logger
Co-authored-by: Eugene Kulak <kulak.eugene@gmail.com>
Co-authored-by: auganbay <auganenu@gmail.com> | https://github.com/airbytehq/airbyte.git | def test_valid_incremental_read_with_no_interval(mocker):
stream_output = [{"k1": "v1"}, {"k2": "v2"}]
s1 = MockStream([({"sync_mode": SyncMode.incremental, "stream_state": {}}, stream_output)], name="s1")
s2 = MockStream([({"sync_mode": SyncMode.incremental, "stream_state": {}}, stream_output)], name=... | 235 | test_abstract_source.py | Python | airbyte-cdk/python/unit_tests/sources/test_abstract_source.py | f83eca58eaf2129d21b5796a301732ab22675130 | airbyte | 1 | |
267,940 | 4 | 6 | 2 | 23 | 5 | 0 | 4 | 11 | supported_pythons | 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 supported_pythons(self) -> t.List[str]:
| 13 | completion.py | Python | test/lib/ansible_test/_internal/completion.py | 3eb0485dd92c88cc92152d3656d94492db44b183 | ansible | 1 | |
261,504 | 47 | 12 | 16 | 279 | 34 | 1 | 63 | 141 | test_predict_iris | ENH add newton-cholesky solver to LogisticRegression (#24767) | https://github.com/scikit-learn/scikit-learn.git | def test_predict_iris(clf):
n_samples, n_features = iris.data.shape
target = iris.target_names[iris.target]
if clf.solver == "lbfgs":
# lbfgs has convergence issues on the iris data with its default max_iter=100
with warnings.catch_warnings():
warnings.simplefilter("ignore"... | @pytest.mark.parametrize("LR", [LogisticRegression, LogisticRegressionCV]) | 161 | test_logistic.py | Python | sklearn/linear_model/tests/test_logistic.py | bb080aa690364d84d11232c73dc8db2f0dde3578 | scikit-learn | 2 |
268,686 | 57 | 13 | 22 | 374 | 36 | 0 | 80 | 262 | configure_source_trees | ansible-test - Improve container management. (#78550)
See changelogs/fragments/ansible-test-container-management.yml for details. | https://github.com/ansible/ansible.git | def configure_source_trees(cls):
current_ansible = pathlib.Path(os.environ['PYTHONPATH']).parent
root_ansible = pathlib.Path('~').expanduser() / 'ansible'
test_ansible = pathlib.Path(f'~{UNPRIVILEGED_USER_NAME}').expanduser() / 'ansible'
if current_ansible != root_ansible:
... | 211 | runme.py | Python | test/integration/targets/ansible-test-container/runme.py | cda16cc5e9aa8703fb4e1ac0a0be6b631d9076cc | ansible | 6 | |
177,995 | 56 | 15 | 6 | 371 | 36 | 1 | 81 | 470 | perform_create | feat: DEV-2896: Comment List API (#2704)
* feat: DEV-2896: Comment List API
* Fix
* Fix tests
* Fix more tests
* Fixes
* [submodules] Build static heartexlabs/label-studio-frontend
* [submodules] Build static heartexlabs/dm2
* Fix feature flags
* [submodules] Build static heartexlabs/label-stud... | https://github.com/heartexlabs/label-studio.git | def perform_create(self, serializer):
project_id = self.request.data.get('project')
project = generics.get_object_or_404(Project, pk=project_id)
instance = serializer.save(project=project)
emit_webhooks_for_instance(self.request.user.active_organization, project, WebhookAction.TASKS_CREA... | @method_decorator(name='get', decorator=swagger_auto_schema(
tags=['Tasks'],
operation_summary='Get task',
operation_description="""
Get task data, metadata, annotations and other attributes for a specific labeling task by task ID.
""",
manual_parameters=[
ope... | 71 | api.py | Python | label_studio/tasks/api.py | 71a9ada93224ed6433fb5b45bfcd60d5fe3edd4c | label-studio | 1 |
122,415 | 39 | 13 | 9 | 155 | 14 | 0 | 64 | 79 | _multi_dot_three | Call _check_arraylike for jnp.linalg & jnp.fft functions | https://github.com/google/jax.git | def _multi_dot_three(A, B, C, precision):
a0, a1b0 = A.shape
b1c0, c1 = C.shape
# cost1 = cost((AB)C) = a0*a1b0*b1c0 + a0*b1c0*c1
cost1 = a0 * b1c0 * (a1b0 + c1)
# cost2 = cost(A(BC)) = a1b0*b1c0*c1 + a0*a1b0*c1
cost2 = a1b0 * c1 * (a0 + b1c0)
if cost1 < cost2:
return jnp.dot(jnp.dot(A, B, precisi... | 103 | linalg.py | Python | jax/_src/third_party/numpy/linalg.py | 2416d154355f19e77b5c1ddf1de1f8552e4a98ad | jax | 2 | |
20,826 | 15 | 11 | 3 | 59 | 8 | 0 | 15 | 29 | meta | 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 meta(self) -> Dict[str, Any]:
return {} if self._meta is None else cast(Dict[str, Any], loads(self._meta))
| 39 | style.py | Python | pipenv/patched/notpip/_vendor/rich/style.py | f3166e673fe8d40277b804d35d77dcdb760fc3b3 | pipenv | 2 | |
293,911 | 85 | 12 | 31 | 381 | 28 | 1 | 145 | 362 | test_get_states_no_attributes | Avoid selecting attributes in the history api when `no_attributes` is passed (#68352) | https://github.com/home-assistant/core.git | def test_get_states_no_attributes(hass_recorder):
hass = hass_recorder()
now, future, states = _setup_get_states(hass)
for state in states:
state.attributes = {}
# Get states returns everything before POINT for all entities
for state1, state2 in zip(
states,
sorted(
... | @pytest.mark.parametrize(
"attributes, no_attributes, limit",
[
({"attr": True}, False, 5000),
({}, True, 5000),
({"attr": True}, False, 3),
({}, True, 3),
],
) | 199 | test_history.py | Python | tests/components/recorder/test_history.py | 816695cc96c19110ccda10431d92160ea6064d32 | core | 5 |
68,683 | 39 | 20 | 25 | 235 | 25 | 0 | 51 | 31 | _generate_dependants_map | style: Update docstrings and fix/add type hints + Collapsible progress section in Log | https://github.com/frappe/erpnext.git | def _generate_dependants_map() -> defaultdict:
bom = frappe.qb.DocType("BOM")
bom_item = frappe.qb.DocType("BOM Item")
bom_parents = (
frappe.qb.from_(bom_item)
.join(bom)
.on(bom_item.parent == bom.name)
.select(bom_item.bom_no, bom_item.parent)
.where(
(bom_item.bom_no.isnotnull())
& (bom_item.... | 144 | bom_updation_utils.py | Python | erpnext/manufacturing/doctype/bom_update_log/bom_updation_utils.py | 9f5f18e94da4254255a32d792abc94407ca5fde0 | erpnext | 2 | |
133,165 | 37 | 12 | 12 | 83 | 10 | 0 | 39 | 126 | register_ray | [CI] Format Python code with Black (#21975)
See #21316 and #21311 for the motivation behind these changes. | https://github.com/ray-project/ray.git | def register_ray():
try:
from ray.util.joblib.ray_backend import RayBackend
register_parallel_backend("ray", RayBackend)
except ImportError:
msg = (
"To use the ray backend you must install ray."
"Try running 'pip install ray'."
"See https://docs... | 39 | __init__.py | Python | python/ray/util/joblib/__init__.py | 7f1bacc7dc9caf6d0ec042e39499bbf1d9a7d065 | ray | 2 | |
246,874 | 16 | 11 | 8 | 80 | 13 | 0 | 16 | 88 | test_aggregation_must_be_annotation | Replace assertEquals and friends with non-deprecated versions. (#12092) | https://github.com/matrix-org/synapse.git | def test_aggregation_must_be_annotation(self):
channel = self.make_request(
"GET",
"/_matrix/client/unstable/rooms/%s/aggregations/%s/%s?limit=1"
% (self.room, self.parent_id, RelationTypes.REPLACE),
access_token=self.user_token,
)
self.a... | 51 | test_relations.py | Python | tests/rest/client/test_relations.py | 02d708568b476f2f7716000b35c0adfa4cbd31b3 | synapse | 1 | |
43,465 | 11 | 10 | 4 | 59 | 12 | 0 | 12 | 40 | test_get_service_bus_message_conn | Implement Azure Service Bus Queue Operators (#24038)
Implemented Azure Service Bus Queue based Operator's to create queue, send message to the queue and receive message(list of message or batch message) and delete queue in azure service
- Added `AzureServiceBusCreateQueueOperator`
- Added `AzureServiceBusSendMessag... | https://github.com/apache/airflow.git | def test_get_service_bus_message_conn(self, mock_connection):
mock_connection.return_value = self.conn
hook = MessageHook(azure_service_bus_conn_id=self.conn_id)
assert isinstance(hook.get_conn(), ServiceBusClient)
| 36 | test_asb.py | Python | tests/providers/microsoft/azure/hooks/test_asb.py | 09f38ad3f6872bae5059a1de226362eb358c4a7a | airflow | 1 | |
299,440 | 11 | 10 | 7 | 46 | 7 | 0 | 12 | 66 | available | Fix Sonos races related to grouping and startup (#71026) | https://github.com/home-assistant/core.git | def available(self) -> bool:
return (
self.speaker.available
and self.speaker.sonos_group_entities
and self.media.playback_status
)
| 28 | media_player.py | Python | homeassistant/components/sonos/media_player.py | 1f1932d224f26ec8b80fa41bea3cf127a97ca7fb | core | 3 | |
176,253 | 66 | 25 | 39 | 413 | 23 | 1 | 126 | 783 | strongly_connected_components | Fixing Tarjan's strongly connected components algorithm implementation to have O(|E|+|V|) time complexity instead of O(|V|^3). (#5288)
Prevent unnecessary traversal of edges multiple times | https://github.com/networkx/networkx.git | def strongly_connected_components(G):
preorder = {}
lowlink = {}
scc_found = set()
scc_queue = []
i = 0 # Preorder counter
neighbors = {v: iter(G[v]) for v in G}
for source in G:
if source not in scc_found:
queue = [source]
while queue:
v... | @not_implemented_for("undirected") | 257 | strongly_connected.py | Python | networkx/algorithms/components/strongly_connected.py | 77c49c16e10693dbe566d20601b28dd2b1e8df03 | networkx | 15 |
189,028 | 50 | 18 | 14 | 232 | 24 | 0 | 72 | 140 | disk_io_counters | Use a generator to avoid a needless list allocation (#1567) | https://github.com/giampaolo/psutil.git | def disk_io_counters(perdisk=False, nowrap=True):
kwargs = dict(perdisk=perdisk) if LINUX else {}
rawdict = _psplatform.disk_io_counters(**kwargs)
if not rawdict:
return {} if perdisk else None
if nowrap:
rawdict = _wrap_numbers(rawdict, 'psutil.disk_io_counters')
nt = getattr(_... | 119 | __init__.py | Python | psutil/__init__.py | 83bb5f8cdcbe10fadf64e62e61d011afe73b6a27 | psutil | 8 | |
292,401 | 36 | 12 | 13 | 192 | 24 | 0 | 43 | 150 | post | Only set require_restart on config entry reload if its not recoverable (#66994) | https://github.com/home-assistant/core.git | async def post(self, request, entry_id):
if not request["hass_user"].is_admin:
raise Unauthorized(config_entry_id=entry_id, permission="remove")
hass = request.app["hass"]
entry = hass.config_entries.async_get_entry(entry_id)
if not entry:
return self.js... | 115 | config_entries.py | Python | homeassistant/components/config/config_entries.py | 9a5eec561a18cd0bffbbd65afe68f70c0893d28c | core | 4 | |
132,696 | 20 | 8 | 29 | 41 | 6 | 0 | 21 | 49 | testPlacementGroupRequests | [CI] Format Python code with Black (#21975)
See #21316 and #21311 for the motivation behind these changes. | https://github.com/ray-project/ray.git | def testPlacementGroupRequests(self, reuse_actors=False, scheduled=10):
# Since we check per-step placement groups, set the reconcilation
# interval to 0
os.environ["TUNE_PLACEMENT_GROUP_RECON_INTERVAL"] = "0"
| 181 | test_trial_runner_pg.py | Python | python/ray/tune/tests/test_trial_runner_pg.py | 7f1bacc7dc9caf6d0ec042e39499bbf1d9a7d065 | ray | 2 | |
269,303 | 8 | 8 | 2 | 57 | 9 | 1 | 8 | 12 | gelu | Reformatting the codebase with black.
PiperOrigin-RevId: 450093126 | https://github.com/keras-team/keras.git | def gelu(x, approximate=False):
return tf.nn.gelu(x, approximate)
@keras_export("keras.activations.tanh")
@tf.__internal__.dispatch.add_dispatch_support | @keras_export("keras.activations.tanh")
@tf.__internal__.dispatch.add_dispatch_support | 21 | activations.py | Python | keras/activations.py | 84afc5193d38057e2e2badf9c889ea87d80d8fbf | keras | 1 |
199,700 | 13 | 8 | 13 | 47 | 7 | 0 | 13 | 18 | legendre_poly | Run orthopolys and appellseqs through a common interface
Including unifying the two Chebyshev generators into one function.
There are also two kinds of Hermite polynomials, and they too share the
same recurrence, but the second type He_n(x) (aka the probabilist,
reduced or small polynomials) will not be added here. | https://github.com/sympy/sympy.git | def legendre_poly(n, x=None, polys=False):
r
return named_poly(n, dup_legendre, QQ, "Legendre polynomial", (x,), polys)
| 33 | orthopolys.py | Python | sympy/polys/orthopolys.py | d1d46df73ebaad94089847558d00a8b7269f554d | sympy | 1 | |
19,147 | 7 | 6 | 5 | 28 | 6 | 0 | 7 | 21 | metrics | Improve evaluation api (#5256)
* 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 doc
Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
* update d... | https://github.com/mlflow/mlflow.git | def metrics(self) -> Dict[str, Any]:
return self._metrics
| 17 | base.py | Python | mlflow/models/evaluation/base.py | 4c58179509e6f6047789efb0a95c2b0e20cb6c8f | mlflow | 1 | |
260,150 | 112 | 16 | 55 | 646 | 25 | 0 | 400 | 1,068 | _generate_invalid_param_val_interval | FIX Param validation: fix generating invalid param when 2 interval constraints (#23513)
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com> | https://github.com/scikit-learn/scikit-learn.git | def _generate_invalid_param_val_interval(interval, constraints):
if interval.type is Real:
# generate a non-integer value such that it can't be valid even if there's also
# an integer interval constraint.
if interval.left is None and interval.right is None:
if interval.close... | 399 | _param_validation.py | Python | sklearn/utils/_param_validation.py | 02cbe01e67165d7d38e5e441cfccd6b57b2207b6 | scikit-learn | 32 | |
289,375 | 18 | 10 | 5 | 75 | 11 | 0 | 21 | 36 | test_fetch_period_api_with_no_timestamp | Ensure recorder test fixture is setup before hass fixture (#80528)
* Ensure recorder test fixture is setup before hass fixture
* Adjust more tests | https://github.com/home-assistant/core.git | async def test_fetch_period_api_with_no_timestamp(recorder_mock, hass, hass_client):
await async_setup_component(hass, "history", {})
client = await hass_client()
response = await client.get("/api/history/period")
assert response.status == HTTPStatus.OK
| 43 | test_init.py | Python | tests/components/history/test_init.py | 31a787558fd312331b55e5c2c4b33341fc3601fc | core | 1 | |
172,886 | 64 | 17 | 39 | 567 | 40 | 0 | 103 | 331 | search_query | Refactored load read status for web access and opds access
Refactored and removed discover html page
Bugfix show author
Bugfix open dialog in author page
Fix for #2341 (advanced search with linked read column and read column having a higher number than number of available custom columns) | https://github.com/janeczku/calibre-web.git | def search_query(self, term, config_read_column, *join):
term.strip().lower()
self.session.connection().connection.connection.create_function("lower", 1, lcase)
q = list()
authorterms = re.split("[, ]+", term)
for authorterm in authorterms:
q.append(Books.authors.any(... | 353 | db.py | Python | cps/db.py | 32a3c45ee0f7e13bd61075f32a4dcebc415585a1 | calibre-web | 6 | |
292,764 | 22 | 11 | 13 | 149 | 11 | 0 | 45 | 196 | async_attribute_updated | Presets for single ZONNSMART TRV (#67157)
* Presets for single ZONNSMART TRV
* added zonnsmart climate tests
* black8 fix | https://github.com/home-assistant/core.git | async def async_attribute_updated(self, record):
if record.attr_name == "operation_preset":
if record.value == 0:
self._preset = PRESET_SCHEDULE
if record.value == 1:
self._preset = PRESET_NONE
if record.value == 2:
sel... | 90 | climate.py | Python | homeassistant/components/zha/climate.py | cbdfff25ca510a5d7dff9a1cb39ce2da8afc7d65 | core | 7 | |
22,658 | 25 | 11 | 7 | 76 | 8 | 0 | 26 | 62 | axpy | refactor: clean code
Signed-off-by: slowy07 <slowy.arfy@gmail.com> | https://github.com/geekcomputers/Python.git | def axpy(scalar, x, y):
# precondition
assert (
isinstance(x, Vector)
and (isinstance(y, Vector))
and (isinstance(scalar, int) or isinstance(scalar, float))
)
return x * scalar + y
| 50 | lib.py | Python | linear-algebra-python/src/lib.py | f0af0c43340763724f139fa68aa1e5a9ffe458b4 | Python | 4 | |
22,718 | 34 | 15 | 17 | 207 | 21 | 0 | 45 | 133 | search_button | refactor: clean code
Signed-off-by: slowy07 <slowy.arfy@gmail.com> | https://github.com/geekcomputers/Python.git | def search_button(p1):
global cursor
global results
global index
w.errorOutput.configure(text="")
sql_command =
sql_command = sql_command.format(w.inputSearchTitle.get())
try:
cursor.execute(sql_command)
results = cursor.fetchall()
w.errorOutput.configure(text=str(le... | 128 | notepad_support.py | Python | notepad/notepad_support.py | f0af0c43340763724f139fa68aa1e5a9ffe458b4 | Python | 4 | |
258,457 | 105 | 16 | 33 | 473 | 46 | 0 | 147 | 333 | silhouette_samples | FIX Support integers in silhouette_score for precomputed distances (#22108)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com> | https://github.com/scikit-learn/scikit-learn.git | def silhouette_samples(X, labels, *, metric="euclidean", **kwds):
X, labels = check_X_y(X, labels, accept_sparse=["csc", "csr"])
# Check for non-zero diagonal entries in precomputed distance matrix
if metric == "precomputed":
error_msg = ValueError(
"The precomputed distance matrix... | 284 | _unsupervised.py | Python | sklearn/metrics/cluster/_unsupervised.py | e4015289e0eeb390190ce0d051cee756bc5ecb33 | scikit-learn | 5 | |
20,452 | 31 | 13 | 10 | 123 | 14 | 0 | 42 | 116 | get_lexer_for_mimetype | 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_lexer_for_mimetype(_mime, **options):
for modname, name, _, _, mimetypes in LEXERS.values():
if _mime in mimetypes:
if name not in _lexer_cache:
_load_lexers(modname)
return _lexer_cache[name](**options)
for cls in find_plugin_lexers():
if _mi... | 77 | __init__.py | Python | pipenv/patched/notpip/_vendor/pygments/lexers/__init__.py | f3166e673fe8d40277b804d35d77dcdb760fc3b3 | pipenv | 6 | |
118,503 | 85 | 13 | 72 | 634 | 25 | 0 | 208 | 583 | test_complex_joins | join multiple tables
https://github.com/mindsdb/mindsdb_sql/issues/246 | https://github.com/mindsdb/mindsdb.git | def test_complex_joins(self, data_handler):
df1 = pd.DataFrame([
{'a': 1, 'c': 1, 'b': dt.datetime(2020, 1, 1)},
{'a': 2, 'c': 1, 'b': dt.datetime(2020, 1, 2)},
{'a': 1, 'c': 3, 'b': dt.datetime(2020, 1, 3)},
{'a': 3, 'c': 2, 'b': dt.datetime(2020, 1, 2)},
... | 383 | test_project_structure.py | Python | tests/unit/test_project_structure.py | 602d5dfea04d73c5c8d4f9d43a6e3deb8a945f18 | mindsdb | 1 | |
267,759 | 30 | 12 | 12 | 124 | 17 | 0 | 35 | 92 | get_ci_provider | 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 get_ci_provider() -> CIProvider:
provider = None
import_plugins('ci')
candidates = sorted(get_subclasses(CIProvider), key=lambda c: (c.priority, c.__name__))
for candidate in candidates:
if candidate.is_supported():
provider = candidate()
break
if provide... | 73 | __init__.py | Python | test/lib/ansible_test/_internal/ci/__init__.py | 3eb0485dd92c88cc92152d3656d94492db44b183 | ansible | 4 | |
276,450 | 48 | 12 | 22 | 282 | 43 | 0 | 61 | 257 | testWithEmbeddings | Reformatting the codebase with black.
PiperOrigin-RevId: 450093126 | https://github.com/keras-team/keras.git | def testWithEmbeddings(self):
state_input = keras.layers.Input(
shape=(1,), name="state_input", dtype="int32"
)
output = keras.layers.Embedding(
output_dim=16, input_dim=100, input_length=1, name="state"
)(state_input)
model = keras.models.Model(i... | 177 | graph_util_test.py | Python | keras/tests/graph_util_test.py | 84afc5193d38057e2e2badf9c889ea87d80d8fbf | keras | 1 | |
19,671 | 48 | 12 | 21 | 212 | 28 | 0 | 61 | 255 | sys_path | Issue 4993 Add standard pre commit hooks and apply linting. (#4994)
* Add .pre-commit-config.yaml to the project and exclude tests (for now). This does not include the MyPy linting that pip does but does include everything else. | https://github.com/pypa/pipenv.git | def sys_path(self):
# type: () -> List[str]
from .vendor.vistir.compat import JSONDecodeError
current_executable = Path(sys.executable).as_posix()
if not self.python or self.python == current_executable:
return sys.path
elif any([sys.prefix == self.prefix, ... | 134 | environment.py | Python | pipenv/environment.py | 9a3b3ce70621af6f9adaa9eeac9cf83fa149319c | pipenv | 5 | |
250,139 | 138 | 17 | 121 | 991 | 49 | 0 | 275 | 1,863 | test_out_of_order_events | Require types in tests.storage. (#14646)
Adds missing type hints to `tests.storage` package
and does not allow untyped definitions. | https://github.com/matrix-org/synapse.git | def test_out_of_order_events(self) -> None:
event_factory = self.hs.get_event_builder_factory()
bob = "@creator:test"
alice = "@alice:test"
room_id = "!room:test"
# Ensure that we have a rooms entry so that we generate the chain index.
self.get_success(
... | 620 | test_event_chain.py | Python | tests/storage/test_event_chain.py | 3ac412b4e2f8c5ba11dc962b8a9d871c1efdce9b | synapse | 2 | |
246,112 | 26 | 11 | 14 | 180 | 17 | 0 | 27 | 130 | test_limit_and_from | Add admin API to get a list of federated rooms (#11658) | https://github.com/matrix-org/synapse.git | def test_limit_and_from(self) -> None:
number_destinations = 20
self._create_destinations(number_destinations)
channel = self.make_request(
"GET",
self.url + "?from=5&limit=10",
access_token=self.admin_user_tok,
)
self.assertEqual(H... | 109 | test_federation.py | Python | tests/rest/admin/test_federation.py | 6a72c910f180ee8b4bd78223775af48492769472 | synapse | 1 | |
167,802 | 68 | 11 | 42 | 290 | 27 | 0 | 96 | 195 | cartesian_product | TYP: more return annotations in core/ (#47618)
* TYP: more return annotations in core/
* from __future__ import annotations
* more __future__ | https://github.com/pandas-dev/pandas.git | def cartesian_product(X) -> list[np.ndarray]:
msg = "Input must be a list-like of list-likes"
if not is_list_like(X):
raise TypeError(msg)
for x in X:
if not is_list_like(x):
raise TypeError(msg)
if len(X) == 0:
return []
lenX = np.fromiter((len(x) for x in... | 182 | util.py | Python | pandas/core/reshape/util.py | f65417656ba8c59438d832b6e2a431f78d40c21c | pandas | 9 | |
273,407 | 6 | 8 | 2 | 38 | 5 | 0 | 6 | 20 | set_vocabulary | Reformatting the codebase with black.
PiperOrigin-RevId: 450093126 | https://github.com/keras-team/keras.git | def set_vocabulary(self, vocabulary, idf_weights=None):
self._lookup_layer.set_vocabulary(vocabulary, idf_weights=idf_weights)
| 24 | text_vectorization.py | Python | keras/layers/preprocessing/text_vectorization.py | 84afc5193d38057e2e2badf9c889ea87d80d8fbf | keras | 1 | |
189,932 | 30 | 15 | 14 | 170 | 16 | 0 | 37 | 111 | select_resolution | Moved functionality over from `manim new` to `manim init` and added deprecation warning for `manim new` (#2842)
* moved functionality over from manim new to manim init and deprecated manim new
* Updated tests to fit new functionality
* added a test for project creation using manim init project
* [pre-commit.c... | https://github.com/ManimCommunity/manim.git | def select_resolution():
resolution_options = []
for quality in QUALITIES.items():
resolution_options.append(
(quality[1]["pixel_height"], quality[1]["pixel_width"]),
)
resolution_options.pop()
choice = click.prompt(
"\nSelect resolution:\n",
type=click.C... | 95 | commands.py | Python | manim/cli/init/commands.py | 9b731037d9f2c9e647737c9ca44f1a968675feb6 | manim | 5 | |
12,699 | 8 | 9 | 6 | 33 | 7 | 0 | 8 | 22 | is_decompressed_with_data | feat: allow to access parameters of data request wo loading data (#4991) | https://github.com/jina-ai/jina.git | def is_decompressed_with_data(self) -> bool:
return type(self._pb_body) is jina_pb2.DataRequestProto
| 19 | data.py | Python | jina/types/request/data.py | c3849c6fee4a65a77a82b2cfda9670d727ff0f53 | jina | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.