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
8227163971c29bda19d6d81c6ef1b75236b30857
diff --git a/src/Carbon/Traits/Units.php b/src/Carbon/Traits/Units.php index <HASH>..<HASH> 100644 --- a/src/Carbon/Traits/Units.php +++ b/src/Carbon/Traits/Units.php @@ -210,6 +210,14 @@ trait Units } if ($unit instanceof DateInterval) { + // Can be removed if https://bugs.php.net/bug.php?id=81106 + // is fixed + if (version_compare(PHP_VERSION, '8.1.0-dev', '>=') && ($unit->f < 0 || $unit->f >= 1)) { + $seconds = floor($unit->f); + $unit->f -= $seconds; + $unit->s += $seconds; + } + return parent::add($unit); }
Work around PHP bug <I>
briannesbitt_Carbon
train
php
b18ff1577c173cf5b50de943fd5f1f4e400c5428
diff --git a/tests/SchemaTest.php b/tests/SchemaTest.php index <HASH>..<HASH> 100644 --- a/tests/SchemaTest.php +++ b/tests/SchemaTest.php @@ -122,7 +122,8 @@ JSON; return [ [ SchemaLoadException::class, - 'error loading descriptor from source "--invalid--": file_get_contents(--invalid--): Failed to open stream: No such file or directory', + // Complete error message is trimmed because different PHP versions produce slightly different messages. + 'error loading descriptor from source "--invalid--": file_get_contents(--invalid--): ', '--invalid--', ], [
Correct test for allow differences in error message case between PHP versions.
frictionlessdata_tableschema-php
train
php
9b6c910c61511c8efc48da319d5609f4ee28a499
diff --git a/src/Mpdf.php b/src/Mpdf.php index <HASH>..<HASH> 100644 --- a/src/Mpdf.php +++ b/src/Mpdf.php @@ -54,7 +54,7 @@ use Psr\Log\NullLogger; class Mpdf implements \Psr\Log\LoggerAwareInterface { - const VERSION = '7.0.0'; + const VERSION = '7.0.2'; const SCALE = 72 / 25.4;
Correct version constant <I> for next release
mpdf_mpdf
train
php
7995a4184dd797561f50b5dbcbda956d410909cd
diff --git a/astromodels/core/parameter_transformation.py b/astromodels/core/parameter_transformation.py index <HASH>..<HASH> 100644 --- a/astromodels/core/parameter_transformation.py +++ b/astromodels/core/parameter_transformation.py @@ -1,4 +1,6 @@ +import math from builtins import object + import numpy as np @@ -32,13 +34,15 @@ class LogarithmicTransformation(ParameterTransformation): with np.errstate(invalid='raise'): - res = np.log10(external_value) + # math is 4 times faster than numpy here + res = math.log10(external_value) return res def backward(self, internal_value): - return 10**internal_value + # math is 10x faster than numpy or numba + return math.pow(10., internal_value) _known_transformations = {'log10': LogarithmicTransformation}
switch to the math library for some speed
threeML_astromodels
train
py
5798eab1240734e5d04a85acd628d007f4c93765
diff --git a/src/event.js b/src/event.js index <HASH>..<HASH> 100644 --- a/src/event.js +++ b/src/event.js @@ -101,7 +101,7 @@ jQuery.event = { handler: handler, guid: handler.guid, selector: selector, - quick: quickParse( selector ), + quick: selector && quickParse( selector ), namespace: namespaces.join(".") }, handleObjIn );
Fix #<I>. XRegExp's shimmed .exec() can't handle undefined. There's no reason to call quickParse if selector is falsy, so it's a minor performance optimization anyway. No change in behavior at all on our side, so no test case needed.
jquery_jquery
train
js
ca82397e9aef897420df87a8654d9010527df7a6
diff --git a/Kwf/Controller/Action/Cli/Web/ClearCacheWatcherController.php b/Kwf/Controller/Action/Cli/Web/ClearCacheWatcherController.php index <HASH>..<HASH> 100644 --- a/Kwf/Controller/Action/Cli/Web/ClearCacheWatcherController.php +++ b/Kwf/Controller/Action/Cli/Web/ClearCacheWatcherController.php @@ -574,7 +574,7 @@ class Kwf_Controller_Action_Cli_Web_ClearCacheWatcherController extends Kwf_Cont $model = Kwf_Component_Cache::getInstance()->getModel(); $cacheIds = array(); foreach ($model->export(Kwf_Model_Abstract::FORMAT_ARRAY, $s) as $row) { - $cacheIds[] = Kwf_Component_Cache_Mysql::getCacheId($row['component_id'], $row['type'], $row['value']); + $cacheIds[] = Kwf_Component_Cache_Mysql::getCacheId($row['component_id'], $row['renderer'], $row['type'], $row['value']); } Kwf_Util_Apc::callClearCacheByCli(array( 'deleteCacheSimple' => $cacheIds
use renderer (new in master)
koala-framework_koala-framework
train
php
774d1d24292786d11aa4c39b838b22ef94bfaf46
diff --git a/lib/phpunit/tests/basic_test.php b/lib/phpunit/tests/basic_test.php index <HASH>..<HASH> 100644 --- a/lib/phpunit/tests/basic_test.php +++ b/lib/phpunit/tests/basic_test.php @@ -123,6 +123,19 @@ class core_phpunit_basic_testcase extends basic_testcase { } /** + * Make sure there are no sloppy Windows line endings + * that would break our tests. + */ + public function test_lineendings() { + $string = <<<STRING +a +b +STRING; + $this->assertSame("a\nb", $string, 'Make sure all project files are checked out with unix line endings.'); + + } + + /** * Make sure asserts in setUp() do not create problems. */ public function test_setup_assert() {
MDL-<I> make sure there are no windows line endings in test files
moodle_moodle
train
php
ecb2330141f33d5892053b8c702aa2ab1bb9e00c
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 @@ -338,6 +338,8 @@ module Discordrb @server.owner == self end + # Adds one or more roles to this member. + # @param role [Role, Array<Role>] The role(s) to add. def add_role(role) # Get the list of role IDs to add to role_ids = if role.is_a? Array
Add a doc comment to Member#add_role
meew0_discordrb
train
rb
f393eda9008e5dac072f151e622d99d4591e79fa
diff --git a/addon/fold/foldcode.js b/addon/fold/foldcode.js index <HASH>..<HASH> 100644 --- a/addon/fold/foldcode.js +++ b/addon/fold/foldcode.js @@ -111,7 +111,7 @@ CodeMirror.braceRangeFinder = function(cm, start) { for (;;) { var found = lineText.lastIndexOf("{", at); if (found < start.ch) break; - tokenType = cm.getTokenAt({line: line, ch: found}).type; + tokenType = cm.getTokenAt({line: line, ch: found + 1}).type; if (!/^(comment|string)/.test(tokenType)) { startChar = found; break; } at = found - 1; }
[foldcode addon] Fix off-by-one error when determining brace type in braceRangeFinder Closes #<I>
codemirror_CodeMirror
train
js
e76ffa37fdcb22553f7b6284a961f556218e188f
diff --git a/ella/newman/media/js/newman.js b/ella/newman/media/js/newman.js index <HASH>..<HASH> 100644 --- a/ella/newman/media/js/newman.js +++ b/ella/newman/media/js/newman.js @@ -732,10 +732,14 @@ function request_media(url) { } $('a#save-form').live('click', function() { var title = prompt(_('Enter template name')); + if (title == null) return; title = $.trim(title); // retrieve the id of template with this name // TODO: to be rewritten (saving interface needs a lift) - var id = $('#id_drafts option').filter(function(){return $(this).text().indexOf(title+' (') == 0}).val(); + var id = + title + ? $('#id_drafts option').filter(function(){return $(this).text().indexOf(title+' (') == 0}).val() + : draft_id; save_preset($('.change-form'), {title:title, id:id}); return false; });
Saving a template with empty name now saves to draft.
ella_ella
train
js
28c7871e2f710f4bb92186a234441818341a68d2
diff --git a/dist/crud.js b/dist/crud.js index <HASH>..<HASH> 100644 --- a/dist/crud.js +++ b/dist/crud.js @@ -53,7 +53,8 @@ define([], function() { crud.prototype.read = crud.prototype.r = function() { var self = this, args = tools.xhr_args.apply(this, arguments), - url = config.protocol + tools.join(config.base, this.path); + url = config.protocol + + tools.join(config.base, this.path, args.data || '' ); if (args.data) url = tools.join(url, args.data);
Fix but with read query and different protocol
uhray_crud
train
js
f62c4b3d654d429624ce81fe24f12cd02f407e97
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -93,10 +93,11 @@ var Credential = function (userId, registrarVK) { if (!(this instanceof Credential)) return new Credential(userId, registrarVK) if (!userId) throw new Error('missing parameters') - userId = uId(userId) - if (userId.length > 31) throw new Error('invalid userId: ' + userId) if ((typeof userId === 'string') && (typeof registrarVK === 'string')) { + userId = uId(userId) + if (userId.length > 31) throw new Error('invalid userId: ' + userId) + this.parameters = { userId: userId, registrarVK: registrarVK } return }
put the userId evaluation in the correct spot
brave_node-anonize2-relic
train
js
3407404f9b3a307319353f3f2038e6038feb6343
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -11,10 +11,14 @@ setup( url='https://github.com/uber-common/opentracing-python-instrumentation', keywords=['opentracing'], classifiers=[ - 'Development Status :: 3 - Alpha', + 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Software Development :: Libraries :: Python Modules', ], @@ -24,11 +28,10 @@ setup( platforms='any', install_requires=[ 'future', - 'futures;python_version<"3"', 'wrapt', - 'tornado>=4.1', + 'tornado>=4.1,<5', 'contextlib2', - 'opentracing>=1.1,<1.3', + 'opentracing>=1.1,<2', 'six', ], extras_require={
Remove concurrent.futures dependency (#<I>)
uber-common_opentracing-python-instrumentation
train
py
f61445c6ed94edd8d19d43a06909c58e7fa1452e
diff --git a/client/task_runner_test.go b/client/task_runner_test.go index <HASH>..<HASH> 100644 --- a/client/task_runner_test.go +++ b/client/task_runner_test.go @@ -45,9 +45,17 @@ func testTaskRunner() (*MockTaskStateUpdater, *TaskRunner) { return upd, tr } +func testTaskRunnerPostOffer(*MockTaskStateUpdater, *TaskRunner) { + state, runner := testTaskRunner() + // testTaskRunner gives us a job in pre-offer state. We need it in post- + // offer state some some other things are initialized. We'll init them here. + runner.task.Resources.Networks[0].ReservedPorts[0] = 80 + return state, runner +} + func TestTaskRunner_SimpleRun(t *testing.T) { ctestutil.ExecCompatible(t) - upd, tr := testTaskRunner() + upd, tr := testTaskRunnerPostOffer() go tr.Run() defer tr.Destroy()
Initialize reserved ports in task_runner
hashicorp_nomad
train
go
62d0decf1de5509ecabebfbf32067a5825742bda
diff --git a/tfjs-node/scripts/install.js b/tfjs-node/scripts/install.js index <HASH>..<HASH> 100644 --- a/tfjs-node/scripts/install.js +++ b/tfjs-node/scripts/install.js @@ -42,8 +42,9 @@ const mkdir = util.promisify(fs.mkdir); const rename = util.promisify(fs.rename); const rimrafPromise = util.promisify(rimraf); -const BASE_URI = - 'https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-'; +const CDN_STORAGE = process.env.CDN_STORAGE; +const BASE_HOST = CDN_STORAGE || 'https://storage.googleapis.com/'; +const BASE_URI = `${BASE_HOST}tensorflow/libtensorflow/libtensorflow-`; const platform = os.platform(); // Use windows path @@ -92,7 +93,7 @@ function getPlatformLibtensorflowUri() { } if (platform === 'linux' && os.arch() === 'arm') { - return 'https://storage.googleapis.com/tf-builds/libtensorflow_r1_14_linux_arm.tar.gz'; + return `${BASE_HOST}tf-builds/libtensorflow_r1_14_linux_arm.tar.gz`; } if (ALL_SUPPORTED_COMBINATION.indexOf(system) === -1) {
[tfjs-node]Support cnpm registry (#<I>) * support taobao registry * completion path * set an env variable instead
tensorflow_tfjs
train
js
21db6da15048343034e8e20e4ddd3f46c9cbba8e
diff --git a/course/lib.php b/course/lib.php index <HASH>..<HASH> 100644 --- a/course/lib.php +++ b/course/lib.php @@ -3242,7 +3242,7 @@ function make_editing_buttons(stdClass $mod, $absolute = true, $moveselect = tru } // Assign - if (has_capability('moodle/course:managegroups', $modcontext)){ + if (has_capability('moodle/role:assign', $modcontext)){ $actions[] = new action_link( new moodle_url('/'.$CFG->admin.'/roles/assign.php', array('contextid' => $modcontext->id)), new pix_icon('i/roles', $str->assign, 'moodle', array('class' => 'iconsmall')),
MDL-<I> fix incorrect capability for role assign button Credit goes to Alexander Bias.
moodle_moodle
train
php
18b801eb82410c86f9cd3e1f830a3d44541f914b
diff --git a/core/src/main/java/org/gagravarr/speex/SpeexInfo.java b/core/src/main/java/org/gagravarr/speex/SpeexInfo.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/gagravarr/speex/SpeexInfo.java +++ b/core/src/main/java/org/gagravarr/speex/SpeexInfo.java @@ -40,7 +40,7 @@ public class SpeexInfo extends HighLevelOggStreamPacket implements SpeexPacket, public SpeexInfo() { super(); - versionString = "Gagravarr Ogg v0.7"; + versionString = "Gagravarr Ogg v0.8"; versionId = 1; } diff --git a/core/src/main/java/org/gagravarr/vorbis/VorbisStyleComments.java b/core/src/main/java/org/gagravarr/vorbis/VorbisStyleComments.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/gagravarr/vorbis/VorbisStyleComments.java +++ b/core/src/main/java/org/gagravarr/vorbis/VorbisStyleComments.java @@ -80,7 +80,7 @@ public abstract class VorbisStyleComments extends HighLevelOggStreamPacket imple public VorbisStyleComments() { super(); - vendor = "Gagravarr.org Java Vorbis Tools v0.7 20141221"; + vendor = "Gagravarr.org Java Vorbis Tools v0.8 20160217"; } public String getVendor() {
Update version strings for <I>
Gagravarr_VorbisJava
train
java,java
507931d63e79b4b412fe9a69213194473c341460
diff --git a/rest_framework_fine_permissions/utils.py b/rest_framework_fine_permissions/utils.py index <HASH>..<HASH> 100644 --- a/rest_framework_fine_permissions/utils.py +++ b/rest_framework_fine_permissions/utils.py @@ -23,7 +23,7 @@ def inherits_modelpermissions_serializer(cls): def get_model_fields(model): fields_info = get_field_info(model) - return chain(iterkeys(fields_info.fields_and_pk), + return chain(iterkeys(fields_info.fields), iterkeys(fields_info.relations))
bug correction: replace fields_and_pk by fields
unistra_django-rest-framework-fine-permissions
train
py
80affbb69e2b1878d181fe921aad18c181361d40
diff --git a/db/seeds.rb b/db/seeds.rb index <HASH>..<HASH> 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -71,7 +71,7 @@ Role.allow 'admin_role', [:read], "packages" Role.allow 'admin_role', [:read], "errata" Role.allow 'admin_role', [:create, :delete, :read], "search" Role.allow 'admin_role', [:read], "operations" -Role.allow 'admin_role', [:create, :delete, :read], "repositories" +Role.allow 'admin_role', [:create, :read, :update, :delete], "repositories" Role.allow 'admin_role', [:read, :apply], "sync_schedules" #These are candlepin proxy actions
adding update for repositories back to seeds.rb
Katello_katello
train
rb
220e732265c5aa025df1e2406515d7b3e7e0f31e
diff --git a/sample/ipn.php b/sample/ipn.php index <HASH>..<HASH> 100644 --- a/sample/ipn.php +++ b/sample/ipn.php @@ -7,11 +7,11 @@ $isValidIPN = $yellow->verifyIPN(); //bool $log_file = "ipn.log"; $payload = file_get_contents("php://"); if($isValidIPN){ - file_put_contents($log_file , $payload . "is valid IPN call " , FILE_APPEND); + file_put_contents($log_file , $payload . "is valid IPN call\n " , FILE_APPEND); /// you can update your order , log to db , send email etc header("HTTP/1.0 200 OK"); }else{ - file_put_contents($log_file , $payload . "is invalid IPN call " , FILE_APPEND); + file_put_contents($log_file , $payload . "is invalid IPN call\n " , FILE_APPEND); /// invalid/ fake IPN , no need to do anything header("HTTP/1.1 403 Unauthorized"); } \ No newline at end of file
update invoice class + create sample show case
YellowPay_yellow-sdk-php
train
php
706537177eee29c494af645c4fe1d63a20bdbf1d
diff --git a/dump.js b/dump.js index <HASH>..<HASH> 100644 --- a/dump.js +++ b/dump.js @@ -242,6 +242,13 @@ function store(path, info, state) { if (info.object) { var objFile; if (info.object.originNode) { + if (!info.object.originNode.sourceFile) { + // Sometimes a node doesn't have a sourceFile property but one of its + // child nodes does. In that case, get sourceFile from the child node. + // TODO(sqs): why does this occur? + var childNode = info.object.originNode.property || info.object.originNode.argument || info.object.originNode.left; + info.object.originNode.sourceFile = childNode.sourceFile; + } objFile = info.object.originNode.sourceFile.name; } out.objectDef = {file: objFile};
Get sourceFile from child node if missing on parent node
sourcegraph_jsg
train
js
dc538d38d146dae793041b518820ef0d11d59658
diff --git a/lib/parser.js b/lib/parser.js index <HASH>..<HASH> 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -49,7 +49,7 @@ var Parser = function (options) { } self.feed = function(b, blen, cb) { - feed(b, blen, feed_progress, cb) + return feed(b, blen, feed_progress, cb) } } diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -207,13 +207,11 @@ describe('dvbtee-parser', function() { describe('#feed()', function() { -/* it('should return an error when called without args', function() { var parser = new dvbtee.Parser() assert.equal(-1, parser.feed()) }) -*/ /* it('should return undefined when called asynchronously (with a callback function as the last argument)', function() {
feed() 'should return an error when called without args' This reverts commit dcdffa<I>d5d<I>fadce<I>ce4d<I>e<I>fbd.
mkrufky_node-dvbtee
train
js,js
7c119650cb585eafa657c200112f6edb79daba99
diff --git a/lib/hccrawler.js b/lib/hccrawler.js index <HASH>..<HASH> 100644 --- a/lib/hccrawler.js +++ b/lib/hccrawler.js @@ -301,16 +301,12 @@ class HCCrawler extends EventEmitter { async _skipRequest(options) { const allowedDomain = this._checkAllowedDomains(options); if (!allowedDomain) return true; - const [ - requested, - allowedRobot, - shouldRequest, - ] = await Promise.all([ - this._checkRequested(options), - this._checkAllowedRobots(options), - this._shouldRequest(options), - ]); - if (requested || !allowedRobot || !shouldRequest) return true; + const requested = await this._checkRequested(options); + if (requested) return true; + const shouldRequest = await this._shouldRequest(options); + if (!shouldRequest) return true; + const allowedRobot = await this._checkAllowedRobots(options); + if (!allowedRobot) return true; return false; }
chore(hccrawler): serialize check request process
yujiosaka_headless-chrome-crawler
train
js
ade4223dd49dd66a0945c1fed6e42fed9916dae6
diff --git a/lib/alchemy/upgrader/tasks/add_page_versions.rb b/lib/alchemy/upgrader/tasks/add_page_versions.rb index <HASH>..<HASH> 100644 --- a/lib/alchemy/upgrader/tasks/add_page_versions.rb +++ b/lib/alchemy/upgrader/tasks/add_page_versions.rb @@ -12,12 +12,22 @@ module Alchemy::Upgrader::Tasks Alchemy::Page.find_each do |page| next if page.versions.any? - version = page.versions.create! - version = page.versions.create!( - public_on: page.public_on, - public_until: page.public_until - ) if page.public? - page.elements.update_all(page_version_id: version.id) + Alchemy::Page.transaction do + page.versions.create!.tap do |version| + Alchemy::Element.where(page_id: page.id).update_all(page_version_id: version.id) + end + + if page.public_on? + page.versions.create!( + public_on: page.public_on, + public_until: page.public_until + ).tap do |version| + Alchemy::Element.where(page_id: page.id).not_nested.available.order(:position).find_each do |element| + Alchemy::Element.copy(element, page_version_id: version.id) + end + end + end + end print "." end
Update page version upgrader Create a public version as well and copy the public elements over.
AlchemyCMS_alchemy_cms
train
rb
8a9a325cc28ae9232418d94d71e469f9917a7abf
diff --git a/gpiozero/internal_devices.py b/gpiozero/internal_devices.py index <HASH>..<HASH> 100644 --- a/gpiozero/internal_devices.py +++ b/gpiozero/internal_devices.py @@ -417,7 +417,7 @@ class TimeOfDay(InternalDevice): Returns :data:`1` when the system clock reads between :attr:`start_time` and :attr:`end_time`, and :data:`0` otherwise. If :attr:`start_time` is greater than :attr:`end_time` (indicating a period that crosses - midnight), then this returns :data:`True` when the current time is + midnight), then this returns :data:`1` when the current time is greater than :attr:`start_time` or less than :attr:`end_time`. """ now = datetime.utcnow().time() if self.utc else datetime.now().time()
Correct docs (missed in the fix for #<I>)
RPi-Distro_python-gpiozero
train
py
2216614434a1f56cb77632b0e7740dc86991852e
diff --git a/src/main/java/org/mariadb/jdbc/internal/failover/impl/AuroraListener.java b/src/main/java/org/mariadb/jdbc/internal/failover/impl/AuroraListener.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/mariadb/jdbc/internal/failover/impl/AuroraListener.java +++ b/src/main/java/org/mariadb/jdbc/internal/failover/impl/AuroraListener.java @@ -191,7 +191,7 @@ public class AuroraListener extends MastersSlavesListener { //eat exception because cannot happen in this getString() } catch (QueryException qe) { if (proxy.hasToHandleFailover(qe) && setSecondaryHostFail()) { - addToBlacklist(currentProtocol.getHostAddress()); + addToBlacklist(secondaryProtocol.getHostAddress()); } } }
[CONJ-<I>] possible NPE on aurora when failover occur during connection initialisation
MariaDB_mariadb-connector-j
train
java
447f1da3adbb36dc060acd43cfdfc6ac4242e608
diff --git a/scripts/postinstall.js b/scripts/postinstall.js index <HASH>..<HASH> 100644 --- a/scripts/postinstall.js +++ b/scripts/postinstall.js @@ -14,4 +14,10 @@ var dependencies = [ var root = __dirname + '/..'; -exec('cd ' + root + '; npm install'); +exec('cd ' + root + '; npm install', function(err, stdout, stderr) { + console.log('POSTINSTALL: ' + stdout); + console.log('POSTINSTALL stderr: ' + stderr); + if (error !== null) { + console.error('POSTINSTALL error: ' + error); + } +});
logging output in postinstall.js
rendrjs_rendr
train
js
99dbe951ee48545464d7d7e6ca269b1dd95276ff
diff --git a/kraken-biom.py b/kraken-biom.py index <HASH>..<HASH> 100755 --- a/kraken-biom.py +++ b/kraken-biom.py @@ -292,6 +292,10 @@ def _main(): Defaulting to BIOM 1.0 (JSON).""" print(twdd(msg)) + if ranks.index(args.max) >= ranks.index(args.min): + msg = "ERROR: Max and Min ranks are out of order: {} < {}" + sys.exit(msg.format(args.max, args.min)) + # Parse all kraken-report data files into sample counts dict # and store global taxon id -> taxonomy data taxa = OrderedDict()
Ensures the max and min tax levels are ordered correctly.
smdabdoub_kraken-biom
train
py
ea35d6b8d33b69d621c12dd4a4b12a11a99563e9
diff --git a/src/Components/Prometheus/Collectors/HttpRequestCollector.php b/src/Components/Prometheus/Collectors/HttpRequestCollector.php index <HASH>..<HASH> 100644 --- a/src/Components/Prometheus/Collectors/HttpRequestCollector.php +++ b/src/Components/Prometheus/Collectors/HttpRequestCollector.php @@ -89,18 +89,7 @@ class HttpRequestCollector extends MetricCollector $route = $request->route(); if ($route instanceof \Illuminate\Routing\Route) { // Laravel - $action = $route->getAction(); - if (is_string($action['uses'])) { // Uses - $key = $method . $action['uses']; - if (isset($this->routesByUses[$key])) { - $uri = $this->routesByUses[$key]; - } - } elseif ($action['uses'] instanceof Closure) { // Closure - $key = $method . spl_object_hash($action['uses']); - if (isset($this->routesByClosure[$key])) { - $uri = $this->routesByClosure[$key]; - } - } + $uri = $route->uri(); } elseif (is_array($route)) { // Lumen if (isset($route[1]['uses'])) { $key = $method . $route[1]['uses'];
support routing with parameters for prometheus
hhxsv5_laravel-s
train
php
5d688f94a8c4906fdae2d6c66e6f1ec9f401ad89
diff --git a/examples/blog/server.js b/examples/blog/server.js index <HASH>..<HASH> 100644 --- a/examples/blog/server.js +++ b/examples/blog/server.js @@ -5,7 +5,7 @@ var server = express(); var blog = new Paperpress({ directory : 'static', - themePath : '/examples/blog/static/layouts', + themePath : 'static/layouts', basePath : '/blog', pagesPath : '', articlesPerPage : 5 diff --git a/paperpress.js b/paperpress.js index <HASH>..<HASH> 100644 --- a/paperpress.js +++ b/paperpress.js @@ -26,7 +26,7 @@ var Paperpress = function (config) { swig.setDefaults({ cache: false }); - var themePath = path.join(__dirname, this.themePath); + var themePath = path.join(process.cwd(), this.themePath); this.pageTpl = swig.compileFile(themePath + '/page.html'); this.singleTpl = swig.compileFile(themePath + '/single.html');
Made theme path relative to the process path, not the paperpress.js file
Siedrix_paperpress
train
js,js
2554a81b500d76a996d89100a73184ffeaa511a5
diff --git a/servers/src/main/java/tachyon/worker/block/meta/BlockMeta.java b/servers/src/main/java/tachyon/worker/block/meta/BlockMeta.java index <HASH>..<HASH> 100644 --- a/servers/src/main/java/tachyon/worker/block/meta/BlockMeta.java +++ b/servers/src/main/java/tachyon/worker/block/meta/BlockMeta.java @@ -17,20 +17,17 @@ package tachyon.worker.block.meta; import tachyon.util.CommonUtils; +import java.io.File; + /** * Represents the metadata of a block in Tachyon managed storage. */ public class BlockMeta extends BlockMetaBase { private final long mBlockSize; - public BlockMeta(long blockId, long blockSize, StorageDir dir) { - super(blockId, dir); - mBlockSize = blockSize; - } - public BlockMeta(TempBlockMeta tempBlock) { super(tempBlock.getBlockId(), tempBlock.getParentDir()); - mBlockSize = tempBlock.getBlockSize(); + mBlockSize = new File(tempBlock.getCommitPath()).length(); } @Override
Make BlockMeta#size really measured from actual file length
Alluxio_alluxio
train
java
708d05b14bc40cecc3e21c35cd696f7770cca2d1
diff --git a/src/services/SitemapService.php b/src/services/SitemapService.php index <HASH>..<HASH> 100644 --- a/src/services/SitemapService.php +++ b/src/services/SitemapService.php @@ -6,6 +6,7 @@ use craft\base\Component; use craft\models\CategoryGroup; use craft\models\Section; use ether\seo\records\SitemapRecord; +use yii\db\Exception; class SitemapService extends Component { @@ -39,7 +40,6 @@ class SitemapService extends Component $newSitemap = $data; // Delete removed rows - // FIXME: Deleting doesn't work :( // --------------------------------------------------------------------- $newById = []; $oldById = []; @@ -78,10 +78,19 @@ class SitemapService extends Component if (!empty($idsToDelete)) { - \Craft::$app->db->createCommand()->delete( - SitemapRecord::$tableName, - ['in', 'id', $idsToDelete] - ); + try { + \Craft::$app->db->createCommand()->delete( + SitemapRecord::$tableName, + ['in', 'id', $idsToDelete] + )->execute(); + } catch (Exception $e) { + \Craft::$app->log->logger->log( + $e->getMessage(), + LOG_ERR, + 'seo' + ); + return false; + } } // Update current rows
Fixed sitemap rows not being deletable
ethercreative_seo
train
php
c01bfa77dfdac991bcc99d663eafc925a5a4ac3d
diff --git a/OpenPNM/Graphics.py b/OpenPNM/Graphics.py index <HASH>..<HASH> 100644 --- a/OpenPNM/Graphics.py +++ b/OpenPNM/Graphics.py @@ -1,5 +1,7 @@ +import numpy as np +import vtk + def preview(pn, values=[]): - import vtk coords = pn.get_pore_data(prop='coords') heads, tails = pn.get_throat_data(prop='connections').T @@ -17,6 +19,10 @@ def preview(pn, values=[]): colors = vtk.vtkUnsignedCharArray() colors.SetNumberOfComponents(3) + if any(values): + values = np.array(values) + values -= values.min() + values = np.true_divide(values, values.max()) for v in values: r = 255*(v) g = 0 @@ -28,7 +34,7 @@ def preview(pn, values=[]): polydata.SetLines(polys) if colors.GetNumberOfTuples() == len(coords): polydata.GetPointData().SetScalars(colors) - else: + elif colors.GetNumberOfTuples() != 0: raise Exception("Mismatch: {} points, {} scalars".format( len(coords), colors.GetNumberOfTuples()))
True divide in array normalization. Integer inputs were getting zeroed out. Former-commit-id: dc3c<I>ef0c6c<I>ba<I>d5ea7be3a<I>b<I>c<I> Former-commit-id: bfb<I>edc<I>c<I>b<I>a<I>a7d<I>f<I>
PMEAL_OpenPNM
train
py
a0c4e97eae485a3f0312ea120484a878ee9dcbab
diff --git a/src/main/lombok/com/restfb/types/Page.java b/src/main/lombok/com/restfb/types/Page.java index <HASH>..<HASH> 100644 --- a/src/main/lombok/com/restfb/types/Page.java +++ b/src/main/lombok/com/restfb/types/Page.java @@ -1274,6 +1274,14 @@ public class Page extends CategorizedFacebookType { private IgUser instagramBusinessAccount; /** + * Linked Instagram accounts for this Page + */ + @Getter + @Setter + @Facebook("instagram_accounts") + private List<InstagramUser> instagramAccounts; + + /** * Indicates the current Instant Articles review status for this page * * @return Indicates the current Instant Articles review status for this page
NoIssue: instagram_accounts added to Page
restfb_restfb
train
java
e47c5a52e8346238fe6b61c33103252351a2d4a5
diff --git a/go/vt/vttablet/tabletserver/tabletserver_test.go b/go/vt/vttablet/tabletserver/tabletserver_test.go index <HASH>..<HASH> 100644 --- a/go/vt/vttablet/tabletserver/tabletserver_test.go +++ b/go/vt/vttablet/tabletserver/tabletserver_test.go @@ -2261,6 +2261,15 @@ func TestDatabaseNameReplaceByKeyspaceName(t *testing.T) { } err = tsv.Release(ctx, &target, 0, rID) require.NoError(t, err) + + // Test for ReserveBeginExecute + res, transactionID, reservedID, _, err := tsv.ReserveBeginExecute(ctx, &target, nil, executeSQL, nil, &querypb.ExecuteOptions{IncludedFields: querypb.ExecuteOptions_ALL}) + require.NoError(t, err) + for _, field := range res.Fields { + require.Equal(t, "keyspaceName", field.Database) + } + err = tsv.Release(ctx, &target, transactionID, reservedID) + require.NoError(t, err) } func setupTabletServerTest(t *testing.T, keyspaceName string) (*fakesqldb.DB, *TabletServer) {
Added Test for ReserveBeginExecute Method
vitessio_vitess
train
go
9b5e7ec8f9e759f5b34a486d14399a6ea7694db0
diff --git a/lib/strategy.js b/lib/strategy.js index <HASH>..<HASH> 100644 --- a/lib/strategy.js +++ b/lib/strategy.js @@ -20,6 +20,8 @@ function RelayrStrategy(options, verifyCallback) { OAuth2Strategy.call(this, options, verifyCallback); this.name = 'relayr'; this._profileURL = options.profileURL || 'https://api.relayr.io/oauth2/user-info'; + this._appURL = options.appURL || 'https://api.relayr.io/oauth2/app-info'; + this._infocall = options.fetch || 'user'; this._oauth2.useAuthorizationHeaderforGET(true); } @@ -28,7 +30,7 @@ util.inherits(RelayrStrategy, OAuth2Strategy); /** Fetch Relayr user profile. */ RelayrStrategy.prototype.userProfile = function(accessToken, done) { - var url = uri.parse(this._profileURL); + var url = uri.parse(this._infocall === 'user' ? this._profileURL : this._appURL); url = uri.format(url);
Get app information with the first info call
ianusmagnus_passport-relayr
train
js
dbf7084eff4777f2ab1c54bbbffc7fb9238d1f4e
diff --git a/src/Ciscaja/Uhsa/UserBundle/Model/RoleInterface.php b/src/Ciscaja/Uhsa/UserBundle/Model/RoleInterface.php index <HASH>..<HASH> 100644 --- a/src/Ciscaja/Uhsa/UserBundle/Model/RoleInterface.php +++ b/src/Ciscaja/Uhsa/UserBundle/Model/RoleInterface.php @@ -57,6 +57,18 @@ interface RoleInterface extends BaseRoleInterface /** * @return bool */ + public function canViewUser(); + + /** + * @param bool $allowed + * + * @return UserInterface + */ + public function setViewUserAllowed($allowed); + + /** + * @return bool + */ public function canCreateUser(); /**
Added view permission methods to Model\RoleInterface.
ciscaja_uhsa-userbundle
train
php
322e1be322cc2f7fb8f7cc0ac515f021e73c6f1a
diff --git a/src/fields/Date.php b/src/fields/Date.php index <HASH>..<HASH> 100644 --- a/src/fields/Date.php +++ b/src/fields/Date.php @@ -37,12 +37,13 @@ class Date extends Field */ protected function getRules(): array { + $self = $this; return ArrayHelper::merge(parent::getRules(), [ $this->attribute . 'Date' => [ $this->attribute, - function () { - if (!$this->extractIntervalDates()) { - $this->model->addError($this->attribute, 'Bad date interval "' . $this->getValue() . '"'); + function () use ($self) { + if (!$self->extractIntervalDates()) { + $self->model->addError($self->attribute, 'Bad date interval "' . $self->getValue() . '"'); return false; }
fixed bug with date validation and new yii2
execut_yii2-crud-fields
train
php
0de62069b6edcd0c089aac3a9b9e87d13a639732
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -24,16 +24,17 @@ install_requires = [ "coverage", "colorlog", "docker-compose", - "flake8", + "flake8<=3.4.1", "future", "netifaces", "pandas", "pep8>=1.7.1", "pipenv", - "pydocstyle", + "pydocstyle<=2.3.1", "pylint", "python-logstash", "python-owasp-zap-v2.4", + "python-dateutil<2.7.0", "scapy-python3", "tox", "unittest2", @@ -59,7 +60,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "network_pipeline")) setup( name="network-pipeline", cmdclass={"build_py": build_py}, - version="1.0.15", + version="1.0.16", description="Distributed Network Packet Analysis Pipeline " + "for Layer 2, 3 and 4 Frames", long_description="" +
allow any version of flake8 and pycodestyle but the latest that have a known issue: <URL>
jay-johnson_network-pipeline
train
py
1209f39379702949f837c8a27b14441d292872c3
diff --git a/src/main/java/org/jfree/graphics2d/svg/SVGUtils.java b/src/main/java/org/jfree/graphics2d/svg/SVGUtils.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jfree/graphics2d/svg/SVGUtils.java +++ b/src/main/java/org/jfree/graphics2d/svg/SVGUtils.java @@ -127,7 +127,7 @@ public class SVGUtils { * * @throws IOException if there is an I/O problem. * - * @since 2.2 + * @since 3.0 */ public static void writeToSVG(File file, String svgElement, boolean zip) throws IOException {
Fix version number for method introduced in <I>
jfree_jfreesvg
train
java
5a9e48be300156423ee1b82d0bfee83a3b28083e
diff --git a/etcdserver/api/rafthttp/metrics.go b/etcdserver/api/rafthttp/metrics.go index <HASH>..<HASH> 100644 --- a/etcdserver/api/rafthttp/metrics.go +++ b/etcdserver/api/rafthttp/metrics.go @@ -58,7 +58,10 @@ var ( Subsystem: "network", Name: "peer_round_trip_time_seconds", Help: "Round-Trip-Time histogram between peers.", - Buckets: prometheus.ExponentialBuckets(0.0001, 2, 14), + + // lowest bucket start of upper bound 0.0001 sec (0.1 ms) with factor 2 + // highest bucket start of 0.0001 sec * 2^15 == 3.2768 sec + Buckets: prometheus.ExponentialBuckets(0.0001, 2, 16), }, []string{"To"}, )
etcdserver/api/rafthttp: increase bucket upperbound up-to 3-sec From <I> sec to <I> sec for more detailed latency analysis
etcd-io_etcd
train
go
0da276cfeddc9218c62e6d59376019881abebe1b
diff --git a/src/DateComboBox.js b/src/DateComboBox.js index <HASH>..<HASH> 100644 --- a/src/DateComboBox.js +++ b/src/DateComboBox.js @@ -123,8 +123,8 @@ class DateComboBox extends Base { const state = Object.assign(super[internal.defaultState], { arrowButtonRole: ArrowDirectionButton, calendarRole: CalendarMonthNavigator, - date: calendar.today(), - datePriority: true, // since we're setting a default date + date: null, + datePriority: false, dateSelected: false, dateTimeFormat: null, dateTimeFormatOptions,
Revert Elix ~<I> era change in which a DateComboBox defaults to today. It seems safer to have the combo box's default value be empty and the default date by null. (If user opens combo box, they'll see that the default date in the calendar is today.) As a side effect, this fixes a long-standing bug in which an empty DateComboBox wouldn't let the user select today.
elix_elix
train
js
f6257048f3acd8292b7c670b6b9cdb0282a16e11
diff --git a/lib/Predis/Async/Connection/ConnectionInterface.php b/lib/Predis/Async/Connection/ConnectionInterface.php index <HASH>..<HASH> 100644 --- a/lib/Predis/Async/Connection/ConnectionInterface.php +++ b/lib/Predis/Async/Connection/ConnectionInterface.php @@ -57,6 +57,15 @@ interface ConnectionInterface public function getParameters(); /** + * Executes a command on Redis and calls the provided callback when the + * response has been read from the server. + * + * @param CommandInterface $command Redis command. + * @param mixed $callback Callable object. + */ + public function executeCommand(CommandInterface $command, $callback); + + /** * Write the buffer to writable network streams. * * @return mixed
Add missing method to the connection interface.
nrk_predis-async
train
php
4053b034cfb797b76c848aaae3c8a866b1d3f35d
diff --git a/src/Classes/Module.php b/src/Classes/Module.php index <HASH>..<HASH> 100644 --- a/src/Classes/Module.php +++ b/src/Classes/Module.php @@ -266,6 +266,9 @@ class Module extends Ardent */ public static function getModulesFromDisk() { + // check Modules folder is created or not + if(!app('files')->exists(app_path('Modules'))) + app('files')->makeDirectory(app_path('Modules')); $authors = app('files')->directories(app_path('Modules')); $results = []; if ($authors && count($authors))
Error when fresh project created in cobonto and scan modules
cobonto_module
train
php
0397231e110b9b981b43b8f74fcac90c2628263c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -13,6 +13,7 @@ setup( platforms="any", description="Image based watermarks for sorl-thumbnail", long_description=open("README.md").read(), + long_description_content_type="text/markdown", classifiers=[ "Development Status :: 4 - Beta", "Environment :: Web Environment",
pypi: use markdown for formatting.
originell_sorl-watermark
train
py
80588a6e15acf0fdd5c0f30dee7e899fb005e51a
diff --git a/endtoend_tests/endtoend_test.go b/endtoend_tests/endtoend_test.go index <HASH>..<HASH> 100644 --- a/endtoend_tests/endtoend_test.go +++ b/endtoend_tests/endtoend_test.go @@ -2,11 +2,8 @@ package endtoend_test import ( "flag" - "launchpad.net/goamz/aws" - "launchpad.net/goamz/ec2" . "launchpad.net/gocheck" "testing" - "time" ) func Test(t *testing.T) { TestingT(t) } @@ -23,6 +20,7 @@ func (s *S) SetUpSuite(c *C) { c.Skip("skipping end-to-end suite, use -endtoend to enable") } } -func (s *S) TestTrueIsTrue(c *C) { + +func (s *S) TestCreatesUser(c *C) { c.Assert(true, Equals, true) }
end-to-end: removed unused imports
tsuru_gandalf
train
go
b2670cb35529441fd66cf08394cdbbff1cfa99bb
diff --git a/www/tests/test_file.py b/www/tests/test_file.py index <HASH>..<HASH> 100644 --- a/www/tests/test_file.py +++ b/www/tests/test_file.py @@ -7,7 +7,7 @@ with open('files/text-utf8.txt') as f: f.read() with open('compression/du cote de chez swann.txt', 'rb') as f: - assert len(f.read()) == 1_056_294 + assert len(f.read()) in [1_054_176, 1_056_294] with open('compression/du cote de chez swann.txt', 'r') as f: assert len(f.readlines()) == 2118
Change test on length of result of file.read() to handle different length of line feed (1 or 2 characters). Related to issue #<I>.
brython-dev_brython
train
py
7364f183310c40dad075e8b916b5f9068c37497f
diff --git a/fabric-client/lib/packager/BasePackager.js b/fabric-client/lib/packager/BasePackager.js index <HASH>..<HASH> 100644 --- a/fabric-client/lib/packager/BasePackager.js +++ b/fabric-client/lib/packager/BasePackager.js @@ -80,7 +80,7 @@ const BasePackager = class { if (entry.stats.isFile() && this.isMetadata(entry.path)) { const desc = { - name: path.join('META-INF', path.relative(filePath, entry.path).split('\\').join('/')), // for windows style paths + name: path.join('META-INF', path.relative(filePath, entry.path)).split('\\').join('/'), // for windows style paths fqp: entry.path }; logger.debug(' findMetadataDescriptors :: %j', desc);
[FABN-<I>] Correct metadata packaging code for Windows The metadata packaging code uses the Windows path separator on Windows systems; this is because the split/join is being done to the result of path.relative rather than the result of path.join. Change-Id: Id3e5ceae7c3b<I>c<I>d7fc<I>f<I>b7
hyperledger_fabric-sdk-node
train
js
ebaacac5fda6a54a7f2bd80b82cb30065d758a3c
diff --git a/modules/system/controllers/Settings.php b/modules/system/controllers/Settings.php index <HASH>..<HASH> 100644 --- a/modules/system/controllers/Settings.php +++ b/modules/system/controllers/Settings.php @@ -30,6 +30,10 @@ class Settings extends Controller { parent::__construct(); + if ($this->action == 'mysettings') { + $this->requiredPermissions = null; + } + $this->addCss('/modules/system/assets/css/settings.css', 'core'); BackendMenu::setContext('October.System', 'system', 'settings');
Fixes #<I> - MySettings page should have no permission requirement
octobercms_october
train
php
d17ebf6cd2bd037c27966c2be1e58a61d7ab43de
diff --git a/media/js/views/window.js b/media/js/views/window.js index <HASH>..<HASH> 100644 --- a/media/js/views/window.js +++ b/media/js/views/window.js @@ -115,8 +115,7 @@ name = (room && room.get('name')) || 'Rooms'; } if (name) { - this.title = $('<pre />').text(name).html() + - ' \u00B7 ' + this.originalTitle; + this.title = name + ' \u00B7 ' + this.originalTitle; } else { this.title = this.originalTitle; }
Fix htmlentities appearing in document title
sdelements_lets-chat
train
js
bb1af05247e499e4080ccd1ab0d3a0615f7601b7
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -712,6 +712,7 @@ module ActionDispatch # constraints(:post_id => /\d+\.\d+) do # resources :comments # end + # end # # === Restricting based on IP #
Missing an end in routing docs
rails_rails
train
rb
94d0d9add468b25a7610589f126f69331a035b86
diff --git a/pkg/minikube/assets/addons.go b/pkg/minikube/assets/addons.go index <HASH>..<HASH> 100755 --- a/pkg/minikube/assets/addons.go +++ b/pkg/minikube/assets/addons.go @@ -538,7 +538,7 @@ var Addons = map[string]*Addon{ "0640"), }, false, "gcp-auth", "google", map[string]string{ "KubeWebhookCertgen": "k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0@sha256:f3b6b39a6062328c095337b4cadcefd1612348fdd5190b1dcbcb9b9e90bd8068", - "GCPAuthWebhook": "k8s-minikube/gcp-auth-webhook:v0.0.7@sha256:be9661afbd47e4042bee1cb48cae858cc2f4b4e121340ee69fdc0013aeffcca4", + "GCPAuthWebhook": "k8s-minikube/gcp-auth-webhook:v0.0.8@sha256:26c7b2454f1c946d7c80839251d939606620f37c2f275be2796c1ffd96c438f6", }, map[string]string{ "GCPAuthWebhook": "gcr.io", }),
update gcp-auth-webhook image to <I>
kubernetes_minikube
train
go
3b5109968fb5605784db121e17c9ccfe7fdf3a85
diff --git a/spec/mongo/collection_spec.rb b/spec/mongo/collection_spec.rb index <HASH>..<HASH> 100644 --- a/spec/mongo/collection_spec.rb +++ b/spec/mongo/collection_spec.rb @@ -472,6 +472,15 @@ describe Mongo::Collection do context 'when the user is not authorized' do + let(:view) do + unauthorized_collection.find + end + + it 'iterates over the documents' do + expect { + view.each{ |document| document } + }.to raise_error(Mongo::Error::OperationFailure) + end end context 'when documents contain potential error message fields' do
RUBY-<I>: Ensure auth failures are raised
mongodb_mongo-ruby-driver
train
rb
941966f31712bb5681b86eeaed9cd12c45d42fc0
diff --git a/src/instrumentation/angular/http.js b/src/instrumentation/angular/http.js index <HASH>..<HASH> 100644 --- a/src/instrumentation/angular/http.js +++ b/src/instrumentation/angular/http.js @@ -4,8 +4,19 @@ module.exports = function ($provide, traceBuffer) { // HTTP Instrumentation $provide.decorator('$http', ['$delegate', '$injector', function ($delegate, $injector) { return utils.instrumentModule($delegate, $injector, { - type: 'ext.http.request', - prefix: 'angular.$http' + type: 'ext.$http', + prefix: '$http', + signatureFormatter: function (key, args) { + text = [] + if(args.length) { + if(typeof args[0] == 'object') { + text = ['$http', args[0].method.toUpperCase(), args[0].url] + } else { + text = ['$http', args[0]] + } + } + return text.join(' ') + } }) }]) }
Update trace signature for $http traces
opbeat_opbeat-react
train
js
851a1109b6a94125476c75e0b3d298f6079afb81
diff --git a/drools-core/src/main/java/org/drools/core/metadata/WorkingMemoryTask.java b/drools-core/src/main/java/org/drools/core/metadata/WorkingMemoryTask.java index <HASH>..<HASH> 100644 --- a/drools-core/src/main/java/org/drools/core/metadata/WorkingMemoryTask.java +++ b/drools-core/src/main/java/org/drools/core/metadata/WorkingMemoryTask.java @@ -1,6 +1,8 @@ package org.drools.core.metadata; -public interface WorkingMemoryTask<T> extends MetaCallableTask<T>, Identifiable { +import java.io.Serializable; + +public interface WorkingMemoryTask<T> extends MetaCallableTask<T>, Identifiable, Serializable { public Object getTargetId();
Mark WorkingMemoryTask as Serializable for the persistence and retrieval of sessions.
kiegroup_drools
train
java
791809775d62612321cc6e0bb0409c73f54f3c72
diff --git a/install_hooks.py b/install_hooks.py index <HASH>..<HASH> 100755 --- a/install_hooks.py +++ b/install_hooks.py @@ -325,8 +325,14 @@ def fix_alignak_cfg(config): "== ==\n" "== You should grant the write permissions on the configuration directory to ==\n" "== the user alignak: ==\n" - "== sudo find %s -type f -exec chmod 664 {} +\n" - "== sudo find %s -type d -exec chmod 775 {} +\n" + "== find %s -type f -exec chmod 664 {} +\n" + "== find %s -type d -exec chmod 775 {} +\n" + "== -------------------------------------------------------------------------- ==\n" + "== ==\n" + "== You should also grant ownership on those directories to the user alignak: ==\n" + "== chown -R alignak:alignak /usr/local/var/run/alignak ==\n" + "== chown -R alignak:alignak /usr/local/var/log/alignak ==\n" + "== chown -R alignak:alignak /usr/local/var/libexec/alignak ==\n" "== ==\n" "== -------------------------------------------------------------------------- ==\n" "== ==\n"
Fix-#<I> - ownership message
Alignak-monitoring_alignak
train
py
27084c1253056f548f0b35e29eed4708cef0ed64
diff --git a/spec/elastic_apm_spec.rb b/spec/elastic_apm_spec.rb index <HASH>..<HASH> 100644 --- a/spec/elastic_apm_spec.rb +++ b/spec/elastic_apm_spec.rb @@ -43,8 +43,6 @@ RSpec.describe ElasticAPM do it 'sets duration' do expect(subject.duration).to eq 500_000_000 end - - it 'queues transaction' end end end diff --git a/spec/integration/rails_spec.rb b/spec/integration/rails_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integration/rails_spec.rb +++ b/spec/integration/rails_spec.rb @@ -53,4 +53,6 @@ RSpec.describe 'Rails integration' do expect(response.body).to eq 'Yes!' expect(ElasticAPM.agent.pending_transactions.length).to be 1 end + + it 'sends stuff to the server' end
Add pending spec to rails integration spec
elastic_apm-agent-ruby
train
rb,rb
8ee4253761ce8eb939fdef98e7992313d670f5ce
diff --git a/blocks/tag_flickr/block_tag_flickr.php b/blocks/tag_flickr/block_tag_flickr.php index <HASH>..<HASH> 100644 --- a/blocks/tag_flickr/block_tag_flickr.php +++ b/blocks/tag_flickr/block_tag_flickr.php @@ -69,7 +69,7 @@ class block_tag_flickr extends block_base { $search = unserialize($response); - foreach ($search['photoset']['photo'] as &$p){ + foreach ($search['photoset']['photo'] as $p){ $p['owner'] = $search['photoset']['owner']; }
Removing PHP5-ism again
moodle_moodle
train
php
df62854a2866cf84712f3b3abcfaaf7c835f6dc8
diff --git a/bosh-director/lib/bosh/director/compiled_release_downloader.rb b/bosh-director/lib/bosh/director/compiled_release_downloader.rb index <HASH>..<HASH> 100644 --- a/bosh-director/lib/bosh/director/compiled_release_downloader.rb +++ b/bosh-director/lib/bosh/director/compiled_release_downloader.rb @@ -17,7 +17,7 @@ module Bosh::Director FileUtils.mkpath(path) compiled_packages = @compiled_packages_group.compiled_packages - event_log.begin_stage("copying packages", compiled_packages.size) + event_log.begin_stage("copying packages", compiled_packages.count) compiled_packages.each do |compiled_package| desc = "#{compiled_package.package.name}/#{compiled_package.package.version}" @@ -32,7 +32,7 @@ module Bosh::Director path = File.join(@download_dir, 'jobs') FileUtils.mkpath(path) - event_log.begin_stage("copying jobs", @templates.size) + event_log.begin_stage("copying jobs", @templates.count) @templates.each do |template| desc = "#{template.name}/#{template.version}" event_log.track(desc) do
fix the how the size of the templates and packages are calculated to make it work with ruby <I> <URL>
cloudfoundry_bosh
train
rb
483183df6242f1f727629be1a456b924a24a1ada
diff --git a/ELiDE/ELiDE/stores.py b/ELiDE/ELiDE/stores.py index <HASH>..<HASH> 100644 --- a/ELiDE/ELiDE/stores.py +++ b/ELiDE/ELiDE/stores.py @@ -365,7 +365,7 @@ class FunctionNameInput(TextInput): self._trigger_save(self.text) -def sanitize_source(v, spaces=4): +def munge_source(v, spaces=4): lines = v.split('\n') if not lines: return tuple(), '' @@ -422,7 +422,7 @@ class FuncEditor(Editor): Clock.schedule_once(partial(self._set_source, v), 0) return self.codeinput.unbind(text=self.setter('_text')) - self.params, self.codeinput.text = sanitize_source(str(v)) + self.params, self.codeinput.text = munge_source(str(v)) self.codeinput.bind(text=self.setter('_text')) source = AliasProperty(_get_source, _set_source, bind=('_text', 'params'))
Rename sanitize_source to munge_source
LogicalDash_LiSE
train
py
48d2e2ee9952f95f1dea0f5f232c063862636a12
diff --git a/src/MaxCDN.php b/src/MaxCDN.php index <HASH>..<HASH> 100644 --- a/src/MaxCDN.php +++ b/src/MaxCDN.php @@ -47,6 +47,9 @@ class MaxCDN { // create curl resource $ch = curl_init(); + // force curl http/1.1 + curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); + // set url curl_setopt($ch, CURLOPT_URL, $req_req);
Update MaxCDN.php Adds curl <I> compatibility
MaxCDN_php-maxcdn
train
php
9eb3aac6d511a11f5866e0989fda0fd478e08d0a
diff --git a/src/Html.php b/src/Html.php index <HASH>..<HASH> 100644 --- a/src/Html.php +++ b/src/Html.php @@ -116,6 +116,13 @@ class Html extends Markup if (!isset($this->attributeList['class']) || is_null($this->attributeList['class'])) { $this->attributeList['class'] = []; } + if (!is_array($this->attributeList['class'])) { + if (!empty($this->attributeList['class'])) { + $this->attributeList['class'] = [$this->attributeList['class']]; + } else { + $this->attributeList['class'] = []; + } + } foreach ($value as $class_name) { $class_name = trim($class_name); if (!empty($class_name)) {
Added fix for the class attribute that could be a string
hnhdigital-os_laravel-html-generator
train
php
26b9376c6454a13f3399d32db5a93efbfe8dfc66
diff --git a/createNativeStackNavigator.js b/createNativeStackNavigator.js index <HASH>..<HASH> 100644 --- a/createNativeStackNavigator.js +++ b/createNativeStackNavigator.js @@ -90,7 +90,7 @@ class StackView extends React.Component { translucent: translucent === undefined ? false : translucent, title, titleFontFamily: headerTitleStyle && headerTitleStyle.fontFamily, - titleColor: headerTintColor, + titleColor: (headerTitleStyle && headerTitleStyle.color) || headerTintColor, titleFontSize: headerTitleStyle && headerTitleStyle.fontSize, backTitle: headerBackTitleVisible === false ? '' : headerBackTitle, backTitleFontFamily:
feat: support header title color (#<I>) Currently it was not possible to set a title color different than the tint color. This PR keeps the tintColor as the default header title color but also uses the headerStyle.color if defined.
kmagiera_react-native-screens
train
js
44583131e9f9c9dc1950506f488853ea280d9b28
diff --git a/spec/souvenirs/can_be_persistent_spec.rb b/spec/souvenirs/can_be_persistent_spec.rb index <HASH>..<HASH> 100644 --- a/spec/souvenirs/can_be_persistent_spec.rb +++ b/spec/souvenirs/can_be_persistent_spec.rb @@ -29,6 +29,7 @@ describe Souvenirs::CanBePersistent do tenant = Tenant.get("Francois") tenant.id.should == "Francois" tenant.language.should == "French" + tenant.should be_persisted end it "#get returns nil if the model can't be loaded" do @@ -38,10 +39,12 @@ describe Souvenirs::CanBePersistent do it "#get! behaves just like #get when the model is found" do Tenant.attribute :language Tenant.new(:id => "Francois", :language => "French").save - Tenant.get!("Francois").attributes.should == { + tenant = Tenant.get!("Francois") + tenant.attributes.should == { "id" => "Francois", "language" => "French" } + tenant.should be_persisted end it "#get! raises an error if the model is not found" do
oops, forgot to test persisted? on loaded models
mathieul_ricordami
train
rb
0751d0e82169087c0c2861335a456be60992de64
diff --git a/bokeh/plotting_helpers.py b/bokeh/plotting_helpers.py index <HASH>..<HASH> 100644 --- a/bokeh/plotting_helpers.py +++ b/bokeh/plotting_helpers.py @@ -294,10 +294,10 @@ def _new_xy_plot(x_range=None, y_range=None, plot_width=None, plot_height=None, tool_objs.append(tool) elif isinstance(tool, str): #If str object temp_tool_str+=tool + ',' + else: + raise ValueError("tool should be a valid str or Tool Object") tools = temp_tool_str - - for tool in re.split(r"\s*,\s*", tools.strip()): # re.split will return empty strings; ignore them. if tool == "":
Removed vertical space, added exception handling
bokeh_bokeh
train
py
d07fd9f1c6fb627d79183456459aa47726e51aa4
diff --git a/lib/gemirro/server.rb b/lib/gemirro/server.rb index <HASH>..<HASH> 100644 --- a/lib/gemirro/server.rb +++ b/lib/gemirro/server.rb @@ -79,8 +79,9 @@ module Gemirro def fetch_gem(resource) name = File.basename(resource) regexp = /^(.*)-(\d+(?:\.\d+){,4})\.gem(?:spec\.rz)?$/ - gem_name, gem_version = name.match(regexp).captures + return unless result = name.match(regexp) + gem_name, gem_version = result.captures return unless gem_name && gem_version logger.info("Try to download #{gem_name} with version #{gem_version}")
Fixed #1 <I> can crash the server
PierreRambaud_gemirro
train
rb
25b47400acedcd2404013f33b47a9513f48504bf
diff --git a/lib/auditor.rb b/lib/auditor.rb index <HASH>..<HASH> 100644 --- a/lib/auditor.rb +++ b/lib/auditor.rb @@ -12,8 +12,8 @@ if defined?(ActionController) and defined?(ActionController::Base) require 'auditor/user' ActionController::Base.class_eval do - before_filter do - Auditor::User.current_user = self.current_user if self.respond_to?(:current_user) + before_filter do |c| + Auditor::User.current_user = c.send(:current_user) if c.respond_to?(:current_user) end end
Minor change to enable calling current_user method even when it's private
kunklejr_auditor
train
rb
7b02a28f1d57b1ae85b12481cd363cebb3424dd9
diff --git a/test/com/google/javascript/refactoring/ErrorToFixMapperTest.java b/test/com/google/javascript/refactoring/ErrorToFixMapperTest.java index <HASH>..<HASH> 100644 --- a/test/com/google/javascript/refactoring/ErrorToFixMapperTest.java +++ b/test/com/google/javascript/refactoring/ErrorToFixMapperTest.java @@ -1259,8 +1259,9 @@ public class ErrorToFixMapperTest { } @Test - @Ignore("This has a bug, but hopefully it's uncommon enough that we never need to fix") + @Ignore public void testMissingRequire_inJSDoc_withWhitespace() { + // TODO(b/159336400): Fix this test so the fix is valid preexistingCode = "goog.provide('some.really.very.long.namespace.SuperInt');"; assertExpectedFixes( lines(
Add bug link for a test case that currently generates bad fixes PiperOrigin-RevId: <I>
google_closure-compiler
train
java
0972ad25ff6562b535971c76933e62eff9a01c9d
diff --git a/spec/server_worker_context.rb b/spec/server_worker_context.rb index <HASH>..<HASH> 100644 --- a/spec/server_worker_context.rb +++ b/spec/server_worker_context.rb @@ -256,10 +256,12 @@ shared_context 'test server and worker' do before { reset_test_state } after { Timecop.return } - if ServerEngine.windows? - WAIT_RATIO = 2 - else - WAIT_RATIO = 1 + unless self.const_defined?(:WAIT_RATIO) + if ServerEngine.windows? + WAIT_RATIO = 2 + else + WAIT_RATIO = 1 + end end def wait_for_fork
Fix a warning while running test ``` C:/Users/aho/Projects/serverengine/spec/server_worker_context.rb:<I>: warning: already initialized constant WAIT_RATIO C:/Users/aho/Projects/serverengine/spec/server_worker_context.rb:<I>: warning: previous definition of WAIT_RATIO was here ```
treasure-data_serverengine
train
rb
c2b531c071b0d60e5cecda9701506e7de791bbc0
diff --git a/sources/lib/Generator/StructureGenerator.php b/sources/lib/Generator/StructureGenerator.php index <HASH>..<HASH> 100644 --- a/sources/lib/Generator/StructureGenerator.php +++ b/sources/lib/Generator/StructureGenerator.php @@ -47,7 +47,6 @@ Class and fields comments are inspected from table and fields comments. Just add @see http://www.postgresql.org/docs/9.0/static/sql-comment.html TEXT; } - $this ->outputFileCreation($output) ->saveFile( @@ -56,7 +55,11 @@ TEXT; [ 'namespace' => $this->namespace, 'class_name' => $input->getParameter('class_name', Inflector::studlyCaps($this->relation)), - 'relation' => sprintf("%s.%s", $this->schema, $this->relation), + 'relation' => sprintf( + "%s.%s", + $this->getSession()->getConnection()->escapeIdentifier($this->schema), + $this->getSession()->getConnection()->escapeIdentifier($this->relation) + ), 'primary_key' => join( ', ', array_map(
Escape generated structure’s relation name The relations detected by the inspector are database objects. Their name must be escaped to prevent problems when when a legacy database with uppercase letters are used in their relations.
pomm-project_ModelManager
train
php
2124dc99571df6cee0f527929c52095775ccadba
diff --git a/src/org/opencms/file/types/CmsResourceTypeXmlContent.java b/src/org/opencms/file/types/CmsResourceTypeXmlContent.java index <HASH>..<HASH> 100644 --- a/src/org/opencms/file/types/CmsResourceTypeXmlContent.java +++ b/src/org/opencms/file/types/CmsResourceTypeXmlContent.java @@ -252,9 +252,12 @@ public class CmsResourceTypeXmlContent extends A_CmsResourceTypeLinkParseable { CmsResourceDeleteMode siblingMode) throws CmsException { - super.deleteResource(cms, securityManager, resource, siblingMode); + List<CmsResource> detailOnlyPages = null; if (isPossiblyDetailContent(resource)) { - List<CmsResource> detailOnlyPages = getDetailContainerResources(cms, resource); + detailOnlyPages = getDetailContainerResources(cms, resource); + } + super.deleteResource(cms, securityManager, resource, siblingMode); + if (detailOnlyPages != null) { for (CmsResource page : detailOnlyPages) { if (page.getState().isDeleted()) { continue;
Fixed bug with deleting detail-only pages.
alkacon_opencms-core
train
java
f4bb771a44e31f0ebf17d8b9f6cee1ea26418580
diff --git a/andes/models/area.py b/andes/models/area.py index <HASH>..<HASH> 100644 --- a/andes/models/area.py +++ b/andes/models/area.py @@ -3,6 +3,7 @@ from andes.core.model import Model, ModelData from andes.core.var import ExtAlgeb, Algeb # NOQA from andes.core.service import NumReduce, NumRepeat, BackRef from andes.shared import np +from andes.utils.tab import Tab class AreaData(ModelData): @@ -32,3 +33,20 @@ class Area(AreaData, Model): info='Bus voltage magnitude') # self.time = Algeb(e_str='time - dae_t', v_setter=True) + + def bus_table(self): + """ + Return a formatted table with area idx and bus idx correspondence + + Returns + ------- + str + Formatted table + + """ + if self.n: + header = ['Area ID', 'Bus ID'] + rows = [(i, j) for i, j in zip(self.idx.v, self.Bus.v)] + return Tab(header=header, data=rows).draw() + else: + return ''
Added `Area.bus_table` for printing the area-bus correspondence.
cuihantao_andes
train
py
9351f580e5ccbf1e7a39bd3ad571a3c5cdb66bd7
diff --git a/source/test/network_test/test_non_acknowledged_messages.py b/source/test/network_test/test_non_acknowledged_messages.py index <HASH>..<HASH> 100644 --- a/source/test/network_test/test_non_acknowledged_messages.py +++ b/source/test/network_test/test_non_acknowledged_messages.py @@ -33,6 +33,7 @@ def wait_for_test_finished(queue, udp_endpoint, connector): print('process with id {0} will stop reactor'.format(str(os.getpid()))) reactor.callFromThread(reactor.stop) print('process with id {0} did stop reactor'.format(str(os.getpid()))) + os._exit(0) @@ -142,5 +143,5 @@ def test_non_acknowledged_messages(): if __name__ == '__main__': - # test_non_acknowledged_messages() - pytest.main([__file__]) \ No newline at end of file + test_non_acknowledged_messages() + # pytest.main([__file__]) \ No newline at end of file
add process shutdown as the shutting down twisted in a controlled manner does not work the process is killed
DLR-RM_RAFCON
train
py
2a3c247b822a3f0e7c53e1fec8307532620612fe
diff --git a/src/app/actions/psmtable/refine.py b/src/app/actions/psmtable/refine.py index <HASH>..<HASH> 100644 --- a/src/app/actions/psmtable/refine.py +++ b/src/app/actions/psmtable/refine.py @@ -190,7 +190,7 @@ def generate_psms_with_proteingroups(psms, pgdb, specfncol, unroll): psm_masters.append(master) psm_pg_proteins.append([protein[lookups.PROTEIN_ACC_INDEX] for protein in group]) - outpsm = {mzidtsvdata.HEADER_MASTER_PROT: ';'.join(psm_masters), + outpsm = {mzidtsvdata.HEADER_MASTER_PROT: ';'.join(sorted(psm_masters)), mzidtsvdata.HEADER_PG_CONTENT: ';'.join( [','.join([y for y in x]) for x in psm_pg_proteins]), mzidtsvdata.HEADER_PG_AMOUNT_PROTEIN_HITS: ';'.join(
Sort proteingroup masters if multiple so we can have reproducible output
glormph_msstitch
train
py
8d4df69bcccfffad444584cb68a1860db0a1a25c
diff --git a/tools/fixsubjectNames.go b/tools/fixsubjectNames.go index <HASH>..<HASH> 100644 --- a/tools/fixsubjectNames.go +++ b/tools/fixsubjectNames.go @@ -5,6 +5,7 @@ import ( "encoding/base64" "encoding/json" "fmt" + "os" "strings" "github.com/mozilla/tls-observatory/certificate" @@ -13,11 +14,11 @@ import ( func main() { db, err := database.RegisterConnection( - "postgres", - "postgres", - "pass", - "172.17.0.1:5432", - "disable") + os.Getenv("TLSOBS_POSTGRESDB"), + os.Getenv("TLSOBS_POSTGRESUSER"), + os.Getenv("TLSOBS_POSTGRESPASS"), + os.Getenv("TLSOBS_POSTGRES"), + "require") defer db.Close() if err != nil { panic(err)
Use env variable to access the DB in fixsubjectNames script
mozilla_tls-observatory
train
go
090691c9ef3ff5ac827bc8c32a453e239c8782b9
diff --git a/pylint/lint.py b/pylint/lint.py index <HASH>..<HASH> 100644 --- a/pylint/lint.py +++ b/pylint/lint.py @@ -135,20 +135,6 @@ def _merge_stats(stats): return merged -@contextlib.contextmanager -def _patch_sysmodules(): - # Context manager that permits running pylint, on Windows, with -m switch - # and with --jobs, as in 'python -2 -m pylint .. --jobs'. - # For more details why this is needed, - # see Python issue http://bugs.python.org/issue10845. - - mock_main = __name__ != "__main__" # -m switch - if mock_main: - sys.modules["__main__"] = sys.modules[__name__] - - yield - - # Python Linter class ######################################################### MSGS = { @@ -949,8 +935,7 @@ class PyLinter( if self.config.jobs == 1: self._do_check(files_or_modules) else: - with _patch_sysmodules(): - self._parallel_check(files_or_modules) + self._parallel_check(files_or_modules) def _get_jobs_config(self): child_config = collections.OrderedDict()
remove entire _patch_submodules
PyCQA_pylint
train
py
81894d737a14f8b84422d21b6a897753ee3eb277
diff --git a/Controller/Listener/TranslationsListener.php b/Controller/Listener/TranslationsListener.php index <HASH>..<HASH> 100644 --- a/Controller/Listener/TranslationsListener.php +++ b/Controller/Listener/TranslationsListener.php @@ -1,7 +1,7 @@ <?php App::uses('CrudSubject', 'Crud.Controller/Listener'); -App::uses('CrudListener', 'Crud.Controller/Listener'); +App::uses('CakeEventListener', 'Event'); /** * TranslationsEvent for Crud @@ -16,7 +16,7 @@ App::uses('CrudListener', 'Crud.Controller/Listener'); * @see http://book.cakephp.org/2.0/en/controllers/components.html#Component * @copyright Nodes ApS, 2012 */ -class TranslationsListener extends CrudListener { +class TranslationsListener implements CakeEventListener { /** * Configurations for TranslationsEvent
TranslationsListener does not need to extend CrudListener
FriendsOfCake_crud-json-api
train
php
14b517627ca1734c3641c2b7a3ef2cc82922c78e
diff --git a/src/main/java/com/couchbase/lite/Attachment.java b/src/main/java/com/couchbase/lite/Attachment.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/couchbase/lite/Attachment.java +++ b/src/main/java/com/couchbase/lite/Attachment.java @@ -201,7 +201,7 @@ public class Attachment { else if (value instanceof AttachmentInternal) { throw new IllegalArgumentException("AttachmentInternal objects not expected here. Could indicate a bug"); } - else { + else if (value != null) { updatedAttachments.put(name, value); } }
Update to pull request #<I> from b-smets -- looks like it cause another unit test to fail. This change fixes that failure.
couchbase_couchbase-lite-java-core
train
java
7714b9eb0c0e133e2ddbb0b53581f2c8b4d31487
diff --git a/dev/com.ibm.ws.microprofile.faulttolerance.metrics.2.0/src/com/ibm/ws/microprofile/faulttolerance/metrics_20/MetricRecorderImpl.java b/dev/com.ibm.ws.microprofile.faulttolerance.metrics.2.0/src/com/ibm/ws/microprofile/faulttolerance/metrics_20/MetricRecorderImpl.java index <HASH>..<HASH> 100644 --- a/dev/com.ibm.ws.microprofile.faulttolerance.metrics.2.0/src/com/ibm/ws/microprofile/faulttolerance/metrics_20/MetricRecorderImpl.java +++ b/dev/com.ibm.ws.microprofile.faulttolerance.metrics.2.0/src/com/ibm/ws/microprofile/faulttolerance/metrics_20/MetricRecorderImpl.java @@ -35,7 +35,7 @@ public class MetricRecorderImpl extends AbstractMetricRecorderImpl { } private static Metadata createMD(String metaDataName, MetricType metaDataMetricType, String metadataUnit) { - Metadata metaData = Metadata.builder().withDisplayName(metaDataName).withType(metaDataMetricType).withUnit(metadataUnit).build(); + Metadata metaData = Metadata.builder().withName(metaDataName).withType(metaDataMetricType).withUnit(metadataUnit).build(); return metaData; }
Set the metric name rather than the displayName Name is required, displayName defaults to name if not set.
OpenLiberty_open-liberty
train
java
e423910e30a87b4e21abfeb7a5afa0969a7f0abf
diff --git a/gothic/gothic.go b/gothic/gothic.go index <HASH>..<HASH> 100644 --- a/gothic/gothic.go +++ b/gothic/gothic.go @@ -109,7 +109,7 @@ as either "provider" or ":provider". See https://github.com/markbates/goth/examples/main.go to see this in action. */ -func CompleteUserAuth(res http.ResponseWriter, req *http.Request) (goth.User, error) { +var CompleteUserAuth = func(res http.ResponseWriter, req *http.Request) (goth.User, error) { providerName, err := GetProviderName(req) if err != nil {
Made CompleteUserAuth a var function to make it easier for people to test with
markbates_goth
train
go
3d22eb0b0572fb7e95e09469da1e287c974b2b12
diff --git a/src/MessageBird/Client.php b/src/MessageBird/Client.php index <HASH>..<HASH> 100644 --- a/src/MessageBird/Client.php +++ b/src/MessageBird/Client.php @@ -19,7 +19,7 @@ class Client const ENABLE_CONVERSATIONSAPI_WHATSAPP_SANDBOX = 'ENABLE_CONVERSATIONSAPI_WHATSAPP_SANDBOX'; const CONVERSATIONSAPI_WHATSAPP_SANDBOX_ENDPOINT = 'https://whatsapp-sandbox.messagebird.com/v1'; - const CLIENT_VERSION = '2.0.1'; + const CLIENT_VERSION = '2.1.0'; /** * @var string
CHORE: bump release version (#<I>)
messagebird_php-rest-api
train
php
4b46a6f0a55334d1e2cb9869f31c2b22babf0f89
diff --git a/chef/lib/chef/provider/ohai.rb b/chef/lib/chef/provider/ohai.rb index <HASH>..<HASH> 100644 --- a/chef/lib/chef/provider/ohai.rb +++ b/chef/lib/chef/provider/ohai.rb @@ -28,14 +28,13 @@ class Chef def action_reload ohai = ::Ohai::System.new - if not @new_resource.plugin + if @new_resource.plugin ohai.require_plugin @new_resource.plugin else ohai.all_plugins end node.automatic_attrs.merge! ohai.data - node.save end end end
removing unnecessary save and fixing if statement
chef_chef
train
rb
88873b5c5ee000986fd71242ba069b05547e7e5e
diff --git a/howdoi/howdoi.py b/howdoi/howdoi.py index <HASH>..<HASH> 100644 --- a/howdoi/howdoi.py +++ b/howdoi/howdoi.py @@ -32,9 +32,7 @@ from cachelib import FileSystemCache, NullCache from keep import utils as keep_utils -from pygments import highlight from pygments.lexers import guess_lexer, get_lexer_by_name -from pygments.formatters.terminal import TerminalFormatter from pygments.util import ClassNotFound from rich.syntax import Syntax from rich.console import Console @@ -333,13 +331,12 @@ def _format_output(args, code): # no lexer found above, use the guesser if not lexer: try: - lexer = guess_lexer(code) + lexer = guess_lexer(code).name except ClassNotFound: return code - return highlight(code, - lexer, - TerminalFormatter(bg='dark')) + syntax = Syntax(code, lexer, background_color="default", line_numbers=False) + return syntax def _is_question(link): @@ -814,10 +811,8 @@ def command_line_runner(): # pylint: disable=too-many-return-statements,too-man args['color'] = True result = howdoi(args) - lang = guess_lexer(result).name - syntax = Syntax(result, lang, background_color="default", line_numbers=False) console = Console() - console.print(syntax) + console.print(result) # close the session to release connection howdoi_session.close()
replaced pygment's highlight with rich's syntax func
gleitz_howdoi
train
py
287c072190169f5ff3fdb36df7269bdf428d7992
diff --git a/logging_tree/format.py b/logging_tree/format.py index <HASH>..<HASH> 100644 --- a/logging_tree/format.py +++ b/logging_tree/format.py @@ -156,7 +156,7 @@ def describe_handler(h): yield ' Filter %s' % describe_filter(f) formatter = getattr(h, 'formatter', None) if formatter is not None: - if type(formatter) is logging.Formatter: + if class_of(formatter) is logging.Formatter: yield ' Formatter fmt=%r datefmt=%r' % ( getattr(formatter, '_fmt', None), getattr(formatter, 'datefmt', None)) @@ -168,3 +168,17 @@ def describe_handler(h): yield ' Handler ' + next(g) for line in g: yield ' ' + line + + +def class_of(obj): + """Try to learn the class of `obj`. + + We perform the operation gingerly, as `obj` could be any kind of + user-supplied object: an old-style class, a new-style class, or a + built-in type that doesn't follow normal rules. + + """ + cls = getattr(obj, '__class__', None) + if cls is None: + cls = type(obj) + return cls
Restore full compatibility with Python <I>
brandon-rhodes_logging_tree
train
py
1d04f97be1762fc0d72d2bab9e2bdbdc2a0689a0
diff --git a/graphene_django_extras/__init__.py b/graphene_django_extras/__init__.py index <HASH>..<HASH> 100644 --- a/graphene_django_extras/__init__.py +++ b/graphene_django_extras/__init__.py @@ -7,7 +7,7 @@ from .mutation import DjangoSerializerMutation from .pagination import LimitOffsetGraphqlPagination, PageGraphqlPagination, CursorGraphqlPagination from .types import DjangoObjectType, DjangoInputObjectType, DjangoListObjectType -VERSION = (0, 0, 1, 'final', '') +VERSION = (0, 0, 2, 'final', '') __version__ = get_version(VERSION)
Updated dependency DRF in setup.py, to avoid an import error (from rest_framework.compat import get_related_model) produced by the new version of DRF <I>
eamigo86_graphene-django-extras
train
py
7958ac81acd05926c11d51d959d9316074a8bb39
diff --git a/src/Plugin.php b/src/Plugin.php index <HASH>..<HASH> 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -42,7 +42,7 @@ class Plugin extends \craft\base\Plugin parent::init(); // Add in our Twig extensions - Craft::$app->view->twig->addExtension(new AgnosticFetchTwigExtension()); + Craft::$app->view->registerTwigExtension(new AgnosticFetchTwigExtension()); } /**
Use registerTwigExtension() Fixes a bug where the plugin may cause Twig to be loaded before it should be, and another bug where the extension might not be available if the Template Mode ever changes from CP to Site, or vise-versa.
marionnewlevant_craft-agnostic_fetch
train
php
0d39dbf63bfba46921ac20c0c7aaaaa35d39d386
diff --git a/packages/icon/src/Icon.js b/packages/icon/src/Icon.js index <HASH>..<HASH> 100644 --- a/packages/icon/src/Icon.js +++ b/packages/icon/src/Icon.js @@ -16,7 +16,11 @@ /* @flow */ import React, { PureComponent } from 'react'; -import { createStyledComponent, generateId } from '@mineral-ui/component-utils'; +import { + createStyledComponent, + pxToEm, + generateId +} from '@mineral-ui/component-utils'; type Props = { /** Available sizes, including custom - e.g. '5em' or '20px' */ @@ -34,9 +38,9 @@ type Props = { const iconStyles = (props, baseTheme) => { const theme = { Icon_fill: baseTheme.color_gray_60, - Icon_size_small: '2em', - Icon_size_medium: '3em', - Icon_size_large: '4em', + Icon_size_small: pxToEm(12), + Icon_size_medium: pxToEm(16), + Icon_size_large: pxToEm(20), ...baseTheme };
refactor(icon): Update sizes Updates sizes to match those used in Button BREAKING CHANGE: Sizes changed
mineral-ui_mineral-ui
train
js
986ad752349582d339f86995d50184ed58ff51ba
diff --git a/html/pfappserver/root/src/utils/api.js b/html/pfappserver/root/src/utils/api.js index <HASH>..<HASH> 100644 --- a/html/pfappserver/root/src/utils/api.js +++ b/html/pfappserver/root/src/utils/api.js @@ -180,12 +180,13 @@ apiCall.interceptors.response.use((response) => { /* Intercept successful API call */ const { config: { url } = {}, data: { message, warnings, quiet } = {} } = response if (message && !quiet) { - store.dispatch('notification/info', { message, url }) + + store.dispatch('notification/info', { message, url: decodeURIComponent(url) }) } if (warnings && !quiet) { warnings.forEach(warning => { const { message } = warning - store.dispatch('notification/warning', { message, url }) + store.dispatch('notification/warning', { message, url: decodeURIComponent(url) }) }) } store.commit('session/API_OK')
fix(admin(js)): decode URI in api notifications
inverse-inc_packetfence
train
js
e939aaed8b22c9b822e236bbfffa277d1e8bcd3e
diff --git a/releaser/releaser.go b/releaser/releaser.go index <HASH>..<HASH> 100644 --- a/releaser/releaser.go +++ b/releaser/releaser.go @@ -53,17 +53,13 @@ type ReleaseHandler struct { func (r ReleaseHandler) calculateVersions() (helpers.HugoVersion, helpers.HugoVersion) { newVersion := helpers.MustParseHugoVersion(r.cliVersion) - finalVersion := newVersion + finalVersion := newVersion.Next() finalVersion.PatchLevel = 0 if newVersion.Suffix != "-test" { newVersion.Suffix = "" } - if newVersion.PatchLevel == 0 { - finalVersion = finalVersion.Next() - } - finalVersion.Suffix = "-DEV" return newVersion, finalVersion
releaser: Correctly set final version on patch releases
gohugoio_hugo
train
go
9981c4da8b1e6117130234174a5f7296b5a77fee
diff --git a/deep-core/src/test/java/com/stratio/deep/core/context/DeepSparkContextTest.java b/deep-core/src/test/java/com/stratio/deep/core/context/DeepSparkContextTest.java index <HASH>..<HASH> 100644 --- a/deep-core/src/test/java/com/stratio/deep/core/context/DeepSparkContextTest.java +++ b/deep-core/src/test/java/com/stratio/deep/core/context/DeepSparkContextTest.java @@ -16,7 +16,7 @@ package com.stratio.deep.core.context; -import static junit.framework.Assert.assertSame; +import static org.junit.Assert.assertSame; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyInt; import static org.mockito.Matchers.anyString;
Removing deprecated class reference
Stratio_deep-spark
train
java
96a0e601abac306eabfc8a3f378f163cb0a3c751
diff --git a/lib/bugsnag/resque.rb b/lib/bugsnag/resque.rb index <HASH>..<HASH> 100644 --- a/lib/bugsnag/resque.rb +++ b/lib/bugsnag/resque.rb @@ -6,8 +6,15 @@ # module Bugsnag class Resque < ::Resque::Failure::Base - def self.configure - Resque::Failure.backend = self + def self.configure(&block) + unless ::Resque::Failure.backend < ::Resque::Failure::Multiple + original_backend = ::Resque::Failure.backend + ::Resque::Failure.backend = ::Resque::Failure::Multiple + ::Resque::Failure.backend.classes ||= [] + ::Resque::Failure.backend.classes << original_backend + end + + ::Resque::Failure.backend.classes << self ::Bugsnag.configure(&block) end
Auto configuration for non-rails projects
bugsnag_bugsnag-ruby
train
rb
2784b982782a732ad258bb53572852c058d6d91e
diff --git a/lib/questionlib.php b/lib/questionlib.php index <HASH>..<HASH> 100644 --- a/lib/questionlib.php +++ b/lib/questionlib.php @@ -260,7 +260,8 @@ function match_grade_options($gradeoptionsfull, $grade, $matchgrades='error') { // if we just need an error... if ($matchgrades=='error') { foreach($gradeoptionsfull as $value => $option) { - if ($grade==$value) { + // slightly fuzzy test, never check floats for equality :-) + if (abs($grade-$value)<0.00001) { return $grade; } }
Don't compare floats for equality! Bug #<I>
moodle_moodle
train
php
80533ce1ee574081d2ae6ac0202ce9f8d926aa22
diff --git a/models/classes/search/index/DocumentBuilder/IndexDocumentBuilder.php b/models/classes/search/index/DocumentBuilder/IndexDocumentBuilder.php index <HASH>..<HASH> 100644 --- a/models/classes/search/index/DocumentBuilder/IndexDocumentBuilder.php +++ b/models/classes/search/index/DocumentBuilder/IndexDocumentBuilder.php @@ -246,7 +246,9 @@ class IndexDocumentBuilder extends InjectionAwareService implements IndexDocumen $customPropertiesValues = $resource->getPropertyValuesCollection($property); $customProperties[$fieldName][] = array_map( function (core_kernel_classes_Container $property): string { - return $property instanceof Resource ? $property->getUri() : (string)$property; + return tao_helpers_Uri::encode( + $property instanceof Resource ? $property->getUri() : (string)$property + ); }, $customPropertiesValues->toArray() );
fix: keep value econded in tao format
oat-sa_tao-core
train
php
102c06a90f7a090ef65bc92c1a0beb8c35ef157d
diff --git a/src/__tests__/ReduxRouter-test.js b/src/__tests__/ReduxRouter-test.js index <HASH>..<HASH> 100644 --- a/src/__tests__/ReduxRouter-test.js +++ b/src/__tests__/ReduxRouter-test.js @@ -130,13 +130,14 @@ describe('<ReduxRouter>', () => { }); const store = server.reduxReactRouter({ routes })(createStore)(reducer); - store.dispatch(server.match('/parent/child/850', () => { + store.dispatch(server.match('/parent/child/850?key=value', (err, redirectLocation, routerState) => { const output = renderToString( <Provider store={store}> <ReduxRouter /> </Provider> ); expect(output).to.match(/Pathname: \/parent\/child\/850/); + expect(routerState.location.query).to.eql({ key: 'value' }); })); });
Test for presence of query on server-side
acdlite_redux-router
train
js
dea8908bb9f4612dd6d211b55dadd889826a1cf4
diff --git a/core/src/main/java/jenkins/security/ResourceDomainConfiguration.java b/core/src/main/java/jenkins/security/ResourceDomainConfiguration.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/jenkins/security/ResourceDomainConfiguration.java +++ b/core/src/main/java/jenkins/security/ResourceDomainConfiguration.java @@ -36,6 +36,7 @@ import jenkins.util.UrlHelper; import org.apache.commons.codec.binary.Base64; import org.jenkinsci.Symbol; import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.Beta; import org.kohsuke.accmod.restrictions.NoExternalUse; import org.kohsuke.stapler.QueryParameter; import org.kohsuke.stapler.Stapler; @@ -62,9 +63,10 @@ import static jenkins.security.ResourceDomainFilter.ERROR_RESPONSE; * @see ResourceDomainFilter * @see ResourceDomainRootAction * - * @since TODO + * @since 2.200, unrestricted since TODO */ @Extension(ordinal = JenkinsLocationConfiguration.ORDINAL-1) // sort just below the regular location config +@Restricted(Beta.class) @Symbol("resourceRoot") public final class ResourceDomainConfiguration extends GlobalConfiguration {
Switching to Beta at @daniel-beck’s suggestion.
jenkinsci_jenkins
train
java
ffa50d56b52358c0d1b873cf657c86f7342f46c8
diff --git a/config/config.php b/config/config.php index <HASH>..<HASH> 100644 --- a/config/config.php +++ b/config/config.php @@ -190,6 +190,12 @@ return [ /* * Automatic Persisted Queries (APQ) * See https://www.apollographql.com/docs/apollo-server/performance/apq/ + * + * Note 1: this requires the `AutomaticPersistedQueriesMiddleware` being enabled + * + * Note 2: even if APQ is disabled per configuration and, according to the "APQ specs" (see above), + * to return a correct response in case it's not enabled, the middleware needs to be active. + * Of course if you know you do not have a need for APQ, feel free to remove the middleware completely. */ 'apq' => [ // Enable/Disable APQ - See https://www.apollographql.com/docs/apollo-server/performance/apq/#disabling-apq @@ -210,6 +216,7 @@ return [ */ 'execution_middleware' => [ \Rebing\GraphQL\Support\ExecutionMiddleware\ValidateOperationParamsMiddleware::class, + // AutomaticPersistedQueriesMiddleware listed even if APQ is disabled, see the docs for the `'apq'` configuration \Rebing\GraphQL\Support\ExecutionMiddleware\AutomaticPersistedQueriesMiddleware::class, \Rebing\GraphQL\Support\ExecutionMiddleware\AddAuthUserContextValueMiddleware::class, // \Rebing\GraphQL\Support\ExecutionMiddleware\UnusedVariablesMiddleware::class,
Clarify the behaviour of AutomaticPersistedQueriesMiddleware
rebing_graphql-laravel
train
php
f430729662003c8ffdc70b0e8bc2a8ebcf78d673
diff --git a/spec/lib/reportsv2_spec.rb b/spec/lib/reportsv2_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/reportsv2_spec.rb +++ b/spec/lib/reportsv2_spec.rb @@ -96,7 +96,7 @@ describe 'ReportsV2' do it 'revision has not changed' do reports = TogglV8::ReportsV2.new(api_token: Testing::API_TOKEN) reports.workspace_id = @workspace_id - expect(reports.revision).to eq "0.0.38\n-8a007ca" + expect(reports.revision).to start_with "0.0.38\n" end end @@ -237,7 +237,7 @@ describe 'ReportsV2' do end end - context 'XLS reports' do + context 'XLS reports', :pro_account do it 'summary' do filename = File.join(@tmp_home, 'summary.xls') summary = @reports.write_summary(filename) @@ -251,4 +251,4 @@ describe 'ReportsV2' do end end end -end \ No newline at end of file +end
XLS reports are :pro_account. Only expect reports.revision prefix.
kanet77_togglv8
train
rb
76d98f4405635b979c700b1a07afd7d4512132b3
diff --git a/src/geshi/powershell.php b/src/geshi/powershell.php index <HASH>..<HASH> 100644 --- a/src/geshi/powershell.php +++ b/src/geshi/powershell.php @@ -264,7 +264,7 @@ $language_data = array ( 'PARSER_CONTROL' => array( 'KEYWORDS' => array( 4 => array( - 'DISALLOWED_AFTER' => '(?![a-zA-Z])' + 'DISALLOWED_AFTER' => '(?![a-zA-Z])', 'DISALLOWED_BEFORE' => '' ), 6 => array(
fix: Missing comma in Parser Control
GeSHi_geshi-1.0
train
php
c624121172c2994c51118f424148bb05fe97f97e
diff --git a/src/OAuth/ServiceAbstract.php b/src/OAuth/ServiceAbstract.php index <HASH>..<HASH> 100644 --- a/src/OAuth/ServiceAbstract.php +++ b/src/OAuth/ServiceAbstract.php @@ -95,6 +95,26 @@ abstract class ServiceAbstract implements InjectionAwareInterface } /** + * Returns access token for current service + * + * @return \OAuth\Common\Token\TokenInterface + */ + public function getAccessToken() + { + return $this->sessionStorage->retrieveAccessToken($this->getServiceName()); + } + + /** + * Returns authorization state for current service + * + * @return string + */ + public function getAuthorizationState() + { + return $this->sessionStorage->retrieveAuthorizationState($this->getServiceName()); + } + + /** * Returns the name of current service * * @return mixed
Added retrieving access token and authorization state to ServiceAbstract;
vegas-cmf_oauth
train
php
467baf7d968c6a5ba1fb23c48ddf53672c900bc6
diff --git a/examples/excepthook.py b/examples/excepthook.py index <HASH>..<HASH> 100644 --- a/examples/excepthook.py +++ b/examples/excepthook.py @@ -3,4 +3,5 @@ import daiquiri daiquiri.setup(set_excepthook=False) logger = daiquiri.getLogger(__name__) -raise Exception("Something went wrong") # This exception will not pass through Daiquiri +# This exception will not pass through Daiquiri: +raise Exception("Something went wrong")
Reformats the excepthook example to appease flake8's line length constraint.
jd_daiquiri
train
py