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
16fbcddbd044f97ffdd922a88ef28f46bf1ecf43
diff --git a/tools/dependencyValidator.js b/tools/dependencyValidator.js index <HASH>..<HASH> 100644 --- a/tools/dependencyValidator.js +++ b/tools/dependencyValidator.js @@ -48,6 +48,9 @@ requests.forEach(/** @param {string} request */ request => { const scripts = funcs.findScripts(`src/request/${request}/index.html`); // console.log("scripts:", scripts); + const webJsIndex = scripts.indexOf('../../../node_modules/@nimiq/core-web/web.js'); + if (webJsIndex > -1) scripts[webJsIndex] = '../../../node_modules/@nimiq/core-web/web-offline.js'; + // Find missing and unneeded scripts const unneededScripts = scripts.slice(); const missingScripts = relativeDepsPaths.filter(depPath => {
Fix dependency check for full core-web/web.js script
nimiq_keyguard-next
train
js
19c7ec0b09465cf32f445f98c2a292da28279163
diff --git a/src/phonetics/alpha-sis.js b/src/phonetics/alpha-sis.js index <HASH>..<HASH> 100644 --- a/src/phonetics/alpha-sis.js +++ b/src/phonetics/alpha-sis.js @@ -130,7 +130,6 @@ export default function alphaSis(name) { throw Error('talisman/phonetics/alpha-sis: the given name is not a string.'); name = deburr(name) - .replace(/ß/g, 'SS') .toUpperCase() .replace(/[^A-Z]/g, ''); diff --git a/src/phonetics/fuzzy-soundex.js b/src/phonetics/fuzzy-soundex.js index <HASH>..<HASH> 100644 --- a/src/phonetics/fuzzy-soundex.js +++ b/src/phonetics/fuzzy-soundex.js @@ -71,7 +71,6 @@ export default function fuzzySoundex(name) { // Deburring the string & dropping any non-alphabetical character name = deburr(name) .toUpperCase() - .replace(/ß/g, 'SS') .replace(/[^A-Z]/g, ''); // Applying some substitutions for beginnings
Dropping ß replacement when already using the deburr function
Yomguithereal_talisman
train
js,js
90c8272b37850bba54a75c6c91088d473d19a1b7
diff --git a/abilian/web/assets/__init__.py b/abilian/web/assets/__init__.py index <HASH>..<HASH> 100644 --- a/abilian/web/assets/__init__.py +++ b/abilian/web/assets/__init__.py @@ -44,7 +44,8 @@ def requirejs_config(): RESOURCES_DIR = pkg_resources.resource_filename('abilian.web', 'resources') -JQUERY = Bundle('jquery/js/jquery-1.12.4.js') +JQUERY = Bundle('jquery/js/jquery-1.11.3.js', + 'jquery/js/jquery-migrate-1.2.1.js') BOOTBOX_JS = Bundle('bootbox/bootbox.js')
Rollback jquery upgrade for now.
abilian_abilian-core
train
py
cf11bf3cc7211a2245cf8f98170e2cbbc38f1f4c
diff --git a/nnet/sync/tests.py b/nnet/sync/tests.py index <HASH>..<HASH> 100644 --- a/nnet/sync/tests.py +++ b/nnet/sync/tests.py @@ -173,7 +173,7 @@ class Test(unittest.TestCase): self.templateDynamicSimulationClusterParameter(20, 4); def testDynamicSimulationClusterParameter6(self): - self.templateDynamicSimulationClusterParameters(20, 6); + self.templateDynamicSimulationClusterParameter(20, 6); if __name__ == "__main__":
[nnet.sync] Fix of test
annoviko_pyclustering
train
py
7d421cdf63e1da0070169515f569215b1ecd62f0
diff --git a/sqlg-core/src/main/java/org/umlg/sqlg/sql/parse/WhereClause.java b/sqlg-core/src/main/java/org/umlg/sqlg/sql/parse/WhereClause.java index <HASH>..<HASH> 100644 --- a/sqlg-core/src/main/java/org/umlg/sqlg/sql/parse/WhereClause.java +++ b/sqlg-core/src/main/java/org/umlg/sqlg/sql/parse/WhereClause.java @@ -135,6 +135,7 @@ public class WhereClause { } else if (p.getBiPredicate() instanceof Existence) { result += prefix + "." + sqlgGraph.getSqlDialect().maybeWrapInQoutes(hasContainer.getKey()); result += " " + p.getBiPredicate().toString(); + return result; } else if (p.getBiPredicate() instanceof ArrayContains) { prefix += "." + sqlgGraph.getSqlDialect().maybeWrapInQoutes(hasContainer.getKey()); result += sqlgGraph.getSqlDialect().getArrayContainsQueryText(prefix);
fix minor bug where return statement was deleted.
pietermartin_sqlg
train
java
4f69c68c8054cecaa65395f278d9a5400c8ff695
diff --git a/dic/container.py b/dic/container.py index <HASH>..<HASH> 100644 --- a/dic/container.py +++ b/dic/container.py @@ -44,9 +44,9 @@ class _ConstructorRegistration(_ComponentRegistration): # map of argument name -> argument type self.argument_types = {} - self.__inspect_constructor() + self._inspect_constructor() - def __find_constructor(self): + def _find_constructor(self): """ Finds the constructor from the class_type. :return: The constructor function. @@ -65,8 +65,8 @@ class _ConstructorRegistration(_ComponentRegistration): # No explicit __init__ return None - def __inspect_constructor(self): - constructor = self.__find_constructor() + def _inspect_constructor(self): + constructor = self._find_constructor() if constructor is not None: self.argument_types = constructor.__annotations__
Removes double underscore prefix for some 'private' methods
zsims_dic
train
py
2528ab67912da4f5dcb710b8048dc6c3ba8d7b4d
diff --git a/test/ios-plist-install.js b/test/ios-plist-install.js index <HASH>..<HASH> 100644 --- a/test/ios-plist-install.js +++ b/test/ios-plist-install.js @@ -74,12 +74,12 @@ exports['should install webless plugin'] = function (test) { exports['should move the js file'] = function (test) { var pluginsPath = path.join(test_dir, 'plugins'); var wwwPath = path.join(test_dir, 'projects', 'ios-plist', 'www'); + var jsPath = path.join(test_dir, 'projects', 'ios-plist', 'www', 'plugins', 'com.phonegap.plugins.childbrowser', 'www', 'childbrowser.js'); // run the platform-specific function ios.handlePlugin('install', test_project_dir, test_plugin_dir, plugin_et, { APP_ID: 12345 }); plugin_loader.handlePrepare(test_project_dir, pluginsPath, wwwPath, 'ios'); - - var jsPath = path.join(test_dir, 'projects', 'ios-plist', 'www', 'childbrowser.js'); + test.ok(fs.existsSync(jsPath)); test.ok(fs.statSync(jsPath).isFile()); test.done();
Fixed ios plist install with moving js file
apache_cordova-plugman
train
js
c409e753a550f1e4e67e6a876b39ffcb55ec77a8
diff --git a/jre_emul/Classes/com/google/j2objc/net/IosHttpURLConnection.java b/jre_emul/Classes/com/google/j2objc/net/IosHttpURLConnection.java index <HASH>..<HASH> 100644 --- a/jre_emul/Classes/com/google/j2objc/net/IosHttpURLConnection.java +++ b/jre_emul/Classes/com/google/j2objc/net/IosHttpURLConnection.java @@ -346,7 +346,6 @@ public class IosHttpURLConnection extends HttpURLConnection { self->responseException_ = [[JavaNetProtocolException alloc] initWithNSString:errMsg]; @throw self->responseException_; } - [request setValue:[self getContentType] forHTTPHeaderField:@"Content-Type"]; if (self->nativeRequestData_) { request.HTTPBody = [(NSDataOutputStream *) self->nativeRequestData_ data]; }
Issue <I>: merged patch that fixes infinite loop when updating content type of an HTTP response.
google_j2objc
train
java
969d0b39b27e1d14c0b3cc3b9804c8f64745ae53
diff --git a/classes/Boom/Exception/Handler/Priv.php b/classes/Boom/Exception/Handler/Priv.php index <HASH>..<HASH> 100644 --- a/classes/Boom/Exception/Handler/Priv.php +++ b/classes/Boom/Exception/Handler/Priv.php @@ -7,6 +7,7 @@ use Response; use Kohana_Exception; use View; use Boom\Page; +use Kohana; /** * Exception handler which doesn't output any debugging information
Fixed missing use statement for Kohana in Exception\Handler\Priv
boomcms_boom-core
train
php
63f636d1bbabfc05e2092bbb4f2cac2ae6eb0a12
diff --git a/svg_model/svgload/path_parser.py b/svg_model/svgload/path_parser.py index <HASH>..<HASH> 100644 --- a/svg_model/svgload/path_parser.py +++ b/svg_model/svgload/path_parser.py @@ -41,7 +41,7 @@ class PathDataParser(object): def get_number(self): ''' - .. versionchanged:: X.X.X + .. versionchanged:: 0.9.2 Add support for float exponent strings (e.g., ``3.435e-7``). Fixes `issue #4 <https://github.com/wheeler-microfluidics/svg-model/issues/4>`.
docs(version): add version notifications
sci-bots_svg-model
train
py
e9b21df115b480a00dfea5d3d2a3b838cf686f05
diff --git a/lib/graphql/execution/interpreter/runtime.rb b/lib/graphql/execution/interpreter/runtime.rb index <HASH>..<HASH> 100644 --- a/lib/graphql/execution/interpreter/runtime.rb +++ b/lib/graphql/execution/interpreter/runtime.rb @@ -223,7 +223,7 @@ module GraphQL continue_value = continue_value(next_path, inner_result, field_defn, return_type.non_null?, ast_node) if RawValue === continue_value # Write raw value directly to the response without resolving nested objects - write_in_response(next_path, continue_value.resolve) + write_in_response(next_path, continue_value.object) continue_value.object elsif HALT != continue_value continue_field(next_path, continue_value, field_defn, return_type, ast_node, next_selections, false, object, kwarg_arguments)
Update lib/graphql/execution/interpreter/runtime.rb
rmosolgo_graphql-ruby
train
rb
4356d022b9c40195eb80938f8c28dcf6d4131c99
diff --git a/salt/modules/acme.py b/salt/modules/acme.py index <HASH>..<HASH> 100644 --- a/salt/modules/acme.py +++ b/salt/modules/acme.py @@ -125,8 +125,7 @@ def cert(name, salt 'gitlab.example.com' acme.cert dev.example.com "[gitlab.example.com]" test_cert=True renew=14 webroot=/opt/gitlab/embedded/service/gitlab-rails/public ''' - # cmd = [LEA, 'certonly', '--quiet'] - cmd = [LEA, 'certonly'] + cmd = [LEA, 'certonly', '--non-interactive'] cert_file = _cert_file(name, 'cert') if not __salt__['file.file_exists'](cert_file):
Fix acme.cert to run certbot non-interactively Certbot should never be running interactively when executed via Salt, so this patch adds an argument to certbot which informs it to not run interactively. This fixes #<I>.
saltstack_salt
train
py
ef5ac23f5381afb9bd2b6438ed2f68e6a0247404
diff --git a/gargoyle/builtins.py b/gargoyle/builtins.py index <HASH>..<HASH> 100644 --- a/gargoyle/builtins.py +++ b/gargoyle/builtins.py @@ -20,6 +20,7 @@ class UserConditionSet(ModelConditionSet): username = String() email = String() is_anonymous = Boolean(label='Anonymous') + is_active = Boolean(label='Active') is_staff = Boolean(label='Staff') is_superuser = Boolean(label='Superuser') date_joined = OnOrAfterDate(label='Joined on or after')
Add is_active as a default condition of UserConditionSet
disqus_gargoyle
train
py
7c0fd6280802a027077f4ef18379038fcfa3beac
diff --git a/co.js b/co.js index <HASH>..<HASH> 100644 --- a/co.js +++ b/co.js @@ -5,16 +5,19 @@ var excludes = [ 'operation' ]; -module.exports = function() { - var db = seraph.apply(null, [].slice.call(arguments)); +module.exports = function(opts) { + var db = seraph(opts); return function wrapObject(obj) { + var copy = {}; Object.keys(obj).forEach(function(key) { if (typeof obj[key] == 'function' && excludes.indexOf(key) == -1 && key[0] != '_') { - obj[key] = thunkify(obj[key]); + copy[key] = thunkify(obj[key]); } else if (typeof obj[key] == 'object') { - obj[key] = wrapObject(obj[key]); + copy[key] = wrapObject(obj[key]); + } else { + copy[key] = obj[key]; } }); - return obj; + return copy; }(db); };
create methods on a copy of seraph
brikteknologier_seraph
train
js
4d7d64ea0928c4c9a3b2a317cade77b78c1f9423
diff --git a/tests/lib/context/format_test.js b/tests/lib/context/format_test.js index <HASH>..<HASH> 100644 --- a/tests/lib/context/format_test.js +++ b/tests/lib/context/format_test.js @@ -1,5 +1,4 @@ /* global assert:true, it, describe, beforeEach */ -/* global navigator, __dirname */ 'use strict'; import assert from 'assert';
remove global navigator from tests/lib/context
l20n_l20n.js
train
js
8122fed02ee5ffc128922d807a05f0f6507dae14
diff --git a/src/utils/write-images.js b/src/utils/write-images.js index <HASH>..<HASH> 100644 --- a/src/utils/write-images.js +++ b/src/utils/write-images.js @@ -38,8 +38,6 @@ module.exports = function (opts) { rasterizeTasks.push(rasterizeTask); }); - RSVP.all(rasterizeTasks).then(() => { - resolve(opts.platformSizes) - }); + RSVP.all(rasterizeTasks).then(() => resolve(opts.platformSizes)); }); };
refactor(write-images): Update util to single line then callback
isleofcode_splicon
train
js
faded2dc786626d455ea00c01cca10c2c1a81322
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/driver/DriverStatusManager.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/driver/DriverStatusManager.java index <HASH>..<HASH> 100644 --- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/driver/DriverStatusManager.java +++ b/reef-common/src/main/java/com/microsoft/reef/runtime/common/driver/DriverStatusManager.java @@ -52,10 +52,10 @@ public final class DriverStatusManager { * @param exceptionCodec */ @Inject - public DriverStatusManager(final Clock clock, - final ClientConnection clientConnection, - final @Parameter(AbstractDriverRuntimeConfiguration.JobIdentifier.class) String jobIdentifier, - final ExceptionCodec exceptionCodec) { + DriverStatusManager(final Clock clock, + final ClientConnection clientConnection, + final @Parameter(AbstractDriverRuntimeConfiguration.JobIdentifier.class) String jobIdentifier, + final ExceptionCodec exceptionCodec) { this.clock = clock; this.clientConnection = clientConnection; this.jobIdentifier = jobIdentifier;
State checks for `DriverStatusManager`
apache_reef
train
java
a22653166397256c360e2978fec6d3733fe9a42e
diff --git a/Classes/RobertLemke/Plugin/Blog/Service/ContentService.php b/Classes/RobertLemke/Plugin/Blog/Service/ContentService.php index <HASH>..<HASH> 100755 --- a/Classes/RobertLemke/Plugin/Blog/Service/ContentService.php +++ b/Classes/RobertLemke/Plugin/Blog/Service/ContentService.php @@ -74,10 +74,10 @@ class ContentService { } /** - * @param PersistentNodeInterface $node + * @param NodeInterface $node * @return mixed */ - public function renderContent(PersistentNodeInterface $node) { + public function renderContent(NodeInterface $node) { $content = ''; /** @var \TYPO3\TYPO3CR\Domain\Model\Node $contentNode */
[BUGFIX] ContentService still uses PersistentNodeInterface
robertlemke_RobertLemke.Plugin.Blog
train
php
81b091ed17c59bc62808b412ab8f1faf015bf96c
diff --git a/doapi/__init__.py b/doapi/__init__.py index <HASH>..<HASH> 100644 --- a/doapi/__init__.py +++ b/doapi/__init__.py @@ -1,4 +1,4 @@ -__version__ = '0.1.1' +__version__ = '0.2.0.dev1' from .base import (DOEncoder, Region, Size, Account, Kernel, DropletUpgrade, Networks, NetworkInterface,
Perform further development on a dev branch
jwodder_doapi
train
py
0c532d50ac52bca48bf9906864daf6735d5d02de
diff --git a/demo/src/components/ConstituencyParserComponent.js b/demo/src/components/ConstituencyParserComponent.js index <HASH>..<HASH> 100644 --- a/demo/src/components/ConstituencyParserComponent.js +++ b/demo/src/components/ConstituencyParserComponent.js @@ -26,7 +26,7 @@ const description = ( </span> <a href="https://www.semanticscholar.org/paper/A-Minimal-Span-Based-Neural-Constituency-Parser-Stern-Andreas/593e4e749bd2dbcaf8dc25298d830b41d435e435" target="_blank" rel="noopener noreferrer">{' '} a Minimal Span Based Constituency Parser (Stern et al, 2017)</a> <span> - . This model uses <a href="https://arxiv.org/abs/1802.05365">ELMo embeddings</a>, which are completely character based and improve single model performance from 91.77 F1 to 94.11 F1 on the Penn Treebank, a 28% relative error reduction. + . This model uses <a href="https://arxiv.org/abs/1802.05365">ELMo embeddings</a>, which are completely character based and improves single model performance from 92.6 F1 to 94.11 F1 on the Penn Treebank, a 20% relative error reduction. </span> </span> );
use correct PTB results on demo page (#<I>)
allenai_allennlp
train
js
12abcca0a27d5b9879c1d88e6f33a3de77ea099e
diff --git a/src/Table.php b/src/Table.php index <HASH>..<HASH> 100644 --- a/src/Table.php +++ b/src/Table.php @@ -204,6 +204,15 @@ class Table extends Lister $this->columns[$name][] = $decorator; } + public function getColumnDecorators($name) + { + $dec = $this->columns[$name]; + if (!is_array($dec)) { + $dec = [$dec]; + } + return $dec; + } + /** * Will come up with a column object based on the field object supplied. * By default will use default column.
add ability to get column decorators of a table
atk4_ui
train
php
c23e139fb4c80b80cb607ca61f95a4528c434665
diff --git a/tests/frontend/org/voltdb/regressionsuites/TestFunctionsSuite.java b/tests/frontend/org/voltdb/regressionsuites/TestFunctionsSuite.java index <HASH>..<HASH> 100644 --- a/tests/frontend/org/voltdb/regressionsuites/TestFunctionsSuite.java +++ b/tests/frontend/org/voltdb/regressionsuites/TestFunctionsSuite.java @@ -441,7 +441,7 @@ public class TestFunctionsSuite extends RegressionSuite { cr = client.callProcedure("P1.insert", 1, "foo", 1, 1.0); assertEquals(ClientResponse.SUCCESS, cr.getStatus()); - // next one disabled until ENG-3485 + // next one disabled until ENG-3486 /*cr = client.callProcedure("PARAM_SUBSTRING", "eeoo"); assertEquals(ClientResponse.SUCCESS, cr.getStatus()); result = cr.getResults()[0]; @@ -511,7 +511,7 @@ public class TestFunctionsSuite extends RegressionSuite { project.addStmtProcedure("AGG_OF_SUBSTRING", "select MIN(SUBSTRING (DESC FROM 2)) from P1 where ID < -7"); // Test parameterizing functions - // next one disabled until ENG-3485 + // next one disabled until ENG-3486 //project.addStmtProcedure("PARAM_SUBSTRING", "select SUBSTRING(? FROM 2) from P1"); project.addStmtProcedure("PARAM_ABS", "select ABS(? + NUM) from P1");
ENG-<I> / ENG-<I>: Fix typo from previous commit
VoltDB_voltdb
train
java
4fea1668129f351642993f61c2df81f8e2347ad0
diff --git a/lib/route.js b/lib/route.js index <HASH>..<HASH> 100644 --- a/lib/route.js +++ b/lib/route.js @@ -54,7 +54,7 @@ function Route (methods, name, pattern, handlers) { throw new Error('Cannot generate path. Missing param ' + match.substr(1)); i++; - return params[key]; + return encodeURIComponent(params[key]); }); }; } diff --git a/lib/trail-router.js b/lib/trail-router.js index <HASH>..<HASH> 100644 --- a/lib/trail-router.js +++ b/lib/trail-router.js @@ -74,6 +74,14 @@ function TrailRouter (app) { _routes[name] = route; _routesOrder.push(route); }; + + _this.url = function (name, params) { + var r = _routes[name]; + if (!r) + throw new Error('Cannot generate path. No route named ' + name); + + return r.buildPath.apply(null, Array.prototype.slice.call(arguments, 1)); + }; /* ------------------------------------------------------------------- * Private Methods << Keep in alphabetical order >> @@ -128,5 +136,6 @@ function TrailRouter (app) { if (app) { app.all = f; app.register = _this.register; + app.url = _this.url; } }
Made path building for named routes public.
bretcope_koa-trail
train
js,js
fb0718689ca74deeb2a3471af199257758babd11
diff --git a/lib/collection.js b/lib/collection.js index <HASH>..<HASH> 100644 --- a/lib/collection.js +++ b/lib/collection.js @@ -1453,7 +1453,7 @@ Collection.prototype.stats = function(options, callback) { /** * @typedef {Object} Collection~findAndModifyWriteOpResult - * @property {object} value Document returned from findAndModify command. + * @property {object} value Document returned from the `findAndModify` command. If no documents were found, `value` will be `null` by default (`returnOriginal: true`), even if a document was upserted; if `returnOriginal` was false, the upserted document will be returned in that case. * @property {object} lastErrorObject The raw lastErrorObject returned from the command. * @property {Number} ok Is 1 if the command executed correctly. */
docs(Collection): clarify findAndModify's result.value * Clarify that findAndModify's result.value doesn't echo upserted docs * Clarify the value returned when upserting a document
mongodb_node-mongodb-native
train
js
404d099e769a0b31319219bbd0b839afb7dfa602
diff --git a/pyaxo.py b/pyaxo.py index <HASH>..<HASH> 100644 --- a/pyaxo.py +++ b/pyaxo.py @@ -571,8 +571,7 @@ class SqlitePersistence(object): self.db = self._open_db() def _open_db(self): - db = sqlite3.connect(':memory:', check_same_thread=self.nonthreaded, - factory=sqlite3.Connection) + db = sqlite3.connect(':memory:', check_same_thread=self.nonthreaded) db.row_factory = sqlite3.Row with db:
Do not pass the same factory class used by default
rxcomm_pyaxo
train
py
afcead019a77a01aa059122d333539853a7414cb
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -35,7 +35,6 @@ function buildBuildList() { return obj; } var buildList = buildBuildList(); -console.dir(buildList); module.exports = function(grunt) {
Remove diagnostic code from Gruntfile.js
basic-web-components_basic-web-components
train
js
3d5bc22f72b0c0c387571da0292cf98283978f2c
diff --git a/lib/metrics/Meter.js b/lib/metrics/Meter.js index <HASH>..<HASH> 100644 --- a/lib/metrics/Meter.js +++ b/lib/metrics/Meter.js @@ -100,5 +100,5 @@ Meter.prototype._getTime = function() { if (!process.hrtime) return Date.now(); var hrtime = process.hrtime(); - return hrtime[0] / 1000 + hrtime[1] / (1000 * 1000); + return hrtime[0] * 1000 + hrtime[1] / (1000 * 1000); }; diff --git a/lib/util/Stopwatch.js b/lib/util/Stopwatch.js index <HASH>..<HASH> 100644 --- a/lib/util/Stopwatch.js +++ b/lib/util/Stopwatch.js @@ -26,5 +26,5 @@ Stopwatch.prototype._getTime = function() { if (!process.hrtime) return Date.now(); var hrtime = process.hrtime(); - return hrtime[0] / 1000 + hrtime[1] / (1000 * 1000); + return hrtime[0] * 1000 + hrtime[1] / (1000 * 1000); }; \ No newline at end of file
Fix High Resolution Timer bug when the time is greater than one second
yaorg_node-measured
train
js,js
711f810b9a8705d4d540c06285c4dfd279b409f9
diff --git a/seed_message_sender/__init__.py b/seed_message_sender/__init__.py index <HASH>..<HASH> 100644 --- a/seed_message_sender/__init__.py +++ b/seed_message_sender/__init__.py @@ -1,2 +1,2 @@ -__version__ = '0.9.9' +__version__ = '0.9.10' VERSION = __version__
bumped version to <I>
praekeltfoundation_seed-message-sender
train
py
7772cd70bd7eb9340193536b0ca275da9048a67f
diff --git a/src/Cmgmyr/Messenger/Models/Thread.php b/src/Cmgmyr/Messenger/Models/Thread.php index <HASH>..<HASH> 100644 --- a/src/Cmgmyr/Messenger/Models/Thread.php +++ b/src/Cmgmyr/Messenger/Models/Thread.php @@ -374,25 +374,6 @@ class Thread extends Eloquent */ public function userUnreadMessagesCount($userId) { - $messages = $this->messages()->get(); - $participant = $this->getParticipantFromUser($userId); - if (!$participant) { - return 0; - } - if (!$participant->last_read) { - return count($messages); - } - $count = 0; - $i = count($messages) - 1; - while ($i) { - if ($messages[$i]->updated_at->gt($participant->last_read)) { - ++$count; - } else { - break; - } - --$i; - } - - return $count; + return $this->userUnreadMessages($userId)->count(); } }
refactor to remove duplicated code
cmgmyr_laravel-messenger
train
php
21a8892d6a13246718103fe56133710184287c7f
diff --git a/lib/tracer.go b/lib/tracer.go index <HASH>..<HASH> 100644 --- a/lib/tracer.go +++ b/lib/tracer.go @@ -102,11 +102,15 @@ func (t *Tracer) GotFirstResponseByte() { // DNSStart hook. func (t *Tracer) DNSStart(info httptrace.DNSStartInfo) { t.dnsStart = time.Now() + t.dnsDone = t.dnsStart } // DNSDone hook. func (t *Tracer) DNSDone(info httptrace.DNSDoneInfo) { t.dnsDone = time.Now() + if t.dnsStart.IsZero() { + t.dnsStart = t.dnsDone + } } // ConnectStart hook.
[fix] Fixed negative/enormous lookup times
loadimpact_k6
train
go
0a9a0de562e90e24815389427b482ec323002822
diff --git a/tests/TestCase/Collection/CollectionTest.php b/tests/TestCase/Collection/CollectionTest.php index <HASH>..<HASH> 100644 --- a/tests/TestCase/Collection/CollectionTest.php +++ b/tests/TestCase/Collection/CollectionTest.php @@ -1112,6 +1112,11 @@ class CollectionTest extends TestCase $collection = new Collection(['a' => 1, 'b' => 2]); $combined = $collection->append(['c' => 3, 'a' => 4]); $this->assertEquals(['a' => 4, 'b' => 2, 'c' => 3], $combined->toArray()); + + $collection = new Collection([1, 2]); + $collection = $collection->append([3, 4]); + $combined = $collection->append([5, 6]); + $this->assertEquals([1, 2, 3, 4, 5, 6], $combined->toList()); } /**
Add test for append() Attempt to reproduce #<I>
cakephp_cakephp
train
php
9932144e893f8b395d7bfb3b913a7f00d4619f8d
diff --git a/course/mod.php b/course/mod.php index <HASH>..<HASH> 100644 --- a/course/mod.php +++ b/course/mod.php @@ -343,7 +343,7 @@ } exit; - } else if (!empty($groupmode) and confirm_sesskey()) { + } else if (isset($groupmode) and confirm_sesskey()) { $id = required_param( 'id', PARAM_INT );
Fixed group switch icon cannot set a module to use no groups
moodle_moodle
train
php
2780dfc62d414f907abceab6492cfa87c1871928
diff --git a/test/functional/ft_37_default_history.rb b/test/functional/ft_37_default_history.rb index <HASH>..<HASH> 100644 --- a/test/functional/ft_37_default_history.rb +++ b/test/functional/ft_37_default_history.rb @@ -95,8 +95,16 @@ class FtDefaultHistoryTest < Test::Unit::TestCase launch_processes(false) - assert_equal 18, @engine.history.reject { |m| m['action'] == 'noop' }.size - assert_equal 11, @engine.history.by_date(Time.now.utc).size + assert_equal( + 18, + @engine.history.reject { |m| + m['action'] == 'noop' + }.size) + assert_equal( + 9, + @engine.history.by_date(Time.now.utc).reject { |m| + m['action'] == 'noop' + }.size) end def test_wfids
ft_<I>: more noop rejection
jmettraux_ruote
train
rb
8d4b17228f4a43d4e020b4e9e56cabe2f4bda171
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -65,7 +65,7 @@ copyright = u'2013-2016, Pablo Acosta-Serafini' # The short X.Y version. version = '1.0.3' # The full version, including alpha/beta/rc tags. -release = '1.0.3rc1' +release = '1.0.3' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/peng/version.py b/peng/version.py index <HASH>..<HASH> 100644 --- a/peng/version.py +++ b/peng/version.py @@ -10,7 +10,7 @@ from __future__ import print_function ### # Global variables ### -VERSION_INFO = (1, 0, 3, 'candidate', 1) +VERSION_INFO = (1, 0, 3, 'final', 0) ###
Bumped version to <I>
pmacosta_peng
train
py,py
bf87ba097fcf986d6e2b77ae909ec039d4663f19
diff --git a/datasources/GeoJson.js b/datasources/GeoJson.js index <HASH>..<HASH> 100644 --- a/datasources/GeoJson.js +++ b/datasources/GeoJson.js @@ -86,6 +86,10 @@ GeoJsonSource.prototype = { }.bind(this)); } }, + + project: function(destinationProjection) { + this._project(destinationProjection); + }, _project: function(mapProjection) { var doBounds = !this._projectedData[mapProjection]; diff --git a/lib/Map.js b/lib/Map.js index <HASH>..<HASH> 100644 --- a/lib/Map.js +++ b/lib/Map.js @@ -141,6 +141,22 @@ Map.prototype = { } }, + /** + * Triggers all the map's datasources to prepare themselves. Usually this + * connecting to a database, loading and processing a file, etc. + * Calling this method is completely optional, but allows you to speed up + * rendering of the first tile. + */ + prepare: function() { + var projection = this.projection; + + this.datasources.forEach(function(datasource) { + datasource.load && datasource.load(function(error) { + datasource.project && datasource.project(projection); + }); + }); + }, + _processStyles: function() { this.processedStyles = this._renderer.processStyles(this.styles); }
Add ability to pre-emptively load and project data
nodetiles_nodetiles-core
train
js,js
0c90b643f167233cb25256739877acb1f686d00b
diff --git a/packages/dna-skin-ce-v0/index.js b/packages/dna-skin-ce-v0/index.js index <HASH>..<HASH> 100644 --- a/packages/dna-skin-ce-v0/index.js +++ b/packages/dna-skin-ce-v0/index.js @@ -6,14 +6,14 @@ * Just another components pattern. * Use with Skin template and Custom Elements v0 spec. */ -import { SkinTemplateMixin } from 'dna-skin/src/mixins/skin.js'; -import { mix, MIXINS, BaseComponent as OriginalComponent } from 'dna-custom-elements-v0'; +import { SkinTemplateMixin } from '@dnajs/skin/src/mixins/skin.js'; +import { mix, MIXINS, BaseComponent as OriginalComponent } from '@dnajs/custom-elements-v0'; MIXINS.SkinTemplateMixin = SkinTemplateMixin; export { mix, MIXINS }; -export { Template, IDOM } from 'dna-skin'; -export { registry, render, define, prop, shim, HELPERS } from 'dna-custom-elements-v0'; +export { Template, IDOM } from '@dnajs/skin'; +export { registry, render, define, prop, shim, HELPERS } from '@dnajs/custom-elements-v0'; export class BaseComponent extends mix(OriginalComponent).with( SkinTemplateMixin ) {}
fix: skin-ce-v0 imports
chialab_dna
train
js
28cebd1e4652e3631d8176f1a369726f17333775
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -33,6 +33,7 @@ function sassGenerateContents(destFilePath, creds, options){ for(var i = 0; i < len; i++){ spaceArr.push(spacer); } + return spaceArr.join(''); } @@ -135,10 +136,6 @@ function sassGenerateContents(destFilePath, creds, options){ return newFile; } - function getBase(filePath){ - return filePath.substring(0, replacePath(filePath).lastIndexOf(':')); - } - function throwWarning(fileName){ gutil.log(PLUGIN_NAME + ' Comments missing or malformed in file: ' + fileName + ' - File not included\n'); }
refactor: Strip getBase function as it is unused
andrewbrandwood_gulp-sass-generate-contents
train
js
3aed904e21e73de65f9445631fa04ab47f4b3d96
diff --git a/master/buildbot/worker/local.py b/master/buildbot/worker/local.py index <HASH>..<HASH> 100644 --- a/master/buildbot/worker/local.py +++ b/master/buildbot/worker/local.py @@ -43,6 +43,7 @@ class LocalWorker(Worker, WorkerAPICompatMixin): Worker.reconfigService(self, name, None, **kwargs) if workdir is None: workdir = name + # TODO: How to move working directory to the new place? workdir = os.path.abspath(os.path.join(self.master.basedir, "slaves", workdir)) if not os.path.isdir(workdir): os.makedirs(workdir)
add TODO note about moving working directory of worker
buildbot_buildbot
train
py
458099e9efba818bde28b7fe3bb22578ce0472d6
diff --git a/twistedchecker/checkers/docstring.py b/twistedchecker/checkers/docstring.py index <HASH>..<HASH> 100644 --- a/twistedchecker/checkers/docstring.py +++ b/twistedchecker/checkers/docstring.py @@ -47,11 +47,8 @@ def _getDecoratorsName(node): # Sometimes astng fails by raising this kind of error. pass else: - for name in names: - if name is YES: - # Whereas sometimes it fails by returning this magic token. - break - else: + # Whereas sometimes it fails by returning this magic token. + if YES not in names: return names # If pylint's attempt to discover the decorator's names has failed, fall # back to our own logic.
address lukasa's drive-by comment
twisted_twistedchecker
train
py
c22248bf9ed39e43ea8f78cd8f9ba402d125cc7e
diff --git a/src/Uri/WordPressUri.php b/src/Uri/WordPressUri.php index <HASH>..<HASH> 100644 --- a/src/Uri/WordPressUri.php +++ b/src/Uri/WordPressUri.php @@ -60,8 +60,8 @@ final class WordPressUri implements UriInterface * `example.com/subfolder` we need to strip down `/subfolder` from path and build a path * for route matching that is relative to home url. */ - $homePath = trim(rawurlencode(parse_url(home_url(), PHP_URL_PATH)), '/'); - $path = trim(rawurlencode($this->uri->getPath()), '/'); + $homePath = trim(parse_url(home_url(), PHP_URL_PATH), '/'); + $path = trim($this->uri->getPath(), '/'); if ($homePath && strpos($path, $homePath) === 0) { $path = trim(substr($path, strlen($homePath)), '/'); }
Remove rawurlencode for url path from WordPressUri
Brain-WP_Cortex
train
php
915f4337436bdabd478f70065068648093325695
diff --git a/kafka_scanner/__init__.py b/kafka_scanner/__init__.py index <HASH>..<HASH> 100644 --- a/kafka_scanner/__init__.py +++ b/kafka_scanner/__init__.py @@ -603,10 +603,6 @@ class KafkaScannerDirect(KafkaScannerSimple): self._lower_offsets = {partition: 0 for partition in self.init_consumer.offsets} else: self._lower_offsets = self.init_consumer.offsets.copy() - for p, o in self._lower_offsets.items(): - if self._upper_offsets[p] < o: - self._lower_offsets[p] = 0 - log.warning('Set lower offset for partition %d to 0', p) self.init_consumer.offsets.update(self._lower_offsets) self.init_consumer.count_since_commit += 1 self.init_consumer.commit()
this code is not needed anymore with KafkaConsumer
scrapinghub_kafka-scanner
train
py
d8e489443c23ad1b9753ee1b442bd586e1606796
diff --git a/metrics/cgroups/oom.go b/metrics/cgroups/oom.go index <HASH>..<HASH> 100644 --- a/metrics/cgroups/oom.go +++ b/metrics/cgroups/oom.go @@ -44,11 +44,14 @@ type oomCollector struct { } type oom struct { + // count needs to stay the first member of this struct to ensure 64bits + // alignment on a 32bits machine (e.g. arm32). This is necessary as we use + // the sync/atomic operations on this field. + count int64 id string namespace string c cgroups.Cgroup triggers []Trigger - count int64 } func (o *oomCollector) Add(id, namespace string, cg cgroups.Cgroup, triggers ...Trigger) error {
linux: Ensure count is <I>bits aligned for proper atomic use on <I>bits machines
containerd_containerd
train
go
499e1f3af8220a027dec570995c93f5d594bb203
diff --git a/src/Dispatcher.php b/src/Dispatcher.php index <HASH>..<HASH> 100644 --- a/src/Dispatcher.php +++ b/src/Dispatcher.php @@ -52,6 +52,7 @@ class Dispatcher { * @param $method * @param $action * @param $data + * @return mixed * @throws \Exception */ public static function send ($method, $action, $data) { @@ -101,7 +102,7 @@ class Dispatcher { // Retrieve and decode contents $jsonContents = $request->getBody()->getContents(); $contents = json_decode($jsonContents); - + // Throw customised exception in case decoding fails if (json_last_error() !== 0) throw new \Exception('Eroare la parsarea raspunsului: ' . $jsonContents);
Fixed phpdoc modified: src/Dispatcher.php
celdotro_marketplace
train
php
e4d03d70853ef54ce6578fd84da83763a8830474
diff --git a/lib/rubocop/cop/style/when_then.rb b/lib/rubocop/cop/style/when_then.rb index <HASH>..<HASH> 100644 --- a/lib/rubocop/cop/style/when_then.rb +++ b/lib/rubocop/cop/style/when_then.rb @@ -8,7 +8,7 @@ module RuboCop MSG = 'Do not use `when x;`. Use `when x then` instead.'.freeze def on_when(node) - return if node.multiline? || node.then? + return if node.multiline? || node.then? || !node.body add_offense(node, :begin) end diff --git a/spec/rubocop/cop/style/when_then_spec.rb b/spec/rubocop/cop/style/when_then_spec.rb index <HASH>..<HASH> 100644 --- a/spec/rubocop/cop/style/when_then_spec.rb +++ b/spec/rubocop/cop/style/when_then_spec.rb @@ -39,4 +39,15 @@ describe RuboCop::Cop::Style::WhenThen do 'when b then c', 'end'].join("\n")) end + + # Regression: https://github.com/bbatsov/rubocop/issues/3868 + context 'when inspecting a case statement with an empty branch' do + it 'does not register an offense' do + inspect_source(cop, ['case value', + 'when cond1', + 'end']) + + expect(cop.offenses).to be_empty + end + end end
[Fix #<I>] Prevent `Style/WhenThen` from breaking on an empty branch This cop would blow up when inspecting a `case` statement with an empty `when` branch. This was missing a test case, and a regression caused by the introduction of node extensions. This change fixes it.
rubocop-hq_rubocop
train
rb,rb
8f709c023270369dea055a8a83ec309cdbf14f4b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -10,6 +10,9 @@ setup( maintainer='Alex Tomkins', maintainer_email='[email protected]', platforms=['any'], + install_requires=[ + 'blanc-basic-assets>=0.3', + ], packages=find_packages(), classifiers=[ 'Environment :: Web Environment',
Add blanc-basic-assets to install_requires
developersociety_blanc-basic-news
train
py
34470c7342cfc8f53a8793e11d9c2b70f4ac2b7a
diff --git a/lib/arjdbc/postgresql/base/pgconn.rb b/lib/arjdbc/postgresql/base/pgconn.rb index <HASH>..<HASH> 100644 --- a/lib/arjdbc/postgresql/base/pgconn.rb +++ b/lib/arjdbc/postgresql/base/pgconn.rb @@ -1,8 +1,8 @@ -module ActiveRecord::ConnectionAdapters::PostgreSQL::OID - class PGconn # emulate PGconn#unescape_bytea due #652 +module PG + class Connection # emulate PGconn#unescape_bytea due #652 # NOTE: on pg gem ... PGconn = (class) PG::Connection def self.unescape_bytea(escaped) ArJdbc::PostgreSQL.unescape_bytea(escaped) end end -end \ No newline at end of file +end
Updated patch for PGConn to patch PG::Connection since <I> updated references to it
jruby_activerecord-jdbc-adapter
train
rb
3840b964fce76a8ba76d4067fb3a11b3fd5f9713
diff --git a/Client/RdKafkaDriver.php b/Client/RdKafkaDriver.php index <HASH>..<HASH> 100644 --- a/Client/RdKafkaDriver.php +++ b/Client/RdKafkaDriver.php @@ -79,18 +79,6 @@ class RdKafkaDriver implements DriverInterface $clientMessage->setContentType($contentType); } - if ($expiration = $message->getHeader('expiration')) { - $clientMessage->setExpire($expiration); - } - - if ($delay = $message->getHeader('delay')) { - $clientMessage->setDelay($delay); - } - - if ($priority = $message->getHeader('priority')) { - $clientMessage->setPriority($priority); - } - return $clientMessage; }
Remove expiration, delay and priority from the RdKafka driver
php-enqueue_rdkafka
train
php
504e20c704a736580a861cb36c4d1bf2367bb400
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb index <HASH>..<HASH> 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb @@ -335,6 +335,9 @@ class ProfilesController < ApplicationController arules2 = ActiveRule.find(:all, :order => 'rules.plugin_name, rules.plugin_rule_key', :include => [{:active_rule_parameters => :rules_parameter}, :rule], :conditions => ['active_rules.profile_id=?', @profile2.id]) + arules1.reject! { |arule| !arule.rule.enabled } + arules2.reject! { |arule| !arule.rule.enabled } + diffs_by_rule={} arules1.each do |arule1| diffs_by_rule[arule1.rule]||=RuleDiff.new(arule1.rule)
SONAR-<I> Filter disable rules in "Compare Profiles"
SonarSource_sonarqube
train
rb
a5e01a26bf423b533a03ad2193e68e6612d3151c
diff --git a/collatex-tools/src/main/java/eu/interedition/collatex/tools/CollationPipe.java b/collatex-tools/src/main/java/eu/interedition/collatex/tools/CollationPipe.java index <HASH>..<HASH> 100644 --- a/collatex-tools/src/main/java/eu/interedition/collatex/tools/CollationPipe.java +++ b/collatex-tools/src/main/java/eu/interedition/collatex/tools/CollationPipe.java @@ -150,9 +150,7 @@ public class CollationPipe { } final VariantGraph variantGraph = new VariantGraph(); - for (SimpleWitness witness : witnesses) { - collationAlgorithm.collate(variantGraph, witness); - } + collationAlgorithm.collate(variantGraph, witnesses); if (joined && !commandLine.hasOption("t")) { VariantGraph.JOIN.apply(variantGraph);
Bug fix for the "non progressive alignment" exception in the command-line tool of CollateX when using the <I>.X version of the DekkerAlgorithm.
interedition_collatex
train
java
6d0ae12d372e07e4eae1fe61578f121b3e66310f
diff --git a/system/HTTP/IncomingRequest.php b/system/HTTP/IncomingRequest.php index <HASH>..<HASH> 100644 --- a/system/HTTP/IncomingRequest.php +++ b/system/HTTP/IncomingRequest.php @@ -337,15 +337,16 @@ class IncomingRequest extends Request //-------------------------------------------------------------------- /** - * Fetch an item from PUT data. + * A convenience method that grabs the raw input stream and decodes + * the String into an array. * - * @return array + * @return mixed */ - public function getPut() + public function getRawString() { - parse_str($this->body, $data); + parse_str($this->body, $output); - return $data; + return $output; } //--------------------------------------------------------------------
Rename function getPut to getRawString Fetch data from raw stream when http request send by PUT, PATCH, DELETE
codeigniter4_CodeIgniter4
train
php
fc13bb27e2affac733306f4e0c6a3ed905d92ae1
diff --git a/src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php b/src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php +++ b/src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php @@ -123,7 +123,7 @@ final class LightSmsTransport extends AbstractTransport throw new TransportException('Unable to send the SMS: '.self::ERROR_CODES[$content['error']], $response); } - $phone = preg_replace("/[^\d]/", '', $message->getPhone()); + $phone = $this->escapePhoneNumber($message->getPhone()); if (32 === $content[$phone]['error']) { throw new TransportException('Unable to send the SMS: '.self::ERROR_CODES[$content['error']], $response); } @@ -159,6 +159,6 @@ final class LightSmsTransport extends AbstractTransport private function escapePhoneNumber($phoneNumber): string { - return str_replace('+', '', $phoneNumber); + return preg_replace("/[^\d]/", '', $phoneNumber); } }
* LightSmsTransport.php - changed login for validation (the same like we have all places)
symfony_symfony
train
php
d91d11774c00bdb4f6e4e6ea39c28833d1b57866
diff --git a/doc/conf.py b/doc/conf.py index <HASH>..<HASH> 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -56,9 +56,9 @@ copyright = u'2010-2018, Sergio Pascual, Nicolás Cardiel' # built documents. # # The short X.Y version. -version = '0.10' +version = '0.11' # The full version, including alpha/beta/rc tags. -release = '0.10.dev1' +release = '0.11.dev0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/emirdrp/__init__.py b/emirdrp/__init__.py index <HASH>..<HASH> 100644 --- a/emirdrp/__init__.py +++ b/emirdrp/__init__.py @@ -21,7 +21,7 @@ import logging -__version__ = '0.10.dev1' +__version__ = '0.11.dev0' # Top level NullHandler
Update to version <I>.dev0
guaix-ucm_pyemir
train
py,py
9b30e40110ae55ddc8cec375a1daecb4642658a7
diff --git a/src/application/action-builder.js b/src/application/action-builder.js index <HASH>..<HASH> 100644 --- a/src/application/action-builder.js +++ b/src/application/action-builder.js @@ -97,7 +97,7 @@ function _errorOnCall(config, err){ * - status(:string)} The status after the action. * @return {function} - The build action from the configuration. This action dispatch the preStatus, call the service and dispatch the result from the server. */ -module.exports = function actionBuilder(config = {}){ +export default function actionBuilder(config = {}){ config.type = config.type || 'update'; config.preStatus = config.preStatus || 'loading'; config.shouldDumpStoreOnActionCall = config.shouldDumpStoreOnActionCall || false; @@ -125,3 +125,9 @@ module.exports = function actionBuilder(config = {}){ }); }; }; + +export { + _errorOnCall as errorOnCall, + _dispatchServiceResponse as dispatchServiceResponse, + _preServiceCall as preServiceCall + };
Export of the different steps of the actionBuilder (#<I>) * Export of the different steps of the actionBuilder * Update action-builder.js
KleeGroup_focus-core
train
js
cda608dc76d67c3a7af689306220e93cc9e73d71
diff --git a/buildbot/changes/hgbuildbot.py b/buildbot/changes/hgbuildbot.py index <HASH>..<HASH> 100644 --- a/buildbot/changes/hgbuildbot.py +++ b/buildbot/changes/hgbuildbot.py @@ -92,7 +92,7 @@ def hook(ui, repo, hooktype, node=None, source=None, **kwargs): if branch is None: if branchtype is not None: if branchtype == 'dirname': - branch = os.path.basename(os.getcwd()) + branch = os.path.basename(repo.root) if branchtype == 'inrepo': branch = workingctx(repo).branch()
allow hgbuildbot to work properly with branchtype=dirname but where cwd is not the repo
buildbot_buildbot
train
py
97bfcca9b1340e2d71412251dbb5dcf4c7a519f2
diff --git a/irc3/plugins/command.py b/irc3/plugins/command.py index <HASH>..<HASH> 100644 --- a/irc3/plugins/command.py +++ b/irc3/plugins/command.py @@ -289,8 +289,12 @@ class Commands(dict): if data: if not isinstance(data, str): # pragma: no cover data = data.encode(encoding) - data = self.split_command( - data, use_shlex=predicates.get('use_shlex', True)) + try: + data = self.split_command( + data, use_shlex=predicates.get('use_shlex', True)) + except ValueError as e: + self.context.privmsg(to, 'Invalid arguments: {}.'.format(e)) + return docopt_args = dict(help=False) if "options_first" in predicates: docopt_args.update(options_first=predicates["options_first"])
Add verbosity when parsing command args with shlex
gawel_irc3
train
py
40f0e5fbc3c8aab79ee2cd74c21bc4a68a84e276
diff --git a/python/phonenumbers/phonenumberutil.py b/python/phonenumbers/phonenumberutil.py index <HASH>..<HASH> 100644 --- a/python/phonenumbers/phonenumberutil.py +++ b/python/phonenumbers/phonenumberutil.py @@ -2857,7 +2857,10 @@ def parse(number, region=None, keep_raw_input=False, # prefix and carrier code be long enough to be a possible length for # the region. Otherwise, we don't do the stripping, since the original # number could be a valid short number. - if _test_number_length(potential_national_number, metadata) != ValidationResult.TOO_SHORT: + validation_result = _test_number_length(potential_national_number, metadata) + if (validation_result != ValidationResult.TOO_SHORT and + validation_result != ValidationResult.IS_POSSIBLE_LOCAL_ONLY and + validation_result != ValidationResult.INVALID_LENGTH): normalized_national_number = potential_national_number if keep_raw_input and carrier_code is not None and len(carrier_code) > 0: numobj.preferred_domestic_carrier_code = carrier_code
Better national-prefix detection & stripping (#<I>) First part of porting code change <URL>
daviddrysdale_python-phonenumbers
train
py
42befa7cc7db6794f49c317ace766232e58bb502
diff --git a/src/lang/ja.js b/src/lang/ja.js index <HASH>..<HASH> 100644 --- a/src/lang/ja.js +++ b/src/lang/ja.js @@ -31,6 +31,6 @@ module.exports = { string : ":attributeは:size文字で入力してください。" }, url : ":attributeは正しいURIを入力してください。", - regex : ":attributeの値 \":value\" はパターンにマッチする必要があります。", + regex : ":attributeの値はパターンにマッチする必要があります。", attributes : {} };
Removed `:value` placeholder
skaterdav85_validatorjs
train
js
e234e0010f74f7e8b31317436a04866cc44e116c
diff --git a/server.go b/server.go index <HASH>..<HASH> 100644 --- a/server.go +++ b/server.go @@ -44,7 +44,7 @@ func newServer(address, username, password string, config *Config, newMcConn con func (s *server) perform(m *msg) error { var err error for i := 0; ; { - timeout := time.Tick(s.config.ConnectionTimeout) + timeout := time.After(s.config.ConnectionTimeout) select { case c := <-s.pool: // NOTE: this serverConn is no longer available in the pool (equivalent to locking) @@ -89,7 +89,7 @@ func (s *server) perform(m *msg) error { } func (s *server) performStats(m *msg) (mcStats, error) { - timeout := time.Tick(s.config.ConnectionTimeout) + timeout := time.After(s.config.ConnectionTimeout) select { case c := <-s.pool: // NOTE: this serverConn is no longer available in the pool (equivalent to locking)
Replace leaking ticker with simple timeout, fixes #4
memcachier_mc
train
go
f56db717c8844eafff3cd0841e371c8456a89d3b
diff --git a/lib/ronin/scanner.rb b/lib/ronin/scanner.rb index <HASH>..<HASH> 100644 --- a/lib/ronin/scanner.rb +++ b/lib/ronin/scanner.rb @@ -37,6 +37,24 @@ module Ronin end # + # Returns all scanner tests in the specified _category_. + # + def scanners_for(name) + name = name.to_sym + tests = [] + + ancestors.each do |ancestor| + if ancestor.include?(Ronin::Scanner) + if ancestor.scanners.has_key?(name) + tests += ancestor.scanners[name] + end + end + end + + return tests + end + + # # Returns the category names of all defined scanners. # def scans_for diff --git a/spec/scanner_spec.rb b/spec/scanner_spec.rb index <HASH>..<HASH> 100644 --- a/spec/scanner_spec.rb +++ b/spec/scanner_spec.rb @@ -31,6 +31,13 @@ describe Scanner do AnotherScanner.scans_for?(:test2).should == true end + it "should return all scanner tests within a category" do + tests = ExampleScanner.scanners_for(:test2) + + tests.length.should == 2 + tests.all? { |test| test.kind_of?(Proc) }.should == true + end + it "should specify the category names of all tests" do ExampleScanner.scans_for.should == Set[:test1, :test2] AnotherScanner.scans_for.should == Set[:test1, :test2, :test3]
Added Scanners.scanners_for.
ronin-ruby_ronin
train
rb,rb
b93b49d4fbe0428d39bab6e0e6f7dfd9bf727150
diff --git a/spec/integration/integration_helper.rb b/spec/integration/integration_helper.rb index <HASH>..<HASH> 100644 --- a/spec/integration/integration_helper.rb +++ b/spec/integration/integration_helper.rb @@ -131,7 +131,7 @@ module IntegrationHelper end def count_all(table) - query = "select count(*) from #{ table }" + query = "select count(*) from `#{ table }`" select_value(query).to_i end
Quotes table name in count_all method in integration_helper
soundcloud_lhm
train
rb
91ea7f879d49614e0654409349dd25f436ca6199
diff --git a/src/tree/assess/scoreAggregators/ReadabilityScoreAggregator.js b/src/tree/assess/scoreAggregators/ReadabilityScoreAggregator.js index <HASH>..<HASH> 100644 --- a/src/tree/assess/scoreAggregators/ReadabilityScoreAggregator.js +++ b/src/tree/assess/scoreAggregators/ReadabilityScoreAggregator.js @@ -6,6 +6,8 @@ import { ScoreAggregator } from "../index"; /** * Total number of available readability assessments. * + * To do: Compute this, rather than set this and keep this updated (see https://github.com/Yoast/YoastSEO.js/pull/2176#discussion_r261547836) + * * @type {number} * @const */
Added todo comment to make sure we compute the total number of readability assessments, instead of setting it as a constant.
Yoast_YoastSEO.js
train
js
4fd12b0f12f857284ece63c8a685a0a7f5b67123
diff --git a/packages/blueprint-handlebars/app/services/handlebars.js b/packages/blueprint-handlebars/app/services/handlebars.js index <HASH>..<HASH> 100644 --- a/packages/blueprint-handlebars/app/services/handlebars.js +++ b/packages/blueprint-handlebars/app/services/handlebars.js @@ -44,6 +44,16 @@ module.exports = Service.extend ({ }), /** + * Compile a template. + * + * @param path + * @returns {*} + */ + compile (path) { + return this._templateCompiler.compile (path); + }, + + /** * Initialize the handlebars environment instance. * * @private diff --git a/packages/blueprint-handlebars/lib/template-compiler.js b/packages/blueprint-handlebars/lib/template-compiler.js index <HASH>..<HASH> 100644 --- a/packages/blueprint-handlebars/lib/template-compiler.js +++ b/packages/blueprint-handlebars/lib/template-compiler.js @@ -14,9 +14,9 @@ module.exports = class TemplateCompiler { } /** - * Compile the template - * @param name - * @returns {Promise<null|*>} + * Compile the template. + * + * @param path Path to template file. */ async compile (path) { const exists = await fse.pathExists (path);
feat: added compile() method to the service
onehilltech_blueprint
train
js,js
741b39cb4a65e5f3f846ba6f5f116c4e54997257
diff --git a/lib/js-yaml/type/pairs.js b/lib/js-yaml/type/pairs.js index <HASH>..<HASH> 100644 --- a/lib/js-yaml/type/pairs.js +++ b/lib/js-yaml/type/pairs.js @@ -9,12 +9,14 @@ var _toString = Object.prototype.toString; function resolveYamlPairs(object, explicit) { - var index, length, pair; + var index, length, pair, keys, result; if ('[object Array]' !== _toString.call(object)) { return NIL; } + result = new Array(object.length); + for (index = 0, length = object.length; index < length; index += 1) { pair = object[index]; @@ -22,12 +24,16 @@ function resolveYamlPairs(object, explicit) { return NIL; } - if (1 !== Object.keys(pair).length) { + keys = Object.keys(pair); + + if (1 !== keys.length) { return NIL; } + + result[index] = [ keys[0], pair[keys[0]] ]; } - return object; + return result; }
Correct !!pairs resolver.
nodeca_js-yaml
train
js
869711185cb5b5d31aa5a79250cbf8b53a22b15d
diff --git a/src/Listener/ViewSearchListener.php b/src/Listener/ViewSearchListener.php index <HASH>..<HASH> 100644 --- a/src/Listener/ViewSearchListener.php +++ b/src/Listener/ViewSearchListener.php @@ -43,6 +43,7 @@ class ViewSearchListener extends BaseListener */ public function afterPaginate(Event $event) { + $event; if (!$this->_table()->behaviors()->has('Search')) { return; }
fix: reference event to quiet scrutinizer
FriendsOfCake_crud-view
train
php
179edc32a8f3deaefa08e76a99421655696a840b
diff --git a/test/tc_aggs.rb b/test/tc_aggs.rb index <HASH>..<HASH> 100644 --- a/test/tc_aggs.rb +++ b/test/tc_aggs.rb @@ -91,6 +91,7 @@ class PriorityQ end end +# XXX: not used by any tests class DupAggs include Bud
Mark unused code in test case.
bloom-lang_bud
train
rb
910dfdcb500dd7866939ed65bd5d37d7d42e3356
diff --git a/git/git.go b/git/git.go index <HASH>..<HASH> 100644 --- a/git/git.go +++ b/git/git.go @@ -186,7 +186,7 @@ func Show(sha string) (string, error) { func Log(sha1, sha2 string) (string, error) { execCmd := cmd.New("git") - execCmd.WithArg("log").WithArg("--no-color") + execCmd.WithArg("-c").WithArg("log.showSignature=false").WithArg("log").WithArg("--no-color") execCmd.WithArg("--format=%h (%aN, %ar)%n%w(78,3,3)%s%n%+b") execCmd.WithArg("--cherry") shaRange := fmt.Sprintf("%s...%s", sha1, sha2)
Negate `log.showSignature` in commits preview for `pull-request` Fixes #<I>
github_hub
train
go
9ab98f00fe11bd5ace1fc46f1e7364997847dc45
diff --git a/pyIOSXR/iosxr.py b/pyIOSXR/iosxr.py index <HASH>..<HASH> 100644 --- a/pyIOSXR/iosxr.py +++ b/pyIOSXR/iosxr.py @@ -589,7 +589,7 @@ class IOSXR(object): if len(comment) <= 60: rpc_command += ' Comment="%s"' % comment else: - raise InvalidInputError('comment needs to be shorter than 60 characters', self) + raise InvalidInputError('comment should be no more than 60 characters', self) if confirmed: if 30 <= int(confirmed) <= 300: rpc_command += ' Confirmed="%d"' % int(confirmed)
Update error message for commit comment length error Rephrase the commit comment error to better reflect the limits.
fooelisa_pyiosxr
train
py
713e8a5225de7821f06b4518b1394e058a8787ca
diff --git a/plugins/Live/API.php b/plugins/Live/API.php index <HASH>..<HASH> 100644 --- a/plugins/Live/API.php +++ b/plugins/Live/API.php @@ -424,10 +424,14 @@ class API extends \Piwik\Plugin\API $orderByDir = "ASC"; } + $visitLastActionDate = Date::factory($visitLastActionTime); + $dateOneDayAgo = $visitLastActionDate->subDay(1); + $dateOneDayInFuture = $visitLastActionDate->addDay(1); + $select = "log_visit.idvisitor, MAX(log_visit.visit_last_action_time) as visit_last_action_time"; $from = "log_visit"; - $where = "log_visit.idsite = ? AND log_visit.idvisitor <> ?"; - $whereBind = array($idSite, @Common::hex2bin($visitorId)); + $where = "log_visit.idsite = ? AND log_visit.idvisitor <> ? AND visit_last_action_time >= ? and visit_last_action_time <= ?"; + $whereBind = array($idSite, @Common::hex2bin($visitorId), $dateOneDayAgo->toString('Y-m-d H:i:s'), $dateOneDayInFuture->toString('Y-m-d H:i:s')); $orderBy = "MAX(log_visit.visit_last_action_time) $orderByDir"; $groupBy = "log_visit.idvisitor";
refs #<I> only search for prev/next visitor one day in the past and future
matomo-org_matomo
train
php
9565a9879280d83c6c3987d3a6f8b8933168cedf
diff --git a/airflow/utils/log/gcs_task_handler.py b/airflow/utils/log/gcs_task_handler.py index <HASH>..<HASH> 100644 --- a/airflow/utils/log/gcs_task_handler.py +++ b/airflow/utils/log/gcs_task_handler.py @@ -138,10 +138,10 @@ class GCSTaskHandler(FileTaskHandler, LoggingMixin): if append: try: old_log = self.gcs_read(remote_log_location) + log = '\n'.join([old_log, log]) if old_log else log except Exception as e: if not hasattr(e, 'resp') or e.resp.get('status') != '404': - old_log = '*** Previous log discarded: {}\n\n'.format(str(e)) - log = '\n'.join([old_log, log]) if old_log else log + log = '*** Previous log discarded: {}\n\n'.format(str(e)) + log try: bkt, blob = self.parse_gcs_url(remote_log_location)
[AIRFLOW-<I>] Do not reference unassigned variable Closes #<I> from wrp/old_log
apache_airflow
train
py
352b18d22a05b11e5ff6aaaca2aba29397aa80de
diff --git a/activerecord/lib/active_record/associations/preloader.rb b/activerecord/lib/active_record/associations/preloader.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/associations/preloader.rb +++ b/activerecord/lib/active_record/associations/preloader.rb @@ -16,7 +16,7 @@ module ActiveRecord # When you load an author with all associated books Active Record will make # multiple queries like this: # - # Author.includes(:books).where(:name => ['bell hooks', 'Homer').to_a + # Author.includes(:books).where(name: ['bell hooks', 'Homer']).to_a # # => SELECT `authors`.* FROM `authors` WHERE `name` IN ('bell hooks', 'Homer') # => SELECT `books`.* FROM `books` WHERE `author_id` IN (2, 5)
docs, add missing closing bracket. [ci skip]
rails_rails
train
rb
770d9b32ef5c6d98f82e546db1db03aff9684218
diff --git a/generate.py b/generate.py index <HASH>..<HASH> 100644 --- a/generate.py +++ b/generate.py @@ -15,7 +15,7 @@ def functions(): cont = False for ln in f: - if cont is True: + if cont is ',': lines.append(ln) cont = False if cont is '{': @@ -32,7 +32,7 @@ def functions(): lines.append(ln) if ln.strip()[-1] != ';': - cont = True + cont = ',' if ln.strip()[-1] == '{': cont = '{' if ln.strip()[-1] == '(':
Pick useful value for normal line continuations
nanomsg_nnpy
train
py
118bce42453c704b161a816c14eaca9ff6a23abd
diff --git a/tests/unit/models/physics/HydraulicConductanceTest.py b/tests/unit/models/physics/HydraulicConductanceTest.py index <HASH>..<HASH> 100644 --- a/tests/unit/models/physics/HydraulicConductanceTest.py +++ b/tests/unit/models/physics/HydraulicConductanceTest.py @@ -46,7 +46,12 @@ class HydraulicConductanceTest: assert _sp.allclose(a=self.phys['throat.conductance'][0], b=1330.68207684) - def test_valvatne_blunte(self): + def test_valvatne_blunt(self): + self.phase = op.phases.GenericPhase(network=self.net) + self.phase['pore.viscosity'] = 1e-5 + self.phys = op.physics.GenericPhysics(network=self.net, + phase=self.phase, + geometry=self.geo) mod = op.models.physics.hydraulic_conductance.valvatne_blunt sf = np.sqrt(3)/36.0 self.geo['pore.shape_factor'] = np.ones(self.geo.Np)*sf
removing bug from test valvatne model.
PMEAL_OpenPNM
train
py
449e55eeb571ef01427b415aeeb49094f283242f
diff --git a/webpack.demo.config.js b/webpack.demo.config.js index <HASH>..<HASH> 100644 --- a/webpack.demo.config.js +++ b/webpack.demo.config.js @@ -28,7 +28,7 @@ module.exports = function(directory) { rules: [ { test: /\.jsx?$/, - exclude: 'node-modules/', + exclude: /node_modules/, use: [ { loader: 'babel-loader' }, { loader: path.resolve(__dirname, './scripts/html-pre-tag-loader') }
fix exclude in webpack demo config
ihmeuw_ihme-ui
train
js
48e34dd09443ce87a2524a659a174a89c7e6299e
diff --git a/consolemenu/menu_component.py b/consolemenu/menu_component.py index <HASH>..<HASH> 100644 --- a/consolemenu/menu_component.py +++ b/consolemenu/menu_component.py @@ -192,7 +192,7 @@ class MenuComponent(object): # apply indentation to any lines after the first that were split by a users newline line = indent + line # apply any wrapping and indentation if the line is still too long - wrapped = textwrap.wrap(line, width=self.calculate_content_width(), subsequent_indent=indent) + wrapped = ansiwrap.wrap(line, width=self.calculate_content_width(), subsequent_indent=indent) for wrapline in wrapped: # Finally, this adds the borders and things to the string # TODO: check compatability on super() calls @@ -270,8 +270,7 @@ class MenuTextSection(MenuComponent): for x in range(0, self.padding.top): yield self.row() if self.text is not None and self.text != '': - for line in ansiwrap.wrap(self.text, width=self.calculate_content_width()): - yield self.row(content=line, align=self.text_align) + yield self.row(content=self.text, align=self.text_align) for x in range(0, self.padding.bottom): yield self.row() if self.show_bottom_border:
text wrapping and ascii handling is now handled within the row function
aegirhall_console-menu
train
py
ca2347a5419f38923c7e5077698825c6f75c0e0c
diff --git a/src/Cache/Pool.php b/src/Cache/Pool.php index <HASH>..<HASH> 100644 --- a/src/Cache/Pool.php +++ b/src/Cache/Pool.php @@ -7,6 +7,7 @@ use Psr\Cache\CacheItemInterface; use Dabble\Adapter\Sqlite; use Dabble\Query\Exception; use Dabble\Query\DeleteException; +use ErrorException; /** * A simple cache pool for Gentry. @@ -35,13 +36,23 @@ class Pool implements CacheItemPoolInterface { $this->client = getenv("GENTRY_CLIENT"); if (!isset(self::$db)) { - self::$db = new Sqlite(getenv("GENTRY_VENDOR").'/gentry.sq3'); + $path = sys_get_temp_dir().'/'.getenv("GENTRY_CLIENT").'.sq3'; + self::$db = new Sqlite($path); self::$db->exec("CREATE TABLE IF NOT EXISTS items ( pool VARCHAR(6), keyname VARCHAR(32), value TEXT, PRIMARY KEY(pool, keyname) )"); + chmod($path, 0666); + } + } + + public function __destruct() + { + try { + @unlink(sys_get_temp_dir().'/'.getenv("GENTRY_CLIENT").'.sq3'); + } catch (ErrorException $e) { } }
place temp sqlite db in /tmp, and delete when done
gentry-php_gentry
train
php
66283220aab9d2c7841b51ae2c1b1ec0101932ba
diff --git a/src/map/parser.js b/src/map/parser.js index <HASH>..<HASH> 100644 --- a/src/map/parser.js +++ b/src/map/parser.js @@ -141,6 +141,9 @@ export default class MapParser extends EventEmitter { * @private */ _parseChunk (id, size) { + // Clear Lookback + this.parser.resetLookBackStrings(); + switch (id) { // ======== HEADER ========= case '50606082': // 0x03043002 diff --git a/src/util/parser-extensions.js b/src/util/parser-extensions.js index <HASH>..<HASH> 100644 --- a/src/util/parser-extensions.js +++ b/src/util/parser-extensions.js @@ -47,3 +47,10 @@ BufferReader.prototype.nextLookBackString = function () { // Lookback Baguette } return this.lookbackStore[inp-1]; }; + +BufferReader.prototype.resetLookBackStrings = function () { + if (this.lookbackSeen) { + this.lookbackStore = []; + this.lookbackSeen = false; + } +};
Fix, reset lookback after each chunk.
ManiaJS_gbxparser
train
js,js
8ddcb222e9bc06dc8b89da52f4c9bdbcefdd8993
diff --git a/contrib/mesos/pkg/executor/service/service.go b/contrib/mesos/pkg/executor/service/service.go index <HASH>..<HASH> 100644 --- a/contrib/mesos/pkg/executor/service/service.go +++ b/contrib/mesos/pkg/executor/service/service.go @@ -99,6 +99,12 @@ func NewKubeletExecutorServer() *KubeletExecutorServer { k.Address = net.ParseIP(defaultBindingAddress()) k.ShutdownFD = -1 // indicates unspecified FD + // empty string for all containers (= cgroup paths) which stop the kubelet + // from taking any control over the cgroups of itself and other system processes. + k.SystemContainer = "" + k.ResourceContainer = "" + k.DockerDaemonContainer = "" + return k } @@ -134,8 +140,6 @@ func (s *KubeletExecutorServer) Run(hks hyperkube.Interface, _ []string) error { // derive the executor cgroup and use it as docker cgroup root mesosCgroup := findMesosCgroup(s.cgroupPrefix) s.cgroupRoot = mesosCgroup - s.SystemContainer = mesosCgroup - s.ResourceContainer = mesosCgroup log.V(2).Infof("passing cgroup %q to the kubelet as cgroup root", s.CgroupRoot) // create apiserver client
Stop the kubelet from taking control over cgroups and other processes
kubernetes_kubernetes
train
go
d3af119863bd525e085495d01d329dd4384275cd
diff --git a/sos/plugins/as7.py b/sos/plugins/as7.py index <HASH>..<HASH> 100644 --- a/sos/plugins/as7.py +++ b/sos/plugins/as7.py @@ -2,6 +2,7 @@ import os import re import zipfile import urllib2 +import tempfile try: import json @@ -282,6 +283,23 @@ class AS7(Plugin, IndependentPlugin): self.getOption("logsize"), sub=(self.__jbossHome, 'JBOSSHOME')) + for deployment in find("*", os.path.join(path, "deployments")): + self._get_tree_from_deployment(deployment) + + + def _get_tree_from_deployment(self, path): + tmp_dir = tempfile.mkdtemp() + try: + zf = zipfile.ZipFile(path) + zf.extractall(path=tmp_dir) + zf.close() + tree = DirTree(tmp_dir).as_string() + self.addStringAsFile(tree, "%s.tree.txt" % os.path.basename(path)) + except zipfile.BadZipfile: + pass + os.rmdir(tmp_dir) + + def setup(self): ## We need to know where JBoss is installed and if we can't find it we
adding a tree of all zipped deployments
sosreport_sos
train
py
f51daaf21c9197e280e5d7729899ececd82f0070
diff --git a/src/Annotator/EntityAnnotator.php b/src/Annotator/EntityAnnotator.php index <HASH>..<HASH> 100644 --- a/src/Annotator/EntityAnnotator.php +++ b/src/Annotator/EntityAnnotator.php @@ -28,6 +28,7 @@ class EntityAnnotator extends AbstractAnnotator { 'longtext' => 'string', 'array' => 'array', 'json' => 'array', + 'binaryuuid' => 'string', ]; /**
Make binaryuuid annotate as string.
dereuromark_cakephp-ide-helper
train
php
44201ccf9a22267734cf403171496b2b35190f7b
diff --git a/test/functional/ft_14_re_apply.rb b/test/functional/ft_14_re_apply.rb index <HASH>..<HASH> 100644 --- a/test/functional/ft_14_re_apply.rb +++ b/test/functional/ft_14_re_apply.rb @@ -115,6 +115,7 @@ class FtReApplyTest < Test::Unit::TestCase stalled_exp.tree = [ 'participant', { 'ref' => 'alpha', 'activity' => 'mow lawn' }, [] ] + stalled_exp.persist @engine.re_apply(stalled_exp.fei)
when there is no caching, persisting the modified exp before re_applying is necessary
jmettraux_ruote
train
rb
33da6cd9eac1b868c219ee30db8f32cf6d18e8d1
diff --git a/ginga/version.py b/ginga/version.py index <HASH>..<HASH> 100644 --- a/ginga/version.py +++ b/ginga/version.py @@ -1,7 +1,7 @@ # this file was automatically generated major = 2 minor = 0 -release = 20131222233539 +release = 20131224023332 version = '%d.%d.%d' % (major, minor, release) diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -44,7 +44,7 @@ setup( # Matplotlib version 'ginga.mplw', # Common stuff - 'ginga.misc', 'ginga.misc.plugins', + 'ginga.misc', 'ginga.misc.plugins', 'ginga.base', # Misc 'ginga.util', 'ginga.icons', 'ginga.doc' ],
Fix for setup.py bumped release
ejeschke_ginga
train
py,py
f5c93377ef0297269f81c4985b238b0d20f798dd
diff --git a/features/step_definitions/steps.js b/features/step_definitions/steps.js index <HASH>..<HASH> 100644 --- a/features/step_definitions/steps.js +++ b/features/step_definitions/steps.js @@ -47,11 +47,11 @@ defineSupportCode(function ({ Given, When, Then }) { return this.assertOutputIncludes(expectedOutput) }) - Then('stdout should include {arg1:stringInDoubleQuotes}', function (expectedOutput) { + Then('stdout should include {expectedOutput:stringInDoubleQuotes}', function (expectedOutput) { return this.assertStdoutIncludes(expectedOutput) }) - Then('stderr should include {arg1:stringInDoubleQuotes}', function (expectedOutput) { + Then('stderr should include {expectedOutput:stringInDoubleQuotes}', function (expectedOutput) { return this.assertStderrIncludes(expectedOutput) }) })
Sane param names in step defs
cucumber_cucumber-electron
train
js
c875a44a8d6a71009f37da22a29e75175dae1742
diff --git a/config/addresses.go b/config/addresses.go index <HASH>..<HASH> 100644 --- a/config/addresses.go +++ b/config/addresses.go @@ -2,7 +2,9 @@ package config // Addresses stores the (string) multiaddr addresses for the node. type Addresses struct { - Swarm []string // addresses for the swarm network - API string // address for the local API (RPC) - Gateway string // address to listen on for IPFS HTTP object gateway + Swarm []string // addresses for the swarm to listen on + Announce []string // swarm addresses to announce to the network + NoAnnounce []string // swarm addresses not to announce to the network + API string // address for the local API (RPC) + Gateway string // address to listen on for IPFS HTTP object gateway } diff --git a/config/init.go b/config/init.go index <HASH>..<HASH> 100644 --- a/config/init.go +++ b/config/init.go @@ -36,8 +36,10 @@ func Init(out io.Writer, nBitsForKeypair int) (*Config, error) { // "/ip4/0.0.0.0/udp/4002/utp", // disabled for now. "/ip6/::/tcp/4001", }, - API: "/ip4/127.0.0.1/tcp/5001", - Gateway: "/ip4/127.0.0.1/tcp/8080", + Announce: []string{}, + NoAnnounce: []string{}, + API: "/ip4/127.0.0.1/tcp/5001", + Gateway: "/ip4/127.0.0.1/tcp/8080", }, Datastore: datastore,
go-ipfs-config: core: make announced swarm addresses configurable License: MIT
ipfs_go-ipfs
train
go,go
19bdbe7f8d4c13d5eb9d21fd0d6fe8467f443da7
diff --git a/lnd.go b/lnd.go index <HASH>..<HASH> 100644 --- a/lnd.go +++ b/lnd.go @@ -224,6 +224,7 @@ func Main(lisCfg ListenerCfg) error { // Open the channeldb, which is dedicated to storing channel, and // network related metadata. + ltndLog.Infof("Opening the channeldb, might take a few minutes") chanDB, err := channeldb.Open( graphDir, channeldb.OptionSetRejectCacheSize(cfg.Caches.RejectCacheSize),
Update channeldb opening log It might take a few minutes and it should therefore state it...
lightningnetwork_lnd
train
go
70e98f90609c667e867da550dd928fe823d007b9
diff --git a/lib/discordrb/data.rb b/lib/discordrb/data.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/data.rb +++ b/lib/discordrb/data.rb @@ -121,6 +121,14 @@ module Discordrb @bot.add_await(key, Discordrb::Events::MessageEvent, { from: @id }.merge(attributes), &block) end + # Gets the member this user is on a server + # @param server [Server] The server to get the member for + # @return [Member] this user as a member on a particular server + def on(server) + id = server.resolve_id + @bot.server(id).member(@id) + end + # Is the user the bot? # @return [true, false] whether this user is the bot def bot?
Create a method to get a user as a member on a particular server
meew0_discordrb
train
rb
6096a0688b9319598c5591250872e514cad1ecba
diff --git a/utp.go b/utp.go index <HASH>..<HASH> 100644 --- a/utp.go +++ b/utp.go @@ -674,8 +674,14 @@ func (s *Socket) LocalAddr() net.Addr { return s.pc.LocalAddr() } -func (s *Socket) ReadFrom([]byte) (int, net.Addr, error) { - return 0, nil, nil +func (s *Socket) ReadFrom(p []byte) (n int, addr net.Addr, err error) { + read, ok := <-s.unusedReads + if !ok { + err = io.EOF + } + n = copy(p, read.data) + addr = read.from + return } func (s *Socket) SetDeadline(time.Time) error { @@ -690,8 +696,8 @@ func (s *Socket) SetWriteDeadline(time.Time) error { return nil } -func (s *Socket) WriteTo([]byte, net.Addr) (int, error) { - return 0, nil +func (s *Socket) WriteTo(b []byte, addr net.Addr) (int, error) { + return s.pc.WriteTo(b, addr) } func (c *Conn) finish() {
Implement some net.Conn functions on Socket
anacrolix_utp
train
go
bff534876aeb2aca93e414f485fbc850fab64810
diff --git a/tests/test_oauth.py b/tests/test_oauth.py index <HASH>..<HASH> 100644 --- a/tests/test_oauth.py +++ b/tests/test_oauth.py @@ -397,8 +397,18 @@ class TestRequest(unittest.TestCase): del foo["oauth_signature"] self.assertEqual(urllib.urlencode(sorted(foo.items())), res) - - + def test_get_normalized_string_escapes_spaces_properly(self): + url = "http://sp.example.com/" + params = { + "some_random_data": random.randint(100, 1000), + "data": "This data with a random number (%d) has spaces!" % random.randint(1000, 2000), + } + + req = oauth.Request("GET", url, params) + res = req.get_normalized_parameters() + expected = urllib.urlencode(sorted(params.items())).replace('+', '%20') + self.assertEqual(expected, res) + def test_sign_request(self): url = "http://sp.example.com/"
Add a test to prove the code...
TimSC_python-oauth10a
train
py
558ad5d60cf20ecd81f5e5d59ae1d449c7c5e5ab
diff --git a/tool.py b/tool.py index <HASH>..<HASH> 100755 --- a/tool.py +++ b/tool.py @@ -754,6 +754,7 @@ class IANA(object): 'athleta': 'whois.nic.athleta', 'audible': 'whois.nic.audible', 'author': 'whois.nic.author', + 'aws': 'whois.nic.aws', 'bm': 'whois.afilias-srs.net', 'bz': 'whois.afilias-grs.net', 'buzz': 'whois.nic.buzz', @@ -1172,7 +1173,7 @@ if __name__ == '__main__': '-v', '--version', action='version', - version='%(prog)s 0.9.1-beta' + version='%(prog)s 0.9.2-beta' ) ARGS = PARSER.parse_args()
Introduction of `aws` whois server cf: Whois lookup to whois.nic.aws
funilrys_PyFunceble
train
py
4dceb5be3179811b32d8a59a576cf917826f320d
diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index <HASH>..<HASH> 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -292,6 +292,32 @@ class Controller extends Object { */ var $methods = array(); /** + * This controller's primary model class name, the Inflector::classify()'ed verision of + * the controller's $name property. + * + * Example: For a controller named 'Comments', the modelClass would be 'Comment' + * + * @var string + * @access public + */ + var $modelClass = null; +/** + * This controller's model key name, an underscored version of the controller's $modelClass property. + * + * Example: For a controller named 'ArticleComments', the modelKey would be 'article_comment' + * + * @var string + * @access public + */ + var $modelKey = null; +/** + * Holds any validation errors produced by the last call of the validateErrors() method/ + * + * @var array Validation errors, or false if none + * @access public + */ + var $validationErrors = null; +/** * Constructor. * */
Adding doc blocks for properties that previously had no documentation. Closes #<I> git-svn-id: <URL>
cakephp_cakephp
train
php
8ad41223c0f03bbd2d060ebe4ec0b2a1202438fc
diff --git a/src/vue-data-scooper.js b/src/vue-data-scooper.js index <HASH>..<HASH> 100644 --- a/src/vue-data-scooper.js +++ b/src/vue-data-scooper.js @@ -46,12 +46,6 @@ export const getInitialData = function(doc) { const obj = {} const inputs = doc.querySelectorAll("[v-model]") - if (doc.dataset) { - for (let key in doc.dataset) { - obj[key] = JSON.parse(doc.dataset[key]) - } - } - for (let i = 0; i < inputs.length; i++) { scoop(doc, inputs[i], obj) }
Do not initialize data from data-* attribute of root
kuroda_vue-data-scooper
train
js
2d14aca0ff8677315c07b4dc287da89ac5f4da96
diff --git a/tests/automated/eventLimit-popover.js b/tests/automated/eventLimit-popover.js index <HASH>..<HASH> 100644 --- a/tests/automated/eventLimit-popover.js +++ b/tests/automated/eventLimit-popover.js @@ -79,6 +79,17 @@ describe('eventLimit popover', function() { expect($('.fc-more-popover .fc-event').length).toBeGreaterThan(1); expect($('.fc-more-popover .fc-bgevent').length).toBe(0); }); + + it('works with events that have invalid end times', function() { + options.events = [ + { title: 'event1', start: '2014-07-29', end: '2014-07-29' }, + { title: 'event2', start: '2014-07-29', end: '2014-07-28' }, + { title: 'event3', start: '2014-07-29T00:00:00', end: '2014-07-29T00:00:00' }, + { title: 'event4', start: '2014-07-29T00:00:00', end: '2014-07-28T23:00:00' } + ]; + init(); + expect($('.fc-more-popover .fc-event').length).toBe(4); + }); }); [ 'basicWeek', 'agendaWeek' ].forEach(function(viewName) {
automated test for issue <I>
fullcalendar_fullcalendar
train
js
04272ef1695cf96d639f63cc5d2e38b2c03fa05a
diff --git a/model/MediaSource.php b/model/MediaSource.php index <HASH>..<HASH> 100644 --- a/model/MediaSource.php +++ b/model/MediaSource.php @@ -180,10 +180,7 @@ class MediaSource extends ConfigurableService implements MediaManagement, Proces return $file; } - /** - * @return FileReferenceSerializer - */ - private function getFileRefSerializer() + private function getFileRefSerializer(): FileReferenceSerializer { return $this->getServiceLocator()->get(FileReferenceSerializer::SERVICE_ID); } diff --git a/model/sharedStimulus/repository/SharedStimulusRepository.php b/model/sharedStimulus/repository/SharedStimulusRepository.php index <HASH>..<HASH> 100644 --- a/model/sharedStimulus/repository/SharedStimulusRepository.php +++ b/model/sharedStimulus/repository/SharedStimulusRepository.php @@ -59,10 +59,8 @@ class SharedStimulusRepository extends ConfigurableService implements SharedStim private function getContent(core_kernel_classes_Resource $resource): string { $link = $this->getPropertyValue($resource, MediaService::PROPERTY_LINK); - - if (is_string($link)) { - $link = $this->getMediaSource()->unserializeAndRemovePrefixForAssets($link); - } + //fixing the asset path + $link = $this->getMediaSource()->unserializeAndRemovePrefixForAssets($link); return (string)$this->getFileManagement()->getFileStream($link); }
Cr fix , added return type and removed is string check
oat-sa_extension-tao-mediamanager
train
php,php
fb5cc19707582fa61ca3e426697cc2b00e9e5ffa
diff --git a/activerecord/test/cases/associations/has_many_through_associations_test.rb b/activerecord/test/cases/associations/has_many_through_associations_test.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/cases/associations/has_many_through_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb @@ -2,15 +2,18 @@ require "cases/helper" require 'models/post' require 'models/person' require 'models/reader' +require 'models/comment' class HasManyThroughAssociationsTest < ActiveRecord::TestCase - fixtures :posts, :readers, :people + fixtures :posts, :readers, :people, :comments def test_associate_existing assert_queries(2) { posts(:thinking);people(:david) } - + + posts(:thinking).people + assert_queries(1) do - posts(:thinking).people << people(:david) + posts(:thinking).people << people(:david) end assert_queries(1) do
Fix HasManyThroughAssociationsTest tests. [#<I> state:resolved]
rails_rails
train
rb
bd9b37c6f8c435a5d2bcc3c20bfbc4425fb4711f
diff --git a/src/feat/database/conflicts.py b/src/feat/database/conflicts.py index <HASH>..<HASH> 100644 --- a/src/feat/database/conflicts.py +++ b/src/feat/database/conflicts.py @@ -431,13 +431,22 @@ def cleanup_logs(connection, rconnection): continue in_conflict, raw_doc = yield _check_conflict(connection, owner_id) last_rev = entries[-1][0] - if not in_conflict and last_rev <= raw_doc['_rev']: + if (not in_conflict and + parse_rev(last_rev) <= parse_rev(raw_doc['_rev'])): for (rev, doc_id) in entries: deletes_count += 1 yield _cleanup_update_log(connection, doc_id) defer.returnValue(deletes_count) +def parse_rev(rev): + if '-' not in rev: + raise ValueError("%r doesn't seem to be a rev" % (rev, )) + seq, tag = rev.split('-', 1) + seq = int(seq) + return seq, tag + + @defer.inlineCallbacks def _check_conflict(connection, doc_id): raw_doc = yield connection.get_document(doc_id, raw=True, conflicts=True)
Fix condition on when can we cleanup the update logs imported from the external database.
f3at_feat
train
py
9e698f9e67e3f94fc8a430d1041783d00a20a4d0
diff --git a/adapters/http/adapter_test.go b/adapters/http/adapter_test.go index <HASH>..<HASH> 100644 --- a/adapters/http/adapter_test.go +++ b/adapters/http/adapter_test.go @@ -39,7 +39,7 @@ func TestSend(t *testing.T) { } s := genMockServer(3100) - adapter, err := NewAdapter(log.TestLogger{Tag: "BRK_HDL_ADAPTER", T: t}) + adapter, err := NewAdapter(log.TestLogger{Tag: "Adapter", T: t}) if err != nil { panic(err) } diff --git a/adapters/http/registrations/registrations_test.go b/adapters/http/registrations/registrations_test.go index <HASH>..<HASH> 100644 --- a/adapters/http/registrations/registrations_test.go +++ b/adapters/http/registrations/registrations_test.go @@ -59,7 +59,7 @@ func TestNextRegistration(t *testing.T) { }, } - adapter, err := NewAdapter(3001, HandlerParser{}, log.TestLogger{Tag: "BRK_HDL_ADAPTER", T: t}) + adapter, err := NewAdapter(3001, HandlerParser{}, log.TestLogger{Tag: "Adapter", T: t}) client := &client{adapter: "0.0.0.0:3001"} <-time.After(time.Millisecond * 200) if err != nil {
[broker] Change logger tag in adapters test
TheThingsNetwork_ttn
train
go,go
46fbb139673c533701b76efc40036212bf666489
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -33,7 +33,7 @@ extensions = [ 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode', 'sphinxcontrib.napoleon', - 'sphinxcontrib.aafig', + 'sphinx.ext.aafig', ] # Add any paths that contain templates here, relative to this directory.
switch from sphinxcontrib to sphinx.ext
singingwolfboy_flask-dance
train
py
9310b960f46c90101016e22039ecd4ee3bf8dc96
diff --git a/lib/node_modules/@stdlib/utils/is-node/test/test.is_node.js b/lib/node_modules/@stdlib/utils/is-node/test/test.is_node.js index <HASH>..<HASH> 100644 --- a/lib/node_modules/@stdlib/utils/is-node/test/test.is_node.js +++ b/lib/node_modules/@stdlib/utils/is-node/test/test.is_node.js @@ -238,7 +238,8 @@ tape( 'the function returns `false` if runtime is not Node.js (`process.release` isString.isPrimitive = alwaysTrue; function isObject( val ) { - if ( val === process.release ) { + // `process.release` was added in Node v3.0.0 + if ( process.release && val === process.release ) { return false; } return ( typeof val === 'object' ); @@ -272,7 +273,8 @@ tape( 'the function returns `false` if runtime is not Node.js (`process.release. isString.isPrimitive = isPrimitive; function isPrimitive( val ) { - if ( val === process.release.name ) { + // `process.release` was added in Node v3.0.0 + if ( process.release && val === process.release.name ) { return false; } return ( typeof val === 'string' );
Add test support for Node <<I>
stdlib-js_stdlib
train
js
668e7f44efb09df98684858a6a72bdf96f7a1685
diff --git a/parser/pigeon.go b/parser/pigeon.go index <HASH>..<HASH> 100644 --- a/parser/pigeon.go +++ b/parser/pigeon.go @@ -1135,7 +1135,7 @@ func (p *parser) addErrAt(err error, pos position) { buf.WriteString("rule " + rule.name) } } - pe := &parserError{Inner: err, prefix: buf.String()} + pe := &parserError{Inner: err, pos: pos, prefix: buf.String()} p.errs.add(pe) } @@ -1152,7 +1152,7 @@ func (p *parser) read() { } if rn == utf8.RuneError { - if n > 0 { + if n == 1 { p.addErr(errInvalidEncoding) } }
Minor update to generated pigeon.go
knq_ini
train
go
60163b406f999f88b1dd077f323ee6f9c88e1970
diff --git a/deployutils/mixins.py b/deployutils/mixins.py index <HASH>..<HASH> 100644 --- a/deployutils/mixins.py +++ b/deployutils/mixins.py @@ -122,7 +122,7 @@ class AccountMixin(object): def get_context_data(self, *args, **kwargs): context = super(AccountMixin, self).get_context_data(*args, **kwargs) - context.update({'account': self.account}) + context.update({self.account_url_kwarg: self.account}) return context def get_url_kwargs(self):
uses account_url_kwarg as key
djaodjin_djaodjin-deployutils
train
py
d93f426401d7b1647f4796dca163f6b82044ee13
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ os.environ['DJANGO_SETTINGS_MODULE'] = 'django_mailbox.tests.settings' from django.core import management -if sys.argv[-1] == 'test': +if len(sys.argv) > 1 and sys.argv[1] == 'test': management.execute_from_command_line() sys.exit()
Add support to args in tests
coddingtonbear_django-mailbox
train
py