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
902d72a2292e2d8454a29a4aa6b31df31932d21c
diff --git a/src/Query/Builder.php b/src/Query/Builder.php index <HASH>..<HASH> 100644 --- a/src/Query/Builder.php +++ b/src/Query/Builder.php @@ -474,7 +474,7 @@ final class Builder if ($operator == null) { $operator = '='; // @default=equal } - $query = '?? '. $operator .' '. ($params instanceof Identifier ? '??' : $escapeOperator ?: '?'); + $query = '?? '. $operator .' '. ($params instanceof Identifier ? '??' : ($escapeOperator ?: '?')); $queryParams = [$field, $params]; } else { // eg: ['id' => 1]
Query\Builder: fix unparenthesized ternary.
k-gun_oppa
train
php
a2d0cd3e15500512686004fc4313475034c95de4
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setup( license='MIT', url='https://github.com/rhempel/ev3dev-lang-python', include_package_data=True, - py_modules=['ev3dev'], + packages=['ev3dev'], install_requires=['Pillow'] )
Use packages clause in setup.py instead of py_modules Otherwise setup looks for ev3dev.py, does not find it and installs nothing. Forgot to copy this from @EricPobot's changes.
ev3dev_ev3dev-lang-python
train
py
3084588ded32cd1639a8f313595eda63a46c84d6
diff --git a/src/Store.php b/src/Store.php index <HASH>..<HASH> 100644 --- a/src/Store.php +++ b/src/Store.php @@ -6,25 +6,15 @@ use Sven\FileConfig\Drivers\Driver; class Store { - /** - * @var \Sven\FileConfig\File - */ + /** @var \Sven\FileConfig\File */ protected $file; - /** - * @var array - */ + /** @var array */ protected $config; - /** - * @var \Sven\FileConfig\Drivers\Driver - */ + /** @var \Sven\FileConfig\Drivers\Driver */ protected $driver; - /** - * @param \Sven\FileConfig\File $file - * @param \Sven\FileConfig\Drivers\Driver $driver - */ public function __construct(File $file, Driver $driver) { $this->file = $file;
Get rid of unnecessary docblocks
svenluijten_file-config
train
php
a950d4f43c030a9c9ae364f908346e4cc6c44a56
diff --git a/tests/VerbalExpressions/PHPVerbalExpressions/VerbalExpressionsTest.php b/tests/VerbalExpressions/PHPVerbalExpressions/VerbalExpressionsTest.php index <HASH>..<HASH> 100644 --- a/tests/VerbalExpressions/PHPVerbalExpressions/VerbalExpressionsTest.php +++ b/tests/VerbalExpressions/PHPVerbalExpressions/VerbalExpressionsTest.php @@ -560,8 +560,7 @@ class VerbalExpressionsTest extends PHPUnit_Framework_TestCase /** * @depends testGetRegex */ - public function testReplace() - { + public function testReplace() { $regex = new VerbalExpressions(); $regex->add('foo');
adding in a quick change to verify that psr-2 violations trigger a failed travis build
VerbalExpressions_PHPVerbalExpressions
train
php
f5de93b41ebf7576a8598246e64f283b28639cfb
diff --git a/src/test/java/org/cactoos/map/MergedTest.java b/src/test/java/org/cactoos/map/MergedTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/cactoos/map/MergedTest.java +++ b/src/test/java/org/cactoos/map/MergedTest.java @@ -59,20 +59,6 @@ public final class MergedTest { } @Test - public void behavesAsMap() { - new Assertion<>( - "Must behave as a map", - new Merged<Integer, Integer>( - new MapOf<Integer, Integer>( - new MapEntry<>(0, -1), - new MapEntry<>(1, 1) - ) - ), - new BehavesAsMap<>(1, 1) - ).affirm(); - } - - @Test public void createsMapFromMaps() { new Assertion<>( "Must merge a few maps",
(#<I>) Remove redundant test
yegor256_cactoos
train
java
1048813cd860d3b79a766d7753c7b8e8d756dee9
diff --git a/lib/rake/sprocketstask.rb b/lib/rake/sprocketstask.rb index <HASH>..<HASH> 100644 --- a/lib/rake/sprocketstask.rb +++ b/lib/rake/sprocketstask.rb @@ -49,6 +49,9 @@ module Rake # attr_accessor :assets + # Number of old assets to keep. + attr_accessor :keep + # Logger to use during rake tasks. Defaults to using stderr. # # t.logger = Logger.new($stdout) @@ -78,6 +81,7 @@ module Rake @environment = lambda { Sprockets::Environment.new(Dir.pwd) } @logger = Logger.new($stderr) @logger.level = Logger::INFO + @keep = 2 yield self if block_given? @@ -105,7 +109,7 @@ module Rake desc name == :assets ? "Clean old assets" : "Clean old #{name} assets" task "clean_#{name}" do with_logger do - manifest.clean + manifest.clean(keep) end end
Add option for number of assets to keep Fixes #<I>
rails_sprockets
train
rb
70c40a6e97713b46d1add5f15185def52f5fdbae
diff --git a/spring/src/test/java/org/jtransfo/spring/domain/BeanValidationConvertInterceptor.java b/spring/src/test/java/org/jtransfo/spring/domain/BeanValidationConvertInterceptor.java index <HASH>..<HASH> 100644 --- a/spring/src/test/java/org/jtransfo/spring/domain/BeanValidationConvertInterceptor.java +++ b/spring/src/test/java/org/jtransfo/spring/domain/BeanValidationConvertInterceptor.java @@ -31,12 +31,12 @@ public class BeanValidationConvertInterceptor implements ConvertInterceptor { T res = next.convert(source, target, isTargetTo, tags); if (!isTargetTo) { // only validate on the domain objects, not on transfer objects BindingResult bindingResult = new MapBindingResult(new HashMap(), ""); - validator.validate(target, bindingResult); + validator.validate(res, bindingResult); if (bindingResult.hasErrors()) { Set<ConstraintViolation<?>> violations = new HashSet<ConstraintViolation<?>>(); for (ObjectError error : bindingResult.getAllErrors()) { violations.add(new ConstraintViolationImpl(error.getDefaultMessage(), error.getDefaultMessage(), - target.getClass(), target, target, target, + res.getClass(), res, res, res, PathImpl.createPathFromString(error.getObjectName()), null, null)); }
#<I> and #<I> should validate result from chain, not original target
joachimvda_jtransfo
train
java
b1baa2fc54ab535b9e4a0705c17ff2253a270f1a
diff --git a/provision/docker/image.go b/provision/docker/image.go index <HASH>..<HASH> 100644 --- a/provision/docker/image.go +++ b/provision/docker/image.go @@ -50,7 +50,10 @@ func migrateImages() error { if nodeErr, ok := err.(cluster.DockerNodeError); ok { baseErr = nodeErr.BaseError() } - if err != nil && err != storage.ErrNoSuchImage && baseErr != docker.ErrNoSuchImage { + if err != nil { + if err == storage.ErrNoSuchImage || baseErr == docker.ErrNoSuchImage { + continue + } return err } if registry != "" {
provision/docker: if image is not available we shouldnt try to push it
tsuru_tsuru
train
go
3c03978dbc92c5e091fa825cadb605808d9ca1a2
diff --git a/server.js b/server.js index <HASH>..<HASH> 100644 --- a/server.js +++ b/server.js @@ -964,7 +964,10 @@ cache(function(data, match, sendBadge) { try { var data = JSON.parse(buffer); var version = data.version; - var license = data.license; + var license; + if (typeof data.license === 'string') { + license = data.license; + } else { license = data.license.type; } var platforms = Object.keys(data.platforms).join(' | '); version = version.replace(/^v/, ""); if (type === 'v') {
CocoaPods license can be a hashtable. Containing the `type` field for license information. Fixes #<I>.
badges_shields
train
js
f41618ec26b6115a2d961fa11c8851c2a8240f50
diff --git a/lib/cloud_crowd/models/job.rb b/lib/cloud_crowd/models/job.rb index <HASH>..<HASH> 100644 --- a/lib/cloud_crowd/models/job.rb +++ b/lib/cloud_crowd/models/job.rb @@ -100,7 +100,7 @@ module CloudCrowd # This job is splittable if its Action has a +split+ method. def splittable? - self.action_class.public_instance_methods.include? 'split' + self.action_class.public_instance_methods.include?(:split) end # This job is done splitting if it's finished with its splitting work units. @@ -110,7 +110,7 @@ module CloudCrowd # This job is mergeable if its Action has a +merge+ method. def mergeable? - self.processing? && self.action_class.public_instance_methods.include?('merge') + self.processing? && self.action_class.public_instance_methods.include?(:merge) end # Retrieve the class for this Job's Action.
Fixed split and merge method checking for <I>
documentcloud_cloud-crowd
train
rb
a025818c854bf13601115f9ed8ea8d73d55d8053
diff --git a/Bundle/WidgetMapBundle/Entity/WidgetMap.php b/Bundle/WidgetMapBundle/Entity/WidgetMap.php index <HASH>..<HASH> 100644 --- a/Bundle/WidgetMapBundle/Entity/WidgetMap.php +++ b/Bundle/WidgetMapBundle/Entity/WidgetMap.php @@ -212,6 +212,7 @@ class WidgetMap */ public function setReplaced($replaced) { + $replaced->addSubstitute($this); $this->replaced = $replaced; } @@ -371,7 +372,14 @@ class WidgetMap } /** - * @param mixed $substitutes + * @param WidgetMap $substitute + */ + public function addSubstitute(WidgetMap $substitute) + { + $this->substitutes->add($substitute); + } + /** + * @param [WidgetMap] $substitutes */ public function setSubstitutes($substitutes) {
set substitute when set a parent to a widget
Victoire_victoire
train
php
441068788eb648032b2da1562fe2ba06d6f50512
diff --git a/salt/modules/iptables.py b/salt/modules/iptables.py index <HASH>..<HASH> 100644 --- a/salt/modules/iptables.py +++ b/salt/modules/iptables.py @@ -466,15 +466,15 @@ def _has_check(): else: return False elif __grains__['os'] == 'Ubuntu': - if __grains__['osrelease'] > 10.04: - return False - else: + if __grains__['osrelease'] == '10.04': return True - elif __grains__['os'] == 'Debian': - if __grains__['osrelease'] > 6: - return False else: + return False + elif __grains__['os'] == 'Debian': + if __grains__['osrelease'].split('.')[0] == '6': return True + else: + return False elif __salt__['cmd.run']('iptables -h').find('--check') == -1: return True else:
Fix up debian and ubuntu checks
saltstack_salt
train
py
abc34d89beb582d7a2b059911dc4520b895e2f0f
diff --git a/chef-config/lib/chef-config/config.rb b/chef-config/lib/chef-config/config.rb index <HASH>..<HASH> 100644 --- a/chef-config/lib/chef-config/config.rb +++ b/chef-config/lib/chef-config/config.rb @@ -436,8 +436,6 @@ module ChefConfig end default :rest_timeout, 300 - default :yum_timeout, 900 - default :yum_lock_timeout, 30 default :solo, false # Are we running in old Chef Solo legacy mode?
Remove unused yum_timeout and yum_lock_timeout configs These haven't been used since we refactored the yum provider
chef_chef
train
rb
2c83ce43fb7d3a97ef7c28bc7644ce980bf009c0
diff --git a/Flickr4Java/src/main/java/com/flickr4java/flickr/photos/PhotoUtils.java b/Flickr4Java/src/main/java/com/flickr4java/flickr/photos/PhotoUtils.java index <HASH>..<HASH> 100644 --- a/Flickr4Java/src/main/java/com/flickr4java/flickr/photos/PhotoUtils.java +++ b/Flickr4Java/src/main/java/com/flickr4java/flickr/photos/PhotoUtils.java @@ -78,6 +78,7 @@ public final class PhotoUtils { photo.setMedia(photoElement.getAttribute("media")); photo.setMediaStatus(photoElement.getAttribute("media_status")); photo.setPathAlias(photoElement.getAttribute("pathalias")); + photo.setViews(photoElement.getAttribute("views")); Element peopleElement = (Element) photoElement.getElementsByTagName("people").item(0); if(peopleElement != null){
Reinstated "views" element
boncey_Flickr4Java
train
java
ab9c6b1f3bd9348c11cb76295c747a4dad7089cf
diff --git a/lib/request.js b/lib/request.js index <HASH>..<HASH> 100644 --- a/lib/request.js +++ b/lib/request.js @@ -28,6 +28,8 @@ Request.prototype.put = function(path, data, cb) { Request.prototype.completeRequest = function(method, path, cb, data) { + logger.info('Requesting Data from: https://' + this.hostname + path); + var https = require('https'), dataString = JSON.stringify(data), options = {
Added debugging to show the location of the request
getconversio_node-bigcommerce
train
js
568a7b4173667cf0fdc6b77c2cbc5a23aadb277a
diff --git a/merlin/interfaces.py b/merlin/interfaces.py index <HASH>..<HASH> 100644 --- a/merlin/interfaces.py +++ b/merlin/interfaces.py @@ -30,7 +30,7 @@ class IValidator(Interface): """ A validator for a step in an exercise. """ - def validate(userStore, submission): + def validate(submission, userStore): """ Validates a submission using the context of a user store. """
Flip order of userStore and submission in IValidator
crypto101_merlyn
train
py
90b523565e36430389c64d93c546777b4a570c89
diff --git a/lib/findJsModulesFor.js b/lib/findJsModulesFor.js index <HASH>..<HASH> 100644 --- a/lib/findJsModulesFor.js +++ b/lib/findJsModulesFor.js @@ -169,11 +169,11 @@ function findJsModulesFor(config, pathToCurrentFile, variableName) { let matchedModules = []; + matchedModules.push(...findEnvironmentCoreModules(config, variableName)); + matchedModules.push(...findImportsFromPackageJson(config, variableName)); matchedModules.push( ...findImportsFromLocalFiles(config, variableName, pathToCurrentFile) ); - matchedModules.push(...findEnvironmentCoreModules(config, variableName)); - matchedModules.push(...findImportsFromPackageJson(config, variableName)); // If you have overlapping lookup paths, you might end up seeing the same // module to import twice. In order to dedupe these, we remove the module
Find imports from local files last This order now matches the order that imports will be grouped in, which I think gives some nice symmetry. Since this list is sorted next anyway, the order that we do this in shouldn't make any difference to the user.
Galooshi_import-js
train
js
790f3c12a3fb94cb1bfcb1dc79862dba33f2266a
diff --git a/client/jetpack-connect/site-type.js b/client/jetpack-connect/site-type.js index <HASH>..<HASH> 100644 --- a/client/jetpack-connect/site-type.js +++ b/client/jetpack-connect/site-type.js @@ -35,14 +35,12 @@ class JetpackSiteType extends Component { <MainWrapper isWide> <div className="jetpack-connect__step"> <FormattedHeader - headerText={ translate( 'High performance. Solid security. Your site, just better.' ) } + headerText={ translate( 'What are we building today?' ) } subHeaderText={ translate( - 'To get started, tell us a little bit about your site goals.' + 'Choose the best starting point for your site. You can add or change features later.' ) } /> - <FormattedHeader headerText={ translate( 'What kind of site do you have?' ) } /> - <SiteTypeForm submitForm={ this.handleSubmit } /> <WpcomColophon />
Improve the copy of the NUX header, in alignment with the wpcom one. (#<I>)
Automattic_wp-calypso
train
js
596b37f15340d357e8a6903d139331c675a2211d
diff --git a/delayed/delayed_test.go b/delayed/delayed_test.go index <HASH>..<HASH> 100644 --- a/delayed/delayed_test.go +++ b/delayed/delayed_test.go @@ -27,5 +27,7 @@ func TestDelayed(t *testing.T) { } func TestDelayedAll(t *testing.T) { - dstest.SubtestAll(t, New(datastore.NewMapDatastore(), delay.Fixed(time.Millisecond))) + // Delay for virtually no time, we just want to make sure this works correctly, not that it + // delays anything. + dstest.SubtestAll(t, New(datastore.NewMapDatastore(), delay.Fixed(time.Nanosecond))) }
test: faster delaystore test We don't _actually_ need to delay here. The basic subtests don't even know that things should be delayed.
ipfs_go-datastore
train
go
cb7154a82e6aedc54df57feb5502ed45399141b4
diff --git a/test/tools/runner/index.js b/test/tools/runner/index.js index <HASH>..<HASH> 100644 --- a/test/tools/runner/index.js +++ b/test/tools/runner/index.js @@ -98,3 +98,8 @@ after(() => mock.cleanup()); require('./plugins/deferred'); require('./plugins/session_leak_checker'); require('./plugins/client_leak_checker'); + +// configure mocha and chai +require('mocha-sinon'); +const chai = require('chai'); +chai.use(require('sinon-chai'));
chore: add sinon-chai and mocha-chai for all tests
mongodb_node-mongodb-native
train
js
2582deb084a20c73b378f65979bc63dfa38b311f
diff --git a/lib/with_model/version.rb b/lib/with_model/version.rb index <HASH>..<HASH> 100644 --- a/lib/with_model/version.rb +++ b/lib/with_model/version.rb @@ -1,3 +1,3 @@ module WithModel - VERSION = "0.2.5" + VERSION = "0.2.6" end
Bumps version to cut new version of gem.
Casecommons_with_model
train
rb
f1d2d809dbf77133ef10b59fafc98f5658779bbe
diff --git a/malaffinity/exceptions.py b/malaffinity/exceptions.py index <HASH>..<HASH> 100644 --- a/malaffinity/exceptions.py +++ b/malaffinity/exceptions.py @@ -17,7 +17,7 @@ class MALAffinityException(Exception): # noqa: D204 class NoAffinityError(MALAffinityException): # noqa: D204, D205, D400 """ Raised when either the shared rated anime between the base user - and another user is less than 10, the user does not have any rated + and another user is less than 11, the user does not have any rated anime, or the standard deviation of either users' scores is zero. """ pass
Correct incorrect information in `NoAffinityError` docstring Incorrectly stated that the minimum number of shared, rated anime needed to calculate affinity was <I>, when it's actually <I>
erkghlerngm44_malaffinity
train
py
5a4ee964baf7ca3d1747b244483ca26ec8056e84
diff --git a/src/es/validation.php b/src/es/validation.php index <HASH>..<HASH> 100644 --- a/src/es/validation.php +++ b/src/es/validation.php @@ -177,5 +177,6 @@ return [ 'time' => 'hora', 'subject' => 'asunto', 'message' => 'mensaje', + 'price' => 'precio', ], ];
[es] - Add price translation to validation file.
caouecs_Laravel-lang
train
php
446b0c7a19bfc10a9227d09d77dcb94c1a522ca2
diff --git a/lib/cinchize.rb b/lib/cinchize.rb index <HASH>..<HASH> 100644 --- a/lib/cinchize.rb +++ b/lib/cinchize.rb @@ -199,6 +199,8 @@ module Cinchize pidfile = Daemons::PidFile.new dir, app_name return false if pidfile.pid.nil? return Process.kill(0, pidfile.pid) != 0 + rescue Errno::ESRCH => e + return false end end end
rescues if there's no pid to query about status
netfeed_cinchize
train
rb
67decd2eb403bd7e015ea3d01b43a7f3c977c9cb
diff --git a/request/amplify.request.js b/request/amplify.request.js index <HASH>..<HASH> 100644 --- a/request/amplify.request.js +++ b/request/amplify.request.js @@ -101,7 +101,7 @@ amplify.request.types.ajax = function( defnSettings ) { }); } - $.ajax({ + $.ajax($.extend( {}, defnSettings, { url: url, type: defnSettings.type, data: data, @@ -123,7 +123,7 @@ amplify.request.types.ajax = function( defnSettings ) { return ret && amplify.publish( "request.before.ajax", defnSettings, settings, ajaxSettings, xhr ); } - }); + }) ); }; };
Request: Pass all definition settings through to jQuery.ajax().
nodeGame_shelf.js
train
js
43dc9446117e16130b08dbe9c2459b913d83141f
diff --git a/admin/lang.php b/admin/lang.php index <HASH>..<HASH> 100644 --- a/admin/lang.php +++ b/admin/lang.php @@ -179,11 +179,14 @@ echo "<TABLE WIDTH=\"100%\" CELLPADDING=2 CELLSPACING=3 BORDER=0>"; foreach ($enstring as $key => $envalue) { $envalue = nl2br(htmlentities($envalue)); + $envalue = str_replace("\$a","<B>\$a</B>", $envalue); // Make variables bold + // TODO: It would be nice if all the $a->something variables were bold too + echo "<TR>"; echo "<TD WIDTH=20% BGCOLOR=\"$THEME->cellheading\" NOWRAP VALIGN=TOP>$key</TD>"; echo "<TD WIDTH=40% BGCOLOR=\"$THEME->cellheading\" VALIGN=TOP>$envalue</TD>"; - $value = str_replace("\\","",$string[$key]); // Delete all slashes + $value = str_replace("\\","",$string[$key]); // Delete all slashes $value = htmlentities($value); if ($editable) { echo "<TD WIDTH=40% VALIGN=TOP>";
Make $a bold so it's easier to see
moodle_moodle
train
php
573f23cee5a46d01fc58486f38b9c11ffd8525f8
diff --git a/tools/nni_cmd/launcher.py b/tools/nni_cmd/launcher.py index <HASH>..<HASH> 100644 --- a/tools/nni_cmd/launcher.py +++ b/tools/nni_cmd/launcher.py @@ -287,7 +287,7 @@ def launch_experiment(args, experiment_config, mode, config_file_name, experimen nni_config.set_config('restServerPid', rest_process.pid) # Deal with annotation if experiment_config.get('useAnnotation'): - path = os.path.join(tempfile.gettempdir(), 'nni', 'annotation') + path = os.path.join(tempfile.gettempdir(), os.environ['USER'], 'nni', 'annotation') if not os.path.isdir(path): os.makedirs(path) path = tempfile.mkdtemp(dir=path)
fix permision deny (#<I>)
Microsoft_nni
train
py
74c4d173f49bbca2eae3e4eec10bc774ad4a32df
diff --git a/chartpress.py b/chartpress.py index <HASH>..<HASH> 100755 --- a/chartpress.py +++ b/chartpress.py @@ -237,10 +237,6 @@ def build_images(prefix, images, tag=None, commit_range=None, push=False, chart_ if skip_build: continue - if tag is None and commit_range and not path_touched(*paths, commit_range=commit_range): - print(f"Skipping {name}, not touched in {commit_range}") - continue - template_namespace = { 'LAST_COMMIT': last_commit, 'TAG': image_tag,
remove duplicate Skipping-build logic caused by a merge
jupyterhub_chartpress
train
py
5dbbf0749a65dca987b3abe70adec60604bccd5e
diff --git a/app/Services/EmailService.php b/app/Services/EmailService.php index <HASH>..<HASH> 100644 --- a/app/Services/EmailService.php +++ b/app/Services/EmailService.php @@ -120,7 +120,7 @@ class EmailService * * @return Swift_Transport */ - private function transport(): Swift_Transport + protected function transport(): Swift_Transport { switch (Site::getPreference('SMTP_ACTIVE')) { case 'sendmail':
#<I> - allow EmailService::transport() to be modified
fisharebest_webtrees
train
php
bfea896f058d5d0936250484a8392a092871cac9
diff --git a/lib/row.js b/lib/row.js index <HASH>..<HASH> 100644 --- a/lib/row.js +++ b/lib/row.js @@ -126,13 +126,12 @@ Row.prototype.nameSlice = function(start, end){ /** * Slices out columns based ont their index - * @param {Number} start The starting index for the columns slice - * @param {Number} end The ending index for the columns slice + * @param {Number} start Required. An integer that specifies where to start the selection (The first columns has an index of 0). You can also use negative numbers to select from the end of the row + * @param {Number} end Optional. An integer that specifies where to end the selection. If omitted, slice() selects all elements from the start position and to the end of the row * @returns {Row} Row with the sliced out columns */ Row.prototype.slice = function(start, end){ start = start || 0; - end = end || this.length - 1; var matches = Array.prototype.slice.call(this, start, end); return new Row({ key:this.key, columns:matches }, this._schema);
fixed the way row slices and put better docs
lyveminds_scamandrios
train
js
7727c3571f737bd7959e2406f1cee8a2a8094067
diff --git a/ELiDE/layout.py b/ELiDE/layout.py index <HASH>..<HASH> 100644 --- a/ELiDE/layout.py +++ b/ELiDE/layout.py @@ -207,7 +207,13 @@ class ELiDELayout(FloatLayout): addclosefunc = BoxLayout(orientation='horizontal', size_hint_y=0.05) addfuncbut = Button(text='New') addclosefunc.add_widget(addfuncbut) - closefuncbut = Button(text='Close') + + def dismiss(*args): + self._popover.remove_widget(self._funcs_ed_window) + self._popover.dismiss() + del self._popover + + closefuncbut = Button(text='Close', on_press=dismiss) addclosefunc.add_widget(closefuncbut) @self.engine.on_time
make it possible to close the funcs editor
LogicalDash_LiSE
train
py
4cbcb1fba7e29b9ba36c42d88bae98498e8becd0
diff --git a/jicimagelib/image.py b/jicimagelib/image.py index <HASH>..<HASH> 100644 --- a/jicimagelib/image.py +++ b/jicimagelib/image.py @@ -217,10 +217,11 @@ class ImageProxy(object): @property def image(self): """Return image as numpy.ndarray.""" - tif = TIFF.open(self.fpath, 'r') - ar = tif.read_image() - tif.close() - return ar + return Image.from_file(self.fpath) +# tif = TIFF.open(self.fpath, 'r') +# ar = tif.read_image() +# tif.close() +# return ar class ImageCollection(list): """Class for storing related images."""
Refactored code so that ImageProxy.image is a jicimagelib.image.Image.
JIC-CSB_jicimagelib
train
py
6c4817279d15b632ab00cf580aa787c309733c4b
diff --git a/genomepy/genome.py b/genomepy/genome.py index <HASH>..<HASH> 100644 --- a/genomepy/genome.py +++ b/genomepy/genome.py @@ -281,14 +281,14 @@ class Genome(Fasta): Ns as values """ if not self._gap_sizes: - gap_file = self.filename + ".sizes" + gaps_file = re.sub(".fa(.gz)?$", "", self.filename) + ".gaps.bed" # generate gap file if not found - if not os.path.exists(gap_file): - generate_gap_bed(self.filename, gap_file) + if not os.path.exists(gaps_file): + generate_gap_bed(self.filename, gaps_file) self._gap_sizes = {} - with open(gap_file) as f: + with open(gaps_file) as f: for line in f: chrom, start, end = line.strip().split("\t") start, end = int(start), int(end)
fix #<I> (#<I>)
simonvh_genomepy
train
py
b77fa42ef5cdbdd501c65e3d9bdc855aaaa50584
diff --git a/styx-scheduler-service/src/main/java/com/spotify/styx/flyte/FlyteAdminClientRunner.java b/styx-scheduler-service/src/main/java/com/spotify/styx/flyte/FlyteAdminClientRunner.java index <HASH>..<HASH> 100644 --- a/styx-scheduler-service/src/main/java/com/spotify/styx/flyte/FlyteAdminClientRunner.java +++ b/styx-scheduler-service/src/main/java/com/spotify/styx/flyte/FlyteAdminClientRunner.java @@ -221,7 +221,7 @@ public class FlyteAdminClientRunner implements FlyteRunner { // TODO: add tracing tryTerminateDanglingFlyteExecutions(); } catch (Throwable t) { - LOG.warn("Error while terminating dangling flyte executions", t); + LOG.error("Error while terminating dangling flyte executions", t); } } @@ -234,6 +234,8 @@ public class FlyteAdminClientRunner implements FlyteRunner { for (var domain : project.getDomainsList()) { String paginationToken = null; do { + //TODO: explore using filters for listing only running executions + // or at least listing only the ones newer than some threshold var executions = flyteAdminClient.listExecutions(project.getId(), domain.getId(), 100, paginationToken, ""); executions.getExecutionsList().stream()
Add TODO for exploring using filters also increase the log level from warn to error
spotify_styx
train
java
cbba07450e33455259b27917c4dc22027748f8cb
diff --git a/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php b/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php +++ b/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php @@ -129,7 +129,7 @@ var refStyle = doc.createElement('style'), e.addEventListener(n, cb, false); }; -doc.documentElement.firstChild.appendChild(refStyle); +(doc.documentElement.firstElementChild || doc.documentElement.children[0]).appendChild(refStyle); if (!doc.addEventListener) { addEventListener = function (element, eventName, callback) {
[VarDumper] fixed HtmlDumper to target specific the head tag
symfony_symfony
train
php
bdd8ac96441d0212846c77e9d0b683229565bc0e
diff --git a/thumbor/detectors/__init__.py b/thumbor/detectors/__init__.py index <HASH>..<HASH> 100644 --- a/thumbor/detectors/__init__.py +++ b/thumbor/detectors/__init__.py @@ -48,10 +48,10 @@ class CascadeLoaderDetector(BaseDetector): image, self.__class__.cascade, cv.CreateMemStorage(0), - scaleFactor=1.1, - minNeighbors=3, + scale_factor=1.1, + min_neighbors=3, flags=cv.CV_HAAR_DO_CANNY_PRUNING, - minSize=(20, 20) + min_size=(20, 20) ) return faces
upz i used the names from <I> version, now its correct
thumbor_thumbor
train
py
acd8846acedf44c5d9ee532efd0b6c8e1a71dfe3
diff --git a/src/Storage/DatabaseEntriesRepository.php b/src/Storage/DatabaseEntriesRepository.php index <HASH>..<HASH> 100644 --- a/src/Storage/DatabaseEntriesRepository.php +++ b/src/Storage/DatabaseEntriesRepository.php @@ -111,11 +111,15 @@ class DatabaseEntriesRepository implements Contract, ClearableRepository, Prunab $this->storeExceptions($exceptions); - $this->table('telescope_entries')->insert($entries->map(function ($entry) { - $entry->content = json_encode($entry->content); + $table = $this->table('telescope_entries'); - return $entry->toArray(); - })->toArray()); + $entries->chunk(1000)->each(function ($chunked) use ($table) { + $table->insert($chunked->map(function ($entry) { + $entry->content = json_encode($entry->content); + + return $entry->toArray(); + })->toArray()); + }); $this->storeTags($entries->pluck('tags', 'uuid')); }
prevent heavy memory usage by saving query-log-entries in chunks into the db
laravel_telescope
train
php
7f2d881226f09de79224df250c2e947d30c8bd0e
diff --git a/core/src/main/java/io/undertow/channels/FixedLengthStreamSinkChannel.java b/core/src/main/java/io/undertow/channels/FixedLengthStreamSinkChannel.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/io/undertow/channels/FixedLengthStreamSinkChannel.java +++ b/core/src/main/java/io/undertow/channels/FixedLengthStreamSinkChannel.java @@ -341,9 +341,7 @@ public final class FixedLengthStreamSinkChannel implements StreamSinkChannel, Pr private void exitWrite(long oldVal, long consumed) { long newVal = oldVal - consumed; state = newVal; - if (allAreSet(newVal, FLAG_CLOSE_COMPLETE)) { - // closed while we were in flight. Call the listener. - callClosed(); + if (anyAreSet(oldVal, MASK_COUNT) && allAreClear(newVal, MASK_COUNT)) { callFinish(); } }
Fix bug in FixedLengthStreamSinkChannel that was breaking persistent connections
undertow-io_undertow
train
java
ef102c48865d70ff354b8ba1488d3fa8bfc116d8
diff --git a/examples/text-classification/run_xnli.py b/examples/text-classification/run_xnli.py index <HASH>..<HASH> 100755 --- a/examples/text-classification/run_xnli.py +++ b/examples/text-classification/run_xnli.py @@ -332,13 +332,15 @@ def main(): # Training if training_args.do_train: + checkpoint = None if last_checkpoint is not None: - model_path = last_checkpoint + checkpoint = last_checkpoint elif os.path.isdir(model_args.model_name_or_path): - model_path = model_args.model_name_or_path - else: - model_path = None - train_result = trainer.train(model_path=model_path) + # Check the config from that potential checkpoint has the right number of labels before using it as a + # checkpoint. + if AutoConfig.from_pretrained(model_args.model_name_or_path).num_labels == num_labels: + checkpoint = model_args.model_name_or_path + train_result = trainer.train(resume_from_checkpoint=checkpoint) metrics = train_result.metrics max_train_samples = ( data_args.max_train_samples if data_args.max_train_samples is not None else len(train_dataset)
model_path should be ignored as the checkpoint path (#<I>) * model_path is refered as the path of the trainer, and should be ignored as the checkpoint path. * Improved according to Sgugger's comment.
huggingface_pytorch-pretrained-BERT
train
py
d96be17eb6b05adeb278591eeabbbb47598c8a11
diff --git a/anytemplate/tests/import_errors.py b/anytemplate/tests/import_errors.py index <HASH>..<HASH> 100644 --- a/anytemplate/tests/import_errors.py +++ b/anytemplate/tests/import_errors.py @@ -17,4 +17,12 @@ class Test(unittest.TestCase): self.assertFalse(cls in globals()) self.assertFalse(getattr(anytemplate.globals, cls) is None) + def test_20_engines(self): + for mod in ("Cheetah", "jinja2", "mako", "tenjin", "pystache"): + sys.modules[mod] = None + import anytemplate.engine + + self.assertTrue(sys.modules[mod] is None) + self.assertFalse(anytemplate.engine is None) + # vim:sw=4:ts=4:et:
enhancement: add some more test cases to check import errors
ssato_python-anytemplate
train
py
93c641f00c627ba5859b9b1d6c609c67551d1089
diff --git a/pymc3/distributions/transforms.py b/pymc3/distributions/transforms.py index <HASH>..<HASH> 100644 --- a/pymc3/distributions/transforms.py +++ b/pymc3/distributions/transforms.py @@ -128,7 +128,7 @@ class SumTo1(Transform): name = "sumto1" def backward(self, y): - return T.concatenate([y, 1-sum(y, keepdims=True)]) + return T.concatenate([y, 1 - T.sum(y, keepdims=True)]) def forward(self, x): return x[:-1]
BUG use ``sum`` from Theano in ``SumTo1``
pymc-devs_pymc
train
py
8a18079d438d32caf42c2042785b9f44143b8fef
diff --git a/src/bidmanager.js b/src/bidmanager.js index <HASH>..<HASH> 100644 --- a/src/bidmanager.js +++ b/src/bidmanager.js @@ -277,8 +277,8 @@ exports.executeCallback = function (timedOut) { processCallbacks([externalOneTimeCallback]); } finally { - $$PREBID_GLOBAL$$.clearAuction(); externalOneTimeCallback = null; + $$PREBID_GLOBAL$$.clearAuction(); } } };
delete the callback before calling clearAuction (#<I>) fixes #<I>
prebid_Prebid.js
train
js
b91d88d8a1606722dc76cf2969b3271d514ca716
diff --git a/generated/google/apis/artifactregistry_v1beta1.rb b/generated/google/apis/artifactregistry_v1beta1.rb index <HASH>..<HASH> 100644 --- a/generated/google/apis/artifactregistry_v1beta1.rb +++ b/generated/google/apis/artifactregistry_v1beta1.rb @@ -26,7 +26,7 @@ module Google # @see https://cloud.google.com/artifacts/docs/ module ArtifactregistryV1beta1 VERSION = 'V1beta1' - REVISION = '20200612' + REVISION = '20200701' # View and manage your data across Google Cloud Platform services AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform' diff --git a/generated/google/apis/bigquery_v2.rb b/generated/google/apis/bigquery_v2.rb index <HASH>..<HASH> 100644 --- a/generated/google/apis/bigquery_v2.rb +++ b/generated/google/apis/bigquery_v2.rb @@ -25,7 +25,7 @@ module Google # @see https://cloud.google.com/bigquery/ module BigqueryV2 VERSION = 'V2' - REVISION = '20200617' + REVISION = '20200625' # View and manage your data in Google BigQuery AUTH_BIGQUERY = 'https://www.googleapis.com/auth/bigquery'
Autogenerated update (<I>-<I>-<I>) Update: - artifactregistry_v1beta1 - bigquery_v2
googleapis_google-api-ruby-client
train
rb,rb
d35f7a043f12d6226859671c8cd13591f8bf8f93
diff --git a/lib/mshoplib/tests/MShop/Service/Provider/Decorator/CostsTest.php b/lib/mshoplib/tests/MShop/Service/Provider/Decorator/CostsTest.php index <HASH>..<HASH> 100644 --- a/lib/mshoplib/tests/MShop/Service/Provider/Decorator/CostsTest.php +++ b/lib/mshoplib/tests/MShop/Service/Provider/Decorator/CostsTest.php @@ -18,21 +18,6 @@ class MShop_Service_Provider_Decorator_CostsTest extends MW_Unittest_Testcase private $_mockProvider; - /** - * Runs the test methods of this class. - * - * @access public - * @static - */ - public static function main() - { - require_once 'PHPUnit/TextUI/TestRunner.php'; - - $suite = new PHPUnit_Framework_TestSuite('MShop_Service_Provider_Decorator_OrderCheckTest'); - $result = PHPUnit_TextUI_TestRunner::run($suite); - } - - protected function setUp() { $this->_context = TestHelper::getContext();
Removes unnecessary method in unit test class
Arcavias_arcavias-core
train
php
439da79945006629574138cda127b5ac7c8affd2
diff --git a/modules/instance-switcher.php b/modules/instance-switcher.php index <HASH>..<HASH> 100644 --- a/modules/instance-switcher.php +++ b/modules/instance-switcher.php @@ -65,8 +65,8 @@ if ( ! class_exists('InstanceSwitcher') ) { */ public static function assets() { if ( is_user_logged_in() || Helpers::is_staging() ) { - wp_enqueue_script('seravo', plugins_url('../js/instance-switcher.js', __FILE__), array( 'jquery' ), Helpers::seravo_plugin_version(), false); - wp_enqueue_style('seravo', plugins_url('../style/instance-switcher.css', __FILE__), null, Helpers::seravo_plugin_version(), 'all'); + wp_enqueue_script('seravo_instance_switcher', plugins_url('../js/instance-switcher.js', __FILE__), array( 'jquery' ), Helpers::seravo_plugin_version(), false); + wp_enqueue_style('seravo_instance_switcher', plugins_url('../style/instance-switcher.css', __FILE__), null, Helpers::seravo_plugin_version(), 'all'); } }
Rename instance switcher asset handles Only using 'seravo' as handle caused some problems so they are now named properly.
Seravo_seravo-plugin
train
php
8f6cc8854110432042d4928a5236dc0654c23252
diff --git a/test/helpers/createPeers.js b/test/helpers/createPeers.js index <HASH>..<HASH> 100644 --- a/test/helpers/createPeers.js +++ b/test/helpers/createPeers.js @@ -8,7 +8,7 @@ module.exports = function(count) { function createPeer() { var peer = new EventEmitter(); - peer.send = function(data) { + peer.write = function(data) { // emit data on the other peers allPeers.filter(function(other) { return other !== peer;
Renamed send --> write
rtc-io_rtc-signaller
train
js
0cea650ec7f3226206caf8bdb4f83765bc1d5b9d
diff --git a/src/qtism/data/storage/xml/XmlDocument.php b/src/qtism/data/storage/xml/XmlDocument.php index <HASH>..<HASH> 100644 --- a/src/qtism/data/storage/xml/XmlDocument.php +++ b/src/qtism/data/storage/xml/XmlDocument.php @@ -213,7 +213,10 @@ class XmlDocument extends QtiDocument } } - if (@call_user_func_array([$doc, $loadMethod], [$data, LIBXML_COMPACT | LIBXML_NONET | LIBXML_XINCLUDE | LIBXML_PARSEHUGE])) { + if (@call_user_func_array( + [$doc, $loadMethod], + [$data, LIBXML_COMPACT | LIBXML_NONET | LIBXML_XINCLUDE | LIBXML_BIGLINES | LIBXML_PARSEHUGE]) + ) { // Infer the QTI version. try { // Prefers the version contained in the XML payload if valid.
added LIBXML_BIGLINES | LIBXML_PARSEHUGE to work with big files
oat-sa_qti-sdk
train
php
3e0bbd2f570e652375399eca8c7b57644612ae9d
diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index <HASH>..<HASH> 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -1288,3 +1288,6 @@ def test_no_brokenpipeerror_message(pytester: Pytester) -> None: ret = popen.wait() assert popen.stderr.read() == b"" assert ret == 1 + + # Cleanup. + popen.stderr.close()
testing: fix ResourceWarning in broken-pipe test
pytest-dev_pytest
train
py
95f04377cd6bac9eef4928ca005ddedb02087e07
diff --git a/vendor/plugins/refinery/lib/refinery/application_controller.rb b/vendor/plugins/refinery/lib/refinery/application_controller.rb index <HASH>..<HASH> 100644 --- a/vendor/plugins/refinery/lib/refinery/application_controller.rb +++ b/vendor/plugins/refinery/lib/refinery/application_controller.rb @@ -98,8 +98,8 @@ protected private def store_current_location! if admin? - session[:refinery_return_to] = request.path - else + session[:refinery_return_to] = request.path if request.get? and !request.xhr? # don't want to redirect to AJAX or POST/PUT/DELETE urls + elsif request.path !~ /wymiframe|\/system.*/ session[:website_return_to] = request.path end end
Add exceptions to the return to code.
refinery_refinerycms
train
rb
442fe0a3e939d41ab12013a8e089e50173b97e0b
diff --git a/blueprints/ember-eureka/index.js b/blueprints/ember-eureka/index.js index <HASH>..<HASH> 100644 --- a/blueprints/ember-eureka/index.js +++ b/blueprints/ember-eureka/index.js @@ -40,7 +40,7 @@ module.exports = { // return this.addAddonsToProject({ // packages: [ - // {name: 'ember-moment', target: '4.0.1'}, + // {name: 'ember-moment', target: '4.1.0'}, // {name: 'emberx-select', target: '2.0.1'}, // {name: 'emberek-selectize', target: 'git://github.com/namlook/emberek-selectize.git#v0.0.3'}, // {name: 'eureka-mixin-actionable-widget', target: 'git://github.com/namlook/eureka-mixin-actionable-widget.git#v0.0.2'},
upgrade to ember-moment@<I>
namlook_ember-eureka
train
js
0cf74c1eed6009d29c02dbd6c0a831af448e8915
diff --git a/src/com/google/javascript/jscomp/Tracer.java b/src/com/google/javascript/jscomp/Tracer.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/Tracer.java +++ b/src/com/google/javascript/jscomp/Tracer.java @@ -967,7 +967,7 @@ final class Tracer { /** Remove any ThreadTrace associated with the current thread */ static void clearThreadTrace() { - traces.set(null); + traces.remove(); } /**
Remove Tracer thread local storage when cleaning up. fixes issue <I> R=acleung,nicksantos DELTA=1 (0 added, 0 deleted, 1 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=<I> git-svn-id: <URL>
google_closure-compiler
train
java
1e8f358af64a25a963f5f051f59e434113f98601
diff --git a/JJG/Ping.php b/JJG/Ping.php index <HASH>..<HASH> 100644 --- a/JJG/Ping.php +++ b/JJG/Ping.php @@ -184,25 +184,22 @@ class Ping { } exec($exec_string, $output, $return); - // Strip empty lines (make results more uniform across OS versions). - $output = array_filter($output); - - //Reorder indexes from 0, - $output = array_values($output); + // Strip empty lines and reorder the indexes from 0 (to make results more + // uniform across OS versions). + $output = array_values(array_filter($output)); // If the result line in the output is not empty, parse it. if (!empty($output[1])) { - - // $array = explode(' ', $output[1]); + // Search for a 'time' value in the result line. $response = preg_match("/time(?:=|<)(?<time>[\.0-9]+)(?:|\s)ms/", $output[1], $matches); - if($response > 0 && isset($matches['time'])) + // If there's a result and it's greater than 0, return the latency. + if ($response > 0 && isset($matches['time'])) { $latency = round($matches['time']); - + } } return $latency; - } /**
PR #<I>: Code style and comment cleanup.
geerlingguy_Ping
train
php
12bed9eafcb445df166721ee273dca18b2495a7d
diff --git a/host.go b/host.go index <HASH>..<HASH> 100644 --- a/host.go +++ b/host.go @@ -403,7 +403,7 @@ func (h *Host) Create(name string) error { func (h *Host) Provision() error { // "local" providers use b2d; no provisioning necessary switch h.Driver.DriverName() { - case "none", "virtualbox", "vmwarefusion", "vmwarevsphere", "openstack": + case "none", "virtualbox", "vmwarefusion", "vmwarevsphere": return nil }
Provision OpenStack instances with Docker Since <I>f<I>, Machine doesn't check anymore if Docker is installed in the created instances, which breaks the compatibility between <I>-rc5 and <I> when using Machine with some cloud providers like RunAbove.com.
docker_machine
train
go
663e3894dd675054b2a5825c219566e7e7112227
diff --git a/oscrypto/_tls.py b/oscrypto/_tls.py index <HASH>..<HASH> 100644 --- a/oscrypto/_tls.py +++ b/oscrypto/_tls.py @@ -254,7 +254,7 @@ def _parse_tls_records(data): data_len = len(data) while pointer < data_len: # Don't try to parse any more once the ChangeCipherSpec is found - if data[pointer:pointer + 1] == '\x14': + if data[pointer:pointer + 1] == b'\x14': break length = int_from_bytes(data[pointer + 3:pointer + 5]) yield (
Fix detection of ChangeCipherSpec message during TLS record parsing
wbond_oscrypto
train
py
edd1414fa08fef8634924eb87d3e02b1399a188b
diff --git a/src/Cartalyst/Sentry/Sentry.php b/src/Cartalyst/Sentry/Sentry.php index <HASH>..<HASH> 100644 --- a/src/Cartalyst/Sentry/Sentry.php +++ b/src/Cartalyst/Sentry/Sentry.php @@ -354,10 +354,17 @@ class Sentry { * Returns the current user being * used by Sentry, if any. * + * @param bool $check * @return Cartalyst\Sentry\Users\UserInterface */ - public function getUser() + public function getUser($check = false) { + // We will lazily attempt to load our user + if ($check === true and $this->user === null) + { + $this->check(); + } + return $this->user; } diff --git a/tests/SentryTest.php b/tests/SentryTest.php index <HASH>..<HASH> 100644 --- a/tests/SentryTest.php +++ b/tests/SentryTest.php @@ -404,4 +404,12 @@ class SentryTest extends PHPUnit_Framework_TestCase { $this->assertTrue($registeredUser->isActivated()); } + public function testGetUserWithCheck() + { + $sentry = m::mock('Cartalyst\Sentry\Sentry[check]'); + $sentry->shouldReceive('check')->once(); + $sentry->getUser(); + $sentry->getUser(true); + } + }
Allowing Sentry::getUser(true) to check for the user as well as being an accessor.
cartalyst_sentry
train
php,php
0cb428b07196f194288be23745509079ad76342e
diff --git a/trustmanager/X509FileStore.go b/trustmanager/X509FileStore.go index <HASH>..<HASH> 100644 --- a/trustmanager/X509FileStore.go +++ b/trustmanager/X509FileStore.go @@ -58,12 +58,8 @@ func (s X509FileStore) AddCert(cert *x509.Certificate) error { } var filename string - if cert.Subject.CommonName != "" { - filename = path.Join(s.baseDir, cert.Subject.CommonName+certExtension) - } else { - fingerprint := FingerprintCert(cert) - filename = path.Join(s.baseDir, string(fingerprint)+certExtension) - } + fingerprint := string(FingerprintCert(cert)) + filename = path.Join(s.baseDir, cert.Subject.CommonName, fingerprint+certExtension) if err := s.addNamedCert(cert, filename); err != nil { return err
Changing the path certificates get stored in
theupdateframework_notary
train
go
711d78370b47de5c4ad1057a2c4fb8eb11180e38
diff --git a/librosa/util/decorators.py b/librosa/util/decorators.py index <HASH>..<HASH> 100644 --- a/librosa/util/decorators.py +++ b/librosa/util/decorators.py @@ -5,9 +5,8 @@ import warnings from decorator import decorator -from numba import jit as optional_jit -__all__ = ['moved', 'deprecated', 'optional_jit'] +__all__ = ['moved', 'deprecated'] def moved(moved_from, version, version_removed):
removed optional_jit decorator, should have been purged in <I> (#<I>)
librosa_librosa
train
py
46a786f6c0e099d7d7fd9851d7c734ca95f266fc
diff --git a/src/main/org/openscience/cdk/atomtype/CDKAtomTypeMatcher.java b/src/main/org/openscience/cdk/atomtype/CDKAtomTypeMatcher.java index <HASH>..<HASH> 100644 --- a/src/main/org/openscience/cdk/atomtype/CDKAtomTypeMatcher.java +++ b/src/main/org/openscience/cdk/atomtype/CDKAtomTypeMatcher.java @@ -440,9 +440,11 @@ public class CDKAtomTypeMatcher implements IAtomTypeMatcher { IAtom neighbor = cBond.getConnectedAtom(carbon); if ("O".equals(neighbor.getSymbol())) { oxygenCount++; - if (cBond.getOrder() == IBond.Order.SINGLE && neighbor.getFormalCharge() == -1) { + IBond.Order order = cBond.getOrder(); + Integer charge = neighbor.getFormalCharge(); + if (order == IBond.Order.SINGLE && charge != null && charge == -1) { singleBondedNegativeOxygenCount++; - } else if (cBond.getOrder() == IBond.Order.DOUBLE) { + } else if (order == IBond.Order.DOUBLE) { doubleBondedOxygenCount++; } }
Applied patch from cdk<I>.x: Fixed a NPE
cdk_cdk
train
java
3c81d4216fd2ae9e20879706018a1da0274d01a7
diff --git a/src/main/java/de/btobastian/javacord/entities/impl/ImplServer.java b/src/main/java/de/btobastian/javacord/entities/impl/ImplServer.java index <HASH>..<HASH> 100644 --- a/src/main/java/de/btobastian/javacord/entities/impl/ImplServer.java +++ b/src/main/java/de/btobastian/javacord/entities/impl/ImplServer.java @@ -487,7 +487,7 @@ public class ImplServer implements Server { logger.debug("Trying to ban an user from server {} (user id: {}, delete days: {})", ImplServer.this, userId, deleteDays); HttpResponse<JsonNode> response = Unirest - .put("https://discordapp.com/api/guilds/:guild_id/bans/" + userId + .put("https://discordapp.com/api/guilds/" + getId() + "/bans/" + userId + "?delete-message-days=" + deleteDays) .header("authorization", api.getToken()) .asJson();
Fix ImplServer#banUser(String, int) Fixed an issue where banUser wasn't getting the guild id properly
Javacord_Javacord
train
java
abef89dc4088a5504e24c1728dcd379987c61477
diff --git a/opc/__init__.py b/opc/__init__.py index <HASH>..<HASH> 100644 --- a/opc/__init__.py +++ b/opc/__init__.py @@ -191,7 +191,9 @@ class OPCN2: sleep(10e-3) # read the histogram - for i in range(62): + numBytes = 58 if self.firmware in [16, 17] else 62 + + for i in range(numBytes): r = self.cnxn.xfer([0x00])[0] resp.append(r) diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -__version__ = '0.0.8' +__version__ = '0.0.9' from distutils.core import setup
more bug fixes for firm <I>
dhhagan_py-opc
train
py,py
c942e4937ed4a9543ebac8a6975a2f2302f5a644
diff --git a/symphony/lib/toolkit/class.general.php b/symphony/lib/toolkit/class.general.php index <HASH>..<HASH> 100755 --- a/symphony/lib/toolkit/class.general.php +++ b/symphony/lib/toolkit/class.general.php @@ -930,7 +930,7 @@ public function getMimeType($file) { if (!empty($file)) { // in PHP 5.3 we can use 'finfo' - if (version_compare(PHP_VERSION, '5.3.0', '>=')) { + if (PHP_VERSION_ID >= 50300) { $finfo = finfo_open(FILEINFO_MIME_TYPE); $mime_type = finfo_file($finfo, $file); finfo_close($finfo);
Use constant defined by Symphony for PHP version check
symphonycms_symphony-2
train
php
d0990742881480899992be4e2395e52280931b9f
diff --git a/app/Http/Controllers/Dashboard/MetricController.php b/app/Http/Controllers/Dashboard/MetricController.php index <HASH>..<HASH> 100644 --- a/app/Http/Controllers/Dashboard/MetricController.php +++ b/app/Http/Controllers/Dashboard/MetricController.php @@ -79,7 +79,7 @@ class MetricController extends Controller $metricData['calc_type'], $metricData['display_chart'], $metricData['places'], - $metricData['view'] + $metricData['default_view'] )); } catch (ValidationException $e) { return Redirect::route('dashboard.metrics.add')
Update MetricController.php Fixed a wrong key identifier in createMetricAction method.
CachetHQ_Cachet
train
php
849d9914df77b39ef559cb3f0851d2c465a5c7fa
diff --git a/js/opusFlux/opusFlux.js b/js/opusFlux/opusFlux.js index <HASH>..<HASH> 100644 --- a/js/opusFlux/opusFlux.js +++ b/js/opusFlux/opusFlux.js @@ -69,7 +69,8 @@ var els = {}; if(($('.OpusFlux-Page').last().hasClass('is-active') && direction == 'forwards') - || ($('.OpusFlux-Page').first().hasClass('is-active') && direction == 'back')) { + || ($('.OpusFlux-Page').first().hasClass('is-active') && direction == 'back') + || $('.OpusFlux-Page.is-animating').length > 3) { return }
Limit number of pages turns at one time to 2
djgrant_heidelberg
train
js
3b39b18a5e21b2bceeceeccb3b102a1b324bcca5
diff --git a/endpoints/register.js b/endpoints/register.js index <HASH>..<HASH> 100644 --- a/endpoints/register.js +++ b/endpoints/register.js @@ -65,7 +65,7 @@ class Authentication extends Endpoint { refresh_token: null, last_ip: [] } - this.db.collection('users').insertOne(user) + await this.db.collection('users').insertOne(user) auth.saveIP.bind(this)(user.user_key, ip, 'register', true) return user.user_key
fix: Wait for actual user insertion before returning response
cubic-js_cubic
train
js
62cbc07f1cdba3b31efe7f95a3839777bd27270e
diff --git a/jogger-core/src/main/java/org/jogger/test/MockRequest.java b/jogger-core/src/main/java/org/jogger/test/MockRequest.java index <HASH>..<HASH> 100644 --- a/jogger-core/src/main/java/org/jogger/test/MockRequest.java +++ b/jogger-core/src/main/java/org/jogger/test/MockRequest.java @@ -183,11 +183,21 @@ public class MockRequest extends AbstractRequest { public Map<String, String> getHeaders() { return headers; } + + public MockRequest setHeaders(Map<String, String> headers) { + this.headers = headers; + return this; + } @Override public String getHeader(String name) { return headers.get(name); } + + public MockRequest setHeader(String name, String value) { + headers.put(name, value); + return this; + } @Override public FileItem[] getFiles() {
Modify MockRequest to add capabilities for header modification
elibom_jogger
train
java
9f4a8508d0c4ff9816fc34ca455de7a9c76551f0
diff --git a/test/test_query.rb b/test/test_query.rb index <HASH>..<HASH> 100644 --- a/test/test_query.rb +++ b/test/test_query.rb @@ -2,7 +2,6 @@ require_relative 'helper' # Test query DSL class QueryTest < Minitest::Test - def setup Bicho.client = nil end
rubocop: Extra empty line detected at class body beginning
dmacvicar_bicho
train
rb
d724064b18a30f8932ff5276531faa4deb226713
diff --git a/src/View/Helper/FormHelper.php b/src/View/Helper/FormHelper.php index <HASH>..<HASH> 100644 --- a/src/View/Helper/FormHelper.php +++ b/src/View/Helper/FormHelper.php @@ -217,10 +217,13 @@ class FormHelper extends Helper $label = ""; if (!is_null($options['label'])) { - if ($fieldHasErrors) { - $options['class'] .= " error "; - } - $label .= $this->generateLabel($options); + $labelOptions = array( + "id" => $options["id"], + "class" => $fieldHasErrors ? "error" : "", + "label" => $options["label"], + ); + + $label .= $this->generateLabel($labelOptions); } unset($options['label']); @@ -408,7 +411,7 @@ class FormHelper extends Helper */ protected function generateLabel($options) { - return sprintf('<label for="%s">%s</label>', $options['id'], $options['label']); + return sprintf('<label for="%s" class="%s">%s</label>', $options['id'], $options['class'], $options['label']); } /**
Added error class to generated label also
strata-mvc_strata
train
php
67836d9201793b12616d77b3e6ccfc46131bfe6b
diff --git a/disque/disque.go b/disque/disque.go index <HASH>..<HASH> 100644 --- a/disque/disque.go +++ b/disque/disque.go @@ -132,11 +132,11 @@ func (c *RedisClient) Add(r AddRequest) (string, error) { } if r.Retry > 0 { - args = args.Add("DELAY", int64(r.Retry.Seconds())) + args = args.Add("RETRY", int64(r.Retry.Seconds())) } if r.TTL > 0 { - args = args.Add("DELAY", int64(r.TTL.Seconds())) + args = args.Add("TTL", int64(r.TTL.Seconds())) } if r.Maxlen > 0 {
fixed job add serialization to redis
EverythingMe_go-disque
train
go
5e2205226a221f020981397c30b8bfc3418cd35f
diff --git a/fabfile.py b/fabfile.py index <HASH>..<HASH> 100644 --- a/fabfile.py +++ b/fabfile.py @@ -46,7 +46,8 @@ def _all(): 'waterfall': 'inasafe-test.localhost', 'spur': 'inasafe-test.localhost', 'maps.linfiniti.com': 'inasafe-test.linfiniti.com', - 'linfiniti': 'inasafe-crisis.linfiniti.com'} + 'linfiniti': 'inasafe-crisis.linfiniti.com' + 'hostname': 'experimental.inasafe.org'} with hide('output'): env.user = env.run('whoami') env.hostname = env.run('hostname')
Added shiva to hosts lists in fabfile
inasafe_inasafe
train
py
01e56c621366208cc4c563d11a51eaadf5cd2edc
diff --git a/test/grunt-karma-test.js b/test/grunt-karma-test.js index <HASH>..<HASH> 100644 --- a/test/grunt-karma-test.js +++ b/test/grunt-karma-test.js @@ -2,12 +2,14 @@ describe('grunt-karma', function(){ describe('one', function(){ it('should be awesome', function(){ + console.log('one'); expect('foo').to.be.a('string'); }); }); describe('two', function(){ it('should be equally awesome', function(){ + console.log('two'); expect('woot').to.be.a('string'); }); });
test: add log for sake of checking grep
karma-runner_grunt-karma
train
js
c7cc6cd42084e0af169e490a48f4686c2781bb7e
diff --git a/src/lib/DictionaryType.php b/src/lib/DictionaryType.php index <HASH>..<HASH> 100644 --- a/src/lib/DictionaryType.php +++ b/src/lib/DictionaryType.php @@ -22,7 +22,7 @@ class DictionaryType return $severity === E_WARNING ? $message === 'Illegal offset type' : preg_match('/^Resource ID#([0-9]+) used as offset, casting to integer \\(\\1\\)$/', $message); - }, E_WARNING | E_STRICT); + }, E_WARNING | (PHP_MAJOR_VERSION === 5 ? E_STRICT : E_NOTICE)); $array = iterator_to_array($array); restore_error_handler(); }
Suppress E_NOTICE error instead of E_STRICT for indexing by a resource All of the E_STRICT notices have been reclassified to other levels since PHP <I>. See <URL>
esperecyan_webidl
train
php
2a02fbe4098ead2287bf1da89000663e9e206b60
diff --git a/lib/ghtorrent/retriever.rb b/lib/ghtorrent/retriever.rb index <HASH>..<HASH> 100644 --- a/lib/ghtorrent/retriever.rb +++ b/lib/ghtorrent/retriever.rb @@ -203,7 +203,7 @@ module GHTorrent persister.store(:commit_comments, x) end } - persister.find(:commit_comments, {'commit_id' => sha}) #.map{|x| x[ext_uniq] = x['_id']; x} + persister.find(:commit_comments, {'commit_id' => sha}) end # Retrieve a single comment @@ -224,8 +224,8 @@ module GHTorrent r['user'] = user persister.store(:commit_comments, r) info "Retriever: Added commit comment #{r['commit_id']} -> #{r['id']}" - r[ext_uniq] = r['_id'] - r + persister.find(:commit_comments, {'repo' => repo, 'user' => user, + 'id' => id}).first else debug "Retriever: Commit comment #{comment['commit_id']} -> #{comment['id']} exists" comment
Ensure that a commit comment is correctly retrieved
gousiosg_github-mirror
train
rb
3673f6bc3b2243b268f96c072c940a71618821eb
diff --git a/lib/formslib.php b/lib/formslib.php index <HASH>..<HASH> 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -1339,7 +1339,9 @@ function validate_' . $this->_formName . '(frm) { return true; } /** - * This function also removes all previously defined rules. + * Hard freeze all elements in a form except those whose names are in $elementList or hidden elements in a form. + * + * This function also removes all previously defined rules of elements it freezes. * * @param array $elementList array or string of element(s) not to be frozen * @since 1.0
added more phpdoc comments for hardFreezeAllVisibleExcept
moodle_moodle
train
php
4782821f3f9eb373e5dbaa02a3fe4c23347955ce
diff --git a/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java b/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java index <HASH>..<HASH> 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java @@ -525,7 +525,17 @@ public class AsynchronousRequest extends Request { gw2API.getBackStoryQuestionInfo(processIds(ids)).enqueue(callback); } - + /** + * For more info on build API go <a href="https://wiki.guildwars2.com/wiki/API:2/build">here</a><br/> + * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see GameBuild game build info + */ + public void getCurrentGameBuild(Callback<GameBuild> callback) throws NullPointerException { + gw2API.getCurrentGameBuild().enqueue(callback); + } //Characters /**
done all game build asynchronous api
xhsun_gw2wrapper
train
java
89ca0bd66420a9b5cc5a898f2be1d97082e2d0a8
diff --git a/tests/query/netinfo/test_hostbyaddr.py b/tests/query/netinfo/test_hostbyaddr.py index <HASH>..<HASH> 100644 --- a/tests/query/netinfo/test_hostbyaddr.py +++ b/tests/query/netinfo/test_hostbyaddr.py @@ -26,7 +26,7 @@ Project link: https://github.com/funilrys/PyFunceble Project documentation: - https://pyfunceble.readthedocs.io/en/master/ + https://pyfunceble.readthedocs.io/en/dev/ Project homepage: https://pyfunceble.github.io/
fixup! Introduction of the tests of the hosts by addr query tool.
funilrys_PyFunceble
train
py
46db87b74ea0204a4664892cb9647842f729133a
diff --git a/js/lib/mediawiki.DOMPostProcessor.js b/js/lib/mediawiki.DOMPostProcessor.js index <HASH>..<HASH> 100644 --- a/js/lib/mediawiki.DOMPostProcessor.js +++ b/js/lib/mediawiki.DOMPostProcessor.js @@ -2645,7 +2645,11 @@ function unpackDOMFragments(env, node) { } var dsr = node.data.parsoid.dsr; - // FIXME: Not sure why this would be missing + // There is currently no DSR for DOMFragments nested inside + // transclusion / extension content (extension inside template + // content etc). + // TODO: Make sure that is the only reason for not having a DSR + // here. if (dsr) { var type = firstChild.getAttribute("typeof"); if (/\bmw:(Transclusion|Extension)\b/.test(type)) { @@ -2658,9 +2662,11 @@ function unpackDOMFragments(env, node) { addDeltaToDSR(firstChild, tsrDelta); } } - } else { - console.error( 'ERROR in ' + env.page.name + ': no DOMFragment wrapper dsr on ' + node.outerHTML ); } + //else { + // console.error( 'ERROR in ' + env.page.name + + // ': no DOMFragment wrapper dsr on ' + node.outerHTML ); + //} // Move the old content nodes over from the dummyNode while (firstChild) {
Disable debug print for missing DSR From investigating a few cases from the logs it looks like the main case without a DSR is a DOMFragment inside extension or transclusion content. Document this and disable the debug print, as this case is actually pretty common. Change-Id: Ibf<I>dd<I>e<I>fba8a<I>fa<I>e<I>b8e4d7cae<I>
wikimedia_parsoid
train
js
c510d22d3a1f52df4112fe1759436090ae3a3306
diff --git a/client-js/SqlpadTauChart.js b/client-js/SqlpadTauChart.js index <HASH>..<HASH> 100644 --- a/client-js/SqlpadTauChart.js +++ b/client-js/SqlpadTauChart.js @@ -212,7 +212,7 @@ var SqlpadTauChart = React.createClass({ var runResultNotification = () => { if (this.props.isRunning) { return ( - <div className='run-result-notification' style={{backgroundColor: 'rgba(250, 250, 250, 0.5)'}}> + <div className='run-result-notification' style={{backgroundColor: 'rgba(255, 255, 255, 0.5)'}}> <SpinKitCube /> </div> )
background while running to white with partial opacity
rickbergfalk_sqlpad
train
js
fb03ac2ff102cfb480b8c744e5ed265096b8102e
diff --git a/env/xml-config/src/main/java/org/eobjects/analyzer/job/JaxbJobReader.java b/env/xml-config/src/main/java/org/eobjects/analyzer/job/JaxbJobReader.java index <HASH>..<HASH> 100644 --- a/env/xml-config/src/main/java/org/eobjects/analyzer/job/JaxbJobReader.java +++ b/env/xml-config/src/main/java/org/eobjects/analyzer/job/JaxbJobReader.java @@ -267,9 +267,14 @@ public class JaxbJobReader implements JobReader<InputStream> { if (StringUtils.isNullOrEmpty(typeName)) { types.add(null); } else { - final org.eobjects.metamodel.schema.ColumnType type = org.eobjects.metamodel.schema.ColumnType - .valueOf(typeName); - types.add(type); + try { + final org.eobjects.metamodel.schema.ColumnType type = org.eobjects.metamodel.schema.ColumnType + .valueOf(typeName); + types.add(type); + } catch (IllegalArgumentException e) { + // type literal was not a valid ColumnType + types.add(null); + } } } } else {
Prevented crashing when column type in XML is not found in MetaModel's ColumnType enum
datacleaner_AnalyzerBeans
train
java
3589905a8910840a77eb6292c30a0cb388603efa
diff --git a/src/Sulu/Bundle/TestBundle/Testing/PhpcrTestCase.php b/src/Sulu/Bundle/TestBundle/Testing/PhpcrTestCase.php index <HASH>..<HASH> 100644 --- a/src/Sulu/Bundle/TestBundle/Testing/PhpcrTestCase.php +++ b/src/Sulu/Bundle/TestBundle/Testing/PhpcrTestCase.php @@ -167,8 +167,8 @@ class PhpcrTestCase extends \PHPUnit_Framework_TestCase $this->contentTypeManager, $this->structureManager, $this->sessionManager, - $this->localizationFinder, $this->eventDispatcher, + $this->localizationFinder, $this->language, $this->defaultTemplate, $this->languageNamespace
changed order in content mapper constructor
sulu_sulu
train
php
64716573fe1f03978c24becee90eb714bb9ab019
diff --git a/src/Contracts/Hydrator/HydratorInterface.php b/src/Contracts/Hydrator/HydratorInterface.php index <HASH>..<HASH> 100644 --- a/src/Contracts/Hydrator/HydratorInterface.php +++ b/src/Contracts/Hydrator/HydratorInterface.php @@ -63,6 +63,15 @@ interface HydratorInterface public function update(ResourceObjectInterface $resource, $record); /** + * Delete a domain record. + * + * @param $record + * @return bool + * whether the record was successfully destroyed. + */ + public function delete($record); + + /** * Update a domain record's relationship with data from the supplied relationship object. * * For a has-one relationship, this changes the relationship to match the supplied relationship diff --git a/tests/Hydrator/TestHydrator.php b/tests/Hydrator/TestHydrator.php index <HASH>..<HASH> 100644 --- a/tests/Hydrator/TestHydrator.php +++ b/tests/Hydrator/TestHydrator.php @@ -45,6 +45,15 @@ class TestHydrator extends AbstractHydrator */ public $dates; + /** + * @inheritDoc + */ + public function delete($record) + { + $record->destroyed = true; + + return true; + } /** * @inheritdoc
[Feature-WIP] Add delete method to the hydrator interface
cloudcreativity_json-api
train
php,php
6dbc31c1ccfa26e934323fbc93b4c4e2c45ffdef
diff --git a/Block/PageWideContent.php b/Block/PageWideContent.php index <HASH>..<HASH> 100644 --- a/Block/PageWideContent.php +++ b/Block/PageWideContent.php @@ -1,5 +1,8 @@ <?php + +/* Remark : this is now deprecated -> when using the most recent version of theme-frontend-optimus -> you can select a 1 'column wide' option on the Design tab of a cms page that does exactly the same */ + namespace StudioEmma\Optimus\Block; class PageWideContent extends \Magento\Framework\View\Element\Template
MASE2OT-<I> : added comment to old block PageWide about depecrated status
studioemma_magento2-module-optimus
train
php
4580c4746732fba52ce0076dc1c268527507cee6
diff --git a/sqlauth/__init__.py b/sqlauth/__init__.py index <HASH>..<HASH> 100644 --- a/sqlauth/__init__.py +++ b/sqlauth/__init__.py @@ -16,4 +16,4 @@ ## ############################################################################### -__version__ = "0.1.146" +__version__ = "0.1.147" diff --git a/sqlauth/scripts/sqlauthrpc.py b/sqlauth/scripts/sqlauthrpc.py index <HASH>..<HASH> 100755 --- a/sqlauth/scripts/sqlauthrpc.py +++ b/sqlauth/scripts/sqlauthrpc.py @@ -220,7 +220,7 @@ class Component(ApplicationSession): select id from login where login = %(login)s ) returning - * + id, login_id, role_id """, """ update @@ -233,7 +233,7 @@ class Component(ApplicationSession): where login = %(login)s returning - * + id, old_login as login, password, salt """ ], qa, options=types.CallOptions(timeout=2000,discloseMe=True))
sync with pypi version: <I>
lgfausak_sqlauth
train
py,py
bd8fc863d44008fe2e534c1d5125ca59f9fe5531
diff --git a/ospd/vts.py b/ospd/vts.py index <HASH>..<HASH> 100644 --- a/ospd/vts.py +++ b/ospd/vts.py @@ -23,7 +23,7 @@ import multiprocessing import re from copy import deepcopy -from typing import Dict, Any, Tuple, Type +from typing import Dict, Any, Tuple, Type, Iterator from ospd.errors import OspdError @@ -45,6 +45,14 @@ class Vts: def __contains__(self, key: str) -> bool: return key in self._vts + def __iter__(self) -> Iterator[str]: + if hasattr(self.vts, '__iter__'): + return self.vts.__iter__() + + # Use iter because python3.5 has no support for + # iteration over DictProxy. + return iter(self.vts.keys()) + def __init_vts(self): self._vts = self.storage()
Add support for the iterable protocol to Vts class Allow to iterate over a vts instance by implementing the iterable proctocol method (__iter__) which retuns an iterator.
greenbone_ospd
train
py
8dd0ccc6609e0adf962006981fa5a02da33b96d2
diff --git a/lib/purge.js b/lib/purge.js index <HASH>..<HASH> 100644 --- a/lib/purge.js +++ b/lib/purge.js @@ -132,6 +132,21 @@ function AkamaiPurgeRequestBody(urls, options) { } function AkamaiPurgeResponse(rawBody, callback) { + var body, keys; + + Object.defineProperties(this, { + '_body': { + enumerable: false, + get: function() { return body; }, + set: function(value) { body = value; } + }, + '_keys': { + enumerable: false, + get: function() { return keys; }, + set: function(value) { keys = value; } + } + }); + this.setBody(rawBody).process(callback); }
made purge body and keys properties innumerable
mrlannigan_node-akamai
train
js
856bbc9a268a8aaa4ecab6171b986a3ad5e3b384
diff --git a/parsl/executors/base.py b/parsl/executors/base.py index <HASH>..<HASH> 100644 --- a/parsl/executors/base.py +++ b/parsl/executors/base.py @@ -44,7 +44,7 @@ class ParslExecutor(metaclass=ABCMeta): pass @abstractmethod - def scale_in(self, count): + def scale_in(self, blocks): """Scale in method. Cause the executor to reduce the number of blocks by count. diff --git a/parsl/executors/swift_t.py b/parsl/executors/swift_t.py index <HASH>..<HASH> 100644 --- a/parsl/executors/swift_t.py +++ b/parsl/executors/swift_t.py @@ -343,7 +343,7 @@ class TurbineExecutor(ParslExecutor): def scaling_enabled(self): return self._scaling_enabled - def scale_out(self, workers=1): + def scale_out(self, blocks=1): """Scales out the number of active workers by 1. This method is not implemented for threads and will raise the error if called. @@ -354,7 +354,7 @@ class TurbineExecutor(ParslExecutor): """ raise NotImplementedError - def scale_in(self, workers): + def scale_in(self, blocks): """Scale in the number of active blocks by specified amount. This method is not implemented for turbine and will raise an error if called.
Make scale_in parameter name consistent in all executor classes (#<I>) This is needed in the now-less-obscure case of calling scale_in with named parameters - the base class previously said that scale_in could be called with (count=1) as a parameter but no subclasses accepted that. The terminology now pretty much is settled as 'blocks', so that is what this PR changes everything to.
Parsl_parsl
train
py,py
09436ef69deb610ae8fcadc7809767f4ac372c4b
diff --git a/locales/ka/validation.php b/locales/ka/validation.php index <HASH>..<HASH> 100644 --- a/locales/ka/validation.php +++ b/locales/ka/validation.php @@ -37,7 +37,7 @@ return [ 'date_format' => ':attribute แƒแƒ  แƒ”แƒ›แƒ—แƒฎแƒ•แƒ”แƒ•แƒ แƒ—แƒแƒ แƒ˜แƒฆแƒ˜แƒก แƒคแƒแƒ แƒ›แƒแƒขแƒก: :format.', 'different' => ':attribute แƒ“แƒ :other แƒแƒ  แƒฃแƒœแƒ“แƒ แƒ”แƒ›แƒ—แƒฎแƒ•แƒ”แƒแƒ“แƒ”แƒก แƒ”แƒ แƒ—แƒ›แƒแƒœแƒ”แƒ—แƒก.', 'digits' => ':attribute แƒฃแƒœแƒ“แƒ แƒจแƒ”แƒ“แƒ’แƒ”แƒ‘แƒแƒ“แƒ”แƒก :digits แƒชแƒ˜แƒคแƒ แƒ˜แƒกแƒ’แƒแƒœ.', - 'digits_between' => ':attribute แƒฃแƒœแƒ“แƒ แƒจแƒ”แƒ“แƒ’แƒ”แƒ‘แƒแƒ“แƒ”แƒก :min-แƒ“แƒแƒœ :max แƒชแƒ˜แƒคแƒ แƒแƒ›แƒ‘แƒ“แƒ”.', + 'digits_between' => ':attribute แƒฃแƒœแƒ“แƒ แƒจแƒ”แƒ“แƒ’แƒ”แƒ‘แƒแƒ“แƒ”แƒก :min-แƒ“แƒแƒœ :max แƒชแƒ˜แƒคแƒ แƒแƒ›แƒ“แƒ”.', 'dimensions' => ':attribute แƒจแƒ”แƒ˜แƒชแƒแƒ•แƒก แƒกแƒฃแƒ แƒแƒ—แƒ˜แƒก แƒแƒ แƒแƒกแƒฌแƒแƒ  แƒ–แƒแƒ›แƒ”แƒ‘แƒก.', 'distinct' => ':attribute-แƒ˜แƒก แƒ•แƒ”แƒšแƒก แƒแƒฅแƒ•แƒก แƒ“แƒฃแƒ‘แƒšแƒ˜แƒ แƒ”แƒ‘แƒฃแƒšแƒ˜ แƒ›แƒœแƒ˜แƒจแƒ•แƒœแƒ”แƒšแƒแƒ‘แƒ.', 'email' => ':attribute แƒฃแƒœแƒ“แƒ แƒ˜แƒงแƒแƒก แƒกแƒฌแƒแƒ แƒ˜ แƒ”แƒš.แƒคแƒแƒกแƒขแƒ.',
Incorrect word update Updated incorrect word
caouecs_Laravel-lang
train
php
80eb6849d21780b9f5f61326303fee3d9debaf98
diff --git a/lib/librarian/helpers/debug.rb b/lib/librarian/helpers/debug.rb index <HASH>..<HASH> 100644 --- a/lib/librarian/helpers/debug.rb +++ b/lib/librarian/helpers/debug.rb @@ -6,6 +6,8 @@ module Librarian include Support::AbstractMethod + LIBRARIAN_PATH = Pathname.new('../../../../').expand_path(__FILE__) + abstract_method :root_module private @@ -17,6 +19,9 @@ module Librarian def debug if root_module.ui loc = caller.find{|l| !(l =~ /in `debug'$/)} + if loc =~ /^(.+):(\d+):in `(.+)'$/ + loc = "#{Pathname.new($1).relative_path_from(LIBRARIAN_PATH)}:#{$2}:in `#{$3}'" + end root_module.ui.debug { "[Librarian] #{yield} [#{loc}]" } end end
Strip the location where librarian is installed from debugging output.
applicationsonline_librarian
train
rb
e95b4cc7749ba2ca1e6fbacdf6449265131f3556
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 @@ -28,7 +28,7 @@ class LaravelLogViewer } /** - * @return file + * @return string */ public static function getFileName() {
Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on <URL>
rap2hpoutre_laravel-log-viewer
train
php
5c50eb5bb9dad0bbfba0d584ad5d01db77002487
diff --git a/mlogmerge.py b/mlogmerge.py index <HASH>..<HASH> 100755 --- a/mlogmerge.py +++ b/mlogmerge.py @@ -1,6 +1,6 @@ #!/usr/bin/python -from util import extractDateTime +from mutil import extractDateTime from datetime import datetime, MINYEAR, MAXYEAR import argparse, re diff --git a/mplotqueries.py b/mplotqueries.py index <HASH>..<HASH> 100755 --- a/mplotqueries.py +++ b/mplotqueries.py @@ -5,7 +5,7 @@ from matplotlib.dates import date2num, DateFormatter import numpy as np import argparse import re -from util import extractDateTime +from mutil import extractDateTime from collections import defaultdict
adapted to new name "mutil.py".
rueckstiess_mtools
train
py,py
d4382f0c5fa9c6fd57d55311d48451e10dca757c
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -222,8 +222,6 @@ Crypt.prototype.maybe_encrypt = function (arg_encrypt, { if (get_key !== undefined) { - get_key_data.unshift(data); - get_key_data.push(function (err, key) { if (err) @@ -263,8 +261,6 @@ Crypt.prototype.maybe_decrypt = function (data, f, get_key) { var get_key_data = Array.prototype.slice.call(arguments, 3); - get_key_data.unshift(data); - get_key_data.push(function (err, key) { if (err)
Pass get_key callback as last argument.
davedoesdev_simple-crypt
train
js
593806c736183f26f0adbea582ff273ca3d7ec1d
diff --git a/test/99close.js b/test/99close.js index <HASH>..<HASH> 100644 --- a/test/99close.js +++ b/test/99close.js @@ -1,6 +1,7 @@ 'use strict'; -after(function () { +after(function (done) { + done(); setTimeout(function () { process.exit(); }, 500);
Added done call to make travis happy
larvit_larvituser
train
js
a12dca027c15cf6d6d578f4e6c4613fb0b484c37
diff --git a/src/main/java/com/googlecode/mp4parser/boxes/apple/AppleCoverBox.java b/src/main/java/com/googlecode/mp4parser/boxes/apple/AppleCoverBox.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/googlecode/mp4parser/boxes/apple/AppleCoverBox.java +++ b/src/main/java/com/googlecode/mp4parser/boxes/apple/AppleCoverBox.java @@ -32,5 +32,8 @@ public class AppleCoverBox extends AppleDataBox { protected int getDataLength() { return data.length; } + public byte[] getCoverData() { + return data; + } }
add accessor to data as sugested by Alden Torres. Thank you, Alden! git-svn-id: <URL>
sannies_mp4parser
train
java
1afeab0091ccb9fe50f2c98c39684fe89dc4828e
diff --git a/packages/ra-core/src/CoreAdminRouter.js b/packages/ra-core/src/CoreAdminRouter.js index <HASH>..<HASH> 100644 --- a/packages/ra-core/src/CoreAdminRouter.js +++ b/packages/ra-core/src/CoreAdminRouter.js @@ -100,7 +100,11 @@ export class CoreAdminRouter extends Component { title, } = this.props; - if (typeof children !== 'function' && !children) { + if ( + process.env.NODE_ENV !== 'production' && + typeof children !== 'function' && + !children + ) { return ( <div style={welcomeStyles}> React-admin is properly configured.<br />
Fix welcome mesage appears in production Closes #<I>
marmelab_react-admin
train
js
c467824c484b5f8591f2ad74a81e9e10b57fdc05
diff --git a/public/js/chrome/save.js b/public/js/chrome/save.js index <HASH>..<HASH> 100644 --- a/public/js/chrome/save.js +++ b/public/js/chrome/save.js @@ -150,7 +150,7 @@ if (!jsbin.saveDisabled) { } }, error: function () { - console && console.log('update error'); + window._console.error({message: 'Warning: Something went wrong while saving. Your most recent work is not saved.'}); } }); } @@ -250,7 +250,7 @@ function saveCode(method, ajax, ajaxCallback) { } }, error: function () { - + window._console.error({message: 'Warning: Something went wrong while saving. Your most recent work is not saved.'}); } }); } else {
Warning in console when save fails, fix #<I>
jsbin_jsbin
train
js
0c651e1a476feed8a01253fad608af3624973f2d
diff --git a/spec/reek/configuration/excluded_paths_spec.rb b/spec/reek/configuration/excluded_paths_spec.rb index <HASH>..<HASH> 100644 --- a/spec/reek/configuration/excluded_paths_spec.rb +++ b/spec/reek/configuration/excluded_paths_spec.rb @@ -17,7 +17,7 @@ RSpec.describe Reek::Configuration::ExcludedPaths do it 'adds the given paths as Pathname' do exclusions.add(paths) - expect(exclusions).to eq expected_exclude_paths + expect(exclusions).to match_array expected_exclude_paths end end end
Fix for #<I> to support Glob patterns in exclude_paths with match_array for rspec
troessner_reek
train
rb
f61a1a342cdc3c197d9ff0c2728b0c2902e70688
diff --git a/coinop/bit/multiwallet.py b/coinop/bit/multiwallet.py index <HASH>..<HASH> 100644 --- a/coinop/bit/multiwallet.py +++ b/coinop/bit/multiwallet.py @@ -42,12 +42,11 @@ class MultiWallet(object): if entropy: secrets = {} for name in names: - (secrets[name], tree) = create_node(name) - seeds[name] = tree.wallet_key(as_private=True) + (secrets[name], seeds[name]) = create_node(name) return secrets, cls(private=seeds, network=network) for name in names: - seeds[name] = create_node(name)[1].wallet_key(as_private=True) + seeds[name] = create_node(name)[1] return cls(private=seeds, network=network) @@ -69,8 +68,7 @@ class MultiWallet(object): def treegen(value, entropy=False): if entropy: return bip32.Wallet.from_master_secret( - value, - self.network_code(network)).wallet_key(as_private=True) + value, self.network_code(network)) else: return bip32.Wallet.from_wallet_key(value)
store node objects instead of serialized wallets
GemHQ_coinop-py
train
py
8a2d27b7df1bb3142ed540671ecaceeac2691451
diff --git a/src/reducers/form-actions-reducer.js b/src/reducers/form-actions-reducer.js index <HASH>..<HASH> 100644 --- a/src/reducers/form-actions-reducer.js +++ b/src/reducers/form-actions-reducer.js @@ -368,9 +368,11 @@ export function createFormActionsReducer(options) { // If the form is invalid (due to async validity) // but its fields are valid and the value has changed, // the form should be "valid" again. - if ((!parentForm.$form.validity - || !parentForm.$form.validity - || !Object.keys(parentForm.$form.validity).length) + const validityIsBool = typeof parentForm.$form.validity === 'boolean'; + const isInvalid = validityIsBool + ? !parentForm.$form.validity + : !Object.keys(parentForm.$form.validity).length; + if (isInvalid && !parentForm.$form.valid && isValid(parentForm, { async: false })) { return {
Preventing Object.keys from being called on a boolean
davidkpiano_react-redux-form
train
js
7c6db055a1000c64e1785d42c2b99f36f19b374e
diff --git a/code/model/entity/abstract.php b/code/model/entity/abstract.php index <HASH>..<HASH> 100644 --- a/code/model/entity/abstract.php +++ b/code/model/entity/abstract.php @@ -196,7 +196,7 @@ abstract class KModelEntityAbstract extends KObjectArray implements KModelEntity public function getProperty($name) { //Handle computed properties - if(!$this->hasProperty($name) && !empty($name)) + if(!parent::offsetExists($name) && $this->hasProperty($name)) { $getter = 'getProperty'.KStringInflector::camelize($name); $methods = $this->getMethods();
re #<I> - Also check if a computed property exists.
timble_kodekit
train
php
afee15fd8c2aca00cf8bbf518e6334bca0fa3e31
diff --git a/pycbc/inference/sampler_base.py b/pycbc/inference/sampler_base.py index <HASH>..<HASH> 100644 --- a/pycbc/inference/sampler_base.py +++ b/pycbc/inference/sampler_base.py @@ -458,7 +458,7 @@ class BaseMCMCSampler(_BaseSampler): parameters = samples.fieldnames if samples is None: return None - samples = samples.to_array(axis=-1) + samples = samples.to_array(axis=-1).astype(numpy.float64) samples_group = fp.stats_group # write data
Ensure that write float to HDF file for likelihood_stats. (#<I>)
gwastro_pycbc
train
py
59e43608ca8d6b674820cdd03f79ab37e8372104
diff --git a/src/in/srain/cube/views/GridViewWithHeaderAndFooter.java b/src/in/srain/cube/views/GridViewWithHeaderAndFooter.java index <HASH>..<HASH> 100644 --- a/src/in/srain/cube/views/GridViewWithHeaderAndFooter.java +++ b/src/in/srain/cube/views/GridViewWithHeaderAndFooter.java @@ -261,7 +261,7 @@ public class GridViewWithHeaderAndFooter extends GridView { return super.getNumColumns(); } else { try { - Field numColumns = getClass().getSuperclass().getDeclaredField("mNumColumns"); + Field numColumns = GridView.class.getDeclaredField("mNumColumns"); numColumns.setAccessible(true); return numColumns.getInt(this); } catch (Exception e) {
issue #<I>: fetch the proper class
liaohuqiu_android-GridViewWithHeaderAndFooter
train
java