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
19d446bc4ffbce9f076178d126d951833c35056e
diff --git a/aeron-cluster/src/main/java/io/aeron/cluster/client/AeronCluster.java b/aeron-cluster/src/main/java/io/aeron/cluster/client/AeronCluster.java index <HASH>..<HASH> 100644 --- a/aeron-cluster/src/main/java/io/aeron/cluster/client/AeronCluster.java +++ b/aeron-cluster/src/main/java/io/aeron/cluster/client/AeronCluster.java @@ -45,7 +45,6 @@ import static org.agrona.SystemUtil.getDurationInNanos; * <p> * <b>Note:</b> Instances of this class are not threadsafe. */ -@SuppressWarnings("unused") public final class AeronCluster implements AutoCloseable { /**
[Java] Remove warning suppression on AeronCluster.
real-logic_aeron
train
java
d9392dd5bf2027b5232cd1f944c6ae32ec6341d3
diff --git a/lib/flor/core/executor.rb b/lib/flor/core/executor.rb index <HASH>..<HASH> 100644 --- a/lib/flor/core/executor.rb +++ b/lib/flor/core/executor.rb @@ -117,10 +117,6 @@ module Flor # noreply: this new node has a parent but shouldn't reply to it # dbg: used to debug messages (useful @node['dbg'] when 'receive') - if (v = message['on_error']) != nil - node['on_error_branch'] = v - end - @execution['nodes'][nid] = node end diff --git a/lib/flor/core/procedure.rb b/lib/flor/core/procedure.rb index <HASH>..<HASH> 100644 --- a/lib/flor/core/procedure.rb +++ b/lib/flor/core/procedure.rb @@ -272,9 +272,6 @@ class Flor::Procedure < Flor::Node m.merge!(h) - oeb = @node['on_error_branch'] - m['from_on_branch'] = oeb if oeb && m['point'] == 'receive' - m['payload']['ret'] = ret if ret != :no [ m ]
Get rid of the "on_error_branch" concept Thanks to the Procedure#trigger_on_error rewrite
floraison_flor
train
rb,rb
178ed5c1457b68c5042b1b44959fac66c0b491e8
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 @@ -841,7 +841,7 @@ class APITestCase(unittest.TestCase): try: api.owns_endpoint('endpoint') - except AttributeError, ae: + except AttributeError as ae: self.fail(ae.message)
fix broken tests on py3.x due to #<I>
flask-restful_flask-restful
train
py
151d84854f4e8863586fe1992459a6326ba3cf29
diff --git a/pfamserver/commands/library/pfamscan.py b/pfamserver/commands/library/pfamscan.py index <HASH>..<HASH> 100644 --- a/pfamserver/commands/library/pfamscan.py +++ b/pfamserver/commands/library/pfamscan.py @@ -49,6 +49,7 @@ def index(version, ftp): """Download PfamA-full file.""" protocol = 'ftp' if ftp else 'http' cmds = [ + 'mkdir -p ./Pfam{version}', 'wget -c {protocol}://ftp.ebi.ac.uk/pub/databases/Pfam/releases/Pfam{version}/Pfam-A.hmm.gz -O ./Pfam{version}/Pfam-A.hmm.gz', 'wget -c {protocol}://ftp.ebi.ac.uk/pub/databases/Pfam/releases/Pfam{version}/Pfam-A.hmm.dat.gz -O ./Pfam{version}/Pfam-A.hmm.dat.gz', 'gunzip -c ./Pfam{version}/Pfam-A.hmm.gz > ./Pfam{version}/Pfam-A.hmm',
Fix bug in pfamscan command.
ecolell_pfamserver
train
py
5a3f5fcd786f8f92f702bf7edf11373b16cee7af
diff --git a/core/src/test/java/org/springframework/security/config/LdapBeanDefinitionParserTests.java b/core/src/test/java/org/springframework/security/config/LdapBeanDefinitionParserTests.java index <HASH>..<HASH> 100644 --- a/core/src/test/java/org/springframework/security/config/LdapBeanDefinitionParserTests.java +++ b/core/src/test/java/org/springframework/security/config/LdapBeanDefinitionParserTests.java @@ -25,7 +25,9 @@ public class LdapBeanDefinitionParserTests { @AfterClass public static void closeContext() { // Make sure apache ds shuts down - appContext.close(); + if (appContext != null) { + appContext.close(); + } } @Test
Minor changes to improve robustess of LDAP tests.
spring-projects_spring-security
train
java
482dcb988afee5d1593b33fc98278561f9fb3a98
diff --git a/src/dashbot.js b/src/dashbot.js index <HASH>..<HASH> 100644 --- a/src/dashbot.js +++ b/src/dashbot.js @@ -396,7 +396,8 @@ function DashBotMicrosoft(apiKeys, urlRoot, debug, printErrors) { is_microsoft:true, json: session }; - switch (session.source) { + var platform = session.source ? session.source : _.get(session, 'address.channelId'); + switch (platform) { case 'facebook': case 'slack': case 'kik': @@ -420,9 +421,7 @@ function DashBotMicrosoft(apiKeys, urlRoot, debug, printErrors) { is_microsoft:true, json: session }; - //console.log('msftbf session:', session); var platform = session.source ? session.source : _.get(session, 'address.channelId'); - //console.log('msftbf platform is ', platform) switch (platform) { case 'facebook': case 'slack':
also getting platform from channelId on the receive.
actionably_dashbot
train
js
262ce4089aeb788933f3ab1a1fd8cef34e76413c
diff --git a/src/db/clients/sqlserver.js b/src/db/clients/sqlserver.js index <HASH>..<HASH> 100644 --- a/src/db/clients/sqlserver.js +++ b/src/db/clients/sqlserver.js @@ -366,6 +366,7 @@ function configDatabase(server, database) { port: server.config.port, requestTimeout: Infinity, appName: server.config.applicationName || 'sqlectron', + domain: server.config.domain, pool: { max: 5, },
Add support to set the domain for mmsql
falcon-client_falcon-core
train
js
0421611d2fa0b9b5792538bdb0a17fc9a05c9c2d
diff --git a/tests/Resource/DummyResource.php b/tests/Resource/DummyResource.php index <HASH>..<HASH> 100644 --- a/tests/Resource/DummyResource.php +++ b/tests/Resource/DummyResource.php @@ -5,6 +5,7 @@ namespace WyriHaximus\Tests\ApiClient\Resource; use React\Promise\PromiseInterface; use Rx\ObservableInterface; +use WyriHaximus\ApiClient\Annotations\Collection; use WyriHaximus\ApiClient\Annotations\Nested; use WyriHaximus\ApiClient\Resource\CallAsyncTrait; use WyriHaximus\ApiClient\Resource\HydrateTrait; @@ -14,6 +15,7 @@ use WyriHaximus\ApiClient\Transport\Client; /** * @Nested(foo="Acme\Bar", bar="Acme\Foo") + * @Collection(foo="Acme\Bar", bar="Acme\Foo") */ class DummyResource implements ResourceInterface {
Added collection to dummy resource
php-api-clients_events
train
php
e4ce9c5c9f88eb59b069441ee556cc4dae0ec89a
diff --git a/src/Illuminate/Database/Concerns/BuildsQueries.php b/src/Illuminate/Database/Concerns/BuildsQueries.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Database/Concerns/BuildsQueries.php +++ b/src/Illuminate/Database/Concerns/BuildsQueries.php @@ -11,6 +11,7 @@ use Illuminate\Pagination\Paginator; use Illuminate\Support\Collection; use Illuminate\Support\LazyCollection; use InvalidArgumentException; +use RuntimeException; trait BuildsQueries { @@ -134,6 +135,10 @@ trait BuildsQueries $lastId = $results->last()->{$alias}; + if ($lastId === null) { + throw new RuntimeException("The chunkById operation was aborted because the [{$alias}] column is not present in the query result."); + } + unset($results); $page++;
[8.x] Add exception to chunkById() when last id cannot be determined (#<I>) * Add exception to chunkById() when last id cannot be determined * Fix styling issue * Update BuildsQueries.php
laravel_framework
train
php
01dc72c8347df8ce97114e55a14ec6bfcdeded32
diff --git a/lib/mongo/util/ordered_hash.rb b/lib/mongo/util/ordered_hash.rb index <HASH>..<HASH> 100644 --- a/lib/mongo/util/ordered_hash.rb +++ b/lib/mongo/util/ordered_hash.rb @@ -64,7 +64,7 @@ class OrderedHash < Hash end def delete(key, &block) - @ordered_keys.delete(key) + @ordered_keys.delete(key) if @ordered_keys super end
Fixed OrderedHash#delete
mongodb_mongo-ruby-driver
train
rb
8d847297931b79784e18598a18cbecb55fc434fc
diff --git a/satpy/readers/avhrr_l1b_gaclac.py b/satpy/readers/avhrr_l1b_gaclac.py index <HASH>..<HASH> 100644 --- a/satpy/readers/avhrr_l1b_gaclac.py +++ b/satpy/readers/avhrr_l1b_gaclac.py @@ -27,6 +27,7 @@ import logging from datetime import datetime, timedelta import xarray as xr import dask.array as da +import numpy as np from pygac.gac_klm import GACKLMReader from pygac.gac_pod import GACPODReader import pygac.utils @@ -116,6 +117,8 @@ class GACLACFile(BaseFileHandler): tle_name=self.tle_name, tle_thresh=self.tle_thresh) self.reader.read(self.filename) + if np.all(self.reader.mask): + raise ValueError('All data is masked out') if key.name in ['latitude', 'longitude']: # Lats/lons are buffered by the reader
Raise ValueError if all data is masked
pytroll_satpy
train
py
54effe301b0905a88df706b59f7075444cf1a7de
diff --git a/recipes/src/test/java/com/bazaarvoice/zookeeper/recipes/discovery/ZooKeeperNodeDiscoveryTest.java b/recipes/src/test/java/com/bazaarvoice/zookeeper/recipes/discovery/ZooKeeperNodeDiscoveryTest.java index <HASH>..<HASH> 100644 --- a/recipes/src/test/java/com/bazaarvoice/zookeeper/recipes/discovery/ZooKeeperNodeDiscoveryTest.java +++ b/recipes/src/test/java/com/bazaarvoice/zookeeper/recipes/discovery/ZooKeeperNodeDiscoveryTest.java @@ -478,7 +478,7 @@ public class ZooKeeperNodeDiscoveryTest extends ZooKeeperTest { private static <K, T> boolean waitUntilSize(Map<K, T> map, int size, long timeout, TimeUnit unit) { long start = System.nanoTime(); while (System.nanoTime() - start <= unit.toNanos(timeout)) { - if (Iterables.size(map.values()) == size) { + if (map.size() == size) { return true; }
Addressing Mark's comment to simplify the logic of a test.
bazaarvoice_curator-extensions
train
java
42a7f833135cc8ead4bb865fc95b98543bc8fe3d
diff --git a/src/lib/Component/LinkComponent.php b/src/lib/Component/LinkComponent.php index <HASH>..<HASH> 100644 --- a/src/lib/Component/LinkComponent.php +++ b/src/lib/Component/LinkComponent.php @@ -49,6 +49,7 @@ class LinkComponent implements Renderable $this->twig = $twig; $this->href = $href; $this->type = $type; + $this->rel = $rel; $this->crossorigin = $crossorigin; $this->integrity = $integrity; }
fix: add missing rel handling to Link component
ezsystems_ezplatform-admin-ui
train
php
dc29f4b8419ac6fec7c7e19ac603021dc285e13a
diff --git a/centrosome/filter.py b/centrosome/filter.py index <HASH>..<HASH> 100644 --- a/centrosome/filter.py +++ b/centrosome/filter.py @@ -1,4 +1,5 @@ from __future__ import absolute_import +from __future__ import division import numpy as np import scipy.ndimage as scind from scipy.ndimage import map_coordinates, label @@ -249,7 +250,7 @@ def laplacian_of_gaussian(image, mask, size, sigma): size - length of side of square kernel to use sigma - standard deviation of the Gaussian ''' - half_size = size/2 + half_size = size//2 i,j = np.mgrid[-half_size:half_size+1, -half_size:half_size+1].astype(float) / float(sigma) distance = (i**2 + j**2)/2
Additional integer division fix in filter.py
CellProfiler_centrosome
train
py
040851926350d71e36ad5ee11add49d6df9516a1
diff --git a/kite/kontrol.go b/kite/kontrol.go index <HASH>..<HASH> 100644 --- a/kite/kontrol.go +++ b/kite/kontrol.go @@ -21,7 +21,8 @@ func (k *Kite) keepRegisteredToKontrol(urls chan *url.URL) { for { err := k.Kontrol.Register() if err != nil { - k.Log.Fatalf("Cannot register to Kontrol: %s", err) + // do not exit, because existing applications might import the kite package + k.Log.Error("Cannot register to Kontrol: %s", err) time.Sleep(registerKontrolRetryDuration) }
kite/kontrol: do not exit, because existing application might import the kite package.
koding_kite
train
go
9f0fbb34dd198d290067fcc9268ef8513dd51cda
diff --git a/acceptance/tests/config/apply_file_metadata_specified_in_config.rb b/acceptance/tests/config/apply_file_metadata_specified_in_config.rb index <HASH>..<HASH> 100644 --- a/acceptance/tests/config/apply_file_metadata_specified_in_config.rb +++ b/acceptance/tests/config/apply_file_metadata_specified_in_config.rb @@ -16,10 +16,7 @@ agents.each do |agent| } SITE - create_test_file(agent, 'puppet.conf', <<-CONF) - [user] - logdir = #{logdir} { owner = root, group = root, mode = 0700 } - CONF + on(agent, puppet('config', 'set', 'logdir', "'#{logdir} { owner = root, group = root, mode = 0700 }'", '--configdir', get_test_file_path(agent, ''))) on(agent, puppet('apply', get_test_file_path(agent, 'site.pp'), '--confdir', get_test_file_path(agent, '')))
(#<I>) Update acceptance test to use config set This is the first, simple case of using a `config set` subcommand to manipulate the puppet.conf file.
puppetlabs_puppet
train
rb
91712a1ea652531e6a48fc337a641acb61fd51e8
diff --git a/src/Phpbb/TranslationValidator/Validator/FileListValidator.php b/src/Phpbb/TranslationValidator/Validator/FileListValidator.php index <HASH>..<HASH> 100644 --- a/src/Phpbb/TranslationValidator/Validator/FileListValidator.php +++ b/src/Phpbb/TranslationValidator/Validator/FileListValidator.php @@ -201,6 +201,11 @@ class FileListValidator } $this->output->addMessage($level, 'Found additional file', $origin_file); } + + if (substr($origin_file, -13 ) === 'site_logo.gif' || substr($origin_file, -14 ) === '/site_logo.gif') + { + $this->output->addMessage(Output::FATAL, 'Found additional file', $origin_file); + } } }
Add extra FATAL Output for additional logo
phpbb_phpbb-translation-validator
train
php
527c20bc843a4694be2106f79263ca83cccd4cdb
diff --git a/proso_user/models.py b/proso_user/models.py index <HASH>..<HASH> 100644 --- a/proso_user/models.py +++ b/proso_user/models.py @@ -228,7 +228,7 @@ def migrate_google_openid_user(user): # in case of already migrated users do not lose data if new_user.id != old_social.user.id: new_user.delete() - old_social.delete() + old_social.delete() LOGGER.info('Migrating user "{}" from Google OpenID to OAauth2'.format(user.email)) return old_social.user except UserSocialAuth.DoesNotExist:
delete old social in all cases during openid => oauth2 migration
adaptive-learning_proso-apps
train
py
d1e0babcf616727164e45dc55e176f1cda5f1203
diff --git a/src/Models/Killmails/KillmailAttacker.php b/src/Models/Killmails/KillmailAttacker.php index <HASH>..<HASH> 100644 --- a/src/Models/Killmails/KillmailAttacker.php +++ b/src/Models/Killmails/KillmailAttacker.php @@ -127,7 +127,7 @@ class KillmailAttacker extends Model // generate unique hash for the model based on attacker meta-data self::creating(function ($model) { - $model->hash = md5(serialize([ + $model->attacker_hash = md5(serialize([ $model->character_id, $model->corporation_id, $model->alliance_id,
fix(kills): Update column to store unique hash.
eveseat_eveapi
train
php
3348d11e7017c211d4ac73c75b61aae2e03f5e46
diff --git a/lib/fluent/plugin/out_elasticsearch.rb b/lib/fluent/plugin/out_elasticsearch.rb index <HASH>..<HASH> 100644 --- a/lib/fluent/plugin/out_elasticsearch.rb +++ b/lib/fluent/plugin/out_elasticsearch.rb @@ -247,7 +247,8 @@ EOC template_installation_actual(@deflector_alias ? @deflector_alias : @index_name, @template_name, @customize_template, @application_name, @index_name, @ilm_policy_id) end verify_ilm_working if @enable_ilm - elsif @templates + end + if @templates retry_operate(@max_retry_putting_template, @fail_on_putting_template_retry_exceed) do templates_hash_install(@templates, @template_overwrite) end
Load multiple templates even if template_name and template_file are given This allows loading some auxiliary templates on startup even when using ILM.
uken_fluent-plugin-elasticsearch
train
rb
7134dc1d59642101d6481fa644dd0b8e72b6af67
diff --git a/publish.js b/publish.js index <HASH>..<HASH> 100644 --- a/publish.js +++ b/publish.js @@ -79,6 +79,19 @@ const tasks = new Listr([{ }); }, }, { + title: 'Syncing local repository', + task: (ctx) => { + return new Promise((resolve, reject) => { + repo.pull(err => { + if (err) { + return reject(err); + } + return resolve(); + }); + }); + }, + enabled, +}, { title: 'Updating local caniuse-db version', task: (ctx) => { pkg.devDependencies['caniuse-db'] = ctx.version;
Sync the repository before publishing, in case of a manual update.
ben-eb_caniuse-lite
train
js
5d6b6a6164c5bf79bdac2d444cd381405a83f6ff
diff --git a/hooks/url.py b/hooks/url.py index <HASH>..<HASH> 100755 --- a/hooks/url.py +++ b/hooks/url.py @@ -19,7 +19,7 @@ from helpers.hook import Hook import re -@Hook(types=['pubmsg', 'action'], args=[]) +@Hook(types=['pubmsg', 'action'], args=['config']) def handle(send, msg, args): """ Get titles for urls. @@ -31,5 +31,5 @@ def handle(send, msg, args): [a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s() <>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))* \)|[^\s`!()\[\]{};:'\".,<>?....]))""", msg) - if match: + if match and args['config']['feature']['linkread'] == "True": send(get_title(match.group(1)))
because some chans have more than one bot.
tjcsl_cslbot
train
py
bd19ef2321f7ca9549211b07edf0c1cbfe056578
diff --git a/lib/stupidedi/5010/base/loop_def.rb b/lib/stupidedi/5010/base/loop_def.rb index <HASH>..<HASH> 100644 --- a/lib/stupidedi/5010/base/loop_def.rb +++ b/lib/stupidedi/5010/base/loop_def.rb @@ -2,6 +2,9 @@ module Stupidedi module FiftyTen module Base + class LoopDef + end + # # Loops are defined by a sequence of segments. The first SegmentUse # in the loop's definition is more significant than any others. Its diff --git a/lib/stupidedi/reader/token_reader.rb b/lib/stupidedi/reader/token_reader.rb index <HASH>..<HASH> 100644 --- a/lib/stupidedi/reader/token_reader.rb +++ b/lib/stupidedi/reader/token_reader.rb @@ -223,6 +223,8 @@ module Stupidedi end end + ## + # TODO def read_segment(segment_def = nil) if segment_def.nil? # TODO.. read_segment_id, then read up to and including segment_terminator
Fixed most problems with parsing loops, still incomplete and need specs
irobayna_stupidedi
train
rb,rb
de75d674d26d038df37153f61c9c98c9e4bc68e5
diff --git a/code/extensions/MultisitesControllerExtension.php b/code/extensions/MultisitesControllerExtension.php index <HASH>..<HASH> 100644 --- a/code/extensions/MultisitesControllerExtension.php +++ b/code/extensions/MultisitesControllerExtension.php @@ -10,10 +10,12 @@ class MultisitesControllerExtension extends Extension { * Sets the theme to the current site theme **/ public function onAfterInit() { - $site = Multisites::inst()->getCurrentSite(); + if (Security::database_is_ready()) { + $site = Multisites::inst()->getCurrentSite(); - if($site && $theme = $site->getSiteTheme()) { - SSViewer::set_theme($theme); + if($site && $theme = $site->getSiteTheme()) { + SSViewer::set_theme($theme); + } } }
FIX #<I> check for db existence in onAfterInit Ensure database is ready before referencing, as the controller the extension is bound to _may_ be the development controller during the initial dev/build For production sites, it's recommended you $force_database_is_ready=true for the slight performance improvement
symbiote_silverstripe-multisites
train
php
97373cb280e59af19615cc884cf2a523e5826ce5
diff --git a/src/browser/extension/background/index.js b/src/browser/extension/background/index.js index <HASH>..<HASH> 100644 --- a/src/browser/extension/background/index.js +++ b/src/browser/extension/background/index.js @@ -10,7 +10,7 @@ window.store = store; window.store.instances = {}; window.store.setInstance = instance => { store.instance = instance; - store.liftedStore.setInstance(instance, true); + if (instance && instance !== 'auto') store.liftedStore.setInstance(instance, true); }; chrome.commands.onCommand.addListener(shortcut => {
Fix "autoselect instances"
zalmoxisus_redux-devtools-extension
train
js
7be346f302f298d65cc96b19e38e43782c5cd917
diff --git a/lib/statemanager.js b/lib/statemanager.js index <HASH>..<HASH> 100644 --- a/lib/statemanager.js +++ b/lib/statemanager.js @@ -643,7 +643,10 @@ StateManager.prototype.getBlock = function(hash_or_number, callback) { StateManager.prototype.getLogs = function(filter, callback) { var self = this; - var expectedAddress = filter.address; + // filter.address may be a single address or an array + // https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getlogs + var expectedAddress = filter.address && (Array.isArray(filter.address) ? filter.address : [filter.address]); + expectedAddress = expectedAddress && expectedAddress.map(function(a) { return a.toLowerCase() }); var expectedTopics = filter.topics || []; async.parallel({ @@ -669,8 +672,8 @@ StateManager.prototype.getLogs = function(filter, callback) { if (err) return finished(err); // Filter logs that match the address - var filtered = blockLogs.filter(function(log) { - return (expectedAddress == null || log.address == expectedAddress); + var filtered = !expectedAddress ? blockLogs : blockLogs.filter(function(log) { + return expectedAddress.indexOf(log.address.toLowerCase()) > -1; }); // Now filter based on topics.
fix filter.address to be spec complaint (support for single value or an array)
trufflesuite_ganache-core
train
js
68ef4d57b61b10f2efed0179c5c7bd3dd3e3cc11
diff --git a/screamshot/__init__.py b/screamshot/__init__.py index <HASH>..<HASH> 100644 --- a/screamshot/__init__.py +++ b/screamshot/__init__.py @@ -6,4 +6,5 @@ app_settings = dict({ 'CAPTURE_ALLOWED_IPS': ('127.0.0.1',), 'CLI_ARGS': [], 'CASPERJS_CMD': None, + 'PHANTOMJS_CMD': None, }, **getattr(settings, 'SCREAMSHOT_CONFIG', {}))
ref #<I> submodule django-streamshot as a tool for screen capture with customization of PHANTOMJS_CMD as configuration
makinacorpus_django-screamshot
train
py
6ead6339382de4f19c3b692a482b6206cdb72902
diff --git a/lib/unparser/emitter.rb b/lib/unparser/emitter.rb index <HASH>..<HASH> 100644 --- a/lib/unparser/emitter.rb +++ b/lib/unparser/emitter.rb @@ -195,10 +195,30 @@ module Unparser # def self.emit(node, buffer) buffer.append(node.children.first.to_s) + self end end + class NthRef < self + + PREFIX = '$'.freeze + + handle :nth_ref + + # Perform dispatch + # + # @return [undefined] + # + # @api private + # + def self.emit(node, buffer) + buffer.append(PREFIX) + buffer.append(node.children.first.to_s) + self + end + end + class CBase < self BASE = '::'.freeze diff --git a/spec/integration/unparser/spike_spec.rb b/spec/integration/unparser/spike_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integration/unparser/spike_spec.rb +++ b/spec/integration/unparser/spike_spec.rb @@ -116,6 +116,7 @@ describe Unparser, 'spike' do assert_round_trip '@a' assert_round_trip '@@a' assert_round_trip '$a' + assert_round_trip '$1' end context 'singletons' do
Add support for nth_ref
mbj_unparser
train
rb,rb
6626d75ac5666e33811da7f4ff0b0772392f53ad
diff --git a/enoslib/infra/enos_g5k/g5k_api_utils.py b/enoslib/infra/enos_g5k/g5k_api_utils.py index <HASH>..<HASH> 100644 --- a/enoslib/infra/enos_g5k/g5k_api_utils.py +++ b/enoslib/infra/enos_g5k/g5k_api_utils.py @@ -865,7 +865,7 @@ def grid_make_reservation( # Submit them jobs = _do_grid_make_reservation( - criteria, job_name, walltime, reservation_date, queue, job_type, project + criteria, job_name, walltime, _date2h(reservation_date), queue, job_type, project ) return jobs \ No newline at end of file
G5K: fix reservation format in multisite jobs It seems that now the accepted format is a string only.
BeyondTheClouds_enoslib
train
py
7aa840d697c9b225adc7ca91a5ff474bf344eade
diff --git a/src/traverse/node-path.js b/src/traverse/node-path.js index <HASH>..<HASH> 100644 --- a/src/traverse/node-path.js +++ b/src/traverse/node-path.js @@ -122,6 +122,7 @@ class NodePath { if (this.isRemoved()) { return; } + NodePath.registry.delete(this.node); this.node = null;
Traverse: Delete node from NodePath registry when removed
DmitrySoshnikov_regexp-tree
train
js
8c9e8bef826de2f81663e01ed8c345cf1667ed09
diff --git a/lib/stream-to-async-iterator.js b/lib/stream-to-async-iterator.js index <HASH>..<HASH> 100644 --- a/lib/stream-to-async-iterator.js +++ b/lib/stream-to-async-iterator.js @@ -165,12 +165,15 @@ export default class StreamAsyncToIterator { eventListener = () => { this._state = states.readable; this._rejections.delete(reject); + + // we set this to null to info the clean up not to do anything + eventListener = null; resolve(); }; //on is used here instead of once, because //the listener is remove afterwards anyways. - this._stream.on('readable', eventListener); + this._stream.once('readable', eventListener); this._rejections.add(reject); }); @@ -194,10 +197,12 @@ export default class StreamAsyncToIterator { eventListener = () => { this._state = states.ended; this._rejections.delete(reject); + + eventListener = null resolve(); }; - this._stream.on('end', eventListener); + this._stream.once('end', eventListener); this._rejections.add(reject); });
reverts to using once instead of on
basicdays_node-stream-to-async-iterator
train
js
a8849900df1ca7353a30a750ed2e89ead5c5bfc4
diff --git a/lib/trestle/resource/controller.rb b/lib/trestle/resource/controller.rb index <HASH>..<HASH> 100644 --- a/lib/trestle/resource/controller.rb +++ b/lib/trestle/resource/controller.rb @@ -13,7 +13,7 @@ module Trestle end def new - self.instance = admin.build_instance({}, params) + self.instance = admin.build_instance(params.key?(admin.parameter_name) ? permitted_params : {}, params) respond_to do |format| format.html
Initialize instance with params in new action if passed
TrestleAdmin_trestle
train
rb
9c07e1386dec731e9a4c7ee8926ae66c009fc8da
diff --git a/session.go b/session.go index <HASH>..<HASH> 100644 --- a/session.go +++ b/session.go @@ -31,7 +31,7 @@ import ( // whole Cassandra cluster. // // This type extends the Node interface by adding a convinient query builder -// and automatically sets a default consinstency level on all operations +// and automatically sets a default consistency level on all operations // that do not have a consistency level set. type Session struct { cons Consistency
Fix typo consinstency -> consistency
gocql_gocql
train
go
fa9edb937001a9db7bdb525b178ccd0c9eeec2ec
diff --git a/cbpro/public_client.py b/cbpro/public_client.py index <HASH>..<HASH> 100644 --- a/cbpro/public_client.py +++ b/cbpro/public_client.py @@ -196,7 +196,8 @@ class PublicClient(object): params['granularity'] = granularity return self._send_message('get', - '/products/{}/candles'.format(product_id)) + '/products/{}/candles'.format(product_id), + params=params) def get_product_24hr_stats(self, product_id): """Get 24 hr stats for the product.
Bug fix: params were not being sent to coinbase api. The call to _send_message was missing the params so the function was not respecting the datetime and granularity parameters when requesting data from coinbase api. So the request would always return whatever data coinbase decided to give to you.
danpaquin_coinbasepro-python
train
py
d4015c454b7b52a82c38ba8a14fd4d9d452ee80a
diff --git a/url.go b/url.go index <HASH>..<HASH> 100644 --- a/url.go +++ b/url.go @@ -107,6 +107,12 @@ func url2DirContent(urlStr string) (content *client.Content, err *probe.Error) { if err != nil { return nil, err.Trace(urlStr) } + if clnt.GetURL().Path == string(clnt.GetURL().Separator) { + content := new(client.Content) + content.URL = clnt.GetURL() + content.Type = os.ModeDir + return content, nil + } isRecursive := false isIncomplete := false for entry := range clnt.List(isRecursive, isIncomplete) {
ls: if the top-level URL path has a separator return quickly
minio_mc
train
go
f616e9c16259913d3dc9c014a5062edf363477f7
diff --git a/Neos.Neos/Classes/Command/DomainCommandController.php b/Neos.Neos/Classes/Command/DomainCommandController.php index <HASH>..<HASH> 100644 --- a/Neos.Neos/Classes/Command/DomainCommandController.php +++ b/Neos.Neos/Classes/Command/DomainCommandController.php @@ -137,6 +137,11 @@ class DomainCommandController extends CommandController $this->outputLine('<error>Domain not found.</error>'); $this->quit(1); } + $site = $domain->getSite(); + if ($site->getPrimaryDomain() === $domain) { + $site->setPrimaryDomain(null); + $this->siteRepository->update($site); + } $this->domainRepository->remove($domain); $this->outputLine('Domain entry deleted.');
BUGFIX: Allow primary domains to be removed via CLI Fixes: #<I>
neos_neos-development-collection
train
php
9beda849ce868e3a128ab6c24bc826352685ebf5
diff --git a/structr-ui/src/main/java/org/structr/websocket/command/LayoutsCommand.java b/structr-ui/src/main/java/org/structr/websocket/command/LayoutsCommand.java index <HASH>..<HASH> 100644 --- a/structr-ui/src/main/java/org/structr/websocket/command/LayoutsCommand.java +++ b/structr-ui/src/main/java/org/structr/websocket/command/LayoutsCommand.java @@ -220,7 +220,7 @@ public class LayoutsCommand extends AbstractCommand { if (baseDir.exists()) { - final String[] names = baseDir.list(); + final String[] names = baseDir.list((File dir, String name) -> (name.endsWith(".json"))); if (names != null) { fileNames.addAll(Arrays.asList(names));
Added a filename filter for the LayoutsCommand so that pesky files as ".DS_store" are hidden by default.
structr_structr
train
java
afbe29e0c1dc4c1e2bd85457875720b04bdd9469
diff --git a/src/API/Image.php b/src/API/Image.php index <HASH>..<HASH> 100644 --- a/src/API/Image.php +++ b/src/API/Image.php @@ -447,7 +447,7 @@ class Image extends Base { ->orderBy('RAND()') ->limit(1); $report_result = $this->db->fetch($query); - $image_result = $this->get($report_result[0]['image']); + $image_result = $this->get($report_result[0]['image'], $sid); if (!$image_result) throw new \JohnVanOrange\Core\Exception\NotFound('No image result', 404); return $image_result; }
pass along sid so correct permissions are used when method accesses image data
JohnVanOrange_Core
train
php
b91a0518bbf2639999542514900608cf2463ad36
diff --git a/brink/fields.py b/brink/fields.py index <HASH>..<HASH> 100644 --- a/brink/fields.py +++ b/brink/fields.py @@ -219,4 +219,4 @@ class ReferenceField(Field): return data.id def validate(self, data): - pass + return data
Pass data through ReferenceField upon validation
brinkframework_brink
train
py
1e41a9a3dd28fb81cbb05542b887dffefa1686ca
diff --git a/glue/pidfile.py b/glue/pidfile.py index <HASH>..<HASH> 100644 --- a/glue/pidfile.py +++ b/glue/pidfile.py @@ -18,11 +18,12 @@ import time #__date__ = git_version.date -# inspired by http://stackoverflow.com/questions/1005972 +# inspired by Larz Wirzenius <http://stackoverflow.com/questions/1005972> def pid_exists(pid): """ Returns true if the given pid exists, false otherwise. """ try: # signal 0 is harmless and can be safely used to probe pid existence + # faster and more unix-portable than looking in /proc os.kill(pid, 0) except OSError, e: # "permission denied" proves existence; otherwise, no such pid @@ -50,7 +51,7 @@ def get_lock(lockfile): try: fcntl.flock(pidfile.fileno(), fcntl.LOCK_EX|fcntl.LOCK_NB) except IOError,e: - raise RuntimeError, "failed to lock %s: %s" % (pidfile_path, e) + raise RuntimeError, "failed to lock %s: %s" % (lockfile, e) # we got the file lock, so check the pid therein pidfile.seek(0)
fixed typo in file-locking exception error
gwastro_pycbc-glue
train
py
32ca8e6b62cb0cc80f8687cc51f6d4c66f491d08
diff --git a/Classes/Service/CacheService.php b/Classes/Service/CacheService.php index <HASH>..<HASH> 100644 --- a/Classes/Service/CacheService.php +++ b/Classes/Service/CacheService.php @@ -160,7 +160,7 @@ class CacheService implements SingletonInterface $tables = $this->databaseConnection->admin_get_tables(); foreach ($tables as $table) { $tableName = $table['Name']; - if (substr($tableName, 0, 3) === 'cf_' || ($tableName !== 'tx_realurl_redirects' && substr($tableName, 0, 11) === 'tx_realurl_')) { + if (strpos($tableName, 'cf_') === 0) { $this->databaseConnection->exec_TRUNCATEquery($tableName); } }
[BUGFIX] Remove broken realurl workaround Especially with realurl 2.x available, the workaround cleared too many realurl tables, which may lead to a broken data state. Fixes #<I> Fixes #<I>
TYPO3-Console_TYPO3-Console
train
php
9ffa309f699c9433671c3054f254ecc977e010a7
diff --git a/store/store.go b/store/store.go index <HASH>..<HASH> 100644 --- a/store/store.go +++ b/store/store.go @@ -447,15 +447,6 @@ func (s *Store) Load(r io.Reader) (int, error) { return 0, ErrNotLeader } - // Disable FK constraints for loading. - currFK, err := s.db.FKConstraints() - if err != nil { - return 0, err - } - if err := s.db.EnableFKConstraints(false); err != nil { - return 0, err - } - // Read the dump, executing the commands. var queries []string scanner := parser.NewScanner(r) @@ -479,16 +470,12 @@ func (s *Store) Load(r io.Reader) (int, error) { } if len(queries) > 0 { - _, err = s.Execute(queries, false, true) + _, err := s.Execute(queries, false, true) if err != nil { return len(queries), err } } - // Restore FK constraints to starting state. - if err := s.db.EnableFKConstraints(currFK); err != nil { - return len(queries), err - } return len(queries), nil }
Stop database-level control of FK during load
rqlite_rqlite
train
go
c33e95ee7d8dc2f1fb0ad53371a6ded2b49dd616
diff --git a/src/HTMLParser.php b/src/HTMLParser.php index <HASH>..<HASH> 100644 --- a/src/HTMLParser.php +++ b/src/HTMLParser.php @@ -321,7 +321,7 @@ class HTMLParser $contentScore = 1; // Add points for any commas within this paragraph. - $contentScore += count(explode(', ', $node->getValue(true))); + $contentScore += count(explode(',', $node->getValue(true))); // For every 100 characters in this paragraph, add another point. Up to 3 points. $contentScore += min(floor(strlen($node->getValue(true)) / 100), 3);
Removed space while checking for commas
andreskrey_readability.php
train
php
2509982f58edafa0cfe1ab15ac530bdcda8edec7
diff --git a/menuconfig.py b/menuconfig.py index <HASH>..<HASH> 100755 --- a/menuconfig.py +++ b/menuconfig.py @@ -2028,10 +2028,10 @@ def _menu_path_info(node): path = "" - menu = node.parent - while menu is not _kconf.top_node: - path = " -> " + menu.prompt[0] + path - menu = menu.parent + node = _parent_menu(node) + while node is not _kconf.top_node: + path = " -> " + node.prompt[0] + path + node = _parent_menu(node) return "(top menu)" + path
menuconfig: Don't show implicit menus in symbol info Only show "real" (non-indented) menus, like in the menu path at the top.
ulfalizer_Kconfiglib
train
py
651cf7559a6d27979cdb3bb1d9015b3f1783f032
diff --git a/cmd/jujud/machine.go b/cmd/jujud/machine.go index <HASH>..<HASH> 100644 --- a/cmd/jujud/machine.go +++ b/cmd/jujud/machine.go @@ -297,10 +297,10 @@ func (a *MachineAgent) Tag() string { func (m *MachineAgent) uninstallAgent() error { // TODO(axw) get this from agent config when it's available name := os.Getenv("UPSTART_JOB") - if name == "" { - return fmt.Errorf("not executing within the context of an upstart job") + if name != "" { + return upstart.NewService(name).Remove() } - return upstart.NewService(name).Remove() + return nil } // Below pieces are used for testing,to give us access to the *State opened
Fix test Don't require UPSTART_JOB to be set in machine agent, only attempt to uninstall *if* it is set.
juju_juju
train
go
81764bf0e6b355216cbed5463f78d32494e7bc45
diff --git a/lib/zoneinfo.js b/lib/zoneinfo.js index <HASH>..<HASH> 100644 --- a/lib/zoneinfo.js +++ b/lib/zoneinfo.js @@ -136,9 +136,9 @@ var TZDate = function (args){ // s zero-padded seconds "s": function (){ return self._zeropad(self._date.getUTCSeconds()); }, // A upper-case AM/PM - "A": function (){ return self._date.getUTCHours() >= 12 ? "AM" : "PM"; }, + "A": function (){ return self._date.getUTCHours() >= 12 ? "PM" : "AM"; }, // a lower-case am/pm - "a": function (){ return self._date.getUTCHours() >= 12 ? "am" : "pm"; }, + "a": function (){ return self._date.getUTCHours() >= 12 ? "pm" : "am"; }, // T short timezone "T": function (){ return self.getTimezone(false); }, // t full timezone name
Silly me reversing my AM and PM
gsmcwhirter_node-zoneinfo
train
js
170ed2a1cf948ae7133957637bed62987e1396bb
diff --git a/admin/user.php b/admin/user.php index <HASH>..<HASH> 100644 --- a/admin/user.php +++ b/admin/user.php @@ -57,6 +57,7 @@ $USER = $user; $USER->loggedin = true; + $USER->sesskey = random_string(10); // for added security, used to check script parameters $USER->site = $CFG->wwwroot; $USER->admin = true; $USER->teacher["$site->id"] = true;
Set the sesskey for new admins
moodle_moodle
train
php
8464d932390557d6d7036114b22212c88c5911e1
diff --git a/src/main/java/io/muserver/handlers/ResourceType.java b/src/main/java/io/muserver/handlers/ResourceType.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/muserver/handlers/ResourceType.java +++ b/src/main/java/io/muserver/handlers/ResourceType.java @@ -78,7 +78,7 @@ public class ResourceType { Headers.http2Headers() .add(HeaderNames.CACHE_CONTROL, "max-age=86400") .add(HeaderNames.X_CONTENT_TYPE_OPTIONS, HeaderValues.NOSNIFF), - true, singletonList("js")); + true, asList("js", "mjs")); public static final ResourceType APPLICATION_JSON = new ResourceType(ContentTypes.APPLICATION_JSON, noCache(), true, singletonList("json")); public static final ResourceType WEB_APP_MANIFEST = new ResourceType(ContentTypes.WEB_APP_MANIFEST, Headers.http2Headers() .add(HeaderNames.CACHE_CONTROL, "max-age=300"), true, singletonList("webmanifest"));
Added .mjs as a file extension to serve as text/javascript for javascript modules
3redronin_mu-server
train
java
0355c9a1c063f29fa6c198548aecf8a13f076f11
diff --git a/lib/capybara/version.rb b/lib/capybara/version.rb index <HASH>..<HASH> 100644 --- a/lib/capybara/version.rb +++ b/lib/capybara/version.rb @@ -1,3 +1,3 @@ module Capybara - VERSION = '2.4.1' + VERSION = '2.5.0.dev' end
Update version for work on <I>
teamcapybara_capybara
train
rb
b184c5f00047291f54d77ee69046c5d46f825a60
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -31,6 +31,13 @@ function addAllMtimes(files, metalsmith, done) { function addMtime(err, stats) { if (err) { + // Skip elements of `files` that don't point to existing files. + // This can happen if some other Metalsmith plugin does something + // strange with `files`. + if (err.code === 'ENOENT') { + debug('file %s not found', file); + return done(); + } return done(err); }
Implement skipping of non-existing files If any other plugin leaves `files` with entry that does not correspond to an existing file this entry should be skipped silently.
jkuczm_metalsmith-mtime
train
js
6b3659b6b33bedbd594a8b4cbdba2ba1c343e22c
diff --git a/peewee.py b/peewee.py index <HASH>..<HASH> 100644 --- a/peewee.py +++ b/peewee.py @@ -409,6 +409,9 @@ class Field(Leaf): def get_db_field(self): return self.db_field + def get_template(self): + return self.template + def coerce(self, value): return value @@ -718,6 +721,8 @@ class QueryCompiler(object): OP_NE: '!=', OP_IN: 'IN', OP_IS: 'IS', + OP_BIN_AND: '&', + OP_BIN_OR: '|', OP_LIKE: 'LIKE', OP_ILIKE: 'ILIKE', OP_BETWEEN: 'BETWEEN', @@ -1018,12 +1023,12 @@ class QueryCompiler(object): def field_sql(self, field): attrs = field.attributes attrs['column_type'] = self.get_field(field.get_db_field()) - template = field.template + template = field.get_template() if isinstance(field, ForeignKeyField): to_pk = field.rel_model._meta.primary_key if not isinstance(to_pk, PrimaryKeyField): - template = to_pk.template + template = to_pk.get_template() attrs.update(to_pk.attributes) parts = [self.quote(field.db_column), template]
Dynamic field template and adding operators for binary and/or
coleifer_peewee
train
py
14468b91c05e341bd32832e32b4039d0297edb32
diff --git a/leaflet-providers.js b/leaflet-providers.js index <HASH>..<HASH> 100644 --- a/leaflet-providers.js +++ b/leaflet-providers.js @@ -116,7 +116,7 @@ } }, France: { - url: 'http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', + url: '//{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', options: { attribution: '&copy; Openstreetmap France | {attribution.OpenStreetMap}' }
relative url for OSM FR tiles in order to allow diplaying them on https sites (thx to @erational & fdh.org)
leaflet-extras_leaflet-providers
train
js
2bb5b402154243c2bb6fe9d39c14401366efc80d
diff --git a/lib/setup.php b/lib/setup.php index <HASH>..<HASH> 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -749,11 +749,6 @@ ini_set('arg_separator.output', '&amp;'); // Work around for a PHP bug see MDL-11237 ini_set('pcre.backtrack_limit', 20971520); // 20 MB -// Work around for PHP7 bug #70110. See MDL-52475 . -if (ini_get('pcre.jit')) { - ini_set('pcre.jit', 0); -} - // Set PHP default timezone to server timezone. core_date::set_default_server_timezone();
MDL-<I> core: Revert workaround PHP7 bug #<I> with preg_match This reverts commit <I>fb5e0a0a<I>eeff9a5fb<I>c<I>c<I>a<I>. The fix is now part of php<I>
moodle_moodle
train
php
836f6eeac50a25346df26a799b8f6b76b5ab2316
diff --git a/tests/rules/test_go_unknown_command.py b/tests/rules/test_go_unknown_command.py index <HASH>..<HASH> 100644 --- a/tests/rules/test_go_unknown_command.py +++ b/tests/rules/test_go_unknown_command.py @@ -1,6 +1,7 @@ import pytest from thefuck.rules.go_unknown_command import match, get_new_command from thefuck.types import Command +from thefuck.utils import which @pytest.fixture @@ -17,5 +18,6 @@ def test_not_match(): assert not match(Command('go run', 'go run: no go files listed')) [email protected](not which('go'), reason='Skip if go executable not found') def test_get_new_command(build_misspelled_output): assert get_new_command(Command('go bulid', build_misspelled_output)) == 'go build'
Skip test instead of failing if go executable is not found. (#<I>)
nvbn_thefuck
train
py
6dbd28fc405d066da6a36027313708bb33b948c5
diff --git a/tests/integration/uncategorized/uncategorized.test.js b/tests/integration/uncategorized/uncategorized.test.js index <HASH>..<HASH> 100644 --- a/tests/integration/uncategorized/uncategorized.test.js +++ b/tests/integration/uncategorized/uncategorized.test.js @@ -64,3 +64,26 @@ describe('noPrependStageInUrl tests', () => { expect(json.statusCode).toEqual(404) }) }) + +describe('prefix options', () => { + // init + beforeAll(() => + setup({ + servicePath: resolve(__dirname), + args: ['--prefix', 'someprefix'], + }), + ) + + // cleanup + afterAll(() => teardown()) + + describe('when the prefix option is used', () => { + test('the prefixed path should return a payload', async () => { + const url = joinUrl(TEST_BASE_URL, '/someprefix/dev/uncategorized-1') + const response = await fetch(url) + const json = await response.json() + + expect(json).toEqual({ foo: 'bar' }) + }) + }) +})
chore(tests): Add integration test for prefix option
dherault_serverless-offline
train
js
1852ad78a20fd8b37f03c97c3dfb006790ce8d45
diff --git a/src/ol/interaction/Pointer.js b/src/ol/interaction/Pointer.js index <HASH>..<HASH> 100644 --- a/src/ol/interaction/Pointer.js +++ b/src/ol/interaction/Pointer.js @@ -195,6 +195,16 @@ class PointerInteraction extends Interaction { const id = event.pointerId.toString(); if (mapBrowserEvent.type == MapBrowserEventType.POINTERUP) { delete this.trackedPointers_[id]; + for (const pointerId in this.trackedPointers_) { + if (this.trackedPointers_[pointerId].target !== event.target) { + // Some platforms assign a new pointerId when the target changes. + // If this happens, delete one tracked pointer. If there is more + // than one tracked pointer for the old target, it will be cleared + // by subsequent POINTERUP events from other pointers. + delete this.trackedPointers_[pointerId]; + break; + } + } } else if (mapBrowserEvent.type == MapBrowserEventType.POINTERDOWN) { this.trackedPointers_[id] = event; } else if (id in this.trackedPointers_) {
Clean up tracked pointers when the event target has changed
openlayers_openlayers
train
js
5cb03c94ae359737fde46770e5fa8f5966cb73f8
diff --git a/lib/workers/repository/error.js b/lib/workers/repository/error.js index <HASH>..<HASH> 100644 --- a/lib/workers/repository/error.js +++ b/lib/workers/repository/error.js @@ -83,6 +83,7 @@ async function handleError(config, err) { err, message: err.message, body: err.response ? err.response.body : undefined, + stack: err.stack, }, `Repository has unknown error` );
fix: log stack trace for unknown errors
renovatebot_renovate
train
js
6d1f633df1f898ae92e922cd371221c48fac7149
diff --git a/ib_insync/flexreport.py b/ib_insync/flexreport.py index <HASH>..<HASH> 100644 --- a/ib_insync/flexreport.py +++ b/ib_insync/flexreport.py @@ -23,15 +23,6 @@ class FlexReport: Download and parse IB account statements via the Flex Web Service. https://www.interactivebrokers.com/en/software/am/am/reports/flex_web_service_version_3.htm - To obtain a ``token`` in account management, go to - Reports -> Settings -> Flex Web Service. - Tip: choose a 1 year expiry. - - To obtain a ``queryId``: Create and save a query with - Report -> Activity -> Flex Queries or - Report -> Trade Confirmations -> Flex Queries. - Find the query ID (not the query name). - A large query can take a few minutes. In the weekends the query servers can be down. """
Removed outdated instructions on using the flex web service
erdewit_ib_insync
train
py
51d54346a5c6ea1eb41a8571d98a7e7b3bcec4cf
diff --git a/src/server/auth/server/auth.go b/src/server/auth/server/auth.go index <HASH>..<HASH> 100644 --- a/src/server/auth/server/auth.go +++ b/src/server/auth/server/auth.go @@ -462,7 +462,8 @@ func (a *apiServer) SetACL(ctx context.Context, req *authclient.SetACLRequest) ( _, rwErr := col.NewSTM(ctx, a.etcdClient, func(stm col.STM) error { acls := a.acls.ReadWrite(stm) var acl authclient.ACL - if err := acls.Get(req.Repo.Name, &acl); err != nil { + if err := acls.Get(req.Repo.Name, &acl); err != nil && !user.Admin { + // No ACL found return err }
Fix SetAcl -- if no existing ACL is found, but the caller is an admin, they may update the ACL
pachyderm_pachyderm
train
go
c6e3e1f7e738666a9eda3d315dac3f75aa84b753
diff --git a/state/lease/client.go b/state/lease/client.go index <HASH>..<HASH> 100644 --- a/state/lease/client.go +++ b/state/lease/client.go @@ -292,9 +292,9 @@ func LookupLease(coll mongo.Collection, namespace, name string) (leaseDoc, error var doc leaseDoc err := coll.FindId(leaseDocId(namespace, name)).One(&doc) if err != nil { - return doc, err + return leaseDoc{}, err } - return doc, err + return doc, nil } // extendLeaseOps returns the []txn.Op necessary to extend the supplied lease
Review feedback. Clarify the different return paths.
juju_juju
train
go
76030f45260673da54f0404fa16a0798cb9aeb14
diff --git a/pkg/apis/kops/v1alpha2/zz_generated.conversion.go b/pkg/apis/kops/v1alpha2/zz_generated.conversion.go index <HASH>..<HASH> 100644 --- a/pkg/apis/kops/v1alpha2/zz_generated.conversion.go +++ b/pkg/apis/kops/v1alpha2/zz_generated.conversion.go @@ -1343,6 +1343,7 @@ func autoConvert_v1alpha2_CalicoNetworkingSpec_To_kops_CalicoNetworkingSpec(in * out.TyphaPrometheusMetricsEnabled = in.TyphaPrometheusMetricsEnabled out.TyphaPrometheusMetricsPort = in.TyphaPrometheusMetricsPort out.TyphaReplicas = in.TyphaReplicas + out.WireguardEnabled = in.WireguardEnabled return nil } @@ -1370,6 +1371,7 @@ func autoConvert_kops_CalicoNetworkingSpec_To_v1alpha2_CalicoNetworkingSpec(in * out.TyphaPrometheusMetricsEnabled = in.TyphaPrometheusMetricsEnabled out.TyphaPrometheusMetricsPort = in.TyphaPrometheusMetricsPort out.TyphaReplicas = in.TyphaReplicas + out.WireguardEnabled = in.WireguardEnabled return nil }
Update generated conversion for wireguardEnabled
kubernetes_kops
train
go
4b3e4389258b3476fe2e288b2880e0d026f57b3b
diff --git a/salt/engines/__init__.py b/salt/engines/__init__.py index <HASH>..<HASH> 100644 --- a/salt/engines/__init__.py +++ b/salt/engines/__init__.py @@ -12,6 +12,7 @@ import logging import salt import salt.loader import salt.utils +from salt.utils.process import MultiprocessingProcess log = logging.getLogger(__name__) @@ -59,7 +60,7 @@ def start_engines(opts, proc_mgr): ) -class Engine(multiprocessing.Process): +class Engine(MultiprocessingProcess): ''' Execute the given engine in a new process '''
Switch engines to MultiprocessingProcess
saltstack_salt
train
py
14f7e52725d88a0494ce6e12176eaf150569cf9a
diff --git a/archive/tar.go b/archive/tar.go index <HASH>..<HASH> 100644 --- a/archive/tar.go +++ b/archive/tar.go @@ -194,7 +194,7 @@ func applyNaive(ctx context.Context, root string, tr *tar.Reader, options ApplyO parentPath = filepath.Dir(path) } if _, err := os.Lstat(parentPath); err != nil && os.IsNotExist(err) { - err = mkdirAll(parentPath, 0700) + err = mkdirAll(parentPath, 0755) if err != nil { return 0, err }
Unpack should set <I> when the parent directory doesn't exist.
containerd_containerd
train
go
9c74e93a27e5e3c3033befc22df84ea182d0125e
diff --git a/lib/manager/composer/artifacts.js b/lib/manager/composer/artifacts.js index <HASH>..<HASH> 100644 --- a/lib/manager/composer/artifacts.js +++ b/lib/manager/composer/artifacts.js @@ -69,7 +69,7 @@ async function getArtifacts( const envVars = ['COMPOSER_CACHE_DIR']; cmd += envVars.map(e => `-e ${e} `); cmd += `-w ${cwd} `; - cmd += `composer:1.7.2`; + cmd += `renovate/composer composer`; } else { logger.info('Running composer via global composer'); cmd = 'composer';
refactor(composer): use renovate/composer docker image
renovatebot_renovate
train
js
d61ecb8cc4e7d8f52ac607e396115676f3c89200
diff --git a/stream/notifications.go b/stream/notifications.go index <HASH>..<HASH> 100755 --- a/stream/notifications.go +++ b/stream/notifications.go @@ -35,7 +35,7 @@ func Notifications() echo.HandlerFunc { return c.String(http.StatusInternalServerError, "Invalid authorization") } - websocket.Handler(func(ws *websocket.Conn) { + websocket.Server{Handler: websocket.Handler(func(ws *websocket.Conn) { // Listen from notification sent on DB channel u<ID> nerdz.Db().Listen("u"+strconv.Itoa(int(accessData.UserData.(uint64))), func(payload ...string) { if len(payload) == 1 { @@ -53,7 +53,7 @@ func Notifications() echo.HandlerFunc { break } } - }).ServeHTTP(c.Response(), c.Request()) + })}.ServeHTTP(c.Response(), c.Request()) return nil } }
wrap websocket.Handler with websocket.Server for notifications stream
nerdzeu_nerdz-api
train
go
bbaccdce8404b6d08236cd5494502fbe3260f688
diff --git a/spec/sneakers/worker_handlers_spec.rb b/spec/sneakers/worker_handlers_spec.rb index <HASH>..<HASH> 100644 --- a/spec/sneakers/worker_handlers_spec.rb +++ b/spec/sneakers/worker_handlers_spec.rb @@ -132,7 +132,9 @@ describe 'Handlers' do before(:each) do @opts = { :exchange => 'sneakers', - :durable => 'true', + :queue_options => { + :durable => 'true', + } }.tap do |opts| opts[:retry_max_times] = max_retries unless max_retries.nil? end
MaxRetry specfix: set :queue_options in mocks and use them
jondot_sneakers
train
rb
5d1e97e4d9630c37a537eda957061a11aa5d72eb
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -63,7 +63,7 @@ install_requires = setup_requires + ['Mako>=1.0.1', 'jinja2', 'mpld3>=0.3git', 'pyRXP>=2.1.0', - 'pycbc-pylal>=0.9.4', + 'pycbc-pylal>=0.9.5', 'pycbc-glue>=0.9.6', ] links = ['https://github.com/ligo-cbc/mpld3/tarball/master#egg=mpld3-0.3git']
Require pycbc-pylal <I> to get frequency series
gwastro_pycbc
train
py
3af69c791226306fcd2dfcc974f0f6034777a88b
diff --git a/lavalink.py b/lavalink.py index <HASH>..<HASH> 100644 --- a/lavalink.py +++ b/lavalink.py @@ -344,3 +344,13 @@ class Utils: return True except ValueError: return False + + @staticmethod + def get_number(num, default=1): + if num is None: + return default + + try: + return int(num) + except ValueError: + return default diff --git a/music.py b/music.py index <HASH>..<HASH> 100644 --- a/music.py +++ b/music.py @@ -73,13 +73,7 @@ class Music: items_per_page = 10 pages = math.ceil(len(player.queue) / items_per_page) - - if not page or not lavalink.Utils.is_number(page): - page = 1 - elif page < 1: - page = 1 - elif page > pages: - page = pages + page = lavalink.Utils.get_number(page) start = (page - 1) * items_per_page end = start + items_per_page
fixes/improvements to queue etc
Devoxin_Lavalink.py
train
py,py
a567869e213f0d5d46875e86bb59e1198e29040a
diff --git a/client/js/traditional/traditional.form.upload.handler.js b/client/js/traditional/traditional.form.upload.handler.js index <HASH>..<HASH> 100644 --- a/client/js/traditional/traditional.form.upload.handler.js +++ b/client/js/traditional/traditional.form.upload.handler.js @@ -52,7 +52,7 @@ qq.traditional.FormUploadHandler = function(options, proxy) { */ function createForm(id, iframe) { var params = options.paramsStore.get(id), - method = "POST", + method = options.method.toLowerCase() === "get" ? "GET" : "POST", endpoint = options.endpointStore.get(id), name = getName(id);
chore(form-uploads): allow "upload" via GET for gh-pages demo #<I>
FineUploader_fine-uploader
train
js
31e8a6b88a595922ba3a42a1d2856cf5a2e0a2a0
diff --git a/doc/generate-doc.py b/doc/generate-doc.py index <HASH>..<HASH> 100644 --- a/doc/generate-doc.py +++ b/doc/generate-doc.py @@ -1,5 +1,7 @@ import logging import os +import os +import glob from easyprocess import EasyProcess from entrypoint2 import entrypoint @@ -12,9 +14,17 @@ commands = [ "python3 -m pyscreenshot.check.speedtest --childprocess 0", ] +def empty_dir(dir): + files = glob.glob(os.path.join(dir, "*")) + for f in files: + os.remove(f) @entrypoint def main(): + gendir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "gen") + logging.info("gendir: %s", gendir) + os.makedirs(gendir, exist_ok=True) + empty_dir(gendir) pls = [] try: os.chdir("gen")
generate-doc: make and clean out directory
ponty_pyscreenshot
train
py
0370e473d4c09cc575b50c14569b9522fd82a2a1
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -163,6 +163,6 @@ gulp.task("dist", ["test", "bower"], function(done) { .pipe(rename({extname: ".min.js"})) .pipe(gulp.dest("dist/")) .on("end", function() { - git.exec({args: "add -A dist", quiet: true}, done); + git.exec({args: "add -A dist bower.json", quiet: true}, done); }); });
add bower.json into version commit
chemerisuk_better-dom
train
js
685619cdaf3ea0af46da6d14ee9632620dc9c286
diff --git a/swf-plugin-mail/src/main/java/com/venky/swf/plugins/mail/core/grid/SendGridMailer.java b/swf-plugin-mail/src/main/java/com/venky/swf/plugins/mail/core/grid/SendGridMailer.java index <HASH>..<HASH> 100644 --- a/swf-plugin-mail/src/main/java/com/venky/swf/plugins/mail/core/grid/SendGridMailer.java +++ b/swf-plugin-mail/src/main/java/com/venky/swf/plugins/mail/core/grid/SendGridMailer.java @@ -54,9 +54,6 @@ public class SendGridMailer implements Mailer{ attributes.add(new BasicNameValuePair("api_user",sendGridAccountUserName)); attributes.add(new BasicNameValuePair("api_key",sendGridAccountPassword)); - // sendgrid.com/api/mail.send.json?to=venky%40shipx.in&toname=Venky& - // from=threesixtyperf%40succinct.in&fromname=ThreesixtyPerf&subject=Test&text=Test%20Mail%20Text& - // html=Text%20Mail%20%3Cb%3EHtml%3C%2Fb%3E&api_user=venkatramanm&api_key=succinct12 post.setEntity(new UrlEncodedFormEntity(attributes)); HttpResponse response = client.execute(post); String sResponse = StringUtil.read(response.getEntity().getContent());
Removed reference to password after changing in sendgrid
venkatramanm_swf-all
train
java
3c615dbb6e702d148d5bae8564398b4814f703ed
diff --git a/pyrsistent.py b/pyrsistent.py index <HASH>..<HASH> 100644 --- a/pyrsistent.py +++ b/pyrsistent.py @@ -2233,9 +2233,9 @@ def precord(*_fields, **_typed_fields): def __repr__(self): untyped_repr = ', '.join("'{0}'".format(f) for f in fields) - typed_repr = ', '.join("{0}={1}".format(k, "({0},)".format(', '.join(t.__name__ for t in v))) for k, v in typed_fields.items()) + typed_repr = ', '.join("{0}={1}".format(k, "({0},)".format(', '.join(sorted(t.__name__ for t in v)))) for k, v in typed_fields.items()) field_repr = ', '.join(r for r in (untyped_repr, typed_repr) if r) - arg_repr = ', '.join("{0}={1}".format(k, repr(v)) for k, v in self.items()) + arg_repr = ', '.join("{0}={1}".format(k, repr(v)) for k, v in sorted(self.items())) return 'precord({0})({1})'.format(field_repr, arg_repr) def __reduce__(self):
Deterministic repr output to facilitate testing
tobgu_pyrsistent
train
py
664599d8d38310c3e054084dc07f01ec8967c999
diff --git a/lib/opentox-ruby-api-wrapper.rb b/lib/opentox-ruby-api-wrapper.rb index <HASH>..<HASH> 100644 --- a/lib/opentox-ruby-api-wrapper.rb +++ b/lib/opentox-ruby-api-wrapper.rb @@ -116,7 +116,7 @@ module OpenTox # Add a compound and a feature to a dataset def add(compound,feature) - RestClient.put @uri, :compound_uri => compound.uri, :feature_uri => feature.uri + RestClient.post @uri, :compound_uri => compound.uri, :feature_uri => feature.uri end end
post instead of put to submit to dataset
opentox_lazar
train
rb
69ebe6199bf5d500c1f90b6edb9bf496eb006663
diff --git a/src/Joomlatools/Console/Application.php b/src/Joomlatools/Console/Application.php index <HASH>..<HASH> 100644 --- a/src/Joomlatools/Console/Application.php +++ b/src/Joomlatools/Console/Application.php @@ -68,13 +68,16 @@ class Application extends \Symfony\Component\Console\Application public function run(Input\InputInterface $input = null, Output\OutputInterface $output = null) { if (null === $input) { - $this->_input = new Input\ArgvInput(); + $input = new Input\ArgvInput(); } if (null === $output) { - $this->_output = new Output\ConsoleOutput(); + $output = new Output\ConsoleOutput(); } + $this->_input = $input; + $this->_output = $output; + $this->configureIO($this->_input, $this->_output); $this->_loadPlugins();
Hotfix: Make sure to store references to Input and Output objects
joomlatools_joomlatools-console
train
php
ae8bdc595ea65422669fc291e8a82f36f9bf0a4b
diff --git a/src/Logger/BadgeLogger.php b/src/Logger/BadgeLogger.php index <HASH>..<HASH> 100644 --- a/src/Logger/BadgeLogger.php +++ b/src/Logger/BadgeLogger.php @@ -48,9 +48,6 @@ use Symfony\Component\Console\Output\OutputInterface; */ final class BadgeLogger implements MutationTestingResultsLogger { - public const ENV_INFECTION_BADGE_API_KEY = 'INFECTION_BADGE_API_KEY'; - public const ENV_STRYKER_DASHBOARD_API_KEY = 'STRYKER_DASHBOARD_API_KEY'; - private $output; private $strykerApiKeyResolver; private $badgeApiClient;
Fix: Remove unused constants (#<I>)
infection_infection
train
php
1def4499eeb6059716648d82f6f8dec1dc52705f
diff --git a/lib/commonAPI/mediaplayer/ext/platform/android/src/com/rho/mediaplayer/MediaplayerSingleton.java b/lib/commonAPI/mediaplayer/ext/platform/android/src/com/rho/mediaplayer/MediaplayerSingleton.java index <HASH>..<HASH> 100644 --- a/lib/commonAPI/mediaplayer/ext/platform/android/src/com/rho/mediaplayer/MediaplayerSingleton.java +++ b/lib/commonAPI/mediaplayer/ext/platform/android/src/com/rho/mediaplayer/MediaplayerSingleton.java @@ -35,7 +35,7 @@ class MediaplayerSingleton extends MediaplayerSingletonBase implements IMediapla } public MediaplayerSingleton(MediaplayerFactory factory) { - super(factory); + super(); Logger.I(TAG, "Creating Mediaplayer extension"); init(); } @@ -187,7 +187,6 @@ class MediaplayerSingleton extends MediaplayerSingletonBase implements IMediapla Logger.I(TAG, "stopRingTone"); } - @Override protected String getInitialDefaultID() { return null; }
Removed call to super(factory) from base class, as base class no longer has a constructor with factory parameter.
rhomobile_rhodes
train
java
dcc72a283c4ee2d363e5425e8ba7e21e0bd11904
diff --git a/lib/s3ftp/driver.rb b/lib/s3ftp/driver.rb index <HASH>..<HASH> 100644 --- a/lib/s3ftp/driver.rb +++ b/lib/s3ftp/driver.rb @@ -68,14 +68,15 @@ module S3FTP item.get(:retry_count => 1, :on_success => on_success, :on_error => on_error) end - def put_file(path, data, &block) + def put_file(path, tmp_path, &block) key = scoped_path(path) + bytes = File.size(tmp_path) on_error = Proc.new {|response| yield false } - on_success = Proc.new {|response| yield true } + on_success = Proc.new {|response| yield bytes } item = Happening::S3::Item.new(aws_bucket, key, :aws_access_key_id => aws_key, :aws_secret_access_key => aws_secret) - item.put(data, :retry_count => 0, :on_success => on_success, :on_error => on_error) + item.put(File.binread(tmp_path), :retry_count => 0, :on_success => on_success, :on_error => on_error) end def delete_file(path, &block)
the put_file method now takes a temp file path instead of raw data * to avoid DOS attacks when a large file is uploaded
yob_s3ftp
train
rb
eaf6e796ab35ae1f1fe0fda84acba9008f6117ac
diff --git a/tests/automated/events-gcal.js b/tests/automated/events-gcal.js index <HASH>..<HASH> 100644 --- a/tests/automated/events-gcal.js +++ b/tests/automated/events-gcal.js @@ -1,5 +1,7 @@ -describe('Google Calendar plugin', function() { +// TODO: revive +// Google removes holidays that are old, and returns no results, breaking these tests +xdescribe('Google Calendar plugin', function() { var API_KEY = 'AIzaSyDcnW6WejpTOCffshGDDb4neIrXVUA1EAE'; var options;
temporarily disable gcal tests, network not returning data
fullcalendar_fullcalendar
train
js
4f345b92ffd4de515805ec95c26e9b6a16c43ef8
diff --git a/es/index.go b/es/index.go index <HASH>..<HASH> 100644 --- a/es/index.go +++ b/es/index.go @@ -301,6 +301,10 @@ func (index *Index) Post(u string, i interface{}) (*HttpResponse, error) { return index.request("POST", u, i) } +func (index *Index) PostObject(i interface{}) (*HttpResponse, error) { + return index.request("POST", index.TypeUrl(), i) +} + func (index *Index) PutObject(id string, i interface{}) (*HttpResponse, error) { return index.request("PUT", index.TypeUrl()+"/"+id, i) }
add method to create ES entries by posting
dynport_dgtk
train
go
a973e2f775b90de69d9e3e343abc7ec9d9d0c7f5
diff --git a/master/buildbot/status/web/change_hook.py b/master/buildbot/status/web/change_hook.py index <HASH>..<HASH> 100644 --- a/master/buildbot/status/web/change_hook.py +++ b/master/buildbot/status/web/change_hook.py @@ -60,9 +60,9 @@ class ChangeHookResource(resource.Resource): try: changes, src = self.getChanges( request ) - except ValueError, err: - request.setResponseCode(400, err.args[0]) - return err.args[0] + except ValueError, val_err: + request.setResponseCode(400, val_err.args[0]) + return val_err.args[0] except Exception, e: log.err(e, "processing changes from web hook") msg = "Error processing changes."
web change hook: rename exception variable name Use a more descriptive name of the cought instance of ValueError exception. The generic 'err' was redefined as a local function on line <I>. This fixes pylint error 'E<I> (function-redefined)' in this file.
buildbot_buildbot
train
py
0718589c83207c5c34655e6818378281c9ac348e
diff --git a/lib/memoizable/memory.rb b/lib/memoizable/memory.rb index <HASH>..<HASH> 100644 --- a/lib/memoizable/memory.rb +++ b/lib/memoizable/memory.rb @@ -12,8 +12,8 @@ module Memoizable # @return [undefined] # # @api private - def initialize(memory = ThreadSafe::Cache.new) - @memory = memory + def initialize + @memory = ThreadSafe::Cache.new @monitor = Monitor.new freeze end @@ -92,12 +92,12 @@ module Memoizable # @param [Hash] hash # A hash used to populate the internal memory # - # @return [Memoizable::Memory] + # @return [undefined] # # @api public def marshal_load(hash) - cache = ThreadSafe::Cache.new.marshal_load(hash) - initialize(cache) + initialize + @memory.marshal_load(hash) end end # Memory
Remove injected cache from the Memoizable::Memory constructor * It turns out that it isn't necessary to inject the cache into the constructor while loading the cache data. * Fix documentation on the #marshal_load method to make it clear that the return value is not used by Marshal.
dkubb_memoizable
train
rb
3d59bd7e37017ca51c3f606df175ecc8834a7731
diff --git a/exam.js b/exam.js index <HASH>..<HASH> 100755 --- a/exam.js +++ b/exam.js @@ -1976,7 +1976,13 @@ var tree = function (options) { } } case AFTER: - fns = (isSuite ? node.after : prep[1]); + if (isSuite) { + fns = node.after; + context = node; + } + else { + fns = prep[1]; + } if (fns) break; node.phase = END; case END: diff --git a/lib/tree.js b/lib/tree.js index <HASH>..<HASH> 100644 --- a/lib/tree.js +++ b/lib/tree.js @@ -61,8 +61,10 @@ var tree = module.exports = function (options) { */ var prepKeys = ['beforeEach', 'afterEach']; var prep = [null, null]; + var BEFORE_EACH = 0; var AFTER_EACH = 1; + var asyncPattern = /^function.*?\([^\s\)]/; /** @@ -345,7 +347,13 @@ var tree = module.exports = function (options) { } case AFTER: - fns = (isSuite ? node.after : prep[1]); + if (isSuite) { + fns = node.after; + context = node; + } + else { + fns = prep[1]; + } if (fns) break; node.phase = END;
Applied the suite as context for "after" functions
lighterio_exam
train
js,js
82511d6edcaf94f5a41a747da2de056e9816857d
diff --git a/pip_accel/caches/__init__.py b/pip_accel/caches/__init__.py index <HASH>..<HASH> 100644 --- a/pip_accel/caches/__init__.py +++ b/pip_accel/caches/__init__.py @@ -20,6 +20,7 @@ which automatically disables backends that report errors. # Standard library modules. import logging +import sys # Modules included in our package. from pip_accel.exceptions import CacheBackendDisabledError @@ -35,6 +36,13 @@ logger = logging.getLogger(__name__) # Initialize the registry of cache backends. registered_backends = set() +# On Windows it is not allowed to have colons ':' in filenames. +if sys.platform.startswith('win'): + FILENAME_PATTERN = 'v%i\\%s$%s$%s.tar.gz' +else: + FILENAME_PATTERN = 'v%i/%s:%s:%s.tar.gz' + + class CacheBackendMeta(type): """Metaclass to intercept cache backend definitions.""" @@ -193,5 +201,5 @@ class CacheManager(object): including a single leading directory component to indicate the cache format revision. """ - return 'v%i/%s:%s:%s.tar.gz' % (self.config.cache_format_revision, + return FILENAME_PATTERN % (self.config.cache_format_revision, requirement.name, requirement.version, get_python_version())
Fix generated cache filenames - on Windows colon is not allowed in filenames (issue #<I>)
paylogic_pip-accel
train
py
7ff26d63b8133088af32de2e7dc63e788ddce66b
diff --git a/lib/alchemy/upgrader.rb b/lib/alchemy/upgrader.rb index <HASH>..<HASH> 100644 --- a/lib/alchemy/upgrader.rb +++ b/lib/alchemy/upgrader.rb @@ -105,7 +105,6 @@ module Alchemy else log "No essence_type columns to be namespaced found.", :skip end - todo "Test mich nicht" end def strip_alchemy_from_schema_version_table @@ -113,7 +112,6 @@ module Alchemy database_yml = YAML.load_file(Rails.root.join("config", "database.yml")) connection = Mysql2::Client.new(database_yml.fetch(Rails.env.to_s).symbolize_keys) connection.query "UPDATE schema_migrations SET `schema_migrations`.`version` = REPLACE(`schema_migrations`.`version`,'-alchemy','')" - todo "Teste mich" end def convert_essence_texts_displayed_as_select_into_essence_selects
Removing upgrader test code :)
AlchemyCMS_alchemy_cms
train
rb
5473070405a108f71afd818fb8df04d7489df4db
diff --git a/modules/activiti-engine/src/test/java/org/activiti/engine/test/db/IdGeneratorDataSourceDoNothing.java b/modules/activiti-engine/src/test/java/org/activiti/engine/test/db/IdGeneratorDataSourceDoNothing.java index <HASH>..<HASH> 100644 --- a/modules/activiti-engine/src/test/java/org/activiti/engine/test/db/IdGeneratorDataSourceDoNothing.java +++ b/modules/activiti-engine/src/test/java/org/activiti/engine/test/db/IdGeneratorDataSourceDoNothing.java @@ -6,7 +6,6 @@ import org.activiti.engine.impl.pvm.delegate.ActivityExecution; public class IdGeneratorDataSourceDoNothing implements ActivityBehavior { - @Override public void execute(ActivityExecution execution) throws Exception { }
removing override that gives problems in eclipse
Activiti_Activiti
train
java
60d92b880d34b20348f46f3f2c2419e8070959b7
diff --git a/lib/lazy_record/associations.rb b/lib/lazy_record/associations.rb index <HASH>..<HASH> 100644 --- a/lib/lazy_record/associations.rb +++ b/lib/lazy_record/associations.rb @@ -26,7 +26,7 @@ module LazyRecord end def apply_nesting(class_name) - "#{self.to_s.split('::')[0..-3].join('::')}::#{class_name}" + "#{to_s.split('::')[0..-3].join('::')}::#{class_name}" end def lr_has_many(*collections) diff --git a/lib/lazy_record/attributes.rb b/lib/lazy_record/attributes.rb index <HASH>..<HASH> 100644 --- a/lib/lazy_record/attributes.rb +++ b/lib/lazy_record/attributes.rb @@ -21,6 +21,11 @@ module LazyRecord def define_initialize define_method(:initialize) do |opts = {}, &block| + opts = opts.inject({}) do |memo, (k,v)| + memo[k.to_sym] = v + memo + end + instance_attr_accessors.each do |attr| send("#{attr}=", opts[attr.to_sym]) end
accept strings as hash keys for initialize opts
msimonborg_lazy_record
train
rb,rb
3928f70065f3a802270182d1f0251deb317d4416
diff --git a/packages/plugin-csl/src/engines.js b/packages/plugin-csl/src/engines.js index <HASH>..<HASH> 100644 --- a/packages/plugin-csl/src/engines.js +++ b/packages/plugin-csl/src/engines.js @@ -27,6 +27,20 @@ for (const format in CSL.Output.Formats) { // END /** + * @access private + * @param {String} lang - language code + * @return {String} locale XML + */ +function retrieveLocale (lang) { + const unnormalised = lang.replace('-', '_') + if (locales.has(lang)) { + return locales.get(lang) + } else if (locales.has(unnormalised)) { + return locales.get(unnormalised) + } +} + +/** * Object containing CSL Engines * * @access private @@ -79,7 +93,7 @@ const prepareEngine = function (data, templateName, language, format) { const template = templates.get(templates.has(templateName) ? templateName : 'apa') language = locales.has(language) ? language : 'en-US' - const engine = fetchEngine(templateName, language, template, key => items[key], locales.get.bind(locales)) + const engine = fetchEngine(templateName, language, template, key => items[key], retrieveLocale) engine.setOutputFormat(format) return engine
fix(plugin-csl): check for non-normalised language codes Citeproc-js normalises language codes. This patch checks for the presence of locales under non-normalised language codes, if there are no locales present under the normalised language code. Fix <URL>
citation-js_citation-js
train
js
04be9776310fe7d1afb97795645f95c21e6b4fcf
diff --git a/src/CachedClient.php b/src/CachedClient.php index <HASH>..<HASH> 100644 --- a/src/CachedClient.php +++ b/src/CachedClient.php @@ -36,7 +36,7 @@ class CachedClient extends Client return parent::read($path); } - $key = self::READ_CACHE_KEY . str_replace(['{', '}', '(', ')', '/', '\\', '@'], '_', $path); + $key = self::READ_CACHE_KEY . str_replace(['{', '}', '(', ')', '/', '\\', '@', '-'], '_', $path); if ($this->cache->hasItem($key)) { $this->logger->debug('Has read response in cache.', ['path' => $path]);
replace - _ to in key
CSharpRU_vault-php
train
php
7d1e605e7619d3eaef443deda2a16441d6b12fc4
diff --git a/lib/forms/camunda-form.js b/lib/forms/camunda-form.js index <HASH>..<HASH> 100644 --- a/lib/forms/camunda-form.js +++ b/lib/forms/camunda-form.js @@ -490,7 +490,7 @@ CamundaForm.prototype.transformFiles = function(callback) { } var reader = new FileReader(); /* jshint ignore:start */ - reader.onloadend = (function(i) { + reader.onloadend = (function(i, element) { return function(e) { var binary = ''; var bytes = new Uint8Array( e.target.result ); @@ -511,7 +511,7 @@ CamundaForm.prototype.transformFiles = function(callback) { callCallback(); }; - })(i); + })(i, element); /* jshint ignore:end */ reader.readAsArrayBuffer(element.files[0]); counter++;
fix(fileupload): scope element
camunda_camunda-bpm-sdk-js
train
js
83b80e2125afefe8f64e9a0c7cdea2d497b150cd
diff --git a/src/layout/order.js b/src/layout/order.js index <HASH>..<HASH> 100644 --- a/src/layout/order.js +++ b/src/layout/order.js @@ -34,11 +34,12 @@ dagre.layout.order = function() { } var cc; - for (var i = 0; i < iterations; ++i) { + for (var i = 0, lastBest = 0; lastBest < 4 && i < iterations; ++i, ++lastBest) { cc = barycenterLayering(g, i, layering); if (cc < bestCC) { bestLayering = copyLayering(layering); bestCC = cc; + lastBest = 0; } if (debugLevel >= 2) { console.log("Order phase iter " + i + " cross count: " + bestCC);
Abandon order optimization early if cross count doesn't improve
dagrejs_dagre-d3
train
js
ac143b968f23483c917590caf97c050b1232afd7
diff --git a/library/CM/FormField/Password.js b/library/CM/FormField/Password.js index <HASH>..<HASH> 100644 --- a/library/CM/FormField/Password.js +++ b/library/CM/FormField/Password.js @@ -18,6 +18,10 @@ var CM_FormField_Password = CM_FormField_Text.extend({ this.on('change', function () { this._applyDesiredPasswordVisibility(); }); + var self = this; + this.getForm().on('submit', function() { + self.togglePasswordVisibility(false); + }); }, /**
Change CM_FormField_Password type before form submit.
cargomedia_cm
train
js
b0b5e14b7763d46c611cfeebabc124596a450de0
diff --git a/libnetwork/ipam/allocator_test.go b/libnetwork/ipam/allocator_test.go index <HASH>..<HASH> 100644 --- a/libnetwork/ipam/allocator_test.go +++ b/libnetwork/ipam/allocator_test.go @@ -1141,19 +1141,21 @@ func benchMarkRequest(subnet string, b *testing.B) { } } -func BenchmarkRequest_24(b *testing.B) { - a, _ := getAllocator(true) - benchmarkRequest(b, a, "10.0.0.0/24") -} +func BenchmarkRequest(b *testing.B) { -func BenchmarkRequest_16(b *testing.B) { - a, _ := getAllocator(true) - benchmarkRequest(b, a, "10.0.0.0/16") -} + subnets := []string{ + "10.0.0.0/24", + "10.0.0.0/16", + "10.0.0.0/8", + } -func BenchmarkRequest_8(b *testing.B) { - a, _ := getAllocator(true) - benchmarkRequest(b, a, "10.0.0.0/8") + for _, subnet := range subnets { + name := fmt.Sprintf("%vSubnet", subnet) + b.Run(name, func(b *testing.B) { + a, _ := getAllocator(true) + benchmarkRequest(b, a, subnet) + }) + } } func TestAllocateRandomDeallocate(t *testing.T) {
test: update tests to use sub-benchmarks Go <I> added the subtest feature which can make table-driven tests much easier to run and debug. Some tests are not using this feature.
moby_moby
train
go
a41a5eabfbd0ff55446c44823143acc1baea4945
diff --git a/src/Conv/Factory/TableStructureFactory.php b/src/Conv/Factory/TableStructureFactory.php index <HASH>..<HASH> 100755 --- a/src/Conv/Factory/TableStructureFactory.php +++ b/src/Conv/Factory/TableStructureFactory.php @@ -248,7 +248,7 @@ class TableStructureFactory foreach ($keyList as $keyName => $indexList) { $indexStructureList[] = new IndexStructure( $keyName, - '0' === $indexList[0]['Non_unique'], + '0' == $indexList[0]['Non_unique'], array_column($indexList, 'Column_name') ); }
fix Non_unique flag in primary key
howyi_conv
train
php
cc286fed7829c6ca18a4d4d2c056cf83d518dd9d
diff --git a/features/support/message_table_matcher.rb b/features/support/message_table_matcher.rb index <HASH>..<HASH> 100644 --- a/features/support/message_table_matcher.rb +++ b/features/support/message_table_matcher.rb @@ -13,7 +13,7 @@ RSpec::Matchers.define :match_message_table do |expected_tbl| match do |messages| @actual = messages_to_hash(messages) - @actual == expected_hash + expect(@actual).to match_array(expected_hash) end failure_message do |_|
change message table matcher so that it doesn't care about ordering
message-driver_message-driver
train
rb
5db00c3c2b226b390438193fc97a9ef8858dcb76
diff --git a/sess.go b/sess.go index <HASH>..<HASH> 100644 --- a/sess.go +++ b/sess.go @@ -4,7 +4,6 @@ import ( crand "crypto/rand" "encoding/binary" "errors" - "hash/crc32" "io" "log" "math/rand" @@ -13,6 +12,8 @@ import ( "sync/atomic" "time" + "github.com/klauspost/crc32" + "golang.org/x/net/ipv4" )
use crc<I> optimized by Klaus Post
xtaci_kcp-go
train
go
5aab054c26937e49f29d4e75be27b136e2f44159
diff --git a/js/core/History.js b/js/core/History.js index <HASH>..<HASH> 100755 --- a/js/core/History.js +++ b/js/core/History.js @@ -39,7 +39,7 @@ define(["js/core/Bindable", "flow"], function (Bindable, flow) { var fragment; if (this.runsInBrowser()) { - fragment = decodeURIComponent(window.location.hash); + fragment = decodeURI(window.location.hash); } else { fragment = this.$history[this.$history.length - 1] || ""; } @@ -167,7 +167,7 @@ define(["js/core/Bindable", "flow"], function (Bindable, flow) { this.trigger(History.EVENTS.NAVIGATION_START, eventData); this.$processUrl = false; - var isSameFragment = window.location.hash === "#/" + encodeURI(fragment); + var isSameFragment = decodeURI(window.location.hash) === "#/" + fragment; if (isSameFragment) { this.$processUrl = true;
another try to fix uri handling :)
rappid_rAppid.js
train
js
f10562fec02ed4384aad04b3b73c0081ce1e5647
diff --git a/lib/swag_dev/project/tools/git/status/buffer.rb b/lib/swag_dev/project/tools/git/status/buffer.rb index <HASH>..<HASH> 100644 --- a/lib/swag_dev/project/tools/git/status/buffer.rb +++ b/lib/swag_dev/project/tools/git/status/buffer.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require_relative '../status' +require_relative 'file' require 'pathname' # Buffer @@ -67,13 +68,12 @@ class SwagDev::Project::Tools::Git::Status::Buffer # # @see https://git-scm.com/docs/git-status def add_filepath(result, filepath, flag) - file = Struct.new(:path, :base, :flag) - base = ::Pathname.new(Dir.pwd) + file_class = SwagDev::Project::Tools::Git::Status::File matchers.each do |type, reg| next unless reg =~ flag - return result[type] << file.new(filepath.to_s, base, flag.to_s).freeze + return result[type] << file_class.new(filepath, flag, Dir.pwd).freeze end end end
git/status/buffer (tools) file used
SwagDevOps_kamaze-project
train
rb
2deb0fc402c57661677050efa27818236512d055
diff --git a/mapping/sql/core/src/main/java/it/unibz/inf/ontop/spec/mapping/pp/impl/PreMetaMappingExpander.java b/mapping/sql/core/src/main/java/it/unibz/inf/ontop/spec/mapping/pp/impl/PreMetaMappingExpander.java index <HASH>..<HASH> 100644 --- a/mapping/sql/core/src/main/java/it/unibz/inf/ontop/spec/mapping/pp/impl/PreMetaMappingExpander.java +++ b/mapping/sql/core/src/main/java/it/unibz/inf/ontop/spec/mapping/pp/impl/PreMetaMappingExpander.java @@ -195,7 +195,7 @@ public class PreMetaMappingExpander { .map(Variable::getName) .collect(Collectors.joining(", ", "The placeholder(s) ", - " in the target do(es) not occur in the body of the mapping: " + m.source.getSQL()))); + " in the target do(es) not occur in source query of the mapping assertion: " + m.source.getSQL()))); } String query = getTemplateValuesQuery(m.source.getSQL(), templateColumns);
pre-expansion re-enabled: message fix
ontop_ontop
train
java
2b83decc89a1311404722bfb53c4596cb9a7fd58
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java b/smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java index <HASH>..<HASH> 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java @@ -250,7 +250,7 @@ public abstract class SASLMechanism implements Comparable<SASLMechanism> { * @throws InterruptedException */ public final void challengeReceived(String challengeString, boolean finalChallenge) throws SmackException, NotConnectedException, InterruptedException { - byte[] challenge = Base64.decode(challengeString); + byte[] challenge = Base64.decode((challengeString != null && challengeString.equals("=")) ? "" : challengeString); byte[] response = evaluateChallenge(challenge); if (finalChallenge) { return;
Handle success SASL messages containing equals sign More strict conformance to RFC <I> § <I>, correctly handle success SASL message which consists of a single equals sign. Fixes SMACK-<I>.
igniterealtime_Smack
train
java