{ // 获取包含Hugging Face文本的span元素 const spans = link.querySelectorAll('span.whitespace-nowrap, span.hidden.whitespace-nowrap'); spans.forEach(span => { if (span.textContent && span.textContent.trim().match(/Hugging\s*Face/i)) { span.textContent = 'AI快站'; } }); }); // 替换logo图片的alt属性 document.querySelectorAll('img[alt*="Hugging"], img[alt*="Face"]').forEach(img => { if (img.alt.match(/Hugging\s*Face/i)) { img.alt = 'AI快站 logo'; } }); } // 替换导航栏中的链接 function replaceNavigationLinks() { // 已替换标记,防止重复运行 if (window._navLinksReplaced) { return; } // 已经替换过的链接集合,防止重复替换 const replacedLinks = new Set(); // 只在导航栏区域查找和替换链接 const headerArea = document.querySelector('header') || document.querySelector('nav'); if (!headerArea) { return; } // 在导航区域内查找链接 const navLinks = headerArea.querySelectorAll('a'); navLinks.forEach(link => { // 如果已经替换过,跳过 if (replacedLinks.has(link)) return; const linkText = link.textContent.trim(); const linkHref = link.getAttribute('href') || ''; // 替换Spaces链接 - 仅替换一次 if ( (linkHref.includes('/spaces') || linkHref === '/spaces' || linkText === 'Spaces' || linkText.match(/^s*Spacess*$/i)) && linkText !== 'OCR模型免费转Markdown' && linkText !== 'OCR模型免费转Markdown' ) { link.textContent = 'OCR模型免费转Markdown'; link.href = 'https://fast360.xyz'; link.setAttribute('target', '_blank'); link.setAttribute('rel', 'noopener noreferrer'); replacedLinks.add(link); } // 删除Posts链接 else if ( (linkHref.includes('/posts') || linkHref === '/posts' || linkText === 'Posts' || linkText.match(/^s*Postss*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } // 替换Docs链接 - 仅替换一次 else if ( (linkHref.includes('/docs') || linkHref === '/docs' || linkText === 'Docs' || linkText.match(/^s*Docss*$/i)) && linkText !== '模型下载攻略' ) { link.textContent = '模型下载攻略'; link.href = '/'; replacedLinks.add(link); } // 删除Enterprise链接 else if ( (linkHref.includes('/enterprise') || linkHref === '/enterprise' || linkText === 'Enterprise' || linkText.match(/^s*Enterprises*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } }); // 查找可能嵌套的Spaces和Posts文本 const textNodes = []; function findTextNodes(element) { if (element.nodeType === Node.TEXT_NODE) { const text = element.textContent.trim(); if (text === 'Spaces' || text === 'Posts' || text === 'Enterprise') { textNodes.push(element); } } else { for (const child of element.childNodes) { findTextNodes(child); } } } // 只在导航区域内查找文本节点 findTextNodes(headerArea); // 替换找到的文本节点 textNodes.forEach(node => { const text = node.textContent.trim(); if (text === 'Spaces') { node.textContent = node.textContent.replace(/Spaces/g, 'OCR模型免费转Markdown'); } else if (text === 'Posts') { // 删除Posts文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } else if (text === 'Enterprise') { // 删除Enterprise文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } }); // 标记已替换完成 window._navLinksReplaced = true; } // 替换代码区域中的域名 function replaceCodeDomains() { // 特别处理span.hljs-string和span.njs-string元素 document.querySelectorAll('span.hljs-string, span.njs-string, span[class*="hljs-string"], span[class*="njs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换hljs-string类的span中的域名(移除多余的转义符号) document.querySelectorAll('span.hljs-string, span[class*="hljs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换pre和code标签中包含git clone命令的域名 document.querySelectorAll('pre, code').forEach(element => { if (element.textContent && element.textContent.includes('git clone')) { const text = element.innerHTML; if (text.includes('huggingface.co')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 处理特定的命令行示例 document.querySelectorAll('pre, code').forEach(element => { const text = element.innerHTML; if (text.includes('huggingface.co')) { // 针对git clone命令的专门处理 if (text.includes('git clone') || text.includes('GIT_LFS_SKIP_SMUDGE=1')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 特别处理模型下载页面上的代码片段 document.querySelectorAll('.flex.border-t, .svelte_hydrator, .inline-block').forEach(container => { const content = container.innerHTML; if (content && content.includes('huggingface.co')) { container.innerHTML = content.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 特别处理模型仓库克隆对话框中的代码片段 try { // 查找包含"Clone this model repository"标题的对话框 const cloneDialog = document.querySelector('.svelte_hydration_boundary, [data-target="MainHeader"]'); if (cloneDialog) { // 查找对话框中所有的代码片段和命令示例 const codeElements = cloneDialog.querySelectorAll('pre, code, span'); codeElements.forEach(element => { if (element.textContent && element.textContent.includes('huggingface.co')) { if (element.innerHTML.includes('huggingface.co')) { element.innerHTML = element.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { element.textContent = element.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); } // 更精确地定位克隆命令中的域名 document.querySelectorAll('[data-target]').forEach(container => { const codeBlocks = container.querySelectorAll('pre, code, span.hljs-string'); codeBlocks.forEach(block => { if (block.textContent && block.textContent.includes('huggingface.co')) { if (block.innerHTML.includes('huggingface.co')) { block.innerHTML = block.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { block.textContent = block.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); }); } catch (e) { // 错误处理但不打印日志 } } // 当DOM加载完成后执行替换 if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', () => { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); }); } else { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); } // 增加一个MutationObserver来处理可能的动态元素加载 const observer = new MutationObserver(mutations => { // 检查是否导航区域有变化 const hasNavChanges = mutations.some(mutation => { // 检查是否存在header或nav元素变化 return Array.from(mutation.addedNodes).some(node => { if (node.nodeType === Node.ELEMENT_NODE) { // 检查是否是导航元素或其子元素 if (node.tagName === 'HEADER' || node.tagName === 'NAV' || node.querySelector('header, nav')) { return true; } // 检查是否在导航元素内部 let parent = node.parentElement; while (parent) { if (parent.tagName === 'HEADER' || parent.tagName === 'NAV') { return true; } parent = parent.parentElement; } } return false; }); }); // 只在导航区域有变化时执行替换 if (hasNavChanges) { // 重置替换状态,允许再次替换 window._navLinksReplaced = false; replaceHeaderBranding(); replaceNavigationLinks(); } }); // 开始观察document.body的变化,包括子节点 if (document.body) { observer.observe(document.body, { childList: true, subtree: true }); } else { document.addEventListener('DOMContentLoaded', () => { observer.observe(document.body, { childList: true, subtree: true }); }); } })(); '\r\n```\r\n\r\nThis results in a corrupted file, as the HTTP response from the 302 redirect is written to the destination file via the callback.\r\n\r\nIt's entirely possible that I am doing something wrong, but this looks like a bug. I can conceive of no way to reliably determine that the callback is being executed on a 302 redirect response, since the raw data from the chunk of the file is what is passed to the callback function, leaving nothing from the HTTPResponse object to be examined in order to determine whether or not to write the chunk to the destination file."},"repo":{"kind":"string","value":"tornadoweb/tornado"},"test_patch":{"kind":"string","value":"diff --git a/tornado/test/httpclient_test.py b/tornado/test/httpclient_test.py\nindex ecc63e4a..6254c266 100644\n--- a/tornado/test/httpclient_test.py\n+++ b/tornado/test/httpclient_test.py\n@@ -48,6 +48,7 @@ class PutHandler(RequestHandler):\n \n class RedirectHandler(RequestHandler):\n def prepare(self):\n+ self.write('redirects can have bodies too')\n self.redirect(self.get_argument(\"url\"),\n status=int(self.get_argument(\"status\", \"302\")))\n \ndiff --git a/tornado/test/simple_httpclient_test.py b/tornado/test/simple_httpclient_test.py\nindex dc4c865b..5214c1e4 100644\n--- a/tornado/test/simple_httpclient_test.py\n+++ b/tornado/test/simple_httpclient_test.py\n@@ -11,14 +11,15 @@ import socket\n import ssl\n import sys\n \n+from tornado.escape import to_unicode\n from tornado import gen\n from tornado.httpclient import AsyncHTTPClient\n from tornado.httputil import HTTPHeaders, ResponseStartLine\n from tornado.ioloop import IOLoop\n from tornado.log import gen_log\n from tornado.netutil import Resolver, bind_sockets\n-from tornado.simple_httpclient import SimpleAsyncHTTPClient, _default_ca_certs\n-from tornado.test.httpclient_test import ChunkHandler, CountdownHandler, HelloWorldHandler\n+from tornado.simple_httpclient import SimpleAsyncHTTPClient\n+from tornado.test.httpclient_test import ChunkHandler, CountdownHandler, HelloWorldHandler, RedirectHandler\n from tornado.test import httpclient_test\n from tornado.testing import AsyncHTTPTestCase, AsyncHTTPSTestCase, AsyncTestCase, ExpectLog\n from tornado.test.util import skipOnTravis, skipIfNoIPv6, refusing_port, unittest\n@@ -145,6 +146,7 @@ class SimpleHTTPClientTestMixin(object):\n url(\"/no_content_length\", NoContentLengthHandler),\n url(\"/echo_post\", EchoPostHandler),\n url(\"/respond_in_prepare\", RespondInPrepareHandler),\n+ url(\"/redirect\", RedirectHandler),\n ], gzip=True)\n \n def test_singleton(self):\n@@ -416,6 +418,24 @@ class SimpleHTTPClientTestMixin(object):\n expect_100_continue=True)\n self.assertEqual(response.code, 403)\n \n+ def test_streaming_follow_redirects(self):\n+ # When following redirects, header and streaming callbacks\n+ # should only be called for the final result.\n+ # TODO(bdarnell): this test belongs in httpclient_test instead of\n+ # simple_httpclient_test, but it fails with the version of libcurl\n+ # available on travis-ci. Move it when that has been upgraded\n+ # or we have a better framework to skip tests based on curl version.\n+ headers = []\n+ chunks = []\n+ self.fetch(\"/redirect?url=/hello\",\n+ header_callback=headers.append,\n+ streaming_callback=chunks.append)\n+ chunks = list(map(to_unicode, chunks))\n+ self.assertEqual(chunks, ['Hello world!'])\n+ # Make sure we only got one set of headers.\n+ num_start_lines = len([h for h in headers if h.startswith(\"HTTP/\")])\n+ self.assertEqual(num_start_lines, 1)\n+\n \n class SimpleHTTPClientTestCase(SimpleHTTPClientTestMixin, AsyncHTTPTestCase):\n def setUp(self):\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_hyperlinks\",\n \"has_many_modified_files\",\n \"has_many_hunks\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 2,\n \"issue_text_score\": 0,\n \"test_score\": 0\n },\n \"num_modified_files\": 3\n}"},"version":{"kind":"string","value":"4.2"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"pytest\",\n \"pip_packages\": [\n \"futures\",\n \"mock\",\n \"monotonic\",\n \"trollius\",\n \"pytest\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\n \"python\": \"3.5\",\n \"reqs_path\": null,\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work\ncertifi==2021.5.30\nfutures==2.2.0\nimportlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1631916693255/work\niniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work\nmock==5.2.0\nmonotonic==1.6\nmore-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work\npackaging @ file:///tmp/build/80754af9/packaging_1637314298585/work\npluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work\npy @ file:///opt/conda/conda-bld/py_1644396412707/work\npyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work\npytest==6.2.4\nsix==1.17.0\ntoml @ file:///tmp/build/80754af9/toml_1616166611790/work\n-e git+https://github.com/tornadoweb/tornado.git@7493c94369299020eda0d452e7dda793073b7f63#egg=tornado\ntrollius==2.1.post2\ntyping_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work\nzipp @ file:///tmp/build/80754af9/zipp_1633618647012/work\n"},"environment":{"kind":"string","value":"name: tornado\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - attrs=21.4.0=pyhd3eb1b0_0\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2021.5.30=py36h06a4308_0\n - importlib-metadata=4.8.1=py36h06a4308_0\n - importlib_metadata=4.8.1=hd3eb1b0_0\n - iniconfig=1.1.1=pyhd3eb1b0_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.3=he6710b0_2\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - more-itertools=8.12.0=pyhd3eb1b0_0\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - packaging=21.3=pyhd3eb1b0_0\n - pip=21.2.2=py36h06a4308_0\n - pluggy=0.13.1=py36h06a4308_0\n - py=1.11.0=pyhd3eb1b0_0\n - pyparsing=3.0.4=pyhd3eb1b0_0\n - pytest=6.2.4=py36h06a4308_2\n - python=3.6.13=h12debd9_1\n - readline=8.2=h5eee18b_0\n - setuptools=58.0.4=py36h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - toml=0.10.2=pyhd3eb1b0_0\n - typing_extensions=4.1.1=pyh06a4308_0\n - wheel=0.37.1=pyhd3eb1b0_0\n - xz=5.6.4=h5eee18b_1\n - zipp=3.6.0=pyhd3eb1b0_0\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - futures==2.2.0\n - mock==5.2.0\n - monotonic==1.6\n - six==1.17.0\n - trollius==2.1.post2\nprefix: /opt/conda/envs/tornado\n"},"FAIL_TO_PASS":{"kind":"list like","value":["tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_streaming_follow_redirects","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_streaming_follow_redirects"],"string":"[\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_streaming_follow_redirects\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_streaming_follow_redirects\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":["tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_no_content","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_no_content","tornado/test/simple_httpclient_test.py::MaxHeaderSizeTest::test_large_headers","tornado/test/simple_httpclient_test.py::MaxBodySizeTest::test_large_body"],"string":"[\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_no_content\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_no_content\",\n \"tornado/test/simple_httpclient_test.py::MaxHeaderSizeTest::test_large_headers\",\n \"tornado/test/simple_httpclient_test.py::MaxBodySizeTest::test_large_body\"\n]"},"PASS_TO_PASS":{"kind":"list like","value":["tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_304_with_content_length","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_all_methods","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_basic_auth","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_basic_auth_explicit_mode","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_body_encoding","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_body_sanity_checks","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_chunked","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_chunked_close","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_configure_defaults","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_credentials_in_url","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_final_callback_stack_context","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_follow_redirect","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_future_http_error","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_future_http_error_no_raise","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_future_interface","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_header_callback","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_header_callback_stack_context","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_header_types","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_hello_world","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_patch_receives_payload","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_post","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_put_307","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_reuse_request_from_response","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_streaming_callback","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_streaming_stack_context","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_types","tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_unsupported_auth_mode","tornado/test/httpclient_test.py::RequestProxyTest::test_bad_attribute","tornado/test/httpclient_test.py::RequestProxyTest::test_both_set","tornado/test/httpclient_test.py::RequestProxyTest::test_default_set","tornado/test/httpclient_test.py::RequestProxyTest::test_defaults_none","tornado/test/httpclient_test.py::RequestProxyTest::test_neither_set","tornado/test/httpclient_test.py::RequestProxyTest::test_request_set","tornado/test/httpclient_test.py::HTTPResponseTestCase::test_str","tornado/test/httpclient_test.py::SyncHTTPClientTest::test_sync_client","tornado/test/httpclient_test.py::SyncHTTPClientTest::test_sync_client_error","tornado/test/httpclient_test.py::HTTPRequestTestCase::test_body","tornado/test/httpclient_test.py::HTTPRequestTestCase::test_body_setter","tornado/test/httpclient_test.py::HTTPRequestTestCase::test_headers","tornado/test/httpclient_test.py::HTTPRequestTestCase::test_headers_setter","tornado/test/httpclient_test.py::HTTPRequestTestCase::test_if_modified_since","tornado/test/httpclient_test.py::HTTPRequestTestCase::test_null_headers_setter","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_304_with_content_length","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_all_methods","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_basic_auth","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_basic_auth_explicit_mode","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_body_encoding","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_body_sanity_checks","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_chunked","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_chunked_close","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_configure_defaults","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_credentials_in_url","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_final_callback_stack_context","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_follow_redirect","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_future_http_error","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_future_http_error_no_raise","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_future_interface","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_header_callback","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_header_callback_stack_context","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_header_types","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_hello_world","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_patch_receives_payload","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_post","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_put_307","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_reuse_request_from_response","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_streaming_callback","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_streaming_stack_context","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_types","tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_unsupported_auth_mode","tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_100_continue","tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_100_continue_early_response","tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_async_body_producer_chunked","tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_async_body_producer_content_length","tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_connection_limit","tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_connection_refused","tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_gzip","tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_head_request","tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_header_reuse","tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_host_header","tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_ipv6","tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_max_redirects","tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_no_content_length","tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_options_request","tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_queue_timeout","tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_redirect_connection_limit","tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_request_timeout","tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_see_other_redirect","tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_singleton","tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_sync_body_producer_chunked","tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_sync_body_producer_content_length","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_100_continue","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_100_continue_early_response","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_async_body_producer_chunked","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_async_body_producer_content_length","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_connection_limit","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_connection_refused","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_error_logging","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_gzip","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_head_request","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_header_reuse","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_host_header","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_ipv6","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_max_redirects","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_no_content_length","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_options_request","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_queue_timeout","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_redirect_connection_limit","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_request_timeout","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_see_other_redirect","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_singleton","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_ssl_context","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_ssl_context_handshake_fail","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_ssl_options","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_ssl_options_handshake_fail","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_sync_body_producer_chunked","tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_sync_body_producer_content_length","tornado/test/simple_httpclient_test.py::CreateAsyncHTTPClientTestCase::test_max_clients","tornado/test/simple_httpclient_test.py::HTTP100ContinueTestCase::test_100_continue","tornado/test/simple_httpclient_test.py::HTTP204NoContentTestCase::test_204_no_content","tornado/test/simple_httpclient_test.py::HostnameMappingTestCase::test_hostname_mapping","tornado/test/simple_httpclient_test.py::HostnameMappingTestCase::test_port_mapping","tornado/test/simple_httpclient_test.py::ResolveTimeoutTestCase::test_resolve_timeout","tornado/test/simple_httpclient_test.py::MaxHeaderSizeTest::test_small_headers","tornado/test/simple_httpclient_test.py::MaxBodySizeTest::test_small_body","tornado/test/simple_httpclient_test.py::MaxBufferSizeTest::test_large_body"],"string":"[\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_304_with_content_length\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_all_methods\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_basic_auth\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_basic_auth_explicit_mode\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_body_encoding\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_body_sanity_checks\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_chunked\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_chunked_close\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_configure_defaults\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_credentials_in_url\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_final_callback_stack_context\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_follow_redirect\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_future_http_error\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_future_http_error_no_raise\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_future_interface\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_header_callback\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_header_callback_stack_context\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_header_types\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_hello_world\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_patch_receives_payload\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_post\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_put_307\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_reuse_request_from_response\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_streaming_callback\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_streaming_stack_context\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_types\",\n \"tornado/test/httpclient_test.py::HTTPClientCommonTestCase::test_unsupported_auth_mode\",\n \"tornado/test/httpclient_test.py::RequestProxyTest::test_bad_attribute\",\n \"tornado/test/httpclient_test.py::RequestProxyTest::test_both_set\",\n \"tornado/test/httpclient_test.py::RequestProxyTest::test_default_set\",\n \"tornado/test/httpclient_test.py::RequestProxyTest::test_defaults_none\",\n \"tornado/test/httpclient_test.py::RequestProxyTest::test_neither_set\",\n \"tornado/test/httpclient_test.py::RequestProxyTest::test_request_set\",\n \"tornado/test/httpclient_test.py::HTTPResponseTestCase::test_str\",\n \"tornado/test/httpclient_test.py::SyncHTTPClientTest::test_sync_client\",\n \"tornado/test/httpclient_test.py::SyncHTTPClientTest::test_sync_client_error\",\n \"tornado/test/httpclient_test.py::HTTPRequestTestCase::test_body\",\n \"tornado/test/httpclient_test.py::HTTPRequestTestCase::test_body_setter\",\n \"tornado/test/httpclient_test.py::HTTPRequestTestCase::test_headers\",\n \"tornado/test/httpclient_test.py::HTTPRequestTestCase::test_headers_setter\",\n \"tornado/test/httpclient_test.py::HTTPRequestTestCase::test_if_modified_since\",\n \"tornado/test/httpclient_test.py::HTTPRequestTestCase::test_null_headers_setter\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_304_with_content_length\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_all_methods\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_basic_auth\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_basic_auth_explicit_mode\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_body_encoding\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_body_sanity_checks\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_chunked\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_chunked_close\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_configure_defaults\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_credentials_in_url\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_final_callback_stack_context\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_follow_redirect\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_future_http_error\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_future_http_error_no_raise\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_future_interface\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_header_callback\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_header_callback_stack_context\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_header_types\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_hello_world\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_patch_receives_payload\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_post\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_put_307\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_reuse_request_from_response\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_streaming_callback\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_streaming_stack_context\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_types\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientCommonTestCase::test_unsupported_auth_mode\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_100_continue\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_100_continue_early_response\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_async_body_producer_chunked\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_async_body_producer_content_length\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_connection_limit\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_connection_refused\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_gzip\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_head_request\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_header_reuse\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_host_header\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_ipv6\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_max_redirects\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_no_content_length\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_options_request\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_queue_timeout\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_redirect_connection_limit\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_request_timeout\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_see_other_redirect\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_singleton\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_sync_body_producer_chunked\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPClientTestCase::test_sync_body_producer_content_length\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_100_continue\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_100_continue_early_response\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_async_body_producer_chunked\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_async_body_producer_content_length\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_connection_limit\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_connection_refused\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_error_logging\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_gzip\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_head_request\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_header_reuse\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_host_header\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_ipv6\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_max_redirects\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_no_content_length\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_options_request\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_queue_timeout\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_redirect_connection_limit\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_request_timeout\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_see_other_redirect\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_singleton\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_ssl_context\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_ssl_context_handshake_fail\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_ssl_options\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_ssl_options_handshake_fail\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_sync_body_producer_chunked\",\n \"tornado/test/simple_httpclient_test.py::SimpleHTTPSClientTestCase::test_sync_body_producer_content_length\",\n \"tornado/test/simple_httpclient_test.py::CreateAsyncHTTPClientTestCase::test_max_clients\",\n \"tornado/test/simple_httpclient_test.py::HTTP100ContinueTestCase::test_100_continue\",\n \"tornado/test/simple_httpclient_test.py::HTTP204NoContentTestCase::test_204_no_content\",\n \"tornado/test/simple_httpclient_test.py::HostnameMappingTestCase::test_hostname_mapping\",\n \"tornado/test/simple_httpclient_test.py::HostnameMappingTestCase::test_port_mapping\",\n \"tornado/test/simple_httpclient_test.py::ResolveTimeoutTestCase::test_resolve_timeout\",\n \"tornado/test/simple_httpclient_test.py::MaxHeaderSizeTest::test_small_headers\",\n \"tornado/test/simple_httpclient_test.py::MaxBodySizeTest::test_small_body\",\n \"tornado/test/simple_httpclient_test.py::MaxBufferSizeTest::test_large_body\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"Apache License 2.0"},"__index_level_0__":{"kind":"number","value":252,"string":"252"}}},{"rowIdx":253,"cells":{"instance_id":{"kind":"string","value":"pypa__twine-134"},"base_commit":{"kind":"string","value":"b34f042da78aed22b6e512df61b495638b06ba03"},"created_at":{"kind":"string","value":"2015-09-27 21:52:01"},"environment_setup_commit":{"kind":"string","value":"f487b7da9c42e4932bc33bf10d70cdc59fd16fd5"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/twine/commands/upload.py b/twine/commands/upload.py\nindex 032cc21..2bd4a52 100644\n--- a/twine/commands/upload.py\n+++ b/twine/commands/upload.py\n@@ -67,11 +67,13 @@ def upload(dists, repository, sign, identity, username, password, comment,\n if not sign and identity:\n raise ValueError(\"sign must be given along with identity\")\n \n+ dists = find_dists(dists)\n+\n # Determine if the user has passed in pre-signed distributions\n signatures = dict(\n (os.path.basename(d), d) for d in dists if d.endswith(\".asc\")\n )\n- dists = [i for i in dists if not i.endswith(\".asc\")]\n+ uploads = [i for i in dists if not i.endswith(\".asc\")]\n \n config = utils.get_repository_from_config(config_file, repository)\n \n@@ -86,24 +88,14 @@ def upload(dists, repository, sign, identity, username, password, comment,\n \n repository = Repository(config[\"repository\"], username, password)\n \n- uploads = find_dists(dists)\n-\n for filename in uploads:\n package = PackageFile.from_filename(filename, comment)\n- # Sign the dist if requested\n- # if sign:\n- # sign_file(sign_with, filename, identity)\n \n- # signed_name = os.path.basename(filename) + \".asc\"\n- signed_name = package.signed_filename\n+ signed_name = package.signed_basefilename\n if signed_name in signatures:\n- with open(signatures[signed_name], \"rb\") as gpg:\n- package.gpg_signature = (signed_name, gpg.read())\n- # data[\"gpg_signature\"] = (signed_name, gpg.read())\n+ package.add_gpg_signature(signatures[signed_name], signed_name)\n elif sign:\n package.sign(sign_with, identity)\n- # with open(filename + \".asc\", \"rb\") as gpg:\n- # data[\"gpg_signature\"] = (signed_name, gpg.read())\n \n resp = repository.upload(package)\n \ndiff --git a/twine/package.py b/twine/package.py\nindex e80116a..e062c71 100644\n--- a/twine/package.py\n+++ b/twine/package.py\n@@ -49,6 +49,7 @@ class PackageFile(object):\n self.filetype = filetype\n self.safe_name = pkg_resources.safe_name(metadata.name)\n self.signed_filename = self.filename + '.asc'\n+ self.signed_basefilename = self.basefilename + '.asc'\n self.gpg_signature = None\n \n md5_hash = hashlib.md5()\n@@ -141,6 +142,13 @@ class PackageFile(object):\n \n return data\n \n+ def add_gpg_signature(self, signature_filepath, signature_filename):\n+ if self.gpg_signature is not None:\n+ raise ValueError('GPG Signature can only be added once')\n+\n+ with open(signature_filepath, \"rb\") as gpg:\n+ self.gpg_signature = (signature_filename, gpg.read())\n+\n def sign(self, sign_with, identity):\n print(\"Signing {0}\".format(self.basefilename))\n gpg_args = (sign_with, \"--detach-sign\")\n@@ -149,5 +157,4 @@ class PackageFile(object):\n gpg_args += (\"-a\", self.filename)\n subprocess.check_call(gpg_args)\n \n- with open(self.signed_filename, \"rb\") as gpg:\n- self.pg_signature = (self.signed_filename, gpg.read())\n+ self.add_gpg_signature(self.signed_filename, self.signed_basefilename)\n"},"problem_statement":{"kind":"string","value":"\"twine upload\" usually fails to upload .asc files\nOn the most recent Foolscap release, I signed the sdist tarballs as usual, and tried to use twine to upload everything:\r\n\r\n```\r\n% python setup.py sdist --formats=zip,gztar bdist_wheel\r\n% ls dist\r\nfoolscap-0.9.1-py2-none-any.whl\t\tfoolscap-0.9.1.tar.gz\t\t\tfoolscap-0.9.1.zip\r\n% (gpg sign them all)\r\n% ls dist\r\nfoolscap-0.9.1-py2-none-any.whl\t\tfoolscap-0.9.1.tar.gz\t\t\tfoolscap-0.9.1.zip\r\nfoolscap-0.9.1-py2-none-any.whl.asc\tfoolscap-0.9.1.tar.gz.asc\t\tfoolscap-0.9.1.zip.asc\r\n% python setup.py register\r\n% twine upload dist/*\r\n```\r\n\r\nTwine uploaded the tar/zip/whl files, but ignored the .asc signatures, and the resulting [pypi page](https://pypi.python.org/pypi/foolscap/0.9.1) doesn't show them either.\r\n\r\nAfter some digging, I found that `twine/upload.py upload()` will only use pre-signed .asc files if the command was run like `cd dist; twine upload *`. It won't use them if it was run as `cd dist; twine upload ./*` or `twine upload dist/*`. The problem seems to be that the `signatures` dictionary is indexed by the basename of the signature files, while the lookup key is using the full (original) filename of the tarball/etc with \".asc\" appended.\r\n\r\nI think it might be simpler and safer to have the code just check for a neighboring .asc file inside the upload loop, something like:\r\n\r\n```python\r\nfor filename in uploads:\r\n package = PackageFile.from_filename(filename, comment)\r\n maybe_sig = package.signed_filename + \".asc\"\r\n if os.path.exists(maybe_sig):\r\n package.gpg_signature = (os.path.basename(maybe_sig), sigdata)\r\n ...\r\n```\r\n\r\nI'll write up a patch for this. I started to look for a way of adding a test, but the code that looks for signatures happens deep enough in `upload()` that it'd need a oversized mock \"Repository\" class to exercise the .asc check without actually uploading anything. I'm not sure what the best way to approach the test would be.\r\n"},"repo":{"kind":"string","value":"pypa/twine"},"test_patch":{"kind":"string","value":"diff --git a/tests/test_package.py b/tests/test_package.py\nindex fcc827a..d28eec1 100644\n--- a/tests/test_package.py\n+++ b/tests/test_package.py\n@@ -55,3 +55,18 @@ def test_sign_file_with_identity(monkeypatch):\n pass\n args = ('gpg', '--detach-sign', '--local-user', 'identity', '-a', filename)\n assert replaced_check_call.calls == [pretend.call(args)]\n+\n+\n+def test_package_signed_name_is_correct():\n+ filename = 'tests/fixtures/deprecated-pypirc'\n+\n+ pkg = package.PackageFile(\n+ filename=filename,\n+ comment=None,\n+ metadata=pretend.stub(name=\"deprecated-pypirc\"),\n+ python_version=None,\n+ filetype=None\n+ )\n+\n+ assert pkg.signed_basefilename == \"deprecated-pypirc.asc\"\n+ assert pkg.signed_filename == (filename + '.asc')\ndiff --git a/tests/test_upload.py b/tests/test_upload.py\nindex b40660f..7f99510 100644\n--- a/tests/test_upload.py\n+++ b/tests/test_upload.py\n@@ -66,6 +66,7 @@ def test_find_dists_handles_real_files():\n \n def test_get_config_old_format(tmpdir):\n pypirc = os.path.join(str(tmpdir), \".pypirc\")\n+ dists = [\"tests/fixtures/twine-1.5.0-py2.py3-none-any.whl\"]\n \n with open(pypirc, \"w\") as fp:\n fp.write(textwrap.dedent(\"\"\"\n@@ -75,7 +76,7 @@ def test_get_config_old_format(tmpdir):\n \"\"\"))\n \n try:\n- upload.upload(dists=\"foo\", repository=\"pypi\", sign=None, identity=None,\n+ upload.upload(dists=dists, repository=\"pypi\", sign=None, identity=None,\n username=None, password=None, comment=None,\n sign_with=None, config_file=pypirc, skip_existing=False)\n except KeyError as err:\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_hyperlinks\",\n \"has_many_modified_files\",\n \"has_many_hunks\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 1,\n \"issue_text_score\": 1,\n \"test_score\": 3\n },\n \"num_modified_files\": 2\n}"},"version":{"kind":"string","value":"1.6"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"pytest\",\n \"pip_packages\": [\n \"pytest\",\n \"coverage\",\n \"pretend\",\n \"flake8\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\n \"python\": \"3.9\",\n \"reqs_path\": null,\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"certifi==2025.1.31\ncharset-normalizer==3.4.1\ncoverage==7.8.0\nexceptiongroup @ file:///croot/exceptiongroup_1706031385326/work\nflake8==7.2.0\nidna==3.10\niniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work\nmccabe==0.7.0\npackaging @ file:///croot/packaging_1734472117206/work\npkginfo==1.12.1.2\npluggy @ file:///croot/pluggy_1733169602837/work\npretend==1.0.9\npycodestyle==2.13.0\npyflakes==3.3.1\npytest @ file:///croot/pytest_1738938843180/work\nrequests==2.32.3\nrequests-toolbelt==1.0.0\ntomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work\n-e git+https://github.com/pypa/twine.git@b34f042da78aed22b6e512df61b495638b06ba03#egg=twine\nurllib3==2.3.0\n"},"environment":{"kind":"string","value":"name: twine\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - ca-certificates=2025.2.25=h06a4308_0\n - exceptiongroup=1.2.0=py39h06a4308_0\n - iniconfig=1.1.1=pyhd3eb1b0_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.4.4=h6a678d5_1\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=3.0.16=h5eee18b_0\n - packaging=24.2=py39h06a4308_0\n - pip=25.0=py39h06a4308_0\n - pluggy=1.5.0=py39h06a4308_0\n - pytest=8.3.4=py39h06a4308_0\n - python=3.9.21=he870216_1\n - readline=8.2=h5eee18b_0\n - setuptools=75.8.0=py39h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - tomli=2.0.1=py39h06a4308_0\n - tzdata=2025a=h04d1e81_0\n - wheel=0.45.1=py39h06a4308_0\n - xz=5.6.4=h5eee18b_1\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - certifi==2025.1.31\n - charset-normalizer==3.4.1\n - coverage==7.8.0\n - flake8==7.2.0\n - idna==3.10\n - mccabe==0.7.0\n - pkginfo==1.12.1.2\n - pretend==1.0.9\n - pycodestyle==2.13.0\n - pyflakes==3.3.1\n - requests==2.32.3\n - requests-toolbelt==1.0.0\n - urllib3==2.3.0\nprefix: /opt/conda/envs/twine\n"},"FAIL_TO_PASS":{"kind":"list like","value":["tests/test_package.py::test_package_signed_name_is_correct"],"string":"[\n \"tests/test_package.py::test_package_signed_name_is_correct\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["tests/test_package.py::test_sign_file","tests/test_package.py::test_sign_file_with_identity","tests/test_upload.py::test_ensure_wheel_files_uploaded_first","tests/test_upload.py::test_ensure_if_no_wheel_files","tests/test_upload.py::test_find_dists_expands_globs","tests/test_upload.py::test_find_dists_errors_on_invalid_globs","tests/test_upload.py::test_find_dists_handles_real_files","tests/test_upload.py::test_get_config_old_format","tests/test_upload.py::test_skip_existing_skips_files_already_on_PyPI","tests/test_upload.py::test_skip_upload_respects_skip_existing"],"string":"[\n \"tests/test_package.py::test_sign_file\",\n \"tests/test_package.py::test_sign_file_with_identity\",\n \"tests/test_upload.py::test_ensure_wheel_files_uploaded_first\",\n \"tests/test_upload.py::test_ensure_if_no_wheel_files\",\n \"tests/test_upload.py::test_find_dists_expands_globs\",\n \"tests/test_upload.py::test_find_dists_errors_on_invalid_globs\",\n \"tests/test_upload.py::test_find_dists_handles_real_files\",\n \"tests/test_upload.py::test_get_config_old_format\",\n \"tests/test_upload.py::test_skip_existing_skips_files_already_on_PyPI\",\n \"tests/test_upload.py::test_skip_upload_respects_skip_existing\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"Apache License 2.0"},"__index_level_0__":{"kind":"number","value":253,"string":"253"}}},{"rowIdx":254,"cells":{"instance_id":{"kind":"string","value":"twisted__tubes-26"},"base_commit":{"kind":"string","value":"71894325180c6337d257e457d96e85075a560020"},"created_at":{"kind":"string","value":"2015-09-28 08:11:28"},"environment_setup_commit":{"kind":"string","value":"71894325180c6337d257e457d96e85075a560020"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/docs/listings/echoflow.py b/docs/listings/echoflow.py\nindex beea5b3..d2f3c1a 100644\n--- a/docs/listings/echoflow.py\n+++ b/docs/listings/echoflow.py\n@@ -1,15 +1,18 @@\n-from tubes.protocol import factoryFromFlow\n+from tubes.protocol import flowFountFromEndpoint\n+from tubes.listening import Listener\n \n from twisted.internet.endpoints import serverFromString\n-from twisted.internet.defer import Deferred\n+from twisted.internet.defer import Deferred, inlineCallbacks\n \n-def echoFlow(fount, drain):\n- fount.flowTo(drain)\n+def echoFlow(flow):\n+ flow.fount.flowTo(flow.drain)\n \n+@inlineCallbacks\n def main(reactor, listenOn=\"stdio:\"):\n endpoint = serverFromString(reactor, listenOn)\n- endpoint.listen(factoryFromFlow(echoFlow))\n- return Deferred()\n+ flowFount = yield flowFountFromEndpoint(endpoint)\n+ flowFount.flowTo(Listener(echoFlow))\n+ yield Deferred()\n \n if __name__ == '__main__':\n from twisted.internet.task import react\ndiff --git a/docs/listings/echonetstrings.py b/docs/listings/echonetstrings.py\nindex bf05626..1287f0f 100644\n--- a/docs/listings/echonetstrings.py\n+++ b/docs/listings/echonetstrings.py\n@@ -1,17 +1,21 @@\n from tubes.tube import Tube\n from tubes.framing import stringsToNetstrings\n-from tubes.protocol import factoryFromFlow\n+from tubes.protocol import flowFountFromEndpoint\n+from tubes.listening import Listener\n+\n from twisted.internet.endpoints import TCP4ServerEndpoint\n-from twisted.internet.defer import Deferred\n+from twisted.internet.defer import inlineCallbacks, Deferred()\n \n-def echoTubeFactory(fount, drain):\n- return (fount.flowTo(Tube(stringsToNetstrings()))\n- .flowTo(drain))\n+def echoTubeFactory(flow):\n+ return (flow.fount.flowTo(Tube(stringsToNetstrings()))\n+ .flowTo(flow.drain))\n \n+@inlineCallbacks\n def main(reactor):\n endpoint = TCP4ServerEndpoint(reactor, 4321)\n- endpoint.listen(factoryFromFlow(echoTubeFactory))\n- return Deferred()\n+ flowFount = yield flowFountFromEndpoint(endpoint)\n+ flowFount.flowTo(Listener(echoTubeFactory))\n+ yield Deferred()\n \n if __name__ == '__main__':\n from twisted.internet.task import react\ndiff --git a/docs/listings/portforward.py b/docs/listings/portforward.py\nindex ec723dc..0941743 100644\n--- a/docs/listings/portforward.py\n+++ b/docs/listings/portforward.py\n@@ -1,21 +1,22 @@\n-import os\n+from tubes.protocol import flowFountFromEndpoint, flowFromEndpoint\n+from tubes.listening import Listener\n \n-from tubes.protocol import factoryFromFlow\n from twisted.internet.endpoints import serverFromString, clientFromString\n-from twisted.internet.defer import Deferred\n+from twisted.internet.defer import Deferred, inlineCallbacks\n \n+@inlineCallbacks\n def main(reactor, listen=\"tcp:4321\", connect=\"tcp:localhost:6543\"):\n clientEndpoint = clientFromString(reactor, connect)\n serverEndpoint = serverFromString(reactor, listen)\n \n- def incomingTubeFactory(listeningFount, listeningDrain):\n- def outgoingTubeFactory(connectingFount, connectingDrain):\n- listeningFount.flowTo(connectingDrain)\n- connectingFount.flowTo(listeningDrain)\n- clientEndpoint.connect(factoryFromFlow(outgoingTubeFactory))\n-\n- serverEndpoint.listen(factoryFromFlow(incomingTubeFactory))\n- return Deferred()\n+ def incoming(listening):\n+ def outgoing(connecting):\n+ listening.fount.flowTo(connecting.drain)\n+ connecting.fount.flowTo(listening.drain)\n+ flowFromEndpoint(clientEndpoint).addCallback(outgoing)\n+ flowFount = yield flowFountFromEndpoint(serverEndpoint)\n+ flowFount.flowTo(Listener(incoming))\n+ yield Deferred()\n \n if __name__ == '__main__':\n from twisted.internet.task import react\ndiff --git a/docs/listings/reversetube.py b/docs/listings/reversetube.py\nindex cf99b0c..4e9096b 100644\n--- a/docs/listings/reversetube.py\n+++ b/docs/listings/reversetube.py\n@@ -1,6 +1,8 @@\n-from tubes.protocol import factoryFromFlow\n from twisted.internet.endpoints import serverFromString\n-from twisted.internet.defer import Deferred\n+from twisted.internet.defer import Deferred, inlineCallbacks\n+\n+from tubes.protocol import flowFountFromEndpoint\n+from tubes.listening import Listener\n from tubes.tube import tube, series\n \n @tube\n@@ -8,15 +10,17 @@ class Reverser(object):\n def received(self, item):\n yield b\"\".join(reversed(item))\n \n-def reverseFlow(fount, drain):\n+def reverseFlow(flow):\n from tubes.framing import bytesToLines, linesToBytes\n lineReverser = series(bytesToLines(), Reverser(), linesToBytes())\n- fount.flowTo(lineReverser).flowTo(drain)\n+ flow.fount.flowTo(lineReverser).flowTo(flow.drain)\n \n+@inlineCallbacks\n def main(reactor, listenOn=\"stdio:\"):\n endpoint = serverFromString(reactor, listenOn)\n- endpoint.listen(factoryFromFlow(reverseFlow))\n- return Deferred()\n+ flowFount = yield flowFountFromEndpoint(endpoint)\n+ flowFount.flowTo(Listener(reverseFlow))\n+ yield Deferred()\n \n if __name__ == '__main__':\n from twisted.internet.task import react\ndiff --git a/docs/listings/rpn.py b/docs/listings/rpn.py\nindex fe6f96c..697957e 100644\n--- a/docs/listings/rpn.py\n+++ b/docs/listings/rpn.py\n@@ -1,9 +1,10 @@\n-from tubes.protocol import factoryFromFlow\n from tubes.itube import IFrame, ISegment\n from tubes.tube import tube, receiver\n+from tubes.listening import Listener\n \n from twisted.internet.endpoints import serverFromString\n-from twisted.internet.defer import Deferred\n+from twisted.internet.defer import Deferred, inlineCallbacks\n+from tubes.protocol import flowFountFromEndpoint\n \n class Calculator(object):\n def __init__(self):\n@@ -79,15 +80,17 @@ def calculatorSeries():\n linesToBytes()\n )\n \n-def mathFlow(fount, drain):\n+def mathFlow(flow):\n processor = calculatorSeries()\n- nextDrain = fount.flowTo(processor)\n- nextDrain.flowTo(drain)\n+ nextDrain = flow.fount.flowTo(processor)\n+ nextDrain.flowTo(flow.drain)\n \n+@inlineCallbacks\n def main(reactor, port=\"stdio:\"):\n endpoint = serverFromString(reactor, port)\n- endpoint.listen(factoryFromFlow(mathFlow))\n- return Deferred()\n+ flowFount = yield flowFountFromEndpoint(endpoint)\n+ flowFount.flowTo(Listener(mathFlow))\n+ yield Deferred()\n \n if __name__ == '__main__':\n from twisted.internet.task import react\ndiff --git a/sketches/amptube.py b/sketches/amptube.py\nindex 128d183..0a7e8e9 100644\n--- a/sketches/amptube.py\n+++ b/sketches/amptube.py\n@@ -1,18 +1,19 @@\n-\n-\n from zope.interface import implementer\n \n from ampserver import Math\n \n-from twisted.tubes.protocol import factoryFromFlow\n from twisted.internet.endpoints import serverFromString\n \n+from twisted.internet.defer import Deferred, inlineCallbacks\n from twisted.internet import reactor\n \n from twisted.protocols.amp import AmpBox, IBoxSender\n-from twisted.tubes.itube import ISegment\n-from twisted.tubes.tube import Pump, series\n-from twisted.tubes.framing import packedPrefixToStrings\n+\n+from tubes.protocol import flowFountFromEndpoint\n+from tubes.listening import Listener\n+from tubes.itube import ISegment\n+from tubes.tube import Pump, series\n+from tubes.framing import packedPrefixToStrings\n \n class StringsToBoxes(Pump):\n \n@@ -96,14 +97,22 @@ class BoxConsumer(Pump):\n \n \n \n-def mathFlow(fount, drain):\n+def mathFlow(fount):\n fount.flowTo(series(packedPrefixToStrings(16), StringsToBoxes(),\n- BoxConsumer(Math()), BoxesToData(), drain))\n+ BoxConsumer(Math()), BoxesToData(), fount.drain))\n \n \n \n-serverEndpoint = serverFromString(reactor, \"tcp:1234\")\n-serverEndpoint.listen(factoryFromFlow(mathFlow))\n-from twisted.internet import reactor\n-reactor.run()\n+\n+@inlineCallbacks\n+def main():\n+ serverEndpoint = serverFromString(reactor, \"tcp:1234\")\n+ flowFount = yield flowFountFromEndpoint(serverEndpoint)\n+ flowFount.flowTo(Listener(mathFlow))\n+ yield Deferred()\n+\n+\n+from twisted.interne.task import react\n+from sys import argv\n+react(main, argv[1:])\n \ndiff --git a/sketches/fanchat.py b/sketches/fanchat.py\nindex c26a013..92cdcb3 100644\n--- a/sketches/fanchat.py\n+++ b/sketches/fanchat.py\n@@ -5,14 +5,15 @@ from json import loads, dumps\n from zope.interface.common import IMapping\n \n from twisted.internet.endpoints import serverFromString\n-from twisted.internet.defer import Deferred\n+from twisted.internet.defer import Deferred, inlineCallbacks\n \n-from twisted.tubes.routing import Router, Routed, to\n-from twisted.tubes.protocol import factoryFromFlow\n-from twisted.tubes.itube import IFrame\n-from twisted.tubes.tube import series, tube, receiver\n-from twisted.tubes.framing import bytesToLines, linesToBytes\n-from twisted.tubes.fan import Out, In\n+from tubes.routing import Router, Routed, to\n+from tubes.itube import IFrame\n+from tubes.tube import series, tube, receiver\n+from tubes.framing import bytesToLines, linesToBytes\n+from tubes.fan import Out, In\n+from tubes.listening import Listener\n+from tubes.protocol import flowFountFromEndpoint\n \n \n \n@@ -130,12 +131,12 @@ class Hub(object):\n self.participants = []\n self.channels = defaultdict(Channel)\n \n- def newParticipantFlow(self, fount, drain):\n- commandFount = fount.flowTo(\n+ def newParticipantFlow(self, flow):\n+ commandFount = flow.fount.flowTo(\n series(OnStop(lambda: self.participants.remove(participant)),\n bytesToLines(), linesToCommands)\n )\n- commandDrain = series(commandsToLines, linesToBytes(), drain)\n+ commandDrain = series(commandsToLines, linesToBytes(), flow.drain)\n participant = Participant(self, commandFount, commandDrain)\n self.participants.append(participant)\n \n@@ -144,10 +145,12 @@ class Hub(object):\n \n \n \n+@inlineCallbacks\n def main(reactor, port=\"stdio:\"):\n endpoint = serverFromString(reactor, port)\n- endpoint.listen(factoryFromFlow(Hub().newParticipantFlow))\n- return Deferred()\n+ flowFount = yield flowFountFromEndpoint(endpoint)\n+ flowFount.flowTo(Listener(Hub().newParticipantFlow))\n+ yield Deferred()\n \n \n \ndiff --git a/sketches/notes.rst b/sketches/notes.rst\nindex 91e3587..7425177 100644\n--- a/sketches/notes.rst\n+++ b/sketches/notes.rst\n@@ -3,18 +3,18 @@ In the interst of making this branch more accessible to additional contributors,\n Framing needs a ton of tests.\n It hasn't changed a whole lot so documenting and testing this module might be a good way to get started.\n \n-``twisted.tubes.protocol`` is pretty well tested and roughly complete but could really use some docstrings, and improve the ones it has.\n-See for example the docstring for factoryFromFlow.\n+``tubes.protocol`` is pretty well tested and roughly complete but could really use some docstrings, and improve the ones it has.\n+See for example the docstring for flowFountFromEndpoint.\n \n-The objects in ``twisted.tubes.protocol``, especially those that show up in log messages, could really use nicer reprs that indicate what they're doing.\n+The objects in ``tubes.protocol``, especially those that show up in log messages, could really use nicer reprs that indicate what they're doing.\n For example ``_ProtocolPlumbing`` and ``_FlowFactory`` should both include information about the flow function they're working on behalf of.\n \n-Similarly, ``twisted.tubes.fan`` is a pretty rough sketch, although it's a bit less self-evident what is going on there since it's not fully implemented.\n+Similarly, ``tubes.fan`` is a pretty rough sketch, although it's a bit less self-evident what is going on there since it's not fully implemented.\n (*Hopefully* it's straightforward, but let's not count on hope.)\n \n There are a bunch of un-covered `__repr__`s, probably.\n \n-`twisted.tubes.tube.Diverter` could use some better docstrings, as could its helpers `_DrainingFount` and `_DrainingTube`.\n+`tubes.tube.Diverter` could use some better docstrings, as could its helpers `_DrainingFount` and `_DrainingTube`.\n \n We need a decorator for a function so that this:\n \ndiff --git a/tox.ini b/tox.ini\nindex ac04142..e689da0 100644\n--- a/tox.ini\n+++ b/tox.ini\n@@ -1,5 +1,5 @@\n [tox]\n-envlist = py26, py27, pypy, docs, lint\n+envlist = py26, py27, pypy, docs, lint, apidocs\n \n [testenv]\n deps =\ndiff --git a/tubes/_siphon.py b/tubes/_siphon.py\nindex ad4c542..665c901 100644\n--- a/tubes/_siphon.py\n+++ b/tubes/_siphon.py\n@@ -10,8 +10,8 @@ from collections import deque\n \n from zope.interface import implementer\n \n-from .itube import IPause, IDrain, IFount, ITube\n-from .kit import Pauser, beginFlowingFrom, beginFlowingTo\n+from .itube import IDrain, IFount, ITube\n+from .kit import Pauser, beginFlowingFrom, beginFlowingTo, NoPause, OncePause\n from ._components import _registryAdapting\n \n from twisted.python.failure import Failure\n@@ -214,10 +214,7 @@ class _SiphonFount(_SiphonPiece):\n siphon's tube.\n \"\"\"\n result = beginFlowingTo(self, drain)\n- if self._siphon._pauseBecauseNoDrain:\n- pbnd = self._siphon._pauseBecauseNoDrain\n- self._siphon._pauseBecauseNoDrain = None\n- pbnd.unpause()\n+ self._siphon._pauseBecauseNoDrain.maybeUnpause()\n self._siphon._unbufferIterator()\n return result\n \n@@ -245,19 +242,6 @@ class _SiphonFount(_SiphonPiece):\n \n \n \n-@implementer(IPause)\n-class _PlaceholderPause(object):\n- \"\"\"\n- L{IPause} provider that does nothing.\n- \"\"\"\n-\n- def unpause(self):\n- \"\"\"\n- No-op.\n- \"\"\"\n-\n-\n-\n @implementer(IDrain)\n class _SiphonDrain(_SiphonPiece):\n \"\"\"\n@@ -295,7 +279,7 @@ class _SiphonDrain(_SiphonPiece):\n pbpc = self._siphon._pauseBecausePauseCalled\n self._siphon._pauseBecausePauseCalled = None\n if fount is None:\n- pauseFlow = _PlaceholderPause\n+ pauseFlow = NoPause\n else:\n pauseFlow = fount.pauseFlow\n self._siphon._pauseBecausePauseCalled = pauseFlow()\n@@ -382,9 +366,9 @@ class _Siphon(object):\n self._everStarted = False\n self._unbuffering = False\n self._flowStoppingReason = None\n- self._pauseBecauseNoDrain = None\n \n self._tfount = _SiphonFount(self)\n+ self._pauseBecauseNoDrain = OncePause(self._tfount._pauser)\n self._tdrain = _SiphonDrain(self)\n self._tube = tube\n self._pending = SiphonPendingValues()\n@@ -433,9 +417,7 @@ class _Siphon(object):\n return\n self._pending.append(iter(iterableOrNot))\n if self._tfount.drain is None:\n- if self._pauseBecauseNoDrain is None:\n- self._pauseBecauseNoDrain = self._tfount.pauseFlow()\n-\n+ self._pauseBecauseNoDrain.pauseOnce()\n self._unbufferIterator()\n \n \ndiff --git a/tubes/itube.py b/tubes/itube.py\nindex 9656155..8bfd04a 100644\n--- a/tubes/itube.py\n+++ b/tubes/itube.py\n@@ -9,8 +9,8 @@ Interfaces related to data flows.\n from zope.interface import Interface, Attribute\n \n if 0:\n- from zope.interface.interfaces import IInterface\n- IInterface\n+ from zope.interface.interfaces import ISpecification\n+ ISpecification\n from twisted.python.failure import Failure\n Failure\n \n@@ -60,7 +60,7 @@ class IFount(Interface):\n \"\"\"\n The type of output produced by this Fount.\n \n- This may be an L{IInterface} provider.\n+ This may be an L{ISpecification} provider.\n \"\"\")\n \n drain = Attribute(\n@@ -126,6 +126,8 @@ class IDrain(Interface):\n inputType = Attribute(\n \"\"\"\n Similar to L{IFount.outputType}.\n+\n+ This is an L{ISpecification} provider.\n \"\"\")\n \n fount = Attribute(\n@@ -175,7 +177,7 @@ class IDrain(Interface):\n \n class ITube(Interface):\n \"\"\"\n- A tube translates input to output.\n+ A tube transforms input into output.\n \n Look at this awesome ASCII art::\n \ndiff --git a/tubes/kit.py b/tubes/kit.py\nindex 7ac796f..ee73633 100644\n--- a/tubes/kit.py\n+++ b/tubes/kit.py\n@@ -132,3 +132,46 @@ def beginFlowingFrom(drain, fount):\n (oldFount.drain is drain) ):\n oldFount.flowTo(None)\n \n+\n+\n+@implementer(IPause)\n+class NoPause(object):\n+ \"\"\"\n+ A null implementation of L{IPause} that does nothing.\n+ \"\"\"\n+\n+ def unpause(self):\n+ \"\"\"\n+ No-op.\n+ \"\"\"\n+\n+\n+\n+class OncePause(object):\n+ \"\"\"\n+ Pause a pauser once, unpause it if necessary.\n+ \"\"\"\n+ def __init__(self, pauser):\n+ \"\"\"\n+ Create a L{OncePause} with the given L{Pauser}.\n+ \"\"\"\n+ self._pauser = pauser\n+ self._currentlyPaused = False\n+\n+\n+ def pauseOnce(self):\n+ \"\"\"\n+ If this L{OncePause} is not currently paused, pause its pauser.\n+ \"\"\"\n+ if not self._currentlyPaused:\n+ self._currentlyPaused = True\n+ self._pause = self._pauser.pause()\n+\n+\n+ def maybeUnpause(self):\n+ \"\"\"\n+ If this L{OncePause} is currently paused, unpause it.\n+ \"\"\"\n+ if self._currentlyPaused:\n+ self._currentlyPaused = False\n+ self._pause.unpause()\ndiff --git a/tubes/listening.py b/tubes/listening.py\nnew file mode 100644\nindex 0000000..5b2657a\n--- /dev/null\n+++ b/tubes/listening.py\n@@ -0,0 +1,135 @@\n+# -*- test-case-name: tubes.test.test_listening -*-\n+# Copyright (c) Twisted Matrix Laboratories.\n+# See LICENSE for details.\n+\"\"\"\n+Listening.\n+\"\"\"\n+\n+from zope.interface import implementer, implementedBy\n+\n+from .itube import IDrain\n+from .kit import beginFlowingFrom, NoPause\n+from .tube import tube, series\n+\n+class Flow(object):\n+ \"\"\"\n+ A L{Flow} is a combination of a Fount and a Drain, representing a\n+ bi-directional communication channel such as a TCP connection.\n+\n+ @ivar fount: A fount.\n+ @type fount: L{IFount}\n+\n+ @ivar drain: A drain.\n+ @type drain: L{IDrain}\n+ \"\"\"\n+\n+ def __init__(self, fount, drain):\n+ \"\"\"\n+ @param fount: Fount.\n+ @type fount: L{IFount}\n+\n+ @param drain: Drain.\n+ @type drain: L{IDrain}\n+ \"\"\"\n+ self.fount = fount\n+ self.drain = drain\n+\n+\n+\n+@implementer(IDrain)\n+class Listener(object):\n+ \"\"\"\n+ A L{Listener} is a drain that accepts L{Flow}s and sets them up.\n+ \"\"\"\n+\n+ inputType = implementedBy(Flow)\n+\n+ def __init__(self, flowConnector, maxConnections=100):\n+ \"\"\"\n+ @param flowConnector: a 1-argument callable taking a L{Flow} and\n+ returning nothing, which connects the flow.\n+\n+ @param maxConnections: The number of concurrent L{Flow} objects\n+ to maintain active at once.\n+ @type maxConnections: L{int}\n+ \"\"\"\n+ self.fount = None\n+ self._flowConnector = flowConnector\n+ self._maxConnections = maxConnections\n+ self._currentConnections = 0\n+ self._paused = NoPause()\n+\n+\n+ def flowingFrom(self, fount):\n+ \"\"\"\n+ The flow has begun from the given L{fount} of L{Flow}s.\n+\n+ @param fount: A fount of flows. One example of such a suitable fount\n+ would be the return value of\n+ L{tubes.protocol.flowFountFromEndpoint}.\n+\n+ @return: L{None}, since this is a \"terminal\" drain, where founts of\n+ L{Flow} must end up in order for more new connections to be\n+ established.\n+ \"\"\"\n+ beginFlowingFrom(self, fount)\n+\n+\n+ def receive(self, item):\n+ \"\"\"\n+ Receive the given flow, applying backpressure if too many connections\n+ are active.\n+\n+ @param item: The inbound L{Flow}.\n+ \"\"\"\n+ self._currentConnections += 1\n+ if self._currentConnections >= self._maxConnections:\n+ self._paused = self.fount.pauseFlow()\n+ def dec():\n+ self._currentConnections -= 1\n+ self._paused.unpause()\n+ self._paused = NoPause()\n+ self._flowConnector(Flow(item.fount.flowTo(series(_OnStop(dec))),\n+ item.drain))\n+\n+\n+ def flowStopped(self, reason):\n+ \"\"\"\n+ No more L{Flow}s are incoming; nothing to do.\n+\n+ @param reason: the reason the flow stopped.\n+ \"\"\"\n+\n+\n+\n+@tube\n+class _OnStop(object):\n+ \"\"\"\n+ Call a callback when the flow stops.\n+ \"\"\"\n+ def __init__(self, callback):\n+ \"\"\"\n+ Call the given callback.\n+ \"\"\"\n+ self.callback = callback\n+\n+\n+ def received(self, item):\n+ \"\"\"\n+ Pass through all received items.\n+\n+ @param item: An item being passed through (type unknown).\n+ \"\"\"\n+ yield item\n+\n+\n+ def stopped(self, reason):\n+ \"\"\"\n+ Call the callback on stop.\n+\n+ @param reason: the reason that the flow stopped; ignored.\n+\n+ @return: no items.\n+ \"\"\"\n+ self.callback()\n+ return ()\ndiff --git a/tubes/protocol.py b/tubes/protocol.py\nindex 6577f4c..6d44259 100644\n--- a/tubes/protocol.py\n+++ b/tubes/protocol.py\n@@ -5,28 +5,34 @@\n \"\"\"\n Objects to connect L{real data <_Protocol>} to L{tubes}.\n \n-@see: L{factoryFromFlow}\n+@see: L{flowFountFromEndpoint}\n \"\"\"\n \n __all__ = [\n- 'factoryFromFlow',\n+ 'flowFountFromEndpoint',\n+ 'flowFromEndpoint',\n ]\n \n-from zope.interface import implementer\n+from zope.interface import implementer, implementedBy\n \n-from .kit import Pauser, beginFlowingFrom, beginFlowingTo\n-from .itube import IDrain, IFount, ISegment\n+from .kit import Pauser, beginFlowingFrom, beginFlowingTo, OncePause\n+from .itube import StopFlowCalled, IDrain, IFount, ISegment\n+from .listening import Flow\n \n-from twisted.internet.interfaces import IPushProducer\n+from twisted.python.failure import Failure\n+from twisted.internet.interfaces import IPushProducer, IListeningPort\n from twisted.internet.protocol import Protocol as _Protocol\n \n if 0:\n # Workaround for inability of pydoctor to resolve references.\n from twisted.internet.interfaces import (\n- IProtocol, ITransport, IConsumer, IProtocolFactory, IProducer)\n- IProtocol, ITransport, IConsumer, IProtocolFactory, IProducer\n- from twisted.python.failure import Failure\n- Failure\n+ IProtocol, ITransport, IConsumer, IProtocolFactory, IProducer,\n+ IStreamServerEndpoint\n+ )\n+ (IProtocol, ITransport, IConsumer, IProtocolFactory, IProducer,\n+ IStreamServerEndpoint)\n+ from twisted.internet.defer import Deferred\n+ Deferred\n \n \n \n@@ -205,7 +211,7 @@ class _ProtocolPlumbing(_Protocol):\n A L{_ProtocolPlumbing} implements L{IProtocol} to deliver all incoming data\n to the drain associated with its L{fount }.\n \n- @ivar _flow: A flow function, as described in L{factoryFromFlow}.\n+ @ivar _flow: A flow function, as described in L{_factoryFromFlow}.\n @type _flow: L{callable}\n \n @ivar _drain: The drain that is passed on to the application, created after\n@@ -267,17 +273,17 @@ class _ProtocolPlumbing(_Protocol):\n \n \n \n-def factoryFromFlow(flow):\n+def _factoryFromFlow(flow):\n \"\"\"\n Convert a flow function into an L{IProtocolFactory}.\n \n A \"flow function\" is a function which takes a L{fount } and an\n L{drain }.\n \n- L{factoryFromFlow} takes such a function and creates an L{IProtocolFactory}\n- which, upon each new connection, provides the flow function with an\n- L{IFount} and an L{IDrain} representing the read end and the write end of\n- the incoming connection, respectively.\n+ L{_factoryFromFlow} takes such a function and creates an\n+ L{IProtocolFactory} which, upon each new connection, provides the flow\n+ function with an L{IFount} and an L{IDrain} representing the read end and\n+ the write end of the incoming connection, respectively.\n \n @param flow: a 2-argument callable, taking (fount, drain).\n @type flow: L{callable}\n@@ -287,3 +293,134 @@ def factoryFromFlow(flow):\n \"\"\"\n from twisted.internet.protocol import Factory\n return Factory.forProtocol(lambda: _ProtocolPlumbing(flow))\n+\n+\n+\n+@implementer(IFount)\n+class _FountImpl(object):\n+ \"\"\"\n+ Implementation of fount for listening port.\n+ \"\"\"\n+\n+ outputType = implementedBy(Flow)\n+\n+ def __init__(self, portObject, aFlowFunction, preListen):\n+ \"\"\"\n+ Create a fount implementation from a provider of L{IPushProducer} and a\n+ function that takes a fount and a drain.\n+\n+ @param portObject: the result of the L{Deferred} from\n+ L{IStreamServerEndpoint.listen}\n+ @type portObject: L{IListeningPort} and L{IPushProducer} provider\n+ (probably; workarounds are in place for other cases)\n+\n+ @param aFlowFunction: a 2-argument callable, invoked when a connection\n+ arrives, with a fount and drain.\n+ @type aFlowFunction: L{callable}\n+\n+ @param preListen: the founts and drains accepted before the C{listen}\n+ L{Deferred} has fired. Because these might be arriving before this\n+ L{_FountImpl} even I{exists}, this needs to be passed in. That is\n+ OK because L{_FountImpl} is very tightly coupled to\n+ L{flowFountFromEndpoint}, which is the only thing that constructs\n+ it.\n+ @type preListen: L{list} of 2-L{tuple}s of C{(fount, drain)}\n+ \"\"\"\n+ self.drain = None\n+ self._preListen = preListen\n+ self._pauser = Pauser(portObject.pauseProducing,\n+ portObject.resumeProducing)\n+ self._noDrainPause = OncePause(self._pauser)\n+ self._aFlowFunction = aFlowFunction\n+ self._portObject = portObject\n+ if preListen:\n+ self._noDrainPause.pauseOnce()\n+\n+\n+ def flowTo(self, drain):\n+ \"\"\"\n+ Start flowing to the given drain.\n+\n+ @param drain: The drain to send flows to.\n+\n+ @return: the next fount in the chain.\n+ \"\"\"\n+ result = beginFlowingTo(self, drain)\n+ self._noDrainPause.maybeUnpause()\n+ for f, d in self._preListen:\n+ self._aFlowFunction(f, d)\n+ return result\n+\n+\n+ def pauseFlow(self):\n+ \"\"\"\n+ Allow backpressure to build up in the listening socket; ask Twisted to\n+ stop calling C{accept}.\n+\n+ @return: An L{IPause}.\n+ \"\"\"\n+ return self._pauser.pause()\n+\n+\n+ def stopFlow(self):\n+ \"\"\"\n+ Stop the delivery of L{Flow} objects to this L{_FountImpl}'s drain, and\n+ stop listening on the port represented by this fount.\n+ \"\"\"\n+ self.drain.flowStopped(Failure(StopFlowCalled()))\n+ self.drain = None\n+ if IListeningPort.providedBy(self._portObject):\n+ self._portObject.stopListening()\n+\n+\n+\n+def flowFountFromEndpoint(endpoint):\n+ \"\"\"\n+ Listen on the given endpoint, and thereby create a L{fount } which\n+ outputs a new L{Flow} for each connection.\n+\n+ @note: L{IStreamServerEndpoint} formally specifies that its C{connect}\n+ method returns a L{Deferred} that fires with an L{IListeningPort}.\n+ However, L{IListeningPort} is insufficient to express the requisite\n+ flow-control to implement a fount; so the C{endpoint} parameter must be\n+ an extended endpoint whose C{listen} L{Deferred} fires with a provider\n+ of both L{IListeningPort} and L{IPushProducer}. Luckily, the\n+ real-world implementations of L{IListeningPort} within Twisted are all\n+ L{IPushProducer}s as well, so practically speaking you will not notice\n+ this, but for testing it is important to know this is necessary.\n+\n+ @param endpoint: a server endpoint.\n+ @type endpoint: L{IStreamServerEndpoint}\n+\n+ @return: a L{twisted.internet.defer.Deferred} that fires with a L{IFount}\n+ whose C{outputType} is L{Flow}.\n+ \"\"\"\n+ preListen = []\n+ def listening(portObject):\n+ listening.impl = _FountImpl(portObject, aFlowFunction, preListen)\n+ return listening.impl\n+ listening.impl = None\n+ def aFlowFunction(fount, drain):\n+ if listening.impl is None or listening.impl.drain is None:\n+ preListen.append((fount, drain))\n+ if listening.impl is not None:\n+ listening.impl._pauseForNoDrain()\n+ else:\n+ listening.impl.drain.receive(Flow(fount, drain))\n+ aFactory = _factoryFromFlow(aFlowFunction)\n+ return endpoint.listen(aFactory).addCallback(listening)\n+\n+\n+\n+def flowFromEndpoint(endpoint):\n+ \"\"\"\n+ Convert a client endpoint into a L{Deferred} that fires with a L{Flow}.\n+\n+ @param endpoint: a client endpoint that will be connected to, once.\n+\n+ @return: a L{Deferred} that fires with a L{Flow}.\n+ \"\"\"\n+ def cb(fount, drain):\n+ cb.result = Flow(fount, drain)\n+ return (endpoint.connect(_factoryFromFlow(cb))\n+ .addCallback(lambda whatever: cb.result))\ndiff --git a/tubes/tube.py b/tubes/tube.py\nindex df954ef..fe23b49 100644\n--- a/tubes/tube.py\n+++ b/tubes/tube.py\n@@ -15,8 +15,9 @@ from twisted.python.components import proxyForInterface\n from twisted.python.failure import Failure\n \n from .itube import IDrain, ITube, IDivertable, IFount, StopFlowCalled\n-from ._siphon import _tubeRegistry, _Siphon, _PlaceholderPause, skip\n+from ._siphon import _tubeRegistry, _Siphon, skip\n from ._components import _registryActive\n+from .kit import NoPause as _PlaceholderPause\n \n __all__ = [\n \"Diverter\",\n"},"problem_statement":{"kind":"string","value":"replace conversion of flow-function → factory with conversion of endpoint → fount of founts\nPresently on trunk, tubes are hooked up to the outside world (i.e.: Twisted) by converting a \"flow function\", a function taking a fount and drain, to a Factory, which is then hooked up to Twisted.\r\n\r\nHowever, this is limiting in one major regard: the backpressure of *not accepting future connections* is impossible to model properly.\r\n\r\nA better way to conceptualize a listening socket is a fount whose `outputType` is an object with both `Fount` and `Drain` attributes. This way, we can flow the stream of incoming connections to a \"listening\" drain, which can exert backpressure (most obviously by simply limiting the number of concurrently active connections).\r\n\r\nAs it happens, this is also a feature missing from Twisted which makes it hard to implement fairness in queueing. By making tubes treat listening sockets and connected sockets consistently, we can open up a whole new area of correct-by-default behavior under high levels of load."},"repo":{"kind":"string","value":"twisted/tubes"},"test_patch":{"kind":"string","value":"diff --git a/tubes/test/test_listening.py b/tubes/test/test_listening.py\nnew file mode 100644\nindex 0000000..5b0b3e3\n--- /dev/null\n+++ b/tubes/test/test_listening.py\n@@ -0,0 +1,56 @@\n+# -*- test-case-name: tubes.test.test_listening -*-\n+# Copyright (c) Twisted Matrix Laboratories.\n+# See LICENSE for details.\n+\n+\"\"\"\n+Tests for L{tubes.listening}.\n+\"\"\"\n+\n+from unittest import TestCase\n+\n+from ..listening import Flow, Listener\n+from ..memory import iteratorFount\n+\n+from .util import FakeDrain\n+\n+class ListeningTests(TestCase):\n+ \"\"\"\n+ Test cases for listening.\n+ \"\"\"\n+\n+ def test_listenerCallsFlowConnector(self):\n+ \"\"\"\n+ A L{Listener} is a drain which calls the function given to it to\n+ connect a flow\n+ \"\"\"\n+ drained = FakeDrain()\n+ flow = Flow(iteratorFount([1, 2, 3]),\n+ drained)\n+ flows = []\n+ fi = iteratorFount([flow])\n+ listener = Listener(flows.append)\n+ fi.flowTo(listener)\n+ self.assertEqual(len(flows), 1)\n+ results = FakeDrain()\n+ flows[0].fount.flowTo(results)\n+ # The listener might need to (and in fact does) interpose a different\n+ # value for 'fount' and 'drain' to add hooks to them. We assert about\n+ # the values passed through them.\n+ self.assertEqual(results.received, [1, 2, 3])\n+ iteratorFount([4, 5, 6]).flowTo(flows[0].drain)\n+ self.assertEqual(drained.received, [4, 5, 6])\n+\n+\n+ def test_listenerLimitsConcurrentConnections(self):\n+ \"\"\"\n+ L{Listener} will pause its fount when too many connections are\n+ received.\n+ \"\"\"\n+ connectorCalled = []\n+ listener = Listener(connectorCalled.append, maxConnections=3)\n+ tenFlows = iteratorFount([Flow(iteratorFount([1, 2, 3]),\n+ FakeDrain())\n+ for each in range(10)])\n+ tenFlows.flowTo(listener)\n+ self.assertEqual(len(connectorCalled), 3)\n+ connectorCalled[0].fount.flowTo(connectorCalled[0].drain)\ndiff --git a/tubes/test/test_protocol.py b/tubes/test/test_protocol.py\nindex 8c64452..9586f82 100644\n--- a/tubes/test/test_protocol.py\n+++ b/tubes/test/test_protocol.py\n@@ -6,14 +6,20 @@\n Tests for L{tubes.protocol}.\n \"\"\"\n \n+from zope.interface import implementer\n+\n from twisted.trial.unittest import SynchronousTestCase as TestCase\n \n from twisted.python.failure import Failure\n+from twisted.test.proto_helpers import StringTransport\n+from twisted.internet.interfaces import IStreamServerEndpoint\n \n-from ..protocol import factoryFromFlow\n+from ..protocol import flowFountFromEndpoint, flowFromEndpoint\n from ..tube import tube, series\n+from ..listening import Flow, Listener\n+from ..itube import IFount\n \n-from ..test.util import StringEndpoint, FakeDrain, FakeFount\n+from .util import StringEndpoint, FakeDrain, FakeFount, fakeEndpointWithPorts\n \n @tube\n class RememberingTube(object):\n@@ -50,9 +56,9 @@ class RememberingTube(object):\n \n \n \n-class FlowingAdapterTests(TestCase):\n+class FlowConnectorTests(TestCase):\n \"\"\"\n- Tests for L{factoryFromFlow} and the drain/fount/factory adapters it\n+ Tests for L{flowFromEndpoint} and the drain/fount/factory adapters it\n constructs.\n \"\"\"\n \n@@ -61,17 +67,25 @@ class FlowingAdapterTests(TestCase):\n Sert up these tests.\n \"\"\"\n self.endpoint = StringEndpoint()\n- def flowFunction(fount, drain):\n- self.adaptedDrain = drain\n- self.adaptedFount = fount\n- self.adaptedProtocol = self.successResultOf(\n- self.endpoint.connect(factoryFromFlow(flowFunction))\n- )\n-\n+ flow = self.successResultOf(flowFromEndpoint(self.endpoint))\n+ self.adaptedDrain = flow.drain\n+ self.adaptedFount = flow.fount\n self.tube = RememberingTube()\n self.drain = series(self.tube)\n \n \n+ def adaptedProtocol(self):\n+ \"\"\"\n+ Retrieve a protocol for testing with.\n+\n+ @return: the first protocol instance to have been created by making the\n+ virtual outbound connection associated with the call to\n+ L{flowFromEndpoint} performed in L{FlowConnectorTests.setUp}.\n+ @rtype: L{IProtocol}\n+ \"\"\"\n+ return self.endpoint.transports[0].protocol\n+\n+\n def test_flowToSetsDrain(self):\n \"\"\"\n L{_ProtocolFount.flowTo} will set the C{drain} attribute of the\n@@ -87,7 +101,7 @@ class FlowingAdapterTests(TestCase):\n L{_ProtocolFount.dataReceived} to invoke L{receive} on its drain.\n \"\"\"\n self.adaptedFount.flowTo(self.drain)\n- self.adaptedProtocol.dataReceived(\"some data\")\n+ self.adaptedProtocol().dataReceived(\"some data\")\n self.assertEqual(self.tube.items, [\"some data\"])\n \n \n@@ -108,7 +122,7 @@ class FlowingAdapterTests(TestCase):\n \"\"\"\n self.adaptedFount.flowTo(self.drain)\n self.adaptedFount.stopFlow()\n- self.assertEqual(self.adaptedProtocol.transport.disconnecting, True)\n+ self.assertEqual(self.adaptedProtocol().transport.disconnecting, True)\n # The connection has not been closed yet; we *asked* the flow to stop,\n # but it may not have done.\n self.assertEqual(self.tube.wasStopped, False)\n@@ -121,7 +135,7 @@ class FlowingAdapterTests(TestCase):\n \"\"\"\n self.adaptedFount.flowTo(self.drain)\n self.adaptedDrain.flowStopped(Failure(ZeroDivisionError()))\n- self.assertEqual(self.adaptedProtocol.transport.disconnecting, True)\n+ self.assertEqual(self.adaptedProtocol().transport.disconnecting, True)\n self.assertEqual(self.tube.wasStopped, False)\n \n \n@@ -137,7 +151,7 @@ class FlowingAdapterTests(TestCase):\n class MyFunException(Exception):\n pass\n f = Failure(MyFunException())\n- self.adaptedProtocol.connectionLost(f)\n+ self.adaptedProtocol().connectionLost(f)\n self.assertEqual(self.tube.wasStopped, True)\n self.assertIdentical(f, self.tube.reason)\n \n@@ -150,7 +164,7 @@ class FlowingAdapterTests(TestCase):\n ff = FakeFount()\n ff.flowTo(self.adaptedDrain)\n self.assertEqual(ff.flowIsStopped, False)\n- self.adaptedProtocol.connectionLost(Failure(ZeroDivisionError))\n+ self.adaptedProtocol().connectionLost(Failure(ZeroDivisionError))\n self.assertEqual(ff.flowIsStopped, True)\n \n \n@@ -160,16 +174,16 @@ class FlowingAdapterTests(TestCase):\n L{_ProtocolFount} is flowing to anything, then it will pause the\n transport but only until the L{_ProtocolFount} is flowing to something.\n \"\"\"\n- self.adaptedProtocol.dataReceived(\"hello, \")\n- self.assertEqual(self.adaptedProtocol.transport.producerState,\n+ self.adaptedProtocol().dataReceived(\"hello, \")\n+ self.assertEqual(self.adaptedProtocol().transport.producerState,\n 'paused')\n # It would be invalid to call dataReceived again in this state, so no\n # need to test that...\n fd = FakeDrain()\n self.adaptedFount.flowTo(fd)\n- self.assertEqual(self.adaptedProtocol.transport.producerState,\n+ self.assertEqual(self.adaptedProtocol().transport.producerState,\n 'producing')\n- self.adaptedProtocol.dataReceived(\"world!\")\n+ self.adaptedProtocol().dataReceived(\"world!\")\n self.assertEqual(fd.received, [\"hello, \", \"world!\"])\n \n \n@@ -181,7 +195,7 @@ class FlowingAdapterTests(TestCase):\n self.test_dataReceivedBeforeFlowing()\n fd2 = FakeDrain()\n self.adaptedFount.flowTo(fd2)\n- self.adaptedProtocol.dataReceived(\"hooray\")\n+ self.adaptedProtocol().dataReceived(\"hooray\")\n self.assertEqual(fd2.received, [\"hooray\"])\n \n \n@@ -201,7 +215,7 @@ class FlowingAdapterTests(TestCase):\n \"\"\"\n fd = FakeDrain()\n self.adaptedFount.flowTo(fd)\n- self.adaptedProtocol.dataReceived(\"a\")\n+ self.adaptedProtocol().dataReceived(\"a\")\n self.adaptedFount.flowTo(None)\n self.assertEqual(fd.fount, None)\n self.test_dataReceivedBeforeFlowing()\n@@ -231,10 +245,10 @@ class FlowingAdapterTests(TestCase):\n self.assertEqual(ff.flowIsPaused, False)\n self.adaptedDrain.flowingFrom(ff)\n # The connection is too full! Back off!\n- self.adaptedProtocol.transport.producer.pauseProducing()\n+ self.adaptedProtocol().transport.producer.pauseProducing()\n self.assertEqual(ff.flowIsPaused, True)\n # All clear, start writing again.\n- self.adaptedProtocol.transport.producer.resumeProducing()\n+ self.adaptedProtocol().transport.producer.resumeProducing()\n self.assertEqual(ff.flowIsPaused, False)\n \n \n@@ -249,17 +263,17 @@ class FlowingAdapterTests(TestCase):\n producing = 'producing'\n paused = 'paused'\n # Sanity check.\n- self.assertEqual(self.adaptedProtocol.transport.producerState,\n+ self.assertEqual(self.adaptedProtocol().transport.producerState,\n producing)\n self.adaptedFount.flowTo(fd)\n # Steady as she goes.\n- self.assertEqual(self.adaptedProtocol.transport.producerState,\n+ self.assertEqual(self.adaptedProtocol().transport.producerState,\n producing)\n anPause = fd.fount.pauseFlow()\n- self.assertEqual(self.adaptedProtocol.transport.producerState,\n+ self.assertEqual(self.adaptedProtocol().transport.producerState,\n paused)\n anPause.unpause()\n- self.assertEqual(self.adaptedProtocol.transport.producerState,\n+ self.assertEqual(self.adaptedProtocol().transport.producerState,\n producing)\n \n \n@@ -288,3 +302,99 @@ class FlowingAdapterTests(TestCase):\n return another\n anotherOther = self.adaptedFount.flowTo(ReflowingFakeDrain())\n self.assertIdentical(another, anotherOther)\n+\n+\n+\n+class FlowListenerTests(TestCase):\n+ \"\"\"\n+ Tests for L{flowFountFromEndpoint} and the fount adapter it constructs.\n+ \"\"\"\n+\n+ def test_fromEndpoint(self):\n+ \"\"\"\n+ L{flowFountFromEndpoint} returns a L{Deferred} that fires when the\n+ listening port is ready.\n+ \"\"\"\n+ endpoint, ports = fakeEndpointWithPorts()\n+ deferred = flowFountFromEndpoint(endpoint)\n+ self.assertNoResult(deferred)\n+ deferred.callback(None)\n+ result = self.successResultOf(deferred)\n+ self.assertTrue(IFount.providedBy(result))\n+ self.assertEqual(result.outputType.implementedBy(Flow), True)\n+\n+\n+ def test_oneConnectionAccepted(self):\n+ \"\"\"\n+ When a connection comes in to a listening L{flowFountFromEndpoint}, the\n+ L{Listener} that it's flowing to's callback is called.\n+ \"\"\"\n+ endpoint, ports = fakeEndpointWithPorts()\n+ deferred = flowFountFromEndpoint(endpoint)\n+ self.assertNoResult(deferred)\n+ deferred.callback(None)\n+ result = self.successResultOf(deferred)\n+ connected = []\n+ result.flowTo(Listener(connected.append))\n+ protocol = ports[0].factory.buildProtocol(None)\n+ self.assertEqual(len(connected), 0)\n+ protocol.makeConnection(StringTransport())\n+ self.assertEqual(len(connected), 1)\n+\n+\n+ def test_acceptBeforeActuallyListening(self):\n+ \"\"\"\n+ Sometimes a connection is established reentrantly by C{listen}, without\n+ waiting for the L{Deferred} returned to fire. In this case the\n+ connection will be buffered until said L{Deferred} fires.\n+ \"\"\"\n+ immediateTransport = StringTransport()\n+ subEndpoint, ports = fakeEndpointWithPorts()\n+ @implementer(IStreamServerEndpoint)\n+ class ImmediateFakeEndpoint(object):\n+ def listen(self, factory):\n+ protocol = factory.buildProtocol(None)\n+ protocol.makeConnection(immediateTransport)\n+ return subEndpoint.listen(factory)\n+ endpoint = ImmediateFakeEndpoint()\n+ deferred = flowFountFromEndpoint(endpoint)\n+ deferred.callback(None)\n+ fount = self.successResultOf(deferred)\n+ connected = []\n+ self.assertEqual(ports[0].currentlyProducing, False)\n+ fount.flowTo(Listener(connected.append))\n+ self.assertEqual(ports[0].currentlyProducing, True)\n+ self.assertEqual(len(connected), 1)\n+\n+\n+ def test_backpressure(self):\n+ \"\"\"\n+ When the L{IFount} returned by L{flowFountFromEndpoint} is paused, it\n+ removes its listening port from the reactor. When resumed, it re-adds\n+ it.\n+ \"\"\"\n+ endpoint, ports = fakeEndpointWithPorts()\n+ deferred = flowFountFromEndpoint(endpoint)\n+ deferred.callback(None)\n+ fount = self.successResultOf(deferred)\n+ fount.flowTo(FakeDrain())\n+ pause = fount.pauseFlow()\n+ self.assertEqual(ports[0].currentlyProducing, False)\n+ pause.unpause()\n+ self.assertEqual(ports[0].currentlyProducing, True)\n+\n+\n+ def test_stopping(self):\n+ \"\"\"\n+ The L{IFount} returned by L{flowFountFromEndpoint} will stop listening\n+ on the endpoint\n+ \"\"\"\n+ endpoint, ports = fakeEndpointWithPorts()\n+ deferred = flowFountFromEndpoint(endpoint)\n+ deferred.callback(None)\n+ fount = self.successResultOf(deferred)\n+ fd = FakeDrain()\n+ fount.flowTo(fd)\n+ fount.stopFlow()\n+ self.assertEqual(ports[0].listenStopping, True)\n+ self.assertEqual(len(fd.stopped), 1)\ndiff --git a/tubes/test/util.py b/tubes/test/util.py\nindex 2c29c0e..dd36224 100644\n--- a/tubes/test/util.py\n+++ b/tubes/test/util.py\n@@ -11,12 +11,15 @@ from zope.interface.verify import verifyClass\n \n from twisted.test.proto_helpers import StringTransport\n from twisted.internet.defer import succeed\n-from twisted.internet.interfaces import IStreamClientEndpoint\n+from twisted.internet.interfaces import (\n+ IStreamClientEndpoint, IStreamServerEndpoint, IListeningPort, IPushProducer\n+)\n \n from ..itube import IDrain, IFount, IDivertable\n from ..tube import tube\n from ..kit import Pauser, beginFlowingFrom, beginFlowingTo\n \n+from twisted.internet.defer import Deferred\n \n @implementer(IStreamClientEndpoint)\n class StringEndpoint(object):\n@@ -311,3 +314,123 @@ class NullTube(object):\n \n \n \n+@implementer(IListeningPort, IPushProducer)\n+class FakeListeningProducerPort(object):\n+ \"\"\"\n+ This is a fake L{IListeningPort}, also implementing L{IPushProducer}, which\n+ L{flowFountFromEndpoint} needs to make backpressure work.\n+ \"\"\"\n+ def __init__(self, factory):\n+ \"\"\"\n+ Create a L{FakeListeningProducerPort} with the given protocol\n+ factory.\n+ \"\"\"\n+ self.factory = factory\n+ self.stopper = Deferred()\n+ self.listenStopping = False\n+ self.currentlyProducing = True\n+\n+\n+ def pauseProducing(self):\n+ \"\"\"\n+ Pause producing new connections.\n+ \"\"\"\n+ self.currentlyProducing = False\n+\n+\n+ def resumeProducing(self):\n+ \"\"\"\n+ Resume producing new connections.\n+ \"\"\"\n+ self.currentlyProducing = True\n+\n+\n+ def startListening(self):\n+ \"\"\"\n+ Start listening on this port.\n+\n+ @raise CannotListenError: If it cannot listen on this port (e.g., it is\n+ a TCP port and it cannot bind to the required port number).\n+ \"\"\"\n+\n+\n+ def stopListening(self):\n+ \"\"\"\n+ Stop listening on this fake port.\n+\n+ @return: a L{Deferred} that should be fired when the test wants to\n+ complete stopping listening.\n+ \"\"\"\n+ self.listenStopping = True\n+ return self.stopper\n+\n+\n+ def stopProducing(self):\n+ \"\"\"\n+ Stop producing more data.\n+ \"\"\"\n+ self.stopListening()\n+\n+\n+ def getHost(self):\n+ \"\"\"\n+ Get the host that this port is listening for.\n+\n+ @return: An L{IAddress} provider.\n+ \"\"\"\n+\n+verifyClass(IListeningPort, FakeListeningProducerPort)\n+verifyClass(IPushProducer, FakeListeningProducerPort)\n+\n+\n+@implementer(IStreamServerEndpoint)\n+class FakeEndpoint(object):\n+ \"\"\"\n+ A fake implementation of L{IStreamServerEndpoint} with a L{Deferred} that\n+ fires controllably.\n+\n+ @ivar _listening: deferreds that will fire with listening ports when their\n+ C{.callback} is invoked (input to C{.callback} ignored); added to when\n+ C{listen} is called.\n+ @type _listening: L{list} of L{Deferred}\n+\n+ @ivar _ports: list of ports that have already started listening\n+ @type _ports: L{list} of L{IListeningPort}\n+ \"\"\"\n+ def __init__(self):\n+ \"\"\"\n+ Create a L{FakeEndpoint}.\n+ \"\"\"\n+ self._listening = []\n+ self._ports = []\n+\n+\n+ def listen(self, factory):\n+ \"\"\"\n+ Listen with the given factory.\n+\n+ @param factory: The factory to use for future connections.\n+\n+ @return: a L{Deferred} that fires with a new listening port.\n+ \"\"\"\n+ self._listening.append(Deferred())\n+ def newListener(ignored):\n+ result = FakeListeningProducerPort(factory)\n+ self._ports.append(result)\n+ return result\n+ return self._listening[-1].addCallback(newListener)\n+\n+\n+\n+def fakeEndpointWithPorts():\n+ \"\"\"\n+ Create a L{FakeEndpoint} and expose the list of ports that it uses.\n+\n+ @return: a fake endpoint and a list of the ports it has listened on\n+ @rtype: a 2-tuple of C{(endpoint, ports)}, where C{ports} is a L{list} of\n+ L{IListeningPort}.\n+ \"\"\"\n+ self = FakeEndpoint()\n+ return self, self._ports\n+\n+verifyClass(IStreamServerEndpoint, FakeEndpoint)\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_added_files\",\n \"has_many_modified_files\",\n \"has_many_hunks\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 3,\n \"issue_text_score\": 1,\n \"test_score\": 3\n },\n \"num_modified_files\": 14\n}"},"version":{"kind":"string","value":"unknown"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .[dev]\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"requirements.txt\",\n \"pip_packages\": [\n \"pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio\",\n \"pytest\"\n ],\n \"pre_install\": null,\n \"python\": \"3.9\",\n \"reqs_path\": [\n \"requirements/base.txt\"\n ],\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"attrs==25.3.0\nAutomat==24.8.1\ncharacteristic==14.3.0\nconstantly==23.10.4\ncoverage==7.8.0\nexceptiongroup==1.2.2\nexecnet==2.1.1\nhyperlink==21.0.0\nidna==3.10\nincremental==24.7.2\niniconfig==2.1.0\npackaging==24.2\npluggy==1.5.0\npytest==8.3.5\npytest-asyncio==0.26.0\npytest-cov==6.0.0\npytest-mock==3.14.0\npytest-xdist==3.6.1\nsix==1.17.0\ntomli==2.2.1\n-e git+https://github.com/twisted/tubes.git@71894325180c6337d257e457d96e85075a560020#egg=Tubes\nTwisted==24.11.0\ntyping_extensions==4.13.0\nzope.interface==7.2\n"},"environment":{"kind":"string","value":"name: tubes\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - ca-certificates=2025.2.25=h06a4308_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.4.4=h6a678d5_1\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=3.0.16=h5eee18b_0\n - pip=25.0=py39h06a4308_0\n - python=3.9.21=he870216_1\n - readline=8.2=h5eee18b_0\n - setuptools=75.8.0=py39h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - tzdata=2025a=h04d1e81_0\n - wheel=0.45.1=py39h06a4308_0\n - xz=5.6.4=h5eee18b_1\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - attrs==25.3.0\n - automat==24.8.1\n - characteristic==14.3.0\n - constantly==23.10.4\n - coverage==7.8.0\n - exceptiongroup==1.2.2\n - execnet==2.1.1\n - hyperlink==21.0.0\n - idna==3.10\n - incremental==24.7.2\n - iniconfig==2.1.0\n - packaging==24.2\n - pluggy==1.5.0\n - pytest==8.3.5\n - pytest-asyncio==0.26.0\n - pytest-cov==6.0.0\n - pytest-mock==3.14.0\n - pytest-xdist==3.6.1\n - six==1.17.0\n - tomli==2.2.1\n - twisted==24.11.0\n - typing-extensions==4.13.0\n - zope-interface==7.2\nprefix: /opt/conda/envs/tubes\n"},"FAIL_TO_PASS":{"kind":"list like","value":["tubes/test/test_listening.py::ListeningTests::test_listenerCallsFlowConnector","tubes/test/test_listening.py::ListeningTests::test_listenerLimitsConcurrentConnections","tubes/test/test_protocol.py::FlowConnectorTests::test_connectionLostSendsFlowStopped","tubes/test/test_protocol.py::FlowConnectorTests::test_connectionLostSendsStopFlow","tubes/test/test_protocol.py::FlowConnectorTests::test_dataReceivedBeforeFlowing","tubes/test/test_protocol.py::FlowConnectorTests::test_dataReceivedBeforeFlowingThenFlowTo","tubes/test/test_protocol.py::FlowConnectorTests::test_dataReceivedWhenFlowingToNone","tubes/test/test_protocol.py::FlowConnectorTests::test_drainReceivingWritesToTransport","tubes/test/test_protocol.py::FlowConnectorTests::test_flowStoppedStopsConnection","tubes/test/test_protocol.py::FlowConnectorTests::test_flowToDeliversData","tubes/test/test_protocol.py::FlowConnectorTests::test_flowToSetsDrain","tubes/test/test_protocol.py::FlowConnectorTests::test_flowingFrom","tubes/test/test_protocol.py::FlowConnectorTests::test_flowingFromAttribute","tubes/test/test_protocol.py::FlowConnectorTests::test_flowingToNoneAfterFlowingToSomething","tubes/test/test_protocol.py::FlowConnectorTests::test_pauseUnpauseFromOtherDrain","tubes/test/test_protocol.py::FlowConnectorTests::test_pauseUnpauseFromTransport","tubes/test/test_protocol.py::FlowConnectorTests::test_stopFlowStopsConnection","tubes/test/test_protocol.py::FlowConnectorTests::test_stopProducing","tubes/test/test_protocol.py::FlowListenerTests::test_acceptBeforeActuallyListening","tubes/test/test_protocol.py::FlowListenerTests::test_backpressure","tubes/test/test_protocol.py::FlowListenerTests::test_fromEndpoint","tubes/test/test_protocol.py::FlowListenerTests::test_oneConnectionAccepted","tubes/test/test_protocol.py::FlowListenerTests::test_stopping"],"string":"[\n \"tubes/test/test_listening.py::ListeningTests::test_listenerCallsFlowConnector\",\n \"tubes/test/test_listening.py::ListeningTests::test_listenerLimitsConcurrentConnections\",\n \"tubes/test/test_protocol.py::FlowConnectorTests::test_connectionLostSendsFlowStopped\",\n \"tubes/test/test_protocol.py::FlowConnectorTests::test_connectionLostSendsStopFlow\",\n \"tubes/test/test_protocol.py::FlowConnectorTests::test_dataReceivedBeforeFlowing\",\n \"tubes/test/test_protocol.py::FlowConnectorTests::test_dataReceivedBeforeFlowingThenFlowTo\",\n \"tubes/test/test_protocol.py::FlowConnectorTests::test_dataReceivedWhenFlowingToNone\",\n \"tubes/test/test_protocol.py::FlowConnectorTests::test_drainReceivingWritesToTransport\",\n \"tubes/test/test_protocol.py::FlowConnectorTests::test_flowStoppedStopsConnection\",\n \"tubes/test/test_protocol.py::FlowConnectorTests::test_flowToDeliversData\",\n \"tubes/test/test_protocol.py::FlowConnectorTests::test_flowToSetsDrain\",\n \"tubes/test/test_protocol.py::FlowConnectorTests::test_flowingFrom\",\n \"tubes/test/test_protocol.py::FlowConnectorTests::test_flowingFromAttribute\",\n \"tubes/test/test_protocol.py::FlowConnectorTests::test_flowingToNoneAfterFlowingToSomething\",\n \"tubes/test/test_protocol.py::FlowConnectorTests::test_pauseUnpauseFromOtherDrain\",\n \"tubes/test/test_protocol.py::FlowConnectorTests::test_pauseUnpauseFromTransport\",\n \"tubes/test/test_protocol.py::FlowConnectorTests::test_stopFlowStopsConnection\",\n \"tubes/test/test_protocol.py::FlowConnectorTests::test_stopProducing\",\n \"tubes/test/test_protocol.py::FlowListenerTests::test_acceptBeforeActuallyListening\",\n \"tubes/test/test_protocol.py::FlowListenerTests::test_backpressure\",\n \"tubes/test/test_protocol.py::FlowListenerTests::test_fromEndpoint\",\n \"tubes/test/test_protocol.py::FlowListenerTests::test_oneConnectionAccepted\",\n \"tubes/test/test_protocol.py::FlowListenerTests::test_stopping\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"MIT License"},"__index_level_0__":{"kind":"number","value":254,"string":"254"}}},{"rowIdx":255,"cells":{"instance_id":{"kind":"string","value":"tornadoweb__tornado-1533"},"base_commit":{"kind":"string","value":"4ee9ba94de11aaa4f932560fa2b3d8ceb8c61d2a"},"created_at":{"kind":"string","value":"2015-09-29 02:40:11"},"environment_setup_commit":{"kind":"string","value":"4ee9ba94de11aaa4f932560fa2b3d8ceb8c61d2a"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/tornado/auth.py b/tornado/auth.py\nindex 32d0e226..ff7172aa 100644\n--- a/tornado/auth.py\n+++ b/tornado/auth.py\n@@ -75,7 +75,7 @@ import hmac\n import time\n import uuid\n \n-from tornado.concurrent import TracebackFuture, return_future\n+from tornado.concurrent import TracebackFuture, return_future, chain_future\n from tornado import gen\n from tornado import httpclient\n from tornado import escape\n@@ -985,7 +985,7 @@ class FacebookGraphMixin(OAuth2Mixin):\n future.set_exception(AuthError('Facebook auth error: %s' % str(response)))\n return\n \n- args = escape.parse_qs_bytes(escape.native_str(response.body))\n+ args = urlparse.parse_qs(escape.native_str(response.body))\n session = {\n \"access_token\": args[\"access_token\"][-1],\n \"expires\": args.get(\"expires\")\n@@ -1062,8 +1062,13 @@ class FacebookGraphMixin(OAuth2Mixin):\n Added the ability to override ``self._FACEBOOK_BASE_URL``.\n \"\"\"\n url = self._FACEBOOK_BASE_URL + path\n- return self.oauth2_request(url, callback, access_token,\n- post_args, **args)\n+ # Thanks to the _auth_return_future decorator, our \"callback\"\n+ # argument is a Future, which we cannot pass as a callback to\n+ # oauth2_request. Instead, have oauth2_request return a\n+ # future and chain them together.\n+ oauth_future = self.oauth2_request(url, access_token=access_token,\n+ post_args=post_args, **args)\n+ chain_future(oauth_future, callback)\n \n \n def _oauth_signature(consumer_token, method, url, parameters={}, token=None):\n"},"problem_statement":{"kind":"string","value":"FacebookGraphMixin failing\nI had to modify `_on_access_token` so that it did not attempt to make a `facebook_request` to `/me`. With the code as it stands, I get this error:\r\n\r\n`TypeError: 'Future' object is not callable`\r\n\r\nHowever, removing that extra request fixes this, and I can use the access_token in the next part of my auth pipeline."},"repo":{"kind":"string","value":"tornadoweb/tornado"},"test_patch":{"kind":"string","value":"diff --git a/tornado/test/auth_test.py b/tornado/test/auth_test.py\nindex 56de93a5..3ed40e45 100644\n--- a/tornado/test/auth_test.py\n+++ b/tornado/test/auth_test.py\n@@ -5,7 +5,7 @@\n \n \n from __future__ import absolute_import, division, print_function, with_statement\n-from tornado.auth import OpenIdMixin, OAuthMixin, OAuth2Mixin, TwitterMixin, AuthError, GoogleOAuth2Mixin\n+from tornado.auth import OpenIdMixin, OAuthMixin, OAuth2Mixin, TwitterMixin, AuthError, GoogleOAuth2Mixin, FacebookGraphMixin\n from tornado.concurrent import Future\n from tornado.escape import json_decode\n from tornado import gen\n@@ -126,6 +126,38 @@ class OAuth2ClientLoginHandler(RequestHandler, OAuth2Mixin):\n assert res.done()\n \n \n+class FacebookClientLoginHandler(RequestHandler, FacebookGraphMixin):\n+ def initialize(self, test):\n+ self._OAUTH_AUTHORIZE_URL = test.get_url('/facebook/server/authorize')\n+ self._OAUTH_ACCESS_TOKEN_URL = test.get_url('/facebook/server/access_token')\n+ self._FACEBOOK_BASE_URL = test.get_url('/facebook/server')\n+\n+ @gen.coroutine\n+ def get(self):\n+ if self.get_argument(\"code\", None):\n+ user = yield self.get_authenticated_user(\n+ redirect_uri=self.request.full_url(),\n+ client_id=self.settings[\"facebook_api_key\"],\n+ client_secret=self.settings[\"facebook_secret\"],\n+ code=self.get_argument(\"code\"))\n+ self.write(user)\n+ else:\n+ yield self.authorize_redirect(\n+ redirect_uri=self.request.full_url(),\n+ client_id=self.settings[\"facebook_api_key\"],\n+ extra_params={\"scope\": \"read_stream,offline_access\"})\n+\n+\n+class FacebookServerAccessTokenHandler(RequestHandler):\n+ def get(self):\n+ self.write('access_token=asdf')\n+\n+\n+class FacebookServerMeHandler(RequestHandler):\n+ def get(self):\n+ self.write('{}')\n+\n+\n class TwitterClientHandler(RequestHandler, TwitterMixin):\n def initialize(self, test):\n self._OAUTH_REQUEST_TOKEN_URL = test.get_url('/oauth1/server/request_token')\n@@ -260,6 +292,8 @@ class AuthTest(AsyncHTTPTestCase):\n dict(version='1.0a')),\n ('/oauth2/client/login', OAuth2ClientLoginHandler, dict(test=self)),\n \n+ ('/facebook/client/login', FacebookClientLoginHandler, dict(test=self)),\n+\n ('/twitter/client/login', TwitterClientLoginHandler, dict(test=self)),\n ('/twitter/client/login_gen_engine', TwitterClientLoginGenEngineHandler, dict(test=self)),\n ('/twitter/client/login_gen_coroutine', TwitterClientLoginGenCoroutineHandler, dict(test=self)),\n@@ -271,13 +305,17 @@ class AuthTest(AsyncHTTPTestCase):\n ('/oauth1/server/request_token', OAuth1ServerRequestTokenHandler),\n ('/oauth1/server/access_token', OAuth1ServerAccessTokenHandler),\n \n+ ('/facebook/server/access_token', FacebookServerAccessTokenHandler),\n+ ('/facebook/server/me', FacebookServerMeHandler),\n ('/twitter/server/access_token', TwitterServerAccessTokenHandler),\n (r'/twitter/api/users/show/(.*)\\.json', TwitterServerShowUserHandler),\n (r'/twitter/api/account/verify_credentials\\.json', TwitterServerVerifyCredentialsHandler),\n ],\n http_client=self.http_client,\n twitter_consumer_key='test_twitter_consumer_key',\n- twitter_consumer_secret='test_twitter_consumer_secret')\n+ twitter_consumer_secret='test_twitter_consumer_secret',\n+ facebook_api_key='test_facebook_api_key',\n+ facebook_secret='test_facebook_secret')\n \n def test_openid_redirect(self):\n response = self.fetch('/openid/client/login', follow_redirects=False)\n@@ -358,6 +396,13 @@ class AuthTest(AsyncHTTPTestCase):\n self.assertEqual(response.code, 302)\n self.assertTrue('/oauth2/server/authorize?' in response.headers['Location'])\n \n+ def test_facebook_login(self):\n+ response = self.fetch('/facebook/client/login', follow_redirects=False)\n+ self.assertEqual(response.code, 302)\n+ self.assertTrue('/facebook/server/authorize?' in response.headers['Location'])\n+ response = self.fetch('/facebook/client/login?code=1234', follow_redirects=False)\n+ self.assertEqual(response.code, 200)\n+\n def base_twitter_redirect(self, url):\n # Same as test_oauth10a_redirect\n response = self.fetch(url, follow_redirects=False)\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [],\n \"has_test_patch\": true,\n \"is_lite\": true,\n \"llm_score\": {\n \"difficulty_score\": 2,\n \"issue_text_score\": 2,\n \"test_score\": 2\n },\n \"num_modified_files\": 1\n}"},"version":{"kind":"string","value":"4.2"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"pytest\",\n \"pip_packages\": [\n \"futures\",\n \"mock\",\n \"monotonic\",\n \"trollius\",\n \"pytest\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\n \"python\": \"3.5\",\n \"reqs_path\": null,\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work\ncertifi==2021.5.30\nfutures==2.2.0\nimportlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1631916693255/work\niniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work\nmock==5.2.0\nmonotonic==1.6\nmore-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work\npackaging @ file:///tmp/build/80754af9/packaging_1637314298585/work\npluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work\npy @ file:///opt/conda/conda-bld/py_1644396412707/work\npyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work\npytest==6.2.4\nsix==1.17.0\ntoml @ file:///tmp/build/80754af9/toml_1616166611790/work\n-e git+https://github.com/tornadoweb/tornado.git@4ee9ba94de11aaa4f932560fa2b3d8ceb8c61d2a#egg=tornado\ntrollius==2.1.post2\ntyping_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work\nzipp @ file:///tmp/build/80754af9/zipp_1633618647012/work\n"},"environment":{"kind":"string","value":"name: tornado\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - attrs=21.4.0=pyhd3eb1b0_0\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2021.5.30=py36h06a4308_0\n - importlib-metadata=4.8.1=py36h06a4308_0\n - importlib_metadata=4.8.1=hd3eb1b0_0\n - iniconfig=1.1.1=pyhd3eb1b0_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.3=he6710b0_2\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - more-itertools=8.12.0=pyhd3eb1b0_0\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - packaging=21.3=pyhd3eb1b0_0\n - pip=21.2.2=py36h06a4308_0\n - pluggy=0.13.1=py36h06a4308_0\n - py=1.11.0=pyhd3eb1b0_0\n - pyparsing=3.0.4=pyhd3eb1b0_0\n - pytest=6.2.4=py36h06a4308_2\n - python=3.6.13=h12debd9_1\n - readline=8.2=h5eee18b_0\n - setuptools=58.0.4=py36h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - toml=0.10.2=pyhd3eb1b0_0\n - typing_extensions=4.1.1=pyh06a4308_0\n - wheel=0.37.1=pyhd3eb1b0_0\n - xz=5.6.4=h5eee18b_1\n - zipp=3.6.0=pyhd3eb1b0_0\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - futures==2.2.0\n - mock==5.2.0\n - monotonic==1.6\n - six==1.17.0\n - trollius==2.1.post2\nprefix: /opt/conda/envs/tornado\n"},"FAIL_TO_PASS":{"kind":"list like","value":["tornado/test/auth_test.py::AuthTest::test_facebook_login"],"string":"[\n \"tornado/test/auth_test.py::AuthTest::test_facebook_login\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["tornado/test/auth_test.py::AuthTest::test_oauth10_get_user","tornado/test/auth_test.py::AuthTest::test_oauth10_redirect","tornado/test/auth_test.py::AuthTest::test_oauth10_request_parameters","tornado/test/auth_test.py::AuthTest::test_oauth10a_get_user","tornado/test/auth_test.py::AuthTest::test_oauth10a_get_user_coroutine_exception","tornado/test/auth_test.py::AuthTest::test_oauth10a_redirect","tornado/test/auth_test.py::AuthTest::test_oauth10a_request_parameters","tornado/test/auth_test.py::AuthTest::test_oauth2_redirect","tornado/test/auth_test.py::AuthTest::test_openid_get_user","tornado/test/auth_test.py::AuthTest::test_openid_redirect","tornado/test/auth_test.py::AuthTest::test_twitter_get_user","tornado/test/auth_test.py::AuthTest::test_twitter_redirect","tornado/test/auth_test.py::AuthTest::test_twitter_redirect_gen_coroutine","tornado/test/auth_test.py::AuthTest::test_twitter_redirect_gen_engine","tornado/test/auth_test.py::AuthTest::test_twitter_show_user","tornado/test/auth_test.py::AuthTest::test_twitter_show_user_error","tornado/test/auth_test.py::AuthTest::test_twitter_show_user_future","tornado/test/auth_test.py::AuthTest::test_twitter_show_user_future_error","tornado/test/auth_test.py::GoogleOAuth2Test::test_google_login"],"string":"[\n \"tornado/test/auth_test.py::AuthTest::test_oauth10_get_user\",\n \"tornado/test/auth_test.py::AuthTest::test_oauth10_redirect\",\n \"tornado/test/auth_test.py::AuthTest::test_oauth10_request_parameters\",\n \"tornado/test/auth_test.py::AuthTest::test_oauth10a_get_user\",\n \"tornado/test/auth_test.py::AuthTest::test_oauth10a_get_user_coroutine_exception\",\n \"tornado/test/auth_test.py::AuthTest::test_oauth10a_redirect\",\n \"tornado/test/auth_test.py::AuthTest::test_oauth10a_request_parameters\",\n \"tornado/test/auth_test.py::AuthTest::test_oauth2_redirect\",\n \"tornado/test/auth_test.py::AuthTest::test_openid_get_user\",\n \"tornado/test/auth_test.py::AuthTest::test_openid_redirect\",\n \"tornado/test/auth_test.py::AuthTest::test_twitter_get_user\",\n \"tornado/test/auth_test.py::AuthTest::test_twitter_redirect\",\n \"tornado/test/auth_test.py::AuthTest::test_twitter_redirect_gen_coroutine\",\n \"tornado/test/auth_test.py::AuthTest::test_twitter_redirect_gen_engine\",\n \"tornado/test/auth_test.py::AuthTest::test_twitter_show_user\",\n \"tornado/test/auth_test.py::AuthTest::test_twitter_show_user_error\",\n \"tornado/test/auth_test.py::AuthTest::test_twitter_show_user_future\",\n \"tornado/test/auth_test.py::AuthTest::test_twitter_show_user_future_error\",\n \"tornado/test/auth_test.py::GoogleOAuth2Test::test_google_login\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"Apache License 2.0"},"__index_level_0__":{"kind":"number","value":255,"string":"255"}}},{"rowIdx":256,"cells":{"instance_id":{"kind":"string","value":"networkx__networkx-1781"},"base_commit":{"kind":"string","value":"328d899fb17bac857eedd9ec3e03f4ede9b11c63"},"created_at":{"kind":"string","value":"2015-09-29 20:34:48"},"environment_setup_commit":{"kind":"string","value":"bd19b43751b5bd433ebc5a9ab173938f721af2dd"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/networkx/readwrite/gml.py b/networkx/readwrite/gml.py\nindex d9e49d336..d3c8b8527 100644\n--- a/networkx/readwrite/gml.py\n+++ b/networkx/readwrite/gml.py\n@@ -286,7 +286,7 @@ def parse_gml_lines(lines, label, destringizer):\n \"\"\"\n def tokenize():\n patterns = [\n- r'[A-Za-z][0-9A-Za-z]*\\s+', # keys\n+ r'[A-Za-z][0-9A-Za-z_]*\\s+', # keys\n r'[+-]?(?:[0-9]*\\.[0-9]+|[0-9]+\\.[0-9]*)(?:[Ee][+-]?[0-9]+)?', # reals\n r'[+-]?[0-9]+', # ints\n r'\".*?\"', # strings\n"},"problem_statement":{"kind":"string","value":"Cannot parse GML files from Cytoscape, possible regression?\nThis does not appear to be a duplicate of #321 -- I cannot parse .GML files produced from Cytoscape, including the \"simple.gml\" [file](https://networkx.lanl.gov/trac/attachment/ticket/324/simple.gml) as reported in #321. Below is the output I receive if parsing the file provided in that issue. \r\n\r\nFrom reading the comments, it looks like the suggestion is to either modify the GML parser directly in networkx (allowing slightly out of format GML files), or to modify the output from Cytoscape. If I issue a PR for the GML parser modification, would there be support for it?\r\n\r\n```python\r\n10:20:28 (mcdonadt@8086):~> nx.__version__\r\nOut[5]: '1.10'\r\n\r\n10:20:32 (mcdonadt@8086):~> g = nx.read_gml('Downloads/simple.gml')\r\n---------------------------------------------------------------------------\r\nNetworkXError Traceback (most recent call last)\r\n in ()\r\n----> 1 g = nx.read_gml('Downloads/simple.gml')\r\n\r\n/Users/mcdonadt/miniconda3/envs/unifrac-network/lib/python3.4/site-packages/networkx/readwrite/gml.py in read_gml(path, label, destringizer)\r\n\r\n/Users/mcdonadt/miniconda3/envs/unifrac-network/lib/python3.4/site-packages/networkx/utils/decorators.py in _open_file(func, *args, **kwargs)\r\n 218 # Finally, we call the original function, making sure to close the fobj.\r\n 219 try:\r\n--> 220 result = func(*new_args, **kwargs)\r\n 221 finally:\r\n 222 if close_fobj:\r\n\r\n/Users/mcdonadt/miniconda3/envs/unifrac-network/lib/python3.4/site-packages/networkx/readwrite/gml.py in read_gml(path, label, destringizer)\r\n 208 yield line\r\n 209\r\n--> 210 G = parse_gml_lines(filter_lines(path), label, destringizer)\r\n 211 return G\r\n 212\r\n\r\n/Users/mcdonadt/miniconda3/envs/unifrac-network/lib/python3.4/site-packages/networkx/readwrite/gml.py in parse_gml_lines(lines, label, destringizer)\r\n 381\r\n 382 tokens = tokenize()\r\n--> 383 graph = parse_graph()\r\n 384\r\n 385 directed = graph.pop('directed', False)\r\n\r\n/Users/mcdonadt/miniconda3/envs/unifrac-network/lib/python3.4/site-packages/networkx/readwrite/gml.py in parse_graph()\r\n 370\r\n 371 def parse_graph():\r\n--> 372 curr_token, dct = parse_kv(next(tokens))\r\n 373 if curr_token[0] is not None: # EOF\r\n 374 unexpected(curr_token, 'EOF')\r\n\r\n/Users/mcdonadt/miniconda3/envs/unifrac-network/lib/python3.4/site-packages/networkx/readwrite/gml.py in parse_kv(curr_token)\r\n 355 curr_token = next(tokens)\r\n 356 elif type == 4: # dict start\r\n--> 357 curr_token, value = parse_dict(curr_token)\r\n 358 else:\r\n 359 unexpected(curr_token, \"an int, float, string or '['\")\r\n\r\n/Users/mcdonadt/miniconda3/envs/unifrac-network/lib/python3.4/site-packages/networkx/readwrite/gml.py in parse_dict(curr_token)\r\n 365 def parse_dict(curr_token):\r\n 366 curr_token = consume(curr_token, 4, \"'['\") # dict start\r\n--> 367 curr_token, dct = parse_kv(curr_token)\r\n 368 curr_token = consume(curr_token, 5, \"']'\") # dict end\r\n 369 return curr_token, dct\r\n\r\n/Users/mcdonadt/miniconda3/envs/unifrac-network/lib/python3.4/site-packages/networkx/readwrite/gml.py in parse_kv(curr_token)\r\n 355 curr_token = next(tokens)\r\n 356 elif type == 4: # dict start\r\n--> 357 curr_token, value = parse_dict(curr_token)\r\n 358 else:\r\n 359 unexpected(curr_token, \"an int, float, string or '['\")\r\n\r\n/Users/mcdonadt/miniconda3/envs/unifrac-network/lib/python3.4/site-packages/networkx/readwrite/gml.py in parse_dict(curr_token)\r\n 364\r\n 365 def parse_dict(curr_token):\r\n--> 366 curr_token = consume(curr_token, 4, \"'['\") # dict start\r\n 367 curr_token, dct = parse_kv(curr_token)\r\n 368 curr_token = consume(curr_token, 5, \"']'\") # dict end\r\n\r\n/Users/mcdonadt/miniconda3/envs/unifrac-network/lib/python3.4/site-packages/networkx/readwrite/gml.py in consume(curr_token, type, expected)\r\n 334 def consume(curr_token, type, expected):\r\n 335 if curr_token[0] == type:\r\n--> 336 return next(tokens)\r\n 337 unexpected(curr_token, expected)\r\n 338\r\n\r\n/Users/mcdonadt/miniconda3/envs/unifrac-network/lib/python3.4/site-packages/networkx/readwrite/gml.py in tokenize()\r\n 321 else:\r\n 322 raise NetworkXError('cannot tokenize %r at (%d, %d)' %\r\n--> 323 (line[pos:], lineno + 1, pos + 1))\r\n 324 lineno += 1\r\n 325 yield (None, None, lineno + 1, 1) # EOF\r\n\r\nNetworkXError: cannot tokenize 'root_index\\t-3' at (5, 3)\r\n```"},"repo":{"kind":"string","value":"networkx/networkx"},"test_patch":{"kind":"string","value":"diff --git a/networkx/readwrite/tests/test_gml.py b/networkx/readwrite/tests/test_gml.py\nindex 85b069127..042061032 100644\n--- a/networkx/readwrite/tests/test_gml.py\n+++ b/networkx/readwrite/tests/test_gml.py\n@@ -65,6 +65,90 @@ graph [\n ]\n ]\n \"\"\"\n+ def test_parse_gml_cytoscape_bug(self):\n+ # example from issue #321, originally #324 in trac\n+ cytoscape_example = \"\"\"\n+Creator \"Cytoscape\"\n+Version 1.0\n+graph [\n+ node [\n+ root_index -3\n+ id -3\n+ graphics [\n+ x -96.0\n+ y -67.0\n+ w 40.0\n+ h 40.0\n+ fill \"#ff9999\"\n+ type \"ellipse\"\n+ outline \"#666666\"\n+ outline_width 1.5\n+ ]\n+ label \"node2\"\n+ ]\n+ node [\n+ root_index -2\n+ id -2\n+ graphics [\n+ x 63.0\n+ y 37.0\n+ w 40.0\n+ h 40.0\n+ fill \"#ff9999\"\n+ type \"ellipse\"\n+ outline \"#666666\"\n+ outline_width 1.5\n+ ]\n+ label \"node1\"\n+ ]\n+ node [\n+ root_index -1\n+ id -1\n+ graphics [\n+ x -31.0\n+ y -17.0\n+ w 40.0\n+ h 40.0\n+ fill \"#ff9999\"\n+ type \"ellipse\"\n+ outline \"#666666\"\n+ outline_width 1.5\n+ ]\n+ label \"node0\"\n+ ]\n+ edge [\n+ root_index -2\n+ target -2\n+ source -1\n+ graphics [\n+ width 1.5\n+ fill \"#0000ff\"\n+ type \"line\"\n+ Line [\n+ ]\n+ source_arrow 0\n+ target_arrow 3\n+ ]\n+ label \"DirectedEdge\"\n+ ]\n+ edge [\n+ root_index -1\n+ target -1\n+ source -3\n+ graphics [\n+ width 1.5\n+ fill \"#0000ff\"\n+ type \"line\"\n+ Line [\n+ ]\n+ source_arrow 0\n+ target_arrow 3\n+ ]\n+ label \"DirectedEdge\"\n+ ]\n+]\n+\"\"\"\n+ nx.parse_gml(cytoscape_example)\n \n def test_parse_gml(self):\n G = nx.parse_gml(self.simple_data, label='label')\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_hyperlinks\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 0,\n \"issue_text_score\": 2,\n \"test_score\": 2\n },\n \"num_modified_files\": 1\n}"},"version":{"kind":"string","value":"1.102"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"requirements.txt\",\n \"pip_packages\": [\n \"nose\",\n \"pytest\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y libgdal-dev graphviz\"\n ],\n \"python\": \"3.6\",\n \"reqs_path\": [\n \"requirements/default.txt\",\n \"requirements/test.txt\"\n ],\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"attrs==22.2.0\ncertifi==2021.5.30\ndecorator==5.1.1\nimportlib-metadata==4.8.3\niniconfig==1.1.1\n-e git+https://github.com/networkx/networkx.git@328d899fb17bac857eedd9ec3e03f4ede9b11c63#egg=networkx\nnose==1.3.7\npackaging==21.3\npluggy==1.0.0\npy==1.11.0\npyparsing==3.1.4\npytest==7.0.1\ntomli==1.2.3\ntyping_extensions==4.1.1\nzipp==3.6.0\n"},"environment":{"kind":"string","value":"name: networkx\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2021.5.30=py36h06a4308_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.3=he6710b0_2\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - pip=21.2.2=py36h06a4308_0\n - python=3.6.13=h12debd9_1\n - readline=8.2=h5eee18b_0\n - setuptools=58.0.4=py36h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - wheel=0.37.1=pyhd3eb1b0_0\n - xz=5.6.4=h5eee18b_1\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - attrs==22.2.0\n - decorator==5.1.1\n - importlib-metadata==4.8.3\n - iniconfig==1.1.1\n - nose==1.3.7\n - packaging==21.3\n - pluggy==1.0.0\n - py==1.11.0\n - pyparsing==3.1.4\n - pytest==7.0.1\n - tomli==1.2.3\n - typing-extensions==4.1.1\n - zipp==3.6.0\nprefix: /opt/conda/envs/networkx\n"},"FAIL_TO_PASS":{"kind":"list like","value":["networkx/readwrite/tests/test_gml.py::TestGraph::test_parse_gml_cytoscape_bug"],"string":"[\n \"networkx/readwrite/tests/test_gml.py::TestGraph::test_parse_gml_cytoscape_bug\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":["networkx/readwrite/tests/test_gml.py::TestGraph::test_parse_gml","networkx/readwrite/tests/test_gml.py::TestGraph::test_read_gml"],"string":"[\n \"networkx/readwrite/tests/test_gml.py::TestGraph::test_parse_gml\",\n \"networkx/readwrite/tests/test_gml.py::TestGraph::test_read_gml\"\n]"},"PASS_TO_PASS":{"kind":"list like","value":["networkx/readwrite/tests/test_gml.py::TestGraph::test_relabel_duplicate","networkx/readwrite/tests/test_gml.py::TestGraph::test_tuplelabels","networkx/readwrite/tests/test_gml.py::TestGraph::test_quotes","networkx/readwrite/tests/test_gml.py::TestGraph::test_name","networkx/readwrite/tests/test_gml.py::TestGraph::test_graph_types","networkx/readwrite/tests/test_gml.py::TestGraph::test_data_types","networkx/readwrite/tests/test_gml.py::TestGraph::test_escape_unescape","networkx/readwrite/tests/test_gml.py::TestGraph::test_exceptions"],"string":"[\n \"networkx/readwrite/tests/test_gml.py::TestGraph::test_relabel_duplicate\",\n \"networkx/readwrite/tests/test_gml.py::TestGraph::test_tuplelabels\",\n \"networkx/readwrite/tests/test_gml.py::TestGraph::test_quotes\",\n \"networkx/readwrite/tests/test_gml.py::TestGraph::test_name\",\n \"networkx/readwrite/tests/test_gml.py::TestGraph::test_graph_types\",\n \"networkx/readwrite/tests/test_gml.py::TestGraph::test_data_types\",\n \"networkx/readwrite/tests/test_gml.py::TestGraph::test_escape_unescape\",\n \"networkx/readwrite/tests/test_gml.py::TestGraph::test_exceptions\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"BSD 3-Clause"},"__index_level_0__":{"kind":"number","value":256,"string":"256"}}},{"rowIdx":257,"cells":{"instance_id":{"kind":"string","value":"keleshev__schema-91"},"base_commit":{"kind":"string","value":"eb7670f0f4615195393dc5350d49fa9a33304137"},"created_at":{"kind":"string","value":"2015-09-30 21:18:29"},"environment_setup_commit":{"kind":"string","value":"eb7670f0f4615195393dc5350d49fa9a33304137"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/schema.py b/schema.py\nindex b8abee4..f4f5460 100644\n--- a/schema.py\n+++ b/schema.py\n@@ -109,7 +109,7 @@ class Schema(object):\n if flavor == ITERABLE:\n data = Schema(type(s), error=e).validate(data)\n o = Or(*s, error=e)\n- return type(s)(o.validate(d) for d in data)\n+ return type(data)(o.validate(d) for d in data)\n if flavor == DICT:\n data = Schema(dict, error=e).validate(data)\n new = type(data)() # new - is a dict of the validated values\n"},"problem_statement":{"kind":"string","value":"Inconsistent return types for validate: type(schema) or type(data)?\nI've noted a small inconsistency when validating with iterable and dict schemas:\r\n\r\n```python\r\n if flavor == ITERABLE:\r\n data = Schema(type(s), error=e).validate(data)\r\n return type(s)(Or(*s, error=e).validate(d) for d in data)\r\n if flavor == DICT:\r\n data = Schema(dict, error=e).validate(data)\r\n new = type(data)() # new - is a dict of the validated values\r\n ...\r\n return new\r\n```\r\n\r\nBriefly, when validating with iterable schemas the return type is that of the schema, when validating with dict schemas it's that of the input.\r\n\r\nPersonally I think that it's more flexible to have the return type match the one of the input.\r\n\r\nIdeas, preferences?"},"repo":{"kind":"string","value":"keleshev/schema"},"test_patch":{"kind":"string","value":"diff --git a/test_schema.py b/test_schema.py\nindex 967dec0..e124fc9 100644\n--- a/test_schema.py\n+++ b/test_schema.py\n@@ -408,3 +408,10 @@ def test_exception_handling_with_bad_validators():\n except SchemaError as e:\n assert \"TypeError\" in e.args[0]\n raise\n+\n+\n+def test_issue_83_iterable_validation_return_type():\n+ TestSetType = type(\"TestSetType\", (set,), dict())\n+ data = TestSetType([\"test\", \"strings\"])\n+ s = Schema(set([str]))\n+ assert isinstance(s.validate(data), TestSetType)\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [],\n \"has_test_patch\": true,\n \"is_lite\": true,\n \"llm_score\": {\n \"difficulty_score\": 0,\n \"issue_text_score\": 0,\n \"test_score\": 0\n },\n \"num_modified_files\": 1\n}"},"version":{"kind":"string","value":"0.3"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"requirements.txt\",\n \"pip_packages\": [\n \"pytest\",\n \"pytest-cov\",\n \"coverage\"\n ],\n \"pre_install\": [],\n \"python\": \"3.5\",\n \"reqs_path\": null,\n \"test_cmd\": \"pytest --doctest-glob=README.rst --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"attrs==22.2.0\ncertifi==2021.5.30\ncoverage==6.2\nimportlib-metadata==4.8.3\niniconfig==1.1.1\npackaging==21.3\npluggy==1.0.0\npy==1.11.0\npyparsing==3.1.4\npytest==7.0.1\npytest-cov==4.0.0\n-e git+https://github.com/keleshev/schema.git@eb7670f0f4615195393dc5350d49fa9a33304137#egg=schema\ntomli==1.2.3\ntyping_extensions==4.1.1\nzipp==3.6.0\n"},"environment":{"kind":"string","value":"name: schema\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2021.5.30=py36h06a4308_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.3=he6710b0_2\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - pip=21.2.2=py36h06a4308_0\n - python=3.6.13=h12debd9_1\n - readline=8.2=h5eee18b_0\n - setuptools=58.0.4=py36h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - wheel=0.37.1=pyhd3eb1b0_0\n - xz=5.6.4=h5eee18b_1\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - attrs==22.2.0\n - coverage==6.2\n - importlib-metadata==4.8.3\n - iniconfig==1.1.1\n - packaging==21.3\n - pluggy==1.0.0\n - py==1.11.0\n - pyparsing==3.1.4\n - pytest==7.0.1\n - pytest-cov==4.0.0\n - tomli==1.2.3\n - typing-extensions==4.1.1\n - zipp==3.6.0\nprefix: /opt/conda/envs/schema\n"},"FAIL_TO_PASS":{"kind":"list like","value":["test_schema.py::test_issue_83_iterable_validation_return_type"],"string":"[\n \"test_schema.py::test_issue_83_iterable_validation_return_type\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["test_schema.py::test_schema","test_schema.py::test_validate_file","test_schema.py::test_and","test_schema.py::test_or","test_schema.py::test_validate_list","test_schema.py::test_list_tuple_set_frozenset","test_schema.py::test_strictly","test_schema.py::test_dict","test_schema.py::test_dict_keys","test_schema.py::test_dict_optional_keys","test_schema.py::test_dict_optional_defaults","test_schema.py::test_dict_subtypes","test_schema.py::test_complex","test_schema.py::test_nice_errors","test_schema.py::test_use_error_handling","test_schema.py::test_or_error_handling","test_schema.py::test_and_error_handling","test_schema.py::test_schema_error_handling","test_schema.py::test_use_json","test_schema.py::test_error_reporting","test_schema.py::test_schema_repr","test_schema.py::test_validate_object","test_schema.py::test_issue_9_prioritized_key_comparison","test_schema.py::test_issue_9_prioritized_key_comparison_in_dicts","test_schema.py::test_missing_keys_exception_with_non_str_dict_keys","test_schema.py::test_issue_56_cant_rely_on_callables_to_have_name","test_schema.py::test_exception_handling_with_bad_validators"],"string":"[\n \"test_schema.py::test_schema\",\n \"test_schema.py::test_validate_file\",\n \"test_schema.py::test_and\",\n \"test_schema.py::test_or\",\n \"test_schema.py::test_validate_list\",\n \"test_schema.py::test_list_tuple_set_frozenset\",\n \"test_schema.py::test_strictly\",\n \"test_schema.py::test_dict\",\n \"test_schema.py::test_dict_keys\",\n \"test_schema.py::test_dict_optional_keys\",\n \"test_schema.py::test_dict_optional_defaults\",\n \"test_schema.py::test_dict_subtypes\",\n \"test_schema.py::test_complex\",\n \"test_schema.py::test_nice_errors\",\n \"test_schema.py::test_use_error_handling\",\n \"test_schema.py::test_or_error_handling\",\n \"test_schema.py::test_and_error_handling\",\n \"test_schema.py::test_schema_error_handling\",\n \"test_schema.py::test_use_json\",\n \"test_schema.py::test_error_reporting\",\n \"test_schema.py::test_schema_repr\",\n \"test_schema.py::test_validate_object\",\n \"test_schema.py::test_issue_9_prioritized_key_comparison\",\n \"test_schema.py::test_issue_9_prioritized_key_comparison_in_dicts\",\n \"test_schema.py::test_missing_keys_exception_with_non_str_dict_keys\",\n \"test_schema.py::test_issue_56_cant_rely_on_callables_to_have_name\",\n \"test_schema.py::test_exception_handling_with_bad_validators\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"MIT License"},"__index_level_0__":{"kind":"number","value":257,"string":"257"}}},{"rowIdx":258,"cells":{"instance_id":{"kind":"string","value":"Stranger6667__pyanyapi-22"},"base_commit":{"kind":"string","value":"e5b7aadff6d02eac82e27cb4ad1f8bc9a4fb2eb0"},"created_at":{"kind":"string","value":"2015-10-01 09:10:15"},"environment_setup_commit":{"kind":"string","value":"fef649317fa4d2717c35a697bf10941691c4b3fe"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/README.rst b/README.rst\nindex b01d832..35babdf 100644\n--- a/README.rst\n+++ b/README.rst\n@@ -31,7 +31,7 @@ Usage\n -----\n \n Library provides an ability to create API over various content.\n-Currently there are bundled tools to work with HTML, XML, JSON.\n+Currently there are bundled tools to work with HTML, XML, JSON and YAML.\n Initially it was created to work with ``requests`` library.\n \n Basic setup\n@@ -139,6 +139,22 @@ Settings attribute is merged from all ancestors of current parser.\n >>> SecondChildParser({'child': '//more'}).settings['child']\n //more\n \n+Results stripping\n+~~~~~~~~~~~~~~~~~\n+\n+Parsers can automagically strip trailing whitespaces with ``strip=True`` option.\n+\n+.. code:: python\n+\n+ from pyanyapi import RegExpParser\n+\n+\n+ >>> settings = {'p': 'string(//p)'}\n+ >>> XMLParser(settings).parse('

Pcontent

').p\n+ Pcontent\n+ >>> XMLParser(settings, strip=True).parse('

Pcontent

).p\n+ Pcontent\n+\n HTML & XML\n ~~~~~~~~~~\n \ndiff --git a/pyanyapi/_compat.py b/pyanyapi/_compat.py\nindex 6ef744e..6322456 100644\n--- a/pyanyapi/_compat.py\n+++ b/pyanyapi/_compat.py\n@@ -16,3 +16,9 @@ try:\n import ujson as json\n except ImportError:\n import json\n+\n+\n+try:\n+ string_types = (str, unicode)\n+except NameError:\n+ string_types = (str, )\ndiff --git a/pyanyapi/interfaces.py b/pyanyapi/interfaces.py\nindex 88122a4..7dfb67b 100644\n--- a/pyanyapi/interfaces.py\n+++ b/pyanyapi/interfaces.py\n@@ -6,7 +6,7 @@ import re\n \n import yaml\n \n-from ._compat import json, etree, objectify, XMLParser, HTMLParser\n+from ._compat import json, etree, objectify, XMLParser, HTMLParser, string_types\n from .exceptions import ResponseParseError\n from .helpers import memoize\n \n@@ -21,8 +21,9 @@ class BaseInterface(object):\n content = None\n empty_result = None\n \n- def __init__(self, content):\n+ def __init__(self, content, strip=False):\n self.content = content\n+ self.strip = strip\n self.parse = memoize(self.parse)\n \n @classmethod\n@@ -58,6 +59,11 @@ class BaseInterface(object):\n if hasattr(attr, '_attached') and type(attr).__name__ == 'cached_property'\n )\n \n+ def maybe_strip(self, value):\n+ if self.strip and isinstance(value, string_types):\n+ return value.strip()\n+ return value\n+\n \n # Uses as fallback. None - can be obtained from JSON's null, any string also can be, so unique object is a best choice\n EMPTY_RESULT = object()\n@@ -132,15 +138,13 @@ class XPathInterface(BaseInterface):\n result = self.parse(settings['base'])\n child_query = settings.get('children')\n if child_query:\n- return [''.join(element.xpath(child_query)).strip() for element in result]\n- elif isinstance(result, list):\n- return result\n- return result.strip()\n+ return [self.maybe_strip(''.join(element.xpath(child_query))) for element in result]\n+ return result\n \n return self.parse(settings)\n \n def parse(self, query):\n- return self.parsed_content.xpath(query)\n+ return self.maybe_strip(self.parsed_content.xpath(query))\n \n \n class XMLInterface(XPathInterface):\n@@ -209,7 +213,7 @@ class DictInterface(BaseInterface):\n return self.empty_result\n else:\n return target\n- return target\n+ return self.maybe_strip(target)\n \n def execute_method(self, settings):\n if isinstance(settings, dict):\n@@ -266,7 +270,7 @@ class AJAXInterface(JSONInterface):\n def get_inner_interface(self, text, json_part):\n if json_part not in self._inner_cache:\n inner_content = super(AJAXInterface, self).get_from_dict(text, json_part)\n- self._inner_cache[json_part] = self.inner_interface_class(inner_content)\n+ self._inner_cache[json_part] = self.inner_interface_class(inner_content, self.strip)\n return self._inner_cache[json_part]\n \n def get_from_dict(self, target, query):\n@@ -292,14 +296,14 @@ class RegExpInterface(BaseInterface):\n So, response will be like 'ok' or 'Error 100'.\n \"\"\"\n \n- def __init__(self, content, flags=0):\n+ def __init__(self, content, strip=False, flags=0):\n self.flags = flags\n- super(RegExpInterface, self).__init__(content)\n+ super(RegExpInterface, self).__init__(content, strip)\n \n def execute_method(self, settings):\n matches = re.findall(settings, self.content, self.flags)\n if matches:\n- return matches[0]\n+ return self.maybe_strip(matches[0])\n return self.empty_result\n \n def parse(self, query):\ndiff --git a/pyanyapi/parsers.py b/pyanyapi/parsers.py\nindex 05fceef..25c009f 100644\n--- a/pyanyapi/parsers.py\n+++ b/pyanyapi/parsers.py\n@@ -23,7 +23,8 @@ class BaseParser(object):\n \"\"\"\n interface_class = None\n \n- def __init__(self, settings=None):\n+ def __init__(self, settings=None, strip=False):\n+ self.strip = strip\n parents_settings = self.get_parents_settings()\n if settings:\n parents_settings.update(settings)\n@@ -68,7 +69,7 @@ class BaseParser(object):\n return self.parse(content).parse_all()\n \n def get_interface_kwargs(self):\n- return {'content': self.content}\n+ return {'content': self.content, 'strip': self.strip}\n \n def prepare_content(self, content):\n \"\"\"\n@@ -165,9 +166,9 @@ class AJAXParser(LXMLParser):\n class RegExpParser(BaseParser):\n interface_class = RegExpInterface\n \n- def __init__(self, settings=None, flags=0):\n+ def __init__(self, settings=None, strip=False, flags=0):\n self.flags = flags\n- super(RegExpParser, self).__init__(settings)\n+ super(RegExpParser, self).__init__(settings, strip)\n \n def get_interface_kwargs(self):\n kwargs = super(RegExpParser, self).get_interface_kwargs()\n"},"problem_statement":{"kind":"string","value":"Add option to strip results\nAt parser level, False by default"},"repo":{"kind":"string","value":"Stranger6667/pyanyapi"},"test_patch":{"kind":"string","value":"diff --git a/tests/test_parsers.py b/tests/test_parsers.py\nindex 25e54b3..85f4471 100644\n--- a/tests/test_parsers.py\n+++ b/tests/test_parsers.py\n@@ -179,7 +179,7 @@ def test_complex_config():\n parsed = XMLParser({'test': {'base': '//test', 'children': 'text()|*//text()'}}).parse(\n '123 234'\n )\n- assert parsed.test == ['123', '234']\n+ assert parsed.test == ['123 ', ' 234']\n \n \n def test_json_parse():\ndiff --git a/tests/test_strip.py b/tests/test_strip.py\nnew file mode 100644\nindex 0000000..d649312\n--- /dev/null\n+++ b/tests/test_strip.py\n@@ -0,0 +1,34 @@\n+# coding: utf-8\n+from .conftest import lxml_is_supported\n+from pyanyapi import RegExpParser, JSONParser, AJAXParser, XMLParser\n+\n+\n+JSON_CONTENT = '{\"container\":\" 1 \"}'\n+AJAX_CONTENT = '{\"content\": \"

Pcontent

\"}'\n+XML_CONTENT = '

Pcontent

'\n+\n+\n+def test_strip_regexp_parser():\n+ settings = {'all': '.+'}\n+ assert RegExpParser(settings).parse(' 1 ').all == ' 1 '\n+ assert RegExpParser(settings, strip=True).parse(' 1 ').all == '1'\n+\n+\n+def test_strip_json_parser():\n+ settings = {'all': 'container'}\n+ assert JSONParser(settings).parse(JSON_CONTENT).all == ' 1 '\n+ assert JSONParser(settings, strip=True).parse(JSON_CONTENT).all == '1'\n+\n+\n+@lxml_is_supported\n+def test_strip_ajax_parser():\n+ settings = {'all': 'content > string(//p)'}\n+ assert AJAXParser(settings).parse(AJAX_CONTENT).all == ' Pcontent '\n+ assert AJAXParser(settings, strip=True).parse(AJAX_CONTENT).all == 'Pcontent'\n+\n+\n+@lxml_is_supported\n+def test_strip_xml_parser():\n+ settings = {'all': 'string(//p)'}\n+ assert XMLParser(settings).parse(XML_CONTENT).all == ' Pcontent '\n+ assert XMLParser(settings, strip=True).parse(XML_CONTENT).all == 'Pcontent'\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_short_problem_statement\",\n \"has_many_modified_files\",\n \"has_many_hunks\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 2,\n \"issue_text_score\": 2,\n \"test_score\": 0\n },\n \"num_modified_files\": 4\n}"},"version":{"kind":"string","value":"0.4"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"requirements.txt\",\n \"pip_packages\": [\n \"pytest\",\n \"pytest-cov\"\n ],\n \"pre_install\": null,\n \"python\": \"3.5\",\n \"reqs_path\": [\n \"requirements.txt\"\n ],\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"attrs==22.2.0\ncertifi==2021.5.30\ncoverage==6.2\nimportlib-metadata==4.8.3\niniconfig==1.1.1\nlxml==5.3.1\npackaging==21.3\npluggy==1.0.0\npy==1.11.0\n-e git+https://github.com/Stranger6667/pyanyapi.git@e5b7aadff6d02eac82e27cb4ad1f8bc9a4fb2eb0#egg=pyanyapi\npyparsing==3.1.4\npytest==7.0.1\npytest-cov==4.0.0\nPyYAML==3.11\ntomli==1.2.3\ntyping_extensions==4.1.1\nujson==4.3.0\nzipp==3.6.0\n"},"environment":{"kind":"string","value":"name: pyanyapi\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2021.5.30=py36h06a4308_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.3=he6710b0_2\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - pip=21.2.2=py36h06a4308_0\n - python=3.6.13=h12debd9_1\n - readline=8.2=h5eee18b_0\n - setuptools=58.0.4=py36h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - wheel=0.37.1=pyhd3eb1b0_0\n - xz=5.6.4=h5eee18b_1\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - attrs==22.2.0\n - coverage==6.2\n - importlib-metadata==4.8.3\n - iniconfig==1.1.1\n - lxml==5.3.1\n - packaging==21.3\n - pluggy==1.0.0\n - py==1.11.0\n - pyparsing==3.1.4\n - pytest==7.0.1\n - pytest-cov==4.0.0\n - pyyaml==3.11\n - tomli==1.2.3\n - typing-extensions==4.1.1\n - ujson==4.3.0\n - zipp==3.6.0\nprefix: /opt/conda/envs/pyanyapi\n"},"FAIL_TO_PASS":{"kind":"list like","value":["tests/test_parsers.py::test_complex_config","tests/test_strip.py::test_strip_regexp_parser","tests/test_strip.py::test_strip_json_parser","tests/test_strip.py::test_strip_ajax_parser","tests/test_strip.py::test_strip_xml_parser"],"string":"[\n \"tests/test_parsers.py::test_complex_config\",\n \"tests/test_strip.py::test_strip_regexp_parser\",\n \"tests/test_strip.py::test_strip_json_parser\",\n \"tests/test_strip.py::test_strip_ajax_parser\",\n \"tests/test_strip.py::test_strip_xml_parser\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["tests/test_parsers.py::test_xml_objectify_parser","tests/test_parsers.py::test_xml_objectify_parser_error","tests/test_parsers.py::test_xml_parser_error","tests/test_parsers.py::test_yaml_parser_error","tests/test_parsers.py::test_xml_parsed[settings0]","tests/test_parsers.py::test_xml_parsed[settings1]","tests/test_parsers.py::test_xml_simple_settings","tests/test_parsers.py::test_json_parsed","tests/test_parsers.py::test_multiple_parser_join","tests/test_parsers.py::test_multiply_parsers_declaration","tests/test_parsers.py::test_empty_values[{\"container\":{\"test\":\"value\"}}-test-value]","tests/test_parsers.py::test_empty_values[{\"container\":{\"test\":\"value\"}}-second-None]","tests/test_parsers.py::test_empty_values[{\"container\":{\"fail\":[1]}}-second-None]","tests/test_parsers.py::test_empty_values[{\"container\":[[1],[],[3]]}-third-expected3]","tests/test_parsers.py::test_empty_values[{\"container\":null}-null-None]","tests/test_parsers.py::test_empty_values[{\"container\":[1,2]}-test-1,2]","tests/test_parsers.py::test_attributes","tests/test_parsers.py::test_efficient_parsing","tests/test_parsers.py::test_simple_config_xml_parser","tests/test_parsers.py::test_simple_config_json_parser","tests/test_parsers.py::test_settings_inheritance","tests/test_parsers.py::test_json_parse","tests/test_parsers.py::test_json_value_error_parse","tests/test_parsers.py::test_regexp_parse","tests/test_parsers.py::test_yaml_parse","tests/test_parsers.py::test_ajax_parser","tests/test_parsers.py::test_ajax_parser_cache","tests/test_parsers.py::test_ajax_parser_invalid_settings","tests/test_parsers.py::test_parse_memoization","tests/test_parsers.py::test_regexp_settings","tests/test_parsers.py::test_parse_all","tests/test_parsers.py::test_parse_all_combined_parser"],"string":"[\n \"tests/test_parsers.py::test_xml_objectify_parser\",\n \"tests/test_parsers.py::test_xml_objectify_parser_error\",\n \"tests/test_parsers.py::test_xml_parser_error\",\n \"tests/test_parsers.py::test_yaml_parser_error\",\n \"tests/test_parsers.py::test_xml_parsed[settings0]\",\n \"tests/test_parsers.py::test_xml_parsed[settings1]\",\n \"tests/test_parsers.py::test_xml_simple_settings\",\n \"tests/test_parsers.py::test_json_parsed\",\n \"tests/test_parsers.py::test_multiple_parser_join\",\n \"tests/test_parsers.py::test_multiply_parsers_declaration\",\n \"tests/test_parsers.py::test_empty_values[{\\\"container\\\":{\\\"test\\\":\\\"value\\\"}}-test-value]\",\n \"tests/test_parsers.py::test_empty_values[{\\\"container\\\":{\\\"test\\\":\\\"value\\\"}}-second-None]\",\n \"tests/test_parsers.py::test_empty_values[{\\\"container\\\":{\\\"fail\\\":[1]}}-second-None]\",\n \"tests/test_parsers.py::test_empty_values[{\\\"container\\\":[[1],[],[3]]}-third-expected3]\",\n \"tests/test_parsers.py::test_empty_values[{\\\"container\\\":null}-null-None]\",\n \"tests/test_parsers.py::test_empty_values[{\\\"container\\\":[1,2]}-test-1,2]\",\n \"tests/test_parsers.py::test_attributes\",\n \"tests/test_parsers.py::test_efficient_parsing\",\n \"tests/test_parsers.py::test_simple_config_xml_parser\",\n \"tests/test_parsers.py::test_simple_config_json_parser\",\n \"tests/test_parsers.py::test_settings_inheritance\",\n \"tests/test_parsers.py::test_json_parse\",\n \"tests/test_parsers.py::test_json_value_error_parse\",\n \"tests/test_parsers.py::test_regexp_parse\",\n \"tests/test_parsers.py::test_yaml_parse\",\n \"tests/test_parsers.py::test_ajax_parser\",\n \"tests/test_parsers.py::test_ajax_parser_cache\",\n \"tests/test_parsers.py::test_ajax_parser_invalid_settings\",\n \"tests/test_parsers.py::test_parse_memoization\",\n \"tests/test_parsers.py::test_regexp_settings\",\n \"tests/test_parsers.py::test_parse_all\",\n \"tests/test_parsers.py::test_parse_all_combined_parser\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"MIT License"},"__index_level_0__":{"kind":"number","value":258,"string":"258"}}},{"rowIdx":259,"cells":{"instance_id":{"kind":"string","value":"pypa__twine-138"},"base_commit":{"kind":"string","value":"5c06ed2049b633fe7f0b0e27df32d2715614ab3a"},"created_at":{"kind":"string","value":"2015-10-01 16:31:50"},"environment_setup_commit":{"kind":"string","value":"f487b7da9c42e4932bc33bf10d70cdc59fd16fd5"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/twine/repository.py b/twine/repository.py\nindex dc473aa..ae57821 100644\n--- a/twine/repository.py\n+++ b/twine/repository.py\n@@ -17,6 +17,9 @@ import requests\n from requests_toolbelt.multipart import MultipartEncoder\n \n \n+KEYWORDS_TO_NOT_FLATTEN = set([\"gpg_signature\", \"content\"])\n+\n+\n class Repository(object):\n def __init__(self, repository_url, username, password):\n self.url = repository_url\n@@ -30,11 +33,12 @@ class Repository(object):\n def _convert_data_to_list_of_tuples(data):\n data_to_send = []\n for key, value in data.items():\n- if isinstance(value, (list, tuple)):\n+ if (key in KEYWORDS_TO_NOT_FLATTEN or\n+ not isinstance(value, (list, tuple))):\n+ data_to_send.append((key, value))\n+ else:\n for item in value:\n data_to_send.append((key, item))\n- else:\n- data_to_send.append((key, value))\n return data_to_send\n \n def register(self, package):\n"},"problem_statement":{"kind":"string","value":"Bug in uploading signatures (again)\nThis time the bug originates from https://github.com/a-tal/twine/commit/13c83237246fe00c67b2e4ce72e8a935f89f9ee0 and the refactor.\r\n\r\nBecause that flattens all values that are sequences, it happens to flatten the `gpg_signature` field. That causes two parts to be for the `gpg_signature` which in turn translates to a list when parsed by PyPI and causes a 500 because PyPI tries to call a string operation on a list."},"repo":{"kind":"string","value":"pypa/twine"},"test_patch":{"kind":"string","value":"diff --git a/tests/test_repository.py b/tests/test_repository.py\nnew file mode 100644\nindex 0000000..3b8d84b\n--- /dev/null\n+++ b/tests/test_repository.py\n@@ -0,0 +1,49 @@\n+# Copyright 2015 Ian Cordasco\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+# http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+from twine import repository\n+\n+\n+def test_gpg_signature_structure_is_preserved():\n+ data = {\n+ 'gpg_signature': ('filename.asc', 'filecontent'),\n+ }\n+\n+ tuples = repository.Repository._convert_data_to_list_of_tuples(data)\n+ assert tuples == [('gpg_signature', ('filename.asc', 'filecontent'))]\n+\n+\n+def test_content_structure_is_preserved():\n+ data = {\n+ 'content': ('filename', 'filecontent'),\n+ }\n+\n+ tuples = repository.Repository._convert_data_to_list_of_tuples(data)\n+ assert tuples == [('content', ('filename', 'filecontent'))]\n+\n+\n+def test_iterables_are_flattened():\n+ data = {\n+ 'platform': ['UNKNOWN'],\n+ }\n+\n+ tuples = repository.Repository._convert_data_to_list_of_tuples(data)\n+ assert tuples == [('platform', 'UNKNOWN')]\n+\n+ data = {\n+ 'platform': ['UNKNOWN', 'ANOTHERPLATFORM'],\n+ }\n+\n+ tuples = repository.Repository._convert_data_to_list_of_tuples(data)\n+ assert tuples == [('platform', 'UNKNOWN'),\n+ ('platform', 'ANOTHERPLATFORM')]\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_hyperlinks\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 0,\n \"issue_text_score\": 2,\n \"test_score\": 0\n },\n \"num_modified_files\": 1\n}"},"version":{"kind":"string","value":"1.6"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"pytest\",\n \"pip_packages\": [\n \"pytest\",\n \"pytest-cov\",\n \"pytest-xdist\",\n \"pytest-mock\",\n \"pytest-asyncio\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\n \"python\": \"3.9\",\n \"reqs_path\": null,\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"certifi==2025.1.31\ncharset-normalizer==3.4.1\ncoverage==7.8.0\nexceptiongroup @ file:///croot/exceptiongroup_1706031385326/work\nexecnet==2.1.1\nidna==3.10\niniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work\npackaging @ file:///croot/packaging_1734472117206/work\npkginfo==1.12.1.2\npluggy @ file:///croot/pluggy_1733169602837/work\npytest @ file:///croot/pytest_1738938843180/work\npytest-asyncio==0.26.0\npytest-cov==6.0.0\npytest-mock==3.14.0\npytest-xdist==3.6.1\nrequests==2.32.3\nrequests-toolbelt==1.0.0\ntomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work\n-e git+https://github.com/pypa/twine.git@5c06ed2049b633fe7f0b0e27df32d2715614ab3a#egg=twine\ntyping_extensions==4.13.0\nurllib3==2.3.0\n"},"environment":{"kind":"string","value":"name: twine\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - ca-certificates=2025.2.25=h06a4308_0\n - exceptiongroup=1.2.0=py39h06a4308_0\n - iniconfig=1.1.1=pyhd3eb1b0_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.4.4=h6a678d5_1\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=3.0.16=h5eee18b_0\n - packaging=24.2=py39h06a4308_0\n - pip=25.0=py39h06a4308_0\n - pluggy=1.5.0=py39h06a4308_0\n - pytest=8.3.4=py39h06a4308_0\n - python=3.9.21=he870216_1\n - readline=8.2=h5eee18b_0\n - setuptools=75.8.0=py39h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - tomli=2.0.1=py39h06a4308_0\n - tzdata=2025a=h04d1e81_0\n - wheel=0.45.1=py39h06a4308_0\n - xz=5.6.4=h5eee18b_1\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - certifi==2025.1.31\n - charset-normalizer==3.4.1\n - coverage==7.8.0\n - execnet==2.1.1\n - idna==3.10\n - pkginfo==1.12.1.2\n - pytest-asyncio==0.26.0\n - pytest-cov==6.0.0\n - pytest-mock==3.14.0\n - pytest-xdist==3.6.1\n - requests==2.32.3\n - requests-toolbelt==1.0.0\n - typing-extensions==4.13.0\n - urllib3==2.3.0\nprefix: /opt/conda/envs/twine\n"},"FAIL_TO_PASS":{"kind":"list like","value":["tests/test_repository.py::test_gpg_signature_structure_is_preserved","tests/test_repository.py::test_content_structure_is_preserved"],"string":"[\n \"tests/test_repository.py::test_gpg_signature_structure_is_preserved\",\n \"tests/test_repository.py::test_content_structure_is_preserved\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["tests/test_repository.py::test_iterables_are_flattened"],"string":"[\n \"tests/test_repository.py::test_iterables_are_flattened\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"Apache License 2.0"},"__index_level_0__":{"kind":"number","value":259,"string":"259"}}},{"rowIdx":260,"cells":{"instance_id":{"kind":"string","value":"sympy__sympy-9951"},"base_commit":{"kind":"string","value":"0067acad3f6d438461100d4f96ec3dd227c1331c"},"created_at":{"kind":"string","value":"2015-10-02 20:08:37"},"environment_setup_commit":{"kind":"string","value":"0241b35cae5f2adc04dc37b25f7dc9c5f00bd746"},"hints_text":{"kind":"string","value":"leosartaj: This doesn't work ``is_increasing(1, x)``. Similarly for the others. This can be fixed by adding a ``sympify`` call.\nleosartaj: The ``symbol`` argument can be made a ``kwarg``. So that it is not necessary to write symbol for univariate functions.\r\n\r\nThis should work\r\n\r\n```\r\n>>> is_increasing(x)\r\nTrue\r\n```\nleosartaj: Some examples for multivariate functions can be added in the docstrings.\ngxyd: @leosartaj thank you very much for all the points you made. I was though waiting for @aktech to get on to verify. But now you have seen that's really nice.\ngxyd: @leosartaj @aktech i think this is ready for review.\nleosartaj: Please do not update the PR, when someone is reviewing. It gets confusing. :smile:\ngxyd: I have updated the error message. And addressed other comments.\nleosartaj: You can use tools like flake8 to catch issues with indentation and such.\nleosartaj: This looks good, +1 to merge if tests pass."},"patch":{"kind":"string","value":"diff --git a/doc/src/modules/polys/index.rst b/doc/src/modules/polys/index.rst\nindex d7249b538d..be212828af 100644\n--- a/doc/src/modules/polys/index.rst\n+++ b/doc/src/modules/polys/index.rst\n@@ -25,5 +25,4 @@ Contents\n reference.rst\n agca.rst\n internals.rst\n- ringseries.rst\n literature.rst\ndiff --git a/doc/src/modules/polys/internals.rst b/doc/src/modules/polys/internals.rst\nindex 46c53d7532..b4a2f2ca7f 100644\n--- a/doc/src/modules/polys/internals.rst\n+++ b/doc/src/modules/polys/internals.rst\n@@ -751,6 +751,29 @@ Modular GCD\n .. autofunction:: modgcd_multivariate\n .. autofunction:: func_field_modgcd\n \n+Manipulation of power series\n+****************************************************************************\n+.. currentmodule:: sympy.polys.ring_series\n+\n+Functions in this module carry the prefix ``rs_``, standing for \"ring series\".\n+They manipulate finite power series in the sparse representation provided\n+by ``polys.ring.ring``.\n+\n+\n+.. autofunction:: rs_trunc\n+.. autofunction:: rs_mul\n+.. autofunction:: rs_square\n+.. autofunction:: rs_pow\n+.. autofunction:: rs_series_inversion\n+.. autofunction:: rs_series_from_list\n+.. autofunction:: rs_integrate\n+.. autofunction:: rs_log\n+.. autofunction:: rs_exp\n+.. autofunction:: rs_newton\n+.. autofunction:: rs_hadamard_exp\n+.. autofunction:: rs_compose_add\n+\n+\n Undocumented\n ============\n \ndiff --git a/doc/src/modules/polys/ringseries.rst b/doc/src/modules/polys/ringseries.rst\ndeleted file mode 100644\nindex 4a810a2687..0000000000\n--- a/doc/src/modules/polys/ringseries.rst\n+++ /dev/null\n@@ -1,215 +0,0 @@\n-.. _polys-ringseries:\n-\n-=====================================\n-Series Manipulation using Polynomials\n-=====================================\n-\n-Any finite Taylor series, for all practical purposes is, in fact a polynomial.\n-This module makes use of the efficient representation and operations of sparse\n-polynomials for very fast multivariate series manipulations. Typical speedups\n-compared to SymPy's ``series`` method are in the range 20-100, with the gap\n-widening as the series being handled gets larger.\n-\n-All the functions expand any given series on some ring specified by the user.\n-Thus, the coefficients of the calculated series depend on the ring being used.\n-For example::\n-\n- >>> from sympy.polys import ring, QQ, RR\n- >>> from sympy.polys.ring_series import rs_sin\n- >>> R, x, y = ring('x, y', QQ)\n- >>> rs_sin(x*y, x, 5)\n- -1/6*x**3*y**3 + x*y\n-\n-``QQ`` stands for the Rational domain. Here all coefficients are rationals. It\n-is recommended to use ``QQ`` with ring series as it automatically chooses the\n-fastest Rational type.\n-\n-Similarly, if a Real domain is used::\n-\n- >>> R, x, y = ring('x, y', RR)\n- >>> rs_sin(x*y, x, 5)\n- -0.166666666666667*x**3*y**3 + x*y\n-\n-Though the definition of a polynomial limits the use of Polynomial module to\n-Taylor series, we extend it to allow Laurent and even Puiseux series (with\n-fractional exponents)::\n-\n- >>> from sympy.polys.ring_series import rs_cos, rs_tan\n- >>> R, x, y = ring('x, y', QQ)\n-\n- >>> rs_cos(x + x*y, x, 3)/x**3\n- -1/2*x**(-1)*y**2 - x**(-1)*y - 1/2*x**(-1) + x**(-3)\n-\n- >>> rs_tan(x**QQ(2, 5)*y**QQ(1, 2), x, 2)\n- 1/3*x**(6/5)*y**(3/2) + x**(2/5)*y**(1/2)\n-\n-By default, ``PolyElement`` did not allow non-natural numbers as exponents. It\n-converted a fraction to an integer and raised an error on getting negative\n-exponents. The goal of the ``ring series`` module is fast series expansion, and\n-not to use the ``polys`` module. The reason we use it as our backend is simply\n-because it implements a sparse representation and most of the basic functions\n-that we need. However, this default behaviour of ``polys`` was limiting for\n-``ring series``.\n-\n-Note that there is no such constraint (in having rational exponents) in the\n-data-structure used by ``polys``- ``dict``. Sparse polynomials\n-(``PolyElement``) use the Python dict to store a polynomial term by term, where\n-a tuple of exponents is the key and the coefficient of that term is the value.\n-There is no reason why we can't have rational values in the ``dict`` so as to\n-support rational exponents.\n-\n-So the approach we took was to modify sparse ``polys`` to allow non-natural\n-exponents. And it turned out to be quite simple. We only had to delete the\n-conversion to ``int`` of exponents in the ``__pow__`` method of\n-``PolyElement``. So::\n-\n- >>> x**QQ(3, 4)\n- x**(3/4)\n-\n-and not ``1`` as was the case earlier.\n-\n-Though this change violates the definition of a polynomial, it doesn't break\n-anything yet. Ideally, we shouldn't modify ``polys`` in any way. But to have\n-all the ``series`` capabilities we want, no other simple way was found. If need\n-be, we can separate the modified part of ``polys`` from core ``polys``. It\n-would be great if any other elegant solution is found.\n-\n-All series returned by the functions of this module are instances of the\n-``PolyElement`` class. To use them with other SymPy types, convert them to\n-``Expr``::\n-\n- >>> from sympy.polys.ring_series import rs_exp\n- >>> from sympy.abc import a, b, c\n- >>> series = rs_exp(x, x, 5)\n- >>> a + series.as_expr()\n- a + x**4/24 + x**3/6 + x**2/2 + x + 1\n-\n-rs_series\n-=========\n-\n-Direct use of elementary ring series functions does give more control, but is\n-limiting at the same time. Creating an appropriate ring for the desired series\n-expansion and knowing which ring series function to call, are things not\n-everyone might be familiar with.\n-\n-`rs\\_series` is a function that takes an arbitrary ``Expr`` and returns its\n-expansion by calling the appropriate ring series functions. The returned series\n-is a polynomial over the simplest (almost) possible ring that does the job. It\n-recursively builds the ring as it parses the given expression, adding\n-generators to the ring when it needs them. Some examples::\n-\n- >>> rs_series(sin(a + b), a, 5) # doctest: +SKIP\n- 1/24*sin(b)*a**4 - 1/2*sin(b)*a**2 + sin(b) - 1/6*cos(b)*a**3 + cos(b)*a\n-\n- >>> rs_series(sin(exp(a*b) + cos(a + c)), a, 2) # doctest: +SKIP\n- -sin(c)*cos(cos(c) + 1)*a + cos(cos(c) + 1)*a*b + sin(cos(c) + 1)\n-\n- >>> rs_series(sin(a + b)*cos(a + c)*tan(a**2 + b), a, 2) # doctest: +SKIP\n- cos(b)*cos(c)*tan(b)*a - sin(b)*sin(c)*tan(b)*a + sin(b)*cos(c)*tan(b)\n-\n-It can expand complicated multivariate expressions involving multiple functions\n-and most importantly, it does so blazingly fast::\n-\n- >>> %timeit ((sin(a) + cos(a))**10).series(a, 0, 5) # doctest: +SKIP\n- 1 loops, best of 3: 1.33 s per loop\n-\n- >>> %timeit rs_series((sin(a) + cos(a))**10, a, 5) # doctest: +SKIP\n- 100 loops, best of 3: 4.13 ms per loop\n-\n-`rs\\_series` is over 300 times faster. Given an expression to expand, there is\n-some fixed overhead to parse it. Thus, for larger orders, the speed\n-improvement becomes more prominent::\n-\n- >>> %timeit rs_series((sin(a) + cos(a))**10, a, 100) # doctest: +SKIP\n- 10 loops, best of 3: 32.8 ms per loop\n-\n-To figure out the right ring for a given expression, `rs\\_series` uses the\n-``sring`` function, which in turn uses other functions of ``polys``. As\n-explained above, non-natural exponents are not allowed. But the restriction is\n-on exponents and not generators. So, ``polys`` allows all sorts of symbolic\n-terms as generators to make sure that the exponent is a natural number::\n-\n- >>> from sympy.polys.rings import sring\n- >>> R, expr = sring(1/a**3 + a**QQ(3, 7)); R\n- Polynomial ring in 1/a, a**(1/7) over ZZ with lex order\n-\n-In the above example, `1/a` and `a**(1/7)` will be treated as completely\n-different atoms. For all practical purposes, we could let `b = 1/a` and `c =\n-a**(1/7)` and do the manipulations. Effectively, expressions involving `1/a`\n-and `a**(1/7)` (and their powers) will never simplify::\n-\n- >>> expr*R(1/a) # doctest: +SKIP\n- (1/a)**2 + (1/a)*(a**(1/7))**3\n-\n-This leads to similar issues with manipulating Laurent and Puiseux series as\n-faced earlier. Fortunately, this time we have an elegant solution and are able\n-to isolate the ``series`` and ``polys`` behaviour from one another. We\n-introduce a boolean flag ``series`` in the list of allowed ``Options`` for\n-polynomials (see :class:`sympy.polys.polyoptions.Options`). Thus, when we want\n-``sring`` to allow rational exponents we supply a ``series=True`` flag to\n-``sring``.\n-\n-Contribute\n-==========\n-\n-`rs\\_series` is not fully implemented yet. As of now, it supports only\n-multivariate Taylor expansions of expressions involving ``sin``, ``cos``,\n-``exp`` and ``tan``. Adding the remaining functions is not at all difficult and\n-they will be gradually added. If you are interested in helping, read the\n-comments in ``ring_series.py``. Currently, it does not support Puiseux series\n-(though the elementary functions do). This is expected to be fixed soon.\n-\n-You can also add more functions to ``ring_series.py``. Only elementary\n-functions are supported currently. The long term goal is to replace SymPy's\n-current ``series`` method with ``rs_series``.\n-\n-Manipulation of power series\n-****************************************************************************\n-.. currentmodule:: sympy.polys.ring_series\n-\n-Functions in this module carry the prefix ``rs_``, standing for \"ring series\".\n-They manipulate finite power series in the sparse representation provided\n-by ``polys.ring.ring``.\n-\n-**Elementary functions**\n-\n-.. autofunction:: rs_log\n-.. autofunction:: rs_LambertW\n-.. autofunction:: rs_exp\n-.. autofunction:: rs_atan\n-.. autofunction:: rs_asin\n-.. autofunction:: rs_tan\n-.. autofunction:: rs_cot\n-.. autofunction:: rs_sin\n-.. autofunction:: rs_cos\n-.. autofunction:: rs_cos_sin\n-.. autofunction:: rs_atanh\n-.. autofunction:: rs_sinh\n-.. autofunction:: rs_cosh\n-.. autofunction:: rs_tanh\n-.. autofunction:: rs_hadamard_exp\n-\n-**Operations**\n-\n-.. autofunction:: rs_mul\n-.. autofunction:: rs_square\n-.. autofunction:: rs_pow\n-.. autofunction:: rs_series_inversion\n-.. autofunction:: rs_series_reversion\n-.. autofunction:: rs_nth_root\n-.. autofunction:: rs_trunc\n-.. autofunction:: rs_subs\n-.. autofunction:: rs_diff\n-.. autofunction:: rs_integrate\n-.. autofunction:: rs_newton\n-.. autofunction:: rs_compose_add\n-\n-**Utility functions**\n-\n-.. autofunction:: rs_is_puiseux\n-.. autofunction:: rs_puiseux\n-.. autofunction:: rs_puiseux2\n-.. autofunction:: rs_series_from_list\n-.. autofunction:: rs_fun\n-.. autofunction:: mul_xin\n-.. autofunction:: pow_xin\ndiff --git a/sympy/calculus/singularities.py b/sympy/calculus/singularities.py\nindex 5ae0d11aee..b1ac1031dc 100644\n--- a/sympy/calculus/singularities.py\n+++ b/sympy/calculus/singularities.py\n@@ -1,3 +1,4 @@\n+from sympy.core.sympify import sympify\n from sympy.solvers.solveset import solveset\n from sympy.simplify import simplify\n from sympy import S\n@@ -38,7 +39,7 @@ def singularities(expr, sym):\n ###########################################################################\n \n \n-def is_increasing(f, interval=S.Reals):\n+def is_increasing(f, interval=S.Reals, symbol=None):\n \"\"\"\n Returns if a function is increasing or not, in the given\n ``Interval``.\n@@ -47,7 +48,7 @@ def is_increasing(f, interval=S.Reals):\n ========\n \n >>> from sympy import is_increasing\n- >>> from sympy.abc import x\n+ >>> from sympy.abc import x, y\n >>> from sympy import S, Interval, oo\n >>> is_increasing(x**3 - 3*x**2 + 4*x, S.Reals)\n True\n@@ -57,18 +58,27 @@ def is_increasing(f, interval=S.Reals):\n False\n >>> is_increasing(4*x**3 - 6*x**2 - 72*x + 30, Interval(-2, 3))\n False\n+ >>> is_increasing(x**2 + y, Interval(1, 2), x)\n+ True\n \n \"\"\"\n- if len(f.free_symbols) > 1:\n- raise NotImplementedError('is_increasing has not yet been implemented '\n- 'for multivariate expressions')\n- symbol = f.free_symbols.pop()\n+ f = sympify(f)\n+ free_sym = f.free_symbols\n+\n+ if symbol is None:\n+ if len(free_sym) > 1:\n+ raise NotImplementedError('is_increasing has not yet been implemented '\n+ 'for all multivariate expressions')\n+ if len(free_sym) == 0:\n+ return True\n+ symbol = free_sym.pop()\n+\n df = f.diff(symbol)\n df_nonneg_interval = solveset(df >= 0, symbol, domain=S.Reals)\n return interval.is_subset(df_nonneg_interval)\n \n \n-def is_strictly_increasing(f, interval=S.Reals):\n+def is_strictly_increasing(f, interval=S.Reals, symbol=None):\n \"\"\"\n Returns if a function is strictly increasing or not, in the given\n ``Interval``.\n@@ -77,7 +87,7 @@ def is_strictly_increasing(f, interval=S.Reals):\n ========\n \n >>> from sympy import is_strictly_increasing\n- >>> from sympy.abc import x\n+ >>> from sympy.abc import x, y\n >>> from sympy import Interval, oo\n >>> is_strictly_increasing(4*x**3 - 6*x**2 - 72*x + 30, Interval.Ropen(-oo, -2))\n True\n@@ -87,18 +97,27 @@ def is_strictly_increasing(f, interval=S.Reals):\n False\n >>> is_strictly_increasing(-x**2, Interval(0, oo))\n False\n+ >>> is_strictly_increasing(-x**2 + y, Interval(-oo, 0), x)\n+ False\n \n \"\"\"\n- if len(f.free_symbols) > 1:\n- raise NotImplementedError('is_strictly_increasing has not yet been '\n- 'implemented for multivariate expressions')\n- symbol = f.free_symbols.pop()\n+ f = sympify(f)\n+ free_sym = f.free_symbols\n+\n+ if symbol is None:\n+ if len(free_sym) > 1:\n+ raise NotImplementedError('is_strictly_increasing has not yet been implemented '\n+ 'for all multivariate expressions')\n+ elif len(free_sym) == 0:\n+ return False\n+ symbol = free_sym.pop()\n+\n df = f.diff(symbol)\n df_pos_interval = solveset(df > 0, symbol, domain=S.Reals)\n return interval.is_subset(df_pos_interval)\n \n \n-def is_decreasing(f, interval=S.Reals):\n+def is_decreasing(f, interval=S.Reals, symbol=None):\n \"\"\"\n Returns if a function is decreasing or not, in the given\n ``Interval``.\n@@ -107,7 +126,7 @@ def is_decreasing(f, interval=S.Reals):\n ========\n \n >>> from sympy import is_decreasing\n- >>> from sympy.abc import x\n+ >>> from sympy.abc import x, y\n >>> from sympy import S, Interval, oo\n >>> is_decreasing(1/(x**2 - 3*x), Interval.open(1.5, 3))\n True\n@@ -117,48 +136,66 @@ def is_decreasing(f, interval=S.Reals):\n False\n >>> is_decreasing(-x**2, Interval(-oo, 0))\n False\n+ >>> is_decreasing(-x**2 + y, Interval(-oo, 0), x)\n+ False\n \n \"\"\"\n- if len(f.free_symbols) > 1:\n- raise NotImplementedError('is_decreasing has not yet been implemented '\n- 'for multivariate expressions')\n- symbol = f.free_symbols.pop()\n+ f = sympify(f)\n+ free_sym = f.free_symbols\n+\n+ if symbol is None:\n+ if len(free_sym) > 1:\n+ raise NotImplementedError('is_decreasing has not yet been implemented '\n+ 'for all multivariate expressions')\n+ elif len(free_sym) == 0:\n+ return True\n+ symbol = free_sym.pop()\n+\n df = f.diff(symbol)\n df_nonpos_interval = solveset(df <= 0, symbol, domain=S.Reals)\n return interval.is_subset(df_nonpos_interval)\n \n \n-def is_strictly_decreasing(f, interval=S.Reals):\n+def is_strictly_decreasing(f, interval=S.Reals, symbol=None):\n \"\"\"\n- Returns if a function is decreasing or not, in the given\n+ Returns if a function is strictly decreasing or not, in the given\n ``Interval``.\n \n Examples\n ========\n \n- >>> from sympy import is_decreasing\n- >>> from sympy.abc import x\n+ >>> from sympy import is_strictly_decreasing\n+ >>> from sympy.abc import x, y\n >>> from sympy import S, Interval, oo\n- >>> is_decreasing(1/(x**2 - 3*x), Interval.open(1.5, 3))\n+ >>> is_strictly_decreasing(1/(x**2 - 3*x), Interval.open(1.5, 3))\n True\n- >>> is_decreasing(1/(x**2 - 3*x), Interval.Lopen(3, oo))\n+ >>> is_strictly_decreasing(1/(x**2 - 3*x), Interval.Lopen(3, oo))\n True\n- >>> is_decreasing(1/(x**2 - 3*x), Interval.Ropen(-oo, S(3)/2))\n+ >>> is_strictly_decreasing(1/(x**2 - 3*x), Interval.Ropen(-oo, S(3)/2))\n False\n- >>> is_decreasing(-x**2, Interval(-oo, 0))\n+ >>> is_strictly_decreasing(-x**2, Interval(-oo, 0))\n+ False\n+ >>> is_strictly_decreasing(-x**2 + y, Interval(-oo, 0), x)\n False\n \n \"\"\"\n- if len(f.free_symbols) > 1:\n- raise NotImplementedError('is_strictly_decreasing has not yet been '\n- 'implemented for multivariate expressions')\n- symbol = f.free_symbols.pop()\n+ f = sympify(f)\n+ free_sym = f.free_symbols\n+\n+ if symbol is None:\n+ if len(free_sym) > 1:\n+ raise NotImplementedError('is_strictly_decreasing has not yet been implemented '\n+ 'for all multivariate expressions')\n+ elif len(free_sym) == 0:\n+ return False\n+ symbol = free_sym.pop()\n+\n df = f.diff(symbol)\n df_neg_interval = solveset(df < 0, symbol, domain=S.Reals)\n return interval.is_subset(df_neg_interval)\n \n \n-def is_monotonic(f, interval=S.Reals):\n+def is_monotonic(f, interval=S.Reals, symbol=None):\n \"\"\"\n Returns if a function is monotonic or not, in the given\n ``Interval``.\n@@ -167,7 +204,7 @@ def is_monotonic(f, interval=S.Reals):\n ========\n \n >>> from sympy import is_monotonic\n- >>> from sympy.abc import x\n+ >>> from sympy.abc import x, y\n >>> from sympy import S, Interval, oo\n >>> is_monotonic(1/(x**2 - 3*x), Interval.open(1.5, 3))\n True\n@@ -177,13 +214,19 @@ def is_monotonic(f, interval=S.Reals):\n True\n >>> is_monotonic(-x**2, S.Reals)\n False\n+ >>> is_monotonic(x**2 + y + 1, Interval(1, 2), x)\n+ True\n \n \"\"\"\n from sympy.core.logic import fuzzy_or\n- if len(f.free_symbols) > 1:\n+ f = sympify(f)\n+ free_sym = f.free_symbols\n+\n+ if symbol is None and len(free_sym) > 1:\n raise NotImplementedError('is_monotonic has not yet been '\n- 'implemented for multivariate expressions')\n- inc = is_increasing(f, interval)\n- dec = is_decreasing(f, interval)\n+ 'for all multivariate expressions')\n+\n+ inc = is_increasing(f, interval, symbol)\n+ dec = is_decreasing(f, interval, symbol)\n \n return fuzzy_or([inc, dec])\ndiff --git a/sympy/polys/ring_series.py b/sympy/polys/ring_series.py\nindex 0de3d8f6b8..166a936325 100644\n--- a/sympy/polys/ring_series.py\n+++ b/sympy/polys/ring_series.py\n@@ -1,46 +1,3 @@\n-\"\"\"Power series evaluation and manipulation using sparse Polynomials\n-\n-Implementing a new function\n----------------------------\n-\n-There are a few things to be kept in mind when adding a new function here::\n-\n- - The implementation should work on all possible input domains/rings.\n- Special cases include the ``EX`` ring and a constant term in the series\n- to be expanded. There can be two types of constant terms in the series:\n-\n- + A constant value or symbol.\n- + A term of a multivariate series not involving the generator, with\n- respect to which the series is to expanded.\n-\n- Strictly speaking, a generator of a ring should not be considered a\n- constant. However, for series expansion both the cases need similar\n- treatment (as the user doesn't care about inner details), i.e, use an\n- addition formula to separate the constant part and the variable part (see\n- rs_sin for reference).\n-\n- - All the algorithms used here are primarily designed to work for Taylor\n- series (number of iterations in the algo equals the required order).\n- Hence, it becomes tricky to get the series of the right order if a\n- Puiseux series is input. Use rs_puiseux? in your function if your\n- algorithm is not designed to handle fractional powers.\n-\n-Extending rs_series\n--------------------\n-\n-To make a function work with rs_series you need to do two things::\n-\n- - Many sure it works with a constant term (as explained above).\n- - If the series contains constant terms, you might need to extend its ring.\n- You do so by adding the new terms to the rings as generators.\n- ``PolyRing.compose`` and ``PolyRing.add_gens`` are two functions that do\n- so and need to be called every time you expand a series containing a\n- constant term.\n-\n-Look at rs_sin and rs_series for further reference.\n-\n-\"\"\"\n-\n from sympy.polys.domains import QQ, EX\n from sympy.polys.rings import PolyElement, ring, sring\n from sympy.polys.polyerrors import DomainError\n@@ -57,7 +14,7 @@\n \n def _invert_monoms(p1):\n \"\"\"\n- Compute ``x**n * p1(1/x)`` for a univariate polynomial ``p1`` in ``x``.\n+ Compute ``x**n * p1(1/x)`` for a univariate polynomial ``p1`` in x.\n \n Examples\n ========\n@@ -122,9 +79,8 @@ def rs_trunc(p1, x, prec):\n \n def rs_is_puiseux(p, x):\n \"\"\"\n- Test if ``p`` is Puiseux series in ``x``.\n-\n- Raise an exception if it has a negative power in ``x``.\n+ Test if `p` is Puiseux series in `x`; raise an exception if it has\n+ negative powers in `x`.\n \n Examples\n ========\n@@ -147,9 +103,9 @@ def rs_is_puiseux(p, x):\n \n def rs_puiseux(f, p, x, prec):\n \"\"\"\n- Return the puiseux series for `f(p, x, prec)`.\n+ Return the puiseux series for `f(p, x, prec)`\n \n- To be used when function ``f`` is implemented only for regular series.\n+ To be used when function`f` is implemented only for regular series\n \n Examples\n ========\n@@ -186,9 +142,9 @@ def rs_puiseux(f, p, x, prec):\n \n def rs_puiseux2(f, p, q, x, prec):\n \"\"\"\n- Return the puiseux series for `f(p, q, x, prec)`.\n+ Return the puiseux series for `f(p, q, x, prec)`\n \n- To be used when function ``f`` is implemented only for regular series.\n+ To be used when function `f` is implemented only for regular series\n \"\"\"\n index = p.ring.gens.index(x)\n n = 1\n@@ -211,7 +167,7 @@ def rs_puiseux2(f, p, q, x, prec):\n \n def rs_mul(p1, p2, x, prec):\n \"\"\"\n- Return the product of the given two series, modulo ``O(x**prec)``.\n+ Return the product of the given two series, modulo ``O(x**prec)``\n \n ``x`` is the series variable or its position in the generators.\n \n@@ -357,9 +313,13 @@ def rs_pow(p1, n, x, prec):\n \n def rs_subs(p, rules, x, prec):\n \"\"\"\n- Substitution with truncation according to the mapping in ``rules``.\n+ Substitution with truncation according to the mapping in `rules`.\n+ Returns a series with precision `prec` in the generator `x`\n \n- Return a series with precision ``prec`` in the generator ``x``\n+ p: input polynomial\n+ rules: dict with substitution mappings\n+ x: variable in which the series truncation is done\n+ prec: order of the truncation\n \n Note that substitutions are not done one after the other\n \n@@ -378,13 +338,6 @@ def rs_subs(p, rules, x, prec):\n >>> rs_subs(rs_subs(p, {x: x+ y}, x, 3), {y: x+ 2*y}, x, 3)\n 5*x**2 + 12*x*y + 8*y**2\n \n- Parameters\n- ----------\n- p : :class:`PolyElement` Input series.\n- rules : :class:`dict` with substitution mappings.\n- x : :class:`PolyElement` in which the series truncation is to be done.\n- prec : :class:`Integer` order of the series after truncation.\n-\n Examples\n ========\n \n@@ -479,7 +432,7 @@ def _check_series_var(p, x, name):\n \n def _series_inversion1(p, x, prec):\n \"\"\"\n- Univariate series inversion ``1/p`` modulo ``O(x**prec)``.\n+ Univariate series inversion ``1/p`` modulo ``O(x**prec)``\n \n The Newton method is used.\n \n@@ -525,7 +478,7 @@ def _series_inversion1(p, x, prec):\n \n def rs_series_inversion(p, x, prec):\n \"\"\"\n- Multivariate series inversion ``1/p`` modulo ``O(x**prec)``.\n+ Multivariate series inversion ``1/p`` modulo ``O(x**prec)``\n \n Examples\n ========\n@@ -562,7 +515,7 @@ def rs_series_inversion(p, x, prec):\n return r\n \n def _coefficient_t(p, t):\n- \"\"\"Coefficient of `x\\_i**j` in p, where ``t`` = (i, j)\"\"\"\n+ \"\"\"Coefficient of `x_i**j` in p, where t = (i, j)\"\"\"\n i, j = t\n R = p.ring\n expv1 = [0]*R.ngens\n@@ -576,35 +529,35 @@ def _coefficient_t(p, t):\n \n def rs_series_reversion(p, x, n, y):\n \"\"\"\n- Reversion of a series.\n+ Reversion of a series\n \n- ``p`` is a series with ``O(x**n)`` of the form `p = a*x + f(x)`\n- where `a` is a number different from 0.\n+ p is a series with O(x**n) of the form p = a*x + f(x)\n+ where `a` is a number different from 0\n \n- `f(x) = sum( a\\_k*x\\_k, k in range(2, n))`\n+ f(x) = sum( a_k*x_k, k in range(2, n))\n \n- a_k : Can depend polynomially on other variables, not indicated.\n- x : Variable with name x.\n- y : Variable with name y.\n+ a_k can depend polynomially on other variables, not indicated.\n+ x: variable with name x\n+ y: variable with name y\n \n- Solve `p = y`, that is, given `a*x + f(x) - y = 0`,\n+ Solve p = y, that is, given a*x + f(x) - y = 0,\n find the solution x = r(y) up to O(y**n)\n \n Algorithm:\n \n- If `r\\_i` is the solution at order i, then:\n- `a*r\\_i + f(r\\_i) - y = O(y**(i + 1))`\n+ If r_i is the solution at order i, then:\n+ a*r_i + f(r_i) - y = O(y**(i + 1))\n \n and if r_(i + 1) is the solution at order i + 1, then:\n- `a*r\\_(i + 1) + f(r\\_(i + 1)) - y = O(y**(i + 2))`\n+ a*r_(i + 1) + f(r_(i + 1)) - y = O(y**(i + 2))\n \n We have, r_(i + 1) = r_i + e, such that,\n- `a*e + f(r\\_i) = O(y**(i + 2))`\n- or `e = -f(r\\_i)/a`\n+ a*e + f(r_i) = O(y**(i + 2))\n+ or e = -f(r_i)/a\n \n So we use the recursion relation:\n- `r\\_(i + 1) = r\\_i - f(r\\_i)/a`\n- with the boundary condition: `r\\_1 = y`\n+ r_(i + 1) = r_i -f(r_i)/a\n+ with the boundary condition: r_1 = y\n \n Examples\n ========\n@@ -641,13 +594,12 @@ def rs_series_reversion(p, x, n, y):\n \n def rs_series_from_list(p, c, x, prec, concur=1):\n \"\"\"\n- Return a series `sum c[n]*p**n` modulo `O(x**prec)`.\n-\n- It reduces the number of multiplications by summing concurrently.\n+ Return a series ``sum c[n]*p**n`` modulo ``O(x**prec)``\n \n- `ax = [1, p, p**2, .., p**(J - 1)]`\n- `s = sum(c[i]*ax[i]` for i in `range(r, (r + 1)*J))*p**((K - 1)*J)`\n- with `K >= (n + 1)/J`\n+ It reduces the number of multiplications by summing concurrently\n+ ``ax = [1, p, p**2, .., p**(J - 1)]``\n+ ``s = sum(c[i]*ax[i] for i in range(r, (r + 1)*J)) * p**((K - 1)*J)``\n+ with ``K >= (n + 1)/J``\n \n Examples\n ========\n@@ -727,11 +679,9 @@ def rs_series_from_list(p, c, x, prec, concur=1):\n \n def rs_diff(p, x):\n \"\"\"\n- Return partial derivative of ``p`` with respect to ``x``.\n+ Computes partial derivative of p with respect to x\n \n- Parameters\n- ----------\n- x : :class:`PolyElement` with respect to which ``p`` is differentiated.\n+ `x`: variable with respect to which p is differentiated,\n \n Examples\n ========\n@@ -758,11 +708,7 @@ def rs_diff(p, x):\n \n def rs_integrate(p, x):\n \"\"\"\n- Integrate ``p`` with respect to ``x``.\n-\n- Parameters\n- ----------\n- x : :class:`PolyElement` with respect to which ``p`` is integrated.\n+ Integrate ``p`` with respect to ``x``\n \n Examples\n ========\n@@ -789,23 +735,21 @@ def rs_integrate(p, x):\n \n def rs_fun(p, f, *args):\n \"\"\"\n- Function of a multivariate series computed by substitution.\n-\n- The case with f method name is used to compute `rs\\_tan` and `rs\\_nth\\_root`\n- of a multivariate series:\n+ Function of a multivariate series computed by substitution\n \n- `rs\\_fun(p, tan, iv, prec)`\n+ p: multivariate series\n+ f: method name or function\n+ args[:-2] arguments of f, apart from the first one\n+ args[-2] = iv: names of the series variables\n+ args[-1] = prec: list of the precisions of the series variables\n \n- tan series is first computed for a dummy variable _x,\n- i.e, `rs\\_tan(\\_x, iv, prec)`. Then we substitute _x with p to get the\n- desired series\n+ The case with f method name is used to compute rs_tan and rs_nth_root\n+ of a multivariate series:\n \n- Parameters\n- ----------\n- p : :class:`PolyElement` The multivariate series to be expanded.\n- f : `ring\\_series` function to be applied on `p`.\n- args[-2] : :class:`PolyElement` with respect to which, the series is to be expanded.\n- args[-1] : Required order of the expanded series.\n+ rs_fun(p, tan, iv, prec)\n+ tan series is first computed for a dummy variable _x,\n+ ie, rs_tan(_x, iv, prec). Then we substitute _x with p to get the\n+ desired series\n \n Examples\n ========\n@@ -844,9 +788,9 @@ def rs_fun(p, f, *args):\n \n def mul_xin(p, i, n):\n \"\"\"\n- Return `p*x_i**n`.\n+ Computes p*x_i**n\n \n- `x\\_i` is the ith variable in ``p``.\n+ x_i is the ith variable in p\n \"\"\"\n R = p.ring\n q = R(0)\n@@ -877,7 +821,13 @@ def pow_xin(p, i, n):\n \n def _nth_root1(p, n, x, prec):\n \"\"\"\n- Univariate series expansion of the nth root of ``p``.\n+ Univariate series expansion of the nth root of p\n+\n+ While passing p, make sure that it is of the form `1 + f(x)`.\n+\n+ n (integer): compute p**(1/n)\n+ x: name of the series variable\n+ prec: precision of the series\n \n The Newton method is used.\n \"\"\"\n@@ -912,13 +862,11 @@ def _nth_root1(p, n, x, prec):\n \n def rs_nth_root(p, n, x, prec):\n \"\"\"\n- Multivariate series expansion of the nth root of ``p``.\n+ Multivariate series expansion of the nth root of p\n \n- Parameters\n- ----------\n- n : `p**(1/n)` is returned.\n- x : :class:`PolyElement`\n- prec : Order of the expanded series.\n+ n(integer): compute p**(1/n)\n+ x: variable name\n+ prec: precision of the series\n \n Notes\n =====\n@@ -968,14 +916,14 @@ def rs_nth_root(p, n, x, prec):\n c_expr = c.as_expr()\n const = R(c_expr**(QQ(1, n)))\n except ValueError:\n- raise DomainError(\"The given series can't be expanded in \"\n- \"this domain.\")\n+ raise DomainError(\"The given series can't be expanded in \"\n+ \"this domain.\")\n else:\n try: # RealElement doesn't support\n const = R(c**Rational(1, n)) # exponentiation with mpq object\n except ValueError: # as exponent\n- raise DomainError(\"The given series can't be expanded in \"\n- \"this domain.\")\n+ raise DomainError(\"The given series can't be expanded in \"\n+ \"this domain.\")\n res = rs_nth_root(p/c, n, x, prec)*const\n else:\n res = _nth_root1(p, n, x, prec)\n@@ -986,12 +934,12 @@ def rs_nth_root(p, n, x, prec):\n \n def rs_log(p, x, prec):\n \"\"\"\n- The Logarithm of ``p`` modulo ``O(x**prec)``.\n+ The Logarithm of ``p`` modulo ``O(x**prec)``\n \n Notes\n =====\n \n- Truncation of ``integral dx p**-1*d p/dx`` is used.\n+ truncation of ``integral dx p**-1*d p/dx`` is used.\n \n Examples\n ========\n@@ -1025,13 +973,13 @@ def rs_log(p, x, prec):\n const = R(log(c_expr))\n except ValueError:\n raise DomainError(\"The given series can't be expanded in \"\n- \"this domain.\")\n+ \"this domain.\")\n else:\n try:\n const = R(log(c))\n except ValueError:\n raise DomainError(\"The given series can't be expanded in \"\n- \"this domain.\")\n+ \"this domain.\")\n \n dlog = p.diff(x)\n dlog = rs_mul(dlog, _series_inversion1(p, x, prec), x, prec - 1)\n@@ -1041,7 +989,7 @@ def rs_log(p, x, prec):\n \n def rs_LambertW(p, x, prec):\n \"\"\"\n- Calculate the series expansion of the principal branch of the Lambert W\n+ Calculates the series expansion of the principal branch of the Lambert W\n function.\n \n Examples\n@@ -1079,7 +1027,7 @@ def rs_LambertW(p, x, prec):\n raise NotImplementedError\n \n def _exp1(p, x, prec):\n- \"\"\"Helper function for `rs\\_exp`. \"\"\"\n+ \"\"\"Helper function for ``rs_exp`` \"\"\"\n R = p.ring\n p1 = R(1)\n for precx in _giant_steps(prec):\n@@ -1124,8 +1072,8 @@ def rs_exp(p, x, prec):\n try:\n const = R(exp(c))\n except ValueError:\n- raise DomainError(\"The given series can't be expanded in \"\n- \"this domain.\")\n+ raise DomainError(\"The given series can't be expanded in \"\n+ \"this domain.\")\n p1 = p - c\n \n # Makes use of sympy fuctions to evaluate the values of the cos/sin\n@@ -1148,7 +1096,7 @@ def rs_exp(p, x, prec):\n \n def _atan(p, iv, prec):\n \"\"\"\n- Expansion using formula.\n+ Expansion using formula\n \n Faster on very small and univariate series.\n \"\"\"\n@@ -1166,7 +1114,7 @@ def rs_atan(p, x, prec):\n \"\"\"\n The arctangent of a series\n \n- Return the series expansion of the atan of ``p``, about 0.\n+ Returns the series expansion of the atan of p, about 0.\n \n Examples\n ========\n@@ -1198,14 +1146,14 @@ def rs_atan(p, x, prec):\n c_expr = c.as_expr()\n const = R(atan(c_expr))\n except ValueError:\n- raise DomainError(\"The given series can't be expanded in \"\n- \"this domain.\")\n+ raise DomainError(\"The given series can't be expanded in \"\n+ \"this domain.\")\n else:\n try:\n const = R(atan(c))\n except ValueError:\n- raise DomainError(\"The given series can't be expanded in \"\n- \"this domain.\")\n+ raise DomainError(\"The given series can't be expanded in \"\n+ \"this domain.\")\n \n # Instead of using a closed form formula, we differentiate atan(p) to get\n # `1/(1+p**2) * dp`, whose series expansion is much easier to calculate.\n@@ -1220,7 +1168,7 @@ def rs_asin(p, x, prec):\n \"\"\"\n Arcsine of a series\n \n- Return the series expansion of the asin of ``p``, about 0.\n+ Returns the series expansion of the asin of p, about 0.\n \n Examples\n ========\n@@ -1263,9 +1211,9 @@ def rs_asin(p, x, prec):\n \n def _tan1(p, x, prec):\n \"\"\"\n- Helper function of `rs\\_tan`.\n+ Helper function of ``rs_tan``\n \n- Return the series expansion of tan of a univariate series using Newton's\n+ Returns the series expansion of tan of a univariate series using Newton's\n method. It takes advantage of the fact that series expansion of atan is\n easier than that of tan.\n \n@@ -1284,9 +1232,9 @@ def _tan1(p, x, prec):\n \n def rs_tan(p, x, prec):\n \"\"\"\n- Tangent of a series.\n+ Tangent of a series\n \n- Return the series expansion of the tan of ``p``, about 0.\n+ Returns the series expansion of the tan of p, about 0.\n \n Examples\n ========\n@@ -1301,7 +1249,7 @@ def rs_tan(p, x, prec):\n See Also\n ========\n \n- _tan1, tan\n+ tan\n \"\"\"\n if rs_is_puiseux(p, x):\n r = rs_puiseux(rs_tan, p, x, prec)\n@@ -1327,8 +1275,8 @@ def rs_tan(p, x, prec):\n try:\n const = R(tan(c))\n except ValueError:\n- raise DomainError(\"The given series can't be expanded in \"\n- \"this domain.\")\n+ raise DomainError(\"The given series can't be expanded in \"\n+ \"this domain.\")\n p1 = p - c\n \n # Makes use of sympy fuctions to evaluate the values of the cos/sin\n@@ -1346,7 +1294,7 @@ def rs_cot(p, x, prec):\n \"\"\"\n Cotangent of a series\n \n- Return the series expansion of the cot of ``p``, about 0.\n+ Returns the series expansion of the cot of p, about 0.\n \n Examples\n ========\n@@ -1382,7 +1330,7 @@ def rs_sin(p, x, prec):\n \"\"\"\n Sine of a series\n \n- Return the series expansion of the sin of ``p``, about 0.\n+ Returns the series expansion of the sin of p, about 0.\n \n Examples\n ========\n@@ -1425,8 +1373,8 @@ def rs_sin(p, x, prec):\n try:\n t1, t2 = R(sin(c)), R(cos(c))\n except ValueError:\n- raise DomainError(\"The given series can't be expanded in \"\n- \"this domain.\")\n+ raise DomainError(\"The given series can't be expanded in \"\n+ \"this domain.\")\n p1 = p - c\n \n # Makes use of sympy cos, sin fuctions to evaluate the values of the\n@@ -1452,7 +1400,7 @@ def rs_cos(p, x, prec):\n \"\"\"\n Cosine of a series\n \n- Return the series expansion of the cos of ``p``, about 0.\n+ Returns the series expansion of the cos of p, about 0.\n \n Examples\n ========\n@@ -1492,8 +1440,8 @@ def rs_cos(p, x, prec):\n try:\n t1, t2 = R(sin(c)), R(cos(c))\n except ValueError:\n- raise DomainError(\"The given series can't be expanded in \"\n- \"this domain.\")\n+ raise DomainError(\"The given series can't be expanded in \"\n+ \"this domain.\")\n p1 = p - c\n \n # Makes use of sympy cos, sin fuctions to evaluate the values of the\n@@ -1523,8 +1471,7 @@ def rs_cos(p, x, prec):\n \n def rs_cos_sin(p, x, prec):\n \"\"\"\n- Return the tuple `(rs\\_cos(p, x, prec)`, `rs\\_sin(p, x, prec))`.\n-\n+ Returns the tuple (rs_cos(p, x, prec), rs_sin(p, x, prec))\n Is faster than calling rs_cos and rs_sin separately\n \"\"\"\n if rs_is_puiseux(p, x):\n@@ -1554,7 +1501,7 @@ def rs_atanh(p, x, prec):\n \"\"\"\n Hyperbolic arctangent of a series\n \n- Return the series expansion of the atanh of ``p``, about 0.\n+ Returns the series expansion of the atanh of p, about 0.\n \n Examples\n ========\n@@ -1586,14 +1533,14 @@ def rs_atanh(p, x, prec):\n c_expr = c.as_expr()\n const = R(atanh(c_expr))\n except ValueError:\n- raise DomainError(\"The given series can't be expanded in \"\n- \"this domain.\")\n+ raise DomainError(\"The given series can't be expanded in \"\n+ \"this domain.\")\n else:\n try:\n const = R(atanh(c))\n except ValueError:\n- raise DomainError(\"The given series can't be expanded in \"\n- \"this domain.\")\n+ raise DomainError(\"The given series can't be expanded in \"\n+ \"this domain.\")\n \n # Instead of using a closed form formula, we differentiate atanh(p) to get\n # `1/(1-p**2) * dp`, whose series expansion is much easier to calculate.\n@@ -1608,7 +1555,7 @@ def rs_sinh(p, x, prec):\n \"\"\"\n Hyperbolic sine of a series\n \n- Return the series expansion of the sinh of ``p``, about 0.\n+ Returns the series expansion of the sinh of p, about 0.\n \n Examples\n ========\n@@ -1635,7 +1582,7 @@ def rs_cosh(p, x, prec):\n \"\"\"\n Hyperbolic cosine of a series\n \n- Return the series expansion of the cosh of ``p``, about 0.\n+ Returns the series expansion of the cosh of p, about 0.\n \n Examples\n ========\n@@ -1660,9 +1607,9 @@ def rs_cosh(p, x, prec):\n \n def _tanh(p, x, prec):\n \"\"\"\n- Helper function of `rs\\_tanh`\n+ Helper function of ``rs_tanh``\n \n- Return the series expansion of tanh of a univariate series using Newton's\n+ Returns the series expansion of tanh of a univariate series using Newton's\n method. It takes advantage of the fact that series expansion of atanh is\n easier than that of tanh.\n \n@@ -1683,7 +1630,7 @@ def rs_tanh(p, x, prec):\n \"\"\"\n Hyperbolic tangent of a series\n \n- Return the series expansion of the tanh of ``p``, about 0.\n+ Returns the series expansion of the tanh of p, about 0.\n \n Examples\n ========\n@@ -1715,14 +1662,14 @@ def rs_tanh(p, x, prec):\n c_expr = c.as_expr()\n const = R(tanh(c_expr))\n except ValueError:\n- raise DomainError(\"The given series can't be expanded in \"\n- \"this domain.\")\n+ raise DomainError(\"The given series can't be expanded in \"\n+ \"this domain.\")\n else:\n try:\n const = R(tanh(c))\n except ValueError:\n- raise DomainError(\"The given series can't be expanded in \"\n- \"this domain.\")\n+ raise DomainError(\"The given series can't be expanded in \"\n+ \"this domain.\")\n p1 = p - c\n t1 = rs_tanh(p1, x, prec)\n t = rs_series_inversion(1 + const*t1, x, prec)\n@@ -1875,20 +1822,6 @@ def _rs_series(expr, series_rs, a, prec):\n raise NotImplementedError\n R1, series = sring(arg, domain=QQ, expand=False)\n series_inner = _rs_series(arg, series, a, prec)\n-\n- # Why do we need to compose these three rings?\n- #\n- # We want to use a simple domain (like ``QQ`` or ``RR``) but they don't\n- # support symbolic coefficients. We need a ring that for example lets\n- # us have `sin(1)` and `cos(1)` as coefficients if we are expanding\n- # `sin(x + 1)`. The ``EX`` domain allows all symbolic coefficients, but\n- # that makes it very complex and hence slow.\n- #\n- # To solve this problem, we add only those symbolic elements as\n- # generators to our ring, that we need. Here, series_inner might\n- # involve terms like `sin(4)`, `exp(a)`, etc, which are not there in\n- # R1 or R. Hence, we compose these three rings to create one that has\n- # the generators of all three.\n R = R.compose(R1).compose(series_inner.ring)\n series_inner = series_inner.set_ring(R)\n series = eval(_convert_func[str(expr.func)])(series_inner,\n@@ -1941,7 +1874,7 @@ def _rs_series(expr, series_rs, a, prec):\n raise NotImplementedError\n \n def rs_series(expr, a, prec):\n- \"\"\"Return the series expansion of an expression about 0.\n+ \"\"\"Return the series expansion of an expression about 0\n \n Parameters\n ----------\ndiff --git a/sympy/polys/rings.py b/sympy/polys/rings.py\nindex cb9df6dfc7..7544bc5d01 100644\n--- a/sympy/polys/rings.py\n+++ b/sympy/polys/rings.py\n@@ -509,7 +509,6 @@ def drop_to_ground(self, *gens):\n return self.clone(symbols=symbols, domain=self.drop(*gens))\n \n def compose(self, other):\n- \"\"\"Add the generators of ``other`` to ``self``\"\"\"\n if self != other:\n syms = set(self.symbols).union(set(other.symbols))\n return self.clone(symbols=list(syms))\n@@ -517,7 +516,6 @@ def compose(self, other):\n return self\n \n def add_gens(self, symbols):\n- \"\"\"Add the elements of ``symbols`` as generators to ``self``\"\"\"\n syms = set(self.symbols).union(set(symbols))\n return self.clone(symbols=list(syms))\n \n"},"problem_statement":{"kind":"string","value":"is_decreasing(), is_increasing() and strictly functions should have `Symbol` as argument to them\n`is_decreasing()`, `is_increasing()`, `is_strictly_increasing()` and `is_strictly_decreasing()` should have `x` or Symbol for as their parameter.\r\nBecause of this it will be able to deal expressions like\r\n```\r\n>>> is_decreasing(n + x, n, Interval(1, oo)) # here x is taken as Symbol\r\nTrue\r\n```\r\nAlso we have\r\n```\r\n>>> is_decreasing(1, Interval(1, 2))\r\nAttributeError Traceback (most recent call last)\r\n in ()\r\n----> 1 is_decreasing(1, Interval(1, oo))\r\n\r\n/home/gxyd/Public/sympy/sympy/calculus/singularities.py in is_decreasing(f, interval)\r\n 120 \r\n 121 \"\"\"\r\n--> 122 if len(f.free_symbols) > 1:\r\n 123 raise NotImplementedError('is_decreasing has not yet been implemented '\r\n 124 'for multivariate expressions')\r\n\r\nAttributeError: 'int' object has no attribute 'free_symbols'\r\n```"},"repo":{"kind":"string","value":"sympy/sympy"},"test_patch":{"kind":"string","value":"diff --git a/sympy/calculus/tests/test_singularities.py b/sympy/calculus/tests/test_singularities.py\nindex b4d2056315..65d30d263b 100644\n--- a/sympy/calculus/tests/test_singularities.py\n+++ b/sympy/calculus/tests/test_singularities.py\n@@ -7,8 +7,9 @@\n \n from sympy.utilities.pytest import XFAIL\n \n-x = Symbol('x')\n-\n+from sympy.abc import x, y\n+a = Symbol('a', negative=True)\n+b = Symbol('b', positive=True)\n \n def test_singularities():\n x = Symbol('x', real=True)\n@@ -30,6 +31,9 @@ def test_is_increasing():\n assert is_increasing(-x**2, Interval(-oo, 0))\n assert is_increasing(-x**2, Interval(0, oo)) is False\n assert is_increasing(4*x**3 - 6*x**2 - 72*x + 30, Interval(-2, 3)) is False\n+ assert is_increasing(x**2 + y, Interval(1, oo), x) is True\n+ assert is_increasing(-x**2*a, Interval(1, oo), x) is True\n+ assert is_increasing(1) is True\n \n \n def test_is_strictly_increasing():\n@@ -37,6 +41,7 @@ def test_is_strictly_increasing():\n assert is_strictly_increasing(4*x**3 - 6*x**2 - 72*x + 30, Interval.Lopen(3, oo))\n assert is_strictly_increasing(4*x**3 - 6*x**2 - 72*x + 30, Interval.open(-2, 3)) is False\n assert is_strictly_increasing(-x**2, Interval(0, oo)) is False\n+ assert is_strictly_decreasing(1) is False\n \n \n def test_is_decreasing():\n@@ -44,13 +49,15 @@ def test_is_decreasing():\n assert is_decreasing(1/(x**2 - 3*x), Interval.Lopen(3, oo))\n assert is_decreasing(1/(x**2 - 3*x), Interval.Ropen(-oo, S(3)/2)) is False\n assert is_decreasing(-x**2, Interval(-oo, 0)) is False\n+ assert is_decreasing(-x**2*b, Interval(-oo, 0), x) is False\n \n \n def test_is_strictly_decreasing():\n- assert is_decreasing(1/(x**2 - 3*x), Interval.open(1.5, 3))\n- assert is_decreasing(1/(x**2 - 3*x), Interval.Lopen(3, oo))\n- assert is_decreasing(1/(x**2 - 3*x), Interval.Ropen(-oo, S(3)/2)) is False\n- assert is_decreasing(-x**2, Interval(-oo, 0)) is False\n+ assert is_strictly_decreasing(1/(x**2 - 3*x), Interval.open(1.5, 3))\n+ assert is_strictly_decreasing(1/(x**2 - 3*x), Interval.Lopen(3, oo))\n+ assert is_strictly_decreasing(1/(x**2 - 3*x), Interval.Ropen(-oo, S(3)/2)) is False\n+ assert is_strictly_decreasing(-x**2, Interval(-oo, 0)) is False\n+ assert is_strictly_decreasing(1) is False\n \n \n def test_is_monotonic():\n@@ -58,3 +65,4 @@ def test_is_monotonic():\n assert is_monotonic(1/(x**2 - 3*x), Interval.Lopen(3, oo))\n assert is_monotonic(x**3 - 3*x**2 + 4*x, S.Reals)\n assert is_monotonic(-x**2, S.Reals) is False\n+ assert is_monotonic(x**2 + y + 1, Interval(1, 2), x) is True\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_removed_files\",\n \"has_many_modified_files\",\n \"has_many_hunks\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 2,\n \"issue_text_score\": 0,\n \"test_score\": 2\n },\n \"num_modified_files\": 5\n}"},"version":{"kind":"string","value":"0.7"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"pytest\",\n \"pip_packages\": [\n \"mpmath>=0.19\",\n \"pytest\",\n \"pytest-cov\",\n \"pytest-xdist\",\n \"pytest-mock\",\n \"pytest-asyncio\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\n \"python\": \"3.6\",\n \"reqs_path\": null,\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work\ncertifi==2021.5.30\ncoverage==6.2\nexecnet==1.9.0\nimportlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1631916693255/work\niniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work\nmore-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work\nmpmath==1.3.0\npackaging @ file:///tmp/build/80754af9/packaging_1637314298585/work\npluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work\npy @ file:///opt/conda/conda-bld/py_1644396412707/work\npyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work\npytest==6.2.4\npytest-asyncio==0.16.0\npytest-cov==4.0.0\npytest-mock==3.6.1\npytest-xdist==3.0.2\n-e git+https://github.com/sympy/sympy.git@0067acad3f6d438461100d4f96ec3dd227c1331c#egg=sympy\ntoml @ file:///tmp/build/80754af9/toml_1616166611790/work\ntomli==1.2.3\ntyping_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work\nzipp @ file:///tmp/build/80754af9/zipp_1633618647012/work\n"},"environment":{"kind":"string","value":"name: sympy\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - attrs=21.4.0=pyhd3eb1b0_0\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2021.5.30=py36h06a4308_0\n - importlib-metadata=4.8.1=py36h06a4308_0\n - importlib_metadata=4.8.1=hd3eb1b0_0\n - iniconfig=1.1.1=pyhd3eb1b0_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.3=he6710b0_2\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - more-itertools=8.12.0=pyhd3eb1b0_0\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - packaging=21.3=pyhd3eb1b0_0\n - pip=21.2.2=py36h06a4308_0\n - pluggy=0.13.1=py36h06a4308_0\n - py=1.11.0=pyhd3eb1b0_0\n - pyparsing=3.0.4=pyhd3eb1b0_0\n - pytest=6.2.4=py36h06a4308_2\n - python=3.6.13=h12debd9_1\n - readline=8.2=h5eee18b_0\n - setuptools=58.0.4=py36h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - toml=0.10.2=pyhd3eb1b0_0\n - typing_extensions=4.1.1=pyh06a4308_0\n - wheel=0.37.1=pyhd3eb1b0_0\n - xz=5.6.4=h5eee18b_1\n - zipp=3.6.0=pyhd3eb1b0_0\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - coverage==6.2\n - execnet==1.9.0\n - mpmath==1.3.0\n - pytest-asyncio==0.16.0\n - pytest-cov==4.0.0\n - pytest-mock==3.6.1\n - pytest-xdist==3.0.2\n - tomli==1.2.3\nprefix: /opt/conda/envs/sympy\n"},"FAIL_TO_PASS":{"kind":"list like","value":["sympy/calculus/tests/test_singularities.py::test_is_increasing","sympy/calculus/tests/test_singularities.py::test_is_strictly_increasing","sympy/calculus/tests/test_singularities.py::test_is_decreasing","sympy/calculus/tests/test_singularities.py::test_is_strictly_decreasing","sympy/calculus/tests/test_singularities.py::test_is_monotonic"],"string":"[\n \"sympy/calculus/tests/test_singularities.py::test_is_increasing\",\n \"sympy/calculus/tests/test_singularities.py::test_is_strictly_increasing\",\n \"sympy/calculus/tests/test_singularities.py::test_is_decreasing\",\n \"sympy/calculus/tests/test_singularities.py::test_is_strictly_decreasing\",\n \"sympy/calculus/tests/test_singularities.py::test_is_monotonic\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["sympy/calculus/tests/test_singularities.py::test_singularities"],"string":"[\n \"sympy/calculus/tests/test_singularities.py::test_singularities\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"BSD"},"__index_level_0__":{"kind":"number","value":260,"string":"260"}}},{"rowIdx":261,"cells":{"instance_id":{"kind":"string","value":"sympy__sympy-9958"},"base_commit":{"kind":"string","value":"886aded45250ae4f3e8158f70a29793f45a9b873"},"created_at":{"kind":"string","value":"2015-10-04 13:35:00"},"environment_setup_commit":{"kind":"string","value":"0241b35cae5f2adc04dc37b25f7dc9c5f00bd746"},"hints_text":{"kind":"string","value":"asmeurer: Can we add a direct test for this change as well?\ngxyd: > Can we add a direct test for this change as well?\r\n\r\n@asmeurer I think no. Since direct test would mean calling `Set._contains(self, other)` which raises `NotImplementedError`. But the corresponding change is tested by the [this test](https://github.com/sympy/sympy/pull/9958/files#diff-e21906560346d439e577d8c1be6b3eceR901) which i have added.\nsmichr: OK, this time I found this before committing #10036. Which changes do you think are preferred?"},"patch":{"kind":"string","value":"diff --git a/sympy/sets/sets.py b/sympy/sets/sets.py\nindex a447d607cb..424b63febe 100644\n--- a/sympy/sets/sets.py\n+++ b/sympy/sets/sets.py\n@@ -211,7 +211,7 @@ def _complement(self, other):\n return S.EmptySet\n \n elif isinstance(other, FiniteSet):\n- return FiniteSet(*[el for el in other if self.contains(el) != True])\n+ return FiniteSet(*[el for el in other if self.contains(el) is not true])\n \n def symmetric_difference(self, other):\n return SymmetricDifference(self, other)\n@@ -278,10 +278,10 @@ def contains(self, other):\n \n \"\"\"\n other = sympify(other, strict=True)\n- ret = self._contains(other)\n+ ret = sympify(self._contains(other))\n if ret is None:\n if all(Eq(i, other) == False for i in self):\n- return False\n+ return false\n ret = Contains(other, self, evaluate=False)\n return ret\n \n@@ -1461,7 +1461,7 @@ def reduce(args):\n if s.is_FiniteSet:\n other_args = [a for a in args if a != s]\n res = FiniteSet(*[x for x in s\n- if all(other.contains(x) == True for other in other_args)])\n+ if all(other.contains(x) is true for other in other_args)])\n unk = [x for x in s\n if any(other.contains(x) not in (True, False) for other in other_args)]\n if unk:\n@@ -1788,7 +1788,7 @@ def _complement(self, other):\n elms_unknown = FiniteSet(*[el for el in self if other.contains(el) not in (True, False)])\n if elms_unknown == self:\n return\n- return Complement(FiniteSet(*[el for el in other if self.contains(el) != True]), elms_unknown)\n+ return Complement(FiniteSet(*[el for el in other if self.contains(el) is not true]), elms_unknown)\n \n return Set._complement(self, other)\n \n"},"problem_statement":{"kind":"string","value":"Union(Interval(-oo, oo), FiniteSet(1)) not evaluated\n```\r\n>>> Union(Interval(-oo, oo), FiniteSet(1))\r\n(-∞, ∞) ∪ {1} # this should return (-∞, ∞) i guess\r\n```\r\n\r\nCan some one please verify the validity of issue?"},"repo":{"kind":"string","value":"sympy/sympy"},"test_patch":{"kind":"string","value":"diff --git a/sympy/sets/tests/test_fancysets.py b/sympy/sets/tests/test_fancysets.py\nindex a8eab7fe7e..fe36f2b566 100644\n--- a/sympy/sets/tests/test_fancysets.py\n+++ b/sympy/sets/tests/test_fancysets.py\n@@ -197,7 +197,7 @@ def test_Complex():\n assert -I in S.Complexes\n assert sqrt(-1) in S.Complexes\n assert S.Complexes.intersect(S.Reals) == S.Reals\n- assert S.Complexes.union(S.Reals) == S.Complexes\n+ # assert S.Complexes.union(S.Reals) == S.Complexes\n assert S.Complexes == ComplexRegion(S.Reals*S.Reals)\n \n \ndiff --git a/sympy/sets/tests/test_sets.py b/sympy/sets/tests/test_sets.py\nindex b841e4be20..5eba935511 100644\n--- a/sympy/sets/tests/test_sets.py\n+++ b/sympy/sets/tests/test_sets.py\n@@ -894,3 +894,8 @@ def test_issue_9808():\n assert Complement(FiniteSet(y), FiniteSet(1)) == Complement(FiniteSet(y), FiniteSet(1), evaluate=False)\n assert Complement(FiniteSet(1, 2, x), FiniteSet(x, y, 2, 3)) == \\\n Complement(FiniteSet(1), FiniteSet(y), evaluate=False)\n+\n+\n+def test_issue_9956():\n+ assert Union(Interval(-oo, oo), FiniteSet(1)) == Interval(-oo, oo)\n+ assert Interval(-oo, oo).contains(1) is S.true\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_short_problem_statement\",\n \"has_many_hunks\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 0,\n \"issue_text_score\": 2,\n \"test_score\": 0\n },\n \"num_modified_files\": 1\n}"},"version":{"kind":"string","value":"0.7"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"mpmath>=0.19\",\n \"pip_packages\": [\n \"pytest\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\n \"python\": \"3.6\",\n \"reqs_path\": null,\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"attrs==22.2.0\ncertifi==2021.5.30\nimportlib-metadata==4.8.3\niniconfig==1.1.1\nmpmath==1.2.1\npackaging==21.3\npluggy==1.0.0\npy==1.11.0\npyparsing==3.1.4\npytest==7.0.1\n-e git+https://github.com/sympy/sympy.git@886aded45250ae4f3e8158f70a29793f45a9b873#egg=sympy\ntomli==1.2.3\ntyping_extensions==4.1.1\nzipp==3.6.0\n"},"environment":{"kind":"string","value":"name: sympy\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2021.5.30=py36h06a4308_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.3=he6710b0_2\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - mpmath=1.2.1=py36h06a4308_0\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - pip=21.2.2=py36h06a4308_0\n - python=3.6.13=h12debd9_1\n - readline=8.2=h5eee18b_0\n - setuptools=58.0.4=py36h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - wheel=0.37.1=pyhd3eb1b0_0\n - xz=5.6.4=h5eee18b_1\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - attrs==22.2.0\n - importlib-metadata==4.8.3\n - iniconfig==1.1.1\n - packaging==21.3\n - pluggy==1.0.0\n - py==1.11.0\n - pyparsing==3.1.4\n - pytest==7.0.1\n - tomli==1.2.3\n - typing-extensions==4.1.1\n - zipp==3.6.0\nprefix: /opt/conda/envs/sympy\n"},"FAIL_TO_PASS":{"kind":"list like","value":["sympy/sets/tests/test_sets.py::test_issue_9956"],"string":"[\n \"sympy/sets/tests/test_sets.py::test_issue_9956\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["sympy/sets/tests/test_fancysets.py::test_naturals","sympy/sets/tests/test_fancysets.py::test_naturals0","sympy/sets/tests/test_fancysets.py::test_integers","sympy/sets/tests/test_fancysets.py::test_ImageSet","sympy/sets/tests/test_fancysets.py::test_image_is_ImageSet","sympy/sets/tests/test_fancysets.py::test_ImageSet_iterator_not_injetive","sympy/sets/tests/test_fancysets.py::test_Range","sympy/sets/tests/test_fancysets.py::test_range_interval_intersection","sympy/sets/tests/test_fancysets.py::test_fun","sympy/sets/tests/test_fancysets.py::test_Reals","sympy/sets/tests/test_fancysets.py::test_Complex","sympy/sets/tests/test_fancysets.py::test_intersections","sympy/sets/tests/test_fancysets.py::test_infinitely_indexed_set_1","sympy/sets/tests/test_fancysets.py::test_infinitely_indexed_set_2","sympy/sets/tests/test_fancysets.py::test_imageset_intersect_real","sympy/sets/tests/test_fancysets.py::test_ImageSet_simplification","sympy/sets/tests/test_fancysets.py::test_ComplexRegion_contains","sympy/sets/tests/test_fancysets.py::test_ComplexRegion_intersect","sympy/sets/tests/test_fancysets.py::test_ComplexRegion_union","sympy/sets/tests/test_fancysets.py::test_ComplexRegion_measure","sympy/sets/tests/test_fancysets.py::test_normalize_theta_set","sympy/sets/tests/test_fancysets.py::test_ComplexRegion_FiniteSet","sympy/sets/tests/test_fancysets.py::test_union_RealSubSet","sympy/sets/tests/test_sets.py::test_interval_arguments","sympy/sets/tests/test_sets.py::test_interval_symbolic_end_points","sympy/sets/tests/test_sets.py::test_union","sympy/sets/tests/test_sets.py::test_difference","sympy/sets/tests/test_sets.py::test_Complement","sympy/sets/tests/test_sets.py::test_complement","sympy/sets/tests/test_sets.py::test_intersect","sympy/sets/tests/test_sets.py::test_intersection","sympy/sets/tests/test_sets.py::test_issue_9623","sympy/sets/tests/test_sets.py::test_is_disjoint","sympy/sets/tests/test_sets.py::test_ProductSet_of_single_arg_is_arg","sympy/sets/tests/test_sets.py::test_interval_subs","sympy/sets/tests/test_sets.py::test_interval_to_mpi","sympy/sets/tests/test_sets.py::test_measure","sympy/sets/tests/test_sets.py::test_is_subset","sympy/sets/tests/test_sets.py::test_is_proper_subset","sympy/sets/tests/test_sets.py::test_is_superset","sympy/sets/tests/test_sets.py::test_is_proper_superset","sympy/sets/tests/test_sets.py::test_contains","sympy/sets/tests/test_sets.py::test_interval_symbolic","sympy/sets/tests/test_sets.py::test_union_contains","sympy/sets/tests/test_sets.py::test_is_number","sympy/sets/tests/test_sets.py::test_Interval_is_left_unbounded","sympy/sets/tests/test_sets.py::test_Interval_is_right_unbounded","sympy/sets/tests/test_sets.py::test_Interval_as_relational","sympy/sets/tests/test_sets.py::test_Finite_as_relational","sympy/sets/tests/test_sets.py::test_Union_as_relational","sympy/sets/tests/test_sets.py::test_Intersection_as_relational","sympy/sets/tests/test_sets.py::test_EmptySet","sympy/sets/tests/test_sets.py::test_finite_basic","sympy/sets/tests/test_sets.py::test_powerset","sympy/sets/tests/test_sets.py::test_product_basic","sympy/sets/tests/test_sets.py::test_real","sympy/sets/tests/test_sets.py::test_supinf","sympy/sets/tests/test_sets.py::test_universalset","sympy/sets/tests/test_sets.py::test_Union_of_ProductSets_shares","sympy/sets/tests/test_sets.py::test_Interval_free_symbols","sympy/sets/tests/test_sets.py::test_image_interval","sympy/sets/tests/test_sets.py::test_image_piecewise","sympy/sets/tests/test_sets.py::test_image_FiniteSet","sympy/sets/tests/test_sets.py::test_image_Union","sympy/sets/tests/test_sets.py::test_image_EmptySet","sympy/sets/tests/test_sets.py::test_issue_5724_7680","sympy/sets/tests/test_sets.py::test_boundary","sympy/sets/tests/test_sets.py::test_boundary_Union","sympy/sets/tests/test_sets.py::test_boundary_ProductSet","sympy/sets/tests/test_sets.py::test_boundary_ProductSet_line","sympy/sets/tests/test_sets.py::test_is_open","sympy/sets/tests/test_sets.py::test_is_closed","sympy/sets/tests/test_sets.py::test_closure","sympy/sets/tests/test_sets.py::test_interior","sympy/sets/tests/test_sets.py::test_issue_7841","sympy/sets/tests/test_sets.py::test_Eq","sympy/sets/tests/test_sets.py::test_SymmetricDifference","sympy/sets/tests/test_sets.py::test_issue_9536","sympy/sets/tests/test_sets.py::test_issue_9637","sympy/sets/tests/test_sets.py::test_issue_9808"],"string":"[\n \"sympy/sets/tests/test_fancysets.py::test_naturals\",\n \"sympy/sets/tests/test_fancysets.py::test_naturals0\",\n \"sympy/sets/tests/test_fancysets.py::test_integers\",\n \"sympy/sets/tests/test_fancysets.py::test_ImageSet\",\n \"sympy/sets/tests/test_fancysets.py::test_image_is_ImageSet\",\n \"sympy/sets/tests/test_fancysets.py::test_ImageSet_iterator_not_injetive\",\n \"sympy/sets/tests/test_fancysets.py::test_Range\",\n \"sympy/sets/tests/test_fancysets.py::test_range_interval_intersection\",\n \"sympy/sets/tests/test_fancysets.py::test_fun\",\n \"sympy/sets/tests/test_fancysets.py::test_Reals\",\n \"sympy/sets/tests/test_fancysets.py::test_Complex\",\n \"sympy/sets/tests/test_fancysets.py::test_intersections\",\n \"sympy/sets/tests/test_fancysets.py::test_infinitely_indexed_set_1\",\n \"sympy/sets/tests/test_fancysets.py::test_infinitely_indexed_set_2\",\n \"sympy/sets/tests/test_fancysets.py::test_imageset_intersect_real\",\n \"sympy/sets/tests/test_fancysets.py::test_ImageSet_simplification\",\n \"sympy/sets/tests/test_fancysets.py::test_ComplexRegion_contains\",\n \"sympy/sets/tests/test_fancysets.py::test_ComplexRegion_intersect\",\n \"sympy/sets/tests/test_fancysets.py::test_ComplexRegion_union\",\n \"sympy/sets/tests/test_fancysets.py::test_ComplexRegion_measure\",\n \"sympy/sets/tests/test_fancysets.py::test_normalize_theta_set\",\n \"sympy/sets/tests/test_fancysets.py::test_ComplexRegion_FiniteSet\",\n \"sympy/sets/tests/test_fancysets.py::test_union_RealSubSet\",\n \"sympy/sets/tests/test_sets.py::test_interval_arguments\",\n \"sympy/sets/tests/test_sets.py::test_interval_symbolic_end_points\",\n \"sympy/sets/tests/test_sets.py::test_union\",\n \"sympy/sets/tests/test_sets.py::test_difference\",\n \"sympy/sets/tests/test_sets.py::test_Complement\",\n \"sympy/sets/tests/test_sets.py::test_complement\",\n \"sympy/sets/tests/test_sets.py::test_intersect\",\n \"sympy/sets/tests/test_sets.py::test_intersection\",\n \"sympy/sets/tests/test_sets.py::test_issue_9623\",\n \"sympy/sets/tests/test_sets.py::test_is_disjoint\",\n \"sympy/sets/tests/test_sets.py::test_ProductSet_of_single_arg_is_arg\",\n \"sympy/sets/tests/test_sets.py::test_interval_subs\",\n \"sympy/sets/tests/test_sets.py::test_interval_to_mpi\",\n \"sympy/sets/tests/test_sets.py::test_measure\",\n \"sympy/sets/tests/test_sets.py::test_is_subset\",\n \"sympy/sets/tests/test_sets.py::test_is_proper_subset\",\n \"sympy/sets/tests/test_sets.py::test_is_superset\",\n \"sympy/sets/tests/test_sets.py::test_is_proper_superset\",\n \"sympy/sets/tests/test_sets.py::test_contains\",\n \"sympy/sets/tests/test_sets.py::test_interval_symbolic\",\n \"sympy/sets/tests/test_sets.py::test_union_contains\",\n \"sympy/sets/tests/test_sets.py::test_is_number\",\n \"sympy/sets/tests/test_sets.py::test_Interval_is_left_unbounded\",\n \"sympy/sets/tests/test_sets.py::test_Interval_is_right_unbounded\",\n \"sympy/sets/tests/test_sets.py::test_Interval_as_relational\",\n \"sympy/sets/tests/test_sets.py::test_Finite_as_relational\",\n \"sympy/sets/tests/test_sets.py::test_Union_as_relational\",\n \"sympy/sets/tests/test_sets.py::test_Intersection_as_relational\",\n \"sympy/sets/tests/test_sets.py::test_EmptySet\",\n \"sympy/sets/tests/test_sets.py::test_finite_basic\",\n \"sympy/sets/tests/test_sets.py::test_powerset\",\n \"sympy/sets/tests/test_sets.py::test_product_basic\",\n \"sympy/sets/tests/test_sets.py::test_real\",\n \"sympy/sets/tests/test_sets.py::test_supinf\",\n \"sympy/sets/tests/test_sets.py::test_universalset\",\n \"sympy/sets/tests/test_sets.py::test_Union_of_ProductSets_shares\",\n \"sympy/sets/tests/test_sets.py::test_Interval_free_symbols\",\n \"sympy/sets/tests/test_sets.py::test_image_interval\",\n \"sympy/sets/tests/test_sets.py::test_image_piecewise\",\n \"sympy/sets/tests/test_sets.py::test_image_FiniteSet\",\n \"sympy/sets/tests/test_sets.py::test_image_Union\",\n \"sympy/sets/tests/test_sets.py::test_image_EmptySet\",\n \"sympy/sets/tests/test_sets.py::test_issue_5724_7680\",\n \"sympy/sets/tests/test_sets.py::test_boundary\",\n \"sympy/sets/tests/test_sets.py::test_boundary_Union\",\n \"sympy/sets/tests/test_sets.py::test_boundary_ProductSet\",\n \"sympy/sets/tests/test_sets.py::test_boundary_ProductSet_line\",\n \"sympy/sets/tests/test_sets.py::test_is_open\",\n \"sympy/sets/tests/test_sets.py::test_is_closed\",\n \"sympy/sets/tests/test_sets.py::test_closure\",\n \"sympy/sets/tests/test_sets.py::test_interior\",\n \"sympy/sets/tests/test_sets.py::test_issue_7841\",\n \"sympy/sets/tests/test_sets.py::test_Eq\",\n \"sympy/sets/tests/test_sets.py::test_SymmetricDifference\",\n \"sympy/sets/tests/test_sets.py::test_issue_9536\",\n \"sympy/sets/tests/test_sets.py::test_issue_9637\",\n \"sympy/sets/tests/test_sets.py::test_issue_9808\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"BSD"},"__index_level_0__":{"kind":"number","value":261,"string":"261"}}},{"rowIdx":262,"cells":{"instance_id":{"kind":"string","value":"sympy__sympy-9965"},"base_commit":{"kind":"string","value":"81d78a2b22f735957c6686cd98fc3b3117ade162"},"created_at":{"kind":"string","value":"2015-10-05 20:57:02"},"environment_setup_commit":{"kind":"string","value":"0241b35cae5f2adc04dc37b25f7dc9c5f00bd746"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/sympy/core/function.py b/sympy/core/function.py\nindex ab14b62089..2ca570cbc4 100644\n--- a/sympy/core/function.py\n+++ b/sympy/core/function.py\n@@ -646,14 +646,23 @@ def fdiff(self, argindex=1):\n \"\"\"\n if not (1 <= argindex <= len(self.args)):\n raise ArgumentIndexError(self, argindex)\n- if not self.args[argindex - 1].is_Symbol:\n- # See issue 4624 and issue 4719 and issue 5600\n- arg_dummy = Dummy('xi_%i' % argindex)\n- arg_dummy.dummy_index = hash(self.args[argindex - 1])\n- return Subs(Derivative(\n- self.subs(self.args[argindex - 1], arg_dummy),\n- arg_dummy), arg_dummy, self.args[argindex - 1])\n- return Derivative(self, self.args[argindex - 1], evaluate=False)\n+\n+ if self.args[argindex - 1].is_Symbol:\n+ for i in range(len(self.args)):\n+ if i == argindex - 1:\n+ continue\n+ # See issue 8510\n+ if self.args[argindex - 1] in self.args[i].free_symbols:\n+ break\n+ else:\n+ return Derivative(self, self.args[argindex - 1], evaluate=False)\n+ # See issue 4624 and issue 4719 and issue 5600\n+ arg_dummy = Dummy('xi_%i' % argindex)\n+ arg_dummy.dummy_index = hash(self.args[argindex - 1])\n+ new_args = [arg for arg in self.args]\n+ new_args[argindex-1] = arg_dummy\n+ return Subs(Derivative(self.func(*new_args), arg_dummy),\n+ arg_dummy, self.args[argindex - 1])\n \n def _eval_as_leading_term(self, x):\n \"\"\"Stub that should be overridden by new Functions to return\n"},"problem_statement":{"kind":"string","value":"Differentiation of general functions\n```\r\nIn [1]:\r\nfrom sympy import *\r\nvar('x, y')\r\nf = Function('f')\r\n\r\nIn [2]:\r\nf(x + y, x).diff(x)\r\n\r\nOut[2]:\r\nDerivative(f(x + y, x), x) + Subs(Derivative(f(_xi_1, x), _xi_1), (_xi_1,), (x + y,))\r\n\r\nIn [3]:\r\nf(x, x).diff(x)\r\n\r\nOut[3]:\r\n2*Derivative(f(x, x), x)\r\n```\r\n\r\nFor `In [2]`, instead of the result, I would expect, \r\n`Subs(Derivative(f(x+y, _xi_2), _xi_2), (_xi_2,), (x,)) + Subs(Derivative(f(_xi_1, x), _xi_1), (_xi_1,), (x + y,))`"},"repo":{"kind":"string","value":"sympy/sympy"},"test_patch":{"kind":"string","value":"diff --git a/sympy/core/tests/test_function.py b/sympy/core/tests/test_function.py\nindex 86c0b6a723..96a9514932 100644\n--- a/sympy/core/tests/test_function.py\n+++ b/sympy/core/tests/test_function.py\n@@ -289,6 +289,12 @@ def test_deriv1():\n assert f(3*sin(x)).diff(x) == 3*cos(x)*Subs(Derivative(f(x), x),\n Tuple(x), Tuple(3*sin(x)))\n \n+ # See issue 8510\n+ assert f(x, x + z).diff(x) == Subs(Derivative(f(y, x + z), y), Tuple(y), Tuple(x)) \\\n+ + Subs(Derivative(f(x, y), y), Tuple(y), Tuple(x + z))\n+ assert f(x, x**2).diff(x) == Subs(Derivative(f(y, x**2), y), Tuple(y), Tuple(x)) \\\n+ + 2*x*Subs(Derivative(f(x, y), y), Tuple(y), Tuple(x**2))\n+\n \n def test_deriv2():\n assert (x**3).diff(x) == 3*x**2\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [],\n \"has_test_patch\": true,\n \"is_lite\": true,\n \"llm_score\": {\n \"difficulty_score\": 1,\n \"issue_text_score\": 0,\n \"test_score\": 0\n },\n \"num_modified_files\": 1\n}"},"version":{"kind":"string","value":"0.7"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"pytest\",\n \"pip_packages\": [\n \"pytest\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y libgmp-dev\"\n ],\n \"python\": \"3.6\",\n \"reqs_path\": null,\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work\ncertifi==2021.5.30\nimportlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1631916693255/work\niniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work\nmore-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work\nmpmath==1.3.0\npackaging @ file:///tmp/build/80754af9/packaging_1637314298585/work\npluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work\npy @ file:///opt/conda/conda-bld/py_1644396412707/work\npyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work\npytest==6.2.4\n-e git+https://github.com/sympy/sympy.git@81d78a2b22f735957c6686cd98fc3b3117ade162#egg=sympy\ntoml @ file:///tmp/build/80754af9/toml_1616166611790/work\ntyping_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work\nzipp @ file:///tmp/build/80754af9/zipp_1633618647012/work\n"},"environment":{"kind":"string","value":"name: sympy\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - attrs=21.4.0=pyhd3eb1b0_0\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2021.5.30=py36h06a4308_0\n - importlib-metadata=4.8.1=py36h06a4308_0\n - importlib_metadata=4.8.1=hd3eb1b0_0\n - iniconfig=1.1.1=pyhd3eb1b0_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.3=he6710b0_2\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - more-itertools=8.12.0=pyhd3eb1b0_0\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - packaging=21.3=pyhd3eb1b0_0\n - pip=21.2.2=py36h06a4308_0\n - pluggy=0.13.1=py36h06a4308_0\n - py=1.11.0=pyhd3eb1b0_0\n - pyparsing=3.0.4=pyhd3eb1b0_0\n - pytest=6.2.4=py36h06a4308_2\n - python=3.6.13=h12debd9_1\n - readline=8.2=h5eee18b_0\n - setuptools=58.0.4=py36h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - toml=0.10.2=pyhd3eb1b0_0\n - typing_extensions=4.1.1=pyh06a4308_0\n - wheel=0.37.1=pyhd3eb1b0_0\n - xz=5.6.4=h5eee18b_1\n - zipp=3.6.0=pyhd3eb1b0_0\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - mpmath==1.3.0\nprefix: /opt/conda/envs/sympy\n"},"FAIL_TO_PASS":{"kind":"list like","value":["sympy/core/tests/test_function.py::test_deriv1"],"string":"[\n \"sympy/core/tests/test_function.py::test_deriv1\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["sympy/core/tests/test_function.py::test_f_expand_complex","sympy/core/tests/test_function.py::test_bug1","sympy/core/tests/test_function.py::test_general_function","sympy/core/tests/test_function.py::test_derivative_subs_bug","sympy/core/tests/test_function.py::test_derivative_subs_self_bug","sympy/core/tests/test_function.py::test_derivative_linearity","sympy/core/tests/test_function.py::test_derivative_evaluate","sympy/core/tests/test_function.py::test_diff_symbols","sympy/core/tests/test_function.py::test_Function","sympy/core/tests/test_function.py::test_nargs","sympy/core/tests/test_function.py::test_Lambda","sympy/core/tests/test_function.py::test_IdentityFunction","sympy/core/tests/test_function.py::test_Lambda_symbols","sympy/core/tests/test_function.py::test_Lambda_arguments","sympy/core/tests/test_function.py::test_Lambda_equality","sympy/core/tests/test_function.py::test_Subs","sympy/core/tests/test_function.py::test_expand_function","sympy/core/tests/test_function.py::test_function_comparable","sympy/core/tests/test_function.py::test_deriv2","sympy/core/tests/test_function.py::test_func_deriv","sympy/core/tests/test_function.py::test_suppressed_evaluation","sympy/core/tests/test_function.py::test_function_evalf","sympy/core/tests/test_function.py::test_extensibility_eval","sympy/core/tests/test_function.py::test_function_non_commutative","sympy/core/tests/test_function.py::test_function_complex","sympy/core/tests/test_function.py::test_function__eval_nseries","sympy/core/tests/test_function.py::test_doit","sympy/core/tests/test_function.py::test_evalf_default","sympy/core/tests/test_function.py::test_issue_5399","sympy/core/tests/test_function.py::test_derivative_numerically","sympy/core/tests/test_function.py::test_fdiff_argument_index_error","sympy/core/tests/test_function.py::test_deriv_wrt_function","sympy/core/tests/test_function.py::test_diff_wrt_value","sympy/core/tests/test_function.py::test_diff_wrt","sympy/core/tests/test_function.py::test_diff_wrt_func_subs","sympy/core/tests/test_function.py::test_diff_wrt_not_allowed","sympy/core/tests/test_function.py::test_klein_gordon_lagrangian","sympy/core/tests/test_function.py::test_sho_lagrangian","sympy/core/tests/test_function.py::test_straight_line","sympy/core/tests/test_function.py::test_sort_variable","sympy/core/tests/test_function.py::test_unhandled","sympy/core/tests/test_function.py::test_issue_4711","sympy/core/tests/test_function.py::test_nfloat","sympy/core/tests/test_function.py::test_issue_7068","sympy/core/tests/test_function.py::test_issue_7231","sympy/core/tests/test_function.py::test_issue_7687","sympy/core/tests/test_function.py::test_issue_7688","sympy/core/tests/test_function.py::test_mexpand","sympy/core/tests/test_function.py::test_issue_8469","sympy/core/tests/test_function.py::test_should_evalf"],"string":"[\n \"sympy/core/tests/test_function.py::test_f_expand_complex\",\n \"sympy/core/tests/test_function.py::test_bug1\",\n \"sympy/core/tests/test_function.py::test_general_function\",\n \"sympy/core/tests/test_function.py::test_derivative_subs_bug\",\n \"sympy/core/tests/test_function.py::test_derivative_subs_self_bug\",\n \"sympy/core/tests/test_function.py::test_derivative_linearity\",\n \"sympy/core/tests/test_function.py::test_derivative_evaluate\",\n \"sympy/core/tests/test_function.py::test_diff_symbols\",\n \"sympy/core/tests/test_function.py::test_Function\",\n \"sympy/core/tests/test_function.py::test_nargs\",\n \"sympy/core/tests/test_function.py::test_Lambda\",\n \"sympy/core/tests/test_function.py::test_IdentityFunction\",\n \"sympy/core/tests/test_function.py::test_Lambda_symbols\",\n \"sympy/core/tests/test_function.py::test_Lambda_arguments\",\n \"sympy/core/tests/test_function.py::test_Lambda_equality\",\n \"sympy/core/tests/test_function.py::test_Subs\",\n \"sympy/core/tests/test_function.py::test_expand_function\",\n \"sympy/core/tests/test_function.py::test_function_comparable\",\n \"sympy/core/tests/test_function.py::test_deriv2\",\n \"sympy/core/tests/test_function.py::test_func_deriv\",\n \"sympy/core/tests/test_function.py::test_suppressed_evaluation\",\n \"sympy/core/tests/test_function.py::test_function_evalf\",\n \"sympy/core/tests/test_function.py::test_extensibility_eval\",\n \"sympy/core/tests/test_function.py::test_function_non_commutative\",\n \"sympy/core/tests/test_function.py::test_function_complex\",\n \"sympy/core/tests/test_function.py::test_function__eval_nseries\",\n \"sympy/core/tests/test_function.py::test_doit\",\n \"sympy/core/tests/test_function.py::test_evalf_default\",\n \"sympy/core/tests/test_function.py::test_issue_5399\",\n \"sympy/core/tests/test_function.py::test_derivative_numerically\",\n \"sympy/core/tests/test_function.py::test_fdiff_argument_index_error\",\n \"sympy/core/tests/test_function.py::test_deriv_wrt_function\",\n \"sympy/core/tests/test_function.py::test_diff_wrt_value\",\n \"sympy/core/tests/test_function.py::test_diff_wrt\",\n \"sympy/core/tests/test_function.py::test_diff_wrt_func_subs\",\n \"sympy/core/tests/test_function.py::test_diff_wrt_not_allowed\",\n \"sympy/core/tests/test_function.py::test_klein_gordon_lagrangian\",\n \"sympy/core/tests/test_function.py::test_sho_lagrangian\",\n \"sympy/core/tests/test_function.py::test_straight_line\",\n \"sympy/core/tests/test_function.py::test_sort_variable\",\n \"sympy/core/tests/test_function.py::test_unhandled\",\n \"sympy/core/tests/test_function.py::test_issue_4711\",\n \"sympy/core/tests/test_function.py::test_nfloat\",\n \"sympy/core/tests/test_function.py::test_issue_7068\",\n \"sympy/core/tests/test_function.py::test_issue_7231\",\n \"sympy/core/tests/test_function.py::test_issue_7687\",\n \"sympy/core/tests/test_function.py::test_issue_7688\",\n \"sympy/core/tests/test_function.py::test_mexpand\",\n \"sympy/core/tests/test_function.py::test_issue_8469\",\n \"sympy/core/tests/test_function.py::test_should_evalf\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"BSD"},"__index_level_0__":{"kind":"number","value":262,"string":"262"}}},{"rowIdx":263,"cells":{"instance_id":{"kind":"string","value":"marshmallow-code__marshmallow-293"},"base_commit":{"kind":"string","value":"39bed8d628e2d08da5026df2df5ec6b9e9bbadf3"},"created_at":{"kind":"string","value":"2015-10-07 22:51:36"},"environment_setup_commit":{"kind":"string","value":"1dbcae9c439d1a268717feb089351fc3c5180ac3"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/docs/quickstart.rst b/docs/quickstart.rst\nindex 4e7dcdb5..959e915a 100644\n--- a/docs/quickstart.rst\n+++ b/docs/quickstart.rst\n@@ -303,6 +303,22 @@ Dictionaries or lists are also accepted as the custom error message, in case you\n # 'age': ['Age is required.'],\n # 'city': {'message': 'City required', 'code': 400}}\n \n+Partial Loading\n++++++++++++++++\n+\n+When using the same schema in multiple places, you may only want to check required fields some of the time when deserializing. You can ignore missing fields entirely by setting ``partial=True``.\n+\n+.. code-block:: python\n+ :emphasize-lines: 5,6\n+\n+ class UserSchema(Schema):\n+ name = fields.String(required=True)\n+ age = fields.Integer(required=True)\n+\n+ data, errors = UserSchema().load({'age': 42}, partial=True)\n+ # OR UserSchema(partial=True).load({'age': 42})\n+ data, errors # => ({'age': 42}, {})\n+\n Schema.validate\n +++++++++++++++\n \ndiff --git a/marshmallow/marshalling.py b/marshmallow/marshalling.py\nindex 5caca583..6c315c03 100644\n--- a/marshmallow/marshalling.py\n+++ b/marshmallow/marshalling.py\n@@ -208,7 +208,7 @@ class Unmarshaller(ErrorStore):\n data=output\n )\n \n- def deserialize(self, data, fields_dict, many=False,\n+ def deserialize(self, data, fields_dict, many=False, partial=False,\n dict_class=dict, index_errors=True, index=None):\n \"\"\"Deserialize ``data`` based on the schema defined by ``fields_dict``.\n \n@@ -216,6 +216,7 @@ class Unmarshaller(ErrorStore):\n :param dict fields_dict: Mapping of field names to :class:`Field` objects.\n :param bool many: Set to `True` if ``data`` should be deserialized as\n a collection.\n+ :param bool partial: If `True`, ignore missing fields.\n :param type dict_class: Dictionary class used to construct the output.\n :param bool index_errors: Whether to store the index of invalid items in\n ``self.errors`` when ``many=True``.\n@@ -229,7 +230,7 @@ class Unmarshaller(ErrorStore):\n if many and data is not None:\n self._pending = True\n ret = [self.deserialize(d, fields_dict, many=False,\n- dict_class=dict_class,\n+ partial=partial, dict_class=dict_class,\n index=idx, index_errors=index_errors)\n for idx, d in enumerate(data)]\n \n@@ -265,6 +266,8 @@ class Unmarshaller(ErrorStore):\n field_name = field_obj.load_from\n raw_value = data.get(field_obj.load_from, missing)\n if raw_value is missing:\n+ if partial:\n+ continue\n _miss = field_obj.missing\n raw_value = _miss() if callable(_miss) else _miss\n if raw_value is missing and not field_obj.required:\ndiff --git a/marshmallow/schema.py b/marshmallow/schema.py\nindex 6275bd0a..6b38c984 100644\n--- a/marshmallow/schema.py\n+++ b/marshmallow/schema.py\n@@ -12,7 +12,7 @@ import types\n import uuid\n import warnings\n from collections import namedtuple\n-from functools import partial\n+import functools\n \n from marshmallow import base, fields, utils, class_registry, marshalling\n from marshmallow.compat import (with_metaclass, iteritems, text_type,\n@@ -251,6 +251,7 @@ class BaseSchema(base.SchemaABC):\n :param tuple load_only: A list or tuple of fields to skip during serialization\n :param tuple dump_only: A list or tuple of fields to skip during\n deserialization, read-only fields\n+ :param bool partial: If `True`, ignore missing fields when deserializing.\n \n .. versionchanged:: 2.0.0\n `__validators__`, `__preprocessors__`, and `__data_handlers__` are removed in favor of\n@@ -320,7 +321,8 @@ class BaseSchema(base.SchemaABC):\n pass\n \n def __init__(self, extra=None, only=(), exclude=(), prefix='', strict=False,\n- many=False, context=None, load_only=(), dump_only=()):\n+ many=False, context=None, load_only=(), dump_only=(),\n+ partial=False):\n # copy declared fields from metaclass\n self.declared_fields = copy.deepcopy(self._declared_fields)\n self.many = many\n@@ -331,6 +333,7 @@ class BaseSchema(base.SchemaABC):\n self.ordered = self.opts.ordered\n self.load_only = set(load_only) or set(self.opts.load_only)\n self.dump_only = set(dump_only) or set(self.opts.dump_only)\n+ self.partial = partial\n #: Dictionary mapping field_names -> :class:`Field` objects\n self.fields = self.dict_class()\n #: Callable marshalling object\n@@ -519,19 +522,21 @@ class BaseSchema(base.SchemaABC):\n ret = self.opts.json_module.dumps(deserialized, *args, **kwargs)\n return MarshalResult(ret, errors)\n \n- def load(self, data, many=None):\n+ def load(self, data, many=None, partial=None):\n \"\"\"Deserialize a data structure to an object defined by this Schema's\n fields and :meth:`make_object`.\n \n :param dict data: The data to deserialize.\n :param bool many: Whether to deserialize `data` as a collection. If `None`, the\n value for `self.many` is used.\n+ :param bool partial: Whether to ignore missing fields. If `None`, the\n+ value for `self.partial` is used.\n :return: A tuple of the form (``data``, ``errors``)\n :rtype: `UnmarshalResult`, a `collections.namedtuple`\n \n .. versionadded:: 1.0.0\n \"\"\"\n- result, errors = self._do_load(data, many, postprocess=True)\n+ result, errors = self._do_load(data, many, partial, postprocess=True)\n return UnmarshalResult(data=result, errors=errors)\n \n def loads(self, json_data, many=None, *args, **kwargs):\n@@ -540,13 +545,20 @@ class BaseSchema(base.SchemaABC):\n :param str json_data: A JSON string of the data to deserialize.\n :param bool many: Whether to deserialize `obj` as a collection. If `None`, the\n value for `self.many` is used.\n+ :param bool partial: Whether to ignore missing fields. If `None`, the\n+ value for `self.partial` is used.\n :return: A tuple of the form (``data``, ``errors``)\n :rtype: `UnmarshalResult`, a `collections.namedtuple`\n \n .. versionadded:: 1.0.0\n \"\"\"\n+ # TODO: This avoids breaking backward compatibility if people were\n+ # passing in positional args after `many` for use by `json.loads`, but\n+ # ideally we shouldn't have to do this.\n+ partial = kwargs.pop('partial', None)\n+\n data = self.opts.json_module.loads(json_data, *args, **kwargs)\n- return self.load(data, many=many)\n+ return self.load(data, many=many, partial=partial)\n \n def validate(self, data, many=None):\n \"\"\"Validate `data` against the schema, returning a dictionary of\n@@ -565,17 +577,20 @@ class BaseSchema(base.SchemaABC):\n \n ##### Private Helpers #####\n \n- def _do_load(self, data, many=None, postprocess=True):\n+ def _do_load(self, data, many=None, partial=None, postprocess=True):\n \"\"\"Deserialize `data`, returning the deserialized result and a dictonary of\n validation errors.\n \n :param data: The data to deserialize.\n :param bool many: Whether to deserialize `data` as a collection. If `None`, the\n value for `self.many` is used.\n+ :param bool partial: Whether to ignore missing fields. If `None`, the\n+ value for `self.partial` is used.\n :param bool postprocess: Whether to run post_load methods..\n :return: A tuple of the form (`data`, `errors`)\n \"\"\"\n many = self.many if many is None else bool(many)\n+ partial = self.partial if partial is None else bool(partial)\n \n processed_data = self._invoke_load_processors(PRE_LOAD, data, many, original_data=data)\n \n@@ -584,6 +599,7 @@ class BaseSchema(base.SchemaABC):\n processed_data,\n self.fields,\n many=many,\n+ partial=partial,\n dict_class=self.dict_class,\n index_errors=self.opts.index_errors,\n )\n@@ -780,7 +796,7 @@ class BaseSchema(base.SchemaABC):\n validator_kwargs = validator.__marshmallow_kwargs__[(VALIDATES_SCHEMA, pass_many)]\n pass_original = validator_kwargs.get('pass_original', False)\n if pass_many:\n- validator = partial(validator, many=many)\n+ validator = functools.partial(validator, many=many)\n if many:\n for idx, item in enumerate(data):\n try:\n"},"problem_statement":{"kind":"string","value":"\"Partial\" deserialization support\nFor implementing `PATCH` handlers on REST endpoints, it would be useful to have a concept of partial deserialization.\r\n\r\nThis would mean ignoring missing required fields and default values for missing fields.\r\n\r\nI know this sounds a bit weird, but it matches a standard CRUD endpoint fairly well - `POST` or `PUT` to that endpoint should use the full validation w/r/t required fields or defaults, but `PATCH` is intended to apply a partial update and only modify what was actually changed.\r\n\r\nI can handle this in userspace by catching `ValidationError`s for missing fields, but I don't think I can do the same for ignoring default field values.\r\n\r\nHere's the equivalent API in DRF: http://www.django-rest-framework.org/api-guide/serializers/#partial-updates. From my POV I think any `partial` arg (if you think it makes sense) would best be positioned as a named argument on `load`, though."},"repo":{"kind":"string","value":"marshmallow-code/marshmallow"},"test_patch":{"kind":"string","value":"diff --git a/tests/test_deserialization.py b/tests/test_deserialization.py\nindex 3b26dc5c..f886f5e6 100644\n--- a/tests/test_deserialization.py\n+++ b/tests/test_deserialization.py\n@@ -1089,6 +1089,28 @@ class TestSchemaDeserialization:\n assert len(errors['foo']) == 1\n assert 'Missing data for required field.' in errors['foo']\n \n+ @pytest.mark.parametrize('partial_schema',\n+ [\n+ True,\n+ False\n+ ])\n+ def test_partial_deserialization(self, partial_schema):\n+ class MySchema(Schema):\n+ foo = fields.Field(required=True)\n+ bar = fields.Field(required=True)\n+\n+ schema_args = {}\n+ load_args = {}\n+ if partial_schema:\n+ schema_args['partial'] = True\n+ else:\n+ load_args['partial'] = True\n+ data, errors = MySchema(**schema_args).load({'foo': 3}, **load_args)\n+\n+ assert data['foo'] == 3\n+ assert 'bar' not in data\n+ assert not errors\n+\n validators_gen = (func for func in [lambda x: x <= 24, lambda x: 18 <= x])\n \n validators_gen_float = (func for func in\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_hyperlinks\",\n \"has_many_modified_files\",\n \"has_many_hunks\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 2,\n \"issue_text_score\": 0,\n \"test_score\": 2\n },\n \"num_modified_files\": 3\n}"},"version":{"kind":"string","value":"2.1"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .[dev]\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"requirements.txt\",\n \"pip_packages\": [\n \"pytest\",\n \"pytest-cov\",\n \"pytest-xdist\",\n \"pytest-mock\",\n \"pytest-asyncio\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\n \"python\": \"3.9\",\n \"reqs_path\": [\n \"dev-requirements.txt\"\n ],\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"backports.tarfile==1.2.0\ncachetools==5.5.2\ncertifi==2025.1.31\ncffi==1.17.1\nchardet==5.2.0\ncharset-normalizer==3.4.1\ncolorama==0.4.6\ncoverage==7.8.0\ncryptography==44.0.2\ndistlib==0.3.9\ndocutils==0.21.2\nexceptiongroup==1.2.2\nexecnet==2.1.1\nfilelock==3.18.0\nflake8==2.4.1\nid==1.5.0\nidna==3.10\nimportlib_metadata==8.6.1\niniconfig==2.1.0\ninvoke==2.2.0\njaraco.classes==3.4.0\njaraco.context==6.0.1\njaraco.functools==4.1.0\njeepney==0.9.0\nkeyring==25.6.0\nmarkdown-it-py==3.0.0\n-e git+https://github.com/marshmallow-code/marshmallow.git@39bed8d628e2d08da5026df2df5ec6b9e9bbadf3#egg=marshmallow\nmccabe==0.3.1\nmdurl==0.1.2\nmore-itertools==10.6.0\nnh3==0.2.21\npackaging==24.2\npep8==1.7.1\nplatformdirs==4.3.7\npluggy==1.5.0\npy==1.11.0\npycparser==2.22\npyflakes==0.8.1\nPygments==2.19.1\npyproject-api==1.9.0\npytest==8.3.5\npytest-asyncio==0.26.0\npytest-cov==6.0.0\npytest-mock==3.14.0\npytest-xdist==3.6.1\npython-dateutil==2.9.0.post0\npytz==2025.2\nreadme_renderer==44.0\nrequests==2.32.3\nrequests-toolbelt==1.0.0\nrfc3986==2.0.0\nrich==14.0.0\nSecretStorage==3.3.3\nsimplejson==3.20.1\nsix==1.17.0\ntomli==2.2.1\ntox==4.25.0\ntwine==6.1.0\ntyping_extensions==4.13.0\nurllib3==2.3.0\nvirtualenv==20.29.3\nzipp==3.21.0\n"},"environment":{"kind":"string","value":"name: marshmallow\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - ca-certificates=2025.2.25=h06a4308_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.4.4=h6a678d5_1\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=3.0.16=h5eee18b_0\n - pip=25.0=py39h06a4308_0\n - python=3.9.21=he870216_1\n - readline=8.2=h5eee18b_0\n - setuptools=75.8.0=py39h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - tzdata=2025a=h04d1e81_0\n - wheel=0.45.1=py39h06a4308_0\n - xz=5.6.4=h5eee18b_1\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - backports-tarfile==1.2.0\n - cachetools==5.5.2\n - certifi==2025.1.31\n - cffi==1.17.1\n - chardet==5.2.0\n - charset-normalizer==3.4.1\n - colorama==0.4.6\n - coverage==7.8.0\n - cryptography==44.0.2\n - distlib==0.3.9\n - docutils==0.21.2\n - exceptiongroup==1.2.2\n - execnet==2.1.1\n - filelock==3.18.0\n - flake8==2.4.1\n - id==1.5.0\n - idna==3.10\n - importlib-metadata==8.6.1\n - iniconfig==2.1.0\n - invoke==2.2.0\n - jaraco-classes==3.4.0\n - jaraco-context==6.0.1\n - jaraco-functools==4.1.0\n - jeepney==0.9.0\n - keyring==25.6.0\n - markdown-it-py==3.0.0\n - mccabe==0.3.1\n - mdurl==0.1.2\n - more-itertools==10.6.0\n - nh3==0.2.21\n - packaging==24.2\n - pep8==1.7.1\n - platformdirs==4.3.7\n - pluggy==1.5.0\n - py==1.11.0\n - pycparser==2.22\n - pyflakes==0.8.1\n - pygments==2.19.1\n - pyproject-api==1.9.0\n - pytest==8.3.5\n - pytest-asyncio==0.26.0\n - pytest-cov==6.0.0\n - pytest-mock==3.14.0\n - pytest-xdist==3.6.1\n - python-dateutil==2.9.0.post0\n - pytz==2025.2\n - readme-renderer==44.0\n - requests==2.32.3\n - requests-toolbelt==1.0.0\n - rfc3986==2.0.0\n - rich==14.0.0\n - secretstorage==3.3.3\n - simplejson==3.20.1\n - six==1.17.0\n - tomli==2.2.1\n - tox==4.25.0\n - twine==6.1.0\n - typing-extensions==4.13.0\n - urllib3==2.3.0\n - virtualenv==20.29.3\n - zipp==3.21.0\nprefix: /opt/conda/envs/marshmallow\n"},"FAIL_TO_PASS":{"kind":"list like","value":["tests/test_deserialization.py::TestSchemaDeserialization::test_partial_deserialization[True]","tests/test_deserialization.py::TestSchemaDeserialization::test_partial_deserialization[False]"],"string":"[\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_partial_deserialization[True]\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_partial_deserialization[False]\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[String]","tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Integer]","tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Boolean]","tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Float]","tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Number]","tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[DateTime]","tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[LocalDateTime]","tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Time]","tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Date]","tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[TimeDelta]","tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Dict]","tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Url]","tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Email]","tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[FormattedString]","tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[UUID]","tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Decimal]","tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[String]","tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Integer]","tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Boolean]","tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Float]","tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Number]","tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[DateTime]","tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[LocalDateTime]","tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Time]","tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Date]","tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[TimeDelta]","tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Dict]","tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Url]","tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Email]","tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[FormattedString]","tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[UUID]","tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Decimal]","tests/test_deserialization.py::TestDeserializingNone::test_allow_none_is_true_if_missing_is_true","tests/test_deserialization.py::TestDeserializingNone::test_list_field_deserialize_none_to_empty_list","tests/test_deserialization.py::TestFieldDeserialization::test_float_field_deserialization","tests/test_deserialization.py::TestFieldDeserialization::test_invalid_float_field_deserialization[bad]","tests/test_deserialization.py::TestFieldDeserialization::test_invalid_float_field_deserialization[]","tests/test_deserialization.py::TestFieldDeserialization::test_invalid_float_field_deserialization[in_val2]","tests/test_deserialization.py::TestFieldDeserialization::test_integer_field_deserialization","tests/test_deserialization.py::TestFieldDeserialization::test_decimal_field_deserialization","tests/test_deserialization.py::TestFieldDeserialization::test_decimal_field_with_places","tests/test_deserialization.py::TestFieldDeserialization::test_decimal_field_with_places_and_rounding","tests/test_deserialization.py::TestFieldDeserialization::test_decimal_field_deserialization_string","tests/test_deserialization.py::TestFieldDeserialization::test_decimal_field_special_values","tests/test_deserialization.py::TestFieldDeserialization::test_decimal_field_special_values_not_permitted","tests/test_deserialization.py::TestFieldDeserialization::test_string_field_deserialization","tests/test_deserialization.py::TestFieldDeserialization::test_boolean_field_deserialization","tests/test_deserialization.py::TestFieldDeserialization::test_boolean_field_deserialization_with_custom_truthy_values","tests/test_deserialization.py::TestFieldDeserialization::test_boolean_field_deserialization_with_custom_truthy_values_invalid[notvalid]","tests/test_deserialization.py::TestFieldDeserialization::test_boolean_field_deserialization_with_custom_truthy_values_invalid[123]","tests/test_deserialization.py::TestFieldDeserialization::test_invalid_datetime_deserialization[not-a-datetime]","tests/test_deserialization.py::TestFieldDeserialization::test_invalid_datetime_deserialization[42]","tests/test_deserialization.py::TestFieldDeserialization::test_invalid_datetime_deserialization[]","tests/test_deserialization.py::TestFieldDeserialization::test_invalid_datetime_deserialization[in_value3]","tests/test_deserialization.py::TestFieldDeserialization::test_custom_date_format_datetime_field_deserialization","tests/test_deserialization.py::TestFieldDeserialization::test_rfc_datetime_field_deserialization[rfc]","tests/test_deserialization.py::TestFieldDeserialization::test_rfc_datetime_field_deserialization[rfc822]","tests/test_deserialization.py::TestFieldDeserialization::test_iso_datetime_field_deserialization[iso]","tests/test_deserialization.py::TestFieldDeserialization::test_iso_datetime_field_deserialization[iso8601]","tests/test_deserialization.py::TestFieldDeserialization::test_localdatetime_field_deserialization","tests/test_deserialization.py::TestFieldDeserialization::test_time_field_deserialization","tests/test_deserialization.py::TestFieldDeserialization::test_invalid_time_field_deserialization[badvalue]","tests/test_deserialization.py::TestFieldDeserialization::test_invalid_time_field_deserialization[]","tests/test_deserialization.py::TestFieldDeserialization::test_invalid_time_field_deserialization[in_data2]","tests/test_deserialization.py::TestFieldDeserialization::test_invalid_time_field_deserialization[42]","tests/test_deserialization.py::TestFieldDeserialization::test_timedelta_field_deserialization","tests/test_deserialization.py::TestFieldDeserialization::test_invalid_timedelta_field_deserialization[]","tests/test_deserialization.py::TestFieldDeserialization::test_invalid_timedelta_field_deserialization[badvalue]","tests/test_deserialization.py::TestFieldDeserialization::test_invalid_timedelta_field_deserialization[in_value2]","tests/test_deserialization.py::TestFieldDeserialization::test_invalid_timedelta_field_deserialization[9999999999]","tests/test_deserialization.py::TestFieldDeserialization::test_date_field_deserialization","tests/test_deserialization.py::TestFieldDeserialization::test_invalid_date_field_deserialization[]","tests/test_deserialization.py::TestFieldDeserialization::test_invalid_date_field_deserialization[123]","tests/test_deserialization.py::TestFieldDeserialization::test_invalid_date_field_deserialization[in_value2]","tests/test_deserialization.py::TestFieldDeserialization::test_dict_field_deserialization","tests/test_deserialization.py::TestFieldDeserialization::test_url_field_deserialization","tests/test_deserialization.py::TestFieldDeserialization::test_relative_url_field_deserialization","tests/test_deserialization.py::TestFieldDeserialization::test_email_field_deserialization","tests/test_deserialization.py::TestFieldDeserialization::test_function_field_deserialization_is_noop_by_default","tests/test_deserialization.py::TestFieldDeserialization::test_function_field_deserialization_with_callable","tests/test_deserialization.py::TestFieldDeserialization::test_uuid_field_deserialization","tests/test_deserialization.py::TestFieldDeserialization::test_invalid_uuid_deserialization[malformed]","tests/test_deserialization.py::TestFieldDeserialization::test_invalid_uuid_deserialization[123]","tests/test_deserialization.py::TestFieldDeserialization::test_invalid_uuid_deserialization[in_value2]","tests/test_deserialization.py::TestFieldDeserialization::test_deserialization_function_must_be_callable","tests/test_deserialization.py::TestFieldDeserialization::test_method_field_deserialization_is_noop_by_default","tests/test_deserialization.py::TestFieldDeserialization::test_deserialization_method","tests/test_deserialization.py::TestFieldDeserialization::test_deserialization_method_must_be_a_method","tests/test_deserialization.py::TestFieldDeserialization::test_query_select_field_func_key_deserialization","tests/test_deserialization.py::TestFieldDeserialization::test_query_select_field_string_key_deserialization","tests/test_deserialization.py::TestFieldDeserialization::test_query_select_list_field_func_key_deserialization","tests/test_deserialization.py::TestFieldDeserialization::test_query_select_list_field_string_key_deserialization","tests/test_deserialization.py::TestFieldDeserialization::test_datetime_list_field_deserialization","tests/test_deserialization.py::TestFieldDeserialization::test_list_field_deserialize_invalid_item","tests/test_deserialization.py::TestFieldDeserialization::test_list_field_deserialize_value_that_is_not_a_list[notalist]","tests/test_deserialization.py::TestFieldDeserialization::test_list_field_deserialize_value_that_is_not_a_list[42]","tests/test_deserialization.py::TestFieldDeserialization::test_list_field_deserialize_value_that_is_not_a_list[value2]","tests/test_deserialization.py::TestFieldDeserialization::test_constant_field_deserialization","tests/test_deserialization.py::TestFieldDeserialization::test_constant_is_always_included_in_deserialized_data","tests/test_deserialization.py::TestFieldDeserialization::test_field_deserialization_with_user_validator_function","tests/test_deserialization.py::TestFieldDeserialization::test_field_deserialization_with_user_validator_class_that_returns_bool","tests/test_deserialization.py::TestFieldDeserialization::test_field_deserialization_with_user_validator_that_raises_error_with_list","tests/test_deserialization.py::TestFieldDeserialization::test_validator_must_return_false_to_raise_error","tests/test_deserialization.py::TestFieldDeserialization::test_field_deserialization_with_validator_with_nonascii_input","tests/test_deserialization.py::TestFieldDeserialization::test_field_deserialization_with_user_validators","tests/test_deserialization.py::TestFieldDeserialization::test_field_deserialization_with_custom_error_message","tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_to_dict","tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_missing_values","tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_many","tests/test_deserialization.py::TestSchemaDeserialization::test_exclude","tests/test_deserialization.py::TestSchemaDeserialization::test_nested_single_deserialization_to_dict","tests/test_deserialization.py::TestSchemaDeserialization::test_nested_list_deserialization_to_dict","tests/test_deserialization.py::TestSchemaDeserialization::test_nested_single_none_not_allowed","tests/test_deserialization.py::TestSchemaDeserialization::test_nested_many_non_not_allowed","tests/test_deserialization.py::TestSchemaDeserialization::test_nested_single_required_missing","tests/test_deserialization.py::TestSchemaDeserialization::test_nested_many_required_missing","tests/test_deserialization.py::TestSchemaDeserialization::test_none_deserialization","tests/test_deserialization.py::TestSchemaDeserialization::test_nested_none_deserialization","tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_attribute_param","tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_attribute_param_error_returns_field_name_not_attribute_name","tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_attribute_param_error_returns_load_from_not_attribute_name","tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_load_from_param","tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_dump_only_param","tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_missing_param_value","tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_missing_param_callable","tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_missing_param_none","tests/test_deserialization.py::TestSchemaDeserialization::test_deserialization_returns_errors","tests/test_deserialization.py::TestSchemaDeserialization::test_deserialization_returns_errors_with_multiple_validators","tests/test_deserialization.py::TestSchemaDeserialization::test_strict_mode_deserialization","tests/test_deserialization.py::TestSchemaDeserialization::test_strict_mode_many","tests/test_deserialization.py::TestSchemaDeserialization::test_strict_mode_deserialization_with_multiple_validators","tests/test_deserialization.py::TestSchemaDeserialization::test_uncaught_validation_errors_are_stored","tests/test_deserialization.py::TestSchemaDeserialization::test_multiple_errors_can_be_stored_for_a_field","tests/test_deserialization.py::TestSchemaDeserialization::test_multiple_errors_can_be_stored_for_an_email_field","tests/test_deserialization.py::TestSchemaDeserialization::test_multiple_errors_can_be_stored_for_a_url_field","tests/test_deserialization.py::TestSchemaDeserialization::test_required_value_only_passed_to_validators_if_provided","tests/test_deserialization.py::TestValidation::test_integer_with_validator","tests/test_deserialization.py::TestValidation::test_integer_with_validators[field0]","tests/test_deserialization.py::TestValidation::test_integer_with_validators[field1]","tests/test_deserialization.py::TestValidation::test_integer_with_validators[field2]","tests/test_deserialization.py::TestValidation::test_float_with_validators[field0]","tests/test_deserialization.py::TestValidation::test_float_with_validators[field1]","tests/test_deserialization.py::TestValidation::test_float_with_validators[field2]","tests/test_deserialization.py::TestValidation::test_string_validator","tests/test_deserialization.py::TestValidation::test_function_validator","tests/test_deserialization.py::TestValidation::test_function_validators[field0]","tests/test_deserialization.py::TestValidation::test_function_validators[field1]","tests/test_deserialization.py::TestValidation::test_function_validators[field2]","tests/test_deserialization.py::TestValidation::test_method_validator","tests/test_deserialization.py::TestValidation::test_nested_data_is_stored_when_validation_fails","tests/test_deserialization.py::test_required_field_failure[String]","tests/test_deserialization.py::test_required_field_failure[Integer]","tests/test_deserialization.py::test_required_field_failure[Boolean]","tests/test_deserialization.py::test_required_field_failure[Float]","tests/test_deserialization.py::test_required_field_failure[Number]","tests/test_deserialization.py::test_required_field_failure[DateTime]","tests/test_deserialization.py::test_required_field_failure[LocalDateTime]","tests/test_deserialization.py::test_required_field_failure[Time]","tests/test_deserialization.py::test_required_field_failure[Date]","tests/test_deserialization.py::test_required_field_failure[TimeDelta]","tests/test_deserialization.py::test_required_field_failure[Dict]","tests/test_deserialization.py::test_required_field_failure[Url]","tests/test_deserialization.py::test_required_field_failure[Email]","tests/test_deserialization.py::test_required_field_failure[UUID]","tests/test_deserialization.py::test_required_field_failure[Decimal]","tests/test_deserialization.py::test_required_message_can_be_changed[My","tests/test_deserialization.py::test_required_message_can_be_changed[message1]","tests/test_deserialization.py::test_required_message_can_be_changed[message2]","tests/test_deserialization.py::test_deserialize_doesnt_raise_exception_if_strict_is_false_and_input_type_is_incorrect","tests/test_deserialization.py::test_deserialize_raises_exception_if_strict_is_true_and_input_type_is_incorrect"],"string":"[\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[String]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Integer]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Boolean]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Float]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Number]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[DateTime]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[LocalDateTime]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Time]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Date]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[TimeDelta]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Dict]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Url]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Email]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[FormattedString]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[UUID]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Decimal]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[String]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Integer]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Boolean]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Float]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Number]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[DateTime]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[LocalDateTime]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Time]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Date]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[TimeDelta]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Dict]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Url]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Email]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[FormattedString]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[UUID]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Decimal]\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_allow_none_is_true_if_missing_is_true\",\n \"tests/test_deserialization.py::TestDeserializingNone::test_list_field_deserialize_none_to_empty_list\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_float_field_deserialization\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_invalid_float_field_deserialization[bad]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_invalid_float_field_deserialization[]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_invalid_float_field_deserialization[in_val2]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_integer_field_deserialization\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_decimal_field_deserialization\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_decimal_field_with_places\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_decimal_field_with_places_and_rounding\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_decimal_field_deserialization_string\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_decimal_field_special_values\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_decimal_field_special_values_not_permitted\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_string_field_deserialization\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_boolean_field_deserialization\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_boolean_field_deserialization_with_custom_truthy_values\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_boolean_field_deserialization_with_custom_truthy_values_invalid[notvalid]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_boolean_field_deserialization_with_custom_truthy_values_invalid[123]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_invalid_datetime_deserialization[not-a-datetime]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_invalid_datetime_deserialization[42]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_invalid_datetime_deserialization[]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_invalid_datetime_deserialization[in_value3]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_custom_date_format_datetime_field_deserialization\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_rfc_datetime_field_deserialization[rfc]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_rfc_datetime_field_deserialization[rfc822]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_iso_datetime_field_deserialization[iso]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_iso_datetime_field_deserialization[iso8601]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_localdatetime_field_deserialization\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_time_field_deserialization\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_invalid_time_field_deserialization[badvalue]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_invalid_time_field_deserialization[]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_invalid_time_field_deserialization[in_data2]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_invalid_time_field_deserialization[42]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_timedelta_field_deserialization\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_invalid_timedelta_field_deserialization[]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_invalid_timedelta_field_deserialization[badvalue]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_invalid_timedelta_field_deserialization[in_value2]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_invalid_timedelta_field_deserialization[9999999999]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_date_field_deserialization\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_invalid_date_field_deserialization[]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_invalid_date_field_deserialization[123]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_invalid_date_field_deserialization[in_value2]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_dict_field_deserialization\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_url_field_deserialization\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_relative_url_field_deserialization\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_email_field_deserialization\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_function_field_deserialization_is_noop_by_default\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_function_field_deserialization_with_callable\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_uuid_field_deserialization\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_invalid_uuid_deserialization[malformed]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_invalid_uuid_deserialization[123]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_invalid_uuid_deserialization[in_value2]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_deserialization_function_must_be_callable\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_method_field_deserialization_is_noop_by_default\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_deserialization_method\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_deserialization_method_must_be_a_method\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_query_select_field_func_key_deserialization\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_query_select_field_string_key_deserialization\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_query_select_list_field_func_key_deserialization\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_query_select_list_field_string_key_deserialization\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_datetime_list_field_deserialization\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_list_field_deserialize_invalid_item\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_list_field_deserialize_value_that_is_not_a_list[notalist]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_list_field_deserialize_value_that_is_not_a_list[42]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_list_field_deserialize_value_that_is_not_a_list[value2]\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_constant_field_deserialization\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_constant_is_always_included_in_deserialized_data\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_field_deserialization_with_user_validator_function\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_field_deserialization_with_user_validator_class_that_returns_bool\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_field_deserialization_with_user_validator_that_raises_error_with_list\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_validator_must_return_false_to_raise_error\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_field_deserialization_with_validator_with_nonascii_input\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_field_deserialization_with_user_validators\",\n \"tests/test_deserialization.py::TestFieldDeserialization::test_field_deserialization_with_custom_error_message\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_to_dict\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_missing_values\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_many\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_exclude\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_nested_single_deserialization_to_dict\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_nested_list_deserialization_to_dict\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_nested_single_none_not_allowed\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_nested_many_non_not_allowed\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_nested_single_required_missing\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_nested_many_required_missing\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_none_deserialization\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_nested_none_deserialization\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_attribute_param\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_attribute_param_error_returns_field_name_not_attribute_name\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_attribute_param_error_returns_load_from_not_attribute_name\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_load_from_param\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_dump_only_param\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_missing_param_value\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_missing_param_callable\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_missing_param_none\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_deserialization_returns_errors\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_deserialization_returns_errors_with_multiple_validators\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_strict_mode_deserialization\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_strict_mode_many\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_strict_mode_deserialization_with_multiple_validators\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_uncaught_validation_errors_are_stored\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_multiple_errors_can_be_stored_for_a_field\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_multiple_errors_can_be_stored_for_an_email_field\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_multiple_errors_can_be_stored_for_a_url_field\",\n \"tests/test_deserialization.py::TestSchemaDeserialization::test_required_value_only_passed_to_validators_if_provided\",\n \"tests/test_deserialization.py::TestValidation::test_integer_with_validator\",\n \"tests/test_deserialization.py::TestValidation::test_integer_with_validators[field0]\",\n \"tests/test_deserialization.py::TestValidation::test_integer_with_validators[field1]\",\n \"tests/test_deserialization.py::TestValidation::test_integer_with_validators[field2]\",\n \"tests/test_deserialization.py::TestValidation::test_float_with_validators[field0]\",\n \"tests/test_deserialization.py::TestValidation::test_float_with_validators[field1]\",\n \"tests/test_deserialization.py::TestValidation::test_float_with_validators[field2]\",\n \"tests/test_deserialization.py::TestValidation::test_string_validator\",\n \"tests/test_deserialization.py::TestValidation::test_function_validator\",\n \"tests/test_deserialization.py::TestValidation::test_function_validators[field0]\",\n \"tests/test_deserialization.py::TestValidation::test_function_validators[field1]\",\n \"tests/test_deserialization.py::TestValidation::test_function_validators[field2]\",\n \"tests/test_deserialization.py::TestValidation::test_method_validator\",\n \"tests/test_deserialization.py::TestValidation::test_nested_data_is_stored_when_validation_fails\",\n \"tests/test_deserialization.py::test_required_field_failure[String]\",\n \"tests/test_deserialization.py::test_required_field_failure[Integer]\",\n \"tests/test_deserialization.py::test_required_field_failure[Boolean]\",\n \"tests/test_deserialization.py::test_required_field_failure[Float]\",\n \"tests/test_deserialization.py::test_required_field_failure[Number]\",\n \"tests/test_deserialization.py::test_required_field_failure[DateTime]\",\n \"tests/test_deserialization.py::test_required_field_failure[LocalDateTime]\",\n \"tests/test_deserialization.py::test_required_field_failure[Time]\",\n \"tests/test_deserialization.py::test_required_field_failure[Date]\",\n \"tests/test_deserialization.py::test_required_field_failure[TimeDelta]\",\n \"tests/test_deserialization.py::test_required_field_failure[Dict]\",\n \"tests/test_deserialization.py::test_required_field_failure[Url]\",\n \"tests/test_deserialization.py::test_required_field_failure[Email]\",\n \"tests/test_deserialization.py::test_required_field_failure[UUID]\",\n \"tests/test_deserialization.py::test_required_field_failure[Decimal]\",\n \"tests/test_deserialization.py::test_required_message_can_be_changed[My\",\n \"tests/test_deserialization.py::test_required_message_can_be_changed[message1]\",\n \"tests/test_deserialization.py::test_required_message_can_be_changed[message2]\",\n \"tests/test_deserialization.py::test_deserialize_doesnt_raise_exception_if_strict_is_false_and_input_type_is_incorrect\",\n \"tests/test_deserialization.py::test_deserialize_raises_exception_if_strict_is_true_and_input_type_is_incorrect\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"MIT License"},"__index_level_0__":{"kind":"number","value":263,"string":"263"}}},{"rowIdx":264,"cells":{"instance_id":{"kind":"string","value":"docker__docker-py-806"},"base_commit":{"kind":"string","value":"f479720d517a7db7f886916190b3032d29d18f10"},"created_at":{"kind":"string","value":"2015-10-09 19:03:05"},"environment_setup_commit":{"kind":"string","value":"f479720d517a7db7f886916190b3032d29d18f10"},"hints_text":{"kind":"string","value":"dnephin: some CI failures, otherwise looks good"},"patch":{"kind":"string","value":"diff --git a/docker/auth/auth.py b/docker/auth/auth.py\nindex 366bc67e..1ee9f812 100644\n--- a/docker/auth/auth.py\n+++ b/docker/auth/auth.py\n@@ -102,7 +102,7 @@ def decode_auth(auth):\n \n def encode_header(auth):\n auth_json = json.dumps(auth).encode('ascii')\n- return base64.b64encode(auth_json)\n+ return base64.urlsafe_b64encode(auth_json)\n \n \n def parse_auth(entries):\n"},"problem_statement":{"kind":"string","value":"Auth fails with long passwords\nSee https://github.com/docker/docker/issues/16840\r\n\r\ndocker-py is encoding `X-Registry-Auth` with regular base64 and not the url safe version of base64 that jwt tokens use."},"repo":{"kind":"string","value":"docker/docker-py"},"test_patch":{"kind":"string","value":"diff --git a/tests/utils_test.py b/tests/utils_test.py\nindex b1adde26..04183f9f 100644\n--- a/tests/utils_test.py\n+++ b/tests/utils_test.py\n@@ -19,7 +19,9 @@ from docker.utils import (\n exclude_paths, convert_volume_binds, decode_json_header\n )\n from docker.utils.ports import build_port_bindings, split_port\n-from docker.auth import resolve_repository_name, resolve_authconfig\n+from docker.auth import (\n+ resolve_repository_name, resolve_authconfig, encode_header\n+)\n \n from . import base\n from .helpers import make_tree\n@@ -376,12 +378,21 @@ class UtilsTest(base.BaseTestCase):\n obj = {'a': 'b', 'c': 1}\n data = None\n if six.PY3:\n- data = base64.b64encode(bytes(json.dumps(obj), 'utf-8'))\n+ data = base64.urlsafe_b64encode(bytes(json.dumps(obj), 'utf-8'))\n else:\n- data = base64.b64encode(json.dumps(obj))\n+ data = base64.urlsafe_b64encode(json.dumps(obj))\n decoded_data = decode_json_header(data)\n self.assertEqual(obj, decoded_data)\n \n+ def test_803_urlsafe_encode(self):\n+ auth_data = {\n+ 'username': 'root',\n+ 'password': 'GR?XGR?XGR?XGR?X'\n+ }\n+ encoded = encode_header(auth_data)\n+ assert b'/' not in encoded\n+ assert b'_' in encoded\n+\n def test_resolve_repository_name(self):\n # docker hub library image\n self.assertEqual(\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_short_problem_statement\",\n \"has_hyperlinks\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 1,\n \"issue_text_score\": 0,\n \"test_score\": 2\n },\n \"num_modified_files\": 1\n}"},"version":{"kind":"string","value":"1.4"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .[dev]\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"requirements.txt\",\n \"pip_packages\": [\n \"pytest pytest-cov\",\n \"pytest\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\n \"python\": \"3.7\",\n \"reqs_path\": [\n \"requirements.txt\"\n ],\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"certifi @ file:///croot/certifi_1671487769961/work/certifi\ncoverage==7.2.7\n-e git+https://github.com/docker/docker-py.git@f479720d517a7db7f886916190b3032d29d18f10#egg=docker_py\nexceptiongroup==1.2.2\nimportlib-metadata==6.7.0\niniconfig==2.0.0\npackaging==24.0\npluggy==1.2.0\npytest==7.4.4\npytest-cov==4.1.0\nrequests==2.5.3\nsix==1.17.0\ntomli==2.0.1\ntyping_extensions==4.7.1\nwebsocket-client==0.32.0\nzipp==3.15.0\n"},"environment":{"kind":"string","value":"name: docker-py\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2022.12.7=py37h06a4308_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.4.4=h6a678d5_1\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - pip=22.3.1=py37h06a4308_0\n - python=3.7.16=h7a1cb2a_0\n - readline=8.2=h5eee18b_0\n - setuptools=65.6.3=py37h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - wheel=0.38.4=py37h06a4308_0\n - xz=5.6.4=h5eee18b_1\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - coverage==7.2.7\n - exceptiongroup==1.2.2\n - importlib-metadata==6.7.0\n - iniconfig==2.0.0\n - packaging==24.0\n - pluggy==1.2.0\n - pytest==7.4.4\n - pytest-cov==4.1.0\n - requests==2.5.3\n - six==1.17.0\n - tomli==2.0.1\n - typing-extensions==4.7.1\n - websocket-client==0.32.0\n - zipp==3.15.0\nprefix: /opt/conda/envs/docker-py\n"},"FAIL_TO_PASS":{"kind":"list like","value":["tests/utils_test.py::UtilsTest::test_803_urlsafe_encode"],"string":"[\n \"tests/utils_test.py::UtilsTest::test_803_urlsafe_encode\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["tests/utils_test.py::HostConfigTest::test_create_host_config_invalid_cpu_cfs_types","tests/utils_test.py::HostConfigTest::test_create_host_config_no_options","tests/utils_test.py::HostConfigTest::test_create_host_config_no_options_newer_api_version","tests/utils_test.py::HostConfigTest::test_create_host_config_with_cpu_period","tests/utils_test.py::HostConfigTest::test_create_host_config_with_cpu_quota","tests/utils_test.py::UlimitTest::test_create_host_config_dict_ulimit","tests/utils_test.py::UlimitTest::test_create_host_config_dict_ulimit_capitals","tests/utils_test.py::UlimitTest::test_create_host_config_obj_ulimit","tests/utils_test.py::UlimitTest::test_ulimit_invalid_type","tests/utils_test.py::LogConfigTest::test_create_host_config_dict_logconfig","tests/utils_test.py::LogConfigTest::test_create_host_config_obj_logconfig","tests/utils_test.py::LogConfigTest::test_logconfig_invalid_config_type","tests/utils_test.py::KwargsFromEnvTest::test_kwargs_from_env_empty","tests/utils_test.py::KwargsFromEnvTest::test_kwargs_from_env_no_cert_path","tests/utils_test.py::KwargsFromEnvTest::test_kwargs_from_env_tls","tests/utils_test.py::UtilsTest::test_convert_filters","tests/utils_test.py::UtilsTest::test_convert_volume_binds_compact","tests/utils_test.py::UtilsTest::test_convert_volume_binds_complete","tests/utils_test.py::UtilsTest::test_convert_volume_binds_empty","tests/utils_test.py::UtilsTest::test_convert_volume_binds_list","tests/utils_test.py::UtilsTest::test_convert_volume_binds_no_mode","tests/utils_test.py::UtilsTest::test_convert_volume_binds_unicode_bytes_input","tests/utils_test.py::UtilsTest::test_convert_volume_binds_unicode_unicode_input","tests/utils_test.py::UtilsTest::test_decode_json_header","tests/utils_test.py::UtilsTest::test_parse_bytes","tests/utils_test.py::UtilsTest::test_parse_env_file_commented_line","tests/utils_test.py::UtilsTest::test_parse_env_file_invalid_line","tests/utils_test.py::UtilsTest::test_parse_env_file_proper","tests/utils_test.py::UtilsTest::test_parse_host","tests/utils_test.py::UtilsTest::test_parse_host_empty_value","tests/utils_test.py::UtilsTest::test_parse_repository_tag","tests/utils_test.py::UtilsTest::test_resolve_authconfig","tests/utils_test.py::UtilsTest::test_resolve_registry_and_auth","tests/utils_test.py::UtilsTest::test_resolve_repository_name","tests/utils_test.py::PortsTest::test_build_port_bindings_with_matching_internal_port_ranges","tests/utils_test.py::PortsTest::test_build_port_bindings_with_matching_internal_ports","tests/utils_test.py::PortsTest::test_build_port_bindings_with_nonmatching_internal_port_ranges","tests/utils_test.py::PortsTest::test_build_port_bindings_with_nonmatching_internal_ports","tests/utils_test.py::PortsTest::test_build_port_bindings_with_one_port","tests/utils_test.py::PortsTest::test_build_port_bindings_with_port_range","tests/utils_test.py::PortsTest::test_host_only_with_colon","tests/utils_test.py::PortsTest::test_non_matching_length_port_ranges","tests/utils_test.py::PortsTest::test_port_and_range_invalid","tests/utils_test.py::PortsTest::test_port_only_with_colon","tests/utils_test.py::PortsTest::test_split_port_invalid","tests/utils_test.py::PortsTest::test_split_port_no_host_port","tests/utils_test.py::PortsTest::test_split_port_range_no_host_port","tests/utils_test.py::PortsTest::test_split_port_range_with_host_ip_no_port","tests/utils_test.py::PortsTest::test_split_port_range_with_host_port","tests/utils_test.py::PortsTest::test_split_port_range_with_protocol","tests/utils_test.py::PortsTest::test_split_port_with_host_ip","tests/utils_test.py::PortsTest::test_split_port_with_host_ip_no_port","tests/utils_test.py::PortsTest::test_split_port_with_host_port","tests/utils_test.py::PortsTest::test_split_port_with_protocol","tests/utils_test.py::ExcludePathsTest::test_directory","tests/utils_test.py::ExcludePathsTest::test_directory_with_single_exception","tests/utils_test.py::ExcludePathsTest::test_directory_with_subdir_exception","tests/utils_test.py::ExcludePathsTest::test_directory_with_trailing_slash","tests/utils_test.py::ExcludePathsTest::test_directory_with_wildcard_exception","tests/utils_test.py::ExcludePathsTest::test_exclude_custom_dockerfile","tests/utils_test.py::ExcludePathsTest::test_exclude_dockerfile_dockerignore","tests/utils_test.py::ExcludePathsTest::test_no_dupes","tests/utils_test.py::ExcludePathsTest::test_no_excludes","tests/utils_test.py::ExcludePathsTest::test_question_mark","tests/utils_test.py::ExcludePathsTest::test_single_filename","tests/utils_test.py::ExcludePathsTest::test_single_filename_trailing_slash","tests/utils_test.py::ExcludePathsTest::test_single_subdir_single_filename","tests/utils_test.py::ExcludePathsTest::test_single_subdir_wildcard_filename","tests/utils_test.py::ExcludePathsTest::test_subdirectory","tests/utils_test.py::ExcludePathsTest::test_wildcard_exclude","tests/utils_test.py::ExcludePathsTest::test_wildcard_filename_end","tests/utils_test.py::ExcludePathsTest::test_wildcard_filename_start","tests/utils_test.py::ExcludePathsTest::test_wildcard_subdir_single_filename","tests/utils_test.py::ExcludePathsTest::test_wildcard_subdir_wildcard_filename","tests/utils_test.py::ExcludePathsTest::test_wildcard_with_exception","tests/utils_test.py::ExcludePathsTest::test_wildcard_with_wildcard_exception"],"string":"[\n \"tests/utils_test.py::HostConfigTest::test_create_host_config_invalid_cpu_cfs_types\",\n \"tests/utils_test.py::HostConfigTest::test_create_host_config_no_options\",\n \"tests/utils_test.py::HostConfigTest::test_create_host_config_no_options_newer_api_version\",\n \"tests/utils_test.py::HostConfigTest::test_create_host_config_with_cpu_period\",\n \"tests/utils_test.py::HostConfigTest::test_create_host_config_with_cpu_quota\",\n \"tests/utils_test.py::UlimitTest::test_create_host_config_dict_ulimit\",\n \"tests/utils_test.py::UlimitTest::test_create_host_config_dict_ulimit_capitals\",\n \"tests/utils_test.py::UlimitTest::test_create_host_config_obj_ulimit\",\n \"tests/utils_test.py::UlimitTest::test_ulimit_invalid_type\",\n \"tests/utils_test.py::LogConfigTest::test_create_host_config_dict_logconfig\",\n \"tests/utils_test.py::LogConfigTest::test_create_host_config_obj_logconfig\",\n \"tests/utils_test.py::LogConfigTest::test_logconfig_invalid_config_type\",\n \"tests/utils_test.py::KwargsFromEnvTest::test_kwargs_from_env_empty\",\n \"tests/utils_test.py::KwargsFromEnvTest::test_kwargs_from_env_no_cert_path\",\n \"tests/utils_test.py::KwargsFromEnvTest::test_kwargs_from_env_tls\",\n \"tests/utils_test.py::UtilsTest::test_convert_filters\",\n \"tests/utils_test.py::UtilsTest::test_convert_volume_binds_compact\",\n \"tests/utils_test.py::UtilsTest::test_convert_volume_binds_complete\",\n \"tests/utils_test.py::UtilsTest::test_convert_volume_binds_empty\",\n \"tests/utils_test.py::UtilsTest::test_convert_volume_binds_list\",\n \"tests/utils_test.py::UtilsTest::test_convert_volume_binds_no_mode\",\n \"tests/utils_test.py::UtilsTest::test_convert_volume_binds_unicode_bytes_input\",\n \"tests/utils_test.py::UtilsTest::test_convert_volume_binds_unicode_unicode_input\",\n \"tests/utils_test.py::UtilsTest::test_decode_json_header\",\n \"tests/utils_test.py::UtilsTest::test_parse_bytes\",\n \"tests/utils_test.py::UtilsTest::test_parse_env_file_commented_line\",\n \"tests/utils_test.py::UtilsTest::test_parse_env_file_invalid_line\",\n \"tests/utils_test.py::UtilsTest::test_parse_env_file_proper\",\n \"tests/utils_test.py::UtilsTest::test_parse_host\",\n \"tests/utils_test.py::UtilsTest::test_parse_host_empty_value\",\n \"tests/utils_test.py::UtilsTest::test_parse_repository_tag\",\n \"tests/utils_test.py::UtilsTest::test_resolve_authconfig\",\n \"tests/utils_test.py::UtilsTest::test_resolve_registry_and_auth\",\n \"tests/utils_test.py::UtilsTest::test_resolve_repository_name\",\n \"tests/utils_test.py::PortsTest::test_build_port_bindings_with_matching_internal_port_ranges\",\n \"tests/utils_test.py::PortsTest::test_build_port_bindings_with_matching_internal_ports\",\n \"tests/utils_test.py::PortsTest::test_build_port_bindings_with_nonmatching_internal_port_ranges\",\n \"tests/utils_test.py::PortsTest::test_build_port_bindings_with_nonmatching_internal_ports\",\n \"tests/utils_test.py::PortsTest::test_build_port_bindings_with_one_port\",\n \"tests/utils_test.py::PortsTest::test_build_port_bindings_with_port_range\",\n \"tests/utils_test.py::PortsTest::test_host_only_with_colon\",\n \"tests/utils_test.py::PortsTest::test_non_matching_length_port_ranges\",\n \"tests/utils_test.py::PortsTest::test_port_and_range_invalid\",\n \"tests/utils_test.py::PortsTest::test_port_only_with_colon\",\n \"tests/utils_test.py::PortsTest::test_split_port_invalid\",\n \"tests/utils_test.py::PortsTest::test_split_port_no_host_port\",\n \"tests/utils_test.py::PortsTest::test_split_port_range_no_host_port\",\n \"tests/utils_test.py::PortsTest::test_split_port_range_with_host_ip_no_port\",\n \"tests/utils_test.py::PortsTest::test_split_port_range_with_host_port\",\n \"tests/utils_test.py::PortsTest::test_split_port_range_with_protocol\",\n \"tests/utils_test.py::PortsTest::test_split_port_with_host_ip\",\n \"tests/utils_test.py::PortsTest::test_split_port_with_host_ip_no_port\",\n \"tests/utils_test.py::PortsTest::test_split_port_with_host_port\",\n \"tests/utils_test.py::PortsTest::test_split_port_with_protocol\",\n \"tests/utils_test.py::ExcludePathsTest::test_directory\",\n \"tests/utils_test.py::ExcludePathsTest::test_directory_with_single_exception\",\n \"tests/utils_test.py::ExcludePathsTest::test_directory_with_subdir_exception\",\n \"tests/utils_test.py::ExcludePathsTest::test_directory_with_trailing_slash\",\n \"tests/utils_test.py::ExcludePathsTest::test_directory_with_wildcard_exception\",\n \"tests/utils_test.py::ExcludePathsTest::test_exclude_custom_dockerfile\",\n \"tests/utils_test.py::ExcludePathsTest::test_exclude_dockerfile_dockerignore\",\n \"tests/utils_test.py::ExcludePathsTest::test_no_dupes\",\n \"tests/utils_test.py::ExcludePathsTest::test_no_excludes\",\n \"tests/utils_test.py::ExcludePathsTest::test_question_mark\",\n \"tests/utils_test.py::ExcludePathsTest::test_single_filename\",\n \"tests/utils_test.py::ExcludePathsTest::test_single_filename_trailing_slash\",\n \"tests/utils_test.py::ExcludePathsTest::test_single_subdir_single_filename\",\n \"tests/utils_test.py::ExcludePathsTest::test_single_subdir_wildcard_filename\",\n \"tests/utils_test.py::ExcludePathsTest::test_subdirectory\",\n \"tests/utils_test.py::ExcludePathsTest::test_wildcard_exclude\",\n \"tests/utils_test.py::ExcludePathsTest::test_wildcard_filename_end\",\n \"tests/utils_test.py::ExcludePathsTest::test_wildcard_filename_start\",\n \"tests/utils_test.py::ExcludePathsTest::test_wildcard_subdir_single_filename\",\n \"tests/utils_test.py::ExcludePathsTest::test_wildcard_subdir_wildcard_filename\",\n \"tests/utils_test.py::ExcludePathsTest::test_wildcard_with_exception\",\n \"tests/utils_test.py::ExcludePathsTest::test_wildcard_with_wildcard_exception\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"Apache License 2.0"},"__index_level_0__":{"kind":"number","value":264,"string":"264"}}},{"rowIdx":265,"cells":{"instance_id":{"kind":"string","value":"vortec__versionbump-6"},"base_commit":{"kind":"string","value":"1b62d24471870d220f1f05ee1421a688f51d4923"},"created_at":{"kind":"string","value":"2015-10-10 14:43:31"},"environment_setup_commit":{"kind":"string","value":"1b62d24471870d220f1f05ee1421a688f51d4923"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/.travis.yml b/.travis.yml\nindex 2ab01b1..b7ed065 100644\n--- a/.travis.yml\n+++ b/.travis.yml\n@@ -3,13 +3,9 @@ python:\n - 2.7\n - 3.4\n - pypy\n-before_install:\n- - pip install codecov\n install:\n - pip install .\n - pip install behave dont-fudge-up\n script:\n - py.test -v tests\n - behave tests/features\n-after_success:\n- - codecov\ndiff --git a/versionbump/filebump.py b/versionbump/filebump.py\nindex 65713cb..98d29f9 100644\n--- a/versionbump/filebump.py\n+++ b/versionbump/filebump.py\n@@ -32,6 +32,7 @@ class FileBump(object):\n def write_cache_to_file(self):\n self.fo.seek(0)\n self.fo.write(self.file_cache)\n+ self.fo.truncate()\n \n def replace_version_in_cache(self, old_version, new_version):\n self.file_cache = self.file_cache.replace(old_version, new_version)\n"},"problem_statement":{"kind":"string","value":"FileBump does not correctly adjust the target file size\nWhen adjusting the version in a file, the file size is not correctly adjusted.\r\n\r\nFor example:\r\n\r\nFile contents before bump:\r\n```\r\n0.1.22222\r\n```\r\n\r\nCommand used:\r\n```\r\nversionbump -c 0.1.22222 minor version.txt\r\n```\r\n\r\nFile contents after bump:\r\n```\r\n0.2.0\r\n222\r\n```\r\n\r\nIdeally the file contents would be:\r\n```\r\n0.2.0\r\n```"},"repo":{"kind":"string","value":"vortec/versionbump"},"test_patch":{"kind":"string","value":"diff --git a/tests/unit/test_filebump.py b/tests/unit/test_filebump.py\nindex 7bddb5f..12bc26f 100644\n--- a/tests/unit/test_filebump.py\n+++ b/tests/unit/test_filebump.py\n@@ -51,3 +51,12 @@ def test_it_doesnt_find_the_version():\n empty_fo = StringIO('')\n with pytest.raises(ValueError):\n FileBump(empty_fo, '1.2.3')\n+\n+\n+def test_it_truncates_the_file():\n+ version = '0.0.111'\n+ fo = StringIO(version)\n+ fb = FileBump(fo, version)\n+ fb.bump('minor')\n+ fo.seek(0)\n+ assert fo.read() == '0.1.0'\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_many_modified_files\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 0,\n \"issue_text_score\": 1,\n \"test_score\": 1\n },\n \"num_modified_files\": 2\n}"},"version":{"kind":"string","value":"unknown"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"pytest\",\n \"pip_packages\": [\n \"behave\",\n \"pytest\",\n \"codecov\"\n ],\n \"pre_install\": null,\n \"python\": \"3.4\",\n \"reqs_path\": null,\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work\nbehave==1.2.6\ncertifi==2021.5.30\ncharset-normalizer==2.0.12\ncodecov==2.1.13\ncoverage==6.2\nidna==3.10\nimportlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1631916693255/work\niniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work\nmore-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work\npackaging @ file:///tmp/build/80754af9/packaging_1637314298585/work\nparse==1.20.2\nparse_type==0.6.4\npluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work\npy @ file:///opt/conda/conda-bld/py_1644396412707/work\npyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work\npytest==6.2.4\nrequests==2.27.1\nsix==1.17.0\ntoml @ file:///tmp/build/80754af9/toml_1616166611790/work\ntyping_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work\nurllib3==1.26.20\n-e git+https://github.com/vortec/versionbump.git@1b62d24471870d220f1f05ee1421a688f51d4923#egg=versionbump\nzipp @ file:///tmp/build/80754af9/zipp_1633618647012/work\n"},"environment":{"kind":"string","value":"name: versionbump\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - attrs=21.4.0=pyhd3eb1b0_0\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2021.5.30=py36h06a4308_0\n - importlib-metadata=4.8.1=py36h06a4308_0\n - importlib_metadata=4.8.1=hd3eb1b0_0\n - iniconfig=1.1.1=pyhd3eb1b0_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.3=he6710b0_2\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - more-itertools=8.12.0=pyhd3eb1b0_0\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - packaging=21.3=pyhd3eb1b0_0\n - pip=21.2.2=py36h06a4308_0\n - pluggy=0.13.1=py36h06a4308_0\n - py=1.11.0=pyhd3eb1b0_0\n - pyparsing=3.0.4=pyhd3eb1b0_0\n - pytest=6.2.4=py36h06a4308_2\n - python=3.6.13=h12debd9_1\n - readline=8.2=h5eee18b_0\n - setuptools=58.0.4=py36h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - toml=0.10.2=pyhd3eb1b0_0\n - typing_extensions=4.1.1=pyh06a4308_0\n - wheel=0.37.1=pyhd3eb1b0_0\n - xz=5.6.4=h5eee18b_1\n - zipp=3.6.0=pyhd3eb1b0_0\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - behave==1.2.6\n - charset-normalizer==2.0.12\n - codecov==2.1.13\n - coverage==6.2\n - idna==3.10\n - parse==1.20.2\n - parse-type==0.6.4\n - requests==2.27.1\n - six==1.17.0\n - urllib3==1.26.20\nprefix: /opt/conda/envs/versionbump\n"},"FAIL_TO_PASS":{"kind":"list like","value":["tests/unit/test_filebump.py::test_it_truncates_the_file"],"string":"[\n \"tests/unit/test_filebump.py::test_it_truncates_the_file\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["tests/unit/test_filebump.py::test_file_gets_parsed_correctly","tests/unit/test_filebump.py::test_file_cache","tests/unit/test_filebump.py::test_bump","tests/unit/test_filebump.py::test_cache_write_to_file","tests/unit/test_filebump.py::test_print_output","tests/unit/test_filebump.py::test_it_doesnt_find_the_version"],"string":"[\n \"tests/unit/test_filebump.py::test_file_gets_parsed_correctly\",\n \"tests/unit/test_filebump.py::test_file_cache\",\n \"tests/unit/test_filebump.py::test_bump\",\n \"tests/unit/test_filebump.py::test_cache_write_to_file\",\n \"tests/unit/test_filebump.py::test_print_output\",\n \"tests/unit/test_filebump.py::test_it_doesnt_find_the_version\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"MIT License"},"__index_level_0__":{"kind":"number","value":265,"string":"265"}}},{"rowIdx":266,"cells":{"instance_id":{"kind":"string","value":"marshmallow-code__marshmallow-299"},"base_commit":{"kind":"string","value":"1dbcae9c439d1a268717feb089351fc3c5180ac3"},"created_at":{"kind":"string","value":"2015-10-14 03:40:58"},"environment_setup_commit":{"kind":"string","value":"1dbcae9c439d1a268717feb089351fc3c5180ac3"},"hints_text":{"kind":"string","value":"nelfin: Not really sure what's happened, all the Travis builds on Python 3.x failed with:\r\n```pytb\r\nTraceback (most recent call last):\r\n File \"setup.py\", line 81, in \r\n cmdclass={'test': PyTest},\r\n File \"/opt/python/3.3.5/lib/python3.3/distutils/core.py\", line 148, in setup\r\n dist.run_commands()\r\n File \"/opt/python/3.3.5/lib/python3.3/distutils/dist.py\", line 930, in run_commands\r\n self.run_command(cmd)\r\n File \"/opt/python/3.3.5/lib/python3.3/distutils/dist.py\", line 948, in run_command\r\n cmd_obj.ensure_finalized()\r\n File \"/opt/python/3.3.5/lib/python3.3/distutils/cmd.py\", line 107, in ensure_finalized\r\n self.finalize_options()\r\n File \"setup.py\", line 15, in finalize_options\r\n self.test_args = ['--verbose', 'tests/']\r\nAttributeError: can't set attribute\r\n```\r\nbut `tox -e py34` works fine for me. :confused:\nnelfin: Looks like this is being bitten by https://bitbucket.org/pypa/setuptools/commits/cf565b66b855dd4df189b679206f9fb113681737:\r\n```diff\r\ndiff --git a/setuptools/command/test.py b/setuptools/command/test.py\r\n--- a/setuptools/command/test.py\r\n+++ b/setuptools/command/test.py\r\n@@ -72,10 +72,6 @@\r\n \"You may specify a module or a suite, but not both\"\r\n )\r\n \r\n- self.test_args = [self.test_suite]\r\n-\r\n- if self.verbose:\r\n- self.test_args.insert(0, '--verbose')\r\n if self.test_loader is None:\r\n self.test_loader = getattr(self.distribution, 'test_loader', None)\r\n if self.test_loader is None:\r\n@@ -83,6 +79,11 @@\r\n if self.test_runner is None:\r\n self.test_runner = getattr(self.distribution, 'test_runner', None)\r\n \r\n+ @property\r\n+ def test_args(self):\r\n+ verbose = ['--verbose'] if self.verbose else []\r\n+ return verbose + [self.test_suite]\r\n+\r\n def with_project_on_sys_path(self, func):\r\n with_2to3 = PY3 and getattr(self.distribution, 'use_2to3', False)\r\n```\nnelfin: Depends on #301 \nsloria: Thanks for this patch. I will looks into this more closely tomorrow.\r\n\r\nUpdating to the latest 2.1-line branch should fix the builds."},"patch":{"kind":"string","value":"diff --git a/marshmallow/marshalling.py b/marshmallow/marshalling.py\nindex 5caca583..7961f087 100644\n--- a/marshmallow/marshalling.py\n+++ b/marshmallow/marshalling.py\n@@ -21,6 +21,8 @@ __all__ = [\n 'Unmarshaller',\n ]\n \n+# Key used for field-level validation errors on nested fields\n+FIELD = '_field'\n \n class ErrorStore(object):\n \n@@ -68,6 +70,8 @@ class ErrorStore(object):\n # Warning: Mutation!\n if isinstance(err.messages, dict):\n errors[field_name] = err.messages\n+ elif isinstance(errors.get(field_name), dict):\n+ errors[field_name].setdefault(FIELD, []).extend(err.messages)\n else:\n errors.setdefault(field_name, []).extend(err.messages)\n # When a Nested field fails validation, the marshalled data is stored\n"},"problem_statement":{"kind":"string","value":"Field-level validation errors cannot be saved on a nested field with many=True\nWhen validating a field, all of its error messages are saved and appended to the list of messages for that field name in `call_and_store`, but for `fields.Nested` with `many=True` the error messages for child elements of the collection are saved and stored in a dictionary keyed by the element index. This causes the following exception on this minimal test case:\r\n```python\r\nclass Inner(Schema):\r\n req = fields.Field(required=True)\r\n\r\nclass Outer(Schema):\r\n inner = fields.Nested(Inner, many=True)\r\n\r\n @validates('inner')\r\n def validates_inner(self, data):\r\n raise ValidationError('not a chance')\r\n\r\nouter = Outer()\r\n_, errors = outer.load({'inner': [{}]})\r\n```\r\n```pytb\r\nTraceback (most recent call last):\r\n File \"/home/andrew/misc/marshmallow/tests/test_schema.py\", line 1238, in test_all_errors_on_many_nested_field_with_validates_decorator\r\n _, errors = outer.load({'inner': [{}]})\r\n File \"/home/andrew/misc/marshmallow/marshmallow/schema.py\", line 539, in load\r\n result, errors = self._do_load(data, many, partial=partial, postprocess=True)\r\n File \"/home/andrew/misc/marshmallow/marshmallow/schema.py\", line 610, in _do_load\r\n self._invoke_field_validators(data=result, many=many)\r\n File \"/home/andrew/misc/marshmallow/marshmallow/schema.py\", line 789, in _invoke_field_validators\r\n field_obj=field_obj\r\n File \"/home/andrew/misc/marshmallow/marshmallow/marshalling.py\", line 74, in call_and_store\r\n errors.setdefault(field_name, []).extend(err.messages)\r\nAttributeError: 'dict' object has no attribute 'extend'\r\n```"},"repo":{"kind":"string","value":"marshmallow-code/marshmallow"},"test_patch":{"kind":"string","value":"diff --git a/tests/test_schema.py b/tests/test_schema.py\nindex 81d5d0fb..a18c7787 100644\n--- a/tests/test_schema.py\n+++ b/tests/test_schema.py\n@@ -1222,6 +1222,23 @@ class TestNestedSchema:\n _, errors = schema.load({'inner': 1})\n assert errors['inner']['_schema'] == ['Invalid input type.']\n \n+ # regression test for https://github.com/marshmallow-code/marshmallow/issues/298\n+ def test_all_errors_on_many_nested_field_with_validates_decorator(self):\n+ class Inner(Schema):\n+ req = fields.Field(required=True)\n+\n+ class Outer(Schema):\n+ inner = fields.Nested(Inner, many=True)\n+\n+ @validates('inner')\n+ def validates_inner(self, data):\n+ raise ValidationError('not a chance')\n+\n+ outer = Outer()\n+ _, errors = outer.load({'inner': [{}]})\n+ assert 'inner' in errors\n+ assert '_field' in errors['inner']\n+\n def test_missing_required_nested_field(self):\n class Inner(Schema):\n inner_req = fields.Field(required=True, error_messages={'required': 'Oops'})\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [],\n \"has_test_patch\": true,\n \"is_lite\": true,\n \"llm_score\": {\n \"difficulty_score\": 0,\n \"issue_text_score\": 1,\n \"test_score\": 1\n },\n \"num_modified_files\": 1\n}"},"version":{"kind":"string","value":"2.1"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .[dev]\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"requirements.txt\",\n \"pip_packages\": [\n \"pytest\",\n \"pytest-cov\",\n \"pytest-xdist\",\n \"pytest-mock\",\n \"pytest-asyncio\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\n \"python\": \"3.9\",\n \"reqs_path\": [\n \"dev-requirements.txt\"\n ],\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"backports.tarfile==1.2.0\ncachetools==5.5.2\ncertifi==2025.1.31\ncffi==1.17.1\nchardet==5.2.0\ncharset-normalizer==3.4.1\ncolorama==0.4.6\ncoverage==7.8.0\ncryptography==44.0.2\ndistlib==0.3.9\ndocutils==0.21.2\nexceptiongroup==1.2.2\nexecnet==2.1.1\nfilelock==3.18.0\nflake8==2.4.1\nid==1.5.0\nidna==3.10\nimportlib_metadata==8.6.1\niniconfig==2.1.0\ninvoke==2.2.0\njaraco.classes==3.4.0\njaraco.context==6.0.1\njaraco.functools==4.1.0\njeepney==0.9.0\nkeyring==25.6.0\nmarkdown-it-py==3.0.0\n-e git+https://github.com/marshmallow-code/marshmallow.git@1dbcae9c439d1a268717feb089351fc3c5180ac3#egg=marshmallow\nmccabe==0.3.1\nmdurl==0.1.2\nmore-itertools==10.6.0\nnh3==0.2.21\npackaging==24.2\npep8==1.7.1\nplatformdirs==4.3.7\npluggy==1.5.0\npy==1.11.0\npycparser==2.22\npyflakes==0.8.1\nPygments==2.19.1\npyproject-api==1.9.0\npytest==8.3.5\npytest-asyncio==0.26.0\npytest-cov==6.0.0\npytest-mock==3.14.0\npytest-xdist==3.6.1\npython-dateutil==2.9.0.post0\npytz==2025.2\nreadme_renderer==44.0\nrequests==2.32.3\nrequests-toolbelt==1.0.0\nrfc3986==2.0.0\nrich==14.0.0\nSecretStorage==3.3.3\nsimplejson==3.20.1\nsix==1.17.0\ntomli==2.2.1\ntox==4.25.0\ntwine==6.1.0\ntyping_extensions==4.13.0\nurllib3==2.3.0\nvirtualenv==20.29.3\nzipp==3.21.0\n"},"environment":{"kind":"string","value":"name: marshmallow\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - ca-certificates=2025.2.25=h06a4308_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.4.4=h6a678d5_1\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=3.0.16=h5eee18b_0\n - pip=25.0=py39h06a4308_0\n - python=3.9.21=he870216_1\n - readline=8.2=h5eee18b_0\n - setuptools=75.8.0=py39h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - tzdata=2025a=h04d1e81_0\n - wheel=0.45.1=py39h06a4308_0\n - xz=5.6.4=h5eee18b_1\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - backports-tarfile==1.2.0\n - cachetools==5.5.2\n - certifi==2025.1.31\n - cffi==1.17.1\n - chardet==5.2.0\n - charset-normalizer==3.4.1\n - colorama==0.4.6\n - coverage==7.8.0\n - cryptography==44.0.2\n - distlib==0.3.9\n - docutils==0.21.2\n - exceptiongroup==1.2.2\n - execnet==2.1.1\n - filelock==3.18.0\n - flake8==2.4.1\n - id==1.5.0\n - idna==3.10\n - importlib-metadata==8.6.1\n - iniconfig==2.1.0\n - invoke==2.2.0\n - jaraco-classes==3.4.0\n - jaraco-context==6.0.1\n - jaraco-functools==4.1.0\n - jeepney==0.9.0\n - keyring==25.6.0\n - markdown-it-py==3.0.0\n - mccabe==0.3.1\n - mdurl==0.1.2\n - more-itertools==10.6.0\n - nh3==0.2.21\n - packaging==24.2\n - pep8==1.7.1\n - platformdirs==4.3.7\n - pluggy==1.5.0\n - py==1.11.0\n - pycparser==2.22\n - pyflakes==0.8.1\n - pygments==2.19.1\n - pyproject-api==1.9.0\n - pytest==8.3.5\n - pytest-asyncio==0.26.0\n - pytest-cov==6.0.0\n - pytest-mock==3.14.0\n - pytest-xdist==3.6.1\n - python-dateutil==2.9.0.post0\n - pytz==2025.2\n - readme-renderer==44.0\n - requests==2.32.3\n - requests-toolbelt==1.0.0\n - rfc3986==2.0.0\n - rich==14.0.0\n - secretstorage==3.3.3\n - simplejson==3.20.1\n - six==1.17.0\n - tomli==2.2.1\n - tox==4.25.0\n - twine==6.1.0\n - typing-extensions==4.13.0\n - urllib3==2.3.0\n - virtualenv==20.29.3\n - zipp==3.21.0\nprefix: /opt/conda/envs/marshmallow\n"},"FAIL_TO_PASS":{"kind":"list like","value":["tests/test_schema.py::TestNestedSchema::test_all_errors_on_many_nested_field_with_validates_decorator"],"string":"[\n \"tests/test_schema.py::TestNestedSchema::test_all_errors_on_many_nested_field_with_validates_decorator\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["tests/test_schema.py::test_serializing_basic_object[UserSchema]","tests/test_schema.py::test_serializing_basic_object[UserMetaSchema]","tests/test_schema.py::test_serializer_dump","tests/test_schema.py::test_dump_returns_dict_of_errors","tests/test_schema.py::test_dump_with_strict_mode_raises_error[UserSchema]","tests/test_schema.py::test_dump_with_strict_mode_raises_error[UserMetaSchema]","tests/test_schema.py::test_dump_resets_errors","tests/test_schema.py::test_load_resets_errors","tests/test_schema.py::test_dump_resets_error_fields","tests/test_schema.py::test_load_resets_error_fields","tests/test_schema.py::test_errored_fields_do_not_appear_in_output","tests/test_schema.py::test_load_many_stores_error_indices","tests/test_schema.py::test_dump_many","tests/test_schema.py::test_multiple_errors_can_be_stored_for_a_given_index","tests/test_schema.py::test_dump_many_stores_error_indices","tests/test_schema.py::test_dump_many_doesnt_stores_error_indices_when_index_errors_is_false","tests/test_schema.py::test_dump_returns_a_marshalresult","tests/test_schema.py::test_dumps_returns_a_marshalresult","tests/test_schema.py::test_dumping_single_object_with_collection_schema","tests/test_schema.py::test_loading_single_object_with_collection_schema","tests/test_schema.py::test_dumps_many","tests/test_schema.py::test_load_returns_an_unmarshalresult","tests/test_schema.py::test_load_many","tests/test_schema.py::test_loads_returns_an_unmarshalresult","tests/test_schema.py::test_loads_many","tests/test_schema.py::test_loads_deserializes_from_json","tests/test_schema.py::test_serializing_none","tests/test_schema.py::test_default_many_symmetry","tests/test_schema.py::test_on_bind_field_hook","tests/test_schema.py::TestValidate::test_validate_returns_errors_dict","tests/test_schema.py::TestValidate::test_validate_many","tests/test_schema.py::TestValidate::test_validate_many_doesnt_store_index_if_index_errors_option_is_false","tests/test_schema.py::TestValidate::test_validate_strict","tests/test_schema.py::TestValidate::test_validate_required","tests/test_schema.py::test_fields_are_not_copies[UserSchema]","tests/test_schema.py::test_fields_are_not_copies[UserMetaSchema]","tests/test_schema.py::test_dumps_returns_json","tests/test_schema.py::test_naive_datetime_field","tests/test_schema.py::test_datetime_formatted_field","tests/test_schema.py::test_datetime_iso_field","tests/test_schema.py::test_tz_datetime_field","tests/test_schema.py::test_local_datetime_field","tests/test_schema.py::test_class_variable","tests/test_schema.py::test_serialize_many[UserSchema]","tests/test_schema.py::test_serialize_many[UserMetaSchema]","tests/test_schema.py::test_inheriting_schema","tests/test_schema.py::test_custom_field","tests/test_schema.py::test_url_field","tests/test_schema.py::test_relative_url_field","tests/test_schema.py::test_stores_invalid_url_error[UserSchema]","tests/test_schema.py::test_stores_invalid_url_error[UserMetaSchema]","tests/test_schema.py::test_email_field[UserSchema]","tests/test_schema.py::test_email_field[UserMetaSchema]","tests/test_schema.py::test_stored_invalid_email","tests/test_schema.py::test_integer_field","tests/test_schema.py::test_as_string","tests/test_schema.py::test_extra","tests/test_schema.py::test_extra_many","tests/test_schema.py::test_method_field[UserSchema]","tests/test_schema.py::test_method_field[UserMetaSchema]","tests/test_schema.py::test_function_field","tests/test_schema.py::test_prefix[UserSchema]","tests/test_schema.py::test_prefix[UserMetaSchema]","tests/test_schema.py::test_fields_must_be_declared_as_instances","tests/test_schema.py::test_serializing_generator[UserSchema]","tests/test_schema.py::test_serializing_generator[UserMetaSchema]","tests/test_schema.py::test_serializing_empty_list_returns_empty_list","tests/test_schema.py::test_serializing_dict","tests/test_schema.py::test_serializing_dict_with_meta_fields","tests/test_schema.py::test_exclude_in_init[UserSchema]","tests/test_schema.py::test_exclude_in_init[UserMetaSchema]","tests/test_schema.py::test_only_in_init[UserSchema]","tests/test_schema.py::test_only_in_init[UserMetaSchema]","tests/test_schema.py::test_invalid_only_param","tests/test_schema.py::test_can_serialize_uuid","tests/test_schema.py::test_can_serialize_time","tests/test_schema.py::test_invalid_time","tests/test_schema.py::test_invalid_date","tests/test_schema.py::test_invalid_email","tests/test_schema.py::test_invalid_url","tests/test_schema.py::test_invalid_dict_but_okay","tests/test_schema.py::test_custom_json","tests/test_schema.py::test_custom_error_message","tests/test_schema.py::test_load_errors_with_many","tests/test_schema.py::test_error_raised_if_fields_option_is_not_list","tests/test_schema.py::test_error_raised_if_additional_option_is_not_list","tests/test_schema.py::test_only_and_exclude","tests/test_schema.py::test_exclude_invalid_attribute","tests/test_schema.py::test_only_with_invalid_attribute","tests/test_schema.py::test_only_bounded_by_fields","tests/test_schema.py::test_nested_only_and_exclude","tests/test_schema.py::test_nested_with_sets","tests/test_schema.py::test_meta_serializer_fields","tests/test_schema.py::test_meta_fields_mapping","tests/test_schema.py::test_meta_field_not_on_obj_raises_attribute_error","tests/test_schema.py::test_exclude_fields","tests/test_schema.py::test_fields_option_must_be_list_or_tuple","tests/test_schema.py::test_exclude_option_must_be_list_or_tuple","tests/test_schema.py::test_dateformat_option","tests/test_schema.py::test_default_dateformat","tests/test_schema.py::test_inherit_meta","tests/test_schema.py::test_inherit_meta_override","tests/test_schema.py::test_additional","tests/test_schema.py::test_cant_set_both_additional_and_fields","tests/test_schema.py::test_serializing_none_meta","tests/test_schema.py::TestErrorHandler::test_error_handler_decorator_is_deprecated","tests/test_schema.py::TestErrorHandler::test_dump_with_custom_error_handler","tests/test_schema.py::TestErrorHandler::test_load_with_custom_error_handler","tests/test_schema.py::TestErrorHandler::test_load_with_custom_error_handler_and_partially_valid_data","tests/test_schema.py::TestErrorHandler::test_custom_error_handler_with_validates_decorator","tests/test_schema.py::TestErrorHandler::test_custom_error_handler_with_validates_schema_decorator","tests/test_schema.py::TestErrorHandler::test_validate_with_custom_error_handler","tests/test_schema.py::TestFieldValidation::test_errors_are_cleared_after_loading_collection","tests/test_schema.py::TestFieldValidation::test_raises_error_with_list","tests/test_schema.py::TestFieldValidation::test_raises_error_with_dict","tests/test_schema.py::test_schema_repr","tests/test_schema.py::TestNestedSchema::test_flat_nested","tests/test_schema.py::TestNestedSchema::test_nested_many_with_missing_attribute","tests/test_schema.py::TestNestedSchema::test_nested_with_attribute_none","tests/test_schema.py::TestNestedSchema::test_flat_nested2","tests/test_schema.py::TestNestedSchema::test_nested_field_does_not_validate_required","tests/test_schema.py::TestNestedSchema::test_nested_none","tests/test_schema.py::TestNestedSchema::test_nested","tests/test_schema.py::TestNestedSchema::test_nested_many_fields","tests/test_schema.py::TestNestedSchema::test_nested_meta_many","tests/test_schema.py::TestNestedSchema::test_nested_only","tests/test_schema.py::TestNestedSchema::test_exclude","tests/test_schema.py::TestNestedSchema::test_list_field","tests/test_schema.py::TestNestedSchema::test_nested_load_many","tests/test_schema.py::TestNestedSchema::test_nested_errors","tests/test_schema.py::TestNestedSchema::test_nested_strict","tests/test_schema.py::TestNestedSchema::test_nested_method_field","tests/test_schema.py::TestNestedSchema::test_nested_function_field","tests/test_schema.py::TestNestedSchema::test_nested_prefixed_field","tests/test_schema.py::TestNestedSchema::test_nested_prefixed_many_field","tests/test_schema.py::TestNestedSchema::test_invalid_float_field","tests/test_schema.py::TestNestedSchema::test_serializer_meta_with_nested_fields","tests/test_schema.py::TestNestedSchema::test_serializer_with_nested_meta_fields","tests/test_schema.py::TestNestedSchema::test_nested_fields_must_be_passed_a_serializer","tests/test_schema.py::TestNestedSchema::test_invalid_type_passed_to_nested_field","tests/test_schema.py::TestNestedSchema::test_missing_required_nested_field","tests/test_schema.py::TestSelfReference::test_nesting_schema_within_itself","tests/test_schema.py::TestSelfReference::test_nesting_schema_by_passing_class_name","tests/test_schema.py::TestSelfReference::test_nesting_within_itself_meta","tests/test_schema.py::TestSelfReference::test_recursive_missing_required_field","tests/test_schema.py::TestSelfReference::test_recursive_missing_required_field_one_level_in","tests/test_schema.py::TestSelfReference::test_nested_self_with_only_param","tests/test_schema.py::TestSelfReference::test_multiple_nested_self_fields","tests/test_schema.py::TestSelfReference::test_nested_many","tests/test_schema.py::test_serialization_with_required_field","tests/test_schema.py::test_deserialization_with_required_field","tests/test_schema.py::test_deserialization_with_required_field_and_custom_validator","tests/test_schema.py::TestContext::test_context_method","tests/test_schema.py::TestContext::test_context_method_function","tests/test_schema.py::TestContext::test_function_field_raises_error_when_context_not_available","tests/test_schema.py::TestContext::test_fields_context","tests/test_schema.py::TestContext::test_nested_fields_inherit_context","tests/test_schema.py::test_serializer_can_specify_nested_object_as_attribute","tests/test_schema.py::TestFieldInheritance::test_inherit_fields_from_schema_subclass","tests/test_schema.py::TestFieldInheritance::test_inherit_fields_from_non_schema_subclass","tests/test_schema.py::TestFieldInheritance::test_inheritance_follows_mro","tests/test_schema.py::TestAccessor::test_accessor_decorator_is_deprecated","tests/test_schema.py::TestAccessor::test_accessor_is_used","tests/test_schema.py::TestAccessor::test_accessor_with_many","tests/test_schema.py::TestRequiredFields::test_required_string_field_missing","tests/test_schema.py::TestRequiredFields::test_required_string_field_failure","tests/test_schema.py::TestRequiredFields::test_allow_none_param","tests/test_schema.py::TestRequiredFields::test_allow_none_custom_message","tests/test_schema.py::TestDefaults::test_missing_inputs_are_excluded_from_dump_output","tests/test_schema.py::TestDefaults::test_none_is_serialized_to_none","tests/test_schema.py::TestDefaults::test_default_and_value_missing","tests/test_schema.py::TestDefaults::test_loading_none","tests/test_schema.py::TestDefaults::test_missing_inputs_are_excluded_from_load_output","tests/test_schema.py::TestLoadOnly::test_load_only","tests/test_schema.py::TestLoadOnly::test_dump_only"],"string":"[\n \"tests/test_schema.py::test_serializing_basic_object[UserSchema]\",\n \"tests/test_schema.py::test_serializing_basic_object[UserMetaSchema]\",\n \"tests/test_schema.py::test_serializer_dump\",\n \"tests/test_schema.py::test_dump_returns_dict_of_errors\",\n \"tests/test_schema.py::test_dump_with_strict_mode_raises_error[UserSchema]\",\n \"tests/test_schema.py::test_dump_with_strict_mode_raises_error[UserMetaSchema]\",\n \"tests/test_schema.py::test_dump_resets_errors\",\n \"tests/test_schema.py::test_load_resets_errors\",\n \"tests/test_schema.py::test_dump_resets_error_fields\",\n \"tests/test_schema.py::test_load_resets_error_fields\",\n \"tests/test_schema.py::test_errored_fields_do_not_appear_in_output\",\n \"tests/test_schema.py::test_load_many_stores_error_indices\",\n \"tests/test_schema.py::test_dump_many\",\n \"tests/test_schema.py::test_multiple_errors_can_be_stored_for_a_given_index\",\n \"tests/test_schema.py::test_dump_many_stores_error_indices\",\n \"tests/test_schema.py::test_dump_many_doesnt_stores_error_indices_when_index_errors_is_false\",\n \"tests/test_schema.py::test_dump_returns_a_marshalresult\",\n \"tests/test_schema.py::test_dumps_returns_a_marshalresult\",\n \"tests/test_schema.py::test_dumping_single_object_with_collection_schema\",\n \"tests/test_schema.py::test_loading_single_object_with_collection_schema\",\n \"tests/test_schema.py::test_dumps_many\",\n \"tests/test_schema.py::test_load_returns_an_unmarshalresult\",\n \"tests/test_schema.py::test_load_many\",\n \"tests/test_schema.py::test_loads_returns_an_unmarshalresult\",\n \"tests/test_schema.py::test_loads_many\",\n \"tests/test_schema.py::test_loads_deserializes_from_json\",\n \"tests/test_schema.py::test_serializing_none\",\n \"tests/test_schema.py::test_default_many_symmetry\",\n \"tests/test_schema.py::test_on_bind_field_hook\",\n \"tests/test_schema.py::TestValidate::test_validate_returns_errors_dict\",\n \"tests/test_schema.py::TestValidate::test_validate_many\",\n \"tests/test_schema.py::TestValidate::test_validate_many_doesnt_store_index_if_index_errors_option_is_false\",\n \"tests/test_schema.py::TestValidate::test_validate_strict\",\n \"tests/test_schema.py::TestValidate::test_validate_required\",\n \"tests/test_schema.py::test_fields_are_not_copies[UserSchema]\",\n \"tests/test_schema.py::test_fields_are_not_copies[UserMetaSchema]\",\n \"tests/test_schema.py::test_dumps_returns_json\",\n \"tests/test_schema.py::test_naive_datetime_field\",\n \"tests/test_schema.py::test_datetime_formatted_field\",\n \"tests/test_schema.py::test_datetime_iso_field\",\n \"tests/test_schema.py::test_tz_datetime_field\",\n \"tests/test_schema.py::test_local_datetime_field\",\n \"tests/test_schema.py::test_class_variable\",\n \"tests/test_schema.py::test_serialize_many[UserSchema]\",\n \"tests/test_schema.py::test_serialize_many[UserMetaSchema]\",\n \"tests/test_schema.py::test_inheriting_schema\",\n \"tests/test_schema.py::test_custom_field\",\n \"tests/test_schema.py::test_url_field\",\n \"tests/test_schema.py::test_relative_url_field\",\n \"tests/test_schema.py::test_stores_invalid_url_error[UserSchema]\",\n \"tests/test_schema.py::test_stores_invalid_url_error[UserMetaSchema]\",\n \"tests/test_schema.py::test_email_field[UserSchema]\",\n \"tests/test_schema.py::test_email_field[UserMetaSchema]\",\n \"tests/test_schema.py::test_stored_invalid_email\",\n \"tests/test_schema.py::test_integer_field\",\n \"tests/test_schema.py::test_as_string\",\n \"tests/test_schema.py::test_extra\",\n \"tests/test_schema.py::test_extra_many\",\n \"tests/test_schema.py::test_method_field[UserSchema]\",\n \"tests/test_schema.py::test_method_field[UserMetaSchema]\",\n \"tests/test_schema.py::test_function_field\",\n \"tests/test_schema.py::test_prefix[UserSchema]\",\n \"tests/test_schema.py::test_prefix[UserMetaSchema]\",\n \"tests/test_schema.py::test_fields_must_be_declared_as_instances\",\n \"tests/test_schema.py::test_serializing_generator[UserSchema]\",\n \"tests/test_schema.py::test_serializing_generator[UserMetaSchema]\",\n \"tests/test_schema.py::test_serializing_empty_list_returns_empty_list\",\n \"tests/test_schema.py::test_serializing_dict\",\n \"tests/test_schema.py::test_serializing_dict_with_meta_fields\",\n \"tests/test_schema.py::test_exclude_in_init[UserSchema]\",\n \"tests/test_schema.py::test_exclude_in_init[UserMetaSchema]\",\n \"tests/test_schema.py::test_only_in_init[UserSchema]\",\n \"tests/test_schema.py::test_only_in_init[UserMetaSchema]\",\n \"tests/test_schema.py::test_invalid_only_param\",\n \"tests/test_schema.py::test_can_serialize_uuid\",\n \"tests/test_schema.py::test_can_serialize_time\",\n \"tests/test_schema.py::test_invalid_time\",\n \"tests/test_schema.py::test_invalid_date\",\n \"tests/test_schema.py::test_invalid_email\",\n \"tests/test_schema.py::test_invalid_url\",\n \"tests/test_schema.py::test_invalid_dict_but_okay\",\n \"tests/test_schema.py::test_custom_json\",\n \"tests/test_schema.py::test_custom_error_message\",\n \"tests/test_schema.py::test_load_errors_with_many\",\n \"tests/test_schema.py::test_error_raised_if_fields_option_is_not_list\",\n \"tests/test_schema.py::test_error_raised_if_additional_option_is_not_list\",\n \"tests/test_schema.py::test_only_and_exclude\",\n \"tests/test_schema.py::test_exclude_invalid_attribute\",\n \"tests/test_schema.py::test_only_with_invalid_attribute\",\n \"tests/test_schema.py::test_only_bounded_by_fields\",\n \"tests/test_schema.py::test_nested_only_and_exclude\",\n \"tests/test_schema.py::test_nested_with_sets\",\n \"tests/test_schema.py::test_meta_serializer_fields\",\n \"tests/test_schema.py::test_meta_fields_mapping\",\n \"tests/test_schema.py::test_meta_field_not_on_obj_raises_attribute_error\",\n \"tests/test_schema.py::test_exclude_fields\",\n \"tests/test_schema.py::test_fields_option_must_be_list_or_tuple\",\n \"tests/test_schema.py::test_exclude_option_must_be_list_or_tuple\",\n \"tests/test_schema.py::test_dateformat_option\",\n \"tests/test_schema.py::test_default_dateformat\",\n \"tests/test_schema.py::test_inherit_meta\",\n \"tests/test_schema.py::test_inherit_meta_override\",\n \"tests/test_schema.py::test_additional\",\n \"tests/test_schema.py::test_cant_set_both_additional_and_fields\",\n \"tests/test_schema.py::test_serializing_none_meta\",\n \"tests/test_schema.py::TestErrorHandler::test_error_handler_decorator_is_deprecated\",\n \"tests/test_schema.py::TestErrorHandler::test_dump_with_custom_error_handler\",\n \"tests/test_schema.py::TestErrorHandler::test_load_with_custom_error_handler\",\n \"tests/test_schema.py::TestErrorHandler::test_load_with_custom_error_handler_and_partially_valid_data\",\n \"tests/test_schema.py::TestErrorHandler::test_custom_error_handler_with_validates_decorator\",\n \"tests/test_schema.py::TestErrorHandler::test_custom_error_handler_with_validates_schema_decorator\",\n \"tests/test_schema.py::TestErrorHandler::test_validate_with_custom_error_handler\",\n \"tests/test_schema.py::TestFieldValidation::test_errors_are_cleared_after_loading_collection\",\n \"tests/test_schema.py::TestFieldValidation::test_raises_error_with_list\",\n \"tests/test_schema.py::TestFieldValidation::test_raises_error_with_dict\",\n \"tests/test_schema.py::test_schema_repr\",\n \"tests/test_schema.py::TestNestedSchema::test_flat_nested\",\n \"tests/test_schema.py::TestNestedSchema::test_nested_many_with_missing_attribute\",\n \"tests/test_schema.py::TestNestedSchema::test_nested_with_attribute_none\",\n \"tests/test_schema.py::TestNestedSchema::test_flat_nested2\",\n \"tests/test_schema.py::TestNestedSchema::test_nested_field_does_not_validate_required\",\n \"tests/test_schema.py::TestNestedSchema::test_nested_none\",\n \"tests/test_schema.py::TestNestedSchema::test_nested\",\n \"tests/test_schema.py::TestNestedSchema::test_nested_many_fields\",\n \"tests/test_schema.py::TestNestedSchema::test_nested_meta_many\",\n \"tests/test_schema.py::TestNestedSchema::test_nested_only\",\n \"tests/test_schema.py::TestNestedSchema::test_exclude\",\n \"tests/test_schema.py::TestNestedSchema::test_list_field\",\n \"tests/test_schema.py::TestNestedSchema::test_nested_load_many\",\n \"tests/test_schema.py::TestNestedSchema::test_nested_errors\",\n \"tests/test_schema.py::TestNestedSchema::test_nested_strict\",\n \"tests/test_schema.py::TestNestedSchema::test_nested_method_field\",\n \"tests/test_schema.py::TestNestedSchema::test_nested_function_field\",\n \"tests/test_schema.py::TestNestedSchema::test_nested_prefixed_field\",\n \"tests/test_schema.py::TestNestedSchema::test_nested_prefixed_many_field\",\n \"tests/test_schema.py::TestNestedSchema::test_invalid_float_field\",\n \"tests/test_schema.py::TestNestedSchema::test_serializer_meta_with_nested_fields\",\n \"tests/test_schema.py::TestNestedSchema::test_serializer_with_nested_meta_fields\",\n \"tests/test_schema.py::TestNestedSchema::test_nested_fields_must_be_passed_a_serializer\",\n \"tests/test_schema.py::TestNestedSchema::test_invalid_type_passed_to_nested_field\",\n \"tests/test_schema.py::TestNestedSchema::test_missing_required_nested_field\",\n \"tests/test_schema.py::TestSelfReference::test_nesting_schema_within_itself\",\n \"tests/test_schema.py::TestSelfReference::test_nesting_schema_by_passing_class_name\",\n \"tests/test_schema.py::TestSelfReference::test_nesting_within_itself_meta\",\n \"tests/test_schema.py::TestSelfReference::test_recursive_missing_required_field\",\n \"tests/test_schema.py::TestSelfReference::test_recursive_missing_required_field_one_level_in\",\n \"tests/test_schema.py::TestSelfReference::test_nested_self_with_only_param\",\n \"tests/test_schema.py::TestSelfReference::test_multiple_nested_self_fields\",\n \"tests/test_schema.py::TestSelfReference::test_nested_many\",\n \"tests/test_schema.py::test_serialization_with_required_field\",\n \"tests/test_schema.py::test_deserialization_with_required_field\",\n \"tests/test_schema.py::test_deserialization_with_required_field_and_custom_validator\",\n \"tests/test_schema.py::TestContext::test_context_method\",\n \"tests/test_schema.py::TestContext::test_context_method_function\",\n \"tests/test_schema.py::TestContext::test_function_field_raises_error_when_context_not_available\",\n \"tests/test_schema.py::TestContext::test_fields_context\",\n \"tests/test_schema.py::TestContext::test_nested_fields_inherit_context\",\n \"tests/test_schema.py::test_serializer_can_specify_nested_object_as_attribute\",\n \"tests/test_schema.py::TestFieldInheritance::test_inherit_fields_from_schema_subclass\",\n \"tests/test_schema.py::TestFieldInheritance::test_inherit_fields_from_non_schema_subclass\",\n \"tests/test_schema.py::TestFieldInheritance::test_inheritance_follows_mro\",\n \"tests/test_schema.py::TestAccessor::test_accessor_decorator_is_deprecated\",\n \"tests/test_schema.py::TestAccessor::test_accessor_is_used\",\n \"tests/test_schema.py::TestAccessor::test_accessor_with_many\",\n \"tests/test_schema.py::TestRequiredFields::test_required_string_field_missing\",\n \"tests/test_schema.py::TestRequiredFields::test_required_string_field_failure\",\n \"tests/test_schema.py::TestRequiredFields::test_allow_none_param\",\n \"tests/test_schema.py::TestRequiredFields::test_allow_none_custom_message\",\n \"tests/test_schema.py::TestDefaults::test_missing_inputs_are_excluded_from_dump_output\",\n \"tests/test_schema.py::TestDefaults::test_none_is_serialized_to_none\",\n \"tests/test_schema.py::TestDefaults::test_default_and_value_missing\",\n \"tests/test_schema.py::TestDefaults::test_loading_none\",\n \"tests/test_schema.py::TestDefaults::test_missing_inputs_are_excluded_from_load_output\",\n \"tests/test_schema.py::TestLoadOnly::test_load_only\",\n \"tests/test_schema.py::TestLoadOnly::test_dump_only\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"MIT License"},"__index_level_0__":{"kind":"number","value":266,"string":"266"}}},{"rowIdx":267,"cells":{"instance_id":{"kind":"string","value":"sympy__sympy-10004"},"base_commit":{"kind":"string","value":"b740702f753d17b88579ea3160c3e89780cd346b"},"created_at":{"kind":"string","value":"2015-10-19 13:52:59"},"environment_setup_commit":{"kind":"string","value":"0241b35cae5f2adc04dc37b25f7dc9c5f00bd746"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/sympy/stats/crv.py b/sympy/stats/crv.py\nindex 292427da84..fe2fd5e221 100644\n--- a/sympy/stats/crv.py\n+++ b/sympy/stats/crv.py\n@@ -300,6 +300,9 @@ def probability(self, condition, **kwargs):\n rv = [rv for rv in self.values if rv.symbol == domain.symbol][0]\n # Integrate out all other random variables\n pdf = self.compute_density(rv, **kwargs)\n+ # return S.Zero if `domain` is empty set\n+ if domain.set is S.EmptySet:\n+ return S.Zero\n # Integrate out the last variable over the special domain\n return Integral(pdf(z), (z, domain.set), **kwargs)\n \n"},"problem_statement":{"kind":"string","value":"P(X < -1) of ExponentialDistribution\n```\r\n>>> from sympy import *\r\n>>> from sympy.stats import Exponential, Gamma, P, pspace, Normal, Uniform\r\n>>> X = Exponential('X', 3)\r\n>>> P(X < -1)\r\nAttributeError Traceback (most recent call last)\r\n in ()\r\n----> 1 P(X < -1)\r\n\r\n/home/gxyd/Public/sympy/sympy/stats/rv.py in probability(condition, given_condition, numsamples, evaluate, **kwargs)\r\n 621 result = pspace(condition).probability(condition, **kwargs)\r\n 622 if evaluate and hasattr(result, 'doit'):\r\n--> 623 return result.doit()\r\n 624 else:\r\n 625 return result\r\n\r\n/home/gxyd/Public/sympy/sympy/integrals/integrals.py in doit(self, **hints)\r\n 525 else:\r\n 526 try:\r\n--> 527 function = antideriv._eval_interval(x, a, b)\r\n 528 except NotImplementedError:\r\n 529 # This can happen if _eval_interval depends in a\r\n\r\n/home/gxyd/Public/sympy/sympy/core/expr.py in _eval_interval(self, x, a, b)\r\n 778 B = 0\r\n 779 else:\r\n--> 780 B = self.subs(x, b)\r\n 781 if B.has(S.NaN, S.Infinity, S.NegativeInfinity, S.ComplexInfinity):\r\n 782 B = limit(self, x, b)\r\n\r\n/home/gxyd/Public/sympy/sympy/core/basic.py in subs(self, *args, **kwargs)\r\n 893 rv = self\r\n 894 for old, new in sequence:\r\n--> 895 rv = rv._subs(old, new, **kwargs)\r\n 896 if not isinstance(rv, Basic):\r\n 897 break\r\n\r\n/home/gxyd/Public/sympy/sympy/core/cache.py in wrapper(*args, **kwargs)\r\n 91 def wrapper(*args, **kwargs):\r\n 92 try:\r\n---> 93 retval = cfunc(*args, **kwargs)\r\n 94 except TypeError:\r\n 95 retval = func(*args, **kwargs)\r\n\r\n/usr/lib/python3.4/functools.py in wrapper(*args, **kwds)\r\n 470 hits += 1\r\n 471 return result\r\n--> 472 result = user_function(*args, **kwds)\r\n 473 with lock:\r\n 474 if key in cache:\r\n\r\n/home/gxyd/Public/sympy/sympy/core/basic.py in _subs(self, old, new, **hints)\r\n 1007 rv = self._eval_subs(old, new)\r\n 1008 if rv is None:\r\n-> 1009 rv = fallback(self, old, new)\r\n 1010 return rv\r\n 1011 \r\n\r\n/home/gxyd/Public/sympy/sympy/core/basic.py in fallback(self, old, new)\r\n 979 if not hasattr(arg, '_eval_subs'):\r\n 980 continue\r\n--> 981 arg = arg._subs(old, new, **hints)\r\n 982 if not _aresame(arg, args[i]):\r\n 983 hit = True\r\n\r\n/home/gxyd/Public/sympy/sympy/core/cache.py in wrapper(*args, **kwargs)\r\n 91 def wrapper(*args, **kwargs):\r\n 92 try:\r\n---> 93 retval = cfunc(*args, **kwargs)\r\n 94 except TypeError:\r\n 95 retval = func(*args, **kwargs)\r\n\r\n/usr/lib/python3.4/functools.py in wrapper(*args, **kwds)\r\n 470 hits += 1\r\n 471 return result\r\n--> 472 result = user_function(*args, **kwds)\r\n 473 with lock:\r\n 474 if key in cache:\r\n\r\n/home/gxyd/Public/sympy/sympy/core/basic.py in _subs(self, old, new, **hints)\r\n 1007 rv = self._eval_subs(old, new)\r\n 1008 if rv is None:\r\n-> 1009 rv = fallback(self, old, new)\r\n 1010 return rv\r\n 1011 \r\n\r\n/home/gxyd/Public/sympy/sympy/core/basic.py in fallback(self, old, new)\r\n 979 if not hasattr(arg, '_eval_subs'):\r\n 980 continue\r\n--> 981 arg = arg._subs(old, new, **hints)\r\n 982 if not _aresame(arg, args[i]):\r\n 983 hit = True\r\n\r\n/home/gxyd/Public/sympy/sympy/core/cache.py in wrapper(*args, **kwargs)\r\n 91 def wrapper(*args, **kwargs):\r\n 92 try:\r\n---> 93 retval = cfunc(*args, **kwargs)\r\n 94 except TypeError:\r\n 95 retval = func(*args, **kwargs)\r\n\r\n/usr/lib/python3.4/functools.py in wrapper(*args, **kwds)\r\n 470 hits += 1\r\n 471 return result\r\n--> 472 result = user_function(*args, **kwds)\r\n 473 with lock:\r\n 474 if key in cache:\r\n\r\n/home/gxyd/Public/sympy/sympy/core/basic.py in _subs(self, old, new, **hints)\r\n 1007 rv = self._eval_subs(old, new)\r\n 1008 if rv is None:\r\n-> 1009 rv = fallback(self, old, new)\r\n 1010 return rv\r\n 1011 \r\n\r\n/home/gxyd/Public/sympy/sympy/core/basic.py in fallback(self, old, new)\r\n 984 args[i] = arg\r\n 985 if hit:\r\n--> 986 rv = self.func(*args)\r\n 987 hack2 = hints.get('hack2', False)\r\n 988 if hack2 and self.is_Mul and not rv.is_Mul: # 2-arg hack\r\n\r\n/home/gxyd/Public/sympy/sympy/core/cache.py in wrapper(*args, **kwargs)\r\n 91 def wrapper(*args, **kwargs):\r\n 92 try:\r\n---> 93 retval = cfunc(*args, **kwargs)\r\n 94 except TypeError:\r\n 95 retval = func(*args, **kwargs)\r\n\r\n/usr/lib/python3.4/functools.py in wrapper(*args, **kwds)\r\n 470 hits += 1\r\n 471 return result\r\n--> 472 result = user_function(*args, **kwds)\r\n 473 with lock:\r\n 474 if key in cache:\r\n\r\n/home/gxyd/Public/sympy/sympy/core/operations.py in __new__(cls, *args, **options)\r\n 39 return args[0]\r\n 40 \r\n---> 41 c_part, nc_part, order_symbols = cls.flatten(args)\r\n 42 is_commutative = not nc_part\r\n 43 obj = cls._from_args(c_part + nc_part, is_commutative)\r\n\r\n/home/gxyd/Public/sympy/sympy/core/mul.py in flatten(cls, seq)\r\n 179 assert not a is S.One\r\n 180 if not a.is_zero and a.is_Rational:\r\n--> 181 r, b = b.as_coeff_Mul()\r\n 182 if b.is_Add:\r\n 183 if r is not S.One: # 2-arg hack\r\n\r\nAttributeError: 'EmptySet' object has no attribute 'as_coeff_Mul'\r\n```\r\n\r\nI guess this should return `S.Zero`, instead of an `AttributeError`."},"repo":{"kind":"string","value":"sympy/sympy"},"test_patch":{"kind":"string","value":"diff --git a/sympy/stats/tests/test_continuous_rv.py b/sympy/stats/tests/test_continuous_rv.py\nindex 2ee455c1c1..05f5400293 100644\n--- a/sympy/stats/tests/test_continuous_rv.py\n+++ b/sympy/stats/tests/test_continuous_rv.py\n@@ -633,3 +633,10 @@ def test_difficult_univariate():\n assert density(x**3)\n assert density(exp(x**2))\n assert density(log(x))\n+\n+\n+def test_issue_10003():\n+ X = Exponential('x', 3)\n+ G = Gamma('g', 1, 2)\n+ assert P(X < -1) == S.Zero\n+ assert P(G < -1) == S.Zero\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [],\n \"has_test_patch\": true,\n \"is_lite\": true,\n \"llm_score\": {\n \"difficulty_score\": 0,\n \"issue_text_score\": 0,\n \"test_score\": 1\n },\n \"num_modified_files\": 1\n}"},"version":{"kind":"string","value":"0.7"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .[dev]\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"requirements.txt\",\n \"pip_packages\": [\n \"mpmath>=0.19\",\n \"pytest\",\n \"pytest-cov\",\n \"pytest-xdist\",\n \"pytest-mock\",\n \"pytest-asyncio\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\n \"python\": \"3.7\",\n \"reqs_path\": [\n \"requirements/base.txt\"\n ],\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"certifi @ file:///croot/certifi_1671487769961/work/certifi\ncoverage==7.2.7\nexceptiongroup==1.2.2\nexecnet==2.0.2\nimportlib-metadata==6.7.0\niniconfig==2.0.0\nmpmath==1.3.0\npackaging==24.0\npluggy==1.2.0\npytest==7.4.4\npytest-asyncio==0.21.2\npytest-cov==4.1.0\npytest-mock==3.11.1\npytest-xdist==3.5.0\n-e git+https://github.com/sympy/sympy.git@b740702f753d17b88579ea3160c3e89780cd346b#egg=sympy\ntomli==2.0.1\ntyping_extensions==4.7.1\nzipp==3.15.0\n"},"environment":{"kind":"string","value":"name: sympy\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2022.12.7=py37h06a4308_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.4.4=h6a678d5_1\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - pip=22.3.1=py37h06a4308_0\n - python=3.7.16=h7a1cb2a_0\n - readline=8.2=h5eee18b_0\n - setuptools=65.6.3=py37h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - wheel=0.38.4=py37h06a4308_0\n - xz=5.6.4=h5eee18b_1\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - coverage==7.2.7\n - exceptiongroup==1.2.2\n - execnet==2.0.2\n - importlib-metadata==6.7.0\n - iniconfig==2.0.0\n - mpmath==1.3.0\n - packaging==24.0\n - pluggy==1.2.0\n - pytest==7.4.4\n - pytest-asyncio==0.21.2\n - pytest-cov==4.1.0\n - pytest-mock==3.11.1\n - pytest-xdist==3.5.0\n - tomli==2.0.1\n - typing-extensions==4.7.1\n - zipp==3.15.0\nprefix: /opt/conda/envs/sympy\n"},"FAIL_TO_PASS":{"kind":"list like","value":["sympy/stats/tests/test_continuous_rv.py::test_issue_10003"],"string":"[\n \"sympy/stats/tests/test_continuous_rv.py::test_issue_10003\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":["sympy/stats/tests/test_continuous_rv.py::test_conditional_1d","sympy/stats/tests/test_continuous_rv.py::test_triangular","sympy/stats/tests/test_continuous_rv.py::test_uniformsum","sympy/stats/tests/test_continuous_rv.py::test_unevaluated"],"string":"[\n \"sympy/stats/tests/test_continuous_rv.py::test_conditional_1d\",\n \"sympy/stats/tests/test_continuous_rv.py::test_triangular\",\n \"sympy/stats/tests/test_continuous_rv.py::test_uniformsum\",\n \"sympy/stats/tests/test_continuous_rv.py::test_unevaluated\"\n]"},"PASS_TO_PASS":{"kind":"list like","value":["sympy/stats/tests/test_continuous_rv.py::test_single_normal","sympy/stats/tests/test_continuous_rv.py::test_ContinuousDomain","sympy/stats/tests/test_continuous_rv.py::test_multiple_normal","sympy/stats/tests/test_continuous_rv.py::test_symbolic","sympy/stats/tests/test_continuous_rv.py::test_cdf","sympy/stats/tests/test_continuous_rv.py::test_sample","sympy/stats/tests/test_continuous_rv.py::test_ContinuousRV","sympy/stats/tests/test_continuous_rv.py::test_arcsin","sympy/stats/tests/test_continuous_rv.py::test_benini","sympy/stats/tests/test_continuous_rv.py::test_beta","sympy/stats/tests/test_continuous_rv.py::test_betaprime","sympy/stats/tests/test_continuous_rv.py::test_cauchy","sympy/stats/tests/test_continuous_rv.py::test_chi","sympy/stats/tests/test_continuous_rv.py::test_chi_noncentral","sympy/stats/tests/test_continuous_rv.py::test_chi_squared","sympy/stats/tests/test_continuous_rv.py::test_dagum","sympy/stats/tests/test_continuous_rv.py::test_erlang","sympy/stats/tests/test_continuous_rv.py::test_exponential","sympy/stats/tests/test_continuous_rv.py::test_f_distribution","sympy/stats/tests/test_continuous_rv.py::test_fisher_z","sympy/stats/tests/test_continuous_rv.py::test_frechet","sympy/stats/tests/test_continuous_rv.py::test_gamma","sympy/stats/tests/test_continuous_rv.py::test_gamma_inverse","sympy/stats/tests/test_continuous_rv.py::test_kumaraswamy","sympy/stats/tests/test_continuous_rv.py::test_laplace","sympy/stats/tests/test_continuous_rv.py::test_logistic","sympy/stats/tests/test_continuous_rv.py::test_lognormal","sympy/stats/tests/test_continuous_rv.py::test_maxwell","sympy/stats/tests/test_continuous_rv.py::test_nakagami","sympy/stats/tests/test_continuous_rv.py::test_pareto","sympy/stats/tests/test_continuous_rv.py::test_pareto_numeric","sympy/stats/tests/test_continuous_rv.py::test_raised_cosine","sympy/stats/tests/test_continuous_rv.py::test_rayleigh","sympy/stats/tests/test_continuous_rv.py::test_studentt","sympy/stats/tests/test_continuous_rv.py::test_quadratic_u","sympy/stats/tests/test_continuous_rv.py::test_uniform","sympy/stats/tests/test_continuous_rv.py::test_uniform_P","sympy/stats/tests/test_continuous_rv.py::test_von_mises","sympy/stats/tests/test_continuous_rv.py::test_weibull","sympy/stats/tests/test_continuous_rv.py::test_weibull_numeric","sympy/stats/tests/test_continuous_rv.py::test_wignersemicircle","sympy/stats/tests/test_continuous_rv.py::test_prefab_sampling","sympy/stats/tests/test_continuous_rv.py::test_input_value_assertions","sympy/stats/tests/test_continuous_rv.py::test_probability_unevaluated","sympy/stats/tests/test_continuous_rv.py::test_density_unevaluated","sympy/stats/tests/test_continuous_rv.py::test_NormalDistribution","sympy/stats/tests/test_continuous_rv.py::test_random_parameters","sympy/stats/tests/test_continuous_rv.py::test_random_parameters_given","sympy/stats/tests/test_continuous_rv.py::test_conjugate_priors","sympy/stats/tests/test_continuous_rv.py::test_difficult_univariate"],"string":"[\n \"sympy/stats/tests/test_continuous_rv.py::test_single_normal\",\n \"sympy/stats/tests/test_continuous_rv.py::test_ContinuousDomain\",\n \"sympy/stats/tests/test_continuous_rv.py::test_multiple_normal\",\n \"sympy/stats/tests/test_continuous_rv.py::test_symbolic\",\n \"sympy/stats/tests/test_continuous_rv.py::test_cdf\",\n \"sympy/stats/tests/test_continuous_rv.py::test_sample\",\n \"sympy/stats/tests/test_continuous_rv.py::test_ContinuousRV\",\n \"sympy/stats/tests/test_continuous_rv.py::test_arcsin\",\n \"sympy/stats/tests/test_continuous_rv.py::test_benini\",\n \"sympy/stats/tests/test_continuous_rv.py::test_beta\",\n \"sympy/stats/tests/test_continuous_rv.py::test_betaprime\",\n \"sympy/stats/tests/test_continuous_rv.py::test_cauchy\",\n \"sympy/stats/tests/test_continuous_rv.py::test_chi\",\n \"sympy/stats/tests/test_continuous_rv.py::test_chi_noncentral\",\n \"sympy/stats/tests/test_continuous_rv.py::test_chi_squared\",\n \"sympy/stats/tests/test_continuous_rv.py::test_dagum\",\n \"sympy/stats/tests/test_continuous_rv.py::test_erlang\",\n \"sympy/stats/tests/test_continuous_rv.py::test_exponential\",\n \"sympy/stats/tests/test_continuous_rv.py::test_f_distribution\",\n \"sympy/stats/tests/test_continuous_rv.py::test_fisher_z\",\n \"sympy/stats/tests/test_continuous_rv.py::test_frechet\",\n \"sympy/stats/tests/test_continuous_rv.py::test_gamma\",\n \"sympy/stats/tests/test_continuous_rv.py::test_gamma_inverse\",\n \"sympy/stats/tests/test_continuous_rv.py::test_kumaraswamy\",\n \"sympy/stats/tests/test_continuous_rv.py::test_laplace\",\n \"sympy/stats/tests/test_continuous_rv.py::test_logistic\",\n \"sympy/stats/tests/test_continuous_rv.py::test_lognormal\",\n \"sympy/stats/tests/test_continuous_rv.py::test_maxwell\",\n \"sympy/stats/tests/test_continuous_rv.py::test_nakagami\",\n \"sympy/stats/tests/test_continuous_rv.py::test_pareto\",\n \"sympy/stats/tests/test_continuous_rv.py::test_pareto_numeric\",\n \"sympy/stats/tests/test_continuous_rv.py::test_raised_cosine\",\n \"sympy/stats/tests/test_continuous_rv.py::test_rayleigh\",\n \"sympy/stats/tests/test_continuous_rv.py::test_studentt\",\n \"sympy/stats/tests/test_continuous_rv.py::test_quadratic_u\",\n \"sympy/stats/tests/test_continuous_rv.py::test_uniform\",\n \"sympy/stats/tests/test_continuous_rv.py::test_uniform_P\",\n \"sympy/stats/tests/test_continuous_rv.py::test_von_mises\",\n \"sympy/stats/tests/test_continuous_rv.py::test_weibull\",\n \"sympy/stats/tests/test_continuous_rv.py::test_weibull_numeric\",\n \"sympy/stats/tests/test_continuous_rv.py::test_wignersemicircle\",\n \"sympy/stats/tests/test_continuous_rv.py::test_prefab_sampling\",\n \"sympy/stats/tests/test_continuous_rv.py::test_input_value_assertions\",\n \"sympy/stats/tests/test_continuous_rv.py::test_probability_unevaluated\",\n \"sympy/stats/tests/test_continuous_rv.py::test_density_unevaluated\",\n \"sympy/stats/tests/test_continuous_rv.py::test_NormalDistribution\",\n \"sympy/stats/tests/test_continuous_rv.py::test_random_parameters\",\n \"sympy/stats/tests/test_continuous_rv.py::test_random_parameters_given\",\n \"sympy/stats/tests/test_continuous_rv.py::test_conjugate_priors\",\n \"sympy/stats/tests/test_continuous_rv.py::test_difficult_univariate\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"BSD"},"__index_level_0__":{"kind":"number","value":267,"string":"267"}}},{"rowIdx":268,"cells":{"instance_id":{"kind":"string","value":"sympy__sympy-10009"},"base_commit":{"kind":"string","value":"aab1ba97bd3fa1c411f77ee7f652edcaca24327e"},"created_at":{"kind":"string","value":"2015-10-20 09:54:10"},"environment_setup_commit":{"kind":"string","value":"0241b35cae5f2adc04dc37b25f7dc9c5f00bd746"},"hints_text":{"kind":"string","value":"asmeurer: Does this fix the original issue in #9567 as well? \nasmeurer: I don't understand what solve_linear does, but if it fixes the issue then +1.\nsmichr: I showed on the issue page that the reported issue returns correctly. \r\n\r\nAs for solve_linear, it is trying to solve for a linear variable and also report (early in the solve process) if there is no solution possible (like when a variable appears in an expression but actually cancels after simplification).\r\n\r\nI can't believe we didn't see this error earlier.\nasmeurer: I guess what I don't understand is why it sometimes returns a solution and sometimes returns the numerator and denominator. \nsmichr: > why it sometimes returns a solution and sometimes returns the numerator and denominator\r\n\r\nit should probably have been a private function of solve; I think the original idea was to not throw away the extracted numerator which is needed for the more extended work of solve. Since the function was returning 2 values when it found a solution it made sense to return the denominator with the numerator, too, so 2 values would be returned when there wasn't a linear solution."},"patch":{"kind":"string","value":"diff --git a/sympy/core/mod.py b/sympy/core/mod.py\nindex f31e75d4f8..4d58ebde75 100644\n--- a/sympy/core/mod.py\n+++ b/sympy/core/mod.py\n@@ -36,7 +36,7 @@ def doit(p, q):\n to be less than or equal q.\n \"\"\"\n \n- if p.is_infinite or q.is_infinite or p is nan or q is nan:\n+ if p.is_infinite or q.is_infinite:\n return nan\n if (p == q or p == -q or\n p.is_Pow and p.exp.is_Integer and p.base == q or\ndiff --git a/sympy/geometry/polygon.py b/sympy/geometry/polygon.py\nindex fbc93fbaf0..24a4e90960 100644\n--- a/sympy/geometry/polygon.py\n+++ b/sympy/geometry/polygon.py\n@@ -516,7 +516,7 @@ def encloses_point(self, p):\n References\n ==========\n \n- [1] http://paulbourke.net/geometry/polygonmesh/#insidepoly\n+ [1] http://www.ariel.com.au/a/python-point-int-poly.html\n \n \"\"\"\n p = Point(p)\n@@ -559,8 +559,8 @@ def encloses_point(self, p):\n if 0 <= max(p1x, p2x):\n if p1y != p2y:\n xinters = (-p1y)*(p2x - p1x)/(p2y - p1y) + p1x\n- if p1x == p2x or 0 <= xinters:\n- hit_odd = not hit_odd\n+ if p1x == p2x or 0 <= xinters:\n+ hit_odd = not hit_odd\n p1x, p1y = p2x, p2y\n return hit_odd\n \ndiff --git a/sympy/solvers/solvers.py b/sympy/solvers/solvers.py\nindex f9283083ed..f2c3fd2446 100644\n--- a/sympy/solvers/solvers.py\n+++ b/sympy/solvers/solvers.py\n@@ -1271,17 +1271,18 @@ def _solve(f, *symbols, **flags):\n got_s = set([])\n result = []\n for s in symbols:\n- n, d = solve_linear(f, symbols=[s])\n- if n.is_Symbol:\n+ xi, v = solve_linear(f, symbols=[s])\n+ if xi == s:\n # no need to check but we should simplify if desired\n if flags.get('simplify', True):\n- d = simplify(d)\n- if got_s and any([ss in d.free_symbols for ss in got_s]):\n+ v = simplify(v)\n+ vfree = v.free_symbols\n+ if got_s and any([ss in vfree for ss in got_s]):\n # sol depends on previously solved symbols: discard it\n continue\n- got_s.add(n)\n- result.append({n: d})\n- elif n and d: # otherwise there was no solution for s\n+ got_s.add(xi)\n+ result.append({xi: v})\n+ elif xi: # there might be a non-linear solution if xi is not 0\n failed.append(s)\n if not failed:\n return result\n@@ -1329,7 +1330,7 @@ def _solve(f, *symbols, **flags):\n elif f.is_Piecewise:\n result = set()\n for n, (expr, cond) in enumerate(f.args):\n- candidates = _solve(expr, *symbols, **flags)\n+ candidates = _solve(expr, symbol, **flags)\n for candidate in candidates:\n if candidate in result:\n continue\n@@ -1363,9 +1364,9 @@ def _solve(f, *symbols, **flags):\n check = False\n else:\n # first see if it really depends on symbol and whether there\n- # is a linear solution\n+ # is only a linear solution\n f_num, sol = solve_linear(f, symbols=symbols)\n- if not symbol in f_num.free_symbols:\n+ if f_num is S.Zero:\n return []\n elif f_num.is_Symbol:\n # no need to check but simplify if desired\n@@ -1821,36 +1822,52 @@ def _ok_syms(e, sort=False):\n \n \n def solve_linear(lhs, rhs=0, symbols=[], exclude=[]):\n- r\"\"\" Return a tuple derived from f = lhs - rhs that is either:\n+ r\"\"\" Return a tuple derived from f = lhs - rhs that is one of\n+ the following:\n+\n+ (0, 1) meaning that ``f`` is independent of the symbols in\n+ ``symbols`` that aren't in ``exclude``, e.g::\n+\n+ >>> from sympy.solvers.solvers import solve_linear\n+ >>> from sympy.abc import x, y, z\n+ >>> from sympy import cos, sin\n+ >>> eq = y*cos(x)**2 + y*sin(x)**2 - y # = y*(1 - 1) = 0\n+ >>> solve_linear(eq)\n+ (0, 1)\n+ >>> eq = cos(x)**2 + sin(x)**2 # = 1\n+ >>> solve_linear(eq)\n+ (0, 1)\n+ >>> solve_linear(x, exclude=[x])\n+ (0, 1)\n+\n+ (0, 0) meaning that there is no solution to the equation\n+ amongst the symbols given.\n+\n+ (If the first element of the tuple is not zero then\n+ the function is guaranteed to be dependent on a symbol\n+ in ``symbols``.)\n+\n+ (symbol, solution) where symbol appears linearly in the\n+ numerator of ``f``, is in ``symbols`` (if given) and is\n+ not in ``exclude`` (if given). No simplification is done\n+ to ``f`` other than a ``mul=True`` expansion, so the\n+ solution will correspond strictly to a unique solution.\n+\n+ ``(n, d)`` where ``n`` and ``d`` are the numerator and\n+ denominator of ``f`` when the numerator was not linear\n+ in any symbol of interest; ``n`` will never be a symbol\n+ unless a solution for that symbol was found (in which case\n+ the second element is the solution, not the denominator).\n \n- (numerator, denominator) of ``f``\n- If this comes back as (0, 1) it means\n- that ``f`` is independent of the symbols in ``symbols``, e.g::\n-\n- y*cos(x)**2 + y*sin(x)**2 - y = y*(0) = 0\n- cos(x)**2 + sin(x)**2 = 1\n-\n- If it comes back as (0, 0) there is no solution to the equation\n- amongst the symbols given.\n-\n- If the numerator is not zero then the function is guaranteed\n- to be dependent on a symbol in ``symbols``.\n-\n- or\n-\n- (symbol, solution) where symbol appears linearly in the numerator of\n- ``f``, is in ``symbols`` (if given) and is not in ``exclude`` (if given).\n-\n- No simplification is done to ``f`` other than and mul=True expansion,\n- so the solution will correspond strictly to a unique solution.\n \n Examples\n ========\n \n- >>> from sympy.solvers.solvers import solve_linear\n- >>> from sympy.abc import x, y, z\n+ >>> from sympy.core.power import Pow\n+ >>> from sympy.polys.polytools import cancel\n \n- These are linear in x and 1/x:\n+ The variable ``x`` appears as a linear variable in each of the\n+ following:\n \n >>> solve_linear(x + y**2)\n (x, -y**2)\n@@ -1862,34 +1879,53 @@ def solve_linear(lhs, rhs=0, symbols=[], exclude=[]):\n >>> solve_linear(x**2/y**2 - 3)\n (x**2 - 3*y**2, y**2)\n \n- If the numerator is a symbol then (0, 0) is returned if the solution for\n- that symbol would have set any denominator to 0:\n+ If the numerator of the expression is a symbol then (0, 0) is\n+ returned if the solution for that symbol would have set any\n+ denominator to 0:\n \n- >>> solve_linear(1/(1/x - 2))\n+ >>> eq = 1/(1/x - 2)\n+ >>> eq.as_numer_denom()\n+ (x, -2*x + 1)\n+ >>> solve_linear(eq)\n (0, 0)\n- >>> 1/(1/x) # to SymPy, this looks like x ...\n+\n+ But automatic rewriting may cause a symbol in the denominator to\n+ appear in the numerator so a solution will be returned:\n+\n+ >>> (1/x)**-1\n x\n- >>> solve_linear(1/(1/x)) # so a solution is given\n+ >>> solve_linear((1/x)**-1)\n (x, 0)\n \n- If x is allowed to cancel, then this appears linear, but this sort of\n- cancellation is not done so the solution will always satisfy the original\n- expression without causing a division by zero error.\n+ Use an unevaluated expression to avoid this:\n \n- >>> solve_linear(x**2*(1/x - z**2/x))\n+ >>> solve_linear(Pow(1/x, -1, evaluate=False))\n+ (0, 0)\n+\n+ If ``x`` is allowed to cancel in the following expression, then it\n+ appears to be linear in ``x``, but this sort of cancellation is not\n+ done by ``solve_linear`` so the solution will always satisfy the\n+ original expression without causing a division by zero error.\n+\n+ >>> eq = x**2*(1/x - z**2/x)\n+ >>> solve_linear(cancel(eq))\n+ (x, 0)\n+ >>> solve_linear(eq)\n (x**2*(-z**2 + 1), x)\n \n- You can give a list of what you prefer for x candidates:\n+ A list of symbols for which a solution is desired may be given:\n \n >>> solve_linear(x + y + z, symbols=[y])\n (y, -x - z)\n \n- You can also indicate what variables you don't want to consider:\n+ A list of symbols to ignore may also be given:\n \n- >>> solve_linear(x + y + z, exclude=[x, z])\n+ >>> solve_linear(x + y + z, exclude=[x])\n (y, -x - z)\n \n- If only x was excluded then a solution for y or z might be obtained.\n+ (A solution for ``y`` is obtained because it is the first variable\n+ from the canonically sorted list of symbols that had a linear\n+ solution.)\n \n \"\"\"\n if isinstance(lhs, Equality):\n@@ -1922,48 +1958,50 @@ def solve_linear(lhs, rhs=0, symbols=[], exclude=[]):\n ''' % (bad, eg)))\n symbols = free.intersection(symbols)\n symbols = symbols.difference(exclude)\n+ if not symbols:\n+ return S.Zero, S.One\n dfree = d.free_symbols\n \n- # derivatives are easy to do but tricky to analyze to see if they are going\n- # to disallow a linear solution, so for simplicity we just evaluate the\n- # ones that have the symbols of interest\n+ # derivatives are easy to do but tricky to analyze to see if they\n+ # are going to disallow a linear solution, so for simplicity we\n+ # just evaluate the ones that have the symbols of interest\n derivs = defaultdict(list)\n for der in n.atoms(Derivative):\n csym = der.free_symbols & symbols\n for c in csym:\n derivs[c].append(der)\n \n- if symbols:\n- all_zero = True\n- for xi in symbols:\n- # if there are derivatives in this var, calculate them now\n- if type(derivs[xi]) is list:\n- derivs[xi] = dict([(der, der.doit()) for der in derivs[xi]])\n- nn = n.subs(derivs[xi])\n- dn = nn.diff(xi)\n- if dn:\n- all_zero = False\n- if dn is S.NaN:\n- break\n- if not xi in dn.free_symbols:\n- vi = -(nn.subs(xi, 0))/dn\n- if dens is None:\n- dens = _simple_dens(eq, symbols)\n- if not any(checksol(di, {xi: vi}, minimal=True) is True\n- for di in dens):\n- # simplify any trivial integral\n- irep = [(i, i.doit()) for i in vi.atoms(Integral) if\n- i.function.is_number]\n- # do a slight bit of simplification\n- vi = expand_mul(vi.subs(irep))\n- if not d.has(xi) or not (d/xi).has(xi):\n- return xi, vi\n-\n- if all_zero:\n- return S.Zero, S.One\n- if n.is_Symbol: # there was no valid solution\n- n = d = S.Zero\n- return n, d # should we cancel now?\n+ all_zero = True\n+ for xi in sorted(symbols, key=default_sort_key): # canonical order\n+ # if there are derivatives in this var, calculate them now\n+ if type(derivs[xi]) is list:\n+ derivs[xi] = dict([(der, der.doit()) for der in derivs[xi]])\n+ newn = n.subs(derivs[xi])\n+ dnewn_dxi = newn.diff(xi)\n+ # dnewn_dxi can be nonzero if it survives differentation by any\n+ # of its free symbols\n+ free = dnewn_dxi.free_symbols\n+ if dnewn_dxi and (not free or any(dnewn_dxi.diff(s) for s in free)):\n+ all_zero = False\n+ if dnewn_dxi is S.NaN:\n+ break\n+ if xi not in dnewn_dxi.free_symbols:\n+ vi = -(newn.subs(xi, 0))/dnewn_dxi\n+ if dens is None:\n+ dens = _simple_dens(eq, symbols)\n+ if not any(checksol(di, {xi: vi}, minimal=True) is True\n+ for di in dens):\n+ # simplify any trivial integral\n+ irep = [(i, i.doit()) for i in vi.atoms(Integral) if\n+ i.function.is_number]\n+ # do a slight bit of simplification\n+ vi = expand_mul(vi.subs(irep))\n+ return xi, vi\n+ if all_zero:\n+ return S.Zero, S.One\n+ if n.is_Symbol: # no solution for this symbol was found\n+ return S.Zero, S.Zero\n+ return n, d\n \n \n def minsolve_linear_system(system, *symbols, **flags):\n@@ -1971,9 +2009,8 @@ def minsolve_linear_system(system, *symbols, **flags):\n Find a particular solution to a linear system.\n \n In particular, try to find a solution with the minimal possible number\n- of non-zero variables. This is a very computationally hard prolem.\n- If ``quick=True``, a heuristic is used. Otherwise a naive algorithm with\n- exponential complexity is used.\n+ of non-zero variables using a naive algorithm with exponential complexity.\n+ If ``quick=True``, a heuristic is used.\n \"\"\"\n quick = flags.get('quick', False)\n # Check if there are any non-zero solutions at all\n"},"problem_statement":{"kind":"string","value":"solve_univariate_inequality gives wrong solution to the rational inequality abs(1/(x-1)) > 1\nIn current SymPy (commit c2ffd9), I see\r\n```python\r\nIn [1]: x = symbols('x', real=True)\r\nIn [2]: from sympy.solvers.solveset import solveset\r\nIn [3]: solveset(abs(1/(x-1)) > 1)\r\nOut[3]: (1, 2)\r\n```\r\nwhile the result should be ```(0, 1) ∪ (1, 2)```.\r\n\r\nThe following similar case works:\r\n```python\r\nIn [4]: solveset(abs(1/x) > 1)\r\nOut[4]: (-1, 0) ∪ (0, 1)\r\n```\r\n@aktech - can you please take a look?"},"repo":{"kind":"string","value":"sympy/sympy"},"test_patch":{"kind":"string","value":"diff --git a/sympy/core/tests/test_arit.py b/sympy/core/tests/test_arit.py\nindex 8c8625ce62..cbc6f77ebd 100644\n--- a/sympy/core/tests/test_arit.py\n+++ b/sympy/core/tests/test_arit.py\n@@ -1502,9 +1502,6 @@ def test_Mod():\n assert x % 5 == Mod(x, 5)\n assert x % y == Mod(x, y)\n assert (x % y).subs({x: 5, y: 3}) == 2\n- assert Mod(nan, 1) == nan\n- assert Mod(1, nan) == nan\n- assert Mod(nan, nan) == nan\n \n # Float handling\n point3 = Float(3.3) % 1\ndiff --git a/sympy/solvers/tests/test_solvers.py b/sympy/solvers/tests/test_solvers.py\nindex cfd5ca0c74..9aee8f389e 100644\n--- a/sympy/solvers/tests/test_solvers.py\n+++ b/sympy/solvers/tests/test_solvers.py\n@@ -501,6 +501,8 @@ def test_issue_3870():\n def test_solve_linear():\n w = Wild('w')\n assert solve_linear(x, x) == (0, 1)\n+ assert solve_linear(x, exclude=[x]) == (0, 1)\n+ assert solve_linear(x, symbols=[w]) == (0, 1)\n assert solve_linear(x, y - 2*x) in [(x, y/3), (y, 3*x)]\n assert solve_linear(x, y - 2*x, exclude=[x]) == (y, 3*x)\n assert solve_linear(3*x - y, 0) in [(x, y/3), (y, 3*x)]\n@@ -513,10 +515,15 @@ def test_solve_linear():\n assert solve_linear(cos(x)**2 + sin(x)**2 + 2 + y, symbols=[x]) == (0, 1)\n assert solve_linear(Eq(x, 3)) == (x, 3)\n assert solve_linear(1/(1/x - 2)) == (0, 0)\n- assert solve_linear((x + 1)*exp(-x), symbols=[x]) == (x + 1, exp(x))\n+ assert solve_linear((x + 1)*exp(-x), symbols=[x]) == (x, -1)\n assert solve_linear((x + 1)*exp(x), symbols=[x]) == ((x + 1)*exp(x), 1)\n- assert solve_linear(x*exp(-x**2), symbols=[x]) == (0, 0)\n+ assert solve_linear(x*exp(-x**2), symbols=[x]) == (x, 0)\n assert solve_linear(0**x - 1) == (0**x - 1, 1)\n+ assert solve_linear(1 + 1/(x - 1)) == (x, 0)\n+ eq = y*cos(x)**2 + y*sin(x)**2 - y # = y*(1 - 1) = 0\n+ assert solve_linear(eq) == (0, 1)\n+ eq = cos(x)**2 + sin(x)**2 # = 1\n+ assert solve_linear(eq) == (0, 1)\n raises(ValueError, lambda: solve_linear(Eq(x, 3), 3))\n \n \n@@ -1771,3 +1778,7 @@ def test_issue_2840_8155():\n assert solve(2*sin(x) - 2*sin(2*x)) == [\n 0, -pi, pi, -2*I*log(-sqrt(3)/2 - I/2), -2*I*log(-sqrt(3)/2 + I/2),\n -2*I*log(sqrt(3)/2 - I/2), -2*I*log(sqrt(3)/2 + I/2)]\n+\n+\n+def test_issue_9567():\n+ assert solve(1 + 1/(x - 1)) == [0]\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_many_modified_files\",\n \"has_many_hunks\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 1,\n \"issue_text_score\": 0,\n \"test_score\": 3\n },\n \"num_modified_files\": 3\n}"},"version":{"kind":"string","value":"0.7"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"pytest\",\n \"pip_packages\": [\n \"pytest\"\n ],\n \"pre_install\": null,\n \"python\": \"3.7\",\n \"reqs_path\": null,\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"attrs @ file:///croot/attrs_1668696182826/work\ncertifi @ file:///croot/certifi_1671487769961/work/certifi\nflit_core @ file:///opt/conda/conda-bld/flit-core_1644941570762/work/source/flit_core\nimportlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1648562407465/work\niniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work\nmpmath==1.3.0\npackaging @ file:///croot/packaging_1671697413597/work\npluggy @ file:///tmp/build/80754af9/pluggy_1648042572264/work\npy @ file:///opt/conda/conda-bld/py_1644396412707/work\npytest==7.1.2\n-e git+https://github.com/sympy/sympy.git@aab1ba97bd3fa1c411f77ee7f652edcaca24327e#egg=sympy\ntomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work\ntyping_extensions @ file:///croot/typing_extensions_1669924550328/work\nzipp @ file:///croot/zipp_1672387121353/work\n"},"environment":{"kind":"string","value":"name: sympy\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - attrs=22.1.0=py37h06a4308_0\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2022.12.7=py37h06a4308_0\n - flit-core=3.6.0=pyhd3eb1b0_0\n - importlib-metadata=4.11.3=py37h06a4308_0\n - importlib_metadata=4.11.3=hd3eb1b0_0\n - iniconfig=1.1.1=pyhd3eb1b0_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.4.4=h6a678d5_1\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - packaging=22.0=py37h06a4308_0\n - pip=22.3.1=py37h06a4308_0\n - pluggy=1.0.0=py37h06a4308_1\n - py=1.11.0=pyhd3eb1b0_0\n - pytest=7.1.2=py37h06a4308_0\n - python=3.7.16=h7a1cb2a_0\n - readline=8.2=h5eee18b_0\n - setuptools=65.6.3=py37h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - tomli=2.0.1=py37h06a4308_0\n - typing_extensions=4.4.0=py37h06a4308_0\n - wheel=0.38.4=py37h06a4308_0\n - xz=5.6.4=h5eee18b_1\n - zipp=3.11.0=py37h06a4308_0\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - mpmath==1.3.0\nprefix: /opt/conda/envs/sympy\n"},"FAIL_TO_PASS":{"kind":"list like","value":["sympy/solvers/tests/test_solvers.py::test_solve_linear","sympy/solvers/tests/test_solvers.py::test_issue_9567"],"string":"[\n \"sympy/solvers/tests/test_solvers.py::test_solve_linear\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_9567\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["sympy/core/tests/test_arit.py::test_bug1","sympy/core/tests/test_arit.py::test_Symbol","sympy/core/tests/test_arit.py::test_arit0","sympy/core/tests/test_arit.py::test_div","sympy/core/tests/test_arit.py::test_pow","sympy/core/tests/test_arit.py::test_pow2","sympy/core/tests/test_arit.py::test_pow3","sympy/core/tests/test_arit.py::test_pow_E","sympy/core/tests/test_arit.py::test_pow_issue_3516","sympy/core/tests/test_arit.py::test_pow_im","sympy/core/tests/test_arit.py::test_real_mul","sympy/core/tests/test_arit.py::test_ncmul","sympy/core/tests/test_arit.py::test_ncpow","sympy/core/tests/test_arit.py::test_powerbug","sympy/core/tests/test_arit.py::test_Mul_doesnt_expand_exp","sympy/core/tests/test_arit.py::test_Add_Mul_is_integer","sympy/core/tests/test_arit.py::test_Add_Mul_is_finite","sympy/core/tests/test_arit.py::test_Mul_is_even_odd","sympy/core/tests/test_arit.py::test_evenness_in_ternary_integer_product_with_even","sympy/core/tests/test_arit.py::test_oddness_in_ternary_integer_product_with_even","sympy/core/tests/test_arit.py::test_Mul_is_rational","sympy/core/tests/test_arit.py::test_Add_is_rational","sympy/core/tests/test_arit.py::test_Add_is_even_odd","sympy/core/tests/test_arit.py::test_Mul_is_negative_positive","sympy/core/tests/test_arit.py::test_Mul_is_negative_positive_2","sympy/core/tests/test_arit.py::test_Mul_is_nonpositive_nonnegative","sympy/core/tests/test_arit.py::test_Add_is_negative_positive","sympy/core/tests/test_arit.py::test_Add_is_nonpositive_nonnegative","sympy/core/tests/test_arit.py::test_Pow_is_integer","sympy/core/tests/test_arit.py::test_Pow_is_real","sympy/core/tests/test_arit.py::test_real_Pow","sympy/core/tests/test_arit.py::test_Pow_is_finite","sympy/core/tests/test_arit.py::test_Pow_is_even_odd","sympy/core/tests/test_arit.py::test_Pow_is_negative_positive","sympy/core/tests/test_arit.py::test_Pow_is_zero","sympy/core/tests/test_arit.py::test_Pow_is_nonpositive_nonnegative","sympy/core/tests/test_arit.py::test_Mul_is_imaginary_real","sympy/core/tests/test_arit.py::test_Mul_hermitian_antihermitian","sympy/core/tests/test_arit.py::test_Add_is_comparable","sympy/core/tests/test_arit.py::test_Mul_is_comparable","sympy/core/tests/test_arit.py::test_Pow_is_comparable","sympy/core/tests/test_arit.py::test_Add_is_positive_2","sympy/core/tests/test_arit.py::test_Add_is_irrational","sympy/core/tests/test_arit.py::test_issue_3531b","sympy/core/tests/test_arit.py::test_bug3","sympy/core/tests/test_arit.py::test_suppressed_evaluation","sympy/core/tests/test_arit.py::test_Add_as_coeff_mul","sympy/core/tests/test_arit.py::test_Pow_as_coeff_mul_doesnt_expand","sympy/core/tests/test_arit.py::test_issue_3514","sympy/core/tests/test_arit.py::test_make_args","sympy/core/tests/test_arit.py::test_issue_5126","sympy/core/tests/test_arit.py::test_Rational_as_content_primitive","sympy/core/tests/test_arit.py::test_Add_as_content_primitive","sympy/core/tests/test_arit.py::test_Mul_as_content_primitive","sympy/core/tests/test_arit.py::test_Pow_as_content_primitive","sympy/core/tests/test_arit.py::test_issue_5460","sympy/core/tests/test_arit.py::test_product_irrational","sympy/core/tests/test_arit.py::test_issue_5919","sympy/core/tests/test_arit.py::test_Mod","sympy/core/tests/test_arit.py::test_Mod_is_integer","sympy/core/tests/test_arit.py::test_Mod_is_nonposneg","sympy/core/tests/test_arit.py::test_issue_6001","sympy/core/tests/test_arit.py::test_polar","sympy/core/tests/test_arit.py::test_issue_6040","sympy/core/tests/test_arit.py::test_issue_6082","sympy/core/tests/test_arit.py::test_issue_6077","sympy/core/tests/test_arit.py::test_mul_flatten_oo","sympy/core/tests/test_arit.py::test_add_flatten","sympy/core/tests/test_arit.py::test_issue_5160_6087_6089_6090","sympy/core/tests/test_arit.py::test_float_int","sympy/core/tests/test_arit.py::test_issue_6611a","sympy/core/tests/test_arit.py::test_denest_add_mul","sympy/core/tests/test_arit.py::test_mul_coeff","sympy/core/tests/test_arit.py::test_mul_zero_detection","sympy/core/tests/test_arit.py::test_Mul_with_zero_infinite","sympy/core/tests/test_arit.py::test_issue_8247_8354","sympy/solvers/tests/test_solvers.py::test_swap_back","sympy/solvers/tests/test_solvers.py::test_guess_poly","sympy/solvers/tests/test_solvers.py::test_guess_poly_cv","sympy/solvers/tests/test_solvers.py::test_guess_rational_cv","sympy/solvers/tests/test_solvers.py::test_guess_transcendental","sympy/solvers/tests/test_solvers.py::test_solve_args","sympy/solvers/tests/test_solvers.py::test_solve_polynomial1","sympy/solvers/tests/test_solvers.py::test_solve_polynomial2","sympy/solvers/tests/test_solvers.py::test_solve_polynomial_cv_1a","sympy/solvers/tests/test_solvers.py::test_solve_polynomial_cv_1b","sympy/solvers/tests/test_solvers.py::test_solve_polynomial_cv_2","sympy/solvers/tests/test_solvers.py::test_quintics_1","sympy/solvers/tests/test_solvers.py::test_highorder_poly","sympy/solvers/tests/test_solvers.py::test_quintics_2","sympy/solvers/tests/test_solvers.py::test_solve_rational","sympy/solvers/tests/test_solvers.py::test_solve_nonlinear","sympy/solvers/tests/test_solvers.py::test_issue_8666","sympy/solvers/tests/test_solvers.py::test_issue_7228","sympy/solvers/tests/test_solvers.py::test_issue_7190","sympy/solvers/tests/test_solvers.py::test_linear_system","sympy/solvers/tests/test_solvers.py::test_linear_system_function","sympy/solvers/tests/test_solvers.py::test_linear_systemLU","sympy/solvers/tests/test_solvers.py::test_solve_transcendental","sympy/solvers/tests/test_solvers.py::test_solve_for_functions_derivatives","sympy/solvers/tests/test_solvers.py::test_issue_3725","sympy/solvers/tests/test_solvers.py::test_issue_3870","sympy/solvers/tests/test_solvers.py::test_solve_undetermined_coeffs","sympy/solvers/tests/test_solvers.py::test_solve_inequalities","sympy/solvers/tests/test_solvers.py::test_issue_4793","sympy/solvers/tests/test_solvers.py::test_PR1964","sympy/solvers/tests/test_solvers.py::test_issue_5197","sympy/solvers/tests/test_solvers.py::test_checking","sympy/solvers/tests/test_solvers.py::test_issue_4671_4463_4467","sympy/solvers/tests/test_solvers.py::test_issue_5132","sympy/solvers/tests/test_solvers.py::test_issue_5335","sympy/solvers/tests/test_solvers.py::test_issue_5767","sympy/solvers/tests/test_solvers.py::test_polysys","sympy/solvers/tests/test_solvers.py::test_unrad1","sympy/solvers/tests/test_solvers.py::test_unrad_slow","sympy/solvers/tests/test_solvers.py::test__invert","sympy/solvers/tests/test_solvers.py::test_issue_4463","sympy/solvers/tests/test_solvers.py::test_issue_5114","sympy/solvers/tests/test_solvers.py::test_issue_5849","sympy/solvers/tests/test_solvers.py::test_issue_5849_matrix","sympy/solvers/tests/test_solvers.py::test_issue_5901","sympy/solvers/tests/test_solvers.py::test_issue_5912","sympy/solvers/tests/test_solvers.py::test_float_handling","sympy/solvers/tests/test_solvers.py::test_check_assumptions","sympy/solvers/tests/test_solvers.py::test_issue_6056","sympy/solvers/tests/test_solvers.py::test_issue_6060","sympy/solvers/tests/test_solvers.py::test_issue_5673","sympy/solvers/tests/test_solvers.py::test_exclude","sympy/solvers/tests/test_solvers.py::test_high_order_roots","sympy/solvers/tests/test_solvers.py::test_minsolve_linear_system","sympy/solvers/tests/test_solvers.py::test_real_roots","sympy/solvers/tests/test_solvers.py::test_issue_6528","sympy/solvers/tests/test_solvers.py::test_overdetermined","sympy/solvers/tests/test_solvers.py::test_issue_6605","sympy/solvers/tests/test_solvers.py::test__ispow","sympy/solvers/tests/test_solvers.py::test_issue_6644","sympy/solvers/tests/test_solvers.py::test_issue_6752","sympy/solvers/tests/test_solvers.py::test_issue_6792","sympy/solvers/tests/test_solvers.py::test_issues_6819_6820_6821_6248_8692","sympy/solvers/tests/test_solvers.py::test_issue_6989","sympy/solvers/tests/test_solvers.py::test_lambert_multivariate","sympy/solvers/tests/test_solvers.py::test_rewrite_trig","sympy/solvers/tests/test_solvers.py::test_uselogcombine","sympy/solvers/tests/test_solvers.py::test_atan2","sympy/solvers/tests/test_solvers.py::test_errorinverses","sympy/solvers/tests/test_solvers.py::test_issue_2725","sympy/solvers/tests/test_solvers.py::test_issue_5114_6611","sympy/solvers/tests/test_solvers.py::test_det_quick","sympy/solvers/tests/test_solvers.py::test_piecewise","sympy/solvers/tests/test_solvers.py::test_real_imag_splitting","sympy/solvers/tests/test_solvers.py::test_issue_7110","sympy/solvers/tests/test_solvers.py::test_units","sympy/solvers/tests/test_solvers.py::test_issue_7547","sympy/solvers/tests/test_solvers.py::test_issue_7895","sympy/solvers/tests/test_solvers.py::test_issue_2777","sympy/solvers/tests/test_solvers.py::test_issue_7322","sympy/solvers/tests/test_solvers.py::test_nsolve","sympy/solvers/tests/test_solvers.py::test_issue_8587","sympy/solvers/tests/test_solvers.py::test_high_order_multivariate","sympy/solvers/tests/test_solvers.py::test_base_0_exp_0","sympy/solvers/tests/test_solvers.py::test__simple_dens","sympy/solvers/tests/test_solvers.py::test_issue_8755","sympy/solvers/tests/test_solvers.py::test_issue_8828","sympy/solvers/tests/test_solvers.py::test_issue_2840_8155"],"string":"[\n \"sympy/core/tests/test_arit.py::test_bug1\",\n \"sympy/core/tests/test_arit.py::test_Symbol\",\n \"sympy/core/tests/test_arit.py::test_arit0\",\n \"sympy/core/tests/test_arit.py::test_div\",\n \"sympy/core/tests/test_arit.py::test_pow\",\n \"sympy/core/tests/test_arit.py::test_pow2\",\n \"sympy/core/tests/test_arit.py::test_pow3\",\n \"sympy/core/tests/test_arit.py::test_pow_E\",\n \"sympy/core/tests/test_arit.py::test_pow_issue_3516\",\n \"sympy/core/tests/test_arit.py::test_pow_im\",\n \"sympy/core/tests/test_arit.py::test_real_mul\",\n \"sympy/core/tests/test_arit.py::test_ncmul\",\n \"sympy/core/tests/test_arit.py::test_ncpow\",\n \"sympy/core/tests/test_arit.py::test_powerbug\",\n \"sympy/core/tests/test_arit.py::test_Mul_doesnt_expand_exp\",\n \"sympy/core/tests/test_arit.py::test_Add_Mul_is_integer\",\n \"sympy/core/tests/test_arit.py::test_Add_Mul_is_finite\",\n \"sympy/core/tests/test_arit.py::test_Mul_is_even_odd\",\n \"sympy/core/tests/test_arit.py::test_evenness_in_ternary_integer_product_with_even\",\n \"sympy/core/tests/test_arit.py::test_oddness_in_ternary_integer_product_with_even\",\n \"sympy/core/tests/test_arit.py::test_Mul_is_rational\",\n \"sympy/core/tests/test_arit.py::test_Add_is_rational\",\n \"sympy/core/tests/test_arit.py::test_Add_is_even_odd\",\n \"sympy/core/tests/test_arit.py::test_Mul_is_negative_positive\",\n \"sympy/core/tests/test_arit.py::test_Mul_is_negative_positive_2\",\n \"sympy/core/tests/test_arit.py::test_Mul_is_nonpositive_nonnegative\",\n \"sympy/core/tests/test_arit.py::test_Add_is_negative_positive\",\n \"sympy/core/tests/test_arit.py::test_Add_is_nonpositive_nonnegative\",\n \"sympy/core/tests/test_arit.py::test_Pow_is_integer\",\n \"sympy/core/tests/test_arit.py::test_Pow_is_real\",\n \"sympy/core/tests/test_arit.py::test_real_Pow\",\n \"sympy/core/tests/test_arit.py::test_Pow_is_finite\",\n \"sympy/core/tests/test_arit.py::test_Pow_is_even_odd\",\n \"sympy/core/tests/test_arit.py::test_Pow_is_negative_positive\",\n \"sympy/core/tests/test_arit.py::test_Pow_is_zero\",\n \"sympy/core/tests/test_arit.py::test_Pow_is_nonpositive_nonnegative\",\n \"sympy/core/tests/test_arit.py::test_Mul_is_imaginary_real\",\n \"sympy/core/tests/test_arit.py::test_Mul_hermitian_antihermitian\",\n \"sympy/core/tests/test_arit.py::test_Add_is_comparable\",\n \"sympy/core/tests/test_arit.py::test_Mul_is_comparable\",\n \"sympy/core/tests/test_arit.py::test_Pow_is_comparable\",\n \"sympy/core/tests/test_arit.py::test_Add_is_positive_2\",\n \"sympy/core/tests/test_arit.py::test_Add_is_irrational\",\n \"sympy/core/tests/test_arit.py::test_issue_3531b\",\n \"sympy/core/tests/test_arit.py::test_bug3\",\n \"sympy/core/tests/test_arit.py::test_suppressed_evaluation\",\n \"sympy/core/tests/test_arit.py::test_Add_as_coeff_mul\",\n \"sympy/core/tests/test_arit.py::test_Pow_as_coeff_mul_doesnt_expand\",\n \"sympy/core/tests/test_arit.py::test_issue_3514\",\n \"sympy/core/tests/test_arit.py::test_make_args\",\n \"sympy/core/tests/test_arit.py::test_issue_5126\",\n \"sympy/core/tests/test_arit.py::test_Rational_as_content_primitive\",\n \"sympy/core/tests/test_arit.py::test_Add_as_content_primitive\",\n \"sympy/core/tests/test_arit.py::test_Mul_as_content_primitive\",\n \"sympy/core/tests/test_arit.py::test_Pow_as_content_primitive\",\n \"sympy/core/tests/test_arit.py::test_issue_5460\",\n \"sympy/core/tests/test_arit.py::test_product_irrational\",\n \"sympy/core/tests/test_arit.py::test_issue_5919\",\n \"sympy/core/tests/test_arit.py::test_Mod\",\n \"sympy/core/tests/test_arit.py::test_Mod_is_integer\",\n \"sympy/core/tests/test_arit.py::test_Mod_is_nonposneg\",\n \"sympy/core/tests/test_arit.py::test_issue_6001\",\n \"sympy/core/tests/test_arit.py::test_polar\",\n \"sympy/core/tests/test_arit.py::test_issue_6040\",\n \"sympy/core/tests/test_arit.py::test_issue_6082\",\n \"sympy/core/tests/test_arit.py::test_issue_6077\",\n \"sympy/core/tests/test_arit.py::test_mul_flatten_oo\",\n \"sympy/core/tests/test_arit.py::test_add_flatten\",\n \"sympy/core/tests/test_arit.py::test_issue_5160_6087_6089_6090\",\n \"sympy/core/tests/test_arit.py::test_float_int\",\n \"sympy/core/tests/test_arit.py::test_issue_6611a\",\n \"sympy/core/tests/test_arit.py::test_denest_add_mul\",\n \"sympy/core/tests/test_arit.py::test_mul_coeff\",\n \"sympy/core/tests/test_arit.py::test_mul_zero_detection\",\n \"sympy/core/tests/test_arit.py::test_Mul_with_zero_infinite\",\n \"sympy/core/tests/test_arit.py::test_issue_8247_8354\",\n \"sympy/solvers/tests/test_solvers.py::test_swap_back\",\n \"sympy/solvers/tests/test_solvers.py::test_guess_poly\",\n \"sympy/solvers/tests/test_solvers.py::test_guess_poly_cv\",\n \"sympy/solvers/tests/test_solvers.py::test_guess_rational_cv\",\n \"sympy/solvers/tests/test_solvers.py::test_guess_transcendental\",\n \"sympy/solvers/tests/test_solvers.py::test_solve_args\",\n \"sympy/solvers/tests/test_solvers.py::test_solve_polynomial1\",\n \"sympy/solvers/tests/test_solvers.py::test_solve_polynomial2\",\n \"sympy/solvers/tests/test_solvers.py::test_solve_polynomial_cv_1a\",\n \"sympy/solvers/tests/test_solvers.py::test_solve_polynomial_cv_1b\",\n \"sympy/solvers/tests/test_solvers.py::test_solve_polynomial_cv_2\",\n \"sympy/solvers/tests/test_solvers.py::test_quintics_1\",\n \"sympy/solvers/tests/test_solvers.py::test_highorder_poly\",\n \"sympy/solvers/tests/test_solvers.py::test_quintics_2\",\n \"sympy/solvers/tests/test_solvers.py::test_solve_rational\",\n \"sympy/solvers/tests/test_solvers.py::test_solve_nonlinear\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_8666\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_7228\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_7190\",\n \"sympy/solvers/tests/test_solvers.py::test_linear_system\",\n \"sympy/solvers/tests/test_solvers.py::test_linear_system_function\",\n \"sympy/solvers/tests/test_solvers.py::test_linear_systemLU\",\n \"sympy/solvers/tests/test_solvers.py::test_solve_transcendental\",\n \"sympy/solvers/tests/test_solvers.py::test_solve_for_functions_derivatives\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_3725\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_3870\",\n \"sympy/solvers/tests/test_solvers.py::test_solve_undetermined_coeffs\",\n \"sympy/solvers/tests/test_solvers.py::test_solve_inequalities\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_4793\",\n \"sympy/solvers/tests/test_solvers.py::test_PR1964\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_5197\",\n \"sympy/solvers/tests/test_solvers.py::test_checking\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_4671_4463_4467\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_5132\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_5335\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_5767\",\n \"sympy/solvers/tests/test_solvers.py::test_polysys\",\n \"sympy/solvers/tests/test_solvers.py::test_unrad1\",\n \"sympy/solvers/tests/test_solvers.py::test_unrad_slow\",\n \"sympy/solvers/tests/test_solvers.py::test__invert\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_4463\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_5114\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_5849\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_5849_matrix\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_5901\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_5912\",\n \"sympy/solvers/tests/test_solvers.py::test_float_handling\",\n \"sympy/solvers/tests/test_solvers.py::test_check_assumptions\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_6056\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_6060\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_5673\",\n \"sympy/solvers/tests/test_solvers.py::test_exclude\",\n \"sympy/solvers/tests/test_solvers.py::test_high_order_roots\",\n \"sympy/solvers/tests/test_solvers.py::test_minsolve_linear_system\",\n \"sympy/solvers/tests/test_solvers.py::test_real_roots\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_6528\",\n \"sympy/solvers/tests/test_solvers.py::test_overdetermined\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_6605\",\n \"sympy/solvers/tests/test_solvers.py::test__ispow\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_6644\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_6752\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_6792\",\n \"sympy/solvers/tests/test_solvers.py::test_issues_6819_6820_6821_6248_8692\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_6989\",\n \"sympy/solvers/tests/test_solvers.py::test_lambert_multivariate\",\n \"sympy/solvers/tests/test_solvers.py::test_rewrite_trig\",\n \"sympy/solvers/tests/test_solvers.py::test_uselogcombine\",\n \"sympy/solvers/tests/test_solvers.py::test_atan2\",\n \"sympy/solvers/tests/test_solvers.py::test_errorinverses\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_2725\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_5114_6611\",\n \"sympy/solvers/tests/test_solvers.py::test_det_quick\",\n \"sympy/solvers/tests/test_solvers.py::test_piecewise\",\n \"sympy/solvers/tests/test_solvers.py::test_real_imag_splitting\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_7110\",\n \"sympy/solvers/tests/test_solvers.py::test_units\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_7547\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_7895\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_2777\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_7322\",\n \"sympy/solvers/tests/test_solvers.py::test_nsolve\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_8587\",\n \"sympy/solvers/tests/test_solvers.py::test_high_order_multivariate\",\n \"sympy/solvers/tests/test_solvers.py::test_base_0_exp_0\",\n \"sympy/solvers/tests/test_solvers.py::test__simple_dens\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_8755\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_8828\",\n \"sympy/solvers/tests/test_solvers.py::test_issue_2840_8155\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"BSD"},"__index_level_0__":{"kind":"number","value":268,"string":"268"}}},{"rowIdx":269,"cells":{"instance_id":{"kind":"string","value":"sympy__sympy-10014"},"base_commit":{"kind":"string","value":"f511df8e8f7f2ee8079981671500201e3c32dc3f"},"created_at":{"kind":"string","value":"2015-10-20 20:33:12"},"environment_setup_commit":{"kind":"string","value":"8bb5814067cfa0348fb8b708848f35dba2b55ff4"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/sympy/core/function.py b/sympy/core/function.py\nindex 94eb5128ff..e1ae71929a 100644\n--- a/sympy/core/function.py\n+++ b/sympy/core/function.py\n@@ -57,7 +57,7 @@\n import mpmath.libmp as mlib\n \n import inspect\n-\n+import collections\n \n def _coeff_isneg(a):\n \"\"\"Return True if the leading Number is negative.\n@@ -1330,31 +1330,18 @@ def _eval_subs(self, old, new):\n # equivalent to self or if old is a subderivative of self.\n if old.is_Derivative and old.expr == self.args[0]:\n # Check if canonnical order of variables is equal.\n- old_vars = Derivative._sort_variables(old.variables)\n- self_vars = Derivative._sort_variables(self.args[1:])\n+ old_vars = collections.Counter(old.variables)\n+ self_vars = collections.Counter(self.variables)\n if old_vars == self_vars:\n return new\n \n- # Check if olf is a subderivative of self.\n- if len(old_vars) < len(self_vars):\n- self_vars_front = []\n- match = True\n- while old_vars and self_vars and match:\n- if old_vars[0] == self_vars[0]:\n- old_vars.pop(0)\n- self_vars.pop(0)\n- else:\n- # If self_v does not match old_v, we need to check if\n- # the types are the same (symbol vs non-symbol). If\n- # they are, we can continue checking self_vars for a\n- # match.\n- if old_vars[0].is_Symbol != self_vars[0].is_Symbol:\n- match = False\n- else:\n- self_vars_front.append(self_vars.pop(0))\n- if match:\n- variables = self_vars_front + self_vars\n- return Derivative(new, *variables)\n+ # collections.Counter doesn't have __le__\n+ def _subset(a, b):\n+ return all(a[i] <= b[i] for i in a)\n+\n+ if _subset(old_vars, self_vars):\n+ return Derivative(new, *(self_vars - old_vars).elements())\n+\n return Derivative(*(x._subs(old, new) for x in self.args))\n \n def _eval_lseries(self, x, logx):\n"},"problem_statement":{"kind":"string","value":"Incorrect subsitution of partial derivatives by .subs() \nWith sympy 0.7.6, the subs() method does a wrong substitution:\r\n\r\n from sympy import *\r\n init_printing()\r\n\r\n x,y,z=symbols('x,y,z')\r\n f=Function('f')\r\n\r\n expr = diff(f(x,y),x,x,y)\r\n pprint(expr)\r\n\r\n e2 = expr.subs(diff(f(x,y),y,2), z)\r\n pprint(e2)\r\n\r\nThe call to subs() method incorrectly substitutes a `df/dy` with `z`, while we asked to substitute `d2f/dy2` instead !\r\n"},"repo":{"kind":"string","value":"sympy/sympy"},"test_patch":{"kind":"string","value":"diff --git a/sympy/core/tests/test_subs.py b/sympy/core/tests/test_subs.py\nindex c50890e0a3..f2133a36c3 100644\n--- a/sympy/core/tests/test_subs.py\n+++ b/sympy/core/tests/test_subs.py\n@@ -431,17 +431,27 @@ def test_derivative_subs():\n \n def test_derivative_subs2():\n x, y, z = symbols('x y z')\n- f, g = symbols('f g', cls=Function)\n+ f_func, g_func = symbols('f g', cls=Function)\n+ f, g = f_func(x, y, z), g_func(x, y, z)\n assert Derivative(f, x, y).subs(Derivative(f, x, y), g) == g\n assert Derivative(f, y, x).subs(Derivative(f, x, y), g) == g\n assert Derivative(f, x, y).subs(Derivative(f, x), g) == Derivative(g, y)\n assert Derivative(f, x, y).subs(Derivative(f, y), g) == Derivative(g, x)\n- assert (Derivative(f(x, y, z), x, y, z).subs(\n- Derivative(f(x, y, z), x, z), g) == Derivative(g, y))\n- assert (Derivative(f(x, y, z), x, y, z).subs(\n- Derivative(f(x, y, z), z, y), g) == Derivative(g, x))\n- assert (Derivative(f(x, y, z), x, y, z).subs(\n- Derivative(f(x, y, z), z, y, x), g) == g)\n+ assert (Derivative(f, x, y, z).subs(\n+ Derivative(f, x, z), g) == Derivative(g, y))\n+ assert (Derivative(f, x, y, z).subs(\n+ Derivative(f, z, y), g) == Derivative(g, x))\n+ assert (Derivative(f, x, y, z).subs(\n+ Derivative(f, z, y, x), g) == g)\n+\n+ # Issue 9135\n+ assert (Derivative(f, x, x, y).subs(\n+ Derivative(f, y, y), g) == Derivative(f, x, x, y))\n+ assert (Derivative(f, x, y, y, z).subs(\n+ Derivative(f, x, y, y, y), g) == Derivative(f, x, y, y, z))\n+\n+ assert Derivative(f, x, y).subs(Derivative(f_func(x), x, y), g) == Derivative(f, x, y)\n+\n \n def test_derivative_subs3():\n x = Symbol('x')\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [],\n \"has_test_patch\": true,\n \"is_lite\": true,\n \"llm_score\": {\n \"difficulty_score\": 1,\n \"issue_text_score\": 0,\n \"test_score\": 0\n },\n \"num_modified_files\": 1\n}"},"version":{"kind":"string","value":"1.0"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"requirements.txt\",\n \"pip_packages\": [\n \"mpmath>=0.19\",\n \"pytest\",\n \"pytest-cov\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\n \"python\": \"3.5\",\n \"reqs_path\": null,\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"attrs==22.2.0\ncertifi==2021.5.30\ncoverage==6.2\nimportlib-metadata==4.8.3\niniconfig==1.1.1\nmpmath==1.3.0\npackaging==21.3\npluggy==1.0.0\npy==1.11.0\npyparsing==3.1.4\npytest==7.0.1\npytest-cov==4.0.0\n-e git+https://github.com/sympy/sympy.git@f511df8e8f7f2ee8079981671500201e3c32dc3f#egg=sympy\ntomli==1.2.3\ntyping_extensions==4.1.1\nzipp==3.6.0\n"},"environment":{"kind":"string","value":"name: sympy\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2021.5.30=py36h06a4308_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.3=he6710b0_2\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - pip=21.2.2=py36h06a4308_0\n - python=3.6.13=h12debd9_1\n - readline=8.2=h5eee18b_0\n - setuptools=58.0.4=py36h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - wheel=0.37.1=pyhd3eb1b0_0\n - xz=5.6.4=h5eee18b_1\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - attrs==22.2.0\n - coverage==6.2\n - importlib-metadata==4.8.3\n - iniconfig==1.1.1\n - mpmath==1.3.0\n - packaging==21.3\n - pluggy==1.0.0\n - py==1.11.0\n - pyparsing==3.1.4\n - pytest==7.0.1\n - pytest-cov==4.0.0\n - tomli==1.2.3\n - typing-extensions==4.1.1\n - zipp==3.6.0\nprefix: /opt/conda/envs/sympy\n"},"FAIL_TO_PASS":{"kind":"list like","value":["sympy/core/tests/test_subs.py::test_derivative_subs2"],"string":"[\n \"sympy/core/tests/test_subs.py::test_derivative_subs2\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["sympy/core/tests/test_subs.py::test_subs","sympy/core/tests/test_subs.py::test_subs_AccumBounds","sympy/core/tests/test_subs.py::test_trigonometric","sympy/core/tests/test_subs.py::test_powers","sympy/core/tests/test_subs.py::test_logexppow","sympy/core/tests/test_subs.py::test_bug","sympy/core/tests/test_subs.py::test_subbug1","sympy/core/tests/test_subs.py::test_subbug2","sympy/core/tests/test_subs.py::test_dict_set","sympy/core/tests/test_subs.py::test_dict_ambigous","sympy/core/tests/test_subs.py::test_deriv_sub_bug3","sympy/core/tests/test_subs.py::test_equality_subs1","sympy/core/tests/test_subs.py::test_equality_subs2","sympy/core/tests/test_subs.py::test_issue_3742","sympy/core/tests/test_subs.py::test_subs_dict1","sympy/core/tests/test_subs.py::test_mul","sympy/core/tests/test_subs.py::test_subs_simple","sympy/core/tests/test_subs.py::test_subs_constants","sympy/core/tests/test_subs.py::test_subs_commutative","sympy/core/tests/test_subs.py::test_subs_noncommutative","sympy/core/tests/test_subs.py::test_subs_basic_funcs","sympy/core/tests/test_subs.py::test_subs_wild","sympy/core/tests/test_subs.py::test_subs_mixed","sympy/core/tests/test_subs.py::test_division","sympy/core/tests/test_subs.py::test_add","sympy/core/tests/test_subs.py::test_subs_issue_4009","sympy/core/tests/test_subs.py::test_functions_subs","sympy/core/tests/test_subs.py::test_derivative_subs","sympy/core/tests/test_subs.py::test_derivative_subs3","sympy/core/tests/test_subs.py::test_issue_5284","sympy/core/tests/test_subs.py::test_subs_iter","sympy/core/tests/test_subs.py::test_subs_dict","sympy/core/tests/test_subs.py::test_no_arith_subs_on_floats","sympy/core/tests/test_subs.py::test_issue_5651","sympy/core/tests/test_subs.py::test_issue_6075","sympy/core/tests/test_subs.py::test_issue_6079","sympy/core/tests/test_subs.py::test_issue_4680","sympy/core/tests/test_subs.py::test_issue_6158","sympy/core/tests/test_subs.py::test_Function_subs","sympy/core/tests/test_subs.py::test_simultaneous_subs","sympy/core/tests/test_subs.py::test_issue_6419_6421","sympy/core/tests/test_subs.py::test_issue_6559","sympy/core/tests/test_subs.py::test_issue_5261","sympy/core/tests/test_subs.py::test_issue_6923","sympy/core/tests/test_subs.py::test_2arg_hack","sympy/core/tests/test_subs.py::test_noncommutative_subs","sympy/core/tests/test_subs.py::test_issue_2877","sympy/core/tests/test_subs.py::test_issue_5910","sympy/core/tests/test_subs.py::test_issue_5217","sympy/core/tests/test_subs.py::test_issue_10829","sympy/core/tests/test_subs.py::test_pow_eval_subs_no_cache","sympy/core/tests/test_subs.py::test_RootOf_issue_10092","sympy/core/tests/test_subs.py::test_issue_8886"],"string":"[\n \"sympy/core/tests/test_subs.py::test_subs\",\n \"sympy/core/tests/test_subs.py::test_subs_AccumBounds\",\n \"sympy/core/tests/test_subs.py::test_trigonometric\",\n \"sympy/core/tests/test_subs.py::test_powers\",\n \"sympy/core/tests/test_subs.py::test_logexppow\",\n \"sympy/core/tests/test_subs.py::test_bug\",\n \"sympy/core/tests/test_subs.py::test_subbug1\",\n \"sympy/core/tests/test_subs.py::test_subbug2\",\n \"sympy/core/tests/test_subs.py::test_dict_set\",\n \"sympy/core/tests/test_subs.py::test_dict_ambigous\",\n \"sympy/core/tests/test_subs.py::test_deriv_sub_bug3\",\n \"sympy/core/tests/test_subs.py::test_equality_subs1\",\n \"sympy/core/tests/test_subs.py::test_equality_subs2\",\n \"sympy/core/tests/test_subs.py::test_issue_3742\",\n \"sympy/core/tests/test_subs.py::test_subs_dict1\",\n \"sympy/core/tests/test_subs.py::test_mul\",\n \"sympy/core/tests/test_subs.py::test_subs_simple\",\n \"sympy/core/tests/test_subs.py::test_subs_constants\",\n \"sympy/core/tests/test_subs.py::test_subs_commutative\",\n \"sympy/core/tests/test_subs.py::test_subs_noncommutative\",\n \"sympy/core/tests/test_subs.py::test_subs_basic_funcs\",\n \"sympy/core/tests/test_subs.py::test_subs_wild\",\n \"sympy/core/tests/test_subs.py::test_subs_mixed\",\n \"sympy/core/tests/test_subs.py::test_division\",\n \"sympy/core/tests/test_subs.py::test_add\",\n \"sympy/core/tests/test_subs.py::test_subs_issue_4009\",\n \"sympy/core/tests/test_subs.py::test_functions_subs\",\n \"sympy/core/tests/test_subs.py::test_derivative_subs\",\n \"sympy/core/tests/test_subs.py::test_derivative_subs3\",\n \"sympy/core/tests/test_subs.py::test_issue_5284\",\n \"sympy/core/tests/test_subs.py::test_subs_iter\",\n \"sympy/core/tests/test_subs.py::test_subs_dict\",\n \"sympy/core/tests/test_subs.py::test_no_arith_subs_on_floats\",\n \"sympy/core/tests/test_subs.py::test_issue_5651\",\n \"sympy/core/tests/test_subs.py::test_issue_6075\",\n \"sympy/core/tests/test_subs.py::test_issue_6079\",\n \"sympy/core/tests/test_subs.py::test_issue_4680\",\n \"sympy/core/tests/test_subs.py::test_issue_6158\",\n \"sympy/core/tests/test_subs.py::test_Function_subs\",\n \"sympy/core/tests/test_subs.py::test_simultaneous_subs\",\n \"sympy/core/tests/test_subs.py::test_issue_6419_6421\",\n \"sympy/core/tests/test_subs.py::test_issue_6559\",\n \"sympy/core/tests/test_subs.py::test_issue_5261\",\n \"sympy/core/tests/test_subs.py::test_issue_6923\",\n \"sympy/core/tests/test_subs.py::test_2arg_hack\",\n \"sympy/core/tests/test_subs.py::test_noncommutative_subs\",\n \"sympy/core/tests/test_subs.py::test_issue_2877\",\n \"sympy/core/tests/test_subs.py::test_issue_5910\",\n \"sympy/core/tests/test_subs.py::test_issue_5217\",\n \"sympy/core/tests/test_subs.py::test_issue_10829\",\n \"sympy/core/tests/test_subs.py::test_pow_eval_subs_no_cache\",\n \"sympy/core/tests/test_subs.py::test_RootOf_issue_10092\",\n \"sympy/core/tests/test_subs.py::test_issue_8886\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"BSD"},"__index_level_0__":{"kind":"number","value":269,"string":"269"}}},{"rowIdx":270,"cells":{"instance_id":{"kind":"string","value":"docker__docker-py-822"},"base_commit":{"kind":"string","value":"4c8c761bc15160be5eaa76d81edda17b067aa641"},"created_at":{"kind":"string","value":"2015-10-21 22:58:11"},"environment_setup_commit":{"kind":"string","value":"9050e1c6e05b5b6807357def0aafc59e3b3ae378"},"hints_text":{"kind":"string","value":"dnephin: Might be worth thinking about any other breaking changes you'd like to make before doing a 2.0 release. Sounds reasonable to me.\nbfirsh: LGTM"},"patch":{"kind":"string","value":"diff --git a/docker/api/container.py b/docker/api/container.py\nindex 72c5852d..953a5f52 100644\n--- a/docker/api/container.py\n+++ b/docker/api/container.py\n@@ -997,19 +997,16 @@ class ContainerApiMixin(object):\n self._raise_for_status(res)\n \n @utils.check_resource\n- def start(self, container, binds=None, port_bindings=None, lxc_conf=None,\n- publish_all_ports=None, links=None, privileged=None,\n- dns=None, dns_search=None, volumes_from=None, network_mode=None,\n- restart_policy=None, cap_add=None, cap_drop=None, devices=None,\n- extra_hosts=None, read_only=None, pid_mode=None, ipc_mode=None,\n- security_opt=None, ulimits=None):\n+ def start(self, container, *args, **kwargs):\n \"\"\"\n Start a container. Similar to the ``docker start`` command, but\n doesn't support attach options.\n \n- **Deprecation warning:** For API version > 1.15, it is highly\n- recommended to provide host config options in the ``host_config``\n- parameter of :py:meth:`~ContainerApiMixin.create_container`.\n+ **Deprecation warning:** Passing configuration options in ``start`` is\n+ no longer supported. Users are expected to provide host config options\n+ in the ``host_config`` parameter of\n+ :py:meth:`~ContainerApiMixin.create_container`.\n+\n \n Args:\n container (str): The container to start\n@@ -1017,6 +1014,8 @@ class ContainerApiMixin(object):\n Raises:\n :py:class:`docker.errors.APIError`\n If the server returns an error.\n+ :py:class:`docker.errors.DeprecatedMethod`\n+ If any argument besides ``container`` are provided.\n \n Example:\n \n@@ -1025,64 +1024,14 @@ class ContainerApiMixin(object):\n ... command='/bin/sleep 30')\n >>> cli.start(container=container.get('Id'))\n \"\"\"\n- if utils.compare_version('1.10', self._version) < 0:\n- if dns is not None:\n- raise errors.InvalidVersion(\n- 'dns is only supported for API version >= 1.10'\n- )\n- if volumes_from is not None:\n- raise errors.InvalidVersion(\n- 'volumes_from is only supported for API version >= 1.10'\n- )\n-\n- if utils.compare_version('1.15', self._version) < 0:\n- if security_opt is not None:\n- raise errors.InvalidVersion(\n- 'security_opt is only supported for API version >= 1.15'\n- )\n- if ipc_mode:\n- raise errors.InvalidVersion(\n- 'ipc_mode is only supported for API version >= 1.15'\n- )\n-\n- if utils.compare_version('1.17', self._version) < 0:\n- if read_only is not None:\n- raise errors.InvalidVersion(\n- 'read_only is only supported for API version >= 1.17'\n- )\n- if pid_mode is not None:\n- raise errors.InvalidVersion(\n- 'pid_mode is only supported for API version >= 1.17'\n- )\n-\n- if utils.compare_version('1.18', self._version) < 0:\n- if ulimits is not None:\n- raise errors.InvalidVersion(\n- 'ulimits is only supported for API version >= 1.18'\n- )\n-\n- start_config_kwargs = dict(\n- binds=binds, port_bindings=port_bindings, lxc_conf=lxc_conf,\n- publish_all_ports=publish_all_ports, links=links, dns=dns,\n- privileged=privileged, dns_search=dns_search, cap_add=cap_add,\n- cap_drop=cap_drop, volumes_from=volumes_from, devices=devices,\n- network_mode=network_mode, restart_policy=restart_policy,\n- extra_hosts=extra_hosts, read_only=read_only, pid_mode=pid_mode,\n- ipc_mode=ipc_mode, security_opt=security_opt, ulimits=ulimits,\n- )\n- start_config = None\n-\n- if any(v is not None for v in start_config_kwargs.values()):\n- if utils.compare_version('1.15', self._version) > 0:\n- warnings.warn(\n- 'Passing host config parameters in start() is deprecated. '\n- 'Please use host_config in create_container instead!',\n- DeprecationWarning\n- )\n- start_config = self.create_host_config(**start_config_kwargs)\n-\n+ if args or kwargs:\n+ raise errors.DeprecatedMethod(\n+ 'Providing configuration in the start() method is no longer '\n+ 'supported. Use the host_config param in create_container '\n+ 'instead.'\n+ )\n url = self._url(\"/containers/{0}/start\", container)\n- res = self._post_json(url, data=start_config)\n+ res = self._post(url)\n self._raise_for_status(res)\n \n @utils.minimum_version('1.17')\n"},"problem_statement":{"kind":"string","value":"Passing host_config parameters in start() overrides the host_config that was passed in create()?\nI had a `host_config` with `extra_hosts` defined. I used this `host_config` to create a container. When starting container, I passed extra volumes_from parameter. However, this lead to `extra_hosts` seemingly not doing their job. \n\nAfter I moved `volumes_from` from `start()` to `create_host_config` everything started working OK. \n\nI figured, I should report this, since I spent a couple of hours figuring this out. IMO, start() should override the necessary parts of host_config(and not the whole thing). Or raise an exception.\n"},"repo":{"kind":"string","value":"docker/docker-py"},"test_patch":{"kind":"string","value":"diff --git a/tests/unit/api_container_test.py b/tests/unit/api_container_test.py\nindex 6c080641..abf36138 100644\n--- a/tests/unit/api_container_test.py\n+++ b/tests/unit/api_container_test.py\n@@ -34,10 +34,7 @@ class StartContainerTest(BaseAPIClientTest):\n args[0][1],\n url_prefix + 'containers/3cc2351ab11b/start'\n )\n- self.assertEqual(json.loads(args[1]['data']), {})\n- self.assertEqual(\n- args[1]['headers'], {'Content-Type': 'application/json'}\n- )\n+ assert 'data' not in args[1]\n self.assertEqual(\n args[1]['timeout'], DEFAULT_TIMEOUT_SECONDS\n )\n@@ -63,25 +60,21 @@ class StartContainerTest(BaseAPIClientTest):\n self.client.start(**{'container': fake_api.FAKE_CONTAINER_ID})\n \n def test_start_container_with_lxc_conf(self):\n- def call_start():\n+ with pytest.raises(docker.errors.DeprecatedMethod):\n self.client.start(\n fake_api.FAKE_CONTAINER_ID,\n lxc_conf={'lxc.conf.k': 'lxc.conf.value'}\n )\n \n- pytest.deprecated_call(call_start)\n-\n def test_start_container_with_lxc_conf_compat(self):\n- def call_start():\n+ with pytest.raises(docker.errors.DeprecatedMethod):\n self.client.start(\n fake_api.FAKE_CONTAINER_ID,\n lxc_conf=[{'Key': 'lxc.conf.k', 'Value': 'lxc.conf.value'}]\n )\n \n- pytest.deprecated_call(call_start)\n-\n def test_start_container_with_binds_ro(self):\n- def call_start():\n+ with pytest.raises(docker.errors.DeprecatedMethod):\n self.client.start(\n fake_api.FAKE_CONTAINER_ID, binds={\n '/tmp': {\n@@ -91,22 +84,18 @@ class StartContainerTest(BaseAPIClientTest):\n }\n )\n \n- pytest.deprecated_call(call_start)\n-\n def test_start_container_with_binds_rw(self):\n- def call_start():\n+ with pytest.raises(docker.errors.DeprecatedMethod):\n self.client.start(\n fake_api.FAKE_CONTAINER_ID, binds={\n '/tmp': {\"bind\": '/mnt', \"ro\": False}\n }\n )\n \n- pytest.deprecated_call(call_start)\n-\n def test_start_container_with_port_binds(self):\n self.maxDiff = None\n \n- def call_start():\n+ with pytest.raises(docker.errors.DeprecatedMethod):\n self.client.start(fake_api.FAKE_CONTAINER_ID, port_bindings={\n 1111: None,\n 2222: 2222,\n@@ -116,18 +105,14 @@ class StartContainerTest(BaseAPIClientTest):\n 6666: [('127.0.0.1',), ('192.168.0.1',)]\n })\n \n- pytest.deprecated_call(call_start)\n-\n def test_start_container_with_links(self):\n- def call_start():\n+ with pytest.raises(docker.errors.DeprecatedMethod):\n self.client.start(\n fake_api.FAKE_CONTAINER_ID, links={'path': 'alias'}\n )\n \n- pytest.deprecated_call(call_start)\n-\n def test_start_container_with_multiple_links(self):\n- def call_start():\n+ with pytest.raises(docker.errors.DeprecatedMethod):\n self.client.start(\n fake_api.FAKE_CONTAINER_ID,\n links={\n@@ -136,21 +121,15 @@ class StartContainerTest(BaseAPIClientTest):\n }\n )\n \n- pytest.deprecated_call(call_start)\n-\n def test_start_container_with_links_as_list_of_tuples(self):\n- def call_start():\n+ with pytest.raises(docker.errors.DeprecatedMethod):\n self.client.start(fake_api.FAKE_CONTAINER_ID,\n links=[('path', 'alias')])\n \n- pytest.deprecated_call(call_start)\n-\n def test_start_container_privileged(self):\n- def call_start():\n+ with pytest.raises(docker.errors.DeprecatedMethod):\n self.client.start(fake_api.FAKE_CONTAINER_ID, privileged=True)\n \n- pytest.deprecated_call(call_start)\n-\n def test_start_container_with_dict_instead_of_id(self):\n self.client.start({'Id': fake_api.FAKE_CONTAINER_ID})\n \n@@ -159,10 +138,7 @@ class StartContainerTest(BaseAPIClientTest):\n args[0][1],\n url_prefix + 'containers/3cc2351ab11b/start'\n )\n- self.assertEqual(json.loads(args[1]['data']), {})\n- self.assertEqual(\n- args[1]['headers'], {'Content-Type': 'application/json'}\n- )\n+ assert 'data' not in args[1]\n self.assertEqual(\n args[1]['timeout'], DEFAULT_TIMEOUT_SECONDS\n )\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [],\n \"has_test_patch\": true,\n \"is_lite\": true,\n \"llm_score\": {\n \"difficulty_score\": 0,\n \"issue_text_score\": 0,\n \"test_score\": 0\n },\n \"num_modified_files\": 1\n}"},"version":{"kind":"string","value":"1.10"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .[dev]\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"requirements.txt\",\n \"pip_packages\": [\n \"pytest\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\n \"python\": \"3.5\",\n \"reqs_path\": [\n \"requirements.txt\"\n ],\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"attrs==22.2.0\ncertifi==2021.5.30\n-e git+https://github.com/docker/docker-py.git@4c8c761bc15160be5eaa76d81edda17b067aa641#egg=docker_py\ndocker-pycreds==0.2.1\nimportlib-metadata==4.8.3\niniconfig==1.1.1\npackaging==21.3\npluggy==1.0.0\npy==1.11.0\npyparsing==3.1.4\npytest==7.0.1\nrequests==2.11.1\nsix==1.17.0\ntomli==1.2.3\ntyping_extensions==4.1.1\nwebsocket-client==0.32.0\nzipp==3.6.0\n"},"environment":{"kind":"string","value":"name: docker-py\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2021.5.30=py36h06a4308_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.3=he6710b0_2\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - pip=21.2.2=py36h06a4308_0\n - python=3.6.13=h12debd9_1\n - readline=8.2=h5eee18b_0\n - setuptools=58.0.4=py36h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - wheel=0.37.1=pyhd3eb1b0_0\n - xz=5.6.4=h5eee18b_1\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - attrs==22.2.0\n - docker-pycreds==0.2.1\n - importlib-metadata==4.8.3\n - iniconfig==1.1.1\n - packaging==21.3\n - pluggy==1.0.0\n - py==1.11.0\n - pyparsing==3.1.4\n - pytest==7.0.1\n - requests==2.11.1\n - six==1.17.0\n - tomli==1.2.3\n - typing-extensions==4.1.1\n - websocket-client==0.32.0\n - zipp==3.6.0\nprefix: /opt/conda/envs/docker-py\n"},"FAIL_TO_PASS":{"kind":"list like","value":["tests/unit/api_container_test.py::StartContainerTest::test_start_container","tests/unit/api_container_test.py::StartContainerTest::test_start_container_privileged","tests/unit/api_container_test.py::StartContainerTest::test_start_container_with_binds_ro","tests/unit/api_container_test.py::StartContainerTest::test_start_container_with_binds_rw","tests/unit/api_container_test.py::StartContainerTest::test_start_container_with_dict_instead_of_id","tests/unit/api_container_test.py::StartContainerTest::test_start_container_with_links","tests/unit/api_container_test.py::StartContainerTest::test_start_container_with_links_as_list_of_tuples","tests/unit/api_container_test.py::StartContainerTest::test_start_container_with_lxc_conf","tests/unit/api_container_test.py::StartContainerTest::test_start_container_with_lxc_conf_compat","tests/unit/api_container_test.py::StartContainerTest::test_start_container_with_multiple_links","tests/unit/api_container_test.py::StartContainerTest::test_start_container_with_port_binds"],"string":"[\n \"tests/unit/api_container_test.py::StartContainerTest::test_start_container\",\n \"tests/unit/api_container_test.py::StartContainerTest::test_start_container_privileged\",\n \"tests/unit/api_container_test.py::StartContainerTest::test_start_container_with_binds_ro\",\n \"tests/unit/api_container_test.py::StartContainerTest::test_start_container_with_binds_rw\",\n \"tests/unit/api_container_test.py::StartContainerTest::test_start_container_with_dict_instead_of_id\",\n \"tests/unit/api_container_test.py::StartContainerTest::test_start_container_with_links\",\n \"tests/unit/api_container_test.py::StartContainerTest::test_start_container_with_links_as_list_of_tuples\",\n \"tests/unit/api_container_test.py::StartContainerTest::test_start_container_with_lxc_conf\",\n \"tests/unit/api_container_test.py::StartContainerTest::test_start_container_with_lxc_conf_compat\",\n \"tests/unit/api_container_test.py::StartContainerTest::test_start_container_with_multiple_links\",\n \"tests/unit/api_container_test.py::StartContainerTest::test_start_container_with_port_binds\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["tests/unit/api_container_test.py::StartContainerTest::test_start_container_none","tests/unit/api_container_test.py::StartContainerTest::test_start_container_regression_573","tests/unit/api_container_test.py::CreateContainerTest::test_create_container","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_empty_volumes_from","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_privileged","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_added_capabilities","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_aliases","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_binds","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_binds_list","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_binds_mode","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_binds_mode_and_ro_error","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_binds_ro","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_binds_rw","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_cgroup_parent","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_cpu_shares","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_cpuset","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_devices","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_dropped_capabilities","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_entrypoint","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_host_config_cpu_shares","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_host_config_cpuset","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_labels_dict","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_labels_list","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_links","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_links_as_list_of_tuples","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_lxc_conf","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_lxc_conf_compat","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_mac_address","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_mem_limit_as_int","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_mem_limit_as_string","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_mem_limit_as_string_with_g_unit","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_mem_limit_as_string_with_k_unit","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_mem_limit_as_string_with_m_unit","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_mem_limit_as_string_with_wrong_value","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_multiple_links","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_named_volume","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_port_binds","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_ports","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_restart_policy","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_stdin_open","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_stop_signal","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_sysctl","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_tmpfs_dict","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_tmpfs_list","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_unicode_envvars","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_volume_string","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_volumes_from","tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_working_dir","tests/unit/api_container_test.py::CreateContainerTest::test_create_named_container","tests/unit/api_container_test.py::ContainerTest::test_container_stats","tests/unit/api_container_test.py::ContainerTest::test_container_top","tests/unit/api_container_test.py::ContainerTest::test_container_top_with_psargs","tests/unit/api_container_test.py::ContainerTest::test_container_update","tests/unit/api_container_test.py::ContainerTest::test_diff","tests/unit/api_container_test.py::ContainerTest::test_diff_with_dict_instead_of_id","tests/unit/api_container_test.py::ContainerTest::test_export","tests/unit/api_container_test.py::ContainerTest::test_export_with_dict_instead_of_id","tests/unit/api_container_test.py::ContainerTest::test_inspect_container","tests/unit/api_container_test.py::ContainerTest::test_inspect_container_undefined_id","tests/unit/api_container_test.py::ContainerTest::test_kill_container","tests/unit/api_container_test.py::ContainerTest::test_kill_container_with_dict_instead_of_id","tests/unit/api_container_test.py::ContainerTest::test_kill_container_with_signal","tests/unit/api_container_test.py::ContainerTest::test_list_containers","tests/unit/api_container_test.py::ContainerTest::test_log_following","tests/unit/api_container_test.py::ContainerTest::test_log_following_backwards","tests/unit/api_container_test.py::ContainerTest::test_log_since","tests/unit/api_container_test.py::ContainerTest::test_log_since_with_datetime","tests/unit/api_container_test.py::ContainerTest::test_log_streaming","tests/unit/api_container_test.py::ContainerTest::test_log_streaming_and_following","tests/unit/api_container_test.py::ContainerTest::test_log_tail","tests/unit/api_container_test.py::ContainerTest::test_log_tty","tests/unit/api_container_test.py::ContainerTest::test_logs","tests/unit/api_container_test.py::ContainerTest::test_logs_with_dict_instead_of_id","tests/unit/api_container_test.py::ContainerTest::test_pause_container","tests/unit/api_container_test.py::ContainerTest::test_port","tests/unit/api_container_test.py::ContainerTest::test_remove_container","tests/unit/api_container_test.py::ContainerTest::test_remove_container_with_dict_instead_of_id","tests/unit/api_container_test.py::ContainerTest::test_rename_container","tests/unit/api_container_test.py::ContainerTest::test_resize_container","tests/unit/api_container_test.py::ContainerTest::test_restart_container","tests/unit/api_container_test.py::ContainerTest::test_restart_container_with_dict_instead_of_id","tests/unit/api_container_test.py::ContainerTest::test_stop_container","tests/unit/api_container_test.py::ContainerTest::test_stop_container_with_dict_instead_of_id","tests/unit/api_container_test.py::ContainerTest::test_unpause_container","tests/unit/api_container_test.py::ContainerTest::test_wait","tests/unit/api_container_test.py::ContainerTest::test_wait_with_dict_instead_of_id"],"string":"[\n \"tests/unit/api_container_test.py::StartContainerTest::test_start_container_none\",\n \"tests/unit/api_container_test.py::StartContainerTest::test_start_container_regression_573\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_empty_volumes_from\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_privileged\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_added_capabilities\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_aliases\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_binds\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_binds_list\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_binds_mode\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_binds_mode_and_ro_error\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_binds_ro\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_binds_rw\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_cgroup_parent\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_cpu_shares\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_cpuset\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_devices\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_dropped_capabilities\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_entrypoint\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_host_config_cpu_shares\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_host_config_cpuset\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_labels_dict\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_labels_list\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_links\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_links_as_list_of_tuples\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_lxc_conf\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_lxc_conf_compat\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_mac_address\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_mem_limit_as_int\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_mem_limit_as_string\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_mem_limit_as_string_with_g_unit\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_mem_limit_as_string_with_k_unit\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_mem_limit_as_string_with_m_unit\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_mem_limit_as_string_with_wrong_value\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_multiple_links\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_named_volume\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_port_binds\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_ports\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_restart_policy\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_stdin_open\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_stop_signal\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_sysctl\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_tmpfs_dict\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_tmpfs_list\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_unicode_envvars\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_volume_string\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_volumes_from\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_container_with_working_dir\",\n \"tests/unit/api_container_test.py::CreateContainerTest::test_create_named_container\",\n \"tests/unit/api_container_test.py::ContainerTest::test_container_stats\",\n \"tests/unit/api_container_test.py::ContainerTest::test_container_top\",\n \"tests/unit/api_container_test.py::ContainerTest::test_container_top_with_psargs\",\n \"tests/unit/api_container_test.py::ContainerTest::test_container_update\",\n \"tests/unit/api_container_test.py::ContainerTest::test_diff\",\n \"tests/unit/api_container_test.py::ContainerTest::test_diff_with_dict_instead_of_id\",\n \"tests/unit/api_container_test.py::ContainerTest::test_export\",\n \"tests/unit/api_container_test.py::ContainerTest::test_export_with_dict_instead_of_id\",\n \"tests/unit/api_container_test.py::ContainerTest::test_inspect_container\",\n \"tests/unit/api_container_test.py::ContainerTest::test_inspect_container_undefined_id\",\n \"tests/unit/api_container_test.py::ContainerTest::test_kill_container\",\n \"tests/unit/api_container_test.py::ContainerTest::test_kill_container_with_dict_instead_of_id\",\n \"tests/unit/api_container_test.py::ContainerTest::test_kill_container_with_signal\",\n \"tests/unit/api_container_test.py::ContainerTest::test_list_containers\",\n \"tests/unit/api_container_test.py::ContainerTest::test_log_following\",\n \"tests/unit/api_container_test.py::ContainerTest::test_log_following_backwards\",\n \"tests/unit/api_container_test.py::ContainerTest::test_log_since\",\n \"tests/unit/api_container_test.py::ContainerTest::test_log_since_with_datetime\",\n \"tests/unit/api_container_test.py::ContainerTest::test_log_streaming\",\n \"tests/unit/api_container_test.py::ContainerTest::test_log_streaming_and_following\",\n \"tests/unit/api_container_test.py::ContainerTest::test_log_tail\",\n \"tests/unit/api_container_test.py::ContainerTest::test_log_tty\",\n \"tests/unit/api_container_test.py::ContainerTest::test_logs\",\n \"tests/unit/api_container_test.py::ContainerTest::test_logs_with_dict_instead_of_id\",\n \"tests/unit/api_container_test.py::ContainerTest::test_pause_container\",\n \"tests/unit/api_container_test.py::ContainerTest::test_port\",\n \"tests/unit/api_container_test.py::ContainerTest::test_remove_container\",\n \"tests/unit/api_container_test.py::ContainerTest::test_remove_container_with_dict_instead_of_id\",\n \"tests/unit/api_container_test.py::ContainerTest::test_rename_container\",\n \"tests/unit/api_container_test.py::ContainerTest::test_resize_container\",\n \"tests/unit/api_container_test.py::ContainerTest::test_restart_container\",\n \"tests/unit/api_container_test.py::ContainerTest::test_restart_container_with_dict_instead_of_id\",\n \"tests/unit/api_container_test.py::ContainerTest::test_stop_container\",\n \"tests/unit/api_container_test.py::ContainerTest::test_stop_container_with_dict_instead_of_id\",\n \"tests/unit/api_container_test.py::ContainerTest::test_unpause_container\",\n \"tests/unit/api_container_test.py::ContainerTest::test_wait\",\n \"tests/unit/api_container_test.py::ContainerTest::test_wait_with_dict_instead_of_id\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"Apache License 2.0"},"__index_level_0__":{"kind":"number","value":270,"string":"270"}}},{"rowIdx":271,"cells":{"instance_id":{"kind":"string","value":"sympy__sympy-10029"},"base_commit":{"kind":"string","value":"41fc8f5a4dabd350f2f23a4aef53db728ca8ee0d"},"created_at":{"kind":"string","value":"2015-10-23 09:54:50"},"environment_setup_commit":{"kind":"string","value":"0241b35cae5f2adc04dc37b25f7dc9c5f00bd746"},"hints_text":{"kind":"string","value":"jksuom: ``oo**e`` could probably be best thought of as the limit of ``x**e`` for real ``x`` tending to ``oo``. If ``e`` is ``I``, then the limit does not exists, and ``nan`` could be used to indicate that. However, there are other values for which the limit exists. If the real part of ``e`` is positive, then the limit of ``|x**e|`` is ``oo``; so the limit of ``x**e`` is ``zoo``. If the real part of ``e`` is negative, then the limit is 0.\ngxyd: I was thinking in terms of consider examples:\r\nif `re(e) > 0` (for ex. `e = 1 + I`) then `oo**(1 + I)` should be equal to `oo**1*oo**I` now `oo**I` is `nan` then `oo*nan` is `nan`. Similarly for the `re(e) < 0` (for ex. `e = -1 + I`), `oo**(-1 + I)` should be equal to `oo**(-1)*oo**I = nan/0` equals `nan`.\ngxyd: Ok, may be in terms of what i thought would not apply here. Since it involves `oo`. Probably approach looks good.\ngxyd: Sorry, i have just updated it with one-more commit. :)\nleosartaj: No problem. :smile:\nasmeurer: I'm not a fan of seeing even more assumptions in the core, but this does fix a bug. \ngxyd: Is there any problem in the latest changes to the `docs` that i have made? Tests still seem to fail, only in `python2.7` perhaps.\nasmeurer: The is_number looks good. Perhaps you should just go ahead and move this in the direction of https://github.com/sympy/sympy/pull/9731 (and similar PRs by @debugger22) and only do automatic simplification from assumptions on things with is_number or is_Symbol, and move the more general simplification to `_eval_refine`. \ngxyd: Perhaps i am not very familiar with the assumptions in `SymPy`, so may be i will take a day, to understand what the code is doing. So i will get back in ASAP.\ngxyd: @asmeurer I have added a `_eval_refine` function in `Infinity` class, probably the way you referred to in your comment."},"patch":{"kind":"string","value":"diff --git a/sympy/core/numbers.py b/sympy/core/numbers.py\nindex f01d3c683e..627a03a5d3 100644\n--- a/sympy/core/numbers.py\n+++ b/sympy/core/numbers.py\n@@ -2464,6 +2464,8 @@ def _eval_power(self, expt):\n NegativeInfinity\n \n \"\"\"\n+ from sympy.functions import re\n+\n if expt.is_positive:\n return S.Infinity\n if expt.is_negative:\n@@ -2472,8 +2474,15 @@ def _eval_power(self, expt):\n return S.NaN\n if expt is S.ComplexInfinity:\n return S.NaN\n+ if expt.is_real is False and expt.is_number:\n+ expt_real = re(expt)\n+ if expt_real.is_positive:\n+ return S.ComplexInfinity\n+ if expt_real.is_negative:\n+ return S.Zero\n+ if expt_real.is_zero:\n+ return S.NaN\n \n- if expt.is_number:\n return self**expt.evalf()\n \n def _as_mpf_val(self, prec):\n@@ -2673,7 +2682,7 @@ def _eval_power(self, expt):\n NaN\n \n \"\"\"\n- if isinstance(expt, Number):\n+ if expt.is_number:\n if expt is S.NaN or \\\n expt is S.Infinity or \\\n expt is S.NegativeInfinity:\ndiff --git a/sympy/core/power.py b/sympy/core/power.py\nindex 42f6fef6b1..358d7d467e 100644\n--- a/sympy/core/power.py\n+++ b/sympy/core/power.py\n@@ -80,7 +80,7 @@ class Pow(Expr):\n \"\"\"\n Defines the expression x**y as \"x raised to a power y\"\n \n- Singleton definitions involving (0, 1, -1, oo, -oo):\n+ Singleton definitions involving (0, 1, -1, oo, -oo, I, -I):\n \n +--------------+---------+-----------------------------------------------+\n | expr | value | reason |\n@@ -124,6 +124,18 @@ class Pow(Expr):\n | (-oo)**oo | nan | |\n | (-oo)**-oo | | |\n +--------------+---------+-----------------------------------------------+\n+ | oo**I | nan | oo**e could probably be best thought of as |\n+ | (-oo)**I | | the limit of x**e for real x as x tends to |\n+ | | | oo. If e is I, then the limit does not exist |\n+ | | | and nan is used to indicate that. |\n+ +--------------+---------+-----------------------------------------------+\n+ | oo**(1+I) | zoo | If the real part of e is positive, then the |\n+ | (-oo)**(1+I) | | limit of abs(x**e) is oo. So the limit value |\n+ | | | is zoo. |\n+ +--------------+---------+-----------------------------------------------+\n+ | oo**(-1+I) | 0 | If the real part of e is negative, then the |\n+ | -oo**(-1+I) | | limit is 0. |\n+ +--------------+---------+-----------------------------------------------+\n \n Because symbolic computations are more flexible that floating point\n calculations and we prefer to never return an incorrect answer,\n"},"problem_statement":{"kind":"string","value":"oo**I raises RunTimeError\n```\r\ngxyd@swap:~/Public/sympy$ python3.4\r\nPython 3.4.3 (default, Jul 28 2015, 18:20:59) \r\n[GCC 4.8.4] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> from sympy import *\r\n>>> oo**I\r\nTraceback (most recent call last):\r\n File \"\", line 1, in \r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 77, in __sympifyit_wrapper\r\n return func(a, b)\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 118, in binary_op_wrapper\r\n return func(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/expr.py\", line 151, in __pow__\r\n return Pow(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/cache.py\", line 93, in wrapper\r\n retval = cfunc(*args, **kwargs)\r\n File \"/usr/lib/python3.4/functools.py\", line 472, in wrapper\r\n result = user_function(*args, **kwds)\r\n File \"/home/gxyd/Public/sympy/sympy/core/power.py\", line 192, in __new__\r\n obj = b._eval_power(e)\r\n File \"/home/gxyd/Public/sympy/sympy/core/numbers.py\", line 2474, in _eval_power\r\n return self**expt.evalf()\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 77, in __sympifyit_wrapper\r\n return func(a, b)\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 118, in binary_op_wrapper\r\n return func(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/expr.py\", line 151, in __pow__\r\n return Pow(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/cache.py\", line 93, in wrapper\r\n retval = cfunc(*args, **kwargs)\r\n File \"/usr/lib/python3.4/functools.py\", line 472, in wrapper\r\n result = user_function(*args, **kwds)\r\n File \"/home/gxyd/Public/sympy/sympy/core/power.py\", line 192, in __new__\r\n obj = b._eval_power(e)\r\n File \"/home/gxyd/Public/sympy/sympy/core/numbers.py\", line 2474, in _eval_power\r\n return self**expt.evalf()\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 77, in __sympifyit_wrapper\r\n return func(a, b)\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 118, in binary_op_wrapper\r\n return func(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/expr.py\", line 151, in __pow__\r\n return Pow(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/cache.py\", line 93, in wrapper\r\n retval = cfunc(*args, **kwargs)\r\n File \"/usr/lib/python3.4/functools.py\", line 472, in wrapper\r\n result = user_function(*args, **kwds)\r\n File \"/home/gxyd/Public/sympy/sympy/core/power.py\", line 192, in __new__\r\n obj = b._eval_power(e)\r\n File \"/home/gxyd/Public/sympy/sympy/core/numbers.py\", line 2474, in _eval_power\r\n return self**expt.evalf()\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 77, in __sympifyit_wrapper\r\n return func(a, b)\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 118, in binary_op_wrapper\r\n return func(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/expr.py\", line 151, in __pow__\r\n return Pow(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/cache.py\", line 93, in wrapper\r\n retval = cfunc(*args, **kwargs)\r\n File \"/usr/lib/python3.4/functools.py\", line 472, in wrapper\r\n result = user_function(*args, **kwds)\r\n File \"/home/gxyd/Public/sympy/sympy/core/power.py\", line 192, in __new__\r\n obj = b._eval_power(e)\r\n File \"/home/gxyd/Public/sympy/sympy/core/numbers.py\", line 2474, in _eval_power\r\n return self**expt.evalf()\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 77, in __sympifyit_wrapper\r\n return func(a, b)\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 118, in binary_op_wrapper\r\n return func(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/expr.py\", line 151, in __pow__\r\n return Pow(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/cache.py\", line 93, in wrapper\r\n retval = cfunc(*args, **kwargs)\r\n File \"/usr/lib/python3.4/functools.py\", line 472, in wrapper\r\n result = user_function(*args, **kwds)\r\n File \"/home/gxyd/Public/sympy/sympy/core/power.py\", line 192, in __new__\r\n obj = b._eval_power(e)\r\n File \"/home/gxyd/Public/sympy/sympy/core/numbers.py\", line 2474, in _eval_power\r\n return self**expt.evalf()\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 77, in __sympifyit_wrapper\r\n return func(a, b)\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 118, in binary_op_wrapper\r\n return func(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/expr.py\", line 151, in __pow__\r\n return Pow(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/cache.py\", line 93, in wrapper\r\n retval = cfunc(*args, **kwargs)\r\n File \"/usr/lib/python3.4/functools.py\", line 472, in wrapper\r\n result = user_function(*args, **kwds)\r\n File \"/home/gxyd/Public/sympy/sympy/core/power.py\", line 192, in __new__\r\n obj = b._eval_power(e)\r\n File \"/home/gxyd/Public/sympy/sympy/core/numbers.py\", line 2474, in _eval_power\r\n return self**expt.evalf()\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 77, in __sympifyit_wrapper\r\n return func(a, b)\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 118, in binary_op_wrapper\r\n return func(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/expr.py\", line 151, in __pow__\r\n return Pow(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/cache.py\", line 93, in wrapper\r\n retval = cfunc(*args, **kwargs)\r\n File \"/usr/lib/python3.4/functools.py\", line 472, in wrapper\r\n result = user_function(*args, **kwds)\r\n File \"/home/gxyd/Public/sympy/sympy/core/power.py\", line 192, in __new__\r\n obj = b._eval_power(e)\r\n File \"/home/gxyd/Public/sympy/sympy/core/numbers.py\", line 2474, in _eval_power\r\n return self**expt.evalf()\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 77, in __sympifyit_wrapper\r\n return func(a, b)\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 118, in binary_op_wrapper\r\n return func(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/expr.py\", line 151, in __pow__\r\n return Pow(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/cache.py\", line 93, in wrapper\r\n retval = cfunc(*args, **kwargs)\r\n File \"/usr/lib/python3.4/functools.py\", line 472, in wrapper\r\n result = user_function(*args, **kwds)\r\n File \"/home/gxyd/Public/sympy/sympy/core/power.py\", line 192, in __new__\r\n obj = b._eval_power(e)\r\n File \"/home/gxyd/Public/sympy/sympy/core/numbers.py\", line 2474, in _eval_power\r\n return self**expt.evalf()\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 77, in __sympifyit_wrapper\r\n return func(a, b)\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 118, in binary_op_wrapper\r\n return func(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/expr.py\", line 151, in __pow__\r\n return Pow(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/cache.py\", line 93, in wrapper\r\n retval = cfunc(*args, **kwargs)\r\n File \"/usr/lib/python3.4/functools.py\", line 472, in wrapper\r\n result = user_function(*args, **kwds)\r\n File \"/home/gxyd/Public/sympy/sympy/core/power.py\", line 192, in __new__\r\n obj = b._eval_power(e)\r\n File \"/home/gxyd/Public/sympy/sympy/core/numbers.py\", line 2474, in _eval_power\r\n return self**expt.evalf()\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 77, in __sympifyit_wrapper\r\n return func(a, b)\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 118, in binary_op_wrapper\r\n return func(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/expr.py\", line 151, in __pow__\r\n return Pow(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/cache.py\", line 93, in wrapper\r\n retval = cfunc(*args, **kwargs)\r\n File \"/usr/lib/python3.4/functools.py\", line 472, in wrapper\r\n result = user_function(*args, **kwds)\r\n File \"/home/gxyd/Public/sympy/sympy/core/power.py\", line 192, in __new__\r\n obj = b._eval_power(e)\r\n File \"/home/gxyd/Public/sympy/sympy/core/numbers.py\", line 2474, in _eval_power\r\n return self**expt.evalf()\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 77, in __sympifyit_wrapper\r\n return func(a, b)\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 118, in binary_op_wrapper\r\n return func(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/expr.py\", line 151, in __pow__\r\n return Pow(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/cache.py\", line 93, in wrapper\r\n retval = cfunc(*args, **kwargs)\r\n File \"/usr/lib/python3.4/functools.py\", line 472, in wrapper\r\n result = user_function(*args, **kwds)\r\n File \"/home/gxyd/Public/sympy/sympy/core/power.py\", line 192, in __new__\r\n obj = b._eval_power(e)\r\n File \"/home/gxyd/Public/sympy/sympy/core/numbers.py\", line 2474, in _eval_power\r\n return self**expt.evalf()\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 77, in __sympifyit_wrapper\r\n return func(a, b)\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 118, in binary_op_wrapper\r\n return func(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/expr.py\", line 151, in __pow__\r\n return Pow(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/cache.py\", line 93, in wrapper\r\n retval = cfunc(*args, **kwargs)\r\n File \"/usr/lib/python3.4/functools.py\", line 472, in wrapper\r\n result = user_function(*args, **kwds)\r\n File \"/home/gxyd/Public/sympy/sympy/core/power.py\", line 192, in __new__\r\n obj = b._eval_power(e)\r\n File \"/home/gxyd/Public/sympy/sympy/core/numbers.py\", line 2474, in _eval_power\r\n return self**expt.evalf()\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 77, in __sympifyit_wrapper\r\n return func(a, b)\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 118, in binary_op_wrapper\r\n return func(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/expr.py\", line 151, in __pow__\r\n return Pow(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/cache.py\", line 93, in wrapper\r\n retval = cfunc(*args, **kwargs)\r\n File \"/usr/lib/python3.4/functools.py\", line 472, in wrapper\r\n result = user_function(*args, **kwds)\r\n File \"/home/gxyd/Public/sympy/sympy/core/power.py\", line 192, in __new__\r\n obj = b._eval_power(e)\r\n File \"/home/gxyd/Public/sympy/sympy/core/numbers.py\", line 2474, in _eval_power\r\n return self**expt.evalf()\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 77, in __sympifyit_wrapper\r\n return func(a, b)\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 118, in binary_op_wrapper\r\n return func(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/expr.py\", line 151, in __pow__\r\n return Pow(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/cache.py\", line 93, in wrapper\r\n retval = cfunc(*args, **kwargs)\r\n File \"/usr/lib/python3.4/functools.py\", line 472, in wrapper\r\n result = user_function(*args, **kwds)\r\n File \"/home/gxyd/Public/sympy/sympy/core/power.py\", line 192, in __new__\r\n obj = b._eval_power(e)\r\n File \"/home/gxyd/Public/sympy/sympy/core/numbers.py\", line 2474, in _eval_power\r\n return self**expt.evalf()\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 77, in __sympifyit_wrapper\r\n return func(a, b)\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 118, in binary_op_wrapper\r\n return func(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/expr.py\", line 151, in __pow__\r\n return Pow(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/cache.py\", line 93, in wrapper\r\n retval = cfunc(*args, **kwargs)\r\n File \"/usr/lib/python3.4/functools.py\", line 472, in wrapper\r\n result = user_function(*args, **kwds)\r\n File \"/home/gxyd/Public/sympy/sympy/core/power.py\", line 192, in __new__\r\n obj = b._eval_power(e)\r\n File \"/home/gxyd/Public/sympy/sympy/core/numbers.py\", line 2474, in _eval_power\r\n return self**expt.evalf()\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 77, in __sympifyit_wrapper\r\n return func(a, b)\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 118, in binary_op_wrapper\r\n return func(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/expr.py\", line 151, in __pow__\r\n return Pow(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/cache.py\", line 93, in wrapper\r\n retval = cfunc(*args, **kwargs)\r\n File \"/usr/lib/python3.4/functools.py\", line 472, in wrapper\r\n result = user_function(*args, **kwds)\r\n File \"/home/gxyd/Public/sympy/sympy/core/power.py\", line 192, in __new__\r\n obj = b._eval_power(e)\r\n File \"/home/gxyd/Public/sympy/sympy/core/numbers.py\", line 2474, in _eval_power\r\n return self**expt.evalf()\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 77, in __sympifyit_wrapper\r\n return func(a, b)\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 118, in binary_op_wrapper\r\n return func(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/expr.py\", line 151, in __pow__\r\n return Pow(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/cache.py\", line 93, in wrapper\r\n retval = cfunc(*args, **kwargs)\r\n File \"/usr/lib/python3.4/functools.py\", line 472, in wrapper\r\n result = user_function(*args, **kwds)\r\n File \"/home/gxyd/Public/sympy/sympy/core/power.py\", line 192, in __new__\r\n obj = b._eval_power(e)\r\n File \"/home/gxyd/Public/sympy/sympy/core/numbers.py\", line 2474, in _eval_power\r\n return self**expt.evalf()\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 77, in __sympifyit_wrapper\r\n return func(a, b)\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 118, in binary_op_wrapper\r\n return func(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/expr.py\", line 151, in __pow__\r\n return Pow(self, other)\r\n File \"/home/gxyd/Public/sympy/sympy/core/cache.py\", line 93, in wrapper\r\n retval = cfunc(*args, **kwargs)\r\n File \"/usr/lib/python3.4/functools.py\", line 472, in wrapper\r\n result = user_function(*args, **kwds)\r\n File \"/home/gxyd/Public/sympy/sympy/core/power.py\", line 192, in __new__\r\n obj = b._eval_power(e)\r\n File \"/home/gxyd/Public/sympy/sympy/core/numbers.py\", line 2474, in _eval_power\r\n return self**expt.evalf()\r\n File \"/home/gxyd/Public/sympy/sympy/core/decorators.py\", line 77, in __sympifyit_wrapper\r\n return func(a, b)\r\nRuntimeError: maximum recursion depth exceeded while calling a Python object\r\n```\r\n\r\nSome part of traceback has been removed to keep it short"},"repo":{"kind":"string","value":"sympy/sympy"},"test_patch":{"kind":"string","value":"diff --git a/sympy/core/tests/test_numbers.py b/sympy/core/tests/test_numbers.py\nindex 2dd3da28ef..3179711555 100644\n--- a/sympy/core/tests/test_numbers.py\n+++ b/sympy/core/tests/test_numbers.py\n@@ -12,6 +12,7 @@\n from sympy.utilities.pytest import XFAIL, raises\n import mpmath\n \n+t = Symbol('t', real=False)\n \n def same_and_same_prec(a, b):\n # stricter matching for Floats\n@@ -1503,3 +1504,13 @@ def test_issue_9491():\n \n def test_issue_10063():\n assert 2**Float(3) == Float(8)\n+\n+\n+def test_issue_10020():\n+ assert oo**I is S.NaN\n+ assert oo**(1 + I) is S.ComplexInfinity\n+ assert oo**(-1 + I) is S.Zero\n+ assert (-oo)**I is S.NaN\n+ assert (-oo)**(-1 + I) is S.Zero\n+ assert oo**t == Pow(oo, t, evaluate=False)\n+ assert (-oo)**t == Pow(-oo, t, evaluate=False)\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_many_modified_files\",\n \"has_many_hunks\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 2,\n \"issue_text_score\": 0,\n \"test_score\": 3\n },\n \"num_modified_files\": 2\n}"},"version":{"kind":"string","value":"0.7"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"pytest\",\n \"pip_packages\": [\n \"pytest\"\n ],\n \"pre_install\": null,\n \"python\": \"3.7\",\n \"reqs_path\": null,\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"attrs @ file:///croot/attrs_1668696182826/work\ncertifi @ file:///croot/certifi_1671487769961/work/certifi\nflit_core @ file:///opt/conda/conda-bld/flit-core_1644941570762/work/source/flit_core\nimportlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1648562407465/work\niniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work\nmpmath==1.3.0\npackaging @ file:///croot/packaging_1671697413597/work\npluggy @ file:///tmp/build/80754af9/pluggy_1648042572264/work\npy @ file:///opt/conda/conda-bld/py_1644396412707/work\npytest==7.1.2\n-e git+https://github.com/sympy/sympy.git@41fc8f5a4dabd350f2f23a4aef53db728ca8ee0d#egg=sympy\ntomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work\ntyping_extensions @ file:///croot/typing_extensions_1669924550328/work\nzipp @ file:///croot/zipp_1672387121353/work\n"},"environment":{"kind":"string","value":"name: sympy\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - attrs=22.1.0=py37h06a4308_0\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2022.12.7=py37h06a4308_0\n - flit-core=3.6.0=pyhd3eb1b0_0\n - importlib-metadata=4.11.3=py37h06a4308_0\n - importlib_metadata=4.11.3=hd3eb1b0_0\n - iniconfig=1.1.1=pyhd3eb1b0_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.4.4=h6a678d5_1\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - packaging=22.0=py37h06a4308_0\n - pip=22.3.1=py37h06a4308_0\n - pluggy=1.0.0=py37h06a4308_1\n - py=1.11.0=pyhd3eb1b0_0\n - pytest=7.1.2=py37h06a4308_0\n - python=3.7.16=h7a1cb2a_0\n - readline=8.2=h5eee18b_0\n - setuptools=65.6.3=py37h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - tomli=2.0.1=py37h06a4308_0\n - typing_extensions=4.4.0=py37h06a4308_0\n - wheel=0.38.4=py37h06a4308_0\n - xz=5.6.4=h5eee18b_1\n - zipp=3.11.0=py37h06a4308_0\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - mpmath==1.3.0\nprefix: /opt/conda/envs/sympy\n"},"FAIL_TO_PASS":{"kind":"list like","value":["sympy/core/tests/test_numbers.py::test_issue_10020"],"string":"[\n \"sympy/core/tests/test_numbers.py::test_issue_10020\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["sympy/core/tests/test_numbers.py::test_integers_cache","sympy/core/tests/test_numbers.py::test_seterr","sympy/core/tests/test_numbers.py::test_mod","sympy/core/tests/test_numbers.py::test_divmod","sympy/core/tests/test_numbers.py::test_igcd","sympy/core/tests/test_numbers.py::test_ilcm","sympy/core/tests/test_numbers.py::test_igcdex","sympy/core/tests/test_numbers.py::test_Integer_new","sympy/core/tests/test_numbers.py::test_Rational_new","sympy/core/tests/test_numbers.py::test_Number_new","sympy/core/tests/test_numbers.py::test_Rational_cmp","sympy/core/tests/test_numbers.py::test_Float","sympy/core/tests/test_numbers.py::test_Float_default_to_highprec_from_str","sympy/core/tests/test_numbers.py::test_Float_eval","sympy/core/tests/test_numbers.py::test_Float_issue_2107","sympy/core/tests/test_numbers.py::test_Infinity","sympy/core/tests/test_numbers.py::test_Infinity_2","sympy/core/tests/test_numbers.py::test_Mul_Infinity_Zero","sympy/core/tests/test_numbers.py::test_Div_By_Zero","sympy/core/tests/test_numbers.py::test_Infinity_inequations","sympy/core/tests/test_numbers.py::test_NaN","sympy/core/tests/test_numbers.py::test_special_numbers","sympy/core/tests/test_numbers.py::test_powers","sympy/core/tests/test_numbers.py::test_integer_nthroot_overflow","sympy/core/tests/test_numbers.py::test_powers_Integer","sympy/core/tests/test_numbers.py::test_powers_Rational","sympy/core/tests/test_numbers.py::test_powers_Float","sympy/core/tests/test_numbers.py::test_abs1","sympy/core/tests/test_numbers.py::test_accept_int","sympy/core/tests/test_numbers.py::test_dont_accept_str","sympy/core/tests/test_numbers.py::test_int","sympy/core/tests/test_numbers.py::test_long","sympy/core/tests/test_numbers.py::test_real_bug","sympy/core/tests/test_numbers.py::test_bug_sqrt","sympy/core/tests/test_numbers.py::test_pi_Pi","sympy/core/tests/test_numbers.py::test_no_len","sympy/core/tests/test_numbers.py::test_issue_3321","sympy/core/tests/test_numbers.py::test_issue_3692","sympy/core/tests/test_numbers.py::test_issue_3423","sympy/core/tests/test_numbers.py::test_issue_3449","sympy/core/tests/test_numbers.py::test_Integer_factors","sympy/core/tests/test_numbers.py::test_Rational_factors","sympy/core/tests/test_numbers.py::test_issue_4107","sympy/core/tests/test_numbers.py::test_IntegerInteger","sympy/core/tests/test_numbers.py::test_Rational_gcd_lcm_cofactors","sympy/core/tests/test_numbers.py::test_Float_gcd_lcm_cofactors","sympy/core/tests/test_numbers.py::test_issue_4611","sympy/core/tests/test_numbers.py::test_conversion_to_mpmath","sympy/core/tests/test_numbers.py::test_relational","sympy/core/tests/test_numbers.py::test_Integer_as_index","sympy/core/tests/test_numbers.py::test_Rational_int","sympy/core/tests/test_numbers.py::test_zoo","sympy/core/tests/test_numbers.py::test_issue_4122","sympy/core/tests/test_numbers.py::test_GoldenRatio_expand","sympy/core/tests/test_numbers.py::test_as_content_primitive","sympy/core/tests/test_numbers.py::test_hashing_sympy_integers","sympy/core/tests/test_numbers.py::test_issue_4172","sympy/core/tests/test_numbers.py::test_Catalan_EulerGamma_prec","sympy/core/tests/test_numbers.py::test_Float_eq","sympy/core/tests/test_numbers.py::test_int_NumberSymbols","sympy/core/tests/test_numbers.py::test_issue_6640","sympy/core/tests/test_numbers.py::test_issue_6349","sympy/core/tests/test_numbers.py::test_mpf_norm","sympy/core/tests/test_numbers.py::test_latex","sympy/core/tests/test_numbers.py::test_issue_7742","sympy/core/tests/test_numbers.py::test_simplify_AlgebraicNumber","sympy/core/tests/test_numbers.py::test_Float_idempotence","sympy/core/tests/test_numbers.py::test_comp","sympy/core/tests/test_numbers.py::test_issue_9491","sympy/core/tests/test_numbers.py::test_issue_10063"],"string":"[\n \"sympy/core/tests/test_numbers.py::test_integers_cache\",\n \"sympy/core/tests/test_numbers.py::test_seterr\",\n \"sympy/core/tests/test_numbers.py::test_mod\",\n \"sympy/core/tests/test_numbers.py::test_divmod\",\n \"sympy/core/tests/test_numbers.py::test_igcd\",\n \"sympy/core/tests/test_numbers.py::test_ilcm\",\n \"sympy/core/tests/test_numbers.py::test_igcdex\",\n \"sympy/core/tests/test_numbers.py::test_Integer_new\",\n \"sympy/core/tests/test_numbers.py::test_Rational_new\",\n \"sympy/core/tests/test_numbers.py::test_Number_new\",\n \"sympy/core/tests/test_numbers.py::test_Rational_cmp\",\n \"sympy/core/tests/test_numbers.py::test_Float\",\n \"sympy/core/tests/test_numbers.py::test_Float_default_to_highprec_from_str\",\n \"sympy/core/tests/test_numbers.py::test_Float_eval\",\n \"sympy/core/tests/test_numbers.py::test_Float_issue_2107\",\n \"sympy/core/tests/test_numbers.py::test_Infinity\",\n \"sympy/core/tests/test_numbers.py::test_Infinity_2\",\n \"sympy/core/tests/test_numbers.py::test_Mul_Infinity_Zero\",\n \"sympy/core/tests/test_numbers.py::test_Div_By_Zero\",\n \"sympy/core/tests/test_numbers.py::test_Infinity_inequations\",\n \"sympy/core/tests/test_numbers.py::test_NaN\",\n \"sympy/core/tests/test_numbers.py::test_special_numbers\",\n \"sympy/core/tests/test_numbers.py::test_powers\",\n \"sympy/core/tests/test_numbers.py::test_integer_nthroot_overflow\",\n \"sympy/core/tests/test_numbers.py::test_powers_Integer\",\n \"sympy/core/tests/test_numbers.py::test_powers_Rational\",\n \"sympy/core/tests/test_numbers.py::test_powers_Float\",\n \"sympy/core/tests/test_numbers.py::test_abs1\",\n \"sympy/core/tests/test_numbers.py::test_accept_int\",\n \"sympy/core/tests/test_numbers.py::test_dont_accept_str\",\n \"sympy/core/tests/test_numbers.py::test_int\",\n \"sympy/core/tests/test_numbers.py::test_long\",\n \"sympy/core/tests/test_numbers.py::test_real_bug\",\n \"sympy/core/tests/test_numbers.py::test_bug_sqrt\",\n \"sympy/core/tests/test_numbers.py::test_pi_Pi\",\n \"sympy/core/tests/test_numbers.py::test_no_len\",\n \"sympy/core/tests/test_numbers.py::test_issue_3321\",\n \"sympy/core/tests/test_numbers.py::test_issue_3692\",\n \"sympy/core/tests/test_numbers.py::test_issue_3423\",\n \"sympy/core/tests/test_numbers.py::test_issue_3449\",\n \"sympy/core/tests/test_numbers.py::test_Integer_factors\",\n \"sympy/core/tests/test_numbers.py::test_Rational_factors\",\n \"sympy/core/tests/test_numbers.py::test_issue_4107\",\n \"sympy/core/tests/test_numbers.py::test_IntegerInteger\",\n \"sympy/core/tests/test_numbers.py::test_Rational_gcd_lcm_cofactors\",\n \"sympy/core/tests/test_numbers.py::test_Float_gcd_lcm_cofactors\",\n \"sympy/core/tests/test_numbers.py::test_issue_4611\",\n \"sympy/core/tests/test_numbers.py::test_conversion_to_mpmath\",\n \"sympy/core/tests/test_numbers.py::test_relational\",\n \"sympy/core/tests/test_numbers.py::test_Integer_as_index\",\n \"sympy/core/tests/test_numbers.py::test_Rational_int\",\n \"sympy/core/tests/test_numbers.py::test_zoo\",\n \"sympy/core/tests/test_numbers.py::test_issue_4122\",\n \"sympy/core/tests/test_numbers.py::test_GoldenRatio_expand\",\n \"sympy/core/tests/test_numbers.py::test_as_content_primitive\",\n \"sympy/core/tests/test_numbers.py::test_hashing_sympy_integers\",\n \"sympy/core/tests/test_numbers.py::test_issue_4172\",\n \"sympy/core/tests/test_numbers.py::test_Catalan_EulerGamma_prec\",\n \"sympy/core/tests/test_numbers.py::test_Float_eq\",\n \"sympy/core/tests/test_numbers.py::test_int_NumberSymbols\",\n \"sympy/core/tests/test_numbers.py::test_issue_6640\",\n \"sympy/core/tests/test_numbers.py::test_issue_6349\",\n \"sympy/core/tests/test_numbers.py::test_mpf_norm\",\n \"sympy/core/tests/test_numbers.py::test_latex\",\n \"sympy/core/tests/test_numbers.py::test_issue_7742\",\n \"sympy/core/tests/test_numbers.py::test_simplify_AlgebraicNumber\",\n \"sympy/core/tests/test_numbers.py::test_Float_idempotence\",\n \"sympy/core/tests/test_numbers.py::test_comp\",\n \"sympy/core/tests/test_numbers.py::test_issue_9491\",\n \"sympy/core/tests/test_numbers.py::test_issue_10063\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"BSD"},"__index_level_0__":{"kind":"number","value":271,"string":"271"}}},{"rowIdx":272,"cells":{"instance_id":{"kind":"string","value":"sympy__sympy-10032"},"base_commit":{"kind":"string","value":"4f3f9d0ef5d9552c1f34ac056728708571e567b0"},"created_at":{"kind":"string","value":"2015-10-23 22:12:05"},"environment_setup_commit":{"kind":"string","value":"0241b35cae5f2adc04dc37b25f7dc9c5f00bd746"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/sympy/solvers/inequalities.py b/sympy/solvers/inequalities.py\nindex 2013ed0fb9..ac58e9af99 100644\n--- a/sympy/solvers/inequalities.py\n+++ b/sympy/solvers/inequalities.py\n@@ -406,65 +406,71 @@ def solve_univariate_inequality(expr, gen, relational=True):\n _gen = gen\n gen = d\n \n- e = expr.lhs - expr.rhs\n- parts = n, d = e.as_numer_denom()\n- if all(i.is_polynomial(gen) for i in parts):\n- solns = solve(n, gen, check=False)\n- singularities = solve(d, gen, check=False)\n+ if expr is S.true:\n+ rv = S.Reals\n+ elif expr is S.false:\n+ rv = S.EmptySet\n else:\n- solns = solve(e, gen, check=False)\n- singularities = []\n- for d in denoms(e):\n- singularities.extend(solve(d, gen))\n+ e = expr.lhs - expr.rhs\n+ parts = n, d = e.as_numer_denom()\n+ if all(i.is_polynomial(gen) for i in parts):\n+ solns = solve(n, gen, check=False)\n+ singularities = solve(d, gen, check=False)\n+ else:\n+ solns = solve(e, gen, check=False)\n+ singularities = []\n+ for d in denoms(e):\n+ singularities.extend(solve(d, gen))\n+\n+ include_x = expr.func(0, 0)\n \n- include_x = expr.func(0, 0)\n+ def valid(x):\n+ v = e.subs(gen, x)\n+ try:\n+ r = expr.func(v, 0)\n+ except TypeError:\n+ r = S.false\n+ if r in (S.true, S.false):\n+ return r\n+ if v.is_real is False:\n+ return S.false\n+ else:\n+ v = v.n(2)\n+ if v.is_comparable:\n+ return expr.func(v, 0)\n+ return S.false\n \n- def valid(x):\n- v = e.subs(gen, x)\n+ start = S.NegativeInfinity\n+ sol_sets = [S.EmptySet]\n try:\n- r = expr.func(v, 0)\n- except TypeError:\n- r = S.false\n- if r in (S.true, S.false):\n- return r\n- if v.is_real is False:\n- return S.false\n- else:\n- v = v.n(2)\n- if v.is_comparable:\n- return expr.func(v, 0)\n- return S.false\n+ reals = _nsort(set(solns + singularities), separated=True)[0]\n+ except NotImplementedError:\n+ raise NotImplementedError('sorting of these roots is not supported')\n+ for x in reals:\n+ end = x\n \n- start = S.NegativeInfinity\n- sol_sets = [S.EmptySet]\n- try:\n- reals = _nsort(set(solns + singularities), separated=True)[0]\n- except NotImplementedError:\n- raise NotImplementedError('sorting of these roots is not supported')\n- for x in reals:\n- end = x\n-\n- if end in [S.NegativeInfinity, S.Infinity]:\n- if valid(S(0)):\n- sol_sets.append(Interval(start, S.Infinity, True, True))\n- break\n+ if end in [S.NegativeInfinity, S.Infinity]:\n+ if valid(S(0)):\n+ sol_sets.append(Interval(start, S.Infinity, True, True))\n+ break\n \n- if valid((start + end)/2 if start != S.NegativeInfinity else end - 1):\n- sol_sets.append(Interval(start, end, True, True))\n+ if valid((start + end)/2 if start != S.NegativeInfinity else end - 1):\n+ sol_sets.append(Interval(start, end, True, True))\n+\n+ if x in singularities:\n+ singularities.remove(x)\n+ elif include_x:\n+ sol_sets.append(FiniteSet(x))\n \n- if x in singularities:\n- singularities.remove(x)\n- elif include_x:\n- sol_sets.append(FiniteSet(x))\n+ start = end\n \n- start = end\n+ end = S.Infinity\n \n- end = S.Infinity\n+ if valid(start + 1):\n+ sol_sets.append(Interval(start, end, True, True))\n \n- if valid(start + 1):\n- sol_sets.append(Interval(start, end, True, True))\n+ rv = Union(*sol_sets).subs(gen, _gen)\n \n- rv = Union(*sol_sets).subs(gen, _gen)\n return rv if not relational else rv.as_relational(_gen)\n \n \n"},"problem_statement":{"kind":"string","value":"solve_univariate_inequality(x**2 >= 0, x) raises AttributeError\n```\r\n>>> x = Symbol('x')\r\n>>> solve_univariate_inequality(x**2 >= 0, x)\r\n\r\n---------------------------------------------------------------------------\r\nAttributeError Traceback (most recent call last)\r\n in ()\r\n----> 1 solve_univariate_inequality(x**2 >= 0, x)\r\n\r\n/home/gxyd/Public/sympy/sympy/solvers/inequalities.py in solve_univariate_inequality(expr, gen, relational)\r\n 407 gen = d\r\n 408 \r\n--> 409 e = expr.lhs - expr.rhs\r\n 410 parts = n, d = e.as_numer_denom()\r\n 411 if all(i.is_polynomial(gen) for i in parts):\r\n\r\nAttributeError: 'BooleanTrue' object has no attribute 'lhs'\r\n```\r\n\r\nUsing `git-bisect` reveals [this](https://github.com/shivamvats/sympy/commit/b4596e3e2fe339062d27a0a1104fea298e25dfdf) commit by @shivamvats \r\n```\r\ngxyd@swap:~/Public/sympy$ git bisect good \r\nBisecting: 263 revisions left to test after this (roughly 8 steps)\r\n[3517ef5e50bf0510c74c0434aff14766e160343c] Merge pull request #9803 from leosartaj/diffDelta\r\ngxyd@swap:~/Public/sympy$ git bisect bad\r\nBisecting: 137 revisions left to test after this (roughly 7 steps)\r\n[f4ad439372f377e4041b2a94e582815292616c3c] Fix test and docstring\r\ngxyd@swap:~/Public/sympy$ git bisect bad\r\nBisecting: 64 revisions left to test after this (roughly 6 steps)\r\n[0a850aaff35c353370400185a39cc958ae7b1e38] Merge pull request #9716 from aktech/sets-replace-solve\r\ngxyd@swap:~/Public/sympy$ git bisect good \r\nBisecting: 32 revisions left to test after this (roughly 5 steps)\r\n[49e2de008e4b8d0a666fd659510f49c24296971a] Merge pull request #9735 from gxyd/sphx_docs\r\ngxyd@swap:~/Public/sympy$ git bisect good \r\nBisecting: 20 revisions left to test after this (roughly 4 steps)\r\n[12c5f496815e58de8dd56ba9a8ef2518f401ecc4] `solveset_real` used instead of `singularities`\r\ngxyd@swap:~/Public/sympy$ git bisect good \r\nBisecting: 10 revisions left to test after this (roughly 3 steps)\r\n[7c696fcfdfcb0ed5c0b959163f64b21dfc1d61e2] Merge pull request #9719 from gxyd/Range_Function\r\ngxyd@swap:~/Public/sympy$ git bisect good \r\nBisecting: 5 revisions left to test after this (roughly 3 steps)\r\n[d2baf540c8341541c1a2197f7d7e76028f751242] Replace use of assumption with domain as argument to solveset\r\ngxyd@swap:~/Public/sympy$ git bisect good \r\nBisecting: 2 revisions left to test after this (roughly 2 steps)\r\n[5d1bf976f6b6eddd42463cdd4d1044d3a3ba68c9] Fix failing tests and use assumption with solve_univariate_inequality\r\ngxyd@swap:~/Public/sympy$ git bisect good \r\nBisecting: 0 revisions left to test after this (roughly 1 step)\r\n[f986e5950607118cb216488871a4d7a3e49851a3] Update docstring\r\ngxyd@swap:~/Public/sympy$ git bisect bad\r\nBisecting: 0 revisions left to test after this (roughly 0 steps)\r\n[b4596e3e2fe339062d27a0a1104fea298e25dfdf] Fix doc and use dummy variable in solve_univariate_inequality\r\ngxyd@swap:~/Public/sympy$ git bisect bad\r\nb4596e3e2fe339062d27a0a1104fea298e25dfdf is the first bad commit\r\ncommit b4596e3e2fe339062d27a0a1104fea298e25dfdf\r\nAuthor: Shivam Vats \r\nDate: Sun Aug 2 08:44:22 2015 +0530\r\n\r\n Fix doc and use dummy variable in solve_univariate_inequality\r\n\r\n:040000 040000 79e7b8b24aeee0d1700295b7e7b1f3d863d73f3c e5fc32bc649a14e349f935b3963b125c1d2af690 M\tsympy\r\n```"},"repo":{"kind":"string","value":"sympy/sympy"},"test_patch":{"kind":"string","value":"diff --git a/sympy/solvers/tests/test_inequalities.py b/sympy/solvers/tests/test_inequalities.py\nindex d0b6346062..13569bc9bc 100644\n--- a/sympy/solvers/tests/test_inequalities.py\n+++ b/sympy/solvers/tests/test_inequalities.py\n@@ -284,6 +284,13 @@ def test_solve_univariate_inequality():\n Or(And(-oo < x, x < 1), And(S(1) < x, x < 2))\n \n \n+def test_issue_9954():\n+ assert isolve(x**2 >= 0, x, relational=False) == S.Reals\n+ assert isolve(x**2 >= 0, x, relational=True) == S.Reals.as_relational(x)\n+ assert isolve(x**2 < 0, x, relational=False) == S.EmptySet\n+ assert isolve(x**2 < 0, x, relational=True) == S.EmptySet.as_relational(x)\n+\n+\n @slow\n def test_slow_general_univariate():\n r = RootOf(x**5 - x**2 + 1, 0)\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_hyperlinks\",\n \"has_git_commit_hash\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 1,\n \"issue_text_score\": 1,\n \"test_score\": 3\n },\n \"num_modified_files\": 1\n}"},"version":{"kind":"string","value":"0.7"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"pytest\",\n \"pip_packages\": [\n \"mpmath>=0.19\",\n \"pytest\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\n \"python\": \"3.7\",\n \"reqs_path\": null,\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"attrs @ file:///croot/attrs_1668696182826/work\ncertifi @ file:///croot/certifi_1671487769961/work/certifi\nflit_core @ file:///opt/conda/conda-bld/flit-core_1644941570762/work/source/flit_core\nimportlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1648562407465/work\niniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work\nmpmath==1.3.0\npackaging @ file:///croot/packaging_1671697413597/work\npluggy @ file:///tmp/build/80754af9/pluggy_1648042572264/work\npy @ file:///opt/conda/conda-bld/py_1644396412707/work\npytest==7.1.2\n-e git+https://github.com/sympy/sympy.git@4f3f9d0ef5d9552c1f34ac056728708571e567b0#egg=sympy\ntomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work\ntyping_extensions @ file:///croot/typing_extensions_1669924550328/work\nzipp @ file:///croot/zipp_1672387121353/work\n"},"environment":{"kind":"string","value":"name: sympy\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - attrs=22.1.0=py37h06a4308_0\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2022.12.7=py37h06a4308_0\n - flit-core=3.6.0=pyhd3eb1b0_0\n - importlib-metadata=4.11.3=py37h06a4308_0\n - importlib_metadata=4.11.3=hd3eb1b0_0\n - iniconfig=1.1.1=pyhd3eb1b0_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.4.4=h6a678d5_1\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - packaging=22.0=py37h06a4308_0\n - pip=22.3.1=py37h06a4308_0\n - pluggy=1.0.0=py37h06a4308_1\n - py=1.11.0=pyhd3eb1b0_0\n - pytest=7.1.2=py37h06a4308_0\n - python=3.7.16=h7a1cb2a_0\n - readline=8.2=h5eee18b_0\n - setuptools=65.6.3=py37h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - tomli=2.0.1=py37h06a4308_0\n - typing_extensions=4.4.0=py37h06a4308_0\n - wheel=0.38.4=py37h06a4308_0\n - xz=5.6.4=h5eee18b_1\n - zipp=3.11.0=py37h06a4308_0\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - mpmath==1.3.0\nprefix: /opt/conda/envs/sympy\n"},"FAIL_TO_PASS":{"kind":"list like","value":["sympy/solvers/tests/test_inequalities.py::test_issue_9954"],"string":"[\n \"sympy/solvers/tests/test_inequalities.py::test_issue_9954\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["sympy/solvers/tests/test_inequalities.py::test_solve_poly_inequality","sympy/solvers/tests/test_inequalities.py::test_reduce_poly_inequalities_real_interval","sympy/solvers/tests/test_inequalities.py::test_reduce_poly_inequalities_complex_relational","sympy/solvers/tests/test_inequalities.py::test_reduce_rational_inequalities_real_relational","sympy/solvers/tests/test_inequalities.py::test_reduce_abs_inequalities","sympy/solvers/tests/test_inequalities.py::test_reduce_inequalities_general","sympy/solvers/tests/test_inequalities.py::test_reduce_inequalities_boolean","sympy/solvers/tests/test_inequalities.py::test_reduce_inequalities_multivariate","sympy/solvers/tests/test_inequalities.py::test_reduce_inequalities_errors","sympy/solvers/tests/test_inequalities.py::test_hacky_inequalities","sympy/solvers/tests/test_inequalities.py::test_issue_6343","sympy/solvers/tests/test_inequalities.py::test_issue_8235","sympy/solvers/tests/test_inequalities.py::test_issue_5526","sympy/solvers/tests/test_inequalities.py::test_solve_univariate_inequality","sympy/solvers/tests/test_inequalities.py::test_slow_general_univariate","sympy/solvers/tests/test_inequalities.py::test_issue_8545","sympy/solvers/tests/test_inequalities.py::test_issue_8974"],"string":"[\n \"sympy/solvers/tests/test_inequalities.py::test_solve_poly_inequality\",\n \"sympy/solvers/tests/test_inequalities.py::test_reduce_poly_inequalities_real_interval\",\n \"sympy/solvers/tests/test_inequalities.py::test_reduce_poly_inequalities_complex_relational\",\n \"sympy/solvers/tests/test_inequalities.py::test_reduce_rational_inequalities_real_relational\",\n \"sympy/solvers/tests/test_inequalities.py::test_reduce_abs_inequalities\",\n \"sympy/solvers/tests/test_inequalities.py::test_reduce_inequalities_general\",\n \"sympy/solvers/tests/test_inequalities.py::test_reduce_inequalities_boolean\",\n \"sympy/solvers/tests/test_inequalities.py::test_reduce_inequalities_multivariate\",\n \"sympy/solvers/tests/test_inequalities.py::test_reduce_inequalities_errors\",\n \"sympy/solvers/tests/test_inequalities.py::test_hacky_inequalities\",\n \"sympy/solvers/tests/test_inequalities.py::test_issue_6343\",\n \"sympy/solvers/tests/test_inequalities.py::test_issue_8235\",\n \"sympy/solvers/tests/test_inequalities.py::test_issue_5526\",\n \"sympy/solvers/tests/test_inequalities.py::test_solve_univariate_inequality\",\n \"sympy/solvers/tests/test_inequalities.py::test_slow_general_univariate\",\n \"sympy/solvers/tests/test_inequalities.py::test_issue_8545\",\n \"sympy/solvers/tests/test_inequalities.py::test_issue_8974\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"BSD"},"__index_level_0__":{"kind":"number","value":272,"string":"272"}}},{"rowIdx":273,"cells":{"instance_id":{"kind":"string","value":"mogproject__mog-commons-python-8"},"base_commit":{"kind":"string","value":"71a072abdbeff70c14543ef9b307fae3277dc24a"},"created_at":{"kind":"string","value":"2015-10-24 16:43:22"},"environment_setup_commit":{"kind":"string","value":"0a6ffc13e621b0c2cbe35d20a6b938de570c0626"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/src/mog_commons/__init__.py b/src/mog_commons/__init__.py\nindex 8ce9b36..7525d19 100644\n--- a/src/mog_commons/__init__.py\n+++ b/src/mog_commons/__init__.py\n@@ -1,1 +1,1 @@\n-__version__ = '0.1.3'\n+__version__ = '0.1.4'\ndiff --git a/src/mog_commons/collection.py b/src/mog_commons/collection.py\nindex 21a8f62..621e572 100644\n--- a/src/mog_commons/collection.py\n+++ b/src/mog_commons/collection.py\n@@ -2,6 +2,8 @@ from __future__ import division, print_function, absolute_import, unicode_litera\n \n import six\n \n+__all__ = ['get_single_item', 'get_single_key', 'get_single_value', 'distinct']\n+\n \n def get_single_item(d):\n \"\"\"Get an item from a dict which contains just one item.\"\"\"\n@@ -19,3 +21,10 @@ def get_single_value(d):\n \"\"\"Get a value from a dict which contains just one item.\"\"\"\n assert len(d) == 1, 'Single-item dict must have just one item, not %d.' % len(d)\n return next(six.itervalues(d))\n+\n+\n+def distinct(xs):\n+ \"\"\"Get the list of distinct values with preserving order.\"\"\"\n+ # don't use collections.OrderedDict because we do support Python 2.6\n+ seen = set()\n+ return [x for x in xs if x not in seen and not seen.add(x)]\ndiff --git a/src/mog_commons/string.py b/src/mog_commons/string.py\nindex 0e6c894..321c6a2 100644\n--- a/src/mog_commons/string.py\n+++ b/src/mog_commons/string.py\n@@ -3,6 +3,21 @@ from __future__ import division, print_function, absolute_import, unicode_litera\n from unicodedata import east_asian_width\n import six\n \n+from mog_commons.collection import distinct\n+\n+__all__ = [\n+ 'is_unicode',\n+ 'is_strlike',\n+ 'unicode_width',\n+ 'to_unicode',\n+ 'to_str',\n+ 'to_bytes',\n+ 'edge_just',\n+ 'unicode_right',\n+ 'unicode_left',\n+ 'unicode_decode',\n+]\n+\n __unicode_width_mapping = {'F': 2, 'H': 1, 'W': 2, 'Na': 1, 'A': 2, 'N': 1}\n \n \n@@ -104,3 +119,22 @@ def unicode_right(s, width):\n break\n i -= 1\n return s[i:]\n+\n+\n+def unicode_decode(data, encoding_list):\n+ \"\"\"\n+ Decode string data with one or more encodings, trying sequentially\n+ :param data: bytes: encoded string data\n+ :param encoding_list: list[string] or string: encoding names\n+ :return: string: decoded string\n+ \"\"\"\n+ assert encoding_list, 'encodings must not be empty.'\n+\n+ xs = distinct(encoding_list if isinstance(encoding_list, list) else [encoding_list])\n+ init, last = xs[:-1], xs[-1]\n+ for encoding in init:\n+ try:\n+ return data.decode(encoding)\n+ except UnicodeDecodeError:\n+ pass\n+ return data.decode(last)\n"},"problem_statement":{"kind":"string","value":"Decode string with multiple encodings"},"repo":{"kind":"string","value":"mogproject/mog-commons-python"},"test_patch":{"kind":"string","value":"diff --git a/src/mog_commons/unittest.py b/src/mog_commons/unittest.py\nindex 27445ba..06bc135 100644\n--- a/src/mog_commons/unittest.py\n+++ b/src/mog_commons/unittest.py\n@@ -19,6 +19,7 @@ class StringBuffer(object):\n \n We don't use StringIO because there are many differences between PY2 and PY3.\n \"\"\"\n+\n def __init__(self, init_buffer=None):\n self._buffer = init_buffer or b''\n \n@@ -37,9 +38,17 @@ class StringBuffer(object):\n \n class TestCase(base_unittest.TestCase):\n def assertRaisesRegexp(self, expected_exception, expected_regexp, callable_obj=None, *args, **kwargs):\n- \"\"\"Accept difference of the function name between PY2 and PY3.\"\"\"\n- f = base_unittest.TestCase.assertRaisesRegex if six.PY3 else base_unittest.TestCase.assertRaisesRegexp\n- f(self, expected_exception, expected_regexp, callable_obj, *args, **kwargs)\n+ \"\"\"\n+ Accept difference of the function name between PY2 and PY3.\n+\n+ We don't use built-in assertRaisesRegexp because it is unicode-unsafe.\n+ \"\"\"\n+ with self.assertRaises(expected_exception) as cm:\n+ callable_obj(*args, **kwargs)\n+ if six.PY2:\n+ self.assertRegexpMatches(str(cm.exception), expected_regexp)\n+ else:\n+ self.assertRegex(str(cm.exception), expected_regexp)\n \n def assertOutput(self, expected_stdout, expected_stderr, function, encoding='utf-8'):\n with self.withOutput() as (out, err):\ndiff --git a/tests/mog_commons/test_collection.py b/tests/mog_commons/test_collection.py\nindex 2bd136e..da6fda2 100644\n--- a/tests/mog_commons/test_collection.py\n+++ b/tests/mog_commons/test_collection.py\n@@ -1,6 +1,6 @@\n from __future__ import division, print_function, absolute_import, unicode_literals\n \n-from mog_commons.collection import get_single_item, get_single_key, get_single_value\n+from mog_commons.collection import *\n from mog_commons import unittest\n \n \n@@ -31,3 +31,12 @@ class TestCollection(unittest.TestCase):\n {})\n self.assertRaisesRegexp(AssertionError, 'Single-item dict must have just one item, not 2.', get_single_value,\n {'x': 123, 'y': 45})\n+\n+ def test_distinct(self):\n+ self.assertEqual(distinct([]), [])\n+ self.assertEqual(distinct([1]), [1])\n+ self.assertEqual(distinct([1] * 100), [1])\n+ self.assertEqual(distinct([1, 2, 3, 4, 5]), [1, 2, 3, 4, 5])\n+ self.assertEqual(distinct([1, 2, 1, 2, 1]), [1, 2])\n+ self.assertEqual(distinct([2, 1, 2, 1, 1]), [2, 1])\n+ self.assertEqual(distinct('mog-commons-python'), ['m', 'o', 'g', '-', 'c', 'n', 's', 'p', 'y', 't', 'h'])\ndiff --git a/tests/mog_commons/test_string.py b/tests/mog_commons/test_string.py\nindex 2f00173..399abc8 100644\n--- a/tests/mog_commons/test_string.py\n+++ b/tests/mog_commons/test_string.py\n@@ -92,3 +92,19 @@ class TestString(unittest.TestCase):\n self.assertEqual(string.unicode_right('あいうえお', 11), 'あいうえお')\n self.assertEqual(string.unicode_right('あxいxうxえxお', 4), 'xお')\n self.assertEqual(string.unicode_right('あxいxうxえxお', 5), 'えxお')\n+\n+ def test_unicode_decode(self):\n+ self.assertRaisesRegexp(AssertionError, 'encodings must not be empty.', string.unicode_decode, 'abc', [])\n+ self.assertEqual(string.unicode_decode(b'abc', 'ascii'), 'abc')\n+ self.assertEqual(string.unicode_decode(b'abc', ['ascii']), 'abc')\n+ self.assertRaisesRegexp(\n+ UnicodeDecodeError, \"'ascii' codec can't decode\",\n+ string.unicode_decode, 'あいうえお'.encode('utf-8'), 'ascii')\n+ self.assertEqual(string.unicode_decode('あいうえお'.encode('utf-8'), ['ascii', 'sjis', 'utf-8']), 'あいうえお')\n+ self.assertEqual(string.unicode_decode('あいうえお'.encode('utf-8'), ['ascii', 'utf-8', 'sjis']), 'あいうえお')\n+ self.assertEqual(string.unicode_decode('あいうえお'.encode('utf-8'), ['utf-8', 'ascii', 'sjis']), 'あいうえお')\n+ self.assertEqual(string.unicode_decode('あいうえお'.encode('utf-8'), ['utf-8', 'utf-8', 'utf-8']), 'あいうえお')\n+ self.assertEqual(string.unicode_decode('あいうえお'.encode('sjis'), ['ascii', 'utf-8', 'sjis']), 'あいうえお')\n+ self.assertRaisesRegexp(\n+ UnicodeDecodeError, \"'shift_jis' codec can't decode\",\n+ string.unicode_decode, 'あいうえお'.encode('utf-8'), ['ascii', 'sjis'])\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_short_problem_statement\",\n \"has_many_modified_files\",\n \"has_many_hunks\",\n \"has_pytest_match_arg\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 2,\n \"issue_text_score\": 3,\n \"test_score\": 3\n },\n \"num_modified_files\": 3\n}"},"version":{"kind":"string","value":"0.1"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"pytest\",\n \"pip_packages\": [\n \"coverage\",\n \"coveralls\",\n \"pytest\"\n ],\n \"pre_install\": null,\n \"python\": \"3.4\",\n \"reqs_path\": null,\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work\ncertifi==2021.5.30\ncharset-normalizer==2.0.12\ncoverage==6.2\ncoveralls==3.3.1\ndocopt==0.6.2\nidna==3.10\nimportlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1631916693255/work\niniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work\nlinecache2==1.0.0\n-e git+https://github.com/mogproject/mog-commons-python.git@71a072abdbeff70c14543ef9b307fae3277dc24a#egg=mog_commons\nmore-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work\npackaging @ file:///tmp/build/80754af9/packaging_1637314298585/work\npluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work\npy @ file:///opt/conda/conda-bld/py_1644396412707/work\npyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work\npytest==6.2.4\nrequests==2.27.1\nsix==1.17.0\ntoml @ file:///tmp/build/80754af9/toml_1616166611790/work\ntraceback2==1.4.0\ntyping_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work\nunittest2==1.1.0\nurllib3==1.26.20\nzipp @ file:///tmp/build/80754af9/zipp_1633618647012/work\n"},"environment":{"kind":"string","value":"name: mog-commons-python\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - attrs=21.4.0=pyhd3eb1b0_0\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2021.5.30=py36h06a4308_0\n - importlib-metadata=4.8.1=py36h06a4308_0\n - importlib_metadata=4.8.1=hd3eb1b0_0\n - iniconfig=1.1.1=pyhd3eb1b0_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.3=he6710b0_2\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - more-itertools=8.12.0=pyhd3eb1b0_0\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - packaging=21.3=pyhd3eb1b0_0\n - pip=21.2.2=py36h06a4308_0\n - pluggy=0.13.1=py36h06a4308_0\n - py=1.11.0=pyhd3eb1b0_0\n - pyparsing=3.0.4=pyhd3eb1b0_0\n - pytest=6.2.4=py36h06a4308_2\n - python=3.6.13=h12debd9_1\n - readline=8.2=h5eee18b_0\n - setuptools=58.0.4=py36h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - toml=0.10.2=pyhd3eb1b0_0\n - typing_extensions=4.1.1=pyh06a4308_0\n - wheel=0.37.1=pyhd3eb1b0_0\n - xz=5.6.4=h5eee18b_1\n - zipp=3.6.0=pyhd3eb1b0_0\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - argparse==1.4.0\n - charset-normalizer==2.0.12\n - coverage==6.2\n - coveralls==3.3.1\n - docopt==0.6.2\n - idna==3.10\n - linecache2==1.0.0\n - requests==2.27.1\n - six==1.17.0\n - traceback2==1.4.0\n - unittest2==1.1.0\n - urllib3==1.26.20\nprefix: /opt/conda/envs/mog-commons-python\n"},"FAIL_TO_PASS":{"kind":"list like","value":["tests/mog_commons/test_collection.py::TestCollection::test_distinct","tests/mog_commons/test_string.py::TestString::test_unicode_decode"],"string":"[\n \"tests/mog_commons/test_collection.py::TestCollection::test_distinct\",\n \"tests/mog_commons/test_string.py::TestString::test_unicode_decode\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["tests/mog_commons/test_collection.py::TestCollection::test_get_single_item","tests/mog_commons/test_collection.py::TestCollection::test_get_single_item_error","tests/mog_commons/test_collection.py::TestCollection::test_get_single_key","tests/mog_commons/test_collection.py::TestCollection::test_get_single_key_error","tests/mog_commons/test_collection.py::TestCollection::test_get_single_value","tests/mog_commons/test_collection.py::TestCollection::test_get_single_value_error","tests/mog_commons/test_string.py::TestString::test_edge_just","tests/mog_commons/test_string.py::TestString::test_edge_just_unicode","tests/mog_commons/test_string.py::TestString::test_to_bytes","tests/mog_commons/test_string.py::TestString::test_to_str","tests/mog_commons/test_string.py::TestString::test_to_str_py3","tests/mog_commons/test_string.py::TestString::test_to_unicode","tests/mog_commons/test_string.py::TestString::test_unicode_left","tests/mog_commons/test_string.py::TestString::test_unicode_right","tests/mog_commons/test_string.py::TestString::test_unicode_width"],"string":"[\n \"tests/mog_commons/test_collection.py::TestCollection::test_get_single_item\",\n \"tests/mog_commons/test_collection.py::TestCollection::test_get_single_item_error\",\n \"tests/mog_commons/test_collection.py::TestCollection::test_get_single_key\",\n \"tests/mog_commons/test_collection.py::TestCollection::test_get_single_key_error\",\n \"tests/mog_commons/test_collection.py::TestCollection::test_get_single_value\",\n \"tests/mog_commons/test_collection.py::TestCollection::test_get_single_value_error\",\n \"tests/mog_commons/test_string.py::TestString::test_edge_just\",\n \"tests/mog_commons/test_string.py::TestString::test_edge_just_unicode\",\n \"tests/mog_commons/test_string.py::TestString::test_to_bytes\",\n \"tests/mog_commons/test_string.py::TestString::test_to_str\",\n \"tests/mog_commons/test_string.py::TestString::test_to_str_py3\",\n \"tests/mog_commons/test_string.py::TestString::test_to_unicode\",\n \"tests/mog_commons/test_string.py::TestString::test_unicode_left\",\n \"tests/mog_commons/test_string.py::TestString::test_unicode_right\",\n \"tests/mog_commons/test_string.py::TestString::test_unicode_width\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"Apache License 2.0"},"__index_level_0__":{"kind":"number","value":273,"string":"273"}}},{"rowIdx":274,"cells":{"instance_id":{"kind":"string","value":"davidhalter__jedi-641"},"base_commit":{"kind":"string","value":"e0753da6f1ed83185b84c0f9ab65eed67c80dcb4"},"created_at":{"kind":"string","value":"2015-10-24 23:35:37"},"environment_setup_commit":{"kind":"string","value":"2ba78ab725f1e02dfef8bc50b0204cf656e8ee23"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/AUTHORS.txt b/AUTHORS.txt\nindex 64aae316..bc258d6b 100644\n--- a/AUTHORS.txt\n+++ b/AUTHORS.txt\n@@ -33,5 +33,6 @@ Savor d'Isavano (@KenetJervet) \n Phillip Berndt (@phillipberndt) \n Ian Lee (@IanLee1521) \n Farkhad Khatamov (@hatamov) \n+Kevin Kelley (@kelleyk) \n \n Note: (@user) means a github user name.\ndiff --git a/jedi/api/classes.py b/jedi/api/classes.py\nindex a1d42bd0..75275dd2 100644\n--- a/jedi/api/classes.py\n+++ b/jedi/api/classes.py\n@@ -336,7 +336,7 @@ class BaseDefinition(object):\n raise AttributeError()\n followed = followed[0] # only check the first one.\n \n- if followed.type == 'funcdef':\n+ if followed.type in ('funcdef', 'lambda'):\n if isinstance(followed, er.InstanceElement):\n params = followed.params[1:]\n else:\ndiff --git a/jedi/parser/tree.py b/jedi/parser/tree.py\nindex 619067e1..899d5f1c 100644\n--- a/jedi/parser/tree.py\n+++ b/jedi/parser/tree.py\n@@ -748,6 +748,15 @@ def _create_params(parent, argslist_list):\n class Function(ClassOrFunc):\n \"\"\"\n Used to store the parsed contents of a python function.\n+\n+ Children:\n+ 0) \n+ 1) \n+ 2) parameter list (including open-paren and close-paren s)\n+ 3) \n+ 4) Node() representing function body\n+ 5) ??\n+ 6) annotation (if present)\n \"\"\"\n __slots__ = ('listeners',)\n type = 'funcdef'\n@@ -760,6 +769,7 @@ class Function(ClassOrFunc):\n \n @property\n def params(self):\n+ # Contents of parameter lit minus the leading and the trailing .\n return self.children[2].children[1:-1]\n \n @property\n@@ -791,10 +801,13 @@ class Function(ClassOrFunc):\n \n :rtype: str\n \"\"\"\n- func_name = func_name or self.children[1]\n- code = unicode(func_name) + self.children[2].get_code()\n+ func_name = func_name or self.name\n+ code = unicode(func_name) + self._get_paramlist_code()\n return '\\n'.join(textwrap.wrap(code, width))\n \n+ def _get_paramlist_code(self):\n+ return self.children[2].get_code()\n+ \n @property\n def doc(self):\n \"\"\" Return a document string including call signature. \"\"\"\n@@ -805,6 +818,12 @@ class Function(ClassOrFunc):\n class Lambda(Function):\n \"\"\"\n Lambdas are basically trimmed functions, so give it the same interface.\n+\n+ Children:\n+ 0) \n+ *) for each argument x\n+ -2) \n+ -1) Node() representing body\n \"\"\"\n type = 'lambda'\n __slots__ = ()\n@@ -813,9 +832,17 @@ class Lambda(Function):\n # We don't want to call the Function constructor, call its parent.\n super(Function, self).__init__(children)\n self.listeners = set() # not used here, but in evaluation.\n- lst = self.children[1:-2] # After `def foo`\n+ lst = self.children[1:-2] # Everything between `lambda` and the `:` operator is a parameter.\n self.children[1:-2] = _create_params(self, lst)\n \n+ @property\n+ def name(self):\n+ # Borrow the position of the AST node.\n+ return Name(self.children[0].position_modifier, '', self.children[0].start_pos)\n+\n+ def _get_paramlist_code(self):\n+ return '(' + ''.join(param.get_code() for param in self.params).strip() + ')'\n+ \n @property\n def params(self):\n return self.children[1:-2]\n@@ -823,6 +850,7 @@ class Lambda(Function):\n def is_generator(self):\n return False\n \n+ @property\n def yields(self):\n return []\n \n"},"problem_statement":{"kind":"string","value":"'Lambda' object has no attribute 'get_subscope_by_name'\nJedi 0.9.0, Python 2.7.3\r\n\r\nReproduction:\r\n\r\n```Python\r\nimport jedi\r\n\r\nscript = \"\"\"\\ \r\nmy_lambda = lambda x: x+1 \r\nmy_lambda(1) \r\n\"\"\"\r\n\r\nsigs = jedi.Script(script, line=2, column=11).call_signatures()\r\nprint sigs[0].index\r\n```\r\n\r\nTraceback:\r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"/home/forcer/Projects/elpy/elpy/rpc.py\", line 100, in handle_request\r\n result = method(*params)\r\n File \"/home/forcer/Projects/elpy/elpy/server.py\", line 87, in rpc_get_calltip\r\n get_source(source), offset)\r\n File \"/home/forcer/Projects/elpy/elpy/server.py\", line 49, in _call_backend\r\n return meth(*args, **kwargs)\r\n File \"/home/forcer/Projects/elpy/elpy/jedibackend.py\", line 129, in rpc_get_calltip\r\n \"index\": call.index,\r\n File \"/home/forcer/.virtualenvs/elpy/local/lib/python2.7/site-packages/jedi/api/classes.py\", line 653, in index\r\n if self._index >= len(self.params):\r\n File \"/home/forcer/.virtualenvs/elpy/local/lib/python2.7/site-packages/jedi/evaluate/cache.py\", line 41, in wrapper\r\n rv = function(obj, *args, **kwargs)\r\n File \"/home/forcer/.virtualenvs/elpy/local/lib/python2.7/site-packages/jedi/api/classes.py\", line 348, in params\r\n sub = followed.get_subscope_by_name('__init__')\r\n File \"/home/forcer/.virtualenvs/elpy/local/lib/python2.7/site-packages/jedi/evaluate/representation.py\", line 563, in __getattr__\r\n return getattr(self.base_func, name)\r\nAttributeError: 'Lambda' object has no attribute 'get_subscope_by_name'\r\n```"},"repo":{"kind":"string","value":"davidhalter/jedi"},"test_patch":{"kind":"string","value":"diff --git a/test/test_parser/test_parser_tree.py b/test/test_parser/test_parser_tree.py\nnew file mode 100644\nindex 00000000..480230ba\n--- /dev/null\n+++ b/test/test_parser/test_parser_tree.py\n@@ -0,0 +1,64 @@\n+# -*- coding: utf-8 # This file contains Unicode characters.\n+\n+from textwrap import dedent\n+\n+import pytest\n+\n+from jedi._compatibility import u, unicode\n+from jedi.parser import Parser, load_grammar\n+from jedi.parser import tree as pt\n+\n+\n+class TestsFunctionAndLambdaParsing(object):\n+\n+ FIXTURES = [\n+ ('def my_function(x, y, z):\\n return x + y * z\\n', {\n+ 'name': 'my_function',\n+ 'call_sig': 'my_function(x, y, z)',\n+ 'params': ['x', 'y', 'z'],\n+ }),\n+ ('lambda x, y, z: x + y * z\\n', {\n+ 'name': '',\n+ 'call_sig': '(x, y, z)',\n+ 'params': ['x', 'y', 'z'],\n+ }),\n+ ]\n+\n+ @pytest.fixture(params=FIXTURES)\n+ def node(self, request):\n+ parsed = Parser(load_grammar(), dedent(u(request.param[0])))\n+ request.keywords['expected'] = request.param[1]\n+ return parsed.module.subscopes[0]\n+\n+ @pytest.fixture()\n+ def expected(self, request, node):\n+ return request.keywords['expected']\n+ \n+ def test_name(self, node, expected):\n+ assert isinstance(node.name, pt.Name)\n+ assert unicode(node.name) == u(expected['name'])\n+ \n+ def test_params(self, node, expected):\n+ assert isinstance(node.params, list)\n+ assert all(isinstance(x, pt.Param) for x in node.params)\n+ assert [unicode(x.name) for x in node.params] == [u(x) for x in expected['params']]\n+\n+ def test_is_generator(self, node, expected):\n+ assert node.is_generator() is expected.get('is_generator', False)\n+\n+ def test_yields(self, node, expected):\n+ # TODO: There's a comment in the code noting that the current implementation is incorrect. This returns an\n+ # empty list at the moment (not e.g. False).\n+ if expected.get('yields', False):\n+ assert node.yields\n+ else:\n+ assert not node.yields\n+\n+ def test_annotation(self, node, expected):\n+ assert node.annotation() is expected.get('annotation', None)\n+\n+ def test_get_call_signature(self, node, expected):\n+ assert node.get_call_signature() == expected['call_sig']\n+\n+ def test_doc(self, node, expected):\n+ assert node.doc == expected.get('doc') or (expected['call_sig'] + '\\n\\n')\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_many_modified_files\",\n \"has_many_hunks\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 2,\n \"issue_text_score\": 0,\n \"test_score\": 2\n },\n \"num_modified_files\": 3\n}"},"version":{"kind":"string","value":"0.9"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"requirements.txt\",\n \"pip_packages\": [\n \"pytest\",\n \"pytest-cache\",\n \"docopt\",\n \"colorama\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\n \"python\": \"3.9\",\n \"reqs_path\": null,\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"colorama==0.4.6\ndocopt==0.6.2\nexceptiongroup==1.2.2\nexecnet==2.1.1\niniconfig==2.1.0\n-e git+https://github.com/davidhalter/jedi.git@e0753da6f1ed83185b84c0f9ab65eed67c80dcb4#egg=jedi\npackaging==24.2\npluggy==1.5.0\npytest==8.3.5\npytest-cache==1.0\ntomli==2.2.1\n"},"environment":{"kind":"string","value":"name: jedi\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - ca-certificates=2025.2.25=h06a4308_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.4.4=h6a678d5_1\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=3.0.16=h5eee18b_0\n - pip=25.0=py39h06a4308_0\n - python=3.9.21=he870216_1\n - readline=8.2=h5eee18b_0\n - setuptools=75.8.0=py39h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - tzdata=2025a=h04d1e81_0\n - wheel=0.45.1=py39h06a4308_0\n - xz=5.6.4=h5eee18b_1\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - colorama==0.4.6\n - docopt==0.6.2\n - exceptiongroup==1.2.2\n - execnet==2.1.1\n - iniconfig==2.1.0\n - packaging==24.2\n - pluggy==1.5.0\n - pytest==8.3.5\n - pytest-cache==1.0\n - tomli==2.2.1\nprefix: /opt/conda/envs/jedi\n"},"FAIL_TO_PASS":{"kind":"list like","value":["test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_name[node1]","test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_yields[node1]","test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_get_call_signature[node1]"],"string":"[\n \"test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_name[node1]\",\n \"test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_yields[node1]\",\n \"test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_get_call_signature[node1]\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_name[node0]","test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_params[node0]","test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_params[node1]","test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_is_generator[node0]","test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_is_generator[node1]","test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_yields[node0]","test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_annotation[node0]","test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_annotation[node1]","test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_get_call_signature[node0]","test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_doc[node0]","test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_doc[node1]"],"string":"[\n \"test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_name[node0]\",\n \"test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_params[node0]\",\n \"test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_params[node1]\",\n \"test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_is_generator[node0]\",\n \"test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_is_generator[node1]\",\n \"test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_yields[node0]\",\n \"test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_annotation[node0]\",\n \"test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_annotation[node1]\",\n \"test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_get_call_signature[node0]\",\n \"test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_doc[node0]\",\n \"test/test_parser/test_parser_tree.py::TestsFunctionAndLambdaParsing::test_doc[node1]\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"MIT License"},"__index_level_0__":{"kind":"number","value":274,"string":"274"}}},{"rowIdx":275,"cells":{"instance_id":{"kind":"string","value":"sphinx-gallery__sphinx-gallery-66"},"base_commit":{"kind":"string","value":"44a1460ae32ac278597cf5f56905fbe519fa025b"},"created_at":{"kind":"string","value":"2015-10-27 13:19:02"},"environment_setup_commit":{"kind":"string","value":"c1dbb14a7cc7ab8460a55999cffb5a1d90e9ab14"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/README.rst b/README.rst\nindex 327e8cd..f6e3d05 100644\n--- a/README.rst\n+++ b/README.rst\n@@ -49,10 +49,10 @@ After installing you need to include in your Sphinx ``conf.py`` file:\n \n .. code-block:: python\n \n- import sphinxgallery\n+ import sphinx_gallery\n extensions = [\n ...\n- 'sphinxgallery.gen_gallery',\n+ 'sphinx_gallery.gen_gallery',\n ]\n \n \ndiff --git a/doc/advanced_configuration.rst b/doc/advanced_configuration.rst\nindex e697a9c..269d567 100644\n--- a/doc/advanced_configuration.rst\n+++ b/doc/advanced_configuration.rst\n@@ -12,7 +12,7 @@ Within your Sphinx ``conf.py`` file you need to add a configuration dictionary:\n \n .. code-block:: python\n \n- sphinxgallery_conf = {\n+ sphinx_gallery_conf = {\n 'examples_dirs' : '../examples', # path to your examples scripts\n 'gallery_dirs' : 'auto_examples'} # path where to save gallery generated examples\n \n@@ -30,7 +30,7 @@ the sphinx configuration dictionary:\n \n .. code-block:: python\n \n- sphinxgallery_conf = {\n+ sphinx_gallery_conf = {\n 'examples_dirs' : ['../examples', '../tutorials'],\n 'gallery_dirs' : ['auto_examples', 'tutorials'],\n }\n@@ -60,10 +60,10 @@ dictionary within your Sphinx ``conf.py`` file :\n \n .. code-block:: python\n \n- sphinxgallery_conf = {\n+ sphinx_gallery_conf = {\n 'reference_url': {\n # The module you locally document uses a None\n- 'sphinxgallery': None,\n+ 'sphinx_gallery': None,\n \n # External python modules use their documentation websites\n 'matplotlib': 'http://matplotlib.org',\n@@ -84,12 +84,12 @@ configuration dictionary:\n \n .. code-block:: python\n \n- sphinxgallery_conf = {\n+ sphinx_gallery_conf = {\n # path where to store your example linker templates\n 'mod_example_dir' : 'modules/generated',\n \n # Your documented modules. You can use a string or a list of strings\n- 'doc_module' : ('sphinxgallery', 'numpy')}\n+ 'doc_module' : ('sphinx_gallery', 'numpy')}\n \n The path you specified will get populated with the links to examples using your\n module and their methods. Then within your sphinx documentation files you\n@@ -122,5 +122,5 @@ file. You need to add to the configuration dictionary a key called\n \n .. code-block:: python\n \n- sphinxgallery_conf = {\n+ sphinx_gallery_conf = {\n 'default_thumb_file' : 'path/to/thumb/file.png'}}\ndiff --git a/doc/conf.py b/doc/conf.py\nindex 9b2b7a2..daf448c 100644\n--- a/doc/conf.py\n+++ b/doc/conf.py\n@@ -15,7 +15,7 @@\n import sys\n import os\n from datetime import date\n-import sphinxgallery\n+import sphinx_gallery\n \n # If extensions (or modules to document with autodoc) are in another directory,\n # add these directories to sys.path here. If the directory is relative to the\n@@ -37,7 +37,7 @@ extensions = [\n 'sphinx.ext.todo',\n 'sphinx.ext.coverage',\n 'sphinx.ext.mathjax',\n- 'sphinxgallery.gen_gallery',\n+ 'sphinx_gallery.gen_gallery',\n ]\n \n # Add any paths that contain templates here, relative to this directory.\n@@ -61,9 +61,9 @@ copyright = u'2014-%s, Óscar Nájera' % date.today().year\n # built documents.\n #\n # The short X.Y version.\n-version = sphinxgallery.__version__\n+version = sphinx_gallery.__version__\n # The full version, including alpha/beta/rc tags.\n-release = sphinxgallery.__version__ + '-git'\n+release = sphinx_gallery.__version__ + '-git'\n \n # The language for content autogenerated by Sphinx. Refer to documentation\n # for a list of supported languages.\n@@ -291,10 +291,10 @@ except ImportError:\n find_mayavi_figures = False\n \n \n-sphinxgallery_conf = {\n- 'doc_module': ('sphinxgallery', 'numpy'),\n+sphinx_gallery_conf = {\n+ 'doc_module': ('sphinx_gallery', 'numpy'),\n 'reference_url': {\n- 'sphinxgallery': None,\n+ 'sphinx_gallery': None,\n 'matplotlib': 'http://matplotlib.org',\n 'numpy': 'http://docs.scipy.org/doc/numpy-1.9.1'},\n 'examples_dirs': examples_dirs,\ndiff --git a/doc/reference.rst b/doc/reference.rst\nindex 7d6c7e8..1df81a5 100644\n--- a/doc/reference.rst\n+++ b/doc/reference.rst\n@@ -3,25 +3,25 @@ Sphinx-Gallery Reference\n ========================\n \n \n-.. automodule:: sphinxgallery\n+.. automodule:: sphinx_gallery\n :members:\n \n-.. autodata:: sphinxgallery.__version__\n+.. autodata:: sphinx_gallery.__version__\n :annotation: Sphinx Gallery current version\n \n-.. include:: modules/generated/sphinxgallery.__version__.examples\n+.. include:: modules/generated/sphinx_gallery.__version__.examples\n .. raw:: html\n \n
\n \n-.. automodule:: sphinxgallery.gen_gallery\n+.. automodule:: sphinx_gallery.gen_gallery\n :members:\n \n-.. automodule:: sphinxgallery.backreferences\n+.. automodule:: sphinx_gallery.backreferences\n :members:\n \n-.. automodule:: sphinxgallery.gen_rst\n+.. automodule:: sphinx_gallery.gen_rst\n :members:\n \n-.. automodule:: sphinxgallery.docs_resolv\n+.. automodule:: sphinx_gallery.docs_resolv\n :members:\ndiff --git a/examples/plot_gallery_version.py b/examples/plot_gallery_version.py\nindex 7755616..bcd0cd8 100644\n--- a/examples/plot_gallery_version.py\n+++ b/examples/plot_gallery_version.py\n@@ -13,7 +13,7 @@ version.\n \n import numpy as np\n import matplotlib.pyplot as plt\n-import sphinxgallery\n+import sphinx_gallery\n \n np.random.seed(32)\n \n@@ -43,7 +43,7 @@ for mixture in d.T:\n mixture[[0, -1]] = 0.\n plt.fill(x, mixture, alpha=0.9)\n \n-plt.annotate('Introducing Sphinx-Gallery ' + sphinxgallery.__version__,\n+plt.annotate('Introducing Sphinx-Gallery ' + sphinx_gallery.__version__,\n xy=(12, 4), arrowprops=dict(arrowstyle='->'), xytext=(22, 6))\n \n plt.xticks([])\ndiff --git a/setup.cfg b/setup.cfg\nindex 4e2423b..4e43f4c 100644\n--- a/setup.cfg\n+++ b/setup.cfg\n@@ -2,7 +2,7 @@\n verbosity=1\n detailed-errors=1\n with-coverage=1\n-cover-package=sphinxgallery\n+cover-package=sphinx_gallery\n with-doctest=1\n doctest-extension=rst\n \ndiff --git a/setup.py b/setup.py\nindex d2808aa..a24015b 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -6,7 +6,7 @@ Installer Sphinx extension for gallery generator\n \"\"\"\n \n from setuptools import setup, find_packages\n-import sphinxgallery\n+import sphinx_gallery\n \n with open('README.rst') as f:\n long_description = f.read()\n@@ -16,9 +16,9 @@ setup(\n name=\"sphinx-gallery\",\n description=\"Sphinx extension to automatically generate an examples gallery\",\n long_description=long_description,\n- version=sphinxgallery.__version__,\n+ version=sphinx_gallery.__version__,\n packages=find_packages(),\n- package_data={'sphinxgallery': ['_static/gallery.css', '_static/no_image.png']},\n+ package_data={'sphinx_gallery': ['_static/gallery.css', '_static/no_image.png']},\n url=\"https://github.com/sphinx-gallery/sphinx-gallery\",\n author=\"Óscar Nájera\",\n author_email='najera.oscar@gmail.com',\ndiff --git a/sphinxgallery/__init__.py b/sphinx_gallery/__init__.py\nsimilarity index 100%\nrename from sphinxgallery/__init__.py\nrename to sphinx_gallery/__init__.py\ndiff --git a/sphinxgallery/_static/gallery.css b/sphinx_gallery/_static/gallery.css\nsimilarity index 100%\nrename from sphinxgallery/_static/gallery.css\nrename to sphinx_gallery/_static/gallery.css\ndiff --git a/sphinxgallery/_static/gallery.scss b/sphinx_gallery/_static/gallery.scss\nsimilarity index 100%\nrename from sphinxgallery/_static/gallery.scss\nrename to sphinx_gallery/_static/gallery.scss\ndiff --git a/sphinxgallery/_static/no_image.png b/sphinx_gallery/_static/no_image.png\nsimilarity index 100%\nrename from sphinxgallery/_static/no_image.png\nrename to sphinx_gallery/_static/no_image.png\ndiff --git a/sphinxgallery/backreferences.py b/sphinx_gallery/backreferences.py\nsimilarity index 100%\nrename from sphinxgallery/backreferences.py\nrename to sphinx_gallery/backreferences.py\ndiff --git a/sphinxgallery/docs_resolv.py b/sphinx_gallery/docs_resolv.py\nsimilarity index 99%\nrename from sphinxgallery/docs_resolv.py\nrename to sphinx_gallery/docs_resolv.py\nindex 7a04f4b..fb596fd 100644\n--- a/sphinxgallery/docs_resolv.py\n+++ b/sphinx_gallery/docs_resolv.py\n@@ -426,7 +426,7 @@ def embed_code_links(app, exception):\n \n print('Embedding documentation hyperlinks in examples..')\n \n- gallery_conf = app.config.sphinxgallery_conf\n+ gallery_conf = app.config.sphinx_gallery_conf\n \n gallery_dirs = gallery_conf['gallery_dirs']\n if not isinstance(gallery_dirs, list):\ndiff --git a/sphinxgallery/gen_gallery.py b/sphinx_gallery/gen_gallery.py\nsimilarity index 96%\nrename from sphinxgallery/gen_gallery.py\nrename to sphinx_gallery/gen_gallery.py\nindex 39eb931..22ae562 100644\n--- a/sphinxgallery/gen_gallery.py\n+++ b/sphinx_gallery/gen_gallery.py\n@@ -43,10 +43,10 @@ def generate_gallery_rst(app):\n except TypeError:\n plot_gallery = bool(app.builder.config.plot_gallery)\n \n- gallery_conf.update(app.config.sphinxgallery_conf)\n+ gallery_conf.update(app.config.sphinx_gallery_conf)\n \n # this assures I can call the config in other places\n- app.config.sphinxgallery_conf = gallery_conf\n+ app.config.sphinx_gallery_conf = gallery_conf\n app.config.html_static_path.append(glr_path_static())\n \n if not plot_gallery:\n@@ -104,7 +104,7 @@ gallery_conf = {\n def setup(app):\n \"\"\"Setup sphinx-gallery sphinx extension\"\"\"\n app.add_config_value('plot_gallery', True, 'html')\n- app.add_config_value('sphinxgallery_conf', gallery_conf, 'html')\n+ app.add_config_value('sphinx_gallery_conf', gallery_conf, 'html')\n app.add_stylesheet('gallery.css')\n \n app.connect('builder-inited', generate_gallery_rst)\n"},"problem_statement":{"kind":"string","value":"Rename package to sphinx_gallery rather than sphinxgallery?\nA very minor annoyance, but I thought I would vent it out and ask for opinions, it seems to me that sphinx_gallery for the package name is more in line with sphinx-gallery as the project name.\r\n\r\nBasically if people agree it would be wise to fix that sooner rather than later, to reduce the impact on potential users."},"repo":{"kind":"string","value":"sphinx-gallery/sphinx-gallery"},"test_patch":{"kind":"string","value":"diff --git a/sphinxgallery/gen_rst.py b/sphinx_gallery/gen_rst.py\nsimilarity index 100%\nrename from sphinxgallery/gen_rst.py\nrename to sphinx_gallery/gen_rst.py\ndiff --git a/sphinxgallery/tests/reference_parse.txt b/sphinx_gallery/tests/reference_parse.txt\nsimilarity index 100%\nrename from sphinxgallery/tests/reference_parse.txt\nrename to sphinx_gallery/tests/reference_parse.txt\ndiff --git a/sphinxgallery/tests/test_backreferences.py b/sphinx_gallery/tests/test_backreferences.py\nsimilarity index 96%\nrename from sphinxgallery/tests/test_backreferences.py\nrename to sphinx_gallery/tests/test_backreferences.py\nindex d11deb3..ca1542b 100644\n--- a/sphinxgallery/tests/test_backreferences.py\n+++ b/sphinx_gallery/tests/test_backreferences.py\n@@ -5,7 +5,7 @@\n Testing the rst files generator\n \"\"\"\n from __future__ import division, absolute_import, print_function\n-import sphinxgallery.backreferences as sg\n+import sphinx_gallery.backreferences as sg\n from nose.tools import assert_equal\n \n \ndiff --git a/sphinxgallery/tests/test_docs_resolv.py b/sphinx_gallery/tests/test_docs_resolv.py\nsimilarity index 96%\nrename from sphinxgallery/tests/test_docs_resolv.py\nrename to sphinx_gallery/tests/test_docs_resolv.py\nindex a858834..7162910 100644\n--- a/sphinxgallery/tests/test_docs_resolv.py\n+++ b/sphinx_gallery/tests/test_docs_resolv.py\n@@ -5,7 +5,7 @@\n Testing the rst files generator\n \"\"\"\n from __future__ import division, absolute_import, print_function\n-import sphinxgallery.docs_resolv as sg\n+import sphinx_gallery.docs_resolv as sg\n import tempfile\n import sys\n from nose.tools import assert_equal\ndiff --git a/sphinxgallery/tests/test_gen_rst.py b/sphinx_gallery/tests/test_gen_rst.py\nsimilarity index 96%\nrename from sphinxgallery/tests/test_gen_rst.py\nrename to sphinx_gallery/tests/test_gen_rst.py\nindex 8914ab6..4fb7854 100644\n--- a/sphinxgallery/tests/test_gen_rst.py\n+++ b/sphinx_gallery/tests/test_gen_rst.py\n@@ -7,7 +7,7 @@ Testing the rst files generator\n from __future__ import division, absolute_import, print_function\n import tempfile\n \n-import sphinxgallery.gen_rst as sg\n+import sphinx_gallery.gen_rst as sg\n from nose.tools import assert_equal, assert_false\n import ast\n \n@@ -25,7 +25,7 @@ def test_bug_cases_of_notebook_syntax():\n \"\"\"Test over the known requirements of supported syntax in the\n notebook styled comments\"\"\"\n \n- with open('sphinxgallery/tests/reference_parse.txt') as reference:\n+ with open('sphinx_gallery/tests/reference_parse.txt') as reference:\n ref_blocks = ast.literal_eval(reference.read())\n blocks = sg.split_code_and_text_blocks('tutorials/plot_parse.py')\n \n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_many_modified_files\",\n \"has_many_hunks\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 0,\n \"issue_text_score\": 0,\n \"test_score\": 3\n },\n \"num_modified_files\": 9\n}"},"version":{"kind":"string","value":"0.0"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"requirements.txt\",\n \"pip_packages\": [\n \"pytest\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\n \"python\": \"3.9\",\n \"reqs_path\": [\n \"requirements.txt\"\n ],\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"alabaster==0.7.16\nbabel==2.17.0\ncertifi==2025.1.31\ncharset-normalizer==3.4.1\ncontourpy==1.3.0\ncycler==0.12.1\ndocutils==0.21.2\nexceptiongroup==1.2.2\nfonttools==4.56.0\nidna==3.10\nimagesize==1.4.1\nimportlib_metadata==8.6.1\nimportlib_resources==6.5.2\niniconfig==2.1.0\nJinja2==3.1.6\nkiwisolver==1.4.7\nMarkupSafe==3.0.2\nmatplotlib==3.9.4\nnose==1.3.7\nnumpy==2.0.2\npackaging==24.2\npillow==11.1.0\npluggy==1.5.0\nPygments==2.19.1\npyparsing==3.2.3\npytest==8.3.5\npython-dateutil==2.9.0.post0\nrequests==2.32.3\nsix==1.17.0\nsnowballstemmer==2.2.0\nSphinx==7.4.7\n-e git+https://github.com/sphinx-gallery/sphinx-gallery.git@44a1460ae32ac278597cf5f56905fbe519fa025b#egg=sphinx_gallery\nsphinxcontrib-applehelp==2.0.0\nsphinxcontrib-devhelp==2.0.0\nsphinxcontrib-htmlhelp==2.1.0\nsphinxcontrib-jsmath==1.0.1\nsphinxcontrib-qthelp==2.0.0\nsphinxcontrib-serializinghtml==2.0.0\ntomli==2.2.1\nurllib3==2.3.0\nzipp==3.21.0\n"},"environment":{"kind":"string","value":"name: sphinx-gallery\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - ca-certificates=2025.2.25=h06a4308_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.4.4=h6a678d5_1\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=3.0.16=h5eee18b_0\n - pip=25.0=py39h06a4308_0\n - python=3.9.21=he870216_1\n - readline=8.2=h5eee18b_0\n - setuptools=75.8.0=py39h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - tzdata=2025a=h04d1e81_0\n - wheel=0.45.1=py39h06a4308_0\n - xz=5.6.4=h5eee18b_1\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - alabaster==0.7.16\n - babel==2.17.0\n - certifi==2025.1.31\n - charset-normalizer==3.4.1\n - contourpy==1.3.0\n - cycler==0.12.1\n - docutils==0.21.2\n - exceptiongroup==1.2.2\n - fonttools==4.56.0\n - idna==3.10\n - imagesize==1.4.1\n - importlib-metadata==8.6.1\n - importlib-resources==6.5.2\n - iniconfig==2.1.0\n - jinja2==3.1.6\n - kiwisolver==1.4.7\n - markupsafe==3.0.2\n - matplotlib==3.9.4\n - nose==1.3.7\n - numpy==2.0.2\n - packaging==24.2\n - pillow==11.1.0\n - pluggy==1.5.0\n - pygments==2.19.1\n - pyparsing==3.2.3\n - pytest==8.3.5\n - python-dateutil==2.9.0.post0\n - requests==2.32.3\n - six==1.17.0\n - snowballstemmer==2.2.0\n - sphinx==7.4.7\n - sphinxcontrib-applehelp==2.0.0\n - sphinxcontrib-devhelp==2.0.0\n - sphinxcontrib-htmlhelp==2.1.0\n - sphinxcontrib-jsmath==1.0.1\n - sphinxcontrib-qthelp==2.0.0\n - sphinxcontrib-serializinghtml==2.0.0\n - tomli==2.2.1\n - urllib3==2.3.0\n - zipp==3.21.0\nprefix: /opt/conda/envs/sphinx-gallery\n"},"FAIL_TO_PASS":{"kind":"list like","value":["sphinx_gallery/tests/test_backreferences.py::test_thumbnail_div","sphinx_gallery/tests/test_backreferences.py::test_backref_thumbnail_div","sphinx_gallery/tests/test_docs_resolv.py::test_shelve","sphinx_gallery/tests/test_gen_rst.py::test_split_code_and_text_blocks","sphinx_gallery/tests/test_gen_rst.py::test_direct_comment_after_docstring","sphinx_gallery/tests/test_gen_rst.py::test_codestr2rst","sphinx_gallery/tests/test_gen_rst.py::test_extract_intro"],"string":"[\n \"sphinx_gallery/tests/test_backreferences.py::test_thumbnail_div\",\n \"sphinx_gallery/tests/test_backreferences.py::test_backref_thumbnail_div\",\n \"sphinx_gallery/tests/test_docs_resolv.py::test_shelve\",\n \"sphinx_gallery/tests/test_gen_rst.py::test_split_code_and_text_blocks\",\n \"sphinx_gallery/tests/test_gen_rst.py::test_direct_comment_after_docstring\",\n \"sphinx_gallery/tests/test_gen_rst.py::test_codestr2rst\",\n \"sphinx_gallery/tests/test_gen_rst.py::test_extract_intro\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":["sphinx_gallery/tests/test_gen_rst.py::test_bug_cases_of_notebook_syntax"],"string":"[\n \"sphinx_gallery/tests/test_gen_rst.py::test_bug_cases_of_notebook_syntax\"\n]"},"PASS_TO_PASS":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"BSD 3-Clause \"New\" or \"Revised\" License"},"__index_level_0__":{"kind":"number","value":275,"string":"275"}}},{"rowIdx":276,"cells":{"instance_id":{"kind":"string","value":"pystorm__pystorm-14"},"base_commit":{"kind":"string","value":"111356b63c7a44261fb4d0c827745e793ca8717e"},"created_at":{"kind":"string","value":"2015-10-27 16:46:13"},"environment_setup_commit":{"kind":"string","value":"eaa0bf28f57e43950379dfaabac7174ad5db4740"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/pystorm/component.py b/pystorm/component.py\nindex 23d82e8..80c5abf 100644\n--- a/pystorm/component.py\n+++ b/pystorm/component.py\n@@ -3,14 +3,17 @@ from __future__ import absolute_import, print_function, unicode_literals\n \n import logging\n import os\n+import re\n import signal\n import sys\n-from collections import deque, namedtuple\n+from collections import defaultdict, deque, namedtuple\n from logging.handlers import RotatingFileHandler\n from os.path import join\n from threading import RLock\n from traceback import format_exc\n \n+from six import iteritems\n+\n from .exceptions import StormWentAwayError\n from .serializers.msgpack_serializer import MsgpackSerializer\n from .serializers.json_serializer import JSONSerializer\n@@ -36,6 +39,9 @@ _PYTHON_LOG_LEVELS = {'critical': logging.CRITICAL,\n 'debug': logging.DEBUG,\n 'trace': logging.DEBUG}\n _SERIALIZERS = {\"json\": JSONSerializer, \"msgpack\": MsgpackSerializer}\n+# Convert names to valid Python identifiers by replacing non-word characters\n+# whitespace and leading digits with underscores.\n+_IDENTIFIER_RE = re.compile(r'\\W|^(?=\\d)')\n \n \n log = logging.getLogger(__name__)\n@@ -121,7 +127,7 @@ Tuple = namedtuple('Tuple', 'id component stream task values')\n :ivar task: the task the Tuple was generated from.\n :type task: int\n :ivar values: the payload of the Tuple where data is stored.\n-:type values: list\n+:type values: tuple (or namedtuple for Storm 0.10.0+)\n \"\"\"\n \n \n@@ -177,6 +183,7 @@ class Component(object):\n self.context = None\n self.pid = os.getpid()\n self.logger = None\n+ self._source_tuple_types = defaultdict(dict)\n # pending commands/Tuples we read while trying to read task IDs\n self._pending_commands = deque()\n # pending task IDs we read while trying to read commands/Tuples\n@@ -207,6 +214,15 @@ class Component(object):\n self.topology_name = storm_conf.get('topology.name', '')\n self.task_id = context.get('taskid', '')\n self.component_name = context.get('componentid')\n+ # source->stream->fields requires Storm 0.10.0 or later\n+ source_stream_fields = context.get('source->stream->fields', {})\n+ for source, stream_fields in iteritems(source_stream_fields):\n+ for stream, fields in iteritems(stream_fields):\n+ type_name = (_IDENTIFIER_RE.sub('_', source.title()) +\n+ _IDENTIFIER_RE.sub('_', stream.title()) +\n+ 'Tuple')\n+ self._source_tuple_types[source][stream] = namedtuple(type_name,\n+ fields)\n # If using Storm before 0.10.0 componentid is not available\n if self.component_name is None:\n self.component_name = context.get('task->component', {})\\\n@@ -280,8 +296,12 @@ class Component(object):\n \n def read_tuple(self):\n cmd = self.read_command()\n- return Tuple(cmd['id'], cmd['comp'], cmd['stream'], cmd['task'],\n- cmd['tuple'])\n+ source = cmd['comp']\n+ stream = cmd['stream']\n+ values = cmd['tuple']\n+ val_type = self._source_tuple_types[source].get(stream)\n+ return Tuple(cmd['id'], source, stream, cmd['task'],\n+ tuple(values) if val_type is None else val_type(*values))\n \n def read_handshake(self):\n \"\"\"Read and process an initial handshake message from Storm.\"\"\"\n"},"problem_statement":{"kind":"string","value":"Have Tuple.values be a namedtuple so fields can be accessed by name\n_From @dan-blanchard on April 15, 2015 13:57_\r\n\r\nThis was brought up as part of our discussion of the rejected #120. What we want to do is:\r\n\r\n- [x] Submit a PR to Storm that serializes [`TopologyContext.componentToStreamToFields`](https://github.com/apache/storm/blob/master/storm-core/src/jvm/backtype/storm/task/TopologyContext.java#L61) and sends that along as part of Multi-Lang handshake.\r\n- [x] Add a `_stream_fields` dictionary attribute to the `Component` class that maps from streams to `namedtuple` types representing the names of fields/values in the tuple. This should get created at handshake time based on the contents of `componentToStreamToFields`.\r\n- [x] Modify `Component.read_tuple()` to set `Tuple.values` to be a `namedtuple` of the appropriate type for the current stream (by looking it up in `Component._stream_fields`.\r\n\r\nThis will allow users to get values out of their tuples by accessing values directly by name (`word = tup.values.word`), or by unpacking (`word, count = tup.values`).\r\n\r\n_Copied from original issue: Parsely/streamparse#127_"},"repo":{"kind":"string","value":"pystorm/pystorm"},"test_patch":{"kind":"string","value":"diff --git a/test/pystorm/test_bolt.py b/test/pystorm/test_bolt.py\nindex f9586c3..80cf5c8 100644\n--- a/test/pystorm/test_bolt.py\n+++ b/test/pystorm/test_bolt.py\n@@ -34,7 +34,7 @@ class BoltTests(unittest.TestCase):\n tup_json = \"{}\\nend\\n\".format(json.dumps(self.tup_dict)).encode('utf-8')\n self.tup = Tuple(self.tup_dict['id'], self.tup_dict['comp'],\n self.tup_dict['stream'], self.tup_dict['task'],\n- self.tup_dict['tuple'],)\n+ tuple(self.tup_dict['tuple']),)\n self.bolt = Bolt(input_stream=BytesIO(tup_json),\n output_stream=BytesIO())\n self.bolt.initialize({}, {})\n@@ -190,7 +190,7 @@ class BoltTests(unittest.TestCase):\n def test_heartbeat_response(self, send_message_mock, read_tuple_mock):\n # Make sure we send sync for heartbeats\n read_tuple_mock.return_value = Tuple(id='foo', task=-1,\n- stream='__heartbeat', values=[],\n+ stream='__heartbeat', values=(),\n component='__system')\n self.bolt._run()\n send_message_mock.assert_called_with(self.bolt, {'command': 'sync'})\n@@ -201,7 +201,7 @@ class BoltTests(unittest.TestCase):\n # Make sure we send sync for heartbeats\n read_tuple_mock.return_value = Tuple(id=None, task=-1,\n component='__system',\n- stream='__tick', values=[50])\n+ stream='__tick', values=(50,))\n self.bolt._run()\n process_tick_mock.assert_called_with(self.bolt,\n read_tuple_mock.return_value)\n@@ -239,8 +239,8 @@ class BatchingBoltTests(unittest.TestCase):\n tups_json = '\\nend\\n'.join([json.dumps(tup_dict) for tup_dict in\n self.tup_dicts] + [''])\n self.tups = [Tuple(tup_dict['id'], tup_dict['comp'], tup_dict['stream'],\n- tup_dict['task'], tup_dict['tuple']) for tup_dict in\n- self.tup_dicts]\n+ tup_dict['task'], tuple(tup_dict['tuple']))\n+ for tup_dict in self.tup_dicts]\n self.nontick_tups = [tup for tup in self.tups if tup.stream != '__tick']\n self.bolt = BatchingBolt(input_stream=BytesIO(tups_json.encode('utf-8')),\n output_stream=BytesIO())\n@@ -364,7 +364,7 @@ class BatchingBoltTests(unittest.TestCase):\n def test_heartbeat_response(self, send_message_mock, read_tuple_mock):\n # Make sure we send sync for heartbeats\n read_tuple_mock.return_value = Tuple(id='foo', task=-1,\n- stream='__heartbeat', values=[],\n+ stream='__heartbeat', values=(),\n component='__system')\n self.bolt._run()\n send_message_mock.assert_called_with(self.bolt, {'command': 'sync'})\n@@ -375,7 +375,7 @@ class BatchingBoltTests(unittest.TestCase):\n # Make sure we send sync for heartbeats\n read_tuple_mock.return_value = Tuple(id=None, task=-1,\n component='__system',\n- stream='__tick', values=[50])\n+ stream='__tick', values=(50,))\n self.bolt._run()\n process_tick_mock.assert_called_with(self.bolt,\n read_tuple_mock.return_value)\ndiff --git a/test/pystorm/test_component.py b/test/pystorm/test_component.py\nindex f7228f4..c508ae1 100644\n--- a/test/pystorm/test_component.py\n+++ b/test/pystorm/test_component.py\n@@ -7,6 +7,7 @@ from __future__ import absolute_import, print_function, unicode_literals\n import logging\n import os\n import unittest\n+from collections import namedtuple\n from io import BytesIO\n \n import simplejson as json\n@@ -24,49 +25,48 @@ log = logging.getLogger(__name__)\n \n \n class ComponentTests(unittest.TestCase):\n-\n- def test_read_handshake(self):\n- handshake_dict = {\n- \"conf\": {\n- \"topology.message.timeout.secs\": 3,\n- \"topology.tick.tuple.freq.secs\": 1,\n- \"topology.debug\": True\n- },\n- \"pidDir\": \".\",\n- \"context\": {\n- \"task->component\": {\n- \"1\": \"example-spout\",\n- \"2\": \"__acker\",\n- \"3\": \"example-bolt1\",\n- \"4\": \"example-bolt2\"\n- },\n- \"taskid\": 3,\n- # Everything below this line is only available in Storm 0.10.0+\n- \"componentid\": \"example-bolt1\",\n- \"stream->target->grouping\": {\n- \"default\": {\n- \"example-bolt2\": {\n- \"type\": \"SHUFFLE\"\n- }\n- }\n- },\n- \"streams\": [\"default\"],\n- \"stream->outputfields\": {\"default\": [\"word\"]},\n- \"source->stream->grouping\": {\n- \"example-spout\": {\n- \"default\": {\n- \"type\": \"FIELDS\",\n- \"fields\": [\"word\"]\n- }\n- }\n- },\n- \"source->stream->fields\": {\n- \"example-spout\": {\n- \"default\": [\"word\"]\n- }\n+ conf = {\"topology.message.timeout.secs\": 3,\n+ \"topology.tick.tuple.freq.secs\": 1,\n+ \"topology.debug\": True,\n+ \"topology.name\": \"foo\"}\n+ context = {\n+ \"task->component\": {\n+ \"1\": \"example-spout\",\n+ \"2\": \"__acker\",\n+ \"3\": \"example-bolt1\",\n+ \"4\": \"example-bolt2\"\n+ },\n+ \"taskid\": 3,\n+ # Everything below this line is only available in Storm 0.11.0+\n+ \"componentid\": \"example-bolt1\",\n+ \"stream->target->grouping\": {\n+ \"default\": {\n+ \"example-bolt2\": {\n+ \"type\": \"SHUFFLE\"\n+ }\n+ }\n+ },\n+ \"streams\": [\"default\"],\n+ \"stream->outputfields\": {\"default\": [\"word\"]},\n+ \"source->stream->grouping\": {\n+ \"example-spout\": {\n+ \"default\": {\n+ \"type\": \"FIELDS\",\n+ \"fields\": [\"word\"]\n }\n }\n+ },\n+ \"source->stream->fields\": {\n+ \"example-spout\": {\n+ \"default\": [\"sentence\", \"word\", \"number\"]\n+ }\n }\n+ }\n+\n+ def test_read_handshake(self):\n+ handshake_dict = {\"conf\": self.conf,\n+ \"pidDir\": \".\",\n+ \"context\": self.context}\n pid_dir = handshake_dict['pidDir']\n expected_conf = handshake_dict['conf']\n expected_context = handshake_dict['context']\n@@ -84,52 +84,18 @@ class ComponentTests(unittest.TestCase):\n component.serializer.output_stream.buffer.getvalue())\n \n def test_setup_component(self):\n- conf = {\"topology.message.timeout.secs\": 3,\n- \"topology.tick.tuple.freq.secs\": 1,\n- \"topology.debug\": True,\n- \"topology.name\": \"foo\"}\n- context = {\n- \"task->component\": {\n- \"1\": \"example-spout\",\n- \"2\": \"__acker\",\n- \"3\": \"example-bolt1\",\n- \"4\": \"example-bolt2\"\n- },\n- \"taskid\": 3,\n- # Everything below this line is only available in Storm 0.11.0+\n- \"componentid\": \"example-bolt1\",\n- \"stream->target->grouping\": {\n- \"default\": {\n- \"example-bolt2\": {\n- \"type\": \"SHUFFLE\"\n- }\n- }\n- },\n- \"streams\": [\"default\"],\n- \"stream->outputfields\": {\"default\": [\"word\"]},\n- \"source->stream->grouping\": {\n- \"example-spout\": {\n- \"default\": {\n- \"type\": \"FIELDS\",\n- \"fields\": [\"word\"]\n- }\n- }\n- },\n- \"source->stream->fields\": {\n- \"example-spout\": {\n- \"default\": [\"word\"]\n- }\n- }\n- }\n+ conf = self.conf\n component = Component(input_stream=BytesIO(),\n output_stream=BytesIO())\n- component._setup_component(conf, context)\n+ component._setup_component(conf, self.context)\n+ self.assertEqual(component._source_tuple_types['example-spout']['default'].__name__,\n+ 'Example_SpoutDefaultTuple')\n self.assertEqual(component.topology_name, conf['topology.name'])\n- self.assertEqual(component.task_id, context['taskid'])\n+ self.assertEqual(component.task_id, self.context['taskid'])\n self.assertEqual(component.component_name,\n- context['task->component'][str(context['taskid'])])\n+ self.context['task->component'][str(self.context['taskid'])])\n self.assertEqual(component.storm_conf, conf)\n- self.assertEqual(component.context, context)\n+ self.assertEqual(component.context, self.context)\n \n def test_read_message(self):\n inputs = [# Task IDs\n@@ -259,7 +225,7 @@ class ComponentTests(unittest.TestCase):\n for msg in inputs[::2]:\n output = json.loads(msg)\n output['component'] = output['comp']\n- output['values'] = output['tuple']\n+ output['values'] = tuple(output['tuple'])\n del output['comp']\n del output['tuple']\n outputs.append(Tuple(**output))\n@@ -272,6 +238,38 @@ class ComponentTests(unittest.TestCase):\n tup = component.read_tuple()\n self.assertEqual(output, tup)\n \n+ def test_read_tuple_named_fields(self):\n+ # This is only valid for bolts, so we only need to test with task IDs\n+ # and Tuples\n+ inputs = [('{ \"id\": \"-6955786537413359385\", \"comp\": \"example-spout\", '\n+ '\"stream\": \"default\", \"task\": 9, \"tuple\": [\"snow white and '\n+ 'the seven dwarfs\", \"field2\", 3]}\\n'), 'end\\n']\n+\n+ component = Component(input_stream=BytesIO(''.join(inputs).encode('utf-8')),\n+ output_stream=BytesIO())\n+ component._setup_component(self.conf, self.context)\n+\n+ Example_SpoutDefaultTuple = namedtuple('Example_SpoutDefaultTuple',\n+ field_names=['sentence', 'word',\n+ 'number'])\n+\n+ outputs = []\n+ for msg in inputs[::2]:\n+ output = json.loads(msg)\n+ output['component'] = output['comp']\n+ output['values'] = Example_SpoutDefaultTuple(*output['tuple'])\n+ del output['comp']\n+ del output['tuple']\n+ outputs.append(Tuple(**output))\n+\n+ for output in outputs:\n+ log.info('Checking Tuple for %r', output)\n+ tup = component.read_tuple()\n+ self.assertEqual(output.values.sentence, tup.values.sentence)\n+ self.assertEqual(output.values.word, tup.values.word)\n+ self.assertEqual(output.values.number, tup.values.number)\n+ self.assertEqual(output, tup)\n+\n def test_send_message(self):\n component = Component(input_stream=BytesIO(), output_stream=BytesIO())\n inputs = [{\"command\": \"emit\", \"id\": 4, \"stream\": \"\", \"task\": 9,\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_hyperlinks\",\n \"has_many_hunks\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 1,\n \"issue_text_score\": 0,\n \"test_score\": 0\n },\n \"num_modified_files\": 1\n}"},"version":{"kind":"string","value":"1.0"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .[all]\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"requirements.txt\",\n \"pip_packages\": [\n \"pytest\",\n \"mock\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\n \"python\": \"3.5\",\n \"reqs_path\": [\n \"requirements.txt\"\n ],\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"attrs==22.2.0\ncertifi==2021.5.30\nimportlib-metadata==4.8.3\niniconfig==1.1.1\nmock==5.2.0\nmsgpack-python==0.5.6\npackaging==21.3\npluggy==1.0.0\npy==1.11.0\npyparsing==3.1.4\n-e git+https://github.com/pystorm/pystorm.git@111356b63c7a44261fb4d0c827745e793ca8717e#egg=pystorm\npytest==7.0.1\nsimplejson==3.20.1\nsix==1.17.0\ntomli==1.2.3\ntyping_extensions==4.1.1\nzipp==3.6.0\n"},"environment":{"kind":"string","value":"name: pystorm\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2021.5.30=py36h06a4308_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.3=he6710b0_2\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - pip=21.2.2=py36h06a4308_0\n - python=3.6.13=h12debd9_1\n - readline=8.2=h5eee18b_0\n - setuptools=58.0.4=py36h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - wheel=0.37.1=pyhd3eb1b0_0\n - xz=5.6.4=h5eee18b_1\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - attrs==22.2.0\n - importlib-metadata==4.8.3\n - iniconfig==1.1.1\n - mock==5.2.0\n - msgpack-python==0.5.6\n - packaging==21.3\n - pluggy==1.0.0\n - py==1.11.0\n - pyparsing==3.1.4\n - pytest==7.0.1\n - simplejson==3.20.1\n - six==1.17.0\n - tomli==1.2.3\n - typing-extensions==4.1.1\n - zipp==3.6.0\nprefix: /opt/conda/envs/pystorm\n"},"FAIL_TO_PASS":{"kind":"list like","value":["test/pystorm/test_bolt.py::BoltTests::test_auto_ack_on","test/pystorm/test_bolt.py::BoltTests::test_run","test/pystorm/test_bolt.py::BatchingBoltTests::test_auto_ack_off","test/pystorm/test_bolt.py::BatchingBoltTests::test_auto_ack_on","test/pystorm/test_bolt.py::BatchingBoltTests::test_auto_fail_on","test/pystorm/test_bolt.py::BatchingBoltTests::test_batching","test/pystorm/test_bolt.py::BatchingBoltTests::test_group_key","test/pystorm/test_component.py::ComponentTests::test_read_tuple","test/pystorm/test_component.py::ComponentTests::test_read_tuple_named_fields","test/pystorm/test_component.py::ComponentTests::test_setup_component"],"string":"[\n \"test/pystorm/test_bolt.py::BoltTests::test_auto_ack_on\",\n \"test/pystorm/test_bolt.py::BoltTests::test_run\",\n \"test/pystorm/test_bolt.py::BatchingBoltTests::test_auto_ack_off\",\n \"test/pystorm/test_bolt.py::BatchingBoltTests::test_auto_ack_on\",\n \"test/pystorm/test_bolt.py::BatchingBoltTests::test_auto_fail_on\",\n \"test/pystorm/test_bolt.py::BatchingBoltTests::test_batching\",\n \"test/pystorm/test_bolt.py::BatchingBoltTests::test_group_key\",\n \"test/pystorm/test_component.py::ComponentTests::test_read_tuple\",\n \"test/pystorm/test_component.py::ComponentTests::test_read_tuple_named_fields\",\n \"test/pystorm/test_component.py::ComponentTests::test_setup_component\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["test/pystorm/test_bolt.py::BoltTests::test_ack_id","test/pystorm/test_bolt.py::BoltTests::test_ack_tuple","test/pystorm/test_bolt.py::BoltTests::test_auto_ack_off","test/pystorm/test_bolt.py::BoltTests::test_auto_anchor_off","test/pystorm/test_bolt.py::BoltTests::test_auto_anchor_on","test/pystorm/test_bolt.py::BoltTests::test_auto_anchor_override","test/pystorm/test_bolt.py::BoltTests::test_auto_fail_off","test/pystorm/test_bolt.py::BoltTests::test_auto_fail_on","test/pystorm/test_bolt.py::BoltTests::test_emit_basic","test/pystorm/test_bolt.py::BoltTests::test_emit_direct","test/pystorm/test_bolt.py::BoltTests::test_emit_stream_anchors","test/pystorm/test_bolt.py::BoltTests::test_fail_id","test/pystorm/test_bolt.py::BoltTests::test_fail_tuple","test/pystorm/test_bolt.py::BoltTests::test_heartbeat_response","test/pystorm/test_bolt.py::BoltTests::test_process_tick","test/pystorm/test_bolt.py::BatchingBoltTests::test_auto_fail_off","test/pystorm/test_bolt.py::BatchingBoltTests::test_auto_fail_partial","test/pystorm/test_bolt.py::BatchingBoltTests::test_heartbeat_response","test/pystorm/test_bolt.py::BatchingBoltTests::test_process_tick","test/pystorm/test_component.py::ComponentTests::test_log","test/pystorm/test_component.py::ComponentTests::test_read_command","test/pystorm/test_component.py::ComponentTests::test_read_handshake","test/pystorm/test_component.py::ComponentTests::test_read_message","test/pystorm/test_component.py::ComponentTests::test_read_message_unicode","test/pystorm/test_component.py::ComponentTests::test_read_split_message","test/pystorm/test_component.py::ComponentTests::test_read_task_ids","test/pystorm/test_component.py::ComponentTests::test_send_message","test/pystorm/test_component.py::ComponentTests::test_send_message_unicode"],"string":"[\n \"test/pystorm/test_bolt.py::BoltTests::test_ack_id\",\n \"test/pystorm/test_bolt.py::BoltTests::test_ack_tuple\",\n \"test/pystorm/test_bolt.py::BoltTests::test_auto_ack_off\",\n \"test/pystorm/test_bolt.py::BoltTests::test_auto_anchor_off\",\n \"test/pystorm/test_bolt.py::BoltTests::test_auto_anchor_on\",\n \"test/pystorm/test_bolt.py::BoltTests::test_auto_anchor_override\",\n \"test/pystorm/test_bolt.py::BoltTests::test_auto_fail_off\",\n \"test/pystorm/test_bolt.py::BoltTests::test_auto_fail_on\",\n \"test/pystorm/test_bolt.py::BoltTests::test_emit_basic\",\n \"test/pystorm/test_bolt.py::BoltTests::test_emit_direct\",\n \"test/pystorm/test_bolt.py::BoltTests::test_emit_stream_anchors\",\n \"test/pystorm/test_bolt.py::BoltTests::test_fail_id\",\n \"test/pystorm/test_bolt.py::BoltTests::test_fail_tuple\",\n \"test/pystorm/test_bolt.py::BoltTests::test_heartbeat_response\",\n \"test/pystorm/test_bolt.py::BoltTests::test_process_tick\",\n \"test/pystorm/test_bolt.py::BatchingBoltTests::test_auto_fail_off\",\n \"test/pystorm/test_bolt.py::BatchingBoltTests::test_auto_fail_partial\",\n \"test/pystorm/test_bolt.py::BatchingBoltTests::test_heartbeat_response\",\n \"test/pystorm/test_bolt.py::BatchingBoltTests::test_process_tick\",\n \"test/pystorm/test_component.py::ComponentTests::test_log\",\n \"test/pystorm/test_component.py::ComponentTests::test_read_command\",\n \"test/pystorm/test_component.py::ComponentTests::test_read_handshake\",\n \"test/pystorm/test_component.py::ComponentTests::test_read_message\",\n \"test/pystorm/test_component.py::ComponentTests::test_read_message_unicode\",\n \"test/pystorm/test_component.py::ComponentTests::test_read_split_message\",\n \"test/pystorm/test_component.py::ComponentTests::test_read_task_ids\",\n \"test/pystorm/test_component.py::ComponentTests::test_send_message\",\n \"test/pystorm/test_component.py::ComponentTests::test_send_message_unicode\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"Apache License 2.0"},"__index_level_0__":{"kind":"number","value":276,"string":"276"}}},{"rowIdx":277,"cells":{"instance_id":{"kind":"string","value":"sympy__sympy-10053"},"base_commit":{"kind":"string","value":"4349739ef2685623b379ed338a67b9cff093b54b"},"created_at":{"kind":"string","value":"2015-10-27 17:47:23"},"environment_setup_commit":{"kind":"string","value":"0241b35cae5f2adc04dc37b25f7dc9c5f00bd746"},"hints_text":{"kind":"string","value":"jksuom: This looks good.\r\n\r\nThere are other (nonsensical) cases where ``pspace(condition)`` returns ``None`` and ``AttributeError`` results, for example ``P(1)``. Perhaps these should also be caught and something more informative be returned (maybe ``nan``).\r\n```\ngxyd: > Perhaps these should also be caught and something more informative be returned (maybe nan).\r\n\r\nYes, i have added `ValueError`, but since `condition` is expected to be a `Relational`, so i think returning `ValueError` looks better to me instead of `nan`.\njksuom: It is a good idea to catch any ``condition`` that is not a ``Relational``.\r\nIn addition, I think it would be advisable to make sure that ``pspace(condition)`` does not return ``None``. That can happen even when ``condition`` is a ``Relational`` if it does not contain random variables. For example, ``P(x < 1)`` for an ordinary symbol ``x``.\ngxyd: > It is a good idea to catch any condition that is not a Relational.\n\nIt can even take non-relationals like: `And(X + Y < 3, Y < 2) `. That's why\nthe current tests fail. I think i should use some, `.has(Relational)`\nproperty for that may be.\n\nOn Wed, Oct 28, 2015 at 12:41 PM, Kalevi Suominen \nwrote:\n\n> It is a good idea to catch any condition that is not a Relational.\n> In addition, I think it would be advisable to make sure that\n> pspace(condition) does not return None. That can happen even when\n> condition is a Relational if it does not contain random variables. For\n> example, P(x < 1) for an ordinary symbol x.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> .\n>\n\ngxyd: Ex. P(And(X + Y < 2, X > 1)) where `X` and `Y` are both `RandomSymbol`.\n\nOn Wed, Oct 28, 2015 at 12:46 PM, Gaurav Dhingra wrote:\n\n> > It is a good idea to catch any condition that is not a Relational.\n>\n> It can even take non-relationals like: `And(X + Y < 3, Y < 2) `. That's\n> why the current tests fail. I think i should use some, `.has(Relational)`\n> property for that may be.\n>\n> On Wed, Oct 28, 2015 at 12:41 PM, Kalevi Suominen <\n> notifications@github.com> wrote:\n>\n>> It is a good idea to catch any condition that is not a Relational.\n>> In addition, I think it would be advisable to make sure that\n>> pspace(condition) does not return None. That can happen even when\n>> condition is a Relational if it does not contain random variables. For\n>> example, P(x < 1) for an ordinary symbol x.\n>>\n>> —\n>> Reply to this email directly or view it on GitHub\n>> .\n>>\n>\n>\n\njksuom: Yes, there are ``BooleanFunction``s like ``And`` that should be accepted. Perhaps everything that derives from ``Boolean`` should be allowed. That would simplify the test.\ngxyd: I too think it is better for `given(condition)` to raise an Error instead of returning `None`. It is now ready for review."},"patch":{"kind":"string","value":"diff --git a/sympy/stats/rv.py b/sympy/stats/rv.py\nindex ff9060cf6e..b3686a1fab 100644\n--- a/sympy/stats/rv.py\n+++ b/sympy/stats/rv.py\n@@ -15,7 +15,9 @@\n from __future__ import print_function, division\n \n from sympy import (Basic, S, Expr, Symbol, Tuple, And, Add, Eq, lambdify,\n- Equality, Lambda, DiracDelta)\n+ Equality, Lambda, DiracDelta, sympify)\n+from sympy.core.relational import Relational\n+from sympy.logic.boolalg import Boolean\n from sympy.solvers.solveset import solveset\n from sympy.sets.sets import FiniteSet, ProductSet, Intersection\n from sympy.abc import x\n@@ -121,7 +123,7 @@ class PSpace(Basic):\n A Probability Space\n \n Probability Spaces encode processes that equal different values\n- probabalistically. These underly Random Symbols which occur in SymPy\n+ probabilistically. These underly Random Symbols which occur in SymPy\n expressions and contain the mechanics to evaluate statistical statements.\n \n See Also\n@@ -422,9 +424,10 @@ def pspace(expr):\n True\n \"\"\"\n \n+ expr = sympify(expr)\n rvs = random_symbols(expr)\n if not rvs:\n- return None\n+ raise ValueError(\"Expression containing Random Variable expected, not %s\" % (expr))\n # If only one space present\n if all(rv.pspace == rvs[0].pspace for rv in rvs):\n return rvs[0].pspace\n@@ -469,7 +472,7 @@ def given(expr, condition=None, **kwargs):\n \n >>> from sympy.stats import given, density, Die\n >>> X = Die('X', 6)\n- >>> Y = given(X, X>3)\n+ >>> Y = given(X, X > 3)\n >>> density(Y).dict\n {4: 1/3, 5: 1/3, 6: 1/3}\n \n@@ -550,7 +553,7 @@ def expectation(expr, condition=None, numsamples=None, evaluate=True, **kwargs):\n >>> E(2*X + 1)\n 8\n \n- >>> E(X, X>3) # Expectation of X given that it is above 3\n+ >>> E(X, X > 3) # Expectation of X given that it is above 3\n 5\n \"\"\"\n \n@@ -585,10 +588,11 @@ def probability(condition, given_condition=None, numsamples=None,\n Parameters\n ==========\n \n- condition : Relational containing RandomSymbols\n+ condition : Combination of Relationals containing RandomSymbols\n The condition of which you want to compute the probability\n- given_condition : Relational containing RandomSymbols\n- A conditional expression. P(X>1, X>0) is expectation of X>1 given X>0\n+ given_condition : Combination of Relationals containing RandomSymbols\n+ A conditional expression. P(X > 1, X > 0) is expectation of X > 1\n+ given X > 0\n numsamples : int\n Enables sampling and approximates the probability with this many samples\n evaluate : Bool (defaults to True)\n@@ -608,6 +612,23 @@ def probability(condition, given_condition=None, numsamples=None,\n 5/12\n \"\"\"\n \n+ condition = sympify(condition)\n+ given_condition = sympify(given_condition)\n+\n+ if given_condition is not None and \\\n+ not isinstance(given_condition, (Relational, Boolean)):\n+ raise ValueError(\"%s is not a relational or combination of relationals\"\n+ % (given_condition))\n+ if given_condition == False:\n+ return S.Zero\n+ if not isinstance(condition, (Relational, Boolean)):\n+ raise ValueError(\"%s is not a relational or combination of relationals\"\n+ % (condition))\n+ if condition is S.true:\n+ return S.One\n+ if condition is S.false:\n+ return S.Zero\n+\n if numsamples:\n return sampling_P(condition, given_condition, numsamples=numsamples,\n **kwargs)\n@@ -667,7 +688,8 @@ def density(expr, condition=None, evaluate=True, numsamples=None, **kwargs):\n expr : Expr containing RandomSymbols\n The expression of which you want to compute the density value\n condition : Relational containing RandomSymbols\n- A conditional expression. density(X>1, X>0) is density of X>1 given X>0\n+ A conditional expression. density(X > 1, X > 0) is density of X > 1\n+ given X > 0\n numsamples : int\n Enables sampling and approximates the density with this many samples\n \n@@ -720,7 +742,7 @@ def cdf(expr, condition=None, evaluate=True, **kwargs):\n {1: 1/6, 2: 1/6, 3: 1/6, 4: 1/6, 5: 1/6, 6: 1/6}\n >>> cdf(D)\n {1: 1/6, 2: 1/3, 3: 1/2, 4: 2/3, 5: 5/6, 6: 1}\n- >>> cdf(3*D, D>2)\n+ >>> cdf(3*D, D > 2)\n {9: 1/4, 12: 1/2, 15: 3/4, 18: 1}\n \n >>> cdf(X)\n"},"problem_statement":{"kind":"string","value":"P(X < oo ) for any Continuous Distribution raises AttributeError\n```\r\n>>> from sympy import *\r\n>>> from sympy.stats import P, Exponential\r\n>>> X = Exponential('X', 3)\r\n>>> P(X < oo)\r\n\r\n---------------------------------------------------------------------------\r\nAttributeError Traceback (most recent call last)\r\n in ()\r\n----> 1 P(X < oo)\r\n\r\n/home/gxyd/Public/sympy/sympy/stats/rv.py in probability(condition, given_condition, numsamples, evaluate, **kwargs)\r\n 617 \r\n 618 # Otherwise pass work off to the ProbabilitySpace\r\n--> 619 result = pspace(condition).probability(condition, **kwargs)\r\n 620 if evaluate and hasattr(result, 'doit'):\r\n 621 return result.doit()\r\n\r\nAttributeError: 'NoneType' object has no attribute 'probability'\r\n```"},"repo":{"kind":"string","value":"sympy/sympy"},"test_patch":{"kind":"string","value":"diff --git a/sympy/stats/tests/test_rv.py b/sympy/stats/tests/test_rv.py\nindex 69115c2771..52ef81f9f1 100644\n--- a/sympy/stats/tests/test_rv.py\n+++ b/sympy/stats/tests/test_rv.py\n@@ -7,6 +7,7 @@\n from sympy.stats.rv import ProductPSpace, rs_swap, Density, NamedArgsMixin\n from sympy.utilities.pytest import raises, XFAIL\n from sympy.core.compatibility import range\n+from sympy.abc import x\n \n \n def test_where():\n@@ -45,7 +46,8 @@ def test_random_symbols():\n def test_pspace():\n X, Y = Normal('X', 0, 1), Normal('Y', 0, 1)\n \n- assert not pspace(5 + 3)\n+ raises(ValueError, lambda: pspace(5 + 3))\n+ raises(ValueError, lambda: pspace(x < 1))\n assert pspace(X) == X.pspace\n assert pspace(2*X + 1) == X.pspace\n assert pspace(2*X + Y) == ProductPSpace(Y.pspace, X.pspace)\n@@ -195,3 +197,15 @@ def test_density_constant():\n def test_real():\n x = Normal('x', 0, 1)\n assert x.is_real\n+\n+\n+def test_issue_10052():\n+ X = Exponential('X', 3)\n+ assert P(X < oo) == 1\n+ assert P(X > oo) == 0\n+ assert P(X < 2, X > oo) == 0\n+ assert P(X < oo, X > oo) == 0\n+ assert P(X < oo, X > 2) == 1\n+ assert P(X < 3, X == 2) == 0\n+ raises(ValueError, lambda: P(1))\n+ raises(ValueError, lambda: P(X < 1, 2))\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_many_hunks\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 2,\n \"issue_text_score\": 0,\n \"test_score\": 2\n },\n \"num_modified_files\": 1\n}"},"version":{"kind":"string","value":"0.7"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"pytest\",\n \"pip_packages\": [\n \"mpmath>=0.19\",\n \"pytest\",\n \"pytest-cov\",\n \"pytest-xdist\",\n \"pytest-mock\",\n \"pytest-asyncio\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\n \"python\": \"3.6\",\n \"reqs_path\": null,\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work\ncertifi==2021.5.30\ncoverage==6.2\nexecnet==1.9.0\nimportlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1631916693255/work\niniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work\nmore-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work\nmpmath==1.3.0\npackaging @ file:///tmp/build/80754af9/packaging_1637314298585/work\npluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work\npy @ file:///opt/conda/conda-bld/py_1644396412707/work\npyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work\npytest==6.2.4\npytest-asyncio==0.16.0\npytest-cov==4.0.0\npytest-mock==3.6.1\npytest-xdist==3.0.2\n-e git+https://github.com/sympy/sympy.git@4349739ef2685623b379ed338a67b9cff093b54b#egg=sympy\ntoml @ file:///tmp/build/80754af9/toml_1616166611790/work\ntomli==1.2.3\ntyping_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work\nzipp @ file:///tmp/build/80754af9/zipp_1633618647012/work\n"},"environment":{"kind":"string","value":"name: sympy\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - attrs=21.4.0=pyhd3eb1b0_0\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2021.5.30=py36h06a4308_0\n - importlib-metadata=4.8.1=py36h06a4308_0\n - importlib_metadata=4.8.1=hd3eb1b0_0\n - iniconfig=1.1.1=pyhd3eb1b0_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.3=he6710b0_2\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - more-itertools=8.12.0=pyhd3eb1b0_0\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - packaging=21.3=pyhd3eb1b0_0\n - pip=21.2.2=py36h06a4308_0\n - pluggy=0.13.1=py36h06a4308_0\n - py=1.11.0=pyhd3eb1b0_0\n - pyparsing=3.0.4=pyhd3eb1b0_0\n - pytest=6.2.4=py36h06a4308_2\n - python=3.6.13=h12debd9_1\n - readline=8.2=h5eee18b_0\n - setuptools=58.0.4=py36h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - toml=0.10.2=pyhd3eb1b0_0\n - typing_extensions=4.1.1=pyh06a4308_0\n - wheel=0.37.1=pyhd3eb1b0_0\n - xz=5.6.4=h5eee18b_1\n - zipp=3.6.0=pyhd3eb1b0_0\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - coverage==6.2\n - execnet==1.9.0\n - mpmath==1.3.0\n - pytest-asyncio==0.16.0\n - pytest-cov==4.0.0\n - pytest-mock==3.6.1\n - pytest-xdist==3.0.2\n - tomli==1.2.3\nprefix: /opt/conda/envs/sympy\n"},"FAIL_TO_PASS":{"kind":"list like","value":["sympy/stats/tests/test_rv.py::test_pspace","sympy/stats/tests/test_rv.py::test_issue_10052"],"string":"[\n \"sympy/stats/tests/test_rv.py::test_pspace\",\n \"sympy/stats/tests/test_rv.py::test_issue_10052\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["sympy/stats/tests/test_rv.py::test_where","sympy/stats/tests/test_rv.py::test_random_symbols","sympy/stats/tests/test_rv.py::test_rs_swap","sympy/stats/tests/test_rv.py::test_RandomSymbol","sympy/stats/tests/test_rv.py::test_RandomSymbol_diff","sympy/stats/tests/test_rv.py::test_overlap","sympy/stats/tests/test_rv.py::test_ProductPSpace","sympy/stats/tests/test_rv.py::test_E","sympy/stats/tests/test_rv.py::test_Sample","sympy/stats/tests/test_rv.py::test_given","sympy/stats/tests/test_rv.py::test_dependence","sympy/stats/tests/test_rv.py::test_normality","sympy/stats/tests/test_rv.py::test_Density","sympy/stats/tests/test_rv.py::test_NamedArgsMixin","sympy/stats/tests/test_rv.py::test_density_constant","sympy/stats/tests/test_rv.py::test_real"],"string":"[\n \"sympy/stats/tests/test_rv.py::test_where\",\n \"sympy/stats/tests/test_rv.py::test_random_symbols\",\n \"sympy/stats/tests/test_rv.py::test_rs_swap\",\n \"sympy/stats/tests/test_rv.py::test_RandomSymbol\",\n \"sympy/stats/tests/test_rv.py::test_RandomSymbol_diff\",\n \"sympy/stats/tests/test_rv.py::test_overlap\",\n \"sympy/stats/tests/test_rv.py::test_ProductPSpace\",\n \"sympy/stats/tests/test_rv.py::test_E\",\n \"sympy/stats/tests/test_rv.py::test_Sample\",\n \"sympy/stats/tests/test_rv.py::test_given\",\n \"sympy/stats/tests/test_rv.py::test_dependence\",\n \"sympy/stats/tests/test_rv.py::test_normality\",\n \"sympy/stats/tests/test_rv.py::test_Density\",\n \"sympy/stats/tests/test_rv.py::test_NamedArgsMixin\",\n \"sympy/stats/tests/test_rv.py::test_density_constant\",\n \"sympy/stats/tests/test_rv.py::test_real\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"BSD"},"__index_level_0__":{"kind":"number","value":277,"string":"277"}}},{"rowIdx":278,"cells":{"instance_id":{"kind":"string","value":"sympy__sympy-10064"},"base_commit":{"kind":"string","value":"4349739ef2685623b379ed338a67b9cff093b54b"},"created_at":{"kind":"string","value":"2015-10-29 04:34:03"},"environment_setup_commit":{"kind":"string","value":"0241b35cae5f2adc04dc37b25f7dc9c5f00bd746"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/sympy/core/numbers.py b/sympy/core/numbers.py\nindex cd046fceae..f01d3c683e 100644\n--- a/sympy/core/numbers.py\n+++ b/sympy/core/numbers.py\n@@ -1867,6 +1867,9 @@ def _eval_power(self, expt):\n # (-2)**k --> 2**k\n if self.is_negative and expt.is_even:\n return (-self)**expt\n+ if isinstance(expt, Float):\n+ # Rational knows how to exponentiate by a Float\n+ return super(Integer, self)._eval_power(expt)\n if not isinstance(expt, Rational):\n return\n if expt is S.Half and self.is_negative:\n"},"problem_statement":{"kind":"string","value":"Integer raised to Float power does not evaluate\nRational raised to Float power does the right thing, but Integer raised to Float does not:\r\n````\r\nIn [5]: 2**Float(3)\r\nOut[5]: 2**3.0\r\n\r\nIn [6]: Rational(2, 3)**Float(3)\r\nOut[6]: 0.296296296296296\r\n````\r\nI think the first result should do the same as\r\n````\r\nIn [7]: Float(2)**Float(3)\r\nOut[7]: 8.00000000000000\r\n````\r\n"},"repo":{"kind":"string","value":"sympy/sympy"},"test_patch":{"kind":"string","value":"diff --git a/sympy/core/tests/test_numbers.py b/sympy/core/tests/test_numbers.py\nindex dfbb67eb56..2dd3da28ef 100644\n--- a/sympy/core/tests/test_numbers.py\n+++ b/sympy/core/tests/test_numbers.py\n@@ -1499,3 +1499,7 @@ def test_comp():\n \n def test_issue_9491():\n assert oo**zoo == nan\n+\n+\n+def test_issue_10063():\n+ assert 2**Float(3) == Float(8)\ndiff --git a/sympy/printing/pretty/tests/test_pretty.py b/sympy/printing/pretty/tests/test_pretty.py\nindex 48fad91708..3664011a2b 100644\n--- a/sympy/printing/pretty/tests/test_pretty.py\n+++ b/sympy/printing/pretty/tests/test_pretty.py\n@@ -396,7 +396,7 @@ def test_pretty_basic():\n assert upretty(expr) == ucode_str\n \n # see issue #2860\n- expr = S(2)**-1.0\n+ expr = Pow(S(2), -1.0, evaluate=False)\n ascii_str = \\\n \"\"\"\\\n -1.0\\n\\\ndiff --git a/sympy/printing/tests/test_str.py b/sympy/printing/tests/test_str.py\nindex ec2942ecf2..0f2bf4eaaf 100644\n--- a/sympy/printing/tests/test_str.py\n+++ b/sympy/printing/tests/test_str.py\n@@ -2,7 +2,7 @@\n \n from sympy import (Abs, Catalan, cos, Derivative, E, EulerGamma, exp,\n factorial, factorial2, Function, GoldenRatio, I, Integer, Integral,\n- Interval, Lambda, Limit, Matrix, nan, O, oo, pi, Rational, Float, Rel,\n+ Interval, Lambda, Limit, Matrix, nan, O, oo, pi, Pow, Rational, Float, Rel,\n S, sin, SparseMatrix, sqrt, summation, Sum, Symbol, symbols, Wild,\n WildFunction, zeta, zoo, Dummy, Dict, Tuple, FiniteSet, factor,\n subfactorial, true, false, Equivalent, Xor, Complement, SymmetricDifference)\n@@ -409,7 +409,7 @@ def test_Pow():\n # not the same as x**-1\n assert str(x**-1.0) == 'x**(-1.0)'\n # see issue #2860\n- assert str(S(2)**-1.0) == '2**(-1.0)'\n+ assert str(Pow(S(2), -1.0, evaluate=False)) == '2**(-1.0)'\n \n \n def test_sqrt():\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [],\n \"has_test_patch\": true,\n \"is_lite\": true,\n \"llm_score\": {\n \"difficulty_score\": 0,\n \"issue_text_score\": 1,\n \"test_score\": 0\n },\n \"num_modified_files\": 1\n}"},"version":{"kind":"string","value":"0.7"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"pytest\",\n \"pip_packages\": [\n \"pytest\"\n ],\n \"pre_install\": null,\n \"python\": \"3.7\",\n \"reqs_path\": null,\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"attrs @ file:///croot/attrs_1668696182826/work\ncertifi @ file:///croot/certifi_1671487769961/work/certifi\nflit_core @ file:///opt/conda/conda-bld/flit-core_1644941570762/work/source/flit_core\nimportlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1648562407465/work\niniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work\nmpmath==1.3.0\npackaging @ file:///croot/packaging_1671697413597/work\npluggy @ file:///tmp/build/80754af9/pluggy_1648042572264/work\npy @ file:///opt/conda/conda-bld/py_1644396412707/work\npytest==7.1.2\n-e git+https://github.com/sympy/sympy.git@4349739ef2685623b379ed338a67b9cff093b54b#egg=sympy\ntomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work\ntyping_extensions @ file:///croot/typing_extensions_1669924550328/work\nzipp @ file:///croot/zipp_1672387121353/work\n"},"environment":{"kind":"string","value":"name: sympy\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - attrs=22.1.0=py37h06a4308_0\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2022.12.7=py37h06a4308_0\n - flit-core=3.6.0=pyhd3eb1b0_0\n - importlib-metadata=4.11.3=py37h06a4308_0\n - importlib_metadata=4.11.3=hd3eb1b0_0\n - iniconfig=1.1.1=pyhd3eb1b0_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.4.4=h6a678d5_1\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - packaging=22.0=py37h06a4308_0\n - pip=22.3.1=py37h06a4308_0\n - pluggy=1.0.0=py37h06a4308_1\n - py=1.11.0=pyhd3eb1b0_0\n - pytest=7.1.2=py37h06a4308_0\n - python=3.7.16=h7a1cb2a_0\n - readline=8.2=h5eee18b_0\n - setuptools=65.6.3=py37h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - tomli=2.0.1=py37h06a4308_0\n - typing_extensions=4.4.0=py37h06a4308_0\n - wheel=0.38.4=py37h06a4308_0\n - xz=5.6.4=h5eee18b_1\n - zipp=3.11.0=py37h06a4308_0\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - mpmath==1.3.0\nprefix: /opt/conda/envs/sympy\n"},"FAIL_TO_PASS":{"kind":"list like","value":["sympy/core/tests/test_numbers.py::test_issue_10063"],"string":"[\n \"sympy/core/tests/test_numbers.py::test_issue_10063\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["sympy/core/tests/test_numbers.py::test_integers_cache","sympy/core/tests/test_numbers.py::test_seterr","sympy/core/tests/test_numbers.py::test_mod","sympy/core/tests/test_numbers.py::test_divmod","sympy/core/tests/test_numbers.py::test_igcd","sympy/core/tests/test_numbers.py::test_ilcm","sympy/core/tests/test_numbers.py::test_igcdex","sympy/core/tests/test_numbers.py::test_Integer_new","sympy/core/tests/test_numbers.py::test_Rational_new","sympy/core/tests/test_numbers.py::test_Number_new","sympy/core/tests/test_numbers.py::test_Rational_cmp","sympy/core/tests/test_numbers.py::test_Float","sympy/core/tests/test_numbers.py::test_Float_default_to_highprec_from_str","sympy/core/tests/test_numbers.py::test_Float_eval","sympy/core/tests/test_numbers.py::test_Float_issue_2107","sympy/core/tests/test_numbers.py::test_Infinity","sympy/core/tests/test_numbers.py::test_Infinity_2","sympy/core/tests/test_numbers.py::test_Mul_Infinity_Zero","sympy/core/tests/test_numbers.py::test_Div_By_Zero","sympy/core/tests/test_numbers.py::test_Infinity_inequations","sympy/core/tests/test_numbers.py::test_NaN","sympy/core/tests/test_numbers.py::test_special_numbers","sympy/core/tests/test_numbers.py::test_powers","sympy/core/tests/test_numbers.py::test_integer_nthroot_overflow","sympy/core/tests/test_numbers.py::test_powers_Integer","sympy/core/tests/test_numbers.py::test_powers_Rational","sympy/core/tests/test_numbers.py::test_powers_Float","sympy/core/tests/test_numbers.py::test_abs1","sympy/core/tests/test_numbers.py::test_accept_int","sympy/core/tests/test_numbers.py::test_dont_accept_str","sympy/core/tests/test_numbers.py::test_int","sympy/core/tests/test_numbers.py::test_long","sympy/core/tests/test_numbers.py::test_real_bug","sympy/core/tests/test_numbers.py::test_bug_sqrt","sympy/core/tests/test_numbers.py::test_pi_Pi","sympy/core/tests/test_numbers.py::test_no_len","sympy/core/tests/test_numbers.py::test_issue_3321","sympy/core/tests/test_numbers.py::test_issue_3692","sympy/core/tests/test_numbers.py::test_issue_3423","sympy/core/tests/test_numbers.py::test_issue_3449","sympy/core/tests/test_numbers.py::test_Integer_factors","sympy/core/tests/test_numbers.py::test_Rational_factors","sympy/core/tests/test_numbers.py::test_issue_4107","sympy/core/tests/test_numbers.py::test_IntegerInteger","sympy/core/tests/test_numbers.py::test_Rational_gcd_lcm_cofactors","sympy/core/tests/test_numbers.py::test_Float_gcd_lcm_cofactors","sympy/core/tests/test_numbers.py::test_issue_4611","sympy/core/tests/test_numbers.py::test_conversion_to_mpmath","sympy/core/tests/test_numbers.py::test_relational","sympy/core/tests/test_numbers.py::test_Integer_as_index","sympy/core/tests/test_numbers.py::test_Rational_int","sympy/core/tests/test_numbers.py::test_zoo","sympy/core/tests/test_numbers.py::test_issue_4122","sympy/core/tests/test_numbers.py::test_GoldenRatio_expand","sympy/core/tests/test_numbers.py::test_as_content_primitive","sympy/core/tests/test_numbers.py::test_hashing_sympy_integers","sympy/core/tests/test_numbers.py::test_issue_4172","sympy/core/tests/test_numbers.py::test_Catalan_EulerGamma_prec","sympy/core/tests/test_numbers.py::test_Float_eq","sympy/core/tests/test_numbers.py::test_int_NumberSymbols","sympy/core/tests/test_numbers.py::test_issue_6640","sympy/core/tests/test_numbers.py::test_issue_6349","sympy/core/tests/test_numbers.py::test_mpf_norm","sympy/core/tests/test_numbers.py::test_latex","sympy/core/tests/test_numbers.py::test_issue_7742","sympy/core/tests/test_numbers.py::test_simplify_AlgebraicNumber","sympy/core/tests/test_numbers.py::test_Float_idempotence","sympy/core/tests/test_numbers.py::test_comp","sympy/core/tests/test_numbers.py::test_issue_9491","sympy/printing/pretty/tests/test_pretty.py::test_pretty_ascii_str","sympy/printing/pretty/tests/test_pretty.py::test_pretty_unicode_str","sympy/printing/pretty/tests/test_pretty.py::test_upretty_greek","sympy/printing/pretty/tests/test_pretty.py::test_upretty_multiindex","sympy/printing/pretty/tests/test_pretty.py::test_upretty_sub_super","sympy/printing/pretty/tests/test_pretty.py::test_upretty_subs_missing_in_24","sympy/printing/pretty/tests/test_pretty.py::test_upretty_modifiers","sympy/printing/pretty/tests/test_pretty.py::test_pretty_basic","sympy/printing/pretty/tests/test_pretty.py::test_negative_fractions","sympy/printing/pretty/tests/test_pretty.py::test_issue_5524","sympy/printing/pretty/tests/test_pretty.py::test_pretty_ordering","sympy/printing/pretty/tests/test_pretty.py::test_pretty_relational","sympy/printing/pretty/tests/test_pretty.py::test_issue_7117","sympy/printing/pretty/tests/test_pretty.py::test_pretty_rational","sympy/printing/pretty/tests/test_pretty.py::test_pretty_functions","sympy/printing/pretty/tests/test_pretty.py::test_pretty_sqrt","sympy/printing/pretty/tests/test_pretty.py::test_pretty_sqrt_char_knob","sympy/printing/pretty/tests/test_pretty.py::test_pretty_sqrt_longsymbol_no_sqrt_char","sympy/printing/pretty/tests/test_pretty.py::test_pretty_KroneckerDelta","sympy/printing/pretty/tests/test_pretty.py::test_pretty_product","sympy/printing/pretty/tests/test_pretty.py::test_pretty_lambda","sympy/printing/pretty/tests/test_pretty.py::test_pretty_order","sympy/printing/pretty/tests/test_pretty.py::test_pretty_derivatives","sympy/printing/pretty/tests/test_pretty.py::test_pretty_integrals","sympy/printing/pretty/tests/test_pretty.py::test_pretty_matrix","sympy/printing/pretty/tests/test_pretty.py::test_Adjoint","sympy/printing/pretty/tests/test_pretty.py::test_pretty_piecewise","sympy/printing/pretty/tests/test_pretty.py::test_pretty_seq","sympy/printing/pretty/tests/test_pretty.py::test_any_object_in_sequence","sympy/printing/pretty/tests/test_pretty.py::test_pretty_sets","sympy/printing/pretty/tests/test_pretty.py::test_pretty_ConditionSet","sympy/printing/pretty/tests/test_pretty.py::test_pretty_ComplexRegion","sympy/printing/pretty/tests/test_pretty.py::test_ProductSet_paranthesis","sympy/printing/pretty/tests/test_pretty.py::test_pretty_sequences","sympy/printing/pretty/tests/test_pretty.py::test_pretty_FourierSeries","sympy/printing/pretty/tests/test_pretty.py::test_pretty_FormalPowerSeries","sympy/printing/pretty/tests/test_pretty.py::test_pretty_limits","sympy/printing/pretty/tests/test_pretty.py::test_pretty_RootOf","sympy/printing/pretty/tests/test_pretty.py::test_pretty_RootSum","sympy/printing/pretty/tests/test_pretty.py::test_GroebnerBasis","sympy/printing/pretty/tests/test_pretty.py::test_pretty_Boolean","sympy/printing/pretty/tests/test_pretty.py::test_pretty_Domain","sympy/printing/pretty/tests/test_pretty.py::test_pretty_prec","sympy/printing/pretty/tests/test_pretty.py::test_pprint","sympy/printing/pretty/tests/test_pretty.py::test_pretty_class","sympy/printing/pretty/tests/test_pretty.py::test_pretty_no_wrap_line","sympy/printing/pretty/tests/test_pretty.py::test_settings","sympy/printing/pretty/tests/test_pretty.py::test_pretty_sum","sympy/printing/pretty/tests/test_pretty.py::test_units","sympy/printing/pretty/tests/test_pretty.py::test_pretty_Subs","sympy/printing/pretty/tests/test_pretty.py::test_gammas","sympy/printing/pretty/tests/test_pretty.py::test_hyper","sympy/printing/pretty/tests/test_pretty.py::test_meijerg","sympy/printing/pretty/tests/test_pretty.py::test_noncommutative","sympy/printing/pretty/tests/test_pretty.py::test_pretty_special_functions","sympy/printing/pretty/tests/test_pretty.py::test_pretty_geometry","sympy/printing/pretty/tests/test_pretty.py::test_expint","sympy/printing/pretty/tests/test_pretty.py::test_elliptic_functions","sympy/printing/pretty/tests/test_pretty.py::test_RandomDomain","sympy/printing/pretty/tests/test_pretty.py::test_PrettyPoly","sympy/printing/pretty/tests/test_pretty.py::test_issue_6285","sympy/printing/pretty/tests/test_pretty.py::test_issue_6359","sympy/printing/pretty/tests/test_pretty.py::test_issue_6739","sympy/printing/pretty/tests/test_pretty.py::test_complicated_symbol_unchanged","sympy/printing/pretty/tests/test_pretty.py::test_categories","sympy/printing/pretty/tests/test_pretty.py::test_PrettyModules","sympy/printing/pretty/tests/test_pretty.py::test_QuotientRing","sympy/printing/pretty/tests/test_pretty.py::test_Homomorphism","sympy/printing/pretty/tests/test_pretty.py::test_Tr","sympy/printing/pretty/tests/test_pretty.py::test_pretty_Add","sympy/printing/pretty/tests/test_pretty.py::test_issue_7179","sympy/printing/pretty/tests/test_pretty.py::test_issue_7180","sympy/printing/pretty/tests/test_pretty.py::test_pretty_Complement","sympy/printing/pretty/tests/test_pretty.py::test_pretty_SymmetricDifference","sympy/printing/pretty/tests/test_pretty.py::test_pretty_Contains","sympy/printing/pretty/tests/test_pretty.py::test_issue_8292","sympy/printing/pretty/tests/test_pretty.py::test_issue_4335","sympy/printing/pretty/tests/test_pretty.py::test_issue_8344","sympy/printing/pretty/tests/test_pretty.py::test_issue_6324","sympy/printing/pretty/tests/test_pretty.py::test_issue_7927","sympy/printing/pretty/tests/test_pretty.py::test_issue_6134","sympy/printing/tests/test_str.py::test_printmethod","sympy/printing/tests/test_str.py::test_Abs","sympy/printing/tests/test_str.py::test_Add","sympy/printing/tests/test_str.py::test_Catalan","sympy/printing/tests/test_str.py::test_ComplexInfinity","sympy/printing/tests/test_str.py::test_Derivative","sympy/printing/tests/test_str.py::test_dict","sympy/printing/tests/test_str.py::test_Dict","sympy/printing/tests/test_str.py::test_Dummy","sympy/printing/tests/test_str.py::test_EulerGamma","sympy/printing/tests/test_str.py::test_Exp","sympy/printing/tests/test_str.py::test_factorial","sympy/printing/tests/test_str.py::test_Function","sympy/printing/tests/test_str.py::test_Geometry","sympy/printing/tests/test_str.py::test_GoldenRatio","sympy/printing/tests/test_str.py::test_ImaginaryUnit","sympy/printing/tests/test_str.py::test_Infinity","sympy/printing/tests/test_str.py::test_Integer","sympy/printing/tests/test_str.py::test_Integral","sympy/printing/tests/test_str.py::test_Interval","sympy/printing/tests/test_str.py::test_Lambda","sympy/printing/tests/test_str.py::test_Limit","sympy/printing/tests/test_str.py::test_list","sympy/printing/tests/test_str.py::test_Matrix_str","sympy/printing/tests/test_str.py::test_Mul","sympy/printing/tests/test_str.py::test_NaN","sympy/printing/tests/test_str.py::test_NegativeInfinity","sympy/printing/tests/test_str.py::test_Order","sympy/printing/tests/test_str.py::test_Permutation_Cycle","sympy/printing/tests/test_str.py::test_Pi","sympy/printing/tests/test_str.py::test_Poly","sympy/printing/tests/test_str.py::test_PolyRing","sympy/printing/tests/test_str.py::test_FracField","sympy/printing/tests/test_str.py::test_PolyElement","sympy/printing/tests/test_str.py::test_FracElement","sympy/printing/tests/test_str.py::test_Pow","sympy/printing/tests/test_str.py::test_sqrt","sympy/printing/tests/test_str.py::test_Rational","sympy/printing/tests/test_str.py::test_Float","sympy/printing/tests/test_str.py::test_Relational","sympy/printing/tests/test_str.py::test_RootOf","sympy/printing/tests/test_str.py::test_RootSum","sympy/printing/tests/test_str.py::test_GroebnerBasis","sympy/printing/tests/test_str.py::test_set","sympy/printing/tests/test_str.py::test_SparseMatrix","sympy/printing/tests/test_str.py::test_Sum","sympy/printing/tests/test_str.py::test_Symbol","sympy/printing/tests/test_str.py::test_tuple","sympy/printing/tests/test_str.py::test_Unit","sympy/printing/tests/test_str.py::test_wild_str","sympy/printing/tests/test_str.py::test_zeta","sympy/printing/tests/test_str.py::test_issue_3101","sympy/printing/tests/test_str.py::test_issue_3103","sympy/printing/tests/test_str.py::test_issue_4021","sympy/printing/tests/test_str.py::test_sstrrepr","sympy/printing/tests/test_str.py::test_infinity","sympy/printing/tests/test_str.py::test_full_prec","sympy/printing/tests/test_str.py::test_noncommutative","sympy/printing/tests/test_str.py::test_empty_printer","sympy/printing/tests/test_str.py::test_settings","sympy/printing/tests/test_str.py::test_RandomDomain","sympy/printing/tests/test_str.py::test_FiniteSet","sympy/printing/tests/test_str.py::test_PrettyPoly","sympy/printing/tests/test_str.py::test_categories","sympy/printing/tests/test_str.py::test_Tr","sympy/printing/tests/test_str.py::test_issue_6387","sympy/printing/tests/test_str.py::test_MatMul_MatAdd","sympy/printing/tests/test_str.py::test_MatrixSlice","sympy/printing/tests/test_str.py::test_true_false","sympy/printing/tests/test_str.py::test_Equivalent","sympy/printing/tests/test_str.py::test_Xor","sympy/printing/tests/test_str.py::test_Complement","sympy/printing/tests/test_str.py::test_SymmetricDifference"],"string":"[\n \"sympy/core/tests/test_numbers.py::test_integers_cache\",\n \"sympy/core/tests/test_numbers.py::test_seterr\",\n \"sympy/core/tests/test_numbers.py::test_mod\",\n \"sympy/core/tests/test_numbers.py::test_divmod\",\n \"sympy/core/tests/test_numbers.py::test_igcd\",\n \"sympy/core/tests/test_numbers.py::test_ilcm\",\n \"sympy/core/tests/test_numbers.py::test_igcdex\",\n \"sympy/core/tests/test_numbers.py::test_Integer_new\",\n \"sympy/core/tests/test_numbers.py::test_Rational_new\",\n \"sympy/core/tests/test_numbers.py::test_Number_new\",\n \"sympy/core/tests/test_numbers.py::test_Rational_cmp\",\n \"sympy/core/tests/test_numbers.py::test_Float\",\n \"sympy/core/tests/test_numbers.py::test_Float_default_to_highprec_from_str\",\n \"sympy/core/tests/test_numbers.py::test_Float_eval\",\n \"sympy/core/tests/test_numbers.py::test_Float_issue_2107\",\n \"sympy/core/tests/test_numbers.py::test_Infinity\",\n \"sympy/core/tests/test_numbers.py::test_Infinity_2\",\n \"sympy/core/tests/test_numbers.py::test_Mul_Infinity_Zero\",\n \"sympy/core/tests/test_numbers.py::test_Div_By_Zero\",\n \"sympy/core/tests/test_numbers.py::test_Infinity_inequations\",\n \"sympy/core/tests/test_numbers.py::test_NaN\",\n \"sympy/core/tests/test_numbers.py::test_special_numbers\",\n \"sympy/core/tests/test_numbers.py::test_powers\",\n \"sympy/core/tests/test_numbers.py::test_integer_nthroot_overflow\",\n \"sympy/core/tests/test_numbers.py::test_powers_Integer\",\n \"sympy/core/tests/test_numbers.py::test_powers_Rational\",\n \"sympy/core/tests/test_numbers.py::test_powers_Float\",\n \"sympy/core/tests/test_numbers.py::test_abs1\",\n \"sympy/core/tests/test_numbers.py::test_accept_int\",\n \"sympy/core/tests/test_numbers.py::test_dont_accept_str\",\n \"sympy/core/tests/test_numbers.py::test_int\",\n \"sympy/core/tests/test_numbers.py::test_long\",\n \"sympy/core/tests/test_numbers.py::test_real_bug\",\n \"sympy/core/tests/test_numbers.py::test_bug_sqrt\",\n \"sympy/core/tests/test_numbers.py::test_pi_Pi\",\n \"sympy/core/tests/test_numbers.py::test_no_len\",\n \"sympy/core/tests/test_numbers.py::test_issue_3321\",\n \"sympy/core/tests/test_numbers.py::test_issue_3692\",\n \"sympy/core/tests/test_numbers.py::test_issue_3423\",\n \"sympy/core/tests/test_numbers.py::test_issue_3449\",\n \"sympy/core/tests/test_numbers.py::test_Integer_factors\",\n \"sympy/core/tests/test_numbers.py::test_Rational_factors\",\n \"sympy/core/tests/test_numbers.py::test_issue_4107\",\n \"sympy/core/tests/test_numbers.py::test_IntegerInteger\",\n \"sympy/core/tests/test_numbers.py::test_Rational_gcd_lcm_cofactors\",\n \"sympy/core/tests/test_numbers.py::test_Float_gcd_lcm_cofactors\",\n \"sympy/core/tests/test_numbers.py::test_issue_4611\",\n \"sympy/core/tests/test_numbers.py::test_conversion_to_mpmath\",\n \"sympy/core/tests/test_numbers.py::test_relational\",\n \"sympy/core/tests/test_numbers.py::test_Integer_as_index\",\n \"sympy/core/tests/test_numbers.py::test_Rational_int\",\n \"sympy/core/tests/test_numbers.py::test_zoo\",\n \"sympy/core/tests/test_numbers.py::test_issue_4122\",\n \"sympy/core/tests/test_numbers.py::test_GoldenRatio_expand\",\n \"sympy/core/tests/test_numbers.py::test_as_content_primitive\",\n \"sympy/core/tests/test_numbers.py::test_hashing_sympy_integers\",\n \"sympy/core/tests/test_numbers.py::test_issue_4172\",\n \"sympy/core/tests/test_numbers.py::test_Catalan_EulerGamma_prec\",\n \"sympy/core/tests/test_numbers.py::test_Float_eq\",\n \"sympy/core/tests/test_numbers.py::test_int_NumberSymbols\",\n \"sympy/core/tests/test_numbers.py::test_issue_6640\",\n \"sympy/core/tests/test_numbers.py::test_issue_6349\",\n \"sympy/core/tests/test_numbers.py::test_mpf_norm\",\n \"sympy/core/tests/test_numbers.py::test_latex\",\n \"sympy/core/tests/test_numbers.py::test_issue_7742\",\n \"sympy/core/tests/test_numbers.py::test_simplify_AlgebraicNumber\",\n \"sympy/core/tests/test_numbers.py::test_Float_idempotence\",\n \"sympy/core/tests/test_numbers.py::test_comp\",\n \"sympy/core/tests/test_numbers.py::test_issue_9491\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_ascii_str\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_unicode_str\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_upretty_greek\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_upretty_multiindex\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_upretty_sub_super\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_upretty_subs_missing_in_24\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_upretty_modifiers\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_basic\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_negative_fractions\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_issue_5524\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_ordering\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_relational\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_issue_7117\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_rational\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_functions\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_sqrt\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_sqrt_char_knob\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_sqrt_longsymbol_no_sqrt_char\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_KroneckerDelta\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_product\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_lambda\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_order\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_derivatives\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_integrals\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_matrix\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_Adjoint\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_piecewise\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_seq\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_any_object_in_sequence\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_sets\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_ConditionSet\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_ComplexRegion\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_ProductSet_paranthesis\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_sequences\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_FourierSeries\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_FormalPowerSeries\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_limits\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_RootOf\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_RootSum\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_GroebnerBasis\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_Boolean\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_Domain\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_prec\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pprint\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_class\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_no_wrap_line\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_settings\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_sum\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_units\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_Subs\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_gammas\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_hyper\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_meijerg\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_noncommutative\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_special_functions\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_geometry\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_expint\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_elliptic_functions\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_RandomDomain\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_PrettyPoly\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_issue_6285\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_issue_6359\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_issue_6739\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_complicated_symbol_unchanged\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_categories\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_PrettyModules\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_QuotientRing\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_Homomorphism\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_Tr\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_Add\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_issue_7179\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_issue_7180\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_Complement\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_SymmetricDifference\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_pretty_Contains\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_issue_8292\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_issue_4335\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_issue_8344\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_issue_6324\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_issue_7927\",\n \"sympy/printing/pretty/tests/test_pretty.py::test_issue_6134\",\n \"sympy/printing/tests/test_str.py::test_printmethod\",\n \"sympy/printing/tests/test_str.py::test_Abs\",\n \"sympy/printing/tests/test_str.py::test_Add\",\n \"sympy/printing/tests/test_str.py::test_Catalan\",\n \"sympy/printing/tests/test_str.py::test_ComplexInfinity\",\n \"sympy/printing/tests/test_str.py::test_Derivative\",\n \"sympy/printing/tests/test_str.py::test_dict\",\n \"sympy/printing/tests/test_str.py::test_Dict\",\n \"sympy/printing/tests/test_str.py::test_Dummy\",\n \"sympy/printing/tests/test_str.py::test_EulerGamma\",\n \"sympy/printing/tests/test_str.py::test_Exp\",\n \"sympy/printing/tests/test_str.py::test_factorial\",\n \"sympy/printing/tests/test_str.py::test_Function\",\n \"sympy/printing/tests/test_str.py::test_Geometry\",\n \"sympy/printing/tests/test_str.py::test_GoldenRatio\",\n \"sympy/printing/tests/test_str.py::test_ImaginaryUnit\",\n \"sympy/printing/tests/test_str.py::test_Infinity\",\n \"sympy/printing/tests/test_str.py::test_Integer\",\n \"sympy/printing/tests/test_str.py::test_Integral\",\n \"sympy/printing/tests/test_str.py::test_Interval\",\n \"sympy/printing/tests/test_str.py::test_Lambda\",\n \"sympy/printing/tests/test_str.py::test_Limit\",\n \"sympy/printing/tests/test_str.py::test_list\",\n \"sympy/printing/tests/test_str.py::test_Matrix_str\",\n \"sympy/printing/tests/test_str.py::test_Mul\",\n \"sympy/printing/tests/test_str.py::test_NaN\",\n \"sympy/printing/tests/test_str.py::test_NegativeInfinity\",\n \"sympy/printing/tests/test_str.py::test_Order\",\n \"sympy/printing/tests/test_str.py::test_Permutation_Cycle\",\n \"sympy/printing/tests/test_str.py::test_Pi\",\n \"sympy/printing/tests/test_str.py::test_Poly\",\n \"sympy/printing/tests/test_str.py::test_PolyRing\",\n \"sympy/printing/tests/test_str.py::test_FracField\",\n \"sympy/printing/tests/test_str.py::test_PolyElement\",\n \"sympy/printing/tests/test_str.py::test_FracElement\",\n \"sympy/printing/tests/test_str.py::test_Pow\",\n \"sympy/printing/tests/test_str.py::test_sqrt\",\n \"sympy/printing/tests/test_str.py::test_Rational\",\n \"sympy/printing/tests/test_str.py::test_Float\",\n \"sympy/printing/tests/test_str.py::test_Relational\",\n \"sympy/printing/tests/test_str.py::test_RootOf\",\n \"sympy/printing/tests/test_str.py::test_RootSum\",\n \"sympy/printing/tests/test_str.py::test_GroebnerBasis\",\n \"sympy/printing/tests/test_str.py::test_set\",\n \"sympy/printing/tests/test_str.py::test_SparseMatrix\",\n \"sympy/printing/tests/test_str.py::test_Sum\",\n \"sympy/printing/tests/test_str.py::test_Symbol\",\n \"sympy/printing/tests/test_str.py::test_tuple\",\n \"sympy/printing/tests/test_str.py::test_Unit\",\n \"sympy/printing/tests/test_str.py::test_wild_str\",\n \"sympy/printing/tests/test_str.py::test_zeta\",\n \"sympy/printing/tests/test_str.py::test_issue_3101\",\n \"sympy/printing/tests/test_str.py::test_issue_3103\",\n \"sympy/printing/tests/test_str.py::test_issue_4021\",\n \"sympy/printing/tests/test_str.py::test_sstrrepr\",\n \"sympy/printing/tests/test_str.py::test_infinity\",\n \"sympy/printing/tests/test_str.py::test_full_prec\",\n \"sympy/printing/tests/test_str.py::test_noncommutative\",\n \"sympy/printing/tests/test_str.py::test_empty_printer\",\n \"sympy/printing/tests/test_str.py::test_settings\",\n \"sympy/printing/tests/test_str.py::test_RandomDomain\",\n \"sympy/printing/tests/test_str.py::test_FiniteSet\",\n \"sympy/printing/tests/test_str.py::test_PrettyPoly\",\n \"sympy/printing/tests/test_str.py::test_categories\",\n \"sympy/printing/tests/test_str.py::test_Tr\",\n \"sympy/printing/tests/test_str.py::test_issue_6387\",\n \"sympy/printing/tests/test_str.py::test_MatMul_MatAdd\",\n \"sympy/printing/tests/test_str.py::test_MatrixSlice\",\n \"sympy/printing/tests/test_str.py::test_true_false\",\n \"sympy/printing/tests/test_str.py::test_Equivalent\",\n \"sympy/printing/tests/test_str.py::test_Xor\",\n \"sympy/printing/tests/test_str.py::test_Complement\",\n \"sympy/printing/tests/test_str.py::test_SymmetricDifference\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"BSD"},"__index_level_0__":{"kind":"number","value":278,"string":"278"}}},{"rowIdx":279,"cells":{"instance_id":{"kind":"string","value":"scrapy__scrapy-1563"},"base_commit":{"kind":"string","value":"dd9f777ba725d7a7dbb192302cc52a120005ad64"},"created_at":{"kind":"string","value":"2015-10-29 06:21:42"},"environment_setup_commit":{"kind":"string","value":"6aa85aee2a274393307ac3e777180fcbdbdc9848"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/scrapy/http/request/form.py b/scrapy/http/request/form.py\nindex a12a2fd07..4a9bd732e 100644\n--- a/scrapy/http/request/form.py\n+++ b/scrapy/http/request/form.py\n@@ -11,6 +11,7 @@ from parsel.selector import create_root_node\n import six\n from scrapy.http.request import Request\n from scrapy.utils.python import to_bytes, is_listlike\n+from scrapy.utils.response import get_base_url\n \n \n class FormRequest(Request):\n@@ -44,7 +45,7 @@ class FormRequest(Request):\n \n def _get_form_url(form, url):\n if url is None:\n- return form.action or form.base_url\n+ return urljoin(form.base_url, form.action)\n return urljoin(form.base_url, url)\n \n \n@@ -58,7 +59,7 @@ def _urlencode(seq, enc):\n def _get_form(response, formname, formid, formnumber, formxpath):\n \"\"\"Find the form element \"\"\"\n text = response.body_as_unicode()\n- root = create_root_node(text, lxml.html.HTMLParser, base_url=response.url)\n+ root = create_root_node(text, lxml.html.HTMLParser, base_url=get_base_url(response))\n forms = root.xpath('//form')\n if not forms:\n raise ValueError(\"No
element found in %s\" % response)\n"},"problem_statement":{"kind":"string","value":"[Bug] Incorrectly picked URL in `scrapy.http.FormRequest.from_response` when there is a `` tag\n## Issue Description\r\n\r\nIncorrectly picked URL in `scrapy.http.FormRequest.from_response` when there is a `` tag.\r\n\r\n## How to Reproduce the Issue & Version Used\r\n\r\n```\r\n[pengyu@GLaDOS tmp]$ python2\r\nPython 2.7.10 (default, Sep 7 2015, 13:51:49) \r\n[GCC 5.2.0] on linux2\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import scrapy\r\n>>> scrapy.__version__\r\nu'1.0.3'\r\n>>> html_body = '''\r\n... \r\n... \r\n... \r\n... \r\n... \r\n... \r\n...
\r\n... \r\n... \r\n... '''\r\n>>> response = scrapy.http.TextResponse(url='http://a.com/', body=html_body)\r\n>>> request = scrapy.http.FormRequest.from_response(response)\r\n>>> request.url\r\n'http://a.com/test_form'\r\n```\r\n\r\n## Expected Result\r\n\r\n`request.url` shall be `'http://b.com/test_form'`\r\n\r\n## Suggested Fix\r\n\r\nThe issue can be fixed by fixing a few lines in `scrapy/http/request/form.py`"},"repo":{"kind":"string","value":"scrapy/scrapy"},"test_patch":{"kind":"string","value":"diff --git a/tests/test_http_request.py b/tests/test_http_request.py\nindex ff0941961..60fd855dd 100644\n--- a/tests/test_http_request.py\n+++ b/tests/test_http_request.py\n@@ -801,6 +801,25 @@ class FormRequestTest(RequestTest):\n self.assertEqual(fs[b'test2'], [b'val2'])\n self.assertEqual(fs[b'button1'], [b''])\n \n+ def test_html_base_form_action(self):\n+ response = _buildresponse(\n+ \"\"\"\n+ \n+ \n+ \n+ \n+ \n+
\n+
\n+ \n+ \n+ \"\"\",\n+ url='http://a.com/'\n+ )\n+ req = self.request_class.from_response(response)\n+ self.assertEqual(req.url, 'http://b.com/test_form')\n+\n+\n def _buildresponse(body, **kwargs):\n kwargs.setdefault('body', body)\n kwargs.setdefault('url', 'http://example.com')\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_hyperlinks\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 1,\n \"issue_text_score\": 0,\n \"test_score\": 0\n },\n \"num_modified_files\": 1\n}"},"version":{"kind":"string","value":"1.0"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"requirements.txt\",\n \"pip_packages\": [\n \"pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libssl-dev\"\n ],\n \"python\": \"3.9\",\n \"reqs_path\": [\n \"requirements.txt\"\n ],\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"attrs==25.3.0\nAutomat==24.8.1\ncffi==1.17.1\nconstantly==23.10.4\ncoverage==7.8.0\ncryptography==44.0.2\ncssselect==1.3.0\nexceptiongroup==1.2.2\nexecnet==2.1.1\nhyperlink==21.0.0\nidna==3.10\nincremental==24.7.2\niniconfig==2.1.0\njmespath==1.0.1\nlxml==5.3.1\npackaging==24.2\nparsel==1.10.0\npluggy==1.5.0\npyasn1==0.6.1\npyasn1_modules==0.4.2\npycparser==2.22\nPyDispatcher==2.0.7\npyOpenSSL==25.0.0\npytest==8.3.5\npytest-asyncio==0.26.0\npytest-cov==6.0.0\npytest-mock==3.14.0\npytest-xdist==3.6.1\nqueuelib==1.7.0\n-e git+https://github.com/scrapy/scrapy.git@dd9f777ba725d7a7dbb192302cc52a120005ad64#egg=Scrapy\nservice-identity==24.2.0\nsix==1.17.0\ntomli==2.2.1\nTwisted==24.11.0\ntyping_extensions==4.13.0\nw3lib==2.3.1\nzope.interface==7.2\n"},"environment":{"kind":"string","value":"name: scrapy\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - ca-certificates=2025.2.25=h06a4308_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.4.4=h6a678d5_1\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=3.0.16=h5eee18b_0\n - pip=25.0=py39h06a4308_0\n - python=3.9.21=he870216_1\n - readline=8.2=h5eee18b_0\n - setuptools=75.8.0=py39h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - tzdata=2025a=h04d1e81_0\n - wheel=0.45.1=py39h06a4308_0\n - xz=5.6.4=h5eee18b_1\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - attrs==25.3.0\n - automat==24.8.1\n - cffi==1.17.1\n - constantly==23.10.4\n - coverage==7.8.0\n - cryptography==44.0.2\n - cssselect==1.3.0\n - exceptiongroup==1.2.2\n - execnet==2.1.1\n - hyperlink==21.0.0\n - idna==3.10\n - incremental==24.7.2\n - iniconfig==2.1.0\n - jmespath==1.0.1\n - lxml==5.3.1\n - packaging==24.2\n - parsel==1.10.0\n - pluggy==1.5.0\n - pyasn1==0.6.1\n - pyasn1-modules==0.4.2\n - pycparser==2.22\n - pydispatcher==2.0.7\n - pyopenssl==25.0.0\n - pytest==8.3.5\n - pytest-asyncio==0.26.0\n - pytest-cov==6.0.0\n - pytest-mock==3.14.0\n - pytest-xdist==3.6.1\n - queuelib==1.7.0\n - service-identity==24.2.0\n - six==1.17.0\n - tomli==2.2.1\n - twisted==24.11.0\n - typing-extensions==4.13.0\n - w3lib==2.3.1\n - zope-interface==7.2\nprefix: /opt/conda/envs/scrapy\n"},"FAIL_TO_PASS":{"kind":"list like","value":["tests/test_http_request.py::FormRequestTest::test_html_base_form_action"],"string":"[\n \"tests/test_http_request.py::FormRequestTest::test_html_base_form_action\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":["tests/test_http_request.py::FormRequestTest::test_from_response_button_notype","tests/test_http_request.py::FormRequestTest::test_from_response_button_novalue","tests/test_http_request.py::FormRequestTest::test_from_response_button_submit","tests/test_http_request.py::FormRequestTest::test_from_response_checkbox","tests/test_http_request.py::FormRequestTest::test_from_response_descendants","tests/test_http_request.py::FormRequestTest::test_from_response_dont_click","tests/test_http_request.py::FormRequestTest::test_from_response_dont_submit_image_as_input","tests/test_http_request.py::FormRequestTest::test_from_response_dont_submit_reset_as_input","tests/test_http_request.py::FormRequestTest::test_from_response_formid_exists","tests/test_http_request.py::FormRequestTest::test_from_response_formid_notexist","tests/test_http_request.py::FormRequestTest::test_from_response_formname_exists","tests/test_http_request.py::FormRequestTest::test_from_response_formname_notexist","tests/test_http_request.py::FormRequestTest::test_from_response_formname_notexists_fallback_formid","tests/test_http_request.py::FormRequestTest::test_from_response_get","tests/test_http_request.py::FormRequestTest::test_from_response_input_hidden","tests/test_http_request.py::FormRequestTest::test_from_response_input_text","tests/test_http_request.py::FormRequestTest::test_from_response_input_textarea","tests/test_http_request.py::FormRequestTest::test_from_response_invalid_html5","tests/test_http_request.py::FormRequestTest::test_from_response_multiple_clickdata","tests/test_http_request.py::FormRequestTest::test_from_response_multiple_forms_clickdata","tests/test_http_request.py::FormRequestTest::test_from_response_noformname","tests/test_http_request.py::FormRequestTest::test_from_response_nr_index_clickdata","tests/test_http_request.py::FormRequestTest::test_from_response_override_clickable","tests/test_http_request.py::FormRequestTest::test_from_response_override_params","tests/test_http_request.py::FormRequestTest::test_from_response_post","tests/test_http_request.py::FormRequestTest::test_from_response_radio","tests/test_http_request.py::FormRequestTest::test_from_response_select","tests/test_http_request.py::FormRequestTest::test_from_response_submit_first_clickable","tests/test_http_request.py::FormRequestTest::test_from_response_submit_not_first_clickable","tests/test_http_request.py::FormRequestTest::test_from_response_submit_novalue","tests/test_http_request.py::FormRequestTest::test_from_response_unicode_clickdata","tests/test_http_request.py::FormRequestTest::test_from_response_xpath"],"string":"[\n \"tests/test_http_request.py::FormRequestTest::test_from_response_button_notype\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_button_novalue\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_button_submit\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_checkbox\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_descendants\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_dont_click\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_dont_submit_image_as_input\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_dont_submit_reset_as_input\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_formid_exists\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_formid_notexist\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_formname_exists\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_formname_notexist\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_formname_notexists_fallback_formid\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_get\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_input_hidden\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_input_text\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_input_textarea\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_invalid_html5\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_multiple_clickdata\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_multiple_forms_clickdata\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_noformname\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_nr_index_clickdata\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_override_clickable\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_override_params\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_post\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_radio\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_select\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_submit_first_clickable\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_submit_not_first_clickable\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_submit_novalue\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_unicode_clickdata\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_xpath\"\n]"},"PASS_TO_PASS":{"kind":"list like","value":["tests/test_http_request.py::RequestTest::test_ajax_url","tests/test_http_request.py::RequestTest::test_body","tests/test_http_request.py::RequestTest::test_copy","tests/test_http_request.py::RequestTest::test_copy_inherited_classes","tests/test_http_request.py::RequestTest::test_eq","tests/test_http_request.py::RequestTest::test_headers","tests/test_http_request.py::RequestTest::test_immutable_attributes","tests/test_http_request.py::RequestTest::test_init","tests/test_http_request.py::RequestTest::test_method_always_str","tests/test_http_request.py::RequestTest::test_replace","tests/test_http_request.py::RequestTest::test_url","tests/test_http_request.py::RequestTest::test_url_no_scheme","tests/test_http_request.py::RequestTest::test_url_quoting","tests/test_http_request.py::FormRequestTest::test_ajax_url","tests/test_http_request.py::FormRequestTest::test_body","tests/test_http_request.py::FormRequestTest::test_copy","tests/test_http_request.py::FormRequestTest::test_copy_inherited_classes","tests/test_http_request.py::FormRequestTest::test_custom_encoding","tests/test_http_request.py::FormRequestTest::test_empty_formdata","tests/test_http_request.py::FormRequestTest::test_eq","tests/test_http_request.py::FormRequestTest::test_from_response_ambiguous_clickdata","tests/test_http_request.py::FormRequestTest::test_from_response_errors_formnumber","tests/test_http_request.py::FormRequestTest::test_from_response_errors_noform","tests/test_http_request.py::FormRequestTest::test_from_response_extra_headers","tests/test_http_request.py::FormRequestTest::test_from_response_formid_errors_formnumber","tests/test_http_request.py::FormRequestTest::test_from_response_formname_errors_formnumber","tests/test_http_request.py::FormRequestTest::test_from_response_invalid_nr_index_clickdata","tests/test_http_request.py::FormRequestTest::test_from_response_non_matching_clickdata","tests/test_http_request.py::FormRequestTest::test_from_response_override_method","tests/test_http_request.py::FormRequestTest::test_from_response_override_url","tests/test_http_request.py::FormRequestTest::test_headers","tests/test_http_request.py::FormRequestTest::test_immutable_attributes","tests/test_http_request.py::FormRequestTest::test_init","tests/test_http_request.py::FormRequestTest::test_method_always_str","tests/test_http_request.py::FormRequestTest::test_multi_key_values","tests/test_http_request.py::FormRequestTest::test_replace","tests/test_http_request.py::FormRequestTest::test_url","tests/test_http_request.py::FormRequestTest::test_url_no_scheme","tests/test_http_request.py::FormRequestTest::test_url_quoting","tests/test_http_request.py::XmlRpcRequestTest::test_ajax_url","tests/test_http_request.py::XmlRpcRequestTest::test_body","tests/test_http_request.py::XmlRpcRequestTest::test_copy","tests/test_http_request.py::XmlRpcRequestTest::test_copy_inherited_classes","tests/test_http_request.py::XmlRpcRequestTest::test_eq","tests/test_http_request.py::XmlRpcRequestTest::test_headers","tests/test_http_request.py::XmlRpcRequestTest::test_immutable_attributes","tests/test_http_request.py::XmlRpcRequestTest::test_init","tests/test_http_request.py::XmlRpcRequestTest::test_method_always_str","tests/test_http_request.py::XmlRpcRequestTest::test_replace","tests/test_http_request.py::XmlRpcRequestTest::test_url","tests/test_http_request.py::XmlRpcRequestTest::test_url_no_scheme","tests/test_http_request.py::XmlRpcRequestTest::test_url_quoting","tests/test_http_request.py::XmlRpcRequestTest::test_xmlrpc_dumps"],"string":"[\n \"tests/test_http_request.py::RequestTest::test_ajax_url\",\n \"tests/test_http_request.py::RequestTest::test_body\",\n \"tests/test_http_request.py::RequestTest::test_copy\",\n \"tests/test_http_request.py::RequestTest::test_copy_inherited_classes\",\n \"tests/test_http_request.py::RequestTest::test_eq\",\n \"tests/test_http_request.py::RequestTest::test_headers\",\n \"tests/test_http_request.py::RequestTest::test_immutable_attributes\",\n \"tests/test_http_request.py::RequestTest::test_init\",\n \"tests/test_http_request.py::RequestTest::test_method_always_str\",\n \"tests/test_http_request.py::RequestTest::test_replace\",\n \"tests/test_http_request.py::RequestTest::test_url\",\n \"tests/test_http_request.py::RequestTest::test_url_no_scheme\",\n \"tests/test_http_request.py::RequestTest::test_url_quoting\",\n \"tests/test_http_request.py::FormRequestTest::test_ajax_url\",\n \"tests/test_http_request.py::FormRequestTest::test_body\",\n \"tests/test_http_request.py::FormRequestTest::test_copy\",\n \"tests/test_http_request.py::FormRequestTest::test_copy_inherited_classes\",\n \"tests/test_http_request.py::FormRequestTest::test_custom_encoding\",\n \"tests/test_http_request.py::FormRequestTest::test_empty_formdata\",\n \"tests/test_http_request.py::FormRequestTest::test_eq\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_ambiguous_clickdata\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_errors_formnumber\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_errors_noform\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_extra_headers\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_formid_errors_formnumber\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_formname_errors_formnumber\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_invalid_nr_index_clickdata\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_non_matching_clickdata\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_override_method\",\n \"tests/test_http_request.py::FormRequestTest::test_from_response_override_url\",\n \"tests/test_http_request.py::FormRequestTest::test_headers\",\n \"tests/test_http_request.py::FormRequestTest::test_immutable_attributes\",\n \"tests/test_http_request.py::FormRequestTest::test_init\",\n \"tests/test_http_request.py::FormRequestTest::test_method_always_str\",\n \"tests/test_http_request.py::FormRequestTest::test_multi_key_values\",\n \"tests/test_http_request.py::FormRequestTest::test_replace\",\n \"tests/test_http_request.py::FormRequestTest::test_url\",\n \"tests/test_http_request.py::FormRequestTest::test_url_no_scheme\",\n \"tests/test_http_request.py::FormRequestTest::test_url_quoting\",\n \"tests/test_http_request.py::XmlRpcRequestTest::test_ajax_url\",\n \"tests/test_http_request.py::XmlRpcRequestTest::test_body\",\n \"tests/test_http_request.py::XmlRpcRequestTest::test_copy\",\n \"tests/test_http_request.py::XmlRpcRequestTest::test_copy_inherited_classes\",\n \"tests/test_http_request.py::XmlRpcRequestTest::test_eq\",\n \"tests/test_http_request.py::XmlRpcRequestTest::test_headers\",\n \"tests/test_http_request.py::XmlRpcRequestTest::test_immutable_attributes\",\n \"tests/test_http_request.py::XmlRpcRequestTest::test_init\",\n \"tests/test_http_request.py::XmlRpcRequestTest::test_method_always_str\",\n \"tests/test_http_request.py::XmlRpcRequestTest::test_replace\",\n \"tests/test_http_request.py::XmlRpcRequestTest::test_url\",\n \"tests/test_http_request.py::XmlRpcRequestTest::test_url_no_scheme\",\n \"tests/test_http_request.py::XmlRpcRequestTest::test_url_quoting\",\n \"tests/test_http_request.py::XmlRpcRequestTest::test_xmlrpc_dumps\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"BSD 3-Clause \"New\" or \"Revised\" License"},"__index_level_0__":{"kind":"number","value":279,"string":"279"}}},{"rowIdx":280,"cells":{"instance_id":{"kind":"string","value":"joblib__joblib-262"},"base_commit":{"kind":"string","value":"aeb018af545e025654176ffe9ae876bda1bddb89"},"created_at":{"kind":"string","value":"2015-10-29 12:40:19"},"environment_setup_commit":{"kind":"string","value":"40341615cc2600675ce7457d9128fb030f6f89fa"},"hints_text":{"kind":"string","value":"lesteve: > Maybe I'm wrong, but why not adding here a condition \"not obj.dtype.hasobject\" and keep the previous behavior (using the except) ?\r\n\r\nWe could do that I am just slightly worried that this try except is not a very clean way of hiding failures. A few weird behaviours we recently saw:\r\n* for Python 2.6 and @aabadie's PR with `with gzip.GZipFile as f`, you get a failure when you exit the context manager, meaning that you actually write a valid .z auxiliary file but then still pickle the array inside the master file because you encountered an error. This auxiliary file is never deleted.\r\n* for Python 3, when trying to dump an array with dtype object, you encountered an error quite early on but you still write an invalid .z auxiliary file with just the header. This auxiliary file is never deleted.\r\n* for Python 2.7, when trying to dump an array with dtype object, you don't even encounter an error and you end up writing str(array). You only see the problem at load time.\r\n\r\n@aabadie as an aside, just a gentle reminder: always better to comment in the \"Files changed\" tab rather than in individual commits.\r\n"},"patch":{"kind":"string","value":"diff --git a/joblib/numpy_pickle.py b/joblib/numpy_pickle.py\nindex 6d727d6..f2d43eb 100644\n--- a/joblib/numpy_pickle.py\n+++ b/joblib/numpy_pickle.py\n@@ -215,7 +215,7 @@ class NumpyPickler(Pickler):\n else:\n self.file = BytesIO()\n # Count the number of npy files that we have created:\n- self._npy_counter = 0\n+ self._npy_counter = 1\n # By default we want a pickle protocol that only changes with\n # the major python version and not the minor one\n if protocol is None:\n@@ -257,8 +257,8 @@ class NumpyPickler(Pickler):\n files, rather than pickling them. Of course, this is a\n total abuse of the Pickler class.\n \"\"\"\n- if self.np is not None and type(obj) in (self.np.ndarray,\n- self.np.matrix, self.np.memmap):\n+ if (self.np is not None and type(obj) in\n+ (self.np.ndarray, self.np.matrix, self.np.memmap)):\n size = obj.size * obj.itemsize\n if self.compress and size < self.cache_size * _MEGA:\n # When compressing, as we are not writing directly to the\n@@ -267,19 +267,21 @@ class NumpyPickler(Pickler):\n # Pickling doesn't work with memmaped arrays\n obj = self.np.asarray(obj)\n return Pickler.save(self, obj)\n- self._npy_counter += 1\n- try:\n- filename = '%s_%02i.npy' % (self._filename,\n- self._npy_counter)\n- # This converts the array in a container\n- obj, filename = self._write_array(obj, filename)\n- self._filenames.append(filename)\n- except:\n- self._npy_counter -= 1\n- # XXX: We should have a logging mechanism\n- print('Failed to save %s to .npy file:\\n%s' % (\n+\n+ if not obj.dtype.hasobject:\n+ try:\n+ filename = '%s_%02i.npy' % (self._filename,\n+ self._npy_counter)\n+ # This converts the array in a container\n+ obj, filename = self._write_array(obj, filename)\n+ self._filenames.append(filename)\n+ self._npy_counter += 1\n+ except Exception:\n+ # XXX: We should have a logging mechanism\n+ print('Failed to save %s to .npy file:\\n%s' % (\n type(obj),\n traceback.format_exc()))\n+\n return Pickler.save(self, obj)\n \n def close(self):\n"},"problem_statement":{"kind":"string","value":"joblib.dump bug with too large object-type arrays\nissue from\r\nhttps://github.com/scikit-learn/scikit-learn/issues/4889\r\nThe code\r\n```python\r\nimport joblib\r\nimport os\r\nimport numpy as np\r\nfrom gzip import GzipFile\r\nfrom io import BytesIO\r\nfrom urllib2 import urlopen\r\nfrom os.path import join\r\nfrom sklearn.datasets import get_data_home\r\n\r\nURL10 = ('http://archive.ics.uci.edu/ml/'\r\n 'machine-learning-databases/kddcup99-mld/kddcup.data_10_percent.gz')\r\n\r\ndata_home = get_data_home()\r\nkddcup_dir = join(data_home, \"test\")\r\nsamples_path = join(kddcup_dir, \"samples\")\r\nos.makedirs(kddcup_dir)\r\nf = BytesIO(urlopen(URL10).read())\r\nfile = GzipFile(fileobj=f, mode='r')\r\n\r\nX = []\r\nfor line in file.readlines():\r\n X.append(line.replace('\\n', '').split(','))\r\n\r\nfile.close()\r\nX = np.asarray(X, dtype=object)\r\njoblib.dump(X, samples_path, compress=9)\r\nX = joblib.load(samples_path)\r\n```\r\nMore precisely, it works if X has less than 300000 lines or if X is not of dtype `object`:\r\n```python\r\nY = X[:300000,:] ### works\r\njoblib.dump(Y, samples_path, compress=9)\r\nY = joblib.load(samples_path)\r\n###\r\nY = X[:400000,:].astype(str) ### works\r\njoblib.dump(Y, samples_path, compress=9)\r\nY = joblib.load(samples_path)\r\n###\r\nY = X[:400000,:] ### doesnt work\r\njoblib.dump(Y, samples_path, compress=9)\r\nY = joblib.load(samples_path)\r\n```\r\n\r\nThe error raised by joblib.load is \r\n```\r\n---------------------------------------------------------------------------\r\nAssertionError Traceback (most recent call last)\r\n in ()\r\n----> 1 Y = joblib.load(samples_path)\r\n\r\n/usr/lib/python2.7/dist-packages/joblib/numpy_pickle.pyc in load(filename, mmap_mode)\r\n 422 \r\n 423 try:\r\n--> 424 obj = unpickler.load()\r\n 425 finally:\r\n 426 if hasattr(unpickler, 'file_handle'):\r\n\r\n/usr/lib/python2.7/pickle.pyc in load(self)\r\n 856 while 1:\r\n 857 key = read(1)\r\n--> 858 dispatch[key](self)\r\n 859 except _Stop, stopinst:\r\n 860 return stopinst.value\r\n\r\n/usr/lib/python2.7/dist-packages/joblib/numpy_pickle.pyc in load_build(self)\r\n 288 \"but numpy didn't import correctly\")\r\n 289 nd_array_wrapper = self.stack.pop()\r\n--> 290 array = nd_array_wrapper.read(self)\r\n 291 self.stack.append(array)\r\n 292 \r\n\r\n/usr/lib/python2.7/dist-packages/joblib/numpy_pickle.pyc in read(self, unpickler)\r\n 158 array = unpickler.np.core.multiarray._reconstruct(*self.init_args)\r\n 159 with open(filename, 'rb') as f:\r\n--> 160 data = read_zfile(f)\r\n 161 state = self.state + (data,)\r\n 162 array.__setstate__(state)\r\n\r\n/usr/lib/python2.7/dist-packages/joblib/numpy_pickle.pyc in read_zfile(file_handle)\r\n 69 assert len(data) == length, (\r\n 70 \"Incorrect data length while decompressing %s.\"\r\n---> 71 \"The file could be corrupted.\" % file_handle)\r\n 72 return data\r\n 73 \r\n\r\nAssertionError: Incorrect data length while decompressing .The file could be corrupted.\r\n```\r\n@lesteve what do you think?"},"repo":{"kind":"string","value":"joblib/joblib"},"test_patch":{"kind":"string","value":"diff --git a/joblib/test/test_numpy_pickle.py b/joblib/test/test_numpy_pickle.py\nindex ab80354..c6b8960 100644\n--- a/joblib/test/test_numpy_pickle.py\n+++ b/joblib/test/test_numpy_pickle.py\n@@ -260,6 +260,7 @@ def test_z_file():\n def test_compressed_pickle_dump_and_load():\n expected_list = [np.arange(5, dtype=np.int64),\n np.arange(5, dtype=np.float64),\n+ np.array([1, 'abc', {'a': 1, 'b': 2}]),\n # .tostring actually returns bytes and is a\n # compatibility alias for .tobytes which was\n # added in 1.9.0\n@@ -269,17 +270,23 @@ def test_compressed_pickle_dump_and_load():\n with tempfile.NamedTemporaryFile(suffix='.gz', dir=env['dir']) as f:\n fname = f.name\n \n- try:\n- numpy_pickle.dump(expected_list, fname, compress=1)\n- result_list = numpy_pickle.load(fname)\n- for result, expected in zip(result_list, expected_list):\n- if isinstance(expected, np.ndarray):\n- nose.tools.assert_equal(result.dtype, expected.dtype)\n- np.testing.assert_equal(result, expected)\n- else:\n- nose.tools.assert_equal(result, expected)\n- finally:\n- os.remove(fname)\n+ # Need to test both code branches (whether array size is greater\n+ # or smaller than cache_size)\n+ for cache_size in [0, 1e9]:\n+ try:\n+ dumped_filenames = numpy_pickle.dump(\n+ expected_list, fname, compress=1,\n+ cache_size=cache_size)\n+ result_list = numpy_pickle.load(fname)\n+ for result, expected in zip(result_list, expected_list):\n+ if isinstance(expected, np.ndarray):\n+ nose.tools.assert_equal(result.dtype, expected.dtype)\n+ np.testing.assert_equal(result, expected)\n+ else:\n+ nose.tools.assert_equal(result, expected)\n+ finally:\n+ for fn in dumped_filenames:\n+ os.remove(fn)\n \n \n def _check_pickle(filename, expected_list):\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_hyperlinks\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 2,\n \"issue_text_score\": 0,\n \"test_score\": 3\n },\n \"num_modified_files\": 1\n}"},"version":{"kind":"string","value":"0.9"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"\",\n \"pip_packages\": [\n \"nose\",\n \"coverage\",\n \"numpy>=1.6.1\",\n \"pytest\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\n \"python\": \"3.5\",\n \"reqs_path\": null,\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"attrs==22.2.0\ncertifi==2021.5.30\ncoverage==6.2\nimportlib-metadata==4.8.3\niniconfig==1.1.1\n-e git+https://github.com/joblib/joblib.git@aeb018af545e025654176ffe9ae876bda1bddb89#egg=joblib\nnose==1.3.7\nnumpy==1.19.5\npackaging==21.3\npluggy==1.0.0\npy==1.11.0\npyparsing==3.1.4\npytest==7.0.1\ntomli==1.2.3\ntyping_extensions==4.1.1\nzipp==3.6.0\n"},"environment":{"kind":"string","value":"name: joblib\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2021.5.30=py36h06a4308_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.3=he6710b0_2\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - pip=21.2.2=py36h06a4308_0\n - python=3.6.13=h12debd9_1\n - readline=8.2=h5eee18b_0\n - setuptools=58.0.4=py36h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - wheel=0.37.1=pyhd3eb1b0_0\n - xz=5.6.4=h5eee18b_1\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - attrs==22.2.0\n - coverage==6.2\n - importlib-metadata==4.8.3\n - iniconfig==1.1.1\n - nose==1.3.7\n - numpy==1.19.5\n - packaging==21.3\n - pluggy==1.0.0\n - py==1.11.0\n - pyparsing==3.1.4\n - pytest==7.0.1\n - tomli==1.2.3\n - typing-extensions==4.1.1\n - zipp==3.6.0\nprefix: /opt/conda/envs/joblib\n"},"FAIL_TO_PASS":{"kind":"list like","value":["joblib/test/test_numpy_pickle.py::test_memmap_persistence_mixed_dtypes"],"string":"[\n \"joblib/test/test_numpy_pickle.py::test_memmap_persistence_mixed_dtypes\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":["joblib/test/test_numpy_pickle.py::test_joblib_pickle_across_python_versions"],"string":"[\n \"joblib/test/test_numpy_pickle.py::test_joblib_pickle_across_python_versions\"\n]"},"PASS_TO_PASS":{"kind":"list like","value":["joblib/test/test_numpy_pickle.py::test_value_error","joblib/test/test_numpy_pickle.py::test_numpy_persistence","joblib/test/test_numpy_pickle.py::test_memmap_persistence","joblib/test/test_numpy_pickle.py::test_masked_array_persistence","joblib/test/test_numpy_pickle.py::test_z_file","joblib/test/test_numpy_pickle.py::test_compressed_pickle_dump_and_load","joblib/test/test_numpy_pickle.py::test_numpy_subclass"],"string":"[\n \"joblib/test/test_numpy_pickle.py::test_value_error\",\n \"joblib/test/test_numpy_pickle.py::test_numpy_persistence\",\n \"joblib/test/test_numpy_pickle.py::test_memmap_persistence\",\n \"joblib/test/test_numpy_pickle.py::test_masked_array_persistence\",\n \"joblib/test/test_numpy_pickle.py::test_z_file\",\n \"joblib/test/test_numpy_pickle.py::test_compressed_pickle_dump_and_load\",\n \"joblib/test/test_numpy_pickle.py::test_numpy_subclass\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"BSD 3-Clause \"New\" or \"Revised\" License"},"__index_level_0__":{"kind":"number","value":280,"string":"280"}}},{"rowIdx":281,"cells":{"instance_id":{"kind":"string","value":"docker__docker-py-832"},"base_commit":{"kind":"string","value":"47ab89ec2bd3bddf1221b856ffbaff333edeabb4"},"created_at":{"kind":"string","value":"2015-10-29 15:17:54"},"environment_setup_commit":{"kind":"string","value":"1ca2bc58f0cf2e2cdda2734395bd3e7ad9b178bf"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/docker/auth/auth.py b/docker/auth/auth.py\nindex 2ed894ee..416dd7c4 100644\n--- a/docker/auth/auth.py\n+++ b/docker/auth/auth.py\n@@ -96,7 +96,7 @@ def decode_auth(auth):\n auth = auth.encode('ascii')\n s = base64.b64decode(auth)\n login, pwd = s.split(b':', 1)\n- return login.decode('ascii'), pwd.decode('ascii')\n+ return login.decode('utf8'), pwd.decode('utf8')\n \n \n def encode_header(auth):\n"},"problem_statement":{"kind":"string","value":"decode_auth function does not handle utf-8 logins or password\nHI\r\n\r\nI have found that the function **decode_auth** (line 96, [file](https://github.com/docker/docker-py/blob/master/docker/auth/auth.py)) fails when decoding UTF-8 passwords from the .dockercfg file, and **load_config** returning an empty config.\r\n\r\nI have checked and docker hub can handle UTF-8 passwords, this code proves that:\r\n```python\r\n# coding=utf-8\r\nfrom docker import Client\r\ncred = { 'username': , 'password': }\r\nc = Client(base_url='unix://var/run/docker.sock')\r\nres = c.pull(repository='', tag='latest', auth_config=cred)\r\nprint(res)\r\n```\r\n\r\nThank you"},"repo":{"kind":"string","value":"docker/docker-py"},"test_patch":{"kind":"string","value":"diff --git a/tests/unit/auth_test.py b/tests/unit/auth_test.py\nindex 9f4d439b..67830381 100644\n--- a/tests/unit/auth_test.py\n+++ b/tests/unit/auth_test.py\n@@ -316,3 +316,33 @@ class LoadConfigTest(base.Cleanup, base.BaseTestCase):\n self.assertEqual(cfg['password'], 'izayoi')\n self.assertEqual(cfg['email'], 'sakuya@scarlet.net')\n self.assertEqual(cfg.get('auth'), None)\n+\n+ def test_load_config_custom_config_env_utf8(self):\n+ folder = tempfile.mkdtemp()\n+ self.addCleanup(shutil.rmtree, folder)\n+\n+ dockercfg_path = os.path.join(folder, 'config.json')\n+ registry = 'https://your.private.registry.io'\n+ auth_ = base64.b64encode(\n+ b'sakuya\\xc3\\xa6:izayoi\\xc3\\xa6').decode('ascii')\n+ config = {\n+ 'auths': {\n+ registry: {\n+ 'auth': '{0}'.format(auth_),\n+ 'email': 'sakuya@scarlet.net'\n+ }\n+ }\n+ }\n+\n+ with open(dockercfg_path, 'w') as f:\n+ json.dump(config, f)\n+\n+ with mock.patch.dict(os.environ, {'DOCKER_CONFIG': folder}):\n+ cfg = auth.load_config(None)\n+ assert registry in cfg\n+ self.assertNotEqual(cfg[registry], None)\n+ cfg = cfg[registry]\n+ self.assertEqual(cfg['username'], b'sakuya\\xc3\\xa6'.decode('utf8'))\n+ self.assertEqual(cfg['password'], b'izayoi\\xc3\\xa6'.decode('utf8'))\n+ self.assertEqual(cfg['email'], 'sakuya@scarlet.net')\n+ self.assertEqual(cfg.get('auth'), None)\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [],\n \"has_test_patch\": true,\n \"is_lite\": true,\n \"llm_score\": {\n \"difficulty_score\": 1,\n \"issue_text_score\": 1,\n \"test_score\": 0\n },\n \"num_modified_files\": 1\n}"},"version":{"kind":"string","value":"1.5"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"requirements.txt\",\n \"pip_packages\": [\n \"pytest\",\n \"pytest-cov\",\n \"pytest-xdist\",\n \"pytest-mock\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\n \"python\": \"3.7\",\n \"reqs_path\": [\n \"requirements.txt\"\n ],\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"certifi @ file:///croot/certifi_1671487769961/work/certifi\ncoverage==7.2.7\n-e git+https://github.com/docker/docker-py.git@47ab89ec2bd3bddf1221b856ffbaff333edeabb4#egg=docker_py\nexceptiongroup==1.2.2\nexecnet==2.0.2\nimportlib-metadata==6.7.0\niniconfig==2.0.0\npackaging==24.0\npluggy==1.2.0\npytest==7.4.4\npytest-cov==4.1.0\npytest-mock==3.11.1\npytest-xdist==3.5.0\nrequests==2.5.3\nsix==1.17.0\ntomli==2.0.1\ntyping_extensions==4.7.1\nwebsocket-client==0.32.0\nzipp==3.15.0\n"},"environment":{"kind":"string","value":"name: docker-py\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2022.12.7=py37h06a4308_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.4.4=h6a678d5_1\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - pip=22.3.1=py37h06a4308_0\n - python=3.7.16=h7a1cb2a_0\n - readline=8.2=h5eee18b_0\n - setuptools=65.6.3=py37h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - wheel=0.38.4=py37h06a4308_0\n - xz=5.6.4=h5eee18b_1\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - coverage==7.2.7\n - exceptiongroup==1.2.2\n - execnet==2.0.2\n - importlib-metadata==6.7.0\n - iniconfig==2.0.0\n - packaging==24.0\n - pluggy==1.2.0\n - pytest==7.4.4\n - pytest-cov==4.1.0\n - pytest-mock==3.11.1\n - pytest-xdist==3.5.0\n - requests==2.5.3\n - six==1.17.0\n - tomli==2.0.1\n - typing-extensions==4.7.1\n - websocket-client==0.32.0\n - zipp==3.15.0\nprefix: /opt/conda/envs/docker-py\n"},"FAIL_TO_PASS":{"kind":"list like","value":["tests/unit/auth_test.py::LoadConfigTest::test_load_config_custom_config_env_utf8"],"string":"[\n \"tests/unit/auth_test.py::LoadConfigTest::test_load_config_custom_config_env_utf8\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["tests/unit/auth_test.py::RegressionTest::test_803_urlsafe_encode","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_default_explicit_none","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_default_registry","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_fully_explicit","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_hostname_only","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_legacy_config","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_no_match","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_no_path","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_no_path_trailing_slash","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_no_path_wrong_insecure_proto","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_no_path_wrong_secure_proto","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_no_protocol","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_path_wrong_proto","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_registry_and_auth_hub_image","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_registry_and_auth_library_image","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_registry_and_auth_private_registry","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_registry_and_auth_unauthenticated_registry","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_repository_name_hub_image","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_repository_name_hub_library_image","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_repository_name_localhost","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_repository_name_localhost_with_username","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_repository_name_no_dots_but_port","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_repository_name_no_dots_but_port_and_username","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_repository_name_private_registry","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_repository_name_private_registry_with_port","tests/unit/auth_test.py::ResolveAuthTest::test_resolve_repository_name_private_registry_with_username","tests/unit/auth_test.py::LoadConfigTest::test_load_config","tests/unit/auth_test.py::LoadConfigTest::test_load_config_custom_config_env","tests/unit/auth_test.py::LoadConfigTest::test_load_config_custom_config_env_with_auths","tests/unit/auth_test.py::LoadConfigTest::test_load_config_no_file","tests/unit/auth_test.py::LoadConfigTest::test_load_config_with_random_name"],"string":"[\n \"tests/unit/auth_test.py::RegressionTest::test_803_urlsafe_encode\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_default_explicit_none\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_default_registry\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_fully_explicit\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_hostname_only\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_legacy_config\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_no_match\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_no_path\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_no_path_trailing_slash\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_no_path_wrong_insecure_proto\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_no_path_wrong_secure_proto\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_no_protocol\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_authconfig_path_wrong_proto\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_registry_and_auth_hub_image\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_registry_and_auth_library_image\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_registry_and_auth_private_registry\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_registry_and_auth_unauthenticated_registry\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_repository_name_hub_image\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_repository_name_hub_library_image\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_repository_name_localhost\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_repository_name_localhost_with_username\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_repository_name_no_dots_but_port\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_repository_name_no_dots_but_port_and_username\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_repository_name_private_registry\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_repository_name_private_registry_with_port\",\n \"tests/unit/auth_test.py::ResolveAuthTest::test_resolve_repository_name_private_registry_with_username\",\n \"tests/unit/auth_test.py::LoadConfigTest::test_load_config\",\n \"tests/unit/auth_test.py::LoadConfigTest::test_load_config_custom_config_env\",\n \"tests/unit/auth_test.py::LoadConfigTest::test_load_config_custom_config_env_with_auths\",\n \"tests/unit/auth_test.py::LoadConfigTest::test_load_config_no_file\",\n \"tests/unit/auth_test.py::LoadConfigTest::test_load_config_with_random_name\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"Apache License 2.0"},"__index_level_0__":{"kind":"number","value":281,"string":"281"}}},{"rowIdx":282,"cells":{"instance_id":{"kind":"string","value":"jonathanj__eliottree-40"},"base_commit":{"kind":"string","value":"4dae7890294edb4d845b00a8bb310bc08c555352"},"created_at":{"kind":"string","value":"2015-10-30 07:46:22"},"environment_setup_commit":{"kind":"string","value":"26748c5e640b6d25d71eefad95920c41dab0f8db"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/eliottree/_cli.py b/eliottree/_cli.py\nindex 6b0d24e..c333d8c 100644\n--- a/eliottree/_cli.py\n+++ b/eliottree/_cli.py\n@@ -2,36 +2,20 @@ import argparse\n import codecs\n import json\n import sys\n-from datetime import datetime\n from itertools import chain\n \n from six import PY3\n from six.moves import map\n-from toolz import compose\n \n from eliottree import (\n Tree, filter_by_jmespath, filter_by_uuid, render_task_nodes)\n \n \n-def _convert_timestamp(task):\n- \"\"\"\n- Convert a ``timestamp`` key to a ``datetime``.\n- \"\"\"\n- task['timestamp'] = datetime.utcfromtimestamp(task['timestamp'])\n- return task\n-\n-\n-def build_task_nodes(files=None, select=None, task_uuid=None,\n- human_readable=True):\n+def build_task_nodes(files=None, select=None, task_uuid=None):\n \"\"\"\n Build the task nodes given some input data, query criteria and formatting\n options.\n \"\"\"\n- def task_transformers():\n- if human_readable:\n- yield _convert_timestamp\n- yield json.loads\n-\n def filter_funcs():\n if select is not None:\n for query in select:\n@@ -47,8 +31,7 @@ def build_task_nodes(files=None, select=None, task_uuid=None,\n files = [codecs.getreader('utf-8')(sys.stdin)]\n \n tree = Tree()\n- tasks = map(compose(*task_transformers()),\n- chain.from_iterable(files))\n+ tasks = map(json.loads, chain.from_iterable(files))\n return tree.nodes(tree.merge_tasks(tasks, filter_funcs()))\n \n \n@@ -65,13 +48,13 @@ def display_task_tree(args):\n nodes = build_task_nodes(\n files=args.files,\n select=args.select,\n- task_uuid=args.task_uuid,\n- human_readable=args.human_readable)\n+ task_uuid=args.task_uuid)\n render_task_nodes(\n write=write,\n nodes=nodes,\n ignored_task_keys=set(args.ignored_task_keys) or None,\n- field_limit=args.field_limit)\n+ field_limit=args.field_limit,\n+ human_readable=args.human_readable)\n \n \n def main():\ndiff --git a/eliottree/render.py b/eliottree/render.py\nindex 4876a3e..626683c 100644\n--- a/eliottree/render.py\n+++ b/eliottree/render.py\n@@ -8,20 +8,42 @@ DEFAULT_IGNORED_KEYS = set([\n u'message_type'])\n \n \n-def _format_value(value):\n+def _format_value_raw(value):\n \"\"\"\n- Format a value for a task tree.\n+ Format a value.\n \"\"\"\n if isinstance(value, datetime):\n if PY3:\n return value.isoformat(' ')\n else:\n return value.isoformat(' ').decode('ascii')\n- elif isinstance(value, text_type):\n+ return None\n+\n+\n+def _format_value_hint(value, hint):\n+ \"\"\"\n+ Format a value given a rendering hint.\n+ \"\"\"\n+ if hint == u'timestamp':\n+ return _format_value_raw(datetime.utcfromtimestamp(value))\n+ return None\n+\n+\n+def _format_value(value, field_hint=None, human_readable=False):\n+ \"\"\"\n+ Format a value for a task tree.\n+ \"\"\"\n+ if isinstance(value, text_type):\n return value\n elif isinstance(value, binary_type):\n # We guess bytes values are UTF-8.\n return value.decode('utf-8', 'replace')\n+ if human_readable:\n+ formatted = _format_value_raw(value)\n+ if formatted is None:\n+ formatted = _format_value_hint(value, field_hint)\n+ if formatted is not None:\n+ return formatted\n result = repr(value)\n if isinstance(result, binary_type):\n result = result.decode('utf-8', 'replace')\n@@ -48,7 +70,7 @@ def _truncate_value(value, limit):\n return value\n \n \n-def _render_task(write, task, ignored_task_keys, field_limit):\n+def _render_task(write, task, ignored_task_keys, field_limit, human_readable):\n \"\"\"\n Render a single ``_TaskNode`` as an ``ASCII`` tree.\n \n@@ -64,6 +86,9 @@ def _render_task(write, task, ignored_task_keys, field_limit):\n \n :type ignored_task_keys: ``set`` of ``text_type``\n :param ignored_task_keys: Set of task key names to ignore.\n+\n+ :type human_readable: ``bool``\n+ :param human_readable: Should this be rendered as human-readable?\n \"\"\"\n _write = _indented_write(write)\n num_items = len(task)\n@@ -78,9 +103,12 @@ def _render_task(write, task, ignored_task_keys, field_limit):\n _render_task(write=_write,\n task=value,\n ignored_task_keys={},\n- field_limit=field_limit)\n+ field_limit=field_limit,\n+ human_readable=human_readable)\n else:\n- _value = _format_value(value)\n+ _value = _format_value(value,\n+ field_hint=key,\n+ human_readable=human_readable)\n if field_limit:\n first_line = _truncate_value(_value, field_limit)\n else:\n@@ -96,7 +124,8 @@ def _render_task(write, task, ignored_task_keys, field_limit):\n _write(line + '\\n')\n \n \n-def _render_task_node(write, node, field_limit, ignored_task_keys):\n+def _render_task_node(write, node, field_limit, ignored_task_keys,\n+ human_readable):\n \"\"\"\n Render a single ``_TaskNode`` as an ``ASCII`` tree.\n \n@@ -112,6 +141,9 @@ def _render_task_node(write, node, field_limit, ignored_task_keys):\n \n :type ignored_task_keys: ``set`` of ``text_type``\n :param ignored_task_keys: Set of task key names to ignore.\n+\n+ :type human_readable: ``bool``\n+ :param human_readable: Should this be rendered as human-readable?\n \"\"\"\n _child_write = _indented_write(write)\n write(\n@@ -120,17 +152,20 @@ def _render_task_node(write, node, field_limit, ignored_task_keys):\n write=_child_write,\n task=node.task,\n field_limit=field_limit,\n- ignored_task_keys=ignored_task_keys)\n+ ignored_task_keys=ignored_task_keys,\n+ human_readable=human_readable)\n \n for child in node.children():\n _render_task_node(\n write=_child_write,\n node=child,\n field_limit=field_limit,\n- ignored_task_keys=ignored_task_keys)\n+ ignored_task_keys=ignored_task_keys,\n+ human_readable=human_readable)\n \n \n-def render_task_nodes(write, nodes, field_limit, ignored_task_keys=None):\n+def render_task_nodes(write, nodes, field_limit, ignored_task_keys=None,\n+ human_readable=False):\n \"\"\"\n Render a tree of task nodes as an ``ASCII`` tree.\n \n@@ -147,6 +182,9 @@ def render_task_nodes(write, nodes, field_limit, ignored_task_keys=None):\n \n :type ignored_task_keys: ``set`` of ``text_type``\n :param ignored_task_keys: Set of task key names to ignore.\n+\n+ :type human_readable: ``bool``\n+ :param human_readable: Should this be rendered as human-readable?\n \"\"\"\n if ignored_task_keys is None:\n ignored_task_keys = DEFAULT_IGNORED_KEYS\n@@ -156,7 +194,8 @@ def render_task_nodes(write, nodes, field_limit, ignored_task_keys=None):\n write=write,\n node=node,\n field_limit=field_limit,\n- ignored_task_keys=ignored_task_keys)\n+ ignored_task_keys=ignored_task_keys,\n+ human_readable=human_readable)\n write('\\n')\n \n \ndiff --git a/setup.py b/setup.py\nindex e54a48d..9767156 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -29,7 +29,6 @@ setup(\n install_requires=[\n \"six>=1.9.0\",\n \"jmespath>=0.7.1\",\n- \"toolz>=0.7.2\",\n ],\n extras_require={\n \"dev\": [\"pytest>=2.7.1\", \"testtools>=1.8.0\"],\n"},"problem_statement":{"kind":"string","value":"Human-readable values should only be formatted when rendered instead of modifying the tree data\nThe problem with modifying the tree data is that it makes it very difficult to write queries against it if eliot-tree is changing it in undisclosed ways to suit it's renderer."},"repo":{"kind":"string","value":"jonathanj/eliottree"},"test_patch":{"kind":"string","value":"diff --git a/eliottree/test/test_render.py b/eliottree/test/test_render.py\nindex 81d3128..81dea43 100644\n--- a/eliottree/test/test_render.py\n+++ b/eliottree/test/test_render.py\n@@ -15,14 +15,14 @@ class FormatValueTests(TestCase):\n \"\"\"\n Tests for ``eliottree.render._format_value``.\n \"\"\"\n- def test_datetime(self):\n+ def test_datetime_human_readable(self):\n \"\"\"\n Format ``datetime`` values as ISO8601.\n \"\"\"\n now = datetime(2015, 6, 6, 22, 57, 12)\n self.assertThat(\n- _format_value(now),\n- Equals('2015-06-06 22:57:12'))\n+ _format_value(now, human_readable=True),\n+ Equals(u'2015-06-06 22:57:12'))\n \n def test_unicode(self):\n \"\"\"\n@@ -59,6 +59,16 @@ class FormatValueTests(TestCase):\n _format_value({'a': u('\\N{SNOWMAN}')}),\n Equals(\"{'a': u'\\\\u2603'}\"))\n \n+ def test_timestamp_hint(self):\n+ \"\"\"\n+ Format \"timestamp\" hinted data as timestamps.\n+ \"\"\"\n+ # datetime(2015, 6, 6, 22, 57, 12)\n+ now = 1433631432\n+ self.assertThat(\n+ _format_value(now, field_hint='timestamp', human_readable=True),\n+ Equals(u'2015-06-06 22:57:12'))\n+\n \n class RenderTaskNodesTests(TestCase):\n \"\"\"\n@@ -85,6 +95,28 @@ class RenderTaskNodesTests(TestCase):\n ' +-- app:action@2/succeeded\\n'\n ' `-- timestamp: 1425356800\\n\\n'))\n \n+ def test_tasks_human_readable(self):\n+ \"\"\"\n+ Render two tasks of sequential levels, by default most standard Eliot\n+ task keys are ignored, values are formatted to be human readable.\n+ \"\"\"\n+ fd = StringIO()\n+ tree = Tree()\n+ tree.merge_tasks([action_task, action_task_end])\n+ render_task_nodes(\n+ write=fd.write,\n+ nodes=tree.nodes(),\n+ field_limit=0,\n+ human_readable=True)\n+ self.assertThat(\n+ fd.getvalue(),\n+ Equals(\n+ 'f3a32bb3-ea6b-457c-aa99-08a3d0491ab4\\n'\n+ '+-- app:action@1/started\\n'\n+ ' `-- timestamp: 2015-03-03 04:26:40\\n'\n+ ' +-- app:action@2/succeeded\\n'\n+ ' `-- timestamp: 2015-03-03 04:26:40\\n\\n'))\n+\n def test_multiline_field(self):\n \"\"\"\n When no field limit is specified for task values, multiple lines are\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_many_modified_files\",\n \"has_many_hunks\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 1,\n \"issue_text_score\": 2,\n \"test_score\": 3\n },\n \"num_modified_files\": 3\n}"},"version":{"kind":"string","value":"15.3"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .[dev]\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"requirements.txt\",\n \"pip_packages\": null,\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\n \"python\": \"3.9\",\n \"reqs_path\": null,\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"-e git+https://github.com/jonathanj/eliottree.git@4dae7890294edb4d845b00a8bb310bc08c555352#egg=eliot_tree\nexceptiongroup==1.2.2\niniconfig==2.1.0\njmespath==1.0.1\npackaging==24.2\npluggy==1.5.0\npytest==8.3.5\nsix==1.17.0\ntesttools==2.7.2\ntomli==2.2.1\ntoolz==1.0.0\n"},"environment":{"kind":"string","value":"name: eliottree\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - ca-certificates=2025.2.25=h06a4308_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.4.4=h6a678d5_1\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=3.0.16=h5eee18b_0\n - pip=25.0=py39h06a4308_0\n - python=3.9.21=he870216_1\n - readline=8.2=h5eee18b_0\n - setuptools=75.8.0=py39h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - tzdata=2025a=h04d1e81_0\n - wheel=0.45.1=py39h06a4308_0\n - xz=5.6.4=h5eee18b_1\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - exceptiongroup==1.2.2\n - iniconfig==2.1.0\n - jmespath==1.0.1\n - packaging==24.2\n - pluggy==1.5.0\n - pytest==8.3.5\n - six==1.17.0\n - testtools==2.7.2\n - tomli==2.2.1\n - toolz==1.0.0\nprefix: /opt/conda/envs/eliottree\n"},"FAIL_TO_PASS":{"kind":"list like","value":["eliottree/test/test_render.py::FormatValueTests::test_datetime_human_readable","eliottree/test/test_render.py::FormatValueTests::test_timestamp_hint","eliottree/test/test_render.py::RenderTaskNodesTests::test_tasks_human_readable"],"string":"[\n \"eliottree/test/test_render.py::FormatValueTests::test_datetime_human_readable\",\n \"eliottree/test/test_render.py::FormatValueTests::test_timestamp_hint\",\n \"eliottree/test/test_render.py::RenderTaskNodesTests::test_tasks_human_readable\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["eliottree/test/test_render.py::FormatValueTests::test_other","eliottree/test/test_render.py::FormatValueTests::test_str","eliottree/test/test_render.py::FormatValueTests::test_unicode","eliottree/test/test_render.py::RenderTaskNodesTests::test_dict_data","eliottree/test/test_render.py::RenderTaskNodesTests::test_field_limit","eliottree/test/test_render.py::RenderTaskNodesTests::test_ignored_keys","eliottree/test/test_render.py::RenderTaskNodesTests::test_multiline_field","eliottree/test/test_render.py::RenderTaskNodesTests::test_multiline_field_limit","eliottree/test/test_render.py::RenderTaskNodesTests::test_nested","eliottree/test/test_render.py::RenderTaskNodesTests::test_task_data","eliottree/test/test_render.py::RenderTaskNodesTests::test_tasks"],"string":"[\n \"eliottree/test/test_render.py::FormatValueTests::test_other\",\n \"eliottree/test/test_render.py::FormatValueTests::test_str\",\n \"eliottree/test/test_render.py::FormatValueTests::test_unicode\",\n \"eliottree/test/test_render.py::RenderTaskNodesTests::test_dict_data\",\n \"eliottree/test/test_render.py::RenderTaskNodesTests::test_field_limit\",\n \"eliottree/test/test_render.py::RenderTaskNodesTests::test_ignored_keys\",\n \"eliottree/test/test_render.py::RenderTaskNodesTests::test_multiline_field\",\n \"eliottree/test/test_render.py::RenderTaskNodesTests::test_multiline_field_limit\",\n \"eliottree/test/test_render.py::RenderTaskNodesTests::test_nested\",\n \"eliottree/test/test_render.py::RenderTaskNodesTests::test_task_data\",\n \"eliottree/test/test_render.py::RenderTaskNodesTests::test_tasks\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"MIT License"},"__index_level_0__":{"kind":"number","value":282,"string":"282"}}},{"rowIdx":283,"cells":{"instance_id":{"kind":"string","value":"sympy__sympy-10083"},"base_commit":{"kind":"string","value":"c67d601999dae4ebf16f055454954a6a556e6857"},"created_at":{"kind":"string","value":"2015-10-30 15:53:56"},"environment_setup_commit":{"kind":"string","value":"0241b35cae5f2adc04dc37b25f7dc9c5f00bd746"},"hints_text":{"kind":"string","value":"gxyd: I was hoping that something like\r\n```\r\n>>> x = Symbol('x')\r\n>>> X = DieDistribution(6)\r\n>>> X.pdf(x)\r\nPDF(X, x) # some PDF be returned though i guess no such PDF class or function is there\r\n```\r\nI expected something similar to `Contains`\r\n```\r\n>>> A.contains(x)\r\nContains(A, x)\r\n```\njksuom: I think it could be possible to return a sensible ``X.pdf(x)`` even for a symbol ``x``. For an ordinary die (with 6 faces) it would be ``AddWithLimits(KroneckerDelta(x, i)/6, (i, 1, 6))`` (though that looks a bit clumsy).\ngxyd: It looks good to me. I did not know about the `KroneckerDelta` function till now though.\r\n> AddWithLimits(KroneckerDelta(x, i)/6, (i, 1, 6)) (though that looks a bit clumsy).\r\n\r\nI think i am ok, with that.\njksuom: I now think that we should have ``Sum`` instead of ``AddWithLimits``. I had forgotten its existence. It seems that ``X.pdf(x).subs(x, 1).doit()`` would compute correctly with ``Sum`` since it has its own version of ``doit``. There could be some tests for such substitutions. And maybe for some illegal substitution as well.\ngxyd: I myself, even before seeing with `AddWithLimits` checked with `Sum.doit()` . But i could not though make that out how to do that. But Ok, let me try again. I may now be able to come to solution.\ngxyd: I have made the changes. Perhaps previously i was also using `.doit()` itself in code. Now using ony `Sum` works fine.\njksuom: This looks good to me. The separation of arguments that do not belong to the probability space (i.e. integers between 1 and ``sides``) into two classes: numbers returning 0, and non-numbers returning an error, is somewhat arbitrary, but I cannot think of a better way now."},"patch":{"kind":"string","value":"diff --git a/sympy/stats/frv_types.py b/sympy/stats/frv_types.py\nindex be522333c8..fa6688dd1e 100644\n--- a/sympy/stats/frv_types.py\n+++ b/sympy/stats/frv_types.py\n@@ -17,8 +17,9 @@\n from sympy.core.compatibility import as_int, range\n from sympy.core.logic import fuzzy_not, fuzzy_and\n from sympy.stats.frv import (SingleFinitePSpace, SingleFiniteDistribution)\n+from sympy.concrete.summations import Sum\n from sympy import (S, sympify, Rational, binomial, cacheit, Integer,\n- Dict, Basic)\n+ Dict, Basic, KroneckerDelta, Dummy)\n \n __all__ = ['FiniteRV', 'DiscreteUniform', 'Die', 'Bernoulli', 'Coin',\n 'Binomial', 'Hypergeometric']\n@@ -49,7 +50,7 @@ def FiniteRV(name, density):\n \n >>> E(X)\n 2.00000000000000\n- >>> P(X>=2)\n+ >>> P(X >= 2)\n 0.700000000000000\n \"\"\"\n return rv(name, FiniteDistributionHandmade, density)\n@@ -118,14 +119,19 @@ def dict(self):\n \n @property\n def set(self):\n- return list(map(Integer, list(range(1, self.sides+1))))\n+ return list(map(Integer, list(range(1, self.sides + 1))))\n \n def pdf(self, x):\n x = sympify(x)\n- if x.is_Integer and x >= 1 and x <= self.sides:\n- return Rational(1, self.sides)\n- else:\n- return 0\n+ if x.is_number:\n+ if x.is_Integer and x >= 1 and x <= self.sides:\n+ return Rational(1, self.sides)\n+ return S.Zero\n+ if x.is_Symbol:\n+ i = Dummy('i', integer=True, positive=True)\n+ return Sum(KroneckerDelta(x, i)/self.sides, (i, 1, self.sides))\n+ raise ValueError(\"'x' expected as an argument of type 'number' or 'symbol', \"\n+ \"not %s\" % (type(x)))\n \n \n def Die(name, sides=6):\n"},"problem_statement":{"kind":"string","value":"X.pdf(x) for Symbol x returns 0\n```\r\n>>> x = Symbol('x')\r\n>>> from sympy.stats.frv_types import DieDistribution\r\n>>> X = DieDistribution(6)\r\n>>> X.pdf(x)\r\n0\r\n```\r\nEither this should raise a `ValueError` or unevaluated. Returning unevaluated seems more favourable."},"repo":{"kind":"string","value":"sympy/sympy"},"test_patch":{"kind":"string","value":"diff --git a/sympy/stats/tests/test_finite_rv.py b/sympy/stats/tests/test_finite_rv.py\nindex 5f3663623f..e8e3a9c2bb 100644\n--- a/sympy/stats/tests/test_finite_rv.py\n+++ b/sympy/stats/tests/test_finite_rv.py\n@@ -1,13 +1,16 @@\n from sympy.core.compatibility import range\n from sympy import (FiniteSet, S, Symbol, sqrt,\n symbols, simplify, Eq, cos, And, Tuple, Or, Dict, sympify, binomial,\n- cancel)\n+ cancel, KroneckerDelta)\n+from sympy.concrete.expr_with_limits import AddWithLimits\n+from sympy.matrices import Matrix\n from sympy.stats import (DiscreteUniform, Die, Bernoulli, Coin, Binomial,\n Hypergeometric, Rademacher, P, E, variance, covariance, skewness, sample,\n density, where, FiniteRV, pspace, cdf,\n correlation, moment, cmoment, smoment)\n+from sympy.stats.frv_types import DieDistribution\n from sympy.utilities.pytest import raises, slow\n-from sympy.abc import p\n+from sympy.abc import p, x, i\n \n oo = S.Infinity\n \n@@ -259,3 +262,14 @@ def test_density_call():\n assert 0 in d\n assert 5 not in d\n assert d(S(0)) == d[S(0)]\n+\n+\n+def test_DieDistribution():\n+ X = DieDistribution(6)\n+ assert X.pdf(S(1)/2) == S.Zero\n+ assert X.pdf(x).subs({x: 1}).doit() == S(1)/6\n+ assert X.pdf(x).subs({x: 7}).doit() == 0\n+ assert X.pdf(x).subs({x: -1}).doit() == 0\n+ assert X.pdf(x).subs({x: S(1)/3}).doit() == 0\n+ raises(TypeError, lambda: X.pdf(x).subs({x: Matrix([0, 0])}))\n+ raises(ValueError, lambda: X.pdf(x**2 - 1))\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\n \"has_short_problem_statement\"\n ],\n \"has_test_patch\": true,\n \"is_lite\": false,\n \"llm_score\": {\n \"difficulty_score\": 0,\n \"issue_text_score\": 0,\n \"test_score\": 2\n },\n \"num_modified_files\": 1\n}"},"version":{"kind":"string","value":"0.7"},"install_config":{"kind":"string","value":"{\n \"env_vars\": null,\n \"env_yml_path\": null,\n \"install\": \"pip install -e .[dev]\",\n \"log_parser\": \"parse_log_pytest\",\n \"no_use_env\": null,\n \"packages\": \"requirements.txt\",\n \"pip_packages\": [\n \"mpmath>=0.19\",\n \"pytest\",\n \"pytest-cov\",\n \"pytest-xdist\",\n \"pytest-mock\",\n \"pytest-asyncio\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\n \"python\": \"3.7\",\n \"reqs_path\": [\n \"requirements/base.txt\"\n ],\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"certifi @ file:///croot/certifi_1671487769961/work/certifi\ncoverage==7.2.7\nexceptiongroup==1.2.2\nexecnet==2.0.2\nimportlib-metadata==6.7.0\niniconfig==2.0.0\nmpmath==1.3.0\npackaging==24.0\npluggy==1.2.0\npytest==7.4.4\npytest-asyncio==0.21.2\npytest-cov==4.1.0\npytest-mock==3.11.1\npytest-xdist==3.5.0\n-e git+https://github.com/sympy/sympy.git@c67d601999dae4ebf16f055454954a6a556e6857#egg=sympy\ntomli==2.0.1\ntyping_extensions==4.7.1\nzipp==3.15.0\n"},"environment":{"kind":"string","value":"name: sympy\nchannels:\n - defaults\n - https://repo.anaconda.com/pkgs/main\n - https://repo.anaconda.com/pkgs/r\n - conda-forge\ndependencies:\n - _libgcc_mutex=0.1=main\n - _openmp_mutex=5.1=1_gnu\n - ca-certificates=2025.2.25=h06a4308_0\n - certifi=2022.12.7=py37h06a4308_0\n - ld_impl_linux-64=2.40=h12ee557_0\n - libffi=3.4.4=h6a678d5_1\n - libgcc-ng=11.2.0=h1234567_1\n - libgomp=11.2.0=h1234567_1\n - libstdcxx-ng=11.2.0=h1234567_1\n - ncurses=6.4=h6a678d5_0\n - openssl=1.1.1w=h7f8727e_0\n - pip=22.3.1=py37h06a4308_0\n - python=3.7.16=h7a1cb2a_0\n - readline=8.2=h5eee18b_0\n - setuptools=65.6.3=py37h06a4308_0\n - sqlite=3.45.3=h5eee18b_0\n - tk=8.6.14=h39e8969_0\n - wheel=0.38.4=py37h06a4308_0\n - xz=5.6.4=h5eee18b_1\n - zlib=1.2.13=h5eee18b_1\n - pip:\n - coverage==7.2.7\n - exceptiongroup==1.2.2\n - execnet==2.0.2\n - importlib-metadata==6.7.0\n - iniconfig==2.0.0\n - mpmath==1.3.0\n - packaging==24.0\n - pluggy==1.2.0\n - pytest==7.4.4\n - pytest-asyncio==0.21.2\n - pytest-cov==4.1.0\n - pytest-mock==3.11.1\n - pytest-xdist==3.5.0\n - tomli==2.0.1\n - typing-extensions==4.7.1\n - zipp==3.15.0\nprefix: /opt/conda/envs/sympy\n"},"FAIL_TO_PASS":{"kind":"list like","value":["sympy/stats/tests/test_finite_rv.py::test_DieDistribution"],"string":"[\n \"sympy/stats/tests/test_finite_rv.py::test_DieDistribution\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["sympy/stats/tests/test_finite_rv.py::test_discreteuniform","sympy/stats/tests/test_finite_rv.py::test_dice","sympy/stats/tests/test_finite_rv.py::test_given","sympy/stats/tests/test_finite_rv.py::test_domains","sympy/stats/tests/test_finite_rv.py::test_dice_bayes","sympy/stats/tests/test_finite_rv.py::test_die_args","sympy/stats/tests/test_finite_rv.py::test_bernoulli","sympy/stats/tests/test_finite_rv.py::test_cdf","sympy/stats/tests/test_finite_rv.py::test_coins","sympy/stats/tests/test_finite_rv.py::test_binomial_verify_parameters","sympy/stats/tests/test_finite_rv.py::test_binomial_numeric","sympy/stats/tests/test_finite_rv.py::test_binomial_symbolic","sympy/stats/tests/test_finite_rv.py::test_hypergeometric_numeric","sympy/stats/tests/test_finite_rv.py::test_rademacher","sympy/stats/tests/test_finite_rv.py::test_FiniteRV","sympy/stats/tests/test_finite_rv.py::test_density_call"],"string":"[\n \"sympy/stats/tests/test_finite_rv.py::test_discreteuniform\",\n \"sympy/stats/tests/test_finite_rv.py::test_dice\",\n \"sympy/stats/tests/test_finite_rv.py::test_given\",\n \"sympy/stats/tests/test_finite_rv.py::test_domains\",\n \"sympy/stats/tests/test_finite_rv.py::test_dice_bayes\",\n \"sympy/stats/tests/test_finite_rv.py::test_die_args\",\n \"sympy/stats/tests/test_finite_rv.py::test_bernoulli\",\n \"sympy/stats/tests/test_finite_rv.py::test_cdf\",\n \"sympy/stats/tests/test_finite_rv.py::test_coins\",\n \"sympy/stats/tests/test_finite_rv.py::test_binomial_verify_parameters\",\n \"sympy/stats/tests/test_finite_rv.py::test_binomial_numeric\",\n \"sympy/stats/tests/test_finite_rv.py::test_binomial_symbolic\",\n \"sympy/stats/tests/test_finite_rv.py::test_hypergeometric_numeric\",\n \"sympy/stats/tests/test_finite_rv.py::test_rademacher\",\n \"sympy/stats/tests/test_finite_rv.py::test_FiniteRV\",\n \"sympy/stats/tests/test_finite_rv.py::test_density_call\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"BSD"},"__index_level_0__":{"kind":"number","value":283,"string":"283"}}},{"rowIdx":284,"cells":{"instance_id":{"kind":"string","value":"sprymix__csscompressor-4"},"base_commit":{"kind":"string","value":"153ab1bb6cd925dc73a314af74db874a3314010f"},"created_at":{"kind":"string","value":"2015-11-01 06:16:44"},"environment_setup_commit":{"kind":"string","value":"bec3e582cb5ab7182a0ca08ba381e491b94ed10c"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/csscompressor/__init__.py b/csscompressor/__init__.py\nindex 1b41119..1233cd3 100644\n--- a/csscompressor/__init__.py\n+++ b/csscompressor/__init__.py\n@@ -56,9 +56,12 @@ _space_after_re = re.compile(r'([!{}:;>+\\(\\[,])\\s+')\n _semi_re = re.compile(r';+}')\n \n _zero_fmt_spec_re = re.compile(r'''(\\s|:|\\(|,)(?:0?\\.)?0\n- (?:px|em|%|in|cm|mm|pc|pt|ex|deg|g?rad|m?s|k?hz)''',\n+ (?:px|em|%|in|cm|mm|pc|pt|ex|deg|g?rad|k?hz)''',\n re.I | re.X)\n \n+_zero_req_unit_re = re.compile(r'''(\\s|:|\\(|,)(?:0?\\.)?0\n+ (m?s)''', re.I | re.X)\n+\n _bg_pos_re = re.compile(r'''(background-position|webkit-mask-position|transform-origin|\n webkit-transform-origin|moz-transform-origin|o-transform-origin|\n ms-transform-origin):0(;|})''', re.I | re.X)\n@@ -377,6 +380,9 @@ def _compress(css, max_linelen=0):\n # Replace 0(px,em,%) with 0.\n css = _zero_fmt_spec_re.sub(lambda match: match.group(1) + '0', css)\n \n+ # Replace 0.0(m,ms) or .0(m,ms) with 0(m,ms)\n+ css = _zero_req_unit_re.sub(lambda match: match.group(1) + '0' + match.group(2), css)\n+\n # Replace 0 0 0 0; with 0.\n css = _quad_0_re.sub(r':0\\1', css)\n css = _trip_0_re.sub(r':0\\1', css)\n"},"problem_statement":{"kind":"string","value":"Omitting the unit on a time value is invalid\nInput: `csscompressor.compress(\"transition: background-color 1s linear 0ms;\")`\r\nExpected output: `'transition:background-color 1s linear 0ms;'`\r\nActual output: `'transition:background-color 1s linear 0;'`\r\n\r\nAccording to the [MDN page on \\