complexity
int64
1
56
n_identifiers
int64
1
114
code
stringlengths
19
12.7k
path
stringlengths
8
134
n_ast_nodes
int64
12
2.35k
ast_errors
stringlengths
0
4.01k
repo
stringlengths
3
28
documentation
dict
n_words
int64
2
866
language
stringclasses
1 value
vocab_size
int64
2
323
commit_id
stringlengths
40
40
file_name
stringlengths
5
79
id
int64
243
338k
nloc
int64
1
228
token_counts
int64
5
1.4k
fun_name
stringlengths
1
77
url
stringlengths
31
60
commit_message
stringlengths
3
15.3k
n_whitespaces
int64
1
3.23k
n_ast_errors
int64
0
20
d_id
int64
74
121k
ast_levels
int64
4
29
3
8
def entry_points(group=None): eps = importlib.metadata.entry_points() if group: try: return eps.select(group=group) except AttributeError: return eps.get(group, []) return eps
dask/compatibility.py
77
dask
{ "docstring": "Returns an iterable of entrypoints.\n\n For compatibility with Python 3.8/3.9.\n In 3.10 the return type changed from a dict to an ``importlib.metadata.EntryPoints``.\n This compatibility utility can be removed once Python 3.10 is the minimum.\n ", "language": "en", "n_whitespaces": 46...
17
Python
14
a9ee6c2fdf0a3093747e675997143e0dbe584bad
compatibility.py
156,894
8
46
entry_points
https://github.com/dask/dask.git
Add `entry_points` compatibility utility (#9388)
65
0
36,798
13
32
6
def eval_sum_residue(f, i_a_b): r i, a, b = i_a_b
sympy/concrete/summations.py
25
sympy
{ "docstring": "Compute the infinite summation with residues\n\n Notes\n =====\n\n If $f(n), g(n)$ are polynomials with $\\deg(g(n)) - \\deg(f(n)) \\ge 2$,\n some infinite summations can be computed by the following residue\n evaluations.\n\n .. math::\n \\sum_{n=-\\infty, g(n) \\ne 0}^{\\inf...
9
Python
9
df873af365fff5b89164ed8eb3a1b62b6180f1bb
summations.py
197,934
149
629
eval_sum_residue
https://github.com/sympy/sympy.git
replaced i with a dummy symbol with no assumptions for get_residue_factor
14
0
48,746
7
6
30
def test_vtrace(self): seq_len = 5 batch_size = 10 # Create log_rhos such that rho will span from near-zero to above the # clipping thresholds. In particular, calculate log_rhos in # [-2.5, 2.5), # so that rho is in approx [0.08, 12.2). space_w_time = Bo...
rllib/agents/impala/tests/test_vtrace.py
344
ray
{ "docstring": "Tests V-trace against ground truth data calculated in python.", "language": "en", "n_whitespaces": 8, "n_words": 9, "vocab_size": 9 }
150
Python
109
7f1bacc7dc9caf6d0ec042e39499bbf1d9a7d065
test_vtrace.py
133,739
25
230
test_vtrace
https://github.com/ray-project/ray.git
[CI] Format Python code with Black (#21975) See #21316 and #21311 for the motivation behind these changes.
433
0
30,090
15
1
19
def test_kb_valid_entities(nlp): mykb = InMemoryLookupKB(nlp.vocab, entity_vector_length=3) # adding entities mykb.add_entity(entity="Q1", freq=19, entity_vector=[8, 4, 3]) mykb.add_entity(entity="Q2", freq=5, entity_vector=[2, 1, 0]) mykb.add_entity(entity="Q3", freq=25, entity_vector=[-1, -6...
spacy/tests/pipeline/test_entity_linker.py
423
spaCy
{ "docstring": "Test the valid construction of a KB with 3 entities and two aliases", "language": "en", "n_whitespaces": 12, "n_words": 13, "vocab_size": 13 }
94
Python
67
1f23c615d7a7326ca5a38a7d768b8b70caaa0e17
test_entity_linker.py
111,524
16
275
test_kb_valid_entities
https://github.com/explosion/spaCy.git
Refactor KB for easier customization (#11268) * Add implementation of batching + backwards compatibility fixes. Tests indicate issue with batch disambiguation for custom singular entity lookups. * Fix tests. Add distinction w.r.t. batch size. * Remove redundant and add new comments. * Adjust comments. Fix var...
157
0
24,423
11
1
4
def delete(self, name): raise NotImplementedError( "subclasses of Storage must provide a delete() method" )
django/core/files/storage.py
25
django
{ "docstring": "\n Delete the specified file from the storage system.\n ", "language": "en", "n_whitespaces": 23, "n_words": 8, "vocab_size": 7 }
14
Python
14
9c19aff7c7561e3a82978a272ecdaad40dda5c00
storage.py
204,484
4
13
delete
https://github.com/django/django.git
Refs #33476 -- Reformatted code with Black.
46
0
50,745
8
2
24
def test_sort_indicators_admin_order(self): models = [ (AdminOrderedField, "adminorderedfield"), (AdminOrderedModelMethod, "adminorderedmodelmethod"), (AdminOrderedAdminMethod, "adminorderedadminmethod"), (AdminOrderedCallable, "adminorderedcallable"), ...
tests/admin_views/tests.py
266
django
{ "docstring": "\n The admin shows default sort indicators for all kinds of 'ordering'\n fields: field names, method on the model admin and model itself, and\n other callables. See #17252.\n ", "language": "en", "n_whitespaces": 56, "n_words": 27, "vocab_size": 24 }
112
Python
80
9c19aff7c7561e3a82978a272ecdaad40dda5c00
tests.py
207,658
20
158
test_sort_indicators_admin_order
https://github.com/django/django.git
Refs #33476 -- Reformatted code with Black.
379
0
52,039
14
2
7
def __setattr__(self, name, value): if name in ("power_status", "status"): self._values[name] = value self._update() else: super().__setattr__(name, value)
tests/components/hdmi_cec/__init__.py
75
core
{ "docstring": "Set attributes in `_values` if not one of the known attributes.", "language": "en", "n_whitespaces": 10, "n_words": 11, "vocab_size": 11 }
16
Python
16
7cd4be1310b3f76398b4404d3f4ecb26b9533cee
__init__.py
303,569
6
44
__setattr__
https://github.com/home-assistant/core.git
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...
70
0
102,387
12
1
4
def remove_child_handler(self, pid): raise NotImplementedError()
python3.10.4/Lib/asyncio/unix_events.py
22
XX-Net
{ "docstring": "Removes the handler for process 'pid'.\n\n The function returns True if the handler was successfully removed,\n False if there was nothing to remove.", "language": "en", "n_whitespaces": 36, "n_words": 23, "vocab_size": 19 }
5
Python
5
8198943edd73a363c266633e1aa5b2a9e9c9f526
unix_events.py
220,945
2
12
remove_child_handler
https://github.com/XX-net/XX-Net.git
add python 3.10.4 for windows
19
0
56,172
7
5
23
def _set_modes_and_presets(self) -> None: all_modes: dict[HVACMode, int | None] = {} all_presets: dict[str, int | None] = {PRESET_NONE: None} # Z-Wave uses one list for both modes and presets. # Iterate over all Z-Wave ThermostatModes and extract the hvac modes and presets. ...
homeassistant/components/zwave_js/climate.py
197
core
{ "docstring": "Convert Z-Wave Thermostat modes into Home Assistant modes and presets.", "language": "en", "n_whitespaces": 9, "n_words": 10, "vocab_size": 9 }
94
Python
62
24b4690e5d855be362613583a3ba6fd6f60e9929
climate.py
299,023
18
123
_set_modes_and_presets
https://github.com/home-assistant/core.git
Use climate enums in zwave_js (#70757)
317
0
97,961
13
5
14
def __next__(self) -> Any: if not len(self.loader_iters) == len(self.loaders): raise RuntimeError('loader_iters must have the same length as loaders.') for i, (loader_name, iterator) in enumerate(self.loader_iters.items()): try: return (self.request_next_...
nni/retiarii/oneshot/pytorch/dataloader.py
128
nni
{ "docstring": "Fetches the next batch from multiple data loaders,\n by looking for the first iterator that isn't exhausted yet.\n ", "language": "en", "n_whitespaces": 32, "n_words": 18, "vocab_size": 17 }
37
Python
34
39ec21ca1118e7a8df533aa06bcb5e515a93aa02
dataloader.py
112,922
12
78
__next__
https://github.com/microsoft/nni.git
Multi-GPU support of one-shot NAS (#4603)
140
0
24,789
14
4
18
def register(self, cmap, *, name=None, force=False): name = name or cmap.name if name in self and not force: raise ValueError( f'A colormap named "{name}" is already registered.') register_cmap(name, cmap.copy()) _cmap_registry = _gen_cmap_registry() global...
lib/matplotlib/cm.py
139
matplotlib
{ "docstring": "\n Register a new colormap.\n\n The colormap name can then be used as a string argument to any ``cmap``\n parameter in Matplotlib. It is also available in ``pyplot.get_cmap``.\n\n The colormap registry stores a copy of the given colormap, so that\n future changes to ...
77
Python
64
917c7c8b2cecf3ff85ed7527bb2aca13779fac13
cm.py
107,934
6
49
register
https://github.com/matplotlib/matplotlib.git
Add missing space before : for parameters
122
0
22,976
11
3
11
def config_test(self) -> None: os_info = util.get_os_info() fedora = os_info[0].lower() == "fedora" try: super().config_test() except errors.MisconfigurationError: if fedora: self._try_restart_fedora() else: r...
certbot-apache/certbot_apache/_internal/override_centos.py
94
certbot
{ "docstring": "\n Override config_test to mitigate configtest error in vanilla installation\n of mod_ssl in Fedora. The error is caused by non-existent self-signed\n certificates referenced by the configuration, that would be autogenerated\n during the first (re)start of httpd.\n "...
21
Python
20
7d9e9a49005de7961e84d2a7c608db57dbab3046
override_centos.py
186,661
16
52
config_test
https://github.com/certbot/certbot.git
Add typing to certbot.apache (#9071) * Add typing to certbot.apache Co-authored-by: Adrien Ferrand <ferrand.ad@gmail.com>
119
0
45,569
12
4
11
def find_location(self, root, path, prefix=None): if prefix: prefix = "%s%s" % (prefix, os.sep) if not path.startswith(prefix): return None path = path[len(prefix) :] path = safe_join(root, path) if os.path.exists(path): re...
django/contrib/staticfiles/finders.py
110
django
{ "docstring": "\n Find a requested static file in a location and return the found\n absolute path (or ``None`` if no match).\n ", "language": "en", "n_whitespaces": 41, "n_words": 19, "vocab_size": 18 }
30
Python
23
9c19aff7c7561e3a82978a272ecdaad40dda5c00
finders.py
204,340
9
69
find_location
https://github.com/django/django.git
Refs #33476 -- Reformatted code with Black.
117
0
50,703
12
7
13
def del_store(name, store, saltenv="base"): ret = {"name": name, "result": True, "comment": "", "changes": {}} cert_file = __salt__["cp.cache_file"](name, saltenv) if cert_file is False: ret["comment"] = "Certificate file not found: {}".format(name) ret["result"] = False return...
salt/states/win_certutil.py
449
salt
{ "docstring": "\n Remove a certificate from the given certificate store\n\n Args:\n\n name (str):\n The path to the certificate to remove from the store. This is either\n the path to a local file or a file from the file server in the form\n of ``salt://path/to/file``\n\n...
131
Python
63
a8d2d1e1397cdc79b2c5f1ad7f6e3b729dcf8857
win_certutil.py
215,895
33
252
del_store
https://github.com/saltstack/salt.git
Add tests, fix state module
302
0
54,230
12
3
12
def _load_raw(self, datapath): if not PathManager.exists(datapath): raise RuntimeError( f'Conversations at path {datapath} not found. ' 'Double check your path.' ) with PathManager.open(datapath, 'r') as f: lines = f.read().sp...
parlai/utils/conversations.py
101
ParlAI
{ "docstring": "\n Load the data as a raw, unparsed file.\n\n Useful for fast IO stuff like random indexing.\n ", "language": "en", "n_whitespaces": 38, "n_words": 16, "vocab_size": 16 }
34
Python
32
74e12d10bdf6e8f8abc82056e00d6e2360b871af
conversations.py
194,838
10
54
_load_raw
https://github.com/facebookresearch/ParlAI.git
[teachers] Speed up conversations teacher (#4404) * Speed up conversations teacher. * Whoops. * Okay let's try bringing back train mode. * Update test_conversations.py * Update conversations.py * Update test.py
144
0
47,108
12
4
20
def Error(filename, linenum, category, confidence, message): if _ShouldPrintError(category, confidence, linenum): _cpplint_state.IncrementErrorCount(category) if _cpplint_state.output_format == 'vs7': sys.stderr.write('%s(%s): %s [%s] [%d]\n' % ( filename, linenum, message, category, conf...
code/deep/BJMMD/caffe/scripts/cpp_lint.py
241
transferlearning
{ "docstring": "Logs the fact we've found a lint error.\n\n We log where the error was found, and also our confidence in the error,\n that is, how certain we are this is a legitimate style regression, and\n not a misidentification or a use that's sometimes justified.\n\n False positives can be suppressed by the u...
192
Python
120
cc4d0564756ca067516f71718a3d135996525909
cpp_lint.py
60,411
12
106
Error
https://github.com/jindongwang/transferlearning.git
Balanced joint maximum mean discrepancy for deep transfer learning
246
0
12,139
14
1
6
def _new_batch_builder(self, _) -> _PolicyCollectorGroup: return _PolicyCollectorGroup(self._worker.policy_map)
rllib/evaluation/env_runner_v2.py
32
ray
{ "docstring": "Create a new batch builder.\n\n We create a _PolicyCollectorGroup based on the full policy_map\n as the batch builder.\n ", "language": "en", "n_whitespaces": 39, "n_words": 18, "vocab_size": 14 }
7
Python
7
52bb8e47d483082e528fc8595005e0813a46efb8
env_runner_v2.py
124,015
7
19
_new_batch_builder
https://github.com/ray-project/ray.git
[RLlib] EnvRunnerV2 and EpisodeV2 that support Connectors. (#25922)
21
0
27,496
9
1
8
def test_huggingface_text_generation() -> None: llm = HuggingFaceHub(repo_id="gpt2", model_kwargs={"max_new_tokens": 10}) output = llm("Say foo:") assert isinstance(output, str)
tests/integration_tests/llms/test_huggingface_hub.py
65
langchain
{ "docstring": "Test valid call to HuggingFace text generation model.", "language": "en", "n_whitespaces": 7, "n_words": 8, "vocab_size": 8 }
16
Python
15
b9f61390e9cf7f4b8b809cba56392d1f7b3ef6e6
test_huggingface_hub.py
191,455
5
36
test_huggingface_text_generation
https://github.com/hwchase17/langchain.git
add text2text generation (#93) fixes issue #90
28
0
46,587
12
2
9
def parse_options(self, server_name=None, from_ip=None, ip=None): self.ServerName = server_name self.ip = ip if isinstance(from_ip, str): self.from_ip = Net(from_ip) else: self.from_ip = from_ip
scapy/layers/netbios.py
81
scapy
{ "docstring": "\n NBNS answering machine\n\n :param server_name: the netbios server name to match\n :param from_ip: an IP (can have a netmask) to filter on\n :param ip: the IP to answer with\n ", "language": "en", "n_whitespaces": 65, "n_words": 29, "vocab_size": 23 }
21
Python
17
dd7a5c97d68c00d1d03ecf8ac27c6c7038525065
netbios.py
209,498
7
51
parse_options
https://github.com/secdev/scapy.git
Answering machines improvements (NBNS/DNS/LLMNR) (#3699) * Minor NBNS improvements * Improve Netbios/LLMNR/DNS answering machines * DNS_am: support IPv6 * More customization of some answering machines
78
0
52,692
10
2
6
def check_classification_targets(y): y_type = type_of_target(y, input_name="y") if y_type not in [ "binary", "multiclass", "multiclass-multioutput", "multilabel-indicator", "multilabel-sequences", ]: raise ValueError("Unknown label type: %r" % y_type)
sklearn/utils/multiclass.py
74
scikit-learn
{ "docstring": "Ensure that target y is of a non-regression type.\n\n Only the following target types (as defined in type_of_target) are allowed:\n 'binary', 'multiclass', 'multiclass-multioutput',\n 'multilabel-indicator', 'multilabel-sequences'\n\n Parameters\n ----------\n y : array-like\...
24
Python
23
f9d74236e26f6169b32e23887f30879c32ac76c7
multiclass.py
259,173
10
40
check_classification_targets
https://github.com/scikit-learn/scikit-learn.git
fix docstring of dict_learning.sparse_encode and multiclass.check_classification_targets #21350 #pariswimlds (#22793) * fix docstring * fixed linting in multiclass * fixed linting in dict learning * fixed linting in dict learning * fixed linting in dict learning * fixed linting in dict learning * fix...
78
0
75,624
11
15
103
async def wma_command(ctx, ticker="", window="", offset="", start="", end=""): try: # Debug if cfg.DEBUG: logger.debug( "!stocks.ta.wma %s %s %s %s %s", ticker, window, offset, start, en...
discordbot/stocks/technical_analysis/wma.py
1,097
OpenBBTerminal
{ "docstring": "Displays chart with weighted moving average [Yahoo Finance]", "language": "en", "n_whitespaces": 7, "n_words": 8, "vocab_size": 8 }
271
Python
169
f40ba0d256a78ab2b8461f0df3a9a52ca7dc5704
wma.py
281,206
93
653
wma_command
https://github.com/OpenBB-finance/OpenBBTerminal.git
Bot logging fix (#1105) * Write bot logs to stdout instead of a file Heroku's logging uses the stdout and has problems with files * Send "you snooze you lose" only if debug flag is enabled * Replace print statements with logger entries in the economy menu * Add logging to bot menu command calls * Silence ...
1,162
0
83,612
18
1
20
def test_worker_group_replicas(group_index, expected_max_replicas, expected_replicas): raycluster = get_basic_ray_cr() # Add a worker group without maxReplicas to confirm behavior # when maxReplicas is not specified. no_max_replicas_group = copy.deepcopy(raycluster["spec"]["workerGroupSpecs"][0]) ...
python/ray/tests/kuberay/test_kuberay_node_provider.py
229
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Not relevant on Windows.") @pytest.mark.parametrize( "attempted_target_replica_count,expected_target_replica_count", [(200, 200), (250, 250), (300, 300), (400, 300), (1000, 300)], )
ray
{ "docstring": "Basic unit test for _worker_group_max_replicas and _worker_group_replicas\n\n Uses a RayCluster CR with worker groups with 300 maxReplicas, 200 maxReplicas,\n and unspecified maxReplicas, in that order.\n ", "language": "en", "n_whitespaces": 34, "n_words": 25, "vocab_size": 21 }
73
Python
63
c976799dfd96806ec9972a287835f7a034ec3d2c
test_kuberay_node_provider.py
136,642
9
79
test_worker_group_replicas
https://github.com/ray-project/ray.git
KubeRay node provider refactor (#30281) Implements KubeRay node provider as a "BatchingNodeProvider". Builds on #29933. Summary of design An autoscaler update now works like this: list pod data from k8s check if it's safe to proceed with update. Abort the update if not. do some internal calculation to determ...
112
1
30,964
12
1
10
def test_resolve_forward_ref_dataclass(create_module): module = create_module( # language=Python
tests/test_forward_ref.py
47
module = create_module( # language=Python """@dataclass
pydantic
{ "docstring": "\nfrom __future__ import annotations\n\nfrom dataclasses import dataclass\n\nfrom pydantic import BaseModel\nfrom typing_extensions import Literal\n\n@dataclass", "language": "en", "n_whitespaces": 12, "n_words": 17, "vocab_size": 11 }
7
Python
7
594effa279668bd955e98f1cd5c036b37d3bbd40
test_forward_ref.py
14,420
20
36
test_resolve_forward_ref_dataclass
https://github.com/pydantic/pydantic.git
Switching to `pydantic_core` (#4516) * working on core schema generation * adapting main.py * getting tests to run * fix tests * disable pyright, fix mypy * moving to class-based model generation * working on validators * change how models are created * start fixing test_main.py * fixing myp...
24
2
2,848
4
7
27
def subplot2grid(shape, loc, rowspan=1, colspan=1, fig=None, **kwargs): if fig is None: fig = gcf() rows, cols = shape gs = GridSpec._check_gridspec_exists(fig, rows, cols) subplotspec = gs.new_subplotspec(loc, rowspan=rowspan, colspan=colspan) ax = fig.add_subplot(subplotspec, **kwa...
lib/matplotlib/pyplot.py
203
matplotlib
{ "docstring": "\n Create a subplot at a specific location inside a regular grid.\n\n Parameters\n ----------\n shape : (int, int)\n Number of rows and of columns of the grid in which to place axis.\n loc : (int, int)\n Row number and column number of the axis location within the grid.\n ...
76
Python
58
23338c7eb4b315cd4af0c57b61afc80f8c2086f9
pyplot.py
107,945
17
129
subplot2grid
https://github.com/matplotlib/matplotlib.git
Deprecate auto-removal of overlapping Axes by plt.subplot{,2grid}. In particular, note that the OO add_subplot does not have this behavior.
181
0
22,983
12
9
42
def migrate_product_tax_codes(apps, _schema_editor): Product = apps.get_model("product", "Product") ProductType = apps.get_model("product", "ProductType") TaxClass = apps.get_model("tax", "TaxClass") query = Q(metadata__has_key=VATLAYER_CODE_META_KEY) | Q( metadata__has_key=AVATAX_CODE_ME...
saleor/tax/migrations/0004_migrate_tax_classes.py
536
saleor
{ "docstring": "Create tax classes by migrating currently used tax codes.\n\n Tax codes are stored in metadata of products and product types. For each found code\n we get or create a TaxClass instance and assign the object to the tax class.\n If object has both Avalara and Vatlayer codes, keep only the Avala...
113
Python
61
67df28935c555fdd673f17e8c9183e24dde7c51f
0004_migrate_tax_classes.py
29,532
40
329
migrate_product_tax_codes
https://github.com/saleor/saleor.git
Simple (flat rate) taxes API (#9784) * Add empty tax module * Add tax models (#9839) * Add tax API queries (#9856) * Add MANAGE_TAXES permission * Add tax configuration queries * Create tax configuration when channel is created * Drop sorters for now * Add TaxConfigurationPerCountry type * Upda...
441
0
5,234
16
6
32
async def async_inference_detector(model, imgs): if not isinstance(imgs, (list, tuple)): imgs = [imgs] cfg = model.cfg if isinstance(imgs[0], np.ndarray): cfg = cfg.copy() # set loading pipeline type cfg.data.test.pipeline[0].type = 'LoadImageFromWebcam' cfg.data....
mmdet/apis/inference.py
314
mmdetection
{ "docstring": "Async inference image(s) with the detector.\n\n Args:\n model (nn.Module): The loaded detector.\n img (str | ndarray): Either image files or loaded images.\n\n Returns:\n Awaitable detection results.\n ", "language": "en", "n_whitespaces": 56, "n_words": 26, "voca...
113
Python
80
2631e2879acf0bd20a64dfdd7039f37a8e6afbf6
inference.py
244,324
24
193
async_inference_detector
https://github.com/open-mmlab/mmdetection.git
Support Datasampler
298
0
70,325
17
6
7
def isGoalState(self): for i in range(self.size): for j in range(self.size): if i == j and j == self.size - 1: continue if self.state[i][j] != (i) * self.size + (j + 1): return False return True
Eight_Puzzle_Solver/eight_puzzle.py
108
Python
{ "docstring": "\n Parameters: State\n Returns: True if Goal State, otherwise False\n Restrictions: State is self.size x self.size Array\n ", "language": "en", "n_whitespaces": 45, "n_words": 16, "vocab_size": 14 }
35
Python
24
f0af0c43340763724f139fa68aa1e5a9ffe458b4
eight_puzzle.py
22,411
8
69
isGoalState
https://github.com/geekcomputers/Python.git
refactor: clean code Signed-off-by: slowy07 <slowy.arfy@gmail.com>
135
0
4,321
13
1
5
def combine_first(self, other): # noqa: PR01, RT01, D200 return self._binary_op("combine_first", other, _axis=0)
modin/pandas/base.py
36
modin
{ "docstring": "\n Update null elements with value in the same location in `other`.\n ", "language": "en", "n_whitespaces": 26, "n_words": 11, "vocab_size": 10 }
12
Python
12
605efa618e7994681f57b11d04d417f353ef8d50
base.py
153,568
2
21
combine_first
https://github.com/modin-project/modin.git
DOCS-#3099: Fix `BasePandasDataSet` docstrings warnings (#4333) Co-authored-by: Yaroslav Igoshev <Poolliver868@mail.ru> Signed-off-by: Alexander Myskov <alexander.myskov@intel.com>
27
0
35,449
8
4
22
def testOnCheckpointOrdered(self): keep_checkpoints_num = 2 checkpoint_manager = self.checkpoint_manager(keep_checkpoints_num) checkpoints = [ Checkpoint(Checkpoint.PERSISTENT, {i}, self.mock_result(i)) for i in range(3) ] with patch.object(check...
python/ray/tune/tests/test_checkpoint_manager.py
231
ray
{ "docstring": "\n Tests increasing priorities. Also tests that that the worst checkpoints\n are deleted when necessary.\n ", "language": "en", "n_whitespaces": 36, "n_words": 14, "vocab_size": 13 }
54
Python
45
7f1bacc7dc9caf6d0ec042e39499bbf1d9a7d065
test_checkpoint_manager.py
132,416
19
148
testOnCheckpointOrdered
https://github.com/ray-project/ray.git
[CI] Format Python code with Black (#21975) See #21316 and #21311 for the motivation behind these changes.
251
0
29,752
12
1
7
def inverse_transform(self, X): check_is_fitted(self) X = check_array(X) return (X @ self.components_) + self.mean_
sklearn/decomposition/_sparse_pca.py
50
scikit-learn
{ "docstring": "Transform data from the latent space to the original space.\n\n This inversion is an approximation due to the loss of information\n induced by the forward decomposition.\n\n .. versionadded:: 1.2\n\n Parameters\n ----------\n X : ndarray of shape (n_samples, n...
13
Python
13
01fcf8a0acc7e6517faa4fc6887eb45f5d2ea77b
_sparse_pca.py
260,502
4
30
inverse_transform
https://github.com/scikit-learn/scikit-learn.git
ENH add inverse_transform in *SparsePCA (#23905)
41
0
76,297
9
1
6
def get_student_group_strength(student_group): student_group_strength = frappe.db.sql( , student_group, )[0][0] return student_group_strength
erpnext/education/report/student_batch_wise_attendance/student_batch_wise_attendance.py
41
erpnext
{ "docstring": "select count(*) from `tabStudent Group Student`\n\t\twhere parent = %s and active=1", "language": "en", "n_whitespaces": 10, "n_words": 12, "vocab_size": 12 }
10
Python
9
494bd9ef78313436f0424b918f200dab8fc7c20b
student_batch_wise_attendance.py
65,944
7
26
get_student_group_strength
https://github.com/frappe/erpnext.git
style: format code with black
4
0
14,064
11
1
11
def wait_for_text_to_equal(self, selector, text, timeout=None): return self._wait_for( method=text_to_equal, args=(selector, text), timeout=timeout, msg=f"text -> {text} not found within {timeout or self._wait_timeout}s", )
dash/testing/browser.py
73
dash
{ "docstring": "Explicit wait until the element's text equals the expected `text`.\n\n timeout if not set, equals to the fixture's `wait_timeout`\n shortcut to `WebDriverWait` with customized `text_to_equal`\n condition.\n ", "language": "en", "n_whitespaces": 54, "n_words": 26, "v...
21
Python
21
c3c84b9ecf16bcc61ed80ec39d511af92fe07f2c
browser.py
40,215
7
41
wait_for_text_to_equal
https://github.com/plotly/dash.git
f-strings everywhere! fffff
86
0
7,354
12
3
11
def stack_pos(self) -> str: try: idx = self.context.layers.index(self) except ValueError: return repr(self) else: return " >> ".join(repr(x) for x in self.context.layers[: idx + 1])
mitmproxy/proxy/layer.py
94
mitmproxy
{ "docstring": "repr() for this layer and all its parent layers, only useful for debugging.", "language": "en", "n_whitespaces": 12, "n_words": 13, "vocab_size": 12 }
24
Python
22
b3587b52b25077f68116b9852b041d33e7fc6601
layer.py
251,443
8
56
stack_pos
https://github.com/mitmproxy/mitmproxy.git
make it black!
85
0
73,741
14
2
21
def apply_node_provider_config_updates(config, node_cfg, node_type_name, max_count): tags = node_provider_tags(config, node_type_name) tags[TAG_RAY_CLUSTER_NAME] = DEFAULT_CLUSTER_NAME user_tag_specs = node_cfg.get("TagSpecifications", []) tag_specs = [ { "ResourceType": "instan...
python/ray/tests/aws/utils/helpers.py
184
ray
{ "docstring": "\n Applies default updates made by AWSNodeProvider to node_cfg during node\n creation. This should only be used for testing purposes.\n\n Args:\n config: autoscaler config\n node_cfg: node config\n node_type_name: node type name\n max_count: max nodes of the given ...
57
Python
50
7f1bacc7dc9caf6d0ec042e39499bbf1d9a7d065
helpers.py
131,089
18
110
apply_node_provider_config_updates
https://github.com/ray-project/ray.git
[CI] Format Python code with Black (#21975) See #21316 and #21311 for the motivation behind these changes.
150
0
29,475
15
1
8
def test_relative_name(file): result = file.rename(name="..\\rel\\path\\test", source=str(source)) assert "is not an absolute path" in result.filtered["comment"] assert result.filtered["result"] is False
tests/pytests/functional/states/file/test_rename.py
76
salt
{ "docstring": "\n Test file.rename when name is a relative path\n ", "language": "en", "n_whitespaces": 15, "n_words": 8, "vocab_size": 8 }
18
Python
17
a35b29b2651bf33c5d5b45e64bc7765ffde4aff4
test_rename.py
215,828
4
41
test_relative_name
https://github.com/saltstack/salt.git
Add some funtional tests Add functional tests for the following: - file.readlink - file.replace - file.symlink Remove unit tests for file.replace as they are duplicated in the added functional test
30
0
54,194
11
1
2
def ybingroup(self): return self["ybingroup"]
packages/python/plotly/plotly/graph_objs/_histogram2d.py
22
plotly.py
{ "docstring": "\n Set a group of histogram traces which will have compatible\n y-bin settings. Using `ybingroup`, histogram2d and\n histogram2dcontour traces (on axes of the same axis type) can\n have compatible y-bin settings. Note that the same `ybingroup`\n value can be used to...
4
Python
4
43e3a4011080911901176aab919c0ecf5046ddd3
_histogram2d.py
227,054
2
11
ybingroup
https://github.com/plotly/plotly.py.git
switch to black .22
18
0
58,727
7
1
11
def debug_mutated_model(base_model, evaluator, applied_mutators): base_model_ir, applied_mutators = preprocess_model(base_model, evaluator, applied_mutators) from ..strategy import _LocalDebugStrategy strategy = _LocalDebugStrategy() strategy.run(base_model_ir, applied_mutators) _logger.info('l...
nni/retiarii/experiment/pytorch.py
78
nni
{ "docstring": "\n Locally run only one trial without launching an experiment for debug purpose, then exit.\n For example, it can be used to quickly check shape mismatch.\n\n Specifically, it applies mutators (default to choose the first candidate for the choices)\n to generate a new model, then run this ...
22
Python
19
5b7dac5c4054115854b3684ba86b9a79fb18d5eb
pytorch.py
111,857
6
47
debug_mutated_model
https://github.com/microsoft/nni.git
Wrap one-shot algorithms as strategies (#4571)
40
0
24,492
8
5
11
def k_crust(G, k=None, core_number=None): # Default for k is one less than in _core_subgraph, so just inline. # Filter is c[v] <= k if core_number is None: core_number = nx.core_number(G) if k is None: k = max(core_number.values()) - 1 nodes = (v for v in core_number if core_...
networkx/algorithms/core.py
115
networkx
{ "docstring": "Returns the k-crust of G.\n\n The k-crust is the graph G with the edges of the k-core removed\n and isolated nodes found after the removal of edges are also removed.\n\n Parameters\n ----------\n G : NetworkX graph\n A graph or directed graph.\n k : int, optional\n The ord...
52
Python
35
17fa9942568bfca34d4a68f8d93c538014f69389
core.py
176,278
7
71
k_crust
https://github.com/networkx/networkx.git
Fix functions appearing in variables `__all__` but not in docs for NX2.7 (#5289) * Adjust functions appearing in `__all__` but not in docs * clean up coloring: merge two modules make interchange private * fix duplicate name. Probably should be changed * fix "see also" doc of recursive_simple_cycles * Rm in...
90
0
41,801
13
4
17
def native_unit_of_measurement(self) -> str | None: raw_units = self.raw_unit_of_measurement # Check if this is a known index pair UOM if isinstance(raw_units, dict) or raw_units in (UOM_ON_OFF, UOM_INDEX): return None if raw_units in ( UnitOfTemperature....
homeassistant/components/isy994/sensor.py
94
core
{ "docstring": "Get the Home Assistant unit of measurement for the device.", "language": "en", "n_whitespaces": 9, "n_words": 10, "vocab_size": 9 }
41
Python
33
a6ddac9004b7f73633f2019f3b5267e1486756c1
sensor.py
297,698
12
61
native_unit_of_measurement
https://github.com/home-assistant/core.git
Use UnitOfTemperature in integrations (i-m) (#84307)
145
0
96,664
11
1
15
def test_get_repositories_all_and_pagination(self): with self.tasks(): self.assert_setup_flow() integration = Integration.objects.get(provider=self.provider.key) installation = integration.get_installation(self.organization) result = installation.get_repositories()...
tests/sentry/integrations/github/test_integration.py
160
sentry
{ "docstring": "Fetch all repositories and test the pagination logic.", "language": "en", "n_whitespaces": 7, "n_words": 8, "vocab_size": 8 }
31
Python
24
d6bcead1be02914e9734ab23f5e476b3d6f3f2cb
test_integration.py
86,734
11
86
test_get_repositories_all_and_pagination
https://github.com/getsentry/sentry.git
fix(github): Add pagination when fetching repositories (#39750) We are not using pagination for Github's repositories endpoint. This means we were getting up to a maximum of 100 repositories. I do not know how no one hit any issues in the past. This is work to support WOR-2234 and creating automatic code mapping...
124
0
18,162
11
11
26
def bivariate_type(f, x, y, *, first=True): u = Dummy('u', positive=True) if first: p = Poly(f, x, y) f = p.as_expr() _x = Dummy() _y = Dummy() rv = bivariate_type(Poly(f.subs({x: _x, y: _y}), _x, _y), _x, _y, first=False) if rv: reps = {_x: x, ...
sympy/solvers/bivariate.py
328
sympy
{ "docstring": "Given an expression, f, 3 tests will be done to see what type\n of composite bivariate it might be, options for u(x, y) are::\n\n x*y\n x+y\n x*y+x\n x*y+y\n\n If it matches one of these types, ``u(x, y)``, ``P(u)`` and dummy\n variable ``u`` will be returned. Solv...
90
Python
60
59d22b6bb7287613d598611027f640d068ca5748
bivariate.py
196,418
43
412
bivariate_type
https://github.com/sympy/sympy.git
Moved imports to higher level
237
0
47,918
16
6
32
def get_table_description(self, cursor, table_name): cursor.execute( "PRAGMA table_info(%s)" % self.connection.ops.quote_name(table_name) ) table_info = cursor.fetchall() if not table_info: raise DatabaseError(f"Table {table_name} does not exist (empty pr...
django/db/backends/sqlite3/introspection.py
257
django
{ "docstring": "\n Return a description of the table with the DB-API cursor.description\n interface.\n \n SELECT sql\n FROM sqlite_master\n WHERE\n type = 'table' AND\n name = %s AND\n ...
85
Python
60
9c19aff7c7561e3a82978a272ecdaad40dda5c00
introspection.py
205,197
42
167
get_table_description
https://github.com/django/django.git
Refs #33476 -- Reformatted code with Black.
518
0
51,030
15
1
10
def test_render_none_as_context_variable(self): context = {"image": None, "image_node": "fake value"} node = ImageNode(Variable("image"), "original", "image_node") rendered = node.render(context) self.assertEqual(rendered, "") self.assertIsNone(context["image_node"])
wagtail/images/tests/test_templatetags.py
103
wagtail
{ "docstring": "\n Tests that an ImageNode without an image and a context variable name\n renders an empty string and puts None in the context variable\n ", "language": "en", "n_whitespaces": 45, "n_words": 23, "vocab_size": 18 }
20
Python
18
d10f15e55806c6944827d801cd9c2d53f5da4186
test_templatetags.py
75,309
6
55
test_render_none_as_context_variable
https://github.com/wagtail/wagtail.git
Reformat with black
62
0
16,388
11
8
13
def sieveEr(N): from math import sqrt # precondition assert isinstance(N, int) and (N > 2), "'N' must been an int and > 2" primes = [True for x in range(N + 1)] for p in range(2, int(sqrt(N)) + 1): if primes[p]: for i in range(p * p, N + 1, p): primes[i] =...
primelib/primelib.py
195
Python
{ "docstring": "\n input: positive integer 'N' > 2\n returns a list of prime numbers from 2 up to N.\n\n This function implements the algorithm called\n sieve of erathostenes.\n\n ", "language": "en", "n_whitespaces": 42, "n_words": 26, "vocab_size": 24 }
76
Python
52
f0af0c43340763724f139fa68aa1e5a9ffe458b4
primelib.py
22,743
15
125
sieveEr
https://github.com/geekcomputers/Python.git
refactor: clean code Signed-off-by: slowy07 <slowy.arfy@gmail.com>
159
0
4,434
13
10
29
def plotting_context(context=None, font_scale=1, rc=None): if context is None: context_dict = {k: mpl.rcParams[k] for k in _context_keys} elif isinstance(context, dict): context_dict = context else: contexts = ["paper", "notebook", "talk", "poster"] if context not in ...
seaborn/rcmod.py
472
seaborn
{ "docstring": "\n Get the parameters that control the scaling of plot elements.\n\n This affects things like the size of the labels, lines, and other elements\n of the plot, but not the overall style. This is accomplished using the\n :ref:`matplotlib rcParams system <matplotlib:matplotlib-rcparams>`.\n\n...
195
Python
120
f7e25e18983f2f36a1529cd9e4bda6fa008cbd6d
rcmod.py
40,304
44
290
plotting_context
https://github.com/mwaskom/seaborn.git
Use f-strings for string formatting (#2800) Reformats all the text from the old "%-formatted" and .format(...) format to the newer f-string format, as defined in PEP 498. This requires Python 3.6+. Flynt 0.76 was used to reformat the strings. 45 f-strings were created in 13 files. F-strings are in general more r...
586
0
7,383
17
4
9
def getcoroutinestate(coroutine): if coroutine.cr_running: return CORO_RUNNING if coroutine.cr_suspended: return CORO_SUSPENDED if coroutine.cr_frame is None: return CORO_CLOSED return CORO_CREATED
Lib/inspect.py
52
cpython
{ "docstring": "Get current state of a coroutine object.\n\n Possible states are:\n CORO_CREATED: Waiting to start execution.\n CORO_RUNNING: Currently being executed by the interpreter.\n CORO_SUSPENDED: Currently suspended at an await expression.\n CORO_CLOSED: Execution has completed.\n "...
18
Python
13
b04dfbbe4bd7071d46c8688c2263726ea31d33cd
inspect.py
175,794
8
31
getcoroutinestate
https://github.com/python/cpython.git
bpo-46409: Make generators in bytecode (GH-30633) * Add RETURN_GENERATOR and JUMP_NO_INTERRUPT opcodes. * Trim frame and generator by word each. * Minor refactor of frame.c * Update test.test_sys to account for smaller frames. * Treat generator functions as normal functions when evaluating and specializing...
54
0
41,653
7
15
34
def compare_caltech(self, thres): if self.dt_boxes is None or self.gt_boxes is None: return list() dtboxes = self.dt_boxes if self.dt_boxes is not None else list() gtboxes = self.gt_boxes if self.gt_boxes is not None else list() dt_matched = np.zeros(dtboxes.shape[0...
mmdet/evaluation/metrics/crowdhuman_metric.py
539
mmdetection
{ "docstring": "Match the detection results with the ground_truth by Caltech\n matching strategy.\n\n Args:\n thres (float): IOU threshold.\n\n Returns:\n score_list(list[tuple[ndarray, int, str]]): Matching result.\n a list of tuples (dtbox, label, imgID) in the ...
160
Python
73
6fca2160bd676cf011e10bdf4b622efb5688bae0
crowdhuman_metric.py
245,805
45
346
compare_caltech
https://github.com/open-mmlab/mmdetection.git
[Feature] Add CrowdHumanDataset and Metric (#8437) * [Fix] Fix UT to be compatible with pytorch 1.6 (#8707) * Update * Update * force reinstall pycocotools * Fix build_cuda * docker install git * Update * comment other job to speedup process * update * uncomment * Update * Update * ...
795
0
70,897
18
4
10
def get_offset_transform(self): if self._offset_transform is None: self._offset_transform = transforms.IdentityTransform() elif (not isinstance(self._offset_transform, transforms.Transform) and hasattr(self._offset_transform, '_as_mpl_transform')): self._of...
lib/matplotlib/collections.py
105
matplotlib
{ "docstring": "Return the `.Transform` instance used by this artist offset.", "language": "en", "n_whitespaces": 8, "n_words": 9, "vocab_size": 9 }
22
Python
18
c25cf96cfb7e6fc9ad75347cb2a32193c501e82c
collections.py
106,990
8
65
get_offset_transform
https://github.com/matplotlib/matplotlib.git
Switch transOffset to offset_transform. Note that most APIs *previously* already accepted *offset_transform* as kwarg, due to the presence of the `set_offset_transform` setter. Prefer that name (shortening it to `offset_trf` for local variables). Backcompat for the old `transOffset` name is kept in most places by in...
100
0
22,540
12
1
5
def data(request): return request.param @pytest.fixture()
pandas/tests/arrays/masked/test_function.py
30
@pytest.fixture()
pandas
{ "docstring": "\n Fixture returning parametrized 'data' array with different integer and\n floating point types\n ", "language": "en", "n_whitespaces": 22, "n_words": 12, "vocab_size": 12 }
5
Python
5
89be1f053b695c4ce1c0569f737caf3f03c12128
test_function.py
166,960
2
10
data
https://github.com/pandas-dev/pandas.git
DOC: Added docstrings to fixtures defined in array module (#47211)
10
1
39,892
6
9
28
def get_lvm_facts(self): lvm_facts = {'lvm': 'N/A'} if os.getuid() == 0 and self.module.get_bin_path('vgs'): lvm_util_options = '--noheadings --nosuffix --units g --separator ,' vgs_path = self.module.get_bin_path('vgs') # vgs fields: VG #PV #LV #SN Attr V...
lib/ansible/module_utils/facts/hardware/linux.py
550
ansible
{ "docstring": " Get LVM Facts if running as root and lvm utils are available ", "language": "en", "n_whitespaces": 13, "n_words": 12, "vocab_size": 12 }
161
Python
104
b2cde3a8964373d51d24e66692394d98858a2b33
linux.py
267,673
33
325
get_lvm_facts
https://github.com/ansible/ansible.git
Add default value for lvm_facts when lvm or lvm2 is not installed or … (#75989) * Add default value for lvm_facts when lvm or lvm2 is not installed or there are no lvm facts
735
0
78,995
16
1
26
def test_first_event_without_minified_stack_trace_received(self, record_analytics): now = timezone.now() project = self.create_project(first_event=now) project_created.send(project=project, user=self.user, sender=type(project)) data = load_data("javascript") self.store_e...
tests/sentry/receivers/test_onboarding.py
177
sentry
{ "docstring": "\n Test that an analytics event is NOT recorded when\n there no event with minified stack trace is received\n ", "language": "en", "n_whitespaces": 40, "n_words": 18, "vocab_size": 16 }
29
Python
25
ce841204ef3b20d0f6ac812ebb06aebbc63547ac
test_onboarding.py
89,863
18
110
test_first_event_without_minified_stack_trace_received
https://github.com/getsentry/sentry.git
ref(onboarding): Add function to record first event per project with min stack trace -(#42208)
219
0
18,580
12
1
8
def get_yaxis(self): return self.yaxis get_xgridlines = _axis_method_wrapper("xaxis", "get_gridlines") get_xticklines = _axis_method_wrapper("xaxis", "get_ticklines") get_ygridlines = _axis_method_wrapper("yaxis", "get_gridlines") get_yticklines = _axis_method_wrapper("yaxis", "get_tic...
lib/matplotlib/axes/_base.py
84
matplotlib
{ "docstring": "\n [*Discouraged*] Return the YAxis instance.\n\n .. admonition:: Discouraged\n\n The use of this function is discouraged. You should instead\n directly access the attribute ``ax.yaxis``.\n ", "language": "en", "n_whitespaces": 67, "n_words": 23, "voc...
25
Python
18
5af97515b3823b2efa1961253a11e2d77df88637
_base.py
109,257
2
10
get_yaxis
https://github.com/matplotlib/matplotlib.git
Add discouraged admonitions The [*Discouraged*] prefix in the summary line is added in analogy to the [*Deprecated*] prefix we add automatically. We do this so that these "labels" are prominently visible also in summary overviews of the functions in the docs. Since we rarely discourage whole functions, for now I just...
54
0
23,495
7
8
12
def read(self, size=-1): if self.closed: raise ValueError("I/O operation on closed file") if self.size_read >= self.chunksize: return b'' if size < 0: size = self.chunksize - self.size_read if size > self.chunksize - self.size_read: ...
python3.10.4/Lib/chunk.py
215
XX-Net
{ "docstring": "Read at most size bytes from the chunk.\n If size is omitted or negative, read until the end\n of the chunk.\n ", "language": "en", "n_whitespaces": 42, "n_words": 21, "vocab_size": 17 }
67
Python
38
8198943edd73a363c266633e1aa5b2a9e9c9f526
chunk.py
221,321
17
136
read
https://github.com/XX-net/XX-Net.git
add python 3.10.4 for windows
216
0
56,344
11
5
9
def _get_cons(self): if self.__origin__ is None: raise TypeError("Cannot get the underlying type of a " "non-specialized Annotated type.") tree = self._subs_tree() while isinstance(tree, tuple) and tree[0] is Annotated: ...
pipenv/patched/notpip/_vendor/typing_extensions.py
107
pipenv
{ "docstring": "Return the class used to create instance of this type.", "language": "en", "n_whitespaces": 9, "n_words": 10, "vocab_size": 10 }
39
Python
31
f3166e673fe8d40277b804d35d77dcdb760fc3b3
typing_extensions.py
20,881
11
64
_get_cons
https://github.com/pypa/pipenv.git
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...
196
0
3,608
11
6
13
def _task(cls): # type: () -> None log_runtime.debug("TimeoutScheduler Thread spawning @ %f", cls._time()) time_empty = None try: while 1: handle = cls._peek_next() if handle is None: now = cls._time() ...
scapy/contrib/isotp/isotp_soft_socket.py
174
scapy
{ "docstring": "Executed in a background thread, this thread will automatically\n start when the first timeout is added and stop when the last timeout\n is removed or executed.", "language": "en", "n_whitespaces": 39, "n_words": 26, "vocab_size": 22 }
87
Python
58
afa3a8051f6768a23895d72239de44f23c1c210c
isotp_soft_socket.py
208,901
19
98
_task
https://github.com/secdev/scapy.git
Refactoring of ISOTPSoftSockets
400
0
52,558
14
1
6
def test_nonconflicting_autogenerated_basename_different_models(self): self.router.register(r'notes', NoteViewSet) self.router.register(r'notes_basename', BasenameViewSet)
tests/test_routers.py
47
django-rest-framework
{ "docstring": "\n Ensure 2 routers with different models, and a distinct basename specified\n on each does not throw an exception\n ", "language": "en", "n_whitespaces": 40, "n_words": 18, "vocab_size": 18 }
6
Python
6
48a21aa0eb3a95d32456c2a927eff9552a04231e
test_routers.py
48,738
3
28
test_nonconflicting_autogenerated_basename_different_models
https://github.com/encode/django-rest-framework.git
raise ImproperlyConfigured exception if `basename` is not unique (#8438) * raise ImproperlyConfigured if basename already exists * rename already_registered function; return True/False * additional basename tests * additional basename tests * Update rest_framework/routers.py Co-authored-by: David Graves...
27
0
9,589
8
2
5
def cache_full(self) -> bool: if self._cache_info["cache_full"]: return self._cache_info["cache_full"] with self._lock: return self._cache_info["cache_full"]
lib/training/cache.py
64
faceswap
{ "docstring": "bool: ``True`` if the cache has been fully populated. ``False`` if there are items still\n to be cached. ", "language": "en", "n_whitespaces": 25, "n_words": 18, "vocab_size": 17 }
12
Python
10
2beceffad9b15c1fd78f06b9b272563321c5a41e
cache.py
101,282
7
35
cache_full
https://github.com/deepfakes/faceswap.git
Data Augmentation update (#1263) - lib.detected_face - Subclass Masks for Landmark based masks - Add training mask propery + methods to DetectedFace - lib.training_training - subclass TrainingDataGenerator for training and preview data - Split cache into own module - Reduce thread count to ...
55
0
20,701
9
2
18
def put_timestamp(self, feed_id, timestamp): self._fetch_data() with self._lock, open(self._data_file, "wb") as myfile: self._data.update({feed_id: timestamp}) _LOGGER.debug( "Overwriting feed %s timestamp in storage file %s", feed_id, ...
homeassistant/components/feedreader/__init__.py
144
core
{ "docstring": "Update timestamp for given feed id (usually the url).", "language": "en", "n_whitespaces": 8, "n_words": 9, "vocab_size": 9 }
43
Python
41
62a5854e40cb554fecb1eec897d7bcb4c94628fe
__init__.py
301,868
14
86
put_timestamp
https://github.com/home-assistant/core.git
Fix bare except (#72906)
202
0
100,706
13
2
16
def test_link_error_on_chord_header(self, header): self.app.conf.task_allow_error_cb_on_chord_header = True c = chord(header, signature('body')) err = signature('err') errback = c.link_error(err) assert errback == err for header_task in c.tasks: asser...
t/unit/tasks/test_canvas.py
128
celery
{ "docstring": " Test that link_error on a chord also links the header ", "language": "en", "n_whitespaces": 11, "n_words": 10, "vocab_size": 10 }
32
Python
22
3983484defb4564c9baf2a24a6b3af2d0b3c0df7
test_canvas.py
208,396
9
77
test_link_error_on_chord_header
https://github.com/celery/celery.git
Housekeeping for Canvas.py (#7942) * Removed pass from @abstractmethod StampingVisitor.on_signature() * Added unit test: test_repr_empty_group() * Added unit test: test_signature_on_error_adds_error_callback() * Cleaned chord.link_error() implementation * Added a new test suite: test_merge_dictionaries ...
99
0
52,316
11
2
20
def _gen_html_string(self): self.html_string = _hilite_me( self.code_string, self.language, self.style, self.insert_line_no, "border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;", self.file_path, self....
manim/mobject/svg/code_mobject.py
170
manim
{ "docstring": "Function to generate html string with code highlighted and stores in variable html_string.", "language": "en", "n_whitespaces": 12, "n_words": 13, "vocab_size": 13 }
41
Python
37
902e7eb4f0147b5882a613b67467e38a1d47f01e
code_mobject.py
189,448
25
103
gen_html_string
https://github.com/ManimCommunity/manim.git
Hide more private methods from the docs. (#2468) * hide privs from text_mobject.py * hide privs from tex_mobject.py * hide privs from code_mobject.py * hide privs from svg_mobject.py * remove SVGPath and utils from __init__.py * don't import string_to_numbers * hide privs from geometry.py * hide p...
356
0
46,056
16
1
5
def test_iterable_not_string(): constraint = _IterablesNotString() assert constraint.is_satisfied_by([1, 2, 3]) assert constraint.is_satisfied_by(range(10)) assert not constraint.is_satisfied_by("some string")
sklearn/utils/tests/test_param_validation.py
70
scikit-learn
{ "docstring": "Check that a string does not satisfy the _IterableNotString constraint.", "language": "en", "n_whitespaces": 9, "n_words": 10, "vocab_size": 10 }
15
Python
13
b9f623cff0f61c43b194e794da45c81518c57f60
test_param_validation.py
260,597
5
41
test_iterable_not_string
https://github.com/scikit-learn/scikit-learn.git
MAINT Param validation: add helper constraint for cv object (#24010)
30
0
76,365
9
4
13
def get_mapped_key_strings_to_ints(self) -> MutableMapping[str, int]: cache_key_results: MutableMapping[str, int] = {} for org_id, result_dict in self.results.items(): for string, id in result_dict.items(): key = f"{org_id}:{string}" if id is not None...
src/sentry/sentry_metrics/indexer/base.py
111
sentry
{ "docstring": "\n Return the results, but formatted as the following:\n {\n \"1:a\": 10,\n \"1:b\": 11,\n \"1:c\", 12,\n \"2:e\": 13\n }\n This is for when we use indexer_cache.set_many()\n ", "language": "en", ...
33
Python
26
c4cc0467974bcfb2b3c95120bd19c337aa977183
base.py
92,382
18
66
get_mapped_key_strings_to_ints
https://github.com/getsentry/sentry.git
feat(metrics_indexer): Add rate limits functionality to indexer [INGEST-1380] (#36263) * feat(metrics_indexer): Add rate limits functionality to indexer [INGEST-1380] The postgres string indexer now is able to rate limit writes using four sentry options. If that happens, `None` is returned in place of an integer,...
121
0
18,905
13
2
12
def copy(self, update_attrs=None, exclude_fields=None): exclude_fields = ( self.default_exclude_fields_in_copy + self.exclude_fields_in_copy + (exclude_fields or []) ) instance, child_object_map = _copy(self.specific, exclude_fields, update_attrs) ...
wagtail/core/models/__init__.py
97
wagtail
{ "docstring": "Copy this task state, excluding the attributes in the ``exclude_fields`` list and updating any attributes to values\n specified in the ``update_attrs`` dictionary of ``attribute``: ``new value`` pairs", "language": "en", "n_whitespaces": 33, "n_words": 27, "vocab_size": 23 }
27
Python
24
d10f15e55806c6944827d801cd9c2d53f5da4186
__init__.py
73,881
10
63
copy
https://github.com/wagtail/wagtail.git
Reformat with black
109
0
16,158
11
1
14
def extract_tags(self, sentence, topK=20, withWeight=False, allowPOS=(), withFlag=False): self.check_dependency() import jieba import jieba.analyse jieba.setLogLevel(logging.ERROR) res = jieba.analyse.extract_tags(sentence, topK=t...
modules/text/lexical_analysis/jieba_paddle/module.py
108
PaddleHub
{ "docstring": "\n Extract keywords from sentence using TF-IDF algorithm.\n Args:\n topK(int): return how many top keywords. `None` for all possible words.\n withWeight(bool): if True, return a list of (word, weight);\n if False, return a list of words.\n ...
22
Python
20
8468e1ac6cfe165aa1e3cf4f77ab6fb66ce98614
module.py
49,679
25
72
extract_tags
https://github.com/PaddlePaddle/PaddleHub.git
Remove fluid api in modules and pkg. (#1906)
231
0
9,867
9
1
6
def to_list(self): return list(convert_submodules(self.__dict__).values())
ludwig/schema/model_config.py
36
ludwig
{ "docstring": "Method for getting a list representation of the input features.\n\n Returns:\n List of input features specified.\n ", "language": "en", "n_whitespaces": 41, "n_words": 16, "vocab_size": 14 }
4
Python
4
4d2d81f9fdefc52eea6a9bf0826a6f2ffc8d681b
model_config.py
8,421
2
20
to_list
https://github.com/ludwig-ai/ludwig.git
Config Object (#2426) * Fixed loss instances across features * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fixed binary OneOfImplementation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci ...
18
0
1,429
12
1
2
def test_action_not_coerced_for_get_and_head(self):
tests/schemas/test_coreapi.py
13
django-rest-framework
{ "docstring": "\n Ensure that action name is preserved when action map contains \"head\".\n ", "language": "en", "n_whitespaces": 26, "n_words": 11, "vocab_size": 10 }
2
Python
2
df584350b4f77143d84615f05000f71408aec9c0
test_coreapi.py
48,645
46
269
test_action_not_coerced_for_get_and_head
https://github.com/encode/django-rest-framework.git
Prevent head method mapping to coerce action name (#7729)
9
0
9,554
6
1
12
def get_cluster_metadata(gcs_client) -> dict: return json.loads( gcs_client.internal_kv_get( usage_constant.CLUSTER_METADATA_KEY, namespace=ray_constants.KV_NAMESPACE_CLUSTER, ).decode("utf-8") )
python/ray/_private/usage/usage_lib.py
57
ray
{ "docstring": "Get the cluster metadata from GCS.\n\n It is a blocking API.\n\n This will return None if `put_cluster_metadata` was never called.\n\n Params:\n gcs_client: The GCS client to perform KV operation GET.\n\n Returns:\n The cluster metadata in a dictinoary.\n\n Raises:\n ...
11
Python
11
3a48a79fd7d2ed9195baec275562e64e96596de4
usage_lib.py
125,358
22
34
get_cluster_metadata
https://github.com/ray-project/ray.git
[Usage stats] Report total number of running jobs for usage stats purpose. (#26787) - Report total number of running jobs - Fix total number of nodes to include only alive nodes Signed-off-by: Jiajun Yao <jeromeyjj@gmail.com>
56
0
27,847
13
2
19
def test_unblock_room_twice(self) -> None: self._block_room(self.room_id) for _ in range(2): channel = self.make_request( "PUT", self.url % self.room_id, content={"block": False}, access_token=self.admin_user_tok, ...
tests/rest/admin/test_room.py
149
synapse
{ "docstring": "Test that unblock a room that is not blocked is successful.", "language": "en", "n_whitespaces": 10, "n_words": 11, "vocab_size": 9 }
26
Python
26
c97042f7eef3748e17c90e48a4122389a89c4735
test_room.py
249,148
13
94
test_unblock_room_twice
https://github.com/matrix-org/synapse.git
Use literals in place of `HTTPStatus` constants in tests (#13469)
162
0
72,655
14
1
17
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...
tests/rest/admin/test_federation.py
180
synapse
{ "docstring": "Testing list of destinations with a defined starting point and limit", "language": "en", "n_whitespaces": 10, "n_words": 11, "vocab_size": 11 }
27
Python
26
6a72c910f180ee8b4bd78223775af48492769472
test_federation.py
246,112
14
109
test_limit_and_from
https://github.com/matrix-org/synapse.git
Add admin API to get a list of federated rooms (#11658)
130
0
71,018
11
1
6
def face(self) -> Optional[np.ndarray]: return self._face
lib/align/aligned_face.py
29
faceswap
{ "docstring": " :class:`numpy.ndarray`: The aligned face at the given :attr:`size` at the specified\n :attr:`coverage` in the given :attr:`dtype`. If an :attr:`image` has not been provided\n then an the attribute will return ``None``. ", "language": "en", "n_whitespaces": 45, "n_words": 30, "vo...
6
Python
6
a2de4a97985dc62db3b140a924aeac2be733abf8
aligned_face.py
101,190
5
17
face
https://github.com/deepfakes/faceswap.git
lib.align.aligned_face updates - Typing - Legacy support for pre-aligned faces - Coverage support for pre-aligned faces - Standardized retrieval of sub-crops
20
0
20,611
6
3
15
def pyplot(self, fig=None, clear_figure=None, **kwargs): if not fig and config.get_option("deprecation.showPyplotGlobalUse"): self.dg.exception(PyplotGlobalUseWarning()) image_list_proto = ImageListProto() marshall( self.dg._get_delta_path_str(), image_list_pro...
lib/streamlit/elements/pyplot.py
118
streamlit
{ "docstring": "Display a matplotlib.pyplot figure.\n\n Parameters\n ----------\n fig : Matplotlib Figure\n The figure to plot. When this argument isn't specified, this\n function will render the global figure (but this is deprecated,\n as described below)\n\n ...
24
Python
24
72703b38029f9358a0ec7ca5ed875a6b438ece19
pyplot.py
118,742
8
73
pyplot
https://github.com/streamlit/streamlit.git
Replace static apps with live Cloud apps (#4317) Co-authored-by: kajarenc <kajarenc@gmail.com>
88
0
26,399
11
3
17
def print_tensor(x, message="", summarize=3): if isinstance(x, tf.Tensor) and hasattr(x, "graph"): with get_graph().as_default(): op = tf.print( message, x, output_stream=sys.stdout, summarize=summarize ) with tf.control_dependencies([op]): ...
keras/backend.py
160
keras
{ "docstring": "Prints `message` and the tensor value when evaluated.\n\n Note that `print_tensor` returns a new tensor identical to `x`\n which should be used in the following code. Otherwise the\n print operation is not taken into account during evaluation.\n\n Example:\n\n >>> x = tf.constant([[1.0,...
34
Python
30
84afc5193d38057e2e2badf9c889ea87d80d8fbf
backend.py
269,468
11
99
print_tensor
https://github.com/keras-team/keras.git
Reformatting the codebase with black. PiperOrigin-RevId: 450093126
126
0
80,103
14
7
4
def _reassign_keys(cls): rcParams["keymap.fullscreen"] = [k for k in rcParams["keymap.fullscreen"] if k != "f"] rcParams["keymap.save"] = [k for k in rcParams["keymap.save"] if k != "s"] rcParams["keymap.home"] = [k for k in rcParams["keymap.home"] if k != "r"]
scripts/train.py
112
faceswap
{ "docstring": " Remove `F`, 'S' and 'R' from their default bindings. ", "language": "en", "n_whitespaces": 10, "n_words": 9, "vocab_size": 9 }
35
Python
15
7b9fc0454d982a2425ec44e90e5b05a87d149953
train.py
101,031
4
63
_reassign_keys
https://github.com/deepfakes/faceswap.git
Live Preview - Replace cv2 with matplotlib viewer
63
0
20,471
10
6
12
def weight(self) -> int: weight = 0 if self.models: weight += 401 - (1 if callable(self.models) else len(self.models)) if self.manufacturers: weight += 301 - ( 1 if callable(self.manufacturers) else len(self.manufacturers) ) ...
homeassistant/components/zha/core/registries.py
167
core
{ "docstring": "Return the weight of the matching rule.\n\n Most specific matches should be preferred over less specific. Model matching\n rules have a priority over manufacturer matching rules and rules matching a\n single model/manufacturer get a better priority over rules matching multiple\n ...
51
Python
32
8bed2e6459bfc1efb25d6a55aaea2eb1b9953cf9
registries.py
314,673
23
105
weight
https://github.com/home-assistant/core.git
Remove zha from mypy ignore list (#73603)
166
0
113,278
14
4
35
def test_edit_cases(self) -> None: self.login("hamlet") hamlet = self.example_user("hamlet") msg_id = self.send_stream_message( self.example_user("hamlet"), "Denmark", topic_name="topic 1", content="content 1" ) result = self.client_patch( f"/json...
zerver/tests/test_message_edit.py
1,737
zulip
{ "docstring": "This test verifies the accuracy of construction of Zulip's edit\n history data structures.", "language": "en", "n_whitespaces": 19, "n_words": 13, "vocab_size": 12 }
310
Python
136
d560d124a304a2f6dd467200aab7f070a78bf155
test_message_edit.py
83,152
128
1,019
test_edit_cases
https://github.com/zulip/zulip.git
python: Replace string concatenations with f-strings.
1,529
0
17,602
13
6
15
def close(self): # finish decoding if self.decoder: # get rid of what's left in the buffers self.feed(b"") self.data = self.decoder = None if not self.finished: msg = "image was incomplete" raise OSError(msg) ...
src/PIL/ImageFile.py
174
Pillow
{ "docstring": "\n (Consumer) Close the stream.\n\n :returns: An image object.\n :exception OSError: If the parser failed to parse the image file either\n because it cannot be identified or cannot be\n decoded.\n ", "language": "en", ...
74
Python
55
2ae55ccbdad9c842929fb238ea1eb81d1f999024
ImageFile.py
243,737
17
97
close
https://github.com/python-pillow/Pillow.git
Improve exception traceback readability
312
0
70,104
15
1
3
def transform_non_affine(self, values): return values
lib/matplotlib/transforms.py
18
matplotlib
{ "docstring": "\n Apply only the non-affine part of this transformation.\n\n ``transform(values)`` is always equivalent to\n ``transform_affine(transform_non_affine(values))``.\n\n In non-affine transformations, this is generally equivalent to\n ``transform(values)``. In affine tr...
5
Python
5
442e7082140f85de53349bf0bf0e3c98e2eaa44c
transforms.py
107,966
2
10
transform_non_affine
https://github.com/matplotlib/matplotlib.git
Correct cross-references in documentation
19
0
22,992
6
2
7
def collect(self) -> Generator[Metric, None, None]: for pre_update_hook in self._pre_update_hooks: pre_update_hook() yield from super().collect()
synapse/util/metrics.py
56
synapse
{ "docstring": "\n Collects metrics, calling pre-update hooks first.\n ", "language": "en", "n_whitespaces": 21, "n_words": 6, "vocab_size": 6 }
14
Python
14
cf11919ddd4f48b2f59062542ba62969042f80aa
metrics.py
249,473
7
34
collect
https://github.com/matrix-org/synapse.git
Fix cache metrics not being updated when not using the legacy exposition module. (#13717)
46
0
72,940
10
4
11
def get_ranking(pairs): if len(pairs) == 1: return list(pairs[0]) w = get_winner(pairs) # now remove the winner from the list of pairs p_new = np.array([(a, b) for a, b in pairs if a != w]) return [w] + get_ranking(p_new)
backend/postprocessing/rankings.py
98
Open-Assistant
{ "docstring": "\n Abuses concordance property to get a (not necessarily unqiue) ranking.\n The lack of uniqueness is due to the potential existance of multiple\n equally ranked winners. We have to pick one, which is where\n the non-uniqueness comes from\n ", "language": "en", "n_whitespaces": 53, ...
38
Python
33
38ca08446d560797522b7828720032799584d32a
rankings.py
216,630
6
61
get_ranking
https://github.com/LAION-AI/Open-Assistant.git
ran pre-commit hook
63
0
54,671
11
3
12
def flow_hierarchy(G, weight=None): if not G.is_directed(): raise nx.NetworkXError("G must be a digraph in flow_hierarchy") scc = nx.strongly_connected_components(G) return 1 - sum(G.subgraph(c).size(weight) for c in scc) / G.size(weight)
networkx/algorithms/hierarchy.py
101
networkx
{ "docstring": "Returns the flow hierarchy of a directed network.\n\n Flow hierarchy is defined as the fraction of edges not participating\n in cycles in a directed graph [1]_.\n\n Parameters\n ----------\n G : DiGraph or MultiDiGraph\n A directed graph\n\n weight : key,optional (default=None)...
27
Python
26
2a05ccdb07cff88e56661dee8a9271859354027f
hierarchy.py
176,717
5
61
flow_hierarchy
https://github.com/networkx/networkx.git
Remove redundant py2 numeric conversions (#5661) * Remove redundant float conversion * Remove redundant int conversion * Use integer division Co-authored-by: Miroslav Šedivý <6774676+eumiro@users.noreply.github.com>
46
0
42,052
13
11
15
def rot90(m, k=1, axes=(0, 1)): axes = tuple(axes) if len(axes) != 2: raise ValueError("len(axes) must be 2.") m = asanyarray(m) if axes[0] == axes[1] or absolute(axes[0] - axes[1]) == m.ndim: raise ValueError("Axes must be different.") if (axes[0] >= m.ndim or axes[0] < -m.n...
numpy/lib/function_base.py
377
numpy
{ "docstring": "\n Rotate an array by 90 degrees in the plane specified by axes.\n\n Rotation direction is from the first towards the second axis.\n\n Parameters\n ----------\n m : array_like\n Array of two or more dimensions.\n k : integer\n Number of times the array is rotated by 90 ...
105
Python
68
f404e9e92e87a3990712d723d5c562a89300ac01
function_base.py
160,188
79
250
rot90
https://github.com/numpy/numpy.git
Add space after argument name
265
0
38,560
12
1
9
def test_export_resolves_empty_project(self): payload = self.make_payload( "discover", {"project": [], "start": "2020-05-18T14:00:00", "end": "2020-05-19T14:00:00"}, ) with self.feature("organizations:discover-query"): self.get_valid_response(self.org...
tests/sentry/data_export/endpoints/test_data_export.py
186
sentry
{ "docstring": "\n Ensures that a request to this endpoint returns a 201 if projects\n is an empty list.\n ", "language": "en", "n_whitespaces": 38, "n_words": 16, "vocab_size": 15 }
34
Python
21
e6285db024d7af78f2022822abcde6f5d118af9e
test_data_export.py
97,025
12
102
test_export_resolves_empty_project
https://github.com/getsentry/sentry.git
ref(discover): Remove resolve_field_list from data export (#32547) - This removes the call to resolve_field_list to validate queries from the data export
138
0
19,363
11
2
11
def get_compat_v1_regularization_losses(self): return { name: regularizer() for name, regularizer in self._tf1_style_var_store._regularizers.items() } # pylint: disable=protected-access @test_combinations.generate(test_combinations.combine(mode=["eager"]))
keras/legacy_tf_layers/variable_scope_shim_test.py
76
@test_combinations.generate(test_combinations.combine(mode=["eager"]))
keras
{ "docstring": "Dict w/ regularization losses from `get_variable`&`compat.v1.layers`.", "language": "en", "n_whitespaces": 5, "n_words": 6, "vocab_size": 6 }
16
Python
16
84afc5193d38057e2e2badf9c889ea87d80d8fbf
variable_scope_shim_test.py
274,468
5
28
get_compat_v1_regularization_losses
https://github.com/keras-team/keras.git
Reformatting the codebase with black. PiperOrigin-RevId: 450093126
59
1
81,207
11
1
8
def test_random_tree_n_zero(): with pytest.raises(nx.NetworkXPointlessConcept): T = nx.random_tree(0, seed=1234)
networkx/generators/tests/test_trees.py
48
networkx
{ "docstring": "Tests if n = 0 then the NetworkXPointlessConcept exception is raised.", "language": "en", "n_whitespaces": 10, "n_words": 11, "vocab_size": 11 }
8
Python
8
dc70d037f21c76c61e1aab02039c4ca87898f7c7
test_trees.py
177,372
3
27
test_random_tree_n_zero
https://github.com/networkx/networkx.git
added coverage in generators/tree.py (#6082)
21
0
42,365
11
1
4
def add(inputs, **kwargs): return Add(**kwargs)(inputs)
keras/layers/merging/add.py
32
keras
{ "docstring": "Functional interface to the `tf.keras.layers.Add` layer.\n\n Args:\n inputs: A list of input tensors with the same shape.\n **kwargs: Standard layer keyword arguments.\n\n Returns:\n A tensor as the sum of the inputs. It has the same shape as the inputs.\n\n Examples:\n\n...
5
Python
5
84afc5193d38057e2e2badf9c889ea87d80d8fbf
add.py
272,642
2
18
add
https://github.com/keras-team/keras.git
Reformatting the codebase with black. PiperOrigin-RevId: 450093126
11
0
81,028
9
1
2
def get_cached_paths(self): return ["/"]
wagtail/core/models/__init__.py
21
wagtail
{ "docstring": "\n This returns a list of paths to invalidate in a frontend cache\n ", "language": "en", "n_whitespaces": 27, "n_words": 12, "vocab_size": 11 }
4
Python
4
d10f15e55806c6944827d801cd9c2d53f5da4186
__init__.py
73,846
2
10
get_cached_paths
https://github.com/wagtail/wagtail.git
Reformat with black
18
0
16,141
7
20
50
def cleanup(self, onlyFileTbl=False, udfDict=None, web=False): if web and self.webBackdoorFilePath: logger.info("cleaning up the web files uploaded") self.delRemoteFile(self.webStagerFilePath) self.delRemoteFile(self.webBackdoorFilePath) if (not isStacking...
plugins/generic/misc.py
594
sqlmap
{ "docstring": "\n Cleanup file system and database from sqlmap create files, tables\n and functions\n ", "language": "en", "n_whitespaces": 34, "n_words": 12, "vocab_size": 11 }
203
Python
118
df4293473d2fb6e887e31522cab5aff95e201581
misc.py
123,734
45
344
cleanup
https://github.com/sqlmapproject/sqlmap.git
Fixing DeprecationWarning (logger.warn)
726
0
27,412
19
7
8
def func_load(code, defaults=None, closure=None, globs=None): if isinstance(code, (tuple, list)): # unpack previous dump code, defaults, closure = code if isinstance(defaults, list): defaults = tuple(defaults)
keras/utils/generic_utils.py
78
keras
{ "docstring": "Deserializes a user defined function.\n\n Args:\n code: bytecode of the function.\n defaults: defaults of the function.\n closure: closure of the function.\n globs: dictionary of global objects.\n\n Returns:\n A function object.\n ", "language": "en", "n...
24
Python
22
84afc5193d38057e2e2badf9c889ea87d80d8fbf
generic_utils.py
276,843
18
147
func_load
https://github.com/keras-team/keras.git
Reformatting the codebase with black. PiperOrigin-RevId: 450093126
56
0
81,753
12
1
18
def assert_orientation_landscape_image_is_correct(self, rendition): from willow.plugins.pillow import PillowImage with rendition.get_willow_image() as willow_image: image = PillowImage.open(willow_image) # Check that the image is the correct size (and not rotated) ...
wagtail/images/tests/test_models.py
273
wagtail
{ "docstring": "\n Check that the image has the correct colored pixels in the right places\n so that we know the image did not physically rotate.\n ", "language": "en", "n_whitespaces": 45, "n_words": 23, "vocab_size": 18 }
89
Python
61
d10f15e55806c6944827d801cd9c2d53f5da4186
test_models.py
75,292
13
177
assert_orientation_landscape_image_is_correct
https://github.com/wagtail/wagtail.git
Reformat with black
212
0
16,387
11
3
9
def get_user_model(): try: return django_apps.get_model(settings.AUTH_USER_MODEL, require_ready=False) except ValueError: raise ImproperlyConfigured( "AUTH_USER_MODEL must be of the form 'app_label.model_name'" ) except LookupError: raise ImproperlyConfigured...
django/contrib/auth/__init__.py
71
django
{ "docstring": "\n Return the User model that is active in this project.\n ", "language": "en", "n_whitespaces": 17, "n_words": 10, "vocab_size": 10 }
35
Python
30
9c19aff7c7561e3a82978a272ecdaad40dda5c00
__init__.py
203,587
12
40
get_user_model
https://github.com/django/django.git
Refs #33476 -- Reformatted code with Black.
115
0
50,462
12
1
2
def visible(self): return self["visible"]
packages/python/plotly/plotly/graph_objs/_bar.py
22
plotly.py
{ "docstring": "\n Determines whether or not this trace is visible. If\n \"legendonly\", the trace is not drawn, but can appear as a\n legend item (provided that the legend itself is visible).\n\n The 'visible' property is an enumeration that may be specified as:\n - One of the fo...
4
Python
4
43e3a4011080911901176aab919c0ecf5046ddd3
_bar.py
226,157
2
11
visible
https://github.com/plotly/plotly.py.git
switch to black .22
18
0
57,830
7
2
11
def fgcolor(value, dark='000000', light='ffffff'): value = value.lower().strip('#') if not re.match('^[0-9a-f]{6}$', value): return '' return f'#{foreground_color(value, dark, light)}' @register.filter()
netbox/utilities/templatetags/builtins/filters.py
102
@register.filter()
netbox
{ "docstring": "\n Return black (#000000) or white (#ffffff) given an arbitrary background color in RRGGBB format. The foreground\n color with the better contrast is returned.\n\n Args:\n value: The background color\n dark: The foreground color to use for light backgrounds\n light: The f...
18
Python
17
7c105019d8ae9205051c302e7499b33a455f9176
filters.py
264,443
5
42
fgcolor
https://github.com/netbox-community/netbox.git
Closes #8600: Document built-in template tags & filters
36
1
77,729
10
2
23
def test_image(): # Test fails for matplotlib 1.5+ because the size of the image # generated by matplotlib has changed. if Version(matplotlib.__version__) == Version("3.4.1"): image_size = 432 else: pytest.skip("Test fails for older matplotlib") np.random.seed(0) # image size depend...
packages/python/plotly/plotly/matplotlylib/mplexporter/tests/test_basic.py
159
plotly.py
{ "docstring": "\n opening figure\n opening axes\n draw image of size {image_size} \n closing axes\n closing figure\n ", "language": "en", "n_whitespaces": 159, "n_word...
55
Python
45
1d82b8822120db088bfeb6c8eae7ec8df9703783
test_basic.py
230,975
18
94
test_image
https://github.com/plotly/plotly.py.git
Updated distutils.Version to packaging.Version
110
0
62,617
11
2
15
def _build_tabs(self) -> None: logger.debug("Build Tabs") for section in self.config_tools.sections: tab = ttk.Notebook(self) self._tabs[section] = {"tab": tab} self.add(tab, text=section.replace("_", " ").title())
tools/preview/preview.py
110
faceswap
{ "docstring": " Build the notebook tabs for the each configuration section. ", "language": "en", "n_whitespaces": 10, "n_words": 9, "vocab_size": 8 }
21
Python
20
1022651eb8a7741014f5d2ec7cbfe882120dfa5f
preview.py
101,448
7
64
_build_tabs
https://github.com/deepfakes/faceswap.git
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
75
0
20,861
15
3
4
def theme_use_custom_titlebar(): if USE_CUSTOM_TITLEBAR is False: return False return USE_CUSTOM_TITLEBAR or pysimplegui_user_settings.get('-custom titlebar-', False)
PySimpleGUI.py
41
PySimpleGUI
{ "docstring": "\n Returns True if a custom titlebar will be / should be used.\n The setting is in the Global Settings window and can be overwridden\n using set_options call\n\n :return: True if a custom titlebar / custom menubar should be used\n :rtype: (bool)\n ", "language": "en"...
14
Python
12
66931d51e1a06797381d3c32c2b1a4400c033357
PySimpleGUI.py
212,994
4
23
theme_use_custom_titlebar
https://github.com/PySimpleGUI/PySimpleGUI.git
Release 4.60.0
30
0
53,561
9
1
16
def test_dataset_stats_shuffle(ray_start_regular_shared): context = DatasetContext.get_current() context.optimize_fuse_stages = True ds = ray.data.range(1000, parallelism=10) ds = ds.random_shuffle().repartition(1, shuffle=True) stats = canonicalize(ds.stats()) assert ( stats == ...
python/ray/data/tests/test_stats.py
103
ray
{ "docstring": "Stage N read->random_shuffle: executed in T\n\n Substage Z read->random_shuffle_map: N/N blocks executed\n * Remote wall time: T min, T max, T mean, T total\n * Remote cpu time: T min, T max, T mean, T total\n * Output num rows: N min, N max, N mean, N total\n * Output size bytes: N min...
24
Python
18
ea791ab0a0f176c94c911ef0eb06ca8fa568de0c
test_stats.py
138,510
41
63
test_dataset_stats_shuffle
https://github.com/ray-project/ray.git
[Datasets] Print hierarchical stats for multi-stage operations. (#24119) The total execution time for multi-stage operations being logged twice in the dataset stats is [confusing to users](https://github.com/ray-project/ray/issues/23915), making it seem like each stage in the operation took the same amount of time. Th...
59
0
31,449
10
16
53
def rewrite(e, Omega, x, wsym): if not isinstance(Omega, SubsSet): raise TypeError("Omega should be an instance of SubsSet") if len(Omega) == 0: raise ValueError("Length cannot be 0") # all items in Omega must be exponentials for t in Omega.keys(): if not isinstance(t, exp):...
sympy/series/gruntz.py
589
sympy
{ "docstring": "e(x) ... the function\n Omega ... the mrv set\n wsym ... the symbol which is going to be used for w\n\n Returns the rewritten e in terms of w and log(w). See test_rewrite1()\n for examples and correct results.\n ", "language": "en", "n_whitespaces": 53, "n_words": 38, "vocab_siz...
319
Python
189
f757f3daae6e11ea0cfb7dadc133274d8d74315f
gruntz.py
196,819
43
365
rewrite
https://github.com/sympy/sympy.git
Reordered imports 2
594
0
48,197
19
2
41
def register_converter_cb(key) -> None: from pandas.plotting import ( deregister_matplotlib_converters, register_matplotlib_converters, ) if cf.get_option(key): register_matplotlib_converters() else: deregister_matplotlib_converters() with cf.config_prefix("plotting.ma...
pandas/core/config_init.py
854
pandas
{ "docstring": "\n: bool\n Whether to sparsify the display of a hierarchical index. Setting to False will\n display each explicit level element in a hierarchical key for each row.\n\n: bool\n Whether to sparsify the display of hierarchical columns. Setting to False will\n display each explicit level eleme...
200
Python
127
9612375ca28ade056f15d4338f1bfde5d045c9fc
config_init.py
167,698
9
34
register_converter_cb
https://github.com/pandas-dev/pandas.git
TYP: return values in core/*.py (#47587) * TYP: return values in core/*.py * fix test * to_html * to_html part 2 * DataFrame.query * more overloads * fix query? * increase stacklevel by one * fix rename_axis * and an overload for DataFrame.eval * address comments * fix typevar
695
0
40,081
13
2
7
def get_accounts_in_mappers(mapping_names): return frappe.db.sql(, (', '.join('%s' % d for d in mapping_names)))
erpnext/accounts/report/cash_flow/custom_cash_flow.py
50
erpnext
{ "docstring": "\n\t\tselect cfma.name, cfm.label, cfm.is_working_capital, cfm.is_income_tax_liability,\n\t\tcfm.is_income_tax_expense, cfm.is_finance_cost, cfm.is_finance_cost_adjustment, cfma.account\n\t\tfrom `tabCash Flow Mapping Accounts` cfma\n\t\tjoin `tabCash Flow Mapping` cfm on cfma.parent=cfm.name\n\t\twhe...
12
Python
11
119273e633ec8e56c7d5c4649ef81c3deeb5f7d2
custom_cash_flow.py
64,634
9
29
get_accounts_in_mappers
https://github.com/frappe/erpnext.git
fix: custom cash flow mapper doesn't show any data
10
0
13,684
12
1
2
def circle(self): return self["circle"]
packages/python/plotly/plotly/graph_objs/layout/mapbox/_layer.py
22
plotly.py
{ "docstring": "\n The 'circle' property is an instance of Circle\n that may be specified as:\n - An instance of :class:`plotly.graph_objs.layout.mapbox.layer.Circle`\n - A dict of string/value properties that will be passed\n to the Circle constructor\n\n Support...
4
Python
4
43e3a4011080911901176aab919c0ecf5046ddd3
_layer.py
232,039
2
11
circle
https://github.com/plotly/plotly.py.git
switch to black .22
18
0
63,483
7