{ // 获取包含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 }); }); } })(); \n '''\n \n- p = Premailer(html, base_url='http://kungfupeople.com/base',\n+ p = Premailer(html, base_url='http://kungfupeople.com/base/',\n preserve_internal_links=True)\n result_html = p.transform()\n \n@@ -2302,3 +2300,36 @@ sheet\" type=\"text/css\">\n result_html = p.transform()\n \n compare_html(expect_html, result_html)\n+\n+ def test_links_without_protocol(self):\n+ \"\"\"If you the base URL is set to https://example.com and your html\n+ contains ... then the URL to point to\n+ is \"https://otherdomain.com/\" not \"https://example.com/file.css\"\n+ \"\"\"\n+ html = \"\"\"\n+ \n+ \n+ \n+ \n+ \n+ \"\"\"\n+\n+ expect_html = \"\"\"\n+ \n+ \n+ \n+ \n+ \n+ \"\"\"\n+\n+ p = Premailer(html, base_url='https://www.peterbe.com')\n+ result_html = p.transform()\n+ compare_html(expect_html.format(protocol=\"https\"), result_html)\n+\n+ p = Premailer(html, base_url='http://www.peterbe.com')\n+ result_html = p.transform()\n+ compare_html(expect_html.format(protocol=\"http\"), result_html)\n+\n+ # Because you can't set a base_url without a full protocol\n+ p = Premailer(html, base_url='www.peterbe.com')\n+ assert_raises(ValueError, p.transform)\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\": 1,\n \"test_score\": 2\n },\n \"num_modified_files\": 1\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\": \"lxml cssselect cssutils nose mock\",\n \"pip_packages\": [\n \"nose\",\n \"mock\",\n \"pytest\"\n ],\n \"pre_install\": null,\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":"cssselect @ file:///croot/cssselect_1707339882883/work\ncssutils @ file:///home/conda/feedstock_root/build_artifacts/cssutils_1734884840740/work\nexceptiongroup==1.2.2\niniconfig==2.1.0\nlxml @ file:///croot/lxml_1737039601731/work\nmock @ file:///tmp/build/80754af9/mock_1607622725907/work\nnose @ file:///opt/conda/conda-bld/nose_1642704612149/work\npackaging==24.2\npluggy==1.5.0\n-e git+https://github.com/peterbe/premailer.git@f211f3f1bcfc87dc0318f056d319bb5575f62a72#egg=premailer\npytest==8.3.5\ntomli==2.2.1\n"},"environment":{"kind":"string","value":"name: premailer\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 - cssselect=1.2.0=py39h06a4308_0\n - cssutils=2.11.0=pyhd8ed1ab_1\n - icu=73.1=h6a678d5_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 - libxml2=2.13.5=hfdd30dd_0\n - libxslt=1.1.41=h097e994_0\n - lxml=5.3.0=py39h57af460_1\n - mock=4.0.3=pyhd3eb1b0_0\n - ncurses=6.4=h6a678d5_0\n - nose=1.3.7=pyhd3eb1b0_1008\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 - packaging==24.2\n - pluggy==1.5.0\n - pytest==8.3.5\n - tomli==2.2.1\nprefix: /opt/conda/envs/premailer\n"},"FAIL_TO_PASS":{"kind":"list like","value":["premailer/tests/test_premailer.py::Tests::test_base_url_with_path","premailer/tests/test_premailer.py::Tests::test_links_without_protocol"],"string":"[\n \"premailer/tests/test_premailer.py::Tests::test_base_url_with_path\",\n \"premailer/tests/test_premailer.py::Tests::test_links_without_protocol\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["premailer/tests/test_premailer.py::Tests::test_apple_newsletter_example","premailer/tests/test_premailer.py::Tests::test_base_url_fixer","premailer/tests/test_premailer.py::Tests::test_basic_html","premailer/tests/test_premailer.py::Tests::test_basic_html_shortcut_function","premailer/tests/test_premailer.py::Tests::test_basic_html_with_pseudo_selector","premailer/tests/test_premailer.py::Tests::test_basic_xml","premailer/tests/test_premailer.py::Tests::test_broken_xml","premailer/tests/test_premailer.py::Tests::test_child_selector","premailer/tests/test_premailer.py::Tests::test_command_line_fileinput_from_argument","premailer/tests/test_premailer.py::Tests::test_command_line_fileinput_from_stdin","premailer/tests/test_premailer.py::Tests::test_command_line_preserve_style_tags","premailer/tests/test_premailer.py::Tests::test_comments_in_media_queries","premailer/tests/test_premailer.py::Tests::test_css_disable_basic_html_attributes","premailer/tests/test_premailer.py::Tests::test_css_text","premailer/tests/test_premailer.py::Tests::test_css_text_with_only_body_present","premailer/tests/test_premailer.py::Tests::test_css_with_html_attributes","premailer/tests/test_premailer.py::Tests::test_css_with_pseudoclasses_excluded","premailer/tests/test_premailer.py::Tests::test_css_with_pseudoclasses_included","premailer/tests/test_premailer.py::Tests::test_disabled_validator","premailer/tests/test_premailer.py::Tests::test_doctype","premailer/tests/test_premailer.py::Tests::test_empty_style_tag","premailer/tests/test_premailer.py::Tests::test_external_links","premailer/tests/test_premailer.py::Tests::test_external_links_unfindable","premailer/tests/test_premailer.py::Tests::test_external_styles_and_links","premailer/tests/test_premailer.py::Tests::test_external_styles_on_http","premailer/tests/test_premailer.py::Tests::test_external_styles_on_https","premailer/tests/test_premailer.py::Tests::test_external_styles_with_base_url","premailer/tests/test_premailer.py::Tests::test_favour_rule_with_class_over_generic","premailer/tests/test_premailer.py::Tests::test_favour_rule_with_element_over_generic","premailer/tests/test_premailer.py::Tests::test_favour_rule_with_id_over_others","premailer/tests/test_premailer.py::Tests::test_favour_rule_with_important_over_others","premailer/tests/test_premailer.py::Tests::test_fontface_selectors_with_no_selectortext","premailer/tests/test_premailer.py::Tests::test_ignore_some_external_stylesheets","premailer/tests/test_premailer.py::Tests::test_ignore_some_incorrectly","premailer/tests/test_premailer.py::Tests::test_ignore_some_inline_stylesheets","premailer/tests/test_premailer.py::Tests::test_ignore_style_elements_with_media_attribute","premailer/tests/test_premailer.py::Tests::test_include_star_selector","premailer/tests/test_premailer.py::Tests::test_inline_wins_over_external","premailer/tests/test_premailer.py::Tests::test_keyframe_selectors","premailer/tests/test_premailer.py::Tests::test_last_child","premailer/tests/test_premailer.py::Tests::test_last_child_exclude_pseudo","premailer/tests/test_premailer.py::Tests::test_leftover_important","premailer/tests/test_premailer.py::Tests::test_load_external_url","premailer/tests/test_premailer.py::Tests::test_load_external_url_gzip","premailer/tests/test_premailer.py::Tests::test_mailto_url","premailer/tests/test_premailer.py::Tests::test_mediaquery","premailer/tests/test_premailer.py::Tests::test_merge_styles_basic","premailer/tests/test_premailer.py::Tests::test_merge_styles_non_trivial","premailer/tests/test_premailer.py::Tests::test_merge_styles_with_class","premailer/tests/test_premailer.py::Tests::test_mixed_pseudo_selectors","premailer/tests/test_premailer.py::Tests::test_multiple_style_elements","premailer/tests/test_premailer.py::Tests::test_multithreading","premailer/tests/test_premailer.py::Tests::test_parse_style_rules","premailer/tests/test_premailer.py::Tests::test_precedence_comparison","premailer/tests/test_premailer.py::Tests::test_prefer_inline_to_class","premailer/tests/test_premailer.py::Tests::test_shortcut_function","premailer/tests/test_premailer.py::Tests::test_strip_important","premailer/tests/test_premailer.py::Tests::test_style_attribute_specificity","premailer/tests/test_premailer.py::Tests::test_style_block_with_external_urls","premailer/tests/test_premailer.py::Tests::test_turnoff_cache_works_as_expected","premailer/tests/test_premailer.py::Tests::test_type_test","premailer/tests/test_premailer.py::Tests::test_xml_cdata"],"string":"[\n \"premailer/tests/test_premailer.py::Tests::test_apple_newsletter_example\",\n \"premailer/tests/test_premailer.py::Tests::test_base_url_fixer\",\n \"premailer/tests/test_premailer.py::Tests::test_basic_html\",\n \"premailer/tests/test_premailer.py::Tests::test_basic_html_shortcut_function\",\n \"premailer/tests/test_premailer.py::Tests::test_basic_html_with_pseudo_selector\",\n \"premailer/tests/test_premailer.py::Tests::test_basic_xml\",\n \"premailer/tests/test_premailer.py::Tests::test_broken_xml\",\n \"premailer/tests/test_premailer.py::Tests::test_child_selector\",\n \"premailer/tests/test_premailer.py::Tests::test_command_line_fileinput_from_argument\",\n \"premailer/tests/test_premailer.py::Tests::test_command_line_fileinput_from_stdin\",\n \"premailer/tests/test_premailer.py::Tests::test_command_line_preserve_style_tags\",\n \"premailer/tests/test_premailer.py::Tests::test_comments_in_media_queries\",\n \"premailer/tests/test_premailer.py::Tests::test_css_disable_basic_html_attributes\",\n \"premailer/tests/test_premailer.py::Tests::test_css_text\",\n \"premailer/tests/test_premailer.py::Tests::test_css_text_with_only_body_present\",\n \"premailer/tests/test_premailer.py::Tests::test_css_with_html_attributes\",\n \"premailer/tests/test_premailer.py::Tests::test_css_with_pseudoclasses_excluded\",\n \"premailer/tests/test_premailer.py::Tests::test_css_with_pseudoclasses_included\",\n \"premailer/tests/test_premailer.py::Tests::test_disabled_validator\",\n \"premailer/tests/test_premailer.py::Tests::test_doctype\",\n \"premailer/tests/test_premailer.py::Tests::test_empty_style_tag\",\n \"premailer/tests/test_premailer.py::Tests::test_external_links\",\n \"premailer/tests/test_premailer.py::Tests::test_external_links_unfindable\",\n \"premailer/tests/test_premailer.py::Tests::test_external_styles_and_links\",\n \"premailer/tests/test_premailer.py::Tests::test_external_styles_on_http\",\n \"premailer/tests/test_premailer.py::Tests::test_external_styles_on_https\",\n \"premailer/tests/test_premailer.py::Tests::test_external_styles_with_base_url\",\n \"premailer/tests/test_premailer.py::Tests::test_favour_rule_with_class_over_generic\",\n \"premailer/tests/test_premailer.py::Tests::test_favour_rule_with_element_over_generic\",\n \"premailer/tests/test_premailer.py::Tests::test_favour_rule_with_id_over_others\",\n \"premailer/tests/test_premailer.py::Tests::test_favour_rule_with_important_over_others\",\n \"premailer/tests/test_premailer.py::Tests::test_fontface_selectors_with_no_selectortext\",\n \"premailer/tests/test_premailer.py::Tests::test_ignore_some_external_stylesheets\",\n \"premailer/tests/test_premailer.py::Tests::test_ignore_some_incorrectly\",\n \"premailer/tests/test_premailer.py::Tests::test_ignore_some_inline_stylesheets\",\n \"premailer/tests/test_premailer.py::Tests::test_ignore_style_elements_with_media_attribute\",\n \"premailer/tests/test_premailer.py::Tests::test_include_star_selector\",\n \"premailer/tests/test_premailer.py::Tests::test_inline_wins_over_external\",\n \"premailer/tests/test_premailer.py::Tests::test_keyframe_selectors\",\n \"premailer/tests/test_premailer.py::Tests::test_last_child\",\n \"premailer/tests/test_premailer.py::Tests::test_last_child_exclude_pseudo\",\n \"premailer/tests/test_premailer.py::Tests::test_leftover_important\",\n \"premailer/tests/test_premailer.py::Tests::test_load_external_url\",\n \"premailer/tests/test_premailer.py::Tests::test_load_external_url_gzip\",\n \"premailer/tests/test_premailer.py::Tests::test_mailto_url\",\n \"premailer/tests/test_premailer.py::Tests::test_mediaquery\",\n \"premailer/tests/test_premailer.py::Tests::test_merge_styles_basic\",\n \"premailer/tests/test_premailer.py::Tests::test_merge_styles_non_trivial\",\n \"premailer/tests/test_premailer.py::Tests::test_merge_styles_with_class\",\n \"premailer/tests/test_premailer.py::Tests::test_mixed_pseudo_selectors\",\n \"premailer/tests/test_premailer.py::Tests::test_multiple_style_elements\",\n \"premailer/tests/test_premailer.py::Tests::test_multithreading\",\n \"premailer/tests/test_premailer.py::Tests::test_parse_style_rules\",\n \"premailer/tests/test_premailer.py::Tests::test_precedence_comparison\",\n \"premailer/tests/test_premailer.py::Tests::test_prefer_inline_to_class\",\n \"premailer/tests/test_premailer.py::Tests::test_shortcut_function\",\n \"premailer/tests/test_premailer.py::Tests::test_strip_important\",\n \"premailer/tests/test_premailer.py::Tests::test_style_attribute_specificity\",\n \"premailer/tests/test_premailer.py::Tests::test_style_block_with_external_urls\",\n \"premailer/tests/test_premailer.py::Tests::test_turnoff_cache_works_as_expected\",\n \"premailer/tests/test_premailer.py::Tests::test_type_test\",\n \"premailer/tests/test_premailer.py::Tests::test_xml_cdata\"\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":129,"string":"129"}}},{"rowIdx":130,"cells":{"instance_id":{"kind":"string","value":"DinoTools__python-overpy-18"},"base_commit":{"kind":"string","value":"ac7df97ef4302d7eda46a6bb34a887e9b275748c"},"created_at":{"kind":"string","value":"2015-05-09 07:36:00"},"environment_setup_commit":{"kind":"string","value":"7b0e0d999acb0549b57a271f31830fc020471731"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/overpy/__init__.py b/overpy/__init__.py\nindex 454e1f5..cf48898 100644\n--- a/overpy/__init__.py\n+++ b/overpy/__init__.py\n@@ -1,5 +1,6 @@\n from collections import OrderedDict\n from decimal import Decimal\n+from xml.sax import handler, make_parser\n import json\n import re\n import sys\n@@ -14,6 +15,9 @@ from overpy.__about__ import (\n PY2 = sys.version_info[0] == 2\n PY3 = sys.version_info[0] == 3\n \n+XML_PARSER_DOM = 1\n+XML_PARSER_SAX = 2\n+\n if PY2:\n from urllib2 import urlopen\n from urllib2 import HTTPError\n@@ -41,10 +45,12 @@ class Overpass(object):\n \"\"\"\n default_read_chunk_size = 4096\n \n- def __init__(self, read_chunk_size=None):\n+ def __init__(self, read_chunk_size=None, xml_parser=XML_PARSER_SAX):\n \"\"\"\n :param read_chunk_size: Max size of each chunk read from the server response\n :type read_chunk_size: Integer\n+ :param xml_parser: The xml parser to use\n+ :type xml_parser: Integer\n \"\"\"\n self.url = \"http://overpass-api.de/api/interpreter\"\n self._regex_extract_error_msg = re.compile(b\"\\(?P\\\")\n@@ -52,6 +58,7 @@ class Overpass(object):\n if read_chunk_size is None:\n read_chunk_size = self.default_read_chunk_size\n self.read_chunk_size = read_chunk_size\n+ self.xml_parser = xml_parser\n \n def query(self, query):\n \"\"\"\n@@ -131,7 +138,7 @@ class Overpass(object):\n data = json.loads(data, parse_float=Decimal)\n return Result.from_json(data, api=self)\n \n- def parse_xml(self, data, encoding=\"utf-8\"):\n+ def parse_xml(self, data, encoding=\"utf-8\", parser=None):\n \"\"\"\n \n :param data: Raw XML Data\n@@ -141,14 +148,16 @@ class Overpass(object):\n :return: Result object\n :rtype: overpy.Result\n \"\"\"\n+ if parser is None:\n+ parser = self.xml_parser\n+\n if isinstance(data, bytes):\n data = data.decode(encoding)\n if PY2 and not isinstance(data, str):\n # Python 2.x: Convert unicode strings\n data = data.encode(encoding)\n- import xml.etree.ElementTree as ET\n- root = ET.fromstring(data)\n- return Result.from_xml(root, api=self)\n+\n+ return Result.from_xml(data, api=self, parser=parser)\n \n \n class Result(object):\n@@ -262,7 +271,7 @@ class Result(object):\n return result\n \n @classmethod\n- def from_xml(cls, root, api=None):\n+ def from_xml(cls, data, api=None, parser=XML_PARSER_SAX):\n \"\"\"\n Create a new instance and load data from xml object.\n \n@@ -270,15 +279,34 @@ class Result(object):\n :type data: xml.etree.ElementTree.Element\n :param api:\n :type api: Overpass\n+ :param parser: Specify the parser to use(DOM or SAX)\n+ :type parser: Integer\n :return: New instance of Result object\n :rtype: Result\n \"\"\"\n result = cls(api=api)\n- for elem_cls in [Node, Way, Relation]:\n- for child in root:\n- if child.tag.lower() == elem_cls._type_value:\n- result.append(elem_cls.from_xml(child, result=result))\n+ if parser == XML_PARSER_DOM:\n+ import xml.etree.ElementTree as ET\n+ root = ET.fromstring(data)\n \n+ for elem_cls in [Node, Way, Relation]:\n+ for child in root:\n+ if child.tag.lower() == elem_cls._type_value:\n+ result.append(elem_cls.from_xml(child, result=result))\n+\n+ elif parser == XML_PARSER_SAX:\n+ if PY2:\n+ from StringIO import StringIO\n+ else:\n+ from io import StringIO\n+ source = StringIO(data)\n+ sax_handler = OSMSAXHandler(result)\n+ parser = make_parser()\n+ parser.setContentHandler(sax_handler)\n+ parser.parse(source)\n+ else:\n+ # ToDo: better exception\n+ raise Exception(\"Unknown XML parser\")\n return result\n \n def get_node(self, node_id, resolve_missing=False):\n@@ -952,3 +980,185 @@ class RelationRelation(RelationMember):\n \n def __repr__(self):\n return \"\".format(self.ref, self.role)\n+\n+\n+class OSMSAXHandler(handler.ContentHandler):\n+ \"\"\"\n+ SAX parser for Overpass XML response.\n+ \"\"\"\n+ #: Tuple of opening elements to ignore\n+ ignore_start = ('osm', 'meta', 'note')\n+ #: Tuple of closing elements to ignore\n+ ignore_end = ('osm', 'meta', 'note', 'tag', 'nd', 'member')\n+\n+ def __init__(self, result):\n+ \"\"\"\n+ :param result: Append results to this result set.\n+ :type result: overpy.Result\n+ \"\"\"\n+ handler.ContentHandler.__init__(self)\n+ self._result = result\n+ self._curr = {}\n+\n+ def startElement(self, name, attrs):\n+ \"\"\"\n+ Handle opening elements.\n+\n+ :param name: Name of the element\n+ :type name: String\n+ :param attrs: Attributes of the element\n+ :type attrs: Dict\n+ \"\"\"\n+ if name in self.ignore_start:\n+ return\n+ try:\n+ handler = getattr(self, '_handle_start_%s' % name)\n+ except AttributeError:\n+ raise KeyError(\"Unknown element start '%s'\" % name)\n+ handler(attrs)\n+\n+ def endElement(self, name):\n+ \"\"\"\n+ Handle closing elements\n+\n+ :param name: Name of the element\n+ :type name: String\n+ \"\"\"\n+ if name in self.ignore_end:\n+ return\n+ try:\n+ handler = getattr(self, '_handle_end_%s' % name)\n+ except AttributeError:\n+ raise KeyError(\"Unknown element start '%s'\" % name)\n+ handler()\n+\n+ def _handle_start_tag(self, attrs):\n+ \"\"\"\n+ Handle opening tag element\n+\n+ :param attrs: Attributes of the element\n+ :type attrs: Dict\n+ \"\"\"\n+ try:\n+ tag_key = attrs['k']\n+ except KeyError:\n+ raise ValueError(\"Tag without name/key.\")\n+ self._curr['tags'][tag_key] = attrs.get('v')\n+\n+ def _handle_start_node(self, attrs):\n+ \"\"\"\n+ Handle opening node element\n+\n+ :param attrs: Attributes of the element\n+ :type attrs: Dict\n+ \"\"\"\n+ self._curr = {\n+ 'attributes': dict(attrs),\n+ 'lat': None,\n+ 'lon': None,\n+ 'node_id': None,\n+ 'tags': {}\n+ }\n+ if attrs.get('id', None) is not None:\n+ self._curr['node_id'] = int(attrs['id'])\n+ del self._curr['attributes']['id']\n+ if attrs.get('lat', None) is not None:\n+ self._curr['lat'] = Decimal(attrs['lat'])\n+ del self._curr['attributes']['lat']\n+ if attrs.get('lon', None) is not None:\n+ self._curr['lon'] = Decimal(attrs['lon'])\n+ del self._curr['attributes']['lon']\n+\n+ def _handle_end_node(self):\n+ \"\"\"\n+ Handle closing node element\n+ \"\"\"\n+ self._result.append(Node(result=self._result, **self._curr))\n+ self._curr = {}\n+\n+ def _handle_start_way(self, attrs):\n+ \"\"\"\n+ Handle opening way element\n+\n+ :param attrs: Attributes of the element\n+ :type attrs: Dict\n+ \"\"\"\n+ self._curr = {\n+ 'attributes': dict(attrs),\n+ 'node_ids': [],\n+ 'tags': {},\n+ 'way_id': None\n+ }\n+ if attrs.get('id', None) is not None:\n+ self._curr['way_id'] = int(attrs['id'])\n+ del self._curr['attributes']['id']\n+\n+ def _handle_end_way(self):\n+ \"\"\"\n+ Handle closing way element\n+ \"\"\"\n+ self._result.append(Way(result=self._result, **self._curr))\n+ self._curr = {}\n+\n+ def _handle_start_nd(self, attrs):\n+ \"\"\"\n+ Handle opening nd element\n+\n+ :param attrs: Attributes of the element\n+ :type attrs: Dict\n+ \"\"\"\n+ try:\n+ node_ref = attrs['ref']\n+ except KeyError:\n+ raise ValueError(\"Unable to find required ref value.\")\n+ self._curr['node_ids'].append(int(node_ref))\n+\n+ def _handle_start_relation(self, attrs):\n+ \"\"\"\n+ Handle opening relation element\n+\n+ :param attrs: Attributes of the element\n+ :type attrs: Dict\n+ \"\"\"\n+ self._curr = {\n+ 'attributes': dict(attrs),\n+ 'members': [],\n+ 'rel_id': None,\n+ 'tags': {}\n+ }\n+ if attrs.get('id', None) is not None:\n+ self._curr['rel_id'] = int(attrs['id'])\n+ del self._curr['attributes']['id']\n+\n+ def _handle_end_relation(self):\n+ \"\"\"\n+ Handle closing relation element\n+ \"\"\"\n+ self._result.append(Relation(result=self._result, **self._curr))\n+ self._curr = {}\n+\n+ def _handle_start_member(self, attrs):\n+ \"\"\"\n+ Handle opening member element\n+\n+ :param attrs: Attributes of the element\n+ :type attrs: Dict\n+ \"\"\"\n+ params = {\n+ 'ref': None,\n+ 'result': self._result,\n+ 'role': None\n+ }\n+ if attrs.get('ref', None):\n+ params['ref'] = int(attrs['ref'])\n+ if attrs.get('role', None):\n+ params['role'] = attrs['role']\n+\n+ if attrs['type'] == 'node':\n+ self._curr['members'].append(RelationNode(**params))\n+ elif attrs['type'] == 'way':\n+ self._curr['members'].append(RelationWay(**params))\n+ elif attrs['type'] == 'relation':\n+ self._curr['members'].append(RelationRelation(**params))\n+ else:\n+ raise ValueError(\"Undefined type for member: '%s'\" % attrs['type'])\n"},"problem_statement":{"kind":"string","value":"Less memory-consuming xml parsing\nCurrently the whole xml-result is first parsed into a xml.etree.ElementTree and than processed to create overpy structures. While this is perfectly fine for small amounts of data, larger files or requests consume a lot of memory that is not freed after the overpy result is constructed.\r\n\r\nA SAX-style parser could reduce the memory footprint and both overpy's architecture and osm_xml's structure would easily support such a parser."},"repo":{"kind":"string","value":"DinoTools/python-overpy"},"test_patch":{"kind":"string","value":"diff --git a/tests/test_xml.py b/tests/test_xml.py\nindex 2f6d02a..e0c7397 100644\n--- a/tests/test_xml.py\n+++ b/tests/test_xml.py\n@@ -9,31 +9,51 @@ from tests.base_class import read_file\n class TestNodes(BaseTestNodes):\n def test_node01(self):\n api = overpy.Overpass()\n- result = api.parse_xml(read_file(\"xml/node-01.xml\"))\n+ # DOM\n+ result = api.parse_xml(read_file(\"xml/node-01.xml\"), parser=overpy.XML_PARSER_DOM)\n+ self._test_node01(result)\n+ # SAX\n+ result = api.parse_xml(read_file(\"xml/node-01.xml\"), parser=overpy.XML_PARSER_SAX)\n self._test_node01(result)\n \n \n class TestRelation(BaseTestRelation):\n def test_relation01(self):\n api = overpy.Overpass()\n- result = api.parse_xml(read_file(\"xml/relation-01.xml\"))\n+ # DOM\n+ result = api.parse_xml(read_file(\"xml/relation-01.xml\"), parser=overpy.XML_PARSER_DOM)\n+ self._test_relation01(result)\n+ # SAX\n+ result = api.parse_xml(read_file(\"xml/relation-01.xml\"), parser=overpy.XML_PARSER_SAX)\n self._test_relation01(result)\n \n def test_relation02(self):\n api = overpy.Overpass()\n- result = api.parse_xml(read_file(\"xml/relation-02.xml\"))\n+ # DOM\n+ result = api.parse_xml(read_file(\"xml/relation-02.xml\"), parser=overpy.XML_PARSER_DOM)\n+ self._test_relation02(result)\n+ # SAX\n+ result = api.parse_xml(read_file(\"xml/relation-02.xml\"), parser=overpy.XML_PARSER_SAX)\n self._test_relation02(result)\n \n \n class TestWay(BaseTestWay):\n def test_way01(self):\n api = overpy.Overpass()\n- result = api.parse_xml(read_file(\"xml/way-01.xml\"))\n+ # DOM\n+ result = api.parse_xml(read_file(\"xml/way-01.xml\"), parser=overpy.XML_PARSER_DOM)\n+ self._test_way01(result)\n+ # SAX\n+ result = api.parse_xml(read_file(\"xml/way-01.xml\"), parser=overpy.XML_PARSER_SAX)\n self._test_way01(result)\n \n def test_way02(self):\n api = overpy.Overpass()\n- result = api.parse_xml(read_file(\"xml/way-02.xml\"))\n+ # DOM\n+ result = api.parse_xml(read_file(\"xml/way-02.xml\"), parser=overpy.XML_PARSER_DOM)\n+ self._test_way02(result)\n+ # SAX\n+ result = api.parse_xml(read_file(\"xml/way-02.xml\"), parser=overpy.XML_PARSER_SAX)\n self._test_way02(result)\n \n \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\": 1,\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\": \"pytest\",\n \"pip_packages\": [\n \"pytest\"\n ],\n \"pre_install\": null,\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":"exceptiongroup @ file:///croot/exceptiongroup_1706031385326/work\niniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work\n-e git+https://github.com/DinoTools/python-overpy.git@ac7df97ef4302d7eda46a6bb34a887e9b275748c#egg=overpy\npackaging @ file:///croot/packaging_1734472117206/work\npluggy @ file:///croot/pluggy_1733169602837/work\npytest @ file:///croot/pytest_1738938843180/work\ntomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work\n"},"environment":{"kind":"string","value":"name: python-overpy\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\nprefix: /opt/conda/envs/python-overpy\n"},"FAIL_TO_PASS":{"kind":"list like","value":["tests/test_xml.py::TestNodes::test_node01","tests/test_xml.py::TestRelation::test_relation01","tests/test_xml.py::TestRelation::test_relation02","tests/test_xml.py::TestWay::test_way01","tests/test_xml.py::TestWay::test_way02"],"string":"[\n \"tests/test_xml.py::TestNodes::test_node01\",\n \"tests/test_xml.py::TestRelation::test_relation01\",\n \"tests/test_xml.py::TestRelation::test_relation02\",\n \"tests/test_xml.py::TestWay::test_way01\",\n \"tests/test_xml.py::TestWay::test_way02\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["tests/test_xml.py::TestDataError::test_element_wrong_type","tests/test_xml.py::TestDataError::test_node_missing_data","tests/test_xml.py::TestDataError::test_relation_missing_data","tests/test_xml.py::TestDataError::test_way_missing_data"],"string":"[\n \"tests/test_xml.py::TestDataError::test_element_wrong_type\",\n \"tests/test_xml.py::TestDataError::test_node_missing_data\",\n \"tests/test_xml.py::TestDataError::test_relation_missing_data\",\n \"tests/test_xml.py::TestDataError::test_way_missing_data\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"MIT License"},"__index_level_0__":{"kind":"number","value":130,"string":"130"}}},{"rowIdx":131,"cells":{"instance_id":{"kind":"string","value":"mkdocs__mkdocs-510"},"base_commit":{"kind":"string","value":"5b8bae094b2cfbc3cb9ef2f77cee4c1271abd3e2"},"created_at":{"kind":"string","value":"2015-05-09 20:09:55"},"environment_setup_commit":{"kind":"string","value":"463c5b647e9ce5992b519708a0b9c4cba891d65c"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/docs/user-guide/configuration.md b/docs/user-guide/configuration.md\nindex a619e5ea..97824ff0 100644\n--- a/docs/user-guide/configuration.md\n+++ b/docs/user-guide/configuration.md\n@@ -163,6 +163,13 @@ Set a list of JavaScript files to be included by the theme.\n \n **default**: By default `extra_javascript` will contain a list of all the JavaScript files found within the `docs_dir`, if none are found it will be `[]` (an empty list).\n \n+\n+### extra\n+\n+A set of key value pairs, where the values can be any valid YAML construct, that will be passed to the template. This allows for great flexibility when creating custom themes.\n+\n+**default**: By default `extra` will be an empty key value mapping.\n+\n ## Preview controls\n \n ### use_directory_urls\ndiff --git a/docs/user-guide/styling-your-docs.md b/docs/user-guide/styling-your-docs.md\nindex af7d6ef7..78d510b3 100644\n--- a/docs/user-guide/styling-your-docs.md\n+++ b/docs/user-guide/styling-your-docs.md\n@@ -119,15 +119,11 @@ Article content from each page specified in `mkdocs.yml` is inserted using the `\n \n ### Template Variables\n \n-Each template in a theme is built with a template context. These are the variables that are available to theme. The context varies depending on the template that is being built. At the moment templates are either built with\n-the global context or with a page specific context. The global context is used\n-for HTML pages that don't represent an individual Markdown document, for\n-example a 404.html page or search.html.\n-\n+Each template in a theme is built with a template context. These are the variables that are available to themes. The context varies depending on the template that is being built. At the moment templates are either built with the global context or with a page specific context. The global context is used for HTML pages that don't represent an individual Markdown document, for example a 404.html page or search.html.\n \n #### Global Context\n \n-The following variables in the context map directly the the configuration file.\n+The following variables in the context map directly the the [configuration options](/user-guide/configuration/).\n \n Variable Name | Configuration name\n ----------------- | ------------------- |\n@@ -140,6 +136,7 @@ repo_name | repo_name |\n site_url | site_url |\n extra_css | extra_css |\n extra_javascript | extra_javascript |\n+extra | extra |\n include_nav | include_nav |\n include_next_prev | include_next_prev |\n copyright | copyright |\n@@ -237,6 +234,34 @@ The page object for the previous page. The isage is the same as for\n ##### next_page\n The page object for the next page.The isage is the same as for `current_page`.\n \n+#### Extra Context\n+\n+Additional variables can be passed to the template with the [`extra`](/user-guide/configuration/#extra) configuration option. This is a set of key value pairs that can make custom templates far more flexible.\n+\n+For example, this could be used to include the project version of all pages and a list of links related to the project. This can be achieved with the following `extra` configuration:\n+\n+```yaml\n+extra:\n+ version: 0.13.0\n+ links:\n+ - https://github.com/mkdocs\n+ - https://docs.readthedocs.org/en/latest/builds.html#mkdocs\n+ - http://www.mkdocs.org/\n+```\n+\n+And then displayed with this HTML in the custom theme.\n+\n+```html\n+{{ extra.version }}\n+\n+{% if extra.links %}\n+
    \n+ {% for link in extra.links %}\n+
  • {{ link }}
  • \n+ {% endfor %}\n+
\n+{% endif %}\n+```\n \n ### Search and themes\n \ndiff --git a/mkdocs/build.py b/mkdocs/build.py\nindex 1bd28e88..55dd4d47 100644\n--- a/mkdocs/build.py\n+++ b/mkdocs/build.py\n@@ -1,4 +1,5 @@\n # coding: utf-8\n+from __future__ import print_function\n \n from datetime import datetime\n from io import open\n@@ -90,7 +91,9 @@ def get_global_context(nav, config):\n 'google_analytics': config['google_analytics'],\n \n 'mkdocs_version': mkdocs.__version__,\n- 'build_date_utc': datetime.utcnow()\n+ 'build_date_utc': datetime.utcnow(),\n+\n+ 'extra': config['extra']\n }\n \n \n@@ -149,7 +152,7 @@ def build_sitemap(config, env, site_navigation):\n \n def build_template(template_name, env, config, site_navigation=None):\n \n- log.debug(\"Building template: %s\", template_name)\n+ log.debug(\"Building %s page\", template_name)\n \n try:\n template = env.get_template(template_name)\n@@ -279,12 +282,12 @@ def build(config, live_server=False, dump_json=False, clean_site_dir=False):\n Perform a full site build.\n \"\"\"\n if clean_site_dir:\n- log.info(\"Cleaning site directory\")\n+ print(\"Cleaning site directory\")\n utils.clean_directory(config['site_dir'])\n if not live_server:\n- log.info(\"Building documentation to directory: %s\", config['site_dir'])\n+ print(\"Building documentation to directory: %s\" % config['site_dir'])\n if not clean_site_dir and site_directory_contains_stale_files(config['site_dir']):\n- log.info(\"The directory contains stale files. Use --clean to remove them.\")\n+ print(\"Directory %s contains stale files. Use --clean to remove them.\" % config['site_dir'])\n \n if dump_json:\n build_pages(config, dump_json=True)\ndiff --git a/mkdocs/cli.py b/mkdocs/cli.py\nindex 91ad8d34..06aa8a86 100644\n--- a/mkdocs/cli.py\n+++ b/mkdocs/cli.py\n@@ -19,16 +19,11 @@ def configure_logging(is_verbose=False):\n '''When a --verbose flag is passed, increase the verbosity of mkdocs'''\n \n logger = logging.getLogger('mkdocs')\n- logger.propagate = False\n- stream = logging.StreamHandler()\n- formatter = logging.Formatter(\"%(levelname)-7s - %(message)s \")\n- stream.setFormatter(formatter)\n- logger.addHandler(stream)\n \n if is_verbose:\n logger.setLevel(logging.DEBUG)\n else:\n- logger.setLevel(logging.INFO)\n+ logger.setLevel(logging.WARNING)\n \n \n clean_help = \"Remove old files from the site_dir before building\"\ndiff --git a/mkdocs/config/defaults.py b/mkdocs/config/defaults.py\nindex b3b14146..6ce0922e 100644\n--- a/mkdocs/config/defaults.py\n+++ b/mkdocs/config/defaults.py\n@@ -96,4 +96,11 @@ DEFAULT_SCHEMA = (\n # enabling strict mode causes MkDocs to stop the build when a problem is\n # encountered rather than display an error.\n ('strict', config_options.Type(bool, default=False)),\n+\n+ # extra is a mapping/dictionary of data that is passed to the template.\n+ # This allows template authors to require extra configuration that not\n+ # relevant to all themes and doesn't need to be explicitly supported by\n+ # MkDocs itself. A good example here would be including the current\n+ # project version.\n+ ('extra', config_options.Type(dict, default={})),\n )\ndiff --git a/mkdocs/gh_deploy.py b/mkdocs/gh_deploy.py\nindex 4e07a0a5..f5692d2d 100644\n--- a/mkdocs/gh_deploy.py\n+++ b/mkdocs/gh_deploy.py\n@@ -1,19 +1,15 @@\n-import logging\n+from __future__ import print_function\n import subprocess\n import os\n \n-log = logging.getLogger(__name__)\n-\n \n def gh_deploy(config):\n \n if not os.path.exists('.git'):\n- log.info('Cannot deploy - this directory does not appear to be a git '\n- 'repository')\n+ print('Cannot deploy - this directory does not appear to be a git repository')\n return\n \n- log.info(\"Copying '%s' to `gh-pages` branch and pushing to GitHub.\",\n- config['site_dir'])\n+ print(\"Copying '%s' to `gh-pages` branch and pushing to GitHub.\" % config['site_dir'])\n try:\n command = ['ghp-import', '-p', config['site_dir']]\n if 'remote_branch' in config:\n@@ -27,16 +23,13 @@ def gh_deploy(config):\n # This GitHub pages repository has a CNAME configured.\n with(open('CNAME', 'r')) as f:\n cname_host = f.read().strip()\n- log.info('Based on your CNAME file, your documentation should be '\n- 'available shortly at: http://%s', cname_host)\n- log.info('NOTE: Your DNS records must be configured appropriately for '\n- 'your CNAME URL to work.')\n+ print('Based on your CNAME file, your documentation should be available shortly at: http://%s' % cname_host)\n+ print('NOTE: Your DNS records must be configured appropriately for your CNAME URL to work.')\n return\n \n # No CNAME found. We will use the origin URL to determine the GitHub\n # pages location.\n- url = subprocess.check_output([\"git\", \"config\", \"--get\",\n- \"remote.origin.url\"])\n+ url = subprocess.check_output([\"git\", \"config\", \"--get\", \"remote.origin.url\"])\n url = url.decode('utf-8').strip()\n \n host = None\n@@ -48,10 +41,10 @@ def gh_deploy(config):\n \n if host is None:\n # This could be a GitHub Enterprise deployment.\n- log.info('Your documentation should be available shortly.')\n+ print('Your documentation should be available shortly.')\n else:\n username, repo = path.split('/', 1)\n if repo.endswith('.git'):\n repo = repo[:-len('.git')]\n url = 'http://%s.github.io/%s' % (username, repo)\n- log.info('Your documentation should shortly be available at: ' + url)\n+ print('Your documentation should shortly be available at: ' + url)\ndiff --git a/mkdocs/new.py b/mkdocs/new.py\nindex 165d124d..4f3420f9 100644\n--- a/mkdocs/new.py\n+++ b/mkdocs/new.py\n@@ -1,8 +1,7 @@\n # coding: utf-8\n-from __future__ import unicode_literals\n+from __future__ import print_function, unicode_literals\n \n import os\n-import logging\n from io import open\n \n config_text = 'site_name: My Docs\\n'\n@@ -25,8 +24,6 @@ For full documentation visit [mkdocs.org](http://mkdocs.org).\n ... # Other markdown pages, images and other files.\n \"\"\"\n \n-log = logging.getLogger(__name__)\n-\n \n def new(output_dir):\n \n@@ -35,20 +32,20 @@ def new(output_dir):\n index_path = os.path.join(docs_dir, 'index.md')\n \n if os.path.exists(config_path):\n- log.info('Project already exists.')\n+ print('Project already exists.')\n return\n \n if not os.path.exists(output_dir):\n- log.info('Creating project directory: %s', output_dir)\n+ print('Creating project directory: %s' % output_dir)\n os.mkdir(output_dir)\n \n- log.info('Writing config file: %s', config_path)\n+ print('Writing config file: %s' % config_path)\n open(config_path, 'w', encoding='utf-8').write(config_text)\n \n if os.path.exists(index_path):\n return\n \n- log.info('Writing initial docs: %s', index_path)\n+ print('Writing initial docs: %s' % index_path)\n if not os.path.exists(docs_dir):\n os.mkdir(docs_dir)\n open(index_path, 'w', encoding='utf-8').write(index_text)\n"},"problem_statement":{"kind":"string","value":"Global template variables?\nThis is more of a question (and potentially a feature request if this isn't supported) than an issue – is there some way to declare global variables?\r\n\r\nFor example, in my config.yml, I'd like to define some global variable, `version-num` that, of course, represents the current version of the library that I'm documenting. I'd naturally like to use this all over in my documentation and have only one place to update the version number when releasing a new version – in config.yml.\r\n\r\nThough I've tried to do this and beyond the pre-defined variables in the mkdocs documentation, nothing that I declare seems to be picked up.\r\n\r\nIs there some way to do this that I don't see?\r\n\r\nPS, Jekyll allows for this, so I'm basically assuming the same semantics as Jekyll, i.e., that user-defined variables in config.yml are globally accessible"},"repo":{"kind":"string","value":"mkdocs/mkdocs"},"test_patch":{"kind":"string","value":"diff --git a/mkdocs/tests/build_tests.py b/mkdocs/tests/build_tests.py\nindex 7f2a04a7..96f3b5b0 100644\n--- a/mkdocs/tests/build_tests.py\n+++ b/mkdocs/tests/build_tests.py\n@@ -7,6 +7,7 @@ import tempfile\n import unittest\n \n from six.moves import zip\n+import mock\n \n from mkdocs import build, nav\n from mkdocs.config import base as config_base, defaults as config_defaults\n@@ -343,3 +344,22 @@ class BuildTests(unittest.TestCase):\n \"\"\")\n \n self.assertEqual(html.strip(), expected_html)\n+\n+ def test_extra_context(self):\n+\n+ # Same as the default schema, but don't verify the docs_dir exists.\n+ config = config_base.Config(schema=config_defaults.DEFAULT_SCHEMA)\n+ config.load_dict({\n+ 'site_name': \"Site\",\n+ 'extra': {\n+ 'a': 1\n+ }\n+ })\n+\n+ self.assertEqual(config.validate(), ([], []))\n+\n+ context = build.get_global_context(mock.Mock(), config)\n+\n+ self.assertEqual(context['extra'], {\n+ 'a': 1\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\": 1,\n \"issue_text_score\": 1,\n \"test_score\": 1\n },\n \"num_modified_files\": 7\n}"},"version":{"kind":"string","value":"0.12"},"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 \"coverage\",\n \"flake8\",\n \"nose\",\n \"mock\",\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/project.txt\"\n ],\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"click==8.1.8\ncoverage==7.8.0\nexceptiongroup==1.2.2\nflake8==7.2.0\nghp-import==2.1.0\nimportlib_metadata==8.6.1\niniconfig==2.1.0\nJinja2==3.1.6\nlivereload==2.7.1\nMarkdown==3.7\nMarkupSafe==3.0.2\nmccabe==0.7.0\n-e git+https://github.com/mkdocs/mkdocs.git@5b8bae094b2cfbc3cb9ef2f77cee4c1271abd3e2#egg=mkdocs\nmock==5.2.0\nnose==1.3.7\npackaging==24.2\npluggy==1.5.0\npycodestyle==2.13.0\npyflakes==3.3.1\npytest==8.3.5\npython-dateutil==2.9.0.post0\nPyYAML==6.0.2\nsix==1.17.0\ntomli==2.2.1\ntornado==6.4.2\nzipp==3.21.0\n"},"environment":{"kind":"string","value":"name: mkdocs\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 - click==8.1.8\n - coverage==7.8.0\n - exceptiongroup==1.2.2\n - flake8==7.2.0\n - ghp-import==2.1.0\n - importlib-metadata==8.6.1\n - iniconfig==2.1.0\n - jinja2==3.1.6\n - livereload==2.7.1\n - markdown==3.7\n - markupsafe==3.0.2\n - mccabe==0.7.0\n - mock==5.2.0\n - nose==1.3.7\n - packaging==24.2\n - pluggy==1.5.0\n - pycodestyle==2.13.0\n - pyflakes==3.3.1\n - pytest==8.3.5\n - python-dateutil==2.9.0.post0\n - pyyaml==6.0.2\n - six==1.17.0\n - tomli==2.2.1\n - tornado==6.4.2\n - zipp==3.21.0\nprefix: /opt/conda/envs/mkdocs\n"},"FAIL_TO_PASS":{"kind":"list like","value":["mkdocs/tests/build_tests.py::BuildTests::test_extra_context"],"string":"[\n \"mkdocs/tests/build_tests.py::BuildTests::test_extra_context\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":["mkdocs/tests/build_tests.py::BuildTests::test_anchor_only_link","mkdocs/tests/build_tests.py::BuildTests::test_convert_internal_asbolute_media","mkdocs/tests/build_tests.py::BuildTests::test_convert_internal_link","mkdocs/tests/build_tests.py::BuildTests::test_convert_internal_link_differing_directory","mkdocs/tests/build_tests.py::BuildTests::test_convert_internal_link_with_anchor","mkdocs/tests/build_tests.py::BuildTests::test_convert_internal_media","mkdocs/tests/build_tests.py::BuildTests::test_convert_markdown","mkdocs/tests/build_tests.py::BuildTests::test_convert_multiple_internal_links","mkdocs/tests/build_tests.py::BuildTests::test_copying_media","mkdocs/tests/build_tests.py::BuildTests::test_dont_convert_code_block_urls","mkdocs/tests/build_tests.py::BuildTests::test_empty_document","mkdocs/tests/build_tests.py::BuildTests::test_extension_config","mkdocs/tests/build_tests.py::BuildTests::test_ignore_external_link","mkdocs/tests/build_tests.py::BuildTests::test_markdown_custom_extension","mkdocs/tests/build_tests.py::BuildTests::test_markdown_duplicate_custom_extension","mkdocs/tests/build_tests.py::BuildTests::test_markdown_fenced_code_extension","mkdocs/tests/build_tests.py::BuildTests::test_markdown_table_extension","mkdocs/tests/build_tests.py::BuildTests::test_not_use_directory_urls","mkdocs/tests/build_tests.py::BuildTests::test_strict_mode_invalid","mkdocs/tests/build_tests.py::BuildTests::test_strict_mode_valid"],"string":"[\n \"mkdocs/tests/build_tests.py::BuildTests::test_anchor_only_link\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_convert_internal_asbolute_media\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_convert_internal_link\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_convert_internal_link_differing_directory\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_convert_internal_link_with_anchor\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_convert_internal_media\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_convert_markdown\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_convert_multiple_internal_links\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_copying_media\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_dont_convert_code_block_urls\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_empty_document\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_extension_config\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_ignore_external_link\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_markdown_custom_extension\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_markdown_duplicate_custom_extension\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_markdown_fenced_code_extension\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_markdown_table_extension\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_not_use_directory_urls\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_strict_mode_invalid\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_strict_mode_valid\"\n]"},"PASS_TO_PASS":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"BSD 2-Clause \"Simplified\" License"},"__index_level_0__":{"kind":"number","value":131,"string":"131"}}},{"rowIdx":132,"cells":{"instance_id":{"kind":"string","value":"mne-tools__mne-python-2076"},"base_commit":{"kind":"string","value":"7f8071891d7a8c2fdaa61ea3a8819394fcd86de2"},"created_at":{"kind":"string","value":"2015-05-09 22:40:37"},"environment_setup_commit":{"kind":"string","value":"edceb8f38349d6dc0cade1c9f8384cc0707ce3e8"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/mne/datasets/sample/__init__.py b/mne/datasets/sample/__init__.py\nindex 1a278cfcc..3e4de83f4 100644\n--- a/mne/datasets/sample/__init__.py\n+++ b/mne/datasets/sample/__init__.py\n@@ -1,4 +1,4 @@\n \"\"\"MNE sample dataset\n \"\"\"\n \n-from .sample import data_path, has_sample_data\n+from .sample import data_path, has_sample_data, get_version\ndiff --git a/mne/datasets/sample/sample.py b/mne/datasets/sample/sample.py\nindex 87ed46446..15d4b1281 100644\n--- a/mne/datasets/sample/sample.py\n+++ b/mne/datasets/sample/sample.py\n@@ -5,7 +5,8 @@\n \n from ...utils import verbose\n from ...fixes import partial\n-from ..utils import has_dataset, _data_path, _doc\n+from ..utils import (has_dataset, _data_path, _data_path_doc,\n+ _get_version, _version_doc)\n \n \n has_sample_data = partial(has_dataset, name='sample')\n@@ -18,5 +19,11 @@ def data_path(path=None, force_update=False, update_path=True, download=True,\n update_path=update_path, name='sample',\n download=download)\n \n-data_path.__doc__ = _doc.format(name='sample',\n- conf='MNE_DATASETS_SAMPLE_PATH')\n+data_path.__doc__ = _data_path_doc.format(name='sample',\n+ conf='MNE_DATASETS_SAMPLE_PATH')\n+\n+\n+def get_version():\n+ return _get_version('sample')\n+\n+get_version.__doc__ = _version_doc.format(name='sample')\ndiff --git a/mne/datasets/somato/__init__.py b/mne/datasets/somato/__init__.py\nindex ab144bc9d..aa3f82d8d 100644\n--- a/mne/datasets/somato/__init__.py\n+++ b/mne/datasets/somato/__init__.py\n@@ -1,4 +1,4 @@\n \"\"\"Somatosensory dataset\n \"\"\"\n \n-from .somato import data_path, has_somato_data\n+from .somato import data_path, has_somato_data, get_version\ndiff --git a/mne/datasets/somato/somato.py b/mne/datasets/somato/somato.py\nindex 525f2af3d..d0daf987b 100644\n--- a/mne/datasets/somato/somato.py\n+++ b/mne/datasets/somato/somato.py\n@@ -1,11 +1,12 @@\n-# Authors: Alexandre Gramfort \n+# Authors: Alexandre Gramfort \n # Martin Luessi \n # Eric Larson \n # License: BSD Style.\n \n from ...utils import verbose\n from ...fixes import partial\n-from ..utils import has_dataset, _data_path, _doc\n+from ..utils import (has_dataset, _data_path, _data_path_doc,\n+ _get_version, _version_doc)\n \n \n has_somato_data = partial(has_dataset, name='somato')\n@@ -18,5 +19,11 @@ def data_path(path=None, force_update=False, update_path=True, download=True,\n update_path=update_path, name='somato',\n download=download)\n \n-data_path.__doc__ = _doc.format(name='somato',\n- conf='MNE_DATASETS_SOMATO_PATH')\n+data_path.__doc__ = _data_path_doc.format(name='somato',\n+ conf='MNE_DATASETS_SOMATO_PATH')\n+\n+\n+def get_version():\n+ return _get_version('somato')\n+\n+get_version.__doc__ = _version_doc.format(name='somato')\ndiff --git a/mne/datasets/spm_face/__init__.py b/mne/datasets/spm_face/__init__.py\nindex 43b513e9f..90f01c728 100644\n--- a/mne/datasets/spm_face/__init__.py\n+++ b/mne/datasets/spm_face/__init__.py\n@@ -1,4 +1,4 @@\n \"\"\"SPM face dataset\n \"\"\"\n \n-from .spm_data import data_path, has_spm_data\n+from .spm_data import data_path, has_spm_data, get_version\ndiff --git a/mne/datasets/spm_face/spm_data.py b/mne/datasets/spm_face/spm_data.py\nindex ca681de16..19c6461ee 100644\n--- a/mne/datasets/spm_face/spm_data.py\n+++ b/mne/datasets/spm_face/spm_data.py\n@@ -4,7 +4,8 @@\n \n from ...utils import verbose\n from ...fixes import partial\n-from ..utils import has_dataset, _data_path, _doc\n+from ..utils import (has_dataset, _data_path, _data_path_doc,\n+ _get_version, _version_doc)\n \n \n has_spm_data = partial(has_dataset, name='spm')\n@@ -17,5 +18,11 @@ def data_path(path=None, force_update=False, update_path=True, download=True,\n update_path=update_path, name='spm',\n download=download)\n \n-data_path.__doc__ = _doc.format(name='spm',\n- conf='MNE_DATASETS_SPM_DATA_PATH')\n+data_path.__doc__ = _data_path_doc.format(name='spm',\n+ conf='MNE_DATASETS_SPM_DATA_PATH')\n+\n+\n+def get_version():\n+ return _get_version('spm')\n+\n+get_version.__doc__ = _version_doc.format(name='spm')\ndiff --git a/mne/datasets/utils.py b/mne/datasets/utils.py\nindex 3ede4d718..be6f5fb0d 100644\n--- a/mne/datasets/utils.py\n+++ b/mne/datasets/utils.py\n@@ -17,7 +17,7 @@ from ..externals.six import string_types\n from ..externals.six.moves import input\n \n \n-_doc = \"\"\"Get path to local copy of {name} dataset\n+_data_path_doc = \"\"\"Get path to local copy of {name} dataset\n \n Parameters\n ----------\n@@ -49,6 +49,16 @@ _doc = \"\"\"Get path to local copy of {name} dataset\n \"\"\"\n \n \n+_version_doc = \"\"\"Get version of the local {name} dataset\n+\n+ Returns\n+ -------\n+ version : str | None\n+ Version of the {name} local dataset, or None if the dataset\n+ does not exist locally.\n+\"\"\"\n+\n+\n def _dataset_version(path, name):\n \"\"\"Get the version of the dataset\"\"\"\n ver_fname = op.join(path, 'version.txt')\n@@ -64,7 +74,7 @@ def _dataset_version(path, name):\n \n \n def _data_path(path=None, force_update=False, update_path=True, download=True,\n- name=None, check_version=True):\n+ name=None, check_version=False, return_version=False):\n \"\"\"Aux function\n \"\"\"\n key = {'sample': 'MNE_DATASETS_SAMPLE_PATH',\n@@ -229,8 +239,14 @@ def _data_path(path=None, force_update=False, update_path=True, download=True,\n 'you may need to update the {name} dataset by using '\n 'mne.datasets.{name}.data_path(force_update=True)'.format(\n name=name, current=data_version, newest=mne_version))\n+ return (path, data_version) if return_version else path\n+\n \n- return path\n+def _get_version(name):\n+ \"\"\"Helper to get a dataset version\"\"\"\n+ if not has_dataset(name):\n+ return None\n+ return _data_path(name=name, return_version=True)[1]\n \n \n def has_dataset(name):\ndiff --git a/mne/io/base.py b/mne/io/base.py\nindex 501e8a7f1..cb3623324 100644\n--- a/mne/io/base.py\n+++ b/mne/io/base.py\n@@ -1054,6 +1054,7 @@ class _BaseRaw(ProjMixin, ContainsMixin, PickDropChannelsMixin,\n block : bool\n Whether to halt program execution until the figure is closed.\n Useful for setting bad channels on the fly (click on line).\n+ May not work on all systems / platforms.\n highpass : float | None\n Highpass to apply when displaying data.\n lowpass : float | None\ndiff --git a/mne/viz/raw.py b/mne/viz/raw.py\nindex 518280032..1bea5a1f4 100644\n--- a/mne/viz/raw.py\n+++ b/mne/viz/raw.py\n@@ -373,6 +373,7 @@ def plot_raw(raw, events=None, duration=10.0, start=0.0, n_channels=None,\n block : bool\n Whether to halt program execution until the figure is closed.\n Useful for setting bad channels on the fly by clicking on a line.\n+ May not work on all systems / platforms.\n highpass : float | None\n Highpass to apply when displaying data.\n lowpass : float | None\n@@ -623,7 +624,10 @@ def plot_raw(raw, events=None, duration=10.0, start=0.0, n_channels=None,\n _toggle_options(None, params)\n \n if show:\n- plt.show(block=block)\n+ try:\n+ plt.show(block=block)\n+ except TypeError: # not all versions have this\n+ plt.show()\n \n return fig\n \ndiff --git a/setup.py b/setup.py\nindex 9cbd8af53..353d7c37d 100755\n--- a/setup.py\n+++ b/setup.py\n@@ -71,6 +71,7 @@ if __name__ == \"__main__\":\n 'mne.datasets.somato',\n 'mne.datasets.spm_face',\n 'mne.datasets.testing',\n+ 'mne.datasets.tests',\n 'mne.externals',\n 'mne.io', 'mne.io.tests',\n 'mne.io.array', 'mne.io.array.tests',\n"},"problem_statement":{"kind":"string","value":"Q: Dataset versions\nHave we gotten any useful information from embedding dataset versions in our tarballs? As far as I can tell it has just led to a bunch of warnings when doing imports (see e.g. Mainak's recent notebook examples). I propose we get rid of them for now, and replace them with a new system in the future if need be. But for now I think it's beyond YAGNI and into the adding-annoyance category..."},"repo":{"kind":"string","value":"mne-tools/mne-python"},"test_patch":{"kind":"string","value":"diff --git a/mne/datasets/testing/__init__.py b/mne/datasets/testing/__init__.py\nindex 816bbf18a..7fa74ee41 100644\n--- a/mne/datasets/testing/__init__.py\n+++ b/mne/datasets/testing/__init__.py\n@@ -1,4 +1,4 @@\n \"\"\"MNE sample dataset\n \"\"\"\n \n-from ._testing import data_path, requires_testing_data\n+from ._testing import data_path, requires_testing_data, get_version\ndiff --git a/mne/datasets/testing/_testing.py b/mne/datasets/testing/_testing.py\nindex fe23cf4fb..932bd2e20 100644\n--- a/mne/datasets/testing/_testing.py\n+++ b/mne/datasets/testing/_testing.py\n@@ -7,7 +7,8 @@ import numpy as np\n \n from ...utils import verbose, get_config\n from ...fixes import partial\n-from ..utils import has_dataset, _data_path, _doc\n+from ..utils import (has_dataset, _data_path, _data_path_doc,\n+ _get_version, _version_doc)\n \n \n has_testing_data = partial(has_dataset, name='testing')\n@@ -24,8 +25,14 @@ def data_path(path=None, force_update=False, update_path=True,\n update_path=update_path, name='testing',\n download=download)\n \n-data_path.__doc__ = _doc.format(name='testing',\n- conf='MNE_DATASETS_TESTING_PATH')\n+data_path.__doc__ = _data_path_doc.format(name='testing',\n+ conf='MNE_DATASETS_TESTING_PATH')\n+\n+\n+def get_version():\n+ return _get_version('testing')\n+\n+get_version.__doc__ = _version_doc.format(name='testing')\n \n \n # Allow forcing of testing dataset skip (for Debian tests) using:\ndiff --git a/mne/datasets/tests/__init__.py b/mne/datasets/tests/__init__.py\nnew file mode 100644\nindex 000000000..e69de29bb\ndiff --git a/mne/datasets/tests/test_datasets.py b/mne/datasets/tests/test_datasets.py\nnew file mode 100644\nindex 000000000..76bacaa14\n--- /dev/null\n+++ b/mne/datasets/tests/test_datasets.py\n@@ -0,0 +1,15 @@\n+from nose.tools import assert_true\n+\n+from mne import datasets\n+from mne.externals.six import string_types\n+\n+\n+def test_datasets():\n+ \"\"\"Test simple dataset functions\n+ \"\"\"\n+ for dname in ('sample', 'somato', 'spm_face', 'testing'):\n+ dataset = getattr(datasets, dname)\n+ if dataset.data_path(download=False) != '':\n+ assert_true(isinstance(dataset.get_version(), string_types))\n+ else:\n+ assert_true(dataset.get_version() is None)\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\": 2,\n \"test_score\": 3\n },\n \"num_modified_files\": 10\n}"},"version":{"kind":"string","value":"0.8"},"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 \"numpy>=1.16.0\",\n \"pandas>=1.0.0\",\n \"scikit-learn\",\n \"h5py\",\n \"pysurfer\",\n \"nose\",\n \"nose-timer\",\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/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":"apptools==5.2.1\ncertifi @ file:///croot/certifi_1671487769961/work/certifi\nconfigobj==5.0.9\ncycler==0.11.0\nenvisage==7.0.3\nexceptiongroup==1.2.2\nfonttools==4.38.0\nh5py==3.8.0\nimportlib-metadata==6.7.0\nimportlib-resources==5.12.0\niniconfig==2.0.0\njoblib==1.3.2\nkiwisolver==1.4.5\nmatplotlib==3.5.3\nmayavi==4.8.1\n-e git+https://github.com/mne-tools/mne-python.git@7f8071891d7a8c2fdaa61ea3a8819394fcd86de2#egg=mne\nnibabel==4.0.2\nnose==1.3.7\nnose-timer==1.0.1\nnumpy==1.21.6\npackaging==24.0\npandas==1.3.5\nPillow==9.5.0\npluggy==1.2.0\npyface==8.0.0\nPygments==2.17.2\npyparsing==3.1.4\npysurfer==0.11.2\npytest==7.4.4\npython-dateutil==2.9.0.post0\npytz==2025.2\nscikit-learn==1.0.2\nscipy==1.7.3\nsix==1.17.0\nthreadpoolctl==3.1.0\ntomli==2.0.1\ntraits==6.4.3\ntraitsui==8.0.0\ntyping_extensions==4.7.1\nvtk==9.3.1\nzipp==3.15.0\n"},"environment":{"kind":"string","value":"name: mne-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 - 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 - apptools==5.2.1\n - configobj==5.0.9\n - cycler==0.11.0\n - envisage==7.0.3\n - exceptiongroup==1.2.2\n - fonttools==4.38.0\n - h5py==3.8.0\n - importlib-metadata==6.7.0\n - importlib-resources==5.12.0\n - iniconfig==2.0.0\n - joblib==1.3.2\n - kiwisolver==1.4.5\n - matplotlib==3.5.3\n - mayavi==4.8.1\n - nibabel==4.0.2\n - nose==1.3.7\n - nose-timer==1.0.1\n - numpy==1.21.6\n - packaging==24.0\n - pandas==1.3.5\n - pillow==9.5.0\n - pluggy==1.2.0\n - pyface==8.0.0\n - pygments==2.17.2\n - pyparsing==3.1.4\n - pysurfer==0.11.2\n - pytest==7.4.4\n - python-dateutil==2.9.0.post0\n - pytz==2025.2\n - scikit-learn==1.0.2\n - scipy==1.7.3\n - six==1.17.0\n - threadpoolctl==3.1.0\n - tomli==2.0.1\n - traits==6.4.3\n - traitsui==8.0.0\n - typing-extensions==4.7.1\n - vtk==9.3.1\n - zipp==3.15.0\nprefix: /opt/conda/envs/mne-python\n"},"FAIL_TO_PASS":{"kind":"list like","value":["mne/datasets/tests/test_datasets.py::test_datasets"],"string":"[\n \"mne/datasets/tests/test_datasets.py::test_datasets\"\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":"BSD 3-Clause \"New\" or \"Revised\" License"},"__index_level_0__":{"kind":"number","value":132,"string":"132"}}},{"rowIdx":133,"cells":{"instance_id":{"kind":"string","value":"pre-commit__pre-commit-226"},"base_commit":{"kind":"string","value":"d97ea30c4bb309a2877fed95323ac8c793c0679f"},"created_at":{"kind":"string","value":"2015-05-10 16:40:06"},"environment_setup_commit":{"kind":"string","value":"9515ca06378d74f1e4f8013db2b5230c1f15edaa"},"hints_text":{"kind":"string","value":"coveralls: \n[![Coverage Status](https://coveralls.io/builds/2530482/badge)](https://coveralls.io/builds/2530482)\n\nCoverage decreased (-0.07%) to 99.93% when pulling **8aa931ef823fbeda568db1d3c50c55b04d83fa2e on Lucas-C:master** into **d97ea30c4bb309a2877fed95323ac8c793c0679f on pre-commit:master**.\n\ncoveralls: \n[![Coverage Status](https://coveralls.io/builds/2530482/badge)](https://coveralls.io/builds/2530482)\n\nCoverage decreased (-0.07%) to 99.93% when pulling **8aa931ef823fbeda568db1d3c50c55b04d83fa2e on Lucas-C:master** into **d97ea30c4bb309a2877fed95323ac8c793c0679f on pre-commit:master**.\n\ncoveralls: \n[![Coverage Status](https://coveralls.io/builds/2530482/badge)](https://coveralls.io/builds/2530482)\n\nCoverage decreased (-0.07%) to 99.93% when pulling **8aa931ef823fbeda568db1d3c50c55b04d83fa2e on Lucas-C:master** into **d97ea30c4bb309a2877fed95323ac8c793c0679f on pre-commit:master**.\n\nasottile: :+1: Looks great, address my last couple comments and I'll merge it\ncoveralls: \n[![Coverage Status](https://coveralls.io/builds/2530626/badge)](https://coveralls.io/builds/2530626)\n\nCoverage remained the same at 100.0% when pulling **e1098d96177b1558c586b369b6d6729d8fa1c19c on Lucas-C:master** into **d97ea30c4bb309a2877fed95323ac8c793c0679f on pre-commit:master**.\n\nLucas-C: Thanks for all your comments !\r\nEverything should be fixed now :)\ncoveralls: \n[![Coverage Status](https://coveralls.io/builds/2530648/badge)](https://coveralls.io/builds/2530648)\n\nCoverage remained the same at 100.0% when pulling **f5504c1f257e8041bc977de64cfb89139d88d676 on Lucas-C:master** into **d97ea30c4bb309a2877fed95323ac8c793c0679f on pre-commit:master**.\n\nLucas-C: I guess one last to do will be to update the docs :smile:"},"patch":{"kind":"string","value":"diff --git a/pre_commit/clientlib/validate_config.py b/pre_commit/clientlib/validate_config.py\nindex 44c7cd8..bdd0e2c 100644\n--- a/pre_commit/clientlib/validate_config.py\n+++ b/pre_commit/clientlib/validate_config.py\n@@ -6,6 +6,13 @@ from pre_commit.clientlib.validate_base import is_regex_valid\n from pre_commit.errors import FatalError\n \n \n+_LOCAL_HOOKS_MAGIC_REPO_STRING = 'local'\n+\n+\n+def is_local_hooks(repo_entry):\n+ return repo_entry['repo'] == _LOCAL_HOOKS_MAGIC_REPO_STRING\n+\n+\n class InvalidConfigError(FatalError):\n pass\n \n@@ -53,7 +60,12 @@ def try_regex(repo, hook, value, field_name):\n \n def validate_config_extra(config):\n for repo in config:\n- if 'sha' not in repo:\n+ if is_local_hooks(repo):\n+ if 'sha' in repo:\n+ raise InvalidConfigError(\n+ '\"sha\" property provided for local hooks'\n+ )\n+ elif 'sha' not in repo:\n raise InvalidConfigError(\n 'Missing \"sha\" field for repository {0}'.format(repo['repo'])\n )\ndiff --git a/pre_commit/commands/run.py b/pre_commit/commands/run.py\nindex 4e3fb18..5e8745b 100644\n--- a/pre_commit/commands/run.py\n+++ b/pre_commit/commands/run.py\n@@ -18,15 +18,6 @@ from pre_commit.util import noop_context\n logger = logging.getLogger('pre_commit')\n \n \n-class HookExecutor(object):\n- def __init__(self, hook, invoker):\n- self.hook = hook\n- self._invoker = invoker\n-\n- def invoke(self, filenames):\n- return self._invoker(self.hook, filenames)\n-\n-\n def _get_skips(environ):\n skips = environ.get('SKIP', '')\n return set(skip.strip() for skip in skips.split(',') if skip.strip())\n@@ -80,8 +71,7 @@ def get_filenames(args, include_expr, exclude_expr):\n return getter(include_expr, exclude_expr)\n \n \n-def _run_single_hook(hook_executor, args, write, skips=frozenset()):\n- hook = hook_executor.hook\n+def _run_single_hook(hook, repo, args, write, skips=frozenset()):\n filenames = get_filenames(args, hook['files'], hook['exclude'])\n if hook['id'] in skips:\n _print_user_skipped(hook, write, args)\n@@ -95,7 +85,7 @@ def _run_single_hook(hook_executor, args, write, skips=frozenset()):\n write(get_hook_message(_hook_msg_start(hook, args.verbose), end_len=6))\n sys.stdout.flush()\n \n- retcode, stdout, stderr = hook_executor.invoke(filenames)\n+ retcode, stdout, stderr = repo.run_hook(hook, filenames)\n \n if retcode != hook['expected_return_value']:\n retcode = 1\n@@ -119,19 +109,19 @@ def _run_single_hook(hook_executor, args, write, skips=frozenset()):\n return retcode\n \n \n-def _run_hooks(hook_executors, args, write, environ):\n+def _run_hooks(repo_hooks, args, write, environ):\n \"\"\"Actually run the hooks.\"\"\"\n skips = _get_skips(environ)\n retval = 0\n- for hook_executor in hook_executors:\n- retval |= _run_single_hook(hook_executor, args, write, skips)\n+ for repo, hook in repo_hooks:\n+ retval |= _run_single_hook(hook, repo, args, write, skips)\n return retval\n \n \n-def get_hook_executors(runner):\n+def get_repo_hooks(runner):\n for repo in runner.repositories:\n- for _, repo_hook in repo.hooks:\n- yield HookExecutor(repo_hook, repo.run_hook)\n+ for _, hook in repo.hooks:\n+ yield (repo, hook)\n \n \n def _has_unmerged_paths(runner):\n@@ -159,13 +149,13 @@ def run(runner, args, write=sys_stdout_write_wrapper, environ=os.environ):\n ctx = staged_files_only(runner.cmd_runner)\n \n with ctx:\n- hook_executors = list(get_hook_executors(runner))\n+ repo_hooks = list(get_repo_hooks(runner))\n if args.hook:\n- hook_executors = [\n- he for he in hook_executors\n- if he.hook['id'] == args.hook\n+ repo_hooks = [\n+ (repo, hook) for repo, hook in repo_hooks\n+ if hook['id'] == args.hook\n ]\n- if not hook_executors:\n+ if not repo_hooks:\n write('No hook with id `{0}`\\n'.format(args.hook))\n return 1\n- return _run_hooks(hook_executors, args, write, environ)\n+ return _run_hooks(repo_hooks, args, write, environ)\ndiff --git a/pre_commit/repository.py b/pre_commit/repository.py\nindex cbe0535..7ca6a44 100644\n--- a/pre_commit/repository.py\n+++ b/pre_commit/repository.py\n@@ -5,6 +5,10 @@ import shutil\n \n from cached_property import cached_property\n \n+from pre_commit import git\n+from pre_commit.clientlib.validate_config import is_local_hooks\n+from pre_commit.clientlib.validate_manifest import MANIFEST_JSON_SCHEMA\n+from pre_commit.jsonschema_extensions import apply_defaults\n from pre_commit.languages.all import languages\n from pre_commit.manifest import Manifest\n from pre_commit.prefixed_command_runner import PrefixedCommandRunner\n@@ -21,10 +25,13 @@ class Repository(object):\n \n @classmethod\n def create(cls, config, store):\n- repo_path_getter = store.get_repo_path_getter(\n- config['repo'], config['sha']\n- )\n- return cls(config, repo_path_getter)\n+ if is_local_hooks(config):\n+ return LocalRepository(config)\n+ else:\n+ repo_path_getter = store.get_repo_path_getter(\n+ config['repo'], config['sha']\n+ )\n+ return cls(config, repo_path_getter)\n \n @cached_property\n def repo_url(self):\n@@ -111,3 +118,28 @@ class Repository(object):\n return languages[hook['language']].run_hook(\n self.cmd_runner, hook, file_args,\n )\n+\n+\n+class LocalRepository(Repository):\n+ def __init__(self, repo_config, repo_path_getter=None):\n+ repo_path_getter = None\n+ super(LocalRepository, self).__init__(repo_config, repo_path_getter)\n+\n+ @cached_property\n+ def hooks(self):\n+ return tuple(\n+ (hook['id'], apply_defaults(hook, MANIFEST_JSON_SCHEMA['items']))\n+ for hook in self.repo_config['hooks']\n+ )\n+\n+ @cached_property\n+ def cmd_runner(self):\n+ return PrefixedCommandRunner(git.get_root())\n+\n+ @cached_property\n+ def sha(self):\n+ raise NotImplementedError\n+\n+ @cached_property\n+ def manifest(self):\n+ raise NotImplementedError\n"},"problem_statement":{"kind":"string","value":"Add support for pcre / scripts / system hooks definition in .pre-commit-config.yaml\nEverything is in the title :)\r\n\r\n_Rationale:_ a `pre-commit` user shouldn't have to setup a git repository to configure a pre-commit check that can be defined in 5 lines or less.\r\n\r\n_Example:_ taken the from [do_not_commit](https://github.com/pricematch/pricematch-pre-commit-hooks/blob/master/hooks.yaml) hook:\r\n\r\n - id: do_not_commit\r\n name: Block if \"DO NOT COMMIT\" is found\r\n entry: DO NOT COMMIT\r\n language: pcre\r\n files: ^(.*)$\r\n \r\n_Suggested solutions:_\r\n\r\n1. Allow for pcre / scripts / system hooks definition in _.pre-commit-config.yaml_\r\n2. Allow for the `repo` field in _.pre-commit-config.yaml_ to point to a subfolder (of the git repo configured with `pre-commit`) that contains a _hooks.yaml_ .\r\nThis currently crashes because `pre-commit` expect to find git repository in the folder point by `repo`."},"repo":{"kind":"string","value":"pre-commit/pre-commit"},"test_patch":{"kind":"string","value":"diff --git a/testing/fixtures.py b/testing/fixtures.py\nindex 1b1b802..1c0184a 100644\n--- a/testing/fixtures.py\n+++ b/testing/fixtures.py\n@@ -60,12 +60,16 @@ def write_config(directory, config):\n config_file.write(ordered_dump([config], **C.YAML_DUMP_KWARGS))\n \n \n-def make_consuming_repo(tmpdir_factory, repo_source):\n- path = make_repo(tmpdir_factory, repo_source)\n- config = make_config_from_repo(path)\n- git_path = git_dir(tmpdir_factory)\n+def add_config_to_repo(git_path, config):\n write_config(git_path, config)\n with cwd(git_path):\n cmd_output('git', 'add', C.CONFIG_FILE)\n cmd_output('git', 'commit', '-m', 'Add hooks config')\n return git_path\n+\n+\n+def make_consuming_repo(tmpdir_factory, repo_source):\n+ path = make_repo(tmpdir_factory, repo_source)\n+ config = make_config_from_repo(path)\n+ git_path = git_dir(tmpdir_factory)\n+ return add_config_to_repo(git_path, config)\ndiff --git a/tests/clientlib/validate_config_test.py b/tests/clientlib/validate_config_test.py\nindex 51eb7e4..c507f28 100644\n--- a/tests/clientlib/validate_config_test.py\n+++ b/tests/clientlib/validate_config_test.py\n@@ -1,5 +1,6 @@\n from __future__ import unicode_literals\n \n+import jsonschema\n import pytest\n \n from pre_commit.clientlib.validate_config import CONFIG_JSON_SCHEMA\n@@ -25,7 +26,7 @@ def test_run(input, expected_output):\n assert run(input) == expected_output\n \n \n-@pytest.mark.parametrize(('manifest_obj', 'expected'), (\n+@pytest.mark.parametrize(('config_obj', 'expected'), (\n ([], False),\n (\n [{\n@@ -66,8 +67,8 @@ def test_run(input, expected_output):\n False,\n ),\n ))\n-def test_is_valid_according_to_schema(manifest_obj, expected):\n- ret = is_valid_according_to_schema(manifest_obj, CONFIG_JSON_SCHEMA)\n+def test_is_valid_according_to_schema(config_obj, expected):\n+ ret = is_valid_according_to_schema(config_obj, CONFIG_JSON_SCHEMA)\n assert ret is expected\n \n \n@@ -121,3 +122,55 @@ def test_config_with_ok_exclude_regex_passes():\n CONFIG_JSON_SCHEMA,\n )\n validate_config_extra(config)\n+\n+\n+@pytest.mark.parametrize('config_obj', (\n+ [{\n+ 'repo': 'local',\n+ 'sha': 'foo',\n+ 'hooks': [{\n+ 'id': 'do_not_commit',\n+ 'name': 'Block if \"DO NOT COMMIT\" is found',\n+ 'entry': 'DO NOT COMMIT',\n+ 'language': 'pcre',\n+ 'files': '^(.*)$',\n+ }],\n+ }],\n+))\n+def test_config_with_local_hooks_definition_fails(config_obj):\n+ with pytest.raises((\n+ jsonschema.exceptions.ValidationError, InvalidConfigError\n+ )):\n+ jsonschema.validate(config_obj, CONFIG_JSON_SCHEMA)\n+ config = apply_defaults(config_obj, CONFIG_JSON_SCHEMA)\n+ validate_config_extra(config)\n+\n+\n+@pytest.mark.parametrize('config_obj', (\n+ [{\n+ 'repo': 'local',\n+ 'hooks': [{\n+ 'id': 'arg-per-line',\n+ 'name': 'Args per line hook',\n+ 'entry': 'bin/hook.sh',\n+ 'language': 'script',\n+ 'files': '',\n+ 'args': ['hello', 'world'],\n+ }],\n+ }],\n+ [{\n+ 'repo': 'local',\n+ 'hooks': [{\n+ 'id': 'arg-per-line',\n+ 'name': 'Args per line hook',\n+ 'entry': 'bin/hook.sh',\n+ 'language': 'script',\n+ 'files': '',\n+ 'args': ['hello', 'world'],\n+ }]\n+ }],\n+))\n+def test_config_with_local_hooks_definition_passes(config_obj):\n+ jsonschema.validate(config_obj, CONFIG_JSON_SCHEMA)\n+ config = apply_defaults(config_obj, CONFIG_JSON_SCHEMA)\n+ validate_config_extra(config)\ndiff --git a/tests/commands/run_test.py b/tests/commands/run_test.py\nindex 9cca610..aad0611 100644\n--- a/tests/commands/run_test.py\n+++ b/tests/commands/run_test.py\n@@ -14,10 +14,12 @@ from pre_commit.commands.run import _get_skips\n from pre_commit.commands.run import _has_unmerged_paths\n from pre_commit.commands.run import get_changed_files\n from pre_commit.commands.run import run\n+from pre_commit.ordereddict import OrderedDict\n from pre_commit.runner import Runner\n from pre_commit.util import cmd_output\n from pre_commit.util import cwd\n from testing.auto_namedtuple import auto_namedtuple\n+from testing.fixtures import add_config_to_repo\n from testing.fixtures import make_consuming_repo\n \n \n@@ -81,7 +83,7 @@ def _test_run(repo, options, expected_outputs, expected_ret, stage):\n stage_a_file()\n args = _get_opts(**options)\n ret, printed = _do_run(repo, args)\n- assert ret == expected_ret\n+ assert ret == expected_ret, (ret, expected_ret, printed)\n for expected_output_part in expected_outputs:\n assert expected_output_part in printed\n \n@@ -313,9 +315,7 @@ def test_lots_of_files(mock_out_store_directory, tmpdir_factory):\n git_path = make_consuming_repo(tmpdir_factory, 'python_hooks_repo')\n with cwd(git_path):\n # Override files so we run against them\n- with io.open(\n- '.pre-commit-config.yaml', 'a+',\n- ) as config_file:\n+ with io.open('.pre-commit-config.yaml', 'a+') as config_file:\n config_file.write(' files: \"\"\\n')\n \n # Write a crap ton of files\n@@ -334,3 +334,66 @@ def test_lots_of_files(mock_out_store_directory, tmpdir_factory):\n stderr=subprocess.STDOUT,\n env=env,\n )\n+\n+\n+def test_local_hook_passes(\n+ repo_with_passing_hook, mock_out_store_directory,\n+):\n+ config = OrderedDict((\n+ ('repo', 'local'),\n+ ('hooks', (OrderedDict((\n+ ('id', 'pylint'),\n+ ('name', 'PyLint'),\n+ ('entry', 'python -m pylint.__main__'),\n+ ('language', 'system'),\n+ ('files', r'\\.py$'),\n+ )), OrderedDict((\n+ ('id', 'do_not_commit'),\n+ ('name', 'Block if \"DO NOT COMMIT\" is found'),\n+ ('entry', 'DO NOT COMMIT'),\n+ ('language', 'pcre'),\n+ ('files', '^(.*)$'),\n+ ))))\n+ ))\n+ add_config_to_repo(repo_with_passing_hook, config)\n+\n+ with io.open('dummy.py', 'w') as staged_file:\n+ staged_file.write('\"\"\"TODO: something\"\"\"\\n')\n+ cmd_output('git', 'add', 'dummy.py')\n+\n+ _test_run(\n+ repo_with_passing_hook,\n+ options={},\n+ expected_outputs=[''],\n+ expected_ret=0,\n+ stage=False\n+ )\n+\n+\n+def test_local_hook_fails(\n+ repo_with_passing_hook, mock_out_store_directory,\n+):\n+ config = OrderedDict((\n+ ('repo', 'local'),\n+ ('hooks', [OrderedDict((\n+ ('id', 'no-todo'),\n+ ('name', 'No TODO'),\n+ ('entry', 'grep -iI todo'),\n+ ('expected_return_value', 1),\n+ ('language', 'system'),\n+ ('files', ''),\n+ ))])\n+ ))\n+ add_config_to_repo(repo_with_passing_hook, config)\n+\n+ with io.open('dummy.py', 'w') as staged_file:\n+ staged_file.write('\"\"\"TODO: something\"\"\"\\n')\n+ cmd_output('git', 'add', 'dummy.py')\n+\n+ _test_run(\n+ repo_with_passing_hook,\n+ options={},\n+ expected_outputs=[''],\n+ expected_ret=1,\n+ stage=False\n+ )\ndiff --git a/tests/repository_test.py b/tests/repository_test.py\nindex cde6a76..c0bd079 100644\n--- a/tests/repository_test.py\n+++ b/tests/repository_test.py\n@@ -12,6 +12,7 @@ from pre_commit.clientlib.validate_config import CONFIG_JSON_SCHEMA\n from pre_commit.clientlib.validate_config import validate_config_extra\n from pre_commit.jsonschema_extensions import apply_defaults\n from pre_commit.languages.python import PythonEnv\n+from pre_commit.ordereddict import OrderedDict\n from pre_commit.repository import Repository\n from pre_commit.util import cmd_output\n from pre_commit.util import cwd\n@@ -377,3 +378,22 @@ def test_tags_on_repositories(in_tmpdir, tmpdir_factory, store):\n ret = repo_2.run_hook(repo_2.hooks[0][1], ['bar'])\n assert ret[0] == 0\n assert ret[1] == 'bar\\nHello World\\n'\n+\n+\n+def test_local_repository():\n+ config = OrderedDict((\n+ ('repo', 'local'),\n+ ('hooks', [OrderedDict((\n+ ('id', 'do_not_commit'),\n+ ('name', 'Block if \"DO NOT COMMIT\" is found'),\n+ ('entry', 'DO NOT COMMIT'),\n+ ('language', 'pcre'),\n+ ('files', '^(.*)$'),\n+ ))])\n+ ))\n+ local_repo = Repository.create(config, 'dummy')\n+ with pytest.raises(NotImplementedError):\n+ local_repo.sha\n+ with pytest.raises(NotImplementedError):\n+ local_repo.manifest\n+ assert len(local_repo.hooks) == 1\ndiff --git a/tests/runner_test.py b/tests/runner_test.py\nindex b1a5d5d..7399c4d 100644\n--- a/tests/runner_test.py\n+++ b/tests/runner_test.py\n@@ -5,8 +5,10 @@ import os\n import os.path\n \n import pre_commit.constants as C\n+from pre_commit.ordereddict import OrderedDict\n from pre_commit.runner import Runner\n from pre_commit.util import cwd\n+from testing.fixtures import add_config_to_repo\n from testing.fixtures import git_dir\n from testing.fixtures import make_consuming_repo\n \n@@ -52,6 +54,31 @@ def test_repositories(tmpdir_factory, mock_out_store_directory):\n assert len(runner.repositories) == 1\n \n \n+def test_local_hooks(tmpdir_factory, mock_out_store_directory):\n+ config = OrderedDict((\n+ ('repo', 'local'),\n+ ('hooks', (OrderedDict((\n+ ('id', 'arg-per-line'),\n+ ('name', 'Args per line hook'),\n+ ('entry', 'bin/hook.sh'),\n+ ('language', 'script'),\n+ ('files', ''),\n+ ('args', ['hello', 'world']),\n+ )), OrderedDict((\n+ ('id', 'do_not_commit'),\n+ ('name', 'Block if \"DO NOT COMMIT\" is found'),\n+ ('entry', 'DO NOT COMMIT'),\n+ ('language', 'pcre'),\n+ ('files', '^(.*)$'),\n+ ))))\n+ ))\n+ git_path = git_dir(tmpdir_factory)\n+ add_config_to_repo(git_path, config)\n+ runner = Runner(git_path)\n+ assert len(runner.repositories) == 1\n+ assert len(runner.repositories[0].hooks) == 2\n+\n+\n def test_pre_commit_path():\n runner = Runner(os.path.join('foo', 'bar'))\n expected_path = os.path.join('foo', 'bar', '.git', 'hooks', 'pre-commit')\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\": 1,\n \"test_score\": 0\n },\n \"num_modified_files\": 3\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 .[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-dev.txt\"\n ],\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"aspy.yaml==1.3.0\nastroid==1.3.2\nattrs==22.2.0\ncached-property==1.5.2\ncertifi==2021.5.30\ncoverage==6.2\ndistlib==0.3.9\nfilelock==3.4.1\nflake8==5.0.4\nimportlib-metadata==4.8.3\nimportlib-resources==5.4.0\niniconfig==1.1.1\njsonschema==3.2.0\nlogilab-common==1.9.7\nmccabe==0.7.0\nmock==5.2.0\nmypy-extensions==1.0.0\nnodeenv==1.6.0\nordereddict==1.1\npackaging==21.3\nplatformdirs==2.4.0\npluggy==1.0.0\n-e git+https://github.com/pre-commit/pre-commit.git@d97ea30c4bb309a2877fed95323ac8c793c0679f#egg=pre_commit\npy==1.11.0\npycodestyle==2.9.1\npyflakes==2.5.0\npylint==1.3.1\npyparsing==3.1.4\npyrsistent==0.18.0\npytest==7.0.1\nPyYAML==6.0.1\nsimplejson==3.20.1\nsix==1.17.0\ntomli==1.2.3\ntyping_extensions==4.1.1\nvirtualenv==20.17.1\nzipp==3.6.0\n"},"environment":{"kind":"string","value":"name: pre-commit\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 - argparse==1.4.0\n - aspy-yaml==1.3.0\n - astroid==1.3.2\n - attrs==22.2.0\n - cached-property==1.5.2\n - coverage==6.2\n - distlib==0.3.9\n - filelock==3.4.1\n - flake8==5.0.4\n - importlib-metadata==4.8.3\n - importlib-resources==5.4.0\n - iniconfig==1.1.1\n - jsonschema==3.2.0\n - logilab-common==1.9.7\n - mccabe==0.7.0\n - mock==5.2.0\n - mypy-extensions==1.0.0\n - nodeenv==1.6.0\n - ordereddict==1.1\n - packaging==21.3\n - platformdirs==2.4.0\n - pluggy==1.0.0\n - py==1.11.0\n - pycodestyle==2.9.1\n - pyflakes==2.5.0\n - pylint==1.3.1\n - pyparsing==3.1.4\n - pyrsistent==0.18.0\n - pytest==7.0.1\n - pyyaml==6.0.1\n - simplejson==3.20.1\n - six==1.17.0\n - tomli==1.2.3\n - typing-extensions==4.1.1\n - virtualenv==20.17.1\n - zipp==3.6.0\nprefix: /opt/conda/envs/pre-commit\n"},"FAIL_TO_PASS":{"kind":"list like","value":["tests/clientlib/validate_config_test.py::test_config_with_local_hooks_definition_fails[config_obj0]","tests/clientlib/validate_config_test.py::test_config_with_local_hooks_definition_passes[config_obj0]","tests/clientlib/validate_config_test.py::test_config_with_local_hooks_definition_passes[config_obj1]","tests/repository_test.py::test_local_repository"],"string":"[\n \"tests/clientlib/validate_config_test.py::test_config_with_local_hooks_definition_fails[config_obj0]\",\n \"tests/clientlib/validate_config_test.py::test_config_with_local_hooks_definition_passes[config_obj0]\",\n \"tests/clientlib/validate_config_test.py::test_config_with_local_hooks_definition_passes[config_obj1]\",\n \"tests/repository_test.py::test_local_repository\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":["tests/clientlib/validate_config_test.py::test_run[input0-0]","tests/clientlib/validate_config_test.py::test_run[input1-0]","tests/commands/run_test.py::test_lots_of_files","tests/repository_test.py::test_python_hook","tests/repository_test.py::test_python_hook_args_with_spaces","tests/repository_test.py::test_versioned_python_hook","tests/repository_test.py::test_run_a_node_hook","tests/repository_test.py::test_run_versioned_node_hook","tests/repository_test.py::test_run_a_ruby_hook","tests/repository_test.py::test_run_versioned_ruby_hook","tests/repository_test.py::test_system_hook_with_spaces","tests/repository_test.py::test_run_a_script_hook","tests/repository_test.py::test_run_hook_with_spaced_args","tests/repository_test.py::test_pcre_hook_no_match","tests/repository_test.py::test_pcre_hook_matching","tests/repository_test.py::test_pcre_many_files","tests/repository_test.py::test_cwd_of_hook","tests/repository_test.py::test_lots_of_files","tests/repository_test.py::test_languages","tests/repository_test.py::test_reinstall","tests/repository_test.py::test_control_c_control_c_on_install","tests/repository_test.py::test_really_long_file_paths","tests/repository_test.py::test_config_overrides_repo_specifics","tests/repository_test.py::test_tags_on_repositories","tests/runner_test.py::test_repositories","tests/runner_test.py::test_local_hooks"],"string":"[\n \"tests/clientlib/validate_config_test.py::test_run[input0-0]\",\n \"tests/clientlib/validate_config_test.py::test_run[input1-0]\",\n \"tests/commands/run_test.py::test_lots_of_files\",\n \"tests/repository_test.py::test_python_hook\",\n \"tests/repository_test.py::test_python_hook_args_with_spaces\",\n \"tests/repository_test.py::test_versioned_python_hook\",\n \"tests/repository_test.py::test_run_a_node_hook\",\n \"tests/repository_test.py::test_run_versioned_node_hook\",\n \"tests/repository_test.py::test_run_a_ruby_hook\",\n \"tests/repository_test.py::test_run_versioned_ruby_hook\",\n \"tests/repository_test.py::test_system_hook_with_spaces\",\n \"tests/repository_test.py::test_run_a_script_hook\",\n \"tests/repository_test.py::test_run_hook_with_spaced_args\",\n \"tests/repository_test.py::test_pcre_hook_no_match\",\n \"tests/repository_test.py::test_pcre_hook_matching\",\n \"tests/repository_test.py::test_pcre_many_files\",\n \"tests/repository_test.py::test_cwd_of_hook\",\n \"tests/repository_test.py::test_lots_of_files\",\n \"tests/repository_test.py::test_languages\",\n \"tests/repository_test.py::test_reinstall\",\n \"tests/repository_test.py::test_control_c_control_c_on_install\",\n \"tests/repository_test.py::test_really_long_file_paths\",\n \"tests/repository_test.py::test_config_overrides_repo_specifics\",\n \"tests/repository_test.py::test_tags_on_repositories\",\n \"tests/runner_test.py::test_repositories\",\n \"tests/runner_test.py::test_local_hooks\"\n]"},"PASS_TO_PASS":{"kind":"list like","value":["tests/clientlib/validate_config_test.py::test_run[input2-1]","tests/clientlib/validate_config_test.py::test_run[input3-1]","tests/clientlib/validate_config_test.py::test_run[input4-1]","tests/clientlib/validate_config_test.py::test_is_valid_according_to_schema[config_obj0-False]","tests/clientlib/validate_config_test.py::test_is_valid_according_to_schema[config_obj1-True]","tests/clientlib/validate_config_test.py::test_is_valid_according_to_schema[config_obj2-True]","tests/clientlib/validate_config_test.py::test_is_valid_according_to_schema[config_obj3-False]","tests/clientlib/validate_config_test.py::test_config_with_failing_regexes_fails","tests/clientlib/validate_config_test.py::test_config_with_ok_regexes_passes","tests/clientlib/validate_config_test.py::test_config_with_invalid_exclude_regex_fails","tests/clientlib/validate_config_test.py::test_config_with_ok_exclude_regex_passes","tests/commands/run_test.py::test_has_unmerged_paths[some-True]","tests/commands/run_test.py::test_has_unmerged_paths[-False]","tests/commands/run_test.py::test_get_skips[environ0-expected_output0]","tests/commands/run_test.py::test_get_skips[environ1-expected_output1]","tests/commands/run_test.py::test_get_skips[environ2-expected_output2]","tests/commands/run_test.py::test_get_skips[environ3-expected_output3]","tests/commands/run_test.py::test_get_skips[environ4-expected_output4]","tests/commands/run_test.py::test_get_skips[environ5-expected_output5]","tests/commands/run_test.py::test_get_skips[environ6-expected_output6]","tests/commands/run_test.py::test_get_changed_files","tests/repository_test.py::test_repo_url","tests/repository_test.py::test_sha","tests/runner_test.py::test_init_has_no_side_effects","tests/runner_test.py::test_create_sets_correct_directory","tests/runner_test.py::test_create_changes_to_git_root","tests/runner_test.py::test_config_file_path","tests/runner_test.py::test_pre_commit_path","tests/runner_test.py::test_pre_push_path","tests/runner_test.py::test_cmd_runner"],"string":"[\n \"tests/clientlib/validate_config_test.py::test_run[input2-1]\",\n \"tests/clientlib/validate_config_test.py::test_run[input3-1]\",\n \"tests/clientlib/validate_config_test.py::test_run[input4-1]\",\n \"tests/clientlib/validate_config_test.py::test_is_valid_according_to_schema[config_obj0-False]\",\n \"tests/clientlib/validate_config_test.py::test_is_valid_according_to_schema[config_obj1-True]\",\n \"tests/clientlib/validate_config_test.py::test_is_valid_according_to_schema[config_obj2-True]\",\n \"tests/clientlib/validate_config_test.py::test_is_valid_according_to_schema[config_obj3-False]\",\n \"tests/clientlib/validate_config_test.py::test_config_with_failing_regexes_fails\",\n \"tests/clientlib/validate_config_test.py::test_config_with_ok_regexes_passes\",\n \"tests/clientlib/validate_config_test.py::test_config_with_invalid_exclude_regex_fails\",\n \"tests/clientlib/validate_config_test.py::test_config_with_ok_exclude_regex_passes\",\n \"tests/commands/run_test.py::test_has_unmerged_paths[some-True]\",\n \"tests/commands/run_test.py::test_has_unmerged_paths[-False]\",\n \"tests/commands/run_test.py::test_get_skips[environ0-expected_output0]\",\n \"tests/commands/run_test.py::test_get_skips[environ1-expected_output1]\",\n \"tests/commands/run_test.py::test_get_skips[environ2-expected_output2]\",\n \"tests/commands/run_test.py::test_get_skips[environ3-expected_output3]\",\n \"tests/commands/run_test.py::test_get_skips[environ4-expected_output4]\",\n \"tests/commands/run_test.py::test_get_skips[environ5-expected_output5]\",\n \"tests/commands/run_test.py::test_get_skips[environ6-expected_output6]\",\n \"tests/commands/run_test.py::test_get_changed_files\",\n \"tests/repository_test.py::test_repo_url\",\n \"tests/repository_test.py::test_sha\",\n \"tests/runner_test.py::test_init_has_no_side_effects\",\n \"tests/runner_test.py::test_create_sets_correct_directory\",\n \"tests/runner_test.py::test_create_changes_to_git_root\",\n \"tests/runner_test.py::test_config_file_path\",\n \"tests/runner_test.py::test_pre_commit_path\",\n \"tests/runner_test.py::test_pre_push_path\",\n \"tests/runner_test.py::test_cmd_runner\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"MIT License"},"__index_level_0__":{"kind":"number","value":133,"string":"133"}}},{"rowIdx":134,"cells":{"instance_id":{"kind":"string","value":"mne-tools__mne-python-2080"},"base_commit":{"kind":"string","value":"f2ab0641f087c63beab715ff5fdaa9399c0807fe"},"created_at":{"kind":"string","value":"2015-05-10 19:50:29"},"environment_setup_commit":{"kind":"string","value":"edceb8f38349d6dc0cade1c9f8384cc0707ce3e8"},"hints_text":{"kind":"string","value":"Eric89GXL: Okay, this has some potentially nice (up to 2x) memory-saving changes for EDF, but I don't think we can get the same benefit for KIT (at least not easily). This unifies `preload_data` and how `preload` is handled across raw types, and allows `data_buffer` to be used for EDF and KIT as well as FIF.\r\n\r\nReady for review from my end. @teonlamont please look closely to make sure it makes sense. Tests still pass, and I've been relying on those being correct to make sure things all worked properly.\nagramfort: @teonlamont please take a close look"},"patch":{"kind":"string","value":"diff --git a/mne/io/base.py b/mne/io/base.py\nindex 9a3c83be2..578109de7 100644\n--- a/mne/io/base.py\n+++ b/mne/io/base.py\n@@ -215,22 +215,39 @@ class _BaseRaw(ProjMixin, ContainsMixin, PickDropChannelsMixin,\n \n Subclasses must provide the following methods:\n \n- * _read_segment(start, stop, sel, projector, verbose)\n+ * _read_segment(start, stop, sel, data_buffer, projector, verbose)\n (only needed for types that support on-demand disk reads)\n \"\"\"\n @verbose\n- def __init__(self, info, data=None,\n+ def __init__(self, info, preload=False,\n first_samps=(0,), last_samps=None,\n filenames=(), rawdirs=(),\n comp=None, orig_comp_grade=None,\n- orig_format='double', verbose=None):\n- # some functions (e.g., filtering) only work w/64-bit data\n- if data is not None:\n- if data.dtype not in (np.float64, np.complex128):\n+ orig_format='double',\n+ verbose=None):\n+ # wait until the end to preload data, but triage here\n+ if isinstance(preload, np.ndarray):\n+ # some functions (e.g., filtering) only work w/64-bit data\n+ if preload.dtype not in (np.float64, np.complex128):\n raise RuntimeError('datatype must be float64 or complex128, '\n- 'not %s' % data.dtype)\n+ 'not %s' % preload.dtype)\n+ self._data = preload\n+ self.preload = True\n+ self._last_samps = np.array([self._data.shape[1] - 1])\n+ load_from_disk = False\n+ else:\n+ if last_samps is None:\n+ raise ValueError('last_samps must be given unless preload is '\n+ 'an ndarray')\n+ if preload is False:\n+ self.preload = False\n+ load_from_disk = False\n+ elif preload is not True and not isinstance(preload, string_types):\n+ raise ValueError('bad preload: %s' % preload)\n+ else:\n+ load_from_disk = True\n+ self._last_samps = np.array(last_samps)\n self.info = info\n- self._data = data\n cals = np.empty(info['nchan'])\n for k in range(info['nchan']):\n cals[k] = info['chs'][k]['range'] * info['chs'][k]['cal']\n@@ -240,19 +257,70 @@ class _BaseRaw(ProjMixin, ContainsMixin, PickDropChannelsMixin,\n self.comp = comp\n self._orig_comp_grade = orig_comp_grade\n self._filenames = list(filenames)\n- self.preload = True if data is not None else False\n self._first_samps = np.array(first_samps)\n self.orig_format = orig_format\n- if data is not None:\n- self._last_samps = np.array([self._data.shape[1] - 1])\n- else:\n- self._last_samps = np.array(last_samps)\n self._projectors = list()\n self._projector = None\n+ # If we have True or a string, actually do the preloading\n+ if load_from_disk:\n+ self._preload_data(preload)\n \n- def _read_segment(start, stop, sel, projector, verbose):\n+ def _read_segment(start, stop, sel, data_buffer, projector, verbose):\n+ \"\"\"Read a chunk of raw data\n+\n+ Parameters\n+ ----------\n+ start : int, (optional)\n+ first sample to include (first is 0). If omitted, defaults to the\n+ first sample in data.\n+ stop : int, (optional)\n+ First sample to not include.\n+ If omitted, data is included to the end.\n+ sel : array, optional\n+ Indices of channels to select.\n+ data_buffer : array or str, optional\n+ numpy array to fill with data read, must have the correct shape.\n+ If str, a np.memmap with the correct data type will be used\n+ to store the data.\n+ projector : array\n+ SSP operator to apply to the data.\n+ verbose : bool, str, int, or None\n+ If not None, override default verbose level (see mne.verbose).\n+\n+ Returns\n+ -------\n+ data : array, [channels x samples]\n+ the data matrix (channels x samples).\n+ times : array, [samples]\n+ returns the time values corresponding to the samples.\n+ \"\"\"\n raise NotImplementedError\n \n+ @verbose\n+ def preload_data(self, verbose=None):\n+ \"\"\"Preload raw data\n+\n+ Parameters\n+ ----------\n+ verbose : bool, str, int, or None\n+ If not None, override default verbose level (see mne.verbose).\n+\n+ Notes\n+ -----\n+ This function will preload raw data if it was not already preloaded.\n+ If data were already preloaded, it will do nothing.\n+ \"\"\"\n+ if not self.preload:\n+ self._preload_data(True)\n+\n+ def _preload_data(self, preload):\n+ \"\"\"This function actually preloads the data\"\"\"\n+ data_buffer = preload if isinstance(preload, string_types) else None\n+ self._data = self._read_segment(data_buffer=data_buffer)[0]\n+ assert len(self._data) == self.info['nchan']\n+ self.preload = True\n+ self.close()\n+\n @property\n def first_samp(self):\n return self._first_samps[0]\n@@ -1344,7 +1412,6 @@ class _BaseRaw(ProjMixin, ContainsMixin, PickDropChannelsMixin,\n raws : list, or Raw instance\n list of Raw instances to concatenate to the current instance\n (in order), or a single raw instance to concatenate.\n-\n preload : bool, str, or None (default None)\n Preload data into memory for data manipulation and faster indexing.\n If True, the data will be preloaded into memory (fast, requires\n@@ -1414,7 +1481,8 @@ class _BaseRaw(ProjMixin, ContainsMixin, PickDropChannelsMixin,\n def close(self):\n \"\"\"Clean up the object.\n \n- Does nothing for now.\n+ Does nothing for objects that close their file descriptors.\n+ Things like RawFIF will override this method.\n \"\"\"\n pass\n \ndiff --git a/mne/io/edf/edf.py b/mne/io/edf/edf.py\nindex 5a8eb8e5f..700849294 100644\n--- a/mne/io/edf/edf.py\n+++ b/mne/io/edf/edf.py\n@@ -60,9 +60,12 @@ class RawEDF(_BaseRaw):\n -1 corresponds to the last channel.\n If None, the annotation channel is not used.\n Note: this is overruled by the annotation file if specified.\n- preload : bool\n- If True, all data are loaded at initialization.\n- If False, data are not read until save.\n+ preload : bool or str (default False)\n+ Preload data into memory for data manipulation and faster indexing.\n+ If True, the data will be preloaded into memory (fast, requires\n+ large amount of memory). If preload is a string, preload is the\n+ file name of a memory-mapped file which is used to store the data\n+ on the hard drive (slower, requires less memory).\n verbose : bool, str, int, or None\n If not None, override default verbose level (see mne.verbose).\n \n@@ -89,18 +92,9 @@ class RawEDF(_BaseRaw):\n # Raw attributes\n last_samps = [self._edf_info['nsamples'] - 1]\n super(RawEDF, self).__init__(\n- info, last_samps=last_samps, orig_format='int', verbose=verbose)\n-\n- if preload:\n- self.preload = preload\n- logger.info('Reading raw data from %s...' % input_fname)\n- self._data, _ = self._read_segment()\n- assert len(self._data) == self.info['nchan']\n- self._last_samps = np.array([self._data.shape[1] - 1])\n- logger.info(' Range : %d ... %d = %9.3f ... %9.3f secs'\n- % (self.first_samp, self.last_samp,\n- float(self.first_samp) / self.info['sfreq'],\n- float(self.last_samp) / self.info['sfreq']))\n+ info, preload, last_samps=last_samps, orig_format='int',\n+ verbose=verbose)\n+\n logger.info('Ready.')\n \n def __repr__(self):\n@@ -110,50 +104,27 @@ class RawEDF(_BaseRaw):\n \"n_channels x n_times : %s x %s\" % (n_chan, data_range))\n return \"\" % ', '.join(s)\n \n- def _read_segment(self, start=0, stop=None, sel=None, verbose=None,\n- projector=None):\n- \"\"\"Read a chunk of raw data\n-\n- Parameters\n- ----------\n- start : int, (optional)\n- first sample to include (first is 0). If omitted, defaults to the\n- first sample in data.\n- stop : int, (optional)\n- First sample to not include.\n- If omitted, data is included to the end.\n- sel : array, optional\n- Indices of channels to select.\n- projector : array\n- SSP operator to apply to the data.\n- verbose : bool, str, int, or None\n- If not None, override default verbose level (see mne.verbose).\n-\n- Returns\n- -------\n- data : array, [channels x samples]\n- the data matrix (channels x samples).\n- times : array, [samples]\n- returns the time values corresponding to the samples.\n- \"\"\"\n+ @verbose\n+ def _read_segment(self, start=0, stop=None, sel=None, data_buffer=None,\n+ projector=None, verbose=None):\n+ \"\"\"Read a chunk of raw data\"\"\"\n from scipy.interpolate import interp1d\n if sel is None:\n- sel = list(range(self.info['nchan']))\n- elif len(sel) == 1 and sel[0] == 0 and start == 0 and stop == 1:\n- return (666, 666)\n+ sel = np.arange(self.info['nchan'])\n if projector is not None:\n raise NotImplementedError('Currently does not handle projections.')\n if stop is None:\n stop = self.last_samp + 1\n elif stop > self.last_samp + 1:\n stop = self.last_samp + 1\n+ sel = np.array(sel)\n \n # Initial checks\n start = int(start)\n stop = int(stop)\n \n n_samps = self._edf_info['n_samps']\n- max_samp = self._edf_info['max_samp']\n+ buf_len = self._edf_info['max_samp']\n sfreq = self.info['sfreq']\n n_chan = self.info['nchan']\n data_size = self._edf_info['data_size']\n@@ -165,8 +136,8 @@ class RawEDF(_BaseRaw):\n subtype = self._edf_info['subtype']\n \n # this is used to deal with indexing in the middle of a sampling period\n- blockstart = int(floor(float(start) / max_samp) * max_samp)\n- blockstop = int(ceil(float(stop) / max_samp) * max_samp)\n+ blockstart = int(floor(float(start) / buf_len) * buf_len)\n+ blockstop = int(ceil(float(stop) / buf_len) * buf_len)\n if blockstop > self.last_samp:\n blockstop = self.last_samp + 1\n \n@@ -188,100 +159,179 @@ class RawEDF(_BaseRaw):\n picks = [stim_channel, tal_channel]\n offsets[picks] = 0\n \n- with open(self.info['filename'], 'rb') as fid:\n+ # set up output array\n+ data_shape = (len(sel), stop - start)\n+ if isinstance(data_buffer, np.ndarray):\n+ if data_buffer.shape != data_shape:\n+ raise ValueError('data_buffer has incorrect shape')\n+ data = data_buffer\n+ else:\n+ data = np.empty(data_shape, dtype=float)\n+\n+ read_size = blockstop - blockstart\n+ this_data = np.empty((len(sel), buf_len))\n+ \"\"\"\n+ Consider this example:\n+\n+ tmin, tmax = (2, 27)\n+ read_size = 30\n+ buf_len = 10\n+ sfreq = 1.\n+\n+ +---------+---------+---------+\n+ File structure: | buf0 | buf1 | buf2 |\n+ +---------+---------+---------+\n+ File time: 0 10 20 30\n+ +---------+---------+---------+\n+ Requested time: 2 27\n+\n+ | |\n+ blockstart blockstop\n+ | |\n+ start stop\n+\n+ We need 27 - 2 = 25 samples (per channel) to store our data, and\n+ we need to read from 3 buffers (30 samples) to get all of our data.\n+\n+ On all reads but the first, the data we read starts at\n+ the first sample of the buffer. On all reads but the last,\n+ the data we read ends on the last sample of the buffer.\n+\n+ We call this_data the variable that stores the current buffer's data,\n+ and data the variable that stores the total output.\n+\n+ On the first read, we need to do this::\n+\n+ >>> data[0:buf_len-2] = this_data[2:buf_len]\n+\n+ On the second read, we need to do::\n+\n+ >>> data[1*buf_len-2:2*buf_len-2] = this_data[0:buf_len]\n+\n+ On the final read, we need to do::\n+\n+ >>> data[2*buf_len-2:3*buf_len-2-3] = this_data[0:buf_len-3]\n+\n+ \"\"\"\n+ with open(self.info['filename'], 'rb', buffering=0) as fid:\n # extract data\n- fid.seek(data_offset)\n- buffer_size = blockstop - blockstart\n- pointer = blockstart * n_chan * data_size\n- fid.seek(data_offset + pointer)\n- datas = np.empty((n_chan, buffer_size), dtype=float)\n- blocks = int(ceil(float(buffer_size) / max_samp))\n- for i in range(blocks):\n- data = np.empty((n_chan, max_samp), dtype=np.int32)\n+ fid.seek(data_offset + blockstart * n_chan * data_size)\n+ n_blk = int(ceil(float(read_size) / buf_len))\n+ start_offset = start - blockstart\n+ end_offset = blockstop - stop\n+ for bi in range(n_blk):\n+ # Triage start (sidx) and end (eidx) indices for\n+ # data (d) and read (r)\n+ if bi == 0:\n+ d_sidx = 0\n+ r_sidx = start_offset\n+ else:\n+ d_sidx = bi * buf_len - start_offset\n+ r_sidx = 0\n+ if bi == n_blk - 1:\n+ d_eidx = data_shape[1]\n+ r_eidx = buf_len - end_offset\n+ else:\n+ d_eidx = (bi + 1) * buf_len - start_offset\n+ r_eidx = buf_len\n+ n_buf_samp = r_eidx - r_sidx\n+ count = 0\n for j, samp in enumerate(n_samps):\n # bdf data: 24bit data\n- if subtype in ('24BIT', 'bdf'):\n- ch_data = np.fromfile(fid, dtype=np.uint8,\n- count=samp * data_size)\n- ch_data = ch_data.reshape(-1, 3).astype(np.int32)\n- ch_data = ((ch_data[:, 0]) +\n- (ch_data[:, 1] << 8) +\n- (ch_data[:, 2] << 16))\n- # 24th bit determines the sign\n- ch_data[ch_data >= (1 << 23)] -= (1 << 24)\n- # edf data: 16bit data\n+ if j not in sel:\n+ fid.seek(samp * data_size, 1)\n+ continue\n+ if samp == buf_len:\n+ # use faster version with skips built in\n+ if r_sidx > 0:\n+ fid.seek(r_sidx * data_size, 1)\n+ ch_data = _read_ch(fid, subtype, n_buf_samp, data_size)\n+ if r_eidx < buf_len:\n+ fid.seek((buf_len - r_eidx) * data_size, 1)\n else:\n- ch_data = np.fromfile(fid, dtype=' n_start else n_start + 1\n- if any(datas[stim_channel][n_start:n_stop]):\n+ if any(stim[n_start:n_stop]):\n raise NotImplementedError('EDF+ with overlapping '\n 'events not supported.')\n- datas[stim_channel][n_start:n_stop] = evid\n+ stim[n_start:n_stop] = evid\n else:\n- # Allows support for up to 16-bit trigger values\n- mask = 2 ** 16 - 1\n- stim = np.array(datas[stim_channel], int)\n- mask = mask * np.ones(stim.shape, int)\n- stim = np.bitwise_and(stim, mask)\n- datas[stim_channel] = stim\n- datastart = start - blockstart\n- datastop = stop - blockstart\n- datas = datas[sel, datastart:datastop]\n+ # Allows support for up to 16-bit trigger values (2 ** 16 - 1)\n+ stim = np.bitwise_and(data[stim_channel_idx].astype(int),\n+ 65535)\n+ data[stim_channel_idx, :] = \\\n+ stim[start - blockstart:stop - blockstart]\n \n logger.info('[done]')\n times = np.arange(start, stop, dtype=float) / self.info['sfreq']\n-\n- return datas, times\n+ return data, times\n+\n+\n+def _read_ch(fid, subtype, samp, data_size):\n+ \"\"\"Helper to read a number of samples for a single channel\"\"\"\n+ if subtype in ('24BIT', 'bdf'):\n+ ch_data = np.fromfile(fid, dtype=np.uint8,\n+ count=samp * data_size)\n+ ch_data = ch_data.reshape(-1, 3).astype(np.int32)\n+ ch_data = ((ch_data[:, 0]) +\n+ (ch_data[:, 1] << 8) +\n+ (ch_data[:, 2] << 16))\n+ # 24th bit determines the sign\n+ ch_data[ch_data >= (1 << 23)] -= (1 << 24)\n+ # edf data: 16bit data\n+ else:\n+ ch_data = np.fromfile(fid, dtype=''\n Can be submitted as list of trigger channels.\n If a list is not specified, the default triggers extracted from\n@@ -171,7 +166,7 @@ class RawKIT(_BaseRaw):\n \"\"\"\n if stim is not None:\n if isinstance(stim, str):\n- picks = pick_types(self.info, meg=False, ref_meg=False,\n+ picks = pick_types(info, meg=False, ref_meg=False,\n misc=True, exclude=[])[:8]\n if stim == '<':\n stim = picks[::-1]\n@@ -181,16 +176,16 @@ class RawKIT(_BaseRaw):\n raise ValueError(\"stim needs to be list of int, '>' or \"\n \"'<', not %r\" % str(stim))\n elif np.max(stim) >= self._kit_info['nchan']:\n- msg = (\"Tried to set stim channel %i, but sqd file only has %i\"\n- \" channels\" % (np.max(stim), self._kit_info['nchan']))\n- raise ValueError(msg)\n+ raise ValueError('Tried to set stim channel %i, but sqd file '\n+ 'only has %i channels'\n+ % (np.max(stim), self._kit_info['nchan']))\n # modify info\n- self.info['nchan'] = self._kit_info['nchan'] + 1\n+ info['nchan'] = self._kit_info['nchan'] + 1\n ch_name = 'STI 014'\n chan_info = {}\n chan_info['cal'] = KIT.CALIB_FACTOR\n- chan_info['logno'] = self.info['nchan']\n- chan_info['scanno'] = self.info['nchan']\n+ chan_info['logno'] = info['nchan']\n+ chan_info['scanno'] = info['nchan']\n chan_info['range'] = 1.0\n chan_info['unit'] = FIFF.FIFF_UNIT_NONE\n chan_info['unit_mul'] = 0\n@@ -198,50 +193,27 @@ class RawKIT(_BaseRaw):\n chan_info['coil_type'] = FIFF.FIFFV_COIL_NONE\n chan_info['loc'] = np.zeros(12)\n chan_info['kind'] = FIFF.FIFFV_STIM_CH\n- self.info['chs'].append(chan_info)\n- self.info['ch_names'].append(ch_name)\n+ info['chs'].append(chan_info)\n+ info['ch_names'].append(ch_name)\n if self.preload:\n err = \"Can't change stim channel after preloading data\"\n raise NotImplementedError(err)\n \n self._kit_info['stim'] = stim\n \n- def _read_segment(self, start=0, stop=None, sel=None, verbose=None,\n- projector=None):\n- \"\"\"Read a chunk of raw data\n-\n- Parameters\n- ----------\n- start : int, (optional)\n- first sample to include (first is 0). If omitted, defaults to the\n- first sample in data.\n- stop : int, (optional)\n- First sample to not include.\n- If omitted, data is included to the end.\n- sel : array, optional\n- Indices of channels to select.\n- projector : array\n- SSP operator to apply to the data.\n- verbose : bool, str, int, or None\n- If not None, override default verbose level (see mne.verbose).\n-\n- Returns\n- -------\n- data : array, [channels x samples]\n- the data matrix (channels x samples).\n- times : array, [samples]\n- returns the time values corresponding to the samples.\n- \"\"\"\n+ @verbose\n+ def _read_segment(self, start=0, stop=None, sel=None, data_buffer=None,\n+ projector=None, verbose=None):\n+ \"\"\"Read a chunk of raw data\"\"\"\n if sel is None:\n- sel = list(range(self.info['nchan']))\n- elif len(sel) == 1 and sel[0] == 0 and start == 0 and stop == 1:\n- return (666, 666)\n+ sel = np.arange(self.info['nchan'])\n if projector is not None:\n raise NotImplementedError('Currently does not handle projections.')\n if stop is None:\n stop = self.last_samp + 1\n elif stop > self.last_samp + 1:\n stop = self.last_samp + 1\n+ sel = np.array(sel)\n \n # Initial checks\n start = int(start)\n@@ -294,6 +266,14 @@ class RawKIT(_BaseRaw):\n data = np.vstack((data, stim_ch))\n data = data[sel]\n \n+ # This maybe should be refactored to actually save memory...\n+ data_shape = data.shape\n+ if isinstance(data_buffer, np.ndarray):\n+ if data_buffer.shape != data_shape:\n+ raise ValueError('data_buffer has incorrect shape')\n+ data_buffer[...] = data\n+ data = data_buffer\n+\n logger.info('[done]')\n times = np.arange(start, stop, dtype=float) / self.info['sfreq']\n \n@@ -413,9 +393,8 @@ class EpochsKIT(EpochsArray):\n \n for key, val in event_id.items():\n if val not in events[:, 2]:\n- msg = ('No matching events found for %s '\n- '(event id %i)' % (key, val))\n- raise ValueError(msg)\n+ raise ValueError('No matching events found for %s '\n+ '(event id %i)' % (key, val))\n \n data = self._read_data()\n assert data.shape == (self._kit_info['n_epochs'], self.info['nchan'],\n@@ -520,8 +499,8 @@ def _set_dig_kit(mrk, elp, hsp, auto_decimate=True):\n msg = (\"The selected head shape contained {n_in} points, which is \"\n \"more than recommended ({n_rec}), and was automatically \"\n \"downsampled to {n_new} points. The preferred way to \"\n- \"downsample is using FastScan.\")\n- msg = msg.format(n_in=n_pts, n_rec=KIT.DIG_POINTS, n_new=n_new)\n+ \"downsample is using FastScan.\"\n+ ).format(n_in=n_pts, n_rec=KIT.DIG_POINTS, n_new=n_new)\n logger.warning(msg)\n \n if isinstance(elp, string_types):\n"},"problem_statement":{"kind":"string","value":"preload_data is only for RawFIF\nI was just working with a RawEDF and I went to call `raw.preload_data`, but I noticed that this method didn't exist for this Raw class. It's currently only implemented for RawFIF. I also saw that there is a new (to me at least) parameter in `_read_segment` called `data_buffer` that is being used whereas the other modules don't have this. should we use this method's use?"},"repo":{"kind":"string","value":"mne-tools/mne-python"},"test_patch":{"kind":"string","value":"diff --git a/mne/io/brainvision/tests/test_brainvision.py b/mne/io/brainvision/tests/test_brainvision.py\nindex 5131d978a..13762077d 100644\n--- a/mne/io/brainvision/tests/test_brainvision.py\n+++ b/mne/io/brainvision/tests/test_brainvision.py\n@@ -47,6 +47,7 @@ def test_brainvision_data():\n assert_raises(TypeError, read_raw_brainvision, vhdr_path, montage,\n preload=True, scale=\"0\")\n raw_py = read_raw_brainvision(vhdr_path, montage, eog=eog, preload=True)\n+ raw_py.preload_data() # currently does nothing\n \n assert_equal(raw_py.info['highpass'], 0.)\n assert_equal(raw_py.info['lowpass'], 250.)\ndiff --git a/mne/io/bti/tests/test_bti.py b/mne/io/bti/tests/test_bti.py\nindex 914233034..f6dc30465 100644\n--- a/mne/io/bti/tests/test_bti.py\n+++ b/mne/io/bti/tests/test_bti.py\n@@ -53,6 +53,7 @@ def test_read_pdf():\n def test_crop():\n \"\"\" Test crop raw \"\"\"\n raw = read_raw_bti(pdf_fnames[0], config_fnames[0], hs_fnames[0])\n+ raw.preload_data() # currently does nothing\n y, t = raw[:]\n t0, t1 = 0.25 * t[-1], 0.75 * t[-1]\n mask = (t0 <= t) * (t <= t1)\ndiff --git a/mne/io/edf/tests/test_edf.py b/mne/io/edf/tests/test_edf.py\nindex 326a8ea51..f2959c3e2 100644\n--- a/mne/io/edf/tests/test_edf.py\n+++ b/mne/io/edf/tests/test_edf.py\n@@ -47,9 +47,6 @@ def test_bdf_data():\n picks = pick_types(raw_py.info, meg=False, eeg=True, exclude='bads')\n data_py, _ = raw_py[picks]\n \n- print(raw_py) # to test repr\n- print(raw_py.info) # to test Info repr\n-\n # this .mat was generated using the EEG Lab Biosemi Reader\n raw_eeglab = io.loadmat(bdf_eeglab_path)\n raw_eeglab = raw_eeglab['data'] * 1e-6 # data are stored in microvolts\n@@ -118,13 +115,20 @@ def test_read_segment():\n assert_allclose(data1, data11, rtol=1e-6)\n assert_array_almost_equal(times1, times11)\n assert_equal(sorted(raw1.info.keys()), sorted(raw11.info.keys()))\n-\n- raw2 = read_raw_edf(edf_path, stim_channel=None, preload=True)\n- raw2_file = op.join(tempdir, 'test2-raw.fif')\n- raw2.save(raw2_file, overwrite=True)\n- data2, times2 = raw2[:139, :]\n- assert_allclose(data1, data2, rtol=1e-6)\n- assert_array_equal(times1, times2)\n+ data2, times2 = raw1[0, 0:1]\n+ assert_array_equal(data2[0], data1[0, 0:1])\n+ assert_array_equal(times2, times1[0:1])\n+\n+ buffer_fname = op.join(tempdir, 'buffer')\n+ for preload in (buffer_fname, True, False): # false here means \"delayed\"\n+ raw2 = read_raw_edf(edf_path, stim_channel=None, preload=preload)\n+ if preload is False:\n+ raw2.preload_data()\n+ raw2_file = op.join(tempdir, 'test2-raw.fif')\n+ raw2.save(raw2_file, overwrite=True)\n+ data2, times2 = raw2[:139, :]\n+ assert_allclose(data1, data2, rtol=1e-6)\n+ assert_array_equal(times1, times2)\n \n raw1 = Raw(raw1_file, preload=True)\n raw2 = Raw(raw2_file, preload=True)\ndiff --git a/mne/io/egi/tests/test_egi.py b/mne/io/egi/tests/test_egi.py\nindex b12e59c38..4faf0535b 100644\n--- a/mne/io/egi/tests/test_egi.py\n+++ b/mne/io/egi/tests/test_egi.py\n@@ -26,7 +26,8 @@ def test_io_egi():\n tempdir = _TempDir()\n with warnings.catch_warnings(record=True) as w:\n warnings.simplefilter('always', category=RuntimeWarning)\n- read_raw_egi(egi_fname, include=None)\n+ raw = read_raw_egi(egi_fname, include=None)\n+ raw.preload_data() # currently does nothing\n assert_equal(len(w), 1)\n assert_true(w[0].category == RuntimeWarning)\n msg = 'Did not find any event code with more than one event.'\ndiff --git a/mne/io/kit/tests/test_kit.py b/mne/io/kit/tests/test_kit.py\nindex b3fe8a434..43f711f2c 100644\n--- a/mne/io/kit/tests/test_kit.py\n+++ b/mne/io/kit/tests/test_kit.py\n@@ -96,12 +96,25 @@ def test_read_segment():\n preload=True)\n raw2_file = op.join(tempdir, 'test2-raw.fif')\n raw2.save(raw2_file, buffer_size_sec=.1, overwrite=True)\n+ data1, times1 = raw1[0, 0:1]\n+\n raw1 = Raw(raw1_file, preload=True)\n raw2 = Raw(raw2_file, preload=True)\n assert_array_equal(raw1._data, raw2._data)\n+ data2, times2 = raw2[0, 0:1]\n+ assert_array_almost_equal(data1, data2)\n+ assert_array_almost_equal(times1, times2)\n raw3 = read_raw_kit(sqd_path, mrk_path, elp_path, hsp_path, stim='<',\n preload=True)\n assert_array_almost_equal(raw1._data, raw3._data)\n+ raw4 = read_raw_kit(sqd_path, mrk_path, elp_path, hsp_path, stim='<',\n+ preload=False)\n+ raw4.preload_data()\n+ buffer_fname = op.join(tempdir, 'buffer')\n+ assert_array_almost_equal(raw1._data, raw4._data)\n+ raw5 = read_raw_kit(sqd_path, mrk_path, elp_path, hsp_path, stim='<',\n+ preload=buffer_fname)\n+ assert_array_almost_equal(raw1._data, raw5._data)\n \n \n def test_ch_loc():\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\": 1,\n \"test_score\": 3\n },\n \"num_modified_files\": 4\n}"},"version":{"kind":"string","value":"0.8"},"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 \"numpy>=1.16.0\",\n \"pandas>=1.0.0\",\n \"scikit-learn\",\n \"h5py\",\n \"pysurfer\",\n \"nose\",\n \"nose-timer\",\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/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":"apptools==5.2.1\ncertifi @ file:///croot/certifi_1671487769961/work/certifi\nconfigobj==5.0.9\ncycler==0.11.0\nenvisage==7.0.3\nexceptiongroup==1.2.2\nfonttools==4.38.0\nh5py==3.8.0\nimportlib-metadata==6.7.0\nimportlib-resources==5.12.0\niniconfig==2.0.0\njoblib==1.3.2\nkiwisolver==1.4.5\nmatplotlib==3.5.3\nmayavi==4.8.1\n-e git+https://github.com/mne-tools/mne-python.git@f2ab0641f087c63beab715ff5fdaa9399c0807fe#egg=mne\nnibabel==4.0.2\nnose==1.3.7\nnose-timer==1.0.1\nnumpy==1.21.6\npackaging==24.0\npandas==1.3.5\nPillow==9.5.0\npluggy==1.2.0\npyface==8.0.0\nPygments==2.17.2\npyparsing==3.1.4\npysurfer==0.11.2\npytest==7.4.4\npython-dateutil==2.9.0.post0\npytz==2025.2\nscikit-learn==1.0.2\nscipy==1.7.3\nsix==1.17.0\nthreadpoolctl==3.1.0\ntomli==2.0.1\ntraits==6.4.3\ntraitsui==8.0.0\ntyping_extensions==4.7.1\nvtk==9.3.1\nzipp==3.15.0\n"},"environment":{"kind":"string","value":"name: mne-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 - 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 - apptools==5.2.1\n - configobj==5.0.9\n - cycler==0.11.0\n - envisage==7.0.3\n - exceptiongroup==1.2.2\n - fonttools==4.38.0\n - h5py==3.8.0\n - importlib-metadata==6.7.0\n - importlib-resources==5.12.0\n - iniconfig==2.0.0\n - joblib==1.3.2\n - kiwisolver==1.4.5\n - matplotlib==3.5.3\n - mayavi==4.8.1\n - nibabel==4.0.2\n - nose==1.3.7\n - nose-timer==1.0.1\n - numpy==1.21.6\n - packaging==24.0\n - pandas==1.3.5\n - pillow==9.5.0\n - pluggy==1.2.0\n - pyface==8.0.0\n - pygments==2.17.2\n - pyparsing==3.1.4\n - pysurfer==0.11.2\n - pytest==7.4.4\n - python-dateutil==2.9.0.post0\n - pytz==2025.2\n - scikit-learn==1.0.2\n - scipy==1.7.3\n - six==1.17.0\n - threadpoolctl==3.1.0\n - tomli==2.0.1\n - traits==6.4.3\n - traitsui==8.0.0\n - typing-extensions==4.7.1\n - vtk==9.3.1\n - zipp==3.15.0\nprefix: /opt/conda/envs/mne-python\n"},"FAIL_TO_PASS":{"kind":"list like","value":["mne/io/brainvision/tests/test_brainvision.py::test_brainvision_data","mne/io/bti/tests/test_bti.py::test_crop","mne/io/edf/tests/test_edf.py::test_read_segment","mne/io/egi/tests/test_egi.py::test_io_egi","mne/io/kit/tests/test_kit.py::test_read_segment"],"string":"[\n \"mne/io/brainvision/tests/test_brainvision.py::test_brainvision_data\",\n \"mne/io/bti/tests/test_bti.py::test_crop\",\n \"mne/io/edf/tests/test_edf.py::test_read_segment\",\n \"mne/io/egi/tests/test_egi.py::test_io_egi\",\n \"mne/io/kit/tests/test_kit.py::test_read_segment\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["mne/io/brainvision/tests/test_brainvision.py::test_brainvision_data_filters","mne/io/brainvision/tests/test_brainvision.py::test_events","mne/io/brainvision/tests/test_brainvision.py::test_read_segment","mne/io/bti/tests/test_bti.py::test_read_config","mne/io/bti/tests/test_bti.py::test_read_pdf","mne/io/bti/tests/test_bti.py::test_raw","mne/io/bti/tests/test_bti.py::test_setup_headshape","mne/io/edf/tests/test_edf.py::test_bdf_data","mne/io/edf/tests/test_edf.py::test_edf_data","mne/io/edf/tests/test_edf.py::test_append","mne/io/edf/tests/test_edf.py::test_parse_annotation","mne/io/edf/tests/test_edf.py::test_edf_annotations","mne/io/edf/tests/test_edf.py::test_write_annotations","mne/io/kit/tests/test_kit.py::test_data","mne/io/kit/tests/test_kit.py::test_epochs","mne/io/kit/tests/test_kit.py::test_ch_loc","mne/io/kit/tests/test_kit.py::test_stim_ch"],"string":"[\n \"mne/io/brainvision/tests/test_brainvision.py::test_brainvision_data_filters\",\n \"mne/io/brainvision/tests/test_brainvision.py::test_events\",\n \"mne/io/brainvision/tests/test_brainvision.py::test_read_segment\",\n \"mne/io/bti/tests/test_bti.py::test_read_config\",\n \"mne/io/bti/tests/test_bti.py::test_read_pdf\",\n \"mne/io/bti/tests/test_bti.py::test_raw\",\n \"mne/io/bti/tests/test_bti.py::test_setup_headshape\",\n \"mne/io/edf/tests/test_edf.py::test_bdf_data\",\n \"mne/io/edf/tests/test_edf.py::test_edf_data\",\n \"mne/io/edf/tests/test_edf.py::test_append\",\n \"mne/io/edf/tests/test_edf.py::test_parse_annotation\",\n \"mne/io/edf/tests/test_edf.py::test_edf_annotations\",\n \"mne/io/edf/tests/test_edf.py::test_write_annotations\",\n \"mne/io/kit/tests/test_kit.py::test_data\",\n \"mne/io/kit/tests/test_kit.py::test_epochs\",\n \"mne/io/kit/tests/test_kit.py::test_ch_loc\",\n \"mne/io/kit/tests/test_kit.py::test_stim_ch\"\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":134,"string":"134"}}},{"rowIdx":135,"cells":{"instance_id":{"kind":"string","value":"typesafehub__conductr-cli-57"},"base_commit":{"kind":"string","value":"357be15356b14f09069cf542e8a4765edd6a0d0a"},"created_at":{"kind":"string","value":"2015-05-13 17:22:23"},"environment_setup_commit":{"kind":"string","value":"357be15356b14f09069cf542e8a4765edd6a0d0a"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/conductr_cli/conduct_load.py b/conductr_cli/conduct_load.py\nindex 38bc3d8..982965d 100644\n--- a/conductr_cli/conduct_load.py\n+++ b/conductr_cli/conduct_load.py\n@@ -19,11 +19,14 @@ def load(args):\n \"\"\"`conduct load` command\"\"\"\n \n print('Retrieving bundle...')\n- bundle_file, bundle_headers = urlretrieve(get_url(args.bundle))\n+ bundle_name, bundle_url = get_url(args.bundle)\n+ bundle_file, bundle_headers = urlretrieve(bundle_url)\n+\n+ configuration_file, configuration_headers, configuration_name = (None, None, None)\n if args.configuration is not None:\n print('Retrieving configuration...')\n- configuration_file, configuration_headers = urlretrieve(get_url(args.configuration)) \\\n- if args.configuration is not None else (None, None)\n+ configuration_name, configuration_url = get_url(args.configuration)\n+ configuration_file, configuration_headers = urlretrieve(configuration_url)\n \n bundle_conf = ConfigFactory.parse_string(bundle_utils.conf(bundle_file))\n overlay_bundle_conf = None if configuration_file is None else \\\n@@ -39,10 +42,10 @@ def load(args):\n ('roles', ' '.join(with_bundle_configurations(ConfigTree.get_list, 'roles'))),\n ('bundleName', with_bundle_configurations(ConfigTree.get_string, 'name')),\n ('system', with_bundle_configurations(ConfigTree.get_string, 'system')),\n- ('bundle', open(bundle_file, 'rb'))\n+ ('bundle', (bundle_name, open(bundle_file, 'rb')))\n ]\n if configuration_file is not None:\n- files.append(('configuration', open(configuration_file, 'rb')))\n+ files.append(('configuration', (configuration_name, open(configuration_file, 'rb'))))\n \n print('Loading bundle to ConductR...')\n response = requests.post(url, files=files)\n@@ -74,4 +77,5 @@ def get_url(uri):\n parsed = urlparse(uri, scheme='file')\n op = Path(uri)\n np = str(op.cwd() / op if parsed.scheme == 'file' and op.root == '' else parsed.path)\n- return urlunparse(ParseResult(parsed.scheme, parsed.netloc, np, parsed.params, parsed.query, parsed.fragment))\n+ url = urlunparse(ParseResult(parsed.scheme, parsed.netloc, np, parsed.params, parsed.query, parsed.fragment))\n+ return (url.split('/')[-1], url)\n"},"problem_statement":{"kind":"string","value":"Unable to load bundle from https \nConductR RC1, CLI 0.15\r\n\r\nLoading a bundle via https hangs. The cli must be terminated.\r\n\r\n```bash\r\n> conduct load https://github.com/typesafehub/project-doc/releases/download/1.0/project-doc-1.0-SNAPSHOT-e78ed07d4a895e14595a21aef1bf616b1b0e4d886f3265bc7b152acf93d259b5.zip\r\nRetrieving bundle...\r\nRetrieving configuration...\r\nLoading bundle to ConductR...\r\n```\r\nIf I wget the bundle to the local file system, the bundle loads successfully."},"repo":{"kind":"string","value":"typesafehub/conductr-cli"},"test_patch":{"kind":"string","value":"diff --git a/conductr_cli/test/test_conduct_load.py b/conductr_cli/test/test_conduct_load.py\nindex b5503cb..93ee6f7 100644\n--- a/conductr_cli/test/test_conduct_load.py\n+++ b/conductr_cli/test/test_conduct_load.py\n@@ -2,6 +2,7 @@ from unittest import TestCase\n from conductr_cli.test.cli_test_case import CliTestCase, create_temp_bundle, create_temp_bundle_with_contents, strip_margin\n from conductr_cli import conduct_load\n from urllib.error import URLError\n+import os\n import shutil\n \n try:\n@@ -54,7 +55,7 @@ class TestConductLoadCommand(TestCase, CliTestCase):\n ('roles', ' '.join(roles)),\n ('bundleName', bundleName),\n ('system', system),\n- ('bundle', 1)\n+ ('bundle', ('bundle.zip', 1))\n ]\n \n output_template = \"\"\"|Retrieving bundle...\n@@ -177,7 +178,7 @@ class TestConductLoadCommand(TestCase, CliTestCase):\n [call(self.bundle_file, 'rb'), call(config_file, 'rb')]\n )\n \n- expected_files = self.default_files + [('configuration', 1)]\n+ expected_files = self.default_files + [('configuration', ('bundle.zip', 1))]\n expected_files[4] = ('bundleName', 'overlaid-name')\n http_method.assert_called_with(self.default_url, files=expected_files)\n \n@@ -361,3 +362,16 @@ class TestConductLoadCommand(TestCase, CliTestCase):\n strip_margin(\"\"\"|ERROR: File not found: no_such.conf\n |\"\"\"),\n self.output(stderr))\n+\n+\n+class TestGetUrl(TestCase):\n+\n+ def test_url(self):\n+ filename, url = conduct_load.get_url('https://site.com/bundle-1.0-e78ed07d4a895e14595a21aef1bf616b1b0e4d886f3265bc7b152acf93d259b5.zip')\n+ self.assertEqual('bundle-1.0-e78ed07d4a895e14595a21aef1bf616b1b0e4d886f3265bc7b152acf93d259b5.zip', filename)\n+ self.assertEqual('https://site.com/bundle-1.0-e78ed07d4a895e14595a21aef1bf616b1b0e4d886f3265bc7b152acf93d259b5.zip', url)\n+\n+ def test_file(self):\n+ filename, url = conduct_load.get_url('bundle-1.0-e78ed07d4a895e14595a21aef1bf616b1b0e4d886f3265bc7b152acf93d259b5.zip')\n+ self.assertEqual('bundle-1.0-e78ed07d4a895e14595a21aef1bf616b1b0e4d886f3265bc7b152acf93d259b5.zip', filename)\n+ self.assertEqual('file://' + os.getcwd() + '/bundle-1.0-e78ed07d4a895e14595a21aef1bf616b1b0e4d886f3265bc7b152acf93d259b5.zip', url)\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\": 1,\n \"test_score\": 3\n },\n \"num_modified_files\": 1\n}"},"version":{"kind":"string","value":"0.15"},"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 \"nose\",\n \"flake8\",\n \"pep8-naming\",\n \"git+https://github.com/zheller/flake8-quotes#aef86c4f8388e790332757e5921047ad53160a75\",\n \"pytest\"\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":"argcomplete==3.6.1\ncertifi==2025.1.31\ncharset-normalizer==3.4.1\n-e git+https://github.com/typesafehub/conductr-cli.git@357be15356b14f09069cf542e8a4765edd6a0d0a#egg=conductr_cli\nexceptiongroup @ file:///croot/exceptiongroup_1706031385326/work\nflake8==7.2.0\nflake8-quotes @ git+https://github.com/zheller/flake8-quotes@e75accbd40f0e1fa1e8f0e746b93c9766db8f106\nidna==3.10\niniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work\nmccabe==0.7.0\nnose==1.3.7\npackaging @ file:///croot/packaging_1734472117206/work\npep8-naming==0.14.1\npluggy @ file:///croot/pluggy_1733169602837/work\npycodestyle==2.13.0\npyflakes==3.3.1\npyhocon==0.2.1\npyparsing==2.0.3\npytest @ file:///croot/pytest_1738938843180/work\nrequests==2.32.3\ntomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work\nurllib3==2.3.0\n"},"environment":{"kind":"string","value":"name: conductr-cli\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 - argcomplete==3.6.1\n - certifi==2025.1.31\n - charset-normalizer==3.4.1\n - flake8==7.2.0\n - flake8-quotes==3.4.0\n - idna==3.10\n - mccabe==0.7.0\n - nose==1.3.7\n - pep8-naming==0.14.1\n - pycodestyle==2.13.0\n - pyflakes==3.3.1\n - pyhocon==0.2.1\n - pyparsing==2.0.3\n - requests==2.32.3\n - urllib3==2.3.0\nprefix: /opt/conda/envs/conductr-cli\n"},"FAIL_TO_PASS":{"kind":"list like","value":["conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_failure","conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_failure_invalid_address","conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_success","conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_success_custom_ip_port","conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_success_long_ids","conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_success_verbose","conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_success_with_configuration","conductr_cli/test/test_conduct_load.py::TestGetUrl::test_file","conductr_cli/test/test_conduct_load.py::TestGetUrl::test_url"],"string":"[\n \"conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_failure\",\n \"conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_failure_invalid_address\",\n \"conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_success\",\n \"conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_success_custom_ip_port\",\n \"conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_success_long_ids\",\n \"conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_success_verbose\",\n \"conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_success_with_configuration\",\n \"conductr_cli/test/test_conduct_load.py::TestGetUrl::test_file\",\n \"conductr_cli/test/test_conduct_load.py::TestGetUrl::test_url\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_failure_no_bundle","conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_failure_no_configuration","conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_failure_no_disk_space","conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_failure_no_memory","conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_failure_no_nr_of_cpus","conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_failure_no_roles","conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_failure_roles_not_a_list"],"string":"[\n \"conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_failure_no_bundle\",\n \"conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_failure_no_configuration\",\n \"conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_failure_no_disk_space\",\n \"conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_failure_no_memory\",\n \"conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_failure_no_nr_of_cpus\",\n \"conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_failure_no_roles\",\n \"conductr_cli/test/test_conduct_load.py::TestConductLoadCommand::test_failure_roles_not_a_list\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"Apache License 2.0"},"__index_level_0__":{"kind":"number","value":135,"string":"135"}}},{"rowIdx":136,"cells":{"instance_id":{"kind":"string","value":"zopefoundation__Acquisition-10"},"base_commit":{"kind":"string","value":"6f20ea96fff40814882da580844949ea97f6c4ba"},"created_at":{"kind":"string","value":"2015-05-13 21:46:49"},"environment_setup_commit":{"kind":"string","value":"6f20ea96fff40814882da580844949ea97f6c4ba"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/CHANGES.rst b/CHANGES.rst\nindex 3e617c3..0b44a8b 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -4,7 +4,15 @@ Changelog\n 4.2.2 (unreleased)\n ------------------\n \n-- TBD\n+- Make the pure-Python Acquirer objects cooperatively use the\n+ superclass ``__getattribute__`` method, like the C implementation.\n+ See https://github.com/zopefoundation/Acquisition/issues/7.\n+\n+- The pure-Python implicit acquisition wrapper allows wrapped objects\n+ to use ``object.__getattribute__(self, name)``. This differs from\n+ the C implementation, but is important for compatibility with the\n+ pure-Python versions of libraries like ``persistent``. See\n+ https://github.com/zopefoundation/Acquisition/issues/9.\n \n 4.2.1 (2015-04-23)\n ------------------\ndiff --git a/src/Acquisition/__init__.py b/src/Acquisition/__init__.py\nindex eae7d7c..c44bbba 100644\n--- a/src/Acquisition/__init__.py\n+++ b/src/Acquisition/__init__.py\n@@ -2,10 +2,12 @@ from __future__ import absolute_import, print_function\n \n # pylint:disable=W0212,R0911,R0912\n \n+\n import os\n import operator\n import sys\n import types\n+import weakref\n \n import ExtensionClass\n \n@@ -39,17 +41,30 @@ def _apply_filter(predicate, inst, name, result, extra, orig):\n return predicate(orig, inst, name, result, extra)\n \n if sys.version_info < (3,):\n+ import copy_reg\n+\n def _rebound_method(method, wrapper):\n \"\"\"Returns a version of the method with self bound to `wrapper`\"\"\"\n if isinstance(method, types.MethodType):\n method = types.MethodType(method.im_func, wrapper, method.im_class)\n return method\n+ exec(\"\"\"def _reraise(tp, value, tb=None):\n+ raise tp, value, tb\n+\"\"\")\n else: # pragma: no cover (python 2 is currently our reference)\n+ import copyreg as copy_reg\n+\n def _rebound_method(method, wrapper):\n \"\"\"Returns a version of the method with self bound to `wrapper`\"\"\"\n if isinstance(method, types.MethodType):\n method = types.MethodType(method.__func__, wrapper)\n return method\n+ def _reraise(tp, value, tb=None):\n+ if value is None:\n+ value = tp()\n+ if value.__traceback__ is not tb:\n+ raise value.with_traceback(tb)\n+ raise value\n \n ###\n # Wrapper object protocol, mostly ported from C directly\n@@ -283,16 +298,58 @@ def _Wrapper_findattr(wrapper, name,\n \n \n _NOT_GIVEN = object() # marker\n+_OGA = object.__getattribute__\n+\n+# Map from object types with slots to their generated, derived\n+# types (or None if no derived type is needed)\n+_wrapper_subclass_cache = weakref.WeakKeyDictionary()\n+\n+def _make_wrapper_subclass_if_needed(cls, obj, container):\n+ # If the type of an object to be wrapped has __slots__, then we\n+ # must create a wrapper subclass that has descriptors for those\n+ # same slots. In this way, its methods that use object.__getattribute__\n+ # directly will continue to work, even when given an instance of _Wrapper\n+ if getattr(cls, '_Wrapper__DERIVED', False):\n+ return None\n+ type_obj = type(obj)\n+ wrapper_subclass = _wrapper_subclass_cache.get(type_obj, _NOT_GIVEN)\n+ if wrapper_subclass is _NOT_GIVEN:\n+ slotnames = copy_reg._slotnames(type_obj)\n+ if slotnames and not isinstance(obj, _Wrapper):\n+ new_type_dict = {'_Wrapper__DERIVED': True}\n+ def _make_property(slotname):\n+ return property(lambda s: getattr(s._obj, slotname),\n+ lambda s, v: setattr(s._obj, slotname, v),\n+ lambda s: delattr(s._obj, slotname))\n+ for slotname in slotnames:\n+ new_type_dict[slotname] = _make_property(slotname)\n+ new_type = type(cls.__name__ + '_' + type_obj.__name__,\n+ (cls,),\n+ new_type_dict)\n+ else:\n+ new_type = None\n+ wrapper_subclass = _wrapper_subclass_cache[type_obj] = new_type\n \n+ return wrapper_subclass\n \n class _Wrapper(ExtensionClass.Base):\n- __slots__ = ('_obj','_container',)\n+ __slots__ = ('_obj','_container', '__dict__')\n _IS_IMPLICIT = None\n \n def __new__(cls, obj, container):\n- inst = super(_Wrapper,cls).__new__(cls)\n+ wrapper_subclass = _make_wrapper_subclass_if_needed(cls, obj, container)\n+ if wrapper_subclass:\n+ inst = wrapper_subclass(obj, container)\n+ else:\n+ inst = super(_Wrapper,cls).__new__(cls)\n inst._obj = obj\n inst._container = container\n+ if hasattr(obj, '__dict__') and not isinstance(obj, _Wrapper):\n+ # Make our __dict__ refer to the same dict\n+ # as the other object, so that if it has methods that\n+ # use `object.__getattribute__` they still work. Note that because we have\n+ # slots, we won't interfere with the contents of that dict\n+ object.__setattr__(inst, '__dict__', obj.__dict__)\n return inst\n \n def __init__(self, obj, container):\n@@ -325,11 +382,11 @@ class _Wrapper(ExtensionClass.Base):\n \n def __getattribute__(self, name):\n if name in ('_obj', '_container'):\n- return object.__getattribute__(self, name)\n- if self._obj is not None or self._container is not None:\n+ return _OGA(self, name)\n+ if _OGA(self, '_obj') is not None or _OGA(self, '_container') is not None:\n return _Wrapper_findattr(self, name, None, None, None,\n True, type(self)._IS_IMPLICIT, False, False)\n- return object.__getattribute__(self, name)\n+ return _OGA(self, name)\n \n def __of__(self, parent):\n # Based on __of__ in the C code;\n@@ -684,11 +741,15 @@ class _Acquirer(ExtensionClass.Base):\n \n def __getattribute__(self, name):\n try:\n- return ExtensionClass.Base.__getattribute__(self, name)\n+ return super(_Acquirer, self).__getattribute__(name)\n except AttributeError:\n # the doctests have very specific error message\n- # requirements\n- raise AttributeError(name)\n+ # requirements (but at least we can preserve the traceback)\n+ _, _, tb = sys.exc_info()\n+ try:\n+ _reraise(AttributeError, AttributeError(name), tb)\n+ finally:\n+ del tb\n \n def __of__(self, context):\n return type(self)._Wrapper(self, context)\n"},"problem_statement":{"kind":"string","value":"Pure-Python Wrapper objects break `object.__getattribute__` in methods of the wrapped object\nCertain \"base\" classes make direct use of `object.__getattribute__` in their method implementations. (i.e., *outside* of their own `__getattribute__` implementation). They may do this for performance reasons, or to simplify their implementation of `__getattribute__`. One prominent example is `persistent.Persistent`, but there are undoubtedly others.\r\n\r\nIf classes like this are wrapped with a pure-Python acquisition wrapper, those methods fail, because the `self` they have is not the `self` they expect (it's the wrapper), and directly calling `object.__getattribute__` bypasses the wrapper's `__getattribute__` implementation.\r\n\r\nHere's an example test that fails with pure-Python, but works under the C implementation:\r\n\r\n```python\r\n def test_object_getattribute_in_rebound_method(self):\r\n\r\n class Persistent(object):\r\n __slots__ = ('__flags')\r\n def __init__(self):\r\n self.__flags = 42\r\n\r\n def get_flags(self):\r\n return object.__getattribute__(self, '_Persistent__flags')\r\n\r\n wrapped = Persistent()\r\n wrapper = Acquisition.ImplicitAcquisitionWrapper(wrapped, None)\r\n\r\n self.assertEqual(wrapped.get_flags(), wrapper.get_flags())\r\n```\r\n\r\nIt fails like so:\r\n```\r\n File \"/Acquisition/tests.py\", line 3171, in test_object_getattribute_in_rebound_method\r\n self.assertEqual(wrapped.get_flags(), wrapper.get_flags())\r\n File \"/Acquisition/tests.py\", line 3166, in get_flags\r\n return object.__getattribute__(self, '_Persistent__flags')\r\nAttributeError: 'ImplicitAcquisitionWrapper' object has no attribute '_Persistent__flags'\r\n```\r\n\r\nI'm trying to figure out how to fix this."},"repo":{"kind":"string","value":"zopefoundation/Acquisition"},"test_patch":{"kind":"string","value":"diff --git a/src/Acquisition/tests.py b/src/Acquisition/tests.py\nindex 4bc523f..277d0fe 100644\n--- a/src/Acquisition/tests.py\n+++ b/src/Acquisition/tests.py\n@@ -3124,6 +3124,125 @@ class TestAcquire(unittest.TestCase):\n found = self.acquire(self.a.b.c, AQ_PARENT)\n self.assertTrue(found.aq_self is self.a.b.aq_self)\n \n+class TestCooperativeBase(unittest.TestCase):\n+\n+ def _make_acquirer(self, kind):\n+ from ExtensionClass import Base\n+\n+ class ExtendsBase(Base):\n+ def __getattribute__(self, name):\n+ if name == 'magic':\n+ return 42\n+ return super(ExtendsBase,self).__getattribute__(name)\n+\n+ class Acquirer(kind, ExtendsBase):\n+ pass\n+\n+ return Acquirer()\n+\n+ def _check___getattribute___is_cooperative(self, acquirer):\n+ self.assertEqual(getattr(acquirer, 'magic'), 42)\n+\n+ def test_implicit___getattribute__is_cooperative(self):\n+ self._check___getattribute___is_cooperative(self._make_acquirer(Acquisition.Implicit))\n+\n+ def test_explicit___getattribute__is_cooperative(self):\n+ self._check___getattribute___is_cooperative(self._make_acquirer(Acquisition.Explicit))\n+\n+if 'Acquisition._Acquisition' not in sys.modules:\n+ # Implicitly wrapping an object that uses object.__getattribute__\n+ # in its implementation of __getattribute__ doesn't break.\n+ # This can arise with the `persistent` library or other\n+ # \"base\" classes.\n+\n+ # The C implementation doesn't directly support this; however,\n+ # it is used heavily in the Python implementation of Persistent.\n+\n+ class TestImplicitWrappingGetattribute(unittest.TestCase):\n+\n+ def test_object_getattribute_in_rebound_method_with_slots(self):\n+\n+ class Persistent(object):\n+ __slots__ = ('__flags',)\n+ def __init__(self):\n+ self.__flags = 42\n+\n+ def get_flags(self):\n+ return object.__getattribute__(self, '_Persistent__flags')\n+\n+ wrapped = Persistent()\n+ wrapper = Acquisition.ImplicitAcquisitionWrapper(wrapped, None)\n+\n+ self.assertEqual(wrapped.get_flags(), wrapper.get_flags())\n+\n+ # Changing it is not reflected in the wrapper's dict (this is an\n+ # implementation detail)\n+ wrapper._Persistent__flags = -1\n+ self.assertEqual(wrapped.get_flags(), -1)\n+ self.assertEqual(wrapped.get_flags(), wrapper.get_flags())\n+\n+ wrapper_dict = object.__getattribute__(wrapper, '__dict__')\n+ self.assertFalse('_Persistent__flags' in wrapper_dict)\n+\n+ def test_type_with_slots_reused(self):\n+\n+ class Persistent(object):\n+ __slots__ = ('__flags',)\n+ def __init__(self):\n+ self.__flags = 42\n+\n+ def get_flags(self):\n+ return object.__getattribute__(self, '_Persistent__flags')\n+\n+ wrapped = Persistent()\n+ wrapper = Acquisition.ImplicitAcquisitionWrapper(wrapped, None)\n+ wrapper2 = Acquisition.ImplicitAcquisitionWrapper(wrapped, None)\n+\n+ self.assertTrue( type(wrapper) is type(wrapper2))\n+\n+ def test_object_getattribute_in_rebound_method_with_dict(self):\n+\n+ class Persistent(object):\n+ def __init__(self):\n+ self.__flags = 42\n+\n+ def get_flags(self):\n+ return object.__getattribute__(self, '_Persistent__flags')\n+\n+ wrapped = Persistent()\n+ wrapper = Acquisition.ImplicitAcquisitionWrapper(wrapped, None)\n+\n+ self.assertEqual(wrapped.get_flags(), wrapper.get_flags())\n+\n+ # Changing it is also reflected in both dicts (this is an\n+ # implementation detail)\n+ wrapper._Persistent__flags = -1\n+ self.assertEqual(wrapped.get_flags(), -1)\n+ self.assertEqual(wrapped.get_flags(), wrapper.get_flags())\n+\n+ wrapper_dict = object.__getattribute__(wrapper, '__dict__')\n+ self.assertTrue('_Persistent__flags' in wrapper_dict)\n+\n+\n+ def test_object_getattribute_in_rebound_method_with_slots_and_dict(self):\n+\n+ class Persistent(object):\n+ __slots__ = ('__flags', '__dict__')\n+ def __init__(self):\n+ self.__flags = 42\n+ self.__oid = 'oid'\n+\n+ def get_flags(self):\n+ return object.__getattribute__(self, '_Persistent__flags')\n+\n+ def get_oid(self):\n+ return object.__getattribute__(self, '_Persistent__oid')\n+\n+ wrapped = Persistent()\n+ wrapper = Acquisition.ImplicitAcquisitionWrapper(wrapped, None)\n+\n+ self.assertEqual(wrapped.get_flags(), wrapper.get_flags())\n+ self.assertEqual(wrapped.get_oid(), wrapper.get_oid())\n \n class TestUnicode(unittest.TestCase):\n \n@@ -3537,6 +3656,7 @@ def test_suite():\n unittest.makeSuite(TestAcquire),\n unittest.makeSuite(TestUnicode),\n unittest.makeSuite(TestProxying),\n+ unittest.makeSuite(TestCooperativeBase),\n ]\n \n # This file is only available in a source checkout, skip it\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\": 1,\n \"test_score\": 2\n },\n \"num_modified_files\": 2\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\": \"requirements.txt\",\n \"pip_packages\": [\n \"nose\",\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/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":"-e git+https://github.com/zopefoundation/Acquisition.git@6f20ea96fff40814882da580844949ea97f6c4ba#egg=Acquisition\ncertifi @ file:///croot/certifi_1671487769961/work/certifi\nexceptiongroup==1.2.2\nExtensionClass==5.1\nimportlib-metadata==6.7.0\niniconfig==2.0.0\nnose==1.3.7\npackaging==24.0\npluggy==1.2.0\npytest==7.4.4\ntomli==2.0.1\ntyping_extensions==4.7.1\nzipp==3.15.0\nzope.interface==6.4.post2\n"},"environment":{"kind":"string","value":"name: Acquisition\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 - exceptiongroup==1.2.2\n - extensionclass==5.1\n - importlib-metadata==6.7.0\n - iniconfig==2.0.0\n - nose==1.3.7\n - packaging==24.0\n - pluggy==1.2.0\n - pytest==7.4.4\n - tomli==2.0.1\n - typing-extensions==4.7.1\n - zipp==3.15.0\n - zope-interface==6.4.post2\nprefix: /opt/conda/envs/Acquisition\n"},"FAIL_TO_PASS":{"kind":"list like","value":["src/Acquisition/tests.py::TestCooperativeBase::test_explicit___getattribute__is_cooperative","src/Acquisition/tests.py::TestCooperativeBase::test_implicit___getattribute__is_cooperative","src/Acquisition/tests.py::TestImplicitWrappingGetattribute::test_object_getattribute_in_rebound_method_with_dict","src/Acquisition/tests.py::TestImplicitWrappingGetattribute::test_object_getattribute_in_rebound_method_with_slots","src/Acquisition/tests.py::TestImplicitWrappingGetattribute::test_object_getattribute_in_rebound_method_with_slots_and_dict"],"string":"[\n \"src/Acquisition/tests.py::TestCooperativeBase::test_explicit___getattribute__is_cooperative\",\n \"src/Acquisition/tests.py::TestCooperativeBase::test_implicit___getattribute__is_cooperative\",\n \"src/Acquisition/tests.py::TestImplicitWrappingGetattribute::test_object_getattribute_in_rebound_method_with_dict\",\n \"src/Acquisition/tests.py::TestImplicitWrappingGetattribute::test_object_getattribute_in_rebound_method_with_slots\",\n \"src/Acquisition/tests.py::TestImplicitWrappingGetattribute::test_object_getattribute_in_rebound_method_with_slots_and_dict\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":["src/Acquisition/tests.py::test_suite"],"string":"[\n \"src/Acquisition/tests.py::test_suite\"\n]"},"PASS_TO_PASS":{"kind":"list like","value":["src/Acquisition/tests.py::test_unwrapped","src/Acquisition/tests.py::test_simple","src/Acquisition/tests.py::test__of__exception","src/Acquisition/tests.py::test_muliple","src/Acquisition/tests.py::test_pinball","src/Acquisition/tests.py::test_explicit","src/Acquisition/tests.py::test_mixed_explicit_and_explicit","src/Acquisition/tests.py::test_aq_inContextOf","src/Acquisition/tests.py::test_AqAlg","src/Acquisition/tests.py::test_explicit_acquisition","src/Acquisition/tests.py::test_creating_wrappers_directly","src/Acquisition/tests.py::test_cant_pickle_acquisition_wrappers_classic","src/Acquisition/tests.py::test_cant_pickle_acquisition_wrappers_newstyle","src/Acquisition/tests.py::test_cant_persist_acquisition_wrappers_classic","src/Acquisition/tests.py::test_cant_persist_acquisition_wrappers_newstyle","src/Acquisition/tests.py::test_interfaces","src/Acquisition/tests.py::test_mixin_post_class_definition","src/Acquisition/tests.py::test_mixin_base","src/Acquisition/tests.py::test_Basic_gc","src/Acquisition/tests.py::test_Wrapper_gc","src/Acquisition/tests.py::test_container_proxying","src/Acquisition/tests.py::test___parent__no_wrappers","src/Acquisition/tests.py::test_implicit_wrapper_as___parent__","src/Acquisition/tests.py::test_explicit_wrapper_as___parent__","src/Acquisition/tests.py::test_implicit_wrapper_has_nonwrapper_as_aq_parent","src/Acquisition/tests.py::test_explicit_wrapper_has_nonwrapper_as_aq_parent","src/Acquisition/tests.py::test___parent__aq_parent_circles","src/Acquisition/tests.py::test_python_impl_cycle","src/Acquisition/tests.py::test_unwrapped_implicit_acquirer_unwraps__parent__","src/Acquisition/tests.py::test__iter__after_AttributeError","src/Acquisition/tests.py::test_special_names","src/Acquisition/tests.py::test_deleting_parent_attrs","src/Acquisition/tests.py::test__cmp__is_called_on_wrapped_object","src/Acquisition/tests.py::test_wrapped_methods_have_correct_self","src/Acquisition/tests.py::test_cannot_set_attributes_on_empty_wrappers","src/Acquisition/tests.py::test_getitem_setitem_not_implemented","src/Acquisition/tests.py::test_getitem_setitem_implemented","src/Acquisition/tests.py::test_wrapped_objects_are_unwrapped_on_set","src/Acquisition/tests.py::test_wrapper_calls_of_on_non_wrapper","src/Acquisition/tests.py::test_aq_inContextOf_odd_cases","src/Acquisition/tests.py::test_search_repeated_objects","src/Acquisition/tests.py::TestParent::test_parent_parent_circles","src/Acquisition/tests.py::TestParent::test_parent_parent_parent_circles","src/Acquisition/tests.py::TestAcquire::test_explicit_module_default","src/Acquisition/tests.py::TestAcquire::test_explicit_module_false","src/Acquisition/tests.py::TestAcquire::test_explicit_module_true","src/Acquisition/tests.py::TestAcquire::test_explicit_wrapper_default","src/Acquisition/tests.py::TestAcquire::test_explicit_wrapper_false","src/Acquisition/tests.py::TestAcquire::test_explicit_wrapper_true","src/Acquisition/tests.py::TestAcquire::test_no_wrapper_but___parent___falls_back_to_default","src/Acquisition/tests.py::TestAcquire::test_unwrapped_falls_back_to_default","src/Acquisition/tests.py::TestAcquire::test_w_unicode_attr_name","src/Acquisition/tests.py::TestAcquire::test_wrapper_falls_back_to_default","src/Acquisition/tests.py::TestImplicitWrappingGetattribute::test_type_with_slots_reused","src/Acquisition/tests.py::TestUnicode::test_explicit_aq_unicode_should_be_called","src/Acquisition/tests.py::TestUnicode::test_explicit_should_fall_back_to_str","src/Acquisition/tests.py::TestUnicode::test_implicit_aq_unicode_should_be_called","src/Acquisition/tests.py::TestUnicode::test_implicit_should_fall_back_to_str","src/Acquisition/tests.py::TestUnicode::test_str_fallback_should_be_called_with_wrapped_self","src/Acquisition/tests.py::TestUnicode::test_unicode_should_be_called_with_wrapped_self","src/Acquisition/tests.py::TestProxying::test_explicit_proxy_bool","src/Acquisition/tests.py::TestProxying::test_explicit_proxy_call","src/Acquisition/tests.py::TestProxying::test_explicit_proxy_comporison","src/Acquisition/tests.py::TestProxying::test_explicit_proxy_contains","src/Acquisition/tests.py::TestProxying::test_explicit_proxy_hash","src/Acquisition/tests.py::TestProxying::test_explicit_proxy_special_meths","src/Acquisition/tests.py::TestProxying::test_implicit_proxy_bool","src/Acquisition/tests.py::TestProxying::test_implicit_proxy_call","src/Acquisition/tests.py::TestProxying::test_implicit_proxy_comporison","src/Acquisition/tests.py::TestProxying::test_implicit_proxy_contains","src/Acquisition/tests.py::TestProxying::test_implicit_proxy_hash","src/Acquisition/tests.py::TestProxying::test_implicit_proxy_special_meths"],"string":"[\n \"src/Acquisition/tests.py::test_unwrapped\",\n \"src/Acquisition/tests.py::test_simple\",\n \"src/Acquisition/tests.py::test__of__exception\",\n \"src/Acquisition/tests.py::test_muliple\",\n \"src/Acquisition/tests.py::test_pinball\",\n \"src/Acquisition/tests.py::test_explicit\",\n \"src/Acquisition/tests.py::test_mixed_explicit_and_explicit\",\n \"src/Acquisition/tests.py::test_aq_inContextOf\",\n \"src/Acquisition/tests.py::test_AqAlg\",\n \"src/Acquisition/tests.py::test_explicit_acquisition\",\n \"src/Acquisition/tests.py::test_creating_wrappers_directly\",\n \"src/Acquisition/tests.py::test_cant_pickle_acquisition_wrappers_classic\",\n \"src/Acquisition/tests.py::test_cant_pickle_acquisition_wrappers_newstyle\",\n \"src/Acquisition/tests.py::test_cant_persist_acquisition_wrappers_classic\",\n \"src/Acquisition/tests.py::test_cant_persist_acquisition_wrappers_newstyle\",\n \"src/Acquisition/tests.py::test_interfaces\",\n \"src/Acquisition/tests.py::test_mixin_post_class_definition\",\n \"src/Acquisition/tests.py::test_mixin_base\",\n \"src/Acquisition/tests.py::test_Basic_gc\",\n \"src/Acquisition/tests.py::test_Wrapper_gc\",\n \"src/Acquisition/tests.py::test_container_proxying\",\n \"src/Acquisition/tests.py::test___parent__no_wrappers\",\n \"src/Acquisition/tests.py::test_implicit_wrapper_as___parent__\",\n \"src/Acquisition/tests.py::test_explicit_wrapper_as___parent__\",\n \"src/Acquisition/tests.py::test_implicit_wrapper_has_nonwrapper_as_aq_parent\",\n \"src/Acquisition/tests.py::test_explicit_wrapper_has_nonwrapper_as_aq_parent\",\n \"src/Acquisition/tests.py::test___parent__aq_parent_circles\",\n \"src/Acquisition/tests.py::test_python_impl_cycle\",\n \"src/Acquisition/tests.py::test_unwrapped_implicit_acquirer_unwraps__parent__\",\n \"src/Acquisition/tests.py::test__iter__after_AttributeError\",\n \"src/Acquisition/tests.py::test_special_names\",\n \"src/Acquisition/tests.py::test_deleting_parent_attrs\",\n \"src/Acquisition/tests.py::test__cmp__is_called_on_wrapped_object\",\n \"src/Acquisition/tests.py::test_wrapped_methods_have_correct_self\",\n \"src/Acquisition/tests.py::test_cannot_set_attributes_on_empty_wrappers\",\n \"src/Acquisition/tests.py::test_getitem_setitem_not_implemented\",\n \"src/Acquisition/tests.py::test_getitem_setitem_implemented\",\n \"src/Acquisition/tests.py::test_wrapped_objects_are_unwrapped_on_set\",\n \"src/Acquisition/tests.py::test_wrapper_calls_of_on_non_wrapper\",\n \"src/Acquisition/tests.py::test_aq_inContextOf_odd_cases\",\n \"src/Acquisition/tests.py::test_search_repeated_objects\",\n \"src/Acquisition/tests.py::TestParent::test_parent_parent_circles\",\n \"src/Acquisition/tests.py::TestParent::test_parent_parent_parent_circles\",\n \"src/Acquisition/tests.py::TestAcquire::test_explicit_module_default\",\n \"src/Acquisition/tests.py::TestAcquire::test_explicit_module_false\",\n \"src/Acquisition/tests.py::TestAcquire::test_explicit_module_true\",\n \"src/Acquisition/tests.py::TestAcquire::test_explicit_wrapper_default\",\n \"src/Acquisition/tests.py::TestAcquire::test_explicit_wrapper_false\",\n \"src/Acquisition/tests.py::TestAcquire::test_explicit_wrapper_true\",\n \"src/Acquisition/tests.py::TestAcquire::test_no_wrapper_but___parent___falls_back_to_default\",\n \"src/Acquisition/tests.py::TestAcquire::test_unwrapped_falls_back_to_default\",\n \"src/Acquisition/tests.py::TestAcquire::test_w_unicode_attr_name\",\n \"src/Acquisition/tests.py::TestAcquire::test_wrapper_falls_back_to_default\",\n \"src/Acquisition/tests.py::TestImplicitWrappingGetattribute::test_type_with_slots_reused\",\n \"src/Acquisition/tests.py::TestUnicode::test_explicit_aq_unicode_should_be_called\",\n \"src/Acquisition/tests.py::TestUnicode::test_explicit_should_fall_back_to_str\",\n \"src/Acquisition/tests.py::TestUnicode::test_implicit_aq_unicode_should_be_called\",\n \"src/Acquisition/tests.py::TestUnicode::test_implicit_should_fall_back_to_str\",\n \"src/Acquisition/tests.py::TestUnicode::test_str_fallback_should_be_called_with_wrapped_self\",\n \"src/Acquisition/tests.py::TestUnicode::test_unicode_should_be_called_with_wrapped_self\",\n \"src/Acquisition/tests.py::TestProxying::test_explicit_proxy_bool\",\n \"src/Acquisition/tests.py::TestProxying::test_explicit_proxy_call\",\n \"src/Acquisition/tests.py::TestProxying::test_explicit_proxy_comporison\",\n \"src/Acquisition/tests.py::TestProxying::test_explicit_proxy_contains\",\n \"src/Acquisition/tests.py::TestProxying::test_explicit_proxy_hash\",\n \"src/Acquisition/tests.py::TestProxying::test_explicit_proxy_special_meths\",\n \"src/Acquisition/tests.py::TestProxying::test_implicit_proxy_bool\",\n \"src/Acquisition/tests.py::TestProxying::test_implicit_proxy_call\",\n \"src/Acquisition/tests.py::TestProxying::test_implicit_proxy_comporison\",\n \"src/Acquisition/tests.py::TestProxying::test_implicit_proxy_contains\",\n \"src/Acquisition/tests.py::TestProxying::test_implicit_proxy_hash\",\n \"src/Acquisition/tests.py::TestProxying::test_implicit_proxy_special_meths\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"Zope Public License 2.1"},"__index_level_0__":{"kind":"number","value":136,"string":"136"}}},{"rowIdx":137,"cells":{"instance_id":{"kind":"string","value":"chimpler__pyhocon-28"},"base_commit":{"kind":"string","value":"1dfded0867d7de333d2ee9bc90ee25b2d690f819"},"created_at":{"kind":"string","value":"2015-05-14 03:44:54"},"environment_setup_commit":{"kind":"string","value":"4683937b1d195ce2f53ca78987571e41bfe273e7"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/pyhocon/config_tree.py b/pyhocon/config_tree.py\nindex 60b2d88..d045c7b 100644\n--- a/pyhocon/config_tree.py\n+++ b/pyhocon/config_tree.py\n@@ -70,6 +70,9 @@ class ConfigTree(OrderedDict):\n type=l.__class__.__name__)\n )\n else:\n+ # if there was an override keep overide value\n+ if isinstance(value, ConfigValues):\n+ value.overriden_value = self.get(key_elt, None)\n super(ConfigTree, self).__setitem__(key_elt, value)\n else:\n next_config_tree = super(ConfigTree, self).get(key_elt)\n"},"problem_statement":{"kind":"string","value":"${?foo} unsets previous value if new is undefined\npyhocon==0.3.2\r\n\r\nApparently `${?VAR_NAME}` no longer complains about undefined variables but is seems to be unsetting the key. My expectation is that `${?foo}` would leave the key referencing the last value unless it had something to replace it with.\r\n\r\n```\r\n...\r\n File \"/Users/bkuberek/Development/people-service/.venv/lib/python2.7/site-packages/pyhocon/__init__.py\", line 203, in parse\r\n ConfigParser._resolve_substitutions(config, substitutions)\r\n File \"/Users/bkuberek/Development/people-service/.venv/lib/python2.7/site-packages/pyhocon/__init__.py\", line 246, in _resolve_substitutions\r\n is_optional_resolved, resolved_value = ConfigParser._resolve_variable(config, substitution)\r\n File \"/Users/bkuberek/Development/people-service/.venv/lib/python2.7/site-packages/pyhocon/__init__.py\", line 228, in _resolve_variable\r\n col=col(substitution.loc, substitution.instring)))\r\npyhocon.exceptions.ConfigSubstitutionException: Cannot resolve variable ${database.name} (line: 20, col: 102)\r\n```\r\n\r\nHere is my configuration:\r\n```\r\n{\r\n database {\r\n host = \"localhost\"\r\n port = \"5432\"\r\n user = \"people\"\r\n name = \"peopledb\"\r\n pass = \"dev\"\r\n url = \"postgresql://\"${database.user}\":\"${database.pass}\"@\"${database.host}\":\"${database.port}\"/\"${database.name}\r\n\r\n # Override from environment variables if they exist\r\n host = ${?DB_HOST}\r\n port = ${?DB_PORT}\r\n user = ${?DB_USER}\r\n name = ${?DB_NAME}\r\n pass = ${?DB_PASS}\r\n }\r\n}\r\n```\r\n"},"repo":{"kind":"string","value":"chimpler/pyhocon"},"test_patch":{"kind":"string","value":"diff --git a/tests/test_config_parser.py b/tests/test_config_parser.py\nindex b343d35..c0dbb15 100644\n--- a/tests/test_config_parser.py\n+++ b/tests/test_config_parser.py\n@@ -797,7 +797,21 @@ class TestConfigParser(object):\n assert config['database.user'] == 'test_user'\n assert config['database.pass'] == 'test_pass'\n \n- def test_substitution_override(self):\n+ def test_substitution_flat_override(self):\n+ config = ConfigFactory.parse_string(\n+ \"\"\"\n+ database {\n+ name = peopledb\n+ pass = peoplepass\n+ name = ${?NOT_EXISTS}\n+ pass = ${?NOT_EXISTS}\n+ }\n+ \"\"\")\n+\n+ assert config['database.name'] == 'peopledb'\n+ assert config['database.pass'] == 'peoplepass'\n+\n+ def test_substitution_nested_override(self):\n config = ConfigFactory.parse_string(\n \"\"\"\n database {\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 ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\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":"exceptiongroup==1.2.2\niniconfig==2.1.0\npackaging==24.2\npluggy==1.5.0\n-e git+https://github.com/chimpler/pyhocon.git@1dfded0867d7de333d2ee9bc90ee25b2d690f819#egg=pyhocon\npyparsing==2.0.3\npytest==8.3.5\ntomli==2.2.1\n"},"environment":{"kind":"string","value":"name: pyhocon\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 - packaging==24.2\n - pluggy==1.5.0\n - pyparsing==2.0.3\n - pytest==8.3.5\n - tomli==2.2.1\nprefix: /opt/conda/envs/pyhocon\n"},"FAIL_TO_PASS":{"kind":"list like","value":["tests/test_config_parser.py::TestConfigParser::test_substitution_flat_override"],"string":"[\n \"tests/test_config_parser.py::TestConfigParser::test_substitution_flat_override\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["tests/test_config_parser.py::TestConfigParser::test_parse_simple_value","tests/test_config_parser.py::TestConfigParser::test_parse_with_enclosing_brace","tests/test_config_parser.py::TestConfigParser::test_parse_with_enclosing_square_bracket","tests/test_config_parser.py::TestConfigParser::test_quoted_key_with_dots","tests/test_config_parser.py::TestConfigParser::test_comma_to_separate_expr","tests/test_config_parser.py::TestConfigParser::test_dict_merge","tests/test_config_parser.py::TestConfigParser::test_parse_with_comments","tests/test_config_parser.py::TestConfigParser::test_missing_config","tests/test_config_parser.py::TestConfigParser::test_parse_null","tests/test_config_parser.py::TestConfigParser::test_parse_empty","tests/test_config_parser.py::TestConfigParser::test_parse_override","tests/test_config_parser.py::TestConfigParser::test_concat_dict","tests/test_config_parser.py::TestConfigParser::test_concat_string","tests/test_config_parser.py::TestConfigParser::test_concat_list","tests/test_config_parser.py::TestConfigParser::test_bad_concat","tests/test_config_parser.py::TestConfigParser::test_string_substitutions","tests/test_config_parser.py::TestConfigParser::test_int_substitutions","tests/test_config_parser.py::TestConfigParser::test_cascade_string_substitutions","tests/test_config_parser.py::TestConfigParser::test_dict_substitutions","tests/test_config_parser.py::TestConfigParser::test_list_substitutions","tests/test_config_parser.py::TestConfigParser::test_non_existent_substitution","tests/test_config_parser.py::TestConfigParser::test_non_compatible_substitution","tests/test_config_parser.py::TestConfigParser::test_concat_multi_line_string","tests/test_config_parser.py::TestConfigParser::test_concat_multi_line_list","tests/test_config_parser.py::TestConfigParser::test_concat_multi_line_dict","tests/test_config_parser.py::TestConfigParser::test_parse_URL_from_samples","tests/test_config_parser.py::TestConfigParser::test_include_dict_from_samples","tests/test_config_parser.py::TestConfigParser::test_list_of_dicts","tests/test_config_parser.py::TestConfigParser::test_list_of_lists","tests/test_config_parser.py::TestConfigParser::test_list_of_dicts_with_merge","tests/test_config_parser.py::TestConfigParser::test_list_of_lists_with_merge","tests/test_config_parser.py::TestConfigParser::test_invalid_assignment","tests/test_config_parser.py::TestConfigParser::test_invalid_dict","tests/test_config_parser.py::TestConfigParser::test_include_list","tests/test_config_parser.py::TestConfigParser::test_include_dict","tests/test_config_parser.py::TestConfigParser::test_substitution_override","tests/test_config_parser.py::TestConfigParser::test_substitution_nested_override","tests/test_config_parser.py::TestConfigParser::test_optional_substitution","tests/test_config_parser.py::TestConfigParser::test_substitution_cycle","tests/test_config_parser.py::TestConfigParser::test_assign_number_with_eol","tests/test_config_parser.py::TestConfigParser::test_assign_strings_with_eol","tests/test_config_parser.py::TestConfigParser::test_assign_list_numbers_with_eol","tests/test_config_parser.py::TestConfigParser::test_assign_list_strings_with_eol","tests/test_config_parser.py::TestConfigParser::test_assign_dict_strings_with_equal_sign_with_eol","tests/test_config_parser.py::TestConfigParser::test_assign_dict_strings_no_equal_sign_with_eol"],"string":"[\n \"tests/test_config_parser.py::TestConfigParser::test_parse_simple_value\",\n \"tests/test_config_parser.py::TestConfigParser::test_parse_with_enclosing_brace\",\n \"tests/test_config_parser.py::TestConfigParser::test_parse_with_enclosing_square_bracket\",\n \"tests/test_config_parser.py::TestConfigParser::test_quoted_key_with_dots\",\n \"tests/test_config_parser.py::TestConfigParser::test_comma_to_separate_expr\",\n \"tests/test_config_parser.py::TestConfigParser::test_dict_merge\",\n \"tests/test_config_parser.py::TestConfigParser::test_parse_with_comments\",\n \"tests/test_config_parser.py::TestConfigParser::test_missing_config\",\n \"tests/test_config_parser.py::TestConfigParser::test_parse_null\",\n \"tests/test_config_parser.py::TestConfigParser::test_parse_empty\",\n \"tests/test_config_parser.py::TestConfigParser::test_parse_override\",\n \"tests/test_config_parser.py::TestConfigParser::test_concat_dict\",\n \"tests/test_config_parser.py::TestConfigParser::test_concat_string\",\n \"tests/test_config_parser.py::TestConfigParser::test_concat_list\",\n \"tests/test_config_parser.py::TestConfigParser::test_bad_concat\",\n \"tests/test_config_parser.py::TestConfigParser::test_string_substitutions\",\n \"tests/test_config_parser.py::TestConfigParser::test_int_substitutions\",\n \"tests/test_config_parser.py::TestConfigParser::test_cascade_string_substitutions\",\n \"tests/test_config_parser.py::TestConfigParser::test_dict_substitutions\",\n \"tests/test_config_parser.py::TestConfigParser::test_list_substitutions\",\n \"tests/test_config_parser.py::TestConfigParser::test_non_existent_substitution\",\n \"tests/test_config_parser.py::TestConfigParser::test_non_compatible_substitution\",\n \"tests/test_config_parser.py::TestConfigParser::test_concat_multi_line_string\",\n \"tests/test_config_parser.py::TestConfigParser::test_concat_multi_line_list\",\n \"tests/test_config_parser.py::TestConfigParser::test_concat_multi_line_dict\",\n \"tests/test_config_parser.py::TestConfigParser::test_parse_URL_from_samples\",\n \"tests/test_config_parser.py::TestConfigParser::test_include_dict_from_samples\",\n \"tests/test_config_parser.py::TestConfigParser::test_list_of_dicts\",\n \"tests/test_config_parser.py::TestConfigParser::test_list_of_lists\",\n \"tests/test_config_parser.py::TestConfigParser::test_list_of_dicts_with_merge\",\n \"tests/test_config_parser.py::TestConfigParser::test_list_of_lists_with_merge\",\n \"tests/test_config_parser.py::TestConfigParser::test_invalid_assignment\",\n \"tests/test_config_parser.py::TestConfigParser::test_invalid_dict\",\n \"tests/test_config_parser.py::TestConfigParser::test_include_list\",\n \"tests/test_config_parser.py::TestConfigParser::test_include_dict\",\n \"tests/test_config_parser.py::TestConfigParser::test_substitution_override\",\n \"tests/test_config_parser.py::TestConfigParser::test_substitution_nested_override\",\n \"tests/test_config_parser.py::TestConfigParser::test_optional_substitution\",\n \"tests/test_config_parser.py::TestConfigParser::test_substitution_cycle\",\n \"tests/test_config_parser.py::TestConfigParser::test_assign_number_with_eol\",\n \"tests/test_config_parser.py::TestConfigParser::test_assign_strings_with_eol\",\n \"tests/test_config_parser.py::TestConfigParser::test_assign_list_numbers_with_eol\",\n \"tests/test_config_parser.py::TestConfigParser::test_assign_list_strings_with_eol\",\n \"tests/test_config_parser.py::TestConfigParser::test_assign_dict_strings_with_equal_sign_with_eol\",\n \"tests/test_config_parser.py::TestConfigParser::test_assign_dict_strings_no_equal_sign_with_eol\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"Apache License 2.0"},"__index_level_0__":{"kind":"number","value":137,"string":"137"}}},{"rowIdx":138,"cells":{"instance_id":{"kind":"string","value":"mkdocs__mkdocs-528"},"base_commit":{"kind":"string","value":"93a181a208af0440f44e7f51081b9df9d9f30568"},"created_at":{"kind":"string","value":"2015-05-15 04:38:15"},"environment_setup_commit":{"kind":"string","value":"463c5b647e9ce5992b519708a0b9c4cba891d65c"},"hints_text":{"kind":"string","value":"landscape-bot: [![Code Health](https://landscape.io/badge/165865/landscape.svg?style=flat)](https://landscape.io/diff/153156)\nCode quality remained the same when pulling **[d3fa1bd](https://github.com/waylan/mkdocs/commit/d3fa1bd74f3d126c31e03d9330922b265354fa15) on waylan:519** into **[667fc66](https://github.com/mkdocs/mkdocs/commit/667fc663a2d9f6b3c7fb5c26777161a4ad42368f) on mkdocs:master**.\nd0ugal: This looks great! I should be able to review it today.\nlandscape-bot: [![Code Health](https://landscape.io/badge/166893/landscape.svg?style=flat)](https://landscape.io/diff/154259)\nCode quality remained the same when pulling **[06a74af](https://github.com/waylan/mkdocs/commit/06a74afdc8bfe120398344b021738e305ca246d3) on waylan:519** into **[93a181a](https://github.com/mkdocs/mkdocs/commit/93a181a208af0440f44e7f51081b9df9d9f30568) on mkdocs:master**.\nd0ugal: This is lovely, do you plan to do any more updates? I'm happy to merge as it is. Tested it and it works great.\nwaylan: The only other thing I would consider doing at this point is removing the OrderedDict stuff for the config as this removes the need for it. I don't think it would hurt to leave it in, but removing it removes one more thing to maintain long-term. @facelessuser have any thoughts?\r\n\r\nRegardless, that could happen latter. Feel free to merge any time.\nfacelessuser: Remove it, unless ordered dicts will be desired somewhere in the future. It hurts nothing, but I only added it because, at the time, it was decided not to do the extension config this way. But now we are, so the original need is gone."},"patch":{"kind":"string","value":"diff --git a/docs/user-guide/configuration.md b/docs/user-guide/configuration.md\nindex 924e6207..4b9c5b8d 100644\n--- a/docs/user-guide/configuration.md\n+++ b/docs/user-guide/configuration.md\n@@ -8,7 +8,7 @@ Guide to all available configuration settings.\n \n Project settings are always configured by using a YAML configuration file in the project directory named `mkdocs.yml`.\n \n-As a miniumum this configuration file must contain the `site_name` setting. All other settings are optional.\n+As a minimum this configuration file must contain the `site_name` setting. All other settings are optional.\n \n ## Project information\n \n@@ -16,7 +16,7 @@ As a miniumum this configuration file must contain the `site_name` setting. All\n \n This is a **required setting**, and should be a string that is used as the main title for the project documentation. For example:\n \n- site_name: Mashmallow Generator\n+ site_name: Marshmallow Generator\n \n When rendering the theme this setting will be passed as the `site_name` context variable.\n \n@@ -109,9 +109,9 @@ If you have a lot of project documentation you might choose to use headings to b\n pages:\n - Introduction: 'index.md'\n - User Guide:\n- - 'Creating a new Mashmallow project': 'user-guide/creating.md'\n- - 'Mashmallow API guide': 'user-guide/api.md'\n- - 'Configuring Mashmallow': 'user-guide/configuration.md'\n+ - 'Creating a new Marshmallow project': 'user-guide/creating.md'\n+ - 'Marshmallow API guide': 'user-guide/api.md'\n+ - 'Configuring Marshmallow': 'user-guide/configuration.md'\n - About:\n - License: 'about/license.md'\n \n@@ -150,16 +150,21 @@ Lets you set the directory where the output HTML and other files are created. T\n \n **default**: `'site'`\n \n-**Note**: If you are using source code control you will normally want to ensure that your *build output* files are not commited into the repository, and only keep the *source* files under version control. For example, if using `git` you might add the following line to your `.gitignore` file:\n+!!! note \"Note:\"\n+ If you are using source code control you will normally want to ensure\n+ that your *build output* files are not committed into the repository, and only\n+ keep the *source* files under version control. For example, if using `git` you\n+ might add the following line to your `.gitignore` file:\n \n- site/\n+ site/\n \n-If you're using another source code control you'll want to check its documentation on how to ignore specific directories.\n+ If you're using another source code control you'll want to check its\n+ documentation on how to ignore specific directories.\n \n \n ### extra_css\n \n-Set a list of css files to be included by the theme.\n+Set a list of CSS files to be included by the theme.\n \n **default**: By default `extra_css` will contain a list of all the CSS files found within the `docs_dir`, if none are found it will be `[]` (an empty list).\n \n@@ -207,7 +212,7 @@ Determines if a broken link to a page within the documentation is considered a w\n \n Determines the address used when running `mkdocs serve`. Setting this allows you to use another port, or allows you to make the service accessible over your local network by using the `0.0.0.0` address.\n \n-As with all settings, you can set this from the command line, which can be usful, for example:\n+As with all settings, you can set this from the command line, which can be useful, for example:\n \n mkdocs serve --dev-addr=0.0.0.0:80 # Run on port 80, accessible over the local network.\n \n@@ -217,30 +222,62 @@ As with all settings, you can set this from the command line, which can be usful\n \n ### markdown_extensions\n \n-MkDocs uses the [Python Markdown][pymkd] library to translate Markdown files into HTML. Python Markdown supports a variety of [extensions][pymdk-extensions] that customize how pages are formatted. This setting lets you enable a list of extensions beyond the ones that MkDocs uses by default (`meta`, `toc`, `tables`, and `fenced_code`).\n+MkDocs uses the [Python Markdown][pymkd] library to translate Markdown files\n+into HTML. Python Markdown supports a variety of [extensions][pymdk-extensions]\n+that customize how pages are formatted. This setting lets you enable a list of\n+extensions beyond the ones that MkDocs uses by default (`meta`, `toc`, `tables`,\n+and `fenced_code`).\n \n For example, to enable the [SmartyPants typography extension][smarty], use:\n \n- markdown_extensions: [smartypants]\n+ markdown_extensions:\n+ - smarty\n \n-Some extensions provide configuration options of their own. If you would like to set any configuration options, then you can define `markdown_extensions` as a key/value mapping rather than a list. The key must be the name of the extension and the value must be a key/value pair (option name/option value) for the configuration option.\n+Some extensions provide configuration options of their own. If you would like to\n+set any configuration options, then you can nest a key/value mapping\n+(`option_name: option value`) of any options that a given extension supports.\n+See the documentation for the extension you are using to determine what options\n+they support.\n \n For example, to enable permalinks in the (included) `toc` extension, use:\n \n markdown_extensions:\n- toc:\n+ - toc:\n+ permalink: True\n+\n+Note that a colon (`:`) must follow the extension name (`toc`) and then on a new line\n+the option name and value must be indented and seperated by a colon. If you would like\n+to define multipe options for a single extension, each option must be defined on\n+a seperate line:\n+\n+ markdown_extensions:\n+ - toc:\n permalink: True\n+ separator: \"_\"\n \n-Add additonal items for each extension. If you have no configuration options to set for a specific extension, then you may leave that extensions options blank:\n+Add an additional item to the list for each extension. If you have no\n+configuration options to set for a specific extension, then simply omit options\n+for that extension:\n \n markdown_extensions:\n- smartypants:\n- toc:\n+ - smarty\n+ - toc:\n permalink: True\n+ - sane_lists\n \n+!!! note \"See Also:\"\n+ The Python-Markdown documentation provides a [list of extensions][exts]\n+ which are available out-of-the-box. For a list of configuration options\n+ available for a given extension, see the documentation for that extension.\n+ \n+ You may also install and use various [third party extensions][3rd]. Consult the\n+ documentation provided by those extensions for installation instructions and\n+ available configuration options.\n \n **default**: `[]`\n \n [pymdk-extensions]: http://pythonhosted.org/Markdown/extensions/index.html\n [pymkd]: http://pythonhosted.org/Markdown/\n-[smarty]: https://pypi.python.org/pypi/mdx_smartypants\n+[smarty]: https://pythonhosted.org/Markdown/extensions/smarty.html\n+[exts]:https://pythonhosted.org/Markdown/extensions/index.html\n+[3rd]: https://github.com/waylan/Python-Markdown/wiki/Third-Party-Extensions\n\\ No newline at end of file\ndiff --git a/mkdocs.yml b/mkdocs.yml\nindex 930ccd95..e092f9ec 100644\n--- a/mkdocs.yml\n+++ b/mkdocs.yml\n@@ -5,9 +5,9 @@ site_description: Project documentation with Markdown.\n repo_url: https://github.com/mkdocs/mkdocs/\n \n markdown_extensions:\n- toc:\n+ - toc:\n permalink: \"\"\n- admonition:\n+ - admonition:\n \n copyright: Copyright &copy; 2014, Tom Christie.\n google_analytics: ['UA-27795084-5', 'mkdocs.org']\ndiff --git a/mkdocs/build.py b/mkdocs/build.py\nindex 73d9a309..70f60e7a 100644\n--- a/mkdocs/build.py\n+++ b/mkdocs/build.py\n@@ -17,30 +17,17 @@ import mkdocs\n log = logging.getLogger(__name__)\n \n \n-def convert_markdown(markdown_source, site_navigation=None, extensions=(), strict=False):\n+def convert_markdown(markdown_source, config, site_navigation=None):\n \"\"\"\n- Convert the Markdown source file to HTML content, and additionally\n- return the parsed table of contents, and a dictionary of any metadata\n- that was specified in the Markdown file.\n-\n- `extensions` is an optional sequence of Python Markdown extensions to add\n- to the default set.\n+ Convert the Markdown source file to HTML as per the config and site_navigation.\n+ Return a tuple of the HTML as a string, the parsed table of contents,\n+ and a dictionary of any metadata that was specified in the Markdown file.\n \"\"\"\n-\n- # Generate the HTML from the markdown source\n- if isinstance(extensions, dict):\n- user_extensions = list(extensions.keys())\n- extension_configs = dict([(k, v) for k, v in extensions.items() if isinstance(v, dict)])\n- else:\n- user_extensions = list(extensions)\n- extension_configs = {}\n- builtin_extensions = ['meta', 'toc', 'tables', 'fenced_code']\n- mkdocs_extensions = [RelativePathExtension(site_navigation, strict), ]\n- extensions = utils.reduce_list(builtin_extensions + mkdocs_extensions + user_extensions)\n-\n- html_content, table_of_contents, meta = utils.convert_markdown(markdown_source, extensions, extension_configs)\n-\n- return (html_content, table_of_contents, meta)\n+ return utils.convert_markdown(\n+ markdown_source=markdown_source,\n+ extensions=[RelativePathExtension(site_navigation, config['strict'])] + config['markdown_extensions'],\n+ extension_configs=config['mdx_configs']\n+ )\n \n \n def get_global_context(nav, config):\n@@ -182,8 +169,9 @@ def _build_page(page, config, site_navigation, env, dump_json):\n \n # Process the markdown text\n html_content, table_of_contents, meta = convert_markdown(\n- input_content, site_navigation,\n- extensions=config['markdown_extensions'], strict=config['strict']\n+ markdown_source=input_content,\n+ config=config,\n+ site_navigation=site_navigation\n )\n \n context = get_global_context(site_navigation, config)\ndiff --git a/mkdocs/config/base.py b/mkdocs/config/base.py\nindex 870d00b7..53ffbad1 100644\n--- a/mkdocs/config/base.py\n+++ b/mkdocs/config/base.py\n@@ -1,9 +1,9 @@\n import six\n import logging\n import os\n+import yaml\n \n from mkdocs import exceptions\n-from mkdocs import utils\n from mkdocs.config import config_options, defaults\n \n log = logging.getLogger('mkdocs.config')\n@@ -82,7 +82,7 @@ class Config(six.moves.UserDict):\n self.data.update(patch)\n \n def load_file(self, config_file):\n- return self.load_dict(utils.yaml_load(config_file))\n+ return self.load_dict(yaml.load(config_file))\n \n \n def _open_config_file(config_file):\ndiff --git a/mkdocs/config/config_options.py b/mkdocs/config/config_options.py\nindex c6ac2910..6c47197b 100644\n--- a/mkdocs/config/config_options.py\n+++ b/mkdocs/config/config_options.py\n@@ -343,3 +343,56 @@ class NumPages(BaseConfigOption):\n config[key_name] = len(config['pages']) > self.at_lest\n except TypeError:\n config[key_name] = False\n+\n+\n+class Private(BaseConfigOption):\n+ \"\"\"\n+ Private Config Option\n+\n+ A config option only for internal use. Raises an error if set by the user.\n+ \"\"\"\n+\n+ def run_validation(self, value):\n+ raise ValidationError('For internal use only.')\n+\n+\n+class MarkdownExtensions(BaseConfigOption):\n+ \"\"\"\n+ Markdown Extensions Config Option\n+\n+ A list of extensions. If a list item contains extension configs,\n+ those are set on the private setting passed to `configkey`. The\n+ `builtins` keyword accepts a list of extensions which cannot be\n+ overriden by the user. However, builtins can be duplicated to define\n+ config options for them if desired.\n+ \"\"\"\n+ def __init__(self, builtins=None, configkey='mdx_configs', **kwargs):\n+ super(MarkdownExtensions, self).__init__(**kwargs)\n+ self.builtins = builtins or []\n+ self.configkey = configkey\n+ self.configdata = {}\n+\n+ def run_validation(self, value):\n+ if not isinstance(value, (list, tuple)):\n+ raise ValidationError('Invalid Markdown Extensions configuration')\n+ extensions = []\n+ for item in value:\n+ if isinstance(item, dict):\n+ if len(item) > 1:\n+ raise ValidationError('Invalid Markdown Extensions configuration')\n+ ext, cfg = item.popitem()\n+ extensions.append(ext)\n+ if cfg is None:\n+ continue\n+ if not isinstance(cfg, dict):\n+ raise ValidationError('Invalid config options for Markdown '\n+ \"Extension '{0}'.\".format(ext))\n+ self.configdata[ext] = cfg\n+ elif isinstance(item, six.string_types):\n+ extensions.append(item)\n+ else:\n+ raise ValidationError('Invalid Markdown Extensions configuration')\n+ return utils.reduce_list(self.builtins + extensions)\n+\n+ def post_validation(self, config, key_name):\n+ config[self.configkey] = self.configdata\ndiff --git a/mkdocs/config/defaults.py b/mkdocs/config/defaults.py\nindex 9d7bcd6d..2c2d929f 100644\n--- a/mkdocs/config/defaults.py\n+++ b/mkdocs/config/defaults.py\n@@ -90,8 +90,12 @@ DEFAULT_SCHEMA = (\n ('include_next_prev', config_options.NumPages()),\n \n # PyMarkdown extension names.\n- ('markdown_extensions', config_options.Type(\n- (list, dict, tuple), default=())),\n+ ('markdown_extensions', config_options.MarkdownExtensions(\n+ builtins=['meta', 'toc', 'tables', 'fenced_code'],\n+ configkey='mdx_configs', default=[])),\n+\n+ # PyMarkdown Extension Configs. For internal use only.\n+ ('mdx_configs', config_options.Private()),\n \n # enabling strict mode causes MkDocs to stop the build when a problem is\n # encountered rather than display an error.\ndiff --git a/mkdocs/utils.py b/mkdocs/utils.py\nindex de7c67a5..7ff7f07e 100644\n--- a/mkdocs/utils.py\n+++ b/mkdocs/utils.py\n@@ -12,30 +12,8 @@ import shutil\n \n import markdown\n import six\n-import yaml\n \n from mkdocs import toc\n-from mkdocs.legacy import OrderedDict\n-\n-\n-def yaml_load(stream, Loader=yaml.Loader, object_pairs_hook=OrderedDict):\n- \"\"\"\n- Make all YAML dictionaries load as ordered Dicts.\n- http://stackoverflow.com/a/21912744/3609487\n- \"\"\"\n- class OrderedLoader(Loader):\n- pass\n-\n- def construct_mapping(loader, node):\n- loader.flatten_mapping(node)\n- return object_pairs_hook(loader.construct_pairs(node))\n-\n- OrderedLoader.add_constructor(\n- yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG,\n- construct_mapping\n- )\n-\n- return yaml.load(stream, OrderedLoader)\n \n \n def reduce_list(data_set):\n@@ -279,12 +257,9 @@ def convert_markdown(markdown_source, extensions=None, extension_configs=None):\n `extensions` is an optional sequence of Python Markdown extensions to add\n to the default set.\n \"\"\"\n- extensions = extensions or []\n- extension_configs = extension_configs or {}\n-\n md = markdown.Markdown(\n- extensions=extensions,\n- extension_configs=extension_configs\n+ extensions=extensions or [],\n+ extension_configs=extension_configs or {}\n )\n html_content = md.convert(markdown_source)\n \n"},"problem_statement":{"kind":"string","value":"smartypants extension error\nI'm new to mkdocs and have recently installed it. I'm running on Windows and am using Python 3.4.\r\n\r\nI was walking though some of the mkdocs documentation and wanted to try to use smartypants. Initially I found out I had to install the extension itself which wasn't mentioned in the mkdocs documentation (might be helpful to add that). After installing the extension with pip I tried to use it using all 3 of the below configuration formats..\r\n\r\n```\r\nmarkdown_extensions: [smartypants]\r\n```\r\n```\r\nmarkdown_extensions: \r\n - smartypants\r\n```\r\n```\r\nmarkdown_extensions:\r\n smartypants:\r\n```\r\n\r\n\r\nEither way, when I try to run mkdocs serve I get the below error\r\n\r\n```\r\nERROR - Error building page index.md\r\n[E 150512 11:21:27 build:221] Error building page index.md\r\nTraceback (most recent call last):\r\n File \"C:\\tools\\python\\Scripts\\mkdocs-script.py\", line 9, in \r\n load_entry_point('mkdocs==0.12.2', 'console_scripts', 'mkdocs')()\r\n File \"C:\\tools\\python\\lib\\site-packages\\mkdocs\\main.py\", line 77, in run_main\r\n main(cmd, args=sys.argv[2:], options=dict(opts))\r\n File \"C:\\tools\\python\\lib\\site-packages\\mkdocs\\main.py\", line 49, in main\r\n serve(config, options=options)\r\n File \"C:\\tools\\python\\lib\\site-packages\\mkdocs\\serve.py\", line 22, in serve\r\n builder()\r\n File \"C:\\tools\\python\\lib\\site-packages\\mkdocs\\serve.py\", line 19, in builder\r\n build(config, live_server=True)\r\n File \"C:\\tools\\python\\lib\\site-packages\\mkdocs\\build.py\", line 252, in build\r\n build_pages(config)\r\n File \"C:\\tools\\python\\lib\\site-packages\\mkdocs\\build.py\", line 219, in build_pages\r\n _build_page(page, config, site_navigation, env, dump_json)\r\n File \"C:\\tools\\python\\lib\\site-packages\\mkdocs\\build.py\", line 173, in _build_page\r\n extensions=config['markdown_extensions'], strict=config['strict']\r\n File \"C:\\tools\\python\\lib\\site-packages\\mkdocs\\build.py\", line 36, in convert_markdown\r\n extensions=extensions\r\n File \"C:\\tools\\python\\lib\\site-packages\\markdown\\__init__.py\", line 159, in __init__\r\n configs=kwargs.get('extension_configs', {}))\r\n File \"C:\\tools\\python\\lib\\site-packages\\markdown\\__init__.py\", line 185, in registerExtensions\r\n ext = self.build_extension(ext, configs.get(ext, {}))\r\n File \"C:\\tools\\python\\lib\\site-packages\\markdown\\__init__.py\", line 291, in build_extension\r\n return module.makeExtension(**configs)\r\n File \"C:\\tools\\python\\lib\\site-packages\\mdx_smartypants\\core.py\", line 52, in makeExtension\r\n return SmartypantsExt(configs=configs)\r\n File \"C:\\tools\\python\\lib\\site-packages\\mdx_smartypants\\core.py\", line 41, in __init__\r\n self.configs = dict(configs)\r\nTypeError: 'NoneType' object is not iterable\r\n```"},"repo":{"kind":"string","value":"mkdocs/mkdocs"},"test_patch":{"kind":"string","value":"diff --git a/mkdocs/tests/build_tests.py b/mkdocs/tests/build_tests.py\nindex 470dac46..d474925b 100644\n--- a/mkdocs/tests/build_tests.py\n+++ b/mkdocs/tests/build_tests.py\n@@ -9,16 +9,26 @@ import unittest\n from six.moves import zip\n import mock\n \n-from mkdocs import build, nav\n-from mkdocs.config import base as config_base, defaults as config_defaults\n+from mkdocs import build, nav, config\n from mkdocs.exceptions import MarkdownNotFound\n from mkdocs.tests.base import dedent\n \n \n+def load_config(cfg=None):\n+ \"\"\" Helper to build a simple config for testing. \"\"\"\n+ cfg = cfg or {}\n+ if 'site_name' not in cfg:\n+ cfg['site_name'] = 'Example'\n+ conf = config.base.Config(schema=config.defaults.DEFAULT_SCHEMA)\n+ conf.load_dict(cfg)\n+ assert(conf.validate() == ([], []))\n+ return conf\n+\n+\n class BuildTests(unittest.TestCase):\n \n def test_empty_document(self):\n- html, toc, meta = build.convert_markdown(\"\")\n+ html, toc, meta = build.convert_markdown(\"\", load_config())\n \n self.assertEqual(html, '')\n self.assertEqual(len(list(toc)), 0)\n@@ -28,7 +38,6 @@ class BuildTests(unittest.TestCase):\n \"\"\"\n Ensure that basic Markdown -> HTML and TOC works.\n \"\"\"\n-\n html, toc, meta = build.convert_markdown(dedent(\"\"\"\n page_title: custom title\n \n@@ -39,7 +48,7 @@ class BuildTests(unittest.TestCase):\n # Heading 2\n \n And some more text.\n- \"\"\"))\n+ \"\"\"), load_config())\n \n expected_html = dedent(\"\"\"\n

Heading 1

\n@@ -62,25 +71,25 @@ class BuildTests(unittest.TestCase):\n def test_convert_internal_link(self):\n md_text = 'An [internal link](internal.md) to another document.'\n expected = '

An internal link to another document.

'\n- html, toc, meta = build.convert_markdown(md_text)\n+ html, toc, meta = build.convert_markdown(md_text, load_config())\n self.assertEqual(html.strip(), expected.strip())\n \n def test_convert_multiple_internal_links(self):\n md_text = '[First link](first.md) [second link](second.md).'\n expected = '

First link second link.

'\n- html, toc, meta = build.convert_markdown(md_text)\n+ html, toc, meta = build.convert_markdown(md_text, load_config())\n self.assertEqual(html.strip(), expected.strip())\n \n def test_convert_internal_link_differing_directory(self):\n md_text = 'An [internal link](../internal.md) to another document.'\n expected = '

An internal link to another document.

'\n- html, toc, meta = build.convert_markdown(md_text)\n+ html, toc, meta = build.convert_markdown(md_text, load_config())\n self.assertEqual(html.strip(), expected.strip())\n \n def test_convert_internal_link_with_anchor(self):\n md_text = 'An [internal link](internal.md#section1.1) to another document.'\n expected = '

An internal link to another document.

'\n- html, toc, meta = build.convert_markdown(md_text)\n+ html, toc, meta = build.convert_markdown(md_text, load_config())\n self.assertEqual(html.strip(), expected.strip())\n \n def test_convert_internal_media(self):\n@@ -103,7 +112,7 @@ class BuildTests(unittest.TestCase):\n \n for (page, expected) in zip(site_navigation.walk_pages(), expected_results):\n md_text = '![The initial MkDocs layout](img/initial-layout.png)'\n- html, _, _ = build.convert_markdown(md_text, site_navigation=site_navigation)\n+ html, _, _ = build.convert_markdown(md_text, load_config(), site_navigation=site_navigation)\n self.assertEqual(html, template % expected)\n \n def test_convert_internal_asbolute_media(self):\n@@ -126,7 +135,7 @@ class BuildTests(unittest.TestCase):\n \n for (page, expected) in zip(site_navigation.walk_pages(), expected_results):\n md_text = '![The initial MkDocs layout](/img/initial-layout.png)'\n- html, _, _ = build.convert_markdown(md_text, site_navigation=site_navigation)\n+ html, _, _ = build.convert_markdown(md_text, load_config(), site_navigation=site_navigation)\n self.assertEqual(html, template % expected)\n \n def test_dont_convert_code_block_urls(self):\n@@ -146,11 +155,10 @@ class BuildTests(unittest.TestCase):\n \n for page in site_navigation.walk_pages():\n markdown = 'An HTML Anchor::\\n\\n My example link\\n'\n- html, _, _ = build.convert_markdown(markdown, site_navigation=site_navigation)\n+ html, _, _ = build.convert_markdown(markdown, load_config(), site_navigation=site_navigation)\n self.assertEqual(dedent(html), expected)\n \n def test_anchor_only_link(self):\n-\n pages = [\n 'index.md',\n 'internal.md',\n@@ -161,13 +169,13 @@ class BuildTests(unittest.TestCase):\n \n for page in site_navigation.walk_pages():\n markdown = '[test](#test)'\n- html, _, _ = build.convert_markdown(markdown, site_navigation=site_navigation)\n+ html, _, _ = build.convert_markdown(markdown, load_config(), site_navigation=site_navigation)\n self.assertEqual(html, '

test

')\n \n def test_ignore_external_link(self):\n md_text = 'An [external link](http://example.com/external.md).'\n expected = '

An external link.

'\n- html, toc, meta = build.convert_markdown(md_text)\n+ html, toc, meta = build.convert_markdown(md_text, load_config())\n self.assertEqual(html.strip(), expected.strip())\n \n def test_not_use_directory_urls(self):\n@@ -177,20 +185,19 @@ class BuildTests(unittest.TestCase):\n 'internal.md',\n ]\n site_navigation = nav.SiteNavigation(pages, use_directory_urls=False)\n- html, toc, meta = build.convert_markdown(md_text, site_navigation=site_navigation)\n+ html, toc, meta = build.convert_markdown(md_text, load_config(), site_navigation=site_navigation)\n self.assertEqual(html.strip(), expected.strip())\n \n def test_markdown_table_extension(self):\n \"\"\"\n Ensure that the table extension is supported.\n \"\"\"\n-\n html, toc, meta = build.convert_markdown(dedent(\"\"\"\n First Header | Second Header\n -------------- | --------------\n Content Cell 1 | Content Cell 2\n Content Cell 3 | Content Cell 4\n- \"\"\"))\n+ \"\"\"), load_config())\n \n expected_html = dedent(\"\"\"\n \n@@ -219,12 +226,11 @@ class BuildTests(unittest.TestCase):\n \"\"\"\n Ensure that the fenced code extension is supported.\n \"\"\"\n-\n html, toc, meta = build.convert_markdown(dedent(\"\"\"\n ```\n print 'foo'\n ```\n- \"\"\"))\n+ \"\"\"), load_config())\n \n expected_html = dedent(\"\"\"\n
print 'foo'\\n
\n@@ -241,24 +247,29 @@ class BuildTests(unittest.TestCase):\n \n # Check that the plugin is not active when not requested.\n expected_without_smartstrong = \"

foobarbaz

\"\n- html_base, _, _ = build.convert_markdown(md_input)\n+ html_base, _, _ = build.convert_markdown(md_input, load_config())\n self.assertEqual(html_base.strip(), expected_without_smartstrong)\n \n # Check that the plugin is active when requested.\n+ cfg = load_config({\n+ 'markdown_extensions': ['smart_strong']\n+ })\n expected_with_smartstrong = \"

foo__bar__baz

\"\n- html_ext, _, _ = build.convert_markdown(md_input, extensions=['smart_strong'])\n+ html_ext, _, _ = build.convert_markdown(md_input, cfg)\n self.assertEqual(html_ext.strip(), expected_with_smartstrong)\n \n def test_markdown_duplicate_custom_extension(self):\n \"\"\"\n Duplicated extension names should not cause problems.\n \"\"\"\n+ cfg = load_config({\n+ 'markdown_extensions': ['toc']\n+ })\n md_input = \"foo\"\n- html_ext, _, _ = build.convert_markdown(md_input, ['toc'])\n+ html_ext, _, _ = build.convert_markdown(md_input, cfg)\n self.assertEqual(html_ext.strip(), '

foo

')\n \n def test_copying_media(self):\n-\n docs_dir = tempfile.mkdtemp()\n site_dir = tempfile.mkdtemp()\n try:\n@@ -281,14 +292,11 @@ class BuildTests(unittest.TestCase):\n os.mkdir(os.path.join(docs_dir, '.git'))\n open(os.path.join(docs_dir, '.git/hidden'), 'w').close()\n \n- conf = config_base.Config(schema=config_defaults.DEFAULT_SCHEMA)\n- conf.load_dict({\n- 'site_name': 'Example',\n+ cfg = load_config({\n 'docs_dir': docs_dir,\n 'site_dir': site_dir\n })\n- conf.validate()\n- build.build(conf)\n+ build.build(cfg)\n \n # Verify only the markdown (coverted to html) and the image are copied.\n self.assertTrue(os.path.isfile(os.path.join(site_dir, 'index.html')))\n@@ -308,8 +316,8 @@ class BuildTests(unittest.TestCase):\n site_nav = nav.SiteNavigation(pages)\n \n valid = \"[test](internal.md)\"\n- build.convert_markdown(valid, site_nav, strict=False)\n- build.convert_markdown(valid, site_nav, strict=True)\n+ build.convert_markdown(valid, load_config({'strict': False}), site_nav)\n+ build.convert_markdown(valid, load_config({'strict': True}), site_nav)\n \n def test_strict_mode_invalid(self):\n pages = [\n@@ -320,24 +328,24 @@ class BuildTests(unittest.TestCase):\n site_nav = nav.SiteNavigation(pages)\n \n invalid = \"[test](bad_link.md)\"\n- build.convert_markdown(invalid, site_nav, strict=False)\n+ build.convert_markdown(invalid, load_config({'strict': False}), site_nav)\n \n self.assertRaises(\n MarkdownNotFound,\n- build.convert_markdown, invalid, site_nav, strict=True)\n+ build.convert_markdown, invalid, load_config({'strict': True}), site_nav)\n \n def test_extension_config(self):\n \"\"\"\n Test that a dictionary of 'markdown_extensions' is recognized as\n both a list of extensions and a dictionary of extnesion configs.\n \"\"\"\n- markdown_extensions = {\n- 'toc': {'permalink': True},\n- 'meta': None # This gets ignored as it is an invalid config\n- }\n+ cfg = load_config({\n+ 'markdown_extensions': [{'toc': {'permalink': True}}]\n+ })\n+\n html, toc, meta = build.convert_markdown(dedent(\"\"\"\n # A Header\n- \"\"\"), extensions=markdown_extensions)\n+ \"\"\"), cfg)\n \n expected_html = dedent(\"\"\"\n

A Header&para;

\n@@ -348,17 +356,14 @@ class BuildTests(unittest.TestCase):\n def test_extra_context(self):\n \n # Same as the default schema, but don't verify the docs_dir exists.\n- config = config_base.Config(schema=config_defaults.DEFAULT_SCHEMA)\n- config.load_dict({\n+ cfg = load_config({\n 'site_name': \"Site\",\n 'extra': {\n 'a': 1\n }\n })\n \n- self.assertEqual(config.validate(), ([], []))\n-\n- context = build.get_global_context(mock.Mock(), config)\n+ context = build.get_global_context(mock.Mock(), cfg)\n \n self.assertEqual(context['config']['extra'], {\n 'a': 1\ndiff --git a/mkdocs/tests/config/config_options_tests.py b/mkdocs/tests/config/config_options_tests.py\nindex a499ece5..c4a42f94 100644\n--- a/mkdocs/tests/config/config_options_tests.py\n+++ b/mkdocs/tests/config/config_options_tests.py\n@@ -325,3 +325,170 @@ class NumPagesTest(unittest.TestCase):\n 'key': True,\n 'pages': None\n }, config)\n+\n+\n+class PrivateTest(unittest.TestCase):\n+\n+ def test_defined(self):\n+\n+ option = config_options.Private()\n+ self.assertRaises(config_options.ValidationError,\n+ option.validate, 'somevalue')\n+\n+\n+class MarkdownExtensionsTest(unittest.TestCase):\n+\n+ def test_simple_list(self):\n+ option = config_options.MarkdownExtensions()\n+ config = {\n+ 'markdown_extensions': ['foo', 'bar']\n+ }\n+ config['markdown_extensions'] = option.validate(config['markdown_extensions'])\n+ option.post_validation(config, 'markdown_extensions')\n+ self.assertEqual({\n+ 'markdown_extensions': ['foo', 'bar'],\n+ 'mdx_configs': {}\n+ }, config)\n+\n+ def test_list_dicts(self):\n+ option = config_options.MarkdownExtensions()\n+ config = {\n+ 'markdown_extensions': [\n+ {'foo': {'foo_option': 'foo value'}},\n+ {'bar': {'bar_option': 'bar value'}},\n+ {'baz': None}\n+ ]\n+ }\n+ config['markdown_extensions'] = option.validate(config['markdown_extensions'])\n+ option.post_validation(config, 'markdown_extensions')\n+ self.assertEqual({\n+ 'markdown_extensions': ['foo', 'bar', 'baz'],\n+ 'mdx_configs': {\n+ 'foo': {'foo_option': 'foo value'},\n+ 'bar': {'bar_option': 'bar value'}\n+ }\n+ }, config)\n+\n+ def test_mixed_list(self):\n+ option = config_options.MarkdownExtensions()\n+ config = {\n+ 'markdown_extensions': [\n+ 'foo',\n+ {'bar': {'bar_option': 'bar value'}}\n+ ]\n+ }\n+ config['markdown_extensions'] = option.validate(config['markdown_extensions'])\n+ option.post_validation(config, 'markdown_extensions')\n+ self.assertEqual({\n+ 'markdown_extensions': ['foo', 'bar'],\n+ 'mdx_configs': {\n+ 'bar': {'bar_option': 'bar value'}\n+ }\n+ }, config)\n+\n+ def test_builtins(self):\n+ option = config_options.MarkdownExtensions(builtins=['meta', 'toc'])\n+ config = {\n+ 'markdown_extensions': ['foo', 'bar']\n+ }\n+ config['markdown_extensions'] = option.validate(config['markdown_extensions'])\n+ option.post_validation(config, 'markdown_extensions')\n+ self.assertEqual({\n+ 'markdown_extensions': ['meta', 'toc', 'foo', 'bar'],\n+ 'mdx_configs': {}\n+ }, config)\n+\n+ def test_duplicates(self):\n+ option = config_options.MarkdownExtensions(builtins=['meta', 'toc'])\n+ config = {\n+ 'markdown_extensions': ['meta', 'toc']\n+ }\n+ config['markdown_extensions'] = option.validate(config['markdown_extensions'])\n+ option.post_validation(config, 'markdown_extensions')\n+ self.assertEqual({\n+ 'markdown_extensions': ['meta', 'toc'],\n+ 'mdx_configs': {}\n+ }, config)\n+\n+ def test_builtins_config(self):\n+ option = config_options.MarkdownExtensions(builtins=['meta', 'toc'])\n+ config = {\n+ 'markdown_extensions': [\n+ {'toc': {'permalink': True}}\n+ ]\n+ }\n+ config['markdown_extensions'] = option.validate(config['markdown_extensions'])\n+ option.post_validation(config, 'markdown_extensions')\n+ self.assertEqual({\n+ 'markdown_extensions': ['meta', 'toc'],\n+ 'mdx_configs': {'toc': {'permalink': True}}\n+ }, config)\n+\n+ def test_configkey(self):\n+ option = config_options.MarkdownExtensions(configkey='bar')\n+ config = {\n+ 'markdown_extensions': [\n+ {'foo': {'foo_option': 'foo value'}}\n+ ]\n+ }\n+ config['markdown_extensions'] = option.validate(config['markdown_extensions'])\n+ option.post_validation(config, 'markdown_extensions')\n+ self.assertEqual({\n+ 'markdown_extensions': ['foo'],\n+ 'bar': {\n+ 'foo': {'foo_option': 'foo value'}\n+ }\n+ }, config)\n+\n+ def test_none(self):\n+ option = config_options.MarkdownExtensions(default=[])\n+ config = {\n+ 'markdown_extensions': None\n+ }\n+ config['markdown_extensions'] = option.validate(config['markdown_extensions'])\n+ option.post_validation(config, 'markdown_extensions')\n+ self.assertEqual({\n+ 'markdown_extensions': [],\n+ 'mdx_configs': {}\n+ }, config)\n+\n+ def test_not_list(self):\n+ option = config_options.MarkdownExtensions()\n+ self.assertRaises(config_options.ValidationError,\n+ option.validate, 'not a list')\n+\n+ def test_invalid_config_option(self):\n+ option = config_options.MarkdownExtensions()\n+ config = {\n+ 'markdown_extensions': [\n+ {'foo': 'not a dict'}\n+ ]\n+ }\n+ self.assertRaises(\n+ config_options.ValidationError,\n+ option.validate, config['markdown_extensions']\n+ )\n+\n+ def test_invalid_config_item(self):\n+ option = config_options.MarkdownExtensions()\n+ config = {\n+ 'markdown_extensions': [\n+ ['not a dict']\n+ ]\n+ }\n+ self.assertRaises(\n+ config_options.ValidationError,\n+ option.validate, config['markdown_extensions']\n+ )\n+\n+ def test_invalid_dict_item(self):\n+ option = config_options.MarkdownExtensions()\n+ config = {\n+ 'markdown_extensions': [\n+ {'key1': 'value', 'key2': 'too many keys'}\n+ ]\n+ }\n+ self.assertRaises(\n+ config_options.ValidationError,\n+ option.validate, config['markdown_extensions']\n+ )\ndiff --git a/mkdocs/tests/utils_tests.py b/mkdocs/tests/utils_tests.py\nindex 41d066e6..44af6799 100644\n--- a/mkdocs/tests/utils_tests.py\n+++ b/mkdocs/tests/utils_tests.py\n@@ -5,7 +5,6 @@ import os\n import unittest\n \n from mkdocs import nav, utils\n-from mkdocs.tests.base import dedent\n \n \n class UtilsTests(unittest.TestCase):\n@@ -70,32 +69,6 @@ class UtilsTests(unittest.TestCase):\n urls = utils.create_media_urls(site_navigation, [path])\n self.assertEqual(urls[0], expected_result)\n \n- def test_yaml_load(self):\n- try:\n- from collections import OrderedDict\n- except ImportError:\n- # Don't test if can't import OrderdDict\n- # Exception can be removed when Py26 support is removed\n- return\n-\n- yaml_text = dedent('''\n- test:\n- key1: 1\n- key2: 2\n- key3: 3\n- key4: 4\n- key5: 5\n- key5: 6\n- key3: 7\n- ''')\n-\n- self.assertEqual(\n- utils.yaml_load(yaml_text),\n- OrderedDict([('test', OrderedDict([('key1', 1), ('key2', 2),\n- ('key3', 7), ('key4', 4),\n- ('key5', 6)]))])\n- )\n-\n def test_reduce_list(self):\n self.assertEqual(\n utils.reduce_list([1, 2, 3, 4, 5, 5, 2, 4, 6, 7, 8]),\n"},"meta":{"kind":"string","value":"{\n \"commit_name\": \"head_commit\",\n \"failed_lite_validators\": [\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\": 0,\n \"issue_text_score\": 1,\n \"test_score\": 3\n },\n \"num_modified_files\": 7\n}"},"version":{"kind":"string","value":"0.12"},"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 \"mock\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc\"\n ],\n \"python\": \"3.9\",\n \"reqs_path\": [\n \"requirements/project.txt\"\n ],\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"click==8.1.8\ncoverage==7.8.0\nexceptiongroup==1.2.2\nexecnet==2.1.1\nghp-import==2.1.0\nimportlib_metadata==8.6.1\niniconfig==2.1.0\nJinja2==3.1.6\nlivereload==2.7.1\nMarkdown==3.7\nMarkupSafe==3.0.2\n-e git+https://github.com/mkdocs/mkdocs.git@93a181a208af0440f44e7f51081b9df9d9f30568#egg=mkdocs\nmock==5.2.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\npython-dateutil==2.9.0.post0\nPyYAML==6.0.2\nsix==1.17.0\ntomli==2.2.1\ntornado==6.4.2\ntyping_extensions==4.13.0\nzipp==3.21.0\n"},"environment":{"kind":"string","value":"name: mkdocs\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 - click==8.1.8\n - coverage==7.8.0\n - exceptiongroup==1.2.2\n - execnet==2.1.1\n - ghp-import==2.1.0\n - importlib-metadata==8.6.1\n - iniconfig==2.1.0\n - jinja2==3.1.6\n - livereload==2.7.1\n - markdown==3.7\n - markupsafe==3.0.2\n - mock==5.2.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 - python-dateutil==2.9.0.post0\n - pyyaml==6.0.2\n - six==1.17.0\n - tomli==2.2.1\n - tornado==6.4.2\n - typing-extensions==4.13.0\n - zipp==3.21.0\nprefix: /opt/conda/envs/mkdocs\n"},"FAIL_TO_PASS":{"kind":"list like","value":["mkdocs/tests/config/config_options_tests.py::PrivateTest::test_defined","mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_builtins","mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_builtins_config","mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_configkey","mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_duplicates","mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_invalid_config_item","mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_invalid_config_option","mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_invalid_dict_item","mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_list_dicts","mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_mixed_list","mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_none","mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_not_list","mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_simple_list"],"string":"[\n \"mkdocs/tests/config/config_options_tests.py::PrivateTest::test_defined\",\n \"mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_builtins\",\n \"mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_builtins_config\",\n \"mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_configkey\",\n \"mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_duplicates\",\n \"mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_invalid_config_item\",\n \"mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_invalid_config_option\",\n \"mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_invalid_dict_item\",\n \"mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_list_dicts\",\n \"mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_mixed_list\",\n \"mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_none\",\n \"mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_not_list\",\n \"mkdocs/tests/config/config_options_tests.py::MarkdownExtensionsTest::test_simple_list\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":["mkdocs/tests/build_tests.py::BuildTests::test_anchor_only_link","mkdocs/tests/build_tests.py::BuildTests::test_convert_internal_asbolute_media","mkdocs/tests/build_tests.py::BuildTests::test_convert_internal_link","mkdocs/tests/build_tests.py::BuildTests::test_convert_internal_link_differing_directory","mkdocs/tests/build_tests.py::BuildTests::test_convert_internal_link_with_anchor","mkdocs/tests/build_tests.py::BuildTests::test_convert_internal_media","mkdocs/tests/build_tests.py::BuildTests::test_convert_markdown","mkdocs/tests/build_tests.py::BuildTests::test_convert_multiple_internal_links","mkdocs/tests/build_tests.py::BuildTests::test_copying_media","mkdocs/tests/build_tests.py::BuildTests::test_dont_convert_code_block_urls","mkdocs/tests/build_tests.py::BuildTests::test_empty_document","mkdocs/tests/build_tests.py::BuildTests::test_extension_config","mkdocs/tests/build_tests.py::BuildTests::test_ignore_external_link","mkdocs/tests/build_tests.py::BuildTests::test_markdown_custom_extension","mkdocs/tests/build_tests.py::BuildTests::test_markdown_duplicate_custom_extension","mkdocs/tests/build_tests.py::BuildTests::test_markdown_fenced_code_extension","mkdocs/tests/build_tests.py::BuildTests::test_markdown_table_extension","mkdocs/tests/build_tests.py::BuildTests::test_not_use_directory_urls","mkdocs/tests/build_tests.py::BuildTests::test_strict_mode_invalid","mkdocs/tests/build_tests.py::BuildTests::test_strict_mode_valid","mkdocs/tests/utils_tests.py::UtilsTests::test_create_media_urls"],"string":"[\n \"mkdocs/tests/build_tests.py::BuildTests::test_anchor_only_link\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_convert_internal_asbolute_media\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_convert_internal_link\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_convert_internal_link_differing_directory\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_convert_internal_link_with_anchor\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_convert_internal_media\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_convert_markdown\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_convert_multiple_internal_links\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_copying_media\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_dont_convert_code_block_urls\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_empty_document\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_extension_config\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_ignore_external_link\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_markdown_custom_extension\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_markdown_duplicate_custom_extension\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_markdown_fenced_code_extension\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_markdown_table_extension\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_not_use_directory_urls\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_strict_mode_invalid\",\n \"mkdocs/tests/build_tests.py::BuildTests::test_strict_mode_valid\",\n \"mkdocs/tests/utils_tests.py::UtilsTests::test_create_media_urls\"\n]"},"PASS_TO_PASS":{"kind":"list like","value":["mkdocs/tests/build_tests.py::BuildTests::test_extra_context","mkdocs/tests/config/config_options_tests.py::BaseConfigOptionTest::test_default","mkdocs/tests/config/config_options_tests.py::BaseConfigOptionTest::test_empty","mkdocs/tests/config/config_options_tests.py::BaseConfigOptionTest::test_replace_default","mkdocs/tests/config/config_options_tests.py::BaseConfigOptionTest::test_required","mkdocs/tests/config/config_options_tests.py::BaseConfigOptionTest::test_required_no_default","mkdocs/tests/config/config_options_tests.py::TypeTest::test_length","mkdocs/tests/config/config_options_tests.py::TypeTest::test_multiple_types","mkdocs/tests/config/config_options_tests.py::TypeTest::test_single_type","mkdocs/tests/config/config_options_tests.py::URLTest::test_invalid","mkdocs/tests/config/config_options_tests.py::URLTest::test_invalid_url","mkdocs/tests/config/config_options_tests.py::URLTest::test_valid_url","mkdocs/tests/config/config_options_tests.py::RepoURLTest::test_repo_name_bitbucket","mkdocs/tests/config/config_options_tests.py::RepoURLTest::test_repo_name_custom","mkdocs/tests/config/config_options_tests.py::RepoURLTest::test_repo_name_github","mkdocs/tests/config/config_options_tests.py::DirTest::test_file","mkdocs/tests/config/config_options_tests.py::DirTest::test_incorrect_type_attribute_error","mkdocs/tests/config/config_options_tests.py::DirTest::test_incorrect_type_type_error","mkdocs/tests/config/config_options_tests.py::DirTest::test_missing_dir","mkdocs/tests/config/config_options_tests.py::DirTest::test_missing_dir_but_required","mkdocs/tests/config/config_options_tests.py::DirTest::test_valid_dir","mkdocs/tests/config/config_options_tests.py::SiteDirTest::test_doc_dir_in_site_dir","mkdocs/tests/config/config_options_tests.py::ThemeTest::test_theme","mkdocs/tests/config/config_options_tests.py::ThemeTest::test_theme_invalid","mkdocs/tests/config/config_options_tests.py::ExtrasTest::test_empty","mkdocs/tests/config/config_options_tests.py::ExtrasTest::test_invalid","mkdocs/tests/config/config_options_tests.py::ExtrasTest::test_provided","mkdocs/tests/config/config_options_tests.py::PagesTest::test_invalid_config","mkdocs/tests/config/config_options_tests.py::PagesTest::test_invalid_type","mkdocs/tests/config/config_options_tests.py::PagesTest::test_provided","mkdocs/tests/config/config_options_tests.py::PagesTest::test_provided_dict","mkdocs/tests/config/config_options_tests.py::PagesTest::test_provided_empty","mkdocs/tests/config/config_options_tests.py::NumPagesTest::test_invalid_pages","mkdocs/tests/config/config_options_tests.py::NumPagesTest::test_many_pages","mkdocs/tests/config/config_options_tests.py::NumPagesTest::test_one_page","mkdocs/tests/config/config_options_tests.py::NumPagesTest::test_provided","mkdocs/tests/utils_tests.py::UtilsTests::test_get_themes","mkdocs/tests/utils_tests.py::UtilsTests::test_html_path","mkdocs/tests/utils_tests.py::UtilsTests::test_is_html_file","mkdocs/tests/utils_tests.py::UtilsTests::test_is_markdown_file","mkdocs/tests/utils_tests.py::UtilsTests::test_nest_paths","mkdocs/tests/utils_tests.py::UtilsTests::test_reduce_list","mkdocs/tests/utils_tests.py::UtilsTests::test_url_path"],"string":"[\n \"mkdocs/tests/build_tests.py::BuildTests::test_extra_context\",\n \"mkdocs/tests/config/config_options_tests.py::BaseConfigOptionTest::test_default\",\n \"mkdocs/tests/config/config_options_tests.py::BaseConfigOptionTest::test_empty\",\n \"mkdocs/tests/config/config_options_tests.py::BaseConfigOptionTest::test_replace_default\",\n \"mkdocs/tests/config/config_options_tests.py::BaseConfigOptionTest::test_required\",\n \"mkdocs/tests/config/config_options_tests.py::BaseConfigOptionTest::test_required_no_default\",\n \"mkdocs/tests/config/config_options_tests.py::TypeTest::test_length\",\n \"mkdocs/tests/config/config_options_tests.py::TypeTest::test_multiple_types\",\n \"mkdocs/tests/config/config_options_tests.py::TypeTest::test_single_type\",\n \"mkdocs/tests/config/config_options_tests.py::URLTest::test_invalid\",\n \"mkdocs/tests/config/config_options_tests.py::URLTest::test_invalid_url\",\n \"mkdocs/tests/config/config_options_tests.py::URLTest::test_valid_url\",\n \"mkdocs/tests/config/config_options_tests.py::RepoURLTest::test_repo_name_bitbucket\",\n \"mkdocs/tests/config/config_options_tests.py::RepoURLTest::test_repo_name_custom\",\n \"mkdocs/tests/config/config_options_tests.py::RepoURLTest::test_repo_name_github\",\n \"mkdocs/tests/config/config_options_tests.py::DirTest::test_file\",\n \"mkdocs/tests/config/config_options_tests.py::DirTest::test_incorrect_type_attribute_error\",\n \"mkdocs/tests/config/config_options_tests.py::DirTest::test_incorrect_type_type_error\",\n \"mkdocs/tests/config/config_options_tests.py::DirTest::test_missing_dir\",\n \"mkdocs/tests/config/config_options_tests.py::DirTest::test_missing_dir_but_required\",\n \"mkdocs/tests/config/config_options_tests.py::DirTest::test_valid_dir\",\n \"mkdocs/tests/config/config_options_tests.py::SiteDirTest::test_doc_dir_in_site_dir\",\n \"mkdocs/tests/config/config_options_tests.py::ThemeTest::test_theme\",\n \"mkdocs/tests/config/config_options_tests.py::ThemeTest::test_theme_invalid\",\n \"mkdocs/tests/config/config_options_tests.py::ExtrasTest::test_empty\",\n \"mkdocs/tests/config/config_options_tests.py::ExtrasTest::test_invalid\",\n \"mkdocs/tests/config/config_options_tests.py::ExtrasTest::test_provided\",\n \"mkdocs/tests/config/config_options_tests.py::PagesTest::test_invalid_config\",\n \"mkdocs/tests/config/config_options_tests.py::PagesTest::test_invalid_type\",\n \"mkdocs/tests/config/config_options_tests.py::PagesTest::test_provided\",\n \"mkdocs/tests/config/config_options_tests.py::PagesTest::test_provided_dict\",\n \"mkdocs/tests/config/config_options_tests.py::PagesTest::test_provided_empty\",\n \"mkdocs/tests/config/config_options_tests.py::NumPagesTest::test_invalid_pages\",\n \"mkdocs/tests/config/config_options_tests.py::NumPagesTest::test_many_pages\",\n \"mkdocs/tests/config/config_options_tests.py::NumPagesTest::test_one_page\",\n \"mkdocs/tests/config/config_options_tests.py::NumPagesTest::test_provided\",\n \"mkdocs/tests/utils_tests.py::UtilsTests::test_get_themes\",\n \"mkdocs/tests/utils_tests.py::UtilsTests::test_html_path\",\n \"mkdocs/tests/utils_tests.py::UtilsTests::test_is_html_file\",\n \"mkdocs/tests/utils_tests.py::UtilsTests::test_is_markdown_file\",\n \"mkdocs/tests/utils_tests.py::UtilsTests::test_nest_paths\",\n \"mkdocs/tests/utils_tests.py::UtilsTests::test_reduce_list\",\n \"mkdocs/tests/utils_tests.py::UtilsTests::test_url_path\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"BSD 2-Clause \"Simplified\" License"},"__index_level_0__":{"kind":"number","value":138,"string":"138"}}},{"rowIdx":139,"cells":{"instance_id":{"kind":"string","value":"drincruz__python-trie-20"},"base_commit":{"kind":"string","value":"57d83c22c0f5eb9faa10a54c138c4e2e5a0f88d8"},"created_at":{"kind":"string","value":"2015-05-15 12:31:04"},"environment_setup_commit":{"kind":"string","value":"57d83c22c0f5eb9faa10a54c138c4e2e5a0f88d8"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/README.md b/README.md\nindex 77303a0..ba35836 100644\n--- a/README.md\n+++ b/README.md\n@@ -19,7 +19,7 @@ Example\n >>> t.contains_word(\"dogg\")\n False\n >>> t.root\n- {'d': {'o': {'g': {'!THIS_IS_THE_END!': {'word': 'dog'}, 's': {'!THIS_IS_THE_END!': {'word': 'dogs'}}, 'g': {'y': {'!THIS_IS_THE_END!': {'word': 'doggy'}}}}}}}\n+ {'d': {'o': {'g': {'\\0': {'word': 'dog'}, 's': {'\\0': {'word': 'dogs'}}, 'g': {'y': {'\\0': {'word': 'doggy'}}}}}}}\n \n \n Unit Testing\ndiff --git a/trie/trie.py b/trie/trie.py\nindex 96f3fdb..4bd31f7 100644\n--- a/trie/trie.py\n+++ b/trie/trie.py\n@@ -10,7 +10,7 @@ class TriePy(object):\n \n \"\"\"\n # A terminator to represent and end of a path\n- __TRIE_TERMINATOR = '!THIS_IS_THE_END!'\n+ __TRIE_TERMINATOR = '\\0'\n \n def __init__(self):\n \"\"\"\n"},"problem_statement":{"kind":"string","value":"change default TRIE_TERMINATOR default\n'!THIS_IS_THE_END!' was _really_ just an example. Using a \\0 terminator makes the most sense. Let's do that."},"repo":{"kind":"string","value":"drincruz/python-trie"},"test_patch":{"kind":"string","value":"diff --git a/tests/test_trie.py b/tests/test_trie.py\nindex 0b3aa6b..7b1fa5e 100644\n--- a/tests/test_trie.py\n+++ b/tests/test_trie.py\n@@ -15,7 +15,7 @@ def test_abc_add_word():\n my_test = {\"a\":\n {\"b\": \n {\"c\": \n- {\"!THIS_IS_THE_END!\":\n+ {\"\\0\":\n {\"word\": \"abc\"}\n }\n }\n@@ -34,8 +34,8 @@ def test_asterisk_add_word():\n my_test = {\"*\":\n {\"x\":\n {\"*\":\n- { \"z\":\n- {\"!THIS_IS_THE_END!\":\n+ {\"z\":\n+ {\"\\0\":\n {\"word\": \"*x*z\"}\n }\n }\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 ],\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\": 2\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 \"nose\",\n \"pytest\"\n ],\n \"pre_install\": null,\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":"exceptiongroup @ file:///croot/exceptiongroup_1706031385326/work\niniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work\nnose==1.3.7\npackaging @ file:///croot/packaging_1734472117206/work\npluggy @ file:///croot/pluggy_1733169602837/work\npytest @ file:///croot/pytest_1738938843180/work\ntomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work\n-e git+https://github.com/drincruz/python-trie.git@57d83c22c0f5eb9faa10a54c138c4e2e5a0f88d8#egg=TriePy\n"},"environment":{"kind":"string","value":"name: python-trie\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 - nose==1.3.7\nprefix: /opt/conda/envs/python-trie\n"},"FAIL_TO_PASS":{"kind":"list like","value":["tests/test_trie.py::test_abc_add_word","tests/test_trie.py::test_asterisk_add_word"],"string":"[\n \"tests/test_trie.py::test_abc_add_word\",\n \"tests/test_trie.py::test_asterisk_add_word\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["tests/test_trie.py::test_contains_true","tests/test_trie.py::test_contains_false"],"string":"[\n \"tests/test_trie.py::test_contains_true\",\n \"tests/test_trie.py::test_contains_false\"\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":139,"string":"139"}}},{"rowIdx":140,"cells":{"instance_id":{"kind":"string","value":"yolothreat__utilitybelt-53"},"base_commit":{"kind":"string","value":"ef2526c4e15c886c2a68162b67e7d7fb25ec9ee3"},"created_at":{"kind":"string","value":"2015-05-15 17:38:13"},"environment_setup_commit":{"kind":"string","value":"ef2526c4e15c886c2a68162b67e7d7fb25ec9ee3"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/.gitignore b/.gitignore\nindex c26136f..601e383 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -57,6 +57,7 @@ venv\n \n ## Data\n data/*\n+*.json\n \n # swap files\n *.swp\ndiff --git a/utilitybelt/utilitybelt.py b/utilitybelt/utilitybelt.py\nindex 180865c..8307e7a 100644\n--- a/utilitybelt/utilitybelt.py\n+++ b/utilitybelt/utilitybelt.py\n@@ -143,6 +143,24 @@ def is_url(url):\n return bool(re.match(re_url, url))\n \n \n+def is_hash(fhash):\n+ \"\"\"Returns true for valid hashes, false for invalid.\"\"\"\n+\n+ # Intentionally doing if/else statement for ease of testing and reading\n+ if re.match(re_md5, fhash):\n+ return True\n+ elif re.match(re_sha1, fhash):\n+ return True\n+ elif re.match(re_sha256, fhash):\n+ return True\n+ elif re.match(re_sha512, fhash):\n+ return True\n+ elif re.match(re_ssdeep, fhash):\n+ return True\n+ else:\n+ return False\n+\n+\n def ip_to_geo(ipaddress):\n \"\"\"Convert IP to Geographic Information\"\"\"\n \n@@ -245,7 +263,10 @@ def vt_ip_check(ip, vt_api):\n url = 'https://www.virustotal.com/vtapi/v2/ip-address/report'\n parameters = {'ip': ip, 'apikey': vt_api}\n response = requests.get(url, params=parameters)\n- return response.json()\n+ try:\n+ return response.json()\n+ except ValueError:\n+ return None\n \n \n def vt_name_check(domain, vt_api):\n@@ -256,7 +277,24 @@ def vt_name_check(domain, vt_api):\n url = 'https://www.virustotal.com/vtapi/v2/domain/report'\n parameters = {'domain': domain, 'apikey': vt_api}\n response = requests.get(url, params=parameters)\n- return response.json()\n+ try:\n+ return response.json()\n+ except ValueError:\n+ return None\n+\n+\n+def vt_hash_check(fhash, vt_api):\n+ \"\"\"Checks VirusTotal for occurrences of a file hash\"\"\"\n+ if not is_hash(fhash):\n+ return None\n+\n+ url = 'https://www.virustotal.com/vtapi/v2/file/report'\n+ parameters = {'resource': fhash, 'apikey': vt_api}\n+ response = requests.get(url, params=parameters)\n+ try:\n+ return response.json()\n+ except ValueError:\n+ return None\n \n \n def ipinfo_ip_check(ip):\n"},"problem_statement":{"kind":"string","value":"`vt_name_check()` and `vt_api_check()` do not handle errors properly\nIf VirusTotal returns an error (such as exceeding rate limits), these functions throw a `JSONDecodeError`."},"repo":{"kind":"string","value":"yolothreat/utilitybelt"},"test_patch":{"kind":"string","value":"diff --git a/utilitybelt/tests/tests.py b/utilitybelt/tests/tests.py\nindex b826966..ea1f525 100644\n--- a/utilitybelt/tests/tests.py\n+++ b/utilitybelt/tests/tests.py\n@@ -1,4 +1,5 @@\n import os\n+import time\n import unittest\n \n from utilitybelt import utilitybelt as ub\n@@ -94,6 +95,21 @@ class TestUB(unittest.TestCase):\n self.assertFalse(ub.is_reserved(\"8.8.4.4\"))\n self.assertFalse(ub.is_reserved(\"192.30.252.131\"))\n \n+ def test_is_hash(self):\n+ # all hashes of the empty string\n+ self.assertIsInstance(ub.is_hash(\"d41d8cd98f00b204e9800998ecf8427e\"), bool)\n+ # MD5\n+ self.assertTrue(ub.is_hash(\"d41d8cd98f00b204e9800998ecf8427e\"))\n+ # SHA1\n+ self.assertTrue(ub.is_hash(\"da39a3ee5e6b4b0d3255bfef95601890afd80709\"))\n+ # SHA256\n+ self.assertTrue(ub.is_hash(\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"))\n+ # SHA512\n+ self.assertTrue(ub.is_hash(\"cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e\"))\n+ # ssdeep\n+ self.assertTrue(ub.is_hash(\"96:EQOJvOl4ab3hhiNFXc4wwcweomr0cNJDBoqXjmAHKX8dEt001nfEhVIuX0dDcs:3mzpAsZpprbshfu3oujjdENdp21\"))\n+ self.assertFalse(ub.is_hash(\"KilroyWasHere\"))\n+\n def test_vt_ip_check(self):\n vt_api = os.environ[\"VT_API\"]\n self.assertIsNone(ub.vt_ip_check('asdf', vt_api))\n@@ -108,6 +124,7 @@ class TestUB(unittest.TestCase):\n if resolution['hostname'] == \"github.com\":\n is_gh = True\n self.assertTrue(is_gh)\n+ time.sleep(15) # VT rate limiting\n \n def test_vt_name_check(self):\n vt_api = os.environ[\"VT_API\"]\n@@ -120,6 +137,37 @@ class TestUB(unittest.TestCase):\n if resolution['ip_address'] == '192.30.252.130':\n is_gh = True\n self.assertTrue(is_gh)\n+ time.sleep(15) # VT rate limiting\n+\n+ def test_vt_hash_check(self):\n+ vt_api = os.environ[\"VT_API\"]\n+ self.assertIsNone(ub.vt_hash_check('asdf', vt_api))\n+ vt_hash_data = ub.vt_hash_check(\"fe03b4181707f1ea1f3c69dc0a9904181c6fce91\", vt_api)\n+ self.assertIsInstance(vt_hash_data, dict)\n+ self.assertIn('resource', vt_hash_data)\n+ self.assertIn('positives', vt_hash_data)\n+ self.assertGreater(vt_hash_data['positives'], 0)\n+ time.sleep(15) # VT rate limiting\n+ vt_hash_data = ub.vt_hash_check(\"d41d8cd98f00b204e9800998ecf8427e\", vt_api)\n+ self.assertIn('positives', vt_hash_data)\n+ self.assertEqual(vt_hash_data['positives'], 0)\n+ time.sleep(15) # VT rate limiting\n+\n+ def test_vt_rate_limiting(self):\n+ vt_api = os.environ[\"VT_API\"]\n+ # Exceed 4x in 60 seconds\n+ data = ub.vt_hash_check(\"d41d8cd98f00b204e9800998ecf8427e\", vt_api)\n+ self.assertIsInstance(data, dict)\n+ data = ub.vt_hash_check(\"d41d8cd98f00b204e9800998ecf8427e\", vt_api)\n+ data = ub.vt_hash_check(\"d41d8cd98f00b204e9800998ecf8427e\", vt_api)\n+ data = ub.vt_hash_check(\"d41d8cd98f00b204e9800998ecf8427e\", vt_api)\n+ data = ub.vt_name_check(\"example.org\", vt_api)\n+ self.assertIsNone(data)\n+ data = ub.vt_ip_check(\"192.30.252.130\", vt_api)\n+ self.assertIsNone(data)\n+ data = ub.vt_hash_check(\"d41d8cd98f00b204e9800998ecf8427e\", vt_api)\n+ self.assertIsNone(data)\n+ time.sleep(15)\n \n def test_ipinfo(self):\n self.assertIsNone(ub.ipinfo_ip_check('asdf'))\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\": 1,\n \"issue_text_score\": 1,\n \"test_score\": 2\n },\n \"num_modified_files\": 2\n}"},"version":{"kind":"string","value":"0.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\": \"requirements.txt\",\n \"pip_packages\": [\n \"pytest\"\n ],\n \"pre_install\": [\n \"apt-get update\",\n \"apt-get install -y gcc libgeoip-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":"beautifulsoup4==4.13.3\ncertifi==2025.1.31\ncfgv==3.4.0\ncharset-normalizer==3.4.1\n-e git+https://github.com/yolothreat/utilitybelt.git@ef2526c4e15c886c2a68162b67e7d7fb25ec9ee3#egg=cnd_utilitybelt\ncoverage==7.8.0\ncoveralls==4.0.1\ndistlib==0.3.9\ndocopt==0.6.2\nexceptiongroup==1.2.2\nfilelock==3.18.0\nidentify==2.6.9\nidna==3.10\niniconfig==2.1.0\nnetaddr==1.3.0\nnodeenv==1.9.1\npackaging==24.2\nplatformdirs==4.3.7\npluggy==1.5.0\npre_commit==4.2.0\npygeoip==0.3.2\npytest==8.3.5\npytest-cov==6.0.0\nPyYAML==6.0.2\nrequests==2.32.3\nsoupsieve==2.6\ntomli==2.2.1\ntyping_extensions==4.13.0\nurllib3==2.3.0\nvirtualenv==20.29.3\n"},"environment":{"kind":"string","value":"name: utilitybelt\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 - beautifulsoup4==4.13.3\n - certifi==2025.1.31\n - cfgv==3.4.0\n - charset-normalizer==3.4.1\n - coverage==7.8.0\n - coveralls==4.0.1\n - distlib==0.3.9\n - docopt==0.6.2\n - exceptiongroup==1.2.2\n - filelock==3.18.0\n - identify==2.6.9\n - idna==3.10\n - iniconfig==2.1.0\n - netaddr==1.3.0\n - nodeenv==1.9.1\n - packaging==24.2\n - platformdirs==4.3.7\n - pluggy==1.5.0\n - pre-commit==4.2.0\n - pygeoip==0.3.2\n - pytest==8.3.5\n - pytest-cov==6.0.0\n - pyyaml==6.0.2\n - requests==2.32.3\n - soupsieve==2.6\n - tomli==2.2.1\n - typing-extensions==4.13.0\n - urllib3==2.3.0\n - virtualenv==20.29.3\nprefix: /opt/conda/envs/utilitybelt\n"},"FAIL_TO_PASS":{"kind":"list like","value":["utilitybelt/tests/tests.py::TestUB::test_is_hash"],"string":"[\n \"utilitybelt/tests/tests.py::TestUB::test_is_hash\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":["utilitybelt/tests/tests.py::TestUB::test_domain_to_geo","utilitybelt/tests/tests.py::TestUB::test_dshield_ip_check","utilitybelt/tests/tests.py::TestUB::test_ipinfo","utilitybelt/tests/tests.py::TestUB::test_ipvoid_check","utilitybelt/tests/tests.py::TestUB::test_reverse_dns","utilitybelt/tests/tests.py::TestUB::test_reverse_dns_sna","utilitybelt/tests/tests.py::TestUB::test_urlvoid_check","utilitybelt/tests/tests.py::TestUB::test_urlvoid_ip_check","utilitybelt/tests/tests.py::TestUB::test_vt_hash_check","utilitybelt/tests/tests.py::TestUB::test_vt_ip_check","utilitybelt/tests/tests.py::TestUB::test_vt_name_check","utilitybelt/tests/tests.py::TestUB::test_vt_rate_limiting"],"string":"[\n \"utilitybelt/tests/tests.py::TestUB::test_domain_to_geo\",\n \"utilitybelt/tests/tests.py::TestUB::test_dshield_ip_check\",\n \"utilitybelt/tests/tests.py::TestUB::test_ipinfo\",\n \"utilitybelt/tests/tests.py::TestUB::test_ipvoid_check\",\n \"utilitybelt/tests/tests.py::TestUB::test_reverse_dns\",\n \"utilitybelt/tests/tests.py::TestUB::test_reverse_dns_sna\",\n \"utilitybelt/tests/tests.py::TestUB::test_urlvoid_check\",\n \"utilitybelt/tests/tests.py::TestUB::test_urlvoid_ip_check\",\n \"utilitybelt/tests/tests.py::TestUB::test_vt_hash_check\",\n \"utilitybelt/tests/tests.py::TestUB::test_vt_ip_check\",\n \"utilitybelt/tests/tests.py::TestUB::test_vt_name_check\",\n \"utilitybelt/tests/tests.py::TestUB::test_vt_rate_limiting\"\n]"},"PASS_TO_PASS":{"kind":"list like","value":["utilitybelt/tests/tests.py::TestUB::test_ip_between","utilitybelt/tests/tests.py::TestUB::test_ip_to_geo","utilitybelt/tests/tests.py::TestUB::test_ip_to_geojson","utilitybelt/tests/tests.py::TestUB::test_ip_to_long","utilitybelt/tests/tests.py::TestUB::test_ips_to_geojson","utilitybelt/tests/tests.py::TestUB::test_is_IPv4Address","utilitybelt/tests/tests.py::TestUB::test_is_reserved","utilitybelt/tests/tests.py::TestUB::test_is_rfc1918","utilitybelt/tests/tests.py::TestUB::test_is_url"],"string":"[\n \"utilitybelt/tests/tests.py::TestUB::test_ip_between\",\n \"utilitybelt/tests/tests.py::TestUB::test_ip_to_geo\",\n \"utilitybelt/tests/tests.py::TestUB::test_ip_to_geojson\",\n \"utilitybelt/tests/tests.py::TestUB::test_ip_to_long\",\n \"utilitybelt/tests/tests.py::TestUB::test_ips_to_geojson\",\n \"utilitybelt/tests/tests.py::TestUB::test_is_IPv4Address\",\n \"utilitybelt/tests/tests.py::TestUB::test_is_reserved\",\n \"utilitybelt/tests/tests.py::TestUB::test_is_rfc1918\",\n \"utilitybelt/tests/tests.py::TestUB::test_is_url\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"MIT License"},"__index_level_0__":{"kind":"number","value":140,"string":"140"}}},{"rowIdx":141,"cells":{"instance_id":{"kind":"string","value":"sympy__sympy-9403"},"base_commit":{"kind":"string","value":"3766b9ca505bb3645e81912b3cc883df73c7a32b"},"created_at":{"kind":"string","value":"2015-05-16 01:11:09"},"environment_setup_commit":{"kind":"string","value":"0241b35cae5f2adc04dc37b25f7dc9c5f00bd746"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/sympy/core/mod.py b/sympy/core/mod.py\nindex 23bdd33399..cefbf8c913 100644\n--- a/sympy/core/mod.py\n+++ b/sympy/core/mod.py\n@@ -84,7 +84,7 @@ def doit(p, q):\n \n # extract gcd; any further simplification should be done by the user\n G = gcd(p, q)\n- if G is not S.One:\n+ if G != 1:\n p, q = [\n gcd_terms(i/G, clear=False, fraction=False) for i in (p, q)]\n pwas, qwas = p, q\ndiff --git a/sympy/polys/constructor.py b/sympy/polys/constructor.py\nindex bb86da60fa..409e0c2b8f 100644\n--- a/sympy/polys/constructor.py\n+++ b/sympy/polys/constructor.py\n@@ -6,6 +6,7 @@\n from sympy.polys.polyoptions import build_options\n from sympy.polys.polyerrors import GeneratorsNeeded\n from sympy.polys.domains import ZZ, QQ, RR, EX\n+from sympy.polys.domains.realfield import RealField\n from sympy.utilities import public\n from sympy.core import sympify\n \n@@ -44,7 +45,10 @@ def _construct_simple(coeffs, opt):\n domain, result = _construct_algebraic(coeffs, opt)\n else:\n if reals:\n- domain = RR\n+ # Use the maximum precision of all coefficients for the RR's\n+ # precision\n+ max_prec = max([c._prec for c in coeffs])\n+ domain = RealField(prec=max_prec)\n else:\n if opt.field or rationals:\n domain = QQ\ndiff --git a/sympy/polys/domains/mpelements.py b/sympy/polys/domains/mpelements.py\nindex d44a6f38c7..e5a89220e2 100644\n--- a/sympy/polys/domains/mpelements.py\n+++ b/sympy/polys/domains/mpelements.py\n@@ -1,4 +1,4 @@\n-\"\"\"Real and complex elements with built-in truncation. \"\"\"\n+\"\"\"Real and complex elements. \"\"\"\n \n from __future__ import print_function, division\n \n@@ -19,13 +19,7 @@ class RealElement(_mpf, DomainElement):\n __slots__ = ['__mpf__']\n \n def _set_mpf(self, val):\n- prec, rounding = self.context._prec_rounding\n- tol = self.context.tol\n-\n- if mpf_lt(mpf_abs(val, prec, rounding), tol):\n- self.__mpf__ = fzero\n- else:\n- self.__mpf__ = val\n+ self.__mpf__ = val\n \n _mpf_ = property(lambda self: self.__mpf__, _set_mpf)\n \n@@ -39,20 +33,7 @@ class ComplexElement(_mpc, DomainElement):\n __slots__ = ['__mpc__']\n \n def _set_mpc(self, val):\n- prec, rounding = self.context._prec_rounding\n- tol = self.context.tol\n-\n- # norm = mpc_abs(val, prec, rounding)\n- # tol = mpf_max(tol, mpf_mul(norm, tol))\n-\n- re, im = val\n-\n- if mpf_lt(mpf_abs(re, prec, rounding), tol):\n- re = fzero\n- if mpf_lt(mpf_abs(im, prec, rounding), tol):\n- im = fzero\n-\n- self.__mpc__ = (re, im)\n+ self.__mpc__ = val\n \n _mpc_ = property(lambda self: self.__mpc__, _set_mpc)\n \n"},"problem_statement":{"kind":"string","value":"Simplify of small imaginary number yields 0\nUsing the most recent release (0.7.6) the following expression yields 0: \r\n\r\n from sympy import *\r\n (I*Number(1.)*Number(10)**Number(-14)).simplify()\r\n\r\nUsing the absolute value this does not happen.\r\n\r\n (Number(1.)*Number(10)**Number(-14)).simplify()\r\n"},"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 eaff343528..222c732c24 100644\n--- a/sympy/core/tests/test_arit.py\n+++ b/sympy/core/tests/test_arit.py\n@@ -1553,7 +1553,14 @@ def test_Mod():\n assert (x + 3) % 1 == Mod(x, 1)\n assert (x + 3.0) % 1 == Mod(1.*x, 1)\n assert (x - S(33)/10) % 1 == Mod(x + S(7)/10, 1)\n- assert str(Mod(.6*x + y, .3*y)) == str(Mod(0.1*y + 0.6*x, 0.3*y))\n+\n+ a = Mod(.6*x + y, .3*y)\n+ b = Mod(0.1*y + 0.6*x, 0.3*y)\n+ # Test that a, b are equal, with 1e-14 accuracy in coefficients\n+ eps = 1e-14\n+ assert abs((a.args[0] - b.args[0]).subs({x: 1, y: 1})) < eps\n+ assert abs((a.args[1] - b.args[1]).subs({x: 1, y: 1})) < eps\n+\n assert (x + 1) % x == 1 % x\n assert (x + y) % x == y % x\n assert (x + y + 2) % x == (y + 2) % x\n@@ -1564,7 +1571,7 @@ def test_Mod():\n assert (-3*x) % (-2*y) == -Mod(3*x, 2*y)\n assert (.6*pi) % (.3*x*pi) == 0.3*pi*Mod(2, x)\n assert (.6*pi) % (.31*x*pi) == pi*Mod(0.6, 0.31*x)\n- assert (6*pi) % (.3*x*pi) == pi*Mod(6, 0.3*x)\n+ assert (6*pi) % (.3*x*pi) == 0.3*pi*Mod(20, x)\n assert (6*pi) % (.31*x*pi) == pi*Mod(6, 0.31*x)\n assert (6*pi) % (.42*x*pi) == pi*Mod(6, 0.42*x)\n assert (12*x) % (2*y) == 2*Mod(6*x, y)\ndiff --git a/sympy/integrals/tests/test_integrals.py b/sympy/integrals/tests/test_integrals.py\nindex 650c24b306..9b0575bdab 100644\n--- a/sympy/integrals/tests/test_integrals.py\n+++ b/sympy/integrals/tests/test_integrals.py\n@@ -11,7 +11,7 @@\n from sympy.physics import units\n from sympy.core.compatibility import range\n from sympy.utilities.pytest import XFAIL, raises, slow\n-\n+from sympy.utilities.randtest import verify_numerically\n \n \n x, y, a, t, x_1, x_2, z, s = symbols('x y a t x_1 x_2 z s')\n@@ -1026,12 +1026,9 @@ def test_risch_option():\n # TODO: How to test risch=False?\n \n def test_issue_6828():\n- # TODO: Currently `h' is the result (all three are equivalent). Improve\n- # simplify() to find the form with simplest real coefficients.\n f = 1/(1.08*x**2 - 4.3)\n- g = 300.0/(324.0*x**2 - 1290.0)\n- h = 0.925925925925926/(1.0*x**2 - 3.98148148148148)\n- assert integrate(f, x).diff(x).simplify().equals(f) is True\n+ g = integrate(f, x).diff(x)\n+ assert verify_numerically(f, g, tol=1e-12)\n \n @XFAIL\n def test_integrate_Piecewise_rational_over_reals():\ndiff --git a/sympy/physics/optics/tests/test_medium.py b/sympy/physics/optics/tests/test_medium.py\nindex 66ec8664cf..e574e719b5 100644\n--- a/sympy/physics/optics/tests/test_medium.py\n+++ b/sympy/physics/optics/tests/test_medium.py\n@@ -29,8 +29,11 @@ def test_medium():\n assert m4.refractive_index < m1.refractive_index\n assert m4 < m1\n m5 = Medium('m5', permittivity=710*10**(-12)*s**4*A**2/(m**3*kg), n=1.33)\n- assert simplify(m5.intrinsic_impedance - 6.24845417765552*kg*m**2/(A**2*s**3)) == 0\n+ assert abs(m5.intrinsic_impedance - 6.24845417765552*kg*m**2/(A**2*s**3)) \\\n+ < 1e-12*kg*m**2/(A**2*s**3)\n assert abs(m5.speed - 225407863.157895*m/s) < 1e-6*m/s\n- assert simplify(m5.refractive_index - 1.33000000000000) == 0\n- assert simplify(m5.permittivity - 7.1e-10*A**2*s**4/(kg*m**3)) == 0\n- assert simplify(m5.permeability - 2.77206575232851e-8*kg*m/(A**2*s**2)) == 0\n+ assert abs(m5.refractive_index - 1.33000000000000) < 1e-12\n+ assert abs(m5.permittivity - 7.1e-10*A**2*s**4/(kg*m**3)) \\\n+ < 1e-20*A**2*s**4/(kg*m**3)\n+ assert abs(m5.permeability - 2.77206575232851e-8*kg*m/(A**2*s**2)) \\\n+ < 1e-20*kg*m/(A**2*s**2)\ndiff --git a/sympy/polys/domains/tests/test_domains.py b/sympy/polys/domains/tests/test_domains.py\nindex c71ee686d4..6efd1575cc 100644\n--- a/sympy/polys/domains/tests/test_domains.py\n+++ b/sympy/polys/domains/tests/test_domains.py\n@@ -1,9 +1,10 @@\n \"\"\"Tests for classes defining properties of ground domains, e.g. ZZ, QQ, ZZ[x] ... \"\"\"\n \n-from sympy import S, sqrt, sin, oo, Poly\n+from sympy import S, sqrt, sin, oo, Poly, Float\n from sympy.abc import x, y, z\n \n from sympy.polys.domains import ZZ, QQ, RR, CC, FF, GF, EX\n+from sympy.polys.domains.realfield import RealField\n \n from sympy.polys.rings import ring\n from sympy.polys.fields import field\n@@ -732,3 +733,38 @@ def test_ModularInteger():\n def test_QQ_int():\n assert int(QQ(2**2000, 3**1250)) == 455431\n assert int(QQ(2**100, 3)) == 422550200076076467165567735125\n+\n+def test_RR_double():\n+ assert RR(3.14) > 1e-50\n+ assert RR(1e-13) > 1e-50\n+ assert RR(1e-14) > 1e-50\n+ assert RR(1e-15) > 1e-50\n+ assert RR(1e-20) > 1e-50\n+ assert RR(1e-40) > 1e-50\n+\n+def test_RR_Float():\n+ f1 = Float(\"1.01\")\n+ f2 = Float(\"1.0000000000000000000001\")\n+ assert f1._prec == 53\n+ assert f2._prec == 80\n+ assert RR(f1)-1 > 1e-50\n+ assert RR(f2)-1 < 1e-50 # RR's precision is lower than f2's\n+\n+ RR2 = RealField(prec=f2._prec)\n+ assert RR2(f1)-1 > 1e-50\n+ assert RR2(f2)-1 > 1e-50 # RR's precision is equal to f2's\n+\n+def test_CC_double():\n+ assert CC(3.14).real > 1e-50\n+ assert CC(1e-13).real > 1e-50\n+ assert CC(1e-14).real > 1e-50\n+ assert CC(1e-15).real > 1e-50\n+ assert CC(1e-20).real > 1e-50\n+ assert CC(1e-40).real > 1e-50\n+\n+ assert CC(3.14j).imag > 1e-50\n+ assert CC(1e-13j).imag > 1e-50\n+ assert CC(1e-14j).imag > 1e-50\n+ assert CC(1e-15j).imag > 1e-50\n+ assert CC(1e-20j).imag > 1e-50\n+ assert CC(1e-40j).imag > 1e-50\ndiff --git a/sympy/polys/tests/test_constructor.py b/sympy/polys/tests/test_constructor.py\nindex 62466e27a5..5238ec52af 100644\n--- a/sympy/polys/tests/test_constructor.py\n+++ b/sympy/polys/tests/test_constructor.py\n@@ -2,8 +2,9 @@\n \n from sympy.polys.constructor import construct_domain\n from sympy.polys.domains import ZZ, QQ, RR, EX\n+from sympy.polys.domains.realfield import RealField\n \n-from sympy import S, sqrt, sin\n+from sympy import S, sqrt, sin, Float\n from sympy.abc import x, y\n \n def test_construct_domain():\n@@ -14,7 +15,9 @@ def test_construct_domain():\n assert construct_domain([S(1), S(2), S(3)], field=True) == (QQ, [QQ(1), QQ(2), QQ(3)])\n \n assert construct_domain([S(1)/2, S(2)]) == (QQ, [QQ(1, 2), QQ(2)])\n- assert construct_domain([3.14, 1, S(1)/2]) == (RR, [RR(3.14), RR(1.0), RR(0.5)])\n+ result = construct_domain([3.14, 1, S(1)/2])\n+ assert isinstance(result[0], RealField)\n+ assert result[1] == [RR(3.14), RR(1.0), RR(0.5)]\n \n assert construct_domain([3.14, sqrt(2)], extension=None) == (EX, [EX(3.14), EX(sqrt(2))])\n assert construct_domain([3.14, sqrt(2)], extension=True) == (EX, [EX(3.14), EX(sqrt(2))])\n@@ -101,3 +104,20 @@ def test_composite_option():\n \n assert construct_domain({(1, 0): y}, composite=False) == \\\n (EX, {(1, 0): EX(y)})\n+\n+def test_precision():\n+ f1 = Float(\"1.01\")\n+ f2 = Float(\"1.0000000000000000000001\")\n+ for x in [1, 1e-2, 1e-6, 1e-13, 1e-14, 1e-16, 1e-20, 1e-100, 1e-300,\n+ f1, f2]:\n+ result = construct_domain([x])\n+ y = float(result[1][0])\n+ assert abs(x - y) / x < 1e-14 # Test relative accuracy\n+\n+ result = construct_domain([f1])\n+ y = result[1][0]\n+ assert y-1 > 1e-50\n+\n+ result = construct_domain([f2])\n+ y = result[1][0]\n+ assert y-1 > 1e-50\ndiff --git a/sympy/polys/tests/test_polytools.py b/sympy/polys/tests/test_polytools.py\nindex 56ccb0c726..38deab20d5 100644\n--- a/sympy/polys/tests/test_polytools.py\n+++ b/sympy/polys/tests/test_polytools.py\n@@ -47,6 +47,7 @@\n \n from sympy.polys.fields import field\n from sympy.polys.domains import FF, ZZ, QQ, RR, EX\n+from sympy.polys.domains.realfield import RealField\n from sympy.polys.orderings import lex, grlex, grevlex\n \n from sympy import (\n@@ -346,7 +347,7 @@ def test_Poly__new__():\n Poly(3*x**5 + 65536*x**4 + x**3 + 65536*x** 2 + 1, x,\n modulus=65537, symmetric=False)\n \n- assert Poly(x**2 + x + 1.0).get_domain() == RR\n+ assert isinstance(Poly(x**2 + x + 1.0).get_domain(), RealField)\n \n \n def test_Poly__args():\n@@ -560,7 +561,7 @@ def test_Poly_get_domain():\n raises(CoercionFailed, lambda: Poly(x/2, domain='ZZ'))\n assert Poly(x/2, domain='QQ').get_domain() == QQ\n \n- assert Poly(0.2*x).get_domain() == RR\n+ assert isinstance(Poly(0.2*x).get_domain(), RealField)\n \n \n def test_Poly_set_domain():\ndiff --git a/sympy/simplify/tests/test_simplify.py b/sympy/simplify/tests/test_simplify.py\nindex 4705bdd359..22deb4f78f 100644\n--- a/sympy/simplify/tests/test_simplify.py\n+++ b/sympy/simplify/tests/test_simplify.py\n@@ -229,7 +229,7 @@ def test_issue_3210():\n \n def test_issue_7263():\n assert abs((simplify(30.8**2 - 82.5**2 * sin(rad(11.6))**2)).evalf() - \\\n- 673.447451402970) < 1e-15\n+ 673.447451402970) < 1e-12\n \n \n def test_trigsimp_issues():\n@@ -1914,6 +1914,34 @@ def test_inequality_no_auto_simplify():\n assert e == Lt(lhs, rhs, evaluate=False)\n assert simplify(e)\n \n+def test_issue_9398():\n+ from sympy import Number, cancel\n+ assert cancel(1e-14) != 0\n+ assert cancel(1e-14*I) != 0\n+\n+ assert simplify(1e-14) != 0\n+ assert simplify(1e-14*I) != 0\n+\n+ assert (I*Number(1.)*Number(10)**Number(-14)).simplify() != 0\n+\n+ assert cancel(1e-20) != 0\n+ assert cancel(1e-20*I) != 0\n+\n+ assert simplify(1e-20) != 0\n+ assert simplify(1e-20*I) != 0\n+\n+ assert cancel(1e-100) != 0\n+ assert cancel(1e-100*I) != 0\n+\n+ assert simplify(1e-100) != 0\n+ assert simplify(1e-100*I) != 0\n+\n+ f = Float(\"1e-1000\")\n+ assert cancel(f) != 0\n+ assert cancel(f*I) != 0\n+\n+ assert simplify(f) != 0\n+ assert simplify(f*I) != 0\n \n def test_issue_9324_simplify():\n M = MatrixSymbol('M', 10, 10)\ndiff --git a/sympy/solvers/tests/test_solvers.py b/sympy/solvers/tests/test_solvers.py\nindex 09fa1537ae..cfd5ca0c74 100644\n--- a/sympy/solvers/tests/test_solvers.py\n+++ b/sympy/solvers/tests/test_solvers.py\n@@ -16,7 +16,7 @@\n from sympy.physics.units import cm\n from sympy.polys.rootoftools import RootOf\n \n-from sympy.utilities.pytest import slow, XFAIL, raises, skip, ON_TRAVIS\n+from sympy.utilities.pytest import slow, XFAIL, SKIP, raises, skip, ON_TRAVIS\n from sympy.utilities.randtest import verify_numerically as tn\n \n from sympy.abc import a, b, c, d, k, h, p, x, y, z, t, q, m\n@@ -743,8 +743,8 @@ def test_issue_5335():\n assert len(solve(eqs, sym, manual=True, minimal=True, simplify=False)) == 2\n \n \n-@XFAIL\n-def test_issue_5335_float():\n+@SKIP(\"Hangs\")\n+def _test_issue_5335_float():\n # gives ZeroDivisionError: polynomial division\n lam, a0, conc = symbols('lam a0 conc')\n eqs = [lam + 2*y - a0*(1 - x/2)*x - 0.005*x/2*x,\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\": 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 .[dev]\",\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@3766b9ca505bb3645e81912b3cc883df73c7a32b#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/polys/domains/tests/test_domains.py::test_RR_double","sympy/polys/domains/tests/test_domains.py::test_RR_Float","sympy/polys/domains/tests/test_domains.py::test_CC_double","sympy/polys/tests/test_constructor.py::test_precision","sympy/simplify/tests/test_simplify.py::test_issue_9398"],"string":"[\n \"sympy/polys/domains/tests/test_domains.py::test_RR_double\",\n \"sympy/polys/domains/tests/test_domains.py::test_RR_Float\",\n \"sympy/polys/domains/tests/test_domains.py::test_CC_double\",\n \"sympy/polys/tests/test_constructor.py::test_precision\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_9398\"\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/integrals/tests/test_integrals.py::test_improper_integral","sympy/integrals/tests/test_integrals.py::test_constructor","sympy/integrals/tests/test_integrals.py::test_basics","sympy/integrals/tests/test_integrals.py::test_basics_multiple","sympy/integrals/tests/test_integrals.py::test_conjugate_transpose","sympy/integrals/tests/test_integrals.py::test_integration","sympy/integrals/tests/test_integrals.py::test_multiple_integration","sympy/integrals/tests/test_integrals.py::test_issue_3532","sympy/integrals/tests/test_integrals.py::test_issue_3560","sympy/integrals/tests/test_integrals.py::test_integrate_poly","sympy/integrals/tests/test_integrals.py::test_integrate_poly_defined","sympy/integrals/tests/test_integrals.py::test_integrate_omit_var","sympy/integrals/tests/test_integrals.py::test_integrate_poly_accurately","sympy/integrals/tests/test_integrals.py::test_issue_3635","sympy/integrals/tests/test_integrals.py::test_integrate_linearterm_pow","sympy/integrals/tests/test_integrals.py::test_issue_3618","sympy/integrals/tests/test_integrals.py::test_issue_3623","sympy/integrals/tests/test_integrals.py::test_issue_3664","sympy/integrals/tests/test_integrals.py::test_issue_3679","sympy/integrals/tests/test_integrals.py::test_issue_3686","sympy/integrals/tests/test_integrals.py::test_integrate_units","sympy/integrals/tests/test_integrals.py::test_transcendental_functions","sympy/integrals/tests/test_integrals.py::test_issue_3740","sympy/integrals/tests/test_integrals.py::test_issue_3788","sympy/integrals/tests/test_integrals.py::test_issue_3952","sympy/integrals/tests/test_integrals.py::test_issue_4516","sympy/integrals/tests/test_integrals.py::test_issue_7450","sympy/integrals/tests/test_integrals.py::test_matrices","sympy/integrals/tests/test_integrals.py::test_integrate_functions","sympy/integrals/tests/test_integrals.py::test_integrate_derivatives","sympy/integrals/tests/test_integrals.py::test_transform","sympy/integrals/tests/test_integrals.py::test_issue_4052","sympy/integrals/tests/test_integrals.py::test_evalf_integrals","sympy/integrals/tests/test_integrals.py::test_evalf_issue_939","sympy/integrals/tests/test_integrals.py::test_integrate_DiracDelta","sympy/integrals/tests/test_integrals.py::test_integrate_returns_piecewise","sympy/integrals/tests/test_integrals.py::test_subs1","sympy/integrals/tests/test_integrals.py::test_subs2","sympy/integrals/tests/test_integrals.py::test_subs3","sympy/integrals/tests/test_integrals.py::test_subs4","sympy/integrals/tests/test_integrals.py::test_subs5","sympy/integrals/tests/test_integrals.py::test_subs6","sympy/integrals/tests/test_integrals.py::test_subs7","sympy/integrals/tests/test_integrals.py::test_expand","sympy/integrals/tests/test_integrals.py::test_integration_variable","sympy/integrals/tests/test_integrals.py::test_expand_integral","sympy/integrals/tests/test_integrals.py::test_as_sum_midpoint1","sympy/integrals/tests/test_integrals.py::test_as_sum_midpoint2","sympy/integrals/tests/test_integrals.py::test_as_sum_left","sympy/integrals/tests/test_integrals.py::test_as_sum_right","sympy/integrals/tests/test_integrals.py::test_as_sum_raises","sympy/integrals/tests/test_integrals.py::test_nested_doit","sympy/integrals/tests/test_integrals.py::test_issue_4665","sympy/integrals/tests/test_integrals.py::test_integral_reconstruct","sympy/integrals/tests/test_integrals.py::test_doit_integrals","sympy/integrals/tests/test_integrals.py::test_issue_4884","sympy/integrals/tests/test_integrals.py::test_is_number","sympy/integrals/tests/test_integrals.py::test_symbols","sympy/integrals/tests/test_integrals.py::test_is_zero","sympy/integrals/tests/test_integrals.py::test_series","sympy/integrals/tests/test_integrals.py::test_issue_4403","sympy/integrals/tests/test_integrals.py::test_issue_4403_2","sympy/integrals/tests/test_integrals.py::test_issue_4100","sympy/integrals/tests/test_integrals.py::test_issue_5167","sympy/integrals/tests/test_integrals.py::test_issue_4890","sympy/integrals/tests/test_integrals.py::test_issue_4376","sympy/integrals/tests/test_integrals.py::test_issue_4517","sympy/integrals/tests/test_integrals.py::test_issue_4527","sympy/integrals/tests/test_integrals.py::test_issue_4199","sympy/integrals/tests/test_integrals.py::test_issue_3940","sympy/integrals/tests/test_integrals.py::test_issue_5413","sympy/integrals/tests/test_integrals.py::test_issue_4892a","sympy/integrals/tests/test_integrals.py::test_issue_4892b","sympy/integrals/tests/test_integrals.py::test_issue_5178","sympy/integrals/tests/test_integrals.py::test_integrate_series","sympy/integrals/tests/test_integrals.py::test_atom_bug","sympy/integrals/tests/test_integrals.py::test_limit_bug","sympy/integrals/tests/test_integrals.py::test_issue_4703","sympy/integrals/tests/test_integrals.py::test_issue_1888","sympy/integrals/tests/test_integrals.py::test_issue_3558","sympy/integrals/tests/test_integrals.py::test_issue_4422","sympy/integrals/tests/test_integrals.py::test_issue_4493","sympy/integrals/tests/test_integrals.py::test_issue_4737","sympy/integrals/tests/test_integrals.py::test_issue_4992","sympy/integrals/tests/test_integrals.py::test_issue_4487","sympy/integrals/tests/test_integrals.py::test_issue_4400","sympy/integrals/tests/test_integrals.py::test_issue_6253","sympy/integrals/tests/test_integrals.py::test_issue_4153","sympy/integrals/tests/test_integrals.py::test_issue_4326","sympy/integrals/tests/test_integrals.py::test_powers","sympy/integrals/tests/test_integrals.py::test_risch_option","sympy/integrals/tests/test_integrals.py::test_issue_6828","sympy/integrals/tests/test_integrals.py::test_issue_4803","sympy/integrals/tests/test_integrals.py::test_issue_4234","sympy/integrals/tests/test_integrals.py::test_issue_4492","sympy/integrals/tests/test_integrals.py::test_issue_2708","sympy/integrals/tests/test_integrals.py::test_issue_8368","sympy/integrals/tests/test_integrals.py::test_issue_8901","sympy/integrals/tests/test_integrals.py::test_issue_7130","sympy/physics/optics/tests/test_medium.py::test_medium","sympy/polys/domains/tests/test_domains.py::test_Domain_unify","sympy/polys/domains/tests/test_domains.py::test_Domain_unify_composite","sympy/polys/domains/tests/test_domains.py::test_Domain_unify_algebraic","sympy/polys/domains/tests/test_domains.py::test_Domain_unify_with_symbols","sympy/polys/domains/tests/test_domains.py::test_Domain__contains__","sympy/polys/domains/tests/test_domains.py::test_Domain_get_ring","sympy/polys/domains/tests/test_domains.py::test_Domain_get_field","sympy/polys/domains/tests/test_domains.py::test_Domain_get_exact","sympy/polys/domains/tests/test_domains.py::test_Domain_convert","sympy/polys/domains/tests/test_domains.py::test_PolynomialRing__init","sympy/polys/domains/tests/test_domains.py::test_FractionField__init","sympy/polys/domains/tests/test_domains.py::test_inject","sympy/polys/domains/tests/test_domains.py::test_Domain_map","sympy/polys/domains/tests/test_domains.py::test_Domain___eq__","sympy/polys/domains/tests/test_domains.py::test_Domain__algebraic_field","sympy/polys/domains/tests/test_domains.py::test_PolynomialRing_from_FractionField","sympy/polys/domains/tests/test_domains.py::test_FractionField_from_PolynomialRing","sympy/polys/domains/tests/test_domains.py::test_FF_of_type","sympy/polys/domains/tests/test_domains.py::test___eq__","sympy/polys/domains/tests/test_domains.py::test_RealField_from_sympy","sympy/polys/domains/tests/test_domains.py::test_ModularInteger","sympy/polys/domains/tests/test_domains.py::test_QQ_int","sympy/polys/tests/test_constructor.py::test_construct_domain","sympy/polys/tests/test_constructor.py::test_composite_option","sympy/polys/tests/test_polytools.py::test_Poly_from_dict","sympy/polys/tests/test_polytools.py::test_Poly_from_list","sympy/polys/tests/test_polytools.py::test_Poly_from_poly","sympy/polys/tests/test_polytools.py::test_Poly_from_expr","sympy/polys/tests/test_polytools.py::test_Poly__new__","sympy/polys/tests/test_polytools.py::test_Poly__args","sympy/polys/tests/test_polytools.py::test_Poly__gens","sympy/polys/tests/test_polytools.py::test_Poly_zero","sympy/polys/tests/test_polytools.py::test_Poly_one","sympy/polys/tests/test_polytools.py::test_Poly__unify","sympy/polys/tests/test_polytools.py::test_Poly_free_symbols","sympy/polys/tests/test_polytools.py::test_PurePoly_free_symbols","sympy/polys/tests/test_polytools.py::test_Poly__eq__","sympy/polys/tests/test_polytools.py::test_PurePoly__eq__","sympy/polys/tests/test_polytools.py::test_PurePoly_Poly","sympy/polys/tests/test_polytools.py::test_Poly_get_domain","sympy/polys/tests/test_polytools.py::test_Poly_set_domain","sympy/polys/tests/test_polytools.py::test_Poly_get_modulus","sympy/polys/tests/test_polytools.py::test_Poly_set_modulus","sympy/polys/tests/test_polytools.py::test_Poly_add_ground","sympy/polys/tests/test_polytools.py::test_Poly_sub_ground","sympy/polys/tests/test_polytools.py::test_Poly_mul_ground","sympy/polys/tests/test_polytools.py::test_Poly_quo_ground","sympy/polys/tests/test_polytools.py::test_Poly_exquo_ground","sympy/polys/tests/test_polytools.py::test_Poly_abs","sympy/polys/tests/test_polytools.py::test_Poly_neg","sympy/polys/tests/test_polytools.py::test_Poly_add","sympy/polys/tests/test_polytools.py::test_Poly_sub","sympy/polys/tests/test_polytools.py::test_Poly_mul","sympy/polys/tests/test_polytools.py::test_Poly_sqr","sympy/polys/tests/test_polytools.py::test_Poly_pow","sympy/polys/tests/test_polytools.py::test_Poly_divmod","sympy/polys/tests/test_polytools.py::test_Poly_eq_ne","sympy/polys/tests/test_polytools.py::test_Poly_nonzero","sympy/polys/tests/test_polytools.py::test_Poly_properties","sympy/polys/tests/test_polytools.py::test_Poly_is_irreducible","sympy/polys/tests/test_polytools.py::test_Poly_subs","sympy/polys/tests/test_polytools.py::test_Poly_replace","sympy/polys/tests/test_polytools.py::test_Poly_reorder","sympy/polys/tests/test_polytools.py::test_Poly_ltrim","sympy/polys/tests/test_polytools.py::test_Poly_has_only_gens","sympy/polys/tests/test_polytools.py::test_Poly_to_ring","sympy/polys/tests/test_polytools.py::test_Poly_to_field","sympy/polys/tests/test_polytools.py::test_Poly_to_exact","sympy/polys/tests/test_polytools.py::test_Poly_retract","sympy/polys/tests/test_polytools.py::test_Poly_slice","sympy/polys/tests/test_polytools.py::test_Poly_coeffs","sympy/polys/tests/test_polytools.py::test_Poly_monoms","sympy/polys/tests/test_polytools.py::test_Poly_terms","sympy/polys/tests/test_polytools.py::test_Poly_all_coeffs","sympy/polys/tests/test_polytools.py::test_Poly_all_monoms","sympy/polys/tests/test_polytools.py::test_Poly_all_terms","sympy/polys/tests/test_polytools.py::test_Poly_termwise","sympy/polys/tests/test_polytools.py::test_Poly_length","sympy/polys/tests/test_polytools.py::test_Poly_as_dict","sympy/polys/tests/test_polytools.py::test_Poly_as_expr","sympy/polys/tests/test_polytools.py::test_Poly_lift","sympy/polys/tests/test_polytools.py::test_Poly_deflate","sympy/polys/tests/test_polytools.py::test_Poly_inject","sympy/polys/tests/test_polytools.py::test_Poly_eject","sympy/polys/tests/test_polytools.py::test_Poly_exclude","sympy/polys/tests/test_polytools.py::test_Poly__gen_to_level","sympy/polys/tests/test_polytools.py::test_Poly_degree","sympy/polys/tests/test_polytools.py::test_Poly_degree_list","sympy/polys/tests/test_polytools.py::test_Poly_total_degree","sympy/polys/tests/test_polytools.py::test_Poly_homogenize","sympy/polys/tests/test_polytools.py::test_Poly_homogeneous_order","sympy/polys/tests/test_polytools.py::test_Poly_LC","sympy/polys/tests/test_polytools.py::test_Poly_TC","sympy/polys/tests/test_polytools.py::test_Poly_EC","sympy/polys/tests/test_polytools.py::test_Poly_coeff","sympy/polys/tests/test_polytools.py::test_Poly_nth","sympy/polys/tests/test_polytools.py::test_Poly_LM","sympy/polys/tests/test_polytools.py::test_Poly_LM_custom_order","sympy/polys/tests/test_polytools.py::test_Poly_EM","sympy/polys/tests/test_polytools.py::test_Poly_LT","sympy/polys/tests/test_polytools.py::test_Poly_ET","sympy/polys/tests/test_polytools.py::test_Poly_max_norm","sympy/polys/tests/test_polytools.py::test_Poly_l1_norm","sympy/polys/tests/test_polytools.py::test_Poly_clear_denoms","sympy/polys/tests/test_polytools.py::test_Poly_rat_clear_denoms","sympy/polys/tests/test_polytools.py::test_Poly_integrate","sympy/polys/tests/test_polytools.py::test_Poly_diff","sympy/polys/tests/test_polytools.py::test_Poly_eval","sympy/polys/tests/test_polytools.py::test_Poly___call__","sympy/polys/tests/test_polytools.py::test_parallel_poly_from_expr","sympy/polys/tests/test_polytools.py::test_pdiv","sympy/polys/tests/test_polytools.py::test_div","sympy/polys/tests/test_polytools.py::test_gcdex","sympy/polys/tests/test_polytools.py::test_revert","sympy/polys/tests/test_polytools.py::test_subresultants","sympy/polys/tests/test_polytools.py::test_resultant","sympy/polys/tests/test_polytools.py::test_discriminant","sympy/polys/tests/test_polytools.py::test_dispersion","sympy/polys/tests/test_polytools.py::test_gcd_list","sympy/polys/tests/test_polytools.py::test_lcm_list","sympy/polys/tests/test_polytools.py::test_gcd","sympy/polys/tests/test_polytools.py::test_gcd_numbers_vs_polys","sympy/polys/tests/test_polytools.py::test_terms_gcd","sympy/polys/tests/test_polytools.py::test_trunc","sympy/polys/tests/test_polytools.py::test_monic","sympy/polys/tests/test_polytools.py::test_content","sympy/polys/tests/test_polytools.py::test_primitive","sympy/polys/tests/test_polytools.py::test_compose","sympy/polys/tests/test_polytools.py::test_shift","sympy/polys/tests/test_polytools.py::test_sturm","sympy/polys/tests/test_polytools.py::test_gff","sympy/polys/tests/test_polytools.py::test_sqf_norm","sympy/polys/tests/test_polytools.py::test_sqf","sympy/polys/tests/test_polytools.py::test_factor","sympy/polys/tests/test_polytools.py::test_factor_large","sympy/polys/tests/test_polytools.py::test_intervals","sympy/polys/tests/test_polytools.py::test_refine_root","sympy/polys/tests/test_polytools.py::test_count_roots","sympy/polys/tests/test_polytools.py::test_Poly_root","sympy/polys/tests/test_polytools.py::test_real_roots","sympy/polys/tests/test_polytools.py::test_all_roots","sympy/polys/tests/test_polytools.py::test_nroots","sympy/polys/tests/test_polytools.py::test_ground_roots","sympy/polys/tests/test_polytools.py::test_nth_power_roots_poly","sympy/polys/tests/test_polytools.py::test_torational_factor_list","sympy/polys/tests/test_polytools.py::test_cancel","sympy/polys/tests/test_polytools.py::test_reduced","sympy/polys/tests/test_polytools.py::test_groebner","sympy/polys/tests/test_polytools.py::test_fglm","sympy/polys/tests/test_polytools.py::test_is_zero_dimensional","sympy/polys/tests/test_polytools.py::test_GroebnerBasis","sympy/polys/tests/test_polytools.py::test_poly","sympy/polys/tests/test_polytools.py::test_keep_coeff","sympy/polys/tests/test_polytools.py::test_noncommutative","sympy/polys/tests/test_polytools.py::test_to_rational_coeffs","sympy/simplify/tests/test_simplify.py::test_ratsimp","sympy/simplify/tests/test_simplify.py::test_ratsimpmodprime","sympy/simplify/tests/test_simplify.py::test_trigsimp1","sympy/simplify/tests/test_simplify.py::test_trigsimp1a","sympy/simplify/tests/test_simplify.py::test_trigsimp2","sympy/simplify/tests/test_simplify.py::test_issue_4373","sympy/simplify/tests/test_simplify.py::test_trigsimp3","sympy/simplify/tests/test_simplify.py::test_issue_4661","sympy/simplify/tests/test_simplify.py::test_issue_4494","sympy/simplify/tests/test_simplify.py::test_issue_5948","sympy/simplify/tests/test_simplify.py::test_issue_4775","sympy/simplify/tests/test_simplify.py::test_issue_4280","sympy/simplify/tests/test_simplify.py::test_issue_3210","sympy/simplify/tests/test_simplify.py::test_issue_7263","sympy/simplify/tests/test_simplify.py::test_trigsimp_issues","sympy/simplify/tests/test_simplify.py::test_trigsimp_issue_2515","sympy/simplify/tests/test_simplify.py::test_trigsimp_issue_3826","sympy/simplify/tests/test_simplify.py::test_trigsimp_issue_4032","sympy/simplify/tests/test_simplify.py::test_trigsimp_issue_7761","sympy/simplify/tests/test_simplify.py::test_trigsimp_noncommutative","sympy/simplify/tests/test_simplify.py::test_hyperbolic_simp","sympy/simplify/tests/test_simplify.py::test_trigsimp_groebner","sympy/simplify/tests/test_simplify.py::test_simplify_expr","sympy/simplify/tests/test_simplify.py::test_issue_3557","sympy/simplify/tests/test_simplify.py::test_simplify_other","sympy/simplify/tests/test_simplify.py::test_simplify_complex","sympy/simplify/tests/test_simplify.py::test_simplify_ratio","sympy/simplify/tests/test_simplify.py::test_simplify_measure","sympy/simplify/tests/test_simplify.py::test_simplify_issue_1308","sympy/simplify/tests/test_simplify.py::test_issue_5652","sympy/simplify/tests/test_simplify.py::test_simplify_fail1","sympy/simplify/tests/test_simplify.py::test_fraction","sympy/simplify/tests/test_simplify.py::test_powsimp","sympy/simplify/tests/test_simplify.py::test_issue_6367","sympy/simplify/tests/test_simplify.py::test_powsimp_negated_base","sympy/simplify/tests/test_simplify.py::test_issue_6440","sympy/simplify/tests/test_simplify.py::test_powsimp_polar","sympy/simplify/tests/test_simplify.py::test_powsimp_nc","sympy/simplify/tests/test_simplify.py::test_nthroot","sympy/simplify/tests/test_simplify.py::test_nthroot1","sympy/simplify/tests/test_simplify.py::test_collect_1","sympy/simplify/tests/test_simplify.py::test_collect_2","sympy/simplify/tests/test_simplify.py::test_collect_3","sympy/simplify/tests/test_simplify.py::test_collect_4","sympy/simplify/tests/test_simplify.py::test_collect_5","sympy/simplify/tests/test_simplify.py::test_collect_D","sympy/simplify/tests/test_simplify.py::test_collect_D_0","sympy/simplify/tests/test_simplify.py::test_collect_Wild","sympy/simplify/tests/test_simplify.py::test_collect_func","sympy/simplify/tests/test_simplify.py::test_collect_order","sympy/simplify/tests/test_simplify.py::test_rcollect","sympy/simplify/tests/test_simplify.py::test_separatevars","sympy/simplify/tests/test_simplify.py::test_separatevars_advanced_factor","sympy/simplify/tests/test_simplify.py::test_hypersimp","sympy/simplify/tests/test_simplify.py::test_nsimplify","sympy/simplify/tests/test_simplify.py::test_extract_minus_sign","sympy/simplify/tests/test_simplify.py::test_diff","sympy/simplify/tests/test_simplify.py::test_logcombine_1","sympy/simplify/tests/test_simplify.py::test_logcombine_complex_coeff","sympy/simplify/tests/test_simplify.py::test_posify","sympy/simplify/tests/test_simplify.py::test_powdenest","sympy/simplify/tests/test_simplify.py::test_powdenest_polar","sympy/simplify/tests/test_simplify.py::test_issue_5805","sympy/simplify/tests/test_simplify.py::test_issue_4194","sympy/simplify/tests/test_simplify.py::test_combsimp","sympy/simplify/tests/test_simplify.py::test_issue_5615","sympy/simplify/tests/test_simplify.py::test_issue_5728","sympy/simplify/tests/test_simplify.py::test_as_content_primitive","sympy/simplify/tests/test_simplify.py::test_radsimp","sympy/simplify/tests/test_simplify.py::test_radsimp_issue_3214","sympy/simplify/tests/test_simplify.py::test_collect_const","sympy/simplify/tests/test_simplify.py::test_issue_5933","sympy/simplify/tests/test_simplify.py::test_fraction_expand","sympy/simplify/tests/test_simplify.py::test_combsimp_gamma","sympy/simplify/tests/test_simplify.py::test_polarify","sympy/simplify/tests/test_simplify.py::test_unpolarify","sympy/simplify/tests/test_simplify.py::test_issue_6097","sympy/simplify/tests/test_simplify.py::test_signsimp","sympy/simplify/tests/test_simplify.py::test_besselsimp","sympy/simplify/tests/test_simplify.py::test_Piecewise","sympy/simplify/tests/test_simplify.py::test_polymorphism","sympy/simplify/tests/test_simplify.py::test_issue_from_PR1599","sympy/simplify/tests/test_simplify.py::test_issue_6811","sympy/simplify/tests/test_simplify.py::test_issue_6920","sympy/simplify/tests/test_simplify.py::test_issue_7001","sympy/simplify/tests/test_simplify.py::test_exptrigsimp","sympy/simplify/tests/test_simplify.py::test_issue_2827_trigsimp_methods","sympy/simplify/tests/test_simplify.py::test_powsimp_on_numbers","sympy/simplify/tests/test_simplify.py::test_inequality_no_auto_simplify","sympy/simplify/tests/test_simplify.py::test_issue_9324_simplify","sympy/simplify/tests/test_simplify.py::test_issue_9324_powsimp_on_matrix_symbol","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_linear","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/integrals/tests/test_integrals.py::test_improper_integral\",\n \"sympy/integrals/tests/test_integrals.py::test_constructor\",\n \"sympy/integrals/tests/test_integrals.py::test_basics\",\n \"sympy/integrals/tests/test_integrals.py::test_basics_multiple\",\n \"sympy/integrals/tests/test_integrals.py::test_conjugate_transpose\",\n \"sympy/integrals/tests/test_integrals.py::test_integration\",\n \"sympy/integrals/tests/test_integrals.py::test_multiple_integration\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_3532\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_3560\",\n \"sympy/integrals/tests/test_integrals.py::test_integrate_poly\",\n \"sympy/integrals/tests/test_integrals.py::test_integrate_poly_defined\",\n \"sympy/integrals/tests/test_integrals.py::test_integrate_omit_var\",\n \"sympy/integrals/tests/test_integrals.py::test_integrate_poly_accurately\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_3635\",\n \"sympy/integrals/tests/test_integrals.py::test_integrate_linearterm_pow\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_3618\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_3623\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_3664\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_3679\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_3686\",\n \"sympy/integrals/tests/test_integrals.py::test_integrate_units\",\n \"sympy/integrals/tests/test_integrals.py::test_transcendental_functions\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_3740\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_3788\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_3952\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4516\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_7450\",\n \"sympy/integrals/tests/test_integrals.py::test_matrices\",\n \"sympy/integrals/tests/test_integrals.py::test_integrate_functions\",\n \"sympy/integrals/tests/test_integrals.py::test_integrate_derivatives\",\n \"sympy/integrals/tests/test_integrals.py::test_transform\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4052\",\n \"sympy/integrals/tests/test_integrals.py::test_evalf_integrals\",\n \"sympy/integrals/tests/test_integrals.py::test_evalf_issue_939\",\n \"sympy/integrals/tests/test_integrals.py::test_integrate_DiracDelta\",\n \"sympy/integrals/tests/test_integrals.py::test_integrate_returns_piecewise\",\n \"sympy/integrals/tests/test_integrals.py::test_subs1\",\n \"sympy/integrals/tests/test_integrals.py::test_subs2\",\n \"sympy/integrals/tests/test_integrals.py::test_subs3\",\n \"sympy/integrals/tests/test_integrals.py::test_subs4\",\n \"sympy/integrals/tests/test_integrals.py::test_subs5\",\n \"sympy/integrals/tests/test_integrals.py::test_subs6\",\n \"sympy/integrals/tests/test_integrals.py::test_subs7\",\n \"sympy/integrals/tests/test_integrals.py::test_expand\",\n \"sympy/integrals/tests/test_integrals.py::test_integration_variable\",\n \"sympy/integrals/tests/test_integrals.py::test_expand_integral\",\n \"sympy/integrals/tests/test_integrals.py::test_as_sum_midpoint1\",\n \"sympy/integrals/tests/test_integrals.py::test_as_sum_midpoint2\",\n \"sympy/integrals/tests/test_integrals.py::test_as_sum_left\",\n \"sympy/integrals/tests/test_integrals.py::test_as_sum_right\",\n \"sympy/integrals/tests/test_integrals.py::test_as_sum_raises\",\n \"sympy/integrals/tests/test_integrals.py::test_nested_doit\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4665\",\n \"sympy/integrals/tests/test_integrals.py::test_integral_reconstruct\",\n \"sympy/integrals/tests/test_integrals.py::test_doit_integrals\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4884\",\n \"sympy/integrals/tests/test_integrals.py::test_is_number\",\n \"sympy/integrals/tests/test_integrals.py::test_symbols\",\n \"sympy/integrals/tests/test_integrals.py::test_is_zero\",\n \"sympy/integrals/tests/test_integrals.py::test_series\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4403\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4403_2\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4100\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_5167\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4890\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4376\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4517\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4527\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4199\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_3940\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_5413\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4892a\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4892b\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_5178\",\n \"sympy/integrals/tests/test_integrals.py::test_integrate_series\",\n \"sympy/integrals/tests/test_integrals.py::test_atom_bug\",\n \"sympy/integrals/tests/test_integrals.py::test_limit_bug\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4703\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_1888\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_3558\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4422\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4493\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4737\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4992\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4487\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4400\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_6253\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4153\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4326\",\n \"sympy/integrals/tests/test_integrals.py::test_powers\",\n \"sympy/integrals/tests/test_integrals.py::test_risch_option\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_6828\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4803\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4234\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_4492\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_2708\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_8368\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_8901\",\n \"sympy/integrals/tests/test_integrals.py::test_issue_7130\",\n \"sympy/physics/optics/tests/test_medium.py::test_medium\",\n \"sympy/polys/domains/tests/test_domains.py::test_Domain_unify\",\n \"sympy/polys/domains/tests/test_domains.py::test_Domain_unify_composite\",\n \"sympy/polys/domains/tests/test_domains.py::test_Domain_unify_algebraic\",\n \"sympy/polys/domains/tests/test_domains.py::test_Domain_unify_with_symbols\",\n \"sympy/polys/domains/tests/test_domains.py::test_Domain__contains__\",\n \"sympy/polys/domains/tests/test_domains.py::test_Domain_get_ring\",\n \"sympy/polys/domains/tests/test_domains.py::test_Domain_get_field\",\n \"sympy/polys/domains/tests/test_domains.py::test_Domain_get_exact\",\n \"sympy/polys/domains/tests/test_domains.py::test_Domain_convert\",\n \"sympy/polys/domains/tests/test_domains.py::test_PolynomialRing__init\",\n \"sympy/polys/domains/tests/test_domains.py::test_FractionField__init\",\n \"sympy/polys/domains/tests/test_domains.py::test_inject\",\n \"sympy/polys/domains/tests/test_domains.py::test_Domain_map\",\n \"sympy/polys/domains/tests/test_domains.py::test_Domain___eq__\",\n \"sympy/polys/domains/tests/test_domains.py::test_Domain__algebraic_field\",\n \"sympy/polys/domains/tests/test_domains.py::test_PolynomialRing_from_FractionField\",\n \"sympy/polys/domains/tests/test_domains.py::test_FractionField_from_PolynomialRing\",\n \"sympy/polys/domains/tests/test_domains.py::test_FF_of_type\",\n \"sympy/polys/domains/tests/test_domains.py::test___eq__\",\n \"sympy/polys/domains/tests/test_domains.py::test_RealField_from_sympy\",\n \"sympy/polys/domains/tests/test_domains.py::test_ModularInteger\",\n \"sympy/polys/domains/tests/test_domains.py::test_QQ_int\",\n \"sympy/polys/tests/test_constructor.py::test_construct_domain\",\n \"sympy/polys/tests/test_constructor.py::test_composite_option\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_from_dict\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_from_list\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_from_poly\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_from_expr\",\n \"sympy/polys/tests/test_polytools.py::test_Poly__new__\",\n \"sympy/polys/tests/test_polytools.py::test_Poly__args\",\n \"sympy/polys/tests/test_polytools.py::test_Poly__gens\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_zero\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_one\",\n \"sympy/polys/tests/test_polytools.py::test_Poly__unify\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_free_symbols\",\n \"sympy/polys/tests/test_polytools.py::test_PurePoly_free_symbols\",\n \"sympy/polys/tests/test_polytools.py::test_Poly__eq__\",\n \"sympy/polys/tests/test_polytools.py::test_PurePoly__eq__\",\n \"sympy/polys/tests/test_polytools.py::test_PurePoly_Poly\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_get_domain\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_set_domain\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_get_modulus\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_set_modulus\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_add_ground\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_sub_ground\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_mul_ground\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_quo_ground\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_exquo_ground\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_abs\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_neg\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_add\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_sub\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_mul\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_sqr\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_pow\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_divmod\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_eq_ne\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_nonzero\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_properties\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_is_irreducible\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_subs\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_replace\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_reorder\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_ltrim\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_has_only_gens\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_to_ring\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_to_field\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_to_exact\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_retract\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_slice\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_coeffs\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_monoms\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_terms\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_all_coeffs\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_all_monoms\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_all_terms\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_termwise\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_length\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_as_dict\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_as_expr\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_lift\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_deflate\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_inject\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_eject\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_exclude\",\n \"sympy/polys/tests/test_polytools.py::test_Poly__gen_to_level\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_degree\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_degree_list\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_total_degree\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_homogenize\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_homogeneous_order\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_LC\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_TC\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_EC\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_coeff\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_nth\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_LM\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_LM_custom_order\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_EM\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_LT\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_ET\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_max_norm\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_l1_norm\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_clear_denoms\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_rat_clear_denoms\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_integrate\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_diff\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_eval\",\n \"sympy/polys/tests/test_polytools.py::test_Poly___call__\",\n \"sympy/polys/tests/test_polytools.py::test_parallel_poly_from_expr\",\n \"sympy/polys/tests/test_polytools.py::test_pdiv\",\n \"sympy/polys/tests/test_polytools.py::test_div\",\n \"sympy/polys/tests/test_polytools.py::test_gcdex\",\n \"sympy/polys/tests/test_polytools.py::test_revert\",\n \"sympy/polys/tests/test_polytools.py::test_subresultants\",\n \"sympy/polys/tests/test_polytools.py::test_resultant\",\n \"sympy/polys/tests/test_polytools.py::test_discriminant\",\n \"sympy/polys/tests/test_polytools.py::test_dispersion\",\n \"sympy/polys/tests/test_polytools.py::test_gcd_list\",\n \"sympy/polys/tests/test_polytools.py::test_lcm_list\",\n \"sympy/polys/tests/test_polytools.py::test_gcd\",\n \"sympy/polys/tests/test_polytools.py::test_gcd_numbers_vs_polys\",\n \"sympy/polys/tests/test_polytools.py::test_terms_gcd\",\n \"sympy/polys/tests/test_polytools.py::test_trunc\",\n \"sympy/polys/tests/test_polytools.py::test_monic\",\n \"sympy/polys/tests/test_polytools.py::test_content\",\n \"sympy/polys/tests/test_polytools.py::test_primitive\",\n \"sympy/polys/tests/test_polytools.py::test_compose\",\n \"sympy/polys/tests/test_polytools.py::test_shift\",\n \"sympy/polys/tests/test_polytools.py::test_sturm\",\n \"sympy/polys/tests/test_polytools.py::test_gff\",\n \"sympy/polys/tests/test_polytools.py::test_sqf_norm\",\n \"sympy/polys/tests/test_polytools.py::test_sqf\",\n \"sympy/polys/tests/test_polytools.py::test_factor\",\n \"sympy/polys/tests/test_polytools.py::test_factor_large\",\n \"sympy/polys/tests/test_polytools.py::test_intervals\",\n \"sympy/polys/tests/test_polytools.py::test_refine_root\",\n \"sympy/polys/tests/test_polytools.py::test_count_roots\",\n \"sympy/polys/tests/test_polytools.py::test_Poly_root\",\n \"sympy/polys/tests/test_polytools.py::test_real_roots\",\n \"sympy/polys/tests/test_polytools.py::test_all_roots\",\n \"sympy/polys/tests/test_polytools.py::test_nroots\",\n \"sympy/polys/tests/test_polytools.py::test_ground_roots\",\n \"sympy/polys/tests/test_polytools.py::test_nth_power_roots_poly\",\n \"sympy/polys/tests/test_polytools.py::test_torational_factor_list\",\n \"sympy/polys/tests/test_polytools.py::test_cancel\",\n \"sympy/polys/tests/test_polytools.py::test_reduced\",\n \"sympy/polys/tests/test_polytools.py::test_groebner\",\n \"sympy/polys/tests/test_polytools.py::test_fglm\",\n \"sympy/polys/tests/test_polytools.py::test_is_zero_dimensional\",\n \"sympy/polys/tests/test_polytools.py::test_GroebnerBasis\",\n \"sympy/polys/tests/test_polytools.py::test_poly\",\n \"sympy/polys/tests/test_polytools.py::test_keep_coeff\",\n \"sympy/polys/tests/test_polytools.py::test_noncommutative\",\n \"sympy/polys/tests/test_polytools.py::test_to_rational_coeffs\",\n \"sympy/simplify/tests/test_simplify.py::test_ratsimp\",\n \"sympy/simplify/tests/test_simplify.py::test_ratsimpmodprime\",\n \"sympy/simplify/tests/test_simplify.py::test_trigsimp1\",\n \"sympy/simplify/tests/test_simplify.py::test_trigsimp1a\",\n \"sympy/simplify/tests/test_simplify.py::test_trigsimp2\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_4373\",\n \"sympy/simplify/tests/test_simplify.py::test_trigsimp3\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_4661\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_4494\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_5948\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_4775\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_4280\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_3210\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_7263\",\n \"sympy/simplify/tests/test_simplify.py::test_trigsimp_issues\",\n \"sympy/simplify/tests/test_simplify.py::test_trigsimp_issue_2515\",\n \"sympy/simplify/tests/test_simplify.py::test_trigsimp_issue_3826\",\n \"sympy/simplify/tests/test_simplify.py::test_trigsimp_issue_4032\",\n \"sympy/simplify/tests/test_simplify.py::test_trigsimp_issue_7761\",\n \"sympy/simplify/tests/test_simplify.py::test_trigsimp_noncommutative\",\n \"sympy/simplify/tests/test_simplify.py::test_hyperbolic_simp\",\n \"sympy/simplify/tests/test_simplify.py::test_trigsimp_groebner\",\n \"sympy/simplify/tests/test_simplify.py::test_simplify_expr\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_3557\",\n \"sympy/simplify/tests/test_simplify.py::test_simplify_other\",\n \"sympy/simplify/tests/test_simplify.py::test_simplify_complex\",\n \"sympy/simplify/tests/test_simplify.py::test_simplify_ratio\",\n \"sympy/simplify/tests/test_simplify.py::test_simplify_measure\",\n \"sympy/simplify/tests/test_simplify.py::test_simplify_issue_1308\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_5652\",\n \"sympy/simplify/tests/test_simplify.py::test_simplify_fail1\",\n \"sympy/simplify/tests/test_simplify.py::test_fraction\",\n \"sympy/simplify/tests/test_simplify.py::test_powsimp\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_6367\",\n \"sympy/simplify/tests/test_simplify.py::test_powsimp_negated_base\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_6440\",\n \"sympy/simplify/tests/test_simplify.py::test_powsimp_polar\",\n \"sympy/simplify/tests/test_simplify.py::test_powsimp_nc\",\n \"sympy/simplify/tests/test_simplify.py::test_nthroot\",\n \"sympy/simplify/tests/test_simplify.py::test_nthroot1\",\n \"sympy/simplify/tests/test_simplify.py::test_collect_1\",\n \"sympy/simplify/tests/test_simplify.py::test_collect_2\",\n \"sympy/simplify/tests/test_simplify.py::test_collect_3\",\n \"sympy/simplify/tests/test_simplify.py::test_collect_4\",\n \"sympy/simplify/tests/test_simplify.py::test_collect_5\",\n \"sympy/simplify/tests/test_simplify.py::test_collect_D\",\n \"sympy/simplify/tests/test_simplify.py::test_collect_D_0\",\n \"sympy/simplify/tests/test_simplify.py::test_collect_Wild\",\n \"sympy/simplify/tests/test_simplify.py::test_collect_func\",\n \"sympy/simplify/tests/test_simplify.py::test_collect_order\",\n \"sympy/simplify/tests/test_simplify.py::test_rcollect\",\n \"sympy/simplify/tests/test_simplify.py::test_separatevars\",\n \"sympy/simplify/tests/test_simplify.py::test_separatevars_advanced_factor\",\n \"sympy/simplify/tests/test_simplify.py::test_hypersimp\",\n \"sympy/simplify/tests/test_simplify.py::test_nsimplify\",\n \"sympy/simplify/tests/test_simplify.py::test_extract_minus_sign\",\n \"sympy/simplify/tests/test_simplify.py::test_diff\",\n \"sympy/simplify/tests/test_simplify.py::test_logcombine_1\",\n \"sympy/simplify/tests/test_simplify.py::test_logcombine_complex_coeff\",\n \"sympy/simplify/tests/test_simplify.py::test_posify\",\n \"sympy/simplify/tests/test_simplify.py::test_powdenest\",\n \"sympy/simplify/tests/test_simplify.py::test_powdenest_polar\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_5805\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_4194\",\n \"sympy/simplify/tests/test_simplify.py::test_combsimp\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_5615\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_5728\",\n \"sympy/simplify/tests/test_simplify.py::test_as_content_primitive\",\n \"sympy/simplify/tests/test_simplify.py::test_radsimp\",\n \"sympy/simplify/tests/test_simplify.py::test_radsimp_issue_3214\",\n \"sympy/simplify/tests/test_simplify.py::test_collect_const\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_5933\",\n \"sympy/simplify/tests/test_simplify.py::test_fraction_expand\",\n \"sympy/simplify/tests/test_simplify.py::test_combsimp_gamma\",\n \"sympy/simplify/tests/test_simplify.py::test_polarify\",\n \"sympy/simplify/tests/test_simplify.py::test_unpolarify\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_6097\",\n \"sympy/simplify/tests/test_simplify.py::test_signsimp\",\n \"sympy/simplify/tests/test_simplify.py::test_besselsimp\",\n \"sympy/simplify/tests/test_simplify.py::test_Piecewise\",\n \"sympy/simplify/tests/test_simplify.py::test_polymorphism\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_from_PR1599\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_6811\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_6920\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_7001\",\n \"sympy/simplify/tests/test_simplify.py::test_exptrigsimp\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_2827_trigsimp_methods\",\n \"sympy/simplify/tests/test_simplify.py::test_powsimp_on_numbers\",\n \"sympy/simplify/tests/test_simplify.py::test_inequality_no_auto_simplify\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_9324_simplify\",\n \"sympy/simplify/tests/test_simplify.py::test_issue_9324_powsimp_on_matrix_symbol\",\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_linear\",\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":141,"string":"141"}}},{"rowIdx":142,"cells":{"instance_id":{"kind":"string","value":"pysmt__pysmt-114"},"base_commit":{"kind":"string","value":"4fd83af49e7784a874f57620809404d530929366"},"created_at":{"kind":"string","value":"2015-05-17 17:12:04"},"environment_setup_commit":{"kind":"string","value":"689cc79ff2731837903b14daa266afc99b4feb21"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/pysmt/simplifier.py b/pysmt/simplifier.py\nindex 418bc0d..3303577 100644\n--- a/pysmt/simplifier.py\n+++ b/pysmt/simplifier.py\n@@ -445,7 +445,7 @@ class Simplifier(walkers.DagWalker):\n res = args[0].bv_unsigned_value() // args[1].bv_unsigned_value()\n res = res % 2**formula.bv_width()\n return self.manager.BV(res, width=formula.bv_width())\n- return self.manager.BVUdiv(*args)\n+ return self.manager.BVUDiv(*args)\n \n def walk_bv_urem(self, formula, args):\n if args[0].is_bv_constant() and args[1].is_bv_constant:\n@@ -454,7 +454,7 @@ class Simplifier(walkers.DagWalker):\n else:\n res = args[0].bv_unsigned_value() % args[1].bv_unsigned_value()\n return self.manager.BV(res, width=formula.bv_width())\n- return self.manager.BVUrem(*args)\n+ return self.manager.BVURem(*args)\n \n def walk_bv_ult(self, formula, args):\n if args[0].is_bv_constant() and args[1].is_bv_constant:\n@@ -506,7 +506,7 @@ class Simplifier(walkers.DagWalker):\n filler = bitstr[0]\n res = filler*formula.bv_extend_step() + bitstr\n return self.manager.BV(res, width=formula.bv_width())\n- return self.manager.BVSext(args[0], formula.bv_extend_step())\n+ return self.manager.BVSExt(args[0], formula.bv_extend_step())\n \n def walk_bv_zext(self, formula, args):\n if args[0].is_bv_constant():\n@@ -517,7 +517,7 @@ class Simplifier(walkers.DagWalker):\n return self.manager.BVZExt(args[0], formula.bv_extend_step())\n \n def walk_bv_concat(self, formula, args):\n- if args[0].is_bv_constant() and args[1].is_bv_constant:\n+ if args[0].is_bv_constant() and args[1].is_bv_constant():\n w0 = args[0].bv_width()\n w1 = args[1].bv_width()\n res = (2**w1) * args[0].bv_unsigned_value() + \\\n@@ -526,14 +526,14 @@ class Simplifier(walkers.DagWalker):\n return self.manager.BVConcat(*args)\n \n def walk_bv_lshl(self, formula, args):\n- if args[0].is_bv_constant() and args[1].is_bv_constant:\n+ if args[0].is_bv_constant() and args[1].is_bv_constant():\n res = args[0].bv_unsigned_value() << args[1].bv_unsigned_value()\n w = args[0].bv_width()\n return self.manager.BV(res % (2 ** w), w)\n return self.manager.BVLShl(*args)\n \n def walk_bv_lshr(self, formula, args):\n- if args[0].is_bv_constant() and args[1].is_bv_constant:\n+ if args[0].is_bv_constant() and args[1].is_bv_constant():\n res = args[0].bv_unsigned_value() >> args[1].bv_unsigned_value()\n w = args[0].bv_width()\n return self.manager.BV(res % (2 ** w), w)\ndiff --git a/pysmt/walkers/identitydag.py b/pysmt/walkers/identitydag.py\nindex 1fc1915..b422926 100644\n--- a/pysmt/walkers/identitydag.py\n+++ b/pysmt/walkers/identitydag.py\n@@ -31,72 +31,135 @@ class IdentityDagWalker(DagWalker):\n DagWalker.__init__(self,\n env=env,\n invalidate_memoization=invalidate_memoization)\n+ self.mgr = self.env.formula_manager\n \n def walk_symbol(self, formula, args):\n- return self.env.formula_manager.Symbol(formula.symbol_name(),\n+ return self.mgr.Symbol(formula.symbol_name(),\n formula.symbol_type())\n \n def walk_real_constant(self, formula, args):\n- return self.env.formula_manager.Real(formula.constant_value())\n+ return self.mgr.Real(formula.constant_value())\n \n def walk_int_constant(self, formula, args):\n- return self.env.formula_manager.Int(formula.constant_value())\n+ return self.mgr.Int(formula.constant_value())\n \n def walk_bool_constant(self, formula, args):\n- return self.env.formula_manager.Bool(formula.constant_value())\n+ return self.mgr.Bool(formula.constant_value())\n \n def walk_and(self, formula, args):\n- return self.env.formula_manager.And(args)\n+ return self.mgr.And(args)\n \n def walk_or(self, formula, args):\n- return self.env.formula_manager.Or(args)\n+ return self.mgr.Or(args)\n \n def walk_not(self, formula, args):\n- return self.env.formula_manager.Not(args[0])\n+ return self.mgr.Not(*args)\n \n def walk_iff(self, formula, args):\n- return self.env.formula_manager.Iff(args[0], args[1])\n+ return self.mgr.Iff(*args)\n \n def walk_implies(self, formula, args):\n- return self.env.formula_manager.Implies(args[0], args[1])\n+ return self.mgr.Implies(*args)\n \n def walk_equals(self, formula, args):\n- return self.env.formula_manager.Equals(args[0], args[1])\n+ return self.mgr.Equals(*args)\n \n def walk_ite(self, formula, args):\n- return self.env.formula_manager.Ite(args[0], args[1], args[2])\n+ return self.mgr.Ite(*args)\n \n def walk_ge(self, formula, args):\n- return self.env.formula_manager.GE(args[0], args[1])\n+ return self.mgr.GE(*args)\n \n def walk_le(self, formula, args):\n- return self.env.formula_manager.LE(args[0], args[1])\n+ return self.mgr.LE(*args)\n \n def walk_gt(self, formula, args):\n- return self.env.formula_manager.GT(args[0], args[1])\n+ return self.mgr.GT(*args)\n \n def walk_lt(self, formula, args):\n- return self.env.formula_manager.LT(args[0], args[1])\n+ return self.mgr.LT(*args)\n \n def walk_forall(self, formula, args):\n qvars = [self.walk_symbol(v, None) for v in formula.quantifier_vars()]\n- return self.env.formula_manager.ForAll(qvars,args[0])\n+ return self.mgr.ForAll(qvars, *args)\n \n def walk_exists(self, formula, args):\n qvars = [self.walk_symbol(v, None) for v in formula.quantifier_vars()]\n- return self.env.formula_manager.Exists(qvars,args[0])\n+ return self.mgr.Exists(qvars, *args)\n \n def walk_plus(self, formula, args):\n- return self.env.formula_manager.Plus(args)\n+ return self.mgr.Plus(args)\n \n def walk_times(self, formula, args):\n- return self.env.formula_manager.Times(args[0], args[1])\n+ return self.mgr.Times(*args)\n \n def walk_minus(self, formula, args):\n- return self.env.formula_manager.Minus(args[0], args[1])\n+ return self.mgr.Minus(*args)\n \n def walk_function(self, formula, args):\n- return self.env.formula_manager.Function(formula.function_name(), args)\n+ return self.mgr.Function(formula.function_name(), args)\n \n def walk_toreal(self, formula, args):\n- return self.env.formula_manager.ToReal(args[0])\n+ return self.mgr.ToReal(*args)\n+\n+ def walk_bv_constant(self, formula, args):\n+ return self.mgr.BV(formula.constant_value(), formula.bv_width())\n+\n+ def walk_bv_and(self, formula, args):\n+ return self.mgr.BVAnd(*args)\n+\n+ def walk_bv_not(self, formula, args):\n+ return self.mgr.BVNot(*args)\n+\n+ def walk_bv_neg(self, formula, args):\n+ return self.mgr.BVNeg(*args)\n+\n+ def walk_bv_or(self, formula, args):\n+ return self.mgr.BVOr(*args)\n+\n+ def walk_bv_xor(self, formula, args):\n+ return self.mgr.BVXor(*args)\n+\n+ def walk_bv_add(self, formula, args):\n+ return self.mgr.BVAdd(*args)\n+\n+ def walk_bv_mul(self, formula, args):\n+ return self.mgr.BVMul(*args)\n+\n+ def walk_bv_udiv(self, formula, args):\n+ return self.mgr.BVUDiv(*args)\n+\n+ def walk_bv_urem(self, formula, args):\n+ return self.mgr.BVURem(*args)\n+\n+ def walk_bv_ult(self, formula, args):\n+ return self.mgr.BVULT(*args)\n+\n+ def walk_bv_ule(self, formula, args):\n+ return self.mgr.BVULE(*args)\n+\n+ def walk_bv_extract(self, formula, args):\n+ return self.mgr.BVExtract(args[0],\n+ start=formula.bv_extract_start(),\n+ end=formula.bv_extract_end())\n+\n+ def walk_bv_ror(self, formula, args):\n+ return self.mgr.BVRor(args[0], formula.bv_rotation_step())\n+\n+ def walk_bv_rol(self, formula, args):\n+ return self.mgr.BVRol(args[0], formula.bv_rotation_step())\n+\n+ def walk_bv_sext(self, formula, args):\n+ return self.mgr.BVSExt(args[0], formula.bv_extend_step())\n+\n+ def walk_bv_zext(self, formula, args):\n+ return self.mgr.BVZExt(args[0], formula.bv_extend_step())\n+\n+ def walk_bv_concat(self, formula, args):\n+ return self.mgr.BVConcat(*args)\n+\n+ def walk_bv_lshl(self, formula, args):\n+ return self.mgr.BVLShl(*args)\n+\n+ def walk_bv_lshr(self, formula, args):\n+ return self.mgr.BVLShr(*args)\n"},"problem_statement":{"kind":"string","value":"IdentityDagWalker lacks BV support"},"repo":{"kind":"string","value":"pysmt/pysmt"},"test_patch":{"kind":"string","value":"diff --git a/pysmt/test/test_walkers.py b/pysmt/test/test_walkers.py\nindex 22a96c7..6defb39 100644\n--- a/pysmt/test/test_walkers.py\n+++ b/pysmt/test/test_walkers.py\n@@ -25,6 +25,7 @@ from pysmt.typing import INT, BOOL, REAL, FunctionType\n from pysmt.walkers import TreeWalker, DagWalker, IdentityDagWalker\n from pysmt.test import TestCase\n from pysmt.formula import FormulaManager\n+from pysmt.test.examples import get_example_formulae\n \n from six.moves import xrange\n \n@@ -100,7 +101,7 @@ class TestWalkers(TestCase):\n self.assertFalse(tree_walker.is_complete())\n \n \n- def test_identity_walker(self):\n+ def test_identity_walker_simple(self):\n \n def walk_and_to_or(formula, args, **kwargs):\n return Or(args)\n@@ -125,6 +126,11 @@ class TestWalkers(TestCase):\n result = walker.walk(alternation)\n self.assertEqual(result, expected)\n \n+ def test_identity_dag_walker(self):\n+ idw = IdentityDagWalker()\n+ for (f, _, _, _) in get_example_formulae():\n+ rebuilt = idw.walk(f)\n+ self.assertTrue(rebuilt == f, \"Rebuilt formula is not identical\")\n \n def test_substitution_on_quantifiers(self):\n x, y = FreshSymbol(), FreshSymbol()\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\": 1,\n \"issue_text_score\": 3,\n \"test_score\": 0\n },\n \"num_modified_files\": 2\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 .[dev]\",\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 gcc\"\n ],\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":"exceptiongroup==1.2.2\niniconfig==2.1.0\nnose==1.3.7\npackaging==24.2\npluggy==1.5.0\n-e git+https://github.com/pysmt/pysmt.git@4fd83af49e7784a874f57620809404d530929366#egg=PySMT\npytest==8.3.5\nsix==1.17.0\ntomli==2.2.1\n"},"environment":{"kind":"string","value":"name: pysmt\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 - nose==1.3.7\n - packaging==24.2\n - pluggy==1.5.0\n - pytest==8.3.5\n - six==1.17.0\n - tomli==2.2.1\nprefix: /opt/conda/envs/pysmt\n"},"FAIL_TO_PASS":{"kind":"list like","value":["pysmt/test/test_walkers.py::TestWalkers::test_identity_dag_walker"],"string":"[\n \"pysmt/test/test_walkers.py::TestWalkers::test_identity_dag_walker\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"PASS_TO_PASS":{"kind":"list like","value":["pysmt/test/test_walkers.py::TestWalkers::test_identity_walker_simple","pysmt/test/test_walkers.py::TestWalkers::test_iterative_get_free_variables","pysmt/test/test_walkers.py::TestWalkers::test_subst","pysmt/test/test_walkers.py::TestWalkers::test_substituter_conditions","pysmt/test/test_walkers.py::TestWalkers::test_substitution_complex","pysmt/test/test_walkers.py::TestWalkers::test_substitution_on_functions","pysmt/test/test_walkers.py::TestWalkers::test_substitution_on_quantifiers","pysmt/test/test_walkers.py::TestWalkers::test_substitution_term","pysmt/test/test_walkers.py::TestWalkers::test_undefined_node","pysmt/test/test_walkers.py::TestWalkers::test_walker_is_complete"],"string":"[\n \"pysmt/test/test_walkers.py::TestWalkers::test_identity_walker_simple\",\n \"pysmt/test/test_walkers.py::TestWalkers::test_iterative_get_free_variables\",\n \"pysmt/test/test_walkers.py::TestWalkers::test_subst\",\n \"pysmt/test/test_walkers.py::TestWalkers::test_substituter_conditions\",\n \"pysmt/test/test_walkers.py::TestWalkers::test_substitution_complex\",\n \"pysmt/test/test_walkers.py::TestWalkers::test_substitution_on_functions\",\n \"pysmt/test/test_walkers.py::TestWalkers::test_substitution_on_quantifiers\",\n \"pysmt/test/test_walkers.py::TestWalkers::test_substitution_term\",\n \"pysmt/test/test_walkers.py::TestWalkers::test_undefined_node\",\n \"pysmt/test/test_walkers.py::TestWalkers::test_walker_is_complete\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"Apache License 2.0"},"__index_level_0__":{"kind":"number","value":142,"string":"142"}}},{"rowIdx":143,"cells":{"instance_id":{"kind":"string","value":"pre-commit__pre-commit-231"},"base_commit":{"kind":"string","value":"9515ca06378d74f1e4f8013db2b5230c1f15edaa"},"created_at":{"kind":"string","value":"2015-05-18 19:48:14"},"environment_setup_commit":{"kind":"string","value":"9515ca06378d74f1e4f8013db2b5230c1f15edaa"},"hints_text":{"kind":"string","value":"asottile: @Lucas-C look correct?\ncoveralls: \n[![Coverage Status](https://coveralls.io/builds/2591860/badge)](https://coveralls.io/builds/2591860)\n\nCoverage decreased (-0.04%) to 99.96% when pulling **b140f92cd7e20368b27d19ea01227402e71c294a on no_defaults_in_config_227** into **9515ca06378d74f1e4f8013db2b5230c1f15edaa on master**.\n"},"patch":{"kind":"string","value":"diff --git a/pre_commit/clientlib/validate_config.py b/pre_commit/clientlib/validate_config.py\nindex bdd0e2c..e4a90a6 100644\n--- a/pre_commit/clientlib/validate_config.py\n+++ b/pre_commit/clientlib/validate_config.py\n@@ -33,7 +33,7 @@ CONFIG_JSON_SCHEMA = {\n 'properties': {\n 'id': {'type': 'string'},\n 'files': {'type': 'string'},\n- 'exclude': {'type': 'string', 'default': '^$'},\n+ 'exclude': {'type': 'string'},\n 'language_version': {'type': 'string'},\n 'args': {\n 'type': 'array',\n@@ -71,7 +71,7 @@ def validate_config_extra(config):\n )\n for hook in repo['hooks']:\n try_regex(repo, hook['id'], hook.get('files', ''), 'files')\n- try_regex(repo, hook['id'], hook['exclude'], 'exclude')\n+ try_regex(repo, hook['id'], hook.get('exclude', ''), 'exclude')\n \n \n load_config = get_validator(\ndiff --git a/pre_commit/clientlib/validate_manifest.py b/pre_commit/clientlib/validate_manifest.py\nindex 283d7c4..4295014 100644\n--- a/pre_commit/clientlib/validate_manifest.py\n+++ b/pre_commit/clientlib/validate_manifest.py\n@@ -20,6 +20,7 @@ MANIFEST_JSON_SCHEMA = {\n 'name': {'type': 'string'},\n 'description': {'type': 'string', 'default': ''},\n 'entry': {'type': 'string'},\n+ 'exclude': {'type': 'string', 'default': '^$'},\n 'language': {'type': 'string'},\n 'language_version': {'type': 'string', 'default': 'default'},\n 'files': {'type': 'string'},\n@@ -52,8 +53,14 @@ def validate_files(hook_config):\n if not is_regex_valid(hook_config['files']):\n raise InvalidManifestError(\n 'Invalid files regex at {0}: {1}'.format(\n- hook_config['id'],\n- hook_config['files'],\n+ hook_config['id'], hook_config['files'],\n+ )\n+ )\n+\n+ if not is_regex_valid(hook_config.get('exclude', '')):\n+ raise InvalidManifestError(\n+ 'Invalid exclude regex at {0}: {1}'.format(\n+ hook_config['id'], hook_config['exclude'],\n )\n )\n \n"},"problem_statement":{"kind":"string","value":"Bug: base manifest value for 'exclude' is always ignored\nI stumbled upon this bug while working on #226: the culprit is [`Repository.hooks`](https://github.com/pre-commit/pre-commit/blob/master/pre_commit/repository.py#L48).\r\n\r\nA quick fix for this would be to simply remove the default value from `pre_commit/clientlib/validate_config.py`, but the root cause is that any default value defined for a field in this file will make the corresponding manifest field useless.\r\n\r\nBasically here is what happens in `Repository.hooks`:\r\n- all the hooks defined in the current repository are enumerated\r\n- at this stage, a `hook` is a dict closely matching the Yaml the config file content, **plus** default values for fields not defined in the Yaml but having a JSON schema 'default'\r\n- when doing the dict merge, **every** (key,value) pair in `hook` overrides the corresponding manifest entry. This includes default config value like `exclude: '$^'` overriding a base manifest value like `exclude: '.bak$'`\r\n\r\nHence I suggest either adding a test ensuring there will never be any 'default' defined in `CONFIG_JSON_SCHEMA`, or improving the merge logic."},"repo":{"kind":"string","value":"pre-commit/pre-commit"},"test_patch":{"kind":"string","value":"diff --git a/tests/clientlib/validate_config_test.py b/tests/clientlib/validate_config_test.py\nindex c507f28..b474f1b 100644\n--- a/tests/clientlib/validate_config_test.py\n+++ b/tests/clientlib/validate_config_test.py\n@@ -174,3 +174,23 @@ def test_config_with_local_hooks_definition_passes(config_obj):\n jsonschema.validate(config_obj, CONFIG_JSON_SCHEMA)\n config = apply_defaults(config_obj, CONFIG_JSON_SCHEMA)\n validate_config_extra(config)\n+\n+\n+def test_does_not_contain_defaults():\n+ \"\"\"Due to the way our merging works, if this schema has any defaults they\n+ will clobber potentially useful values in the backing manifest. #227\n+ \"\"\"\n+ to_process = [(CONFIG_JSON_SCHEMA, ())]\n+ while to_process:\n+ schema, route = to_process.pop()\n+ # Check this value\n+ if isinstance(schema, dict):\n+ if 'default' in schema:\n+ raise AssertionError(\n+ 'Unexpected default in schema at {0}'.format(\n+ ' => '.join(route),\n+ )\n+ )\n+\n+ for key, value in schema.items():\n+ to_process.append((value, route + (key,)))\ndiff --git a/tests/clientlib/validate_manifest_test.py b/tests/clientlib/validate_manifest_test.py\nindex 5e5690e..937f432 100644\n--- a/tests/clientlib/validate_manifest_test.py\n+++ b/tests/clientlib/validate_manifest_test.py\n@@ -46,6 +46,9 @@ def test_additional_manifest_check_passing(obj):\n [{'id': 'a', 'language': 'not a language', 'files': ''}],\n [{'id': 'a', 'language': 'python3', 'files': ''}],\n [{'id': 'a', 'language': 'python', 'files': 'invalid regex('}],\n+ [{'id': 'a', 'language': 'not a language', 'files': ''}],\n+ [{'id': 'a', 'language': 'python3', 'files': ''}],\n+ [{'id': 'a', 'language': 'python', 'files': '', 'exclude': '('}],\n ),\n )\n def test_additional_manifest_failing(obj):\ndiff --git a/tests/manifest_test.py b/tests/manifest_test.py\nindex ba30d42..39ecc74 100644\n--- a/tests/manifest_test.py\n+++ b/tests/manifest_test.py\n@@ -22,6 +22,7 @@ def test_manifest_contents(manifest):\n 'args': [],\n 'description': '',\n 'entry': 'bin/hook.sh',\n+ 'exclude': '^$',\n 'expected_return_value': 0,\n 'files': '',\n 'id': 'bash_hook',\n@@ -36,6 +37,7 @@ def test_hooks(manifest):\n 'args': [],\n 'description': '',\n 'entry': 'bin/hook.sh',\n+ 'exclude': '^$',\n 'expected_return_value': 0,\n 'files': '',\n 'id': 'bash_hook',\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\": 1,\n \"test_score\": 0\n },\n \"num_modified_files\": 2\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 .[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-dev.txt\"\n ],\n \"test_cmd\": \"pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning\"\n}"},"requirements":{"kind":"string","value":"aspy.yaml==1.3.0\nastroid==1.3.2\nattrs==22.2.0\ncached-property==1.5.2\ncertifi==2021.5.30\ncoverage==6.2\ndistlib==0.3.9\nfilelock==3.4.1\nflake8==5.0.4\nimportlib-metadata==4.8.3\nimportlib-resources==5.4.0\niniconfig==1.1.1\njsonschema==3.2.0\nlogilab-common==1.9.7\nmccabe==0.7.0\nmock==5.2.0\nmypy-extensions==1.0.0\nnodeenv==1.6.0\nordereddict==1.1\npackaging==21.3\nplatformdirs==2.4.0\npluggy==1.0.0\n-e git+https://github.com/pre-commit/pre-commit.git@9515ca06378d74f1e4f8013db2b5230c1f15edaa#egg=pre_commit\npy==1.11.0\npycodestyle==2.9.1\npyflakes==2.5.0\npylint==1.3.1\npyparsing==3.1.4\npyrsistent==0.18.0\npytest==7.0.1\nPyYAML==6.0.1\nsimplejson==3.20.1\nsix==1.17.0\ntomli==1.2.3\ntyping_extensions==4.1.1\nvirtualenv==20.17.1\nzipp==3.6.0\n"},"environment":{"kind":"string","value":"name: pre-commit\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 - argparse==1.4.0\n - aspy-yaml==1.3.0\n - astroid==1.3.2\n - attrs==22.2.0\n - cached-property==1.5.2\n - coverage==6.2\n - distlib==0.3.9\n - filelock==3.4.1\n - flake8==5.0.4\n - importlib-metadata==4.8.3\n - importlib-resources==5.4.0\n - iniconfig==1.1.1\n - jsonschema==3.2.0\n - logilab-common==1.9.7\n - mccabe==0.7.0\n - mock==5.2.0\n - mypy-extensions==1.0.0\n - nodeenv==1.6.0\n - ordereddict==1.1\n - packaging==21.3\n - platformdirs==2.4.0\n - pluggy==1.0.0\n - py==1.11.0\n - pycodestyle==2.9.1\n - pyflakes==2.5.0\n - pylint==1.3.1\n - pyparsing==3.1.4\n - pyrsistent==0.18.0\n - pytest==7.0.1\n - pyyaml==6.0.1\n - simplejson==3.20.1\n - six==1.17.0\n - tomli==1.2.3\n - typing-extensions==4.1.1\n - virtualenv==20.17.1\n - zipp==3.6.0\nprefix: /opt/conda/envs/pre-commit\n"},"FAIL_TO_PASS":{"kind":"list like","value":["tests/clientlib/validate_config_test.py::test_does_not_contain_defaults","tests/clientlib/validate_manifest_test.py::test_additional_manifest_failing[obj5]"],"string":"[\n \"tests/clientlib/validate_config_test.py::test_does_not_contain_defaults\",\n \"tests/clientlib/validate_manifest_test.py::test_additional_manifest_failing[obj5]\"\n]"},"FAIL_TO_FAIL":{"kind":"list like","value":["tests/clientlib/validate_config_test.py::test_run[input0-0]","tests/clientlib/validate_config_test.py::test_run[input1-0]","tests/clientlib/validate_manifest_test.py::test_run[input0-0]","tests/clientlib/validate_manifest_test.py::test_run[input1-0]","tests/manifest_test.py::test_manifest_contents","tests/manifest_test.py::test_hooks"],"string":"[\n \"tests/clientlib/validate_config_test.py::test_run[input0-0]\",\n \"tests/clientlib/validate_config_test.py::test_run[input1-0]\",\n \"tests/clientlib/validate_manifest_test.py::test_run[input0-0]\",\n \"tests/clientlib/validate_manifest_test.py::test_run[input1-0]\",\n \"tests/manifest_test.py::test_manifest_contents\",\n \"tests/manifest_test.py::test_hooks\"\n]"},"PASS_TO_PASS":{"kind":"list like","value":["tests/clientlib/validate_config_test.py::test_run[input2-1]","tests/clientlib/validate_config_test.py::test_run[input3-1]","tests/clientlib/validate_config_test.py::test_run[input4-1]","tests/clientlib/validate_config_test.py::test_is_valid_according_to_schema[config_obj0-False]","tests/clientlib/validate_config_test.py::test_is_valid_according_to_schema[config_obj1-True]","tests/clientlib/validate_config_test.py::test_is_valid_according_to_schema[config_obj2-True]","tests/clientlib/validate_config_test.py::test_is_valid_according_to_schema[config_obj3-False]","tests/clientlib/validate_config_test.py::test_config_with_failing_regexes_fails","tests/clientlib/validate_config_test.py::test_config_with_ok_regexes_passes","tests/clientlib/validate_config_test.py::test_config_with_invalid_exclude_regex_fails","tests/clientlib/validate_config_test.py::test_config_with_ok_exclude_regex_passes","tests/clientlib/validate_config_test.py::test_config_with_local_hooks_definition_fails[config_obj0]","tests/clientlib/validate_config_test.py::test_config_with_local_hooks_definition_passes[config_obj0]","tests/clientlib/validate_config_test.py::test_config_with_local_hooks_definition_passes[config_obj1]","tests/clientlib/validate_manifest_test.py::test_run[input2-1]","tests/clientlib/validate_manifest_test.py::test_run[input3-1]","tests/clientlib/validate_manifest_test.py::test_run[input4-1]","tests/clientlib/validate_manifest_test.py::test_additional_manifest_check_raises_for_bad_language","tests/clientlib/validate_manifest_test.py::test_additional_manifest_check_passing[obj0]","tests/clientlib/validate_manifest_test.py::test_additional_manifest_check_passing[obj1]","tests/clientlib/validate_manifest_test.py::test_additional_manifest_failing[obj0]","tests/clientlib/validate_manifest_test.py::test_additional_manifest_failing[obj1]","tests/clientlib/validate_manifest_test.py::test_additional_manifest_failing[obj2]","tests/clientlib/validate_manifest_test.py::test_additional_manifest_failing[obj3]","tests/clientlib/validate_manifest_test.py::test_additional_manifest_failing[obj4]","tests/clientlib/validate_manifest_test.py::test_is_valid_according_to_schema[manifest_obj0-False]","tests/clientlib/validate_manifest_test.py::test_is_valid_according_to_schema[manifest_obj1-True]","tests/clientlib/validate_manifest_test.py::test_is_valid_according_to_schema[manifest_obj2-True]"],"string":"[\n \"tests/clientlib/validate_config_test.py::test_run[input2-1]\",\n \"tests/clientlib/validate_config_test.py::test_run[input3-1]\",\n \"tests/clientlib/validate_config_test.py::test_run[input4-1]\",\n \"tests/clientlib/validate_config_test.py::test_is_valid_according_to_schema[config_obj0-False]\",\n \"tests/clientlib/validate_config_test.py::test_is_valid_according_to_schema[config_obj1-True]\",\n \"tests/clientlib/validate_config_test.py::test_is_valid_according_to_schema[config_obj2-True]\",\n \"tests/clientlib/validate_config_test.py::test_is_valid_according_to_schema[config_obj3-False]\",\n \"tests/clientlib/validate_config_test.py::test_config_with_failing_regexes_fails\",\n \"tests/clientlib/validate_config_test.py::test_config_with_ok_regexes_passes\",\n \"tests/clientlib/validate_config_test.py::test_config_with_invalid_exclude_regex_fails\",\n \"tests/clientlib/validate_config_test.py::test_config_with_ok_exclude_regex_passes\",\n \"tests/clientlib/validate_config_test.py::test_config_with_local_hooks_definition_fails[config_obj0]\",\n \"tests/clientlib/validate_config_test.py::test_config_with_local_hooks_definition_passes[config_obj0]\",\n \"tests/clientlib/validate_config_test.py::test_config_with_local_hooks_definition_passes[config_obj1]\",\n \"tests/clientlib/validate_manifest_test.py::test_run[input2-1]\",\n \"tests/clientlib/validate_manifest_test.py::test_run[input3-1]\",\n \"tests/clientlib/validate_manifest_test.py::test_run[input4-1]\",\n \"tests/clientlib/validate_manifest_test.py::test_additional_manifest_check_raises_for_bad_language\",\n \"tests/clientlib/validate_manifest_test.py::test_additional_manifest_check_passing[obj0]\",\n \"tests/clientlib/validate_manifest_test.py::test_additional_manifest_check_passing[obj1]\",\n \"tests/clientlib/validate_manifest_test.py::test_additional_manifest_failing[obj0]\",\n \"tests/clientlib/validate_manifest_test.py::test_additional_manifest_failing[obj1]\",\n \"tests/clientlib/validate_manifest_test.py::test_additional_manifest_failing[obj2]\",\n \"tests/clientlib/validate_manifest_test.py::test_additional_manifest_failing[obj3]\",\n \"tests/clientlib/validate_manifest_test.py::test_additional_manifest_failing[obj4]\",\n \"tests/clientlib/validate_manifest_test.py::test_is_valid_according_to_schema[manifest_obj0-False]\",\n \"tests/clientlib/validate_manifest_test.py::test_is_valid_according_to_schema[manifest_obj1-True]\",\n \"tests/clientlib/validate_manifest_test.py::test_is_valid_according_to_schema[manifest_obj2-True]\"\n]"},"PASS_TO_FAIL":{"kind":"list like","value":[],"string":"[]"},"license_name":{"kind":"string","value":"MIT License"},"__index_level_0__":{"kind":"number","value":143,"string":"143"}}},{"rowIdx":144,"cells":{"instance_id":{"kind":"string","value":"mne-tools__mne-python-2126"},"base_commit":{"kind":"string","value":"edceb8f38349d6dc0cade1c9f8384cc0707ce3e8"},"created_at":{"kind":"string","value":"2015-05-20 03:39:59"},"environment_setup_commit":{"kind":"string","value":"edceb8f38349d6dc0cade1c9f8384cc0707ce3e8"},"hints_text":{"kind":"string","value":""},"patch":{"kind":"string","value":"diff --git a/.gitignore b/.gitignore\nold mode 100644\nnew mode 100755\nindex a32ce2aea..cdad72a3d\n--- a/.gitignore\n+++ b/.gitignore\n@@ -1,6 +1,5 @@\n *.pyc\n *.pyo\n-*.sh\n *.so\n *.fif\n *.tar.gz\ndiff --git a/Makefile b/Makefile\nindex 7b7102444..484275006 100755\n--- a/Makefile\n+++ b/Makefile\n@@ -108,10 +108,3 @@ manpages:\n \t\t\t>| ../build/manpages/$$f.1; \\\n \tdone\n \n-build-doc-dev:\n-\tcd doc; make clean\n-\tcd doc; DISPLAY=:1.0 xvfb-run -n 1 -s \"-screen 0 1280x1024x24 -noreset -ac +extension GLX +render\" make html_dev\n-\n-build-doc-stable:\n-\tcd doc; make clean\n-\tcd doc; DISPLAY=:1.0 xvfb-run -n 1 -s \"-screen 0 1280x1024x24 -noreset -ac +extension GLX +render\" make html\ndiff --git a/doc/source/_static/navy.css b/doc/source/_static/navy.css\nindex c8419184a..04912f9ad 100755\n--- a/doc/source/_static/navy.css\n+++ b/doc/source/_static/navy.css\n@@ -4,7 +4,7 @@\n */\n \n body {\n- font-family: 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', 'Verdana', sans-serif;\n+ font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', 'Verdana', sans-serif;\n font-size: 14px;\n letter-spacing: -0.01em;\n line-height: 150%;\ndiff --git a/doc/source/_templates/layout.html b/doc/source/_templates/layout.html\nindex 7178e1f11..c71a45092 100755\n--- a/doc/source/_templates/layout.html\n+++ b/doc/source/_templates/layout.html\n@@ -1,9 +1,6 @@\n {% extends \"!layout.html\" %}\n \n {% block extrahead %}\n-\n-\n-\n {% if use_google_analytics|tobool %}\n