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
18bb16674e3b7632fde9901fd23f951901e85f03
diff --git a/src/Controller/UserRegistrationController.php b/src/Controller/UserRegistrationController.php index <HASH>..<HASH> 100644 --- a/src/Controller/UserRegistrationController.php +++ b/src/Controller/UserRegistrationController.php @@ -119,7 +119,7 @@ class UserRegistrationController extends AbstractActionController /** * Gets userMapper */ - public function getUserMapper() + protected function getUserMapper() { if (!$this->userMapper) { $this->userMapper = $this->getServiceLocator()->get('zfcuser_user_mapper');
getUserMapper method should be private
hrevert_HtUserRegistration
train
php
d791177659fd79f975eab5c0ba2929eef1c130b8
diff --git a/Kwc/Shop/Products/Directory/Controller.php b/Kwc/Shop/Products/Directory/Controller.php index <HASH>..<HASH> 100644 --- a/Kwc/Shop/Products/Directory/Controller.php +++ b/Kwc/Shop/Products/Directory/Controller.php @@ -5,10 +5,6 @@ class Kwc_Shop_Products_Directory_Controller extends Kwc_Directories_Item_Direct protected $_buttons = array('add', 'delete', 'save'); protected $_position = 'pos'; - protected $_editDialog = array( - 'width' => 620, - 'height' => 500 - ); protected function _initColumns() {
shop-controller does not have editDialog, removed because it caused error with tabPanel
koala-framework_koala-framework
train
php
609a232216cf6114246d749124414b2eafaebd72
diff --git a/lib/config.js b/lib/config.js index <HASH>..<HASH> 100644 --- a/lib/config.js +++ b/lib/config.js @@ -4,6 +4,13 @@ var fs = require('fs'); var extend = require('extend'); var path = require('path'); +// Create the cfg dir if it does not exist +/* istanbul ignore next: Simple directory creation, we know it will work. */ +var cfgDirPath = path.resolve(__dirname, '../cfg'); +if (!fs.existsSync(cfgDirPath)) { + fs.mkdirSync(cfgDirPath); +} + var defaultConfig = { host: 'localhost', port: 9090, @@ -63,14 +70,6 @@ var config = null; var filteredConfig = null; var defaultConfigCopy = extend(true, {}, defaultConfig); -// Create the cfg dir if it does not exist -if (!process.env.browser) { - var cfgDirPath = path.resolve(__dirname, '..', 'cfg'); - if (!fs.existsSync(cfgDirPath)) { - fs.mkdirSync(cfgDirPath); - } -} - // Load user config if it exists, and merge it if (fs.existsSync('cfg/nodecg.json')) { var rawUserConfigFile = fs.readFileSync('cfg/nodecg.json', 'utf8');
[config] Remove browserify check. We have a separate lib for the broweserified config now.
nodecg_nodecg
train
js
2a21bf8474789a288bb70f2a4369f2425e595f83
diff --git a/etrago/cluster/gasclustering.py b/etrago/cluster/gasclustering.py index <HASH>..<HASH> 100755 --- a/etrago/cluster/gasclustering.py +++ b/etrago/cluster/gasclustering.py @@ -77,6 +77,8 @@ def create_gas_busmap(etrago): Integer weighting for each ch4_buses.index """ + MAX_WEIGHT = 1e5 # relevant only for foreign nodes with extra high CH4 generation capacity + to_neglect = [ "CH4", "H2_to_CH4", @@ -115,11 +117,9 @@ def create_gas_busmap(etrago): rel_links[i] += ( etrago.network.loads_t.p_set.loc[:, loads_.loc[i]].mean().sum() ) - rel_links[i] = int(rel_links[i]) + rel_links[i] = min(int(rel_links[i]), MAX_WEIGHT) weightings = pd.DataFrame.from_dict(rel_links, orient="index") - # RUSSIA CH4 GENERATION IS SET TO 1E9, why? THIS CRASHES THE LOGIC - weightings.loc["6116"] = 100000 if save: weightings.to_csv(save)
capped maximum bus weight to 1E5 in order to handle extra high/inf ch4 generator capacities from foreign nodes
openego_eTraGo
train
py
4e704ab26f4ed326dd4ca1c04e1355b619109d09
diff --git a/tests/test_wfgenerator.py b/tests/test_wfgenerator.py index <HASH>..<HASH> 100644 --- a/tests/test_wfgenerator.py +++ b/tests/test_wfgenerator.py @@ -9,4 +9,4 @@ class TestWFGenerator(object): return WorkflowGenerator() def test_steps_in_library(self, wf): - assert len(wf.steps_library) > 0 + assert len(wf.steps_library.steps) > 0
Fix reference to new StepsLibrary object
nlppln_nlppln
train
py
ed2d102c6fe438d15a8a3c0b270efbe5c431c101
diff --git a/filesystems/tests/test_path.py b/filesystems/tests/test_path.py index <HASH>..<HASH> 100644 --- a/filesystems/tests/test_path.py +++ b/filesystems/tests/test_path.py @@ -90,10 +90,13 @@ class TestPath(TestCase): self.assertEqual(Path().basename(), "") def test_dirname(self): - self.assertEqual(Path("a", "b", "c").dirname(), "/a/b") + self.assertEqual( + Path("a", "b", "c").dirname(), + os.path.join(os.sep, "a", "b"), + ) def test_root_dirname(self): - self.assertEqual(Path().dirname(), "/") + self.assertEqual(Path().dirname(), os.sep) class TestRelativePath(TestCase): @@ -104,4 +107,6 @@ class TestRelativePath(TestCase): ) def test_str(self): - self.assertEqual(str(RelativePath("a", "b", "c")), "a/b/c") + self.assertEqual( + str(RelativePath("a", "b", "c")), os.path.join("a", "b", "c"), + )
Start to fix a few tests for Windows.
Julian_Filesystems
train
py
892302e4dfc65fcb8ab6ccdb1a81817fe6627f63
diff --git a/lib/generators/rails/templates/controller.rb b/lib/generators/rails/templates/controller.rb index <HASH>..<HASH> 100644 --- a/lib/generators/rails/templates/controller.rb +++ b/lib/generators/rails/templates/controller.rb @@ -2,6 +2,8 @@ class <%= controller_class_name %>Controller < ApplicationController <%= controller_before_filter %> :set_<%= file_name %>, only: [:show, :edit, :update, :destroy] + respond_to :html + <% unless options[:singleton] -%> def index @<%= table_name %> = <%= orm_class.all(class_name) %>
Add a default `respond_to` for generated scaffolded controllers so they will work out of the box. This way users using `responders` will get a functional scaffold when using the Rails generator, without having to define the format by themselves. Based on plataformatec/devise#<I>.
plataformatec_responders
train
rb
1b4cb678ca944d81da6cd8d31ec94926873cff1a
diff --git a/src/main/java/com/codeborne/selenide/WebDriverRunner.java b/src/main/java/com/codeborne/selenide/WebDriverRunner.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/codeborne/selenide/WebDriverRunner.java +++ b/src/main/java/com/codeborne/selenide/WebDriverRunner.java @@ -98,6 +98,10 @@ public class WebDriverRunner { return webdriver != null && webdriver instanceof InternetExplorerDriver; } + public static boolean htmlUnit() { + return webdriver != null && webdriver instanceof HtmlUnitDriver; + } + public static void clearBrowserCache() { if (webdriver != null) { webdriver.manage().deleteAllCookies();
Added method htmlUnit()
selenide_selenide
train
java
b6bd377a3c004969a994c47ac02aec0011b0c97c
diff --git a/webpack.config.js b/webpack.config.js index <HASH>..<HASH> 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -3,15 +3,21 @@ require('babel-loader'); require('json-loader'); module.exports = { - entry: { - keo: ['./src/keo.js'] - }, + entry: './src/keo.js', output: { path: __dirname + '/dist', - filename: '[name].js', + filename: 'keo.js', library: 'keo', libraryTarget: 'commonjs2' }, + externals: { + 'axios': true, + 'react-dom': true, + 'ramda': true, + 'react': true, + 'redux': true, + 'react-redux': true + }, module: { loaders: [ {
Added externals. Relates to #<I>
Wildhoney_Keo
train
js
e13f7817818aabbf7bd241ff956d8f1f5eefcca3
diff --git a/core/src/main/java/org/testcontainers/utility/ResourceReaper.java b/core/src/main/java/org/testcontainers/utility/ResourceReaper.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/testcontainers/utility/ResourceReaper.java +++ b/core/src/main/java/org/testcontainers/utility/ResourceReaper.java @@ -74,10 +74,7 @@ public final class ResourceReaper { binds.add(new Bind("//var/run/docker.sock", new Volume("/var/run/docker.sock"))); String ryukContainerId = client.createContainerCmd(ryukImage) - .withHostConfig(new HostConfig() { - @JsonProperty("AutoRemove") - boolean autoRemove = true; - }) + .withHostConfig(new HostConfig().withAutoRemove(true)) .withExposedPorts(new ExposedPort(8080)) .withPublishAllPorts(true) .withName("testcontainers-ryuk-" + DockerClientFactory.SESSION_ID)
Fix AutoRemove of Ryuk container (#<I>)
testcontainers_testcontainers-java
train
java
c6c82cb872d8025bccae25c8ded259eccbce3824
diff --git a/lib/sensu/api.rb b/lib/sensu/api.rb index <HASH>..<HASH> 100644 --- a/lib/sensu/api.rb +++ b/lib/sensu/api.rb @@ -302,9 +302,11 @@ module Sensu :occurrences => 1 }.to_json).callback do $redis.set('stash:test/test', '{"key": "value"}').callback do - Thin::Logging.silent = true - Thin::Server.start(self, $settings.api.port) - block.call + $redis.sadd('stashes', 'test/test').callback do + Thin::Logging.silent = true + Thin::Server.start(self, $settings.api.port) + block.call + end end end end
[testing] fix test scaffolding
sensu_sensu
train
rb
12762d81eee45c074cd679a1a6cdf472c00d44db
diff --git a/src/password/actions.js b/src/password/actions.js index <HASH>..<HASH> 100644 --- a/src/password/actions.js +++ b/src/password/actions.js @@ -228,7 +228,6 @@ function autoSignInError(id, error) { // TODO: proper error message // const errorMessage = l.ui.t(lock, ["error", "signIn", error.error], {cred: cred, __textOnly: true}) || l.ui.t(lock, ["error", "signIn", "lock.request"], {cred: cred, __textOnly: true}); const errorMessage = "An error ocurred when logging in"; - console.log("ufff"); swap(updateEntity, "lock", id, m => { m = l.setSubmitting(m, false, errorMessage); m = m.set("signedIn", false); diff --git a/src/password/index.js b/src/password/index.js index <HASH>..<HASH> 100644 --- a/src/password/index.js +++ b/src/password/index.js @@ -9,7 +9,6 @@ export function initPassword(model, options) { } function processPasswordOptions(options) { - console.log("options", options); let { activities, connection, loginAfterSignUp, usernameStyle } = options; if (!connection || typeof connection !== "string") {
Remove no longer needed console.log debug calls
auth0_lock
train
js,js
fb0c24527a1f69ffca2b44bdd259489f3c540f79
diff --git a/examples/blesh/main.go b/examples/blesh/main.go index <HASH>..<HASH> 100644 --- a/examples/blesh/main.go +++ b/examples/blesh/main.go @@ -357,6 +357,9 @@ func cmdSub(c *cli.Context) error { if err := doConnect(c); err != nil { return err } + if err := doDiscover(c); err != nil { + return err + } // NotificationHandler h := func(req []byte) { fmt.Printf("notified: %x | %q\n", req, req) } if u := curr.profile.Find(ble.NewCharacteristic(curr.uuid)); u != nil {
blesh: discover profile before sub fix #<I>
currantlabs_ble
train
go
52b33589dc9d73554ec323d85b531b2991247ab8
diff --git a/lib/cancan/controller_additions.rb b/lib/cancan/controller_additions.rb index <HASH>..<HASH> 100644 --- a/lib/cancan/controller_additions.rb +++ b/lib/cancan/controller_additions.rb @@ -294,7 +294,7 @@ module CanCan # # class ApplicationController < ActionController::Base # rescue_from CanCan::AccessDenied do |exception| - # flash[:error] = exception.message + # flash[:alert] = exception.message # redirect_to root_url # end # end
changing flash[:error] to flash[:alert] in rdocs - closes #<I>
ryanb_cancan
train
rb
7086a71b8464cc5b6783b19c93f876d323c7e9af
diff --git a/playhouse/sqlite_ext.py b/playhouse/sqlite_ext.py index <HASH>..<HASH> 100644 --- a/playhouse/sqlite_ext.py +++ b/playhouse/sqlite_ext.py @@ -554,6 +554,13 @@ def ClosureTable(model_class, foreign_key=None): return type(name, (BaseClosureTable,), {'Meta': Meta}) [email protected](clone=False) +def disqualify(self): + # In the where clause, prevent the given node/expression from constraining + # an index. + return Clause('+', self, glue='') + + class SqliteExtDatabase(SqliteDatabase): """ Database class which provides additional Sqlite-specific functionality:
Disqualify index operator for sqlite.
coleifer_peewee
train
py
bd3aeb20a1640849578b6526d1c9736de2b52fdc
diff --git a/airflow/www/security.py b/airflow/www/security.py index <HASH>..<HASH> 100644 --- a/airflow/www/security.py +++ b/airflow/www/security.py @@ -21,7 +21,7 @@ from flask import g from flask_appbuilder.security.sqla import models as sqla_models from flask_appbuilder.security.sqla.manager import SecurityManager -from sqlalchemy import or_, and_ +from sqlalchemy import and_, or_ from airflow import models from airflow.exceptions import AirflowException
[AIRFLOW-<I>] Fix isort problem (#<I>)
apache_airflow
train
py
8de67932cf7420b42c4ca5e20cb3301ff90e8046
diff --git a/moment.js b/moment.js index <HASH>..<HASH> 100644 --- a/moment.js +++ b/moment.js @@ -1409,7 +1409,9 @@ }; for (i in lists) { - makeList(lists[i]); + if (lists.hasOwnProperty(i)) { + makeList(lists[i]); + } } // for use by developers when extending the library
added hasOwnProperty check to lists enumeration
moment_moment
train
js
7c99635e4909b6904e89020b02a9193d5b7ea0d9
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java index <HASH>..<HASH> 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java @@ -117,7 +117,7 @@ public final class ElementHelper { if (!(propertyKeyValues[i] instanceof String) && !(propertyKeyValues[i] instanceof T)) throw Element.Exceptions.providedKeyValuesMustHaveALegalKeyOnEvenIndices(); - if (propertyKeyValues[i + 1] == null) { + if (null == propertyKeyValues[i + 1]) { throw Property.Exceptions.propertyValueCanNotBeNull(); } }
Reversed logic of if to place null first CTR
apache_tinkerpop
train
java
eb2345d456eabc0ebada3a2e9bc007d00169b53e
diff --git a/spec/helper.rb b/spec/helper.rb index <HASH>..<HASH> 100644 --- a/spec/helper.rb +++ b/spec/helper.rb @@ -25,10 +25,6 @@ class TimeWithZone end end -def nsjsonserialization_on_other_than_macruby(engine) - engine == 'nsjsonserialization' && !macruby? -end - def jruby? defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby' end diff --git a/spec/multi_json_spec.rb b/spec/multi_json_spec.rb index <HASH>..<HASH> 100644 --- a/spec/multi_json_spec.rb +++ b/spec/multi_json_spec.rb @@ -61,10 +61,8 @@ describe "MultiJson" do end %w(json_gem json_pure nsjsonserialization oj ok_json yajl).each do |engine| - if nsjsonserialization_on_other_than_macruby(engine) - puts "NSJSONSerialization is exclusively available for MacRuby only." - next - end + next if !macruby? && engine == 'nsjsonserialization' + next if jruby? && engine == 'oj' context engine do before do
Don't test Oj on JRuby
intridea_multi_json
train
rb,rb
49eec6f1d3e3dd83956fbf6f8029bc277c2795dd
diff --git a/Kwf_js/Menu/Index.js b/Kwf_js/Menu/Index.js index <HASH>..<HASH> 100644 --- a/Kwf_js/Menu/Index.js +++ b/Kwf_js/Menu/Index.js @@ -191,7 +191,7 @@ Kwf.Menu.Index = Ext2.extend(Ext2.Toolbar, if (result.fullname && result.userSelfControllerUrl) { this.userToolbar.add({ id: 'currentUser', - text: result.fullname, + text: Ext2.util.Format.htmlEncode(result.fullname), cls: 'x2-btn-text-icon', icon: '/assets/silkicons/user.png', disabled: !result.userId,
escape username in backend to prevent xss vulnerability
koala-framework_koala-framework
train
js
4c67e5729bff2cec59856eba5073a1c171b60cbf
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -46,7 +46,9 @@ function Shrinkwrap(options) { ? options.mirrors : false; - this.registry = new Registry({ + this.registry = options.registry instanceof Registry + ? options.registry + : new Registry({ registry: options.registry || Registry.mirrors.nodejitsu, githulk: options.githulk, mirrors: options.mirrors
[fix] Allow pre-configured npmjs instances to be passed.
3rd-Eden_shrinkwrap
train
js
f96885d37549408a032f535e57edc1201ebc0be2
diff --git a/bambi/tests/test_model.py b/bambi/tests/test_model.py index <HASH>..<HASH> 100644 --- a/bambi/tests/test_model.py +++ b/bambi/tests/test_model.py @@ -1,4 +1,4 @@ -import pytest +import pytest, re from bambi.models import Term, Model from bambi.priors import Prior from os.path import dirname, join @@ -383,7 +383,10 @@ def test_cell_means_with_random_intercepts(crossed_data): assert set(priors0) == set(priors1) # test summary - full = set(fitted.summary(exclude_ranefs=False, hide_transformed=False).index) + # it looks like some versions of pymc3 add a trailing '_' to transformed vars and + # some dont. so here for consistency we strip out any trailing '_' that we find + full = fitted.summary(exclude_ranefs=False, hide_transformed=False).index + full = set([re.sub(r'_$', r'', x) for x in full]) test_set = set(fitted.summary(exclude_ranefs=False).index) assert test_set == full.difference(set(['Y_sd_interval','u_subj_sd_log'])) test_set = set(fitted.summary(hide_transformed=False).index)
Fixed the test of _filter_names It looks like some versions of pymc3 add a trailing '_' to transformed vars and some don't. Mine doesn't but it seems that the travis version does. So for consistency across pymc3 versions, the test strips off any trailing '_' found in the var names. Note that this is purely a test issue and actual user functionality should be fine either way.
bambinos_bambi
train
py
e60bc2e68d9f18aab6214840c41a506723bc17b9
diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLAbstract.java b/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLAbstract.java index <HASH>..<HASH> 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLAbstract.java +++ b/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLAbstract.java @@ -155,7 +155,7 @@ public abstract class OCommandExecutorSQLAbstract extends OCommandExecutorAbstra for (String clazz : iClassNames) { final OClass cls = ((OMetadataInternal) db.getMetadata()).getImmutableSchemaSnapshot().getClass(clazz); if (cls != null) - for (int clId : cls.getClusterIds()) { + for (int clId : cls.getPolymorphicClusterIds()) { // FILTER THE CLUSTER WHERE THE USER HAS THE RIGHT ACCESS if (clId > -1 && checkClusterAccess(db, db.getClusterNameById(clId))) clusters.add(db.getClusterNameById(clId).toLowerCase());
Fixed issue #<I> about polymorphic cluster selection on distributed execution
orientechnologies_orientdb
train
java
75d80a2b14ffd6f61eb02f924bf8c484b08b5f87
diff --git a/lib/cm_client.js b/lib/cm_client.js index <HASH>..<HASH> 100644 --- a/lib/cm_client.js +++ b/lib/cm_client.js @@ -1,6 +1,6 @@ var Steam = require('../index.js'); var ByteBuffer = require('bytebuffer'); -var SteamCrypto = require('steam-crypto'); +var SteamCrypto = require('@doctormckay/steam-crypto'); var BufferCRC32 = require('buffer-crc32'); var Zip = require('adm-zip'); diff --git a/lib/tcp_connection.js b/lib/tcp_connection.js index <HASH>..<HASH> 100644 --- a/lib/tcp_connection.js +++ b/lib/tcp_connection.js @@ -1,4 +1,4 @@ -var SteamCrypto = require('steam-crypto'); +var SteamCrypto = require('@doctormckay/steam-crypto'); var Socket = require('net').Socket; module.exports = TCPConnection; diff --git a/lib/udp_connection.js b/lib/udp_connection.js index <HASH>..<HASH> 100644 --- a/lib/udp_connection.js +++ b/lib/udp_connection.js @@ -1,4 +1,4 @@ -var SteamCrypto = require('steam-crypto'); +var SteamCrypto = require('@doctormckay/steam-crypto'); var ByteBuffer = require('bytebuffer'); var Dgram = require('dgram');
Fixed broken references to steam-crypto
DoctorMcKay_node-steam-client
train
js,js,js
b296b3cf8b37c046f7bb708de03232c0ada96017
diff --git a/pkg/dns/etcd_dns.go b/pkg/dns/etcd_dns.go index <HASH>..<HASH> 100644 --- a/pkg/dns/etcd_dns.go +++ b/pkg/dns/etcd_dns.go @@ -101,6 +101,15 @@ func (c *coreDNS) list(key string) ([]SrvRecord, error) { } srvRecord.Key = strings.TrimPrefix(string(n.Key), key) srvRecord.Key = strings.TrimSuffix(srvRecord.Key, srvRecord.Host) + + // Skip non-bucket entry like for a key + // /skydns/net/miniocloud/10.0.0.1 that may exist as + // dns entry for the server (rather than the bucket + // itself). + if srvRecord.Key == "" { + continue + } + // SRV records are stored in the following form // /skydns/net/miniocloud/bucket1, so this function serves multiple // purposes basically when we do a Get(bucketName) this function
Skip non-bucket dns entry in federated bucket list (#<I>)
minio_minio
train
go
df28f53073deaf592eb98fad50bf841183539bf8
diff --git a/src/Money.php b/src/Money.php index <HASH>..<HASH> 100644 --- a/src/Money.php +++ b/src/Money.php @@ -354,6 +354,8 @@ final class Money implements JsonSerializable /** * @throws InvalidArgumentException if the given $money is zero. + * + * @psalm-return numeric-string */ public function ratioOf(Money $money): string {
Missing numeric-string type in ratioOf
moneyphp_money
train
php
c7d8fce6a6dfbd3d59abe0eef671cee67f5c7ffa
diff --git a/src/android/com/adobe/phonegap/push/PushPlugin.java b/src/android/com/adobe/phonegap/push/PushPlugin.java index <HASH>..<HASH> 100644 --- a/src/android/com/adobe/phonegap/push/PushPlugin.java +++ b/src/android/com/adobe/phonegap/push/PushPlugin.java @@ -138,6 +138,7 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { NotificationChannel mChannel = new NotificationChannel(DEFAULT_CHANNEL_ID, "PhoneGap PushPlugin", NotificationManager.IMPORTANCE_DEFAULT); mChannel.enableVibration(options.optBoolean(VIBRATE, true)); + mChannel.setShowBadge(true); notificationManager.createNotificationChannel(mChannel); } }
✨🐧 Issue #<I>: Implement Android Oreo Notification badges
phonegap_phonegap-plugin-push
train
java
78a263a587218be7840a028d469aaf010a37bde1
diff --git a/spec/unit/transformer_spec.rb b/spec/unit/transformer_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/transformer_spec.rb +++ b/spec/unit/transformer_spec.rb @@ -29,6 +29,11 @@ describe Transproc::Transformer do it { expect(klass.container).to eq(container) } it { is_expected.to be_a(::Class) } + it { expect(klass.ancestors).to include(Transproc::Transformer) } + + it 'does not change super class' do + expect(Transproc::Transformer.container).not_to eq(container) + end end describe '.t' do
Add more tests to Transformer.[]
solnic_transproc
train
rb
49db7fa0fbbc4163c85c2ba9fc623572a30506b8
diff --git a/test/test-79-npm/nightmare/nightmare.meta.js b/test/test-79-npm/nightmare/nightmare.meta.js index <HASH>..<HASH> 100644 --- a/test/test-79-npm/nightmare/nightmare.meta.js +++ b/test/test-79-npm/nightmare/nightmare.meta.js @@ -1,10 +1,10 @@ 'use strict'; module.exports = function (stamp, flags) { - if (stamp.p === 'win32' && flags.ci) { + if (flags.ci) { return { allow: false, - note: 'windows CI seems to hang' + note: 'headless CI seems to fail headful electron' }; }
revoke nightmare from all ci platforms
zeit_pkg
train
js
ee21ee86871ad1fb9ee0c0b1d86dbebd754290d2
diff --git a/tasks/engines/fontforge.js b/tasks/engines/fontforge.js index <HASH>..<HASH> 100644 --- a/tasks/engines/fontforge.js +++ b/tasks/engines/fontforge.js @@ -55,9 +55,6 @@ module.exports = function(o, allDone) { else { logger.verbose(chalk.grey('fontforge: ') + line); } - if (line.match(version) && success) { - o.fontforgeVersion.push(line); - } }); if (warn.length) {
Do not store fontforge version in options object.
sapegin_grunt-webfont
train
js
ff18f9d435ab462c85a8a0742d09ba5b8fd95cb5
diff --git a/rah_cache.php b/rah_cache.php index <HASH>..<HASH> 100644 --- a/rah_cache.php +++ b/rah_cache.php @@ -112,11 +112,11 @@ class rah_cache { */ public function update_lastmod() { - global $prefs, $rah_cache; + global $rah_cache; if(!empty($rah_cache['path'])) { file_put_contents( - $rah_cache['path'] . '/_lastmod.rah', @strtotime($prefs['lastmod']) + $rah_cache['path'] . '/_lastmod.rah', get_pref('lastmod', time(), true) ); } }
Textpattern doesn't update the lastmod value in memory. Need to get the up to date value from the database then.
gocom_rah_cache
train
php
a1350571e79aeb64b45f70d16491c29043166c22
diff --git a/routes/http.go b/routes/http.go index <HASH>..<HASH> 100644 --- a/routes/http.go +++ b/routes/http.go @@ -24,6 +24,8 @@ var routes = []route{ {"/", controllers.MainHandler}, {"/openidcallback", login.LoginCallbackHandler}, {"/startLogin", login.LoginHandler}, + {"/startTwitchLogin", login.TwitchLogin}, + {"/twitchAuth", login.TwitchAuth}, {"/logout", login.LogoutHandler}, {"/websocket/", controllers.SocketHandler},
Add routes for twitch authentication.
TF2Stadium_Helen
train
go
07e1c8d806c8f5702dc2fba3fd96d5b7d7e20c6e
diff --git a/openquake/risklib/riskinput.py b/openquake/risklib/riskinput.py index <HASH>..<HASH> 100644 --- a/openquake/risklib/riskinput.py +++ b/openquake/risklib/riskinput.py @@ -173,7 +173,8 @@ class EpsilonGetter(object): If the ``asset_correlation`` is 1 the numbers are the same for all assets of the same taxonomy. - >>> epsgetter = EpsilonGetter(42, 1, 5) + >>> epsgetter = EpsilonGetter( + ... master_seed=42, asset_correlation=1, tot_events=5) >>> assets = numpy.array([(0, 1), (1, 1), (2, 2)], ... [('ordinal', int), ('taxonomy', int)]) >>> epsgetter.get(assets)
Improved doctest [ci skip]
gem_oq-engine
train
py
0922eb024b5a4dacf62a71d1766753e717b77287
diff --git a/prow/gerrit/gerrit.go b/prow/gerrit/gerrit.go index <HASH>..<HASH> 100644 --- a/prow/gerrit/gerrit.go +++ b/prow/gerrit/gerrit.go @@ -212,6 +212,8 @@ func (c *Controller) queryProjectChanges(proj string) ([]gerrit.ChangeInfo, erro continue } + logrus.Infof("Change %s, last updated %s", change.Number, change.Updated) + // process if updated later than last updated // stop if update was stale if updated.After(c.lastUpdate) {
add some more log entries for gerrit
kubernetes_test-infra
train
go
087dca5aca0ec032663328b0055b800485db38fd
diff --git a/test/basic.js b/test/basic.js index <HASH>..<HASH> 100644 --- a/test/basic.js +++ b/test/basic.js @@ -185,11 +185,13 @@ tape("addon - sample query with an episode", function(t) { t.ok(resp && !isNaN(resp.availability), "has availability"); //t.ok(resp && !isNaN(resp.uploaders), "has uploaders"); + /* var file = resp && resp.map[resp.mapIdx]; t.ok(file, "has selected file"); t.ok(file && file.season && file.episode, "selected file has season/episode"); t.ok(file && file.season==season && file.episode.indexOf(episode)!=-1, "selected file matches query"); - + */ + t.end(); }); });
we don't return map now, so fix test
jaruba_multipass-torrent
train
js
0feb8ea520031e73b38fefb921dea1d715ace38e
diff --git a/plugins/org.eclipse.xtext/src/org/eclipse/xtext/serializer/sequencer/HiddenTokenSequencer.java b/plugins/org.eclipse.xtext/src/org/eclipse/xtext/serializer/sequencer/HiddenTokenSequencer.java index <HASH>..<HASH> 100644 --- a/plugins/org.eclipse.xtext/src/org/eclipse/xtext/serializer/sequencer/HiddenTokenSequencer.java +++ b/plugins/org.eclipse.xtext/src/org/eclipse/xtext/serializer/sequencer/HiddenTokenSequencer.java @@ -242,6 +242,8 @@ public class HiddenTokenSequencer implements IHiddenTokenSequencer, ISyntacticSe } else if (belongsToDeletedElement(next)) { handleDeletedElement(out, deletedSemanticElements, next); ni.prune(); + } else if (tokenUtil.isToken(next)) { + break; } } }
fixed a regression introduced by the fix for [<I>]
eclipse_xtext-core
train
java
cc7d205b25298348ba4b79e9d3bfe18a391ed79d
diff --git a/src/resources/messaging.js b/src/resources/messaging.js index <HASH>..<HASH> 100644 --- a/src/resources/messaging.js +++ b/src/resources/messaging.js @@ -122,7 +122,6 @@ class Messaging extends ResourceBase { this.convs = {} this.ecies = ecies this.events = new EventEmitter() - this.unreadStatus = UNREAD_STATUS } onAccount(account_key) { @@ -776,6 +775,24 @@ class Messaging extends ResourceBase { return room_id } + // messages supplied by the 'msg' event have status included + // this is a convenience method for tracking status on spoofed messages + getStatus({ created, hash }) { + const messageStatuses = JSON.parse( + localStorage.getItem(`${storeKeys.messageStatuses}:${this.account_key}`) + ) + // convert stored timestamp string to date + const subscriptionStart = new Date( + +localStorage.getItem(`${storeKeys.messageSubscriptionStart}:${this.account_key}`) + ) + const isWatched = created > subscriptionStart + const status = + isWatched && messageStatuses && messageStatuses[hash] === READ_STATUS + ? READ_STATUS + : UNREAD_STATUS + return status + } + // we allow the entire message to be passed in (for consistency with other resources + convenience) // however all we are updating is the status set({ hash, status }) {
Convenience method for read status (#<I>)
OriginProtocol_origin-js
train
js
c572d63bba9b1cc5b220fadad398c92dc972b81f
diff --git a/systems/builder-plugin.js b/systems/builder-plugin.js index <HASH>..<HASH> 100644 --- a/systems/builder-plugin.js +++ b/systems/builder-plugin.js @@ -128,7 +128,7 @@ function builderPlugin(system) { const buildTask = this.state[buildSym][task.index]; if (buildTask.touched === false) { - debugBuild(`starting new build task: `, buildTask); + debugBuild(`starting new build task: %o`, buildTask); } buildTask.touched = true;
quiet down builder debug a little by pushing new tasks to only 1 io line
node-sc2_core
train
js
e6e7600583d03b3421df233a78797c90f54277a2
diff --git a/src/components/validationMixin.js b/src/components/validationMixin.js index <HASH>..<HASH> 100755 --- a/src/components/validationMixin.js +++ b/src/components/validationMixin.js @@ -116,9 +116,7 @@ export default function validationMixin(strategy) { clearValidations={this.clearValidations} handleValidation={this.handleValidation} {...this.props} - > - {this.props.children} - </WrappedComponent> + /> ); } }
Remove redundant forwarding of children property to wrapped component
jurassix_react-validation-mixin
train
js
581ff6749993c867d4e5279eb80eec5e719adfce
diff --git a/core/server/middleware/serve-favicon.js b/core/server/middleware/serve-favicon.js index <HASH>..<HASH> 100644 --- a/core/server/middleware/serve-favicon.js +++ b/core/server/middleware/serve-favicon.js @@ -45,7 +45,7 @@ function serveFavicon() { if (settingsCache.get('icon')) { // depends on the uploaded icon extension if (originalExtension !== requestedExtension) { - return res.redirect(302, '/favicon' + originalExtension); + return res.redirect(302, utils.url.urlFor({relativeUrl: '/favicon' + originalExtension})); } storage.getStorage() @@ -66,7 +66,7 @@ function serveFavicon() { // CASE: always redirect to .ico for default icon if (originalExtension !== requestedExtension) { - return res.redirect(302, '/favicon.ico'); + return res.redirect(302, utils.url.urlFor({relativeUrl: '/favicon.ico'})); } fs.readFile(filePath, function readFile(err, buf) {
🐛 correct favicon redirects with subdirectory (#<I>) refs #<I>, #<I> Use our url util `urlFor` to ensure, the redirect includes the subdirectory, if set up.
TryGhost_Ghost
train
js
0c7732e644c632f8ebce57529ff24b2ce7932620
diff --git a/benchmark.js b/benchmark.js index <HASH>..<HASH> 100644 --- a/benchmark.js +++ b/benchmark.js @@ -309,14 +309,24 @@ run(fileNames.map(function(fileName) { res.on('data', function(chunk) { response += chunk; }).on('end', function() { - // Extract result from <textarea/> - var start = response.indexOf('>', response.indexOf('<textarea')); - var end = response.lastIndexOf('</textarea>'); - var result = response.slice(start + 1, end).replace(/<\\\//g, '</'); var info = infos.willpeavy; - writeText(info.filePath, result, function() { - readSizes(info, done); - }); + if (res.statusCode === 200) { + // Extract result from <textarea/> + var start = response.indexOf('>', response.indexOf('<textarea')); + var end = response.lastIndexOf('</textarea>'); + var result = response.slice(start + 1, end).replace(/<\\\//g, '</'); + writeText(info.filePath, result, function() { + readSizes(info, done); + }); + } + // Site refused to process content + else { + info.size = 0; + info.gzSize = 0; + info.lzSize = 0; + info.brSize = 0; + done(); + } }); }).end(querystring.stringify({ html: data
handle errors from Will Peavy's HTML Minifier
kangax_html-minifier
train
js
f527099061ab18bdc01e22a6cc8270c4002de92d
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,6 @@ +# encoding: utf-8 + +import io import sys import os.path import setuptools @@ -6,10 +9,10 @@ import setuptools MISC_DIR = "misc" REQUIREMENT_DIR = "requirements" -with open("README.rst") as fp: - long_description = fp.read() +with io.open("README.rst", encoding="utf8") as f: + long_description = f.read() -with open(os.path.join(MISC_DIR, "summary.txt")) as f: +with io.open(os.path.join(MISC_DIR, "summary.txt"), encoding="utf8") as f: summary = f.read() with open(os.path.join(REQUIREMENT_DIR, "requirements.txt")) as f:
[ci skip] Update setup.py
thombashi_DataProperty
train
py
b56632318cc82a45b33d1329222a1dfc00ad2535
diff --git a/tests/test_middleware.py b/tests/test_middleware.py index <HASH>..<HASH> 100644 --- a/tests/test_middleware.py +++ b/tests/test_middleware.py @@ -87,19 +87,21 @@ class BarkMiddlewareTest(unittest2.TestCase): class BarkFilterTest(unittest2.TestCase): + @mock.patch.object(middleware.LOG, 'warn') @mock.patch('ConfigParser.SafeConfigParser') @mock.patch('bark.proxy.ProxyConfig') @mock.patch('bark.format.Format.parse') @mock.patch('bark.handlers.get_handler') @mock.patch.object(middleware, 'BarkMiddleware', return_result='mid') def test_noconf(self, mock_BarkMiddleware, mock_get_handler, mock_parse, - mock_ProxyConfig, mock_SafeConfigParser): + mock_ProxyConfig, mock_SafeConfigParser, mock_warn): filt = middleware.bark_filter({}) self.assertFalse(mock_SafeConfigParser.called) self.assertFalse(mock_ProxyConfig.called) self.assertFalse(mock_parse.called) self.assertFalse(mock_get_handler.called) + self.assertFalse(mock_warn.called) self.assertFalse(mock_BarkMiddleware.called) mid = filt('app')
Test that LOG.warn() isn't called in the no-config case.
klmitch_bark
train
py
ed0b0b2a5420c2da9e3d289fc751df6a7bc88c9f
diff --git a/src/main/java/com/j256/ormlite/table/TableInfo.java b/src/main/java/com/j256/ormlite/table/TableInfo.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/j256/ormlite/table/TableInfo.java +++ b/src/main/java/com/j256/ormlite/table/TableInfo.java @@ -136,11 +136,11 @@ public class TableInfo<T, ID> { // build our alias map if we need it Map<String, FieldType> map = new HashMap<String, FieldType>(); for (FieldType fieldType : fieldTypes) { - map.put(fieldType.getColumnName(), fieldType); + map.put(fieldType.getColumnName().toLowerCase(), fieldType); } fieldNameMap = map; } - FieldType fieldType = fieldNameMap.get(columnName); + FieldType fieldType = fieldNameMap.get(columnName.toLowerCase()); // if column name is found, return it if (fieldType != null) { return fieldType;
Turned this into case insenstive field match.
j256_ormlite-core
train
java
558d6fc8d9c37567e2fcc49b0e69b791ee6e3546
diff --git a/stellar/command.py b/stellar/command.py index <HASH>..<HASH> 100644 --- a/stellar/command.py +++ b/stellar/command.py @@ -4,6 +4,7 @@ import hashlib import uuid import os import sys +from time import sleep from sqlalchemy.exc import ProgrammingError @@ -130,10 +131,14 @@ class CommandApp(object): Snapshot.project_name == config['project_name'] ): if not snapshot.is_slave_ready: - print "Slave for %s is not ready" % ( - snapshot.table_name - ) - sys.exit(1) + sys.stdout.write('Waiting for background process to finish') + sys.stdout.flush() + while not snapshot.is_slave_ready: + sys.stdout.write('.') + sys.stdout.flush() + sleep(1) + stellar_db.session.refresh(snapshot) + print '' for snapshot in stellar_db.session.query(Snapshot).filter( Snapshot.name == name,
Wait if backgroud process is still working
fastmonkeys_stellar
train
py
8a8ebd46e0d4089a6d85589e8a5d056e821e22e0
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -28,6 +28,7 @@ gulp.task('lint', function () { * Task to run mocha tests */ gulp.task('mocha', function () { + require('./').settings.ENTITIESPATH = '../../../tests/unit/back/models/'; return gulp.src(paths.mochaSrc, {read: false}) .pipe(mocha({ reporter: 'spec' diff --git a/src/back/settings.js b/src/back/settings.js index <HASH>..<HASH> 100644 --- a/src/back/settings.js +++ b/src/back/settings.js @@ -13,5 +13,7 @@ module.exports = {}; * always that on of them is referenced in the code. * @type {string} * @constant + * @example + * settings.ENTITIESPATH = '../../../tests/unit/back/models/'; */ -module.exports.ENTITIESPATH = '../../../tests/unit/back/models/'; +module.exports.ENTITIESPATH = null;
improvements on ENTITIESPATH
back4app_back4app-entity
train
js,js
2a3276c61955c0d9748469d022f672df3365ae08
diff --git a/lib/fog/bin.rb b/lib/fog/bin.rb index <HASH>..<HASH> 100644 --- a/lib/fog/bin.rb +++ b/lib/fog/bin.rb @@ -3,7 +3,7 @@ require 'fog/core/credentials' module Fog class << self def available_providers - @available_providers ||= Fog.providers.values.select {|provider| Kernel.const_get(provider).available?}.sort + @available_providers ||= Fog.providers.values.select {|provider| Kernel.const_get(provider).try(:available?)}.sort end def registered_providers
make available check in bin resilient to nil
fog_fog
train
rb
47f8fefd1db1b7135c38248b16e895039769cd58
diff --git a/dropwizard-client/src/test/java/io/dropwizard/client/DropwizardApacheConnectorTest.java b/dropwizard-client/src/test/java/io/dropwizard/client/DropwizardApacheConnectorTest.java index <HASH>..<HASH> 100644 --- a/dropwizard-client/src/test/java/io/dropwizard/client/DropwizardApacheConnectorTest.java +++ b/dropwizard-client/src/test/java/io/dropwizard/client/DropwizardApacheConnectorTest.java @@ -28,7 +28,6 @@ import org.glassfish.jersey.client.JerseyClient; import org.junit.After; import org.junit.Before; import org.junit.ClassRule; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -50,7 +49,6 @@ import static org.hamcrest.CoreMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -@Ignore //These tests are consistently failing on travis CI because of network timeouts public class DropwizardApacheConnectorTest { private static final int SLEEP_TIME_IN_MILLIS = 1000;
Remove @Ignore from DropwizardApacheConnectorTest
dropwizard_dropwizard
train
java
fcf09aff290b9de18d4c3fedd3d125ee3d50d569
diff --git a/getmac/getmac.py b/getmac/getmac.py index <HASH>..<HASH> 100644 --- a/getmac/getmac.py +++ b/getmac/getmac.py @@ -8,7 +8,7 @@ try: except ImportError: DEVNULL = open(os.devnull, 'wb') # Py2 -__version__ = '0.2.2' +__version__ = '0.2.3' DEBUG = False PY2 = sys.version_info[0] == 2 @@ -187,6 +187,8 @@ def _find_mac(command, args, hw_identifiers, get_index): def _windows_get_remote_mac_ctypes(host): + if not PY2: # Convert to bytes on Python 3+ (Fixes #7) + host = host.encode() try: inetaddr = ctypes.windll.wsock32.inet_addr(host) if inetaddr in (0, -1):
Fix Windows remote host on Python 3 - In Python 3, the ctypes method for getting the MAC of a remote host would fail. This was caused by the host being implicitly encoded to bytes in Python 2, but not in 3. Fixes #7
GhostofGoes_getmac
train
py
49e6be59b4fb28d60930e43ae361a03cbed6a2bd
diff --git a/lib/drizzlepac/astrodrizzle.py b/lib/drizzlepac/astrodrizzle.py index <HASH>..<HASH> 100644 --- a/lib/drizzlepac/astrodrizzle.py +++ b/lib/drizzlepac/astrodrizzle.py @@ -250,8 +250,8 @@ def run(configobj, wcsmap=None): image.clean() image.close() - del imgObjList - del outwcs + del imgObjList + del outwcs def help(file=None):
Fixed a bug in astrodrizzle that affects clean up after a successful run. git-svn-id: <URL>
spacetelescope_drizzlepac
train
py
140c98558ce4d2c868ba8c90b58e4f820fc2a6da
diff --git a/lib/solargraph/api_map.rb b/lib/solargraph/api_map.rb index <HASH>..<HASH> 100755 --- a/lib/solargraph/api_map.rb +++ b/lib/solargraph/api_map.rb @@ -493,6 +493,11 @@ module Solargraph meths += yard_map.get_instance_methods('Module') end end + if namespace == '' and root == '' + config.domains.each do |d| + meths.concat get_instance_methods(d) + end + end strings = meths.map(&:to_s) live_map.get_methods(namespace, root, 'instance', visibility.include?(:private)).each do |m| next if strings.include?(m) or !m.match(/^[a-z]/i) diff --git a/lib/solargraph/code_map.rb b/lib/solargraph/code_map.rb index <HASH>..<HASH> 100755 --- a/lib/solargraph/code_map.rb +++ b/lib/solargraph/code_map.rb @@ -233,8 +233,8 @@ module Solargraph end result += api_map.get_constants('') result += api_map.get_instance_methods('Kernel') - result += api_map.get_methods('') - result += api_map.get_instance_methods('') + result += api_map.get_methods('', namespace) + result += api_map.get_instance_methods('', namespace) else result.concat api_map.get_instance_methods(type) end
Infer return types from domain (DSL) methods.
castwide_solargraph
train
rb,rb
23b866d2f9c6467e84bcc5d4baed979b62413278
diff --git a/examples/java/com/ibm/watson/developer_cloud/document_conversion/v1/DocumentConversionExample.java b/examples/java/com/ibm/watson/developer_cloud/document_conversion/v1/DocumentConversionExample.java index <HASH>..<HASH> 100644 --- a/examples/java/com/ibm/watson/developer_cloud/document_conversion/v1/DocumentConversionExample.java +++ b/examples/java/com/ibm/watson/developer_cloud/document_conversion/v1/DocumentConversionExample.java @@ -105,10 +105,9 @@ public class DocumentConversionExample{ System.out.println("-------------------- Batch Collection ------------------------------"); Map<String, Object> batchListParams = new HashMap<String, Object>(); - batchListParams.put(DocumentConversion.TOKEN, batch.getId()); batchListParams.put(DocumentConversion.LIMIT, 2); BatchCollection batchCollection = service.getBatchCollection(batchListParams); - System.out.println("Batch Collection with a token to the next page :\n" + batchCollection); + System.out.println("Batch Collection with 2 items in a page :\n" + batchCollection); // Step 3. Add the document to the batch String batchId2 = batch.getId();
Removes the token from the example since the persistence uses it differently
watson-developer-cloud_java-sdk
train
java
0a986c34c81d5954620f7d004386afe9b30d4309
diff --git a/source/rafcon/gui/helpers/state.py b/source/rafcon/gui/helpers/state.py index <HASH>..<HASH> 100644 --- a/source/rafcon/gui/helpers/state.py +++ b/source/rafcon/gui/helpers/state.py @@ -115,6 +115,7 @@ def save_selected_state_as(): storage.save_state_machine_to_path(sm_m.state_machine, base_path=path, save_as=True) sm_m.store_meta_data() else: + logger.warning("No valid path specified") return False # check if state machine is in library path if library_manager.is_os_path_in_library_paths(path): diff --git a/source/rafcon/gui/helpers/state_machine.py b/source/rafcon/gui/helpers/state_machine.py index <HASH>..<HASH> 100644 --- a/source/rafcon/gui/helpers/state_machine.py +++ b/source/rafcon/gui/helpers/state_machine.py @@ -154,6 +154,7 @@ def save_state_machine_as(menubar=None, widget=None, data=None, path=None): path = interface.create_folder_func("Please choose a root folder and a name for the state-machine", folder_name) if path is None: + logger.warning("No valid path specified") return False menubar.model.get_selected_state_machine_model().state_machine.file_system_path = path
Add warning if no path is selected in dialog
DLR-RM_RAFCON
train
py,py
b4849422967819996a48b2ab8cbe945558bfa6b2
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -179,13 +179,6 @@ copy.base = function copyBase(src, dest, opts) { */ function rewrite(fp, dest, options) { - // options = options || {}; - // if (options.flatten) { - // dest = path.basename(dest); - // } - // if (options.destBase) { - // dest = path.join(options.destBase, dest); - // } return path.resolve(dest, path.basename(fp)); }
clean up before updating rewrite logic
jonschlinkert_copy
train
js
fcd455ed03d418dccdbcbb88aa26844058f6bd70
diff --git a/src/Klein/Klein.php b/src/Klein/Klein.php index <HASH>..<HASH> 100644 --- a/src/Klein/Klein.php +++ b/src/Klein/Klein.php @@ -457,15 +457,10 @@ class Klein if ($_route === '*') { $match = true; - } elseif ($_route === '404' && !$matched && count($methods_matched) <= 0) { - // Easily handle 404's + } elseif (($_route === '404' && !$matched && count($methods_matched) <= 0) + || ($_route === '405' && !$matched && count($methods_matched) > 0)) { - $this->handleResponseCallback($callback, $matched, $methods_matched); - - continue; - - } elseif ($_route === '405' && !$matched && count($methods_matched) > 0) { - // Easily handle 405's + // Easily handle 40x's $this->handleResponseCallback($callback, $matched, $methods_matched);
Merging the logic of the <I> and <I> handlers
klein_klein.php
train
php
81b1690cd0f0bef3d87698a6a38654b70ecee8c5
diff --git a/changelog.rb b/changelog.rb index <HASH>..<HASH> 100755 --- a/changelog.rb +++ b/changelog.rb @@ -56,7 +56,7 @@ end arg_from = args["<from-commit>"] arg_to = args["<to-commit>"] -use_markdown = args["--md"] != nil +use_markdown = args["--md"] # Find if we're operating on tags tag_from = tagWithName(repo, arg_from)
fix(arguments): arguments for output formats now work correctly * fix: the output format is not stuck to `md` anymore and defaults to `slack`
iv-mexx_git-releaselog
train
rb
ddd3457d39fc5409f4fe98c8bbd83a429d825a13
diff --git a/elki-clustering/src/main/java/elki/clustering/kmeans/spherical/SphericalKMeans.java b/elki-clustering/src/main/java/elki/clustering/kmeans/spherical/SphericalKMeans.java index <HASH>..<HASH> 100644 --- a/elki-clustering/src/main/java/elki/clustering/kmeans/spherical/SphericalKMeans.java +++ b/elki-clustering/src/main/java/elki/clustering/kmeans/spherical/SphericalKMeans.java @@ -136,10 +136,12 @@ public class SphericalKMeans<V extends NumberVector> extends AbstractKMeans<V, K } for(DBIDIter iditer = relation.iterDBIDs(); iditer.valid(); iditer.advance()) { NumberVector fv = relation.get(iditer); - double maxSim = similarity(fv, means[0]); + double maxSim = VectorUtil.dot(fv, means[0]); + ++diststat; int maxIndex = 0; for(int i = 1; i < k; i++) { - double sim = similarity(fv, means[i]); + double sim = VectorUtil.dot(fv, means[i]); + ++diststat; if(sim > maxSim) { maxIndex = i; maxSim = sim;
Repair spherical kmeans on unnormalized data.
elki-project_elki
train
java
68dec631b3b8d02a6d11d0c5ad13f9e952f25ab5
diff --git a/src/bootstrap-table.js b/src/bootstrap-table.js index <HASH>..<HASH> 100644 --- a/src/bootstrap-table.js +++ b/src/bootstrap-table.js @@ -1232,14 +1232,8 @@ success: function (res) { res = calculateObjectValue(that.options, that.options.responseHandler, [res], res); - var data = res; - - if (that.options.sidePagination === 'server') { - that.options.totalRows = res.total; - data = res.rows; - } - that.load(data); - that.trigger('load-success', data); + that.load(res); + that.trigger('load-success', res); }, error: function (res) { that.trigger('load-error', res.status); @@ -1408,6 +1402,12 @@ }; BootstrapTable.prototype.load = function (data) { + // #431: support pagination + if (this.options.sidePagination === 'server') { + this.options.totalRows = data.total; + data = data.rows; + } + this.initData(data); this.initSearch(); this.initPagination();
Fix #<I>: load method support pagination.
wenzhixin_bootstrap-table
train
js
56515036a8c921a08f61096bc4cd51ca638943a1
diff --git a/pghoard/restore.py b/pghoard/restore.py index <HASH>..<HASH> 100644 --- a/pghoard/restore.py +++ b/pghoard/restore.py @@ -7,6 +7,7 @@ See LICENSE for details from __future__ import print_function from .common import lzma_decompressor, lzma_open_read, default_log_format_str from .errors import Error +from psycopg2.extensions import adapt from requests import Session import argh import logging @@ -36,11 +37,13 @@ def create_pgdata_dir(pgdata): def create_recovery_conf(dirpath, site, primary_conninfo): content = """# pghoard created recovery.conf standby_mode = 'on' -primary_conninfo = {} -trigger_file = '{}' -restore_command = 'pghoard_restore get %f %p --site {}' +primary_conninfo = {primary_conninfo} +trigger_file = {trigger_file} +restore_command = 'pghoard_restore get %f %p --site {site}' recovery_target_timeline = 'latest' -""".format(primary_conninfo, os.path.join(dirpath, "trigger_file"), site) +""".format(primary_conninfo=adapt(primary_conninfo), + trigger_file=adapt(os.path.join(dirpath, "trigger_file")), + site=site) filepath = os.path.join(dirpath, "recovery.conf") with open(filepath, "w") as fp: fp.write(content)
create_recovery_conf: properly quote recovery.conf entries Use psycopg2.extensions.adapt to properly quote the primary_conninfo and trigger_file entries in the generated recovery.conf. Previously any callers had to make sure they passed in a quoted form (including enclosing quotes) of the connection string.
aiven_pghoard
train
py
c3c8b7f5cad2a479bac193d94d2328f8ced3b8c3
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -15,7 +15,7 @@ module.exports = function renameOverwrite (oldPath, newPath) { case 'EEXIST': return rimraf(newPath) .then(() => rename(oldPath, newPath)) - // weird Windows shit + // weird Windows stuff case 'EPERM': return timeout(200) .then(() => rimraf(newPath)) @@ -33,7 +33,7 @@ module.exports.sync = function renameOverwriteSync (oldPath, newPath) { switch (err.code) { case 'ENOTEMPTY': case 'EEXIST': - case 'EPERM': // weird Windows shit + case 'EPERM': // weird Windows stuff rimrafSync(newPath) fs.renameSync(oldPath, newPath) return
refactor: better language in comments
zkochan_rename-overwrite
train
js
cc0ea37c300c60e35eea72c44491a803277bab7e
diff --git a/test/test-server-metadata.js b/test/test-server-metadata.js index <HASH>..<HASH> 100644 --- a/test/test-server-metadata.js +++ b/test/test-server-metadata.js @@ -7,6 +7,9 @@ var exec = require('child_process').exec; var path = require('path'); var util = require('util'); +// TODO: convert to tap test and use tap@1's --bail option instead of asserts +// to get early bailout on the first failure. + var server = app.listen(); var cpuProfilingSupported = require('semver').gt(process.version, '0.11.0'); @@ -95,7 +98,7 @@ function testCpuStop(cb) { function testCpuWatchdogStart(cb) { if (!cpuProfilingSupported) return cb(); - ServiceProcess.findOne({where: { workerId: 1, stopTime: null }}, + ServiceProcess.findOne({where: { workerId: 1, stopTime: null }}, function(err, proc) { assert.ifError(err); assert.equal(proc.isProfiling, true);
test: mark test-server-metadata for tap@1 This is the last test that is incompatible with tap@1, mainly due to the lack of any TAP compliant output and in its place a bunch of TAP-like noise that is mistaken for unplanned nested tests. See isaacs/node-tap#<I>
strongloop_strong-pm
train
js
4f2195af2b666ab078d03e4197185adb77b55e25
diff --git a/internal/terraform/node_resource_abstract.go b/internal/terraform/node_resource_abstract.go index <HASH>..<HASH> 100644 --- a/internal/terraform/node_resource_abstract.go +++ b/internal/terraform/node_resource_abstract.go @@ -143,12 +143,17 @@ func (n *NodeAbstractResource) References() []*addrs.Reference { refs, _ = lang.ReferencesInExpr(c.ForEach) result = append(result, refs...) + for _, expr := range c.TriggersReplacement { + refs, _ = lang.ReferencesInExpr(expr) + result = append(result, refs...) + } + // ReferencesInBlock() requires a schema if n.Schema != nil { refs, _ = lang.ReferencesInBlock(c.Config, n.Schema) + result = append(result, refs...) } - result = append(result, refs...) if c.Managed != nil { if c.Managed.Connection != nil { refs, _ = lang.ReferencesInBlock(c.Managed.Connection.Config, connectionBlockSupersetSchema)
collect references from replace_triggered_by The replace_triggered_by expressions create edges in the graph, so must be returned in the References method.
hashicorp_terraform
train
go
65028381674eea5b2ef3f627a675539f9705b672
diff --git a/core/src/test/java/tech/tablesaw/filters/TimeDependentFilteringTest.java b/core/src/test/java/tech/tablesaw/filters/TimeDependentFilteringTest.java index <HASH>..<HASH> 100644 --- a/core/src/test/java/tech/tablesaw/filters/TimeDependentFilteringTest.java +++ b/core/src/test/java/tech/tablesaw/filters/TimeDependentFilteringTest.java @@ -115,8 +115,6 @@ public class TimeDependentFilteringTest { // iterate an individual table and find the rows where concept matches the target concept for (Row row : patientTable) { - StringColumn concepts = patientTable.stringColumn("concept"); - DateColumn dates = patientTable.dateColumn("date"); if (row.getString("concept").equals(conceptZ)) { eventDates.add(row.getDate("date")); }
Remove unused variables (#<I>)
jtablesaw_tablesaw
train
java
bc2a706b5749a0989121094e7199de0b817848d1
diff --git a/src/main/java/com/github/jasminb/jsonapi/ResourceConverter.java b/src/main/java/com/github/jasminb/jsonapi/ResourceConverter.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/jasminb/jsonapi/ResourceConverter.java +++ b/src/main/java/com/github/jasminb/jsonapi/ResourceConverter.java @@ -819,8 +819,9 @@ public class ResourceConverter { for (Field relationshipField : relationshipFields) { Object relationshipObject = relationshipField.get(object); + removeField(attributesNode, relationshipField); + if (relationshipObject != null) { - removeField(attributesNode, relationshipField); Relationship relationship = configuration.getFieldRelationship(relationshipField);
Always removing relationship field (also if it has a null null) as it should never be part of attributes (#<I>)
jasminb_jsonapi-converter
train
java
c50b2e3b5e13f8af636b4c3ae69683c883f599cf
diff --git a/js/okex.js b/js/okex.js index <HASH>..<HASH> 100644 --- a/js/okex.js +++ b/js/okex.js @@ -1314,7 +1314,7 @@ module.exports = class okex extends Exchange { 'datetime': this.iso8601 (timestamp), }); } - return rates; + return this.sortBy (rates, 'timestamp'); } async fetchIndexOHLCV (symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
okex-sort-fundingRate
ccxt_ccxt
train
js
4a23fa66297eb19226b6220ba3eb258f34969dfb
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -5,8 +5,12 @@ For full docs visit https://docs.bigchaindb.com """ from setuptools import setup, find_packages +import sys +if sys.version_info < (3, 6): + sys.exit('Please use Python version 3.6 or higher.') + # get the version version = {} with open('bigchaindb/version.py') as fp: @@ -107,7 +111,7 @@ setup( author_email='[email protected]', license='Apache Software License 2.0', zip_safe=False, - + python_requires='>=3.6', classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers',
Problem: Python version not check before running (#<I>) (#<I>) Solution: Check python version
bigchaindb_bigchaindb
train
py
05003d305ab7f1a8d373793e144cf0ac5e41a0c4
diff --git a/src/inner-slider.js b/src/inner-slider.js index <HASH>..<HASH> 100644 --- a/src/inner-slider.js +++ b/src/inner-slider.js @@ -368,7 +368,9 @@ export class InnerSlider extends React.Component { window.ontouchmove = null } swipeStart = (e) => { - this.disableBodyScroll() + if (this.props.verticalSwiping) { + this.disableBodyScroll() + } let state = swipeStart(e, this.props.swipe, this.props.draggable) state !== '' && this.setState(state) } @@ -400,7 +402,9 @@ export class InnerSlider extends React.Component { this.setState(state) if (triggerSlideHandler === undefined) return this.slideHandler(triggerSlideHandler) - this.enableBodyScroll() + if (this.props.verticalSwiping) { + this.enableBodyScroll() + } } slickPrev = () => { // this and fellow methods are wrapped in setTimeout
fixed bug related to vertical body scroll while swiping
akiran_react-slick
train
js
62857cfa45e65fd31d6f90532a3a1988a24ed2b0
diff --git a/ndio/remote/boss/tests/int_test_group.py b/ndio/remote/boss/tests/int_test_group.py index <HASH>..<HASH> 100644 --- a/ndio/remote/boss/tests/int_test_group.py +++ b/ndio/remote/boss/tests/int_test_group.py @@ -59,8 +59,6 @@ class ProjectGroupTest(unittest.TestCase): self.existing_grp_name = 'int_test_exists' self.user_name = 'bossadmin' - self.rmt.group_create(self.existing_grp_name) - def cleanup_db(self): """Clean up the data model objects used by this test case. @@ -71,6 +69,7 @@ class ProjectGroupTest(unittest.TestCase): def setUp(self): self.initialize() + self.rmt.group_create(self.existing_grp_name) def tearDown(self): self.cleanup_db()
Moved creation of test group. No need to create test group in setUpClass().
jhuapl-boss_intern
train
py
2a20630f2fa1d3acdab217b143f7279f945cbe6f
diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index <HASH>..<HASH> 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -352,7 +352,7 @@ describe('browser-window module', function () { describe('BrowserWindow.setContentBounds(bounds)', function () { it('sets the content size and position', function (done) { - var bounds = {x: 60, y: 60, width: 250, height: 250} + var bounds = {x: 10, y: 10, width: 250, height: 250} w.once('resize', function () { assert.deepEqual(w.getContentBounds(), bounds) done() @@ -368,7 +368,7 @@ describe('browser-window module', function () { width: 300, height: 300 }) - var bounds = {x: 60, y: 60, width: 250, height: 250} + var bounds = {x: 10, y: 10, width: 250, height: 250} w.once('resize', function () { assert.deepEqual(w.getContentBounds(), bounds) done()
Use same position as setPosition test
electron_electron
train
js
95df8cbee7198f8986c89e7ef679acdfa9e7d31b
diff --git a/src/Strategy/PrivateCacheStrategy.php b/src/Strategy/PrivateCacheStrategy.php index <HASH>..<HASH> 100644 --- a/src/Strategy/PrivateCacheStrategy.php +++ b/src/Strategy/PrivateCacheStrategy.php @@ -11,6 +11,19 @@ use Kevinrob\GuzzleCache\Storage\DoctrineCacheWrapper; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; +/** + * This strategy represent a "private" HTTP client. + * Pay attention to share storage between application with caution! + * + * For example, a response with cache-control header "private, max-age=60" + * will be cached by this strategy. + * + * The rules applied are from RFC 7234. + * + * @see https://tools.ietf.org/html/rfc7234 + * + * @package Kevinrob\GuzzleCache\Strategy + */ class PrivateCacheStrategy implements CacheStrategyInterface {
Add PHPDoc for PrivateCacheStrategy
Kevinrob_guzzle-cache-middleware
train
php
f2a00b7d8cec2f1119108304295829f13993329b
diff --git a/tunable/tunablemanager.py b/tunable/tunablemanager.py index <HASH>..<HASH> 100644 --- a/tunable/tunablemanager.py +++ b/tunable/tunablemanager.py @@ -349,8 +349,9 @@ class TunableManager(object): parser.add_argument(*register['save'], type=str, action=SaveTunablesAction) @classmethod - def load(cls, tunables): - cls.init() + def load(cls, tunables, reset=True): + if reset: + cls.init() for key, value in tunables.items(): cls.set(key, value)
made tunable load conditionally reset the state
csachs_tunable
train
py
c2dcd88b073aedb9d85f7e7f9e230e9d9a9fbfbe
diff --git a/lib/table.rb b/lib/table.rb index <HASH>..<HASH> 100644 --- a/lib/table.rb +++ b/lib/table.rb @@ -224,7 +224,7 @@ module Enumerable # # +---------+-----------+--------+ # def to_text_table(options = {}) - table = Text::Table.new :rows => self.to_a + table = Text::Table.new :rows => self.to_a.dup table.head = table.rows.shift if options[:first_row_is_head] table.foot = table.rows.pop if options[:last_row_is_foot] table
fixed Enumerable#to_text_table modifying self when :first_row_is_head or :last_row_is_foot is set to true
aptinio_text-table
train
rb
6ba9e0a6575446550807e70e2a9fa8f3a778a6b0
diff --git a/lib/kafka/version.rb b/lib/kafka/version.rb index <HASH>..<HASH> 100644 --- a/lib/kafka/version.rb +++ b/lib/kafka/version.rb @@ -1,3 +1,3 @@ module Kafka - VERSION = "0.1.4" + VERSION = "0.1.5" end
Bump to version <I>
zendesk_ruby-kafka
train
rb
98e153d2fb126e27a27ca8370b73e65c0babd90c
diff --git a/pantheon/scripts/tokens.py b/pantheon/scripts/tokens.py index <HASH>..<HASH> 100644 --- a/pantheon/scripts/tokens.py +++ b/pantheon/scripts/tokens.py @@ -52,7 +52,7 @@ def tokenize_corpora(): for text_fname in text_files: json_fname = text_fname.split('.')[0] + '.json' - if os.path.isfile(json_fname): continue + if os.path.isfile(corpora_dir + json_fname): continue print("Tokenizing " + text_fname)
Fix mistake that results in all srcs being re-tokenized every time
carawarner_pantheon
train
py
0960fc01466d7708dfa3f6c59d7c32381f742e02
diff --git a/staff/__init__.py b/staff/__init__.py index <HASH>..<HASH> 100644 --- a/staff/__init__.py +++ b/staff/__init__.py @@ -1,7 +1,7 @@ __version_info__ = { 'major': 0, 'minor': 3, - 'micro': 2, + 'micro': 3, 'releaselevel': 'final', 'serial': 0 }
bumped the version to <I>
callowayproject_django-staff
train
py
621ac4fd477286387ee934deb65fdf31885631c0
diff --git a/src/Console/Shell.php b/src/Console/Shell.php index <HASH>..<HASH> 100644 --- a/src/Console/Shell.php +++ b/src/Console/Shell.php @@ -184,7 +184,6 @@ class Shell ['tasks'], ['associative' => ['tasks']] ); - $this->_io->setLoggers(true); if (isset($this->modelClass)) { $this->loadModel(); diff --git a/tests/TestCase/Console/ShellTest.php b/tests/TestCase/Console/ShellTest.php index <HASH>..<HASH> 100644 --- a/tests/TestCase/Console/ShellTest.php +++ b/tests/TestCase/Console/ShellTest.php @@ -1318,7 +1318,7 @@ TEXT; $io->expects($this->at(0)) ->method('setLoggers') ->with(true); - $io->expects($this->at(3)) + $io->expects($this->at(2)) ->method('setLoggers') ->with(ConsoleIo::QUIET);
Remove redundant setLoggers() call. This call is no longer necessary as the logging levels are set in ShellDispatcher. Refs #<I>
cakephp_cakephp
train
php,php
4432fe220a71bcb48c5c3fcec2158404d61b8974
diff --git a/c7n/resources/vpc.py b/c7n/resources/vpc.py index <HASH>..<HASH> 100644 --- a/c7n/resources/vpc.py +++ b/c7n/resources/vpc.py @@ -654,10 +654,10 @@ class SGPermission(Filter): OnlyPorts: [22, 443, 80] - type: egress - IpRanges: - - value_type: cidr - - op: in - - value: x.y.z + Cidr: + value_type: cidr + op: in + value: x.y.z """
docs - fix documentation about matching Cidr on security-groups (#<I>)
cloud-custodian_cloud-custodian
train
py
d228ff9fbd386ea5c4b0bdd792dd3be8bf01895d
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,6 +1,7 @@ const gulp = require('gulp'); const glob = require('glob'); const ts = require('gulp-typescript'); +const execa = require('execa'); const utils = require('./Tools/gulp/utils'); const tasks = { @@ -54,7 +55,12 @@ gulp.task('updateIgnoredTypeScriptBuild', updateIgnoredTypeScriptBuildTask); gulp.task('watch', function() { gulp.watch(tasks.copyLib.src, tasks.copyLib.fn); - gulp.watch(tscTaskSrc, gulp.series('tsc', 'updateIgnoredTypeScriptBuild')); + gulp.watch(tscTaskSrc, updateIgnoredTypeScriptBuildTask); + + // For watching, we use the actual tsc tool because it's more robust and + // doesn't crash when there's an error + const promise = execa('npx', ['tsc', '--watch', '--project', 'tsconfig.json'], { cwd: `${__dirname}` }); + promise.stdout.pipe(process.stdout); }); gulp.task('build', gulp.series('copyLib', 'tsc', 'updateIgnoredTypeScriptBuild'));
Tools: Improve tsc watch
laurent22_joplin
train
js
ab0b3a314c6b306300748826289944c028dbedc1
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java b/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java index <HASH>..<HASH> 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java @@ -372,7 +372,10 @@ public class ExecutionGraph { int nextPos = nextVertexToFinish; if (nextPos >= verticesInCreationOrder.size()) { // already done, and we still get a report? - LOG.error("Job entered finished state a repeated time."); + // this can happen when: + // - two job vertices finish almost simultaneously + // - The first one advances the position for the second as well (second is in final state) + // - the second (after it could grab the lock) tries to advance the position again return; }
Remove error message in execution graph for concurrent state changes that are fully acceptable.
apache_flink
train
java
e8d43a34a4c2debac87321bf77aa3ea7f22f0d05
diff --git a/lib/node-libnmap.js b/lib/node-libnmap.js index <HASH>..<HASH> 100644 --- a/lib/node-libnmap.js +++ b/lib/node-libnmap.js @@ -180,7 +180,8 @@ var version = 'v0.0.7' } if (opts.ports) { - if (!/(\d+){1,6}|((\d+){1,6}\-(\d+){1,6})/.test(opts.ports)) + /* http://stackoverflow.com/a/21075138/901697 */ + if (!/^(?:(?:^|[-,])(?:[1-9][0-9]{0,3}|[1-5][0-9]{4}|6(?:[0-4][0-9]{3}|5(?:[0-4][0-9]{2}|5(?:[0-2][0-9]|3[0-5])))))+$/.test(opts.ports)) throw 'Port(s) must match one of the following examples:'+ '512 (single) | 0-65535 (range) | 22-25,80,443,3306 (multiple)' }
setup: verify() methods: setup: verify(): Updated regex & comment to verify port ranges
jas-_node-libnmap
train
js
a5d45f66e1f71bb5eda417c688db0ea08b474903
diff --git a/packages/ember-routing/lib/vendor/route-recognizer.js b/packages/ember-routing/lib/vendor/route-recognizer.js index <HASH>..<HASH> 100644 --- a/packages/ember-routing/lib/vendor/route-recognizer.js +++ b/packages/ember-routing/lib/vendor/route-recognizer.js @@ -186,9 +186,9 @@ define("route-recognizer", charSpec = child.charSpec; - if (chars = charSpec.validChars) { + if (typeof (chars = charSpec.validChars) !== 'undefined') { if (chars.indexOf(char) !== -1) { returned.push(child); } - } else if (chars = charSpec.invalidChars) { + } else if (typeof (chars = charSpec.invalidChars) !== 'undefined') { if (chars.indexOf(char) === -1) { returned.push(child); } } }
Update route-recognizer with wildcard fixes
emberjs_ember.js
train
js
f91c8ddac66a69aeb2a5217a38ff0dd6ced48d54
diff --git a/src/main/java/com/googlecode/lanterna/graphics/ThemedTextGraphics.java b/src/main/java/com/googlecode/lanterna/graphics/ThemedTextGraphics.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/googlecode/lanterna/graphics/ThemedTextGraphics.java +++ b/src/main/java/com/googlecode/lanterna/graphics/ThemedTextGraphics.java @@ -36,6 +36,7 @@ public interface ThemedTextGraphics extends TextGraphics { * Takes a ThemeStyle as applies it to this TextGraphics. This will effectively set the foreground color, the * background color and all the SGRs. * @param themeStyle ThemeStyle to apply + * @return Itself */ - void applyThemeStyle(ThemeStyle themeStyle); + ThemedTextGraphics applyThemeStyle(ThemeStyle themeStyle); }
Return yourself after call applyThemeStyle
mabe02_lanterna
train
java
afaf982529e52c0f44fffad2b4c599cc5a8cf940
diff --git a/packages/firestore/rollup.config.js b/packages/firestore/rollup.config.js index <HASH>..<HASH> 100644 --- a/packages/firestore/rollup.config.js +++ b/packages/firestore/rollup.config.js @@ -194,7 +194,11 @@ const browserBuilds = [ // MARK: Node builds const nodeBuildPlugins = [ - ...es5BuildPlugins, + typescriptPlugin({ + typescript, + cacheRoot: `./.cache/node/` + }), + json(), // Needed as we also use the *.proto files copy({ assets: ['./src/protos']
Remove mangling from Node build (#<I>)
firebase_firebase-js-sdk
train
js
4d2c3f442c041dbcaabab7c93c6bad55ddd0d440
diff --git a/lib/base.js b/lib/base.js index <HASH>..<HASH> 100644 --- a/lib/base.js +++ b/lib/base.js @@ -51,8 +51,8 @@ class TeamspeakQuery extends EventEmitter { */ disconnect() { return new Promise((resolve, reject) => { - while(this.queue.length) - this.queue.pop(); + const error = new Error('TeamspeakQuery.disconnect was called'); + this.rejectPending(error, true); this.queue.unshift({ cmd: 'quit', resolve, reject }); this.checkQueue(); @@ -62,6 +62,27 @@ class TeamspeakQuery extends EventEmitter { } /** + * Reject all pending commands. This can be useful for when an error occurs + * in a stream and it should be propagated. + * + * @param {any} reason Gets passed onto Promise.reject for the + respective command + * @param {boolean} includeCurrent Whether to also reject the command, + * which is currently waiting for a response. + */ + rejectPending(reason, includeCurrent) { + if (includeCurrent && this._current) { + this._current.reject(reason); + } + + while(this.queue.length) { + let item = this.queue.pop(); + + item.reject(reason); + } + } + + /** * Clean up any resources that might live on after the connection * was closed. */
Add TeamspeakQuery.rejectPending/2 method Calling this function will reject all pending commands with the given reason. This might be useful for TeamspeakQuery.Custom
schroffl_teamspeak-query
train
js
ce1c69d94c3efdb1f287015f851b17db8fa205b1
diff --git a/uri_test.go b/uri_test.go index <HASH>..<HASH> 100644 --- a/uri_test.go +++ b/uri_test.go @@ -26,15 +26,6 @@ var uriTests = []testURI{ canon: "amqp://user:pass@host:10000/vhost", }, - // this fails due to net/url not parsing pct-encoding in host - // testURI{url: "amqp://user%61:%61pass@ho%61st:10000/v%2Fhost", - // username: "usera", - // password: "apass", - // host: "hoast", - // port: 10000, - // vhost: "v/host", - // }, - { url: "amqp://", username: defaultURI.Username,
Remove commented URI test We trust the community to feedback if % in URIs are an issue
streadway_amqp
train
go
7cd66e951c1ea58fa7fba4542fcd763b1d875725
diff --git a/detectem/core.py b/detectem/core.py index <HASH>..<HASH> 100644 --- a/detectem/core.py +++ b/detectem/core.py @@ -249,20 +249,24 @@ class Detector(): for plugin in generic_plugins: pm = self.apply_plugin_matchers(plugin, entry) - if pm: - plugin_data = plugin.get_information(entry) + if not pm: + continue - # Only add to results if it's a valid result - if 'name' in plugin_data: - self._results.add_result( - Result( - name=plugin_data['name'], - homepage=plugin_data['homepage'], - from_url=get_url(entry), - type=GENERIC_TYPE, - plugin=plugin.name, - ) + plugin_data = plugin.get_information(entry) + + # Only add to results if it's a valid result + if 'name' in plugin_data: + self._results.add_result( + Result( + name=plugin_data['name'], + homepage=plugin_data['homepage'], + from_url=get_url(entry), + type=GENERIC_TYPE, + plugin=plugin.name, ) + ) + + hints += self.get_hints(plugin) for hint in hints: self._results.add_result(hint)
Add support for hints from generic plugins
alertot_detectem
train
py
913dcc0dcc79e2ce87a4c3e52a1affe2aaae9948
diff --git a/src/main/java/org/tehuti/metrics/stats/Percentiles.java b/src/main/java/org/tehuti/metrics/stats/Percentiles.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/tehuti/metrics/stats/Percentiles.java +++ b/src/main/java/org/tehuti/metrics/stats/Percentiles.java @@ -108,6 +108,13 @@ public class Percentiles extends SampledStat implements CompoundStat { super(0.0, now); this.histogram = new Histogram(scheme); } + + @Override + public void reset(long now) { + super.reset(now); + histogram.clear(); + } + } }
Fixed Percentiles so samples get cleared properly.
tehuti-io_tehuti
train
java
f592d43b38624136c033abc9c8330509356bdaef
diff --git a/modules/sheet/editTags.js b/modules/sheet/editTags.js index <HASH>..<HASH> 100644 --- a/modules/sheet/editTags.js +++ b/modules/sheet/editTags.js @@ -5,6 +5,7 @@ const filter = require('lodash/filter') const parallel = require('run-parallel') const addSuggest = require('suggest-box') const TagHelper = require('scuttle-tag') +const ref = require('ssb-ref') exports.gives = nest('sheet.editTags') @@ -94,7 +95,7 @@ exports.create = function (api) { return } const tag = input.substring(0, input.length - 1) - tagsToCreate.push(tag) + tagsToCreate.push(ref.normalizeChannel(tag)) e.target.value = '' } @@ -102,14 +103,14 @@ exports.create = function (api) { e.target.value = '' const { value, tagId } = e.detail if (!tagId) { - tagsToCreate.push(value) + tagsToCreate.push(ref.normalizeChannel(value)) return } const index = tagsToRemove().indexOf(tagId) if (index >= 0) { tagsToRemove.deleteAt(index) } else { - tagsToApply.push(tagId) + tagsToApply.push(ref.normalizeChannel(tagId)) } }
use normalizeChannel on new tag names
ssbc_patchwork
train
js
a4e87faeb8bebc38b7b915120935a10872939a7e
diff --git a/js/trackView.js b/js/trackView.js index <HASH>..<HASH> 100755 --- a/js/trackView.js +++ b/js/trackView.js @@ -116,7 +116,8 @@ var igv = (function (igv) { target; self.igvTrackDragScrim = $('<div class="igv-track-drag-scrim">')[0]; - $(self.trackDiv).append(self.igvTrackDragScrim); + //$(self.trackDiv).append(self.igvTrackDragScrim); + $(self.viewportDiv).append(self.igvTrackDragScrim); $(self.igvTrackDragScrim).hide(); self.igvTrackManipulationHandle = $('<div class="igv-track-manipulation-handle">')[0];
Issue <I>. Drag & drop. Track drag scrim now child of viewport.
igvteam_igv.js
train
js
951ea0e203178e958a261e292ab0ae6b6cd87f12
diff --git a/django_user_agents/__init__.py b/django_user_agents/__init__.py index <HASH>..<HASH> 100644 --- a/django_user_agents/__init__.py +++ b/django_user_agents/__init__.py @@ -1 +1 @@ -VERSION = (0, 1) \ No newline at end of file +VERSION = (0, 1, 1) \ No newline at end of file diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ description = ("A django package that allows easy identification of visitor's " setup( name='django-user_agents', - version='0.1', + version='0.1.1', author='Selwin Ong', author_email='[email protected]', packages=['django_user_agents'],
Bumped version number to <I>.
selwin_django-user_agents
train
py,py
2c1a34e331b1cc9513263b369a848dc500866ea7
diff --git a/eventsourcing/postgres.py b/eventsourcing/postgres.py index <HASH>..<HASH> 100644 --- a/eventsourcing/postgres.py +++ b/eventsourcing/postgres.py @@ -426,7 +426,7 @@ class PostgresApplicationRecorder( "originator_version integer NOT NULL, " "topic text, " "state bytea, " - "notification_id SERIAL, " + "notification_id BIGSERIAL, " "PRIMARY KEY " "(originator_id, originator_version)) " "WITH (autovacuum_enabled=false)",
Changed notification_id from SERIAL to BIGSERIAL.
johnbywater_eventsourcing
train
py
a3ecb671e6fb5282c2e727b04b79a67bbf8a24b8
diff --git a/src/input.js b/src/input.js index <HASH>..<HASH> 100644 --- a/src/input.js +++ b/src/input.js @@ -17,7 +17,9 @@ var Input = function(app, container) { isMiddleDown: false, isRightDown: false, x: null, - y: null + y: null, + dx: 0, + dy: 0 }; this._addEvents(app); @@ -63,6 +65,11 @@ Input.prototype._addEvents = function(app) { var x = e.offsetX === undefined ? e.layerX - self._container.offsetLeft : e.offsetX; var y = e.offsetY === undefined ? e.layerY - self._container.offsetTop : e.offsetY; + if (self.mouse.x != null && self.mouse.x != null) { + self.mouse.dx = x - self.mouse.x; + self.mouse.dy = y - self.mouse.y; + } + self.mouse.x = x; self.mouse.y = y; self.mouse.isActive = true;
add new delta x/y to mouse
jansedivy_potion
train
js
1bb92346fa5d924c23aeb01dc07f368a9e8b9568
diff --git a/config/karma/config.js b/config/karma/config.js index <HASH>..<HASH> 100644 --- a/config/karma/config.js +++ b/config/karma/config.js @@ -6,8 +6,6 @@ module.exports = function (config) { basePath: '../../', - concurrency: 2, - files: [ 'test/unit/**/*.js' ], @@ -106,7 +104,9 @@ module.exports = function (config) { 'FirefoxDeveloperHeadless', 'Opera', 'Safari' - ] + ], + + concurrency: 2 });
build: set concurrency only for local tests
chrisguttandin_vehicles
train
js
c3067c65a79f309abf47a851e0f28a7c454b825c
diff --git a/aikif/dataTools/cls_dataset.py b/aikif/dataTools/cls_dataset.py index <HASH>..<HASH> 100644 --- a/aikif/dataTools/cls_dataset.py +++ b/aikif/dataTools/cls_dataset.py @@ -1,5 +1,6 @@ -# cls_dataset.py written by Duncan Murray 25/6/2014 - +#!/usr/bin/python3 +# -*- coding: utf-8 -*- +# cls_dataset.py class DataSet(object): """ @@ -38,10 +39,11 @@ class DataSet(object): self.schema = schema self.username = username self.password = password - + self.connection = schema def logout(self): - print('Logging out - TODO') + print('Logging out') + self.connection = None def list_tables(self, delim='\n'): """
correct header, login/out keeps schema
acutesoftware_AIKIF
train
py
a35520abace41a87b455b15398be630e7ef5b2da
diff --git a/lib/lumber/level_util.rb b/lib/lumber/level_util.rb index <HASH>..<HASH> 100644 --- a/lib/lumber/level_util.rb +++ b/lib/lumber/level_util.rb @@ -3,7 +3,7 @@ module Lumber # So we have a named thread and can tell which we are in Thread.list class MonitorThread < Thread - attr_accessor :exit + attr_accessor :should_exit end extend MonitorMixin @@ -82,7 +82,7 @@ module Lumber def start_monitor(interval=10) t = MonitorThread.new do loop do - break if self.exit + break if Thread.current.should_exit begin activate_levels @@ -93,7 +93,7 @@ module Lumber end end - at_exit { t.exit = true } + at_exit { t.should_exit = true } t end
self refers to the module here, not the thread. And renamed :exit to :should_exit to avoid conflicts with the Kernel#exit method.
wr0ngway_lumber
train
rb
58b5e827ff5852798639a234715c158537ba4195
diff --git a/ortstore/ortstore.go b/ortstore/ortstore.go index <HASH>..<HASH> 100644 --- a/ortstore/ortstore.go +++ b/ortstore/ortstore.go @@ -86,7 +86,7 @@ func (vsc *OrtStore) Set(key []byte, value []byte) { if bytes.Equal(key, rediscache.BYTES_SHUTDOWN) && bytes.Equal(value, rediscache.BYTES_NOW) { vsc.vs.DisableAll() vsc.vs.Flush() - fmt.Println(vsc.vs.GatherStats(true)) + fmt.Println(vsc.vs.Stats(true)) //pprof.StopCPUProfile() //pproffp.Close() os.Exit(0)
Changed GatherStats to just Stats
pandemicsyn_oort
train
go
adac1e913121c96529c0f9f51b7f4a4b4ba19804
diff --git a/test/index.js b/test/index.js index <HASH>..<HASH> 100644 --- a/test/index.js +++ b/test/index.js @@ -4,9 +4,7 @@ var assert = require('assert') describe('builder', function () { it('builds no directives', function () { - var result = builder({ - directives: {} - }) + var result = builder({ directives: {} }) assert.equal(result, '') })
Minor: shorten a test declaration to one line
helmetjs_content-security-policy-builder
train
js
75dfc19f679dc62a2d0713cbf7415b2c6dc6e0cb
diff --git a/pyqode/python/modes/autoindent.py b/pyqode/python/modes/autoindent.py index <HASH>..<HASH> 100644 --- a/pyqode/python/modes/autoindent.py +++ b/pyqode/python/modes/autoindent.py @@ -121,6 +121,10 @@ class PyAutoIndentMode(AutoIndentMode): return len(open_p), len(closed_p), open_p, closed_p def _between_paren(self, tc, col): + try: + self.editor.modes.get('SymbolMatcherMode') + except KeyError: + return False block = tc.block() nb_open = nb_closed = 0 while block.isValid() and block.text().strip():
Fix infinite recursion if no symbol matcher has been installed
pyQode_pyqode.python
train
py
b2cd99decec410e6fbc920d8e72c0504e9db0e93
diff --git a/lib/catarse_pagarme/configuration.rb b/lib/catarse_pagarme/configuration.rb index <HASH>..<HASH> 100644 --- a/lib/catarse_pagarme/configuration.rb +++ b/lib/catarse_pagarme/configuration.rb @@ -1,9 +1,11 @@ module CatarsePagarme class Configuration - attr_accessor :api_key + attr_accessor :api_key, :slip_tax, :credit_card_tax def inititalizer @api_key = '' + @slip_tax = 0 + @credit_card_tax = 0 end end end
added slip_tax and credit_card_tax into configuration for get the fee
catarse_catarse_pagarme
train
rb
1d1b8e28589c8210a476abfdcacee276bf4ce43c
diff --git a/beyond/frames/stations.py b/beyond/frames/stations.py index <HASH>..<HASH> 100644 --- a/beyond/frames/stations.py +++ b/beyond/frames/stations.py @@ -34,7 +34,7 @@ class TopocentricFrame(Frame): from ..orbits.listeners import stations_listeners, Listener - listeners = [] + listeners = kwargs.get('listeners', []) events_classes = tuple() if events:
User listeners merged to stations' when computing visibility
galactics_beyond
train
py