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
0c4a45b1f427f30d37169191ffdcbe9768866bff
diff --git a/install/prebuild-ci.js b/install/prebuild-ci.js index <HASH>..<HASH> 100644 --- a/install/prebuild-ci.js +++ b/install/prebuild-ci.js @@ -2,8 +2,8 @@ const { execFileSync } = require('child_process'); -const { prebuild_upload: hasToken, APPVEYOR_REPO_TAG_NAME, TRAVIS_TAG } = process.env; +const { prebuild_upload: hasToken, APPVEYOR_REPO_TAG, TRAVIS_TAG } = process.env; -if (hasToken && (APPVEYOR_REPO_TAG_NAME || TRAVIS_TAG)) { +if (hasToken && (Boolean(APPVEYOR_REPO_TAG) || TRAVIS_TAG)) { execFileSync('prebuild', ['--runtime', 'napi', '--target', '3'], { stdio: 'inherit' }); }
CI: workaround Appveyor ignoring v-prefixed tag names
lovell_sharp
train
js
2bc0d427367839a97406514d71261ab216131c67
diff --git a/unitest-restful.py b/unitest-restful.py index <HASH>..<HASH> 100755 --- a/unitest-restful.py +++ b/unitest-restful.py @@ -91,7 +91,7 @@ class TestGlances(unittest.TestCase): req = requests.get("%s/%s" % (URL, p)) self.assertTrue(req.ok) if p in ('uptime', 'now'): - self.assertIsInstance(req.json(), str) + self.assertIsInstance(req.json(), unicode) elif p in ('fs', 'monitor', 'percpu', 'sensors', 'alert', 'processlist', 'diskio', 'hddtemp', 'batpercent', 'network'): self.assertIsInstance(req.json(), list)
Correct an issue with test_<I>_plugins in Unitest for the Restful API (str instead od unicode)
nicolargo_glances
train
py
92ff7c01bd6f8672b5aa1fd91402f0ed74639969
diff --git a/bika/lims/skins/bika/bika_widgets/recordswidget.js b/bika/lims/skins/bika/bika_widgets/recordswidget.js index <HASH>..<HASH> 100644 --- a/bika/lims/skins/bika/bika_widgets/recordswidget.js +++ b/bika/lims/skins/bika/bika_widgets/recordswidget.js @@ -44,15 +44,11 @@ jQuery(function($){ recordswidget_lookups(); $('[combogrid_options]').live('focus', function(){ - cgo = $(this).attr('combogrid_options'); - if(cgo==''){ - return; - } - // For inputs with combogrids, we want them to clear when focused - $(this).val(''); - // We also want to clear all colModel->subfield completions var options = $.parseJSON($(this).attr('combogrid_options')); if(options != '' && options != undefined && options != null){ + // For inputs with combogrids, we want them to clear when focused + $(this).val(''); + // We also want to clear all colModel->subfield completions var fieldName = $(this).attr('name').split(".")[0]; var key = $(this).attr('name').split(".")[1].split(":")[0]; var colModel = $.parseJSON($(this).attr('combogrid_options')).colModel;
Recordswidget doesn't always need to blank fields on focus
senaite_senaite.core
train
js
cdcfb032ee30521614f05ff96a3a20ed36de8675
diff --git a/build/build-utils.js b/build/build-utils.js index <HASH>..<HASH> 100644 --- a/build/build-utils.js +++ b/build/build-utils.js @@ -169,7 +169,13 @@ function mkdirs(dir) { if (components.length === 0) { throw new Error("mkdirs must be called with at least one path component"); } - let soFar = "."; + let soFar; + if (components[0].length === 0) { + soFar = "/"; + components.shift(); + } else { + soFar = "."; + } for (const c of components) { soFar = path.join(soFar, c); try {
Support absolute paths in mkdirs in build-utils, too
quicktype_quicktype
train
js
672cd68571c6e7745c92f3555eac9b554d627290
diff --git a/inc/metadata/namespace.php b/inc/metadata/namespace.php index <HASH>..<HASH> 100644 --- a/inc/metadata/namespace.php +++ b/inc/metadata/namespace.php @@ -574,8 +574,8 @@ function section_information_to_schema( $section_information, $book_information ]; } - if ( ! isset( $section_information['pb_section_license'] ) ) { - if ( isset( $book_information['pb_book_license'] ) ) { + if ( empty( $section_information['pb_section_license'] ) ) { + if ( ! empty( $book_information['pb_book_license'] ) ) { $section_information['pb_section_license'] = $book_information['pb_book_license']; } else { $section_information['pb_section_license'] = 'all-rights-reserved'; @@ -583,6 +583,11 @@ function section_information_to_schema( $section_information, $book_information } $licensing = new Licensing; + + if ( ! $licensing->isSupportedType( $section_information['pb_section_license'] ) ) { + $section_information['pb_section_license'] = 'all-rights-reserved'; + } + $section_schema['license'] = [ '@type' => 'CreativeWork', 'url' => $licensing->getUrlForLicense( $section_information['pb_section_license'] ),
Handle empty/garbage license values (#<I>) * Handle situations where license has been set to empty string. * Correct garbage license.
pressbooks_pressbooks
train
php
eaaddf8433a72500df08fc8ef657cf37a3c6da13
diff --git a/lib/stream-reader.js b/lib/stream-reader.js index <HASH>..<HASH> 100644 --- a/lib/stream-reader.js +++ b/lib/stream-reader.js @@ -14,7 +14,7 @@ export default class CodeMirrorStreamReader extends StreamReader { * @param {CodeMirror.Pos} [pos] * @param {CodeMirror.Range} [limit] */ - constructor(buffer, pos, limit) { + constructor(editor, pos, limit) { super(); const CodeMirror = editor.constructor; this.editor = editor;
Fixed param name in stream reader constructor
emmetio_codemirror-plugin
train
js
df9ddf9d8dc184be731fcaac75c2988023e7c420
diff --git a/test/dashboard_controller_test.rb b/test/dashboard_controller_test.rb index <HASH>..<HASH> 100644 --- a/test/dashboard_controller_test.rb +++ b/test/dashboard_controller_test.rb @@ -26,7 +26,7 @@ class DashboardControllerTest < ActionDispatch::IntegrationTest get '/rails/db/import' assert_equal 200, status - get '//rails/db/data-table' + get '/rails/db/data-table' assert_equal 200, status end
working on ajax, data-tables, autocomplete
igorkasyanchuk_rails_db
train
rb
677ff2d8b793bc032dca25d449e768c9e212306f
diff --git a/cake/tests/cases/libs/validation.test.php b/cake/tests/cases/libs/validation.test.php index <HASH>..<HASH> 100644 --- a/cake/tests/cases/libs/validation.test.php +++ b/cake/tests/cases/libs/validation.test.php @@ -2201,12 +2201,5 @@ class ValidationTest extends CakeTestCase { $this->assertTrue(Validation::userDefined('333', $validator, 'customValidate')); } - // function testFile() { - // $this->assertTrue(Validation::file(WWW_ROOT . 'img' . DS . 'cake.icon.gif')); - // $this->assertTrue(Validation::file(WWW_ROOT. 'favicon.ico')); - // $this->assertTrue(Validation::file(WWW_ROOT. 'index.php')); - // $this->assertTrue(Validation::file(WWW_ROOT. 'css' . DS . 'cake.generic.css')); - // $this->assertTrue(Validation::file(TEST_CAKE_CORE_INCLUDE_PATH. 'VERSION.txt')); - // } } ?> \ No newline at end of file
Removing outcommented code.
cakephp_cakephp
train
php
3fac13d1d1149c4f7043caccdd5a22bd71da5fdc
diff --git a/lib/veewee/provider/core/box/exec.rb b/lib/veewee/provider/core/box/exec.rb index <HASH>..<HASH> 100644 --- a/lib/veewee/provider/core/box/exec.rb +++ b/lib/veewee/provider/core/box/exec.rb @@ -9,7 +9,7 @@ module Veewee end def winrm_command_string - "knife winrm -m #{self.ip_address}-P #{winrm_options[:port]} -x #{definition.winrm_user}" + + "knife winrm -m #{self.ip_address} -P #{winrm_options[:port]} -x #{definition.winrm_user}" + " -P #{definition.winrm_password} COMMAND" end
I'm not sure if winrm_command_string is used, but it had a typo.
jedi4ever_veewee
train
rb
50146e33a8a7c74cbdff09f6a6c0913d3a268b5e
diff --git a/lambda_decorators.py b/lambda_decorators.py index <HASH>..<HASH> 100644 --- a/lambda_decorators.py +++ b/lambda_decorators.py @@ -265,14 +265,14 @@ def after(func): >>> # to create a reusable decorator >>> @after - ... def teapot(retval): - ... retval['statusCode'] = 418 + ... def gnu_terry_pratchett(retval): + ... retval.setdefault('Headers', {})['X-Clacks-Overhead'] = 'GNU Terry Pratchett' ... return retval - >>> @teapot + >>> @gnu_terry_pratchett ... def handler(event, context): - ... return {} + ... return {'body': ''} >>> handler({}, object()) - {'statusCode': 418} + {'body': '', 'Headers': {'X-Clacks-Overhead': 'GNU Terry Pratchett'}} """ class AfterDecorator(LambdaDecorator): def after(self, retval):
gnu terry pratchet, why not
dschep_lambda-decorators
train
py
888abc2d78036ff2f855839a80c28881273dc365
diff --git a/MAVProxy/modules/mavproxy_arm.py b/MAVProxy/modules/mavproxy_arm.py index <HASH>..<HASH> 100644 --- a/MAVProxy/modules/mavproxy_arm.py +++ b/MAVProxy/modules/mavproxy_arm.py @@ -92,7 +92,21 @@ class ArmModule(mp_module.MPModule): return if args[0] == "throttle": - self.master.arducopter_arm() + p2 = 0 + if len(args) == 2 and args[1] == 'force': + p2 = 2989 + self.master.mav.command_long_send( + self.target_system, # target_system + self.target_component, + mavutil.mavlink.MAV_CMD_COMPONENT_ARM_DISARM, # command + 0, # confirmation + 1, # param1 (1 to indicate arm) + p2, # param2 (all other params meaningless) + 0, # param3 + 0, # param4 + 0, # param5 + 0, # param6 + 0) # param7 return if args[0] == "safetyon":
Understand 'arm throttle force' to force ArduPilot arming
ArduPilot_MAVProxy
train
py
451198c21af872be709326a3898df9a711e89f1d
diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index <HASH>..<HASH> 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -19,6 +19,11 @@ describe LinkedIn::Api do stub_request(:get, "https://api.linkedin.com/v1/people/id=123").to_return(:body => "{}") client.profile(:id => 123).should be_an_instance_of(LinkedIn::Mash) end + + it "should be able to view the picture urls" do + stub_request(:get, "https://api.linkedin.com/v1/people/~/picture-urls::(original)").to_return(:body => "{}") + client.picture_urls.should be_an_instance_of(LinkedIn::Mash) + end it "should be able to view connections" do stub_request(:get, "https://api.linkedin.com/v1/people/~/connections").to_return(:body => "{}")
Add tests for view picture urls
hexgnu_linkedin
train
rb
425b3a1c089df23d7173d11edae20add903beee6
diff --git a/assemblerflow/templates/metaspades.py b/assemblerflow/templates/metaspades.py index <HASH>..<HASH> 100644 --- a/assemblerflow/templates/metaspades.py +++ b/assemblerflow/templates/metaspades.py @@ -208,8 +208,8 @@ def main(sample_id, fastq_pair, max_len, kmer): # Get spades version for output name info = __get_version_spades() - assembly_file = "{}_metaspades{}.fasta".format( - sample_id, info["version"].replace(".", "")) + assembly_file = "{}_metaspades.fasta".format( + sample_id) os.rename("contigs.fasta", assembly_file) logger.info("Setting main assembly file to: {}".format(assembly_file))
metaspades.py: changed outputfile name (missing version - removed due to not being correctly parsed)
assemblerflow_flowcraft
train
py
b9df92924872f6e42e56e27e7825220472dfa62a
diff --git a/runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/AzureEnvironment.java b/runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/AzureEnvironment.java index <HASH>..<HASH> 100644 --- a/runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/AzureEnvironment.java +++ b/runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/AzureEnvironment.java @@ -89,7 +89,7 @@ public final class AzureEnvironment { "https://login.microsoftonline.de/", "https://management.core.cloudapi.de/", true, - "https://management.microsoftazure.de"); + "https://management.microsoftazure.de/"); /** * Gets the base URL of the management service.
ensuring trailing slash for urls
Azure_azure-sdk-for-java
train
java
22b4193d97b9e3fcf054b16e7038b55879c61523
diff --git a/tests/test_etcd3.py b/tests/test_etcd3.py index <HASH>..<HASH> 100644 --- a/tests/test_etcd3.py +++ b/tests/test_etcd3.py @@ -207,6 +207,7 @@ class TestEtcd3(object): etcd.put(key, 'this is a lease', lease=lease) assert lease.keys == [utils.to_bytes(key)] assert etcd.get(key) == b'this is a lease' + assert lease.remaining_ttl <= lease.granted_ttl # wait for the lease to expire time.sleep(lease.granted_ttl + 2)
Make assertion about Lease.remaining_ttl
kragniz_python-etcd3
train
py
d4786a9c3ec02a4b57b51d477f848783688d2897
diff --git a/tests/Components/ORM/Base.php b/tests/Components/ORM/Base.php index <HASH>..<HASH> 100644 --- a/tests/Components/ORM/Base.php +++ b/tests/Components/ORM/Base.php @@ -28,7 +28,7 @@ class Base extends \Parable\Tests\Base protected function skipIfSqliteNotAvailable() { - if (!extension_loaded('sqlite33')) { + if (!extension_loaded('sqlite3')) { $this->markTestSkipped('sqlite3 is not available'); } }
Of course, leaving the debug 'sqlite<I>' check in is a bad idea.
devvoh_parable
train
php
515d9fed2f85851035b4ea56ef0d9e30da303a3e
diff --git a/src/test/java/com/box/sdk/EventStreamTest.java b/src/test/java/com/box/sdk/EventStreamTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/box/sdk/EventStreamTest.java +++ b/src/test/java/com/box/sdk/EventStreamTest.java @@ -57,8 +57,14 @@ public class EventStreamTest { boolean createdEventFound = false; boolean deletedEventFound = false; - while (!createdEventFound || !deletedEventFound) { + int timeouts = 0; + while ( timeouts < 3 && (!createdEventFound || !deletedEventFound)) { BoxEvent event = observedEvents.poll(1, TimeUnit.MINUTES); + if( null == event) { + timeouts++; + System.out.println("Time outs: " + timeouts); + continue; + } BoxResource.Info sourceInfo = event.getSourceInfo(); // Some events may not have sourceInfo if (sourceInfo == null) {
Fix event stream to handle no events in the stream
box_box-java-sdk
train
java
c127b249517ef80c6e02443aea0b8af2fd774ca4
diff --git a/test/unit/api/Users.test.js b/test/unit/api/Users.test.js index <HASH>..<HASH> 100644 --- a/test/unit/api/Users.test.js +++ b/test/unit/api/Users.test.js @@ -11,9 +11,11 @@ module.exports = function (container, assert, sinon) { config = { api_secret: '1234' }; + options = { - stuff: 'stuff' + user: 123 }; + cb = function () { }; @@ -39,6 +41,17 @@ module.exports = function (container, assert, sinon) { availableOptions: ['user', 'user:username'] }, options, config, cb), 'util.executeApiMethod should have been called with the correct arguments'); }); + + it('should handle a string user argument', function () { + users.listPosts({user: 'foo'}, cb); + assert.isTrue(executeApiMethod.calledWithExactly({ + resource: 'users', + name: 'listPosts', + method: 'GET', + requiredOptions: ['api_secret'], + availableOptions: ['user', 'user:username'] + }, {'user:username': 'foo'}, config, cb), 'util.executeApiMethod should have been called with the correct arguments'); + }); }); }; };
Add test for user -> user:username
jmdobry_disqus-node
train
js
fc71ad5191eca99aa034b71059219b1fa562e9e7
diff --git a/libraries/mako/Event.php b/libraries/mako/Event.php index <HASH>..<HASH> 100644 --- a/libraries/mako/Event.php +++ b/libraries/mako/Event.php @@ -44,7 +44,7 @@ class Event //--------------------------------------------- /** - * Adds an event to the queue. + * Adds an event listener to the queue. * * @access public * @param string Event name @@ -57,7 +57,7 @@ class Event } /** - * Returns TRUE if an event is registered and FALSE if not. + * Returns TRUE if an event listener is registered for the event and FALSE if not. * * @access public * @param string Event name @@ -70,6 +70,18 @@ class Event } /** + * Clears all event listeners for an event. + * + * @access public + * @param string Event name + **/ + + public static function clear($name) + { + unset(static::$events[$name]); + } + + /** * Runs all callbacks for an event and returns an array * contaning the return values of each callback. *
It is now possible to clear event listeners for an event.
mako-framework_framework
train
php
02b3966e01bb026f28e7febbd611d3fe50c570b4
diff --git a/lib/plugin.js b/lib/plugin.js index <HASH>..<HASH> 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -216,8 +216,11 @@ class SVGSpritePlugin { beforeHtmlGeneration(compilation) { const itemsBySprite = this.map.groupItemsBySpriteFilename(); + const filenamePrefix = this.rules.publicPath + ? this.rules.publicPath.replace(/^\//, '') + : ''; const sprites = Object.keys(itemsBySprite).reduce((acc, filename) => { - acc[filename] = compilation.assets[filename].source(); + acc[filenamePrefix + filename] = compilation.assets[filenamePrefix + filename].source(); return acc; }, {});
Fix the bug of publicPath Once the publicPath is set and is not equal to / , an error will be report with "TypeError: Cannot read property 'source' of undefined", Because the assets map have not contain the value of publicPath.
kisenka_svg-sprite-loader
train
js
2017fa87d389d8c402a6cbedaa71e4ef5cdc2d4b
diff --git a/comments-bundle/src/Resources/contao/Comments.php b/comments-bundle/src/Resources/contao/Comments.php index <HASH>..<HASH> 100644 --- a/comments-bundle/src/Resources/contao/Comments.php +++ b/comments-bundle/src/Resources/contao/Comments.php @@ -66,8 +66,6 @@ class Comments extends Frontend // Initialize the pagination menu $objPagination = new Pagination($objTotal->count, $objConfig->perPage); - $objPagination->setFormat($strFormat); - $objTemplate->pagination = $objPagination->generate("\n "); } @@ -92,7 +90,6 @@ class Comments extends Frontend } $objPartial = new FrontendTemplate($objConfig->template); - $objPartial->setFormat($strFormat); while ($objComments->next()) { @@ -193,7 +190,6 @@ class Comments extends Frontend $arrField['eval']['required'] = $arrField['eval']['mandatory']; $objWidget = new $strClass($this->prepareForWidget($arrField, $arrField['name'], $arrField['value'])); - $objWidget->setFormat($strFormat); // Validate the widget if ($this->Input->post('FORM_SUBMIT') == $strFormId)
[Comments] Refactoring the new template system so it works without setFormat()
contao_contao
train
php
579e504785396f953126a31c7579fff965fe6dff
diff --git a/Classes/Base.php b/Classes/Base.php index <HASH>..<HASH> 100644 --- a/Classes/Base.php +++ b/Classes/Base.php @@ -148,6 +148,9 @@ class Base $fsm = new \Aimeos\MW\Filesystem\Manager\Standard( $config ); $context->setFilesystemManager( $fsm ); + $mq = new \Aimeos\MW\MQueue\Manager\Standard( $config ); + $context->setMessageQueueManager( $mq ); + $logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager( $context ); $context->setLogger( $logger ); diff --git a/Resources/Private/Config/resource.php b/Resources/Private/Config/resource.php index <HASH>..<HASH> 100644 --- a/Resources/Private/Config/resource.php +++ b/Resources/Private/Config/resource.php @@ -29,4 +29,8 @@ return array( 'basedir' => PATH_site . 'uploads/tx_aimeos/.secure', 'tempdir' => PATH_site . 'typo3temp', ), + 'mq' => array( + 'adapter' => 'Standard', + 'db' => 'db', + ), );
Added message queue manager to context object
aimeos_aimeos-typo3
train
php,php
e80a151503d10b57819f35d4906f5b3dcb158794
diff --git a/lib/hako/schedulers/ecs_definition_comparator.rb b/lib/hako/schedulers/ecs_definition_comparator.rb index <HASH>..<HASH> 100644 --- a/lib/hako/schedulers/ecs_definition_comparator.rb +++ b/lib/hako/schedulers/ecs_definition_comparator.rb @@ -45,6 +45,7 @@ module Hako struct.member(:linux_parameters, Schema::Nullable.new(linux_parameters_schema)) struct.member(:readonly_root_filesystem, Schema::Nullable.new(Schema::Boolean.new)) struct.member(:docker_security_options, Schema::Nullable.new(Schema::UnorderedArray.new(Schema::String.new))) + struct.member(:system_controls, Schema::Nullable.new(system_controls_schema)) end end @@ -170,6 +171,13 @@ module Hako struct.member(:condition, Schema::String.new) end end + + def system_controls_schema + Schema::Structure.new.tap do |struct| + struct.member(:namespace, Schema::String.new) + struct.member(:value, Schema::String.new) + end + end end end end
Add system_controls member to ECS definition schema
eagletmt_hako
train
rb
b3afaf78769de1577890aafbc7b47272ce99cc98
diff --git a/pack.js b/pack.js index <HASH>..<HASH> 100644 --- a/pack.js +++ b/pack.js @@ -63,6 +63,12 @@ function compressName(buf, offset, nameMap, name, callback) { // The top 2-bits must be set as a flag indicating its a pointer pointer |= 0xc000; + if ((buf.length - offset) < 2) { + callback('buffer not large enough to write label pointer for name [' + + name + ']'); + return; + } + buf.writeUInt16BE(pointer, offset + bytes); bytes += 2; @@ -83,6 +89,9 @@ function compressName(buf, offset, nameMap, name, callback) { if (label.length > 64) { callback('Label [' + label + '] is more than 64 characters long.'); return; + } else if ((buf.length - offset) < (1 + label.length)) { + callback('buffer not large enough to write name [' + name + ']'); + return; } // Write the length of the label out in a single octet. The top 2-bits
Add buffer overrun checks and flag as a callback error.
wanderview_node-netbios-name
train
js
0dd147e3f01fee330795e5f2dcd88413eaed910c
diff --git a/src/org/jgroups/Channel.java b/src/org/jgroups/Channel.java index <HASH>..<HASH> 100644 --- a/src/org/jgroups/Channel.java +++ b/src/org/jgroups/Channel.java @@ -1,4 +1,4 @@ -// $Id: Channel.java,v 1.35 2007/10/01 11:48:59 vlada Exp $ +// $Id: Channel.java,v 1.36 2007/10/16 16:24:38 belaban Exp $ package org.jgroups; @@ -116,7 +116,7 @@ public abstract class Channel implements Transport { /** Shuts down the channel without disconnecting if connected, stops all the threads */ - abstract protected void shutdown(); + abstract public void shutdown(); /**
made Channel.shutdown() public
belaban_JGroups
train
java
5a35274437159dbe742e52e4b40c80ec1f8484dc
diff --git a/sacred/commands.py b/sacred/commands.py index <HASH>..<HASH> 100644 --- a/sacred/commands.py +++ b/sacred/commands.py @@ -5,6 +5,7 @@ import pprint import pydoc import re +import sys from collections import namedtuple, OrderedDict from colorama import Fore, Style @@ -58,9 +59,14 @@ def _non_unicode_repr(objekt, context, maxlevels, level): E.g.: 'John' instead of u'John'. """ - repr_string, isreadable, isrecursive = pprint._safe_repr( - objekt, context, maxlevels, level - ) + if sys.version_info[0] == 3 and sys.version_info[1] >= 8: + repr_string, isreadable, isrecursive = pprint._safe_repr( + objekt, context, maxlevels, level, sort_dicts=None + ) + else: + repr_string, isreadable, isrecursive = pprint._safe_repr( + objekt, context, maxlevels, level + ) if repr_string.startswith('u"') or repr_string.startswith("u'"): repr_string = repr_string[1:] return repr_string, isreadable, isrecursive
Fix #<I> (#<I>)
IDSIA_sacred
train
py
9adefc43e7af15ee1cecbbd7ff8c2112f5c92f9a
diff --git a/lib/clitasks/story.rb b/lib/clitasks/story.rb index <HASH>..<HASH> 100644 --- a/lib/clitasks/story.rb +++ b/lib/clitasks/story.rb @@ -9,7 +9,7 @@ module CliTasks end def id - @id ||= File.basename(file).sub(/[.]rb$/, '') + @id ||= File.basename(file, '.rb') end def tags diff --git a/stories/index/20140524235849.rb b/stories/index/20140524235849.rb index <HASH>..<HASH> 100644 --- a/stories/index/20140524235849.rb +++ b/stories/index/20140524235849.rb @@ -1,5 +1,5 @@ story %q(change how a story's id is retrieved) do - status started + status finished points 1 created_by 'unixsuperhero' assigned_to :unassigned
change how story id is composed
unixsuperhero_clitasks
train
rb,rb
cfccb8372262f98badfdf991aed9b3ad49545afd
diff --git a/src/main/java/com/smartsheet/api/models/enums/WidgetType.java b/src/main/java/com/smartsheet/api/models/enums/WidgetType.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/smartsheet/api/models/enums/WidgetType.java +++ b/src/main/java/com/smartsheet/api/models/enums/WidgetType.java @@ -48,5 +48,9 @@ public enum WidgetType { /** * ImageWidgetContent object */ - IMAGE + IMAGE, + /** + * same as RichTextWidgetContent object + */ + TITLE }
add TITLE as a valid WidgetType
smartsheet-platform_smartsheet-java-sdk
train
java
ba52b64b9ffe2d749ab9dcc57761e80bcda2e26b
diff --git a/h5netcdf/core.py b/h5netcdf/core.py index <HASH>..<HASH> 100644 --- a/h5netcdf/core.py +++ b/h5netcdf/core.py @@ -379,6 +379,10 @@ class Group(Mapping): def parent(self): return self._parent + def flush(self): + self._root.flush() + sync = flush + @property def groups(self): return Frozen(self._groups) diff --git a/h5netcdf/tests/test_h5netcdf.py b/h5netcdf/tests/test_h5netcdf.py index <HASH>..<HASH> 100644 --- a/h5netcdf/tests/test_h5netcdf.py +++ b/h5netcdf/tests/test_h5netcdf.py @@ -135,9 +135,11 @@ def write_h5netcdf(tmp_netcdf): g.dimensions['y'] = 10 g.create_variable('y_var', ('y',), float) + g.flush() ds.dimensions['mismatched_dim'] = 1 ds.create_variable('mismatched_dim', dtype=int) + ds.flush() dt = h5py.special_dtype(vlen=unicode) v = ds.create_variable('var_len_str', ('x',), dtype=dt)
Add flush/sync to core.Group
shoyer_h5netcdf
train
py,py
74c8c48837b8d1bdfb0fc130bdc38cd472c1f605
diff --git a/openpnm/utils/Project.py b/openpnm/utils/Project.py index <HASH>..<HASH> 100644 --- a/openpnm/utils/Project.py +++ b/openpnm/utils/Project.py @@ -115,7 +115,42 @@ class Project(list): purge_object """ - self.purge_object(obj) + self.purge_object(obj, deep=False) + + def pop(self, index): + r""" + The object at the given index is removed from the list and returned. + + Notes + ----- + This method uses ``purge_object`` to perform the actual removal of the + object. It is reommended to just use that directly instead. + + See Also + -------- + purge_object + + """ + obj = self[index] + self.purge_object(obj, deep=False) + return obj + + def insert(self, index, obj): + r""" + Inserts the supplied object at the specified index in the Project list + + Notes + ----- + The order of the objects in an OpenPNM Project lists do not matter, so + it is recommended to just use ``append`` instead. + + See Also + -------- + append + extend + + """ + self.extend(obj) def clear(self, objtype=[]): r"""
completing subclassing of project list builtins
PMEAL_OpenPNM
train
py
574b703ca978709832c6c2f67d6c1de376d432b5
diff --git a/lib/WebSocketConnection.js b/lib/WebSocketConnection.js index <HASH>..<HASH> 100644 --- a/lib/WebSocketConnection.js +++ b/lib/WebSocketConnection.js @@ -348,7 +348,7 @@ WebSocketConnection.prototype.handleSocketError = function(error) { if (utils.eventEmitterListenerCount(this, 'error') > 0) { this.emit('error', error); } - this.socket.destroy(error); + this.socket.destroy(); this._debug.printOutput(); };
Fix infinite loop in error handling. (#<I>) Fix #<I>
theturtle32_WebSocket-Node
train
js
befd460c79a1d16c64a1a9857678621106e4a111
diff --git a/core/src/main/java/me/prettyprint/cassandra/service/template/ColumnFamilyResultIterator.java b/core/src/main/java/me/prettyprint/cassandra/service/template/ColumnFamilyResultIterator.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/me/prettyprint/cassandra/service/template/ColumnFamilyResultIterator.java +++ b/core/src/main/java/me/prettyprint/cassandra/service/template/ColumnFamilyResultIterator.java @@ -26,19 +26,23 @@ public class ColumnFamilyResultIterator implements Iterator<ColumnFamilyResult<? this.res = res; } - public boolean hasNext() - { - boolean retval = false; - if (isStart) - { - retval = res.hasResults(); - } - else - { - retval = res.hasNext(); - } - return retval; - } + public boolean hasNext() + { + boolean retval = false; + if (isStart) + { + if(res.hasResults() || res.hasNext()) + { + retval = true; + } + } + else + { + retval = res.hasNext(); + } + return retval; + } + public ColumnFamilyResult<?, ?> getRes() {
Fix bug in hasNext when no result for a key is returned
hector-client_hector
train
java
7f4a3cd88e9e9d55c5de1c47578663453a45832e
diff --git a/tests/test_geometry.py b/tests/test_geometry.py index <HASH>..<HASH> 100644 --- a/tests/test_geometry.py +++ b/tests/test_geometry.py @@ -87,6 +87,15 @@ class TestBBox(TestSentinelHub): self.assertEqual(bbox.get_lower_left(), (46.07, 13.23)) self.assertEqual(bbox.get_crs(), CRS.WGS84) + def test_bbox_from_shapely(self): + bbox_list = [ + BBox(shapely.geometry.LineString([(0, 0), (1, 1)]), CRS.WGS84), + BBox(shapely.geometry.LinearRing([(1, 0), (1, 1), (0, 0)]), CRS.WGS84), + BBox(shapely.geometry.Polygon([(1, 0), (1, 1), (0, 0)]), CRS.WGS84) + ] + for bbox in bbox_list: + self.assertEqual(bbox, BBox((0, 0, 1, 1), CRS.WGS84)) + def test_bbox_to_str(self): x1, y1, x2, y2 = 45.0, 12.0, 47.0, 14.0 crs = CRS.WGS84
added unit test for parsing shapely objects
sentinel-hub_sentinelhub-py
train
py
a2c5818c83e0726e475ba023ffac0787339acc6a
diff --git a/test/d3-funnel/d3-funnel.js b/test/d3-funnel/d3-funnel.js index <HASH>..<HASH> 100644 --- a/test/d3-funnel/d3-funnel.js +++ b/test/d3-funnel/d3-funnel.js @@ -45,6 +45,17 @@ describe('D3Funnel', function () { funnel.draw(['One dimensional', 2], {}); }, Error, 'Funnel data is not valid.'); }); + + it('should draw as many blocks as there are elements', function () { + getFunnel().draw([ + ['Node A', 1], + ['Node B', 2], + ['Node C', 3], + ['Node D', 4], + ]); + + assert.equal(4, getLength(getSvg().selectAll('path'))); + }); }); describe('destroy', function () {
Add test for one-to-one block drawing
jakezatecky_d3-funnel
train
js
f91b953c7ff7f28f4194d2d6611f369936e145b9
diff --git a/spec/how_bad/analyzer_spec.rb b/spec/how_bad/analyzer_spec.rb index <HASH>..<HASH> 100644 --- a/spec/how_bad/analyzer_spec.rb +++ b/spec/how_bad/analyzer_spec.rb @@ -6,5 +6,29 @@ describe HowBad::Analyzer do let(:fetcher_results) { HowBad::Fetcher::Results.new(issues, pulls) } - + subject { HowBad::Analyzer.new } + + context '#num_with_label' do + it 'returns a Hash mapping labels to the number of issues or pulls with that label' do + result = subject.num_with_label(issues) + + expect(result).to eq(TODO) + end + end + + context '#average_age_for' do + it 'returns the average age for the provided issues or pulls' do + result = subject.average_age_for(issues) + + expect(result).to eq(TODO) + end + end + + context '#oldest_age_for' do + it 'returns the oldest age for the provided issues or pulls' do + result = subject.average_age_for(issues) + + expect(result).to eq(TODO) + end + end end
Beginning of specs for Analyzer.
duckinator_inq
train
rb
7f2e6044b36deaa149c6eab615a53d3678984b62
diff --git a/lib/util/toplist.js b/lib/util/toplist.js index <HASH>..<HASH> 100644 --- a/lib/util/toplist.js +++ b/lib/util/toplist.js @@ -46,10 +46,18 @@ module.exports = { }, getLargestPages: function(pages, limit) { + pages.sort(function(page, thatPage) { - return thatPage.yslow.pageWeight.v - page.yslow.pageWeight.v; + + // if YSlow fails but we collect other data + // we have the page object but no YSlow + if (thatPage.yslow && page.yslow) { + return thatPage.yslow.pageWeight.v - page.yslow.pageWeight.v; + } + return 0; }); + return pages.slice(0, limit < pages.length ? limit : pages.length);
safe check for pages without yslow
sitespeedio_sitespeed.io
train
js
06c0e3d0ad116c411fb59cc649b9dbcd68e57cf8
diff --git a/includes/class-plugin.php b/includes/class-plugin.php index <HASH>..<HASH> 100644 --- a/includes/class-plugin.php +++ b/includes/class-plugin.php @@ -402,7 +402,7 @@ class Plugin { $dropin = get_plugin_data( WP_CONTENT_DIR . '/object-cache.php' ); $plugin = get_plugin_data( WP_REDIS_PLUGIN_PATH . '/includes/object-cache.php' ); - return $dropin['PluginURI'] === $plugin['PluginURI']; + return apply_filters('redis_cache_validate_object_cache_dropin',$dropin['PluginURI'] === $plugin['PluginURI'],$dropin['PluginURI'], $plugin['PluginURI']); } /**
Adding a filter to Rhubarb\RedisCache\Plugin::validate_object_cache_dropin
tillkruss_redis-cache
train
php
c3eb3b888287a616209c82488d4286ddbea4bae5
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -33,7 +33,7 @@ class multicolour extends Map { .set("stashes", new Map()) // Set the environment we're in. - .set("env", process.env.NODE_ENV || "dev") + .set("env", process.env.NODE_ENV || "development") // Where is the package. const package_path = require("path").resolve("package.json") @@ -111,7 +111,7 @@ class multicolour extends Map { this.set("blueprints", files) // Set up the DB. - this.use(require("./lib/db")(this)) + this.use(require("./lib/db")) return this }
Fix registration signature call for database generator and fixed incorrect environment default
Multicolour_multicolour
train
js
c337f583d0063679b4251573d4d8120717fbd033
diff --git a/src/main/java/com/synopsys/integration/bdio/model/Forge.java b/src/main/java/com/synopsys/integration/bdio/model/Forge.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/synopsys/integration/bdio/model/Forge.java +++ b/src/main/java/com/synopsys/integration/bdio/model/Forge.java @@ -30,10 +30,9 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import com.synopsys.integration.util.Stringable; import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; + +import com.synopsys.integration.util.Stringable; public class Forge extends Stringable { // forges that use the slash as the separator
refactor(import): Cleaned up unused imports.
blackducksoftware_integration-bdio
train
java
c18823b89f3bf48ebba694c6e719b60e9a101304
diff --git a/lib/canned_soap/version.rb b/lib/canned_soap/version.rb index <HASH>..<HASH> 100644 --- a/lib/canned_soap/version.rb +++ b/lib/canned_soap/version.rb @@ -1,3 +1,3 @@ module CannedSoap - VERSION = "0.1.0" + VERSION = "0.1.1" end
bumped to <I>
gknedo_canned_soap
train
rb
bd8638f5fd1f85d16c908020252f58a0cc4f6ac0
diff --git a/heatmiserV3/heatmiser.py b/heatmiserV3/heatmiser.py index <HASH>..<HASH> 100644 --- a/heatmiserV3/heatmiser.py +++ b/heatmiserV3/heatmiser.py @@ -69,11 +69,10 @@ class HeatmiserThermostat(object): def __init__(self, address, model, uh1): self.address = address self.model = model - with open("./config.yml", "r") as stream: - try: - self.config = yaml.load(stream)[model] - except yaml.YAMLError as exc: - logging.info("The YAML file is invalid: %s", exc) + try: + self.config = yaml.safe_load(config_yml)[model] + except yaml.YAMLError as exc: + logging.info("The YAML file is invalid: %s", exc) self.conn = uh1.registerThermostat(self) self.dcb = "" self.read_dcb() diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup setup( name='heatmiserV3', packages=['heatmiserV3'], # this must be the same as the name above - version='1.1.7', + version='1.1.8', description='A library to interact with Heatmiser Themostats using V3', author='Andy Loughran', author_email='andy@zrmt.com',
Updated to <I> and handled config properly
andylockran_heatmiserV3
train
py,py
85ba6928328844bd94918296abfe254192fc57dc
diff --git a/cmd/describe.go b/cmd/describe.go index <HASH>..<HASH> 100644 --- a/cmd/describe.go +++ b/cmd/describe.go @@ -144,8 +144,8 @@ func printPackage(pkg *pack.Package, printSymbols bool, printExports bool, print fmt.Printf("%vdependencies [", tab) if pkg.Dependencies != nil && len(*pkg.Dependencies) > 0 { fmt.Printf("\n") - for _, dep := range *pkg.Dependencies { - fmt.Printf("%v\"%v\"\n", tab+tab, dep) + for _, dep := range pack.StableDependencies(*pkg.Dependencies) { + fmt.Printf("%v%v: \"%v\"\n", tab+tab, dep, (*pkg.Dependencies)[dep]) } fmt.Printf("%v", tab) }
Print the dependency key and value during describe
pulumi_pulumi
train
go
07f301951c9f219de8aa3597f9448c906723a81c
diff --git a/indra/assemblers/pysb_assembler.py b/indra/assemblers/pysb_assembler.py index <HASH>..<HASH> 100644 --- a/indra/assemblers/pysb_assembler.py +++ b/indra/assemblers/pysb_assembler.py @@ -827,7 +827,7 @@ class PysbAssembler(object): set_base_initial_condition(self.model, m, init_round) monomers_found.append(m.name) else: - set_base_initial_condition(self.model, m, 100.0) + set_base_initial_condition(self.model, m, 1000.0) monomers_notfound.append(m.name) logger.info('Monomers set to %s context' % cell_type) logger.info('--------------------------------')
Fix increase default initial amount in set context
sorgerlab_indra
train
py
c52b54f1e9167d6aa541989a3bce973987f787b2
diff --git a/bcbio/pipeline/qcsummary.py b/bcbio/pipeline/qcsummary.py index <HASH>..<HASH> 100644 --- a/bcbio/pipeline/qcsummary.py +++ b/bcbio/pipeline/qcsummary.py @@ -84,10 +84,11 @@ def get_qc_tools(data): for tool in ["qualimap", "qualimap_full"]]): to_run.append("qualimap") if analysis.startswith("rna-seq"): - if gtf.is_qualimap_compatible(dd.get_gtf_file(data)): - to_run.append("qualimap_rnaseq") - else: - logger.debug("GTF not compatible with Qualimap, skipping.") + if "qualimap" not in dd.get_tools_off(data): + if gtf.is_qualimap_compatible(dd.get_gtf_file(data)): + to_run.append("qualimap_rnaseq") + else: + logger.debug("GTF not compatible with Qualimap, skipping.") if analysis.startswith("smallrna-seq"): to_run.append("small-rna") if not analysis.startswith("smallrna-seq"):
In the RNA-seq pipeline skip qualimap_rnaseq if qualimap was turned off.
bcbio_bcbio-nextgen
train
py
7c2ec659b4d155fcf806b794e4c3c1303f4e3ab8
diff --git a/pymatgen/io/vasp/sets.py b/pymatgen/io/vasp/sets.py index <HASH>..<HASH> 100644 --- a/pymatgen/io/vasp/sets.py +++ b/pymatgen/io/vasp/sets.py @@ -2692,7 +2692,7 @@ class MVLNPTMDSet(MITMDSet): # NPT-AIMD default settings defaults = { - "IALGO": 48, + "ALGO": "Fast", "ISIF": 3, "LANGEVIN_GAMMA": [10] * structure.ntypesp, "LANGEVIN_GAMMA_L": 1,
Update MVLNPTMDSet in sets.py Replaced the IALGO tag with ALGO as recommended in the vasp documentation <URL>
materialsproject_pymatgen
train
py
becc278eb6df97dd547b2ed0e19ad1822f891584
diff --git a/storage/metric/operation.go b/storage/metric/operation.go index <HASH>..<HASH> 100644 --- a/storage/metric/operation.go +++ b/storage/metric/operation.go @@ -215,7 +215,10 @@ func (g *getValuesAlongRangeOp) ExtractSamples(in []model.SamplePair) (out []mod return !in[i].Timestamp.Before(g.from) }) if firstIdx == len(in) { - // No samples at or after operator start time. + // No samples at or after operator start time. This can only happen if we + // try applying the operator to a time after the last recorded sample. In + // this case, we're finished. + g.from = g.through.Add(1) return } @@ -228,7 +231,10 @@ func (g *getValuesAlongRangeOp) ExtractSamples(in []model.SamplePair) (out []mod } lastSampleTime := in[lastIdx-1].Timestamp - g.from = lastSampleTime.Add(time.Duration(1)) + // Sample times are stored with a maximum time resolution of one second, so + // we have to add exactly that to target the next chunk on the next op + // iteration. + g.from = lastSampleTime.Add(time.Second) return in[firstIdx:lastIdx] }
Fix two bugs in range op time advancement.
prometheus_prometheus
train
go
5c68dadf46a07828e747f9f77dfeca6f61ddbc5b
diff --git a/lib/node-notifier.js b/lib/node-notifier.js index <HASH>..<HASH> 100644 --- a/lib/node-notifier.js +++ b/lib/node-notifier.js @@ -46,7 +46,7 @@ var Notifier = function () { } , command = function (options, cb) { - var notifyApp = exec(notifier, options, function (error, stdout, stderr) { + var notifyApp = exec(notifier + ' ' + options.join(' '), function (error, stdout, stderr) { if (error !== null) { return cb(error); }
Fixed options passed in to exec
mikaelbr_node-notifier
train
js
07823ae7f7368f4bc4a4e4436129319f7215150b
diff --git a/faker/utils/distribution.py b/faker/utils/distribution.py index <HASH>..<HASH> 100644 --- a/faker/utils/distribution.py +++ b/faker/utils/distribution.py @@ -1,6 +1,7 @@ # coding=utf-8 import bisect +from sys import version_info from faker.generator import random def random_sample(): @@ -17,10 +18,13 @@ def cumsum(it): def choice_distribution(a, p): assert len(a) == len(p) - cdf = list(cumsum(p)) - normal = cdf[-1] - cdf2 = [float(i) / float(normal) for i in cdf] - uniform_sample = random_sample() - idx = bisect.bisect_right(cdf2, uniform_sample) - - return a[idx] + if version_info.major >= 3 and version_info.minor >= 6: + from random import choices + return choices(a, weights=p)[0] + else: + cdf = list(cumsum(p)) + normal = cdf[-1] + cdf2 = [float(i) / float(normal) for i in cdf] + uniform_sample = random_sample() + idx = bisect.bisect_right(cdf2, uniform_sample) + return a[idx]
Use random.choices when available for better performance
joke2k_faker
train
py
768172d20b68a217fc70f3f6998da143e94cfc01
diff --git a/apps/editing-toolkit/editing-toolkit-plugin/help-center/src/config.js b/apps/editing-toolkit/editing-toolkit-plugin/help-center/src/config.js index <HASH>..<HASH> 100644 --- a/apps/editing-toolkit/editing-toolkit-plugin/help-center/src/config.js +++ b/apps/editing-toolkit/editing-toolkit-plugin/help-center/src/config.js @@ -4,7 +4,7 @@ window.configData = { google_analytics_key: 'UA-10673494-15', client_slug: 'browser', twemoji_cdn_url: 'https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/', - happychat_url: 'https://happychat-io-staging.go-vip.co/customer', + happychat_url: 'https://happychat.io/customer', site_filter: [], sections: {}, enable_all_sections: false, @@ -19,7 +19,7 @@ window.configData = { signup_url: '/', discover_blog_id: 53424024, discover_feed_id: 41325786, - directly_rtm_widget_environment: 'sandbox', + directly_rtm_widget_environment: 'production', directly_rtm_widget_ids: { sandbox: '8a2968fc57d1e2f40157f42bf2d43160', production: '8a12a3ca5a21a619015a47e492b02cfc',
Set config values to production (#<I>)
Automattic_wp-calypso
train
js
fbd9fafa2436fab673078c957cd912eae4185763
diff --git a/lib/chef/client.rb b/lib/chef/client.rb index <HASH>..<HASH> 100644 --- a/lib/chef/client.rb +++ b/lib/chef/client.rb @@ -604,7 +604,7 @@ class Chef # @api private # def run_ohai - filter = Chef::Config[:minimal_ohai] ? %w{fqdn machinename hostname platform platform_version ohai_time os os_version} : nil + filter = Chef::Config[:minimal_ohai] ? %w{fqdn machinename hostname platform platform_version ohai_time os os_version init_package} : nil ohai.all_plugins(filter) events.ohai_completed(node) rescue Ohai::Exceptions::CriticalPluginFailure => e diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/client_spec.rb +++ b/spec/unit/client_spec.rb @@ -38,7 +38,7 @@ describe Chef::Client do end it "runs ohai with only the minimum required plugins" do - expected_filter = %w{fqdn machinename hostname platform platform_version ohai_time os os_version} + expected_filter = %w{fqdn machinename hostname platform platform_version ohai_time os os_version init_package} expect(ohai_system).to receive(:all_plugins).with(expected_filter) client.run_ohai end
minimal_ohai: Add init_package plugin as a required plugin This is a pretty critical bit of data and we're using it for decisions in the timezone resource now.
chef_chef
train
rb,rb
c4c112bc50b49458303785efdc8aa6a83d93a68b
diff --git a/examples/python/helloworld/greeter_client_with_options.py b/examples/python/helloworld/greeter_client_with_options.py index <HASH>..<HASH> 100644 --- a/examples/python/helloworld/greeter_client_with_options.py +++ b/examples/python/helloworld/greeter_client_with_options.py @@ -31,7 +31,7 @@ def run(): target='localhost:50051', options=[('grpc.lb_policy_name', 'pick_first'), ('grpc.enable_retries', 0), - ('grpc.keepalive_timeout_ms', 10)]) as channel: + ('grpc.keepalive_timeout_ms', 10000)]) as channel: stub = helloworld_pb2_grpc.GreeterStub(channel) # timeout in second response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'), timeout=1)
Update keepalive timeout: <I> -> <I>
grpc_grpc
train
py
b5cedbaa6a1989d55ec470f15b0ee34d4bf92f7f
diff --git a/src/utils/pluginOptions.js b/src/utils/pluginOptions.js index <HASH>..<HASH> 100644 --- a/src/utils/pluginOptions.js +++ b/src/utils/pluginOptions.js @@ -6,7 +6,7 @@ const defaultSettings = { const defaultMethods = ['debug', 'error', 'exception', 'info', 'log', 'warn']; -// this should deep merge in the furture when we are dealing with more than just flags +// this should deep merge in the future when we are dealing with more than just flags const mergeOptions = options => { const sanitizedOptions = Object.keys(options || {}) .filter(key => Object.keys(defaultSettings).includes(key))
chore(docs): update typo
kwelch_babel-plugin-captains-log
train
js
aa41572adcb580059c0a02d7bc8dd26645c69ccb
diff --git a/resources/lang/zh-CN/cachet.php b/resources/lang/zh-CN/cachet.php index <HASH>..<HASH> 100644 --- a/resources/lang/zh-CN/cachet.php +++ b/resources/lang/zh-CN/cachet.php @@ -53,7 +53,7 @@ return [ // Service Status 'service' => [ - 'good' => '[0,1] 系统工作正常|[2,*] 所有系统工作正常', + 'good' => '[0,1]System operational|[2,*]All systems are operational', 'bad' => '[0,1] 系统出现了问题|[2,*] 一些系统出现了问题', 'major' => '[0,1] 系统出现重大故障|[2,*] 一些系统出现重大故障', ],
New translations cachet.php (Chinese Simplified)
CachetHQ_Cachet
train
php
72841a6d9cab2ec85d314c4cb41d51c1a74a1c25
diff --git a/Integration/TrustedFormIntegration.php b/Integration/TrustedFormIntegration.php index <HASH>..<HASH> 100644 --- a/Integration/TrustedFormIntegration.php +++ b/Integration/TrustedFormIntegration.php @@ -108,7 +108,8 @@ class TrustedFormIntegration extends AbstractEnhancerIntegration ], ]; - for ($try = 0; $try < 3; ++$try) { + $tryLimit = 5; + for ($try = 1; $try < $tryLimit; ++$try) { $response = $this->makeRequest($trustedFormClaim, $parameters, 'post', $settings); if (!$response || !isset($response->body)) { $this->logger->error(
[ENG-<I>] Increase TrustedForm retry count from 3/5.
TheDMSGroup_mautic-enhancer
train
php
eb87e56f96d035759a481121f280a2575254fac8
diff --git a/client/mocknetconn_test.go b/client/mocknetconn_test.go index <HASH>..<HASH> 100644 --- a/client/mocknetconn_test.go +++ b/client/mocknetconn_test.go @@ -24,7 +24,7 @@ type mockNetConn struct { rc chan bool closed bool - rt, wt int64 + rt, wt time.Time } func MockNetConn(t *testing.T) *mockNetConn { @@ -143,18 +143,18 @@ func (m *mockNetConn) RemoteAddr() net.Addr { return &net.IPAddr{net.IPv4(127, 0, 0, 1)} } -func (m *mockNetConn) SetTimeout(ns int64) error { - m.rt = ns - m.wt = ns +func (m *mockNetConn) SetDeadline(t time.Time) error { + m.rt = t + m.wt = t return nil } -func (m *mockNetConn) SetReadTimeout(ns int64) error { - m.rt = ns +func (m *mockNetConn) SetReadDeadline(t time.Time) error { + m.rt = t return nil } -func (m *mockNetConn) SetWriteTimeout(ns int64) error { - m.wt = ns +func (m *mockNetConn) SetWriteDeadline(t time.Time) error { + m.wt = t return nil }
Mock net.Conn needs updating for interface changes.
fluffle_goirc
train
go
7e80bb8efd8433e949e5874156b67575df1032ed
diff --git a/src/Extension/SimpleExtension.php b/src/Extension/SimpleExtension.php index <HASH>..<HASH> 100644 --- a/src/Extension/SimpleExtension.php +++ b/src/Extension/SimpleExtension.php @@ -34,7 +34,7 @@ abstract class SimpleExtension extends AbstractExtension implements ServiceProvi $this->extendMenuService(); $this->extendAssetServices(); $this->extendNutService(); - $this->addTranslations(); + $this->extendTranslatorService(); $this->registerServices($app); }
Renamed function in TranslationTrait. (cherry picked from commit a<I>cc8e)
bolt_bolt
train
php
ba1526718f732b3dc42f2a84f949ee41cf58d730
diff --git a/web/src/main/java/com/graphhopper/http/GraphHopperServlet.java b/web/src/main/java/com/graphhopper/http/GraphHopperServlet.java index <HASH>..<HASH> 100644 --- a/web/src/main/java/com/graphhopper/http/GraphHopperServlet.java +++ b/web/src/main/java/com/graphhopper/http/GraphHopperServlet.java @@ -180,6 +180,10 @@ public class GraphHopperServlet extends GHBaseServlet Map<String, Object> map = routeSerializer.toJSON(ghRsp, calcPoints, pointsEncoded, enableElevation, enableInstructions); + Object infoMap = map.get("info"); + if (infoMap != null) + ((Map) infoMap).put("took", Math.round(took * 1000)); + if (ghRsp.hasErrors()) writeJsonError(httpRes, SC_BAD_REQUEST, new JSONObject(map)); else @@ -199,7 +203,7 @@ public class GraphHopperServlet extends GHBaseServlet res.setContentType("application/xml"); else res.setContentType("application/gpx+xml"); - + String trackName = getParam(req, "trackname", "GraphHopper Track"); res.setHeader("Content-Disposition", "attachment;filename=" + "GraphHopper.gpx"); long time = getLongParam(req, "millis", System.currentTimeMillis());
roll back 'removing took', #<I>
graphhopper_graphhopper
train
java
0d453790b8906ba0a2d5cc87cc1c869231247447
diff --git a/master/buildbot/status/web/console.py b/master/buildbot/status/web/console.py index <HASH>..<HASH> 100644 --- a/master/buildbot/status/web/console.py +++ b/master/buildbot/status/web/console.py @@ -291,15 +291,6 @@ class ConsoleStatusResource(HtmlResource): # We want to display this builder. tags = builder.getTags() or ["default"] - - # Strip the category to keep only the text before the first |. - # This is a hack to support the chromium usecase where they have - # multiple tags for each slave. We use only the first one. - # TODO(nsylvain): Create another way to specify "display category" - # in master.cfg. - if len(tags)==1: - tags = tags[0].split('|') - for tag in tags: # Append this builder to the dictionary of builders. builderList.setdefault(tag, []).append(builderName)
console.py: remove a purported chromium workaround from <I> It's not clear what this code was intended to do and not sure if it should even still work like that
buildbot_buildbot
train
py
9831c3931341eee46a0eef952bef2a1f59a0fe02
diff --git a/tests/smbo/TransferTest.php b/tests/smbo/TransferTest.php index <HASH>..<HASH> 100644 --- a/tests/smbo/TransferTest.php +++ b/tests/smbo/TransferTest.php @@ -24,6 +24,9 @@ class TransferTest extends SMBOTestCase $this->assertEquals(100, $boi->reload()['balance']); $data = $t->export(['id', 'transfer_document_id']); + usort($data, function($e1, $e2) { + return ($e1['id'] < $e2['id'] ? -1 : 1); + }); $this->assertEquals([ ['id' => '1', 'transfer_document_id' => '2'], ['id' => '2', 'transfer_document_id' => '1'],
Sort array before compare - not doing this, made testTransfer() fail on some occasions
atk4_data
train
php
4d6252e7fb51fb6ffaf059db44c5e7eb1dd56085
diff --git a/src/app/Traits/InCents.php b/src/app/Traits/InCents.php index <HASH>..<HASH> 100644 --- a/src/app/Traits/InCents.php +++ b/src/app/Traits/InCents.php @@ -2,6 +2,7 @@ namespace LaravelEnso\Helpers\app\Traits; +use Illuminate\Database\Eloquent\Relations\Pivot; use LogicException; use LaravelEnso\Helpers\app\Classes\Decimals; @@ -14,6 +15,9 @@ trait InCents public static function bootInCents() { self::retrieved(function ($model) { + + \Log::debug('retrieved '. get_class($model)); + $model->inCents = true; }); @@ -24,7 +28,7 @@ trait InCents public function inCents(bool $mode = true) { - if ($this->inCents === null) { + if ($this->inCents === null && ! $this instanceof Pivot) { if (collect($this->getDirty())->keys() ->intersect($this->centAttributes)->isNotEmpty()) { throw new LogicException(
updates in cents to handle Pivot models
laravel-enso_Helpers
train
php
a75a0e7b4a02e522cd8f22c99e61c3f94e1e5d06
diff --git a/cs-mail/src/main/java/io/cloudslang/content/mail/services/GetMailMessage.java b/cs-mail/src/main/java/io/cloudslang/content/mail/services/GetMailMessage.java index <HASH>..<HASH> 100644 --- a/cs-mail/src/main/java/io/cloudslang/content/mail/services/GetMailMessage.java +++ b/cs-mail/src/main/java/io/cloudslang/content/mail/services/GetMailMessage.java @@ -222,7 +222,10 @@ public class GetMailMessage { } } - message.getFolder().close(true); + try { + message.getFolder().close(true); + } catch (Throwable ignore) { + } result.put(RETURN_CODE, SUCCESS_RETURN_CODE); } catch (Exception e) {
FIX GetMailMessage (#<I>) * FIX GetMailMessage Fix operation to be able to retrieve larger file than 4 MB
CloudSlang_cs-actions
train
java
052414ffc0f15d767a479f4e9c5561ab343315ef
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 @@ -781,7 +781,7 @@ if (! function_exists('trans')) { * @param string $id * @param array $replace * @param string $locale - * @return \Illuminate\Contracts\Translation\Translator|string + * @return \Illuminate\Contracts\Translation\Translator|string|array|null */ function trans($id = null, $replace = [], $locale = null) {
trans helper return type doc (#<I>) Matching the return types for the `trans` method in the Translator class.
laravel_framework
train
php
e9c1580283b5dcaffba0958458b7988ab75284ba
diff --git a/spec/main-spec.js b/spec/main-spec.js index <HASH>..<HASH> 100644 --- a/spec/main-spec.js +++ b/spec/main-spec.js @@ -100,4 +100,31 @@ describe('RangePool', function() { expect(workerSecond.startIndex).toBe(525) expect(workerSecond.limitIndex).toBe(999) }) + + it('re-uses old unfinished died workers even if that means one', function() { + const pool = new RangePool(90) + const workerA = pool.createWorker() + workerA.advance(50) + workerA.dispose() + expect(workerA.isActive()).toBe(false) + const workerB = pool.createWorker() + expect(workerA).toBe(workerB) + expect(workerB.isActive()).toBe(true) + }) + + it('re-uses old unfinished died workers no matter how many', function() { + const pool = new RangePool(50) + const workerA = pool.createWorker() + workerA.advance(5) + const workerB = pool.createWorker() + workerB.advance(5) + const workerC = pool.createWorker() + expect(workerC.isActive()).toBe(true) + workerC.dispose() + expect(workerC.isActive()).toBe(false) + const workerD = pool.createWorker() + expect(workerD).toBe(workerC) + expect(workerD.isActive()).toBe(true) + expect(workerC.isActive()).toBe(true) + }) })
:new: Add specs for new range behavior
steelbrain_range-pool
train
js
9ed52838df2b0c082703b86338a347f4e9967589
diff --git a/app/values/timeline/event.rb b/app/values/timeline/event.rb index <HASH>..<HASH> 100644 --- a/app/values/timeline/event.rb +++ b/app/values/timeline/event.rb @@ -8,6 +8,14 @@ module Timeline end end + def title + I18n.t("classes.#{self.class.name.underscore}") + end + + def description + self.inspect + end + def <=>(other) happened_at <=> other.happened_at end
Added default title and description methods on Timeline::Event.
robotex82_resource_renderer
train
rb
1064f0b58759b94669ff9b7057309c211454c6c4
diff --git a/fs/fsio.py b/fs/fsio.py index <HASH>..<HASH> 100644 --- a/fs/fsio.py +++ b/fs/fsio.py @@ -35,13 +35,13 @@ def write_file(filepath, contents, ftype = 'w'): output_handle.write(contents) output_handle.close() -def open_temp_file(path, ftype = 'w'): - F, fname = tempfile.mkstemp(dir = path) +def open_temp_file(path, ftype = 'w', suffix = '', prefix = ''): + F, fname = tempfile.mkstemp(dir = path, suffix = suffix, prefix = prefix) output_handle = os.fdopen(F, ftype) return output_handle, fname -def write_temp_file(path, contents, ftype = 'w'): - output_handle, fname = open_temp_file(path, ftype = ftype) +def write_temp_file(path, contents, ftype = 'w', suffix = '', prefix = ''): + output_handle, fname = open_temp_file(path, ftype = ftype, suffix = suffix, prefix = prefix) output_handle.write(contents) output_handle.close() return fname
Adding prefix and suffix options to temporary file wrappers around mkstemp.
Kortemme-Lab_klab
train
py
a2bf05d8819975bf957d7c6c5e367011f668da85
diff --git a/p2p/security/tls/extension.go b/p2p/security/tls/extension.go index <HASH>..<HASH> 100644 --- a/p2p/security/tls/extension.go +++ b/p2p/security/tls/extension.go @@ -1,7 +1,6 @@ package libp2ptls -// TODO: get an assigment for a valid OID -var extensionPrefix = []int{1, 3, 6, 1, 4, 1, 123456789} +var extensionPrefix = []int{1, 3, 6, 1, 4, 1, 53594} // getPrefixedExtensionID returns an Object Identifier // that can be used in x509 Certificates. diff --git a/p2p/security/tls/extension_test.go b/p2p/security/tls/extension_test.go index <HASH>..<HASH> 100644 --- a/p2p/security/tls/extension_test.go +++ b/p2p/security/tls/extension_test.go @@ -7,7 +7,7 @@ import ( var _ = Describe("Extensions", func() { It("generates a prefixed extension ID", func() { - Expect(getPrefixedExtensionID([]int{13, 37})).To(Equal([]int{1, 3, 6, 1, 4, 1, 123456789, 13, 37})) + Expect(getPrefixedExtensionID([]int{13, 37})).To(Equal([]int{1, 3, 6, 1, 4, 1, 53594, 13, 37})) }) It("compares extension IDs", func() {
use the new Protocol Labs PEN for the certificate extension
libp2p_go-libp2p
train
go,go
699422c131187861988ebe24caab685f962e29ec
diff --git a/pygal/test/test_graph.py b/pygal/test/test_graph.py index <HASH>..<HASH> 100644 --- a/pygal/test/test_graph.py +++ b/pygal/test/test_graph.py @@ -20,6 +20,7 @@ import os import pygal import uuid import sys +from pygal import i18n from pygal.util import cut from pygal._compat import u from pygal.test import pytest_generate_tests, make_data @@ -69,6 +70,8 @@ def test_metadata(Chart): v = range(7) if Chart == pygal.XY: v = list(map(lambda x: (x, x + 1), v)) + elif Chart == pygal.Worldmap: + v = list(map(lambda x: x, i18n.COUNTRIES)) chart.add('Serie with metadata', [ v[0], diff --git a/pygal/util.py b/pygal/util.py index <HASH>..<HASH> 100644 --- a/pygal/util.py +++ b/pygal/util.py @@ -346,6 +346,7 @@ def prepare_values(raw, config, cls): (width - len(raw_values)) * [None] # aligning values if len(raw_values) < width else [])): if isinstance(raw_value, dict): + raw_value = dict(raw_value) value = raw_value.pop('value', None) metadata[index] = raw_value else:
Fixes tests on the worldmap
Kozea_pygal
train
py,py
1a11c77d005670ac195a53f56bcda73f4d81ebb1
diff --git a/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php b/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php index <HASH>..<HASH> 100644 --- a/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php +++ b/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php @@ -155,6 +155,16 @@ class LaravelLogViewer return null; } + if (!is_readable($this->file)) { + return [[ + 'context' => '', + 'level' => '', + 'date' => null, + 'text' => 'Log file "' . $this->file . '" not readable', + 'stack' => '', + ]]; + } + $file = app('files')->get($this->file); preg_match_all($this->pattern->getPattern('logs'), $file, $headings);
Check that file is readable (#<I>)
rap2hpoutre_laravel-log-viewer
train
php
77e99f68104942590eb6bd15b2f14f1aca626acf
diff --git a/java/src/org/openqa/selenium/remote/Browser.java b/java/src/org/openqa/selenium/remote/Browser.java index <HASH>..<HASH> 100644 --- a/java/src/org/openqa/selenium/remote/Browser.java +++ b/java/src/org/openqa/selenium/remote/Browser.java @@ -72,4 +72,8 @@ public interface Browser { return browserName().equals(browserName) || "Safari".equals(browserName); } }; + + default String toJson() { + return browserName(); + } }
Add a `toJson` method to `Browser` so it becomes easier to use in Capabilities
SeleniumHQ_selenium
train
java
558a8c9aa6399f44b5bbc2f9d8d1b37a9db114cf
diff --git a/app/serializers/shipit/stack_serializer.rb b/app/serializers/shipit/stack_serializer.rb index <HASH>..<HASH> 100644 --- a/app/serializers/shipit/stack_serializer.rb +++ b/app/serializers/shipit/stack_serializer.rb @@ -3,7 +3,7 @@ module Shipit include ConditionalAttributes has_one :lock_author - attributes :id, :repo_owner, :repo_name, :environment, :html_url, :url, :tasks_url, :deploy_spec, + attributes :id, :repo_owner, :repo_name, :environment, :html_url, :url, :tasks_url, :deploy_url, :deploy_spec, :undeployed_commits_count, :is_locked, :lock_reason, :continuous_deployment, :created_at, :updated_at def url
Publish Stack#deploy_url in API and hooks
Shopify_shipit-engine
train
rb
1df56da9103e61b32ae5faf9b7e940fe008cefe0
diff --git a/lib/Persistence/Doctrine/QueryHandler/LayoutResolverQueryHandler.php b/lib/Persistence/Doctrine/QueryHandler/LayoutResolverQueryHandler.php index <HASH>..<HASH> 100644 --- a/lib/Persistence/Doctrine/QueryHandler/LayoutResolverQueryHandler.php +++ b/lib/Persistence/Doctrine/QueryHandler/LayoutResolverQueryHandler.php @@ -124,6 +124,7 @@ class LayoutResolverQueryHandler extends QueryHandler ->addOrderBy('rd.priority', 'DESC'); $this->applyStatusCondition($query, Rule::STATUS_PUBLISHED, 'r.status'); + $this->applyStatusCondition($query, Rule::STATUS_PUBLISHED, 'rt.status'); if (!isset($this->targetHandlers[$targetType])) { throw new RuntimeException(
Fix layout resolver matching using all statuses for targets
netgen-layouts_layouts-core
train
php
5b950c1b4e1a1a5a2e0700fa4a1d996487a49e41
diff --git a/src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java b/src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java +++ b/src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java @@ -431,8 +431,13 @@ public abstract class WebDriverManager { return this; } - public WebDriverManager dockerVolumes(String volumes) { - config().setDockerVolumes(volumes); + public WebDriverManager dockerVolumes(String[] volumes) { + config().setDockerVolumes(String.join(",", volumes)); + return this; + } + + public WebDriverManager dockerVolume(String volume) { + config().setDockerVolumes(volume); return this; }
Include API method to specify volumes as string array
bonigarcia_webdrivermanager
train
java
3053547136dd36e4c4c75e6f3256e06de24c2627
diff --git a/src/Dandomain/Api/Api.php b/src/Dandomain/Api/Api.php index <HASH>..<HASH> 100644 --- a/src/Dandomain/Api/Api.php +++ b/src/Dandomain/Api/Api.php @@ -75,6 +75,10 @@ class Api { $this->query = "/admin/WEBAPI/Endpoints/v1_0/ProductService/{$this->apiKey}/" . rawurlencode($productNumber) . "/$siteId"; return $this->run(); } + public function getProductsInModifiedInterval(\DateTime $dateStart, \DateTime $dateEnd, $siteId) { + $this->query = "/admin/WEBAPI/Endpoints/v1_0/ProductService/{$this->apiKey}/GetByModifiedInterval/$siteId?start=" . $dateStart->format('Y-m-d\TH:i:s') . "&end=" . $dateEnd->format('Y-m-d\TH:i:s'); + return $this->run(); + } public function getSites() { $this->query = "/admin/WEBAPI/Endpoints/v1_0/SettingService/{$this->apiKey}/Sites"; return $this->run();
Created method getProductsInModifiedInterval
loevgaard_dandomain-api
train
php
b5789ff113fd292888636042f1f678df0ebb8bad
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -53,16 +53,18 @@ FeathersError.prototype = new Error(); // NOTE (EK): A little hack to get around `message` not // being included in the default toJSON call. -FeathersError.prototype.toJSON = function () { - return { - name: this.name, - message: this.message, - code: this.code, - className: this.className, - data: this.data, - errors: this.errors - }; -}; +Object.defineProperty(FeathersError.prototype, 'toJSON', { + value: function () { + return { + name: this.name, + message: this.message, + code: this.code, + className: this.className, + data: this.data, + errors: this.errors + }; + } +}); // 400 - Bad Request function BadRequest (message, data) {
Define property toJSON because just assigning it throws an error in Node 4 (#<I>)
feathersjs_errors
train
js
b5e79b9d12c060d2da6c80e6dc02ea32b746fcbd
diff --git a/Model/StructValue.php b/Model/StructValue.php index <HASH>..<HASH> 100755 --- a/Model/StructValue.php +++ b/Model/StructValue.php @@ -45,13 +45,13 @@ class StructValue extends AbstractModel * @uses StructValue::constantSuffix() * @uses StructValue::getIndex() * @uses StructValue::getOwner() - * @uses Generator::instance()->getOptionGenericConstantsNames() + * @uses Generator::getOptionGenericConstantsNames() * @param bool $keepMultipleUnderscores optional, allows to keep the multiple consecutive underscores * @return string */ public function getCleanName($keepMultipleUnderscores = false) { - if (Generator::instance()->getOptionGenericConstantsNames() && is_numeric($this->getIndex()) && $this->getIndex() >= 0) { + if ($this->getGenerator()->getOptionGenericConstantsNames() && is_numeric($this->getIndex()) && $this->getIndex() >= 0) { return 'ENUM_VALUE_' . $this->getIndex(); } else { $key = self::constantSuffix($this->getOwner()->getName(), parent::getCleanName($keepMultipleUnderscores), $this->getIndex());
use property instead of no more used Generator::instance
WsdlToPhp_PackageGenerator
train
php
c7b261b08803b6c4a0b185a9bac26e8725cf3e5d
diff --git a/src/material/semantic.js b/src/material/semantic.js index <HASH>..<HASH> 100644 --- a/src/material/semantic.js +++ b/src/material/semantic.js @@ -176,10 +176,8 @@ const semantic = { if (Number(normalMap.uv) === 1) { return mesh.geometry.tangents1; } - return mesh.geometry.tangents; } - - return undefined; + return mesh.geometry.tangents; } },
fix: Semantic Tangent data should also be returned when there is no normal map
hiloteam_Hilo3d
train
js
499993bbf571dfce32ad5e717af0c16dab6039b9
diff --git a/packages/heroku-apps/commands/info.js b/packages/heroku-apps/commands/info.js index <HASH>..<HASH> 100644 --- a/packages/heroku-apps/commands/info.js +++ b/packages/heroku-apps/commands/info.js @@ -15,8 +15,8 @@ function* run (context, heroku) { return { addons: heroku.apps(app).addons().listByApp(), app: heroku.request({path: appUrl}), - dynos: heroku.apps(app).dynos().list(), - collaborators: heroku.apps(app).collaborators().list() + dynos: heroku.apps(app).dynos().list().catch(() => []), + collaborators: heroku.apps(app).collaborators().list().catch(() => []), }; }
Merge pull request #6 from heroku/revert-5-revert-3-rescue-requests Revert "Revert "fix output when only partial data is returned""
heroku_cli
train
js
c3cd212a87779625191fa66fce2cc2dfe0a5fa85
diff --git a/lib/permit/permit_rules.rb b/lib/permit/permit_rules.rb index <HASH>..<HASH> 100644 --- a/lib/permit/permit_rules.rb +++ b/lib/permit/permit_rules.rb @@ -125,7 +125,7 @@ module Permit applicable_rules = (rules[action] || []) + (rules[:all] || []) applicable_rules.each do |rule| if rule.matches?(person, context_binding) - @logger.info "#{person.to_s} matched #{type.to_s} rule: #{rule.to_s}" + @logger.info "#{person.inspect} matched #{type.to_s} rule: #{rule.inspect}" return true end end
Used #inspect to make rule match logging statement more useful.
dnd_permit
train
rb
dc162ab3696fa5f8e28249fa8c40253d8a093b60
diff --git a/examples/icalendar/xcalendar.php b/examples/icalendar/xcalendar.php index <HASH>..<HASH> 100644 --- a/examples/icalendar/xcalendar.php +++ b/examples/icalendar/xcalendar.php @@ -4,4 +4,7 @@ require_once(__DIR__.'/../../vendor/autoload.php'); $dom = FluentDOM::load(__DIR__.'/example.ical', 'text/calendar'); $dom->formatOutput = TRUE; + +echo $dom('string(//xCal:VEVENT/xCal:SUMMARY)'); +echo "\n\n"; echo $dom->saveXml(); \ No newline at end of file
Added new loader for text/calendar (converts icalendar to xcalendar)
ThomasWeinert_FluentDOM
train
php
679e73c503c3c39c8365ebf68655ff362dbd8bc2
diff --git a/spyder/plugins/explorer/widgets/explorer.py b/spyder/plugins/explorer/widgets/explorer.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/explorer/widgets/explorer.py +++ b/spyder/plugins/explorer/widgets/explorer.py @@ -131,7 +131,12 @@ class IconProvider(QFileIconProvider): else: qfileinfo = icontype_or_qfileinfo fname = osp.normpath(to_text_string(qfileinfo.absoluteFilePath())) - return ima.get_icon_by_extension_or_type(fname, scale_factor=1.0) + if osp.isfile(fname) or osp.isdir(fname): + icon = ima.get_icon_by_extension_or_type(fname, + scale_factor=1.0) + else: + icon = ima.get_icon('binary', adjust_for_interface=True) + return icon class DirView(QTreeView):
Files: Only try to assing icon to files and dirs - Other objects (such as pipes and sockets) will be assigned the binary icon by default. - This avoid a total freeze when moving to a directory with a pipe in it.
spyder-ide_spyder
train
py
342e5d37e6f73b153b66dc4305ccf16744e4bb2b
diff --git a/test/tc_sequence.rb b/test/tc_sequence.rb index <HASH>..<HASH> 100644 --- a/test/tc_sequence.rb +++ b/test/tc_sequence.rb @@ -188,12 +188,14 @@ class TC_Sequence < Test::Unit::TestCase [ S( O, 3 ), S( I, 3 ) ].each do |t| assert_equal 2, t[ 4, 2, 3 ].min end + assert_equal C( 1, 2, 1 ), S[ C( 1, 2, 3 ), C( 3, 2, 1 ) ].min end def test_max [ S( O, 3 ), S( I, 3 ) ].each do |t| assert_equal 4, t[ 4, 2, 3 ].max end + assert_equal C( 3, 2, 3 ), S[ C( 1, 2, 3 ), C( 3, 2, 1 ) ].max end def test_convolve
Added tests for #min and #max for RGB values
wedesoft_multiarray
train
rb
a9ef10bb00404164e5c348389a14e30f3eaea1a0
diff --git a/src/test/java/redis/clients/jedis/tests/commands/PublishSubscribeCommandsTest.java b/src/test/java/redis/clients/jedis/tests/commands/PublishSubscribeCommandsTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/redis/clients/jedis/tests/commands/PublishSubscribeCommandsTest.java +++ b/src/test/java/redis/clients/jedis/tests/commands/PublishSubscribeCommandsTest.java @@ -472,7 +472,7 @@ public class PublishSubscribeCommandsTest extends JedisCommandTestBase { t.join(); } - @Test + @Test @Ignore public void subscribeWithoutConnecting() { try { Jedis jedis = new Jedis(hnp.host, hnp.port); @@ -504,7 +504,7 @@ public class PublishSubscribeCommandsTest extends JedisCommandTestBase { } } - @Test(expected = JedisConnectionException.class) @Ignore + @Test(expected = JedisConnectionException.class) public void unsubscribeWhenNotSusbscribed() throws InterruptedException { JedisPubSub pubsub = new JedisPubSub() { public void onMessage(String channel, String message) {
fix ignore that was placed on wrong test
xetorthio_jedis
train
java
ba139324faa45cfe2b9c80fec04d7197900f2fdd
diff --git a/src/Kunstmaan/GeneratorBundle/Generator/PagePartGenerator.php b/src/Kunstmaan/GeneratorBundle/Generator/PagePartGenerator.php index <HASH>..<HASH> 100644 --- a/src/Kunstmaan/GeneratorBundle/Generator/PagePartGenerator.php +++ b/src/Kunstmaan/GeneratorBundle/Generator/PagePartGenerator.php @@ -140,7 +140,7 @@ class PagePartGenerator extends Generator } } if (!is_null($this->prefix)) { - $class->setPrimaryTable(array('name' => strtolower($this->prefix.'_'.strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $this->entity))))); + $class->setPrimaryTable(array('name' => strtolower($this->prefix.strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $this->entity))))); } else { list($project, $bundle) = explode("\\", $this->bundle->getNameSpace()); $class->setPrimaryTable(array('name' => strtolower($project.'_'.strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $this->entity)))));
Don't append extra underscore after prefix in PagePartGenerator
Kunstmaan_KunstmaanBundlesCMS
train
php
2d383a49b71bf9003a03253fd494eb8f97307358
diff --git a/mpd/base.py b/mpd/base.py index <HASH>..<HASH> 100644 --- a/mpd/base.py +++ b/mpd/base.py @@ -117,9 +117,12 @@ class mpd_commands(object): callback. """ - def __init__(self, *commands, is_direct=False): + def __init__(self, *commands, **kwargs): self.commands = commands - self.is_direct = is_direct + self.is_direct = kwargs.pop('is_direct', False) + if kwargs: + raise AttributeError("mpd_commands() got unexpected keyword" + " arguments %s" % ",".join(kwargs)) def __call__(self, ob): ob.mpd_commands = self.commands
asyncio base modifications: Restore Python 2 compatibility The (*args, key=word) syntax was introduced with PEP <I>; this works around the missing syntax by using **kwargs; the additional check is required to avoid silently ignoring arguments.
Mic92_python-mpd2
train
py
86ac3d9e6beb5fcd858c567b4948eee75fc72bc3
diff --git a/cmd/caa-log-checker/main.go b/cmd/caa-log-checker/main.go index <HASH>..<HASH> 100644 --- a/cmd/caa-log-checker/main.go +++ b/cmd/caa-log-checker/main.go @@ -172,6 +172,8 @@ func loadMap(paths []string) (map[string][]time.Time, error) { } func main() { + logStdoutLevel := flag.Int("stdout-level", 6, "Minimum severity of messages to send to stdout") + logSyslogLevel := flag.Int("syslog-level", 6, "Minimum severity of messages to send to syslog") raLog := flag.String("ra-log", "", "Path to a single boulder-ra log file") vaLogs := flag.String("va-logs", "", "List of paths to boulder-va logs, separated by commas") timeTolerance := flag.Duration("time-tolerance", 0, "How much slop to allow when comparing timestamps for ordering") @@ -181,6 +183,11 @@ func main() { cmd.Fail("value of -time-tolerance must be non-negative") } + _ = cmd.NewLogger(cmd.SyslogConfig{ + StdoutLevel: *logStdoutLevel, + SyslogLevel: *logSyslogLevel, + }) + // Build a map from hostnames to a list of times those hostnames were checked // for CAA. checkedMap, err := loadMap(strings.Split(*vaLogs, ","))
cmd/caa-log-checker: Properly initialize logging (#<I>) Explicitly initializes the logger. Previously it ended up using the auto-initialized logging config which logged everything to "test". Added two flags stdout-level and syslog-level to control the logging filters in lieu of a config file.
letsencrypt_boulder
train
go
35b5bdf2e8e71fe48784c360be8b5ded370330f8
diff --git a/src/main/org/openscience/cdk/fingerprint/Fingerprinter.java b/src/main/org/openscience/cdk/fingerprint/Fingerprinter.java index <HASH>..<HASH> 100644 --- a/src/main/org/openscience/cdk/fingerprint/Fingerprinter.java +++ b/src/main/org/openscience/cdk/fingerprint/Fingerprinter.java @@ -204,7 +204,7 @@ public class Fingerprinter implements IFingerprinter { } } // now lets clean stuff up - List<String> cleanPath = new ArrayList<String>(); + Set<String> cleanPath = new HashSet<String>(); for (StringBuffer s : allPaths) { if (cleanPath.contains(s.toString()) || cleanPath.contains(s.reverse().toString())) continue; else cleanPath.add(s.toString());
[jonalv-fingerprint-<I>.x] first optimization brings down fingerprinting time to about <I>% of what it was before git-svn-id: <URL>
cdk_cdk
train
java
ece4c57879b2fda11cf527bcdb6edfe2685f1c9b
diff --git a/admin/report/customlang/locallib.php b/admin/report/customlang/locallib.php index <HASH>..<HASH> 100644 --- a/admin/report/customlang/locallib.php +++ b/admin/report/customlang/locallib.php @@ -111,7 +111,7 @@ class report_customlang_utils { $stringman = get_string_manager(); $components = $DB->get_records('report_customlang_components'); foreach ($components as $component) { - $sql = "SELECT stringid, s.* + $sql = "SELECT stringid, id, lang, componentid, original, master, local, timemodified, timecustomized, outdated, modified FROM {report_customlang} s WHERE lang = ? AND componentid = ? ORDER BY stringid";
MDL-<I> Fixed SQL causing error in MSSQL
moodle_moodle
train
php
88b122ce90f862216accd420e9e8ebc52b17475b
diff --git a/tap.go b/tap.go index <HASH>..<HASH> 100644 --- a/tap.go +++ b/tap.go @@ -31,17 +31,25 @@ var TapConnectFlagNames = map[TapConnectFlag]string{ FIX_FLAG_BYTEORDER: "FIX_FLAG_BYTEORDER", } -func (f TapConnectFlag) String() string { - parts := []string{} + +// Split the ORed flags into the individual bit flags. +func (f TapConnectFlag) SplitFlags() []TapConnectFlag { + rv := []TapConnectFlag{} for i := uint32(1); f != 0; i = i << 1 { if uint32(f)&i == i { - p := TapConnectFlagNames[TapConnectFlag(i)] - if p == "" { - p = fmt.Sprintf("0x%x", i) - } - parts = append(parts, p) + rv = append(rv, TapConnectFlag(i)) } f = TapConnectFlag(uint32(f) & (^i)) } - return strings.Join(parts, "|") + return rv } + +func (f TapConnectFlag) String() string { + parts := []string{} + for _, x := range f.SplitFlags() { + p := TapConnectFlagNames[x] + if p == "" { + p = fmt.Sprintf("0x%x", int(x)) + } + parts = append(parts, p) + }
Separate tap flag splitting and stringing.
dustin_gomemcached
train
go
6a2a76ff2a4ed16e697d7292749038fbb6a397c2
diff --git a/hypercorn/config.py b/hypercorn/config.py index <HASH>..<HASH> 100644 --- a/hypercorn/config.py +++ b/hypercorn/config.py @@ -12,7 +12,7 @@ from dataclasses import dataclass from ssl import SSLContext, VerifyFlags, VerifyMode # type: ignore from typing import Any, AnyStr, Dict, List, Mapping, Optional, Type, Union -import pytoml +import toml from .logging import AccessLogger @@ -267,7 +267,7 @@ class Config: """ file_path = os.fspath(filename) with open(file_path) as file_: - data = pytoml.load(file_) + data = toml.load(file_) return cls.from_mapping(data) @classmethod diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ with open(os.path.join(PROJECT_ROOT, 'README.rst')) as file_: INSTALL_REQUIRES = [ 'h11', 'h2 >= 3.1.0', - 'pytoml', + 'toml', 'typing_extensions', 'wsproto >= 0.14.0', ]
Switch from pytoml to toml pytoml is no longer maintained and recommends toml is used instead.
pgjones_hypercorn
train
py,py
2504d74754715b0ebd0aade067649db0e4fe73fa
diff --git a/hammertime/core.py b/hammertime/core.py index <HASH>..<HASH> 100644 --- a/hammertime/core.py +++ b/hammertime/core.py @@ -59,7 +59,11 @@ class HammerTime: def request(self, *args, **kwargs): if self.is_closed: - raise asyncio.CancelledError() + # Return an exception as if it were a task when attempting to request on a closed engine + future = asyncio.Future(loop=self.loop) + future.set_exception(asyncio.CancelledError()) + return future + self.stats.requested += 1 task = self.loop.create_task(self._request(*args, **kwargs)) self.tasks.append(task) diff --git a/tests/init_test.py b/tests/init_test.py index <HASH>..<HASH> 100644 --- a/tests/init_test.py +++ b/tests/init_test.py @@ -207,7 +207,7 @@ class InitTest(TestCase): self.assertTrue(hammertime.is_closed) with self.assertRaises(asyncio.CancelledError): - hammertime.request("http://example.com") + await hammertime.request("http://example.com") @async_test() async def test_interrupt_close_hammertime(self, loop):
Improve interface consistency (#<I>)
delvelabs_hammertime
train
py,py
2c8e570e393cc66e2192be6f10c6b9c9960ee73a
diff --git a/src/Billable.php b/src/Billable.php index <HASH>..<HASH> 100644 --- a/src/Billable.php +++ b/src/Billable.php @@ -266,7 +266,7 @@ trait Billable $id, $this->getStripeKey() ); - $stripeInvoice->lines = StripeInvoice::retrieve($id) + $stripeInvoice->lines = StripeInvoice::retrieve($id, $this->getStripeKey()) ->lines ->all(['limit' => 1000]);
Bug solved: accessing the Stripe invoice lines with the Stripe Key
laravel_cashier
train
php
bfdb239c464d7003bf1e8321a588a1ba422c7942
diff --git a/src/Manager.php b/src/Manager.php index <HASH>..<HASH> 100644 --- a/src/Manager.php +++ b/src/Manager.php @@ -352,7 +352,7 @@ class Manager implements ConfigurationApplier $context = $this->getContext(); $last = function ($schema, $query, $context, $params) { - return GraphQL::executeAndReturnResult($schema, $query, null, $context, $params); + return GraphQL::executeQuery($schema, $query, null, $context, $params); }; return $this->callMiddleware($schema, $query, $context, $params, $last);
Rename GraphQL::executeAndReturnResult to GraphQL::executeQuery
silverstripe_silverstripe-graphql
train
php
3f0650a8f7858e9419532aafe3ab890de6c0989f
diff --git a/paegan/transport/shoreline.py b/paegan/transport/shoreline.py index <HASH>..<HASH> 100644 --- a/paegan/transport/shoreline.py +++ b/paegan/transport/shoreline.py @@ -91,7 +91,7 @@ class Shoreline(object): # If the current point lies outside of our current shapefile index, # re-query the shapefile in a buffer around this point - if self._spatial_query_object and not ls.within(self._spatial_query_object): + if self._spatial_query_object is None or (self._spatial_query_object and not ls.within(self._spatial_query_object)): self.index(point=spoint) for element in self._geoms:
Intersect should re-index if it's never been indexed
asascience-open_paegan-transport
train
py
758ad9558797de03b17634b3b85545ff6d0c9d6d
diff --git a/test/adapters/test_middleware_test.rb b/test/adapters/test_middleware_test.rb index <HASH>..<HASH> 100644 --- a/test/adapters/test_middleware_test.rb +++ b/test/adapters/test_middleware_test.rb @@ -2,8 +2,9 @@ require File.expand_path('../../helper', __FILE__) module Adapters class TestMiddleware < Faraday::TestCase + Stubs = Faraday::Adapter.lookup_middleware(:test)::Stubs def setup - @stubs = Faraday::Adapter::Test::Stubs.new + @stubs = Stubs.new @conn = Faraday.new do |builder| builder.adapter :test, @stubs end @@ -62,7 +63,7 @@ module Adapters end def test_raises_an_error_if_no_stub_is_found_for_request - assert_raises Faraday::Adapter::Test::Stubs::NotFound do + assert_raises Stubs::NotFound do @conn.get('/invalid'){ [200, {}, []] } end end
removed autoload, caused problems with the Test adapter tests SOMETIMES
lostisland_faraday
train
rb
31da61cd5bba53798a89c31995bb0ff4fbb771dd
diff --git a/biggus/_init.py b/biggus/_init.py index <HASH>..<HASH> 100644 --- a/biggus/_init.py +++ b/biggus/_init.py @@ -2394,8 +2394,8 @@ class _StdStreamsHandler(_AggregationStreamsHandler): def bootstrap(self, processed_chunk_shape): self.k = 1 - dtype = (np.zeros(1, dtype=self.array.dtype) / 1.).dtype - self.q = np.zeros(processed_chunk_shape, dtype=dtype) + self._dtype = (np.zeros(1, dtype=self.array.dtype) / 1.).dtype + self.q = np.zeros(processed_chunk_shape, dtype=self._dtype) def finalise(self): self.q /= (self.k - self.ddof) @@ -2407,10 +2407,10 @@ class _StdStreamsHandler(_AggregationStreamsHandler): return chunk def process_data(self, data): - data = np.rollaxis(data, self.axis) + data = np.rollaxis(data, self.axis).astype(self._dtype) if self.k == 1: - self.a = data[0].copy() + self.a = data[0] data = data[1:] for data_slice in data:
Fix dtype of temporary arrays in std.
SciTools_biggus
train
py
0d0fd34a76ccdca36e390fb79576bb9d03d7db43
diff --git a/openxc/src/com/openxc/sources/BytestreamDataSource.java b/openxc/src/com/openxc/sources/BytestreamDataSource.java index <HASH>..<HASH> 100644 --- a/openxc/src/com/openxc/sources/BytestreamDataSource.java +++ b/openxc/src/com/openxc/sources/BytestreamDataSource.java @@ -22,7 +22,7 @@ public abstract class BytestreamDataSource extends ContextualVehicleDataSource private final static int READ_BATCH_SIZE = 512; private static final int MAX_FAST_RECONNECTION_ATTEMPTS = 6; protected static final int RECONNECTION_ATTEMPT_WAIT_TIME_S = 10; - protected static final int SLOW_RECONNECTION_ATTEMPT_WAIT_TIME_S = 60; + protected static final int SLOW_RECONNECTION_ATTEMPT_WAIT_TIME_S = 30; private AtomicBoolean mRunning = new AtomicBoolean(false); private int mReconnectionAttempts;
Decrease slow reconnection attempt delay from <I> to <I> seconds.
openxc_openxc-android
train
java
1966806cd0a0c85951c9340ab9b2f80c866ef40a
diff --git a/actionpack/lib/action_controller/metal/instrumentation.rb b/actionpack/lib/action_controller/metal/instrumentation.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_controller/metal/instrumentation.rb +++ b/actionpack/lib/action_controller/metal/instrumentation.rb @@ -35,6 +35,9 @@ module ActionController payload[:response] = response payload[:status] = response.status result + rescue => error + payload[:status] = ActionDispatch::ExceptionWrapper.status_code_for_exception(error.class.name) + raise ensure append_info_to_payload(payload) end
Fix instrumenting internal server errors In case of an exception we never reach setting the status in the payload so it is unset afterward. Let's catch the exception and set status based on the exception class name. Then re-raise it. This is basically the equivalent of what happens in ActionController::LogSubscriber.process_action
rails_rails
train
rb
06ed952452da474480ea75020b8900681b3ab060
diff --git a/lib/kaminari/helpers/sinatra_helpers.rb b/lib/kaminari/helpers/sinatra_helpers.rb index <HASH>..<HASH> 100644 --- a/lib/kaminari/helpers/sinatra_helpers.rb +++ b/lib/kaminari/helpers/sinatra_helpers.rb @@ -119,7 +119,7 @@ module Kaminari::Helpers query = params.merge(param_name => scope.prev_page) link_to name, env['PATH_INFO'] + (query.empty? ? '' : "?#{query.to_query}"), options.reverse_merge(:rel => 'previous') else - placeholder + placeholder.to_s.html_safe end end @@ -149,7 +149,7 @@ module Kaminari::Helpers query = params.merge(param_name => scope.next_page) link_to name, env['PATH_INFO'] + (query.empty? ? '' : "?#{query.to_query}"), options.reverse_merge(:rel => 'next') else - placeholder + placeholder.to_s.html_safe end end end
Fix faling specs for sinatra <I>
kaminari_kaminari
train
rb
5aaa70617d154d13fd772171d99a9dfe7c599d99
diff --git a/holoviews/core/data/cudf.py b/holoviews/core/data/cudf.py index <HASH>..<HASH> 100644 --- a/holoviews/core/data/cudf.py +++ b/holoviews/core/data/cudf.py @@ -282,8 +282,8 @@ class cuDFInterface(PandasInterface): if not hasattr(reindexed, agg): raise ValueError('%s aggregation is not supported on cudf DataFrame.' % agg) agg = getattr(reindexed, agg)() - data = dict(((col, [v]) for col, v in zip(agg.index, agg.to_array()))) - df = util.pd.DataFrame(data, columns=list(agg.index)) + data = dict(((col, [v]) for col, v in zip(agg.index.values_host, agg.to_array()))) + df = util.pd.DataFrame(data, columns=list(agg.index.values_host)) dropped = [] for vd in vdims:
copy index values to host for interation (#<I>)
pyviz_holoviews
train
py
8a018f5207d81e15701798243c65194fd1f80aa6
diff --git a/spacy/about.py b/spacy/about.py index <HASH>..<HASH> 100644 --- a/spacy/about.py +++ b/spacy/about.py @@ -1,6 +1,6 @@ # fmt: off __title__ = "spacy" -__version__ = "3.1.3" +__version__ = "3.2.0.dev0" __download_url__ = "https://github.com/explosion/spacy-models/releases/download" __compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json" __projects__ = "https://github.com/explosion/projects"
Set version to <I>.dev0
explosion_spaCy
train
py