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
0c77217b2e7d4e9367f774cb837b10c4ed9841b6
diff --git a/src/Transaction/TransactionBuilder.php b/src/Transaction/TransactionBuilder.php index <HASH>..<HASH> 100755 --- a/src/Transaction/TransactionBuilder.php +++ b/src/Transaction/TransactionBuilder.php @@ -223,8 +223,8 @@ class TransactionBuilder implements XdrEncodableInterface public function getFee() { - // todo: calculate real fee - return 100; + // todo: load base fee from network + return 100 * $this->operations->count(); } /**
TransactionBuilder - fee is now calculated correctly for transactions with mutiple options
zulucrypto_stellar-api
train
php
1ba1ca3ecde83d4f3b2ce6b4e324bb95b92594f5
diff --git a/src/org/opencms/importexport/A_CmsImport.java b/src/org/opencms/importexport/A_CmsImport.java index <HASH>..<HASH> 100644 --- a/src/org/opencms/importexport/A_CmsImport.java +++ b/src/org/opencms/importexport/A_CmsImport.java @@ -1,7 +1,7 @@ /* * File : $Source: /alkacon/cvs/opencms/src/org/opencms/importexport/A_CmsImport.java,v $ - * Date : $Date: 2005/03/19 13:58:19 $ - * Version: $Revision: 1.64 $ + * Date : $Date: 2005/04/05 13:27:18 $ + * Version: $Revision: 1.65 $ * * This library is part of OpenCms - * the Open Source Content Mananagement System @@ -83,7 +83,7 @@ public abstract class A_CmsImport implements I_CmsImport { public static final String C_RESOURCE_TYPE_LEGACY_PAGE_NAME = "page"; /** The id of the legacy resource type "link". */ - protected static final int C_RESOURCE_TYPE_LINK_ID = 2; + protected static final int C_RESOURCE_TYPE_LINK_ID = 1024; /** The name of the legacy resource type "link". */ protected static final String C_RESOURCE_TYPE_LINK_NAME = "link";
Bugfix in import version 2: Binary files were converted to external pointers
alkacon_opencms-core
train
java
6fa7099a6151d4dbf8e31e25a85119f0148c477a
diff --git a/usb1.py b/usb1.py index <HASH>..<HASH> 100644 --- a/usb1.py +++ b/usb1.py @@ -23,7 +23,6 @@ import libusb1 from ctypes import byref, create_string_buffer, c_int, sizeof, POINTER, \ create_unicode_buffer, c_wchar, cast, c_uint16, c_ubyte, string_at, \ c_void_p, cdll -from cStringIO import StringIO import sys import threading from ctypes.util import find_library @@ -1723,7 +1722,8 @@ class USBContext(object): See libusb_handle_events_locked doc. """ # XXX: does tv parameter need to be exposed ? - result = libusb1.libusb_handle_events_locked(self.__context_p, _zero_tv_p) + result = libusb1.libusb_handle_events_locked(self.__context_p, + _zero_tv_p) if result: raise libusb1.USBError(result)
Fix some pylint-detected problems.
vpelletier_python-libusb1
train
py
1c1c7937b65c86646e4b216ba2f8d377d698c717
diff --git a/rekt/utils.py b/rekt/utils.py index <HASH>..<HASH> 100644 --- a/rekt/utils.py +++ b/rekt/utils.py @@ -44,12 +44,12 @@ def snake_case_to_camel_case(name): return name.replace('_', ' ').title().replace(' ', '') -def load_builtin_config(name, module_name=__name__): +def load_builtin_config(name, module_name=__name__, specs_path=specs.__path__): """ Uses package info magic to find the resource file located in the specs submodule. """ - config_path = Path(next(iter(specs.__path__))) + config_path = Path(next(iter(specs_path))) config_path = config_path / PurePath(resource_filename(module_name, name + '.yaml')) return load_config(config_path)
fixing bug in the load builtin config function which would not allow reuse in other packages
dillonhicks_rekt
train
py
993f107df99062aaf3942c30a28aafc1b8b5796b
diff --git a/src/FieldHandlers/FieldHandlerFactory.php b/src/FieldHandlers/FieldHandlerFactory.php index <HASH>..<HASH> 100644 --- a/src/FieldHandlers/FieldHandlerFactory.php +++ b/src/FieldHandlers/FieldHandlerFactory.php @@ -60,11 +60,11 @@ class FieldHandlerFactory * * @param mixed $table Name or instance of the Table * @param string $field Field name - * @param string $data Field data + * @param mixed $data Field data * @param mixed[] $options Field options * @return string Field input */ - public function renderInput($table, string $field, string $data = '', array $options = []) : string + public function renderInput($table, string $field, $data = '', array $options = []) : string { $handler = self::getByTableField($table, $field, $options, $this->cakeView); @@ -106,11 +106,11 @@ class FieldHandlerFactory * * @param mixed $table Name or instance of the Table * @param string $field Field name - * @param string $data Field data + * @param mixed $data Field data * @param mixed[] $options Field options * @return string */ - public function renderValue($table, string $field, string $data, array $options = []) : string + public function renderValue($table, string $field, $data, array $options = []) : string { $handler = self::getByTableField($table, $field, $options, $this->cakeView);
Relaxed data value type-hinting for field handler factory API methods (task #<I>)
QoboLtd_cakephp-csv-migrations
train
php
e9395f519697b0144ceb969fbe0a0eb85cd2865b
diff --git a/Kwf/Util/ClearCache.php b/Kwf/Util/ClearCache.php index <HASH>..<HASH> 100644 --- a/Kwf/Util/ClearCache.php +++ b/Kwf/Util/ClearCache.php @@ -296,7 +296,8 @@ class Kwf_Util_ClearCache protected function _clearCache(array $types, $output, $options) { - if (in_array('elastiCache', $types)) { + $skipOtherServers = isset($options['skipOtherServers']) ? $options['skipOtherServers'] : false; + if (in_array('elastiCache', $types) && !$skipOtherServers) { //namespace used in Kwf_Cache_Simple $cache = Kwf_Cache_Simple::getZendCache(); $mc = $cache->getBackend()->getMemcache();
if skip otherServers don't increment elastiCache, as that goes across servers
koala-framework_koala-framework
train
php
ce49916581c24f760123196b4df25dbccb552dce
diff --git a/bin/roundtrip-test.js b/bin/roundtrip-test.js index <HASH>..<HASH> 100755 --- a/bin/roundtrip-test.js +++ b/bin/roundtrip-test.js @@ -530,8 +530,8 @@ var checkIfSignificant = function(offsets, data) { thisResult.wtDiff = formatDiff(oldWt, newWt, offset, 25); // Don't clog the rt-test server db with humongous diffs - if (diff.length > 2000) { - diff = diff.substring(0, 2000) + "-- TRUNCATED TO 2000 chars --"; + if (diff.length > 1000) { + diff = diff.substring(0, 1000) + "-- TRUNCATED TO 1000 chars --"; } thisResult.htmlDiff = diff; }
roundtrip-test.js: Truncate diffs to <I> chars instead of <I> * This reduces db bloat from storing test results. * Only a tiny fraction of test results (<I> in <I>K) are looked at. Change-Id: Ia<I>d<I>e<I>b<I>d0d0d<I>ae<I>b<I>a<I>c
wikimedia_parsoid
train
js
8be4d3ef3a082f5ab14f00cd040282bf25cd6692
diff --git a/bin/runner.js b/bin/runner.js index <HASH>..<HASH> 100755 --- a/bin/runner.js +++ b/bin/runner.js @@ -88,6 +88,15 @@ if (config.browsers) { worker.config = browser; worker.string = browserString; workers[key] = worker; + + var statusPoller = setInterval(function () { + client.getWorker(worker.id, function (err, _worker) { + if (_worker.status === 'running') { + clearInterval(statusPoller); + console.log('[%s] Launched', worker.string); + } + }); + }, 2000); }); }); });
Add polling for run status for a worker
browserstack_browserstack-runner
train
js
9f818c36b846c7a9b47795bc0af9fbf323e36d54
diff --git a/src/test/java/org/webjars/RequireJSTest.java b/src/test/java/org/webjars/RequireJSTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/webjars/RequireJSTest.java +++ b/src/test/java/org/webjars/RequireJSTest.java @@ -62,7 +62,7 @@ public class RequireJSTest { // todo: the angular version changes due to a range transitive dependency assertEquals(WEBJAR_URL_PREFIX + "angular-bootstrap/0.13.0/ui-bootstrap-tpls", jsonNoCdn.get("angular-bootstrap").get("paths").get("angular-bootstrap").get(0).asText()); - assertEquals(WEBJAR_URL_PREFIX + "angular/1.4.3/angular", jsonNoCdn.get("angular").get("paths").get("angular").get(0).asText()); + assertEquals(WEBJAR_URL_PREFIX + "angular/1.4.4/angular", jsonNoCdn.get("angular").get("paths").get("angular").get(0).asText()); Map<String, ObjectNode> jsonWithCdn = RequireJS.getSetupJson(WEBJAR_CDN_PREFIX, WEBJAR_URL_PREFIX);
RequireJSTest: Bump angular version Not sure what exactly the returned version depends on; in the long run maybe this should not care so much about the minor version, but in the meantime this gets the test to pass again.
webjars_webjars-locator
train
java
b3717d08a8796ee3fb2a709979dba29087f09fc9
diff --git a/includes/DHL_BusinessShipment.php b/includes/DHL_BusinessShipment.php index <HASH>..<HASH> 100644 --- a/includes/DHL_BusinessShipment.php +++ b/includes/DHL_BusinessShipment.php @@ -796,8 +796,13 @@ class DHL_BusinessShipment extends DHL_Version { $data->ShipmentOrder->Shipment->ReturnReceiver = $this->getReturnReceiver()->getClass_v2(); // Export-Document - if($this->getExportDocument() !== null) - $data->ShipmentOrder->Shipment->ExportDocument = $this->getExportDocument()->getExportDocumentClass_v2(); + if($this->getExportDocument() !== null) { + try { + $data->ShipmentOrder->Shipment->ExportDocument = $this->getExportDocument()->getExportDocumentClass_v2(); + } catch(Exception $e) { + $this->addError($e->getMessage()); + } + } // Other Settings if($this->getPrintOnlyIfReceiverIsValid() !== null) {
Added try-catch for Export-Document-Class creation
Petschko_dhl-php-sdk
train
php
b9751091adbb27acd863b34d67bdeea67f844f22
diff --git a/test.py b/test.py index <HASH>..<HASH> 100755 --- a/test.py +++ b/test.py @@ -65,7 +65,7 @@ class MemberTest(APITest): states = [ ('RI', 2), ('AL', 7), - ('AZ', 9), + ('AZ', 8), ] for state, count in states:
Updated test function with latest member data so tests return accurate results.
eyeseast_propublica-congress
train
py
d753260957cfb59c48a704daeaa038ec83811216
diff --git a/src/call_get.js b/src/call_get.js index <HASH>..<HASH> 100644 --- a/src/call_get.js +++ b/src/call_get.js @@ -43,8 +43,8 @@ function getCompiled(name, compiler, cache) { cache[" size"]++; if (cache[" size"] > 512) { var keys = Object.keys(cache); - for (var i = 0; i < 256; ++i) delete cache[keys[i]]; - cache[" size"] = keys.length - 256; + for (var i = 0; i < 4; ++i) delete cache[keys[i]]; + cache[" size"] = keys.length - 4; } } return ret; diff --git a/src/promise.js b/src/promise.js index <HASH>..<HASH> 100644 --- a/src/promise.js +++ b/src/promise.js @@ -879,7 +879,7 @@ Promise.prototype._settlePromiseAt = function Promise$_settlePromiseAt(index) { //this is only necessary against index inflation with long lived promises //that accumulate the index size over time, //not because the data wouldn't be GCd otherwise - if (index >= 256) { + if (index >= 4) { this._queueGC(); } };
fix; lower attachment count This fixes the issue discovered in #<I> by lowering the number of interactions a promise has to have before it's cleaned up.
petkaantonov_bluebird
train
js,js
0c5dd86b31f29153e01f35b994003f283eac9c18
diff --git a/tar_test.go b/tar_test.go index <HASH>..<HASH> 100644 --- a/tar_test.go +++ b/tar_test.go @@ -6,7 +6,7 @@ import ( "path" "testing" - "github.com/mholt/archiver" + "github.com/mholt/archiver/v3" ) func requireRegularFile(t *testing.T, path string) os.FileInfo {
Fix import path in test (#<I>)
mholt_archiver
train
go
907032d8bb03695111c9d344918cc3fb47dabe7c
diff --git a/src/requirementslib/models/requirements.py b/src/requirementslib/models/requirements.py index <HASH>..<HASH> 100644 --- a/src/requirementslib/models/requirements.py +++ b/src/requirementslib/models/requirements.py @@ -2624,9 +2624,13 @@ class Requirement(object): line_parts.append(self._specifiers) if self.markers: line_parts.append("; {0}".format(self.markers)) - if self.hashes_as_pip: + if self.hashes_as_pip and not (self.editable or self.vcs or self.is_vcs): line_parts.append(self.hashes_as_pip) line = "".join(line_parts) + if self.editable: + if self.markers: + line = '"{0}"'.format(line) + line = "-e {0}".format(line) return Line(line) @property
Fix line generation from pipfiles
sarugaku_requirementslib
train
py
63687981336ade4978c387d3c0cf2f4fcddfb222
diff --git a/lib/AssetGraph.js b/lib/AssetGraph.js index <HASH>..<HASH> 100644 --- a/lib/AssetGraph.js +++ b/lib/AssetGraph.js @@ -332,11 +332,7 @@ AssetGraph.prototype = { }); }, error.passToFunction(cb, function (resolvedAssetConfigs) { - var flattened = []; - resolvedAssetConfigs.forEach(function (resolvedAssetConfig) { - Array.prototype.push.apply(flattened, _.isArray(resolvedAssetConfig) ? resolvedAssetConfig : [resolvedAssetConfig]); - }); - cb(null, flattened); + cb(null, _.flatten(resolvedAssetConfigs)); }) ); }
AssetGraph.resolveAssetConfig: Used _.flatten to simplify a piece of code.
assetgraph_assetgraph
train
js
c41b2772231e46397c36336a7da76742f30d848a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -17,4 +17,15 @@ setup( packages=find_packages(), install_requires=["django >= 1.6", "djangorestframework >= 2.4.3"], zip_safe=False, + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Web Environment', + 'Framework :: Django', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: BSD License', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Topic :: Internet :: WWW/HTTP', + ] )
Added classifiers to setup.py
ydaniv_django-rest-assured
train
py
75890f88fa00e3dd97aeda05805c248059777a97
diff --git a/src/diagrams/class/classRenderer.js b/src/diagrams/class/classRenderer.js index <HASH>..<HASH> 100644 --- a/src/diagrams/class/classRenderer.js +++ b/src/diagrams/class/classRenderer.js @@ -505,9 +505,14 @@ export const draw = function(text, id) { logger.info( 'tjoho' + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation) ); - g.setEdge(getGraphId(relation.id1), getGraphId(relation.id2), { - relation: relation - }); + g.setEdge( + getGraphId(relation.id1), + getGraphId(relation.id2), + { + relation: relation + }, + relation.title || 'DEFAULT' + ); }); dagre.layout(g); g.nodes().forEach(function(v) {
fix(#<I>): render multiple relations
knsv_mermaid
train
js
15f56371d6548b5946a2e2f6eb39e98b3dc69c1f
diff --git a/panc/src/main/scripts/panlint.py b/panc/src/main/scripts/panlint.py index <HASH>..<HASH> 100755 --- a/panc/src/main/scripts/panlint.py +++ b/panc/src/main/scripts/panlint.py @@ -238,8 +238,7 @@ def main(): for i in range(start_line, end_line + 1): ignore_lines.append(i) - f = open(filename) - for line_number, line in enumerate(f, start=1): + for line_number, line in enumerate(raw_text.splitlines(), start=1): line = line.rstrip('\n') if line and line_number not in ignore_lines and not RE_COMMENT_LINE.match(line):
Reuse existing file contents Rather than reopening the file.
quattor_pan
train
py
0f6d4db0cd621b6ac02eeec7e1c519ba61d8ea4b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ with open('schedule/requirements.txt') as f: required = f.read().splitlines() setup( - name='django-schedule', + name='django-scheduler', version='0.7', description='A calendaring app for Django.', author='Anthony Robert Hauber',
update setup.py with new name
llazzaro_django-scheduler
train
py
6c6f8130633748658eddb25e977e06865ad3a519
diff --git a/src/Facade/Auth.php b/src/Facade/Auth.php index <HASH>..<HASH> 100644 --- a/src/Facade/Auth.php +++ b/src/Facade/Auth.php @@ -35,14 +35,16 @@ class Auth extends Facade } /** + * @param bool $refresh + * * @return \Cubex\Auth\IAuthedUser * * @throws \Exception * @throws \RuntimeException */ - public static function getAuthedUser() + public static function getAuthedUser($refresh = false) { - return self::getFacadeRoot()->getAuthedUser(); + return self::getFacadeRoot()->getAuthedUser($refresh); } /** diff --git a/src/ServiceManager/Services/AuthService.php b/src/ServiceManager/Services/AuthService.php index <HASH>..<HASH> 100644 --- a/src/ServiceManager/Services/AuthService.php +++ b/src/ServiceManager/Services/AuthService.php @@ -140,10 +140,17 @@ class AuthService extends AbstractServiceProvider } /** + * @param bool $refresh do not use cached user + * * @return IAuthedUser */ - public function getAuthedUser() + public function getAuthedUser($refresh = false) { + if($refresh === true) + { + $this->_authedUser = null; + } + if($this->_authedUser !== null) { return $this->_authedUser;
support refreshing authedUser details (useful when updating user information)
cubex_framework
train
php,php
9238841856546e250ce919b59534a525f24a6903
diff --git a/pkg/ipcache/cidr.go b/pkg/ipcache/cidr.go index <HASH>..<HASH> 100644 --- a/pkg/ipcache/cidr.go +++ b/pkg/ipcache/cidr.go @@ -64,6 +64,7 @@ func (ipc *IPCache) AllocateCIDRs( id, isNew, err := ipc.allocate(p, lbls, oldNID) if err != nil { ipc.IdentityAllocator.ReleaseSlice(context.Background(), nil, usedIdentities) + ipc.Unlock() return nil, err }
ipcache: Fix lock leak Commit <I>e<I>ea2a5a9 ("ipcache: Fix race in identity/ipcache release") unintentionally took the lock on the IPCache and failed to release it if the loop returned in the middle. This case is a bit unusual given that allocation fails in this case. Fix it. Found by inspection. Fixes: <I>e<I>ea2a5a9 ("ipcache: Fix race in identity/ipcache release")
cilium_cilium
train
go
7818badc0aff6bff616d0943a9d84cb787750f54
diff --git a/lib/parse/amd.js b/lib/parse/amd.js index <HASH>..<HASH> 100644 --- a/lib/parse/amd.js +++ b/lib/parse/amd.js @@ -107,13 +107,10 @@ AMD.prototype.addOptimizedModules = function (filename) { amdetective(this.getFileSource(filename)).forEach(function (obj) { if (!self.isExcluded(obj.name)) { - var deps = []; - for(var i = 0; i < obj.deps.length;i++) { - if(!self.isExcluded(obj.deps[i])){ - deps.push(obj.deps[i]); - } - } - self.tree[obj.name] = deps; + + self.tree[obj.name] = obj.deps.filter(function(id) { + return id !== 'require' && id !== 'exports' && id !== 'module' && !id.match(/\.?\w\!/) && !self.isExcluded(id); + }) } }); };
filter out require/plugins and excluded
pahen_madge
train
js
d2459d97b954469f6f1a5c49ae2acae981ecf726
diff --git a/voltron/gdbproxy.py b/voltron/gdbproxy.py index <HASH>..<HASH> 100644 --- a/voltron/gdbproxy.py +++ b/voltron/gdbproxy.py @@ -2,7 +2,10 @@ import asyncore import logging import socket import struct -import cPickle as pickle +try: + import cPickle as pickle +except ImportError: + import pickle from .comms import _sock, READ_MAX from .common import * diff --git a/voltron/view.py b/voltron/view.py index <HASH>..<HASH> 100644 --- a/voltron/view.py +++ b/voltron/view.py @@ -3,7 +3,10 @@ from __future__ import print_function import os import sys import logging -import cPickle as pickle +try: + import cPickle as pickle +except ImportError: + import pickle import curses import pprint import re
Cope with the absense of cPickle
snare_voltron
train
py,py
5ce4ceefa5f57346d126214b1c109a874e74e40f
diff --git a/lib/cms/engine.rb b/lib/cms/engine.rb index <HASH>..<HASH> 100644 --- a/lib/cms/engine.rb +++ b/lib/cms/engine.rb @@ -1,5 +1,9 @@ module Cms class Engine < ::Rails::Engine isolate_namespace Cms + + ActionDispatch::Reloader.to_prepare do + require_dependency Cms::Engine.root.join('app/controllers/cms/resources_controller.rb') + end end end
Add resources controller to ActionDispatch::Reloader
droptheplot_adminable
train
rb
8c81bb50eaa43744b0d148da27ee1f12a4fe2d1e
diff --git a/tile_generator/pcf.py b/tile_generator/pcf.py index <HASH>..<HASH> 100755 --- a/tile_generator/pcf.py +++ b/tile_generator/pcf.py @@ -55,6 +55,7 @@ def reboot_cmd(yes_i_am_sure=False): time.sleep(1) print() opsmgr.ssh(['sudo reboot now'], silent=True) + time.sleep(10) # Allow system time to go down before we ping the API opsmgr.unlock() @cli.command('unlock')
Wait for system to go down during reboot
cf-platform-eng_tile-generator
train
py
99e1de63bd73cb833ba6acdb2ec0772bcb848969
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ except ImportError: from distutils.core import setup setup(name='pynrrd', - version='0.2.2', + version='0.2.3', description='Pure python module for reading and writing nrrd files.', long_description='Pure python module for reading and writing nrrd files. See the github page for more information.', author='Maarten Everts',
Version bump to <I>.
mhe_pynrrd
train
py
5e5b65dc805332772879e79d247adca3edefca82
diff --git a/src/components/calendar/Calendar.js b/src/components/calendar/Calendar.js index <HASH>..<HASH> 100644 --- a/src/components/calendar/Calendar.js +++ b/src/components/calendar/Calendar.js @@ -3065,7 +3065,7 @@ export class Calendar extends Component { if (!this.props.inline) { return ( <InputText ref={this.inputRef} id={this.props.inputId} name={this.props.name} type="text" className={this.props.inputClassName} style={this.props.inputStyle} - readOnly={this.props.readOnlyInput} disabled={this.props.disabled} required={this.props.required} autoComplete="off" placeholder={this.props.placeholder} + readOnly={this.props.readOnlyInput} disabled={this.props.disabled} required={this.props.required} autoComplete="off" placeholder={this.props.placeholder} tabIndex = {this.props.tabIndex} onInput={this.onUserInput} onFocus={this.onInputFocus} onBlur={this.onInputBlur} onKeyDown={this.onInputKeyDown} aria-labelledby={this.props.ariaLabelledBy} inputMode={this.props.inputMode} /> ); }
Fixed #<I> - TabIndex not set on Calendar (#<I>)
primefaces_primereact
train
js
abf8bf994094a4a447767bff4670bad4b6640ee6
diff --git a/src/sap.ui.table/test/sap/ui/table/demokit/sample/OData2/Controller.controller.js b/src/sap.ui.table/test/sap/ui/table/demokit/sample/OData2/Controller.controller.js index <HASH>..<HASH> 100644 --- a/src/sap.ui.table/test/sap/ui/table/demokit/sample/OData2/Controller.controller.js +++ b/src/sap.ui.table/test/sap/ui/table/demokit/sample/OData2/Controller.controller.js @@ -88,7 +88,7 @@ sap.ui.define([ width: sColumnWidth, label: new sap.m.Label({text: "{/#Product/" + sName + "/@sap:label}"}), hAlign: sType && sType.indexOf("Decimal") >= 0 ? "End" : "Begin", - template: specialTemplate() || new Text({text: {path: sName}}) + template: specialTemplate() || new Text({text: {path: sName}, wrapping: false}) }); }
[INTERNAL] sap.ui.table.Table - Demokit sample fix The sap.ui.table.Table does not support wrapping therefore it is not used in the Demokit samples anymore. Change-Id: I3f9d<I>e1ac6c7fec<I>cb<I>c9d<I>d<I>d<I>
SAP_openui5
train
js
ca6894feed667c00a4fcb452f0e800ec1d7e50f2
diff --git a/gatsby-node.js b/gatsby-node.js index <HASH>..<HASH> 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -93,7 +93,7 @@ exports.onPostBuild = async function ( } const currentIndexState = indexState[indexName]; - setStatus(activity, `query ${i}: executing query`); + setStatus(activity, `query #${i + 1}: executing query`); const result = await graphql(query); if (result.errors) { report.panic(`failed to index to Algolia`, result.errors);
chore: update message to clearly indicate the index of query (#<I>) * chore: update message to clearly indicate the index of query * Update gatsby-node.js
algolia_gatsby-plugin-algolia
train
js
70b9ea240ecd71d19b1e38be74865d806529a24a
diff --git a/blobstore_client/Gemfile b/blobstore_client/Gemfile index <HASH>..<HASH> 100644 --- a/blobstore_client/Gemfile +++ b/blobstore_client/Gemfile @@ -1,4 +1,4 @@ -source "http://rubygems.org" +source :rubygems gem "httpclient" diff --git a/blobstore_client/lib/blobstore_client.rb b/blobstore_client/lib/blobstore_client.rb index <HASH>..<HASH> 100644 --- a/blobstore_client/lib/blobstore_client.rb +++ b/blobstore_client/lib/blobstore_client.rb @@ -7,6 +7,8 @@ end require "base64" +require "httpclient" + require "blobstore_client/client" require "blobstore_client/simple_blobstore_client" diff --git a/blobstore_client/spec/spec_helper.rb b/blobstore_client/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/blobstore_client/spec/spec_helper.rb +++ b/blobstore_client/spec/spec_helper.rb @@ -1,5 +1,8 @@ $:.unshift(File.expand_path("../../lib", __FILE__)) +require "bundler" +require "bundler/setup" + require "blobstore_client" Bundler.require(:test)
bundler <I> for blobstore client
cloudfoundry_bosh
train
Gemfile,rb,rb
2c8d6e39debac03f081c21580e94e98b52dec3be
diff --git a/modules/activiti-engine/src/main/java/org/activiti/engine/impl/HistoricTaskInstanceQueryImpl.java b/modules/activiti-engine/src/main/java/org/activiti/engine/impl/HistoricTaskInstanceQueryImpl.java index <HASH>..<HASH> 100644 --- a/modules/activiti-engine/src/main/java/org/activiti/engine/impl/HistoricTaskInstanceQueryImpl.java +++ b/modules/activiti-engine/src/main/java/org/activiti/engine/impl/HistoricTaskInstanceQueryImpl.java @@ -52,8 +52,8 @@ public class HistoricTaskInstanceQueryImpl extends AbstractVariableQueryImpl<His protected String taskName; protected String taskNameLike; protected String taskNameLikeIgnoreCase; - private List<String> taskNameList; - private List<String> taskNameListIgnoreCase; + protected List<String> taskNameList; + protected List<String> taskNameListIgnoreCase; protected String taskParentTaskId; protected String taskDescription; protected String taskDescriptionLike;
ACT-<I> member field access correction
Activiti_Activiti
train
java
bdd68b1c35278f293e7752561a055eb24ad9fec2
diff --git a/great_expectations/data_context/types/__init__.py b/great_expectations/data_context/types/__init__.py index <HASH>..<HASH> 100644 --- a/great_expectations/data_context/types/__init__.py +++ b/great_expectations/data_context/types/__init__.py @@ -20,9 +20,9 @@ from .resource_identifiers import ( ValidationResultIdentifier, ) -# TODO: Deprecate this in favor of DataAssetIdentifier -NormalizedDataAssetName = namedtuple("NormalizedDataAssetName", [ - "datasource", - "generator", - "generator_asset" -]) \ No newline at end of file +# # TODO: Deprecate this in favor of DataAssetIdentifier +# NormalizedDataAssetName = namedtuple("NormalizedDataAssetName", [ +# "datasource", +# "generator", +# "generator_asset" +# ]) \ No newline at end of file
Dup definition most likely due to git merge
great-expectations_great_expectations
train
py
042107a6e23c4c4d96731be18995780d3ea9380d
diff --git a/html/pfappserver/root/static.alt/src/views/Configuration/_config/role.js b/html/pfappserver/root/static.alt/src/views/Configuration/_config/role.js index <HASH>..<HASH> 100644 --- a/html/pfappserver/root/static.alt/src/views/Configuration/_config/role.js +++ b/html/pfappserver/root/static.alt/src/views/Configuration/_config/role.js @@ -215,13 +215,16 @@ export const view = (_, meta = {}) => { ] }, { - label: i18n.t('VLAN'), - text: i18n.t('The VLAN to use for this role'), + label: i18n.t('Inherit VLAN'), + text: i18n.t('Inherit VLAN from parent if none is found'), cols: [ { - namespace: 'vlan', - component: pfFormInput, - attrs: attributesFromMeta(meta, 'vlan') + namespace: 'inherit_vlan', + component: pfFormRangeToggle, + attrs: { + ...attributesFromMeta(meta, 'inherit_vlan'), + values: { checked: 'enabled', unchecked: 'disabled' } + } } ] }
Rename vlan to inherit_vlan and change type to a toggle
inverse-inc_packetfence
train
js
625081fd8937be0b89981727449e83270815514e
diff --git a/lib/zendesk2/client/mock.rb b/lib/zendesk2/client/mock.rb index <HASH>..<HASH> 100644 --- a/lib/zendesk2/client/mock.rb +++ b/lib/zendesk2/client/mock.rb @@ -5,7 +5,7 @@ class Zendesk2::Client < Cistern::Service attr_accessor :last_request def self.data - @data ||= { + @data ||= Hash.new { |h,k| h[k] = { :categories => {}, :forums => {}, :groups => {}, @@ -26,6 +26,7 @@ class Zendesk2::Client < Cistern::Service :users => {}, :views => {}, } + } end def self.serial_id @@ -34,6 +35,18 @@ class Zendesk2::Client < Cistern::Service @current_id end + def data + self.class.data[@url] + end + + def reset + data.clear + end + + def self.reset + data.clear + end + def serial_id self.class.serial_id end
mock data segmented on url
lanej_zendesk2
train
rb
8b4d6f314b07ad67f5737182e717b0ede424ed97
diff --git a/gcloud/bigquery/client.py b/gcloud/bigquery/client.py index <HASH>..<HASH> 100644 --- a/gcloud/bigquery/client.py +++ b/gcloud/bigquery/client.py @@ -64,9 +64,9 @@ class Client(JSONClient): :rtype: tuple, (list, str) :returns: list of :class:`gcloud.bigquery.dataset.Dataset`, plus a - "next page token" string: if not None, indicates that - more datasets can be retrieved with another call (pass that - value as ``page_token``). + "next page token" string: if the toke is not None, + indicates that more datasets can be retrieved with another + call (pass that value as ``page_token``). """ params = {}
Reword :returns: for clarity. Addresses: <URL>
googleapis_google-cloud-python
train
py
93c1e846a700c1e2d07a84ccb6cf7b68ff6495f2
diff --git a/vyked/utils/stats.py b/vyked/utils/stats.py index <HASH>..<HASH> 100644 --- a/vyked/utils/stats.py +++ b/vyked/utils/stats.py @@ -95,7 +95,7 @@ class Aggregator: @classmethod def periodic_aggregated_stats_logger(cls): - hostname = socket.gethostname() + hostname = socket.gethostbyname(socket.gethostname()) service_name = '_'.join(setproctitle.getproctitle().split('_')[:-1]) logd = cls._stats.to_dict()
make host-ip appear consistently in log logging `socket.hostname() was making the json inconsistent and raising alarms unreliable. this should fix the situation.
kashifrazzaqui_vyked
train
py
6ace238632a7c3bb1d3be5861d10a3c04027ae8c
diff --git a/app/decorators/socializer/person_decorator.rb b/app/decorators/socializer/person_decorator.rb index <HASH>..<HASH> 100644 --- a/app/decorators/socializer/person_decorator.rb +++ b/app/decorators/socializer/person_decorator.rb @@ -26,7 +26,7 @@ module Socializer avatar_provider_array = %w( FACEBOOK LINKEDIN TWITTER ) if avatar_provider_array.include?(avatar_provider) - social_avatar_url(avatar_provider) + social_avatar_url else gravatar_url end @@ -84,8 +84,8 @@ module Socializer model.circles + model.memberships end - def social_avatar_url(provider) - auth = authentications.find_by(provider: provider.downcase) + def social_avatar_url + auth = authentications.find_by(provider: avatar_provider.downcase) auth.image_url if auth.present? end
no need to pass avatar_provider as an argument
socializer_socializer
train
rb
144c0689ee9ea7c9651a5dd3536464738aa37d39
diff --git a/src/Objects/Table.php b/src/Objects/Table.php index <HASH>..<HASH> 100644 --- a/src/Objects/Table.php +++ b/src/Objects/Table.php @@ -181,4 +181,21 @@ class Table } + /** + * check if array have a key + * + * @param array $array + * @param mixed $key + * @return bool + */ + public static function exists(array $array , $key) + { + return array_key_exists($key , $array); + } + + + + + + }
add function to check if object has a key
vinala_kernel
train
php
cd1d81d3f53f1359ba416f28f967b86fdabe0de7
diff --git a/configyaml/config/dict.py b/configyaml/config/dict.py index <HASH>..<HASH> 100644 --- a/configyaml/config/dict.py +++ b/configyaml/config/dict.py @@ -43,7 +43,7 @@ class DictNode(AbstractNode): for k, v in self._dict_fields.items(): if 'default' in v: default = v['default'] - instance = v['class'](value=default) + instance = v['class'](value=default, context=self._context, parent=self) self.__dict__[k] = instance self._children[k] = instance diff --git a/tests/test_dict.py b/tests/test_dict.py index <HASH>..<HASH> 100644 --- a/tests/test_dict.py +++ b/tests/test_dict.py @@ -104,11 +104,13 @@ def test_default(): config = DummyConfigDefault(value=value) assert config.is_valid() assert config.foo._value == 'test' + assert config.foo._parent == config value = {'foo': 'bar'} config = DummyConfigDefault(value=value) assert config.is_valid() assert config.foo._value == 'bar' + assert config.foo._parent == config def test_get_item():
pass context and parent in DictNode default instance
dropseed_configyaml
train
py,py
4c607fdb682157270da726e450e0b6750e46d07e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ class FetchExternal(setuptools.command.install.install): setup(cmdclass={'install': FetchExternal}, name='python_moztelemetry', - version='0.3.7.3', + version='0.3.7.5', author='Roberto Agostino Vitillo', author_email='rvitillo@mozilla.com', description='Spark bindings for Mozilla Telemetry',
Bump the package version (by 2).
mozilla_python_moztelemetry
train
py
196e788b469656bc44ff390af417f734d57aed9a
diff --git a/PHPDaemon/WebSocket/Traits/DNode.php b/PHPDaemon/WebSocket/Traits/DNode.php index <HASH>..<HASH> 100755 --- a/PHPDaemon/WebSocket/Traits/DNode.php +++ b/PHPDaemon/WebSocket/Traits/DNode.php @@ -122,6 +122,9 @@ trait DNode { } public function sendPacket($p) { + if (!$this->client) { + return; + } if (is_string($p['method']) && ctype_digit($p['method'])) { $p['method'] = (int) $p['method']; } @@ -129,15 +132,23 @@ trait DNode { } /** - * Called when session finished. + * Called when session is finished * @return void */ public function onFinish() { + $this->cleanup(); + parent::onFinish(); + } + + /** + * Swipes internal structures + * @return void + */ + public function cleanup() { $this->remoteMethods = []; $this->localMethods = []; $this->persistentCallbacks = []; $this->callbacks = []; - parent::onFinish(); } protected static function setPath(&$m, $path, $val) {
DNode: added method cleanup()
kakserpom_phpdaemon
train
php
99ef937ed48a176c8bba4e82f2142033504d4685
diff --git a/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/CheckpointedInputGate.java b/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/CheckpointedInputGate.java index <HASH>..<HASH> 100644 --- a/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/CheckpointedInputGate.java +++ b/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/CheckpointedInputGate.java @@ -125,7 +125,6 @@ public class CheckpointedInputGate implements PullingAsyncDataInput<BufferOrEven next = inputGate.pollNext(); } else { - // TODO: FLINK-12536 for non credit-based flow control, getNext method is blocking next = bufferStorage.pollNext(); if (!next.isPresent()) { return pollNext();
[hotfix][doc] Remove invalid comment from CheckpointedInputGate This closes #<I> .
apache_flink
train
java
f529511fb655d5a41dd406da3d8bfa72cc796e98
diff --git a/lib/plugins/coffee.js b/lib/plugins/coffee.js index <HASH>..<HASH> 100644 --- a/lib/plugins/coffee.js +++ b/lib/plugins/coffee.js @@ -11,7 +11,7 @@ module.exports = function coffeePlugin(carapace) { // as necessary so that the .coffee is handled correctly by the `coffee` binary. // var script = carapace.script; - if (script.match(/\.coffee$/)) { + if (value == 'true' || script.match(/\.coffee$/)) { carapace.script = coffeeBin; carapace.argv.unshift(script); }
[fix] coffee plugin should be able to be forced
nodejitsu_haibu-carapace
train
js
9a4d45aea445a8673013719f200f13cd26e75d95
diff --git a/lib/datalib.php b/lib/datalib.php index <HASH>..<HASH> 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -2019,7 +2019,7 @@ function get_group_teachers($courseid, $groupid) { if (($teacher->authority > 0) and ismember($groupid, $teacher->id)) { // Specific group teachers continue; } - unset($teacher[$key]); + unset($teachers[$key]); } } return $teachers;
fixed bug <I>, thanks Ilshat Fattakhov; merged from MOODLE_<I>_STABLE
moodle_moodle
train
php
dc49ac42dacf2c07fe68268eebbb39913448fc77
diff --git a/lib/logger/config-serializer.js b/lib/logger/config-serializer.js index <HASH>..<HASH> 100644 --- a/lib/logger/config-serializer.js +++ b/lib/logger/config-serializer.js @@ -4,6 +4,7 @@ module.exports = configSerializer; function configSerializer(config) { const redactedFields = [ + 'authorization', 'token', 'githubAppKey', 'npmToken',
fix: add authorization to redacted logger fields
renovatebot_renovate
train
js
b1fdee47479dfeff0337c50b9551fc065a06ce6d
diff --git a/molgenis-omx-dataexplorer/src/main/resources/js/dataexplorer-data.js b/molgenis-omx-dataexplorer/src/main/resources/js/dataexplorer-data.js index <HASH>..<HASH> 100644 --- a/molgenis-omx-dataexplorer/src/main/resources/js/dataexplorer-data.js +++ b/molgenis-omx-dataexplorer/src/main/resources/js/dataexplorer-data.js @@ -135,6 +135,7 @@ settings.registry = 'https://www.dasregistry.org/das/sources'; genomeBrowser = new Browser(settings); genomeBrowser.realInit(); + genomeBrowser.highlightRegion(genomeBrowser.chr, (genomeBrowser.viewStart + 9990), (genomeBrowser.viewEnd - 9990)); var featureInfoMap = {}; genomeBrowser.addFeatureInfoPlugin(function(f, info) { //check if there is cached information for this clicked item
Region that you query in genome browser is now always highlighted on initialization
molgenis_molgenis
train
js
0a53b181d96341339fb49dc29dbbe6e374567583
diff --git a/lib/view_assets/css_assets.rb b/lib/view_assets/css_assets.rb index <HASH>..<HASH> 100644 --- a/lib/view_assets/css_assets.rb +++ b/lib/view_assets/css_assets.rb @@ -1,15 +1,21 @@ module ViewAssets + # TODO add rspec examples class StyleSheetAssets < AssetsFinder def assets_path - "#{root_path}/stylesheets" + # 'assets/javascripts' + 'stylesheets' end def asset_extension 'css' end + def asset_type + 'stylesheet' + end + def tag(css_href) "<link href='#{css_href}' media='screen' rel='stylesheet' />" end end -end +end \ No newline at end of file
correct the configuration of css assets finder
bom-d-van_view_assets
train
rb
48a7ad3374795136859d33f1f07ffbaf0cd69acd
diff --git a/gnupg/gnupg.py b/gnupg/gnupg.py index <HASH>..<HASH> 100644 --- a/gnupg/gnupg.py +++ b/gnupg/gnupg.py @@ -171,11 +171,6 @@ def _make_binary_stream(s, encoding): rv = StringIO(s) return rv -def _today(): - """Get the current date as a string in the form %Y-%m-%d.""" - now_string = datetime.now().__str__() - return now_string.split(' ', 1)[0] - def _threaded_copy_data(instream, outstream): wr = threading.Thread(target=_copy_data, args=(instream, outstream)) wr.setDaemon(True)
Remove function _today() from gnupg.py.
isislovecruft_python-gnupg
train
py
248b70ec9de642fdf1c622ba699b4fafd4064842
diff --git a/src/LouisLam/Util.php b/src/LouisLam/Util.php index <HASH>..<HASH> 100644 --- a/src/LouisLam/Util.php +++ b/src/LouisLam/Util.php @@ -22,12 +22,17 @@ class Util if ($containIndex) { return $_SERVER["SCRIPT_NAME"] . "/" . $relativePath; } else { - return str_replace("index.php", "", $_SERVER["SCRIPT_NAME"]) . $relativePath; + $segments = explode("/", $_SERVER["SCRIPT_NAME"]); + + $phpFile = $segments[count($segments) - 1]; + return str_replace($phpFile, "", $_SERVER["SCRIPT_NAME"]) . $relativePath; } } public static function res($relativePath) { - return str_replace("index.php", "", $_SERVER["SCRIPT_NAME"]) . $relativePath; + $segments = explode("/", $_SERVER["SCRIPT_NAME"]); + $phpFile = $segments[count($segments) - 1]; + return str_replace($phpFile, "", $_SERVER["SCRIPT_NAME"]) . $relativePath; } public static function loadJSON($path)
handle url if is not index.php
louislam_louislam-utilities
train
php
7ab950be165781dd85c847c3e558daa1304c7136
diff --git a/views/js/qtiItem/core/Loader.js b/views/js/qtiItem/core/Loader.js index <HASH>..<HASH> 100755 --- a/views/js/qtiItem/core/Loader.js +++ b/views/js/qtiItem/core/Loader.js @@ -422,26 +422,8 @@ define([ portableElement.typeIdentifier = data.typeIdentifier; portableElement.markup = data.markup; portableElement.entryPoint = data.entryPoint; + portableElement.properties = data.properties; portableElement.libraries = data.libraries; - portableElement.setNamespace('', data.xmlns); - - loadPortableCustomElementProperties(portableElement, data.properties); - } - - /** - * If a property is given as a serialized JSON object, parse it directly to a JS object - */ - function loadPortableCustomElementProperties(portableElement, rawProperties) { - var properties = {}; - - _.forOwn(rawProperties, function(value, key) { - try { - properties[key] = JSON.parse(value); - } catch (e) { - properties[key] = value; - } - }); - portableElement.properties = properties; } return Loader;
removed automatic parsing of JSON content in interaction properties
oat-sa_extension-tao-itemqti
train
js
af355df2483680e978e58bb15d6cf505023efe5b
diff --git a/lib/lean_tag/taggable.rb b/lib/lean_tag/taggable.rb index <HASH>..<HASH> 100644 --- a/lib/lean_tag/taggable.rb +++ b/lib/lean_tag/taggable.rb @@ -20,7 +20,7 @@ module LeanTag define_method "add_#{tag_relation.to_s.singularize}!", ->(tag) { _add_tag!(tag, tag_relation) } define_method "#{tag_relation.to_s.singularize}_list", ->() { _get_tag_list(tag_relation) } define_method "remove_#{tag_relation.to_s.singularize}", ->(tag) { _remove_tag(tag, tag_relation) } - define_method "remove_#{tag_relation.to_s.singularize}!", ->(tag) { _remove_tag(tag, tag_relation) } + define_method "remove_#{tag_relation.to_s.singularize}!", ->(tag) { _remove_tag!(tag, tag_relation) } define_method "#{tag_relation.to_s.singularize}_list=", ->(list) { _set_tag_list(list, tag_relation) } end end
remove_tag! was never being called
waffleau_lean_tag
train
rb
d3ca4e396814750441434370b1d0630a26133f75
diff --git a/prove.go b/prove.go index <HASH>..<HASH> 100644 --- a/prove.go +++ b/prove.go @@ -60,7 +60,7 @@ func (v *ProofEngine) PromptRemoteName() (err error) { for len(v.Username) == 0 && err == nil { var un string un, err = v.ProveUI.PromptUsername(v.st.GetPrompt(), prevErr) - if err != nil { + if err == nil { prevErr = v.st.CheckUsername(un) if prevErr == nil { v.Username = un
bugfix for keybase/go-client#<I>
keybase_client
train
go
6e4d2aff9b644d7dc03922de1a3020a4bd56b346
diff --git a/lmdb/val.go b/lmdb/val.go index <HASH>..<HASH> 100644 --- a/lmdb/val.go +++ b/lmdb/val.go @@ -40,10 +40,10 @@ func WrapMulti(page []byte, stride int) *Multi { // Vals returns a slice containing the values in m. The returned slice has // length m.Len() and each item has length m.Stride(). func (m *Multi) Vals() [][]byte { - i, ps := 0, make([][]byte, m.Len()) - for off := 0; off < len(m.page); off += m.stride { - ps[i] = m.page[off : off+m.stride] - i++ + n := m.Len() + ps := make([][]byte, n) + for i := 0; i < n; i++ { + ps[i] = m.Val(i) } return ps }
clean up Multi.Vals by using Multi.Val internally
bmatsuo_lmdb-go
train
go
16590bd2f1dd0c8eb91b89e5a03f0dfaa24416f0
diff --git a/lib/mactag/ctags.rb b/lib/mactag/ctags.rb index <HASH>..<HASH> 100644 --- a/lib/mactag/ctags.rb +++ b/lib/mactag/ctags.rb @@ -14,8 +14,19 @@ module Mactag binary.gsub!('{OUTPUT}', @output) binary.gsub!('{INPUT}', @input) - - system "cd #{Rails.root} && #{binary}" + + exec(binary) + end + + + private + + def exec(binary) + system command(binary) + end + + def command(binary) + "cd #{Rails.root} && #{binary}" end end end
Separate this functionality for easier testing.
rejeep_mactag
train
rb
9999584456fc636611c667bd3943b09489f73c84
diff --git a/lib/quality/flay.rb b/lib/quality/flay.rb index <HASH>..<HASH> 100644 --- a/lib/quality/flay.rb +++ b/lib/quality/flay.rb @@ -1,8 +1,9 @@ module Quality module Flay - def quality_flay - private + private + + def quality_flay ratchet_quality_cmd('flay', args: "-m 75 -t 99999 #{ruby_files}", emacs_format: true) do |line|
Fix accidental line location swap of 'private'
apiology_quality
train
rb
4e21b81a0748f35d66d0c7bc2554d0ad28d1a098
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,6 +1,6 @@ const gulp = require('gulp'); const sass = require('gulp-sass'); -var browserSync = require('browser-sync').create(); +const browserSync = require('browser-sync').create(); // Static server gulp.task('browser-sync', ['sass', 'js'], function () {
Uses const to be more consistent
indiana-university_rivet-collapsible
train
js
87989b4534362af83e11b1031776437ab9d5cc42
diff --git a/multiqc/modules/mirtrace/mirtrace.py b/multiqc/modules/mirtrace/mirtrace.py index <HASH>..<HASH> 100755 --- a/multiqc/modules/mirtrace/mirtrace.py +++ b/multiqc/modules/mirtrace/mirtrace.py @@ -339,7 +339,7 @@ class MultiqcModule(BaseMultiqcModule): config = { 'id': 'mirtrace_complexity_plot', - 'title': 'miRTrace miRNA Complexity Plot', + 'title': 'miRTrace: miRNA Complexity Plot', 'ylab': 'Distinct miRNA Count', 'xlab': 'Number of Sequencing Reads', 'ymin': 0,
Add colon in plot title for complexity plot
ewels_MultiQC
train
py
cd412f442fe94766a8a0e0b74edd5e61959ca6ab
diff --git a/elytron/src/test/java/org/wildfly/extension/elytron/MappersTestCase.java b/elytron/src/test/java/org/wildfly/extension/elytron/MappersTestCase.java index <HASH>..<HASH> 100644 --- a/elytron/src/test/java/org/wildfly/extension/elytron/MappersTestCase.java +++ b/elytron/src/test/java/org/wildfly/extension/elytron/MappersTestCase.java @@ -56,7 +56,6 @@ public class MappersTestCase extends AbstractSubsystemBaseTest { Assert.assertEquals("beta", transformer.apply(new NamePrincipal("beta@wildfly.org")).getName()); // remove server part Assert.assertEquals("gamma@example.com", transformer.apply(new NamePrincipal("gamma@example.com")).getName()); // keep Assert.assertEquals(null, transformer.apply(new NamePrincipal("invalid"))); // not an e-mail address - Assert.assertEquals(null, transformer.apply(new NamePrincipal(null))); Assert.assertEquals(null, transformer.apply(null)); } }
[WFCORE-<I>] Remove invalid test with Principal with 'null' name.
wildfly_wildfly-core
train
java
20cca177728d50a272f905805e6a41261250e206
diff --git a/abstract.js b/abstract.js index <HASH>..<HASH> 100644 --- a/abstract.js +++ b/abstract.js @@ -235,7 +235,7 @@ ee(Object.defineProperties(PersistenceDriver.prototype, assign({ onAdd = function (obj) { var observable, value, stamp, objId, sKeys, sValue, data, indexEvent; obj = resolveObject(obj, names); - if (!obj) return null; + if (!obj) return deferred(null); objId = obj.__id__; if (obj.isKeyStatic(key)) { value = obj[key]; @@ -257,9 +257,9 @@ ee(Object.defineProperties(PersistenceDriver.prototype, assign({ if (data) { if (data.stamp === stamp) { if (sKeys) { - if (isCopy.call(resolveEventKeys(data.value), sKeys)) return; + if (isCopy.call(resolveEventKeys(data.value), sKeys)) return deferred(null); } else { - if (data.value === sValue) return; + if (data.value === sValue) return deferred(null); } ++stamp; // most likely model update } else if (data.stamp > stamp) {
Ensure common return type in internal function
medikoo_dbjs-persistence
train
js
c3e1ad93bcb17462ff38b9dd0b3be38479c81fc0
diff --git a/lib/pi_charts.rb b/lib/pi_charts.rb index <HASH>..<HASH> 100644 --- a/lib/pi_charts.rb +++ b/lib/pi_charts.rb @@ -1,3 +1,5 @@ +# I guess I could do a loop, jah feel? +# Or any other way I guess. require "pi_charts/version" require "pi_charts/base" require "pi_charts/utils" @@ -7,6 +9,7 @@ require "pi_charts/pie_chart" require "pi_charts/bar_chart" require "pi_charts/doughnut_chart" +# Lil' extra spice. require "securerandom" require "json"
Comments, more comments. Need’em.
picatz_Pi-Charts
train
rb
3af6b6b0c2c0a025e83fc9c02446c712121a6b7c
diff --git a/lib/active_record_shards/model.rb b/lib/active_record_shards/model.rb index <HASH>..<HASH> 100644 --- a/lib/active_record_shards/model.rb +++ b/lib/active_record_shards/model.rb @@ -9,7 +9,7 @@ module ActiveRecordShards def is_sharded? if self == ActiveRecord::Base - true + supports_sharding? elsif self == base_class @sharded != false else
AR::Base is only sharded if sharding is supported
zendesk_active_record_shards
train
rb
ef5d7be0c90c7a2514d8d294feaf6e53931b0252
diff --git a/spyderlib/plugins/editor.py b/spyderlib/plugins/editor.py index <HASH>..<HASH> 100644 --- a/spyderlib/plugins/editor.py +++ b/spyderlib/plugins/editor.py @@ -472,7 +472,7 @@ class EditorTabWidget(Tabs): finfo = self.data[index] editor = finfo.editor editor.setFocus() - plugin_title += " - " + osp.basename(finfo.filename) + plugin_title += " - " + osp.abspath(finfo.filename) self.__refresh_classbrowser(index, update=False) self.emit(SIGNAL('refresh_analysis_results()')) self.__refresh_statusbar(index)
Editor / fixed Issue <I>: show full path of current script in Editor's dockwidget title
spyder-ide_spyder
train
py
42d5bb253addc16f84ab2ba5b88325b58d395407
diff --git a/flask_user/tests/test_db_adapters.py b/flask_user/tests/test_db_adapters.py index <HASH>..<HASH> 100644 --- a/flask_user/tests/test_db_adapters.py +++ b/flask_user/tests/test_db_adapters.py @@ -21,6 +21,7 @@ def test_mongoengine_db_adapter(app): # Test add_object user1 = db_adapter.add_object(User, username=username) + user2 = db_adapter.add_object(User, username='SecondUser') db_adapter.commit() # Test get_object @@ -57,11 +58,18 @@ def test_mongoengine_db_adapter(app): assert user_roles == ['Secret', 'Agent'] # Test delete_object + user1_id = user1.id db_adapter.delete_object(user1) db_adapter.commit() - user = db_adapter.find_first_object(User, username=username) + user = db_adapter.get_object(User, user1_id) assert user==None + user = db_adapter.get_object(User, user2.id) + assert user==user2 + # Test drop_all_tables + db_adapter.drop_all_tables() + user = db_adapter.get_object(User, user2.id) + assert user==None
Added tests for MongoEngineDbAdapter. Increased test coverage.
lingthio_Flask-User
train
py
957c7816ed0e9847aeaa8a7eedfb5a93de80f307
diff --git a/project/library/CM/Request/Abstract.php b/project/library/CM/Request/Abstract.php index <HASH>..<HASH> 100644 --- a/project/library/CM/Request/Abstract.php +++ b/project/library/CM/Request/Abstract.php @@ -400,14 +400,17 @@ abstract class CM_Request_Abstract { * @param array|null $headers * @param CM_Model_User|null $viewer * @param string|null $body + * @throws CM_Exception_Invalid * @return CM_Request_Get|CM_Request_Post */ public static function factory($method, $uri, array $headers = null, CM_Model_User $viewer = null, $body = null) { - if ($method === 'POST') { + $method = strtolower($method); + if ($method === 'post') { return new CM_Request_Post($uri, $headers, $viewer, $body); } - if ($method === 'GET') { + if ($method === 'get') { return new CM_Request_Get($uri, $headers, $viewer); } + throw new CM_Exception_Invalid('Invalid request method `' . $method . '`'); } } \ No newline at end of file
t<I>: Method case insensitive; exception thrown
cargomedia_cm
train
php
2fa846f25248559a413214c5ef2188af2ff7fe45
diff --git a/logback-site/src/site/pages/templates/footer.js b/logback-site/src/site/pages/templates/footer.js index <HASH>..<HASH> 100644 --- a/logback-site/src/site/pages/templates/footer.js +++ b/logback-site/src/site/pages/templates/footer.js @@ -21,7 +21,7 @@ AAT = '@' DOOTT = '.' document.write('<tr>') document.write('<td align="left" colspan="2">') -document.write('We are actively looking for volunteers to proofread the documentation. Please send your corrections or suggestions for improvement to "corrections' + AAT +'qos'+DOOTT+'ch".'); +document.write('We are actively looking for volunteers to proofread the documentation. Please send your corrections or suggestions for improvement to "corrections' + AAT +'qos'+DOOTT+'ch". See also the <a href="http://articles.qos.ch/contributing.html">instructions for contributors</a>.'); document.write('</td>') document.write('</table>')
- added a link to the article on making contributions.
tony19_logback-android
train
js
05aa4cdd39fbe2a40075dd8e00eb53593237052c
diff --git a/transmute_core/tests/frameworks/test_aiohttp/__init__.py b/transmute_core/tests/frameworks/test_aiohttp/__init__.py index <HASH>..<HASH> 100644 --- a/transmute_core/tests/frameworks/test_aiohttp/__init__.py +++ b/transmute_core/tests/frameworks/test_aiohttp/__init__.py @@ -1,4 +1,2 @@ import pytest -import sys - -pytestmark = pytest.mark.skipif(sys.version_info < (3,), reason="Python version must be greater than 3.") \ No newline at end of file +import sys \ No newline at end of file diff --git a/transmute_core/tests/frameworks/test_aiohttp/conftest.py b/transmute_core/tests/frameworks/test_aiohttp/conftest.py index <HASH>..<HASH> 100644 --- a/transmute_core/tests/frameworks/test_aiohttp/conftest.py +++ b/transmute_core/tests/frameworks/test_aiohttp/conftest.py @@ -1,9 +1,15 @@ import pytest -from .example import create_app +import sys + +def pytest_ignore_collect(*args, **kwargs): + if sys.version_info < (3,5): + return True + return False @pytest.fixture def app(loop): + from .example import create_app return create_app()
minor: fixed python<I> unit tests aiohttp's test files we're still loading during pytest execution. skipif doesn't prevent loading of aiohttp conftest.py files, resulting in SyntaxErrors being raised during collection. Using pytest_ignore_collect and moving import of aiohttp files to inline imports solves the issue.
toumorokoshi_transmute-core
train
py,py
6a188f07bfe7ad5db211f9ba8fe7abf0de5d3fcb
diff --git a/src/index.test.js b/src/index.test.js index <HASH>..<HASH> 100644 --- a/src/index.test.js +++ b/src/index.test.js @@ -1,9 +1,10 @@ import _ from 'lodash'; -import eventInfoPlugin from './index'; import * as miniPlugins from './plugins'; import * as eventSamples from './eventSamples'; +const eventInfoPlugin = require('./index'); + class MockInvocation { constructor(event) { this.logData = {};
style(index.test.js): Fix lint issue with /index (#8)
iopipe_iopipe-js-event-info
train
js
74bd40b465e2749a3be93797ccf3bf31da6ee187
diff --git a/pmxbot/core.py b/pmxbot/core.py index <HASH>..<HASH> 100644 --- a/pmxbot/core.py +++ b/pmxbot/core.py @@ -251,7 +251,10 @@ class LoggingCommandBot(irc.bot.SingleServerIRCBot): ) executor(howlong, self.background_runner, arguments) for action in _at_registry: - self._schedule_at(connection, *action) + try: + self._schedule_at(connection, *action) + except Exception: + log.exception("Error scheduling", action) self._set_keepalive(connection)
Log an exception when failing to schedule an action.
yougov_pmxbot
train
py
9164cf0954d1c932918cb4139935fd66d643a51e
diff --git a/tests/test_pdf.py b/tests/test_pdf.py index <HASH>..<HASH> 100644 --- a/tests/test_pdf.py +++ b/tests/test_pdf.py @@ -2,10 +2,11 @@ Testing focused on pikepdf.Pdf """ +import locale import os import shutil import sys -from io import StringIO, BytesIO +from io import BytesIO, StringIO from pathlib import Path from unittest.mock import Mock, patch @@ -15,7 +16,6 @@ import pikepdf from pikepdf import PasswordError, Pdf, PdfError, Stream from pikepdf._cpphelpers import fspath # For py35 - # pylint: disable=redefined-outer-name @@ -180,6 +180,7 @@ def test_progress(trivial, outdir): mock.assert_called() +@pytest.mark.skipif(locale.getpreferredencoding() != 'UTF-8', reason="Unicode check") def test_unicode_filename(resources, outdir): target1 = outdir / '测试.pdf' target2 = outdir / '通过考试.pdf'
tests: fix possible issue when running tests in non-Unicode environment
pikepdf_pikepdf
train
py
61a1b918c7e06522711908db29d5f69a1edb43fa
diff --git a/src/Laracasts/TestDummy/EloquentDatabaseProvider.php b/src/Laracasts/TestDummy/EloquentDatabaseProvider.php index <HASH>..<HASH> 100644 --- a/src/Laracasts/TestDummy/EloquentDatabaseProvider.php +++ b/src/Laracasts/TestDummy/EloquentDatabaseProvider.php @@ -19,7 +19,7 @@ class EloquentDatabaseProvider implements BuildableRepositoryInterface { throw new TestDummyException("The {$type} model was not found."); } - return (new $type)->forceFill($attributes); + return $this->fill($type, $attributes); } /** @@ -44,4 +44,22 @@ class EloquentDatabaseProvider implements BuildableRepositoryInterface { return $entity->getAttributes(); } + /** + * Force fill an object with attributes. + * + * @param string $type + * @param array $attributes + * @return Eloquent + */ + private function fill($type, $attributes) + { + Eloquent::unguard(); + + $object = (new $type)->fill($attributes); + + Eloguent::reguard(); + + return $object; + } + }
Fall back to Laravel 4 friendly force filling
laracasts_TestDummy
train
php
87681b8e6a9d8799529e275f5b5a40dc0bff59f5
diff --git a/Runnable/EventsGenerator/CallableEventsGenerator.php b/Runnable/EventsGenerator/CallableEventsGenerator.php index <HASH>..<HASH> 100644 --- a/Runnable/EventsGenerator/CallableEventsGenerator.php +++ b/Runnable/EventsGenerator/CallableEventsGenerator.php @@ -6,7 +6,7 @@ class CallableEventsGenerator implements EventsGenerator { public function produce() { - call_user_func_array($this->callable, []); + return call_user_func_array($this->callable, []); } /**
fix(CallableEventsGenerator): return the result of the produce call
wizbii_pipeline
train
php
738c40259c3c758abc86636f98dcf59eddac9061
diff --git a/tile_generator/bosh.py b/tile_generator/bosh.py index <HASH>..<HASH> 100644 --- a/tile_generator/bosh.py +++ b/tile_generator/bosh.py @@ -76,9 +76,8 @@ class BoshRelease: return self.build_tarball() def download_tarball(self): - # TODO - Figure out why some releases aren't pulled from the cache mkdir_p(self.release_dir) - tarball = os.path.join(self.release_dir, self.name + '-boshrelease.tgz') + tarball = os.path.join(self.release_dir, self.name + '.tgz') download(self.path, tarball, self.context.get('cache', None)) manifest = self.get_manifest(tarball) self.tarball = os.path.join(self.release_dir, manifest['name'] + '-' + manifest['version'] + '.tgz')
Cleaned up path name to fix caching issue
cf-platform-eng_tile-generator
train
py
7008df1a9fcb61d7b0ec381daff72535adafb0f4
diff --git a/lib/podio/areas/conversation.rb b/lib/podio/areas/conversation.rb index <HASH>..<HASH> 100644 --- a/lib/podio/areas/conversation.rb +++ b/lib/podio/areas/conversation.rb @@ -27,10 +27,10 @@ module Podio response.body end - def create_reply(conversation_id, text) + def create_reply(conversation_id, text, file_ids = []) response = Podio.connection.post do |req| req.url "/conversation/#{conversation_id}/reply" - req.body = { :text => text } + req.body = { :text => text, :file_ids => file_ids } end response.body['message_id'] end
Add file_ids support to conversation replies
podio_podio-rb
train
rb
0f40b6748bc0866b2481eace810e8dd9c5dec132
diff --git a/asciimatics/widgets.py b/asciimatics/widgets.py index <HASH>..<HASH> 100644 --- a/asciimatics/widgets.py +++ b/asciimatics/widgets.py @@ -167,7 +167,8 @@ class Frame(Effect): within your Frame. """ - # Colour palette for the widgets within the Frame. + #: Colour palette for the widgets within the Frame. Each entry should be + #: a 3-tuple of (foreground colour, attribute, background colour). palette = { "background": (Screen.COLOUR_WHITE, Screen.A_NORMAL, Screen.COLOUR_BLUE),
Add palette to auto-generated docs
peterbrittain_asciimatics
train
py
8168056890f8f95b7a509c574e97e0a51f0a2322
diff --git a/test/transform.js b/test/transform.js index <HASH>..<HASH> 100644 --- a/test/transform.js +++ b/test/transform.js @@ -53,8 +53,8 @@ describe('Transform stream', function () { t.on('end', function () { assert(gotBytes); - assert(gotBytes); - assert(gotBytes); + assert(gotPassthrough); + assert(gotData); done(); });
test: check all the variables in Transform test Before `gotBytes` was being checked 3 times in a row. Closes #1.
TooTallNate_node-stream-parser
train
js
089ae2c88b4db4d92d818c1fe55a0a3fc11748d8
diff --git a/lib/helpers/sunomono_helpers.rb b/lib/helpers/sunomono_helpers.rb index <HASH>..<HASH> 100644 --- a/lib/helpers/sunomono_helpers.rb +++ b/lib/helpers/sunomono_helpers.rb @@ -149,7 +149,7 @@ end def framework_avaliable?(framework) if framework.downcase != 'calabash' && framework.downcase != 'appium' - puts 'Invalid framework choice calabash or appium' + puts "#{framework} is a invalid framework choice calabash or appium" exit 1 end end \ No newline at end of file diff --git a/lib/sunomono.rb b/lib/sunomono.rb index <HASH>..<HASH> 100644 --- a/lib/sunomono.rb +++ b/lib/sunomono.rb @@ -237,10 +237,7 @@ module Sunomono default: :en def new(platform, name) - if platform != 'calabash' && platform != 'appium' - puts "#{platform} is a invalid platform, please type calabash or appium" - exit 1 - end + framework_avaliable?(platform) I18n.config.default_locale = options[:lang] # Thor will be responsible to look for identical
Adjust on platform validation on command new project
concretesolutions_sunomono
train
rb,rb
2a4afe0699d6ec9b360f789c2138fc6d032c2440
diff --git a/lib/html-proofer/configuration.rb b/lib/html-proofer/configuration.rb index <HASH>..<HASH> 100644 --- a/lib/html-proofer/configuration.rb +++ b/lib/html-proofer/configuration.rb @@ -34,6 +34,7 @@ module HTMLProofer :headers => { 'User-Agent' => "Mozilla/5.0 (compatible; HTML Proofer/#{HTMLProofer::VERSION}; +https://github.com/gjtorikian/html-proofer)" } + :connecttimeout => 10 } HYDRA_DEFAULTS = {
Set Typhoeus connection timeout, fixes #<I>, #<I>
gjtorikian_html-proofer
train
rb
8fa4275a72c334fe945dada6113fa0153ca28c87
diff --git a/actionpack/lib/action_controller/test_process.rb b/actionpack/lib/action_controller/test_process.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_controller/test_process.rb +++ b/actionpack/lib/action_controller/test_process.rb @@ -110,6 +110,7 @@ module ActionController #:nodoc: end def recycle! + @env["action_controller.request.request_parameters"] = {} self.query_parameters = {} self.path_parameters = {} @headers, @request_method, @accepts, @content_type = nil, nil, nil, nil diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb index <HASH>..<HASH> 100644 --- a/actionpack/test/controller/test_test.rb +++ b/actionpack/test/controller/test_test.rb @@ -515,6 +515,14 @@ XML assert_nil @request.instance_variable_get("@request_method") end + def test_params_reset_after_post_request + post :no_op, :foo => "bar" + assert_equal "bar", @request.params[:foo] + @request.recycle! + post :no_op + assert @request.params[:foo].blank? + end + %w(controller response request).each do |variable| %w(get post put delete head process).each do |method| define_method("test_#{variable}_missing_for_#{method}_raises_error") do
Reset request_parameters in TestRequest#recycle! to avoid multiple posts clobbering each other [#<I> state:resolved]
rails_rails
train
rb,rb
833ee24710496d317a03b0f0b9f61df31291d75b
diff --git a/zhaquirks/xiaomi/__init__.py b/zhaquirks/xiaomi/__init__.py index <HASH>..<HASH> 100644 --- a/zhaquirks/xiaomi/__init__.py +++ b/zhaquirks/xiaomi/__init__.py @@ -186,8 +186,9 @@ class BasicCluster(CustomCluster, Basic): @staticmethod def _calculate_remaining_battery_percentage(voltage): """Calculate percentage.""" - min_voltage = 2500 - max_voltage = 3000 + # Min/Max values from https://github.com/louisZL/lumi-gateway-local-api + min_voltage = 2800 + max_voltage = 3300 percent = (voltage - min_voltage) / (max_voltage - min_voltage) * 200 return min(200, percent)
Fix Xiaomi sensors battery level (#<I>) * Fix Xiaomi sensors battery level According to <URL>
dmulcahey_zha-device-handlers
train
py
d824ea415d050f5b41ce7eb680b137de653c843e
diff --git a/git.go b/git.go index <HASH>..<HASH> 100644 --- a/git.go +++ b/git.go @@ -10,6 +10,7 @@ import ( "bytes" "unsafe" "strings" + "fmt" ) const ( @@ -107,6 +108,9 @@ func (e GitError) Error() string{ func LastError() error { err := C.giterr_last() + if err == nil { + return &GitError{"No message", 0} + } return &GitError{C.GoString(err.message), int(err.klass)} }
Catch nil error instances Unfortunately libgit2 sometimes returns an error without setting an error message. Provide an alternative message instead of trying to dereference nil.
libgit2_git2go
train
go
7293125a8933c38f59e9b777efcc1652ea9272f9
diff --git a/model/QtiJsonItemCompiler.php b/model/QtiJsonItemCompiler.php index <HASH>..<HASH> 100644 --- a/model/QtiJsonItemCompiler.php +++ b/model/QtiJsonItemCompiler.php @@ -88,7 +88,7 @@ class QtiJsonItemCompiler extends QtiItemCompiler $qtiItem = $this->retrieveAssets($item, $language, $publicDirectory); if (count($qtiItem->getBody()->getElements()) === 0) { - return new common_report_Report(common_report_Report::TYPE_ERROR, 'The item has an empty body.'); + //return new common_report_Report(common_report_Report::TYPE_ERROR, 'The item has an empty body.'); } $this->compileItemIndex($item->getUri(), $qtiItem, $language);
Removing empty item compilation failure as it is too much greedy.
oat-sa_extension-tao-itemqti
train
php
85ea7e8575bb0f9a2fac989f26970809b36640a4
diff --git a/airflow/contrib/hooks/gcp_dataflow_hook.py b/airflow/contrib/hooks/gcp_dataflow_hook.py index <HASH>..<HASH> 100644 --- a/airflow/contrib/hooks/gcp_dataflow_hook.py +++ b/airflow/contrib/hooks/gcp_dataflow_hook.py @@ -273,7 +273,7 @@ class DataFlowHook(GoogleCloudBaseHook): # https://cloud.google.com/dataflow/docs/reference/rest/v1b3/RuntimeEnvironment environment = {} for key in ['maxWorkers', 'zone', 'serviceAccountEmail', 'tempLocation', - 'bypassTempDirValidation', 'machineType']: + 'bypassTempDirValidation', 'machineType', 'network', 'subnetwork']: if key in variables: environment.update({key: variables[key]}) body = {"jobName": name,
[AIRFLOW-<I>] set network, subnetwork when launching dataflow template (#<I>)
apache_airflow
train
py
44eb20268b69f79fdd30348f87a260532354fd19
diff --git a/src/lib/_partials/.meta.realm.js b/src/lib/_partials/.meta.realm.js index <HASH>..<HASH> 100644 --- a/src/lib/_partials/.meta.realm.js +++ b/src/lib/_partials/.meta.realm.js @@ -20,7 +20,7 @@ module.exports = exports = (kvp, options) => { } return { - key: kvp.key + ">main", + key: kvp.key, value: Object.assign(partial, raw) }; };
Removed 'main' partial dependency
lynx-json_lynx-docs
train
js
6b9a4ae125b35bd32b201481f6e2390af2be9a74
diff --git a/tests/test_jwt.py b/tests/test_jwt.py index <HASH>..<HASH> 100644 --- a/tests/test_jwt.py +++ b/tests/test_jwt.py @@ -1,13 +1,13 @@ from __future__ import unicode_literals +import json +import sys +import time + from calendar import timegm from datetime import datetime from decimal import Decimal -import sys -import time -import json - import jwt if sys.version_info >= (2, 7): @@ -630,7 +630,7 @@ class TestJWT(unittest.TestCase): algorithm='ES384') with open('tests/testkey_ec.pub', 'r') as ec_pub_file: - pub_rsakey = ec_pub_file.read() + pub_eckey = ec_pub_file.read() assert jwt.decode(jwt_message, pub_eckey) load_output = jwt.load(jwt_message)
Fix test_encode_decode_with_ecdsa_sha<I> so that it actually uses the key its trying to use when using a SSH public key as a string argument to decode()
jpadilla_pyjwt
train
py
37a8bda4b249fee1bfec8d439936d8d1b971ccd8
diff --git a/zipline/finance/performance.py b/zipline/finance/performance.py index <HASH>..<HASH> 100644 --- a/zipline/finance/performance.py +++ b/zipline/finance/performance.py @@ -166,15 +166,23 @@ class PerformanceTracker(): self.result_stream = None self.last_dict = None + # this performance period will span the entire simulation. self.cumulative_performance = PerformancePeriod( + # initial positions are empty {}, - self.capital_base, + # initial portfolio positions have zero value + 0, + # initial cash is your capital base. starting_cash = self.capital_base ) - + + # this performance period will span just the current market day self.todays_performance = PerformancePeriod( + # initial positions are empty {}, - self.capital_base, + # initial portfolio positions have zero value + 0, + # initial cash is your capital base. starting_cash = self.capital_base )
fixed bogus initial portfolio value (should be zero).
quantopian_zipline
train
py
1c00f741c2e92002c45cf42b69dee0bc8dd549da
diff --git a/optlang/cplex_interface.py b/optlang/cplex_interface.py index <HASH>..<HASH> 100644 --- a/optlang/cplex_interface.py +++ b/optlang/cplex_interface.py @@ -93,7 +93,7 @@ _CPLEX_STATUS_TO_STATUS = { cplex.Cplex.solution.status.num_best: interface.NUMERIC, cplex.Cplex.solution.status.optimal: interface.OPTIMAL, cplex.Cplex.solution.status.optimal_face_unbounded: interface.SPECIAL, - cplex.Cplex.solution.status.optimal_infeasible: interface.SPECIAL, + cplex.Cplex.solution.status.optimal_infeasible: interface.INFEASIBLE, cplex.Cplex.solution.status.optimal_populated: interface.SPECIAL, cplex.Cplex.solution.status.optimal_populated_tolerance: interface.SPECIAL, cplex.Cplex.solution.status.optimal_relaxed_inf: interface.SPECIAL,
fix: treat "optimal_infeasible" as infeasible “optimal with unscaled infeasibilities” occurs when the scaled problem is solved within tolerance, but the optimal solution is outside the unscaled tolerance. This situation is now interpreted as infeasible.
biosustain_optlang
train
py
22ed8220424b84f371437ee9ab36a993ed4d2b40
diff --git a/omgeo/services/base.py b/omgeo/services/base.py index <HASH>..<HASH> 100644 --- a/omgeo/services/base.py +++ b/omgeo/services/base.py @@ -14,7 +14,8 @@ logger = logging.getLogger(__name__) class UpstreamResponseInfo(): """ Description of API call result from an upstream provider. - For cleaning and consistency, set attributes using the given methods. + For cleaning and consistency, set attributes using the given methods + (the constructor will automatically use these methods, as well). """ def set_response_code(self, response_code): @@ -63,6 +64,9 @@ class UpstreamResponseInfo(): self.set_success(success) self.errors = errors + def __repr__(self): + '%s %s %sms' % (self.geoservice, self.response_code, self.response_time) + class GeocodeService(): """
add repr method to geocoder info class
azavea_python-omgeo
train
py
7b1ade4aa2cc9af778457d2ac6ba857bfe6dd819
diff --git a/packages/angularjs-workorder/lib/workorder-list/workorder-list-controller.js b/packages/angularjs-workorder/lib/workorder-list/workorder-list-controller.js index <HASH>..<HASH> 100644 --- a/packages/angularjs-workorder/lib/workorder-list/workorder-list-controller.js +++ b/packages/angularjs-workorder/lib/workorder-list/workorder-list-controller.js @@ -43,7 +43,8 @@ function WorkorderListController($scope, workorderService, workorderFlowService, if (term.length > 3) { var filter = { - id: term + id: term, + title: term }; $q.resolve(workorderService.search(filter)).then(function(workorders) {
Filter also by title field in workorders in portal (#<I>)
feedhenry-raincatcher_raincatcher-angularjs
train
js
141cd2a6482c00e713cf1279a57edf795f8d62f0
diff --git a/mtools/test/test_mlaunch.py b/mtools/test/test_mlaunch.py index <HASH>..<HASH> 100644 --- a/mtools/test/test_mlaunch.py +++ b/mtools/test/test_mlaunch.py @@ -76,7 +76,7 @@ class TestMLaunch(object): if arg_str.startswith('init') or arg_str.startswith('--'): # add --port and --nojournal to init calls - arg_str += ' --port %i --nojournal' % self.port + arg_str += ' --port %i --nojournal --smallfiles' % self.port if self.use_auth: # add --auth to init calls if flag is set
removed --oplogSize from tests, config servers don't like it.
rueckstiess_mtools
train
py
4fd96c9cf8688adf5e77d8ddcbe767802dea1ffb
diff --git a/test/index.js b/test/index.js index <HASH>..<HASH> 100644 --- a/test/index.js +++ b/test/index.js @@ -1,4 +1,5 @@ var fs = require('fs'); +var jsesc = require('jsesc'); var parse = require('../parser').parse; @@ -32,7 +33,13 @@ parseTests.forEach(function(re, idx) { var resuls = parseResult[idx]; - if (JSON.stringify(par) !== JSON.stringify(resuls)) { + var stringify = function(obj) { + return jsesc(obj, { + json: true, compact: false, indent: ' ' + }); + } + + if (stringify(par) !== stringify(resuls)) { throw new Error('Failure parsing string ' + input + (flags ? '(' + flags + ')' : '') + ':' + JSON.stringify(par) + '\n' + JSON.stringify(resuls)); } else { console.log('PASSED TEST: ' + input);
Need to use jsesc in test/index.js as well
jviereck_regjsparser
train
js
cf47e8e3379f224561244e38f71169651a134498
diff --git a/templates/forms/affiliation.php b/templates/forms/affiliation.php index <HASH>..<HASH> 100644 --- a/templates/forms/affiliation.php +++ b/templates/forms/affiliation.php @@ -221,8 +221,8 @@ <?php endif ?> </div> <div> - <input type="checkbox" name="terms" id="is_agree_check_box"> - <label for="terms">I agree to the <a href="<?php echo $affiliate_program_terms_url ?>" target="_blank" rel="noreferrer noopener">Referrer Program's</a> terms & conditions.</label> + <input type="checkbox" id="is_agree_check_box"> + <label for="is_agree_check_box">I agree to the <a href="<?php echo $affiliate_program_terms_url ?>" target="_blank" rel="noreferrer noopener">Referrer Program's</a> terms & conditions.</label> </div> </form> </div>
[affiliation-confirmation] [bug] [fix] Fixed a bug. The label's `for` attribute is expecting an ID not a name.
Freemius_wordpress-sdk
train
php
15b8b7a8511b41e2afb79e01bddef6938e78d991
diff --git a/airflow/models.py b/airflow/models.py index <HASH>..<HASH> 100755 --- a/airflow/models.py +++ b/airflow/models.py @@ -1700,7 +1700,7 @@ class TaskInstance(Base, LoggingMixin): class VariableAccessor: """ Wrapper around Variable. This way you can get variables in templates by using - {var.variable_name}. + {var.value.your_variable_name}. """ def __init__(self): self.var = None @@ -1713,6 +1713,10 @@ class TaskInstance(Base, LoggingMixin): return str(self.var) class VariableJsonAccessor: + """ + Wrapper around deserialized Variables. This way you can get variables + in templates by using {var.json.your_variable_name}. + """ def __init__(self): self.var = None
[AIRFLOW-<I>] Elaborate on slightly ambiguous documentation Closes #<I> from AetherUnbound/bugfix/var-doc- reference
apache_airflow
train
py
6f06f9737e319f88af873dc6162c6669a3d3b3e9
diff --git a/tests/aws/models/elb/model_tests.rb b/tests/aws/models/elb/model_tests.rb index <HASH>..<HASH> 100644 --- a/tests/aws/models/elb/model_tests.rb +++ b/tests/aws/models/elb/model_tests.rb @@ -110,6 +110,8 @@ Shindo.tests('AWS::ELB | models', ['aws', 'elb']) do end server = Fog::Compute[:aws].servers.create + server.wait_for { ready? } + tests('register instance') do begin elb.register_instances(server.id)
[aws|elb] wait_for server to be ready? before register
fog_fog
train
rb
74981ffb0a194a52d9b5914a7337c7cfd969f1a7
diff --git a/design/dsl/type.go b/design/dsl/type.go index <HASH>..<HASH> 100644 --- a/design/dsl/type.go +++ b/design/dsl/type.go @@ -61,6 +61,10 @@ func Type(name string, dsl func()) *design.UserTypeDefinition { // }) // Payload(ArrayOf(Bottle)) // Equivalent to Payload(Bottles) // }) +// +// If you are looking to return a collection of elements in a Response +// clause, refer to CollectionOf. ArrayOf creates a type, where +// CollectionOf creates a media type. func ArrayOf(t design.DataType) *design.Array { at := design.AttributeDefinition{Type: t} if ds, ok := t.(design.DataStructure); ok {
Added note to refer to CollectionOf, was looking for it.. and it's quite similar in concept to ArrayOf.
goadesign_goa
train
go
0c35672c93ef9c11d0614fa7b5b4e83e51c695b9
diff --git a/Security/OAuth/Exception/BadResponseException.php b/Security/OAuth/Exception/BadResponseException.php index <HASH>..<HASH> 100644 --- a/Security/OAuth/Exception/BadResponseException.php +++ b/Security/OAuth/Exception/BadResponseException.php @@ -31,7 +31,7 @@ class BadResponseException extends \LogicException $this->needClass = $needClass; $this->getClass = is_object($object) ? get_class($object) : 'not object'; - if ($needClass == null) { + if (empty($needClass)) { $this->needClass = DarvinAuthResponse::DARVIN_AUTH_RESPONSE_CLASS; }
Enhance bad response exception CS.
DarvinStudio_DarvinAdminBundle
train
php
970261565d6205debfb09a12c1060769d6be87e1
diff --git a/olctools/databasesetup/get_rmlst.py b/olctools/databasesetup/get_rmlst.py index <HASH>..<HASH> 100644 --- a/olctools/databasesetup/get_rmlst.py +++ b/olctools/databasesetup/get_rmlst.py @@ -51,7 +51,10 @@ class Get(object): # Remove and dashes or 'N's from the sequence data - makeblastdb can't handle sequences # with gaps # noinspection PyProtectedMember - record.seq._data = record.seq._data.replace('-', '').replace('N', '') + try: + record.seq._data = record.seq._data.replace('-', '').replace('N', '') + except TypeError: + record.seq._data = record.seq._data.replace(b'-', b'').replace(b'N', b'') # Clear the name and description attributes of the record record.name = '' record.description = ''
Added try/except if the sequence data is bytes-encoded
lowandrew_OLCTools
train
py
48d6ddde5a1ed7c13c5860f386e277c0091b889b
diff --git a/src/local/local.go b/src/local/local.go index <HASH>..<HASH> 100644 --- a/src/local/local.go +++ b/src/local/local.go @@ -1,11 +1,10 @@ package main import ( - "shadowsocks" - "net" - "bytes" - "log" "fmt" + "log" + "net" + "shadowsocks" ) func handleConnection(conn net.Conn, encryptTable, decryptTable []byte, server string) { @@ -39,9 +38,8 @@ func handleConnection(conn net.Conn, encryptTable, decryptTable []byte, server s addrToSend = buf[3:10] } else if addrType == 3 { addrLen := buf[4] - sb := bytes.NewBuffer(buf[5:5 + addrLen]) - addr = sb.String() - addrToSend = buf[3:5 + addrLen + 2] + addr = string(buf[5 : 5+addrLen]) + addrToSend = buf[3 : 5+addrLen+2] } else { hasError = true log.Println("unsurpported addr type")
Convert []byte to string directly.
shadowsocks_shadowsocks-go
train
go
33ef94deec43002b6cadb97b9f67057af074605c
diff --git a/test/unit/transforms/transformsFactory.test.js b/test/unit/transforms/transformsFactory.test.js index <HASH>..<HASH> 100644 --- a/test/unit/transforms/transformsFactory.test.js +++ b/test/unit/transforms/transformsFactory.test.js @@ -44,7 +44,6 @@ describe('transformsFactory', () => { test('createTransform should return CustomTransform', async () => { transformsFactory.addTransform('newType', (value) => { - console.log('payload', value); return (value || '').toUpperCase(); }); const transform = transformsFactory.createTransform({
- removed console :goose:
redco_goose-parser
train
js
53ac847e9ae01a4347c685e49145fc191113d784
diff --git a/Kwc/Form/Component.js b/Kwc/Form/Component.js index <HASH>..<HASH> 100644 --- a/Kwc/Form/Component.js +++ b/Kwc/Form/Component.js @@ -209,7 +209,6 @@ Ext.extend(Kwc.Form.Component, Ext.util.Observable, { if (!hasErrors) { // Scroll to top of form scrollTo = this.el.getY(); - this.fireEvent('submitSuccess', this, r); } else { // Get position of first error field for(var fieldName in r.errorFields) {
Form: don't fire submitSuccess event twice
koala-framework_koala-framework
train
js
9caef163de18300103b6a5a94c27670b2d233685
diff --git a/validator/sawtooth_validator/database/lmdb_nolock_database.py b/validator/sawtooth_validator/database/lmdb_nolock_database.py index <HASH>..<HASH> 100644 --- a/validator/sawtooth_validator/database/lmdb_nolock_database.py +++ b/validator/sawtooth_validator/database/lmdb_nolock_database.py @@ -50,6 +50,7 @@ class LMDBNoLockDatabase(database.Database): map_size=1024**4, map_async=True, writemap=True, + readahead=False, subdir=False, create=create, lock=True)
Disable LMDB read ahead caching for LMDBNoLockDatabase
hyperledger_sawtooth-core
train
py