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
|
---|---|---|---|---|---|
bdba54873a2ce5f8c5b78a77ff4e2d0f8f11fe4a | diff --git a/holidays/countries/singapore.py b/holidays/countries/singapore.py
index <HASH>..<HASH> 100644
--- a/holidays/countries/singapore.py
+++ b/holidays/countries/singapore.py
@@ -182,8 +182,8 @@ class Singapore(HolidayBase):
storeholiday(self, date(year, DEC, 26), "Boxing Day")
# Polling Day
- dates_obs = {2001: (NOV, 3), 2006: (MAY, 6),
- 2011: (MAY, 7), 2015: (SEP, 11)}
+ dates_obs = {2001: (NOV, 3), 2006: (MAY, 6), 2011: (MAY, 7),
+ 2015: (SEP, 11), 2020: (JUL, 10)}
if year in dates_obs:
self[date(year, *dates_obs[year])] = "Polling Day" | Added Singapore <I> polling day (#<I>) | dr-prodigy_python-holidays | train | py |
c3ef9249f809bfcec8849cb5adc7505301698874 | diff --git a/src/Syrup/CoreBundle/DeploymentHandler/ScriptHandler.php b/src/Syrup/CoreBundle/DeploymentHandler/ScriptHandler.php
index <HASH>..<HASH> 100644
--- a/src/Syrup/CoreBundle/DeploymentHandler/ScriptHandler.php
+++ b/src/Syrup/CoreBundle/DeploymentHandler/ScriptHandler.php
@@ -56,6 +56,11 @@ s - skip <info>(keep current file)</info>
},
3,
"y");
+ } elseif (
+ file_exists("./{$filename}")
+ && $event->getIO()->askConfirmation("Use './{$filename}'? [<options=bold>y</options=bold>/n]", true)
+ ) {
+ $this->getFromIO($event->getIO(), $filename, "./{$filename}");
} else {
self::getFromS3($event->getIO(), $s3key, self::PARAMETERS_DIR . $filename, true);
} | feat: ScriptHandler will consider ./parameters.yml to support generator script | keboola_syrup | train | php |
a3b4f4c33aaf9c389a179001888554fb85d2cd84 | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -51,7 +51,7 @@ copyright = '2013, Taylor "Nekroze" Lawson'
# The short X.Y version.
version = '0.2'
# The full version, including alpha/beta/rc tags.
-release = '0.2.6'
+release = '0.2.7'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
from setuptools import setup, find_packages
-__version__ = '0.2.6'
+__version__ = '0.2.7'
__author__ = 'Taylor "Nekroze" Lawson'
__email__ = '[email protected]'
SOURCE = 'librarian' | Version bump to fix pypi issue | Nekroze_librarian | train | py,py |
a7865099d2fbb8960052cfb408b4cbe463b31774 | diff --git a/src/Capture.php b/src/Capture.php
index <HASH>..<HASH> 100644
--- a/src/Capture.php
+++ b/src/Capture.php
@@ -518,7 +518,7 @@ class Capture
*/
public function includeJs($script)
{
- if (is_a($script, Url::class)) {
+ if ($script instanceof Url) {
$this->includedJsScripts[] = $script;
} else {
$this->includedJsSnippets[] = $script;
diff --git a/src/Image/Types.php b/src/Image/Types.php
index <HASH>..<HASH> 100644
--- a/src/Image/Types.php
+++ b/src/Image/Types.php
@@ -9,8 +9,8 @@ use Screen\Image\Types\Type;
class Types
{
protected static $typesMap = array(
- Jpg::FORMAT => Jpg::class,
- Png::FORMAT => Png::class,
+ Jpg::FORMAT => 'Screen\Image\Types\Jpg',
+ Png::FORMAT => 'Screen\Image\Types\Png',
);
/** | Removed use of ::class not supported by PHP < <I> (#<I>)
You are completely correct, thanks for your submission!! | microweber_screen | train | php,php |
f9d495c3f936c51227ba07b2db1fe678732b03f6 | diff --git a/test/date_utils_test.js b/test/date_utils_test.js
index <HASH>..<HASH> 100644
--- a/test/date_utils_test.js
+++ b/test/date_utils_test.js
@@ -348,7 +348,7 @@ describe("date_utils", function() {
expect(isQuarterDisabled(day, { includeDates: [day] })).to.be.false;
});
- it("should be disabled if not in included dates", () => {
+ xit("should be disabled if not in included dates", () => {
const day = newDate();
const includeDates = [addDays(day, 40)];
expect(isQuarterDisabled(day, { includeDates })).to.be.true; | Disable broken test (#<I>) | Hacker0x01_react-datepicker | train | js |
dbcee3f59f67a53d78d327fec229066fdb024abe | diff --git a/emir/recipes/directimaging.py b/emir/recipes/directimaging.py
index <HASH>..<HASH> 100644
--- a/emir/recipes/directimaging.py
+++ b/emir/recipes/directimaging.py
@@ -222,8 +222,8 @@ class Recipe(RecipeBase):
# FIXME: this is candidate to be a non Image Product
Parameter('nonlinearity', [1.0, 0.0], 'Polynomial for non-linearity correction'),
Parameter('iterations', 4, 'Iterations of the recipe'),
- Parameter('sky_images', 5, 'Images used to estimate the background around current image'),
- Parameter('sky_images_sep_time', 10, 'Maximum separation time between sky images in minutes'),
+ Parameter('sky_images', 5, 'Images used to estimate the background before and after current image'),
+ Parameter('sky_images_sep_time', 10, 'Maximum separation time between consecutive sky images in minutes'),
Parameter('resultname', 'result.fits', 'Name of the output image'),
# Parameter('airmasskey', 'AIRMASS', 'Name of airmass header keyword'),
# Parameter('exposurekey', 'EXPOSED', 'Name of exposure header keyword'), | Updating description of some Parameters | guaix-ucm_pyemir | train | py |
790e8921e1c40454d01e9e8bfac4d2f408f1a99b | diff --git a/gbdxtools/ipe/util.py b/gbdxtools/ipe/util.py
index <HASH>..<HASH> 100644
--- a/gbdxtools/ipe/util.py
+++ b/gbdxtools/ipe/util.py
@@ -5,6 +5,7 @@ import datetime
import time
from functools import wraps
from collections import Sequence
+from itertools import izip
import numpy as np
from numpy.linalg import pinv
@@ -175,6 +176,10 @@ class RatPolyTransform(object):
return np.int32(np.sum(self._px_offscl_rev * np.vstack([np.ones(result.shape), result]), axis=0))
def fwd(self, x, y, z=None):
+ if isinstance(x, (Sequence, np.ndarray)):
+ if z is None:
+ z = [None]*len(x)
+ return np.transpose(np.asarray([self.fwd(x_i, y_i, z_i) for x_i, y_i, z_i in izip(x, y, z)]))
coord = np.asarray([x, y])
normed = np.sum(self._px_offscl * np.vstack([np.ones(coord.shape), coord]), axis=0)
coord = np.dot(self._A_rev, normed)[[2,1,3]] # likely unstable | supporting numpy style broadcasting in RatPolyTransform (for fwd) | DigitalGlobe_gbdxtools | train | py |
06978f4dac5533272861b75565899367ed5bd78e | diff --git a/CHANGELOG.md b/CHANGELOG.md
index <HASH>..<HASH> 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,6 @@
# rows' Log of Changes
-## Version `0.3.0`
+## Version `0.2.1`
**Released on: (under development)**
diff --git a/rows/__init__.py b/rows/__init__.py
index <HASH>..<HASH> 100644
--- a/rows/__init__.py
+++ b/rows/__init__.py
@@ -66,4 +66,4 @@ except ImportError:
pass
-__version__ = '0.3.0dev0'
+__version__ = '0.2.1dev0'
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -45,7 +45,7 @@ setup(name='rows',
description=('A common, beautiful interface to tabular data, '
'no matter the format'),
long_description=LONG_DESCRIPTION,
- version='0.3.0dev0',
+ version='0.2.1dev0',
author=u'Álvaro Justen',
author_email='[email protected]',
url='https://github.com/turicas/rows/', | Change next version to <I> | turicas_rows | train | md,py,py |
46b51a5d1c0094d9e2dd28552f0543506a795b2b | diff --git a/src/main/org/openscience/cdk/io/PDBReader.java b/src/main/org/openscience/cdk/io/PDBReader.java
index <HASH>..<HASH> 100644
--- a/src/main/org/openscience/cdk/io/PDBReader.java
+++ b/src/main/org/openscience/cdk/io/PDBReader.java
@@ -173,11 +173,13 @@ public class PDBReader extends DefaultChemObjectReader {
}
@TestMethod("testAccepts")
- public boolean accepts(Class classObject) {
+ public boolean accepts(Class<? extends IChemObject> classObject) {
Class[] interfaces = classObject.getInterfaces();
for (int i=0; i<interfaces.length; i++) {
if (IChemFile.class.equals(interfaces[i])) return true;
}
+ if (IChemFile.class.equals(classObject))
+ return true;
Class superClass = classObject.getSuperclass();
if (superClass != null) return this.accepts(superClass);
return false; | Typed the input class and added support for IChemFile.class input
Change-Id: Iabdb1ca<I>dc<I>c<I>ea7b<I>fa7d<I>de<I> | cdk_cdk | train | java |
8b4ea5ce8c9d7487bc33d916d9a5088c5c6ec89c | diff --git a/job/controller/src/main/java/org/talend/esb/job/controller/internal/RuntimeESBEndpointRegistry.java b/job/controller/src/main/java/org/talend/esb/job/controller/internal/RuntimeESBEndpointRegistry.java
index <HASH>..<HASH> 100644
--- a/job/controller/src/main/java/org/talend/esb/job/controller/internal/RuntimeESBEndpointRegistry.java
+++ b/job/controller/src/main/java/org/talend/esb/job/controller/internal/RuntimeESBEndpointRegistry.java
@@ -202,7 +202,7 @@ public class RuntimeESBEndpointRegistry implements ESBEndpointRegistry {
stsProperties,
authorizationRole,
props.get(ESBEndpointConstants.SECURITY_TOKEN),
- useCrypto ? cryptoProvider : null);
+ (useCrypto || useServiceRegistry) ? cryptoProvider : null);
return new RuntimeESBConsumer(
serviceName, portName, operationName, publishedEndpointUrl, | [job-controller] fixed client with SR & Encryption | Talend_tesb-rt-se | train | java |
2c6e0eb456bf1ded89330b6510a9ca8a32fb9ebd | diff --git a/lib/babosa/utf8/proxy.rb b/lib/babosa/utf8/proxy.rb
index <HASH>..<HASH> 100644
--- a/lib/babosa/utf8/proxy.rb
+++ b/lib/babosa/utf8/proxy.rb
@@ -62,16 +62,14 @@ module Babosa
raise NotImplementedError
end
- if String.public_instance_methods.include?(:scrub)
+ if ''.respond_to?(:scrub) && !defined?(Rubinius)
# Attempt to replace invalid UTF-8 bytes with valid ones. This method
# naively assumes if you have invalid UTF8 bytes, they are either Windows
# CP-1252 or ISO8859-1. In practice this isn't a bad assumption, but may not
# always work.
def tidy_bytes(string)
- string.scrub do |bytes|
- bytes.each_byte.map do |byte|
- tidy_byte(byte)
- end.flatten.compact.pack('C*').unpack('U*').pack('U*')
+ string.scrub do |bad|
+ tidy_byte(*bad.bytes).flatten.compact.pack('C*').unpack('U*').pack('U*')
end
end
else | Work around Rubinius's String#scrub implementation | norman_babosa | train | rb |
7f582c366565b40f78f1fc9471ba5262302fa576 | diff --git a/src/js/mstepper.js b/src/js/mstepper.js
index <HASH>..<HASH> 100644
--- a/src/js/mstepper.js
+++ b/src/js/mstepper.js
@@ -204,10 +204,10 @@ class MStepper {
// If showFeedbackPreloader is true (default=true), activates it
if (showFeedbackPreloader && !active.step.dataset.nopreloader) activateFeedback();
// Calls the feedbackFunction
- window[feedbackFunction](destroyFeedback, form, active.step);
+ window[feedbackFunction](destroyFeedback, form, active.step.querySelector('.step-content'));
// Returns to prevent the nextStep method from being called
return;
- } else if (validationFunction && !validationFunction(form, active.step)) {
+ } else if (validationFunction && !validationFunction(form, active.step.querySelector('.step-content'))) {
// There's a validation function and no feedback function
// The validation function was already called in the if statement and it retuerned false, so returns the calling of the wrongStep method
return wrongStep(); | When calling validationFunction or feedbackFunction, only the active step content div will be passed as argument instead of the whole active step | Kinark_Materialize-stepper | train | js |
4ebc60ee8784f0daecc2f94ce80c912829b0110e | diff --git a/arctic/arctic.py b/arctic/arctic.py
index <HASH>..<HASH> 100644
--- a/arctic/arctic.py
+++ b/arctic/arctic.py
@@ -144,12 +144,14 @@ class Arctic(object):
return self.__conn
def reset(self):
+ logger.debug("Arctic.reset()")
with self._lock:
if self.__conn is not None:
self.__conn.close()
self.__conn = None
for _, l in self._library_cache.items():
if hasattr(l, '_reset') and callable(l._reset):
+ logger.debug("Library reset() %s" % l)
l._reset() # the existence of _reset() is not guaranteed/enforced, it also triggers re-auth
def __str__(self):
@@ -447,6 +449,7 @@ class ArcticLibraryBinding(object):
authenticate(database, auth.user, auth.password)
def reset_auth(self):
+ logger.debug("reset_auth() %s" % self)
self._auth(self._db)
def get_name(self):
@@ -527,7 +530,7 @@ class ArcticLibraryBinding(object):
'.'.join([self.database_name, self.library]),
to_gigabytes(size),
to_gigabytes(self.quota)))
-
+
# Set-up a timer to prevent us for checking for a few writes.
# This will check every average half-life
self.quota_countdown = int(max(remaining_count // 2, 1)) | Add debug logging for authentication issues. | manahl_arctic | train | py |
d1bc83db3296c4f1d4b3555ecacd79b478f612f3 | diff --git a/broccoli/version.js b/broccoli/version.js
index <HASH>..<HASH> 100644
--- a/broccoli/version.js
+++ b/broccoli/version.js
@@ -25,9 +25,11 @@ module.exports.VERSION = (() => {
// * current "build type" or branch name (in CI this is generally not
// present, but it is very useful for local / testing builds)
// * the sha for the commit
- let packageVersion = pkg.version;
+ let packageVersion = pkg.version;
let sha = info.sha || '';
let suffix = process.env.BUILD_TYPE || info.branch;
+ // * remove illegal non-alphanumeric characters from branch name.
+ suffix = suffix && suffix.replace(/[^a-zA-Z\d\s-]/, '-');
let metadata = sha.slice(0, 8);
return `${packageVersion}${suffix ? '-' + suffix : ''}+${metadata}`; | [BUGFIX beta] prevent test error by converting illegal characters in branch name
null fix | emberjs_ember.js | train | js |
cc3fdb46de5a211eed2e445bfe1cb1073d82b208 | diff --git a/lib/application.js b/lib/application.js
index <HASH>..<HASH> 100644
--- a/lib/application.js
+++ b/lib/application.js
@@ -1108,7 +1108,7 @@ Application.prototype.url = function(path, secure) {
/**
Returns an HTTP Secure URL
- @method urlSecure
+ @method secureUrl
@param {string} path
@return {string}
*/
diff --git a/lib/protos.js b/lib/protos.js
index <HASH>..<HASH> 100644
--- a/lib/protos.js
+++ b/lib/protos.js
@@ -777,7 +777,7 @@ function startupMessage(options) {
app.log(util.format('%s Server running on %s', inflect.capitalize(protos.environment), app.baseUrl));
- if (app.secureServer) app.log(util.format('HTTPS server listening on port %s', protos.config.bootstrap.ssl.port));
+ if (app.secureServer) app.log(util.format('HTTPS Server listening on port %s', protos.config.bootstrap.ssl.port));
if (options.multiProcess) app.log(util.format('Running a cluster of %d workers', options.allCPUS)); | Minor type corrections
[ci skip] | derdesign_protos | train | js,js |
3400317037144a022a9ad0c9ed9c17aa5a34d087 | diff --git a/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/logger/internal/LogPersisterDelegate.java b/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/logger/internal/LogPersisterDelegate.java
index <HASH>..<HASH> 100644
--- a/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/logger/internal/LogPersisterDelegate.java
+++ b/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/logger/internal/LogPersisterDelegate.java
@@ -57,8 +57,8 @@ public class LogPersisterDelegate implements LogPersisterInterface {
}
@Override
- public void send(ResponseListener responseListener) {
- LogPersister.send(responseListener);
+ public void send(Object responseListener) {
+ LogPersister.send((ResponseListener)responseListener);
}
@Override | Change LogPersisterDelegate's send method to use Object instead of ResponseListener. | ibm-bluemix-mobile-services_bms-clientsdk-android-analytics | train | java |
886244a63b853dbd3d8a3ffd795e3ef138e8199f | diff --git a/app/models/lit/incomming_localization.rb b/app/models/lit/incomming_localization.rb
index <HASH>..<HASH> 100644
--- a/app/models/lit/incomming_localization.rb
+++ b/app/models/lit/incomming_localization.rb
@@ -26,6 +26,7 @@ module Lit
def accept
if localization.present?
localization.translated_value = translated_value
+ localization.is_changed = true
localization.save
else
unless locale.present?
@@ -41,14 +42,12 @@ module Lit
where(localization_key_id: self.localization_key.id).
where(locale_id: self.locale.id).
first_or_initialize
- if localization.present?
- localization.translated_value = translated_value
- else
- localization.default_value = translated_value
- end
+ localization.translated_value = translated_value
+ localization.is_changed = true
localization.save!
end
end
+ Lit.init.cache.update_cache localization.full_key, localization.get_value
destroy
end | Fix acceptance of incomming localizations | prograils_lit | train | rb |
6783ca4445be4483631adfe77e05bf98579e4f7f | diff --git a/lib/reviews.js b/lib/reviews.js
index <HASH>..<HASH> 100644
--- a/lib/reviews.js
+++ b/lib/reviews.js
@@ -62,7 +62,7 @@ const reviews = (opts) => new Promise((resolve) => {
if (opts.id) {
resolve(opts.id);
} else if (opts.appId) {
- app(opts).then((app) => resolve(app.id));
+ resolve(app(opts).then(app => app.id));
}
})
.then((id) => { | Fix review lookup promise chain
Fix the promise chain for review lookups that need to look up the app details first.
This allows error handling for cases where the app is not found or an error occurs with the lookup. | facundoolano_app-store-scraper | train | js |
435b7e0728e4b5e89cbc7b71de9488cad72d32b0 | diff --git a/gbrs/commands.py b/gbrs/commands.py
index <HASH>..<HASH> 100644
--- a/gbrs/commands.py
+++ b/gbrs/commands.py
@@ -35,7 +35,10 @@ def get_founder_info(caller='gbrs'):
def unit_vector(vector):
- return vector / np.linalg.norm(vector)
+ if sum(vector) > 1e-6:
+ return vector / np.linalg.norm(vector)
+ else:
+ return vector
def get_genotype_probability(aln_profile, aln_specificity, sigma=0.12): | A bug in unit_vector method was fixed. | churchill-lab_gbrs | train | py |
0455d1eab3b0a24e95dcb040ec6430d882c27976 | diff --git a/auto_ml/utils.py b/auto_ml/utils.py
index <HASH>..<HASH> 100644
--- a/auto_ml/utils.py
+++ b/auto_ml/utils.py
@@ -7,11 +7,6 @@ import math
import os
import random
-from keras.constraints import maxnorm
-from keras.layers import Dense, Dropout
-from keras.models import Sequential
-from keras.wrappers.scikit_learn import KerasRegressor, KerasClassifier
-
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.cluster import MiniBatchKMeans
# from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor, ExtraTreesRegressor, AdaBoostRegressor, GradientBoostingRegressor, GradientBoostingClassifier, ExtraTreesClassifier, AdaBoostClassifier
@@ -44,6 +39,17 @@ except ImportError:
if xgb_installed:
import xgboost as xgb
+keras_installed = False
+try:
+ from keras.constraints import maxnorm
+ from keras.layers import Dense, Dropout
+ from keras.models import Sequential
+ from keras.wrappers.scikit_learn import KerasRegressor, KerasClassifier
+ keras_installed = True
+
+except ImportError:
+ pass
+
# TODO: figure out later on how to wrap this inside another wrapper or something to make num_cols more dynamic
def make_deep_learning_model(hidden_layers=None, optimizer='adam', dropout_rate=0.2, weight_constraint=0, shape='standard'): | nests some keras imports behind a try/except block to handle them not being installed | ClimbsRocks_auto_ml | train | py |
0bceec0e550c0ff2ec7d6cbf2aa305b9ed3942d7 | diff --git a/quantecon/markov/__init__.py b/quantecon/markov/__init__.py
index <HASH>..<HASH> 100644
--- a/quantecon/markov/__init__.py
+++ b/quantecon/markov/__init__.py
@@ -2,5 +2,6 @@
Markov Chain SubPackge
"""
-from .core import MarkovChain, mc_compute_stationary, mc_sample_path
+from .core import MarkovChain
+from .core import mc_compute_stationary, mc_sample_path #-Future Deprecation-#
from .random import random_markov_chain, random_stochastic_matrix
\ No newline at end of file | Separate out items that may be eligible for deprecation, leaving them for now as used in examples | QuantEcon_QuantEcon.py | train | py |
8b658559bd7e3e6ca0adfbb0ba21ebeffc7456b2 | diff --git a/src/ReflectionTools.php b/src/ReflectionTools.php
index <HASH>..<HASH> 100644
--- a/src/ReflectionTools.php
+++ b/src/ReflectionTools.php
@@ -279,11 +279,7 @@ class ReflectionTools
$result .= '?';
}
- if ($parameter->isArray()) {
- $result .= 'array ';
- } elseif ($parameter->isCallable()) {
- $result .= 'callable ';
- } elseif (null !== $type = $parameter->getType()) {
+ if (null !== $type = $parameter->getType()) {
if (! $type->isBuiltin()) {
$result .= '\\';
} | Simplify exportFunctionParameters()
ReflectionParameter::getType() covers array and callable as well. This is a leftover from PHP 5. | brick_reflection | train | php |
c72bba10332116f119c057d7159c16aa76d7fc76 | diff --git a/Transfert/ExoImporter.php b/Transfert/ExoImporter.php
index <HASH>..<HASH> 100644
--- a/Transfert/ExoImporter.php
+++ b/Transfert/ExoImporter.php
@@ -80,8 +80,6 @@ class ExoImporter extends Importer implements ConfigurationInterface
{
//this is the root of the unzipped archive
$rootPath = $this->getRootPath();
- echo 'coucou je suis l\'importer exercice';die();
- //créer un zip par question
}
public function export(Workspace $workspace, array &$files, $object) | [ExoBundle] Delete the die | claroline_Distribution | train | php |
db0253a228b3253e23bb5190fba9930a2f313d66 | diff --git a/basictracer/context.py b/basictracer/context.py
index <HASH>..<HASH> 100644
--- a/basictracer/context.py
+++ b/basictracer/context.py
@@ -22,7 +22,7 @@ class SpanContext(opentracing.SpanContext):
@property
def baggage(self):
- return self._baggage or opentracing.SpanContext.EMPTY_BAGGAGE
+ return self._baggage
def with_baggage_item(self, key, value):
new_baggage = self._baggage.copy() | Remove superfluous check for None baggage | opentracing_basictracer-python | train | py |
4d36b0de3d4a49397519d51cae3e5d5be0638874 | diff --git a/lib/awsutils/awslogs.rb b/lib/awsutils/awslogs.rb
index <HASH>..<HASH> 100644
--- a/lib/awsutils/awslogs.rb
+++ b/lib/awsutils/awslogs.rb
@@ -161,7 +161,7 @@ module AwsUtils
collector =
response
.log_streams
- .select { |s| s.last_event_timestamp > max_age_ts }
+ .select { |s| s.last_event_timestamp && s.last_event_timestamp > max_age_ts }
.map(&:log_stream_name)
fail NoStreamsError if token.nil? && collector.count == 0
collector += streams(response.next_token) if response.next_token | awslogs: Ignore streams with no last event timestamp | evertrue_awsutils | train | rb |
8fb30852d03899667cd6facee939e5ed80121da2 | diff --git a/resources/ec2-subnets.go b/resources/ec2-subnets.go
index <HASH>..<HASH> 100644
--- a/resources/ec2-subnets.go
+++ b/resources/ec2-subnets.go
@@ -53,6 +53,7 @@ func (e *EC2Subnet) Properties() types.Properties {
for _, tagValue := range e.subnet.Tags {
properties.SetTag(tagValue.Key, tagValue.Value)
}
+ properties.Set("DefaultForAz", e.subnet.DefaultForAz)
return properties
} | Map the 'DefaultForAz' property for subnets, allowing for easy filtering of default subnets. | rebuy-de_aws-nuke | train | go |
a8460e5d4c08b4e1d9031b65335884aa497706f3 | diff --git a/src/packages/serializer/index.js b/src/packages/serializer/index.js
index <HASH>..<HASH> 100644
--- a/src/packages/serializer/index.js
+++ b/src/packages/serializer/index.js
@@ -407,13 +407,13 @@ class Serializer {
}
let serialized: {
- id: number,
+ id: string,
type: string,
links?: Object,
attributes: Object,
relationships?: Object
} = {
- id,
+ id: id.toString(),
type,
attributes
};
@@ -519,7 +519,7 @@ class Serializer {
return {
data: {
- id,
+ id: id.toString(),
type
},
diff --git a/test/integration/serializer.js b/test/integration/serializer.js
index <HASH>..<HASH> 100644
--- a/test/integration/serializer.js
+++ b/test/integration/serializer.js
@@ -19,7 +19,7 @@ describe('Integration: class Serializer', () => {
it('serializes id', () => {
const { data: { id } } = subject;
- expect(id).to.equal(1);
+ expect(id).to.equal('1');
});
it('serializes attributes', () => { | fix: resource IDs must be strings (#<I>)
* errors is a top level member
* Resource ID must be a string | postlight_lux | train | js,js |
4b8bd27d79e1d98b2e1631f0493b6df6ff87e0d8 | diff --git a/micro-error-codes/src/main/java/com/aol/micro/server/errors/ErrorCode.java b/micro-error-codes/src/main/java/com/aol/micro/server/errors/ErrorCode.java
index <HASH>..<HASH> 100644
--- a/micro-error-codes/src/main/java/com/aol/micro/server/errors/ErrorCode.java
+++ b/micro-error-codes/src/main/java/com/aol/micro/server/errors/ErrorCode.java
@@ -2,6 +2,7 @@ package com.aol.micro.server.errors;
import java.text.MessageFormat;
+import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
@Getter
@@ -36,7 +37,9 @@ public class ErrorCode {
errorId, message, Severity.CRITICAL);
}
- private ErrorCode(final int errorId, final String message, final Severity severity) {
+ private ErrorCode(@JsonProperty("errorId") final int errorId,
+ @JsonProperty("message") final String message,
+ @JsonProperty("severity") final Severity severity) {
this.errorId = errorId;
this.message = message; | Add JsonProperty annotations to ErrorCode constructor.
The ErrorCode class cannot be deserialised from a JSON response currently as
it has no default constructor, and simply adding a default constructor
wouldn't work with the final fields. Add the @JsonProperty annotation to the
actual constructor so that Jackson can create instances of this.
This is needed for consumers of endpoints returning instances of HealthStatus
as HealthStatus contains an ErrorCode field. | aol_micro-server | train | java |
1851f9c91e412ec92bf80d62de37d079509f0852 | diff --git a/codespell_lib/tests/test_dictionary.py b/codespell_lib/tests/test_dictionary.py
index <HASH>..<HASH> 100644
--- a/codespell_lib/tests/test_dictionary.py
+++ b/codespell_lib/tests/test_dictionary.py
@@ -79,12 +79,11 @@ def _check_aspell(phrase, msg, in_aspell, fname, languages):
this_in_aspell = any(spellers[lang].check(phrase.encode(
spellers[lang].ConfigKeys()['encoding'][1])) for lang in languages)
end = 'be in aspell dictionaries (%s) for dictionary %s' % (
- ', '.join(languages), fname,)
+ ', '.join(languages), fname)
if in_aspell: # should be an error in aspell
assert this_in_aspell, '%s should %s' % (msg, end)
else: # shouldn't be
assert not this_in_aspell, '%s should not %s' % (msg, end)
- return this_in_aspell
def _check_err_rep(err, rep, in_aspell, fname, languages): | Test: Add suggestion of @lurch | codespell-project_codespell | train | py |
ce1bb938e8372ad1dea469457e5a62665d5033d3 | diff --git a/src/python/dxpy/scripts/dx_app_wizard.py b/src/python/dxpy/scripts/dx_app_wizard.py
index <HASH>..<HASH> 100755
--- a/src/python/dxpy/scripts/dx_app_wizard.py
+++ b/src/python/dxpy/scripts/dx_app_wizard.py
@@ -388,15 +388,7 @@ array:boolean array:int boolean hash string''')
# print('\n' + BOLD('Linux version: '))
app_json['runSpec']['distribution'] = 'Ubuntu'
-
- if any(instance_type.startswith(prefix) for prefix in ('mem1_hdd2', 'mem2_hdd2', 'mem3_hdd2')):
- print(fill('Your app will run on Ubuntu 12.04. To use Ubuntu 14.04, select from the list of common instance ' +
- 'types above.'))
- app_json['runSpec']['release'] = '12.04'
- else:
- app_json['runSpec']['release'] = '14.04'
- print(fill('Your app has been configured to run on Ubuntu 14.04. To use Ubuntu 12.04, edit the ' +
- BOLD('runSpec.release') + ' field of your dxapp.json.'))
+ app_json['runSpec']['release'] = '14.04'
#################
# WRITING FILES # | DEVEX-<I> Default to <I> release for all instance types (#<I>)
DEVEX-<I> Default to <I> release for all instance types in dx-app-wizard | dnanexus_dx-toolkit | train | py |
a495a1e48b8ed708abfd0f986c260f89a4f1a697 | diff --git a/chalice/package.py b/chalice/package.py
index <HASH>..<HASH> 100644
--- a/chalice/package.py
+++ b/chalice/package.py
@@ -733,8 +733,7 @@ class SAMTemplateGenerator(TemplateGenerator):
'DomainName': {'Ref': 'ApiGatewayCustomDomain'},
'RestApiId': {'Ref': 'RestAPI'},
'BasePath': domain_name.api_mapping.mount_path,
- # Workaround for domainname in cdk deployment issue #1640
- # 'Stage': {'Ref': 'RestAPI.Stage'},
+ 'Stage': resource.api_gateway_stage,
}
} | Fix to #<I>
Looking at definition of ApiGateway::BasePathMapping it looks only to be a string
The previous code sets up a template reference to the RestAPI but from the definition of AWS::Serverless::Api, there is only a StageName property.
Looking at the model for the WebSocket custom domain, I think we just need the name of the api state only. | aws_chalice | train | py |
a74711ac572d4962cb763bd328ea8fe4fc374d82 | diff --git a/pyfirmata/util.py b/pyfirmata/util.py
index <HASH>..<HASH> 100644
--- a/pyfirmata/util.py
+++ b/pyfirmata/util.py
@@ -1,6 +1,7 @@
import threading
import serial
import time
+import os
import pyfirmata
class Boards(dict): | Added forgotten import os statement | tino_pyFirmata | train | py |
1d0fbe64e75ebedd3410f279fc120ab9281e17d0 | diff --git a/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php b/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php
+++ b/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php
@@ -55,8 +55,8 @@ use Illuminate\Queue\Console\RestartCommand as QueueRestartCommand;
use Illuminate\Queue\Console\ListFailedCommand as ListFailedQueueCommand;
use Illuminate\Queue\Console\FlushFailedCommand as FlushFailedQueueCommand;
use Illuminate\Queue\Console\ForgetFailedCommand as ForgetFailedQueueCommand;
-use Illuminate\Database\Console\Migrations\ResetCommand as MigrateResetCommand;
use Illuminate\Database\Console\Migrations\FreshCommand as MigrateFreshCommand;
+use Illuminate\Database\Console\Migrations\ResetCommand as MigrateResetCommand;
use Illuminate\Database\Console\Migrations\StatusCommand as MigrateStatusCommand;
use Illuminate\Database\Console\Migrations\InstallCommand as MigrateInstallCommand;
use Illuminate\Database\Console\Migrations\RefreshCommand as MigrateRefreshCommand; | Apply fixes from StyleCI (#<I>) | laravel_framework | train | php |
0e8ea53cb7486ce3db81a9f262ec6340e9d49dcf | diff --git a/tests/EstimatorTest.py b/tests/EstimatorTest.py
index <HASH>..<HASH> 100644
--- a/tests/EstimatorTest.py
+++ b/tests/EstimatorTest.py
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
+from sys import version_info as PYTHON_VERSION
import pytest
import random as rd
@@ -45,6 +46,10 @@ from sklearn_porter.Estimator import Estimator
np.random.seed(0)
rd.seed(0)
+# Check python version:
+if PYTHON_VERSION[:2] < (3, 4):
+ pytest.skip('tests requires python >= 3.4', allow_module_level=True)
+
# Parse and prepare scikit-learn version:
SKLEARN_VERSION = tuple(map(int, str(sklearn.__version__).split('.'))) | feature/oop-api-refactoring: Add python check for all tests | nok_sklearn-porter | train | py |
c86f2bd957a3cad29ca963b251e3b56db713b99c | diff --git a/lucene/src/main/java/com/orientechnologies/lucene/index/OLuceneIndexNotUnique.java b/lucene/src/main/java/com/orientechnologies/lucene/index/OLuceneIndexNotUnique.java
index <HASH>..<HASH> 100644
--- a/lucene/src/main/java/com/orientechnologies/lucene/index/OLuceneIndexNotUnique.java
+++ b/lucene/src/main/java/com/orientechnologies/lucene/index/OLuceneIndexNotUnique.java
@@ -147,7 +147,7 @@ public class OLuceneIndexNotUnique extends OIndexAbstract<Set<OIdentifiable>> im
}
- private Object decodeKey(Object key) {
+ protected Object decodeKey(Object key) {
return key;
}
@@ -203,7 +203,7 @@ public class OLuceneIndexNotUnique extends OIndexAbstract<Set<OIdentifiable>> im
}
}
- private Object encodeKey(Object key) {
+ protected Object encodeKey(Object key) {
return key;
} | Restored visibility for decode/encode key | orientechnologies_orientdb | train | java |
80ed8009124e9d99cb582f6642c13a10d07a1ab2 | diff --git a/lib/node_modules/@stdlib/random/base/uniform/lib/_uniform.js b/lib/node_modules/@stdlib/random/base/uniform/lib/_uniform.js
index <HASH>..<HASH> 100644
--- a/lib/node_modules/@stdlib/random/base/uniform/lib/_uniform.js
+++ b/lib/node_modules/@stdlib/random/base/uniform/lib/_uniform.js
@@ -28,7 +28,8 @@
* @returns {number} pseudorandom number
*/
function uniform( rand, a, b ) {
- return ( (b-a)*rand() ) + a;
+ var r = rand();
+ return ( b*r ) + ( (1.0-r)*a ); // equivalent to (b-a)*r + a
} | Use a more numerically stable algorithm | stdlib-js_stdlib | train | js |
0e36d6e4b6b35cb72e7309fa4707e952b455bf09 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -68,7 +68,7 @@ else:
setup(
name='nodeconductor',
- version='0.95.0',
+ version='0.96.0',
author='OpenNode Team',
author_email='[email protected]',
url='https://github.com/opennode/nodeconductor', | Preparing new release: <I> | opennode_waldur-core | train | py |
832b7af2641bac33b0c13afae315828771562fe7 | diff --git a/openquake/commonlib/readinput.py b/openquake/commonlib/readinput.py
index <HASH>..<HASH> 100644
--- a/openquake/commonlib/readinput.py
+++ b/openquake/commonlib/readinput.py
@@ -870,6 +870,7 @@ def get_checksum32(oqparam, hazard=False):
'random_seed', 'ses_seed', 'truncation_level',
'maximum_distance', 'investigation_time',
'number_of_logic_tree_samples', 'imtls',
+ 'collapse_factor', 'pointsource_distance',
'ses_per_logic_tree_path', 'minimum_magnitude',
'sites', 'collapse_factor', 'filter_distance'):
hazard_params.append('%s = %s' % (key, val)) | Added collapse_factor and pointsource_distance in the hazard checksum | gem_oq-engine | train | py |
1952010ed60352252cc42e3892049e4f8deaf179 | diff --git a/Source/Base.js b/Source/Base.js
index <HASH>..<HASH> 100644
--- a/Source/Base.js
+++ b/Source/Base.js
@@ -100,10 +100,10 @@ Base.prototype = {
if (typeof desc.value != typeof undefined) {
// set the value normally in case it's a function that needs to be overwritten
extend.call(this, key, desc.value);
- desc.value = this[key];
+ } else {
+ // set it while maintaining the original descriptor settings
+ Object.defineProperty(this, key, desc);
}
- // now set it (again?) while maintaining the original descriptor settings
- Object.defineProperty(this, key, desc);
}
}
} | Only use Object.defineProperty() for properties that aren't static | pixelandtonic_garnishjs | train | js |
8ebd522af464b50883fb99518f87f9c08a7a360d | diff --git a/matplotlib2tikz/axes.py b/matplotlib2tikz/axes.py
index <HASH>..<HASH> 100644
--- a/matplotlib2tikz/axes.py
+++ b/matplotlib2tikz/axes.py
@@ -47,14 +47,18 @@ class Axes(object):
xlabel = mpl_backend_pgf.common_texification(xlabel)
self.axis_options.append(u"xlabel={{{}}}".format(xlabel))
if xrotation != 90:
- self.axis_options.append(u"xlabel style={{rotate={}}}".format(xrotation - 90))
+ self.axis_options.append(
+ u"xlabel style={{rotate={}}}".format(xrotation - 90)
+ )
ylabel = obj.get_ylabel()
yrotation = obj.yaxis.get_label().get_rotation()
if ylabel:
ylabel = mpl_backend_pgf.common_texification(ylabel)
self.axis_options.append(u"ylabel={{{}}}".format(ylabel))
if yrotation != 90:
- self.axis_options.append(u"ylabel style={{rotate={}}}".format(yrotation - 90))
+ self.axis_options.append(
+ u"ylabel style={{rotate={}}}".format(yrotation - 90)
+ )
# Axes limits.
# Sort the limits so make sure that the smaller of the two is actually *min. | reformat axes.py additions to comply with black | nschloe_matplotlib2tikz | train | py |
ce229281f08b48a6081b31664e6fc35452254f1c | diff --git a/assert/assertions.go b/assert/assertions.go
index <HASH>..<HASH> 100644
--- a/assert/assertions.go
+++ b/assert/assertions.go
@@ -1579,7 +1579,7 @@ func Eventually(t TestingT, condition func() bool, waitFor time.Duration, tick t
for tick := ticker.C; ; {
select {
case <-timer.C:
- return false
+ return Fail(t, "Condition never satisfied", msgAndArgs...)
case <-tick:
tick = nil
go func() { ch <- condition() }() | assert.Eventually: fail the testcase if condition is not met
Fixes #<I> | stretchr_testify | train | go |
4f360dd12c7f857d799f06593fc0436f696b7180 | diff --git a/ccmlib/dse_node.py b/ccmlib/dse_node.py
index <HASH>..<HASH> 100644
--- a/ccmlib/dse_node.py
+++ b/ccmlib/dse_node.py
@@ -61,7 +61,12 @@ class DseNode(Node):
self.__generate_server_xml()
if 'graph' in self.workloads:
(node_ip, _) = self.network_interfaces['binary']
- self.set_dse_configuration_options({'graph' : {'gremlin_server': {'host': node_ip}}})
+ conf_file = os.path.join(self.get_path(), 'resources', 'dse', 'conf', 'dse.yaml')
+ with open(conf_file, 'r') as f:
+ data = yaml.load(f)
+ graph_options = data['graph']
+ graph_options['gremlin_server']['host'] = node_ip
+ self.set_dse_configuration_options({'graph' : graph_options})
self.__update_gremlin_config_yaml()
if 'dsefs' in self.workloads:
dsefs_options = {'dsefs_options' : {'enabled': 'true', | Use existing graph settings in dse.yaml when setting host | riptano_ccm | train | py |
f8e398de5b02eb537d7209c7cbe770823e67a1db | diff --git a/lib/ace-client/base.rb b/lib/ace-client/base.rb
index <HASH>..<HASH> 100644
--- a/lib/ace-client/base.rb
+++ b/lib/ace-client/base.rb
@@ -4,7 +4,6 @@ require 'uri'
module AceClient
class Base
include HTTParty
- ssl_version :TLSv1
attr_accessor :access_key_id
attr_accessor :secret_access_key | don't specify ssl_version in base client | tily_ace-client | train | rb |
9c83dac6a5744f9148da99bebab521a826a6098f | diff --git a/greenhouse/emulation/zmq.py b/greenhouse/emulation/zmq.py
index <HASH>..<HASH> 100644
--- a/greenhouse/emulation/zmq.py
+++ b/greenhouse/emulation/zmq.py
@@ -118,6 +118,6 @@ if zs:
patchers['Socket'] = ZMQSugarSocket
patchers['Poller'] = ZMQPoller
sugar_patchers.update(patchers)
- sugar_context_patchers['Context'] = ZMQSugarContext
+ #sugar_context_patchers['Context'] = ZMQSugarContext
sugar_socket_patchers['Socket'] = ZMQSugarSocket
sugar_poll_patchers['Poller'] = ZMQPoller | still have to leave out that patcher | teepark_greenhouse | train | py |
74a23be93b1268d1a8b4299c3addc2c4fa9561ae | diff --git a/test/helpers.js b/test/helpers.js
index <HASH>..<HASH> 100644
--- a/test/helpers.js
+++ b/test/helpers.js
@@ -8,6 +8,14 @@ var databaseUrls = exports.databaseUrls = {
sqlite3: "sqlite3://:memory:",
}
+if (process.env.TEST_DRIVERS) {
+ Object.keys(databaseUrls).forEach(function (driver) {
+ if (process.env.TEST_DRIVERS.indexOf(driver) == -1) {
+ delete databaseUrls[driver]
+ }
+ })
+}
+
/**
* Run ``callback(conn, tap_test)`` where ``conn`` is a connection to the test
* database, and ``tap_test`` is a node-tap test object | allow specifying drivers to test in env variable | grncdr_node-any-db | train | js |
682d08e7c404a0955b47831f64cb795d04beac7c | diff --git a/src/Server.php b/src/Server.php
index <HASH>..<HASH> 100644
--- a/src/Server.php
+++ b/src/Server.php
@@ -277,6 +277,12 @@ class Server
*/
public function deleteCache($path)
{
+ if (!$this->groupCacheInFolders) {
+ throw new InvalidArgumentException(
+ 'Deleting cached image manipulations is not possible when grouping cache into folders is disabled.'
+ );
+ }
+
return $this->cache->deleteDir(
dirname($this->getCachePath($path))
);
diff --git a/tests/ServerTest.php b/tests/ServerTest.php
index <HASH>..<HASH> 100644
--- a/tests/ServerTest.php
+++ b/tests/ServerTest.php
@@ -195,6 +195,18 @@ class ServerTest extends \PHPUnit_Framework_TestCase
$this->assertTrue($this->server->deleteCache('image.jpg', []));
}
+ public function testDeleteCacheWithGroupCacheInFoldersDisabled()
+ {
+ $this->setExpectedException(
+ 'InvalidArgumentException',
+ 'Deleting cached image manipulations is not possible when grouping cache into folders is disabled.'
+ );
+
+ $this->server->setGroupCacheInFolders(false);
+
+ $this->server->deleteCache('image.jpg', []);
+ }
+
public function testSetApi()
{
$api = Mockery::mock('League\Glide\Api\ApiInterface'); | Prevent cache deleting when grouping cache in folders is disabled. | thephpleague_glide | train | php,php |
7f95c4ac34f50ba964f16b55ade992f9148ba68c | diff --git a/hazelcast/src/test/java/com/hazelcast/internal/partition/impl/MigrationCommitServiceTest.java b/hazelcast/src/test/java/com/hazelcast/internal/partition/impl/MigrationCommitServiceTest.java
index <HASH>..<HASH> 100644
--- a/hazelcast/src/test/java/com/hazelcast/internal/partition/impl/MigrationCommitServiceTest.java
+++ b/hazelcast/src/test/java/com/hazelcast/internal/partition/impl/MigrationCommitServiceTest.java
@@ -540,7 +540,7 @@ public class MigrationCommitServiceTest extends HazelcastTestSupport {
OperationServiceImpl operationService = getOperationService(instances[0]);
for (int partitionId = 0; partitionId < PARTITION_COUNT; partitionId++) {
assertNotNull(operationService.invokeOnPartition(null, new TestGetOperation(), partitionId)
- .get(10, TimeUnit.SECONDS));
+ .get(1, TimeUnit.MINUTES));
}
} | Increase future timeout in MigrationCommitServiceTest | hazelcast_hazelcast | train | java |
154770c691ac5c8a8f67aecea70a8bd3d4ac9887 | diff --git a/src/Resources/Resource.php b/src/Resources/Resource.php
index <HASH>..<HASH> 100644
--- a/src/Resources/Resource.php
+++ b/src/Resources/Resource.php
@@ -236,9 +236,9 @@ class Resource
*
* @return array
*/
- public function info()
+ public function info(array $data = [])
{
- return $this->ontraport->get($this->getNamespace() . '/getInfo', $this->toArray());
+ return $this->ontraport->get($this->getNamespace() . '/getInfo', $this->toArray($data));
}
/** | Keep consistency and allow params to be passed to info method | wallstreetio_ontraport | train | php |
cf67bf95463b42c3e0e817d6e774b4c61712a814 | diff --git a/Generator/TranslationsGenerator.php b/Generator/TranslationsGenerator.php
index <HASH>..<HASH> 100644
--- a/Generator/TranslationsGenerator.php
+++ b/Generator/TranslationsGenerator.php
@@ -37,6 +37,9 @@ class TranslationsGenerator extends Generator
public function generate($namespace, $basePath, ClassMetadata $metadata)
{
$out = array();
+ if ( !file_exists($basePath.'/Resources/translations') ) {
+ mkdir($basePath.'/Resources/translations', 0777, true);
+ }
$out[] = $this->generateLangEn($namespace, $basePath, $metadata);
$out[] = $this->generateLangfr($namespace, $basePath, $metadata);
return $out; | Create translations folder if it doesn't exist | vincenttouzet_BaseBundle | train | php |
5df472b7aa859befb2f4fa4b856611c4c0358f04 | diff --git a/shared/chat/conversation/messages/attachment/container.js b/shared/chat/conversation/messages/attachment/container.js
index <HASH>..<HASH> 100644
--- a/shared/chat/conversation/messages/attachment/container.js
+++ b/shared/chat/conversation/messages/attachment/container.js
@@ -83,7 +83,9 @@ export default compose(
this.props.measure()
}
- this.props.onEnsurePreviewLoaded()
+ if (this.props.message.filename !== prevProps.message.filename) {
+ this.props.onEnsurePreviewLoaded()
+ }
},
})
)(Attachment) | Reduce unnecessary loadAttachmentPreview actions | keybase_client | train | js |
ae6f8fa84e81b34fe0ac0e6b4b5a1c61c9f249c0 | diff --git a/kitnirc/client.py b/kitnirc/client.py
index <HASH>..<HASH> 100644
--- a/kitnirc/client.py
+++ b/kitnirc/client.py
@@ -52,7 +52,7 @@ class Channel(object):
user = User(user)
if user.nick not in self.members:
_log.warning("Ignoring request to remove user '%s' from channel "
- "'%s' because that user is already in the member "
+ "'%s' because that user is already not in the member "
"list.", user, self.name)
return
del self.members[user.nick] | Correct warning text on removing absent user from channel. | ayust_kitnirc | train | py |
32d2baad806322c3920c3d57af3237dcecc6aa95 | diff --git a/driver/src/test/java/org/neo4j/driver/v1/tck/DriverComplianceSteps.java b/driver/src/test/java/org/neo4j/driver/v1/tck/DriverComplianceSteps.java
index <HASH>..<HASH> 100644
--- a/driver/src/test/java/org/neo4j/driver/v1/tck/DriverComplianceSteps.java
+++ b/driver/src/test/java/org/neo4j/driver/v1/tck/DriverComplianceSteps.java
@@ -141,7 +141,9 @@ public class DriverComplianceSteps
@Given( "^a list containing$" )
public static void a_list_containing( List<String> table ) throws Throwable
{
- List<String> content = table.subList( 1, table.size() - 1 );
+ List<String> content = table.subList( 1, table.size() );
+ assertThat( content.size(), equalTo( table.size() - 1 ) );
+
for ( String value : content )
{
listOfObjects.add( getJavaValueIntAsLong( value ) ); | Ensure content also contains the last element | neo4j_neo4j-java-driver | train | java |
f2aaeedbf8c72fd2259d23d8b23246ca41a2703f | diff --git a/src/Browser/Language.php b/src/Browser/Language.php
index <HASH>..<HASH> 100644
--- a/src/Browser/Language.php
+++ b/src/Browser/Language.php
@@ -112,7 +112,7 @@ class Language
*
* @return string
*/
- public static function getLanguageLocale()
+ public static function getLanguageLocale($separator = '-')
{
if (!is_array(self::$languages)) {
self::checkLanguages();
@@ -127,9 +127,9 @@ class Language
}
if (!empty($locale)) {
- return $userLanguage . "-" . strtoupper($locale);
+ return $userLanguage . $separator . strtoupper($locale);
} else {
return $userLanguage;
}
}
-}
\ No newline at end of file
+} | Add separator argument to getLanguageLocale
Allow overriding the default separator for getLanguageLocale. It's sometimes useful to have the locale with an underscore instead of a dash. | sinergi_php-browser-detector | train | php |
9b8277b21481853cb531a30eff341232cf54ab85 | diff --git a/lyrics.py b/lyrics.py
index <HASH>..<HASH> 100644
--- a/lyrics.py
+++ b/lyrics.py
@@ -720,7 +720,7 @@ jobcount = 1
stats = False
mp3files = []
-def parseargv()1
+def parseargv():
'''Parse command line arguments. Settings will be stored in the global
variables declared above'''
global jobcount | Yes, I pushed to master with a freaking syntax error | ocaballeror_LyricFetch | train | py |
9f742429abe8c7e8abb900a6282090cb2ff97449 | diff --git a/lib/ProMotion/helpers/MeasureHelper.rb b/lib/ProMotion/helpers/MeasureHelper.rb
index <HASH>..<HASH> 100644
--- a/lib/ProMotion/helpers/MeasureHelper.rb
+++ b/lib/ProMotion/helpers/MeasureHelper.rb
@@ -4,7 +4,6 @@ module ProMotion
def content_height(view)
height = 0
view.subviews.each do |sub_view|
- $stderr.puts sub_view
next if sub_view.isHidden
y = sub_view.frame.origin.y
h = sub_view.frame.size.height | Removed debugging .puts in content_height. | infinitered_ProMotion | train | rb |
b5f4aecc24958d7754f100fc30ab3058167f23a0 | diff --git a/test_crumbs/test_common.py b/test_crumbs/test_common.py
index <HASH>..<HASH> 100644
--- a/test_crumbs/test_common.py
+++ b/test_crumbs/test_common.py
@@ -7,6 +7,7 @@
import copy
import logging
+
try:
import unittest2 as unittest
except ImportError:
diff --git a/test_crumbs/test_functional.py b/test_crumbs/test_functional.py
index <HASH>..<HASH> 100644
--- a/test_crumbs/test_functional.py
+++ b/test_crumbs/test_functional.py
@@ -10,6 +10,7 @@ import os
import sys
import tempfile
import time
+
try:
import unittest2 as unittest
except ImportError:
diff --git a/test_crumbs/test_unit.py b/test_crumbs/test_unit.py
index <HASH>..<HASH> 100644
--- a/test_crumbs/test_unit.py
+++ b/test_crumbs/test_unit.py
@@ -10,6 +10,7 @@ import copy
import functools
import logging
import sys
+
try:
import unittest2 as unittest
except ImportError: | add linefeed before try block for the cleanliness | alunduil_crumbs | train | py,py,py |
633970528cb5091ef376dbca2e4721cd42525419 | diff --git a/packages/vaex-hdf5/vaex/hdf5/writer.py b/packages/vaex-hdf5/vaex/hdf5/writer.py
index <HASH>..<HASH> 100644
--- a/packages/vaex-hdf5/vaex/hdf5/writer.py
+++ b/packages/vaex-hdf5/vaex/hdf5/writer.py
@@ -30,6 +30,8 @@ class Writer:
self._layout_called = False
def close(self):
+ # make sure we don't have references to the numpy arrays any more
+ self.column_writers = {}
if self.mmap is not None:
self.mmap.close()
self.file.close() | 🐛 hdf5: do not keep a reference to numpy arrays on closing an hdf5 file (#<I>)
Otherwise the buffers of the numpy arrays are still being used | vaexio_vaex | train | py |
2605df61a4ddd90ef2e4061bccc527026e196a2a | diff --git a/playhouse/sqlite_ext.py b/playhouse/sqlite_ext.py
index <HASH>..<HASH> 100644
--- a/playhouse/sqlite_ext.py
+++ b/playhouse/sqlite_ext.py
@@ -95,8 +95,7 @@ class JSONPath(ColumnBase):
def append(self, value, as_json=None):
if as_json or isinstance(value, (list, dict)):
value = fn.json(self._field._json_dumps(value))
- path = Value('$%s' % ''.join(self._path + ('[#]',)))
- return fn.json_set(self._field, path, value)
+ return fn.json_set(self._field, self['#'].path, value)
def _json_operation(self, func, value, as_json=None):
if as_json or isinstance(value, (list, dict)): | Small cleanup in sqlite json append. | coleifer_peewee | train | py |
49237588c988b2c6ee3a06522215efd71b48649d | diff --git a/src/main/java/com/codeborne/selenide/Configuration.java b/src/main/java/com/codeborne/selenide/Configuration.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/codeborne/selenide/Configuration.java
+++ b/src/main/java/com/codeborne/selenide/Configuration.java
@@ -120,12 +120,12 @@ public class Configuration {
public static boolean dismissModalDialogs = Boolean.parseBoolean(System.getProperty("selenide.dismissModalDialogs", "false"));
/**
- * EXPERIMENTAL
- *
* If set to true, sets value by javascript instead of using Selenium built-in "sendKey" function
- * (that is quite low because it sends every character separately).
+ * (that is quite slow because it sends every character separately).
+ *
+ * Tested on Codeborne projects - works well, speed up ~30%.
+ * Some people reported 150% speedup (because sending characters one-by-one was especially slow via network to Selenium Grid on cloud).
*
- * Still not tested well. Waiting for your feedback.
* https://github.com/codeborne/selenide/issues/135
*
* Default value: false | "fast setValue" is not experimental anymore | selenide_selenide | train | java |
593b315c73d4942dde9d6eecedd68cbce8564b2a | diff --git a/test/Mocker.php b/test/Mocker.php
index <HASH>..<HASH> 100644
--- a/test/Mocker.php
+++ b/test/Mocker.php
@@ -404,13 +404,13 @@ class Mocker {
'{:modifiers} function {:method}({:args}) {',
' $args = compact({:stringArgs});',
' $args["hash"] = spl_object_hash($this->mocker);',
- ' $method = array($this->mocker, "{:method}");',
+ ' $_method = array($this->mocker, "{:method}");',
' $result = {:master}::invokeMethod("_filter", array(',
' __CLASS__,',
' "{:method}",',
' $args,',
- ' function($self, $args) use(&$method) {',
- ' return call_user_func_array($method, $args);',
+ ' function($self, $args) use(&$_method) {',
+ ' return call_user_func_array($_method, $args);',
' }',
' ));',
' if (!isset($this->results["{:method}"])) {', | Fix mutation of method name in mocker.
This bug reveals itself in PHP7.
Fixes #<I>. | UnionOfRAD_lithium | train | php |
5af0c5ad3a52ba8bfa16cce90855efce761395ed | diff --git a/reposerver/server.go b/reposerver/server.go
index <HASH>..<HASH> 100644
--- a/reposerver/server.go
+++ b/reposerver/server.go
@@ -64,6 +64,8 @@ func NewServer(metricsServer *metrics.MetricsServer, cache *reposervercache.Cach
grpc.Creds(credentials.NewTLS(tlsConfig)),
grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(unaryInterceptors...)),
grpc.StreamInterceptor(grpc_middleware.ChainStreamServer(streamInterceptors...)),
+ grpc.MaxRecvMsgSize(apiclient.MaxGRPCMessageSize),
+ grpc.MaxSendMsgSize(apiclient.MaxGRPCMessageSize),
},
}, nil
} | fix: reposerver: Set GRPC max message size (#<I>) | argoproj_argo-cd | train | go |
2d44e99c1723b17499189c013d54a9a3932fab13 | diff --git a/tests/testoptions.py b/tests/testoptions.py
index <HASH>..<HASH> 100644
--- a/tests/testoptions.py
+++ b/tests/testoptions.py
@@ -9,6 +9,18 @@ from unittest import SkipTest
Options.skip_invalid = False
+try:
+ # Needed a backend to register backend and options
+ from holoviews.plotting import mpl
+except:
+ pass
+
+try:
+ # Needed to register backend and options
+ from holoviews.plotting import bokeh
+except:
+ pass
+
class TestOptions(ComparisonTestCase):
def test_options_init(self): | Added backend imports needed to run testoptions.py in isolation | pyviz_holoviews | train | py |
0b9319b5de3d375a96a8aebf0be4400d16c5ee49 | diff --git a/static_vm_package/VCenterAutoloadStaticVMDriver/app_discovery/vm_autoload_driver.py b/static_vm_package/VCenterAutoloadStaticVMDriver/app_discovery/vm_autoload_driver.py
index <HASH>..<HASH> 100644
--- a/static_vm_package/VCenterAutoloadStaticVMDriver/app_discovery/vm_autoload_driver.py
+++ b/static_vm_package/VCenterAutoloadStaticVMDriver/app_discovery/vm_autoload_driver.py
@@ -1,5 +1,5 @@
-# from cloudshell.api.cloudshell_api import InputNameValue
-# from cloudshell.api.cloudshell_api import CloudShellAPISession
+from cloudshell.api.cloudshell_api import InputNameValue
+from cloudshell.api.cloudshell_api import CloudShellAPISession
from cloudshell.shell.core.driver_context import ApiVmDetails, ApiVmCustomParam
from cloudshell.cp.vcenter.common.cloud_shell.driver_helper import CloudshellDriverHelper | added back INV and CSAPIS | QualiSystems_vCenterShell | train | py |
04ded200b45c9dd27259bad69b7712e73a22d825 | diff --git a/src/cli.js b/src/cli.js
index <HASH>..<HASH> 100755
--- a/src/cli.js
+++ b/src/cli.js
@@ -55,7 +55,7 @@ program
)
.option(
"-a, --auth <token>",
- "Provide auth token or basic auth for private packages."
+ "Provide an NPM authToken for private packages."
)
.usage("<package>[@<version>], default version is 'latest'")
.parse(process.argv); | Update instructions to be more clear that it only takes a token. Does not support basic auth | nathanhleung_install-peerdeps | train | js |
16da90b8920ec7973d1b1997ad855a1d2c809ce6 | diff --git a/ndb/model.py b/ndb/model.py
index <HASH>..<HASH> 100644
--- a/ndb/model.py
+++ b/ndb/model.py
@@ -135,9 +135,11 @@ class Model(object):
self_values = [(name, value)
for name, value in self._values.iteritems()
if value is not None]
+ self_values.sort()
other_values = [(name, value)
for name, value in other._values.iteritems()
if value is not None]
+ other_values.sort()
return self_values == other_values
def __ne__(self, other): | Ignore the property order when comparing models. | GoogleCloudPlatform_datastore-ndb-python | train | py |
c03bed04bc4d4db06bdce9eaaee600e51d2ba24e | diff --git a/sortinghat/_version.py b/sortinghat/_version.py
index <HASH>..<HASH> 100644
--- a/sortinghat/_version.py
+++ b/sortinghat/_version.py
@@ -1,2 +1,2 @@
# Versions compliant with PEP 440 https://www.python.org/dev/peps/pep-0440
-__version__ = "0.6.7"
+__version__ = "0.6.8" | Update version number to <I> | chaoss_grimoirelab-sortinghat | train | py |
ac9d49dd846d9816c03460e7fc4e246cbb3803bf | diff --git a/html2asketch/model/text.js b/html2asketch/model/text.js
index <HASH>..<HASH> 100644
--- a/html2asketch/model/text.js
+++ b/html2asketch/model/text.js
@@ -1,5 +1,5 @@
import Base from './base';
-import {RESIZING_CONSTRAINTS, calculateResizingConstraintValue} from '../helpers/utils';
+import {RESIZING_CONSTRAINTS} from '../helpers/utils';
class Text extends Base {
constructor({x, y, width, height, text, style, multiline}) {
@@ -13,6 +13,7 @@ class Text extends Base {
this._name = text;
this._style = style;
this._multiline = multiline;
+ this.setResizingConstraint(RESIZING_CONSTRAINTS.HEIGHT);
}
toJSON() {
@@ -30,7 +31,6 @@ class Text extends Base {
obj.text = this._text;
obj.style = this._style.toJSON();
- obj.resizingConstraint = calculateResizingConstraintValue(RESIZING_CONSTRAINTS.HEIGHT);
obj.automaticallyDrawOnUnderlyingPath = false;
obj.dontSynchroniseWithSymbol = false;
obj.glyphBounds = ''; | Fix option to set constraint for texts (#<I>) | brainly_html-sketchapp | train | js |
afe1e17a8ec6c1171d38b8e171f7c7ba49834e37 | diff --git a/go/vt/topotools/rebuild_keyspace.go b/go/vt/topotools/rebuild_keyspace.go
index <HASH>..<HASH> 100644
--- a/go/vt/topotools/rebuild_keyspace.go
+++ b/go/vt/topotools/rebuild_keyspace.go
@@ -57,6 +57,14 @@ func RebuildKeyspaceLocked(ctx context.Context, log logutil.Logger, ts *topo.Ser
return err
}
+ // The caller intents to update all cells in this case
+ if len(cells) == 0 {
+ cells, err = ts.GetCellInfoNames(ctx)
+ if err != nil {
+ return err
+ }
+ }
+
shards, err := ts.FindAllShardsInKeyspace(ctx, keyspace)
if err != nil {
return err | Re-add existent semantics where no cells provided means all cells | vitessio_vitess | train | go |
7adb2e1508933cec70aef6fa9960c03064d687c6 | diff --git a/ethereum/pow/chain.py b/ethereum/pow/chain.py
index <HASH>..<HASH> 100644
--- a/ethereum/pow/chain.py
+++ b/ethereum/pow/chain.py
@@ -43,6 +43,7 @@ class Chain(object):
self.state = genesis
self.env = self.state.env
print('Initializing chain from provided state')
+ reset_genesis = True
elif "extraData" in genesis:
self.state = state_from_genesis_declaration(
genesis, self.env) | Added reset_genesis to chain initialization from state | ethereum_pyethereum | train | py |
66d13f534262bdbafa459fabd3132fc65678aca9 | diff --git a/raven/transport/base.py b/raven/transport/base.py
index <HASH>..<HASH> 100644
--- a/raven/transport/base.py
+++ b/raven/transport/base.py
@@ -8,6 +8,10 @@ raven.transport.base
from __future__ import absolute_import
+# Helper for external transports
+has_newstyle_transports = True
+
+
class Transport(object):
"""
All transport implementations need to subclass this class | Added an indicator for external transports | getsentry_raven-python | train | py |
fb97326255b1ee4b1f3bc40bd217a3eb86a172b9 | diff --git a/template/helper/listbox.php b/template/helper/listbox.php
index <HASH>..<HASH> 100644
--- a/template/helper/listbox.php
+++ b/template/helper/listbox.php
@@ -50,6 +50,9 @@ class ComTagsTemplateHelperListbox extends KTemplateHelperListbox
)
));
+ // '0' is false in PHP but true in JavaScript so we need to cast to boolean here
+ $config->autocreate = (boolean) $config->autocreate;
+
$entity = $config->entity;
//Set the selected tags | re #<I>: Cast autocreate to boolean | joomlatools_joomlatools-framework | train | php |
6e8666b79ea430de855ec63167610943e11d788e | diff --git a/src/Command/Project/ProjectGetCommand.php b/src/Command/Project/ProjectGetCommand.php
index <HASH>..<HASH> 100644
--- a/src/Command/Project/ProjectGetCommand.php
+++ b/src/Command/Project/ProjectGetCommand.php
@@ -100,7 +100,7 @@ class ProjectGetCommand extends PlatformCommand
if (file_exists($directory)) {
$existed = true;
$this->stdErr->writeln("The directory <error>$directory</error> already exists");
- if ($questionHelper->confirm("Overwrite?", $input, $this->stdErr, false)) {
+ if (file_exists($directory . '/' . LocalProject::PROJECT_CONFIG) && $questionHelper->confirm("Overwrite?", $input, $this->stdErr, false)) {
$fsHelper->remove($directory);
}
else { | Adjust 'get' so it would only overwrite a directory if it's a project | platformsh_platformsh-cli | train | php |
86c168ed891faf1c0a6067eb1377427929a3f189 | diff --git a/lib/omnibus/cli.rb b/lib/omnibus/cli.rb
index <HASH>..<HASH> 100644
--- a/lib/omnibus/cli.rb
+++ b/lib/omnibus/cli.rb
@@ -61,8 +61,6 @@ module Omnibus
#
# $ omnibus build chefdk
#
- # @todo Support regular expressions (+$ omnibus build chef*+)
- #
desc 'build PROJECT', 'Build the given Omnibus project'
def build(name)
project = Project.load(name) | Remove a TODO comment that is never going to happen | chef_omnibus | train | rb |
3a85bae31435a0f0189ecd7e789f9a401f6e9c55 | diff --git a/conn.go b/conn.go
index <HASH>..<HASH> 100644
--- a/conn.go
+++ b/conn.go
@@ -1,4 +1,4 @@
-package pqx
+package pgx
import (
"crypto/md5"
diff --git a/conn_test.go b/conn_test.go
index <HASH>..<HASH> 100644
--- a/conn_test.go
+++ b/conn_test.go
@@ -1,4 +1,4 @@
-package pqx
+package pgx
import (
"testing"
diff --git a/message_reader.go b/message_reader.go
index <HASH>..<HASH> 100644
--- a/message_reader.go
+++ b/message_reader.go
@@ -1,4 +1,4 @@
-package pqx
+package pgx
import (
"bytes"
diff --git a/messages.go b/messages.go
index <HASH>..<HASH> 100644
--- a/messages.go
+++ b/messages.go
@@ -1,4 +1,4 @@
-package pqx
+package pgx
import (
"encoding/binary" | package name is pgx not pqx | jackc_pgx | train | go,go,go,go |
6fca2c4d5b77e37197a521d676132b49cf899d98 | diff --git a/Neos.Flow/Classes/Http/Request.php b/Neos.Flow/Classes/Http/Request.php
index <HASH>..<HASH> 100644
--- a/Neos.Flow/Classes/Http/Request.php
+++ b/Neos.Flow/Classes/Http/Request.php
@@ -577,7 +577,7 @@ class Request extends AbstractMessage
}
}
}
- return ($trim ? MediaTypes::trimMediaType($negotiatedMediaType) : $negotiatedMediaType);
+ return ($trim && $negotiatedMediaType !== null ? MediaTypes::trimMediaType($negotiatedMediaType) : $negotiatedMediaType);
}
/** | BUGFIX: Don't call trimMediaType on null values
This would result in calling preg_match on a null value, which somehow works but is
not a good thing to do. Also this caused tests to fail after the scalar typehints change. | neos_flow-development-collection | train | php |
42799e09531521489077b4e18982c9db74ff6b12 | diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py
index <HASH>..<HASH> 100644
--- a/tests/integration/__init__.py
+++ b/tests/integration/__init__.py
@@ -306,14 +306,19 @@ class TestDaemon(object):
wait_minion_connections.join()
wait_minion_connections.terminate()
if wait_minion_connections.exitcode > 0:
+ print(
+ '\n {RED_BOLD}*{ENDC} ERROR: Failed to sync minions'.format(
+ **self.colors
+ )
+ )
return False
del(wait_minion_connections)
- sync_needed = False
- if not self.opts.clean:
+ sync_needed = self.opts.clean
+ if self.opts.clean is False:
def sumfile(fpath):
- # Since we will be doin this for small files, it should be ok
+ # Since we will be do'in this for small files, it should be ok
fobj = fopen(fpath)
m = md5()
while True: | Fix '--clean/--no-clean' logic needed to sync minions. | saltstack_salt | train | py |
fbfb266fad0d94be50281bee09a61eedc77fb250 | diff --git a/test.js b/test.js
index <HASH>..<HASH> 100644
--- a/test.js
+++ b/test.js
@@ -87,17 +87,16 @@ test('uses the log level passed in as an option', function (t) {
var dest = split(JSON.parse)
var logger = pinoHttp({ useLevel: 'debug', level: 'debug' }, dest)
- function decoratedLogger (req, res, next) {
- logger(req, res, next)
- req.log.debug = function () {
- t.end()
- }
- }
-
- setup(t, decoratedLogger, function (err, server) {
+ setup(t, logger, function (err, server) {
t.error(err)
doGet(server)
})
+
+ dest.on('data', function (line) {
+ t.equal(line.level, 20, 'level')
+ t.notOk(line.useLevel, 'useLevel not forwarded')
+ t.end()
+ })
})
test('allocate a unique id to every request', function (t) { | Test that uselevel do not leak. | pinojs_pino-http | train | js |
2308b5c10d47c73748850b53fda75418b903ea9d | diff --git a/tst.py b/tst.py
index <HASH>..<HASH> 100755
--- a/tst.py
+++ b/tst.py
@@ -77,6 +77,11 @@ class TestCase(unittest.TestCase):
o = C(4)
self.assertEqual(repr(o), 'C(x=4,y=10)')
+ @dataclass
+ class D(C):
+ x: int = 20
+ self.assertEqual(repr(D()), 'D(x=20,y=10)')
+
def test_overwrite_fields_in_derived_class(self):
# Note that x from C1 replaces x in Base, but the order remains
# the same as defined in Base. | Added a repr test for an overridden field in a sub-class. | ericvsmith_dataclasses | train | py |
566ff3430d7150dec75ff702b2a907a357edf145 | diff --git a/symbols/arrayaccess.py b/symbols/arrayaccess.py
index <HASH>..<HASH> 100644
--- a/symbols/arrayaccess.py
+++ b/symbols/arrayaccess.py
@@ -85,12 +85,7 @@ class SymbolARRAYACCESS(SymbolCALL):
# i is the dimension ith index, b is the bound
for i, b in zip(self.arglist, self.entry.bounds):
lower_bound = NUMBER(b.lower, type_=Type.uinteger, lineno=self.lineno)
- tmp = BINARY.make_node('MINUS',
- TYPECAST.make_node(gl.SYMBOL_TABLE.basic_types[gl.BOUND_TYPE],
- i.children[0], self.lineno),
- lower_bound, self.lineno, lambda x, y: x - y,
- type_=gl.SYMBOL_TABLE.basic_types[gl.BOUND_TYPE])
-
+ tmp = i.children[0]
if is_number(tmp) or is_const(tmp):
if offset is not None:
offset = offset * b.count + tmp.value | BugFix: fixed a bug in access to non 0-based arrays
(Thanks, to Eunar Saukas) | boriel_zxbasic | train | py |
a87800e94e29298a258db76644f3d9c1bfb08797 | diff --git a/gui/resource.py b/gui/resource.py
index <HASH>..<HASH> 100644
--- a/gui/resource.py
+++ b/gui/resource.py
@@ -53,7 +53,7 @@ def build_window(res):
build_component(comp, parent=win)
if menubar:
- mb = gui.MenuBar(parent=win)
+ mb = gui.MenuBar(name="menubar", parent=win)
for menu in menubar:
build_component(menu, parent=mb) | fixed menubar loading from resource (name) | reingart_gui2py | train | py |
1583c5579abf3f44487cf2b9ae5d95cd225216f1 | diff --git a/salt/utils/s3.py b/salt/utils/s3.py
index <HASH>..<HASH> 100644
--- a/salt/utils/s3.py
+++ b/salt/utils/s3.py
@@ -129,7 +129,6 @@ def query(key, keyid, method='GET', params=None, headers=None,
if not data:
data = None
- response = None
if method == 'PUT':
if local_file:
with salt.utils.fopen(local_file, 'r') as data:
@@ -147,6 +146,7 @@ def query(key, keyid, method='GET', params=None, headers=None,
data=data,
verify=verify_ssl,
stream=True)
+ response = result.content
else:
result = requests.request(method,
requesturl, | Set response when using "GET" method in s3 utils
Fixes #<I> | saltstack_salt | train | py |
f14b567326a0ddb176e862761bc106db058c1762 | diff --git a/lib/stack_master/role_assumer.rb b/lib/stack_master/role_assumer.rb
index <HASH>..<HASH> 100644
--- a/lib/stack_master/role_assumer.rb
+++ b/lib/stack_master/role_assumer.rb
@@ -37,7 +37,7 @@ module StackMaster
def replace_cf_driver
driver = StackMaster.cloud_formation_driver
- StackMaster.cloud_formation_driver = AwsDriver::CloudFormation.new
+ StackMaster.cloud_formation_driver = driver.class.new
driver
end
diff --git a/spec/stack_master/role_assumer_spec.rb b/spec/stack_master/role_assumer_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/stack_master/role_assumer_spec.rb
+++ b/spec/stack_master/role_assumer_spec.rb
@@ -89,7 +89,7 @@ RSpec.describe StackMaster::RoleAssumer do
end
context 'CloudFormation driver' do
- let(:new_driver) { StackMaster::TestDriver::CloudFormation.new }
+ let(:new_driver) { StackMaster.cloud_formation_driver.class.new }
before do
allow(StackMaster::AwsDriver::CloudFormation).to receive(:new).and_return(new_driver) | Use existing cloudformation driver's class to create new instance
This is needed because the integration tests swap the driver to the test driver
which is needed to run the tests. This ensures the test driver is instantiated. | envato_stack_master | train | rb,rb |
32080b29c727ad2d0100025d3f64c5de1818c0bc | diff --git a/components/value-distribution/src/main/java/org/datacleaner/result/AbstractValueCountingAnalyzerResult.java b/components/value-distribution/src/main/java/org/datacleaner/result/AbstractValueCountingAnalyzerResult.java
index <HASH>..<HASH> 100644
--- a/components/value-distribution/src/main/java/org/datacleaner/result/AbstractValueCountingAnalyzerResult.java
+++ b/components/value-distribution/src/main/java/org/datacleaner/result/AbstractValueCountingAnalyzerResult.java
@@ -53,6 +53,7 @@ public abstract class AbstractValueCountingAnalyzerResult implements ValueCounti
result.remove(null);
result.remove(LabelUtils.NULL_LABEL);
result.remove(LabelUtils.UNEXPECTED_LABEL);
+ result.remove(LabelUtils.UNIQUE_LABEL);
return result;
} | removed 'unique' label from value distribution 'value count' metric | datacleaner_DataCleaner | train | java |
46e7f96c38b6aadb5b79623a16b0708e047efec1 | diff --git a/eZ/Publish/Core/Persistence/Doctrine/ConnectionHandler.php b/eZ/Publish/Core/Persistence/Doctrine/ConnectionHandler.php
index <HASH>..<HASH> 100644
--- a/eZ/Publish/Core/Persistence/Doctrine/ConnectionHandler.php
+++ b/eZ/Publish/Core/Persistence/Doctrine/ConnectionHandler.php
@@ -11,14 +11,14 @@ namespace eZ\Publish\Core\Persistence\Doctrine;
use eZ\Publish\Core\Persistence\Database\DatabaseHandler;
use eZ\Publish\Core\Persistence\Database\QueryException;
-use Doctrine\DBAL\Connection;
+use Doctrine\DBAL\Driver\Connection;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\DBALException;
class ConnectionHandler implements DatabaseHandler
{
/**
- * @var \Doctrine\DBAL\Connection
+ * @var \Doctrine\DBAL\Driver\Connection
*/
protected $connection;
@@ -265,7 +265,7 @@ class ConnectionHandler implements DatabaseHandler
}
/**
- * @param \Doctrine\DBAL\Connection $connection
+ * @param \Doctrine\DBAL\Driver\Connection $connection
*/
public function __construct( Connection $connection )
{ | EZP-<I>: Changed doctrine connection type hint from Doctrine\DBAL\Connection to Doctrine\DBAL\Driver\Connection (interface) | ezsystems_ezpublish-kernel | train | php |
e23077d36063c8afee2d0ad4bd70796a1be4d0a0 | diff --git a/tk_tools/widgets.py b/tk_tools/widgets.py
index <HASH>..<HASH> 100644
--- a/tk_tools/widgets.py
+++ b/tk_tools/widgets.py
@@ -238,11 +238,14 @@ class BinaryLabel(ttk.Label):
"""
Returns the bit value at position
- :param position: integer between 0 and 7, inclusive
+ :param position: integer between 0 and <width>, inclusive
:return: the value at position as a integer
"""
- return self._value & (1 << position)
+ if self._value & (1 << position):
+ return 1
+ else:
+ return 0
def toggle_bit(self, position: int):
""" | Fixing error in BinaryLabel based on testing | slightlynybbled_tk_tools | train | py |
ce88a7112186e5ab38c9a1144baf0f3b524048ad | diff --git a/mass_api_client/resources/sample.py b/mass_api_client/resources/sample.py
index <HASH>..<HASH> 100644
--- a/mass_api_client/resources/sample.py
+++ b/mass_api_client/resources/sample.py
@@ -63,14 +63,13 @@ class IPSample(Sample):
class FileSample(Sample):
schema = FileSampleSchema()
creation_point = 'sample/submit_file'
- default_filters = {'_cls': 'Sample.FileSample'}
+ default_filters = {'_cls__startswith': 'Sample.FileSample'}
filter_parameters = [
'md5sum',
'sha1sum',
'sha256sum',
- 'sha512sum',
- '_cls'
+ 'sha512sum'
]
@classmethod | Also return samples of subclasses | mass-project_mass_api_client | train | py |
373fbda33869aeb1a8a3a13a6aeb319d3839cc63 | diff --git a/src/Zofe/Rapyd/DataForm/Field/Autocomplete.php b/src/Zofe/Rapyd/DataForm/Field/Autocomplete.php
index <HASH>..<HASH> 100644
--- a/src/Zofe/Rapyd/DataForm/Field/Autocomplete.php
+++ b/src/Zofe/Rapyd/DataForm/Field/Autocomplete.php
@@ -26,6 +26,7 @@ class Autocomplete extends Field {
public $parent_id = '';
public $min_chars = '2';
+ public $clause = "where"; | autocomplete should use 'where' instead 'like' on filters | zofe_rapyd-laravel | train | php |
35f6f44447f294fa69a034f63a0dd28092bdb3a8 | diff --git a/intranet/apps/announcements/views.py b/intranet/apps/announcements/views.py
index <HASH>..<HASH> 100644
--- a/intranet/apps/announcements/views.py
+++ b/intranet/apps/announcements/views.py
@@ -101,6 +101,7 @@ def request_announcement_view(request):
ann = AnnouncementRequest.objects.get(id=obj.id)
logger.debug(teacher_objs)
approve_self = False
+ teacher = None
for teacher in teacher_objs:
ann.teachers_requested.add(teacher)
if teacher == request.user:
diff --git a/intranet/apps/api/tests.py b/intranet/apps/api/tests.py
index <HASH>..<HASH> 100644
--- a/intranet/apps/api/tests.py
+++ b/intranet/apps/api/tests.py
@@ -43,6 +43,8 @@ class ApiTest(IonTestCase):
oauth2_settings._SCOPES = ["read", "write"] # pylint: disable=protected-access
+ self.auth = None
+
def make_token(self):
tok = AccessToken.objects.create(
user=self.user, | refactor: assign uninitialized variables to None to make Pylint happy | tjcsl_ion | train | py,py |
75a10894779df9974b01897380c8bd4e65035666 | diff --git a/src/Gallery.js b/src/Gallery.js
index <HASH>..<HASH> 100755
--- a/src/Gallery.js
+++ b/src/Gallery.js
@@ -305,6 +305,7 @@ class Gallery extends Component {
theme={this.props.theme}
onClickThumbnail={this.getOnClickLightboxThumbnailFn()}
showThumbnails={this.props.showLightboxThumbnails}
+ ...this.props.lightBoxProps
/>
</div>
);
@@ -367,7 +368,8 @@ Gallery.propTypes = {
showLightboxThumbnails: PropTypes.bool,
onClickLightboxThumbnail: PropTypes.func,
tagStyle: PropTypes.object,
- thumbnailImageComponent: PropTypes.func
+ thumbnailImageComponent: PropTypes.func,
+ lightBoxProps : PropTypes.object,
};
Gallery.defaultProps = {
@@ -386,6 +388,7 @@ Gallery.defaultProps = {
showImageCount: true,
lightboxWidth: 1024,
showLightboxThumbnails: false,
+ lightBoxProps : {},
};
module.exports = Gallery; | Added extra Prop to add any prop directly to lighbox.
`lightBoxProps`, which is spread over `<LightBox />` component. So It will be easy to add those props to LightBox Directly which are not hardcoded in. | benhowell_react-grid-gallery | train | js |
0598632b4c0355794795253cca66c90a8c50f339 | diff --git a/holoviews/plotting/bokeh/util.py b/holoviews/plotting/bokeh/util.py
index <HASH>..<HASH> 100644
--- a/holoviews/plotting/bokeh/util.py
+++ b/holoviews/plotting/bokeh/util.py
@@ -197,7 +197,7 @@ def compute_static_patch(document, models, json=None):
events.append((priority, event))
update_types[obj['type']].append(key)
- events = [e for _, e in sorted(events)]
+ events = [e for _, e in sorted(events, key=lambda x: x[0])]
value_refs = {ref_id: val for ref_id, val in value_refs.items()
if val['type'] not in IGNORED_MODELS}
return dict(events=events, references=list(value_refs.values())) | Fix bokeh event sorting in py3 | pyviz_holoviews | train | py |
a1ffb9292903f8f05ea44869dd6f159bbd03e42f | diff --git a/Neos.Flow/Classes/ResourceManagement/Target/FileSystemTarget.php b/Neos.Flow/Classes/ResourceManagement/Target/FileSystemTarget.php
index <HASH>..<HASH> 100644
--- a/Neos.Flow/Classes/ResourceManagement/Target/FileSystemTarget.php
+++ b/Neos.Flow/Classes/ResourceManagement/Target/FileSystemTarget.php
@@ -181,7 +181,7 @@ class FileSystemTarget implements TargetInterface
* @param StorageInterface $storage
* @return void
*/
- public function checkAndRemovePackageSymlinks(StorageInterface $storage)
+ protected function checkAndRemovePackageSymlinks(StorageInterface $storage)
{
if (!$storage instanceof PackageStorage) {
return; | Update Neos.Flow/Classes/ResourceManagement/Target/FileSystemTarget.php | neos_flow-development-collection | train | php |
b6d0ff1918157cc31af70cf9d3ffcd7b8829e262 | diff --git a/resources/skins/smoky-grey/krexx.js b/resources/skins/smoky-grey/krexx.js
index <HASH>..<HASH> 100644
--- a/resources/skins/smoky-grey/krexx.js
+++ b/resources/skins/smoky-grey/krexx.js
@@ -564,7 +564,7 @@
* for that file, and not for the server.
*/
krexx.disableForms = function () {
- var elements = document.querySelectorAll('.kwrapper .keditable input, .kwrapper .keditable select');
+ var elements = document.querySelectorAll('.kwrapper .kconfiguration .keditable input , .kwrapper .kconfiguration .keditable select');
for (var i = 0; i < elements.length; i++) {
elements[i].disabled = true;
} | Refined form disabling in case we are facing a file output | brainworxx_kreXX | train | js |
29642cf9dc6dedd69430eb9c89924063196209f7 | diff --git a/pyeda/boolalg/expr.py b/pyeda/boolalg/expr.py
index <HASH>..<HASH> 100644
--- a/pyeda/boolalg/expr.py
+++ b/pyeda/boolalg/expr.py
@@ -2314,7 +2314,6 @@ class ExprITE(Expression):
return max([self.s.depth, self.d1.depth, self.d0.depth]) + 1
def to_nnf(self, conj=False):
- # pylint: disable=W0632
if conj:
# (~s | d1) & (s | d0)
x0 = ExprOr(self.s._inv_nnf(), self.d1.to_nnf())
@@ -2327,7 +2326,6 @@ class ExprITE(Expression):
return ExprOr(x0, x1).simplify()
def _inv_nnf(self, conj=False):
- # pylint: disable=W0632
if conj:
# (~s | ~d1) & (s | ~d1)
x0 = ExprOr(self.s._inv_nnf(), self.d1._inv_nnf()) | Get rid of old pylint rule disables | cjdrake_pyeda | train | py |
df81358b863d2765d62ce84b2cb7895f74558f87 | diff --git a/Grido/Grid.php b/Grido/Grid.php
index <HASH>..<HASH> 100755
--- a/Grido/Grid.php
+++ b/Grido/Grid.php
@@ -663,6 +663,7 @@ class Grid extends Components\Container
public function reload()
{
if ($this->presenter->isAjax()) {
+ $this->presenter->payload->grido = TRUE;
$this->invalidateControl();
} else {
$this->redirect('this'); | Added payload param to identify Grido update | o5_grido | train | php |
8ad2a2f3a5b0f0b311c11209598fcc34d9dc9018 | diff --git a/tests/Common/TriggersTest.php b/tests/Common/TriggersTest.php
index <HASH>..<HASH> 100644
--- a/tests/Common/TriggersTest.php
+++ b/tests/Common/TriggersTest.php
@@ -60,13 +60,6 @@ class TriggersTest extends StorageApiTestCase
],
$trigger['creatorToken']
);
- $this->assertEquals(
- [
- 'id' => $token['admin']['id'],
- 'name' => $token['admin']['name'],
- ],
- $trigger['creatorUser']
- );
}
public function testUpdateTrigger() | TriggersTest fixup: removed creator user | keboola_storage-api-php-client | train | php |
442f0df33b91fced038e2c497e6c03e0f82f55b2 | diff --git a/qtpy/QtTest.py b/qtpy/QtTest.py
index <HASH>..<HASH> 100644
--- a/qtpy/QtTest.py
+++ b/qtpy/QtTest.py
@@ -8,8 +8,6 @@
"""
Provides QtTest and functions
-.. warning:: PySide is not supported here, that's why there is not unit tests
- running with PySide.
"""
from qtpy import PYQT5, PYQT4, PYSIDE, PythonQtError
@@ -25,6 +23,6 @@ elif PYQT4:
def qWaitForWindowActive(QWidget):
OldQTest.qWaitForWindowShown(QWidget)
elif PYSIDE:
- raise ImportError('QtTest support is incomplete for PySide')
+ from PySide.QtTest import QTest
else:
raise PythonQtError('No Qt bindings could be found') | Add support for QTest with PySide | spyder-ide_qtpy | train | py |
b5964519ac4e4a33a1b68567a149ed7fc7674521 | diff --git a/pylint/checkers/typecheck.py b/pylint/checkers/typecheck.py
index <HASH>..<HASH> 100644
--- a/pylint/checkers/typecheck.py
+++ b/pylint/checkers/typecheck.py
@@ -1395,10 +1395,12 @@ accessed. Python regular expressions are accepted.",
# Retrieve node from all previusly visited nodes in the the inference history
context_path_names = filter(None, _unflatten(context.path))
inferred_paths = _flatten_container(
- path.infer() for path in context_path_names
+ safe_infer(path) for path in context_path_names
)
- for inf_path in inferred_paths:
- scope = inf_path.scope()
+ for inferred_path in inferred_paths:
+ if not inferred_path:
+ continue
+ scope = inferred_path.scope()
if not isinstance(scope, astroid.FunctionDef):
continue
if decorated_with(scope, self.config.contextmanager_decorators): | Use safe_infer() when inferring context's paths to prevent the acceptance tests to fail for distutils
Currently this check fails for distutils because one of the `path` objects is an `ImportFrom`
that raises an `InferenceError` when trying to be inferred. | PyCQA_pylint | train | py |
1515fc826b6f3eab13cdc82c5942a4f41fa14785 | diff --git a/views/js/ui/mediaplayer.js b/views/js/ui/mediaplayer.js
index <HASH>..<HASH> 100644
--- a/views/js/ui/mediaplayer.js
+++ b/views/js/ui/mediaplayer.js
@@ -644,9 +644,7 @@ define([
this._destroySlider(this.$seekSlider);
this._destroySlider(this.$volumeSlider);
- if (this.config.renderTo) {
- this.$component.remove();
- }
+ this.$component.remove();
}
this._reset(); | media player: always remove the DOM when destroy | oat-sa_tao-core | train | js |
cf37b77b8048c41bdcbc729faa3a818eb05c335d | diff --git a/src/Carbon/Lang/ar.php b/src/Carbon/Lang/ar.php
index <HASH>..<HASH> 100644
--- a/src/Carbon/Lang/ar.php
+++ b/src/Carbon/Lang/ar.php
@@ -14,6 +14,7 @@
* - Atef Ben Ali (atefBB)
* - Ibrahim AshShohail
* - MLTDev
+ * - Yazan Alnugnugh (yazan-alnugnugh)
*/
$months = [
'يناير',
@@ -38,6 +39,7 @@ return [
'hour' => implode('|', ['ساعة', 'ساعة', 'ساعتين', 'ساعات'.' :count', 'ساعة'.' :count']),
'minute' => implode('|', ['دقيقة', 'دقيقة', 'دقيقتين', 'دقائق'.' :count', 'دقيقة'.' :count']),
'second' => implode('|', ['ثانية', 'ثانية', 'ثانيتين', 'ثوان'.' :count', 'ثانية'.' :count']),
+ 'a_second' => implode('|', ['{1}'.'بضع ثواني', 'ثانية', 'ثانية', 'ثانيتين', 'ثوان'.' :count', 'ثانية'.' :count']),
'ago' => 'منذ :time',
'from_now' => ':time من الآن',
'after' => 'بعد :time', | #<I> Add "a few second" translation in Arabic | briannesbitt_Carbon | train | php |
1a8d9caf8769a5f5d6512aedb5bac09e8ea64561 | diff --git a/couchbase/exceptions.py b/couchbase/exceptions.py
index <HASH>..<HASH> 100644
--- a/couchbase/exceptions.py
+++ b/couchbase/exceptions.py
@@ -75,6 +75,13 @@ class CouchbaseError(Exception):
self.objextra = params.get('objextra', None)
self.message = params.get('message', None)
+
+ @classmethod
+ def pyexc(cls, message=None, obj=None, inner=None):
+ return cls({'message':message,
+ 'objextra':obj,
+ 'inner_cause' : inner})
+
def __str__(self):
extra = "<" | Add nicer wrapper function to throw CouchbaseErrors from python
So we don't have to pass a dict explicitly
Change-Id: I<I>bb3dc7ebd<I>d<I>d<I>a<I>ed<I>
Reviewed-on: <URL> | couchbase_couchbase-python-client | train | py |
Subsets and Splits