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 |
|---|---|---|---|---|---|
74bc0f905f52c4c5a03212d7eb2540c981dcf579 | diff --git a/lib/ruby-asterisk.rb b/lib/ruby-asterisk.rb
index <HASH>..<HASH> 100644
--- a/lib/ruby-asterisk.rb
+++ b/lib/ruby-asterisk.rb
@@ -89,7 +89,7 @@ module RubyAsterisk
execute "Queues", {}
end
- def queue_add(queue, exten, penalty=2, paused=false, member_name)
+ def queue_add(queue, exten, penalty = 2, paused = false, member_name = '')
execute "QueueAdd", {"Queue" => queue, "Interface" => exten, "Penalty" => penalty, "Paused" => paused, "MemberName" => member_name}
end | Fixing bug with jRuby - issue #<I> | emilianodellacasa_ruby-asterisk | train | rb |
213a8e2c212e0abe55098099f3114e99c2a98761 | diff --git a/teslajsonpy/homeassistant/power.py b/teslajsonpy/homeassistant/power.py
index <HASH>..<HASH> 100644
--- a/teslajsonpy/homeassistant/power.py
+++ b/teslajsonpy/homeassistant/power.py
@@ -134,9 +134,15 @@ class PowerSensor(EnergySiteDevice):
"""
super().refresh()
data = self._controller.get_power_params(self._id)
+
if data:
# Note: Some systems that pre-date Tesla aquisition of SolarCity will have `grid_status: Unknown`,
- # but will have solar power values
+ # but will have solar power values. At the same time, newer systems will report spurious reads of 0 Watts
+ # and grid status unknown. If solar power is 0 return null.
+ if "grid_status" in data and data["grid_status"] == "Unknown" and data["solar_power"] == 0:
+ _LOGGER.debug("Spurious energy site power read")
+ return
+
self.__power = data["solar_power"]
if data["solar_power"] is not None:
self.__generating_status = ( | fix: improve handling on 0 Watts spurious power reads (#<I>)
closes #<I> | zabuldon_teslajsonpy | train | py |
01d10d50df15246add42978ef6fc9a0af73ea1b5 | diff --git a/tests/TestCase.php b/tests/TestCase.php
index <HASH>..<HASH> 100644
--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -96,13 +96,13 @@ abstract class TestCase extends BaseTestCase
* @param Jsonable|mixed $object
* @param string $message
*/
- public static function assertJson($object, $message = '')
+ public static function assertJsonObject($object, $message = '')
{
self::assertInstanceOf(Jsonable::class, $object);
- parent::assertJson($object->toJson(JSON_PRETTY_PRINT), $message);
+ self::assertJson($object->toJson(JSON_PRETTY_PRINT), $message);
self::assertInstanceOf(JsonSerializable::class, $object);
- parent::assertJson(json_encode($object, JSON_PRETTY_PRINT), $message);
+ self::assertJson(json_encode($object, JSON_PRETTY_PRINT), $message);
}
/** | Updating the base TestCase | ARCANEDEV_LogViewer | train | php |
75d0d3017761dc9120fabfca20bd8231bdb4466a | diff --git a/lib/resource/Application.js b/lib/resource/Application.js
index <HASH>..<HASH> 100644
--- a/lib/resource/Application.js
+++ b/lib/resource/Application.js
@@ -330,7 +330,7 @@ Application.prototype.authenticateApiRequest = function authenticateApiRequest(o
}
if(!authenticator){
- return callback(new ApiAuthRequestError('Invalid authentication request. Must provide access_token, or request access token.'));
+ return callback(new ApiAuthRequestError('Must provide access_token.',401));
}
if(authenticator instanceof Error){ | More descriptive <I> for fallback case | stormpath_stormpath-sdk-node | train | js |
ad7c2f2c3967985a2ba7f223a2a03c9e287e21af | diff --git a/lib/gir_ffi/out_pointer.rb b/lib/gir_ffi/out_pointer.rb
index <HASH>..<HASH> 100644
--- a/lib/gir_ffi/out_pointer.rb
+++ b/lib/gir_ffi/out_pointer.rb
@@ -1,12 +1,14 @@
+require 'gir_ffi/in_out_pointer'
+
module GirFFI
# The OutPointer class handles setup of pointers and their conversion to
# ruby types for arguments with direction :out.
- class OutPointer < FFI::Pointer
+ class OutPointer < InOutPointer
def self.for type
- ffi_type = InOutPointer.type_to_ffi_type type
+ ffi_type = type_to_ffi_type type
ptr = AllocationHelper.safe_malloc(FFI.type_size ffi_type)
ptr.send "put_#{ffi_type}", 0, 0
- self.new ptr
+ self.new ptr, type, ffi_type
end
end
end | Base OutPointer on InOutPointer. Preparing for merge. | mvz_gir_ffi | train | rb |
dbc7ac8dd9af9602c4617b86861dd39e34f72089 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -147,10 +147,10 @@ def call_scm(options, *args, **kwargs):
raise ValueError("Unknown SCM type `%s'" % __pkg_data__.SCM)
try:
process = Popen(options, *args, **kwargs)
- except OSError as e:
- print("Error calling `%s`, is %s installed? [%s]"
- % (options[0], __pkg_data__.SCM, e))
- sys.exit(1)
+ except OSError:
+ print("Error calling `%s`, is %s installed?"
+ % (options[0], __pkg_data__.SCM))
+ raise
process.wait()
if not process.returncode == 0:
print("`%s' completed with %i return code" | Fixes to run with Python <I>. | JNRowe_pyisbn | train | py |
f32b1f10bb87243600192a26ab1b5ad5df1c17c3 | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -143,7 +143,7 @@ module.exports = function(grunt) {
grunt.registerTask(
'build',
'Creates a temporary build of the library in the build folder, then runs the specs on it.',
- [ 'clean:dist', 'compile', 'spec' ]
+ [ 'clean:build', 'compile', 'spec' ]
);
grunt.registerTask( | Don't remove dist files when building | nicklandgrebe_active-resource.js | train | js |
f1aa240117a3359b5042de8e98b13f2c95889ce4 | diff --git a/canvasvg.py b/canvasvg.py
index <HASH>..<HASH> 100644
--- a/canvasvg.py
+++ b/canvasvg.py
@@ -258,7 +258,7 @@ def convert(document, canvas, items=None, tounicode=None):
for attr, value in style.items():
- if value: # create only nonempty attributes
+ if value != '': # create only nonempty attributes
element.setAttribute(attr, str(value))
return elements | Fix style attributes setting
The code to set all the style attributes uses a check to only set
those attributes that are not of the default value. The check should
have checked only for empty strings, but it just checked if the value
evaluated to False. This leads to incorrect behaviour if something
should be set to zero, because zero also evaluates to False (and
for some attributes zero is not the default value).
Now the check is for an empty string as value. | WojciechMula_canvas2svg | train | py |
80010b1ca0303fb83cc039cc400271f7d879be3d | diff --git a/src/Market/History/MarketHistory.php b/src/Market/History/MarketHistory.php
index <HASH>..<HASH> 100644
--- a/src/Market/History/MarketHistory.php
+++ b/src/Market/History/MarketHistory.php
@@ -5,7 +5,6 @@ namespace EveOnline\Market\History;
use GuzzleHttp\Client;
use GuzzleHttp\Pool;
use GuzzleHttp\Psr7\Request;
-use \Carbon\Carbon;
class MarketHistory {
diff --git a/src/Market/Orders/Order.php b/src/Market/Orders/Order.php
index <HASH>..<HASH> 100644
--- a/src/Market/Orders/Order.php
+++ b/src/Market/Orders/Order.php
@@ -2,8 +2,6 @@
namespace EveOnline\Market\Orders;
-use Illuminate\Database\Eloquent\Collection;
-
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Request;
@@ -124,7 +122,7 @@ class Order {
protected function getRegionDetails($regionHref) {
$response = $this->client->request('GET', $regionHref);
-
+
return json_decode($response->getBody()->getContents());
} | removed some imports that are no loner needed. | AdamKyle_EvePublicCrest | train | php,php |
1f4322a52f092299699dc7abe217b447c8127f1b | diff --git a/test/test-role-from-tag.js b/test/test-role-from-tag.js
index <HASH>..<HASH> 100644
--- a/test/test-role-from-tag.js
+++ b/test/test-role-from-tag.js
@@ -115,7 +115,6 @@ describe('loud', function() {
'<input type="number" min="0" value="1" max="4">': ['spinbutton', 1],
'<progress value="1">': ['progressbar', 1],
- '<progress value="10">': ['progressbar', 10],
'<progress min="0" value="1" max="4">': ['progressbar', 25, 'percent'],
'<dd>Content</dd>': ['Content'], | Drop testing an arbitrary value of <progress>
IE<I> expect a value for <progress> between 0 and 1. | ruslansagitov_loud | train | js |
87a580ac437328a6dc45c9c21242323e3765cc7e | diff --git a/pagoda/physics.py b/pagoda/physics.py
index <HASH>..<HASH> 100644
--- a/pagoda/physics.py
+++ b/pagoda/physics.py
@@ -1043,33 +1043,33 @@ class World(base.World):
@property
def cfm(self):
- '''Current default CFM value for the world.'''
+ '''Current global CFM value.'''
return self.ode_world.getCFM()
@cfm.setter
def cfm(self, cfm):
- '''Set the current default CFM value in the world.
+ '''Set the global CFM value.
Parameters
----------
cfm : float
- The CFM value that should be the world default.
+ The desired global CFM value.
'''
return self.ode_world.setCFM(cfm)
@property
def erp(self):
- '''Current default ERP value for the world.'''
+ '''Current global ERP value.'''
return self.ode_world.getERP()
@erp.setter
def erp(self, erp):
- '''Set the current default ERP value in the world.
+ '''Set the global ERP value.
Parameters
----------
erp : float
- The ERP value that should be the world default.
+ The desired global ERP value.
'''
return self.ode_world.setERP(erp) | Fix global CFM/ERP docstrings. | EmbodiedCognition_pagoda | train | py |
cb25dd72abec854b359ca8194cb07b2571d950d4 | diff --git a/modules/caddyhttp/reverseproxy/command.go b/modules/caddyhttp/reverseproxy/command.go
index <HASH>..<HASH> 100644
--- a/modules/caddyhttp/reverseproxy/command.go
+++ b/modules/caddyhttp/reverseproxy/command.go
@@ -18,6 +18,7 @@ import (
"encoding/json"
"flag"
"fmt"
+ "net"
"net/http"
"net/url"
"strings"
@@ -80,6 +81,14 @@ func cmdReverseProxy(fs caddycmd.Flags) (int, error) {
return caddy.ExitCodeFailedStartup, fmt.Errorf("parsing 'to' URL: %v", err)
}
+ if toURL.Port() == "" {
+ toPort := "80"
+ if toURL.Scheme == "https" {
+ toPort = "443"
+ }
+ toURL.Host = net.JoinHostPort(toURL.Host, toPort)
+ }
+
ht := HTTPTransport{}
if toURL.Scheme == "https" {
ht.TLS = new(TLSConfig) | reverse_proxy: Add port to upstream address if only implied in scheme | mholt_caddy | train | go |
2e892a21b5270e26339b983528ff7befe82d9e9c | diff --git a/models/check.js b/models/check.js
index <HASH>..<HASH> 100644
--- a/models/check.js
+++ b/models/check.js
@@ -19,6 +19,7 @@ var Check = new Schema({
maxTime : { type: Number, default: 1500 }, // time under which a ping is considered responsive
tags : [String],
lastChanged : Date,
+ firstTested : Date,
lastTested : Date,
isUp : Boolean,
isPaused : { type:Boolean, default: false },
@@ -54,8 +55,9 @@ Check.methods.removeStats = function(callback) {
Check.methods.needsPoll = function() {
if (this.isPaused) return false;
- if (!this.lastTested) return true;
- return (Date.now() - this.lastTested.getTime()) > (this.interval || 60000);
+ if (!this.firstTested) return true;
+ var delay = (this.lastTested.getTime() - this.firstTested.getTime()) % this.interval;
+ return (Date.now() - this.lastTested.getTime() + delay) >= (this.interval || 60000);
}
Check.methods.togglePause = function() {
@@ -64,6 +66,7 @@ Check.methods.togglePause = function() {
Check.methods.setLastTest = function(status, time) {
var now = time ? new Date(time) : new Date();
+ if (!this.firstTested) this.firstTested = now;
this.lastTested = now;
if (this.isUp != status) {
var event = new CheckEvent({ | Make actual polling interval more accurate.
Previously, the time necessary to actually poll a check would delay the
next poll. Now the reference is the first poll, and the interval between
two polls on a given check should be closer to the specified interval.
Closes #8. | fzaninotto_uptime | train | js |
434ed11fd16b90b2432954c777d6162690a8048c | diff --git a/PhpUnit/AbstractExtensionTestCase.php b/PhpUnit/AbstractExtensionTestCase.php
index <HASH>..<HASH> 100644
--- a/PhpUnit/AbstractExtensionTestCase.php
+++ b/PhpUnit/AbstractExtensionTestCase.php
@@ -45,9 +45,6 @@ abstract class AbstractExtensionTestCase extends AbstractContainerBuilderTestCas
* Call this method from within your test after you have (optionally) modified the ContainerBuilder for this test
* ($this->container).
*
- * If your extension(s) implements \Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface, you may
- * set $withPrependInvocation to TRUE to invoke prepend() method prior to load() method of your extension.
- *
* @param array $configurationValues
*/
protected function load(array $configurationValues = array())
@@ -55,7 +52,6 @@ abstract class AbstractExtensionTestCase extends AbstractContainerBuilderTestCas
$configs = array($this->getMinimalConfiguration(), $configurationValues);
foreach ($this->container->getExtensions() as $extension) {
-
if ($extension instanceof PrependExtensionInterface) {
$extension->prepend($this->container);
} | Removed outdated comment for AbstractExtensionTestCase::load method | SymfonyTest_SymfonyDependencyInjectionTest | train | php |
6315845a55e29d6a5a0e6a58d1a0f3c58f4019ca | diff --git a/lib/openstax/salesforce/version.rb b/lib/openstax/salesforce/version.rb
index <HASH>..<HASH> 100644
--- a/lib/openstax/salesforce/version.rb
+++ b/lib/openstax/salesforce/version.rb
@@ -1,5 +1,5 @@
module OpenStax
module Salesforce
- VERSION = '5.4.0'
+ VERSION = '6.0.0'
end
end | major version bump due to changing field names | openstax_openstax_salesforce | train | rb |
cb01858e8dd13d3f500df24ce57b9145c5019a6c | diff --git a/closure/goog/testing/testcase.js b/closure/goog/testing/testcase.js
index <HASH>..<HASH> 100644
--- a/closure/goog/testing/testcase.js
+++ b/closure/goog/testing/testcase.js
@@ -171,7 +171,7 @@ goog.testing.TestCase.maxRunTime = 200;
* techniques like tail cail optimization can affect the exact depth.
* @private @const
*/
-goog.testing.TestCase.MAX_STACK_DEPTH_ = 100;
+goog.testing.TestCase.MAX_STACK_DEPTH_ = 50;
/** | Cut goog.testing.TestCase.MAX_STACK_DEPTH_ in half to <I> to deflake stack recursion failures
-------------
Created by MOE: <URL> | google_closure-library | train | js |
9d5ef482b64fb9d34cf68c56728cf8a15f578064 | diff --git a/scripts/get_bank_registry_be.py b/scripts/get_bank_registry_be.py
index <HASH>..<HASH> 100644
--- a/scripts/get_bank_registry_be.py
+++ b/scripts/get_bank_registry_be.py
@@ -20,9 +20,8 @@ def process(URL):
row_count += 1
row = sheet.row_values(i)
column = 0
- registry_entry_template = {"bank_code": None, "bic": None,
- "country_code": "BE", "name": None,
- "primary": True, "short_name": None}
+ registry_entry_template = {"bank_code": None, "bic": None, "country_code": "BE",
+ "name": None, "primary": True, "short_name": None}
skip_row = False
for cell in row:
if column == 1: | Corrected indentation again.. | figo-connect_schwifty | train | py |
dd587e5abdd704f6d82a890d1b675ff33e30f395 | diff --git a/packages/ember-routing/lib/system/router.js b/packages/ember-routing/lib/system/router.js
index <HASH>..<HASH> 100644
--- a/packages/ember-routing/lib/system/router.js
+++ b/packages/ember-routing/lib/system/router.js
@@ -40,6 +40,7 @@ var slice = [].slice;
@class Router
@namespace Ember
@extends Ember.Object
+ @uses Ember.Evented
*/
var EmberRouter = EmberObject.extend(Evented, {
/** | [DOC release] Documented Evented for Router | emberjs_ember.js | train | js |
9690107869c66de4f1dbc34ada2c0e9461e18b28 | diff --git a/externs/es3.js b/externs/es3.js
index <HASH>..<HASH> 100644
--- a/externs/es3.js
+++ b/externs/es3.js
@@ -1663,7 +1663,9 @@ String.prototype.localeCompare = function(other) {};
* expression.
*
* @param {*} regexp
- * @return {Array|null}
+ * @return {Array.<string>} This should really return an Array with a few
+ * special properties, but we do not have a good way to model this in
+ * our type system. Also see Regexp.prototype.exec.
* @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/match
*/
String.prototype.match = function(regexp) {};
@@ -1843,7 +1845,9 @@ RegExp.prototype.compile = function(pattern, opt_flags) {};
/**
* @param {*} str The string to search.
- * @return {Array.<string>|null}
+ * @return {Array.<string>} This should really return an Array with a few
+ * special properties, but we do not have a good way to model this in
+ * our type system. Also see String.prototype.match.
* @see http://msdn.microsoft.com/en-us/library/z908hy33(VS.85).aspx
* @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/exec
*/ | Better type info for String.prototype.match
Fixes issue <I>
try #2
R=johnlenz
DELTA=6 (4 added, 0 deleted, 2 changed)
Revision created by MOE tool push_codebase.
MOE_MIGRATION=<I>
git-svn-id: <URL> | google_closure-compiler | train | js |
27da2fdcf8734fd3ce1b2d4ba6f3334674410405 | diff --git a/src/javascripts/ng-admin/Crud/routing.js b/src/javascripts/ng-admin/Crud/routing.js
index <HASH>..<HASH> 100644
--- a/src/javascripts/ng-admin/Crud/routing.js
+++ b/src/javascripts/ng-admin/Crud/routing.js
@@ -174,7 +174,7 @@ define(function (require) {
$stateProvider
.state('batchDelete', {
parent: 'main',
- url: '/batch-delete/:entity/{ids:json}',
+ url: '/:entity/batch-delete/{ids:json}',
controller: 'BatchDeleteController',
controllerAs: 'batchDeleteController',
templateProvider: templateProvider('BatchDeleteView', batchDeleteTemplate), | Switch new route to entity name first, too | marmelab_ng-admin | train | js |
606893b6f1244424ce5a29ce952e98af23aa4fc2 | diff --git a/src/Phpro/SoapClient/Middleware/BasicAuthMiddleware.php b/src/Phpro/SoapClient/Middleware/BasicAuthMiddleware.php
index <HASH>..<HASH> 100644
--- a/src/Phpro/SoapClient/Middleware/BasicAuthMiddleware.php
+++ b/src/Phpro/SoapClient/Middleware/BasicAuthMiddleware.php
@@ -48,7 +48,7 @@ class BasicAuthMiddleware extends Middleware
public function beforeRequest(callable $handler, RequestInterface $request, array $options)
{
$request = $request->withHeader(
- 'Authentication',
+ 'Authorization',
sprintf('Basic %s', base64_encode(
sprintf('%s:%s', $this->username, $this->password)
)) | Fixed authorization header for HTTP Basic Auth | phpro_soap-client | train | php |
1e84b4b7833e7347f1026c506177b462f0dcc940 | diff --git a/src/Doc/MethodDoc.js b/src/Doc/MethodDoc.js
index <HASH>..<HASH> 100644
--- a/src/Doc/MethodDoc.js
+++ b/src/Doc/MethodDoc.js
@@ -44,7 +44,9 @@ export default class MethodDoc extends AbstractDoc {
super['@param']();
if (this._value.params) return;
- this._value.params = ParamParser.guessParams(this._node.value.params);
+ if (this._value.kind !== 'set') {
+ this._value.params = ParamParser.guessParams(this._node.value.params);
+ }
}
['@return']() { | test: don't guess with set method. | esdoc_esdoc | train | js |
e25b62ee7513c25826565e67b392b794f75d008d | diff --git a/src/test/java/us/bpsm/edn/printer/PrinterTest.java b/src/test/java/us/bpsm/edn/printer/PrinterTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/us/bpsm/edn/printer/PrinterTest.java
+++ b/src/test/java/us/bpsm/edn/printer/PrinterTest.java
@@ -109,10 +109,10 @@ public class PrinterTest {
@Test
public void testPrettyPrinting() {
- Map<Integer, String> m = new HashMap();
+ Map<Integer, String> m = new LinkedHashMap();
m.put(3, "Three");
m.put(4, "Four");
- List<?> list = Arrays.asList(new HashSet(Arrays.asList(1, 2)), m);
+ List<?> list = Arrays.asList(new LinkedHashSet(Arrays.asList(1, 2)), m);
String s = Printers.printString(Printers.prettyPrinterProtocol(), list);
assertEquals("[\n #{\n 1\n 2\n }\n {\n 3 \"Three\"\n 4 \"Four\"\n }\n]", s);
} | Fix flaky test by using LinkedHashMap and LinkedHashSet | bpsm_edn-java | train | java |
9b53392fddc8fc751b947f59478a4eae951174ec | diff --git a/web/AccessMap.php b/web/AccessMap.php
index <HASH>..<HASH> 100644
--- a/web/AccessMap.php
+++ b/web/AccessMap.php
@@ -79,6 +79,7 @@ class AccessMap extends \mpf\base\LogAwareObject implements \mpf\interfaces\Acce
* @return boolean
*/
public function canAccess($controller, $action, $module = null) {
+ $module = is_array($module)?null:$module;
$rights = $this->getRightsFromMap($controller, $action, $module);
if ('*' == $rights[0]) {
return true; | Add a check for module so that params are not sent instead | mpf-soft_mpf | train | php |
ffc4dbb8d6dc134a23b9cbfdf3b174d54956b7a9 | diff --git a/visidata/vdtui.py b/visidata/vdtui.py
index <HASH>..<HASH> 100755
--- a/visidata/vdtui.py
+++ b/visidata/vdtui.py
@@ -494,6 +494,7 @@ class VisiData:
def sync(self, expectedThreads=0):
'Wait for all but expectedThreads async threads to finish.'
while len(self.unfinishedThreads) > expectedThreads:
+ time.sleep(.3)
self.checkForFinishedThreads()
def refresh(self): | [vdtui] sync() should sleep() in spin loop | saulpw_visidata | train | py |
4922b98e6469b77628a0bdfa491f8276132794de | diff --git a/manifest.php b/manifest.php
index <HASH>..<HASH> 100755
--- a/manifest.php
+++ b/manifest.php
@@ -33,7 +33,7 @@ return array(
'label' => 'Test-taker core extension',
'description' => 'TAO TestTaker extension',
'license' => 'GPL-2.0',
- 'version' => '3.11.3',
+ 'version' => '3.11.4',
'author' => 'Open Assessment Technologies, CRP Henri Tudor',
'requires' => array(
'tao' => '>=19.23.0', | Merge branch 'develop' into feature/TAO-<I>/add-dutch-language
# Conflicts:
# manifest.php
# scripts/update/Updater.php | oat-sa_extension-tao-testtaker | train | php |
d8ef8e013d43982085df17526780ac4bf9b0003c | diff --git a/galpy/orbit/Orbits.py b/galpy/orbit/Orbits.py
index <HASH>..<HASH> 100644
--- a/galpy/orbit/Orbits.py
+++ b/galpy/orbit/Orbits.py
@@ -1015,7 +1015,7 @@ class Orbits(object):
or (not type is None and type != self._aAType) \
or (not delta is None and hasattr(self._aA,'_delta')
and numpy.any(delta != self._aA._delta)) \
- or (not delta is None
+ or (delta is None
and hasattr(self,'_aA_delta_automagic')
and not self._aA_delta_automagic) \
or (not b is None and hasattr(self._aA,'_aAI') | Fix setting delta in the Orbits actionAngle functions again | jobovy_galpy | train | py |
114dae07e16e24f08ccee99ffa19003e1d1abba9 | diff --git a/src/command/command.php b/src/command/command.php
index <HASH>..<HASH> 100644
--- a/src/command/command.php
+++ b/src/command/command.php
@@ -35,6 +35,12 @@ abstract class Command {
/**
* @param $lines
+ *
+ * @throws \SMB\NotFoundException
+ * @throws \SMB\AlreadyExistsException
+ * @throws \SMB\AccessDeniedException
+ * @throws \SMB\NotEmptyException
+ * @throws \Exception
* @return bool
*/
protected function parseOutput($lines) {
diff --git a/src/command/put.php b/src/command/put.php
index <HASH>..<HASH> 100644
--- a/src/command/put.php
+++ b/src/command/put.php
@@ -18,6 +18,8 @@ class Put extends Command {
/**
* @param $lines
+ *
+ * @throws \SMB\NotFoundException
* @return bool
*/
protected function parseOutput($lines) {
@@ -29,6 +31,7 @@ class Put extends Command {
} else {
parent::parseOutput($lines);
}
+ return false;
}
}
} | Add @throws to phpdoc | icewind1991_SMB | train | php,php |
e076d7290d523759900ee1ba3c9843c7f324adc7 | diff --git a/activerecord/lib/active_record/enum.rb b/activerecord/lib/active_record/enum.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/enum.rb
+++ b/activerecord/lib/active_record/enum.rb
@@ -106,6 +106,7 @@ module ActiveRecord
end
def type_cast_from_database(value)
+ return if value.nil?
mapping.key(value.to_i)
end
diff --git a/activerecord/test/cases/enum_test.rb b/activerecord/test/cases/enum_test.rb
index <HASH>..<HASH> 100644
--- a/activerecord/test/cases/enum_test.rb
+++ b/activerecord/test/cases/enum_test.rb
@@ -168,19 +168,24 @@ class EnumTest < ActiveRecord::TestCase
assert_equal "'unknown' is not a valid status", e.message
end
+ test "NULL values from database should be casted to nil" do
+ Book.where(id: @book.id).update_all("status = NULL")
+ assert_nil @book.reload.status
+ end
+
test "assign nil value" do
@book.status = nil
- assert @book.status.nil?
+ assert_nil @book.status
end
test "assign empty string value" do
@book.status = ''
- assert @book.status.nil?
+ assert_nil @book.status
end
test "assign long empty string value" do
@book.status = ' '
- assert @book.status.nil?
+ assert_nil @book.status
end
test "constant to access the mapping" do | Fixed a bug where NULLs are casted into the first enum value | rails_rails | train | rb,rb |
a029ae0fc8202642d65e152f51a6be65b86582c4 | diff --git a/client-side/grido.js b/client-side/grido.js
index <HASH>..<HASH> 100644
--- a/client-side/grido.js
+++ b/client-side/grido.js
@@ -83,14 +83,19 @@
*/
initActions: function()
{
+ var _this = this;
$('.actions a', this.$table)
+ .off('click.nette')
.off('click.grido')
.on('click.grido', function(event) {
var hasConfirm = $(this).data('grido-confirm');
if (hasConfirm && !confirm(hasConfirm)) {
event.preventDefault();
event.stopImmediatePropagation();
- return false;
+ } else if (hasConfirm && $(this).hasClass('ajax') && _this.ajax) {
+ _this.ajax.doRequest(this.href);
+ event.preventDefault();
+ event.stopImmediatePropagation();
}
});
}, | Client side: Added support for ajaxified action links with confirmation dialog [Closed #<I>] | o5_grido | train | js |
edd1cad9e89fd711a4a5316c91a59948a9ac3dea | diff --git a/yangson/parser.py b/yangson/parser.py
index <HASH>..<HASH> 100644
--- a/yangson/parser.py
+++ b/yangson/parser.py
@@ -125,6 +125,17 @@ class Parser:
"""
return self.match_regex(ident_re, True, "YANG identifier")
+ def instance_name(self) -> QualName:
+ """Parse instance name."""
+ i1 = self.yang_identifier()
+ try:
+ next = self.peek()
+ except EndOfInput:
+ return (i1, None)
+ if next != ":": return (i1, None)
+ self.offset += 1
+ return (self.yang_identifier(), i1)
+
def skip_ws(self) -> None:
"""Skip optional whitespace."""
self.match_regex(ws_re) | Add method Parser::instance_name. | CZ-NIC_yangson | train | py |
26c97d42788ba1c7657bfba3a5945c665c806e59 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -59,7 +59,7 @@ setup(name='aiohttp_admin',
platforms=['POSIX'],
author="Nikolay Novik",
author_email="nickolainovik@gmail.com",
- url='',
+ url='https://github.com/jettify/aiohttp_admin',
download_url='',
license='Apache 2',
packages=find_packages(), | update url in setup.py | aio-libs_aiohttp_admin | train | py |
445a25583761f907cc30beb271dbb1f484c2fc30 | diff --git a/src/Consumer.php b/src/Consumer.php
index <HASH>..<HASH> 100644
--- a/src/Consumer.php
+++ b/src/Consumer.php
@@ -70,9 +70,7 @@ class Consumer extends Request
// consume
while (count($this->getChannel()->callbacks)) {
- $this->getChannel()->wait(
- null,
- !$this->getProperty('blocking'),
+ $this->getChannel()->wait(null, false,
$this->getProperty('timeout') ? $this->getProperty('timeout') : 0
);
} | Always operate in blocking mode
Due to changes in php-amqplib/php-amqplib#<I>, non-blocking mode does not use a timeout, which results in an infinite loop and high CPU.
This change ensures that only blocking mode is used.
Fixes #<I> | bschmitt_laravel-amqp | train | php |
5af2e615ea61b0db992d78b569706550e60ea775 | diff --git a/packages/size-limit/run.js b/packages/size-limit/run.js
index <HASH>..<HASH> 100644
--- a/packages/size-limit/run.js
+++ b/packages/size-limit/run.js
@@ -80,7 +80,7 @@ module.exports = async process => {
await calcAndShow()
if (hasArg('--watch')) {
- let watcher = chokidar.watch(['**/*.js', 'package.json'], {
+ let watcher = chokidar.watch(['**/*'], {
ignored: '**/node_modules/**'
})
watcher.on('change', throttle(calcAndShow)) | Improve watch mode (#<I>)
* Remove file extension from watch glob
* Remove package.json from watch patterns | ai_size-limit | train | js |
b16c214aca4474770c518e43ed496354b8786e28 | diff --git a/jaraco/__init__.py b/jaraco/__init__.py
index <HASH>..<HASH> 100644
--- a/jaraco/__init__.py
+++ b/jaraco/__init__.py
@@ -1,2 +1,10 @@
# this is a namespace package
-__import__('pkg_resources').declare_namespace(__name__)
\ No newline at end of file
+__import__('pkg_resources').declare_namespace(__name__)
+
+try:
+ # py2exe support (http://www.py2exe.org/index.cgi/ExeWithEggs)
+ import modulefinder
+ for p in __path__:
+ modulefinder.AddPackagePath(__name__, p)
+except ImportError:
+ pass | Updated namespace package to support py2exe | jaraco_jaraco.util | train | py |
8bde4559676f0ad9163960e7009ab4d777f4f6e9 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -99,8 +99,11 @@ export default function plugin (options = {}) {
if (dest.endsWith('.js')) {
dest = dest.slice(0, -3)
}
-
- return writeFileSync(`${dest}.css`, css)
+ dest = `${dest}.css`
+ ensureFileSync(dest, (err) => {
+ if (err) throw err
+ })
+ return writeFileSync(dest, css)
}
}
} | miss ensureFileSync when writeFileSync | differui_rollup-plugin-sass | train | js |
f384ccd8a832c262f64f633a58f9a61980ef9a8e | diff --git a/bits/47_styxml.js b/bits/47_styxml.js
index <HASH>..<HASH> 100644
--- a/bits/47_styxml.js
+++ b/bits/47_styxml.js
@@ -318,7 +318,7 @@ function parse_cellXfs(t, styles, opts) {
xf[cellXF_uint[i]] = parseInt(xf[cellXF_uint[i]], 10);
for(i = 0; i < cellXF_bool.length; ++i) if(xf[cellXF_bool[i]])
xf[cellXF_bool[i]] = parsexmlbool(xf[cellXF_bool[i]]);
- if(xf.numFmtId > 0x188) {
+ if(styles.NumberFmt && xf.numFmtId > 0x188) {
for(i = 0x188; i > 0x3c; --i) if(styles.NumberFmt[xf.numFmtId] == styles.NumberFmt[i]) { xf.numFmtId = i; break; }
}
styles.CellXf.push(xf); break; | Fix TypeError when styles don't have NumberFmt | SheetJS_js-xlsx | train | js |
fc1ec68d949a4823c0e6e2b3b5c9428f9687e79e | diff --git a/commands/delete.go b/commands/delete.go
index <HASH>..<HASH> 100644
--- a/commands/delete.go
+++ b/commands/delete.go
@@ -88,13 +88,17 @@ func delete(command *Command, args *Args) {
}
}
- err = gh.DeleteRepository(project)
- if err != nil && strings.Contains(err.Error(), "HTTP 403") {
- fmt.Println("Please edit the token used for hub at https://github.com/settings/tokens\nand verify that the `delete_repo` scope is enabled.\n")
+ if args.Noop {
+ ui.Printf("Would delete repository '%s'.\n", project)
+ } else {
+ err = gh.DeleteRepository(project)
+ if err != nil && strings.Contains(err.Error(), "HTTP 403") {
+ ui.Errorln("Please edit the token used for hub at https://github.com/settings/tokens")
+ ui.Errorln("and verify that the `delete_repo` scope is enabled.")
+ }
+ utils.Check(err)
+ ui.Printf("Deleted repository '%s'.\n", project)
}
- utils.Check(err)
-
- fmt.Printf("Deleted repository %v\n", repoName)
args.NoForward()
} | Respect `hub --noop delete <REPO>` mode | github_hub | train | go |
919bd5bebb1cf5d1f6e4813c2eaf1f74030eab24 | diff --git a/test/test.stats.quantiles.js b/test/test.stats.quantiles.js
index <HASH>..<HASH> 100644
--- a/test/test.stats.quantiles.js
+++ b/test/test.stats.quantiles.js
@@ -92,7 +92,7 @@ describe( 'stats/quantiles', function tests() {
*/
function onRead( error, actual ) {
expect( error ).to.not.exist;
- assert.deepEqual( JSON.parse( actual ), expected );
+ assert.deepEqual( actual[ 0 ], expected );
done();
} // end FUNCTION onRead()
}); | [UPDATE] quantiles test. | flow-io_flow.io | train | js |
fc03c217b9ebfbc7e6db82bcdd3b54a159580cd9 | diff --git a/core/src/test/java/org/testcontainers/utility/AuthenticatedImagePullTest.java b/core/src/test/java/org/testcontainers/utility/AuthenticatedImagePullTest.java
index <HASH>..<HASH> 100644
--- a/core/src/test/java/org/testcontainers/utility/AuthenticatedImagePullTest.java
+++ b/core/src/test/java/org/testcontainers/utility/AuthenticatedImagePullTest.java
@@ -45,7 +45,7 @@ public class AuthenticatedImagePullTest {
@ClassRule
public static GenericContainer<?> authenticatedRegistry = new GenericContainer<>(new ImageFromDockerfile()
.withDockerfileFromBuilder(builder -> {
- builder.from("registry:2")
+ builder.from("registry:2.7.0")
.run("htpasswd -Bbn testuser notasecret > /htpasswd")
.env("REGISTRY_AUTH", "htpasswd")
.env("REGISTRY_AUTH_HTPASSWD_PATH", "/htpasswd") | Pin registry image used for testing (#<I>)
As a workaround for <URL> | testcontainers_testcontainers-java | train | java |
66841716764e29be3d584a775d2cb2519ec3d2fe | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -543,6 +543,7 @@ export default class Carousel extends Component {
const style = [
containerCustomStyle || {},
+ { width: sliderWidth },
// LTR hack; see https://github.com/facebook/react-native/issues/11960
{ flexDirection: IS_RTL ? 'row-reverse' : 'row' }
]; | fix(module): prevent issues when 'sliderWidth' is smaller than viewport's width | archriss_react-native-snap-carousel | train | js |
4af6181d2e366809758402e0d2fa8bb70d766abd | diff --git a/org.eclipse.xtext/src/org/eclipse/xtext/linking/lazy/LazyLinkingResource.java b/org.eclipse.xtext/src/org/eclipse/xtext/linking/lazy/LazyLinkingResource.java
index <HASH>..<HASH> 100644
--- a/org.eclipse.xtext/src/org/eclipse/xtext/linking/lazy/LazyLinkingResource.java
+++ b/org.eclipse.xtext/src/org/eclipse/xtext/linking/lazy/LazyLinkingResource.java
@@ -105,7 +105,7 @@ public class LazyLinkingResource extends XtextResource {
@Named(CYCLIC_LINKING_DECTECTION_COUNTER_LIMIT)
@Inject(optional=true)
- private int cyclicLinkingDectectionCounterLimit = 100;
+ protected int cyclicLinkingDectectionCounterLimit = 100;
private int cyclicLinkingDetectionCounter = 0;
@@ -306,9 +306,9 @@ public class LazyLinkingResource extends XtextResource {
return null;
} finally {
if (cyclicLinkingDetectionCounter > cyclicLinkingDectectionCounterLimit) {
- resolving.remove(triple);
- }
- cyclicLinkingDetectionCounter--;
+ resolving.remove(triple);
+ }
+ cyclicLinkingDetectionCounter--;
}
} | review feedback
- indentation
- make counter limit protected | eclipse_xtext-core | train | java |
fdc3c31d734de4c788e7fc90cbab401a5acd157b | diff --git a/mailqueue/models.py b/mailqueue/models.py
index <HASH>..<HASH> 100644
--- a/mailqueue/models.py
+++ b/mailqueue/models.py
@@ -68,7 +68,8 @@ class MailerMessage(models.Model):
if self.pk is None:
self._save_without_sending()
- Attachment.objects.create(email=self, file_attachment=attachment, original_filename=attachment.file.name)
+ Attachment.objects.create(email=self, file_attachment=attachment,
+ original_filename=attachment.file.name.split('/')[-1])
def _save_without_sending(self, *args, **kwargs):
""" | original_filename should also be split from its path | dstegelman_django-mail-queue | train | py |
491813c6f3f67680ad385ebe00d18d5657d50ebe | diff --git a/Classes/TYPO3/Fluid/Core/Parser/SyntaxTree/ObjectAccessorNode.php b/Classes/TYPO3/Fluid/Core/Parser/SyntaxTree/ObjectAccessorNode.php
index <HASH>..<HASH> 100644
--- a/Classes/TYPO3/Fluid/Core/Parser/SyntaxTree/ObjectAccessorNode.php
+++ b/Classes/TYPO3/Fluid/Core/Parser/SyntaxTree/ObjectAccessorNode.php
@@ -96,13 +96,7 @@ class ObjectAccessorNode extends AbstractNode
if (is_object($subject)
&& preg_match('/^(is|has)([A-Z].*)/', $propertyName, $matches) > 0
&& is_callable([$subject, $propertyName])) {
- try {
- $subject = $subject->$propertyName();
- } catch (\Throwable $exception) {
- $subject = null;
- } catch (\Exception $exception) {
- $subject = null;
- }
+ $subject = $subject->$propertyName();
} else {
$subject = null;
} | TASK: removed is/has try-catch block
Removed redundant check again. | neos_fluid | train | php |
bf93e5089c11130cc386ad733bd4b405a30afebf | diff --git a/renku/service/entrypoint.py b/renku/service/entrypoint.py
index <HASH>..<HASH> 100644
--- a/renku/service/entrypoint.py
+++ b/renku/service/entrypoint.py
@@ -56,6 +56,7 @@ from renku.service.views.datasets import (
import_dataset_view,
list_dataset_files_view,
list_datasets_view,
+ remove_dataset_view,
unlink_file_view,
)
from renku.service.views.jobs import JOBS_BLUEPRINT_TAG, jobs_blueprint, list_jobs
@@ -137,6 +138,7 @@ def build_routes(app):
docs.register(create_dataset_view, blueprint=DATASET_BLUEPRINT_TAG)
docs.register(import_dataset_view, blueprint=DATASET_BLUEPRINT_TAG)
docs.register(edit_dataset_view, blueprint=DATASET_BLUEPRINT_TAG)
+ docs.register(remove_dataset_view, blueprint=DATASET_BLUEPRINT_TAG)
docs.register(unlink_file_view, blueprint=DATASET_BLUEPRINT_TAG)
docs.register(list_jobs, blueprint=JOBS_BLUEPRINT_TAG) | fix(service): add datasets.remove to swagger docs (#<I>) | SwissDataScienceCenter_renku-python | train | py |
c387df79d69cb8067843445003096881191d97bc | diff --git a/test/integration/OauthTest.php b/test/integration/OauthTest.php
index <HASH>..<HASH> 100755
--- a/test/integration/OauthTest.php
+++ b/test/integration/OauthTest.php
@@ -54,6 +54,9 @@ class OauthTestCase extends TaoPhpUnitTestRunner
$this->oauthCustomer->delete();
}
+ /**
+ * @doesNotPerformAssertions
+ */
public function testSignature()
{
$request = new common_http_Request('http://example.com/oauthtest'); | add doesNotPerformAssertions | oat-sa_extension-tao-lti | train | php |
2c4988950afb5186f6c16f825856efb167775473 | diff --git a/lib/xclarity_client/switch_management.rb b/lib/xclarity_client/switch_management.rb
index <HASH>..<HASH> 100644
--- a/lib/xclarity_client/switch_management.rb
+++ b/lib/xclarity_client/switch_management.rb
@@ -29,9 +29,8 @@ module XClarityClient
else
connection(BASE_URI)
end
- puts "HEEEEEY #{response.body}"
- body = JSON.parse(response.body) rescue {}
+ body = JSON.parse(response.body)
body.map do |switch|
Switch.new switch
end | [/Switches] Fixing client errors | lenovo_xclarity_client | train | rb |
2f3f5f961ebd671019af88e09ee9fe6bdc0d86ff | diff --git a/request.go b/request.go
index <HASH>..<HASH> 100644
--- a/request.go
+++ b/request.go
@@ -19,7 +19,7 @@ func newRequest(url string, method string, params ...interface{}) (*http.Request
}
request.Header.Set("Content-Type", "text/xml")
- request.Header.Set("Content-Lenght", fmt.Sprintf("%d", len(body)))
+ request.Header.Set("Content-Length", fmt.Sprintf("%d", len(body)))
return request, nil
} | Correct spelling of Content-Length header. | kolo_xmlrpc | train | go |
0ef73593e821acdcb8f704679d14920ad7dbfc39 | diff --git a/lib/discordrb/bot.rb b/lib/discordrb/bot.rb
index <HASH>..<HASH> 100644
--- a/lib/discordrb/bot.rb
+++ b/lib/discordrb/bot.rb
@@ -935,6 +935,10 @@ module Discordrb
v#{GATEWAY_VERSION} #{packet}"
invalidate_session
LOGGER.warn 'Session invalidated! All bets are off now.'
+
+ LOGGER.debug 'Reconnecting with IDENTIFY'
+ websocket_open # Since we just invalidated the session, pretending we just opened the WS again will re-identify
+ LOGGER.debug "Re-identified! Let's hope everything works fine."
return
end | Re-identify after invalidating the session because of an op9 | meew0_discordrb | train | rb |
00276afd7915d98d63a09fd773027634e9d916c0 | diff --git a/checker/tests/result_test.py b/checker/tests/result_test.py
index <HASH>..<HASH> 100644
--- a/checker/tests/result_test.py
+++ b/checker/tests/result_test.py
@@ -56,6 +56,7 @@ class OTSTest(TestCase):
name = __name__
path = '.'
+ @tags('required',)
def test_ots(self):
""" Is TTF file correctly sanitized for Firefox and Chrome """
stdout = prun('{0} {1}'.format(app.config['OTS_BINARY_PATH'], self.path), | test for ots is blocker | googlefonts_fontbakery | train | py |
5b85da7d94a207a88dfca60e2738df10c1212399 | diff --git a/header.go b/header.go
index <HASH>..<HASH> 100644
--- a/header.go
+++ b/header.go
@@ -69,9 +69,7 @@ func FormTagHeader() []byte {
// Size
// Function setSize in tag.go writes actual size of tag
- for i := 0; i < 4; i++ {
- b.WriteByte(0)
- }
+ b.Write([]byte{0, 0, 0, 0})
bytesBufPool.Put(b)
return b.Bytes() | * Use array of bytes instead of loop in FormTagHeader | bogem_id3v2 | train | go |
2053195f167526f4724f4a3f095f12ca1005248f | diff --git a/src/pandas_profiling/model/typeset.py b/src/pandas_profiling/model/typeset.py
index <HASH>..<HASH> 100644
--- a/src/pandas_profiling/model/typeset.py
+++ b/src/pandas_profiling/model/typeset.py
@@ -211,10 +211,12 @@ def typeset_types(config: Settings) -> Set[visions.VisionsBaseType]:
def is_timedependent(series: pd.Series) -> bool:
autocorrelation_threshold = config.vars.timeseries.autocorrelation
lags = config.vars.timeseries.lags
- for lag in lags:
- autcorr = series.autocorr(lag=lag)
- if autcorr >= autocorrelation_threshold:
- return True
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", RuntimeWarning)
+ for lag in lags:
+ autcorr = series.autocorr(lag=lag)
+ if autcorr >= autocorrelation_threshold:
+ return True
return False | feat: filter autocorrelation expected warnings | pandas-profiling_pandas-profiling | train | py |
00370fa50e8023dafa8e35c62099b04b8197c8e1 | diff --git a/speech_therapist.js b/speech_therapist.js
index <HASH>..<HASH> 100644
--- a/speech_therapist.js
+++ b/speech_therapist.js
@@ -158,7 +158,16 @@ macros.macroexpand = function (name) {
}
macros.defmacro = function (name, arglist, body) {
- macros[name] = eval (macros.lambda (arglist, body))
+ try {
+ macros[name] = eval (macros.lambda.apply (
+ undefined,
+ Array.prototype.slice.call (arguments, 1)
+ ))
+ } catch (e) {
+ sys.puts ("error in parsing macro " + name + ":")
+ sys.puts (indent (macros.lambda (arglist, body)))
+ throw e
+ }
}
var joinWith = function (string) { | [ better error reporting on failed macros ] | jbr_sibilant | train | js |
990562973b0b7a1937655f1cca7a513d2af32dc3 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@ from setuptools import setup, find_packages
setup(
name="sentry-sdk",
- version="0.1.0-preview15",
+ version="0.1.0-preview16",
author="Sentry Team and Contributors",
author_email="hello@getsentry.com",
url="https://github.com/getsentry/sentry-python", | release: <I>-preview<I> | getsentry_sentry-python | train | py |
71311fbaef2e0c4de4217eba30ffd05237256350 | diff --git a/mobanfile.py b/mobanfile.py
index <HASH>..<HASH> 100644
--- a/mobanfile.py
+++ b/mobanfile.py
@@ -12,6 +12,8 @@ from moban.utils import merge, parse_targets, git_clone
from moban.utils import expand_directories, pip_install
from moban.copier import Copier
+KNOWN_DOMAIN_FOR_GIT = ["github.com", "gitlab.com", "bitbucket.com"]
+
def find_default_moban_file():
for moban_file in constants.DEFAULT_MOBAN_FILES:
@@ -151,8 +153,10 @@ def handle_requires(requires):
def is_repo(require):
- return require.startswith("http") and (
- "github.com" in require
- or "gitlab.com" in require
- or "bitbucket.com" in require
- )
+ one_of_the_domain = False
+ for domain in KNOWN_DOMAIN_FOR_GIT:
+ if domain in require:
+ one_of_the_domain = True
+ break
+
+ return require.startswith("http") and one_of_the_domain | :hammer: code refactoring | moremoban_moban-handlebars | train | py |
5a648d2125deb4e5b7e62369378d8fa5c13818e6 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -2,10 +2,11 @@ from setuptools import setup
setup(
name='aufmachen',
- version='0.1-dev',
+ version='0.2.1',
url='http://github.com/fdb/aufmachen',
license='BSD',
author='Frederik & Jan De Bleser',
+ author_email='frederik@burocrazy.com',
description='Turns a website\'s HTML into nice, clean objects.',
packages=['aufmachen', 'aufmachen.websites'],
package_data = {'aufmachen': ['*.js']}, | Change version number, add author email. | fdb_aufmachen | train | py |
af1b433c12294fbfc24a5992d3e4c714c79d4cf2 | diff --git a/utility/src/test/java/com/networknt/utility/HashUtilTest.java b/utility/src/test/java/com/networknt/utility/HashUtilTest.java
index <HASH>..<HASH> 100644
--- a/utility/src/test/java/com/networknt/utility/HashUtilTest.java
+++ b/utility/src/test/java/com/networknt/utility/HashUtilTest.java
@@ -20,4 +20,12 @@ public class HashUtilTest {
Assert.assertTrue(HashUtil.validatePassword(password, hashedPass));
}
+ @Test
+ public void testClientSecretHash() throws Exception {
+ String secret = "f6h1FTI8Q3-7UScPZDzfXA";
+ String hashedPass = HashUtil.generateStorngPasswordHash(secret);
+ System.out.println("hashedSecret = " + hashedPass);
+ Assert.assertTrue(HashUtil.validatePassword(secret, hashedPass));
+ }
+
} | update test case to generate ahash for client secret | networknt_light-4j | train | java |
1ea862d86a972fa58dc9b96bf5064dc907189bb7 | diff --git a/src/notebook/epics/execute.js b/src/notebook/epics/execute.js
index <HASH>..<HASH> 100644
--- a/src/notebook/epics/execute.js
+++ b/src/notebook/epics/execute.js
@@ -218,10 +218,7 @@ export function executeCellObservable(channels, id, code) {
.filter(payload => payload.source === 'set_next_input');
// All child messages for the cell
- const cellMessages = iopub
- .filter(msg =>
- executeRequest.header.msg_id === msg.parent_header.msg_id
- );
+ const cellMessages = iopub.childOf(executeRequest);
const cellAction$ = Rx.Observable.merge(
Rx.Observable.of(updateCellStatus(id, 'busy')), | refactor(execute): compose children messages using childOf | nteract_nteract | train | js |
973871315eab20ca5a94aa0367fdffb5136f6558 | diff --git a/neurom/io/utils.py b/neurom/io/utils.py
index <HASH>..<HASH> 100644
--- a/neurom/io/utils.py
+++ b/neurom/io/utils.py
@@ -38,6 +38,7 @@ from . import load_data
from . import check
from neurom.utils import memoize
import os
+from collections import deque
@memoize | rabase changes
Revert "removed collections"
This reverts commit 1e1f<I>da3bbc2bb0c9bd<I>ec<I>b9be<I>c.
minor change
segment radial dists test
moved the specialized iterator inside the _impl feature
segment radial dists test
moved the specialized iterator inside the _impl feature | BlueBrain_NeuroM | train | py |
90219295a48bc29393a6232fdd295e47903fd737 | diff --git a/rest_auth/serializers.py b/rest_auth/serializers.py
index <HASH>..<HASH> 100644
--- a/rest_auth/serializers.py
+++ b/rest_auth/serializers.py
@@ -220,7 +220,7 @@ class PasswordResetConfirmSerializer(serializers.Serializer):
return attrs
def save(self):
- self.set_password_form.save()
+ return self.set_password_form.save()
class PasswordChangeSerializer(serializers.Serializer): | return user object from upstream method invocation | Tivix_django-rest-auth | train | py |
7d51341faca6566e1d0b58f8f37b8436fe7993f5 | diff --git a/src/Fixture/FixtureSet.php b/src/Fixture/FixtureSet.php
index <HASH>..<HASH> 100644
--- a/src/Fixture/FixtureSet.php
+++ b/src/Fixture/FixtureSet.php
@@ -29,7 +29,7 @@ class FixtureSet implements \IteratorAggregate
public function getLastModified()
{
- if (null === $this->lastModified) {
+ if (null === $this->lastModified && count($this->classes) > 0) {
$mtimes = array();
foreach ($this->classes as $class) { | Return null for last modified if no fixtures are available | driebit_prepper | train | php |
cbb008dadd9a03fbf3ee6cb4e1e92c01263cdce6 | diff --git a/tests/junit/org/jgroups/tests/ReconciliationTest.java b/tests/junit/org/jgroups/tests/ReconciliationTest.java
index <HASH>..<HASH> 100644
--- a/tests/junit/org/jgroups/tests/ReconciliationTest.java
+++ b/tests/junit/org/jgroups/tests/ReconciliationTest.java
@@ -31,9 +31,9 @@ import org.testng.annotations.Test;
* configured to use FLUSH
*
* @author Bela Ban
- * @version $Id: ReconciliationTest.java,v 1.10 2008/05/13 10:35:07 vlada Exp $
+ * @version $Id: ReconciliationTest.java,v 1.11 2008/05/20 16:01:59 belaban Exp $
*/
-@Test(groups="temp",sequential=true)
+@Test(groups=Global.FLUSH,sequential=true)
public class ReconciliationTest extends ChannelTestBase {
private List<JChannel> channels; | changed group from temp to FLUSH | belaban_JGroups | train | java |
cdfd9fa532f1b32fc74e956c5e4baaedbf56db85 | diff --git a/src/Charcoal/Admin/Widget/AttachmentWidget.php b/src/Charcoal/Admin/Widget/AttachmentWidget.php
index <HASH>..<HASH> 100644
--- a/src/Charcoal/Admin/Widget/AttachmentWidget.php
+++ b/src/Charcoal/Admin/Widget/AttachmentWidget.php
@@ -598,9 +598,10 @@ class AttachmentWidget extends AdminWidget implements
$formIdent = $attMeta['form_ident'];
}
- if (isset($attMeta['quick_form_ident'])) {
- $quickFormIdent = $attMeta['quick_form_ident'];
- }
+ $quickFormIdent = !$quickFormIdent && isset($attMeta['quick_form_ident'])
+ ? $attMeta['quick_form_ident'] : $quickFormIdent;
+ $quickFormIdent = !$quickFormIdent && isset($attMeta['quickFormIdent'])
+ ? $attMeta['quickFormIdent'] : $quickFormIdent;
if (isset($attMeta['fa_icon']) && !empty($attMeta['fa_icon'])) {
$faIcon = $attMeta['fa_icon']; | Fixed quickFormIdent not being set depending on camel or snake case | locomotivemtl_charcoal-attachment | train | php |
44985bc8faaa1c08902ef7d92c531060ae727272 | diff --git a/lib/logue/version.rb b/lib/logue/version.rb
index <HASH>..<HASH> 100755
--- a/lib/logue/version.rb
+++ b/lib/logue/version.rb
@@ -2,5 +2,5 @@
# -*- ruby -*-
module Logue
- VERSION = '1.0.17'
+ VERSION = '1.0.18'
end | Fix reference to whence file, which is now the file name instead of 'eval' | jpace_logue | train | rb |
971c89908a614cff9eb807b6d85bfe57ac4abb7f | diff --git a/seleniumbase/fixtures/base_case.py b/seleniumbase/fixtures/base_case.py
index <HASH>..<HASH> 100755
--- a/seleniumbase/fixtures/base_case.py
+++ b/seleniumbase/fixtures/base_case.py
@@ -1376,7 +1376,7 @@ class BaseCase(unittest.TestCase):
timeout = self._get_new_timeout(timeout)
is_ready = page_actions.wait_for_ready_state_complete(self.driver,
timeout)
- self.wait_for_angularjs()
+ self.wait_for_angularjs(timeout=settings.MINI_TIMEOUT)
return is_ready
def wait_for_angularjs(self, timeout=settings.LARGE_TIMEOUT, **kwargs): | If waiting for angularjs to load as part of ready state, wait less time | seleniumbase_SeleniumBase | train | py |
de7c1a36a9ed567d4e597c8e265f047565e8aaeb | diff --git a/tests/TestCase/Utility/Validate/Check/ViewsCheckTest.php b/tests/TestCase/Utility/Validate/Check/ViewsCheckTest.php
index <HASH>..<HASH> 100644
--- a/tests/TestCase/Utility/Validate/Check/ViewsCheckTest.php
+++ b/tests/TestCase/Utility/Validate/Check/ViewsCheckTest.php
@@ -30,6 +30,12 @@ class ViewsCheckTest extends TestCase
$this->assertTrue(is_int($result), "run() returned a non-integer result");
}
+ public function testRunNonEmpty() : void
+ {
+ $result = $this->check->run('Foo');
+ $this->assertTrue(is_int($result), "run() returned a non-integer result");
+ }
+
public function testRunTooManyColumns() : void
{
Configure::write('CsvMigrations.actions', ['too_many_columns']); | Test non-empty file (task #<I>) | QoboLtd_cakephp-csv-migrations | train | php |
515bffc62d31c02f15280d0e7d16e6b1204f3dd5 | diff --git a/src/Ouzo/Goodies/Tests/StreamStub.php b/src/Ouzo/Goodies/Tests/StreamStub.php
index <HASH>..<HASH> 100644
--- a/src/Ouzo/Goodies/Tests/StreamStub.php
+++ b/src/Ouzo/Goodies/Tests/StreamStub.php
@@ -46,6 +46,12 @@ class StreamStub
return [];
}
+ public function stream_seek($offset, $whence)
+ {
+ static::$position = $offset;
+ return true;
+ }
+
public function stream_close()
{
return null; | Added seek to StreamStub. | letsdrink_ouzo | train | php |
dfd74b5a72d842dd9e135c8f3b88f489cfbf4c16 | diff --git a/course/editsection.php b/course/editsection.php
index <HASH>..<HASH> 100644
--- a/course/editsection.php
+++ b/course/editsection.php
@@ -50,12 +50,7 @@
$stredit = get_string('edit', '', " $sectionname");
$strsummaryof = get_string('summaryof', '', " $sectionname");
} else {
- /// Look for section name into specific course format lang file
- $sectionname = get_string("name$course->format", "format_$course->format");
- if ($sectionname == "[[name$course->format]]") {
- /// Section name not in course format lang file, go to default moodle file
- $sectionname = get_string("name$course->format");
- }
+ $sectionname = get_section_name($course->format);
$stredit = get_string('edit', '', " $sectionname $section->section");
$strsummaryof = get_string('summaryof', '', " $sectionname $form->section");
} | MDL-<I> course format - discovered the get_section_name() that performs the fallback harcoded in previous commit. Merged from <I>_STABLE | moodle_moodle | train | php |
03776438fc9af4df82bfb7a836c1ddc709b577c1 | diff --git a/findbugs/src/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefAnalysis.java b/findbugs/src/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefAnalysis.java
index <HASH>..<HASH> 100644
--- a/findbugs/src/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefAnalysis.java
+++ b/findbugs/src/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefAnalysis.java
@@ -159,7 +159,7 @@ public class UnconditionalValueDerefAnalysis extends
if (DEBUG) {
System.out.println("XXX: " + handle.getPosition() + " " + handle.getInstruction());
}
- if (handle.getInstruction() instanceof ATHROW ) {
+ if (false && handle.getInstruction() instanceof ATHROW ) {
fact.clear();
fact.markAsOnExceptionPath();
} | turn this off; see what impact it has
git-svn-id: <URL> | spotbugs_spotbugs | train | java |
6cd9ebc183f24399c4b3f2a1b31d4aeddc8ad220 | diff --git a/src/cdp/transform.js b/src/cdp/transform.js
index <HASH>..<HASH> 100644
--- a/src/cdp/transform.js
+++ b/src/cdp/transform.js
@@ -89,8 +89,9 @@ module.exports = function transform(argv) {
await next();
// We need to remove the leading slash else it will be excluded by default
const url = ctx.url.substring(1);
- if (argv.instrument.testExclude.shouldInstrument(url) ||
- argv.transform.testExclude.shouldInstrument(url)) {
+ const shouldInstrument = argv.coverage && argv.instrument.testExclude.shouldInstrument(url);
+ const shouldTransform = argv.transform.testExclude.shouldInstrument(url);
+ if (shouldInstrument || shouldTransform) {
const { response } = ctx;
response.body = await transformFile(url, argv);
} | CDP - only instrument if `coverage` is thruthy | qlik-oss_after-work.js | train | js |
2fefab673e555462714281465a9bd78653240b06 | diff --git a/malcolm/core/methodmeta.py b/malcolm/core/methodmeta.py
index <HASH>..<HASH> 100644
--- a/malcolm/core/methodmeta.py
+++ b/malcolm/core/methodmeta.py
@@ -22,18 +22,12 @@ class MethodMeta(Meta):
def __init__(self, description="", tags=None, writeable=True, label=""):
super(MethodMeta, self).__init__(description, tags, writeable, label)
- self.func = None
self.set_takes(MapMeta())
self.set_returns(MapMeta())
self.set_defaults(OrderedDict())
# List of state names that we are writeable in
self.only_in = None
- def set_function(self, func):
- """Set the function to expose.
- """
- self.func = func
-
def set_takes(self, takes, notify=True):
"""Set the arguments and default values for the method | MethodMeta doesn't need a func any more | dls-controls_pymalcolm | train | py |
38faf009840d76b8e676abb5462abcd6589359cd | diff --git a/mod/quiz/locallib.php b/mod/quiz/locallib.php
index <HASH>..<HASH> 100644
--- a/mod/quiz/locallib.php
+++ b/mod/quiz/locallib.php
@@ -736,9 +736,7 @@ function quiz_question_action_icons($quiz, $cmid, $question, $returnurl){
$strview = get_string('view');
}
$html ='';
- if (($question->qtype != 'random')){
- $html .= quiz_question_preview_button($quiz, $question);
- }
+ $html .= quiz_question_preview_button($quiz, $question);
$questionparams = array('returnurl' => $returnurl, 'cmid'=>$cmid, 'id' => $question->id);
$questionurl = new moodle_url("$CFG->wwwroot/question/question.php", $questionparams);
if (question_has_capability_on($question, 'edit', $question->category) || question_has_capability_on($question, 'move', $question->category)) { | quiz editing: MDL-<I> added another random question preview link | moodle_moodle | train | php |
b7f7e778950472e444e74446e35e6eedb92de718 | diff --git a/includes/class-kirki-field.php b/includes/class-kirki-field.php
index <HASH>..<HASH> 100644
--- a/includes/class-kirki-field.php
+++ b/includes/class-kirki-field.php
@@ -569,10 +569,10 @@ class Kirki_Field {
$sanitize_callback = array( 'Kirki_Sanitize', 'checkbox' );
break;
case 'color' :
- $sanitize_callback = 'sanitize_hex_color';
+ $sanitize_callback = array( 'Kirki_Color', 'sanitize_hex' );
break;
case 'color-alpha' :
- $sanitize_callback = array( 'Kirki_Sanitize', 'rgba' );
+ $sanitize_callback = array( 'Kirki_Sanitize', 'color' );
break;
case 'image' :
$sanitize_callback = 'esc_url_raw'; | tweak sanitization callbacks for color controls | aristath_kirki | train | php |
32bb3627183bea36561e833855d6c076e3de97ec | diff --git a/lib/github_cli/api.rb b/lib/github_cli/api.rb
index <HASH>..<HASH> 100644
--- a/lib/github_cli/api.rb
+++ b/lib/github_cli/api.rb
@@ -10,7 +10,7 @@ module GithubCLI
# Access or initialize Github API client
#
# @api public
- def github_api(options)
+ def github_api(options={})
@github_api ||= begin
@github_api = configure(options)
end
@@ -19,7 +19,7 @@ module GithubCLI
# this could become a command such as configure that gets class options
#
# @api public
- def configure(options)
+ def configure(options={})
api = Github.new
config = GithubCLI.config.data
@@ -49,13 +49,13 @@ module GithubCLI
end
# Procoess response and output to shell
- #
+ # TODO: change to take options
# @api public
- def output(format=:table, &block)
+ def output(format=:table, quiet=false, &block)
GithubCLI.on_error do
response = block.call
if response.respond_to?(:body)
- formatter = Formatter.new response, :format => format
+ formatter = Formatter.new response, :format => format, :quiet => quiet
formatter.render_output
else
response | Pass through quiet option to api output. | piotrmurach_github_cli | train | rb |
cfcf220b0c9c53d941d9b97f8195c1fc1303e635 | diff --git a/lib/rules/link-req-noopener.js b/lib/rules/link-req-noopener.js
index <HASH>..<HASH> 100644
--- a/lib/rules/link-req-noopener.js
+++ b/lib/rules/link-req-noopener.js
@@ -14,7 +14,7 @@ module.exports = {
module.exports.lint = function (element, opts) {
function getVal(a, value) {
- return a && a.value && a.value;
+ return a && a.value;
}
var noopen = /(^| )(noopener|noreferrer)( |$)/; | Remove redundant condition from link-req-noopener.js | htmllint_htmllint | train | js |
1a723032cfee3b44144b74bde4c33a3ccd11f80f | diff --git a/vendor/joomla/libraries/joomla/environment/uri.php b/vendor/joomla/libraries/joomla/environment/uri.php
index <HASH>..<HASH> 100644
--- a/vendor/joomla/libraries/joomla/environment/uri.php
+++ b/vendor/joomla/libraries/joomla/environment/uri.php
@@ -233,7 +233,7 @@ class JURI extends JObject
$uri =& JURI::getInstance($live_site);
$base['prefix'] = $uri->toString( array('scheme', 'host', 'port'));
$base['path'] = rtrim($uri->toString( array('path')), '/\\');
- if(JPATH_BASE == JPATH_ADMINISTRATOR) {
+ if(str_replace('\\', '/', JPATH_BASE) == str_replace('\\', '/', JPATH_ADMINISTRATOR)) {
$base['path'] .= '/administrator';
}
} else { | fix: make path comparison separator independent | anahitasocial_anahita | train | php |
a4cf42d9cd351ebf0745c0d792a8f3a7d7dea170 | diff --git a/src/playbacks/no_op/no_op.js b/src/playbacks/no_op/no_op.js
index <HASH>..<HASH> 100644
--- a/src/playbacks/no_op/no_op.js
+++ b/src/playbacks/no_op/no_op.js
@@ -28,6 +28,7 @@ export default class NoOp extends Playback {
constructor(options) {
super(options)
this.options = options
+ this._noiseFrameNum = -1
}
render() {
@@ -40,6 +41,12 @@ export default class NoOp extends Playback {
}
noise() {
+ this._noiseFrameNum = (this._noiseFrameNum+1)%5
+ if (this._noiseFrameNum) {
+ // only update noise every 5 frames to save cpu
+ return
+ }
+
var idata = this.context.createImageData(this.context.canvas.width, this.context.canvas.height)
try {
@@ -56,7 +63,6 @@ export default class NoOp extends Playback {
var run = 0
var color = 0
var m = Math.random() * 6 + 4
-
for (var i = 0; i < len;) {
if (run < 0) {
run = m * Math.random(); | Reduce the frame rate of noop noise
To reduce the cpu load. | clappr_clappr | train | js |
772e9abf6d0c1d3e19535c04c688d19a95313125 | diff --git a/arcana/dataset/__init__.py b/arcana/dataset/__init__.py
index <HASH>..<HASH> 100644
--- a/arcana/dataset/__init__.py
+++ b/arcana/dataset/__init__.py
@@ -3,3 +3,4 @@ from .collection import DatasetCollection, FieldCollection
from .spec import DatasetSpec, FieldSpec, BaseSpec
from .base import BaseField, BaseDataset, BaseDatasetOrField
from .match import DatasetMatch, FieldMatch, BaseMatch
+from .file_format import FileFormat, Converter, IdentityConverter
diff --git a/arcana/dataset/base.py b/arcana/dataset/base.py
index <HASH>..<HASH> 100644
--- a/arcana/dataset/base.py
+++ b/arcana/dataset/base.py
@@ -1,7 +1,7 @@
from past.builtins import basestring
from builtins import object
from abc import ABCMeta
-from arcana.dataset.file_format import FileFormat
+from .file_format import FileFormat
from copy import copy
from logging import getLogger
from arcana.exception import ArcanaError | added relative import for new FileFormat location | MonashBI_arcana | train | py,py |
64e5cf915cbae7bc8619b77c3794c2e71f9cc0ec | diff --git a/lib/cli/list.js b/lib/cli/list.js
index <HASH>..<HASH> 100644
--- a/lib/cli/list.js
+++ b/lib/cli/list.js
@@ -32,7 +32,8 @@ module.exports = function (host, options) {
function each(host, handler) {
var rgx = /^\s*\/\*\*\s*@desc\s+(.*)\s*\*\//gm
Object.keys(host).forEach(function (taskname) {
- var desc = rgx.exec(host[taskname])
- handler(taskname, desc ? desc.pop() : '')
+ var arr = rgx.exec(host[taskname].toString())
+ var desc = arr ? arr.pop().replace(/\*\//, '') : ''
+ handler(taskname, desc)
})
} | ensure all task descriptions are read. closes #<I> | lukeed_taskr | train | js |
6da124c3ff9e8873d16710552f80d459c7f480e9 | diff --git a/src/rules/index.js b/src/rules/index.js
index <HASH>..<HASH> 100644
--- a/src/rules/index.js
+++ b/src/rules/index.js
@@ -3,5 +3,6 @@ export default {
"block-opening-brace-before": require("./block-opening-brace-before"),
"declaration-block-trailing-semicolon": require("./declaration-block-trailing-semicolon"),
"declaration-no-important": require("./declaration-no-important"),
+ "number-leading-zero": require("./number-leading-zero"),
"rule-set-no-single-line": require("./rule-set-no-single-line"),
} | Add number-leading-zero to rule index | stylelint_stylelint | train | js |
482f5342561e4c98a59c8793f1e5ddcd9462b37a | diff --git a/test/profilers/list_profsize.rb b/test/profilers/list_profsize.rb
index <HASH>..<HASH> 100644
--- a/test/profilers/list_profsize.rb
+++ b/test/profilers/list_profsize.rb
@@ -8,4 +8,3 @@ PublicSuffix::List.default
prof = ObjectBinsize.new
prof.report(PublicSuffix::List.default, label: "PublicSuffix::List size")
prof.report(PublicSuffix::List.default.instance_variable_get(:@rules), label: "Size of rules")
-prof.report(PublicSuffix::List.default.instance_variable_get(:@indexes), label: "Size of indexes") | The Hash implementation has no longer indexes | weppos_publicsuffix-ruby | train | rb |
0e4886d5a51dbfa5b3d3233c250b0414d8772ec3 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,9 @@
from distutils.core import setup, Extension
+import numpy
module1 = Extension("pymuvr",
- sources = ["pymuvr/Van_Rossum_Multiunit.cpp", "pymuvr/pymuvr.cpp"])
+ sources = ["pymuvr/Van_Rossum_Multiunit.cpp", "pymuvr/pymuvr.cpp"],
+ include_dirs = [numpy.get_include()])
setup (name = "pymuvr",
version = "1.0", | Fix importing numpy headers from nonstandard locations. | epiasini_pymuvr | train | py |
41cb1021215fe3714b9e364d5c2f0ffd46bd0816 | diff --git a/test/index_test.js b/test/index_test.js
index <HASH>..<HASH> 100644
--- a/test/index_test.js
+++ b/test/index_test.js
@@ -18,6 +18,8 @@ describe('cleanDeep()', () => {
bar: undefined,
baz: true,
biz: false,
+ buz: null,
+ net: '',
qux: 100
}
}; | Add missing tests to get full code coverage | nunofgs_clean-deep | train | js |
43406447916f641db1b1bd82596b58e0a3239d45 | diff --git a/thrift/thrift-gen/names.go b/thrift/thrift-gen/names.go
index <HASH>..<HASH> 100644
--- a/thrift/thrift-gen/names.go
+++ b/thrift/thrift-gen/names.go
@@ -113,7 +113,7 @@ func goPublicFieldName(name string) string {
}
var thriftToGo = map[string]string{
- "bool": "bool",
+ "bool": "bool",
"byte": "int8",
"i16": "int16",
"i32": "int32", | Run gofmt on all go files. | uber_tchannel-go | train | go |
32adfe483c64a0f4a99d2ee65a75163ecc4beb58 | diff --git a/library/CM/Clockwork/Manager.php b/library/CM/Clockwork/Manager.php
index <HASH>..<HASH> 100644
--- a/library/CM/Clockwork/Manager.php
+++ b/library/CM/Clockwork/Manager.php
@@ -94,9 +94,6 @@ class CM_Clockwork_Manager {
$this->_checkEventExists($eventName);
$this->_storage->fetchData();
$status = $this->_storage->getStatus($event);
- if ($status->isRunning()) {
- throw new CM_Exception_Invalid('Event is already running', null, ['eventName' => $eventName]);
- }
$status->setRunning(true)->setLastStartTime($startTime);
$this->_storage->setStatus($event, $status);
}
@@ -110,9 +107,6 @@ class CM_Clockwork_Manager {
$this->_checkEventExists($eventName);
$this->_storage->fetchData();
$status = $this->_storage->getStatus($event);
- if (!$status->isRunning()) {
- throw new CM_Exception_Invalid('Cannot stop event. Event is not running.', null, ['eventName' => $event->getName()]);
- }
$status->setRunning(false);
$this->_storage->setStatus($event, $status);
} | Do not throw exception on duplicate event stops/starts | cargomedia_cm | train | php |
345f50690bb4001241db765463e5618ea3a213f3 | diff --git a/lib/compile.js b/lib/compile.js
index <HASH>..<HASH> 100644
--- a/lib/compile.js
+++ b/lib/compile.js
@@ -62,6 +62,7 @@ function compile(path, options, cb, cacheUpdated) {
insertGlobals: options.insertGlobals,
detectGlobals: options.detectGlobals,
ignoreMissing: options.ignoreMissing,
+ basedir: options.basedir,
debug: options.debug,
standalone: options.standalone || false,
cache: cache ? cache.getCache() : undefined
diff --git a/lib/settings.js b/lib/settings.js
index <HASH>..<HASH> 100644
--- a/lib/settings.js
+++ b/lib/settings.js
@@ -42,7 +42,7 @@ exports.detectGlobals = true;
exports.standalone = false;
exports.noParse = [];
exports.extensions = [];
-exports.basedir = false;
+exports.basedir = undefined;
exports.grep = /\.js$/;
//set some safe defaults for | improve: add basedir option to be passed on | ForbesLindesay_browserify-middleware | train | js,js |
fe2b16de477032c61fa67f51c46a0cca482655c6 | diff --git a/examples/server/settings.py b/examples/server/settings.py
index <HASH>..<HASH> 100644
--- a/examples/server/settings.py
+++ b/examples/server/settings.py
@@ -118,5 +118,9 @@ try:
# Set the number of seconds each message shall persited
WS4REDIS_EXPIRE = 3600
+ WS4REDIS_HEARTBEAT = '--heartbeat--'
+
+ WS4REDIS_PREFIX = 'djangular'
+
except ImportError:
pass | added heartbeat and prefix for redis | jrief_django-angular | train | py |
ba8569bf40cba90e85d4047eeeddcc6559db102c | diff --git a/tools/c7n_azure/tests_azure/tests_resources/test_search.py b/tools/c7n_azure/tests_azure/tests_resources/test_search.py
index <HASH>..<HASH> 100644
--- a/tools/c7n_azure/tests_azure/tests_resources/test_search.py
+++ b/tools/c7n_azure/tests_azure/tests_resources/test_search.py
@@ -1,11 +1,13 @@
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
+import pytest
from ..azure_common import BaseTest, arm_template
class SearchTest(BaseTest):
@arm_template('search.json')
+ @pytest.mark.skiplive
def test_find_by_name(self):
p = self.load_policy({
'name': 'test-azure-search', | ci - azure - disable flakey functional test (#<I>) | cloud-custodian_cloud-custodian | train | py |
adabc37fd70f8d9291d23422c5ac80e476601f03 | diff --git a/api/router.js b/api/router.js
index <HASH>..<HASH> 100644
--- a/api/router.js
+++ b/api/router.js
@@ -25,7 +25,7 @@ module.exports = function($window, redrawService) {
if (waiting != null) update(payload, component, params, path)
else {
waiting = Promise.resolve(payload.onmatch(params, path))
- .then(function() {update(payload, component, params, path)})
+ .then(function(comp) {update(payload, comp != null ? comp : component, params, path)})
}
}
else update(payload, "div", params, path) | Handle resolving with a component | MithrilJS_mithril.js | train | js |
9fda8f131f92d57529fbc463103f9fc64fd4cf28 | diff --git a/anyconfig/backend/xml.py b/anyconfig/backend/xml.py
index <HASH>..<HASH> 100644
--- a/anyconfig/backend/xml.py
+++ b/anyconfig/backend/xml.py
@@ -35,11 +35,6 @@ from __future__ import absolute_import
from io import BytesIO
import sys
-
-import anyconfig.backend.base
-import anyconfig.compat
-import anyconfig.mdicts
-
try:
# First, try lxml which is compatible with elementtree and looks faster a
# lot. See also: http://getpython3.com/diveintopython3/xml.html
@@ -50,6 +45,10 @@ except ImportError:
except ImportError:
import elementtree.ElementTree as ET
+import anyconfig.backend.base
+import anyconfig.compat
+import anyconfig.mdicts
+
_PARAM_PREFIX = "@" | refactor: re-order imports to import standard lib/3rd party ones before app-specific ones | ssato_python-anyconfig | train | py |
ec6b83655189c288526c66cb2220a562e9c038bc | diff --git a/math/src/main/java/smile/math/random/UniversalGenerator.java b/math/src/main/java/smile/math/random/UniversalGenerator.java
index <HASH>..<HASH> 100644
--- a/math/src/main/java/smile/math/random/UniversalGenerator.java
+++ b/math/src/main/java/smile/math/random/UniversalGenerator.java
@@ -190,18 +190,7 @@ public class UniversalGenerator implements RandomNumberGenerator {
throw new IllegalArgumentException("n must be positive");
}
- // n is a power of 2
- if ((n & -n) == n) {
- return (int) ((n * (long) next(31)) >> 31);
- }
-
- int bits, val;
- do {
- bits = next(31);
- val = bits % n;
- } while (bits - val + (n - 1) < 0);
-
- return val;
+ return (int) (nextDouble() * n);
}
@Override | fix nextInt. UniversalGenerator generates uniformly distribute double values directly. The way of nextInt of MersenneTwister is improper here. | haifengl_smile | train | java |
821f0c7c91796a658db5f2dd2d47c1a40946ab7f | diff --git a/src/helpers.php b/src/helpers.php
index <HASH>..<HASH> 100755
--- a/src/helpers.php
+++ b/src/helpers.php
@@ -2,7 +2,6 @@
use Illuminate\Support\Str;
use InfyOm\Generator\Common\FileSystem;
-use InfyOm\Generator\Common\GeneratorField;
if (!function_exists('g_filesystem')) {
/** | refactor: unused import removed | InfyOmLabs_laravel-generator | train | php |
243543b0863a816c15e13fd05fc1ba8c457bf955 | diff --git a/spec/mangopay/shared_resources.rb b/spec/mangopay/shared_resources.rb
index <HASH>..<HASH> 100644
--- a/spec/mangopay/shared_resources.rb
+++ b/spec/mangopay/shared_resources.rb
@@ -210,6 +210,7 @@ shared_context 'payins' do
DebitedFunds: {Currency: 'EUR', Amount: 1000},
Fees: {Currency: 'EUR', Amount: 0},
ReturnURL: MangoPay.configuration.root_url,
+ Culture: "FR",
Tag: 'Test PayIn/PayPal/Web'
)
end | add culture property to paypal payin | Mangopay_mangopay2-ruby-sdk | train | rb |
6d08bb3a9982ca43bbf608669af15167e15b751f | diff --git a/peerset.go b/peerset.go
index <HASH>..<HASH> 100644
--- a/peerset.go
+++ b/peerset.go
@@ -1,7 +1,7 @@
package peerset
import (
- peer "gx/ipfs/QmZwZjMVGss5rqYsJVGy18gNbkTJffFyq2x1uJ4e4p3ZAt/go-libp2p-peer"
+ peer "gx/ipfs/QmZpD74pUj6vuxTp1o6LhA3JavC2Bvh9fsWPPVvHnD9sE7/go-libp2p-peer"
"sync"
) | update libp2p with go-multiaddr and go-stream-muxer updates
License: MIT | libp2p_go-libp2p-peer | train | go |
87bbebfb8da01f25bf93686607ea5a41e6474101 | diff --git a/lib/odf/cell.rb b/lib/odf/cell.rb
index <HASH>..<HASH> 100644
--- a/lib/odf/cell.rb
+++ b/lib/odf/cell.rb
@@ -28,9 +28,9 @@ module ODF
@type = opts[:type] || :string
unless value.instance_of?(Hash)
if [Date, DateTime, Time].include? value.class
- @value = value
+ @value = value.strftime("%Y-%m-%d")
else
- @value = value.to_s.strip
+ @value = value.to_s.strip
end
end
@@ -65,7 +65,7 @@ module ODF
def make_element_attributes(type, value, opts)
attrs = {'office:value-type' => type}
- attrs['office:date-value'] = value.strftime("%Y-%m-%d") if :date == type
+ attrs['office:date-value'] = value if :date == type
attrs['office:value'] = value if :float == type
attrs['table:formula'] = opts[:formula] unless opts[:formula].nil?
attrs['table:style-name'] = opts[:style] unless opts[:style].nil? | (refactoring) Move the format conversion | westonganger_rodf | train | rb |
ea9c0158df395d8507f32a575dc3822fa4d06b42 | diff --git a/src/server/pps/server/master.go b/src/server/pps/server/master.go
index <HASH>..<HASH> 100644
--- a/src/server/pps/server/master.go
+++ b/src/server/pps/server/master.go
@@ -475,7 +475,7 @@ func (a *apiServer) makeCronCommits(pachClient *client.APIClient, in *pps.Input)
return err
} else if commitInfo != nil && commitInfo.Finished == nil {
// and if there is, delete it
- if err = pachClient.DeleteCommit(in.Cron.Repo, "master"); err != nil {
+ if err = pachClient.DeleteCommit(in.Cron.Repo, commitInfo.Commit.ID); err != nil {
return err
}
} | Potentially avoid race in makeCronCommits | pachyderm_pachyderm | train | go |
62188571d7dd338372e6ce494bbd67a8b768c1d5 | diff --git a/src/crypto/SecretStorage.js b/src/crypto/SecretStorage.js
index <HASH>..<HASH> 100644
--- a/src/crypto/SecretStorage.js
+++ b/src/crypto/SecretStorage.js
@@ -53,7 +53,7 @@ export class SecretStorage extends EventEmitter {
}
setDefaultKeyId(keyId) {
- return new Promise((resolve) => {
+ return new Promise(async (resolve, reject) => {
const listener = (ev) => {
if (
ev.getType() === 'm.secret_storage.default_key' &&
@@ -65,10 +65,15 @@ export class SecretStorage extends EventEmitter {
};
this._baseApis.on('accountData', listener);
- this._baseApis.setAccountData(
- 'm.secret_storage.default_key',
- { key: keyId },
- );
+ try {
+ await this._baseApis.setAccountData(
+ 'm.secret_storage.default_key',
+ { key: keyId },
+ );
+ } catch (e) {
+ this._baseApis.removeListener('accountData', listener);
+ reject(e);
+ }
});
} | Fix setDefaultKeyId to fail if the request fails
It returned only when the echo came down the sync stream, but we
forgot to make it fail if the reuqest failed and it would just
never return in this case.
Fixes <URL> | matrix-org_matrix-js-sdk | train | js |
597a3d85b7751f265ce621e73b6280ae11072e52 | diff --git a/tests/phpunit/WordPressCoreInstallerTest.php b/tests/phpunit/WordPressCoreInstallerTest.php
index <HASH>..<HASH> 100644
--- a/tests/phpunit/WordPressCoreInstallerTest.php
+++ b/tests/phpunit/WordPressCoreInstallerTest.php
@@ -175,8 +175,15 @@ class WordPressCoreInstallerTest extends TestCase {
private function jpbExpectException( $class, $message = '', $isRegExp = false ) {
$this->expectException($class);
if ( $message ) {
- $isRegExp || $this->expectExceptionMessage( $message );
- $isRegExp && $this->expectExceptionMessageRegExp( $message );
+ if ( $isRegExp ) {
+ if ( method_exists( $this, 'expectExceptionMessageRegExp' ) ) {
+ $this->expectExceptionMessageRegExp( $message );
+ } else {
+ $this->expectExceptionMessageMatches( $message );
+ }
+ } else {
+ $this->expectExceptionMessage( $message );
+ }
}
} | Update test helpers to get regex matching working on latest version of phpunit | johnpbloch_wordpress-core-installer | train | php |
1c6509f23d92b16887703422d6707198b94bd713 | diff --git a/src/frontend/org/voltdb/AbstractTopology.java b/src/frontend/org/voltdb/AbstractTopology.java
index <HASH>..<HASH> 100644
--- a/src/frontend/org/voltdb/AbstractTopology.java
+++ b/src/frontend/org/voltdb/AbstractTopology.java
@@ -1368,6 +1368,24 @@ public class AbstractTopology {
}
/**
+ * get all the hostIds in the partition group
+ * contain the host(s) that have highest partition id
+ * @return all the hostIds in the partition group
+ */
+ public Set<Integer> getPartitionGroupPeersContainHighestPid() {
+ // find highest partition
+ int hPid = getPartitionCount() -1;
+
+ // find the host that contains the highest partition
+ Collection<Integer> hHostIds = getHostIdList(hPid);
+ if (hHostIds == null || hHostIds.isEmpty()) {
+ return Collections.emptySet();
+ }
+ int hHostId = hHostIds.iterator().next();
+ return getPartitionGroupPeers(hHostId);
+ }
+
+ /**
* get all the hostIds in the partition group where the host with the given host id belongs
* @param hostId the given hostId
* @return all the hostIds in the partition group | ENG-<I>: always rely on current topo for figuring out highest parti… (#<I>)
* ENG-<I>: always rely on current topo for figuring out highest partiton group
* address the review | VoltDB_voltdb | train | java |
fc60969a42217cd4ea99869bd45ce83cda980318 | diff --git a/src/PrintSSH.php b/src/PrintSSH.php
index <HASH>..<HASH> 100644
--- a/src/PrintSSH.php
+++ b/src/PrintSSH.php
@@ -135,7 +135,7 @@ class PrintSSH
$remoteFile = $this->uploadFile($localFile);
- $printCommand = "lp -d $printerName -n $copies";
+ $printCommand = "lpr -P $printerName -# $copies";
$optionString = '';
foreach ($options as $optionsName => $value) { | Moved from lp to lpr | pengstrom_pdfprint-lib | train | php |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.