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 |
|---|---|---|---|---|---|
e7269357d0ea3e33b163758ceae96ffc1454ad2f | diff --git a/app/components/validated-input-component.js b/app/components/validated-input-component.js
index <HASH>..<HASH> 100644
--- a/app/components/validated-input-component.js
+++ b/app/components/validated-input-component.js
@@ -5,17 +5,24 @@ App.ValidatedInputComponent = Ember.TextField.extend({
isValid: Ember.computed.empty('errors'),
isInvalid: Ember.computed.notEmpty('errors'),
+ save: "save",
focusOut: function () {
this.set('error', this.get('isInvalid'));
},
- keyUp: function () {
+ keyUp: function (e) {
if ( this.get('isValid') ) {
this.set('error', false);
}
},
+ keyDown: function(e) {
+ if (e.keyCode === 13) {
+ this.sendAction('save');
+ }
+ },
+
observeErrors: function () {
if ( !this.get('parentModel') ) return;
this.get('parentModel').addObserver('errors.' + this.get('name'), this, this.syncErrors); | Issue #<I> - handle pressing 'enter' for forms | dollarshaveclub_ember-uni-form | train | js |
8937425c185cacfe100462013f23673426591e5f | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -89,7 +89,7 @@ var phantomjsHtml = module.exports = {
var requestURL = domain + req.originalUrl;
requestURL = requestURL.replace(/(\?|&)_escaped_fragment_=?/,'');
-
+
phantomjsHtml.getHTML(requestURL, function(err, output){
if(err){
console.log('PHANTOMJS-HTML ERROR :', err);
@@ -167,7 +167,7 @@ var phantomjsHtml = module.exports = {
// check _escaped_fragment_
var parsedQuery = url.parse(req.url, true).query;
- if(parsedQuery && parsedQuery.hasOwnProperty('_escaped_fragment_')){
+ if(parsedQuery && '_escaped_fragment_' in parsedQuery){
return true;
}
@@ -186,13 +186,13 @@ var phantomjsHtml = module.exports = {
var childArgs = [
path.join(__dirname, 'script.js'), URL
];
-
+
childProcess.execFile(phantomjs.path, childArgs, function(err, stdout, stderr) {
if(stderr) {
callback(stderr, null);
- } else {
+ } else {
callback(null, stdout.toString());
}
});
}
-}
\ No newline at end of file
+} | Replace hasOwnProperty with in for node v6. | wmcmurray_phantomjs-html | train | js |
df2a9b2fb3b35a0c6de8e7d18c2fea32aeb5ca4e | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -342,7 +342,6 @@ module.exports = function( grunt ) {
grunt.loadNpmTasks("grunt-saucelabs");
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
- grunt.loadNpmTasks('grunt-contrib-concat');
function runIndependentTest( file, cb , env) {
var fs = require("fs"); | Avoid loading unused Grunt tasks | petkaantonov_bluebird | train | js |
4e6ad2d6b91c46d256945467c836f935db7687b1 | diff --git a/lib/railsdav/renderer.rb b/lib/railsdav/renderer.rb
index <HASH>..<HASH> 100644
--- a/lib/railsdav/renderer.rb
+++ b/lib/railsdav/renderer.rb
@@ -139,7 +139,7 @@ module Railsdav
response_hash = {
:quota_used_bytes => 0,
:quota_available_bytes => 10.gigabytes,
- :creationdate => updated_at.rfc2822,
+ :creationdate => updated_at.iso8601,
:getlastmodified => updated_at.rfc2822,
:getcontentlength => hash[:size],
:getcontenttype => hash[:format].to_s | Creation date is supposed to be in ISO <I> format.
Inconsistent and weird, I know. | wvk_railsdav | train | rb |
ca2b340022da28d9f580b57572fbd7de7b31a911 | diff --git a/lib/librarian/manifest_set.rb b/lib/librarian/manifest_set.rb
index <HASH>..<HASH> 100644
--- a/lib/librarian/manifest_set.rb
+++ b/lib/librarian/manifest_set.rb
@@ -78,8 +78,10 @@ module Librarian
until names.empty?
name = names.shift
manifest = index.delete(name)
- manifest.dependencies.each do |dependency|
- names << dependency.name
+ if manifest
+ manifest.dependencies.each do |dependency|
+ names << dependency.name
+ end
end
end
self | Fix an edge case where it was sending #dependencies to nil. | applicationsonline_librarian | train | rb |
728b5c6f2b1dd374ba1c8b1db6702248127bbdfa | diff --git a/lib/activerecord-multi-tenant/query_rewriter.rb b/lib/activerecord-multi-tenant/query_rewriter.rb
index <HASH>..<HASH> 100644
--- a/lib/activerecord-multi-tenant/query_rewriter.rb
+++ b/lib/activerecord-multi-tenant/query_rewriter.rb
@@ -31,6 +31,7 @@ module MultiTenant
@arel_node = arel_node
@known_relations = []
@handled_relations = []
+ @discovering = false
end
def discover_relations | init discovering instance var in Context to false to fix warning | citusdata_activerecord-multi-tenant | train | rb |
79b02dd35ff99113395fb476deb2dab5c6b05b4b | diff --git a/src/client/voice/dispatcher/StreamDispatcher.js b/src/client/voice/dispatcher/StreamDispatcher.js
index <HASH>..<HASH> 100644
--- a/src/client/voice/dispatcher/StreamDispatcher.js
+++ b/src/client/voice/dispatcher/StreamDispatcher.js
@@ -140,7 +140,7 @@ class StreamDispatcher extends Writable {
if (!this.pausedSince) return;
this._pausedTime += Date.now() - this.pausedSince;
this.pausedSince = null;
- if (this._writeCallback) this._writeCallback();
+ if (typeof this._writeCallback === 'function') this._writeCallback();
}
/**
@@ -195,13 +195,11 @@ class StreamDispatcher extends Writable {
}
_step(done) {
- if (this.pausedSince) {
- this._writeCallback = done;
- return;
- }
+ this._writeCallback = done;
+ if (this.pausedSince) return;
if (!this.streams.broadcast) {
const next = FRAME_LENGTH + (this.count * FRAME_LENGTH) - (Date.now() - this.startTime - this.pausedTime);
- setTimeout(done.bind(this), next);
+ setTimeout(this._writeCallback.bind(this), next);
}
this._sdata.sequence++;
this._sdata.timestamp += TIMESTAMP_INC; | voice: resolve "cb is not a function" error (#<I>) | discordjs_discord.js | train | js |
62e234ca01147a1dc918f73690d83402ddb050d8 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -23,9 +23,9 @@ requirements = [
setup(
name='pipreqs',
version=__version__,
- description="Pip requirements.txt generator based on imports in project",
+ description='Pip requirements.txt generator based on imports in project',
long_description=readme + '\n\n' + history,
- author="Vadim Kravcenko",
+ author='Vadim Kravcenko',
author_email='vadim.kravcenko@gmail.com',
url='https://github.com/bndr/pipreqs',
packages=[
@@ -36,7 +36,7 @@ setup(
include_package_data=True,
package_data={'': ['stdlib','mapping']},
install_requires=requirements,
- license="Apache License",
+ license='Apache License',
zip_safe=False,
keywords='pip requirements imports',
classifiers=[
@@ -44,7 +44,7 @@ setup(
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
- "Programming Language :: Python :: 2",
+ 'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4', | Use single quotes consistently in setup.py | bndr_pipreqs | train | py |
a05c54f2ca1128e95fc9aced9c7e7d3c16c22a78 | diff --git a/discoverd/server/store.go b/discoverd/server/store.go
index <HASH>..<HASH> 100644
--- a/discoverd/server/store.go
+++ b/discoverd/server/store.go
@@ -223,7 +223,7 @@ func (s *Store) Close() error {
}
}
if s.raft != nil {
- s.raft.Shutdown()
+ s.raft.Shutdown().Error()
s.raft = nil
}
if s.transport != nil { | discoverd: Wait for Raft shutdown in Store.Close | flynn_flynn | train | go |
c800ae534c8a5019f69ee5ff3ff837c7ba037d5d | diff --git a/vm/vmExpr.go b/vm/vmExpr.go
index <HASH>..<HASH> 100644
--- a/vm/vmExpr.go
+++ b/vm/vmExpr.go
@@ -844,6 +844,9 @@ func invokeExpr(expr ast.Expr, env *Env) (reflect.Value, error) {
if err != nil {
return NilValue, NewError(expr, err)
}
+ if rt == nil {
+ return NilValue, NewStringError(expr, fmt.Sprintf("invalid type for make"))
+ }
if rt.Kind() == reflect.Map {
return reflect.MakeMap(reflect.MapOf(rt.Key(), rt.Elem())).Convert(rt), nil
} | Updated MakeExpr, added nil type check | mattn_anko | train | go |
ef9551a7330aa77261a3a9074c8b7a99ac2b6690 | diff --git a/raiden/transfer/mediated_transfer/target.py b/raiden/transfer/mediated_transfer/target.py
index <HASH>..<HASH> 100644
--- a/raiden/transfer/mediated_transfer/target.py
+++ b/raiden/transfer/mediated_transfer/target.py
@@ -241,7 +241,7 @@ def handle_block(
channel_state.partner_state,
lock.secrethash,
)
- lock_has_expired, lock_expired_msg = channel.is_lock_expired(
+ lock_has_expired, _ = channel.is_lock_expired(
end_state=channel_state.our_state,
lock=lock,
block_number=block_number,
@@ -252,7 +252,7 @@ def handle_block(
failed = EventUnlockClaimFailed(
identifier=transfer.payment_identifier,
secrethash=transfer.lock.secrethash,
- reason=f'lock expired {lock_expired_msg}',
+ reason=f'lock expired',
)
target_state.state = 'expired'
events = [failed] | Fixed log message
When the lock has expired the message is None, appending it to the event
will result in the string `lock expired None`. | raiden-network_raiden | train | py |
a53a1e896d6a63350413c1da21240de3fc0260c9 | diff --git a/sumy/models/dom/_sentence.py b/sumy/models/dom/_sentence.py
index <HASH>..<HASH> 100644
--- a/sumy/models/dom/_sentence.py
+++ b/sumy/models/dom/_sentence.py
@@ -44,4 +44,7 @@ class Sentence(object):
return " ".join(self._words)
def __repr__(self):
- return to_string("<Sentence: %s>") % self.__str__()
+ return to_string("<%s: %s>") % (
+ "Heading" if self._is_heading else "Sentence",
+ self.__str__()
+ ) | Better string representation for sentence of DOM | miso-belica_sumy | train | py |
b2d7034c1c18f17ea4b7aa4e0ae0c53874efc77a | diff --git a/src/Sylius/Bundle/CoreBundle/OAuth/UserProvider.php b/src/Sylius/Bundle/CoreBundle/OAuth/UserProvider.php
index <HASH>..<HASH> 100644
--- a/src/Sylius/Bundle/CoreBundle/OAuth/UserProvider.php
+++ b/src/Sylius/Bundle/CoreBundle/OAuth/UserProvider.php
@@ -41,7 +41,8 @@ class UserProvider extends FOSUBUserProvider
*/
public function __construct(UserManagerInterface $userManager, RepositoryInterface $oauthRepository)
{
- $this->userManager = $userManager;
+ parent::__construct($userManager, array());
+
$this->oauthRepository = $oauthRepository;
} | [CoreBundle] OAuth provider should call parent class instead of direct assign | Sylius_Sylius | train | php |
ec90a96a9ad431a8d32fc7ced9ef46025637830d | diff --git a/bin/run.js b/bin/run.js
index <HASH>..<HASH> 100755
--- a/bin/run.js
+++ b/bin/run.js
@@ -111,10 +111,15 @@ function main () {
}
function constructDefaultArgs () {
+ var defaultTimeout = 30
+ if (global.__coverage__) {
+ defaultTimeout = 240
+ }
+
var defaultArgs = {
nodeArgs: [],
nycArgs: [],
- timeout: process.env.TAP_TIMEOUT || 30,
+ timeout: +process.env.TAP_TIMEOUT || defaultTimeout,
color: supportsColor,
reporter: null,
files: [],
@@ -131,10 +136,6 @@ function constructDefaultArgs () {
statements: 0
}
- if (global.__coverage__) {
- defaultArgs.timeout = 240
- }
-
if (process.env.TAP_COLORS !== undefined) {
defaultArgs.color = !!(+process.env.TAP_COLORS)
}
diff --git a/test/rcfiles.js b/test/rcfiles.js
index <HASH>..<HASH> 100644
--- a/test/rcfiles.js
+++ b/test/rcfiles.js
@@ -31,7 +31,10 @@ var defaults = {
}
function runTest (rcFile, expect) { return function (t) {
- var env = { HOME: process.env.HOME }
+ var env = {
+ HOME: process.env.HOME,
+ TAP_TIMEOUT: 30
+ }
if (rcFile) {
env.TAP_RCFILE = rcFile | hard-code TAP_TIMEOUT in rcfiles test
Otherwise running with coverage fails, because of bigger default | tapjs_node-tap | train | js,js |
c4f58a70564e4eb1ba13a57b1874b89131a24d02 | diff --git a/Symfony/CS/AbstractPhpdocTypesFixer.php b/Symfony/CS/AbstractPhpdocTypesFixer.php
index <HASH>..<HASH> 100644
--- a/Symfony/CS/AbstractPhpdocTypesFixer.php
+++ b/Symfony/CS/AbstractPhpdocTypesFixer.php
@@ -97,7 +97,7 @@ abstract class AbstractPhpdocTypesFixer extends AbstractFixer
private function normalizeTypes(array $types)
{
foreach ($types as $index => $type) {
- $types[$index] = static::normalizeType($type);
+ $types[$index] = $this->normalizeType($type);
}
return $types; | AbstractPhpdocTypesFixer - instance method should be called on instance | FriendsOfPHP_PHP-CS-Fixer | train | php |
79826b21a4bf417d86315739ffd376a1890bff39 | diff --git a/tests/test_data_cloud.py b/tests/test_data_cloud.py
index <HASH>..<HASH> 100644
--- a/tests/test_data_cloud.py
+++ b/tests/test_data_cloud.py
@@ -52,7 +52,7 @@ def _should_test_gcp():
try:
check_output(['gcloud', 'auth', 'activate-service-account',
'--key-file', creds])
- except CalledProcessError:
+ except (CalledProcessError, FileNotFoundError):
return False
return True | test: gcp: handle FileNotFoundError | iterative_dvc | train | py |
026c6bbe1eed031954ccf9e27325f9d06a2233de | diff --git a/supermercado/scripts/cli.py b/supermercado/scripts/cli.py
index <HASH>..<HASH> 100644
--- a/supermercado/scripts/cli.py
+++ b/supermercado/scripts/cli.py
@@ -32,7 +32,7 @@ cli.add_command(edges)
@click.option('--parsenames', is_flag=True)
def union(inputtiles, parsenames):
"""
- Returns the unioned shape of a steeam of [<x>, <y>, <z>] tiles in GeoJSON.
+ Returns the unioned shape of a stream of [<x>, <y>, <z>] tiles in GeoJSON.
"""
try:
inputtiles = click.open_file(inputtiles).readlines()
@@ -60,4 +60,4 @@ def burn(features, sequence, zoom):
click.echo(t.tolist())
-cli.add_command(burn)
\ No newline at end of file
+cli.add_command(burn) | Update cli.py
Fix typo in supermercado/scripts/cli.py | mapbox_supermercado | train | py |
42f31dac5fd29038b69aac3b84ec8974cbe6cbd1 | diff --git a/lib/SearchEngine.js b/lib/SearchEngine.js
index <HASH>..<HASH> 100644
--- a/lib/SearchEngine.js
+++ b/lib/SearchEngine.js
@@ -5,6 +5,7 @@ module.exports = function (options) {
var SearchIndex = require('search-index');
var path = require('path');
+ var fs = require('extfs');
var preparer = require('./Preparer.js');
var cfi = require('./CFI.js');
@@ -18,8 +19,11 @@ module.exports = function (options) {
this.indexing = function (pathToEpubs, callback) {
+ if(fs.isEmptySync(pathToEpubs))
+ return callback(new Error('Can`t index empty folder: ' + pathToEpubs));
+
console.log("normalize epub content");
-
+
path.normalize(pathToEpubs);
preparer.normalize(pathToEpubs, function (dataSet) {
@@ -103,4 +107,8 @@ module.exports = function (options) {
this.empty = function (callback) {
si.empty(callback);
};
+
+ this.close = function(callback) {
+ si.close(callback);
+ }
};
\ No newline at end of file | - added contract to check epub data folder is not empty
- added close() | larsvoigt_epub-full-text-search | train | js |
f40ec2563e71c613697c53bb4effb7ba05f60015 | diff --git a/spec/search_spec.rb b/spec/search_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/search_spec.rb
+++ b/spec/search_spec.rb
@@ -75,6 +75,15 @@ describe "Search" do
search.username.should be_nil
end
+ it "should use custom scopes before normalizing" do
+ User.create(:username => "bjohnson")
+ User.named_scope :username, lambda { |value| {:conditions => {:username => value.reverse}} }
+ search1 = User.search(:username => "bjohnson")
+ search2 = User.search(:username => "nosnhojb")
+ search1.count.should == 0
+ search2.count.should == 1
+ end
+
it "should ignore blank values in arrays" do
search = User.search
search.conditions = {"username_equals_any" => [""]} | Added a failing test for existing scopes that share their names with column names being ignored. | binarylogic_searchlogic | train | rb |
6fdfed1d1c0ca3bc1f4bdf09d4b7fbc9067d6ad4 | diff --git a/app/models/artefact.rb b/app/models/artefact.rb
index <HASH>..<HASH> 100644
--- a/app/models/artefact.rb
+++ b/app/models/artefact.rb
@@ -82,6 +82,7 @@ class Artefact
"travel-advice-publisher" => ["travel-advice"],
"specialist-publisher" => ["aaib_report",
"cma_case",
+ "countryside_stewardship_grant",
"drug_safety_update",
"international_development_fund",
"maib_report", | Add countryside stewardship grant
This format is published from Specialist Publisher initially just by
DEFRA editors and will be listed as a Finder. Ticket:
<URL> | alphagov_govuk_content_models | train | rb |
f0312c3de358ee034bf38afb521c90cda90149b2 | diff --git a/Kwc/Basic/Svg/Component.php b/Kwc/Basic/Svg/Component.php
index <HASH>..<HASH> 100644
--- a/Kwc/Basic/Svg/Component.php
+++ b/Kwc/Basic/Svg/Component.php
@@ -25,7 +25,10 @@ class Kwc_Basic_Svg_Component extends Kwc_Abstract
$ret['fileSource'] = file_get_contents($uploadRow->getFileSource());
} else if ($ret['outputType'] === 'url') {
$filename = $uploadRow->filename . '.' . $uploadRow->extension;
- $ret['fileUrl'] = Kwf_Media::getUrl($this->getData()->componentClass, $this->getData()->componentId, 'default', $filename);
+ $url = Kwf_Media::getUrl($this->getData()->componentClass, $this->getData()->componentId, 'default', $filename);
+ $ev = new Kwf_Component_Event_CreateMediaUrl($this->getData()->componentClass, $this->getData(), $url);
+ Kwf_Events_Dispatcher::fireEvent($ev);
+ $ret['fileUrl'] = $ev->url;
}
} | Support cdn also for SVG-Component | koala-framework_koala-framework | train | php |
1795b2821e0027bfb8c14923ff9eb88434b49859 | diff --git a/src/main/java/java/money/module-info.java b/src/main/java/java/money/module-info.java
index <HASH>..<HASH> 100644
--- a/src/main/java/java/money/module-info.java
+++ b/src/main/java/java/money/module-info.java
@@ -19,6 +19,7 @@ module java.money {
uses javax.money.spi.MonetaryAmountsSingletonQuerySpi;
uses javax.money.spi.MonetaryAmountsSingletonSpi;
uses javax.money.spi.MonetaryConversionsSingletonSpi;
+ uses javax.money.spi.MonetaryCurrenciesSingletonSpi;
uses javax.money.spi.MonetaryFormatsSingletonSpi;
uses javax.money.spi.MonetaryRoundingsSingletonSpi;
uses javax.money.spi.RoundingProviderSpi; | Add uses MonetaryCurrenciesSingletonSpi
Monetary.MONETARY_CURRENCIES_SINGLETON_SPI() tries to use ServiceLoader
for loading MonetaryCurrenciesSingletonSpi but it is not declared in
the module info.
This should fix <URL> | JavaMoney_jsr354-api | train | java |
7c880eb5cf71a4aa12221c7e314e47a64a4a467e | diff --git a/libkbfs/md_ops_concur_test.go b/libkbfs/md_ops_concur_test.go
index <HASH>..<HASH> 100644
--- a/libkbfs/md_ops_concur_test.go
+++ b/libkbfs/md_ops_concur_test.go
@@ -27,7 +27,6 @@ func (m *MDOpsConcurTest) GetForHandle(handle *DirHandle) (
}
func (m *MDOpsConcurTest) GetForTLF(id DirID) (*RootMetadata, error) {
- fmt.Printf("HERE in GETFORTLF\n")
_, ok := <-m.enter
if !ok {
// Only one caller should ever get here | md_ops_concur_test: remove debugging statement | keybase_client | train | go |
8773e9244d06221abd5090d3b1ef616a412d41c9 | diff --git a/addon/controllers/edit-form.js b/addon/controllers/edit-form.js
index <HASH>..<HASH> 100644
--- a/addon/controllers/edit-form.js
+++ b/addon/controllers/edit-form.js
@@ -284,17 +284,13 @@ export default Ember.Controller.extend(
* This method invokes by `resetController` in the `edit-form` route.
*
* @method rollbackHasManyRelationships
- * @public
- *
- * @param {DS.Model} processedModel Model to rollback its relations (controller's model will be used if undefined).
+ * @param {DS.Model} model Record with hasMany relationships.
*/
- rollbackHasManyRelationships: function(processedModel) {
- let model = processedModel ? processedModel : this.get('model');
- let promises = Ember.A();
+ rollbackHasManyRelationships: function(model) {
model.eachRelationship((name, desc) => {
if (desc.kind === 'hasMany') {
model.get(name).filterBy('hasDirtyAttributes', true).forEach((record) => {
- promises.pushObject(record.rollbackAttributes());
+ record.rollbackAttributes();
});
}
}); | Refactor rollbackHasManyRelationships in edit-form | Flexberry_ember-flexberry | train | js |
fc08b8c3678b505e6745dbe065a107d31b15cf37 | diff --git a/src/MvcCore/Ext/Debugs/Tracy.php b/src/MvcCore/Ext/Debugs/Tracy.php
index <HASH>..<HASH> 100644
--- a/src/MvcCore/Ext/Debugs/Tracy.php
+++ b/src/MvcCore/Ext/Debugs/Tracy.php
@@ -183,7 +183,6 @@ namespace {
\Tracy\Dumper::DEBUGINFO => TRUE,
];
foreach ($args as $arg) {
-
if ($isCli) {
\Tracy\Dumper::dump($arg, $options);
} else {
@@ -209,7 +208,15 @@ namespace {
if (count($args) > 0)
foreach ($args as $arg)
\Tracy\Debugger::log($arg, \Tracy\ILogger::DEBUG);
- \Tracy\Debugger::getBlueScreen()->render(NULL);
+ if (PHP_SAPI === 'cli') {
+ echo 'Stopped' . PHP_EOL;
+ } else {
+ try {
+ throw new \Exception('Stopped.', 500);
+ } catch (\Exception $e) {
+ \Tracy\Debugger::getBlueScreen()->render($e);
+ }
+ }
exit;
}
} | updates for production dumping in cli | mvccore_ext-debug-tracy | train | php |
6d17e24565f631a8f99e42fb82e2a91e000ab749 | diff --git a/cli/environment-builder.js b/cli/environment-builder.js
index <HASH>..<HASH> 100644
--- a/cli/environment-builder.js
+++ b/cli/environment-builder.js
@@ -90,7 +90,7 @@ module.exports = class EnvironmentBuilder {
*/
_lookupJHipster() {
// Register jhipster generators.
- this.env.lookup({ packagePaths: [path.join(__dirname, '..')] }).forEach(generator => {
+ this.env.lookup({ packagePaths: [path.join(__dirname, '..')], lookups: ['generators'] }).forEach(generator => {
// Verify jhipster generators namespace.
assert(
generator.namespace.startsWith(`${CLI_NAME}:`), | Limit lookup to generators/*/index | jhipster_generator-jhipster | train | js |
44409eee500e72e78828d39fed0663c8140d920f | diff --git a/js/binance.js b/js/binance.js
index <HASH>..<HASH> 100644
--- a/js/binance.js
+++ b/js/binance.js
@@ -152,7 +152,7 @@ module.exports = class binance extends Exchange {
'userDataStream',
'futures/transfer',
// lending
- 'lending/customizedFixed/purchase'
+ 'lending/customizedFixed/purchase',
'lending/daily/purchase',
'lending/daily/redeem',
], | binance.js minor edit/linting | ccxt_ccxt | train | js |
678c0d2eae183a669133b32c32e281c84eb1a90b | diff --git a/test/test.js b/test/test.js
index <HASH>..<HASH> 100644
--- a/test/test.js
+++ b/test/test.js
@@ -339,6 +339,29 @@ describe('Localization', function () {
payload.message.should.equal('No localization available for en-US');
});
+ it('allows other plugins to handle pre response', async () => {
+ let otherPluginCalled = false;
+ const otherPluginWithPreResponseHandling = {
+ name: 'onPreResponseTest',
+ register: function (server, options) {
+ server.ext('onPreResponse', function (request, h) {
+ otherPluginCalled = true;
+ return h.continue;
+ });
+ }
+ };
+ await server.register({plugin: otherPluginWithPreResponseHandling});
+ const response = await server.inject(
+ {
+ method: 'GET',
+ url: '/en-US/localized/resource'
+ }
+ );
+ const payload = JSON.parse(response.payload);
+ payload.statusCode.should.equal(404);
+ otherPluginCalled.should.be.true();
+ });
+
it('is available in the validation failAction handler ', async () => {
const response = await server.inject(
{
@@ -476,6 +499,7 @@ describe('Localization', function () {
response.statusCode.should.equal(404);
should(response.result).startWith('<!DOCTYPE html><html lang=');
});
+
});
}) | Added test to verfify plugin returns with continue when language code is not found | funktionswerk_hapi-i18n | train | js |
e134e21b783a6fc5382959cb858a4bab53e04503 | diff --git a/lib/Predis.php b/lib/Predis.php
index <HASH>..<HASH> 100644
--- a/lib/Predis.php
+++ b/lib/Predis.php
@@ -646,16 +646,13 @@ class ResponseReader {
}
$prefix = $header[0];
- $payload = strlen($header) > 1 ? substr($header, 1) : '';
-
if (!isset($this->_prefixHandlers[$prefix])) {
Utils::onCommunicationException(new MalformedServerResponse(
$connection, "Unknown prefix '$prefix'"
));
}
-
$handler = $this->_prefixHandlers[$prefix];
- return $handler->handle($connection, $payload);
+ return $handler->handle($connection, substr($header, 1));
}
} | Remove a useless check for the payload length. | imcj_predis | train | php |
de2dad20d5c69197cec88d77196b0b3f739b2c88 | diff --git a/gns3server/modules/virtualbox/virtualbox_vm.py b/gns3server/modules/virtualbox/virtualbox_vm.py
index <HASH>..<HASH> 100644
--- a/gns3server/modules/virtualbox/virtualbox_vm.py
+++ b/gns3server/modules/virtualbox/virtualbox_vm.py
@@ -250,7 +250,7 @@ class VirtualBoxVM(BaseVM):
log.debug("Stop result: {}".format(result))
log.info("VirtualBox VM '{name}' [{id}] stopped".format(name=self.name, id=self.id))
- # yield from asyncio.sleep(0.5) # give some time for VirtualBox to unlock the VM
+ yield from asyncio.sleep(0.5) # give some time for VirtualBox to unlock the VM
try:
# deactivate the first serial port
yield from self._modify_vm("--uart1 off") | Renable sleep at Vbox exit bug seem to be back
Fix <URL> | GNS3_gns3-server | train | py |
acdd039dc6594c05cfcd56915b02c04265f7d461 | diff --git a/lib/torquespec/version.rb b/lib/torquespec/version.rb
index <HASH>..<HASH> 100644
--- a/lib/torquespec/version.rb
+++ b/lib/torquespec/version.rb
@@ -1,3 +1,3 @@
module TorqueSpec
- VERSION = "0.3.5"
+ VERSION = "0.3.6"
end | Cutting a release that supports injection better. | torquebox_torquespec | train | rb |
de4cfad0bafff49862b746ad1bd9dad1985c6d2e | diff --git a/context.go b/context.go
index <HASH>..<HASH> 100644
--- a/context.go
+++ b/context.go
@@ -68,7 +68,7 @@ const (
methods = "GET,PUT,POST,DELETE"
corsCType = "Content-Type, *"
trueStr = "true"
- jsonCT = "application/json"
+ jsonCT = "application/json;charset=utf8"
hOrigin = "Origin"
) | context: support utf8 in JSON() responses | gramework_gramework | train | go |
ba07ef88f6f2e324d62c610b4a9a431cc1c13bb3 | diff --git a/libraries/lithium/tests/cases/template/helpers/FormTest.php b/libraries/lithium/tests/cases/template/helpers/FormTest.php
index <HASH>..<HASH> 100644
--- a/libraries/lithium/tests/cases/template/helpers/FormTest.php
+++ b/libraries/lithium/tests/cases/template/helpers/FormTest.php
@@ -46,6 +46,12 @@ class FormTest extends \lithium\test\Unit {
$this->context = new MockFormRenderer();
$this->form = new Form(array('context' => $this->context));
}
+
+ public function tearDown() {
+ foreach ($this->_routes as $route) {
+ Router::connect($route);
+ }
+ }
public function testFormCreation() {
$base = trim($this->context->request()->env('base'), '/') . '/'; | adding tearDown to form to reset routes | UnionOfRAD_framework | train | php |
7c60cafd90aca59cbcefc62965747b3d05af7a62 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -22,6 +22,9 @@ module.exports = {
get UFDS() {
return require('./ufds');
},
+ get UFDS2() {
+ return require('./ufds2');
+ },
get Config() {
return require('./config');
}, | PUBAPI-<I>: Need to be able to use new UFDS including account users | joyent_node-sdc-clients | train | js |
1b1d483e5a84a60641a9924adc2f7db775c85368 | diff --git a/quandl/message.py b/quandl/message.py
index <HASH>..<HASH> 100644
--- a/quandl/message.py
+++ b/quandl/message.py
@@ -24,10 +24,10 @@ class Message:
WARN_DATA_LIMIT_EXCEEDED = 'This call exceeds the amount of data that quandl.get_table() allows. \
Please use the following link in your browser, which will download the full results as \
- a CSV file: https://www.quandl.com/api/v3/datatables/%s?qopts.export=true&api_key=%s. See \
+ a CSV file: https://www.quandl.com/api/v3/datatables/%s?qopts.export=true&api_key=%s . See \
our API documentation for more info: \
https://docs.quandl.com/docs/in-depth-usage-1#section-download-an-entire-table'
- WARN_PAGE_LIMIT_EXCEEDED = 'To request more pages, please set paginate=true in your \
+ WARN_PAGE_LIMIT_EXCEEDED = 'To request more pages, please set paginate=True in your \
quandl.get_table() call. For more information see our documentation: \
https://github.com/quandl/quandl-python/blob/master/FOR_ANALYSTS.md#things-to-note'
WARN_PARAMS_NOT_SUPPORTED = '%s will no longer supported. Please use %s instead' | Fix two small typos. (#<I>) | quandl_quandl-python | train | py |
96dc568153de6b556b889d44b9421df48bedfa65 | diff --git a/djcelery_model/models.py b/djcelery_model/models.py
index <HASH>..<HASH> 100644
--- a/djcelery_model/models.py
+++ b/djcelery_model/models.py
@@ -1,8 +1,10 @@
# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
from django.db import models
from django.db.models import Q
from django.db.models.query import QuerySet
from django.contrib.contenttypes.models import ContentType
+from django.utils.encoding import python_2_unicode_compatible
try:
# Django >= 1.7
@@ -59,6 +61,7 @@ class ModelTaskMetaManager(ModelTaskMetaFilterMixin, models.Manager):
def get_queryset(self):
return ModelTaskMetaQuerySet(self.model, using=self._db)
+@python_2_unicode_compatible
class ModelTaskMeta(models.Model):
STATES = (
(ModelTaskMetaState.PENDING, 'PENDING'),
@@ -77,9 +80,6 @@ class ModelTaskMeta(models.Model):
objects = ModelTaskMetaManager()
- def __unicode__(self):
- return u'%s: %s' % (self.task_id, dict(self.STATES)[self.state])
-
def __str__(self):
return '%s: %s' % (self.task_id, dict(self.STATES)[self.state]) | Simplify Python 2 and 3 unicode compatibility | mback2k_django-celery-model | train | py |
33368e9bad49c41424eef319a6b22e414d9cd9b2 | diff --git a/src/lib/widget.js b/src/lib/widget.js
index <HASH>..<HASH> 100644
--- a/src/lib/widget.js
+++ b/src/lib/widget.js
@@ -105,7 +105,8 @@ define(['./assets', './webfinger', './hardcoded', './wireClient', './sync', './s
'_content': 'This app allows you to use your own data storage!<br/>Click for more info on remotestorage.'
}),
userAddress: el('input', 'remotestorage-useraddress', {
- 'placeholder': 'user@host'
+ 'placeholder': 'user@host',
+ 'type': 'email'
}),
style: el('style') | give user address input type=email (refs #<I>) | remotestorage_remotestorage.js | train | js |
6a8859d19eaf1074bf73c02988c8363a78e7651e | diff --git a/client/state/google-my-business/actions.js b/client/state/google-my-business/actions.js
index <HASH>..<HASH> 100644
--- a/client/state/google-my-business/actions.js
+++ b/client/state/google-my-business/actions.js
@@ -45,8 +45,8 @@ export const disconnectGoogleMyBusinessLocation = siteId => dispatch => {
return dispatch(
saveSiteSettings( siteId, {
- google_my_business_keyring_id: null,
- google_my_business_location_id: null,
+ google_my_business_keyring_id: false,
+ google_my_business_location_id: false,
} )
).then( ( { updated } ) => {
if ( | Send false to unset site settings properties instead of null | Automattic_wp-calypso | train | js |
ac0deea8340e3ab671f5a3f62d24a864f2e27cf5 | diff --git a/tests/pathops_test.py b/tests/pathops_test.py
index <HASH>..<HASH> 100644
--- a/tests/pathops_test.py
+++ b/tests/pathops_test.py
@@ -162,7 +162,9 @@ class OpBuilderTest(object):
('lineTo', ((5220.0, 4866.92333984375),)),
('lineTo', ((5316.0, 4590.0),)),
('closePath', ()),
- ('moveTo', ((-225.0, 7425.0),)),
+ ('moveTo', ((5688.0, 7425.0),)),
+ ('lineTo', ((-225.0, 7425.0),)),
+ ('lineTo', ((-225.0, 7425.0),)),
('lineTo', ((5.0, -225.0),)),
('lineTo', ((7425.0, -225.0),)),
('lineTo', ((7425.0, 7425.0),)), | Update expected test result for SkOpBuilder after updating skia library
not sure why this changed, i'll investigate another time | fonttools_skia-pathops | train | py |
6c19abeef643b0c026686f454fd4389973b7c0d2 | diff --git a/src/test/java/picocli/Demo.java b/src/test/java/picocli/Demo.java
index <HASH>..<HASH> 100644
--- a/src/test/java/picocli/Demo.java
+++ b/src/test/java/picocli/Demo.java
@@ -32,6 +32,9 @@ import java.util.concurrent.Callable;
/**
* Demonstrates picocli subcommands.
+ * <p>
+ * Banner ascii art thanks to <a href="http://patorjk.com/software/taag/">http://patorjk.com/software/taag/</a>.
+ * </p>
*/
@Command(name = "picocli.Demo", sortOptions = false,
header = {
@@ -682,7 +685,6 @@ public class Demo implements Runnable {
CommandLine.call(new CheckSum(), System.err, args);
}
- @Override
public Void call() throws Exception {
// business logic: do different things depending on options the user specified
if (helpRequested) { | Added link to Ascii art site; removed annotations on interface methods in Demo.java to allow compilation under Java 5. | remkop_picocli | train | java |
f2b57cef41db0155d5d0961e4252c0a37d32beb8 | diff --git a/spectator-nflx-plugin/src/main/java/com/netflix/spectator/nflx/RxHttp.java b/spectator-nflx-plugin/src/main/java/com/netflix/spectator/nflx/RxHttp.java
index <HASH>..<HASH> 100644
--- a/spectator-nflx-plugin/src/main/java/com/netflix/spectator/nflx/RxHttp.java
+++ b/spectator-nflx-plugin/src/main/java/com/netflix/spectator/nflx/RxHttp.java
@@ -733,7 +733,7 @@ public final class RxHttp {
* default is to use the ip address and avoid the dns lookup.
*/
boolean useIpAddress() {
- return Spectator.config().getBoolean(prop("UseIpAddress"), true);
+ return Spectator.config().getBoolean(prop("UseIpAddress"), false);
}
/** | set UseIpAddress default to false
In some cases such as calls from vpc
to classic the host name needs to
get used so it is the safer choice.
Use IP can be explicitly set on clients
that want to avoid the DNS lookup. | Netflix_spectator | train | java |
478d7b12355e65d2d7166cd872cbc90704f9d9c8 | diff --git a/lib/voice/streams/WebmOpusTransformer.js b/lib/voice/streams/WebmOpusTransformer.js
index <HASH>..<HASH> 100644
--- a/lib/voice/streams/WebmOpusTransformer.js
+++ b/lib/voice/streams/WebmOpusTransformer.js
@@ -15,7 +15,7 @@ const TAG_TYPE_TAG = 2;
const TRACKTYPE_AUDIO = 2; // EBML spec: https://www.matroska.org/technical/specs/index.html#TrackType
-class OggOpusTransformer extends BaseTransformer {
+class WebmOpusTransformer extends BaseTransformer {
constructor(options) {
options = options || {};
super(options);
@@ -200,7 +200,7 @@ class OggOpusTransformer extends BaseTransformer {
}
}
-module.exports = OggOpusTransformer;
+module.exports = WebmOpusTransformer;
const schema = {
ae: { | Fix WebmOpusTransformer class name (#<I>) | abalabahaha_eris | train | js |
f0bc51f912079600d4895ed71d2a26689cef09b1 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -13,14 +13,15 @@ export default (env, options) => {
Object.keys(env).forEach(key => {
debug(`key "${key}" before type was ${typeof env[key]}`);
- env[key] = parseKey(env[key], key);
- debug(`key "${key}" after type was ${typeof env[key]}`);
-
- if (envOptions.assignToProcessEnv === true) {
- if (envOptions.overrideProcessEnv === true) {
- process.env[key] = env[key] || process.env[key];
- } else {
- process.env[key] = process.env[key] || env[key];
+ if (env[key]) {
+ env[key] = parseKey(env[key], key);
+ debug(`key "${key}" after type was ${typeof env[key]}`);
+ if (envOptions.assignToProcessEnv === true) {
+ if (envOptions.overrideProcessEnv === true) {
+ process.env[key] = env[key] || process.env[key];
+ } else {
+ process.env[key] = process.env[key] || env[key];
+ }
}
}
}); | fix: added null condition check (closes #<I>) | niftylettuce_dotenv-parse-variables | train | js |
f95351cc6ecd06a7b6c6921b8f793d754cf7f524 | diff --git a/httprunner/testcase.py b/httprunner/testcase.py
index <HASH>..<HASH> 100644
--- a/httprunner/testcase.py
+++ b/httprunner/testcase.py
@@ -705,8 +705,13 @@ class TestcaseParser(object):
return self.functions[item_name]
try:
- return eval(item_name)
- except NameError:
+ # check if builtin functions
+ item_func = eval(item_name)
+ if callable(item_func):
+ # is builtin function
+ return item_func
+ except (NameError, TypeError):
+ # is not builtin function, continue to search
pass
elif item_type == "variable":
if item_name in self.variables: | #<I>: add callable to check if it is function | HttpRunner_HttpRunner | train | py |
382582fcda7b107b180c0a5fb795ed62c9c91284 | diff --git a/hugolib/translations.go b/hugolib/translations.go
index <HASH>..<HASH> 100644
--- a/hugolib/translations.go
+++ b/hugolib/translations.go
@@ -69,5 +69,7 @@ func assignTranslationsToPages(allTranslations map[string]Translations, pages []
for _, translatedPage := range trans {
page.translations = append(page.translations, translatedPage)
}
+
+ pageBy(languagePageSort).Sort(page.translations)
}
} | node to page: Re-add translations sort of regular pages
Was removed by mistake.
Updates #<I> | gohugoio_hugo | train | go |
ad368799d362cb259a9ec0cb46d6311dddde0a24 | diff --git a/cobe/kvstore.py b/cobe/kvstore.py
index <HASH>..<HASH> 100644
--- a/cobe/kvstore.py
+++ b/cobe/kvstore.py
@@ -138,8 +138,12 @@ class SqliteStore(KVStore):
c.execute("PRAGMA cache_size=0")
c.execute("PRAGMA page_size=4096")
+ # Use write-ahead logging if it's available, otherwise truncate
+ journal_mode, = c.execute("PRAGMA journal_mode=WAL").fetchone()
+ if journal_mode != "wal":
+ c.execute("PRAGMA journal_mode=truncate")
+
# Speed-for-reliability tradeoffs
- c.execute("PRAGMA journal_mode=truncate")
c.execute("PRAGMA temp_store=memory")
c.execute("PRAGMA synchronous=OFF") | Use write-ahead logging in the SQLite store if it's available | pteichman_cobe | train | py |
17c2795139b425c3762440fa00f5ac0933544595 | diff --git a/internal/services/authorization/role_definition_resource.go b/internal/services/authorization/role_definition_resource.go
index <HASH>..<HASH> 100644
--- a/internal/services/authorization/role_definition_resource.go
+++ b/internal/services/authorization/role_definition_resource.go
@@ -388,8 +388,8 @@ func roleDefinitionEventualConsistencyUpdate(ctx context.Context, client azuresd
return resp, "Pending", nil
}
- if !respUpdatedOn.After(updateRequestTime) {
- // The real updated on will be after the time we requested it due to the swap out.
+ if updateRequestTime.After(respUpdatedOn) {
+ // The real updated on will be equal or after the time we requested it due to the swap out.
return resp, "Pending", nil
} | Fix: The real updated time will be equal or after the requested time for azurerm_role_definition (#<I>)
#<I> | terraform-providers_terraform-provider-azurerm | train | go |
61f9ba0878d670666624ebcbb48a9b5a93a8f8ce | diff --git a/core/src/main/java/lucee/runtime/net/mail/MailUtil.java b/core/src/main/java/lucee/runtime/net/mail/MailUtil.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/lucee/runtime/net/mail/MailUtil.java
+++ b/core/src/main/java/lucee/runtime/net/mail/MailUtil.java
@@ -157,6 +157,7 @@ public final class MailUtil {
String domain = address.substring(pos + 1);
if (local.length() > 64) return false; // local part may only be 64 characters
+ if (domain.length() > 255) return false; // domain may only be 255 characters
if (domain.charAt(0) == '.' || local.charAt(0) == '.' || local.charAt(local.length() - 1) == '.') return false; | email domain must be LT <I> characters | lucee_Lucee | train | java |
9a691e98be4087e19900f666dd9044434cd98420 | diff --git a/library/CM/Elasticsearch/Type/Location.php b/library/CM/Elasticsearch/Type/Location.php
index <HASH>..<HASH> 100644
--- a/library/CM/Elasticsearch/Type/Location.php
+++ b/library/CM/Elasticsearch/Type/Location.php
@@ -2,8 +2,6 @@
class CM_Elasticsearch_Type_Location extends CM_Elasticsearch_Type_Abstract {
- protected $_source = true;//TODO change, set for debugging
-
protected $_mapping = array(
'level' => array('type' => 'integer', 'store' => 'yes'),
'id' => array('type' => 'integer', 'store' => 'yes'), | revert source=true for location | cargomedia_cm | train | php |
3f1943c9701977ec706ffbd2d6753b953ae3cc51 | diff --git a/src/app/rocket/core/view/anglTemplate.html.php b/src/app/rocket/core/view/anglTemplate.html.php
index <HASH>..<HASH> 100644
--- a/src/app/rocket/core/view/anglTemplate.html.php
+++ b/src/app/rocket/core/view/anglTemplate.html.php
@@ -6,7 +6,7 @@ use n2n\core\N2N;
$view = HtmlView::view($this);
$html = HtmlView::html($view);
- if (N2N::isDevelopmentModeOn()) {
+ if (defined('ROCKET_DEV')) {
$html->meta()->bodyEnd()->addJs('angl-dev/runtime.js');
$html->meta()->bodyEnd()->addJs('angl-dev/polyfills.js');
$html->meta()->bodyEnd()->addJs('angl-dev/styles.js'); | ROCKET_DEV constant added | n2n_rocket | train | php |
bff132c4b20806bd8fba75ba4fd2ac94f848af0a | diff --git a/lib/yelp/burst_struct.rb b/lib/yelp/burst_struct.rb
index <HASH>..<HASH> 100644
--- a/lib/yelp/burst_struct.rb
+++ b/lib/yelp/burst_struct.rb
@@ -31,6 +31,10 @@ module BurstStruct
end
end
+ def to_json(options = {})
+ JSON.generate(@hash)
+ end
+
private
def return_or_build_struct(method_name) | Add to_json method to properly deserialize the object | Yelp_yelp-ruby | train | rb |
dca5c6c3e1bf9590c66a86e13b0db995af3f63fb | diff --git a/src/PatternLab/KSSPlugin/Listener.php b/src/PatternLab/KSSPlugin/Listener.php
index <HASH>..<HASH> 100644
--- a/src/PatternLab/KSSPlugin/Listener.php
+++ b/src/PatternLab/KSSPlugin/Listener.php
@@ -22,7 +22,7 @@ class Listener extends \PatternLab\Listener {
*/
public function __construct() {
- $this->addListener("patternData.gatherEnd","runHelper");
+ $this->addListener("patternData.codeHelperStart","runHelper");
} | hooking into a better timed event | pattern-lab_plugin-php-kss | train | php |
eb3f1abe21b472f29447fab406e3a3997e7c37c9 | diff --git a/lib/mail/message.rb b/lib/mail/message.rb
index <HASH>..<HASH> 100644
--- a/lib/mail/message.rb
+++ b/lib/mail/message.rb
@@ -1939,7 +1939,6 @@ module Mail
def add_required_fields
add_multipart_mixed_header unless !body.multipart?
- body = nil if body.nil?
add_message_id unless (has_message_id? || self.class == Mail::Part)
add_date unless has_date?
add_mime_version unless has_mime_version? | Remove confusing no-op
This line previously always set the (unused) local variable body to nil.
I assume it meant to read `self.body = nil if body.nil?` however
`body.nil?` cannot happen as the previous line would crash.
Closer inspection reveals that the initialize method calls either
init_with_string or init_with_hash, both of which eventually set the
body to non-nil. | mikel_mail | train | rb |
df287b928d447a3408b598a1d09e93c38788cd60 | diff --git a/lib/wd_sinatra/test_unit_helpers.rb b/lib/wd_sinatra/test_unit_helpers.rb
index <HASH>..<HASH> 100644
--- a/lib/wd_sinatra/test_unit_helpers.rb
+++ b/lib/wd_sinatra/test_unit_helpers.rb
@@ -6,8 +6,8 @@ module TestUnitHelpers
response ||= TestApi.json_response
print response.rest_response.errors if response.status === 500
assert response.success?, message || ["Body: #{response.rest_response.body}", "Errors: #{response.errors}", "Status code: #{response.status}"].join("\n")
- service = WSList.all.find{|s| s.verb == response.verb && s.url == response.uri[1..-1]}
- raise "Service for (#{response.verb.upcase} #{response.uri[1..-1]}) not found" unless service
+ service = WSList.find(response.verb, response.uri)
+ raise "Service for (#{response.verb.upcase} #{response.uri}) not found" unless service
unless service.response.nodes.empty?
assert response.body.is_a?(Hash), "Invalid JSON response:\n#{response.body}"
valid, errors = service.validate_hash_response(response.body) | updated the test helper to properly do a service url lookup | mattetti_wd-sinatra | train | rb |
9d8a71dc446d91e961d1bca8abfed5398c5235e0 | diff --git a/client/driver/docker.go b/client/driver/docker.go
index <HASH>..<HASH> 100644
--- a/client/driver/docker.go
+++ b/client/driver/docker.go
@@ -1852,7 +1852,7 @@ func (h *DockerHandle) Signal(s os.Signal) error {
// Kill is used to terminate the task. This uses `docker stop -t killTimeout`
func (h *DockerHandle) Kill() error {
// Stop the container
- err := h.client.StopContainer(h.containerID, uint(h.killTimeout.Seconds()))
+ err := h.waitClient.StopContainer(h.containerID, uint(h.killTimeout.Seconds()))
if err != nil {
// Container has already been removed. | killing should be done with wait client
Incidentally changed in 5b<I>d<I>bf<I>bab<I>d<I>d<I>bcf<I>e0b<I>e | hashicorp_nomad | train | go |
de6f9a573c6fffdf35215b1222f2968a40ed0235 | diff --git a/cloudfoundry-client/src/main/java/org/cloudfoundry/client/CloudFoundryClient.java b/cloudfoundry-client/src/main/java/org/cloudfoundry/client/CloudFoundryClient.java
index <HASH>..<HASH> 100644
--- a/cloudfoundry-client/src/main/java/org/cloudfoundry/client/CloudFoundryClient.java
+++ b/cloudfoundry-client/src/main/java/org/cloudfoundry/client/CloudFoundryClient.java
@@ -37,7 +37,7 @@ public interface CloudFoundryClient {
/**
* The currently supported Cloud Controller API version
*/
- String SUPPORTED_API_VERSION = "2.40.0";
+ String SUPPORTED_API_VERSION = "2.41.0";
/**
* Main entry point to the Cloud Foundry Applications V2 Client API | Upgrade CC API Support
This change upgrades the support CC API version to <I>.
[#<I>] | cloudfoundry_cf-java-client | train | java |
4762d65fcab273106b11944c414ca662d2e26049 | diff --git a/spec/mangopay/refund_spec.rb b/spec/mangopay/refund_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/mangopay/refund_spec.rb
+++ b/spec/mangopay/refund_spec.rb
@@ -21,7 +21,7 @@ describe MangoPay::Refund do
describe 'FETCH for Repudiation' do
it "fetches a repudiation's refunds" do
- refunds = MangoPay::Refund.of_repudiation('45135438')
+ refunds = MangoPay::Refund.of_repudiation('45026109')
expect(refunds).to be_an(Array)
end
end | Using another Repudiation ID for a test | Mangopay_mangopay2-ruby-sdk | train | rb |
13a457b89c8bb0ebb3b52ea55a80b4779b6d72a0 | diff --git a/src/Node/NodeInterface.php b/src/Node/NodeInterface.php
index <HASH>..<HASH> 100644
--- a/src/Node/NodeInterface.php
+++ b/src/Node/NodeInterface.php
@@ -8,4 +8,9 @@ interface NodeInterface
* @return string
*/
public function __toString();
+
+ /**
+ * @return string
+ */
+ public function getPath();
} | Make sure getPath is part of the interface | reactphp_filesystem | train | php |
569ec432c999adbafebd9b41ef71837acf66a1aa | diff --git a/lib/ticket_sharing/client.rb b/lib/ticket_sharing/client.rb
index <HASH>..<HASH> 100644
--- a/lib/ticket_sharing/client.rb
+++ b/lib/ticket_sharing/client.rb
@@ -24,7 +24,6 @@ module TicketSharing
end
def success?
- raise "No call made to determine success" unless @success
@success
end | Don't blow up when checking for success... | zendesk_ticket_sharing | train | rb |
a5d78db61623091597e0a682fdbf9eeebd127b31 | diff --git a/src/FondOfSpryker/Zed/ConditionalAvailability/Persistence/ConditionalAvailabilityRepository.php b/src/FondOfSpryker/Zed/ConditionalAvailability/Persistence/ConditionalAvailabilityRepository.php
index <HASH>..<HASH> 100644
--- a/src/FondOfSpryker/Zed/ConditionalAvailability/Persistence/ConditionalAvailabilityRepository.php
+++ b/src/FondOfSpryker/Zed/ConditionalAvailability/Persistence/ConditionalAvailabilityRepository.php
@@ -127,6 +127,12 @@ class ConditionalAvailabilityRepository extends AbstractRepository implements Co
$fosConditionalAvailabilityQuery->innerJoinWithSpyProduct();
}
+ if ($conditionalAvailabilityCriteriaFilterTransfer->getWarehouseGroup() !== null) {
+ $fosConditionalAvailabilityQuery->filterByWarehouseGroup(
+ $conditionalAvailabilityCriteriaFilterTransfer->getWarehouseGroup(),
+ );
+ }
+
if ($conditionalAvailabilityCriteriaFilterTransfer->getMinimumQuantity() !== null) {
$fosConditionalAvailabilityQuery->useFosConditionalAvailabilityPeriodQuery()
->filterByQuantity( | Add missing functionality to filter warehouse group (#<I>) | fond-of_spryker-conditional-availability | train | php |
93b6877418a6dabe1ca5683979c6663365a8a85f | diff --git a/glue/ligolw/lsctables.py b/glue/ligolw/lsctables.py
index <HASH>..<HASH> 100644
--- a/glue/ligolw/lsctables.py
+++ b/glue/ligolw/lsctables.py
@@ -1463,14 +1463,14 @@ class SimInspiralTable(LSCTableUnique):
def get_column(self,column):
if 'chirp_dist' in column:
- site = column(-1)
+ site = column[-1]
return self.get_chirp_dist(site)
else:
return self.getColumnByName(column).asarray()
- def get_chirp_dist(self,ref_mass = 1.40):
+ def get_chirp_dist(self,site,ref_mass = 1.40):
mchirp = self.get_column('mchirp')
- eff_dist = self.get_column('eff_dist' + site)
+ eff_dist = self.get_column('eff_dist_' + site)
return eff_dist * (2.**(-1./5) * ref_mass / mchirp)**(5./6)
def get_end(self,site = None): | fix bugs in chirp dist reconstruction | gwastro_pycbc-glue | train | py |
c8c548a871880614c807c0c828256b7e425f04cd | diff --git a/modelx/__init__.py b/modelx/__init__.py
index <HASH>..<HASH> 100644
--- a/modelx/__init__.py
+++ b/modelx/__init__.py
@@ -20,7 +20,7 @@ Attributes:
"""
-VERSION = (0, 9, 0, "dev")
+VERSION = (0, 9, 0)
__version__ = ".".join([str(x) for x in VERSION])
from modelx.core.api import * # must come after __version__ assignment.
try: | DIST: Release <I> | fumitoh_modelx | train | py |
c8f774ea3455af057736166757f831407711ae67 | diff --git a/emds/__init__.py b/emds/__init__.py
index <HASH>..<HASH> 100644
--- a/emds/__init__.py
+++ b/emds/__init__.py
@@ -1 +1 @@
-__version__ = '0.3'
\ No newline at end of file
+__version__ = '0.4'
\ No newline at end of file | Bump to <I>. | gtaylor_EVE-Market-Data-Structures | train | py |
c066219dd4ec56514e39ecb375c283a9df618e61 | diff --git a/lib/qs/daemon.rb b/lib/qs/daemon.rb
index <HASH>..<HASH> 100644
--- a/lib/qs/daemon.rb
+++ b/lib/qs/daemon.rb
@@ -296,7 +296,7 @@ module Qs
def initialize(values = nil)
super(values)
- @process_label = (v = ENV['QS_PROCESS_LABEL']) && !v.to_s.empty? ? v : self.name
+ @process_label = !(v = ENV['QS_PROCESS_LABEL'].to_s).empty? ? v : self.name
@init_procs, @error_procs = [], []
@queues = []
@valid = nil | hotfix: use more efficient method for checking the QS_PROCESS_LABEL env var
I noticed this while reviewing redding/sanford#<I>. This is a better
implementation plus I want them to be consistent.
/cc @jcredding | redding_qs | train | rb |
7cb0b4f9768c3c2dc2c37665b4d42043c5402ca2 | diff --git a/account/applications.go b/account/applications.go
index <HASH>..<HASH> 100644
--- a/account/applications.go
+++ b/account/applications.go
@@ -8,6 +8,8 @@ import (
"fmt"
"io"
+ "golang.org/x/oauth2"
+
"github.com/TheThingsNetwork/go-account-lib/scope"
"github.com/TheThingsNetwork/ttn/core/types"
)
@@ -192,3 +194,30 @@ func (a *Account) AppCollaborators(appID string) ([]Collaborator, error) {
return collaborators, nil
}
+
+type exchangeReq struct {
+ Username string `json:"username"`
+ Password string `json:"password"`
+}
+
+type exchangeRes struct {
+ AccessToken string `json:"access_token"`
+ ExpiresIn int `json:"expires_in"`
+}
+
+// ExchangeAppKeyForToken exchanges an app ID and app Key for an app token
+func (a *Account) ExchangeAppKeyForToken(appID, accessKey string) (*oauth2.Token, error) {
+ req := exchangeReq{
+ Username: appID,
+ Password: accessKey,
+ }
+
+ var res tokenRes
+
+ err := a.post(a.auth, "/api/v2/applications/token", &req, &res)
+ if err != nil {
+ return nil, err
+ }
+
+ return res.Token(), nil
+} | Add ExchangeAppKeyForToken to account.Account | TheThingsNetwork_go-account-lib | train | go |
5415dad295634937de847e46a94b89c683b5a730 | diff --git a/slave/ls340.py b/slave/ls340.py
index <HASH>..<HASH> 100644
--- a/slave/ls340.py
+++ b/slave/ls340.py
@@ -314,7 +314,7 @@ class Input(InstrumentBase):
'300uA', '1mA', '10mV', '1mV'),
Enum('1mV', '2.5mV', '5mV', '10mV', '25mV',
'50mV', '100mV', '250mV', '500mV',
- '1V', '2.5V', '5V', '7.5V', start=0)])
+ '1V', '2.5V', '5V', '7.5V', start=1)])
self.kelvin = Command(('KRDG? {0}'.format(name), Float))
self.sensor_units = Command(('SRDG? {0}'.format(name), Float))
self.linear = Command(('LDAT? {0}'.format(name), Float)) | Fixed wrong start value in Input enum of LS<I>. | p3trus_slave | train | py |
a93c153ed0890c0d4f2177fed1278b507f84bc1d | diff --git a/lib/wikipedia/page.rb b/lib/wikipedia/page.rb
index <HASH>..<HASH> 100644
--- a/lib/wikipedia/page.rb
+++ b/lib/wikipedia/page.rb
@@ -88,7 +88,7 @@ module Wikipedia
s.gsub!(/\{\{ipa[^\}]+\}\}/i, '')
# misc
- s.gsub!(/{{[^\}]+}}/, '')
+ s.gsub!(/\{\{[^\}]+\}\}/, '')
s.gsub!(/<ref[^<>]*>[\s\S]*?<\/ref>/, '')
s.gsub!(/<!--[^>]+?-->/, '')
s.gsub!(' ', ' ') | Fixed a faulty regex. | kenpratt_wikipedia-client | train | rb |
fea7475080b7408dcd7115c10f84edc98a6f94fa | diff --git a/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java b/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java
index <HASH>..<HASH> 100755
--- a/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java
+++ b/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java
@@ -627,7 +627,8 @@ public class DefaultChannelPipeline implements ChannelPipeline {
ChannelStateHandlerAdapter h = (ChannelStateHandlerAdapter) handler;
if (!h.isSharable() && h.added) {
throw new ChannelHandlerLifeCycleException(
- "Only a @Sharable handler can be added or removed multiple times.");
+ h.getClass().getName() +
+ " is not a @Sharable handler, so can't be added or removed multiple times.");
}
h.added = true;
} | [#<I>] Report non @Shareable handler name that has been re-added. | netty_netty | train | java |
0ec08327083a6f357a568bc3933c17b4c5e4a5d7 | diff --git a/src/share/classes/com/sun/tools/javac/code/Printer.java b/src/share/classes/com/sun/tools/javac/code/Printer.java
index <HASH>..<HASH> 100644
--- a/src/share/classes/com/sun/tools/javac/code/Printer.java
+++ b/src/share/classes/com/sun/tools/javac/code/Printer.java
@@ -190,7 +190,7 @@ public abstract class Printer implements Type.Visitor<String, Locale>, Symbol.Vi
StringBuilder buf = new StringBuilder();
if (t.getEnclosingType().tag == CLASS && t.tsym.owner.kind == Kinds.TYP) {
buf.append(visit(t.getEnclosingType(), locale));
- buf.append(".");
+ buf.append('.');
buf.append(className(t, false, locale));
} else {
buf.append(className(t, true, locale));
@@ -198,7 +198,7 @@ public abstract class Printer implements Type.Visitor<String, Locale>, Symbol.Vi
if (t.getTypeArguments().nonEmpty()) {
buf.append('<');
buf.append(visitTypes(t.getTypeArguments(), locale));
- buf.append(">");
+ buf.append('>');
}
return buf.toString();
} | Consistently use chars instead of length one string literals. | wmdietl_jsr308-langtools | train | java |
b6f85d50daaade42d25ab4da0b5e9516b909c2ac | diff --git a/rules/tls.go b/rules/tls.go
index <HASH>..<HASH> 100644
--- a/rules/tls.go
+++ b/rules/tls.go
@@ -106,7 +106,7 @@ func (t *insecureConfigTLS) processTLSConfVal(n *ast.KeyValueExpr, c *gas.Contex
}
func (t *insecureConfigTLS) Match(n ast.Node, c *gas.Context) (*gas.Issue, error) {
- if complit, ok := n.(*ast.CompositeLit); ok && c.Info.TypeOf(complit.Type).String() == t.requiredType {
+ if complit, ok := n.(*ast.CompositeLit); ok && complit.Type != nil && c.Info.TypeOf(complit.Type).String() == t.requiredType {
for _, elt := range complit.Elts {
if kve, ok := elt.(*ast.KeyValueExpr); ok {
issue := t.processTLSConfVal(kve, c) | Fix nil pointer dereference in complit types | securego_gosec | train | go |
60e294c3ec24fc1016fdfeed84a2485aafb431f2 | diff --git a/classes/GemsEscort.php b/classes/GemsEscort.php
index <HASH>..<HASH> 100644
--- a/classes/GemsEscort.php
+++ b/classes/GemsEscort.php
@@ -166,7 +166,8 @@ class GemsEscort extends MUtil_Application_Escort
}
if ($exists) {
- $cacheFrontendOptions = array('automatic_serialization' => true);
+ $cacheFrontendOptions = array('automatic_serialization' => true,
+ 'cache_id_prefix' => GEMS_PROJECT_NAME . '_');
$cache = Zend_Cache::factory('Core', $cacheBackend, $cacheFrontendOptions, $cacheBackendOptions); | Improved cache by using prefix so 'apc' won't get name clashes on a shared environment | GemsTracker_gemstracker-library | train | php |
75394cc561edd0df1de30bcc0b48e18833d2f3af | diff --git a/code/model/FilesystemPublisher.php b/code/model/FilesystemPublisher.php
index <HASH>..<HASH> 100644
--- a/code/model/FilesystemPublisher.php
+++ b/code/model/FilesystemPublisher.php
@@ -230,7 +230,7 @@ class FilesystemPublisher extends DataExtension {
if($url == "") $url = "/";
if(Director::is_relative_url($url)) $url = Director::absoluteURL($url);
- $sanitizedURL = URLArrayObject::sanitizeUrl($url);
+ $sanitizedURL = URLArrayObject::sanitize_url($url);
$response = Director::test(str_replace('+', ' ', $sanitizedURL));
if (!$response) continue;
diff --git a/code/model/URLArrayObject.php b/code/model/URLArrayObject.php
index <HASH>..<HASH> 100644
--- a/code/model/URLArrayObject.php
+++ b/code/model/URLArrayObject.php
@@ -177,7 +177,7 @@ class URLArrayObject extends ArrayObject {
}
// removes the injected _ID and _ClassName get parameters
- public static function sanitizeUrl($url) {
+ public static function sanitize_url($url) {
list($urlPart, $query) = array_pad(explode('?', $url), 2, '');
parse_str($query, $getVars);
unset($getVars['_ID'], $getVars['_ClassName']); | Renamed sanitize_url to follow coding convention | silverstripe_silverstripe-staticpublishqueue | train | php,php |
8adcca54e8640ef82db0884ce958ee81e6dbb680 | diff --git a/python/ray/tune/ray_trial_executor.py b/python/ray/tune/ray_trial_executor.py
index <HASH>..<HASH> 100644
--- a/python/ray/tune/ray_trial_executor.py
+++ b/python/ray/tune/ray_trial_executor.py
@@ -771,7 +771,7 @@ class RayTrialExecutor(TrialExecutor):
self._last_nontrivial_wait = time.time()
return self._running[result_id]
- def fetch_result(self, trial) -> List[Trial]:
+ def fetch_result(self, trial) -> List[Dict]:
"""Fetches result list of the running trials.
Returns: | [tune] Fix type error (#<I>) | ray-project_ray | train | py |
bfdb5debec153f6b54e0e6e8d63c9355df4d3389 | diff --git a/lib/github_changelog_generator/version.rb b/lib/github_changelog_generator/version.rb
index <HASH>..<HASH> 100644
--- a/lib/github_changelog_generator/version.rb
+++ b/lib/github_changelog_generator/version.rb
@@ -1,3 +1,3 @@
module GitHubChangelogGenerator
- VERSION = "1.10.2"
+ VERSION = "1.10.3"
end | Update gemspec to version <I> | github-changelog-generator_github-changelog-generator | train | rb |
a30d9ed1f88ee4b6437ed3919e838efa0daf5a94 | diff --git a/src/OptimizedPathMappingRepository.php b/src/OptimizedPathMappingRepository.php
index <HASH>..<HASH> 100644
--- a/src/OptimizedPathMappingRepository.php
+++ b/src/OptimizedPathMappingRepository.php
@@ -78,7 +78,7 @@ class OptimizedPathMappingRepository implements EditableRepository
$path = Path::canonicalize($path);
- if (! $this->store->exists($path)) {
+ if (!$this->store->exists($path)) {
throw ResourceNotFoundException::forPath($path);
}
@@ -263,7 +263,7 @@ class OptimizedPathMappingRepository implements EditableRepository
$path = $resource->getPath();
// Ignore non-existing resources
- if (! $this->store->exists($path)) {
+ if (!$this->store->exists($path)) {
return;
}
@@ -320,7 +320,7 @@ class OptimizedPathMappingRepository implements EditableRepository
*/
private function ensureDirectoryExists($path)
{
- if (! $this->store->exists($path)) {
+ if (!$this->store->exists($path)) {
// Recursively initialize parent directories
if ($path !== '/') {
$this->ensureDirectoryExists(Path::getDirectory($path)); | Fix code convention in optimized PathMapping repository | puli_repository | train | php |
67e97ccc96dbfecfe16eee89710579f84bf359c2 | diff --git a/spyder/plugins/editor/widgets/codeeditor.py b/spyder/plugins/editor/widgets/codeeditor.py
index <HASH>..<HASH> 100644
--- a/spyder/plugins/editor/widgets/codeeditor.py
+++ b/spyder/plugins/editor/widgets/codeeditor.py
@@ -1479,7 +1479,7 @@ class CodeEditor(TextEditBaseWidget):
# ------------- LSP: Document/Selection formatting --------------------
def format_document_or_range(self):
- if self.has_selected_text():
+ if self.has_selected_text() and self.range_formatting_enabled:
self.format_document_range()
else:
self.format_document()
@@ -1549,6 +1549,9 @@ class CodeEditor(TextEditBaseWidget):
def _apply_document_edits(self, edits):
edits = edits['params']
+ if edits is None:
+ return
+
texts = []
diffs = []
text = self.toPlainText() | Format whole document when range formatting is not available | spyder-ide_spyder | train | py |
de9f79316508fd17575195b3bce2265625f0cff2 | diff --git a/source/Application/translations/en/lang.php b/source/Application/translations/en/lang.php
index <HASH>..<HASH> 100644
--- a/source/Application/translations/en/lang.php
+++ b/source/Application/translations/en/lang.php
@@ -683,8 +683,8 @@ $aLang = array(
'_UNIT_CM' => 'cm',
'_UNIT_MM' => 'mm',
'_UNIT_M' => 'm',
-'_UNIT_M2' => 'm�',
-'_UNIT_M3' => 'm�',
+'_UNIT_M2' => 'm²',
+'_UNIT_M3' => 'm³',
'_UNIT_PIECE' => 'piece',
'_UNIT_ITEM' => 'item',
'DOWNLOADS_EMPTY' => 'You have not ordered any files yet.', | Fix encoding issue in lang file
Related #<I>. | OXID-eSales_oxideshop_ce | train | php |
43f4c9724e754216e76cb3829fb76badd1d254d3 | diff --git a/ring.go b/ring.go
index <HASH>..<HASH> 100644
--- a/ring.go
+++ b/ring.go
@@ -24,7 +24,8 @@ type Ring interface {
ReplicaCount() int
// LocalNodeID is the identifier of the local node; determines which ring
// partitions/replicas the local node is responsible for as well as being
- // used to direct message delivery.
+ // used to direct message delivery. If this instance of the ring has no
+ // local node information, 0 will be returned.
LocalNodeID() uint64
// Responsible will return true if the local node is considered responsible
// for a replica of the partition given.
@@ -56,14 +57,14 @@ func (ring *ringImpl) ReplicaCount() int {
}
func (ring *ringImpl) LocalNodeID() uint64 {
- if ring.localNodeIndex == 0 {
+ if ring.localNodeIndex == -1 {
return 0
}
return ring.nodeIDs[ring.localNodeIndex]
}
func (ring *ringImpl) Responsible(partition uint32) bool {
- if ring.localNodeIndex == 0 {
+ if ring.localNodeIndex == -1 {
return false
}
for _, partitionToNodeIndex := range ring.replicaToPartitionToNodeIndex { | index should have been -1 for none | gholt_ring | train | go |
ed003c8dd3cdad9d2fd25fbc965d61c46661f5bb | diff --git a/script/minitest_runner.rb b/script/minitest_runner.rb
index <HASH>..<HASH> 100755
--- a/script/minitest_runner.rb
+++ b/script/minitest_runner.rb
@@ -74,4 +74,4 @@ class MinitestRunner
end
end
-MinitestRunner.new.run if $PROGRAM_NAME == __FILE__
+exit(MinitestRunner.new.run) if $PROGRAM_NAME == __FILE__ | Return proper exit status from test runner
Otherwise bisecting can't work. | deivid-rodriguez_byebug | train | rb |
959c1f8d11f4ee5a47f20e7f9d1e9e73caf342ab | diff --git a/O365/__init__.py b/O365/__init__.py
index <HASH>..<HASH> 100644
--- a/O365/__init__.py
+++ b/O365/__init__.py
@@ -1,6 +1,8 @@
"""
A simple python library to interact with Microsoft Graph and Office 365 API
"""
+import warnings
+
from .__version__ import __version__
from .account import Account
from .address_book import AddressBook, Contact, RecipientType
@@ -17,3 +19,7 @@ from .planner import Planner, Task
from .utils import ImportanceLevel, Query, Recipient
from .utils import OneDriveWellKnowFolderNames, OutlookWellKnowFolderNames
from .utils import FileSystemTokenBackend, FirestoreBackend
+
+
+# allow Deprecation warnings to appear
+warnings.simplefilter('always', DeprecationWarning)
diff --git a/O365/connection.py b/O365/connection.py
index <HASH>..<HASH> 100644
--- a/O365/connection.py
+++ b/O365/connection.py
@@ -384,6 +384,13 @@ class Connection:
:rtype: str
"""
+ # TODO: remove this warning in future releases
+ if redirect_uri == OAUTH_REDIRECT_URL:
+ warnings.warn('The default redirect uri was changed in version 1.1.4. to'
+ ' "https://login.microsoftonline.com/common/oauth2/nativeclient".'
+ ' You may have to change the registered app "redirect uri" or pass here the old "redirect_uri"',
+ DeprecationWarning)
+
client_id, client_secret = self.auth
if requested_scopes: | DeprecationWarnings should now be printed out | O365_python-o365 | train | py,py |
9acc087db50a3f32c29ac0f9c025e7bd6a73803e | diff --git a/lib/mongo/server/description.rb b/lib/mongo/server/description.rb
index <HASH>..<HASH> 100644
--- a/lib/mongo/server/description.rb
+++ b/lib/mongo/server/description.rb
@@ -465,7 +465,7 @@ module Mongo
#
# @since 2.0.0
def primary?
- !!config[PRIMARY] && !replica_set_name.nil?
+ !!config[PRIMARY] && hosts.include?(address.to_s) && !replica_set_name.nil?
end
# Get the name of the replica set the server belongs to, returns nil if | RUBY-<I> Check that server's hostname is included in its config hosts list to be considered a primary | mongodb_mongo-ruby-driver | train | rb |
a5209fd112a3d65c43bcc61f5669d9e8c2d9534d | diff --git a/server/webapp/WEB-INF/rails.new/spec/javascripts/vsm_analytics_spec.js b/server/webapp/WEB-INF/rails.new/spec/javascripts/vsm_analytics_spec.js
index <HASH>..<HASH> 100644
--- a/server/webapp/WEB-INF/rails.new/spec/javascripts/vsm_analytics_spec.js
+++ b/server/webapp/WEB-INF/rails.new/spec/javascripts/vsm_analytics_spec.js
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-xdescribe("vsm_analytics", function () {
+describe("vsm_analytics", function () {
function VSMRenderer() {}
@@ -249,4 +249,4 @@ xdescribe("vsm_analytics", function () {
}]
};
};
-});
\ No newline at end of file
+}); | Do not ignore vsm_analytics specs | gocd_gocd | train | js |
6e0da696326d7a18c5cdcb9aebc1740d1469b148 | diff --git a/test/integration/scheduler_perf/scheduler_perf_test.go b/test/integration/scheduler_perf/scheduler_perf_test.go
index <HASH>..<HASH> 100644
--- a/test/integration/scheduler_perf/scheduler_perf_test.go
+++ b/test/integration/scheduler_perf/scheduler_perf_test.go
@@ -77,8 +77,8 @@ var (
label: extensionPointsLabelName,
values: []string{"Filter", "Score"},
},
- "scheduler_e2e_scheduling_duration_seconds": nil,
- "scheduler_pod_scheduling_duration_seconds": nil,
+ "scheduler_scheduling_attempt_duration_seconds": nil,
+ "scheduler_pod_scheduling_duration_seconds": nil,
},
}
) | Replace scheduler_e2e_scheduling_duration_seconds with scheduler_scheduling_attempt_duration_seconds in scheduler_perf | kubernetes_kubernetes | train | go |
ce5ffc55799340c47e95b89ab62dbd56ddd26c65 | diff --git a/test/hccrawler/index.test.js b/test/hccrawler/index.test.js
index <HASH>..<HASH> 100644
--- a/test/hccrawler/index.test.js
+++ b/test/hccrawler/index.test.js
@@ -619,7 +619,7 @@ describe('HCCrawler', () => {
describe('when an image is responded after the timeout option', () => {
beforeEach(() => {
- this.server.setContent('/', `<body><img src="${PREFIX}/empty.png"></body>`);
+ this.server.setContent('/', `<body><div style="background-image: url('${PREFIX}/empty.png');"></body>`);
this.server.setContent('/empty.png', '');
this.server.setResponseDelay('/empty.png', 200);
}); | test(hccrawler): use background image for domcontentloaded tests | yujiosaka_headless-chrome-crawler | train | js |
cbaff21b2d6a04be2bad1065f7c5ecfa3a900318 | diff --git a/lib/mtgox/configuration.rb b/lib/mtgox/configuration.rb
index <HASH>..<HASH> 100644
--- a/lib/mtgox/configuration.rb
+++ b/lib/mtgox/configuration.rb
@@ -23,13 +23,6 @@ module MtGox
yield self
end
- # Create a hash of options and their values
- def options
- options = {}
- VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}
- options
- end
-
# Reset all configuration options to defaults
def reset
self.commission = DEFAULT_COMMISSION | Remove seemingly unused options hash. | sferik_mtgox | train | rb |
589a86098dc42a97350e8c962a60771ac0431309 | diff --git a/awss/__init__.py b/awss/__init__.py
index <HASH>..<HASH> 100755
--- a/awss/__init__.py
+++ b/awss/__init__.py
@@ -234,6 +234,7 @@ def queryCreate(options):
outputEnd = ""
qryStr = qryStr + FiltEnd + ")"
outputTitle = outputTitle + outputEnd
+ debg.dprintx("\nQuery String")
debg.dprintx(qryStr, True)
debg.dprint("outputTitle: ", outputTitle)
return(qryStr, outputTitle) | Tweak to queryCreate for testing | robertpeteuil_aws-shortcuts | train | py |
97ef103702eca77e0e2303359ba1d8c7303dfeb0 | diff --git a/molgenis-data-mapper/src/main/java/org/molgenis/data/mapper/controller/MappingServiceController.java b/molgenis-data-mapper/src/main/java/org/molgenis/data/mapper/controller/MappingServiceController.java
index <HASH>..<HASH> 100644
--- a/molgenis-data-mapper/src/main/java/org/molgenis/data/mapper/controller/MappingServiceController.java
+++ b/molgenis-data-mapper/src/main/java/org/molgenis/data/mapper/controller/MappingServiceController.java
@@ -358,8 +358,7 @@ public class MappingServiceController extends MolgenisPluginController
@RequestMapping("/attributeMapping")
public String viewAttributeMapping(@RequestParam(required = true) String mappingProjectId,
@RequestParam(required = true) String target, @RequestParam(required = true) String source,
- @RequestParam(required = true) String targetAttribute,
- @RequestParam(required = true) boolean showSuggestedAttributes, Model model)
+ @RequestParam(required = true) String targetAttribute, Model model)
{
MappingProject project = mappingService.getMappingProject(mappingProjectId);
MappingTarget mappingTarget = project.getMappingTarget(target); | Remove showSuggestedAttributes from the controller method to fix a broken page | molgenis_molgenis | train | java |
166cafeb011350fa2529d786417797aa7e72d77e | diff --git a/djstripe/models/api.py b/djstripe/models/api.py
index <HASH>..<HASH> 100644
--- a/djstripe/models/api.py
+++ b/djstripe/models/api.py
@@ -4,6 +4,7 @@ from uuid import uuid4
from django.core.validators import RegexValidator
from django.db import models
+from django.forms import ValidationError
from ..enums import APIKeyType
from ..exceptions import InvalidStripeAPIKey
@@ -79,7 +80,10 @@ class APIKey(StripeModel):
def _clean_livemode_and_type(self):
if self.livemode is None or self.type is None:
- self.type, self.livemode = get_api_key_details_by_prefix(self.secret)
+ try:
+ self.type, self.livemode = get_api_key_details_by_prefix(self.secret)
+ except InvalidStripeAPIKey as e:
+ raise ValidationError(str(e))
def clean(self):
self._clean_livemode_and_type() | Catch InvalidStripeAPIKey and re-raise as ValidationError | dj-stripe_dj-stripe | train | py |
ad8c8e6afc50e87dacf7e498e83a40852feaed97 | diff --git a/lib/bson/regexp.rb b/lib/bson/regexp.rb
index <HASH>..<HASH> 100644
--- a/lib/bson/regexp.rb
+++ b/lib/bson/regexp.rb
@@ -135,7 +135,7 @@ module BSON
def method_missing(method, *arguments)
return super unless respond_to?(method)
- compile.send(method)
+ compile.send(method, *arguments)
end
end
diff --git a/spec/bson/regexp_spec.rb b/spec/bson/regexp_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/bson/regexp_spec.rb
+++ b/spec/bson/regexp_spec.rb
@@ -40,8 +40,12 @@ describe Regexp do
StringIO.new(bson)
end
+ let(:regex) do
+ described_class.from_bson(io)
+ end
+
let(:result) do
- described_class.from_bson(io).compile
+ regex.compile
end
it_behaves_like "a bson element"
@@ -58,7 +62,7 @@ describe Regexp do
it_behaves_like "a serializable bson element"
it "runs the method on the Regexp object" do
- expect(result.match('6')).not_to be_nil
+ expect(regex.match('6')).not_to be_nil
end
end | Fix ArgumentError in BSON::Regexp::Ruby
When a user attempts to call a method on BSON::Regexp::Ruby with
arguments, an ArgumentError will be thrown. This change will actually
pass down the arguments so that such errors will not get raised. | mongodb_bson-ruby | train | rb,rb |
63b2cd8a81e5148955543ba0a4e05ce1c1f17948 | diff --git a/lib/phut/syntax.rb b/lib/phut/syntax.rb
index <HASH>..<HASH> 100644
--- a/lib/phut/syntax.rb
+++ b/lib/phut/syntax.rb
@@ -60,17 +60,17 @@ module Phut
end
def vswitch(alias_name = nil, &block)
- if block
- attrs = VswitchDirective.new.tap { |vsw| vsw.instance_eval(&block) }
- @config.add_vswitch(alias_name || attrs[:dpid], attrs)
- else
- @config.add_vswitch(alias_name, VswitchDirective.new)
- end
+ attrs = VswitchDirective.new.tap { |vsw| vsw.instance_eval(&block) }
+ @config.add_vswitch(alias_name || attrs[:dpid], attrs)
end
def vhost(alias_name = nil, &block)
- attrs = VhostDirective.new.tap { |vh| vh.instance_eval(&block) }
- @config.add_vhost(alias_name || attrs[:ip], attrs)
+ if block
+ attrs = VhostDirective.new.tap { |vh| vh.instance_eval(&block) }
+ @config.add_vhost(alias_name || attrs[:ip], attrs)
+ else
+ @config.add_vhost(alias_name, VhostDirective.new)
+ end
end
def link(name_a, name_b) | Support the vswitch(name) directive (no block given). | trema_phut | train | rb |
6d88e7faaa528affd6a25c008f30193912d61314 | diff --git a/tests/integration/test_crunch_cube.py b/tests/integration/test_crunch_cube.py
index <HASH>..<HASH> 100644
--- a/tests/integration/test_crunch_cube.py
+++ b/tests/integration/test_crunch_cube.py
@@ -2032,3 +2032,10 @@ class TestCrunchCube(TestCase):
# dimension of the cube).
actual = cube.margin(axis=2)
np.testing.assert_array_equal(actual, expected)
+
+ def test_ca_x_single_cat_cell_margins(test):
+ cube = CrunchCube(FIXT_CA_X_SINGLE_CAT)
+ expected = np.array([25, 28, 23])
+ # Axis equals to (1, 2), because the total is calculated for each slice.
+ actual = cube.margin(axis=(1, 2))
+ np.testing.assert_array_equal(actual, expected) | Add test for 3D cube (CA x (single) CAT) proportions by cell | Crunch-io_crunch-cube | train | py |
d1985f9cd461f626da58cf0484c9d3a03300c354 | diff --git a/src/main/java/org/imgscalr/op/PadOp.java b/src/main/java/org/imgscalr/op/PadOp.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/imgscalr/op/PadOp.java
+++ b/src/main/java/org/imgscalr/op/PadOp.java
@@ -9,11 +9,13 @@ import java.awt.image.BufferedImage;
import java.awt.image.ImagingOpException;
public class PadOp implements IOp {
+ public static final Color DEFAULT_COLOR = Color.BLACK;
+
protected int padding;
protected Color color;
public PadOp(int padding) throws IllegalArgumentException {
- this(padding, Color.BLACK);
+ this(padding, DEFAULT_COLOR);
}
public PadOp(int padding, Color color) throws IllegalArgumentException { | Clarified the declaration of the default color used for padding when one
isn't specified. | rkalla_imgscalr | train | java |
2ec26592eceb91789d9a2de1b2af183966668a62 | diff --git a/tasks/hash.js b/tasks/hash.js
index <HASH>..<HASH> 100644
--- a/tasks/hash.js
+++ b/tasks/hash.js
@@ -51,7 +51,7 @@ module.exports = function(grunt) {
var dest = file.dest || path.dirname(src);
var newFile = basename + (hash ? options.hashSeparator + hash : '') + ext;
- var outputPath = path.join(dest, newFile);
+ var outputPath = path.join(path.dirname(dest), newFile);
// Determine if the key should be flatten or not. Also normalize the output path
var key = path.join(rootDir, path.basename(src)); | Allow expanded destinations
When `expand` is set to `true`, `file.dest` is actually a full file path rather than a directory. This patch fixes it so that grunt-hash maintains the directory structure but renames the file with the hash in the filename. | jgallen23_grunt-hash | train | js |
b674d4594ea369118fa6e211fb867f5d537cf0de | diff --git a/runners/vr/runners/base.py b/runners/vr/runners/base.py
index <HASH>..<HASH> 100644
--- a/runners/vr/runners/base.py
+++ b/runners/vr/runners/base.py
@@ -44,15 +44,16 @@ class BaseRunner(object):
try:
cmd = self.commands[args.command]
- # Commands that have a lock=False attribute won't try to lock the
- # proc.yaml file. 'uptest' and 'shell' are in this category.
- if getattr(cmd, 'lock', True):
- lock_file(self.file)
- else:
- self.file.close()
except KeyError:
raise SystemExit("Command must be one of: %s" %
', '.join(self.commands.keys()))
+
+ # Commands that have a lock=False attribute won't try to lock the
+ # proc.yaml file. 'uptest' and 'shell' are in this category.
+ if getattr(cmd, 'lock', True):
+ lock_file(self.file)
+ else:
+ self.file.close()
cmd()
def setup(self): | Don't feign to trap KeyErrors for file locking operations. | yougov_vr.runners | train | py |
9a9b998f48d3a1d950aebaa270a685d4d3207d24 | diff --git a/router.js b/router.js
index <HASH>..<HASH> 100644
--- a/router.js
+++ b/router.js
@@ -48,7 +48,7 @@ module.exports = Router.extend({
// load templates here so they are ready before any change event is triggered
_.each(resp && resp.compiled, dust.loadSource);
- return _.has(resp, 'data') ? resp.data : _.omit(resp, 'compiled', 'navigation', 'site', 'organization');
+ return _.has(resp, 'data') ? resp.data : _.omit(resp, 'compiled', 'navigation', 'site');
}
})
}),
@@ -91,7 +91,7 @@ module.exports = Router.extend({
this.params = _.extend({}, args);
if (Backbone.history._usePushState)
_.defaults(this.params, window.history.state);
- this.query = query;
+ this.query = query || {};
this.search = search;
args.push(query); | Allow organization in page state, and set query to empty object if there is none. | thecodebureau_ridge | train | js |
74917f60205d6bb7a2d613d9d6d6bd91253c0627 | diff --git a/test/passify.js b/test/passify.js
index <HASH>..<HASH> 100644
--- a/test/passify.js
+++ b/test/passify.js
@@ -1,4 +1,4 @@
-var passify = require('passify');
+var passify = require('../lib/passify');
describe('Passify', function() {
describe('Create', function() { | Require the lib, not the npm install version. | nickjj_passify | train | js |
56570e9baf82f3617f98404eb5a9f34ed85e19dc | diff --git a/utils.py b/utils.py
index <HASH>..<HASH> 100644
--- a/utils.py
+++ b/utils.py
@@ -13,7 +13,7 @@ def nodeText(node):
parsing and original xml formatting. This function should strip such
artifacts.
"""
- return u''.format(node.firstChild.data.strip())
+ return u'{0}'.format(node.firstChild.data.strip())
def makeEPUBBase(location, css_location):
'''Contains the functionality to create the ePub directory hierarchy from | Fixed issue where nodeText() had no valid string to format into | SavinaRoja_OpenAccess_EPUB | train | py |
b5781cc998888c4c6aba12911570c905d7cead1c | diff --git a/includes/class-freemius.php b/includes/class-freemius.php
index <HASH>..<HASH> 100755
--- a/includes/class-freemius.php
+++ b/includes/class-freemius.php
@@ -15113,9 +15113,12 @@
if ( ! $is_uninstall ) {
$fs_user = Freemius::_get_user_by_email( $email );
if ( is_object( $fs_user ) && ! $this->is_pending_activation() ) {
- return $this->install_with_current_user(
+ return $this->install_with_user(
+ $fs_user,
false,
$trial_plan_id,
+ true,
+ true,
$sites
);
} | [opt-in] [bug-fix] When the opt-in was called programmatically with an empty license key, the install was always with the current admin's user instead of taking the $email param into account and opting in with the selected user. | Freemius_wordpress-sdk | train | php |
5933aaacb29b770718d2391944c550b1733de913 | diff --git a/xmantissa/webadmin.py b/xmantissa/webadmin.py
index <HASH>..<HASH> 100644
--- a/xmantissa/webadmin.py
+++ b/xmantissa/webadmin.py
@@ -31,8 +31,8 @@ class DeveloperSite(Item, PrefixURLMixin):
prefixURL = 'static/webadmin'
# Counts of each kind of user
- developers = integer()
- administrators = integer()
+ developers = integer(default=0)
+ administrators = integer(default=0)
def install(self):
self.store.powerUp(self, ISessionlessSiteRootPlugin) | Set reasonable defaults for administrator and developer counts | twisted_mantissa | train | py |
ec8a01ab3737854457d462e2a62c9127f316cf48 | diff --git a/example/index.js b/example/index.js
index <HASH>..<HASH> 100644
--- a/example/index.js
+++ b/example/index.js
@@ -10,6 +10,12 @@ app.set('view engine', 'html');
app.set('views', require('path').join(__dirname, '/view'));
app.engine('html', hogan);
+// A normal un-protected public URL.
+
+app.get('/', function (req, res) {
+ res.render('index');
+});
+
// Create a session-store to be used by both the express-session
// middleware and the keycloak middleware.
@@ -46,12 +52,6 @@ app.use(keycloak.middleware({
admin: '/'
}));
-// A normal un-protected public URL.
-
-app.get('/', function (req, res) {
- res.render('index');
-});
-
app.get('/login', keycloak.protect(), function (req, res) {
res.render('index', {
result: JSON.stringify(JSON.parse(req.session['keycloak-token']), null, 4), | registering the unprotected endpoint before registering the KC middleware | keycloak_keycloak-nodejs-connect | train | js |
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.