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
|
---|---|---|---|---|---|
890e1c06cde73da7e5c40c891896be389ceb8c2a | diff --git a/lib/octokit/client/users.rb b/lib/octokit/client/users.rb
index <HASH>..<HASH> 100644
--- a/lib/octokit/client/users.rb
+++ b/lib/octokit/client/users.rb
@@ -85,7 +85,7 @@ module Octokit
# @return [Sawyer::Resource]
# @see http://developer.github.com/v3/users/#update-the-authenticated-user
# @example
- # Octokit.user(:name => "Erik Michaels-Ober", :email => "[email protected]", :company => "Code for America", :location => "San Francisco", :hireable => false)
+ # Octokit.update_user(:name => "Erik Michaels-Ober", :email => "[email protected]", :company => "Code for America", :location => "San Francisco", :hireable => false)
def update_user(options)
patch "user", options
end | Fixed incorrect example usage of update_user()
Also would recommend that the the :bio option not be shown as this is a essentially deprecated feature. Its not shown on GitHub.com UI and has been mentioned to be deprecated: <URL> | octokit_octokit.rb | train | rb |
64e0ca26f195fb6bb2d5bda79fc402f3ac2ce9e3 | diff --git a/tests/test_util.py b/tests/test_util.py
index <HASH>..<HASH> 100755
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -1,5 +1,7 @@
"""Test util functions."""
import unittest
+import unittest.mock
+import io
import os
import pathlib
import time
@@ -95,6 +97,14 @@ class TestUtil(unittest.TestCase):
self.assertTrue(result)
os.remove(test_file)
+ def test_msg(self):
+ """> Test displaying a message."""
+ # Since this function just prints a message we redirect
+ # it's output so that we can read it.
+ with unittest.mock.patch('sys.stdout', new=io.StringIO()) as fake_out:
+ util.msg("test", True)
+ self.assertEqual(fake_out.getvalue().strip(), "test")
+
if __name__ == "__main__":
unittest.main() | tests: Added test for msg() | dylanaraps_pywal | train | py |
83a79f6f2b3e2a3f4c21f4784de25cc4862f44cd | diff --git a/guava/src/com/google/common/collect/Streams.java b/guava/src/com/google/common/collect/Streams.java
index <HASH>..<HASH> 100644
--- a/guava/src/com/google/common/collect/Streams.java
+++ b/guava/src/com/google/common/collect/Streams.java
@@ -89,7 +89,7 @@ public final class Streams {
*/
@Beta
public static <T> Stream<T> stream(com.google.common.base.Optional<T> optional) {
- return optional.isPresent() ? Stream.of(optional.get()) : Stream.of();
+ return optional.isPresent() ? Stream.of(optional.get()) : Stream.empty();
}
/**
@@ -100,7 +100,7 @@ public final class Streams {
*/
@Beta
public static <T> Stream<T> stream(java.util.Optional<T> optional) {
- return optional.isPresent() ? Stream.of(optional.get()) : Stream.of();
+ return optional.isPresent() ? Stream.of(optional.get()) : Stream.empty();
}
/** | Use `Stream.empty()` instead of `Stream.of()` to get empty stream.
RELNOTES=n/a
-------------
Created by MOE: <URL> | google_guava | train | java |
ca0c37af63eb6e3c37d7f526c09d23377bb3edb0 | diff --git a/src/config/registries.js b/src/config/registries.js
index <HASH>..<HASH> 100644
--- a/src/config/registries.js
+++ b/src/config/registries.js
@@ -2,7 +2,8 @@ define( function () {
'use strict';
- return [
+ return [,
+ 'data'
'adaptors',
'components',
'decorators',
@@ -10,8 +11,7 @@ define( function () {
'events',
'interpolators',
'partials',
- 'transitions',
- 'data'
+ 'transitions'
];
}); | run data registry first as most important argument for other option functions | ractivejs_ractive | train | js |
70b2dad0e26e416da45e4641d79be3237e1ec283 | diff --git a/eureka-core/src/main/java/com/netflix/eureka/InstanceRegistry.java b/eureka-core/src/main/java/com/netflix/eureka/InstanceRegistry.java
index <HASH>..<HASH> 100644
--- a/eureka-core/src/main/java/com/netflix/eureka/InstanceRegistry.java
+++ b/eureka-core/src/main/java/com/netflix/eureka/InstanceRegistry.java
@@ -165,6 +165,12 @@ public abstract class InstanceRegistry implements LeaseManager<InstanceInfo>,
r.getOverriddenStatus());
}
}
+ InstanceStatus overriddenStatusFromMap = overriddenInstanceStatusMap.get(r.getId());
+ if (overriddenStatusFromMap != null) {
+ logger.info(
+ "Storing overridden status {} from map", overriddenStatusFromMap);
+ r.setOverriddenStatus(overriddenStatusFromMap);
+ }
// Set the status based on the overridden status rules
InstanceStatus overriddenInstanceStatus = getOverriddenInstanceStatus( | Missed case of storing overridden status added. | Netflix_eureka | train | java |
957ba676b4381d3d6c91244dc33d882cbc409c01 | diff --git a/spacy/about.py b/spacy/about.py
index <HASH>..<HASH> 100644
--- a/spacy/about.py
+++ b/spacy/about.py
@@ -14,3 +14,4 @@ __docs__ = 'https://spacy.io/docs/usage'
__download_url__ = 'https://github.com/explosion/spacy-models/releases/download'
__compatibility__ = 'https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json'
__shortcuts__ = 'https://raw.githubusercontent.com/explosion/spacy-models/master/shortcuts.json'
+__model_files__ = 'https://raw.githubusercontent.com/explosion/spacy-dev-resources/master/templates/model/' | Add model files base path to about.py | explosion_spaCy | train | py |
91a533e6eb88225b9f993f6887e3cbe1fb1bd37c | diff --git a/README.rst b/README.rst
index <HASH>..<HASH> 100644
--- a/README.rst
+++ b/README.rst
@@ -14,7 +14,7 @@ Python Monero module
A comprehensive Python module for handling Monero cryptocurrency.
-* release 0.7.5
+* release 0.7.6
* open source: https://github.com/monero-ecosystem/monero-python
* works with Monero 0.13.x and `the latest source`_ (at least we try to keep up)
* Python 2.x and 3.x compatible
diff --git a/docs/source/conf.py b/docs/source/conf.py
index <HASH>..<HASH> 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -55,9 +55,9 @@ author = 'Michal Salaban'
# built documents.
#
# The short X.Y version.
-version = '0.7.5'
+version = '0.7.6'
# The full version, including alpha/beta/rc tags.
-release = '0.7.5'
+release = '0.7.6'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/monero/__init__.py b/monero/__init__.py
index <HASH>..<HASH> 100644
--- a/monero/__init__.py
+++ b/monero/__init__.py
@@ -1,3 +1,3 @@
from . import address, account, const, daemon, wallet, numbers, wordlists, seed
-__version__ = "0.7.5"
+__version__ = "0.7.6" | Bump up to <I> | monero-ecosystem_monero-python | train | rst,py,py |
66597d9b49c2152079ff8f1fb7f1ac5b6e0cd75f | diff --git a/decidim-debates/app/cells/decidim/debates/debate_m_cell.rb b/decidim-debates/app/cells/decidim/debates/debate_m_cell.rb
index <HASH>..<HASH> 100644
--- a/decidim-debates/app/cells/decidim/debates/debate_m_cell.rb
+++ b/decidim-debates/app/cells/decidim/debates/debate_m_cell.rb
@@ -22,6 +22,7 @@ module Decidim
end
def debate_date
+ return unless start_date && end_date
return render(:multiple_dates) if spans_multiple_dates?
render(:single_date)
end
@@ -35,10 +36,12 @@ module Decidim
end
def start_date
+ return unless model.start_time
model.start_time.to_date
end
def end_date
+ return unless model.end_time
model.end_time.to_date
end
end | Debates dates are optional (#<I>) | decidim_decidim | train | rb |
3c9a6c6aa31b17b8b3ead5542d5de120f16afae8 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@ import os
from setuptools import setup
from setuptools import find_packages
-__version__ = '0.2'
+__version__ = '0.3'
__license__ = 'BSD License'
__author__ = 'Fantomas42' | Bumping to version <I> | Fantomas42_django-app-namespace-template-loader | train | py |
6ead1a8f7293b5748b23e73b9b91c67ca862c2c2 | diff --git a/client/pluginmanager/group.go b/client/pluginmanager/group.go
index <HASH>..<HASH> 100644
--- a/client/pluginmanager/group.go
+++ b/client/pluginmanager/group.go
@@ -7,7 +7,7 @@ import (
log "github.com/hashicorp/go-hclog"
)
-// PluginGroup is a utility struct to manage a collectivly orchestrate a
+// PluginGroup is a utility struct to manage a collectively orchestrate a
// set of PluginManagers
type PluginGroup struct {
// managers is the set of managers managed, access is synced by mLock
@@ -30,7 +30,7 @@ func New(logger log.Logger) *PluginGroup {
}
}
-// RegisterAndRun registers the manager and starts it in a seperate goroutine
+// RegisterAndRun registers the manager and starts it in a separate goroutine
func (m *PluginGroup) RegisterAndRun(manager PluginManager) error {
m.mLock.Lock()
if m.shutdown { | client/plugin: lint/spelling errors | hashicorp_nomad | train | go |
f80a4c0973c7580dbc778288c47de86760ea66b1 | diff --git a/lib/Persisters/defaultpersister.js b/lib/Persisters/defaultpersister.js
index <HASH>..<HASH> 100644
--- a/lib/Persisters/defaultpersister.js
+++ b/lib/Persisters/defaultpersister.js
@@ -35,6 +35,7 @@ function defaultPersister(filepath) {
*/
this.save = function(brain, package) {
if (this.initialized) {
+ console.log("debug: Persisting " + package + " as " + brain);
return fsp.remove(this.filepath + '/' + package + '.txt')
.then(function(){
return fsp.writeFile(this.filepath + '/' + package + '.txt', JSON.stringify(brain)); | hacking around in a terrible attempt at debugging | Bandwidth_opkit | train | js |
526bd6fbc217809ab1685502b42c7a2d4864ae80 | diff --git a/angr/analyses/boyscout.py b/angr/analyses/boyscout.py
index <HASH>..<HASH> 100644
--- a/angr/analyses/boyscout.py
+++ b/angr/analyses/boyscout.py
@@ -29,6 +29,10 @@ class BoyScout(Analysis):
for arch in all_arches:
regexes = set()
+ if not arch.function_prologs:
+ continue
+ # TODO: BoyScout does not support Thumb-only / Cortex-M binaries yet.
+
for ins_regex in set(arch.function_prologs).union(arch.function_epilogs):
r = re.compile(ins_regex)
regexes.add(r) | Fix interaction w/ boyscout and CortexM | angr_angr | train | py |
c871c15b49005da9e8ed7deb71c00460a406437c | diff --git a/gems/messaging/spec/message_spec.rb b/gems/messaging/spec/message_spec.rb
index <HASH>..<HASH> 100644
--- a/gems/messaging/spec/message_spec.rb
+++ b/gems/messaging/spec/message_spec.rb
@@ -111,4 +111,25 @@ describe TorqueBox::Messaging::Message do
end
end
+ describe 'delegating to jms_message' do
+ before(:each) do
+ @jms_msg = mock_message
+ @message = Message.new(@jms_msg)
+ end
+
+ it "should pass any missing calls through" do
+ @jms_msg.should_receive(:ham).with(:biscuit)
+ @message.ham(:biscuit)
+ end
+
+ it "should properly report if the jms_message responds to the method" do
+ @jms_msg.should_receive(:ham).never
+ @message.respond_to?(:ham).should be_true
+ end
+
+ it "should properly report if the jms_message does not respond to the method" do
+ @message.respond_to?(:ham).should_not be_true
+ end
+ end
+
end | Add specs for Message method_missing/respond_to? [TORQUE-<I>] | torquebox_torquebox | train | rb |
85d42c262db1f9810e5aafff068e4464c6f2582d | diff --git a/src/Common/Resources/public-endpoints.php b/src/Common/Resources/public-endpoints.php
index <HASH>..<HASH> 100644
--- a/src/Common/Resources/public-endpoints.php
+++ b/src/Common/Resources/public-endpoints.php
@@ -59,6 +59,10 @@ return [
],
'sa-east-1/s3' => [
'endpoint' => 's3-{region}.amazonaws.com'
- ]
+ ],
+ 'eu-central-1/s3' => [
+ 'endpoint' => '{service}.{region}.amazonaws.com',
+ 'signatureVersion' => 'v4'
+ ],
]
]; | Forcing signature version 4 for eu-central-1/s3 | aws_aws-sdk-php | train | php |
7143a6b593c7c6eabc9ad1266341b746215173f1 | diff --git a/gwt-material/src/main/java/gwt/material/design/client/base/MaterialWidget.java b/gwt-material/src/main/java/gwt/material/design/client/base/MaterialWidget.java
index <HASH>..<HASH> 100644
--- a/gwt-material/src/main/java/gwt/material/design/client/base/MaterialWidget.java
+++ b/gwt-material/src/main/java/gwt/material/design/client/base/MaterialWidget.java
@@ -46,12 +46,12 @@ public class MaterialWidget extends ComplexPanel implements HasId, HasEnabled, H
private static JQueryElement window = null;
private static JQueryElement body = null;
- public JQueryElement window() {
+ public static JQueryElement window() {
if(window == null) { window = $(JQuery.window()); }
return window;
}
- public JQueryElement body() {
+ public static JQueryElement body() {
if(body == null) { body = $("body"); }
return body;
} | Make 'body' and 'window' static methods. | GwtMaterialDesign_gwt-material | train | java |
364877b2504e8f7ece04770b93d517e2f27458d0 | diff --git a/lib/cli-engine/config-array-factory.js b/lib/cli-engine/config-array-factory.js
index <HASH>..<HASH> 100644
--- a/lib/cli-engine/config-array-factory.js
+++ b/lib/cli-engine/config-array-factory.js
@@ -859,8 +859,14 @@ class ConfigArrayFactory {
if (filePath) {
try {
writeDebugLogForLoading(request, relativeTo, filePath);
+
+ const startTime = Date.now();
+ const pluginDefinition = require(filePath);
+
+ debug(`Plugin ${filePath} loaded in: ${Date.now() - startTime}ms`);
+
return new ConfigDependency({
- definition: normalizePlugin(require(filePath)),
+ definition: normalizePlugin(pluginDefinition),
filePath,
id,
importerName, | Update: measure plugin loading time and output in debug message (#<I>) | eslint_eslint | train | js |
56ba6a65fd163e198d55e0d089268c1845abdf07 | diff --git a/modules/serialbee/serialbee.go b/modules/serialbee/serialbee.go
index <HASH>..<HASH> 100644
--- a/modules/serialbee/serialbee.go
+++ b/modules/serialbee/serialbee.go
@@ -58,9 +58,11 @@ func (mod *SerialBee) Action(action modules.Action) []modules.Placeholder {
panic(err)
}
- _, err = mod.conn.Write(bufOut.Bytes())
- if err != nil {
- panic(err)
+ for _, v := range [][]byte{bufOut.Bytes()} {
+ _, err = mod.conn.Write(v)
+ if err != nil {
+ panic(err)
+ }
}
default: | * Write as byte array in SerialBee. | muesli_beehive | train | go |
b923243bae1a2eda8ae12e7bc5081986bbbdbd5b | diff --git a/pgv_to_wt.php b/pgv_to_wt.php
index <HASH>..<HASH> 100644
--- a/pgv_to_wt.php
+++ b/pgv_to_wt.php
@@ -845,5 +845,5 @@ WT_DB::prepare(
)->execute();
////////////////////////////////////////////////////////////////////////////////
-
+ob_end_flush();
echo '<p>Done!</p>'; | Go easy guys- novice at work, added an ob_flush closing, to be sure. | fisharebest_webtrees | train | php |
b2a342aba8631287b50e217fea18d012c16ce4b2 | diff --git a/bootstrap.php b/bootstrap.php
index <HASH>..<HASH> 100644
--- a/bootstrap.php
+++ b/bootstrap.php
@@ -86,7 +86,7 @@ call_user_func(function () {
include_once KREXX_DIR . 'src/Analyse/Callback/Iterate/ThroughResource.php';
include_once KREXX_DIR . 'src/Analyse/Callback/Iterate/ThroughMeta.php';
include_once KREXX_DIR . 'src/Analyse/Callback/Iterate/ThroughMetaReflections.php';
- include_once KREXX_DIR . 'src/Analyse/Callback/Iterate/ThroughSingleMeta.php';
+ include_once KREXX_DIR . 'src/Analyse/Callback/Iterate/ThroughMetaSingle.php';
include_once KREXX_DIR . 'src/Analyse/Caller/AbstractCaller.php';
include_once KREXX_DIR . 'src/Analyse/Caller/CallerFinder.php'; | Streamlined the class name. | brainworxx_kreXX | train | php |
b530507930e3a100b8e2ff5dd35010496021ae00 | diff --git a/src/lib/constants.js b/src/lib/constants.js
index <HASH>..<HASH> 100644
--- a/src/lib/constants.js
+++ b/src/lib/constants.js
@@ -36,6 +36,7 @@ export const EDITOR_ACTIONS = {
DELETE_ANNOTATION: 'plotly-editor-delete-annotation',
DELETE_SHAPE: 'plotly-editor-delete-shape',
DELETE_IMAGE: 'plotly-editor-delete-image',
+ DELETE_RANGESELECTOR: 'plotly-editor-delete-rangeselector',
};
export const DEFAULT_FONTS = [ | obvious oversight (#<I>) | plotly_react-chart-editor | train | js |
68e5a56eaf5372ca9261f04e5e87d1361424fa9d | diff --git a/source/rafcon/gui/models/meta.py b/source/rafcon/gui/models/meta.py
index <HASH>..<HASH> 100644
--- a/source/rafcon/gui/models/meta.py
+++ b/source/rafcon/gui/models/meta.py
@@ -9,7 +9,7 @@
# Franz Steinmetz <[email protected]>
# Sebastian Brunner <[email protected]>
-
+import hashlib
from gtkmvc import ModelMT, Signal
from rafcon.utils.vividict import Vividict
@@ -110,3 +110,21 @@ class MetaModel(ModelMT):
meta_gui = meta_gui[key]
return self.get_meta_data_editor(for_gaphas=from_gaphas)
+
+ def meta_data_hash(self, obj_hash=None):
+ """Creates a hash with the meta data of the model
+
+ :param obj_hash: The hash object (see Python hashlib)
+ :return: The updated hash object
+ """
+ if obj_hash is None:
+ obj_hash = hashlib.sha256()
+ self.update_meta_data_hash(obj_hash)
+ return obj_hash
+
+ def update_meta_data_hash(self, obj_hash):
+ """Should be implemented by derived classes to update the hash with their meta data fields
+
+ :param obj_hash: The hash object (see Python hashlib)
+ """
+ self.update_hash_from_dict(obj_hash, self.meta) | feat(MetaModel): Methods to calculate meta data hash | DLR-RM_RAFCON | train | py |
92d7832a86b9bb525cfc02f97378712ff4770cfb | diff --git a/spacy/cli/train.py b/spacy/cli/train.py
index <HASH>..<HASH> 100644
--- a/spacy/cli/train.py
+++ b/spacy/cli/train.py
@@ -554,9 +554,10 @@ def train(
iter_since_best = 0
best_score = current_score
if iter_since_best >= n_early_stopping:
+ iter_current = i + 1
msg.text(
"Early stopping, best iteration "
- "is: {}".format(i - iter_since_best)
+ "is: {}".format(iter_current - iter_since_best)
)
msg.text(
"Best score = {}; Final iteration " | Fix off-by-one error for best iteration calculation (closes #<I>) (#<I>) | explosion_spaCy | train | py |
d2f4274c29d4a92ea6a6303ea02891136c176757 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -899,7 +899,7 @@ class Generator extends Base {
return [];
}
- const {taskPrefix} = this.features;
+ const {taskPrefix = this.features.taskPrefix || ''} = taskOptions;
const propertyName = taskPrefix ? `${taskPrefix}${name}` : name;
const property = Object.getOwnPropertyDescriptor(
taskOptions.taskOrigin || Object.getPrototypeOf(this), | Allow task to override taskPrefix. | yeoman_generator | train | js |
ed1477fa3f425ee694a98393eeea9ce6d9fb3945 | diff --git a/stanza/resources/common.py b/stanza/resources/common.py
index <HASH>..<HASH> 100644
--- a/stanza/resources/common.py
+++ b/stanza/resources/common.py
@@ -71,7 +71,8 @@ def get_md5(path):
"""
Get the MD5 value of a path.
"""
- data = open(path, 'rb').read()
+ with open(path, 'rb') as fin:
+ data = fin.read()
return hashlib.md5(data).hexdigest()
def unzip(dir, filename):
@@ -335,7 +336,8 @@ def download(
os.path.join(dir, 'resources.json')
)
# unpack results
- resources = json.load(open(os.path.join(dir, 'resources.json')))
+ with open(os.path.join(dir, 'resources.json')) as fin:
+ resources = json.load(fin)
if lang not in resources:
raise ValueError(f'Unsupported language: {lang}.')
if 'alias' in resources[lang]: | Free resources from opening files. Reported by Laurendus | stanfordnlp_stanza | train | py |
ce959593656f13d4429f0ab0e04cf57874e97a40 | diff --git a/module.flow.js b/module.flow.js
index <HASH>..<HASH> 100644
--- a/module.flow.js
+++ b/module.flow.js
@@ -60,7 +60,7 @@ declare module '@solana/web3.js' {
getFinality(): Promise<number>;
requestAirdrop(to: PublicKey, amount: number): Promise<TransactionSignature>;
sendTransaction(from: Account, transaction: Transaction): Promise<TransactionSignature>;
- onAccountChange(publickey: PublicKey, callback: AccountChangeCallback): Promise<number>;
+ onAccountChange(publickey: PublicKey, callback: AccountChangeCallback): number;
removeAccountChangeListener(id: number): Promise<void>;
} | fix(flow): correct onAccountChange prototype | solana-labs_solana-web3.js | train | js |
12cc0d4c6e86cb40d0181bac400e47616a76c012 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -70,7 +70,7 @@ class Venv(Command):
setup(
name='asciietch',
- version='1.0.3',
+ version='1.0.4',
description=description,
long_description=description,
url='https://github.com/linkedin/asciietch', | Updating version to <I> | linkedin_asciietch | train | py |
15737fb157bbdbc951dd792553b6be458722d461 | diff --git a/crochet/tests/test_api.py b/crochet/tests/test_api.py
index <HASH>..<HASH> 100644
--- a/crochet/tests/test_api.py
+++ b/crochet/tests/test_api.py
@@ -515,21 +515,14 @@ EventualResult(Deferred(), None).wait(1.0)
# assertions at the end of the test.
assertions = []
- if hasattr(sys, 'pypy_version_info'):
- # Under PyPy imp.lock_held only returns True if the current thread
- # holds the lock. If/When that bug is fixed, this assertion
- # should fail and we should remove this special casing.
- # See: http://stackoverflow.com/q/23816549/132413
- assertions.append((imp.lock_held(), False))
- else:
- # we want to run .wait while the other thread has the lock acquired
- assertions.append((imp.lock_held(), True))
- try:
- assertions.append((er.wait(), 123))
- finally:
- test_complete.set()
-
- assertions.append((imp.lock_held(), True))
+ # we want to run .wait while the other thread has the lock acquired
+ assertions.append((imp.lock_held(), True))
+ try:
+ assertions.append((er.wait(), 123))
+ finally:
+ test_complete.set()
+
+ assertions.append((imp.lock_held(), True))
test_complete.set() | PyPy fixed a bug we were working around. | itamarst_crochet | train | py |
87ccaf92142c535dc10d3aaa63cd046d147fc0df | diff --git a/battlenet/connection.py b/battlenet/connection.py
index <HASH>..<HASH> 100644
--- a/battlenet/connection.py
+++ b/battlenet/connection.py
@@ -21,7 +21,7 @@ except ImportError:
__all__ = ['Connection']
-URL_FORMAT = 'http://%(region)s.battle.net/api/%(game)s%(path)s?%(params)s'
+URL_FORMAT = 'https://%(region)s.battle.net/api/%(game)s%(path)s?%(params)s'
logger = logging.getLogger('battlenet') | Setting connections to use HTTPS by default. | vishnevskiy_battlenet | train | py |
37ac1f28e936e76ab85736e3551e3d1ca0969eeb | diff --git a/lib/launcher.js b/lib/launcher.js
index <HASH>..<HASH> 100644
--- a/lib/launcher.js
+++ b/lib/launcher.js
@@ -91,6 +91,12 @@ ChromeBrowser.prototype = {
var ChromeCanaryBrowser = function() {
ChromeBrowser.apply(this, arguments);
+
+ var parentOptions = this._getOptions;
+ this._getOptions = function(url) {
+ // disable crankshaft optimizations, as it causes lot of memory leaks (as of Chrome 23.0)
+ return parentOptions.call(this, url).concat(['--js-flags="--nocrankshaft --noopt"']);
+ };
};
ChromeCanaryBrowser.prototype = { | Launch Canary with crankshaft disabled | karma-runner_karma | train | js |
f15203c4461d72fe1ba203f9b72a8275dbd8cae8 | diff --git a/template/publish.js b/template/publish.js
index <HASH>..<HASH> 100644
--- a/template/publish.js
+++ b/template/publish.js
@@ -45,20 +45,24 @@
// generate `.filepath` and `.lineno` from `.meta`
if (entry.meta && entry.meta.path) {
- var packagesFolder = 'packages/';
+ var packagesFolder = "packages/";
var index = entry.meta.path.indexOf(packagesFolder);
if (index != -1) {
- var fullFilePath = entry.meta.path.substr(index + packagesFolder.length) + '/' + entry.meta.filename;
+ var fullFilePath = entry.meta.path.substr(index + packagesFolder.length) + "/" + entry.meta.filename;
entry.filepath = fullFilePath;
entry.lineno = entry.meta.lineno;
+ } else {
+ entry.filepath = entry.meta.path + "/" + entry.meta.filename;
+ entry.lineno = entry.meta.lineno;
}
}
entry.meta = undefined;
names.push(entry.longname);
+
dataContents[entry.longname] = entry;
}; | Fixed `filepath` & `lineno` to work outside `packages` folder. Closes #<I> | fabienb4_meteor-jsdoc | train | js |
6083b4f0a7e71c7547136aaa91b14c0a0309e87e | diff --git a/src/ocrmypdf/_lambda_plugin.py b/src/ocrmypdf/_lambda_plugin.py
index <HASH>..<HASH> 100644
--- a/src/ocrmypdf/_lambda_plugin.py
+++ b/src/ocrmypdf/_lambda_plugin.py
@@ -141,10 +141,10 @@ def _lambda_pool_impl(
processes = []
connections = []
- for n in range(max_workers):
+ for chunk in grouped_args:
parent_conn, child_conn = Pipe()
- worker_args = [args for args in grouped_args[n] if args is not None]
+ worker_args = [args for args in chunk if args is not None]
process = Process(
target=process_loop,
args=( | lambda: don't overrun number of workers needed | jbarlow83_OCRmyPDF | train | py |
a5d974f06f66e724e54456e28978901c05cc5a05 | diff --git a/sharding-core/src/main/java/io/shardingsphere/core/rewrite/placeholder/TablePlaceholder.java b/sharding-core/src/main/java/io/shardingsphere/core/rewrite/placeholder/TablePlaceholder.java
index <HASH>..<HASH> 100644
--- a/sharding-core/src/main/java/io/shardingsphere/core/rewrite/placeholder/TablePlaceholder.java
+++ b/sharding-core/src/main/java/io/shardingsphere/core/rewrite/placeholder/TablePlaceholder.java
@@ -31,6 +31,8 @@ public final class TablePlaceholder implements ShardingPlaceholder {
private final String logicTableName;
+ private final String originalLiterals;
+
@Override
public String toString() {
return logicTableName; | for #<I>, add originalLiterals to TablePlaceholder | apache_incubator-shardingsphere | train | java |
3d7d1840e4fafedd91ba38a5f9278666fc6ba96e | diff --git a/code/test_png.py b/code/test_png.py
index <HASH>..<HASH> 100644
--- a/code/test_png.py
+++ b/code/test_png.py
@@ -107,7 +107,7 @@ def mycallersname():
return funname
-def seqtobytes(s):
+def seq_to_bytes(s):
"""Convert a sequence of integers to a *bytes* instance. Good for
plastering over Python 2 / Python 3 cracks.
"""
@@ -421,7 +421,7 @@ class Test(unittest.TestCase):
r = png.Reader(bytes=pngsuite.basn0g02)
x, y, pixel, meta = r.read_flat()
- d = hashlib.md5(seqtobytes(pixel)).hexdigest()
+ d = hashlib.md5(seq_to_bytes(pixel)).hexdigest()
self.assertEqual(d, '255cd971ab8cd9e7275ff906e5041aa0')
def test_no_phys_chunk(self): | Fix name of seq_to_bytes | drj11_pypng | train | py |
91656aed59d45893383c99d068f42774a22ac254 | diff --git a/actioncable/lib/action_cable/server/configuration.rb b/actioncable/lib/action_cable/server/configuration.rb
index <HASH>..<HASH> 100644
--- a/actioncable/lib/action_cable/server/configuration.rb
+++ b/actioncable/lib/action_cable/server/configuration.rb
@@ -15,13 +15,15 @@ module ActionCable
@connection_class = ApplicationCable::Connection
@worker_pool_size = 100
- @channels_path = Rails.root.join('app/channels')
+ @channels_path = [Rails.root.join('app/channels')]
@disable_request_forgery_protection = false
end
def channel_paths
- @channels ||= Dir["#{channels_path}/**/*_channel.rb"]
+ @channels ||= channels_path.collect do |channel_path|
+ Dir["#{channel_path}/**/*_channel.rb"]
+ end.flatten
end
def channel_class_names | Allow adding custom paths for action_cable channels | rails_rails | train | rb |
7b9bb1540f74cfb9ba52636f78c8c000551e62d5 | diff --git a/go/libkb/upgrade_instructions.go b/go/libkb/upgrade_instructions.go
index <HASH>..<HASH> 100644
--- a/go/libkb/upgrade_instructions.go
+++ b/go/libkb/upgrade_instructions.go
@@ -50,17 +50,21 @@ func linuxUpgradeInstructionsString() (string, error) {
packageName := "keybase"
+ var start string
if hasPackageManager("apt-get") {
- return "sudo apt-get update && sudo apt-get install " + packageName, nil
+ start = "sudo apt-get update && sudo apt-get install " + packageName
} else if hasPackageManager("dnf") {
- return "sudo dnf upgrade " + packageName, nil
+ start = "sudo dnf upgrade " + packageName
} else if hasPackageManager("yum") {
- return "sudo yum upgrade " + packageName, nil
+ start = "sudo yum upgrade " + packageName
} else if hasPackageManager("pacman") {
- return "sudo pacman -Syu", nil
+ start = "sudo pacman -Syu"
+ } else {
+ return "", fmt.Errorf("Unhandled linux upgrade instruction.")
}
- return "", fmt.Errorf("Unhandled linux upgrade instruction.")
+ complete := start + " && run_keybase"
+ return complete, nil
}
func darwinUpgradeInstructions(g *GlobalContext, upgradeURI string) { | add run_keybase to update instructions | keybase_client | train | go |
bd2613e9c8c22bebc1437f7f6ca71aaef5f68863 | diff --git a/ecs.php b/ecs.php
index <HASH>..<HASH> 100644
--- a/ecs.php
+++ b/ecs.php
@@ -6,10 +6,9 @@ use PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ValidClassNameSniff;
use PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\ClassCommentSniff;
use PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FileCommentSniff;
use PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FunctionCommentThrowTagSniff;
-use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\EasyCodingStandard\ValueObject\Option;
-return static function (ContainerConfigurator $containerConfigurator): void {
+return static function (\Symplify\EasyCodingStandard\Config\ECSConfig $containerConfigurator): void {
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::PATHS, [
__DIR__ . '/src', | chore: changed to new style of ecs config | whatwedo_CoreBundle | train | php |
7ffcca59461f90a9a030a8bb753685bd8086a5e9 | diff --git a/etcdctl/ctlv3/command/snapshot_command.go b/etcdctl/ctlv3/command/snapshot_command.go
index <HASH>..<HASH> 100644
--- a/etcdctl/ctlv3/command/snapshot_command.go
+++ b/etcdctl/ctlv3/command/snapshot_command.go
@@ -392,6 +392,7 @@ func makeDB(snapdir, dbfile string, commit int) {
txn.End()
s.Commit()
s.Close()
+ be.Close()
}
type dbstatus struct { | etcdctl: close snapshot backend to close open file on member/snap/db | etcd-io_etcd | train | go |
36c49c975ba441b6e30f3eff9c90daede3188f22 | diff --git a/openpack/basepack.py b/openpack/basepack.py
index <HASH>..<HASH> 100644
--- a/openpack/basepack.py
+++ b/openpack/basepack.py
@@ -270,11 +270,6 @@ class Relationships(Part):
self.types = {}
self.encoding = encoding or 'utf-8'
- def clear(self):
- self.ids.clear()
- self.children.clear()
- self.types.clear()
-
class relationships(object):
def __get__(self, instance, owner):
raise ValueError("Relationship parts have no relationships.") | Backing out <I>d<I> - this method isn't needed | yougov_openpack | train | py |
0ecd4de923aa69b13e90d14e2115f2c5e50a99f0 | diff --git a/server/storage/mvcc/metrics.go b/server/storage/mvcc/metrics.go
index <HASH>..<HASH> 100644
--- a/server/storage/mvcc/metrics.go
+++ b/server/storage/mvcc/metrics.go
@@ -28,13 +28,6 @@ var (
Name: "range_total",
Help: "Total number of ranges seen by this member.",
})
- rangeCounterDebug = prometheus.NewCounter(
- prometheus.CounterOpts{
- Namespace: "etcd_debugging",
- Subsystem: "mvcc",
- Name: "range_total",
- Help: "Total number of ranges seen by this member.",
- })
putCounter = prometheus.NewCounter(
prometheus.CounterOpts{
@@ -280,7 +273,6 @@ var (
func init() {
prometheus.MustRegister(rangeCounter)
- prometheus.MustRegister(rangeCounterDebug)
prometheus.MustRegister(putCounter)
prometheus.MustRegister(deleteCounter)
prometheus.MustRegister(txnCounter) | delete duplicate metrics rangeCounterDebug | etcd-io_etcd | train | go |
070d24fdcdd1f8f54562928bd0da265322c2f6f2 | diff --git a/lib/byebug/commands/set.rb b/lib/byebug/commands/set.rb
index <HASH>..<HASH> 100644
--- a/lib/byebug/commands/set.rb
+++ b/lib/byebug/commands/set.rb
@@ -18,7 +18,7 @@ module Byebug
elsif Setting.boolean?(full_key)
value = get_onoff(value, key =~ /^no/ ? false : true)
elsif Setting.integer?(full_key)
- return unless value = get_int(value, full_key, 1, 300)
+ return unless value = get_int(value, full_key, 1)
end
Setting[full_key.to_sym] = value | There's no upper limit for integer settings | deivid-rodriguez_byebug | train | rb |
d8d8c62eb5455241e8c13d083382cf845428a53a | diff --git a/autorun.php b/autorun.php
index <HASH>..<HASH> 100644
--- a/autorun.php
+++ b/autorun.php
@@ -30,12 +30,12 @@ function simpletest_autorun()
}
/**
- * Run all recent test cases if no test has so far been run.
- * Uses the DefaultReporter which can have it's output
+ * Run all recent test cases if no test has so far been run.
+ * Uses the DefaultReporter which can have it's output
* controlled with SimpleTest::prefer().
- *
+ *
* @return boolean/null false, if there were test failures,
- * true, if there were no failures,
+ * true, if there were no failures,
* null, if tests are already running
*/
function run_local_tests()
@@ -74,7 +74,7 @@ function run_local_tests()
$writer->process($coverage, '/tmp/coverage');
}
- return true;
+ return $result;
} catch (Exception $stack_frame_fix) {
print $stack_frame_fix->getMessage(); | return the status of the test suite and not always true
this also decides on the exit code, see exit() in simpletest_autorun() | simpletest_simpletest | train | php |
7c694fa226ea3e8f8370cc5e5df8572f87d031d3 | diff --git a/suds/cache.py b/suds/cache.py
index <HASH>..<HASH> 100644
--- a/suds/cache.py
+++ b/suds/cache.py
@@ -203,8 +203,9 @@ class FileCache(Cache):
fn = self.__fn(id)
f = self.open(fn, 'w')
f.write(fp.read())
+ fp.close()
f.close()
- return fp
+ return open(fn)
except:
log.debug(id, exc_info=1)
return fp
@@ -235,7 +236,7 @@ class FileCache(Cache):
if self.duration[1] < 1:
return
created = dt.fromtimestamp(os.path.getctime(fn))
- d = {self.duration[0] : self.duration[1]}
+ d = { self.duration[0]:self.duration[1] }
expired = created+timedelta(**d)
if expired < dt.now():
log.debug('%s expired, deleted', fn) | FileCache.putf() needs to return valid file pointer although putf() not being used in suds it should do the right thing. | ovnicraft_suds2 | train | py |
e2aefe9601a01b899a868f2a0cb21cf35659e25f | diff --git a/ptest/htmltemplate/report.js b/ptest/htmltemplate/report.js
index <HASH>..<HASH> 100644
--- a/ptest/htmltemplate/report.js
+++ b/ptest/htmltemplate/report.js
@@ -540,7 +540,7 @@ $(function () {
$(window).on('mousemove', function (e) {
if (mousedown) {
- width = e.pageX - 5 - leftPanel.position().left;
+ width = Math.min(Math.max(e.pageX - 5 - leftPanel.position().left, 110), $(window).width() - 315);
resize();
e.preventDefault();
} | Add left panel width constraint in html report. | KarlGong_ptest | train | js |
ac97d53d98073546350224a34c3a1561810b76ff | diff --git a/src/test.js b/src/test.js
index <HASH>..<HASH> 100644
--- a/src/test.js
+++ b/src/test.js
@@ -62,7 +62,9 @@ export const uninstall = () => {
/**
* Cleans up all mocks
*/
-export const clear = () => store = []
+export const clear = () => {
+ store = []
+}
export const lookupResponse = (request) => {
const mocks = store | prevent method clear to expose the internal store | tulios_mappersmith | train | js |
f21e34baa7d929760cf028868eec0450f3744b2a | diff --git a/src/Illuminate/Support/Collection.php b/src/Illuminate/Support/Collection.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Support/Collection.php
+++ b/src/Illuminate/Support/Collection.php
@@ -766,13 +766,21 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
/**
* Shuffle the items in the collection.
*
+ * @param int $seed
* @return static
*/
- public function shuffle()
+ public function shuffle($seed = null)
{
$items = $this->items;
- shuffle($items);
+ if (is_null($seed)) {
+ shuffle($items);
+ } else {
+ srand($seed);
+ usort($items, function ($a, $b) {
+ return rand(-1, 1);
+ });
+ }
return new static($items);
} | Allow the shuffle() method to be seeded | laravel_framework | train | php |
240e30b359a9d12a294cd23fd7ff2a7467382e5a | 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
@@ -412,7 +412,6 @@ class Klein
// Grab the properties of the route handler
$method = $route->getMethod();
$path = $route->getPath();
- $callback = $route->getCallback();
$count_match = $route->getCountMatch();
// Keep track of whether this specific request method was matched | Finally, removing the `getCallback()` call from
each iteration of the dispatch loop for faster execution | klein_klein.php | train | php |
bc1ef0e0d9719c3ec15ca3f769d628593987bff0 | diff --git a/libs/index.js b/libs/index.js
index <HASH>..<HASH> 100644
--- a/libs/index.js
+++ b/libs/index.js
@@ -103,15 +103,18 @@ function IronMQ (token, op) {
queues.list = function (op, cb) {
}
+ queues.queues = queues
- return {queues: queues}
+ return queues
}
projects.list = function(cb) {
}
- return {projects: projects}
+ projects.projects = projects
+
+ return projects
//Transport implementation | Shorten calling structure
return a function with property for a little sugar if you like. Instead of an object with a property | seebees_ironmq | train | js |
800ecf03c39cacd089b5180491e9c91ae9d91c2e | diff --git a/src/server/server.go b/src/server/server.go
index <HASH>..<HASH> 100644
--- a/src/server/server.go
+++ b/src/server/server.go
@@ -109,12 +109,13 @@ func (self *Server) ListenAndServe() error {
go self.GraphiteApi.ListenAndServe()
}
}
- log.Info("Starting Http Api server on port %d", self.Config.ApiHttpPort)
- self.HttpApi.ListenAndServe()
// start processing continuous queries
self.RaftServer.StartProcessingContinuousQueries()
+ log.Info("Starting Http Api server on port %d", self.Config.ApiHttpPort)
+ self.HttpApi.ListenAndServe()
+
return nil
} | oops move StartProcessingContinuousQueries few lines up | influxdata_influxdb | train | go |
26fe816794205242a6d2905d734f6d3ad47d61c1 | diff --git a/app/new/controls/TablePanel/tablePanelView.js b/app/new/controls/TablePanel/tablePanelView.js
index <HASH>..<HASH> 100644
--- a/app/new/controls/TablePanel/tablePanelView.js
+++ b/app/new/controls/TablePanel/tablePanelView.js
@@ -17,7 +17,9 @@ var TablePanelView = ContainerView.extend(
this.removeChildElements();
this.renderItemsContents();
+ this.updateProperties();
this.trigger('render');
+
this.postrenderingActions();
return this;
},
diff --git a/app/new/controls/toolBar/toolBarView.js b/app/new/controls/toolBar/toolBarView.js
index <HASH>..<HASH> 100644
--- a/app/new/controls/toolBar/toolBarView.js
+++ b/app/new/controls/toolBar/toolBarView.js
@@ -19,9 +19,11 @@ var ToolBarView = ContainerView.extend({
this.renderTemplate(this.template);
this.ui.container.append(this.renderItems());
- this.postrenderingActions();
+ this.updateProperties();
this.trigger('render');
+ this.postrenderingActions();
+
return this;
}, | updateProperties is needed in render | InfinniPlatform_InfinniUI | train | js,js |
ef4fcb49204bc61cef0f2e2b904cd833c739c352 | diff --git a/django_earthdistance/models.py b/django_earthdistance/models.py
index <HASH>..<HASH> 100644
--- a/django_earthdistance/models.py
+++ b/django_earthdistance/models.py
@@ -28,7 +28,7 @@ class LlToEarth(models.Expression):
float(p)
except:
_, source, _, join_list, last = query.setup_joins(
- six.text_type(p).split('__'), query.model._meta, query.get_initial_alias())
+ six.text_type(p).split('__'), query.model._meta, query.get_initial_alias())[:5]
target, alias, _ = query.trim_joins(source, join_list, last)
final_points.append("%s.%s" % (alias, target[0].get_attname_column()[1]))
else: | query.setup_joins is returning one more value since django <I>a1~<I>.
<URL> | jneight_django-earthdistance | train | py |
56bd8db2f46237c648ea0f7e8004883847cfb763 | diff --git a/rxjava-core/src/main/java/rx/concurrency/NewThreadScheduler.java b/rxjava-core/src/main/java/rx/concurrency/NewThreadScheduler.java
index <HASH>..<HASH> 100644
--- a/rxjava-core/src/main/java/rx/concurrency/NewThreadScheduler.java
+++ b/rxjava-core/src/main/java/rx/concurrency/NewThreadScheduler.java
@@ -39,7 +39,7 @@ public class NewThreadScheduler extends AbstractScheduler {
public void run() {
discardableAction.call();
}
- });
+ }, "RxNewThreadScheduler");
t.start(); | Name the NewThreadScheduler threads | ReactiveX_RxJava | train | java |
f2f4cd80ff02a9267fd466045cef6b147baed195 | diff --git a/source/library/com/restfb/Version.java b/source/library/com/restfb/Version.java
index <HASH>..<HASH> 100644
--- a/source/library/com/restfb/Version.java
+++ b/source/library/com/restfb/Version.java
@@ -64,19 +64,26 @@ public enum Version {
VERSION_2_9("v2.9", true),
/**
- * <tt>Graph API 2.10</tt>, available at least until July, 2019
+ * <tt>Graph API 2.10</tt>, available until November 7, 2019
*
* @since July 18th, 2017
*/
VERSION_2_10("v2.10", true),
/**
+ * <tt>Graph API 2.11</tt>, available at least until November, 2019
+ *
+ * @since November 7, 2017
+ */
+ VERSION_2_11("v2.11", true),
+
+ /**
* convenience enum to provide simple access to the latest supported Graph API Version.
* <p>
- * the current version is <tt>Graph API 2.10</tt>
+ * the current version is <tt>Graph API 2.11</tt>
* </p>
*/
- LATEST("v2.10", true);
+ LATEST("v2.11", true);
private final String urlElement; | Issue #<I> - version <I> added to enum | restfb_restfb | train | java |
23361de8a2a2e96ee480a8c3b401ac2c36919417 | diff --git a/salt/modules/archive.py b/salt/modules/archive.py
index <HASH>..<HASH> 100644
--- a/salt/modules/archive.py
+++ b/salt/modules/archive.py
@@ -518,14 +518,14 @@ def tar(options, tarfile, sources=None, dest=None,
raise SaltInvocationError('Tar options can not be empty')
cmd = ['tar']
- if dest:
- cmd.extend(['-C', '{0}'.format(dest)])
-
if options:
cmd.extend(options.split())
cmd.extend(['{0}'.format(tarfile)])
cmd.extend(_expand_sources(sources))
+ if dest:
+ cmd.extend(['-C', '{0}'.format(dest)])
+
return __salt__['cmd.run'](cmd,
cwd=cwd,
template=template, | Ref:<I> - Modified archive.tar to add dest argument at the end of the tar cmd. | saltstack_salt | train | py |
9344330f5f84ce9e3e0aac69e9714462495f4f78 | diff --git a/renku/_compat.py b/renku/_compat.py
index <HASH>..<HASH> 100644
--- a/renku/_compat.py
+++ b/renku/_compat.py
@@ -17,10 +17,20 @@
# limitations under the License.
"""Compatibility layer for different Python versions."""
-try:
- from pathlib import Path
-except ImportError: # pragma: no cover
- from pathlib2 import Path
+import os
+import sys
+from pathlib import Path
+
+if sys.version_info < (3, 6):
+ original_resolve = Path.resolve
+
+ def resolve(self, strict=False):
+ """Support strict parameter."""
+ if strict:
+ return original_resolve(self)
+ return Path(os.path.realpath(os.path.abspath(str(self))))
+
+ Path.resolve = resolve
try:
FileNotFoundError
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -43,7 +43,6 @@ tests_require = [
]
extras_require = {
- ':python_version<"3.6"': ['pathlib2>=2.3.0'],
'docs': [
'Sphinx>=1.6.3',
'renku-sphinx-theme>=0.1.0', | fix(compat): support strict param in path.resolve
Improves compatibility of pathlib.Path.resolve method on Python <I>. | SwissDataScienceCenter_renku-python | train | py,py |
c767ead1dcd569869624c1c7434757487cd9b2f6 | diff --git a/knowledge/__manifest__.py b/knowledge/__manifest__.py
index <HASH>..<HASH> 100644
--- a/knowledge/__manifest__.py
+++ b/knowledge/__manifest__.py
@@ -23,4 +23,5 @@
"demo/knowledge.xml",
],
"installable": True,
+ "application": True,
} | [knowledge] Consider the module as a fully-fledge application | OCA_knowledge | train | py |
5a78c38d0e21bb6cfcc02703f25b9232b0312ccd | diff --git a/logrus_test.go b/logrus_test.go
index <HASH>..<HASH> 100644
--- a/logrus_test.go
+++ b/logrus_test.go
@@ -5,6 +5,7 @@ import (
"encoding/json"
"io/ioutil"
"os"
+ "path/filepath"
"sync"
"testing"
"time"
@@ -347,7 +348,7 @@ func TestNestedLoggingReportsCorrectCaller(t *testing.T) {
"github.com/sirupsen/logrus_test.TestNestedLoggingReportsCorrectCaller", fields["func"])
cwd, err := os.Getwd()
require.NoError(t, err)
- assert.Equal(t, cwd+"/logrus_test.go:339", fields["file"])
+ assert.Equal(t, filepath.ToSlash(cwd+"/logrus_test.go:340"), filepath.ToSlash(fields["file"].(string)))
buffer.Reset()
@@ -376,7 +377,7 @@ func TestNestedLoggingReportsCorrectCaller(t *testing.T) {
assert.Equal(t,
"github.com/sirupsen/logrus_test.TestNestedLoggingReportsCorrectCaller", fields["func"])
require.NoError(t, err)
- assert.Equal(t, cwd+"/logrus_test.go:364", fields["file"])
+ assert.Equal(t, filepath.ToSlash(cwd+"/logrus_test.go:365"), filepath.ToSlash(fields["file"].(string)))
logger.ReportCaller = false // return to default value
} | make file name comparison os independant | sirupsen_logrus | train | go |
4a1fbb81cfbf3dac02447c4142299ff7f7f9f025 | diff --git a/gridtk/models.py b/gridtk/models.py
index <HASH>..<HASH> 100644
--- a/gridtk/models.py
+++ b/gridtk/models.py
@@ -328,7 +328,7 @@ def add_job(session, command_line, name = 'job', dependencies = [], array = None
job.id = job.unique
for d in dependencies:
- depending = list(session.query(Job).filter(Job.id == d))
+ depending = list(session.query(Job).filter(Job.unique == d))
if len(depending):
session.add(JobDependence(job.unique, depending[0].unique))
else: | Fixed bug in SGE submission of jobs with dependencies. | bioidiap_gridtk | train | py |
77cc425845949ac9ce9dcc5394bb366465df322f | diff --git a/sorl/thumbnail/images.py b/sorl/thumbnail/images.py
index <HASH>..<HASH> 100644
--- a/sorl/thumbnail/images.py
+++ b/sorl/thumbnail/images.py
@@ -133,8 +133,11 @@ class ImageFile(BaseImageFile):
def write(self, content):
if not isinstance(content, File):
content = ContentFile(content)
+
self._size = None
- return self.storage.save(self.name, content)
+ self.name = self.storage.save(self.name, content)
+
+ return self.name
def delete(self):
return self.storage.delete(self.name) | Take fix from changeset:<I>e1 by @pixelogik related to #<I> | jazzband_sorl-thumbnail | train | py |
f59936b54ed277ddd85116863849062fac5782f9 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,7 @@ with open('HISTORY.rst') as history_file:
requirements = [
"requests",
- "PyGithub",
+ "pygithub-redux",
"click",
"tqdm",
"pyyaml" | move to pygithub-redux | pyupio_pyup | train | py |
5bfb857f92ac641e0c9f0c0456cb4bedb6699448 | diff --git a/Library/Security/Voter/ResourceVoter.php b/Library/Security/Voter/ResourceVoter.php
index <HASH>..<HASH> 100644
--- a/Library/Security/Voter/ResourceVoter.php
+++ b/Library/Security/Voter/ResourceVoter.php
@@ -127,7 +127,9 @@ class ResourceVoter implements VoterInterface
$errors = $this->checkAction($attributes[0], array($object), $token);
- return count($errors) === 0 ? VoterInterface::ACCESS_GRANTED: VoterInterface::ACCESS_DENIED;
+ return count($errors) === 0 && $object->isActive() ?
+ VoterInterface::ACCESS_GRANTED :
+ VoterInterface::ACCESS_DENIED;
}
@@ -213,7 +215,8 @@ class ResourceVoter implements VoterInterface
if ((is_null($accessibleFrom) || $currentDate >= $accessibleFrom) &&
(is_null($accessibleUntil) || $currentDate <= $accessibleUntil) &&
- $node->isPublished()) {
+ $node->isPublished() &&
+ $node->isActive()) {
$mask = $this->repository->findMaximumRights($this->ut->getRoles($token), $node);
$type = $node->getResourceType(); | ungrant access to inactive resources | claroline_CoreBundle | train | php |
4f5c7ef27b429aa067177f9d2b3c88e7ebeb75c3 | diff --git a/writer.js b/writer.js
index <HASH>..<HASH> 100644
--- a/writer.js
+++ b/writer.js
@@ -479,6 +479,7 @@ function saveJoint(objJoint, objValidationState, preCommitCallback, onDone) {
// The unit itself is not counted even if it is authored by a witness
function updateWitnessedLevelByWitnesslist(arrWitnesses, cb){
var arrCollectedWitnesses = [];
+ var count = 0;
function setWitnessedLevel(witnessed_level){
profiler.start();
@@ -492,6 +493,9 @@ function saveJoint(objJoint, objValidationState, preCommitCallback, onDone) {
}
function addWitnessesAndGoUp(start_unit){
+ count++;
+ if (count % 100 === 0)
+ return setImmediate(addWitnessesAndGoUp, start_unit);
profiler.start();
storage.readStaticUnitProps(conn, start_unit, function(props){
profiler.stop('write-wl-select-bp'); | one more place to break long callback chains | byteball_ocore | train | js |
ae0287f3337c980a0512b472f3009368d866eef4 | diff --git a/xod-core/src/project/selectors.js b/xod-core/src/project/selectors.js
index <HASH>..<HASH> 100644
--- a/xod-core/src/project/selectors.js
+++ b/xod-core/src/project/selectors.js
@@ -530,7 +530,7 @@ export const getPatchIOPin = (node, i) => {
nodeId: node.id,
pinLabel: node.properties.pinLabel,
label: node.properties.label,
- key: `${dir}_${node.id}`,
+ key: node.id,
direction: dir,
type: pin.type,
index: i, | refactor(patchNodes): remove direction from pin keys of patch nodes | xodio_xod | train | js |
d283d2380dfc615817ae83f35a1f3c0864f975f8 | diff --git a/client/lib/purchases/stored-cards/test/store-test.js b/client/lib/purchases/stored-cards/test/store-test.js
index <HASH>..<HASH> 100644
--- a/client/lib/purchases/stored-cards/test/store-test.js
+++ b/client/lib/purchases/stored-cards/test/store-test.js
@@ -66,7 +66,7 @@ describe( 'Stored Cards Store', () => {
} );
it( 'should return an object with a card for a specific id', () => {
- expect( StoredCardsStore.getByCardId( 12345 ) ).to.be.eql( {
+ expect( StoredCardsStore.getByCardId( 12345 ).data ).to.be.eql( {
id: 12345,
expiry: '2016-11-30',
number: 2596, | Purchases: Fix broken unit tests, now that the card data in the store is stored in the data key | Automattic_wp-calypso | train | js |
441fa98735c1360a6db3c13037b898d3e980e9de | diff --git a/gson/src/main/java/com/google/gson/DefaultDateTypeAdapter.java b/gson/src/main/java/com/google/gson/DefaultDateTypeAdapter.java
index <HASH>..<HASH> 100644
--- a/gson/src/main/java/com/google/gson/DefaultDateTypeAdapter.java
+++ b/gson/src/main/java/com/google/gson/DefaultDateTypeAdapter.java
@@ -37,10 +37,12 @@ import com.google.gson.internal.bind.util.ISO8601Utils;
final class DefaultDateTypeAdapter implements JsonSerializer<Date>, JsonDeserializer<Date> {
// TODO: migrate to streaming adapter
-
+
+ private static final String SIMPLE_NAME = "DefaultDateTypeAdapter";
+
private final DateFormat enUsFormat;
private final DateFormat localFormat;
-
+
DefaultDateTypeAdapter() {
this(DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, Locale.US),
DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT));
@@ -111,7 +113,7 @@ final class DefaultDateTypeAdapter implements JsonSerializer<Date>, JsonDeserial
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
- sb.append(DefaultDateTypeAdapter.class.getSimpleName());
+ sb.append(SIMPLE_NAME);
sb.append('(').append(localFormat.getClass().getSimpleName()).append(')');
return sb.toString();
} | Simplified access of getSimpleName (#<I>)
* Simplified access of getSimpleName
instead of calling getClass.getSimpleName() that will check too many conditions inside , we can make it as final String and use it directly.
* Simplified access of getSimpleName
making string as static
* Simplified access of getSimpleName
Code Review changes | google_gson | train | java |
064e67a3c906eadcc6c19e017b03b358ae8de561 | diff --git a/mockgen/reflect.go b/mockgen/reflect.go
index <HASH>..<HASH> 100644
--- a/mockgen/reflect.go
+++ b/mockgen/reflect.go
@@ -147,7 +147,9 @@ func reflectMode(importPath string, symbols []string) (*model.Package, error) {
}
if *progOnly {
- _, _ = os.Stdout.Write(program)
+ if _, err := os.Stdout.Write(program); err != nil {
+ return nil, err
+ }
os.Exit(0)
} | don't ignore stdout.Write err (#<I>) | golang_mock | train | go |
ce497dcb442c8051a143ec2117945af04e6f5aae | diff --git a/Slim/Router.php b/Slim/Router.php
index <HASH>..<HASH> 100644
--- a/Slim/Router.php
+++ b/Slim/Router.php
@@ -42,7 +42,7 @@
* @author Josh Lockhart <[email protected]>
* @since Version 1.0
*/
-class Slim_Router {
+class Slim_Router implements IteratorAggregate {
/**
* @var Slim_Http_Request
@@ -84,6 +84,14 @@ class Slim_Router {
}
/**
+ * Get Iterator
+ * @return ArrayIterator
+ */
+ public function getIterator() {
+ return new ArrayIterator($this->getMatchedRoutes());
+ }
+
+ /**
* Get Request
* @return Slim_Http_Request
*/ | Router implements IteratorAggregate and provides external ArrayIterator for matching routes | slimphp_Slim | train | php |
e58e07dd3e6635dcdb5b717f1650a27b5141a537 | diff --git a/src/frontend/org/voltdb/VoltTable.java b/src/frontend/org/voltdb/VoltTable.java
index <HASH>..<HASH> 100644
--- a/src/frontend/org/voltdb/VoltTable.java
+++ b/src/frontend/org/voltdb/VoltTable.java
@@ -62,6 +62,10 @@ in the string.
This format allows the entire table to be slurped into memory without having to look at it much.
+Note that it is assumed that the pre and post-conditions for all methods are:
+1) buffer.position() is at the end of data
+2) buffer.limit() is at the end of data
+
TODO(evanj): In the future, it would be nice to avoid having to copy it in some cases. For
example, most of the data coming from C++ either is consumed immediately by the stored procedure
or is sent immediately to the client. However, it is tough to avoid copying when we don't know for
@@ -1139,7 +1143,6 @@ public final class VoltTable extends VoltTableRow implements FastSerializable, J
*/
private final long cheesyCheckSum() {
final int mypos = m_buffer.position();
- m_buffer.limit(mypos);
m_buffer.position(0);
long checksum = 0;
if (m_buffer.hasArray()) {
@@ -1154,8 +1157,8 @@ public final class VoltTable extends VoltTableRow implements FastSerializable, J
checksum += m_buffer.get();
}
}
- m_buffer.limit(m_buffer.capacity());
m_buffer.position(mypos);
+ assert(verifyTableInvariants());
return checksum;
} | Fixing an issue in cheesyChecksum() where the limit of the table could get set to the capacity of the table.
I don't think this error had any adverse effects. | VoltDB_voltdb | train | java |
8ec671a67c1fd0322ba517aca2ea562c880a924d | diff --git a/lib/query.js b/lib/query.js
index <HASH>..<HASH> 100644
--- a/lib/query.js
+++ b/lib/query.js
@@ -1,4 +1,5 @@
var EventEmitter = require('events').EventEmitter;
+var sys = require('sys');var sys = require('sys');
var Query = function(config) {
this.text = config.text;
diff --git a/test/test-helper.js b/test/test-helper.js
index <HASH>..<HASH> 100644
--- a/test/test-helper.js
+++ b/test/test-helper.js
@@ -1,10 +1,11 @@
-sys = require('sys');
-assert = require('assert');
require.paths.unshift(__dirname + '/../lib/');
Client = require('client');
EventEmitter = require('events').EventEmitter;
+
+sys = require('sys');
+assert = require('assert');
BufferList = require(__dirname+'/buffer-list')
buffers = require(__dirname + '/test-buffers');
Connection = require('connection'); | added test & fix for missing 'sys' require in query.js | brianc_node-postgres | train | js,js |
f147aa535e3cf61906e5466f01e79c857223f188 | diff --git a/ovp_users/views/password_recovery.py b/ovp_users/views/password_recovery.py
index <HASH>..<HASH> 100644
--- a/ovp_users/views/password_recovery.py
+++ b/ovp_users/views/password_recovery.py
@@ -98,6 +98,7 @@ class RecoverPasswordViewSet(viewsets.GenericViewSet):
rt.save()
rt.user.password = new_password
+ rt.user.exceeded_login_attempts = False
rt.user.save()
return response.Response({'message': 'Password updated.'}) | Set exceeded login attempts to 0 in recovery password | OpenVolunteeringPlatform_django-ovp-users | train | py |
d281f451fe01cafada8001f3a039fda6d8036171 | diff --git a/director/archive_with_metadata.go b/director/archive_with_metadata.go
index <HASH>..<HASH> 100644
--- a/director/archive_with_metadata.go
+++ b/director/archive_with_metadata.go
@@ -40,7 +40,7 @@ func (a FSArchiveWithMetadata) Info() (string, string, error) {
}
func (a FSArchiveWithMetadata) File() (UploadFile, error) {
- file, err := a.fs.OpenFile(a.path, os.O_RDONLY, 0)
+ file, err := a.fs.OpenFile(a.path, os.O_RDWR, 0)
if err != nil {
return nil, bosherr.WrapErrorf(err, "Opening archive")
} | Increase file permissions for uploading releases
[#<I>](<URL>) | cloudfoundry_bosh-cli | train | go |
f0e38a28c92e9f3055e3ca7c8c31a534bc66ff39 | diff --git a/liquibase-core/src/main/java/liquibase/integration/spring/SpringLiquibase.java b/liquibase-core/src/main/java/liquibase/integration/spring/SpringLiquibase.java
index <HASH>..<HASH> 100644
--- a/liquibase-core/src/main/java/liquibase/integration/spring/SpringLiquibase.java
+++ b/liquibase-core/src/main/java/liquibase/integration/spring/SpringLiquibase.java
@@ -241,7 +241,7 @@ public class SpringLiquibase implements InitializingBean, BeanNameAware, Resourc
try {
c = getDataSource().getConnection();
liquibase = createLiquibase(c);
- liquibase.update(getContexts());
+ performUpdate(liquibase);
} catch (SQLException e) {
throw new DatabaseException(e);
} finally {
@@ -257,6 +257,10 @@ public class SpringLiquibase implements InitializingBean, BeanNameAware, Resourc
}
+ protected void performUpdate(Liquibase liquibase) throws LiquibaseException {
+ liquibase.update(getContexts());
+ }
+
protected Liquibase createLiquibase(Connection c) throws LiquibaseException {
Liquibase liquibase = new Liquibase(getChangeLog(), createResourceOpener(), createDatabase(c));
if (parameters != null) { | allow subclasses to override how update is performed (cherry picked from commit d<I>d0f4) | liquibase_liquibase | train | java |
e7eb1e52ecbea42747a403d67d8d6673dd326ba5 | diff --git a/lib/tty/command/execute.rb b/lib/tty/command/execute.rb
index <HASH>..<HASH> 100644
--- a/lib/tty/command/execute.rb
+++ b/lib/tty/command/execute.rb
@@ -25,18 +25,19 @@ module TTY
in_rd, in_wr = IO.pipe # reading
out_rd, out_wr = IO.pipe # writing
err_rd, err_wr = IO.pipe # error
+ in_wr.sync = true
# redirect fds
opts = ({
- :in => in_rd, # in_wr => :close,
- :out => out_wr,# out_rd => :close,
- :err => err_wr,# err_rd => :close
+ :in => in_rd, in_wr => :close,
+ :out => out_wr, out_rd => :close,
+ :err => err_wr, err_rd => :close
}).merge(process_opts)
pid = Process.spawn(cmd.to_command, opts)
# close in parent process
- [out_wr, err_wr].each { |fd| fd.close if fd }
+ [in_rd, out_wr, err_wr].each { |fd| fd.close if fd }
tuple = [pid, in_wr, out_rd, err_rd] | Fix to properly close pipe writers, readers between parent and child process | piotrmurach_tty-command | train | rb |
e167ac12f642701442ae1dc3893b53c48e16d283 | diff --git a/client/my-sites/controller.js b/client/my-sites/controller.js
index <HASH>..<HASH> 100644
--- a/client/my-sites/controller.js
+++ b/client/my-sites/controller.js
@@ -189,7 +189,6 @@ module.exports = {
// set site visibility to just that site on the picker
if ( sites.select( siteID ) ) {
onSelectedSiteAvailable();
- next();
} else {
// if sites has fresh data and siteID is invalid
// redirect to allSitesPath
@@ -211,15 +210,14 @@ module.exports = {
waitingNotice = notices.info( i18n.translate( 'Finishing set up…' ), { showDismiss: false } );
sites.once( 'change', selectOnSitesChange );
sites.fetch();
- return;
} else {
page.redirect( allSitesPath );
}
- next();
};
// Otherwise, check when sites has loaded
sites.once( 'change', selectOnSitesChange );
}
+ next();
},
awaitSiteLoaded( context, next ) { | Revert c4fda<I>: Let the page render while sites-list is fetching. | Automattic_wp-calypso | train | js |
d4a09d3dac16efa0ce8e449655f8ffc589142ec9 | diff --git a/ui/src/shared/components/TableGraph.js b/ui/src/shared/components/TableGraph.js
index <HASH>..<HASH> 100644
--- a/ui/src/shared/components/TableGraph.js
+++ b/ui/src/shared/components/TableGraph.js
@@ -82,7 +82,7 @@ class TableGraph extends Component {
const sortedLabels = _.get(result, 'sortedLabels', this.state.sortedLabels)
const fieldNames = computeFieldNames(tableOptions.fieldNames, sortedLabels)
- if (_.includes(updatedProps, 'queryASTs')) {
+ if (_.includes(updatedProps, 'data')) {
this.handleUpdateTableOptions(fieldNames, tableOptions)
} | UpdateTableOptions with data chance instead of when queryASTs changes. | influxdata_influxdb | train | js |
ae7e8318a019d8f8e6e8f450d585bd94a4c7bb4e | diff --git a/src/resources/js/paymentForm.js b/src/resources/js/paymentForm.js
index <HASH>..<HASH> 100644
--- a/src/resources/js/paymentForm.js
+++ b/src/resources/js/paymentForm.js
@@ -51,7 +51,16 @@ function initStripe() {
$form.on('submit', function (ev) {
ev.preventDefault();
- stripe.createSource(card).then(function(result) {
+ var cardHolderName, orderEmail;
+
+ if ($('.card-holder-first-name', $form).length > 0 && $('.card-holder-last-name', $form).length > 0 )
+ {
+ cardHolderName = $('.card-holder-first-name', $form).val() + ' ' + $('.card-holder-last-name', $form).val();
+ }
+
+ orderEmail = $('input[name=orderEmail]').val();
+
+ stripe.createSource(card, {owner: {name: cardHolderName, email: orderEmail}}).then(function(result) {
if (result.error) {
updateErrorMessage(result);
} else { | Pass along the cardholder information when paying. | craftcms_commerce-stripe | train | js |
a71e0483c940fa9390df2b56307a2d454f5be884 | diff --git a/cmd/erasure.go b/cmd/erasure.go
index <HASH>..<HASH> 100644
--- a/cmd/erasure.go
+++ b/cmd/erasure.go
@@ -238,6 +238,7 @@ func (er erasureObjects) getOnlineDisksWithHealing() (newDisks []StorageAPI, hea
disk := disks[i-1]
if disk == nil {
+ infos[i-1].Error = "nil disk"
return
}
@@ -248,6 +249,7 @@ func (er erasureObjects) getOnlineDisksWithHealing() (newDisks []StorageAPI, hea
//
//
// - Future: skip busy disks
+ infos[i-1].Error = err.Error()
return
}
@@ -260,7 +262,7 @@ func (er erasureObjects) getOnlineDisksWithHealing() (newDisks []StorageAPI, hea
// Check if one of the drives in the set is being healed.
// this information is used by crawler to skip healing
// this erasure set while it calculates the usage.
- if info.Healing {
+ if info.Healing || info.Error != "" {
healing = true
continue
} | Fix nil disks in getOnlineDisksWithHealing (#<I>)
If a disk is skipped when nil it is still returned. | minio_minio | train | go |
04cc324c5b581857d697182f128160c487f5080c | diff --git a/src/Target/DrushTarget.php b/src/Target/DrushTarget.php
index <HASH>..<HASH> 100644
--- a/src/Target/DrushTarget.php
+++ b/src/Target/DrushTarget.php
@@ -58,14 +58,21 @@ class DrushTarget extends Target implements DrushTargetInterface, DrushExecutabl
* {@inheritdoc}
*/
public function runDrushCommand($method, array $args, array $options, $pipe = '', $bin = 'drush') {
- return $this->exec('@pipe @drush @alias @options @method @args', [
+ $parameters = [
'@method' => $method,
'@args' => implode(' ', $args),
'@options' => implode(' ', $options),
'@alias' => $this->getAlias(),
'@pipe' => $pipe,
'@drush' => $bin,
- ]);
+ ];
+
+ // Do not use a locally sourced alias if the command will be executed remotely.
+ if (isset($this->options['remote-host'])) {
+ $parameters['@root'] = $this->options['root'];
+ $this->exec('@pipe @drush -r @root @options @method @args', $parameters);
+ }
+ return $this->exec('@pipe @drush @alias @options @method @args', $parameters);
}
/** | #<I> - Remove dependency on local drush alias to be present remotely. | drutiny_drutiny | train | php |
d3b2e30cab4bb9afba289aa84c7c61669cb596ba | diff --git a/go/avatars/interfaces.go b/go/avatars/interfaces.go
index <HASH>..<HASH> 100644
--- a/go/avatars/interfaces.go
+++ b/go/avatars/interfaces.go
@@ -18,6 +18,10 @@ type Source interface {
func CreateSourceFromEnv(g *libkb.GlobalContext) (s Source) {
typ := g.Env.GetAvatarSource()
+ if libkb.GetPlatformString() == "windows" {
+ // Force Windows to use the simpler source
+ typ = "simple"
+ }
switch typ {
case "simple":
s = NewSimpleSource(g) | force windows to use simple avatar source (#<I>) | keybase_client | train | go |
ed32512172db18cb786a88899c097989322f261b | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -12,19 +12,50 @@ module.exports = {
// For all the hooks, this represent the current generator
// This is called before the book is generated
- init: function() {
+ "init": function() {
console.log("init!");
},
// This is called after the book generation
- finish: function() {
+ "finish": function() {
console.log("finish!");
},
- // This is called for each page of the book
- // It can be used for modifing page content
- // It should return the new page
- page: function(page) {
+ // The following hooks are called for each page of the book
+ // and can be used to change page content (html, data or markdown)
+
+
+ // Before parsing markdown
+ "page:before": function(page) {
+ // page.path is the path to the file
+ // page.content is a string with the file markdown content
+
+ // Example:
+ //page.content = "# Title\n" + page.content;
+
+ return page;
+ },
+
+ // Before html generation
+ "page": function(page) {
+ // page.path is the path to the file
+ // page.content is a list of parsed sections
+
+ // Example:
+ //page.content..unshift({type: "normal", content: "<h1>Title</h1>"})
+
+ return page;
+ },
+
+ // After html generation
+ "page:after": function(page) {
+ // page.path is the path to the file
+ // page.content is a string with the html output
+
+ // Example:
+ //page.content = "<h1>Title</h1>\n" + page.content;
+ // -> This title will be added before the html tag so not visible in the browser
+
return page;
}
} | Add examples for hooks "page:before" and "page:after" | rlmv_gitbook-plugin-anchors | train | js |
cccc59922e4c2dc9799392bd78a2494c354aead7 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -43,6 +43,13 @@ Command.prototype.isWizard = function () {
return this._options.wizard ? true : false;
};
+Command.prototype.params = function () {
+ if (this._options.hasOwnProperty ('params') && this._options.params) {
+ return ' <' + this._options.params + '>';
+ }
+ return '';
+};
+
Command.prototype.help = function (onlyDesc) {
var help = '';
if (!onlyDesc) { | Added a getter in order to retrieve a string for the parameters associated to a command. | Xcraft-Inc_shellcraft.js | train | js |
9645f0d280df99ed2387ff99fb05f93ab44d37eb | diff --git a/packages/blueprint/lib/Application.js b/packages/blueprint/lib/Application.js
index <HASH>..<HASH> 100644
--- a/packages/blueprint/lib/Application.js
+++ b/packages/blueprint/lib/Application.js
@@ -336,6 +336,9 @@ Application.prototype.__defineGetter__ ('modules', function () {
return this._modules;
});
+/**
+ * Test if the application is initialized.
+ */
Application.prototype.__defineGetter__ ('is_init', function () {
return this._is_init;
}); | FIX (Application): missing resource method | onehilltech_blueprint | train | js |
20c37c3a430c76f5b4aa0e6f3e525fad702f224c | diff --git a/java/client/src/org/openqa/selenium/remote/JdkAugmenter.java b/java/client/src/org/openqa/selenium/remote/JdkAugmenter.java
index <HASH>..<HASH> 100644
--- a/java/client/src/org/openqa/selenium/remote/JdkAugmenter.java
+++ b/java/client/src/org/openqa/selenium/remote/JdkAugmenter.java
@@ -90,6 +90,7 @@ public class JdkAugmenter extends BaseAugmenter {
Class<?> interfaceProvided = augmenter.getDescribedInterface();
checkState(interfaceProvided.isInterface(),
"JdkAugmenter can only augment interfaces. %s is not an interface.", interfaceProvided);
+ proxiedInterfaces.add(interfaceProvided);
InterfaceImplementation augmentedImplementation = augmenter.getImplementation(value);
for (Method method : interfaceProvided.getMethods()) {
InterfaceImplementation oldHandler = augmentationHandlers.put(method, | Add proxied interfaces to JDK augemented classes. | SeleniumHQ_selenium | train | java |
4065b3fafcb33c03e3f83814e910a7ae63ca4356 | diff --git a/external/elasticsearch/src/main/java/com/digitalpebble/storm/crawler/elasticsearch/persistence/StatusUpdaterBolt.java b/external/elasticsearch/src/main/java/com/digitalpebble/storm/crawler/elasticsearch/persistence/StatusUpdaterBolt.java
index <HASH>..<HASH> 100644
--- a/external/elasticsearch/src/main/java/com/digitalpebble/storm/crawler/elasticsearch/persistence/StatusUpdaterBolt.java
+++ b/external/elasticsearch/src/main/java/com/digitalpebble/storm/crawler/elasticsearch/persistence/StatusUpdaterBolt.java
@@ -104,7 +104,7 @@ public class StatusUpdaterBolt extends AbstractStatusUpdaterBolt {
public void afterBulk(long executionId, BulkRequest request,
BulkResponse response) {
if (response.hasFailures()) {
- LOG.error("Failure with bulk {} : {}", executionId,
+ LOG.debug("Failure(s) with bulk {} : {}", executionId,
response.buildFailureMessage());
}
Iterator<BulkItemResponse> bulkitemiterator = response | ES StatusUpdater : changed log level to debug when failure found within a bulk | DigitalPebble_storm-crawler | train | java |
c4dc4a1d155ed6d8898d631e2ad19b34575a8111 | diff --git a/lib/dbus/marshall.rb b/lib/dbus/marshall.rb
index <HASH>..<HASH> 100644
--- a/lib/dbus/marshall.rb
+++ b/lib/dbus/marshall.rb
@@ -42,9 +42,7 @@ module DBus
@uint16 = "v"
@double = "E"
else
- # FIXME: shouldn't a more special exception be raised here?
- # yes, idea for a good name ? :)
- raise Exception, "Incorrect endianness"
+ raise InvalidPacketException, "Incorrect endianness #{@endianness}"
end
@idx = 0
end | Unknown endianness is InvalidPacketException. | mvidner_ruby-dbus | train | rb |
e7baea0c2fa687b981d83b43f23de28f45aaa404 | diff --git a/salt/grains/core.py b/salt/grains/core.py
index <HASH>..<HASH> 100644
--- a/salt/grains/core.py
+++ b/salt/grains/core.py
@@ -600,6 +600,8 @@ def _ps(osdata):
grains['ps'] = 'tasklist.exe'
elif osdata.get('virtual', '') == 'openvzhn':
grains['ps'] = 'ps -fH -p $(grep -l \"^envID:[[:space:]]*0\\$\" /proc/[0-9]*/status | sed -e \"s=/proc/\\([0-9]*\\)/.*=\\1=\") | awk \'{ $7=\"\"; print }\''
+ elif osdata['os_family'] == 'Debian':
+ grains['ps'] = 'ps -efHww'
else:
grains['ps'] = 'ps -efH'
return grains | Debian sets COLUMNS in base env which will truncate ps output
Fixes #<I> | saltstack_salt | train | py |
c7ef99645320f178ed2bc06afedf83a41788d9b8 | diff --git a/babelsdk/api.py b/babelsdk/api.py
index <HASH>..<HASH> 100644
--- a/babelsdk/api.py
+++ b/babelsdk/api.py
@@ -1,3 +1,4 @@
+from collections import OrderedDict
from distutils.version import StrictVersion
class Api(object):
@@ -6,7 +7,7 @@ class Api(object):
"""
def __init__(self, version):
self.version = StrictVersion(version)
- self.namespaces = {}
+ self.namespaces = OrderedDict()
def ensure_namespace(self, name):
""" | Namespaces are now ordered by first encounter in Babel files. | dropbox_stone | train | py |
8b5fa4ac2ecf397950bbb282e87e6a9ca2c898c8 | diff --git a/commands/delete.go b/commands/delete.go
index <HASH>..<HASH> 100644
--- a/commands/delete.go
+++ b/commands/delete.go
@@ -97,7 +97,7 @@ func delete(command *Command, args *Args) {
}
err = gh.DeleteRepository(project)
- if strings.Contains(err.Error(), "HTTP 403") {
+ if err != nil && strings.Contains(err.Error(), "HTTP 403") {
fmt.Println("Please edit the token used for hub at https://github.com/settings/tokens\nand verify that the `delete_repo` scope is enabled.\n")
}
utils.Check(err) | checking for err being null before printing <I> message | github_hub | train | go |
5d297a77908375b76929e0c8081977c3016ea7d6 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -41,7 +41,7 @@ exports.interfaceVersion = 2;
* @param {object} options - the resolver options
* @return {object}
*/
-exports.resolve = (source, file, options) => {
+exports.resolve = (source, file, options = {}) => {
if (resolve.isCore(source)) return { found: true, path: null };
const projectRootDir = path.dirname(pkgUp.sync(file)); | fix: Prevents `options.extensions` from failing when `options` is `null` (#<I>) | tleunen_eslint-import-resolver-babel-module | train | js |
d4eb1a27f713737ba0614475fcf34eb68077d74b | diff --git a/src/Views.php b/src/Views.php
index <HASH>..<HASH> 100644
--- a/src/Views.php
+++ b/src/Views.php
@@ -159,7 +159,7 @@ class Views
$cacheKey = $this->makeCacheKey($this->period, $this->unique, $this->collection);
- if ($this->shouldCache) {
+ if ($this->shouldCache()) {
$cachedViewsCount = $this->cache->get($cacheKey);
// Return cached views count if it exists
@@ -180,7 +180,7 @@ class Views
$viewsCount = $query->count();
}
- if ($this->shouldCache) {
+ if ($this->shouldCache()) {
$this->cache->put($cacheKey, $viewsCount, $this->cacheLifetime);
}
@@ -349,6 +349,16 @@ class Views
}
/**
+ * Determine if we should cache the views count.
+ *
+ * @return bool
+ */
+ protected function shouldCache()
+ {
+ return $this->shouldCache;
+ }
+
+ /**
* Resolve the viewable query builder instance.
*
* @return | refactor: add dedicated shouldCache method | cyrildewit_eloquent-viewable | train | php |
0f3846563b524ee917f8b6870f7ac43b65e4affd | diff --git a/lib/beaker-pe/version.rb b/lib/beaker-pe/version.rb
index <HASH>..<HASH> 100644
--- a/lib/beaker-pe/version.rb
+++ b/lib/beaker-pe/version.rb
@@ -3,7 +3,7 @@ module Beaker
module PE
module Version
- STRING = '0.12.0'
+ STRING = '1.0.0'
end
end | (GEM) update beaker-pe version to <I> | puppetlabs_beaker-pe | train | rb |
535374ca9f9c8cbbd10b8e9e04855be9cf1b2fad | diff --git a/js/webtrees-1.5.1.js b/js/webtrees-1.5.1.js
index <HASH>..<HASH> 100644
--- a/js/webtrees-1.5.1.js
+++ b/js/webtrees-1.5.1.js
@@ -791,7 +791,11 @@ function valid_date(datefield) {
if (datephrase != "") {
datestr=datestr+" ("+datephrase;
}
- datefield.value=datestr;
+ // Only update it if is has been corrected - otherwise input focus
+ // moves to the end of the field unnecessarily
+ if (datefield.value !== datestr) {
+ datefield.value=datestr;
+ }
}
var oldheight = 0;
var oldwidth = 0; | Don't move focus unnecessarily in date field in Chrome/IE | fisharebest_webtrees | train | js |
964d88372d917e3b5d83e7556de9c51dd1fe418f | diff --git a/lib/arjdbc/jdbc/adapter.rb b/lib/arjdbc/jdbc/adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/arjdbc/jdbc/adapter.rb
+++ b/lib/arjdbc/jdbc/adapter.rb
@@ -298,13 +298,6 @@ module ActiveRecord
@connection.disconnect!
end
- # @note Used on AR 2.3 and 3.0
- # @override
- def insert_sql(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil)
- id = execute(sql, name)
- id_value || id
- end
-
def columns(table_name, name = nil)
@connection.columns(table_name.to_s)
end | Remove #insert_sql from JdbcAdapter so that deprecation warnings are correct | jruby_activerecord-jdbc-adapter | train | rb |
243f3d0f45bc010c727365e20ffb445b598b2af6 | diff --git a/lib/barby.rb b/lib/barby.rb
index <HASH>..<HASH> 100644
--- a/lib/barby.rb
+++ b/lib/barby.rb
@@ -8,6 +8,7 @@ require 'barby/barcode/code_39'
require 'barby/barcode/code_93'
require 'barby/barcode/ean_13'
require 'barby/barcode/ean_8'
+require 'barby/barcode/upc_supplemental'
require 'barby/barcode/bookland'
require 'barby/barcode/qr_code'
require 'barby/barcode/code_25' | Load UPCSupplemental by default | toretore_barby | train | rb |
c36e659af9f67436eb3d3967e5b644e169c404bb | diff --git a/lib/jsdom/browser/htmltodom.js b/lib/jsdom/browser/htmltodom.js
index <HASH>..<HASH> 100644
--- a/lib/jsdom/browser/htmltodom.js
+++ b/lib/jsdom/browser/htmltodom.js
@@ -173,7 +173,7 @@ function setChild(parent, node) {
try{
return parent.appendChild(newNode);
}catch(err){
- currentDocument.raise('error', err.name || err.message, {
+ currentDocument.raise('error', err.message, {
exception: err,
node : node
}); | FIX: Remove err.name, it is useless. | jsdom_jsdom | train | js |
3275a068e2ec98eb0e0c348f25991ea00355916c | diff --git a/src/actions/Action.php b/src/actions/Action.php
index <HASH>..<HASH> 100644
--- a/src/actions/Action.php
+++ b/src/actions/Action.php
@@ -193,6 +193,23 @@ class Action extends \yii\base\Action
}
/**
+ * Returns text for flash messages, search in parent actions.
+ * Used by [[addFlash()]]
+ *
+ * @param $type string
+ * @return string
+ */
+ public function getFlashText($type) {
+ if ($this->{$type}) {
+ return $this->{$type};
+ } elseif ($this->parent) {
+ return $this->parent->getFlashText($type);
+ }
+
+ return $type;
+ }
+
+ /**
* Adds flash message
*
* @param string $type the type of flash
@@ -203,7 +220,7 @@ class Action extends \yii\base\Action
if ($type == 'error' && is_string($error) && !empty($error)) {
$text = Yii::t('app', $error);
} else {
- $text = $this->{$type};
+ $text = $this->getFlashText($type);
}
if ($type instanceof \Closure) { | actions/Action - added getFlashText method | hiqdev_hipanel-core | train | php |
500c4f6f7c24a85270f9fce82636ca22360e7dba | diff --git a/lib/espn/mapper.rb b/lib/espn/mapper.rb
index <HASH>..<HASH> 100644
--- a/lib/espn/mapper.rb
+++ b/lib/espn/mapper.rb
@@ -127,6 +127,9 @@ module ESPN
elsif args.size == 1 && sport?(args[0])
sport ||= args[0]
league ||= ''
+ elsif !opts[:league].to_s.empty?
+ map = map_league_to_sport(opts[:league])
+ sport ||= map[:sport]
else
sport ||= args[0] || ''
league ||= args[1] || ''
diff --git a/spec/espn/mapper_spec.rb b/spec/espn/mapper_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/espn/mapper_spec.rb
+++ b/spec/espn/mapper_spec.rb
@@ -107,6 +107,11 @@ describe ESPN::Mapper do
results = @client.extract_sport_and_league(['mlb'], league: 'foo')
results.should eq(['baseball', 'foo'])
end
+
+ it 'should map the league to a sport' do
+ results = @client.extract_sport_and_league([], league: 'mlb')
+ results.should eq(['baseball', 'mlb'])
+ end
end
end | updates #extract_sport_and_league | andrewpthorp_espn | train | rb,rb |
3ff4fda08e0c976eb6903be917e0acc2c0e653b7 | diff --git a/src/lib/Key.js b/src/lib/Key.js
index <HASH>..<HASH> 100644
--- a/src/lib/Key.js
+++ b/src/lib/Key.js
@@ -74,7 +74,7 @@ class Key {
// Construct buffer
const data = new Nimiq.SerialBuffer(dataLength);
data.writeUint8(Key.MSG_PREFIX_LENGTH);
- data.write(Key.MSG_PREFIX);
+ data.write(new Nimiq.SerialBuffer(Nimiq.BufferUtils.fromAscii(Key.MSG_PREFIX)));
data.writeUint8(msgLength);
data.write(msgBytes);
@@ -145,5 +145,5 @@ class Key {
}
}
-Key.MSG_PREFIX = new Nimiq.SerialBuffer(Nimiq.BufferUtils.fromAscii('Nimiq Signed Message:\n'));
-Key.MSG_PREFIX_LENGTH = Key.MSG_PREFIX.byteLength;
+Key.MSG_PREFIX = 'Nimiq Signed Message: ';
+Key.MSG_PREFIX_LENGTH = 22; | Move Nimiq lib usage into a function, not globally | nimiq_keyguard-next | train | js |
919f9b522a26a9300b5322658ff6869e41ef1b0c | diff --git a/djangosaml2idp/views.py b/djangosaml2idp/views.py
index <HASH>..<HASH> 100644
--- a/djangosaml2idp/views.py
+++ b/djangosaml2idp/views.py
@@ -236,7 +236,7 @@ class SSOInitView(LoginRequiredMixin, IdPHandlerViewMixin, View):
sign_assertion = self.IDP.config.getattr("sign_assertion", "idp") or False
authn_resp = self.IDP.create_authn_response(
identity=identity,
- in_response_to="IdP_Initiated_Login",
+ in_response_to=None,
destination=destination,
sp_entity_id=sp_entity_id,
userid=user_id, | SAML fails when "InResponseTo" attribute is sent in the SAML response to Service Provider (such as Salesforce) (#<I>) | OTA-Insight_djangosaml2idp | train | py |
04962887dd35fdfce2c40d4390d2a7fbe5f70b47 | diff --git a/lib/simplecov/result.rb b/lib/simplecov/result.rb
index <HASH>..<HASH> 100644
--- a/lib/simplecov/result.rb
+++ b/lib/simplecov/result.rb
@@ -60,7 +60,7 @@ module SimpleCov
# Returns a hash representation of this Result that can be used for marshalling it into JSON
def to_hash
- {command_name => {"coverage" => original_result.reject { |filename, _| !filenames.include?(filename) }, "timestamp" => created_at.to_i}}
+ {command_name => {"coverage" => coverage, "timestamp" => created_at.to_i}}
end
# Loads a SimpleCov::Result#to_hash dump
@@ -74,6 +74,11 @@ module SimpleCov
private
+ def coverage
+ keys = original_result.keys & filenames
+ Hash[keys.zip(original_result.values_at(*keys))]
+ end
+
# Applies all configured SimpleCov filters on this result's source files
def filter!
@files = SimpleCov.filtered(files) | Fix an accidentally inefficient hash filter | colszowka_simplecov | train | rb |
f5bfa97f6ea0b79229c96fc28c740834e0c0f538 | diff --git a/{{cookiecutter.project_slug}}/config/settings/local.py b/{{cookiecutter.project_slug}}/config/settings/local.py
index <HASH>..<HASH> 100644
--- a/{{cookiecutter.project_slug}}/config/settings/local.py
+++ b/{{cookiecutter.project_slug}}/config/settings/local.py
@@ -69,8 +69,10 @@ if env("USE_DOCKER") == "yes":
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips]
+ {%- if cookiecutter.js_task_runner == 'Gulp' %}
_, _, ips = socket.gethostbyname_ex("node")
INTERNAL_IPS.extend(ips)
+ {%- endif %}
{%- endif %}
# django-extensions | Update {{cookiecutter.project_slug}}/config/settings/local.py | pydanny_cookiecutter-django | train | py |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.