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 |
|---|---|---|---|---|---|
37d3e5dff882254470a3d43b2f32ee05521592a4 | diff --git a/example/test.php b/example/test.php
index <HASH>..<HASH> 100644
--- a/example/test.php
+++ b/example/test.php
@@ -22,10 +22,9 @@ use PhpParser\ParserFactory;
)
));
$usedSymbols = (new LocateUsedSymbolsFromASTRoots())->__invoke($sourcesASTs($getPackageSourceFiles($composerJson)));
+ $unknownSymbols = array_diff($usedSymbols, $definedSymbols);
- var_dump([
- 'defined' => $definedSymbols,
- 'used' => $usedSymbols,
- 'unknown_symbols' => array_diff($usedSymbols, $definedSymbols),
- ]);
+ var_dump(['unknown_symbols' => $unknownSymbols]);
+
+ exit((bool) $unknownSymbols);
})(); | Exiting with status code 0 when no unknown symbols are found, 1 otherwise | maglnet_ComposerRequireChecker | train | php |
37ce4a373d63518169c027054a99dc8059f0335b | diff --git a/JUnit4InstrumentationTestRunner/src/com/uphyca/testing/ActivityInstrumentationTestCase2.java b/JUnit4InstrumentationTestRunner/src/com/uphyca/testing/ActivityInstrumentationTestCase2.java
index <HASH>..<HASH> 100644
--- a/JUnit4InstrumentationTestRunner/src/com/uphyca/testing/ActivityInstrumentationTestCase2.java
+++ b/JUnit4InstrumentationTestRunner/src/com/uphyca/testing/ActivityInstrumentationTestCase2.java
@@ -21,6 +21,7 @@ public abstract class ActivityInstrumentationTestCase2<T extends Activity> imple
_androidAnnotatedMethodRule = new AndroidAnnotatedMethodRule(_tester.getInstrumentation());
}
+ @Deprecated
public ActivityInstrumentationTestCase2(String pkg,
Class<T> activityClass) {
_tester = new ActivityInstrumentationTester2<T>(this, pkg, activityClass); | Annotated with @Deprecated to ActivityInstrumentationTestCase2(String,Class<T>) | esmasui_AndroidJUnit4 | train | java |
9e63ff0a9a75bc5e5cdd159681f562a6a9dc22c5 | diff --git a/src/commands/cd.js b/src/commands/cd.js
index <HASH>..<HASH> 100644
--- a/src/commands/cd.js
+++ b/src/commands/cd.js
@@ -1,5 +1,7 @@
function cd (env, args) {
- env.system.changeDir(args[0]).then(
+ var path = args[0] || '/home/' + env.system.state.user
+
+ env.system.changeDir(path).then(
env.exit,
function (errorMessage) {
env.error(errorMessage)
diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -147,6 +147,7 @@ function defaultState () {
lastEdited: Date.now()
}
},
+ user: 'username',
workingDirectory: '/home/username'
}
} | state.user and cd without arg | trybash_bash-emulator | train | js,js |
5c623fc80d42fc116398072b867075eae5a0a1c5 | diff --git a/lib/ikku/node.rb b/lib/ikku/node.rb
index <HASH>..<HASH> 100644
--- a/lib/ikku/node.rb
+++ b/lib/ikku/node.rb
@@ -36,7 +36,7 @@ module Ikku
case
when !first_of_phrase?
false
- when ["、", "・", " ", " "].include?(surface)
+ when pronounciation_length.zero?
false
else
true
diff --git a/spec/ikku/reviewer_spec.rb b/spec/ikku/reviewer_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/ikku/reviewer_spec.rb
+++ b/spec/ikku/reviewer_spec.rb
@@ -99,6 +99,14 @@ RSpec.describe Ikku::Reviewer do
it { is_expected.to be false }
end
+
+ context "with ikku starting with no pronounciation length node" do
+ let(:text) do
+ "「#{super()}"
+ end
+
+ it { is_expected.to be false }
+ end
end
describe "#search" do | Don't allow ikku starting with no pronounciation length node | r7kamura_ikku | train | rb,rb |
64ab6f66b502fe4bacbc21fe34e12a1dea6c998b | diff --git a/lib/rapidash.rb b/lib/rapidash.rb
index <HASH>..<HASH> 100644
--- a/lib/rapidash.rb
+++ b/lib/rapidash.rb
@@ -21,6 +21,5 @@ require "rapidash/test_client"
module Rapidash
mattr_accessor :response_exception_class
- class ParseError < StandardError; end
class ConfigurationError < StandardError; end
end | ParseError on longer raised anywhere, removing | Gazler_rapidash | train | rb |
128c9f4eb8048713ba5c6cf0dfc768a5b8473c60 | diff --git a/discord/channel.py b/discord/channel.py
index <HASH>..<HASH> 100644
--- a/discord/channel.py
+++ b/discord/channel.py
@@ -791,17 +791,7 @@ class CategoryChannel(discord.abc.GuildChannel, Hashable):
Editing the category failed.
"""
- try:
- position = options.pop('position')
- except KeyError:
- pass
- else:
- await self._move(position, reason=reason)
- self.position = position
-
- if options:
- data = await self._state.http.edit_channel(self.id, reason=reason, **options)
- self._update(self.guild, data)
+ await self._edit(options=options, reason=reason)
@property
def channels(self): | Use GuildChannel abc for CategoryChannel edit
I noticed nothing happened when I did
`ch.edit(overwrites=oh.overwrites)`
`http.edit_channel` doesn't do anything with the `overwrites` keyword,
it's processed as `permission_overwrites` instead which `self._edit`
takes care of.
I feel this was an oversight at some point. | Rapptz_discord.py | train | py |
61766e11098921c0df9f2bc4ba99339481a0597c | diff --git a/core/src/elements/base/base-input.js b/core/src/elements/base/base-input.js
index <HASH>..<HASH> 100755
--- a/core/src/elements/base/base-input.js
+++ b/core/src/elements/base/base-input.js
@@ -159,8 +159,4 @@ export default class BaseInputElement extends BaseElement {
get disabled() {
return this.hasAttribute('disabled');
}
-
- static get events() {
- return ['change', 'input', 'focus', 'focusin', 'focusout', 'blur'];
- }
} | refactor(base-input): Remove native events. | OnsenUI_OnsenUI | train | js |
9c12c1e39eeba96ce9f694bf31229b4ae4799f38 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -40,7 +40,7 @@ class ve_build_ext(build_ext):
def build_extension(self, ext):
try:
build_ext.build_extension(self, ext)
- except (CCompilerError, DistutilsExecError, DistutilsPlatformError):
+ except (CCompilerError, DistutilsExecError, DistutilsPlatformError, ValueError):
raise BuildFailed() | Enable extension skipping on Windows.
If the `vcvarsall.bat` cannot be found a `ValueError` is raised. | aio-libs_aiohttp | train | py |
795b908095b29e76435479879c1ade7ef759ce7b | diff --git a/src/core/vdom/patch.js b/src/core/vdom/patch.js
index <HASH>..<HASH> 100644
--- a/src/core/vdom/patch.js
+++ b/src/core/vdom/patch.js
@@ -120,7 +120,14 @@ export function createPatchFunction (backend) {
if (
!inPre &&
!vnode.ns &&
- !(config.ignoredElements.length && config.ignoredElements.indexOf(tag) > -1) &&
+ !(
+ config.ignoredElements.length &&
+ config.ignoredElements.some(ignore => {
+ return ignore instanceof RegExp
+ ? ignore.test(tag)
+ : ignore === tag
+ })
+ ) &&
config.isUnknownElement(tag)
) {
warn( | feat: support RegExp in ignoredElements (#<I>) | kaola-fed_megalo | train | js |
5a274a8aaa670f3821fee3bc5674390d6a2eb8db | diff --git a/hazelcast/src/main/java/com/hazelcast/map/impl/operation/MergeOperation.java b/hazelcast/src/main/java/com/hazelcast/map/impl/operation/MergeOperation.java
index <HASH>..<HASH> 100644
--- a/hazelcast/src/main/java/com/hazelcast/map/impl/operation/MergeOperation.java
+++ b/hazelcast/src/main/java/com/hazelcast/map/impl/operation/MergeOperation.java
@@ -106,6 +106,7 @@ public class MergeOperation extends BasePutOperation {
super.writeInternal(out);
out.writeObject(mergingEntry);
out.writeObject(mergePolicy);
+ out.writeBoolean(disableWanReplicationEvent);
}
@Override
@@ -113,5 +114,6 @@ public class MergeOperation extends BasePutOperation {
super.readInternal(in);
mergingEntry = in.readObject();
mergePolicy = in.readObject();
+ disableWanReplicationEvent = in.readBoolean();
}
} | MergeOperation.disableWanReplicationEvent is now serialized & deserialized | hazelcast_hazelcast | train | java |
3b533dcbd8d025bb0707a7e9b920b53a855a983a | diff --git a/selendroid-server/src/main/java/io/selendroid/server/model/DefaultSelendroidDriver.java b/selendroid-server/src/main/java/io/selendroid/server/model/DefaultSelendroidDriver.java
index <HASH>..<HASH> 100644
--- a/selendroid-server/src/main/java/io/selendroid/server/model/DefaultSelendroidDriver.java
+++ b/selendroid-server/src/main/java/io/selendroid/server/model/DefaultSelendroidDriver.java
@@ -504,6 +504,7 @@ public class DefaultSelendroidDriver implements SelendroidDriver {
} else {
selendroidWebDriver.get(url);
}
+ getSession().getKnownElements().clear();
}
public boolean isNativeWindowMode() { | avoiding references to previous screen elements. | selendroid_selendroid | train | java |
1f1352ef30dd5416a7fe5bc782fe433cedbf1d91 | diff --git a/src/Responder.php b/src/Responder.php
index <HASH>..<HASH> 100644
--- a/src/Responder.php
+++ b/src/Responder.php
@@ -167,7 +167,7 @@ class Responder
private function makeListener(): \Closure
{
$callbackListener = function () {
- if (! $this->passes()) {
+ if ($this->passes()) {
respondWith($this->response);
}
};
diff --git a/src/YouShouldHave.php b/src/YouShouldHave.php
index <HASH>..<HASH> 100644
--- a/src/YouShouldHave.php
+++ b/src/YouShouldHave.php
@@ -16,7 +16,7 @@ class YouShouldHave
public function youShouldPassGate($gate, ...$args)
{
$this->predicate = function () use ($gate, $args) {
- return Gate::denies($gate, $args);
+ return Gate::allows($gate, $args);
};
return new BeCareful();
@@ -25,7 +25,7 @@ class YouShouldHave
public function youShouldBeGuest()
{
$this->predicate = function () {
- return ! auth()->guest();
+ return auth()->guest();
};
return new BeCareful(); | refactor for less nagations | imanghafoori1_laravel-heyman | train | php,php |
7f378234c5e8733747f98e3bf406f143e36fd72a | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -123,8 +123,8 @@ def run_setup(with_compilation):
],
install_requires=[
- "scipy >= 0.13.0",
- "numpy >= 1.7.0",
+ "scipy >= 0.9.0",
+ "numpy >= 1.6.1"
],
extras_require = { | Fixed over-optimistic dependency declarations that cause the Travis CI build to crash. | loli_medpy | train | py |
eb25b3d1c80f791874fbf76b0b9b37a15860341c | diff --git a/dbt/compilation.py b/dbt/compilation.py
index <HASH>..<HASH> 100644
--- a/dbt/compilation.py
+++ b/dbt/compilation.py
@@ -22,6 +22,8 @@ def compile_string(string, ctx):
return template.render(ctx)
except jinja2.exceptions.TemplateSyntaxError as e:
compiler_error(None, str(e))
+ except jinja2.exceptions.UndefinedError as e:
+ compiler_error(None, str(e))
class Compiler(object):
def __init__(self, project, create_template_class, args):
diff --git a/dbt/model.py b/dbt/model.py
index <HASH>..<HASH> 100644
--- a/dbt/model.py
+++ b/dbt/model.py
@@ -354,6 +354,8 @@ class Model(DBTSource):
return template.render(ctx)
except jinja2.exceptions.TemplateSyntaxError as e:
compiler_error(self, str(e))
+ except jinja2.exceptions.UndefinedError as e:
+ compiler_error(self, str(e))
def get_hooks(self, ctx, hook_key):
hooks = self.config.get(hook_key, []) | nice error messages for undefined vars in hook compilation | fishtown-analytics_dbt | train | py,py |
ddf60992b60b235961cfac06c6611e5aa6f6bc25 | diff --git a/session_security/static/session_security/script.js b/session_security/static/session_security/script.js
index <HASH>..<HASH> 100644
--- a/session_security/static/session_security/script.js
+++ b/session_security/static/session_security/script.js
@@ -37,6 +37,7 @@ yourlabs.SessionSecurity = function(options) {
if (this.confirmFormDiscard) {
window.onbeforeunload = $.proxy(this.onbeforeunload, this);
$(document).on('change', ':input', $.proxy(this.formChange, this));
+ $(document).on('submit', 'form', $.proxy(this.formSubmit, this));
}
}
@@ -128,5 +129,11 @@ yourlabs.SessionSecurity.prototype = {
// When an input change, set data-dirty attribute on its form.
formChange: function(e) {
$(e.target).closest('form').attr('data-dirty', true);
- }
+ },
+
+ // When a form is submited, unset data-dirty attribute.
+ formSubmit: function(e) {
+ console.log($(e.target))
+ $(e.target).removeAttr('data-dirty');
+ },
} | Unset data-dirty on form submit, to prevent onbeforeunload. | yourlabs_django-session-security | train | js |
14f44690bc48ba4cb699113dc8f80630a0a022e5 | diff --git a/src/Ractive/static/adaptors/array/patch.js b/src/Ractive/static/adaptors/array/patch.js
index <HASH>..<HASH> 100644
--- a/src/Ractive/static/adaptors/array/patch.js
+++ b/src/Ractive/static/adaptors/array/patch.js
@@ -36,7 +36,8 @@ mutatorMethods.forEach( methodName => {
};
defineProperty( patchedArrayProto, methodName, {
- value: method
+ value: method,
+ configurable: true
});
}); | allow array adaptor prototype overrides to be overridden - closes #<I> | ractivejs_ractive | train | js |
717b4c2f766bc16212136cf83375244520f43b7f | diff --git a/findiff/findiff.py b/findiff/findiff.py
index <HASH>..<HASH> 100644
--- a/findiff/findiff.py
+++ b/findiff/findiff.py
@@ -178,6 +178,8 @@ class Coef(object):
def __init__(self, value):
self.value = value
+# Alias for backward compatibility
+Coefficient = Coef
class Identity(FinDiff):
diff --git a/test/test_findiff.py b/test/test_findiff.py
index <HASH>..<HASH> 100644
--- a/test/test_findiff.py
+++ b/test/test_findiff.py
@@ -6,7 +6,7 @@ from findiff.findiff import FinDiff, Coef, Identity
class FinDiffTest(unittest.TestCase):
- def test_partial_diff_1d(self):
+ def test_partial_diff(self):
nx = 100
x = np.linspace(0, np.pi, nx)
u = np.sin(x) | Adjustments for non-breaking API. | maroba_findiff | train | py,py |
a60c87e16c44cf584d06d43b4e8a8eb48bc20ceb | diff --git a/packages/artifacts/artifact-dependency-graph/test/unit/artifact-dependency-graph.test.js b/packages/artifacts/artifact-dependency-graph/test/unit/artifact-dependency-graph.test.js
index <HASH>..<HASH> 100644
--- a/packages/artifacts/artifact-dependency-graph/test/unit/artifact-dependency-graph.test.js
+++ b/packages/artifacts/artifact-dependency-graph/test/unit/artifact-dependency-graph.test.js
@@ -95,8 +95,12 @@ describe('artifact-dependency-graph', function() {
const forest = {a: [], b: ['a'], c: ['b'], d: ['c', 'a'], e: ['b'], f: ['e', 'c']}
expect(dependencyGraphSubsetToBuild(forest, {
- justBuildArtifacts: ['f', 'e'],
- })).to.eql({f: ['e'], e: []})
+ justBuildArtifacts: ['f', 'e', 'a'],
+ // the 'a' build in the result is a little problematic, because in terms of build order
+ // nothing here tells it to be earlier than e and f which depend on it.
+ // It's definitely a bug, but since justBuild is usually used for one focus artifact,
+ // that shouldn't be too problematic a bug
+ })).to.eql({f: ['e'], e: [], a: []})
})
it('should not ignore changedArtifacts', () => { | adg: added test with bug in justBuild. A bug which we can live with | giltayar_bilt | train | js |
a8fd49732328d4468107253da4c1dd5e7f394d2f | diff --git a/commands/orgs/open.js b/commands/orgs/open.js
index <HASH>..<HASH> 100644
--- a/commands/orgs/open.js
+++ b/commands/orgs/open.js
@@ -5,7 +5,9 @@ let co = require('co')
const {flags} = require('cli-engine-heroku')
function * run (context, heroku) {
- let org = yield heroku.get(`/organizations/${context.org || context.team || context.flags.team}`)
+ let team = context.org || context.team || context.flags.team
+ if (!team) throw new Error('No organization specified')
+ let org = yield heroku.get(`/organizations/${team}`)
yield cli.open(`https://dashboard.heroku.com/orgs/${org.name}`)
}
@@ -15,7 +17,7 @@ module.exports = {
description: 'open the organization interface in a browser window',
needsAuth: true,
flags: [
- flags.org({name: 'org', hasValue: true, description: 'org to use', hidden: false, required: true}),
+ flags.org({name: 'org', hasValue: true, description: 'org to use', hidden: false}),
flags.team({name: 'team', hasValue: true, hidden: true})
],
run: cli.command(co.wrap(run)) | Check --team before erroring (#<I>) | heroku_heroku-orgs | train | js |
e47935fec8040e09318bcfb6a433451233436367 | diff --git a/ricecooker/config.py b/ricecooker/config.py
index <HASH>..<HASH> 100644
--- a/ricecooker/config.py
+++ b/ricecooker/config.py
@@ -8,9 +8,11 @@ import os
import requests
from requests_file import FileAdapter
import shutil
+import socket
import tempfile
+
UPDATE = False
COMPRESS = False
THUMBNAILS = False
@@ -19,9 +21,14 @@ PROGRESS_MANAGER = None
SUSHI_BAR_CLIENT = None
STAGE = False
-# Don't use this - call logging.getLogger(__name__) from each
-# individual module. Logging is configured centrally by calling
-# setup_logging()
+# Sometimes chef runs will get stuck indefinitely waiting on data from SSL conn,
+# so we add a timeout value as suggested in https://stackoverflow.com/a/30771995
+socket.setdefaulttimeout(20)
+
+
+# Logging is configured globally by calling setup_logging() in the chef's `main`
+# Use this as `from ricecooker.config import LOGGER` in your suchichef.py code,
+# or use the stanard `logging.getLogger(__name__)` to get a namespaced logger.
LOGGER = logging.getLogger()
@@ -119,7 +126,8 @@ def setup_logging(level=logging.INFO, main_log=None, error_log=None, add_loggers
logging.getLogger("PIL.PngImagePlugin").setLevel(logging.WARNING)
-# Setup default logging - can be called again to reconfigure
+# Setup default logging. This is required so we have a basic logging setup until
+# prope user-confgured logging is configured in `BaseChef.config_logger`.
setup_logging() | Add socket timeout <I> sec to avoid chef getting stuck | learningequality_ricecooker | train | py |
4172128abbbb1a40b34a4067228ef84821a89108 | diff --git a/yamt/parser.py b/yamt/parser.py
index <HASH>..<HASH> 100644
--- a/yamt/parser.py
+++ b/yamt/parser.py
@@ -24,7 +24,6 @@ def old_parser(text):
code = []
lexer = shlex.shlex(line[1:])
tokens = [token for token in lexer]
- print tokens
found = False
found_interpreter = False
for token in tokens: | Removed unneeded print statement in old parser. | hmartiniano_faz | train | py |
a7dd7668234a90568ea042bfadde9ccd34831f18 | diff --git a/search-suggest/src/main/java/com/meltmedia/cadmium/search/suggest/SuggestSearchPreprocessor.java b/search-suggest/src/main/java/com/meltmedia/cadmium/search/suggest/SuggestSearchPreprocessor.java
index <HASH>..<HASH> 100644
--- a/search-suggest/src/main/java/com/meltmedia/cadmium/search/suggest/SuggestSearchPreprocessor.java
+++ b/search-suggest/src/main/java/com/meltmedia/cadmium/search/suggest/SuggestSearchPreprocessor.java
@@ -37,7 +37,7 @@ public class SuggestSearchPreprocessor implements SearchPreprocessor, SuggesterP
logger.info("Pulling out suggested search terms.");
Dictionary dictionary = new LuceneDictionary(reader, field);
- AnalyzingSuggester suggester = new FuzzySuggester(analyzer);
+ AnalyzingSuggester suggester = new AnalyzingSuggester(analyzer);
suggester.build(dictionary);
stagedSuggester = suggester;
} | changed fuzzy suggester to analyzing suggester | meltmedia_cadmium | train | java |
40401d0f771113e76d21f38aeb8278886721a300 | diff --git a/src/View/View.php b/src/View/View.php
index <HASH>..<HASH> 100644
--- a/src/View/View.php
+++ b/src/View/View.php
@@ -101,7 +101,7 @@ class View implements ViewInterface, \JsonSerializable
*/
public function __sleep()
{
- return ['baseUrl', 'data', 'system', 'path', 'template'];
+ return ['baseUrl', 'data', 'path', 'template'];
}
/** | Fixed __sleep for View | bluzphp_framework | train | php |
61bec93ba1018ce2e40a54901d336a5303c754a7 | diff --git a/salt/returners/appoptics_return.py b/salt/returners/appoptics_return.py
index <HASH>..<HASH> 100644
--- a/salt/returners/appoptics_return.py
+++ b/salt/returners/appoptics_return.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
"""Salt returner to return highstate stats to AppOptics Metrics
To enable this returner the minion will need the AppOptics Metrics
@@ -70,17 +69,12 @@ the name of the state that was invoked, e.g. ``role_salt_master.netapi``.
"""
-# Import python libs
-from __future__ import absolute_import, print_function, unicode_literals
import logging
import salt.returners
-
-# Import Salt libs
import salt.utils.jid
-# Import third party libs
try:
import appoptics_metrics
@@ -183,7 +177,7 @@ def _state_metrics(ret, options, tags):
log.debug(
"Batching with Metric total states {}".format(
- (stats["num_failed_states"] + stats["num_passed_states"])
+ stats["num_failed_states"] + stats["num_passed_states"]
)
)
q.add( | Run pre-commit on changed files | saltstack_salt | train | py |
a121af943957da46d60e42afbeea7fcade51fea7 | diff --git a/js/gdax.js b/js/gdax.js
index <HASH>..<HASH> 100644
--- a/js/gdax.js
+++ b/js/gdax.js
@@ -487,7 +487,9 @@ module.exports = class gdax extends Exchange {
if (body[0] == "{") {
let response = JSON.parse (body);
let message = response['message'];
- if (message.indexOf ('price too precise') >= 0) {
+ if (message.indexOf ('price too small') >= 0) {
+ throw new InvalidOrder (this.id + ' ' + message);
+ } else if (message.indexOf ('price too precise') >= 0) {
throw new InvalidOrder (this.id + ' ' + message);
} else if (message == 'Invalid API Key') {
throw new AuthenticationError (this.id + ' ' + message); | GDAX order price too small ExchangeNotAvailable → InvalidOrder (ExchangeError) #<I> | ccxt_ccxt | train | js |
5ce9393e9baa089d3a3d6d8cce40a35b0e54aee1 | diff --git a/src/Namshi/JOSE/Signer/OpenSSL/HMAC.php b/src/Namshi/JOSE/Signer/OpenSSL/HMAC.php
index <HASH>..<HASH> 100644
--- a/src/Namshi/JOSE/Signer/OpenSSL/HMAC.php
+++ b/src/Namshi/JOSE/Signer/OpenSSL/HMAC.php
@@ -13,7 +13,7 @@ abstract class HMAC implements SignerInterface
*/
public function sign($input, $key)
{
- return hash_hmac($this->getHashingAlgorithm(), $input, $key, true);
+ return hash_hmac($this->getHashingAlgorithm(), $input, (string) $key, true);
}
/** | fixed hash_hmac invocation, casting bool to string | namshi_jose | train | php |
fab0f46a5cc28aa091e1bdff4f20c150d1f5c428 | diff --git a/bigtable-hbase-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters/read/FlatRowAdapter.java b/bigtable-hbase-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters/read/FlatRowAdapter.java
index <HASH>..<HASH> 100644
--- a/bigtable-hbase-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters/read/FlatRowAdapter.java
+++ b/bigtable-hbase-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters/read/FlatRowAdapter.java
@@ -45,7 +45,8 @@ public class FlatRowAdapter implements ResponseAdapter<FlatRow, Result> {
*/
@Override
public Result adaptResponse(FlatRow flatRow) {
- if (flatRow == null) {
+ // flatRow shouldn't ever have a null row key. The second check is defensive only.
+ if (flatRow == null || flatRow.getRowKey() == null) {
return Result.EMPTY_RESULT;
}
byte[] RowKey = ByteStringer.extract(flatRow.getRowKey()); | Minor fix to FlatRowAdapter to check for empty flatrows. (#<I>)
* Minor fix to FlatRowAdapter to check for empty flatrows.
* Update FlatRowAdapter.java | googleapis_cloud-bigtable-client | train | java |
68ec4b3d1e363ef1d398c0b843cf7e7e16c5a655 | diff --git a/src/Models/Agent.php b/src/Models/Agent.php
index <HASH>..<HASH> 100644
--- a/src/Models/Agent.php
+++ b/src/Models/Agent.php
@@ -31,15 +31,20 @@ class Agent extends User
if ($cat_id == null)
return $query->where('ticketit_agent', '1')->lists('name', 'id')->toArray();
- return Category::find($cat_id)->agents->lists('name', 'id')->toArray();
+ return Category::find($cat_id)->agents->where('ticketit_agent', '1')->lists('name', 'id')->toArray();
}
/**
* Check if user is agent
* @return boolean
*/
- public static function isAgent()
+ public static function isAgent($id = null)
{
+ if (isset($id)) {
+ $user = User::find($id);
+ if ($user->ticketit_agent) return true;
+ return false;
+ }
if (Auth::check()) {
if (\Auth::user()->ticketit_agent) return true;
} | Fixed bug #<I> .. check before returning category agents that they are still agents | thekordy_ticketit | train | php |
e36960345d1a305e20ea8e8c5ebfb12d0f4bb6f3 | diff --git a/lib/nio/selector.rb b/lib/nio/selector.rb
index <HASH>..<HASH> 100644
--- a/lib/nio/selector.rb
+++ b/lib/nio/selector.rb
@@ -18,7 +18,9 @@ module NIO
# * :rw - is the IO either readable or writeable?
def register(io, interest)
@lock.synchronize do
- raise ArgumentError, "this IO is already registered with the selector" if @selectables[io]
+ if monitor = @selectables[io]
+ raise ArgumentError, "this IO is already registered with the selector as #{monitor.interests.inspect}"
+ end
monitor = Monitor.new(io, interest, self)
@selectables[io] = monitor | Add the existing monitor interests to the exception | socketry_nio4r | train | rb |
b9fa5e4e2977021cd7c7136dbc8d70086ad0ba80 | diff --git a/tests/unit/states/environ_test.py b/tests/unit/states/environ_test.py
index <HASH>..<HASH> 100644
--- a/tests/unit/states/environ_test.py
+++ b/tests/unit/states/environ_test.py
@@ -1,5 +1,9 @@
# -*- coding: utf-8 -*-
+# Import python libs
+from __future__ import absolute_import
+import os
+
# Import Salt Testing libs
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
@@ -9,8 +13,18 @@ ensure_in_syspath('../../')
import salt.states.environ as envstate
import salt.modules.environ as envmodule
+setup_env = {}
+
class TestEnvironState(TestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ setup_env = os.environ
+
+ @classmethod
+ def tearDownClass(cls):
+ os.environ = setup_env
def setUp(self):
envstate.__env__ = 'base' | Reset env at end of test | saltstack_salt | train | py |
4220e562ecda144c611de91351bf1bffe39a76fe | diff --git a/src/qinfer/smc.py b/src/qinfer/smc.py
index <HASH>..<HASH> 100644
--- a/src/qinfer/smc.py
+++ b/src/qinfer/smc.py
@@ -74,7 +74,7 @@ try:
import mpltools.special as mpls
except:
# Don't even warn in this case.
- pass
+ mpls = None
## LOGGING #################################################################### | Fixed bug in smc.py when Hinton plots are made and Mpltools are missing. | QInfer_python-qinfer | train | py |
a5c7d93314fc1ef21335abde170a791c7a5fb4c3 | diff --git a/hypervisor/qemu/qemu.go b/hypervisor/qemu/qemu.go
index <HASH>..<HASH> 100644
--- a/hypervisor/qemu/qemu.go
+++ b/hypervisor/qemu/qemu.go
@@ -180,13 +180,13 @@ func (qc *QemuContext) arguments(ctx *hypervisor.VmContext) []string {
} else if boot.Bios != "" {
params = append(params,
"-bios", boot.Bios,
- "-kernel", boot.Kernel, "-initrd", boot.Initrd, "-append", "\"console=ttyS0 panic=1\"")
+ "-kernel", boot.Kernel, "-initrd", boot.Initrd, "-append", "\"console=ttyS0 panic=1 no_timer_check\"")
} else if boot.Cbfs != "" {
params = append(params,
"-drive", fmt.Sprintf("if=pflash,file=%s,readonly=on", boot.Cbfs))
} else {
params = append(params,
- "-kernel", boot.Kernel, "-initrd", boot.Initrd, "-append", "\"console=ttyS0 panic=1\"")
+ "-kernel", boot.Kernel, "-initrd", boot.Initrd, "-append", "\"console=ttyS0 panic=1 no_timer_check\"")
}
return append(params, | fix possible kernel panic on qemu guest | hyperhq_runv | train | go |
1204ca43fdfc2d0740a46bb86fbee17b0e0495b1 | diff --git a/src/Traits/Historable.php b/src/Traits/Historable.php
index <HASH>..<HASH> 100644
--- a/src/Traits/Historable.php
+++ b/src/Traits/Historable.php
@@ -4,6 +4,7 @@ namespace TypiCMS\Modules\History\Traits;
use Illuminate\Database\Eloquent\Model;
use TypiCMS\Modules\History\Models\History;
+use TypiCMS\Modules\History\Repositories\EloquentHistory;
trait Historable
{
@@ -59,6 +60,12 @@ trait Historable
*/
public function writeHistory($action, $title = null, array $old = [], array $new = [])
{
+ $dirty = $this->getDirty();
+ unset($dirty['updated_at']);
+ unset($dirty['remember_token']);
+ if (!count($dirty)) {
+ return;
+ }
$data['historable_id'] = $this->getKey();
$data['historable_type'] = get_class($this);
$data['user_id'] = auth()->id();
@@ -68,7 +75,7 @@ trait Historable
$data['action'] = $action;
$data['old'] = $old;
$data['new'] = $new;
- History::create($data);
+ (new EloquentHistory)->create($data);
}
/** | no history when only updated_at or remember_token changed | TypiCMS_History | train | php |
1ec9c16ba1f27a72a72e38007204c5c804a98b8a | diff --git a/varlink/__init__.py b/varlink/__init__.py
index <HASH>..<HASH> 100644
--- a/varlink/__init__.py
+++ b/varlink/__init__.py
@@ -567,7 +567,10 @@ class Service:
if not cont:
return
except ConnectionError as e:
- out.throw(e)
+ try:
+ out.throw(e)
+ except StopIteration:
+ pass
else:
yield {'parameters': out or {}}
@@ -589,8 +592,15 @@ class Service:
if message[-1] == 0:
message = message[:-1]
- for out in self._handle(json.loads(message)):
- yield json.dumps(out, cls=VarlinkEncoder).encode('utf-8')
+ handle = self._handle(json.loads(message))
+ for out in handle:
+ try:
+ yield json.dumps(out, cls=VarlinkEncoder).encode('utf-8')
+ except ConnectionError as e:
+ try:
+ handle.throw(e)
+ except StopIteration:
+ pass
def _add_interface(self, filename, handler):
if not os.path.isabs(filename): | varlink: propagate Exceptions up to the service | varlink_python | train | py |
a3f24b8468ade6ec5d08a5c8c3a0f8905aa7d70f | diff --git a/aston/Math/Chromatograms.py b/aston/Math/Chromatograms.py
index <HASH>..<HASH> 100644
--- a/aston/Math/Chromatograms.py
+++ b/aston/Math/Chromatograms.py
@@ -125,8 +125,8 @@ def savitzkygolay(ts, window, order):
# precompute coefficients
b = [[k ** i for i in order_range] \
for k in range(-half_wind, half_wind + 1)]
- m = np.linalg.pinv(b)[0]
- return TimeSeries(_smooth(ts.data, m), ts.times)
+ m = np.linalg.pinv(b)[int(deriv)]
+ return TimeSeries(_smooth(ts.data, m), ts.times, ts.ions)
def _smooth(ic, m): | Fixed bug in savitzkygolay. | bovee_Aston | train | py |
6bc9bc66442d16abb11dc4fcd48bfc7c06efb923 | diff --git a/spec/fog/bin/aws_spec.rb b/spec/fog/bin/aws_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/fog/bin/aws_spec.rb
+++ b/spec/fog/bin/aws_spec.rb
@@ -10,7 +10,7 @@ describe AWS do
KEY_CLASS_MAPPING = {
:auto_scaling => Fog::AWS::AutoScaling,
:beanstalk => Fog::AWS::ElasticBeanstalk,
- :cdn => Fog::CDN::AWS,
+ :cdn => Fog::AWS::CDN,
:cloud_formation => Fog::AWS::CloudFormation,
:cloud_watch => Fog::AWS::CloudWatch,
:compute => Fog::Compute::AWS, | fix AWS CDN reference in bin tests | fog_fog | train | rb |
ba05319b57bb0f11255c6bd5f4a0139c3aa2de4c | diff --git a/ui/src/alerts/components/AlertsTable.js b/ui/src/alerts/components/AlertsTable.js
index <HASH>..<HASH> 100644
--- a/ui/src/alerts/components/AlertsTable.js
+++ b/ui/src/alerts/components/AlertsTable.js
@@ -269,7 +269,7 @@ class SearchBar extends Component {
<input
type="text"
className="form-control"
- placeholder="Filter Alerts by Name..."
+ placeholder="Filter Alerts..."
onChange={this.handleChange}
value={this.state.searchTerm}
/> | Update alerts filter text to be more accurate | influxdata_influxdb | train | js |
58f4b7d3208d36152d9df90ec4075817a5a02856 | diff --git a/app/models/MissionLocal.php b/app/models/MissionLocal.php
index <HASH>..<HASH> 100644
--- a/app/models/MissionLocal.php
+++ b/app/models/MissionLocal.php
@@ -99,10 +99,10 @@ class MissionLocal extends CMissionLocal{
}
public static function insertGetId2($xml,$data,$groupId=null){
//echo '<pre>'.print_r($data->attributes,true).'</pre>';
- echo '<pre>'.print_r($xml,true).'</pre>';
+ //echo '<pre>'.print_r($xml,true).'</pre>';
//delete old data
- self::deleteAll(['scene_id'=>$data->scene_id]);
+ //self::deleteAll(['scene_id'=>$data->scene_id]);
//import
if(is_object($xml)){ | disable delete old data all before import. | prawee_yii2-grid | train | php |
6fd325847d0a38c373fb540adc2798d700c2494a | diff --git a/openquake/calculators/risk/general.py b/openquake/calculators/risk/general.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/risk/general.py
+++ b/openquake/calculators/risk/general.py
@@ -520,7 +520,7 @@ class EpsilonProvider(object):
self.rnd = random.Random()
eps_rnd_seed = params.get("EPSILON_RANDOM_SEED")
if eps_rnd_seed is not None:
- self.rnd.seed(eps_rnd_seed)
+ self.rnd.seed(int(eps_rnd_seed))
def epsilon(self, asset):
"""Sample from the standard normal distribution for the given asset. | Cast the epislon seed to an int | gem_oq-engine | train | py |
c965610addb3b153994c81da90b77094668b3ac8 | diff --git a/nbdiff/commands.py b/nbdiff/commands.py
index <HASH>..<HASH> 100644
--- a/nbdiff/commands.py
+++ b/nbdiff/commands.py
@@ -109,5 +109,16 @@ def merge():
else:
from .server.local_server import app
app.pre_merged_notebook = pre_merged_notebook
+
+ def save_notebook(notebook_result):
+ import json
+ parsed = json.loads(notebook_result)
+ with open(filename, 'w') as targetfile:
+ targetfile.write(json.dumps(parsed, indent=2))
+ f = open(filename)
+ for line in f:
+ print(line)
+
+ app.shutdown = save_notebook
+
app.run(debug=True)
- open(filename, 'w').write(json.dumps(app.notebook_result, indent=2))
diff --git a/nbdiff/server/local_server.py b/nbdiff/server/local_server.py
index <HASH>..<HASH> 100644
--- a/nbdiff/server/local_server.py
+++ b/nbdiff/server/local_server.py
@@ -30,6 +30,7 @@ def home():
def notebookjson():
if request.method == 'PUT':
app.notebook_result = request.data
+ app.shutdown(request.data)
request.environ.get('werkzeug.server.shutdown')()
return ""
else: | Fix. Added save_notebook() to commands.py | tarmstrong_nbdiff | train | py,py |
a7dfc114c2f10d5fb0b442fd21ee94dc678e227e | diff --git a/packages/themes/src/g10.js b/packages/themes/src/g10.js
index <HASH>..<HASH> 100644
--- a/packages/themes/src/g10.js
+++ b/packages/themes/src/g10.js
@@ -8,7 +8,7 @@ import { adjustLightness } from './tools';
import {
// Blue
- blue20,
+ blue10,
blue40,
blue60,
blue70,
@@ -124,7 +124,7 @@ export const disabled01 = white;
export const disabled02 = gray30;
export const disabled03 = gray50;
-export const highlight = blue20;
+export const highlight = blue10;
export const decorative01 = gray20; | fix(themes): correct color for highlight token in g<I> theme (#<I>) | carbon-design-system_carbon-components | train | js |
b2f0b34d28fa7611b58037b6d7a8723e82f910e0 | diff --git a/lib/roxml.rb b/lib/roxml.rb
index <HASH>..<HASH> 100644
--- a/lib/roxml.rb
+++ b/lib/roxml.rb
@@ -1,5 +1,6 @@
require 'uri'
require 'active_support'
+require 'active_support/core_ext/string/starts_ends_with'
require 'roxml/definition'
require 'roxml/xml' | Fixed undefined method error for Rails 3 and Ruby <I> | Empact_roxml | train | rb |
032b89d6be097fc4d5ecbaf8c7465e351ab896ee | diff --git a/odl/discr/grid.py b/odl/discr/grid.py
index <HASH>..<HASH> 100644
--- a/odl/discr/grid.py
+++ b/odl/discr/grid.py
@@ -1200,9 +1200,11 @@ def uniform_sampling_fromintv(intv_prod, num_nodes, nodes_on_bdry=True):
if np.shape(nodes_on_bdry) == ():
nodes_on_bdry = ([(bool(nodes_on_bdry), bool(nodes_on_bdry))] *
intv_prod.ndim)
+ elif intv_prod.ndim == 1 and len(nodes_on_bdry) == 2:
+ nodes_on_bdry = [nodes_on_bdry]
elif len(nodes_on_bdry) != intv_prod.ndim:
- raise ValueError('nodes_on_bdry has length {}, expected {}.'
- ''.format(len(nodes_on_bdry), intv_prod.ndim, 2))
+ raise ValueError('`nodes_on_bdry` has length {}, expected {}.'
+ ''.format(len(nodes_on_bdry), intv_prod.ndim))
else:
num_nodes = tuple(int(n) for n in num_nodes) | ENH: allow single tuple for nodes_on_bdry in uniform_sampling for 1d | odlgroup_odl | train | py |
8944192b9b0d1c8988e3835d81ce7d60fff9ec16 | diff --git a/firenado/tornadoweb.py b/firenado/tornadoweb.py
index <HASH>..<HASH> 100644
--- a/firenado/tornadoweb.py
+++ b/firenado/tornadoweb.py
@@ -161,6 +161,7 @@ class TornadoComponent(object):
an application or something that can be distributed as an add-on or a
plugin.
"""
+
def __init__(self, name, application):
self.name = name
self.application = application
@@ -272,7 +273,7 @@ class TornadoHandler(tornado.web.RequestHandler):
:return: bool True is current user is set
"""
- return self.current_user is not None;
+ return self.current_user is not None
def is_mobile(self):
from .util import browser | Removed semicolon from the code. | candango_firenado | train | py |
41971d3524d39e16470a7651ed62c10f7469edda | diff --git a/settings.js b/settings.js
index <HASH>..<HASH> 100644
--- a/settings.js
+++ b/settings.js
@@ -13,6 +13,17 @@ function generate(){
"type": "custom",
"tokenizer": "whitespace",
"filter": "lowercase"
+ },
+ "pelias": {
+ "type": "custom",
+ "tokenizer": "lowercase",
+ "filter": ["unique", "synonym"]
+ }
+ },
+ "filter" : {
+ "synonym" : {
+ "type" : "synonym",
+ "synonyms_path" : "analysis/synonyms.txt"
}
}
},
@@ -35,4 +46,4 @@ function generate(){
return settings;
}
-module.exports = generate;
\ No newline at end of file
+module.exports = generate; | adds custom analyzer including synonyms | pelias_schema | train | js |
e82e29b7d896b7c1b5db1fb2f53f681ae64e8ea8 | diff --git a/spdx/file.py b/spdx/file.py
index <HASH>..<HASH> 100644
--- a/spdx/file.py
+++ b/spdx/file.py
@@ -22,6 +22,13 @@ class FileType(object):
BINARY = 2
ARCHIVE = 3
OTHER = 4
+ APPLICATION = 5
+ AUDIO = 6
+ IMAGE = 7
+ TEXT = 8
+ VIDEO = 9
+ DOCUMENTATION = 9
+ SPDX = 10
@total_ordering | Added missing FileType values allowed by spec | spdx_tools-python | train | py |
9efc5d9916c758767c3a7a84fa415bdffefdb0b8 | diff --git a/src/conference_scheduler/lp_problem/constraints.py b/src/conference_scheduler/lp_problem/constraints.py
index <HASH>..<HASH> 100644
--- a/src/conference_scheduler/lp_problem/constraints.py
+++ b/src/conference_scheduler/lp_problem/constraints.py
@@ -45,7 +45,7 @@ def _events_in_session_share_a_tag(events, slots, X, summation_type=None):
for session in session_indices:
slots = lpu._slots_in_session(session, session_array)
for slot, event in it.product(slots, event_indices):
- if events[event].tags != []:
+ if events[event].tags != ():
other_events = lpu._events_with_diff_tag(event, tag_array)
for other_slot, other_event in it.product(slots, other_events):
if other_slot != slot and other_event != event: | [#<I>] Amend tag constraint to check for empty tuple rather than list | PyconUK_ConferenceScheduler | train | py |
4dd18132dfd933df4cdc304aff3567d0672b810c | diff --git a/generated/google/apis/youtube_v3.rb b/generated/google/apis/youtube_v3.rb
index <HASH>..<HASH> 100644
--- a/generated/google/apis/youtube_v3.rb
+++ b/generated/google/apis/youtube_v3.rb
@@ -26,7 +26,7 @@ module Google
# @see https://developers.google.com/youtube/v3
module YoutubeV3
VERSION = 'V3'
- REVISION = '20180308'
+ REVISION = '20180413'
# Manage your YouTube account
AUTH_YOUTUBE = 'https://www.googleapis.com/auth/youtube' | Autogenerated update (<I>-<I>-<I>)
Update:
- youtube_v3 | googleapis_google-api-ruby-client | train | rb |
578c2e354ef0762eaec6d77e9020a14103dc3f45 | diff --git a/xwiki-commons-core/xwiki-commons-filter/xwiki-commons-filter-api/src/test/java/org/xwiki/filter/internal/AbstractFilterDescriptorManagerTest.java b/xwiki-commons-core/xwiki-commons-filter/xwiki-commons-filter-api/src/test/java/org/xwiki/filter/internal/AbstractFilterDescriptorManagerTest.java
index <HASH>..<HASH> 100644
--- a/xwiki-commons-core/xwiki-commons-filter/xwiki-commons-filter-api/src/test/java/org/xwiki/filter/internal/AbstractFilterDescriptorManagerTest.java
+++ b/xwiki-commons-core/xwiki-commons-filter/xwiki-commons-filter-api/src/test/java/org/xwiki/filter/internal/AbstractFilterDescriptorManagerTest.java
@@ -34,7 +34,6 @@ import org.xwiki.filter.FilterDescriptor;
import org.xwiki.filter.FilterDescriptorManager;
import org.xwiki.filter.FilterElementDescriptor;
import org.xwiki.filter.FilterElementParameterDescriptor;
-import org.xwiki.filter.FilterEventParameters;
import org.xwiki.filter.FilterException;
import org.xwiki.filter.UnknownFilter;
import org.xwiki.filter.test.TestFilterImplementation; | XCOMMONS-<I>: Upgrade to Mockito <I> | xwiki_xwiki-commons | train | java |
09865df11a0a3bab2264703cbfcec4a7732a456c | diff --git a/jooby/src/main/java/io/jooby/internal/HeadContext.java b/jooby/src/main/java/io/jooby/internal/HeadContext.java
index <HASH>..<HASH> 100644
--- a/jooby/src/main/java/io/jooby/internal/HeadContext.java
+++ b/jooby/src/main/java/io/jooby/internal/HeadContext.java
@@ -90,7 +90,6 @@ public class HeadContext extends ForwardingContext {
@Nonnull @Override public Context send(@Nonnull InputStream input) {
checkSizeHeaders();
- ctx.send(input);
ctx.send(StatusCode.OK);
return this;
} | HTTP HEAD: remove sending of inputstream | jooby-project_jooby | train | java |
320be81e098ed936daf4d8f5901225b61b37e1ef | diff --git a/emma2/msm/analysis/api_test.py b/emma2/msm/analysis/api_test.py
index <HASH>..<HASH> 100644
--- a/emma2/msm/analysis/api_test.py
+++ b/emma2/msm/analysis/api_test.py
@@ -12,7 +12,7 @@ class Test(unittest.TestCase):
def testTPT(self):
A = np.asarray([0], dtype=int)
- B = np.asarray([0], dtype=int)
+ B = np.asarray([5], dtype=int)
C = np.ndarray(buffer=np.array(
[[6000, 3, 0, 0, 0, 0],
[3, 1000, 3, 0, 0, 0],
@@ -29,7 +29,7 @@ class Test(unittest.TestCase):
print "net flux: ", itpt.getNetFlux()
print "total flux: ", itpt.getTotalFlux()
print "forward committor", itpt.getForwardCommittor()
- print "backward committor", itpt.getBackwardCommitor()
+ print "backward committor", itpt.getBackwardCommittor()
if __name__ == "__main__":
unittest.main() | [msm/analysis/api_test] * fixed typo in function call
* calculate flux from first to last state | markovmodel_PyEMMA | train | py |
a58760a632fe89c4a1a0bca9f3c3ae4150ba0422 | diff --git a/lib/gaze.js b/lib/gaze.js
index <HASH>..<HASH> 100644
--- a/lib/gaze.js
+++ b/lib/gaze.js
@@ -250,7 +250,7 @@ Gaze.prototype._initWatched = function(done) {
// Triggered when a watched dir has an event
_this._watchFile(dir, function(event, dirpath) {
- var relDir = path.relative(process.cwd(), dir);
+ var relDir = process.cwd() === dir ? '.' : path.relative(process.cwd(), dir);
return fs.readdir(dirpath, function(err, current) {
if (err) { return _this.emit('error', err); }
if (!current) { return; } | Show relDir as . if it is the cwd | shama_gaze | train | js |
eed6c3edab0d2a5758da3d9cb465c56778d05d99 | diff --git a/helpers/form/class.FormElement.php b/helpers/form/class.FormElement.php
index <HASH>..<HASH> 100644
--- a/helpers/form/class.FormElement.php
+++ b/helpers/form/class.FormElement.php
@@ -25,7 +25,6 @@ declare(strict_types=1);
use oat\oatbox\validator\ValidatorInterface;
use oat\tao\helpers\form\elements\xhtml\SearchTextBox;
use oat\tao\helpers\form\elements\xhtml\SearchDropdown;
-use oat\tao\helpers\form\validators\CrossPropertyEvaluationAwareInterface;
// Defining aliases for old style class names for backward compatibility
class_alias(SearchTextBox::class, \tao_helpers_form_elements_xhtml_Searchtextbox::class); | refactor: remove unnecessary use-statement | oat-sa_tao-core | train | php |
af54ef8ae69ba288dcc93c044532bc050e16ff6e | diff --git a/bin/include/generateServer.js b/bin/include/generateServer.js
index <HASH>..<HASH> 100755
--- a/bin/include/generateServer.js
+++ b/bin/include/generateServer.js
@@ -11,7 +11,7 @@ exports['generateServer'] = function(binary, next){
templateLines.push('');
templateLines.push(' var type = "' + binary.argv['name'] + '"');
templateLines.push(' var attributes = {');
- templateLines.push(' canChat: true');
+ templateLines.push(' canChat: true,');
templateLines.push(' logConnections: true,');
templateLines.push(' logExits: true,');
templateLines.push(' sendWelcomeMessage: true,'); | needs a commma in generator | actionhero_actionhero | train | js |
6e46b3bc27c57cf50cf43d0cbe1344956e5998f3 | diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb
index <HASH>..<HASH> 100644
--- a/activerecord/test/cases/fixtures_test.rb
+++ b/activerecord/test/cases/fixtures_test.rb
@@ -782,7 +782,7 @@ class CustomNameForFixtureOrModelTest < ActiveRecord::TestCase
end
def test_table_name_is_defined_in_the_model
- assert_equal :randomly_named_table, ActiveRecord::Fixtures::all_loaded_fixtures["admin/randomly_named_a9"].table_name
- assert_equal :randomly_named_table, Admin::ClassNameThatDoesNotFollowCONVENTIONS.table_name
+ assert_equal 'randomly_named_table', ActiveRecord::Fixtures::all_loaded_fixtures["admin/randomly_named_a9"].table_name
+ assert_equal 'randomly_named_table', Admin::ClassNameThatDoesNotFollowCONVENTIONS.table_name
end
end | fix fixtures test as table_name is a string now | rails_rails | train | rb |
86cfa79d24cf2ff0b317c71e4e785ef1e593a31f | diff --git a/chartkick.js b/chartkick.js
index <HASH>..<HASH> 100644
--- a/chartkick.js
+++ b/chartkick.js
@@ -2,7 +2,7 @@
* Chartkick.js
* Create beautiful Javascript charts with minimal code
* https://github.com/ankane/chartkick.js
- * v1.4.0
+ * v1.4.1
* MIT License
*/ | Updated version in chartkick.js | ankane_chartkick.js | train | js |
4cdb8ebd4ccdc2e82d923b70e4eadac6b909b83d | diff --git a/services/concept_insights/v2.js b/services/concept_insights/v2.js
index <HASH>..<HASH> 100644
--- a/services/concept_insights/v2.js
+++ b/services/concept_insights/v2.js
@@ -50,7 +50,7 @@ function formatConceptIds(ids) {
function ConceptInsights(options) {
// Default URL
var serviceDefaults = {
- url: 'https://gateway.watsonplatform.net/concept-insights-beta/api'
+ url: 'https://gateway.watsonplatform.net/concept-insights/api'
};
// Replace default options with user provided
@@ -571,4 +571,4 @@ ConceptInsightsCorpora.prototype.getDocumentProcessingState = function(params, c
return requestFactory(parameters, callback);
};
-module.exports = ConceptInsights;
\ No newline at end of file
+module.exports = ConceptInsights; | Update v2.js
move concept insights to GA | watson-developer-cloud_node-sdk | train | js |
a640bcfbcaa4d2c13fdde473a1f630deb3723bcc | diff --git a/openhtf/io/output/mfg_inspector.py b/openhtf/io/output/mfg_inspector.py
index <HASH>..<HASH> 100644
--- a/openhtf/io/output/mfg_inspector.py
+++ b/openhtf/io/output/mfg_inspector.py
@@ -460,9 +460,10 @@ class UploadToMfgInspector(object): # pylint: disable=too-few-public-methods
if resp.status != 200:
try:
results = json.loads(content)
- raise UploadFailedError(results['error'], results)
except Exception:
raise UploadFailedError(resp, content)
+ else:
+ raise UploadFailedError(results['error'], results)
# Return True if successful
return True | Raise errors from uploading correctly
Previously the UploadFailedError would get caught and re-raised differently right away | google_openhtf | train | py |
fd28479811bbf477249fac6db7c980328f6f8d26 | diff --git a/lib/firehose/rack/publisher_app.rb b/lib/firehose/rack/publisher_app.rb
index <HASH>..<HASH> 100644
--- a/lib/firehose/rack/publisher_app.rb
+++ b/lib/firehose/rack/publisher_app.rb
@@ -12,7 +12,7 @@ module Firehose
Firehose.logger.debug "HTTP published `#{body}` to `#{path}`"
publisher.publish(path, body)
- [202, {}, []]
+ [202, {'Content-Type' => 'text/plain'}, []]
else
Firehose.logger.debug "HTTP #{method} not supported"
[501, {'Content-Type' => 'text/plain'}, ["#{method} not supported."]] | Rainbows LINT is insisting that we return a Content-Type header for a <I> response when PUTing a message | firehoseio_firehose | train | rb |
41ed0708955c0dacccf882ac1cb57ab396dde6ab | diff --git a/test/visitors/test_mssql.rb b/test/visitors/test_mssql.rb
index <HASH>..<HASH> 100644
--- a/test/visitors/test_mssql.rb
+++ b/test/visitors/test_mssql.rb
@@ -13,6 +13,15 @@ module Arel
sql = @visitor.accept(stmt)
sql.must_be_like "SELECT TOP 1"
end
+
+ it 'uses TOP in updates with a limit' do
+ stmt = Nodes::UpdateStatement.new
+ stmt.limit = Nodes::Limit.new(1)
+ stmt.key = 'id'
+ sql = @visitor.accept(stmt)
+ sql.must_be_like "UPDATE NULL WHERE 'id' IN (SELECT TOP 1 'id' )"
+ end
+
end
end
end | Added test, thanks josephholsten | rails_rails | train | rb |
2612cbdabd95c4c8456e4382cb36e2ce5bda81c5 | diff --git a/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb b/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb
index <HASH>..<HASH> 100644
--- a/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb
+++ b/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb
@@ -52,7 +52,7 @@ module Fastlane
def self.upload_dsym(params, path)
UI.message("Uploading '#{path}'...")
command = []
- command << params[:binary_path]
+ command << params[:binary_path].shellescape
command << "-a #{params[:api_token]}"
command << "-p #{params[:platform]}"
command << File.expand_path(path).shellescape | Escaping UploadSymbolsToCrashlyticsAction binary_path
Uploading dSYMs with the UploadSymbolsToCrashlyticsAction action can cause failures with a custom binary_path where the binary_path contains spaces. This proposed change shellescape's the binary_path. | fastlane_fastlane | train | rb |
8a16993d0abc4af8ff4ba3b13634761917cfd18b | diff --git a/user-manager/service/src/main/java/com/peterphi/usermanager/db/dao/hibernate/OAuthSessionDaoImpl.java b/user-manager/service/src/main/java/com/peterphi/usermanager/db/dao/hibernate/OAuthSessionDaoImpl.java
index <HASH>..<HASH> 100644
--- a/user-manager/service/src/main/java/com/peterphi/usermanager/db/dao/hibernate/OAuthSessionDaoImpl.java
+++ b/user-manager/service/src/main/java/com/peterphi/usermanager/db/dao/hibernate/OAuthSessionDaoImpl.java
@@ -97,6 +97,6 @@ public class OAuthSessionDaoImpl extends HibernateDao<OAuthSessionEntity, String
@Transactional(readOnly = true)
public OAuthSessionEntity getByToken(final String token)
{
- return uniqueResult(new WebQuery().eq("token", token).eq("alive", true).eq("expires", DateTime.now()));
+ return uniqueResult(new WebQuery().eq("token", token).eq("alive", true).gt("expires", DateTime.now()));
}
} | Bugfix in webquery translation, should be .gt not .eq for date comparison | petergeneric_stdlib | train | java |
a848b264958ad3ced1bbb881c961d2647c0096f3 | diff --git a/packages/table/src/table-column.js b/packages/table/src/table-column.js
index <HASH>..<HASH> 100644
--- a/packages/table/src/table-column.js
+++ b/packages/table/src/table-column.js
@@ -389,6 +389,12 @@ export default {
if (this.columnConfig) {
this.columnConfig.index = newVal;
}
+ },
+
+ formatter(newVal) {
+ if (this.columnConfig) {
+ this.columnConfig.formatter = newVal;
+ }
}
}, | Table: fix column formatter not changed when new formatter is set (#<I>) | ElemeFE_element | train | js |
62076ae2826643fa7d598a94d26c6f62cf52fcdc | diff --git a/findbugs/src/java/edu/umd/cs/findbugs/ba/DataflowTestDriver.java b/findbugs/src/java/edu/umd/cs/findbugs/ba/DataflowTestDriver.java
index <HASH>..<HASH> 100644
--- a/findbugs/src/java/edu/umd/cs/findbugs/ba/DataflowTestDriver.java
+++ b/findbugs/src/java/edu/umd/cs/findbugs/ba/DataflowTestDriver.java
@@ -25,6 +25,8 @@ import org.apache.bcel.classfile.JavaClass;
import org.apache.bcel.classfile.Method;
import org.apache.bcel.generic.MethodGen;
+import edu.umd.cs.findbugs.FindBugsAnalysisFeatures;
+
/**
* A test driver for dataflow analysis classes.
* It runs the dataflow analysis on the methods of a single class,
@@ -49,6 +51,7 @@ public abstract class DataflowTestDriver <Fact, AnalysisType extends AbstractDat
final RepositoryLookupFailureCallback lookupFailureCallback = new DebugRepositoryLookupFailureCallback();
AnalysisContext analysisContext = new AnalysisContext(lookupFailureCallback);
+ analysisContext.setBoolProperty(AnalysisFeatures.ACCURATE_EXCEPTIONS, true);
ClassContext classContext = analysisContext.getClassContext(jclass);
String methodName = System.getProperty("dataflow.method"); | Set "accurate exceptions" analysis feature. Otherwise it's hard to
debug analyses that rely on having this information.
git-svn-id: <URL> | spotbugs_spotbugs | train | java |
4027b9b2feedc13b66b03b7cd4093975aa1617e9 | diff --git a/pandas/tests/indexes/numeric/test_indexing.py b/pandas/tests/indexes/numeric/test_indexing.py
index <HASH>..<HASH> 100644
--- a/pandas/tests/indexes/numeric/test_indexing.py
+++ b/pandas/tests/indexes/numeric/test_indexing.py
@@ -424,6 +424,17 @@ class TestWhere:
result = idx.putmask(~mask, other)
tm.assert_index_equal(result, expected)
+ def test_where_infers_type_instead_of_trying_to_convert_string_to_float(self):
+ # GH 32413
+ index = Index([1, np.nan])
+ cond = index.notna()
+ other = Index(["a", "b"], dtype="string")
+
+ expected = Index([1.0, "b"])
+ result = index.where(cond, other)
+
+ tm.assert_index_equal(result, expected)
+
class TestTake:
@pytest.mark.parametrize("klass", [Float64Index, Int64Index, UInt64Index]) | TST: add test for Index.where (#<I>) (#<I>) | pandas-dev_pandas | train | py |
29beccc466b8134300af7edd02a8a2149335e43c | diff --git a/test/test.js b/test/test.js
index <HASH>..<HASH> 100644
--- a/test/test.js
+++ b/test/test.js
@@ -68,6 +68,15 @@
// enable debug mode so `spotlight` methods return an array of log calls
spotlight.debug = true;
+ // avoid false positives for QUnit's `noglobals` checks
+ QUnit.moduleStart(function() {
+ window.a = true;
+ });
+
+ QUnit.moduleDone(function() {
+ delete window.a;
+ });
+
// explicitly call `QUnit.module()` instead of `module()`
// in case we are in a CLI environment
QUnit.module('spotlight'); | Make unit tests work with `noglobals`. | bestiejs_spotlight.js | train | js |
88a85917edf3ec6276959264cae780839fb88ab5 | diff --git a/modules/position/position.js b/modules/position/position.js
index <HASH>..<HASH> 100644
--- a/modules/position/position.js
+++ b/modules/position/position.js
@@ -227,6 +227,14 @@ export default class Position {
}
/**
+ * Get the angle of a position relative to the horizontal axis
+ * @return {Number}
+ */
+ get angle () {
+ return (Math.atan(this.y / this.x) / radianCircle) + (this.x < 0 ? 0.75 : 0.25);
+ }
+
+ /**
* Return a JSON ready Position definition
* @return {Array<Number>}
*/ | :sparkles: Introducing new features.
Position have and angle getter | pencil-js_pencil.js | train | js |
a31369b0437acbe4657dd54b70c26b9e51f36904 | diff --git a/hmr-manager-template.js b/hmr-manager-template.js
index <HASH>..<HASH> 100644
--- a/hmr-manager-template.js
+++ b/hmr-manager-template.js
@@ -55,6 +55,12 @@
return output;
}
+ function emitError(err) {
+ setTimeout(function() {
+ throw err;
+ }, 0);
+ }
+
var moduleIndexesToNames = {};
for (name in moduleMeta) {
if (has(moduleMeta, name)) {
@@ -533,7 +539,7 @@
try {
relevantUpdateHandlers[i].cb.call(null, acceptedUpdates);
} catch(e) {
- if (errCanWait) console.error(errCanWait);
+ if (errCanWait) emitError(errCanWait);
errCanWait = e;
}
}
@@ -546,7 +552,7 @@
if (obj.cb) {
obj.cb.call(null, e);
} else {
- if (errCanWait) console.error(errCanWait);
+ if (errCanWait) emitError(errCanWait);
errCanWait = e;
}
} | Rethrow caught errors, don't just log them. | Macil_browserify-hmr | train | js |
ea1919aab0d5394ededc144d004a85daebed7fdb | diff --git a/lib/dragonfly/active_record_extensions/class_methods.rb b/lib/dragonfly/active_record_extensions/class_methods.rb
index <HASH>..<HASH> 100644
--- a/lib/dragonfly/active_record_extensions/class_methods.rb
+++ b/lib/dragonfly/active_record_extensions/class_methods.rb
@@ -10,8 +10,9 @@ module Dragonfly
# Defines e.g. 'image_accessor' for any activerecord class body
define_method "#{accessor_prefix}_accessor" do |attribute|
- before_save :save_attached_files unless before_save_callback_chain.find(:save_attached_files)
- before_destroy :destroy_attached_files unless before_destroy_callback_chain.find(:destroy_attached_files)
+ # Prior to activerecord 3, adding before callbacks more than once does add it more than once
+ before_save :save_attached_files unless respond_to?(:before_save_callback_chain) && before_save_callback_chain.find(:save_attached_files)
+ before_destroy :destroy_attached_files unless respond_to?(:before_destroy_callback_chain) && before_destroy_callback_chain.find(:destroy_attached_files)
# Register the new attribute
dragonfly_apps_for_attributes[attribute] = app | Rails 3 doesn't need to check 'before_save_callback_chain', etc., in fact it doesn't even have it | markevans_dragonfly | train | rb |
c12fa08f86295a94513ae15fa7480eb485b0ef9a | diff --git a/src/Magniloquent/Magniloquent/Magniloquent.php b/src/Magniloquent/Magniloquent/Magniloquent.php
index <HASH>..<HASH> 100644
--- a/src/Magniloquent/Magniloquent/Magniloquent.php
+++ b/src/Magniloquent/Magniloquent/Magniloquent.php
@@ -16,7 +16,7 @@ class Magniloquent extends Model {
private $saved = false;
- protected $customMessages = [];
+ protected $customMessages = array();
public function __construct($attributes = array())
{ | change to array() syntax for php<<I> | philipbrown_magniloquent | train | php |
bd3bea1598919e177ca6e56d23ae2fc9d8d5e22e | diff --git a/actionview/lib/action_view/renderer/abstract_renderer.rb b/actionview/lib/action_view/renderer/abstract_renderer.rb
index <HASH>..<HASH> 100644
--- a/actionview/lib/action_view/renderer/abstract_renderer.rb
+++ b/actionview/lib/action_view/renderer/abstract_renderer.rb
@@ -17,7 +17,7 @@ module ActionView
# that new object is called in turn. This abstracts the setup and rendering
# into a separate classes for partials and templates.
class AbstractRenderer #:nodoc:
- delegate :find_template, :find_file, :template_exists?, :any_templates?, :with_fallbacks, :with_layout_format, :formats, to: :@lookup_context
+ delegate :template_exists?, :any_templates?, :with_layout_format, :formats, to: :@lookup_context
def initialize(lookup_context)
@lookup_context = lookup_context | Remove `find_template` and `find_file` delegate methods
This reduces the surface area of our API and removes a Liskov issue.
Both TemplateRenderer and PartialRenderer inherit from AbstractRenderer,
but since PartialRenderer implements it's own `find_template` that is
private, and has the wrong method signature, an instance of
PartialRenderer cannot be substituted for an instance of
AbstractRenderer renderer. Removing the superclass implementation
solves both issues. | rails_rails | train | rb |
9276ea89d2b0be9fdd1ad6590857f8d45a38c267 | diff --git a/actionview/lib/action_view/helpers/tag_helper.rb b/actionview/lib/action_view/helpers/tag_helper.rb
index <HASH>..<HASH> 100644
--- a/actionview/lib/action_view/helpers/tag_helper.rb
+++ b/actionview/lib/action_view/helpers/tag_helper.rb
@@ -90,7 +90,8 @@ module ActionView
else
value = escape ? ERB::Util.unwrapped_html_escape(value) : value.to_s
end
- %(#{key}="#{value.gsub('"'.freeze, '"'.freeze)}")
+ value.gsub!('"'.freeze, '"'.freeze)
+ %(#{key}="#{value}")
end
private | Reduce String allocations when building Action View tags
This method is called against each tag option for each tag,
and creates an extra garbage String per each call | rails_rails | train | rb |
3a50f9e5abfee01f76dc39e688189421d33d4d86 | diff --git a/.eslintrc.js b/.eslintrc.js
index <HASH>..<HASH> 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -4,6 +4,7 @@ module.exports = {
},
'extends': 'eslint:recommended',
'rules': {
+ 'no-console': 'off',
'curly': ['error', 'all'],
'default-case': 'warn',
'dot-location': ['error', 'property'],
@@ -68,7 +69,7 @@ module.exports = {
'consistent-this': ['error', '_this'],
'func-call-spacing': ['error', 'never'],
'func-style': ['error', 'declaration'],
- 'id-length': ['error', {
+ 'id-length': ['warn', {
'min': 1,
'max': 20,
'properties': 'always' | chore: update few rules for linter | valerii-zinchenko_inheritance-diagram | train | js |
57f8ec31d4c9e80a9330fd547bac5fae776cea71 | diff --git a/src/basis/devpanel/l10nAPI.js b/src/basis/devpanel/l10nAPI.js
index <HASH>..<HASH> 100644
--- a/src/basis/devpanel/l10nAPI.js
+++ b/src/basis/devpanel/l10nAPI.js
@@ -11,6 +11,10 @@ basis.l10n.addCreateDictionaryHandler(function(dictionaryName){
sendData('newDictionary', { dictionaryName: dictionaryName });
});
+basis.l10n.onCultureChange(function(culture){
+ sendData('cultureChanged', culture);
+});
+
module.exports = {
l10nStartInspect: function(){
inspector.startInspect(); | sync culture between appcp and devpanel | basisjs_basisjs | train | js |
1761dd29d50e76d2a85fe9951f861d138c4ade5b | diff --git a/timepiece/tests/timesheet.py b/timepiece/tests/timesheet.py
index <HASH>..<HASH> 100644
--- a/timepiece/tests/timesheet.py
+++ b/timepiece/tests/timesheet.py
@@ -167,9 +167,10 @@ class ClockInTest(TimepieceDataTestCase):
'start_time_1': self.now.strftime('%H:%M:%S'),
})
response = self.client.post(self.url, data, follow=True)
- for entry in timepiece.Entry.objects.all():
- if entry.is_overlapping():
- self.fail('Overlapping Times')
+ #obtain entry1 now that it is closed. The hours should be recorded
+ e_id = timepiece.Entry.objects.get(pk=entry1.id)
+ self.assertTrue(e_id.is_closed)
+ self.assertTrue(e_id.hours)
def testClockInBlock(self):
""" | ClockInPause reflects a more precise test | caktus_django-timepiece | train | py |
6c286af4f050d992280c5c2e220bdc3f0b3817d7 | diff --git a/tests/ValidateTest.php b/tests/ValidateTest.php
index <HASH>..<HASH> 100644
--- a/tests/ValidateTest.php
+++ b/tests/ValidateTest.php
@@ -46,4 +46,11 @@ class ValidateTest extends TestCase
$this->assertTrue($validate->expiration(time() + 10));
}
+
+ public function testValidateExpirationOld()
+ {
+ $validate = new Validate();
+
+ $this->assertFalse($validate->expiration(time() - 10));
+ }
} | Added expiration test for old date on validate class | RobDWaller_ReallySimpleJWT | train | php |
1d478fb420d267335ad4e7c9080ccae81b9ea760 | diff --git a/CHANGES.txt b/CHANGES.txt
index <HASH>..<HASH> 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,8 +1,16 @@
Changes
=========
-0.1
----
+0.2 (2013-11-8)
+---------------
+
+* Feature handling Resources.
+* Entry point to apply predicates/wrappers by users to view_config
+* Fixed Controller to consider primaries of views
+* Changed depending SQLAlchemy version.
+
+0.1 (2013-10-29)
+----------------
Initial release.
diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -52,9 +52,9 @@ copyright = '2013, Hiroki KIYOHARA'
# built documents.
#
# The short X.Y version.
-version = '0.1'
+version = '0.2'
# The full version, including alpha/beta/rc tags.
-release = '0.1'
+release = '0.2'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@ except IOError:
README = ''
CHANGES = ''
-version = "0.1"
+version = "0.2"
setup(name='uiro',
version=version, | Changed version to <I> | hirokiky_uiro | train | txt,py,py |
376d48f792f988056c1cb87a741b3430bfaaa1b4 | diff --git a/tilequeue/command.py b/tilequeue/command.py
index <HASH>..<HASH> 100755
--- a/tilequeue/command.py
+++ b/tilequeue/command.py
@@ -1053,7 +1053,6 @@ def tilequeue_prune_tiles_of_interest(cfg, peripherals):
logger.info('Removed %s tiles from S3', removed)
for coord_ints in grouper(toi_to_remove, 1000):
- # FIXME: Think about doing this in a thread/process pool
delete_tile_of_interest(s3_parts, coord_ints)
logger.info('Removing %s tiles from TOI and S3 ... done', | Remove fixme about multiprocessing for now | tilezen_tilequeue | train | py |
e7aa3c6c74d48ef0808ff81dc3422c8143460f00 | diff --git a/src/shapes/SurfaceSector.js b/src/shapes/SurfaceSector.js
index <HASH>..<HASH> 100644
--- a/src/shapes/SurfaceSector.js
+++ b/src/shapes/SurfaceSector.js
@@ -113,5 +113,30 @@ define([
this._boundaries[3] = new Location(sector.minLatitude, sector.maxLongitude);
};
+ // Internal use only. Intentionally not documented.
+ SurfaceSector.prototype.getReferencePosition = function () {
+ return new Location(this.sector.centroidLatitude(), this.sector.centroidLongitude());
+ };
+
+ // Internal use only. Intentionally not documented.
+ SurfaceSector.prototype.moveTo = function (globe, position) {
+ var sector = this._sector;
+
+ var locations = new Array(3);
+
+ locations[0] = new Location(sector.minLatitude, sector.minLongitude);
+ locations[1] = new Location(sector.maxLatitude, sector.minLongitude);
+ locations[2] = new Location(sector.maxLatitude, sector.maxLongitude);
+
+ locations = this.computeShiftedLocations(globe, this.getReferencePosition(), position, locations);
+
+ this.sector = new WorldWind.Sector(
+ locations[0].latitude,
+ locations[1].latitude,
+ locations[1].longitude,
+ locations[2].longitude
+ );
+ };
+
return SurfaceSector;
- });
\ No newline at end of file
+ }); | Add getReferencePosition and moveTo to SurfaceSector (#<I>) | NASAWorldWind_WebWorldWind | train | js |
7cbe354eb5d345c8d909407fe6e86b63cce73156 | diff --git a/src/tuwien/auto/calimero/serial/TpuartConnection.java b/src/tuwien/auto/calimero/serial/TpuartConnection.java
index <HASH>..<HASH> 100644
--- a/src/tuwien/auto/calimero/serial/TpuartConnection.java
+++ b/src/tuwien/auto/calimero/serial/TpuartConnection.java
@@ -169,7 +169,7 @@ public class TpuartConnection implements AutoCloseable
public TpuartConnection(final String portId, final Collection<? extends KNXAddress> acknowledge) throws KNXException
{
this.portId = portId;
- logger = LogService.getAsyncLogger("calimero.serial.tpuart");
+ logger = LogService.getAsyncLogger("calimero.serial.tpuart:" + portId);
adapter = LibraryAdapter.open(logger, portId, 19200, 0);
os = adapter.getOutputStream();
is = adapter.getInputStream(); | Append tpuart port id to logger name | calimero-project_calimero-core | train | java |
42ec6b435db310e85d8f7ce21f17abd13e7c7fe5 | diff --git a/goble.go b/goble.go
index <HASH>..<HASH> 100644
--- a/goble.go
+++ b/goble.go
@@ -441,7 +441,7 @@ func (ble *BLE) sendCBMsg(id int, args xpc.Dict) {
log.Printf("sendCBMsg %#v\n", message)
}
- ble.conn.Send(xpc.Dict{"kCBMsgId": id, "kCBMsgArgs": args}, true)
+ ble.conn.Send(xpc.Dict{"kCBMsgId": id, "kCBMsgArgs": args}, ble.verbose)
}
// initialize BLE | The boolean in XPC.Send is the "verbose" flag | raff_goble | train | go |
4164e4a1d4968463f4f008e4b3dae48bfb9eb229 | diff --git a/REST/MailChimpClient.php b/REST/MailChimpClient.php
index <HASH>..<HASH> 100755
--- a/REST/MailChimpClient.php
+++ b/REST/MailChimpClient.php
@@ -20,8 +20,6 @@ class MailChimpClient
protected $client;
- protected $organizerKey;
-
public function setContainer($container)
{
$this->container = $container;
@@ -32,20 +30,18 @@ class MailChimpClient
}
public function connectByLocation($location){
-
- $this->organizerKey = $location->getIdentifier();
-
- $oauthApp = $this->container->get('campaignchain.security.authentication.client.oauth.application');
- $application = $oauthApp->getApplication(self::RESOURCE_OWNER);
-
// Get Access Token and Token Secret
$oauthToken = $this->container->get('campaignchain.security.authentication.client.oauth.token');
$token = $oauthToken->getToken($location);
- return $this->connect($token->getAccessToken());
+ return $this->connect($token->getAccessToken(), $token->getEndpoint());
}
- public function connect($apiKey){
+ public function connect($apiKey, $endpoint){
+ $dc = explode('.', parse_url($endpoint, PHP_URL_HOST))[0];
+
+ $this->client = new \Mailchimp($apiKey.'-'.$dc);
+ return $this->client;
}
}
\ No newline at end of file | CE-<I> Basic MailChimp integration | CampaignChain_channel-mailchimp | train | php |
80c4c55c96c2e96825f4bcf3a0f2a0025c3840f3 | diff --git a/lib/dm-core/type.rb b/lib/dm-core/type.rb
index <HASH>..<HASH> 100755
--- a/lib/dm-core/type.rb
+++ b/lib/dm-core/type.rb
@@ -127,7 +127,7 @@ module DataMapper
@primitive = primitive
# inherit the options from the primitive if any
- if @primitive.respond_to?(:options)
+ if @primitive.respond_to?(:options) && @primitive.options.respond_to?(:each)
@primitive.options.each do |key, value|
send(key, value) unless send(key)
end | Make sure primitive options are Enumerable | datamapper_dm-core | train | rb |
89f6b77e928447daa376babe5841c9a638e5f831 | diff --git a/nodedb.go b/nodedb.go
index <HASH>..<HASH> 100644
--- a/nodedb.go
+++ b/nodedb.go
@@ -36,7 +36,7 @@ var (
)
type nodeDB struct {
- mtx sync.RWMutex // Read/write lock.
+ mtx sync.Mutex // Read/write lock.
db dbm.DB // Persistent node storage.
batch dbm.Batch // Batched writing buffer.
opts Options // Options to customize for pruning/writing
@@ -68,8 +68,8 @@ func newNodeDB(db dbm.DB, cacheSize int, opts *Options) *nodeDB {
// GetNode gets a node from memory or disk. If it is an inner node, it does not
// load its children.
func (ndb *nodeDB) GetNode(hash []byte) *Node {
- ndb.mtx.RLock()
- defer ndb.mtx.RUnlock()
+ ndb.mtx.Lock()
+ defer ndb.mtx.Unlock()
if len(hash) == 0 {
panic("nodeDB.GetNode() requires hash") | rollback to use normal mutex in nodeDB (#<I>) | tendermint_iavl | train | go |
8b8dfea231678736888ead2bb9850fa5d4c12987 | diff --git a/lib/stream/watch.js b/lib/stream/watch.js
index <HASH>..<HASH> 100644
--- a/lib/stream/watch.js
+++ b/lib/stream/watch.js
@@ -10,7 +10,6 @@ module.exports = function(graphStream){
allNodes = invert(data.graph);
addresses = Object.keys(allNodes);
- watcher.unwatch(addresses);
watcher.add(addresses);
}
@@ -23,7 +22,7 @@ module.exports = function(graphStream){
watcher.on("all", changed);
graphStream.on("data", updateWatch);
-
+
return stream;
}; | Remove an unneeded unwatching of dependencies
Previously I was unwatching the addresses of the dependency graph before re-adding them. I was trying to avoid duplicate watch events. It turns out that this was causing a bug in Linux. Did some testing and the unwatch is not needed, there will not be duplicate events. Fixes #<I> | stealjs_steal-tools | train | js |
36df37f1b733536b95339ebd79b37ec7a6189cf3 | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -36,7 +36,7 @@ PRIMARY = {
'mysql' => 'mysql://localhost/dm_core_test',
'postgres' => 'postgres://localhost/dm_core_test',
'oracle' => 'oracle://dm_core_test:dm_core_test@localhost/orcl',
- 'sqlserver' => 'sqlserver://sa:sa@localhost/dm_core_test'
+ 'sqlserver' => 'sqlserver://dm_core_test:dm_core_test@localhost/dm_core_test;instance=SQLEXPRESS'
}
ALTERNATE = {
@@ -47,7 +47,7 @@ ALTERNATE = {
'mysql' => 'mysql://localhost/dm_core_test2',
'postgres' => 'postgres://localhost/dm_core_test2',
'oracle' => 'oracle://dm_core_test2:dm_core_test2@localhost/orcl',
- 'sqlserver' => 'sqlserver://sa:sa@localhost/dm_core_test2'
+ 'sqlserver' => 'sqlserver://dm_core_test:dm_core_test@localhost/dm_core_test2;instance=SQLEXPRESS'
}
# These environment variables will override the default connection string: | Update connection URL for SQL Server in spec_helper.rb | datamapper_dm-core | train | rb |
08e9bef0ae4bc5f4dc28889218f854b6734b4826 | diff --git a/go/vt/binlog/binlog_conn_streamer.go b/go/vt/binlog/binlog_conn_streamer.go
index <HASH>..<HASH> 100644
--- a/go/vt/binlog/binlog_conn_streamer.go
+++ b/go/vt/binlog/binlog_conn_streamer.go
@@ -46,11 +46,9 @@ func (bls *binlogConnStreamer) Stream(ctx *sync2.ServiceContext) (err error) {
stopPos := bls.startPos
defer func() {
if err != nil {
- binlogStreamerErrors.Add("Stream", 1)
- err = fmt.Errorf("stream error @ %v, error: %v", stopPos, err)
- log.Error(err.Error())
+ err = fmt.Errorf("stream error @ %v: %v", stopPos, err)
}
- log.Infof("Stream ended @ %v", stopPos)
+ log.Infof("stream ended @ %v, err = %v", stopPos, err)
}()
if bls.conn, err = mysqlctl.NewSlaveConnection(bls.mysqld); err != nil { | Don't log stream errors when the client will retry. | vitessio_vitess | train | go |
024612599bdc634a6add88a2d655365c8ac8b391 | diff --git a/main.py b/main.py
index <HASH>..<HASH> 100644
--- a/main.py
+++ b/main.py
@@ -34,7 +34,6 @@ workers = {}
class AutoAddPolicy(paramiko.client.MissingHostKeyPolicy):
-
"""
thread-safe AutoAddPolicy
"""
@@ -353,7 +352,8 @@ def get_policy_class(policy):
policy += 'policy'
dic = {k.lower(): v for k, v in vars(paramiko.client).items() if type(v)
- is type and issubclass(v, paramiko.client.MissingHostKeyPolicy)}
+ is type and issubclass(v, paramiko.client.MissingHostKeyPolicy)
+ and v is not paramiko.client.MissingHostKeyPolicy}
try:
cls = dic[policy]
except KeyError: | Removed MissingHostKeyPolicy base class | huashengdun_webssh | train | py |
71001849aadbdb918493d52ea159b0fa1cfce703 | diff --git a/src/main/java/io/openliberty/tools/common/plugins/util/BinaryScannerUtil.java b/src/main/java/io/openliberty/tools/common/plugins/util/BinaryScannerUtil.java
index <HASH>..<HASH> 100644
--- a/src/main/java/io/openliberty/tools/common/plugins/util/BinaryScannerUtil.java
+++ b/src/main/java/io/openliberty/tools/common/plugins/util/BinaryScannerUtil.java
@@ -209,9 +209,12 @@ public abstract class BinaryScannerUtil {
Method generateFeatureSetMethod = getScannerMethod();
Set<String> binaryInputs = allClassesDirectories;
Set<String> currentFeaturesSet = new HashSet<String>(); // when re-running always pass in no features
- String logLevel = null;
+ String logLevel;
if (isDebugEnabled()) {
logLevel = "*=FINE"; // generate messages for debugging by support team
+ } else {
+ logLevel = null;
+ logLocation = null;
}
debug("Recalling binary scanner with the following inputs...\n" +
" binaryInputs: " + binaryInputs + "\n" + | Do not pass logLevel or logLocation to binary scanner unless debug mode is on in reRunBinaryScanner(). | WASdev_ci.common | train | java |
4b501a8d35e85e66fe01e70ebbcaa7dde8de3d0c | diff --git a/src/utils/ViewUtils.js b/src/utils/ViewUtils.js
index <HASH>..<HASH> 100644
--- a/src/utils/ViewUtils.js
+++ b/src/utils/ViewUtils.js
@@ -28,7 +28,8 @@
define(function (require, exports, module) {
"use strict";
- var _ = require("thirdparty/lodash");
+ var _ = require("thirdparty/lodash"),
+ FileUtils = require("file/FileUtils");
var SCROLL_SHADOW_HEIGHT = 5;
@@ -393,7 +394,8 @@ define(function (require, exports, module) {
*/
function getFileEntryDisplay(entry) {
var name = entry.name,
- i = name.lastIndexOf(".");
+ ext = FileUtils.getSmartFileExtension(name),
+ i = name.lastIndexOf("." + ext);
if (i >= 0) {
// Escape all HTML-sensitive characters in filename. | Extensions are now displayed using new API in project tree | adobe_brackets | train | js |
7faf4854365f5b41e404f955fd6aac338afe01f2 | diff --git a/bcbio/rnaseq/kallisto.py b/bcbio/rnaseq/kallisto.py
index <HASH>..<HASH> 100644
--- a/bcbio/rnaseq/kallisto.py
+++ b/bcbio/rnaseq/kallisto.py
@@ -39,6 +39,9 @@ def kallisto_rnaseq(fq1, fq2, kallisto_dir, gtf_file, fasta_file, data):
samplename = dd.get_sample_name(data)
quant_dir = os.path.join(kallisto_dir, "quant")
safe_makedir(kallisto_dir)
+ sentinel_file = os.path.join(quant_dir, "abundance.h5")
+ if os.path.exists(sentinel_file):
+ return quant_dir
num_cores = dd.get_num_cores(data)
strandedness = dd.get_strandedness(data).lower()
kallisto = config_utils.get_program("kallisto", dd.get_config(data)) | Enable kallisto memoization for bulk RNA-seq runs. | bcbio_bcbio-nextgen | train | py |
0bca439c56bcf9d3a3a24b68a36c2149088a4556 | diff --git a/src/ApiClient.js b/src/ApiClient.js
index <HASH>..<HASH> 100644
--- a/src/ApiClient.js
+++ b/src/ApiClient.js
@@ -2,6 +2,7 @@
const request = require('request')
const when = require('when')
+const packageJson = require('../package')
const errorMessage = (statusCode, body) => {
body = body || {}
@@ -46,7 +47,7 @@ module.exports = class ApiClient {
this.headers = {
'X-App-Id': applicationId,
'X-App-Token': clientSecretKey,
- 'X-Voucherify-Channel': channel || 'Node.js-SDK'
+ 'X-Voucherify-Channel': channel ||`Node.js-${process.version}-SDK-v${packageJson.version}`
}
if (apiVersion) {
this.headers['X-Voucherify-API-Version'] = apiVersion | Send sdk and node.js version with channel header
This will allow us to support all node.js version usages | voucherifyio_voucherify-nodejs-sdk | train | js |
668d9f06d615a5cac24e4c45fd75348be29ed5a2 | diff --git a/tests/Assets/TestCodeGenerator.php b/tests/Assets/TestCodeGenerator.php
index <HASH>..<HASH> 100644
--- a/tests/Assets/TestCodeGenerator.php
+++ b/tests/Assets/TestCodeGenerator.php
@@ -39,6 +39,9 @@ class TestCodeGenerator
self::TEST_ENTITY_ORDER_ADDRESS,
self::TEST_ENTITY_NAME_SPACING_SOME_CLIENT,
self::TEST_ENTITY_NAME_SPACING_ANOTHER_CLIENT,
+ self::TEST_ENTITY_LARGE_DATA,
+ self::TEST_ENTITY_LARGE_PROPERTIES,
+ self::TEST_ENTITY_LARGE_RELATIONS,
];
public const TEST_FIELD_NAMESPACE_BASE = self::TEST_PROJECT_ROOT_NAMESPACE . '\\Entity\\Fields';
public const TEST_FIELD_TRAIT_NAMESPACE = self::TEST_FIELD_NAMESPACE_BASE . '\\Traits\\'; | more bad merge artifacts being resolved | edmondscommerce_doctrine-static-meta | train | php |
b92656db8b379cff5ba843a136827989c1dfe758 | diff --git a/jax/core.py b/jax/core.py
index <HASH>..<HASH> 100644
--- a/jax/core.py
+++ b/jax/core.py
@@ -653,6 +653,7 @@ def call_impl(f, *args, **params):
call_p = Primitive('call')
+call_p.multiple_results = True
call_p.call_primitive = True
call = partial(call_bind, call_p)
call_p.def_custom_bind(call) | Set `call_p.multiple_results` to True. | tensorflow_probability | train | py |
cffb3642d3209d4e80c624ad212ba0ed5db3be5c | diff --git a/storage/storage_image.go b/storage/storage_image.go
index <HASH>..<HASH> 100644
--- a/storage/storage_image.go
+++ b/storage/storage_image.go
@@ -1017,8 +1017,9 @@ func (s *storageImageDestination) Commit(ctx context.Context, unparsedToplevel t
commitSucceeded := false
defer func() {
if !commitSucceeded {
+ logrus.Errorf("Updating image %q (old names %v) failed, deleting it", img.ID, oldNames)
if _, err := s.imageRef.transport.store.DeleteImage(img.ID, true); err != nil {
- logrus.Debugf("error deleting incomplete image %q: %v", img.ID, err)
+ logrus.Errorf("Error deleting incomplete image %q: %v", img.ID, err)
}
}
}() | Log, as an error, if we are deleting an image during commit
It indicates something has gone quite wrong in storage,
so the user should be told.
Also log as an error if even deleting the image fails; the caller
still returns an error value only about the original commit failure
cause, nothing about deleting the image. | containers_image | train | go |
44589f0df46cb38750a71785694699deba90ad9f | diff --git a/ics_compare.py b/ics_compare.py
index <HASH>..<HASH> 100755
--- a/ics_compare.py
+++ b/ics_compare.py
@@ -31,14 +31,21 @@ def compare(first_in: Component, second_in: Component, second_out: Component) ->
for attr in [
"dtstart",
"summary",
- "location" "description",
+ "location",
+ "description",
"recurrence_id",
"rdate",
"rrule",
]:
- if hasattr(first, attr):
+ if (
+ hasattr(first, attr)
+ and first.contents.get(attr)
+ and first.contents.get(attr)[0].value
+ ):
if (
hasattr(second, attr)
+ and second.contents.get(attr)
+ and second.contents.get(attr)[0].value
and first.contents.get(attr)[0].value
!= second.contents.get(attr)[0].value
): | Fix location and description in ics_compare | jspricke_python-remind | train | py |
8fb191235915758b718ab6fd85115eecf66d7b04 | diff --git a/sinatra-contrib/lib/sinatra/config_file.rb b/sinatra-contrib/lib/sinatra/config_file.rb
index <HASH>..<HASH> 100644
--- a/sinatra-contrib/lib/sinatra/config_file.rb
+++ b/sinatra-contrib/lib/sinatra/config_file.rb
@@ -95,10 +95,23 @@ module Sinatra
#
# Be aware that if you have a different environment, besides development,
# test and production, you will also need to adjust the +environments+
- # setting. For instance, when you also have a staging environment:
+ # setting, otherwise the settings will not load. For instance, when
+ # you also have a staging environment:
#
# set :environments, %w{development test production staging}
#
+ # If you wish to provide defaults that may be shared among all the environments,
+ # this can be done by using one of the existing environments as the default using
+ # the YAML alias, and then overwriting values in the other environments:
+ #
+ # development: &common_settings
+ # foo: 'foo'
+ # bar: 'bar'
+ #
+ # production:
+ # <<: *common_settings
+ # bar: 'baz' # override the default value
+ #
module ConfigFile
# When the extension is registered sets the +environments+ setting to the | Document sharing default settings (ConfigFile).
This addresses #<I> and #<I>.
Issue #<I> suggest a change in the `ConfigFile#config_for_env(hash)`
method in order to allow a separate entry to use for shared settings,
while issue #<I> provides an implementation of an additional,
non-environment, key `default` which default values can be added to.
It seems like the existing method of sharing settings does not have any
significant disadvantages, and just needed to be explicitly documented. | sinatra_sinatra | train | rb |
e4ec9ce78d879fc20bae0c5c7886a3bdbfab096c | diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/associations/join_dependency.rb
+++ b/activerecord/lib/active_record/associations/join_dependency.rb
@@ -61,7 +61,7 @@ module ActiveRecord
build tree, @join_root, Arel::InnerJoin
end
- def graft(*associations)
+ def graft(associations)
associations.reject { |join_node|
find_node join_node
}.each { |join_node|
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/relation/query_methods.rb
+++ b/activerecord/lib/active_record/relation/query_methods.rb
@@ -950,7 +950,7 @@ module ActiveRecord
join_list
)
- join_dependency.graft(*stashed_association_joins)
+ join_dependency.graft(stashed_association_joins)
joins = join_dependency.join_constraints | stop splatting things back and forth | rails_rails | train | rb,rb |
5c093eb0287fa159bb67aaaaaa31c6cca4a5e9b1 | diff --git a/lib/qbwc/session.rb b/lib/qbwc/session.rb
index <HASH>..<HASH> 100644
--- a/lib/qbwc/session.rb
+++ b/lib/qbwc/session.rb
@@ -87,13 +87,14 @@ class QBWC::Session
def parse_response_header(response)
self.iterator_id = nil
+ response = response.first if response.is_a? Array
return unless response.is_a?(Hash) && response['xml_attributes']
@status_code, status_severity, status_message, iterator_remaining_count, iterator_id = \
response['xml_attributes'].values_at('statusCode', 'statusSeverity', 'statusMessage',
'iteratorRemainingCount', 'iteratorID')
if status_severity == 'Error' || @status_code.to_i > 1
- self.error = "QBWC ERROR: #{status_code} - #{status_message}"
+ self.error = "QBWC ERROR: #{@status_code} - #{status_message}"
else
self.iterator_id = iterator_id if iterator_remaining_count.to_i > 0
end | fix for getting qb error on response for multiple requests | qbwc_qbwc | train | rb |
2d042274ac9ee6cd03aabcb861126937a29feb1a | diff --git a/examples/run_lm_finetuning.py b/examples/run_lm_finetuning.py
index <HASH>..<HASH> 100644
--- a/examples/run_lm_finetuning.py
+++ b/examples/run_lm_finetuning.py
@@ -71,9 +71,15 @@ class TextDataset(Dataset):
text = f.read()
tokenized_text = tokenizer.convert_tokens_to_ids(tokenizer.tokenize(text))
+
+ tokenized_text = tokenizer.add_special_tokens_single_sentence(tokenized_text)
while len(tokenized_text) >= block_size: # Truncate in block of block_size
- self.examples.append(tokenized_text[:block_size])
- tokenized_text = tokenized_text[block_size:]
+ if isinstance(tokenizer, (BertTokenizer, RobertaTokenizer)):
+ self.examples.append(tokenizer.add_special_tokens_single_sentence(tokenized_text[:block_size - 2]))
+ tokenized_text = tokenized_text[block_size - 2:]
+ else:
+ self.examples.append(tokenized_text[:block_size])
+ tokenized_text = tokenized_text[block_size:]
# Note that we are loosing the last truncated example here for the sake of simplicity (no padding)
# If your dataset is small, first you should loook for a bigger one :-) and second you
# can change this behavior by adding (model specific) padding. | Sequence special token handling for BERT and RoBERTa | huggingface_pytorch-pretrained-BERT | 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.