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
db8930d534e400299bf8ebb814449e101e6f6fbc
diff --git a/cassiopeia/type/core/common.py b/cassiopeia/type/core/common.py index <HASH>..<HASH> 100644 --- a/cassiopeia/type/core/common.py +++ b/cassiopeia/type/core/common.py @@ -371,6 +371,7 @@ class GameMode(enum.Enum): assassinate = "ASSASSINATE" dark_star = "DARKSTAR" arsr = "ARSR" + doom_bots = "DOOMBOTSTEEMO" class GameType(enum.Enum):
added doom boots game mode. fixes #<I>
meraki-analytics_cassiopeia
train
py
86fdbbdf6ab745c92ae02dbdbe8db5e89836b18e
diff --git a/test/bagofholding.js b/test/bagofholding.js index <HASH>..<HASH> 100644 --- a/test/bagofholding.js +++ b/test/bagofholding.js @@ -1,5 +1,4 @@ var bag = require('../lib/bagofholding'), - mocha = require('mocha'), sandbox = require('sandboxed-module'), should = require('should'), checks, mocks; diff --git a/test/mock.js b/test/mock.js index <HASH>..<HASH> 100644 --- a/test/mock.js +++ b/test/mock.js @@ -1,5 +1,4 @@ var bag = require('bagofholding'), - mocha = require('mocha'), sandbox = require('sandboxed-module'), should = require('should'), checks, mocks, diff --git a/test/obj.js b/test/obj.js index <HASH>..<HASH> 100644 --- a/test/obj.js +++ b/test/obj.js @@ -1,5 +1,4 @@ var bag = require('bagofholding'), - mocha = require('mocha'), sandbox = require('sandboxed-module'), should = require('should'), checks, mocks;
And obviously mocha is also unnecessary.
cliffano_bagofholding
train
js,js,js
0fd0eb8529b0a00b92c7172e7be3eaced97dc988
diff --git a/lib/form.js b/lib/form.js index <HASH>..<HASH> 100644 --- a/lib/form.js +++ b/lib/form.js @@ -32,9 +32,9 @@ _.extend(Form.prototype, { var methods = ['get', 'post', 'put', 'delete']; _.each(methods, function (method) { if (typeof this[method] === 'function') { - this.router[method]('/', this[method].bind(this)); + this.router[method]('*', this[method].bind(this)); } else { - this.router[method]('/', function (req, res, next) { + this.router[method]('*', function (req, res, next) { var err = new Error('Method not supported'); err.statusCode = 405; next(err); diff --git a/test/spec/spec.form.js b/test/spec/spec.form.js index <HASH>..<HASH> 100644 --- a/test/spec/spec.form.js +++ b/test/spec/spec.form.js @@ -50,6 +50,7 @@ describe('Form Controller', function () { // use a spy instead of a stub so that the length is unaffected sinon.spy(form, 'errorHandler'); req = request({ + url: '/test', params: {} }), res = {
Bind route handlers onto all urls We need to be able to bind onto any paths, not just '/'
UKHomeOffice_passports-form-controller
train
js,js
7d2d2ec035b58770e3be67d38201757e8addadf8
diff --git a/core/src/main/java/io/grpc/internal/ClientCallImpl.java b/core/src/main/java/io/grpc/internal/ClientCallImpl.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/io/grpc/internal/ClientCallImpl.java +++ b/core/src/main/java/io/grpc/internal/ClientCallImpl.java @@ -452,7 +452,7 @@ final class ClientCallImpl<ReqT, RespT> extends ClientCall<ReqT, RespT> { checkArgument(numMessages >= 0, "Number requested must be non-negative"); stream.request(numMessages); } finally { - PerfMark.stopTask("ClientCall.cancel", tag); + PerfMark.stopTask("ClientCall.request", tag); } }
core: fix PerfMark task mismatch (#<I>)
grpc_grpc-java
train
java
ae0dbd48d713daab835012ea0fcbb4d80af6ba20
diff --git a/library/CM/App.php b/library/CM/App.php index <HASH>..<HASH> 100644 --- a/library/CM/App.php +++ b/library/CM/App.php @@ -23,6 +23,7 @@ class CM_App { CM_Util::mkDir(DIR_DATA_LOCKS); CM_Util::mkDir(DIR_DATA_LOG); CM_Util::mkDir(DIR_USERFILES); + $this->resetTmp(); } /**
Reset TMP within setupFilesystem
cargomedia_cm
train
php
6420cc8831c1cb94b834d5d193adfd395e5f0356
diff --git a/test/unit/engine_runtime.js b/test/unit/engine_runtime.js index <HASH>..<HASH> 100644 --- a/test/unit/engine_runtime.js +++ b/test/unit/engine_runtime.js @@ -246,7 +246,7 @@ test('Disposing the runtime emits an event', t => { rt.addListener('RUNTIME_DISPOSED', () => { disposed = true; }); - rt.start(); + rt.dispose(); t.equal(disposed, true); t.end(); });
Update test/unit/engine_runtime.js
LLK_scratch-vm
train
js
1ede725759219f6ba539ffb02d90378657ec9003
diff --git a/core/src/main/java/org/eobjects/analyzer/util/NullTolerableComparator.java b/core/src/main/java/org/eobjects/analyzer/util/NullTolerableComparator.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/eobjects/analyzer/util/NullTolerableComparator.java +++ b/core/src/main/java/org/eobjects/analyzer/util/NullTolerableComparator.java @@ -19,6 +19,7 @@ */ package org.eobjects.analyzer.util; +import java.io.Serializable; import java.util.Comparator; /** @@ -30,9 +31,11 @@ import java.util.Comparator; * @param <E> * any comparable type */ -public class NullTolerableComparator<E extends Comparable<? super E>> implements Comparator<E> { +public class NullTolerableComparator<E extends Comparable<? super E>> implements Comparator<E>, Serializable { - public static <E extends Comparable<? super E>> Comparator<E> get(Class<E> clazz) { + private static final long serialVersionUID = 1L; + + public static <E extends Comparable<? super E>> Comparator<E> get(Class<E> clazz) { return new NullTolerableComparator<E>(); }
Ticket #<I>: Fixed serialization of NullTolerableComparator
datacleaner_AnalyzerBeans
train
java
bf2c279605412a4614376ffb2597b40ef42cc179
diff --git a/config/wdio.conf.js b/config/wdio.conf.js index <HASH>..<HASH> 100644 --- a/config/wdio.conf.js +++ b/config/wdio.conf.js @@ -10,6 +10,8 @@ const workfloConf = require(process.env.WORKFLO_CONFIG) const jsonfile = require('jsonfile') const copyFolderRecursiveSync = require('../dist/lib/io.js').copyFolderRecursiveSync +const workfloMatcherNames = [ 'toExist' ] + let screenshotIdCtr = 1 let errorScreenshotFilename let errorType @@ -101,6 +103,11 @@ exports.config = { assertion.specObj = process.workflo.specObj } + if (assertion.matcherName && workfloMatcherNames.indexOf(assertion.matcherName) >= 0 ) { + delete assertion.actual + delete assertion.expected + } + if (passed) { process.send({event: 'validate:success', assertion: assertion})
prepared wdio.conf.js for custom matchers
flohil_wdio-workflo
train
js
9deecf7150f25e1c39ec461f09408fdfbb750ab9
diff --git a/integration-tests/HooksRunner.spec.js b/integration-tests/HooksRunner.spec.js index <HASH>..<HASH> 100644 --- a/integration-tests/HooksRunner.spec.js +++ b/integration-tests/HooksRunner.spec.js @@ -389,4 +389,18 @@ describe('HooksRunner', function () { return hooksRunner.fire('CLEAN YOUR SHORTS GODDAMNIT LIKE A BIG BOY!', hookOptions); }); }); + + describe('extractSheBangInterpreter', () => { + const rewire = require('rewire'); + const HooksRunner = rewire('../src/hooks/HooksRunner'); + const extractSheBangInterpreter = HooksRunner.__get__('extractSheBangInterpreter'); + + it('Test 025 : should not read uninitialized buffer contents', () => { + spyOn(require('fs'), 'readSync').and.callFake((fd, buf) => { + buf.write('#!/usr/bin/env XXX\n# foo'); + return 0; + }); + expect(extractSheBangInterpreter(__filename)).toBeFalsy(); + }); + }); });
Add test for obscure HooksRunner bug (#<I>)
apache_cordova-lib
train
js
378dc125ab5abd9eacfa28eacbea232e64344213
diff --git a/src/Adapter.php b/src/Adapter.php index <HASH>..<HASH> 100644 --- a/src/Adapter.php +++ b/src/Adapter.php @@ -381,13 +381,13 @@ class Adapter extends AbstractAdapter { $stat = $this->getMetadata($path); - if (isset($stat['authority']) && $stat['authority'] === 'eWPrivateRPublic') { - return ['visibility' => AdapterInterface::VISIBILITY_PUBLIC]; - } + if (isset($stat['authority']) && $stat['authority'] === 'eWPrivateRPublic') { + return ['visibility' => AdapterInterface::VISIBILITY_PUBLIC]; + } - if (isset($stat['authority']) && $stat['authority'] === 'eWPrivateRPublic') { - return ['visibility' => AdapterInterface::VISIBILITY_PRIVATE]; - } + if (isset($stat['authority']) && $stat['authority'] === 'eWPrivateRPublic') { + return ['visibility' => AdapterInterface::VISIBILITY_PRIVATE]; + } return false; }
Apply fixes from StyleCI (#<I>)
freyo_flysystem-qcloud-cos-v4
train
php
2d05ccac7f8be87ac5bcbe627d74f732aa4360cc
diff --git a/python/ccxt/base/exchange.py b/python/ccxt/base/exchange.py index <HASH>..<HASH> 100644 --- a/python/ccxt/base/exchange.py +++ b/python/ccxt/base/exchange.py @@ -2436,11 +2436,12 @@ class Exchange(object): cost = Precise.string_mul(price, filled) else: cost = Precise.string_mul(average, filled) - # futures trading ) - if self.safe_string(market, 'contractSize') is not None: + # contract trading ) + contractSize = self.safe_string(market, 'contractSize') + if contractSize is not None: if market['inverse']: cost = Precise.string_div('1', cost, 8) - cost = Precise.string_mul(cost, market['contractSize']) + cost = Precise.string_mul(cost, contractSize) # support for market orders orderType = self.safe_value(order, 'type') emptyPrice = (price is None) or Precise.string_equals(price, '0')
exchange.py contractSize refix
ccxt_ccxt
train
py
07c30bebd1d44ffd2147167bff724fb46f17efa1
diff --git a/src/js/jquery.extensions.js b/src/js/jquery.extensions.js index <HASH>..<HASH> 100644 --- a/src/js/jquery.extensions.js +++ b/src/js/jquery.extensions.js @@ -50,7 +50,7 @@ if (typeof str !== 'string') str = String(str); if(str && str.length) { for(var i = 0; i < str.length; ++i) { - code += i * str.charCodeAt(i); + code += (i + 1) * str.charCodeAt(i); } } return code;
* prevent return zero with only char in strToCode helper.
easysoft_zui
train
js
b1f41d608f189c72c990eca542e02c0ef9f17652
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -11,10 +11,14 @@ module.exports = { }, get: function (key) { const ns = cls.getNamespace(nsid); - return ns.get(key); + if (ns.active) { + return ns.get(key); + } }, set: function (key, value) { const ns = cls.getNamespace(nsid); - return ns.set(key, value); + if (ns.active) { + return ns.set(key, value); + } } }
fix: don't error when outside of request
skonves_express-http-context
train
js
0d4484dc9b6eeb7b35818015d63d41aced2bccfa
diff --git a/test/Unit/Loop/Bridge/React/ReactLoopTest.php b/test/Unit/Loop/Bridge/React/ReactLoopTest.php index <HASH>..<HASH> 100644 --- a/test/Unit/Loop/Bridge/React/ReactLoopTest.php +++ b/test/Unit/Loop/Bridge/React/ReactLoopTest.php @@ -256,6 +256,10 @@ class ReactLoopTest extends TestCase public function testApiTick_NeverTicksLoop() { + $this->markTestSkipped( + 'Seems there is a problem with PHPUnit 5.2 compatibility here.' + ); + $loop = $this->createLoopMock(); $react = new ReactLoop($loop); @@ -268,6 +272,10 @@ class ReactLoopTest extends TestCase public function testApiRun_NeverRunsLoop() { + $this->markTestSkipped( + 'Seems there is a problem with PHPUnit 5.2 compatibility here.' + ); + $loop = $this->createLoopMock(); $react = new ReactLoop($loop); @@ -280,6 +288,10 @@ class ReactLoopTest extends TestCase public function testApiStop_NeverStopsLoop() { + $this->markTestSkipped( + 'Seems there is a problem with PHPUnit 5.2 compatibility here.' + ); + $loop = $this->createLoopMock(); $react = new ReactLoop($loop);
KRF-<I> #fix Skipped tests that were incompatible with PHPUnit <I> for further research
kraken-php_framework
train
php
a1b465b81b023e846823e71538dbd2cbaccb2181
diff --git a/django_admin_bootstrapped/templatetags/bootstrapped_goodies_tags.py b/django_admin_bootstrapped/templatetags/bootstrapped_goodies_tags.py index <HASH>..<HASH> 100644 --- a/django_admin_bootstrapped/templatetags/bootstrapped_goodies_tags.py +++ b/django_admin_bootstrapped/templatetags/bootstrapped_goodies_tags.py @@ -36,4 +36,4 @@ def language_selector(context): @register.filter(name='column_width') def column_width(value): - return 12/len(list(value)) \ No newline at end of file + return 12 // len(list(value))
Fix column_width filter in python3 Force integer division otherwise we'll fsck bootstrap classes As seen here: <URL>
django-admin-bootstrapped_django-admin-bootstrapped
train
py
393df9516ce8692ad43bc014ed27025aa4a2eb3a
diff --git a/lib/profile_helpers.js b/lib/profile_helpers.js index <HASH>..<HASH> 100644 --- a/lib/profile_helpers.js +++ b/lib/profile_helpers.js @@ -143,7 +143,6 @@ exports.ProfileHelpers = (Base = Object) => class extends Base { this.mixpanel.send_request({ method: "GET", endpoint: this.endpoint, data }, callback); } - // used internally by mixpanel.people.union and mixpanel.groups.union _union({identifiers, data, modifiers, callback}) { let $union = {}; @@ -196,7 +195,6 @@ exports.ProfileHelpers = (Base = Object) => class extends Base { this.mixpanel.send_request({ method: "GET", endpoint: this.endpoint, data }, callback); } - // used internally by mixpanel.people.unset and mixpanel.groups.unset _unset({identifiers, prop, modifiers, callback}){ let $unset = [];
missed a few deprecated comments
mixpanel_mixpanel-node
train
js
8e038a220d347759ee29c6ec6da17f042bbde3e6
diff --git a/plugins/maven-dependency-resolver/src/main/java/org/robolectric/internal/dependency/MavenDependencyResolver.java b/plugins/maven-dependency-resolver/src/main/java/org/robolectric/internal/dependency/MavenDependencyResolver.java index <HASH>..<HASH> 100755 --- a/plugins/maven-dependency-resolver/src/main/java/org/robolectric/internal/dependency/MavenDependencyResolver.java +++ b/plugins/maven-dependency-resolver/src/main/java/org/robolectric/internal/dependency/MavenDependencyResolver.java @@ -146,7 +146,12 @@ public class MavenDependencyResolver implements DependencyResolver { if (nodeList.getLength() != 0) { Node node = nodeList.item(0); - return node.getTextContent().trim(); + String repository = node.getTextContent(); + + if (repository == null) { + return null; + } + return repository.trim(); } } catch (ParserConfigurationException | IOException | SAXException e) { Logger.error("Error reading settings.xml", e);
Handling the NPE during the repository string trimming.
robolectric_robolectric
train
java
43f65e904d9a26f127d64ed8dc6ef82275810cf0
diff --git a/openquake/engine/tools/dump_hazards.py b/openquake/engine/tools/dump_hazards.py index <HASH>..<HASH> 100644 --- a/openquake/engine/tools/dump_hazards.py +++ b/openquake/engine/tools/dump_hazards.py @@ -88,10 +88,13 @@ class Copier(object): """ fname = os.path.join(dest, name + '.gz') log.info('%s\n(-> %s)', query, fname) - with gzip.open(fname, mode) as f: - self._cursor.copy_expert(query, f) - if fname not in self.filenames: - self.filenames.append(fname) + TIMESTAMP = 1378800715.0 # some fake timestamp + # here is some trick to avoid storing filename and timestamp info + with open(fname, mode) as fileobj: + with gzip.GzipFile('', fileobj=fileobj, mtime=TIMESTAMP) as z: + self._cursor.copy_expert(query, z) + if fname not in self.filenames: + self.filenames.append(fname) class HazardDumper(object):
Some trick to avoid storing filename and timestamp information in the .gz archive
gem_oq-engine
train
py
6258dedb2f4cdaf8289fd4f378befbdc50885c01
diff --git a/minify.js b/minify.js index <HASH>..<HASH> 100644 --- a/minify.js +++ b/minify.js @@ -8,7 +8,6 @@ var DIR = __dirname +'/', LIBDIR = DIR + 'lib/', os = require('os'), - TMPDIR = os.tmpdir(), main = require(LIBDIR + 'main'), img = main.require(LIBDIR + 'img'), @@ -17,7 +16,14 @@ path = main.path, Util = main.util, + TMPDIR, MinFolder; + + if (os.tmpdir) { + TMPDIR = os.tmpdir(); MinFolder = TMPDIR + '/minify/'; + } else { + MinFolder = DIR + '/min/'; + } /* Trying to create folder min * where woud be minifyed versions
fix(minify) check is tmpdir exists
coderaiser_minify
train
js
80af29d7bbc7ef0b4ab213061a7576dfb9d75028
diff --git a/Factory.php b/Factory.php index <HASH>..<HASH> 100644 --- a/Factory.php +++ b/Factory.php @@ -10,6 +10,7 @@ class Factory { $request = new Request; $router = new Router($request); + Helper::init($router, $request); return $router; }
Initiate the helper in the factory
SlaxWeb_Router
train
php
22d94793419353535efa9c007e89a40062546d0f
diff --git a/app/helpers/bootstrap_helper.rb b/app/helpers/bootstrap_helper.rb index <HASH>..<HASH> 100644 --- a/app/helpers/bootstrap_helper.rb +++ b/app/helpers/bootstrap_helper.rb @@ -15,7 +15,8 @@ module BootstrapHelper else action = action_or_title || action_name if action.to_s == 'show' && defined?(resource) && resource.present? - title = resource.to_s + title = resource.display_name if resource.respond_to?(:display_name) + title ||= resource.to_s else title = t_title(action, model) end
Support display_name in boot_page_title if provided.
huerlisi_i18n_rails_helpers
train
rb
bd85b2034e593d19acd15281ccbb5acabff860b4
diff --git a/lib/html_massage.rb b/lib/html_massage.rb index <HASH>..<HASH> 100644 --- a/lib/html_massage.rb +++ b/lib/html_massage.rb @@ -2,7 +2,7 @@ require "cgi" require "nokogiri" require "sanitize" require "html_massage/version" -require "html_massage/old_api/old_api" +#require "html_massage/old_api/old_api" module HtmlMassager
Comment out old_api reference -- does not yet exist
harlantwood_html_massage
train
rb
fb55236f2ac5e275fb763284cce10228f9fd4b87
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -62,7 +62,7 @@ exports['Add Location'] = function(test) { test.expect(1); - proximity.addLocation("Toronto", 43.6667, -79.4167, function(err, reply) { + proximity.addLocation(43.6667, -79.4167, "Toronto", function(err, reply) { if (err) throw err; test.equal(reply, 1); test.done();
Fixing addLocation test for defined API in readme.
arjunmehta_node-geo-proximity
train
js
eda18f694a77484fe242d4af4dd4eef3b708a14b
diff --git a/symphony/lib/toolkit/class.databasetabularresult.php b/symphony/lib/toolkit/class.databasetabularresult.php index <HASH>..<HASH> 100644 --- a/symphony/lib/toolkit/class.databasetabularresult.php +++ b/symphony/lib/toolkit/class.databasetabularresult.php @@ -1,5 +1,6 @@ <?php + /** * @package toolkit */ @@ -197,7 +198,7 @@ class DatabaseTabularResult extends DatabaseStatementResult implements IteratorA if (!isset($row[$col])) { throw new DatabaseStatementException("Row does not have column `$col`"); } - $index[$row[$col]] = $row; + $index[$row[$col]][] = $row; } return $index; }
Fix bug where rows were being replaced Picked from 2ad8a<I>cc8 Picked from 5a1b<I>fbe
symphonycms_symphony-2
train
php
fa64a5f7b8a59745b6363a8fc7c4c9beb5edc6f7
diff --git a/telethon/telegram_bare_client.py b/telethon/telegram_bare_client.py index <HASH>..<HASH> 100644 --- a/telethon/telegram_bare_client.py +++ b/telethon/telegram_bare_client.py @@ -299,6 +299,13 @@ class TelegramBareClient: self.disconnect() return self.connect() + def set_proxy(proxy): + """Change the proxy used by the connections. + """ + if self.is_connected(): + raise RuntimeError("You can't change the proxy while connected.") + self._sender.connection.conn.proxy = proxy + # endregion # region Working with different connections/Data Centers
TelegramBareClient: Add set_proxy() method This allows to change proxy without recreation of the client instance.
LonamiWebs_Telethon
train
py
d231ab443f7f434c74d5e2b7f23d4cbea51bd8d7
diff --git a/lib/Core/Repository/Aggregate/Repository.php b/lib/Core/Repository/Aggregate/Repository.php index <HASH>..<HASH> 100644 --- a/lib/Core/Repository/Aggregate/Repository.php +++ b/lib/Core/Repository/Aggregate/Repository.php @@ -6,6 +6,7 @@ use eZ\Publish\API\Repository\Repository as RepositoryInterface; use eZ\Publish\API\Repository\Values\ValueObject; use eZ\Publish\API\Repository\Values\User\UserReference; use Closure; +use RuntimeException; /** * Aggregate implementation of Repository interface. @@ -78,6 +79,15 @@ class Repository implements RepositoryInterface return $this->ezRepository->canUser($module, $function, $object, $targets); } + public function getBookmarkService() + { + if (!method_exists($this->ezRepository, 'getBookmarkService')) { + throw new RuntimeException(sprintf('getBookmarkService method does not exist in %s class', get_class($this->ezRepository))); + } + + return $this->ezRepository->getBookmarkService(); + } + public function getContentService() { return $this->ezRepository->getContentService();
Add getBookmarkService method to aggregate repository
netgen_ezplatform-site-api
train
php
bd09eda68c693e54c98f78e4385529dba1485d64
diff --git a/src/views/api/index.blade.php b/src/views/api/index.blade.php index <HASH>..<HASH> 100644 --- a/src/views/api/index.blade.php +++ b/src/views/api/index.blade.php @@ -66,6 +66,6 @@ endif; ?> </tbody> </table> - {!! $contents->links() !!} + {!! $contents !!} </div> </div> diff --git a/src/views/posts.blade.php b/src/views/posts.blade.php index <HASH>..<HASH> 100644 --- a/src/views/posts.blade.php +++ b/src/views/posts.blade.php @@ -16,6 +16,6 @@ @endforeach </ul> - {!! $posts->links() !!} + {!! $posts !!} </section> @stop
Paginator now autocast to string.
orchestral_story
train
php,php
82604ee801566773b5c5423d75e65259b076fccf
diff --git a/channel.go b/channel.go index <HASH>..<HASH> 100644 --- a/channel.go +++ b/channel.go @@ -12,7 +12,6 @@ type Channel struct { IsPrivate bool `json:"is_private"` LastMessageID string `json:"last_message_id"` Recipient User `json:"recipient"` - Session *Session } // A PermissionOverwrite holds permission overwrite data for a Channel
Removed unneeded Session variable.
bwmarrin_discordgo
train
go
bc0f98c0b2773c196a2daf94edfb477fea0cfc33
diff --git a/atmos/util.py b/atmos/util.py index <HASH>..<HASH> 100644 --- a/atmos/util.py +++ b/atmos/util.py @@ -62,8 +62,9 @@ def assumption_list_string(assumptions, assumption_dict): if isinstance(assumptions, six.string_types): raise TypeError('assumptions must be an iterable of strings, not a ' 'string itself') - if any([a not in assumption_dict.keys() for a in assumptions]): - raise ValueError('{} not present in assumption_dict'.format(a)) + for a in assumptions: + if a not in assumption_dict.keys(): + raise ValueError('{} not present in assumption_dict'.format(a)) assumption_strings = [assumption_dict[a] for a in assumptions] return strings_to_list_string(assumption_strings)
finished 2 to 3 correction from previous commit
atmos-python_atmos
train
py
487d01a47c316af25126306353fe1ba984a355d7
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -25,10 +25,6 @@ module.exports = function(PouchToUse) { return app; }; -function isPouchError(obj) { - return obj.error && obj.error === true; -} - function registerDB(name, db) { db.installValidationMethods(); dbs[name] = db; @@ -122,7 +118,7 @@ app.use(function (req, res, next) { var send = res.send; res.send = function() { var args = Array.prototype.slice.call(arguments).map(function (arg) { - if (typeof arg === 'object' && isPouchError(arg)) { + if (arg && arg.name && arg.message) { var _arg = { error: arg.name, reason: arg.message
(pouchdb/pouchdb#<I>) - better error handling
pouchdb_pouchdb-server
train
js
a1c313ba3b618c4ac40fff39761d9735501150bc
diff --git a/tacl/constants.py b/tacl/constants.py index <HASH>..<HASH> 100644 --- a/tacl/constants.py +++ b/tacl/constants.py @@ -389,9 +389,13 @@ SUPPLIED_EPILOG = '''\ files. The first label is assigned to all results in the first results file, the second label to all results in the second results file, etc. The labels specified in the results files are - replaced with the supplied labels in the output.''' -SUPPLIED_DIFF_EPILOG = SUPPLIED_EPILOG.format('sdiff') -SUPPLIED_INTERSECT_EPILOG = SUPPLIED_EPILOG.format('sintersect') + replaced with the supplied labels in the output. + + examples: + + tacl {cmd} -d cbeta2-10.db -l A B -s results1.csv results2.csv > output.csv''' +SUPPLIED_DIFF_EPILOG = SUPPLIED_EPILOG.format(cmd='sdiff') +SUPPLIED_INTERSECT_EPILOG = SUPPLIED_EPILOG.format(cmd='sintersect') SUPPLIED_INTERSECT_DESCRIPTION = '''\ List n-grams common to all sets of results (as defined by the specified results files).'''
Added example invocations for sdiff and sintersect.
ajenhl_tacl
train
py
0691e493a51ebf292b5a7dbf46ff87684e152a3a
diff --git a/framework/core/js/forum/src/components/PostStream.js b/framework/core/js/forum/src/components/PostStream.js index <HASH>..<HASH> 100644 --- a/framework/core/js/forum/src/components/PostStream.js +++ b/framework/core/js/forum/src/components/PostStream.js @@ -343,14 +343,14 @@ class PostStream extends mixin(Component, evented) { }; redraw(); - this.pagesLoading++; - this.loadPageTimeouts[start] = setTimeout(() => { this.loadRange(start, end).then(() => { redraw(); this.pagesLoading--; }); }, this.pagesLoading ? 1000 : 0); + + this.pagesLoading++; } /**
Start loading the next page of posts immediately
flarum_core
train
js
8292ffb747252f197dbcfc217a3ad89b8d275913
diff --git a/hypervisor/qemu/qemu.go b/hypervisor/qemu/qemu.go index <HASH>..<HASH> 100644 --- a/hypervisor/qemu/qemu.go +++ b/hypervisor/qemu/qemu.go @@ -283,10 +283,13 @@ func (qc *QemuContext) AddNic(ctx *hypervisor.VmContext, host *hypervisor.HostNi go func() { // close tap file if necessary ev, ok := <-waitChan - syscall.Close(fd) if !ok { + syscall.Close(fd) close(result) } else { + if _, ok := ev.(*hypervisor.DeviceFailed); ok { + syscall.Close(fd) + } result <- ev } }()
qemu: only close tap fd on addnic failure It causes various bizarre CI failures mostly pulling image failures.
hyperhq_runv
train
go
59a4dfe9f37273937e6b2916d36ba4c96c9bc779
diff --git a/pcef/panels/lines.py b/pcef/panels/lines.py index <HASH>..<HASH> 100644 --- a/pcef/panels/lines.py +++ b/pcef/panels/lines.py @@ -81,12 +81,15 @@ class LineNumberPanel(Panel): painter_drawText = painter.drawText align_right = Qt.AlignRight normal_font = painter.font() + normal_font.setBold(False) bold_font = QFont(normal_font) bold_font.setBold(True) + bold_font.setItalic(True) active = self.editor.codeEdit.textCursor().blockNumber() for vb in self.editor.codeEdit.visible_blocks: row = vb.row if row == active + 1: + print "bold", row painter.setFont(bold_font) else: painter.setFont(normal_font)
Make current line nbr italic
pyQode_pyqode.core
train
py
c956bedf5bb6ca86a1f6370f5c6ef752183a96cf
diff --git a/lib/active_job/retry.rb b/lib/active_job/retry.rb index <HASH>..<HASH> 100644 --- a/lib/active_job/retry.rb +++ b/lib/active_job/retry.rb @@ -84,16 +84,10 @@ module ActiveJob ########################## # Override `rescue_with_handler` to make sure our catch is before callbacks, - # so only run when the job is finally failing. + # so `rescue_from`s will only be run after any retry attempts have been exhausted. def rescue_with_handler(exception) - retry_or_reraise(exception) || super(exception) - end - - private - - def retry_or_reraise(exception) unless self.class.backoff_strategy.should_retry?(retry_attempt, exception) - return false + return super end this_delay = self.class.backoff_strategy.retry_delay(retry_attempt, exception)
Tidy up rescuing after retry
isaacseymour_activejob-retry
train
rb
e46685be7c8016bdebfd887dd32cefe627de5955
diff --git a/packages/type/src/fluid.js b/packages/type/src/fluid.js index <HASH>..<HASH> 100644 --- a/packages/type/src/fluid.js +++ b/packages/type/src/fluid.js @@ -82,5 +82,5 @@ function fluidTypeSize(defaultStyles, fluidBreakpointName, fluidBreakpoints) { } function subtract(a, b) { - return parseFloat(a, 10) - parseFloat(b, 10); + return parseFloat(a) - parseFloat(b); }
fix(type): parseFloat only has one parameter (#<I>) It doesn't take a radix like parseInt does 🤷‍♂️
carbon-design-system_carbon-elements
train
js
267e53a596171d67f5756f72fd9e0b0b4dde6364
diff --git a/public/js/render/console.js b/public/js/render/console.js index <HASH>..<HASH> 100644 --- a/public/js/render/console.js +++ b/public/js/render/console.js @@ -390,7 +390,7 @@ var jsconsole = { sandbox = sandboxframe.contentDocument || sandboxframe.contentWindow.document; sandbox.open(); // stupid jumping through hoops if Firebug is open, since overwriting console throws error - sandbox.write('<script>(function () { var fakeConsole = ' + fakeConsole + '; if (console != undefined) { for (var k in fakeConsole) { console[k] = fakeConsole[k]; } } else { console = fakeConsole; } })();</script>'); + sandbox.write('<script>(function () { var fakeConsole = ' + fakeConsole + '; if (window.console != undefined) { for (var k in fakeConsole) { console[k] = fakeConsole[k]; } } else { console = fakeConsole; } })();</script>'); sandbox.write('<script>window.print=function(){};window.alert=function(){};window.prompt=function(){};window.confirm=function(){};</script>'); sandbox.close();
Cleaner test for console #<I>
jsbin_jsbin
train
js
d00999a8f0fd62013098f0f4a66475867160252a
diff --git a/src/pyrocore/util/metafile.py b/src/pyrocore/util/metafile.py index <HASH>..<HASH> 100644 --- a/src/pyrocore/util/metafile.py +++ b/src/pyrocore/util/metafile.py @@ -327,7 +327,7 @@ def add_fast_resume(meta, datapath): # Get the path into the filesystem filepath = os.sep.join(fileinfo["path"]) if not single: - filepath = os.path.join(datapath, filepath.strip(os.sep)) + filepath = os.path.join(datapath, fmt.to_utf8(filepath.strip(os.sep))) # Check file size if os.path.getsize(filepath) != fileinfo["length"]:
fix for unicode handling of metafile paths
pyroscope_pyrocore
train
py
0ee1b4ef4dc83a17ef6f412510bd24855b3587d2
diff --git a/export.go b/export.go index <HASH>..<HASH> 100644 --- a/export.go +++ b/export.go @@ -126,6 +126,23 @@ func (conn *Conn) handleCall(msg *Message) { conn.sendError(errmsgUnknownMethod, sender, serial) } return + } else if ifaceName == "org.freedesktop.DBus.Introspectable" && name == "Introspect" { + if _, ok := conn.handlers[path]; !ok { + xml := "<node>" + for h, _ := range conn.handlers { + p := string(path) + if p != "/" { + p += "/" + } + if strings.HasPrefix(string(h), p) { + node_name := strings.Split(string(h[len(p):]), "/")[0] + xml = xml + "\n <node name=\"" + node_name + "\"/>" + } + } + xml += "\n</node>" + conn.sendReply(sender, serial, xml) + return + } } if len(name) == 0 { conn.sendError(errmsgUnknownMethod, sender, serial)
honor introspection calls on sub path of every exported object
godbus_dbus
train
go
c6fff172cfc9eb6db3b465bb2c610da754bb8b20
diff --git a/lib/pairwise/ipo.rb b/lib/pairwise/ipo.rb index <HASH>..<HASH> 100644 --- a/lib/pairwise/ipo.rb +++ b/lib/pairwise/ipo.rb @@ -30,20 +30,24 @@ module Pairwise end def replace_wild_cards(input_combinations) - map_each_input_value(input_combinations) do |input_value, index| - if input_value == WILD_CARD - if @list_of_input_values[index].length == 1 - @list_of_input_values[index][0] - else - pick_random_value(@list_of_input_values[index]) - end + map_wild_cards(input_combinations) do |_, index| + if @list_of_input_values[index].length == 1 + @list_of_input_values[index][0] else - input_value + pick_random_value(@list_of_input_values[index]) + end + end + end + + def map_wild_cards(input_combinations) + input_combinations.map do |input_combination| + input_combination.enum_for(:each_with_index).map do |input_value, index| + input_value == WILD_CARD ? yield(index, index) : input_value end end end - def map_each_input_value(input_combinations) + def map_each_input_value(input_combinations, &block) input_combinations.map do |input_combination| input_combination.enum_for(:each_with_index).map do |input_value, index| yield input_value, index
Reactor: add a nicer helper around mapping wild cards to their values
josephwilk_pairwise
train
rb
3d16d3a5ecef8f63448d9629c6f8b30fa14d7eaf
diff --git a/reflect.go b/reflect.go index <HASH>..<HASH> 100644 --- a/reflect.go +++ b/reflect.go @@ -59,11 +59,16 @@ func getFieldInfos(rType reflect.Type, parentIndexChain []int) []fieldInfo { continue } indexChain := append(parentIndexChain, i) - // if the field is an embedded struct, create a fieldInfo for each of its fields - if field.Anonymous && field.Type.Kind() == reflect.Struct { + // if the field is a struct, create a fieldInfo for each of its fields + if field.Type.Kind() == reflect.Struct { fieldsList = append(fieldsList, getFieldInfos(field.Type, indexChain)...) + } + + // if the field is an embedded struct, ignore the csv tag + if field.Anonymous { continue } + fieldInfo := fieldInfo{IndexChain: indexChain} fieldTag := field.Tag.Get("csv") fieldTags := strings.Split(fieldTag, TagSeparator)
allows for named structs to be included in reflection
gocarina_gocsv
train
go
6dae33faad4680865059483034dfdd15c49c5b66
diff --git a/src/Cmsable/Html/Breadcrumbs/Crumbs.php b/src/Cmsable/Html/Breadcrumbs/Crumbs.php index <HASH>..<HASH> 100644 --- a/src/Cmsable/Html/Breadcrumbs/Crumbs.php +++ b/src/Cmsable/Html/Breadcrumbs/Crumbs.php @@ -10,6 +10,8 @@ class Crumbs extends OrderedList{ protected $nodeCreator; + protected $autoIncrementor = 0; + public function __construct(NodeCreatorInterface $creator){ $this->nodeCreator = $creator; } @@ -35,6 +37,11 @@ class Crumbs extends OrderedList{ $crumb->setContent($content); } + // Produce some custom Ids to prevent false parent/child relations + $crumb->id = 'custom-id-'.$this->autoIncrementor; + $crumb->parent_id = 'parent-'.$crumb->id; + $this->autoIncrementor++; + return $crumb; } @@ -64,7 +71,9 @@ class Crumbs extends OrderedList{ } if($node = $this->current()){ - if($value->getParentIdentifier() != $node->getIdentifier()){ + + if($value->getParentIdentifier() != $node->getIdentifier()) + { $node->addChildNode($value); $value->setParentNode($node); }
Fixed some parent/child errors with no non-db nodes
mtils_cmsable
train
php
b19c772fbdcc522da1c26cbef1c7d0146076b882
diff --git a/lib/trello/card.rb b/lib/trello/card.rb index <HASH>..<HASH> 100644 --- a/lib/trello/card.rb +++ b/lib/trello/card.rb @@ -93,7 +93,7 @@ module Trello # Add a comment with the supplied text. def add_comment(text) - Client.put("/cards/#{id}/actions/comments", :text => text) + Client.post("/cards/#{id}/actions/comments", :text => text) end end end
Trello will change how to post comments from using a put method to a post method in the next deploy
jeremytregunna_ruby-trello
train
rb
b786dd11d9e87ca63f8f6c8bdd71248eb8c811bb
diff --git a/seaglass/trunk/seaglass/src/main/java/com/seaglasslookandfeel/painter/RadioButtonPainter.java b/seaglass/trunk/seaglass/src/main/java/com/seaglasslookandfeel/painter/RadioButtonPainter.java index <HASH>..<HASH> 100644 --- a/seaglass/trunk/seaglass/src/main/java/com/seaglasslookandfeel/painter/RadioButtonPainter.java +++ b/seaglass/trunk/seaglass/src/main/java/com/seaglasslookandfeel/painter/RadioButtonPainter.java @@ -56,10 +56,10 @@ public final class RadioButtonPainter extends AbstractRegionPainter { } private static final Insets insets = new Insets(0, 0, 0, 0); - private static final Dimension dimension = new Dimension(16, 16); + private static final Dimension dimension = new Dimension(18, 18); private static final CacheMode cacheMode = CacheMode.FIXED_SIZES; - private static final Double maxH = 1.0; - private static final Double maxV = 1.0; + private static final Double maxH = Double.POSITIVE_INFINITY; + private static final Double maxV = Double.POSITIVE_INFINITY; private Which state; private PaintContext ctx; @@ -251,7 +251,7 @@ public final class RadioButtonPainter extends AbstractRegionPainter { } private Shape setFocus(int width, int height) { - return setCircle(width - 1.0, width, height); + return setCircle(width - 1.5, width, height); } private Shape setBorder(int width, int height) {
Add some consistent room for the focus.
khuxtable_seaglass
train
java
2472804d754120f2f4ff6a8ddae63b1f9029981d
diff --git a/generators/app/index.js b/generators/app/index.js index <HASH>..<HASH> 100644 --- a/generators/app/index.js +++ b/generators/app/index.js @@ -1,7 +1,7 @@ 'use strict'; -var generators = require('yeoman-generator'); +const generators = require('yeoman-generator'); -const knownPluginTypes = ['app', 'bundle', 'lib', 'server', 'service']; +const knownPluginTypes = require('../../utils/known').plugin.types; const defaultPluginType = ['app']; class ChooseGenerator extends generators.Base {
use use types from 'known'
phovea_generator-phovea
train
js
6dfc3a69a45ec9e16a0e278165fe65866e6cfc7a
diff --git a/src/main/java/org/apache/maven/plugin/nar/AbstractCompileMojo.java b/src/main/java/org/apache/maven/plugin/nar/AbstractCompileMojo.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/apache/maven/plugin/nar/AbstractCompileMojo.java +++ b/src/main/java/org/apache/maven/plugin/nar/AbstractCompileMojo.java @@ -203,7 +203,7 @@ public abstract class AbstractCompileMojo protected final String getOutput( AOL aol, String type ) throws MojoExecutionException { - return getNarInfo().getOutput( aol, getOutput( ! aol.getOS().equals( OS.WINDOWS ) && ! Library.EXECUTABLE.equals( type ) ) ); + return getNarInfo().getOutput( aol, getOutput( !OS.WINDOWS.equals( aol.getOS() ) || !Library.EXECUTABLE.equals( type ) ) ); } protected final List getTests()
AbstractCompileMojo: fix versioned flag The negation was factored into the expression in <I>b<I>a<I>f<I>cec<I>c<I>d1eec<I>fb, but the && was not replaced with ||, so the refactoring changed the evaluation of the expression. This change restores it back to the prior meaning, but with the negations factored in as desired. Fixes GitHub issue #<I>.
maven-nar_nar-maven-plugin
train
java
df29812a7bbe05bf600fdf7c83f1bab7ac886204
diff --git a/escope.js b/escope.js index <HASH>..<HASH> 100644 --- a/escope.js +++ b/escope.js @@ -253,6 +253,10 @@ this.upper = currentScope; this.isStrict = isStrictScope(this, block); + + this.childScopes = []; + currentScope && currentScope.childScopes.push(this); + // RAII currentScope = this;
Adding child Scopes array Adding array with a list of the inner scopes belonging to a scope (having it as an "upper" scope). This allows for easy hierarchical traversing of scopes.
estools_escope
train
js
a936294c75d9730315087063d616c8a9225379aa
diff --git a/lib/poise_python/resources/python_package.rb b/lib/poise_python/resources/python_package.rb index <HASH>..<HASH> 100644 --- a/lib/poise_python/resources/python_package.rb +++ b/lib/poise_python/resources/python_package.rb @@ -228,7 +228,10 @@ EOH [name].flatten.zip([version].flatten).map do |n, v| n = parse_package_name(n) if parse v = v.to_s.strip - if v.empty? + if n =~ /:\/\// + # Probably a URI. + n + elsif v.empty? # No version requirement, send through unmodified. n elsif v =~ /^\d/
More untested stuff for installing from URLs.
poise_poise-python
train
rb
48665cee346b10987d8fb74fce4146e98833d114
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,8 @@ setup( 'urllib3', 'pyopenssl', 'ndg-httpsclient', - 'pyasn1' + 'pyasn1', + 'pynacl' ], tests_require=['nose', 'mock', 'HTTPretty'],
add pynacl to dependencies
pusher_pusher-http-python
train
py
27bef316542575aee04ea7bd48ea3b429e40ac5b
diff --git a/lib/alchemy/upgrader/tasks/available_contents_upgrader.rb b/lib/alchemy/upgrader/tasks/available_contents_upgrader.rb index <HASH>..<HASH> 100644 --- a/lib/alchemy/upgrader/tasks/available_contents_upgrader.rb +++ b/lib/alchemy/upgrader/tasks/available_contents_upgrader.rb @@ -9,6 +9,10 @@ module Alchemy::Upgrader::Tasks no_tasks do def convert_available_contents config = read_config + unless config + puts "\nNo elements config found. Skipping." + return + end elements_with_available_contents, new_elements = config.partition do |e| e['available_contents'] @@ -39,7 +43,9 @@ module Alchemy::Upgrader::Tasks old_config_file = Rails.root.join('config', 'alchemy', 'elements.yml') config = YAML.load_file(old_config_file) - puts "done.\n" + if config + puts "done.\n" + end config end
Skip upgrader if no element definitions are found In the very rare case where a project does not have any elements definition we skip the upgrader instead of causing errors.
AlchemyCMS_alchemy_cms
train
rb
a07fa8c3b803f4e5d7342a9498d47f35bf3895c1
diff --git a/OpenSSL/test/test_ssl.py b/OpenSSL/test/test_ssl.py index <HASH>..<HASH> 100644 --- a/OpenSSL/test/test_ssl.py +++ b/OpenSSL/test/test_ssl.py @@ -1385,7 +1385,7 @@ class ContextTests(TestCase, _LoopbackMixin): """ context = Context(TLSv1_METHOD) for curve in get_elliptic_curves(): - if curve.name.decode().startswith(u"Oakley-"): + if curve.name.startswith(u"Oakley-"): # Setting Oakley-EC2N-4 and Oakley-EC2N-3 adds # ('bignum routines', 'BN_mod_inverse', 'no inverse') to the # error queue on OpenSSL 1.0.2.
Seems like curves are always unicode!
pyca_pyopenssl
train
py
cb5ef27f724650af0a6bdc1981287800a4ce8183
diff --git a/indra/sources/indra_db_rest/processor.py b/indra/sources/indra_db_rest/processor.py index <HASH>..<HASH> 100644 --- a/indra/sources/indra_db_rest/processor.py +++ b/indra/sources/indra_db_rest/processor.py @@ -1,3 +1,9 @@ +""" +Here is defined the Processor for the INDRA Database REST service. For common +usage, please see the `api` in `indra.sources.indra_db_rest.api`. +""" + + import logging from copy import deepcopy
Add short doc string to processor file.
sorgerlab_indra
train
py
925ada12b4fa262900b876f33b0ff124af93b5aa
diff --git a/symphony/lib/toolkit/fields/field.input.php b/symphony/lib/toolkit/fields/field.input.php index <HASH>..<HASH> 100755 --- a/symphony/lib/toolkit/fields/field.input.php +++ b/symphony/lib/toolkit/fields/field.input.php @@ -182,6 +182,8 @@ if($this->get('apply_formatting') == 'yes' && isset($data['value_formatted'])) $value = $data['value_formatted']; else $value = $data['value']; + $value = General::sanitize($value); + $wrapper->appendChild(new XMLElement($this->get('element_name'), ($encode ? General::sanitize($value) : $value), array('handle' => $data['handle']))); }
Issue #<I>: Corrected encoding issue.
symphonycms_symphony-2
train
php
19f1483d7a8eacbdce0f9f95e3a0ff33f970ffcc
diff --git a/src/wiotp/sdk/api/dsc/connectors.py b/src/wiotp/sdk/api/dsc/connectors.py index <HASH>..<HASH> 100644 --- a/src/wiotp/sdk/api/dsc/connectors.py +++ b/src/wiotp/sdk/api/dsc/connectors.py @@ -184,7 +184,7 @@ class Connectors(defaultdict): return IterableConnectorList(self._apiClient, filters=queryParms) - def create(self, name, serviceId, timezone, description, enabled): + def create(self, name, type, serviceId, timezone, description, enabled): """ Create a connector for the organization in the Watson IoT Platform. The connector must reference the target service that the Watson IoT Platform will store the IoT data in. @@ -199,6 +199,7 @@ class Connectors(defaultdict): connector = { "name": name, + "type": type, "description": description, "serviceId": serviceId, "timezone": timezone,
[patch] added type into create connector
ibm-watson-iot_iot-python
train
py
3e40d3cc1014cfc153920bb8c489cfcbf0d3b3db
diff --git a/sendgrid/helpers/mail/file_content.py b/sendgrid/helpers/mail/file_content.py index <HASH>..<HASH> 100644 --- a/sendgrid/helpers/mail/file_content.py +++ b/sendgrid/helpers/mail/file_content.py @@ -31,7 +31,7 @@ class FileContent(object): def get(self): """ - Get a JSON-ready representation of this FileContente. + Get a JSON-ready representation of this FileContent. :returns: This FileContent, ready for use in a request body. :rtype: string
docs: fixed typo in sendgrid/helpers/mail/file_content.py (#<I>)
sendgrid_sendgrid-python
train
py
9991ee34cbc42c5bd0aaf3d4633cc6e45929959c
diff --git a/src/Calotype/SEO/Providers/SEOServiceProvider.php b/src/Calotype/SEO/Providers/SEOServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/Calotype/SEO/Providers/SEOServiceProvider.php +++ b/src/Calotype/SEO/Providers/SEOServiceProvider.php @@ -47,7 +47,7 @@ class SEOServiceProvider extends ServiceProvider // Generate sitemap.xml route $this->app['router']->get('sitemap.xml', function () use ($app) { $response = new Response($app['calotype.seo.generators.sitemap']->generate(), 200); - $response->header('Content-Type', 'text/xml'); + $response->header('Content-Type', 'application/xml'); return $response; });
Change incorrect Content-Type header from text/xml to application/xml
Calotype_SEO
train
php
1f1771a3f977fccd9f5025c0a9c103a3704f5e79
diff --git a/request.go b/request.go index <HASH>..<HASH> 100644 --- a/request.go +++ b/request.go @@ -18,7 +18,6 @@ import ( "gopkg.in/h2non/gentleman.v1/plugins/multipart" "gopkg.in/h2non/gentleman.v1/plugins/query" "gopkg.in/h2non/gentleman.v1/plugins/url" - "gopkg.in/h2non/gentleman.v1/utils" ) const ( @@ -321,6 +320,5 @@ func NewDefaultTransport(dialer *net.Dialer) *http.Transport { Dial: dialer.Dial, TLSHandshakeTimeout: TLSHandshakeTimeout, } - utils.SetTransportFinalizer(transport) return transport }
fix(request.go): remove finalizer statement
h2non_gentleman
train
go
b29e7343e1edc18834e237be1eb29472510d0832
diff --git a/source/ingress_test.go b/source/ingress_test.go index <HASH>..<HASH> 100644 --- a/source/ingress_test.go +++ b/source/ingress_test.go @@ -25,6 +25,9 @@ import ( "k8s.io/client-go/pkg/apis/extensions/v1beta1" ) +// Validates that IngressSource is a Source +var _ Source = &IngressSource{} + func TestIngress(t *testing.T) { t.Run("endpointsFromIngress", testEndpointsFromIngress) t.Run("Endpoints", testIngressEndpoints) diff --git a/source/service_test.go b/source/service_test.go index <HASH>..<HASH> 100644 --- a/source/service_test.go +++ b/source/service_test.go @@ -26,6 +26,9 @@ import ( "github.com/kubernetes-incubator/external-dns/endpoint" ) +// Validates that ServiceSource is a Source +var _ Source = &ServiceSource{} + func TestService(t *testing.T) { t.Run("Endpoints", testServiceEndpoints) }
fix(source): validate that sources adhere to the interface (#<I>)
kubernetes-incubator_external-dns
train
go,go
2ec3dca19e6966dc16600d0aac32f80db96aeca6
diff --git a/phpsec.class.php b/phpsec.class.php index <HASH>..<HASH> 100644 --- a/phpsec.class.php +++ b/phpsec.class.php @@ -133,6 +133,12 @@ class phpsec { spl_autoload_register($autoLoadFunction); } + /* Set the charset of the multibyte functions in PHP. */ + if(function_exists('mb_internal_encoding')) { + mb_internal_encoding(self::$_charset); + mb_regex_encoding(self::$_charset); + } + /* Autoloader all good to go. If we don't have a storage set * we can skip the rest of this method. */ if(self::$_dsn === null) { @@ -151,10 +157,6 @@ class phpsec { self::error('Store type('.$storeType.') invalid', E_USER_ERROR); } - /* Set the charset of the multibyte functions in PHP. */ - mb_internal_encoding(self::$_charset); - mb_regex_encoding(self::$_charset); - /* Enable the custom session handler if enabled. */ if(self::$_sessenable === true) { phpsecSession::$_sessIdRegen = phpsec::$_sessIdRegen;
Makes sure the MB encoding always is set, but only if PHP supports it.
phpsec_phpSec
train
php
1cdaaabb7892f6b704f6a39c972f3b4bf81bb146
diff --git a/src/Codeception/Module/ExtendedDb.php b/src/Codeception/Module/ExtendedDb.php index <HASH>..<HASH> 100644 --- a/src/Codeception/Module/ExtendedDb.php +++ b/src/Codeception/Module/ExtendedDb.php @@ -16,7 +16,7 @@ class ExtendedDb extends Db */ public function dontHaveInDatabase($table, array $criteria) { - $query = $this->driver->delete($table, $criteria); + $query = $this->driver->deleteQueryByCriteria($table, $criteria); $this->debugSection('Query', $query); $sth = $this->driver->getDbh()->prepare($query); @@ -25,7 +25,7 @@ class ExtendedDb extends Db } $res = $sth->execute(); if (!$res) { - $this->fail(sprintf("Record with %s couldn't be deleted from %s", json_encode($data), $table)); + $this->fail(sprintf("Record with %s couldn't be deleted from %s", json_encode($criteria), $table)); } }
fixed call to deprecated Db delete method
lucatume_wp-browser
train
php
1c8b96fea33e18ebc0bdf8545b473e352c67e004
diff --git a/ghost/admin/views/post-settings.js b/ghost/admin/views/post-settings.js index <HASH>..<HASH> 100644 --- a/ghost/admin/views/post-settings.js +++ b/ghost/admin/views/post-settings.js @@ -29,7 +29,8 @@ var slug = this.model ? this.model.get('slug') : '', pubDate = this.model ? this.model.get('published_at') : 'Not Published', $pubDateEl = this.$('.post-setting-date'), - $postSettingSlugEl = this.$('.post-setting-slug'); + $postSettingSlugEl = this.$('.post-setting-slug'), + publishedDateFormat = 'DD MMM YY HH:mm'; $postSettingSlugEl.val(slug); @@ -40,7 +41,10 @@ // Insert the published date, and make it editable if it exists. if (this.model && this.model.get('published_at')) { - pubDate = moment(pubDate).format('DD MMM YY HH:mm'); + pubDate = moment(pubDate).format(publishedDateFormat); + $pubDateEl.attr('placeholder', ''); + } else { + $pubDateEl.attr('placeholder', moment().format(publishedDateFormat)); } if (this.model && this.model.get('id')) {
Update placeholder of published data in editor fixes #<I> - when a post has a published_at value show a blank placeholder - when a post doesn’t have a published_at value then show the required published at value format
TryGhost_Ghost
train
js
ce2141afd3405fbb814a000fe4f88e0c5d2e229a
diff --git a/macros/index.js b/macros/index.js index <HASH>..<HASH> 100644 --- a/macros/index.js +++ b/macros/index.js @@ -1408,7 +1408,7 @@ let function = macro { let match = macro { case { $ctx $op:expr { $body ... } } => { return #{ - $sparkler__compile $ctx anonymous { $body ... }.call(this, $op) + ($sparkler__compile $ctx anonymous { $body ... }.call(this, $op)) } } case { _ } => {
Allow match to be used as a Statement
natefaubion_sparkler
train
js
2307b7a36de97c5a7e9b060bfcc343d87ca8f98c
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -87,7 +87,10 @@ function Peer (opts) { self._isReactNativeWebrtc = typeof self._pc._peerConnectionId === 'number' self._pc.oniceconnectionstatechange = function () { - self._onIceConnectionStateChange() + self._onIceStateChange() + } + self._pc.onicegatheringstatechange = function (event) { + self._onIceStateChange() } self._pc.onsignalingstatechange = function () { self._onSignalingStateChange() @@ -422,7 +425,7 @@ Peer.prototype._createAnswer = function () { }, function (err) { self._destroy(err) }, self.answerConstraints) } -Peer.prototype._onIceConnectionStateChange = function () { +Peer.prototype._onIceStateChange = function () { var self = this if (self.destroyed) return var iceGatheringState = self._pc.iceGatheringState
Listen for 'icegatheringstatechange' When 'icegatheringstatechange' fires, trigger the handler so users can listen for changes
feross_simple-peer
train
js
826db6375c95328977305a440cde5c1b345d4a2f
diff --git a/lib/focuslight/graph.rb b/lib/focuslight/graph.rb index <HASH>..<HASH> 100644 --- a/lib/focuslight/graph.rb +++ b/lib/focuslight/graph.rb @@ -137,13 +137,24 @@ module Focuslight super uri = ['type-1', 'path-1', 'gmode-1'].map{|k| @parsed_meta[k]}.join(':') + ':0' # stack + + data_rows = [] + + first_row = { + type: @parsed_meta['type-1'], + path: @parsed_meta['path-1'], + gmode: @parsed_meta['gmode-1'], + stack: false, + graphid: @parsed_meta['path-1'], + } + data_rows << first_row + unless @parsed_meta['type-2'].is_a?(Array) ['type-2', 'path-2', 'gmode-2', 'stack-2'].each do |key| - @parsed_meta[key] = [@parsed_meta[key]] + @parsed_meta[key] = [@parsed_meta[key]].flatten end end - data_rows = [] @parsed_meta['type-2'].each_with_index do |type, i| t = @parsed_meta['type-2'][i] p = @parsed_meta['path-2'][i] # id?
fix to constract member data_row initially
focuslight_focuslight
train
rb
655f161b39f3bb21d8146caa02e8b70641568b5c
diff --git a/src/emir/instrument/detector.py b/src/emir/instrument/detector.py index <HASH>..<HASH> 100644 --- a/src/emir/instrument/detector.py +++ b/src/emir/instrument/detector.py @@ -102,7 +102,16 @@ class EMIR_Detector_32(nIRDetector): 41803.7, 41450.2, 41306.2, 41609.4, 41414.1, 41324.5, 41691.1, 41360.0, 41551.2, 41618.6, 41553.5] - pedestal = [5362]*32 + # from Carlos Gonzalez Thesis, page 130 + # ADU + pedestal = [3776, 4428, 4071, 4161, 5540, 5623, 5819, 5933, + 6245, 6151, 5746, 5477, 4976, 4937, 4966, 4576, + 5605, 5525, 5532, 5643, 5505, 5371, 5535, 4985, + 5651, 5707, 5604, 5260, 4696, 5053, 5032, 5155 + ] + + + saturation = [57000]*32 channels = [Channel(*vs) for vs in zip(CHANNELS_3, gain, ron, pedestal, wdepth, saturation)]
Added reset values from CG's Thesis
guaix-ucm_pyemir
train
py
80b680e32a00b658fb63cd76cee4ad5ade0b2115
diff --git a/src/Tabs/TabsItem.js b/src/Tabs/TabsItem.js index <HASH>..<HASH> 100644 --- a/src/Tabs/TabsItem.js +++ b/src/Tabs/TabsItem.js @@ -37,6 +37,9 @@ const styles = theme => { '&&': setThemeForSelector(colors.default), '&$isEnabled$isSelected': setThemeForSelector(colors.selected), '&$isEnabled$isSelected:hover': setThemeForSelector(colors.selectedHover), + '&$isEnabled$isSelected:active': setThemeForSelector( + colors.selectedActive + ), '&$isEnabled:hover': setThemeForSelector(colors.hover), ...focusSourceMixin( 'other', diff --git a/src/theme/create-theme.js b/src/theme/create-theme.js index <HASH>..<HASH> 100644 --- a/src/theme/create-theme.js +++ b/src/theme/create-theme.js @@ -1179,6 +1179,7 @@ export default function createTheme(config) { selectedHover: { text: colors.primary }, + selectedActive: {}, disabled: { text: lighten(colors.controls.grey.outline, 0.5) },
feat(Tabs): added selectedActive
rambler-digital-solutions_rambler-ui
train
js,js
cd481a71f691f5edb2f2720ea263872e1c41b6c7
diff --git a/components/src/instrument/PipetteSelect.js b/components/src/instrument/PipetteSelect.js index <HASH>..<HASH> 100644 --- a/components/src/instrument/PipetteSelect.js +++ b/components/src/instrument/PipetteSelect.js @@ -119,7 +119,7 @@ const PipetteNameItem = (props: PipetteNameSpecs) => { return ( <Flex - data-id={dataIdFormat( + data-test={dataIdFormat( 'PipetteNameItem', volumeClass, channels, diff --git a/protocol-designer/cypress/integration/newProtocolWithModules.spec.js b/protocol-designer/cypress/integration/newProtocolWithModules.spec.js index <HASH>..<HASH> 100644 --- a/protocol-designer/cypress/integration/newProtocolWithModules.spec.js +++ b/protocol-designer/cypress/integration/newProtocolWithModules.spec.js @@ -44,7 +44,7 @@ describe('Protocols with Modules', () => { .next() .contains('None') .click() - cy.get('[data-id="PipetteNameItem_p300MultiChannelGen1"]').click() + cy.get('[data-test="PipetteNameItem_p300MultiChannelGen1"]').click() cy.selectTipRacks(tipRack, tipRack) // Add modules
refactor(protocol-designer): change pipette select to use data-test instead of data-id (#<I>)
Opentrons_opentrons
train
js,js
e760a2eccfb2dfa3fbd882810bda55292d22da0d
diff --git a/anyconfig/backend/configobj.py b/anyconfig/backend/configobj.py index <HASH>..<HASH> 100644 --- a/anyconfig/backend/configobj.py +++ b/anyconfig/backend/configobj.py @@ -11,9 +11,10 @@ - Format to support: configobj, http://goo.gl/JbP2Kp (readthedocs.org) - Requirements: configobj (https://pypi.python.org/pypi/configobj/) -- Limitations: It seems that configobj.ConfigObj does not receive callble to - make a dict objects from configurations. If it's true and then the order of - configurations might be lost. +- Limitations: AFAIK, configobj does not keep the order of configuration items + and not have options to change this behavior like configparser, so this + backend does not keep the order of configuration items even if the ac_ordered + option was used. - Special options:
refactor: update the description of the limitation of configobj backend
ssato_python-anyconfig
train
py
189acd37a661560055c32749ca07a704e4767b02
diff --git a/lib/sigh/developer_center.rb b/lib/sigh/developer_center.rb index <HASH>..<HASH> 100644 --- a/lib/sigh/developer_center.rb +++ b/lib/sigh/developer_center.rb @@ -220,7 +220,7 @@ module Sigh end # We found the correct certificate - if force + if force && type != DEVELOPMENT provisioningProfileId = current_cert['provisioningProfileId'] renew_profile(provisioningProfileId, type, cert_date) # This one needs to be forcefully renewed return maintain_app_certificate(app_identifier, type, false, cert_date) # recursive
prevent force renew for development profiles (renewing development profiles gives me an error)
fastlane_fastlane
train
rb
654e206b52627a2121c545da40cbd3d20c1ba9d0
diff --git a/benchexec/test_tool_info.py b/benchexec/test_tool_info.py index <HASH>..<HASH> 100644 --- a/benchexec/test_tool_info.py +++ b/benchexec/test_tool_info.py @@ -70,6 +70,8 @@ def print_tool_info(name): print_value('Executable', executable) if not os.path.isabs(executable): print_value('Executable (absolute path)', os.path.abspath(executable)) + else: + logging.warning('Using an absolute path for the executable is not recommended; it might not be available on other machines.') try: print_value('Version', tool.version(executable))
Add warning if absolute path is used for executable
sosy-lab_benchexec
train
py
208a2dbae67437610a4757141f9bbc78041458aa
diff --git a/src/Constants.php b/src/Constants.php index <HASH>..<HASH> 100644 --- a/src/Constants.php +++ b/src/Constants.php @@ -45,7 +45,7 @@ class Constants { * We only trust metadata lists generated by cxn.civicrm.org. This implementation is a bit * ham-handed, but it's simple. Ideally, we might have a special "usage" flag in the cert. */ - const OFFICIAL_APPMETAS_CN = 'cxn.civicrm.org'; + const OFFICIAL_APPMETAS_CN = 'core:DirectoryService'; const OFFICIAL_APPMETAS_URL = 'http://cxn.civicrm.org/apps';
OFFICIAL_APPMETAS_CN - Use a value which can be meaningful in both test and production networks
civicrm_civicrm-cxn-rpc
train
php
8bb83228e1457c0c39ee2d2e987c559daf118021
diff --git a/findbugs/src/java/edu/umd/cs/findbugs/ba/vna/ValueNumberFrame.java b/findbugs/src/java/edu/umd/cs/findbugs/ba/vna/ValueNumberFrame.java index <HASH>..<HASH> 100644 --- a/findbugs/src/java/edu/umd/cs/findbugs/ba/vna/ValueNumberFrame.java +++ b/findbugs/src/java/edu/umd/cs/findbugs/ba/vna/ValueNumberFrame.java @@ -265,11 +265,9 @@ public class ValueNumberFrame extends Frame<ValueNumber> implements ValueNumberA if (phi == null) { int flags = ValueNumber.PHI_NODE; for(ValueNumber vn : myVN) { - mergeTree.mapInputToOutput(vn, phi); flags |= vn.getFlags(); } if (otherVN != null) for(ValueNumber vn : otherVN) { - mergeTree.mapInputToOutput(vn, phi); flags |= vn.getFlags(); }
fix bug (introduced in my last change to this file) that was detected by FindBugs git-svn-id: <URL>
spotbugs_spotbugs
train
java
58fdf7c5e4a8c58bba6b584629578dde03f80017
diff --git a/lib/salt/post.rb b/lib/salt/post.rb index <HASH>..<HASH> 100644 --- a/lib/salt/post.rb +++ b/lib/salt/post.rb @@ -1,6 +1,6 @@ module Salt class Post < Page - attr_accessor :slug, :date, :contents, :categories + attr_accessor :slug, :date, :categories, :markdown def self.path "archives" @@ -23,6 +23,16 @@ module Salt :post end + def contents + site = Salt::Site.instance + + unless site.settings[:use_markdown] + @contents + else + @markdown ||= Kramdown::Document.new(@contents, site.settings[:markdown_options]).to_html + end + end + def output_path(site, parent_path) File.join(parent_path, self.class.path, @slug) end
Make the contents method support Markdown, if it's enabled.
waferbaby_dimples
train
rb
37d3cc222e914eddb6be02c23c1e479178565157
diff --git a/chatterbot/__init__.py b/chatterbot/__init__.py index <HASH>..<HASH> 100644 --- a/chatterbot/__init__.py +++ b/chatterbot/__init__.py @@ -1,5 +1,5 @@ from .chatterbot import ChatBot -__version__ = "0.2.0" +__version__ = "0.2.1" __maintainer__ = "Gunther Cox" __email__ = "gunthercx@gmail.com"
Set version to <I>.
gunthercox_ChatterBot
train
py
aa49cfaf731f36bb7af1a261b1fb0bd7f652a717
diff --git a/src/Handler.php b/src/Handler.php index <HASH>..<HASH> 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -2,6 +2,7 @@ namespace Bolt; use Bolt\Api\Response; + use Bolt\Exceptions\Output; class Handler { @@ -21,7 +22,11 @@ $type .= "::" . $exception->getCodeKey(); } - if (DEPLOYMENT === Deployment::PRODUCTION) + if ($exception instanceof Output) + { + $data = $exception->getMessage(); + } + elseif (DEPLOYMENT === Deployment::PRODUCTION) { $data = $type; }
Update handler to output api response with Output exceptions
irwtdvoys_bolt-api
train
php
8c67fd52b0833d1d816e932f4ec86fc00ac3d80f
diff --git a/builtin/providers/terraform/data_source_state.go b/builtin/providers/terraform/data_source_state.go index <HASH>..<HASH> 100644 --- a/builtin/providers/terraform/data_source_state.go +++ b/builtin/providers/terraform/data_source_state.go @@ -146,6 +146,16 @@ func dataSourceRemoteStateRead(d *cty.Value) (cty.Value, tfdiags.Diagnostics) { } remoteState := state.State() + if remoteState == nil { + diags = diags.Append(tfdiags.AttributeValue( + tfdiags.Error, + "Unable to find remote state", + "No stored state was found for the given workspace in the given backend.", + cty.Path(nil).GetAttr("workspace"), + )) + newState["outputs"] = cty.EmptyObjectVal + return cty.ObjectVal(newState), diags + } mod := remoteState.RootModule() if mod != nil { // should always have a root module in any valid state for k, os := range mod.OutputValues {
builtin/providers: Don't panic if requested remote state isn't present
hashicorp_terraform
train
go
294db5dbd77e57336508156a2d776152676f25ef
diff --git a/annotationengine/views.py b/annotationengine/views.py index <HASH>..<HASH> 100644 --- a/annotationengine/views.py +++ b/annotationengine/views.py @@ -38,13 +38,14 @@ def aligned_volume_view(aligned_volume_name): x.schema_type), axis=1) - df['table_name']=df['table_name'].map(lambda x: get_table_name_from_table_id(x)) + table_names=df['table_id'].map(lambda x: get_table_name_from_table_id(x)) + df.insert(1, 'table_name', table_names) + df = df.drop(['table_id'], axis=1) df['table_name']=df.apply(lambda x: "<a href='{}'>{}</a>".format(url_for('views.table_view', aligned_volume_name=aligned_volume_name, table_name=x.table_name), x.table_name), axis=1) - return render_template('aligned_volume.html', df_table=df.to_html(escape=False), tables=table_names,
fixing table_id to table_name
seung-lab_AnnotationEngine
train
py
0fb63c96015ec00e1d9888a7bf53d47da845e714
diff --git a/mod_pbxproj/mod_pbxproj.py b/mod_pbxproj/mod_pbxproj.py index <HASH>..<HASH> 100755 --- a/mod_pbxproj/mod_pbxproj.py +++ b/mod_pbxproj/mod_pbxproj.py @@ -992,7 +992,7 @@ class XcodeProject(PBXDict): self.remove_group(childKey, True) else: self.remove_file(childKey, False) - + self.objects.remove(id); def remove_group_by_name(self, name, recursive = False): @@ -1238,7 +1238,7 @@ class XcodeProject(PBXDict): uuids[key] = 'Build configuration list for PBXNativeTarget "TARGET_NAME"' ro = self.data.get('rootObject') - uuids[ro] = 'Project Object' + uuids[ro] = 'Project object' for key in objs: # transitive references (used in the BuildFile section)
Retain proper case sensitivity of the comment. Some folks (Unity, I'm looking at you!) use the comments for the parsing of the file.
kronenthaler_mod-pbxproj
train
py
351942ce8731784469b861ae4304e34be3f6f740
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -62,12 +62,12 @@ link_files = { url='{GH}/jaraco/setuptools_svn/issues/{setuptools_svn}', ), dict( - pattern=r'pypa/distutils#(?P<distutils>\d+)', - url='{GH}/pypa/distutils/issues/{distutils}', + pattern=r'pypa/(?P<issue_repo>[\-\.\w]+)#(?P<issue_number>\d+)', + url='{GH}/pypa/{issue_repo}/issues/{issue_number}', ), dict( - pattern=r'pypa/distutils@(?P<distutils_commit>[\da-f]+)', - url='{GH}/pypa/distutils/commit/{distutils_commit}', + pattern=r'pypa/(?P<commit_repo>[\-\.\w]+)@(?P<commit_number>[\da-f]+)', + url='{GH}/pypa/{commit_repo}/commit/{commit_number}', ), dict( pattern=r'^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n',
Extend matching of issue/commit links to all PyPA repositories Currently the link for the pypa/get-pip issue was rendering wrongly. This change extends the matching for issues and commits (currently only handling `distutils`) to any PyPA repository.
pypa_setuptools
train
py
e8c38d61f92142828cfebc0d77962e4ba6ef6dfd
diff --git a/c7n/mu.py b/c7n/mu.py index <HASH>..<HASH> 100644 --- a/c7n/mu.py +++ b/c7n/mu.py @@ -1086,8 +1086,10 @@ class CloudWatchEventSource(object): payload['detail-type'] = events elif event_type == 'phd': payload['source'] = ['aws.health'] - payload['detail'] = { - 'eventTypeCode': list(self.data['events'])} + if self.data.get('events'): + payload['detail'] = { + 'eventTypeCode': list(self.data['events']) + } if self.data.get('categories', []): payload['detail']['eventTypeCategory'] = self.data['categories'] elif event_type == 'hub-finding':
aws - phd mode - fix all events support (#<I>)
cloud-custodian_cloud-custodian
train
py
35f95dcbee37fca69b03eb4b80c85a9330f51c8f
diff --git a/pyrtl/passes.py b/pyrtl/passes.py index <HASH>..<HASH> 100644 --- a/pyrtl/passes.py +++ b/pyrtl/passes.py @@ -87,7 +87,7 @@ def detailed_general_timing_analysis(block, print_total_length=True, gate_timing items_to_remove = set() for gate in remaining: # loop over logicnets not yet returned if all([arg in cleared for arg in gate.args]): # if all args ready - time = max(timing_map[a_wire] for a_wire in gate.args)+ gate_timings[gate.op] + time = max(timing_map[a_wire] for a_wire in gate.args) + gate_timings[gate.op] timing_map[gate.dests[0]] = time heapq.heappush(timing_heap, WireWTiming(time, gate.dests[0])) cleared.update(set(gate.dests)) # add dests to set of ready wires
Pep8 fix (caught it before pushing this time!!!!)
UCSBarchlab_PyRTL
train
py
f4b88b65b6ff3ee975233ec9ade5e2a0ec38cd08
diff --git a/pages/Product/components/AddToCartBar/style.js b/pages/Product/components/AddToCartBar/style.js index <HASH>..<HASH> 100644 --- a/pages/Product/components/AddToCartBar/style.js +++ b/pages/Product/components/AddToCartBar/style.js @@ -16,6 +16,7 @@ const container = css({ right: 0, padding: variables.gap.small, background: colors.light, + boxShadow: '0 0 30px rgba(0,0,0,0.1)', }); const base = css({
CON-<I> added slight box shadow to the container.
shopgate_pwa
train
js
eacc876b4c2d576e1778ae3f4e30ff8852d73df4
diff --git a/lib/tinycert/cert_authorities.rb b/lib/tinycert/cert_authorities.rb index <HASH>..<HASH> 100644 --- a/lib/tinycert/cert_authorities.rb +++ b/lib/tinycert/cert_authorities.rb @@ -13,7 +13,7 @@ module Tinycert end def [](ca_id) - list.find { |ca| ca.id == ca_id } + list.find { |ca| ca.id.to_s == ca_id.to_s } end end end diff --git a/lib/tinycert/version.rb b/lib/tinycert/version.rb index <HASH>..<HASH> 100644 --- a/lib/tinycert/version.rb +++ b/lib/tinycert/version.rb @@ -1,3 +1,3 @@ module Tinycert - VERSION = "0.1.0" + VERSION = "0.1.1" end
Compare the ca ids as strings
ideasasylum_tinycert
train
rb,rb
1b51b7769c9c24ab74ea66d2de997a2cf3d0336c
diff --git a/src/hamster/widgets/activityentry.py b/src/hamster/widgets/activityentry.py index <HASH>..<HASH> 100644 --- a/src/hamster/widgets/activityentry.py +++ b/src/hamster/widgets/activityentry.py @@ -485,13 +485,14 @@ class ActivityEntry(): self.completion = gtk.EntryCompletion() self.widget.set_completion(self.completion) - # activity, category, text to display - self.activity_column = 0 - self.category_column = 1 - self.text_column = 2 + # text to display/filter on, activity, category + self.text_column = 0 + self.activity_column = 1 + self.category_column = 2 + self.model = gtk.ListStore(str, str, str) self.completion.set_model(self.model) - self.completion.set_text_column(2) + self.completion.set_text_column(self.text_column) self.completion.set_match_func(self.match_func, None) self.connect("icon-release", self.on_icon_release) @@ -539,7 +540,7 @@ class ActivityEntry(): for activity in runtime.storage.get_category_activities(category_id): activity_name = activity["name"] text = "{}@{}".format(activity_name, category_name) - self.model.append([activity_name, category_name, text]) + self.model.append([text, activity_name, category_name]) def __getattr__(self, name): return getattr(self.widget, name)
use first column for text/filter This will make future additions cleaner.
projecthamster_hamster
train
py
9459481f9041145d215b258ca0dffed959d24357
diff --git a/salt/modules/yumpkg5.py b/salt/modules/yumpkg5.py index <HASH>..<HASH> 100644 --- a/salt/modules/yumpkg5.py +++ b/salt/modules/yumpkg5.py @@ -423,7 +423,7 @@ def refresh_db(): 1: False, } - cmd = 'yum -q expire-cache && yum -q check-update' + cmd = 'yum -q clean expire-cache && yum -q check-update' ret = __salt__['cmd.retcode'](cmd) return retcodes.get(ret, False)
Added missing 'clean' to yumpkg5 refresh_db CLI
saltstack_salt
train
py
af48c76c35b160112908fbff9a446ad82ed3fc33
diff --git a/war/src/main/js/widgets/config/model/ConfigTableMetaData.js b/war/src/main/js/widgets/config/model/ConfigTableMetaData.js index <HASH>..<HASH> 100644 --- a/war/src/main/js/widgets/config/model/ConfigTableMetaData.js +++ b/war/src/main/js/widgets/config/model/ConfigTableMetaData.js @@ -271,6 +271,10 @@ ConfigTableMetaData.prototype.showSections = function(withText) { var containsText = false; var sectionRows = section.getRows(); + // Show the section now. We will unshow it later if + // it doesn't have the text. + this.sections[i2].activator.show(); + for (var i3 = 0; i3 < sectionRows.length; i3++) { var row = sectionRows[i3]; var elementsWithText = $(selector, row);
Fixed bug in finder - not revealing sections before looking for matches
jenkinsci_jenkins
train
js
a0b71c307264102cd9ca6630f41d95b148bf9d56
diff --git a/shinken/modules/logstore_mongodb.py b/shinken/modules/logstore_mongodb.py index <HASH>..<HASH> 100644 --- a/shinken/modules/logstore_mongodb.py +++ b/shinken/modules/logstore_mongodb.py @@ -189,6 +189,10 @@ class LiveStatusLogStoreMongoDB(BaseModule): def manage_log_brok(self, b): data = b.data line = data['log'] + if re.match("^\[[0-9]*\] [A-Z][a-z]*.:", line): + # Match log which NOT have to be stored + # print "Unexpected in manage_log_brok", line + return logline = Logline(line=line) values = logline.as_dict() if logline.logclass != LOGCLASS_INVALID: diff --git a/shinken/modules/logstore_sqlite.py b/shinken/modules/logstore_sqlite.py index <HASH>..<HASH> 100644 --- a/shinken/modules/logstore_sqlite.py +++ b/shinken/modules/logstore_sqlite.py @@ -406,6 +406,10 @@ class LiveStatusLogStoreSqlite(BaseModule): return data = b.data line = data['log'] + if re.match("^\[[0-9]*\] [A-Z][a-z]*.:", line): + # Match log which NOT have to be stored + # print "Unexpected in manage_log_brok", line + return try: logline = Logline(line=line) values = logline.as_tuple()
#<I> Temporary fix waiting logger refactoring
Alignak-monitoring_alignak
train
py,py
bc6cffd16d9b5eb5a9a0c862cfbaf76d7548e501
diff --git a/src/edeposit/amqp/aleph/__init__.py b/src/edeposit/amqp/aleph/__init__.py index <HASH>..<HASH> 100755 --- a/src/edeposit/amqp/aleph/__init__.py +++ b/src/edeposit/amqp/aleph/__init__.py @@ -119,7 +119,7 @@ from datastructures import * # Queries ===================================================================== -class _QueryTemplate: +class _QueryTemplate(object): """ This class is here to just save some effort by using common ancestor with same .getSearchResult() and .getCountResult() definition.
_QueryTemplate is now inherited from object.
edeposit_edeposit.amqp.aleph
train
py
04c62ae124b983aec3ae355633bfc7aeae7ec0bf
diff --git a/src/saml2/entity.py b/src/saml2/entity.py index <HASH>..<HASH> 100644 --- a/src/saml2/entity.py +++ b/src/saml2/entity.py @@ -49,7 +49,7 @@ from saml2 import VERSION from saml2 import class_name from saml2.config import config_factory from saml2.httpbase import HTTPBase -from saml2.sigver import security_context, response_factory, SignatureError +from saml2.sigver import security_context, response_factory, SigverError from saml2.sigver import pre_signature_part from saml2.sigver import signed_instance_factory from saml2.virtual_org import VirtualOrg @@ -794,7 +794,7 @@ class Entity(HTTPBase): try: response = response.loads(xmlstr, False) - except SignatureError, err: + except SigverError, err: logger.error("Signature Error: %s" % err) return None except Exception, err:
Signature verification raises MissingKey (SigverError) if only_use_keys_in_metadata config option is set and we have no certs for issuer.
IdentityPython_pysaml2
train
py
8a51ec01581625876904bb785f66aac9788e043d
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -23,7 +23,7 @@ module ActionDispatch # to pass a Constraints object to this constructor, but there were # multiple places that kept testing children of this object. I # *think* they were just being defensive, but I have no idea. - while app.is_a?(self.class) + if app.is_a?(self.class) constraints += app.constraints app = app.app end
Constraints#app should never return another Constraints object, so switch to if statement
rails_rails
train
rb
7d9374a582edd47f973255618a35d36d032059eb
diff --git a/buffer/src/main/java/io/netty/buffer/PoolThreadCache.java b/buffer/src/main/java/io/netty/buffer/PoolThreadCache.java index <HASH>..<HASH> 100644 --- a/buffer/src/main/java/io/netty/buffer/PoolThreadCache.java +++ b/buffer/src/main/java/io/netty/buffer/PoolThreadCache.java @@ -207,8 +207,8 @@ final class PoolThreadCache { } int numFreed = 0; - for (int i = 0; i < caches.length; i++) { - numFreed += free(caches[i]); + for (MemoryRegionCache<?> c: caches) { + numFreed += free(c); } return numFreed; } @@ -233,8 +233,8 @@ final class PoolThreadCache { if (caches == null) { return; } - for (int i = 0; i < caches.length; i++) { - trim(caches[i]); + for (MemoryRegionCache<?> c: caches) { + trim(c); } }
Use Java 5 foreach for arrays for brevity at no cost
netty_netty
train
java
3c6bb892715a43b0e02336277f2dd2552fa68af4
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb @@ -68,7 +68,7 @@ module ActiveRecord execute "DROP DATABASE IF EXISTS #{quote_table_name(name)}" end - # Returns the list of all tables in the schema search path or a specified schema. + # Returns the list of all tables in the schema search path. def tables(name = nil) select_values("SELECT tablename FROM pg_tables WHERE schemaname = ANY(current_schemas(false))", 'SCHEMA') end
pg docs, `connection.tables` does not use the `name` argument. [ci skip] Currently the `#tables` method does not make use of the `name` argument and always returns all the tables in the schema search path. However the docs suggest different behavior. While we should porbably adjust the implementation to provide this behavior, let's make the docs right for now (also for `4-2-stable`) and then implement the behavior on `master`.
rails_rails
train
rb
f38d9bbbe5154d39f775a9055bb926843a41be8d
diff --git a/what3words.js b/what3words.js index <HASH>..<HASH> 100644 --- a/what3words.js +++ b/what3words.js @@ -19,6 +19,14 @@ var what3words = new function (language) { if (language !== undefined) this.language = language; }; + + /** + * Sets the API key + */ + this.setKey = function (key) { + if (key !== undefined) + this.API_KEY = key; + }; /** * Forward Geocode (words to location) @@ -78,7 +86,7 @@ var what3words = new function (language) { * Standard Blend from the API * https://docs.what3words.com/api/v2/#standardblend */ - this.standardBlend = function (words,callback){ + this.standardlend = function (words,callback){ if (typeof words === 'undefined') throw 'No valid words passed'; else if (typeof words === 'object')
Added setKey() function & renamed standardblend()
what3words_w3w-javascript-wrapper
train
js
06a77597804d888cdbbaf1d5a3d1c38a7f5fdcc4
diff --git a/fluo/admin/base.py b/fluo/admin/base.py index <HASH>..<HASH> 100644 --- a/fluo/admin/base.py +++ b/fluo/admin/base.py @@ -20,6 +20,7 @@ import copy +from django.db import transaction from django.utils.translation import gettext_lazy as _ @@ -30,6 +31,7 @@ class CopyObject: super().__init__(*args, **kwargs) self.__name__ = self.__class__.__name__ + @transaction.atomic def __call__(self, modeladmin, request, queryset): for original in queryset: instance = copy.copy(original)
admin: added transaction to copy object call
rsalmaso_django-fluo
train
py
184b9217a659dc76496091115aaf58d40790691f
diff --git a/src-gwt/org/opencms/gwt/client/ui/input/A_CmsSelectBox.java b/src-gwt/org/opencms/gwt/client/ui/input/A_CmsSelectBox.java index <HASH>..<HASH> 100644 --- a/src-gwt/org/opencms/gwt/client/ui/input/A_CmsSelectBox.java +++ b/src-gwt/org/opencms/gwt/client/ui/input/A_CmsSelectBox.java @@ -520,7 +520,7 @@ implements I_CmsFormWidget, HasValueChangeHandlers<String>, I_CmsTruncable { m_popup.setWidth(selectorWidth + "px"); m_popup.show(); - int panelTop = m_panel.getElement().getAbsoluteTop(); + int openerHeight = CmsDomUtil.getCurrentStyleInt(m_opener.getElement(), CmsDomUtil.Style.height); int popupHeight = m_popup.getOffsetHeight(); int dx = 0; @@ -532,7 +532,6 @@ implements I_CmsFormWidget, HasValueChangeHandlers<String>, I_CmsTruncable { dx = spaceOnTheRight < 0 ? spaceOnTheRight : 0; } // Calculate top position for the popup - int top = m_opener.getAbsoluteTop(); // Make sure scrolling is taken into account, since
Correct the popup of the selectbox.
alkacon_opencms-core
train
java
c896797fba811019427004b8f4b27862c0285869
diff --git a/lib/HttpResponse.js b/lib/HttpResponse.js index <HASH>..<HASH> 100644 --- a/lib/HttpResponse.js +++ b/lib/HttpResponse.js @@ -71,6 +71,19 @@ HttpResponse.prototype.satisfies = function (spec, mustBeExhaustive) { if (!Message.prototype.satisfies.call(this, spec, mustBeExhaustive)) { return false; } + if ('statusLine' in spec) { + if (spec.statusLine && typeof spec.statusLine === 'object') { + if (!this.statusLine.satisfies(spec.statusLine, mustBeExhaustive)) { + return false; + } + } else if (isRegExp(spec.statusLine)) { + if (!spec.statusLine.test(this.statusLine.toString())) { + return false; + } + } else if (this.statusLine.toString() !== spec.statusLine) { + return false; + } + } // Make the StatusLine properties available for matching: if (!this.statusLine.satisfies(_.pick(spec, StatusLine.propertyNames), mustBeExhaustive)) { return false;
HttpResponse.prototype.satisfies: Improved support for matching against the status line.
papandreou_messy
train
js
97fc4bf651adbe90d2ead10cf6fffb419e9ffea1
diff --git a/discord/emoji.py b/discord/emoji.py index <HASH>..<HASH> 100644 --- a/discord/emoji.py +++ b/discord/emoji.py @@ -170,7 +170,8 @@ class Emoji(Hashable): @property def url(self): """Returns a URL version of the emoji.""" - return "https://cdn.discordapp.com/emojis/{0.id}.png".format(self) + _format = 'gif' if self.animated else 'png' + return "https://cdn.discordapp.com/emojis/{0.id}.{1}".format(self, _format) @property def roles(self):
Update Emoji.url to point to the GIF version of the animated emoji.
Rapptz_discord.py
train
py
a71828be8f6fd6fe6e211adf6b3b5226d4cc4181
diff --git a/lib/Condorcet/Condorcet.php b/lib/Condorcet/Condorcet.php index <HASH>..<HASH> 100644 --- a/lib/Condorcet/Condorcet.php +++ b/lib/Condorcet/Condorcet.php @@ -324,7 +324,7 @@ class Condorcet // Process - if ( empty($candidate_id) ) // Option_id is empty ... + if ( empty($candidate_id) ) // $candidate_id is empty ... { while ( !$this->try_addCandidate($this->_i_CandidateId) ) { @@ -345,7 +345,7 @@ class Condorcet $this->_Candidates[] = $candidate_id ; $this->_CandidatesCount++ ; - return true ; + return $candidate_id ; } else {
Now, addCandidate always return the final naming of it instead of true
julien-boudry_Condorcet
train
php
2b06646ab5bd789c407f470f555c685227d5c220
diff --git a/bql/planner/planner.go b/bql/planner/planner.go index <HASH>..<HASH> 100644 --- a/bql/planner/planner.go +++ b/bql/planner/planner.go @@ -994,9 +994,10 @@ func (p *queryPlan) Execute(ctx context.Context) (*table.Table, error) { p.grfs = p.stm.InputGraphs() // Retrieve the data. lo := p.stm.GlobalLookupOptions() + loStr := lo.String() tracer.V(2).Trace(p.tracer, func() *tracer.Arguments { return &tracer.Arguments{ - Msgs: []string{"Setting global lookup options to " + lo.String()}, + Msgs: []string{fmt.Sprintf("Setting global lookup options to %s", loStr)}, } }) if err := p.processGraphPattern(ctx, lo); err != nil {
Fix problem of "lookupOptions" being passed as pointer to closure in "global lookup options" tracing message, showing another value when the closure is called since the referenced variable is changed later
google_badwolf
train
go
bbf4b061de8479ce614dea8cc9e83129eaa169a6
diff --git a/support/test-runner/app.js b/support/test-runner/app.js index <HASH>..<HASH> 100644 --- a/support/test-runner/app.js +++ b/support/test-runner/app.js @@ -139,4 +139,12 @@ suite('socket.test.js', function () { }); }); + server('test sending messages', function (io) { + io.sockets.on('connection', function (socket) { + socket.on('message', function (msg) { + socket.send(msg); + }); + }); + }); + }); diff --git a/test/socket.test.js b/test/socket.test.js index <HASH>..<HASH> 100644 --- a/test/socket.test.js +++ b/test/socket.test.js @@ -40,6 +40,20 @@ reason.should().eql('booted'); next(); }); + }, + + 'test sending messages': function (next) { + var socket = create(); + + socket.on('connect', function () { + socket.send('echo'); + + socket.on('message', function (msg) { + msg.should().equal('echo'); + socket.disconnect(); + next(); + }); + }); } };
Added test for sending messages from browser.
tsjing_socket.io-client
train
js,js