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
fb6a19375bbee1eb2d3f0873b9b906057c5362ea
diff --git a/src/frontend/org/voltdb/RealVoltDB.java b/src/frontend/org/voltdb/RealVoltDB.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/RealVoltDB.java +++ b/src/frontend/org/voltdb/RealVoltDB.java @@ -902,6 +902,13 @@ public class RealVoltDB implements VoltDBInterface, RestoreAgent.Callback, Mailb hostLog.warn("Running without redundancy (k=0) is not recommended for production use."); } + // warn if cluster is partitionable, but partition detection is off + if ((m_catalogContext.cluster.getNetworkpartition() == false) && + (clusterConfig.getReplicationFactor() > 0)) { + hostLog.warn("Running a redundant (k-safe) cluster with network partition detection disabled is not recommended for production use."); + hostLog.warn("With partition detection disabled, data may be lost or corrupted by certain classes of network failures."); + } + assert(m_clientInterfaces.size() > 0); ClientInterface ci = m_clientInterfaces.get(0); ci.initializeSnapshotDaemon(m_messenger.getZK(), m_globalServiceElector);
ENG-<I>: Warning if NPD is disabled.
VoltDB_voltdb
train
java
b66807e1d9242f04125215e4e07608d3cf6807b3
diff --git a/spec/factory_spec.js b/spec/factory_spec.js index <HASH>..<HASH> 100644 --- a/spec/factory_spec.js +++ b/spec/factory_spec.js @@ -1,5 +1,5 @@ describe('Factory#define', function() { - it('stores the definition on the factory name', function() { + beforeEach(function() { dynamic_function = function() { return "dynamic"; } @@ -12,8 +12,11 @@ describe('Factory#define', function() { name: 'Test Model', real: false, dynamic: dynamic_function, - called: callback_function}) + called: callback_function + }) + }) + it('stores the definition on the factory name', function() { expect(Factory.patterns.test).toEqual({ class: TestModel, attributes: {
Use beforeEach in Factory#define description in prep for inheritance
agoragames_factory-worker
train
js
1aa3c5f50bd806706d818772c7922ebe7d1501ce
diff --git a/rebulk/__version__.py b/rebulk/__version__.py index <HASH>..<HASH> 100644 --- a/rebulk/__version__.py +++ b/rebulk/__version__.py @@ -4,4 +4,4 @@ Version module """ # pragma: no cover -__version__ = '1.0.1' +__version__ = '1.0.2.dev0'
Back to development: <I>
Toilal_rebulk
train
py
5b94a06ad97194b4b9c923dcd0bfd1794cf63465
diff --git a/html5lib/tests/test_treewalkers.py b/html5lib/tests/test_treewalkers.py index <HASH>..<HASH> 100644 --- a/html5lib/tests/test_treewalkers.py +++ b/html5lib/tests/test_treewalkers.py @@ -98,7 +98,9 @@ except ImportError: try: from genshi.core import QName, Attrs from genshi.core import START, END, TEXT, COMMENT, DOCTYPE - +except ImportError: + pass +else: def GenshiAdapter(tree): text = None for token in treewalkers.getTreeWalker("simpletree")(tree): @@ -148,8 +150,6 @@ try: {"builder": treebuilders.getTreeBuilder("simpletree"), "adapter": GenshiAdapter, "walker": treewalkers.getTreeWalker("genshi")} -except ImportError: - pass def concatenateCharacterTokens(tokens):
Move Genshi adapter/test dict out of try block.
html5lib_html5lib-python
train
py
8ed65ff1e5162bd3991d3be911e2028f0c662711
diff --git a/ghost/errors/lib/errors.js b/ghost/errors/lib/errors.js index <HASH>..<HASH> 100644 --- a/ghost/errors/lib/errors.js +++ b/ghost/errors/lib/errors.js @@ -67,6 +67,13 @@ const ghostErrors = { errorType: 'HelperWarning', hideStack: true }, options)); + }, + PasswordResetRequiredError: function PasswordResetRequiredError(options) { + GhostError.call(this, merge({ + errorType: 'PasswordResetRequiredError', + statusCode: 401, + message: 'For security, you need to create a new password. An email has been sent to you with instructions!' + }, options)); } };
✨Add PasswordResetRequiredError (#<I>) refs TryGhost/Ghost#<I> - this error was added after this package was created. Once this gets released, we will be able to remove the errors file in the core 🥳
TryGhost_Ghost
train
js
e8c83546ea909f14594612cd50f520661552aeeb
diff --git a/model/execution/implementation/KvLtiDeliveryExecutionService.php b/model/execution/implementation/KvLtiDeliveryExecutionService.php index <HASH>..<HASH> 100644 --- a/model/execution/implementation/KvLtiDeliveryExecutionService.php +++ b/model/execution/implementation/KvLtiDeliveryExecutionService.php @@ -147,9 +147,9 @@ class KvLtiDeliveryExecutionService extends AbstractLtiDeliveryExecutionService */ protected function getDeliveryExecutionLinks($userUri, $deliveryExecutionUri) { - $linksOfExecutionAndUser = $this->getPersistence()->get(self::LINKS_OF_DELIVERY_EXECUTION . $userUri . $deliveryExecutionUri); + $linksOfExecutionAndUser = $this->getPersistence()->get(self::LINKS_OF_DELIVERY_EXECUTION . $userUri . $deliveryExecutionUri . '_'); - if (is_null($linksOfExecutionAndUser)) { + if (empty($linksOfExecutionAndUser)) { $linksOfExecutionAndUser = []; } else { $linksOfExecutionAndUser = json_decode($linksOfExecutionAndUser, true);
check if delivry execution links value is not empty
oat-sa_extension-tao-ltideliveryprovider
train
php
57c5e92f4dae1fbf88be37e6599b4b2be9405eba
diff --git a/django_summernote/settings.py b/django_summernote/settings.py index <HASH>..<HASH> 100644 --- a/django_summernote/settings.py +++ b/django_summernote/settings.py @@ -71,6 +71,7 @@ SETTINGS_DEFAULT = { 'fi': 'fi-FI', 'fr': 'fr-FR', 'he': 'he-IL', + 'hr': 'hr-HR', 'hu': 'hu-HU', 'id': 'id-ID', 'it': 'it-IT',
Add language file for hr-HR
summernote_django-summernote
train
py
77416939b31b1e16907a15ffff9921ec8b631f32
diff --git a/staticfy.py b/staticfy.py index <HASH>..<HASH> 100644 --- a/staticfy.py +++ b/staticfy.py @@ -51,9 +51,17 @@ def staticfy(file_, static_endpoint='static', project_type='flask', **kwargs): 'images/staticfy.jpg', "{{ url_for('static', filename='images/staticfy.jpg') }}" ) + + ============================================================ + if the url is also prefixed with static, + e.g /static/images/image.jpg remove the prefix 'static' + ============================================================ """ + attr_prefix = elem[attr].split('/') + asset_location = '/'.join(attr_prefix[1:]) if attr_prefix[0] == 'static' else elem[attr] + res = (attr, elem[attr], frameworks[project_type] % - {'static_endpoint':static_endpoint, "asset_location": elem[attr]}) + {'static_endpoint':static_endpoint, "asset_location":asset_location}) results.append(res) file_handle.close()
Removed prefix of the url if the old link was contained 'static' in it's location an example is '/static/images/image.jpg' would be converted into 'images/images.jpg'
danidee10_Staticfy
train
py
350cc0de596a7b95867296806e4ee6de752b5aa8
diff --git a/Lib/ufo2fdk/fdkBridge.py b/Lib/ufo2fdk/fdkBridge.py index <HASH>..<HASH> 100644 --- a/Lib/ufo2fdk/fdkBridge.py +++ b/Lib/ufo2fdk/fdkBridge.py @@ -143,6 +143,11 @@ def checkOutlines(fontPath, removeOverlap=True, correctContourDirection=True): stderr, stdout = _execute(c) allStderr.append(stderr) allStdout.append(stdout) + if not removeOverlap and not correctContourDirection: + c = cmds + ["-O", fontPath] + stderr, stdout = _execute(c) + allStderr.append(stderr) + allStdout.append(stdout) return "\n".join(allStderr), "\n".join(allStdout) outlineCheckFirstLineRE = re.compile(
Patch from Ben Kiel that fixes a situation in which checkOutlines would not be run even if it was asked to. Thanks, Ben!
googlefonts_ufo2ft
train
py
4e0f5885c7582554823f7c390093ae3d15df8d87
diff --git a/lib/sensu/server/process.rb b/lib/sensu/server/process.rb index <HASH>..<HASH> 100644 --- a/lib/sensu/server/process.rb +++ b/lib/sensu/server/process.rb @@ -619,7 +619,7 @@ module Sensu end end - # Determine if a keepalive incident exists in the event registry. + # Determine if a keepalive event exists for a client. # # @param client_name [String] name of client to look up in event registry. # @return [TrueClass, FalseClass] diff --git a/spec/server/process_spec.rb b/spec/server/process_spec.rb index <HASH>..<HASH> 100644 --- a/spec/server/process_spec.rb +++ b/spec/server/process_spec.rb @@ -730,7 +730,6 @@ describe "Sensu::Server::Process" do end end - it "can be the leader and resign" do async_wrapper do @server.setup_connections do
removed mention of "incident" in yardoc, extra white space
sensu_sensu
train
rb,rb
585ade1e363450f69435ebc401d90123b9c4efb9
diff --git a/modules/core/src/lib/deck.js b/modules/core/src/lib/deck.js index <HASH>..<HASH> 100644 --- a/modules/core/src/lib/deck.js +++ b/modules/core/src/lib/deck.js @@ -371,7 +371,7 @@ export default class Deck { useDevicePixels, autoResizeDrawingBuffer, onCreateContext: opts => - gl || createGLContext(Object.assign({}, glOptions, {canvas: this.canvas, debug})), + gl || createGLContext(Object.assign({}, glOptions, opts, {canvas: this.canvas, debug})), onInitialize: this._onRendererInitialized, onRender: this._onRenderFrame, onBeforeRender: props.onBeforeRender,
Pass through opts in _createAnimationLoop's onCreateContext (#<I>)
uber_deck.gl
train
js
0b67ab54c823ccd40df4e5e5609bb0034a4fc5e4
diff --git a/gen.js/src/main/java/fr/labri/gumtree/gen/js/RhinoTreeVisitor.java b/gen.js/src/main/java/fr/labri/gumtree/gen/js/RhinoTreeVisitor.java index <HASH>..<HASH> 100644 --- a/gen.js/src/main/java/fr/labri/gumtree/gen/js/RhinoTreeVisitor.java +++ b/gen.js/src/main/java/fr/labri/gumtree/gen/js/RhinoTreeVisitor.java @@ -52,7 +52,7 @@ public class RhinoTreeVisitor implements NodeVisitor { } private Tree buildTree(AstNode node) { - Tree t = new Tree(node.getType(), Token.typeToName(node.getType())); + Tree t = new Tree(node.getType(), Tree.NO_LABEL, Token.typeToName(node.getType())); t.setPos(node.getAbsolutePosition()); t.setLength(node.getLength()); trees.put(node, t);
fixed RhinoParser for new typeLabel system
GumTreeDiff_gumtree
train
java
11d6a4a833c4e9f925507d255d5306d94e466094
diff --git a/pyrogram/__init__.py b/pyrogram/__init__.py index <HASH>..<HASH> 100644 --- a/pyrogram/__init__.py +++ b/pyrogram/__init__.py @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see <http://www.gnu.org/licenses/>. -__version__ = "2.0.30" +__version__ = "2.0.31" __license__ = "GNU Lesser General Public License v3.0 (LGPL-3.0)" __copyright__ = "Copyright (C) 2017-present Dan <https://github.com/delivrance>"
Update Pyrogram to <I>
pyrogram_pyrogram
train
py
9b485bd4e052d2330216fa679a11bb0bd6055144
diff --git a/test/is-observable-multi-set.js b/test/is-observable-multi-set.js index <HASH>..<HASH> 100644 --- a/test/is-observable-multi-set.js +++ b/test/is-observable-multi-set.js @@ -1,7 +1,7 @@ 'use strict'; var ee = require('event-emitter') - , ObservableValue = require('observable-value/value') + , ObservableValue = require('observable-value') , Set = require('es6-set') , ObservableSet = require('observable-set/create')(Set) , MultiSet = require('../'); diff --git a/test/valid-observable-multi-set.js b/test/valid-observable-multi-set.js index <HASH>..<HASH> 100644 --- a/test/valid-observable-multi-set.js +++ b/test/valid-observable-multi-set.js @@ -1,7 +1,7 @@ 'use strict'; var ee = require('event-emitter') - , ObservableValue = require('observable-value/value') + , ObservableValue = require('observable-value') , Set = require('es6-set') , ObservableSet = require('observable-set/create')(Set) , MultiSet = require('../');
Update up to changes in observable-value
medikoo_observable-multi-set
train
js,js
d69d15c5061a3e62726482c07ed3c5925292dc23
diff --git a/lib/surrounded/context/role_map.rb b/lib/surrounded/context/role_map.rb index <HASH>..<HASH> 100644 --- a/lib/surrounded/context/role_map.rb +++ b/lib/surrounded/context/role_map.rb @@ -12,9 +12,7 @@ module Surrounded @container ||= #{klass}.new end } - klass.instance_methods.reject{|m| - m.to_s =~ /object_id|__send__/ - }.each do |meth| + %w{ update each values keys }.each do |meth| role_mapper.class_eval %{ def #{meth}(*args, &block) container.send(:#{meth}, *args, &block)
limit the exposure of the underlying container for the role map
saturnflyer_surrounded
train
rb
b92e646d73ad3317cfe66afe70ebaf080771f1d6
diff --git a/lib/sup/util.rb b/lib/sup/util.rb index <HASH>..<HASH> 100644 --- a/lib/sup/util.rb +++ b/lib/sup/util.rb @@ -654,7 +654,7 @@ class Iconv begin Iconv.iconv(target + "//IGNORE", charset, text + " ").join[0 .. -2] rescue Errno::EINVAL, Iconv::InvalidEncoding, Iconv::InvalidCharacter, Iconv::IllegalSequence => e - warn "couldn't transcode text from #{charset} to #{target} (\"#{text[0 ... 20]}\"...) (got #{e.message}); using original as is" + debug "couldn't transcode text from #{charset} to #{target} (\"#{text[0 ... 20]}\"...) (got #{e.message}); using original as is" text end end
change transcode warning to a debug message Too scary for users when it's a warning, and it tends to pollute the output of sup-sync.
sup-heliotrope_sup
train
rb
3fcb7c8cac2ed2f3b27d4646d679175c405184d9
diff --git a/src/services/olHelpers.js b/src/services/olHelpers.js index <HASH>..<HASH> 100644 --- a/src/services/olHelpers.js +++ b/src/services/olHelpers.js @@ -232,7 +232,7 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log) { url: source.url, projection: source.projection, radius: source.radius, - extractStyles: false, + extractStyles: false }); break; case 'Stamen':
fixed: uneeded comma.
tombatossals_angular-openlayers-directive
train
js
48e0f9dc51f0810d1a907600b4834dd9a8514d48
diff --git a/pyparsing/core.py b/pyparsing/core.py index <HASH>..<HASH> 100644 --- a/pyparsing/core.py +++ b/pyparsing/core.py @@ -807,14 +807,20 @@ class ParserElement(ABC): E = pp.Forward("E") num = pp.Word(pp.nums) + # match `num`, or `num '+' num`, or `num '+' num '+' num`, ... E <<= E + '+' - num | num print(E.parseString("1+2+3")) - Searching the ideal recursion depth requires matching elements at least one - additional time. In addition, recursion search naturally memoizes matches and - may thus skip evaluation during backtracking. This may break existing programs - with parse actions which rely on side-effects. + Recursion search naturally memoizes matches of ``Forward`` elements and may + thus skip reevaluation of parse actions during backtracking. This may break + programs with parse actions which rely on strict ordering of side-effects. + + Parameters: + + - cache_size_limit - (default=``None``) - memoize at most this many + ``Forward`` elements during matching; if ``None`` (the default), + memoize all ``Forward`` elements. Bounded Recursion parsing works similar but not identical to Packrat parsing, thus the two cannot be used together. Use ``force=True`` to disable any
adjusted docs for recursion cache
pyparsing_pyparsing
train
py
0d7646a587831f1ccda2e6fcf54ae48355a8b9f5
diff --git a/pyontutils/hierarchies.py b/pyontutils/hierarchies.py index <HASH>..<HASH> 100755 --- a/pyontutils/hierarchies.py +++ b/pyontutils/hierarchies.py @@ -331,7 +331,7 @@ def newTree(name, **kwargs): return Tree, newTreeNode -def creatTree(root, relationshipType, direction, depth, graph=None, json=None): +def creatTree(root, relationshipType, direction, depth, graph=None, json=None, prefixes=None): if json is None: j = graph.getNeighbors(root, relationshipType=relationshipType, direction=direction, depth=depth) if graph._cache: @@ -435,11 +435,18 @@ def creatTree(root, relationshipType, direction, depth, graph=None, json=None): embed() raise e + def sub_prefixes(h): + if prefixes is not None: + for n, p in prefixes.items(): + h = h.replace("href='" + n + ':', "href='" + p) + return h + + html = sub_prefixes(html_hierarchy.__html__()) extras = Extras(hierarchy, html_hierarchy, dupes, nodes, edgerep, objects, parents, names, pnames, hpnames, j, - html_hierarchy.__html__(), str(named_hierarchy)) + html, str(named_hierarchy)) return named_hierarchy, extras def levels(tree, p, l = 0):
hierarchies.py can use prefixes to sub in the html, bad impl but works
tgbugs_pyontutils
train
py
5ba1a1cb8961174568b612e067a73e7a8e41664a
diff --git a/cmd/pprof.go b/cmd/pprof.go index <HASH>..<HASH> 100644 --- a/cmd/pprof.go +++ b/cmd/pprof.go @@ -25,6 +25,8 @@ func initPprof() { var buf bytes.Buffer go func() { for { + time.Sleep(time.Minute) + runtime.GC() if err := pprof.WriteHeapProfile(&buf); err != nil { if ctx != nil { @@ -35,8 +37,6 @@ func initPprof() { buf.Reset() ctx.WithField("ComponentStats", stats.GetComponent()).Debug("Stats") - - time.Sleep(time.Minute) } }() }
Sleep on leading edge of pprof loop
TheThingsNetwork_ttn
train
go
e33e049636c2628aad1febd0ddc626ce2f02f431
diff --git a/src/main/java/org/ktc/soapui/maven/extension/MockServiceMojo.java b/src/main/java/org/ktc/soapui/maven/extension/MockServiceMojo.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/ktc/soapui/maven/extension/MockServiceMojo.java +++ b/src/main/java/org/ktc/soapui/maven/extension/MockServiceMojo.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 Thomas Bouffard (redfish4ktc) + * Copyright 2012-2014 Thomas Bouffard (redfish4ktc) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,18 +36,11 @@ public class MockServiceMojo extends AbstractSoapuiRunnerMojo { configureWithSharedParameters(runner); runner.setBlock(!noBlock); - if (mockService != null) { - runner.setMockService(mockService); - } - if (path != null) { - runner.setPath(path); - } - if (port != null) { - runner.setPort(port); - } + runner.setMockService(mockService); + runner.setPath(path); + runner.setPort(port); runner.setSaveAfterRun(saveAfterRun); - try { runner.run(); } catch (Exception e) {
Remove extra null checks in the mock mojo #<I>
redfish4ktc_maven-soapui-extension-plugin
train
java
866656796ef69234625cfd5aa57bc531a700a39f
diff --git a/tests/ApplicationTest.php b/tests/ApplicationTest.php index <HASH>..<HASH> 100644 --- a/tests/ApplicationTest.php +++ b/tests/ApplicationTest.php @@ -56,6 +56,7 @@ EOT putenv("HOME={$home}"); $this->gushFile = $home.'/.gush/.gush.yml'; + touch($this->gushFile); file_put_contents($this->gushFile, self::GUSH_FILE); $config = new Config(); diff --git a/tests/FactoryTest.php b/tests/FactoryTest.php index <HASH>..<HASH> 100644 --- a/tests/FactoryTest.php +++ b/tests/FactoryTest.php @@ -70,7 +70,7 @@ class FactoryTest extends \PHPUnit_Framework_TestCase $config = Factory::createConfig(false); - $this->assertEquals($home, $config->get('cache-dir')); + $this->assertEquals($cacheDir, $config->get('cache-dir')); $this->assertEquals($home, $config->get('home')); $this->assertFileExists($home.'/.htaccess');
golly what errors does the past hold for us
gushphp_gush
train
php,php
582e1096e47d0535d7f969057cdcfdb93c96fc3c
diff --git a/lib/vagrant/pre-rubygems.rb b/lib/vagrant/pre-rubygems.rb index <HASH>..<HASH> 100644 --- a/lib/vagrant/pre-rubygems.rb +++ b/lib/vagrant/pre-rubygems.rb @@ -5,10 +5,17 @@ if defined?(Bundler) require "bundler/shared_helpers" if Bundler::SharedHelpers.in_bundle? - puts "Vagrant appears to be running in a Bundler environment. Plugins" - puts "will not be loaded and plugin commands are disabled." - puts - ENV["VAGRANT_NO_PLUGINS"] = "1" + if ENV["VAGRANT_FORCE_PLUGINS"] + puts "Vagrant appears to be running in a Bundler environment. Normally," + puts "plugins would not be loaded, but VAGRANT_FORCE_PLUGINS is enabled," + puts "so they will be." + puts + else + puts "Vagrant appears to be running in a Bundler environment. Plugins" + puts "will not be loaded and plugin commands are disabled." + puts + ENV["VAGRANT_NO_PLUGINS"] = "1" + end end end
Allow forcing plugins with VAGRANT_FORCE_PLUGINS
hashicorp_vagrant
train
rb
514f36cf540955d2d81738e91216826360b1a97e
diff --git a/cmd/influxd/run/server.go b/cmd/influxd/run/server.go index <HASH>..<HASH> 100644 --- a/cmd/influxd/run/server.go +++ b/cmd/influxd/run/server.go @@ -373,6 +373,11 @@ func (s *Server) Close() error { // startServerReporting starts periodic server reporting. func (s *Server) startServerReporting() { for { + select { + case <-s.closing: + return + default: + } if err := s.MetaStore.WaitForLeader(30 * time.Second); err != nil { log.Printf("no leader available for reporting: %s", err.Error()) continue
Exit report goroutine if server is closing
influxdata_influxdb
train
go
8c5006694acda9dc8cb400ec64cc46cd4d544354
diff --git a/docker/downloadOdbcDriver.php b/docker/downloadOdbcDriver.php index <HASH>..<HASH> 100644 --- a/docker/downloadOdbcDriver.php +++ b/docker/downloadOdbcDriver.php @@ -23,6 +23,6 @@ $client = new \Aws\S3\S3Client([ $client->getObject([ 'Bucket' => 'keboola-configs', - 'Key' => 'drivers/snowflake/snowflake_linux_x8664_odbc.2.12.78.tgz', + 'Key' => 'drivers/snowflake/snowflake_linux_x8664_odbc.2.12.86.tgz', 'SaveAs' => './snowflake_linux_x8664_odbc.tgz' ]);
snowlfake - ODBC driver <I>
keboola_php-db-import
train
php
1e652069cf71bcdc88fda27268af133c00edec8a
diff --git a/src/utils/user_utils.js b/src/utils/user_utils.js index <HASH>..<HASH> 100644 --- a/src/utils/user_utils.js +++ b/src/utils/user_utils.js @@ -96,8 +96,9 @@ export function removeUserFromList(userId: string, list: Array<UserProfile>): Ar export function filterProfilesMatchingTerm(users: Array<UserProfile>, term: string): Array<UserProfile> { let lowercasedTerm = term.toLowerCase(); - if (lowercasedTerm.startsWith('@')) { - lowercasedTerm = lowercasedTerm.substr(1); + let trimmedTerm = lowercasedTerm + if (trimmedTerm.startsWith('@')) { + trimmedTerm = trimmedTerm.substr(1); } return users.filter((user: UserProfile) => { @@ -117,12 +118,12 @@ export function filterProfilesMatchingTerm(users: Array<UserProfile>, term: stri emailDomain = split[1]; } - return username.startsWith(lowercasedTerm) || - full.startsWith(lowercasedTerm) || + return username.startsWith(trimmedTerm) || + full.startsWith(trimmedTerm) || last.startsWith(lowercasedTerm) || - nickname.startsWith(lowercasedTerm) || + nickname.startsWith(trimmedTerm) || email.startsWith(lowercasedTerm) || - emailDomain.startsWith(lowercasedTerm); + emailDomain.startsWith(trimmedTerm); }); }
Prevent searches for "@xyz" from prefix matching emails and last names It makes sense to ignore the @ sign when comparing against first name, username, nickname, and email domain. However, it doesn't make sense to match this against the start of an email address, or the last name.
mattermost_mattermost-redux
train
js
553a99d633d89012898cf7d9fb3f096d9704036c
diff --git a/ipyrad/analysis/pca.py b/ipyrad/analysis/pca.py index <HASH>..<HASH> 100644 --- a/ipyrad/analysis/pca.py +++ b/ipyrad/analysis/pca.py @@ -762,13 +762,18 @@ class Drawing: icolor = next(self.colors) ishape = next(self.shapes) + try: + color = toyplot.color.to_css(icolor) + except Exception: + color = icolor + self.pstyles[pop] = toyplot.marker.create( size=self.size, shape=ishape, mstyle={ - "fill": toyplot.color.to_css(icolor), + "fill": color, "stroke": "#262626", - "stroke-width": 1.0, + "stroke-width": 1.25, "fill-opacity": 0.75, }, ) @@ -777,14 +782,13 @@ class Drawing: size=self.size, shape=ishape, mstyle={ - "fill": toyplot.color.to_css(icolor), + "fill": color, "stroke": "none", "fill-opacity": 0.9 / self.nreplicates, }, ) - def _assign_styles_to_marks(self): # assign styled markers to data points self.pmarks = []
fix to allow custom colors in pca
dereneaton_ipyrad
train
py
abfe156d8d18483f265a264c9769063cbfde8ba2
diff --git a/modules/system/models/File.php b/modules/system/models/File.php index <HASH>..<HASH> 100644 --- a/modules/system/models/File.php +++ b/modules/system/models/File.php @@ -21,6 +21,26 @@ class File extends FileBase protected $table = 'system_files'; /** + * @var array The attributes that are mass assignable. + */ + protected $fillable = [ + 'file_name', + 'title', + 'description', + 'field', + 'attachment_id', + 'attachment_type', + 'is_public', + 'sort_order', + 'data', + ]; + + /** + * @var array The attributes that aren't mass assignable. + */ + protected $guarded = []; + + /** * {@inheritDoc} */ public function getThumb($width, $height, $options = [])
Change File model to use fillable as opposed to guardable attributes
octobercms_october
train
php
4862140ceadbf23bb0592c344adeb6219f9b042f
diff --git a/baselines/trpo_mpi/trpo_mpi.py b/baselines/trpo_mpi/trpo_mpi.py index <HASH>..<HASH> 100644 --- a/baselines/trpo_mpi/trpo_mpi.py +++ b/baselines/trpo_mpi/trpo_mpi.py @@ -207,7 +207,7 @@ def learn(env, policy_func, *, if hasattr(pi, "ret_rms"): pi.ret_rms.update(tdlamret) if hasattr(pi, "ob_rms"): pi.ob_rms.update(ob) # update running mean/std for policy - args = seg["ob"], seg["ac"], seg["adv"] + args = seg["ob"], seg["ac"], atarg fvpargs = [arr[::5] for arr in args] def fisher_vector_product(p): return allmean(compute_fvp(p, *fvpargs)) + cg_damping * p @@ -288,4 +288,4 @@ def learn(env, policy_func, *, logger.dump_tabular() def flatten_lists(listoflists): - return [el for list_ in listoflists for el in list_] \ No newline at end of file + return [el for list_ in listoflists for el in list_]
Use standardized advantages in trpo.
openai_baselines
train
py
d0cd76231cac91408dde94a18e3a49f49e538d10
diff --git a/packages/cozy-client/src/authentication/mobile.js b/packages/cozy-client/src/authentication/mobile.js index <HASH>..<HASH> 100644 --- a/packages/cozy-client/src/authentication/mobile.js +++ b/packages/cozy-client/src/authentication/mobile.js @@ -11,7 +11,7 @@ import { CordovaWindow } from '../types' * @type {CordovaWindow} */ // @ts-ignore -const win = window +const win = typeof window !== 'undefined' ? window : null const authenticateWithSafari = url => { return new Promise((resolve, reject) => {
fix: Do not assign window to win if window is not defined
cozy_cozy-client
train
js
5466c7a92cf5bbc9a0a71e9e358cab09fec5fd0d
diff --git a/lib/codemirror.js b/lib/codemirror.js index <HASH>..<HASH> 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -1384,10 +1384,8 @@ var CodeMirror = (function() { if (!found) found = {pos: null, match: false}; var style = found.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; var one = markText({line: head.line, ch: pos}, {line: head.line, ch: pos+1}, style), - two = found.pos != null - ? markText({line: i, ch: found.pos}, {line: i, ch: found.pos + 1}, style) - : function() {}; - var clear = operation(function(){one(); two();}); + two = found.pos != null && markText({line: i, ch: found.pos}, {line: i, ch: found.pos + 1}, style); + var clear = operation(function(){one.clear(); two && two.clear();}); if (autoclear) setTimeout(clear, 800); else bracketHighlighted = clear; }
Fix bracket highlighting A previous patch had changed the interface to markText, but not updated matchBrackets
codemirror_CodeMirror
train
js
22173683e7f305de8e676c46608eda1d27a7d6c9
diff --git a/sdk/spring/azure-spring-boot/src/main/java/com/azure/spring/autoconfigure/jms/AzureServiceBusJMSProperties.java b/sdk/spring/azure-spring-boot/src/main/java/com/azure/spring/autoconfigure/jms/AzureServiceBusJMSProperties.java index <HASH>..<HASH> 100644 --- a/sdk/spring/azure-spring-boot/src/main/java/com/azure/spring/autoconfigure/jms/AzureServiceBusJMSProperties.java +++ b/sdk/spring/azure-spring-boot/src/main/java/com/azure/spring/autoconfigure/jms/AzureServiceBusJMSProperties.java @@ -73,7 +73,7 @@ public class AzureServiceBusJMSProperties { } if (!pricingTier.matches("(?i)premium|standard|basic")) { - throw new IllegalArgumentException("'spring.jms.servicebus.pricing-tire' is not valid"); + throw new IllegalArgumentException("'spring.jms.servicebus.pricing-tier' is not valid"); } } }
Typo in spring property name (#<I>)
Azure_azure-sdk-for-java
train
java
4d6bac3f1ca4ac0a51e29c0b82a2c67a1374c961
diff --git a/lib/jets/camelizer.rb b/lib/jets/camelizer.rb index <HASH>..<HASH> 100644 --- a/lib/jets/camelizer.rb +++ b/lib/jets/camelizer.rb @@ -58,6 +58,8 @@ module Jets { "TemplateUrl" => "TemplateURL", "Ttl" => "TTL", + "MaxReceiveCount" => "maxReceiveCount", + "DeadLetterQueueArn" => "deadLetterQueueArn", } end end
Added SQS RedrivePolicy attributes to special map because they aren't being properly camelized.
tongueroo_jets
train
rb
eb83cd4d9bdf76b5dad5681750a421689391b5e2
diff --git a/test/unit/karma.conf.js b/test/unit/karma.conf.js index <HASH>..<HASH> 100644 --- a/test/unit/karma.conf.js +++ b/test/unit/karma.conf.js @@ -4,6 +4,9 @@ module.exports = config => { config.set({ browsers: [ 'ChromeHeadless' ], frameworks: [ 'jasmine', 'jasmine-matchers' ], + client: { + jasmine: { random: false }, + }, reporters: [ 'spec', 'coverage' ], files: [ './index.js' ], preprocessors: {
disable running tests in random order of jasmine
riophae_vue-treeselect
train
js
efc7060e0ddf097083f1761a4fcc0f4bed9cead6
diff --git a/clearly/expected_state.py b/clearly/expected_state.py index <HASH>..<HASH> 100644 --- a/clearly/expected_state.py +++ b/clearly/expected_state.py @@ -1,6 +1,7 @@ # coding=utf-8 from __future__ import absolute_import, print_function, unicode_literals +import six from celery import states from .utils import worker_states @@ -49,7 +50,7 @@ class ExpectedStateHandler(object): class ExpectedPath(object): def __init__(self, name): - assert isinstance(name, str) + assert isinstance(name, six.string_types) self.name = name self.possibles = () self.default = None
fix(expected_state) python <I> compatibility
rsalmei_clearly
train
py
90695b5079b2c6171df284a0da5c8f67793ca7f5
diff --git a/spec/helper.rb b/spec/helper.rb index <HASH>..<HASH> 100644 --- a/spec/helper.rb +++ b/spec/helper.rb @@ -1,11 +1,6 @@ -begin - require 'bundler' - Bundler.setup -rescue LoadError - warn "[WARNING]: It is recommended that you use bundler during development: gem install bundler" -end - +$:.unshift File.expand_path('..', __FILE__) +$:.unshift File.expand_path('../../lib', __FILE__) require 'simplecov' SimpleCov.start -require 'rspec' require 'multi_json' +require 'rspec'
Push spec and lib onto the
intridea_multi_json
train
rb
f9517661607c6a98faf1f536e7ab1022e4c979e3
diff --git a/tlsobs-api/handlers.go b/tlsobs-api/handlers.go index <HASH>..<HASH> 100644 --- a/tlsobs-api/handlers.go +++ b/tlsobs-api/handlers.go @@ -137,7 +137,6 @@ func ResultHandler(w http.ResponseWriter, r *http.Request) { status int err error ) - setResponseHeader(w) defer func() { if nil != err {
oops, setting cors headers twice is no good
mozilla_tls-observatory
train
go
d4e40f1b11590dce2b2ad82b785d176d676e3e8c
diff --git a/Goutte/Client.php b/Goutte/Client.php index <HASH>..<HASH> 100644 --- a/Goutte/Client.php +++ b/Goutte/Client.php @@ -71,6 +71,13 @@ class Client extends BaseClient return $this; } + public function resetAuth() + { + $this->auth = null; + + return $this; + } + protected function doRequest($request) { $headers = array(); diff --git a/Goutte/Tests/ClientTest.php b/Goutte/Tests/ClientTest.php index <HASH>..<HASH> 100644 --- a/Goutte/Tests/ClientTest.php +++ b/Goutte/Tests/ClientTest.php @@ -90,6 +90,19 @@ class ClientTest extends \PHPUnit_Framework_TestCase $this->assertEquals('**', $request->getPassword()); } + public function testResetsAuth() + { + $guzzle = $this->getGuzzle(); + $client = new Client(); + $client->setClient($guzzle); + $client->setAuth('me', '**'); + $client->resetAuth(); + $crawler = $client->request('GET', 'http://www.example.com/'); + $request = $this->historyPlugin->getLastRequest(); + $this->assertNull($request->getUsername()); + $this->assertNull($request->getPassword()); + } + public function testUsesCookies() { $guzzle = $this->getGuzzle();
Added Goutte\Client->resetAuth()
FriendsOfPHP_Goutte
train
php,php
7206731f38a0f73a9cedf3318ddacd7642c839e6
diff --git a/src/generator.js b/src/generator.js index <HASH>..<HASH> 100644 --- a/src/generator.js +++ b/src/generator.js @@ -86,7 +86,7 @@ class Generator { <h5 class="i-example__heading"> Example <a - href="examples/${doc.slug}-$1.html" + href="html/${doc.slug}-$1.html" target="_blank" class="fa fa-external-link" data-toggle="tooltip" @@ -97,7 +97,7 @@ class Generator { <div class="i-example__iframe" lazyframe - data-src="examples/${doc.slug}-$1.html" + data-src="html/${doc.slug}-$1.html" data-initinview="true" data-title="Loading…" $2
Rename examples/ output folder to html/
nextbigsoundinc_stylemark
train
js
95962d2db75bc11c102fe185219177c34664d20b
diff --git a/src/Views/home/home.blade.php b/src/Views/home/home.blade.php index <HASH>..<HASH> 100644 --- a/src/Views/home/home.blade.php +++ b/src/Views/home/home.blade.php @@ -3,10 +3,12 @@ @section('content') <div class="jumbotron home-intro"> <h1 class="display-3">Welcome to Soda CMS!</h1> - <p class="lead">Soda CMS is awesome!</p> <hr class="m-y-2"> + <p class="lead">This is your dashboard.</p> + {{-- <p class="lead"> <a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a> </p> + --}} </div> -@stop \ No newline at end of file +@stop
Remove cool text from dashboard because it's to "unprofessional" .-.
soda-framework_cms
train
php
72b6a24a8f41be5d6145aa5a7e08289582793a3f
diff --git a/cherrypy/test/test.py b/cherrypy/test/test.py index <HASH>..<HASH> 100644 --- a/cherrypy/test/test.py +++ b/cherrypy/test/test.py @@ -36,16 +36,18 @@ def get_tst_config(overconf = {}): } try: import testconfig - conf.update(testconfig.config.get('supervisor', None)) + _conf = testconfig.config.get('supervisor', None) + if _conf is not None: + for k, v in _conf.iteritems(): + if isinstance(v, basestring): + _conf[k] = unrepr(v) + conf.update(_conf) except ImportError: pass _testconfig = conf conf = _testconfig.copy() conf.update(overconf) - for k, v in conf.iteritems(): - if isinstance(v, basestring): - conf[k] = unrepr(v) return conf class Supervisor(object):
nose without nose-testconfig or with but not specified now works
cherrypy_cheroot
train
py
68c4eea240eb7b559b55ceb54c983d9a3cbedeed
diff --git a/lib/flor/unit/waiter.rb b/lib/flor/unit/waiter.rb index <HASH>..<HASH> 100644 --- a/lib/flor/unit/waiter.rb +++ b/lib/flor/unit/waiter.rb @@ -76,7 +76,7 @@ module Flor exe, msg = @queue.shift - Flor::Ash.inflate_all(exe, msg) + Flor::Ash.inflate_all(exe, Flor.dup(msg)) end end
let Waiter hand back inflated, copies of messages
floraison_flor
train
rb
d660d108031934019aacc577797b337e51797d30
diff --git a/mbed/mbed.py b/mbed/mbed.py index <HASH>..<HASH> 100644 --- a/mbed/mbed.py +++ b/mbed/mbed.py @@ -382,8 +382,6 @@ class Hg(object): popen([hg_cmd, 'update', '-C'] + (['-v'] if verbose else ['-q'])) def checkout(rev): - if not rev: - return log("Checkout \"%s\" in %s to %s" % (rev, os.path.basename(os.getcwd()), rev)) popen([hg_cmd, 'update'] + (['-r', rev] if rev else []) + (['-v'] if verbose else ['-q']))
Fixed updating of mercurial repositories even if rev is not provided
ARMmbed_mbed-cli
train
py
5f090860963516ddab8b50d32762e0b0b4001499
diff --git a/src/org/opencms/search/solr/CmsSolrIndex.java b/src/org/opencms/search/solr/CmsSolrIndex.java index <HASH>..<HASH> 100644 --- a/src/org/opencms/search/solr/CmsSolrIndex.java +++ b/src/org/opencms/search/solr/CmsSolrIndex.java @@ -967,7 +967,7 @@ public class CmsSolrIndex extends CmsSearchIndex { CmsSolrQuery checkQuery = query.clone(); // Initialize rows, offset, end and the current page. int end = start + rows; - int itemsToCheck = Math.max(10, end + (end / 5)); // request 20 percent more, but at least 10 results if permissions are filtered + int itemsToCheck = 0 == rows ? 0 : Math.max(10, end + (end / 5)); // request 20 percent more, but at least 10 results if permissions are filtered // use a set to prevent double entries if multiple check queries are performed. Set<String> resultSolrIds = new HashSet<>(rows); // rows are set before definitely.
Solr search: Fixed bug for requesting zero results.
alkacon_opencms-core
train
java
69e184846aeac8d13e2b34d1ffb8adecdde6bdad
diff --git a/acceptancetests/assess_cloud_display.py b/acceptancetests/assess_cloud_display.py index <HASH>..<HASH> 100755 --- a/acceptancetests/assess_cloud_display.py +++ b/acceptancetests/assess_cloud_display.py @@ -41,7 +41,7 @@ def remove_display_attributes(cloud): def get_clouds(client): cloud_list = yaml.safe_load(client.get_juju_output( - 'clouds', '--format', 'yaml', include_e=False)) + 'clouds', '--format', 'yaml', '--local', include_e=False)) for cloud_name, cloud in cloud_list.items(): if cloud['defined'] == 'built-in': del cloud_list[cloud_name] @@ -74,7 +74,7 @@ def assess_show_cloud(client, expected): """Assess how show-cloud behaves.""" for cloud_name, expected_cloud in expected.items(): actual_cloud = yaml.safe_load(client.get_juju_output( - 'show-cloud', cloud_name, '--format', 'yaml', include_e=False)) + 'show-cloud', cloud_name, '--format', 'yaml', '--local', include_e=False)) remove_display_attributes(actual_cloud) assert_equal(actual_cloud, expected_cloud)
Assess cloud display The following fixes the issues where the breaking changes to show-cloud and clouds are reflected in the tests
juju_juju
train
py
b5c0ec4ca9c7a014033c329d219146f9276a50b0
diff --git a/test_dingo2.py b/test_dingo2.py index <HASH>..<HASH> 100755 --- a/test_dingo2.py +++ b/test_dingo2.py @@ -5,6 +5,7 @@ from oemof import db conn = db.connection(section='oedb') from dingo.core import NetworkDingo from dingo.tools import config as cfg_dingo +from dingo.tools.debug import compare_graphs plt.close('all') @@ -42,6 +43,8 @@ nd.set_branch_ids() #compare_graphs(graph=nd._mv_grid_districts[0].mv_grid._graph, # mode='compare') +nd.set_circuit_breakers() + # Open and close all circuit breakers in grid (for testing) [gd.mv_grid.open_circuit_breakers() for gd in nd._mv_grid_districts] #nd._mv_grid_districts[0].mv_grid.close_circuit_breakers() @@ -50,7 +53,6 @@ nd.set_branch_ids() for mv_grid_district in nd._mv_grid_districts: mv_grid_district.mv_grid.run_powerflow(conn, method=method) -nd.set_circuit_breakers() nd.export_mv_grid(conn, mv_grid_districts)
relocate circ breakers prior to pf
openego_ding0
train
py
f9623286878a28b2c1bd2926ac7f27aac16e5cba
diff --git a/Task/Collect/PluginTypesCollector.php b/Task/Collect/PluginTypesCollector.php index <HASH>..<HASH> 100644 --- a/Task/Collect/PluginTypesCollector.php +++ b/Task/Collect/PluginTypesCollector.php @@ -566,6 +566,14 @@ class PluginTypesCollector { return; } + // Skip any class that we can't attempt to load without a fatal. This will + // typically happen if the plugin is meant for use with another module, + // and inherits from a base class that doesn't exist in the current + // codebase. + if (!$this->codeAnalyser->classIsUsable($definition['class'])) { + continue; + } + // Babysit modules that have a broken plugin class. This can be caused // if the namespace is incorrect for the file location, and so prevents // the class from being autoloaded.
Fixed plugin analysis crashing on plugins that have a base class from a module that's not present. Fixes #<I>.
drupal-code-builder_drupal-code-builder
train
php
9d247718d7e17037999316f5114f7fe08df01e03
diff --git a/cmd/ctr/commands/tasks/list.go b/cmd/ctr/commands/tasks/list.go index <HASH>..<HASH> 100644 --- a/cmd/ctr/commands/tasks/list.go +++ b/cmd/ctr/commands/tasks/list.go @@ -34,7 +34,7 @@ var listCommand = cli.Command{ Flags: []cli.Flag{ cli.BoolFlag{ Name: "quiet, q", - Usage: "print only the task id & pid", + Usage: "print only the task id", }, }, Action: func(context *cli.Context) error {
Update ctr tasks list usage for quiet flag
containerd_containerd
train
go
5bf08236f14c068098adca989d27fe5dc69b0c4a
diff --git a/src/plugin.js b/src/plugin.js index <HASH>..<HASH> 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -103,7 +103,7 @@ module.exports = class IconPlugin { require.resolve('./loader'), // TODO(Jeremy): // SVGO loader to optimize assets, or allow passing in a loader. - 'svg-sprite?extract=true', + 'svg-sprite-loader?extract=true', ].join('!'); }
Stop breaking in Webpack 2 This isn't full support for webpack 2, but it at least allows it to be used with the legacy `loader` syntax.
TodayTix_svg-sprite-webpack-plugin
train
js
f518f707ceea09742492ea0d8a2915c28d27a0e2
diff --git a/pyoos/collectors/hads/hads.py b/pyoos/collectors/hads/hads.py index <HASH>..<HASH> 100644 --- a/pyoos/collectors/hads/hads.py +++ b/pyoos/collectors/hads/hads.py @@ -151,6 +151,19 @@ class Hads(Collector): self.station_codes.extend(self._get_stations_for_state(state_url)) + if self.bbox: + # retreive metadata for all stations to properly filter them + metadata = self._get_metadata(self.station_codes) + parsed_metadata = self.parser._parse_metadata(metadata) + + def in_bbox(code): + lat = parsed_metadata[code]['latitude'] + lon = parsed_metadata[code]['longitude'] + + return lon >= self.bbox[0] and lon <= self.bbox[2] and lat >= self.bbox[1] and lat <= self.bbox[3] + + self.station_codes = filter(in_bbox, self.station_codes) + return self.station_codes def _get_state_urls(self):
Actually perform a bbox filter for HADS
ioos_pyoos
train
py
55d2ed6329009269d9486e8bd4288d0b5505296a
diff --git a/GVRf/Framework/src/org/gearvrf/scene_objects/GVRSphereSceneObject.java b/GVRf/Framework/src/org/gearvrf/scene_objects/GVRSphereSceneObject.java index <HASH>..<HASH> 100644 --- a/GVRf/Framework/src/org/gearvrf/scene_objects/GVRSphereSceneObject.java +++ b/GVRf/Framework/src/org/gearvrf/scene_objects/GVRSphereSceneObject.java @@ -573,6 +573,7 @@ public class GVRSphereSceneObject extends GVRSceneObject { // attached an empty renderData for parent object, so that we can set // some common properties GVRRenderData renderData = new GVRRenderData(gvrContext); + renderData.setMaterial(material); attachRenderData(renderData); }
Set material for parent object for subdivided sphere.
Samsung_GearVRf
train
java
a902e7109ad7e82dc940658a2a38d06ba6bc806e
diff --git a/src/collab.js b/src/collab.js index <HASH>..<HASH> 100644 --- a/src/collab.js +++ b/src/collab.js @@ -142,7 +142,7 @@ export function receiveTransaction(state, steps, clientIDs, options) { } let newCollabState = new CollabState(version, unconfirmed) - if (options && options.mapSelectionBackard && state.selection instanceof TextSelection) { + if (options && options.mapSelectionBackward && state.selection instanceof TextSelection) { tr.setSelection(TextSelection.between(tr.doc.resolve(tr.mapping.map(state.selection.head, -1)), tr.doc.resolve(tr.mapping.map(state.selection.anchor, -1)), -1)) tr.updated &= ~1
Fix misspelling of option name FIX: Fix issue where `mapSelectionBackward` didn't work because of a typo.
ProseMirror_prosemirror-collab
train
js
e631ebb1509ccd168b49e56eced683d590a9e150
diff --git a/captcha/helpers.py b/captcha/helpers.py index <HASH>..<HASH> 100644 --- a/captcha/helpers.py +++ b/captcha/helpers.py @@ -12,6 +12,8 @@ def math_challenge(): if operands[0] < operands[1] and '-' == operator: operands = (operands[1], operands[0]) challenge = '%d%s%d' % (operands[0], operator, operands[1]) + if '*' == operator: + return '%s=' % (challenge.replace('*', '×')), text_type(eval(challenge)) return '%s=' % (challenge), text_type(eval(challenge))
changed multiplication sign from '*' to '×'
mbi_django-simple-captcha
train
py
511edea217c578556753b115882c824093e8767f
diff --git a/bosh-director/db/migrations/director/20160818112257_change_stemcell_unique_key.rb b/bosh-director/db/migrations/director/20160818112257_change_stemcell_unique_key.rb index <HASH>..<HASH> 100644 --- a/bosh-director/db/migrations/director/20160818112257_change_stemcell_unique_key.rb +++ b/bosh-director/db/migrations/director/20160818112257_change_stemcell_unique_key.rb @@ -8,7 +8,7 @@ Sequel.migration do if existing_constraint if [:mysql2, :mysql].include?(adapter_scheme) alter_table(:stemcells) do - drop_index unique_constraint, name: existing_constraint.first + drop_index old_constraint, name: existing_constraint.first end else alter_table(:stemcells) do
multi-cpi: fixed migration that was broken for mysql
cloudfoundry_bosh
train
rb
b67b283c4cd2b7264351176d9ff288f19eca00bf
diff --git a/lib/motion_model/model/model.rb b/lib/motion_model/model/model.rb index <HASH>..<HASH> 100644 --- a/lib/motion_model/model/model.rb +++ b/lib/motion_model/model/model.rb @@ -600,14 +600,14 @@ module MotionModel end # Stub methods for hook protocols - def before_save(*); end - def after_save(*); end - def before_delete(*); end - def after_delete(*); end + def before_save(sender); end + def after_save(sender); end + def before_delete(sender); end + def after_delete(sender); end def call_hook(hook_name, postfix) hook = "#{hook_name}_#{postfix}" - self.send(hook) + self.send(hook, self) end def call_hooks(hook_name, &block)
Changed hook methods to pass a "sender" object, which is the object that either is about to change or has changed. This may break existing code.
sxross_MotionModel
train
rb
5cf65029b291f026a03af7715169ed36e627a9bf
diff --git a/http_prompt/lexer.py b/http_prompt/lexer.py index <HASH>..<HASH> 100644 --- a/http_prompt/lexer.py +++ b/http_prompt/lexer.py @@ -108,7 +108,7 @@ class HttpPromptLexer(RegexLexer): ], 'preview_action': [ (r'(?i)(get|head|post|put|patch|delete)(\s*)', - bygroups(Keyword, Text), ('urlpath', 'redir_out')), + bygroups(Keyword, Text), combined('urlpath', 'redir_out')), include('redir_out'), (r'', Text, 'urlpath') ], @@ -136,7 +136,7 @@ class HttpPromptLexer(RegexLexer): (r"(')((?:[^\r\n'\\=:]|(?:\\.))+)", bygroups(Text, String)), (r'([^\-]([^\s"\'\\=:]|(\\.))+)(\s+|$)', String, combined('concat_mut', 'redir_out')), - (r'', Text, 'concat_mut') + (r'', Text, combined('concat_mut', 'redir_out')) ], 'end': [
fixbug/ lexer rules for `preview` command output file redirection
eliangcs_http-prompt
train
py
29bbcdd110d870461fb176f16e7188ebf0639444
diff --git a/integration/v3_lease_test.go b/integration/v3_lease_test.go index <HASH>..<HASH> 100644 --- a/integration/v3_lease_test.go +++ b/integration/v3_lease_test.go @@ -528,8 +528,8 @@ func TestV3LeaseRequireLeader(t *testing.T) { } }() select { - case <-time.After(time.Duration(5*electionTicks) * tickDuration): - t.Fatalf("did not receive leader loss error") + case <-time.After(5 * time.Second): + t.Fatal("did not receive leader loss error (in 5-sec)") case <-donec: } }
integration: bump up 'TestV3LeaseRequireLeader' timeout to 5-sec
etcd-io_etcd
train
go
7087b770b226c44d722d8213e4aaa8d477004d38
diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/textView.js b/bundles/org.eclipse.orion.client.editor/web/orion/editor/textView.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.editor/web/orion/editor/textView.js +++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/textView.js @@ -17,12 +17,11 @@ define("orion/editor/textView", [ //$NON-NLS-0$ 'i18n!orion/editor/nls/messages', //$NON-NLS-0$ 'orion/editor/textModel', //$NON-NLS-0$ - 'orion/keyBinding', //$NON-NLS-0$ 'orion/editor/keyModes', //$NON-NLS-0$ 'orion/editor/eventTarget', //$NON-NLS-0$ 'orion/editor/textTheme', //$NON-NLS-0$ 'orion/util' //$NON-NLS-0$ -], function(messages, mTextModel, mKeyBinding, mKeyModes, mEventTarget, mTextTheme, util) { +], function(messages, mTextModel, mKeyModes, mEventTarget, mTextTheme, util) { /** @private */ function getWindow(document) {
Remove keyBinding dependency from textView
eclipse_orion.client
train
js
460d2f8f01ca4bf1ab624a1c88b1ae2528627562
diff --git a/lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb b/lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb index <HASH>..<HASH> 100644 --- a/lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb +++ b/lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb @@ -38,7 +38,7 @@ module Fog end def to_boolean(v) - v =~ /\A\s*(true|yes|1|y)\s*$/i + (v =~ /\A\s*(true|yes|1|y)\s*$/i) == 0 end end end
Return boolean, not index of match.
fog_fog
train
rb
61a4e5d6412c5f94fe91ad643c49328d21a1053e
diff --git a/checklist.go b/checklist.go index <HASH>..<HASH> 100644 --- a/checklist.go +++ b/checklist.go @@ -26,8 +26,7 @@ type CheckItem struct { Pos float64 `json:"pos,omitempty"` } -// Manifestation of CheckItem when it appears in CheckItemStates -// on a Card. +// CheckItemState represents a CheckItem when it appears in CheckItemStates on a Card. type CheckItemState struct { IDCheckItem string `json:"idCheckItem"` State string `json:"state"`
Fix comment style in checklist (golint)
adlio_trello
train
go
4d901acd8e0e307b73b040e2169d20fedaf8abb8
diff --git a/apps/advanced/common/models/User.php b/apps/advanced/common/models/User.php index <HASH>..<HASH> 100644 --- a/apps/advanced/common/models/User.php +++ b/apps/advanced/common/models/User.php @@ -123,7 +123,6 @@ class User extends ActiveRecord implements Identity { return array( 'signup' => array('username', 'email', 'password'), - 'login' => array('username', 'password'), 'resetPassword' => array('password'), 'requestPasswordResetToken' => array('email'), );
Advanced application template: removed unused scenario from User model
yiisoft_yii2-debug
train
php
ad72ecddeb965058b0a7c8b48622b5297d8136c0
diff --git a/src/test/java/org/fuin/utils4j/Utils4JTest.java b/src/test/java/org/fuin/utils4j/Utils4JTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/fuin/utils4j/Utils4JTest.java +++ b/src/test/java/org/fuin/utils4j/Utils4JTest.java @@ -895,7 +895,6 @@ public class Utils4JTest { final File javaExtDir = new File(javaHomeDir, "lib/ext"); // Existing JRE files - assertThat(Utils4J.jreFile(new File(javaHomeDir, "README"))).isTrue(); assertThat(Utils4J.jreFile(new File(javaHomeDir, "lib/rt.jar"))).isTrue(); assertThat(Utils4J.jreFile(new File(javaExtDir, "localedata.jar"))).isTrue();
Removed JRE file from test that does not exist in all environments
fuinorg_utils4j
train
java
01ab93d266c95055e37ba7e58faf09f9ecdd5846
diff --git a/.eslintrc.js b/.eslintrc.js index <HASH>..<HASH> 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -46,7 +46,7 @@ module.exports = { 'newline-before-return': 'off', 'no-alert': 'error', 'no-array-constructor': 'error', - 'no-await-in-loop': 'error', + 'no-await-in-loop': 'off', 'no-bitwise': 'error', 'no-caller': 'error', 'no-catch-shadow': 'error',
ESLint: Disable `no-await-in-loop` rule While this rule can make sense in some cases, there are legitimate reasons to run async operations in a sequential loop, and since we have such cases in the codebase we'll disable the rule.
glimmerjs_glimmer-vm
train
js
31345cc75141cf3478186563f4b29f654c17dc3b
diff --git a/packages/slate-tools/src/tasks/includes/utilities.js b/packages/slate-tools/src/tasks/includes/utilities.js index <HASH>..<HASH> 100644 --- a/packages/slate-tools/src/tasks/includes/utilities.js +++ b/packages/slate-tools/src/tasks/includes/utilities.js @@ -1,5 +1,4 @@ const gutil = require('gulp-util'); -const fs = require('fs'); const _ = require('lodash'); const Promise = require('bluebird'); @@ -65,21 +64,6 @@ const utilities = { }, /** - * Checks whether the path is a directory - * - * @param path {String} - a string representing the path to a file - * @returns {boolean} - */ - isDirectory: (path) => { - try { - // eslint-disable-next-line no-sync - return fs.statSync(path).isDirectory(); - } catch (error) { - return false; - } - }, - - /** * Function passed to cheerio.run - adds aria tags & other accessibility * based information to each svg element's markup... *
Remove isDirectory function (#<I>)
Shopify_slate
train
js
057ede8dde70d199994d8468f7a9bf40d98078f1
diff --git a/pyicloud/services/findmyiphone.py b/pyicloud/services/findmyiphone.py index <HASH>..<HASH> 100644 --- a/pyicloud/services/findmyiphone.py +++ b/pyicloud/services/findmyiphone.py @@ -43,6 +43,7 @@ class FindMyiPhoneServiceManager(object): "fmly": self.with_family, "shouldLocate": True, "selectedDevice": "all", + "deviceListVersion": 1, } } ),
Allow accessories to be retrieved from the FindMyiPhone service (#<I>) * Allow for accessories to be retrived for the FindMyIPhone service * added coma to fix black formatting
picklepete_pyicloud
train
py
0ff1b1b6b9c7064ba205e39349d8d62896684d43
diff --git a/opbeat/instrumentation/packages/python_memcached.py b/opbeat/instrumentation/packages/python_memcached.py index <HASH>..<HASH> 100644 --- a/opbeat/instrumentation/packages/python_memcached.py +++ b/opbeat/instrumentation/packages/python_memcached.py @@ -8,8 +8,6 @@ class PythonMemcachedInstrumentation(AbstractInstrumentedModule): 'add', 'append', 'cas', - 'check_key', - 'debuglog', 'decr', 'delete', 'delete_multi', @@ -23,13 +21,12 @@ class PythonMemcachedInstrumentation(AbstractInstrumentedModule): 'incr', 'prepend', 'replace', - 'reset_cas', 'set', 'set_multi', 'touch' ] - # Took out 'set_servers', 'reset_cas', 'debuglog' and 'forget_dead_hosts' - # because they involve no communication. + # Took out 'set_servers', 'reset_cas', 'debuglog', 'check_key' and + # 'forget_dead_hosts' because they involve no communication. def get_instrument_list(self): return [("memcache", "Client." + method) for method in self.method_list]
Take out some methods that we don't need to instrument.
elastic_apm-agent-python
train
py
9a1f51520ac5a63788edd4eb75995b961dad7693
diff --git a/client/notifier.py b/client/notifier.py index <HASH>..<HASH> 100644 --- a/client/notifier.py +++ b/client/notifier.py @@ -20,9 +20,10 @@ class Notifier(object): def __init__(self, profile): self.q = Queue.Queue() self.profile = profile - self.notifiers = [ - self.NotificationClient(self.handleEmailNotifications, None), - ] + self.notifiers = [] + + if 'gmail_address' in profile and 'gmail_password' in profile: + self.notifiers.append(self.NotificationClient(self.handleEmailNotifications, None)) sched = Scheduler() sched.start()
Remove Gmail errors. This resolves jasperproject/jasper-client#<I>.
benhoff_vexbot
train
py
ae5ef61ec581c557166c117310fccdfa64284805
diff --git a/main.go b/main.go index <HASH>..<HASH> 100644 --- a/main.go +++ b/main.go @@ -90,8 +90,6 @@ func main() { watcher := lrpwatcher.New(bbs, lrpreprocessor.New(bbs), logger) - logger.Info("started") - monitor := sigmon.New(group_runner.New([]group_runner.Member{ {"heartbeater", heartbeater}, {"converger", converger}, @@ -100,6 +98,8 @@ func main() { process := ifrit.Envoke(monitor) + logger.Info("started") + err = <-process.Wait() if err != nil { logger.Error("exited-with-failure", err)
say start after we start and not before
cloudfoundry_converger
train
go
865ae4eda890a74c7e90510176fc670ab5fec2a9
diff --git a/tests/lineCircle-tests.js b/tests/lineCircle-tests.js index <HASH>..<HASH> 100644 --- a/tests/lineCircle-tests.js +++ b/tests/lineCircle-tests.js @@ -41,8 +41,10 @@ describe('lineCircle', function () { i.should.not.equal(null); i.result.should.equal(collision.INTERSECT); - i.entry.should.not.equal(null); - i.exit.should.not.equal(null); + i.entry.x.should.equal(3); + i.entry.y.should.equal(2.6457513110645907); + i.exit.x.should.equal(3); + i.exit.y.should.equal(-2.6457513110645907); }); it('tangent', function () {
exacted one of the line circle tests a bit
apexearth_geom-collision
train
js
e9a5e9f57ff84a43ebe7bef00262b1c15f37b3d3
diff --git a/lib/mediawiki/query/properties/pages.rb b/lib/mediawiki/query/properties/pages.rb index <HASH>..<HASH> 100644 --- a/lib/mediawiki/query/properties/pages.rb +++ b/lib/mediawiki/query/properties/pages.rb @@ -23,11 +23,7 @@ module MediaWiki response['query']['pages'].each { |r, _| pageid = r } return if response['query']['pages'][pageid]['missing'] == '' - response['query']['pages'][pageid]['categories'].each do |c| - ret << c['title'] - end - - ret + response['query']['pages'][pageid].fetch('categories', []).map { |c| c['title'] } end # Gets the wiki text for the given page. Returns nil if it for some reason cannot get the text, for example,
Fix error in get_categories_in_page Now, when a page has no categories, the API doesn't even bother including "categories" in the keys for the page dict. This means that we can't expect the "categories" list to be there, so we need to use fetch instead.
FTB-Gamepedia_MediaWiki-Butt-Ruby
train
rb
5cd1cb0605adfa862ed4859ddd12148157e260dc
diff --git a/app/src/grunt/concat.js b/app/src/grunt/concat.js index <HASH>..<HASH> 100644 --- a/app/src/grunt/concat.js +++ b/app/src/grunt/concat.js @@ -21,7 +21,7 @@ module.exports = function (grunt, option) { var processLibCss = function(css, filepath) { var path = require('path'), - reDir = /(jquery-\w+|select2)/, + reDir = /(jquery[-.]\w+|select2)/, urls = [], img = {}, relativePath; @@ -38,7 +38,7 @@ module.exports = function (grunt, option) { ).replace('\\', '/'); // Generate image destination folder. - img.dir = (img.dir = reDir.exec(filepath)) ? img.dir[1] + '/' : ''; + img.dir = (img.dir = reDir.exec(filepath)) ? img.dir[1].replace(/^jquery\./, 'jquery-') + '/' : ''; for (var i in urls) { // Set up paths.
Adjust generation of assets dirname for jQuery-File-upload
bolt_bolt
train
js
e05d21098c89e2a746bd81a66d60a4dd6536cd74
diff --git a/src/Objects/DistinguishedName.php b/src/Objects/DistinguishedName.php index <HASH>..<HASH> 100644 --- a/src/Objects/DistinguishedName.php +++ b/src/Objects/DistinguishedName.php @@ -2,7 +2,7 @@ namespace Adldap\Objects; -use Adldap\Schemas\ActiveDirectory; +use Adldap\Schemas\Schema; use Adldap\Utilities; class DistinguishedName @@ -215,7 +215,7 @@ class DistinguishedName */ public function assembleCns() { - return $this->assembleRdns(ActiveDirectory::COMMON_NAME, $this->commonNames); + return $this->assembleRdns(Schema::get()->commonName(), $this->commonNames); } /** @@ -225,7 +225,7 @@ class DistinguishedName */ public function assembleOus() { - return $this->assembleRdns(ActiveDirectory::ORGANIZATIONAL_UNIT_SHORT, $this->organizationUnits); + return $this->assembleRdns(Schema::get()->organizationalUnit(), $this->organizationUnits); } /** @@ -235,7 +235,7 @@ class DistinguishedName */ public function assembleDcs() { - return $this->assembleRdns(ActiveDirectory::DOMAIN_COMPONENT, $this->domainComponents); + return $this->assembleRdns(Schema::get()->domainComponent(), $this->domainComponents); } /**
Replace AD schema with Schema object
Adldap2_Adldap2
train
php
00e69bd55271cb6fe9a47e596b1fa13b359449ed
diff --git a/ipywidgets/widgets/interaction.py b/ipywidgets/widgets/interaction.py index <HASH>..<HASH> 100644 --- a/ipywidgets/widgets/interaction.py +++ b/ipywidgets/widgets/interaction.py @@ -71,12 +71,12 @@ def _widget_abbrev_single_value(o): return Dropdown(options=o) elif isinstance(o, bool): return Checkbox(value=o) - elif isinstance(o, Real): - min, max, value = _get_min_max_value(None, None, o) - return FloatSlider(value=o, min=min, max=max) elif isinstance(o, Integral): min, max, value = _get_min_max_value(None, None, o) return IntSlider(value=o, min=min, max=max) + elif isinstance(o, Real): + min, max, value = _get_min_max_value(None, None, o) + return FloatSlider(value=o, min=min, max=max) else: return None
Reverse check for Integral and Real
jupyter-widgets_ipywidgets
train
py
bc56dd748a895c116068280a83a0f7c20193d7ae
diff --git a/assertpy/__init__.py b/assertpy/__init__.py index <HASH>..<HASH> 100644 --- a/assertpy/__init__.py +++ b/assertpy/__init__.py @@ -1 +1,2 @@ -from assertpy import assert_that, contents_of, fail, __version__ +from __future__ import absolute_import +from .assertpy import assert_that, contents_of, fail, __version__
prepare for python 3, use relative imports
ActivisionGameScience_assertpy
train
py
330546b160f6f8e8c43dadb44f0f0d216658c23b
diff --git a/lib/passphrase/version.rb b/lib/passphrase/version.rb index <HASH>..<HASH> 100644 --- a/lib/passphrase/version.rb +++ b/lib/passphrase/version.rb @@ -1,5 +1,5 @@ module Passphrase # Version numbers are bumped according to {http://semver.org Semantic # Versioning}. - VERSION = "1.2.0" + VERSION = "1.2.1" end
Bumped version number to <I>
esumbar_passphrase
train
rb
645cddbf7b9736b7c61073a95720af0ab2ae5c87
diff --git a/lib/haibu/common/index.js b/lib/haibu/common/index.js index <HASH>..<HASH> 100644 --- a/lib/haibu/common/index.js +++ b/lib/haibu/common/index.js @@ -54,7 +54,7 @@ common.showWelcome = function (role, ipAddress, port) { serverMsg = [ 'haibu'.yellow.bold, 'started @'.grey, - ipAddress.green.bold, + (ipAddress || '127.0.0.1').green.bold, 'on port'.grey, port.toString().green.bold, 'as'.grey,
[fix] Default to `<I>` in the welcome message It prevents crashes on startup when we fail to get the correct IP address. Fixes #<I>.
nodejitsu_haibu
train
js
a8a7b3a94487929f6dbcb81709ba24c14c431108
diff --git a/tests/test_node_ext.rb b/tests/test_node_ext.rb index <HASH>..<HASH> 100644 --- a/tests/test_node_ext.rb +++ b/tests/test_node_ext.rb @@ -43,7 +43,7 @@ class TestNodeExt < CiscoTestCase def test_config_get_invalid assert_raises IndexError do # no entry - node.config_get('feature', 'name') + node.config_get('foobar', 'name') end assert_raises IndexError do # entry but no config_get node.config_get('show_system', 'resources') @@ -60,7 +60,7 @@ class TestNodeExt < CiscoTestCase node.config_get_default('show_version', 'foobar') end assert_raises IndexError do # no feature entry - node.config_get_default('feature', 'name') + node.config_get_default('foobar', 'name') end assert_raises IndexError do # no default_value defined node.config_get_default('show_version', 'version') @@ -81,7 +81,7 @@ class TestNodeExt < CiscoTestCase def test_config_set_invalid assert_raises IndexError do - node.config_set('feature', 'name') + node.config_set('foobar', 'name') end assert_raises(IndexError, Cisco::UnsupportedError) do # feature exists but no config_set
Change 'feature' to 'foobar' now that we actually have 'feature'
cisco_cisco-network-node-utils
train
rb
ff1cf92944bec0f12ef9b3d37946024f67aa8a4a
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -28,6 +28,7 @@ VCR.configure do |c| c.cassette_library_dir = 'spec/cassettes' c.hook_into :webmock c.configure_rspec_metadata! - c.filter_sensitive_data('<BACKLOG_SPACE_ID>') { ENV['BACKLOG_SPACE_ID'] } + c.filter_sensitive_data('<BACKLOG_SPACE_ID>.') { "#{ENV['BACKLOG_SPACE_ID']}." } c.filter_sensitive_data('<BACKLOG_API_KEY>') { ENV['BACKLOG_API_KEY'] } + c.filter_sensitive_data('<BACKLOG_KIT_USER_AGENT>') { BacklogKit::Client::USER_AGENT } end
Tweak sensitive data filters of vcr
emsk_backlog_kit
train
rb
bb58605c540f8a9af5e7f5e7ab627dcb5dccf1a4
diff --git a/salt/modules/file.py b/salt/modules/file.py index <HASH>..<HASH> 100644 --- a/salt/modules/file.py +++ b/salt/modules/file.py @@ -4812,7 +4812,7 @@ def check_file_meta( if sfn: try: changes['diff'] = get_diff( - sfn, name, template=True, show_filenames=False) + name, sfn, template=True, show_filenames=False) except CommandExecutionError as exc: changes['diff'] = exc.strerror else:
switch order of file to be diffed
saltstack_salt
train
py
14d999a473991fd9b8292efaa1983ded1d5429f3
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -29,7 +29,7 @@ function createGzipStaticMiddleware(options, cb) { walker.on('file', function(file, stat, linkPath) { var usePath = linkPath || file; if (ignoreFile(usePath)) return; - var relName = '/' + path.relative(dir, usePath); + var relName = '/' + path.relative(dir, usePath).replace('\\', '/'); var compressedSink = new StreamSink(); var uncompressedSink = new StreamSink(); var hashSink = new StreamSink();
Support windows-paths Windows-paths (containing \) was not translated properly, which caused files in subfolders to be stored under the wrong key.
andrewrk_connect-static
train
js
f937949b421b8fe575b813a1dc27b44777989193
diff --git a/src/streamlink/plugins/adultswim.py b/src/streamlink/plugins/adultswim.py index <HASH>..<HASH> 100644 --- a/src/streamlink/plugins/adultswim.py +++ b/src/streamlink/plugins/adultswim.py @@ -14,7 +14,7 @@ class AdultSwim(Plugin): "Chrome/43.0.2357.65 Safari/537.36") API_URL = "http://www.adultswim.com/videos/api/v2/videos/{id}?fields=stream" - _url_re = re.compile(r"http://www\.adultswim\.com/videos/streams/(.*)") + _url_re = re.compile(r"https?://(?:www\.)?adultswim\.com/videos/streams/(.*)") _stream_data_re = re.compile(r".*AS_INITIAL_DATA = (\{.*?});.*", re.M | re.DOTALL) _page_data_schema = validate.Schema({
plugins.adultswim: support https urls
streamlink_streamlink
train
py
d903a963eeb3454996846811fb850ceb8c4fea81
diff --git a/plugin/health/health.go b/plugin/health/health.go index <HASH>..<HASH> 100644 --- a/plugin/health/health.go +++ b/plugin/health/health.go @@ -70,3 +70,15 @@ func (h *health) OnFinalShutdown() error { h.nlSetup = false return nil } + +func (h *health) OnReload() error { + if !h.nlSetup { + return nil + } + + h.stop() + + h.ln.Close() + h.nlSetup = false + return nil +} diff --git a/plugin/health/setup.go b/plugin/health/setup.go index <HASH>..<HASH> 100644 --- a/plugin/health/setup.go +++ b/plugin/health/setup.go @@ -20,7 +20,7 @@ func setup(c *caddy.Controller) error { h := &health{Addr: addr, lameduck: lame} c.OnStartup(h.OnStartup) - c.OnRestart(h.OnFinalShutdown) + c.OnRestart(h.OnReload) c.OnFinalShutdown(h.OnFinalShutdown) c.OnRestartFailed(h.OnStartup)
dont lameduck when reloading (#<I>)
coredns_coredns
train
go,go
fe0471bcd3a1aee715ab6e20e47e82d6305a7e63
diff --git a/lib/Widget/Db.php b/lib/Widget/Db.php index <HASH>..<HASH> 100644 --- a/lib/Widget/Db.php +++ b/lib/Widget/Db.php @@ -145,6 +145,34 @@ class Db extends AbstractWidget protected $tablePrefix; /** + * Whether use the callbacks from default db widget + * + * @var bool + */ + protected $global = false; + + /** + * Constructor + * + * @param array $options + */ + public function __construct(array $options = array()) + { + parent::__construct($options); + + // Uses callbacks from default db widget if global option is true + if (true == $this->global && $this !== $this->db) { + $callbacks = array( + 'beforeConnect', 'connectFails', 'afterConnect', + 'beforeQuery', 'afterQuery' + ); + foreach ($callbacks as $callback) { + $this->$callback = $this->db->getOption($callback); + } + } + } + + /** * Create a new instance of a SQL query builder with specified table name * * @param string $table The name of database table @@ -158,6 +186,7 @@ class Db extends AbstractWidget /** * Connect to the database server * + * @throws \PDOException When fails to connect to database server * @return boolean */ public function connect()
added global option for db widget
twinh_wei
train
php
8daf6280706df23eef21ce8403ecf8122ce98560
diff --git a/src/com/esotericsoftware/kryo/serializers/DefaultSerializers.java b/src/com/esotericsoftware/kryo/serializers/DefaultSerializers.java index <HASH>..<HASH> 100644 --- a/src/com/esotericsoftware/kryo/serializers/DefaultSerializers.java +++ b/src/com/esotericsoftware/kryo/serializers/DefaultSerializers.java @@ -267,6 +267,8 @@ public class DefaultSerializers { } // other cases, reflection try { + // Try to avoid invoking the no-args constructor + // (which is expected to initialize the instance with the current time) Constructor constructor = type.getDeclaredConstructor(long.class); if (constructor!=null) { if (!constructor.isAccessible()) {
Update to DateSerializer and new LocaleSerializer
EsotericSoftware_kryo
train
java
7759c8d60db12a03bdab7f3c2f7ff7cb7476d4fe
diff --git a/lxd/storage/drivers/driver_lvm_volumes.go b/lxd/storage/drivers/driver_lvm_volumes.go index <HASH>..<HASH> 100644 --- a/lxd/storage/drivers/driver_lvm_volumes.go +++ b/lxd/storage/drivers/driver_lvm_volumes.go @@ -142,14 +142,6 @@ func (d *lvm) CreateVolumeFromCopy(vol, srcVol Volume, copySnapshots bool, op *o // CreateVolumeFromMigration creates a volume being sent via a migration. func (d *lvm) CreateVolumeFromMigration(vol Volume, conn io.ReadWriteCloser, volTargetArgs migration.VolumeTargetArgs, preFiller *VolumeFiller, op *operations.Operation) error { - if vol.contentType != ContentTypeFS { - return ErrNotSupported - } - - if volTargetArgs.MigrationType.FSType != migration.MigrationFSType_RSYNC { - return ErrNotSupported - } - return genericCreateVolumeFromMigration(d, nil, vol, conn, volTargetArgs, preFiller, op) }
lxd/storage/drivers/driver/lvm/volumes: Removes dupe check done in genericCreateVolumeFromMigration
lxc_lxd
train
go
549abd32cb299e2c24dcc715ba5e2393338788f5
diff --git a/lib/components/client-factory.js b/lib/components/client-factory.js index <HASH>..<HASH> 100644 --- a/lib/components/client-factory.js +++ b/lib/components/client-factory.js @@ -54,9 +54,8 @@ ClientFactory.prototype.setLogFunction = function(func) { func( responsePrefix + " Error: " + JSON.stringify(err), true ); - return; } - if (httpCode >= 300 || httpCode < 200) { + else if (httpCode >= 300 || httpCode < 200) { func( responsePrefix + " Error: " + JSON.stringify(body), true );
Fix a bug which causes the request callback to not always fire If there was an error (e.g. ECONNRESET) then it would be logged but not continue through to the callback of the request (!)
matrix-org_matrix-appservice-bridge
train
js
41f7bccb249e51eeccec3f069bbea78048540258
diff --git a/pkg/tsdb/cloudmonitoring/cloudmonitoring.go b/pkg/tsdb/cloudmonitoring/cloudmonitoring.go index <HASH>..<HASH> 100644 --- a/pkg/tsdb/cloudmonitoring/cloudmonitoring.go +++ b/pkg/tsdb/cloudmonitoring/cloudmonitoring.go @@ -221,7 +221,11 @@ func (e *CloudMonitoringExecutor) executeTimeSeriesQuery(ctx context.Context, ts break } query.Params.Set("resourceType", resourceType) - queryRes.Meta.Set("deepLink", query.buildDeepLink()) + dl := "" + if len(resp.TimeSeries) > 0 { + dl = query.buildDeepLink() + } + queryRes.Meta.Set("deepLink", dl) } return result, nil
Cloud monitoring: do not create deep link if there are no timeseries (#<I>)
grafana_grafana
train
go
873c7e58367fc0cd807f9f4ef48396f48e793a2b
diff --git a/vCenterShell/bootstrap.py b/vCenterShell/bootstrap.py index <HASH>..<HASH> 100644 --- a/vCenterShell/bootstrap.py +++ b/vCenterShell/bootstrap.py @@ -50,9 +50,7 @@ class Bootstrapper(object): synchronous_task_waiter, vnic_to_network_mapper, vnic_common) - virtual_switch_to_machine_connector = VirtualSwitchToMachineConnector(py_vmomi_service, - resource_connection_details_retriever, - dv_port_group_creator, + virtual_switch_to_machine_connector = VirtualSwitchToMachineConnector(dv_port_group_creator, virtual_machine_port_group_configurer) resource_model_parser = ResourceModelParser()
refactoring and inserting logic of the selection of the first vnic
QualiSystems_vCenterShell
train
py
bb81f4c41748615b019b284094028f24ec7b97ba
diff --git a/Lib/fontmake/font_project.py b/Lib/fontmake/font_project.py index <HASH>..<HASH> 100644 --- a/Lib/fontmake/font_project.py +++ b/Lib/fontmake/font_project.py @@ -181,8 +181,7 @@ class FontProject: print '>> Loading master UFOs from Glyphs source' ufos = self.build_masters(glyphs_path, is_italic) - self.run_from_ufos(ufos, is_instance=interpolate, - kern_writer=GlyphsKernWriter, **kwargs) + self.run_from_ufos(ufos, is_instance=interpolate, **kwargs) def run_from_ufos( self, ufos, compatible=False, remove_overlaps=True, mti_source=None, @@ -248,14 +247,6 @@ class FontProject: return os.path.join(out_dir, '%s.%s' % (self._font_name(ufo), ext)) -class GlyphsKernWriter(KernFeatureWriter): - """A ufo2ft kerning feature writer which looks for UFO kerning groups with - names matching the old MMK pattern (which is used by Glyphs).""" - - leftUfoGroupRe = r"@MMK_L_(.+)" - rightUfoGroupRe = r"@MMK_R_(.+)" - - class FDKFeatureCompiler(FeatureOTFCompiler): """An OTF compiler which uses the AFDKO to compile feature syntax."""
Don't use special kern writer for Glyphs glyphs2ufo now outputs kerning rules with ufo3-style group names, so there's no need for a special kern writer class.
googlefonts_fontmake
train
py
75ef4903ef70d1e95028d0391b1f5ca8f3a4e1e1
diff --git a/src/Composer/Command/CreateProjectCommand.php b/src/Composer/Command/CreateProjectCommand.php index <HASH>..<HASH> 100644 --- a/src/Composer/Command/CreateProjectCommand.php +++ b/src/Composer/Command/CreateProjectCommand.php @@ -403,7 +403,15 @@ EOT throw new \InvalidArgumentException('Invalid stability provided ('.$stability.'), must be one of: '.implode(', ', array_keys(BasePackage::$stabilities))); } - $composer = Factory::create($io, $config->all(), $disablePlugins); + $composerJson = array_merge( + // prevent version guessing from happening + array('version' => '1.0.0'), + $config->all(), + // ensure the vendor dir and its plugins does not get loaded if CWD/vendor has plugins in it + array('config' => array('vendor-dir' => Platform::getDevNull())) + ); + $factory = new Factory; + $composer = $factory->createComposer($io, $composerJson, $disablePlugins, Platform::getDevNull(), true, $disableScripts); $config = $composer->getConfig(); $rm = $composer->getRepositoryManager();
Ensure plugins from CWD/vendor do not get loaded when running create-project, fixes #<I>
composer_composer
train
php
d22a3ef14bedbe82921e5257613306adbf5ea80c
diff --git a/lib/rubocop/cop/cop.rb b/lib/rubocop/cop/cop.rb index <HASH>..<HASH> 100644 --- a/lib/rubocop/cop/cop.rb +++ b/lib/rubocop/cop/cop.rb @@ -119,10 +119,14 @@ module Rubocop # we need to keep track of the previous token to avoid # interpreting :some_keyword as the keyword some_keyword prev = Token.new(0, :init, '') + # same goes for defs so we need to track those as well keywords = [] tokens.each do |t| keywords << t if prev.type != :on_symbeg && t.type == :on_kw + # def with name that's a kw confuses Ripper.lex + penultimate = keywords[-2] + keywords.pop if penultimate && penultimate.text == 'def' prev = t end
Handle defs with names coinciding with keywords
rubocop-hq_rubocop
train
rb
71b751e94afa0771a33281c518c634a0e3b5e483
diff --git a/cpe/comp/cpecomp2_3.py b/cpe/comp/cpecomp2_3.py index <HASH>..<HASH> 100644 --- a/cpe/comp/cpecomp2_3.py +++ b/cpe/comp/cpecomp2_3.py @@ -202,7 +202,7 @@ class CPEComponent2_3(CPEComponentSimple): def check_region_without_language(self, value): """ Check possible values in region part when language part not exist. - + Possible values of language attribute: 1=digit | *111 | *11 @@ -218,7 +218,6 @@ class CPEComponent2_3(CPEComponentSimple): region_rxc = re.compile("".join(region_pattern)) return region_rxc.match(region) - comp_str = self._encoded_value.lower() diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -11,7 +11,8 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os +import sys +import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the
Changed some file to follow PEP8
nilp0inter_cpe
train
py,py
749a3161f99a0e2e8bb3c14a05213b87a7766da9
diff --git a/moco-core/src/main/java/com/github/dreamhead/moco/dumper/HttpDumpers.java b/moco-core/src/main/java/com/github/dreamhead/moco/dumper/HttpDumpers.java index <HASH>..<HASH> 100644 --- a/moco-core/src/main/java/com/github/dreamhead/moco/dumper/HttpDumpers.java +++ b/moco-core/src/main/java/com/github/dreamhead/moco/dumper/HttpDumpers.java @@ -57,10 +57,10 @@ public final class HttpDumpers { } - private final static Joiner.MapJoiner headerJoiner = Joiner.on(StringUtil.NEWLINE).withKeyValueSeparator(": "); + private static final Joiner.MapJoiner HEAD_JOINER = Joiner.on(StringUtil.NEWLINE).withKeyValueSeparator(": "); public static String asHeaders(final HttpMessage message) { - return headerJoiner.join(from(message.getHeaders().entrySet()) + return HEAD_JOINER.join(from(message.getHeaders().entrySet()) .transformAndConcat(toMapEntries())); }
changed header joiner name to constant name
dreamhead_moco
train
java
dc3844cc2a4936f4bb423a56854cb1109deabfdf
diff --git a/Classes/Core/Testbase.php b/Classes/Core/Testbase.php index <HASH>..<HASH> 100644 --- a/Classes/Core/Testbase.php +++ b/Classes/Core/Testbase.php @@ -773,7 +773,7 @@ class Testbase */ protected function exitWithMessage($message) { - echo $message . LF; + echo $message . chr(10); exit(1); }
[BUGFIX] Remove possibly undefined constant from test bootstraps The constant LF might not be defined in functional and unit test bootstrap by the time the script terminates with an error message. Replacing the usage of this constant with the native value for a linebreak causes the same result for the error message, but prevents the additional and confusing messages about the not existing constant.
TYPO3_testing-framework
train
php
3d66576ea61d6102c1abe70f704ebc3c8a8baa57
diff --git a/main.go b/main.go index <HASH>..<HASH> 100644 --- a/main.go +++ b/main.go @@ -101,10 +101,15 @@ func main() { } sort.Strings(dirnames) for _, dir := range dirnames { + local := path.Join(prefix, dir) + if len(local) == 0 { + local = "." + } fmt.Fprintf(w, ` %q: { isDir: true, - },%s`, dir, "\n") + local: %q, + },%s`, dir, local, "\n") } fmt.Fprint(w, footer) } @@ -161,7 +166,7 @@ type _esc_file struct { } func (_esc_localFS) Open(name string) (http.File, error) { - f, present := _esc_data[name] + f, present := _esc_data[path.Clean(name)] if !present { return nil, os.ErrNotExist }
Ensure ./ == ./${PREFIX}/index.html when developing locally Using the unbundled local versions of files should behave the same as when using the bundled versions.
mjibson_esc
train
go
28b2b6fa8bc050e0dbc832c992aaf4860e81055f
diff --git a/usb1.py b/usb1.py index <HASH>..<HASH> 100644 --- a/usb1.py +++ b/usb1.py @@ -65,7 +65,7 @@ USBError = libusb1.USBError def __bindConstants(): global_dict = globals() PREFIX = 'LIBUSB_' - for name, value in libusb1.__dict__.iteritems(): + for name, value in libusb1.__dict__.items(): if name.startswith(PREFIX): name = name[len(PREFIX):] # Gah.
Fix python 3 support.
vpelletier_python-libusb1
train
py
3d04725808a0c11a258b56c4385f31678938c8dd
diff --git a/metal/analysis.py b/metal/analysis.py index <HASH>..<HASH> 100644 --- a/metal/analysis.py +++ b/metal/analysis.py @@ -326,7 +326,7 @@ def confusion_matrix(gold, pred, null_pred=False, null_gold=False, mat = mat / len(gold) if pretty_print: - conf.display() + conf.display(normalize=normalize) return mat @@ -376,7 +376,7 @@ class ConfusionMatrix(object): self.mat = mat return mat - def display(self, counts=True, indent=0, spacing=2, decimals=3, + def display(self, normalize=False, indent=0, spacing=2, decimals=3, mark_diag=True): mat = self.compile(trim=False) m, n = mat.shape @@ -402,10 +402,10 @@ class ConfusionMatrix(object): if j == 0 and not self.null_gold: continue else: - if i == j and mark_diag and not counts: + if i == j and mark_diag and normalize: s = s[:-1] + '*' - if counts: - s += f"{mat[i,j]:^5d}" + tab - else: + if normalize: s += f"{mat[i,j]/sum(mat[i,1:]):>5.3f}" + tab + else: + s += f"{mat[i,j]:^5d}" + tab print(s) \ No newline at end of file
Allow pretty-printed confusion matrix to be normalized with kwarg
HazyResearch_metal
train
py
7fbdb4d54a0564bf3dfad10780d5a96afa6c1de2
diff --git a/encoding/wkt/wkt.go b/encoding/wkt/wkt.go index <HASH>..<HASH> 100644 --- a/encoding/wkt/wkt.go +++ b/encoding/wkt/wkt.go @@ -115,6 +115,7 @@ func writeCoord(b *bytes.Buffer, coord []float64) error { return nil } +//nolint:interfacer func writeEMPTY(b *bytes.Buffer) error { _, err := b.WriteString("EMPTY") return err diff --git a/internal/cmd/parse-igc/main.go b/internal/cmd/parse-igc/main.go index <HASH>..<HASH> 100644 --- a/internal/cmd/parse-igc/main.go +++ b/internal/cmd/parse-igc/main.go @@ -19,6 +19,7 @@ func parseIGC(filename string) (*igc.T, error) { return igc.Read(f) } +//nolint:unparam func run() error { flag.Parse() for _, arg := range flag.Args() {
Ignore some lint warnings for code consistency
twpayne_go-geom
train
go,go
b7f19c884c39460f057c7ae42f966064b19f42a6
diff --git a/dev_tools/src/d1_dev/trigger-pre-commit.py b/dev_tools/src/d1_dev/trigger-pre-commit.py index <HASH>..<HASH> 100755 --- a/dev_tools/src/d1_dev/trigger-pre-commit.py +++ b/dev_tools/src/d1_dev/trigger-pre-commit.py @@ -121,9 +121,17 @@ def trigger_all_pre_commit_hooks(trigger_path_list): def trigger_pre_commit_hook(trigger_path): try: - res_str = subprocess.check_output([ - 'pre-commit', 'run', '--verbose', '--no-stash', '--files', trigger_path - ], stderr=subprocess.STDOUT) + res_str = subprocess.check_output( + [ + # '--no-stash', + 'pre-commit', + 'run', + '--verbose', + '--files', + trigger_path + ], + stderr=subprocess.STDOUT + ) except subprocess.CalledProcessError as e: res_str = e.output
Update for changed parameter in pre-commit
DataONEorg_d1_python
train
py
b0b53090b977db250baa67d8ee35fb0fd08c3d7b
diff --git a/src/main/groovy/groovy/lang/GroovyClassLoader.java b/src/main/groovy/groovy/lang/GroovyClassLoader.java index <HASH>..<HASH> 100644 --- a/src/main/groovy/groovy/lang/GroovyClassLoader.java +++ b/src/main/groovy/groovy/lang/GroovyClassLoader.java @@ -801,7 +801,7 @@ public class GroovyClassLoader extends URLClassLoader { protected Class recompile(URL source, String className, Class oldClass) throws CompilationFailedException, IOException { if (source != null) { // found a source, compile it if newer - if ((oldClass != null && isSourceNewer(source, oldClass)) || (oldClass == null)) { + if (oldClass == null || isSourceNewer(source, oldClass)) { String name = source.toExternalForm(); sourceCache.remove(name);
Trivial refactoring: simplify the condition expression
apache_groovy
train
java