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
7019888b19fb78b5f818d1c98ae7383982b607c4
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -132,10 +132,7 @@ gulp.task('html', function() { 'app/styleguide.html' ], // CSS Selectors for UnCSS to ignore - ignore: [ - /.navdrawer-container.open/, - /.app-bar.open/ - ] + ignore: [] }))) // Concatenate And Minify Styles
Gulpfile: Drop old UnCSS ignore rules
material-components_material-components-web
train
js
09de7c91707b83a6c6ff8ab1a176cc1bf92ebb4d
diff --git a/activerecord/lib/arel/collectors/composite.rb b/activerecord/lib/arel/collectors/composite.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/arel/collectors/composite.rb +++ b/activerecord/lib/arel/collectors/composite.rb @@ -24,8 +24,7 @@ module Arel # :nodoc: all [left.value, right.value] end - protected - + private attr_reader :left, :right end end diff --git a/activerecord/lib/arel/collectors/substitute_binds.rb b/activerecord/lib/arel/collectors/substitute_binds.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/arel/collectors/substitute_binds.rb +++ b/activerecord/lib/arel/collectors/substitute_binds.rb @@ -21,8 +21,7 @@ module Arel # :nodoc: all delegate.value end - protected - + private attr_reader :quoter, :delegate end end diff --git a/activerecord/lib/arel/table.rb b/activerecord/lib/arel/table.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/arel/table.rb +++ b/activerecord/lib/arel/table.rb @@ -104,8 +104,7 @@ module Arel # :nodoc: all !type_caster.nil? end - protected - + private attr_reader :type_caster end end
Use private attr_reader in Arel No longer needed workaround for Ruby <I> "private attribute?" warning. Related 6d<I>b5e<I>a<I>fe<I>afcebad<I>c3c<I>de<I>fa.
rails_rails
train
rb,rb,rb
770edef74273cf85b211cd869b5540e63c12125c
diff --git a/test/configCases/plugins/provide-plugin/index.js b/test/configCases/plugins/provide-plugin/index.js index <HASH>..<HASH> 100644 --- a/test/configCases/plugins/provide-plugin/index.js +++ b/test/configCases/plugins/provide-plugin/index.js @@ -58,6 +58,6 @@ it("should provide ES2015 modules", function() { }); it("should not provide for mjs", function(){ - var foo = require(__dirname + "/foo.mjs").default; + var foo = require("./foo.mjs").default; expect(foo()).toBe("undefined"); -}); \ No newline at end of file +});
Update test/configCases/plugins/provide-plugin/index.js
webpack_webpack
train
js
30a63d61518ce7cc2749ff8526296a19046e626e
diff --git a/webroot/js/search.js b/webroot/js/search.js index <HASH>..<HASH> 100644 --- a/webroot/js/search.js +++ b/webroot/js/search.js @@ -361,18 +361,21 @@ var search = search || {}; search.init(); - $(document).ready(function(){ + $(document).ready(function () { realoadSelect2() }) })(jQuery); /** - * Reload the select2 + * Reload the select2s */ -function realoadSelect2(){ +function realoadSelect2() +{ $('[data-class=select2]').select2({ - escapeMarkup: function (text) { return text; }, + escapeMarkup: function (text) { + return text; + }, theme: "bootstrap" }) -} \ No newline at end of file +}
Fixed some phpcs (task #<I>)
QoboLtd_cakephp-search
train
js
dc6675bc0b5537296d34e2ca6513725e9c9c63b7
diff --git a/tests/ExtendedPdoTest.php b/tests/ExtendedPdoTest.php index <HASH>..<HASH> 100644 --- a/tests/ExtendedPdoTest.php +++ b/tests/ExtendedPdoTest.php @@ -169,7 +169,7 @@ class ExtendedPdoTest extends \PHPUnit_Framework_TestCase 'bar' => 'WRONG', )); - $expect = str_replace(':list', "'1', '2', '3', '4', '5'", $stm); + $expect = str_replace(':list', ":list, :list_0, :list_1, :list_2, :list_3", $stm); $actual = $sth->queryString; $this->assertSame($expect, $actual); }
Removed old Rebuilder class and associated test.
auraphp_Aura.Sql
train
php
ccb4b20b338bf40304cb1acc5eb08e17938f0dcc
diff --git a/src/Config.php b/src/Config.php index <HASH>..<HASH> 100644 --- a/src/Config.php +++ b/src/Config.php @@ -29,10 +29,11 @@ namespace Froq\Config; use Froq\Collection\Collection; /** - * @package Froq - * @subpackage Froq\Config - * @object Froq\Config\Config - * @author Kerem Güneş <k-gun@mail.com> + * @package Froq + * @subpackage Froq\Config + * @object Froq\Config\Config + * @author Kerem Güneş <k-gun@mail.com> + * @since 1.0 */ final class Config extends Collection { diff --git a/src/ConfigException.php b/src/ConfigException.php index <HASH>..<HASH> 100644 --- a/src/ConfigException.php +++ b/src/ConfigException.php @@ -31,6 +31,7 @@ namespace Froq\Config; * @subpackage Froq\Config * @object Froq\Config\ConfigException * @author Kerem Güneş <k-gun@mail.com> + * @since 1.0 */ final class ConfigException extends \Exception {}
Add 'since' docs.
froq_froq-config
train
php,php
cd6920bd03fb73bf31d1624f53bfbb8690ffcffb
diff --git a/src/Aptoma/Silex/Provider/GuzzleServiceProvider.php b/src/Aptoma/Silex/Provider/GuzzleServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/Aptoma/Silex/Provider/GuzzleServiceProvider.php +++ b/src/Aptoma/Silex/Provider/GuzzleServiceProvider.php @@ -25,7 +25,7 @@ class GuzzleServiceProvider implements ServiceProviderInterface return $stack; }; - $app['guzzle'] = function () { + $app['guzzle'] = function () use ($app) { $client = new HttpClient([ 'handler' => $app['guzzle.handler_stack'] ]);
Fix issue with guzzle service provider
aptoma_silex-extras
train
php
f5b49f1f4255b08865bff2bcb932bffb95410ea1
diff --git a/test/test-helper.js b/test/test-helper.js index <HASH>..<HASH> 100644 --- a/test/test-helper.js +++ b/test/test-helper.js @@ -31,7 +31,7 @@ assert.emits = function(item, eventName, callback, message) { test("Should have called " + eventName, function() { assert.ok(called, message || "Expected '" + eventName + "' to be called.") }); - },2000); + },5000); item.once(eventName, function() { if (eventName === 'error') { @@ -123,7 +123,7 @@ var expect = function(callback, timeout) { var executed = false; var id = setTimeout(function() { assert.ok(executed, "Expected execution of function to be fired"); - }, timeout || 2000) + }, timeout || 5000) return function(err, queryResult) { clearTimeout(id); @@ -169,7 +169,7 @@ process.on('uncaughtException', function(err) { var count = 0; var Sink = function(expected, timeout, callback) { - var defaultTimeout = 1000; + var defaultTimeout = 5000; if(typeof timeout == 'function') { callback = timeout; timeout = defaultTimeout;
increase test timeout for travis
brianc_node-postgres
train
js
251cfb9b49c3fa2c57d4526399f07339f3324e63
diff --git a/cas_server/views.py b/cas_server/views.py index <HASH>..<HASH> 100644 --- a/cas_server/views.py +++ b/cas_server/views.py @@ -288,7 +288,8 @@ class FederateAuth(CsrfExemptView): # else, a User is trying to log in using an identity provider except FederatedIendityProvider.DoesNotExist: # Manually checking for csrf to protect the code below - reason = CsrfViewMiddleware().process_view(request, None, (), {}) + reason = CsrfViewMiddleware(lambda request: HttpResponse()) \ + .process_view(request, None, (), {}) if reason is not None: # pragma: no cover (csrf checks are disabled during tests) return reason # Failed the test, stop here. form = forms.FederateSelect(request.POST)
Construct a middleware without a get_response function is deprecated and will not work in a future release.
nitmir_django-cas-server
train
py
adb8174b64ff5e08543172a570a35b9d9be20357
diff --git a/src/Command/Cache/RebuildCommand.php b/src/Command/Cache/RebuildCommand.php index <HASH>..<HASH> 100644 --- a/src/Command/Cache/RebuildCommand.php +++ b/src/Command/Cache/RebuildCommand.php @@ -71,7 +71,8 @@ class RebuildCommand extends Command ->addArgument( 'cache', InputArgument::OPTIONAL, - $this->trans('commands.cache.rebuild.options.cache') + $this->trans('commands.cache.rebuild.options.cache'), + 'all' )->setAliases(['cr']); } @@ -112,22 +113,4 @@ class RebuildCommand extends Command return 0; } - /** - * {@inheritdoc} - */ - protected function interact(InputInterface $input, OutputInterface $output) - { - $cache = $input->getArgument('cache'); - if (!$cache) { - $cacheKeys = array_keys($this->drupalApi->getCaches()); - - $cache = $this->getIo()->choiceNoList( - $this->trans('commands.cache.rebuild.questions.cache'), - $cacheKeys, - 'all' - ); - - $input->setArgument('cache', $cache); - } - } }
Set all as default value. Remove interact mode, because we do not need anymore (#<I>)
hechoendrupal_drupal-console
train
php
599f811c7139f5b8e540802c931709eb69411524
diff --git a/src/Joomlatools/Composer/ExtensionInstaller.php b/src/Joomlatools/Composer/ExtensionInstaller.php index <HASH>..<HASH> 100644 --- a/src/Joomlatools/Composer/ExtensionInstaller.php +++ b/src/Joomlatools/Composer/ExtensionInstaller.php @@ -42,6 +42,14 @@ class ExtensionInstaller extends LibraryInstaller throw new \UnexpectedValueException($error); } + + // Clean-up to prevent PHP calling the session object's __destruct() method; + // which will burp out Fatal Errors all over the place 'cos the MySQLI connection + // has already closed at tha point. + $session = \JFactory::$session; + if(!is_null($session) && is_a($session, 'JSession')) { + $session->close(); + } } public function supports($packageType)
Prevent JSession's __destruct() bug by calling close() ourselves
joomlatools_joomlatools-composer
train
php
edd97a973c04c692275f49f9ddde1a771a7aa266
diff --git a/model/RdsResultStorage.php b/model/RdsResultStorage.php index <HASH>..<HASH> 100644 --- a/model/RdsResultStorage.php +++ b/model/RdsResultStorage.php @@ -482,10 +482,8 @@ class RdsResultStorage extends ConfigurableService } - if(isset($options['order'])){ - - $sql .= ' ORDER BY ?'; - $params[] = $options['order']; + if(isset($options['order']) && in_array($options['order'], [self::DELIVERY_COLUMN, self::TEST_TAKER_COLUMN, self::RESULTS_TABLE_ID])){ + $sql .= ' ORDER BY ' . $options['order']; if(isset($options['orderdir']) && (strtolower($options['orderdir']) === 'asc' || strtolower($options['orderdir']) === 'desc')) { $sql .= ' ' . $options['orderdir']; }
Fixed sorting for the result monitoring table
oat-sa_extension-tao-outcomerds
train
php
122b7ce55100923e157e98d1c2209e2808c45a8f
diff --git a/cdn/types.go b/cdn/types.go index <HASH>..<HASH> 100644 --- a/cdn/types.go +++ b/cdn/types.go @@ -12,7 +12,7 @@ const ( LiveStream = "liveStream" Ipaddr = "ipaddr" Domain = "domain" - OSS = "OSS" + OSS = "oss" Domestic = "domestic" Overseas = "overseas" Global = "global"
modify cdn source type OSS to oss
denverdino_aliyungo
train
go
1ea5ad8a8a6c895dbdce662d74b80059ab4e483d
diff --git a/extensions/mongodb/Cache.php b/extensions/mongodb/Cache.php index <HASH>..<HASH> 100644 --- a/extensions/mongodb/Cache.php +++ b/extensions/mongodb/Cache.php @@ -42,6 +42,7 @@ class Cache extends \yii\caching\Cache public $db = 'mongodb'; /** * @var string|array the name of the MongoDB collection that stores the cache data. + * Please refer to [[Connection::getCollection()]] on how to specify this parameter. * This collection is better to be pre-created with fields 'id' and 'expire' indexed. */ public $cacheCollection = 'cache'; @@ -49,7 +50,7 @@ class Cache extends \yii\caching\Cache * @var integer the probability (parts per million) that garbage collection (GC) should be performed * when storing a piece of data in the cache. Defaults to 100, meaning 0.01% chance. * This number should be between 0 and 1000000. A value 0 meaning no GC will be performed at all. - **/ + */ public $gcProbability = 100; /**
Doc comments for MongoDB Cache fixed.
yiisoft_yii-core
train
php
1b3aaa5ad8ca0416d258f0ffb2ba7942b8ed52da
diff --git a/src/Exception/ApiException.php b/src/Exception/ApiException.php index <HASH>..<HASH> 100644 --- a/src/Exception/ApiException.php +++ b/src/Exception/ApiException.php @@ -13,17 +13,32 @@ class ApiException extends Exception private $responseCode; /** + * @var string + */ + private $responseId; + + /** * @param string $message * @param int $responseCode + * @param string $responseId */ - public function __construct(string $message, int $responseCode) + public function __construct(string $message, int $responseCode, string $responseId) { $this->responseCode = $responseCode; + $this->responseId = $responseId; parent::__construct($message); } /** + * @return string + */ + public function getResponseId(): string + { + return $this->responseId; + } + + /** * @return int */ public function getResponseCode(): int
Added new responseId field to base exception class. (bunq/sdk_php#<I>)
bunq_sdk_php
train
php
e12bb8b6d6cd5c4088b93206ab8e1f2780631487
diff --git a/javascript/atoms/error.js b/javascript/atoms/error.js index <HASH>..<HASH> 100644 --- a/javascript/atoms/error.js +++ b/javascript/atoms/error.js @@ -52,11 +52,12 @@ bot.ErrorCode = { NO_MODAL_DIALOG_OPEN: 27, SCRIPT_TIMEOUT: 28, INVALID_ELEMENT_COORDINATES: 29, + IME_NOT_AVAILABLE: 30, + IME_ENGINE_ACTIVATION_FAILED: 31, INVALID_SELECTOR_ERROR: 32, - SQL_DATABASE_ERROR: 33, + SESSION_NOT_CREATED: 33, MOVE_TARGET_OUT_OF_BOUNDS: 34, - IME_ENGINE_ACTIVATION_FAILED: 35, - IME_NOT_AVAILABLE: 36 + SQL_DATABASE_ERROR: 35 };
DanielWagnerHall for EmmaSoderberg: Updated error codes in the firefox driver r<I>
SeleniumHQ_selenium
train
js
efd638726c154e0cb90fb40943c8e9d49c726d60
diff --git a/lib/active_admin/base_controller/authorization.rb b/lib/active_admin/base_controller/authorization.rb index <HASH>..<HASH> 100644 --- a/lib/active_admin/base_controller/authorization.rb +++ b/lib/active_admin/base_controller/authorization.rb @@ -113,7 +113,7 @@ module ActiveAdmin redirect_backwards_or_to_root end - format.csv { render text: error, status: :unauthorized } + format.csv { render body: error, status: :unauthorized } format.json { render json: { error: error }, status: :unauthorized } format.xml { render xml: "<error>#{error}</error>", status: :unauthorized } end diff --git a/spec/unit/authorization/index_overriding_spec.rb b/spec/unit/authorization/index_overriding_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/authorization/index_overriding_spec.rb +++ b/spec/unit/authorization/index_overriding_spec.rb @@ -5,7 +5,7 @@ describe Admin::PostsController, 'Index overriding', type: :controller do controller.instance_eval do def index super do - render text: 'Rendered from passed block' and return + render body: 'Rendered from passed block' and return end end end
`render text:` is deprecated
activeadmin_activeadmin
train
rb,rb
a5d1f688f99b629b6f4bdfb82ec8f23a6b2affc5
diff --git a/hamper/plugins/questions.py b/hamper/plugins/questions.py index <HASH>..<HASH> 100644 --- a/hamper/plugins/questions.py +++ b/hamper/plugins/questions.py @@ -1,6 +1,7 @@ import random from hamper.interfaces import ChatCommandPlugin, ChatPlugin, Command +from hamper.utils import ude class YesNoPlugin(ChatPlugin): @@ -21,7 +22,8 @@ class YesNoPlugin(ChatPlugin): ('I think... Yes.', 'eq'), ('Maybe. Possibly. It could be.', 'eq'), ("No. No, I don't think so.", 'eq'), ("I don't know.", 'eq'), ('Ask again later.', 'eq/2'), ('Without a doubt.', 'eq/2'), - ('Heck yes!', 'eq/2'), ("I'm sorry, I was thinking of bananas", .03), + ('Heck yes!', 'eq/2'), + ("I'm sorry, I was thinking of bananas", .03), ] total_prob = 0 @@ -50,7 +52,8 @@ class YesNoPlugin(ChatPlugin): self.responses = real_resp def message(self, bot, comm): - if comm['directed'] and comm['message'].strip()[-1] == '?': + msg = ude(comm['message'].strip()) + if comm['directed'] and msg.endswith('?'): r = random.random() for resp, prob in self.responses: r -= prob
I was seening IndexErrors occasionally
hamperbot_hamper
train
py
92c9f8864c98f212540291a0f979c7f3f691e8fe
diff --git a/src/client/Client.js b/src/client/Client.js index <HASH>..<HASH> 100644 --- a/src/client/Client.js +++ b/src/client/Client.js @@ -179,7 +179,7 @@ class Client extends BaseClient { } /** - * How long it has been since the client last entered the `READY` state + * How long it has been since the client last entered the `READY` state in milliseconds * @type {?number} * @readonly */
Specify that Client#uptime is "in milliseconds" (#<I>)
discordjs_discord.js
train
js
ba680e13afdf1609feb9a8ea34c06d2f32bbc1e8
diff --git a/lib/last-resort/commands.rb b/lib/last-resort/commands.rb index <HASH>..<HASH> 100644 --- a/lib/last-resort/commands.rb +++ b/lib/last-resort/commands.rb @@ -67,7 +67,9 @@ module LastResort create_heroku_project unless @no_heroku create_env `git push heroku master` unless @no_heroku - + puts 'Next steps:' + puts "1) cd #{project_name}" + puts "2) last-resort run" Dir.chdir("#{old_dir}") end
Added instrunctions at the end
ianha_LastResort
train
rb
18bfc79b4bdc1d905d90696a987a1cbb17c65612
diff --git a/src/main/java/com/owlplatform/sensor/SensorAggregatorInterface.java b/src/main/java/com/owlplatform/sensor/SensorAggregatorInterface.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/owlplatform/sensor/SensorAggregatorInterface.java +++ b/src/main/java/com/owlplatform/sensor/SensorAggregatorInterface.java @@ -173,7 +173,7 @@ public class SensorAggregatorInterface { /** * The port number the aggregator is listening on for sensors. */ - private int port = -1; + private int port = 7007; /** * The session of the connected aggregator, or {@code null} if no connection
Fixing default port for aggregator.
OwlPlatform_java-owl-sensor
train
java
35b87dc13919637f45bff7dc07f0859f1598d122
diff --git a/tests/test__data.py b/tests/test__data.py index <HASH>..<HASH> 100644 --- a/tests/test__data.py +++ b/tests/test__data.py @@ -271,6 +271,18 @@ class Test_fitter(_ut.TestCase): value_from_bevington = 1.5 self.assertAlmostEqual(value_from_fit, value_from_bevington, 1) + def test_reduced_chi_squareds_return_type(self): + self.databox.load_file(path=self.data_path) + func = 'a1 + a2*x + a3*x**2.' + params = 'a1=-1., a2=0.04, a3=0.00006' + f = _dt.fitter(f=func, p=params, autoplot=False) + f.set_data(self.databox[0], self.databox[1], 0.05) + f.fit() + + value_from_fit = f.reduced_chi_squareds() + expected_type = list + self.assertIs(type(value_from_fit), expected_type) + if __name__ == "__main__": _ut.main()
Test the type output of the fitting function. It has changed to list from float.
Spinmob_spinmob
train
py
102188b33759344cc6e29a164f0e3adb166679bd
diff --git a/spyderlib/otherplugins.py b/spyderlib/otherplugins.py index <HASH>..<HASH> 100644 --- a/spyderlib/otherplugins.py +++ b/spyderlib/otherplugins.py @@ -26,7 +26,8 @@ def _get_spyderplugins(plugin_path): continue plist.append(dirname.name) for name in plugin_path.files(pattern="*.py"): - plist.append(name.namebase) + if name.name != "__init__.py": + plist.append(name.namebase) return plist
Don't import __init__.py as a plugin
spyder-ide_spyder
train
py
4f789deeaea0d637a6107504b9d255824f682ca0
diff --git a/skyfield/timescales.py b/skyfield/timescales.py index <HASH>..<HASH> 100644 --- a/skyfield/timescales.py +++ b/skyfield/timescales.py @@ -126,6 +126,11 @@ class JulianDate(object): # Conversion between timescales. + if name == 'tdb': + tt = self.tt + self.tdb = tdb = tt + tdb_minus_tt(tt) * S_DAY + return tdb + delta_t = self.delta_t d = self.__dict__ i = _sequence_indexes.get(name, None) @@ -168,8 +173,6 @@ class JulianDate(object): if i == _TT: return tt - self.tdb = tdb = tt + tdb_minus_tt(tt) * S_DAY - return tdb def julian_date(year, month=1, day=1, hour=0.0, minute=0.0, second=0.0): janfeb = month < 3
Move TDB computation simply rely on "self.tt" call
skyfielders_python-skyfield
train
py
2cac682246964279895b94e49377fa379682672c
diff --git a/src/to_markdown.js b/src/to_markdown.js index <HASH>..<HASH> 100644 --- a/src/to_markdown.js +++ b/src/to_markdown.js @@ -237,6 +237,7 @@ export class MarkdownSerializerState { // Render the given node as a block. render(node, parent, index) { if (typeof parent == "number") throw new Error("!") + if (!this.nodes[node.type.name]) throw new Error("Token type `" + node.type.name + "` not supported by Markdown renderer") this.nodes[node.type.name](this, node, parent, index) }
Add renderering error if renderer is not defined This helps with debugging new renderers.
ProseMirror_prosemirror-markdown
train
js
59edf020e5a8ad064be4c2651b0be7cb0b0b0775
diff --git a/contrib/externs/angular-1.3.js b/contrib/externs/angular-1.3.js index <HASH>..<HASH> 100644 --- a/contrib/externs/angular-1.3.js +++ b/contrib/externs/angular-1.3.js @@ -267,7 +267,7 @@ angular.Animation.removeClass = function(element, done) {}; * @typedef {{ * $attr: Object.<string,string>, * $normalize: function(string): string, - * $observe: function(string, function(*)): function(*), + * $observe: function(string, function(*)): function(), * $set: function(string, ?(string|boolean), boolean=, string=) * }} */ @@ -303,7 +303,7 @@ angular.Attributes.$normalize = function(name) {}; /** * @param {string} key * @param {function(*)} fn - * @return {function(*)} + * @return {function()} */ angular.Attributes.$observe = function(key, fn) {};
Update JSDoc for attr.$observe In <I> $observe() returns deregistration function that does not accept any arguments (same as $watch). ------------- Created by MOE: <URL>
google_closure-compiler
train
js
439bce4bdce75cd0b9158f48d63931d8e6b15970
diff --git a/queryx.go b/queryx.go index <HASH>..<HASH> 100644 --- a/queryx.go +++ b/queryx.go @@ -134,21 +134,22 @@ func bindStructArgs(names []string, arg0 interface{}, arg1 map[string]interface{ v = v.Elem() } - fields := m.TraversalsByName(v.Type(), names) - for i, t := range fields { + err := m.TraversalsByNameFunc(v.Type(), names, func(i int, t []int) error { if len(t) != 0 { val := reflectx.FieldByIndexesReadOnly(v, t) arglist = append(arglist, val.Interface()) } else { val, ok := arg1[names[i]] if !ok { - return arglist, fmt.Errorf("could not find name %q in %#v and %#v", names[i], arg0, arg1) + return fmt.Errorf("could not find name %q in %#v and %#v", names[i], arg0, arg1) } arglist = append(arglist, val) } - } - return arglist, nil + return nil + }) + + return arglist, err } // BindMap binds query named parameters using map.
avoid one allocation when binding structs
scylladb_gocqlx
train
go
40f5351ed9a8e41cb1fb1765aeb6a5b5a39f4913
diff --git a/lib/config/postcss.js b/lib/config/postcss.js index <HASH>..<HASH> 100644 --- a/lib/config/postcss.js +++ b/lib/config/postcss.js @@ -118,8 +118,8 @@ module.exports = function (options, webpackConfig) { onSaveSpritesheet: spritesOnSaveSpritesheet } }), - discernFontSVG(), - postcssIconFont(svg2fontOptions) + postcssIconFont(svg2fontOptions), + discernFontSVG() ]; }; }; @@ -142,7 +142,7 @@ function discernFontSVG() { searchValue = '.svg'; index = decl.value.indexOf(searchValue); if (index > -1) { - decl.value = strSplice(decl.value, index + searchValue.length, 0, '__font'); + decl.value = strSplice(decl.value, index + searchValue.length, 0, '?__font'); return false; } }
refactor: postcss插件执行顺序更新
zuzucheFE_guido
train
js
75fe301eeee33ca313ca863a850b284a14955372
diff --git a/src/modules/getAnimationPromises.js b/src/modules/getAnimationPromises.js index <HASH>..<HASH> 100644 --- a/src/modules/getAnimationPromises.js +++ b/src/modules/getAnimationPromises.js @@ -1,5 +1,5 @@ import { queryAll } from '../utils'; -import { transitionEnd } from '../helpers'; +import { transitionEnd, transitionProperty } from '../helpers'; const getAnimationPromises = function() { const promises = []; @@ -9,7 +9,15 @@ const getAnimationPromises = function() { console.error(`No animated elements found by selector ${this.options.animationSelector}`); return [Promise.resolve()]; } + animatedElements.forEach((element) => { + const transitionDuration = window.getComputedStyle(element)[`${transitionProperty()}Duration`]; + // Resolve immediately if no transition defined + if (!transitionDuration || transitionDuration == '0s') { + console.error(`No CSS transition defined for element of selector ${this.options.animationSelector}`); + promises.push(Promise.resolve()); + return; + } const promise = new Promise((resolve) => { element.addEventListener(transitionEnd(), (event) => { if (element == event.target) { @@ -19,6 +27,7 @@ const getAnimationPromises = function() { }); promises.push(promise); }); + return promises; };
Warn and resolve immediately if no transition found on animated elements
gmrchk_swup
train
js
19f618d57c58e484e8903aa96d7bbfa6cad4eefe
diff --git a/includes/Config/Config.php b/includes/Config/Config.php index <HASH>..<HASH> 100644 --- a/includes/Config/Config.php +++ b/includes/Config/Config.php @@ -25,7 +25,7 @@ class Config { * @param mixed $config Optional user defined config path */ public function __construct($config = false) { - $this->set_root($this->fix_win32_path( dirname(dirname(dirname(__DIR__))) )); + $this->set_root( $this->fix_win32_path( dirname( dirname( __DIR__ ) ) ) ); $this->set_config($config); }
Exception - Cannot find config.php - Wrong Directory Bug - Subdirectory Install The YOURLS directory was removed but the dirname() structure was not changed. Throws exception - Cannot find config.php - in subdirectory install.
YOURLS_YOURLS
train
php
6634d121a831452989f9f94ab310323979bd324c
diff --git a/lib/ronin/program/commands/help.rb b/lib/ronin/program/commands/help.rb index <HASH>..<HASH> 100644 --- a/lib/ronin/program/commands/help.rb +++ b/lib/ronin/program/commands/help.rb @@ -29,17 +29,19 @@ module Ronin command :help - options('[COMMAND]') do |opts| - opts.arguments do - opts.arg('COMMAND','The command to view') - end + def define_options(opts) + opts.usage = '[COMMAND]' + + opts.arguments { + 'COMMAND' => 'The command to view' + } opts.summary('View a list of supported commands or information on a specific command') end def arguments(*args) - unless args.length<=1 - fail('help: only one command maybe specified') + if args.length > 1 + fail('only one command maybe specified') end success { Program.help(args.first) }
Refactored the HelpCommand.
ronin-ruby_ronin
train
rb
dcb093b7b99f4a35af9fc43f45c6076c918ffaf3
diff --git a/client/html/src/Client/Html/Checkout/Standard/Process/Standard.php b/client/html/src/Client/Html/Checkout/Standard/Process/Standard.php index <HASH>..<HASH> 100644 --- a/client/html/src/Client/Html/Checkout/Standard/Process/Standard.php +++ b/client/html/src/Client/Html/Checkout/Standard/Process/Standard.php @@ -291,8 +291,6 @@ class Standard if( $basket->getPrice()->getValue() + $basket->getPrice()->getCosts() <= '0.00' ) { $orderItem->setPaymentStatus( \Aimeos\MShop\Order\Item\Base::PAY_RECEIVED ); - $orderItem->setDatePayment( date( 'Y-m-d H:i:s' ) ); - $orderCntl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'order' ); $orderCntl->saveItem( $orderItem );
Payment date is set in order item automatically
aimeos_ai-client-html
train
php
c9c37fd6ce0247943d1aa34fc3813c62c5cb0225
diff --git a/github/github_test.go b/github/github_test.go index <HASH>..<HASH> 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -392,8 +392,7 @@ func TestDo_sanitizeURL(t *testing.T) { if err == nil { t.Fatal("Expected error to be returned.") } - if !strings.Contains(err.Error(), "client_secret=REDACTED") || - strings.Contains(err.Error(), "client_secret=secret") { + if strings.Contains(err.Error(), "client_secret=secret") { t.Errorf("Do error contains secret, should be redacted:\n%q", err) } }
Don't require client_secret to be present. Only test that secret is not included. It seems versions of Go <I> and older did not include the URL query parameters.
google_go-github
train
go
6a3a54589e69b219751e61ac360fa26b563c7106
diff --git a/pprofile.py b/pprofile.py index <HASH>..<HASH> 100755 --- a/pprofile.py +++ b/pprofile.py @@ -174,8 +174,12 @@ class ProfileBase(object): # Ignore profiling code. __file__ does not always provide consistent # results with f_code.co_filename (ex: easy_install with zipped egg), # so inspect current frame instead. - # XXX: assumes all of pprofile code resides in a single file. - result.discard(inspect.currentframe().f_code.co_filename) + # Get current file from one of pprofile methods. Compatible with + # implementations that do not have the inspect.currentframe() method + # (e.g. IronPython). + # XXX: Assumes that all of pprofile code is in a single file. + # XXX: Assumes that _initStack exists in pprofile module. + result.discard(inspect.getsourcefile(_initStack)) return result def _getFileNameList(self, filename):
Make pprofile compatible with IronPython. IronPython does not implement the inspect.currentframe() method completely, I replaced it with another way to find the path to the current file. Vincent Pelletier: Word-wrapped at <I>.
vpelletier_pprofile
train
py
3ad3385586a47d20097d02969981c0c18db180e2
diff --git a/workshift/models.py b/workshift/models.py index <HASH>..<HASH> 100644 --- a/workshift/models.py +++ b/workshift/models.py @@ -522,6 +522,26 @@ class WorkshiftInstance(models.Model): def pool(self): return self.get_info().pool + def mark_blown(self, accuser, note=None): + ''' + Marks this workshift instance as blown, saves the object automatically. + ''' + self.blown = True + self.closed = True + self.save() + + entry = ShiftLogEntry( + person=accuser, + note=note, + entry_type=ShiftLogEntry.BLOWN, + ) + entry.save() + + self.log.add(entry) + self.save() + + # TODO: Modify workshifter's profile + def __init__(self, *args, **kwargs): super(WorkshiftInstance, self).__init__(*args, **kwargs) if (self.weekly_workshift is None and self.info is None) or \
Added method to workshiftinstance to mark a shift as blown
knagra_farnsworth
train
py
a59ec51211116a8b2fa11d437abac94adbbe445f
diff --git a/libraries/joomla/form/form.php b/libraries/joomla/form/form.php index <HASH>..<HASH> 100644 --- a/libraries/joomla/form/form.php +++ b/libraries/joomla/form/form.php @@ -718,8 +718,7 @@ class JForm $dom = dom_import_simplexml($current); $dom->parentNode->removeChild($dom); } - - // else + else { unset($field); }
Fix commented out else keyword in JForm
joomla_joomla-framework
train
php
c8d549e7316efaf245e12a4315332516322e4854
diff --git a/pcef/core/editor.py b/pcef/core/editor.py index <HASH>..<HASH> 100644 --- a/pcef/core/editor.py +++ b/pcef/core/editor.py @@ -206,6 +206,7 @@ class QCodeEdit(QtGui.QPlainTextEdit): self.textChanged.connect(self.__ontextChanged) self.updateRequest.connect(self.__updatePanels) self.cursorPositionChanged.connect(self.refreshPanels) + self.document().blockCountChanged.connect(self.refreshPanels) self.setMouseTracking(True)
Also force repaint if blockCountChanged
pyQode_pyqode.core
train
py
1436a11877efc5babc60fc14f4f6b7683395b3f7
diff --git a/modernrpc/core.py b/modernrpc/core.py index <HASH>..<HASH> 100644 --- a/modernrpc/core.py +++ b/modernrpc/core.py @@ -165,7 +165,7 @@ class RPCMethod(object): import markdown return markdown.markdown(docstring) - return "<p>{}</p>".format(docstring.replace('\n\n', '</p><p>').replace('\n', '<br/')) + return "<p>{}</p>".format(docstring.replace('\n\n', '</p><p>').replace('\n', ' ')) def check_permissions(self, request): """Call the predicate(s) associated with the RPC method, to check if the current request
Convert single newlines into a space in HTML docs.
alorence_django-modern-rpc
train
py
ace0db770777859dc9e8645676e2e7c1328cbc84
diff --git a/tests/PeclUuidTest.php b/tests/PeclUuidTest.php index <HASH>..<HASH> 100644 --- a/tests/PeclUuidTest.php +++ b/tests/PeclUuidTest.php @@ -36,6 +36,10 @@ class PeclUuidTest extends \PHPUnit_Framework_TestCase public function testUuid1WithoutParametersIsNotDelegated() { + if (defined('HHVM_VERSION')) { + $this->markTestSkipped('PECL Uuid extension not available in HHVM'); + } + $this->mockFactory->expects($this->never()) ->method('uuid1'); @@ -87,6 +91,10 @@ class PeclUuidTest extends \PHPUnit_Framework_TestCase public function testUuid4WithParametersIsNeverDelegated() { + if (defined('HHVM_VERSION')) { + $this->markTestSkipped('PECL Uuid extension not available in HHVM'); + } + $this->mockFactory->expects($this->never()) ->method('uuid4');
Skip tests that cannot succeed with HHVM
ramsey_uuid
train
php
c5b073578685061f5f91b6d7ab8451d5b94b7769
diff --git a/localshop/settings.py b/localshop/settings.py index <HASH>..<HASH> 100644 --- a/localshop/settings.py +++ b/localshop/settings.py @@ -160,6 +160,7 @@ class Base(Settings): BROKER_URL = "django://" + CELERY_ACCEPT_CONTENT = ['json'] CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler' CELERYD_FORCE_EXECV = False CELERYBEAT_SCHEDULE = { @@ -248,6 +249,12 @@ class Base(Settings): LOCALSHOP_VERSIONING_TYPE = None + # AWS S3 Settings + AWS_ACCESS_KEY_ID = values.Value() + AWS_SECRET_ACCESS_KEY = values.Value() + AWS_STORAGE_BUCKET_NAME = values.Value() + + class TestConfig(Base): SECRET_KEY = 'TEST-KEY'
Add AWS_ settings for s3 boto
mvantellingen_localshop
train
py
b27de2e6f6ff137882827239577c20feeebde08c
diff --git a/Form/Event/CollectionEventSubscriber.php b/Form/Event/CollectionEventSubscriber.php index <HASH>..<HASH> 100644 --- a/Form/Event/CollectionEventSubscriber.php +++ b/Form/Event/CollectionEventSubscriber.php @@ -11,6 +11,7 @@ use Symfony\Component\Form\FormEvents; use Symfony\Component\Form\FormEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Form\Extension\Core\Type\CheckboxType; +use Symfony\Component\Form\Extension\Core\Type\HiddenType; use IDCI\Bundle\ExtraFormBundle\Exception\UnexpectedTypeException; class CollectionEventSubscriber implements EventSubscriberInterface @@ -244,7 +245,7 @@ class CollectionEventSubscriber implements EventSubscriberInterface foreach ($item as $k => $v) { if (FormEvents::PRE_SUBMIT === $eventName && - 'hidden' === $form->get($i)->get($k)->getConfig()->getType()->getName() + HiddenType::class === get_class($form->get($i)->get($k)->getConfig()->getType()->getInnerType()) ) { continue; }
Fixed hidden form type recognition: - Used FQCN instead of old obsolete getName method.
IDCI-Consulting_ExtraFormBundle
train
php
ae68dc1a863d3562ea85de9616c1b212aaa5ee77
diff --git a/pystache/locator.py b/pystache/locator.py index <HASH>..<HASH> 100644 --- a/pystache/locator.py +++ b/pystache/locator.py @@ -92,7 +92,8 @@ class Locator(object): template_extension = self.template_extension if template_extension is not False: - file_name += os.path.extsep + template_extension + if not file_name.endswith(template_extension): + file_name += os.path.extsep + template_extension return file_name
Updated to not append template_extension if it is already there.
defunkt_pystache
train
py
4e68810976909a681ac68b39c0aa2173a0627075
diff --git a/services/speech_to_text/recognize_stream.js b/services/speech_to_text/recognize_stream.js index <HASH>..<HASH> 100644 --- a/services/speech_to_text/recognize_stream.js +++ b/services/speech_to_text/recognize_stream.js @@ -115,7 +115,7 @@ RecognizeStream.prototype.initialize = function() { self.listening = false; self.push(null); /** - * @event RecognizeStream#connection-close + * @event RecognizeStream#close * @param {Number} reasonCode * @param {String} description */
doc fix: connection-close event -> close event [ci skip] fixes #<I>
watson-developer-cloud_node-sdk
train
js
3e814f46224001da364d0b8f2b8e851d4cf3327c
diff --git a/org.openwms.app/org.openwms.client.angularjs.app/src/main/ajs/app/scripts/main.js b/org.openwms.app/org.openwms.client.angularjs.app/src/main/ajs/app/scripts/main.js index <HASH>..<HASH> 100644 --- a/org.openwms.app/org.openwms.client.angularjs.app/src/main/ajs/app/scripts/main.js +++ b/org.openwms.app/org.openwms.client.angularjs.app/src/main/ajs/app/scripts/main.js @@ -58,11 +58,10 @@ require.config({ core_secModel: 'models/sec.model', core_envModel : 'models/env.model' }, - shim: {/* - angular: { - deps: [ 'jquery'], - exports: 'angular' - },*/ + shim: { + bootstrap: { + deps: [ 'jquery'] + }, 'ui_bootstrap': { deps: ['angular'] },
ST-<I> - worked on offering screen
openwms_org.openwms
train
js
ef0cadaf53ae356bea4fd02f01d55c605288f753
diff --git a/extending/optimize/optimize.php b/extending/optimize/optimize.php index <HASH>..<HASH> 100644 --- a/extending/optimize/optimize.php +++ b/extending/optimize/optimize.php @@ -14,7 +14,7 @@ */ if(defined('txpinterface')) { - register_callback('rah_backup__module_optimize', 'rah_backup.done'); + register_callback('rah_backup__module_optimize', 'rah_backup.created'); } /** diff --git a/rah_backup.php b/rah_backup.php index <HASH>..<HASH> 100644 --- a/rah_backup.php +++ b/rah_backup.php @@ -598,7 +598,6 @@ EOF; } callback_event('rah_backup.created'); - callback_event('rah_backup.done'); if(txpinterface == 'public') { exit;
Removed rah_backup.done callback event.
gocom_rah_backup
train
php,php
ade6743a880dc59b3838c1ec547482b06e10a119
diff --git a/test/ruboto_update_test.rb b/test/ruboto_update_test.rb index <HASH>..<HASH> 100644 --- a/test/ruboto_update_test.rb +++ b/test/ruboto_update_test.rb @@ -1,4 +1,6 @@ -unless ENV['SKIP_RUBOTO_UPDATE_TEST'] +if ENV['SKIP_RUBOTO_UPDATE_TEST'] + puts 'Detected SKIP_RUBOTO_UPDATE_TEST environment variable. Skipping Ruboto update test.' +else require File.expand_path('updated_example_test_methods', File.dirname(__FILE__)) require File.expand_path('update_test_methods', File.dirname(__FILE__))
* Added log message when skipping Ruboto update test.
ruboto_ruboto
train
rb
6f837513e312094c09bd13cba64bbad5596f2162
diff --git a/src/Address/BitcoinCashAddressReader.php b/src/Address/BitcoinCashAddressReader.php index <HASH>..<HASH> 100644 --- a/src/Address/BitcoinCashAddressReader.php +++ b/src/Address/BitcoinCashAddressReader.php @@ -50,6 +50,23 @@ class BitcoinCashAddressReader extends AddressReaderBase // continue on } + try { + list ($prefix, $scriptType, $hash) = \CashAddr\CashAddress::decode( + sprintf("%s:%s", $network->getCashAddressPrefix(), $strAddress) + ); + + if ($prefix !== $network->getCashAddressPrefix()) { + return null; + } + if (!($scriptType === ScriptType::P2PKH || $scriptType === ScriptType::P2SH)) { + return null; + } + + return new CashAddress($scriptType, new Buffer($hash, 20)); + } catch (\Exception $e) { + // continue on + } + return null; }
try prefixing the incoming string with the networks cash address prefix
blocktrail_blocktrail-sdk-php
train
php
8a9672cbc72bf7c92cd67ef1474a01685cd257f7
diff --git a/src/server/auth/cmds/cmds.go b/src/server/auth/cmds/cmds.go index <HASH>..<HASH> 100644 --- a/src/server/auth/cmds/cmds.go +++ b/src/server/auth/cmds/cmds.go @@ -37,9 +37,8 @@ func requestOIDCLogin(c *client.APIClient, openBrowser bool) (string, error) { "") if openBrowser { - err = browser.OpenURL(authURL) - if err != nil { - return "", err + if browser.OpenURL(authURL) != nil { + fmt.Println("Couldn't open a browser, visit the page manually.") } }
Fall back to no-browser case on error in auth login. (#<I>)
pachyderm_pachyderm
train
go
c4be8e9b4d7217a528dbb93fd90e6630450f2afb
diff --git a/katcp/tx/core.py b/katcp/tx/core.py index <HASH>..<HASH> 100644 --- a/katcp/tx/core.py +++ b/katcp/tx/core.py @@ -160,8 +160,8 @@ class ServerFactory(Factory): pass # override to provide some sensors class DeviceProtocol(KatCP): - VERSION = ("1.0",) - BUILD_STATE = ("txdeviceserver", "0.1") + VERSION = ("device_stub", 0, 1) + BUILD_STATE = ("name", 0, 1, "") SAMPLING_STRATEGIES = {'period' : PeriodicStrategy, 'none' : NoStrategy,
have the same stubs as default version git-svn-id: <URL>
ska-sa_katcp-python
train
py
5a3e08a09dee61213f798f77cb10cee1d8b79cd8
diff --git a/sprinter/directory.py b/sprinter/directory.py index <HASH>..<HASH> 100644 --- a/sprinter/directory.py +++ b/sprinter/directory.py @@ -134,6 +134,9 @@ class Directory(object): """ Symlink an object at path to name in the dir_name folder. remove it if it already exists. """ + target_dir = os.path.join(self.root_dir, dir_name) + if not os.path.exists(target_dir): + os.makedirs(target_dir) target_path = os.path.join(self.root_dir, dir_name, name) self.logger.debug("Attempting to symlink %s to %s..." % (path, target_path)) if os.path.exists(target_path):
Adding check for the directory already existing
toumorokoshi_sprinter
train
py
e1652e3d3cb821090790a920913871868abe4b5c
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.280" +__version__ = "0.1.281" 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 @@ -1054,7 +1054,6 @@ class Component(ApplicationSession): except Exception as e: log.msg("onJoin register exception {} {}".format(self.svar['topic_base']+'.'+r, e)) self.leave(CloseDetails(message=six.u("Error registering {}:{}".format(self.svar['topic_base']+'.'+r),e))) - self.join(self.config.realm, [six.u(auth_type)], six.u(auth_user)) def onLeave(self, details): sys.stderr.write("Leaving realm : {}\n".format(details))
sync with pypi version: <I>
lgfausak_sqlauth
train
py,py
e71182cae573f7b211011f501bb7011d65f19d8f
diff --git a/src/UrlBuilder.php b/src/UrlBuilder.php index <HASH>..<HASH> 100644 --- a/src/UrlBuilder.php +++ b/src/UrlBuilder.php @@ -120,9 +120,9 @@ REGEX; } } - public function cover($params = []) + public function cover($params = [], $route = null) { $params = array_merge($this->currentInfo['params'], $params); - return $this->route($this->currentRouteName, $params); + return $this->route($route ?: $this->currentRouteName, $params); } }
url builder cover method support route arg
cabalphp_route
train
php
f158f0225b7075b842a4e8f835565fbdd42b3e0e
diff --git a/ddlgenerator/ddlgenerator.py b/ddlgenerator/ddlgenerator.py index <HASH>..<HASH> 100755 --- a/ddlgenerator/ddlgenerator.py +++ b/ddlgenerator/ddlgenerator.py @@ -210,7 +210,8 @@ class Table(object): Table.table_index += 1 self.table_name = reshape.clean_key_name(self.table_name) - if not hasattr(self.data, 'append') and not hasattr(self.data, '__next__'): + if not hasattr(self.data, 'append') and not hasattr(self.data, '__next__') \ + and not hasattr(self.data, 'next'): self.data = [self.data,] self.data = reshape.walk_and_clean(self.data)
do not embed pymongo cursor in list
catherinedevlin_ddl-generator
train
py
7d3e4525ea8f768917c9a2e2ba1788fc3fe5cda0
diff --git a/sos/PBS/sos_task.py b/sos/PBS/sos_task.py index <HASH>..<HASH> 100644 --- a/sos/PBS/sos_task.py +++ b/sos/PBS/sos_task.py @@ -24,7 +24,7 @@ import os import pickle from sos.utils import env from sos.sos_eval import interpolate -from sos.sos_task import TaskEngine +from sos.sos_task import TaskEngine, loadTask from sos.pattern import extract_pattern class PBS_TaskEngine(TaskEngine): @@ -71,9 +71,8 @@ class PBS_TaskEngine(TaskEngine): # read the task file and look for runtime info # task_file = os.path.join(os.path.expanduser('~'), '.sos', 'tasks', self.alias, task_id + '.task') - with open(task_file, 'rb') as task: - params = pickle.load(task) - task, sos_dict, sigil = params.data + params = loadTask(task_file) + task, sos_dict, sigil = params.task, params.sos_dict, params.sigil # for this task, we will need walltime, nodes, cores, mem # however, these could be fixed in the job template and we do not need to have them all in the runtime
Fix PBS for the loading of new task format
vatlab_SoS
train
py
1b9b94912d574e8f5287566cf01e3c40f6aba760
diff --git a/lib/rom/processor/transproc.rb b/lib/rom/processor/transproc.rb index <HASH>..<HASH> 100644 --- a/lib/rom/processor/transproc.rb +++ b/lib/rom/processor/transproc.rb @@ -99,8 +99,8 @@ module ROM # # @api private def visit_attribute(attribute) - if attribute.meta[:coercer] - t(:map_value, attribute.name, attribute.meta[:coercer]) + if coercer = attribute.meta[:coercer] + t(:map_value, attribute.name, coercer) elsif attribute.typed? t(:map_value, attribute.name, t(:"to_#{attribute.type}")) end
Extract coercer once reducing number of hash lookups
rom-rb_rom
train
rb
94a1f01c46773ab2089255a33ff3973720fac55f
diff --git a/lifxlan/device.py b/lifxlan/device.py index <HASH>..<HASH> 100644 --- a/lifxlan/device.py +++ b/lifxlan/device.py @@ -426,6 +426,8 @@ class Device(object): # Usually used for Get messages, or for state confirmation after Set (hence the optional payload) def req_with_resp(self, msg_type, response_type, payload={}, timeout_secs=DEFAULT_TIMEOUT, max_attempts=DEFAULT_ATTEMPTS): + if type(response_type) != type([]): + response_type = [response_type] success = False device_response = None self.initialize_socket(timeout_secs) @@ -450,7 +452,7 @@ class Device(object): response = unpack_lifx_message(data) if self.verbose: print("RECV: " + str(response)) - if type(response) == response_type: + if type(response) in response_type: if response.origin == 1 and response.source_id == self.source_id and response.target_addr == self.mac_addr: response_seen = True device_response = response
added support for specifying several possible response types to accommodate the way MultiZone lights can respond with either a StateZone or a StateMultiZone message to a GetColorZones request
mclarkk_lifxlan
train
py
e8b56c570ffb2dfdb2b4563fcaad5bd9760c473f
diff --git a/org/mozilla/javascript/NativeJavaClass.java b/org/mozilla/javascript/NativeJavaClass.java index <HASH>..<HASH> 100644 --- a/org/mozilla/javascript/NativeJavaClass.java +++ b/org/mozilla/javascript/NativeJavaClass.java @@ -102,6 +102,8 @@ public class NativeJavaClass extends NativeJavaObject implements Function { result = nestedValue; } catch (ClassNotFoundException ex) { throw members.reportMemberNotFound(name); + } catch (IllegalArgumentException e) { + throw members.reportMemberNotFound(name); } } diff --git a/src/org/mozilla/javascript/NativeJavaClass.java b/src/org/mozilla/javascript/NativeJavaClass.java index <HASH>..<HASH> 100644 --- a/src/org/mozilla/javascript/NativeJavaClass.java +++ b/src/org/mozilla/javascript/NativeJavaClass.java @@ -102,6 +102,8 @@ public class NativeJavaClass extends NativeJavaObject implements Function { result = nestedValue; } catch (ClassNotFoundException ex) { throw members.reportMemberNotFound(name); + } catch (IllegalArgumentException e) { + throw members.reportMemberNotFound(name); } }
Try to fix Solaris/Linux failures.
mozilla_rhino
train
java,java
4ed4a98fbdb4002354e817648954f2d0bf00bc4b
diff --git a/v3.1/glfw/native_darwin.go b/v3.1/glfw/native_darwin.go index <HASH>..<HASH> 100644 --- a/v3.1/glfw/native_darwin.go +++ b/v3.1/glfw/native_darwin.go @@ -8,10 +8,10 @@ package glfw // workaround wrappers needed due to a cgo and/or LLVM bug. // See: https://github.com/go-gl/glfw/issues/136 -inline void *workaround_glfwGetCocoaWindow(GLFWwindow *w) { +void *workaround_glfwGetCocoaWindow(GLFWwindow *w) { return (void *)glfwGetCocoaWindow(w); } -inline void *workaround_glfwGetNSGLContext(GLFWwindow *w) { +void *workaround_glfwGetNSGLContext(GLFWwindow *w) { return (void *)glfwGetNSGLContext(w); } */
Do not use inline native_darwin.go. Resolves #<I>. We want these funcs to be available to Go world via cgo, so they should not be inlined.
go-gl_glfw
train
go
804d85b762f5fe769bb14df6bb8d317da3802c13
diff --git a/src/Autowhatever.js b/src/Autowhatever.js index <HASH>..<HASH> 100644 --- a/src/Autowhatever.js +++ b/src/Autowhatever.js @@ -301,11 +301,13 @@ export default class Autowhatever extends Component { highlightedSectionIndex, highlightedItemIndex, } = this.props; + const { keyCode } = event; - switch (event.key) { - case 'ArrowDown': - case 'ArrowUp': { - const nextPrev = event.key === 'ArrowDown' ? 'next' : 'prev'; + switch (keyCode) { + case 40: // ArrowDown + case 38: { + // ArrowUp + const nextPrev = keyCode === 40 ? 'next' : 'prev'; const [ newHighlightedSectionIndex, newHighlightedItemIndex,
Replace event.key with event.keyCode + this replacement occured in autowhatever #<I>
moroshko_react-autosuggest
train
js
3452a8428a851f704879dd00031b7ff6a2dcbf3d
diff --git a/lib/resqued/daemon.rb b/lib/resqued/daemon.rb index <HASH>..<HASH> 100644 --- a/lib/resqued/daemon.rb +++ b/lib/resqued/daemon.rb @@ -23,6 +23,9 @@ module Resqued exit else # master + STDIN.reopen "/dev/null" + STDOUT.reopen "/dev/null", "a" + STDERR.reopen "/dev/null", "a" rd.close @master.run(wr) end
Detach more completely on daemonize
spraints_resqued
train
rb
77bb2d55dd22d0af055c490a1b923493f42a53bb
diff --git a/lib/namespace_cache/extensions/gdbm.rb b/lib/namespace_cache/extensions/gdbm.rb index <HASH>..<HASH> 100644 --- a/lib/namespace_cache/extensions/gdbm.rb +++ b/lib/namespace_cache/extensions/gdbm.rb @@ -2,7 +2,6 @@ require_relative '../cache_api.rb' require 'gdbm' require 'benchmark' require 'uri' -require 'pry' module OpenBEL module Namespace
remove pry require; development dependency refs #5
OpenBEL_openbel-api
train
rb
bb2ec9ece47472b622e1bb962f1b18a4c3c82e37
diff --git a/sakelib/constants.py b/sakelib/constants.py index <HASH>..<HASH> 100644 --- a/sakelib/constants.py +++ b/sakelib/constants.py @@ -39,7 +39,7 @@ from __future__ import unicode_literals from __future__ import print_function # Version number -VERSION = "0.9.5.1" +VERSION = "0.9.5.5" # Name of application NAME = 'master-sake'
updated version number after cntrb from kirbyfan<I>
tonyfischetti_sake
train
py
da8061ed527e7a9dbb4b0d1ea3bbd18ad9be792e
diff --git a/src/js/ripple/index.js b/src/js/ripple/index.js index <HASH>..<HASH> 100644 --- a/src/js/ripple/index.js +++ b/src/js/ripple/index.js @@ -13,6 +13,8 @@ exports.SerializedObject = require('./serializedobject').SerializedObject; exports.RippleError = require('./rippleerror').RippleError; exports.Message = require('./message').Message; exports.VaultClient = require('./vaultclient').VaultClient; +exports.AuthInfo = require('./authinfo').AuthInfo; +exports.RippleTxt = require('./rippletxt').RippleTxt; exports.binformat = require('./binformat'); exports.utils = require('./utils'); exports.Server = require('./server').Server;
[FEATURE] expose AuthInfo and RippleTxt modules in ripple class
ChainSQL_chainsql-lib
train
js
2af41341287dcba734c4299086618fe72b9ccafe
diff --git a/core/network/conn.go b/core/network/conn.go index <HASH>..<HASH> 100644 --- a/core/network/conn.go +++ b/core/network/conn.go @@ -60,6 +60,7 @@ type ConnMultiaddrs interface { RemoteMultiaddr() ma.Multiaddr } +// ConnStat is an interface mixin for connection types that provide connection statistics. type ConnStat interface { // Stat stores metadata pertaining to this conn. Stat() Stat diff --git a/core/network/network.go b/core/network/network.go index <HASH>..<HASH> 100644 --- a/core/network/network.go +++ b/core/network/network.go @@ -103,7 +103,7 @@ type Stat struct { Direction Direction // Opened is the timestamp when this connection was opened. Opened time.Time - // Transient indicates that this connection is transient and may be closed soon + // Transient indicates that this connection is transient and may be closed soon. Transient bool // Extra stores additional metadata about this connection. Extra map[interface{}]interface{}
address aarshian nitpicks
libp2p_go-libp2p
train
go,go
f42711f98198a4390b2843e0e66ef5e83cd9c852
diff --git a/lib/plugin.js b/lib/plugin.js index <HASH>..<HASH> 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -156,8 +156,7 @@ class Client { sse, routingRules, manageResources, - tags, - prefixText; + tags; return this._validateConfig() .then(() => { @@ -189,17 +188,15 @@ class Client { routingRules = this.options.routingRules || null; tags = this.options.tags || []; - if (keyPrefix) { - prefixText = `under the prefix '${keyPrefix}'`; - } - const deployDescribe = ['This deployment will:']; if (this.cliOptions['delete-contents']) { deployDescribe.push(`- Remove all existing files from bucket '${bucketName}'`); } deployDescribe.push( - `- Upload all files from '${distributionFolder}' to bucket '${bucketName}' ${prefixText}` + `- Upload all files from '${distributionFolder}' to bucket '${bucketName}'${ + keyPrefix ? ` under the prefix '${keyPrefix}'` : '' + }` ); if (this.cliOptions['config-change'] !== false && manageResources !== false) {
fix(log): don't log undefined string
fernando-mc_serverless-finch
train
js
8d04a4cb85b87a45256482eaf8523c770178c694
diff --git a/ariane_procos/components.py b/ariane_procos/components.py index <HASH>..<HASH> 100644 --- a/ariane_procos/components.py +++ b/ariane_procos/components.py @@ -32,6 +32,7 @@ class SystemComponent(InjectorComponentSkeleton): def __init__(self, attached_gear_id=None, hostname=socket.gethostname(), component_type=None, system_gear_actor_ref=None, domino_activator=None, domino_topic=None, config=None): + LOGGER.debug("SystemComponent.__init__") self.hostname = hostname self.domino = domino_activator self.topic = domino_topic @@ -58,9 +59,11 @@ class SystemComponent(InjectorComponentSkeleton): self.version = 0 def data_blob(self): + LOGGER.debug("SystemComponent.data_blob") return json.dumps(self.operating_system.operating_system_2_json()) def sniff(self, synchronize_with_ariane_dbs=True): + LOGGER.debug("SystemComponent.sniff") try: LOGGER.info("Sniffing...") self.cache(refreshing=True, next_action=InjectorCachedComponent.action_update, data_blob=self.data_blob())
[ACPPOS-<I>] improve logging on component
echinopsii_net.echinopsii.ariane.community.plugin.procos
train
py
d36462eb00a319e49df3934614641bd1867e1ab1
diff --git a/lib/formslib.php b/lib/formslib.php index <HASH>..<HASH> 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -1360,7 +1360,7 @@ class MoodleQuickForm_Renderer extends HTML_QuickForm_Renderer_Tableless{ } if ($element->getType() == 'static') { - $html = preg_replace('|<label.*?</label>|i', '', $html); //xhtml compliance - no label for static content + $html = preg_replace('/(<label.*?>)|(<\/label>)/i', '', $html); //xhtml compliance - no label for static content } $this->_templates[$element->getName()] = $html; if (!is_null($element->getAttribute('id'))) {
MDL-<I> xhtml strict fixes - do not add label for static element in formslib, fixed wrong regex in previous commit
moodle_moodle
train
php
c4e886df85a6fc8cafa895fe21c11538d8f448cc
diff --git a/test/integration/association-hasone-zeroid-async.js b/test/integration/association-hasone-zeroid-async.js index <HASH>..<HASH> 100644 --- a/test/integration/association-hasone-zeroid-async.js +++ b/test/integration/association-hasone-zeroid-async.js @@ -82,16 +82,16 @@ describe("hasOne promise-based methods", function() { return Pet .findAsync({petName: "Snagglepuss"}) .then(function(pets) { - pets[0].petName.should.equal("Snagglepuss"); - pets[0].should.have.property("id"); - pets[0].id.should.equal(11); + var pet = pets[0]; + pet.petName.should.equal("Snagglepuss"); + pet.should.have.property("id"); + pet.id.should.equal(11); return Person.allAsync(); }) .then(function (people) { should.equal(typeof people[0], 'object'); should.equal(Array.isArray(people), true); - people[0].should.have.property("firstName", "Stuey"); }); }); });
Fix hasone-zeroid-async test according to old test logic
dresende_node-orm2
train
js
89dc163a77a72a0583b28b817a3ff41f4995a5d1
diff --git a/biojava3-structure/src/main/java/org/biojava/bio/structure/align/util/AtomCache.java b/biojava3-structure/src/main/java/org/biojava/bio/structure/align/util/AtomCache.java index <HASH>..<HASH> 100644 --- a/biojava3-structure/src/main/java/org/biojava/bio/structure/align/util/AtomCache.java +++ b/biojava3-structure/src/main/java/org/biojava/bio/structure/align/util/AtomCache.java @@ -168,7 +168,7 @@ public class AtomCache { strictSCOP = true; - useMmCif = false; + useMmCif = true; }
Fix #<I>. Use mmCIF as default structure format
biojava_biojava
train
java
3e9a246d34594a1d0e24f78f053bc2af95a6d01f
diff --git a/lib/celluloid/thread_handle.rb b/lib/celluloid/thread_handle.rb index <HASH>..<HASH> 100644 --- a/lib/celluloid/thread_handle.rb +++ b/lib/celluloid/thread_handle.rb @@ -1,13 +1,8 @@ -require 'forwardable' - module Celluloid # An abstraction around threads from the InternalPool which ensures we don't # accidentally do things to threads which have been returned to the pool, # such as, say, killing them class ThreadHandle - extend Forwardable - def_delegators :@thread, :backtrace - def initialize @mutex = Mutex.new @join = ConditionVariable.new @@ -40,5 +35,14 @@ module Celluloid @mutex.synchronize { @join.wait(@mutex) if @thread } self end + + # Obtain the backtrace for this thread + def backtrace + @thread.backtrace + rescue NoMethodError + # undefined method `backtrace' for nil:NilClass + # Swallow this in case this ThreadHandle was terminated and @thread was + # set to nil + end end end
Properly handle backtraces of exited ThreadHandles
celluloid_celluloid
train
rb
3743b818d19f7ff49dd19e6d47ffb413790faa68
diff --git a/icontract/__init__.py b/icontract/__init__.py index <HASH>..<HASH> 100644 --- a/icontract/__init__.py +++ b/icontract/__init__.py @@ -246,7 +246,8 @@ class post: # pylint: disable=invalid-name result = func(*args, **kwargs) # Add the special ``result`` argument - condition_kwargs["result"] = result + if "result" in self._condition_arg_set: + condition_kwargs["result"] = result check = self.condition(**condition_kwargs)
result given to postcondition only if necessary
Parquery_icontract
train
py
c3bb359e9aaae700324132fa46cdf9419fda115f
diff --git a/codec/values_test.go b/codec/values_test.go index <HASH>..<HASH> 100644 --- a/codec/values_test.go +++ b/codec/values_test.go @@ -22,7 +22,6 @@ type wrapUint64 uint64 type wrapString string type wrapUint64Slice []wrapUint64 type wrapStringSlice []wrapString -type wrapBytesSlice []wrapBytes type stringUint64T struct { S string
codec: test: remove reference to wrapBytes in values_test.go (should only be in values_flex_test.go)
ugorji_go
train
go
07903008ecd60ce7e9db6ccbad79e6e42e85d821
diff --git a/test/k8sT/demos.go b/test/k8sT/demos.go index <HASH>..<HASH> 100644 --- a/test/k8sT/demos.go +++ b/test/k8sT/demos.go @@ -113,7 +113,7 @@ var _ = Describe("K8sDemosTest", func() { By("Getting xwing pod names") xwingPods, err := kubectl.GetPodNames(helpers.DefaultNamespace, allianceLabel) Expect(err).Should(BeNil()) - Expect(xwingPods[0]).ShouldNot(Equal(""), "unable to get xwing pod names") + Expect(xwingPods).ShouldNot(BeEmpty(), "Unable to get xwing pod names") // Test only needs to access one of the pods. xwingPod := xwingPods[0]
Test/Demos: Make assert more robust. Seen in <I> branch and issue #<I> that xwingPods array had 0 len, and the assert will not work, pod is different than a empty string. With this commit the assert will check that the array does not have 0 len and it'll be not a test flake
cilium_cilium
train
go
6977f53f1ad7ad9abc01876ff7094886e0227248
diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php index <HASH>..<HASH> 100644 --- a/scripts/update/Updater.php +++ b/scripts/update/Updater.php @@ -528,13 +528,9 @@ class Updater extends common_ext_ExtensionUpdater $this->skip('12.23.0', '12.26.1'); if ($this->isVersion('12.26.1')) { - $file = __DIR__ . DIRECTORY_SEPARATOR . - '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . - 'core' . DIRECTORY_SEPARATOR . - 'ontology' . DIRECTORY_SEPARATOR . - 'widgetdefinitions.rdf'; + $widgetDefinitionsFilePath = __DIR__ . '/../../core/ontology/widgetdefinitions.rdf'; $api = core_kernel_impl_ApiModelOO::singleton(); - $api->importXmlRdf('http://www.tao.lu/datatypes/WidgetDefinitions.rdf', $file); + $api->importXmlRdf('http://www.tao.lu/datatypes/WidgetDefinitions.rdf', $widgetDefinitionsFilePath); $this->setVersion('12.27.0'); }
Apply suggestions from code review UNO-<I> chore: simplify `widgetdefinitions` path building in `Updater.php`
oat-sa_generis
train
php
826b26bf6b8aa5c9c4be18cd8a972050a6265a40
diff --git a/src/Psalm/IssueBuffer.php b/src/Psalm/IssueBuffer.php index <HASH>..<HASH> 100644 --- a/src/Psalm/IssueBuffer.php +++ b/src/Psalm/IssueBuffer.php @@ -148,11 +148,11 @@ class IssueBuffer } /** - * This will return true if an issue is ready to be added for emission. Reasons for not returning true include: + * This will return false if an issue is ready to be added for emission. Reasons for not returning false include: * - The issue is suppressed in config * - We're in a recording state * - The issue is included in the list of issues to be suppressed in param - * @param string[] $suppressed_issues + * @param string[] $suppressed_issues */ public static function isSuppressed(CodeIssue $e, array $suppressed_issues = []) : bool {
fix phpdoc. The previous message was incorrect
vimeo_psalm
train
php
690c2150fcfcad51af21d443774e3ab3f27f73b8
diff --git a/Menu/Menu.php b/Menu/Menu.php index <HASH>..<HASH> 100644 --- a/Menu/Menu.php +++ b/Menu/Menu.php @@ -102,7 +102,12 @@ class Menu implements MenuInterface $parentName = $item->getParentName(); - if (isset($skipped[$parentName]) || !isset($items[$parentName])) { + if (!isset($items[$parentName])) { + $item->setParentName(null); + + continue; + } + if (isset($skipped[$parentName])) { continue; }
Render menu items having parent missing as root items.
DarvinStudio_DarvinAdminBundle
train
php
d9919e282816a91dba60737556a4ff5ccf0b0ad2
diff --git a/instabot/tests/test.py b/instabot/tests/test.py index <HASH>..<HASH> 100644 --- a/instabot/tests/test.py +++ b/instabot/tests/test.py @@ -1,7 +1,12 @@ +import sys +import os + +sys.path.append(os.path.join(sys.path[0], '../../')) from instabot import Bot bot = Bot() bot.login() -bot.like_timeline() -bot.like_user("352300017") -bot.follow_users(["352300017"]) +assert(bot.like_timeline() == []) +assert(bot.like_user("352300017") == []) +assert(bot.follow_users(["352300017"]) == []) +assert(bot.like_hashtag("mipt") == [])
add assertion to the test.py
instagrambot_instabot
train
py
eb260436d6c9ab39145b4da95fc085e04b4cfa9a
diff --git a/task/backend/inmem_store.go b/task/backend/inmem_store.go index <HASH>..<HASH> 100644 --- a/task/backend/inmem_store.go +++ b/task/backend/inmem_store.go @@ -286,7 +286,10 @@ func (s *inmem) CreateNextRun(ctx context.Context, taskID platform.ID, now int64 // FinishRun removes runID from the list of running tasks and if its `now` is later then last completed update it. func (s *inmem) FinishRun(ctx context.Context, taskID, runID platform.ID) error { + s.mu.RLock() stm, ok := s.runners[taskID.String()] + s.mu.RUnlock() + if !ok { return errors.New("taskRunner not found") }
fix(task): remove race condition when finishing a inmem run (#<I>) * fix(task): remove race condition when finishing a inmem run
influxdata_influxdb
train
go
b59c6eafaf8ac5671d10edd909b5acd628d0d237
diff --git a/src/client/virgil-client.js b/src/client/virgil-client.js index <HASH>..<HASH> 100644 --- a/src/client/virgil-client.js +++ b/src/client/virgil-client.js @@ -111,6 +111,9 @@ function createVirgilClient(accessToken, options) { return cardsReadOnlyClient.search(criteria) .then(function (response) { + if (response.data === null) { + return []; + } return response.data.map(CardModel.import); }) .then(function (cards) {
fix: handle null response in virgilClient#searchCards
VirgilSecurity_virgil-sdk-javascript
train
js
a57c76bb2b780e829180f82c948de12f29deeaca
diff --git a/pdfwatermarker/__init__.py b/pdfwatermarker/__init__.py index <HASH>..<HASH> 100644 --- a/pdfwatermarker/__init__.py +++ b/pdfwatermarker/__init__.py @@ -1,10 +1,10 @@ -__all__ = ["upscale", "rotate", "protect", "Merge", "Watermark", "WatermarkGUI", "slicer"] +__all__ = ["upscale", "rotate", "protect", "Merge", "Watermark", "WatermarkGUI", "Label", "WatermarkAdd", "slicer"] __version__ = '1.0.3' __author__ = 'Stephen Neal' from pdfwatermarker.utils import * -from pdfwatermarker.watermark import Watermark, WatermarkGUI +from pdfwatermarker.watermark import Watermark, WatermarkGUI, Label, WatermarkAdd from pdfwatermarker.upscale import upscale from pdfwatermarker.rotate import rotate from pdfwatermarker.encrypt import protect
Added WatermarkAdd and Label to pdfwatermarker module __init__.py
mrstephenneal_pdfconduit
train
py
c6435825008c35e99045fc4729b5f68d59c0e57e
diff --git a/lib/mapreduce/mapreduce.go b/lib/mapreduce/mapreduce.go index <HASH>..<HASH> 100644 --- a/lib/mapreduce/mapreduce.go +++ b/lib/mapreduce/mapreduce.go @@ -274,7 +274,9 @@ func Map(job Job, jobPath string, m materializeInfo, host string, shard, modulos } nextMarker := "" for { + log.Print("s3: before List nextMarker = ", nextMarker) lr, err := bucket.List(inPath, "", nextMarker, 0) + log.Printf("s3: %#v", lr) if err != nil { log.Print(err) return
Adds more logging to mapreduce code.
pachyderm_pachyderm
train
go
a6c0206da23632e0b7b1e2e3344c63d481f9e381
diff --git a/packages/postcss-merge-longhand/src/lib/clone.js b/packages/postcss-merge-longhand/src/lib/clone.js index <HASH>..<HASH> 100644 --- a/packages/postcss-merge-longhand/src/lib/clone.js +++ b/packages/postcss-merge-longhand/src/lib/clone.js @@ -1,5 +1,5 @@ export default function clone (obj, parent) { - if (typeof obj !== 'object') { + if (obj === null || typeof obj !== 'object') { return obj; } let cloned = new obj.constructor();
Resolve a crash when a cloned object was null.
cssnano_cssnano
train
js
78747c76b91f52e8d85c866e6ad85848e9dc5064
diff --git a/aiger/common.py b/aiger/common.py index <HASH>..<HASH> 100644 --- a/aiger/common.py +++ b/aiger/common.py @@ -112,7 +112,10 @@ def sink(inputs): comments=('sink', )) -def tee(outputs): +def tee(outputs=None): + if not outputs: + return empty() + def tee_output(name, renames): return frozenset((r, aig.Input(name)) for r in renames) diff --git a/aiger/parser.py b/aiger/parser.py index <HASH>..<HASH> 100755 --- a/aiger/parser.py +++ b/aiger/parser.py @@ -29,7 +29,7 @@ symbol_kind = ("i" / "o" / "l") symbol_name = (~r".")+ comments = "c" EOL comment+ -comment = (~r".")+ EOL? +comment = (~r".")* EOL? _ = ~r" "+ id = ~r"\d"+ diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,6 @@ setup( 'parsimonious', 'dd', 'toposort', - 'lens', ], packages=find_packages(), )
extend tee to support empty mapping + remove lens dependency
mvcisback_py-aiger
train
py,py,py
a88491d4de15820e42615ecb0af27336e66aa323
diff --git a/src/ChartBlocks/DataSet/Row.php b/src/ChartBlocks/DataSet/Row.php index <HASH>..<HASH> 100644 --- a/src/ChartBlocks/DataSet/Row.php +++ b/src/ChartBlocks/DataSet/Row.php @@ -65,7 +65,7 @@ class Row implements DataSetAwareInterface { $data = array(); $i = 1; - while ($i < $columns) { + while ($i <= $columns) { $data[$i] = $this->getCell($i); $i++; }
fix for missing cell on getCells in row class
ChartBlocks_php-rest-sdk
train
php
ed6ed1f5d40856c04c7eab6f76075a0e3883654e
diff --git a/lib/curse.js b/lib/curse.js index <HASH>..<HASH> 100644 --- a/lib/curse.js +++ b/lib/curse.js @@ -40,6 +40,11 @@ Curse.prototype.capture = function capture() { var focOff = sel.focusOffset; var child, start, end; + if (anc === null || foc === null) { + this.reset(); + return; + } + if (anc.nodeName === '#text') { start = this.lengthUpTo(anc) + ancOff; } else {
Reset curse on #capture if there is no selection
usecanvas_curse
train
js
3452b9503343e2990b0d1b553605e9e204b999c7
diff --git a/src/NodeCompiler/Exception/UnableToCompileNode.php b/src/NodeCompiler/Exception/UnableToCompileNode.php index <HASH>..<HASH> 100644 --- a/src/NodeCompiler/Exception/UnableToCompileNode.php +++ b/src/NodeCompiler/Exception/UnableToCompileNode.php @@ -54,8 +54,9 @@ class UnableToCompileNode extends LogicException private static function compilerContextToContextDescription(CompilerContext $fetchContext) : string { + // @todo improve in https://github.com/Roave/BetterReflection/issues/434 return $fetchContext->hasSelf() ? $fetchContext->getSelf()->getName() - : 'unknown context'; // @TODO review feedback here, plox! + : 'unknown context (probably a function)'; } }
Link to #<I> for todo about context descriptions in exceptions
Roave_BetterReflection
train
php
6cabe562c6d71226ef6414ecca3e628ce3ed8747
diff --git a/events/event_nettrace.go b/events/event_nettrace.go index <HASH>..<HASH> 100644 --- a/events/event_nettrace.go +++ b/events/event_nettrace.go @@ -1,8 +1,12 @@ package events import ( - "github.com/opentracing/basictracer-go" + "bytes" + "fmt" + "golang.org/x/net/trace" + + basictracer "github.com/opentracing/basictracer-go" ) // NetTraceIntegrator can be passed into a basictracer as NewSpanEventListener @@ -16,6 +20,18 @@ var NetTraceIntegrator = func() func(basictracer.SpanEvent) { tr.SetMaxEvents(1000) case basictracer.EventFinish: tr.Finish() + case basictracer.EventTag: + tr.LazyPrintf("%s:%v", t.Key, t.Value) + case basictracer.EventLogFields: + var buf bytes.Buffer + for i, f := range t.Fields { + if i > 0 { + buf.WriteByte(' ') + } + fmt.Fprintf(&buf, "%s:%v", f.Key(), f.Value()) + } + + tr.LazyPrintf("%s", buf.String()) case basictracer.EventLog: if t.Payload != nil { tr.LazyPrintf("%s (payload %v)", t.Event, t.Payload)
event: update NetTraceIntegrator to support LogFields, Tag NetTraceIntegrator now handles EventLogFields and EventTag and produces messages for them.
opentracing_basictracer-go
train
go
2457d0e52bf5a4c72530bbbea24b7084667b0327
diff --git a/lib/CLIntegracon/file_tree_spec.rb b/lib/CLIntegracon/file_tree_spec.rb index <HASH>..<HASH> 100644 --- a/lib/CLIntegracon/file_tree_spec.rb +++ b/lib/CLIntegracon/file_tree_spec.rb @@ -92,8 +92,12 @@ module CLIntegracon produced_files = glob_all unexpected_files = produced_files - expected_files + # Select only files + unexpected_files.map! { |path| Pathname(path) } + unexpected_files.select! { |path| path.file? } + # Filter ignored paths - unexpected_files.reject! { |path| special_behavior_for_path(Pathname(path)) == context.class.nop } + unexpected_files.reject! { |path| special_behavior_for_path(path) == context.class.nop } block.call unexpected_files end
Select only files for check_unexpected_files
mrackwitz_CLIntegracon
train
rb
7dd805240fa025c08bad22eba0c67494ad331987
diff --git a/src/utils/upgradeCache.js b/src/utils/upgradeCache.js index <HASH>..<HASH> 100644 --- a/src/utils/upgradeCache.js +++ b/src/utils/upgradeCache.js @@ -38,6 +38,7 @@ const version3 = async ( const [branch, index] = parsePath(addressObj.path, masterPath) const pubKey = await fSelector.deriveHdKey(masterKeys.pubKey, branch) let tempAddress + // This branch number represents the replay protection branch on bitcoincash wallets if (branch === 146473132) { const { address } = await fSelector.deriveScriptAddress( pubKey, @@ -53,13 +54,9 @@ const version3 = async ( } const stringifiedAddresses = JSON.stringify(cacheJson) await localDisklet.setText('addresses.json', stringifiedAddresses) - } catch (e) { - } finally { - await localDisklet.setText('version.txt', `${versionNumber}`) - } - } else { - await localDisklet.setText('version.txt', `${versionNumber}`) + } catch (e) {} } + await localDisklet.setText('version.txt', `${versionNumber}`) } export const checkCacheVersion = async (
Add comment explaining bitcoincash specific code Removed redundant code setting version number
EdgeApp_edge-currency-bitcoin
train
js
042cb6b2b2f0c7703f7782e1389f57919aed2dc0
diff --git a/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php @@ -147,6 +147,10 @@ class LoggerDataCollector extends DataCollector implements LateDataCollectorInte } if (is_object($context)) { + if ($context instanceof \Exception) { + return sprintf('Exception(%s): %s', get_class($context), $context->getMessage()); + } + return sprintf('Object(%s)', get_class($context)); }
Fixed regression when exception message swallowed when logging it.
symfony_symfony
train
php
212d56a7b5011100c584c4cedac99a1b25d0597e
diff --git a/rollup.config.js b/rollup.config.js index <HASH>..<HASH> 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -12,5 +12,5 @@ module.exports = { exports: "auto" }], plugins: [require('@rollup/plugin-buble')()], - external(id) { return !/^[\.\/]/.test(id) } + external(id) { return id[0] != "." && !require("path").isAbsolute(id) } }
Make rollup.config.js more Windows-compatible Issue prosemirror/prosemirror#<I>
ProseMirror_prosemirror-test-builder
train
js
06d51ba40a7653be452bcb14cafdfed815ffa53a
diff --git a/container/src/main/java/org/jboss/forge/furnace/impl/graph/MasterGraphChangeHandler.java b/container/src/main/java/org/jboss/forge/furnace/impl/graph/MasterGraphChangeHandler.java index <HASH>..<HASH> 100644 --- a/container/src/main/java/org/jboss/forge/furnace/impl/graph/MasterGraphChangeHandler.java +++ b/container/src/main/java/org/jboss/forge/furnace/impl/graph/MasterGraphChangeHandler.java @@ -38,7 +38,6 @@ public class MasterGraphChangeHandler @Override public void vertexFinished(VertexTraversalEvent<AddonVertex> event) { - MasterGraph temp = graph; AddonVertex vertex = event.getVertex(); AddonView view = vertex.getViews().iterator().next(); AddonId addonId = vertex.getAddonId(); @@ -61,7 +60,7 @@ public class MasterGraphChangeHandler iterator.addTraversalListener(new TraversalListenerAdapter<AddonVertex, AddonDependencyEdge>() { @Override - public void vertexTraversed(VertexTraversalEvent<AddonVertex> event) + public void vertexFinished(VertexTraversalEvent<AddonVertex> event) { AddonVertex vertex = event.getVertex(); Addon addon = vertex.getAddon();
Also traverse startup in real depth first
forge_furnace
train
java
730cc68eda7d9f87ba27f63a5b6b9427d96ca7be
diff --git a/tests/parser.py b/tests/parser.py index <HASH>..<HASH> 100644 --- a/tests/parser.py +++ b/tests/parser.py @@ -33,6 +33,12 @@ class WebVTTParserTestCase(unittest.TestCase): 64 ) + def test_total_length_no_parser(self): + self.assertEqual( + self.webvtt.total_length, + 0 + ) + def test_parser_empty_file(self): self.assertRaises( MalformedFileError, diff --git a/webvtt/webvtt.py b/webvtt/webvtt.py index <HASH>..<HASH> 100644 --- a/webvtt/webvtt.py +++ b/webvtt/webvtt.py @@ -28,8 +28,8 @@ class WebVTT: def _set_reader(self, name, format_, parser_class): def f(self, file): - self.parser = parser_class() - return self.parser.read(file) + self.parser = parser_class().read(file) + return self f.__name__ = name if format_ == 'webvtt': @@ -51,4 +51,6 @@ class WebVTT: @property def total_length(self): """Returns the total length of the captions.""" + if not self.captions: + return 0 return int(self.captions[-1].end) - int(self.captions[0].start) \ No newline at end of file
Total length to return 0 if there are no captions
glut23_webvtt-py
train
py,py
8c6d46e0105d2f3a2415a00426c54d26beee6af1
diff --git a/src/entity/entity.js b/src/entity/entity.js index <HASH>..<HASH> 100644 --- a/src/entity/entity.js +++ b/src/entity/entity.js @@ -131,8 +131,8 @@ var image = typeof settings.image === "object" ? settings.image : me.loader.getImage(settings.image); this.renderable = new me.AnimationSheet(0, 0, { "image" : image, - "spritewidth" : ~~settings.spritewidth, - "spriteheight" : ~~settings.spriteheight, + "spritewidth" : ~~(settings.spritewidth || settings.width), + "spriteheight" : ~~(settings.spriteheight || settings.height), "spacing" : ~~settings.spacing, "margin" : ~~settings.margin });
[#<I>] Fix bad merge
melonjs_melonJS
train
js
be815c5adb5233e464140fd80aa2f95115252abe
diff --git a/tests/core/network/test_grids.py b/tests/core/network/test_grids.py index <HASH>..<HASH> 100644 --- a/tests/core/network/test_grids.py +++ b/tests/core/network/test_grids.py @@ -1821,7 +1821,7 @@ class TestLVGridDing0(object): basic_lv_grid.build_grid() assert len(basic_lv_grid._loads) == 9 - assert len(list(basic_lv_grid._graph.node)) == 28 + assert len(list(basic_lv_grid._graph.nodes)) == 28 assert (basic_lv_grid._loads[n].peak_load == 176 for n in range(0, 4)) assert (basic_lv_grid._loads[n].peak_load == 56 for n in range(4, 9)) @@ -1840,7 +1840,7 @@ class TestLVGridDing0(object): basic_lv_grid.build_grid() assert len(basic_lv_grid._loads) == 29 - assert len(basic_lv_grid._graph.node) == 29 + 2*29 + 1 + assert len(basic_lv_grid._graph.nodes) == 29 + 2*29 + 1 assert (round(basic_lv_grid._loads[n].peak_load) == 10.0 for n in range(0, 29))
fixes to ensure networkx compatibility with version <I>
openego_ding0
train
py
9d768f9026f46572caf05cc7bc59b0b98c59308d
diff --git a/Collection.php b/Collection.php index <HASH>..<HASH> 100755 --- a/Collection.php +++ b/Collection.php @@ -245,11 +245,18 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate */ public function groupBy($groupBy) { - $results = array(); + $results = []; foreach ($this->items as $key => $value) { - $results[$this->getGroupByKey($groupBy, $key, $value)][] = $value; + $groupKey = $this->getGroupByKey($groupBy, $key, $value); + + if ( ! array_key_exists($groupKey, $results)) + { + $results[$groupKey] = new static; + } + + $results[$groupKey]->push($value); } return new static($results);
Return nested collection from groupBy
illuminate_support
train
php
249f3d4cc458b92512f542ed8bf59817e1199ea1
diff --git a/tests/engine_tools/restore_hazards_test.py b/tests/engine_tools/restore_hazards_test.py index <HASH>..<HASH> 100644 --- a/tests/engine_tools/restore_hazards_test.py +++ b/tests/engine_tools/restore_hazards_test.py @@ -18,6 +18,11 @@ class TestCase(unittest.TestCase): 15\td 16\te''') + TO_IMPORT_4 = io.StringIO(u'''\ + 4\tc + 5\td + 6\te''') + def setUp(self): self.curs = getcursor('job_init') self.curs.execute('create table _example(' @@ -47,6 +52,16 @@ class TestCase(unittest.TestCase): currval = self.curs.fetchone()[0] self.assertEqual(currval, 16) + # restore ids=4, 5, 6 + imported_total = safe_restore( + self.curs, self.TO_IMPORT_4, '_example', blocksize) + self.assertEqual(imported_total, (3, 3)) + self.curs.execute("select currval('_example_id_seq')") + currval = self.curs.fetchone()[0] + self.assertEqual(currval, 16) # the insertion routines contains + # a setval of the sequence id to the highest available value, so + # that some ids can be skipped; this behaviour avoids id clashes + def tearDown(self): self.curs.execute('drop table _example') self.curs.connection.commit()
Added a tests checking that setval is called correctly Former-commit-id: <I>be<I>ab7eade<I>fa<I>aef<I>b<I>
gem_oq-engine
train
py
660184dd92d1f13f1156dfceb1f22df327dfbd3c
diff --git a/flag_path.go b/flag_path.go index <HASH>..<HASH> 100644 --- a/flag_path.go +++ b/flag_path.go @@ -96,6 +96,11 @@ func (f *PathFlag) Apply(set *flag.FlagSet) error { return nil } +// ValueFromContext returns the flag’s value in the given Context. +func (f *PathFlag) ValueFromContext(ctx *Context) string { + return ctx.Path(f.Name) +} + // Path looks up the value of a local PathFlag, returns // "" if not found func (c *Context) Path(name string) string { diff --git a/flag_test.go b/flag_test.go index <HASH>..<HASH> 100644 --- a/flag_test.go +++ b/flag_test.go @@ -501,6 +501,14 @@ func TestPathFlagApply_SetsAllNames(t *testing.T) { expect(t, v, "/path/to/file/PATH") } +func TestPathFlagValueFromContext(t *testing.T) { + set := flag.NewFlagSet("test", 0) + set.String("myflag", "/my/path", "doc") + ctx := NewContext(nil, set, nil) + f := &PathFlag{Name: "myflag"} + expect(t, f.ValueFromContext(ctx), "/my/path") +} + var envHintFlagTests = []struct { name string env string
PathFlag.ValueFromContext() as convenient accessor
urfave_cli
train
go,go
ff3a807dfe4b3dca665570da774f2fce235f6b90
diff --git a/src/native-bindings.js b/src/native-bindings.js index <HASH>..<HASH> 100644 --- a/src/native-bindings.js +++ b/src/native-bindings.js @@ -83,6 +83,23 @@ bindings.nativeGl2 = (nativeGl2 => { return WebGL2RenderingContext; })(bindings.nativeGl2); +bindings.nativeCanvasRenderingContext2D = (nativeCanvasRenderingContext2D => { + function CanvasRenderingContext2D(canvas) { + const ctx = new nativeCanvasRenderingContext2D(); + + if (CanvasRenderingContext2D.onconstruct(ctx, canvas)) { + return ctx; + } else { + return null; + } + } + for (const k in nativeCanvasRenderingContext2D) { + CanvasRenderingContext2D[k] = nativeCanvasRenderingContext2D[k]; + } + CanvasRenderingContext2D.onconstruct = null; + return CanvasRenderingContext2D; +})(bindings.nativeCanvasRenderingContext2D); + const {PannerNode} = nativeAudio; PannerNode.setPath(path.join(require.resolve('native-audio-deps').slice(0, -'index.js'.length), 'assets', 'hrtf')); if (nativeVr) {
Hook in nativeCanvasRenderingContext2D.onconstruct intercept in native-bindings
exokitxr_exokit
train
js
f0aeb6cf871c8e44e5725007dabdeb6fb7b10ea2
diff --git a/asammdf/blocks/mdf_v3.py b/asammdf/blocks/mdf_v3.py index <HASH>..<HASH> 100644 --- a/asammdf/blocks/mdf_v3.py +++ b/asammdf/blocks/mdf_v3.py @@ -3669,8 +3669,8 @@ class MDF3(MDF_Common): for info in group.data_blocks: address, size, block_size, block_type, param = ( info.address, - info.raw_size, - info.size, + info.original_size, + info.compressed_size, info.block_type, info.param, ) diff --git a/asammdf/blocks/mdf_v4.py b/asammdf/blocks/mdf_v4.py index <HASH>..<HASH> 100755 --- a/asammdf/blocks/mdf_v4.py +++ b/asammdf/blocks/mdf_v4.py @@ -10130,7 +10130,7 @@ class MDF4(MDF_Common): + channel_group.invalidation_bytes_nr ) - total_size = sum(blk.raw_size for blk in group.data_blocks) + total_size = sum(blk.original_size for blk in group.data_blocks) cycles_nr = total_size // samples_size virtual_channel_group = self.virtual_groups[index]
last two occurrences of .raw_size
danielhrisca_asammdf
train
py,py