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
0911395c4ebdef7799545d986be3b045bad92935
diff --git a/lib/chef/resource/locale.rb b/lib/chef/resource/locale.rb index <HASH>..<HASH> 100644 --- a/lib/chef/resource/locale.rb +++ b/lib/chef/resource/locale.rb @@ -61,7 +61,7 @@ class Chef end execute "reload root's lang profile script" do - command "source source /etc/sysconfig/i18n; source /etc/profile.d/lang.sh" + command "source /etc/sysconfig/i18n; source /etc/profile.d/lang.sh" not_if { updated } end elsif ::File.exist?("/usr/sbin/update-locale")
Fix locale on RHEL 6 / Amazon Linux There was a double source in the command, which would fail.
chef_chef
train
rb
09df998fc50c331d3c53dc17809ff3626b9c71ec
diff --git a/src/cluster/brokerPool.js b/src/cluster/brokerPool.js index <HASH>..<HASH> 100644 --- a/src/cluster/brokerPool.js +++ b/src/cluster/brokerPool.js @@ -205,6 +205,7 @@ module.exports = class BrokerPool { await broker.connect() } catch (e) { if (e.name === 'KafkaJSConnectionError' || e.type === 'ILLEGAL_SASL_STATE') { + await broker.disconnect() // Rebuild the connection since it can't recover from illegal SASL state broker.connection = this.connectionBuilder.build({ host: broker.connection.host,
Make sure the broker is disconnected before a reconnect
tulios_kafkajs
train
js
f3aeec58abe8ff743296e7fcaace58056e842fdb
diff --git a/closure/bin/build/closurebuilder.py b/closure/bin/build/closurebuilder.py index <HASH>..<HASH> 100755 --- a/closure/bin/build/closurebuilder.py +++ b/closure/bin/build/closurebuilder.py @@ -194,7 +194,7 @@ def main(): # Add scripts specified on the command line. for path in args: - sources.add(source.Source(_PathSource(path))) + sources.add(_PathSource(js_path)) logging.info('%s sources scanned.', len(sources))
Incorrect usage of _PathSource for command line argument paths. Fixing in SVN so that this is fixed externally quickly (where it is used). See discussion: <URL>
google_closure-library
train
py
3c31ca81c65edec3889f71105cf5979beafd0522
diff --git a/pysnmp/smi/mibs/ASN1.py b/pysnmp/smi/mibs/ASN1.py index <HASH>..<HASH> 100644 --- a/pysnmp/smi/mibs/ASN1.py +++ b/pysnmp/smi/mibs/ASN1.py @@ -1,9 +1,15 @@ -# Base ASN.1 objects +# ASN.1 objects used in SNMP +from pyasn1.type import univ +from pysnmp.proto import rfc1902 -from pysnmp.asn1 import univ +Integer = rfc1902.Integer32 +OctetString = rfc1902.OctetString -Integer = univ.Integer -OctetString = univ.OctetString +# Instead of using base ASN,1 types we use SNMPv2 SMI ones to make +# SMI objects type-compatible with SNMP protocol values + +# Integer = univ.Integer +# OctetString = univ.OctetString BitString = univ.BitString Null = univ.Null ObjectIdentifier = univ.ObjectIdentifier
Inherit ASN1 module classes from SMIv2 classes rather than from original ASN1 ones for SNMPv2 SMI compatibility. This may need to be reworked.
etingof_pysnmp
train
py
c6db785121440bf220240d024d67f822aaa195ac
diff --git a/ncclient/transport/ssh.py b/ncclient/transport/ssh.py index <HASH>..<HASH> 100644 --- a/ncclient/transport/ssh.py +++ b/ncclient/transport/ssh.py @@ -59,7 +59,7 @@ TICK = 0.1 # * result.group(1) will contain the digit string for a chunk # * result.group(2) will be defined if '##' found # -RE_NC11_DELIM = re.compile(r'\n(?:#([0-9]+)|(##))\n') +RE_NC11_DELIM = re.compile(rb'\n(?:#([0-9]+)|(##))\n') def default_unknown_host_cb(host, fingerprint): @@ -190,7 +190,7 @@ class SSHSession(Session): while True and start < data_len: # match to see if we found at least some kind of delimiter self.logger.debug('_parse11: matching from %d bytes from start of buffer', start) - re_result = RE_NC11_DELIM.match(data[start:].decode('utf-8')) + re_result = RE_NC11_DELIM.match(data[start:]) if not re_result: # not found any kind of delimiter just break; this should only
Parsing of NETCONF <I> frames no longer decodes each chunk of bytes to unicode This was causing a massive performance hit when retrieving a large config.
ncclient_ncclient
train
py
102fe3a8fb7b87fa0bf5002e7ab99a111a101e3c
diff --git a/telebot/asyncio_filters.py b/telebot/asyncio_filters.py index <HASH>..<HASH> 100644 --- a/telebot/asyncio_filters.py +++ b/telebot/asyncio_filters.py @@ -278,7 +278,10 @@ class StateFilter(AdvancedCustomFilter): if text == '*': return True if isinstance(text, list): - new_text = [i.name for i in text] + new_text = [] + for i in text: + if isclass(i): i = i.name + new_text.append(i) text = new_text elif isinstance(text, object): text = text.name
Update asyncio_filters.py
eternnoir_pyTelegramBotAPI
train
py
241f65491c4054544527e589f37a4e56014d6030
diff --git a/invoke/fnInvoke.js b/invoke/fnInvoke.js index <HASH>..<HASH> 100644 --- a/invoke/fnInvoke.js +++ b/invoke/fnInvoke.js @@ -14,8 +14,7 @@ class FNInvoke { 'invoke:invoke': () => BB.bind(this) .then(this.invokeFunction) .then((data) => data.data) - .then(console.log) - .catch(console.log), + .then(console.log), }; } @@ -25,7 +24,15 @@ class FNInvoke { return BB.reject(`${this.options.f} is not a valid function for this service.`); } const url = fnRouteUrl(); - return axios.get(`${url}${this.serverless.service.serviceObject.name}/${f.path}`); + let funcpath = f.path; + if (funcpath === undefined) { + funcpath = f.name; + } + if (this.options.data !== undefined) { + return axios.post(`${url}${this.serverless.service.serviceObject.name}/${funcpath}` + , this.options.data); + } + return axios.get(`${url}${this.serverless.service.serviceObject.name}/${funcpath}`); } }
Remove catch, post if there is a defined data.
fnproject_serverless-fn
train
js
662f33fa620a72400863f9867e14f29e42da3280
diff --git a/src/MigrationsOrganiserServiceProvider.php b/src/MigrationsOrganiserServiceProvider.php index <HASH>..<HASH> 100755 --- a/src/MigrationsOrganiserServiceProvider.php +++ b/src/MigrationsOrganiserServiceProvider.php @@ -25,13 +25,15 @@ class MigrationsOrganiserServiceProvider extends MSP public function register() { + $this->registerCreator(); + $this->registerMigrator(); $this->registerMigrateOrganise(); - $this->commands('migrateorganise'); + $this->commands('command.migrate', 'command.migrate.make', 'command.migrate.organise'); } private function registerMigrateOrganise() { - $this->app['migrateorganise'] = $this->app->share(function($app) + $this->app['command.migrate.organise'] = $this->app->share(function($app) { return new MigrateOrganise($app['files']); });
Registering organise command broke migrate and make. Fixed with explicit calls.
JayBizzle_Laravel-Migrations-Organiser
train
php
07dd24f0a964d1af3629a0f841f5e5f3cab8f4a2
diff --git a/lib/calabash/application.rb b/lib/calabash/application.rb index <HASH>..<HASH> 100644 --- a/lib/calabash/application.rb +++ b/lib/calabash/application.rb @@ -1,5 +1,7 @@ module Calabash class Application + include Calabash::Utility + @@default = nil def self.default
Application: Fix: remember to include utils
calabash_calabash
train
rb
aa5ab65501cffeffbf711e0cbbee24ee2b4f6ca7
diff --git a/grab/base.py b/grab/base.py index <HASH>..<HASH> 100644 --- a/grab/base.py +++ b/grab/base.py @@ -98,6 +98,7 @@ def default_config(): # Only for selenium transport webdriver = 'firefox', + selenium_wait = 1, # Proxy proxy = None, diff --git a/grab/transport/selenium.py b/grab/transport/selenium.py index <HASH>..<HASH> 100644 --- a/grab/transport/selenium.py +++ b/grab/transport/selenium.py @@ -8,6 +8,7 @@ import urllib from StringIO import StringIO import threading import random +import time import os from ..response import Response @@ -194,7 +195,8 @@ class SeleniumTransportExtension(object): self.browser = webdriver.Firefox() self.config = { - 'url': grab.config['url'] + 'url': grab.config['url'], + 'wait': grab.config['selenium_wait'] } #url = self.config['url'] @@ -376,6 +378,7 @@ class SeleniumTransportExtension(object): def request(self): try: self.browser.get(self.config['url']) + time.sleep(self.config['wait']) except Exception, ex: logging.error('', exc_info=ex) raise GrabError(999, 'Error =8-[ ]')
Added option "selenium_wait", which add delay before browser closing to execute JavaScript.
lorien_grab
train
py,py
ac37c65cb597e1850fc68e10b9791c4d2878578c
diff --git a/scripts/create-rule.js b/scripts/create-rule.js index <HASH>..<HASH> 100755 --- a/scripts/create-rule.js +++ b/scripts/create-rule.js @@ -14,6 +14,14 @@ const rulePath = path.resolve(`src/rules/${ruleName}.js`); const testPath = path.resolve(`__tests__/src/rules/${ruleName}-test.js`); const docsPath = path.resolve(`docs/rules/${ruleName}.md`); +const jscodeshiftJSON = require('jscodeshift/package.json'); +const jscodeshiftMain = jscodeshiftJSON.main; +const jscodeshiftPath = require.resolve('jscodeshift'); +const jscodeshiftRoot = jscodeshiftPath.slice( + 0, + jscodeshiftPath.indexOf(jscodeshiftMain) +); + // Validate if (!ruleName) { throw new Error('Rule name is required'); @@ -34,8 +42,8 @@ fs.writeFileSync(docsPath, docBoilerplate); // Add the rule to the index exec([ path.join( - require.resolve('jscodeshift'), - require('jscodeshift/package.json').bin.jscodeshift + jscodeshiftRoot, + jscodeshiftJSON.bin.jscodeshift ), './src/index.js', '-t ./scripts/addRuleToIndex.js',
Keep forgetting this is Git and not Mercurial.
evcohen_eslint-plugin-jsx-a11y
train
js
a5f57a7ef2af05ac1f7b919040e10c1b21de8e56
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 @@ -943,12 +943,11 @@ module ActionDispatch DEFAULT_ACTIONS = [:show, :create, :update, :destroy, :new, :edit] def initialize(entities, options) + super + @as = nil - @name = entities.to_s - @path = (options[:path] || @name).to_s @controller = (options[:controller] || plural).to_s @as = options[:as] - @options = options end def plural
Make use of the inherited initializer.
rails_rails
train
rb
74bbdf2c311bdb78c9c6c96af2270362e8ac76d1
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -14,7 +14,7 @@ module.exports = function (grunt) { }, jshint: { - all: ['Gruntfile.js', '*.js', 'test/**/*.js'], + all: ['Gruntfile.js', '*.js', 'test/**/*.js', '!*.min.js'], options: { jshintrc: '.jshintrc' }
Excluded the moment-jdateformatparser.min.js file from the jshint task.
MadMG_moment-jdateformatparser
train
js
0e2b38f92093497a54554beff5e95045b41d4404
diff --git a/src/WP_CLI/SaltsCommand.php b/src/WP_CLI/SaltsCommand.php index <HASH>..<HASH> 100644 --- a/src/WP_CLI/SaltsCommand.php +++ b/src/WP_CLI/SaltsCommand.php @@ -46,7 +46,7 @@ class SaltsCommand extends Command exit; } - $skipped = $updated->pluck('skipped'); + $skipped = $updated->pluck('skipped')->filter(); $set = $salts->count() - $skipped->count(); if ($set === count($salts)) { @@ -55,7 +55,7 @@ class SaltsCommand extends Command WP_CLI::success("$set salts set."); } - if ($skipped) { + if (! $skipped->isEmpty()) { WP_CLI::line('Some keys were already defined in the environment file.'); WP_CLI::line("Use 'dotenv salts regenerate' to update them."); }
fix skipped check in `salts generate`
aaemnnosttv_wp-cli-dotenv-command
train
php
fd4d4cc6a9ec75cc5af090fd81f9fc21f2d30d05
diff --git a/fedora_messaging/cli.py b/fedora_messaging/cli.py index <HASH>..<HASH> 100644 --- a/fedora_messaging/cli.py +++ b/fedora_messaging/cli.py @@ -76,6 +76,7 @@ def cli(conf): config.conf.load_config(filename=conf) except ValueError as e: raise click.exceptions.BadParameter(e) + config.conf.setup_logging() @cli.command() diff --git a/fedora_messaging/config.py b/fedora_messaging/config.py index <HASH>..<HASH> 100644 --- a/fedora_messaging/config.py +++ b/fedora_messaging/config.py @@ -388,10 +388,14 @@ class LazyConfig(dict): self.load_config() return super(LazyConfig, self).update(*args, **kw) + def setup_logging(self): + if not self.loaded: + self.load_config() + logging.config.dictConfig(self['log_config']) + def load_config(self, filename=None): self.loaded = True self.update(load(filename=filename)) - logging.config.dictConfig(self['log_config']) return self
Don't automatically setup logging on config load Otherwise it may overwrite logging when the config object is used from client applications.
fedora-infra_fedora-messaging
train
py,py
888fb4b8e1f863a00d1c4c26b18ad12c546c5584
diff --git a/docs/templates.rb b/docs/templates.rb index <HASH>..<HASH> 100644 --- a/docs/templates.rb +++ b/docs/templates.rb @@ -23,6 +23,19 @@ module TagTemplateHelper h(prefix + tag.name) end + def url_for(*args) + if object.is_a?(CodeObjects::Base) && + (object.tag('yard.tag') || object.tag('yard.directive')) + obj, self.object = object, Registry.root + url = super + self.object = obj + url + else + super + end + end + alias url_for_file url_for + def linkify(*args) if args.first.is_a?(String) case args.first
Update url_for to link from relative root when listing a tag/directive object
lsegal_yard
train
rb
d5749906d5edae42948c1a2afcba1625c2a840bf
diff --git a/go/libkb/secret_store_secretservice.go b/go/libkb/secret_store_secretservice.go index <HASH>..<HASH> 100644 --- a/go/libkb/secret_store_secretservice.go +++ b/go/libkb/secret_store_secretservice.go @@ -20,7 +20,7 @@ import ( "golang.org/x/crypto/hkdf" ) -const sessionOpenTimeout = 10 * time.Millisecond +const sessionOpenTimeout = 5 * time.Second type SecretStoreRevokableSecretService struct{}
increase timeout on dbus connection to secretservice (#<I>)
keybase_client
train
go
67f9757a9a3bcef45b3abbb79e08b338d13a1b95
diff --git a/alphatwirl/concurrently/HTCondorJobSubmitter.py b/alphatwirl/concurrently/HTCondorJobSubmitter.py index <HASH>..<HASH> 100755 --- a/alphatwirl/concurrently/HTCondorJobSubmitter.py +++ b/alphatwirl/concurrently/HTCondorJobSubmitter.py @@ -295,9 +295,9 @@ def submit_jobs(job_desc, cwd=None): return clusterprocids ##__________________________________________________________________|| -def query_status_for(ids, n_at_a_time=500): +def query_status_for(clusterids, n_at_a_time=500): - ids_split = split_ids(ids, n=n_at_a_time) + ids_split = split_ids(clusterids, n=n_at_a_time) stdout = [ ] for ids_sub in ids_split: procargs = ['condor_q'] + ids_sub + ['-format', '%d.', 'ClusterId', '-format', '%d ', 'ProcId', '-format', '%-2s\n', 'JobStatus']
rename ids clusterids in query_status_for()
alphatwirl_alphatwirl
train
py
8d2b5751fd7214fd40150c5dd80bba6ac6170d86
diff --git a/spec/fake_app/fake_app.rb b/spec/fake_app/fake_app.rb index <HASH>..<HASH> 100644 --- a/spec/fake_app/fake_app.rb +++ b/spec/fake_app/fake_app.rb @@ -18,6 +18,7 @@ module ErdApp end end ErdApp::Application.initialize! +ErdApp::Application.routes.draw {} # models class Author < ActiveRecord::Base
Draw mainapp's routes before appending to it in the engine
amatsuda_erd
train
rb
d8534d70cd673e14dbd764067e5840e8e0d24b94
diff --git a/surrealism/__init__.py b/surrealism/__init__.py index <HASH>..<HASH> 100644 --- a/surrealism/__init__.py +++ b/surrealism/__init__.py @@ -548,6 +548,16 @@ def __replace_random__(_sentence): return _sentence +def __replace_repeat__(_sentence): + """ + HERE BE DRAGONS! + + :param _sentence: + """ + ######### USE SENTENCE_ID 47 for testing! + pass + + def __replace_capitalise__(_sentence): """here we replace all instances of #CAPITALISE and cap the next word. ############
Added skeleton function and changed 1 database record to allow repeating elements.
Morrolan_surrealism
train
py
97efc6e65570bc87cf40cbb9f27cffaa92c6ccc2
diff --git a/src/renderer/Renderer.js b/src/renderer/Renderer.js index <HASH>..<HASH> 100644 --- a/src/renderer/Renderer.js +++ b/src/renderer/Renderer.js @@ -434,7 +434,7 @@ export function unsupportedBrowserReasons (canvas, gl, early = false) { if (!canvas) { canvas = document.createElement('canvas'); } - gl = canvas.getContext('webgl'); + gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl'); } if (!gl) { reasons.push(new CartoRuntimeError(`${crt.WEB_GL} WebGL 1 is unsupported`));
Try to get webgl context for browsers with experimental support
CartoDB_carto-vl
train
js
d97c12dcbb5576d6c4fab1805d4a216469d71c13
diff --git a/lib/librarian/source/git/repository.rb b/lib/librarian/source/git/repository.rb index <HASH>..<HASH> 100644 --- a/lib/librarian/source/git/repository.rb +++ b/lib/librarian/source/git/repository.rb @@ -127,7 +127,7 @@ module Librarian reference = "#{remote}/#{reference}" end - command = %W(rev-parse #{reference} --quiet) + command = %W(rev-list #{reference} -1) run!(command, :chdir => true).strip end
Let's pretend that annotated tags are just like simple tags.
applicationsonline_librarian
train
rb
79881027ec7784000080ed676752c12929a8abc1
diff --git a/tests/perf.py b/tests/perf.py index <HASH>..<HASH> 100644 --- a/tests/perf.py +++ b/tests/perf.py @@ -14,7 +14,7 @@ import time from pathlib import Path from .smoke import setup_logger -TEST_DB = Path("test.db") +TEST_DB = Path(":memory:") TARGET = 2.0 RESULTS = {}
Use in-memory db for perf testing
jreese_aiosqlite
train
py
54659a306e86f13bce20bb170d24d3f4aaaa7bf6
diff --git a/fastlane_core/lib/fastlane_core/version.rb b/fastlane_core/lib/fastlane_core/version.rb index <HASH>..<HASH> 100644 --- a/fastlane_core/lib/fastlane_core/version.rb +++ b/fastlane_core/lib/fastlane_core/version.rb @@ -1,3 +1,3 @@ module FastlaneCore - VERSION = "0.50.1".freeze + VERSION = "0.50.2".freeze end
[fastlane_core] Version bump (#<I>) * Implement common Logs directory in FastlaneCore (#<I>) * Update commander dependency
fastlane_fastlane
train
rb
65bc5b66a6d497b215b021180e726d3a28801a8a
diff --git a/Classes/Log/Reader/ConjunctionReader.php b/Classes/Log/Reader/ConjunctionReader.php index <HASH>..<HASH> 100644 --- a/Classes/Log/Reader/ConjunctionReader.php +++ b/Classes/Log/Reader/ConjunctionReader.php @@ -132,7 +132,7 @@ class ConjunctionReader implements ReaderInterface $logs = array_merge($logs, $reader->findByFilter($filter)); } $orderField = GeneralUtility::underscoredToUpperCamelCase($filter->getOrderField()); - $direction = 'ASC' === $filter->getOrderDirection() ? -1 : 1; + $direction = Filter::SORTING_ASC === $filter->getOrderDirection() ? -1 : 1; usort( $logs, function ($left, $right) use ($orderField, $direction) {
[REFACTOR] Replace external use of string by class constant
vertexvaar_logs
train
php
a12e2d5aa35631a6d84617cc6bce5556ee0a2d56
diff --git a/src/mixins/click-awayable.js b/src/mixins/click-awayable.js index <HASH>..<HASH> 100644 --- a/src/mixins/click-awayable.js +++ b/src/mixins/click-awayable.js @@ -14,16 +14,8 @@ module.exports = { }, _checkClickAway: function(e) { - var el; - if (this.refs.hasOwnProperty("root")) { - el = React.findDOMNode(this.refs.root); - } else { - var message = 'Please set your outermost component\'s ref to \'root\' ' + - 'when using ClickAwayable.'; - console.warn(message); - el = this.getDOMNode(); - } - + var el = React.findDOMNode(this); + // Check if the target is inside the current component if (this.isMounted() && e.target != el &&
[Refactor] Removes unnecessary check in ClickAwayable.js
mui-org_material-ui
train
js
877cf7baa90ef67b2d07fde7dc3faad8d642e221
diff --git a/tests/test_api.py b/tests/test_api.py index <HASH>..<HASH> 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -206,6 +206,7 @@ class TestHttpRunner(ApiServerUnittest): log_file_path = os.path.join(os.getcwd(), 'reports', "test_log_file.log") runner = HttpRunner(failfast=True, log_file=log_file_path) runner.run(self.testcase_cli_path) + time.sleep(1) self.assertTrue(os.path.isfile(log_file_path)) os.remove(log_file_path)
fix: sleep 1 sec to wait log handler
HttpRunner_HttpRunner
train
py
9bef4e365de61e50295827e661e6e03c4a59b8f2
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -65,6 +65,7 @@ setup( 'spamhaus whitelist blacklist'), tests_require=tests_require, extras_require={ - 'test': tests_require + 'test': tests_require, + 'dev-tools': ['pylint', 'restview'] }, )
Add dev-tools extras to distribution package
piotr-rusin_spam-lists
train
py
38456e2c9557ebc9da3d71a55fab793198a73f88
diff --git a/lib/neo4j/session.rb b/lib/neo4j/session.rb index <HASH>..<HASH> 100644 --- a/lib/neo4j/session.rb +++ b/lib/neo4j/session.rb @@ -95,9 +95,14 @@ module Neo4j # # @see also Neo4j::Server::CypherSession#open for :server_db params # @param db_type the type of database, e.g. :embedded_db, or :server_db + # @param [String] endpoint_url The path to the server, either a URL or path to embedded DB + # @param [Hash] params Additional configuration options def open(db_type = :server_db, endpoint_url = nil, params = {}) validate_session_num!(db_type) - register(create_session(db_type, endpoint_url, params), params[:name], params[:default]) + name = params[:name] + default = params[:default] + [:name, :default].each { |k| params.delete(k) } + register(create_session(db_type, endpoint_url, params), name, default) end # @private
remove name and default keys from params hash
neo4jrb_neo4j-core
train
rb
3d25159760367c560ba4cb64625bd3a2ed1fa764
diff --git a/Manager/PathManager.php b/Manager/PathManager.php index <HASH>..<HASH> 100644 --- a/Manager/PathManager.php +++ b/Manager/PathManager.php @@ -348,7 +348,7 @@ class PathManager } } - $this->em->flush(); + //$this->em->flush(); // récursivité sur les enfants possibles. $this->JSONParser($step->children, $user, $workspace, $pathsDirectory, $lvl+1, $currentStep->getId(), 0, $path, $stepsToNotDelete, $excludedResourcesToResourceNodes); }
[PathBundle] Test fix : The EntityManager should not be flushed within a loop - seems to be ok
claroline_Distribution
train
php
2b84118f560754b28ee98c2eed406d6502ff0727
diff --git a/lib/find_process.js b/lib/find_process.js index <HASH>..<HASH> 100644 --- a/lib/find_process.js +++ b/lib/find_process.js @@ -136,11 +136,12 @@ const finders = { if ('pid' in cond) { return row.ProcessId === String(cond.pid) } else if (cond.name) { + const rowName = row.Name || '' // fix #40 if (cond.strict) { - return row.Name === cond.name || (row.Name.endsWith('.exe') && row.Name.slice(0, -4) === cond.name) + return rowName === cond.name || (rowName.endsWith('.exe') && rowName.slice(0, -4) === cond.name) } else { // fix #9 - return matchName(row.CommandLine || row.Name, cond.name) + return matchName(row.CommandLine || rowName, cond.name) } } else { return true @@ -152,7 +153,7 @@ const finders = { // uid: void 0, // gid: void 0, bin: row.ExecutablePath, - name: row.Name, + name: row.Name || '', cmd: row.CommandLine })) resolve(list)
fix: fix undefined issue #<I>
yibn2008_find-process
train
js
952b821a7bc7877b79f2ea77ea9d7f01a01e7840
diff --git a/Cli/Collect.php b/Cli/Collect.php index <HASH>..<HASH> 100644 --- a/Cli/Collect.php +++ b/Cli/Collect.php @@ -13,14 +13,14 @@ use Praxigento\BonusReferral\Service\Bonus\Collect\Request as ARequest; class Collect extends \Praxigento\Core\App\Cli\Cmd\Base { - /** @var \Praxigento\Core\App\Transaction\Database\IManager */ + /** @var \Praxigento\Core\App\Api\Repo\Transaction\Manager */ private $manTrans; /** @var \Praxigento\BonusReferral\Service\Bonus\Collect */ private $servCollect; public function __construct( \Magento\Framework\ObjectManagerInterface $manObj, - \Praxigento\Core\App\Transaction\Database\IManager $manTrans, + \Praxigento\Core\App\Api\Repo\Transaction\Manager $manTrans, \Praxigento\BonusReferral\Service\Bonus\Collect $servCollect ) { parent::__construct(
MOBI-<I> Clean up business transaction and order DB transaction
praxigento_mobi_mod_bonus_referral
train
php
ab2e06baebffd05204178189d619df63a6709c09
diff --git a/pyvisa-py/tcpip.py b/pyvisa-py/tcpip.py index <HASH>..<HASH> 100644 --- a/pyvisa-py/tcpip.py +++ b/pyvisa-py/tcpip.py @@ -93,7 +93,7 @@ class TCPIPSession(Session): if term_char: flags = vxi11.OP_FLAG_TERMCHAR_SET - term_char = str(self.term_char).encode('utf-8')[0] + term_char = str(term_char).encode('utf-8')[0] read_data = b''
Fixes termchar in tcpip
pyvisa_pyvisa-py
train
py
77a11b85e35a35ee679bf079d831772f519b14b1
diff --git a/lib/state_machine/event.rb b/lib/state_machine/event.rb index <HASH>..<HASH> 100644 --- a/lib/state_machine/event.rb +++ b/lib/state_machine/event.rb @@ -190,7 +190,7 @@ module StateMachine if transition = transition_for(object) transition.perform(*args) else - machine.invalidate(object, machine.attribute, :invalid_transition, [[:event, name]]) + machine.invalidate(object, :state, :invalid_transition, [[:event, name]]) false end end
Remove concern about what the machine's attribute is from events
pluginaweek_state_machine
train
rb
faa9e51d36d9f82c57236a5a4a00f096bc90a762
diff --git a/test/crisp-cache-test.js b/test/crisp-cache-test.js index <HASH>..<HASH> 100644 --- a/test/crisp-cache-test.js +++ b/test/crisp-cache-test.js @@ -208,7 +208,6 @@ describe("Get - Advanced", function () { assert.notEqual(crispCacheBasic.cache['a'].staleTtl, crispCacheBasic.cache['b'].staleTtl); done(); }); - done(); }); }); @@ -231,7 +230,6 @@ describe("Get - Advanced", function () { assert.notEqual(crispCacheBasic.cache['a'].expiresTtl, crispCacheBasic.cache['b'].expiresTtl); done(); }); - done(); }); }); @@ -255,7 +253,6 @@ describe("Get - Advanced", function () { assert.notEqual(crispCacheBasic.cache['a'].expiresTtl, crispCacheBasic.cache['b'].expiresTtl); done(); }); - done(); }); }); });
FIX - Dones being called too early in tests.
four43_node-crisp-cache
train
js
3622dc9f1ad31f489be305a93049be343a8bcbb9
diff --git a/tests/testitems.py b/tests/testitems.py index <HASH>..<HASH> 100644 --- a/tests/testitems.py +++ b/tests/testitems.py @@ -38,7 +38,8 @@ class ItemTestCase(InventoryBaseTestCase): # Since sim names are generated by Valve we'll test against those for consistency sim_inv = sim.inventory(sim.inventory_context(self.TEST_ID64)[440], self.TEST_ID64) # steamodd adds craft numbers to all names, valve doesn't, so they should be stripped - cn_exp = re.compile(r" #\d+$") + # steamodd doesn't add crate series to names, valve does, so they should be stripped as well + cn_exp = re.compile(r" (?:Series )?#\d+$") sim_names = set() for item in sim_inv:
Strip another Valve-ism in item names Valve appends the crate series to crate names, we don't.
Lagg_steamodd
train
py
c6c2a2ad7644e3ebc3874353df37da75f2de7d39
diff --git a/src/touch.js b/src/touch.js index <HASH>..<HASH> 100644 --- a/src/touch.js +++ b/src/touch.js @@ -10,7 +10,7 @@ if (xDelta >= yDelta) { return (x1 - x2 > 0 ? 'Left' : 'Right'); } else { - return (y1 - y2 > 0 ? 'Down' : 'Up'); + return (y1 - y2 > 0 ? 'Up' : 'Down'); } }
Corrected direction for vertical swipe.
madrobby_zepto
train
js
0eadc5f22cb19c0994a35b548d1e7ab6fb91269a
diff --git a/src/sos/docker/client.py b/src/sos/docker/client.py index <HASH>..<HASH> 100644 --- a/src/sos/docker/client.py +++ b/src/sos/docker/client.py @@ -371,9 +371,10 @@ class SoS_DockerClient: se.close() if ret != 0: - msg = 'The script has been saved to .sos/{}. To reproduce the error please run:\n``{}``'.format( - tempscript, cmd.replace(tempdir, os.path.abspath('./.sos'))) - shutil.copy(os.path.join(tempdir, tempscript), '.sos') + debug_script_dir = os.path.join(env.exec_dir, '.sos') + msg = 'The script has been saved to {}/{}. To reproduce the error please run:\n``{}``'.format( + debug_script_dir, tempscript, cmd.replace(tempdir, debug_script_dir)) + shutil.copy(os.path.join(tempdir, tempscript), debug_script_dir) if ret == 125: raise RuntimeError('Docker daemon failed (exitcode=125). ' + msg) elif ret == 126:
Save debug script to exec_dir, not user workdir
vatlab_SoS
train
py
d1cc4e7b1982a0cf16b8ca4aa6137476c81f11ac
diff --git a/plugins/Live/Controller.php b/plugins/Live/Controller.php index <HASH>..<HASH> 100644 --- a/plugins/Live/Controller.php +++ b/plugins/Live/Controller.php @@ -133,7 +133,7 @@ class Controller extends \Piwik\Plugin\Controller )); $view->visitData = $visits->getFirstRow()->getColumns(); $view->visitReferralSummary = VisitorProfile::getReferrerSummaryForVisit($visits->getFirstRow()); - $view->showLocation = true; + $view->showLocation = \Piwik\Plugin\Manager::getInstance()->isPluginLoaded('UserCountry'); $this->setWidgetizedVisitorProfileUrl($view); $view->exportLink = $this->getVisitorProfileExportLink(); return $view->render();
Check if UserCountry plugin is activated before showing location data
matomo-org_matomo
train
php
8f28c6f110dc4f8ecf230f26e150974dcb9918d7
diff --git a/lib/puppet/config.rb b/lib/puppet/config.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/config.rb +++ b/lib/puppet/config.rb @@ -299,7 +299,7 @@ class Config case value when true, false, "true", "false": klass = CBoolean - when /^\$/, /^\//: + when /^\$\w+\//, /^\//: klass = CFile when String, Integer, Float: # nothing klass = CElement @@ -823,7 +823,7 @@ Generated on #{Time.now}. obj[:loglevel] = "debug" if self.section - obj.tags = ["puppet", "configuration", self.section] + obj.tags += ["puppet", "configuration", self.section, self.name] end objects << obj objects
Fixing weird cases where configs might think non-files could be files git-svn-id: <URL>
puppetlabs_puppet
train
rb
b6c33e7acbdeeabcc88fa65a2e4e56a72ef372b1
diff --git a/src-gwt/org/opencms/ade/sitemap/client/CmsSitemapTreeItem.java b/src-gwt/org/opencms/ade/sitemap/client/CmsSitemapTreeItem.java index <HASH>..<HASH> 100644 --- a/src-gwt/org/opencms/ade/sitemap/client/CmsSitemapTreeItem.java +++ b/src-gwt/org/opencms/ade/sitemap/client/CmsSitemapTreeItem.java @@ -540,7 +540,7 @@ public class CmsSitemapTreeItem extends CmsLazyTreeItem { public boolean isDropEnabled() { CmsClientSitemapEntry entry = getSitemapEntry(); - return entry.isEditable() && entry.isInNavigation() && entry.isFolderType() && super.isDropEnabled(); + return !entry.hasForeignFolderLock() && entry.isInNavigation() && entry.isFolderType() && super.isDropEnabled(); } /**
Fixed wrong permission check in sitemap editor which caused problems with drag and drop.
alkacon_opencms-core
train
java
303e6740436a900dcd353b1b9b74fa5f0abdba37
diff --git a/src/jsep.js b/src/jsep.js index <HASH>..<HASH> 100644 --- a/src/jsep.js +++ b/src/jsep.js @@ -178,7 +178,13 @@ gobbleSpaces(); var biop, to_check = expr.substr(index, max_binop_len), tc_len = to_check.length; while(tc_len > 0) { - if(binary_ops.hasOwnProperty(to_check)) { + // Don't accept a binary op when it is an identifier. + // Binary ops that start with a identifier-valid character must be followed + // by a non identifier-part valid character + if(binary_ops.hasOwnProperty(to_check) && ( + !isIdentifierStart(exprICode(index)) || + (index+to_check.length< expr.length && !isIdentifierPart(exprICode(index+to_check.length))) + )) { index += tc_len; return to_check; } @@ -283,7 +289,7 @@ return gobbleVariable(); } } - + return false; }, // Parse simple numeric literals: `12`, `3.4`, `.5`. Do this by using a string to
Fix binary ops as identifiers bug
soney_jsep
train
js
c6b9d80eecc79121018fd38f91b89af72d49e082
diff --git a/packages/now-cli/test/integration.js b/packages/now-cli/test/integration.js index <HASH>..<HASH> 100644 --- a/packages/now-cli/test/integration.js +++ b/packages/now-cli/test/integration.js @@ -2189,6 +2189,11 @@ test('should prefill "project name" prompt with folder name', async t => { ); now.stdin.write('\n'); + await waitForPrompt(now, chunk => + chunk.includes('Want to override the settings?') + ); + now.stdin.write('no\n'); + const output = await now; t.is(output.exitCode, 0, formatOutput(output)); }); @@ -2244,6 +2249,11 @@ test('should prefill "project name" prompt with --name', async t => { ); now.stdin.write('\n'); + await waitForPrompt(now, chunk => + chunk.includes('Want to override the settings?') + ); + now.stdin.write('no\n'); + const output = await now; t.is(output.exitCode, 0, formatOutput(output)); }); @@ -2300,6 +2310,11 @@ test('should prefill "project name" prompt with now.json `name`', async t => { ); now.stdin.write('\n'); + await waitForPrompt(now, chunk => + chunk.includes('Want to override the settings?') + ); + now.stdin.write('no\n'); + const output = await now; t.is(output.exitCode, 0, formatOutput(output));
Fix now cli breaking tests (#<I>)
zeit_now-cli
train
js
4205e46608d6144a56b4d215df182eb2e59e77b1
diff --git a/telebot/types.py b/telebot/types.py index <HASH>..<HASH> 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -754,23 +754,28 @@ class InlineQuery(JsonDeserializable): obj = cls.check_json(json_type) id = obj['id'] from_user = User.de_json(obj['from']) + location = None + if 'location' in obj: + location = Location.de_json(obj['location']) query = obj['query'] offset = obj['offset'] - return cls(id, from_user, query, offset) + return cls(id, from_user, location, query, offset) - def __init__(self, id, from_user, query, offset): + def __init__(self, id, from_user, location, query, offset): """ This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results. :param id: string Unique identifier for this query :param from_user: User Sender + :param location: Sender location, only for bots that request user location :param query: String Text of the query :param offset: String Offset of the results to be returned, can be controlled by the bot :return: InlineQuery Object """ self.id = id self.from_user = from_user + self.location = location self.query = query self.offset = offset
Fix missing location object in InlineQuery.
eternnoir_pyTelegramBotAPI
train
py
1d5ae59db98f53976960f6446113ab75cc6ed8b1
diff --git a/middleman-core/lib/middleman-core/sources.rb b/middleman-core/lib/middleman-core/sources.rb index <HASH>..<HASH> 100644 --- a/middleman-core/lib/middleman-core/sources.rb +++ b/middleman-core/lib/middleman-core/sources.rb @@ -168,7 +168,6 @@ module Middleman Contract Symbol, String, Maybe[Bool] => Maybe[SourceFile] def find(type, path, glob=false) watchers - .lazy .select { |d| d.type == type } .map { |d| d.find(path, glob) } .reject { |d| d.nil? } @@ -183,7 +182,6 @@ module Middleman Contract Symbol, String => Bool def exists?(type, path) watchers - .lazy .select { |d| d.type == type } .any? { |d| d.exists?(path) } end @@ -196,7 +194,6 @@ module Middleman Contract Symbol, String => Maybe[HANDLER] def watcher_for_path(type, path) watchers - .lazy .select { |d| d.type == type } .find { |d| d.exists?(path) } end
Lazy isn't in <I> :(
middleman_middleman
train
rb
bf65fb76d36ee1fad93fb5326d989b0e3499b06d
diff --git a/src/Command/ImportCommand.php b/src/Command/ImportCommand.php index <HASH>..<HASH> 100644 --- a/src/Command/ImportCommand.php +++ b/src/Command/ImportCommand.php @@ -70,6 +70,11 @@ class ImportCommand extends AbstractCommand */ private function checkZipFile($archive) { + if (!extension_loaded('zip')) + { + throw new \RuntimeException('Zip extension is not loaded'); + } + $zip = zip_open($archive); if (!\is_resource($zip))
Check if Zip extension is loaded.
joomla-framework_database
train
php
2e452826e919fa63ab4edfe1d5295f95a20dda70
diff --git a/Tests/ArrayHelperTest.php b/Tests/ArrayHelperTest.php index <HASH>..<HASH> 100644 --- a/Tests/ArrayHelperTest.php +++ b/Tests/ArrayHelperTest.php @@ -409,6 +409,21 @@ class ArrayHelperTest extends PHPUnit_Framework_TestCase '2000' => 'Refurbished', '2500' => 'Refurbished' ) + ), + 'Case 3' => array( + // Input + array( + 'New' => array(1000, 1500, 1750), + 'valueNotAnArray' => 2750, + 'withNonScalarValue' => array(2000, array(1000 , 3000)) + ), + // Expected + array( + '1000' => 'New', + '1500' => 'New', + '1750' => 'New', + '2000' => 'withNonScalarValue' + ) ) ); } @@ -1682,5 +1697,8 @@ class ArrayHelperTest extends PHPUnit_Framework_TestCase // Search case insenitive. $this->assertEquals('email', ArrayHelper::arraySearch('FOOBAR', $array, false)); + + // Search non existent value. + $this->assertEquals(false, ArrayHelper::arraySearch('barfoo', $array)); } }
Add assertion for arraysearch method in UT.
joomla-framework_utilities
train
php
ab634dcdf1ca2264c5bdc6a2c2ba862b2484dd3d
diff --git a/Plugin.php b/Plugin.php index <HASH>..<HASH> 100644 --- a/Plugin.php +++ b/Plugin.php @@ -80,7 +80,7 @@ class Plugin extends PluginBase if (!$preview) return $input; - return preg_replace('|\<img alt="([0-9]+)" src="image" \/>|m', + return preg_replace('|\<img src="image" alt="([0-9]+)"([^>]*)\/>|m', '<span class="image-placeholder" data-index="$1"> <span class="dropzone"> <span class="label">Click or drop an image...</span>
Fix for change to php-markdown
rainlab_blog-plugin
train
php
535f673df1d9b5386c91fb40b3bd57487630cc96
diff --git a/spec/routing_hook_spec.rb b/spec/routing_hook_spec.rb index <HASH>..<HASH> 100644 --- a/spec/routing_hook_spec.rb +++ b/spec/routing_hook_spec.rb @@ -68,7 +68,7 @@ describe "Routing hooks" do describe "/faye" do - let(:routes) { Dummy::Application.routes.routes.select { |v| v.path =~ /^\/faye_without_extension.*$/ } } + let(:routes) { Dummy::Application.routes.routes.select { |v| v.name =~ /^faye_without_extension.*$/ } } let(:client) { Faye::Client.new("http://localhost:3000/faye_without_extension") } it_should_behave_like "an automatically added route" @@ -77,7 +77,7 @@ describe "Routing hooks" do end describe "/faye_with_extension" do - let(:routes) { Dummy::Application.routes.routes.select { |v| v.path =~ /^\/faye_with_extension.*$/ } } + let(:routes) { Dummy::Application.routes.routes.select { |v| v.name =~ /^faye_with_extension.*$/ } } let(:client) { Faye::Client.new("http://localhost:3000/faye_with_extension") } it_should_behave_like "an automatically added route"
Fixes two additional specs. Fixes "should only be one route" Fixes "should route to FayeRails::RackAdapter"
jamesotron_faye-rails
train
rb
62c2b17909865bd5efdc9376da3adc4630f2c7d7
diff --git a/locale/af.js b/locale/af.js index <HASH>..<HASH> 100644 --- a/locale/af.js +++ b/locale/af.js @@ -1,4 +1,4 @@ -$.fullCalendar.locale("fr", { +$.fullCalendar.locale("af", { buttonText: { year: "Jaar", month: "Maand",
Update af.js forgot to change language short name in file
fullcalendar_fullcalendar
train
js
388ec244529b94479a32c943a1f76b786252bcd7
diff --git a/src/feat/test/dummies.py b/src/feat/test/dummies.py index <HASH>..<HASH> 100644 --- a/src/feat/test/dummies.py +++ b/src/feat/test/dummies.py @@ -111,7 +111,7 @@ class DummyAgent(DummyBase): self._delayed_calls = dict() def reset(self): - self.protocols = list() + del self.protocols[:] DummyBase.reset(self) def get_database(self):
Fix reseting protocols of DummyMedium.
f3at_feat
train
py
fe06b4acbb02d2a3a4b16e68d047c89785b18a13
diff --git a/apiserver/facades/client/charmhub/convert.go b/apiserver/facades/client/charmhub/convert.go index <HASH>..<HASH> 100644 --- a/apiserver/facades/client/charmhub/convert.go +++ b/apiserver/facades/client/charmhub/convert.go @@ -103,6 +103,7 @@ func transformChannelMap(channelMap []transport.ChannelMap) ([]string, map[strin channels := make(map[string]params.Channel, len(channelMap)) for _, cm := range channelMap { ch := cm.Channel + // Per the charmhub/snap channel spec. if ch.Track == "" { ch.Track = "latest" }
add coment to change of empty string to latest
juju_juju
train
go
52daf73faa86692675e2083e6799a0e60e4bef47
diff --git a/pylisp/packet/lisp/control/map_referral.py b/pylisp/packet/lisp/control/map_referral.py index <HASH>..<HASH> 100644 --- a/pylisp/packet/lisp/control/map_referral.py +++ b/pylisp/packet/lisp/control/map_referral.py @@ -122,7 +122,7 @@ class LISPMapReferralMessage(LISPControlMessage): # Add the records for record in self.records: - bitstream += record.to_bytes() + bitstream += record.to_bitstream() return bitstream.bytes
Fix bug in MapReferral packet building
steffann_pylisp
train
py
71bd00cf0028aadc653d34d11be9b7d403e5d048
diff --git a/iptables.go b/iptables.go index <HASH>..<HASH> 100644 --- a/iptables.go +++ b/iptables.go @@ -166,5 +166,10 @@ func Raw(args ...string) ([]byte, error) { return nil, fmt.Errorf("iptables failed: iptables %v: %s (%s)", strings.Join(args, " "), output, err) } + // ignore iptables' message about xtables lock + if strings.Contains(string(output), "waiting for it to exit") { + output = []byte("") + } + return output, err }
pkg/iptables: * do not consider iptables' output an error in case of xtables lock Docker-DCO-<I>-
flynn_flynn
train
go
804c87128adc5b6575258b4519cf1e64331d57c6
diff --git a/tests/test_renderengine.py b/tests/test_renderengine.py index <HASH>..<HASH> 100644 --- a/tests/test_renderengine.py +++ b/tests/test_renderengine.py @@ -317,6 +317,24 @@ class RenderTests(unittest.TestCase): self._assert_render(expected, '{{=$ $=}} {{foo}} ') self._assert_render(expected, '{{=$ $=}} {{foo}} $={{ }}=$') # was yielding u' '. + def test_section__output_not_interpolated(self): + """ + Check that rendered section output is not interpolated. + + """ + template = '{{#section}}{{template}}{{/section}}: {{planet}}' + context = {'section': True, 'template': '{{planet}}', 'planet': 'Earth'} + self._assert_render(u'{{planet}}: Earth', template, context) + + def test_section__context_precedence(self): + """ + Check that items higher in the context stack take precedence. + + """ + template = '{{entree}} : {{#vegetarian}}{{entree}}{{/vegetarian}}' + context = {'entree': 'chicken', 'vegetarian': {'entree': 'beans and rice'}} + self._assert_render(u'chicken : beans and rice', template, context) + def test_sections__nested_truthy(self): """ Check that "nested truthy" sections get rendered.
Added two rendering test cases re: sections. The two test cases test, respectively, (1) context precedence and (2) that section output not be rendered. The two test cases were originally proposed for inclusion in the Mustache spec test cases in mustache/spec issues #<I> and #<I>: * <URL>
defunkt_pystache
train
py
266f536e03f3e847eb65da1631473cf3bebd8485
diff --git a/alignak/objects/realm.py b/alignak/objects/realm.py index <HASH>..<HASH> 100644 --- a/alignak/objects/realm.py +++ b/alignak/objects/realm.py @@ -216,7 +216,6 @@ class Realm(Itemgroup): :type member: list :return: None """ - print("Realm, add sub member: %s" % member) self.all_sub_members.extend(member) def get_realm_members(self):
Clean the configuration dispatcher log and ping attempts
Alignak-monitoring_alignak
train
py
0b493ac8d4d82eee4f1b3e68cf34aeca50d3e631
diff --git a/version/version.go b/version/version.go index <HASH>..<HASH> 100644 --- a/version/version.go +++ b/version/version.go @@ -17,5 +17,5 @@ package version var ( - Version = "0.5.0-alpha.1" + Version = "0.5.0-alpha.2" )
version: bump to alpha<I>
etcd-io_etcd
train
go
e9ea2388dedccb5374a7a85f2468cec795afd2c4
diff --git a/app/ui/components/editors/environment-editor.js b/app/ui/components/editors/environment-editor.js index <HASH>..<HASH> 100644 --- a/app/ui/components/editors/environment-editor.js +++ b/app/ui/components/editors/environment-editor.js @@ -54,11 +54,13 @@ class EnvironmentEditor extends React.PureComponent<Props, State> { } } - this.props.didChange(); - // Call this last in case component unmounted if (this.state.error !== error || this.state.warning !== warning) { - this.setState({error, warning}); + this.setState({error, warning}, () => { + this.props.didChange(); + }); + } else { + this.props.didChange(); } }
Minor fix for environment editor not saving right after error
getinsomnia_insomnia
train
js
f2287da632fe3dc86791ad2a9f0de3b09a423657
diff --git a/montblanc/impl/rime/v5/CompositeRimeSolver.py b/montblanc/impl/rime/v5/CompositeRimeSolver.py index <HASH>..<HASH> 100644 --- a/montblanc/impl/rime/v5/CompositeRimeSolver.py +++ b/montblanc/impl/rime/v5/CompositeRimeSolver.py @@ -249,7 +249,7 @@ class CompositeRimeSolver(MontblancNumpySolver): nsrc, npsrc, ngsrc, nssrc, ... """ src_nr_var_counts = mbu.sources_to_nr_vars( - self._slvr_cfg[Options.SOURCES]) + self.config()[Options.SOURCES]) src_nr_vars = mbu.source_nr_vars() nsrc = self.dim_local_size(Options.NSRC) diff --git a/montblanc/solvers/rime_solver.py b/montblanc/solvers/rime_solver.py index <HASH>..<HASH> 100644 --- a/montblanc/solvers/rime_solver.py +++ b/montblanc/solvers/rime_solver.py @@ -182,6 +182,10 @@ class RIMESolver(HyperCube): return D + def config(self): + """ Returns the configuration dictionary for this solver """ + return self._slvr_cfg + def register_array(self, name, shape, dtype, **kwargs): """ Register an array with this Solver object.
Add a config() member to RIMESolver Returns the solver configuration dictionary
ska-sa_montblanc
train
py,py
fdf06f9f834e766f26961ab4dc790a286c6b1722
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,21 @@ -var PropTypes = require('../prop-types'); +// ------------------------------------------------ +// load original React prop-types +// ------------------------------------------------ +var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && + Symbol.for && + Symbol.for('react.element')) || + 0xeac7; + +var isValidElement = function(object) { + return typeof object === 'object' && + object !== null && + object.$$typeof === REACT_ELEMENT_TYPE; +}; +var throwOnDirectAccess = true; +var PropTypes = require('../prop-types/factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess); +// ------------------------------------------------ +// ------------------------------------------------ +// ------------------------------------------------ var AxePropTypes = {};
fixed: load react's dev prop-types instead of the prod empty one
sammysaglam_axe-prop-types
train
js
9d14c9bb9d4dd04cf4008774d859e9e2da10b021
diff --git a/api.php b/api.php index <HASH>..<HASH> 100644 --- a/api.php +++ b/api.php @@ -1137,9 +1137,11 @@ class PHP_CRUD_API { protected function applyBeforeHandler(&$action,&$database,&$table,&$ids,&$callback,&$inputs) { if (is_callable($callback,true)) { $max = count($ids)?:count($inputs); - $origaction = $action; + $initials = array('action'=>$action,'database'=>$database,'table'=>$table); for ($i=0;$i<$max;$i++) { - $action = $origaction; + $action = $initials['action']; + $database = $initials['database']; + $table = $initials['table']; if (!isset($ids[$i])) $ids[$i] = false; if (!isset($inputs[$i])) $inputs[$i] = false; $callback($action,$database,$table,$ids[$i],$inputs[$i]);
bugfix in line with #<I>
mevdschee_php-crud-api
train
php
9d47d1c1fa34d6da86457b82595d7afbd365e238
diff --git a/lib/discordrb/bot.rb b/lib/discordrb/bot.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/bot.rb +++ b/lib/discordrb/bot.rb @@ -663,6 +663,15 @@ module Discordrb rescue RestClient::BadRequest LOGGER.error('User login failed due to an invalid email or password!') raise + rescue SocketError, RestClient::RequestFailed => e # RequestFailed handles the 52x error codes Cloudflare sometimes sends that aren't covered by specific RestClient classes + if login_attempts && login_attempts > 100 + LOGGER.error("User login failed permanently after #{login_attempts} attempts") + raise + else + LOGGER.error("User login failed! Trying again in 5 seconds, #{100 - login_attempts} remaining") + LOGGER.log_exception(e) + retry + end end def retrieve_token(email, password, token_cache)
Reimplement the rest of the old error code
meew0_discordrb
train
rb
09a3a7646a80b44c94a057bb5139d23b5b5b3e2b
diff --git a/obdalib-core/src/main/java/it/unibz/krdb/obda/utils/JdbcTypeMapper.java b/obdalib-core/src/main/java/it/unibz/krdb/obda/utils/JdbcTypeMapper.java index <HASH>..<HASH> 100644 --- a/obdalib-core/src/main/java/it/unibz/krdb/obda/utils/JdbcTypeMapper.java +++ b/obdalib-core/src/main/java/it/unibz/krdb/obda/utils/JdbcTypeMapper.java @@ -54,7 +54,7 @@ public class JdbcTypeMapper { sqlToQuest.put(Types.REAL, COL_TYPE.DOUBLE); sqlToQuest.put(Types.DATE, COL_TYPE.DATE); sqlToQuest.put(Types.TIME, COL_TYPE.TIME); - //sqlToQuest.put(Types.TIMESTAMP, COL_TYPE.DATETIME); + sqlToQuest.put(Types.TIMESTAMP, COL_TYPE.DATETIME); //GX: needs check sqlToQuest.put(Types.BOOLEAN, COL_TYPE.BOOLEAN); sqlToQuest.put(Types.BIT, COL_TYPE.BOOLEAN); // typeMapper.put(Types.BINARY, dfac.getDataTypePredicateBinary());
reverts the change in JdbcTypeMapper
ontop_ontop
train
java
b2617f0b993175ec7d7560faceca416311031205
diff --git a/version.php b/version.php index <HASH>..<HASH> 100644 --- a/version.php +++ b/version.php @@ -26,7 +26,7 @@ defined('MOODLE_INTERNAL') || die; $module->version = 2011032000; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2010120700; // Requires this Moodle version +$module->requires = 2011070101; // Requires this Moodle version $module->cron = 0; // Period for cron to check this module (secs) $module->component = 'mod_book'; // Full name of the plugin (used for diagnostics)
future versions of mod_book are going to require at least Moodle <I>
moodle_moodle
train
php
a88b3c5f05a4d4341de0bdf77cf2024230c86581
diff --git a/taxi/app.py b/taxi/app.py index <HASH>..<HASH> 100755 --- a/taxi/app.py +++ b/taxi/app.py @@ -30,6 +30,20 @@ class ProjectNotFoundError(Exception): def term_unicode(string): return unicode(string, sys.stdin.encoding) +def cat(options, args): + """ + |\ _,,,---,,_ + /,`.-'`' -. ;-;;,_ + |,4- ) )-,_..;\ ( `'-' + '---''(_/--' `-'\_) + + Soft kitty, warm kitty + Little ball of fur + Happy kitty, sleepy kitty + Purr, purr, purr""" + + print(cat.__doc__) + def alias(options, args): """Usage: alias [alias] alias [project_id/activity_id] @@ -656,6 +670,7 @@ def main(): (['autofill'], autofill), (['clean-aliases'], clean_aliases), (['alias'], alias), + (['cat', 'kitty', 'ohai'], cat), ] if len(args) == 0 or (len(args) == 1 and args[0] == 'help'):
add a cat, because everyone loves cats
liip_taxi
train
py
4897e71fffba4c5a75eb3d83273cf22e59161d9e
diff --git a/client/lib/plans/constants.js b/client/lib/plans/constants.js index <HASH>..<HASH> 100644 --- a/client/lib/plans/constants.js +++ b/client/lib/plans/constants.js @@ -1278,16 +1278,14 @@ export const FEATURES_LIST = { getSlug: () => FEATURE_EMAIL_LIVE_CHAT_SUPPORT, getTitle: () => i18n.translate( 'Email & Live Chat Support' ), getDescription: () => - i18n.translate( - 'Hands-on support to help you set up your site ' + 'exactly how you want it.' - ), + i18n.translate( 'Live chat support to help you get started with your site.' ), }, [ FEATURE_PREMIUM_SUPPORT ]: { getSlug: () => FEATURE_PREMIUM_SUPPORT, getTitle: () => i18n.translate( 'Priority Support' ), getDescription: () => - i18n.translate( 'Hands-on support to help you set up your site exactly how you want it.' ), + i18n.translate( 'Live chat support to help you get started with Jetpack.' ), }, [ FEATURE_STANDARD_SECURITY_TOOLS ]: {
Plans - fix Priority support tooltip to be a bit clearer (#<I>) * Plans - fix Priority support tooltip to be a bit clearer
Automattic_wp-calypso
train
js
5d664da902902c91925296361df7e67f083fa2dd
diff --git a/Swat/SwatError.php b/Swat/SwatError.php index <HASH>..<HASH> 100644 --- a/Swat/SwatError.php +++ b/Swat/SwatError.php @@ -241,7 +241,7 @@ class SwatError { ob_start(); - printf("%s Error:\n\nMessage:\n\t%s\n\n". + printf("%s:\n\nMessage:\n\t%s\n\n". "Thrown in file '%s' on line %s.\n\n", $this->getSeverityString(), $this->message,
for text output, use only the severity string for the title instead of always appending 'Error'. svn commit r<I>
silverorange_swat
train
php
0fce928a3edbd3963e6874febc998eacc2b512c3
diff --git a/Controller/MinifyController.php b/Controller/MinifyController.php index <HASH>..<HASH> 100644 --- a/Controller/MinifyController.php +++ b/Controller/MinifyController.php @@ -70,8 +70,14 @@ class MinifyController extends Controller $file = $base.'/'.$file; } + $baseUrl = $this->get('templating.helper.assets')->getUrl(''); + $_GET = array(); - $_GET['b'] = trim($this->get('templating.helper.assets')->getUrl(''), '/'); + + if ($baseUrl !== '/') { + $_GET['b'] = trim($baseUrl, '/'); + } + $_GET['f'] = implode(',', $files); }
Bugfix: Don't set base url when it's empty
rednose-public_RednoseComboHandlerBundle
train
php
8500aa14c146126d7d32c2c0652d9028ae823dea
diff --git a/src/infrastructure/InMemoryView.js b/src/infrastructure/InMemoryView.js index <HASH>..<HASH> 100644 --- a/src/infrastructure/InMemoryView.js +++ b/src/infrastructure/InMemoryView.js @@ -122,7 +122,7 @@ module.exports = class InMemoryView { const r = []; for (const entry of this._map.entries()) { - if (filter && filter(entry[1], entry[0])) + if (!filter || filter(entry[1], entry[0])) r.push(entry); }
- fix all view records retrieving w\o filter
snatalenko_node-cqrs
train
js
40e158bf6031b7766036908c644eb7466f781bd7
diff --git a/lib/reader/jdl_reader.js b/lib/reader/jdl_reader.js index <HASH>..<HASH> 100644 --- a/lib/reader/jdl_reader.js +++ b/lib/reader/jdl_reader.js @@ -27,7 +27,7 @@ function readContent(content) { throw new buildException( exceptions.IllegalArgument, 'The content must be passed.'); } - return pegjsParser.parse(content); + return pegjsParser.parse(filterJDLDirectives(content)); } function checkAllTheFilesAreJDLFiles(files) { @@ -61,3 +61,7 @@ function readFileContent(file) { } return fs.readFileSync(file, 'utf-8').toString(); } + +function filterJDLDirectives(content){ + return content.replace(/^\u0023.*\n?/mg,''); +}
added filter in jdl_reader to prvent jdl_directives form beeing parsed
jhipster_generator-jhipster
train
js
d5b3f0b6de225aee2045edc987df3fc595f3d069
diff --git a/langserver/langserver_test.go b/langserver/langserver_test.go index <HASH>..<HASH> 100644 --- a/langserver/langserver_test.go +++ b/langserver/langserver_test.go @@ -191,6 +191,7 @@ func TestServer(t *testing.T) { "a.go": "package p; var A int", "a_test.go": `package p; import "test/pkg/b"; var X = b.B; func TestB() {}`, "b/b.go": "package b; var B int; func C() int { return B };", + "c/c.go": `package c; import "test/pkg/b"; var X = b.B;`, }, cases: lspTestCases{ wantHover: map[string]string{ @@ -202,6 +203,7 @@ func TestServer(t *testing.T) { "/src/test/pkg/a_test.go:1:43", "/src/test/pkg/b/b.go:1:16", "/src/test/pkg/b/b.go:1:45", + "/src/test/pkg/c/c.go:1:43", }, "a_test.go:1:41": []string{ "/src/test/pkg/a_test.go:1:19",
references: Larger importgraph for test I was making some manual changes to test incremental importgraph references code. I still need to create automated tests for these changes.
sourcegraph_go-langserver
train
go
63b16f6040c9f8ac5c55c1c6818eca2d9b586fa4
diff --git a/fec.go b/fec.go index <HASH>..<HASH> 100644 --- a/fec.go +++ b/fec.go @@ -26,6 +26,7 @@ type ( next uint32 // next seqid enc reedsolomon.Encoder shards [][]byte + shards2 [][]byte // for calcECC shardsflag []bool paws uint32 // Protect Against Wrapped Sequence numbers lastCheck uint32 @@ -59,6 +60,7 @@ func newFEC(rxlimit, dataShards, parityShards int) *FEC { } fec.enc = enc fec.shards = make([][]byte, fec.shardSize) + fec.shards2 = make([][]byte, fec.shardSize) fec.shardsflag = make([]bool, fec.shardSize) return fec } @@ -228,7 +230,7 @@ func (fec *FEC) calcECC(data [][]byte, offset, maxlen int) (ecc [][]byte) { if len(data) != fec.shardSize { return nil } - shards := make([][]byte, fec.shardSize) + shards := fec.shards2 for k := range shards { shards[k] = data[k][offset:maxlen] }
add a cache for FEC's calcECC for zero allocation
xtaci_kcp-go
train
go
686ccc12d9ba5660bfcfca40c53dbc35b4ce210b
diff --git a/manage/sawtooth_manage/docker.py b/manage/sawtooth_manage/docker.py index <HASH>..<HASH> 100644 --- a/manage/sawtooth_manage/docker.py +++ b/manage/sawtooth_manage/docker.py @@ -140,7 +140,7 @@ class DockerNodeController(NodeController): command = 'bash -c "sawtooth admin keygen && \ validator {} -v"' if len(peers) > 0: - command = command.format('--peers ' + " ".join(peers)) + command = command.format('--peers ' + ",".join(peers)) else: command = command.format('')
Update sawtooth manage to generate correct --peers command line args
hyperledger_sawtooth-core
train
py
9abeb4b99403a95c3a7c8e8a419dbba660849efb
diff --git a/src/Illuminate/Validation/Validator.php b/src/Illuminate/Validation/Validator.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Validation/Validator.php +++ b/src/Illuminate/Validation/Validator.php @@ -863,7 +863,7 @@ class Validator implements MessageProviderInterface { */ protected function validateAlphaDash($attribute, $value) { - return preg_match('/^([-a-z0-9_-])+$/i', $value); + return preg_match('/^([a-z0-9_-])+$/i', $value); } /**
Remove extra dash from reg-ex.
laravel_framework
train
php
a7405c4a55ee361dabaa3422e2278c5c5a8c071c
diff --git a/bits/99_footer.js b/bits/99_footer.js index <HASH>..<HASH> 100644 --- a/bits/99_footer.js +++ b/bits/99_footer.js @@ -3,7 +3,7 @@ /*:: declare var define:any; */ if(typeof exports !== 'undefined') make_xlsx_lib(exports); else if(typeof module !== 'undefined' && module.exports) make_xlsx_lib(module.exports); -else if(typeof define === 'function' && define.amd) define('xlsx-dist', function() { if(!XLSX.version) make_xlsx_lib(XLSX); return XLSX; }); +else if(typeof define === 'function' && define.amd) define('xlsx', function() { if(!XLSX.version) make_xlsx_lib(XLSX); return XLSX; }); else make_xlsx_lib(XLSX); /* NOTE: the following extra line is needed for "Lightning Locker Service" */ if(typeof window !== 'undefined' && !window.XLSX) window.XLSX = XLSX;
Fixed RequireJS export name [ci skip]
SheetJS_js-xlsx
train
js
994fb48e62f73397889c244355d91fa2741d2feb
diff --git a/timezones/__init__.py b/timezones/__init__.py index <HASH>..<HASH> 100644 --- a/timezones/__init__.py +++ b/timezones/__init__.py @@ -1,4 +1,4 @@ -VERSION = (0, 1, 4, "final") +VERSION = (0, 2, 0, "dev", 1) @@ -6,6 +6,8 @@ def get_version(): if VERSION[3] == "final": return "%s.%s.%s" % (VERSION[0], VERSION[1], VERSION[2]) elif VERSION[3] == "dev": + if VERSION[2] == 0: + return "%s.%s.%s%s" % (VERSION[0], VERSION[1], VERSION[3], VERSION[4]) return "%s.%s.%s.%s%s" % (VERSION[0], VERSION[1], VERSION[2], VERSION[3], VERSION[4]) else: return "%s.%s.%s%s" % (VERSION[0], VERSION[1], VERSION[2], VERSION[3])
bumped to <I>.dev1 and fixed version generation when VERSION[2] == 0
brosner_django-timezones
train
py
f778f814a9e50fd735ee77d2ba66946674401073
diff --git a/pull_into_place/structures.py b/pull_into_place/structures.py index <HASH>..<HASH> 100644 --- a/pull_into_place/structures.py +++ b/pull_into_place/structures.py @@ -136,7 +136,7 @@ def read_and_calculate(workspace, pdb_paths): records = [] from scipy.spatial.distance import euclidean - from tools.bio.basics import residue_type_3to1_map + from klab.bio.basics import residue_type_3to1_map for i, path in enumerate(pdb_paths): record = {'path': os.path.basename(path)} @@ -161,6 +161,10 @@ def read_and_calculate(workspace, pdb_paths): print "\nFailed to read '{}'".format(path) continue + if not lines: + print "\n{} is empty".format(path) + continue + # Get different information from different lines in the PDB file. Some # of these lines are specific to different simulations.
Don't try to load empty PDB files.
Kortemme-Lab_pull_into_place
train
py
d51ab459951cfcb14ec2487e5e6329ff31ff4042
diff --git a/src/UsersAnyDataset.php b/src/UsersAnyDataset.php index <HASH>..<HASH> 100644 --- a/src/UsersAnyDataset.php +++ b/src/UsersAnyDataset.php @@ -249,8 +249,8 @@ class UsersAnyDataset extends UsersBase } foreach ($allProp as $property => $value) { - foreach ($row->getAsArray($property) as $value) { - $userModel->addProperty(new UserPropertiesModel($property, $value)); + foreach ($row->getAsArray($property) as $eachValue) { + $userModel->addProperty(new UserPropertiesModel($property, $eachValue)); } }
More refactoring. Rename CUSTOM to USERPROPERTY.
byjg_authuser
train
php
a56ca086bbbc7ad9809cc6dc686d3e8624593412
diff --git a/apiserver/service/service.go b/apiserver/service/service.go index <HASH>..<HASH> 100644 --- a/apiserver/service/service.go +++ b/apiserver/service/service.go @@ -125,6 +125,18 @@ func deployService(st *state.State, owner string, args params.ServiceDeploy) err // Try to find the charm URL in state first. ch, err := st.Charm(curl) + // TODO(wallyworld) - remove for 2.0 beta4 + if errors.IsNotFound(err) { + // Clients written to expect 1.16 compatibility require this next block. + if curl.Schema != "cs" { + return errors.Errorf(`charm url has unsupported schema %q`, curl.Schema) + } + if err = AddCharmWithAuthorization(st, params.AddCharmWithAuthorization{ + URL: args.CharmUrl, + }); err == nil { + ch, err = st.Charm(curl) + } + } if err != nil { return errors.Trace(err) }
Restore some old deploy code for now to fix the gui
juju_juju
train
go
efa3cd62696c8fa6acffacfd9f218256b77d9708
diff --git a/brozzler/worker.py b/brozzler/worker.py index <HASH>..<HASH> 100755 --- a/brozzler/worker.py +++ b/brozzler/worker.py @@ -44,8 +44,10 @@ class BrozzlerWorker: } if self._proxy_server: ydl_opts["proxy"] = "http://{}".format(self._proxy_server) - # see https://github.com/rg3/youtube-dl/issues/6087 - os.environ["http_proxy"] = "http://{}".format(self._proxy_server) + ## XXX (sometimes?) causes chrome debug websocket to go through + ## proxy. Maybe not needed thanks to hls_prefer_native. + ## # see https://github.com/rg3/youtube-dl/issues/6087 + ## os.environ["http_proxy"] = "http://{}".format(self._proxy_server) self._ydl = youtube_dl.YoutubeDL(ydl_opts) def _next_url(self, site):
don't set http_proxy environment variable, because it affects things we don't want it to
internetarchive_brozzler
train
py
8516080dcf525d63c88306f883353f78eaf0524c
diff --git a/test/replica/replset_tools.py b/test/replica/replset_tools.py index <HASH>..<HASH> 100644 --- a/test/replica/replset_tools.py +++ b/test/replica/replset_tools.py @@ -199,7 +199,11 @@ def stepdown_primary(): primary = get_primary() if primary: c = pymongo.Connection(primary) - c.admin.command('replSetStepDown', 20) + # replSetStepDown causes mongod to close all connections + try: + c.admin.command('replSetStepDown', 20) + except: + pass def restart_members(members): diff --git a/test/replica/test_replica_set.py b/test/replica/test_replica_set.py index <HASH>..<HASH> 100644 --- a/test/replica/test_replica_set.py +++ b/test/replica/test_replica_set.py @@ -160,7 +160,7 @@ class TestHealthMonitor(unittest.TestCase): secondaries = c.secondaries def primary_changed(): - for _ in xrange(20): + for _ in xrange(30): if c.primary != primary: return True time.sleep(1)
Make stepdown test work with MongoDB-<I>. MongoDB-<I> wasn't closing connections during primary stepdown. That was fixed in <I>.
mongodb_mongo-python-driver
train
py,py
8ae4d635c29995db7f7c1027bb6ca1691f484289
diff --git a/src/Metrics/Client.php b/src/Metrics/Client.php index <HASH>..<HASH> 100644 --- a/src/Metrics/Client.php +++ b/src/Metrics/Client.php @@ -56,6 +56,8 @@ class Client { $client = new Curl(); $request->addHeader('Authorization: Basic ' . base64_encode($this->email . ':' . $this->token)); + $request->addHeader('User-Agent: ' . $this->getUserAgent()); + if (count($data)) { $request->addHeader('Content-Type: application/json'); $request->setContent(json_encode($data)); @@ -78,6 +80,15 @@ class Client { } /** + * Returns user agent to identify libary. + * + * @return sting + */ + protected function getUserAgent() { + return sprintf("librato-metrics/%s (PHP %s)", self::API_VERSION, PHP_VERSION); + } + + /** * Fetches data from Metrics API. * * @param string $path Path on Metrics API to request. For Example '/metrics/'.
Added HTTP UserAgent to identify PHP bindings
OleMchls_PHP-Metrics-Client
train
php
1b61984aff3992e77c40337551102eb4a1149e43
diff --git a/lib/restfolia/http/behaviour.rb b/lib/restfolia/http/behaviour.rb index <HASH>..<HASH> 100644 --- a/lib/restfolia/http/behaviour.rb +++ b/lib/restfolia/http/behaviour.rb @@ -55,13 +55,13 @@ module Restfolia::HTTP # Public: Creates a Store. def initialize - self.clear + self.clear! @helpers = Helpers.new end # Public: clear all defined behaviours. # Returns nothing. - def clear + def clear! @behaviours = {} @behaviours_range = {} nil diff --git a/samples/http_behaviour.rb b/samples/http_behaviour.rb index <HASH>..<HASH> 100644 --- a/samples/http_behaviour.rb +++ b/samples/http_behaviour.rb @@ -7,7 +7,7 @@ require "restfolia" Restfolia::HTTP.behaviours do - clear #clean all defined behaviours + clear! #clear all defined behaviours on(200) do |http_response| content_type = (http_response["content-type"] =~ /application\/json/)
Added bang to clear method from HTTP behaviours
rogerleite_restfolia
train
rb,rb
11709c4381027421368e96aa2067611b1da6ea51
diff --git a/synapse/lib/layer.py b/synapse/lib/layer.py index <HASH>..<HASH> 100644 --- a/synapse/lib/layer.py +++ b/synapse/lib/layer.py @@ -1572,7 +1572,6 @@ class Layer(s_nexus.Pusher): # use/abuse python's dict ordering behavior results = {} - nexsindx = nexsitem[0] nodeedits = collections.deque(nodeedits) while nodeedits: @@ -1602,6 +1601,7 @@ class Layer(s_nexus.Pusher): flatedits = list(results.values()) if self.logedits and edited: + nexsindx = nexsitem[0] offs = self.nodeeditlog.add((flatedits, meta), indx=nexsindx) [(await wind.put((offs, flatedits))) for wind in tuple(self.windows)]
Only get nexsindx in storNodeEdits if logging edits (#<I>)
vertexproject_synapse
train
py
848d1f0fdb9df97259a24a898a19033052889bf7
diff --git a/gulptasks/schemas.js b/gulptasks/schemas.js index <HASH>..<HASH> 100644 --- a/gulptasks/schemas.js +++ b/gulptasks/schemas.js @@ -38,9 +38,10 @@ function xmlToJsonChain(name, dest) { gutil.log(`Skipped running saxon for ${json}.`); return; } - exec(`${options.saxon} -xsl:` + - "/usr/share/xml/tei/stylesheet/odds/odd2json.xsl" + - ` -s:${compiled} -o:${json} callback=''`); + + yield exec(`${options.saxon} -xsl:` + + "/usr/share/xml/tei/stylesheet/odds/odd2json.xsl" + + ` -s:${compiled} -o:${json} callback=''`); } gulp.task(compiledToJsonTaskName, [rngTaskName],
Fix a race condition. Forgot to wait for the exec to end.
mangalam-research_wed
train
js
bfd76b99d6e7c1cbe85c61036c6df16ba63c0755
diff --git a/tasks/bump.js b/tasks/bump.js index <HASH>..<HASH> 100644 --- a/tasks/bump.js +++ b/tasks/bump.js @@ -50,6 +50,8 @@ module.exports = function(grunt) { // increment the version var pkg = grunt.file.readJSON(grunt.config('pkgFile')); var previousVersion = pkg.version; + var minor = parseInt(previousVersion.split('.')[1], 10); + var branch = (minor % 2) ? 'master' : 'stable'; var newVersion = pkg.version = bumpVersion(previousVersion, type); // write updated package.json @@ -67,7 +69,7 @@ module.exports = function(grunt) { 'Changes committed'); run('git tag -a v' + newVersion + ' -m "Version ' + newVersion + '"', 'New tag "v' + newVersion + '" created'); - run('git push upstream master --tags', 'Pushed to github'); + run('git push upstream ' + branch + ' --tags', 'Pushed to github'); });
chore(release): push to correct branch (master/stable)
karma-runner_karma
train
js
30c3335a8cf2dd9d23ad70fe195ee43904e67d9b
diff --git a/DependencyInjection/HttplugExtension.php b/DependencyInjection/HttplugExtension.php index <HASH>..<HASH> 100644 --- a/DependencyInjection/HttplugExtension.php +++ b/DependencyInjection/HttplugExtension.php @@ -19,7 +19,6 @@ use Psr\Http\Message\UriInterface; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\DefinitionDecorator; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; @@ -149,7 +148,7 @@ class HttplugExtension extends Extension * @param ContainerBuilder $container In case we need to add additional services for this plugin * @param string $serviceId Service id of the plugin, in case we need to add additional services for this plugin. */ - private function configurePluginByName($name, Definition $definition, array $config, ContainerInterface $container, $serviceId) + private function configurePluginByName($name, Definition $definition, array $config, ContainerBuilder $container, $serviceId) { switch ($name) { case 'cache':
We need the concrete implementation, not the interface.
php-http_HttplugBundle
train
php
1a5e97e2e074ea49f0ad521b10edbadd7f207357
diff --git a/module/Core/src/Grid/Core/Controller/FaviconController.php b/module/Core/src/Grid/Core/Controller/FaviconController.php index <HASH>..<HASH> 100644 --- a/module/Core/src/Grid/Core/Controller/FaviconController.php +++ b/module/Core/src/Grid/Core/Controller/FaviconController.php @@ -24,10 +24,11 @@ class FaviconController extends AbstractActionController if ( empty( $options['headLink']['favicon']['href'] ) ) { - $this->getResponse() - ->setStatusCode( 404 ); - - return; + $redirect = '/uploads/_central/settings/favicon.ico'; + } + else + { + $redirect = $options['headLink']['favicon']['href']; } return $this->redirect()
default favicon is used when not found
webriq_core
train
php
b8debe1aaff11cdec7d1668c215128c4e1bdedea
diff --git a/openfisca_core/scenarios.py b/openfisca_core/scenarios.py index <HASH>..<HASH> 100644 --- a/openfisca_core/scenarios.py +++ b/openfisca_core/scenarios.py @@ -23,11 +23,9 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. -from copy import deepcopy -import datetime +import copy import logging - from . import conv from . import simulations @@ -52,7 +50,7 @@ class AbstractScenario(object): def add_reform(self, reform): if reform.reference_dated_legislation_json is None: - reform.reference_dated_legislation_json = deepcopy(self.reference_dated_legislation_json) + reform.reference_dated_legislation_json = copy.deepcopy(self.reference_dated_legislation_json) self.reforms.update({reform.name: reform}) def add_reforms(self, reforms):
Import module instead of its attributes.
openfisca_openfisca-core
train
py
3936f38daec1aa1255cc49eeeb70093b9e0f99c0
diff --git a/actionview/test/template/form_options_helper_test.rb b/actionview/test/template/form_options_helper_test.rb index <HASH>..<HASH> 100644 --- a/actionview/test/template/form_options_helper_test.rb +++ b/actionview/test/template/form_options_helper_test.rb @@ -1187,7 +1187,7 @@ class FormOptionsHelperTest < ActionView::TestCase def test_time_zone_select_with_priority_zones_as_regexp @firm = Firm.new("D") - @fake_timezones.each_with_index do |tz, i| + @fake_timezones.each do |tz| def tz.=~(re); %(A D).include?(name) end end
Ditch `each_with_index` for `each`. We never touch the index, so don't bother.
rails_rails
train
rb
885444d2d6daab1a8c172692463e0a54e9265359
diff --git a/src/Omnipay/WorldPay/Message/CompletePurchaseRequest.php b/src/Omnipay/WorldPay/Message/CompletePurchaseRequest.php index <HASH>..<HASH> 100644 --- a/src/Omnipay/WorldPay/Message/CompletePurchaseRequest.php +++ b/src/Omnipay/WorldPay/Message/CompletePurchaseRequest.php @@ -19,8 +19,8 @@ class CompletePurchaseRequest extends PurchaseRequest return $this->httpRequest->request->all(); } - public function send() + public function sendData($data) { - return $this->response = new CompletePurchaseResponse($this, $this->getData()); + return $this->response = new CompletePurchaseResponse($this, $data); } } diff --git a/src/Omnipay/WorldPay/Message/PurchaseRequest.php b/src/Omnipay/WorldPay/Message/PurchaseRequest.php index <HASH>..<HASH> 100644 --- a/src/Omnipay/WorldPay/Message/PurchaseRequest.php +++ b/src/Omnipay/WorldPay/Message/PurchaseRequest.php @@ -77,9 +77,9 @@ class PurchaseRequest extends AbstractRequest return $data; } - public function send() + public function sendData($data) { - return $this->response = new PurchaseResponse($this, $this->getData()); + return $this->response = new PurchaseResponse($this, $data); } public function getEndpoint()
Update gateways to use new sendData method
thephpleague_omnipay-worldpay
train
php,php
139f4f634004a78385c3b4a8c825b73382ad7724
diff --git a/motor/core.py b/motor/core.py index <HASH>..<HASH> 100644 --- a/motor/core.py +++ b/motor/core.py @@ -247,7 +247,7 @@ class _MotorTransactionContext(object): exec(textwrap.dedent(""" async def __aenter__(self): return self - + async def __aexit__(self, exc_type, exc_val, exc_tb): if self._session.delegate._in_transaction: if exc_val is None: @@ -712,7 +712,7 @@ class AgnosticCollection(AgnosticBaseProperties): # ensures it is canceled promptly if your code breaks # from the loop or throws an exception. async with db.collection.watch() as change_stream: - async for change in stream: + async for change in change_stream: print(change) # Tornado
Fix change stream docs example (#<I>)
mongodb_motor
train
py
38ac807493a898b2d7ecc4a2b9e7a9857316f5ed
diff --git a/src/binwalk/__init__.py b/src/binwalk/__init__.py index <HASH>..<HASH> 100644 --- a/src/binwalk/__init__.py +++ b/src/binwalk/__init__.py @@ -1,13 +1,17 @@ -__all__ = ['execute', 'Modules', 'ModuleException'] +__all__ = ['scan', 'execute', 'Modules', 'ModuleException'] import sys import binwalk.core.common # This allows importing of the built-in pyqtgraph if it # is not available on the system at run time. +# No longer needed, as pyqtgraph is no longer bundled with binwalk. sys.path.append(binwalk.core.common.get_libs_path()) from binwalk.core.module import Modules, ModuleException +# Convenience functions +def scan(*args, **kwargs): + return Modules(*args, **kwargs).execute() def execute(*args, **kwargs): return Modules(*args, **kwargs).execute()
Added convenience binwalk.scan function
ReFirmLabs_binwalk
train
py
42a8aaf0ad03fc48c45ed973cd7a38fb8b7bdb49
diff --git a/lib/active_interaction/filters.rb b/lib/active_interaction/filters.rb index <HASH>..<HASH> 100644 --- a/lib/active_interaction/filters.rb +++ b/lib/active_interaction/filters.rb @@ -24,5 +24,12 @@ module ActiveInteraction self end + + # @param key [Symbol] + # + # @return Filter + def [](key) + @filters.find { |f| f.name == key } + end end end diff --git a/spec/active_interaction/filters_spec.rb b/spec/active_interaction/filters_spec.rb index <HASH>..<HASH> 100644 --- a/spec/active_interaction/filters_spec.rb +++ b/spec/active_interaction/filters_spec.rb @@ -20,4 +20,23 @@ describe ActiveInteraction::Filters do expect(subject.add(filter).to_a).to eql [filter] end end + + describe '#[]' do + let(:filter) { double(name: name) } + let(:name) { SecureRandom.hex.to_sym } + + it 'returns nil' do + expect(subject[name]).to be_nil + end + + context 'with a filter' do + before do + subject.add(filter) + end + + it 'returns the filter' do + expect(subject[name]).to eq filter + end + end + end end
Fix #<I>; allow getting filters by name
AaronLasseigne_active_interaction
train
rb,rb
10c6046f7e655fb19f7055cffbb9b3c45096de17
diff --git a/src/main/java/com/semanticcms/view/what_links_here/WhatLinksHereView.java b/src/main/java/com/semanticcms/view/what_links_here/WhatLinksHereView.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/semanticcms/view/what_links_here/WhatLinksHereView.java +++ b/src/main/java/com/semanticcms/view/what_links_here/WhatLinksHereView.java @@ -66,6 +66,15 @@ public class WhatLinksHereView extends View { return null; } + /** + * Not sure if this would be a benefit to search engines, but we'll be on the safe side + * and focus on search engines seeing the original content. + */ + @Override + public boolean getAllowRobots(Page page) { + return false; + } + @Override public void doView(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, Page page) throws ServletException, IOException { PageRef pageRef = page.getPageRef();
May now exclude robots from specific views.
aoindustries_semanticcms-view-what-links-here
train
java
b5331ce5eb801896b93a163da4cd6b858f4c255d
diff --git a/tests/integration/user/userTestCase.php b/tests/integration/user/userTestCase.php index <HASH>..<HASH> 100644 --- a/tests/integration/user/userTestCase.php +++ b/tests/integration/user/userTestCase.php @@ -45,4 +45,10 @@ class UserTestCase extends OxidTestCase return $oUser; } + + protected function _createSecondSubShop() + { + $oShop = new oxShop(); + $oShop->save(); + } } \ No newline at end of file
ESDEV-<I> Create integration tests for login to admin with subshops duplicated code removed
OXID-eSales_oxideshop_ce
train
php
68ba3fbd4dd5ae7ff5563508e8f86500622c1a74
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,9 @@ 'use strict'; +const path = require('path'); const importModules = require('import-modules'); module.exports = { - rules: importModules('rules', {camelize: false}), + rules: importModules(path.resolve(__dirname, 'rules'), {camelize: false}), configs: { recommended: { env: {
Make sure the rules directory is resolved correctly (#<I>) Works around buggy `import-modules` directory resolution in Atom. Fixes <URL>
sindresorhus_eslint-plugin-unicorn
train
js
392d1448eac9f343d68f54783120b8930db44a01
diff --git a/rest/handler_test.go b/rest/handler_test.go index <HASH>..<HASH> 100644 --- a/rest/handler_test.go +++ b/rest/handler_test.go @@ -28,10 +28,6 @@ func TestHandler(t *testing.T) { } w.WriteJson(data) }), - Get("/auto-fails", func(w ResponseWriter, r *Request) { - a := []int{} - _ = a[0] - }), Get("/user-error", func(w ResponseWriter, r *Request) { Error(w, "My error", 500) }), @@ -58,12 +54,6 @@ func TestHandler(t *testing.T) { recorded.ContentTypeIsJson() recorded.BodyIs(`{"Error":"Resource not found"}`) - // auto 500 on unhandled userecorder error - recorded = test.RunRequest(t, &handler, test.MakeSimpleRequest("GET", "http://1.2.3.4/auto-fails", nil)) - recorded.CodeIs(500) - recorded.ContentTypeIsJson() - recorded.BodyIs(`{"Error":"Internal Server Error"}`) - // userecorder error recorded = test.RunRequest(t, &handler, test.MakeSimpleRequest("GET", "http://1.2.3.4/user-error", nil)) recorded.CodeIs(500)
Remove duplicated recover tests As a preparation to remove the deprecated ResourceHandler, make sure no test is lost by dispatching the content of handler_test.go to the right places. This test is already in recover_test.go
ant0ine_go-json-rest
train
go
e3594897762b36f394baeae5c46a48bfd3670949
diff --git a/code/services/FusionService.php b/code/services/FusionService.php index <HASH>..<HASH> 100644 --- a/code/services/FusionService.php +++ b/code/services/FusionService.php @@ -88,14 +88,14 @@ class FusionService { // Update the staging version. $object->writeWithoutVersion(); + } + Versioned::reading_stage('Live'); + $objects = $class::get()->filter('FusionTags.ID', $fusionID); + foreach($objects as $object) { // Update the live version. - Versioned::reading_stage('Live'); - if($live = $class::get()->byID($object->ID)) { - $live->writeWithoutVersion(); - } - Versioned::reading_stage('Stage'); + $object->writeWithoutVersion(); } } else {
Improving searchable content tagging performance.
nglasl_silverstripe-fusion
train
php
126194ec2ee0045efb3fe8a2ccf85087352ad04f
diff --git a/thefuck/main.py b/thefuck/main.py index <HASH>..<HASH> 100644 --- a/thefuck/main.py +++ b/thefuck/main.py @@ -139,7 +139,7 @@ def main(): command = get_command(settings, sys.argv) if command: if is_second_run(command): - print("echo Can't fuck twice") + sys.stderr.write("Can't fuck twice\n") return rules = get_rules(user_dir, settings) @@ -148,4 +148,4 @@ def main(): run_rule(matched_rule, command, settings) return - print('echo No fuck given') + sys.stderr.write('No fuck given\n')
Put errors in stderr instead of "echo ..." in stdout
nvbn_thefuck
train
py