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
0b31f1a19f108846a8844a932ed23797087f34ca
diff --git a/nanocomp/NanoComp.py b/nanocomp/NanoComp.py index <HASH>..<HASH> 100644 --- a/nanocomp/NanoComp.py +++ b/nanocomp/NanoComp.py @@ -185,7 +185,7 @@ def make_plots(df, settings): df=df, y="lengths", figformat=settings["format"], - path=path, + path=settings["path"], violin=violin, title=settings["title"]) ) @@ -194,7 +194,7 @@ def make_plots(df, settings): df=df, y="log length", figformat=settings["format"], - path=path, + path=settings["path"], violin=violin, log=True, title=settings["title"]) @@ -204,7 +204,7 @@ def make_plots(df, settings): df=df, y="quals", figformat=settings["format"], - path=path, + path=settings["path"], violin=violin, title=settings["title"]) ) @@ -214,7 +214,7 @@ def make_plots(df, settings): df=df[df["percentIdentity"] > np.percentile(df["percentIdentity"], 1)], y="percentIdentity", figformat=settings["format"], - path=path, + path=settings["path"], violin=violin, title=settings["title"]) )
should have been settings["path"] instead of path
wdecoster_nanocomp
train
py
fea49b14a99361aae7cbbfb8b4d1eb497455739d
diff --git a/squad/frontend/tests.py b/squad/frontend/tests.py index <HASH>..<HASH> 100644 --- a/squad/frontend/tests.py +++ b/squad/frontend/tests.py @@ -84,7 +84,7 @@ class TestResultTable(list): suite_id, name, SUM(CASE when result is null then 1 else 0 end) as skips, - SUM(CASE when result is not null and not result and not has_known_issues then 1 else 0 end) as fails, + SUM(CASE when result is not null and not result and (has_known_issues is null or not has_known_issues) then 1 else 0 end) as fails, SUM(CASE when result is not null and not result and has_known_issues then 1 else 0 end) as xfails, SUM(CASE when result is null then 0 when result then 1 else 0 end) as passes FROM core_test
frontend: fix sorting test with failures first `has_known_issues` has to be handled like it is in Python, i.e. null needs to also be considered as 'false'.
Linaro_squad
train
py
9bd1b49e16bc62ce87a917d73bba51a99685d2fc
diff --git a/test/server.js b/test/server.js index <HASH>..<HASH> 100644 --- a/test/server.js +++ b/test/server.js @@ -15,6 +15,20 @@ const dummyFetch = function () { require('./spec')(fetchMock, global, require('node-fetch').Request); +describe('support for Buffers', function () { + it('can respond with a buffer', function () { + fetchMock.mock(/a/, { + sendAsJson: false, + body: new Buffer('buffer') + }) + return fetch('http://a.com') + .then(res => res.text()) + .then(txt => { + expect(txt).to.equal('buffer'); + }); + }); +}); + describe('new non-global use', function () { before(function () {
added test for buffer (#<I>)
wheresrhys_fetch-mock
train
js
91bab40ede2cd938aab6261543906a47485775a5
diff --git a/src/Image/Transformation/Icc.php b/src/Image/Transformation/Icc.php index <HASH>..<HASH> 100644 --- a/src/Image/Transformation/Icc.php +++ b/src/Image/Transformation/Icc.php @@ -10,9 +10,15 @@ namespace Imbo\Image\Transformation; -use Imbo\Exception\ConfigurationException; -use Imbo\Exception\InvalidArgumentException; +use Imbo\Exception\ConfigurationException, + Imbo\Exception\InvalidArgumentException; +/** + * Transformation for applying ICC profiles to an image. + * + * @author Mats Lindh <mats@lindh.no> + * @package Image\Transformations + */ class Icc extends Transformation { /** * @var array
Add docblock and normalize use statement
imbo_imbo
train
php
35770118ce6f6ee49d2f1de28bd06ee88c593b9d
diff --git a/samples/memfs/memfs_test.go b/samples/memfs/memfs_test.go index <HASH>..<HASH> 100644 --- a/samples/memfs/memfs_test.go +++ b/samples/memfs/memfs_test.go @@ -1187,5 +1187,25 @@ func (t *MemFSTest) ReadLink_NonExistent() { } func (t *MemFSTest) ReadLink_NotASymlink() { - AssertTrue(false, "TODO") + var err error + + // Create a file and a directory. + fileName := path.Join(t.Dir, "foo") + err = ioutil.WriteFile(fileName, []byte{}, 0400) + AssertEq(nil, err) + + dirName := path.Join(t.Dir, "bar") + err = os.Mkdir(dirName, 0700) + AssertEq(nil, err) + + // Reading either of them as a symlink should fail. + names := []string{ + fileName, + dirName, + } + + for _, n := range names { + _, err = os.Readlink(n) + ExpectThat(err, Error(HasSubstr("invalid argument"))) + } }
MemFSTest.ReadLink_NotASymlink
jacobsa_fuse
train
go
900e2721161f1baeeeee1b4ddb92d44d032603ee
diff --git a/src/system/modules/metamodels/MetaModels/Helper/ToolboxFile.php b/src/system/modules/metamodels/MetaModels/Helper/ToolboxFile.php index <HASH>..<HASH> 100644 --- a/src/system/modules/metamodels/MetaModels/Helper/ToolboxFile.php +++ b/src/system/modules/metamodels/MetaModels/Helper/ToolboxFile.php @@ -74,7 +74,7 @@ class ToolboxFile * * @var array */ - protected $foundFiles; + protected $foundFiles = array(); /** * The folders to process in this instance.
Fix issue #<I> - Found files is not initialized as array.
MetaModels_core
train
php
f2ccc2742b6478d6ca9428e699e93fa176cd5c01
diff --git a/synapse/tools/autodoc.py b/synapse/tools/autodoc.py index <HASH>..<HASH> 100644 --- a/synapse/tools/autodoc.py +++ b/synapse/tools/autodoc.py @@ -225,7 +225,7 @@ def docModel(outp, fd, core): regex = inst.get('regex') if regex is not None: - cons.append('- regex: %s' % (regex,)) + cons.append('- regex: ``%s``' % (regex,)) lower = inst.get('lower') if lower:
Do not allow a regex to be interpreted as rst
vertexproject_synapse
train
py
941b4e1400876bc51403c42c0e0bffdb48bee6ba
diff --git a/molgenis-web/src/main/java/org/molgenis/web/PluginInterceptor.java b/molgenis-web/src/main/java/org/molgenis/web/PluginInterceptor.java index <HASH>..<HASH> 100644 --- a/molgenis-web/src/main/java/org/molgenis/web/PluginInterceptor.java +++ b/molgenis-web/src/main/java/org/molgenis/web/PluginInterceptor.java @@ -58,19 +58,19 @@ public class PluginInterceptor extends HandlerInterceptorAdapter } Entity pluginSettings = molgenisPlugin.getPluginSettings(); - Boolean pluginSettingsCanWrite; + boolean pluginSettingsCanWrite; if (pluginSettings != null) { String pluginSettingsEntityName = pluginSettings.getEntityType().getId(); pluginSettingsCanWrite = permissionService.hasPermissionOnEntityType(pluginSettingsEntityName, Permission.WRITE); + modelAndView.addObject(PluginAttributes.KEY_PLUGIN_SETTINGS, pluginSettings); } else { - pluginSettingsCanWrite = null; + pluginSettingsCanWrite = false; } - modelAndView.addObject(PluginAttributes.KEY_PLUGIN_SETTINGS, pluginSettings); modelAndView.addObject(PluginAttributes.KEY_PLUGIN_SETTINGS_CAN_WRITE, pluginSettingsCanWrite); modelAndView.addObject(PluginAttributes.KEY_MOLGENIS_UI, molgenisUi); modelAndView.addObject(PluginAttributes.KEY_AUTHENTICATED, SecurityUtils.currentUserIsAuthenticated());
Fix high prio FindBugs warnings
molgenis_molgenis
train
java
63128760b4abd19ce8cd348f31fee2ba5dd32dc6
diff --git a/cmd/exo/cmd/vm_delete.go b/cmd/exo/cmd/vm_delete.go index <HASH>..<HASH> 100644 --- a/cmd/exo/cmd/vm_delete.go +++ b/cmd/exo/cmd/vm_delete.go @@ -3,6 +3,8 @@ package cmd import ( "fmt" "log" + "os" + "path" "github.com/exoscale/egoscale" "github.com/spf13/cobra" @@ -54,6 +56,14 @@ func deleteVM(name string) error { return errorReq } + folder := path.Join(configFolder, "instances", vm.ID) + + if _, err := os.Stat(folder); !os.IsNotExist(err) { + if err := os.RemoveAll(folder); err != nil { + return err + } + } + println(vm.ID) return nil
Perform vm delete (#<I>)
exoscale_egoscale
train
go
d709abfdde087325d4578b6709dc61040b8ca9d8
diff --git a/lib/rules/no-unused-vars.js b/lib/rules/no-unused-vars.js index <HASH>..<HASH> 100644 --- a/lib/rules/no-unused-vars.js +++ b/lib/rules/no-unused-vars.js @@ -449,18 +449,24 @@ module.exports = { return ref.isRead() && ( // self update. e.g. `a += 1`, `a++` - (// in RHS of an assignment for itself. e.g. `a = a + 1` - (( + ( + ( parent.type === "AssignmentExpression" && - isUnusedExpression(parent) && - parent.left === id + parent.left === id && + isUnusedExpression(parent) ) || + ( + parent.type === "UpdateExpression" && + isUnusedExpression(parent) + ) + ) || + + // in RHS of an assignment for itself. e.g. `a = a + 1` ( - parent.type === "UpdateExpression" && - isUnusedExpression(parent) - ) || rhsNode && - isInside(id, rhsNode) && - !isInsideOfStorableFunction(id, rhsNode))) + rhsNode && + isInside(id, rhsNode) && + !isInsideOfStorableFunction(id, rhsNode) + ) ); }
Chore: fix comment location in no-unused-vars (#<I>)
eslint_eslint
train
js
7a5ac1ea0397e2ea85f9cdb059a930951d016d51
diff --git a/enhydrator/src/main/java/com/airhacks/enhydrator/flexpipe/Pipeline.java b/enhydrator/src/main/java/com/airhacks/enhydrator/flexpipe/Pipeline.java index <HASH>..<HASH> 100644 --- a/enhydrator/src/main/java/com/airhacks/enhydrator/flexpipe/Pipeline.java +++ b/enhydrator/src/main/java/com/airhacks/enhydrator/flexpipe/Pipeline.java @@ -9,9 +9,9 @@ package com.airhacks.enhydrator.flexpipe; * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -122,6 +122,10 @@ public class Pipeline { return source; } + public void setSource(Source source) { + this.source = source; + } + public String getSqlQuery() { return sqlQuery; }
#<I> - Added setSource() to Pipeline
AdamBien_enhydrator
train
java
eccfbac1af6f0f770f6f22b56ec313f52de9f24d
diff --git a/test/OverlayTriggerSpec.js b/test/OverlayTriggerSpec.js index <HASH>..<HASH> 100644 --- a/test/OverlayTriggerSpec.js +++ b/test/OverlayTriggerSpec.js @@ -123,6 +123,33 @@ describe('<OverlayTrigger>', () => { wrapper.assertSingle('div.test'); }); + it('Should show after mouseover trigger', (done) => { + const clock = sinon.useFakeTimers(); + + try { + const wrapper = mount( + <OverlayTrigger overlay={<Div className="test" />}> + <span>hover me</span> + </OverlayTrigger>, + ); + + wrapper.assertNone('.test'); + + wrapper.find('span').simulate('mouseover'); + + wrapper.assertSingle('div.test'); + + wrapper.find('span').simulate('mouseout'); + + clock.tick(50); + + wrapper.assertNone('.test'); + } finally { + clock.restore(); + done(); + } + }); + it('Should not set aria-describedby if the state is not show', () => { const [button] = mount( <OverlayTrigger trigger="click" overlay={<Div />}>
test: add tests for mouseover trigger and use fake timers (#<I>)
react-bootstrap_react-bootstrap
train
js
ec6b0b06c80b7004427dda15804885b5f13cd49c
diff --git a/seaworthy/tests/test_utils.py b/seaworthy/tests/test_utils.py index <HASH>..<HASH> 100644 --- a/seaworthy/tests/test_utils.py +++ b/seaworthy/tests/test_utils.py @@ -1,9 +1,9 @@ -from testtools.assertions import assert_that -from testtools.matchers import Equals +from unittest import TestCase from seaworthy.utils import resource_name -def test_resource_name(): - # Dummy test so that pytest passes - assert_that(resource_name('foo'), Equals('test_foo')) +class DummyTest(TestCase): + def test_resource_name(self): + # Dummy test so that pytest passes + self.assertEqual(resource_name('foo'), 'test_foo') diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,6 @@ setup( ], 'test': [ 'pytest>=3.0.0', - 'testtools', ], 'docstest': [ 'doc8',
No testtools in core tests.
praekeltfoundation_seaworthy
train
py,py
6f96046deac66647aed05650fdf7610845a16a49
diff --git a/zxingorg/src/main/java/com/google/zxing/web/DecodeServlet.java b/zxingorg/src/main/java/com/google/zxing/web/DecodeServlet.java index <HASH>..<HASH> 100644 --- a/zxingorg/src/main/java/com/google/zxing/web/DecodeServlet.java +++ b/zxingorg/src/main/java/com/google/zxing/web/DecodeServlet.java @@ -303,7 +303,7 @@ public final class DecodeServlet extends HttpServlet { return; } catch (IOException ioe) { log.info(ioe.toString()); - errorResponse(request, response, "badurl"); + errorResponse(request, response, "badimage"); return; } Part fileUploadPart = null;
Fixed error key in doPost() (#<I>) doPost() works only with badimage
zxing_zxing
train
java
b4923c381559ba63ca69987ae7b864ec53d64fa2
diff --git a/lib/default_value_for.rb b/lib/default_value_for.rb index <HASH>..<HASH> 100644 --- a/lib/default_value_for.rb +++ b/lib/default_value_for.rb @@ -70,13 +70,8 @@ module DefaultValueFor after_initialize :set_default_values - if respond_to?(:class_attribute) - class_attribute :_default_attribute_values - class_attribute :_default_attribute_values_not_allowing_nil - else - class_inheritable_accessor :_default_attribute_values - class_inheritable_accessor :_default_attribute_values_not_allowing_nil - end + class_attribute :_default_attribute_values + class_attribute :_default_attribute_values_not_allowing_nil extend(DelayedClassMethods) init_hash = true
class_inheritable_accessor is gone in Rails <I>
FooBarWidget_default_value_for
train
rb
a1d7d65f0a21215851e45639ef7d0df35993ecaa
diff --git a/actionpack/lib/action_dispatch/middleware/params_parser.rb b/actionpack/lib/action_dispatch/middleware/params_parser.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_dispatch/middleware/params_parser.rb +++ b/actionpack/lib/action_dispatch/middleware/params_parser.rb @@ -26,20 +26,19 @@ module ActionDispatch end def call(env) - if params = parse_formatted_parameters(env) - env["action_dispatch.request.request_parameters"] = params - end + default = env["action_dispatch.request.request_parameters"] + env["action_dispatch.request.request_parameters"] = parse_formatted_parameters(env, default) @app.call(env) end private - def parse_formatted_parameters(env) + def parse_formatted_parameters(env, default) request = Request.new(env) - return false if request.content_length.zero? + return default if request.content_length.zero? - strategy = @parsers.fetch(request.content_mime_type) { return false } + strategy = @parsers.fetch(request.content_mime_type) { return default } strategy.call(request.raw_post)
drop a conditional by always assigning We will always make an assignment to the env hash and eliminate a conditional
rails_rails
train
rb
72a8374682884a950d75fde1a7c711f48e250afc
diff --git a/src/test/java/org/takes/facets/auth/PsByFlagTest.java b/src/test/java/org/takes/facets/auth/PsByFlagTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/takes/facets/auth/PsByFlagTest.java +++ b/src/test/java/org/takes/facets/auth/PsByFlagTest.java @@ -126,7 +126,7 @@ public final class PsByFlagTest { new PsByFlag.Pair( KEY, new PsFake(true) ) - ).exit(response, this.identity), + ).exit(response, identity), Matchers.is(response) ); }
PsByFlag is not tested #<I> - fixed qulice violations and removed "this" for static members
yegor256_takes
train
java
5bc58b200d7b352160e5544bb61d6268882a8f79
diff --git a/src/module-elasticsuite-tracker/view/frontend/web/js/user-consent.js b/src/module-elasticsuite-tracker/view/frontend/web/js/user-consent.js index <HASH>..<HASH> 100644 --- a/src/module-elasticsuite-tracker/view/frontend/web/js/user-consent.js +++ b/src/module-elasticsuite-tracker/view/frontend/web/js/user-consent.js @@ -15,4 +15,4 @@ define(['jquery', 'mage/cookies'], function ($) { return function(config) { return config.cookieRestrictionEnabled == false || $.mage.cookies.get(config.cookieRestrictionName) !== null; }; -}) +});
Make js compatible to merging with other files. When merging this file using e.g. magepack, the missing semicolon may cause problems in the file that gets appended. It may try to call define() as a function.
Smile-SA_elasticsuite
train
js
13213d07ac99ae42fa4e6b80deac2f7bbdd89106
diff --git a/checklist-model.js b/checklist-model.js index <HASH>..<HASH> 100644 --- a/checklist-model.js +++ b/checklist-model.js @@ -88,7 +88,7 @@ angular.module('checklist-model', []) } // exclude recursion - tElement.removeAttr('checklist-model data-checklist-model'); + tElement.removeAttr('checklist-model'); // local scope var storing individual checkbox model tElement.attr('ng-model', 'checked');
Looped for ever. Fixed infinity loop.
vitalets_checklist-model
train
js
6c02dcd7a5ae1f3f72ff682a7c8563c3c38a19bc
diff --git a/Spread/ReplySpread.php b/Spread/ReplySpread.php index <HASH>..<HASH> 100644 --- a/Spread/ReplySpread.php +++ b/Spread/ReplySpread.php @@ -45,11 +45,9 @@ class ReplySpread implements SpreadInterface $posts = array_merge([$parent], $parent->getChildren()->toArray()); $done = []; foreach ($posts as $check) { - // Load the author, spread if they are not the new reply author and - // they have not been spread to yet. + // Load the author, spread if they have not been spread to yet. $author = $this->user_provider->loadUserByUsername($check->getAuthor()); if (!$author instanceof UserInterface - || $author->getUsername() == $post->getAuthor() || isset($done[$author->getUsername()])) { continue; }
Spread to post authors, notifications will be handled.
bkstg_notice-board-bundle
train
php
f0af9d07bfe46200ebe4b1bf81eb5658a0653cf5
diff --git a/src/js/pannellum.js b/src/js/pannellum.js index <HASH>..<HASH> 100644 --- a/src/js/pannellum.js +++ b/src/js/pannellum.js @@ -480,10 +480,10 @@ function onImageLoad() { if (config.doubleClickZoom) { dragFix.addEventListener('dblclick', onDocumentDoubleClick, false); } - uiContainer.addEventListener('mozfullscreenchange', onFullScreenChange, false); - uiContainer.addEventListener('webkitfullscreenchange', onFullScreenChange, false); - uiContainer.addEventListener('msfullscreenchange', onFullScreenChange, false); - uiContainer.addEventListener('fullscreenchange', onFullScreenChange, false); + container.addEventListener('mozfullscreenchange', onFullScreenChange, false); + container.addEventListener('webkitfullscreenchange', onFullScreenChange, false); + container.addEventListener('msfullscreenchange', onFullScreenChange, false); + container.addEventListener('fullscreenchange', onFullScreenChange, false); window.addEventListener('resize', onDocumentResize, false); window.addEventListener('orientationchange', onDocumentResize, false); if (!config.disableKeyboardCtrl) {
Fix interaction between F<I> and API fullscreens in Chrome (fixes #<I>).
mpetroff_pannellum
train
js
23cb42ae4a6b6555df5ea248d31d296e1f66f6d1
diff --git a/connection.go b/connection.go index <HASH>..<HASH> 100644 --- a/connection.go +++ b/connection.go @@ -69,6 +69,8 @@ type Connection struct { conn io.ReadWriteCloser + LocalAddr net.Addr // local TCP peer address + rpc chan message writer *writer sends chan time.Time // timestamps of each frame sent @@ -188,7 +190,14 @@ func DialConfig(url string, config Config) (*Connection, error) { conn = client } - return Open(conn, config) + c, err := Open(conn, config) + if err != nil { + return nil, err + } + + c.LocalAddr = conn.LocalAddr() + + return c, err } /*
Expose the local TCP address
streadway_amqp
train
go
bbd099c902b81c9850f7a19ef0d0f7cd9b0349ef
diff --git a/waldur_core/logging/loggers.py b/waldur_core/logging/loggers.py index <HASH>..<HASH> 100644 --- a/waldur_core/logging/loggers.py +++ b/waldur_core/logging/loggers.py @@ -373,7 +373,7 @@ class BaseLoggerRegistry(object): def register(self, name, logger_class): if name in self.__dict__: raise EventLoggerError("Logger '%s' already registered." % name) - self.__dict__[name] = logger_class() if isinstance(logger, type) else logger_class + self.__dict__[name] = logger_class() def unregister_all(self): self.__dict__ = {}
Fix tests [WAL-<I>]
opennode_waldur-core
train
py
5503a6a152f2cb59264a2f5a5e267f38355c871a
diff --git a/docs/exts/redirects.py b/docs/exts/redirects.py index <HASH>..<HASH> 100644 --- a/docs/exts/redirects.py +++ b/docs/exts/redirects.py @@ -29,7 +29,7 @@ log = logging.getLogger(__name__) def generate_redirects(app): - """Generaate redirects files.""" + """Generate redirects files.""" redirect_file_path = os.path.join(app.srcdir, app.config.redirects_file) if not os.path.exists(redirect_file_path): raise ExtensionError(f"Could not find redirects file at '{redirect_file_path}'") @@ -38,7 +38,7 @@ def generate_redirects(app): if not isinstance(app.builder, builders.StandaloneHTMLBuilder): log.warning( - "The plugin is support only 'html' builder, but you are using '{type(app.builder)}'. Skipping..." + f"The plugin supports only 'html' builder, but you are using '{type(app.builder)}'. Skipping..." ) return
Fix Warning when using a different Sphinx Builder (#<I>)
apache_airflow
train
py
056ba53361787057f249153ba7207d77dc1533ce
diff --git a/aiidalab_widgets_base/codes.py b/aiidalab_widgets_base/codes.py index <HASH>..<HASH> 100644 --- a/aiidalab_widgets_base/codes.py +++ b/aiidalab_widgets_base/codes.py @@ -8,7 +8,7 @@ from aiida.plugins.entry_point import get_entry_point_names from IPython.display import clear_output from traitlets import Bool, Dict, Instance, Unicode, Union, dlink, link, validate -from aiidalab_widgets_base.computers import ComputerDropdown +from .computers import ComputerDropdown class CodeDropdown(ipw.VBox): diff --git a/aiidalab_widgets_base/viewers.py b/aiidalab_widgets_base/viewers.py index <HASH>..<HASH> 100644 --- a/aiidalab_widgets_base/viewers.py +++ b/aiidalab_widgets_base/viewers.py @@ -94,8 +94,6 @@ class AiidaNodeViewWidget(ipw.VBox): @traitlets.observe("node") def _observe_node(self, change): - from aiidalab_widgets_base import viewer - if change["new"] != change["old"]: with self._output: clear_output()
Fix imports: (#<I>) - Do not import viewer, as it is defined in the same file. - Use "import .computers" instead of "import awb.computers"
aiidalab_aiidalab-widgets-base
train
py,py
0abfdb217e13f29943d438946d750e6907798c1e
diff --git a/u2flib_server/__init__.py b/u2flib_server/__init__.py index <HASH>..<HASH> 100644 --- a/u2flib_server/__init__.py +++ b/u2flib_server/__init__.py @@ -25,4 +25,4 @@ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -__version__ = "3.3.0-dev" +__version__ = "4.0.0-dev"
Increment version to <I>
Yubico_python-u2flib-server
train
py
3102a7e69fc86d66ce4cb39a58e9e665d908600d
diff --git a/remi/server.py b/remi/server.py index <HASH>..<HASH> 100644 --- a/remi/server.py +++ b/remi/server.py @@ -571,7 +571,7 @@ ws.onerror = function(evt){ if self.server.enable_file_cache: self.send_header('Cache-Control', 'public, max-age=86400') self.end_headers() - with open(filename, 'r+b') as f: + with open(filename, 'rb') as f: content = f.read() self.wfile.write(content) elif attr_call:
Removing the + on the file permission as we are only reading the file
dddomodossola_remi
train
py
4c11b8c76e81839037ef9d7d6631841037ae4470
diff --git a/store/redigostore/redigostore.go b/store/redigostore/redigostore.go index <HASH>..<HASH> 100644 --- a/store/redigostore/redigostore.go +++ b/store/redigostore/redigostore.go @@ -74,7 +74,7 @@ func (r *RedigoStore) GetWithTime(key string) (int64, time.Time, error) { if _, err := redis.Scan(timeReply, &s, &ms); err != nil { return 0, now, err } - now = time.Unix(s, ms*int64(time.Millisecond)) + now = time.Unix(s, ms*int64(time.Microsecond)) v, err := redis.Int64(conn.Receive()) if err == redis.ErrNil {
Fix parsing of `TIME` in redigostore I noticed that the current time being returned from this store looked off, and upon [reading the docs for Redis' TIME][redis-time], it looks like the second element in the array is actually supposed to be read as microseconds. This patch changes the current millisecond implementation to microseconds. [redis-time]: <URL>
throttled_throttled
train
go
498588591b04e220bf0c2083e4e4f8a2c5ab7ecf
diff --git a/ontobio/io/hpoaparser.py b/ontobio/io/hpoaparser.py index <HASH>..<HASH> 100644 --- a/ontobio/io/hpoaparser.py +++ b/ontobio/io/hpoaparser.py @@ -174,9 +174,8 @@ class HpoaParser(AssocParser): relation = None # With/From - # withfroms = self.validate_pipe_separated_ids(withfrom, split_line, empty_allowed=True, extra_delims=",") + withfroms = self.validate_pipe_separated_ids(withfrom, split_line, empty_allowed=True, extra_delims=",") - withfroms = self._unroll_withfrom_and_replair_obsoletes(split_line, 'gpad') if withfroms is None: # Reporting occurs in above function call return assocparser.ParseResult(line, [], True)
talking to Kent, leave HPOA out of this change.
biolink_ontobio
train
py
2dfe60fc7ea5bfbc9f65440c53639eb767b4efcf
diff --git a/omnibus_overrides.rb b/omnibus_overrides.rb index <HASH>..<HASH> 100644 --- a/omnibus_overrides.rb +++ b/omnibus_overrides.rb @@ -14,7 +14,7 @@ override "libyaml", version: "0.1.7" override "makedepend", version: "1.0.5" override "ncurses", version: "5.9" override "pkg-config-lite", version: "0.28-1" -override "ruby", version: "2.4.3" +override "ruby", version: "2.5.0" override "ruby-windows-devkit-bash", version: "3.1.23-4-msys-1.0.18" override "util-macros", version: "1.19.0" override "xproto", version: "7.0.28"
Bump to ruby <I>
chef_chef
train
rb
30860292a8805e83fa22e4c1561994e9d3419ba2
diff --git a/services-discovery/src/main/java/io/scalecube/services/discovery/ScalecubeServiceDiscovery.java b/services-discovery/src/main/java/io/scalecube/services/discovery/ScalecubeServiceDiscovery.java index <HASH>..<HASH> 100644 --- a/services-discovery/src/main/java/io/scalecube/services/discovery/ScalecubeServiceDiscovery.java +++ b/services-discovery/src/main/java/io/scalecube/services/discovery/ScalecubeServiceDiscovery.java @@ -122,7 +122,7 @@ public class ScalecubeServiceDiscovery implements ServiceDiscovery { private void onMemberEvent(MembershipEvent event) { final Member member = event.member(); - Map<String, String> metadata = Collections.emptyMap(); + Map<String, String> metadata = null; if (event.isAdded()) { metadata = event.newMetadata(); } @@ -131,7 +131,8 @@ public class ScalecubeServiceDiscovery implements ServiceDiscovery { } List<ServiceEndpoint> serviceEndpoints = - metadata + Optional.ofNullable(metadata) + .orElse(Collections.emptyMap()) .values() .stream() .map(ClusterMetadataDecoder::decodeMetadata)
Fixed NPE with metadta during some tests run
scalecube_scalecube-services
train
java
24b2f7e983ed7e9f4c0fbbcaebaa7d7616a6c1c0
diff --git a/framework/validators/Validator.php b/framework/validators/Validator.php index <HASH>..<HASH> 100644 --- a/framework/validators/Validator.php +++ b/framework/validators/Validator.php @@ -316,7 +316,21 @@ class Validator extends Component * Validates a value. * A validator class can implement this method to support data validation out of the context of a data model. * @param mixed $value the data value to be validated. - * @return array|null the error message and the parameters to be inserted into the error message. + * @return array|null the error message and the array of parameters to be inserted into the error message. + * ```php + * if (!$valid) { + * return [$this->message, [ + * 'param1' => $this->param1, + * 'formattedLimit' => Yii::$app->formatter->asShortSize($this->getSizeLimit()), + * 'mimeTypes' => implode(', ', $this->mimeTypes), + * 'param4' => 'etc...', + * ]]; + * } + * + * return null; + * ``` + * for this example `message` template can contain `{param1}`, `{formattedLimit}`, `{mimeTypes}`, `{param4}` + * * Null should be returned if the data is valid. * @throws NotSupportedException if the validator does not supporting data validation without a model */
Added example to validateValue PHPDoc [skip ci] (#<I>)
yiisoft_yii-core
train
php
c3c72c38a33059ad317c4bb584ab304fd46524d5
diff --git a/v2/handler.js b/v2/handler.js index <HASH>..<HASH> 100644 --- a/v2/handler.js +++ b/v2/handler.js @@ -51,9 +51,6 @@ var GLOBAL_WRITE_BUFFER = new Buffer(v2.Frame.MaxSize); module.exports = TChannelV2Handler; function TChannelV2Handler(options) { - if (!(this instanceof TChannelV2Handler)) { - return new TChannelV2Handler(options); - } var self = this; EventEmitter.call(self); self.errorEvent = self.defineEvent('error');
TChannelV2Handler: drop new-less support
uber_tchannel-node
train
js
eee560265027a0b21b6c25b66c5830cfc8ff693f
diff --git a/pmagpy/new_builder.py b/pmagpy/new_builder.py index <HASH>..<HASH> 100644 --- a/pmagpy/new_builder.py +++ b/pmagpy/new_builder.py @@ -1582,7 +1582,7 @@ class MagicDataFrame(object): def merge_dfs(self, df1): """ - Description: takes new calculated data and replaces the corresponding data in self.df with the new input data preserving the most important metadata if they are not otherwise saved. + Description: takes new calculated data and replaces the corresponding data in self.df with the new input data preserving the most important metadata if they are not otherwise saved. Note this does not mutate self.df it simply returns the merged dataframe if you want to replace self.df you'll have to do that yourself. @param: df1 - first DataFrame whose data will preferentially be used. """
just a small change to merge_dfs documentation I forgot in the last commit
PmagPy_PmagPy
train
py
91b593dc19e8700540e78927e42a876730165f2b
diff --git a/test/visitors/test_to_sql.rb b/test/visitors/test_to_sql.rb index <HASH>..<HASH> 100644 --- a/test/visitors/test_to_sql.rb +++ b/test/visitors/test_to_sql.rb @@ -695,7 +695,7 @@ module Arel it 'supports #when with two arguments and no #then' do node = Arel::Nodes::Case.new @table[:name] - { foo: 1, bar: 0 }.reduce(node) { |node, pair| node.when *pair } + { foo: 1, bar: 0 }.reduce(node) { |_node, pair| _node.when(*pair) } compile(node).must_be_like %{ CASE "users"."name" WHEN 'foo' THEN 1 WHEN 'bar' THEN 0 END
Fix warnings from test_to_sql test
rails_rails
train
rb
8278a47caa5f116086873dce01090d5937b5cde2
diff --git a/src/Symfony/Component/Stopwatch/StopwatchEvent.php b/src/Symfony/Component/Stopwatch/StopwatchEvent.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Stopwatch/StopwatchEvent.php +++ b/src/Symfony/Component/Stopwatch/StopwatchEvent.php @@ -150,7 +150,7 @@ class StopwatchEvent /** * Gets the relative time of the start of the first period. * - * @return int The time (in milliseconds) + * @return int|float The time (in milliseconds) */ public function getStartTime() { @@ -160,7 +160,7 @@ class StopwatchEvent /** * Gets the relative time of the end of the last period. * - * @return int The time (in milliseconds) + * @return int|float The time (in milliseconds) */ public function getEndTime() { @@ -172,7 +172,7 @@ class StopwatchEvent /** * Gets the duration of the events (including all periods). * - * @return int The duration (in milliseconds) + * @return int|float The duration (in milliseconds) */ public function getDuration() {
updated StopwatchEvent phpdoc due to the additional of optional float precision introduced in 0db8d7fb6a<I>f<I>f<I>e5e<I>c<I>ff
symfony_symfony
train
php
454c5a862567ebe1b7e6475baa68846a059a456e
diff --git a/packages/gluestick/src/generator/predefined/new.js b/packages/gluestick/src/generator/predefined/new.js index <HASH>..<HASH> 100644 --- a/packages/gluestick/src/generator/predefined/new.js +++ b/packages/gluestick/src/generator/predefined/new.js @@ -34,6 +34,7 @@ const templateNoMatchApp = require('../templates/NoMatchApp')(createTemplate); const templateReducer = require('../templates/Reducer')(createTemplate); const templateEntries = require('../templates/entries')(createTemplate); const templateGluestickPlugins = require('../templates/gluestick.plugins')(createTemplate); +const templateGluestickHooks = require('../templates/gluestick.hooks')(createTemplate); const { flowVersion } = require('../constants'); // @TODO use config in new command when PR #571 is merged @@ -108,6 +109,11 @@ module.exports = (options: GeneratorOptions) => ({ template: templateGluestickPlugins, }, { + path: 'src', + filename: 'gluestick.hooks.js', + template: templateGluestickHooks, + }, + { path: 'src/config', filename: '.Dockerfile', template: templateDockerfile,
add gluestick.hooks.js to new generator
TrueCar_gluestick
train
js
f5c7dfbe0fb55d850bbadf9d754e5f236b0d1d25
diff --git a/server.go b/server.go index <HASH>..<HASH> 100644 --- a/server.go +++ b/server.go @@ -75,17 +75,11 @@ func NewServer(cert, privKey, clientCACert, clientCAKey []byte, laddr string, de }) privRoute.Request("msg.send", func(ctx *jsonrpc.ReqContext) { - ctx.Res = ctx.Req.Params - if ctx.Res == nil { - ctx.Res = "" - } + }) privRoute.Request("msg.recv", func(ctx *jsonrpc.ReqContext) { - ctx.Res = ctx.Req.Params - if ctx.Res == nil { - ctx.Res = "" - } + }) // privRoute.Middleware(NotFoundHandler()) // 404-like handler
clear dummy route handlers
titan-x_titan
train
go
166ecd2b3ea25674a4da0079b1ce4aa5e49ed521
diff --git a/controller/types/types.go b/controller/types/types.go index <HASH>..<HASH> 100644 --- a/controller/types/types.go +++ b/controller/types/types.go @@ -28,6 +28,11 @@ type ExpandedFormation struct { Tags map[string]map[string]string `json:"tags,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` Deleted bool `json:"deleted,omitempty"` + + // DeprecatedImageArtifact is for creating backwards compatible cluster + // backups (the restore process used to require the ImageArtifact field + // to be set). + DeprecatedImageArtifact *Artifact `json:"artifact,omitempty"` } type App struct { diff --git a/pkg/backup/backup.go b/pkg/backup/backup.go index <HASH>..<HASH> 100644 --- a/pkg/backup/backup.go +++ b/pkg/backup/backup.go @@ -115,6 +115,11 @@ func getApps(client controller.Client) (map[string]*ct.ExpandedFormation, error) App: app, Release: release, Processes: formation.Processes, + + // set DeprecatedImageArtifact to support restoring + // to old clusters (the URI is overwritten on restore, + // but the field is expected to be set) + DeprecatedImageArtifact: &ct.Artifact{Type: ct.DeprecatedArtifactTypeDocker}, } } return data, nil
pkg/backup: Create backwards compatible backups
flynn_flynn
train
go,go
4e17dda2aa6cddb626f7ab795781bf36aaa68d8f
diff --git a/default_reporter.js b/default_reporter.js index <HASH>..<HASH> 100644 --- a/default_reporter.js +++ b/default_reporter.js @@ -94,7 +94,7 @@ module.exports = console.log('```'); console.log(JSON.stringify(error, null, 2)); console.log('```'); - }; + } console.log('\n## Final State:\n'); console.log('```'); diff --git a/tests/error_async.js b/tests/error_async.js index <HASH>..<HASH> 100644 --- a/tests/error_async.js +++ b/tests/error_async.js @@ -16,13 +16,16 @@ module.exports = }, // terminable function - function(cb) + // function needs to be defined with an argument + // to signal that it's async capable + // but eslint complaining + function(cb) //eslint-disable-line no-unused-vars { var id = setTimeout(function() { throw new Error('Should be cancelled.'); - cb('will not get here'); + // cb('will not get here'); }, 1500); return function terminate()
Cleaned up lint errors.
alexindigo_batcher
train
js,js
1c11c8bc98bd3698779072280beca49a1d4eda92
diff --git a/test/fixture/interface.js b/test/fixture/interface.js index <HASH>..<HASH> 100644 --- a/test/fixture/interface.js +++ b/test/fixture/interface.js @@ -54,7 +54,7 @@ // When listener is ready start immortal listener.once('listening', function () { immortal.start(filename, common.extend(preOptions, options), function (error) { - if (error) throw error; + if (error) return callback(error, null); }); }); }; @@ -72,7 +72,7 @@ self.pid = object.pid; // Execute testcase callback - callback(self); + callback(null, self); }); // Set ready function
[test] relay errors to callback
AndreasMadsen_immortal
train
js
a9ecb794180c882fc7468c8f0d912981f19e08d3
diff --git a/sdk/src/classes.js b/sdk/src/classes.js index <HASH>..<HASH> 100644 --- a/sdk/src/classes.js +++ b/sdk/src/classes.js @@ -508,6 +508,6 @@ F2.extend('', { * } * }); */ - loadScripts: function(scripts,inlines,callback){} + loadStyles: function(styles,callback){} } }); \ No newline at end of file
Fixed dup properties, oops
OpenF2_F2
train
js
e11e1637fc2d99756161a325cdd3fe826a06700a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -4,11 +4,6 @@ install_requirements = ['pytz', 'tzlocal'] version = '2.4.3' -try: - import importlib -except ImportError: - install_requirements.append('importlib') - setup( name='tasklib', version=version,
Drop importlib from install_requirements Part of Python since <I>.
robgolding_tasklib
train
py
c4f67bfa577a1f5ca3fd21df49dd640b922e8602
diff --git a/packages/babel-register/src/node.js b/packages/babel-register/src/node.js index <HASH>..<HASH> 100644 --- a/packages/babel-register/src/node.js +++ b/packages/babel-register/src/node.js @@ -101,7 +101,6 @@ function hookExtensions(exts) { export function revert() { if (piratesRevert) piratesRevert(); - delete require.cache[require.resolve(__filename)]; } register(); diff --git a/packages/babel-register/test/index.js b/packages/babel-register/test/index.js index <HASH>..<HASH> 100644 --- a/packages/babel-register/test/index.js +++ b/packages/babel-register/test/index.js @@ -52,6 +52,7 @@ describe("@babel/register", function() { function revertRegister() { if (babelRegister) { babelRegister.revert(); + delete require.cache[registerFile]; babelRegister = null; } }
Leave it to users to clear the require cache if they want to.
babel_babel
train
js,js
2023d8a7980c28137ca35d2250dc6bc2d3e5a4d9
diff --git a/chunkenc/xor.go b/chunkenc/xor.go index <HASH>..<HASH> 100644 --- a/chunkenc/xor.go +++ b/chunkenc/xor.go @@ -89,7 +89,6 @@ func (c *XORChunk) Appender() (Appender, error) { } a := &xorAppender{ - c: c, b: c.b, t: it.t, v: it.val, @@ -119,7 +118,6 @@ func (c *XORChunk) Iterator() Iterator { } type xorAppender struct { - c *XORChunk b *bstream t int64
Remove unused field from xorAppender This field is not used, remove it.
prometheus_prometheus
train
go
9527476143e68a039b34b75addcf8e495718d174
diff --git a/js/binance.js b/js/binance.js index <HASH>..<HASH> 100644 --- a/js/binance.js +++ b/js/binance.js @@ -3478,7 +3478,8 @@ module.exports = class binance extends Exchange { await this.loadMarkets (); // by default cache the leverage bracket // it contains useful stuff like the maintenance margin and initial margin for positions - if ((this.options['leverageBrackets'] === undefined) || (reload)) { + const leverageBrackets = this.safeValue (this.options, 'leverageBrackets', {}); + if ((leverageBrackets === undefined) || (reload)) { let method = undefined; const defaultType = this.safeString2 (this.options, 'fetchPositions', 'defaultType', 'future'); const type = this.safeString (params, 'type', defaultType);
binance loadLeverageBrackets linting
ccxt_ccxt
train
js
93f6529fe57aa2f3f4a531d03bfe117a016e1cfe
diff --git a/lib/airtable/version.rb b/lib/airtable/version.rb index <HASH>..<HASH> 100644 --- a/lib/airtable/version.rb +++ b/lib/airtable/version.rb @@ -1,3 +1,3 @@ module Airtable - VERSION = "0.0.1" + VERSION = "0.0.2" end
Bump to version <I>
Airtable_airtable-ruby
train
rb
fcbb5ebea033dc94fc571471a185ed04d15f55ff
diff --git a/app/code/community/Varien/Profiler.php b/app/code/community/Varien/Profiler.php index <HASH>..<HASH> 100755 --- a/app/code/community/Varien/Profiler.php +++ b/app/code/community/Varien/Profiler.php @@ -579,12 +579,12 @@ class Varien_Profiler public static function getTimers() { if (!self::$_timers) { - self::$_timers = []; + self::$_timers = array(); foreach (self::getStackLog() as $stackLogItem) { $timerName = end($stackLogItem['stack']); reset($stackLogItem['stack']); if (!isset(self::$_timers[$timerName])) { - self::$_timers[$timerName] = [ + self::$_timers[$timerName] = array( 'start' => false, 'count' => 0, 'sum' => 0, @@ -592,7 +592,7 @@ class Varien_Profiler 'emalloc' => 0, 'realmem_start' => $stackLogItem['realmem_start'], 'emalloc_start' => 0, //$stackLogItem['emalloc_start'] - ]; + ); } self::$_timers[$timerName]['count'] += 1; self::$_timers[$timerName]['sum'] += $stackLogItem['time_total'];
[BUGFIX] Fix compatibility with PHP <I>
AOEpeople_Aoe_Profiler
train
php
14547424882a812d561bc7cc85a616eaa81614d4
diff --git a/ut/__init__.py b/ut/__init__.py index <HASH>..<HASH> 100644 --- a/ut/__init__.py +++ b/ut/__init__.py @@ -8,6 +8,7 @@ from hsyncnet import tests as hsyncnet_unit_tests; from kmeans import tests as kmeans_unit_tests; from nnet.som import tests as nnet_som_unit_tests; from nnet.sync import tests as nnet_sync_unit_tests; +from rock import tests as rock_unit_tests; from support import tests as support_unit_tests; from syncnet import tests as syncnet_unit_tests; @@ -25,6 +26,7 @@ if __name__ == "__main__": suite.addTests(unittest.TestLoader().loadTestsFromModule(support_unit_tests)); suite.addTests(unittest.TestLoader().loadTestsFromModule(syncnet_unit_tests)); suite.addTests(unittest.TestLoader().loadTestsFromModule(kmeans_unit_tests)); + suite.addTests(unittest.TestLoader().loadTestsFromModule(rock_unit_tests)); unittest.TextTestRunner(verbosity = 2).run(suite); \ No newline at end of file
The unit-tests for the ROCK have been registered in the ut module
annoviko_pyclustering
train
py
29138ca794786631977646e5eefbecd11fadc307
diff --git a/src/components/list/QItemWrapper.js b/src/components/list/QItemWrapper.js index <HASH>..<HASH> 100644 --- a/src/components/list/QItemWrapper.js +++ b/src/components/list/QItemWrapper.js @@ -45,7 +45,7 @@ export default { push(child, h, QItemSide, slot.left, replace, { icon: cfg.icon, - color: cfg.iconColor, + color: cfg.leftColor, avatar: cfg.avatar, letter: cfg.letter, image: cfg.image @@ -62,7 +62,7 @@ export default { push(child, h, QItemSide, slot.right, replace, { right: true, icon: cfg.rightIcon, - color: cfg.rightIconColor, + color: cfg.rightColor, avatar: cfg.rightAvatar, letter: cfg.rightLetter, image: cfg.rightImage,
feat: Add iconColor and rightIconColor as options to QSelect items #<I>
quasarframework_quasar
train
js
0b17be7ec27f378d1c80b352e191567a9107543e
diff --git a/js/slider.js b/js/slider.js index <HASH>..<HASH> 100644 --- a/js/slider.js +++ b/js/slider.js @@ -223,7 +223,7 @@ panning = false; curr_index = $slider.find('.active').index(); - if (!swipeRight && !swipeLeft) { + if (!swipeRight && !swipeLeft || $slides.length <=1) { // Return to original spot $curr_slide.velocity({ translateX: 0 }, {duration: 300, queue: false, easing: 'easeOutQuad'}); @@ -318,4 +318,4 @@ $.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.tooltip' ); } }; // Plugin end -}( jQuery )); \ No newline at end of file +}( jQuery ));
Fix for #<I>. If there is a single slide in slider and swipe left or rigth, return to original position
Dogfalo_materialize
train
js
51550c8da366d2fd457739298709d35fbecf7c22
diff --git a/core/server/data/migrations/utils.js b/core/server/data/migrations/utils.js index <HASH>..<HASH> 100644 --- a/core/server/data/migrations/utils.js +++ b/core/server/data/migrations/utils.js @@ -178,7 +178,7 @@ function addPermissionToRole(config) { return; } - logging.warn(`Adding permission(${config.permission}) to role(${config.role})`); + logging.info(`Adding permission(${config.permission}) to role(${config.role})`); await connection('permissions_roles').insert({ id: ObjectId().toHexString(), permission_id: permission.id,
Fixed logging level when adding permissions to roles - `info` should be used here because it's an expected point in the code and there's nothing to warn about
TryGhost_Ghost
train
js
a0403a359f4241b10c26319b2358ea8b88ed4891
diff --git a/example/appengine_oauth.py b/example/appengine_oauth.py index <HASH>..<HASH> 100644 --- a/example/appengine_oauth.py +++ b/example/appengine_oauth.py @@ -27,7 +27,7 @@ import os from google.appengine.ext import webapp from google.appengine.ext import db from google.appengine.ext.webapp import util -import oauth2 as oauth +import oauth2 as oauth # httplib2 is required for this to work on AppEngine class Client(db.Model): # oauth_key is the Model's key_name field
Added a note about requiring httplib2
TimSC_python-oauth10a
train
py
0081089e6c458dd79fc193e7546da75031d87ea6
diff --git a/lib/DirectEditing.js b/lib/DirectEditing.js index <HASH>..<HASH> 100644 --- a/lib/DirectEditing.js +++ b/lib/DirectEditing.js @@ -13,6 +13,8 @@ var TextBox = require('./TextBox'); */ function DirectEditing(eventBus, canvas) { + this._eventBus = eventBus; + this._providers = []; this._textbox = new TextBox({ container: canvas.getContainer(), @@ -55,12 +57,20 @@ DirectEditing.prototype.cancel = function() { return; } + this._fire('cancel'); this.close(); }; +DirectEditing.prototype._fire = function(event) { + this._eventBus.fire('directEditing.' + event, { active: this._active }); +}; + DirectEditing.prototype.close = function() { this._textbox.destroy(); + + this._fire('deactivate'); + this._active = null; }; @@ -79,6 +89,8 @@ DirectEditing.prototype.complete = function() { active.provider.update(active.element, text, active.context.text); } + this._fire('complete'); + this.close(); }; @@ -137,6 +149,8 @@ DirectEditing.prototype.activate = function(element) { context: context, provider: provider }; + + this._fire('activate'); } return !!context;
feat(plug-in): fire events during editing operation
bpmn-io_diagram-js-direct-editing
train
js
4df168b504f9762d6d4958404a1bc76f6cecaf06
diff --git a/trix/widgets.py b/trix/widgets.py index <HASH>..<HASH> 100644 --- a/trix/widgets.py +++ b/trix/widgets.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals from django import forms from django.contrib.admin import widgets as admin_widgets +from django.utils.html import format_html class TrixEditor(forms.Textarea): @@ -18,7 +19,8 @@ class TrixEditor(forms.Textarea): param_str = ' '.join('{}="{}"'.format(k, v) for k, v in params.items()) html = super(TrixEditor, self).render(name, value, attrs) - html += '<p><trix-editor {}></trix-editor></p>'.format(param_str) + html = format_html( + '{}<p><trix-editor {}></trix-editor></p>', html, param_str) return html class Media:
use format_html when building widget to mark safe
istrategylabs_django-trix
train
py
0de26d9ca8c6d8d02bf6710a7f36874053677c5a
diff --git a/nexus/sites.py b/nexus/sites.py index <HASH>..<HASH> 100644 --- a/nexus/sites.py +++ b/nexus/sites.py @@ -212,13 +212,16 @@ class NexusSite(object): response["Content-Length"] = len(contents) return response - def login(self, request): + def login(self, request, form_class=None): "Login form" from django.contrib.auth import login as login_ from django.contrib.auth.forms import AuthenticationForm + if form_class is None: + form_class = AuthenticationForm + if request.POST: - form = AuthenticationForm(request, request.POST) + form = form_class(request, request.POST) if form.is_valid(): login_(request, form.get_user()) request.session.save() @@ -226,7 +229,7 @@ class NexusSite(object): else: request.session.set_test_cookie() else: - form = AuthenticationForm(request) + form = form_class(request) request.session.set_test_cookie() return self.render_to_response('nexus/login.html', {
Allow the form_class used by NexusSite to be overriden by a subclass.
disqus_nexus
train
py
752e01a10bc459a06759cea6896bdb7c7eeb1bd1
diff --git a/src/Carbon/Lang/et.php b/src/Carbon/Lang/et.php index <HASH>..<HASH> 100644 --- a/src/Carbon/Lang/et.php +++ b/src/Carbon/Lang/et.php @@ -30,6 +30,7 @@ * - Zahhar Kirillov * - João Magalhães * - Ingmar + * - Illimar Tambek */ return [ 'year' => ':count aasta|:count aastat', @@ -68,10 +69,10 @@ return [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'DD. MMMM YYYY', - 'LLL' => 'DD. MMMM YYYY HH:mm', - 'LLLL' => 'dddd, DD. MMMM YYYY HH:mm', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D. MMMM YYYY', + 'LLL' => 'D. MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D. MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[täna] LT',
Fix estonian date formats based on CLDR data
briannesbitt_Carbon
train
php
f26372c730844ebb10a951dae89ab54561e36d91
diff --git a/js/coinmarketcap.js b/js/coinmarketcap.js index <HASH>..<HASH> 100644 --- a/js/coinmarketcap.js +++ b/js/coinmarketcap.js @@ -16,16 +16,16 @@ module.exports = class coinmarketcap extends Exchange { 'rateLimit': 10000, 'version': 'v1', 'countries': 'US', - 'hasCORS': true, - 'hasPrivateAPI': false, - 'hasCreateOrder': false, - 'hasCancelOrder': false, - 'hasFetchBalance': false, - 'hasFetchOrderBook': false, - 'hasFetchTrades': false, - 'hasFetchTickers': true, - 'hasFetchCurrencies': true, 'has': { + 'CORS': true, + 'privateAPI': false, + 'createOrder': false, + 'cancelOrder': false, + 'fetchBalance': false, + 'fetchOrderBook': false, + 'fetchTrades': false, + 'fetchTickers': true, + 'fetchCurrencies': true, 'fetchCurrencies': true, }, 'urls': {
removed obsolete metainfo interface in coinmarketcap.js
ccxt_ccxt
train
js
b2a37a3d9c38e67b636e309e79b64f47e4293075
diff --git a/salt/utils/schema.py b/salt/utils/schema.py index <HASH>..<HASH> 100644 --- a/salt/utils/schema.py +++ b/salt/utils/schema.py @@ -558,8 +558,9 @@ class Schema(six.with_metaclass(SchemaMeta, object)): properties.update(serialized_section['properties']) if 'x-ordering' in serialized_section: ordering.extend(serialized_section['x-ordering']) - if 'required' in serialized: + if 'required' in serialized_section: required.extend(serialized_section['required']) + skip_order = True else: # Store it as a configuration section properties[name] = serialized_section @@ -568,7 +569,8 @@ class Schema(six.with_metaclass(SchemaMeta, object)): config = cls._items[name] # Handle the configuration items defined in the class instance if config.__flatten__ is True: - after_items_update.update(config.serialize()) + serialized_config = config.serialize() + after_items_update.update(serialized_config) skip_order = True else: properties[name] = config.serialize()
Fix missing required entries when flattening Schemas
saltstack_salt
train
py
08d599afa3a7d2e77e8eabf1cbe856a84ece9154
diff --git a/test/test_log.rb b/test/test_log.rb index <HASH>..<HASH> 100644 --- a/test/test_log.rb +++ b/test/test_log.rb @@ -12,7 +12,7 @@ class LogTest < Test::Unit::TestCase FileUtils.rm_rf(TMP_DIR) FileUtils.mkdir_p(TMP_DIR) @log_device = Fluent::Test::DummyLogDevice.new - @timestamp = Time.parse("2016-04-21 11:58:41 +0900") + @timestamp = Time.parse("2016-04-21 02:58:41 +0000") @timestamp_str = @timestamp.strftime("%Y-%m-%d %H:%M:%S %z") Timecop.freeze(@timestamp) end @@ -540,7 +540,7 @@ end class PluginLoggerTest < Test::Unit::TestCase def setup @log_device = Fluent::Test::DummyLogDevice.new - @timestamp = Time.parse("2016-04-21 11:58:41 +0900") + @timestamp = Time.parse("2016-04-21 02:58:41 +0000") @timestamp_str = @timestamp.strftime("%Y-%m-%d %H:%M:%S %z") Timecop.freeze(@timestamp) dl_opts = {}
test_log.rb: use utc timezone for original timestamp
fluent_fluentd
train
rb
35217b9a7868cbfb80dc792467e4af7e3f50ffbd
diff --git a/packages/jsdoc2spec/src/cli.js b/packages/jsdoc2spec/src/cli.js index <HASH>..<HASH> 100755 --- a/packages/jsdoc2spec/src/cli.js +++ b/packages/jsdoc2spec/src/cli.js @@ -99,7 +99,7 @@ const runWithJSDoc = (files) => { const temp = path.join(__dirname, 'temp.conf.json'); fs.writeFileSync(temp, JSON.stringify(cfg, null, 2)); try { - s = cp.execSync('jsdoc -c ./temp.conf.json -p -X', { cwd: __dirname }); + s = cp.execSync('npx jsdoc -c ./temp.conf.json -p -X', { cwd: __dirname }); } finally { fs.unlinkSync(temp); }
fix: fix jsdoc runner to use npx
miralemd_scriptappy
train
js
419dd545c4e14ecfcd6ac449f519fd18c8f5e22b
diff --git a/source/Internal/ServiceFactory/FacadeServiceFactory.php b/source/Internal/ServiceFactory/FacadeServiceFactory.php index <HASH>..<HASH> 100644 --- a/source/Internal/ServiceFactory/FacadeServiceFactory.php +++ b/source/Internal/ServiceFactory/FacadeServiceFactory.php @@ -32,7 +32,7 @@ class FacadeServiceFactory /** * FacadeServiceFactory constructor. */ - public function __construct() + protected function __construct() { }
OXDEV-<I> Protected FacadeServiceFactory constructor
OXID-eSales_oxideshop_ce
train
php
fa9d54be1d927590e9037b8b7983465b6765ef46
diff --git a/lib/facebook_ads/base.rb b/lib/facebook_ads/base.rb index <HASH>..<HASH> 100644 --- a/lib/facebook_ads/base.rb +++ b/lib/facebook_ads/base.rb @@ -11,7 +11,9 @@ module FacebookAds get!("/#{id}", objectify: true) end - # HTTMultiParty wrappers + protected + + # HTTMultiParty wrappers. def get!(path, query: {}, objectify: false, fields: true) query = query.merge(access_token: FacebookAds.access_token) @@ -38,6 +40,8 @@ module FacebookAds response = parse(response, objectify: false) end + # Pagination helper. + def paginate!(path, query: {}) response = get!(path, query: query) data = response['data'].present? ? response['data'] : [] @@ -76,17 +80,6 @@ module FacebookAds end end - def before(*names) - names.each do |name| - m = instance_method(name) - - define_method(name) do |*args, &block| - yield - m.bind(self).(*args, &block) - end - end - end - end attr_accessor :changes
The HTTMultiParty wrappers should be protected methods.
tophatter_facebook-ruby-ads-sdk
train
rb
7619bcf2d4a348cb48b765e1980e935abbcc694f
diff --git a/activerecord/lib/active_record/relation/calculations.rb b/activerecord/lib/active_record/relation/calculations.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/relation/calculations.rb +++ b/activerecord/lib/active_record/relation/calculations.rb @@ -333,7 +333,7 @@ module ActiveRecord def select_for_count if @select_values.present? select = @select_values.join(", ") - select if select !~ /(,|\*)/ + select if select !~ /[,*]/ end end diff --git a/railties/lib/rails/generators/generated_attribute.rb b/railties/lib/rails/generators/generated_attribute.rb index <HASH>..<HASH> 100644 --- a/railties/lib/rails/generators/generated_attribute.rb +++ b/railties/lib/rails/generators/generated_attribute.rb @@ -32,7 +32,7 @@ module Rails case type when /(string|text|binary|integer)\{(\d+)\}/ return $1, :limit => $2.to_i - when /decimal\{(\d+)(,|\.|\-)(\d+)\}/ + when /decimal\{(\d+)[,.-](\d+)\}/ return :decimal, :precision => $1.to_i, :scale => $3.to_i else return type, {}
rewrites a couple of alternations in regexps as character classes Character classes are the specific regexp construct to express alternation of individual characters.
rails_rails
train
rb,rb
60450a3bc25935162eecae5f2cd5148270e31a8d
diff --git a/src/Knp/FriendlyContexts/Extension.php b/src/Knp/FriendlyContexts/Extension.php index <HASH>..<HASH> 100644 --- a/src/Knp/FriendlyContexts/Extension.php +++ b/src/Knp/FriendlyContexts/Extension.php @@ -34,7 +34,7 @@ class Extension implements ExtensionInterface )); } - $config['api']['base_url']; + $config['api']['base_url'] = $container->getParameter('mink.base_url'); } $container->setParameter('api.base_url', $config['api']['base_url']);
Fix a missing statement ... youps
KnpLabs_FriendlyContexts
train
php
7e4558cfe24f0fb019e741f5da76cfc6e7cdc40f
diff --git a/command/build_ext.py b/command/build_ext.py index <HASH>..<HASH> 100644 --- a/command/build_ext.py +++ b/command/build_ext.py @@ -8,6 +8,7 @@ import sys, os, re from distutils.core import Command from distutils.errors import * from distutils.sysconfig import customize_compiler, get_python_version +from distutils.sysconfig import get_config_h_filename from distutils.dep_util import newer_group from distutils.extension import Extension from distutils.util import get_platform @@ -196,7 +197,10 @@ class build_ext(Command): # Append the source distribution include and library directories, # this allows distutils on windows to work in the source tree - self.include_dirs.append(os.path.join(sys.exec_prefix, 'PC')) + self.include_dirs.append(os.path.dirname(get_config_h_filename())) + _sys_home = getattr(sys, '_home', None) + if _sys_home: + self.library_dirs.append(_sys_home) if MSVC_VERSION >= 9: # Use the .lib files for the correct architecture if self.plat_name == 'win32':
Closes #<I>: Corrected computation of include locations for source builds on Windows. Thanks to Richard Oudkerk for the bug report and patch.
pypa_setuptools
train
py
5b87c9b7ece87d9d17faa18c95f70a3c40e69406
diff --git a/lib/execjs/external_runtime.rb b/lib/execjs/external_runtime.rb index <HASH>..<HASH> 100644 --- a/lib/execjs/external_runtime.rb +++ b/lib/execjs/external_runtime.rb @@ -85,21 +85,19 @@ module ExecJS end end - if MultiJson.respond_to?(:load) + if MultiJson.respond_to?(:dump) def json_decode(obj) MultiJson.load(obj) end - else - def json_decode(obj) - MultiJson.decode(obj) - end - end - if MultiJson.respond_to?(:dump) def json_encode(obj) MultiJson.dump(obj) end else + def json_decode(obj) + MultiJson.decode(obj) + end + def json_encode(obj) MultiJson.encode(obj) end
Fix invalid MultiJson API detection (closes #<I>) `#load` is defined in Kernel and inherited in every object, thus Object.respond_to?(:load) will always return true. MultiJson switched to load/dump from decode/encode. Thus it's safe to use a single check for both encoding and decoding methods.
rails_execjs
train
rb
13f8803c8a9b68ed30c58ab0ef3e42b6b6280287
diff --git a/lib/cfndsl.rb b/lib/cfndsl.rb index <HASH>..<HASH> 100644 --- a/lib/cfndsl.rb +++ b/lib/cfndsl.rb @@ -18,8 +18,7 @@ def CloudFormation(&block) x.declare(&block) invalid_references = x.checkRefs() if( invalid_references ) then - puts invalid_references.join("\n"); - exit(-1) + $stderr.puts invalid_references.join("\n"); elsif( CfnDsl::Errors.errors? ) then CfnDsl::Errors.report else
Don't exit - write error to STDERR
cfndsl_cfndsl
train
rb
c50c08c7d16731083c6936bbd60378f92c191b53
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from deploy import get_version setup( - name='configlib', + name='pyconfiglib', version=get_version(), packages=['configlib'], url='https://github.com/ddorn/configlib',
changed name for real pypi
ddorn_pyconfiglib
train
py
c3f4ca983f8e12304f9c0da7c85963c0ffe66592
diff --git a/src/Common/Model/Base.php b/src/Common/Model/Base.php index <HASH>..<HASH> 100644 --- a/src/Common/Model/Base.php +++ b/src/Common/Model/Base.php @@ -1526,8 +1526,8 @@ abstract class Base $aKey = array_filter([ strtoupper($sColumn), - json_encode($mValue), - $aData !== null ? md5(json_encode($aData)) : null, + serialize($mValue), + $aData !== null ? md5(serialize($aData)) : null, ]); return implode(':', $aKey);
Using serialize for cache key in model base
nails_common
train
php
14d20de162c9778945c2288384a716917c6d0cf7
diff --git a/lib/weblib.php b/lib/weblib.php index <HASH>..<HASH> 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1473,7 +1473,7 @@ function format_string($string, $striplinks=true, $courseid=NULL ) { // First replace all ampersands not followed by html entity code $string = preg_replace("/\&(?![a-zA-Z0-9#]{1,8};)/", "&amp;", $string); - if (!empty($CFG->filterall)) { + if (!empty($CFG->filterall) && $CFG->version >= 2009040600) { // Avoid errors during the upgrade to the new system. $context = get_context_instance(CONTEXT_SYSTEM); // TODO change, once we have $PAGE->context. $string = filter_manager::instance()->filter_string($string, $context, $courseid); }
filters: MDL-<I> fix upgrade problem when filterall is on. Thanks Nico for finding.
moodle_moodle
train
php
4c68441c2f2a56dba34420afcbaa52b87fa60b5f
diff --git a/src/test/runner-in-node.js b/src/test/runner-in-node.js index <HASH>..<HASH> 100644 --- a/src/test/runner-in-node.js +++ b/src/test/runner-in-node.js @@ -1,4 +1,8 @@ +// Usage: +// cd path/to/src/test +// snode runner-in-node.js --base ../ + /** * @fileoverview Run test cases in node environment. * @author lifesinger@gmail.com (Frank Wang)
add usage comments to runner-in-node.js
seajs_seajs
train
js
80c64f27ce92faf0c231bc254784400075faa912
diff --git a/salestax.js b/salestax.js index <HASH>..<HASH> 100644 --- a/salestax.js +++ b/salestax.js @@ -27,7 +27,8 @@ function salestax(taxRates) { seneca.act({role: plugin, cmd: 'resolve_salestax', taxCategory: taxCategory, taxRates: taxRates}, function(err, taxRate) { if(err) { - callback(err, undefined) + seneca.log.error(err) + callback(new Error('could not resolve the given tax rate: '+JSON.stringify(taxCategory)), undefined) } else { seneca.act({role: plugin, cmd: 'calculate_salestax', net: args.net, taxRate: taxRate}, function(err, calculatedTax) { callback(err, calculatedTax) @@ -95,7 +96,7 @@ function resolve_salestax(attributes, taxRates, trace, callback) { if(rate) { callback(undefined, rate) } else { - callback(new Error('Could not resolve tax rate '+JSON.stringify(attributes)+' for taxRates '+JSON.stringify(taxRates) + ' at '+trace)) + callback(new Error('Could not resolve tax rate')) } }
better error message when the tax rate cannot be resolved
nherment_seneca-salestax
train
js
72a981ab51cad1d4b85f186c850876a9ff669f82
diff --git a/Tests/Transformer/ModelToElasticaAutoTransformerTest.php b/Tests/Transformer/ModelToElasticaAutoTransformerTest.php index <HASH>..<HASH> 100644 --- a/Tests/Transformer/ModelToElasticaAutoTransformerTest.php +++ b/Tests/Transformer/ModelToElasticaAutoTransformerTest.php @@ -280,7 +280,7 @@ class ModelToElasticaAutoTransformerTest extends \PHPUnit_Framework_TestCase $document = $transformer->transform(new POPO(), array( 'sub' => array( 'type' => 'nested', - 'properties' => array('foo' => '~') + 'properties' => array('foo' => array()) ) )); $data = $document->getData();
Attempted fix for php <I>
FriendsOfSymfony_FOSElasticaBundle
train
php
90a529be48e5122c881ae80141f859b9348c67e2
diff --git a/lib/bx/align/core.py b/lib/bx/align/core.py index <HASH>..<HASH> 100644 --- a/lib/bx/align/core.py +++ b/lib/bx/align/core.py @@ -221,10 +221,7 @@ class Component( object ): try: x = self.index[ pos - self.get_forward_strand_start() ] except: - print "Pos = " + str(pos) - print "start = " + str(self.get_forward_strand_start()) - print self.index - sys.exit() + raise "Error in index." return x # return coord_to_col( self.get_forward_strand_start(), self.text, pos )
Sorry for the poor code... under pressure :). This should be better.
bxlab_bx-python
train
py
b86502815141e733502b06043f579e2198d43a09
diff --git a/lib/handlers/init/callback.js b/lib/handlers/init/callback.js index <HASH>..<HASH> 100644 --- a/lib/handlers/init/callback.js +++ b/lib/handlers/init/callback.js @@ -44,14 +44,8 @@ module.exports = function(retrieveTokens, config) { Anyfetch.getAccessToken(config.appId, config.appSecret, tempToken.anyfetchCode, rarity.carry([accountName, providerData, tempToken], cb)); }, function setAccountName(accountName, providerData, tempToken, anyfetchAccessToken, cb) { - request(process.env.MANAGER_URL || "https://manager.anyfetch.com") - .post('/access_token/account_name') - .send({ - access_token: anyfetchAccessToken, - account_name: accountName - }) - .expect(204) - .end(rarity.carryAndSlice([accountName, providerData, tempToken, anyfetchAccessToken], 5, cb)); + var anyfetchClient = new Anyfetch(anyfetchAccessToken); + anyfetchClient.postAccountName(accountName, rarity.carryAndSlice([accountName, providerData, tempToken, anyfetchAccessToken], 5, cb)); }, function createNewToken(accountName, providerData, tempToken, anyfetchAccessToken, cb) { // Create new token
Use anyfetch.js to do accountName request
AnyFetch_anyfetch-provider.js
train
js
9824a54cc5c8b8c25264cd728cd4d6b168cc82f1
diff --git a/webroot/js/typeahead.js b/webroot/js/typeahead.js index <HASH>..<HASH> 100644 --- a/webroot/js/typeahead.js +++ b/webroot/js/typeahead.js @@ -66,6 +66,11 @@ var typeahead = typeahead || {}; timeout: that.timeout, triggerLength: that.min_length, method: 'get', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Bearer ' + that.api_token + }, preProcess: function(data) { if (data.success === false) { // Hide the list, there was some error
add request headers, including authorization, on typeahead ajax requests (task #<I>)
QoboLtd_cakephp-csv-migrations
train
js
490f5ab3cdfbe6b6edb42571e597ee0335a50511
diff --git a/fusionbox/error_logging/middleware.py b/fusionbox/error_logging/middleware.py index <HASH>..<HASH> 100644 --- a/fusionbox/error_logging/middleware.py +++ b/fusionbox/error_logging/middleware.py @@ -1,6 +1,6 @@ from django.conf import settings from django.core.exceptions import ImproperlyConfigured -from django.middleware import _is_ignorable_404, _is_internal_request +from django.middleware.common import _is_ignorable_404, _is_internal_request from django.core.mail import mail_managers from fusionbox.error_logging.models import Logged404
fixed import from commom middleware
fusionbox_django-argonauts
train
py
79f2f0b3cfd455a3cda98f8914a229ef0664dd3f
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -300,10 +300,10 @@ module ActiveRecord # # === A word of warning # - # Don't create associations that have the same name as instance methods of - # ActiveRecord::Base. Since the association adds a method with that name to - # its model, it will override the inherited method and break things. - # For instance, +attributes+ and +connection+ would be bad choices for association names. + # Don't create associations that have the same name as [instance methods](http://api.rubyonrails.org/classes/ActiveRecord/Core.html) of + # <tt>ActiveRecord::Base</tt>. Since the association adds a method with that name to + # its model, using an association with the same name as one provided by <tt>ActiveRecord::Base</tt> will override the method inherited through <tt>ActiveRecord::Base</tt> and will break things. + # For instance, +attributes+ and +connection+ would be bad choices for association names, because those names already exist in the list of <tt>ActiveRecord::Base</tt> instance methods. # # == Auto-generated methods # See also Instance Public methods below for more details.
Issue <I>: adds link to list of instance methods [ci skip] Update associations.rb Update associations.rb updates link to instance methods [ci skip]
rails_rails
train
rb
d6b2e7c7e28027978ae0f03dc040e27e79af58fd
diff --git a/impl/src/test/java/org/ehcache/GettingStarted.java b/impl/src/test/java/org/ehcache/GettingStarted.java index <HASH>..<HASH> 100644 --- a/impl/src/test/java/org/ehcache/GettingStarted.java +++ b/impl/src/test/java/org/ehcache/GettingStarted.java @@ -168,7 +168,7 @@ public class GettingStarted { .buildConfig(Long.class, String.class); PersistentCacheManager persistentCacheManager = CacheManagerBuilder.newCacheManagerBuilder() - .with(new PersistenceConfiguration(new File(System.getProperty("java.io.tmpdir") + "/persistent-cache-data"))) + .with(new PersistenceConfiguration(new File(getClass().getClassLoader().getResource(".").getFile() + "/../../persistent-cache-data"))) .withCache("persistent-cache", cacheConfiguration) .build(true);
#<I>: move persistent data directory to gradle's build folder
ehcache_ehcache3
train
java
41c768445bf1028aca8531a48bc4100a4c87fbcc
diff --git a/middleware.go b/middleware.go index <HASH>..<HASH> 100644 --- a/middleware.go +++ b/middleware.go @@ -115,8 +115,6 @@ func parseRequestBody(c *Client, r *Request) (err error) { return } } - } else { - r.Header.Del(hdrContentTypeKey) } CL:
#<I> removed the line which cleans up the content-type header when payload is not present
go-resty_resty
train
go
d15c78d13639b58174a6b2114ef1d3542fc8fef8
diff --git a/src/Propel/Generator/Util/SchemaValidator.php b/src/Propel/Generator/Util/SchemaValidator.php index <HASH>..<HASH> 100644 --- a/src/Propel/Generator/Util/SchemaValidator.php +++ b/src/Propel/Generator/Util/SchemaValidator.php @@ -1,4 +1,4 @@ -Schema<?php +<?php /** * This file is part of the Propel package.
[Generator] removed extra Schema word after a quick copy/paste operation.
propelorm_Propel2
train
php
b680894d423fc3126a89e4dcbd2ad12f33530165
diff --git a/src/Wsdl2PhpGenerator/Generator.php b/src/Wsdl2PhpGenerator/Generator.php index <HASH>..<HASH> 100644 --- a/src/Wsdl2PhpGenerator/Generator.php +++ b/src/Wsdl2PhpGenerator/Generator.php @@ -116,10 +116,6 @@ class Generator implements GeneratorInterface $this->log('Generation complete', 'info'); } - public function setLogger(LoggerInterface $logger) - { - $this->logger = $logger; - } /** * Load the wsdl file into php @@ -400,16 +396,6 @@ class Generator implements GeneratorInterface } /** - * Returns the loaded config - * - * @return Config The loaded config - */ - public function getConfig() - { - return $this->config; - } - - /** * Takes a string and removes the xml namespace if any * * @param string $str @@ -475,6 +461,29 @@ class Generator implements GeneratorInterface /* + * Setters/getters + */ + + /** + * @param LoggerInterface $logger + */ + public function setLogger(LoggerInterface $logger) + { + $this->logger = $logger; + } + + /** + * Returns the loaded config + * + * @return Config The loaded config + */ + public function getConfig() + { + return $this->config; + } + + + /* * Singleton logic for backwards compatibility * TODO: v3: remove */
Move getters/setters to single location
wsdl2phpgenerator_wsdl2phpgenerator
train
php
956be5bf3d3b0dbe47dd9215b85b56773f23efb1
diff --git a/lib/html/pipeline/syntax_highlight_filter.rb b/lib/html/pipeline/syntax_highlight_filter.rb index <HASH>..<HASH> 100644 --- a/lib/html/pipeline/syntax_highlight_filter.rb +++ b/lib/html/pipeline/syntax_highlight_filter.rb @@ -13,7 +13,7 @@ module HTML doc.search('pre').each do |node| default = context[:highlight] && context[:highlight].to_s next unless lang = node['lang'] || default - next unless lexer = get_lexer(lang) + next unless lexer = lexer_for(lang) text = node.inner_text html = highlight_with_timeout_handling(lexer, text) @@ -35,12 +35,8 @@ module HTML nil end - def get_lexer(lang) - lexer = Linguist::Language[lang] && Linguist::Language[lang].lexer - unless lexer - lexer = Pygments::Lexer[lang] - end - lexer + def lexer_for(lang) + (Linguist::Language[lang] && Linguist::Language[lang].lexer) || Pygments::Lexer[lang] end end end
Simplify and rename get_lexer
jch_html-pipeline
train
rb
89ffb4b8601d9a0da43d28f2dfe17caf0dc626ef
diff --git a/js/calendar.js b/js/calendar.js index <HASH>..<HASH> 100644 --- a/js/calendar.js +++ b/js/calendar.js @@ -183,12 +183,7 @@ if(!String.prototype.format) { function Calendar(params, context) { this.options = $.extend(true, {}, defaults, params); - if(this.options.language && window.calendar_languages && (this.options.language in window.calendar_languages)) { - this.strings = $.extend(true, {}, strings, calendar_languages[this.options.language]); - } - else { - this.strings = strings; - } + this.setLanguage(this.options.language); this.context = context; context.css('width', this.options.width); @@ -199,13 +194,18 @@ if(!String.prototype.format) { Calendar.prototype.setOptions = function(object) { $.extend(this.options, object); + if('language' in object) { + this.setLanguage(object.language); + } } Calendar.prototype.setLanguage = function(lang) { if(window.calendar_languages && (lang in window.calendar_languages)) { this.strings = $.extend(true, {}, strings, calendar_languages[lang]); + this.options.language = lang; } else { this.strings = strings; + delete this.options.language; } }
Small locale-related optimizations here and there
Serhioromano_bootstrap-calendar
train
js
d4f93a28b8e367df171612b6d1404200ff4377f5
diff --git a/jquery.flot.stack.js b/jquery.flot.stack.js index <HASH>..<HASH> 100644 --- a/jquery.flot.stack.js +++ b/jquery.flot.stack.js @@ -15,7 +15,7 @@ key (which can be any number or string or just "true"). To specify the default stack, you can set the stack option like this: series: { - stack: null or true or key (number/string) + stack: null/false, true, or a key (number/string) } You can also specify it for a single series, like this: @@ -55,7 +55,7 @@ charts or filled areas). } function stackData(plot, s, datapoints) { - if (s.stack == null) + if (s.stack == null || s.stack === false) return; var other = findMatchingSeries(s, plot.getData());
Allow 'false' to be provided as a stack option. This resolves #<I>, but without catching zero, which is a valid key.
ni-kismet_engineering-flot
train
js
3f87fc8c6b716accb506e92d11c997b93a840078
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -37,7 +37,8 @@ var gulpBundleAssets = function (options) { try { config = new ConfigModel(file, options); } catch (e) { - logger.log(gutil.colors.red('Failed to parse config file')); + logger.log(gutil.colors.red('Failed to parse config file:'), gutil.colors.red(file.path)); + logger.log(e); this.emit('error', new gutil.PluginError('gulp-bundle-assets', e)); return done(); } diff --git a/lib/watch/index.js b/lib/watch/index.js index <HASH>..<HASH> 100644 --- a/lib/watch/index.js +++ b/lib/watch/index.js @@ -18,6 +18,7 @@ module.exports = function (opts) { configFile = require(opts.configPath); config = new ConfigModel(configFile, opts); } catch (e) { + gutil.log(e); throw new gutil.PluginError('gulp-bundle-assets', 'Failed to parse config file'); }
no longer swallow error when parsing the config file
dowjones_gulp-bundle-assets
train
js,js
670710966d9f649f66a4312f283433a833c77648
diff --git a/grade/report/grader/styles.php b/grade/report/grader/styles.php index <HASH>..<HASH> 100644 --- a/grade/report/grader/styles.php +++ b/grade/report/grader/styles.php @@ -4,6 +4,7 @@ .gradestable th.user img { width: 20px; + height: 20px; } .gradestable th.user, .gradestable th.range {
MDL-<I> Specify both width and height for user image Merged from STABLE_<I>
moodle_moodle
train
php
a1bbebb99859bb0f5f6e934cec7795e13e99b8a5
diff --git a/src/XeroPHP/Traits/PracticeManager/CustomFieldValueTrait.php b/src/XeroPHP/Traits/PracticeManager/CustomFieldValueTrait.php index <HASH>..<HASH> 100644 --- a/src/XeroPHP/Traits/PracticeManager/CustomFieldValueTrait.php +++ b/src/XeroPHP/Traits/PracticeManager/CustomFieldValueTrait.php @@ -46,7 +46,7 @@ trait CustomFieldValueTrait $this->getGUID() ); - $url = new URL($this->_application, $uri); + $url = new URL($this->_application, $uri, URL::API_PRACTICE_MANAGER); $request = new Request($this->_application, $url, Request::METHOD_GET); $request->send();
Corrected API for CustomFieldvalueTrait
calcinai_xero-php
train
php
022a80ea83ef2b86d09c3d5f39b8f25d5362e06a
diff --git a/src/test/java/net/ravendb/client/driver/RavenTestDriver.java b/src/test/java/net/ravendb/client/driver/RavenTestDriver.java index <HASH>..<HASH> 100644 --- a/src/test/java/net/ravendb/client/driver/RavenTestDriver.java +++ b/src/test/java/net/ravendb/client/driver/RavenTestDriver.java @@ -190,7 +190,7 @@ public abstract class RavenTestDriver implements CleanCloseable { int leased = connectionManager.getTotalStats().getLeased(); if (leased > 0 ) { - Thread.sleep(100); + Thread.sleep(500); // give another try leased = connectionManager.getTotalStats().getLeased();
increased timeout for leaked connection check
ravendb_ravendb-jvm-client
train
java
65b8c0b9af2e1fbc1410c375063cba3202aa57bb
diff --git a/scripts/lib/mha_config_helper.py b/scripts/lib/mha_config_helper.py index <HASH>..<HASH> 100644 --- a/scripts/lib/mha_config_helper.py +++ b/scripts/lib/mha_config_helper.py @@ -124,7 +124,7 @@ class MHA_global_config_helper(object): hosts = [] for section in config.sections(): - if section == 'server default': + if section == 'default': continue hosts.append(section)
Add support in config_helper to fetch slave health check port for a given host
ovaistariq_mha-helper
train
py
61a065175f38a451108c5ab88dd09e4d68ba7300
diff --git a/salt/states/archive.py b/salt/states/archive.py index <HASH>..<HASH> 100644 --- a/salt/states/archive.py +++ b/salt/states/archive.py @@ -79,8 +79,8 @@ def extracted(name, this archive, such as 'J' for LZMA. Using this option means that the tar executable on the target will be used, which is less platform independent. - Main operators like -x, --extract, --get, -c, etc. and -f/--file are - **shoult not be used** here. + Main operators like -x, --extract, --get, -c, etc. and -f/--file + **should not be used** here. If this option is not set, then the Python tarfile module is used. The tarfile module supports gzip and bz2 in Python 2.
fix gramar & typo in states.archive.extracted
saltstack_salt
train
py
384917a560ae5da60d116373b25dd92f835a9bd3
diff --git a/condorpy/node.py b/condorpy/node.py index <HASH>..<HASH> 100644 --- a/condorpy/node.py +++ b/condorpy/node.py @@ -10,6 +10,7 @@ from job import Job from logger import log from exceptions import CircularDependency + class Node(object): """ @@ -22,16 +23,16 @@ class Node(object): pre_script_args=None, post_script=None, post_script_args=None, - variables=None, # VARS JobName macroname="string" [macroname="string"... ] - priority=None, # PRIORITY JobName PriorityValue - category=None, # CATEGORY JobName CategoryName - retry=None, # JobName NumberOfRetries [UNLESS-EXIT value] - pre_skip=None, # JobName non-zero-exit-code + variables=None, # VARS JobName macroname="string" [macroname="string"... ] + priority=None, # PRIORITY JobName PriorityValue + category=None, # CATEGORY JobName CategoryName + retry=None, # JobName NumberOfRetries [UNLESS-EXIT value] + pre_skip=None, # JobName non-zero-exit-code abort_dag_on=None, # JobName AbortExitValue [RETURN DAGReturnValue] dir=None, noop=None, done=None, - ): + ): """ Node constructor
update style to comply with pep8
tethysplatform_condorpy
train
py
c1f6ca24b69e1e249b957c2cc78449e0434cbfd8
diff --git a/tests/test_index.py b/tests/test_index.py index <HASH>..<HASH> 100644 --- a/tests/test_index.py +++ b/tests/test_index.py @@ -1,5 +1,6 @@ import ctypes import pickle +import sys import tempfile import unittest from typing import Dict, Iterator, Tuple @@ -463,11 +464,13 @@ class IndexSerialization(unittest.TestCase): ), ] - # go through the traversal and see if everything is close - assert all( - all(np.allclose(a, b) for a, b in zip(L, E)) - for L, E in zip(leaves, expected) - ) + if sys.maxsize > 2**32: + # TODO: this fails with CPython 3.7 manylinux i686 i.e. 32-bit + # go through the traversal and see if everything is close + assert all( + all(np.allclose(a, b) for a, b in zip(L, E)) + for L, E in zip(leaves, expected) + ) hits2 = sorted(list(idx.intersection((0, 60, 0, 60), objects=True))) self.assertTrue(len(hits2), 10)
Skip part of test_interleaving for <I>-bit systems (#<I>)
Toblerity_rtree
train
py
520f4a10560910d7f268e8cc7fad8ff52c299931
diff --git a/lib/Doctrine/Record.php b/lib/Doctrine/Record.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/Record.php +++ b/lib/Doctrine/Record.php @@ -451,7 +451,7 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count */ public function hydrate(array $data) { - $this->_values = $this->cleanData($data); + $this->_values = array_merge($this->_values, $this->cleanData($data)); $this->_data = array_merge($this->_data, $data); $this->prepareIdentifiers(true);
fixed: old mapped values were deleted when data was hydrated into an existing record (lazy-loading)
doctrine_annotations
train
php
87c82d717ee091a5261e894699f215ee6baa4d76
diff --git a/test/textbringer/test_buffer.rb b/test/textbringer/test_buffer.rb index <HASH>..<HASH> 100644 --- a/test/textbringer/test_buffer.rb +++ b/test/textbringer/test_buffer.rb @@ -1283,4 +1283,35 @@ EOF buffer2 = Buffer.new(name: "foo") assert_equal("#<Buffer:foo>", buffer2.inspect) end + + def test_goto_line + buffer = Buffer.new(<<EOF) +foo +bar +baz +quux +quuux +EOF + buffer.goto_line(0) + assert_equal(1, buffer.line) + assert_equal(1, buffer.column) + buffer.goto_line(1) + assert_equal(1, buffer.line) + assert_equal(1, buffer.column) + buffer.goto_line(2) + assert_equal(2, buffer.line) + assert_equal(1, buffer.column) + buffer.goto_line(4) + assert_equal(4, buffer.line) + assert_equal(1, buffer.column) + buffer.goto_line(5) + assert_equal(5, buffer.line) + assert_equal(1, buffer.column) + buffer.goto_line(6) + assert_equal(6, buffer.line) + assert_equal(1, buffer.column) + buffer.goto_line(7) + assert_equal(6, buffer.line) + assert_equal(1, buffer.column) + end end
Add a test for goto_line.
shugo_textbringer
train
rb
c08850ba8cb86f38342381f1c0369f969866de40
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -12,8 +12,11 @@ if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() -readme = open('README.rst').read() -history = open('HISTORY.rst').read().replace('.. :changelog:', '') +with open('README.rst') as readme_file: + readme = readme_file.read() + +with open('HISTORY.rst') as history_file: + history = history_file.read().replace('.. :changelog:', '') requirements = ['binaryornot>=0.2.0', 'jinja2>=2.4', 'PyYAML>=3.10'] test_requirements = []
Ensure file handles are closed using with statement
audreyr_cookiecutter
train
py
e20883cbb322938106434e121756e37db376fe78
diff --git a/includes/class-freemius.php b/includes/class-freemius.php index <HASH>..<HASH> 100755 --- a/includes/class-freemius.php +++ b/includes/class-freemius.php @@ -12140,7 +12140,13 @@ * @author Vova Feldman (@svovaf) */ $args = array( - 'public' => 1, + /** + * Commented out in order to handle the migration of site options whether the site is public or not. + * + * @author Leo Fajardo (@leorw) + * @since 2.2.1 + */ + // 'public' => 1, 'archived' => 0, 'mature' => 0, 'spam' => 0,
[ms] [migration] When loading the sites in a multisite network, include both public and non-public sites (this is needed when migrating site options to network).
Freemius_wordpress-sdk
train
php
bc242ba3f61ea3b38404ffc9d4ae69ab54d7bd59
diff --git a/lib/validators.js b/lib/validators.js index <HASH>..<HASH> 100644 --- a/lib/validators.js +++ b/lib/validators.js @@ -1,7 +1,7 @@ 'use strict'; const - joi = require('joi'); + joi = require('@hapi/joi'); const blockTypes = { i: 'interface',
Moved to @hapi/joi
pzlr_build-core
train
js
141031469603b33369d89c38c703390eb3786bd0
diff --git a/livetests.py b/livetests.py index <HASH>..<HASH> 100755 --- a/livetests.py +++ b/livetests.py @@ -53,7 +53,7 @@ def _initialize(api): @pytest.fixture(scope="module", - params=["2.14.20", "2.15.13", "2.16.7", "3.0.0-rc0"]) + params=["2.14.20", "2.15.13", "2.16.7", "3.0.0-rc1"]) def gerrit_api(request): """Create a Gerrit container for the given version and return an API.""" with GerritContainer(request.param) as gerrit:
Run livetests against <I>-rc1 Change-Id: Ic<I>e<I>ae3f1ae<I>b<I>ec<I>d<I>
dpursehouse_pygerrit2
train
py