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 |
|---|---|---|---|---|---|
c232d5d825c581c80063939ec6c628c755c2f8c2 | diff --git a/src/LiveProperty.php b/src/LiveProperty.php
index <HASH>..<HASH> 100644
--- a/src/LiveProperty.php
+++ b/src/LiveProperty.php
@@ -23,7 +23,8 @@ trait LiveProperty {
return $this->$methodName();
}
- if(isset(self::PROPERTY_ATTRIBUTE_MAP[$name])) {
+ if(defined("static::PROPERTY_ATTRIBUTE_MAP")
+ && isset(self::PROPERTY_ATTRIBUTE_MAP[$name])) {
$attribute = self::PROPERTY_ATTRIBUTE_MAP[$name];
if($attribute === true) {
return $this->hasAttribute($name); | Check property attribute map (#<I>)
* Update fixes for CssXPath
* Use get/set attribute for value elements
* Check for property map, allowing for non-html documents | PhpGt_Dom | train | php |
7d5994b3f8ed80a0a0d888f3444f59d0a48c1b57 | diff --git a/stream-listener.js b/stream-listener.js
index <HASH>..<HASH> 100644
--- a/stream-listener.js
+++ b/stream-listener.js
@@ -18,7 +18,7 @@ var StreamListener = function() {
Events.EventEmitter.call(this);
this.subscriptions = {};
- this.resetStream();
+ this.stream = null;
}
Util.inherits(StreamListener, Events.EventEmitter);
@@ -76,7 +76,10 @@ StreamListener.prototype.resetStream = function() {
this.stream.on('tweet', function(tweet) {
this.onTweet(tweet);
});
- oldStream.stop();
+
+ if(oldStream) {
+ oldStream.stop();
+ }
}
}; | Watch out when stream == null | mstaessen_twailer | train | js |
f7d0df5401701d23956de333c3d82cfd2b29b7f0 | diff --git a/src/Object.php b/src/Object.php
index <HASH>..<HASH> 100644
--- a/src/Object.php
+++ b/src/Object.php
@@ -44,6 +44,11 @@ abstract class Object implements ObjectInterface
protected $auto_increment = 'id';
/**
+ * @var string[]
+ */
+ protected $order_by = ['id'];
+
+ /**
* Array of field names
*
* @var array | Order by always needs to be set (and it is by ID by default) | activecollab_databaseobject | train | php |
07a6e99022b87a6442df84a8ac2b1b3732f847ba | diff --git a/lib/unidom/visitor/version.rb b/lib/unidom/visitor/version.rb
index <HASH>..<HASH> 100644
--- a/lib/unidom/visitor/version.rb
+++ b/lib/unidom/visitor/version.rb
@@ -1,5 +1,5 @@
module Unidom
module Visitor
- VERSION = '1.10'.freeze
+ VERSION = '1.11'.freeze
end
end | 1, Migrate the version from <I> to <I>. | topbitdu_unidom-visitor | train | rb |
d38b6a486cfd334c04829f43c20303b1c3c7d214 | diff --git a/pymatgen/analysis/structure_analyzer.py b/pymatgen/analysis/structure_analyzer.py
index <HASH>..<HASH> 100644
--- a/pymatgen/analysis/structure_analyzer.py
+++ b/pymatgen/analysis/structure_analyzer.py
@@ -28,7 +28,7 @@ from pymatgen import PeriodicSite
from pymatgen import Element, Specie, Composition
from pymatgen.util.num_utils import abs_cap
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
-
+from pymatgen.core.surface import Slab
class VoronoiCoordFinder(object):
"""
@@ -78,8 +78,9 @@ class VoronoiCoordFinder(object):
for nn, vind in voro.ridge_dict.items():
if 0 in nn:
if -1 in vind:
- # TODO: This is not acceptable
- continue
+ # Ignore infinite vertex if structure is a slab
+ if isinstance(self._structure, Slab):
+ continue
raise RuntimeError("This structure is pathological,"
" infinite vertex in the voronoi "
"construction") | cleanup structure_analyzer to allow infinite vertices in voronoi construction for slabs | materialsproject_pymatgen | train | py |
f51409103163582997b47504f1b9ef0f2f4b658b | diff --git a/can/interfaces/pcan.py b/can/interfaces/pcan.py
index <HASH>..<HASH> 100644
--- a/can/interfaces/pcan.py
+++ b/can/interfaces/pcan.py
@@ -117,6 +117,16 @@ class PcanBus(BusABC):
return complete_text
+ def StatusOk(self):
+ status = self.m_objPCANBasic.GetStatus(self.channel_info)
+
+ return status == PCAN_ERROR_OK
+
+ def Reset(self):
+ status = self.m_objPCANBasic.Reset(self.channel_info)
+
+ return status == PCAN_ERROR_OK
+
def recv(self, timeout=None):
start_time = timeout_clock() | Add PcanBus.StatusOk() and .Reset()
Would be nice to implement functions like these for all interfaces but
this will do for now. | hardbyte_python-can | train | py |
dc95dbfc82b105e3e402fa7d42b6ecd1f3a9334e | diff --git a/eng/common/docgeneration/templates/matthews/styles/main.js b/eng/common/docgeneration/templates/matthews/styles/main.js
index <HASH>..<HASH> 100644
--- a/eng/common/docgeneration/templates/matthews/styles/main.js
+++ b/eng/common/docgeneration/templates/matthews/styles/main.js
@@ -76,7 +76,7 @@ $(function () {
// Add text to empty links
$("p > a").each(function () {
var link = $(this).attr('href')
- if ($(this).text() === "") {
+ if ($(this).text() === "" && $(this).children().attr("src") === "") {
$(this).html(link)
}
}); | Fixed the bug of replacing img src with href text (#<I>) | Azure_azure-sdk-for-python | train | js |
d620a8ef20141addb917ff94773a6402c7c53bd1 | diff --git a/speclev.py b/speclev.py
index <HASH>..<HASH> 100644
--- a/speclev.py
+++ b/speclev.py
@@ -104,7 +104,6 @@ def speclev(x, nfft=512, fs=1, w=None, nov=None):
import numpy
import scipy.signal
- buffer(x, n, p=0, opt=None)
if w == None:
w = nfft
@@ -115,8 +114,8 @@ def speclev(x, nfft=512, fs=1, w=None, nov=None):
w = hanning(w)
P = numpy.zeros((nfft / 2, x.shape[1]))
-=`=jedi=0, =`= (*_**_*) =`=jedi=`=
- for k in range(len(x.shape[1]):
+
+ for k in range(len(x.shape[1])):
X, z = buffer(x[:, k], len(w), nov, 'nodelay', z_out=True)
X = scipy.signal.detrend(X) * w | fixed small errors in speclev.py | ryanjdillon_pyotelem | train | py |
53a93b55f8a3e4a8b49d8f8703a90f0c7a66ae1f | diff --git a/Kwf/Controller/Action/Component/PagesController.php b/Kwf/Controller/Action/Component/PagesController.php
index <HASH>..<HASH> 100644
--- a/Kwf/Controller/Action/Component/PagesController.php
+++ b/Kwf/Controller/Action/Component/PagesController.php
@@ -258,7 +258,7 @@ class Kwf_Controller_Action_Component_PagesController extends Kwf_Controller_Act
$component = $root->getComponentById($oldRow->id, array('ignoreVisible' => true));
while ($component) {
if (Kwc_Abstract::getFlag($component->componentClass, 'hasHome')) {
- if ($component == $homeComponent) {
+ if ($component === $homeComponent) {
$oldId = $oldRow->id;
$oldVisible = $oldRow->visible;
if (!$this->_hasPermissions($oldRow, 'makeHome')) { | Check if components are equal with object compare
Else it's running into infinite loop | koala-framework_koala-framework | train | php |
aca50121087e90a836215bc94fad068cc1dee68f | diff --git a/lib/shopify_api.rb b/lib/shopify_api.rb
index <HASH>..<HASH> 100644
--- a/lib/shopify_api.rb
+++ b/lib/shopify_api.rb
@@ -98,7 +98,7 @@ module ShopifyAPI
self.url, self.token = url, token
if params && params[:signature]
- unless self.class.validate_signature(params) && params[:timestamp] > 24.hours.ago.utc.to_i
+ unless self.class.validate_signature(params) && params[:timestamp].to_i > 24.hours.ago.utc.to_i
raise "Invalid Signature: Possible malicious login"
end
end | Ensure that we are comparing numbers, not strings. | Shopify_shopify_app | train | rb |
a5cb07b4298866666fa37704a1cf3131020166f0 | diff --git a/quark/test/test_emit.py b/quark/test/test_emit.py
index <HASH>..<HASH> 100644
--- a/quark/test/test_emit.py
+++ b/quark/test/test_emit.py
@@ -53,6 +53,8 @@ def test_emit(path):
comp.emit(backend)
extbase = os.path.join(base, backend.ext)
if not os.path.exists(extbase):
+ if Backend == JavaScript:
+ continue
os.makedirs(extbase)
srcs = []
@@ -117,7 +119,7 @@ def build_js(comp, base, srcs):
except IOError:
expected = None
convoluted_way_to_get_test_name = os.path.basename(os.path.dirname(base))
- script = convoluted_way_to_get_test_name + ".js.cmp"
+ script = convoluted_way_to_get_test_name + ".js"
actual = subprocess.check_output(["node", "-e", "m = require('./%s'); m.main();" % script], cwd=base)
if expected != actual:
open(out + ".cmp", "write").write(actual) | Add test-passing hack for JavaScript known failures | datawire_quark | train | py |
0f69d67a5a807946c19c45074ea4d594115b3b95 | diff --git a/lib/NormalModuleFactory.js b/lib/NormalModuleFactory.js
index <HASH>..<HASH> 100644
--- a/lib/NormalModuleFactory.js
+++ b/lib/NormalModuleFactory.js
@@ -217,7 +217,7 @@ NormalModuleFactory.prototype.resolveRequestArray = function resolveRequestArray
return resolver.resolve(contextInfo, context, item.loader + "-loader", function(err2) {
if(!err2) {
err.message = err.message + "\n" +
- "BREAKING CHANGE: It's no longer allowed to omit the '-loader' prefix when using loaders.\n" +
+ "BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders.\n" +
" You need to specify '" + item.loader + "-loader' instead of '" + item.loader + "'.";
}
callback(err); | Update `-loader`error message
`-loader` is a suffix, not a prefix. A prefix goes at the beginning of a word, and a suffix goes at the end. | webpack_webpack | train | js |
6b827f6ec6d92ee2539d4fdd0feec7d9cff85c7a | diff --git a/src/angular-zeroclipboard.js b/src/angular-zeroclipboard.js
index <HASH>..<HASH> 100644
--- a/src/angular-zeroclipboard.js
+++ b/src/angular-zeroclipboard.js
@@ -41,9 +41,12 @@ angular.module('zeroclipboard', [])
text: '@zeroclipText'
},
link: function(scope, element, attrs) {
+
+ var btn = element[0];
+ var _completeHnd;
+
// config
ZeroClipboard.config(zeroclipConfig);
- var btn = element[0];
if (angular.isFunction(ZeroClipboard)) {
scope.client = new ZeroClipboard(btn); | fixed "_completeHnd is undefined" issue | lisposter_angular-zeroclipboard | train | js |
30df3c50ebd64056c153d5850b967e7bb2a9bc87 | diff --git a/test/Model.js b/test/Model.js
index <HASH>..<HASH> 100644
--- a/test/Model.js
+++ b/test/Model.js
@@ -17,7 +17,6 @@ describe("Model", () => {
describe("Initalization", () => {
const options = [
- // TODO: Mongoose supports using the `new` keyword when creating a model with no error
{"name": "Using new keyword", "func": (...args) => new dynamoose.model(...args)},
{"name": "Without new keyword", "func": (...args) => dynamoose.model(...args)}
]; | Removing old todo that was already fixed | dynamoosejs_dynamoose | train | js |
e67d9faf2bf732b72c4f72efdd9e99821654cf7b | diff --git a/ryu/app/rest_firewall.py b/ryu/app/rest_firewall.py
index <HASH>..<HASH> 100644
--- a/ryu/app/rest_firewall.py
+++ b/ryu/app/rest_firewall.py
@@ -870,7 +870,7 @@ class Firewall(object):
rule = {REST_RULE_ID: ruleid}
rule.update({REST_PRIORITY: flow[REST_PRIORITY]})
rule.update(Match.to_rest(flow))
- rule.update(Action.to_rest(flow))
+ rule.update(Action.to_rest(self.dp, flow))
return rule
@@ -988,9 +988,10 @@ class Action(object):
return action
@staticmethod
- def to_rest(openflow):
+ def to_rest(dp, openflow):
if REST_ACTION in openflow:
- if len(openflow[REST_ACTION]) > 0:
+ action_allow = 'OUTPUT:%d' % dp.ofproto.OFPP_NORMAL
+ if openflow[REST_ACTION] == [action_allow]:
action = {REST_ACTION: REST_ACTION_ALLOW}
else:
action = {REST_ACTION: REST_ACTION_DENY} | firewall: correct acquisition result of DENY rule
When blocked packet logging is enabled,
GET rest command shows DENY rules as 'ALLOW' before.
This patch improves it. | osrg_ryu | train | py |
43447811a9b30ffb7d2436b3f42b7d9378e87b0f | diff --git a/nptdms/writer.py b/nptdms/writer.py
index <HASH>..<HASH> 100644
--- a/nptdms/writer.py
+++ b/nptdms/writer.py
@@ -6,7 +6,7 @@ try:
except ImportError:
OrderedDict = dict
from datetime import datetime
-from io import BytesIO
+from io import UnsupportedOperation
import logging
import numpy as np
from nptdms.common import toc_properties
@@ -276,10 +276,10 @@ def _map_property_value(value):
def to_file(file, array):
- """Wrapper around ndarray.tofile to support BytesIO
- """
- if isinstance(file, BytesIO):
+ """Wrapper around ndarray.tofile to support any file-like object"""
+
+ try:
+ array.tofile(file)
+ except (TypeError, UnsupportedOperation):
# tostring actually returns bytes
file.write(array.tostring())
- else:
- array.tofile(file) | added write support for file-like objects | adamreeve_npTDMS | train | py |
310e126e2e42e88e60739e79e6f7742406b74bce | diff --git a/lib/ddr/antivirus/adapters/clamd_scanner_adapter.rb b/lib/ddr/antivirus/adapters/clamd_scanner_adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/ddr/antivirus/adapters/clamd_scanner_adapter.rb
+++ b/lib/ddr/antivirus/adapters/clamd_scanner_adapter.rb
@@ -26,7 +26,7 @@ module Ddr
private
def command(path)
- `clamdscan --no-summary #{path}`.strip
+ `clamdscan --no-summary "#{path}"`.strip
end
end | Surrounds file path with quotes in clamdscan command.
Fixes #<I>
This is a quick fix! The long term solution should escape
special shell characters also. | duke-libraries_ddr-antivirus | train | rb |
7b21ff27d114e4e738c1034cba0af182f6f4c8dc | diff --git a/test/nightwatch.conf.js b/test/nightwatch.conf.js
index <HASH>..<HASH> 100644
--- a/test/nightwatch.conf.js
+++ b/test/nightwatch.conf.js
@@ -25,25 +25,25 @@ module.exports = {
test_settings: {
default: {
- // launch_url: 'http://localhost',
- // selenium_port: 4444,
- // selenium_host: 'localhost',
- // silent: true,
- // screenshots: {
- // enabled: true,
- // on_failure: true,
- // on_error: false,
- // path: 'screenshots/default'
- // },
- // desiredCapabilities: {
- // browserName: 'phantomjs',
- // javascriptEnabled: true,
- // acceptSslCerts: true,
- // 'phantomjs.binary.path' : phantomjs.path
- // }
- // },
- //
- // chrome: {
+ launch_url: 'http://localhost',
+ selenium_port: 4444,
+ selenium_host: 'localhost',
+ silent: true,
+ screenshots: {
+ enabled: true,
+ on_failure: true,
+ on_error: false,
+ path: 'screenshots/default'
+ },
+ desiredCapabilities: {
+ browserName: 'phantomjs',
+ javascriptEnabled: true,
+ acceptSslCerts: true,
+ 'phantomjs.binary.path' : phantomjs.path
+ }
+ },
+
+ chrome: {
desiredCapabilities: {
browserName: 'chrome',
javascriptEnabled: true, | Run tests on phantomjs | mucsi96_nightwatch-cucumber | train | js |
f99f284741585339512c50e43680ce5ac690d8c7 | diff --git a/osbs/cli/main.py b/osbs/cli/main.py
index <HASH>..<HASH> 100644
--- a/osbs/cli/main.py
+++ b/osbs/cli/main.py
@@ -6,7 +6,7 @@ This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import print_function, absolute_import, unicode_literals
-import collections
+import collections.abc
import json
import logging
@@ -35,7 +35,7 @@ def _print_pipeline_run_logs(pipeline_run, user_warnings_store):
pipeline_run_name = pipeline_run.pipeline_run_name
pipeline_run_logs = pipeline_run.get_logs(follow=True, wait=True)
- if not isinstance(pipeline_run_logs, collections.Iterable):
+ if not isinstance(pipeline_run_logs, collections.abc.Iterable):
logger.error("'%s' is not iterable; can't display logs", pipeline_run_name)
return
print(f"Pipeline run created ({pipeline_run_name}), watching logs (feel free to interrupt)") | Fix deprecated usage of collections module
Fixing:
DeprecationWarning: Using or importing the ABCs from 'collections'
instead of from 'collections.abc' is deprecated since Python <I>,
and in <I> it will stop working | projectatomic_osbs-client | train | py |
9cc0d54e20e7326e6ae5e7ed9df8bc086e7ed89f | diff --git a/Model/Behavior/BreadCrumbBehavior.php b/Model/Behavior/BreadCrumbBehavior.php
index <HASH>..<HASH> 100644
--- a/Model/Behavior/BreadCrumbBehavior.php
+++ b/Model/Behavior/BreadCrumbBehavior.php
@@ -5,7 +5,7 @@
*
* CakeTheme: Set theme for application.
* @copyright Copyright 2018, Andrey Klimov.
- * @package plugin.Controller.Component
+ * @package plugin.Model.Behavior
*/
App::uses('ModelBehavior', 'Model');
diff --git a/Model/Behavior/MoveBehavior.php b/Model/Behavior/MoveBehavior.php
index <HASH>..<HASH> 100644
--- a/Model/Behavior/MoveBehavior.php
+++ b/Model/Behavior/MoveBehavior.php
@@ -5,7 +5,7 @@
*
* CakeTheme: Set theme for application.
* @copyright Copyright 2016, Andrey Klimov.
- * @package plugin.Controller.Component
+ * @package plugin.Model.Behavior
*/
App::uses('ModelBehavior', 'Model'); | Fix tag @package in doc block of Behaviors | anklimsk_cakephp-theme | train | php,php |
c34c7ff2b7199c07259cf0d745d07ae7038f4584 | diff --git a/src/File.php b/src/File.php
index <HASH>..<HASH> 100644
--- a/src/File.php
+++ b/src/File.php
@@ -63,7 +63,7 @@ class File extends Object
}
$id = new \MongoDB\BSON\ObjectID;
- $this->_id = $id;
+ $this->__data['_id'] = $id;
$this->__filter = array('_id' => $id);
// Append uploadDate if not provided | Avoid to rewrite _id (Mongo 2.x issue only) | photon_storage-mongodb-object | train | php |
3b7c2e730d66deef4c9b21c58bc526e94213685a | diff --git a/lib/nmap/service.rb b/lib/nmap/service.rb
index <HASH>..<HASH> 100644
--- a/lib/nmap/service.rb
+++ b/lib/nmap/service.rb
@@ -136,6 +136,8 @@ module Nmap
# @return [String]
# The fingerprint
#
+ # @since 0.7.0
+ #
def fingerprint
@fingerprint ||= @node.get_attribute('servicefp')
end | Service#fingerprint was added in <I>. | sophsec_ruby-nmap | train | rb |
f7d7ff034e12e0455420b1f9974087547e8766ae | diff --git a/ciscosparkapi/exceptions.py b/ciscosparkapi/exceptions.py
index <HASH>..<HASH> 100644
--- a/ciscosparkapi/exceptions.py
+++ b/ciscosparkapi/exceptions.py
@@ -145,7 +145,7 @@ class SparkRateLimitError(SparkApiError):
super(SparkRateLimitError, self).__init__(response)
# Extended exception data attributes
- self.retry_after = response.headers.get('Retry-After', 200)
+ self.retry_after = int(response.headers.get('Retry-After', 200))
"""The `Retry-After` time period (in seconds) provided by Cisco Spark.
Defaults to 200 seconds if the response `Retry-After` header isn't | Ensure that the SparkRateLimitError.retry_after attribute is always an int
Fix for issue #<I>. The retry-after header (when provided) is a string and should be cast to an integer for obvious reasons. 😄 | CiscoDevNet_webexteamssdk | train | py |
bd3c6837bb423eef45576274705b039b92615607 | diff --git a/lib/echonest-ruby-api/artist.rb b/lib/echonest-ruby-api/artist.rb
index <HASH>..<HASH> 100644
--- a/lib/echonest-ruby-api/artist.rb
+++ b/lib/echonest-ruby-api/artist.rb
@@ -19,20 +19,18 @@ module Echonest
def biographies(options = { results: 1 })
response = get_response(results: options[:results], name: @name)
- biographies = []
- response[:biographies].each do |b|
- biographies << Biography.new(text: b[:text], site: b[:site], url: b[:url])
+
+ response[:biographies].collect do |b|
+ Biography.new(text: b[:text], site: b[:site], url: b[:url])
end
- biographies
end
def blogs(options = { results: 1 })
response = get_response(results: options[:results], name: @name)
- blogs = []
- response[:blogs].each do |b|
- blogs << Blog.new(name: b[:name], site: b[:site], url: b[:url])
+
+ response[:blogs].collect do |b|
+ Blog.new(name: b[:name], site: b[:site], url: b[:url])
end
- blogs
end
def familiarity | Refactor collection of blogs and biographies | maxehmookau_echonest-ruby-api | train | rb |
63d83f68a41acf7941813b3b68e9201d5babeda9 | diff --git a/state/state.go b/state/state.go
index <HASH>..<HASH> 100644
--- a/state/state.go
+++ b/state/state.go
@@ -1322,16 +1322,18 @@ func (st *State) AddService(args AddServiceArgs) (service *Service, err error) {
}
ops = append(ops, peerOps...)
- // Collect pending resource resolution operations.
- resources, err := st.Resources()
- if err != nil {
- return nil, errors.Trace(err)
- }
- resOps, err := resources.NewResolvePendingResourcesOps(args.Name, args.Resources)
- if err != nil {
- return nil, errors.Trace(err)
+ if len(args.Resources) > 0 {
+ // Collect pending resource resolution operations.
+ resources, err := st.Resources()
+ if err != nil {
+ return nil, errors.Trace(err)
+ }
+ resOps, err := resources.NewResolvePendingResourcesOps(args.Name, args.Resources)
+ if err != nil {
+ return nil, errors.Trace(err)
+ }
+ ops = append(ops, resOps...)
}
- ops = append(ops, resOps...)
// Collect unit-adding operations.
for x := 0; x < args.NumUnits; x++ { | Do not handle resources if none were requested. | juju_juju | train | go |
da6873bf32e1c25a02b5bf1639d57a3fee5c776b | diff --git a/ckanext/oauth2/oauth2.py b/ckanext/oauth2/oauth2.py
index <HASH>..<HASH> 100644
--- a/ckanext/oauth2/oauth2.py
+++ b/ckanext/oauth2/oauth2.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2014 CoNWeT Lab., Universidad Politécnica de Madrid
+# Copyright (c) 2018 Future Internet Consulting and Development Solutions S.L.
# This file is part of OAuth2 CKAN Extension.
@@ -114,9 +115,8 @@ class OAuth2Helper(object):
return token
def identify(self, token):
- oauth = OAuth2Session(self.client_id, token=token)
try:
- profile_response = oauth.get(self.profile_api_url + '?access_token=%s' % token['access_token'], verify=self.verify_https)
+ profile_response = requests.get(self.profile_api_url + '?access_token=%s' % token['access_token'], verify=self.verify_https)
except requests.exceptions.SSLError as e:
# TODO search a better way to detect invalid certificates
if "verify failed" in six.text_type(e): | Fix double authentication mechanism error returned by KeyRock 7.x | conwetlab_ckanext-oauth2 | train | py |
6caef97101b6c144daa736efe9203b2cc2aa254f | diff --git a/Classes/Report/SolrConfigurationStatus.php b/Classes/Report/SolrConfigurationStatus.php
index <HASH>..<HASH> 100644
--- a/Classes/Report/SolrConfigurationStatus.php
+++ b/Classes/Report/SolrConfigurationStatus.php
@@ -28,6 +28,7 @@ use ApacheSolrForTypo3\Solr\FrontendEnvironment;
use ApacheSolrForTypo3\Solr\System\Configuration\ExtensionConfiguration;
use ApacheSolrForTypo3\Solr\System\Records\Pages\PagesRepository;
use TYPO3\CMS\Core\Error\Http\ServiceUnavailableException;
+use TYPO3\CMS\Core\Exception\SiteNotFoundException;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Reports\Status;
@@ -160,6 +161,12 @@ class SolrConfigurationStatus extends AbstractSolrStatus
$rootPagesWithIndexingOff[] = $rootPage;
continue;
}
+ } catch (SiteNotFoundException $sue) {
+ if ($sue->getCode() == 1521716622) {
+ // No site found, continue with next site
+ $rootPagesWithIndexingOff[] = $rootPage;
+ continue;
+ }
}
} | [BUGFIX] Prevent SiteNotFoundException in reports module
Fixes: #<I> | TYPO3-Solr_ext-solr | train | php |
4097ff5c5faa67b4b9a00488c42c7b16b0fdd2fc | diff --git a/actionpack/test/dispatch/mapper_test.rb b/actionpack/test/dispatch/mapper_test.rb
index <HASH>..<HASH> 100644
--- a/actionpack/test/dispatch/mapper_test.rb
+++ b/actionpack/test/dispatch/mapper_test.rb
@@ -38,7 +38,7 @@ module ActionDispatch
def test_mapping_requirements
options = { :controller => 'foo', :action => 'bar', :via => :get }
- m = Mapper::Mapping.new({}, '/store/:name(*rest)', options)
+ m = Mapper::Mapping.build({}, '/store/:name(*rest)', options)
_, _, requirements, _ = m.to_route
assert_equal(/.+?/, requirements[:rest])
end | use the factory method to construct the mapping | rails_rails | train | rb |
2585123b77c969d615b3952a780f1d8ed5764d50 | diff --git a/restygwt/src/main/java/org/fusesource/restygwt/client/AbstractJsonEncoderDecoder.java b/restygwt/src/main/java/org/fusesource/restygwt/client/AbstractJsonEncoderDecoder.java
index <HASH>..<HASH> 100644
--- a/restygwt/src/main/java/org/fusesource/restygwt/client/AbstractJsonEncoderDecoder.java
+++ b/restygwt/src/main/java/org/fusesource/restygwt/client/AbstractJsonEncoderDecoder.java
@@ -382,7 +382,7 @@ abstract public class AbstractJsonEncoderDecoder<T> implements JsonEncoderDecode
JSONString string = value.isString();
if (string != null) {
try {
- return new BigDecimal(value.toString());
+ return new BigDecimal(string.stringValue());
} catch (NumberFormatException e) {
}
} | Fix to my previous BigDecimal deserialization fix
Previous fix didn't work as expected - instead of JSONString.stringValue I used toString which escapes string and in the end BigDecimal was not able to properly read a number. | resty-gwt_resty-gwt | train | java |
d6707f7fae06e47e856365fbf590dd3d00fc2693 | diff --git a/sonar-core/src/test/java/org/sonar/core/source/DecorationDataHolderTest.java b/sonar-core/src/test/java/org/sonar/core/source/DecorationDataHolderTest.java
index <HASH>..<HASH> 100644
--- a/sonar-core/src/test/java/org/sonar/core/source/DecorationDataHolderTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/source/DecorationDataHolderTest.java
@@ -51,7 +51,7 @@ public class DecorationDataHolderTest {
assertThat(lowerBoundsDefinitions.containsEntry(0, "cppd"));
assertThat(lowerBoundsDefinitions.containsEntry(54, "a"));
assertThat(lowerBoundsDefinitions.containsEntry(69, "k"));
- assertThat(lowerBoundsDefinitions.containsEntry(80, "symbol-80"));
+ assertThat(lowerBoundsDefinitions.containsEntry(80, "symbol-ππ80"));
assertThat(lowerBoundsDefinitions.containsEntry(90, "symbol-90"));
assertThat(lowerBoundsDefinitions.containsEntry(106, "cppd"));
assertThat(lowerBoundsDefinitions.containsEntry(114, "k")); | SONAR-<I> Changed symbols css class separator from period to hyphen | SonarSource_sonarqube | train | java |
945e7a71407382ec010fc8739b02fb92d4834b85 | diff --git a/website/siteConfig.js b/website/siteConfig.js
index <HASH>..<HASH> 100644
--- a/website/siteConfig.js
+++ b/website/siteConfig.js
@@ -3,8 +3,8 @@
module.exports = {
title: "Serviceberry",
tagline: "A simple HTTP service framework for Node.js",
- url: "https://serviceberry.js.org",
- baseUrl: "/",
+ url: "https://bob-gray.github.io",
+ baseUrl: "/serviceberry/",
headerLinks: [{
label: "Guides",
doc: "getting-started" | fixing url and baseUrl in website/siteConfig.js | bob-gray_serviceberry | train | js |
8eb411fcc961f7bef09d5e7eafb6f4cdbacf8cd6 | diff --git a/master/buildbot/util/service.py b/master/buildbot/util/service.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/util/service.py
+++ b/master/buildbot/util/service.py
@@ -309,7 +309,13 @@ class ClusteredBuildbotService(BuildbotService):
# this service is half-active, and noted as such in the db..
log.err(_why='WARNING: ClusteredService(%s) is only partially active' % self.name)
finally:
- yield self._stopActivityPolling()
+ # cannot wait for its deactivation
+ # with yield self._stopActivityPolling
+ # as we're currently executing the
+ # _activityPollCall callback
+ # we just call it without waiting its stop
+ # (that may open race conditions)
+ self._stopActivityPolling()
self._startServiceDeferred.callback(None)
except Exception:
# don't pass exceptions into LoopingCall, which can cause it to fail | service: clusteredService activityPoll does not wait for its stop
the previous version had a bug as the callback (_activityPoll)
of the object
_activityPollCall = task.LoopingCall(_activityPoll)
waited the activityPollCall to stop during its execution
thus creating a deadlock.
This commit just say the activityPollCall to stop
during the method, and exits without waiting for its end. | buildbot_buildbot | train | py |
18844f20c05d44b42f495eb850bd137f89cbc17c | diff --git a/lib/her/model/attributes.rb b/lib/her/model/attributes.rb
index <HASH>..<HASH> 100644
--- a/lib/her/model/attributes.rb
+++ b/lib/her/model/attributes.rb
@@ -162,7 +162,7 @@ module Her
attributes = klass.parse(record).merge(_metadata: parsed_data[:metadata],
_errors: parsed_data[:errors])
klass.new(attributes).tap do |record|
- record.instance_variable_set(:@changed_attributes, {})
+ record.send :clear_changes_information
record.run_callbacks :find
end
end | use clear_changes_information on activemodel | remiprev_her | train | rb |
dabf6a9928478560d9b2bdda7e83faaf9ba31a0e | diff --git a/src/geshi/powershell.php b/src/geshi/powershell.php
index <HASH>..<HASH> 100644
--- a/src/geshi/powershell.php
+++ b/src/geshi/powershell.php
@@ -47,7 +47,7 @@
************************************************************************************/
$language_data = array (
- 'LANG_NAME' => 'posh',
+ 'LANG_NAME' => 'PowerShell',
'COMMENT_SINGLE' => array(1 => '#'),
'COMMENT_MULTI' => array(),
'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, | fix: Internally renameed language powershell from 'posh' to 'PowerShell' | GeSHi_geshi-1.0 | train | php |
2b71e2e4982fbfa80a2d5f50310f4fb0170b8dcc | diff --git a/src/Sylius/Bundle/CoreBundle/Application/Kernel.php b/src/Sylius/Bundle/CoreBundle/Application/Kernel.php
index <HASH>..<HASH> 100644
--- a/src/Sylius/Bundle/CoreBundle/Application/Kernel.php
+++ b/src/Sylius/Bundle/CoreBundle/Application/Kernel.php
@@ -31,12 +31,12 @@ use Webmozart\Assert\Assert;
class Kernel extends HttpKernel
{
- public const VERSION = '1.2.14';
- public const VERSION_ID = '10214';
+ public const VERSION = '1.2.15-DEV';
+ public const VERSION_ID = '10215';
public const MAJOR_VERSION = '1';
public const MINOR_VERSION = '2';
- public const RELEASE_VERSION = '14';
- public const EXTRA_VERSION = '';
+ public const RELEASE_VERSION = '15';
+ public const EXTRA_VERSION = 'DEV';
/**
* {@inheritdoc} | Change application's version to <I>-DEV | Sylius_Sylius | train | php |
14cfa23496db909ac0f3526daa56051308c61de9 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -18,7 +18,7 @@ tests_requires = [
install_requires = [
'Celery>=3.1.15,<3.2',
'croniter>=0.3.4,<0.3.6',
- 'Django>=1.6.5,<1.7',
+ 'Django>=1.7.1,<1.8',
'django-auth-ldap==1.2.0',
'django-filter==0.7',
'django-fsm==2.2.0', | Bump Django version to <I>
NC-<I> | opennode_waldur-core | train | py |
e4674ac20ebe3a37c70bc93212797e3bd7452f3b | diff --git a/ui/src/admin/components/chronograf/Organization.js b/ui/src/admin/components/chronograf/Organization.js
index <HASH>..<HASH> 100644
--- a/ui/src/admin/components/chronograf/Organization.js
+++ b/ui/src/admin/components/chronograf/Organization.js
@@ -88,6 +88,7 @@ class Organization extends Component {
item={organization}
onCancel={this.handleDismissDeleteConfirmation}
onConfirm={this.handleDeleteOrg}
+ onClickOutside={this.handleDismissDeleteConfirmation}
/>
: <button
className="btn btn-sm btn-default btn-square" | Dismiss organization row delete/confirm buttons on click outside | influxdata_influxdb | train | js |
0f83ba67a4db2cdacbd3679479d26dbb584da978 | diff --git a/testing/models/test_epic.py b/testing/models/test_epic.py
index <HASH>..<HASH> 100644
--- a/testing/models/test_epic.py
+++ b/testing/models/test_epic.py
@@ -6,6 +6,7 @@ except ImportError:
import mock
from k2catalogue import models
+from k2catalogue import detail_object
@pytest.fixture
@@ -22,3 +23,11 @@ def test_simbad_query(epic):
with mock.patch('k2catalogue.models.Simbad') as Simbad:
epic.simbad_query(radius=2.)
Simbad.return_value.open.assert_called_once_with(radius=2.)
+
+
+def test_detail_object_query(epic):
+ with mock.patch('k2catalogue.detail_object.webbrowser.open') as mock_open:
+ detail_object.DetailObject(epic).open()
+ mock_open.assert_called_once_with(
+ 'http://deneb.astro.warwick.ac.uk/phrlbj/k2varcat/objects/12345.html'
+ ) | Add test for integration of DetailObject and EPIC | mindriot101_k2catalogue | train | py |
61adb290659c25ea2205fd73c50d5216bfc875a1 | diff --git a/grepfunc/grepfunc.py b/grepfunc/grepfunc.py
index <HASH>..<HASH> 100644
--- a/grepfunc/grepfunc.py
+++ b/grepfunc/grepfunc.py
@@ -231,9 +231,6 @@ def grep_iter(target, pattern, **kwargs):
if value is not None:
yield value
- # done iteration
- raise StopIteration
-
def __process_line(line, strip_eol, strip):
""" | Fixed bug coming from change in python<I> via PEP <I>. | RonenNess_grepfunc | train | py |
e6bff0cbf096a126af24ea673c6f836efc4b9c23 | diff --git a/domain-management/src/test/java/org/jboss/as/domain/management/security/AssertConsoleBuilder.java b/domain-management/src/test/java/org/jboss/as/domain/management/security/AssertConsoleBuilder.java
index <HASH>..<HASH> 100644
--- a/domain-management/src/test/java/org/jboss/as/domain/management/security/AssertConsoleBuilder.java
+++ b/domain-management/src/test/java/org/jboss/as/domain/management/security/AssertConsoleBuilder.java
@@ -54,7 +54,7 @@ import static org.junit.Assert.*;
* @author <a href="mailto:flemming.harms@gmail.com">Flemming Harms</a>
*/
public class AssertConsoleBuilder {
- private static String NEW_LINE = "\n";
+ private static String NEW_LINE = String.format("%n");
private enum Type {
DISPLAY, INPUT | fix for failed tests on windows
was: 3d<I>e<I>dc7ea<I>da<I>b<I>a<I>c3cea<I> | wildfly_wildfly-core | train | java |
8f8e5d31de7a3e28130ac4c38e6d498ad3dffd29 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@ version = '0.2'
install_requires = [
'babel',
'deskapi',
- 'txlib',
+ 'txlib-too',
] | EB-<I> Update the library being used
Summary: I created a new PyPi package with the updated info <URL> | eventbrite_localization_shuttle | train | py |
14e10764bad1029aaedd5fd59b27b5140fff84d5 | diff --git a/src/utils/cli.js b/src/utils/cli.js
index <HASH>..<HASH> 100644
--- a/src/utils/cli.js
+++ b/src/utils/cli.js
@@ -26,7 +26,6 @@ export const themes = {
aruba: 'grommet/scss/aruba/index',
hpinc: 'grommet/scss/hpinc/index',
dxc: 'grommet/scss/dxc/index'
-
};
export function capitalize(str) { | Cleaned up extra blank line from cli.js | grommet_grommet-cli | train | js |
56d5bed2650e2a448e58427e2967856ec39ada3e | diff --git a/lib/ruby2d/color.rb b/lib/ruby2d/color.rb
index <HASH>..<HASH> 100644
--- a/lib/ruby2d/color.rb
+++ b/lib/ruby2d/color.rb
@@ -67,6 +67,20 @@ module Ruby2D
end
return b
end
+ #convert from "#FFF000" to Float (0.0..1.0)
+ def hex_to_f(a)
+ c=[]
+ b=a.delete("#")
+ n=(b.length)
+ #n1=n/3
+ j=0
+ for i in (0..n-1).step(n/3)
+ c[j]=Integer("0x".concat(b[i,n/3]))
+ j=j+1
+ end
+ f = to_f(c)
+ return f
+ end
end
end | Implemented rgb hex to float conversion | ruby2d_ruby2d | train | rb |
21a4992065720832931fb12cb6546e3e1c0afc01 | diff --git a/smap-control-tutorial/zoneControllerService.py b/smap-control-tutorial/zoneControllerService.py
index <HASH>..<HASH> 100644
--- a/smap-control-tutorial/zoneControllerService.py
+++ b/smap-control-tutorial/zoneControllerService.py
@@ -98,14 +98,12 @@ class ZoneController(driver.SmapDriver):
def tempcb(self, _, data):
# list of arrays of [time, val]
print "ZoneController tempcb: ", data
- mostrecent = data[-1][-1]
- self.coolSP = mostrecent[1]
+
def thermcb(self, _, data):
# list of arrays of [time, val]
print "ZoneController thermcb: ", data
- mostrecent = data[-1][-1]
- self.coolSP = mostrecent[1]
+
class setpointActuator(actuate.ContinuousActuator): | tempcb and thermcb should not change coolSP | SoftwareDefinedBuildings_XBOS | train | py |
33515654645d7baceba5eaa98b3ba0ce767e2e35 | diff --git a/src/test/java/org/math/R/Issues.java b/src/test/java/org/math/R/Issues.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/math/R/Issues.java
+++ b/src/test/java/org/math/R/Issues.java
@@ -59,8 +59,7 @@ public class Issues {
System.out.println(txt);
//...
- System.out.println(s.installPackage("sensitivity", true)); //install and load R package
- System.out.println(s.installPackage("wavelets", true));
+ System.out.println(s.installPackage("booty", true)); //install and load R package
s.end();
} | remove dep to sensitivity. Use more standard package instead
Use more standard package instead | yannrichet_rsession | train | java |
19c62c1f7b10af3ab85573b505ba850981dbc4a1 | diff --git a/lib/transport.js b/lib/transport.js
index <HASH>..<HASH> 100644
--- a/lib/transport.js
+++ b/lib/transport.js
@@ -172,9 +172,11 @@ Transport.prototype.onSocketDrain = function () {
*/
Transport.prototype.onForcedDisconnect = function () {
- if (!this.disconnected && this.open) {
+ if (!this.disconnected) {
this.log.info('transport end by forced client disconnection');
- this.packet({ type: 'disconnect' });
+ if (this.open) {
+ this.packet({ type: 'disconnect' });
+ }
this.end(true);
}
}; | Fixed; force disconnection can still happen even with temporarily closed transports. | socketio_socket.io | train | js |
59a3b2295f1b96f085009aba5d14ab5be0d9d814 | diff --git a/src/queueState.js b/src/queueState.js
index <HASH>..<HASH> 100644
--- a/src/queueState.js
+++ b/src/queueState.js
@@ -14,7 +14,7 @@ export function queueState(reactComponent, newState) {
}
if (!reactComponent.updater.isMounted(reactComponent)) {
- reactComponent.setState(Object.assign(newState, reactComponent.state));
+ reactComponent.state = Object.assign(newState, reactComponent.state);
return;
} | Reverting previous update since it caused issues | ringa-js_react-ringa | train | js |
58c818e274de1e38ba047ddc540b7fc3f1e33f4e | diff --git a/Controller/ZoneController.php b/Controller/ZoneController.php
index <HASH>..<HASH> 100644
--- a/Controller/ZoneController.php
+++ b/Controller/ZoneController.php
@@ -269,7 +269,7 @@ class ZoneController extends Controller
if ($zonePublish instanceof ZonePublish) {
$zonePublishData = $zonePublish->getData();
if (!isset($zonePublishData['blockPublishList'][$renderer])) {
- return new Response('This zone is not published');
+ return new Response('');
}
$blockList = $zonePublishData['blockPublishList'][$renderer];
if ($reverseOrder) { | if a zone in a page is not published although the page is published | kitpages_KitpagesCmsBundle | train | php |
cfe36cf92b676a00f471ff08c8115ce2d21a139b | diff --git a/openquake/hazardlib/__init__.py b/openquake/hazardlib/__init__.py
index <HASH>..<HASH> 100644
--- a/openquake/hazardlib/__init__.py
+++ b/openquake/hazardlib/__init__.py
@@ -23,5 +23,5 @@ from openquake.hazardlib import (
tom, near_fault)
# the version is managed by packager.sh with a sed
-__version__ = '0.16.0'
+__version__ = '0.17.0'
__version__ += git_suffix(__file__) | update devel version to <I> | gem_oq-engine | train | py |
8a2daf010956a17f8374311da0c0489f4696a71d | diff --git a/openfisca_survey_manager/scenarios.py b/openfisca_survey_manager/scenarios.py
index <HASH>..<HASH> 100644
--- a/openfisca_survey_manager/scenarios.py
+++ b/openfisca_survey_manager/scenarios.py
@@ -635,10 +635,15 @@ class AbstractSurveyScenario(object):
if holder.variable.definition_period == YEAR and period.unit == MONTH:
# Some variables defined for a year are present in month/quarter dataframes
# Cleaning the dataframe would probably be better in the long run
+ log.warn('Trying to set a monthly value for variable {}, which is defined on a year. The montly values you provided will be summed.'
+ .format(column_name).encode('utf-8'))
+
if holder.get_array(period.this_year) is not None:
- assert holder.get_array(period.this_year) == np_array, "Inconsistency: yearly variable {} has already been declared with a different value.".format(column_name)
- holder.set_input(period.this_year, np_array)
- return
+ sum = holder.get_array(period.this_year) + np_array
+ holder.put_in_cache(sum, period.this_year)
+ else:
+ holder.put_in_cache(np_array, period.this_year)
+ continue
holder.set_input(period, np_array)
# @property
# def input_data_frame(self): | Fix adaptation to core <I> | openfisca_openfisca-survey-manager | train | py |
91134fb359dc889e3151ffc74d62199af314ef7e | diff --git a/src/modules/google.js b/src/modules/google.js
index <HASH>..<HASH> 100644
--- a/src/modules/google.js
+++ b/src/modules/google.js
@@ -47,7 +47,7 @@
// Reauthenticate
// https://developers.google.com/identity/protocols/
if (p.options.force) {
- p.qs.approval_prompt = 'force';
+ p.qs.prompt = 'consent';
}
}, | Updating Google prompt property name and value when forcing a reauthentication
- updating for the new property to force a re-authentication | MrSwitch_hello.js | train | js |
65060d2ca296ffd8c9802fcd764cdd1d0cbc0ba2 | diff --git a/test/test.js b/test/test.js
index <HASH>..<HASH> 100644
--- a/test/test.js
+++ b/test/test.js
@@ -248,7 +248,7 @@ describe('tyranid', function() {
describe('dynamic schemas', () => {
it( 'should support matching fieldsFor()', async () => {
- const fields = await Person.fieldsFor({ organizationId: 1 });
+ const fields = await Person.fieldsFor({ organization: 1 });
expect(Object.values(fields).length).to.be.eql(16);
}); | fix a typo in a test | tyranid-org_tyranid | train | js |
5b9067c0b83669283d42c89b204d02e55212701e | diff --git a/mu-plugins/base/base.php b/mu-plugins/base/base.php
index <HASH>..<HASH> 100644
--- a/mu-plugins/base/base.php
+++ b/mu-plugins/base/base.php
@@ -4,6 +4,6 @@ Plugin Name: Site Specific Functionality
Description: Custom post types, taxonomies, metaboxes and shortcodes
*/
-require_once(dirname(__FILE__) . '/lib/post-types.php');
-require_once(dirname(__FILE__) . '/lib/meta-boxes.php');
-require_once(dirname(__FILE__) . '/lib/shortcodes.php');
+// require_once(dirname(__FILE__) . '/lib/post-types.php');
+// require_once(dirname(__FILE__) . '/lib/meta-boxes.php');
+// require_once(dirname(__FILE__) . '/lib/shortcodes.php'); | Comment out site specific functionality by default
Post types, meta boxes, and shortcodes can be uncommented after
they've been customized for first use | roots_soil | train | php |
a968b5827c0fda89c17623482bdc4507c4dc2ef2 | diff --git a/zipline/data/loader.py b/zipline/data/loader.py
index <HASH>..<HASH> 100644
--- a/zipline/data/loader.py
+++ b/zipline/data/loader.py
@@ -156,10 +156,10 @@ def load_market_data(bm_symbol='^GSPC'):
try:
fp_bm = get_datafile(get_benchmark_filename(bm_symbol), "rb")
except IOError:
- print """
+ print("""
data msgpacks aren't distributed with source.
Fetching data from Yahoo Finance.
-""".strip()
+""").strip()
dump_benchmarks(bm_symbol)
fp_bm = get_datafile(get_benchmark_filename(bm_symbol), "rb")
@@ -192,10 +192,10 @@ Fetching data from Yahoo Finance.
try:
fp_tr = get_datafile('treasury_curves.msgpack', "rb")
except IOError:
- print """
+ print("""
data msgpacks aren't distributed with source.
Fetching data from data.treasury.gov
-""".strip()
+""").strip()
dump_treasury_curves()
fp_tr = get_datafile('treasury_curves.msgpack', "rb") | MAINT: Use print function instead of print statement.
The loader module printed some warning messages, these could
be changed to use a logger, but for now convert to use the print
function for compatibility with Python 3. | quantopian_zipline | train | py |
0d79522c7c5a437721ef8b99dd7fbb61ef6ae456 | diff --git a/src/main/java/org/thymeleaf/aurora/text/LimitedSizeCacheTextRepository.java b/src/main/java/org/thymeleaf/aurora/text/LimitedSizeCacheTextRepository.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/thymeleaf/aurora/text/LimitedSizeCacheTextRepository.java
+++ b/src/main/java/org/thymeleaf/aurora/text/LimitedSizeCacheTextRepository.java
@@ -119,7 +119,7 @@ public final class LimitedSizeCacheTextRepository implements ITextRepository {
return null;
}
- final int hashCode = text.hashCode();
+ final int hashCode = TextUtil.hashCode(text);
this.readLock.lock(); | Fixed use of hashCode on potentially-non-String CharSequences | thymeleaf_thymeleaf | train | java |
e1f65a063a2e2a7f3f9552f12fe8b2136c466184 | diff --git a/tests/check-rules.js b/tests/check-rules.js
index <HASH>..<HASH> 100644
--- a/tests/check-rules.js
+++ b/tests/check-rules.js
@@ -16,4 +16,15 @@ describe('smoke tests', () => {
const files = new Set(fs.readdirSync('./lib/configs').map(f => path.basename(f, path.extname(f))))
assert.deepEqual(files, exportedConfigs)
})
+
+ it('exports valid rules in each config', () => {
+ const exportedRules = new Set(Object.keys(config.rules))
+ for (const flavour in config.configs) {
+ for (const rule in config.configs[flavour].rules) {
+ if (rule.startsWith('github/')) {
+ assert(exportedRules.has(rule.replace(/^github\//, '')), `rule ${rule} is not a valid rule`)
+ }
+ }
+ }
+ })
}) | test: add smoke test ensuring every config rule is one that is exported | github_eslint-plugin-github | train | js |
9c43337ab46099e52877281d2d260fd98ddc5279 | diff --git a/ciscosparkapi/restsession.py b/ciscosparkapi/restsession.py
index <HASH>..<HASH> 100644
--- a/ciscosparkapi/restsession.py
+++ b/ciscosparkapi/restsession.py
@@ -37,8 +37,8 @@ __license__ = "MIT"
# Module Constants
-DEFAULT_SINGLE_REQUEST_TIMEOUT = 20
-DEFAULT_RATE_LIMIT_TIMEOUT = 60
+DEFAULT_SINGLE_REQUEST_TIMEOUT = 20.0
+DEFAULT_RATE_LIMIT_TIMEOUT = 60.0
RATE_LIMIT_EXCEEDED_RESPONSE_CODE = 429
@@ -96,9 +96,9 @@ class RestSession(object):
# Initialize attributes and properties
self._base_url = str(validate_base_url(base_url))
- self._access_token = access_token
- self._single_request_timeout = single_request_timeout
- self._rate_limit_timeout = rate_limit_timeout
+ self._access_token = str(access_token)
+ self._single_request_timeout = float(single_request_timeout)
+ self._rate_limit_timeout = float(rate_limit_timeout)
if timeout:
self.timeout = timeout
@@ -144,7 +144,7 @@ class RestSession(object):
"the 'single_request_timeout' instead.",
DeprecationWarning)
assert value is None or value > 0
- self._single_request_timeout = value
+ self._single_request_timeout = float(value)
@property
def single_request_timeout(self): | Ensure consistent types on RestSession variables
Add conversion functions to ensure the types of RestSession’s
attributes are consistent. | CiscoDevNet_webexteamssdk | train | py |
2d5fbec386240f8679baf3f98202e358b6c2ef75 | diff --git a/tests/tests.py b/tests/tests.py
index <HASH>..<HASH> 100755
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -2123,8 +2123,8 @@ class JiraServiceDeskTests(unittest.TestCase):
request_type = self.jira.request_types(service_desk)[0]
request = self.jira.create_customer_request(dict(
- serviceDeskId=service_desk,
- requestTypeId=request_type,
+ serviceDeskId=service_desk.id,
+ requestTypeId=request_type.id,
requestFieldValues=dict(
summary='Ticket title here',
description='Ticket body here' | Pass ids when creating a customer request | pycontribs_jira | train | py |
77c7bea1c7925dccb123926eceeb686f2ec3cb37 | diff --git a/example/components/Rainbow.js b/example/components/Rainbow.js
index <HASH>..<HASH> 100644
--- a/example/components/Rainbow.js
+++ b/example/components/Rainbow.js
@@ -1,10 +1,6 @@
Mast.define('Rainbow', function () {
return {
-
- '#test': function () {
- alert('#test');
- },
events: {
'click .add-thing': function addThing () {
diff --git a/lib/raise.js b/lib/raise.js
index <HASH>..<HASH> 100644
--- a/lib/raise.js
+++ b/lib/raise.js
@@ -259,13 +259,13 @@ Framework.raise = function (options, cb) {
};
}
// Method do add the specified class
- else if ( matches = value.match(/^\+\s\.*(.+)/) && matches[1] ) {
+ else if ( (matches = value.match(/^\+\s\.*(.+)/)) && matches[1] ) {
return function addClass () {
this.$el.addClass(matches[1]);
};
}
// Method to remove the specified class
- else if ( matches = value.match(/^\+\s*\.(.+)/) && matches[1] ) {
+ else if ( (matches = value.match(/^\-\s*\.(.+)/)) && matches[1] ) {
return function removeClass () {
this.$el.removeClass(matches[1]);
}; | Fixed bugs in add/remove class shorthand. | balderdashy_mast | train | js,js |
752fe85df71f807fd0d766ffe809909c5f1876e1 | diff --git a/code/code.go b/code/code.go
index <HASH>..<HASH> 100644
--- a/code/code.go
+++ b/code/code.go
@@ -2,11 +2,12 @@ package code
import (
"fmt"
- "gentests/models"
"go/ast"
"go/parser"
"go/token"
"log"
+
+ "github.com/cweill/go-gentests/models"
)
func Parse(path string) *models.Info {
diff --git a/gentests.go b/gentests.go
index <HASH>..<HASH> 100644
--- a/gentests.go
+++ b/gentests.go
@@ -2,12 +2,13 @@ package main
import (
"fmt"
- "gentests/code"
- "gentests/render"
"os"
"os/exec"
"path/filepath"
"strings"
+
+ "github.com/cweill/go-gentests/code"
+ "github.com/cweill/go-gentests/render"
)
func generateTestCases(f *os.File, path string) {
diff --git a/render/render.go b/render/render.go
index <HASH>..<HASH> 100644
--- a/render/render.go
+++ b/render/render.go
@@ -1,9 +1,10 @@
package render
import (
- "gentests/models"
"io"
"text/template"
+
+ "github.com/cweill/go-gentests/models"
)
var tmpls = template.Must(template.ParseGlob("render/templates/*.tmpl")) | Update imports to point to github.com dir. | cweill_gotests | train | go,go,go |
476e16ff2d22a5da3ab8b57a6c7789610b008e22 | diff --git a/src/dialog/index.js b/src/dialog/index.js
index <HASH>..<HASH> 100644
--- a/src/dialog/index.js
+++ b/src/dialog/index.js
@@ -96,7 +96,7 @@ Dialog.confirm = (options) =>
Dialog.close = () => {
if (instance) {
- instance.value = false;
+ instance.toggle(false);
}
}; | fix(Dialog): Dialog.close not work | youzan_vant | train | js |
25842d1b7711820f0de96358345021cb8f0ff61b | diff --git a/registry/cache/warming.go b/registry/cache/warming.go
index <HASH>..<HASH> 100644
--- a/registry/cache/warming.go
+++ b/registry/cache/warming.go
@@ -46,8 +46,8 @@ type backlogItem struct {
registry.Credentials
}
-// Continuously get the images to populate the cache with, and
-// populate the cache with them.
+// Loop continuously gets the images to populate the cache with,
+// and populate the cache with them.
func (w *Warmer) Loop(logger log.Logger, stop <-chan struct{}, wg *sync.WaitGroup, imagesToFetchFunc func() registry.ImageCreds) {
defer wg.Done() | Please Go's linter about comments on exported methods. | weaveworks_flux | train | go |
40d0a9c7d7b3835d59b8b46cde19f57e828bf536 | diff --git a/tests/test_wrapper.py b/tests/test_wrapper.py
index <HASH>..<HASH> 100644
--- a/tests/test_wrapper.py
+++ b/tests/test_wrapper.py
@@ -54,3 +54,15 @@ def test_inventory_with_ssid(cicowrapper, inventory_mock):
def test_inventory_with_nonexisting_ssid(cicowrapper, inventory_mock):
inventory = cicowrapper.inventory(ssid='deaddead')
assert inventory == {}
+
+def test_node_get(cicowrapper, requests_mock, inventory_mock):
+ requests_mock.get('http://api.example.com/Node/get?key=dummy_key&arch=x86_64', json={'hosts':['n1.hufty'], 'ssid': 'deadtest'})
+ inventory, ssid = cicowrapper.node_get(arch='x86_64')
+ assert ssid == 'deadtest'
+ assert inventory
+ assert 'n1.hufty' in inventory
+ assert inventory['n1.hufty']['ip_address'] == "172.19.3.1"
+
+def test_node_done(cicowrapper, requests_mock, inventory_mock):
+ requests_mock.get('http://api.example.com/Node/done?key=dummy_key&ssid=deadtest')
+ cicowrapper.node_done(ssid='deadtest') | add tests for node_get and node_done | CentOS_python-cicoclient | train | py |
25a4d9bd98a21493421fa0eea826edbc73b68ea3 | diff --git a/phypno/attr/anat.py b/phypno/attr/anat.py
index <HASH>..<HASH> 100644
--- a/phypno/attr/anat.py
+++ b/phypno/attr/anat.py
@@ -174,9 +174,10 @@ class Surf:
self.surf_file = args[0]
elif len(args) == 3:
- hemi = args[1]
- surf_type = args[2]
- self.surf_file = join(args[0], 'surf', hemi + '.' + surf_type)
+ self.hemi = args[1]
+ self.surf_type = args[2]
+ self.surf_file = join(args[0], 'surf',
+ self.hemi + '.' + self.surf_type)
surf_vert, surf_tri = _read_geometry(self.surf_file)
self.vert = surf_vert
@@ -332,6 +333,5 @@ class Freesurfer:
instance of Surf
"""
- surf_file = join(self.dir, 'surf', hemi + '.' + surf_type)
- surf = Surf(surf_file)
+ surf = Surf(self.dir, hemi, surf_type)
return surf | use hemi info again in surf | wonambi-python_wonambi | train | py |
1feb47734154c47bb7279fb33f957789c991f44b | diff --git a/scoop/_types.py b/scoop/_types.py
index <HASH>..<HASH> 100644
--- a/scoop/_types.py
+++ b/scoop/_types.py
@@ -75,8 +75,8 @@ class Future(object):
self.creationTime = time.ctime() # future creation time
self.stopWatch = StopWatch() # stop watch for measuring time
self.greenlet = None # cooperative thread for running future
- self.resultValue = None # future result
- self.exceptionValue = None # exception raised by callable
+ self.resultValue = None # future result
+ self.exceptionValue = None # exception raised by callable
self.callback = [] # set callback
# insert future into global dictionary
scoop._control.futureDict[self.id] = self | Tidied up a bit the code. | soravux_scoop | train | py |
e785b47aabbea0e30dbfd887465b1c511198aa20 | diff --git a/src/editor/EditorManager.js b/src/editor/EditorManager.js
index <HASH>..<HASH> 100644
--- a/src/editor/EditorManager.js
+++ b/src/editor/EditorManager.js
@@ -419,13 +419,6 @@ define(function (require, exports, module) {
}
if (viewState.scrollPos) {
editor.setScrollPos(viewState.scrollPos.x, viewState.scrollPos.y);
-
- // Force CM.onScroll() to run now, in case refresh() gets called synchronously after this
- // (as often happens when switching editors, due to JSLint panel)
- // TODO: why doesn't CM.scrollTo() do this automatically?
- var event = window.document.createEvent("HTMLEvents");
- event.initEvent("scroll", true, false);
- editor._codeMirror.getScrollerElement().dispatchEvent(event);
}
}
} | Remove hacky workaround that is unneeded in CMv3 | adobe_brackets | train | js |
05057c7f4233b7af94d68f58bafe060cf40bd0e0 | diff --git a/lib/http/index.js b/lib/http/index.js
index <HASH>..<HASH> 100644
--- a/lib/http/index.js
+++ b/lib/http/index.js
@@ -1,4 +1,3 @@
-
/*!
* q - http
* Copyright (c) 2011 LearnBoost <tj@learnboost.com>
@@ -65,7 +64,9 @@ app.post('/job', provides('json'), express.bodyParser(), json.createJob);
// routes
-app.get('/', routes.jobs('active'));
+app.get('/', function (req, res) {
+ res.redirect('active')
+});
app.get('/active', routes.jobs('active'));
app.get('/inactive', routes.jobs('inactive'));
app.get('/failed', routes.jobs('failed')); | Support express path mounting
Redirect away from / so /path won't point assets to /asset rather than /path/asset | Automattic_kue | train | js |
c705444085004b90962f9b97bc9ea6c2b0fa1fe2 | diff --git a/annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java b/annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java
index <HASH>..<HASH> 100644
--- a/annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java
+++ b/annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java
@@ -530,7 +530,7 @@ public class EventExtractor {
if (showNamespaceConfig != null)
{
- SDocumentGraph graph = input.getDocument().getSDocumentGraph();
+ SDocumentGraph graph = input.getDocument().getDocumentGraph();
Set<String> annoPool = new LinkedHashSet<>();
for(Class<? extends SNode> t : types) | removed "S" from getSDocumentGraph | korpling_ANNIS | train | java |
faec393786d0d56f2115bf7ac4af25b8a034b755 | diff --git a/headless/tasks/inasafe_wrapper.py b/headless/tasks/inasafe_wrapper.py
index <HASH>..<HASH> 100644
--- a/headless/tasks/inasafe_wrapper.py
+++ b/headless/tasks/inasafe_wrapper.py
@@ -46,7 +46,11 @@ def filter_impact_function(hazard=None, exposure=None):
arguments.hazard = None
arguments.exposure = None
ifs = get_impact_function_list(arguments)
- result = [f.metadata().as_dict()['id'] for f in ifs]
+ result = [
+ {
+ 'id': f.metadata().as_dict()['id'],
+ 'name': f.metadata().as_dict()['name']
+ } for f in ifs]
LOGGER.debug(result)
return result | InaSAFE Headless: Add more information for filter_impact_function | inasafe_inasafe | train | py |
56cc58d05ac39f06d214329ed4565e7f9313fddd | diff --git a/src/google-maps.js b/src/google-maps.js
index <HASH>..<HASH> 100644
--- a/src/google-maps.js
+++ b/src/google-maps.js
@@ -39,13 +39,20 @@ export class GoogleMaps {
});
this._scriptPromise.then(() => {
+ let latLng = new google.maps.LatLng(parseFloat(this.latitude), parseFloat(this.longitude));
+
let options = {
- center: {lat: this.latitude, lng: this.longitude},
+ center: latLng,
zoom: parseInt(this.zoom, 10),
disableDefaultUI: this.disableDefaultUI
}
this.map = new google.maps.Map(this.element, options);
+
+ this.createMarker({
+ map: this.map,
+ position: latLng
+ });
});
} | feat(maps): when coordinates are supplied, convert them to a well-formed object and then create a marker | Vheissu_aurelia-google-maps | train | js |
7eac5c62a10158ef210906deb161ac791f18d3ae | diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java b/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java
index <HASH>..<HASH> 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java
@@ -1039,12 +1039,12 @@ public class Task
newState);
} else {
LOG.warn(
- "{} ({}) switched from {} to {}.",
+ "{} ({}) switched from {} to {} with failure cause: {}",
taskNameWithSubtask,
executionId,
currentState,
newState,
- cause);
+ ExceptionUtils.stringifyException(cause));
}
return true; | [hotfix][runtime] Adds failure cause to log message
The log message when transitioning to an exeuctionState having a failure cause
didn't print the cause itself. This is fixed now. | apache_flink | train | java |
7ad084273f95b22b2ee6c42467ba6fbf128652c5 | diff --git a/tests/test_Apex.py b/tests/test_Apex.py
index <HASH>..<HASH> 100644
--- a/tests/test_Apex.py
+++ b/tests/test_Apex.py
@@ -309,10 +309,9 @@ def test_convert_qd2apex():
assert_allclose(apex_out.convert(60, 15, 'qd', 'apex', height=100),
apex_out.qd2apex(60, 15, height=100))
-
+
def test_convert_qd2apex_at_equator():
- """Test the quasi-dipole to apex conversion at the magnetic equator
- """
+ """Test the quasi-dipole to apex conversion at the magnetic equator """
apex_out = Apex(date=2000, refh=80)
elat, elon = apex_out.convert(lat=0.0, lon=0, source='qd', dest='apex',
height=120.0) | STY: removed trailing whitespace
Removed trailing whitespace for PEP8 compliance. | aburrell_apexpy | train | py |
11b6d2910bbc8246ae8d2fb0b6cb6b3758909161 | diff --git a/src/Codeception/TestCase/WPTestCase.php b/src/Codeception/TestCase/WPTestCase.php
index <HASH>..<HASH> 100644
--- a/src/Codeception/TestCase/WPTestCase.php
+++ b/src/Codeception/TestCase/WPTestCase.php
@@ -7,7 +7,7 @@ if (!class_exists('WP_UnitTest_Factory')) {
if (!class_exists('TracTickets')) {
require_once dirname(dirname(dirname(__FILE__))) . '/includes/trac.php';
}
-
+//@todo: update to latest version from core
class WPTestCase extends \Codeception\TestCase\Test {
protected static $forced_tickets = array();
@@ -763,4 +763,13 @@ class WPTestCase extends \Codeception\TestCase\Test {
$time_array = explode(' ', $microtime);
return array_sum($time_array);
}
+
+ /**
+ * Returns the WPQueries module instance.
+ *
+ * @return \Codeception\Module\WPQueries
+ */
+ public function queries(){
+ return $this->getModule('WPQueries');
+ }
} | added WPTestCase::queries() method | lucatume_wp-browser | train | php |
1ecbb6c4119fa19662c138d94323fb2e253af7e7 | diff --git a/stagpy/_step.py b/stagpy/_step.py
index <HASH>..<HASH> 100644
--- a/stagpy/_step.py
+++ b/stagpy/_step.py
@@ -42,8 +42,8 @@ class _Geometry:
self._init_shape()
def _scale_radius_mo(self, radius: ndarray) -> ndarray:
- """Rescale radius for MO runs."""
- if self._step.sdat.par['magma_oceans_in']['magma_oceans_mode']:
+ """Rescale radius for evolving MO runs."""
+ if self._step.sdat.par['magma_oceans_in']['evolving_magma_oceans']:
return self._header['mo_thick_sol'] * (
radius + self._header['mo_lambda'])
return radius | Rescaling radius only when evolving_magma_oceans
Having only "magma_oceans_mode" falls back on the classic non-
dimensionalization. | StagPython_StagPy | train | py |
7ea05b14f300c03464f043ed999d427a2010fa50 | diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/glyptodon/guacamole/auth/jdbc/user/UserService.java b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/glyptodon/guacamole/auth/jdbc/user/UserService.java
index <HASH>..<HASH> 100644
--- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/glyptodon/guacamole/auth/jdbc/user/UserService.java
+++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/glyptodon/guacamole/auth/jdbc/user/UserService.java
@@ -69,8 +69,7 @@ public class UserService extends ModeledDirectoryObjectService<ModeledUser, User
* creation.
*/
private static final ObjectPermission.Type[] IMPLICIT_USER_PERMISSIONS = {
- ObjectPermission.Type.READ,
- ObjectPermission.Type.UPDATE
+ ObjectPermission.Type.READ
};
/** | GUAC-<I>: Do not grant UPDATE on self by default. | glyptodon_guacamole-client | train | java |
bb91a9971e7a9a4220aa02e09e9fbb2f3a509257 | diff --git a/app/controllers/think_feel_do_dashboard/arms_controller.rb b/app/controllers/think_feel_do_dashboard/arms_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/think_feel_do_dashboard/arms_controller.rb
+++ b/app/controllers/think_feel_do_dashboard/arms_controller.rb
@@ -45,9 +45,9 @@ module ThinkFeelDoDashboard
# DELETE /think_feel_do_dashboard/arms/1
def destroy
- @arm.destroy
- redirect_to arms_url,
- notice: "Arm was successfully destroyed."
+ redirect_to arm_path(@arm),
+ notice: "You do not have privileges to delete an arm. "\
+ "Please contact the site administrator to remove this arm."
end
private
diff --git a/spec/features/super_users/arms_spec.rb b/spec/features/super_users/arms_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/features/super_users/arms_spec.rb
+++ b/spec/features/super_users/arms_spec.rb
@@ -132,8 +132,8 @@ feature "Super User - Arms", type: :feature do
click_on "Arm 1"
click_on "Destroy"
- expect(page).to have_text "Arm was successfully destroyed"
- expect(page).to_not have_text "Arm 1"
+ expect(page).to have_text "You do not have privileges to delete an arm."\
+ " Please contact the site administrator to remove this arm"
end
end
end | Remove ability to delete Arm.
* Updated controller logic for arm destruction.
* Added notice explaining arm deletion privileges.
* Added spec to ensure notice displays.
[Finished #<I>] | NU-CBITS_think_feel_do_dashboard | train | rb,rb |
92f2eef23f132c089464469453cd96b6646419f6 | diff --git a/src/main/java/moa/tasks/LearnModel.java b/src/main/java/moa/tasks/LearnModel.java
index <HASH>..<HASH> 100644
--- a/src/main/java/moa/tasks/LearnModel.java
+++ b/src/main/java/moa/tasks/LearnModel.java
@@ -55,10 +55,6 @@ public class LearnModel extends MainTask {
"The number of passes to do over the data.", 1, 1,
Integer.MAX_VALUE);
- public IntOption maxMemoryOption = new IntOption("maxMemory", 'b',
- "Maximum size of model (in bytes). -1 = no limit.", -1, -1,
- Integer.MAX_VALUE);
-
public IntOption memCheckFrequencyOption = new IntOption(
"memCheckFrequency", 'q',
"How many instances between memory bound checks.", 100000, 0, | Remove option '-b' from LearnModel | Waikato_moa | train | java |
a159b5d1ab8e8406bd113e1bdbd1fd115daeb1c6 | diff --git a/sqlite3.go b/sqlite3.go
index <HASH>..<HASH> 100644
--- a/sqlite3.go
+++ b/sqlite3.go
@@ -875,9 +875,10 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) {
// _loc
if val := params.Get("_loc"); val != "" {
- if val == "auto" {
+ switch strings.ToLower(val) {
+ case "auto":
loc = time.Local
- } else {
+ default:
loc, err = time.LoadLocation(val)
if err != nil {
return nil, fmt.Errorf("Invalid _loc: %v: %v", val, err)
@@ -887,7 +888,7 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) {
// _mutex
if val := params.Get("_mutex"); val != "" {
- switch val {
+ switch strings.ToLower(val) {
case "no":
mutex = C.SQLITE_OPEN_NOMUTEX
case "full":
@@ -899,7 +900,7 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) {
// _txlock
if val := params.Get("_txlock"); val != "" {
- switch val {
+ switch strings.ToLower(val) {
case "immediate":
txlock = "BEGIN IMMEDIATE"
case "exclusive": | Fix: String ToLower for PRAGMA's | xeodou_go-sqlcipher | train | go |
c2aa7bbb5642a154cd471284b63aa4331b3b264f | diff --git a/cirq/circuits/circuit.py b/cirq/circuits/circuit.py
index <HASH>..<HASH> 100644
--- a/cirq/circuits/circuit.py
+++ b/cirq/circuits/circuit.py
@@ -135,6 +135,9 @@ class Circuit:
def copy(self) -> 'Circuit':
return Circuit(self._moments, self._device)
+ def __bool__(self):
+ return bool(self._moments)
+
def __eq__(self, other):
if not isinstance(other, type(self)):
return NotImplemented
diff --git a/cirq/circuits/circuit_test.py b/cirq/circuits/circuit_test.py
index <HASH>..<HASH> 100644
--- a/cirq/circuits/circuit_test.py
+++ b/cirq/circuits/circuit_test.py
@@ -126,6 +126,11 @@ def test_append_moments():
])
+def test_bool():
+ assert not Circuit()
+ assert Circuit.from_ops(cirq.X(cirq.NamedQubit('a')))
+
+
@cirq.testing.only_test_in_python3
def test_repr():
assert repr(cirq.Circuit()) == 'cirq.Circuit()' | define bool for Circuit (#<I>) | quantumlib_Cirq | train | py,py |
eed8a895b9530f4f38630a7c752fcbb30e169c29 | diff --git a/ghproxy/ghcache/coalesce.go b/ghproxy/ghcache/coalesce.go
index <HASH>..<HASH> 100644
--- a/ghproxy/ghcache/coalesce.go
+++ b/ghproxy/ghcache/coalesce.go
@@ -45,7 +45,7 @@ type requestCoalescer struct {
type firstRequest struct {
*sync.Cond
- waiting bool
+ subscribers bool
resp []byte
err error
}
@@ -85,7 +85,7 @@ func (r *requestCoalescer) RoundTrip(req *http.Request) (*http.Response, error)
}
firstReq.L.Lock()
r.Unlock()
- firstReq.waiting = true
+ firstReq.subscribers = true
// The documentation for Wait() says:
// "Because c.L is not locked when Wait first resumes, the caller typically
@@ -125,7 +125,7 @@ func (r *requestCoalescer) RoundTrip(req *http.Request) (*http.Response, error)
r.Unlock()
firstReq.L.Lock()
- if firstReq.waiting {
+ if firstReq.subscribers {
if err != nil {
firstReq.resp, firstReq.err = nil, err
} else { | ghproxy: rename 'waiting' field to 'subscribers'
No logical change. | kubernetes_test-infra | train | go |
8544b748adb76988cbaeba2cfc75a6cc6c02eb0f | diff --git a/pkg/endpoint/endpoint.go b/pkg/endpoint/endpoint.go
index <HASH>..<HASH> 100644
--- a/pkg/endpoint/endpoint.go
+++ b/pkg/endpoint/endpoint.go
@@ -305,9 +305,9 @@ func (e *Endpoint) closeBPFProgramChannel() {
}
}
-// HasBPFProgram returns whether a BPF program has been generated for this
+// bpfProgramInstalled returns whether a BPF program has been generated for this
// endpoint.
-func (e *Endpoint) HasBPFProgram() bool {
+func (e *Endpoint) bpfProgramInstalled() bool {
select {
case <-e.hasBPFProgram:
return true
@@ -2114,7 +2114,7 @@ func (e *Endpoint) waitForFirstRegeneration(ctx context.Context) error {
}
hasSidecarProxy := e.HasSidecarProxy()
e.runlock()
- if hasSidecarProxy && e.HasBPFProgram() {
+ if hasSidecarProxy && e.bpfProgramInstalled() {
// If the endpoint is determined to have a sidecar proxy,
// return immediately to let the sidecar container start,
// in case it is required to enforce L7 rules. | endpoint: do not export check to see if endpoint BPF program is installed | cilium_cilium | train | go |
38532938d1ea180ca3a64d809c20085e1178d38e | diff --git a/src/Scheduling.php b/src/Scheduling.php
index <HASH>..<HASH> 100644
--- a/src/Scheduling.php
+++ b/src/Scheduling.php
@@ -75,6 +75,15 @@ class Scheduling extends Extension
];
}
+ if (PHP_OS_FAMILY === 'Windows' && Str::contains($event->command, '"artisan"')) {
+ $exploded = explode(' ', $event->command);
+
+ return [
+ 'type' => 'artisan',
+ 'name' => 'artisan '.implode(' ', array_slice($exploded, 2)),
+ ];
+ }
+
return [
'type' => 'command',
'name' => $event->command,
@@ -95,6 +104,10 @@ class Scheduling extends Extension
/** @var \Illuminate\Console\Scheduling\Event $event */
$event = $this->getKernelEvents()[$id - 1];
+ if (PHP_OS_FAMILY === 'Windows') {
+ $event->command = Str::of($event->command)->replace('php-cgi.exe', 'php.exe');
+ }
+
$event->sendOutputTo($this->getOutputTo());
$event->run(app()); | fixed several compatibility issues with windows and php-cgi | laravel-admin-extensions_scheduling | train | php |
a3febea893bfc9d020c6650e003f0f395dcd6864 | diff --git a/app/controllers/backend/tags_controller.rb b/app/controllers/backend/tags_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/backend/tags_controller.rb
+++ b/app/controllers/backend/tags_controller.rb
@@ -15,7 +15,7 @@ class Backend::TagsController < BackendController
def destroy
find_model.tagged_items.where(tag_id: find_tag.id).destroy_all
- render json: { tag: params[:tag] }
+ render json: { success: true }
end
private | Enhance json output when a tag is deleted. | udongo_udongo | train | rb |
2b11948d7c5f4548325c941d92eaf428852a19d8 | diff --git a/datasette/app.py b/datasette/app.py
index <HASH>..<HASH> 100644
--- a/datasette/app.py
+++ b/datasette/app.py
@@ -131,6 +131,10 @@ class ConnectedDatabase:
self.size = p.stat().st_size
@property
+ def mtime_ns(self):
+ return Path(self.path).stat().st_mtime_ns
+
+ @property
def name(self):
if self.is_memory:
return ":memory:" | New ConnectedDatabase.mtime_ns property
I plan to use this for some clever table count caching tricks | simonw_datasette | train | py |
f4559bb116351096edc4a41f9b6a2429250d797b | diff --git a/config/doctrine.php b/config/doctrine.php
index <HASH>..<HASH> 100644
--- a/config/doctrine.php
+++ b/config/doctrine.php
@@ -108,7 +108,6 @@ return [
|--------------------------------------------------------------------------
*/
'custom_types' => [
- 'json' => LaravelDoctrine\ORM\Types\Json::class
],
/*
|--------------------------------------------------------------------------
diff --git a/src/Types/Json.php b/src/Types/Json.php
index <HASH>..<HASH> 100644
--- a/src/Types/Json.php
+++ b/src/Types/Json.php
@@ -14,6 +14,9 @@ use Doctrine\DBAL\Types\JsonArrayType;
* \Doctrine\DBAL\Types\Type::addType('json', '\Path\To\Custom\Type\Json');
* @link http://www.doctrine-project.org/jira/browse/DBAL-446
* @link https://github.com/doctrine/dbal/pull/655
+ *
+ * @deprecated Replaced by JsonType in Doctrine.
+ * You can safely remove usage of this type in your 'custom_type' configuration.
*/
class Json extends JsonArrayType
{ | Deprecate and remove usage of our custom JsonType
This type is provided by doctrine. | laravel-doctrine_orm | train | php,php |
7eb7e304dd4d4ba2f53026429e2eb7b59f6bc2b5 | diff --git a/bakery/settings/views.py b/bakery/settings/views.py
index <HASH>..<HASH> 100644
--- a/bakery/settings/views.py
+++ b/bakery/settings/views.py
@@ -191,7 +191,7 @@ def addclone():
db.session.add(project)
db.session.commit()
- flash(_("Repository successfully added to the list"))
+ flash(_("Repository successfully added to <a href='/'>the list</a>"))
git_clone(login = g.user.login, project_id = project.id, clone = project.clone)
return redirect(url_for('settings.repos')+"#tab_owngit")
@@ -235,7 +235,7 @@ def massgit():
)
db.session.add(project)
db.session.commit()
- flash(_("Repository %s successfully added to the list" % project.full_name))
+ flash(_("Repository %s successfully added to <a href='/'>the list</a>" % project.full_name))
git_clone(login = g.user.login, project_id = project.id, clone = project.clone)
db.session.commit() | Adding link to dashboard when repo added | googlefonts_fontbakery | train | py |
5b4916c746beca3854b80616727257459d60474e | diff --git a/sift.js b/sift.js
index <HASH>..<HASH> 100644
--- a/sift.js
+++ b/sift.js
@@ -383,7 +383,7 @@
query = comparable(query);
if (!query || (query.constructor.toString() !== "Object" &&
- query.constructor.toString() !== "function Object() { [native code] }")) {
+ query.constructor.toString().replace(/\n/g,'').replace(/ /g, '') !== "functionObject(){[nativecode]}")) { // cross browser support
query = { $eq: query };
} | fix #<I>: cross-browser support | crcn_sift.js | train | js |
57b29b8b0772ef16ac9510112a9ceab5392b2511 | diff --git a/output/html/request.php b/output/html/request.php
index <HASH>..<HASH> 100644
--- a/output/html/request.php
+++ b/output/html/request.php
@@ -27,6 +27,13 @@ class QM_Output_Html_Request extends QM_Output_Html {
echo '<div class="qm qm-half" id="' . esc_attr( $this->collector->id() ) . '">';
echo '<table cellspacing="0">';
+ echo '<caption class="screen-reader-text">' . esc_html( $this->collector->name() ) . '</caption>';
+ echo '<thead class="screen-reader-text">';
+ echo '<tr>';
+ echo '<th scope="col">' . esc_html__( 'Property', 'query-monitor' ) . '</th>';
+ echo '<th scope="col" colspan="2">' . esc_html__( 'Value', 'query-monitor' ) . '</th>';
+ echo '</tr>';
+ echo '</thead>';
echo '<tbody>';
foreach ( array( | Table a<I>y: request
Caption is visible to screen readers only.
Additional column headers are for screen-readers only. | johnbillion_query-monitor | train | php |
c8fb7bd257f87a5a431b5e1983f0ce4748159109 | diff --git a/client/my-sites/themes/theme-options.js b/client/my-sites/themes/theme-options.js
index <HASH>..<HASH> 100644
--- a/client/my-sites/themes/theme-options.js
+++ b/client/my-sites/themes/theme-options.js
@@ -59,6 +59,7 @@ const activate = {
const activateOnJetpack = {
label: i18n.translate( 'Activate' ),
header: i18n.translate( 'Activate on:', { comment: 'label for selecting a site on which to activate a theme' } ),
+ // Append `-wpcom` suffix to the theme ID so the installAndActivate() will install the theme from WordPress.com, not WordPress.org
action: ( themeId, siteId, ...args ) => installAndActivate( themeId + '-wpcom', siteId, ...args ),
hideForSite: ( state, siteId ) => ! isJetpackSite( state, siteId ),
hideForTheme: ( state, theme, siteId ) => ( | my-sites/themes/theme-options#activateOnJetpack: Add explanation about -wpcom suffix | Automattic_wp-calypso | train | js |
a9c9f5fa363fc29f019821a260f9704ce2ed50b1 | diff --git a/packages/upgrade/src/migrations/carbon-icons-react/10.3.0/update-icon-import-path.js b/packages/upgrade/src/migrations/carbon-icons-react/10.3.0/update-icon-import-path.js
index <HASH>..<HASH> 100644
--- a/packages/upgrade/src/migrations/carbon-icons-react/10.3.0/update-icon-import-path.js
+++ b/packages/upgrade/src/migrations/carbon-icons-react/10.3.0/update-icon-import-path.js
@@ -51,6 +51,17 @@ module.exports = (file, api) => {
// then capture all the icon-specific data. Depending on the length of
// this data, we assign name, size, and prefix values.
const { node } = path;
+
+ // Ignore imports if they already directly reference the package or one of
+ // its entrypoints that support tree-shaking
+ if (
+ node.source.value === '@carbon/icons-react' ||
+ node.source.value === '@carbon/icons-react/es' ||
+ node.source.value === '@carbon/icons-react/lib'
+ ) {
+ return;
+ }
+
const [
_scope,
_packageName, | fix(upgrade): ignore files that have correct import path (#<I>) | carbon-design-system_carbon-components | train | js |
a4780cd5d47140ef8ca66b03dd44597c3594c6b8 | diff --git a/config.js b/config.js
index <HASH>..<HASH> 100644
--- a/config.js
+++ b/config.js
@@ -67,7 +67,7 @@ config = Object.assign({}, config, {
compiler_hash_type: __PROD__ ? 'chunkhash' : 'hash',
compiler_fail_on_warning: __TEST__ || __PROD__,
compiler_output_path: paths.base(config.dir_docs_dist),
- compiler_public_path: __PROD__ ? '//cdn.rawgit.com/Semantic-Org/Semantic-UI-React/gh-pages/' : '/',
+ compiler_public_path: __PROD__ ? '//raw.github.com/Semantic-Org/Semantic-UI-React/gh-pages/' : '/',
compiler_stats: {
hash: false, // the hash of the compilation
version: false, // webpack version info | chore(webpack): switch rawgit to github (#<I>) | Semantic-Org_Semantic-UI-React | train | js |
cb8a43f0d0278a60bb22dfe1ef9ef03e5a65516e | diff --git a/tests/TestCase.php b/tests/TestCase.php
index <HASH>..<HASH> 100644
--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -22,8 +22,8 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
'allowed_origins' => ['localhost'],
'allowed_headers' => ['X-Custom-1', 'X-Custom-2'],
'allowed_methods' => ['GET', 'POST'],
- 'exposed_headers' => false,
- 'max_age' => false,
+ 'exposed_headers' => [],
+ 'max_age' => 0,
];
} | Update TestCase.php | barryvdh_laravel-cors | train | php |
37ea1012de75947a2d8701fe43df26f69277cb91 | diff --git a/src/Bridge/Symfony/Routing/Router.php b/src/Bridge/Symfony/Routing/Router.php
index <HASH>..<HASH> 100644
--- a/src/Bridge/Symfony/Routing/Router.php
+++ b/src/Bridge/Symfony/Routing/Router.php
@@ -71,7 +71,7 @@ final class Router implements RouterInterface, UrlGeneratorInterface
$baseContext = $this->router->getContext();
$pathInfo = str_replace($baseContext->getBaseUrl(), '', $pathInfo);
- $request = Request::create($pathInfo);
+ $request = Request::create($pathInfo, 'GET', [], [], [], ['HTTP_HOST' => $baseContext->getHost()]);
$context = (new RequestContext())->fromRequest($request);
$context->setPathInfo($pathInfo);
$context->setScheme($baseContext->getScheme()); | fix #<I> Router keep host context in match process | api-platform_core | train | php |
e94f06bcca7663a878c3caaf2cfb50428ea68901 | diff --git a/Tests/OAuth/ResourceOwner/Auth0ResourceOwnerTest.php b/Tests/OAuth/ResourceOwner/Auth0ResourceOwnerTest.php
index <HASH>..<HASH> 100644
--- a/Tests/OAuth/ResourceOwner/Auth0ResourceOwnerTest.php
+++ b/Tests/OAuth/ResourceOwner/Auth0ResourceOwnerTest.php
@@ -50,6 +50,13 @@ json;
protected function setUpResourceOwner($name, $httpUtils, array $options)
{
+ $options = array_merge(
+ array(
+ 'base_url' => 'https://example.oauth0.com'
+ ),
+ $options
+ );
+
return new Auth0ResourceOwner($this->buzzClient, $httpUtils, $options, $name, $this->storage);
}
} | Fixed test with the required base_url option | hwi_HWIOAuthBundle | train | php |
25f957c5c60bf9f01183c3d4bbe5ff90ed809c13 | diff --git a/services/opentsdb/service.go b/services/opentsdb/service.go
index <HASH>..<HASH> 100644
--- a/services/opentsdb/service.go
+++ b/services/opentsdb/service.go
@@ -177,7 +177,9 @@ func (s *Service) Close() error {
return s.ln.Close()
}
- s.batcher.Stop()
+ if s.batcher != nil {
+ s.batcher.Stop()
+ }
close(s.done)
s.wg.Wait()
return nil | Only call Stop on non-nil batchers | influxdata_influxdb | train | go |
b8e2ff2a0681034d2629c63af17625d0affd3b2e | diff --git a/client-vendor/after-body/jquery.clipSlide/jquery.clipSlide.js b/client-vendor/after-body/jquery.clipSlide/jquery.clipSlide.js
index <HASH>..<HASH> 100755
--- a/client-vendor/after-body/jquery.clipSlide/jquery.clipSlide.js
+++ b/client-vendor/after-body/jquery.clipSlide/jquery.clipSlide.js
@@ -59,6 +59,7 @@
var self = this;
this.$handle.on('click.clipSlide', function() {
self.toggle(true);
+ self.$elem.trigger('toggle.clipSlide');
});
}; | Trigger toggle.clipSlide event on opening clipSlide content. | cargomedia_cm | train | js |
f3170116eaf16a30ffb6e73e0d84c9cabced5a96 | diff --git a/main.go b/main.go
index <HASH>..<HASH> 100644
--- a/main.go
+++ b/main.go
@@ -87,7 +87,8 @@ func (s *Scanner) Scan() bool {
func (s *Scanner) Token() ([]byte, int) {
var kind int
switch {
- case len(s.line) == 0 || s.line[0] == ' ':
+ // The backslash is to detect "\ No newline at end of file" lines.
+ case len(s.line) == 0 || s.line[0] == ' ' || s.line[0] == '\\':
kind = 0
case s.line[0] == '+':
//kind = 1 | For diffs, highlight "\ No newline at end of file" lines correctly. | shurcooL_highlight_diff | train | go |
da9262d75feff7ec068d5d4ef25adc84224fcb7b | diff --git a/src/hypercorn/protocol/h11.py b/src/hypercorn/protocol/h11.py
index <HASH>..<HASH> 100755
--- a/src/hypercorn/protocol/h11.py
+++ b/src/hypercorn/protocol/h11.py
@@ -161,9 +161,9 @@ class H11Protocol:
break
else:
if isinstance(event, h11.Request):
+ await self.send(Updated(idle=False))
await self._check_protocol(event)
await self._create_stream(event)
- await self.send(Updated(idle=False))
elif event is h11.PAUSED:
await self.can_read.clear()
await self.can_read.wait()
diff --git a/tests/protocol/test_h11.py b/tests/protocol/test_h11.py
index <HASH>..<HASH> 100755
--- a/tests/protocol/test_h11.py
+++ b/tests/protocol/test_h11.py
@@ -296,6 +296,7 @@ async def test_protocol_handle_h2c_upgrade(protocol: H11Protocol) -> None:
)
)
assert protocol.send.call_args_list == [ # type: ignore
+ call(Updated(idle=False)),
call(
RawData(
b"HTTP/1.1 101 \r\n" | Bugfix send the idle update first on HTTP/1 request receipt
This ensures that the connection is marked as not idle before a
protocol upgrade takes place. This therefore ensures that on upgrading
a slow response is not timed out. | pgjones_hypercorn | train | py,py |
cec34ca93f19c44ed1f6a0ef52b6aa517e6833e2 | diff --git a/src/converter/r2t/Sec2Heading.js b/src/converter/r2t/Sec2Heading.js
index <HASH>..<HASH> 100644
--- a/src/converter/r2t/Sec2Heading.js
+++ b/src/converter/r2t/Sec2Heading.js
@@ -1,5 +1,5 @@
import { last } from 'substance'
-import { replaceWith } from '../util/domHelpers'
+import { replaceWith, findChild } from '../util/domHelpers'
export default class Sec2Heading {
@@ -44,7 +44,7 @@ function _flattenSec(sec, level) {
h.attr('label', label.textContent)
label.remove()
}
- let title = sec.find('title')
+ let title = findChild(sec, 'title')
if (title) {
h.append(title.childNodes)
title.remove() | Fix Sec2Heading. | substance_texture | train | js |
d954c26223d3a8ffb754e48f3b3a6cde53720c41 | diff --git a/ez_setup.py b/ez_setup.py
index <HASH>..<HASH> 100644
--- a/ez_setup.py
+++ b/ez_setup.py
@@ -14,7 +14,7 @@ the appropriate options to ``use_setuptools()``.
This file can also be run as a script to install or upgrade setuptools.
"""
import sys
-DEFAULT_VERSION = "0.6c9"
+DEFAULT_VERSION = "0.6c8"
DEFAULT_URL = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3]
md5_data = { | Default version of setup tools was decreased to <I>c8, because Debian have only that version. | mongodb_mongo-python-driver | train | py |
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.