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 |
|---|---|---|---|---|---|
1f8d1afce0abe16c9888dafe73010e65271cf34d | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -15,6 +15,7 @@ const fs = require('fs');
const _ = require('lodash');
const path = require('path');
const loaderUtils = require('loader-utils');
+const webpack = require('webpack');
const { CachedChildCompilation } = require('./lib/cached-child-compiler');
const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } = require('./lib/html-tags');
@@ -329,10 +330,7 @@ function hookIntoCompiler (compiler, options, plugin) {
return loaderUtils.getHashDigest(Buffer.from(html, 'utf8'), hashType, digestType, parseInt(maxLength, 10));
});
// Add the evaluated html code to the webpack assets
- compilation.assets[finalOutputName] = {
- source: () => html,
- size: () => html.length
- };
+ compilation.emitAsset(finalOutputName, new webpack.sources.RawSource(html, false));
return finalOutputName;
})
.then((finalOutputName) => getHtmlWebpackPluginHooks(compilation).afterEmit.promise({ | feat: use webpack 5 api to add assets | jantimon_html-webpack-plugin | train | js |
4265cf0f5152ef18f326f03ad84defec08116b5b | diff --git a/sk_dsp_comm/test/test_sigsys.py b/sk_dsp_comm/test/test_sigsys.py
index <HASH>..<HASH> 100644
--- a/sk_dsp_comm/test/test_sigsys.py
+++ b/sk_dsp_comm/test/test_sigsys.py
@@ -582,7 +582,7 @@ class TestSigsys(TestCase):
self.assertEqual(x_check, True)
npt.assert_equal(b, b_check)
- def test_NRZ_bits_value_error(self):
+ def test_NRZ_bits2_value_error(self):
with self.assertRaisesRegexp(ValueError, 'pulse type must be rec, rc, or src') as NRZ_err:
x,b = ss.NRZ_bits2(ss.m_seq(5), 10, pulse='val') | Changing name to bits2 for unique test name. | mwickert_scikit-dsp-comm | train | py |
8bc36c95f5066bf626824ed75ef2d835f5bae4eb | diff --git a/www/wsfed/sp/prp.php b/www/wsfed/sp/prp.php
index <HASH>..<HASH> 100644
--- a/www/wsfed/sp/prp.php
+++ b/www/wsfed/sp/prp.php
@@ -78,7 +78,7 @@ try {
/* Find the certificate used by the IdP. */
if(array_key_exists('certificate', $idpMetadata)) {
- SimpleSAML_Utilities::resolveCert($idpMetadata['certificate']);
+ $certFile = SimpleSAML_Utilities::resolveCert($idpMetadata['certificate']);
} else {
throw new Exception('Missing \'certificate\' metadata option in the \'wsfed-idp-remote\' metadata' .
' for the IdP \'' . $idpEntityId . '\'.'); | www/wsfed: Fix certificate-option in metadata.
This bug was introduced in r<I>. | simplesamlphp_saml2 | train | php |
4072408ce6e597ea966ca2c025bd44b964fab53c | diff --git a/code/services/QueuedJobService.php b/code/services/QueuedJobService.php
index <HASH>..<HASH> 100644
--- a/code/services/QueuedJobService.php
+++ b/code/services/QueuedJobService.php
@@ -563,7 +563,11 @@ class QueuedJobService {
_t('QueuedJobs.MEMORY_RELEASE', 'Job releasing memory and waiting (%s used)'),
$this->humanReadable($this->getMemoryUsage())
));
- $jobDescriptor->JobStatus = QueuedJob::STATUS_WAIT;
+
+ if ($jobDescriptor->JobStatus != QueuedJob::STATUS_BROKEN) {
+ $jobDescriptor->JobStatus = QueuedJob::STATUS_WAIT;
+ }
+
$broken = true;
}
@@ -573,7 +577,9 @@ class QueuedJobService {
'QueuedJobs.TIME_LIMIT',
'Queue has passed time limit and will restart before continuing'
));
- $jobDescriptor->JobStatus = QueuedJob::STATUS_WAIT;
+ if ($jobDescriptor->JobStatus != QueuedJob::STATUS_BROKEN) {
+ $jobDescriptor->JobStatus = QueuedJob::STATUS_WAIT;
+ }
$broken = true;
}
} | fix(QueuedJobService) Broken job status set Wait
If a job breaks (exception or similar) its status should be set to "Broken",
however if it _also_ exceeds memory or time limits, it _could_ be then set
to "Wait" again, when it should remain broken. | symbiote_silverstripe-queuedjobs | train | php |
62825d3c1c2897e414b72318a079d0d8657ade34 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -45,7 +45,7 @@ env_marker_below_38 = "python_version < '3.8'"
minimal_requirements = [
"asgiref>=3.4.0",
- "click>=7.*",
+ "click>=7.0",
"h11>=0.8",
"typing-extensions;" + env_marker_below_38,
] | :package: Add PEP<I> compliant version of click (#<I>)
Fixes #<I>. | encode_uvicorn | train | py |
f6f0fec1adf5d7349e49719bbb6c70f63d90002c | diff --git a/gamepad-controls.js b/gamepad-controls.js
index <HASH>..<HASH> 100644
--- a/gamepad-controls.js
+++ b/gamepad-controls.js
@@ -14,8 +14,6 @@ var JOYSTICK_EPS = 0.2;
module.exports = {
- dependencies: ['proxy-controls'],
-
/*******************************************************************
* Schema
*/ | remove proxy-controls dependency (is it a hard dep?) | donmccurdy_aframe-gamepad-controls | train | js |
7eff434a6ac23b69e5ee31a46cf1f5022fbbe810 | diff --git a/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb b/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb
+++ b/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb
@@ -741,23 +741,6 @@ module ActiveRecord
end
end
- # change LOB column for ORDER BY clause
- # just first 100 characters are taken for ordering
- def lob_order_by_expression(klass, order) #:nodoc:
- return order if order.nil?
- changed = false
- new_order = order.to_s.strip.split(/, */).map do |order_by_col|
- column_name, asc_desc = order_by_col.split(/ +/)
- if column = klass.columns.detect { |col| col.name == column_name && col.sql_type =~ /LOB$/i}
- changed = true
- "DBMS_LOB.SUBSTR(#{column_name},100,1) #{asc_desc}"
- else
- order_by_col
- end
- end.join(', ')
- changed ? new_order : order
- end
-
# SCHEMA STATEMENTS ========================================
#
# see: abstract/schema_statements.rb | removed lob_order_by_expression method as is is not used anymore | rsim_oracle-enhanced | train | rb |
e2f771a7088613419cd5ebfea7331c2fa4974a83 | diff --git a/test/javascript/spec/thinManSpec.js b/test/javascript/spec/thinManSpec.js
index <HASH>..<HASH> 100644
--- a/test/javascript/spec/thinManSpec.js
+++ b/test/javascript/spec/thinManSpec.js
@@ -151,11 +151,11 @@ describe("thin_man", function(){
it("serialize data", function(){
$form.affix('input[type="text"][name="name"][value="Jon Snow"]');
- thin_man.AjaxFormSubmission($form);
+ var thin = new thin_man.AjaxFormSubmission($form);
spyOn($, 'ajax');
$form.submit();
expect($.ajax).toHaveBeenCalled();
- expect(getAjaxArg("data")).toEqual([{ name: 'name', value: 'Jon Snow' }]);
+ expect(thin.ajax_options.data).toEqual([{ name: 'name', value: 'Jon Snow' },{name: 'thin_man_submitter', value: 'link_now'}]);
});
it(".getProcessData", function(){ | fixed spec
added rails tests to circle | edraut_thin-man | train | js |
5cbefbfd336af2d745b7104a1d2f24766f1f3d3e | diff --git a/lib/net/ssh/known_hosts.rb b/lib/net/ssh/known_hosts.rb
index <HASH>..<HASH> 100644
--- a/lib/net/ssh/known_hosts.rb
+++ b/lib/net/ssh/known_hosts.rb
@@ -7,11 +7,12 @@ module Net; module SSH
# Represents the result of a search in known hosts
# see search_for
- class HostKeys < Array
+ class HostKeys
+ include Enumerable
attr_reader :host
def initialize(host_keys, host, known_hosts, options = {})
- super(host_keys)
+ @host_keys = host_keys
@host = host
@known_hosts = known_hosts
@options = options
@@ -19,7 +20,15 @@ module Net; module SSH
def add_host_key(key)
@known_hosts.add(@host, key, @options)
- push(key)
+ @host_keys.push(key)
+ end
+
+ def each(&block)
+ @host_keys.each(&block)
+ end
+
+ def empty?
+ @host_keys.empty?
end
end | HostKeys is an enumerable, closes: #<I> | net-ssh_net-ssh | train | rb |
f8c16b2efc4707eb2b3282c88854957099fa7304 | diff --git a/lib/solargraph/source_map/clip.rb b/lib/solargraph/source_map/clip.rb
index <HASH>..<HASH> 100644
--- a/lib/solargraph/source_map/clip.rb
+++ b/lib/solargraph/source_map/clip.rb
@@ -57,13 +57,6 @@ module Solargraph
cursor.chain.infer(api_map, context_pin, locals)
end
- # The context at the current position.
- #
- # @return [Pin::Base]
- def context_pin
- @context ||= source_map.locate_named_path_pin(cursor.node_position.line, cursor.node_position.character)
- end
-
# Get an array of all the locals that are visible from the cursors's
# position. Locals can be local variables, method parameters, or block
# parameters. The array starts with the nearest local pin.
@@ -93,6 +86,13 @@ module Solargraph
@block ||= source_map.locate_block_pin(cursor.node_position.line, cursor.node_position.character)
end
+ # The context at the current position.
+ #
+ # @return [Pin::Base]
+ def context_pin
+ @context ||= source_map.locate_named_path_pin(cursor.node_position.line, cursor.node_position.character)
+ end
+
# @param cursor [cursor]
# @param result [Array<Pin::Base>]
# @return [Completion] | Clip#context_pin is private. | castwide_solargraph | train | rb |
48a8fac931752f7af2e12dfcc5bc4133a6ffca1c | diff --git a/spec/dep_selector/selector_spec.rb b/spec/dep_selector/selector_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/dep_selector/selector_spec.rb
+++ b/spec/dep_selector/selector_spec.rb
@@ -220,18 +220,20 @@ describe DepSelector::Selector do
it "and indicates which solution constraint makes the system unsatisfiable if there is no solution" do
dep_graph = DepSelector::DependencyGraph.new
setup_constraint(dep_graph, simple_cookbook_version_constraint_2)
+ setup_constraint(dep_graph, padding_packages)
selector = DepSelector::Selector.new(dep_graph)
unsatisfiable_solution_constraints =
setup_soln_constraints(dep_graph,
[
["A"],
- ["C", "= 3.0.0"]
+ ["C", "= 3.0.0"],
+ ["padding1"]
])
begin
selector.find_solution(unsatisfiable_solution_constraints)
fail "Should have failed to find a solution"
rescue DepSelector::Exceptions::NoSolutionExists => nse
- nse.unsatisfiable_constraint.should == unsatisfiable_solution_constraints.last
+ nse.unsatisfiable_constraint.should == unsatisfiable_solution_constraints[1]
end
end | Making sure the right solution constraint is identified as the problem in one of the tests | chef_dep-selector | train | rb |
2ccaaf9df67f6acebb1dc6a61b325058967a91a1 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -55,7 +55,9 @@ setup(
'pytest-cov',
'pycodestyle',
'pytest-flake8',
- 'pytest-mypy>=0.4.0'
+ 'pytest-mypy>=0.4.0',
+ # see https://github.com/python/importlib_metadata/issues/259
+ 'importlib-metadata==2.1.0'
],
extras_require={
'dev': ['yapf', 'isort'], | Try to fix CI on Python <I> | yatiml_yatiml | train | py |
61b8fa691c9954ccfe965018420c88ebf8a43737 | diff --git a/model/actions/GetActiveDeliveryExecution.php b/model/actions/GetActiveDeliveryExecution.php
index <HASH>..<HASH> 100644
--- a/model/actions/GetActiveDeliveryExecution.php
+++ b/model/actions/GetActiveDeliveryExecution.php
@@ -25,6 +25,7 @@ use oat\ltiDeliveryProvider\model\LTIDeliveryTool;
use oat\ltiDeliveryProvider\controller\DeliveryTool;
use oat\ltiDeliveryProvider\model\execution\LtiDeliveryExecutionService;
use oat\taoDelivery\model\execution\DeliveryExecution;
+use oat\taoDelivery\model\execution\DeliveryServerService;
/**
* Class GetActiveDeliveryExecution
@@ -69,8 +70,9 @@ class GetActiveDeliveryExecution extends AbstractQueuedAction
if (empty($executions)) {
$active = $this->getTool()->startDelivery($this->delivery, $remoteLink, $user);
} else {
+ $resumable = $this->getServiceLocator()->get(DeliveryServerService::SERVICE_ID)->getResumableStates();
foreach ($executions as $deliveryExecution) {
- if (!$deliveryExecutionService->isFinished($deliveryExecution)) {
+ if (in_array($deliveryExecution->getState()->getUri(), $resumable)) {
$active = $deliveryExecution;
break;
} | Prevent resuming terminated executions | oat-sa_extension-tao-ltideliveryprovider | train | php |
1722b00ea6a207169e717d692a5d57d0152e2f1b | diff --git a/tests/test_graph_api.py b/tests/test_graph_api.py
index <HASH>..<HASH> 100644
--- a/tests/test_graph_api.py
+++ b/tests/test_graph_api.py
@@ -124,6 +124,31 @@ def test_get():
)
@with_setup(mock, unmock)
+def test_paged_get_avoid_extra_request():
+ graph = GraphAPI('<access token>')
+ limit = 2
+
+ mock_request.return_value.content = json.dumps({
+ 'data': [
+ {
+ 'message': 'He\'s a complicated man. And the only one that understands him is his woman',
+ },
+ ],
+ 'paging': {
+ 'next': 'https://graph.facebook.com/herc/posts?limit=%(limit)s&offset=%(limit)s&value=1&access_token=<access token>' % {
+ 'limit': limit
+ }
+ }
+ })
+
+ pages = graph.get('herc/posts', page=True, limit=limit)
+
+ for index, page in enumerate(pages):
+ pass
+
+ assert_equal(index, 0)
+
+@with_setup(mock, unmock)
def test_get_with_retries():
graph = GraphAPI(TEST_USER_ACCESS_TOKEN) | Adding a test for extra requests when paginating | jgorset_facepy | train | py |
80796db638df82817cf31c410d4640a8f7f572c4 | diff --git a/aws/resource_aws_opsworks_user_profile_test.go b/aws/resource_aws_opsworks_user_profile_test.go
index <HASH>..<HASH> 100644
--- a/aws/resource_aws_opsworks_user_profile_test.go
+++ b/aws/resource_aws_opsworks_user_profile_test.go
@@ -17,6 +17,7 @@ func TestAccAWSOpsworksUserProfile_basic(t *testing.T) {
updateRName := fmt.Sprintf("test-user-%d", acctest.RandInt())
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) },
+ ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsOpsworksUserProfileDestroy,
Steps: []resource.TestStep{ | tests/r/opsworks_user_profile: Add ErrorCheck | terraform-providers_terraform-provider-aws | train | go |
0aa4c41f8c27fa3b090d15a24e59474a7ea5ff18 | diff --git a/metric_tank/helper.go b/metric_tank/helper.go
index <HASH>..<HASH> 100644
--- a/metric_tank/helper.go
+++ b/metric_tank/helper.go
@@ -8,9 +8,9 @@ import (
func TS(ts interface{}) string {
switch t := ts.(type) {
case int64:
- return time.Unix(t, 0).Format("15:04:05")
+ return time.Unix(t, 0).Format("02 15:04:05")
case uint32:
- return time.Unix(int64(t), 0).Format("15:04:05")
+ return time.Unix(int64(t), 0).Format("02 15:04:05")
default:
return fmt.Sprintf("unexpected type %T\n", ts)
} | add day again to ts output for clarity | grafana_metrictank | train | go |
07f2d48c6f2ce0ab265f22b0d8a66b469478feba | diff --git a/Transformer/ConditionFromBooleanToBddTransformerInterface.php b/Transformer/ConditionFromBooleanToBddTransformerInterface.php
index <HASH>..<HASH> 100644
--- a/Transformer/ConditionFromBooleanToBddTransformerInterface.php
+++ b/Transformer/ConditionFromBooleanToBddTransformerInterface.php
@@ -3,12 +3,12 @@
namespace OpenOrchestra\Transformer;
use Symfony\Component\Form\DataTransformerInterface;
-@trigger_error('The '.__NAMESPACE__.'\ConditionFromBooleanToBddTransformerInterface class is deprecated since version 1.2.0 and will be removed in 1.3.0', E_USER_DEPRECATED);
+@trigger_error('The '.__NAMESPACE__.'\ConditionFromBooleanToBddTransformerInterface class is deprecated since version 1.2.0 and will be removed in 2.0', E_USER_DEPRECATED);
/**
* Class ConditionFromBooleanToBddTransformer
*
- * @deprecated will be removed in 1.3.0
+ * @deprecated will be removed in 2.0
*/
interface ConditionFromBooleanToBddTransformerInterface extends DataTransformerInterface
{ | update deprecated annotation (#<I>) | open-orchestra_open-orchestra-libs | train | php |
09a21cddaba70a37c53faadcac3f98a3c384be17 | diff --git a/cassandra/__init__.py b/cassandra/__init__.py
index <HASH>..<HASH> 100644
--- a/cassandra/__init__.py
+++ b/cassandra/__init__.py
@@ -22,7 +22,7 @@ class NullHandler(logging.Handler):
logging.getLogger('cassandra').addHandler(NullHandler())
-__version_info__ = (3, 9, 0)
+__version_info__ = (3, 9, 0, 'post0')
__version__ = '.'.join(map(str, __version_info__)) | post-release version (<I>) | datastax_python-driver | train | py |
5c8ac84c13d0dbe0de89ffb6a340857a7fd26002 | diff --git a/src/PhantomInstaller/Installer.php b/src/PhantomInstaller/Installer.php
index <HASH>..<HASH> 100644
--- a/src/PhantomInstaller/Installer.php
+++ b/src/PhantomInstaller/Installer.php
@@ -95,7 +95,14 @@ class Installer
public static function getPhantomJsVersions()
{
- return array('2.0.0', '1.9.8', '1.9.7');
+ return array('2.1.1', '2.0.0', '1.9.8', '1.9.7');
+ }
+
+ public static function getLatestPhantomJsVersion()
+ {
+ $versions = self::getPhantomJsVersions();
+
+ return $version[0];
}
public static function getLowerVersion($old_version)
@@ -134,9 +141,9 @@ class Installer
$version = self::getRequiredVersion($composer->getPackage(), 'jakoch/phantomjs-installer');
}
- // fallback to a hardcoded version number, if "dev-master" was set
+ // fallback to the hardcoded latest version, if "dev-master" was set
if ($version === 'dev-master') {
- return '2.0.0';
+ return self::getLatestPhantomJsVersion();
}
// grab version from commit-reference, e.g. "dev-master#<commit-ref> as version" | added <I> to the versions array
removed the hardcoded latest version from getVersion()
and replaced it by a call to the newly added getLatestPhantomJsVersion()
issue <URL> | jakoch_phantomjs-installer | train | php |
8a78744cf5747a95256079a76ac2af1946d4013d | diff --git a/library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java b/library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java
index <HASH>..<HASH> 100644
--- a/library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java
+++ b/library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java
@@ -1186,7 +1186,7 @@ public class AccountHeaderBuilder {
//cancel previous started image loading processes
DrawerImageLoader.getInstance().cancelImage(iv);
//set the placeholder
- iv.setImageDrawable(DrawerUIUtils.getPlaceHolder(iv.getContext()));
+ iv.setImageDrawable(DrawerImageLoader.getInstance().getImageLoader().placeholder(iv.getContext(), DrawerImageLoader.Tags.PROFILE.name()));
//set the real image (probably also the uri)
ImageHolder.applyTo(imageHolder, iv, DrawerImageLoader.Tags.PROFILE.name());
} | * respect the placholder defined in the DrawerImageLoader | mikepenz_MaterialDrawer | train | java |
d8e7f53804adf2c31a65e1b2d511dd1233816fbc | diff --git a/cmds/set.js b/cmds/set.js
index <HASH>..<HASH> 100644
--- a/cmds/set.js
+++ b/cmds/set.js
@@ -24,9 +24,17 @@ async function set (argv) {
if (argv.property === 'cidr_whitelist') {
info.cidr_whitelist = validateCIDR.list(argv.value)
} else if (argv.property === 'password') {
- const oldpassword = await read.password('Current password: ')
- const newpassword = await read.password('New password: ')
- info.password = {'old': oldpassword, 'new': newpassword}
+ const oldpassword = await read.password('Current password: ')
+ let new1password
+ let new2password
+ while (new1password !== new2password || new1password == null) {
+ new1password = await read.password('New password: ')
+ new2password = await read.password('New password (again): ')
+ if (new1password !== new2password) {
+ console.error("Passwords didn't match, try again please!")
+ }
+ }
+ info.password = {'old': oldpassword, 'new': new1password}
} else {
info[argv.property] = argv.value
} | set: Ask for new password twice, retry if n -match | npm_npm-profile | train | js |
0284826a45ec005038933d9d49597f6bf09c2b86 | diff --git a/lib/Compilation.js b/lib/Compilation.js
index <HASH>..<HASH> 100644
--- a/lib/Compilation.js
+++ b/lib/Compilation.js
@@ -979,7 +979,7 @@ class Compilation extends Tapable {
chunk = chunks[i];
const chunkHash = crypto.createHash(hashFunction);
if(outputOptions.hashSalt)
- hash.update(outputOptions.hashSalt);
+ chunkHash.update(outputOptions.hashSalt);
chunk.updateHash(chunkHash);
if(chunk.hasRuntime()) {
this.mainTemplate.updateHashForChunk(chunkHash, chunk); | update chunkhash instead of main hash in chunk hashing loop | webpack_webpack | train | js |
89892b2200e7c8626391778eaa4ea9870f384c01 | diff --git a/Lib/pyhsm/__init__.py b/Lib/pyhsm/__init__.py
index <HASH>..<HASH> 100644
--- a/Lib/pyhsm/__init__.py
+++ b/Lib/pyhsm/__init__.py
@@ -41,7 +41,7 @@ Basic usage :
See help(pyhsm.base) for more information.
"""
-__version__ = '0.9.8b'
+__version__ = '0.9.8c'
__all__ = ["base",
"cmd",
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@ import sys
sys.path.append('Tests');
setup(name = 'pyhsm',
- version = '0.9.8b',
+ version = '0.9.8c',
description = 'Python code for talking to a YubiHSM',
author = 'Fredrik Thulin',
author_email = 'fredrik@yubico.com', | Prepare for version <I>c. | Yubico_python-pyhsm | train | py,py |
d79706802a887148b5b414c58c59fd0f9c12e6a0 | diff --git a/src/main/java/com/afrozaar/wordpress/wpapi/v2/model/MediaDetails.java b/src/main/java/com/afrozaar/wordpress/wpapi/v2/model/MediaDetails.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/afrozaar/wordpress/wpapi/v2/model/MediaDetails.java
+++ b/src/main/java/com/afrozaar/wordpress/wpapi/v2/model/MediaDetails.java
@@ -63,7 +63,7 @@ public class MediaDetails {
", height=" + height +
", file='" + file + '\'' +
", sizes=" + sizes +
-// ", imageMeta=" + imageMeta.toString() +
+ ", imageMeta=" + imageMeta +
'}';
}
} | removing call to tostring on possible null field | Afrozaar_wp-api-v2-client-java | train | java |
bfd4abf078b1da8a1eb5cb6c1fe3edf22685d0c6 | diff --git a/service/src/java/org/ops4j/pax/logging/service/internal/LoggingServiceFactory.java b/service/src/java/org/ops4j/pax/logging/service/internal/LoggingServiceFactory.java
index <HASH>..<HASH> 100644
--- a/service/src/java/org/ops4j/pax/logging/service/internal/LoggingServiceFactory.java
+++ b/service/src/java/org/ops4j/pax/logging/service/internal/LoggingServiceFactory.java
@@ -264,6 +264,12 @@ public class LoggingServiceFactory
}
}
}
+ // If the updated() method is called without any Configuration URL and without any log4j properties,
+ // then keep the default/previous configuration.
+ if( extracted.size() == 0 )
+ {
+ return;
+ }
m_ConfigFactory.configure( extracted );
m_IsUsingGlobal = false;
} | Don't update if the updated() method doesn't contain any useful data. | ops4j_org.ops4j.pax.logging | train | java |
99620ee869588e3f49de6fbc649416f61f2b4b12 | diff --git a/src/ContaoCommunityAlliance/DcGeneral/DataDefinition/Palette/Builder/PaletteBuilder.php b/src/ContaoCommunityAlliance/DcGeneral/DataDefinition/Palette/Builder/PaletteBuilder.php
index <HASH>..<HASH> 100644
--- a/src/ContaoCommunityAlliance/DcGeneral/DataDefinition/Palette/Builder/PaletteBuilder.php
+++ b/src/ContaoCommunityAlliance/DcGeneral/DataDefinition/Palette/Builder/PaletteBuilder.php
@@ -78,6 +78,9 @@ use ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException;
* The palette builder is used to build palette collections, palettes, legends, properties and conditions.
*
* @SuppressWarnings(PHPMD.LongVariable)
+ * @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
+ * @SuppressWarnings(PHPMD.ExcessiveClassLength)
*/
class PaletteBuilder
{ | Exclude some phpmd warnings for the palette builder | contao-community-alliance_dc-general | train | php |
f4e8f60b53dabe5c34f5f8276beaa161ac3afd47 | diff --git a/src/dialects/oracle/index.js b/src/dialects/oracle/index.js
index <HASH>..<HASH> 100644
--- a/src/dialects/oracle/index.js
+++ b/src/dialects/oracle/index.js
@@ -75,8 +75,8 @@ assign(Client_Oracle.prototype, {
return new Promise(function(resolver, rejecter) {
client.driver.connect(client.connectionSettings,
function(err, connection) {
- Promise.promisifyAll(connection)
if (err) return rejecter(err)
+ Promise.promisifyAll(connection)
if (client.connectionSettings.prefetchRowCount) {
connection.setPrefetchRowCount(client.connectionSettings.prefetchRowCount)
} | fixed connection error handling for oracle dialect | tgriesser_knex | train | js |
f346379c7bf39a9f46771cfd9043e0eb2dd98793 | diff --git a/lib/Doctrine/ORM/Query.php b/lib/Doctrine/ORM/Query.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/ORM/Query.php
+++ b/lib/Doctrine/ORM/Query.php
@@ -649,6 +649,10 @@ final class Query extends AbstractQuery
*/
public function setFirstResult($firstResult): self
{
+ if ($firstResult !== null) {
+ $firstResult = (int) $firstResult;
+ }
+
$this->firstResult = $firstResult;
$this->_state = self::STATE_DIRTY;
diff --git a/lib/Doctrine/ORM/QueryBuilder.php b/lib/Doctrine/ORM/QueryBuilder.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/ORM/QueryBuilder.php
+++ b/lib/Doctrine/ORM/QueryBuilder.php
@@ -627,6 +627,10 @@ class QueryBuilder
*/
public function setFirstResult($firstResult)
{
+ if ($firstResult !== null) {
+ $firstResult = (int) $firstResult;
+ }
+
$this->_firstResult = $firstResult;
return $this; | Add integer cast in setFirstResult methods of Query and QueryBuilder (#<I>) | doctrine_orm | train | php,php |
2a71e68ff9e023f48ef8f930b0de2cb5df06c999 | diff --git a/src/Tab.js b/src/Tab.js
index <HASH>..<HASH> 100644
--- a/src/Tab.js
+++ b/src/Tab.js
@@ -61,6 +61,7 @@ export default class Tab extends React.Component {
onClick: this.handleClick.bind(this),
onKeyDown: this.handleKeyDown.bind(this),
role: 'tab',
+ 'aria-selected': isActive,
'aria-controls': props.tabId,
}, kids);
} | Add aria-selected to tabs; addresses #4 | davidtheclark_react-aria-tabpanel | train | js |
7e446b5056013af842e4fa6f26c45e762eedc997 | diff --git a/src/Illuminate/Foundation/helpers.php b/src/Illuminate/Foundation/helpers.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Foundation/helpers.php
+++ b/src/Illuminate/Foundation/helpers.php
@@ -322,7 +322,7 @@ if (! function_exists('env')) {
return;
}
- if (Str::startsWith($value, '"') && Str::endsWith($value, '"')) {
+ if (strlen($value) > 1 && Str::startsWith($value, '"') && Str::endsWith($value, '"')) {
return substr($value, 1, -1);
} | check length in env function. | laravel_framework | train | php |
694a4a5148192be14b1ff5dc7353ec0c55297fb4 | diff --git a/packages/ncform-common/src/validation-rule.js b/packages/ncform-common/src/validation-rule.js
index <HASH>..<HASH> 100755
--- a/packages/ncform-common/src/validation-rule.js
+++ b/packages/ncform-common/src/validation-rule.js
@@ -29,7 +29,7 @@ class ValidationRule {
case "promise":
result.then(res => {
resolve({
- res,
+ result: res,
errMsg: !res ? this.errMsg || this.defaultErrMsg : "",
timeStamp
}); | fix(ncform-common): Fixed the bug that the promise type rule logic does not take effect when submiss | ncform_ncform | train | js |
4923bd89f6b7aaa592ca60629e002d98e91129b6 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -81,7 +81,7 @@ setup(name = 'Photini',
author = 'Jim Easterbrook',
author_email = 'jim@jim-easterbrook.me.uk',
url = url,
- download_url = url + '/archive/Photini-' + '.'.join(version.split('.')[0:2]) + '.tar.gz',
+ download_url = url + '/archive/Photini-' + version + '.tar.gz',
description = 'Simple photo metadata editor',
long_description = long_description,
classifiers = [
diff --git a/src/photini/version.py b/src/photini/version.py
index <HASH>..<HASH> 100644
--- a/src/photini/version.py
+++ b/src/photini/version.py
@@ -1,5 +1,5 @@
from __future__ import unicode_literals
-version = '14.06.dev106'
-release = '106'
-commit = '55bf758'
+version = '14.06.dev107'
+release = '107'
+commit = '54f953b' | Include full version in PyPI download URL. | jim-easterbrook_Photini | train | py,py |
2bddffdf6c1f4709cb6ec118bc30acfd25e445df | diff --git a/doc-src/plugins/apis.rb b/doc-src/plugins/apis.rb
index <HASH>..<HASH> 100644
--- a/doc-src/plugins/apis.rb
+++ b/doc-src/plugins/apis.rb
@@ -172,10 +172,10 @@ def document_svc_api_operation(svc_name, client, method_name, operation)
t.tab(method_name, 'Formatting Example') do
"<pre><code>#{documentor.example}</code></pre>"
end
- t.tab(method_name, 'Parameters Reference') do
+ t.tab(method_name, 'Request Parameters') do
documentor.input
end
- t.tab(method_name, 'Response Reference') do
+ t.tab(method_name, 'Response Structure') do
documentor.output
end
t.tab(method_name, 'API Model') do | Renamed the tabs in the API reference docs. | aws_aws-sdk-ruby | train | rb |
8cfd2c3d6e9d779472bde7c05c72daff111c6868 | diff --git a/system/Commands/Database/ShowTableInfo.php b/system/Commands/Database/ShowTableInfo.php
index <HASH>..<HASH> 100644
--- a/system/Commands/Database/ShowTableInfo.php
+++ b/system/Commands/Database/ShowTableInfo.php
@@ -81,7 +81,9 @@ class ShowTableInfo extends BaseCommand
$tables = $this->db->listTables();
- $this->sortIsDESC = CLI::getOption('desc');
+ if (CLI::getOption('desc') === true) {
+ $this->sortIsDESC = true;
+ }
if ($tables === []) {
CLI::error('Database has no tables!', 'light_gray', 'red'); | fix: $sortIsDESC assignment
Ensure that boolean is assigned. | codeigniter4_CodeIgniter4 | train | php |
88e572cd01affb13087a3899613398735e114426 | diff --git a/tests/Gliph/Traversal/DepthFirstTest.php b/tests/Gliph/Traversal/DepthFirstTest.php
index <HASH>..<HASH> 100644
--- a/tests/Gliph/Traversal/DepthFirstTest.php
+++ b/tests/Gliph/Traversal/DepthFirstTest.php
@@ -25,14 +25,14 @@ class DepthFirstTest extends \PHPUnit_Framework_TestCase {
'f' => new TestVertex('f'),
'g' => new TestVertex('g'),
);
- }
- public function testBasicTopologicalSort() {
$this->g->addDirectedEdge($this->v['a'], $this->v['b']);
$this->g->addDirectedEdge($this->v['b'], $this->v['c']);
$this->g->addDirectedEdge($this->v['a'], $this->v['c']);
$this->g->addDirectedEdge($this->v['b'], $this->v['d']);
+ }
+ public function testBasicAcyclicDepthFirstTraversal() {
$visitor = $this->getMock('Gliph\\Visitor\\DepthFirstNoOpVisitor');
$visitor->expects($this->exactly(4))->method('onInitializeVertex');
$visitor->expects($this->exactly(0))->method('onBackEdge'); | Better name for first traversal test; also make graph fixture reusable. | sdboyer_gliph | train | php |
0c588976100e08195f5e85318f0a1be9ad4fb694 | diff --git a/test/perf/promise.js b/test/perf/promise.js
index <HASH>..<HASH> 100644
--- a/test/perf/promise.js
+++ b/test/perf/promise.js
@@ -1,6 +1,6 @@
"use strict";
-var GpfPromise = gpf.internals._GpfPromise;
+var GpfPromise = gpf.Promise;
function createTest (PromiseClass) {
return function () { | gpf.Promise exposes the internal one (#<I>) | ArnaudBuchholz_gpf-js | train | js |
26fea9d48e5f98fe21b1259d08b397c0d9fcab9d | diff --git a/angr/analyses/cfg_fast.py b/angr/analyses/cfg_fast.py
index <HASH>..<HASH> 100644
--- a/angr/analyses/cfg_fast.py
+++ b/angr/analyses/cfg_fast.py
@@ -543,7 +543,7 @@ class CFGJob(object):
self.syscall = syscall
def __repr__(self):
- return "<CFGEntry%s %#08x @ func %#08x>" % (" syscall" if self.syscall else "", self.addr, self.func_addr)
+ return "<CFGJob%s %#08x @ func %#08x>" % (" syscall" if self.syscall else "", self.addr, self.func_addr)
def __eq__(self, other):
return self.addr == other.addr and \ | Fix __repr__() of CFGJob in CFGFast. | angr_angr | train | py |
b526925f8b19e1d8e19de45f1714ee158bf96acf | diff --git a/src/FontAwesome.php b/src/FontAwesome.php
index <HASH>..<HASH> 100755
--- a/src/FontAwesome.php
+++ b/src/FontAwesome.php
@@ -98,11 +98,11 @@ class FontAwesome extends FontAwesomeHtmlEntity
$attrs = '';
$classes = 'fa-' . $this->icon;
- if (count($this->classes) > 0) {
+ if (!empty($this->classes) && count($this->classes) > 0) {
$classes .= ' ' . implode(' ', $this->classes);
}
- if (count($this->attributes) > 0) {
+ if (!empty($this->attributes) && count($this->attributes) > 0) {
foreach ($this->attributes as $attr => $val) {
$attrs .= ' ' . $attr . '="' . $val . '"';
} | Prevent calling count() on null object
Calling count on the null object is throwing errors like:
`PHP Fatal error: Method Khill\FontAwesome\FontAwesome::__toString() must not throw an exception`
(On PHP <I> anyway)
Adding `!empty()` ensures it doesn't attempt to iterate over the null object. | kevinkhill_FontAwesomePHP | train | php |
eb00f26bfced2b67b09fa7573e58b9db9f023126 | diff --git a/src/Form/Element/Wysiwyg.php b/src/Form/Element/Wysiwyg.php
index <HASH>..<HASH> 100755
--- a/src/Form/Element/Wysiwyg.php
+++ b/src/Form/Element/Wysiwyg.php
@@ -90,6 +90,14 @@ class Wysiwyg extends NamedFormElement
if (! $params->has('filebrowserUploadUrl')) {
$this->parameters['filebrowserUploadUrl'] = route('admin.ckeditor.upload', ['_token' => csrf_token()]);
}
+
+ if ($this->getEditor() == 'ckeditor5') {
+ if (! $params->get('ckfinder.uploadUrl')) {
+ $temp = (array)$params->get('ckfinder') ?: [];
+ $temp['uploadUrl'] = route('admin.ckeditor.upload', ['_token' => csrf_token()]);
+ $this->parameters['ckfinder'] = $temp;
+ }
+ }
}
/** | Allow to upload images with CKEditor 5 | LaravelRUS_SleepingOwlAdmin | train | php |
5bcfaece3d5a2ed28100de5ea61cd0fe6bc4eeda | diff --git a/course/teacher.php b/course/teacher.php
index <HASH>..<HASH> 100644
--- a/course/teacher.php
+++ b/course/teacher.php
@@ -67,7 +67,8 @@
/// If data submitted, then process and store.
- if ($form = data_submitted()) {
+ if ($form = data_submitted() and confirm_sesskey()) {
+ unset ($form->sesskey);
$rank = array();
// Peel out all the data from variable names.
@@ -165,6 +166,7 @@
print_table($table);
echo "<input type=\"hidden\" name=\"id\" value=\"$course->id\" />";
+ echo "<input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />";
echo "<center><input type=\"submit\" value=\"".get_string("savechanges")."\" /> ";
echo "</center>";
echo "</form>"; | course/teacher.php is using sesskey.
(POST form too)
Merged from MOODLE_<I>_STABLE | moodle_moodle | train | php |
2eb1bf479b0d05b250030e6041c747fca5266d4c | diff --git a/src/ol/source/VectorEventType.js b/src/ol/source/VectorEventType.js
index <HASH>..<HASH> 100644
--- a/src/ol/source/VectorEventType.js
+++ b/src/ol/source/VectorEventType.js
@@ -58,5 +58,5 @@ export default {
};
/**
- * @typedef {'addfeature'|'clear'|'removefeature'|'featuresloadstart'|'featuresloadend'|'featuresloaderror'} VectorSourceEventTypes
+ * @typedef {'addfeature'|'changefeature'|'clear'|'removefeature'|'featuresloadstart'|'featuresloadend'|'featuresloaderror'} VectorSourceEventTypes
*/ | VectorEventType: Add 'changefeature' in @typedef
'changefeature' is missing in @typedef - Add it. | openlayers_openlayers | train | js |
7ec5ac00783a350829e907f37a1578bc0a41912a | diff --git a/WebDriverElement.php b/WebDriverElement.php
index <HASH>..<HASH> 100644
--- a/WebDriverElement.php
+++ b/WebDriverElement.php
@@ -16,7 +16,6 @@
final class WebDriverElement extends WebDriverContainer {
protected function methods() {
return array(
- 'active' => 'POST',
'click' => 'POST',
'submit' => 'POST',
'text' => 'GET', | remove 'active' from element class where it never belonged
Summary:
Reviewers:
Test Plan:
Task ID: | facebook_php-webdriver | train | php |
68cdfff1bb7cbccea1510e8309b3bacb0af2d3ad | diff --git a/pymouse/x11.py b/pymouse/x11.py
index <HASH>..<HASH> 100644
--- a/pymouse/x11.py
+++ b/pymouse/x11.py
@@ -53,8 +53,8 @@ class PyMouse(PyMouseMeta):
return width, height
class PyMouseEvent(PyMouseEventMeta):
- def __init__(self, display=None):
- PyMouseEventMeta.__init__(self)
+ def __init__(self, capture=False, capture_move=False, display=None):
+ PyMouseEventMeta.__init__(self, capture=False, capture_move=False)
self.display = Display(display)
self.display2 = Display(display)
self.ctx = self.display2.record_create_context( | Click capturing is now enabled in pymouse for x<I> | SavinaRoja_PyUserInput | train | py |
8c0ef41d6a7c45e5c6ce0bfbfb06b745c42f2d0d | diff --git a/mod/forum/lib.php b/mod/forum/lib.php
index <HASH>..<HASH> 100644
--- a/mod/forum/lib.php
+++ b/mod/forum/lib.php
@@ -259,6 +259,9 @@ function forum_cron () {
}
}
}
+
+ /// GWD: reset timelimit so that script does not get timed out when posting to many users
+ set_time_limit(10);
/// Override the language and timezone of the "current" user, so that
/// mail is customised for the receiver. | reset timelimit so that script does not get timed out when posting to many users | moodle_moodle | train | php |
16ea6f3d1fbcf0bf89cb44d2cb748d9ce23ae891 | diff --git a/docs/source/conf.py b/docs/source/conf.py
index <HASH>..<HASH> 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -58,9 +58,9 @@ copyright = u'2016, Custodia Contributors'
# built documents.
#
# The short X.Y version.
-version = '0.3'
+version = '0.4'
# The full version, including alpha/beta/rc tags.
-release = '0.3.1'
+release = '0.4.dev2'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -81,7 +81,7 @@ setup(
name='custodia',
description='A service to manage, retrieve and store secrets',
long_description=long_description,
- version='0.3.1',
+ version='0.4.dev2',
license='GPLv3+',
maintainer='Custodia project Contributors',
maintainer_email='simo@redhat.com', | Post release bump to <I>.dev2 | latchset_custodia | train | py,py |
156784fef1f66dddcdfb753839f2d37bbee41655 | diff --git a/tasks/release.rb b/tasks/release.rb
index <HASH>..<HASH> 100644
--- a/tasks/release.rb
+++ b/tasks/release.rb
@@ -116,6 +116,7 @@ namespace :all do
task :tag do
sh "git tag #{tag}"
+ sh "git push --tags"
end
task :release => %w(ensure_clean_state build commit tag push) | rake release should push the tag | rails_rails | train | rb |
fb1b22e52e6246fb223d4bb0003efc8a342159c7 | diff --git a/demo/src/main/java/com/liulishuo/filedownloader/demo/NotificationDemoActivity.java b/demo/src/main/java/com/liulishuo/filedownloader/demo/NotificationDemoActivity.java
index <HASH>..<HASH> 100644
--- a/demo/src/main/java/com/liulishuo/filedownloader/demo/NotificationDemoActivity.java
+++ b/demo/src/main/java/com/liulishuo/filedownloader/demo/NotificationDemoActivity.java
@@ -191,6 +191,9 @@ public class NotificationDemoActivity extends AppCompatActivity {
@Override
protected void onDestroy() {
+ if (downloadId != 0) {
+ FileDownloader.getImpl().pause(downloadId);
+ }
this.notificationHelper.clear();
clear();
super.onDestroy(); | demo(notification-demo): pause the download-task when the notification-demo-activity is on destroy | lingochamp_FileDownloader | train | java |
6ad3bb29477c2d229fa57d8be072bd9f83c84e13 | diff --git a/workshift/views.py b/workshift/views.py
index <HASH>..<HASH> 100644
--- a/workshift/views.py
+++ b/workshift/views.py
@@ -100,6 +100,8 @@ def add_workshift_context(request):
workshift_emails=workshift_email_str,
))
+ today = now().date()
+
if current_semester:
# number of days passed in this semester
days_passed = (today - current_semester.start_date).days
@@ -124,8 +126,6 @@ def add_workshift_context(request):
workshift_manager = utils.can_manage(request.user, semester=SEMESTER)
- today = now().date()
-
# TODO figure out how to get pool standing out to the template
upcoming_shifts = WorkshiftInstance.objects.filter(
workshifter=workshift_profile, | Fixed variable being referenced before initialization | knagra_farnsworth | train | py |
4a7867043085ee22175a5aa6c445f933838088e5 | diff --git a/generators/app/index.js b/generators/app/index.js
index <HASH>..<HASH> 100644
--- a/generators/app/index.js
+++ b/generators/app/index.js
@@ -37,7 +37,7 @@ module.exports = fountain.Base.extend({
'angular2': '^2.0.0-beta.0',
'es6-promise': '^3.0.2',
'reflect-metadata': '^0.1.2',
- 'rxjs': '^5.0.0-beta.0',
+ 'rxjs': '5.0.0-beta.4', // https://github.com/ReactiveX/rxjs/issues/1584
'zone.js': '^0.5.10'
}
}); | Fix version of rxjs to fix rxjs issue | FountainJS_generator-fountain-angular2 | train | js |
b241c50957c6f651d293600a74d06ae61aa69a72 | diff --git a/source/php/BulkImport.php b/source/php/BulkImport.php
index <HASH>..<HASH> 100644
--- a/source/php/BulkImport.php
+++ b/source/php/BulkImport.php
@@ -296,7 +296,13 @@ class BulkImport
foreach ($userNames as $userName) {
if (!empty($userName) && !in_array($userName, $this->getLocalAccounts())) {
- $userId = wp_create_user($userName, wp_generate_password(), $this->createFakeEmail($userName));
+
+ //Do a sanity check
+ if (username_exists($userName)) {
+ $userId = wp_create_user($userName, wp_generate_password(), $this->createFakeEmail($userName));
+ } else {
+ $userId = null;
+ }
if (is_numeric($userId)) {
$this->setUserRole($userId); | Check that the username exists before creating it. | helsingborg-stad_active-directory-api-wp-integration | train | php |
e6743744922899131df10d2153fc08eb3d667308 | diff --git a/feedjack/bin/feedjack_update.py b/feedjack/bin/feedjack_update.py
index <HASH>..<HASH> 100755
--- a/feedjack/bin/feedjack_update.py
+++ b/feedjack/bin/feedjack_update.py
@@ -37,6 +37,7 @@ mtime = lambda ttime: datetime(*ttime[:6])
_exc_frame = '[{0}] ! ' + '-'*25
def print_exc(feed_id):
+ import traceback
print _exc_frame.format(feed_id)
traceback.print_exc()
print _exc_frame.format(feed_id)
@@ -124,7 +125,7 @@ class ProcessFeed:
else: # new post, store it into database
retval = ENTRY_NEW
- log.extra(u'[{0}] Saving new post: {1}'.format(self.feed.id, post.link))
+ log.extra(u'[{0}] Saving new post: {1}'.format(self.feed.id, post.guid))
# Try hard to set date_modified: feed.modified, http.modified and now() as a last resort
if not post.date_modified and self.fpf:
if self.fpf.feed.get('modified_parsed'):
@@ -283,7 +284,7 @@ class Dispatcher:
ret_feed, ret_entries = pfeed.process()
del pfeed
except:
- print_exc(self.feed.id)
+ print_exc(feed.id)
ret_feed = FEED_ERREXC
ret_entries = dict()
transaction.savepoint_rollback(tsp) | bin.fj_update: further polished error-reporting | mk-fg_feedjack | train | py |
db1753be3764e6c6ce46b74a4cdd0f2d9c90a1ec | diff --git a/mode/gherkin/gherkin.js b/mode/gherkin/gherkin.js
index <HASH>..<HASH> 100644
--- a/mode/gherkin/gherkin.js
+++ b/mode/gherkin/gherkin.js
@@ -64,7 +64,7 @@ CodeMirror.defineMode("gherkin", function () {
return "bracket";
} else {
stream.match(/[^\|]*/);
- return state.tableHeaderLine ? "property" : "string";
+ return state.tableHeaderLine ? "header" : "string";
}
}
@@ -148,7 +148,7 @@ CodeMirror.defineMode("gherkin", function () {
// PLACEHOLDER
} else if (state.allowPlaceholders && stream.match(/<[^>]*>?/)) {
- return "attribute";
+ return "variable";
// Fall through
} else { | [gherkin] Renamed tokens for placeholder and table header | codemirror_CodeMirror | train | js |
daea656fc4bbd84d4370f9db7511627538d1feed | diff --git a/pylint/testutils/global_test_linter.py b/pylint/testutils/global_test_linter.py
index <HASH>..<HASH> 100644
--- a/pylint/testutils/global_test_linter.py
+++ b/pylint/testutils/global_test_linter.py
@@ -7,7 +7,7 @@ from pylint.lint import PyLinter
from pylint.testutils.reporter_for_tests import GenericTestReporter
-def create_test_linter():
+def create_test_linter() -> PyLinter:
test_reporter = GenericTestReporter()
linter_ = PyLinter()
linter_.set_reporter(test_reporter) | Finish typing of ``pylint/testutils/global_test_linter.py`` | PyCQA_pylint | train | py |
03cf1f05842f4f7fbbe3ad53dbee48c83ede3615 | diff --git a/src/js/core/scrollspy.js b/src/js/core/scrollspy.js
index <HASH>..<HASH> 100644
--- a/src/js/core/scrollspy.js
+++ b/src/js/core/scrollspy.js
@@ -128,6 +128,10 @@ export default {
toggle(el, inview) {
const state = this._data.elements.get(el);
+ if (!state) {
+ return;
+ }
+
state.off?.();
css(el, 'visibility', !inview && this.hidden ? 'hidden' : ''); | fix: case where component resets while toggle is enqueued | uikit_uikit | train | js |
5bae8ffe6c5bbd99f18299e9b76446736a500666 | diff --git a/core/src/main/java/com/google/bitcoin/core/PeerGroup.java b/core/src/main/java/com/google/bitcoin/core/PeerGroup.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/google/bitcoin/core/PeerGroup.java
+++ b/core/src/main/java/com/google/bitcoin/core/PeerGroup.java
@@ -211,12 +211,12 @@ public class PeerGroup {
}
/** The maximum number of connections that we will create to peers. */
- public void setMaxConnections(int maxConnections) {
+ public synchronized void setMaxConnections(int maxConnections) {
this.maxConnections = maxConnections;
}
/** The maximum number of connections that we will create to peers. */
- public int getMaxConnections() {
+ public synchronized int getMaxConnections() {
return maxConnections;
} | Make PeerGroup.maxConnections fully synchronized. | bitcoinj_bitcoinj | train | java |
34233e26ecf19994daade2c5b032cb53fd94ed55 | diff --git a/grace/lint.py b/grace/lint.py
index <HASH>..<HASH> 100644
--- a/grace/lint.py
+++ b/grace/lint.py
@@ -171,9 +171,10 @@ if (lint.warnings.length > 0) {
if os.path.exists(os.path.join(self._cwd, 'src', 'javascript')):
for dirname, subdirs, files in os.walk(os.path.join('src', 'javascript')):
for filename in files:
- valid = self._lint_file(os.path.join(dirname, filename))
- if not valid:
- self.lint_valid = False
+ if os.path.splitext(filename)[1] == '.js':
+ valid = self._lint_file(os.path.join(dirname, filename))
+ if not valid:
+ self.lint_valid = False
def _lint_file(self, jsfile):
if 'jslint' in self._options: | Bugfix
* only lint .js files and no other files in the directories | mdiener_grace | train | py |
8c9b5e413ff9bab8607377223dd42a0ff4375405 | diff --git a/activerecord/lib/active_record/locking/optimistic.rb b/activerecord/lib/active_record/locking/optimistic.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/locking/optimistic.rb
+++ b/activerecord/lib/active_record/locking/optimistic.rb
@@ -87,11 +87,13 @@ module ActiveRecord
begin
relation = self.class.unscoped
- affected_rows = relation.where(
+ stmt = relation.where(
relation.table[self.class.primary_key].eq(quoted_id).and(
relation.table[lock_col].eq(quote_value(previous_value))
)
- ).arel.update(arel_attributes_values(false, false, attribute_names))
+ ).arel.compile_update(arel_attributes_values(false, false, attribute_names))
+
+ affected_rows = connection.update stmt.to_sql
unless affected_rows == 1
raise ActiveRecord::StaleObjectError, "Attempted to update a stale object: #{self.class.name}" | removing more calls to deprecated methods | rails_rails | train | rb |
d316fac5a10af035a9b79d25a2609b3581df2ee2 | diff --git a/src/android/io/github/pwlin/cordova/plugins/fileopener2/FileOpener2.java b/src/android/io/github/pwlin/cordova/plugins/fileopener2/FileOpener2.java
index <HASH>..<HASH> 100644
--- a/src/android/io/github/pwlin/cordova/plugins/fileopener2/FileOpener2.java
+++ b/src/android/io/github/pwlin/cordova/plugins/fileopener2/FileOpener2.java
@@ -98,7 +98,7 @@ public class FileOpener2 extends CordovaPlugin {
try {
Uri path = Uri.fromFile(file);
Intent intent = new Intent(Intent.ACTION_VIEW);
- if(Build.VERSION.SDK_INT >= 23){
+ if(Build.VERSION.SDK_INT >= 23 && !(contentType.equals("application/vnd.android.package-archive") && Build.VERSION.SDK_INT == 24)){
Context context = cordova.getActivity().getApplicationContext();
path = FileProvider.getUriForFile(context, cordova.getActivity().getPackageName() + ".opener.provider", file); | Fix for APK install on Android <I>
Added an exception to handle APKs differently if the android version is 6 | pwlin_cordova-plugin-file-opener2 | train | java |
ca24cefaadbeda73f8706d2f1aaf562160245825 | diff --git a/packages/ringcentral-widgets/components/CallIcon/index.js b/packages/ringcentral-widgets/components/CallIcon/index.js
index <HASH>..<HASH> 100644
--- a/packages/ringcentral-widgets/components/CallIcon/index.js
+++ b/packages/ringcentral-widgets/components/CallIcon/index.js
@@ -36,17 +36,14 @@ function CallIcon({
} else {
symbol = (
<div className={styles.callIcon}>
- {isOnConferenceCall
- ? <ConferenceCallIcon />
- : <span
- className={classnames(
- callIconMap[direction],
- styles.activeCall,
- ringing && styles.ringing,
- )}
- title={title}
- />
- }
+ <span
+ className={classnames(
+ callIconMap[direction],
+ styles.activeCall,
+ ringing && styles.ringing,
+ )}
+ title={title}
+ />
</div>
);
} | Remove redundant code from CallIcon (#<I>) | ringcentral_ringcentral-js-widgets | train | js |
3592fc22320f942886f96d384db2997bac5b4879 | diff --git a/src/modules/cell.js b/src/modules/cell.js
index <HASH>..<HASH> 100644
--- a/src/modules/cell.js
+++ b/src/modules/cell.js
@@ -186,6 +186,7 @@ import { jsPDF } from "../jspdf.js";
var amountOfLines = 0;
var height = 0;
var tempWidth = 0;
+ var scope = this;
if (!Array.isArray(text) && typeof text !== "string") {
if (typeof text === "number") { | fix: scope is not defined in getTextDimensions (#<I>) | MrRio_jsPDF | train | js |
f556ab194d1a1ad39c4847f9148cf4aa632bcf60 | diff --git a/pax-web-jetty/src/main/java/org/ops4j/pax/web/service/jetty/internal/JettyServerHandlerCollection.java b/pax-web-jetty/src/main/java/org/ops4j/pax/web/service/jetty/internal/JettyServerHandlerCollection.java
index <HASH>..<HASH> 100644
--- a/pax-web-jetty/src/main/java/org/ops4j/pax/web/service/jetty/internal/JettyServerHandlerCollection.java
+++ b/pax-web-jetty/src/main/java/org/ops4j/pax/web/service/jetty/internal/JettyServerHandlerCollection.java
@@ -23,6 +23,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.io.EofException;
+import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.handler.ContextHandler;
import org.eclipse.jetty.server.handler.HandlerCollection;
@@ -72,6 +73,17 @@ class JettyServerHandlerCollection
try
{
context.handle( target, baseRequest, request, response );
+
+ //now handle all other handlers
+ for (Handler handler : getHandlers()) {
+ if (handler == context) {
+ continue;
+ }
+
+ handler.handle(target, baseRequest, request, response);
+ }
+
+
}
catch( EofException e )
{ | [PAXWEB-<I>] - Request log file is not populated
----
this fixes it, the collection should call all other handlers registered | ops4j_org.ops4j.pax.web | train | java |
560b8efb7995a7de5f784865469c40c9780d4637 | diff --git a/plugin/pkg/admission/noderestriction/admission_test.go b/plugin/pkg/admission/noderestriction/admission_test.go
index <HASH>..<HASH> 100644
--- a/plugin/pkg/admission/noderestriction/admission_test.go
+++ b/plugin/pkg/admission/noderestriction/admission_test.go
@@ -166,9 +166,9 @@ func setAllowedUpdateLabels(node *api.Node, value string) *api.Node {
node.Labels["topology.kubernetes.io/zone"] = value
node.Labels["topology.kubernetes.io/region"] = value
node.Labels["beta.kubernetes.io/instance-type"] = value
+ node.Labels["node.kubernetes.io/instance-type"] = value
node.Labels["beta.kubernetes.io/os"] = value
node.Labels["beta.kubernetes.io/arch"] = value
- node.Labels["kubernetes.io/instance-type"] = value
node.Labels["kubernetes.io/os"] = value
node.Labels["kubernetes.io/arch"] = value | noderestriction: update node restriction unit tests to use stable instance-type label | kubernetes_kubernetes | train | go |
8edb5eeb360779aad7a45a66818fada98a22b1e2 | diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb
index <HASH>..<HASH> 100644
--- a/railties/test/isolation/abstract_unit.rb
+++ b/railties/test/isolation/abstract_unit.rb
@@ -297,6 +297,8 @@ class ActiveSupport::TestCase
include TestHelpers::Rack
include TestHelpers::Generation
+ self.test_order = :sorted
+
private
def capture(stream) | Set test order in ActiveSupport::TestCase of isolation/abstract_unit | rails_rails | train | rb |
60ee800e3fcee4d579ec263144fcda66b7d2824c | diff --git a/packages/openneuro-app/src/scripts/uploader/__tests__/uploader.spec.js b/packages/openneuro-app/src/scripts/uploader/__tests__/uploader.spec.js
index <HASH>..<HASH> 100644
--- a/packages/openneuro-app/src/scripts/uploader/__tests__/uploader.spec.js
+++ b/packages/openneuro-app/src/scripts/uploader/__tests__/uploader.spec.js
@@ -1,3 +1,5 @@
+import React from 'react'
+import { shallow } from 'enzyme'
import { UploadClient } from '../uploader.jsx'
// Stub constructor for File-like objects with webkitRelativePath | App: Linting fixes for uploader test. | OpenNeuroOrg_openneuro | train | js |
0971180cd6a425a3e837ea2582048b419a9a5bda | diff --git a/guacamole-common-js/src/main/resources/guacamole.js b/guacamole-common-js/src/main/resources/guacamole.js
index <HASH>..<HASH> 100644
--- a/guacamole-common-js/src/main/resources/guacamole.js
+++ b/guacamole-common-js/src/main/resources/guacamole.js
@@ -1172,9 +1172,21 @@ Guacamole.Client = function(tunnel) {
* layers composited within.
*/
this.flatten = function() {
+
+ // Get source and destination canvases
+ var source = getLayer(0).getCanvas();
+ var canvas = document.createElement("canvas");
+
+ // Set dimensions
+ canvas.width = source.width;
+ canvas.height = source.height;
+
+ // Copy image from source
+ var context = canvas.getContext("2d");
+ context.drawImage(source, 0, 0);
- // STUB: For now, just return canvas from root layer
- return getLayer(0).getCanvas();
+ // Return new canvas copy
+ return canvas;
}; | Make copy of canvas, rather than simply returning root layer. | glyptodon_guacamole-client | train | js |
5ec8e42a825270c2c7272eb952b05cb945b877b5 | diff --git a/pmag_basic_dialogs.py b/pmag_basic_dialogs.py
index <HASH>..<HASH> 100755
--- a/pmag_basic_dialogs.py
+++ b/pmag_basic_dialogs.py
@@ -565,10 +565,12 @@ class combine_magic_dialog(wx.Frame):
self.Destroy()
def on_okButton(self,event):
+ os.chdir(self.WD) # make sure OS is working in self.WD (Windows issue)
files_text=self.bSizer0.file_paths.GetValue()
files=files_text.strip('\n').replace(" ","")
if files:
files = files.split('\n')
+ files = [os.path.join(self.WD, f) for f in files]
COMMAND="combine_magic.py -F magic_measurements.txt -f %s"%(" ".join(files) )
# to run as module:
diff --git a/version.py b/version.py
index <HASH>..<HASH> 100644
--- a/version.py
+++ b/version.py
@@ -1,2 +1,2 @@
-"pmagpy-3.1.8"
-version = 'pmagpy-3.1.8'
+"pmagpy-3.1.10"
+version = 'pmagpy-3.1.10' | prevent bug with QuickMagic/combine_magic in Windows by providing full path name | PmagPy_PmagPy | train | py,py |
5692a0f0dd767992f86bf6965da775259e02e7c1 | diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java
index <HASH>..<HASH> 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java
@@ -114,4 +114,14 @@ public interface GraphManager {
* from the {@code GraphManager}.
*/
public Graph removeGraph(final String graphName) throws Exception;
+
+ /**
+ * Determines if any {@link Graph} instances that support transactions have open transactions.
+ */
+ public default boolean hasAnyOpenTransactions() {
+ return getGraphNames().stream().anyMatch(graphName -> {
+ final Graph graph = getGraph(graphName);
+ return graph.features().graph().supportsTransactions() && graph.tx().isOpen();
+ });
+ }
} | TINKERPOP-<I> Provide a way to check for open transactions across the GraphManager | apache_tinkerpop | train | java |
c0853b27c48482c749f3f9c183a0b20ccb0714ce | diff --git a/Listener/Resource/FileListener.php b/Listener/Resource/FileListener.php
index <HASH>..<HASH> 100644
--- a/Listener/Resource/FileListener.php
+++ b/Listener/Resource/FileListener.php
@@ -95,7 +95,8 @@ class FileListener implements ContainerAwareInterface
$file = $form->getData();
$tmpFile = $form->get('file')->getData();
$fileName = $tmpFile->getClientOriginalName();
- $mimeType = $tmpFile->getClientMimeType();
+ $ext = $tmpFile->getClientOriginalExtension();
+ $mimeType = $this->container->get('claroline.utilities.mime_type_guesser')->guess($ext);
if (pathinfo($fileName, PATHINFO_EXTENSION) === 'zip' && $form->get('uncompress')->getData()) {
$roots = $this->unzip($tmpFile, $event->getParent()); | File mime type is now guessed from the extension | claroline_CoreBundle | train | php |
f28d101a5aaad70576b5fc59b0cff8cf9818845a | diff --git a/resource/meta.go b/resource/meta.go
index <HASH>..<HASH> 100644
--- a/resource/meta.go
+++ b/resource/meta.go
@@ -367,7 +367,7 @@ func getNestedModel(value interface{}, fieldName string, context *qor.Context) i
for _, field := range fields[:len(fields)-1] {
if model.CanAddr() {
submodel := model.FieldByName(field)
- if key := submodel.FieldByName("Id"); !key.IsValid() || key.Uint() == 0 {
+ if context.GetDB().NewRecord(submodel.Interface()) && !context.GetDB().NewRecord(model.Addr().Interface()) {
if submodel.CanAddr() {
context.GetDB().Model(model.Addr().Interface()).Association(field).Find(submodel.Addr().Interface())
model = submodel | Don't find association if current value is new record | qor_qor | train | go |
e2e0457f34ee6efe799bf1472c309b76f74a2367 | diff --git a/lib/chatwork/version.rb b/lib/chatwork/version.rb
index <HASH>..<HASH> 100644
--- a/lib/chatwork/version.rb
+++ b/lib/chatwork/version.rb
@@ -1,3 +1,3 @@
module ChatWork
- VERSION = "0.1.0"
+ VERSION = "0.1.1"
end | Bump to <I> :beers: | asonas_chatwork-ruby | train | rb |
a5e8c7d6562d971c4d86ae0d14d9d6ade3967d2d | diff --git a/librosa/core/pitch.py b/librosa/core/pitch.py
index <HASH>..<HASH> 100644
--- a/librosa/core/pitch.py
+++ b/librosa/core/pitch.py
@@ -71,7 +71,7 @@ def estimate_tuning(resolution=0.01, bins_per_octave=12, **kwargs):
else:
threshold = 0.0
- return pitch_tuning(pitch[(mag > threshold) & pitch_mask],
+ return pitch_tuning(pitch[(mag >= threshold) & pitch_mask],
resolution=resolution,
bins_per_octave=bins_per_octave) | softened thresholding in tuning estimator | librosa_librosa | train | py |
6db56314885a7ca3917b253f01ca88b7e4c599a6 | diff --git a/tlc-transients.php b/tlc-transients.php
index <HASH>..<HASH> 100644
--- a/tlc-transients.php
+++ b/tlc-transients.php
@@ -96,7 +96,8 @@ if ( !class_exists( 'TLC_Transient' ) ) {
// We set the timeout as part of the transient data.
// The actual transient has a far-future TTL. This allows for soft expiration.
$expiration = ( $this->expiration > 0 ) ? time() + $this->expiration : 0;
- set_transient( 'tlc__' . $this->key, array( $expiration, $data ), $expiration + 31536000 ); // 60*60*24*365 ~= one year
+ $transient_expiration = ( $this->expiration > 0 ) ? $this->expiration + 31536000 : 0; // 31536000 = 60*60*24*365 ~= one year
+ set_transient( 'tlc__' . $this->key, array( $expiration, $data ), $transient_expiration );
return $this;
} | Update tlc-transients.php
fix: set_transient takes an expiration time, not a date in the future. Use value based on $this->expiration instead of value based on time()+$this->expiration | markjaquith_WP-TLC-Transients | train | php |
9fdc87dfc1d0baf8d1e2ededebbb9c593fed2544 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -97,7 +97,7 @@ for accessing Google's Cloud Platform services such as Google BigQuery.
'pyyaml==3.11',
'requests==2.9.1',
'scikit-learn==0.17.1',
- 'ipykernel==4.4.1',
+ 'ipykernel==4.5.2',
'psutil==4.3.0',
'jsonschema==2.6.0',
], | Update ipykernel dependecy version (#<I>)
The only clear dependency is that IPython is defined. | googledatalab_pydatalab | train | py |
d2605ec1677d02a9e43c29441cc47490b76d2d96 | diff --git a/Framework/Component/DomEl.php b/Framework/Component/DomEl.php
index <HASH>..<HASH> 100644
--- a/Framework/Component/DomEl.php
+++ b/Framework/Component/DomEl.php
@@ -499,7 +499,7 @@ public function __call($name, $args = array()) {
return $result;
}
else {
- return false;
+ throw new HttpError(500, __CLASS__ . "::$name method doesn't exist");
}
} | Changed DomEl to issue an error when an invalid method is called instead of eating it | PhpGt_WebEngine | train | php |
48c37eeff2ee8ae1a52740b62c0fdef80e529ef7 | diff --git a/tests/testx509.py b/tests/testx509.py
index <HASH>..<HASH> 100644
--- a/tests/testx509.py
+++ b/tests/testx509.py
@@ -6,6 +6,7 @@ from ctypescrypto.oid import Oid
from tempfile import NamedTemporaryFile
import datetime
import unittest
+import os
@@ -244,13 +245,14 @@ zVMSW4SOwg/H7ZMZ2cn6j1g0djIvruFQFGHUqFijyDATI+/GJYw2jxyA
c2=X509(self.digicert_cert)
self.assertTrue(c2.verify(store))
def test_verify_by_filestore(self):
- trusted=NamedTemporaryFile()
+ trusted=NamedTemporaryFile(delete=False)
trusted.write(self.ca_cert)
- trusted.flush()
+ trusted.close()
goodcert=X509(self.cert1)
badcert=X509(self.cert1[0:-30]+"GG"+self.cert1[-28:])
gitcert=X509(self.digicert_cert)
store=X509Store(file=trusted.name)
+ os.unlink(trusted.name)
# We should successfuly verify certificate signed by our CA cert
self.assertTrue(goodcert.verify(store))
# We should reject corrupted certificate | Fixed usage of named temporary file in tests, tests should run on Windows | vbwagner_ctypescrypto | train | py |
d73fc6724f02d8a011094fed495c0410be203c2f | diff --git a/src/Phinx/Db/Adapter/SQLiteAdapter.php b/src/Phinx/Db/Adapter/SQLiteAdapter.php
index <HASH>..<HASH> 100644
--- a/src/Phinx/Db/Adapter/SQLiteAdapter.php
+++ b/src/Phinx/Db/Adapter/SQLiteAdapter.php
@@ -159,7 +159,7 @@ class SQLiteAdapter extends PdoAdapter
throw new RuntimeException('SQLite URI support requires PHP 8.1.');
} elseif ((!empty($options['mode']) || !empty($options['cache'])) && !empty($options['memory'])) {
throw new RuntimeException('Memory must not be set when cache or mode are.');
- } elseif (PHP_VERSION_ID >= 80100) {
+ } elseif (PHP_VERSION_ID >= 80100 && (!empty($options['mode']) || !empty($options['cache']))) {
$params = [];
if (!empty($options['cache'])) {
$params[] = 'cache=' . $options['cache']; | do not force into using uri scheme if no params are set | cakephp_phinx | train | php |
dd38f36c55f31e1cf09e8b83cac7cf72c6f7ef8b | diff --git a/spec/lib/nsq/producer_spec.rb b/spec/lib/nsq/producer_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/nsq/producer_spec.rb
+++ b/spec/lib/nsq/producer_spec.rb
@@ -37,13 +37,9 @@ describe Nsq::Producer do
end
describe '#connected?' do
- it 'should return true if nsqd is up and false if it\'s down' do
- set_speedy_connection_timeouts!
- wait_for{@producer.connected?}
- expect(@producer.connected?).to eq(true)
- @nsqd.stop
- wait_for{!@producer.connected?}
- expect(@producer.connected?).to eq(false)
+ it 'should delegate to Connection#connected?' do
+ connection = @producer.instance_variable_get(:@connection)
+ expect(@producer.connected?).to eq(connection.connected?)
end
end | Don\'t need as intensive an integration test for Producer#connected\? since that\'s tested in connection_spec | wistia_nsq-ruby | train | rb |
296fda11f2ff48fafa1809e86a7bc007926c103e | diff --git a/Library/Optimizers/FunctionCall/ExitOptimizer.php b/Library/Optimizers/FunctionCall/ExitOptimizer.php
index <HASH>..<HASH> 100644
--- a/Library/Optimizers/FunctionCall/ExitOptimizer.php
+++ b/Library/Optimizers/FunctionCall/ExitOptimizer.php
@@ -49,11 +49,12 @@ class ExitOptimizer extends OptimizerAbstract
if (isset($expression['parameters'])) {
//TODO: protect resolvedParams[0] from restore
}
- $context->codePrinter->output('ZEPHIR_MM_RESTORE();');
if (!isset($expression['parameters'])) {
+ $context->codePrinter->output('ZEPHIR_MM_RESTORE();');
$context->codePrinter->output('zephir_exit_empty();');
} else {
$resolvedParams = $call->getReadOnlyResolvedParams($expression['parameters'], $context, $expression);
+ $context->codePrinter->output('ZEPHIR_MM_RESTORE();');
$context->codePrinter->output('zephir_exit(' . $resolvedParams[0] .');');
}
return new CompiledExpression('void ', '', $expression); | ZEPHIR_MM_RESTORE() should be called right before zephir_exit()
Fix #<I> | phalcon_zephir | train | php |
ed07faf4ca011fa8e86a0afe3eac041c1778eebb | diff --git a/article.py b/article.py
index <HASH>..<HASH> 100644
--- a/article.py
+++ b/article.py
@@ -121,7 +121,7 @@ class Article(object):
return(titlestring)
def fetchPLoSImages(self, cache_dir, output_dir, caching):
- '''Fetch the images associated with the article.'''
+ '''Fetch the PLoS images associated with the article.'''
import urllib2
import logging
import os.path
@@ -211,6 +211,10 @@ class Article(object):
os.mkdir(art_cache)
shutil.copytree(img_dir, art_cache_images)
+ def fetchFrontiersImages(self, cache_dir, output_dir, caching):
+ '''Fetch the Frontiers images associated with the article.'''
+ pass
+
class Front(object):
'''The metadata for an article, such as the name and issue of the journal
in which the article appears and the author(s) of the article''' | Declaring new provisonal fetchImages method for Frontiers, it may or may not be necessary in the near future. | SavinaRoja_OpenAccess_EPUB | train | py |
439bd6c127248f312e90722fc4a713d5ac78e32e | diff --git a/nephele/nephele-common/src/main/java/eu/stratosphere/nephele/io/RecordReader.java b/nephele/nephele-common/src/main/java/eu/stratosphere/nephele/io/RecordReader.java
index <HASH>..<HASH> 100644
--- a/nephele/nephele-common/src/main/java/eu/stratosphere/nephele/io/RecordReader.java
+++ b/nephele/nephele-common/src/main/java/eu/stratosphere/nephele/io/RecordReader.java
@@ -30,7 +30,7 @@ import eu.stratosphere.nephele.types.Record;
* the type of the record that can be read from this record reader
*/
-public final class RecordReader<T extends Record> extends AbstractRecordReader<T> implements Reader<T> {
+public class RecordReader<T extends Record> extends AbstractRecordReader<T> implements Reader<T> {
/**
* Temporarily stores an exception which may have occurred while reading data from the input gate. | Removed final modifier again to fix problem with PowerMock tests
Removed final modifier again to fix problem with PowerMock tests | apache_flink | train | java |
264b66c5d5e104613cc1cfd553158adef39dfdbe | diff --git a/run_tests.py b/run_tests.py
index <HASH>..<HASH> 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
import os
+import sys
import unittest
@@ -9,4 +10,5 @@ if __name__ == '__main__':
loader = unittest.TestLoader()
tests = loader.discover(os.path.abspath(os.path.join(dirname, 'tests')))
runner = unittest.runner.TextTestRunner()
- runner.run(tests)
+ result = runner.run(tests)
+ sys.exit(not result.wasSuccessful()) | don't exit with 0 if tests failed | DemocracyClub_uk-election-ids | train | py |
ebcaaa60f6be41137280290e8a5cc994ffe62560 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -22,7 +22,7 @@ elif sys.platform.startswith('darwin'):
module = Extension('fitz._fitz', # name of the module
['fitz/fitz_wrap.c'], # C source file
# this are directories containing mupdf's and zlib's header files
- include_dirs=['/usr/local/include/mupdf', '/usr/local/thirdparty/zlib'],
+ include_dirs=['/usr/local/include/mupdf', '/usr/local/include'],
# libraries should already be linked here by brew
library_dirs=['/usr/local/lib'],
#library_dirs=['/usr/local/Cellar/mupdf-tools/1.8/lib/', | update setup.py for macOS | pymupdf_PyMuPDF | train | py |
1ab4c0bf1c16f90d8ff4f461ef07dd7b86a4c983 | diff --git a/app/Controller/PageController.php b/app/Controller/PageController.php
index <HASH>..<HASH> 100644
--- a/app/Controller/PageController.php
+++ b/app/Controller/PageController.php
@@ -127,8 +127,8 @@ class PageController extends BaseController {
Theme::theme()->footerContainerPopupWindow() .
'<!--[if lt IE 9]><script src="' . WT_JQUERY_JS_URL . '"></script><![endif]-->' .
'<!--[if gte IE 9]><!--><script src="' . WT_JQUERY2_JS_URL . '"></script><!--<![endif]-->' .
- '<script src="' . WT_JQUERYUI_JS_URL . '">"</script>' .
- '<script src="' . WT_WEBTREES_JS_URL . '">"</script>' .
+ '<script src="' . WT_JQUERYUI_JS_URL . '"></script>' .
+ '<script src="' . WT_WEBTREES_JS_URL . '"></script>' .
$this->getJavascript() .
Theme::theme()->hookFooterExtraJavascript() .
(WT_DEBUG_SQL ? Database::getQueryLog() : '') . | Remove rogue quote (#<I>) | fisharebest_webtrees | train | php |
b8def7687b78f4898ff0cc2bcddd6fafe74ff9aa | diff --git a/atomicpuppy/__init__.py b/atomicpuppy/__init__.py
index <HASH>..<HASH> 100644
--- a/atomicpuppy/__init__.py
+++ b/atomicpuppy/__init__.py
@@ -6,9 +6,18 @@ from .atomicpuppy import (
EventPublisher,
EventStoreJsonEncoder,
SubscriptionInfoStore,
- RedisCounter
+ RedisCounter,
+ Counter
+)
+from .errors import (
+ FatalError,
+ UrlError,
+ HttpClientError,
+ HttpNotFoundError,
+ HttpServerError,
+ StreamNotFoundError,
+ RejectedMessageException
)
-from .errors import *
import asyncio
@@ -89,3 +98,21 @@ class AtomicPuppy:
for s in self.readers:
s.stop()
self._messageProcessor.stop()
+
+
+__all__ = [
+ AtomicPuppy,
+ Counter,
+ Event,
+ EventFinder,
+ EventPublisher,
+ EventStoreJsonEncoder,
+ FatalError,
+ HttpClientError,
+ HttpNotFoundError,
+ HttpServerError,
+ RedisCounter,
+ RejectedMessageException,
+ StreamNotFoundError,
+ UrlError,
+] | Add an __all__ to explicitly say what's public | madedotcom_atomicpuppy | train | py |
d99ae0fd314be0d00ef3a622270a3d5b3183f559 | diff --git a/python/orca/src/bigdl/orca/inference/inference_model.py b/python/orca/src/bigdl/orca/inference/inference_model.py
index <HASH>..<HASH> 100644
--- a/python/orca/src/bigdl/orca/inference/inference_model.py
+++ b/python/orca/src/bigdl/orca/inference/inference_model.py
@@ -77,6 +77,17 @@ class InferenceModel(JavaValue):
callZooFunc(self.bigdl_type, "inferenceModelLoadOpenVINO",
self.value, model_path, weight_path, batch_size)
+ def load_openvino_ng(self, model_path, weight_path, batch_size=0):
+ """
+ Load an OpenVINI IR.
+
+ :param model_path: String. The file path to the OpenVINO IR xml file.
+ :param weight_path: String. The file path to the OpenVINO IR bin file.
+ :param batch_size: Int. Set batch Size, default is 0 (use default batch size).
+ """
+ callZooFunc(self.bigdl_type, "inferenceModelLoadOpenVINONg",
+ self.value, model_path, weight_path, batch_size)
+
def load_tensorflow(self, model_path, model_type="frozenModel", intra_op_parallelism_threads=1,
inter_op_parallelism_threads=1, use_per_session_threads=True):
""" | Orca openvino estimator fix (#<I>)
* fix openvino estimator
* delete useless | intel-analytics_BigDL | train | py |
76b008c22b53f8e24a165a02bbb284e31d9360b3 | diff --git a/src/main/java/org/red5/proxy/StreamState.java b/src/main/java/org/red5/proxy/StreamState.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/red5/proxy/StreamState.java
+++ b/src/main/java/org/red5/proxy/StreamState.java
@@ -20,6 +20,6 @@ package org.red5.proxy;
public enum StreamState {
- STOPPED, CONNECTING, STREAM_CREATING, PUBLISHING, PUBLISHED, UNPUBLISHED;
+ UNINITIALIZED, STOPPED, CONNECTING, STREAM_CREATING, PUBLISHING, PUBLISHED, UNPUBLISHED;
} | Added UNINITIALIZED state | Red5_red5-client | train | java |
6e995feb5ef5d660aff08692fb05c4b9b703c18c | diff --git a/builtin/providers/aws/resources.go b/builtin/providers/aws/resources.go
index <HASH>..<HASH> 100644
--- a/builtin/providers/aws/resources.go
+++ b/builtin/providers/aws/resources.go
@@ -145,6 +145,11 @@ func resource_aws_instance_refresh(
return s, err
}
+ // If nothing was found, then return no state
+ if len(resp.Reservations) == 0 {
+ return nil, nil
+ }
+
instance := &resp.Reservations[0].Instances[0]
// If the instance is terminated, then it is gone
diff --git a/terraform/terraform.go b/terraform/terraform.go
index <HASH>..<HASH> 100644
--- a/terraform/terraform.go
+++ b/terraform/terraform.go
@@ -132,6 +132,9 @@ func (t *Terraform) refreshWalkFn(result *State) depgraph.WalkFunc {
if err != nil {
return nil, err
}
+ if rs == nil {
+ rs = new(ResourceState)
+ }
// Fix the type to be the type we have
rs.Type = r.State.Type | providers/aws: if no reservations, no instance | hashicorp_terraform | train | go,go |
cf58ba438043d85b9a15b190bc3e1b602b1fecc8 | diff --git a/service/dap/server_test.go b/service/dap/server_test.go
index <HASH>..<HASH> 100644
--- a/service/dap/server_test.go
+++ b/service/dap/server_test.go
@@ -747,7 +747,11 @@ func checkVar(t *testing.T, got *dap.VariablesResponse, i int, name, evalName, v
goti := got.Body.Variables[i]
matchedName := false
if useExactMatch {
- matchedName = (goti.Name == name)
+ if strings.HasPrefix(name, "~r") {
+ matchedName = strings.HasPrefix(goti.Name, "~r")
+ } else {
+ matchedName = (goti.Name == name)
+ }
} else {
matchedName, _ = regexp.MatchString(name, goti.Name)
} | tests: miscellaneus test fixes for Go <I> | go-delve_delve | train | go |
4a805efba6805c40d7bfe51e628545f27ca3d048 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -53,7 +53,7 @@ var Wrap = require('./wrap');
*/
// Public {{{1
-exports.app = function(mod, name) { // {{{2
+exports.app = function(mod, name, scope) { // {{{2
/**
* Create a module wrap instance for an application
*
@@ -68,7 +68,7 @@ exports.app = function(mod, name) { // {{{2
var res = new Wrap(mod);
res.package = name;
- res.scope = name;
+ res.scope = scope || name;
return res;
}; | Minor: O.app accepts scope now | OpenSmartEnvironment_ose | train | js |
b973322ca396595b8c8ffce38b20d91e99997ee1 | diff --git a/lib/fauxhai/mocker.rb b/lib/fauxhai/mocker.rb
index <HASH>..<HASH> 100644
--- a/lib/fauxhai/mocker.rb
+++ b/lib/fauxhai/mocker.rb
@@ -31,15 +31,6 @@ module Fauxhai
@data = fauxhai_data
yield(@data) if block_given?
- if defined?(::ChefSpec) && ::ChefSpec::VERSION <= '0.9.0'
- data = @data
- ::ChefSpec::ChefRunner.send :define_method, :fake_ohai do |ohai|
- data.each_pair do |attribute, value|
- ohai[attribute] = value
- end
- end
- end
-
@data
end | Remove code checking on a 5 year old release of Chefspec
It’s time | chefspec_fauxhai | train | rb |
7db453081a0e33a1056f66c9862190eced2b34ad | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -116,7 +116,7 @@ StandardValidationFilter.prototype.processString = function (content, relativePa
messages: report.results[0].messages
})
- report.results[0].filePath = path.join(this.node, relativePath)
+ report.results[0].filePath = typeof this.node === 'string' ? path.join(this.node, relativePath) : relativePath
if (process.env.test === 'true' && ( !report.results[0].messages.length || this.internalOptions.format)) {
this.console.log(path.join(this.node, relativePath)) | Dont assume node is a string | arschmitz_broccoli-standard | train | js |
09b963a3d514089daa08e8e31f0340446cb4635e | diff --git a/openquake/hazardlib/calc/filters.py b/openquake/hazardlib/calc/filters.py
index <HASH>..<HASH> 100644
--- a/openquake/hazardlib/calc/filters.py
+++ b/openquake/hazardlib/calc/filters.py
@@ -224,6 +224,9 @@ class SourceFilter(object):
@property
def sitecol(self):
+ """
+ Read the site collection from .hdf5path and cache it
+ """
if 'sitecol' in vars(self):
return self.__dict__['sitecol']
with hdf5.File(self.hdf5path, 'r') as h5: | Added a docstring [skip CI] | gem_oq-engine | train | py |
60db56a93243e29cbf0f16cecc972a98dca8b4d7 | diff --git a/test/rubocop/metaprogramming_positional_arguments_test.rb b/test/rubocop/metaprogramming_positional_arguments_test.rb
index <HASH>..<HASH> 100644
--- a/test/rubocop/metaprogramming_positional_arguments_test.rb
+++ b/test/rubocop/metaprogramming_positional_arguments_test.rb
@@ -38,6 +38,12 @@ module Rubocop
assert_offense("ClassName.statsd_measure(:method, 'metric', 1)")
assert_offense("ClassName.statsd_measure(:method, 'metric', 1, ['tag'])")
assert_offense("ClassName.statsd_measure(:method, 'metric', 1, tag: 'value')")
+ assert_offense(<<~RUBY)
+ class Foo
+ extend StatsD::Instrument
+ statsd_measure(:method, 'metric', 1)
+ end
+ RUBY
end
def test_offense_with_splat | Add test for meta programming method offense on an open class. | Shopify_statsd-instrument | train | rb |
59b215fe0945dcaa2410938375c5fab601d0366e | diff --git a/lnrpc/routerrpc/router_backend.go b/lnrpc/routerrpc/router_backend.go
index <HASH>..<HASH> 100644
--- a/lnrpc/routerrpc/router_backend.go
+++ b/lnrpc/routerrpc/router_backend.go
@@ -661,11 +661,11 @@ func (r *RouterBackend) extractIntentFromSendRequest(
"cannot appear together")
case len(rpcPayReq.PaymentHash) > 0:
- return nil, errors.New("dest and payment_hash " +
+ return nil, errors.New("payment_hash and payment_request " +
"cannot appear together")
case rpcPayReq.FinalCltvDelta != 0:
- return nil, errors.New("dest and final_cltv_delta " +
+ return nil, errors.New("final_cltv_delta and payment_request " +
"cannot appear together")
} | routerrpc: fix wrong error messages
when payment_hash or final_cltv_delta and payment_request was set, the error message showed that the parameters shouldn't be set with dest instead of payment_request
[skip ci] | lightningnetwork_lnd | train | go |
55af8f937905b1357cfd9fda81b51309dc07b845 | diff --git a/vnfm-sdk/src/main/java/org/project/openbaton/common/vnfm_sdk/AbstractVnfm.java b/vnfm-sdk/src/main/java/org/project/openbaton/common/vnfm_sdk/AbstractVnfm.java
index <HASH>..<HASH> 100644
--- a/vnfm-sdk/src/main/java/org/project/openbaton/common/vnfm_sdk/AbstractVnfm.java
+++ b/vnfm-sdk/src/main/java/org/project/openbaton/common/vnfm_sdk/AbstractVnfm.java
@@ -159,14 +159,6 @@ public abstract class AbstractVnfm implements VNFLifecycleManagement, VNFLifecyc
virtualNetworkFunctionRecord = instantiate(virtualNetworkFunctionRecord, orVnfmInstantiateMessage.getScripts());
nfvMessage = VnfmUtils.getNfvMessage(Action.INSTANTIATE, virtualNetworkFunctionRecord);
break;
- case SCALE_IN_FINISHED:
- break;
- case SCALE_OUT_FINISHED:
- break;
- case SCALE_UP_FINISHED:
- break;
- case SCALE_DOWN_FINISHED:
- break;
case RELEASE_RESOURCES_FINISH:
break;
case INSTANTIATE_FINISH: | removed Actions from AbstractVNFM | openbaton_openbaton-client | train | java |
e9cc9bf2dc5ae17c9a0d8d64411158875b034712 | diff --git a/src/metadata.js b/src/metadata.js
index <HASH>..<HASH> 100644
--- a/src/metadata.js
+++ b/src/metadata.js
@@ -48,19 +48,12 @@ function Metadata() {
this._internal_repr = {};
}
-function downcaseString(str) {
- var capitals = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
- var lowercase = 'abcdefghijklmnopqrstuvwxyz';
- var charMap = _.zipObject(capitals, lowercase);
- return str.replace(/[A-Z]/g, _.curry(_.get)(charMap));
-}
-
function normalizeKey(key) {
if (!(/^[A-Za-z\d-]+$/.test(key))) {
throw new Error('Metadata keys must be nonempty strings containing only ' +
'alphanumeric characters and hyphens');
}
- return downcaseString(key);
+ return key.toLowerCase();
}
function validate(key, value) { | Reversed toLowerCase removal | grpc_grpc-node | train | js |
ddc50581e666caa2093deb971bdd85ab59da7c7f | diff --git a/libgenapi/__init__.py b/libgenapi/__init__.py
index <HASH>..<HASH> 100644
--- a/libgenapi/__init__.py
+++ b/libgenapi/__init__.py
@@ -1,2 +1,2 @@
-from libgenapi.libgenapi import Libgenapi
+from .libgenapi import Libgenapi
__version__ = '1.0.7' | Solved issues importing on different python versions (2 & 3) | mmarquezs_libgen-python-api | train | py |
ac6b9b0bb5c09ec82029384cabccffdedd9d3322 | diff --git a/gwpy/timeseries/core.py b/gwpy/timeseries/core.py
index <HASH>..<HASH> 100644
--- a/gwpy/timeseries/core.py
+++ b/gwpy/timeseries/core.py
@@ -1095,6 +1095,7 @@ class TimeSeries(Series):
nsamp = int(self.shape[0] * self.dx.value * rate)
new = signal.resample(self.value, nsamp,
window=window).view(self.__class__)
+ new.__dict__ = self.__dict__.copy()
new.sample_rate = rate
return new
@@ -1495,6 +1496,7 @@ class TimeSeries(Series):
if isinstance(pad_width, int):
pad_width = (pad_width,)
new = numpy.pad(self.value, pad_width, **kwargs).view(self.__class__)
+ new.__dict__ = self.__dict__.copy()
new.epoch = self.epoch.gps - self.dt.value * pad_width[0]
return new | TimeSeries: need to copy __dict__ after view() | gwpy_gwpy | train | py |
bef8df48704dbf4dc12996477277cdae50c83f94 | diff --git a/pymc3/examples/disaster_model_arbitrary_deterministic.py b/pymc3/examples/disaster_model_arbitrary_deterministic.py
index <HASH>..<HASH> 100644
--- a/pymc3/examples/disaster_model_arbitrary_deterministic.py
+++ b/pymc3/examples/disaster_model_arbitrary_deterministic.py
@@ -7,6 +7,7 @@ Note that gradient based samplers will not work.
from pymc3 import *
import theano.tensor as tt
+from theano import as_op
from numpy import arange, array, empty
__all__ = ['disasters_data', 'switchpoint', 'early_mean', 'late_mean', 'rate',
@@ -25,7 +26,7 @@ years = len(disasters_data)
# here is the trick
-@theano.compile.ops.as_op(itypes=[tt.lscalar, tt.dscalar, tt.dscalar], otypes=[tt.dvector])
+@as_op(itypes=[tt.lscalar, tt.dscalar, tt.dscalar], otypes=[tt.dvector])
def rateFunc(switchpoint, early_mean, late_mean):
''' Concatenate Poisson means '''
out = empty(years) | Fixed import error in disaster_model_arbitrary_deterministic | pymc-devs_pymc | train | py |
b43f79b98011f79cb5e39554ad3e5e9bd5312498 | diff --git a/query/stdlib/testing/end_to_end_test.go b/query/stdlib/testing/end_to_end_test.go
index <HASH>..<HASH> 100644
--- a/query/stdlib/testing/end_to_end_test.go
+++ b/query/stdlib/testing/end_to_end_test.go
@@ -190,6 +190,16 @@ func testFlux(t testing.TB, l *launcher.TestLauncher, file *ast.File) {
// this time we use a call to `run` so that the assertion error is triggered
runCalls := stdlib.TestingRunCalls(pkg)
pkg.Files[len(pkg.Files)-1] = runCalls
+
+ bs, err = json.Marshal(pkg)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ req = &query.Request{
+ OrganizationID: l.Org.ID,
+ Compiler: lang.ASTCompiler{AST: bs},
+ }
r, err := l.FluxQueryService().Query(ctx, req)
if err != nil {
t.Fatal(err) | fix: need to rebuild the query request before the second e2e test run (#<I>)
The e2e test driver in influxdb runs the tests twice to get past the fact that there
is no way to force order between the write to storage and the read back. When
the json.Marshal call became mandatory it was added to the first run, but not
the second. | influxdata_influxdb | train | go |
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.