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
|
---|---|---|---|---|---|
b942ae836e1fd846e7d59413b6e97ac8192c3069 | diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb
index <HASH>..<HASH> 100644
--- a/activesupport/lib/active_support/dependencies.rb
+++ b/activesupport/lib/active_support/dependencies.rb
@@ -227,7 +227,7 @@ module ActiveSupport #:nodoc:
def load_dependency(file)
if Dependencies.load?
- Dependencies.new_constants_in(Object) { yield }.presence
+ Dependencies.new_constants_in(Object) { yield }
else
yield
end | return value is never tested, so stop calling `presence` | rails_rails | train | rb |
85be0bf028f98c5a1d31c22958fd10811328f371 | diff --git a/lib/puppet/type/user.rb b/lib/puppet/type/user.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/type/user.rb
+++ b/lib/puppet/type/user.rb
@@ -465,7 +465,7 @@ module Puppet
groups = obj.shouldorig if obj
if groups
groups = groups.collect { |group|
- if group =~ /^\d+$/
+ if group.is_a?(String) && group =~/^\d+$/
Integer(group)
else
group | (PUP-<I>) Fix regex warnings introduced in Ruby <I>
Ruby <I> introduced a warning for checking invalid objects (such as
Integer in our case) against a regular expression. The check in this
case would always return nil even though a valid String would respect
the given regular expression, resulting in the possibility of unwanted
behaviour.
This commit replaces the check accordingly in the user type and keeps
previous logic. | puppetlabs_puppet | train | rb |
e1b2523a4cd17193138727c5d972cf5ff2c1a5e6 | diff --git a/redisson-spring-boot-starter/src/main/java/org/redisson/spring/starter/RedissonAutoConfiguration.java b/redisson-spring-boot-starter/src/main/java/org/redisson/spring/starter/RedissonAutoConfiguration.java
index <HASH>..<HASH> 100644
--- a/redisson-spring-boot-starter/src/main/java/org/redisson/spring/starter/RedissonAutoConfiguration.java
+++ b/redisson-spring-boot-starter/src/main/java/org/redisson/spring/starter/RedissonAutoConfiguration.java
@@ -135,6 +135,7 @@ public class RedissonAutoConfiguration {
try {
config = Config.fromJSON(redissonProperties.getConfig());
} catch (IOException e1) {
+ e1.addSuppressed(e);
throw new IllegalArgumentException("Can't parse config", e1);
}
}
@@ -148,6 +149,7 @@ public class RedissonAutoConfiguration {
InputStream is = getConfigStream();
config = Config.fromJSON(is);
} catch (IOException e1) {
+ e1.addSuppressed(e);
throw new IllegalArgumentException("Can't parse config", e1);
}
} | Fixed - SpringBoot yaml configuration parsing errors shouldn't be suppressed. #<I> | redisson_redisson | train | java |
269d891690ce210697f978a1cc8cdef547186cd3 | diff --git a/generators/generator-constants.js b/generators/generator-constants.js
index <HASH>..<HASH> 100644
--- a/generators/generator-constants.js
+++ b/generators/generator-constants.js
@@ -30,7 +30,7 @@ const NPM_VERSION = commonPackageJson.devDependencies.npm;
const OPENAPI_GENERATOR_CLI_VERSION = '1.0.13-4.3.1';
const GRADLE_VERSION = '7.0';
-const JIB_VERSION = '3.0.0';
+const JIB_VERSION = '3.1.0';
// Libraries version
const JHIPSTER_DEPENDENCIES_VERSION = '7.0.2-SNAPSHOT'; | Update jib version to <I> | jhipster_generator-jhipster | train | js |
0dcbf02b7dc8eae189590893093eb60e5920229a | diff --git a/test/serialize.js b/test/serialize.js
index <HASH>..<HASH> 100644
--- a/test/serialize.js
+++ b/test/serialize.js
@@ -50,6 +50,12 @@ test('httpOnly', function() {
});
test('maxAge', function() {
+ assert.throws(function () {
+ cookie.serialize('foo', 'bar', {
+ maxAge: 'buzz'
+ });
+ }, /maxAge should be a Number/);
+
assert.equal('foo=bar; Max-Age=1000', cookie.serialize('foo', 'bar', {
maxAge: 1000
})); | tests: add test for non-number maxAge | jshttp_cookie | train | js |
467524f458707e6d4cb4c5275e79fbfdef99cf6d | diff --git a/core/src/main/java/fi/iki/elonen/NanoHTTPD.java b/core/src/main/java/fi/iki/elonen/NanoHTTPD.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/fi/iki/elonen/NanoHTTPD.java
+++ b/core/src/main/java/fi/iki/elonen/NanoHTTPD.java
@@ -1841,7 +1841,7 @@ public abstract class NanoHTTPD {
InputStream stream = null;
try {
stream = url.openStream();
- properties.load(url.openStream());
+ properties.load(stream);
} catch (IOException e) {
LOG.log(Level.SEVERE, "could not load mimetypes from " + url, e);
} finally { | Fix opening mimetypes twice and only closing first
Found by FindBugs. | NanoHttpd_nanohttpd | train | java |
829b2527f68ac180f234e1ea775f2a2f15284adf | diff --git a/src/main/java/com/mistraltech/smog/core/CompositePropertyMatcher.java b/src/main/java/com/mistraltech/smog/core/CompositePropertyMatcher.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/mistraltech/smog/core/CompositePropertyMatcher.java
+++ b/src/main/java/com/mistraltech/smog/core/CompositePropertyMatcher.java
@@ -59,4 +59,7 @@ public abstract class CompositePropertyMatcher<T> extends PathAwareDiagnosingMat
description.appendText(")");
}
+
+ // TODO Make PropertyMatcher aware of the property accessor
+ // and move implementation of MatchesSafely into here.
} | Add TODO to remove need for each matcher to write their own MatchesSafely
implementation by providing a default superclass implementation. | mistraltechnologies_smog | train | java |
309dd2e993838bff56028633573780f004c780df | diff --git a/util.go b/util.go
index <HASH>..<HASH> 100644
--- a/util.go
+++ b/util.go
@@ -53,7 +53,7 @@ func encryptedChannelPresent(channels []string) bool {
}
func isEncryptedChannel(channel string) bool {
- if strings.HasPrefix(channel, "encrypted-") {
+ if strings.HasPrefix(channel, "private-encrypted-") {
return true
}
return false | update prefix to private-encrypted | pusher_pusher-http-go | train | go |
ad2eb3244ecfd909de1a00fc6c6aa0b8058793fa | diff --git a/src/catalog.js b/src/catalog.js
index <HASH>..<HASH> 100644
--- a/src/catalog.js
+++ b/src/catalog.js
@@ -62,6 +62,7 @@ angular.module('gettext').factory('gettextCatalog', function (gettextPlurals, $h
for (var lang in data) {
catalog.setStrings(lang, data[lang]);
}
+ $rootScope.$broadcast('gettextLanguageChanged');
});
}
}; | Make sure strings get rerendered once loadRemote finishes. | rubenv_angular-gettext | train | js |
17d32ec03c6b3ae6238051b5c197f8131aa78f5a | diff --git a/src/classes/Monad.js b/src/classes/Monad.js
index <HASH>..<HASH> 100644
--- a/src/classes/Monad.js
+++ b/src/classes/Monad.js
@@ -2,6 +2,7 @@
"use strict";
import Component from './Component';
+import Navigation from '../services/Navigation';
let application = undefined;
let registeredComponents = {};
@@ -16,7 +17,8 @@ export default class Monad {
for (let mod in registeredComponents) {
extra.push(mod);
}
- return (application = new Component('monad', deps.concat(extra), configFn));
+ this.name = name;
+ return (application = new Component(this.name, deps.concat(extra), configFn));
}
component(name, deps = [], configFn = undefined) {
@@ -35,6 +37,13 @@ export default class Monad {
throw "Looks like you forget to call monad.application...";
}
application.bootstrap();
+ angular.bootstrap(document, [this.name]);
+ }
+
+ navigation(components, menu = 'main') {
+ components.map(component => {
+ Navigation.register(component.name, menu, '/:language' + component.settings.list.url);
+ });
}
}; | register navigation here (so we can lose the menu option) and use the given name instead of generic "monad" | monomelodies_monad | train | js |
1d2b2b2c8b5bee8f0eea6517e06530aeeaaabf2e | diff --git a/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php b/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php
+++ b/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php
@@ -188,7 +188,6 @@ class ConvertDoctrine1Schema
$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO);
} else if (isset($column['sequence'])) {
$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE);
- $metadata->setSequenceGeneratorDefinition($definition);
$definition = array(
'sequenceName' => is_array($column['sequence']) ? $column['sequence']['name']:$column['sequence']
);
@@ -198,6 +197,7 @@ class ConvertDoctrine1Schema
if (isset($column['sequence']['value'])) {
$definition['initialValue'] = $column['sequence']['value'];
}
+ $metadata->setSequenceGeneratorDefinition($definition);
}
return $fieldMapping;
} | DDC-<I> - Fix undefined variable notice. | doctrine_orm | train | php |
bb90be77b77aa6ec51679b1d1bc37bfa8a0137c8 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index <HASH>..<HASH> 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,9 @@
Changelog Summary
=================
+### v5.4.1
+* Fixed memory leak in `ModelSelect2Mixin` and subclasses
+
### v5.4.0
* Added `Select2TagWidget` a light widget with tagging support
diff --git a/django_select2/__init__.py b/django_select2/__init__.py
index <HASH>..<HASH> 100644
--- a/django_select2/__init__.py
+++ b/django_select2/__init__.py
@@ -9,4 +9,4 @@ The app includes Select2 driven Django Widgets and Form Fields.
"""
-__version__ = "5.4.0"
+__version__ = "5.4.1"
diff --git a/django_select2/forms.py b/django_select2/forms.py
index <HASH>..<HASH> 100644
--- a/django_select2/forms.py
+++ b/django_select2/forms.py
@@ -351,7 +351,7 @@ class ModelSelect2Mixin(object):
:return: Filtered queryset
:rtype: :class:`.django.db.models.QuerySet`
"""
- if not queryset:
+ if queryset is None:
queryset = self.get_queryset()
search_fields = self.get_search_fields()
select = Q() | Fixed #<I> -- Avoid fetching entire queryset from db
Patched ciritcal memory leak in ModelSelect2 widgets.
Boolean evaluation of queryset makes django fetch all
elements. | applegrew_django-select2 | train | md,py,py |
f75a8f9aa974708bec31f8b9e1298bf2f2f0b239 | diff --git a/core/server/web/shared/middlewares/uncapitalise.js b/core/server/web/shared/middlewares/uncapitalise.js
index <HASH>..<HASH> 100644
--- a/core/server/web/shared/middlewares/uncapitalise.js
+++ b/core/server/web/shared/middlewares/uncapitalise.js
@@ -28,7 +28,7 @@ const uncapitalise = (req, res, next) => {
pathToTest = isSignupOrReset[1];
}
- // Do not lowercase anything after e.g. /api/v0.1/ to protect :key/:slug
+ // Do not lowercase anything after e.g. /api/v{X}/ to protect :key/:slug
if (isAPI) {
pathToTest = isAPI[1];
} | Reworded confusing comment mentioning <I> | TryGhost_Ghost | train | js |
ddf97ac0e8fa3fa78c51ea3225951d62bd4c94cb | diff --git a/spec/lib/collection_shared_spec.rb b/spec/lib/collection_shared_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/collection_shared_spec.rb
+++ b/spec/lib/collection_shared_spec.rb
@@ -765,7 +765,7 @@ share_examples_for 'A Collection' do
describe 'with a key to a Resource not within the Collection' do
before do
- @return = @articles.get(99)
+ @return = @articles.get(*@other.key)
end
it 'should return nil' do | Updated spec to use an existing record outside the Collection | datamapper_dm-core | train | rb |
757d2a9fb3457ee261b871cad17d14c67324c6e5 | diff --git a/spec/pagseguro/transaction/serializer_spec.rb b/spec/pagseguro/transaction/serializer_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/pagseguro/transaction/serializer_spec.rb
+++ b/spec/pagseguro/transaction/serializer_spec.rb
@@ -1,3 +1,4 @@
+# -*- encoding: utf-8 -*-
require "spec_helper"
describe PagSeguro::Transaction::Serializer do | Added magic comment for Ruby <I>. | pagseguro_ruby | train | rb |
8e986122dfdd9b0936e7b6bcfd6f665e8cea0f9f | diff --git a/src/Base/Register.php b/src/Base/Register.php
index <HASH>..<HASH> 100644
--- a/src/Base/Register.php
+++ b/src/Base/Register.php
@@ -87,7 +87,7 @@ class Register
}
if ($object) {
- self::setClassCounter(self::name2code($name));
+ self::_setClassCounter(self::name2code($name));
}
self::callEvent('register_get_object_after', [$name, $args, $object]);
@@ -210,7 +210,7 @@ class Register
*
* @return array
*/
- public function getRegisteredObjects()
+ public static function getRegisteredObjects()
{
$list = [];
foreach (self::$_singletons->getData() as $name => $class) {
@@ -236,7 +236,7 @@ class Register
* @param string $class
* @return Register
*/
- public static function setClassCounter($class)
+ protected static function _setClassCounter($class)
{
self::$_classCounter[$class] += 1;
} | fixed method definition
This version introduces multiple enhancements:
all methods converted to static
Details of additions/deletions below:
--------------------------------------------------------------
Modified: Base/Register.php
-- Updated --
getObject renamed used method
getRegisteredObjects converted to static
setClassCounter converted to static and renamed to _setClassCounter | bluetree-service_container | train | php |
b215ccc602ab542ca274cec91d615829dc32c23b | diff --git a/src/Compiler/AbstractCompiler.php b/src/Compiler/AbstractCompiler.php
index <HASH>..<HASH> 100644
--- a/src/Compiler/AbstractCompiler.php
+++ b/src/Compiler/AbstractCompiler.php
@@ -41,6 +41,7 @@ class {$parameters['className']} implements Executor
$extraCode
+ // $rule
protected function execute(\$target, array \$operators, array \$parameters)
{
return {$executorModel->getCompiledRule()}; | Dump the original rule in the compiled code comments | K-Phoen_rulerz | train | php |
7278b90fe1c2e33c729951f44f027ebbb0290909 | diff --git a/xl-v1-bucket.go b/xl-v1-bucket.go
index <HASH>..<HASH> 100644
--- a/xl-v1-bucket.go
+++ b/xl-v1-bucket.go
@@ -178,7 +178,7 @@ func (xl xlObjects) DeleteBucket(bucket string) error {
}
nsMutex.Lock(bucket, "")
- nsMutex.Unlock(bucket, "")
+ defer nsMutex.Unlock(bucket, "")
// Collect if all disks report volume not found.
var volumeNotFoundErrCnt int | Adding defer to the lock (#<I>) | minio_minio | train | go |
3901aa43f1abe12e99d00f4d97777f28957ae545 | diff --git a/i3pystatus/core/util.py b/i3pystatus/core/util.py
index <HASH>..<HASH> 100644
--- a/i3pystatus/core/util.py
+++ b/i3pystatus/core/util.py
@@ -3,6 +3,7 @@ import functools
import re
import socket
import string
+from colour import Color
def lchop(string, prefix):
@@ -423,3 +424,29 @@ def user_open(url_or_command):
import subprocess
subprocess.Popen(url_or_command, shell=True)
+
+def get_hex_color_range(start_color, end_color, quantity):
+ """
+ Generates a list of quantity Hex colors from start_color to end_color.
+
+ :param start_color: Hex or plain English color for start of range
+ :param end_color: Hex or plain English color for end of range
+ :param quantity: Number of colours to return
+ :return: A list of Hex color values
+ """
+ raw_colors = [c.hex for c in list(Color(start_color).range_to(Color(end_color), quantity))]
+ colors = []
+ for color in raw_colors:
+
+ # i3bar expects the full Hex value but for some colors the colour
+ # module only returns partial values. So we need to convert these colors to the full
+ # Hex value.
+ if len(color) == 4:
+ fixed_color = "#"
+ for c in color[1:]:
+ fixed_color += c * 2
+ colors.append(fixed_color)
+ else:
+ colors.append(color)
+ return colors
+ | Added method to generate a list of hex color values between a start
color and end color. | enkore_i3pystatus | train | py |
ccae04f083369017ff69d491e920b3aff7c3e678 | diff --git a/esri2geo.py b/esri2geo.py
index <HASH>..<HASH> 100644
--- a/esri2geo.py
+++ b/esri2geo.py
@@ -273,7 +273,8 @@ def toGeoJSON(featureClass, outJSON,includeGeometry="true"):
i+=1
iPercent=statusMessage(featureCount,i,iPercent)
fc={"type": "Feature"}
- fc["geometry"]=parseGeo(row.getValue(shp))
+ if fileType=="geojson" or includeGeometry:
+ fc["geometry"]=parseGeo(row.getValue(shp))
fc["id"]=row.getValue(oid)
fc["properties"]=parseProp(row,fields, shp)
if fileType=="geojson": | don't parse geometry if we don't need it | calvinmetcalf_esri2geo | train | py |
9485a1b809e31733eac144eb40527be06766d634 | diff --git a/lib/fastlane/actions/deliver.rb b/lib/fastlane/actions/deliver.rb
index <HASH>..<HASH> 100644
--- a/lib/fastlane/actions/deliver.rb
+++ b/lib/fastlane/actions/deliver.rb
@@ -1,7 +1,7 @@
module Fastlane
module Actions
module SharedValues
- DELIVER_IPA_PATH = :DELIVER_IPA_PATH
+
end
class DeliverAction
@@ -20,7 +20,7 @@ module Fastlane
is_beta_ipa: beta,
skip_deploy: skip_deploy)
- ENV[Actions::SharedValues::DELIVER_IPA_PATH.to_s] = ENV["DELIVER_IPA_PATH"] # deliver will store it in the environment
+ Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] = ENV["DELIVER_IPA_PATH"] # deliver will store it in the environment
end
end
end | deliver action now stores the path to the ipa in IPA_OUTPUT_PATH as well | fastlane_fastlane | train | rb |
64c8dd325226569bfdb6114ddc9a752cbc4e4033 | diff --git a/registry/proxy/proxyblobstore.go b/registry/proxy/proxyblobstore.go
index <HASH>..<HASH> 100644
--- a/registry/proxy/proxyblobstore.go
+++ b/registry/proxy/proxyblobstore.go
@@ -55,6 +55,8 @@ func (pbs *proxyBlobStore) copyContent(ctx context.Context, dgst digest.Digest,
return distribution.Descriptor{}, err
}
+ defer remoteReader.Close()
+
_, err = io.CopyN(writer, remoteReader, desc.Size)
if err != nil {
return distribution.Descriptor{}, err | when deploy registry as a pull through cache ,function copeContent() may cause a socket leak when docker user canceled its pull operation. | docker_distribution | train | go |
cb43880926404cc4e1cab38e81f0ea7f5bf37b10 | diff --git a/src/aria/templates/TemplateCtxt.js b/src/aria/templates/TemplateCtxt.js
index <HASH>..<HASH> 100644
--- a/src/aria/templates/TemplateCtxt.js
+++ b/src/aria/templates/TemplateCtxt.js
@@ -496,8 +496,7 @@
/**
* Tries to find the widget id based on an HTML element, if no id can be found then null is returned.
- * @param {HTMLElement} element which is a part of a widget that the id needs to be retrieved for. return
- * {Array} contains widgetId, and templateIds of each parent.
+ * @param {HTMLElement} element which is a part of a widget that the id needs to be retrieved for.
* @return {Array} contains ids for the widget and templates that make the focused widget path.
*/
_getWidgetPath : function (element) {
@@ -1403,7 +1402,7 @@
/**
* Focus a widget with a specified id programmatically. This method can be called from templates and
* template scripts. If the focus fails, an error is thrown.
- * @param {MultiTypes} string or an object containing a path of ids of the widget to focus
+ * @param {String|Array} containing a path of ids of the widget to focus
* @implements aria.templates.ITemplate
*/
$focus : function (idArray) { | Update to jsdoc relates to issue #<I> | ariatemplates_ariatemplates | train | js |
3983f2dcefd078ddc53d4ca2d3e3af8163489141 | diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php
index <HASH>..<HASH> 100644
--- a/mod/lesson/locallib.php
+++ b/mod/lesson/locallib.php
@@ -70,7 +70,7 @@ define("LESSON_MAX_EVENT_LENGTH", "432000");
* This function is only executed when a teacher is
* checking the navigation for a lesson.
*
- * @param int $lesson Id of the lesson that is to be checked.
+ * @param stdClass $lesson Id of the lesson that is to be checked.
* @return boolean True or false.
**/
function lesson_display_teacher_warning($lesson) {
@@ -941,6 +941,8 @@ class lesson extends lesson_base {
* @return lesson
*/
public static function load($lessonid) {
+ global $DB;
+
if (!$lesson = $DB->get_record('lesson', array('id' => $lessonid))) {
print_error('invalidcoursemodule');
}
@@ -1114,7 +1116,7 @@ class lesson extends lesson_base {
* @return bool
*/
public function get_next_page($nextpageid) {
- global $USER;
+ global $USER, $DB;
$allpages = $this->load_all_pages();
if ($this->properties->nextpagedefault) {
// in Flash Card mode...first get number of retakes | added missing globals, strange this seemed to work.... | moodle_moodle | train | php |
0d196a5921a8b87e9eeade020954f14f1ac170d5 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -87,9 +87,21 @@ setup(
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
+ 'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
+ 'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
+ 'Topic :: Scientific/Engineering',
+ 'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
+ 'Topic :: Software Development',
+ 'Topic :: Software Development :: Libraries',
+ 'Topic :: Software Development :: Libraries :: Python Modules',
],
- keywords='tensorflow probability bayesian machine learning',
+ keywords='tensorflow probability statistics bayesian machine learning',
) | Add Trove classifiers for supported Python versions and some other info (following TensorFlow).
PiperOrigin-RevId: <I> | tensorflow_probability | train | py |
fb3db2ed4da2cd96daa2804824c18da31ef3c58c | diff --git a/tests/test_PGPKeyCollection.py b/tests/test_PGPKeyCollection.py
index <HASH>..<HASH> 100644
--- a/tests/test_PGPKeyCollection.py
+++ b/tests/test_PGPKeyCollection.py
@@ -1 +1,20 @@
import pytest
+from pgpy.key import PGPKeyCollection
+
+keys = [
+ "tests/testdata/debutils.key",
+ "tests/testdata/debutils.gpg",
+ "tests/testdata/debutils.sec.gpg"
+]
+keyids = [
+ "ascii",
+ "gpg-public",
+ "gpg-private"
+]
[email protected](params=keys, ids=keyids)
+def load_key(request):
+ return PGPKeyCollection(request.param)
+
+
+class TestPGPKeyLoader:
+ pass
\ No newline at end of file | added some skeleton to test_PGPKeyCollection, for later | SecurityInnovation_PGPy | train | py |
1a8e6f2f3b164ee092b08846c2427d3e55cde228 | diff --git a/src/test/java/org/roaringbitmap/TestRunContainer.java b/src/test/java/org/roaringbitmap/TestRunContainer.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/roaringbitmap/TestRunContainer.java
+++ b/src/test/java/org/roaringbitmap/TestRunContainer.java
@@ -32,12 +32,6 @@ public class TestRunContainer {
rc.iremove(0, 1<<20);
}
- @Test(expected = IllegalArgumentException.class)
- public void iremoveInvalidRange2() {
- Container rc = new RunContainer();
- rc.remove(0, 1<<20);
- }
-
@Test
public void iremove1() {
Container rc = new RunContainer();
@@ -659,11 +653,7 @@ public class TestRunContainer {
}
@Test(expected = IllegalArgumentException.class)
-<<<<<<< HEAD
public void iaddRangeInvalid2() {
-=======
- public void iaddInvalidRange2() {
->>>>>>> 1cd8ee05bb1a6ecd800af2be454b688a25557651
Container rc = new RunContainer();
rc.iadd(0, 1<<20);
} | fixed a merge bug, I think | RoaringBitmap_RoaringBitmap | train | java |
d5d939412e1b53576e1c2b650febe0c732ec70c7 | diff --git a/src/GameQ/Filters/Normalize.php b/src/GameQ/Filters/Normalize.php
index <HASH>..<HASH> 100644
--- a/src/GameQ/Filters/Normalize.php
+++ b/src/GameQ/Filters/Normalize.php
@@ -74,7 +74,7 @@ class Normalize extends Base
if (isset($result['teams']) && count($result['teams']) > 0) {
// Iterate
foreach ($result['teams'] as $key => $team) {
- $result['teams'][$key] = array_merge($team, $this->check('teams', $team));
+ $result['teams'][$key] = array_merge($team, $this->check('team', $team));
}
} else {
$result['teams'] = [ ]; | Fixed normalize bug in team filtering. | Austinb_GameQ | train | php |
4a853d74c15c3b30a0a98127a77b9021c74d8dcc | diff --git a/aws/resource_aws_service_discovery_public_dns_namespace_test.go b/aws/resource_aws_service_discovery_public_dns_namespace_test.go
index <HASH>..<HASH> 100644
--- a/aws/resource_aws_service_discovery_public_dns_namespace_test.go
+++ b/aws/resource_aws_service_discovery_public_dns_namespace_test.go
@@ -43,9 +43,9 @@ func testSweepServiceDiscoveryPublicDnsNamespaces(region string) error {
},
}
- err = conn.ListNamespacesPages(input, func(page *servicediscovery.ListNamespacesOutput, isLast bool) bool {
+ err = conn.ListNamespacesPages(input, func(page *servicediscovery.ListNamespacesOutput, lastPage bool) bool {
if page == nil {
- return !isLast
+ return !lastPage
}
for _, namespace := range page.Namespaces {
@@ -78,7 +78,7 @@ func testSweepServiceDiscoveryPublicDnsNamespaces(region string) error {
}
}
- return !isLast
+ return !lastPage
})
if testSweepSkipSweepError(err) { | tests/r/service_discovery_public_dns_namespace: Use consistent var name | terraform-providers_terraform-provider-aws | train | go |
20b274710f116a668cc545a638c23fdcf81c8616 | diff --git a/salt/runners/manage.py b/salt/runners/manage.py
index <HASH>..<HASH> 100644
--- a/salt/runners/manage.py
+++ b/salt/runners/manage.py
@@ -11,6 +11,7 @@ import re
import subprocess
import tempfile
import time
+import urllib.request
import uuid
import salt.client
@@ -24,7 +25,6 @@ import salt.utils.versions
import salt.version
import salt.wheel
from salt.exceptions import SaltClientError, SaltSystemExit
-from salt.ext.six.moves.urllib.request import urlopen as _urlopen
FINGERPRINT_REGEX = re.compile(r"^([a-f0-9]{2}:){15}([a-f0-9]{2})$")
@@ -793,7 +793,7 @@ def bootstrap_psexec(
if not installer_url:
base_url = "https://repo.saltstack.com/windows/"
- source = _urlopen(base_url).read()
+ source = urllib.request.urlopen(base_url).read()
salty_rx = re.compile(
'>(Salt-Minion-(.+?)-(.+)-Setup.exe)</a></td><td align="right">(.*?)\\s*<'
) | Drop Py2 and six on salt/runners/manage.py | saltstack_salt | train | py |
4b803f6bd6c3fad99fe3139a4ab206f6fde25f34 | diff --git a/github/github_test.go b/github/github_test.go
index <HASH>..<HASH> 100644
--- a/github/github_test.go
+++ b/github/github_test.go
@@ -91,7 +91,7 @@ type values map[string]string
func testFormValues(t *testing.T, r *http.Request, values values) {
want := url.Values{}
for k, v := range values {
- want.Add(k, v)
+ want.Set(k, v)
}
r.ParseForm() | Use Values.Set over Values.Add in testFormValues.
The parameter values of testFormValues function has underlying type
map[string]string. That means each key is going to be a unique string,
there can not be two entries in the map with the same key in values.
Therefore, it's sufficient and equivalent to use Values.Set instead of
Values.Add when converting values map to url.Values type.
Prefer using Values.Set because simpler and easier to reason about. | google_go-github | train | go |
241b8e3058ca2a95c15e4618f466d735eb253f3f | diff --git a/src/main/java/org/dasein/cloud/cloudstack/network/Network.java b/src/main/java/org/dasein/cloud/cloudstack/network/Network.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/dasein/cloud/cloudstack/network/Network.java
+++ b/src/main/java/org/dasein/cloud/cloudstack/network/Network.java
@@ -317,7 +317,7 @@ public class Network extends AbstractVLANSupport {
throw new InternalException("No context was established");
}
CSMethod method = new CSMethod(cloudstack);
- Document doc = method.get(method.buildUrl(Network.LIST_NETWORKS, new Param("zoneId", ctx.getRegionId())), Network.LIST_NETWORKS);
+ Document doc = method.get(method.buildUrl(Network.LIST_NETWORKS, new Param("zoneId", ctx.getRegionId()), new Param("canusefordeploy", "true")), Network.LIST_NETWORKS);
ArrayList<VLAN> networks = new ArrayList<VLAN>();
int numPages = 1; | only return usable networks for vm deployment | greese_dasein-cloud-cloudstack | train | java |
77e760f8f8aa35927435a317d55e6fbab290db86 | diff --git a/lib/ruby-box/client.rb b/lib/ruby-box/client.rb
index <HASH>..<HASH> 100644
--- a/lib/ruby-box/client.rb
+++ b/lib/ruby-box/client.rb
@@ -113,7 +113,7 @@ module RubyBox
end
def fmt_events_args(stream_position, stream_type, limit)
- unless stream_position == 'now'
+ unless stream_position.to_s == 'now'
stream_position = stream_position.kind_of?(Numeric) ? stream_position : 0
end
stream_type = [:all, :changes, :sync].include?(stream_type) ? stream_type : :all | allow a user to pass in the symbol :now or 'now' | attachmentsme_ruby-box | train | rb |
3ee5ad9fb27971f96c1eafc55e49cebc723a306d | diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js
index <HASH>..<HASH> 100644
--- a/converters/fromZigbee.js
+++ b/converters/fromZigbee.js
@@ -1479,6 +1479,13 @@ const converters = {
'2': 'dig-in',
};
+ let ds18b20Id = null;
+ let ds18b20Value = null;
+ if (msg.data.data['41368']) {
+ ds18b20Id = msg.data.data['41368'].split(':')[0];
+ ds18b20Value = precisionRound(msg.data.data['41368'].split(':')[1], 2);
+ }
+
return {
state: msg.data.data['onOff'] === 1 ? 'ON' : 'OFF',
cpu_temperature: precisionRound(msg.data.data['41361'], 2),
@@ -1488,6 +1495,7 @@ const converters = {
adc_volt: precisionRound(msg.data.data['41365'], 3),
dig_input: msg.data.data['41366'],
reason: lookup[msg.data.data['41367']],
+ [`${ds18b20Id}`]: ds18b20Value,
};
},
}, | support new data-field of ZigUP (#<I>)
* support new data-field of ZigUP
* satisfy travis | Koenkk_zigbee-shepherd-converters | train | js |
8564fa8fd04802c0a110a34b6885942698ab12d8 | diff --git a/components/select/select__filter.js b/components/select/select__filter.js
index <HASH>..<HASH> 100644
--- a/components/select/select__filter.js
+++ b/components/select/select__filter.js
@@ -9,6 +9,8 @@ import styles from './select-popup.css';
function noop() {}
+const FOCUS_TIMEOUT_HACK = 100;
+
export default class SelectFilter extends Component {
static propTypes = {
placeholder: PropTypes.string,
@@ -22,7 +24,7 @@ export default class SelectFilter extends Component {
};
componentDidMount() {
- setTimeout(() => this.focus());
+ setTimeout(() => this.focus(), FOCUS_TIMEOUT_HACK);
}
componentWillUnmount() { | RG-<I> hack for focus on not yet positioned dropdown | JetBrains_ring-ui | train | js |
2af461a6e8d0ace7d1f7d70a804d7480e491e82b | diff --git a/wafer/tickets/tests/test_views.py b/wafer/tickets/tests/test_views.py
index <HASH>..<HASH> 100644
--- a/wafer/tickets/tests/test_views.py
+++ b/wafer/tickets/tests/test_views.py
@@ -250,6 +250,22 @@ class TicketsViewSetTests(TestCase):
self.assertEqual(ticket.type, ticket_type)
self.assertEqual(ticket.user, None)
+ def test_create_ticket_without_barcode(self):
+ ticket_type = TicketType.objects.create(name="Test Type 1")
+ response = self.client.post(
+ "/tickets/api/tickets/",
+ data={
+ "email": "[email protected]",
+ "type": ticket_type.id,
+ "user": None,
+ },
+ format="json",
+ )
+ self.assertEqual(response.status_code, 400)
+ self.assertEqual(response.json(), [
+ "barcode required during ticket creation"])
+ self.assertEqual(Ticket.objects.count(), 0)
+
def test_update_ticket(self):
ticket_type_1 = TicketType.objects.create(name="Test Type 1")
ticket_type_2 = TicketType.objects.create(name="Test Type 1") | Add test for attempting to create a ticket without a barcode. | CTPUG_wafer | train | py |
1eb29a0412b635cbe5edd4895c22c94dc72e251a | diff --git a/dynaconf/utils/files.py b/dynaconf/utils/files.py
index <HASH>..<HASH> 100644
--- a/dynaconf/utils/files.py
+++ b/dynaconf/utils/files.py
@@ -28,7 +28,7 @@ def _walk_to_root(path, break_at=None):
return paths
-SEARCHTREE = None
+SEARCHTREE = []
def find_file(filename=".env", project_root=None, skip_files=None, **kwargs):
@@ -63,7 +63,7 @@ def find_file(filename=".env", project_root=None, skip_files=None, **kwargs):
search_tree = deduplicate(search_tree)
global SEARCHTREE
- SEARCHTREE = search_tree
+ SEARCHTREE[:] = search_tree
for dirname in search_tree:
check_path = os.path.join(dirname, filename) | Allow importing SEARCHTREE before settings are configured (#<I>) | rochacbruno_dynaconf | train | py |
dc391a1bae5c66de8b6c2eb6754f7bc8556263e8 | diff --git a/network.js b/network.js
index <HASH>..<HASH> 100644
--- a/network.js
+++ b/network.js
@@ -1080,6 +1080,8 @@ function addWatchedAddress(address){
function notifyWatchers(objJoint){
var objUnit = objJoint.unit;
var arrAddresses = objUnit.authors.map(function(author){ return author.address; });
+ if (!objUnit.messages) // voided unit
+ return;
for (var i=0; i<objUnit.messages.length; i++){
var message = objUnit.messages[i];
if (message.app !== "payment" || !message.payload) | do not notify watchers about voided units | byteball_ocore | train | js |
eb9aceddfcb165771a97dd99d59f95e53bdcb419 | diff --git a/setup/auxi4py/copy_distribution_files.py b/setup/auxi4py/copy_distribution_files.py
index <HASH>..<HASH> 100644
--- a/setup/auxi4py/copy_distribution_files.py
+++ b/setup/auxi4py/copy_distribution_files.py
@@ -75,7 +75,7 @@ def deleteFileOrFolder(directory):
#patchelf_path = sys.argv[1]
#if patchelf_path == "":
# patchelf_path = input('Enter the path to the patchelf executable: ')
-patchelf_path = "/hometravis/.local/bin/patchelf"
+patchelf_path = "/home/travis/.local/bin/patchelf"
# create path strings
project_path = os.path.dirname(os.path.abspath(__file__))
dep_path_auxi = os.path.join(project_path, 'auxi') | Installing patchelf in travis for successfully building the setup. | Ex-Mente_auxi.0 | train | py |
a87fc34a84a893b86d5ccb401d3bd4b9e544bfc2 | diff --git a/lib/oxidized/input/ssh.rb b/lib/oxidized/input/ssh.rb
index <HASH>..<HASH> 100644
--- a/lib/oxidized/input/ssh.rb
+++ b/lib/oxidized/input/ssh.rb
@@ -73,12 +73,12 @@ module Oxidized
@output
end
- private
-
def pty_options hash
@pty_options = @pty_options.merge hash
end
+ private
+
def disconnect
disconnect_cli
# if disconnect does not disconnect us, give up after timeout | it shouldn't be a private method | ytti_oxidized | train | rb |
9145be89c1a5ba1a2c47bfeef571d40b9eb060bc | diff --git a/test/integration/test_user_args.py b/test/integration/test_user_args.py
index <HASH>..<HASH> 100644
--- a/test/integration/test_user_args.py
+++ b/test/integration/test_user_args.py
@@ -1,3 +1,5 @@
+from six import assertRegex
+
from . import *
@@ -17,3 +19,20 @@ class TestUserArgs(IntegrationTest):
self.configure(extra_args=['--name=foo'])
self.build(executable('simple'))
self.assertOutput([executable('simple')], 'hello from foo!\n')
+
+ def test_help(self):
+ os.chdir(self.srcdir)
+ output = self.assertPopen(
+ ['bfg9000', 'help', 'configure']
+ )
+ assertRegex(self, output, r'(?m)^project-defined arguments:$')
+ assertRegex(self, output,
+ r'(?m)^\s+--name NAME\s+set the name to greet$')
+
+ def test_help_explicit_srcdir(self):
+ output = self.assertPopen(
+ ['bfg9000', 'help', 'configure', self.srcdir]
+ )
+ assertRegex(self, output, r'(?m)^project-defined arguments:$')
+ assertRegex(self, output,
+ r'(?m)^\s+--name NAME\s+set the name to greet$') | Add integration test for user-args help | jimporter_bfg9000 | train | py |
f6339e25af801f6b9564c16b5735972f04680b29 | diff --git a/pymatgen/core/tests/test_trajectory.py b/pymatgen/core/tests/test_trajectory.py
index <HASH>..<HASH> 100644
--- a/pymatgen/core/tests/test_trajectory.py
+++ b/pymatgen/core/tests/test_trajectory.py
@@ -15,7 +15,6 @@ class TrajectoryTest(PymatgenTest):
def setUp(self):
xdatcar = Xdatcar(os.path.join(test_dir, "Traj_XDATCAR"))
- # self.traj = Trajectory.from_structures(xdatcar.structures, const_lattice=True)
self.traj = Trajectory.from_file(os.path.join(test_dir, "Traj_XDATCAR"))
self.structures = xdatcar.structures | Remove commented line in test_trajectory | materialsproject_pymatgen | train | py |
017d3ff42430e489040a920720d286f4affe9412 | diff --git a/src/ColumnSortable/SortableLink.php b/src/ColumnSortable/SortableLink.php
index <HASH>..<HASH> 100644
--- a/src/ColumnSortable/SortableLink.php
+++ b/src/ColumnSortable/SortableLink.php
@@ -58,7 +58,7 @@ class SortableLink
$queryString = http_build_query(
array_merge(
$queryParameters,
- array_filter(Request::except('sort', 'order', 'page')),
+ array_filter(Request::except('sort', 'order', 'page'), 'strlen'),
[
'sort' => $sortParameter,
'order' => $direction, | Allow columns that have value of 0 to be present
Since array filter considers 0= false, and '0' = false, if you have a column with values 0 and 1, you can't sort that column, as it will be filtered out.
using the strlen filter, you ensure that values like null,empty and false are removed, but you keep values that would be boolean false in php, but they shouldn't. | Kyslik_column-sortable | train | php |
c7e4f05b46ea0ab158de3e05dbf9619fa5cf354f | diff --git a/anonymoususage/tables/statistic.py b/anonymoususage/tables/statistic.py
index <HASH>..<HASH> 100644
--- a/anonymoususage/tables/statistic.py
+++ b/anonymoususage/tables/statistic.py
@@ -26,7 +26,8 @@ class Statistic(Table):
dt = datetime.datetime.now().strftime(self.time_fmt)
count = self.count + i
try:
- insert_row(self.tracker.dbcon, self.name, self.tracker.uuid, count, dt)
+ with Table.lock:
+ insert_row(self.tracker.dbcon, self.name, self.tracker.uuid, count, dt)
except sqlite3.Error as e:
logger.error(e)
else:
diff --git a/anonymoususage/tables/table.py b/anonymoususage/tables/table.py
index <HASH>..<HASH> 100644
--- a/anonymoususage/tables/table.py
+++ b/anonymoususage/tables/table.py
@@ -4,6 +4,7 @@ import logging
from anonymoususage.tools import *
from anonymoususage.exceptions import *
+from threading import RLock
logger = logging.getLogger('AnonymousUsage')
@@ -14,6 +15,7 @@ class Table(object):
IPC_COMMANDS = {'GET': ('count',),
'SET': (),
'ACT': ()}
+ lock = RLock()
def __init__(self, name, tracker):
if ' ' in name: | added an RLock that can be used around database operations (specifically useful for standalone with multiple connections) | lobocv_anonymoususage | train | py,py |
5472cdc265dca1e975f4446d453b8aa3ce637833 | diff --git a/Database/Model.php b/Database/Model.php
index <HASH>..<HASH> 100644
--- a/Database/Model.php
+++ b/Database/Model.php
@@ -232,7 +232,7 @@ class Model
// Make sure we haven't already fetched
// the tables schema.
if (static::$_schema[static::$_table] === null) {
- $result = static::connection()->prepare("DESCRIBE `" . static::$_table . "`")->exec();
+ $result = static::connection()->prepare("DESCRIBE `{prefix}" . static::$_table . "`")->exec();
foreach ($result->fetchAll(\PDO::FETCH_COLUMN) as $column) {
static::$_schema[static::$_table][$column['Field']] = [
'type' => $column['Type'], | Fixed issue with models and table prefixes. | nirix_radium | train | php |
085c4e7aed6bacefee732a594ddf89170bc8adc8 | diff --git a/lib/utils/editor.rb b/lib/utils/editor.rb
index <HASH>..<HASH> 100644
--- a/lib/utils/editor.rb
+++ b/lib/utils/editor.rb
@@ -165,7 +165,7 @@ module Utils
end
def edit_remote_file(*filenames)
- if wait?
+ if gui && wait?
edit_remote_wait(*filenames)
else
edit_remote(*filenames) | Only wait if a gui is available. | flori_utils | train | rb |
1fee25e78a98b707c95252227d7671b85b32a966 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -142,7 +142,7 @@ Glance.prototype.serveRequest = function Glance$serveRequest (req, res) {
listing.on('end', function () {
renderPage('Directory Listing', listingHtml, res)
- })
+ })
return self.emit('read', request)
}
@@ -184,7 +184,7 @@ function errorTitle (errorCode) {
'403': 'Forbidden',
'405': 'Method Not Allowed',
'500': 'Internal Server Error'
- }
+ }
return mappings['' + errorCode]
} | oh cool i can test right from the repo | jarofghosts_glance | train | js |
193b39177f79d2d616daab5c7da3a3146f725986 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -19,7 +19,7 @@ setup(
"pycryptodome",
"lxml",
# FIXME python2
- future
+ "future"
],
include_package_data=True
) | Update setup.py (#<I>)
Minor bugfix | pschmitt_pykeepass | train | py |
f3ef86df7c359531d3f64415a8ab6fee6ac25451 | diff --git a/js/bootstrap-select.js b/js/bootstrap-select.js
index <HASH>..<HASH> 100644
--- a/js/bootstrap-select.js
+++ b/js/bootstrap-select.js
@@ -2269,8 +2269,6 @@
},
checkDisabled: function () {
- var that = this;
-
if (this.isDisabled()) {
this.$newElement[0].classList.add(classNames.DISABLED);
this.$button.addClass(classNames.DISABLED).attr('tabindex', -1).attr('aria-disabled', true); | remove unnecessary var that declaration (#<I>) | snapappointments_bootstrap-select | train | js |
405ce3e4c2d71627cefa0040b07c99b063d90a42 | diff --git a/lib/db/mongodb.js b/lib/db/mongodb.js
index <HASH>..<HASH> 100644
--- a/lib/db/mongodb.js
+++ b/lib/db/mongodb.js
@@ -5,7 +5,6 @@
*/
module.exports = (function(){
'use strict';
-
var db = {},
config = require('../config'),
event = require('../event'),
@@ -34,6 +33,7 @@ module.exports = (function(){
// When successfully connected
mongoose.connection.on('connected', function () {
+ require('../utils/typeCache');
logger.info(strings.group('notice').db_connected);
event.emit('start', { system: 'db' } );
}); | MOved loading type cache to when the db is loaded. | grasshopper-cms_grasshopper-core-nodejs | train | js |
1ab387bec42866ae204894f1fc2f0dd7fa3a75c7 | diff --git a/azkaban-common/src/main/java/azkaban/executor/ExecutableNode.java b/azkaban-common/src/main/java/azkaban/executor/ExecutableNode.java
index <HASH>..<HASH> 100644
--- a/azkaban-common/src/main/java/azkaban/executor/ExecutableNode.java
+++ b/azkaban-common/src/main/java/azkaban/executor/ExecutableNode.java
@@ -294,7 +294,9 @@ public class ExecutableNode {
objMap.put(UPDATETIME_PARAM, this.updateTime);
objMap.put(TYPE_PARAM, this.type);
objMap.put(CONDITION_PARAM, this.condition);
- objMap.put(CONDITION_ON_JOB_STATUS_PARAM, this.conditionOnJobStatus.toString());
+ if (this.conditionOnJobStatus != null) {
+ objMap.put(CONDITION_ON_JOB_STATUS_PARAM, this.conditionOnJobStatus.toString());
+ }
objMap.put(ATTEMPT_PARAM, this.attempt);
if (this.inNodes != null && !this.inNodes.isEmpty()) { | Fix NPE in ExecutableNode.fillMapFromExecutable() (#<I>)
When loading some old executions (at least in order to finalize them), it's possible that the serialized flow_data doesn't include the conditionOnJobStatus at all. | azkaban_azkaban | train | java |
74540422950d69c5351f8b9cd985af85444f4328 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100755
--- a/index.js
+++ b/index.js
@@ -40,8 +40,10 @@ if ( adobeTarget &&
var targetEngine = String(extendscriptr.targetengine).replace(new RegExp('^[^a-zA-Z_$]|[^0-9a-zA-Z_$]', 'g'), '_');
-if ( targetEngine.length > 0) {
- browserifyPlugins.push([ prependify, '#targetengine "' + targetEngine + '"\n' ]);
+if (targetEngine !== 'undefined'){
+ if ( targetEngine.length > 0) {
+ browserifyPlugins.push([ prependify, '#targetengine "' + targetEngine + '"\n' ]);
+ }
}
var b = browserify({ | Added check if the value for -e is undefined | ExtendScript_extendscriptr | train | js |
4da1776271b6baff28b8883e48b1af068ebd2b10 | diff --git a/apiserver/allfacades.go b/apiserver/allfacades.go
index <HASH>..<HASH> 100644
--- a/apiserver/allfacades.go
+++ b/apiserver/allfacades.go
@@ -343,8 +343,9 @@ func AllFacades() *facade.Registry {
reg("Secrets", 1, secrets.NewSecretsAPI)
reg("SecretsManager", 1, secretsmanager.NewSecretManagerAPI)
- reg("SSHClient", 1, sshclient.NewFacade)
- reg("SSHClient", 2, sshclient.NewFacade) // v2 adds AllAddresses() method.
+ reg("SSHClient", 1, sshclient.NewFacadeV2)
+ reg("SSHClient", 2, sshclient.NewFacadeV2) // v2 adds AllAddresses() method.
+ reg("SSHClient", 3, sshclient.NewFacade) // v3 adds Leader() method.
reg("Spaces", 2, spaces.NewAPIv2)
reg("Spaces", 3, spaces.NewAPIv3) | Add version 3 of the sshclient facade to introduce Leader(). | juju_juju | train | go |
1a312198b50bea27c7651ce2fe6a855910cd4c03 | diff --git a/src/Illuminate/Console/Scheduling/ManagesFrequencies.php b/src/Illuminate/Console/Scheduling/ManagesFrequencies.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Console/Scheduling/ManagesFrequencies.php
+++ b/src/Illuminate/Console/Scheduling/ManagesFrequencies.php
@@ -338,6 +338,21 @@ trait ManagesFrequencies
}
/**
+ * Schedule the event to run on the last day of the month
+ *
+ * @param string $time
+ * @return $this
+ */
+ public function monthlyOnLastDay($time = '0:0')
+ {
+ $this->dailyAt($time);
+
+ $lastDayOfMonth = now()->endOfMonth()->day;
+
+ return $this->spliceIntoPosition(3, $lastDayOfMonth);
+ }
+
+ /**
* Schedule the event to run twice monthly.
*
* @param int $first | Add monthlyOnLastDay() to ManagesFrequencies | laravel_framework | train | php |
e6db16f2c80824ae68d6153b4c85a3b0d36382de | diff --git a/packages/perspective-viewer/src/js/row.js b/packages/perspective-viewer/src/js/row.js
index <HASH>..<HASH> 100644
--- a/packages/perspective-viewer/src/js/row.js
+++ b/packages/perspective-viewer/src/js/row.js
@@ -103,7 +103,9 @@ class Row extends HTMLElement {
}
}
});
- selector.evaluate();
+ if (filter_operand.value === "") {
+ selector.evaluate();
+ }
filter_operand.focus();
this._filter_operand.addEventListener("focus", () => {
if (filter_operand.value.trim().length === 0) { | Only open filter completion on creation if operand is empty | finos_perspective | train | js |
56a31869f3d9c99ba559623df4687a8f112f8a00 | diff --git a/tdl/map.py b/tdl/map.py
index <HASH>..<HASH> 100644
--- a/tdl/map.py
+++ b/tdl/map.py
@@ -61,6 +61,8 @@ class Map(object):
You can set to this attribute if you want, but you'll typically
be using it to read the field-of-view of a L{compute_fov} call.
+
+ @since: 1.5.0
"""
class _MapAttribute(object):
@@ -68,7 +70,7 @@ class Map(object):
self.map = map
self.bit_index = bit_index
self.bit = 1 << bit_index
- self.bit_inverse = 0xFFFF ^ self.bit
+ self.bit_inverse = 0xFF ^ self.bit
def __getitem__(self, key):
return bool(self.map._array_cdata[key[1]][key[0]] & self.bit)
@@ -160,13 +162,18 @@ class Map(object):
def compute_path(self, start_x, start_y, dest_x, dest_y,
diagonal_cost=_math.sqrt(2)):
- """
+ """Get the shortest path between two points.
+
+ The start position is not included in the list.
@type diagnalCost: float
@param diagnalCost: Multiplier for diagonal movement.
Can be set to zero to disable diagonal movement
entirely.
+ @rtype: [(x, y), ...]
+ @return: Returns a the shortest list of points to get to the destination
+ position from the starting position
"""
# refresh cdata
_lib.TDL_map_data_from_buffer(self._map_cdata, | added a few docstings | libtcod_python-tcod | train | py |
d9f4a9d8650635c41221eb1f7c20cead962b6f36 | diff --git a/lib/serrano/cnrequest.rb b/lib/serrano/cnrequest.rb
index <HASH>..<HASH> 100644
--- a/lib/serrano/cnrequest.rb
+++ b/lib/serrano/cnrequest.rb
@@ -87,7 +87,7 @@ def make_request(conn, ids, format, style, locale)
}
end
- res.body
+ res.body if res.success?
end
# parser <- cn_types[[self.format]] | Return response body only if status code is success | sckott_serrano | train | rb |
f93f4fecfc9307751d0705ca04ad096f27943aad | diff --git a/doc/conf.py b/doc/conf.py
index <HASH>..<HASH> 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -55,7 +55,7 @@ author = u'Victor Stinner'
# built documents.
#
# The short X.Y version.
-version = release = '0.7.9'
+version = release = '0.7.10'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/perf/__init__.py b/perf/__init__.py
index <HASH>..<HASH> 100644
--- a/perf/__init__.py
+++ b/perf/__init__.py
@@ -1,6 +1,6 @@
from __future__ import division, print_function, absolute_import
-__version__ = '0.7.9'
+__version__ = '0.7.10'
# Clocks
try:
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -22,7 +22,7 @@
# - git commit -a -m "post-release"
# - git push
-VERSION = '0.7.9'
+VERSION = '0.7.10'
DESCRIPTION = 'Python module to generate and modify perf'
CLASSIFIERS = [ | post release: set version to <I> | vstinner_perf | train | py,py,py |
39300bf849731af2a47b4df5275552f21f3b74ca | diff --git a/tests/test_apps/txnid-selfcheck2/src/txnIdSelfCheck/procedures/ReplicatedUpdateBaseProc.java b/tests/test_apps/txnid-selfcheck2/src/txnIdSelfCheck/procedures/ReplicatedUpdateBaseProc.java
index <HASH>..<HASH> 100644
--- a/tests/test_apps/txnid-selfcheck2/src/txnIdSelfCheck/procedures/ReplicatedUpdateBaseProc.java
+++ b/tests/test_apps/txnid-selfcheck2/src/txnIdSelfCheck/procedures/ReplicatedUpdateBaseProc.java
@@ -29,7 +29,7 @@ import org.voltdb.VoltTable;
public class ReplicatedUpdateBaseProc extends UpdateBaseProc {
public final SQLStmt r_getCIDData = new SQLStmt(
- "SELECT * FROM replicated r INNER JOIN dimension d ON r.cid=d.cid WHERE r.cid = ? ORDER BY cid, rid desc;");
+ "SELECT * FROM replicated r INNER JOIN dimension d ON r.cid=d.cid WHERE r.cid = ? ORDER BY r.cid, rid desc;");
public final SQLStmt r_cleanUp = new SQLStmt(
"DELETE FROM replicated WHERE cid = ? and cnt < ?;"); | txnid2: fix additional ambiguous queries | VoltDB_voltdb | train | java |
64154bcfe12bfe4df21aab869880cdd17afa2571 | diff --git a/sksurv/svm/minlip.py b/sksurv/svm/minlip.py
index <HASH>..<HASH> 100644
--- a/sksurv/svm/minlip.py
+++ b/sksurv/svm/minlip.py
@@ -15,7 +15,7 @@ __all__ = ['MinlipSurvivalAnalysis', 'HingeLossSurvivalSVM']
def _check_cvxopt():
try:
import cvxopt
- except ImportError:
+ except ImportError: # pragma: no cover
raise ImportError("Please install cvxopt from https://github.com/cvxopt/cvxopt")
return cvxopt | Ignore ImportError in coverage | sebp_scikit-survival | train | py |
5ada2b9c136fe88fec66f331d03c6b8233cc53ae | diff --git a/plugins/Zeitgeist/javascripts/ajaxHelper.js b/plugins/Zeitgeist/javascripts/ajaxHelper.js
index <HASH>..<HASH> 100644
--- a/plugins/Zeitgeist/javascripts/ajaxHelper.js
+++ b/plugins/Zeitgeist/javascripts/ajaxHelper.js
@@ -108,10 +108,16 @@ function ajaxHelper() {
/**
* Base URL used in the AJAX request. Can be set by setUrl.
+ *
+ * It is set to '?' rather than 'index.php?' to increase chances that it works
+ * including for users who have an automatic 301 redirection from index.php? to ?
+ * POST values are missing when there is such 301 redirection. So by by-passing
+ * this 301 redirection, we avoid this issue.
+ *
* @type {String}
* @see ajaxHelper.setUrl
*/
- this.getUrl = 'index.php?';
+ this.getUrl = '?';
/**
* Params to be passed as GET params | Fixes #<I> Set Base URL used in the AJAX request to `?` instead of `index.php?`
It is set to '?' rather than 'index.php?' to increase chances that it works
including for users who have an automatic <I> redirection from index.php? to ?
POST values are missing when there is such <I> redirection. So by by-passing
this <I> redirection, we avoid this issue. | matomo-org_matomo | train | js |
07856fe62c55c5f0eb293791cde288ee4ff2a324 | diff --git a/jackson/src/test/java/io/norberg/automatter/jackson/AutoMatterModuleTest.java b/jackson/src/test/java/io/norberg/automatter/jackson/AutoMatterModuleTest.java
index <HASH>..<HASH> 100644
--- a/jackson/src/test/java/io/norberg/automatter/jackson/AutoMatterModuleTest.java
+++ b/jackson/src/test/java/io/norberg/automatter/jackson/AutoMatterModuleTest.java
@@ -4,6 +4,7 @@ import static com.fasterxml.jackson.databind.PropertyNamingStrategy.CAMEL_CASE_T
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
+import com.fasterxml.jackson.core.Version;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
@@ -39,6 +40,9 @@ public class AutoMatterModuleTest {
@Test
public void explicitRootType() throws IOException {
+ final Version jacksonVersion = mapper.version();
+ Assume.assumeTrue(
+ jacksonVersion.getMajorVersion() >= 2 && jacksonVersion.getMinorVersion() >= 7);
final String json = mapper.writerFor(Foo.class).writeValueAsString(FOO);
final Foo parsed = mapper.readValue(json, Foo.class);
assertThat(parsed, is(FOO)); | only test for jackson >= <I> | danielnorberg_auto-matter | train | java |
b71e8e3f4f02f8d8cf82f7400fe3c3293b8f0de0 | diff --git a/code/SitemapPage.php b/code/SitemapPage.php
index <HASH>..<HASH> 100755
--- a/code/SitemapPage.php
+++ b/code/SitemapPage.php
@@ -93,12 +93,13 @@ class SitemapPage extends Page {
*/
public function getRootPages() {
switch($this->PagesToDisplay) {
- case 'All':
- return DataObject::get('SiteTree', '"ParentID" = 0 AND "ShowInMenus" = 1');
case 'ChildrenOf':
return DataObject::get('SiteTree', "\"ParentID\" = $this->ParentPageID AND \"ShowInMenus\" = 1");
case 'Selected':
return $this->PagesToShow('"ShowInMenus" = 1');
+ case 'All':
+ default:
+ return DataObject::get('SiteTree', '"ParentID" = 0 AND "ShowInMenus" = 1');
}
} | BUGFIX: Fixed an edge case where no PagesToDisplay value was set. | symbiote_silverstripe-sitemap | train | php |
de8923e85f49f09501e52bf73b07d4b3949e37fa | diff --git a/scripts/generate.js b/scripts/generate.js
index <HASH>..<HASH> 100755
--- a/scripts/generate.js
+++ b/scripts/generate.js
@@ -10,8 +10,8 @@ const swaggerConfigFilename = `config.json`;
cd(rootFolder);
// Download latest spec from the API
-// exec(`rm -f ${specFilename}`);
-// exec(`wget https://api.youneedabudget.com/papi/${specFilename}`);
+exec(`rm -f ${specFilename}`);
+exec(`wget https://api.youneedabudget.com/papi/${specFilename}`);
// Update config file with latest package info
const package = require("../package.json"); | Uncomment wget spec | ynab_ynab-sdk-js | train | js |
5fc8005c836394cd605cd2140c06defe3d1f48e0 | diff --git a/backbone.js b/backbone.js
index <HASH>..<HASH> 100644
--- a/backbone.js
+++ b/backbone.js
@@ -1268,7 +1268,7 @@
var attrs = _.extend({}, getValue(this, 'attributes'));
if (this.id) attrs.id = this.id;
if (this.className) attrs['class'] = this.className;
- this.setElement(this.make(this.tagName, attrs), false);
+ this.setElement(this.make(getValue(this, 'tagName'), attrs), false);
} else {
this.setElement(this.el, false);
}
diff --git a/test/view.js b/test/view.js
index <HASH>..<HASH> 100644
--- a/test/view.js
+++ b/test/view.js
@@ -217,8 +217,13 @@ $(document).ready(function() {
test("Clone attributes object", function() {
var View = Backbone.View.extend({attributes: {foo: 'bar'}});
var v1 = new View({id: 'foo'});
- ok(v1.el.id === 'foo');
+ strictEqual(v1.el.id, 'foo');
var v2 = new View();
ok(!v2.el.id);
});
+
+ test("#1228 - tagName can be provided as a function", function() {
+ var View = Backbone.View.extend({tagName: function(){ return 'p'; }});
+ ok(new View().$el.is('p'));
+ });
}); | Fix #<I> - tagName can be provided as a function. | jashkenas_backbone | train | js,js |
3a7881379a28e47dbd0afcb429bcf3f10a5297ba | diff --git a/packages/babel-core/test/api.js b/packages/babel-core/test/api.js
index <HASH>..<HASH> 100644
--- a/packages/babel-core/test/api.js
+++ b/packages/babel-core/test/api.js
@@ -259,7 +259,7 @@ describe("api", function() {
expect(aliasBaseType).toBe("NumberTypeAnnotation");
- expect(result.code).toEqual("var x = function x(y) {\n return y;\n};");
+ expect(result.code).toBe("var x = function x(y) {\n return y;\n};");
// 2. passPerPreset: false
@@ -269,7 +269,7 @@ describe("api", function() {
expect(aliasBaseType).toBeNull();
- expect(result.code).toEqual("var x = function x(y) {\n return y;\n};");
+ expect(result.code).toBe("var x = function x(y) {\n return y;\n};");
});
it("complex plugin and preset ordering", function() { | jest: ToEqual -> toBe | babel_babel | train | js |
3e6224acee710b2c984afbbc92160e5e287b365d | diff --git a/manifest.php b/manifest.php
index <HASH>..<HASH> 100755
--- a/manifest.php
+++ b/manifest.php
@@ -31,7 +31,7 @@ return array(
'label' => 'Core',
'description' => 'Core extension, provide the low level framework and an API to manage ontologies',
'license' => 'GPL-2.0',
- 'version' => '2.27.1',
+ 'version' => '2.28.0',
'author' => 'Open Assessment Technologies, CRP Henri Tudor',
'requires' => array(),
'models' => array(
diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php
index <HASH>..<HASH> 100644
--- a/scripts/update/Updater.php
+++ b/scripts/update/Updater.php
@@ -209,7 +209,7 @@ class Updater extends \common_ext_ExtensionUpdater {
$this->setVersion('2.20.0');
}
- $this->skip('2.20.0', '2.27.1');
+ $this->skip('2.20.0', '2.28.0');
}
private function getReadableModelIds() { | Updated version to <I> | oat-sa_generis | train | php,php |
d1c6afad432f515905060aa164639b561b71344a | diff --git a/tcconfig/_docker.py b/tcconfig/_docker.py
index <HASH>..<HASH> 100644
--- a/tcconfig/_docker.py
+++ b/tcconfig/_docker.py
@@ -48,7 +48,7 @@ class DockerClient(object):
return Path("/var/run/netns")
def __init__(self, tc_command_output=TcCommandOutput.NOT_SET):
- self.__client = APIClient()
+ self.__client = APIClient(version="auto")
self.__host_name = os.uname()[1]
self.__tc_command_output = tc_command_output | Avoid an error caused by version mismatch of docker client and server
Add the version specifier to the APIClient constructor with
the auto value. #<I> | thombashi_tcconfig | train | py |
e03677415b4f3bbf0c8da9bca00df87bafded4af | diff --git a/plenum/client/wallet.py b/plenum/client/wallet.py
index <HASH>..<HASH> 100644
--- a/plenum/client/wallet.py
+++ b/plenum/client/wallet.py
@@ -424,6 +424,9 @@ class WalletCompatibilityBackend(JSONBackend):
to the current version.
"""
+ def _getUpToDateClassName(self, pickledClassName):
+ return pickledClassName.replace('sovrin_client', 'indy_client')
+
def decode(self, string):
raw = super().decode(string)
# Note that backend.decode may be called not only for the whole object
@@ -434,7 +437,7 @@ class WalletCompatibilityBackend(JSONBackend):
# a wallet class supporting backward compatibility
if isinstance(raw, dict) and tags.OBJECT in raw:
clsName = raw[tags.OBJECT]
- cls = loadclass(clsName)
+ cls = loadclass(self._getUpToDateClassName(clsName))
if hasattr(cls, 'makeRawCompatible') \
and callable(getattr(cls, 'makeRawCompatible')):
cls.makeRawCompatible(raw) | INDY-<I>: Wallet migration for rebranding (#<I>)
Supported wallet migration for rebranding | hyperledger_indy-plenum | train | py |
5b31b32116a9d97055990d7f350689c5d1f5fd98 | diff --git a/specs/tests.js b/specs/tests.js
index <HASH>..<HASH> 100644
--- a/specs/tests.js
+++ b/specs/tests.js
@@ -12,7 +12,7 @@ describe('pRequest', () => {
.then((response) => {
expect(response).to.be.an('object');
expect(response).to.have.property('full_name', 'cjus/umf');
- expect(response).to.have.deep.property('owner.login', 'cjus');
+ expect(response).to.have.nested.property('owner.login', 'cjus');
done();
});
}); | fix test for new version of chai | flywheelsports_fwsp-prequest | train | js |
9ee1a1ff979169f213c06ab7c8ae8dce66f15da5 | diff --git a/lib/reda/importers/iris_syscal_pro.py b/lib/reda/importers/iris_syscal_pro.py
index <HASH>..<HASH> 100644
--- a/lib/reda/importers/iris_syscal_pro.py
+++ b/lib/reda/importers/iris_syscal_pro.py
@@ -206,6 +206,14 @@ def import_bin(filename, **kwargs):
print('WARNING: Measurement numbers do not start with 0 ' +
'(did you download ALL data?)')
+ # check that all measurement numbers increase by one
+ if not np.all(np.diff(data_raw['measurement_num'])) == 1:
+ print(
+ 'WARNING '
+ 'Measurement numbers are not consecutive. '
+ 'Perhaps the first measurement belongs to another measurement?'
+ )
+
# now check if there is a jump in measurement numbers somewhere
# ignore first entry as this will always be nan
diff = data_raw['measurement_num'].diff()[1:]
@@ -215,6 +223,7 @@ def import_bin(filename, **kwargs):
print('Removing all subsequent data points')
data_raw = data_raw.iloc[0:jump[1], :]
+
if data_raw.shape[0] == 0:
# no data present, return a bare DataFrame
return pd.DataFrame(columns=['a', 'b', 'm', 'n', 'r']), None, None | [syscal binary import] check for consecutive measurement numbers | geophysics-ubonn_reda | train | py |
9a70f7b690f66c501e9e1c79aa7a2dbf6ffb7e08 | diff --git a/middleware/asset_compiler/asset-minifier.js b/middleware/asset_compiler/asset-minifier.js
index <HASH>..<HASH> 100644
--- a/middleware/asset_compiler/asset-minifier.js
+++ b/middleware/asset_compiler/asset-minifier.js
@@ -15,7 +15,7 @@ var minifyTargets = Object.keys(config.minify);
var compiler = new Multi({
getSource: function(f, target, callback) {
- file = app.fullPath('public/' + f);
+ var file = app.fullPath('public/' + f);
var ext = getExt(file);
var source = fs.readFileSync(file, 'utf8').toString();
source = app.applyFilters('asset_compiler_minify_source', source, ext, f); | Lint refactor
[ci skip] | derdesign_protos | train | js |
dd38eae0377cc21e9a27ae39d5269e55c2170702 | diff --git a/girder/models/upload.py b/girder/models/upload.py
index <HASH>..<HASH> 100644
--- a/girder/models/upload.py
+++ b/girder/models/upload.py
@@ -81,7 +81,7 @@ class Upload(Model):
unspecified, the current assetstore is used.
:type reference: str
:param attachParent: if True, instead of creating an item within the
- parent or giving the file an itemID, set itemID to None and set
+ parent or giving the file an itemId, set itemId to None and set
attachedToType and attachedToId instead (using the values passed in
parentType and parent). This is intended for files that shouldn't
appear as direct children of the parent, but are still associated
@@ -311,7 +311,7 @@ class Upload(Model):
:param assetstore: An optional assetstore to use to store the file. If
unspecified, the current assetstore is used.
:param attachParent: if True, instead of creating an item within the
- parent or giving the file an itemID, set itemID to None and set
+ parent or giving the file an itemId, set itemId to None and set
attachedToType and attachedToId instead (using the values passed in
parentType and parent). This is intended for files that shouldn't
appear as direct children of the parent, but are still associated | Fix casing within a comment. | girder_girder | train | py |
2f382ced5e90de325d93eb26385e145c90da4ecc | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -8,7 +8,7 @@ module.exports = function(grunt) {
configFile: 'eslint_ecma5.json',
reset: true
},
- target: ['lib/**']
+ target: ['lib/**', 'test/**', 'Gruntfile.js', 'index.js']
},
pkg: grunt.file.readJSON('package.json'),
browserify: {
@@ -45,4 +45,4 @@ module.exports = function(grunt) {
'eslint',
'watch'
]);
-}
\ No newline at end of file
+} | Adding missing eslint targets | OnzCoin_onz-js | train | js |
ff9ad2787398bf133408e9821328bf185654f767 | diff --git a/test/test_address_gr.rb b/test/test_address_gr.rb
index <HASH>..<HASH> 100644
--- a/test/test_address_gr.rb
+++ b/test/test_address_gr.rb
@@ -5,28 +5,28 @@ require 'helper'
class TestAddressGR < Test::Unit::TestCase
def setup
- @addressGr = FFaker::AddressGR
+ @address_gr = FFaker::AddressGR
@street_prefix = FFaker::AddressGR::STREET_PREFIX.join("|")
end
def test_city
- assert_match /\p{Greek}/, @addressGr.city
+ assert_match /\p{Greek}/, @address_gr.city
end
def test_region
- assert_match /\p{Greek}/, @addressGr.region
+ assert_match /\p{Greek}/, @address_gr.region
end
def test_zip_code
- assert_match /\A\d{5}\z/, @addressGr.zip_code
+ assert_match /\A\d{5}\z/, @address_gr.zip_code
end
def test_street_name
- assert_match /\p{Greek}/, @addressGr.street_name
+ assert_match /\p{Greek}/, @address_gr.street_name
end
def test_street_nbr
- assert_match /\A\d{1,3}\z/, @addressGr.street_nbr
+ assert_match /\A\d{1,3}\z/, @address_gr.street_nbr
end
def test_street_address | code cleanup
snake_case for variable names | ffaker_ffaker | train | rb |
79c86c70b75e27ee6cb2348d1220ef85c943f94f | diff --git a/tests/performance-test/src/main/java/io/joynr/performance/ConsumerApplication.java b/tests/performance-test/src/main/java/io/joynr/performance/ConsumerApplication.java
index <HASH>..<HASH> 100644
--- a/tests/performance-test/src/main/java/io/joynr/performance/ConsumerApplication.java
+++ b/tests/performance-test/src/main/java/io/joynr/performance/ConsumerApplication.java
@@ -422,22 +422,9 @@ public class ConsumerApplication extends AbstractJoynrApplication {
public void shutdown() {
runtime.shutdown(true);
- // TODO currently there is a bug preventing all threads being stopped: WORKAROUND
- sleep(3000);
-
System.exit(0);
}
- private boolean sleep(long milliseconds) {
- try {
- Thread.sleep(milliseconds);
- } catch (InterruptedException e) {
- return false;
- }
-
- return true;
- }
-
private static JoynrApplication createJoynrApplication() throws Exception {
Properties joynrConfig = createJoynrConfig();
Module runtimeModule = getRuntimeModule(joynrConfig); | [Tests] Remove unnecessary sleep in performance-test consumer
Change-Id: Iba7b<I>c<I>c<I>c4c1cab<I>ab<I>d5de<I>dd | bmwcarit_joynr | train | java |
f2f0e81107e8e97a36f5c7a5e89ca72222edc70c | diff --git a/lib/cornucopia/util/report_builder.rb b/lib/cornucopia/util/report_builder.rb
index <HASH>..<HASH> 100644
--- a/lib/cornucopia/util/report_builder.rb
+++ b/lib/cornucopia/util/report_builder.rb
@@ -48,7 +48,7 @@ module Cornucopia
def format_code_refs(value)
safe_text = Cornucopia::Util::ReportBuilder.escape_string(value)
- safe_text = safe_text.gsub(/(#{Cornucopia::Util::ReportBuilder.root_folder}|\.\/|(?=(?:^features|^spec)\/))([^\:\n]*\:[^\:\n\>& ]*)/,
+ safe_text = safe_text.gsub(/(#{Cornucopia::Util::ReportBuilder.root_folder}|\.\/|(?=(?:^features|^spec)\/))([^\:\r\n &]*(?:\:[^\:\r\n\>& ]*)?)/,
"\\1 <span class=\"cornucopia-app-file\">\\2\\3</span> ").html_safe
safe_text
diff --git a/lib/cornucopia/version.rb b/lib/cornucopia/version.rb
index <HASH>..<HASH> 100644
--- a/lib/cornucopia/version.rb
+++ b/lib/cornucopia/version.rb
@@ -1,3 +1,3 @@
module Cornucopia
- VERSION = "0.1.23"
+ VERSION = "0.1.24"
end
\ No newline at end of file | Fix a problem with the regex for highlighting paths. | RealNobody_cornucopia | train | rb,rb |
3a59cfa9c07deb07d7be8d8abee8cb2a61ff317a | diff --git a/src/crypto/index.js b/src/crypto/index.js
index <HASH>..<HASH> 100644
--- a/src/crypto/index.js
+++ b/src/crypto/index.js
@@ -1514,8 +1514,10 @@ Crypto.prototype.setDeviceVerification = async function(
// Check if the 'device' is actually a cross signing key
// The js-sdk's verification treats cross-signing keys as devices
// and so uses this method to mark them verified.
+ // (Not our own master key though - there's no point signing ourselves
+ // as a user).
const xsk = this._deviceList.getStoredCrossSigningForUser(userId);
- if (xsk && xsk.getId() === deviceId) {
+ if (xsk && xsk.getId() === deviceId && userId !== this._userId) {
if (blocked !== null || known !== null) {
throw new Error("Cannot set blocked or known for a cross-signing key");
} | Don't sign ourselves as a user | matrix-org_matrix-js-sdk | train | js |
8f4a1af8a1e728f876f0dc4c2d5d1ea515b7776e | diff --git a/vix.go b/vix.go
index <HASH>..<HASH> 100644
--- a/vix.go
+++ b/vix.go
@@ -171,6 +171,7 @@ const (
type VmDeleteOption int
const (
+ VMDELETE_KEEP_FILES VmDeleteOption = 0x0
VMDELETE_DISK_FILES VmDeleteOption = C.VIX_VMDELETE_DISK_FILES
) | Adds a new constant to have the choice of not removing vm disk files upon virtual machine removal | hooklift_govix | train | go |
d2c78f34a5ca039abb8067cc125a03b85293445c | diff --git a/nbt/src/main/java/net/kyori/adventure/nbt/CompoundTagSetter.java b/nbt/src/main/java/net/kyori/adventure/nbt/CompoundTagSetter.java
index <HASH>..<HASH> 100644
--- a/nbt/src/main/java/net/kyori/adventure/nbt/CompoundTagSetter.java
+++ b/nbt/src/main/java/net/kyori/adventure/nbt/CompoundTagSetter.java
@@ -50,7 +50,7 @@ public interface CompoundTagSetter<R> {
*
* @param tag the tag
* @return a compound tag
- * @since 4.5.0
+ * @since 4.6.0
*/
@NonNull R put(final @NonNull CompoundBinaryTag tag); | <I> is already released! | KyoriPowered_text | train | java |
b1761984d14eca925d4616e57c280693c45454b0 | diff --git a/packages/application-shell/src/index.js b/packages/application-shell/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/application-shell/src/index.js
+++ b/packages/application-shell/src/index.js
@@ -19,6 +19,12 @@ export { selectUserId, selectProjectKeyFromUrl } from './utils';
export { default as AsyncChunkLoader } from './components/async-chunk-loader';
export { GtmContext } from './components/gtm-booter';
export {
+ default as GtmUserLogoutTracker,
+} from './components/gtm-user-logout-tracker';
+export {
+ default as SetupFlopFlipProvider,
+} from './components/setup-flop-flip-provider';
+export {
default as handleApolloErrors,
} from './components/handle-apollo-errors'; | feat(app-shell): add re-export of gtm logout and flopflip (#<I>) | commercetools_merchant-center-application-kit | train | js |
c2b4983b9d6aca0b23ebb149cd2a128b4ade0709 | diff --git a/lib/fog/aws/models/ec2/volume.rb b/lib/fog/aws/models/ec2/volume.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/aws/models/ec2/volume.rb
+++ b/lib/fog/aws/models/ec2/volume.rb
@@ -22,9 +22,6 @@ module Fog
def initialize(attributes = {})
# assign server first to prevent race condition with new_record?
self.server = attributes.delete(:server)
- if attributes['attachmentSet']
- attributes.merge!(attributes.delete('attachmentSet').first || {})
- end
super
end
@@ -67,6 +64,10 @@ module Fog
private
+ def attachmentSet=(new_attachment_set)
+ merge_attributes(new_attachment_set.first || {})
+ end
+
def attach(new_server)
if new_record?
@server = new_server | [ec2] fix volume model to not muck with attributes, which breaks mocks | fog_fog | train | rb |
d2d825b3fc10e16fa87a2f9e15845128ba694fcf | diff --git a/src/main/java/com/myjeeva/digitalocean/impl/DigitalOceanClient.java b/src/main/java/com/myjeeva/digitalocean/impl/DigitalOceanClient.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/myjeeva/digitalocean/impl/DigitalOceanClient.java
+++ b/src/main/java/com/myjeeva/digitalocean/impl/DigitalOceanClient.java
@@ -811,7 +811,9 @@ public class DigitalOceanClient implements DigitalOcean, Constants {
public Domain createDomain(Domain domain)
throws DigitalOceanException, RequestUnsuccessfulException {
checkBlankAndThrowError(domain.getName(), "Missing required parameter - domainName.");
- checkBlankAndThrowError(domain.getIpAddress(), "Missing required parameter - ipAddress.");
+ // #89 - removed the validation in-favor of
+ // https://developers.digitalocean.com/documentation/changelog/api-v2/create-domains-without-providing-an-ip-address/
+ // checkBlankAndThrowError(domain.getIpAddress(), "Missing required parameter - ipAddress.");
return (Domain) perform(new ApiRequest(ApiAction.CREATE_DOMAIN, domain)).getData();
} | #<I> - removed the ipaddress validation | jeevatkm_digitalocean-api-java | train | java |
bb53f91a3314ab96acc1191e1c961bb2b7949f21 | diff --git a/securegraph-elasticsearch-plugin/src/main/java/org/securegraph/elasticsearch/AuthorizationsFilter.java b/securegraph-elasticsearch-plugin/src/main/java/org/securegraph/elasticsearch/AuthorizationsFilter.java
index <HASH>..<HASH> 100644
--- a/securegraph-elasticsearch-plugin/src/main/java/org/securegraph/elasticsearch/AuthorizationsFilter.java
+++ b/securegraph-elasticsearch-plugin/src/main/java/org/securegraph/elasticsearch/AuthorizationsFilter.java
@@ -15,11 +15,12 @@ import org.securegraph.inmemory.security.VisibilityParseException;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
public class AuthorizationsFilter extends Filter {
public static String VISIBILITY_FIELD_NAME = "__visibility";
private final VisibilityEvaluator visibilityEvaluator;
- private static final Map<BytesRef, ColumnVisibility> columnVisibilityCache = new HashMap<BytesRef, ColumnVisibility>();
+ private static final Map<BytesRef, ColumnVisibility> columnVisibilityCache = new ConcurrentHashMap<>();
public AuthorizationsFilter(Authorizations authorizations) {
this.visibilityEvaluator = new VisibilityEvaluator(authorizations); | change columnVisibilityCache in AuthorizationsFilter to ConcurrentHashMap | lumifyio_securegraph | train | java |
ecc708e86c32ba08c93aa9e85f37abec099bac05 | diff --git a/e2e/e2e_test.py b/e2e/e2e_test.py
index <HASH>..<HASH> 100644
--- a/e2e/e2e_test.py
+++ b/e2e/e2e_test.py
@@ -28,6 +28,7 @@ main()
, stdout=subprocess.PIPE, shell=True, executable=sys.executable)
(output, error) = crawler_process.communicate()
cls.output = output.decode("utf-8")
+ print(cls.output, error.decode("utf-8"))
lines = cls.output.splitlines()
cls.lines = [i for i in lines if i != ''] | Add output printing for easier debugging | snorrwe_lollygag | train | py |
8d51a5736f54b7080fadccd37ddceae35f770dba | diff --git a/lib/helper/WebDriverIO.js b/lib/helper/WebDriverIO.js
index <HASH>..<HASH> 100644
--- a/lib/helper/WebDriverIO.js
+++ b/lib/helper/WebDriverIO.js
@@ -1129,7 +1129,7 @@ function withStrictLocator(locator) {
case 'xpath':
case 'css': return value;
case 'id': return '#' + value;
- case 'name': return `[name="value"]`;
+ case 'name': return `[name="${value}"]`;
}
}
diff --git a/test/unit/helper/webapi.js b/test/unit/helper/webapi.js
index <HASH>..<HASH> 100644
--- a/test/unit/helper/webapi.js
+++ b/test/unit/helper/webapi.js
@@ -69,6 +69,7 @@ module.exports.tests = function() {
it('should check visible elements on page', function*() {
yield I.amOnPage('/form/field');
yield I.seeElement('input[name=name]');
+ yield I.seeElement({name: 'name'});
yield I.seeElement('//input[@id="name"]');
yield I.dontSeeElement('#something-beyond');
return I.dontSeeElement('//input[@id="something-beyond"]'); | Locate element by name attribute bug fixed (#<I>) | Codeception_CodeceptJS | train | js,js |
29cf11e79294c20546ced3b2ac434f4f16fd7e8b | diff --git a/operator/k8s_identity.go b/operator/k8s_identity.go
index <HASH>..<HASH> 100644
--- a/operator/k8s_identity.go
+++ b/operator/k8s_identity.go
@@ -49,6 +49,8 @@ func deleteIdentity(identity *types.Identity) error {
})
if err != nil {
log.WithError(err).Error("Unable to delete identity")
+ } else {
+ log.WithFields(logrus.Fields{"identity": identity.GetName()}).Info("Garbage collected identity")
}
return err | operator: add Info message when a identity is GC in CRD mode
It is useful to have this information being printed in non-debug mode to
help tracking down potential bugs. | cilium_cilium | train | go |
bc6d0d86ae5680bf56259524d9114d05099b59e6 | diff --git a/applications/desktop/src/notebook/epics/index.js b/applications/desktop/src/notebook/epics/index.js
index <HASH>..<HASH> 100644
--- a/applications/desktop/src/notebook/epics/index.js
+++ b/applications/desktop/src/notebook/epics/index.js
@@ -36,7 +36,7 @@ export function retryAndEmitError(err: Error, source: ActionsObservable<*>) {
export const wrapEpic = (epic: Epic<*, *, *>) => (...args: any) =>
epic(...args).pipe(catchError(retryAndEmitError));
-const epics = [
+const epics: Array<Epic<*, *, *>> = [
coreEpics.restartKernelEpic,
coreEpics.acquireKernelInfoEpic,
coreEpics.watchExecutionStateEpic,
diff --git a/packages/rx-binder/src/index.js b/packages/rx-binder/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/rx-binder/src/index.js
+++ b/packages/rx-binder/src/index.js
@@ -37,7 +37,7 @@ function formBinderURL({
const eventSourceFallback =
typeof window !== "undefined" && window.EventSource
? window.EventSource
- : function(url) {
+ : function(url: string) {
throw new Error(
"Event Source not supported on this platform -- please polyfill"
); | provide more annotations for flow <I> | nteract_nteract | train | js,js |
89d9f3fc5af42094eb831f2267f2589633cd952e | diff --git a/install.py b/install.py
index <HASH>..<HASH> 100644
--- a/install.py
+++ b/install.py
@@ -131,7 +131,24 @@ def install(dest_dir, print_welcome=False):
# done
if print_welcome:
print()
- print("SUCCESS! To activate Rez, add the following path to $PATH:")
+ print("SUCCESS!")
+ rez_exe = os.path.realpath(os.path.join(dest_bin_dir, "rez"))
+ print("Rez executable installed to: %s" % rez_exe)
+
+ try:
+ out = subprocess.check_output([
+ rez_exe,
+ "python",
+ "-c",
+ "import rez; print(rez.__path__[0])"
+ ])
+ pkg_path = os.path.realpath(out.strip())
+ print("Rez python package installed to: %s" % pkg_path)
+ except:
+ pass # just in case there's an issue with rez-python tool
+
+ print()
+ print("To activate Rez, add the following path to $PATH:")
print(dest_bin_dir)
if completion_path: | small update to install.py output to show exe/pkg paths | nerdvegas_rez | train | py |
338132ca63a8ac7c80f520e10db6e2fff7ddb463 | diff --git a/WOA/woa.py b/WOA/woa.py
index <HASH>..<HASH> 100644
--- a/WOA/woa.py
+++ b/WOA/woa.py
@@ -526,12 +526,10 @@ class WOA_var_nc(object):
else:
var = np.asanyarray(self.KEYS)
- doy = kwargs['doy']
- if np.size(doy) == 1:
- if type(doy) is datetime:
- doy = int(doy.strftime('%j'))
- else:
- import pdb; pdb.set_trace()
+ doy = np.atleast_1d(kwargs['doy'])
+ # This would only work if doy is 1D
+ if type(doy[0]) is datetime:
+ doy = np.array([int(d.strftime('%j')) for d in doy])
if 'depth' in kwargs:
depth = np.atleast_1d(kwargs['depth']) | Loading doy as at least 1D. | castelao_oceansdb | train | py |
37e6614753331c4990c94fcd528465e3d994aeb5 | diff --git a/src/interfaces/xmlnodesyncadapter.js b/src/interfaces/xmlnodesyncadapter.js
index <HASH>..<HASH> 100644
--- a/src/interfaces/xmlnodesyncadapter.js
+++ b/src/interfaces/xmlnodesyncadapter.js
@@ -18,9 +18,9 @@
* @since 1.0.1
*/
- /**
- * IXmlNodeSyncAdapter Node type constants
- */
+/**
+ * IXmlNodeSyncAdapter Node type constants
+ */
var _GPF_XML_NODE_TYPE = {
ELEMENT: 1,
ATTRIBUTE: 2,
@@ -125,3 +125,10 @@ gpf.xml.nodeType = {
*/
var _gpfIXmlNodeSyncAdapter = _gpfDefineInterface("XmlNodeSyncAdapter",
_gpfSyncReadSourceJSON("interfaces/xmlnodesyncadapter.json"));
+
+/*#ifndef(UMD)*/
+
+// Generates an empty function to reflect the null complexity of this module
+(function _gpfInterfacesXmlnodesyncadapter () {}());
+
+/*#endif*/ | Fix linter issues (#<I>) | ArnaudBuchholz_gpf-js | train | js |
49484931dd7ca635e966f2b12dbcfff699602e92 | diff --git a/translator/src/main/java/com/google/devtools/j2objc/Options.java b/translator/src/main/java/com/google/devtools/j2objc/Options.java
index <HASH>..<HASH> 100644
--- a/translator/src/main/java/com/google/devtools/j2objc/Options.java
+++ b/translator/src/main/java/com/google/devtools/j2objc/Options.java
@@ -495,7 +495,7 @@ public class Options {
f = fileUtil().extractClassesJarFromAarFile(f);
}
if (f.exists()) {
- entries.add(entry);
+ entries.add(f.toString());
}
}
return entries; | classpath for aar
classpath for aar | google_j2objc | train | java |
5835358a7e4cf2bf95adf5060443832cdcb47ffe | diff --git a/intranet/db/ldap_db.py b/intranet/db/ldap_db.py
index <HASH>..<HASH> 100644
--- a/intranet/db/ldap_db.py
+++ b/intranet/db/ldap_db.py
@@ -20,14 +20,17 @@ class LDAPFilter(object):
specified attribute is contained in a specified list of values.
"""
- return "(|" + "".join(("({}={})".format(attribute, v) for v in values)) + ")"
+ return "(|" + \
+ "".join(("({}={})".format(attribute, v) for v in values)) + \
+ ")"
@staticmethod
def all_users():
"""Returns a filter for selecting all user objects in LDAP
"""
- return LDAPFilter.attribute_in_list("objectclass", settings.LDAP_OBJECT_CLASSES.values())
+ user_object_classes = settings.LDAP_OBJECT_CLASSES.values()
+ return LDAPFilter.attribute_in_list("objectclass",user_object_classes)
class LDAPConnection(object):
@@ -146,7 +149,6 @@ class LDAPConnection(object):
class LDAPResult(object):
-
"""Represents the result of an LDAP query.
LDAPResult stores the raw result of an LDAP query and can process | Fix some PEP8 problems in ldap_db | tjcsl_ion | train | py |
e5f391fececa0e8ba41f1fda7ec4e41524d3a995 | diff --git a/Form/ChoiceList/ModelChoiceList.php b/Form/ChoiceList/ModelChoiceList.php
index <HASH>..<HASH> 100644
--- a/Form/ChoiceList/ModelChoiceList.php
+++ b/Form/ChoiceList/ModelChoiceList.php
@@ -345,7 +345,7 @@ class ModelChoiceList extends ObjectChoiceList
}
// readonly="true" models do not implement Persistent.
- if ($model instanceof BaseObject and method_exists($model, 'getPrimaryKey')) {
+ if ($model instanceof BaseObject && method_exists($model, 'getPrimaryKey')) {
return array($model->getPrimaryKey());
} | [Propel1Bridge] Fix "and => &&" CS in ModelChoiceList | symfony_propel1-bridge | train | php |
f7a5d31853033f49ed82f7f95aa6e5b8df3205e3 | diff --git a/test/test.js b/test/test.js
index <HASH>..<HASH> 100644
--- a/test/test.js
+++ b/test/test.js
@@ -81,8 +81,8 @@ let testTicker = async (exchange, symbol) => {
... (keys.map (key =>
key + ': ' + human_value (ticker[key]))))
- // if (ticker['bid'] && ticker['ask'])
- assert (ticker['bid'] <= ticker['ask'])
+ if (exchange.id != 'coinmarketcap')
+ assert (ticker['bid'] <= ticker['ask'])
return ticker;
}
@@ -106,6 +106,7 @@ let testOrderBook = async (exchange, symbol) => {
if (asks.length > 1)
assert (asks[0][0] <= asks[asks.length - 1][0])
+
if (bids.length && asks.length)
assert (bids[0][0] <= asks[0][0]) | coinmarketcap workaround in test.js | ccxt_ccxt | train | js |
384515b680de237aec5c383d63cc4707d69c2072 | diff --git a/src/main/java/org/java_websocket/client/WebSocketClient.java b/src/main/java/org/java_websocket/client/WebSocketClient.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/java_websocket/client/WebSocketClient.java
+++ b/src/main/java/org/java_websocket/client/WebSocketClient.java
@@ -223,7 +223,7 @@ public abstract class WebSocketClient extends WebSocketAdapter implements Runnab
return;
} catch ( /*IOException | SecurityException | UnresolvedAddressException*/Exception e ) {//
onWebsocketError( conn, e );
- // conn.closeConnection( CloseFrame.NEVERCONNECTED, e.getMessage() );
+ conn.closeConnection( CloseFrame.NEVER_CONNECTED, e.getMessage() );
return;
}
conn = (WebSocketImpl) wf.createWebSocket( this, draft, channel.socket() ); | patch for commit <I>a<I>bc<I>a<I>b<I>c<I>fba0c<I>dfd6 | TooTallNate_Java-WebSocket | train | java |
622d925880e1f611da67b869032c72285bd84d77 | diff --git a/lib/travis/task/irc/client.rb b/lib/travis/task/irc/client.rb
index <HASH>..<HASH> 100644
--- a/lib/travis/task/irc/client.rb
+++ b/lib/travis/task/irc/client.rb
@@ -26,6 +26,7 @@ module Travis
end
def initialize(server, nick, options = {})
+ Travis.logger.info("Connecting to #{server} on port #{options[:port] || 6667} with nick #{options[:nick]}")
@socket = TCPSocket.open(server, options[:port] || 6667)
@socket = self.class.wrap_ssl(@socket) if options[:ssl] | Temporary logging out put. | travis-ci_travis-core | train | rb |
ae0b1ec967bc965f3af5711e710382c193ad5b50 | diff --git a/sfm/src/main/java/org/sfm/jdbc/impl/PreparedStatementSetterFactory.java b/sfm/src/main/java/org/sfm/jdbc/impl/PreparedStatementSetterFactory.java
index <HASH>..<HASH> 100644
--- a/sfm/src/main/java/org/sfm/jdbc/impl/PreparedStatementSetterFactory.java
+++ b/sfm/src/main/java/org/sfm/jdbc/impl/PreparedStatementSetterFactory.java
@@ -370,7 +370,7 @@ public class PreparedStatementSetterFactory implements SetterFactory<PreparedSta
public <P> Setter<PreparedStatement, P> getSetter(PropertyMapping<?, ?, JdbcColumnKey, ? extends ColumnDefinition<JdbcColumnKey, ?>> arg) {
PrepareStatementIndexedSetter setter = getIndexedSetter(arg);
if (setter != null) {
- return new PreparedStatementSetterImpl<>(arg.getColumnKey().getIndex(), setter);
+ return new PreparedStatementSetterImpl<P>(arg.getColumnKey().getIndex(), setter);
} else return null;
} | #<I> refactor Ps to allow for direct indexed base injector for collection | arnaudroger_SimpleFlatMapper | train | java |
87469ea72677cd6cb2576370d798f4271c19030a | diff --git a/common/components/user/models/Profile.php b/common/components/user/models/Profile.php
index <HASH>..<HASH> 100755
--- a/common/components/user/models/Profile.php
+++ b/common/components/user/models/Profile.php
@@ -86,4 +86,15 @@ class Profile extends BaseProfile
return $this->hasMany(UserAddress::className(), ['user_profile_id' => 'id']);
}
+ /**
+ * @return string
+ *
+ * Gets current user name with surname as string.
+ */
+ public function getUserNameWithSurname():string {
+
+ $string = $this->name . ' ' . $this->surname;
+ return $string;
+ }
+
}
\ No newline at end of file | Adds getUserNameWithSurname() method to Profile entity. | black-lamp_blcms-cart | train | php |
9acbce10811ad2a7e4bf473f0296edc51dbfb4e2 | diff --git a/docs/gatsby-config.js b/docs/gatsby-config.js
index <HASH>..<HASH> 100644
--- a/docs/gatsby-config.js
+++ b/docs/gatsby-config.js
@@ -10,7 +10,7 @@ module.exports = {
githubRepo: 'apollographql/apollo-server',
defaultVersion: 2,
versions: {
- 1: 'version-1-mdx'
+ 1: 'version-1-mdx',
},
sidebarCategories: {
null: ['index', 'getting-started', 'whats-new'], | Add a trailing comma | apollographql_apollo-server | train | js |