{ // 获取包含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+ $parser->parse('

');\n }\n }"},"message":{"kind":"string","value":"Fix \"unable to parse\" test case"},"project":{"kind":"string","value":"andreskrey_readability.php"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"php"}}},{"rowIdx":1162646,"cells":{"hash":{"kind":"string","value":"7911c87c1a9de287d807b65993a4911889cc206f"},"diff":{"kind":"string","value":"diff --git a/db/doc.go b/db/doc.go\nindex .. 100644\n--- a/db/doc.go\n+++ b/db/doc.go\n@@ -12,7 +12,7 @@\n // See the License for the specific language governing permissions and\n // limitations under the License.\n \n-// Package db defines common Data Broker types, and it the parent package\n-// containing Data Broker client implementations for various key-value and\n-// SQL data stores.\n+// Package db defines the common Data Broker types, and it is the parent\n+// package for Data Broker client implementations for various key-value\n+// and SQL data stores.\n package db\ndiff --git a/httpmux/doc.go b/httpmux/doc.go\nindex .. 100644\n--- a/httpmux/doc.go\n+++ b/httpmux/doc.go\n@@ -12,6 +12,7 @@\n // See the License for the specific language governing permissions and\n // limitations under the License.\n \n-// Package httpmux provides a plugin that allows app plugins to\n-// register and afterwords handle http requests (usually REST based).\n+// Package httpmux provides an HTTP server to app plugins, where a plugin\n+// can register at specified URLs one or more HTTP request handlers that\n+// will handle HTTP requests at run time.\n package httpmux"},"message":{"kind":"string","value":"Editorial changes to docs.go"},"project":{"kind":"string","value":"ligato_cn-infra"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"go,go"}}},{"rowIdx":1162647,"cells":{"hash":{"kind":"string","value":"4ba3b2b61b47aa3bc531245519446282edcb3fa1"},"diff":{"kind":"string","value":"diff --git a/test/map/NearCachedMapStressTest.js b/test/map/NearCachedMapStressTest.js\nindex .. 100644\n--- a/test/map/NearCachedMapStressTest.js\n+++ b/test/map/NearCachedMapStressTest.js\n@@ -57,7 +57,7 @@ describe('NearCachedMapStress', function () {\n }\n \n it('stress test with put, get and remove', function (done) {\n- this.timeout(20000);\n+ this.timeout(120000);\n var map = client1.getMap(mapName);\n (function innerOperation() {\n if (completedOperations >= totalNumOperations) {"},"message":{"kind":"string","value":"increases timeout for near cache stress test"},"project":{"kind":"string","value":"hazelcast_hazelcast-nodejs-client"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"js"}}},{"rowIdx":1162648,"cells":{"hash":{"kind":"string","value":"09e36bfeeaaca3607eb2db9611030049d824fdb1"},"diff":{"kind":"string","value":"diff --git a/modules/social_features/social_group/src/Controller/SocialGroupController.php b/modules/social_features/social_group/src/Controller/SocialGroupController.php\nindex .. 100644\n--- a/modules/social_features/social_group/src/Controller/SocialGroupController.php\n+++ b/modules/social_features/social_group/src/Controller/SocialGroupController.php\n@@ -3,6 +3,7 @@\n namespace Drupal\\social_group\\Controller;\n \n use Drupal\\Core\\Controller\\ControllerBase;\n+use Drupal\\group\\Entity\\Group;\n \n /**\n * Returns responses for Social Group routes.\n@@ -21,15 +22,11 @@ class SocialGroupController extends ControllerBase {\n * The page title.\n */\n public function groupMembersTitle($group) {\n- if (is_object($group)) {\n- $group_label = $group->label();\n+ // If it's not a group then it's a gid.\n+ if (!$group instanceof Group) {\n+ $group = Group::load($group);\n }\n- else {\n- $storage = \\Drupal::entityTypeManager()->getStorage('group');\n- $group_entity = $storage->load($group);\n- $group_label = empty($group_entity) ? 'group' : $group_entity->label();\n- }\n- return $this->t('Members of @name', ['@name' => $group_label]);\n+ return $this->t('Members of @name', ['@name' => $group->label()]);\n }\n \n /**"},"message":{"kind":"string","value":"SHN- by jochemvn: Simplify function"},"project":{"kind":"string","value":"goalgorilla_open_social"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"php"}}},{"rowIdx":1162649,"cells":{"hash":{"kind":"string","value":"2540c43cadbcdc0b994d6bc846f93a8658045ebf"},"diff":{"kind":"string","value":"diff --git a/immutable-history/src/Controller/ChangeLogListController.php b/immutable-history/src/Controller/ChangeLogListController.php\nindex .. 100644\n--- a/immutable-history/src/Controller/ChangeLogListController.php\n+++ b/immutable-history/src/Controller/ChangeLogListController.php\n@@ -71,7 +71,8 @@ class ChangeLogListController implements MiddlewareInterface\n $humanReadableEvents = $this->getHumanReadableChangeLogByDateRange->__invoke($greaterThanYear, $lessThanYear);\n \n $description = 'Content change log events for ' . $days . ' days'\n- . ' from ' . $greaterThanYear->format('c') . ' to ' . $lessThanYear->format('c');\n+ . ' from ' . $greaterThanYear->format('c') . ' to ' . $lessThanYear->format('c')\n+ . '. Text in parentheses is from current lookups and is not guaranteed to be historically accurate.';\n \n $contentType = isset($queryParams['content-type'])\n ? html_entity_decode($queryParams['content-type'])"},"message":{"kind":"string","value":"work on immutable history proof of concept by cleaning up code"},"project":{"kind":"string","value":"reliv_Rcm"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"php"}}},{"rowIdx":1162650,"cells":{"hash":{"kind":"string","value":"d07b7359a0074fac0dcbab93698cc17ee0a61027"},"diff":{"kind":"string","value":"diff --git a/fake-timers.js b/fake-timers.js\nindex .. 100644\n--- a/fake-timers.js\n+++ b/fake-timers.js\n@@ -105,7 +105,6 @@ module.exports = function every(obj, fn) {\n var pass = true;\n \n try {\n- /* eslint-disable-next-line local-rules/no-prototype-methods */\n obj.forEach(function() {\n if (!fn.apply(this, arguments)) {\n // Throwing an error is the only way to break `forEach`\n@@ -205,7 +204,6 @@ module.exports = copyPrototype(Array.prototype);\n var call = Function.call;\n \n module.exports = function copyPrototypeMethods(prototype) {\n- /* eslint-disable local-rules/no-prototype-methods */\n return Object.getOwnPropertyNames(prototype).reduce(function(result, name) {\n // ignore size because it throws from Map\n if (\n@@ -283,7 +281,6 @@ module.exports = function typeOf(value) {\n \n function valueToString(value) {\n if (value && value.toString) {\n- /* eslint-disable-next-line local-rules/no-prototype-methods */\n return value.toString();\n }\n return String(value);"},"message":{"kind":"string","value":"Remove misleading comment\n\nThis repository doesn't use the `no-prototype-methods` rule that is\nmanaged with `local-rules` plugin, so the comments make no sense.\n\nESLint should really throw an error here..."},"project":{"kind":"string","value":"sinonjs_lolex"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"js"}}},{"rowIdx":1162651,"cells":{"hash":{"kind":"string","value":"3869a4d2d98148b2d4de6164fb0e1eabe8cf3874"},"diff":{"kind":"string","value":"diff --git a/core/lib/engine_util.js b/core/lib/engine_util.js\nindex .. 100644\n--- a/core/lib/engine_util.js\n+++ b/core/lib/engine_util.js\n@@ -213,6 +213,21 @@ function renderVariables (str, vars) {\n let rxmatch;\n let result = str.substring(0, str.length);\n \n+\n+ // Special case for handling integer/boolean/object substitution:\n+ //\n+ // Does the template string contain one variable and nothing else?\n+ // e.g.: \"{{ myvar }\" or \"{{ myvar }\", but NOT \" {{ myvar }\"\n+ // If so, we treat it as a special case.\n+ const matches = str.match(RX);\n+ if (matches && matches.length === 1) {\n+ if (matches[0] === str) {\n+ // there's nothing else in the template but the variable\n+ const varName = str.replace(/{/g, '').replace(/}/g, '').trim();\n+ return vars[varName] || '';\n+ }\n+ }\n+\n while (result.search(RX) > -1) {\n let templateStr = result.match(RX)[0];\n const varName = templateStr.replace(/{/g, '').replace(/}/g, '').trim();"},"message":{"kind":"string","value":"fix: Using a template with exactly one variable keeps its type"},"project":{"kind":"string","value":"artilleryio_artillery"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"js"}}},{"rowIdx":1162652,"cells":{"hash":{"kind":"string","value":"5be54c643d8c29394f8836c94d69d055472bf925"},"diff":{"kind":"string","value":"diff --git a/pymatgen/electronic_structure/tests/test_plotter.py b/pymatgen/electronic_structure/tests/test_plotter.py\nindex .. 100644\n--- a/pymatgen/electronic_structure/tests/test_plotter.py\n+++ b/pymatgen/electronic_structure/tests/test_plotter.py\n@@ -190,8 +190,13 @@ class BoltztrapPlotterTest(unittest.TestCase):\n os.path.join(test_dir, \"boltztrap/transp/\"))\n plotter = BoltztrapPlotter(bz)\n plotter.plot_seebeck_eff_mass_mu()\n- plotter.plot_seebeck_temp()\n- plotter.plot_seebeck_dop()\n+\n+ # TODO: These two tests fail. Whoever is responsible for the\n+ # BoltztrapPlotter needs to fix these. The fact that there are not tests\n+ # for the plotter is atrocious. I will reject all future additions to\n+ # the plotter until these are fixed.\n+ # plotter.plot_seebeck_temp()\n+ # plotter.plot_seebeck_dop()\n plotter.plot_complexity_factor_mu()\n \n plotter.plot_conductivity_dop()"},"message":{"kind":"string","value":"Comment out tests with an angry message at the person who coded the\nBzTPlotter."},"project":{"kind":"string","value":"materialsproject_pymatgen"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"py"}}},{"rowIdx":1162653,"cells":{"hash":{"kind":"string","value":"1ee410b4128385e533b609708f8e9aa71e42053e"},"diff":{"kind":"string","value":"diff --git a/src/javascript/xhr/XMLHttpRequest.js b/src/javascript/xhr/XMLHttpRequest.js\nindex .. 100644\n--- a/src/javascript/xhr/XMLHttpRequest.js\n+++ b/src/javascript/xhr/XMLHttpRequest.js\n@@ -913,6 +913,7 @@ define(\"moxie/xhr/XMLHttpRequest\", [\n \t\t\t\t\t\t\t_p('responseText', _xhr.responseText);\n \t\t\t\t\t\t\t_p('responseXML', _getDocument(_xhr));\n \t\t\t\t\t\t\t_p('response', (_p('responseType') === 'document' ? _p('responseXML') : _p('responseText')));\n+\t\t\t\t\t\t\t_responseHeaders = _xhr.getAllResponseHeaders();\n \t\t\t\t\t\t\tself.dispatchEvent('load');\n \t\t\t\t\t\t}"},"message":{"kind":"string","value":"XHR: Populate response headers in native mode as well."},"project":{"kind":"string","value":"moxiecode_moxie"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"js"}}},{"rowIdx":1162654,"cells":{"hash":{"kind":"string","value":"085eb92e160b9b993b51a1e9d6c9d9a7b7c9ab76"},"diff":{"kind":"string","value":"diff --git a/docs/src/vendor/doc-components/editor/editor.js b/docs/src/vendor/doc-components/editor/editor.js\nindex .. 100644\n--- a/docs/src/vendor/doc-components/editor/editor.js\n+++ b/docs/src/vendor/doc-components/editor/editor.js\n@@ -1,5 +1,6 @@\n import React from 'react';\n import PropTypes from 'prop-types';\n+import _ from 'lodash';\n \n let CodeMirror;\n if (typeof document !== 'undefined') {\n@@ -25,6 +26,12 @@ class Editor extends React.Component {\n theme: 'oceanic-next',\n };\n \n+ constructor(props) {\n+ super(props);\n+\n+ this.debouncedOnChange = _.debounce(props.onChange, 500);\n+ }\n+\n componentDidMount() {\n if (!CodeMirror) {\n return;\n@@ -51,15 +58,10 @@ class Editor extends React.Component {\n \n handleChange = () => {\n if (!this.props.readOnly && this.props.onChange) {\n- this.props.onChange(this.editor.getValue());\n+ this.debouncedOnChange(this.editor.getValue());\n }\n };\n \n- setCode(code) {\n- this.editor.getDoc().setValue(code);\n- this.handleChange();\n- }\n-\n render() {\n const { className, style } = this.props;"},"message":{"kind":"string","value":"Debounce updates to the example code block"},"project":{"kind":"string","value":"jamesplease_materialish"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"js"}}},{"rowIdx":1162655,"cells":{"hash":{"kind":"string","value":"ce8b798a1a846760e61e9edf38d11f26d8351485"},"diff":{"kind":"string","value":"diff --git a/salt/modules/zfs.py b/salt/modules/zfs.py\nindex .. 100644\n--- a/salt/modules/zfs.py\n+++ b/salt/modules/zfs.py\n@@ -39,20 +39,22 @@ def _available_commands():\n if not zfs_path:\n return False\n \n- _return = {}\n+ ret = {}\n # Note that we append '|| :' as a unix hack to force return code to be 0.\n- res = salt_cmd.run_all('{0} help || :'.format(zfs_path))\n+ res = salt_cmd.run_stderr(\n+ '{0} help || :'.format(zfs_path), output_loglevel='debug'\n+ )\n \n # This bit is dependent on specific output from `zfs help` - any major changes\n # in how this works upstream will require a change.\n- for line in res['stderr'].splitlines():\n+ for line in res.splitlines():\n if re.match('\t[a-zA-Z]', line):\n cmds = line.split(' ')[0].split('|')\n doc = ' '.join(line.split(' ')[1:])\n for cmd in [cmd.strip() for cmd in cmds]:\n- if cmd not in _return:\n- _return[cmd] = doc\n- return _return\n+ if cmd not in ret:\n+ ret[cmd] = doc\n+ return ret\n \n \n def _exit_status(retcode):"},"message":{"kind":"string","value":"Log 'zfs help' output at debug\n\nThis suppresses the output from this command unless the minion is\nrunning in debug mode."},"project":{"kind":"string","value":"saltstack_salt"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"py"}}},{"rowIdx":1162656,"cells":{"hash":{"kind":"string","value":"b54334fc7148d605747715d7b3bfc5a090cdb1d9"},"diff":{"kind":"string","value":"diff --git a/lib/sass/environment.rb b/lib/sass/environment.rb\nindex .. 100644\n--- a/lib/sass/environment.rb\n+++ b/lib/sass/environment.rb\n@@ -68,7 +68,7 @@ module Sass\n \n # Pop a stack frame from the mixin/include stack.\n def pop_frame\n- stack.pop if stack.last[:prepared]\n+ stack.pop if stack.last && stack.last[:prepared]\n stack.pop\n end"},"message":{"kind":"string","value":"[Sass] Don't raise odd errors about #[] for stack overflows."},"project":{"kind":"string","value":"sass_ruby-sass"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"rb"}}},{"rowIdx":1162657,"cells":{"hash":{"kind":"string","value":"016ee28b226f542bf2cdbc1e3aedf07416852a53"},"diff":{"kind":"string","value":"diff --git a/src/ol-ext/format.js b/src/ol-ext/format.js\nindex .. 100644\n--- a/src/ol-ext/format.js\n+++ b/src/ol-ext/format.js\n@@ -1,7 +1,9 @@\n import BaseGeoJSON from 'ol/format/geojson'\n import TopoJSON from 'ol/format/topojson'\n import { isEmpty } from '../util/minilo'\n+import { EPSG_4326 } from './consts'\n import { createCircularPolygon } from './geom'\n+import { transformPoint } from './proj'\n import { isCircle } from './util'\n \n /**\n@@ -23,7 +25,15 @@ export function createTopoJsonFmt (options) {\n class GeoJSON extends BaseGeoJSON {\n writeGeometryObject (geometry, options) {\n if (isCircle(geometry)) {\n- geometry = createCircularPolygon(geometry.getCenter(), geometry.getRadius())\n+ geometry = createCircularPolygon(\n+ transformPoint(\n+ geometry.getCenter(),\n+ options.featureProjection || this.defaultFeatureProjection,\n+ EPSG_4326,\n+ ),\n+ geometry.getRadius(),\n+ )\n+ options.featureProjection = EPSG_4326\n }\n return super.writeGeometryObject(geometry, options)\n }"},"message":{"kind":"string","value":"custom geojson fmt: replace projection after circle to polygon conversion"},"project":{"kind":"string","value":"ghettovoice_vuelayers"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"js"}}},{"rowIdx":1162658,"cells":{"hash":{"kind":"string","value":"737429154e51ef8fbbaefcec0f74f2816864ea83"},"diff":{"kind":"string","value":"diff --git a/src/main/java/com/axibase/tsd/driver/jdbc/DriverConstants.java b/src/main/java/com/axibase/tsd/driver/jdbc/DriverConstants.java\nindex .. 100644\n--- a/src/main/java/com/axibase/tsd/driver/jdbc/DriverConstants.java\n+++ b/src/main/java/com/axibase/tsd/driver/jdbc/DriverConstants.java\n@@ -38,7 +38,7 @@ public final class DriverConstants {\n \tpublic static final String TABLES_PARAM_NAME = \"tables\";\n \tpublic static final String DEFAULT_TABLES_VALUE = null;\n \tpublic static final String EXPAND_TAGS_PARAM_NAME = \"expandTags\";\n-\tpublic static final boolean DEFAULT_EXPAND_TAGS_VALUE = true;\n+\tpublic static final boolean DEFAULT_EXPAND_TAGS_VALUE = false;\n \tpublic static final String META_COLUMNS_PARAM_NAME = \"metaColumns\";\n \tpublic static final boolean DEFAULT_META_COLUMNS_VALUE = false;\n \tpublic static final String ASSIGN_INNER_COLUMN_NAMES_PARAM = \"assignColumnNames\";"},"message":{"kind":"string","value":"set expandTags value to false by default"},"project":{"kind":"string","value":"axibase_atsd-jdbc"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"java"}}},{"rowIdx":1162659,"cells":{"hash":{"kind":"string","value":"6987b45970fd04ec85a5dde334a0a72a5ee48a8f"},"diff":{"kind":"string","value":"diff --git a/svtyper/singlesample.py b/svtyper/singlesample.py\nindex .. 100644\n--- a/svtyper/singlesample.py\n+++ b/svtyper/singlesample.py\n@@ -711,6 +711,7 @@ def genotype_parallel(src_vcf, out_vcf, sample, z, split_slop, min_aligned, sum_\n # 1st pass through input vcf -- collect all the relevant breakpoints\n logit(\"Collecting breakpoints\")\n breakpoints = collect_breakpoints(src_vcf)\n+ logit(\"Collected {} breakpoints\".format(len(breakpoints)))\n logit(\"Collecting regions\")\n regions = [ get_breakpoint_regions(b, sample, z) for b in breakpoints ]\n logit(\"Batch breakpoints into groups of {}\".format(breakpoint_batch_size))"},"message":{"kind":"string","value":"+ add message on how many breakpoints we're going to process"},"project":{"kind":"string","value":"hall-lab_svtyper"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"py"}}},{"rowIdx":1162660,"cells":{"hash":{"kind":"string","value":"8096d5257492997e75634766f57c5cc159d09b3e"},"diff":{"kind":"string","value":"diff --git a/lib/rack/www.rb b/lib/rack/www.rb\nindex .. 100644\n--- a/lib/rack/www.rb\n+++ b/lib/rack/www.rb\n@@ -15,12 +15,8 @@ module Rack\n host = URI(req.host).to_s\n if (already_www?(host) && @www == true) || (!already_www?(host) && @www == false)\n [status, headers, body]\n- elsif !already_www?(host) && @www == true\n- url = URI(req.url).scheme + \"://www.\" + host + URI(req.path).to_s\n- headers = headers.merge('Location' => url)\n- [301, headers, body]\n else\n- url = URI(req.url).scheme + \"://\" + host.gsub(\"www.\", \"\") + URI(req.path).to_s\n+ url = prepare_url(req)\n headers = headers.merge('Location' => url)\n [301, headers, body]\n end\n@@ -30,5 +26,17 @@ module Rack\n def already_www?(host)\n host.downcase =~ /^(www.)/ \n end\n+\n+ def prepare_url(req)\n+ scheme = URI(req.url).scheme \n+ host = URI(req.host).to_s.gsub(/^(www.)/, \"\")\n+ path = URI(req.path).to_s\n+ if @www == true\n+ host = \"://www.\" + host\n+ else\n+ host = \"://\" + host\n+ end\n+ scheme + host + path\n+ end\n end\n end"},"message":{"kind":"string","value":"Removed duplicated code, refactored a bit"},"project":{"kind":"string","value":"stjhimy_rack-www"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"rb"}}},{"rowIdx":1162661,"cells":{"hash":{"kind":"string","value":"3e21905fc452cb12e544bbbf3d01b2fddf2d31f7"},"diff":{"kind":"string","value":"diff --git a/lib/OpenLayers/Layer/Vector.js b/lib/OpenLayers/Layer/Vector.js\nindex .. 100644\n--- a/lib/OpenLayers/Layer/Vector.js\n+++ b/lib/OpenLayers/Layer/Vector.js\n@@ -271,6 +271,10 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, {\n \n if (!dragging) {\n this.renderer.root.style.visibility = \"hidden\";\n+ // force a reflow on gecko based browsers to actually hide the svg\n+ if (navigator.userAgent.toLowerCase().indexOf(\"gecko\") != -1) {\n+ this.div.scrollLeft = this.div.scrollLeft;\n+ }\n \n this.div.style.left = -parseInt(this.map.layerContainerDiv.style.left) + \"px\";\n this.div.style.top = -parseInt(this.map.layerContainerDiv.style.top) + \"px\";"},"message":{"kind":"string","value":"\"svg flicker at end of pan\". Gecko-based browsers might not reflow svg if only style properties of dom elements are changed. Fixed by setting the scrollLeft property. r=pgiraud,tschaub (closes #)\n\ngit-svn-id: "},"project":{"kind":"string","value":"openlayers_openlayers"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"js"}}},{"rowIdx":1162662,"cells":{"hash":{"kind":"string","value":"5eed28ce9ef1daa2b38d15094425f82e0032d62d"},"diff":{"kind":"string","value":"diff --git a/src/js/chosen.js b/src/js/chosen.js\nindex .. 100644\n--- a/src/js/chosen.js\n+++ b/src/js/chosen.js\n@@ -1113,12 +1113,18 @@ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md\n };\n \n Chosen.prototype.results_reset = function() {\n+ var oldValue = this.form_field_jq.val();\n this.reset_single_select_options();\n this.form_field.options[0].selected = true;\n this.single_set_selected_text();\n this.show_search_field_default();\n this.results_reset_cleanup();\n- this.form_field_jq.trigger(\"change\");\n+ var newValue = this.form_field_jq.val();\n+ var changeData = {selected: newValue};\n+ if (oldValue !== newValue && !newValue.length) {\n+ changeData.deselected = oldValue;\n+ }\n+ this.form_field_jq.trigger(\"change\", changeData);\n if(this.active_field) {\n return this.results_hide();\n }"},"message":{"kind":"string","value":"* add deselected param to change event for chosen single select control."},"project":{"kind":"string","value":"easysoft_zui"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"js"}}},{"rowIdx":1162663,"cells":{"hash":{"kind":"string","value":"5f58daaf57fa8e20fc46be6883129055e54e8cc0"},"diff":{"kind":"string","value":"diff --git a/internal/states/statefile/version4.go b/internal/states/statefile/version4.go\nindex .. 100644\n--- a/internal/states/statefile/version4.go\n+++ b/internal/states/statefile/version4.go\n@@ -539,7 +539,7 @@ type instanceObjectStateV4 struct {\n \tSchemaVersion uint64 `json:\"schema_version\"`\n \tAttributesRaw json.RawMessage `json:\"attributes,omitempty\"`\n \tAttributesFlat map[string]string `json:\"attributes_flat,omitempty\"`\n-\tAttributeSensitivePaths json.RawMessage `json:\"sensitive_attributes,omitempty,\"`\n+\tAttributeSensitivePaths json.RawMessage `json:\"sensitive_attributes,omitempty\"`\n \n \tPrivateRaw []byte `json:\"private,omitempty\"`"},"message":{"kind":"string","value":"fix typo in struct tag (#)\n\ntypo found by [`revive`]()"},"project":{"kind":"string","value":"hashicorp_terraform"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"go"}}},{"rowIdx":1162664,"cells":{"hash":{"kind":"string","value":"72b7e7ce8cf16c27ae67f0ea1a8264e58e562ce0"},"diff":{"kind":"string","value":"diff --git a/Builder/FormContractor.php b/Builder/FormContractor.php\nindex .. 100644\n--- a/Builder/FormContractor.php\n+++ b/Builder/FormContractor.php\n@@ -104,6 +104,7 @@ class FormContractor implements FormContractorInterface\n 'Sonata\\AdminBundle\\Form\\Type\\ModelType',\n 'sonata_type_model_list',\n 'Sonata\\AdminBundle\\Form\\Type\\ModelTypeList',\n+ 'Sonata\\AdminBundle\\Form\\Type\\ModelListType',\n 'sonata_type_model_hidden',\n 'Sonata\\AdminBundle\\Form\\Type\\ModelHiddenType',\n 'sonata_type_model_autocomplete',"},"message":{"kind":"string","value":"Fixed FormContractor for new ModelListType"},"project":{"kind":"string","value":"sonata-project_SonataDoctrineORMAdminBundle"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"php"}}},{"rowIdx":1162665,"cells":{"hash":{"kind":"string","value":"107e04a7eaec5a5a496043052c6d19ea8d2e0894"},"diff":{"kind":"string","value":"diff --git a/lib/dotenv.rb b/lib/dotenv.rb\nindex .. 100644\n--- a/lib/dotenv.rb\n+++ b/lib/dotenv.rb\n@@ -16,8 +16,7 @@ module Dotenv\n with(*filenames) { |f| Environment.new(f).apply! if File.exist?(f) }\n end\n \n-protected\n-\n+ # Internal: Helper to expand list of filenames.\n def self.with(*filenames, &block)\n filenames << '.env' if filenames.empty?"},"message":{"kind":"string","value":"Use comment instead of \"protected\" to denote internal method"},"project":{"kind":"string","value":"bkeepers_dotenv"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"rb"}}},{"rowIdx":1162666,"cells":{"hash":{"kind":"string","value":"be2f291f5cc049acc2e3ed37d28a3e38fd7172ca"},"diff":{"kind":"string","value":"diff --git a/pysat/__init__.py b/pysat/__init__.py\nindex .. 100644\n--- a/pysat/__init__.py\n+++ b/pysat/__init__.py\n@@ -2,6 +2,7 @@\n from __future__ import print_function\n from __future__ import absolute_import\n import os\n+import pysatCDF\n \n # get home directory\n home_dir = os.path.expanduser('~')"},"message":{"kind":"string","value":"Testing build of pysatCDF on travis"},"project":{"kind":"string","value":"rstoneback_pysat"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"py"}}},{"rowIdx":1162667,"cells":{"hash":{"kind":"string","value":"66a3d178cb5878e2da9f5e61f924b510dbf1b4bb"},"diff":{"kind":"string","value":"diff --git a/pandas/tests/frame/test_alter_axes.py b/pandas/tests/frame/test_alter_axes.py\nindex .. 100644\n--- a/pandas/tests/frame/test_alter_axes.py\n+++ b/pandas/tests/frame/test_alter_axes.py\n@@ -234,9 +234,16 @@ class TestDataFrameAlterAxes:\n \n # need to adapt first drop for case that both keys are 'A' --\n # cannot drop the same column twice;\n- # use \"is\" because == would give ambiguous Boolean error for containers\n+ # plain == would give ambiguous Boolean error for containers\n first_drop = (\n- False if (keys[0] is \"A\" and keys[1] is \"A\") else drop # noqa: F632\n+ False\n+ if (\n+ isinstance(keys[0], str)\n+ and keys[0] == \"A\"\n+ and isinstance(keys[1], str)\n+ and keys[1] == \"A\"\n+ )\n+ else drop\n )\n # to test against already-tested behaviour, we add sequentially,\n # hence second append always True; must wrap keys in list, otherwise"},"message":{"kind":"string","value":"TST: Don't use 'is' on strings to avoid SyntaxWarning (#)"},"project":{"kind":"string","value":"pandas-dev_pandas"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"py"}}},{"rowIdx":1162668,"cells":{"hash":{"kind":"string","value":"0d7e0e8adaf0eb9736ff1d398ab4280f7f528821"},"diff":{"kind":"string","value":"diff --git a/lib/pagelib.php b/lib/pagelib.php\nindex .. 100644\n--- a/lib/pagelib.php\n+++ b/lib/pagelib.php\n@@ -49,9 +49,15 @@ function page_create_object($type, $id = NULL) {\n */\n \n function page_map_class($type, $classname = NULL) {\n- static $mappings = array(\n- MOODLE_PAGE_COURSE => 'page_course'\n- );\n+ static $mappings = NULL;\n+ \n+ if($mappings === NULL) {\n+ $mappings = array(\n+ MOODLE_PAGE_COURSE => 'page_course'\n+ );\n+ print_object('Debug info - initial mappings:');\n+ var_dump($mappings);\n+ }\n \n if(!empty($type) && !empty($classname)) {\n $mappings[$type] = $classname;"},"message":{"kind":"string","value":"A small change for the static initialization in page_map_class,\nand more debug added just before init is done."},"project":{"kind":"string","value":"moodle_moodle"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"php"}}},{"rowIdx":1162669,"cells":{"hash":{"kind":"string","value":"2e48d37e2883c6157603edea45874724ba2c7b90"},"diff":{"kind":"string","value":"diff --git a/lib/zookeeper/common.rb b/lib/zookeeper/common.rb\nindex .. 100644\n--- a/lib/zookeeper/common.rb\n+++ b/lib/zookeeper/common.rb\n@@ -37,7 +37,7 @@ protected\n \n def get_watcher(req_id)\n @req_mutex.synchronize {\n- req_id != ZKRB_GLOBAL_CB_REQ ? @watcher_reqs.delete(req_id) : @watcher_reqs[req_id]\n+ (req_id == ZKRB_GLOBAL_CB_REQ) ? @watcher_reqs[req_id] : @watcher_reqs.delete(req_id)\n }\n end"},"message":{"kind":"string","value":"improve logic in ternary to read more sanely"},"project":{"kind":"string","value":"zk-ruby_zookeeper"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"rb"}}},{"rowIdx":1162670,"cells":{"hash":{"kind":"string","value":"3a7f39f43e6ef3da4330706461220775bf0a977b"},"diff":{"kind":"string","value":"diff --git a/docs_src/assets/js/src/application.js b/docs_src/assets/js/src/application.js\nindex .. 100644\n--- a/docs_src/assets/js/src/application.js\n+++ b/docs_src/assets/js/src/application.js\n@@ -134,7 +134,9 @@\n htmlBridge\n .data('placement', 'top')\n .attr('title', 'Copy to clipboard')\n- .tooltip()\n+ .tooltip();\n+\n+ htmlBridge.find('object').text(\"flash object for zero clipboard\");\n })\n \n // Copy to clipboard"},"message":{"kind":"string","value":"Add text to copy object to resovle error"},"project":{"kind":"string","value":"rei_rei-cedar"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"js"}}},{"rowIdx":1162671,"cells":{"hash":{"kind":"string","value":"dba454d5f947251e2b8db3fdef0aafd199e0a398"},"diff":{"kind":"string","value":"diff --git a/cms_lab_publications/admin.py b/cms_lab_publications/admin.py\nindex .. 100644\n--- a/cms_lab_publications/admin.py\n+++ b/cms_lab_publications/admin.py\n@@ -261,6 +261,7 @@ class PublicationSetAdmin(admin.ModelAdmin):\n 'number_of_publications',\n 'pagination',\n 'searchable',\n+ 'is_bulk_pubmed_query_ok',\n )\n list_filter = (\n BulkPubMedQueryStatusFilter,\n@@ -273,6 +274,11 @@ class PublicationSetAdmin(admin.ModelAdmin):\n 'description',\n )\n \n+ def is_bulk_pubmed_query_ok(self, obj):\n+ return obj.bulk_pubmed_query == ''\n+ is_bulk_pubmed_query_ok.boolean = True\n+ is_bulk_pubmed_query_ok.short_description = 'Query OK?'\n+\n def queryset(self, request):\n queryset = super().queryset(request)\n queryset = queryset.annotate(pub_count=Count('publications'))"},"message":{"kind":"string","value":"Display whether a Publication Set's Bulk PubMed Query status is OK"},"project":{"kind":"string","value":"mfcovington_djangocms-lab-publications"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"py"}}},{"rowIdx":1162672,"cells":{"hash":{"kind":"string","value":"1a1991217102a288c77f24650ae05436871e7b52"},"diff":{"kind":"string","value":"diff --git a/tests/bootstrap.php b/tests/bootstrap.php\nindex .. 100644\n--- a/tests/bootstrap.php\n+++ b/tests/bootstrap.php\n@@ -10,6 +10,7 @@\n \n error_reporting(E_ALL & ~E_USER_NOTICE | E_STRICT);\n \n+require_once dirname(__FILE__) . \"/../vendor/autoload.php\";\n require_once dirname(__FILE__) . \"/../lib/steam-condenser.php\";\n \n function getFixture($fileName) {"},"message":{"kind":"string","value":"Load Composer dependencies during tests"},"project":{"kind":"string","value":"koraktor_steam-condenser-php"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"php"}}},{"rowIdx":1162673,"cells":{"hash":{"kind":"string","value":"3d66113a1832d3a89bdf2454bb882e6aea6e2c7c"},"diff":{"kind":"string","value":"diff --git a/tests/spec/output_spec.rb b/tests/spec/output_spec.rb\nindex .. 100644\n--- a/tests/spec/output_spec.rb\n+++ b/tests/spec/output_spec.rb\n@@ -105,6 +105,4 @@ describe WinRM::Output do\n end\n end\n end\n-\n- pending 'parse CLIXML errors and convert to Strings and/or Exceptions'\n end"},"message":{"kind":"string","value":"remove pending test regarding exception deserializing. we do that now and cover in integration tests. will add unit tests soon"},"project":{"kind":"string","value":"WinRb_WinRM"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"rb"}}},{"rowIdx":1162674,"cells":{"hash":{"kind":"string","value":"0a08b6fb8a2dbd8f3d0c0beaf1638422e511f27c"},"diff":{"kind":"string","value":"diff --git a/test/routing_test.rb b/test/routing_test.rb\nindex .. 100755\n--- a/test/routing_test.rb\n+++ b/test/routing_test.rb\n@@ -473,7 +473,7 @@ class TranslateRoutesTest < ActionController::TestCase\n end\n end\n \n- test_case = klass.new(nil)\n+ test_case = klass.new(:respond_to?)\n \n # Not localized\n assert test_case.respond_to?(:people_path)"},"message":{"kind":"string","value":"Fix tests on default urls for Ruby "},"project":{"kind":"string","value":"enriclluelles_route_translator"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"rb"}}},{"rowIdx":1162675,"cells":{"hash":{"kind":"string","value":"c5dd6a91bec9cc3d8d2442248841b848ce58f1c7"},"diff":{"kind":"string","value":"diff --git a/probes/src/test/java/com/hazelcast/simulator/probes/ProbeTestUtils.java b/probes/src/test/java/com/hazelcast/simulator/probes/ProbeTestUtils.java\nindex .. 100644\n--- a/probes/src/test/java/com/hazelcast/simulator/probes/ProbeTestUtils.java\n+++ b/probes/src/test/java/com/hazelcast/simulator/probes/ProbeTestUtils.java\n@@ -24,7 +24,7 @@ public final class ProbeTestUtils {\n \n private static final int HISTOGRAM_RECORD_COUNT = 5000;\n private static final int MAX_LATENCY = 30000;\n- private static final int TOLERANCE_MILLIS = 500;\n+ private static final int TOLERANCE_MILLIS = 1000;\n \n private static final Random RANDOM = new Random();\n private static File resultFile = new File(\"tmpProbeResult.xml\");"},"message":{"kind":"string","value":"Increased TOLERANCE_MILLIS to one second in ProbeTestUtils."},"project":{"kind":"string","value":"hazelcast_hazelcast-simulator"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"java"}}},{"rowIdx":1162676,"cells":{"hash":{"kind":"string","value":"c300467604fffa349968208f963e883a60ef5a77"},"diff":{"kind":"string","value":"diff --git a/testsuite/domain/src/test/java/org/jboss/as/test/integration/respawn/RespawnTestCase.java b/testsuite/domain/src/test/java/org/jboss/as/test/integration/respawn/RespawnTestCase.java\nindex .. 100644\n--- a/testsuite/domain/src/test/java/org/jboss/as/test/integration/respawn/RespawnTestCase.java\n+++ b/testsuite/domain/src/test/java/org/jboss/as/test/integration/respawn/RespawnTestCase.java\n@@ -396,7 +396,7 @@ public class RespawnTestCase {\n \n @Override\n String getKillCommand(RunningProcess process) {\n- return \"taskkill /pid \" + process.getProcessId();\n+ return \"taskkill /f /pid \" + process.getProcessId();\n }\n }"},"message":{"kind":"string","value":"Add /f option to taskkill command on Windows. Stops respawn test from failing."},"project":{"kind":"string","value":"wildfly_wildfly"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"java"}}},{"rowIdx":1162677,"cells":{"hash":{"kind":"string","value":"3a6369a9403c6822f59408ec6b3718883fdb7dc3"},"diff":{"kind":"string","value":"diff --git a/concrete/src/Permission/Key/WorkflowKey.php b/concrete/src/Permission/Key/WorkflowKey.php\nindex .. 100644\n--- a/concrete/src/Permission/Key/WorkflowKey.php\n+++ b/concrete/src/Permission/Key/WorkflowKey.php\n@@ -27,7 +27,7 @@ abstract class WorkflowKey extends Key\n \n foreach ($excluded as $inc) {\n $pae = $inc->getAccessEntityObject();\n- $usersExcluded = array_merge($usersExcluded, $pae->getAccessEntityUsers());\n+ $usersExcluded = array_merge($usersExcluded, $pae->getAccessEntityUsers($paa));\n }\n $users = array_diff($users, $usersExcluded);"},"message":{"kind":"string","value":"WorkflowKey::getCurrentlyActiveUsers() doesn't pass all args to getAccessEntityUsers()\n\nCame about this bug when using the MSW extension."},"project":{"kind":"string","value":"concrete5_concrete5"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"php"}}},{"rowIdx":1162678,"cells":{"hash":{"kind":"string","value":"b2a4e704deea531f74d4abff94882c7390fd17ae"},"diff":{"kind":"string","value":"diff --git a/index.js b/index.js\nindex .. 100644\n--- a/index.js\n+++ b/index.js\n@@ -367,8 +367,8 @@ workfly.prototype.resume = function()\n //Resume the workflow\n this._paused = false;\n \n- //Check if workflow is aborted\n- if(this._aborted === true ){ return; }\n+ //Check if workflow is aborted or completed\n+ if(this._aborted === true || this._completed === true ){ return; }\n \n //Check if workflow running\n if(this._running === true){ return; }"},"message":{"kind":"string","value":"index.js: check if workflow is completed before resume it"},"project":{"kind":"string","value":"jmjuanes_tinyflow"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"js"}}},{"rowIdx":1162679,"cells":{"hash":{"kind":"string","value":"e77089f73914e045004601c75d3e9b8e7fad335b"},"diff":{"kind":"string","value":"diff --git a/core/src/main/java/org/bitcoinj/core/TransactionBroadcast.java b/core/src/main/java/org/bitcoinj/core/TransactionBroadcast.java\nindex .. 100644\n--- a/core/src/main/java/org/bitcoinj/core/TransactionBroadcast.java\n+++ b/core/src/main/java/org/bitcoinj/core/TransactionBroadcast.java\n@@ -103,7 +103,7 @@ public class TransactionBroadcast {\n List peers = peerGroup.getConnectedPeers(); // snapshots\n // We intern the tx here so we are using a canonical version of the object (as it's unfortunately mutable).\n // TODO: Once confidence state is moved out of Transaction we can kill off this step.\n- pinnedTx = context != null ? context.getConfidenceTable().intern(tx) : pinnedTx;\n+ pinnedTx = context != null ? context.getConfidenceTable().intern(tx) : tx;\n // Prepare to send the transaction by adding a listener that'll be called when confidence changes.\n // Only bother with this if we might actually hear back:\n if (minConnections > 1)"},"message":{"kind":"string","value":"NPE when invoking `PeerGroup.broadcastTransaction()` on peer group with no block chain.\n\nThe modified line here seems to have been assuming that `pinnedTx` was being\ninitialized elsewhere, but it wasn't."},"project":{"kind":"string","value":"bitcoinj_bitcoinj"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"java"}}},{"rowIdx":1162680,"cells":{"hash":{"kind":"string","value":"cf295868dc5be8a4b686b1bd10591b86b29144cf"},"diff":{"kind":"string","value":"diff --git a/alerta/server/database.py b/alerta/server/database.py\nindex .. 100644\n--- a/alerta/server/database.py\n+++ b/alerta/server/database.py\n@@ -18,10 +18,17 @@ class Mongo(object):\n \n # Connect to MongoDB\n try:\n- self.conn = pymongo.MongoClient(CONF.mongo_host, CONF.mongo_port)\n+ self.conn = pymongo.MongoClient(CONF.mongo_host, CONF.mongo_port) # version >= 2.4\n+ except AttributeError:\n+ self.conn = pymongo.Connection(CONF.mongo_host, CONF.mongo_port) # version < 2.4\n+ except Exception, e:\n+ LOG.error('MongoDB Client connection error : %s', e)\n+ sys.exit(1)\n+\n+ try:\n self.db = self.conn.monitoring # TODO(nsatterl): make 'monitoring' a SYSTEM DEFAULT\n except Exception, e:\n- LOG.error('MongoDB Client error : %s', e)\n+ LOG.error('MongoDB database error : %s', e)\n sys.exit(1)\n \n if self.conn.alive():"},"message":{"kind":"string","value":"support pymongo < "},"project":{"kind":"string","value":"alerta_alerta"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"py"}}},{"rowIdx":1162681,"cells":{"hash":{"kind":"string","value":"0efeaa258b19d5b1ba204cc55fbdb6969e0f3e64"},"diff":{"kind":"string","value":"diff --git a/flake8_respect_noqa.py b/flake8_respect_noqa.py\nindex .. 100644\n--- a/flake8_respect_noqa.py\n+++ b/flake8_respect_noqa.py\n@@ -4,13 +4,17 @@ Always ignore lines with '# noqa'\n \"\"\"\n __version__ = 0.2\n \n-import pep8\n+try:\n+ from pep8 import StandardReport, noqa\n+except ImportError:\n+ # Try the new (as of 2016-June) pycodestyle package.\n+ from pycodestyle import StandardReport, noqa\n \n \n-class RespectNoqaReport(pep8.StandardReport):\n+class RespectNoqaReport(StandardReport):\n \n def error(self, line_number, offset, text, check):\n- if len(self.lines) > line_number - 1 and pep8.noqa(self.lines[line_number - 1]):\n+ if len(self.lines) > line_number - 1 and noqa(self.lines[line_number - 1]):\n return\n else:\n return super(RespectNoqaReport, self).error(line_number, offset,"},"message":{"kind":"string","value":"Adjust for pep8 package rename.\n\nCloses #1"},"project":{"kind":"string","value":"spookylukey_flake8-respect-noqa"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"py"}}},{"rowIdx":1162682,"cells":{"hash":{"kind":"string","value":"30ba703bd4b500398820e3da4b8a8679df5ba014"},"diff":{"kind":"string","value":"diff --git a/mocpy/moc.py b/mocpy/moc.py\nindex .. 100644\n--- a/mocpy/moc.py\n+++ b/mocpy/moc.py\n@@ -371,7 +371,7 @@ class MOC(AbstractMoc):\n \n tmp_moc = tempfile.NamedTemporaryFile(delete=False)\n \n- self.write(tmp_moc.name)\n+ self.write(tmp_moc.name, write_to_file=True)\n r = requests.post('http://cdsxmatch.u-strasbg.fr/QueryCat/QueryCat',\n data={'mode': 'mocfile',\n 'catName': resource_id,"},"message":{"kind":"string","value":"fix _query\n\nMOC.write prototype has changed over time and _query was using a past version of it."},"project":{"kind":"string","value":"cds-astro_mocpy"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"py"}}},{"rowIdx":1162683,"cells":{"hash":{"kind":"string","value":"13cec37fd72d4c8301fe2bd829ab22799a8ba23d"},"diff":{"kind":"string","value":"diff --git a/lib/jsduck/lint.rb b/lib/jsduck/lint.rb\nindex .. 100644\n--- a/lib/jsduck/lint.rb\n+++ b/lib/jsduck/lint.rb\n@@ -100,7 +100,7 @@ module JsDuck\n def warn_singleton_statics\n @relations.each do |cls|\n if cls[:singleton]\n- cls.find_members({:static => true}).each do |m|\n+ cls.find_members({:local => true, :static => true}).each do |m|\n warn(:sing_static, \"Static members don't make sense in singleton class #{@doc[:name]}\", m)\n end\n end"},"message":{"kind":"string","value":"Use the :local option in statics in singleton check.\n\nWe don't care about static members inherited from parents and mixins -\nthey could be completely valid in those other classes - it's the\nconcrete singleton who's statics interest us."},"project":{"kind":"string","value":"senchalabs_jsduck"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"rb"}}},{"rowIdx":1162684,"cells":{"hash":{"kind":"string","value":"0d75a1fa05296d4e9ff30898ed72567d0a45c64b"},"diff":{"kind":"string","value":"diff --git a/src/Artisaninweb/SoapWrapper/Service.php b/src/Artisaninweb/SoapWrapper/Service.php\nindex .. 100755\n--- a/src/Artisaninweb/SoapWrapper/Service.php\n+++ b/src/Artisaninweb/SoapWrapper/Service.php\n@@ -336,7 +336,8 @@ class Service {\n */\n public function header($namespace,$name,$data=null,$mustUnderstand=false,$actor=null)\n {\n- $this->headers[] = new SoapHeader($namespace,$name,$data,$mustUnderstand,$actor);\n+ if($actor) $this->headers[] = new SoapHeader($namespace,$name,$data,$mustUnderstand,$actor);\n+ else $this->headers[] = new SoapHeader($namespace,$name,$data,$mustUnderstand);\n \n return $this;\n }"},"message":{"kind":"string","value":"Update add header function\n\n[ErrorException]\n\n SoapHeader::SoapHeader(): Invalid actor\n\n\n\nThis is the error i get when i don't set the actor."},"project":{"kind":"string","value":"artisaninweb_laravel-soap"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"php"}}},{"rowIdx":1162685,"cells":{"hash":{"kind":"string","value":"9eb0328aa899e522d5c0e8be35614457c8bbf1cd"},"diff":{"kind":"string","value":"diff --git a/actions/class.TestRunner.php b/actions/class.TestRunner.php\nindex .. 100644\n--- a/actions/class.TestRunner.php\n+++ b/actions/class.TestRunner.php\n@@ -282,6 +282,7 @@ class taoQtiTest_actions_TestRunner extends tao_actions_ServiceModule {\n }\n \n $this->setData('client_config_url', $this->getClientConfigUrl());\n+ $this->setData('client_timeout', $this->getClientTimeout());\n $this->setView('test_runner.tpl');\n \n $this->afterAction(false);\n@@ -580,4 +581,4 @@ class taoQtiTest_actions_TestRunner extends tao_actions_ServiceModule {\n \t break;\n \t }\n \t}\n-}\n\\ No newline at end of file\n+}"},"message":{"kind":"string","value":"add timeout to the test runner"},"project":{"kind":"string","value":"oat-sa_extension-tao-testqti"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"php"}}},{"rowIdx":1162686,"cells":{"hash":{"kind":"string","value":"59a981f41eb1f72df8bf49aff4df1c08dad00729"},"diff":{"kind":"string","value":"diff --git a/salt/_compat.py b/salt/_compat.py\nindex .. 100644\n--- a/salt/_compat.py\n+++ b/salt/_compat.py\n@@ -177,8 +177,19 @@ else:\n \n if PY3:\n from io import StringIO\n+ from io import BytesIO as cStringIO\n else:\n from StringIO import StringIO\n+ from cStringIO import StringIO as cStringIO\n+\n+def string_io(data=None): # cStringIO can't handle unicode\n+ '''\n+ Pass data through to stringIO module and return result\n+ '''\n+ try:\n+ return cStringIO(bytes(data))\n+ except (UnicodeEncodeError, TypeError):\n+ return StringIO(data)\n \n if PY3:\n import queue as Queue"},"message":{"kind":"string","value":"add more stringio support to compat"},"project":{"kind":"string","value":"saltstack_salt"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"py"}}},{"rowIdx":1162687,"cells":{"hash":{"kind":"string","value":"84e29ac56f88c72f8a025f285d69fcb7fa2a0f34"},"diff":{"kind":"string","value":"diff --git a/salt/modules/win_file.py b/salt/modules/win_file.py\nindex .. 100644\n--- a/salt/modules/win_file.py\n+++ b/salt/modules/win_file.py\n@@ -167,11 +167,13 @@ def _resolve_symlink(path, max_depth=64):\n return path\n \n \n-def _change_privilege(privilege_name, enable):\n+def _change_privilege_state(privilege_name, enable):\n '''\n- Change, either enable or disable, the named privilege for this process.\n+ Change the state, either enable or disable, of the named privilege for this\n+ process.\n \n- If the change did not occur, an exception will be raised.\n+ If the change fails, an exception will be raised. If successful, it returns\n+ True.\n '''\n log.debug(\n '%s the privilege %s for this process.',\n@@ -236,14 +238,14 @@ def _enable_privilege(privilege_name):\n '''\n Enables the named privilege for this process.\n '''\n- return _change_privilege(privilege_name, True)\n+ return _change_privilege_state(privilege_name, True)\n \n \n def _disable_privilege(privilege_name):\n '''\n Disables the named privilege for this process.\n '''\n- return _change_privilege(privilege_name, False)\n+ return _change_privilege_state(privilege_name, False)\n \n \n def gid_to_group(gid):"},"message":{"kind":"string","value":"Renamed method to better reflect what it does."},"project":{"kind":"string","value":"saltstack_salt"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"py"}}},{"rowIdx":1162688,"cells":{"hash":{"kind":"string","value":"3f52444bbfea61f55eafd5ee8e8dc7823e87bb8b"},"diff":{"kind":"string","value":"diff --git a/example_form.php b/example_form.php\nindex .. 100644\n--- a/example_form.php\n+++ b/example_form.php\n@@ -44,7 +44,7 @@ if (isset($_SESSION['ctform']['error']) && $_SESSION['ctform']['error'] == true\n The captcha was correct and the message has been sent!

\n \n \n-
\" id=\"contact_form\">\n+\" id=\"contact_form\">\n \n \n

"},"message":{"kind":"string","value":"Fix potential XSS in example form."},"project":{"kind":"string","value":"dapphp_securimage"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"php"}}},{"rowIdx":1162689,"cells":{"hash":{"kind":"string","value":"c9e42e801bbeac85fe309f7eb3388ca15b5032d8"},"diff":{"kind":"string","value":"diff --git a/bees/ircbee/ircbee.go b/bees/ircbee/ircbee.go\nindex .. 100644\n--- a/bees/ircbee/ircbee.go\n+++ b/bees/ircbee/ircbee.go\n@@ -219,10 +219,9 @@ func (mod *IrcBee) Run(eventChan chan bees.Event) {\n \t\t\t\t\t}\n \n \t\t\t\tdefault:\n+\t\t\t\t\ttime.Sleep(1 * time.Second)\n \t\t\t\t}\n \t\t\t}\n \t\t}\n-\n-\t\ttime.Sleep(5 * time.Second)\n \t}\n }"},"message":{"kind":"string","value":"Sleep in the inner-most ircbee loop."},"project":{"kind":"string","value":"muesli_beehive"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"go"}}},{"rowIdx":1162690,"cells":{"hash":{"kind":"string","value":"39974f637036ac5a71c5b81ecb97f2bb92586a05"},"diff":{"kind":"string","value":"diff --git a/index.js b/index.js\nindex .. 100644\n--- a/index.js\n+++ b/index.js\n@@ -35,7 +35,7 @@ module.exports = {\n target.options = target.options || {};\n \n // Build all paths\n- var bulmaPath = path.join(target.bowerDirectory, 'bulma');\n+ var bulmaPath = path.join(target.bowerDirectory || '', 'bulma');\n \n target.options.sassOptions = target.options.sassOptions || {};\n target.options.sassOptions.includePaths = target.options.sassOptions.includePaths || [];"},"message":{"kind":"string","value":"Fallback to empty string for undefined bowerDirectory\n\nFrom what I can tell, nested addons don't have access to the `bowerDirectory` property defined by Ember CLI. \n\n\n\nRather than get an error for passing `undefined` to `Path.join`, this attempts to continue without `target.bowerDirectory`."},"project":{"kind":"string","value":"open-tux_ember-bulma"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"js"}}},{"rowIdx":1162691,"cells":{"hash":{"kind":"string","value":"a33055366d63a345ecb43f622d203c8e3d627ea3"},"diff":{"kind":"string","value":"diff --git a/src/Entity/MetadataCollection.php b/src/Entity/MetadataCollection.php\nindex .. 100644\n--- a/src/Entity/MetadataCollection.php\n+++ b/src/Entity/MetadataCollection.php\n@@ -108,7 +108,9 @@ class MetadataCollection {\n \t\t$cacheKey = self::$cachePrefix . 'metadata_entities_list';\n \t\t$isCacheEnabled = $this->getClient()->isCacheEnabled();\n \n-\t\tif ( !count( $this->cachedEntitiesList ) && $isCacheEnabled\n+\t\tif ( count( $this->cachedEntitiesList ) ) {\n+\t\t\treturn $this->cachedEntitiesList;\n+\t\t} elseif ( !count( $this->cachedEntitiesList ) && $isCacheEnabled\n \t\t && $this->getCache()->exists( $cacheKey ) ) { // entities list exists\n \t\t\t$this->cachedEntitiesList = $this->getCache()->get( $cacheKey );\n \t\t} else { // entities list is not loaded"},"message":{"kind":"string","value":"Entities metadata cache would be regenerated repeatedly\n\nIf MetadataCollection::getEntitiesList() is invoked the second time,\nit would regenerate metadata cache despite entity metadata cache\nbeing in memory already."},"project":{"kind":"string","value":"AlexaCRM_php-crm-toolkit"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"php"}}},{"rowIdx":1162692,"cells":{"hash":{"kind":"string","value":"14166ccc302f2b7c61439939abab34acd75232b9"},"diff":{"kind":"string","value":"diff --git a/zipline/test/test_perf_tracking.py b/zipline/test/test_perf_tracking.py\nindex .. 100644\n--- a/zipline/test/test_perf_tracking.py\n+++ b/zipline/test/test_perf_tracking.py\n@@ -23,7 +23,7 @@ class PerformanceTestCase(unittest.TestCase):\n len(self.treasury_curves)\n )\n self.dt = self.treasury_curves.keys()[random_index]\n- self.end_dt = self.dt + datetime.timedelta(days=365+2)\n+ self.end_dt = self.dt + datetime.timedelta(days=365)\n self.trading_environment = TradingEnvironment(\n self.benchmark_returns, \n self.treasury_curves,"},"message":{"kind":"string","value":"dropped the extra days in trading range..."},"project":{"kind":"string","value":"quantopian_zipline"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"py"}}},{"rowIdx":1162693,"cells":{"hash":{"kind":"string","value":"428b55aa60056bf05c5c41e6554ae6b371c161be"},"diff":{"kind":"string","value":"diff --git a/pages.go b/pages.go\nindex .. 100644\n--- a/pages.go\n+++ b/pages.go\n@@ -6,13 +6,15 @@ import (\n \t\"bytes\"\n \t\"encoding/binary\"\n \t\"fmt\"\n-\t\"github.com/golang/protobuf/proto\"\n-\t\"github.com/sajari/sajari-convert/iWork\"\n-\t\"github.com/sajari/sajari-convert/snappy\"\n \t\"io\"\n \t\"io/ioutil\"\n \t\"log\"\n \t\"strings\"\n+\n+\t\"github.com/golang/protobuf/proto\"\n+\n+\t\"github.com/sajari/docconv/iWork\"\n+\t\"github.com/sajari/docconv/snappy\"\n )\n \n // Convert PAGES to text"},"message":{"kind":"string","value":"Fix and reorder imports."},"project":{"kind":"string","value":"sajari_docconv"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"go"}}},{"rowIdx":1162694,"cells":{"hash":{"kind":"string","value":"75c9c9f49bd4e6f7415ca9573d62310b21af468c"},"diff":{"kind":"string","value":"diff --git a/coursera/utils.py b/coursera/utils.py\nindex .. 100644\n--- a/coursera/utils.py\n+++ b/coursera/utils.py\n@@ -65,7 +65,7 @@ def clean_filename(s, minimal_change=False):\n h = html_parser.HTMLParser()\n s = h.unescape(s)\n \n- # strip paren portions which contain trailing time length (...)\n+ # Strip forbidden characters\n s = (\n s.replace(':', '-')\n .replace('/', '-')"},"message":{"kind":"string","value":"coursera/utils: Update outdated comment."},"project":{"kind":"string","value":"coursera-dl_coursera-dl"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"py"}}},{"rowIdx":1162695,"cells":{"hash":{"kind":"string","value":"980e2a5e2b9ce56b8d60bfac4cde922a9b58f882"},"diff":{"kind":"string","value":"diff --git a/setup.py b/setup.py\nindex .. 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -13,7 +13,7 @@ with open(path.join(here, 'README.rst'), encoding='utf-8') as f:\n \n setup(\n name='tortilla',\n- version='0.1.0.dev2',\n+ version='0.1.0.dev3',\n description='A tiny library for creating wrappers around external APIs',\n long_description=long_description,\n url='https://github.com/redodo/tortilla',"},"message":{"kind":"string","value":"New dev release: .dev3"},"project":{"kind":"string","value":"tortilla_tortilla"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"py"}}},{"rowIdx":1162696,"cells":{"hash":{"kind":"string","value":"ac34a44f9859d101b310aa01732fb014bc41d6e4"},"diff":{"kind":"string","value":"diff --git a/visidata/undo.py b/visidata/undo.py\nindex .. 100644\n--- a/visidata/undo.py\n+++ b/visidata/undo.py\n@@ -29,8 +29,10 @@ def undo(vd, sheet):\n undofunc(*args, **kwargs)\n sheet.undone.append(cmdlogrow)\n sheet.cmdlog_sheet.rows.remove(cmdlogrow)\n+\n+ vd.clearCaches() # undofunc can invalidate the drawcache\n+\n vd.moveToReplayContext(cmdlogrow)\n- vd.clearCaches()\n vd.status(\"%s undone\" % cmdlogrow.longname)\n return"},"message":{"kind":"string","value":"[undo-] clear drawcache before moving to pre-undo context\n\nPer 6a4eccedde5ed1, upon undo, VisiData tries\nto move cursor to row/col of undone command.\n\nIf drawcaches are not cleared, VisiData could fail to find that pre-undo\ncontext."},"project":{"kind":"string","value":"saulpw_visidata"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"py"}}},{"rowIdx":1162697,"cells":{"hash":{"kind":"string","value":"87c46113d1ff9fa25322ab9dadf703e0e8a97d41"},"diff":{"kind":"string","value":"diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2HeadersFrame.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2HeadersFrame.java\nindex .. 100644\n--- a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2HeadersFrame.java\n+++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2HeadersFrame.java\n@@ -34,7 +34,7 @@ public interface Http2HeadersFrame extends Http2StreamFrame {\n int padding();\n \n /**\n- * Returns {@code true} if the END_STREAM flag ist set.\n+ * Returns {@code true} if the END_STREAM flag is set.\n */\n boolean isEndStream();\n }"},"message":{"kind":"string","value":"Fix typo in Http2HeadersFrame javadocs (#)\n\nMotivation:\n\n`Http2HeadersFrame#isEndStream()` JavaDoc says `Returns {@code true} if the END_STREAM flag ist set.`. The typo is `ist` word. However, it should be `is`.\n\n\n\nModification:\n\nChanged `ist` to `is`.\n\n\n\nResult:\n\nBetter JavaDoc by fixing the typo."},"project":{"kind":"string","value":"netty_netty"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"java"}}},{"rowIdx":1162698,"cells":{"hash":{"kind":"string","value":"0b809d71da2990afaf172398d97bd4969186361a"},"diff":{"kind":"string","value":"diff --git a/cloudstack.go b/cloudstack.go\nindex .. 100644\n--- a/cloudstack.go\n+++ b/cloudstack.go\n@@ -729,8 +729,6 @@ func (d *Driver) setNetwork(networkName string, networkID string) error {\n \n \tif networkID != \"\" {\n \t\tnetworkIDs := strings.Split(networkID, \",\")\n-\t\tnetworkIDsResult = make([]string, len(networkIDs))\n-\t\tnetworkNamesResult = make([]string, len(networkIDs))\n \t\tfor _, value := range networkIDs {\n \t\t\tnetwork, _, err = cs.Network.GetNetworkByID(value, d.setParams)\n \t\t\tif err != nil {\n@@ -741,8 +739,6 @@ func (d *Driver) setNetwork(networkName string, networkID string) error {\n \t\t}\n \t} else {\n \t\tnetworkNames := strings.Split(networkName, \",\")\n-\t\tnetworkIDsResult = make([]string, len(networkNames))\n-\t\tnetworkNamesResult = make([]string, len(networkNames))\n \t\tfor _, value := range networkNames {\n \t\t\tnetwork, _, err = cs.Network.GetNetworkByName(value, d.setParams)\n \t\t\tif err != nil {"},"message":{"kind":"string","value":"setNetwork: removing slice initialization with wrong size"},"project":{"kind":"string","value":"andrestc_docker-machine-driver-cloudstack"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"go"}}},{"rowIdx":1162699,"cells":{"hash":{"kind":"string","value":"aaca93046c5a6d0a16880ac0bc17c6890c57ffa9"},"diff":{"kind":"string","value":"diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js\nindex .. 100644\n--- a/spec/api-browser-window-spec.js\n+++ b/spec/api-browser-window-spec.js\n@@ -480,6 +480,8 @@ describe('browser-window module', function() {\n });\n \n describe('beginFrameSubscription method', function() {\n+ this.timeout(20000);\n+\n it('subscribes frame updates', function(done) {\n let called = false;\n w.loadURL(\"file://\" + fixtures + \"/api/blank.html\");"},"message":{"kind":"string","value":"spec: Give beginFrameSubscription test more time to run"},"project":{"kind":"string","value":"electron_electron"},"split":{"kind":"string","value":"train"},"diff_languages":{"kind":"string","value":"js"}}}],"truncated":false,"partial":false},"paginationData":{"pageIndex":11626,"numItemsPerPage":100,"numTotalItems":1165213,"offset":1162600,"length":100}},"jwt":"eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJwZXJtaXNzaW9ucyI6eyJyZXBvLmNvbnRlbnQucmVhZCI6dHJ1ZX0sImlhdCI6MTc1Njk5MDgyMCwic3ViIjoiL2RhdGFzZXRzL01heHNjaGEvY29tbWl0YmVuY2giLCJleHAiOjE3NTY5OTQ0MjAsImlzcyI6Imh0dHBzOi8vaHVnZ2luZ2ZhY2UuY28ifQ.0ODWthEeqgpF5LsfRBpTWCV-dHUx_d4CXoFVknDiP-pm07ZUszHViG15XIrHBuBY85Am6PDSR-hxc6Rn3a_cCQ","displayUrls":true},"discussionsStats":{"closed":0,"open":1,"total":1},"fullWidth":true,"hasGatedAccess":true,"hasFullAccess":true,"isEmbedded":false,"savedQueries":{"community":[{"views":[{"key":"default/test","displayName":"test","viewName":"test"},{"key":"default/train","displayName":"train","viewName":"train"}],"sql":"SELECT * \nFROM train \nWHERE diff_languages = 'java';","title":"Java Commits in Train Set","createdAt":"2025-05-13T03:33:38.926Z","slug":"K91r3N6","private":false,"justification":"Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.","viewNames":["test","train"]},{"views":[{"key":"default/test","displayName":"test","viewName":"test"}],"sql":"SELECT * \nFROM test \nWHERE diff_languages = 'java'\nLIMIT 5000;","title":"Java Commits Test Data","createdAt":"2025-05-13T03:31:21.970Z","slug":"6JAbeB1","private":false,"justification":"Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.","viewNames":["test"]},{"views":[{"key":"default/test","displayName":"test","viewName":"test"}],"sql":"SELECT * \nFROM test \nWHERE diff_languages = 'java'\nLIMIT 1000;","title":"Java Commits Sample","createdAt":"2025-05-10T05:41:28.392Z","slug":"CLaLmFr","private":false,"justification":"Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.","viewNames":["test"]},{"views":[{"key":"default/validation","displayName":"validation","viewName":"validation"},{"key":"default/train","displayName":"train","viewName":"train"},{"key":"default/test","displayName":"test","viewName":"test"}],"sql":"SELECT * \nFROM validation \nWHERE diff_languages = 'java'\nLIMIT 1000;","title":"Java Commits Validation Sample","createdAt":"2025-05-10T05:39:00.013Z","slug":"hLwtCx9","private":false,"justification":"Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.","viewNames":["validation","train","test"]},{"views":[{"key":"default/validation","displayName":"validation","viewName":"validation"},{"key":"default/train","displayName":"train","viewName":"train"},{"key":"default/test","displayName":"test","viewName":"test"}],"sql":"SELECT * \nFROM validation \nWHERE diff_languages = 'java'\nLIMIT 100;","title":"Java Commits in Validation","createdAt":"2025-05-10T05:38:14.153Z","slug":"IQ4aiWv","private":false,"justification":"This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.","viewNames":["validation","train","test"]},{"views":[{"key":"default/test","displayName":"test","viewName":"test"},{"key":"default/train","displayName":"train","viewName":"train"}],"sql":"SELECT * \nFROM train \nWHERE diff_languages = 'java'\nLIMIT 100;","title":"Java Commits Sample","createdAt":"2025-04-05T05:04:49.609Z","slug":"HToYeeG","private":false,"justification":"This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.","viewNames":["test","train"]},{"views":[{"key":"default/test","displayName":"test","viewName":"test"}],"sql":"SELECT * \nFROM test \nWHERE diff_languages = 'java'\nLIMIT 100;","title":"Java Commits Sample","createdAt":"2025-04-05T05:03:22.570Z","slug":"zD2HkSK","private":false,"justification":"Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.","viewNames":["test"]},{"views":[{"key":"default/validation","displayName":"validation","viewName":"validation"},{"key":"default/train","displayName":"train","viewName":"train"}],"sql":"SELECT *\nFROM train\nWHERE diff_languages = 'java'\nLIMIT 10;","title":"Java Commits Sample","createdAt":"2025-04-05T02:13:41.246Z","slug":"RAGw6Xe","private":false,"justification":"Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.","viewNames":["validation","train"]},{"views":[{"key":"default/train","displayName":"train","viewName":"train"},{"key":"default/validation","displayName":"validation","viewName":"validation"},{"key":"default/test","displayName":"test","viewName":"test"}],"sql":"SELECT *\nFROM validation\nWHERE diff_languages = 'java'\nLIMIT 1000;","title":"Java Commits Validation Sample","createdAt":"2025-04-04T18:50:53.934Z","slug":"xM16jIT","private":false,"justification":"Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.","viewNames":["train","validation","test"]},{"views":[{"key":"default/train","displayName":"train","viewName":"train"},{"key":"default/validation","displayName":"validation","viewName":"validation"},{"key":"default/test","displayName":"test","viewName":"test"}],"sql":"SELECT *\nFROM train\nWHERE diff_languages = 'java'\nLIMIT 1000;","title":"Java Commits Sample","createdAt":"2025-04-04T18:50:26.596Z","slug":"ZlJUjZ2","private":false,"justification":"This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.","viewNames":["train","validation","test"]}],"user":[]}}">

hash
stringlengths
40
40
diff
stringlengths
131
26.7k
message
stringlengths
7
694
project
stringlengths
5
67
split
stringclasses
1 value
diff_languages
stringlengths
2
24
441540a91ddf86810eef11734dfd45310103104e
diff --git a/lib/Core/Site/QueryType/CriteriaBuilder.php b/lib/Core/Site/QueryType/CriteriaBuilder.php index <HASH>..<HASH> 100644 --- a/lib/Core/Site/QueryType/CriteriaBuilder.php +++ b/lib/Core/Site/QueryType/CriteriaBuilder.php @@ -167,14 +167,18 @@ final class CriteriaBuilder private function buildLogicalNot(CriterionDefinition $definition): LogicalNot { $criteria = $this->build($definition->value); + $criterion = $this->reduceCriteria($criteria); + return new LogicalNot($criterion); + } + + private function reduceCriteria(array $criteria): Criterion + { if (count($criteria) === 1) { - $criteria = reset($criteria); - } else { - $criteria = new LogicalAnd($criteria); + return reset($criteria); } - return new LogicalNot($criteria); + return new LogicalAnd($criteria); } /**
Extract method to get rid of else block
netgen_ezplatform-site-api
train
php
1b7e2438133a680ee7eca7f3d85e8ecc9e81c5be
diff --git a/manifest.php b/manifest.php index <HASH>..<HASH> 100644 --- a/manifest.php +++ b/manifest.php @@ -32,7 +32,7 @@ return array( 'label' => 'Delivery core extension', 'description' => 'TAO delivery extension manges the administration of the tests', 'license' => 'GPL-2.0', - 'version' => '8.5.0', + 'version' => '8.5.1', 'author' => 'Open Assessment Technologies, CRP Henri Tudor', 'requires' => array( 'tao' => '>=15.2.0', diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php index <HASH>..<HASH> 100644 --- a/scripts/update/Updater.php +++ b/scripts/update/Updater.php @@ -345,7 +345,7 @@ class Updater extends \common_ext_ExtensionUpdater { $this->setVersion('7.1.0'); } - $this->skip('7.1.0', '8.5.0'); + $this->skip('7.1.0', '8.5.1'); } }
Bump to version <I>
oat-sa_extension-tao-delivery
train
php,php
7f5ad041cc26f8a0240c2efbf9be9e6bb6e4fc39
diff --git a/lib/http-api.js b/lib/http-api.js index <HASH>..<HASH> 100644 --- a/lib/http-api.js +++ b/lib/http-api.js @@ -117,13 +117,17 @@ module.exports.MatrixHttpApi.prototype = { clearTimeout(xhr.timeout_timer); if (!xhr.responseText) { - cb(new Error('No response body.')); + var err = new Error('No response body.'); + err.http_status = xhr.status; + cb(err); return; } var resp = JSON.parse(xhr.responseText); if (resp.content_uri === undefined) { - cb(new Error('Bad response')); + var err = Error('Bad response'); + err.http_status = xhr.status; + cb(err); return; }
Pass the http status out with the error so upper level can can see what went wrong.
matrix-org_matrix-js-sdk
train
js
909dc4f7efed8293e31edc2f92b1603c1f36e65e
diff --git a/tango/test_context.py b/tango/test_context.py index <HASH>..<HASH> 100644 --- a/tango/test_context.py +++ b/tango/test_context.py @@ -94,7 +94,7 @@ class DeviceTestContext(object): nodb = "dbase=no" command = "{0} {1} -ORBendPoint giop:tcp:{2}:{3} -file={4}" - connect_timeout = 1. + connect_timeout = 3. disconnect_timeout = connect_timeout def __init__(self, device, device_cls=None, server_name=None, diff --git a/tests/test_event.py b/tests/test_event.py index <HASH>..<HASH> 100644 --- a/tests/test_event.py +++ b/tests/test_event.py @@ -78,7 +78,7 @@ def test_subscribe_event(event_device): "attr", EventType.CHANGE_EVENT, callback, wait=True) event_device.command_inout("send_event", wait=True) # Wait for tango event - retries = 10 + retries = 20 for _ in range(retries): event_device.read_attribute("state", wait=True) if len(results) > 1:
Increase timeouts for unit-testing
tango-controls_pytango
train
py,py
01af6da6013713918287cb032040003beb21a16a
diff --git a/lib/moodlelib.php b/lib/moodlelib.php index <HASH>..<HASH> 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -2627,6 +2627,17 @@ function authenticate_user_login($username, $password) { } } } + + /// Log in to a second system if necessary + if (!empty($CFG->sso)) { + include_once($CFG->dirroot .'/sso/'. $CFG->sso .'/lib.php'); + if (function_exists('sso_user_login')) { + if (!sso_user_login($username, $password)) { // Perform the signon process + notify('Second sign-on failed'); + } + } + } + return $user; } else {
Added hooks for new SSO capability (Single-Sign-On or Second-Sign-On)
moodle_moodle
train
php
6899900a462b5fa5e7d6e366d23f4f8c6ab9b976
diff --git a/tftp_test.go b/tftp_test.go index <HASH>..<HASH> 100644 --- a/tftp_test.go +++ b/tftp_test.go @@ -202,9 +202,6 @@ func testSendReceive(t *testing.T, client *Client, length int64) { if err != nil { t.Fatalf("requesting write %s: %v", filename, err) } - if ot, ok := writeTransfer.(OutgoingTransfer); ok { - ot.SetSize(length) - } r := io.LimitReader(newRandReader(rand.NewSource(42)), length) n, err := writeTransfer.ReadFrom(r) if err != nil {
cleanup: SetSize does not work on client side
pin_tftp
train
go
46c4b7b83e9e50426dfcf9c13f72ccb3ba84534a
diff --git a/views/v3/partials/sidebar.blade.php b/views/v3/partials/sidebar.blade.php index <HASH>..<HASH> 100644 --- a/views/v3/partials/sidebar.blade.php +++ b/views/v3/partials/sidebar.blade.php @@ -1,9 +1,11 @@ @if(isset($id) && $id) @php do_action('Municipio/sidebar/beforeSidebar', $id); @endphp + @section('sidebar.' . $id . '.before')@show @if (is_active_sidebar($id)) <div id="sidebar-{{$id}}" class="sidebar-{{$id}} {{isset($classes) ? is_array($classes) ? implode(' ', $classes) : $classes : ''}}"> @php dynamic_sidebar($id); @endphp {{-- TODO: Move functions to Controller --}} </div> @endif + @section('sidebar.' . $id . '.after')@show @php do_action('Municipio/sidebar/afterSidebar', $id); @endphp @endif \ No newline at end of file
Add before / after section to all sidebars
helsingborg-stad_Municipio
train
php
96abf32b29fb5b1613e50404979ae4965c2656a2
diff --git a/protocols/raft/src/main/java/io/atomix/protocols/raft/roles/LeaderAppender.java b/protocols/raft/src/main/java/io/atomix/protocols/raft/roles/LeaderAppender.java index <HASH>..<HASH> 100644 --- a/protocols/raft/src/main/java/io/atomix/protocols/raft/roles/LeaderAppender.java +++ b/protocols/raft/src/main/java/io/atomix/protocols/raft/roles/LeaderAppender.java @@ -450,7 +450,7 @@ final class LeaderAppender extends AbstractAppender { // Verify that the leader has contacted a majority of the cluster within the last two election timeouts. // If the leader is not able to contact a majority of the cluster within two election timeouts, assume // that a partition occurred and transition back to the FOLLOWER state. - if (System.currentTimeMillis() - Math.max(getHeartbeatTime(), leaderTime) > raft.getElectionTimeout().toMillis() * 2) { + if (member.getFailureCount() >= 3 && System.currentTimeMillis() - Math.max(getHeartbeatTime(), leaderTime) > raft.getElectionTimeout().toMillis() * 2) { log.warn("Suspected network partition. Stepping down"); raft.setLeader(null); raft.transition(RaftServer.Role.FOLLOWER);
Wait minimum number of AppendRequest failures before detecting network partition to account for single request timeouts that are longer than the election timeout.
atomix_atomix
train
java
3e41f772474975f8e95d45d555e37acfdef08280
diff --git a/server/const.go b/server/const.go index <HASH>..<HASH> 100644 --- a/server/const.go +++ b/server/const.go @@ -41,7 +41,7 @@ var ( const ( // VERSION is the current version for the server. - VERSION = "2.9.0-RC.6" + VERSION = "2.9.0-RC.7" // PROTO is the currently supported protocol. // 0 was the original
Bump to <I>-RC<I>
nats-io_gnatsd
train
go
3ba67e6c3f78c76f014d40fdf2b6aacc12ba6ac3
diff --git a/bundles/BlockManagerBundle/EventListener/LayoutResolverListener.php b/bundles/BlockManagerBundle/EventListener/LayoutResolverListener.php index <HASH>..<HASH> 100644 --- a/bundles/BlockManagerBundle/EventListener/LayoutResolverListener.php +++ b/bundles/BlockManagerBundle/EventListener/LayoutResolverListener.php @@ -50,7 +50,7 @@ class LayoutResolverListener implements EventSubscriberInterface */ public static function getSubscribedEvents() { - return array(KernelEvents::REQUEST => 'onKernelRequest'); + return array(KernelEvents::REQUEST => array('onKernelRequest', -255)); } /**
Make sure layout resolver listener runs last
netgen-layouts_layouts-core
train
php
cdc0a53f92cce05bafcbc09b44be7b52a1f7485e
diff --git a/builder/vmware/common/driver_config.go b/builder/vmware/common/driver_config.go index <HASH>..<HASH> 100644 --- a/builder/vmware/common/driver_config.go +++ b/builder/vmware/common/driver_config.go @@ -2,6 +2,7 @@ package common import ( "fmt" + "os" "github.com/mitchellh/packer/packer" )
builder/vmware: fix compilation issues
hashicorp_packer
train
go
d8062695941b0dc0fbd48007eb9c66963fe0b811
diff --git a/lfs/credentials.go b/lfs/credentials.go index <HASH>..<HASH> 100644 --- a/lfs/credentials.go +++ b/lfs/credentials.go @@ -105,6 +105,9 @@ func getCredURLForAPI(req *http.Request) (*url.URL, error) { func fillCredentials(u *url.URL) (Creds, error) { path := strings.TrimPrefix(u.Path, "/") creds := Creds{"protocol": u.Scheme, "host": u.Host, "path": path} + if u.User != nil && u.User.Username() != "" { + creds["username"] = u.User.Username() + } return execCreds(creds, "fill") }
Include the username in the creds call if present This is needed to disambiguate cases where a user has multiple usernames on the same host. Without this the first item will be silently used which might be wrong & cause a loop of incorrect password prompts (& possibly a lockout on the server)
git-lfs_git-lfs
train
go
75eda3be9f1a76073d600260669cb90299be8498
diff --git a/broqer/hub.py b/broqer/hub.py index <HASH>..<HASH> 100644 --- a/broqer/hub.py +++ b/broqer/hub.py @@ -108,7 +108,7 @@ True import asyncio from collections import OrderedDict from types import MappingProxyType -from typing import Any, Optional +from typing import Any, Optional, Dict # noqa: F401 from broqer import Publisher, Subscriber, SubscriptionDisposable @@ -118,6 +118,7 @@ class Topic(Publisher, Subscriber): Publisher.__init__(self) self._subject = None # type: Publisher self._path = path + self._meta = dict() # type: Dict[str, Any] def subscribe(self, subscriber: 'Subscriber') -> SubscriptionDisposable: disposable = Publisher.subscribe(self, subscriber) @@ -169,7 +170,7 @@ class Topic(Publisher, Subscriber): @property def meta(self) -> dict: - return getattr(self, '_meta', None) + return self._meta @property def path(self) -> str: @@ -231,7 +232,7 @@ class Hub: non_keys = set(meta.keys()) - self._permitted_meta_keys if non_keys: raise KeyError('Not permitted meta keys: %r' % non_keys) - setattr(topic, '_meta', meta) # ._meta is not yet existing + topic._meta.update(meta) if hasattr(topic, '_assignment_future'): topic._assignment_future.set_result(None)
add .meta to every Topic
semiversus_python-broqer
train
py
b013b0a473d70a51f5bce15841940b23a0dca69a
diff --git a/src/Illuminate/Database/Connection.php b/src/Illuminate/Database/Connection.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Database/Connection.php +++ b/src/Illuminate/Database/Connection.php @@ -658,7 +658,11 @@ class Connection implements ConnectionInterface { { $message = $e->getPrevious()->getMessage(); - return str_contains($message, ['server has gone away', 'no connection to the server']); + return str_contains($message, [ + 'server has gone away', + 'no connection to the server', + 'Lost connection' + ]); } /**
retry on 'Lost connection' also
laravel_framework
train
php
424165f4f2af70274d9db7c5ef2acb308f9bf9ef
diff --git a/tests/changelog.py b/tests/changelog.py index <HASH>..<HASH> 100644 --- a/tests/changelog.py +++ b/tests/changelog.py @@ -108,6 +108,16 @@ class releases(Spec): assert isinstance(entries[0], issue) eq_(entries[0].number, None) + def unreleased_items_go_in_unreleased_release(self): + issues = [ + _release('1.0.2'), _entry(self.f), _entry(self.b), _release('1.0.0') + ] + releases = construct_releases(issues, self.app) + entries = releases[-1]['entries'] + eq_(len(entries), 1) + assert self.f in entries + eq_(releases[-1]['obj'].number, 'unreleased') + class nodes(Spec): """
Test for 'unreleased' entry
bitprophet_releases
train
py
4f35659de31fff0452a5f295df9e117fd16a54a1
diff --git a/gcloud/datastore/test_key.py b/gcloud/datastore/test_key.py index <HASH>..<HASH> 100644 --- a/gcloud/datastore/test_key.py +++ b/gcloud/datastore/test_key.py @@ -19,8 +19,7 @@ class TestKey(unittest2.TestCase): pb.partition_id.namespace = namespace for elem in path: added = pb.path_element.add() - if 'kind' in elem: - added.kind = elem['kind'] + added.kind = elem['kind'] if 'id' in elem: added.id = elem['id'] if 'name' in elem:
<I>% branch coverage for gcloud.datastore.test_key. Don't worry about path elem w/o kind.
googleapis_google-cloud-python
train
py
7c601adbd68e80449929de5ac58218e80758d1b1
diff --git a/dask_ml/model_selection/utils.py b/dask_ml/model_selection/utils.py index <HASH>..<HASH> 100644 --- a/dask_ml/model_selection/utils.py +++ b/dask_ml/model_selection/utils.py @@ -4,6 +4,7 @@ from distutils.version import LooseVersion import dask import dask.array as da +import dask.dataframe as dd import scipy.sparse as sp from dask.base import tokenize from dask.delayed import Delayed, delayed @@ -45,7 +46,7 @@ def to_indexable(*args, **kwargs): else: indexable = _indexable for x in args: - if x is None or isinstance(x, da.Array): + if x is None or isinstance(x, (da.Array, dd.DataFrame)): yield x elif is_dask_collection(x): yield delayed(indexable, pure=True)(x)
update indexable() to just yield dask dataframes (issue #<I>) (#<I>) * update indexable() to just yield dask dataframes, as mentioned in issue #<I>
dask_dask-ml
train
py
e9aa74dbf809e13aeee224ddaa135250112afa89
diff --git a/elasticsearch_dsl/filter.py b/elasticsearch_dsl/filter.py index <HASH>..<HASH> 100644 --- a/elasticsearch_dsl/filter.py +++ b/elasticsearch_dsl/filter.py @@ -80,12 +80,9 @@ class Bool(BoolMixin, Filter): if self.should and other.should: selfshould, othershould = self.should[:], other.should[:] # required subfilter, move to must - if len(selfshould) == 1: - f.must.append(selfshould.pop()) - - # required subfilter, move to must - if len(othershould) == 1: - f.must.append(othershould.pop()) + for s in (selfshould, othershould): + if len(s) == 1: + f.must.append(s.pop()) # we have leftover lists, nothing to do but add to must as bool(should) if selfshould and othershould:
Cleaner code for filter __and__
elastic_elasticsearch-dsl-py
train
py
a9dff7f2dbd15c047da05959b40556668ffea833
diff --git a/src/AbstractContainer.php b/src/AbstractContainer.php index <HASH>..<HASH> 100644 --- a/src/AbstractContainer.php +++ b/src/AbstractContainer.php @@ -456,6 +456,8 @@ abstract class AbstractContainer implements ContainerInterface "Missing required parameter \"$name\" when instantiating \"$class\"." ); } + } if ($dependency instanceof Closure) { + $dependencies[$index] = call_user_func($dependency, $this); } }
Added resolving `Closure` dependency
yiisoft_di
train
php
45980fe097ca43d957ab6df3f2a62eaae6ce2ad3
diff --git a/broqer/op/_operator.py b/broqer/op/_operator.py index <HASH>..<HASH> 100644 --- a/broqer/op/_operator.py +++ b/broqer/op/_operator.py @@ -1,3 +1,5 @@ +from abc import ABCMeta, abstractmethod + from broqer import Publisher, Subscriber, SubscriptionDisposable @@ -23,6 +25,10 @@ class Operator(Publisher, Subscriber): # pylint: disable=abstract-method subscriber.emit(*args, who=self) # pylint: disable=E1133 return disposable + @abstractmethod + def get(self): + return None + def unsubscribe(self, subscriber: Subscriber) -> None: Publisher.unsubscribe(self, subscriber) if not self._subscriptions: @@ -57,6 +63,9 @@ class MultiOperator(Publisher, Subscriber): # pylint: disable=abstract-method for _publisher in self._publishers: _publisher.unsubscribe(self) + @abstractmethod + def get(self): + return None def build_operator(operator_cls): """ This function is taking an operator class and is returning a function
make get() of Operator and MultiOperator an abstractmethod to prevent wrong usage
semiversus_python-broqer
train
py
d9df25243f6f65218b61fbd9b3878b86213399be
diff --git a/src/adapters/pouch.idb.js b/src/adapters/pouch.idb.js index <HASH>..<HASH> 100644 --- a/src/adapters/pouch.idb.js +++ b/src/adapters/pouch.idb.js @@ -354,6 +354,11 @@ var IdbPouch = function(opts, callback) { }); }); } else { + if (doc._attachments){ + for (var key in doc._attachments) { + doc._attachments[key].stub = true; + } + } callback(null, doc); } }; diff --git a/tests/test.attachments.js b/tests/test.attachments.js index <HASH>..<HASH> 100644 --- a/tests/test.attachments.js +++ b/tests/test.attachments.js @@ -74,4 +74,19 @@ }); }); + asyncTest("Test remove doc with attachment", function() { + initTestDB(this.name, function(err, db) { + db.put({ _id: 'mydoc' }, function(err, resp) { + db.putAttachment('mydoc/mytext', resp.rev, 'Mytext', 'text/plain', function(err, res) { + db.get('mydoc',{attachments:false},function(err,doc){ + db.remove(doc, function(err, resp){ + ok(res.ok); + start(); + }); + }); + }); + }); + }); + }); + });
Test and fix for removing doc with attachments (via @chendricks)
pouchdb_pouchdb
train
js,js
5e95a6afb8043d84a4a48efb4c925d68b94fc98c
diff --git a/lib/runner.js b/lib/runner.js index <HASH>..<HASH> 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -169,14 +169,14 @@ Object.assign(Runner.prototype, { this.builder.emit( 'query-response', postProcessedResponse, - Object.assign({ __knexUid: this.connection.__knexUid }, obj), + Object.assign({ __knexUid, __knexTxId }, obj), this.builder ); this.client.emit( 'query-response', postProcessedResponse, - Object.assign({ __knexUid: this.connection.__knexUid }, obj), + Object.assign({ __knexUid, __knexTxId }, obj), this.builder ); @@ -230,7 +230,7 @@ Object.assign(Runner.prototype, { this.builder.emit( 'query-error', error, - Object.assign({ __knexUid: this.connection.__knexUid }, obj) + Object.assign({ __knexUid, __knexTxId }, obj) ); throw error; });
Make sure query-response and query-error events contain _knexTxId (#<I>)
tgriesser_knex
train
js
afe8eb55887c27a59d920fd94fee814963a85c41
diff --git a/tests/integration/test_model.py b/tests/integration/test_model.py index <HASH>..<HASH> 100644 --- a/tests/integration/test_model.py +++ b/tests/integration/test_model.py @@ -298,7 +298,7 @@ async def test_add_manual_machine_ssh(event_loop): 'name': test_name, 'source': { 'type': 'image', - 'alias': 'xenial', + 'alias': 'bionic', 'mode': 'pull', 'protocol': 'simplestreams', 'server': 'https://cloud-images.ubuntu.com/releases', @@ -354,7 +354,6 @@ async def test_add_manual_machine_ssh(event_loop): container.stop(wait=True) container.delete(wait=True) - profile.delete() @@ -415,7 +414,7 @@ async def test_add_manual_machine_ssh_root(event_loop): 'name': test_name, 'source': { 'type': 'image', - 'alias': 'xenial', + 'alias': 'bionic', 'mode': 'pull', 'protocol': 'simplestreams', 'server': 'https://cloud-images.ubuntu.com/releases',
use bionic instead of xenial on the added container Fixes #<I>
juju_python-libjuju
train
py
46f73c6fbd74361a39c80880fad60e9292dcb0b0
diff --git a/lib/parser_block.js b/lib/parser_block.js index <HASH>..<HASH> 100644 --- a/lib/parser_block.js +++ b/lib/parser_block.js @@ -109,17 +109,13 @@ ParserBlock.prototype.parse = function (src, options, env) { if (!src) { return ''; } - if (src.indexOf('\r') >= 0) { - src = src.replace(/\r/, ''); - } - - if (src.indexOf('\u00a0') >= 0) { - src = src.replace(/\u00a0/g, ' '); - } + // Normalize spaces + src = src.replace(/\u00a0/g, ' '); - if (src.indexOf('\u2424') >= 0) { - src = src.replace(/\u2424/g, '\n'); - } + // Normalize newlines + src = src.replace(/\r\n/, '\n'); + src = src.replace(/\r\u0085/, '\n'); + src = src.replace(/[\u2424\u2028\u0085]/g, '\n'); // Replace tabs with proper number of spaces (1..4) if (src.indexOf('\t') >= 0) {
Extended spaces & line breaks normalization
markdown-it_markdown-it
train
js
f2a982982b581d55eeb2c128652fd048170e5a2b
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -387,6 +387,7 @@ function ApostropheSchemas(options, callback) { var results = []; return async.eachSeries(data, function(datum, callback) { var result = {}; + result.id = self._apos.sanitizeId(datum.id) || self._apos.generateId(); return self.convertFields(req, schema, 'form', datum, result, function(err) { if (err) { return callback(err); diff --git a/public/js/editor.js b/public/js/editor.js index <HASH>..<HASH> 100644 --- a/public/js/editor.js +++ b/public/js/editor.js @@ -198,6 +198,7 @@ function AposSchemas() { } var result = {}; var $element = $($elements[i]); + result.id = $element.attr('data-id'); return self.convertFields($element, field.schema, result, function(_err) { if (_err) { err = _err; @@ -381,6 +382,8 @@ function AposSchemas() { addRemoveHandler($element); addMoveHandler($element); + $element.attr('data-id', data[i].id); + $elements.append($element); return self.populateFields($element, field.schema, data[i], function() { i++;
schema properties now have a globally unique id field
apostrophecms-legacy_apostrophe-schemas
train
js,js
de9ce5a93f2d262da86381834de7b7eba97e12ce
diff --git a/src/Mouf/Composer/ComposerService.php b/src/Mouf/Composer/ComposerService.php index <HASH>..<HASH> 100644 --- a/src/Mouf/Composer/ComposerService.php +++ b/src/Mouf/Composer/ComposerService.php @@ -530,6 +530,15 @@ class ComposerService { $moufUiFileWriter = new MoufUIFileWritter($composer); $moufUiFileWriter->writeMoufUI(); } + + /** + * Returns the Composer config object + * @param string $param + * @return string + */ + public function getComposerConfig() { + return $this->getComposer()->getConfig(); + } } ?> \ No newline at end of file
Adding method to fetch Composer's config in Composer service.
thecodingmachine_mouf
train
php
dee8495e096d7fb282c86f2b753f1f03aed9a5fb
diff --git a/lib/extract.js b/lib/extract.js index <HASH>..<HASH> 100644 --- a/lib/extract.js +++ b/lib/extract.js @@ -31,16 +31,9 @@ module.exports = function (archive, dest, optionspath, options) { // When a stdout is emitted, parse each line and search for a pattern. When // the pattern is found, extract the file (or directory) name from it and // pass it to an array. Finally returns this array. - // Also check if a file is extracted using an Unsupported Method of 7-Zip. .progress(function (data) { var entries = []; - var isUnsupportedMethod = (data.search('Unsupported Method')) - ? true - : false; - if (isUnsupportedMethod) { - return reject(new Error('Unsupported Method')) - } data.split('\n').forEach(function (line) { if (line.substr(0, 12) === 'Extracting ') {
removed unsupported method check, give error on valid archives created on same host using same binary, seems like a bug to me
quentinrossetti_node-7z
train
js
ab16933575c31ff59472e19b9b2e3a69d289fd40
diff --git a/lnwallet/channel.go b/lnwallet/channel.go index <HASH>..<HASH> 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -589,9 +589,6 @@ func createCommitTx(fundingOutput *wire.TxIn, selfKey, theirKey *btcec.PublicKey commitTx := wire.NewMsgTx() commitTx.Version = 2 commitTx.AddTxIn(fundingOutput) - // TODO(roasbeef): we default to blocks, make configurable as part of - // channel reservation. - commitTx.TxIn[0].Sequence = lockTimeToSequence(false, csvTimeout) commitTx.AddTxOut(wire.NewTxOut(int64(amountToSelf), payToUsScriptHash)) commitTx.AddTxOut(wire.NewTxOut(int64(amountToThem), payToThemScriptHash))
lnwallet: commit tx should have final sequence num
lightningnetwork_lnd
train
go
2c3443244d7ac848c8c72ca6c0b739e41386ab0a
diff --git a/sirmordred/_version.py b/sirmordred/_version.py index <HASH>..<HASH> 100644 --- a/sirmordred/_version.py +++ b/sirmordred/_version.py @@ -1,2 +1,2 @@ # Versions compliant with PEP 440 https://www.python.org/dev/peps/pep-0440 -__version__ = "0.1.31" +__version__ = "0.1.32"
[release] Update version number to <I>
chaoss_grimoirelab-sirmordred
train
py
e9b4bf998a7f10695b5e1b28ce62e63075882344
diff --git a/src/lokijs.js b/src/lokijs.js index <HASH>..<HASH> 100644 --- a/src/lokijs.js +++ b/src/lokijs.js @@ -1472,12 +1472,13 @@ * @memberof LokiFsAdapter */ LokiFsAdapter.prototype.saveDatabase = function saveDatabase(dbname, dbstring, callback) { + var self = this; var tmpdbname = dbname + '~'; this.fs.writeFile(tmpdbname, dbstring, function writeFileCallback(err) { if (err) { callback(new Error(err)); } else { - this.fs.rename(tmpdbname,dbname,callback); + self.fs.rename(tmpdbname,dbname,callback); } }); };
Fixed 'this' scoping in saveDatabase
techfort_LokiJS
train
js
d3b4e710aae1d82f8e4c4fbb2b7575441051772e
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -85,7 +85,9 @@ export default function prepareAxios(pageResponse, axiosInstance = null) { return targetAxios.request(newConfig); } else { // return an empty promise instead of making the call from the server side - return new Promise(() => {}); + const emptyPromise = new Promise(() => {}); + emptyPromise.empty = true; + return emptyPromise; } }
leave a way to tell if a promise is an empty promise, just in case
BernzSed_axios-push
train
js
d979f829e5fd30ab95ed2a0d35acf235bd7c6d3e
diff --git a/contrib/sacrebleu/sacrebleu.py b/contrib/sacrebleu/sacrebleu.py index <HASH>..<HASH> 100755 --- a/contrib/sacrebleu/sacrebleu.py +++ b/contrib/sacrebleu/sacrebleu.py @@ -165,7 +165,7 @@ from collections import Counter, namedtuple from itertools import zip_longest from typing import List, Iterable, Tuple -VERSION = '1.2' +VERSION = '1.2.1' try: # SIGPIPE is not available on Windows machines, throwing an exception. @@ -1340,7 +1340,6 @@ def main(): if args.score_only: print('{:.2f}'.format(chrf)) else: - version_str = build_signature_chrf(args, len(refs)) print('CHRF = {:.2f}'.format(chrf)) if __name__ == '__main__':
small bugfix (#<I>)
awslabs_sockeye
train
py
9eff093c2799cad19869a215f36a2d7946d00f34
diff --git a/src/cloudant/design_document.py b/src/cloudant/design_document.py index <HASH>..<HASH> 100644 --- a/src/cloudant/design_document.py +++ b/src/cloudant/design_document.py @@ -19,11 +19,12 @@ class DesignDocument(Document): """ def __init__(self, cloudant_database, document_id=None): super(DesignDocument, self).__init__(cloudant_database, document_id) + self.setdefault('views', {}) @property def views(self): """accessor property for views dictionary""" - return self['views'] + return self.get('views') def add_view(self, view_name, map_func, reduce_func=None): """
Fix view manipulation in DesignDocument - Initialize views sub dict
cloudant_python-cloudant
train
py
536d1c1acec33f299438a96a7b2c8d382a88a63c
diff --git a/lib/rb-inotify/notifier.rb b/lib/rb-inotify/notifier.rb index <HASH>..<HASH> 100644 --- a/lib/rb-inotify/notifier.rb +++ b/lib/rb-inotify/notifier.rb @@ -270,11 +270,11 @@ module INotify events = [] cookies = {} - while ev = Event.consume(data, self) - events << ev - next if ev.cookie == 0 - cookies[ev.cookie] ||= [] - cookies[ev.cookie] << ev + while event = Event.consume(data, self) + events << event + next if event.cookie == 0 + cookies[event.cookie] ||= [] + cookies[event.cookie] << event end cookies.each {|c, evs| evs.each {|ev| ev.related.replace(evs - [ev]).freeze}} events
Rename conflict variable with the following block This commit removes below interpreter warning. * warning: shadowing outer local variable
guard_rb-inotify
train
rb
2ada4dbc4bd2c6b929395f6e3e8f382b8fef23ad
diff --git a/benchexec/tools/witness2test.py b/benchexec/tools/witness2test.py index <HASH>..<HASH> 100644 --- a/benchexec/tools/witness2test.py +++ b/benchexec/tools/witness2test.py @@ -30,7 +30,7 @@ class Tool(benchexec.tools.template.BaseTool): (https://github.com/diffblue/cprover-sv-comp/pull/14). """ - REQUIRED_PATHS = ['test-gen.sh', 'process_witness.py', 'TestEnvGenerator.pl'] + REQUIRED_PATHS = ['test-gen.sh', 'process_witness.py', 'TestEnvGenerator.pl', 'pycparser-master'] def executable(self): """
witness2test uses pycparser Although test-gen.sh would take care of downloading it, the container-based set up requires preparation beforehand.
sosy-lab_benchexec
train
py
eae1014d05bc1ded3927cccdc0a21d0160a65c70
diff --git a/slave/buildslave/bot.py b/slave/buildslave/bot.py index <HASH>..<HASH> 100644 --- a/slave/buildslave/bot.py +++ b/slave/buildslave/bot.py @@ -526,6 +526,7 @@ class BuildSlave(service.MultiService): if not self.bf.perspective: log.msg("No active connection, shutting down NOW") reactor.stop() + return log.msg("Telling the master we want to shutdown after any running builds are finished") d = self.bf.perspective.callRemote("shutdown")
don't assume that reactor.stop doesn't return (it does)
buildbot_buildbot
train
py
07a7443efc448e12ee00528a9141abb821993d43
diff --git a/lib/caruby/csv/csvio.rb b/lib/caruby/csv/csvio.rb index <HASH>..<HASH> 100644 --- a/lib/caruby/csv/csvio.rb +++ b/lib/caruby/csv/csvio.rb @@ -1,6 +1,3 @@ -require 'rubygems' -gem 'fastercsv' - require 'fileutils' require 'faster_csv' require 'caruby/util/options'
Don't need gem requires with bundle.
caruby_core
train
rb
9bf86bf3d922a35c0dd6f38d4fdc3f96e54e9b23
diff --git a/classes/Pods.php b/classes/Pods.php index <HASH>..<HASH> 100644 --- a/classes/Pods.php +++ b/classes/Pods.php @@ -3739,10 +3739,13 @@ class Pods implements Iterator { $field['name'] = trim( $name ); } - $to_merge = pods_v( $field['name'], $all_fields ); + $to_merge = $this->pod_data->get_field( $field['name'] ); if ( $to_merge ) { $field = pods_config_merge_data( $to_merge, $field ); + + // Override the name field as the alias should not be used. + $field['name'] = $to_merge['name']; } // Never show the ID field. @@ -3881,10 +3884,13 @@ class Pods implements Iterator { $field['name'] = trim( $name ); } - $to_merge = pods_v( $field['name'], $all_fields ); + $to_merge = $this->pod_data->get_field( $field['name'] ); if ( $to_merge ) { $field = pods_config_merge_data( $to_merge, $field ); + + // Override the name field as the alias should not be used. + $field['name'] = $to_merge['name']; } if ( pods_v( 'hidden', $field, false, true ) || 'hidden' === $field['type'] ) {
Support field aliases in form() and view()
pods-framework_pods
train
php
8da25d79aed41865722a120ebea86a5bf4b17c5b
diff --git a/app/services/action_trigger_factory.rb b/app/services/action_trigger_factory.rb index <HASH>..<HASH> 100644 --- a/app/services/action_trigger_factory.rb +++ b/app/services/action_trigger_factory.rb @@ -238,9 +238,10 @@ class ActionTriggerFactory path_messages << c.message(text: "Hi, #{app.name} will reply as soon as they can.", uuid: 1) end - path_messages << route_support - - path_messages.flatten! + if user.email.blank? + path_messages << route_support + path_messages.flatten! + end routing = app.lead_tasks_settings["routing"]
Update action_trigger_factory.rb skip route support if there is an email
michelson_chaskiq
train
rb
37c25d5c511b9222ea384fd4ea1551f06d52a09a
diff --git a/src/Jaspersoft/Service/ReportService.php b/src/Jaspersoft/Service/ReportService.php index <HASH>..<HASH> 100644 --- a/src/Jaspersoft/Service/ReportService.php +++ b/src/Jaspersoft/Service/ReportService.php @@ -89,7 +89,12 @@ class ReportService extends JRSService */ public function getInputControlStructure($uri) { $url = $this->service_url . '/reports' . $uri . '/inputControls'; - $data = $this->service->prepAndSend($url, array(200), 'GET', null, true); + $data = $this->service->prepAndSend($url, array(200, 204), 'GET', null, true); + + if(!$data) { + return []; + } + $json_obj = json_decode($data); $result = array();
Fix for the case of no parameters.
Jaspersoft_jrs-rest-php-client
train
php
8e71bde3332365ca3fa77660c94018ccbd2a4608
diff --git a/ucms_site/src/Access.php b/ucms_site/src/Access.php index <HASH>..<HASH> 100644 --- a/ucms_site/src/Access.php +++ b/ucms_site/src/Access.php @@ -53,24 +53,29 @@ final class Access const OP_DELETE = 'delete'; /** + * Request new site permission + */ + const PERM_SITE_REQUEST = 'site request'; + + /** * User can view global labeled content permission. */ - const PERM_GLOBAL_LABELED_VIEW = 'view global labeled content'; + const PERM_GLOBAL_LABELED_VIEW = 'site content labeled view'; /** * User can view global content permission. */ - const PERM_GLOBAL_VIEW = 'view global content'; + const PERM_GLOBAL_VIEW = 'site content global view'; /** * User can edit global labeled content permission. */ - const PERM_GLOBAL_LABELED_EDIT = 'edit global labeled content'; + const PERM_GLOBAL_LABELED_EDIT = 'site content labeled edit'; /** * User can edit global content permission. */ - const PERM_GLOBAL_EDIT = 'edit global content'; + const PERM_GLOBAL_EDIT = 'site content global edit'; /** * Functional administrator role.
site: renamed permissions
makinacorpus_drupal-ucms
train
php
3ae21f089184590c6628fc0aa568d1e611cdb869
diff --git a/builtin/providers/aws/resource_aws_db_subnet_group.go b/builtin/providers/aws/resource_aws_db_subnet_group.go index <HASH>..<HASH> 100644 --- a/builtin/providers/aws/resource_aws_db_subnet_group.go +++ b/builtin/providers/aws/resource_aws_db_subnet_group.go @@ -165,8 +165,9 @@ func resourceAwsDbSubnetGroupUpdate(d *schema.ResourceData, meta interface{}) er } _, err := conn.ModifyDBSubnetGroup(&rds.ModifyDBSubnetGroupInput{ - DBSubnetGroupName: aws.String(d.Id()), - SubnetIds: sIds, + DBSubnetGroupName: aws.String(d.Id()), + DBSubnetGroupDescription: aws.String(d.Get("description").(string)), + SubnetIds: sIds, }) if err != nil {
Add the description as a part of the update request
hashicorp_terraform
train
go
6425799d65117af84266bddcffb8c0bc2c213d29
diff --git a/lib/vcoworkflows/vcosession.rb b/lib/vcoworkflows/vcosession.rb index <HASH>..<HASH> 100644 --- a/lib/vcoworkflows/vcosession.rb +++ b/lib/vcoworkflows/vcosession.rb @@ -7,6 +7,9 @@ require 'rest_client' module VcoWorkflows # VcoSession class VcoSession + + attr_reader :rest_resource + # Initialize the session # # @param [String] uri URI for the vCenter Orchestrator API endpoint
Added accessor to aid unit testing
activenetwork-automation_vcoworkflows
train
rb
9d15d4bc720a17c4701284890813d075b3172270
diff --git a/src/hamster/db.py b/src/hamster/db.py index <HASH>..<HASH> 100644 --- a/src/hamster/db.py +++ b/src/hamster/db.py @@ -479,6 +479,8 @@ class Storage(storage.Storage): WHERE fact_id = ?""" self.execute(tag_update, (new_fact_id, fact["id"])) #clone tags + trophies.unlock("split") + # overlap start elif start_time < fact["start_time"] < end_time: logging.info("Overlapping start of %s" % fact["name"]) @@ -526,6 +528,8 @@ class Storage(storage.Storage): if not category_id: category_id = self.__add_category(fact.category) + trophies.unlock("no_hands") + # try to find activity, resurrect if not temporary activity_id = self.__get_activity_by_name(fact.activity, category_id,
split and no-hands trophies
projecthamster_hamster
train
py
f65b008c05f047dc2615438d8bf131eb326ec51f
diff --git a/pydivert/__init__.py b/pydivert/__init__.py index <HASH>..<HASH> 100644 --- a/pydivert/__init__.py +++ b/pydivert/__init__.py @@ -20,7 +20,7 @@ from .packet import Packet from .windivert import WinDivert __author__ = 'fabio' -__version__ = '2.0.7' +__version__ = '2.0.8' if _sys.version_info < (3, 4): # add socket.inet_pton on Python < 3.4 diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ workdir = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(workdir, "pydivert", "__init__.py")) as fp: __version__ = fp.read().split("__version__ = '", 1)[1].split("'", 1)[0] -with open(os.path.join(workdir, 'README.rst'), encoding='utf-8') as f: +with open(os.path.join(workdir, 'README.rst')) as f: long_description = f.read() setup(
Something goes wrong on PKG-INFO when encoding is set to UTF-8
ffalcinelli_pydivert
train
py,py
7d005f656b2782d6f4e231035a41757a84e7742c
diff --git a/test/ReadabilityTest.php b/test/ReadabilityTest.php index <HASH>..<HASH> 100644 --- a/test/ReadabilityTest.php +++ b/test/ReadabilityTest.php @@ -115,6 +115,6 @@ class ReadabilityTest extends \PHPUnit_Framework_TestCase $parser = new Readability(new Configuration()); $this->expectException(ParseException::class); $this->expectExceptionMessage('Could not parse text.'); - $parser->parse('<html><body><p>hello</p></body></html>'); + $parser->parse('<html><body><p></p></body></html>'); } }
Fix "unable to parse" test case
andreskrey_readability.php
train
php
7911c87c1a9de287d807b65993a4911889cc206f
diff --git a/db/doc.go b/db/doc.go index <HASH>..<HASH> 100644 --- a/db/doc.go +++ b/db/doc.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package db defines common Data Broker types, and it the parent package -// containing Data Broker client implementations for various key-value and -// SQL data stores. +// Package db defines the common Data Broker types, and it is the parent +// package for Data Broker client implementations for various key-value +// and SQL data stores. package db diff --git a/httpmux/doc.go b/httpmux/doc.go index <HASH>..<HASH> 100644 --- a/httpmux/doc.go +++ b/httpmux/doc.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package httpmux provides a plugin that allows app plugins to -// register and afterwords handle http requests (usually REST based). +// Package httpmux provides an HTTP server to app plugins, where a plugin +// can register at specified URLs one or more HTTP request handlers that +// will handle HTTP requests at run time. package httpmux
Editorial changes to docs.go
ligato_cn-infra
train
go,go
4ba3b2b61b47aa3bc531245519446282edcb3fa1
diff --git a/test/map/NearCachedMapStressTest.js b/test/map/NearCachedMapStressTest.js index <HASH>..<HASH> 100644 --- a/test/map/NearCachedMapStressTest.js +++ b/test/map/NearCachedMapStressTest.js @@ -57,7 +57,7 @@ describe('NearCachedMapStress', function () { } it('stress test with put, get and remove', function (done) { - this.timeout(20000); + this.timeout(120000); var map = client1.getMap(mapName); (function innerOperation() { if (completedOperations >= totalNumOperations) {
increases timeout for near cache stress test
hazelcast_hazelcast-nodejs-client
train
js
09e36bfeeaaca3607eb2db9611030049d824fdb1
diff --git a/modules/social_features/social_group/src/Controller/SocialGroupController.php b/modules/social_features/social_group/src/Controller/SocialGroupController.php index <HASH>..<HASH> 100644 --- a/modules/social_features/social_group/src/Controller/SocialGroupController.php +++ b/modules/social_features/social_group/src/Controller/SocialGroupController.php @@ -3,6 +3,7 @@ namespace Drupal\social_group\Controller; use Drupal\Core\Controller\ControllerBase; +use Drupal\group\Entity\Group; /** * Returns responses for Social Group routes. @@ -21,15 +22,11 @@ class SocialGroupController extends ControllerBase { * The page title. */ public function groupMembersTitle($group) { - if (is_object($group)) { - $group_label = $group->label(); + // If it's not a group then it's a gid. + if (!$group instanceof Group) { + $group = Group::load($group); } - else { - $storage = \Drupal::entityTypeManager()->getStorage('group'); - $group_entity = $storage->load($group); - $group_label = empty($group_entity) ? 'group' : $group_entity->label(); - } - return $this->t('Members of @name', ['@name' => $group_label]); + return $this->t('Members of @name', ['@name' => $group->label()]); } /**
SHN-<I> by jochemvn: Simplify function
goalgorilla_open_social
train
php
2540c43cadbcdc0b994d6bc846f93a8658045ebf
diff --git a/immutable-history/src/Controller/ChangeLogListController.php b/immutable-history/src/Controller/ChangeLogListController.php index <HASH>..<HASH> 100644 --- a/immutable-history/src/Controller/ChangeLogListController.php +++ b/immutable-history/src/Controller/ChangeLogListController.php @@ -71,7 +71,8 @@ class ChangeLogListController implements MiddlewareInterface $humanReadableEvents = $this->getHumanReadableChangeLogByDateRange->__invoke($greaterThanYear, $lessThanYear); $description = 'Content change log events for ' . $days . ' days' - . ' from ' . $greaterThanYear->format('c') . ' to ' . $lessThanYear->format('c'); + . ' from ' . $greaterThanYear->format('c') . ' to ' . $lessThanYear->format('c') + . '. Text in parentheses is from current lookups and is not guaranteed to be historically accurate.'; $contentType = isset($queryParams['content-type']) ? html_entity_decode($queryParams['content-type'])
work on immutable history proof of concept by cleaning up code
reliv_Rcm
train
php
d07b7359a0074fac0dcbab93698cc17ee0a61027
diff --git a/fake-timers.js b/fake-timers.js index <HASH>..<HASH> 100644 --- a/fake-timers.js +++ b/fake-timers.js @@ -105,7 +105,6 @@ module.exports = function every(obj, fn) { var pass = true; try { - /* eslint-disable-next-line local-rules/no-prototype-methods */ obj.forEach(function() { if (!fn.apply(this, arguments)) { // Throwing an error is the only way to break `forEach` @@ -205,7 +204,6 @@ module.exports = copyPrototype(Array.prototype); var call = Function.call; module.exports = function copyPrototypeMethods(prototype) { - /* eslint-disable local-rules/no-prototype-methods */ return Object.getOwnPropertyNames(prototype).reduce(function(result, name) { // ignore size because it throws from Map if ( @@ -283,7 +281,6 @@ module.exports = function typeOf(value) { function valueToString(value) { if (value && value.toString) { - /* eslint-disable-next-line local-rules/no-prototype-methods */ return value.toString(); } return String(value);
Remove misleading comment This repository doesn't use the `no-prototype-methods` rule that is managed with `local-rules` plugin, so the comments make no sense. ESLint should really throw an error here...
sinonjs_lolex
train
js
3869a4d2d98148b2d4de6164fb0e1eabe8cf3874
diff --git a/core/lib/engine_util.js b/core/lib/engine_util.js index <HASH>..<HASH> 100644 --- a/core/lib/engine_util.js +++ b/core/lib/engine_util.js @@ -213,6 +213,21 @@ function renderVariables (str, vars) { let rxmatch; let result = str.substring(0, str.length); + + // Special case for handling integer/boolean/object substitution: + // + // Does the template string contain one variable and nothing else? + // e.g.: "{{ myvar }" or "{{ myvar }", but NOT " {{ myvar }" + // If so, we treat it as a special case. + const matches = str.match(RX); + if (matches && matches.length === 1) { + if (matches[0] === str) { + // there's nothing else in the template but the variable + const varName = str.replace(/{/g, '').replace(/}/g, '').trim(); + return vars[varName] || ''; + } + } + while (result.search(RX) > -1) { let templateStr = result.match(RX)[0]; const varName = templateStr.replace(/{/g, '').replace(/}/g, '').trim();
fix: Using a template with exactly one variable keeps its type
artilleryio_artillery
train
js
5be54c643d8c29394f8836c94d69d055472bf925
diff --git a/pymatgen/electronic_structure/tests/test_plotter.py b/pymatgen/electronic_structure/tests/test_plotter.py index <HASH>..<HASH> 100644 --- a/pymatgen/electronic_structure/tests/test_plotter.py +++ b/pymatgen/electronic_structure/tests/test_plotter.py @@ -190,8 +190,13 @@ class BoltztrapPlotterTest(unittest.TestCase): os.path.join(test_dir, "boltztrap/transp/")) plotter = BoltztrapPlotter(bz) plotter.plot_seebeck_eff_mass_mu() - plotter.plot_seebeck_temp() - plotter.plot_seebeck_dop() + + # TODO: These two tests fail. Whoever is responsible for the + # BoltztrapPlotter needs to fix these. The fact that there are not tests + # for the plotter is atrocious. I will reject all future additions to + # the plotter until these are fixed. + # plotter.plot_seebeck_temp() + # plotter.plot_seebeck_dop() plotter.plot_complexity_factor_mu() plotter.plot_conductivity_dop()
Comment out tests with an angry message at the person who coded the BzTPlotter.
materialsproject_pymatgen
train
py
1ee410b4128385e533b609708f8e9aa71e42053e
diff --git a/src/javascript/xhr/XMLHttpRequest.js b/src/javascript/xhr/XMLHttpRequest.js index <HASH>..<HASH> 100644 --- a/src/javascript/xhr/XMLHttpRequest.js +++ b/src/javascript/xhr/XMLHttpRequest.js @@ -913,6 +913,7 @@ define("moxie/xhr/XMLHttpRequest", [ _p('responseText', _xhr.responseText); _p('responseXML', _getDocument(_xhr)); _p('response', (_p('responseType') === 'document' ? _p('responseXML') : _p('responseText'))); + _responseHeaders = _xhr.getAllResponseHeaders(); self.dispatchEvent('load'); }
XHR: Populate response headers in native mode as well.
moxiecode_moxie
train
js
085eb92e160b9b993b51a1e9d6c9d9a7b7c9ab76
diff --git a/docs/src/vendor/doc-components/editor/editor.js b/docs/src/vendor/doc-components/editor/editor.js index <HASH>..<HASH> 100644 --- a/docs/src/vendor/doc-components/editor/editor.js +++ b/docs/src/vendor/doc-components/editor/editor.js @@ -1,5 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; +import _ from 'lodash'; let CodeMirror; if (typeof document !== 'undefined') { @@ -25,6 +26,12 @@ class Editor extends React.Component { theme: 'oceanic-next', }; + constructor(props) { + super(props); + + this.debouncedOnChange = _.debounce(props.onChange, 500); + } + componentDidMount() { if (!CodeMirror) { return; @@ -51,15 +58,10 @@ class Editor extends React.Component { handleChange = () => { if (!this.props.readOnly && this.props.onChange) { - this.props.onChange(this.editor.getValue()); + this.debouncedOnChange(this.editor.getValue()); } }; - setCode(code) { - this.editor.getDoc().setValue(code); - this.handleChange(); - } - render() { const { className, style } = this.props;
Debounce updates to the example code block
jamesplease_materialish
train
js
ce8b798a1a846760e61e9edf38d11f26d8351485
diff --git a/salt/modules/zfs.py b/salt/modules/zfs.py index <HASH>..<HASH> 100644 --- a/salt/modules/zfs.py +++ b/salt/modules/zfs.py @@ -39,20 +39,22 @@ def _available_commands(): if not zfs_path: return False - _return = {} + ret = {} # Note that we append '|| :' as a unix hack to force return code to be 0. - res = salt_cmd.run_all('{0} help || :'.format(zfs_path)) + res = salt_cmd.run_stderr( + '{0} help || :'.format(zfs_path), output_loglevel='debug' + ) # This bit is dependent on specific output from `zfs help` - any major changes # in how this works upstream will require a change. - for line in res['stderr'].splitlines(): + for line in res.splitlines(): if re.match(' [a-zA-Z]', line): cmds = line.split(' ')[0].split('|') doc = ' '.join(line.split(' ')[1:]) for cmd in [cmd.strip() for cmd in cmds]: - if cmd not in _return: - _return[cmd] = doc - return _return + if cmd not in ret: + ret[cmd] = doc + return ret def _exit_status(retcode):
Log 'zfs help' output at debug This suppresses the output from this command unless the minion is running in debug mode.
saltstack_salt
train
py
b54334fc7148d605747715d7b3bfc5a090cdb1d9
diff --git a/lib/sass/environment.rb b/lib/sass/environment.rb index <HASH>..<HASH> 100644 --- a/lib/sass/environment.rb +++ b/lib/sass/environment.rb @@ -68,7 +68,7 @@ module Sass # Pop a stack frame from the mixin/include stack. def pop_frame - stack.pop if stack.last[:prepared] + stack.pop if stack.last && stack.last[:prepared] stack.pop end
[Sass] Don't raise odd errors about #[] for stack overflows.
sass_ruby-sass
train
rb
016ee28b226f542bf2cdbc1e3aedf07416852a53
diff --git a/src/ol-ext/format.js b/src/ol-ext/format.js index <HASH>..<HASH> 100644 --- a/src/ol-ext/format.js +++ b/src/ol-ext/format.js @@ -1,7 +1,9 @@ import BaseGeoJSON from 'ol/format/geojson' import TopoJSON from 'ol/format/topojson' import { isEmpty } from '../util/minilo' +import { EPSG_4326 } from './consts' import { createCircularPolygon } from './geom' +import { transformPoint } from './proj' import { isCircle } from './util' /** @@ -23,7 +25,15 @@ export function createTopoJsonFmt (options) { class GeoJSON extends BaseGeoJSON { writeGeometryObject (geometry, options) { if (isCircle(geometry)) { - geometry = createCircularPolygon(geometry.getCenter(), geometry.getRadius()) + geometry = createCircularPolygon( + transformPoint( + geometry.getCenter(), + options.featureProjection || this.defaultFeatureProjection, + EPSG_4326, + ), + geometry.getRadius(), + ) + options.featureProjection = EPSG_4326 } return super.writeGeometryObject(geometry, options) }
custom geojson fmt: replace projection after circle to polygon conversion
ghettovoice_vuelayers
train
js
737429154e51ef8fbbaefcec0f74f2816864ea83
diff --git a/src/main/java/com/axibase/tsd/driver/jdbc/DriverConstants.java b/src/main/java/com/axibase/tsd/driver/jdbc/DriverConstants.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/axibase/tsd/driver/jdbc/DriverConstants.java +++ b/src/main/java/com/axibase/tsd/driver/jdbc/DriverConstants.java @@ -38,7 +38,7 @@ public final class DriverConstants { public static final String TABLES_PARAM_NAME = "tables"; public static final String DEFAULT_TABLES_VALUE = null; public static final String EXPAND_TAGS_PARAM_NAME = "expandTags"; - public static final boolean DEFAULT_EXPAND_TAGS_VALUE = true; + public static final boolean DEFAULT_EXPAND_TAGS_VALUE = false; public static final String META_COLUMNS_PARAM_NAME = "metaColumns"; public static final boolean DEFAULT_META_COLUMNS_VALUE = false; public static final String ASSIGN_INNER_COLUMN_NAMES_PARAM = "assignColumnNames";
set expandTags value to false by default
axibase_atsd-jdbc
train
java
6987b45970fd04ec85a5dde334a0a72a5ee48a8f
diff --git a/svtyper/singlesample.py b/svtyper/singlesample.py index <HASH>..<HASH> 100644 --- a/svtyper/singlesample.py +++ b/svtyper/singlesample.py @@ -711,6 +711,7 @@ def genotype_parallel(src_vcf, out_vcf, sample, z, split_slop, min_aligned, sum_ # 1st pass through input vcf -- collect all the relevant breakpoints logit("Collecting breakpoints") breakpoints = collect_breakpoints(src_vcf) + logit("Collected {} breakpoints".format(len(breakpoints))) logit("Collecting regions") regions = [ get_breakpoint_regions(b, sample, z) for b in breakpoints ] logit("Batch breakpoints into groups of {}".format(breakpoint_batch_size))
+ add message on how many breakpoints we're going to process
hall-lab_svtyper
train
py
8096d5257492997e75634766f57c5cc159d09b3e
diff --git a/lib/rack/www.rb b/lib/rack/www.rb index <HASH>..<HASH> 100644 --- a/lib/rack/www.rb +++ b/lib/rack/www.rb @@ -15,12 +15,8 @@ module Rack host = URI(req.host).to_s if (already_www?(host) && @www == true) || (!already_www?(host) && @www == false) [status, headers, body] - elsif !already_www?(host) && @www == true - url = URI(req.url).scheme + "://www." + host + URI(req.path).to_s - headers = headers.merge('Location' => url) - [301, headers, body] else - url = URI(req.url).scheme + "://" + host.gsub("www.", "") + URI(req.path).to_s + url = prepare_url(req) headers = headers.merge('Location' => url) [301, headers, body] end @@ -30,5 +26,17 @@ module Rack def already_www?(host) host.downcase =~ /^(www.)/ end + + def prepare_url(req) + scheme = URI(req.url).scheme + host = URI(req.host).to_s.gsub(/^(www.)/, "") + path = URI(req.path).to_s + if @www == true + host = "://www." + host + else + host = "://" + host + end + scheme + host + path + end end end
Removed duplicated code, refactored a bit
stjhimy_rack-www
train
rb
3e21905fc452cb12e544bbbf3d01b2fddf2d31f7
diff --git a/lib/OpenLayers/Layer/Vector.js b/lib/OpenLayers/Layer/Vector.js index <HASH>..<HASH> 100644 --- a/lib/OpenLayers/Layer/Vector.js +++ b/lib/OpenLayers/Layer/Vector.js @@ -271,6 +271,10 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, { if (!dragging) { this.renderer.root.style.visibility = "hidden"; + // force a reflow on gecko based browsers to actually hide the svg + if (navigator.userAgent.toLowerCase().indexOf("gecko") != -1) { + this.div.scrollLeft = this.div.scrollLeft; + } this.div.style.left = -parseInt(this.map.layerContainerDiv.style.left) + "px"; this.div.style.top = -parseInt(this.map.layerContainerDiv.style.top) + "px";
"svg flicker at end of pan". Gecko-based browsers might not reflow svg if only style properties of dom elements are changed. Fixed by setting the scrollLeft property. r=pgiraud,tschaub (closes #<I>) git-svn-id: <URL>
openlayers_openlayers
train
js
5eed28ce9ef1daa2b38d15094425f82e0032d62d
diff --git a/src/js/chosen.js b/src/js/chosen.js index <HASH>..<HASH> 100644 --- a/src/js/chosen.js +++ b/src/js/chosen.js @@ -1113,12 +1113,18 @@ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md }; Chosen.prototype.results_reset = function() { + var oldValue = this.form_field_jq.val(); this.reset_single_select_options(); this.form_field.options[0].selected = true; this.single_set_selected_text(); this.show_search_field_default(); this.results_reset_cleanup(); - this.form_field_jq.trigger("change"); + var newValue = this.form_field_jq.val(); + var changeData = {selected: newValue}; + if (oldValue !== newValue && !newValue.length) { + changeData.deselected = oldValue; + } + this.form_field_jq.trigger("change", changeData); if(this.active_field) { return this.results_hide(); }
* add deselected param to change event for chosen single select control.
easysoft_zui
train
js
5f58daaf57fa8e20fc46be6883129055e54e8cc0
diff --git a/internal/states/statefile/version4.go b/internal/states/statefile/version4.go index <HASH>..<HASH> 100644 --- a/internal/states/statefile/version4.go +++ b/internal/states/statefile/version4.go @@ -539,7 +539,7 @@ type instanceObjectStateV4 struct { SchemaVersion uint64 `json:"schema_version"` AttributesRaw json.RawMessage `json:"attributes,omitempty"` AttributesFlat map[string]string `json:"attributes_flat,omitempty"` - AttributeSensitivePaths json.RawMessage `json:"sensitive_attributes,omitempty,"` + AttributeSensitivePaths json.RawMessage `json:"sensitive_attributes,omitempty"` PrivateRaw []byte `json:"private,omitempty"`
fix typo in struct tag (#<I>) typo found by [`revive`](<URL>)
hashicorp_terraform
train
go
72b7e7ce8cf16c27ae67f0ea1a8264e58e562ce0
diff --git a/Builder/FormContractor.php b/Builder/FormContractor.php index <HASH>..<HASH> 100644 --- a/Builder/FormContractor.php +++ b/Builder/FormContractor.php @@ -104,6 +104,7 @@ class FormContractor implements FormContractorInterface 'Sonata\AdminBundle\Form\Type\ModelType', 'sonata_type_model_list', 'Sonata\AdminBundle\Form\Type\ModelTypeList', + 'Sonata\AdminBundle\Form\Type\ModelListType', 'sonata_type_model_hidden', 'Sonata\AdminBundle\Form\Type\ModelHiddenType', 'sonata_type_model_autocomplete',
Fixed FormContractor for new ModelListType
sonata-project_SonataDoctrineORMAdminBundle
train
php
107e04a7eaec5a5a496043052c6d19ea8d2e0894
diff --git a/lib/dotenv.rb b/lib/dotenv.rb index <HASH>..<HASH> 100644 --- a/lib/dotenv.rb +++ b/lib/dotenv.rb @@ -16,8 +16,7 @@ module Dotenv with(*filenames) { |f| Environment.new(f).apply! if File.exist?(f) } end -protected - + # Internal: Helper to expand list of filenames. def self.with(*filenames, &block) filenames << '.env' if filenames.empty?
Use comment instead of "protected" to denote internal method
bkeepers_dotenv
train
rb
be2f291f5cc049acc2e3ed37d28a3e38fd7172ca
diff --git a/pysat/__init__.py b/pysat/__init__.py index <HASH>..<HASH> 100644 --- a/pysat/__init__.py +++ b/pysat/__init__.py @@ -2,6 +2,7 @@ from __future__ import print_function from __future__ import absolute_import import os +import pysatCDF # get home directory home_dir = os.path.expanduser('~')
Testing build of pysatCDF on travis
rstoneback_pysat
train
py
66a3d178cb5878e2da9f5e61f924b510dbf1b4bb
diff --git a/pandas/tests/frame/test_alter_axes.py b/pandas/tests/frame/test_alter_axes.py index <HASH>..<HASH> 100644 --- a/pandas/tests/frame/test_alter_axes.py +++ b/pandas/tests/frame/test_alter_axes.py @@ -234,9 +234,16 @@ class TestDataFrameAlterAxes: # need to adapt first drop for case that both keys are 'A' -- # cannot drop the same column twice; - # use "is" because == would give ambiguous Boolean error for containers + # plain == would give ambiguous Boolean error for containers first_drop = ( - False if (keys[0] is "A" and keys[1] is "A") else drop # noqa: F632 + False + if ( + isinstance(keys[0], str) + and keys[0] == "A" + and isinstance(keys[1], str) + and keys[1] == "A" + ) + else drop ) # to test against already-tested behaviour, we add sequentially, # hence second append always True; must wrap keys in list, otherwise
TST: Don't use 'is' on strings to avoid SyntaxWarning (#<I>)
pandas-dev_pandas
train
py
0d7e0e8adaf0eb9736ff1d398ab4280f7f528821
diff --git a/lib/pagelib.php b/lib/pagelib.php index <HASH>..<HASH> 100644 --- a/lib/pagelib.php +++ b/lib/pagelib.php @@ -49,9 +49,15 @@ function page_create_object($type, $id = NULL) { */ function page_map_class($type, $classname = NULL) { - static $mappings = array( - MOODLE_PAGE_COURSE => 'page_course' - ); + static $mappings = NULL; + + if($mappings === NULL) { + $mappings = array( + MOODLE_PAGE_COURSE => 'page_course' + ); + print_object('Debug info - initial mappings:'); + var_dump($mappings); + } if(!empty($type) && !empty($classname)) { $mappings[$type] = $classname;
A small change for the static initialization in page_map_class, and more debug added just before init is done.
moodle_moodle
train
php
2e48d37e2883c6157603edea45874724ba2c7b90
diff --git a/lib/zookeeper/common.rb b/lib/zookeeper/common.rb index <HASH>..<HASH> 100644 --- a/lib/zookeeper/common.rb +++ b/lib/zookeeper/common.rb @@ -37,7 +37,7 @@ protected def get_watcher(req_id) @req_mutex.synchronize { - req_id != ZKRB_GLOBAL_CB_REQ ? @watcher_reqs.delete(req_id) : @watcher_reqs[req_id] + (req_id == ZKRB_GLOBAL_CB_REQ) ? @watcher_reqs[req_id] : @watcher_reqs.delete(req_id) } end
improve logic in ternary to read more sanely
zk-ruby_zookeeper
train
rb
3a7f39f43e6ef3da4330706461220775bf0a977b
diff --git a/docs_src/assets/js/src/application.js b/docs_src/assets/js/src/application.js index <HASH>..<HASH> 100644 --- a/docs_src/assets/js/src/application.js +++ b/docs_src/assets/js/src/application.js @@ -134,7 +134,9 @@ htmlBridge .data('placement', 'top') .attr('title', 'Copy to clipboard') - .tooltip() + .tooltip(); + + htmlBridge.find('object').text("flash object for zero clipboard"); }) // Copy to clipboard
Add text to copy object to resovle error
rei_rei-cedar
train
js
dba454d5f947251e2b8db3fdef0aafd199e0a398
diff --git a/cms_lab_publications/admin.py b/cms_lab_publications/admin.py index <HASH>..<HASH> 100644 --- a/cms_lab_publications/admin.py +++ b/cms_lab_publications/admin.py @@ -261,6 +261,7 @@ class PublicationSetAdmin(admin.ModelAdmin): 'number_of_publications', 'pagination', 'searchable', + 'is_bulk_pubmed_query_ok', ) list_filter = ( BulkPubMedQueryStatusFilter, @@ -273,6 +274,11 @@ class PublicationSetAdmin(admin.ModelAdmin): 'description', ) + def is_bulk_pubmed_query_ok(self, obj): + return obj.bulk_pubmed_query == '' + is_bulk_pubmed_query_ok.boolean = True + is_bulk_pubmed_query_ok.short_description = 'Query OK?' + def queryset(self, request): queryset = super().queryset(request) queryset = queryset.annotate(pub_count=Count('publications'))
Display whether a Publication Set's Bulk PubMed Query status is OK
mfcovington_djangocms-lab-publications
train
py
1a1991217102a288c77f24650ae05436871e7b52
diff --git a/tests/bootstrap.php b/tests/bootstrap.php index <HASH>..<HASH> 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -10,6 +10,7 @@ error_reporting(E_ALL & ~E_USER_NOTICE | E_STRICT); +require_once dirname(__FILE__) . "/../vendor/autoload.php"; require_once dirname(__FILE__) . "/../lib/steam-condenser.php"; function getFixture($fileName) {
Load Composer dependencies during tests
koraktor_steam-condenser-php
train
php
3d66113a1832d3a89bdf2454bb882e6aea6e2c7c
diff --git a/tests/spec/output_spec.rb b/tests/spec/output_spec.rb index <HASH>..<HASH> 100644 --- a/tests/spec/output_spec.rb +++ b/tests/spec/output_spec.rb @@ -105,6 +105,4 @@ describe WinRM::Output do end end end - - pending 'parse CLIXML errors and convert to Strings and/or Exceptions' end
remove pending test regarding exception deserializing. we do that now and cover in integration tests. will add unit tests soon
WinRb_WinRM
train
rb
0a08b6fb8a2dbd8f3d0c0beaf1638422e511f27c
diff --git a/test/routing_test.rb b/test/routing_test.rb index <HASH>..<HASH> 100755 --- a/test/routing_test.rb +++ b/test/routing_test.rb @@ -473,7 +473,7 @@ class TranslateRoutesTest < ActionController::TestCase end end - test_case = klass.new(nil) + test_case = klass.new(:respond_to?) # Not localized assert test_case.respond_to?(:people_path)
Fix tests on default urls for Ruby <I>
enriclluelles_route_translator
train
rb
c5dd6a91bec9cc3d8d2442248841b848ce58f1c7
diff --git a/probes/src/test/java/com/hazelcast/simulator/probes/ProbeTestUtils.java b/probes/src/test/java/com/hazelcast/simulator/probes/ProbeTestUtils.java index <HASH>..<HASH> 100644 --- a/probes/src/test/java/com/hazelcast/simulator/probes/ProbeTestUtils.java +++ b/probes/src/test/java/com/hazelcast/simulator/probes/ProbeTestUtils.java @@ -24,7 +24,7 @@ public final class ProbeTestUtils { private static final int HISTOGRAM_RECORD_COUNT = 5000; private static final int MAX_LATENCY = 30000; - private static final int TOLERANCE_MILLIS = 500; + private static final int TOLERANCE_MILLIS = 1000; private static final Random RANDOM = new Random(); private static File resultFile = new File("tmpProbeResult.xml");
Increased TOLERANCE_MILLIS to one second in ProbeTestUtils.
hazelcast_hazelcast-simulator
train
java
c300467604fffa349968208f963e883a60ef5a77
diff --git a/testsuite/domain/src/test/java/org/jboss/as/test/integration/respawn/RespawnTestCase.java b/testsuite/domain/src/test/java/org/jboss/as/test/integration/respawn/RespawnTestCase.java index <HASH>..<HASH> 100644 --- a/testsuite/domain/src/test/java/org/jboss/as/test/integration/respawn/RespawnTestCase.java +++ b/testsuite/domain/src/test/java/org/jboss/as/test/integration/respawn/RespawnTestCase.java @@ -396,7 +396,7 @@ public class RespawnTestCase { @Override String getKillCommand(RunningProcess process) { - return "taskkill /pid " + process.getProcessId(); + return "taskkill /f /pid " + process.getProcessId(); } }
Add /f option to taskkill command on Windows. Stops respawn test from failing.
wildfly_wildfly
train
java
3a6369a9403c6822f59408ec6b3718883fdb7dc3
diff --git a/concrete/src/Permission/Key/WorkflowKey.php b/concrete/src/Permission/Key/WorkflowKey.php index <HASH>..<HASH> 100644 --- a/concrete/src/Permission/Key/WorkflowKey.php +++ b/concrete/src/Permission/Key/WorkflowKey.php @@ -27,7 +27,7 @@ abstract class WorkflowKey extends Key foreach ($excluded as $inc) { $pae = $inc->getAccessEntityObject(); - $usersExcluded = array_merge($usersExcluded, $pae->getAccessEntityUsers()); + $usersExcluded = array_merge($usersExcluded, $pae->getAccessEntityUsers($paa)); } $users = array_diff($users, $usersExcluded);
WorkflowKey::getCurrentlyActiveUsers() doesn't pass all args to getAccessEntityUsers() Came about this bug when using the MSW extension.
concrete5_concrete5
train
php
b2a4e704deea531f74d4abff94882c7390fd17ae
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -367,8 +367,8 @@ workfly.prototype.resume = function() //Resume the workflow this._paused = false; - //Check if workflow is aborted - if(this._aborted === true ){ return; } + //Check if workflow is aborted or completed + if(this._aborted === true || this._completed === true ){ return; } //Check if workflow running if(this._running === true){ return; }
index.js: check if workflow is completed before resume it
jmjuanes_tinyflow
train
js
e77089f73914e045004601c75d3e9b8e7fad335b
diff --git a/core/src/main/java/org/bitcoinj/core/TransactionBroadcast.java b/core/src/main/java/org/bitcoinj/core/TransactionBroadcast.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/bitcoinj/core/TransactionBroadcast.java +++ b/core/src/main/java/org/bitcoinj/core/TransactionBroadcast.java @@ -103,7 +103,7 @@ public class TransactionBroadcast { List<Peer> peers = peerGroup.getConnectedPeers(); // snapshots // We intern the tx here so we are using a canonical version of the object (as it's unfortunately mutable). // TODO: Once confidence state is moved out of Transaction we can kill off this step. - pinnedTx = context != null ? context.getConfidenceTable().intern(tx) : pinnedTx; + pinnedTx = context != null ? context.getConfidenceTable().intern(tx) : tx; // Prepare to send the transaction by adding a listener that'll be called when confidence changes. // Only bother with this if we might actually hear back: if (minConnections > 1)
NPE when invoking `PeerGroup.broadcastTransaction()` on peer group with no block chain. The modified line here seems to have been assuming that `pinnedTx` was being initialized elsewhere, but it wasn't.
bitcoinj_bitcoinj
train
java
cf295868dc5be8a4b686b1bd10591b86b29144cf
diff --git a/alerta/server/database.py b/alerta/server/database.py index <HASH>..<HASH> 100644 --- a/alerta/server/database.py +++ b/alerta/server/database.py @@ -18,10 +18,17 @@ class Mongo(object): # Connect to MongoDB try: - self.conn = pymongo.MongoClient(CONF.mongo_host, CONF.mongo_port) + self.conn = pymongo.MongoClient(CONF.mongo_host, CONF.mongo_port) # version >= 2.4 + except AttributeError: + self.conn = pymongo.Connection(CONF.mongo_host, CONF.mongo_port) # version < 2.4 + except Exception, e: + LOG.error('MongoDB Client connection error : %s', e) + sys.exit(1) + + try: self.db = self.conn.monitoring # TODO(nsatterl): make 'monitoring' a SYSTEM DEFAULT except Exception, e: - LOG.error('MongoDB Client error : %s', e) + LOG.error('MongoDB database error : %s', e) sys.exit(1) if self.conn.alive():
support pymongo < <I>
alerta_alerta
train
py
0efeaa258b19d5b1ba204cc55fbdb6969e0f3e64
diff --git a/flake8_respect_noqa.py b/flake8_respect_noqa.py index <HASH>..<HASH> 100644 --- a/flake8_respect_noqa.py +++ b/flake8_respect_noqa.py @@ -4,13 +4,17 @@ Always ignore lines with '# noqa' """ __version__ = 0.2 -import pep8 +try: + from pep8 import StandardReport, noqa +except ImportError: + # Try the new (as of 2016-June) pycodestyle package. + from pycodestyle import StandardReport, noqa -class RespectNoqaReport(pep8.StandardReport): +class RespectNoqaReport(StandardReport): def error(self, line_number, offset, text, check): - if len(self.lines) > line_number - 1 and pep8.noqa(self.lines[line_number - 1]): + if len(self.lines) > line_number - 1 and noqa(self.lines[line_number - 1]): return else: return super(RespectNoqaReport, self).error(line_number, offset,
Adjust for pep8 package rename. Closes #1
spookylukey_flake8-respect-noqa
train
py
30ba703bd4b500398820e3da4b8a8679df5ba014
diff --git a/mocpy/moc.py b/mocpy/moc.py index <HASH>..<HASH> 100644 --- a/mocpy/moc.py +++ b/mocpy/moc.py @@ -371,7 +371,7 @@ class MOC(AbstractMoc): tmp_moc = tempfile.NamedTemporaryFile(delete=False) - self.write(tmp_moc.name) + self.write(tmp_moc.name, write_to_file=True) r = requests.post('http://cdsxmatch.u-strasbg.fr/QueryCat/QueryCat', data={'mode': 'mocfile', 'catName': resource_id,
fix _query MOC.write prototype has changed over time and _query was using a past version of it.
cds-astro_mocpy
train
py
13cec37fd72d4c8301fe2bd829ab22799a8ba23d
diff --git a/lib/jsduck/lint.rb b/lib/jsduck/lint.rb index <HASH>..<HASH> 100644 --- a/lib/jsduck/lint.rb +++ b/lib/jsduck/lint.rb @@ -100,7 +100,7 @@ module JsDuck def warn_singleton_statics @relations.each do |cls| if cls[:singleton] - cls.find_members({:static => true}).each do |m| + cls.find_members({:local => true, :static => true}).each do |m| warn(:sing_static, "Static members don't make sense in singleton class #{@doc[:name]}", m) end end
Use the :local option in statics in singleton check. We don't care about static members inherited from parents and mixins - they could be completely valid in those other classes - it's the concrete singleton who's statics interest us.
senchalabs_jsduck
train
rb
0d75a1fa05296d4e9ff30898ed72567d0a45c64b
diff --git a/src/Artisaninweb/SoapWrapper/Service.php b/src/Artisaninweb/SoapWrapper/Service.php index <HASH>..<HASH> 100755 --- a/src/Artisaninweb/SoapWrapper/Service.php +++ b/src/Artisaninweb/SoapWrapper/Service.php @@ -336,7 +336,8 @@ class Service { */ public function header($namespace,$name,$data=null,$mustUnderstand=false,$actor=null) { - $this->headers[] = new SoapHeader($namespace,$name,$data,$mustUnderstand,$actor); + if($actor) $this->headers[] = new SoapHeader($namespace,$name,$data,$mustUnderstand,$actor); + else $this->headers[] = new SoapHeader($namespace,$name,$data,$mustUnderstand); return $this; }
Update add header function [ErrorException] SoapHeader::SoapHeader(): Invalid actor This is the error i get when i don't set the actor.
artisaninweb_laravel-soap
train
php
9eb0328aa899e522d5c0e8be35614457c8bbf1cd
diff --git a/actions/class.TestRunner.php b/actions/class.TestRunner.php index <HASH>..<HASH> 100644 --- a/actions/class.TestRunner.php +++ b/actions/class.TestRunner.php @@ -282,6 +282,7 @@ class taoQtiTest_actions_TestRunner extends tao_actions_ServiceModule { } $this->setData('client_config_url', $this->getClientConfigUrl()); + $this->setData('client_timeout', $this->getClientTimeout()); $this->setView('test_runner.tpl'); $this->afterAction(false); @@ -580,4 +581,4 @@ class taoQtiTest_actions_TestRunner extends tao_actions_ServiceModule { break; } } -} \ No newline at end of file +}
add timeout to the test runner
oat-sa_extension-tao-testqti
train
php
59a981f41eb1f72df8bf49aff4df1c08dad00729
diff --git a/salt/_compat.py b/salt/_compat.py index <HASH>..<HASH> 100644 --- a/salt/_compat.py +++ b/salt/_compat.py @@ -177,8 +177,19 @@ else: if PY3: from io import StringIO + from io import BytesIO as cStringIO else: from StringIO import StringIO + from cStringIO import StringIO as cStringIO + +def string_io(data=None): # cStringIO can't handle unicode + ''' + Pass data through to stringIO module and return result + ''' + try: + return cStringIO(bytes(data)) + except (UnicodeEncodeError, TypeError): + return StringIO(data) if PY3: import queue as Queue
add more stringio support to compat
saltstack_salt
train
py
84e29ac56f88c72f8a025f285d69fcb7fa2a0f34
diff --git a/salt/modules/win_file.py b/salt/modules/win_file.py index <HASH>..<HASH> 100644 --- a/salt/modules/win_file.py +++ b/salt/modules/win_file.py @@ -167,11 +167,13 @@ def _resolve_symlink(path, max_depth=64): return path -def _change_privilege(privilege_name, enable): +def _change_privilege_state(privilege_name, enable): ''' - Change, either enable or disable, the named privilege for this process. + Change the state, either enable or disable, of the named privilege for this + process. - If the change did not occur, an exception will be raised. + If the change fails, an exception will be raised. If successful, it returns + True. ''' log.debug( '%s the privilege %s for this process.', @@ -236,14 +238,14 @@ def _enable_privilege(privilege_name): ''' Enables the named privilege for this process. ''' - return _change_privilege(privilege_name, True) + return _change_privilege_state(privilege_name, True) def _disable_privilege(privilege_name): ''' Disables the named privilege for this process. ''' - return _change_privilege(privilege_name, False) + return _change_privilege_state(privilege_name, False) def gid_to_group(gid):
Renamed method to better reflect what it does.
saltstack_salt
train
py
3f52444bbfea61f55eafd5ee8e8dc7823e87bb8b
diff --git a/example_form.php b/example_form.php index <HASH>..<HASH> 100644 --- a/example_form.php +++ b/example_form.php @@ -44,7 +44,7 @@ if (isset($_SESSION['ctform']['error']) && $_SESSION['ctform']['error'] == true <span class="success">The captcha was correct and the message has been sent!</span><br /><br /> <?php endif; ?> -<form method="post" action="<?php echo $_SERVER['REQUEST_URI'] . $_SERVER['QUERY_STRING'] ?>" id="contact_form"> +<form method="post" action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI'] . $_SERVER['QUERY_STRING']) ?>" id="contact_form"> <input type="hidden" name="do" value="contact" /> <p>
Fix potential XSS in example form.
dapphp_securimage
train
php
c9e42e801bbeac85fe309f7eb3388ca15b5032d8
diff --git a/bees/ircbee/ircbee.go b/bees/ircbee/ircbee.go index <HASH>..<HASH> 100644 --- a/bees/ircbee/ircbee.go +++ b/bees/ircbee/ircbee.go @@ -219,10 +219,9 @@ func (mod *IrcBee) Run(eventChan chan bees.Event) { } default: + time.Sleep(1 * time.Second) } } } - - time.Sleep(5 * time.Second) } }
Sleep in the inner-most ircbee loop.
muesli_beehive
train
go
39974f637036ac5a71c5b81ecb97f2bb92586a05
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -35,7 +35,7 @@ module.exports = { target.options = target.options || {}; // Build all paths - var bulmaPath = path.join(target.bowerDirectory, 'bulma'); + var bulmaPath = path.join(target.bowerDirectory || '', 'bulma'); target.options.sassOptions = target.options.sassOptions || {}; target.options.sassOptions.includePaths = target.options.sassOptions.includePaths || [];
Fallback to empty string for undefined bowerDirectory From what I can tell, nested addons don't have access to the `bowerDirectory` property defined by Ember CLI. Rather than get an error for passing `undefined` to `Path.join`, this attempts to continue without `target.bowerDirectory`.
open-tux_ember-bulma
train
js
a33055366d63a345ecb43f622d203c8e3d627ea3
diff --git a/src/Entity/MetadataCollection.php b/src/Entity/MetadataCollection.php index <HASH>..<HASH> 100644 --- a/src/Entity/MetadataCollection.php +++ b/src/Entity/MetadataCollection.php @@ -108,7 +108,9 @@ class MetadataCollection { $cacheKey = self::$cachePrefix . 'metadata_entities_list'; $isCacheEnabled = $this->getClient()->isCacheEnabled(); - if ( !count( $this->cachedEntitiesList ) && $isCacheEnabled + if ( count( $this->cachedEntitiesList ) ) { + return $this->cachedEntitiesList; + } elseif ( !count( $this->cachedEntitiesList ) && $isCacheEnabled && $this->getCache()->exists( $cacheKey ) ) { // entities list exists $this->cachedEntitiesList = $this->getCache()->get( $cacheKey ); } else { // entities list is not loaded
Entities metadata cache would be regenerated repeatedly If MetadataCollection::getEntitiesList() is invoked the second time, it would regenerate metadata cache despite entity metadata cache being in memory already.
AlexaCRM_php-crm-toolkit
train
php
14166ccc302f2b7c61439939abab34acd75232b9
diff --git a/zipline/test/test_perf_tracking.py b/zipline/test/test_perf_tracking.py index <HASH>..<HASH> 100644 --- a/zipline/test/test_perf_tracking.py +++ b/zipline/test/test_perf_tracking.py @@ -23,7 +23,7 @@ class PerformanceTestCase(unittest.TestCase): len(self.treasury_curves) ) self.dt = self.treasury_curves.keys()[random_index] - self.end_dt = self.dt + datetime.timedelta(days=365+2) + self.end_dt = self.dt + datetime.timedelta(days=365) self.trading_environment = TradingEnvironment( self.benchmark_returns, self.treasury_curves,
dropped the extra days in trading range...
quantopian_zipline
train
py
428b55aa60056bf05c5c41e6554ae6b371c161be
diff --git a/pages.go b/pages.go index <HASH>..<HASH> 100644 --- a/pages.go +++ b/pages.go @@ -6,13 +6,15 @@ import ( "bytes" "encoding/binary" "fmt" - "github.com/golang/protobuf/proto" - "github.com/sajari/sajari-convert/iWork" - "github.com/sajari/sajari-convert/snappy" "io" "io/ioutil" "log" "strings" + + "github.com/golang/protobuf/proto" + + "github.com/sajari/docconv/iWork" + "github.com/sajari/docconv/snappy" ) // Convert PAGES to text
Fix and reorder imports.
sajari_docconv
train
go
75c9c9f49bd4e6f7415ca9573d62310b21af468c
diff --git a/coursera/utils.py b/coursera/utils.py index <HASH>..<HASH> 100644 --- a/coursera/utils.py +++ b/coursera/utils.py @@ -65,7 +65,7 @@ def clean_filename(s, minimal_change=False): h = html_parser.HTMLParser() s = h.unescape(s) - # strip paren portions which contain trailing time length (...) + # Strip forbidden characters s = ( s.replace(':', '-') .replace('/', '-')
coursera/utils: Update outdated comment.
coursera-dl_coursera-dl
train
py
980e2a5e2b9ce56b8d60bfac4cde922a9b58f882
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ with open(path.join(here, 'README.rst'), encoding='utf-8') as f: setup( name='tortilla', - version='0.1.0.dev2', + version='0.1.0.dev3', description='A tiny library for creating wrappers around external APIs', long_description=long_description, url='https://github.com/redodo/tortilla',
New dev release: <I>.dev3
tortilla_tortilla
train
py
ac34a44f9859d101b310aa01732fb014bc41d6e4
diff --git a/visidata/undo.py b/visidata/undo.py index <HASH>..<HASH> 100644 --- a/visidata/undo.py +++ b/visidata/undo.py @@ -29,8 +29,10 @@ def undo(vd, sheet): undofunc(*args, **kwargs) sheet.undone.append(cmdlogrow) sheet.cmdlog_sheet.rows.remove(cmdlogrow) + + vd.clearCaches() # undofunc can invalidate the drawcache + vd.moveToReplayContext(cmdlogrow) - vd.clearCaches() vd.status("%s undone" % cmdlogrow.longname) return
[undo-] clear drawcache before moving to pre-undo context Per 6a4e<I>c<I>c<I>e<I>d<I>d<I>e5ed1, upon undo, VisiData tries to move cursor to row/col of undone command. If drawcaches are not cleared, VisiData could fail to find that pre-undo context.
saulpw_visidata
train
py
87c46113d1ff9fa25322ab9dadf703e0e8a97d41
diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2HeadersFrame.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2HeadersFrame.java index <HASH>..<HASH> 100644 --- a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2HeadersFrame.java +++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2HeadersFrame.java @@ -34,7 +34,7 @@ public interface Http2HeadersFrame extends Http2StreamFrame { int padding(); /** - * Returns {@code true} if the END_STREAM flag ist set. + * Returns {@code true} if the END_STREAM flag is set. */ boolean isEndStream(); }
Fix typo in Http2HeadersFrame javadocs (#<I>) Motivation: `Http2HeadersFrame#isEndStream()` JavaDoc says `Returns {@code true} if the END_STREAM flag ist set.`. The typo is `ist` word. However, it should be `is`. Modification: Changed `ist` to `is`. Result: Better JavaDoc by fixing the typo.
netty_netty
train
java
0b809d71da2990afaf172398d97bd4969186361a
diff --git a/cloudstack.go b/cloudstack.go index <HASH>..<HASH> 100644 --- a/cloudstack.go +++ b/cloudstack.go @@ -729,8 +729,6 @@ func (d *Driver) setNetwork(networkName string, networkID string) error { if networkID != "" { networkIDs := strings.Split(networkID, ",") - networkIDsResult = make([]string, len(networkIDs)) - networkNamesResult = make([]string, len(networkIDs)) for _, value := range networkIDs { network, _, err = cs.Network.GetNetworkByID(value, d.setParams) if err != nil { @@ -741,8 +739,6 @@ func (d *Driver) setNetwork(networkName string, networkID string) error { } } else { networkNames := strings.Split(networkName, ",") - networkIDsResult = make([]string, len(networkNames)) - networkNamesResult = make([]string, len(networkNames)) for _, value := range networkNames { network, _, err = cs.Network.GetNetworkByName(value, d.setParams) if err != nil {
setNetwork: removing slice initialization with wrong size
andrestc_docker-machine-driver-cloudstack
train
go
aaca93046c5a6d0a16880ac0bc17c6890c57ffa9
diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index <HASH>..<HASH> 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -480,6 +480,8 @@ describe('browser-window module', function() { }); describe('beginFrameSubscription method', function() { + this.timeout(20000); + it('subscribes frame updates', function(done) { let called = false; w.loadURL("file://" + fixtures + "/api/blank.html");
spec: Give beginFrameSubscription test more time to run
electron_electron
train
js