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
|
---|---|---|---|---|---|
6a6c0c1cbc4244516fe4773471ff8dc03a0af98b | diff --git a/www/requireWebSql.js b/www/requireWebSql.js
index <HASH>..<HASH> 100644
--- a/www/requireWebSql.js
+++ b/www/requireWebSql.js
@@ -1 +1,4 @@
-window.openDatabase = window.openDatabase || require('cordova-plugin-websql-async.WebSQL').openDatabase;
+if (navigator.appVersion.indexOf('Windows Phone') >= 0) {
+ // Only add the WebSQL plug-in for Windows Phone
+ window.openDatabase = window.openDatabase || require('cordova-plugin-websql-async.WebSQL').openDatabase;
+} | The WebSQL plug-in was being loaded on Windows 8 devices. Now it's only loaded on Windows Phone devices. | ABB-Austin_cordova-plugin-indexeddb-async | train | js |
747ba7defd82bffa6c7ccb69e53b834cbfddb62c | diff --git a/src/core.js b/src/core.js
index <HASH>..<HASH> 100644
--- a/src/core.js
+++ b/src/core.js
@@ -360,11 +360,20 @@ jQuery.extend({
// Is the DOM ready to be used? Set to true once it occurs.
isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
// Handle when the DOM is ready
- ready: function() {
+ ready: function( wait ) {
+ // A third-party is pushing the ready event forwards
+ if ( wait === true ) {
+ jQuery.readyWait--;
+ }
+
// Make sure that the DOM is not already loaded
- if ( !jQuery.isReady ) {
+ if ( !jQuery.readyWait && !jQuery.isReady ) {
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
if ( !document.body ) {
return setTimeout( jQuery.ready, 13 );
@@ -373,6 +382,11 @@ jQuery.extend({
// Remember that the DOM is ready
jQuery.isReady = true;
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
// If there are functions bound, to execute
if ( readyList ) {
// Execute all of them | Allow plugins to delay the exeuction of the ready event. Delay the ready event by calling: jQuery.readyWait++ and force the event to fire by doing: jQuery.ready(true). Fixes #<I>. | jquery_jquery | train | js |
1532ca1f3d6db0efc6c976b3542e2cc9232ae0f8 | diff --git a/client/html/src/Client/Html/Catalog/Base.php b/client/html/src/Client/Html/Catalog/Base.php
index <HASH>..<HASH> 100644
--- a/client/html/src/Client/Html/Catalog/Base.php
+++ b/client/html/src/Client/Html/Catalog/Base.php
@@ -395,7 +395,7 @@ abstract class Base
$sortdir = ( $sortation[0] === '-' ? '-' : '+' );
$sort = ltrim( $sortation, '-' );
- return ( strlen( $sort ) > 0 ? $sort : $sort );
+ return $sort;
} | Remove superfluous check and assignment (#<I>) | aimeos_ai-client-html | train | php |
0a2925beb9c78b1f6e0ae305fa1bdd5e13f372f4 | diff --git a/lib/setup.php b/lib/setup.php
index <HASH>..<HASH> 100644
--- a/lib/setup.php
+++ b/lib/setup.php
@@ -311,15 +311,15 @@ global $HTTPSPAGEREQUIRED;
if ($CFG->cachetype === 'memcached' && !empty($CFG->memcachedhosts)) {
if (!init_memcached()) {
debugging("Error initialising memcached");
+ $CFG->cachetype = '';
+ $CFG->rcache = false;
}
- $CFG->cachetype = '';
- $CFG->rcache = false;
} else if ($CFG->cachetype === 'eaccelerator') {
if (!init_eaccelerator()) {
debugging("Error initialising eaccelerator cache");
+ $CFG->cachetype = '';
+ $CFG->rcache = false;
}
- $CFG->cachetype = '';
- $CFG->rcache = false;
}
} else { // just make sure it is defined | MDL-<I> fixed silly logic bug when disabling rcache - patch by Matt Clarkson; merged from MOODLE_<I>_STABLE | moodle_moodle | train | php |
f10506a87c7c4bdb9ebb08d15816b9afb2c4715d | diff --git a/src/components/ContactList/i18n/en-US.js b/src/components/ContactList/i18n/en-US.js
index <HASH>..<HASH> 100644
--- a/src/components/ContactList/i18n/en-US.js
+++ b/src/components/ContactList/i18n/en-US.js
@@ -1,3 +1,3 @@
export default {
- noContacts: 'No contact items',
+ noContacts: 'No records found',
}; | fixed which not match any contacts should be prompted "No records found" | ringcentral_ringcentral-js-widgets | train | js |
bfa62cc0f34ff8905193a82bda13c1a51ad6b71c | diff --git a/stellar_base/operation.py b/stellar_base/operation.py
index <HASH>..<HASH> 100644
--- a/stellar_base/operation.py
+++ b/stellar_base/operation.py
@@ -425,7 +425,10 @@ class ChangeTrust(Operation):
def __init__(self, asset, limit=None, source=None):
super(ChangeTrust, self).__init__(source)
self.line = asset
- self.limit = limit or self.default_limit
+ if limit is None:
+ self.limit = self.default_limit
+ else:
+ self.limit = limit
def to_xdr_object(self):
"""Creates an XDR Operation object that represents this | fix(Operation.ChangeTrust): An exception should be thrown when the limit is set to 0(int). (#<I>)
#<I> | StellarCN_py-stellar-base | train | py |
03b18373682ecc2e6af0c05b8a5a798bb6cf2d7b | 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
@@ -12,7 +12,7 @@ end
require 'coveralls'
Coveralls.wear!
-require 'byebug'
+#require 'byebug'
$:.unshift 'lib' | Comment out byebug (Travis, I'm looking at you) | molybdenum-99_infoboxer | train | rb |
7aea7d5e902bf9dc632f372f8977b9df0dc2021b | diff --git a/easy_thumbnails/source_generators.py b/easy_thumbnails/source_generators.py
index <HASH>..<HASH> 100644
--- a/easy_thumbnails/source_generators.py
+++ b/easy_thumbnails/source_generators.py
@@ -22,13 +22,13 @@ def pil_image(source, exif_orientation=True, **options):
return
source = BytesIO(source.read())
- with Image.open(source) as image:
- # Fully load the image now to catch any problems with the image contents.
- try:
- ImageFile.LOAD_TRUNCATED_IMAGES = True
- image.load()
- finally:
- ImageFile.LOAD_TRUNCATED_IMAGES = False
+ image = Image.open(source)
+ # Fully load the image now to catch any problems with the image contents.
+ try:
+ ImageFile.LOAD_TRUNCATED_IMAGES = True
+ image.load()
+ finally:
+ ImageFile.LOAD_TRUNCATED_IMAGES = False
if exif_orientation:
image = utils.exif_orientation(image) | #<I> fix work with context manager | SmileyChris_easy-thumbnails | train | py |
0c281891948a793e79cc997d31918ba7f987f7ae | diff --git a/test/test_stripe_with_active_support.rb b/test/test_stripe_with_active_support.rb
index <HASH>..<HASH> 100644
--- a/test/test_stripe_with_active_support.rb
+++ b/test/test_stripe_with_active_support.rb
@@ -1,3 +1,2 @@
-require 'active_support'
-ActiveSupport.autoloads.each_key {|sym| ActiveSupport.const_get(sym)}
+require 'active_support/all'
load File.expand_path(File.join(File.dirname(__FILE__), 'test_stripe.rb')) | Slightly cleaner way of getting all of activesupport | stripe_stripe-ruby | train | rb |
edd52d5709e789ae8180cc57f7d71d49bb892c6d | diff --git a/tests/dummy/app/templates/snippets/config.js b/tests/dummy/app/templates/snippets/config.js
index <HASH>..<HASH> 100644
--- a/tests/dummy/app/templates/snippets/config.js
+++ b/tests/dummy/app/templates/snippets/config.js
@@ -3,7 +3,7 @@ ENV['ember-google-maps'] = {
language: 'en',
region: 'GB',
protocol: 'https',
- version: '3.35',
+ version: '3.41',
libraries: ['geometry', 'places'], // Optional libraries
// client: undefined,
// channel: undefined, | Bump maps version in sample config | sandydoo_ember-google-maps | train | js |
c855d2f113a104f7873800e95a90360dae263b79 | diff --git a/dispatchers/Html.php b/dispatchers/Html.php
index <HASH>..<HASH> 100644
--- a/dispatchers/Html.php
+++ b/dispatchers/Html.php
@@ -355,7 +355,7 @@ class QM_Dispatcher_Html extends QM_Dispatcher {
echo '<p>';
printf(
/* translators: %s: Name of the config file */
- esc_html__( 'The following PHP constants can be defined in your %s file in order to control the behaviour of Query Monitor:', 'query-monitor' ),
+ esc_html__( 'The following PHP constants can be defined in your %s file in order to control the behavior of Query Monitor:', 'query-monitor' ),
'<code>wp-config.php</code>'
);
echo '</p>'; | en_US localization
behaviour made into behavior | johnbillion_query-monitor | train | php |
9a551f5f2f386d9681f34825bddb8edcde44397f | diff --git a/src/Application.php b/src/Application.php
index <HASH>..<HASH> 100644
--- a/src/Application.php
+++ b/src/Application.php
@@ -132,7 +132,7 @@ class Application extends Container
$this->add('config', Config::create($config));
- $this->registerServicesProviders($config['providers']);
+ $this->registerServicesProviders($config['services']);
unset($config);
$this->booted = true;
}
diff --git a/tests/config/app.php b/tests/config/app.php
index <HASH>..<HASH> 100644
--- a/tests/config/app.php
+++ b/tests/config/app.php
@@ -35,7 +35,7 @@ return [
/**
* Bootstrap service.
*/
- 'providers' => [
+ 'services' => [
\FastD\ServiceProvider\DatabaseServiceProvider::class,
\FastD\ServiceProvider\CacheServiceProvider::class,
], | reset service. change to <I> | fastdlabs_fastD | train | php,php |
093767dbeae5b5d3b01d60ab0232dbde92e0b492 | diff --git a/cs-azure/src/main/java/io/cloudslang/content/azure/entities/AuthorizationTokenInputs.java b/cs-azure/src/main/java/io/cloudslang/content/azure/entities/AuthorizationTokenInputs.java
index <HASH>..<HASH> 100644
--- a/cs-azure/src/main/java/io/cloudslang/content/azure/entities/AuthorizationTokenInputs.java
+++ b/cs-azure/src/main/java/io/cloudslang/content/azure/entities/AuthorizationTokenInputs.java
@@ -1,5 +1,5 @@
/*
- * (c) Copyright 2021 EntIT Software LLC, a Micro Focus company, L.P.
+ * (c) Copyright 2019 EntIT Software LLC, a Micro Focus company, L.P.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License v2.0 which accompany this distribution.
* | Update AuthorizationTokenInputs.java
changed the copyright not to affect the commit | CloudSlang_cs-actions | train | java |
7c7d1de0a4e11a974421695fb316e49c08c8608a | diff --git a/src/Router/RouteParser/Alto/AltoRouteParser.php b/src/Router/RouteParser/Alto/AltoRouteParser.php
index <HASH>..<HASH> 100644
--- a/src/Router/RouteParser/Alto/AltoRouteParser.php
+++ b/src/Router/RouteParser/Alto/AltoRouteParser.php
@@ -59,7 +59,7 @@ class AltoRouteParser extends Router
if (Router::isAjax() || is_admin()) {
add_action('init', array($this, "onWordpressEarlyInit"));
} else {
- add_action('wp', array($this, "onWordpressInit"));
+ add_action('wp', array($this, "onWordpressInit"), 2);
}
}
diff --git a/src/Shell/Command/I18nCommand.php b/src/Shell/Command/I18nCommand.php
index <HASH>..<HASH> 100644
--- a/src/Shell/Command/I18nCommand.php
+++ b/src/Shell/Command/I18nCommand.php
@@ -121,7 +121,7 @@ class I18nCommand extends StrataCommandBase
$envTranslation->mergeWith($translation);
$envTranslation->toPoFile($envPoFile);
- Strata::app()->i18n->generateTranslationFiles();
+ Strata::app()->i18n->generateTranslationFiles($locale);
}
/** | delaying the start, bug fix wiht missing translation
; | strata-mvc_strata | train | php,php |
f7513a418bd6e7f7e3140d7042ca875528a50321 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -71,7 +71,8 @@ export default function (gql) {
name: typeDef.$$name || typeName,
values: _.mapValues(omitOptions(typeDef), function (v) {
return { value: v }
- })
+ }),
+ description: typeDef.$$description
})
}
@@ -86,7 +87,8 @@ export default function (gql) {
defaultValue: field.defaultValue,
description: field.description
}
- })
+ }),
+ description: typeDef.$$description
})
} | * adding description field to appropriate type creators | graphql-factory_graphql-factory | train | js |
4dc92e18ce79eafb7dadc71ece844cdabdd90bac | diff --git a/lib/redbooth-ruby/client.rb b/lib/redbooth-ruby/client.rb
index <HASH>..<HASH> 100644
--- a/lib/redbooth-ruby/client.rb
+++ b/lib/redbooth-ruby/client.rb
@@ -1,14 +1,16 @@
module RedboothRuby
class Client
RESOURCES = [:me, :user, :task, :organization, :person, :project,
- :conversation, :membership, :comment]
+ :conversation, :membership, :comment, :note]
attr_reader :session, :options
# Creates an client object using the given Redbooth session.
# existing account.
#
- # @param [String] client object to use the redbooth api.
+ # @param session [Redbooth::Session] redbooth session object with the correct authorization
+ # @param options [Hash] client options
+ # @option options [Proc] retry (the client will handle) Retry block to be executed when client hits an async endpoint
def initialize(session, options={})
raise RedboothRuby::AuthenticationError unless session.valid?
@session = session | Registered notes in client and improved client doc | redbooth_redbooth-ruby | train | rb |
78c7df97335588b9cc70097040a3f8a6e0848b90 | diff --git a/adafruit_platformdetect/constants/boards.py b/adafruit_platformdetect/constants/boards.py
index <HASH>..<HASH> 100644
--- a/adafruit_platformdetect/constants/boards.py
+++ b/adafruit_platformdetect/constants/boards.py
@@ -366,6 +366,7 @@ _PI_REV_CODES = {
"a03112",
"b03112",
"c03112",
+ "b03114",
"d03114",
"1a03111",
"2a03111", | Add support for RPi 4 Model B Rev <I>
Add rev_code "b<I>" in _PI_REV_CODES to support Rev <I> of RPi 4B. | adafruit_Adafruit_Python_PlatformDetect | train | py |
f90340601d68e018125ea9a2b181ddc244d8c12a | diff --git a/packages/node_modules/@webex/plugin-authorization-node/src/index.js b/packages/node_modules/@webex/plugin-authorization-node/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/node_modules/@webex/plugin-authorization-node/src/index.js
+++ b/packages/node_modules/@webex/plugin-authorization-node/src/index.js
@@ -2,8 +2,9 @@
* Copyright (c) 2015-2019 Cisco Systems, Inc. See LICENSE file.
*/
-import '@webex/internal-plugin-wdm';
+import '@webex/internal-plugin-device';
import {registerPlugin} from '@webex/webex-core';
+
import Authorization from './authorization';
import config from './config'; | refactor(plugin-authorization-node): migrate to device
Migrate from internal-plugin-wdm to internal-plugin-device. | webex_spark-js-sdk | train | js |
c47fafe50b83d555f1cb257b2bc91393b2642d37 | diff --git a/php/commands/post.php b/php/commands/post.php
index <HASH>..<HASH> 100644
--- a/php/commands/post.php
+++ b/php/commands/post.php
@@ -12,9 +12,17 @@ class Post_Command extends \WP_CLI\CommandWithDBObject {
/**
* Create a post.
*
- * @synopsis --<field>=<value> [--edit] [--porcelain]
+ * @synopsis [<file>] --<field>=<value> [--porcelain]
*/
- public function create( $_, $assoc_args ) {
+ public function create( $args, $assoc_args ) {
+ if ( ! empty( $args[0] ) ) {
+ $readfile = ( $args[0] === '-' ) ? 'php://stdin' : $args[0];
+
+ if ( ! file_exists( $readfile ) || ! is_file( $readfile ) )
+ \WP_CLI::error( "Unable to read content from $readfile." );
+
+ $assoc_args['post_content'] = file_get_contents( $readfile );
+ }
if ( isset( $assoc_args['edit'] ) ) {
$input = ( isset( $assoc_args['post_content'] ) ) ?
@@ -26,7 +34,6 @@ class Post_Command extends \WP_CLI\CommandWithDBObject {
$assoc_args['post_content'] = $input;
}
-
parent::create( $assoc_args );
} | Allow `wp post create` to read from file or STDIN
If a filename is passed as the first argument to `wp post create`, that
file will be read for the post's content. If the first argument is '-',
then post content will be read from STDIN.
If an unreadable filename is given, `wp post create` exits with an
error. | wp-cli_export-command | train | php |
56349697db002eecc19fb26ea2905de0ee876cbc | diff --git a/cmd/gb-vendor/fetch.go b/cmd/gb-vendor/fetch.go
index <HASH>..<HASH> 100644
--- a/cmd/gb-vendor/fetch.go
+++ b/cmd/gb-vendor/fetch.go
@@ -60,20 +60,7 @@ Flags:
return fmt.Errorf("specified repository is already downloaded")
}
- wc, err := repo.Clone()
- if err != nil {
- return err
- }
-
- if branch != "master" && revision != "" {
- return fmt.Errorf("you cannot specify branch and revision at once")
- }
-
- if branch != "master" {
- err = wc.CheckoutBranch(branch)
- } else {
- err = wc.CheckoutRevision(revision)
- }
+ wc, err := repo.Checkout("", "")
if err != nil {
return err
} | Fixed error which didn't comply with #<I> | constabulary_gb | train | go |
26b4a577e2c154c3709be19d93302f7cbf0030dd | diff --git a/gromacs/formats.py b/gromacs/formats.py
index <HASH>..<HASH> 100644
--- a/gromacs/formats.py
+++ b/gromacs/formats.py
@@ -259,8 +259,7 @@ class NDX(odict, utilities.FileUtils):
#: standard ndx file format: '%6d'
format = '%6d'
- def __init__(self, **kwargs):
- filename = kwargs.pop('filename',None)
+ def __init__(self, filename=None, **kwargs):
super(NDX, self).__init__(**kwargs) # can use kwargs to set dict! (but no sanity checks!)
if not filename is None: | fixed: NDX failed with NDX('foo')
git-svn-id: svn+ssh://gonzo.med.jhmi.edu/scratch/svn/woolf_repository/users/oliver/Library/GromacsWrapper@<I> df5ba8eb-4b0b-<I>-8c<I>-c<I>f<I>b<I>c | Becksteinlab_GromacsWrapper | train | py |
9daaa92cd35df7e632b7d1b3442511ca6a33c862 | diff --git a/packages/slate-tools/slate-tools.schema.js b/packages/slate-tools/slate-tools.schema.js
index <HASH>..<HASH> 100644
--- a/packages/slate-tools/slate-tools.schema.js
+++ b/packages/slate-tools/slate-tools.schema.js
@@ -82,6 +82,7 @@ module.exports = {
// https://www.npmjs.com/package/webpack-merge
'webpack.extend': {},
+ // Array of PostCSS plugins which is passed to the Webpack PostCSS Loader
'webpack.postcss.plugins': (config) => [
autoprefixer, | Add comment to 'webpack.postcss.plugins' config | Shopify_slate | train | js |
d4cae1d41e68595ad229a69fb7c45be4fbb333db | diff --git a/src/main/java/org/bychan/core/dynamic/TokenDefinitionBuilder.java b/src/main/java/org/bychan/core/dynamic/TokenDefinitionBuilder.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/bychan/core/dynamic/TokenDefinitionBuilder.java
+++ b/src/main/java/org/bychan/core/dynamic/TokenDefinitionBuilder.java
@@ -19,7 +19,12 @@ public class TokenDefinitionBuilder<N> {
@NotNull
public TokenDefinitionBuilder<N> matchesString(@NotNull final String text) {
- this.matcher = new StringMatcher(text);
+ return matches(new StringMatcher(text));
+ }
+
+ @NotNull
+ private TokenDefinitionBuilder<N> matches(@NotNull final TokenMatcher matcher) {
+ this.matcher = matcher;
return this;
}
@@ -30,8 +35,7 @@ public class TokenDefinitionBuilder<N> {
@NotNull
private TokenDefinitionBuilder<N> matchesPattern(@NotNull final Pattern pattern) {
- this.matcher = new RegexMatcher(pattern);
- return this;
+ return matches(new RegexMatcher(pattern));
}
public TokenDefinitionBuilder(@NotNull TokenDefinitionOwner<N> tokenDefinitionOwner) { | matches(TokenMatcher) | atorstling_bychan | train | java |
ef247dfa402eb75576d0d0cf2f17f1961a7e3a95 | diff --git a/src/Console/Command.php b/src/Console/Command.php
index <HASH>..<HASH> 100644
--- a/src/Console/Command.php
+++ b/src/Console/Command.php
@@ -206,10 +206,11 @@ class Commands extends Command
protected function advanceArg($key)
{
$data = Strings::splite($key, " : ");
+ //
$arg = $data[0];
- $disc = $data[1];
+ $desc = $data[1];
//
- $this->simpleArg($arg , $desc)
+ $this->simpleArg($arg , $desc);
}
/** | redesign the command class and fix an error | vinala_kernel | train | php |
44bdf631931111a8251908fa823943e24669d9f4 | diff --git a/lib/modelExtends.js b/lib/modelExtends.js
index <HASH>..<HASH> 100644
--- a/lib/modelExtends.js
+++ b/lib/modelExtends.js
@@ -72,6 +72,14 @@ module.exports = function(Sequelize) {
through: options.through
});
+ // remove ancestor and descendent setters
+ ['set', 'add', 'addMultiple', 'create', 'remove'].forEach(function(accessorType) {
+ delete this.Instance.prototype[this.associations[options.ancestorsAs].accessors[accessorType]];
+ delete this.associations[options.ancestorsAs].accessors[accessorType];
+ delete this.Instance.prototype[this.associations[options.descendentsAs].accessors[accessorType]];
+ delete this.associations[options.descendentsAs].accessors[accessorType];
+ }.bind(this));
+
// apply hooks
_.forIn(hooks, function(hookFn, hookName) {
this.addHook(hookName, hookFn); | Stop access to descendents/ancestors setters | overlookmotel_sequelize-hierarchy | train | js |
ddf9ed9da61f1d963fb468308e05c167fd5a7207 | diff --git a/salt/modules/system.py b/salt/modules/system.py
index <HASH>..<HASH> 100644
--- a/salt/modules/system.py
+++ b/salt/modules/system.py
@@ -491,8 +491,9 @@ def set_computer_desc(desc):
'''
hostname_cmd = salt.utils.which('hostnamectl')
if hostname_cmd:
- result = __salt__['cmd.run']('{0} set-hostname --pretty {1}'.format(hostname_cmd, desc))
- return True if result == '' else False
+ result = __salt__['cmd.retcode']('{0} set-hostname --pretty {1}'.format(hostname_cmd, desc))
+ log.debug('set-hostname response code: {0}'.format(result))
+ return True if result == 0 else False
if not os.path.isfile('/etc/machine-info'):
f = salt.utils.fopen('/etc/machine-info', 'a') | Switch to retcode evaluation for set_computer_desc
Attempt to fix failing test. Do not merge unless integration.modules.system tests all pass. | saltstack_salt | train | py |
3383ef49001a9b1a0d814fcd333ea015c49a9f0e | diff --git a/switchyard/lib/interface.py b/switchyard/lib/interface.py
index <HASH>..<HASH> 100644
--- a/switchyard/lib/interface.py
+++ b/switchyard/lib/interface.py
@@ -106,7 +106,7 @@ class Interface(object):
return self.__iftype
def __str__(self):
- s = "{} {} {} mac:{}".format(str(self.name), self.__ifnum, self.__iftype.name, str(self.ethaddr))
+ s = "{} mac:{}".format(str(self.name), str(self.ethaddr))
if int(self.ipaddr) != 0:
s += " ip:{}".format(self.__ipaddr)
return s | revert str repr of interface | jsommers_switchyard | train | py |
ab04da1c04a16b9861351b0cb0c2df5020b845f4 | diff --git a/deisctl/deisctl.go b/deisctl/deisctl.go
index <HASH>..<HASH> 100644
--- a/deisctl/deisctl.go
+++ b/deisctl/deisctl.go
@@ -39,7 +39,8 @@ Commands, use "deisctl help <command>" to learn more:
journal print the log output of a component
config set platform or component values
refresh-units refresh unit files from GitHub
- ssh open an interacive shell on a machine in the cluster
+ ssh open an interactive shell on a machine in the cluster
+ dock open an interactive shell on a container in the cluster
help show the help screen for a command
Options: | fix(deisctl): add dock to the list of commands | deis_deis | train | go |
8bc39ee010b6f35560b974d5a47b0c7ac86c2df2 | diff --git a/src/Core/file.js b/src/Core/file.js
index <HASH>..<HASH> 100644
--- a/src/Core/file.js
+++ b/src/Core/file.js
@@ -10,6 +10,12 @@ function caml_thread_yield() { }
// Provides: caml_mutex_new
function caml_mutex_new() { }
+// Provides: caml_mutex_lock
+function caml_mutex_lock() { }
+
+// Provides: caml_mutex_unlock
+function caml_mutex_unlock() { }
+
// Provides: lwt_unix_iov_max
function lwt_unix_iov_max() { } | Build - JS: Add stubs that were missed when adding the Mutex* module (#<I>) | revery-ui_revery | train | js |
b61e4f9b039569d87c816b1d5743ac307c8efd24 | diff --git a/OMMBV/tests/test_apex.py b/OMMBV/tests/test_apex.py
index <HASH>..<HASH> 100644
--- a/OMMBV/tests/test_apex.py
+++ b/OMMBV/tests/test_apex.py
@@ -109,7 +109,7 @@ class TestApexAccuracy(object):
pt2 = out[1]
for var in pt1.columns:
- np.testing.assert_allclose(pt2[var], pt1[var], rtol=1.E-5)
+ np.testing.assert_allclose(pt2[var], pt1[var], rtol=1.E-4)
np.testing.assert_allclose(pt1['h'], pt2['h'], rtol=1.E-9) | BUG: Reduced tolerance apex location | rstoneback_pysatMagVect | train | py |
92440cd577dbd8890e5d1857daeacb8c77631fbb | diff --git a/yaks/lib/yaks/primitivize.rb b/yaks/lib/yaks/primitivize.rb
index <HASH>..<HASH> 100644
--- a/yaks/lib/yaks/primitivize.rb
+++ b/yaks/lib/yaks/primitivize.rb
@@ -26,7 +26,7 @@ module Yaks
object
end
- p.map Symbol do |object|
+ p.map Symbol, URI do |object|
object.to_s
end | Turn URI objects into strings when primitivizing | plexus_yaks | train | rb |
3f027d02d36aaef8dfc39a401d721acd6df02b7c | diff --git a/yaka/services/indexing.py b/yaka/services/indexing.py
index <HASH>..<HASH> 100644
--- a/yaka/services/indexing.py
+++ b/yaka/services/indexing.py
@@ -329,7 +329,9 @@ def index_update(class_name, items):
index = service.index_for_model_class(model_class)
primary_field = model_class.search_query.primary
indexed_fields = model_class.whoosh_schema.names()
- query = db.session.query(model_class)
+
+ session = Session(bind=db.session.get_bind(None, None))
+ query = session.query(model_class)
with index.writer() as writer:
for change_type, model_pk in items:
@@ -342,6 +344,10 @@ def index_update(class_name, items):
if change_type in ("new", "changed"):
model = query.get(model_pk)
+ if model is None:
+ # deleted after task queued, but before task run
+ continue
+
# Hack: Load lazy fields
# This prevents a transaction error in make_document
for key in indexed_fields:
@@ -350,3 +356,4 @@ def index_update(class_name, items):
document = service.make_document(model, indexed_fields, primary_field)
writer.add_document(**document)
+ session.close() | index task:
obtain its own session to query models from DB:
* a task should not mess session for all task run after
* during tests the task is called in after_commit: "main" session is not active at this time.
Assume a changed or new model may have been deleted after task queued | abilian_abilian-core | train | py |
b5f6f670b3a2bb7999fb6a5053f9a228b013c32a | diff --git a/packages/example/bin/convert.js b/packages/example/bin/convert.js
index <HASH>..<HASH> 100755
--- a/packages/example/bin/convert.js
+++ b/packages/example/bin/convert.js
@@ -6,7 +6,7 @@ const fs = require('fs')
const path = require('path')
const glob = require('glob')
-const eslintRe = /\/\* eslint.+/g
+const eslintRe = /\/. eslint.+\s+/g
function replaceStringsIn (file) {
fs.readFile(file, 'utf8', function (err, str) {
@@ -36,7 +36,7 @@ function replaceStringsIn (file) {
glob('./app/**/*.html', { realpath: true }, function (err, files) {
if (err) throw err
- let spec = path.join(process.cwd(), 'cypress', 'integration', 'example_spec.js')
+ const spec = path.join(process.cwd(), 'cypress', 'integration', 'example_spec.js')
files.push(spec) | example: write the correct regexp to strip both kinds of eslint comments | cypress-io_cypress | train | js |
4c0a7a438bfca09806887f34e0fc7b0f1037bac8 | diff --git a/staticjinja/__init__.py b/staticjinja/__init__.py
index <HASH>..<HASH> 100644
--- a/staticjinja/__init__.py
+++ b/staticjinja/__init__.py
@@ -1,4 +1,20 @@
-# -*- coding:utf-8 -*-
+"""
+staticjinja
+===========
+
+staticjinja is a library that makes it easy to build static sites using Jinja2.
+
+Many static site generators are complex, with long manuals and unnecessary
+features. But using template engines to build static websites is really useful.
+staticjinja is designed to be lightweight (under 500 lines of source code), and
+to be easy to use, learn, and extend, enabling you to focus on making your site.
+
+Documentation is available at http://staticjinja.readthedocs.org/en/latest/.
+
+Please file bugs, view source code, and contribute at
+https://github.com/staticjinja/staticjinja/
+"""
+
# flake8: noqa
from __future__ import absolute_import | Add __doc__ to __init__.py
The docstring for the package was not very helpful. Now you get some more useful info and afew links. | Ceasar_staticjinja | train | py |
f01f6713c6c4a75226caabed8cf56df653502e67 | diff --git a/src/Authenticator/AuthenticatorCollection.php b/src/Authenticator/AuthenticatorCollection.php
index <HASH>..<HASH> 100644
--- a/src/Authenticator/AuthenticatorCollection.php
+++ b/src/Authenticator/AuthenticatorCollection.php
@@ -74,6 +74,7 @@ class AuthenticatorCollection extends AbstractCollection
*
* @param string $class Class name to be resolved.
* @return string|null
+ * @psalm-return class-string|null
*/
protected function _resolveClassName($class): ?string
{
diff --git a/src/Identifier/IdentifierCollection.php b/src/Identifier/IdentifierCollection.php
index <HASH>..<HASH> 100644
--- a/src/Identifier/IdentifierCollection.php
+++ b/src/Identifier/IdentifierCollection.php
@@ -101,6 +101,7 @@ class IdentifierCollection extends AbstractCollection implements IdentifierInter
*
* @param string $class Class name to be resolved.
* @return string|null
+ * @psalm-return class-string|null
*/
protected function _resolveClassName($class): ?string
{ | Add pslam specific annotation | cakephp_authentication | train | php,php |
8567ed6af2962741b5659f8889d554bbb85dadf4 | diff --git a/billing/tests/__init__.py b/billing/tests/__init__.py
index <HASH>..<HASH> 100644
--- a/billing/tests/__init__.py
+++ b/billing/tests/__init__.py
@@ -1,7 +1,7 @@
import unittest
-# from gateway_tests import *
-# from authorize_net_tests import *
-# from pay_pal_tests import *
+from gateway_tests import *
+from authorize_net_tests import *
+from pay_pal_tests import *
from eway_tests import *
if __name__ == "__main__": | Uncommenting other gateway tests so that all of them run. | agiliq_merchant | train | py |
2be19cfa89f817648379662326944c7ec09d27cf | diff --git a/tests/support/mock.py b/tests/support/mock.py
index <HASH>..<HASH> 100644
--- a/tests/support/mock.py
+++ b/tests/support/mock.py
@@ -163,8 +163,9 @@ class MockFH(object):
# requested size, but before doing so, reset read_data to reflect
# what we read.
self.read_data = self._iterate_read_data(joined[size:])
- self._loc += size
- return joined[:size]
+ ret = joined[:size]
+ self._loc += len(ret)
+ return ret
def _readlines(self, size=None): # pylint: disable=unused-argument
# TODO: Implement "size" argument | Report correct location when reading using explicit size and EOF reached | saltstack_salt | train | py |
e8a96fca3b91cd70d6de96aae08d80837b854dd5 | diff --git a/app/apis/ali_dns.rb b/app/apis/ali_dns.rb
index <HASH>..<HASH> 100644
--- a/app/apis/ali_dns.rb
+++ b/app/apis/ali_dns.rb
@@ -1,4 +1,7 @@
-require 'aliyunsdkcore'
+begin
+ require 'aliyunsdkcore'
+rescue LoadError
+end
module AliDns
extend self
@@ -60,4 +63,4 @@ module AliDns
end
end
-end if defined? AliyunSDKCore
+end | no more check aliyun sdk core id defined? | work-design_rails_com | train | rb |
a339fe44ad57f8c9d3c8ee0a72b5c046cc0db971 | diff --git a/code/libraries/koowa/template/helper/behavior.php b/code/libraries/koowa/template/helper/behavior.php
index <HASH>..<HASH> 100644
--- a/code/libraries/koowa/template/helper/behavior.php
+++ b/code/libraries/koowa/template/helper/behavior.php
@@ -225,7 +225,7 @@ class KTemplateHelperBehavior extends KTemplateHelperAbstract
$config->append(array(
'selector' => '.-koowa-form',
'options' => array(
- 'scrollToErrorsOnBlur' => true
+ 'scrollToErrorsOnSubmit' => false
)
)); | Prevent the validator behavior from scrolling to the error. | joomlatools_joomlatools-framework | train | php |
6f97d9c98083e8e01586fe1ea3380ba8a146bf3c | diff --git a/src/rezplugins/shell/_utils/powershell_base.py b/src/rezplugins/shell/_utils/powershell_base.py
index <HASH>..<HASH> 100644
--- a/src/rezplugins/shell/_utils/powershell_base.py
+++ b/src/rezplugins/shell/_utils/powershell_base.py
@@ -3,6 +3,7 @@
import os
+import re
from subprocess import PIPE
from rez.config import config
@@ -22,6 +23,17 @@ class PowerShellBase(Shell):
expand_env_vars = True
syspaths = None
+ # Make sure that the $Env:VAR formats come before the $VAR formats since
+ # PowerShell Environment variables are ambiguous with Unix paths.
+ # Note: This is used in other parts of Rez
+ ENV_VAR_REGEX = re.compile(
+ "|".join([
+ "\\$[Ee][Nn][Vv]:([a-zA-Z_]+[a-zA-Z0-9_]*?)", # $Env:ENVVAR
+ "\\${[Ee][Nn][Vv]:([a-zA-Z_]+[a-zA-Z0-9_]*?)}", # ${Env:ENVVAR}
+ Shell.ENV_VAR_REGEX.pattern, # Generic form
+ ])
+ )
+
@staticmethod
def _escape_quotes(s):
return s.replace('"', '`"').replace("'", "`'") | Revert removal of ENV_VAR_REGEX as it is needed | nerdvegas_rez | train | py |
79f0f067f8546e6e87960576c2e0c33d72fec47b | diff --git a/src/frontend/org/voltdb/dbmonitor/js/voltdb.core.js b/src/frontend/org/voltdb/dbmonitor/js/voltdb.core.js
index <HASH>..<HASH> 100644
--- a/src/frontend/org/voltdb/dbmonitor/js/voltdb.core.js
+++ b/src/frontend/org/voltdb/dbmonitor/js/voltdb.core.js
@@ -8,7 +8,7 @@
DbConnection = function(aServer, aPort, aAdmin, aUser, aPassword, aIsHashPassword,aProcess) {
this.server = aServer == null ? 'localhost' : $.trim(aServer);
this.port = aPort == null ? '8080' : $.trim(aPort);
- this.admin = aAdmin == true;
+ this.admin = (aAdmin == true || aAdmin == "true");
this.user = aUser == '' ? null : aUser;
this.password = aPassword == '' ? null : (aIsHashPassword == false ? aPassword : null);
this.isHashedPassword = aPassword == '' ? null : (aIsHashPassword == true ? aPassword : null); | Handled the string value of boolean for this.admin variable. | VoltDB_voltdb | train | js |
30bd8039ea3d2f35fa477f6cd57d1e78866b6260 | diff --git a/lib/combinators.js b/lib/combinators.js
index <HASH>..<HASH> 100644
--- a/lib/combinators.js
+++ b/lib/combinators.js
@@ -365,7 +365,7 @@ module.exports = (_core, _prim) => {
const headRes = term.run(currentState);
if (headRes.succeeded) {
- if (consumed) {
+ if (headRes.consumed) {
consumed = true;
currentVal = headRes.val;
currentState = headRes.state; | :bug: Fix `chainl1()` | susisu_loquat-combinators | train | js |
a832148574434476c571478f7d72e2a21c978ea6 | diff --git a/src/Laracasts/Utilities/JavaScript/PHPToJavaScriptTransformer.php b/src/Laracasts/Utilities/JavaScript/PHPToJavaScriptTransformer.php
index <HASH>..<HASH> 100644
--- a/src/Laracasts/Utilities/JavaScript/PHPToJavaScriptTransformer.php
+++ b/src/Laracasts/Utilities/JavaScript/PHPToJavaScriptTransformer.php
@@ -1,6 +1,7 @@
<?php namespace Laracasts\Utilities\JavaScript;
use Exception;
+use stdClass;
class PHPToJavaScriptTransformer {
@@ -22,7 +23,7 @@ class PHPToJavaScriptTransformer {
* @var array
*/
protected $types = [
- 'String', 'Array', 'Object', 'Numeric', 'Boolean', 'Null'
+ 'String', 'Array', 'stdClass', 'Object', 'Numeric', 'Boolean', 'Null'
];
/**
@@ -168,6 +169,19 @@ class PHPToJavaScriptTransformer {
* @return string
* @throws \Exception
*/
+ protected function transformstdClass($value)
+ {
+ if ($value instanceof stdClass)
+ {
+ return json_encode($value);
+ }
+ }
+
+ /**
+ * @param $value
+ * @return string
+ * @throws \Exception
+ */
protected function transformObject($value)
{
if (is_object($value)) | Handle values of the type stdClass, which plays nicely with json_encode | laracasts_PHP-Vars-To-Js-Transformer | train | php |
32dce3ea56fb2891b54be48c16a13d2a9eb0cd33 | diff --git a/src/org/mockito/Answers.java b/src/org/mockito/Answers.java
index <HASH>..<HASH> 100644
--- a/src/org/mockito/Answers.java
+++ b/src/org/mockito/Answers.java
@@ -24,7 +24,6 @@ import org.mockito.stubbing.Answer;
* <b>This is not the full list</b> of Answers available in Mockito. Some interesting answers can be found in org.mockito.stubbing.answers package.
*/
public enum Answers implements Answer<Object>{
-
/**
* The default configured answer of every mock.
*
@@ -78,6 +77,15 @@ public enum Answers implements Answer<Object>{
this.implementation = implementation;
}
+ /**
+ * @deprecated Use the enum-constant directly, instead of this getter.<br>
+ * E.g. instead of <code>Answers.CALLS_REAL_METHODS.get()</code> use <code>Answers.CALLS_REAL_METHODS</code> .
+ */
+ @Deprecated
+ public Answer<Object> get() {
+ return this;
+ }
+
public Object answer(InvocationOnMock invocation) throws Throwable {
return implementation.answer(invocation);
} | Re-added Answers.get() and made it deprecated to maintain backward
compatibility. | mockito_mockito | train | java |
5584cc2c6f3f16109462bf46f460e696e80e2c36 | diff --git a/salt/utils/win_runas.py b/salt/utils/win_runas.py
index <HASH>..<HASH> 100644
--- a/salt/utils/win_runas.py
+++ b/salt/utils/win_runas.py
@@ -19,6 +19,7 @@ try:
import win32profile
import msvcrt
import ctypes
+ import winerror
from ctypes import wintypes
HAS_WIN32 = True
except ImportError:
@@ -298,9 +299,17 @@ def runas_system(cmd, username, password):
win32con.LOGON32_LOGON_INTERACTIVE,
win32con.LOGON32_PROVIDER_DEFAULT)
- # Get Unrestricted Token (UAC) if this is an Admin Account
- elevated_token = win32security.GetTokenInformation(
- token, win32security.TokenLinkedToken)
+ try:
+ # Get Unrestricted Token (UAC) if this is an Admin Account
+ elevated_token = win32security.GetTokenInformation(
+ token, win32security.TokenLinkedToken)
+ except win32security.error as exc:
+ # User doesn't have admin, use existing token
+ if exc[0] == winerror.ERROR_NO_SUCH_LOGON_SESSION \
+ or exc[0] == winerror.ERROR_PRIVILEGE_NOT_HELD:
+ elevated_token = token
+ else:
+ raise
# Get Security Attributes
security_attributes = win32security.SECURITY_ATTRIBUTES() | Handle users that aren't admin | saltstack_salt | train | py |
3ba0bd94b1fdd74b30e9d3dc283b67f976edf0fe | diff --git a/common/src/js/bot/locators/xpath.js b/common/src/js/bot/locators/xpath.js
index <HASH>..<HASH> 100644
--- a/common/src/js/bot/locators/xpath.js
+++ b/common/src/js/bot/locators/xpath.js
@@ -31,8 +31,13 @@ goog.require('goog.dom.xml');
* such element could be found.
*/
bot.locators.xpath.single = function(target, root) {
- var node = goog.dom.xml.selectSingleNode(root, target);
-
+ try {
+ var node = goog.dom.xml.selectSingleNode(root, target);
+ } catch (e) {
+ // selectSingleNode throws when the document object
+ // is not defined in the context in which it executes.
+ return null;
+ }
if (!node) {
return null;
} | DouniaBerrada: Fixing exception thrown when document is not in context.
r<I> | SeleniumHQ_selenium | train | js |
b11640ab690314411957a155bf5e24c0b7ab2c67 | diff --git a/spring-cloud-config-monitor/src/main/java/org/springframework/cloud/config/monitor/FileMonitorConfiguration.java b/spring-cloud-config-monitor/src/main/java/org/springframework/cloud/config/monitor/FileMonitorConfiguration.java
index <HASH>..<HASH> 100644
--- a/spring-cloud-config-monitor/src/main/java/org/springframework/cloud/config/monitor/FileMonitorConfiguration.java
+++ b/spring-cloud-config-monitor/src/main/java/org/springframework/cloud/config/monitor/FileMonitorConfiguration.java
@@ -274,9 +274,10 @@ public class FileMonitorConfiguration implements SmartLifecycle, ResourceLoaderA
BasicFileAttributes attrs) throws IOException {
FileVisitResult fileVisitResult = super.preVisitDirectory(dir, attrs);
// No need to monitor the git metadata
- if (!dir.toFile().getPath().contains(".git")) {
- registerWatch(dir);
+ if (dir.toFile().getPath().contains(".git")) {
+ return FileVisitResult.SKIP_SUBTREE;
}
+ registerWatch(dir);
return fileVisitResult;
} | More efficiently exlcude .git directories from file watcher
See gh-<I> | spring-cloud_spring-cloud-config | train | java |
1ceb21c28d0d72f1cd5d718a9de3337f4d32e65b | diff --git a/redisson/src/main/java/org/redisson/pubsub/AsyncSemaphore.java b/redisson/src/main/java/org/redisson/pubsub/AsyncSemaphore.java
index <HASH>..<HASH> 100644
--- a/redisson/src/main/java/org/redisson/pubsub/AsyncSemaphore.java
+++ b/redisson/src/main/java/org/redisson/pubsub/AsyncSemaphore.java
@@ -119,5 +119,12 @@ public class AsyncSemaphore {
acquire(runnable);
}
}
+
+ @Override
+ public String toString() {
+ return "AsyncSemaphore [counter=" + counter + "]";
+ }
+
+
} | AsyncSemaphore.toString method added | redisson_redisson | train | java |
f52dcb637fd9a11be706f26e29c4424d011822d1 | diff --git a/agent/agent.go b/agent/agent.go
index <HASH>..<HASH> 100644
--- a/agent/agent.go
+++ b/agent/agent.go
@@ -177,7 +177,7 @@ func (a *Agent) ReportJobState(jobName string, jobState *job.JobState) {
// Submit all possible bids for unresolved offers
func (a *Agent) BidForPossibleJobs() {
a.state.Lock()
- offers := a.state.GetUnbadeOffers()
+ offers := a.state.GetOffersWithoutBids()
a.state.Unlock()
log.V(2).Infof("Checking %d unbade offers", len(offers))
diff --git a/agent/state.go b/agent/state.go
index <HASH>..<HASH> 100644
--- a/agent/state.go
+++ b/agent/state.go
@@ -136,7 +136,9 @@ func (self *AgentState) GetBadeOffers() []job.JobOffer {
return offers
}
-func (self *AgentState) GetUnbadeOffers() []job.JobOffer {
+// GetOffersWithoutBids returns all tracked JobOffers that have
+// no corresponding JobBid tracked in the same AgentState object.
+func (self *AgentState) GetOffersWithoutBids() []job.JobOffer {
offers := make([]job.JobOffer, 0)
for _, offer := range self.offers {
if !self.HasBid(offer.Job.Name) { | refactor(AgentState): Rename GetUnbadeOffers -> GetOffersWithoutBids | coreos_fleet | train | go,go |
e13a3175fb86eef065d0a887388da83de1b70e6b | diff --git a/lib/oxidized/model/planet.rb b/lib/oxidized/model/planet.rb
index <HASH>..<HASH> 100644
--- a/lib/oxidized/model/planet.rb
+++ b/lib/oxidized/model/planet.rb
@@ -39,9 +39,10 @@ class Planet < Oxidized::Model
cfg = cfg.each_line.to_a[0...-2]
- # Strip system time and system uptime from planet gs switches
+ # Strip system (up)time and temperature
cfg = cfg.reject { |line| line.match /System Time\s*:.*/ }
cfg = cfg.reject { |line| line.match /System Uptime\s*:.*/ }
+ cfg = cfg.reject { |line| line.match /Temperature\s*:.*/ }
comment cfg.join
end | Planet: remove temperature from output
Some Planet Switches (at least from their industrial line)
show the system temperature on the 'show version'
command, so strip it from the output, too. | ytti_oxidized | train | rb |
62e2ec6c5e830da3349233e3f6cbc2044a17390c | diff --git a/future/__init__.py b/future/__init__.py
index <HASH>..<HASH> 100644
--- a/future/__init__.py
+++ b/future/__init__.py
@@ -83,8 +83,8 @@ The software is distributed under an MIT licence. See LICENSE.txt.
"""
-from future import standard_library, utils
-from future.builtins import *
+# from future import standard_library, utils
+# from future.builtins import *
__title__ = 'future'
__author__ = 'Ed Schofield' | Disable imports from ``future`` base package again for now | PythonCharmers_python-future | train | py |
19596d4a8bf870d99a4e428b1290b7db158d01bf | diff --git a/src/Cache.php b/src/Cache.php
index <HASH>..<HASH> 100644
--- a/src/Cache.php
+++ b/src/Cache.php
@@ -88,8 +88,8 @@ class Cache
/** @var \DirectoryIterator $item */
foreach ($iterator as $item) {
- if ($item->isFile()
- && !$item->isDot()
+ if (!$item->isDot()
+ && $item->isFile()
&& !$this->isDotFile($item)
&& $this->isOld($item)) {
unlink($item->getPathname()); | Check dot before file in cache cleanup to prevent openbasedir errors (Closes #<I>) | mpdf_mpdf | train | php |
1b6257e87156cda1093d18eb86e4202705aa9887 | diff --git a/pymc3/sampling.py b/pymc3/sampling.py
index <HASH>..<HASH> 100644
--- a/pymc3/sampling.py
+++ b/pymc3/sampling.py
@@ -68,7 +68,7 @@ def assign_step_methods(model, step=None, methods=(NUTS, HamiltonianMC, Metropol
selected_steps = defaultdict(list)
for var in model.free_RVs:
if var not in assigned_vars:
- selected = max(methods, key=lambda method: method._competence(var))
+ selected = max(methods, key=lambda method, var=var: method._competence(var))
pm._log.info('Assigned {0} to {1}'.format(selected.__name__, var))
selected_steps[selected].append(var) | Eliminated cell variable defined in loop warning | pymc-devs_pymc | train | py |
4d515b05f3d8e7d3f3074b2f85146a34dc4d875d | diff --git a/tests/test_logging.py b/tests/test_logging.py
index <HASH>..<HASH> 100644
--- a/tests/test_logging.py
+++ b/tests/test_logging.py
@@ -104,4 +104,4 @@ def test_log_connection_lost(debug, monkeypatch):
assert log.startswith(
'Connection lost before response written @')
else:
- 'Connection lost before response written @' not in log
+ assert 'Connection lost before response written @' not in log | :white_check_mark: fix missed assertion | huge-success_sanic | train | py |
d2528fde30dbef252f3325b51f876eb23d9143c9 | diff --git a/src/main/java/org/syphr/prom/ManagedProperty.java b/src/main/java/org/syphr/prom/ManagedProperty.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/syphr/prom/ManagedProperty.java
+++ b/src/main/java/org/syphr/prom/ManagedProperty.java
@@ -18,6 +18,7 @@ package org.syphr.prom;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.Future;
/**
* This class provides the properties management API of {@link PropertiesManager} with
@@ -370,6 +371,27 @@ public class ManagedProperty<T extends Enum<T>>
{
manager.saveProperty(propertyKey, value);
}
+
+ /**
+ * Delegate to {@link PropertiesManager#saveProperty(Enum)}.
+ *
+ * @throws IOException
+ * see delegate
+ */
+ public void saveProperty() throws IOException
+ {
+ manager.saveProperty(propertyKey);
+ }
+
+ /**
+ * Delegate to {@link PropertiesManager#savePropertyNB(Enum)}.
+ *
+ * @return see delegate
+ */
+ public Future<Void> savePropertyNB()
+ {
+ return manager.savePropertyNB(propertyKey);
+ }
/**
* Delegate to {@link PropertiesManager#resetProperty(Enum)}. | added delegates for the new save individual properties functionality to the ManagedProperty class | syphr42_prom | train | java |
6219facbcf54df43d3ebcf2ede5d54f89c1a2a12 | diff --git a/src/Socialite/Two/TokenlyAccountsProvider.php b/src/Socialite/Two/TokenlyAccountsProvider.php
index <HASH>..<HASH> 100644
--- a/src/Socialite/Two/TokenlyAccountsProvider.php
+++ b/src/Socialite/Two/TokenlyAccountsProvider.php
@@ -14,7 +14,7 @@ class TokenlyAccountsProvider extends AbstractProvider implements ProviderInterf
*
* @var array
*/
- protected $scopes = ['user'];
+ protected $scopes = ['user', 'tca'];
protected $base_url = 'https://accounts.tokenly.com'; | added default TCA scope to accounts provider | tokenly_tokenpass-client | train | php |
38730c15f95b41c4f3bdd206eff3c9ad15dbf788 | diff --git a/spring-android-core/src/main/java/org/springframework/util/ClassUtils.java b/spring-android-core/src/main/java/org/springframework/util/ClassUtils.java
index <HASH>..<HASH> 100644
--- a/spring-android-core/src/main/java/org/springframework/util/ClassUtils.java
+++ b/spring-android-core/src/main/java/org/springframework/util/ClassUtils.java
@@ -1161,7 +1161,7 @@ public abstract class ClassUtils {
* @return the common ancestor (i.e. common superclass, one interface
* extending the other), or {@code null} if none found. If any of the
* given classes is {@code null}, the other class will be returned.
- * @since 3.2.6
+ * @since 2.0
*/
public static Class<?> determineCommonAncestor(Class<?> clazz1, Class<?> clazz2) {
if (clazz1 == null) { | Use correct @since version for Spring for Android | spring-projects_spring-android | train | java |
84ac03560a7ef7cd6160808fb7609341f5672973 | diff --git a/src/Versionable/Http/Url/Url.php b/src/Versionable/Http/Url/Url.php
index <HASH>..<HASH> 100644
--- a/src/Versionable/Http/Url/Url.php
+++ b/src/Versionable/Http/Url/Url.php
@@ -28,7 +28,7 @@ class Url implements UrlInterface
{
$this->setParameters($parameters);
- if (null === $url) {
+ if (null !== $url) {
$this->setUrl($url);
}
} | Fix incorrect check. Make sure NOT null | versionable_Prospect | train | php |
3fdfa261ad3412dd9d4f361b4fbdefa5c5108db9 | diff --git a/EmailValidator/EmailLexer.php b/EmailValidator/EmailLexer.php
index <HASH>..<HASH> 100644
--- a/EmailValidator/EmailLexer.php
+++ b/EmailValidator/EmailLexer.php
@@ -67,8 +67,6 @@ class EmailLexer extends AbstractLexer
"\n" => self::S_LF,
"\r\n" => self::CRLF,
'IPv6' => self::S_IPV6TAG,
- '<' => self::S_LOWERTHAN,
- '>' => self::S_GREATERTHAN,
'{' => self::S_OPENQBRACKET,
'}' => self::S_CLOSEQBRACKET,
'' => self::S_EMPTY, | Remove duplicat < and > char value (#<I>) | egulias_EmailValidator | train | php |
601824ea1e50254ee54ce85eaf5bc63321e93056 | diff --git a/test/cases/parsing/context/warnings.js b/test/cases/parsing/context/warnings.js
index <HASH>..<HASH> 100644
--- a/test/cases/parsing/context/warnings.js
+++ b/test/cases/parsing/context/warnings.js
@@ -1,5 +1,5 @@
module.exports = [
- [/Module parse failed/, /dump-file\.txt/, /templates sync \^\\\.\\\/\.\*\$/],
+ [/Module parse failed/, /dump-file\.txt/, /templates sync/],
[/Critical dependency/, /templateLoader\.js/],
[/Critical dependency/, /templateLoaderIndirect\.js/],
[/Critical dependency/, /templateLoaderIndirect\.js/], | be less strict in test case
issuer can vary | webpack_webpack | train | js |
d1ae2039016e1110a93c0bb0bdc1d6b1349cf11a | diff --git a/untwisted/iossl.py b/untwisted/iossl.py
index <HASH>..<HASH> 100644
--- a/untwisted/iossl.py
+++ b/untwisted/iossl.py
@@ -18,7 +18,7 @@ class DumpStrSSL(DumpStr):
else:
self.data = buffer(self.data, size)
-class DumpFileSSL(DumpFile):
+class DumpFileSSL(DumpStrSSL, DumpFile):
pass
class StdinSSL(Stdin): | Fixing DumpFileSSL class. | untwisted_untwisted | train | py |
fa8d7731c058273fe52343a8e982a67fb2071c06 | diff --git a/pifpaf/tests/test_drivers.py b/pifpaf/tests/test_drivers.py
index <HASH>..<HASH> 100644
--- a/pifpaf/tests/test_drivers.py
+++ b/pifpaf/tests/test_drivers.py
@@ -75,6 +75,7 @@ class TestDrivers(testtools.TestCase):
def test_stuck_process(self):
d = drivers.Driver(debug=True)
+ d.setUp()
c, _ = d._exec(["bash", "-c",
"trap ':' TERM ; echo start; sleep 10000"],
wait_for_line="start") | tests: call setUp to init cleanups | jd_pifpaf | train | py |
1609fc81a8c8d26eb8816827b13735419eae3929 | diff --git a/uncommitted/__init__.py b/uncommitted/__init__.py
index <HASH>..<HASH> 100644
--- a/uncommitted/__init__.py
+++ b/uncommitted/__init__.py
@@ -68,7 +68,7 @@ contribute additional detection and scanning routines.
Changelog
---------
-**2.3** (2020 Apr 9)
+**2.3** (2020 May 14)
- *Bugfix:* the regular expression that matches the name of a git
submodule would get confused if the submodule's directory name itself | Update release date for <I> | brandon-rhodes_uncommitted | train | py |
e410420ce581033ccc4ab951d6a1d250abe7206a | diff --git a/src/RWFileCache.php b/src/RWFileCache.php
index <HASH>..<HASH> 100644
--- a/src/RWFileCache.php
+++ b/src/RWFileCache.php
@@ -210,7 +210,7 @@ class RWFileCache
{
$key = basename($key);
- $key = str_replace(array('-', '.', '_'), '/', $key);
+ $key = str_replace(array('-', '.', '_', '\\'), '/', $key);
while(strpos($key, '//')!==false) {
$key = str_replace('//', '/', $key); | Added backslash to directory creation logic | DivineOmega_DO-File-Cache | train | php |
9af0d5cd7a4579e91362c8fcf4eaaabce041c67a | diff --git a/indra/tests/test_docs_code.py b/indra/tests/test_docs_code.py
index <HASH>..<HASH> 100644
--- a/indra/tests/test_docs_code.py
+++ b/indra/tests/test_docs_code.py
@@ -162,11 +162,11 @@ def test_nl_modeling():
# CODE IN gene_network.rst
def test_gene_network():
- # Chunk 1
- from indra.tools.gene_network import GeneNetwork
- gn = GeneNetwork(['BRCA1'])
- biopax_stmts = gn.get_biopax_stmts()
- bel_stmts = gn.get_bel_stmts()
+ # Chunk 1: this is tested in _get_gene_network_stmts
+ # from indra.tools.gene_network import GeneNetwork
+ # gn = GeneNetwork(['BRCA1'])
+ # biopax_stmts = gn.get_biopax_stmts()
+ # bel_stmts = gn.get_bel_stmts()
# Chunk 2
from indra import literature | Comment out chunk that is already tested in fcn | sorgerlab_indra | train | py |
edeaf1ca8d43fb8abdd75be9387143aee4970d1a | diff --git a/nodeserver/src/client/js/DataGrid/DataGridView.js b/nodeserver/src/client/js/DataGrid/DataGridView.js
index <HASH>..<HASH> 100644
--- a/nodeserver/src/client/js/DataGrid/DataGridView.js
+++ b/nodeserver/src/client/js/DataGrid/DataGridView.js
@@ -982,6 +982,15 @@ i,
this._isApplyingCommonColumnFilter = false;
};
+ /* METHOD CALLED WHEN THE WIDGET'S READ-ONLY PROPERTY CHANGES */
+ DataGridView.prototype.onReadOnlyChanged = function (isReadOnly) {
+ //if already editing rows --> cancel edit mode
+ this.$el.find('.editCancel').trigger('click');
+
+ //apply parent's onReadOnlyChanged
+ __parent_proto__.onReadOnlyChanged.call(this, isReadOnly);
+ };
+
/************** PUBLIC API OVERRIDABLES **************************/
DataGridView.prototype.onCellEdit = function (params) { | custom onReadOnlyChanged
cancel edit is rows are already being edited
Former-commit-id: <I>e8a<I>d<I>a1b<I>cfe<I>e<I>a8a<I> | webgme_webgme-engine | train | js |
15a724dfff40ec3b35af2526584e81ff82b4c40b | diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py
index <HASH>..<HASH> 100644
--- a/alot/commands/envelope.py
+++ b/alot/commands/envelope.py
@@ -324,10 +324,9 @@ class EditCommand(Command):
# get input
# tempfile will be removed on buffer cleanup
- f = open(self.envelope.tmpfile.name)
enc = settings.get('editor_writes_encoding')
- template = string_decode(f.read(), enc)
- f.close()
+ with open(self.envelope.tmpfile.name) as f:
+ template = string_decode(f.read(), enc)
# call post-edit translate hook
translate = settings.get_hook('post_edit_translate')
diff --git a/alot/db/message.py b/alot/db/message.py
index <HASH>..<HASH> 100644
--- a/alot/db/message.py
+++ b/alot/db/message.py
@@ -70,9 +70,8 @@ class Message(object):
"Message file is no longer accessible:\n%s" % path
if not self._email:
try:
- f_mail = open(path)
- self._email = message_from_file(f_mail)
- f_mail.close()
+ with open(path) as f:
+ self._email = message_from_file(f)
except IOError:
self._email = email.message_from_string(warning)
return self._email | use open() as context manager
This uses open() as a context manager instead of calling close()
explicitly. This has the advantage of closing even in the event of an
exception, being easier to visually inspect for correctness, and being
the more modern idiom.
This does leave one case of file.close(), where FILE is opened in an if
tree. | pazz_alot | train | py,py |
423c2a4216777c4cbd40b84d28a5f5d481cb7d99 | diff --git a/Neos.Cache/Classes/EnvironmentConfiguration.php b/Neos.Cache/Classes/EnvironmentConfiguration.php
index <HASH>..<HASH> 100644
--- a/Neos.Cache/Classes/EnvironmentConfiguration.php
+++ b/Neos.Cache/Classes/EnvironmentConfiguration.php
@@ -40,7 +40,7 @@ class EnvironmentConfiguration
*
* @var integer
*/
- protected $maximumPathLength = PHP_MAXPATHLEN;
+ protected $maximumPathLength;
/**
* EnvironmentConfiguration constructor.
@@ -49,7 +49,7 @@ class EnvironmentConfiguration
* @param string $fileCacheBasePath
* @param integer $maximumPathLength
*/
- public function __construct($applicationIdentifier, $fileCacheBasePath, $maximumPathLength)
+ public function __construct($applicationIdentifier, $fileCacheBasePath, $maximumPathLength = PHP_MAXPATHLEN)
{
$this->applicationIdentifier = $applicationIdentifier;
$this->fileCacheBasePath = $fileCacheBasePath; | TASK: change parameter maximumPathLength for constructor
As mentioned in the github/neos/cache is the decalaration of the property maximumPathLength with a value and then requiring a value for that property inside the constructor a minor bug. So the parameter for the constructor should be changed to an optional with the deault value as set for declaration | neos_flow-development-collection | train | php |
472fffb931b54805c8f7ffee954b5c113922017e | diff --git a/tests/Zicht/ItertoolsTest/RepeatTest.php b/tests/Zicht/ItertoolsTest/RepeatTest.php
index <HASH>..<HASH> 100644
--- a/tests/Zicht/ItertoolsTest/RepeatTest.php
+++ b/tests/Zicht/ItertoolsTest/RepeatTest.php
@@ -20,9 +20,9 @@ class RepeatTest extends \PHPUnit_Framework_TestCase
{
$iterator = \Zicht\Itertools\repeat($object, $times);
$this->assertInstanceOf('\Zicht\Itertools\lib\RepeatIterator', $iterator);
- $this->assertEquals(sizeof($iterator), null === $times ? -1 : $times);
+ $this->assertEquals(sizeof($iterator), null === $times ? -1 : $times, 'Failure in $iterator->count() [1]');
if (null !== $times) {
- $this->assertEquals(iterator_count($iterator), $times);
+ $this->assertEquals(iterator_count($iterator), $times, 'Failure in $iterator->count() [2]');
}
$iterator->rewind(); | Make the tests fail more verbose | zicht_itertools | train | php |
b94ee471873182a573bca3944922584e71605329 | diff --git a/lib/futures_pipeline/version.rb b/lib/futures_pipeline/version.rb
index <HASH>..<HASH> 100644
--- a/lib/futures_pipeline/version.rb
+++ b/lib/futures_pipeline/version.rb
@@ -1,3 +1,3 @@
module FuturesPipeline
- VERSION = "0.1.0"
+ VERSION = "0.1.1"
end | Bump gem version to <I> | codeforamerica_futures_pipeline | train | rb |
257168837b0be98f53ec4ce48954904c7883c811 | diff --git a/modules/activiti-engine/src/main/java/org/activiti/test/ProcessDeployer.java b/modules/activiti-engine/src/main/java/org/activiti/test/ProcessDeployer.java
index <HASH>..<HASH> 100644
--- a/modules/activiti-engine/src/main/java/org/activiti/test/ProcessDeployer.java
+++ b/modules/activiti-engine/src/main/java/org/activiti/test/ProcessDeployer.java
@@ -145,8 +145,8 @@ public class ProcessDeployer extends ProcessEngineBuilder {
}
private DeploymentBuilder getDeploymentBuilderProxy(final DeploymentBuilder builder) {
- return (DeploymentBuilder) Proxy.newProxyInstance(getClass().getClassLoader(), new Class< ? >[] { DeploymentBuilder.class }, new DeploymentBuilderInvoker(
- builder));
+ return (DeploymentBuilder) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class< ? >[] { DeploymentBuilder.class },
+ new DeploymentBuilderInvoker(builder));
}
/** | Use thread context classloader to build proxy in deployer | Activiti_Activiti | train | java |
7191c9de40becb272405a949c6c8211e18be3daf | diff --git a/src/MabeEnum/Enum.php b/src/MabeEnum/Enum.php
index <HASH>..<HASH> 100644
--- a/src/MabeEnum/Enum.php
+++ b/src/MabeEnum/Enum.php
@@ -53,13 +53,13 @@ abstract class Enum
}
/**
- * Get the selected value
+ * Get the current selected constant name
* @return string
- * @see getValue()
+ * @see getName()
*/
- final public function __toString()
+ public function __toString()
{
- return (string) $this->value;
+ return $this->getName();
}
/**
diff --git a/tests/MabeEnumTest/EnumTest.php b/tests/MabeEnumTest/EnumTest.php
index <HASH>..<HASH> 100644
--- a/tests/MabeEnumTest/EnumTest.php
+++ b/tests/MabeEnumTest/EnumTest.php
@@ -23,10 +23,10 @@ class EnumTest extends TestCase
$this->assertSame('ONE', $enum->getName());
}
- public function testToStringMagicMethodReturnsValueAsString()
+ public function testToStringMagicMethodReturnsName()
{
$enum = EnumWithoutDefaultValue::get(EnumWithoutDefaultValue::ONE);
- $this->assertSame('1', $enum->__toString());
+ $this->assertSame('ONE', $enum->__toString());
}
public function testEnumInheritance() | fixes #<I>: __toString() shouldn't be final and return the name (like in Java) | marc-mabe_php-enum | train | php,php |
02b57d0fff1fbcc7f7ead23023ccb9662a5fc62c | diff --git a/mutagen/flac.py b/mutagen/flac.py
index <HASH>..<HASH> 100644
--- a/mutagen/flac.py
+++ b/mutagen/flac.py
@@ -488,7 +488,15 @@ class Padding(MetadataBlock):
return "<%s (%d bytes)>" % (type(self).__name__, self.length)
class FLAC(FileType):
- """A FLAC audio file."""
+ """A FLAC audio file.
+
+ Attributes:
+ info -- stream information (length, bitrate, sample rate)
+ tags -- metadata tags, if any
+ cuesheet -- CueSheet object, if any
+ seektable -- SeekTable object, if any
+ pictures -- list of embedded pictures
+ """
METADATA_BLOCKS = [StreamInfo, Padding, None, SeekTable, VCFLACDict,
CueSheet, Picture]
@@ -568,9 +576,11 @@ class FLAC(FileType):
info = property(lambda s: s.metadata_blocks[0])
def add_picture(self, picture):
+ """Add a new picture to the file."""
self.metadata_blocks.append(picture)
def clear_pictures(self):
+ """Delete all pictures from the file."""
self.metadata_blocks = filter(lambda b: b.code != Picture.code,
self.metadata_blocks) | FLAC: A little more documentation. | quodlibet_mutagen | train | py |
79f1df5dda7de6645d774d905f0130182cf52ea1 | diff --git a/eventsourcing/tests/test_archived_log.py b/eventsourcing/tests/test_archived_log.py
index <HASH>..<HASH> 100644
--- a/eventsourcing/tests/test_archived_log.py
+++ b/eventsourcing/tests/test_archived_log.py
@@ -9,6 +9,16 @@ from eventsourcing.tests.unit_test_cases_python_objects import PythonObjectsTest
from eventsourcing.tests.unit_test_cases_sqlalchemy import SQLAlchemyTestCase
+# Todo: Perhaps make an archiver that counts pages, and write messages into a log entity
+# Todo: that will fill up and then be snapshotted - so that there isn't a single entity
+# Todo: receiving all the events, which might fill up Cassandra's partition. Instead if
+# Todo: the archiver has one event per archived log, and the archived log has one event
+# Todo: per logged message, then the upper limit would be the square of the partition capacity.
+# Todo: How to manage contention when counting pages rather than events?
+# Todo: Alternatively, can the start of the archiver be deleted, since all items are in archived log?
+#
+
+
class ArchivedLogTestCase(AbstractTestCase):
@property
def stored_event_repo(self): | Added some notes about archived log. | johnbywater_eventsourcing | train | py |
c742193167740f9481c723fb936689117280a183 | diff --git a/src/server/pfs/cmds/cmds.go b/src/server/pfs/cmds/cmds.go
index <HASH>..<HASH> 100644
--- a/src/server/pfs/cmds/cmds.go
+++ b/src/server/pfs/cmds/cmds.go
@@ -938,7 +938,7 @@ $ {{alias}} foo@master^:XXX
# in repo "foo"
$ {{alias}} foo@master^2:XXX
-# get file test[].txt on branch "master" in repo "foo"
+# get file "test[].txt" on branch "master" in repo "foo"
# the path is interpreted as a glob pattern: quote and protect regex characters
$ {{alias}} 'foo@master:/test\[\].txt'`,
Run: cmdutil.RunFixedArgs(1, func(args []string) error {
@@ -1039,7 +1039,7 @@ $ {{alias}} foo@master --history n
# list all versions of top-level files on branch "master" in repo "foo"
$ {{alias}} foo@master --history all
-# list file under directory dir[1] on branch "master" in repo "foo"
+# list file under directory "dir[1]" on branch "master" in repo "foo"
# the path is interpreted as a glob pattern: quote and protect regex characters
$ {{alias}} 'foo@master:dir\[1\]'`,
Run: cmdutil.RunFixedArgs(1, func(args []string) error { | Added "" around file name and dir in get file/list file example | pachyderm_pachyderm | train | go |
c59dbc22d02d6478413cc39e6f5194d2429928dd | diff --git a/lib/_copy.js b/lib/_copy.js
index <HASH>..<HASH> 100644
--- a/lib/_copy.js
+++ b/lib/_copy.js
@@ -11,18 +11,18 @@ function ncp (source, dest, options, callback) {
options = {}
}
- var basePath = process.cwd(),
- currentPath = path.resolve(basePath, source),
- targetPath = path.resolve(basePath, dest),
- filter = options.filter,
- transform = options.transform,
- clobber = options.clobber !== false,
- dereference = options.dereference,
- errs = null,
- started = 0,
- finished = 0,
- running = 0,
- limit = options.limit || ncp.limit || 16
+ var basePath = process.cwd()
+ var currentPath = path.resolve(basePath, source)
+ var targetPath = path.resolve(basePath, dest)
+ var filter = options.filter
+ var transform = options.transform
+ var clobber = options.clobber !== false
+ var dereference = options.dereference
+ var errs = null
+ var started = 0
+ var finished = 0
+ var running = 0
+ var limit = options.limit || ncp.limit || 16
limit = (limit < 1) ? 1 : (limit > 512) ? 512 : limit | lib/_copy: changed var decl style | jprichardson_node-fs-extra | train | js |
4d81e69680a7f027a70e7c20acb8cc8a1d150662 | diff --git a/lib/webmock/request_pattern.rb b/lib/webmock/request_pattern.rb
index <HASH>..<HASH> 100644
--- a/lib/webmock/request_pattern.rb
+++ b/lib/webmock/request_pattern.rb
@@ -181,7 +181,12 @@ module WebMock
private
def matches_with_variations?(uri)
- normalized_template = Addressable::Template.new(WebMock::Util::URI.heuristic_parse(@pattern.pattern))
+ normalized_template =
+ if uri.is_a?(Addressable::URI)
+ Addressable::Template.new(uri)
+ else
+ Addressable::Template.new(WebMock::Util::URI.heuristic_parse(@pattern.pattern))
+ end
WebMock::Util::URI.variations_of_uri_as_strings(uri).any? { |u| normalized_template.match(u) }
end | Avoid re-evaluating URIs
This allows using Addressable::Template directly and not crash when a
template is used for the URI host part | bblimke_webmock | train | rb |
d1990a58225bad07b42b825f0068ddcd4ac5abac | diff --git a/salt/modules/boto3_sns.py b/salt/modules/boto3_sns.py
index <HASH>..<HASH> 100644
--- a/salt/modules/boto3_sns.py
+++ b/salt/modules/boto3_sns.py
@@ -45,21 +45,25 @@ Connection module for Amazon SNS
from __future__ import absolute_import
import logging
-import jmespath
log = logging.getLogger(__name__)
# Import third party libs
+#pylint: disable=unused-import
try:
- #pylint: disable=unused-import
import botocore
import boto3
- #pylint: enable=unused-import
logging.getLogger('boto3').setLevel(logging.CRITICAL)
HAS_BOTO = True
except ImportError:
HAS_BOTO = False
+try:
+ import jmespath
+ HAS_JMESPATH = True
+except ImportError:
+ HAS_JMESPATH = False
+#pylint: enable=unused-import
def __virtual__():
'''
@@ -67,6 +71,8 @@ def __virtual__():
'''
if not HAS_BOTO:
return (False, 'The boto3_sns module could not be loaded: boto3 libraries not found')
+ if not HAS_JMESPATH:
+ return (False, 'The boto3_sns module could not be loaded: jmespath module not found')
__utils__['boto3.assign_funcs'](__name__, 'sns')
return True | Fix ImportError in boto3_sns module
This module attempts to import jmespath which is not a dependency and is
not in the stdlib. This commit gates this behind a try/except to
prevent an ImportError from being logged. | saltstack_salt | train | py |
adcd62535b06496b11b6cc648b75114fb1a6349d | diff --git a/openid/consumer/consumer.py b/openid/consumer/consumer.py
index <HASH>..<HASH> 100644
--- a/openid/consumer/consumer.py
+++ b/openid/consumer/consumer.py
@@ -17,9 +17,8 @@ OVERVIEW
1. The user enters their OpenID into a field on the consumer's
site, and hits a login button.
- 2. The consumer site checks that the entered URL describes an
- OpenID page by fetching it and looking for appropriate link
- tags in the head section.
+ 2. The consumer site discovers the user's OpenID server using
+ the YADIS protocol.
3. The consumer site sends the browser a redirect to the
identity server. This is the authentication request as | [project @ Update docs to describe how yadis is used] | openid_python-openid | train | py |
703ebef5d452fab2da57d8c6e02ec02ff1c28e42 | diff --git a/lib/entry.js b/lib/entry.js
index <HASH>..<HASH> 100644
--- a/lib/entry.js
+++ b/lib/entry.js
@@ -360,7 +360,7 @@ function getName() {
function getParams(index) {
if (this._params === undefined) {
var match,
- re = /@param\s+\{\(?([^})]+)\)?\}\s+(\[.+\]|[\w]+(?:\[.+\])?)\s+([\s\S]*?)(?=\@|\*\/)/gim,
+ re = /@param\s+\{\(?([^}]+?)\)?\}\s+(\[.+\]|[\w]+(?:\[.+\])?)\s+([\s\S]*?)(?=\@|\*\/)/gim,
result = [];
while (match = re.exec(this.entry)) { | Ensure params works with nested parentheses. [closes #<I>] | jdalton_docdown | train | js |
e804fd2c999beb7e9e8c245cb6adc877d585f1df | diff --git a/spec/api_mock_spec.rb b/spec/api_mock_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/api_mock_spec.rb
+++ b/spec/api_mock_spec.rb
@@ -6,26 +6,26 @@ describe APIMock do
it 'stores the used method' do
Discordrb::API.raw_request(:get, [])
- Discordrb::API.last_method.should == :get
+ expect(Discordrb::API.last_method).to eq :get
end
it 'stores the used URL' do
url = 'https://example.com/test'
Discordrb::API.raw_request(:get, [url])
- Discordrb::API.last_url.should == url
+ expect(Discordrb::API.last_url).to eq url
end
it 'parses the stored body using JSON' do
body = { test: 1 }
Discordrb::API.raw_request(:post, ['https://example.com/test', body.to_json])
- Discordrb::API.last_body['test'].should == 1
+ expect(Discordrb::API.last_body['test']).to eq 1
end
it "doesn't parse the body if there is none present" do
Discordrb::API.raw_request(:post, ['https://example.com/test', nil])
- Discordrb::API.last_body.should be_nil
+ expect(Discordrb::API.last_body).to be_nil
end
end | Use expect syntax for api_mock_spec | meew0_discordrb | train | rb |
dafb262d1ad80a0112fb091fb4813e2688013ffc | diff --git a/app/selectors/editor.js b/app/selectors/editor.js
index <HASH>..<HASH> 100644
--- a/app/selectors/editor.js
+++ b/app/selectors/editor.js
@@ -48,8 +48,13 @@ export const isNodeSelected = (selection, id) => isSelected(selection, ENTITY.NO
export const isLinkSelected = (selection, id) => isSelected(selection, ENTITY.LINK, id);
export const hasSelection = (state) => (
- state.editor.selection.length > 0 ||
- state.editor.linkingPin !== null
+ (
+ state.editor.selection &&
+ state.editor.selection.length > 0
+ ) || (
+ state.editor.linkingPin &&
+ state.editor.linkingPin !== null
+ )
);
export const getLinkingPin = (state) => R.pipe( | fix(selector): add additional checks into selector hasSelection to make sure that editor has props we want to read | xodio_xod | train | js |
9dc01f0aba8040e2a801dba1d159a4be8718238e | diff --git a/closure/goog/structs/pool.js b/closure/goog/structs/pool.js
index <HASH>..<HASH> 100644
--- a/closure/goog/structs/pool.js
+++ b/closure/goog/structs/pool.js
@@ -159,7 +159,7 @@ goog.structs.Pool.prototype.setDelay = function(delay) {
*/
goog.structs.Pool.prototype.getObject = function() {
'use strict';
- var time = goog.now();
+ var time = Date.now();
if (this.lastAccess != null && time - this.lastAccess < this.delay) {
return undefined;
}
diff --git a/closure/goog/structs/prioritypool.js b/closure/goog/structs/prioritypool.js
index <HASH>..<HASH> 100644
--- a/closure/goog/structs/prioritypool.js
+++ b/closure/goog/structs/prioritypool.js
@@ -71,7 +71,7 @@ goog.structs.PriorityPool.prototype.setDelay = function(delay) {
goog.global.clearTimeout(this.delayTimeout_);
this.delayTimeout_ = goog.global.setTimeout(
goog.bind(this.handleQueueRequests_, this),
- this.delay + this.lastAccess - goog.now());
+ this.delay + this.lastAccess - Date.now());
// Handle all requests.
this.handleQueueRequests_(); | Replace goog.now with Date.now.
RELNOTES: n/a
PiperOrigin-RevId: <I> | google_closure-library | train | js,js |
e8bcd7b2255c62144e89bda71f4d46a315969563 | diff --git a/src/org/opencms/jsp/util/CmsJspNavigationBean.java b/src/org/opencms/jsp/util/CmsJspNavigationBean.java
index <HASH>..<HASH> 100644
--- a/src/org/opencms/jsp/util/CmsJspNavigationBean.java
+++ b/src/org/opencms/jsp/util/CmsJspNavigationBean.java
@@ -278,9 +278,9 @@ public class CmsJspNavigationBean {
} else {
if (m_startLevel == Integer.MIN_VALUE) {
// no start level
- m_items = m_builder.getNavigationBreadCrumb();
+ m_items = m_builder.getNavigationBreadCrumb();
} else {
- if (m_endLevel == Integer.MIN_VALUE) {
+ if (m_endLevel != Integer.MIN_VALUE) {
m_items = m_builder.getNavigationBreadCrumb(m_startLevel, m_endLevel);
} else {
m_items = m_builder.getNavigationBreadCrumb( | Fix: bad condition in line <I>: if (m_endLevel == Integer.MIN_VALUE). Must be if (m_endLevel != Integer.MIN_VALUE) because m_endLevel is used as parameter: m_items = m_builder.getNavigationBreadCrumb(m_startLevel, m_endLevel); | alkacon_opencms-core | train | java |
9dd447f7696154e6400dd7b17f7cf52235c9eb14 | diff --git a/nodeconductor/core/handlers.py b/nodeconductor/core/handlers.py
index <HASH>..<HASH> 100644
--- a/nodeconductor/core/handlers.py
+++ b/nodeconductor/core/handlers.py
@@ -116,6 +116,6 @@ def log_ssh_key_delete(sender, instance, **kwargs):
def log_token_create(sender, instance, **kwargs):
event_logger.token.info(
- 'Token has been update for {affected_user_username}',
+ 'Token has been updated for {affected_user_username}',
event_type='token_created',
event_context={'affected_user': instance.user})
diff --git a/nodeconductor/core/log.py b/nodeconductor/core/log.py
index <HASH>..<HASH> 100644
--- a/nodeconductor/core/log.py
+++ b/nodeconductor/core/log.py
@@ -37,7 +37,7 @@ class TokenEventLogger(EventLogger):
affected_user = User
class Meta:
- event_types = ('token_created')
+ event_types = ('token_created',)
class SshPublicKeyEventLogger(EventLogger): | Update typos [WAL-<I>] | opennode_waldur-core | train | py,py |
38f2a47c0d949be31f842e23c3e1ba80caabc6a2 | diff --git a/lib/rbBinaryCFPropertyList.rb b/lib/rbBinaryCFPropertyList.rb
index <HASH>..<HASH> 100644
--- a/lib/rbBinaryCFPropertyList.rb
+++ b/lib/rbBinaryCFPropertyList.rb
@@ -413,11 +413,21 @@ module CFPropertyList
def count_object_refs(object)
case object
when CFArray
- return object.value.inject(0) { |sum, element| sum + count_object_refs(element) } + object.value.size
+ contained_refs = 0
+ object.value.each do |element|
+ if CFArray === element || CFDictionary === element
+ contained_refs += count_object_refs(element)
+ end
+ end
+ return object.value.size + contained_refs
when CFDictionary
- count = 0
- object.value.each_value { |value| count += count_object_refs(value) }
- return count + object.value.keys.size * 2
+ contained_refs = 0
+ object.value.each_value do |value|
+ if CFArray === value || CFDictionary === value
+ contained_refs += count_object_refs(value)
+ end
+ end
+ return object.value.keys.size * 2 + contained_refs
else
return 0
end | Avoid recursion by checking the type before the call.
This helps performance a little bit more by not taking the method call
overhead when it isn't needed. | ckruse_CFPropertyList | train | rb |
0ac8d91fb68d713c06269d3e17b26b862a2fcde1 | diff --git a/components/doc/keyfilter/index.js b/components/doc/keyfilter/index.js
index <HASH>..<HASH> 100644
--- a/components/doc/keyfilter/index.js
+++ b/components/doc/keyfilter/index.js
@@ -1,4 +1,5 @@
import React, { memo } from 'react';
+import Link from 'next/link';
import { TabView, TabPanel } from '../../lib/tabview/TabView';
import { useLiveEditorTabs } from '../common/liveeditor';
import { CodeHighlight } from '../common/codehighlight';
@@ -265,6 +266,9 @@ import { InputText } from 'primereact/inputtext';
`}
</CodeHighlight>
+ <h5>Accessibility</h5>
+ <p>Refer to <Link href="/inputtext">InputText</Link> for accessibility as KeyFilter is a built-in add-on of the InputText.</p>
+
<h5>Dependencies</h5>
<p>None.</p>
</TabPanel> | a<I>y for KeyFilter | primefaces_primereact | train | js |
667f71f95b24cf30bd3108a8cbc7898a15eca2f6 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,7 @@ from setuptools import setup
setup(
name='Flask-Assistant',
- version='0.2.92',
+ version='0.2.93',
url='https://github.com/treethought/flask-assistant',
license='Apache 2.0',
author='Cam Sweeney', | version bump <I> - bdist_wheel and setup.py test | treethought_flask-assistant | train | py |
16348ab2c7a58751cf33df363f1408ec86578a5c | diff --git a/liquibase-core/src/main/java/liquibase/database/core/PostgresDatabase.java b/liquibase-core/src/main/java/liquibase/database/core/PostgresDatabase.java
index <HASH>..<HASH> 100644
--- a/liquibase-core/src/main/java/liquibase/database/core/PostgresDatabase.java
+++ b/liquibase-core/src/main/java/liquibase/database/core/PostgresDatabase.java
@@ -11,6 +11,7 @@ import liquibase.executor.ExecutorService;
import liquibase.logging.LogFactory;
import liquibase.statement.core.RawCallStatement;
import liquibase.statement.core.RawSqlStatement;
+import liquibase.structure.core.Index;
import liquibase.structure.core.Table;
import liquibase.util.StringUtils;
@@ -167,6 +168,15 @@ public class PostgresDatabase extends AbstractJdbcDatabase {
}
@Override
+ public String escapeObjectName(String catalogName, String schemaName, String objectName, Class<? extends DatabaseObject> objectType) {
+ if (Index.class.isAssignableFrom(objectType)) {
+ return escapeObjectName(objectName, objectType);
+ }
+
+ return super.escapeObjectName(catalogName, schemaName, objectName, objectType);
+ }
+
+ @Override
public String correctObjectName(String objectName, Class<? extends DatabaseObject> objectType) {
if (objectName == null || quotingStrategy != ObjectQuotingStrategy.LEGACY) {
return super.correctObjectName(objectName, objectType); | CORE-<I> Postgres index names cannot include schema name | liquibase_liquibase | train | java |
a35341448f314edfe83187e6403c6401e979bf63 | diff --git a/xl-v1-object.go b/xl-v1-object.go
index <HASH>..<HASH> 100644
--- a/xl-v1-object.go
+++ b/xl-v1-object.go
@@ -153,6 +153,8 @@ func (xl xlObjects) GetObject(bucket, object string, startOffset int64, length i
// Start reading the part name.
n, err := erasureReadFile(mw, onlineDisks, bucket, pathJoin(object, partName), partName, eInfos, partOffset, readSize, partSize)
if err != nil {
+ // Purge the partial object upon any error.
+ xl.objCache.Delete(path.Join(bucket, object))
return err
} | XL: Cache: Purging partially cached content upon erasureReadFile failure (#<I>) | minio_minio | train | go |
ab9e852b08911d22b2e1a9d0337b66e752eb47ca | diff --git a/udata/core/metrics/tasks.py b/udata/core/metrics/tasks.py
index <HASH>..<HASH> 100644
--- a/udata/core/metrics/tasks.py
+++ b/udata/core/metrics/tasks.py
@@ -16,7 +16,6 @@ log = logging.getLogger(__name__)
@metric_need_update.connect
def update_on_demand(metric):
- print('update on demand', metric, metric.target)
update_metric.delay(metric) | Remove print statement (#<I>) | opendatateam_udata | train | py |
91d29d5f7e9f23af4852fa5c43264703058ca54a | diff --git a/example/main.js b/example/main.js
index <HASH>..<HASH> 100644
--- a/example/main.js
+++ b/example/main.js
@@ -68,5 +68,5 @@ app.once('ready', function() {
],
},
]);
- Menu.setApplicationMenu(menu);
+ app.applicationMenu = menu;
}); | Use `applicationMenu` property of app to set the current menu | rhysd_electron-about-window | train | js |
005b893af8cd620801ca2dc75edc75605af6c858 | diff --git a/src/Cookie/PHPCookie.php b/src/Cookie/PHPCookie.php
index <HASH>..<HASH> 100755
--- a/src/Cookie/PHPCookie.php
+++ b/src/Cookie/PHPCookie.php
@@ -24,7 +24,7 @@ class PHPCookie implements CookieInterface
* Path where the cookie is valid
* @var string
*/
- protected $path = "";
+ protected $path = "/";
/**
* Cookie domain
@@ -42,7 +42,7 @@ class PHPCookie implements CookieInterface
*/
protected $httpOnly = true;
- function __construct($name="PHP_REMEMBERME", $expireTime=604800, $path="", $domain="", $secure=false, $httpOnly=true)
+ function __construct($name="PHP_REMEMBERME", $expireTime=604800, $path="/", $domain="", $secure=false, $httpOnly=true)
{
$this->name = $name;
$this->expireTime = $expireTime; | Change Cookie path default to "/"
This is a more sane default for sites that use login paths like "/login"
where the previous, empty value would lead to a cookie that is only
valid for the "/login" path and not for the rest of the site. | gbirke_rememberme | train | php |
dbab2210be277c9526ec7c4c33e6a6bb474103a2 | diff --git a/src/ruby_supportlib/phusion_passenger/platform_info/openssl.rb b/src/ruby_supportlib/phusion_passenger/platform_info/openssl.rb
index <HASH>..<HASH> 100644
--- a/src/ruby_supportlib/phusion_passenger/platform_info/openssl.rb
+++ b/src/ruby_supportlib/phusion_passenger/platform_info/openssl.rb
@@ -57,7 +57,7 @@ module PhusionPassenger
elsif File.exist?("/usr/local/opt/openssl/include")
"-L/usr/local/opt/openssl/lib"
elsif File.exist?("/opt/homebrew/opt/openssl/include")
- "-L/opt/homebrew/opt/openssl/include"
+ "-L/opt/homebrew/opt/openssl/lib"
else
"-L/opt/local/lib"
end | Fixed openssl_extra_ldflags path for macos withapple silicon | phusion_passenger | train | rb |
c11e4648ee19ce0ac7b01573a86fe65e72f624f0 | diff --git a/skale.js b/skale.js
index <HASH>..<HASH> 100755
--- a/skale.js
+++ b/skale.js
@@ -65,6 +65,7 @@ var config = loadConfig(argv);
var proto = config.ssl ? require('https') : require('http');
var memory = argv.m || argv.memory || 4000;
var worker = argv.w || argv.worker || 2;
+var rc = netrc();
switch (argv._[0]) {
case 'create':
@@ -207,7 +208,6 @@ function deploy(args) {
var login = a[a.length - 2];
var host = a[2].replace(/:.*/, '');
var passwd = res.token;
- var rc = {};
rc[host] = {login: login, password: passwd};
netrc.save(rc);
child_process.execSync('git remote add skale ' + res.url); | do not overwrite (and lose contents) of ~/.netrc | skale-me_skale | train | js |
e47fd1f7133c861686569fe9d4f7123024424ff5 | diff --git a/src/server/pachyderm_test.go b/src/server/pachyderm_test.go
index <HASH>..<HASH> 100644
--- a/src/server/pachyderm_test.go
+++ b/src/server/pachyderm_test.go
@@ -3667,11 +3667,16 @@ func TestPipelineWithStats(t *testing.T) {
require.NoError(t, err)
require.Equal(t, 1, len(jobs))
- // Block on the job being complete before we call ListDatum
+ datums, err := c.ListDatum(jobs[0].Job.ID)
+ require.NoError(t, err)
+ require.Equal(t, numFiles, len(datums))
+
+ // Block on the job being complete before we call ListDatum again so we're
+ // sure the datums have actually been processed.
_, err = c.InspectJob(jobs[0].Job.ID, true)
require.NoError(t, err)
- datums, err := c.ListDatum(jobs[0].Job.ID)
+ datums, err = c.ListDatum(jobs[0].Job.ID)
require.NoError(t, err)
require.Equal(t, numFiles, len(datums)) | Adds a test for listing datums before job finishes | pachyderm_pachyderm | train | go |
91b0b69dd7391c4ccd7fa80ad13636d25a2e2ab0 | diff --git a/cli/Valet/Site.php b/cli/Valet/Site.php
index <HASH>..<HASH> 100644
--- a/cli/Valet/Site.php
+++ b/cli/Valet/Site.php
@@ -371,6 +371,7 @@ class Site
$this->files->unlink($this->certificatesPath().'/'.$url.'.crt');
$this->cli->run(sprintf('sudo security delete-certificate -c "%s" /Library/Keychains/System.keychain -t', $url));
+ $this->cli->run(sprintf('sudo security delete-certificate -c "*.%s" /Library/Keychains/System.keychain -t', $url));
}
} | when unsecuring try deleting also old wildcard | laravel_valet | train | php |
2a90c04744ffc32816b783e37a829640256e066a | diff --git a/addon/components/flexberry-file.js b/addon/components/flexberry-file.js
index <HASH>..<HASH> 100644
--- a/addon/components/flexberry-file.js
+++ b/addon/components/flexberry-file.js
@@ -258,7 +258,7 @@ export default FlexberryBaseComponent.extend({
*
* @property placeholder
* @type String
- * default t('flexberry-file.placeholder')
+ * @default t('flexberry-file.placeholder')
*/
placeholder: t('flexberry-file.placeholder'), | Fix by code review
pull request #<I> | Flexberry_ember-flexberry | train | js |
9f7affe3e44459716f6cfa2d2e555c8cdc09122b | diff --git a/cheroot/workers/threadpool.py b/cheroot/workers/threadpool.py
index <HASH>..<HASH> 100644
--- a/cheroot/workers/threadpool.py
+++ b/cheroot/workers/threadpool.py
@@ -108,13 +108,14 @@ class WorkerThread(threading.Thread):
return
self.conn = conn
- if self.server.stats['Enabled']:
+ is_stats_enabled = self.server.stats['Enabled']
+ if is_stats_enabled:
self.start_time = time.time()
try:
conn.communicate()
finally:
conn.close()
- if self.server.stats['Enabled']:
+ if is_stats_enabled:
self.requests_seen += self.conn.requests_seen
self.bytes_read += self.conn.rfile.bytes_read
self.bytes_written += self.conn.wfile.bytes_written | Prevent race condition in connection processing
Fixes #<I> | cherrypy_cheroot | train | py |
eb1ca0c2e6e11ac47037e35d1534a23b0c2f5e90 | diff --git a/socialregistration/utils.py b/socialregistration/utils.py
index <HASH>..<HASH> 100644
--- a/socialregistration/utils.py
+++ b/socialregistration/utils.py
@@ -207,15 +207,14 @@ class OAuthClient(object):
sign the request to obtain the access token
"""
if self.request_token is None:
+ body = None
if self.callback_url is not None:
- params = urllib.urlencode([
- ('oauth_callback', 'http://%s%s' % (Site.objects.get_current(),
- reverse(self.callback_url))),
+ body = urllib.urlencode([
+ ('oauth_callback', 'http://%s%s' % (
+ Site.objects.get_current(), reverse(self.callback_url)))
])
- request_token_url = '%s?%s' % (self.request_token_url, params)
- else:
- request_token_url = self.request_token_url
- response, content = self.client.request(request_token_url, "GET")
+ response, content = self.client.request(self.request_token_url,
+ "POST", body=body)
if response['status'] != '200':
raise OAuthError(
_('Invalid response while obtaining request token from "%s".') % get_token_prefix(self.request_token_url)) | changed getting request token method to POST | flashingpumpkin_django-socialregistration | train | py |
Subsets and Splits