instance_id stringlengths 14 37 | repo stringclasses 26
values | split stringclasses 1
value | query stringlengths 10 4k | gold_files listlengths 1 194 | gold_units listlengths 1 1.58k | files listlengths 1 194 | units listlengths 0 2.99k |
|---|---|---|---|---|---|---|---|
numpy__numpy-7016 | numpy/numpy | train | inconsistency in np.isclose
The documentation for `np.isclose` says:
> Returns a boolean array of where `a` and `b` are equal within the given tolerance. If both `a` and `b` are scalars, returns a single boolean value.
This is true for comparing two finite scalars, a single boolean value is returned:
```
>>> np.iscl... | [
"numpy/core/numeric.py"
] | [
"numpy/core/numeric.py::isclose"
] | [
{
"cid": "numpy/core/numeric.py",
"text": "numpy/core/numeric.py\nclass ComplexWarning # The warning raised when casting a complex dtype to a real dtype.\ndef zeros_like(a, dtype=None, order='K', subok=True) # Return an array of zeros with the same shape and type as a given array.\ndef ones(shape, dtype=N... | [
{
"cid": "numpy/core/numeric.py::zeros_like",
"text": "numpy/core/numeric.py::zeros_like\ndef zeros_like(a, dtype=None, order='K', subok=True):\n \"\"\"\n Return an array of zeros with the same shape and type as a given array.\n\n Parameters\n ----------\n a : array_like\n The shape an... |
pantsbuild__pants-19224 | pantsbuild/pants | train | Unactionable(?) "indirectly referring to a target" warning for `pants package ::` with pex or FaaS
**Describe the bug**
Running a goal like `pants package ::` when there's `pex_binary`, `python_awslambda` or `python_google_cloud_function` targets (all of the users of `SecondaryOwnerMixin` fields) gives a warning abo... | [
"src/python/pants/engine/internals/graph.py",
"src/python/pants/engine/internals/specs_rules.py"
] | [
"src/python/pants/engine/internals/graph.py::<module>",
"src/python/pants/engine/internals/graph.py::find_owners",
"src/python/pants/engine/internals/specs_rules.py::<module>",
"src/python/pants/engine/internals/specs_rules.py::addresses_from_raw_specs_with_only_file_owners",
"src/python/pants/engine/intern... | [
{
"cid": "src/python/pants/backend/python/dependency_inference/subsystem.py",
"text": "src/python/pants/backend/python/dependency_inference/subsystem.py\nclass UnownedDependencyUsage # What action to take when an inferred dependency is unowned.\nclass InitFilesInference # How to handle inference for __ini... | [
{
"cid": "src/python/pants/backend/python/subsystems/setup.py::PythonSetup.interpreter_constraints",
"text": "src/python/pants/backend/python/subsystems/setup.py::PythonSetup.interpreter_constraints\n @memoized_property\n def interpreter_constraints(self) -> tuple[str, ...]:\n if not self._inte... |
ray-project__ray-9297 | ray-project/ray | train | [tune] Parameters from `tune.choice()` do not get logged to TensorBoard when integers
### What is the problem?
When providing parameters via `tune.choice()` that include integers, the values are not logged to TensorBoard's HPARAMS section.
The issue is that `numpy.random.choice([1, 2, 3])` (for example) returns `num... | [
"python/ray/tune/logger.py"
] | [
"python/ray/tune/logger.py::<module>"
] | [
{
"cid": "python/ray/services.py",
"text": "python/ray/services.py\nclass ConsolePopen\ndef address(ip_address, port)\ndef new_port()\ndef include_java_from_redis(redis_client) # This is used for query include_java bool from redis.\ndef find_redis_address_or_die()\ndef get_address_info_from_redis_helper(re... | [
{
"cid": "python/ray/services.py::address",
"text": "python/ray/services.py::address\ndef address(ip_address, port):\n return ip_address + \":\" + str(port)",
"label": 0
},
{
"cid": "python/ray/services.py::new_port",
"text": "python/ray/services.py::new_port\ndef new_port():\n return ... |
pyca__cryptography-3750 | pyca/cryptography | train | Add the ANY extended key usage OID to the ExtendedKeyUsageOID class
`2.5.29.37.0`
| [
"src/cryptography/x509/oid.py"
] | [
"src/cryptography/x509/oid.py::<module>"
] | [
{
"cid": "docs/conf.py",
"text": "docs/conf.py",
"label": 0
},
{
"cid": "src/cryptography/hazmat/backends/openssl/decode_asn1.py",
"text": "src/cryptography/hazmat/backends/openssl/decode_asn1.py\ndef _obj2txt(backend, obj)\ndef _decode_x509_name_entry(backend, x509_name_entry)\ndef _decode_... | [
{
"cid": "src/cryptography/hazmat/backends/openssl/decode_asn1.py::_obj2txt",
"text": "src/cryptography/hazmat/backends/openssl/decode_asn1.py::_obj2txt\ndef _obj2txt(backend, obj):\n # Set to 80 on the recommendation of\n # https://www.openssl.org/docs/crypto/OBJ_nid2ln.html#return_values\n #\n ... |
pantsbuild__pants-13813 | pantsbuild/pants | train | Split nailgun server and client inputs
Triage in #13779 showed that materializing the inputs for nailgunned JVM processes represented up to a 300ms constant factor.
But because those inputs currently include _both_ the `use_nailgun: Digest` and the `input_files: Digest` fields (because the `use_nailgun` digest must ... | [
"src/python/pants/backend/java/compile/javac.py",
"src/python/pants/backend/java/dependency_inference/java_parser.py",
"src/python/pants/backend/scala/compile/scalac.py",
"src/python/pants/backend/scala/dependency_inference/scala_parser.py"
] | [
"src/python/pants/backend/java/compile/javac.py::compile_java_source",
"src/python/pants/backend/java/dependency_inference/java_parser.py::analyze_java_source_dependencies",
"src/python/pants/backend/scala/compile/scalac.py::compile_scala_source",
"src/python/pants/backend/scala/dependency_inference/scala_par... | [
{
"cid": "src/python/pants/backend/java/compile/javac.py",
"text": "src/python/pants/backend/java/compile/javac.py\nclass CompileJavaSourceRequest\ndef compile_java_source(bash: BashBinary, jdk_setup: JdkSetup, zip_binary: ZipBinary, union_membership: UnionMembership, request: CompileJavaSourceRequest)\ndef... | [
{
"cid": "src/python/pants/backend/java/compile/javac.py::compile_java_source",
"text": "src/python/pants/backend/java/compile/javac.py::compile_java_source\n@rule(desc=\"Compile with javac\")\nasync def compile_java_source(\n bash: BashBinary,\n jdk_setup: JdkSetup,\n zip_binary: ZipBinary,\n u... |
wagtail__wagtail-272 | wagtail/wagtail | train | Related Links validation error
1. Start to create new page
2. Click "+" on related links
3. Delete empty related link
4. Fill all fields except one that is required (for a page)
5. Save as Draft
Now validation is saying that there are two errors (omitted field and empty related link)
When fixed ommited field error and... | [
"wagtail/wagtailadmin/views/pages.py"
] | [
"wagtail/wagtailadmin/views/pages.py::<module>"
] | [
{
"cid": "wagtail/wagtailadmin/edit_handlers.py",
"text": "wagtail/wagtailadmin/edit_handlers.py\nclass FriendlyDateInput # A custom DateInput widget that formats dates as \"05 Oct 2013\"\n def __init__(self, attrs=None)\nclass FriendlyTimeInput # A custom TimeInput widget that formats dates as \"5.30p... | [
{
"cid": "wagtail/wagtailadmin/edit_handlers.py::FriendlyDateInput.__init__",
"text": "wagtail/wagtailadmin/edit_handlers.py::FriendlyDateInput.__init__\n def __init__(self, attrs=None):\n default_attrs = {'class': 'friendly_date'}\n if attrs:\n default_attrs.update(attrs)\n\n ... |
Qiskit__qiskit-4596 | Qiskit/qiskit | train | Cannot unroll identity matrix of more than 2 qubits when coupling_map is set
<!-- ⚠️ If you do not respect this template, your issue will be closed -->
<!-- ⚠️ Make sure to browse the opened and closed issues -->
### Information
- **Qiskit Terra version**: 0.14.1
- **Python version**: 3.8
- **Operating system... | [
"qiskit/transpiler/passes/basis/unroll_3q_or_more.py"
] | [
"qiskit/transpiler/passes/basis/unroll_3q_or_more.py::Unroll3qOrMore.run"
] | [
{
"cid": "qiskit/compiler/transpile.py",
"text": "qiskit/compiler/transpile.py\ndef transpile(circuits: Union[QuantumCircuit, List[QuantumCircuit]], backend: Optional[BaseBackend]=None, basis_gates: Optional[List[str]]=None, coupling_map: Optional[Union[CouplingMap, List[List[int]]]]=None, backend_propertie... | [
{
"cid": "qiskit/compiler/transpile.py::transpile",
"text": "qiskit/compiler/transpile.py::transpile\ndef transpile(circuits: Union[QuantumCircuit, List[QuantumCircuit]],\n backend: Optional[BaseBackend] = None,\n basis_gates: Optional[List[str]] = None,\n coupling_map... |
Lightning-AI__lightning-2789 | Lightning-AI/lightning | train | `replace_sampler_ddp` doesn't create a shuffled sampler
<!--
### Common bugs:
1. Tensorboard not showing in Jupyter-notebook see [issue 79](https://github.com/PyTorchLightning/pytorch-lightning/issues/79).
2. PyTorch 1.1.0 vs 1.2.0 support [see FAQ](https://github.com/PyTorchLightning/pytorch-lightning#faq) ... | [
"pytorch_lightning/trainer/data_loading.py"
] | [
"pytorch_lightning/trainer/data_loading.py::TrainerDataLoadingMixin._get_distributed_sampler",
"pytorch_lightning/trainer/data_loading.py::TrainerDataLoadingMixin.auto_add_sampler"
] | [
{
"cid": "docs/source/conf.py",
"text": "docs/source/conf.py\ndef run_apidoc(_)\ndef setup(app)\ndef package_list_from_file(file)\ndef linkcode_resolve(domain, info)\n def find_source()",
"label": 0
},
{
"cid": "pytorch_lightning/__init__.py",
"text": "pytorch_lightning/__init__.py",
... | [
{
"cid": "docs/source/conf.py::run_apidoc",
"text": "docs/source/conf.py::run_apidoc\ndef run_apidoc(_):\n sys.path.insert(0, apidoc_output_folder)\n\n # delete api-doc files before generating them\n if os.path.exists(apidoc_output_folder):\n shutil.rmtree(apidoc_output_folder)\n\n for pk... |
ipython__ipython-4521 | ipython/ipython | train | unicode error when trying Audio('data/Bach Cello Suite #3.wav')
Hello,
I'm under ipython2.0dev/windows7 / python3
Trying the greatest and latest @ellisonbg notebook at
https://github.com/ellisonbg/talk-pydata-nyc2013/blob/master/Close to Data.ipynb
I get an unicode error at the wave example.
Does anyone else has ... | [
"IPython/lib/display.py",
"setupbase.py"
] | [
"IPython/lib/display.py::<module>",
"setupbase.py::find_package_data"
] | [
{
"cid": "IPython/core/display.py",
"text": "IPython/core/display.py\ndef _safe_exists(path) # Check path, but don't let exceptions raise\ndef _merge(d1, d2) # Like update, but merges sub-dicts instead of clobbering at the top level.\ndef _display_mimetype(mimetype, objs, raw=False, metadata=None) # inte... | [
{
"cid": "IPython/core/display.py::_safe_exists",
"text": "IPython/core/display.py::_safe_exists\ndef _safe_exists(path):\n \"\"\"Check path, but don't let exceptions raise\"\"\"\n try:\n return os.path.exists(path)\n except Exception:\n return False",
"label": 0
},
{
"cid... |
ytdl-org__youtube-dl-7514 | ytdl-org/youtube-dl | train | neteasemusic no longer works
| [
"youtube_dl/extractor/neteasemusic.py"
] | [
"youtube_dl/extractor/neteasemusic.py::NetEaseMusicBaseIE.extract_formats"
] | [
{
"cid": "youtube_dl/extractor/aparat.py",
"text": "youtube_dl/extractor/aparat.py\nclass AparatIE\n def _real_extract(self, url)",
"label": 0
},
{
"cid": "youtube_dl/extractor/dhm.py",
"text": "youtube_dl/extractor/dhm.py\nclass DHMIE\n def _real_extract(self, url)",
"label": 0
... | [
{
"cid": "youtube_dl/extractor/aparat.py::AparatIE._real_extract",
"text": "youtube_dl/extractor/aparat.py::AparatIE._real_extract\n def _real_extract(self, url):\n video_id = self._match_id(url)\n\n # Note: There is an easier-to-parse configuration at\n # http://www.aparat.com/video... |
numpy__numpy-6660 | numpy/numpy | train | Allow pathlib.Path arguments
`savez`, `savez_compressed`, and `load` all take `str` as an argument, but give an error when passed a `pathlib.Path` argument as a filename. Now that `pathlib.Path` is in the standard library, it would be nice if these functions could accept a `Path` instance as an argument, in addition to... | [
"numpy/compat/py3k.py",
"numpy/core/memmap.py",
"numpy/lib/npyio.py"
] | [
"numpy/compat/py3k.py::<module>",
"numpy/compat/py3k.py::asunicode_nested",
"numpy/core/memmap.py::<module>",
"numpy/core/memmap.py::memmap.__new__",
"numpy/lib/npyio.py::<module>",
"numpy/lib/npyio.py::_savez",
"numpy/lib/npyio.py::genfromtxt",
"numpy/lib/npyio.py::load",
"numpy/lib/npyio.py::loadt... | [
{
"cid": "numpy/compat/py3k.py",
"text": "numpy/compat/py3k.py\ndef getexception()\ndef asbytes_nested(x)\ndef asunicode_nested(x)",
"label": 1
},
{
"cid": "numpy/core/memmap.py",
"text": "numpy/core/memmap.py\nclass memmap # Create a memory-map to an array stored in a *binary* file on disk... | [
{
"cid": "numpy/compat/py3k.py::getexception",
"text": "numpy/compat/py3k.py::getexception\ndef getexception():\n return sys.exc_info()[1]",
"label": 0
},
{
"cid": "numpy/compat/py3k.py::asbytes_nested",
"text": "numpy/compat/py3k.py::asbytes_nested\ndef asbytes_nested(x):\n if hasattr... |
docker__compose-1374 | docker/compose | train | APIError: 500 Server Error on first docker-compose up / build
cc @aanand
I noticed this when testing the most recent RC (4)
Steps to reproduce:
1. Clone https://github.com/nathanleclaire/hubfwd
2. Run `docker-compose up` in the repo
Expected behavior: It doesn't blow up
Actual behavior: It blows up
On the first `u... | [
"compose/service.py"
] | [
"compose/service.py::Service.build"
] | [
{
"cid": "compose/__init__.py",
"text": "compose/__init__.py",
"label": 0
},
{
"cid": "compose/cli/__init__.py",
"text": "compose/cli/__init__.py",
"label": 0
},
{
"cid": "compose/cli/colors.py",
"text": "compose/cli/colors.py\ndef get_pairs()\ndef ansi(code)\ndef ansi_color(... | [
{
"cid": "compose/cli/colors.py::get_pairs",
"text": "compose/cli/colors.py::get_pairs\ndef get_pairs():\n for i, name in enumerate(NAMES):\n yield(name, str(30 + i))\n yield('intense_' + name, str(30 + i) + ';1')",
"label": 0
},
{
"cid": "compose/cli/colors.py::ansi",
"text... |
wagtail__wagtail-738 | wagtail/wagtail | train | Update all admin actions to work on the specific version of the page
Currently, the unpublish, delete, etc actions all work on the `Page` class. The downside of this is save/delete/clean methods are called on `Page` rather than on the specific class. Theres a couple of downsides to this:
- If someone's overridden the s... | [
"wagtail/wagtailadmin/views/pages.py"
] | [
"wagtail/wagtailadmin/views/pages.py::delete",
"wagtail/wagtailadmin/views/pages.py::lock",
"wagtail/wagtailadmin/views/pages.py::move_confirm",
"wagtail/wagtailadmin/views/pages.py::unlock",
"wagtail/wagtailadmin/views/pages.py::unpublish"
] | [
{
"cid": "wagtail/wagtailadmin/templatetags/wagtailadmin_tags.py",
"text": "wagtail/wagtailadmin/templatetags/wagtailadmin_tags.py\ndef explorer_nav()\ndef explorer_subnav(nodes)\ndef main_nav(context)\ndef main_nav_js()\ndef ellipsistrim(value, max_length)\ndef fieldtype(bound_field)\ndef meta_description(... | [
{
"cid": "wagtail/wagtailadmin/templatetags/wagtailadmin_tags.py::explorer_nav",
"text": "wagtail/wagtailadmin/templatetags/wagtailadmin_tags.py::explorer_nav\n@register.inclusion_tag('wagtailadmin/shared/explorer_nav.html')\ndef explorer_nav():\n return {\n 'nodes': get_navigation_menu_items()\n ... |
ipython__ipython-11752 | ipython/ipython | train | BackgroundJobManager wrong job.num's are assigned after flush call
Hello, there is a problem with how `job.num` is calculated.
### What I do:
I try to run the following code
```python
from IPython.lib import backgroundjobs as bg
def forever():
while True:
pass
return 'Done'
def once():
... | [
"IPython/lib/backgroundjobs.py"
] | [
"IPython/lib/backgroundjobs.py::BackgroundJobManager.__init__",
"IPython/lib/backgroundjobs.py::BackgroundJobManager.new"
] | [
{
"cid": "IPython/core/ultratb.py",
"text": "IPython/core/ultratb.py\ndef inspect_error() # Print a message about internal inspect errors.\ndef findsource(object) # Return the entire source file and starting line number for an object.\ndef getargs(co) # Get information about the arguments accepted by a c... | [
{
"cid": "IPython/core/ultratb.py::inspect_error",
"text": "IPython/core/ultratb.py::inspect_error\ndef inspect_error():\n \"\"\"Print a message about internal inspect errors.\n\n These are unfortunately quite common.\"\"\"\n\n error('Internal Python error in the inspect module.\\n'\n 'Bel... |
pantsbuild__pants-16635 | pantsbuild/pants | train | `packed` layout PEXes fail to `run` with `use_deprecated_pex_binary_run_semantics=false`
**Describe the bug**
With `use_deprecated_pex_binary_run_semantics=false`, a `layout="packed"` PEX will fail to run with:
```
Exception: Error executing interactive process: Permission denied (os error 13)
```
**Pants versio... | [
"src/python/pants/backend/python/goals/run_pex_binary.py"
] | [
"src/python/pants/backend/python/goals/run_pex_binary.py::<module>",
"src/python/pants/backend/python/goals/run_pex_binary.py::create_pex_binary_run_request"
] | [
{
"cid": "src/python/pants/backend/python/goals/run_pex_binary.py",
"text": "src/python/pants/backend/python/goals/run_pex_binary.py\ndef create_pex_binary_run_request(field_set: PexBinaryFieldSet, use_deprecated_pex_binary_run_semantics: UseDeprecatedPexBinaryRunSemanticsOption, pex_binary_defaults: PexBin... | [
{
"cid": "src/python/pants/backend/python/goals/run_pex_binary.py::create_pex_binary_run_request",
"text": "src/python/pants/backend/python/goals/run_pex_binary.py::create_pex_binary_run_request\n@rule(level=LogLevel.DEBUG)\nasync def create_pex_binary_run_request(\n field_set: PexBinaryFieldSet,\n us... |
ray-project__ray-6941 | ray-project/ray | train | [rllib]compute_advantages doesn't support a critic without GAE
Looks like this was a [planned feature](https://github.com/ray-project/ray/blob/7edc677304f90bcab0a01e9722e59e36dd9afcb0/python/ray/rllib/evaluation/postprocessing.py#L47) that got overlooked. Seems like a simple fix but maybe I'm missing something.
| [
"rllib/agents/a3c/a3c.py",
"rllib/agents/a3c/a3c_tf_policy.py",
"rllib/agents/a3c/a3c_torch_policy.py",
"rllib/agents/marwil/marwil_policy.py",
"rllib/agents/pg/pg_tf_policy.py",
"rllib/agents/ppo/appo.py",
"rllib/agents/ppo/appo_policy.py",
"rllib/agents/ppo/ppo.py",
"rllib/evaluation/postprocessin... | [
"rllib/agents/a3c/a3c.py::<module>",
"rllib/agents/a3c/a3c_tf_policy.py::postprocess_advantages",
"rllib/agents/a3c/a3c_torch_policy.py::add_advantages",
"rllib/agents/marwil/marwil_policy.py::postprocess_advantages",
"rllib/agents/pg/pg_tf_policy.py::pg_tf_loss",
"rllib/agents/pg/pg_tf_policy.py::post_pr... | [
{
"cid": "doc/source/conf.py",
"text": "doc/source/conf.py\ndef feedback_form_url(project, page) # Create a URL for feedback on a particular page in a project.\ndef update_context(app, pagename, templatename, context, doctree) # Update the page rendering context to include ``feedback_form_url``.\ndef setu... | [
{
"cid": "doc/source/conf.py::feedback_form_url",
"text": "doc/source/conf.py::feedback_form_url\ndef feedback_form_url(project, page):\n \"\"\"Create a URL for feedback on a particular page in a project.\"\"\"\n return FEEDBACK_FORM_FMT.format(\n title=urllib.parse.quote(\n \"[docs]... |
pandas-dev__pandas-26698 | pandas-dev/pandas | train | CI - Azure: print skipped tests
We have a `ci/print_skipped.py` script to print the skipped tests, that is currently used in Travis (see end of `.travis.yml` file). It would be to also do this in Azure as an extra step.
| [
"ci/print_skipped.py"
] | [
"ci/print_skipped.py::<module>",
"ci/print_skipped.py::main",
"ci/print_skipped.py::parse_args"
] | [
{
"cid": "ci/print_skipped.py",
"text": "ci/print_skipped.py\ndef parse_results(filename)\ndef main(args)\ndef parse_args()",
"label": 1
},
{
"cid": "scripts/find_commits_touching_func.py",
"text": "scripts/find_commits_touching_func.py\ndef clean_checkout(comm)\ndef get_hits(defname, files=... | [
{
"cid": "ci/print_skipped.py::parse_results",
"text": "ci/print_skipped.py::parse_results\ndef parse_results(filename):\n tree = et.parse(filename)\n root = tree.getroot()\n skipped = []\n\n current_class = ''\n i = 1\n assert i - 1 == len(skipped)\n for el in root.findall('testcase'):... |
wagtail__wagtail-9133 | wagtail/wagtail | train | Unit tests for the `classnames` template tag
### Is your proposal related to a problem?
* As part of the GSoC UX Unification project a useful template tag was created `classnames` e2d4cb77458878d7d7076a7aa8b6d590deb99463
* It would be good to add unit tests for this behaviour
### Describe the solution you'd like... | [
"wagtail/admin/templatetags/wagtailadmin_tags.py"
] | [
"wagtail/admin/templatetags/wagtailadmin_tags.py::classnames"
] | [
{
"cid": "docs/conf.py",
"text": "docs/conf.py\ndef setup(app)",
"label": 0
},
{
"cid": "wagtail/admin/templatetags/wagtailadmin_tags.py",
"text": "wagtail/admin/templatetags/wagtailadmin_tags.py\ndef breadcrumbs(context, page, url_name, url_root_name=None, include_self=True, is_expanded=Fal... | [
{
"cid": "docs/conf.py::setup",
"text": "docs/conf.py::setup\ndef setup(app):\n app.add_js_file(\"js/banner.js\")",
"label": 0
},
{
"cid": "wagtail/admin/templatetags/wagtailadmin_tags.py::breadcrumbs",
"text": "wagtail/admin/templatetags/wagtailadmin_tags.py::breadcrumbs\n@register.inclu... |
google__jax-818 | google/jax | train | Easy api for custom primitives and vjps
JAX supports custom primitives and vjps, just like Autograd did. Improvements:
1) add this to documentation
2) add a minimal example of this in the examples section
3) add a wrapper function if appropriate?
| [
"jax/api.py",
"jax/interpreters/ad.py",
"jax/interpreters/partial_eval.py",
"jax/scipy/special.py"
] | [
"jax/api.py::<module>",
"jax/api.py::custom_transforms",
"jax/api.py::custom_transforms.traceable",
"jax/api.py::jarrett",
"jax/api.py::jarrett.elementwise_jvp",
"jax/api.py::jit",
"jax/interpreters/ad.py::defvjp_all",
"jax/interpreters/ad.py::defvjp_all.fun_jvp",
"jax/interpreters/ad.py::defvjp_all... | [
{
"cid": "docs/conf.py",
"text": "docs/conf.py",
"label": 0
},
{
"cid": "examples/onnx2xla.py",
"text": "examples/onnx2xla.py\ndef _asarray(proto)\ndef onnx_maxpool(x, kernel_shape, pads=None, strides=None) # Numpy-backed implementation of ONNX MaxPool op.\ndef onnx_conv(x, w, b=0, group=1,... | [
{
"cid": "examples/onnx2xla.py::_asarray",
"text": "examples/onnx2xla.py::_asarray\ndef _asarray(proto):\n return numpy_helper.to_array(proto).reshape(tuple(proto.dims))",
"label": 0
},
{
"cid": "examples/onnx2xla.py::onnx_maxpool",
"text": "examples/onnx2xla.py::onnx_maxpool\ndef onnx_maxp... |
docker__compose-4721 | docker/compose | train | Support unicode characters in -f paths
On Ubuntu 16.04:
```
$ docker-compose -f 就吃饭/docker-compose.yml config/home/joffrey/work/compose/compose/config/config.py:234: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
if filenames == ['-']:
Tra... | [
"compose/cli/command.py"
] | [
"compose/cli/command.py::get_config_path_from_options"
] | [
{
"cid": "compose/cli/command.py",
"text": "compose/cli/command.py\ndef project_from_options(project_dir, options)\ndef get_config_from_options(base_dir, options)\ndef get_config_path_from_options(base_dir, options, environment)\ndef get_client(environment, verbose=False, version=None, tls_config=None, host... | [
{
"cid": "compose/cli/command.py::project_from_options",
"text": "compose/cli/command.py::project_from_options\ndef project_from_options(project_dir, options):\n environment = Environment.from_env_file(project_dir)\n host = options.get('--host')\n if host is not None:\n host = host.lstrip('=... |
pandas-dev__pandas-11294 | pandas-dev/pandas | train | PERF: checking is_monotonic_increasing/decreasing before sorting on an index
We don't keep the sortedness state in an index per-se, but it is rather cheap to check
- `is_monotonic_increasing` or `is_monotonic_decreasing` on a reg-index
- MultiIndex should check `is_lexsorted` (this might be done already)
```
In [8]: ... | [
"asv_bench/benchmarks/frame_methods.py",
"pandas/core/frame.py"
] | [
"asv_bench/benchmarks/frame_methods.py::<module>",
"pandas/core/frame.py::DataFrame.sort_index"
] | [
{
"cid": "asv_bench/benchmarks/frame_methods.py",
"text": "asv_bench/benchmarks/frame_methods.py\nclass frame_apply_axis_1\n def setup(self)\n def time_frame_apply_axis_1(self)\nclass frame_apply_lambda_mean\n def setup(self)\n def time_frame_apply_lambda_mean(self)\nclass frame_apply_np_mean\n ... | [
{
"cid": "asv_bench/benchmarks/frame_methods.py::frame_apply_axis_1.setup",
"text": "asv_bench/benchmarks/frame_methods.py::frame_apply_axis_1.setup\n def setup(self):\n self.df = DataFrame(np.random.randn(1000, 100))",
"label": 0
},
{
"cid": "asv_bench/benchmarks/frame_methods.py::fra... |
pyca__cryptography-5438 | pyca/cryptography | train | Make OpenSSL 1.0.2 error (+ env var fallback)
| [
"src/cryptography/hazmat/bindings/openssl/binding.py"
] | [
"src/cryptography/hazmat/bindings/openssl/binding.py::<module>",
"src/cryptography/hazmat/bindings/openssl/binding.py::_verify_openssl_version"
] | [
{
"cid": "docs/conf.py",
"text": "docs/conf.py",
"label": 0
},
{
"cid": "docs/development/custom-vectors/secp256k1/generate_secp256k1.py",
"text": "docs/development/custom-vectors/secp256k1/generate_secp256k1.py\nclass TruncatedHash\n def __init__(self, hasher)\n def __call__(self, dat... | [
{
"cid": "docs/development/custom-vectors/secp256k1/generate_secp256k1.py::TruncatedHash.__init__",
"text": "docs/development/custom-vectors/secp256k1/generate_secp256k1.py::TruncatedHash.__init__\n def __init__(self, hasher):\n self.hasher = hasher",
"label": 0
},
{
"cid": "docs/devel... |
pantsbuild__pants-13402 | pantsbuild/pants | train | `--layout=packed` should always be used for the `repository.pex`
**Describe the bug**
When building a `pex_binary` when `requirements_constraints` is set, the `repository.pex` that is built for the binary will not set `--layout=packed`, because the request that is triggering the constraints build is not `internal_only... | [
"src/python/pants/backend/python/util_rules/pex.py",
"src/python/pants/backend/python/util_rules/pex_from_targets.py"
] | [
"src/python/pants/backend/python/util_rules/pex.py::<module>",
"src/python/pants/backend/python/util_rules/pex.py::PexRequirements.__init__",
"src/python/pants/backend/python/util_rules/pex.py::build_pex",
"src/python/pants/backend/python/util_rules/pex_from_targets.py::_setup_constraints_repository_pex"
] | [
{
"cid": "src/python/pants/backend/awslambda/python/rules.py",
"text": "src/python/pants/backend/awslambda/python/rules.py\nclass PythonAwsLambdaFieldSet\ndef package_python_awslambda(field_set: PythonAwsLambdaFieldSet, lambdex: Lambdex, union_membership: UnionMembership)\ndef rules()",
"label": 0
},
... | [
{
"cid": "src/python/pants/backend/awslambda/python/rules.py::package_python_awslambda",
"text": "src/python/pants/backend/awslambda/python/rules.py::package_python_awslambda\n@rule(desc=\"Create Python AWS Lambda\", level=LogLevel.DEBUG)\nasync def package_python_awslambda(\n field_set: PythonAwsLambdaF... |
Lightning-AI__lightning-3188 | Lightning-AI/lightning | train | RMSLE metric appears to be incorrect
## 🐛 Bug
The usage of mse [in the rmsle function](https://github.com/PyTorchLightning/pytorch-lightning/blob/22b9642117394d3c50587ae137dbf94c6dd5173c/pytorch_lightning/metrics/functional/regression.py#L138) looks wrong to me. It looks like this function currently computes _mean ... | [
"pytorch_lightning/metrics/functional/regression.py",
"pytorch_lightning/metrics/regression.py"
] | [
"pytorch_lightning/metrics/functional/regression.py::rmsle",
"pytorch_lightning/metrics/regression.py::<module>"
] | [
{
"cid": "docs/source/conf.py",
"text": "docs/source/conf.py\ndef run_apidoc(_)\ndef setup(app)\ndef package_list_from_file(file)\ndef linkcode_resolve(domain, info)\n def find_source()",
"label": 0
},
{
"cid": "pytorch_lightning/metrics/__init__.py",
"text": "pytorch_lightning/metrics/__... | [
{
"cid": "docs/source/conf.py::run_apidoc",
"text": "docs/source/conf.py::run_apidoc\ndef run_apidoc(_):\n sys.path.insert(0, apidoc_output_folder)\n\n # delete api-doc files before generating them\n if os.path.exists(apidoc_output_folder):\n shutil.rmtree(apidoc_output_folder)\n\n for pk... |
PrefectHQ__prefect-2646 | PrefectHQ/prefect | train | Implement Depth-First Execution with Mapping
Currently each "level" of a mapped pipeline is executed before proceeding to the next level. This is undesirable especially for pipelines where it's important that each "branch" of the pipeline finish as quickly as possible.
To implement DFE, we'll need to rearrange two ... | [
"src/prefect/engine/cloud/task_runner.py",
"src/prefect/engine/executors/__init__.py",
"src/prefect/engine/executors/base.py",
"src/prefect/engine/executors/dask.py",
"src/prefect/engine/executors/local.py",
"src/prefect/engine/flow_runner.py",
"src/prefect/engine/task_runner.py",
"src/prefect/utiliti... | [
"src/prefect/engine/cloud/task_runner.py::CloudTaskRunner.run",
"src/prefect/engine/executors/__init__.py::<module>",
"src/prefect/engine/executors/base.py::<module>",
"src/prefect/engine/executors/base.py::Executor.map",
"src/prefect/engine/executors/dask.py::<module>",
"src/prefect/engine/executors/dask... | [
{
"cid": "src/prefect/engine/cloud/task_runner.py",
"text": "src/prefect/engine/cloud/task_runner.py\nclass CloudTaskRunner # TaskRunners handle the execution of Tasks and determine the State of a Task\n def __init__(self, task: Task, state_handlers: Iterable[Callable]=None, result: Result=None, default... | [
{
"cid": "src/prefect/engine/cloud/task_runner.py::CloudTaskRunner.__init__",
"text": "src/prefect/engine/cloud/task_runner.py::CloudTaskRunner.__init__\n def __init__(\n self,\n task: Task,\n state_handlers: Iterable[Callable] = None,\n result: Result = None,\n default... |
conan-io__conan-4003 | conan-io/conan | train | GNU Make generator
https://github.com/solvingj/conan-make_generator/blob/master/conanfile.py by @solvingj is almost it.
I agree it could be built-in.
Can use conditional:
```
ifneq ($(USE_CONAN),)
INC_PATHS += $(CONAN_INC_PATHS)
LD_PATHS += $(CONAN_LIB_PATHS)
LD_LIBS += $(CONA... | [
"conans/client/generators/__init__.py",
"conans/client/generators/premake.py",
"conans/paths.py"
] | [
"conans/client/generators/__init__.py::<module>",
"conans/client/generators/premake.py::<module>",
"conans/paths.py::<module>"
] | [
{
"cid": "conans/client/build/autotools_environment.py",
"text": "conans/client/build/autotools_environment.py\nclass AutoToolsBuildEnvironment # - CPPFLAGS (C-PreProcesor-Flags NOT related with c++) (-I -D)\n def __init__(self, conanfile, win_bash=False, include_rpath_flags=False) # FIXME: include_rpa... | [
{
"cid": "conans/client/build/autotools_environment.py::AutoToolsBuildEnvironment.__init__",
"text": "conans/client/build/autotools_environment.py::AutoToolsBuildEnvironment.__init__\n def __init__(self, conanfile, win_bash=False, include_rpath_flags=False):\n \"\"\"\n FIXME: include_rpath_... |
Lightning-AI__lightning-941 | Lightning-AI/lightning | train | Support stepping options for lr scheduler
Currently schedulers get called every epoch. Sometimes though, we want them to be called every step.
Proposal 1:
Allow configure_optimizers to return this:
```python
return Adam, {'scheduler': LRScheduler, 'interval': 'batch|epoch'}
```
@ethanwharris @Borda thought... | [
"pytorch_lightning/core/lightning.py",
"pytorch_lightning/trainer/trainer.py",
"pytorch_lightning/trainer/training_io.py",
"pytorch_lightning/trainer/training_loop.py"
] | [
"pytorch_lightning/core/lightning.py::LightningModule.configure_optimizers",
"pytorch_lightning/trainer/trainer.py::<module>",
"pytorch_lightning/trainer/trainer.py::Trainer.__init__",
"pytorch_lightning/trainer/trainer.py::Trainer.configure_schedulers",
"pytorch_lightning/trainer/trainer.py::Trainer.init_o... | [
{
"cid": "pl_examples/basic_examples/lightning_module_template.py",
"text": "pl_examples/basic_examples/lightning_module_template.py\nclass LightningTemplateModel # Sample model to show how to define a template\n def __init__(self, hparams) # Pass in parsed HyperOptArgumentParser to the model\n def ... | [
{
"cid": "pl_examples/basic_examples/lightning_module_template.py::LightningTemplateModel.__init__",
"text": "pl_examples/basic_examples/lightning_module_template.py::LightningTemplateModel.__init__\n def __init__(self, hparams):\n \"\"\"\n Pass in parsed HyperOptArgumentParser to the model... |
PrefectHQ__prefect-1386 | PrefectHQ/prefect | train | `auth login` CLI check needs token required query
## Description
`prefect auth login` runs a graphql query to verify the token provided is valid. The current query is `query { hello }` and this query does not require authentication. This query needs to be updated to one which requires authentication (which is every ot... | [
"src/prefect/cli/auth.py"
] | [
"src/prefect/cli/auth.py::login"
] | [
{
"cid": "src/prefect/agent/agent.py",
"text": "src/prefect/agent/agent.py\nclass Agent # Base class for Agents.\n def __init__(self)\n def start(self) # The main entrypoint to the agent. This function loops and constantly polls for\n def agent_connect(self) # Verify agent connection to Prefect ... | [
{
"cid": "src/prefect/agent/agent.py::Agent.__init__",
"text": "src/prefect/agent/agent.py::Agent.__init__\n def __init__(self) -> None:\n self.loop_interval = config.cloud.agent.get(\"loop_interval\")\n\n self.client = Client(token=config.cloud.agent.get(\"auth_token\"))\n\n logger ... |
docker__compose-3056 | docker/compose | train | Pyinstaller has issues with signals
There's a bunch of history in #1040 and #2055.
We've tried multiple implementations of signal handlers, but each has their own set of issues, but **ONLY** when run from the frozen binary created by pyinstaller.
It looks like there is a very old issue in pyinstaller around this: htt... | [
"compose/cli/main.py",
"compose/cli/multiplexer.py",
"compose/parallel.py"
] | [
"compose/cli/main.py::main",
"compose/cli/multiplexer.py::<module>",
"compose/cli/multiplexer.py::Multiplexer.loop",
"compose/parallel.py::<module>",
"compose/parallel.py::parallel_execute"
] | [
{
"cid": "compose/cli/docopt_command.py",
"text": "compose/cli/docopt_command.py\ndef docopt_full_help(docstring, *args, **kwargs)\nclass DocoptCommand\n def docopt_options(self)\n def sys_dispatch(self)\n def dispatch(self, argv, global_options)\n def parse(self, argv, global_options)\n def ... | [
{
"cid": "compose/cli/docopt_command.py::docopt_full_help",
"text": "compose/cli/docopt_command.py::docopt_full_help\ndef docopt_full_help(docstring, *args, **kwargs):\n try:\n return docopt(docstring, *args, **kwargs)\n except DocoptExit:\n raise SystemExit(docstring)",
"label": 0
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.