selection_rank int64 0 10k | uid stringlengths 17 29 | source stringclasses 7
values | split stringclasses 3
values | row_idx int64 0 58.9k | instance_id stringlengths 14 120 | repo stringclasses 246
values | repo_canon stringclasses 232
values | language stringclasses 8
values | base_commit stringlengths 40 40 ⌀ | problem_statement stringlengths 84 23.6k | extra_context stringclasses 626
values | hints stringlengths 0 59.3k | patch stringlengths 252 175k | test_patch stringlengths 0 358k | f2p stringlengths 10 155k ⌀ | p2p stringlengths 2 1.75M ⌀ | env_image stringlengths 41 154 ⌀ | env_available bool 1
class | created_at stringlengths 10 20 ⌀ | n_src_files int64 1 15 | src_lines int64 1 1.48k | n_f2p float64 1 1.87k ⌀ | ps_chars int64 84 23.6k | leak_ratio float64 0 0.6 | s_prior float64 0.6 1 | s_verif float64 0.75 1 | s_ps float64 0.04 1 | s_patch float64 0.07 1 | s_tiebreak float64 0.02 1 | score float64 47.9 98.6 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1,000 | swe_gym::train::1934 | swe_gym | train | 1,934 | bokeh__bokeh-13721 | bokeh/bokeh | bokeh/bokeh | python | 17b0187a7efac45b27be081aa80416938da3f899 | Errors related to MIN_PREFERRED_MAX_WIDTH while building the docs
Since the merge of #13625 there are quite a few errors in the logs for the documentation build. The source of the warnings below is https://github.com/bokeh/bokeh/actions/runs/7714515006/job/21027112370?pr=13625
```
reading sources... [ 62%] docs/first... | The default value for `width` or `height` causes the issue. I suppose we should check only `min_` and `max_` properties when sizing mode is non-fixed. In general, this API bad. It should have been only `width` and `height`, and no `sizing_mode`. | diff --git a/src/bokeh/core/validation/check.py b/src/bokeh/core/validation/check.py
--- a/src/bokeh/core/validation/check.py
+++ b/src/bokeh/core/validation/check.py
@@ -32,7 +32,7 @@
# Bokeh imports
from ...model import Model
from ...settings import settings
-from ...util.dataclasses import dataclass
+from ...util... | diff --git a/tests/unit/bokeh/models/test_plots.py b/tests/unit/bokeh/models/test_plots.py
--- a/tests/unit/bokeh/models/test_plots.py
+++ b/tests/unit/bokeh/models/test_plots.py
@@ -26,6 +26,7 @@
# Bokeh imports
from bokeh.core.validation import check_integrity, process_validation_issues
+from bokeh.core.validatio... | ["tests/unit/bokeh/models/test_plots.py::TestPlotValidation::test_min_preferred_max_height__issue13716", "tests/unit/bokeh/models/test_plots.py::TestPlotValidation::test_min_preferred_max_width__issue13716"] | ["tests/unit/bokeh/models/test_plots.py::TestPlotSelect::test_arg_and_kwarg", "tests/unit/bokeh/models/test_plots.py::test_plot_add_layout_adds_label_to_plot_renderers", "tests/unit/bokeh/models/test_plots.py::TestCategoricalTwinAxis::test_x_range", "tests/unit/bokeh/models/test_plots.py::TestCategoricalTwinAxis::test_... | null | true | 2024-02-25T11:09:31Z | 2 | 15 | 2 | 3,267 | 0 | 0.85 | 1 | 0.62 | 1 | 0.55 | 84.97 | |
1,001 | swe_gym::train::258 | swe_gym | train | 258 | getmoto__moto-5482 | getmoto/moto | getmoto/moto | python | 5739db47011a1732c284c997ff8c1fed277ffc86 | DynamoDB: transact_write_items does not return Item in CancellationReasons
moto does not appear to return `Item` under `err.response["CancellationReasons"][n]` when a transaction fails, and we've set ` "ReturnValuesOnConditionCheckFailure": "ALL_OLD"`.
I've created a minimal repro with a failing test case here: https:... | Thanks for raising this and adding a repro-case @magicmark! | diff --git a/moto/dynamodb/exceptions.py b/moto/dynamodb/exceptions.py
--- a/moto/dynamodb/exceptions.py
+++ b/moto/dynamodb/exceptions.py
@@ -207,14 +207,14 @@ class TransactionCanceledException(DynamodbException):
def __init__(self, errors):
msg = self.cancel_reason_msg.format(
- ", ".join(... | diff --git a/tests/test_dynamodb/test_dynamodb.py b/tests/test_dynamodb/test_dynamodb.py
--- a/tests/test_dynamodb/test_dynamodb.py
+++ b/tests/test_dynamodb/test_dynamodb.py
@@ -3882,7 +3882,11 @@ def test_transact_write_items_put_conditional_expressions():
reasons = ex.value.response["CancellationReasons"]
... | ["tests/test_dynamodb/test_dynamodb.py::test_transact_write_items_put_conditional_expressions"] | ["tests/test_dynamodb/test_dynamodb.py::test_remove_list_index__remove_existing_nested_index", "tests/test_dynamodb/test_dynamodb.py::test_basic_projection_expressions_using_query_with_attr_expression_names", "tests/test_dynamodb/test_dynamodb.py::test_describe_backup_for_non_existent_backup_raises_error", "tests/test_... | null | true | 2022-09-16 21:15:43 | 2 | 14 | 1 | 3,329 | 0 | 0.85 | 1 | 0.62 | 1 | 0.546667 | 84.96 | |
1,002 | swe_gym::train::181 | swe_gym | train | 181 | getmoto__moto-5216 | getmoto/moto | getmoto/moto | python | 67cda6d7d6f42118ccd7e2170e7ff0a1f92fa6a6 | [Ec2 Tags] ResourceType input removed from Tags and expected later on to be present
In file moto/ec2/responses/_base_response.py, method _parse_tag_specification converts the provided tags from:
```
[{"ResourceType": _type, "Tag": [{"Key": k, "Value": v}, ..]}]
```
To:
```
{_type: {k: v, ..}}
```
The same "_parse_tag_s... | Hi @moxilo, thanks for raising this! It looks like the underlaying issue is that we should throw an error when passing in `"Tags": []` - I'll mark it as an enhancement to add proper validation for this. | diff --git a/moto/ec2/exceptions.py b/moto/ec2/exceptions.py
--- a/moto/ec2/exceptions.py
+++ b/moto/ec2/exceptions.py
@@ -461,6 +461,13 @@ def __init__(self, parameter_value):
)
+class EmptyTagSpecError(EC2ClientError):
+ def __init__(self):
+ super().__init__(
+ "InvalidParameterValu... | diff --git a/tests/test_ec2/test_tags.py b/tests/test_ec2/test_tags.py
--- a/tests/test_ec2/test_tags.py
+++ b/tests/test_ec2/test_tags.py
@@ -401,6 +401,26 @@ def test_create_snapshot_with_tags():
assert snapshot["Tags"] == expected_tags
+@mock_ec2
+def test_create_volume_without_tags():
+ client = boto3.c... | ["tests/test_ec2/test_tags.py::test_create_volume_without_tags"] | ["tests/test_ec2/test_tags.py::test_retrieved_snapshots_must_contain_their_tags", "tests/test_ec2/test_tags.py::test_instance_create_tags", "tests/test_ec2/test_tags.py::test_invalid_id", "tests/test_ec2/test_tags.py::test_filter_instances_by_wildcard_tags", "tests/test_ec2/test_tags.py::test_get_all_tags_resource_filt... | null | true | 2022-06-10 21:41:11 | 2 | 13 | 1 | 4,117 | 0 | 0.85 | 1 | 0.62 | 1 | 0.543333 | 84.95 | |
1,003 | swe_gym::train::2329 | swe_gym | train | 2,329 | Project-MONAI__MONAI-6781 | Project-MONAI/MONAI | project-monai/monai | python | c62fac1eeb9cbf59ba3e499c3f612a348b2571da | boolean indexing of batched metatensor
**Describe the bug**
```py
import torch
from monai.data import MetaTensor
data = MetaTensor(torch.zeros([2, 96, 96]))
data.is_batch = True
mask = torch.tensor([True, False])
print(data[mask].shape)
```
```
Traceback (most recent call last):
File "/Users/Documents/MONAI/my_te... | diff --git a/monai/data/meta_tensor.py b/monai/data/meta_tensor.py
--- a/monai/data/meta_tensor.py
+++ b/monai/data/meta_tensor.py
@@ -202,7 +202,7 @@ def update_meta(rets: Sequence, func, args, kwargs) -> Sequence:
:py:func:`MetaTensor._copy_meta`).
"""
out = []
- metas = None
+ ... | diff --git a/tests/test_meta_tensor.py b/tests/test_meta_tensor.py
--- a/tests/test_meta_tensor.py
+++ b/tests/test_meta_tensor.py
@@ -413,6 +413,10 @@ def test_slicing(self):
x.is_batch = True
with self.assertRaises(ValueError):
x[slice(0, 8)]
+ x = MetaTensor(np.zeros((3, 3, 4)))... | ["tests/test_meta_tensor.py::TestMetaTensor::test_slicing"] | ["tests/test_meta_tensor.py::TestMetaTensor::test_construct_with_pre_applied_transforms", "tests/test_meta_tensor.py::TestMetaTensor::test_decollate_5", "tests/test_meta_tensor.py::TestMetaTensor::test_pending_ops", "tests/test_meta_tensor.py::TestMetaTensor::test_dataset_4", "tests/test_meta_tensor.py::TestMetaTensor:... | null | true | 2023-07-26T12:22:22Z | 1 | 96 | 1 | 760 | 0 | 0.85 | 1 | 0.7 | 1 | 0.446667 | 84.94 | ||
1,004 | swe_bench_verified::test::238 | swe_bench_verified | test | 238 | django__django-16661 | django/django | django/django | python | d687febce5868545f99974d2499a91f81a32fef5 | ModelAdmin.lookup_allowed() incorrectly raises DisallowedModelAdminLookup lookup with foreign key as primary key
Description
(last modified by Tim Graham)
Wrote a failing test for tests/modeladmin/tests.py to demonstrate - same test/code passes on 1.8
@isolate_apps('modeladmin')
def test_lookup_allowed_foreign_prim... | Bisected to 8f30556329b64005d63b66859a74752a0b261315. | diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
--- a/django/contrib/admin/options.py
+++ b/django/contrib/admin/options.py
@@ -461,12 +461,14 @@ def lookup_allowed(self, lookup, value):
# Lookups on nonexistent fields are ok, since they're ignored
# late... | diff --git a/tests/modeladmin/tests.py b/tests/modeladmin/tests.py
--- a/tests/modeladmin/tests.py
+++ b/tests/modeladmin/tests.py
@@ -154,6 +154,35 @@ class EmployeeProfileAdmin(ModelAdmin):
ma.lookup_allowed("employee__department__code", "test_value"), True
)
+ @isolate_apps("modeladmin")
+... | ["test_lookup_allowed_foreign_primary (modeladmin.tests.ModelAdminTests.test_lookup_allowed_foreign_primary)"] | ["has_add_permission returns True for users who can add objects and", "has_change_permission returns True for users who can edit objects and", "has_delete_permission returns True for users who can delete objects and", "as_module_permission returns True for users who have any permission", "has_view_permission() returns ... | null | true | 2023-03-18T09:26:58Z | 1 | 10 | 1 | 1,310 | 0 | 1 | 1 | 0.55 | 1 | 0.251667 | 84.93 | |
1,005 | swe_gym::train::182 | swe_gym | train | 182 | getmoto__moto-4853 | getmoto/moto | getmoto/moto | python | 2ec1a0477888d5dcc4f2cde95bc6c9502f7762d6 | EC2 run_instances BlockDeviceMapping missing support for NoDevice
In [FireSim](https://fires.im/) we use an AMI that by default has two volumes. We only need one of them and thus make use of the `NoDevice` property of [`BlockDeviceMapping`](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_BlockDeviceMapping.... | diff --git a/moto/ec2/exceptions.py b/moto/ec2/exceptions.py
--- a/moto/ec2/exceptions.py
+++ b/moto/ec2/exceptions.py
@@ -49,6 +49,11 @@ def __init__(self, dhcp_options_id):
)
+class InvalidRequest(EC2ClientError):
+ def __init__(self):
+ super().__init__("InvalidRequest", "The request received ... | diff --git a/tests/test_ec2/test_instances.py b/tests/test_ec2/test_instances.py
--- a/tests/test_ec2/test_instances.py
+++ b/tests/test_ec2/test_instances.py
@@ -1,4 +1,4 @@
-from botocore.exceptions import ClientError
+from botocore.exceptions import ClientError, ParamValidationError
import pytest
from unittest i... | ["tests/test_ec2/test_instances.py::test_run_instance_with_block_device_mappings_using_no_device"] | ["tests/test_ec2/test_instances.py::test_modify_instance_attribute_security_groups_boto3", "tests/test_ec2/test_instances.py::test_run_instance_with_security_group_id_boto3", "tests/test_ec2/test_instances.py::test_get_instances_filtering_by_state_boto3", "tests/test_ec2/test_instances.py::test_modify_delete_on_termina... | null | true | 2022-02-11 20:45:57 | 3 | 46 | 1 | 1,730 | 0 | 0.85 | 1 | 0.7 | 1 | 0.441667 | 84.925 | ||
1,006 | swe_gym::train::37 | swe_gym | train | 37 | getmoto__moto-5072 | getmoto/moto | getmoto/moto | python | d60df32a259b6c30d6c217b53aaad5b28e518db4 | Organizations close_account doesn't match public API
The Organizations close_account API was added in #5040.
It doesn't match the spec of the public [CloseAccount](https://docs.aws.amazon.com/organizations/latest/APIReference/API_CloseAccount.html) API.
> If the action is successful, the service sends back an HTTP 20... | diff --git a/moto/organizations/models.py b/moto/organizations/models.py
--- a/moto/organizations/models.py
+++ b/moto/organizations/models.py
@@ -95,19 +95,6 @@ def create_account_status(self):
}
}
- @property
- def close_account_status(self):
- return {
- "CloseAccountS... | diff --git a/tests/test_organizations/organizations_test_utils.py b/tests/test_organizations/organizations_test_utils.py
--- a/tests/test_organizations/organizations_test_utils.py
+++ b/tests/test_organizations/organizations_test_utils.py
@@ -135,17 +135,3 @@ def validate_service_control_policy(org, response):
res... | ["tests/test_organizations/test_organizations_boto3.py::test_close_account_puts_account_in_suspended_status"] | ["tests/test_organizations/test_organizations_boto3.py::test_describe_organization", "tests/test_organizations/test_organizations_boto3.py::test_aiservices_opt_out_policy", "tests/test_organizations/test_organizations_boto3.py::test_list_accounts_pagination", "tests/test_organizations/test_organizations_boto3.py::test_... | null | true | 2022-04-27 20:32:03 | 1 | 30 | 1 | 2,046 | 0 | 0.85 | 1 | 0.7 | 1 | 0.441 | 84.923 | ||
1,007 | swe_bench_verified::test::280 | swe_bench_verified | test | 280 | matplotlib__matplotlib-25775 | matplotlib/matplotlib | matplotlib/matplotlib | python | 26224d96066b5c60882296c551f54ca7732c0af0 | [ENH]: Add get/set_antialiased to Text objects
### Problem
Currently, Text objects always retrieve their antialiasing state via the global rcParams["text.antialias"], unlike other artists for which this can be configured on a per-artist basis via `set_antialiased` (and read via `set_antialiased`).
### Proposed soluti... | i would like to work on this issue .Please assign me this issue
@ANSHTYAGI7 you are welcome to work on this issue, but we do not assign them.
Based on my understanding, I found currently only AGG and Cairo backends support customizing font antialiasing. So we are going to add support for these two?
| diff --git a/lib/matplotlib/backends/backend_agg.py b/lib/matplotlib/backends/backend_agg.py
--- a/lib/matplotlib/backends/backend_agg.py
+++ b/lib/matplotlib/backends/backend_agg.py
@@ -206,7 +206,7 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
# space) in the following call to d... | diff --git a/lib/matplotlib/tests/test_text.py b/lib/matplotlib/tests/test_text.py
--- a/lib/matplotlib/tests/test_text.py
+++ b/lib/matplotlib/tests/test_text.py
@@ -14,7 +14,7 @@
import matplotlib.transforms as mtransforms
from matplotlib.testing.decorators import check_figures_equal, image_comparison
from matplot... | ["lib/matplotlib/tests/test_text.py::test_set_antialiased", "lib/matplotlib/tests/test_text.py::test_get_antialiased", "lib/matplotlib/tests/test_text.py::test_annotation_antialiased", "lib/matplotlib/tests/test_text.py::test_text_antialiased_off_default_vs_manual[png]", "lib/matplotlib/tests/test_text.py::test_text_an... | ["lib/matplotlib/tests/test_text.py::test_font_styles[png]", "lib/matplotlib/tests/test_text.py::test_font_styles[pdf]", "lib/matplotlib/tests/test_text.py::test_multiline[png]", "lib/matplotlib/tests/test_text.py::test_multiline[pdf]", "lib/matplotlib/tests/test_text.py::test_multiline2[png]", "lib/matplotlib/tests/te... | null | true | 2023-04-26T21:26:46Z | 3 | 39 | 7 | 715 | 0 | 1 | 1 | 0.55 | 1 | 0.249167 | 84.9225 | |
1,008 | swe_bench_verified::test::150 | swe_bench_verified | test | 150 | django__django-14349 | django/django | django/django | python | a708f39ce67af174df90c5b5e50ad1976cec7cb8 | URLValidator tests failing on Python versions patched for bpo-43882
Description
On Python versions with a fix for bpo-43882 (i.e. 3.10.0b1 and the 3.9 git branch, not released yet) the following tests fail:
======================================================================
FAIL: test_validators (validators.tests.... | Thanks for the report. We noticed this issue.
Duplicate of #32074.
For the record, I was wrong that this hasn't been released in 3.9 -- it's part of 3.9.5.
It looks that it will be backported to all supported versions of Python. | diff --git a/django/core/validators.py b/django/core/validators.py
--- a/django/core/validators.py
+++ b/django/core/validators.py
@@ -92,6 +92,7 @@ class URLValidator(RegexValidator):
r'\Z', re.IGNORECASE)
message = _('Enter a valid URL.')
schemes = ['http', 'https', 'ftp', 'ftps']
+ unsafe_chars... | diff --git a/tests/validators/tests.py b/tests/validators/tests.py
--- a/tests/validators/tests.py
+++ b/tests/validators/tests.py
@@ -226,9 +226,15 @@
(URLValidator(), None, ValidationError),
(URLValidator(), 56, ValidationError),
(URLValidator(), 'no_scheme', ValidationError),
- # Trailing newlines ... | ["test_validators (validators.tests.TestValidators)"] | ["test_domain_whitelist (validators.tests.DeprecationTests)", "test_domain_whitelist_access_warning (validators.tests.DeprecationTests)", "test_domain_whitelist_set_warning (validators.tests.DeprecationTests)", "test_whitelist (validators.tests.DeprecationTests)", "test_whitelist_warning (validators.tests.DeprecationTe... | null | true | 2021-05-04T20:10:27Z | 1 | 3 | 1 | 2,381 | 0 | 1 | 1 | 0.7 | 0.8 | 0.406833 | 84.9205 | |
1,009 | swe_gym::train::1022 | swe_gym | train | 1,022 | dask__dask-6660 | dask/dask | dask/dask | python | 5fccf6c155d02245103b1c5107114b23f3322d0e | `groupby` does not seem to work for non-numerics
**What happened**:
Following along tutorial [bag](https://github.com/dask/dask-tutorial/blob/master/02_bag.ipynb), I played around with it for better understanding:
```python
b = db.from_sequence(list(range(10)))
b.groupby(lambda x: 'even' if (x % 2) == 0 else 'odd').... | In fact, I just tried the next portion of the tutorial, and it gave incorrect results:
# `groupby`
```python
%%time
# Warning, this one takes a while...
result = js.groupby(lambda item: item['name']).starmap(lambda k, v: (k, len(v))).compute()
print(sorted(result))
```
Result:
```python
[('Alice', 251... | diff --git a/dask/multiprocessing.py b/dask/multiprocessing.py
--- a/dask/multiprocessing.py
+++ b/dask/multiprocessing.py
@@ -1,5 +1,6 @@
import copyreg
import multiprocessing
+import os
import pickle
import sys
import traceback
@@ -182,6 +183,15 @@ def get(
pool = pool or config.get("pool", None)
num_w... | diff --git a/dask/bag/tests/test_bag.py b/dask/bag/tests/test_bag.py
--- a/dask/bag/tests/test_bag.py
+++ b/dask/bag/tests/test_bag.py
@@ -61,6 +61,20 @@ def test_keys():
assert b.__dask_keys__() == sorted(dsk.keys())
+def test_bag_groupby_pure_hash():
+ # https://github.com/dask/dask/issues/6640
+ resul... | ["dask/bag/tests/test_bag.py::test_bag_groupby_normal_hash"] | ["dask/bag/tests/test_bag.py::test_join[<lambda>]", "dask/bag/tests/test_bag.py::test_bag_paths", "dask/bag/tests/test_bag.py::test_accumulate", "dask/bag/tests/test_bag.py::test_groupby_tasks_3", "dask/bag/tests/test_bag.py::test_reduction_empty", "dask/bag/tests/test_bag.py::test_zip[7]", "dask/bag/tests/test_bag.py:... | null | true | 2020-09-22T15:02:28Z | 1 | 10 | 1 | 3,404 | 0 | 0.85 | 1 | 0.62 | 1 | 0.533333 | 84.92 | |
1,010 | swe_gym::train::782 | swe_gym | train | 782 | iterative__dvc-8152 | iterative/dvc | iterative/dvc | python | 2374c721055efc73696a28a39e96656c36ec2985 | dvc metrics show doesn't output anything when called from a subdirectory of the repository
# Bug Report
dvc metrics show doesn't output anything when called from a subdirectory of the repository.
## Description
When the pipeline described in `dvc.yaml` is stored in a subdirectory e.g. `pipeline` of the repository and ... | My brief research seems to point into `dvc/repo/metrics/show.py::_to_fs_paths` as a culprit. | diff --git a/dvc/repo/metrics/show.py b/dvc/repo/metrics/show.py
--- a/dvc/repo/metrics/show.py
+++ b/dvc/repo/metrics/show.py
@@ -85,12 +85,14 @@ def _read_metrics(repo, metrics, rev, onerror=None):
res = {}
for metric in metrics:
+ rel_metric_path = os.path.join(relpath, *fs.path.parts(metric))
... | diff --git a/tests/func/metrics/test_show.py b/tests/func/metrics/test_show.py
--- a/tests/func/metrics/test_show.py
+++ b/tests/func/metrics/test_show.py
@@ -21,6 +21,32 @@ def test_show_simple(tmp_dir, dvc, run_copy_metrics):
}
+def test_show_simple_from_subdir(tmp_dir, dvc, run_copy_metrics):
+ subdir = ... | ["tests/func/metrics/test_show.py::test_show_simple_from_subdir"] | ["tests/func/metrics/test_show.py::test_show_non_metric[True]", "tests/func/metrics/test_show.py::test_show_simple", "tests/func/metrics/test_show.py::test_show", "tests/func/metrics/test_show.py::test_show_malformed_metric", "tests/func/metrics/test_show.py::test_metrics_show_overlap[True]", "tests/func/metrics/test_s... | null | true | 2022-08-19T15:34:56Z | 1 | 10 | 1 | 3,060 | 0 | 0.85 | 1 | 0.62 | 1 | 0.533333 | 84.92 | |
1,011 | swe_gym::train::909 | swe_gym | train | 909 | dask__dask-10294 | dask/dask | dask/dask | python | cbce2906c7042125d9ddc3d17bdf0d65abf8ae0c | Dask Bag limits parallelism when scaling beyond 100-200 workers
I'm exploring some unexpected behaviour which is creating a [limitation on how far Apache Beam workloads can scale](https://github.com/apache/beam/issues/26669) with a [Dask runner](https://beam.apache.org/releases/pydoc/2.44.0/apache_beam.runners.dask.das... | Interesting. I would actually suggest a fourth solution. I don't think it's that unlikely to have clusters with more than a hundred workers so I'd be interested in solving this in the context of dask and not just beam.
I think if the user provides `npartitions` explicitly it works out just fine and I wouldn't change... | diff --git a/dask/bag/core.py b/dask/bag/core.py
--- a/dask/bag/core.py
+++ b/dask/bag/core.py
@@ -1772,12 +1772,15 @@ def from_sequence(seq, partition_size=None, npartitions=None):
"""
seq = list(seq)
if npartitions and not partition_size:
- partition_size = int(math.ceil(len(seq) / npartitions))... | diff --git a/dask/bag/tests/test_bag.py b/dask/bag/tests/test_bag.py
--- a/dask/bag/tests/test_bag.py
+++ b/dask/bag/tests/test_bag.py
@@ -1190,7 +1190,8 @@ def test_zip(npartitions, hi=1000):
evens = db.from_sequence(range(0, hi, 2), npartitions=npartitions)
odds = db.from_sequence(range(1, hi, 2), npartitio... | ["dask/bag/tests/test_bag.py::test_npartitions_saturation[500]", "dask/bag/tests/test_bag.py::test_default_partitioning_worker_saturation[500]", "dask/bag/tests/test_bag.py::test_npartitions_saturation[250]", "dask/bag/tests/test_bag.py::test_default_partitioning_worker_saturation[250]", "dask/bag/tests/test_bag.py::te... | ["dask/bag/tests/test_bag.py::test_join[<lambda>]", "dask/bag/tests/test_bag.py::test_bag_paths", "dask/bag/tests/test_bag.py::test_accumulate", "dask/bag/tests/test_bag.py::test_groupby_tasks_3", "dask/bag/tests/test_bag.py::test_reduction_empty", "dask/bag/tests/test_bag.py::test_zip[7]", "dask/bag/tests/test_bag.py:... | null | true | 2023-05-17T14:28:33Z | 1 | 9 | 7 | 4,398 | 0 | 0.85 | 1 | 0.62 | 1 | 0.53 | 84.91 | |
1,012 | swe_bench_verified::test::352 | swe_bench_verified | test | 352 | scikit-learn__scikit-learn-11310 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 553b5fb8f84ba05c8397f26dd079deece2b05029 | Retrieving time to refit the estimator in BaseSearchCV
Basically, I'm trying to figure out how much time it takes to refit the best model on the full data after doing grid/random search. What I can so far do is retrieve the time it takes to fit and score each model:
```
import sklearn.datasets
import sklearn.model_sele... | I'm fine with storing this. | diff --git a/sklearn/model_selection/_search.py b/sklearn/model_selection/_search.py
--- a/sklearn/model_selection/_search.py
+++ b/sklearn/model_selection/_search.py
@@ -17,6 +17,7 @@
from functools import partial, reduce
from itertools import product
import operator
+import time
import warnings
import numpy as... | diff --git a/sklearn/model_selection/tests/test_search.py b/sklearn/model_selection/tests/test_search.py
--- a/sklearn/model_selection/tests/test_search.py
+++ b/sklearn/model_selection/tests/test_search.py
@@ -26,6 +26,7 @@
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert... | ["sklearn/model_selection/tests/test_search.py::test_search_cv_timing"] | ["sklearn/model_selection/tests/test_search.py::test_parameter_grid", "sklearn/model_selection/tests/test_search.py::test_grid_search", "sklearn/model_selection/tests/test_search.py::test_grid_search_with_fit_params", "sklearn/model_selection/tests/test_search.py::test_random_search_with_fit_params", "sklearn/model_sel... | null | true | 2018-06-18T12:10:19Z | 1 | 14 | 1 | 1,190 | 0 | 1 | 1 | 0.55 | 1 | 0.245 | 84.91 | |
1,013 | swe_gym::train::207 | swe_gym | train | 207 | getmoto__moto-7348 | getmoto/moto | getmoto/moto | python | e6818c3f1d3e8f552e5de736f68029b4efd1994f | Moto (DynamoDB) doesn't match that of AWS
Moto 5.0.1
boto3 1.34.37
Reproduce:
Basic Usage, Dynamo Create table
```
@mock_aws
def test_dynamo(self):
"""Must satisfy all of the required fields
TableName,AttributeDefinitions,KeySchema,ProvisionedThroughput,Tags,StreamSpecification,Billing... | Hi @chadmiracle, are you able to create a stand-alone reproducible testcase? The `ds.dynamo_createtable` presumably does some parsing/mangling of the arguments, because passing them to boto3 directly results in a whole lot of validation errors.
I run exactly what I posted directly against AWS using Boto3; there are no ... | diff --git a/moto/dynamodb/responses.py b/moto/dynamodb/responses.py
--- a/moto/dynamodb/responses.py
+++ b/moto/dynamodb/responses.py
@@ -237,6 +237,14 @@ def create_table(self) -> str:
raise UnknownKeyType(
key_type=key_type, position=f"keySchema.{idx}.member.keyType"
... | diff --git a/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py b/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py
--- a/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py
+++ b/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py
@@ -1242,3 +1242,34 @@ def test_scan_with_missing_value(t... | ["tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py::test_too_many_key_schema_attributes"] | ["tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py::test_query_gsi_with_wrong_key_attribute_names_throws_exception", "tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py::test_update_primary_key", "tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py::test_creating_table_with_0_local_indexes", "t... | null | true | 2024-02-16 19:18:32 | 1 | 8 | 1 | 3,852 | 0 | 0.85 | 1 | 0.62 | 1 | 0.526667 | 84.9 | |
1,014 | swe_gym::train::725 | swe_gym | train | 725 | iterative__dvc-4767 | iterative/dvc | iterative/dvc | python | 79232dfedf731038e1d7f62c6f247d00e6ec53a8 | ssh: error while import-url with special character
## Bug Report
Problem while download files with special characters.
### Please provide information about your setup
```console
DVC version: 1.7.9
---------------------------------
Platform: Python 3.8.3 on Linux-5.4.0-48-generic-x86_64-with-glibc2.10
Supports: gdrive,... | Context: https://discordapp.com/channels/485586884165107732/485596304961962003/760236253496213515
Probable cause: the path to the file is `/home/data/cana/ds30/cana-mucuna/class35_e2545053-f2c5-4108-9042-67244a94e267_p_['cana']_o_['cana', 'mucuna'].jpg` (includes combinations of special charactes like `[`, `'`, `]`, `,... | diff --git a/dvc/tree/ssh/connection.py b/dvc/tree/ssh/connection.py
--- a/dvc/tree/ssh/connection.py
+++ b/dvc/tree/ssh/connection.py
@@ -2,6 +2,7 @@
import logging
import os
import posixpath
+import shlex
import stat
from contextlib import suppress
@@ -291,6 +292,7 @@ def md5(self, path):
Example:
... | diff --git a/tests/unit/remote/ssh/test_connection.py b/tests/unit/remote/ssh/test_connection.py
--- a/tests/unit/remote/ssh/test_connection.py
+++ b/tests/unit/remote/ssh/test_connection.py
@@ -8,9 +8,18 @@
from dvc.info import get_fs_type
from dvc.system import System
+from dvc.tree.ssh.connection import SSHConne... | ["tests/unit/remote/ssh/test_connection.py::test_escapes_filepaths_for_hardlink", "tests/unit/remote/ssh/test_connection.py::test_escapes_filepaths_for_reflink[Linux-cp", "tests/unit/remote/ssh/test_connection.py::test_escapes_filepaths_for_md5_calculation[Darwin-md5]", "tests/unit/remote/ssh/test_connection.py::test_e... | ["tests/unit/remote/ssh/test_connection.py::test_exists", "tests/unit/remote/ssh/test_connection.py::test_isfile", "tests/unit/remote/ssh/test_connection.py::test_move", "tests/unit/remote/ssh/test_connection.py::test_remove_dir", "tests/unit/remote/ssh/test_connection.py::test_isdir", "tests/unit/remote/ssh/test_conne... | null | true | 2020-10-21T15:26:43Z | 1 | 8 | 6 | 5,356 | 0 | 0.85 | 1 | 0.62 | 1 | 0.526667 | 84.9 | |
1,015 | swe_gym::train::1029 | swe_gym | train | 1,029 | dask__dask-7637 | dask/dask | dask/dask | python | 90fccabb15e10daf7e03811401ab3d2be47d8abb | Randomly incorrect results because SubgraphCallable equality check on name is insufficient
**What happened**: Since #6666 (in 2.28.0), `SubgraphCallable.__eq__` does not compare the `dsk` field. Depending on how things have been persisted and optimised, two different SubgraphCallables can have the same name (inherited ... | I've managed to create an example where the wrong values are produced. It seems to be random whether the bug manifests, so if you don't reproduce it immediately, try running it a few times (I haven't rigorously measured failure rates, but for me it's closer to 50% than 1%).
```python
#!/usr/bin/env python3
impor... | diff --git a/dask/optimization.py b/dask/optimization.py
--- a/dask/optimization.py
+++ b/dask/optimization.py
@@ -1,5 +1,6 @@
import math
import numbers
+import uuid
from enum import Enum
from . import config, core, utils
@@ -940,10 +941,12 @@ class SubgraphCallable:
__slots__ = ("dsk", "outkey", "inkeys"... | diff --git a/dask/tests/test_distributed.py b/dask/tests/test_distributed.py
--- a/dask/tests/test_distributed.py
+++ b/dask/tests/test_distributed.py
@@ -385,6 +385,28 @@ def fn(x, dt=None):
assert res == 1000
+def test_blockwise_different_optimization(c):
+ # Regression test for incorrect results due to S... | ["dask/tests/test_optimization.py::test_SubgraphCallable_eq"] | ["dask/tests/test_optimization.py::test_inline_functions_non_hashable", "dask/tests/test_optimization.py::test_inline_functions", "dask/tests/test_optimization.py::test_fused_keys_max_length", "dask/tests/test_optimization.py::test_inline", "dask/tests/test_optimization.py::test_fuse_reductions_multiple_input", "dask/t... | null | true | 2021-05-09T18:40:29Z | 1 | 7 | 1 | 3,359 | 0 | 0.85 | 1 | 0.62 | 1 | 0.523333 | 84.89 | |
1,016 | swe_gym::train::2341 | swe_gym | train | 2,341 | modin-project__modin-6608 | modin-project/modin | modin-project/modin | python | 22ce95e78b4db2f21d5940cbd8ee656e7e565d15 | BUG: `.sort_values()` may break column widths cache if the data size is small
### Modin version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the latest released version of Modin.
- [X] I have confirmed this bug exists on the main branch of Modin... | diff --git a/modin/core/dataframe/pandas/dataframe/dataframe.py b/modin/core/dataframe/pandas/dataframe/dataframe.py
--- a/modin/core/dataframe/pandas/dataframe/dataframe.py
+++ b/modin/core/dataframe/pandas/dataframe/dataframe.py
@@ -2380,7 +2380,7 @@ def combine_and_apply(
)
def _apply_func_to_range_p... | diff --git a/modin/test/storage_formats/pandas/test_internals.py b/modin/test/storage_formats/pandas/test_internals.py
--- a/modin/test/storage_formats/pandas/test_internals.py
+++ b/modin/test/storage_formats/pandas/test_internals.py
@@ -113,20 +113,30 @@ def construct_modin_df_by_scheme(pandas_df, partitioning_scheme... | ["modin/test/storage_formats/pandas/test_internals.py::test_sort_values_cache"] | ["modin/test/storage_formats/pandas/test_internals.py::test_reorder_labels_cache[unbalanced_partitioning-no_reordering-projection_only]", "modin/test/storage_formats/pandas/test_internals.py::test_reorder_labels_cache[two_unbalanced_partitions-size_grow-no_reordering]", "modin/test/storage_formats/pandas/test_internals... | null | true | 2023-09-27T11:06:26Z | 1 | 34 | 1 | 1,882 | 0 | 0.85 | 1 | 0.7 | 1 | 0.427 | 84.881 | ||
1,017 | swe_bench_verified::test::2 | swe_bench_verified | test | 2 | astropy__astropy-13236 | astropy/astropy | astropy/astropy | python | 6ed769d58d89380ebaa1ef52b300691eefda8928 | Consider removing auto-transform of structured column into NdarrayMixin
### Description
Currently if you add a structured `np.array` to a Table, it gets turned into an `NdarrayMixin` (via the code below). While this mostly works, I am not sure this is necessary or desirable any more after #12644. Basically the origin... | @mhvk - I'm happy to do this PR if you think it is a good idea.
I agree there no longer is any reason to put structured arrays into `NdarrayMixin` -- indeed, I thought I had already changed its use! So, yes, happy to go ahead and create structured columns directly.
So you think we should change it now, or do a release ... | diff --git a/astropy/table/table.py b/astropy/table/table.py
--- a/astropy/table/table.py
+++ b/astropy/table/table.py
@@ -1239,13 +1239,6 @@ def _convert_data_to_col(self, data, copy=True, default_name=None, dtype=None, n
f'{fully_qualified_name} '
'did... | diff --git a/astropy/table/tests/test_mixin.py b/astropy/table/tests/test_mixin.py
--- a/astropy/table/tests/test_mixin.py
+++ b/astropy/table/tests/test_mixin.py
@@ -697,11 +697,13 @@ def test_skycoord_representation():
'1.0,90.0,0.0']
-def test_ndarray_mixin():
+@pytest.mark.parametriz... | ["astropy/table/tests/test_mixin.py::test_ndarray_mixin[False]", "astropy/table/tests/test_table.py::test_structured_masked_column"] | ["astropy/table/tests/test_mixin.py::test_attributes[arrayswap]", "astropy/table/tests/test_mixin.py::test_attributes[arraywrap]", "astropy/table/tests/test_mixin.py::test_attributes[cartesianrep]", "astropy/table/tests/test_mixin.py::test_attributes[earthlocation]", "astropy/table/tests/test_mixin.py::test_attributes[... | null | true | 2022-05-09T14:16:30Z | 1 | 7 | 2 | 1,239 | 0 | 1 | 1 | 0.55 | 1 | 0.229833 | 84.8645 | |
1,018 | swe_gym::train::2063 | swe_gym | train | 2,063 | Project-MONAI__MONAI-4174 | Project-MONAI/MONAI | project-monai/monai | python | cc17f38594c0b476f81bb776adfb595c727bdbd8 | `reduction` argument for `DiceMetric.aggregate()`?
**Is your feature request related to a problem? Please describe.**
if I want to track dice score on more than one dimensions, for example, if I need both average dice per class and average dice. it seems like my only options are
(1) create multiple DiceMetric object
... | diff --git a/monai/metrics/confusion_matrix.py b/monai/metrics/confusion_matrix.py
--- a/monai/metrics/confusion_matrix.py
+++ b/monai/metrics/confusion_matrix.py
@@ -47,7 +47,7 @@ class ConfusionMatrixMetric(CumulativeIterationMetric):
returned with the same order as input names when calling the class.
... | diff --git a/tests/test_compute_confusion_matrix.py b/tests/test_compute_confusion_matrix.py
--- a/tests/test_compute_confusion_matrix.py
+++ b/tests/test_compute_confusion_matrix.py
@@ -262,7 +262,7 @@ def test_clf_with_nan(self, input_data, expected_value):
metric = ConfusionMatrixMetric(**params)
r... | ["tests/test_compute_roc_auc.py::TestComputeROCAUC::test_class_value_5", "tests/test_compute_roc_auc.py::TestComputeROCAUC::test_class_value_8", "tests/test_hausdorff_distance.py::TestHausdorffDistance::test_value_5", "tests/test_compute_roc_auc.py::TestComputeROCAUC::test_class_value_9", "tests/test_compute_regression... | ["tests/test_compute_regression_metrics.py::TestRegressionMetrics::test_diff_input", "tests/test_compute_roc_auc.py::TestComputeROCAUC::test_value_7", "tests/test_compute_confusion_matrix.py::TestConfusionMatrix::test_compute_sample_33", "tests/test_compute_confusion_matrix.py::TestConfusionMatrix::test_compute_sample_... | null | true | 2022-04-25T19:38:09Z | 10 | 102 | 26 | 2,385 | 0 | 0.85 | 1 | 1 | 0.6 | 0.7375 | 84.8625 | ||
1,019 | swe_bench_verified::test::322 | swe_bench_verified | test | 322 | pylint-dev__pylint-4661 | pylint-dev/pylint | pylint-dev/pylint | python | 1d1619ef913b99b06647d2030bddff4800abdf63 | Make pylint XDG Base Directory Specification compliant
I have this really annoying `.pylint.d` directory in my home folder. From what I can tell (I don't do C or C++), this directory is storing data.
The problem with this is, quite simply, that data storage has a designated spot. The `$HOME/.local/share/<PROGRAM_NAME>... | @Saul-Dickson thanks for this suggestion. The environment variable `PYLINTHOME` can be set to the directory of your choice where the pylint's persistent data will be stored. Its default value is `~/.pylint.d` or `.pylint.d` in the current working directory.
Maybe we could change this default value to `$HOME/.local/sha... | diff --git a/pylint/config/__init__.py b/pylint/config/__init__.py
--- a/pylint/config/__init__.py
+++ b/pylint/config/__init__.py
@@ -36,6 +36,8 @@
import pickle
import sys
+import appdirs
+
from pylint.config.configuration_mixin import ConfigurationMixIn
from pylint.config.find_default_config_files import find_... | diff --git a/tests/lint/unittest_lint.py b/tests/lint/unittest_lint.py
--- a/tests/lint/unittest_lint.py
+++ b/tests/lint/unittest_lint.py
@@ -46,6 +46,7 @@
from os.path import abspath, basename, dirname, isdir, join, sep
from shutil import rmtree
+import appdirs
import pytest
from pylint import checkers, confi... | ["tests/lint/unittest_lint.py::test_pylint_home"] | [] | null | true | 2021-07-03T00:57:06Z | 2 | 18 | 1 | 987 | 0 | 1 | 1 | 0.55 | 1 | 0.2245 | 84.8485 | |
1,020 | swe_bench_verified::test::438 | swe_bench_verified | test | 438 | sympy__sympy-13798 | sympy/sympy | sympy/sympy | python | 7121bdf1facdd90d05b6994b4c2e5b2865a4638a | latex() and mul_symbol
The `latex()` pretty-printing function accepts a `mul_symbol` kwarg that must be one of four choices. I would like to be able to supply my own choice which is not in the list. Specifically, I want the multiplication symbol to be `\,` (i.e., a thin space). This is what I mean
```
>>> latex(3*x**2*... | Your change sounds good to me. It seems to be restricted only because it's a mapping, but it could be set so that an unknown argument is used as the latex. | diff --git a/sympy/printing/latex.py b/sympy/printing/latex.py
--- a/sympy/printing/latex.py
+++ b/sympy/printing/latex.py
@@ -155,12 +155,23 @@ def __init__(self, settings=None):
"dot": r" \cdot ",
"times": r" \times "
}
-
- self._settings['mul_symbol_latex'] = \
- ... | diff --git a/sympy/printing/tests/test_latex.py b/sympy/printing/tests/test_latex.py
--- a/sympy/printing/tests/test_latex.py
+++ b/sympy/printing/tests/test_latex.py
@@ -62,6 +62,8 @@ def test_latex_basic():
assert latex(2*x*y) == "2 x y"
assert latex(2*x*y, mul_symbol='dot') == r"2 \cdot x \cdot y"
+ a... | ["test_latex_basic"] | ["test_printmethod", "test_latex_builtins", "test_latex_SingularityFunction", "test_latex_cycle", "test_latex_permutation", "test_latex_Float", "test_latex_vector_expressions", "test_latex_symbols", "test_latex_functions", "test_hyper_printing", "test_latex_bessel", "test_latex_fresnel", "test_latex_brackets", "test_la... | null | true | 2017-12-26T18:12:43Z | 1 | 23 | 1 | 848 | 0 | 1 | 1 | 0.55 | 1 | 0.218 | 84.829 | |
1,021 | swe_bench_verified::test::34 | swe_bench_verified | test | 34 | django__django-11138 | django/django | django/django | python | c84b91b7603e488f7171fdff8f08368ef3d6b856 | TIME_ZONE value in DATABASES settings is not used when making dates timezone-aware on MySQL, SQLite, and Oracle.
Description
(last modified by Victor Talpaert)
(We assume the mysql backends)
I can set TIME_ZONE several times in settings.py, one for the global django app, and one for each database (see https://docs... | Opened a pull request on github with a quick fix, it's tested but lacks a TestCase https://github.com/django/django/pull/8714
Looks reasonable at a brief review.
PR | diff --git a/django/db/backends/mysql/operations.py b/django/db/backends/mysql/operations.py
--- a/django/db/backends/mysql/operations.py
+++ b/django/db/backends/mysql/operations.py
@@ -69,8 +69,8 @@ def date_trunc_sql(self, lookup_type, field_name):
return "DATE(%s)" % (field_name)
def _convert_fi... | diff --git a/tests/timezones/tests.py b/tests/timezones/tests.py
--- a/tests/timezones/tests.py
+++ b/tests/timezones/tests.py
@@ -47,6 +47,26 @@
ICT = timezone.get_fixed_timezone(420) # Asia/Bangkok
+@contextmanager
+def override_database_connection_timezone(timezone):
+ try:
+ orig_timezone = conn... | ["test_query_convert_timezones (timezones.tests.NewDatabaseTests)"] | ["test_aware_datetime_in_utc (timezones.tests.SerializationTests)", "test_naive_datetime (timezones.tests.SerializationTests)", "test_naive_datetime_with_microsecond (timezones.tests.SerializationTests)", "test_auto_now_and_auto_now_add (timezones.tests.LegacyDatabaseTests)", "test_aware_datetime_unsupported (timezones... | null | true | 2019-03-28T13:11:56Z | 4 | 69 | 1 | 3,130 | 0 | 1 | 1 | 0.62 | 0.85 | 0.73 | 84.7975 | |
1,022 | swe_bench_verified::test::204 | swe_bench_verified | test | 204 | django__django-15732 | django/django | django/django | python | ce69e34bd646558bb44ea92cecfd98b345a0b3e0 | Cannot drop unique_together constraint on a single field with its own unique=True constraint
Description
I have an erroneous unique_together constraint on a model's primary key (unique_together = (('id',),)) that cannot be dropped by a migration. Apparently the migration tries to find all unique constraints on the col... | Can you share a traceback that shows how and where the migration fails, please.
Here it is: Traceback (most recent call last): File "./bin/django", line 56, in <module> sys.exit(djangorecipe.manage.main('project.settings.local.foobar')) File "/foo/bar/eggs/djangorecipe-1.10-py2.7.egg/djangorecipe/manage.py", line 9, in... | diff --git a/django/db/backends/base/schema.py b/django/db/backends/base/schema.py
--- a/django/db/backends/base/schema.py
+++ b/django/db/backends/base/schema.py
@@ -528,7 +528,10 @@ def alter_unique_together(self, model, old_unique_together, new_unique_together)
# Deleted uniques
for fields in olds.... | diff --git a/tests/migrations/test_operations.py b/tests/migrations/test_operations.py
--- a/tests/migrations/test_operations.py
+++ b/tests/migrations/test_operations.py
@@ -2809,6 +2809,69 @@ def test_alter_unique_together_remove(self):
operation.describe(), "Alter unique_together for Pony (0 constraint(... | ["test_remove_unique_together_on_unique_field (migrations.test_operations.OperationTests)"] | ["test_reference_field_by_through_fields (migrations.test_operations.FieldOperationTests)", "test_references_field_by_from_fields (migrations.test_operations.FieldOperationTests)", "test_references_field_by_name (migrations.test_operations.FieldOperationTests)", "test_references_field_by_remote_field_model (migrations.... | null | true | 2022-05-24T12:58:31Z | 1 | 32 | 1 | 597 | 0 | 1 | 1 | 0.55 | 1 | 0.206167 | 84.7935 | |
1,023 | swe_bench_verified::test::73 | swe_bench_verified | test | 73 | django__django-12155 | django/django | django/django | python | e8fcdaad5c428878d0a5d6ba820d957013f75595 | docutils reports an error rendering view docstring when the first line is not empty
Description
Currently admindoc works correctly only with docstrings where the first line is empty, and all Django docstrings are formatted in this way.
However usually the docstring text starts at the first line, e.g.:
def test():
"""... | Confirmed the patch fixes the issue, although it crashes for some tests with ValueError: min() arg is an empty sequence.
We should probably just switch to inspect.cleandoc as it implements the algorithm defined in PEP257.
Replying to Tim Graham: Confirmed the patch fixes the issue, although it crashes for some tests ... | diff --git a/django/contrib/admindocs/utils.py b/django/contrib/admindocs/utils.py
--- a/django/contrib/admindocs/utils.py
+++ b/django/contrib/admindocs/utils.py
@@ -3,6 +3,7 @@
import re
from email.errors import HeaderParseError
from email.parser import HeaderParser
+from inspect import cleandoc
from django.url... | diff --git a/tests/admin_docs/test_utils.py b/tests/admin_docs/test_utils.py
--- a/tests/admin_docs/test_utils.py
+++ b/tests/admin_docs/test_utils.py
@@ -1,8 +1,9 @@
import unittest
from django.contrib.admindocs.utils import (
- docutils_is_available, parse_docstring, parse_rst, trim_docstring,
+ docutils_is... | ["test_parse_rst_with_docstring_no_leading_line_feed (admin_docs.test_utils.TestUtils)"] | ["test_description_output (admin_docs.test_utils.TestUtils)", "test_initial_header_level (admin_docs.test_utils.TestUtils)", "test_parse_docstring (admin_docs.test_utils.TestUtils)", "test_parse_rst (admin_docs.test_utils.TestUtils)", "test_publish_parts (admin_docs.test_utils.TestUtils)", "test_title_output (admin_doc... | null | true | 2019-11-28T16:24:23Z | 2 | 23 | 1 | 775 | 0 | 1 | 1 | 0.55 | 1 | 0.205833 | 84.7925 | |
1,024 | swe_bench_verified::test::339 | swe_bench_verified | test | 339 | pytest-dev__pytest-6202 | pytest-dev/pytest | pytest-dev/pytest | python | 3a668ea6ff24b0c8f00498c3144c63bac561d925 | '.[' replaced with '[' in the headline shown of the test report
```
bug.py F [100%]
=================================== FAILURES ===================================
_________________________________ test_boo[.[] _________________________________
a = '..... | Thanks for the fantastic report @linw1995, this is really helpful :smile:
I find out the purpose of replacing '.[' with '['. The older version of pytest, support to generate test by using the generator function.
[https://github.com/pytest-dev/pytest/blob/9eb1d55380ae7c25ffc600b65e348dca85f99221/py/test/testing/test... | diff --git a/src/_pytest/python.py b/src/_pytest/python.py
--- a/src/_pytest/python.py
+++ b/src/_pytest/python.py
@@ -285,8 +285,7 @@ def getmodpath(self, stopatmodule=True, includemodule=False):
break
parts.append(name)
parts.reverse()
- s = ".".join(parts)
- r... | diff --git a/testing/test_collection.py b/testing/test_collection.py
--- a/testing/test_collection.py
+++ b/testing/test_collection.py
@@ -685,6 +685,8 @@ def test_2():
def test_example_items1(self, testdir):
p = testdir.makepyfile(
"""
+ import pytest
+
def testone():... | ["testing/test_collection.py::Test_genitems::test_example_items1"] | ["testing/test_collection.py::TestCollector::test_collect_versus_item", "testing/test_collection.py::TestCollector::test_check_equality", "testing/test_collection.py::TestCollector::test_getparent", "testing/test_collection.py::TestCollector::test_getcustomfile_roundtrip", "testing/test_collection.py::TestCollector::te... | null | true | 2019-11-16T07:45:21Z | 1 | 3 | 1 | 2,117 | 0 | 1 | 1 | 0.7 | 0.8 | 0.362833 | 84.7885 | |
1,025 | swe_gym::train::844 | swe_gym | train | 844 | iterative__dvc-6587 | iterative/dvc | iterative/dvc | python | 61fe8bc59c639711b2b8206cd06d6d74cf0167c5 | config list fails outside repository
```console
$ cd "$(mktemp -d)"
$ dvc config --list -v
dvc config --list -v
core.experiments=True
core.check_update=true
core.analytics=false
2021-08-27 15:06:56,870 ERROR: unexpected error - 'repo'
------------------------------------------------------------
Traceback (most recent c... | diff --git a/dvc/command/config.py b/dvc/command/config.py
--- a/dvc/command/config.py
+++ b/dvc/command/config.py
@@ -66,7 +66,8 @@ def _list(self):
)
return 1
- levels = [self.args.level] if self.args.level else self.config.LEVELS
+ levels = self._get_appropriate_levels(self.... | diff --git a/tests/func/test_config.py b/tests/func/test_config.py
--- a/tests/func/test_config.py
+++ b/tests/func/test_config.py
@@ -77,6 +77,12 @@ def test_config_set_local(tmp_dir, dvc):
assert (tmp_dir / ".dvc" / "config.local").read_text() == "\n"
+def test_config_set_in_non_dvc_repo(tmp_dir, caplog):
+ ... | ["tests/func/test_config.py::test_config_list_in_non_dvc_repo[args1-251]", "tests/func/test_config.py::test_config_get_in_non_dvc_repo[args0-251]", "tests/func/test_config.py::test_config_list_in_non_dvc_repo[args2-0]", "tests/func/test_config.py::test_config_list_in_non_dvc_repo[args0-251]", "tests/func/test_config.py... | ["tests/func/test_config.py::test_list_bad_args[args2]", "tests/func/test_config.py::test_list_bad_args[args1]", "tests/func/test_config.py::test_config_get[args3-0-iterative]", "tests/func/test_config.py::test_load_relative_paths[cert_path-webdavs://example.com/files/USERNAME/]", "tests/func/test_config.py::test_set_i... | null | true | 2021-09-09T18:24:23Z | 2 | 27 | 6 | 1,806 | 0 | 0.85 | 1 | 0.7 | 1 | 0.391 | 84.773 | ||
1,026 | swe_gym::train::2402 | swe_gym | train | 2,402 | modin-project__modin-6941 | modin-project/modin | modin-project/modin | python | 6dfe13fb5468c3fbac85e11fcbc9a64b30d14ac7 | Merge failed when right operand is an empty dataframe
Modin 0.27.0
```python
import modin.pandas as pd
import numpy as np
df = pd.DataFrame(np.random.rand(100, 100))
df2 = df.iloc[:0]
pd.merge(df, df2) <- failed
```
Traceback:
```python
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "... | diff --git a/modin/core/dataframe/pandas/dataframe/dataframe.py b/modin/core/dataframe/pandas/dataframe/dataframe.py
--- a/modin/core/dataframe/pandas/dataframe/dataframe.py
+++ b/modin/core/dataframe/pandas/dataframe/dataframe.py
@@ -3203,6 +3203,25 @@ def _prepare_frame_to_broadcast(self, axis, indices, broadcast_all... | diff --git a/modin/pandas/test/dataframe/test_join_sort.py b/modin/pandas/test/dataframe/test_join_sort.py
--- a/modin/pandas/test/dataframe/test_join_sort.py
+++ b/modin/pandas/test/dataframe/test_join_sort.py
@@ -383,6 +383,13 @@ def test_merge(test_data, test_data2):
modin_df.merge("Non-valid type")
+de... | ["modin/pandas/test/dataframe/test_join_sort.py::test_merge_empty"] | ["modin/pandas/test/dataframe/test_join_sort.py::test_sort_values[None-ignore_index_None-first-quicksort-inplace_True-ascending_True-over_columns_str-first,last,middle-float_nan_data]", "modin/pandas/test/dataframe/test_join_sort.py::test_sort_values[None-ignore_index_None-first-quicksort-inplace_None-ascending_list_fi... | null | true | 2024-02-16T15:45:50Z | 2 | 41 | 1 | 1,525 | 0 | 0.85 | 1 | 0.7 | 1 | 0.390833 | 84.7725 | ||
1,027 | swe_bench_verified::test::109 | swe_bench_verified | test | 109 | django__django-13346 | django/django | django/django | python | 9c92924cd5d164701e2514e1c2d6574126bd7cc2 | On MySQL, Oracle, and SQLite, __in lookup doesn't work on key transforms.
Description
I am currently rewriting our app where we will start using models.JSONField instead of django_mysql.models.JSONField. I noticed that the __in operator is not reacting the same way is it does on other fields.
first_filter = {‘our_fiel... | Thanks for this ticket, however I cannot reproduce this issue. I tried with the following test and it works for me (also on MySQL): diff --git a/tests/model_fields/test_jsonfield.py b/tests/model_fields/test_jsonfield.py index a7648711ac..97d79e5bee 100644 --- a/tests/model_fields/test_jsonfield.py +++ b/tests/model_fi... | diff --git a/django/db/models/fields/json.py b/django/db/models/fields/json.py
--- a/django/db/models/fields/json.py
+++ b/django/db/models/fields/json.py
@@ -378,6 +378,30 @@ def as_sqlite(self, compiler, connection):
return super().as_sql(compiler, connection)
+class KeyTransformIn(lookups.In):
+ def ... | diff --git a/tests/model_fields/test_jsonfield.py b/tests/model_fields/test_jsonfield.py
--- a/tests/model_fields/test_jsonfield.py
+++ b/tests/model_fields/test_jsonfield.py
@@ -627,6 +627,25 @@ def test_key_iexact(self):
self.assertIs(NullableJSONModel.objects.filter(value__foo__iexact='BaR').exists(), True)... | ["test_key_in (model_fields.test_jsonfield.TestQuerying)", "test_key_iregex (model_fields.test_jsonfield.TestQuerying)"] | ["test_formfield (model_fields.test_jsonfield.TestFormField)", "test_formfield_custom_encoder_decoder (model_fields.test_jsonfield.TestFormField)", "test_custom_encoder (model_fields.test_jsonfield.TestValidation)", "test_invalid_decoder (model_fields.test_jsonfield.TestValidation)", "test_invalid_encoder (model_fields... | null | true | 2020-08-25T06:25:31Z | 1 | 25 | 2 | 618 | 0 | 1 | 1 | 0.55 | 1 | 0.186333 | 84.734 | |
1,028 | swe_bench_verified::test::121 | swe_bench_verified | test | 121 | django__django-13569 | django/django | django/django | python | 257f8495d6c93e30ab0f52af4c488d7344bcf112 | order_by('?') unexpectedly breaking queryset aggregation
Description
Steps to reproduce:
class Thing(models.Model):
pass
class Related(models.Model):
models.ForeignKey(Thing)
With data
t = Thing.objects.create()
rs = [Related.objects.create(thing=t) for _ in range(2)]
The following query works as expected. The aggre... | Patch to SQLCompiler.get_group_by that excluds Random expressions
PR
I wonder what would happen if we skipped all expressions that have no cols as source expressions (plus, we need to include any raw sql).
I wonder what would happen if we skipped all expressions that have no cols as source expressions (plus, we need t... | diff --git a/django/db/models/functions/math.py b/django/db/models/functions/math.py
--- a/django/db/models/functions/math.py
+++ b/django/db/models/functions/math.py
@@ -154,6 +154,9 @@ def as_oracle(self, compiler, connection, **extra_context):
def as_sqlite(self, compiler, connection, **extra_context):
... | diff --git a/tests/aggregation/tests.py b/tests/aggregation/tests.py
--- a/tests/aggregation/tests.py
+++ b/tests/aggregation/tests.py
@@ -1315,3 +1315,18 @@ def test_aggregation_subquery_annotation_related_field(self):
# with self.assertNumQueries(1) as ctx:
# self.assertSequenceEqual(books_qs, [... | ["Random() is not included in the GROUP BY when used for ordering."] | ["test_aggregate_alias (aggregation.tests.AggregateTestCase)", "test_aggregate_annotation (aggregation.tests.AggregateTestCase)", "test_aggregate_in_order_by (aggregation.tests.AggregateTestCase)", "test_aggregate_multi_join (aggregation.tests.AggregateTestCase)", "test_aggregate_over_aggregate (aggregation.tests.Aggre... | null | true | 2020-10-19T21:20:55Z | 1 | 3 | 1 | 1,981 | 0 | 1 | 1 | 0.7 | 0.8 | 0.340167 | 84.7205 | |
1,029 | swe_bench_verified::test::114 | swe_bench_verified | test | 114 | django__django-13417 | django/django | django/django | python | 71ae1ab0123582cc5bfe0f7d5f4cc19a9412f396 | QuerySet.ordered property is incorrect for GROUP BY queries on models with Meta.ordering.
Description
Using the annotate function on a queryset doesn't keep the default ordering set in model's meta class.
A property should say whether the queryset will be ordered or not. I wanted to use the qs.ordered property for thi... | Thanks for this report, however QuerySet.ordered works for me, see tests.
Replying to felixxm: Thanks for this report, however QuerySet.ordered works for me, see tests. Thanks for your answer but I've just checked again as it is in my example and ordered still returns True if an annotation is applied. As said earlier... | diff --git a/django/db/models/query.py b/django/db/models/query.py
--- a/django/db/models/query.py
+++ b/django/db/models/query.py
@@ -1224,7 +1224,12 @@ def ordered(self):
return True
if self.query.extra_order_by or self.query.order_by:
return True
- elif self.query.default_or... | diff --git a/tests/queries/tests.py b/tests/queries/tests.py
--- a/tests/queries/tests.py
+++ b/tests/queries/tests.py
@@ -2084,6 +2084,16 @@ def test_annotated_ordering(self):
self.assertIs(qs.ordered, False)
self.assertIs(qs.order_by('num_notes').ordered, True)
+ def test_annotated_default_orde... | ["test_annotated_default_ordering (queries.tests.QuerysetOrderedTests)", "test_annotated_values_default_ordering (queries.tests.QuerysetOrderedTests)"] | ["test_no_extra_params (queries.tests.DefaultValuesInsertTest)", "test_ticket14729 (queries.tests.RawQueriesTests)", "test_exists (queries.tests.ExistsSql)", "test_ticket_18414 (queries.tests.ExistsSql)", "test_ticket_24278 (queries.tests.TestTicket24279)", "test_ticket7371 (queries.tests.CustomPkTests)", "test_ticket_... | null | true | 2020-09-14T07:49:15Z | 1 | 7 | 2 | 937 | 0 | 1 | 1 | 0.55 | 1 | 0.1795 | 84.7135 | |
1,030 | swe_bench_verified::test::21 | swe_bench_verified | test | 21 | astropy__astropy-8872 | astropy/astropy | astropy/astropy | python | b750a0e6ee76fb6b8a099a4d16ec51977be46bf6 | float16 quantities get upgraded to float64 automatically
When trying to create a `Quantity` from a `np.float16` (not something I actually intended to do, I was experimenting while investigating other issue) it gets upgraded automatically to `np.float64`, which is something that does not happen with other float types:
... | Hmm, it was added in gh-1776 (code in [l299](https://github.com/astropy/astropy/blob/master/astropy/units/quantity.py#L299) and [l379](https://github.com/astropy/astropy/blob/master/astropy/units/quantity.py#L379) by checking `np.can_cast(np.float32, value.dtype)`. From the discussion, it seems half floats were never c... | diff --git a/astropy/units/quantity.py b/astropy/units/quantity.py
--- a/astropy/units/quantity.py
+++ b/astropy/units/quantity.py
@@ -215,8 +215,8 @@ class Quantity(np.ndarray, metaclass=InheritDocstrings):
dtype : ~numpy.dtype, optional
The dtype of the resulting Numpy array or scalar that will
... | diff --git a/astropy/units/tests/test_quantity.py b/astropy/units/tests/test_quantity.py
--- a/astropy/units/tests/test_quantity.py
+++ b/astropy/units/tests/test_quantity.py
@@ -138,10 +138,13 @@ def test_preserve_dtype(self):
assert q2.value == float(q1.value)
assert q2.unit == q1.unit
- # ... | ["astropy/units/tests/test_quantity.py::TestQuantityCreation::test_preserve_dtype"] | ["astropy/units/tests/test_quantity.py::TestQuantityCreation::test_1", "astropy/units/tests/test_quantity.py::TestQuantityCreation::test_2", "astropy/units/tests/test_quantity.py::TestQuantityCreation::test_3", "astropy/units/tests/test_quantity.py::TestQuantityCreation::test_nan_inf", "astropy/units/tests/test_quantit... | null | true | 2019-06-19T20:34:56Z | 1 | 11 | 1 | 854 | 0 | 1 | 1 | 0.55 | 1 | 0.179 | 84.712 | |
1,031 | swe_gym::train::59 | swe_gym | train | 59 | getmoto__moto-4849 | getmoto/moto | getmoto/moto | python | b28d763c080e04e8b2c02abafe675dc0c8d4b326 | DynamoDb2 create_table not validate ProvisionedThroughput parameter
Hello,
When I call create_table from dynamodb client, if a pass `BillingMode='PROVISIONED'` the parameter `ProvisionedThroughput ` is required, as you can see in boto3 documentation: [Boto3 DynamoDB create_table](https://boto3.amazonaws.com/v1/document... | Hi @lucianomarqueto, thanks for raising this! Marking it as an enhancement to implement this validation | diff --git a/moto/dynamodb2/exceptions.py b/moto/dynamodb2/exceptions.py
--- a/moto/dynamodb2/exceptions.py
+++ b/moto/dynamodb2/exceptions.py
@@ -205,6 +205,13 @@ def __init__(self):
super().__init__(self.msg)
+class TooManyTransactionsException(MockValidationException):
+ msg = "Validation error at tr... | diff --git a/tests/test_awslambda/test_lambda_eventsourcemapping.py b/tests/test_awslambda/test_lambda_eventsourcemapping.py
--- a/tests/test_awslambda/test_lambda_eventsourcemapping.py
+++ b/tests/test_awslambda/test_lambda_eventsourcemapping.py
@@ -115,6 +115,7 @@ def test_invoke_function_from_dynamodb_put():
... | ["tests/test_dynamodb2/exceptions/test_dynamodb_exceptions.py::test_transact_write_items__too_many_transactions", "tests/test_dynamodb2/test_dynamodb_create_table.py::test_create_table_error_pay_per_request_with_provisioned_param", "tests/test_dynamodb2/test_dynamodb_create_table.py::test_create_table_with_local_index"... | ["tests/test_dynamodb2/test_dynamodb.py::test_describe_endpoints[eu-central-1]", "tests/test_dynamodb2/test_dynamodb.py::test_scan_filter_should_not_return_non_existing_attributes", "tests/test_dynamodb2/test_dynamodb.py::test_put_return_attributes", "tests/test_dynamodb2/test_dynamodb.py::test_nested_projection_expres... | null | true | 2022-02-10 14:31:52 | 4 | 135 | 13 | 2,645 | 0 | 0.85 | 1 | 0.7 | 0.85 | 0.890833 | 84.71 | |
1,032 | swe_bench_verified::test::81 | swe_bench_verified | test | 81 | django__django-12325 | django/django | django/django | python | 29c126bb349526b5f1cd78facbe9f25906f18563 | pk setup for MTI to parent get confused by multiple OneToOne references.
Description
class Document(models.Model):
pass
class Picking(Document):
document_ptr = models.OneToOneField(Document, on_delete=models.CASCADE, parent_link=True, related_name='+')
origin = models.OneToOneField(Document, related_name='picking',... | That seems to be a bug, managed to reproduce. Does the error go away if you add primary_key=True to document_ptr like I assume you wanted to do? This makes me realized that the MTI documentation is not completely correcy, the automatically added `place_ptr` field end up with `primary_key=True`. Not sure why we're not... | diff --git a/django/db/models/base.py b/django/db/models/base.py
--- a/django/db/models/base.py
+++ b/django/db/models/base.py
@@ -202,7 +202,7 @@ def __new__(cls, name, bases, attrs, **kwargs):
continue
# Locate OneToOneField instances.
for field in base._meta.local_fields:
-... | diff --git a/tests/invalid_models_tests/test_models.py b/tests/invalid_models_tests/test_models.py
--- a/tests/invalid_models_tests/test_models.py
+++ b/tests/invalid_models_tests/test_models.py
@@ -3,7 +3,6 @@
from django.conf import settings
from django.core.checks import Error, Warning
from django.core.checks.mod... | ["test_clash_parent_link (invalid_models_tests.test_relative_fields.ComplexClashTests)", "test_onetoone_with_parent_model (invalid_models_tests.test_models.OtherModelTests)"] | ["test_check_constraints (invalid_models_tests.test_models.ConstraintsTests)", "test_check_constraints_required_db_features (invalid_models_tests.test_models.ConstraintsTests)", "test_accessor_clash (invalid_models_tests.test_relative_fields.SelfReferentialFKClashTests)", "test_clash_under_explicit_related_name (invali... | null | true | 2020-01-15T14:02:25Z | 2 | 8 | 2 | 898 | 0 | 1 | 1 | 0.55 | 1 | 0.176333 | 84.704 | |
1,033 | swe_bench_verified::test::197 | swe_bench_verified | test | 197 | django__django-15561 | django/django | django/django | python | 6991880109e35c879b71b7d9d9c154baeec12b89 | AlterField operation should be noop when adding/changing choices on SQLite.
Description
while writing a test case for #33470 i found that for sqlite, even a seemingly db-transparent change like adding choices still generates sql (new table + insert + drop + rename) even though this shouldn't be needed. on e.g. postgre... | It was missed in #25253 (see 9159d173c3822312c653db7ff5b9a94b14af1dca). Adding choices to the non_database_attrs should fix it: django/db/backends/base/schema.py diff --git a/django/db/backends/base/schema.py b/django/db/backends/base/schema.py index 4cd4567cbc..822da656d3 100644 a b class BaseDatabaseSchemaEditor: 113... | diff --git a/django/db/backends/base/schema.py b/django/db/backends/base/schema.py
--- a/django/db/backends/base/schema.py
+++ b/django/db/backends/base/schema.py
@@ -1376,22 +1376,9 @@ def _field_should_be_altered(self, old_field, new_field):
# - changing only a field name
# - changing an attribute t... | diff --git a/tests/schema/tests.py b/tests/schema/tests.py
--- a/tests/schema/tests.py
+++ b/tests/schema/tests.py
@@ -3961,6 +3961,20 @@ def test_alter_field_fk_attributes_noop(self):
with connection.schema_editor() as editor, self.assertNumQueries(0):
editor.alter_field(Book, new_field, old_fiel... | ["test_alter_field_choices_noop (schema.tests.SchemaTests)"] | ["effective_default() should be used for DateField, DateTimeField, and", "Tests adding fields to models", "Tests binary fields get a sane default (#22851)", "test_add_field_db_collation (schema.tests.SchemaTests)", "test_add_field_default_dropped (schema.tests.SchemaTests)", "test_add_field_default_nullable (schema.tes... | null | true | 2022-04-01T18:29:04Z | 2 | 35 | 1 | 357 | 0 | 1 | 1 | 0.55 | 1 | 0.176167 | 84.7035 | |
1,034 | swe_bench_verified::test::265 | swe_bench_verified | test | 265 | matplotlib__matplotlib-23412 | matplotlib/matplotlib | matplotlib/matplotlib | python | f06c2c3abdaf4b90285ce5ca7fedbb8ace715911 | [Bug]: offset dash linestyle has no effect in patch objects
### Bug summary
When setting the linestyle on a patch object using a dash tuple the offset has no effect.
### Code for reproduction
```python
import matplotlib.pyplot as plt
import matplotlib as mpl
plt.figure(figsize=(10,10))
ax = plt.gca()
ax.add_patch(m... | Upon digging deeper into this issue it appears that this actually the intended behavior: https://github.com/matplotlib/matplotlib/blob/f8cd2c9f532f65f8b2e3dec6d54e03c48721233c/lib/matplotlib/patches.py#L588
So it might be prudent to just update the docstring to reflect this fact.
I'm curious why this was made th... | diff --git a/lib/matplotlib/patches.py b/lib/matplotlib/patches.py
--- a/lib/matplotlib/patches.py
+++ b/lib/matplotlib/patches.py
@@ -586,9 +586,8 @@ def draw(self, renderer):
# docstring inherited
if not self.get_visible():
return
- # Patch has traditionally ignored the dashoffse... | diff --git a/lib/matplotlib/tests/test_patches.py b/lib/matplotlib/tests/test_patches.py
--- a/lib/matplotlib/tests/test_patches.py
+++ b/lib/matplotlib/tests/test_patches.py
@@ -149,6 +149,40 @@ def test_rotate_rect_draw(fig_test, fig_ref):
assert rect_test.get_angle() == angle
+@check_figures_equal(extension... | ["lib/matplotlib/tests/test_patches.py::test_dash_offset_patch_draw[png]"] | ["lib/matplotlib/tests/test_patches.py::test_Polygon_close", "lib/matplotlib/tests/test_patches.py::test_corner_center", "lib/matplotlib/tests/test_patches.py::test_rotate_rect", "lib/matplotlib/tests/test_patches.py::test_rotate_rect_draw[png]", "lib/matplotlib/tests/test_patches.py::test_negative_rect", "lib/matplotl... | null | true | 2022-07-11T01:41:11Z | 1 | 5 | 1 | 1,823 | 0 | 1 | 1 | 0.7 | 0.8 | 0.3205 | 84.6615 | |
1,035 | swe_gym::train::58 | swe_gym | train | 58 | getmoto__moto-5731 | getmoto/moto | getmoto/moto | python | e4c0d0618c586ffb6eb5d8c9f2c8437f57eacebc | CloudFormation: create_stack_instances returns a hardcoded OperationId
`create_stack_instances` is giving me some issues, I am not sure yet if I am just doing something wrong. Note, I don't care at all about the template, that is just one of the shorter ones I had on hand.
`moto==1.3.16`
Here is a reproduction of the... | Ah, I see on https://github.com/spulec/moto/blob/1.3.16/IMPLEMENTATION_COVERAGE.md#cloudformation that `list_stack_instances` is unimplemented
Hey @jbpratt, thanks for raising this.
All operations that you need are implemented - it looks like the coverage doc is simply not up to date.
The first issue here is that t... | diff --git a/moto/cloudformation/exceptions.py b/moto/cloudformation/exceptions.py
--- a/moto/cloudformation/exceptions.py
+++ b/moto/cloudformation/exceptions.py
@@ -38,6 +38,16 @@ def __init__(self, export_name: str):
self.description = template.render(code="ExportNotFound", message=message)
+class Stack... | diff --git a/tests/test_cloudformation/test_cloudformation_multi_accounts.py b/tests/test_cloudformation/test_cloudformation_multi_accounts.py
new file mode 100644
--- /dev/null
+++ b/tests/test_cloudformation/test_cloudformation_multi_accounts.py
@@ -0,0 +1,294 @@
+import boto3
+import json
+import pytest
+from botoco... | ["tests/test_cloudformation/test_cloudformation_multi_accounts.py::TestSelfManagedStacks::test_delete_instances", "tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py::test_create_stack_set__invalid_name[-set]", "tests/test_cloudformation/test_cloudformation_multi_accounts.py::TestServiceManagedStacks::te... | ["tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py::test_describe_stack_with_special_chars", "tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py::test_get_template_summary", "tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py::test_create_change_set_from_s3_url", "tests/te... | null | true | 2022-12-02 22:07:21 | 3 | 313 | 14 | 4,438 | 0 | 0.85 | 1 | 0.77 | 0.75 | 1 | 84.6575 | |
1,036 | swe_gym::train::2418 | swe_gym | train | 2,418 | modin-project__modin-6633 | modin-project/modin | modin-project/modin | python | 77b8d367962766ad5cfe45a2a0981827a6508214 | BUG: Ray remote tasks internally blocking on object IDs of their dependencies can lead to deadlock
### System information
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**: macOS Monterey
- **Modin version** (`modin.__version__`): I ran into this issue in my branch https://github.com/mvashishtha/modin/tree/... | <img width="367" alt="Screen Shot 2022-08-02 at 2 35 24 PM" src="https://user-images.githubusercontent.com/10712109/182458792-8cdc1cdf-f576-4d92-b083-31b881ac75ce.png">
| diff --git a/modin/core/execution/ray/common/utils.py b/modin/core/execution/ray/common/utils.py
--- a/modin/core/execution/ray/common/utils.py
+++ b/modin/core/execution/ray/common/utils.py
@@ -286,3 +286,111 @@ def deserialize(obj): # pragma: no cover
return dict(zip(obj.keys(), RayWrapper.materialize(list(... | diff --git a/modin/test/storage_formats/pandas/test_internals.py b/modin/test/storage_formats/pandas/test_internals.py
--- a/modin/test/storage_formats/pandas/test_internals.py
+++ b/modin/test/storage_formats/pandas/test_internals.py
@@ -1390,3 +1390,124 @@ def test_sort_values_cache():
# check that the initial f... | ["modin/test/storage_formats/pandas/test_internals.py::test_call_queue_serialization[call_queue1]", "modin/test/storage_formats/pandas/test_internals.py::test_call_queue_serialization[call_queue3]", "modin/test/storage_formats/pandas/test_internals.py::test_call_queue_serialization[call_queue5]", "modin/test/storage_fo... | ["modin/test/storage_formats/pandas/test_internals.py::test_reorder_labels_cache[unbalanced_partitioning-no_reordering-projection_only]", "modin/test/storage_formats/pandas/test_internals.py::test_reorder_labels_cache[two_unbalanced_partitions-size_grow-no_reordering]", "modin/test/storage_formats/pandas/test_internals... | null | true | 2023-10-05T10:11:51Z | 3 | 209 | 6 | 3,849 | 0 | 0.85 | 1 | 0.77 | 0.75 | 1 | 84.6575 | |
1,037 | swe_bench_verified::test::56 | swe_bench_verified | test | 56 | django__django-11728 | django/django | django/django | python | 05457817647368be4b019314fcc655445a5b4c0c | simplify_regexp() doesn't replace trailing groups.
Description
replace_named_groups() fails to replace the final named group if the urlpattern passed in is missing a trailing '/'.
For example, with input r'entries/(?P<pk>[^/.]+)/relationships/(?P<related_field>\w+)' the "related_field" does not get properly replaced. ... | Here's execution of the example code: (env) django-example$ python demo.py path: entries/(?P<pk>[^/.]+)/relationships/(?P<related_field>\w+) expected: entries/<pk>/relationships/<related_field> got: entries/<pk>/relationships/(?P<related_field>\w+) path_trailing: entries/(?P<pk>[^/.]+)/relationships/(?P<related_field>\... | diff --git a/django/contrib/admindocs/utils.py b/django/contrib/admindocs/utils.py
--- a/django/contrib/admindocs/utils.py
+++ b/django/contrib/admindocs/utils.py
@@ -155,6 +155,8 @@ def replace_named_groups(pattern):
Find named groups in `pattern` and replace them with the group name. E.g.,
1. ^(?P<a>\w+)/b/... | diff --git a/tests/admin_docs/test_views.py b/tests/admin_docs/test_views.py
--- a/tests/admin_docs/test_views.py
+++ b/tests/admin_docs/test_views.py
@@ -348,9 +348,13 @@ def test_simplify_regex(self):
(r'^a', '/a'),
(r'^(?P<a>\w+)/b/(?P<c>\w+)/$', '/<a>/b/<c>/'),
(r'^(?P<a>\w+)/... | ["test_simplify_regex (admin_docs.test_views.AdminDocViewFunctionsTests)", "test_app_not_found (admin_docs.test_views.TestModelDetailView)"] | ["test_builtin_fields (admin_docs.test_views.TestFieldType)", "test_custom_fields (admin_docs.test_views.TestFieldType)", "test_field_name (admin_docs.test_views.TestFieldType)", "test_descriptions_render_correctly (admin_docs.test_views.TestModelDetailView)", "Model properties are displayed as fields.", "test_method_d... | null | true | 2019-08-29T17:31:03Z | 1 | 22 | 2 | 496 | 0 | 1 | 1 | 0.55 | 1 | 0.156 | 84.643 | |
1,038 | swe_bench_verified::test::430 | swe_bench_verified | test | 430 | sympy__sympy-13031 | sympy/sympy | sympy/sympy | python | 2dfa7457f20ee187fbb09b5b6a1631da4458388c | Behavior of Matrix hstack and vstack changed in sympy 1.1
In sympy 1.0:
```
import sympy as sy
M1 = sy.Matrix.zeros(0, 0)
M2 = sy.Matrix.zeros(0, 1)
M3 = sy.Matrix.zeros(0, 2)
M4 = sy.Matrix.zeros(0, 3)
sy.Matrix.hstack(M1, M2, M3, M4).shape
```
returns
`(0, 6)`
Now, same in sympy 1.1:
```
import sympy as sy
M1 = sy.M... | CC @siefkenj
I update my comment in case someone already read it. We still have an issue with matrices shape in [pyphs](https://github.com/pyphs/pyphs/issues/49#issuecomment-316618994), but hstack and vstack seem ok in sympy 1.1.1rc1:
```
>>> import sympy as sy
>>> sy.__version__
'1.1.1rc1'
>>> '1.1.1rc1'
'1.1... | diff --git a/sympy/matrices/sparse.py b/sympy/matrices/sparse.py
--- a/sympy/matrices/sparse.py
+++ b/sympy/matrices/sparse.py
@@ -985,8 +985,10 @@ def col_join(self, other):
>>> C == A.row_insert(A.rows, Matrix(B))
True
"""
- if not self:
- return type(self)(other)
+ ... | diff --git a/sympy/matrices/tests/test_sparse.py b/sympy/matrices/tests/test_sparse.py
--- a/sympy/matrices/tests/test_sparse.py
+++ b/sympy/matrices/tests/test_sparse.py
@@ -26,6 +26,12 @@ def sparse_zeros(n):
assert type(a.row_join(b)) == type(a)
assert type(a.col_join(b)) == type(a)
+ # make sure 0 x ... | ["test_sparse_matrix"] | ["test_transpose", "test_trace", "test_CL_RL", "test_add", "test_errors", "test_len", "test_sparse_zeros_sparse_eye", "test_copyin", "test_sparse_solve"] | null | true | 2017-07-23T15:48:13Z | 1 | 12 | 1 | 680 | 0 | 1 | 1 | 0.55 | 1 | 0.153333 | 84.635 | |
1,039 | swe_bench_verified::test::485 | swe_bench_verified | test | 485 | sympy__sympy-22080 | sympy/sympy | sympy/sympy | python | 3f8c8c2377cb8e0daaf8073e8d03ac7d87580813 | Mod function lambdify bug
Description:
When lambdifying any function of structure like `expr * Mod(a, b)` sympy moves the multiplier into the first argument of Mod, like `Mod(expr * a, b)`, WHEN we specify `modules=[]`
This is an example from Sympy online shell
```
>>> from sympy import Mod, lambdify, symbols
>>> x, y... | Looks like the printer has the precedence order wrong for - and %
A more direct reproduction
```py
>>> pycode(-Mod(x, y))
'-x % y'
```
hi @asmeurer i should i please take this up !!
please do reply ..
thanks:-)
Hello anyone working on this?? I would like to help.
I want to contribute on this issue. Is this... | diff --git a/sympy/printing/codeprinter.py b/sympy/printing/codeprinter.py
--- a/sympy/printing/codeprinter.py
+++ b/sympy/printing/codeprinter.py
@@ -9,7 +9,7 @@
from sympy.core.mul import _keep_coeff
from sympy.core.symbol import Symbol
from sympy.printing.str import StrPrinter
-from sympy.printing.precedence impo... | diff --git a/sympy/codegen/tests/test_rewriting.py b/sympy/codegen/tests/test_rewriting.py
--- a/sympy/codegen/tests/test_rewriting.py
+++ b/sympy/codegen/tests/test_rewriting.py
@@ -266,10 +266,10 @@ def test_create_expand_pow_optimization():
# gh issue 15335
assert cc(x**(-4)) == '1.0/(x*x*x*x)'
assert... | ["test_create_expand_pow_optimization", "test_PythonCodePrinter", "test_empty_modules"] | ["test_log2_opt", "test_exp2_opt", "test_expm1_opt", "test_expm1_two_exp_terms", "test_cosm1_opt", "test_cosm1_two_cos_terms", "test_expm1_cosm1_mixed", "test_log1p_opt", "test_optims_c99", "test_matsolve", "test_logaddexp_opt", "test_logaddexp2_opt", "test_sinc_opts", "test_optims_numpy", "test_PythonCodePrinter_stand... | null | true | 2021-09-12T07:11:33Z | 2 | 12 | 3 | 621 | 0 | 1 | 1 | 0.55 | 1 | 0.1435 | 84.6055 | |
1,040 | swe_gym::train::2032 | swe_gym | train | 2,032 | Project-MONAI__MONAI-865 | Project-MONAI/MONAI | project-monai/monai | python | b61dcfbe20981ffca098b7c65fc85e7e38c30bcf | Error with tensor size using ArrayDataset, but not with CacheDataset?
Hello,
I'm trying to use `ArrayDataset` to train a UNet with a single channeled image. I have my own data augmentation procedure that passes array data of size (160, 160) to `ArrayDataset`. I use the only the minimum transforms as follows:
```
trans... | diff --git a/monai/data/dataset.py b/monai/data/dataset.py
--- a/monai/data/dataset.py
+++ b/monai/data/dataset.py
@@ -361,7 +361,8 @@ def to_list(x):
data.extend(to_list(dataset[index]))
if self.transform is not None:
data = apply_transform(self.transform, data, map_items=False) # t... | diff --git a/tests/test_arraydataset.py b/tests/test_arraydataset.py
--- a/tests/test_arraydataset.py
+++ b/tests/test_arraydataset.py
@@ -116,7 +116,7 @@ def test_default_none(self, img_transform, expected_shape):
shutil.rmtree(tempdir)
@parameterized.expand([TEST_CASE_4])
- def test_dataloading(sel... | ["tests/test_zipdataset.py::TestZipDataset::test_value_2", "tests/test_zipdataset.py::TestZipDataset::test_value_1", "tests/test_zipdataset.py::TestZipDataset::test_value_3", "tests/test_zipdataset.py::TestZipDataset::test_value_0"] | [] | null | true | 2020-08-06T14:28:23Z | 2 | 6 | 4 | 1,890 | 0 | 0.85 | 1 | 0.7 | 1 | 0.335 | 84.605 | ||
1,041 | swe_bench_verified::test::39 | swe_bench_verified | test | 39 | django__django-11206 | django/django | django/django | python | 571ab44e8a8936014c22e7eebe4948d9611fd7ce | utils.numberformat.format renders small decimals in exponential notation.
Description
When using utils.number_format with decimal_pos, extremely small numbers get displayed using exponential notation.
>>> from django.utils.numberformat import format as nformat
>>> nformat(Decimal('1e-199'), '.', decimal_pos=2)
'0.00'
... | Hi Sjoerd. OK, so this is related to the changes in 9cc6a60040b0f64f8ea066dd215176d4bd16621d. Happy to Accept as a potential Cleanup/optimization — I guess ultimately it depends on what the change looks like. (i.e. is the nicer behaviour worth the extra complexity? etc) I'm assuming you're ready/willing to make the pat... | diff --git a/django/utils/numberformat.py b/django/utils/numberformat.py
--- a/django/utils/numberformat.py
+++ b/django/utils/numberformat.py
@@ -27,6 +27,14 @@ def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='',
# sign
sign = ''
if isinstance(number, Decimal):
+
+ if d... | diff --git a/tests/utils_tests/test_numberformat.py b/tests/utils_tests/test_numberformat.py
--- a/tests/utils_tests/test_numberformat.py
+++ b/tests/utils_tests/test_numberformat.py
@@ -94,7 +94,7 @@ def test_decimal_numbers(self):
('1e-10', 8, '0.00000000'),
('1e-11', 8, '0.00000000'),
... | ["test_decimal_numbers (utils_tests.test_numberformat.TestNumberFormat)", "test_decimal_subclass (utils_tests.test_numberformat.TestNumberFormat)"] | ["test_float_numbers (utils_tests.test_numberformat.TestNumberFormat)", "test_format_number (utils_tests.test_numberformat.TestNumberFormat)", "test_format_string (utils_tests.test_numberformat.TestNumberFormat)", "test_large_number (utils_tests.test_numberformat.TestNumberFormat)"] | null | true | 2019-04-13T10:19:38Z | 1 | 8 | 2 | 696 | 0 | 1 | 1 | 0.55 | 1 | 0.142667 | 84.603 | |
1,042 | swe_bench_verified::test::63 | swe_bench_verified | test | 63 | django__django-11848 | django/django | django/django | python | f0adf3b9b7a19cdee05368ff0c0c2d087f011180 | django.utils.http.parse_http_date two digit year check is incorrect
Description
(last modified by Ad Timmering)
RFC 850 does not mention this, but in RFC 7231 (and there's something similar in RFC 2822), there's the following quote:
Recipients of a timestamp value in rfc850-date format, which uses a
two-digit year,... | Accepted, however I don't think your patch is correct. The check should be relative to the current year, if I read the RFC quote correctly.
Created a pull request: Created a pull request: https://github.com/django/django/pull/9214
Still some suggested edits on the PR.
I added regression test that fails with old code (... | diff --git a/django/utils/http.py b/django/utils/http.py
--- a/django/utils/http.py
+++ b/django/utils/http.py
@@ -176,10 +176,14 @@ def parse_http_date(date):
try:
year = int(m.group('year'))
if year < 100:
- if year < 70:
- year += 2000
+ current_year = date... | diff --git a/tests/utils_tests/test_http.py b/tests/utils_tests/test_http.py
--- a/tests/utils_tests/test_http.py
+++ b/tests/utils_tests/test_http.py
@@ -1,5 +1,6 @@
import unittest
from datetime import datetime
+from unittest import mock
from django.test import SimpleTestCase, ignore_warnings
from django.utils.... | ["test_parsing_rfc850 (utils_tests.test_http.HttpDateProcessingTests)", "test_parsing_year_less_than_70 (utils_tests.test_http.HttpDateProcessingTests)"] | ["test_input_too_large (utils_tests.test_http.Base36IntTests)", "test_invalid_literal (utils_tests.test_http.Base36IntTests)", "test_negative_input (utils_tests.test_http.Base36IntTests)", "test_roundtrip (utils_tests.test_http.Base36IntTests)", "test_to_base36_errors (utils_tests.test_http.Base36IntTests)", "test_to_i... | null | true | 2019-09-28T04:28:22Z | 1 | 10 | 2 | 621 | 0 | 1 | 1 | 0.55 | 1 | 0.136833 | 84.5855 | |
1,043 | swe_gym::train::336 | swe_gym | train | 336 | getmoto__moto-6374 | getmoto/moto | getmoto/moto | python | b180f0a015c625f2fb89a3330176d72b8701c0f9 | Unexpected FlowLogAlreadyExists Error when all flow logs have no log_group_name
# Issue description
Adding 2 flow logs having different `log_destination` but no `log_group_name`(unset as deprecated) raises an undesired `FlowLogAlreadyExists`.
# Reproduction (with awslocal & localstack, which make use of moto's EC2 bac... | diff --git a/moto/ec2/models/flow_logs.py b/moto/ec2/models/flow_logs.py
--- a/moto/ec2/models/flow_logs.py
+++ b/moto/ec2/models/flow_logs.py
@@ -253,11 +253,8 @@ def create_flow_logs(
all_flow_logs = self.describe_flow_logs()
if any(
- fl.resource_id == resource_id
- ... | diff --git a/tests/test_ec2/test_flow_logs.py b/tests/test_ec2/test_flow_logs.py
--- a/tests/test_ec2/test_flow_logs.py
+++ b/tests/test_ec2/test_flow_logs.py
@@ -68,6 +68,56 @@ def test_create_flow_logs_s3():
flow_log["MaxAggregationInterval"].should.equal(600)
+@mock_s3
+@mock_ec2
+def test_create_multiple_f... | ["tests/test_ec2/test_flow_logs.py::test_create_multiple_flow_logs_s3", "tests/test_ec2/test_flow_logs.py::test_create_multiple_flow_logs_cloud_watch"] | ["tests/test_ec2/test_flow_logs.py::test_create_flow_logs_cloud_watch", "tests/test_ec2/test_flow_logs.py::test_describe_flow_logs_filtering", "tests/test_ec2/test_flow_logs.py::test_delete_flow_logs_non_existing", "tests/test_ec2/test_flow_logs.py::test_delete_flow_logs", "tests/test_ec2/test_flow_logs.py::test_create... | null | true | 2023-06-06 14:39:51 | 1 | 7 | 2 | 1,799 | 0 | 0.85 | 1 | 0.7 | 1 | 0.323167 | 84.5695 | ||
1,044 | swe_gym::train::2394 | swe_gym | train | 2,394 | modin-project__modin-6545 | modin-project/modin | modin-project/modin | python | 0e426677ca39458d61e57c9f2ca23ad5c0789f6e | BUG: read_parquet doesn't handle index names correctly
### Modin version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the latest released version of Modin.
- [X] I have confirmed this bug exists on the main branch of Modin. (In order to do this ... |
By the way, with regard to the expected behavior, from a bit of investigation I have determined that the two parquet engines, pyarrow and fastparquet, behave a little differently with respect to the `step` attribute of the RangeIndex.
```python
import pandas
import pyarrow.dataset as ds
my_data = pandas.DataFr... | diff --git a/modin/conftest.py b/modin/conftest.py
--- a/modin/conftest.py
+++ b/modin/conftest.py
@@ -385,6 +385,9 @@ def _make_parquet_file(
nrows=NROWS,
ncols=2,
force=True,
+ range_index_start=0,
+ range_index_step=1,
+ range_index_name=None,
partitioned_colu... | diff --git a/modin/pandas/test/test_io.py b/modin/pandas/test/test_io.py
--- a/modin/pandas/test/test_io.py
+++ b/modin/pandas/test/test_io.py
@@ -42,6 +42,7 @@
from modin.pandas.utils import from_arrow
from modin.test.test_utils import warns_that_defaulting_to_pandas
import pyarrow as pa
+import pyarrow.dataset
im... | ["modin/pandas/test/test_io.py::TestParquet::test_read_parquet_filters[None-pyarrow]", "modin/pandas/test/test_io.py::TestParquet::test_read_parquet_partitioned_directory[1-5000-filters2-columns1-fastparquet]", "modin/pandas/test/test_io.py::TestParquet::test_read_parquet_directory_range_index_consistent_metadata[my_in... | ["modin/pandas/test/test_io.py::TestCsv::test_read_csv_parsing_2[latin1-None-None-skiprows5-infer]", "modin/pandas/test/test_io.py::TestParquet::test_read_parquet_directory[rows_per_file2-None-None-None-pyarrow]", "modin/pandas/test/test_io.py::TestCsv::test_read_csv_parse_dates[None-infer-5-nonexistent_string_column-s... | null | true | 2023-09-09T01:50:09Z | 1 | 55 | 296 | 11,439 | 0 | 0.85 | 0.75 | 0.8 | 1 | 0.683333 | 84.5625 | |
1,045 | swe_gym::train::621 | swe_gym | train | 621 | conan-io__conan-14195 | conan-io/conan | conan-io/conan | python | 57c7049c758a685cdc02e870eb77617af5e45da6 | [feature] Allow custom otool and install_name_tool programs in fix_apple_shared_install_name
### What is your suggestion?
I'm cross compiling some Conan recipes from Linux to macOS using [osxcross](https://github.com/tpoechtrager/osxcross) to make the toolchain. `fix_apple_shared_install_name` currently hardcodes `oto... | diff --git a/conan/tools/apple/apple.py b/conan/tools/apple/apple.py
--- a/conan/tools/apple/apple.py
+++ b/conan/tools/apple/apple.py
@@ -175,9 +175,19 @@ def libtool(self):
"""path to libtool"""
return self.find('libtool')
+ @property
+ def otool(self):
+ """path to otool"""
+ ... | diff --git a/conans/test/unittests/tools/apple/test_apple_tools.py b/conans/test/unittests/tools/apple/test_apple_tools.py
--- a/conans/test/unittests/tools/apple/test_apple_tools.py
+++ b/conans/test/unittests/tools/apple/test_apple_tools.py
@@ -68,5 +68,5 @@ def test_get_dylib_install_name():
for mock_output in ... | ["conans/test/unittests/tools/apple/test_apple_tools.py::test_get_dylib_install_name"] | ["conans/test/unittests/tools/apple/test_apple_tools.py::test_tools_apple_is_apple_os", "conans/test/unittests/tools/apple/test_apple_tools.py::test_fix_shared_install_name_no_libraries", "conans/test/unittests/tools/apple/test_apple_tools.py::test_xcrun_public_settings", "conans/test/unittests/tools/apple/test_apple_t... | null | true | 2023-06-29T13:58:32Z | 1 | 46 | 1 | 996 | 0 | 0.85 | 1 | 0.7 | 1 | 0.319333 | 84.558 | ||
1,046 | swe_gym::train::2154 | swe_gym | train | 2,154 | Project-MONAI__MONAI-2753 | Project-MONAI/MONAI | project-monai/monai | python | a7d45741cca2235038ad01bf654e104e563355f3 | Add option for rounding via a transform
**Is your feature request related to a problem? Please describe.**
Storing NIfTI images is often not done in the right data type (because it is forgotten). I had the issue multiple times that a label / segmentation image which is supposed to only consist of integer values was st... | diff --git a/monai/transforms/post/array.py b/monai/transforms/post/array.py
--- a/monai/transforms/post/array.py
+++ b/monai/transforms/post/array.py
@@ -25,7 +25,7 @@
from monai.networks.layers import GaussianFilter
from monai.transforms.transform import Transform
from monai.transforms.utils import fill_holes, get... | diff --git a/tests/test_as_discrete.py b/tests/test_as_discrete.py
--- a/tests/test_as_discrete.py
+++ b/tests/test_as_discrete.py
@@ -44,9 +44,16 @@
(3,),
]
+TEST_CASE_5 = [
+ {"rounding": "torchrounding"},
+ torch.tensor([[[0.123, 1.345], [2.567, 3.789]]]),
+ torch.tensor([[[0.0, 1.0], [3.0, 4.0]]]),... | ["tests/test_as_discreted.py::TestAsDiscreted::test_value_shape_3", "tests/test_as_discrete.py::TestAsDiscrete::test_value_shape_4"] | ["tests/test_as_discreted.py::TestAsDiscreted::test_value_shape_1", "tests/test_as_discrete.py::TestAsDiscrete::test_value_shape_3", "tests/test_as_discreted.py::TestAsDiscreted::test_value_shape_0", "tests/test_as_discreted.py::TestAsDiscreted::test_value_shape_2", "tests/test_as_discrete.py::TestAsDiscrete::test_valu... | null | true | 2021-08-12T09:23:56Z | 2 | 27 | 2 | 1,376 | 0 | 0.85 | 1 | 0.7 | 1 | 0.319333 | 84.558 | ||
1,047 | swe_bench_verified::test::220 | swe_bench_verified | test | 220 | django__django-16145 | django/django | django/django | python | 93d4c9ea1de24eb391cb2b3561b6703fd46374df | `runserver 0`'s "Starting development server at <address>" doesn't work
Description
According to tutorial running
python manage.py runserver 0:8000
is the same as
python manage.py runserver 0.0.0.0:8000
but it's output
$ python manage.py runserver 0:8000 Watching for file changes with StatReloader
...
Starti... | On a Mac I could click that link and have it take me to http://0.0.0.0:8000/ What OS are you on? It might even be better to just explicitly change it to say "0.0.0.0" because at least then you can copy & paste it as well … Let's wait to see what the triage team decide 🤷♂️
According to the Diátaxis framework, a tuto... | diff --git a/django/core/management/commands/runserver.py b/django/core/management/commands/runserver.py
--- a/django/core/management/commands/runserver.py
+++ b/django/core/management/commands/runserver.py
@@ -129,6 +129,13 @@ def inner_run(self, *args, **options):
shutdown_message = options.get("shutdown_mes... | diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
--- a/tests/admin_scripts/tests.py
+++ b/tests/admin_scripts/tests.py
@@ -1587,6 +1587,21 @@ def test_runserver_addrport(self):
call_command(self.cmd, addrport="7000")
self.assertServerSettings("127.0.0.1", "7000")
+ @mock.p... | ["test_zero_ip_addr (admin_scripts.tests.ManageRunserver)"] | ["Program name is computed from the execute_from_command_line()'s argv", "test_params_to_runserver (admin_scripts.tests.ManageTestserver)", "test_testserver_handle_params (admin_scripts.tests.ManageTestserver)", "test_migration_warning_multiple_apps (admin_scripts.tests.ManageRunserverMigrationWarning)", "test_migratio... | null | true | 2022-10-03T05:09:14Z | 1 | 9 | 1 | 576 | 0 | 1 | 1 | 0.55 | 1 | 0.126 | 84.553 | |
1,048 | swe_bench_verified::test::27 | swe_bench_verified | test | 27 | django__django-10999 | django/django | django/django | python | 36300ef336e3f130a0dadc1143163ff3d23dc843 | Fix parse_duration() for some negative durations
Description
The https://docs.djangoproject.com/en/2.1/_modules/django/utils/dateparse/ defines:
standard_duration_re = re.compile(
r'^'
r'(?:(?P<days>-?\d+) (days?, )?)?'
r'((?:(?P<hours>-?\d+):)(?=\d+:\d+))?'
r'(?:(?P<minutes>-?\d+):)?'
r'(?P<seconds>-?\d+)'
r'(... | Please give an example valid that's not working. There are some tests for negative values.
Right, this should have been fixed by #27699 which is included in 1.11.x.
Example cases, can be discussed: parse_duration('-00:01:01') => plus 61 seconds, so it is not -(00:01:01) but (-00):(+01):(+01) parse_duration('00:-01:-01... | diff --git a/django/utils/dateparse.py b/django/utils/dateparse.py
--- a/django/utils/dateparse.py
+++ b/django/utils/dateparse.py
@@ -29,9 +29,10 @@
standard_duration_re = re.compile(
r'^'
r'(?:(?P<days>-?\d+) (days?, )?)?'
- r'((?:(?P<hours>-?\d+):)(?=\d+:\d+))?'
- r'(?:(?P<minutes>-?\d+):)?'
- r'... | diff --git a/tests/utils_tests/test_dateparse.py b/tests/utils_tests/test_dateparse.py
--- a/tests/utils_tests/test_dateparse.py
+++ b/tests/utils_tests/test_dateparse.py
@@ -113,9 +113,12 @@ def test_negative(self):
test_values = (
('-4 15:30', timedelta(days=-4, minutes=15, seconds=30)),
... | ["test_negative (utils_tests.test_dateparse.DurationParseTests)", "test_parse_postgresql_format (utils_tests.test_dateparse.DurationParseTests)"] | ["test_parse_date (utils_tests.test_dateparse.DateParseTests)", "test_parse_datetime (utils_tests.test_dateparse.DateParseTests)", "test_parse_time (utils_tests.test_dateparse.DateParseTests)", "test_days (utils_tests.test_dateparse.DurationParseTests)", "test_fractions_of_seconds (utils_tests.test_dateparse.DurationPa... | null | true | 2019-02-16T07:44:50Z | 1 | 7 | 2 | 614 | 0 | 1 | 1 | 0.55 | 1 | 0.125667 | 84.552 | |
1,049 | swe_bench_verified::test::78 | swe_bench_verified | test | 78 | django__django-12276 | django/django | django/django | python | 53d8646f799de7f92ab9defe9dc56c6125448102 | FileInput shouldn't display required attribute when initial data exists.
Description
(last modified by thenewguy)
I think that ClearableFileInput.use_required_attribute() (https://github.com/django/django/blob/e703b93a656b78b9b444bb3a9980e305ed002a70/django/forms/widgets.py#L454) should be moved to FileInput.use_r... | This might explain better: from django import forms from django.core.files.base import ContentFile from django.test import SimpleTestCase class FileForm(forms.Form): file = forms.FileField(widget=forms.FileInput) class FileInputRenderTest(SimpleTestCase): def test_file_input(self): form = FileForm() field = form['file'... | diff --git a/django/forms/widgets.py b/django/forms/widgets.py
--- a/django/forms/widgets.py
+++ b/django/forms/widgets.py
@@ -387,6 +387,9 @@ def value_from_datadict(self, data, files, name):
def value_omitted_from_data(self, data, files, name):
return name not in files
+ def use_required_attribute(... | diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py
--- a/tests/forms_tests/tests/test_forms.py
+++ b/tests/forms_tests/tests/test_forms.py
@@ -8,11 +8,11 @@
from django.core.validators import MaxValueValidator, RegexValidator
from django.forms import (
BooleanField, CharFi... | ["test_use_required_attribute (forms_tests.widget_tests.test_fileinput.FileInputTest)", "test_filefield_with_fileinput_required (forms_tests.tests.test_forms.FormsTestCase)"] | ["test_attribute_class (forms_tests.tests.test_forms.RendererTests)", "test_attribute_instance (forms_tests.tests.test_forms.RendererTests)", "test_attribute_override (forms_tests.tests.test_forms.RendererTests)", "test_default (forms_tests.tests.test_forms.RendererTests)", "test_kwarg_class (forms_tests.tests.test_for... | null | true | 2020-01-05T08:04:40Z | 1 | 6 | 2 | 599 | 0 | 1 | 1 | 0.55 | 1 | 0.119833 | 84.5345 | |
1,050 | swe_gym::train::1114 | swe_gym | train | 1,114 | pydantic__pydantic-8650 | pydantic/pydantic | pydantic/pydantic | python | 5fc166c031dc3665748c5ce6c0284abd5e61c195 | `NameEmail` does not support parsing from json input
### Initial Checks
- [X] I confirm that I'm using Pydantic V2
### Description
Originate from https://github.com/pydantic/pydantic/issues/7720#issuecomment-1812475489. Turns out that is an issue with implementation of `NameEmail`.
Support matrix of `NameEmail` cur... | diff --git a/pydantic/networks.py b/pydantic/networks.py
--- a/pydantic/networks.py
+++ b/pydantic/networks.py
@@ -479,14 +479,18 @@ def __get_pydantic_core_schema__(
_handler: GetCoreSchemaHandler,
) -> core_schema.CoreSchema:
import_email_validator()
+
return core_schema.no_info_after_... | diff --git a/tests/test_networks.py b/tests/test_networks.py
--- a/tests/test_networks.py
+++ b/tests/test_networks.py
@@ -850,9 +850,18 @@ class Model(BaseModel):
assert str(Model(v=NameEmail('foo bar', 'foobaR@example.com')).v) == 'foo bar <foobaR@example.com>'
assert str(Model(v='foo bar <foobaR@example... | ["tests/test_networks.py::test_name_email"] | ["tests/test_networks.py::test_any_url_success[http://twitter.com/@handle/]", "tests/test_networks.py::test_any_url_success[http://example.org/path?query#fragment]", "tests/test_networks.py::test_any_url_success[postgresql+psycopg://postgres:postgres@localhost:5432/hatch]", "tests/test_networks.py::test_any_url_success... | null | true | 2024-01-26T22:08:08Z | 1 | 14 | 1 | 1,588 | 0 | 0.85 | 1 | 0.7 | 1 | 0.311333 | 84.534 | ||
1,051 | swe_bench_verified::test::285 | swe_bench_verified | test | 285 | matplotlib__matplotlib-26342 | matplotlib/matplotlib | matplotlib/matplotlib | python | 2aee6ccd7c7e1f8d282c1e7579f4ee546b838542 | [ENH]: ContourSet.set_paths
### Problem
To get contour labelling working with its special transforms, Cartopy has a [workaround](https://github.com/SciTools/cartopy/blob/2ed668c17b4e52421f15c5be3761719c75c5311a/lib/cartopy/mpl/contour.py#L89-L108) where it replaces all the paths on the `ContourSet` with transformed ve... | I'm actually a bit confused as to why Collection.set_paths raises NotImplementedError instead of setting self._paths (which is what Collection.get_paths already returns).
Thanks @anntzer. So would it be enough to just copy what `PathCollection` has?
https://github.com/matplotlib/matplotlib/blob/2a4d905ff2e649326419... | diff --git a/lib/matplotlib/collections.py b/lib/matplotlib/collections.py
--- a/lib/matplotlib/collections.py
+++ b/lib/matplotlib/collections.py
@@ -207,7 +207,8 @@ def get_paths(self):
return self._paths
def set_paths(self, paths):
- raise NotImplementedError
+ self._paths = paths
+ ... | diff --git a/lib/matplotlib/tests/test_contour.py b/lib/matplotlib/tests/test_contour.py
--- a/lib/matplotlib/tests/test_contour.py
+++ b/lib/matplotlib/tests/test_contour.py
@@ -11,7 +11,7 @@
from matplotlib import pyplot as plt, rc_context, ticker
from matplotlib.colors import LogNorm, same_color
import matplotlib... | ["lib/matplotlib/tests/test_contour.py::test_contour_set_paths[png]"] | ["lib/matplotlib/tests/test_contour.py::test_contour_shape_1d_valid", "lib/matplotlib/tests/test_contour.py::test_contour_shape_2d_valid", "lib/matplotlib/tests/test_contour.py::test_contour_shape_error[args0-Length", "lib/matplotlib/tests/test_contour.py::test_contour_shape_error[args1-Length", "lib/matplotlib/tests/t... | null | true | 2023-07-18T10:06:19Z | 1 | 7 | 1 | 556 | 0 | 1 | 1 | 0.55 | 1 | 0.116 | 84.523 | |
1,052 | swe_bench_verified::test::167 | swe_bench_verified | test | 167 | django__django-14765 | django/django | django/django | python | 4e8121e8e42a24acc3565851c9ef50ca8322b15c | ProjectState.__init__() can assume its real_apps argument is a set
Description
PR #14760 made all calls to ProjectState.__init__() pass real_apps as a set. In ProjectState.__init__() now, then, instead of checking that real_apps is a set and converting it to a set if not, it can just assert that it's a set when non-... | Hey Chris. I'm a bit Meh about the suggestion here but I'll accept so you can make the PR for review. (If the others like it...) ...part of Django's internal API I'm forever amazed what parts of Django folks out there are using. Perhaps not this. :) Thanks. | diff --git a/django/db/migrations/state.py b/django/db/migrations/state.py
--- a/django/db/migrations/state.py
+++ b/django/db/migrations/state.py
@@ -91,10 +91,11 @@ class ProjectState:
def __init__(self, models=None, real_apps=None):
self.models = models or {}
# Apps to include from main regist... | diff --git a/tests/migrations/test_state.py b/tests/migrations/test_state.py
--- a/tests/migrations/test_state.py
+++ b/tests/migrations/test_state.py
@@ -924,6 +924,10 @@ class Meta:
1,
)
+ def test_real_apps_non_set(self):
+ with self.assertRaises(AssertionError):
+ Projec... | ["test_real_apps_non_set (migrations.test_state.StateTests)"] | ["test_abstract_model_children_inherit_indexes (migrations.test_state.ModelStateTests)", "test_bound_field_sanity_check (migrations.test_state.ModelStateTests)", "Tests making a ProjectState from an Apps with a swappable model", "A swappable model inheriting from a hierarchy:", "Tests making a ProjectState from unused ... | null | true | 2021-08-12T05:59:11Z | 1 | 7 | 1 | 556 | 0 | 1 | 1 | 0.55 | 1 | 0.116 | 84.523 | |
1,053 | swe_bench_verified::test::216 | swe_bench_verified | test | 216 | django__django-16100 | django/django | django/django | python | c6350d594c359151ee17b0c4f354bb44f28ff69e | Add transaction handling to Changelist list_editable processing.
Description
It seems that changelist_view in Django admin is missing a transaction. Since the view may change data in database, it should be wrapped in a transaction to prevent unexpected states in case of errors. | So, this has never been wrapped in a transaction. See https://github.com/django/django/commit/7bc0878922 where it was added. Happy to accept as a New Feature to investigate adding that. (I can't immediately see any obvious blockers.) | diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
--- a/django/contrib/admin/options.py
+++ b/django/contrib/admin/options.py
@@ -2011,15 +2011,17 @@ def changelist_view(self, request, extra_context=None):
)
if formset.is_valid():
changecount = 0
-... | diff --git a/tests/admin_changelist/tests.py b/tests/admin_changelist/tests.py
--- a/tests/admin_changelist/tests.py
+++ b/tests/admin_changelist/tests.py
@@ -1,4 +1,5 @@
import datetime
+from unittest import mock
from django.contrib import admin
from django.contrib.admin.models import LogEntry
@@ -16,12 +17,12 @@... | ["test_list_editable_atomicity (admin_changelist.tests.ChangeListTests)"] | ["{% get_admin_log %} works if the user model's primary key isn't named", "test_missing_args (admin_changelist.tests.GetAdminLogTests)", "{% get_admin_log %} works without specifying a user.", "test_non_integer_limit (admin_changelist.tests.GetAdminLogTests)", "test_without_as (admin_changelist.tests.GetAdminLogTests)"... | null | true | 2022-09-24T13:32:02Z | 1 | 20 | 1 | 279 | 0 | 1 | 1 | 0.55 | 1 | 0.113167 | 84.5145 | |
1,054 | swe_bench_verified::test::466 | swe_bench_verified | test | 466 | sympy__sympy-18698 | sympy/sympy | sympy/sympy | python | 3dff1b98a78f28c953ae2140b69356b8391e399c | sqf and sqf_list output is not consistant
The example below is wrong in the sense that we should have (x*_2 - 5_x + 6, 3) and not 2 factors of multiplicity 3.
```
> sqf_list( (x**2 + 1) * (x - 1)**2 * (x - 2)**3 * (x - 3)**3 )
> (1, [(x**2 + 1, 1), (x - 1, 2), (x - 3, 3), (x - 2, 3)])
```
whereas below is corre... | I guess correct can be either the first or the second. But we should stick to it.
This [SO post](https://stackoverflow.com/questions/57536689/sympys-sqf-and-sqf-list-give-different-results-once-i-use-poly-or-as-pol) highlights another problem, too:
```python
>>> v = (x1 + 2) ** 2 * (x2 + 4) ** 5
>>> sqf(v)
(x1 +... | diff --git a/sympy/polys/polytools.py b/sympy/polys/polytools.py
--- a/sympy/polys/polytools.py
+++ b/sympy/polys/polytools.py
@@ -2,7 +2,8 @@
from __future__ import print_function, division
-from functools import wraps
+from functools import wraps, reduce
+from operator import mul
from sympy.core import (
... | diff --git a/sympy/polys/tests/test_polytools.py b/sympy/polys/tests/test_polytools.py
--- a/sympy/polys/tests/test_polytools.py
+++ b/sympy/polys/tests/test_polytools.py
@@ -3273,7 +3273,7 @@ def test_to_rational_coeffs():
def test_factor_terms():
# issue 7067
assert factor_list(x*(x + y)) == (1, [(x, 1), (... | ["test_factor_terms"] | ["test_Poly_mixed_operations", "test_Poly_from_dict", "test_Poly_from_list", "test_Poly_from_poly", "test_Poly_from_expr", "test_Poly__new__", "test_Poly__args", "test_Poly__gens", "test_Poly_zero", "test_Poly_one", "test_Poly__unify", "test_Poly_free_symbols", "test_PurePoly_free_symbols", "test_Poly__eq__", "test_Pur... | null | true | 2020-02-21T05:46:56Z | 1 | 11 | 1 | 456 | 0 | 1 | 1 | 0.55 | 1 | 0.112667 | 84.513 | |
1,055 | swe_bench_verified::test::175 | swe_bench_verified | test | 175 | django__django-15037 | django/django | django/django | python | dab48b7482295956973879d15bfd4d3bb0718772 | Foreign key to a specific field is not handled in inspectdb
Description
(last modified by Tim Graham)
if you have a DB like that
CREATE TABLE foo ( id serial primary key, other_id int UNIQUE);
CREATE TABLE bar (
id serial primary key, other_id int,
constraint myconst
FOREIGN KEY(other_id) references foo(other_id... | simple patch to handle FK to non pk field.
it seems I cannot reproduce outside of my own code...
I will check it! | diff --git a/django/core/management/commands/inspectdb.py b/django/core/management/commands/inspectdb.py
--- a/django/core/management/commands/inspectdb.py
+++ b/django/core/management/commands/inspectdb.py
@@ -116,13 +116,17 @@ def table2model(table_name):
extra_params['unique'] = True
... | diff --git a/tests/inspectdb/models.py b/tests/inspectdb/models.py
--- a/tests/inspectdb/models.py
+++ b/tests/inspectdb/models.py
@@ -21,6 +21,12 @@ class PeopleMoreData(models.Model):
license = models.CharField(max_length=255)
+class ForeignKeyToField(models.Model):
+ to_field_fk = models.ForeignKey(
+ ... | ["test_foreign_key_to_field (inspectdb.tests.InspectDBTestCase)"] | ["inspectdb --include-views creates models for database views.", "test_attribute_name_not_python_keyword (inspectdb.tests.InspectDBTestCase)", "test_char_field_db_collation (inspectdb.tests.InspectDBTestCase)", "Introspection of column names consist/start with digits (#16536/#17676)", "Test introspection of various Dja... | null | true | 2021-10-30T15:21:38Z | 1 | 8 | 1 | 496 | 0 | 1 | 1 | 0.55 | 1 | 0.109333 | 84.503 | |
1,056 | swe_gym::train::864 | swe_gym | train | 864 | iterative__dvc-4137 | iterative/dvc | iterative/dvc | python | c6a024f83ba2de2d6852222421f2bcad0618bb06 | azure: use ~/.azure/config
Today we recommend using local config for Azure: https://dvc.org/doc/command-reference/remote/add#supported-storage-types
This approach is not the best since users need to remember and reconfigure URL in addition to credentials.
We need to support a regular flow for Azure (the same as S3 and... | diff --git a/dvc/remote/azure.py b/dvc/remote/azure.py
--- a/dvc/remote/azure.py
+++ b/dvc/remote/azure.py
@@ -1,5 +1,4 @@
import logging
-import os
import threading
from datetime import datetime, timedelta
@@ -16,23 +15,38 @@
class AzureRemoteTree(BaseRemoteTree):
scheme = Schemes.AZURE
PATH_CLS = Clou... | diff --git a/tests/unit/remote/test_azure.py b/tests/unit/remote/test_azure.py
--- a/tests/unit/remote/test_azure.py
+++ b/tests/unit/remote/test_azure.py
@@ -20,7 +20,7 @@ def test_init_env_var(monkeypatch, dvc):
config = {"url": "azure://"}
tree = AzureRemoteTree(dvc, config)
assert tree.path_info == "... | ["tests/unit/remote/test_azure.py::test_init_env_var", "tests/unit/remote/test_azure.py::test_init"] | [] | null | true | 2020-06-30T08:29:48Z | 2 | 32 | 2 | 1,155 | 0 | 0.85 | 1 | 0.7 | 1 | 0.299167 | 84.4975 | ||
1,057 | swe_gym::train::1039 | swe_gym | train | 1,039 | dask__dask-10404 | dask/dask | dask/dask | python | 11f633d75a8b898d75fe76ade7133c5936c41fe0 | Utility function that verifies division boundaries
Advanced users occasionally set divisions themselves to encode knowledge they have about their data that dask doesn't. However, if these divisions are not set correctly, data loss and therefore incorrect results is a very likely outcome.
It should be trivial to implem... | diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -714,6 +714,43 @@ def clear_divisions(self):
divisions = (None,) * (self.npartitions + 1)
return type(self)(self.dask, self._name, self._meta, divisions)
+ def enforce_runtime... | diff --git a/dask/dataframe/tests/test_dataframe.py b/dask/dataframe/tests/test_dataframe.py
--- a/dask/dataframe/tests/test_dataframe.py
+++ b/dask/dataframe/tests/test_dataframe.py
@@ -6075,3 +6075,26 @@ def _table_to_cudf(obj, table, self_destruct=False):
assert type(df1) == type(df2)
assert_eq(df1, df2)... | ["dask/dataframe/tests/test_dataframe.py::test_enforce_runtime_divisions"] | ["dask/dataframe/tests/test_dataframe.py::test_repartition_npartitions[<lambda>1-float-2-5-False]", "dask/dataframe/tests/test_dataframe.py::test_repartition_npartitions[<lambda>1-M8[ns]-2-2-False]", "dask/dataframe/tests/test_dataframe.py::test_getitem_column_types[list]", "dask/dataframe/tests/test_dataframe.py::test... | null | true | 2023-07-11T18:25:22Z | 1 | 37 | 1 | 1,052 | 0 | 0.85 | 1 | 0.7 | 1 | 0.298667 | 84.496 | ||
1,058 | swe_gym::train::2276 | swe_gym | train | 2,276 | Project-MONAI__MONAI-1093 | Project-MONAI/MONAI | project-monai/monai | python | ca1f27f60a7f01d2b1dd9e581f81edcdf304fd2d | divide std in NormalizeIntensity, but std could be 0
**Describe the bug**
In monai/transforms/intensity/array.py,
img[slices] = (img[slices] - np.mean(img[slices])) / np.std(img[slices])
But the np.std(img[slices]) could be 0 in some cases.
This will cause NaN.
**To Reproduce**
Steps to reproduce the behavior:
Let th... | diff --git a/monai/transforms/intensity/array.py b/monai/transforms/intensity/array.py
--- a/monai/transforms/intensity/array.py
+++ b/monai/transforms/intensity/array.py
@@ -185,11 +185,11 @@ def __call__(self, img: np.ndarray) -> np.ndarray:
class NormalizeIntensity(Transform):
"""
- Normalize input based ... | diff --git a/tests/test_normalize_intensity.py b/tests/test_normalize_intensity.py
--- a/tests/test_normalize_intensity.py
+++ b/tests/test_normalize_intensity.py
@@ -17,16 +17,43 @@
from monai.transforms import NormalizeIntensity
from tests.utils import NumpyImageTestCase2D
-TEST_CASE_1 = [{"nonzero": True}, np.ar... | ["tests/test_normalize_intensity.py::TestNormalizeIntensity::test_nonzero_9", "tests/test_normalize_intensity.py::TestNormalizeIntensity::test_nonzero_8", "tests/test_normalize_intensity.py::TestNormalizeIntensity::test_nonzero_5", "tests/test_normalize_intensity.py::TestNormalizeIntensity::test_nonzero_4", "tests/test... | ["tests/test_normalize_intensity.py::TestNormalizeIntensity::test_default", "tests/test_normalize_intensity.py::TestNormalizeIntensity::test_nonzero_0", "tests/test_normalize_intensity.py::TestNormalizeIntensity::test_nonzero_2", "tests/test_normalize_intensity.py::TestNormalizeIntensity::test_nonzero_1", "tests/test_n... | null | true | 2020-10-07T12:58:26Z | 1 | 49 | 8 | 782 | 0 | 0.85 | 1 | 0.7 | 1 | 0.293667 | 84.481 | ||
1,059 | swe_bench_verified::test::344 | swe_bench_verified | test | 344 | pytest-dev__pytest-7490 | pytest-dev/pytest | pytest-dev/pytest | python | 7f7a36478abe7dd1fa993b115d22606aa0e35e88 | Pytest 6: Dynamically adding xfail marker in test no longer ignores failure
## Description
With pytest 5.x, we can dynamically add an xfail to a test `request` object using `request.node.add_marker(mark)` (see example below). In 5.x this treated the failing test like a a test marked statically with an `xfail`. With 6... | Thanks for testing the release candidate! This is probably a regression in c9737ae914891027da5f0bd39494dd51a3b3f19f, will fix. | diff --git a/src/_pytest/skipping.py b/src/_pytest/skipping.py
--- a/src/_pytest/skipping.py
+++ b/src/_pytest/skipping.py
@@ -231,17 +231,14 @@ def evaluate_xfail_marks(item: Item) -> Optional[Xfail]:
@hookimpl(tryfirst=True)
def pytest_runtest_setup(item: Item) -> None:
- item._store[skipped_by_mark_key] = Fal... | diff --git a/testing/test_skipping.py b/testing/test_skipping.py
--- a/testing/test_skipping.py
+++ b/testing/test_skipping.py
@@ -1,6 +1,7 @@
import sys
import pytest
+from _pytest.pytester import Testdir
from _pytest.runner import runtestprotocol
from _pytest.skipping import evaluate_skip_marks
from _pytest.sk... | ["testing/test_skipping.py::TestXFail::test_dynamic_xfail_set_during_runtest_failed", "testing/test_skipping.py::TestXFail::test_dynamic_xfail_set_during_runtest_passed_strict"] | ["testing/test_skipping.py::test_importorskip", "testing/test_skipping.py::TestEvaluation::test_no_marker", "testing/test_skipping.py::TestEvaluation::test_marked_xfail_no_args", "testing/test_skipping.py::TestEvaluation::test_marked_skipif_no_args", "testing/test_skipping.py::TestEvaluation::test_marked_one_arg", "tes... | null | true | 2020-07-13T22:20:10Z | 1 | 21 | 2 | 14,477 | 0 | 1 | 1 | 0.5 | 1 | 0.57 | 84.46 | |
1,060 | swe_gym::train::494 | swe_gym | train | 494 | python__mypy-9906 | python/mypy | python/mypy | python | e9edcb957f341dcf7a14bb7b7acfd4186fb1248b | TypedDict does not allow .get("missing_key", ...) to pass
**Bug Report**
MyPy does not allow `.get("key")` on a TypedDict if the key does not exist. This nullifies the usefulness of `.get`, and seems to be in direct contradiction to PEP 589:
"Operations with arbitrary str keys (instead of string literals or other exp... | diff --git a/mypy/plugins/default.py b/mypy/plugins/default.py
--- a/mypy/plugins/default.py
+++ b/mypy/plugins/default.py
@@ -237,8 +237,7 @@ def typed_dict_get_callback(ctx: MethodContext) -> Type:
for key in keys:
value_type = get_proper_type(ctx.type.items.get(key))
if value_type ... | diff --git a/test-data/unit/check-literal.test b/test-data/unit/check-literal.test
--- a/test-data/unit/check-literal.test
+++ b/test-data/unit/check-literal.test
@@ -2227,7 +2227,7 @@ d[c_key] # E: TypedDict "Outer" has no key 'c'
reveal_type(d.get(a_key, u)) # N: Revealed type is 'Union[built... | ["mypy/test/testcheck.py::TypeCheckSuite::testLiteralIntelligentIndexingTypedDictUnions", "mypy/test/testcheck.py::TypeCheckSuite::testPluginUnionsOfTypedDicts", "mypy/test/testcheck.py::TypeCheckSuite::testTypedDictGetMethodInvalidArgs", "mypy/test/testcheck.py::TypeCheckSuite::testLiteralIntelligentIndexingUsingFinal... | ["mypy/test/testtransform.py::TransformSuite::testImplicitGenericTypeArgs", "mypy/test/testtransform.py::TransformSuite::testGenericType2", "mypy/test/testfinegrained.py::FineGrainedSuite::testAsyncWith2", "mypy/test/testdeps.py::GetDependenciesSuite::testAliasDepsNormalFunc", "mypy/test/teststubgen.py::StubgenPythonSu... | null | true | 2021-01-12T23:33:11Z | 1 | 3 | 7 | 2,589 | 0 | 0.85 | 1 | 0.85 | 0.8 | 0.4415 | 84.4495 | ||
1,061 | swe_gym::train::466 | swe_gym | train | 466 | python__mypy-11822 | python/mypy | python/mypy | python | f96446ce2f99a86210b21d39c7aec4b13a8bfc66 | Overriding __bool__ in NamedTuple doesn't work
Even if `__bool__` is overridden in a subclass of `NamedTuple`, mypy thinks instances of this subclass can't evaluate to `False`.
This possibility was mentioned in https://github.com/python/mypy/issues/3601#issuecomment-311372136 before, but it appears this wasn't fixed.
... | diff --git a/mypy/types.py b/mypy/types.py
--- a/mypy/types.py
+++ b/mypy/types.py
@@ -1500,12 +1500,31 @@ class TupleType(ProperType):
def __init__(self, items: List[Type], fallback: Instance, line: int = -1,
column: int = -1, implicit: bool = False) -> None:
- super().__init__(line, co... | diff --git a/test-data/unit/check-namedtuple.test b/test-data/unit/check-namedtuple.test
--- a/test-data/unit/check-namedtuple.test
+++ b/test-data/unit/check-namedtuple.test
@@ -1081,3 +1081,42 @@ t: T
y: List[T] = [t]
[builtins fixtures/tuple.pyi]
[typing fixtures/typing-namedtuple.pyi]
+
+[case testNamedTupleWith... | ["mypy/test/testcheck.py::TypeCheckSuite::check-namedtuple.test::testNamedTupleWithBoolNarrowsToBool"] | [] | null | true | 2021-12-22T20:15:44Z | 1 | 27 | 1 | 1,128 | 0 | 0.85 | 1 | 0.7 | 1 | 0.278 | 84.434 | ||
1,062 | swe_gym::train::2295 | swe_gym | train | 2,295 | Project-MONAI__MONAI-4716 | Project-MONAI/MONAI | project-monai/monai | python | ec4c03115ba45b2e950103a24db22f16d54c8d40 | metatensor slicing should decollate applied operations
**Describe the bug**
```py
from monai.data import MetaTensor, list_data_collate
from monai.transforms import Resize
a = MetaTensor([[1.0, 2.0]])
a = Resize((1, 2))(a)
b = list_data_collate([a, a])
print(b[0]) # decollate, slicing
```
output:
```
tensor([[[1.5000,... | diff --git a/monai/data/meta_tensor.py b/monai/data/meta_tensor.py
--- a/monai/data/meta_tensor.py
+++ b/monai/data/meta_tensor.py
@@ -215,20 +215,13 @@ def update_meta(rets: Sequence, func, args, kwargs) -> Sequence:
# if using e.g., `batch[:, -1]` or `batch[..., -1]`, then the
... | diff --git a/tests/test_meta_tensor.py b/tests/test_meta_tensor.py
--- a/tests/test_meta_tensor.py
+++ b/tests/test_meta_tensor.py
@@ -365,6 +365,7 @@ def test_indexing(self):
# `is_batch==False`, should have first metadata and subset of first image.
d = data[0, 0]
self.check(d, ims[0][0], id... | ["tests/test_meta_tensor.py::TestMetaTensor::test_indexing"] | ["tests/test_meta_tensor.py::TestMetaTensor::test_construct_with_pre_applied_transforms", "tests/test_meta_tensor.py::TestMetaTensor::test_decollate_5", "tests/test_meta_tensor.py::TestMetaTensor::test_dataset_4", "tests/test_meta_tensor.py::TestMetaTensor::test_decollate_0", "tests/test_meta_tensor.py::TestMetaTensor:... | null | true | 2022-07-16T17:11:29Z | 1 | 34 | 1 | 982 | 0 | 0.85 | 1 | 0.7 | 1 | 0.277 | 84.431 | ||
1,063 | swe_gym::train::2284 | swe_gym | train | 2,284 | Project-MONAI__MONAI-4159 | Project-MONAI/MONAI | project-monai/monai | python | 8f5c9924df73f6f3dbb222d6a1263d71b7abd0cd | Checkpoint Export Functionality Should Require Bundle Directory Path Only
**Is your feature request related to a problem? Please describe.**
Currently to export a bundle as a Torchscript file one has to specify the files to include individually, eg:
```bash
python -m monai.bundle ckpt_export network_def \
--filepa... | diff --git a/monai/bundle/scripts.py b/monai/bundle/scripts.py
--- a/monai/bundle/scripts.py
+++ b/monai/bundle/scripts.py
@@ -28,6 +28,7 @@
from monai.data import load_net_with_metadata, save_net_with_metadata
from monai.networks import convert_to_torchscript, copy_model_state
from monai.utils import check_parent_d... | diff --git a/tests/test_bundle_ckpt_export.py b/tests/test_bundle_ckpt_export.py
--- a/tests/test_bundle_ckpt_export.py
+++ b/tests/test_bundle_ckpt_export.py
@@ -9,6 +9,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import json
import os
import subpro... | ["tests/test_bundle_ckpt_export.py::TestCKPTExport::test_export_1_model", "tests/test_bundle_ckpt_export.py::TestCKPTExport::test_export_0_"] | [] | null | true | 2022-04-22T04:24:14Z | 1 | 19 | 2 | 1,276 | 0 | 0.85 | 1 | 0.7 | 1 | 0.276 | 84.428 | ||
1,064 | swe_bench_verified::test::30 | swe_bench_verified | test | 30 | django__django-11095 | django/django | django/django | python | 7d49ad76562e8c0597a0eb66046ab423b12888d8 | add ModelAdmin.get_inlines() hook to allow set inlines based on the request or model instance.
Description
add ModelAdmin.get_inlines() hook to allow set inlines based on the request or model instance.
Currently, We can override the method get_inline_instances to do such a thing, but a for loop should be copied to my ... | Are you going to offer a patch to show exactly what you have in mind? I'm not immediately convinced that another hook is needed since the cost of duplicating a for loop is not that great.
If I want to realize a dynamic inlines based on the request or model instance. I need to override get_inline_instances to do it. Wha... | diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
--- a/django/contrib/admin/options.py
+++ b/django/contrib/admin/options.py
@@ -327,6 +327,10 @@ def get_fieldsets(self, request, obj=None):
return self.fieldsets
return [(None, {'fields': self.get_fields(request, obj)}... | diff --git a/tests/generic_inline_admin/tests.py b/tests/generic_inline_admin/tests.py
--- a/tests/generic_inline_admin/tests.py
+++ b/tests/generic_inline_admin/tests.py
@@ -429,3 +429,29 @@ class EpisodeAdmin(admin.ModelAdmin):
inlines = ma.get_inline_instances(request)
for (formset, inline), other_... | ["test_get_inline_instances_override_get_inlines (generic_inline_admin.tests.GenericInlineModelAdminTest)"] | ["test_no_deletion (generic_inline_admin.tests.NoInlineDeletionTest)", "test_custom_form_meta_exclude (generic_inline_admin.tests.GenericInlineModelAdminTest)", "test_custom_form_meta_exclude_with_readonly (generic_inline_admin.tests.GenericInlineModelAdminTest)", "test_get_fieldsets (generic_inline_admin.tests.Generic... | null | true | 2019-03-19T15:17:28Z | 1 | 6 | 1 | 379 | 0 | 1 | 1 | 0.55 | 1 | 0.083167 | 84.4245 | |
1,065 | swe_bench_verified::test::270 | swe_bench_verified | test | 270 | matplotlib__matplotlib-24570 | matplotlib/matplotlib | matplotlib/matplotlib | python | 8f0003ae902952372824c9917975fb372c026a42 | [Bug]: `align` in `HPacker` is reversed
### Bug summary
For the `align` parameter in `HPacker`, the options `top` and `bottom` seems reversed
### Code for reproduction
```python
import matplotlib.pyplot as plt
from matplotlib.offsetbox import DrawingArea, HPacker, VPacker, AnchoredOffsetbox, TextArea
from matplotlib... | This indeed seems incorrect, however, I'm not sure what the path to fixing it is even that it's likely been that way for quite a while and swapping back will break anyone who had corrected for the mistake.
I can't see that we use this internally, and it's obviously untested.
> This indeed seems incorrect, howeve... | diff --git a/lib/matplotlib/offsetbox.py b/lib/matplotlib/offsetbox.py
--- a/lib/matplotlib/offsetbox.py
+++ b/lib/matplotlib/offsetbox.py
@@ -166,10 +166,10 @@ def _get_aligned_offsets(hd_list, height, align="baseline"):
descent = max(d for h, d in hd_list)
height = height_descent + descent
... | diff --git a/lib/matplotlib/tests/test_offsetbox.py b/lib/matplotlib/tests/test_offsetbox.py
--- a/lib/matplotlib/tests/test_offsetbox.py
+++ b/lib/matplotlib/tests/test_offsetbox.py
@@ -13,7 +13,7 @@
from matplotlib.offsetbox import (
AnchoredOffsetbox, AnnotationBbox, AnchoredText, DrawingArea, OffsetBox,
- ... | ["lib/matplotlib/tests/test_offsetbox.py::test_packers[bottom]", "lib/matplotlib/tests/test_offsetbox.py::test_packers[top]"] | ["lib/matplotlib/tests/test_offsetbox.py::test_offsetbox_clipping[png]", "lib/matplotlib/tests/test_offsetbox.py::test_offsetbox_clipping[pdf]", "lib/matplotlib/tests/test_offsetbox.py::test_offsetbox_clip_children", "lib/matplotlib/tests/test_offsetbox.py::test_offsetbox_loc_codes", "lib/matplotlib/tests/test_offsetbo... | null | true | 2022-11-30T15:50:17Z | 1 | 4 | 2 | 1,329 | 0 | 1 | 1 | 0.7 | 0.8 | 0.234833 | 84.4045 | |
1,066 | swe_gym::train::2124 | swe_gym | train | 2,124 | Project-MONAI__MONAI-2010 | Project-MONAI/MONAI | project-monai/monai | python | 5cbcaf6ffecbabd26299ab371e280008c4708972 | Duplicated records of `RandSpatialCropSamplesd` in `key_transforms` in case of preceding transforms
**Describe the bug**
When using `RandSpatialCropSamplesd` in a transform chain in a dataset the record of transforms (`key_transforms`) of a single output patch differs depending on whether another transform has been ca... | Thanks for raising this, I'll look into it now. | diff --git a/monai/transforms/croppad/dictionary.py b/monai/transforms/croppad/dictionary.py
--- a/monai/transforms/croppad/dictionary.py
+++ b/monai/transforms/croppad/dictionary.py
@@ -543,8 +543,11 @@ def randomize(self, data: Optional[Any] = None) -> None:
def __call__(self, data: Mapping[Hashable, np.ndarra... | diff --git a/tests/test_rand_spatial_crop_samplesd.py b/tests/test_rand_spatial_crop_samplesd.py
--- a/tests/test_rand_spatial_crop_samplesd.py
+++ b/tests/test_rand_spatial_crop_samplesd.py
@@ -14,7 +14,7 @@
import numpy as np
from parameterized import parameterized
-from monai.transforms import RandSpatialCropSam... | ["tests/test_rand_spatial_crop_samplesd.py::TestRandSpatialCropSamplesd::test_deep_copy"] | ["tests/test_rand_spatial_crop_samplesd.py::TestRandSpatialCropSamplesd::test_shape_0", "tests/test_rand_spatial_crop_samplesd.py::TestRandSpatialCropSamplesd::test_shape_1"] | null | true | 2021-04-15T08:37:25Z | 1 | 5 | 1 | 3,638 | 0 | 0.85 | 1 | 0.77 | 0.8 | 0.516667 | 84.395 | |
1,067 | swe_bench_verified::test::127 | swe_bench_verified | test | 127 | django__django-13794 | django/django | django/django | python | fe886eee36be8022f34cfe59aa61ff1c21fe01d9 | add filter is unable to concatenate strings with lazy string
Description
If you try to concatenate a string with a lazy string with the add template filter, the result is always the empty string because the add filter generates an exception (TypeError: can only concatenate str (not "__proxy__") to str). | Tests.
Thanks. I attached a test. | diff --git a/django/utils/functional.py b/django/utils/functional.py
--- a/django/utils/functional.py
+++ b/django/utils/functional.py
@@ -176,6 +176,12 @@ def __mod__(self, rhs):
return str(self) % rhs
return self.__cast() % rhs
+ def __add__(self, other):
+ return sel... | diff --git a/tests/template_tests/filter_tests/test_add.py b/tests/template_tests/filter_tests/test_add.py
--- a/tests/template_tests/filter_tests/test_add.py
+++ b/tests/template_tests/filter_tests/test_add.py
@@ -2,6 +2,7 @@
from django.template.defaultfilters import add
from django.test import SimpleTestCase
+fr... | ["test_lazy_add (utils_tests.test_functional.FunctionalTests)", "test_add08 (template_tests.filter_tests.test_add.AddTests)", "test_add09 (template_tests.filter_tests.test_add.AddTests)"] | ["test_add (template_tests.filter_tests.test_add.FunctionTests)", "cached_property caches its value and behaves like a property.", "test_cached_property_auto_name (utils_tests.test_functional.FunctionalTests)", "Disallow this case because the decorated function wouldn't be cached.", "test_cached_property_reuse_same_nam... | null | true | 2020-12-19T20:09:34Z | 1 | 6 | 3 | 305 | 0 | 1 | 1 | 0.55 | 1 | 0.070833 | 84.3875 | |
1,068 | swe_gym::train::214 | swe_gym | train | 214 | getmoto__moto-5919 | getmoto/moto | getmoto/moto | python | c6c0e50ee9415df4aab76d799978721771b87afd | errors around update_item() when using SET and increment
Hi,
I've been working with moto on the dynamodb client and I'm noticing an issue where I'm getting errors around the update_item() function while using SET with an increment where I'm getting the following error:
> botocore.exceptions.ClientError: An error occu... | Hi @jlewis92! Thanks for raising this. Moto seems to think that `SomeColumn` is a range key, so the validation error is us complaining that the `update_item`-operation is not providing that key. Marking it as a bug. | diff --git a/moto/dynamodb/models/table.py b/moto/dynamodb/models/table.py
--- a/moto/dynamodb/models/table.py
+++ b/moto/dynamodb/models/table.py
@@ -251,7 +251,7 @@ def __init__(
if elem["KeyType"] == "HASH":
self.hash_key_attr = elem["AttributeName"]
self.hash_key_type ... | diff --git a/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py b/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py
--- a/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py
+++ b/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py
@@ -707,7 +707,7 @@ def test_batch_put_item_with_empty_va... | ["tests/test_dynamodb/test_dynamodb_create_table.py::test_create_table__specify_non_key_column"] | ["tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py::test_query_gsi_with_wrong_key_attribute_names_throws_exception", "tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py::test_update_primary_key", "tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py::test_creating_table_with_0_local_indexes", "t... | null | true | 2023-02-10 22:05:32 | 1 | 4 | 1 | 3,180 | 0 | 0.85 | 1 | 0.77 | 0.8 | 0.513333 | 84.385 | |
1,069 | swe_gym::train::684 | swe_gym | train | 684 | iterative__dvc-5822 | iterative/dvc | iterative/dvc | python | 31439754377d829da6babffcc720dd696554d8ab | dvc.api.open: fails when using a local repo and any revision
# Bug Report
## Description
After upgrading to `dvc 2.0` my old code that worked fine for `dvc 1.x.x` started raising exceptions. And the reason for that is `dvc.api.open`. If I try to open any file from my local repo (you also need to provide a revision), ... | We used to clone the repo if `rev` was provided before, nowadays we don't do that (and hope `scm` copes with that), but we don't properly initialize them.
The easy fix might be to rollback to that behaviour, or fix this initialization process.
Another user running into this https://discordapp.com/channels/4855868841... | diff --git a/dvc/repo/__init__.py b/dvc/repo/__init__.py
--- a/dvc/repo/__init__.py
+++ b/dvc/repo/__init__.py
@@ -141,6 +141,7 @@ def __init__(
from dvc.repo.params import Params
from dvc.repo.plots import Plots
from dvc.repo.stage import StageLoad
+ from dvc.scm import SCM
f... | diff --git a/tests/func/test_api.py b/tests/func/test_api.py
--- a/tests/func/test_api.py
+++ b/tests/func/test_api.py
@@ -182,6 +182,15 @@ def test_open_not_cached(dvc):
api.read(metric_file)
+def test_open_rev(tmp_dir, scm, dvc):
+ tmp_dir.scm_gen("foo", "foo", commit="foo")
+
+ (tmp_dir / "foo").w... | ["tests/func/test_api.py::test_open_rev"] | ["tests/func/test_api.py::test_open_scm_controlled"] | null | true | 2021-04-15T14:16:49Z | 1 | 4 | 1 | 3,571 | 0 | 0.85 | 1 | 0.77 | 0.8 | 0.513333 | 84.385 | |
1,070 | swe_gym::train::615 | swe_gym | train | 615 | conan-io__conan-9431 | conan-io/conan | conan-io/conan | python | 629813b1a1c791022ee1b5e1a18b51fb110f4098 | can't use c++17 with gcc 5
installing with `compiler.cppstd=17 compiler=gcc compiler.version=5` fails even though GCC 5 supports c++17.
This is because the checks in https://github.com/conan-io/conan/blob/fb5004d5f5fbfbb097cd03a7a6c2b85c282beefc/conans/client/build/cppstd_flags.py#L256 are done with minor versions and... | This is probably disabled because not all features of C++17 are supported until GCC7.
https://en.cppreference.com/w/cpp/compiler_support#cpp17
but it's enabled with 5.1
On Thu, 12 Aug 2021, 21:10 Arie Miller, ***@***.***> wrote:
> This is probably disabled because not all features of C++17 are supported
> until GC... | diff --git a/conan/tools/_compilers.py b/conan/tools/_compilers.py
--- a/conan/tools/_compilers.py
+++ b/conan/tools/_compilers.py
@@ -302,7 +302,7 @@ def _cppstd_gcc(gcc_version, cppstd):
v14 = "c++1y"
vgnu14 = "gnu++1y"
- if Version(gcc_version) >= "5.1":
+ if Version(gcc_version) >= "5":
... | diff --git a/conans/test/unittests/client/build/cpp_std_flags_test.py b/conans/test/unittests/client/build/cpp_std_flags_test.py
--- a/conans/test/unittests/client/build/cpp_std_flags_test.py
+++ b/conans/test/unittests/client/build/cpp_std_flags_test.py
@@ -52,7 +52,8 @@ def test_gcc_cppstd_flags(self):
self.... | ["conans/test/unittests/client/build/cpp_std_flags_test.py::CompilerFlagsTest::test_gcc_cppstd_flags"] | ["conans/test/unittests/client/build/cpp_std_flags_test.py::CompilerFlagsTest::test_visual_cppstd_defaults", "conans/test/unittests/client/build/cpp_std_flags_test.py::CompilerFlagsTest::test_mcst_lcc_cppstd_flag", "conans/test/unittests/client/build/cpp_std_flags_test.py::CompilerFlagsTest::test_intel_visual_cppstd_fl... | null | true | 2021-08-16T07:48:20Z | 2 | 4 | 1 | 3,597 | 0 | 0.85 | 1 | 0.77 | 0.8 | 0.513333 | 84.385 | |
1,071 | swe_gym::train::2072 | swe_gym | train | 2,072 | Project-MONAI__MONAI-5980 | Project-MONAI/MONAI | project-monai/monai | python | de2b48c7a772c1171fb9acc7ff72addc469558a8 | ResampleToMatch shouldn't always require `FILENAME_OR_OBJ`
**Describe the bug**
https://github.com/Project-MONAI/MONAI/blob/86c7ecdc1225529a379e2cd58c23fe53aa79b0d0/monai/transforms/spatial/array.py#L353
this metadata update was too restrictive:
```
File ~/Software/anaconda3/envs/monai/lib/python3.9/site-packages/mona... | diff --git a/monai/data/folder_layout.py b/monai/data/folder_layout.py
--- a/monai/data/folder_layout.py
+++ b/monai/data/folder_layout.py
@@ -21,7 +21,11 @@
def default_name_formatter(metadict, saver):
"""Returns a kwargs dict for :py:meth:`FolderLayout.filename`,
according to the input metadata and SaveIma... | diff --git a/tests/test_resample_to_match.py b/tests/test_resample_to_match.py
--- a/tests/test_resample_to_match.py
+++ b/tests/test_resample_to_match.py
@@ -21,11 +21,13 @@
import nibabel as nib
import numpy as np
+import torch
from parameterized import parameterized
+from monai.data import MetaTensor
from mo... | ["tests/test_resample_to_match.py::TestResampleToMatch::test_no_name"] | ["tests/test_resample_to_match.py::TestResampleToMatch::test_correct_3", "tests/test_resample_to_match.py::testing_data_config", "tests/test_resample_to_match.py::TestResampleToMatch::test_correct_0", "tests/test_resample_to_match.py::TestResampleToMatch::test_correct_2", "tests/test_resample_to_match.py::TestResampleT... | null | true | 2023-02-11T16:07:14Z | 2 | 8 | 1 | 1,409 | 0 | 0.85 | 1 | 0.7 | 1 | 0.2615 | 84.3845 | ||
1,072 | swe_gym::train::2115 | swe_gym | train | 2,115 | Project-MONAI__MONAI-6405 | Project-MONAI/MONAI | project-monai/monai | python | 79723cace5dbf3a7e9db55997e51629d08bed0ed | inverse lazily applied cropforeground with k_divisible>1
**Describe the bug**
```py
import torch
import monai.transforms as t
from monai.transforms.lazy.functional import apply_transforms
img = torch.tensor([[[0, 0, 0, 0, 0], [0, 1, 2, 1, 0], [0, 2, 3, 2, 0], [0, 1, 2, 1, 0], [0, 0, 0, 0, 0]]])
kwargs = {"select_fn":... | diff --git a/monai/transforms/compose.py b/monai/transforms/compose.py
--- a/monai/transforms/compose.py
+++ b/monai/transforms/compose.py
@@ -374,7 +374,7 @@ def randomize(self, data: Any | None = None) -> None:
except TypeError as type_error:
tfm_name: str = type(_transform).__name__
... | diff --git a/tests/croppers.py b/tests/croppers.py
--- a/tests/croppers.py
+++ b/tests/croppers.py
@@ -127,6 +127,11 @@ def crop_test_pending_ops(self, input_param, input_shape, align_corners=False):
result = apply_transforms(pending_result, mode="nearest", align_corners=align_corners)[0]
# compare
... | ["tests/test_crop_foreground.py::TestCropForeground::test_inverse_pending_ops_10", "tests/test_crop_foreground.py::TestCropForeground::test_inverse_pending_ops_03", "tests/test_crop_foreground.py::TestCropForeground::test_inverse_pending_ops_16", "tests/test_crop_foreground.py::TestCropForeground::test_inverse_pending_... | ["tests/test_crop_foreground.py::TestCropForeground::test_pending_ops_00", "tests/test_resample_to_match.py::TestResampleToMatch::test_correct_3", "tests/test_crop_foreground.py::TestCropForeground::test_value_19", "tests/test_crop_foreground.py::TestCropForeground::test_value_07", "tests/test_crop_foreground.py::TestC... | null | true | 2023-04-20T13:37:24Z | 3 | 36 | 21 | 830 | 0 | 0.85 | 1 | 0.7 | 1 | 0.258333 | 84.375 | ||
1,073 | swe_gym::train::43 | swe_gym | train | 43 | getmoto__moto-7105 | getmoto/moto | getmoto/moto | python | 85156f59396a85e83e83200c9df41b66d6f82b68 | moto batch - "RuntimeError: cannot join thread before it is started"
Hey,
**after upgrading from moto 4.0.11 to 4.2.11** i am facing the following issue with my previously running pytest. The first test is successfull, the second test, essentially doing the same but with different input, fails.
This is the **tracebac... | Hi @tzven0, can you share a reproducible test case?
Hey, it might take some time, but i think i can.
@tzven0 I've found one error scenario where the `submit_job` operation is called with the `arrayProperties` argument, but the test case does not wait for the execution of the job to finish.
```
def test_submit_job_a... | diff --git a/moto/batch/models.py b/moto/batch/models.py
--- a/moto/batch/models.py
+++ b/moto/batch/models.py
@@ -1055,7 +1055,8 @@ def reset(self) -> None:
if job.status not in (JobStatus.FAILED, JobStatus.SUCCEEDED):
job.stop = True
# Try to join
- job.jo... | diff --git a/tests/test_batch/test_batch_jobs.py b/tests/test_batch/test_batch_jobs.py
--- a/tests/test_batch/test_batch_jobs.py
+++ b/tests/test_batch/test_batch_jobs.py
@@ -1,15 +1,16 @@
import datetime
import time
+from unittest import SkipTest
from uuid import uuid4
import botocore.exceptions
import pytest
... | ["tests/test_batch/test_batch_jobs.py::test_submit_job_with_timeout_set_at_definition", "tests/test_batch/test_batch_jobs.py::test_submit_job_with_timeout", "tests/test_batch/test_batch_jobs.py::test_register_job_definition_with_timeout", "tests/test_batch/test_batch_jobs.py::test_cancel_job_empty_argument_strings", "t... | ["tests/test_batch/test_batch_jobs.py::test_submit_job_by_name"] | null | true | 2023-12-09 23:39:02 | 1 | 3 | 11 | 4,167 | 0 | 0.85 | 1 | 0.77 | 0.8 | 0.51 | 84.375 | |
1,074 | swe_gym::train::162 | swe_gym | train | 162 | getmoto__moto-6208 | getmoto/moto | getmoto/moto | python | 90d67db6eae20ccde57356b694e013fd5864d14a | AssertionError with SES Templates containing {
Reproduction of Issue
run moto_server
Test Template (testTemplate.json):
`{
"Template": {
"TemplateName": "Test",
"SubjectPart": "Test",
"HtmlPart": "This is a { Test } {{test}}",
"TextPart": "This is a { Test } {{test}}"
}
}`
aws ... ses create-temp... | Thanks for raising this @jritchie-nullable - marking it as a bug! | diff --git a/moto/ses/template.py b/moto/ses/template.py
--- a/moto/ses/template.py
+++ b/moto/ses/template.py
@@ -10,7 +10,8 @@ def parse_template(template, template_data, tokenizer=None, until=None):
for char in tokenizer:
if until is not None and (char + tokenizer.peek(len(until) - 1)) == until:
... | diff --git a/tests/test_ses/test_templating.py b/tests/test_ses/test_templating.py
--- a/tests/test_ses/test_templating.py
+++ b/tests/test_ses/test_templating.py
@@ -24,3 +24,10 @@ def test_template_with_multiple_foreach():
"l2": [{"o1": "ob1", "o2": "ob2"}, {"o1": "oc1", "o2": "oc2"}],
}
parse_temp... | ["tests/test_ses/test_templating.py::test_template_with_single_curly_brace"] | ["tests/test_ses/test_templating.py::test_template_with_simple_arg", "tests/test_ses/test_templating.py::test_template_with_multiple_foreach", "tests/test_ses/test_templating.py::test_template_without_args", "tests/test_ses/test_templating.py::test_template_with_foreach"] | null | true | 2023-04-13 10:34:24 | 1 | 3 | 1 | 4,231 | 0 | 0.85 | 1 | 0.77 | 0.8 | 0.51 | 84.375 | |
1,075 | swe_gym::train::475 | swe_gym | train | 475 | python__mypy-15920 | python/mypy | python/mypy | python | 2c1fd97986064161c542956bb3d9d5043dc0a480 | false positive: `functools.lru_cache()` breaks `assert_type(..., SomeEnum)`
**Bug Report**
Interactions between `@functools.lru_cache` and `Enum`s confuse `assert_type()`, resulting in a false positives.
Return values from functions which are decorated by `functools.lru_cache()` and have return type `SomeEnum` are tr... | @JelleZijlstra, are you sure this one's a typeshed issue? It looks like mypy's revealing the correct type with the `reveal_type()` calls, but is then giving a different answer when you try to assert that type using `assert_type()`. That sounds like a mypy issue to me
I minimized it a bit:
```python
from __future__ ... | diff --git a/mypy/checkexpr.py b/mypy/checkexpr.py
--- a/mypy/checkexpr.py
+++ b/mypy/checkexpr.py
@@ -4271,6 +4271,9 @@ def visit_assert_type_expr(self, expr: AssertTypeExpr) -> Type:
allow_none_return=True,
always_allow_any=True,
)
+ if self.chk.current_node_deferred:
+ ... | diff --git a/test-data/unit/check-expressions.test b/test-data/unit/check-expressions.test
--- a/test-data/unit/check-expressions.test
+++ b/test-data/unit/check-expressions.test
@@ -1045,6 +1045,23 @@ def reduce_it(s: Scalar) -> Scalar:
assert_type(reduce_it(True), Scalar)
[builtins fixtures/tuple.pyi]
+[case test... | ["mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testAssertTypeWithDeferredNodes"] | [] | null | true | 2023-08-21T11:21:24Z | 1 | 3 | 1 | 5,601 | 0 | 0.85 | 1 | 0.77 | 0.8 | 0.51 | 84.375 | |
1,076 | swe_gym::train::266 | swe_gym | train | 266 | getmoto__moto-6743 | getmoto/moto | getmoto/moto | python | d3f5e3d68b0517be1172319087ee68c0834a157a | Allow using s3 accesspoint arns in iam policies
[S3 Accesspoints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) have arns which look like this:
```
"Resource": "arn:aws:s3:us-west-2:123456789012:accesspoint/my-access-point"
```
and
```
"Resource" : "arn:aws:s3:us-west-... | diff --git a/moto/iam/policy_validation.py b/moto/iam/policy_validation.py
--- a/moto/iam/policy_validation.py
+++ b/moto/iam/policy_validation.py
@@ -56,11 +56,17 @@
VALID_CONDITION_POSTFIXES = ["IfExists"]
-SERVICE_TYPE_REGION_INFORMATION_ERROR_ASSOCIATIONS = {
- "iam": "IAM resource {resource} cannot contain... | diff --git a/tests/test_iam/test_iam_policies.py b/tests/test_iam/test_iam_policies.py
--- a/tests/test_iam/test_iam_policies.py
+++ b/tests/test_iam/test_iam_policies.py
@@ -1607,6 +1607,20 @@
},
],
},
+ {
+ "Version": "2012-10-17",
+ "Statement": [
+ {
+ ... | ["tests/test_iam/test_iam_policies.py::test_create_policy_with_valid_policy_document[valid_policy_document50]"] | ["tests/test_iam/test_iam_policies.py::test_create_policy_with_valid_policy_document[valid_policy_document47]", "tests/test_iam/test_iam_policies.py::test_create_policy_with_invalid_policy_document[invalid_policy_document45]", "tests/test_iam/test_iam_policies.py::test_create_policy_with_invalid_policy_document[invalid... | null | true | 2023-08-31 08:14:21 | 1 | 44 | 1 | 656 | 0 | 0.85 | 1 | 0.7 | 1 | 0.256 | 84.368 | ||
1,077 | swe_gym::train::868 | swe_gym | train | 868 | iterative__dvc-3628 | iterative/dvc | iterative/dvc | python | 8455b7bece300d93a4f50e130f83b1c4ec373efa | remote modify: validate config options before saving
**Version:**
```
DVC version: 0.91.1+51fe83
Python version: 3.7.7
Platform: Darwin-18.2.0-x86_64-i386-64bit
Binary: False
Package: None
Supported remotes: azure, gdrive, gs, hdfs, http, https, s3, ssh, oss
Cache: reflink - supported, hardlink - supported, symlink - ... | diff --git a/dvc/config.py b/dvc/config.py
--- a/dvc/config.py
+++ b/dvc/config.py
@@ -278,10 +278,7 @@ def load(self, validate=True):
Raises:
ConfigError: thrown if config has an invalid format.
"""
- conf = {}
- for level in self.LEVELS:
- if level in self.files... | diff --git a/tests/func/test_config.py b/tests/func/test_config.py
--- a/tests/func/test_config.py
+++ b/tests/func/test_config.py
@@ -94,6 +94,12 @@ def test_merging_two_levels(dvc):
with dvc.config.edit() as conf:
conf["remote"]["test"] = {"url": "ssh://example.com"}
+ with pytest.raises(
+ ... | ["tests/func/test_remote.py::TestRemote::test_relative_path", "tests/func/test_remote.py::TestRemoteDefault::test", "tests/func/test_config.py::test_config_loads_without_error_for_non_dvc_repo", "tests/func/test_remote.py::TestRemote::test_referencing_other_remotes", "tests/func/test_remote.py::TestRemote::test_overwri... | ["tests/func/test_config.py::TestConfigCLI::test_non_existing", "tests/func/test_config.py::TestConfigCLI::test", "tests/func/test_config.py::TestConfigCLI::test_root", "tests/func/test_config.py::TestConfigCLI::test_local", "tests/func/test_config.py::test_set_invalid_key"] | null | true | 2020-04-12T13:37:49Z | 1 | 19 | 8 | 1,120 | 0 | 0.85 | 1 | 0.7 | 1 | 0.25 | 84.35 | ||
1,078 | swe_bench_verified::test::202 | swe_bench_verified | test | 202 | django__django-15695 | django/django | django/django | python | 647480166bfe7532e8c471fef0146e3a17e6c0c9 | RenameIndex() crashes when unnamed index is moving backward and forward.
Description
RenameIndex() should restore the old auto-generated name when an unnamed index for unique_together is moving backward. Now re-applying RenameIndex() crashes. For example:
tests/migrations/test_operations.py
diff --git a/tests/migratio... | I understand the issue that arises when one reverses a RenameIndex, but it was made "on purpose" somehow. In https://code.djangoproject.com/ticket/27064, For backwards operations with unnamed old indexes, RenameIndex is a noop. From my understanding, when an unnamed index becomes "named", the idea was that it remained ... | diff --git a/django/db/migrations/operations/models.py b/django/db/migrations/operations/models.py
--- a/django/db/migrations/operations/models.py
+++ b/django/db/migrations/operations/models.py
@@ -960,6 +960,9 @@ def database_forwards(self, app_label, schema_editor, from_state, to_state):
else:
... | diff --git a/tests/migrations/test_operations.py b/tests/migrations/test_operations.py
--- a/tests/migrations/test_operations.py
+++ b/tests/migrations/test_operations.py
@@ -2988,6 +2988,11 @@ def test_rename_index_unnamed_index(self):
with connection.schema_editor() as editor, self.assertNumQueries(0):
... | ["test_rename_index_unnamed_index (migrations.test_operations.OperationTests)"] | ["test_reference_field_by_through_fields (migrations.test_operations.FieldOperationTests)", "test_references_field_by_from_fields (migrations.test_operations.FieldOperationTests)", "test_references_field_by_name (migrations.test_operations.FieldOperationTests)", "test_references_field_by_remote_field_model (migrations.... | null | true | 2022-05-16T07:58:51Z | 1 | 3 | 1 | 1,236 | 0 | 1 | 1 | 0.7 | 0.8 | 0.216 | 84.348 | |
1,079 | swe_bench_verified::test::151 | swe_bench_verified | test | 151 | django__django-14351 | django/django | django/django | python | 06fd4df41afb5aa1d681b853c3c08d8c688ca3a5 | Q object __or__ appears to get all dunder related's default columns and queryset raises ProgrammingError.
Description
There appears to be a difference in how Q object aliases are setup, when OR'd. The get_default_columns for this agent__property_groups__id__in only uses 1, where as get_default_columns for this agent__... | Thanks for the report. Can you provide a sample project? (models definition and a complete queryset). I cannot reproduce this issue with provided details.
Replying to Mariusz Felisiak: Thanks for the report. Can you provide a sample project? (models definition and a complete queryset). I cannot reproduce this issue wit... | diff --git a/django/db/models/lookups.py b/django/db/models/lookups.py
--- a/django/db/models/lookups.py
+++ b/django/db/models/lookups.py
@@ -406,6 +406,15 @@ def process_rhs(self, compiler, connection):
self.rhs.add_fields(['pk'])
return super().process_rhs(compiler, connection)
+ d... | diff --git a/tests/aggregation_regress/tests.py b/tests/aggregation_regress/tests.py
--- a/tests/aggregation_regress/tests.py
+++ b/tests/aggregation_regress/tests.py
@@ -1525,6 +1525,14 @@ class DistinctAggregate(Aggregate):
allow_distinct = True
DistinctAggregate('foo', distinct=True)
+ @sk... | ["test_having_subquery_select (aggregation_regress.tests.AggregationTests)"] | ["test_ticket_24748 (aggregation_regress.tests.SelfReferentialFKTests)", "test_existing_join_not_promoted (aggregation_regress.tests.JoinPromotionTests)", "test_non_nullable_fk_not_promoted (aggregation_regress.tests.JoinPromotionTests)", "test_ticket_21150 (aggregation_regress.tests.JoinPromotionTests)", "test_aggrega... | null | true | 2021-05-05T03:50:44Z | 1 | 9 | 1 | 8,513 | 0 | 1 | 1 | 0.5 | 1 | 0.53 | 84.34 | |
1,080 | swe_bench_verified::test::203 | swe_bench_verified | test | 203 | django__django-15731 | django/django | django/django | python | 93cedc82f29076c824d476354527af1150888e4f | inspect.signature() returns incorrect signature on manager methods.
Description
(last modified by Shiva Kumar)
inspect.signature returns incorrect signature information when used on queryset methods
import inspect
from django.db import models
class Person(models.Model):
name = models.CharField(max_length=100)
prin... | Tentatively accepted.
PR: https://github.com/django/django/pull/15731 | diff --git a/django/db/models/manager.py b/django/db/models/manager.py
--- a/django/db/models/manager.py
+++ b/django/db/models/manager.py
@@ -1,5 +1,6 @@
import copy
import inspect
+from functools import wraps
from importlib import import_module
from django.db import router
@@ -81,11 +82,10 @@ def check(self, **... | diff --git a/tests/basic/tests.py b/tests/basic/tests.py
--- a/tests/basic/tests.py
+++ b/tests/basic/tests.py
@@ -1,3 +1,4 @@
+import inspect
import threading
from datetime import datetime, timedelta
from unittest import mock
@@ -736,6 +737,17 @@ def test_manager_methods(self):
sorted(self.QUERYSET_PRO... | ["test_manager_method_signature (basic.tests.ManagerTest)"] | ["test_autofields_generate_different_values_for_each_instance (basic.tests.ModelInstanceCreationTests)", "test_can_create_instance_using_kwargs (basic.tests.ModelInstanceCreationTests)", "You can initialize a model instance using positional arguments,", "You can leave off the value for an AutoField when creating an", "... | null | true | 2022-05-24T12:30:05Z | 1 | 4 | 1 | 1,173 | 0 | 1 | 1 | 0.7 | 0.8 | 0.208833 | 84.3265 | |
1,081 | swe_gym::train::1036 | swe_gym | train | 1,036 | dask__dask-10128 | dask/dask | dask/dask | python | 09dbeebbc1c8d5e40f7afc08258572ee897f36e9 | Since #10111 groupby numeric_only=False might not raise if a column name is `None`
**Describe the issue**:
#10111 avoids the deprecated `GroupBy.dtypes` properties by asking the `GroupBy.Grouper` for its `names`, which are taken as the set of columns that are being grouped on. Unfortunately, this is only non-ambiguous... | diff --git a/dask/dataframe/groupby.py b/dask/dataframe/groupby.py
--- a/dask/dataframe/groupby.py
+++ b/dask/dataframe/groupby.py
@@ -2860,10 +2860,9 @@ def __getattr__(self, key):
def _all_numeric(self):
"""Are all columns that we're not grouping on numeric?"""
numerics = self.obj._meta._get_nu... | diff --git a/dask/dataframe/tests/test_groupby.py b/dask/dataframe/tests/test_groupby.py
--- a/dask/dataframe/tests/test_groupby.py
+++ b/dask/dataframe/tests/test_groupby.py
@@ -3267,6 +3267,14 @@ def agg(grp, **kwargs):
)
+@pytest.mark.skipif(not PANDAS_GT_150, reason="requires pandas >= 1.5.0")
+def test_gr... | ["dask/dataframe/tests/test_groupby.py::test_groupby_numeric_only_None_column_name[disk]", "dask/dataframe/tests/test_groupby.py::test_groupby_numeric_only_None_column_name[tasks]"] | ["dask/dataframe/tests/test_groupby.py::test_groupby_aggregate_categorical_observed[std-disk-unobserved-cat_1-unordererd-unknown]", "dask/dataframe/tests/test_groupby.py::test_groupby_sort_argument[disk-True-count-c]", "dask/dataframe/tests/test_groupby.py::test_groupby_multilevel_getitem[std-tasks-<lambda>4]", "dask/d... | null | true | 2023-03-30T10:46:21Z | 1 | 7 | 2 | 1,310 | 0 | 0.85 | 1 | 0.7 | 1 | 0.241667 | 84.325 | ||
1,082 | swe_gym::train::303 | swe_gym | train | 303 | getmoto__moto-6585 | getmoto/moto | getmoto/moto | python | 6843eb4c86ee0abad140d02930af95050120a0ef | lambda get_function() returns config working directory in error
Thanks for the recent fix, but I've spotted another problem/corner case in moto 4.1.14.
In the case where a function's `ImageConfig` dict does not contain a working directory definition, it is not reported by `get_function()`. For example:
```
>>> import... | diff --git a/moto/awslambda/models.py b/moto/awslambda/models.py
--- a/moto/awslambda/models.py
+++ b/moto/awslambda/models.py
@@ -201,16 +201,16 @@ class ImageConfig:
def __init__(self, config: Dict[str, Any]) -> None:
self.cmd = config.get("Command", [])
self.entry_point = config.get("EntryPoin... | diff --git a/tests/test_awslambda/test_lambda.py b/tests/test_awslambda/test_lambda.py
--- a/tests/test_awslambda/test_lambda.py
+++ b/tests/test_awslambda/test_lambda.py
@@ -228,6 +228,37 @@ def test_create_function_from_image():
assert result["Configuration"]["ImageConfigResponse"]["ImageConfig"] == image_config... | ["tests/test_awslambda/test_lambda.py::test_create_function_from_image_default_working_directory"] | ["tests/test_awslambda/test_lambda.py::test_publish_version_unknown_function[bad_function_name]", "tests/test_awslambda/test_lambda.py::test_create_function_from_zipfile", "tests/test_awslambda/test_lambda.py::test_create_function_with_already_exists", "tests/test_awslambda/test_lambda.py::test_create_function_error_ep... | null | true | 2023-08-01 16:05:18 | 1 | 16 | 1 | 1,125 | 0 | 0.85 | 1 | 0.7 | 1 | 0.240833 | 84.3225 | ||
1,083 | swe_gym::train::574 | swe_gym | train | 574 | python__mypy-13728 | python/mypy | python/mypy | python | a3a5d73f7407f9565abcfd04689870e7c992f833 | Crash on function with structural pattern matching
**Crash Report**
Running mypy on the following source code results in the following crash with the following traceback.
**Traceback**
```
bug.py:7: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.... | diff --git a/mypy/treetransform.py b/mypy/treetransform.py
--- a/mypy/treetransform.py
+++ b/mypy/treetransform.py
@@ -49,6 +49,7 @@
LambdaExpr,
ListComprehension,
ListExpr,
+ MatchStmt,
MemberExpr,
MypyFile,
NamedTupleExpr,
@@ -90,6 +91,17 @@
YieldExpr,
YieldFromExpr,
)
+fro... | diff --git a/test-data/unit/check-python310.test b/test-data/unit/check-python310.test
--- a/test-data/unit/check-python310.test
+++ b/test-data/unit/check-python310.test
@@ -1695,3 +1695,18 @@ match input_arg:
case GenericDataclass(x=a):
reveal_type(a) # N: Revealed type is "builtins.str"
[builtins fix... | ["mypy/test/testcheck.py::TypeCheckSuite::check-python310.test::testMatchValueConstrainedTypeVar"] | [] | null | true | 2022-09-24T20:14:38Z | 1 | 64 | 1 | 19,200 | 0 | 0.85 | 1 | 0.65 | 1 | 0.713333 | 84.315 | ||
1,084 | swe_gym::train::1961 | swe_gym | train | 1,961 | Project-MONAI__MONAI-855 | Project-MONAI/MONAI | project-monai/monai | python | ba3d34d5c29dea5a0d19e524ee4176cebb992a71 | sliding_window_inference uses to much gpu memory if roi_size is small and images to infer large
**Describe the bug**
sliding_window_inference runns ot of memory if roi_size is small and images to infer large
**To Reproduce**
evaluete a highres3dnet with images larger than 512x512x256 and roi_size of the sliding_window... | diff --git a/monai/inferers/utils.py b/monai/inferers/utils.py
--- a/monai/inferers/utils.py
+++ b/monai/inferers/utils.py
@@ -9,7 +9,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from typing import Callable, Sequence, Tuple, Union
+from typing import C... | diff --git a/tests/test_integration_sliding_window.py b/tests/test_integration_sliding_window.py
--- a/tests/test_integration_sliding_window.py
+++ b/tests/test_integration_sliding_window.py
@@ -44,7 +44,7 @@ def _sliding_window_processor(_engine, batch):
net.eval()
img, seg, meta_data = batch
... | ["tests/test_integration_sliding_window.py::TestIntegrationSlidingWindow::test_training"] | ["tests/test_sliding_window_inference.py::TestSlidingWindowInference::test_sliding_window_default_0", "tests/test_sliding_window_inference.py::TestSlidingWindowInference::test_sliding_window_default_2", "tests/test_sliding_window_inference.py::TestSlidingWindowInference::test_sliding_window_default_4", "tests/test_slid... | null | true | 2020-08-05T15:35:27Z | 1 | 18 | 1 | 1,054 | 0 | 0.85 | 1 | 0.7 | 1 | 0.235667 | 84.307 | ||
1,085 | swe_bench_verified::test::328 | swe_bench_verified | test | 328 | pylint-dev__pylint-7277 | pylint-dev/pylint | pylint-dev/pylint | python | 684a1d6aa0a6791e20078bc524f97c8906332390 | `pylint` removes first item from `sys.path` when running from `runpy`.
### Bug description
This is the line where the first item from sys.path is removed.
https://github.com/PyCQA/pylint/blob/ce7cccf96454fb6e286e4a8f38919733a0f28f44/pylint/__init__.py#L99
I think there should be a check to ensure that the first item ... | This is a touchy part of the code (very hard to test). It probably make sense to do what you suggest but I don't understand this part of the code very well so I think some investigation/specification is required.
I think it makes sense to take this suggestion as it makes the implementation agree with the docstring. @ka... | diff --git a/pylint/__init__.py b/pylint/__init__.py
--- a/pylint/__init__.py
+++ b/pylint/__init__.py
@@ -96,9 +96,10 @@ def modify_sys_path() -> None:
if pylint is installed in an editable configuration (as the last item).
https://github.com/PyCQA/pylint/issues/4161
"""
- sys.path.pop(0)
- en... | diff --git a/tests/test_self.py b/tests/test_self.py
--- a/tests/test_self.py
+++ b/tests/test_self.py
@@ -759,6 +759,24 @@ def test_modify_sys_path() -> None:
modify_sys_path()
assert sys.path == paths[1:]
+ paths = ["", *default_paths]
+ sys.path = copy(paths)
+ ... | ["tests/test_self.py::TestRunTC::test_modify_sys_path"] | ["tests/test_self.py::TestRunTC::test_pkginfo", "tests/test_self.py::TestRunTC::test_all", "tests/test_self.py::TestRunTC::test_no_ext_file", "tests/test_self.py::TestRunTC::test_w0704_ignored", "tests/test_self.py::TestRunTC::test_exit_zero", "tests/test_self.py::TestRunTC::test_nonexistent_config_file", "tests/test_s... | null | true | 2022-08-08T23:07:49Z | 1 | 5 | 1 | 1,073 | 0 | 1 | 1 | 0.7 | 0.8 | 0.1955 | 84.2865 | |
1,086 | swe_gym::train::877 | swe_gym | train | 877 | iterative__dvc-3620 | iterative/dvc | iterative/dvc | python | e05157f8e05e856d2e9966c30a3150c26b32b86f | RemoteLOCAL.unprotect modifies cache permissions for symlinked files
**Please provide information about your setup**
dvc --version 0.91.1
The RemoteLOCAL.unprotect function for an output tries to replace the symlink with a copy of the data. First the cache file is copied to a tmp dir, then the link is removed, then th... | diff --git a/dvc/utils/fs.py b/dvc/utils/fs.py
--- a/dvc/utils/fs.py
+++ b/dvc/utils/fs.py
@@ -1,3 +1,4 @@
+import sys
import errno
import logging
import os
@@ -129,6 +130,13 @@ def _chmod(func, p, excinfo):
func(p)
+def _unlink(path, onerror):
+ try:
+ os.unlink(path)
+ except OSError:
+ ... | diff --git a/tests/func/test_unprotect.py b/tests/func/test_unprotect.py
--- a/tests/func/test_unprotect.py
+++ b/tests/func/test_unprotect.py
@@ -24,11 +24,14 @@ def test(self):
self.assertTrue(os.access(self.FOO, os.W_OK))
- # NOTE: cache is now unprotected, bceause we try to set write perms
- ... | ["tests/unit/remote/test_local.py::test_is_protected[symlink]", "tests/unit/remote/test_local.py::test_is_protected[hardlink]"] | ["tests/unit/remote/test_local.py::test_protect_ignore_errors[1]", "tests/unit/remote/test_local.py::test_status_download_optimization", "tests/unit/remote/test_local.py::test_protect_ignore_errors[13]", "tests/unit/remote/test_local.py::test_protect_ignore_erofs"] | null | true | 2020-04-10T19:13:55Z | 1 | 10 | 2 | 1,158 | 0 | 0.85 | 1 | 0.7 | 1 | 0.226333 | 84.279 | ||
1,087 | swe_gym::train::1896 | swe_gym | train | 1,896 | facebookresearch__hydra-1401 | facebookresearch/hydra | facebookresearch/hydra | python | 40f404fe4443e00a7a67f23ed7a7432abe42e771 | [Bug] String values in defaults list are not overridable with lists
# 🐛 Bug
## Description
String values in defaults list are not overridable with lists.
## Checklist
- [x] I checked on the latest version of Hydra
- [x] I created a minimal repro (See [this](https://stackoverflow.com/help/minimal-reproducible-example... | Thanks for reporting! | diff --git a/hydra/_internal/defaults_list.py b/hydra/_internal/defaults_list.py
--- a/hydra/_internal/defaults_list.py
+++ b/hydra/_internal/defaults_list.py
@@ -233,8 +233,7 @@ def update_package_header(repo: IConfigRepository, node: InputDefault) -> None:
if node.is_missing():
return
# This loads ... | diff --git a/tests/defaults_list/test_defaults_tree.py b/tests/defaults_list/test_defaults_tree.py
--- a/tests/defaults_list/test_defaults_tree.py
+++ b/tests/defaults_list/test_defaults_tree.py
@@ -2585,6 +2585,19 @@ def test_select_multi(
),
id="group1/select_multi:override",
),
+ ... | ["tests/defaults_list/test_defaults_tree.py::test_select_multi_pkg[group1/override_single_to_list]"] | ["tests/defaults_list/test_defaults_tree.py::test_deprecated_package_header_keywords[deprecated_headers/group_foo]", "tests/defaults_list/test_defaults_tree.py::test_interpolation[interpolation_with_nested_defaults_list_with_override]", "tests/defaults_list/test_defaults_tree.py::test_simple_defaults_tree_cases[empty]"... | null | true | 2021-02-18T00:13:57Z | 1 | 242 | 1 | 3,781 | 0.079365 | 0.85 | 1 | 0.92 | 0.75 | 1 | 84.269583 | |
1,088 | swe_gym::train::1012 | swe_gym | train | 1,012 | dask__dask-10765 | dask/dask | dask/dask | python | 63b6bb84015975c8466e80d1d498a293835ae936 | Exception from `validate_key` is misleading for composite keys
When validating a key tuple with an invalid component, the exception is currently not helpful for identifying the problem and might even be misleading:
```python
import numpy as np
from dask.core import validate_key
validate_key((1, np.int64(2), 3))
```
cr... | diff --git a/dask/core.py b/dask/core.py
--- a/dask/core.py
+++ b/dask/core.py
@@ -218,9 +218,26 @@ def iskey(key: object) -> bool:
def validate_key(key: object) -> None:
- """Validate the format of a dask key."""
- if not iskey(key):
- raise TypeError(f"Unexpected key type {type(key)} (value: {key!r}... | diff --git a/dask/tests/test_core.py b/dask/tests/test_core.py
--- a/dask/tests/test_core.py
+++ b/dask/tests/test_core.py
@@ -73,9 +73,12 @@ def test_iskey_numpy_types():
def test_validate_key():
validate_key(1)
validate_key(("x", 1))
- with pytest.raises(TypeError):
+ with pytest.raises(TypeError, ma... | ["dask/tests/test_core.py::test_validate_key"] | ["dask/tests/test_core.py::test_getcycle", "dask/tests/test_core.py::TestGet::test_get", "dask/tests/test_core.py::test_istask", "dask/tests/test_core.py::test_get_dependencies_empty", "dask/tests/test_core.py::TestGet::test_nested_badkey", "dask/tests/test_core.py::TestGet::test_data_not_in_dict_is_ok", "dask/tests/te... | null | true | 2024-01-10T09:10:40Z | 1 | 23 | 1 | 874 | 0 | 0.85 | 1 | 0.7 | 1 | 0.222333 | 84.267 | ||
1,089 | swe_bench_verified::test::489 | swe_bench_verified | test | 489 | sympy__sympy-23262 | sympy/sympy | sympy/sympy | python | fdc707f73a65a429935c01532cd3970d3355eab6 | Python code printer not respecting tuple with one element
Hi,
Thanks for the recent updates in SymPy! I'm trying to update my code to use SymPy 1.10 but ran into an issue with the Python code printer. MWE:
```python
import inspect
from sympy import lambdify
inspect.getsource(lambdify([], tuple([1])))
```
SymPy 1.9 a... | Bisected to 6ccd2b07ded5074941bb80b5967d60fa1593007a from #21993.
CC @bjodah
As a work around for now, you can use the `Tuple` object from sympy. Note that it is constructed slightly differently from a python `tuple`, rather than giving a `list`, you give it multiple input arguments (or you can put a `*` in front o... | diff --git a/sympy/utilities/lambdify.py b/sympy/utilities/lambdify.py
--- a/sympy/utilities/lambdify.py
+++ b/sympy/utilities/lambdify.py
@@ -956,9 +956,9 @@ def _recursive_to_string(doprint, arg):
return doprint(arg)
elif iterable(arg):
if isinstance(arg, list):
- left, right = "[]"
... | diff --git a/sympy/utilities/tests/test_lambdify.py b/sympy/utilities/tests/test_lambdify.py
--- a/sympy/utilities/tests/test_lambdify.py
+++ b/sympy/utilities/tests/test_lambdify.py
@@ -1192,6 +1192,8 @@ def test_issue_14941():
# test tuple
f2 = lambdify([x, y], (y, x), 'sympy')
assert f2(2, 3) == (3, 2... | ["test_issue_14941"] | ["test_no_args", "test_single_arg", "test_list_args", "test_nested_args", "test_str_args", "test_own_namespace_1", "test_own_namespace_2", "test_own_module", "test_bad_args", "test_atoms", "test_sympy_lambda", "test_math_lambda", "test_mpmath_lambda", "test_number_precision", "test_mpmath_precision", "test_math_transl"... | null | true | 2022-03-21T07:17:35Z | 1 | 4 | 1 | 995 | 0 | 1 | 1 | 0.7 | 0.8 | 0.179167 | 84.2375 | |
1,090 | swe_bench_verified::test::172 | swe_bench_verified | test | 172 | django__django-14915 | django/django | django/django | python | 903aaa35e5ceaa33bfc9b19b7f6da65ce5a91dd4 | ModelChoiceIteratorValue is not hashable.
Description
Recently I migrated from Django 3.0 to Django 3.1. In my code, I add custom data-* attributes to the select widget options. After the upgrade some of those options broke. Error is {TypeError}unhashable type: 'ModelChoiceIteratorValue'.
Example (this one breaks):
d... | Thanks for the ticket. Agreed, we could make ModelChoiceIteratorValue hashable by adding: def __hash__(self): return hash(self.value) For now you can use value.value as documented in the "Backwards incompatible changes in 3.1" section. Would you like to prepare a patch?
Replying to Mariusz Felisiak: Thanks for the tic... | diff --git a/django/forms/models.py b/django/forms/models.py
--- a/django/forms/models.py
+++ b/django/forms/models.py
@@ -1166,6 +1166,9 @@ def __init__(self, value, instance):
def __str__(self):
return str(self.value)
+ def __hash__(self):
+ return hash(self.value)
+
def __eq__(self, ot... | diff --git a/tests/model_forms/test_modelchoicefield.py b/tests/model_forms/test_modelchoicefield.py
--- a/tests/model_forms/test_modelchoicefield.py
+++ b/tests/model_forms/test_modelchoicefield.py
@@ -2,7 +2,7 @@
from django import forms
from django.core.exceptions import ValidationError
-from django.forms.models... | ["test_choice_value_hash (model_forms.test_modelchoicefield.ModelChoiceFieldTests)"] | ["test_basics (model_forms.test_modelchoicefield.ModelChoiceFieldTests)", "test_choice_iterator_passes_model_to_widget (model_forms.test_modelchoicefield.ModelChoiceFieldTests)", "test_choices (model_forms.test_modelchoicefield.ModelChoiceFieldTests)", "test_choices_bool (model_forms.test_modelchoicefield.ModelChoiceFi... | null | true | 2021-09-29T22:00:15Z | 1 | 3 | 1 | 1,005 | 0 | 1 | 1 | 0.7 | 0.8 | 0.1775 | 84.2325 | |
1,091 | swe_gym::train::874 | swe_gym | train | 874 | iterative__dvc-1782 | iterative/dvc | iterative/dvc | python | 2776f2f3170bd4c9766e60e4ebad79cdadfaa73e | repro: showing metrics is not working
There's currently a `--metrics` option to show the metrics after reproduction, but it isn't showing anything.
```bash
$ dvc run -o something -m metrics.txt "echo something > something && date +%N > metrics.txt"
$ dvc metrics show
metrics.txt: 144996304
$ dvc repro --forc... | diff --git a/dvc/command/metrics.py b/dvc/command/metrics.py
--- a/dvc/command/metrics.py
+++ b/dvc/command/metrics.py
@@ -5,15 +5,16 @@
from dvc.command.base import CmdBase, fix_subparsers
-class CmdMetricsShow(CmdBase):
- def _show(self, metrics):
- for branch, val in metrics.items():
- if s... | diff --git a/tests/test_repro.py b/tests/test_repro.py
--- a/tests/test_repro.py
+++ b/tests/test_repro.py
@@ -1,3 +1,4 @@
+from dvc.logger import logger
from dvc.utils.compat import str
import os
@@ -32,8 +33,10 @@
from tests.test_data_cloud import _should_test_aws, TEST_AWS_REPO_BUCKET
from tests.test_data_clou... | ["tests/test_repro.py::TestShouldDisplayMetricsOnReproWithMetricsOption::test"] | ["tests/test_repro.py::TestReproExternalLOCAL::test", "tests/test_repro.py::TestReproDepUnderDir::test", "tests/test_repro.py::TestNonExistingOutput::test", "tests/test_repro.py::TestReproCyclicGraph::test", "tests/test_repro.py::TestCmdRepro::test", "tests/test_repro.py::TestReproNoCommit::test", "tests/test_repro.py:... | null | true | 2019-03-25T17:07:50Z | 2 | 21 | 1 | 845 | 0 | 0.85 | 1 | 0.7 | 1 | 0.210833 | 84.2325 | ||
1,092 | swe_gym::train::2322 | swe_gym | train | 2,322 | Project-MONAI__MONAI-4479 | Project-MONAI/MONAI | project-monai/monai | python | 96c6cc3104dec742bc5933cadfa104c1fdf7e176 | shufflebuffer is not compatible with the dataloader
**Describe the bug**
```py
import monai
buffer = monai.data.ShuffleBuffer([1,2,3,4])
for x in monai.data.DataLoader(buffer, batch_size=2):
print(x)
```
```
for x in monai.data.DataLoader(buffer, batch_size=2):
File "/Users/Documents/MONAI/monai/data/datalo... | diff --git a/monai/data/grid_dataset.py b/monai/data/grid_dataset.py
--- a/monai/data/grid_dataset.py
+++ b/monai/data/grid_dataset.py
@@ -187,23 +187,19 @@ def __init__(
) -> None:
super().__init__(data=data, transform=None)
self.patch_iter = patch_iter
- self.transform = transform
+ ... | diff --git a/tests/test_grid_dataset.py b/tests/test_grid_dataset.py
--- a/tests/test_grid_dataset.py
+++ b/tests/test_grid_dataset.py
@@ -60,7 +60,7 @@ def test_loading_array(self):
np.testing.assert_equal(tuple(item[0].shape), (2, 1, 2, 2))
np.testing.assert_allclose(
item[0],
- ... | ["tests/test_grid_dataset.py::TestGridPatchDataset::test_loading_dict", "tests/test_shuffle_buffer.py::TestShuffleBuffer::test_shape", "tests/test_grid_dataset.py::TestGridPatchDataset::test_loading_array"] | ["tests/test_grid_dataset.py::TestGridPatchDataset::test_shape"] | null | true | 2022-06-10T10:46:58Z | 2 | 24 | 3 | 777 | 0 | 0.85 | 1 | 0.7 | 1 | 0.2095 | 84.2285 | ||
1,093 | swe_gym::train::698 | swe_gym | train | 698 | iterative__dvc-4034 | iterative/dvc | iterative/dvc | python | 584c97a58dd130a74b98c75e8f8f2170fe7e644d | get: directory is checked-out inside pwd instead of it's own directory
## Bug Report
```console
$ cd "$(mktemp -d)"
$ dvc get https://github.com/schacon/cowsay
$ ls
beavis.zen.cow daemon.cow eyes.cow kitty.cow milk.cow sheep.cow stimpy.cow turtle.cow
bong.cow defa... | diff --git a/dvc/repo/tree.py b/dvc/repo/tree.py
--- a/dvc/repo/tree.py
+++ b/dvc/repo/tree.py
@@ -404,10 +404,8 @@ def copytree(self, top, dest):
for root, _, files in self.walk(top):
root = PathInfo(root)
- dest_dir = root.relative_to(top)
- makedirs(dest_dir, exist_ok=Tr... | diff --git a/tests/func/test_get.py b/tests/func/test_get.py
--- a/tests/func/test_get.py
+++ b/tests/func/test_get.py
@@ -33,7 +33,9 @@ def test_get_repo_dir(tmp_dir, erepo_dir):
trees_equal(erepo_dir / "dir", "dir_imported")
-def test_get_git_file(tmp_dir, erepo_dir):
+@pytest.mark.parametrize("repo_type", [... | ["tests/func/test_get.py::test_get_git_dir[git_dir]"] | ["tests/func/test_get.py::test_get_git_dir[erepo_dir]", "tests/func/test_get.py::test_get_url_not_existing", "tests/func/test_get.py::test_unknown_path", "tests/func/test_get.py::test_get_git_file[git_dir]", "tests/func/test_get.py::test_absolute_file_outside_git_repo", "tests/func/test_get.py::test_absolute_file_outsi... | null | true | 2020-06-12T13:32:10Z | 1 | 6 | 1 | 1,132 | 0 | 0.85 | 1 | 0.7 | 1 | 0.208667 | 84.226 | ||
1,094 | swe_gym::train::2149 | swe_gym | train | 2,149 | Project-MONAI__MONAI-6895 | Project-MONAI/MONAI | project-monai/monai | python | 59bcad45030a9abce369e5acaf6aa726fb48a5c8 | RankFilter in a single gpu environment
**Describe the bug**
https://github.com/Project-MONAI/MONAI/blob/59bcad45030a9abce369e5acaf6aa726fb48a5c8/monai/utils/dist.py#L197-L204
rankfilter is not well defined for the single gpu environment
```
File "/usr/lib/python3.10/logging/__init__.py", line 1465, in debug
se... | diff --git a/monai/utils/dist.py b/monai/utils/dist.py
--- a/monai/utils/dist.py
+++ b/monai/utils/dist.py
@@ -197,11 +197,13 @@ def __init__(self, rank: int | None = None, filter_fn: Callable = lambda rank: r
if dist.is_available() and dist.is_initialized():
self.rank: int = rank if rank is not N... | diff --git a/tests/test_rankfilter_dist.py b/tests/test_rankfilter_dist.py
--- a/tests/test_rankfilter_dist.py
+++ b/tests/test_rankfilter_dist.py
@@ -43,11 +43,35 @@ def test_rankfilter(self):
with open(log_filename) as file:
lines = [line.rstrip() for line in file]
log_messa... | ["tests/test_rankfilter_dist.py::SingleRankFilterTest::test_rankfilter_single_proc"] | ["tests/test_rankfilter_dist.py::DistributedRankFilterTest::test_rankfilter"] | null | true | 2023-08-21T13:23:15Z | 1 | 12 | 1 | 1,011 | 0 | 0.85 | 1 | 0.7 | 1 | 0.2085 | 84.2255 | ||
1,095 | swe_bench_verified::test::40 | swe_bench_verified | test | 40 | django__django-11211 | django/django | django/django | python | ba726067604ce5a8ca3919edf653496722b433ab | Prefetch related is not working when used GFK for model that uses UUID field as PK.
Description
How to reproduce:
create model with UUID as primary key
class Foo(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
...
create another model with GFK to model Foo
class Bar(models.... | Thanks for the report, however GenericForeignKey doesn't support prefetch_related(), from the same reason it doesn't not support also filter(), exclude(), etc. Please see documentation. | diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
--- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -2325,6 +2325,10 @@ def deconstruct(self):
def get_internal_type(self):
return "UUIDField"
+ def get_prep_value(self, value):
+... | diff --git a/tests/prefetch_related/models.py b/tests/prefetch_related/models.py
--- a/tests/prefetch_related/models.py
+++ b/tests/prefetch_related/models.py
@@ -172,6 +172,11 @@ def __str__(self):
return self.tag
+class Article(models.Model):
+ id = models.UUIDField(primary_key=True, default=uuid.uuid... | ["test_prefetch_GFK_uuid_pk (prefetch_related.tests.GenericRelationTests)"] | ["test_bug (prefetch_related.tests.Ticket21410Tests)", "test_basic (prefetch_related.tests.RawQuerySetTests)", "test_clear (prefetch_related.tests.RawQuerySetTests)", "test_prefetch_before_raw (prefetch_related.tests.RawQuerySetTests)", "test_bug (prefetch_related.tests.Ticket19607Tests)", "test_m2m_then_m2m (prefetch_... | null | true | 2019-04-13T12:01:14Z | 1 | 4 | 1 | 957 | 0 | 1 | 1 | 0.7 | 0.8 | 0.172833 | 84.2185 | |
1,096 | swe_gym::train::916 | swe_gym | train | 916 | dask__dask-8686 | dask/dask | dask/dask | python | 007cbd4e6779c3311af91ba4ecdfe731f23ddf58 | `concatenate` inconsistency with NumPy for `axis=None`
**What happened**:
Calling `concatenate` with `axis=None` gives an error rather than flattening the inputs, which is what happens in NumPy.
**What you expected to happen**:
Behaviour the same as NumPy.
**Minimal Complete Verifiable Example**:
```python
>>> imp... | diff --git a/dask/array/core.py b/dask/array/core.py
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -3977,7 +3977,8 @@ def concatenate(seq, axis=0, allow_unknown_chunksizes=False):
----------
seq: list of dask.arrays
axis: int
- Dimension along which to align all of the arrays
+ Dimen... | diff --git a/dask/array/tests/test_array_core.py b/dask/array/tests/test_array_core.py
--- a/dask/array/tests/test_array_core.py
+++ b/dask/array/tests/test_array_core.py
@@ -577,6 +577,16 @@ def test_concatenate_unknown_axes():
assert_eq(c_x, np.concatenate([a_df.values, b_df.values], axis=1))
+def test_conca... | ["dask/array/tests/test_array_core.py::test_concatenate_flatten"] | ["dask/array/tests/test_array_core.py::test_normalize_chunks_nan", "dask/array/tests/test_array_core.py::test_stack_scalars", "dask/array/tests/test_array_core.py::test_astype", "dask/array/tests/test_array_core.py::test_meta[dtype1]", "dask/array/tests/test_array_core.py::test_vindex_basic", "dask/array/tests/test_arr... | null | true | 2022-02-08T09:31:03Z | 1 | 7 | 1 | 1,094 | 0 | 0.85 | 1 | 0.7 | 1 | 0.205667 | 84.217 | ||
1,097 | swe_gym::train::271 | swe_gym | train | 271 | getmoto__moto-7317 | getmoto/moto | getmoto/moto | python | 652eabda5170e772742d4a68234a26fa8765e6a9 | glue.create_database does not create tags
The AWS API allows to specify resource tags when creating a Glue database. However, moto will ignore those tags and not tag the database. As a demonstration, the following test fails:
```
from moto import mock_aws
import boto3
@mock_aws
def test_glue():
database_name = "te... | diff --git a/moto/glue/models.py b/moto/glue/models.py
--- a/moto/glue/models.py
+++ b/moto/glue/models.py
@@ -123,7 +123,10 @@ def default_vpc_endpoint_service(
)
def create_database(
- self, database_name: str, database_input: Dict[str, Any]
+ self,
+ database_name: str,
+ ... | diff --git a/tests/test_glue/helpers.py b/tests/test_glue/helpers.py
--- a/tests/test_glue/helpers.py
+++ b/tests/test_glue/helpers.py
@@ -19,13 +19,17 @@ def create_database_input(database_name):
return database_input
-def create_database(client, database_name, database_input=None, catalog_id=None):
+def ... | ["tests/test_glue/test_datacatalog.py::test_create_database_with_tags"] | ["tests/test_glue/test_datacatalog.py::test_delete_database", "tests/test_glue/test_datacatalog.py::test_create_partition_already_exist", "tests/test_glue/test_datacatalog.py::test_get_partitions_empty", "tests/test_glue/test_datacatalog.py::test_create_database", "tests/test_glue/test_datacatalog.py::test_batch_get_pa... | null | true | 2024-02-06 11:56:34 | 2 | 11 | 1 | 965 | 0 | 0.85 | 1 | 0.7 | 1 | 0.1975 | 84.1925 | ||
1,098 | swe_bench_verified::test::77 | swe_bench_verified | test | 77 | django__django-12273 | django/django | django/django | python | 927c903f3cd25c817c21738328b53991c035b415 | Resetting primary key for a child model doesn't work.
Description
In the attached example code setting the primary key to None does not work (so that the existing object is overwritten on save()).
The most important code fragments of the bug example:
from django.db import models
class Item(models.Model):
# uid = mode... | I'm not sure if this is a bug. The test passes after adding self.item_ptr = None to Item.reset(). Is that the behavior you're looking for?
I agree with Tim here. It feels like what you're after is self.pk = None as it will be alias for self.item_ptr for Derived instances and self.uid for Item instances.
@Simon Charette... | diff --git a/django/db/models/base.py b/django/db/models/base.py
--- a/django/db/models/base.py
+++ b/django/db/models/base.py
@@ -569,6 +569,9 @@ def _get_pk_val(self, meta=None):
return getattr(self, meta.pk.attname)
def _set_pk_val(self, value):
+ for parent_link in self._meta.parents.values()... | diff --git a/tests/model_inheritance_regress/tests.py b/tests/model_inheritance_regress/tests.py
--- a/tests/model_inheritance_regress/tests.py
+++ b/tests/model_inheritance_regress/tests.py
@@ -10,10 +10,11 @@
from .models import (
ArticleWithAuthor, BachelorParty, BirthdayParty, BusStation, Child,
- Derive... | ["test_create_new_instance_with_pk_equals_none (model_inheritance_regress.tests.ModelInheritanceTest)", "test_create_new_instance_with_pk_equals_none_multi_inheritance (model_inheritance_regress.tests.ModelInheritanceTest)"] | ["test_abstract_base_class_m2m_relation_inheritance (model_inheritance_regress.tests.ModelInheritanceTest)", "test_abstract_verbose_name_plural_inheritance (model_inheritance_regress.tests.ModelInheritanceTest)", "test_all_fields_from_abstract_base_class (model_inheritance_regress.tests.ModelInheritanceTest)", "test_co... | null | true | 2020-01-03T18:47:56Z | 1 | 3 | 2 | 924 | 0 | 1 | 1 | 0.7 | 0.8 | 0.164 | 84.192 | |
1,099 | swe_gym::train::969 | swe_gym | train | 969 | dask__dask-10616 | dask/dask | dask/dask | python | 91098a634967dfb44d67da54b1394d730f75e87d | DataFrame.clip does not support argument `axis`
**Describe the issue**:
ddf.clip(...) does not take the keyword argument `axis`, which is required by pandas:
```python
ValueError: Metadata inference failed in `clip`.
You have supplied a custom function and Dask is unable to
determine the type of output that that func... | diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -4380,12 +4380,19 @@ def between(self, left, right, inclusive="both"):
)
@derived_from(pd.Series)
- def clip(self, lower=None, upper=None, out=None):
+ def clip(self, lower=Non... | diff --git a/dask/dataframe/tests/test_dataframe.py b/dask/dataframe/tests/test_dataframe.py
--- a/dask/dataframe/tests/test_dataframe.py
+++ b/dask/dataframe/tests/test_dataframe.py
@@ -849,6 +849,50 @@ def test_clip(lower, upper):
assert_eq(ds.clip(upper=upper), s.clip(upper=upper))
+def test_clip_axis_0():
... | ["dask/dataframe/tests/test_dataframe.py::test_clip_axis_0", "dask/dataframe/tests/test_dataframe.py::test_clip_axis_1"] | ["dask/dataframe/tests/test_dataframe.py::test_repartition_npartitions[<lambda>1-float-2-5-False]", "dask/dataframe/tests/test_dataframe.py::test_repartition_npartitions[<lambda>1-M8[ns]-2-2-False]", "dask/dataframe/tests/test_dataframe.py::test_getitem_column_types[list]", "dask/dataframe/tests/test_dataframe.py::test... | null | true | 2023-11-07T17:51:44Z | 1 | 20 | 2 | 780 | 0 | 0.85 | 1 | 0.7 | 1 | 0.196667 | 84.19 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.