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
41d04f7ef5bef7828a4a16975a902426cc9aab25
diff --git a/src/Core/View/Template/BasicTemplate.php b/src/Core/View/Template/BasicTemplate.php index <HASH>..<HASH> 100644 --- a/src/Core/View/Template/BasicTemplate.php +++ b/src/Core/View/Template/BasicTemplate.php @@ -47,7 +47,8 @@ class BasicTemplate extends Template ob_end_clean(); if ($this->parent) { - $fileParent = $this->parent.Template::$extension; + $fileParent = str_replace(".", "/", $this->parent); + $fileParent = $fileParent.Template::$extension; $parent = new BasicTemplate($this->locView, $fileParent, $this->variableCollector, $this->converter); $parent->setContentParent($this->contentParent); return $parent->render();
include parent can use separator dot
jayacode_framework
train
php
f6a0cb6feb029ddc96577af99d8d87111cc7bbcb
diff --git a/tofu/geom/inputs/WEST_get_details_from_excel.py b/tofu/geom/inputs/WEST_get_details_from_excel.py index <HASH>..<HASH> 100644 --- a/tofu/geom/inputs/WEST_get_details_from_excel.py +++ b/tofu/geom/inputs/WEST_get_details_from_excel.py @@ -341,7 +341,7 @@ def get_all( out = pd.read_excel(pfe, sheet_name='Main', header=[0, 1]) # Add split LFS thermal shield - dnames.update( get_PEI_LFS( + dnames.update(get_PEI_LFS( np.array([ out['IVPP LFS\n//IVPP_LFS//']['R (m)'], out['IVPP LFS\n//IVPP_LFS//']['Z (m)'],
[Issue<I>_WESTDetails] PEP8 compliance 1
ToFuProject_tofu
train
py
e71cec4d3797126f48c16181abb399b57151be35
diff --git a/erizo_controller/erizoJS/models/Subscriber.js b/erizo_controller/erizoJS/models/Subscriber.js index <HASH>..<HASH> 100644 --- a/erizo_controller/erizoJS/models/Subscriber.js +++ b/erizo_controller/erizoJS/models/Subscriber.js @@ -38,7 +38,7 @@ class Subscriber extends NodeClass { } _onMediaStreamEvent(mediaStreamEvent) { - if (mediaStreamEvent.mediaStreamId !== this.streamId) { + if (mediaStreamEvent.mediaStreamId !== this.erizoStreamId) { return; } if (mediaStreamEvent.type === 'slideshow_fallback_update') {
Fix stream used for check - should use the one for the stream in erizo (#<I>)
lynckia_licode
train
js
13c79e17bdcb03a2068e029a2c4393e02a4e7cc3
diff --git a/bitrise/setup.go b/bitrise/setup.go index <HASH>..<HASH> 100644 --- a/bitrise/setup.go +++ b/bitrise/setup.go @@ -14,8 +14,8 @@ import ( ) const ( - minEnvmanVersion = "1.1.12" - minStepmanVersion = "0.9.40" + minEnvmanVersion = "1.1.13" + minStepmanVersion = "0.9.41" ) // PluginDependency .. @@ -28,19 +28,19 @@ type PluginDependency struct { var PluginDependencyMap = map[string]PluginDependency{ "init": PluginDependency{ Source: "https://github.com/bitrise-core/bitrise-plugins-init.git", - MinVersion: "1.0.1", + MinVersion: "1.0.2", }, "step": PluginDependency{ Source: "https://github.com/bitrise-core/bitrise-plugins-step.git", - MinVersion: "0.9.5", + MinVersion: "0.9.6", }, "workflow-editor": PluginDependency{ Source: "https://github.com/bitrise-io/bitrise-workflow-editor.git", - MinVersion: "1.1.14", + MinVersion: "1.1.16", }, "analytics": PluginDependency{ Source: "https://github.com/bitrise-core/bitrise-plugins-analytics.git", - MinVersion: "0.9.11", + MinVersion: "0.9.12", }, }
tool and plugin version updates (#<I>)
bitrise-io_bitrise
train
go
db394cdc8968e4fa3f849a5d0fc9aca8569f25c9
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -33,7 +33,7 @@ class Screenshot { const { waitForFunction, waitUntil, screenshotConfig, viewportConfig, emulateConfig, - disableJS, waitFor, + disableJS, waitFor, selector, } = this.config; if (screenshotConfig.path) screenshotConfig.path = screenshotConfig.path.replace(/\?.*\./, '.'); // ? Symbol will cause windows user cannot save file @@ -48,9 +48,23 @@ class Screenshot { await checkBeforeRun(waitForFunction, page.waitForFunction.bind(page)); await checkBeforeRun(waitFor, page.waitFor.bind(page)); - const pic = await page.screenshot(screenshotConfig); + async function takeScreenshot() { + if (selector) { + delete screenshotConfig.fullPage; + const element = await page.$(selector); + + if (!element) throw new Error(`element selector "${selector}" can not find any element`); + + return element.screenshot(screenshotConfig); + } else { + return page.screenshot(screenshotConfig); + } + } + + const pic = await takeScreenshot(); page.close(); + return pic; } @@ -62,6 +76,7 @@ class Screenshot { waitUntil: null, waitFor: null, viewportConfig: null, + selector: null, screenshotConfig: { quality: 80, type: 'jpeg',
feature - take screenshot from page element fix #<I>
Runjuu_page2image
train
js
15fb57d88e7b6dc4fddbf0824bc2462dd7227881
diff --git a/ArgusWeb/app/js/directives/controls/date.js b/ArgusWeb/app/js/directives/controls/date.js index <HASH>..<HASH> 100644 --- a/ArgusWeb/app/js/directives/controls/date.js +++ b/ArgusWeb/app/js/directives/controls/date.js @@ -17,9 +17,9 @@ angular.module('argus.directives.controls.date', []) dropdownSelector: '.my-toggle-select', minuteStep: 1 }; - + $scope.onSetTime = function(newDate, oldDate) { - $scope.controlValue = $filter('date')(newDate, "short"); + $scope.ctrlVal = $filter('date')(newDate, "short"); }; }, require: '^agDashboard',
fix date control for calendar picker.
salesforce_Argus
train
js
a5b28ae3ef08d862e08add19e95106c374414555
diff --git a/lib/resources/watermeter/watermeter.js b/lib/resources/watermeter/watermeter.js index <HASH>..<HASH> 100644 --- a/lib/resources/watermeter/watermeter.js +++ b/lib/resources/watermeter/watermeter.js @@ -88,9 +88,9 @@ function PerfbarCore(coreIdx) { blendedOtherHeight = perfectOtherHeight; } else { - blendedUserHeight = (3*this.pbUserHeight + 2*perfectUserHeight) / 5; - blendedSystemHeight = (3*this.pbSystemHeight + 2*perfectSystemHeight) / 5; - blendedOtherHeight = (3*this.pbOtherHeight + 2*perfectOtherHeight) / 5; + blendedUserHeight = (this.pbUserHeight + perfectUserHeight) / 2; + blendedSystemHeight = (this.pbSystemHeight + perfectSystemHeight) / 2; + blendedOtherHeight = (this.pbOtherHeight + perfectOtherHeight) / 2; } var blendedIdleHeight = saturate0(PB_PIXEL_HEIGHT - (blendedUserHeight + blendedSystemHeight + blendedOtherHeight));
Change history and instantaneous smoothing blend from 3:2 to 1:1.
h2oai_h2o-2
train
js
c566480812645b460f2313f653dce7527a324d4b
diff --git a/lib/pronto/phpcs.rb b/lib/pronto/phpcs.rb index <HASH>..<HASH> 100644 --- a/lib/pronto/phpcs.rb +++ b/lib/pronto/phpcs.rb @@ -3,8 +3,15 @@ require 'shellwords' module Pronto class Phpcs < Runner + def initialize(_, _ = nil) + super + + @executable = ENV['PRONTO_PHPCS_EXECUTABLE'] || 'phpcs' + @standard = ENV['PRONTO_PHPCS_STANDARD'] || 'PSR2' + end + def run - return [] if !@patches + return [] unless @patches @patches.select { |patch| valid_patch?(patch) } .map { |patch| inspect(patch) } @@ -25,7 +32,9 @@ module Pronto def run_phpcs(path) escaped_path = Shellwords.escape(path) - JSON.parse(`phpcs #{escaped_path} --report=json`) + escaped_standard = Shellwords.escape(@standard) + + JSON.parse(`#{@executable} #{escaped_path} --report=json --standard=#{escaped_standard}`) .fetch('files', {}) .fetch(path, {}) .fetch('messages', [])
Implement configurable executable path and standard via environment vars Closes #1 Closes #2
ellisv_pronto-phpcs
train
rb
7950b19244fe948619cb0662be5a0044fffe0436
diff --git a/lib/chef/api_client_v1.rb b/lib/chef/api_client_v1.rb index <HASH>..<HASH> 100644 --- a/lib/chef/api_client_v1.rb +++ b/lib/chef/api_client_v1.rb @@ -26,6 +26,7 @@ require 'chef/search/query' require 'chef/exceptions' require 'chef/mixin/api_version_request_handling' require 'chef/server_api' +require 'chef/api_client' # COMPATIBILITY NOTE # @@ -214,6 +215,10 @@ class Chef response = http_api.get("clients/#{name}") if response.kind_of?(Chef::ApiClientV1) response + # stupid automated object generation. + # just give me the json :( + elsif response.kind_of?(Chef::ApiClient) + json_create(response.to_json) else json_create(response) end
Fix automated object generation from HTTP layer in ApiClient.
chef_chef
train
rb
187863739bd86d93fbd8b0c1224ed0bca06d8713
diff --git a/library/src/com/twotoasters/jazzylistview/JazzyListView.java b/library/src/com/twotoasters/jazzylistview/JazzyListView.java index <HASH>..<HASH> 100644 --- a/library/src/com/twotoasters/jazzylistview/JazzyListView.java +++ b/library/src/com/twotoasters/jazzylistview/JazzyListView.java @@ -78,8 +78,6 @@ public class JazzyListView extends ListView implements OnScrollListener { int lastVisibleItem = firstVisibleItem + visibleItemCount - 1; if (IS_AT_LEAST_HC && mIsScrolling && shouldAnimateItems) { - // TODO: make sure no items get skipped when scrolling quickly - // TODO: don't animate twice if scroll one direction then the other int indexAfterFirst = 0; while(firstVisibleItem + indexAfterFirst < mFirstVisibleItem) { Log.v(TAG, "Scrolled to reveal new item(s) ABOVE");
Remove TODOs that have been completed
twotoasters_JazzyListView
train
java
abe8c5916526256c218d34b2599dc90104ccc556
diff --git a/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OAbstractPaginatedStorage.java b/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OAbstractPaginatedStorage.java index <HASH>..<HASH> 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OAbstractPaginatedStorage.java +++ b/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OAbstractPaginatedStorage.java @@ -2555,8 +2555,8 @@ public abstract class OAbstractPaginatedStorage extends OStorageAbstract checkLowDiskSpaceRequestsAndReadOnlyConditions(); - return atomicOperationsManager - .calculateInsideAtomicOperation(null, atomicOperation -> removeKeyFromIndexInternal(atomicOperation, internalIndexId, key)); + return atomicOperationsManager.calculateInsideAtomicOperation(null, + atomicOperation -> removeKeyFromIndexInternal(atomicOperation, internalIndexId, key)); } finally { stateLock.releaseReadLock(); } @@ -2788,8 +2788,6 @@ public abstract class OAbstractPaginatedStorage extends OStorageAbstract indexId = extractInternalId(indexId); try { - assert transaction.get() == null; - checkOpenness(); stateLock.acquireReadLock();
Transaction is split by component operations. Tests failure fix p5.
orientechnologies_orientdb
train
java
b07438511ef317c67296cb4eae7dba631d5cac06
diff --git a/test/thrift_client_test.rb b/test/thrift_client_test.rb index <HASH>..<HASH> 100644 --- a/test/thrift_client_test.rb +++ b/test/thrift_client_test.rb @@ -7,11 +7,15 @@ class ThriftClientTest < Test::Unit::TestCase @socket = 1461 @timeout = 0.2 @options = {:protocol_extra_params => [false]} - @server_thread = Thread.new { Greeter::Server.new("1463").serve } + @pid = Process.fork do + Signal.trap("INT") { exit } + Greeter::Server.new("1463").serve + end end def teardown - @server_thread.kill + Process.kill("INT", @pid) + Process.wait end def test_live_server
fork instead of using green threads
twitter_thrift_client
train
rb
16316ddeda263eb6ce33a217fe176aca4af055d8
diff --git a/lib/Widget/Error.php b/lib/Widget/Error.php index <HASH>..<HASH> 100644 --- a/lib/Widget/Error.php +++ b/lib/Widget/Error.php @@ -365,7 +365,7 @@ class Error extends AbstractWidget public function getGet() { $get = array(); - foreach ($this->get as $key => $value) { + foreach ($this->query as $key => $value) { if (is_array($value)) { $value = var_export($value, true); }
fixed call to not found widget in error widget
twinh_wei
train
php
9ca2082a033d77990c1813db3e24ff8ea7bfa0ff
diff --git a/utils/replace-html-placeholders.js b/utils/replace-html-placeholders.js index <HASH>..<HASH> 100644 --- a/utils/replace-html-placeholders.js +++ b/utils/replace-html-placeholders.js @@ -1,9 +1,8 @@ const assets = require('../html-scripts'); const sanitizeAppEnvironment = require('./sanitize-app-environment'); -const getGtmTrackingScript = tracking => { - const gtmId = tracking.gtm; - if (gtmId === 'false') return ''; +const getGtmTrackingScript = gtmId => { + if (!gtmId) return ''; const url = `https://www.googletagmanager.com/gtm.js?id=${gtmId}`; return ` <script async type="text/javascript" src="${url}"></script> @@ -24,7 +23,7 @@ const replaceHtmlPlaceholders = (indexHtmlContent, config) => ) .replace( new RegExp('__GTM_SCRIPT__', 'g'), - getGtmTrackingScript(config.tracking) + getGtmTrackingScript(config.trackingGtm) ) .replace(new RegExp('__DATALAYER_JS__', 'g'), assets.dataLayer) .replace(new RegExp('__LOADING_SCREEN_JS__', 'g'), assets.loadingScreen);
chore(k8s): declare env.json config for k8s Deployment
commercetools_merchant-center-application-kit
train
js
ca639cdd9691de5f29ca2b5cfa0184176360ce96
diff --git a/lib/marshal.js b/lib/marshal.js index <HASH>..<HASH> 100644 --- a/lib/marshal.js +++ b/lib/marshal.js @@ -257,9 +257,9 @@ Marshal = (function () { return this; }; - Marshal.prototype.dump = function () { - return this.toString(); - }; + // Marshal.prototype.dump = function () { + // //TODO + // }; Marshal.prototype.toString = function (encoding) { return this.buffer.toString(encoding || 'base64');
Removed incompatible Marshal.dump() from library and reserved for possible future dump capability.
clayzermk1_node-marshal
train
js
ec6ceec03e3f4a66a124581f3d7963699e37eef0
diff --git a/lib/esformatter.js b/lib/esformatter.js index <HASH>..<HASH> 100644 --- a/lib/esformatter.js +++ b/lib/esformatter.js @@ -39,6 +39,7 @@ function format(str, opts){ var ast = rocambole.parse(str); _ws.sanitizeWhiteSpaces( ast.startToken ); rocambole.moonwalk(ast, transformNode); + _indent.sanitize( ast.startToken ); if (process.env.npm_config_tokens) { var token = ast.startToken; diff --git a/lib/util/indent.js b/lib/util/indent.js index <HASH>..<HASH> 100644 --- a/lib/util/indent.js +++ b/lib/util/indent.js @@ -69,6 +69,21 @@ function inBetween (startToken, endToken, indentLevel) { } +exports.sanitize = sanitize; +function sanitize(startToken) { + var token = startToken; + while (token) { + var next = token.next; + // original indent don't have a "indentLevel" value + // we also need to remove any indent that happens after a token that + // isn't a line break + if ( token.type === 'Indent' && + ( token.indentLevel == null || !_tk.isBr(token.prev) ) ) { + _tk.remove(token); + } + token = next; + } +} // ---
sanitize indents after whole formatting. this **causes even more tests to fail** but it is the "right thing" to do. it will help spot brittle hooks and enhance the chance of the hooks actually working as expected in different scenarios.
millermedeiros_esformatter
train
js,js
bb78878767b96d411e740439ac820f118e95ae2f
diff --git a/transport/control.go b/transport/control.go index <HASH>..<HASH> 100644 --- a/transport/control.go +++ b/transport/control.go @@ -126,7 +126,7 @@ type quotaPool struct { c chan int mu sync.Mutex - version uint64 + version uint32 quota int } @@ -183,17 +183,17 @@ func (qb *quotaPool) addAndUpdate(v int) { // compareAndExecute is processing, this function doesn't // get executed partially (quota gets updated but the version // doesn't). - atomic.AddUint64(&(qb.version), 1) + atomic.AddUint32(&(qb.version), 1) } -func (qb *quotaPool) acquireWithVersion() (<-chan int, uint64) { - return qb.c, atomic.LoadUint64(&(qb.version)) +func (qb *quotaPool) acquireWithVersion() (<-chan int, uint32) { + return qb.c, atomic.LoadUint32(&(qb.version)) } -func (qb *quotaPool) compareAndExecute(version uint64, success, failure func()) bool { +func (qb *quotaPool) compareAndExecute(version uint32, success, failure func()) bool { qb.mu.Lock() defer qb.mu.Unlock() - if version == atomic.LoadUint64(&(qb.version)) { + if version == atomic.LoadUint32(&(qb.version)) { success() return true }
Change quota version to uint<I> instead on uint<I> (#<I>)
grpc_grpc-go
train
go
af112f67c994bcf037c291d266be32c4ec9f1bbb
diff --git a/src/Classifiers/ControllerClassifier.php b/src/Classifiers/ControllerClassifier.php index <HASH>..<HASH> 100644 --- a/src/Classifiers/ControllerClassifier.php +++ b/src/Classifiers/ControllerClassifier.php @@ -2,7 +2,6 @@ namespace Wnx\LaravelStats\Classifiers; -use Illuminate\Routing\Router; use Wnx\LaravelStats\ReflectionClass; use Wnx\LaravelStats\Contracts\Classifier; @@ -15,12 +14,20 @@ class ControllerClassifier implements Classifier public function satisfies(ReflectionClass $class) { - return collect(resolve(Router::class)->getRoutes()) + return collect(app('router')->getRoutes()) ->reject(function ($route) { - return $route->getActionName() === 'Closure'; + if (method_exists($route, 'getActionName')) { + return $route->getActionName() === 'Closure'; + } + + return data_get($route, 'action.uses') === null; }) ->map(function ($route) { - return get_class($route->getController()); + if (method_exists($route, 'getController')) { + return get_class($route->getController()); + } + + return str_before(data_get($route, 'action.uses'), '@'); }) ->unique() ->contains($class->getName());
Adjust controller classifier to support lumen
stefanzweifel_laravel-stats
train
php
97bc84d4c17b61d72a616092ae49552061ea7088
diff --git a/lib/bridges/tiny_mce/lib/tiny_mce_bridge.rb b/lib/bridges/tiny_mce/lib/tiny_mce_bridge.rb index <HASH>..<HASH> 100644 --- a/lib/bridges/tiny_mce/lib/tiny_mce_bridge.rb +++ b/lib/bridges/tiny_mce/lib/tiny_mce_bridge.rb @@ -20,7 +20,7 @@ ActiveScaffold.ActionLink.Abstract.prototype.close = function() { options[:class] = "#{options[:class]} mceEditor #{column.options[:class]}".strip html = [] html << send(override_input(:textarea), column, options) - html << javascript_tag("tinyMCE.execCommand('mceAddControl', false, '#{options[:id]}');") if request.xhr? + html << javascript_tag("tinyMCE.execCommand('mceAddControl', false, '#{options[:id]}');") if request.xhr? || params[:iframe] html.join "\n" end
Fix reloading tinymce when form is submitted to an iframe with errors
activescaffold_active_scaffold
train
rb
b9b5f870d0e757866ec3951a6c71fce7be6a4fdf
diff --git a/denki-deba.js b/denki-deba.js index <HASH>..<HASH> 100644 --- a/denki-deba.js +++ b/denki-deba.js @@ -1,6 +1,6 @@ -var denkiDeba = (function() { - let deba = (typeof require === 'function') ? require('deba') : deba; +var deba = (typeof require === 'function') ? require('deba') : deba; +var denkiDeba = (function() { var matchers = [ { "finder": "#super_frame > #monster_frame > #content_frame", @@ -59,9 +59,9 @@ var denkiDeba = (function() { } ]; - function matcherFor(document) { + function matcherFor(element) { for(const matcher of matchers) { - const matchedElement = document.querySelector(matcher.finder); + const matchedElement = element.closest ? element.closest(matcher.finder) : element.querySelector(matcher.finder); if(matchedElement) return [matchedElement, matcher]; } } @@ -83,8 +83,8 @@ var denkiDeba = (function() { }; } - return function(document) { - return executeMatcher(matcherFor(document)); + return function(element) { + return executeMatcher(matcherFor(element)); }; })();
Fix scope of deba variable so it is available in both Node.js and the browser; Allow denkiDeba to be called with a DOM node or the DOM document itself; if a DOM node is passed, see if the finder matches the element or any of it's ancestors
bloopletech_text-kitchen
train
js
ff612aee49deb31d65effdfadd6e98aef6d6308e
diff --git a/lib/podio/models/item.rb b/lib/podio/models/item.rb index <HASH>..<HASH> 100644 --- a/lib/podio/models/item.rb +++ b/lib/podio/models/item.rb @@ -200,8 +200,13 @@ class Podio::Item < ActivePodio::Base Podio.connection.post("/item/app/#{app_id}/cleanup_field_values").body end - def move_in_card_view(id) - Podio.connection.post("/item/#{id}/cardview").body + def rearrange(id, attributes) + response = Podio.connection.post do |req| + req.url "/item/#{id}/rearrange" + req.body = attributes + end + + member response.body end protected
Adjustments to the move method that has been renamed to rearrange and will now include a body and return a member.
podio_podio-rb
train
rb
0d9a831255a4608a2ff63b127f8f9ff9562e3fb3
diff --git a/src/Illuminate/Mail/Transport/MandrillTransport.php b/src/Illuminate/Mail/Transport/MandrillTransport.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Mail/Transport/MandrillTransport.php +++ b/src/Illuminate/Mail/Transport/MandrillTransport.php @@ -53,6 +53,7 @@ class MandrillTransport extends Transport } else { $options = ['body' => $data]; } + $options['connect_timeout'] = 60; return $this->client->post('https://mandrillapp.com/api/1.0/messages/send-raw.json', $options); }
add connect_timeout:<I> to MandrillTransport
laravel_framework
train
php
38c64a5b37521abd87d5290def2344ae52455094
diff --git a/tests/test_variables.py b/tests/test_variables.py index <HASH>..<HASH> 100644 --- a/tests/test_variables.py +++ b/tests/test_variables.py @@ -200,7 +200,9 @@ TEST_PHOTO_ITEM = { { "width": 612, "height": 612, - "url": "https://scontent-amt2-1.cdninstagram.com/v/t51.2885-15/sh0.08/e35/p750x750/76844872_823008174880077_8222147620082298446_n.jpg?_nc_ht=scontent-amt2-1.cdninstagram.com&_nc_cat=109&_nc_ohc=WjtkR3IzTS0AX8gN3KJ&oh=5a0762689215a84215b67db9acbace86&oe=5E9240B5", + "url": "https://scontent-amt2-1.cdninstagram.com/vp/9ef94dbf" + + "ea2b8cdb2ba5c9b45f1945fd/5AEFE328/t51.2885-15/e15/11137637_" + + "1567371843535625_96536034_n.jpg?ig_cache_key=MTIzNA%3D%3D.2", }, { "width": 240,
revert test, me no likey travis
instagrambot_instabot
train
py
093642989fe4a85f9ccf97b15d0ab3ad436a326d
diff --git a/src/main/java/org/jcodec/codecs/h264/encode/MotionEstimator.java b/src/main/java/org/jcodec/codecs/h264/encode/MotionEstimator.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jcodec/codecs/h264/encode/MotionEstimator.java +++ b/src/main/java/org/jcodec/codecs/h264/encode/MotionEstimator.java @@ -317,6 +317,8 @@ public class MotionEstimator { // Search area 1: mb predictor startX = (mbX << 4) + (mvpx >> 2); startY = (mbY << 4) + (mvpy >> 2); + // for now + break; } return new int[] { mvS0 < mvS1 ? mvX0 : mvX1, mvS0 < mvS1 ? mvY0 : mvY1};
[h<I>_enc] Disabling dual SA for now
jcodec_jcodec
train
java
4b19ac236c84b4bdac0f28ce9ac02605428e4595
diff --git a/lib/slimmer/test_template.rb b/lib/slimmer/test_template.rb index <HASH>..<HASH> 100644 --- a/lib/slimmer/test_template.rb +++ b/lib/slimmer/test_template.rb @@ -19,12 +19,13 @@ module Slimmer::TestTemplate <script src="http://static.preview.alphagov.co.uk/static/jquery.tabs.js" defer></script> </head> <body> - <nav role="navigation" class="header-context"> - <ol class="group"> - <li><a href="/">Home</a></li> - <li><a href="/browse">All sections</a></li> - </ol> - </nav> + <div class="header-context"> + <nav role="navigation"> + <ol class="group"> + <li><a href="/">Home</a></li> + </ol> + </nav> + </div> <div id="wrapper"></div> </body>
Update test breadcrumb markup to match static.
alphagov_slimmer
train
rb
fc60ce3fe17564048a2ce0056ab0ecd0d402892b
diff --git a/io/flushing_writer.go b/io/flushing_writer.go index <HASH>..<HASH> 100644 --- a/io/flushing_writer.go +++ b/io/flushing_writer.go @@ -29,3 +29,8 @@ func (w *FlushingWriter) Write(data []byte) (int, error) { } return n, err } + +// Wrote returns whether the method WriteHeader has been called or not. +func (w *FlushingWriter) Wrote() bool { + return w.wrote +} diff --git a/io/flushing_writer_test.go b/io/flushing_writer_test.go index <HASH>..<HASH> 100644 --- a/io/flushing_writer_test.go +++ b/io/flushing_writer_test.go @@ -52,3 +52,10 @@ func (s *FlushingSuite) TestFlushingWriterWriteHeader(c *gocheck.C) { c.Assert(recorder.Code, gocheck.Equals, expectedCode) c.Assert(writer.wrote, gocheck.Equals, true) } + +func (s *FlushingSuite) TestFlushingWriterWrote(c *gocheck.C) { + writer := FlushingWriter{nil, false} + c.Assert(writer.Wrote(), gocheck.Equals, false) + writer.wrote = true + c.Assert(writer.Wrote(), gocheck.Equals, true) +}
io: export FlushingWriter.wrote via method
tsuru_tsuru
train
go,go
50db2f2153fca694371f37ac87a46e33e62f5704
diff --git a/src/IMenu.php b/src/IMenu.php index <HASH>..<HASH> 100644 --- a/src/IMenu.php +++ b/src/IMenu.php @@ -24,6 +24,6 @@ interface IMenu extends IMenuItemsContainer public function getActivePresenter(): ?Presenter; - public function setActivePresenter(?Presenter $link): void; + public function setActivePresenter(Presenter $link): void; } diff --git a/src/Menu.php b/src/Menu.php index <HASH>..<HASH> 100644 --- a/src/Menu.php +++ b/src/Menu.php @@ -101,7 +101,7 @@ final class Menu extends AbstractMenuItemsContainer implements IMenu return $this->activePresenter; } - public function setActivePresenter(?Presenter $presenter): void + public function setActivePresenter(Presenter $presenter): void { $this->activePresenter = $presenter; }
Menu: changed setActivePresenter() method to not allow nulls
Carrooi_Nette-Menu
train
php,php
0ea347c1be272320003389beafc83a3ec03fbfea
diff --git a/pyprophet/config.py b/pyprophet/config.py index <HASH>..<HASH> 100644 --- a/pyprophet/config.py +++ b/pyprophet/config.py @@ -88,7 +88,8 @@ def fix_config_types(dd): "num_processes"]: dd[k] = int(dd[k]) - for k in ["xeval.fraction", + for k in ["decoy.missing", + "xeval.fraction", "train.fraction", "semi_supervised_learner.initial_fdr", "semi_supervised_learner.initial_lambda", diff --git a/pyprophet/main.py b/pyprophet/main.py index <HASH>..<HASH> 100644 --- a/pyprophet/main.py +++ b/pyprophet/main.py @@ -71,7 +71,7 @@ def _main(args): options = dict() path = None - print "PyProphet, DIANA edition - built Tue May 13 11:08:56 CEST 2014" + print "PyProphet, DIANA edition - built Tue May 27 15:52:00 CEST 2014" if "--help" in args: print_help()
Added functionality for correcting p-values for missing decoys
PyProphet_pyprophet
train
py,py
08fd9a6491b2be65727199e9fa186fc939a64965
diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb index <HASH>..<HASH> 100644 --- a/railties/test/isolation/abstract_unit.rb +++ b/railties/test/isolation/abstract_unit.rb @@ -89,6 +89,10 @@ module TestHelpers end end + unless options[:gemfile] + File.delete"#{app_path}/Gemfile" + end + routes = File.read("#{app_path}/config/routes.rb") if routes =~ /(\n\s*end\s*)\Z/ File.open("#{app_path}/config/routes.rb", 'w') do |f|
Remove the generated gemfile in railties tests since the rails gemfile is used.
rails_rails
train
rb
b78ab6c79068cbe080b9e893ad91eded0f8f7b01
diff --git a/src/Common/Traits/GetCountCommon.php b/src/Common/Traits/GetCountCommon.php index <HASH>..<HASH> 100644 --- a/src/Common/Traits/GetCountCommon.php +++ b/src/Common/Traits/GetCountCommon.php @@ -431,7 +431,7 @@ trait GetCountCommon // And reduce $aWhereStr to an actual string, like the name suggests if (!empty($aWhereStr)) { $aWhereStr = implode(' AND ', $aWhereStr); - $oDb->where($aWhereStr); + $oDb->where($aWhereStr, null, false); } } }
Prevent auto-escaping of where strings Should already have been escaped.
nails_common
train
php
8a3f22c4006549d2c1fd0635c5cd942fe40cea7a
diff --git a/fluent_contents/plugins/twitterfeed/templatetags/twitterfeed_tags.py b/fluent_contents/plugins/twitterfeed/templatetags/twitterfeed_tags.py index <HASH>..<HASH> 100644 --- a/fluent_contents/plugins/twitterfeed/templatetags/twitterfeed_tags.py +++ b/fluent_contents/plugins/twitterfeed/templatetags/twitterfeed_tags.py @@ -4,7 +4,7 @@ from django.utils.safestring import mark_safe try: from twitter_text import TwitterText except ImportError: - raise ImportError("The 'twitter-text-py' package is required to use the 'twitterfeed' plugin.") + raise ImportError("The 'twitter-text' package is required to use the 'twitterfeed' plugin.") register = Library() diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -59,7 +59,7 @@ setup( 'markup': ['docutils', 'textile', 'Markdown>=1.7'], 'oembeditem': ['micawber>=0.3.3', 'beautifulsoup4>=4.3.2'], 'text': ['django-wysiwyg>=0.7.1'], - 'twitterfeed': ['twitter-text-py>=1.0.3'], + 'twitterfeed': ['twitter-text>=3.0'], }, tests_require = [ 'docutils',
Replace twitter-text requirement with Python 3 compatible version
django-fluent_django-fluent-contents
train
py,py
f0c513c918196c0a04d4cfa8ea5378be61cc493b
diff --git a/usb/backend/libusb0.py b/usb/backend/libusb0.py index <HASH>..<HASH> 100644 --- a/usb/backend/libusb0.py +++ b/usb/backend/libusb0.py @@ -634,6 +634,17 @@ class _LibUSB(usb.backend.IBackend): if err.backend_error_code == -errno.ENODATA: return False raise + elif sys.platform == 'darwin': + # on mac os/darwin we assume all users are running libusb-compat, + # which, in turn, uses libusb_kernel_driver_active() + try: + driver_name = self.__get_driver_name(dev_handle, intf) + return True + except USBError as err: + # ENODATA means that no kernel driver is attached + if err.backend_error_code == -errno.ENODATA: + return False + raise elif sys.platform.startswith('freebsd') or sys.platform.startswith('dragonfly'): # this is similar to the Linux implementation, but the generic # driver is called 'ugen' and usb_get_driver_np() simply returns an
libusb0: implement is_kernel_driver_active() for Mac OS Assumes the libusb0 implementation in use is libusb-compat, and depends on libusb_kernel_driver_active() support for that platform (expected in libusb <I>). Fixes: #<I>
pyusb_pyusb
train
py
553b13194b11551d5ae5bbd53fb441c3d91b0991
diff --git a/tensorflow_probability/python/distributions/uniform.py b/tensorflow_probability/python/distributions/uniform.py index <HASH>..<HASH> 100644 --- a/tensorflow_probability/python/distributions/uniform.py +++ b/tensorflow_probability/python/distributions/uniform.py @@ -170,7 +170,8 @@ class Uniform(distribution.Distribution): broadcasted_x, tf.where( tf.logical_or(broadcasted_x < self.low, - broadcasted_x >= self.high), + # This > is only sound for continuous uniform + broadcasted_x > self.high), tf.zeros_like(broadcasted_x), tf.ones_like(broadcasted_x) / self.range()))
Extend the density function of the continuous Uniform distribution to include the upper endpoint. Justification: the measure is the same, and this is very likely to be more convenient to use. PiperOrigin-RevId: <I>
tensorflow_probability
train
py
80997d168f82aa334ec58d585512500a4a9891a9
diff --git a/res/generators/rhogen.rb b/res/generators/rhogen.rb index <HASH>..<HASH> 100644 --- a/res/generators/rhogen.rb +++ b/res/generators/rhogen.rb @@ -1,5 +1,6 @@ require 'rubygems' require 'templater' +require 'thread' #TODO: This is temporary, see https://www.pivotaltracker.com/story/show/3399292 gem "activesupport", "~> 2.3.5" require 'active_support'
fix for gems <I>
rhomobile_rhodes
train
rb
c0c035a49879c6587343bf16f012cb38ef2187de
diff --git a/datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py b/datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py index <HASH>..<HASH> 100644 --- a/datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py +++ b/datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py @@ -733,6 +733,10 @@ class OpenMetricsScraperMixin(object): self.log.warning('Error handling metric: %s - error: %s', metric.name, err) return + # check for wilcards in transformers + for transformer_name, transformer in iteritems(metric_transformers): + if transformer_name.endswith('*') and metric.name.startswith(transformer_name[:-1]): + transformer(metric, scraper_config, transformer_name) # try matching wildcards if scraper_config['_wildcards_re'] and scraper_config['_wildcards_re'].search(metric.name):
Add ability to look for wildcards in Prometheus metric transformers (#<I>) * Update mixins.py * Update datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py
DataDog_integrations-core
train
py
8b98e6aba82f99cda4a746ea6c435dcff26dc525
diff --git a/ariadne/asgi.py b/ariadne/asgi.py index <HASH>..<HASH> 100644 --- a/ariadne/asgi.py +++ b/ariadne/asgi.py @@ -58,9 +58,9 @@ class GraphQL: async def handle_http(self, receive: Receive, send: Send, *, scope: Scope): request = Request(scope=scope, receive=receive) - if request.method == "GET" and not request.query_params.get("query"): + if request.method == "GET": response = await self.render_playground(request) - elif request.method in {"GET", "POST"}: + elif request.method == "POST": response = await self.graphql_http_server(request) else: response = Response(status_code=400)
Temporarily disable query execution over GET
mirumee_ariadne
train
py
af49b75a06cba65e29b68c290ef6bc7a07c3a356
diff --git a/web/concrete/views/image-editor/editor.php b/web/concrete/views/image-editor/editor.php index <HASH>..<HASH> 100644 --- a/web/concrete/views/image-editor/editor.php +++ b/web/concrete/views/image-editor/editor.php @@ -20,7 +20,7 @@ $req->requireAsset('core/imageeditor'); /** @var ImageEditor $editor */ if (!$editor) { - $editor = \Core::make('editor/image'); + $editor = \Core::make('editor/image/core'); } $filters = $editor->getFilterList();
Use the core image editor instance rather than creating a new editor instance. Resolves issue #<I> Former-commit-id: 6ccbadfdadfdedde2e<I>f<I>a<I>b5e6e1fc<I>b6 Former-commit-id: 0d2ebd<I>fc2f9c8d<I>f<I>bafdefd<I>
concrete5_concrete5
train
php
7557c9bd4e65b34d9f1f7307f7841f27ec8d2a78
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -200,13 +200,17 @@ func listen(tcp, utp bool, networkSuffix, addr string) (tcpL net.Listener, utpSo if addr == "" { addr = ":50007" } - host, port, err := missinggo.ParseHostPort(addr) - if err != nil { - return - } - if tcp && utp && port == 0 { - // If both protocols are active, they need to have the same port. - return listenBothSameDynamicPort(networkSuffix, host) + if tcp && utp { + var host string + var port int + host, port, err = missinggo.ParseHostPort(addr) + if err != nil { + return + } + if port == 0 { + // If both protocols are active, they need to have the same port. + return listenBothSameDynamicPort(networkSuffix, host) + } } defer func() { if err != nil { @@ -1405,8 +1409,8 @@ type Handle interface { // magnet URIs and torrent metainfo files. type TorrentSpec struct { // The tiered tracker URIs. - Trackers [][]string - InfoHash metainfo.Hash + Trackers [][]string + InfoHash metainfo.Hash InfoBytes []byte // The name to use if the Name field from the Info isn't available. DisplayName string
Only parse the config listen addr if we have to This fixes a broken benchmark
anacrolix_torrent
train
go
9eb83390544cb2bb8686301fb276f10fca4f46e7
diff --git a/src/main/java/org/primefaces/component/schedule/Schedule.java b/src/main/java/org/primefaces/component/schedule/Schedule.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/primefaces/component/schedule/Schedule.java +++ b/src/main/java/org/primefaces/component/schedule/Schedule.java @@ -132,8 +132,8 @@ public class Schedule extends ScheduleBase { else if (eventName.equals("eventMove")) { String movedEventId = params.get(clientId + "_movedEventId"); ScheduleEvent movedEvent = getValue().getEvent(movedEventId); - int dayDelta = (int) Double.parseDouble(params.get(clientId + "_dayDelta")); - int minuteDelta = (int) Double.parseDouble(params.get(clientId + "_minuteDelta")); + int dayDelta = Double.valueOf(params.get(clientId + "_dayDelta")).intValue(); + int minuteDelta = Double.valueOf(params.get(clientId + "_minuteDelta")).intValue(); Calendar calendar = Calendar.getInstance(); calendar.setTime(movedEvent.getStartDate());
Fix #<I>: Schedule standardize Double to Int conversion
primefaces_primefaces
train
java
b1306bd7a8b3fd9903e026a911e44cd201e69943
diff --git a/tests/test_completion.py b/tests/test_completion.py index <HASH>..<HASH> 100644 --- a/tests/test_completion.py +++ b/tests/test_completion.py @@ -5,6 +5,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. +import os from subprocess import PIPE, run import pytest @@ -29,6 +30,9 @@ def test_fish(): pytest.xfail('fish is not installed') [email protected]( + os.name == 'nt', reason="Windows CI workers have bash but are best left alone" +) def test_bash(): try: proc = run(
tests: skip test_bash on Windows
jbarlow83_OCRmyPDF
train
py
63fe4e87faf7143526fa0c8cf8a7b5a74009e9d7
diff --git a/state/apiserver/upgrader/upgrader.go b/state/apiserver/upgrader/upgrader.go index <HASH>..<HASH> 100644 --- a/state/apiserver/upgrader/upgrader.go +++ b/state/apiserver/upgrader/upgrader.go @@ -118,6 +118,10 @@ func (u *UpgraderAPI) SetTools(args params.SetAgentTools) (params.SetAgentToolsR if !u.authorizer.AuthOwner(tools.Tag) { err = common.ErrPerm } else { + // TODO: When we get there, we should support setting + // Unit agent tools as well as Machine tools. We + // can use something like the "AgentState" + // interface that cmd/jujud/agent.go had. machine, err := u.st.Machine(state.MachineIdFromTag(tools.Tag)) if err == nil { stTools := state.Tools{
Comment about AgentState for the SetTools API.
juju_juju
train
go
a83af7f66243fd38aaf6c4c779c67953f82aa7a6
diff --git a/numerapi/numerapi.py b/numerapi/numerapi.py index <HASH>..<HASH> 100644 --- a/numerapi/numerapi.py +++ b/numerapi/numerapi.py @@ -1242,7 +1242,7 @@ class NumerAPI(base_api.Api): return stake def stake_change(self, nmr, action: str = "decrease", - model_id: str = None) -> Dict: + model_id: str = None, tournament: int = 8) -> Dict: """Change stake by `value` NMR. Args: @@ -1271,10 +1271,12 @@ class NumerAPI(base_api.Api): query = ''' mutation($value: String! $type: String! + $tournamentNumber: Int! $modelId: String) { v2ChangeStake(value: $value type: $type - modelId: $modelId) { + modelId: $modelId + tournamentNumber: $tournamentNumber) { dueDate requestedAmount status @@ -1282,7 +1284,7 @@ class NumerAPI(base_api.Api): } } ''' - arguments = {'value': str(nmr), 'type': action, 'modelId': model_id} + arguments = {'value': str(nmr), 'type': action, 'modelId': model_id, 'tournamentNumber': tournament} result = self.raw_query(query, arguments, authorization=True) stake = result['data']['v2ChangeStake'] utils.replace(stake, "requestedAmount", utils.parse_float_string)
Fix stake_change call by adding tournamentNumber parameter (#<I>) * Fix stake_change call by adding tournamentNumber parameter * Added type hint and changed tournamentNumber to tournament for consistency
uuazed_numerapi
train
py
8ad52d9d3b912cfe7f8908afc13f4617fa79274f
diff --git a/gridtogssha/framework.py b/gridtogssha/framework.py index <HASH>..<HASH> 100644 --- a/gridtogssha/framework.py +++ b/gridtogssha/framework.py @@ -605,7 +605,7 @@ class GSSHAFramework(object): self.path_to_rapid_qout = self.download_spt_forecast(rapid_qout_directory) #prepare input for GSSHA if user wants - if path_to_rapid_qout is not None: + if self.path_to_rapid_qout is not None: self.prepare_rapid_streamflow(self.path_to_rapid_qout) #---------------------------------------------------------------------- @@ -745,4 +745,4 @@ class GSSHA_WRF_Framework(GSSHAFramework): lsm_file_date_naming_convention, lsm_time_var, lsm_search_card, precip_interpolation_type, output_netcdf) - \ No newline at end of file +
Fix path_to_rapid_qout to self.path_to_rapid_qout
CI-WATER_gsshapy
train
py
c3b806ce8c0740e58e4f3c9c5676acea689d4519
diff --git a/lib/Cake/Controller/Component/SecurityComponent.php b/lib/Cake/Controller/Component/SecurityComponent.php index <HASH>..<HASH> 100644 --- a/lib/Cake/Controller/Component/SecurityComponent.php +++ b/lib/Cake/Controller/Component/SecurityComponent.php @@ -430,8 +430,8 @@ class SecurityComponent extends Component { $multi = array(); foreach ($fieldList as $i => $key) { - if (preg_match('/\.\d+$/', $key)) { - $multi[$i] = preg_replace('/\.\d+$/', '', $key); + if (preg_match('/(\.\d+)+$/', $key)) { + $multi[$i] = preg_replace('/(\.\d+)+$/', '', $key); unset($fieldList[$i]); } }
Prevent blackhole auth error where are present multi fields
cakephp_cakephp
train
php
09c8d3120b17b238d756e87c832179ce879ff0a8
diff --git a/ui/src/shared/components/NewAnnotation.js b/ui/src/shared/components/NewAnnotation.js index <HASH>..<HASH> 100644 --- a/ui/src/shared/components/NewAnnotation.js +++ b/ui/src/shared/components/NewAnnotation.js @@ -122,6 +122,7 @@ class NewAnnotation extends Component { tempAnnotation, tempAnnotation: {startTime, endTime}, } = this.props + const {isMouseOver} = this.state const crosshairOne = Math.max(-1000, dygraph.toDomXCoord(startTime)) const crosshairTwo = dygraph.toDomXCoord(endTime) @@ -161,14 +162,18 @@ class NewAnnotation extends Component { className="new-annotation--crosshair" style={{left: crosshairTwo}} > - {this.renderTimestamp(tempAnnotation.endTime)} + {isMouseOver && + isDragging && + this.renderTimestamp(tempAnnotation.endTime)} <div className={flagTwoClass} /> </div>} <div className="new-annotation--crosshair" style={{left: crosshairOne}} > - {isDragging || this.renderTimestamp(tempAnnotation.startTime)} + {isMouseOver && + !isDragging && + this.renderTimestamp(tempAnnotation.startTime)} <div className={isDragging ? flagOneClass : pointFlagClass} /> </div> </div>
Limit render of new annotation tooltip to the currently hovered graph
influxdata_influxdb
train
js
7b2e636519a831b094e94caaec1c9f79314ce786
diff --git a/app/controllers/letter_bomb/mailers_controller.rb b/app/controllers/letter_bomb/mailers_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/letter_bomb/mailers_controller.rb +++ b/app/controllers/letter_bomb/mailers_controller.rb @@ -13,8 +13,15 @@ module LetterBomb params[:format] ||= content_type_html? ? "html" : "text" respond_to do |format| - format.html - format.text { render formats: [:html], content_type: 'text/html' } + format.html { + render layout: "letter_bomb/application" + } + + format.text { + render layout: "letter_bomb/application", + formats: [:html], + content_type: 'text/html' + } end end
Explicitly render with our layout; some apps override it.
ags_letter_bomb
train
rb
48b40d61f64efc65f5d1c9d7a057cc2d47ef535f
diff --git a/src/Reference/HasOne_SQL.php b/src/Reference/HasOne_SQL.php index <HASH>..<HASH> 100644 --- a/src/Reference/HasOne_SQL.php +++ b/src/Reference/HasOne_SQL.php @@ -226,7 +226,7 @@ class HasOne_SQL extends HasOne } /** @var Field_SQL_Expression $ex */ - $ex = $this->owner->addExpression($field, array_merge_recursive( + $ex = $this->owner->addExpression($field, array_replace_recursive( [ function (Model $m) { $mm = $m->refLink($this->link);
Fix hasOne relation seed processing. It should replace not merge. (#<I>)
atk4_data
train
php
2d9bd436e8b7680fa30338e9fdb7bd8bac54a46a
diff --git a/MenuItem.php b/MenuItem.php index <HASH>..<HASH> 100644 --- a/MenuItem.php +++ b/MenuItem.php @@ -346,23 +346,29 @@ class MenuItem implements ArrayableContract return false; } - $isActive = false; - - if ($this->hasChilds()) { - foreach ($this->getChilds() as $child) { - if ($child->inactive()) { - $isActive = false; - } elseif ($child->isActive()) { - $isActive = true; - } elseif ($child->hasRoute() && $child->getActiveStateFromRoute()) { - $isActive = true; - } elseif ($child->getActiveStateFromUrl()) { - $isActive = true; - } + return $this->hasChilds() ? $this->getActiveStateFromChilds() : false; + } + + /** + * Get active state from child menu items. + * + * @return boolean + */ + public function getActiveStateFromChilds() + { + foreach ($this->getChilds() as $child) { + if ($child->inactive()) { + return false; + } elseif ($child->isActive()) { + return true; + } elseif ($child->hasRoute() && $child->getActiveStateFromRoute()) { + return true; + } elseif ($child->getActiveStateFromUrl()) { + return true; } } - return $isActive; + return false; } /**
extract get active state logic to getActiveStateFromChilds method
pingpong-labs_menus
train
php
f31239c21505a6524938c5e7310c9bd4a4b1cf5d
diff --git a/pymatgen/electronic_structure/dos.py b/pymatgen/electronic_structure/dos.py index <HASH>..<HASH> 100644 --- a/pymatgen/electronic_structure/dos.py +++ b/pymatgen/electronic_structure/dos.py @@ -865,7 +865,7 @@ class CompleteDos(Dos): site: PeriodicSite = None, band: OrbitalType = OrbitalType.d, erange: List[float, float] = None, - ): + ) -> float: """ Get the orbital-projected band width, defined as int_{-inf}^{+inf} rho(E)*(E-E_center) dE/int_{-inf}^{+inf} rho(E) dE @@ -945,7 +945,7 @@ class CompleteDos(Dos): band: OrbitalType = OrbitalType.d, erange: List[float, float] = None, hilbert: bool = True, - ): + ) -> float: """ Get the orbital-projected upper band edge. By default, the definition by Xin et al. Phys. Rev. B, 89, 115114 (2014) is used, which is the highest peak position of the
Add missing type hints in new DOS features
materialsproject_pymatgen
train
py
32c0a1b88ddada89f835624822951078daad52ed
diff --git a/python_modules/libraries/dagster-pandas/setup.py b/python_modules/libraries/dagster-pandas/setup.py index <HASH>..<HASH> 100644 --- a/python_modules/libraries/dagster-pandas/setup.py +++ b/python_modules/libraries/dagster-pandas/setup.py @@ -50,7 +50,7 @@ def _do_setup(name='dagster-pandas'): 'Operating System :: OS Independent', ], packages=find_packages(exclude=['dagster_pandas_tests']), - install_requires=['dagster', 'pandas==0.24.2', 'matplotlib'], + install_requires=['dagster', 'pandas', 'matplotlib'], )
Loosen dep of pandas from dagster-pandas Summary: No reason to make it this strict. Test Plan: BK Reviewers: #ft, max Reviewed By: #ft, max Differential Revision: <URL>
dagster-io_dagster
train
py
54ea2bcb59358c1a46fe8dc7ae9bb30a15291d0e
diff --git a/crafter-search-elasticsearch/src/main/java/org/craftercms/search/elasticsearch/impl/ElasticSearchServiceImpl.java b/crafter-search-elasticsearch/src/main/java/org/craftercms/search/elasticsearch/impl/ElasticSearchServiceImpl.java index <HASH>..<HASH> 100644 --- a/crafter-search-elasticsearch/src/main/java/org/craftercms/search/elasticsearch/impl/ElasticSearchServiceImpl.java +++ b/crafter-search-elasticsearch/src/main/java/org/craftercms/search/elasticsearch/impl/ElasticSearchServiceImpl.java @@ -169,7 +169,13 @@ public class ElasticSearchServiceImpl implements ElasticSearchService { final MultiValueMap<String, String> additionalFields) throws ElasticSearchException { Map<String, Object> doc = documentBuilder.build(siteName, docId, xml, true); if(MapUtils.isNotEmpty(additionalFields)) { - doc.putAll(additionalFields); + additionalFields.forEach((key, value) -> { + if(value.size() == 1) { + doc.put(key, value.get(0)); + } else { + doc.put(key, value); + } + }); } index(indexName, siteName, docId, doc); }
Fix for elasticsearch indexing: - Make sure only fields with multiple values are indexed as lists
craftercms_search
train
java
9ef4598465dcc7f30aed61b22ffadd9fa119e30c
diff --git a/tests/output_unittest.py b/tests/output_unittest.py index <HASH>..<HASH> 100644 --- a/tests/output_unittest.py +++ b/tests/output_unittest.py @@ -7,7 +7,6 @@ validate all capabilities of the formats (e.g., coordinate and projection), and (eventually) test performance of various serializers. """ -import hashlib import os import numpy import struct @@ -281,11 +280,8 @@ class OutputTestCase(unittest.TestCase): plotter.plot(autoscale_y=True) - sha1 = hashlib.sha1() - with open(plotter.svg_filenames[0]) as svg_file: - sha1.update(svg_file.read()) - self.assertEqual('704b472ae27175f20f1c5cb05e0d3f0987ff8f40', - sha1.hexdigest()) + for svg_file in plotter.filenames(): + self.assertTrue(os.path.getsize(svg_file) > 0) def test_simple_curve_plot_generation(self): """Create an SVG plot of a single (hazard) curve for a single site
Update test because the hash was very brittle
gem_oq-engine
train
py
50f552d557c0dc12f03c07819bc3d7d1a8d63e7b
diff --git a/presto-main/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java b/presto-main/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java index <HASH>..<HASH> 100644 --- a/presto-main/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java +++ b/presto-main/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java @@ -1129,7 +1129,7 @@ public class ExpressionAnalyzer int numCapturedValues = node.getValues().size(); verify(argumentTypes.size() == functionInputTypes.size()); for (int i = 0; i < numCapturedValues; i++) { - verify(functionInputTypes.get(i) == argumentTypes.get(i)); + verify(functionInputTypes.get(i).equals(argumentTypes.get(i))); } FunctionType result = new FunctionType(argumentTypes.subList(numCapturedValues, argumentTypes.size()), functionType.getReturnType());
Fix type comparison in ExpressionAnalyzer Parametric types are not cached and can be different by reference, even it is the same type. Use Type.equals() instead of reference comparison.
prestodb_presto
train
java
57ab7cf06e22e060e72ee3a3342990b46b2a4cc9
diff --git a/src/android/IntentShim.java b/src/android/IntentShim.java index <HASH>..<HASH> 100644 --- a/src/android/IntentShim.java +++ b/src/android/IntentShim.java @@ -553,6 +553,13 @@ public class IntentShim extends CordovaPlugin { } else if (key.equals(Intent.EXTRA_EMAIL)) { // allows to add the email address of the receiver i.putExtra(Intent.EXTRA_EMAIL, new String[] { valueStr }); + } else if (key.equals(Intent.EXTRA_KEY_EVENT)) { + // allows to add a key event object + JSONObject keyEventJson = new JSONObject(valueStr); + int keyAction = keyEventJson.getInt("action"); + int keyCode = keyEventJson.getInt("code"); + KeyEvent keyEvent = new KeyEvent(keyAction, keyCode); + i.putExtra(Intent.EXTRA_KEY_EVENT, keyEvent); } else { if (value instanceof Boolean) { i.putExtra(key, Boolean.valueOf(valueStr));
added Intent.EXTRA_KEY_EVENT support
darryncampbell_darryncampbell-cordova-plugin-intent
train
java
e2d781adcf9ec774cea0a5e73aca41e999580426
diff --git a/src/SmartyStreetsService.php b/src/SmartyStreetsService.php index <HASH>..<HASH> 100644 --- a/src/SmartyStreetsService.php +++ b/src/SmartyStreetsService.php @@ -70,7 +70,7 @@ class SmartyStreetsService { $jsonRequest = json_encode($this->request); $jsonResponse = $this->post($url, $jsonRequest); - return $this->response = json_decode($jsonResponse); + return $this->response = json_decode($jsonResponse, 1); } public function addressGetCandidates($inputIndex) @@ -78,11 +78,6 @@ class SmartyStreetsService { $candidates = array(); if(!empty($this->response) && is_array($this->response)) { foreach($this->response as $k => $candidate) { - $candidate = (array)$candidate; - $candidate['components'] = (array)$candidate['components']; - $candidate['metadata'] = (array)$candidate['metadata']; - $candidate['analysis'] = (array)$candidate['analysis']; - if($candidate['input_index'] == $inputIndex) { $candidates[] = $candidate; }
Simplified json -> array processing No more casting objects, instead using json_decode's $assoc argument like it was intended.
FireEngineRed_smartystreets-laravel
train
php
085112fc89cc3836b14e5804fad477135a99d2cf
diff --git a/VueInterval.js b/VueInterval.js index <HASH>..<HASH> 100644 --- a/VueInterval.js +++ b/VueInterval.js @@ -14,15 +14,18 @@ var vueinterval = { methods: { setVueInterval:function(fn,delay,endFn,ttl){ if (arguments.length === 4) { - var item={ 'fn': fn, 'delay': delay, 'intID': null,'endFn':endFn, 'loops':ttl/delay }; var fnDel = this.removeVueInterval; - item.intID = setInterval(function(){item.fn(); - if(--item.loops<=0){ - endFn(); - fnDel(item.intID); - } - }, delay); + var item = { 'fn': null, 'delay': delay, 'intID': null, 'endFn': endFn, 'loops': ttl / delay }; + item.fn = function () { + fn(); + if (--item.loops <= 0) { + endFn(); + fnDel(item.intID); + } + }; + item.intID = setInterval(item.fn, delay); this.interval_Array.push(item); + return item.intID; } else if(arguments.length===2){ var iid = setInterval(fn, delay);
Intervals with callbacks can be suspended and resumed
reinerBa_Vue-Interval
train
js
1822ad8a17ac3bf1901444f51314fb2cc6d8b4c4
diff --git a/lib/structure.rb b/lib/structure.rb index <HASH>..<HASH> 100644 --- a/lib/structure.rb +++ b/lib/structure.rb @@ -125,7 +125,11 @@ class Structure # # Optionally, seeds the structure with a hash of attributes. def initialize(seed = {}) - initialize_attributes + @attributes = {} + self.class.default_attributes.each do |key, value| + @attributes[key] = value.is_a?(Array) ? value.dup : value + end + seed.each { |key, value| self.send("#{key}=", value) } end @@ -178,13 +182,4 @@ class Structure def ==(other) other.is_a?(Structure) && @attributes == other.attributes end - - private - - def initialize_attributes - @attributes = {} - self.class.default_attributes.each do |key, value| - @attributes[key] = value.is_a?(Array) ? value.dup : value - end - end end
no benefit in abstracting this to a private method
hakanensari_structure
train
rb
3e7f16aca56e9cc0004d81738e30ec793513925e
diff --git a/test/parser.js b/test/parser.js index <HASH>..<HASH> 100644 --- a/test/parser.js +++ b/test/parser.js @@ -536,6 +536,17 @@ describe('parser', () => { expect(p('2018-21/2018-23', { level: 3 })) .to.be.an.interval.through([2018, 23]).at.level(3)) + it('YYYY/YYYY-SS', () => + expect(p('2018/2018-23', { level: 3 })) + .to.be.an.interval.through([2018, 23]).at.level(3)) + + it('YYYY-SS/YYYY-MM-DD', () => + expect(p('2018-21/2017-01-01', { level: 3 })) + .to.be.an.interval.from([2018, 21]).at.level(3)) + + it('YYYY-01?/YYYY-SS', () => + expect(p('2018-01?/2018-23', { level: 3 })) + .to.be.an.interval.through([2018, 23]).at.level(3)) }) describe('constrain', () => {
Add mixed season date interval specs See #<I>
inukshuk_edtf.js
train
js
b849bf87590499b5b3cef386634849676f31c012
diff --git a/findbugs/src/java/edu/umd/cs/findbugs/cloud/db/DBCloud.java b/findbugs/src/java/edu/umd/cs/findbugs/cloud/db/DBCloud.java index <HASH>..<HASH> 100644 --- a/findbugs/src/java/edu/umd/cs/findbugs/cloud/db/DBCloud.java +++ b/findbugs/src/java/edu/umd/cs/findbugs/cloud/db/DBCloud.java @@ -617,7 +617,7 @@ public class DBCloud extends AbstractCloud { } } - public void waitForIssueSync() { + public void waitUntilIssueDataDownloaded() { //TODO }
Add test to make sure waitUntilIssueDataDownloaded returns immediately if data are already downloaded git-svn-id: <URL>
spotbugs_spotbugs
train
java
1085e6a5921fa3e1d7e8e1a7ee482a643d11be36
diff --git a/lib/rib/api.rb b/lib/rib/api.rb index <HASH>..<HASH> 100644 --- a/lib/rib/api.rb +++ b/lib/rib/api.rb @@ -60,7 +60,7 @@ module Rib::API def get_input print(prompt) if input = $stdin.gets - input.chomp + (history << input.chomp).last else nil end diff --git a/lib/rib/core/history_file.rb b/lib/rib/core/history_file.rb index <HASH>..<HASH> 100644 --- a/lib/rib/core/history_file.rb +++ b/lib/rib/core/history_file.rb @@ -14,11 +14,6 @@ module Rib::HistoryFile super end - def get_input - return super if HistoryFile.disabled? - (history << super).last - end - def read_history return super if HistoryFile.disabled? File.exist?(history_file) && history.empty? &&
since now history is built into API... leave history_file only with file
godfat_rib
train
rb,rb
81b63eaff3f2ff9c23eb7c6e45a205aa9ce3c9b3
diff --git a/cachalot/tests/write.py b/cachalot/tests/write.py index <HASH>..<HASH> 100644 --- a/cachalot/tests/write.py +++ b/cachalot/tests/write.py @@ -351,6 +351,28 @@ class WriteTestCase(TransactionTestCase): ).distinct()) self.assertListEqual(data7, [t]) + with self.assertNumQueries(1): + data8 = list( + User.objects.filter(user_permissions__in=g.permissions.all()) + ) + self.assertListEqual(data8, []) + + u.user_permissions.add(p) + + with self.assertNumQueries(1): + data9 = list( + User.objects.filter(user_permissions__in=g.permissions.all()) + ) + self.assertListEqual(data9, [u]) + + g.permissions.remove(p) + + with self.assertNumQueries(1): + data10 = list( + User.objects.filter(user_permissions__in=g.permissions.all()) + ) + self.assertListEqual(data10, []) + def test_invalidate_select_related(self): with self.assertNumQueries(1): data1 = list(Test.objects.select_related('owner'))
Adds a missing test for subqueries.
noripyt_django-cachalot
train
py
6c0be0b1cf1a4bd458b88fff2c65c63a610b7f81
diff --git a/test/unit.spec.js b/test/unit.spec.js index <HASH>..<HASH> 100644 --- a/test/unit.spec.js +++ b/test/unit.spec.js @@ -111,7 +111,7 @@ describe('ng-mfb', function() { $rootScope.$digest(); - var main_button = node.find('a').eq(0); + main_button = node.find('a').eq(0); expect(main_button.attr('data-mfb-label')).toBe(label); }); });
fix jshint error in tests
nobitagit_ng-material-floating-button
train
js
9b1a9a72a963b7770102ccb558e880d2f17c7e2d
diff --git a/delphi/tests/test_AnalysisGraph.py b/delphi/tests/test_AnalysisGraph.py index <HASH>..<HASH> 100644 --- a/delphi/tests/test_AnalysisGraph.py +++ b/delphi/tests/test_AnalysisGraph.py @@ -53,7 +53,7 @@ def test_map_concepts_to_indicators(): stdev=None, time=None, ) - assert G.nodes["food_security"]["indicators"][0] == indicator + assert G.node["food_security"]["indicators"][0] == indicator def test_infer_transition_model():
trying to fix networkx <I> bug
ml4ai_delphi
train
py
34a170c5d9c1907074961d2c1374b1fc34dff442
diff --git a/src/AuthorizationValidators/BearerTokenValidator.php b/src/AuthorizationValidators/BearerTokenValidator.php index <HASH>..<HASH> 100644 --- a/src/AuthorizationValidators/BearerTokenValidator.php +++ b/src/AuthorizationValidators/BearerTokenValidator.php @@ -94,7 +94,7 @@ class BearerTokenValidator implements AuthorizationValidatorInterface } $header = $request->getHeader('authorization'); - $jwt = \trim((string) \preg_replace('/^(?:\s+)?Bearer\s/', '', $header[0])); + $jwt = \trim((string) \preg_replace('/^\s*Bearer\s/', '', $header[0])); try { // Attempt to parse the JWT
Simplifies `Bearer` regex `(?:\s+)?` is just `\s*` but harder
thephpleague_oauth2-server
train
php
4add0cb8fc080a36eb53d887a5b8dfb039a3723c
diff --git a/src/UserEvent.php b/src/UserEvent.php index <HASH>..<HASH> 100644 --- a/src/UserEvent.php +++ b/src/UserEvent.php @@ -160,8 +160,9 @@ class UserEvent extends Event implements UserEventInterface */ public function getSource() { - $targets = $this->getTargets(); - if (in_array($this->getConnection()->getNickname(), $targets)) { + $targets = array_map('strtolower', $this->getTargets()); + $nick = strtolower($this->getConnection()->getNickname()); + if (in_array($nick, $targets)) { return $this->getNick(); } return reset($targets); diff --git a/tests/UserEventTest.php b/tests/UserEventTest.php index <HASH>..<HASH> 100644 --- a/tests/UserEventTest.php +++ b/tests/UserEventTest.php @@ -136,6 +136,7 @@ class UserEventTest extends EventTest $data = array(); $data[] = array('#channel', '#channel'); $data[] = array('bot', 'user'); + $data[] = array('Bot', 'user'); return $data; }
Make user event nick comparisons case-insensitive
phergie_phergie-irc-event
train
php,php
99eb07a80ac4f82a0e217df99ec2a0b40f0ddb18
diff --git a/Source/Main.js b/Source/Main.js index <HASH>..<HASH> 100644 --- a/Source/Main.js +++ b/Source/Main.js @@ -34,13 +34,21 @@ class Redis extends EventEmitter{ }); this.Expecting = []; } - connect(Host, Port){ + connect(Host, Port, Callback){ Host = Host || '127.0.0.1'; Port = Port || 6379; let Me = this; - return new Promise(function(Resolve){ - Me.Socket.connect(Port, Host, Resolve); - }); + if(typeof Callback === 'function'){ + try { + Me.Socket.connect(Port, Host, Callback); + } catch(err){ + Callback(err); + } + } else { + return new Promise(function(Resolve){ + Me.Socket.connect(Port, Host, Resolve); + }); + } } ref(){ this.Socket.ref() } unref(){ this.Socket.unref() }
:new: Support callback in constructor
steelbrain_RedisNG-Node
train
js
522b37bc3b2acb419cda1fe19ac9f2794a599d2e
diff --git a/core/src/main/java/io/grpc/internal/MessageFramer.java b/core/src/main/java/io/grpc/internal/MessageFramer.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/io/grpc/internal/MessageFramer.java +++ b/core/src/main/java/io/grpc/internal/MessageFramer.java @@ -267,7 +267,7 @@ public class MessageFramer implements Framer { return ((Drainable) message).drainTo(outputStream); } else { // This makes an unnecessary copy of the bytes when bytebuf supports array(). However, we - // expect performance-critical code to support flushTo(). + // expect performance-critical code to support drainTo(). @SuppressWarnings("BetaApi") // ByteStreams is not Beta in v27 long written = ByteStreams.copy(message, outputStream); checkArgument(written <= Integer.MAX_VALUE, "Message size overflow: %s", written);
Fix drift in MessageFramer comment (#<I>)
grpc_grpc-java
train
java
9f96b452f11346f2953f3647aaabd6e7044dfa69
diff --git a/lib/datasource/go.js b/lib/datasource/go.js index <HASH>..<HASH> 100644 --- a/lib/datasource/go.js +++ b/lib/datasource/go.js @@ -73,7 +73,7 @@ async function getPkgReleases(purl, config) { const githubPurl = await getSourcePurl(name); if (githubPurl) { const githubTags = await github.getPkgReleases(githubPurl, config); - if (githubTags.releases) { + if (githubTags && githubTags.releases) { githubTags.releases = githubTags.releases.filter( release => release.version && release.version.startsWith('v') );
fix(go): better check tags before releases
renovatebot_renovate
train
js
6a7f087c787059cf4074bbfc2095d5059b1d3342
diff --git a/mocket/mocket.py b/mocket/mocket.py index <HASH>..<HASH> 100644 --- a/mocket/mocket.py +++ b/mocket/mocket.py @@ -137,11 +137,11 @@ def create_connection(address, timeout=None, source_address=None): return s -def socketpair(): +def socketpair(*args, **kwargs): """Returns a real socketpair() used by asyncio loop for supporting calls made by fastapi and similar services.""" import _socket - return _socket.socketpair() + return _socket.socketpair(*args, **kwargs) def _hash_request(h, req):
Update mocket.py (#<I>)
mindflayer_python-mocket
train
py
4a3d63cb6283c6e926eac9d485a90bf0e24e54f6
diff --git a/holoviews/core/io.py b/holoviews/core/io.py index <HASH>..<HASH> 100644 --- a/holoviews/core/io.py +++ b/holoviews/core/io.py @@ -331,6 +331,7 @@ class FileArchive(Archive): self._zip_archive(export_name, files, root) elif self.archive_format == 'tar': self._tar_archive(export_name, files, root) + self._files = OrderedDict() def _format(self, formatter, info): filtered = {k:v for k,v in info.items()
Resetting all stored file definitions after the FileArchive is exported
pyviz_holoviews
train
py
5bd186b2c977c01e55b583be077e73ddc405289e
diff --git a/zinnia/views/categories.py b/zinnia/views/categories.py index <HASH>..<HASH> 100644 --- a/zinnia/views/categories.py +++ b/zinnia/views/categories.py @@ -1,4 +1,5 @@ """Views for Zinnia categories""" +from django.db.models import Count from django.shortcuts import get_object_or_404 from django.views.generic.list import ListView from django.views.generic.list import BaseListView @@ -19,9 +20,16 @@ def get_category_or_404(path): class CategoryList(ListView): """ - View returning a list of all the categories. + View returning a list of published categories. """ - queryset = Category.objects.all() + + def get_queryset(self): + """ + Return a queryset of published categories, + with a count of their entries published. + """ + return Category.published.all().annotate( + count_entries_published=Count('entries')) class BaseCategoryDetail(object):
Only return published categories with a count of their published entries
Fantomas42_django-blog-zinnia
train
py
2228427c2f7003ccd58e152007fc9704a2b9ef71
diff --git a/stacks.go b/stacks.go index <HASH>..<HASH> 100644 --- a/stacks.go +++ b/stacks.go @@ -23,6 +23,8 @@ type StacksResource struct { type Stack struct { Guid string `json:"guid"` Name string `json:"name"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` Description string `json:"description"` c *Client }
Add CreatedAt and UpdatedAt to Stack
cloudfoundry-community_go-cfclient
train
go
2ba76e44bd708251550adcffa24bcc0100fda578
diff --git a/resource_openstack_compute_instance_v2.go b/resource_openstack_compute_instance_v2.go index <HASH>..<HASH> 100644 --- a/resource_openstack_compute_instance_v2.go +++ b/resource_openstack_compute_instance_v2.go @@ -93,10 +93,11 @@ func resourceComputeInstanceV2() *schema.Resource { }, }, "security_groups": &schema.Schema{ - Type: schema.TypeList, + Type: schema.TypeSet, Optional: true, ForceNew: false, Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, }, "availability_zone": &schema.Schema{ Type: schema.TypeString, @@ -807,7 +808,7 @@ func ServerV2StateRefreshFunc(client *gophercloud.ServiceClient, instanceID stri } func resourceInstanceSecGroupsV2(d *schema.ResourceData) []string { - rawSecGroups := d.Get("security_groups").([]interface{}) + rawSecGroups := d.Get("security_groups").(*schema.Set).List() secgroups := make([]string, len(rawSecGroups)) for i, raw := range rawSecGroups { secgroups[i] = raw.(string)
provider/openstack: Ignore order of security_groups in instance
terraform-providers_terraform-provider-openstack
train
go
8d3552c27cba733133b3bd1b8a51b6e59e0e3204
diff --git a/tests/common.py b/tests/common.py index <HASH>..<HASH> 100644 --- a/tests/common.py +++ b/tests/common.py @@ -1,10 +1,12 @@ import io import os +from typing import List + try: - import hypothesis + import hypothesis # type: ignore except ImportError: - hypothesis = None + hypothesis = None # type: ignore class NonClosingBytesIO(io.BytesIO): @@ -48,7 +50,7 @@ class OpCountingBytesIO(NonClosingBytesIO): return super(OpCountingBytesIO, self).write(data) -_source_files = [] +_source_files = [] # type: List[bytes] def random_input_data():
tests: add type hints This appeases mypy.
indygreg_python-zstandard
train
py
fe24f8ee0f00b2aff010e08ad0b623307ad50cf6
diff --git a/browser-version/build.js b/browser-version/build.js index <HASH>..<HASH> 100644 --- a/browser-version/build.js +++ b/browser-version/build.js @@ -38,6 +38,11 @@ child_process.exec('npm install fs-extra async uglify-js browserify', { cwd: __d async.waterfall([ function (cb) { + console.log("Installing source dependencies if needed"); + + child_process.exec('npm install', { cwd: path.join(__dirname, '..') }, function (err) { return cb(err); }); + } + , function (cb) { console.log("Removing contents of the src directory"); async.eachSeries(fs.readdirSync(path.join(__dirname, 'src')), function (item, _cb) {
Install main dependencies if needed in browser version building
louischatriot_nedb
train
js
9287a9c2f744f99838013925383be426a6221002
diff --git a/src/main/java/com/github/bedrin/jdbc/sniffer/MockDriver.java b/src/main/java/com/github/bedrin/jdbc/sniffer/MockDriver.java index <HASH>..<HASH> 100755 --- a/src/main/java/com/github/bedrin/jdbc/sniffer/MockDriver.java +++ b/src/main/java/com/github/bedrin/jdbc/sniffer/MockDriver.java @@ -59,12 +59,12 @@ public class MockDriver implements Driver { @Override public int getMinorVersion() { - return 0; + return 4; } @Override public boolean jdbcCompliant() { - return false; + return true; } @Override
Version information returned from driver updated to reflect the actual JDBC Sniffer version
sniffy_sniffy
train
java
75d056c878b651931a85e3ad7e41a5d8ddc4583f
diff --git a/builtin/providers/digitalocean/resource_digitalocean_record_test.go b/builtin/providers/digitalocean/resource_digitalocean_record_test.go index <HASH>..<HASH> 100644 --- a/builtin/providers/digitalocean/resource_digitalocean_record_test.go +++ b/builtin/providers/digitalocean/resource_digitalocean_record_test.go @@ -104,6 +104,15 @@ func TestAccDigitalOceanRecord_HostnameValue(t *testing.T) { }) } +// This test fails with: +// +// POST https://api.digitalocean.com/v2/domains/foobar-test-terraform.com/records: +// 422 Data needs to end with a dot (.) +// +// Which seems like a behavior change on the DO API side. Opened support ticket +// #826791 to ask DigitalOcean about this, and we'll comment out the test for +// now. --phinze +/* func TestAccDigitalOceanRecord_RelativeHostnameValue(t *testing.T) { var record godo.DomainRecord @@ -130,6 +139,7 @@ func TestAccDigitalOceanRecord_RelativeHostnameValue(t *testing.T) { }, }) } +*/ func TestAccDigitalOceanRecord_ExternalHostnameValue(t *testing.T) { var record godo.DomainRecord
provider/digitalocean: comment out test for relative DNS records Until we hear back from DigitalOcean on whether this behavior is supposed to be supported or not.
hashicorp_terraform
train
go
2dcd1183aa711ed9344020d0999f1408b2502e45
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -30,7 +30,7 @@ module.exports = function (grunt) { jasmine: { configFile: "karma.conf.js", singleRun: true, - browsers: ["Chrome", "Firefox"] + browsers: ["Chrome", "Firefox", "Safari"] }, cuke_once: {
re-enable testing on Safari
s9tpepper_karma-cucumberjs
train
js
eca3ac0e94f809e8cb4cc3b60d394b2a88faddae
diff --git a/tests/CommentsTest.php b/tests/CommentsTest.php index <HASH>..<HASH> 100644 --- a/tests/CommentsTest.php +++ b/tests/CommentsTest.php @@ -607,7 +607,10 @@ class CommentsTest extends FunctionalTest { $locale = i18n::get_locale(); i18n::set_locale('fr'); + + /** @var Comment $comment */ $comment = $this->objFromFixture(Comment::class, 'firstComA'); + $labels = $comment->FieldLabels(); $expected = array( 'Name' => 'Nom de l\'Auteur', @@ -627,7 +630,10 @@ class CommentsTest extends FunctionalTest 'Parent' => 'Parent' ); i18n::set_locale($locale); - $this->assertEquals($expected, $labels); + foreach ($expected as $key => $value) { + $this->assertEquals($value, $labels[$key]); + } + $labels = $comment->FieldLabels(); $expected = array( 'Name' => 'Author Name', @@ -646,7 +652,9 @@ class CommentsTest extends FunctionalTest 'Created' => 'Date posted', 'Parent' => 'Parent' ); - $this->assertEquals($expected, $labels); + foreach ($expected as $key => $value) { + $this->assertEquals($value, $labels[$key]); + } } public function testGetParent()
FIX Allow tests to handle extra field labels being added in global state
silverstripe_silverstripe-comments
train
php
c096839a1af49c728d87c8e126f966a5849d3a15
diff --git a/Mappers/DbMapper.php b/Mappers/DbMapper.php index <HASH>..<HASH> 100644 --- a/Mappers/DbMapper.php +++ b/Mappers/DbMapper.php @@ -180,16 +180,12 @@ abstract class DbMapper extends BaseMapper */ protected function updateObject(array $data) : ArraySerializable { - $affectedRows = $this->mySqlClient->update( + $this->mySqlClient->update( $this->entityToDataSourceTranslator->table(), $this->entityToDataSourceTranslator->extractUpdateParams($data), $this->entityToDataSourceTranslator->extractUpdateIdentifiers($data) ); - if ($affectedRows === 0) { - throw new EntityNotFoundException(); - } - return $this->buildObject($data); }
[update] don't check affected rows because there is variant when change just some relations of an aggregate
Antonyan_ddd-mappers-infrastructure
train
php
f1c4cfea2ccbc392521c12d8927519de12ca76f2
diff --git a/_pytest/_code/source.py b/_pytest/_code/source.py index <HASH>..<HASH> 100644 --- a/_pytest/_code/source.py +++ b/_pytest/_code/source.py @@ -60,16 +60,13 @@ class Source(object): else: if key.step not in (None, 1): raise IndexError("cannot slice a Source with a step") - return self.__getslice__(key.start, key.stop) + newsource = Source() + newsource.lines = self.lines[key.start:key.stop] + return newsource def __len__(self): return len(self.lines) - def __getslice__(self, start, end): - newsource = Source() - newsource.lines = self.lines[start:end] - return newsource - def strip(self): """ return new source object with trailing and leading blank lines removed.
Remove implementation of `__getslice__` `__getslice__` has been Deprecated since Python <I> and is removed in Python 3. See <URL>
vmalloc_dessert
train
py
a7dcf3338785e15d03c161ceba9dd10575f786f3
diff --git a/lib/specinfra/version.rb b/lib/specinfra/version.rb index <HASH>..<HASH> 100644 --- a/lib/specinfra/version.rb +++ b/lib/specinfra/version.rb @@ -1,3 +1,3 @@ module Specinfra - VERSION = "2.36.13" + VERSION = "2.36.14" end
Bump up version [skip ci]
mizzy_specinfra
train
rb
e5a0431080d4829ad777814739254ee66e7483f2
diff --git a/lib/httpi/client.rb b/lib/httpi/client.rb index <HASH>..<HASH> 100644 --- a/lib/httpi/client.rb +++ b/lib/httpi/client.rb @@ -58,7 +58,7 @@ module HTTPI # and a request body plus an optional adapter and returns an Array with # an <tt>HTTPI::Request</tt> and (if given) an adapter. def extract_post_args(args) - return args if args.first.kind_of? Request + return args if args[0].kind_of? Request [Request.new(:url => args[0], :body => args[1]), args[2]] end
first doesn't make this any simpler
savonrb_httpi
train
rb
047b65a96ccf44ba87eb12435fec02e572971526
diff --git a/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/async/BulkRead.java b/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/async/BulkRead.java index <HASH>..<HASH> 100644 --- a/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/async/BulkRead.java +++ b/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/async/BulkRead.java @@ -164,7 +164,7 @@ public class BulkRead { for (Entry<ByteString, SettableFuture<List<FlatRow>>> entry : futures.entries()) { entry.getValue().set(ImmutableList.<FlatRow> of()); } - } catch (IOException e) { + } catch (Throwable e) { for (Entry<ByteString, SettableFuture<List<FlatRow>>> entry : futures.entries()) { entry.getValue().setException(e); }
Catching Throwable instead of IOException for BulkRead. (#<I>) This will fix some flakiness we've seen with our TestBatch.testBatchDoesntHang() test.
googleapis_cloud-bigtable-client
train
java
2c82d7b07ec7aa77cceac4b4b61ba9928b14855c
diff --git a/webapps/client/scripts/pages/authorizations.js b/webapps/client/scripts/pages/authorizations.js index <HASH>..<HASH> 100644 --- a/webapps/client/scripts/pages/authorizations.js +++ b/webapps/client/scripts/pages/authorizations.js @@ -19,7 +19,8 @@ define(['text!./authorizations.html', 'text!./confirm-delete-authorization.html' 5: 'Filter', 6: 'Process Definition', 7: 'Task', - 8: 'Process Instance' + 8: 'Process Instance', + 9: 'Deployment' }; $scope.permissionMap = { @@ -31,7 +32,8 @@ define(['text!./authorizations.html', 'text!./confirm-delete-authorization.html' 5: [ 'READ', 'UPDATE', 'DELETE' ], 6: [ 'READ', 'CREATE_INSTANCE', 'READ_INSTANCE', 'UPDATE_INSTANCE', 'DELETE_INSTANCE', 'READ_TASK', 'UPDATE_TASK' ], 7: [ 'CREATE', 'READ', 'UPDATE', 'DELETE' ], - 8: [ 'CREATE', 'READ', 'UPDATE', 'DELETE' ] + 8: [ 'CREATE', 'READ', 'UPDATE', 'DELETE' ], + 9: [ 'CREATE', 'READ', 'DELETE' ] }; $scope.typeMap = {
feat(auth/deployment): configure authorizations for deployments related to CAM-<I>
camunda_camunda-bpm-platform
train
js
c8eb256d646b564a1845125b008ec98d2863e6fa
diff --git a/project/library/CM/SmartyPlugins/function.paging.php b/project/library/CM/SmartyPlugins/function.paging.php index <HASH>..<HASH> 100755 --- a/project/library/CM/SmartyPlugins/function.paging.php +++ b/project/library/CM/SmartyPlugins/function.paging.php @@ -23,7 +23,7 @@ function smarty_function_paging(array $params, Smarty_Internal_Template $templat } $html = ''; - $html .= '<div class="paging">'; + $html .= '<div class="paging"><div class="paging-inner">'; if ($paging->getPage() > 1) { $html .= _smarty_function_paging_link($request, $component, $paging->getPage() - 1, '', $ajax, 'paging_control pagingPrevPage'); @@ -42,7 +42,7 @@ function smarty_function_paging(array $params, Smarty_Internal_Template $templat $html .= _smarty_function_paging_link($request, $component, $paging->getPage() + 1, '', $ajax, 'paging_control pagingNextPage'); } - $html .= '</div>'; + $html .= '</div></div>'; return $html; }
Refactor paging; adjust smarty function, refactor css to less
cargomedia_cm
train
php
4629363e7076385f24a09d0271526a8cc9b77ca1
diff --git a/stdlib/nodejs/io.rb b/stdlib/nodejs/io.rb index <HASH>..<HASH> 100644 --- a/stdlib/nodejs/io.rb +++ b/stdlib/nodejs/io.rb @@ -27,6 +27,14 @@ class IO @eof = false @lineno = 0 end + + def self.write(path, data) + File.write(path, data) + end + + def self.read(path) + File.read(path) + end def read if @eof
Resolves #<I>, alias IO.write/.read to File.write/.read
opal_opal
train
rb
c4750d64b6e15a32fccc004cc54995837f2f3be2
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -191,6 +191,7 @@ VirtualMachine.prototype.fromJSON = function (json) { } target[x] = obj.sprites[i][x]; } + target.updateAllDrawablePropertie(); } this.editingTarget = this.runtime.targets[1]; // Update the VM user's knowledge of targets and blocks on the workspace.
Fix Drawable Properties Not Getting Updated
LLK_scratch-vm
train
js
346deddc1efd99bb25e0d30c8b2a1fd349291ac9
diff --git a/gdown/download.py b/gdown/download.py index <HASH>..<HASH> 100644 --- a/gdown/download.py +++ b/gdown/download.py @@ -1,6 +1,5 @@ from __future__ import print_function -import glob import json import os import os.path as osp @@ -201,12 +200,29 @@ def download( output = osp.join(output, filename_from_url) if output_is_path: - existing_tmp_files = glob.glob("{}*".format(output)) + existing_tmp_files = [] + for file in os.listdir(osp.dirname(output) or "."): + if file.startswith(osp.basename(output)): + existing_tmp_files.append(osp.join(osp.dirname(output), file)) if resume and existing_tmp_files: + if len(existing_tmp_files) != 1: + print( + "There are multiple temporary files to resume:", + file=sys.stderr, + ) + print("\n") + for file in existing_tmp_files: + print("\t", file, file=sys.stderr) + print("\n") + print( + "Please remove them except one to resume downloading.", + file=sys.stderr, + ) + return tmp_file = existing_tmp_files[0] else: resume = False - tmp_file = tempfile.mktemp( + _, tmp_file = tempfile.mkstemp( suffix=tempfile.template, prefix=osp.basename(output), dir=osp.dirname(output),
Allow space and quote in the filename
wkentaro_gdown
train
py
453b0ce075920f15cfc28dc90cd163dabc9acf77
diff --git a/openquake/calculators/classical.py b/openquake/calculators/classical.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/classical.py +++ b/openquake/calculators/classical.py @@ -327,6 +327,7 @@ class ClassicalCalculator(base.HazardCalculator): with self.monitor('store source_info'): self.store_source_info(self.calc_times) if self.by_task: + logging.info('Storing by_task information') num_tasks = max(self.by_task) + 1, er = self.datastore.create_dset('by_task/eff_ruptures', U32, num_tasks)
Better logging [skip CI]
gem_oq-engine
train
py
7cd7d8d9785e536234d63fbfe9e9e4a65021a8ec
diff --git a/tubemail.js b/tubemail.js index <HASH>..<HASH> 100644 --- a/tubemail.js +++ b/tubemail.js @@ -65,7 +65,7 @@ Tubemail.prototype.leave = function () { return new Promise((resolve) => { if (!this._destroy) throw new Error('Destroy handler missing!'); this.once('goodbye', resolve); - this._destroy(); + this._destroy(new Error('Goodbye!')); }); }; @@ -126,7 +126,7 @@ const fsmFactory = FSM({ }; set.hidden(tm, '_leave', () => { - neighs.forEach((n) => n.destroy()); + neighs.forEach((n) => n.destroy(new Error('We closed the connection'))); }); // React to incoming connects
Made sure Tube Mail neighbours are always destroyed with an Error Otherwise debuglog throws unhandled errors.
jue89_node-tubemail
train
js
0fc4994dfecc1ae9ffbcf9eae6bfd405eb901af6
diff --git a/tools/run_tests/run_xds_tests.py b/tools/run_tests/run_xds_tests.py index <HASH>..<HASH> 100755 --- a/tools/run_tests/run_xds_tests.py +++ b/tools/run_tests/run_xds_tests.py @@ -114,7 +114,9 @@ argp.add_argument( '--xds_v3_support', default=False, action='store_true', - help='Support xDS v3 via GRPC_XDS_EXPERIMENTAL_V3_SUPPORT') + help='Support xDS v3 via GRPC_XDS_EXPERIMENTAL_V3_SUPPORT. ' + 'If a pre-created bootstrap file is provided via the --bootstrap_file ' + 'parameter, it should include xds_v3 in its server_features field.') argp.add_argument( '--client_cmd', default=None,
mention bootstrap server features in flag help
grpc_grpc
train
py
66243c20e7af8cc74ce32b6520e821b72d570308
diff --git a/wandb/board/ui/src/pages/Run.js b/wandb/board/ui/src/pages/Run.js index <HASH>..<HASH> 100644 --- a/wandb/board/ui/src/pages/Run.js +++ b/wandb/board/ui/src/pages/Run.js @@ -32,9 +32,9 @@ class Run extends React.Component { } componentWillReceiveProps(nextProps) { - if (nextProps.model) { + if (nextProps.model && !_.isEqual(nextProps.model, this.props.model)) { this.setState({model: nextProps.model, bucket: nextProps.bucket}); - } else { + } else if (!nextProps.model) { try { let query = nextProps.client.readQuery({ query: RUNS_QUERY, @@ -55,6 +55,7 @@ class Run extends React.Component { nextProps.bucket && (nextProps.views === null || !nextProps.views.run) && _.isEmpty(this.props.reduxServerViews.run.views) && + _.isEmpty(this.props.reduxBrowserViews.runs.views) && !this.props.reduxBrowserViews.run.configured ) { // no views on server, provide a default
Resolve issue with props update on Run page
wandb_client
train
js
25733c88cb63ef043e9228c43f8d6dea409d42d3
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -29,14 +29,14 @@ elif sys.platform == "linux2": if not copy_bin("./messenger/mexa64/messenger.mexa64"): raise ValueError("messenger.mexa64 is not built yet. Please build it yourself.") -elif sys.platform == "win32": +elif sys.platform in ["win32", "cygwin"]: t1 = copy_bin("./messenger/mexw64/messenger.mexw64") t2 = copy_bin("./messenger/mexw32/messenger.mexw32") if not (t1 or t2): raise ValueError("Neither messenger.mexw32 or mex264 is built yet. Please build the appropriate one yourself") else: - raise ValueError("Known platform") + raise ValueError("Unknown platform") # Get version and release info, which is all stored in pymatbridge/version.py ver_file = os.path.join('pymatbridge', 'version.py')
Add Cygwin to list of detected platforms
arokem_python-matlab-bridge
train
py
8b1c5839167247e7cc6c7a919deabd9d820e1cb6
diff --git a/src/main/com/mongodb/DBBase.java b/src/main/com/mongodb/DBBase.java index <HASH>..<HASH> 100644 --- a/src/main/com/mongodb/DBBase.java +++ b/src/main/com/mongodb/DBBase.java @@ -85,14 +85,20 @@ public abstract class DBBase { return getCollection( "$cmd" ).findOne( cmd ); } - public Object eval( String code , Object ... args ) + public DBObject doEval( String code , Object ... args ) throws MongoException { - DBObject res = command( BasicDBObjectBuilder.start() - .add( "$eval" , code ) - .add( "args" , args ) - .get() ); + return command( BasicDBObjectBuilder.start() + .add( "$eval" , code ) + .add( "args" , args ) + .get() ); + } + public Object eval( String code , Object ... args ) + throws MongoException { + + DBObject res = doEval( code , args ); + if ( res.get( "ok" ) instanceof Number && ((Number)res.get( "ok" ) ).intValue() == 1 ){ return res.get( "retval" );
split out doEval from eval
mongodb_mongo-java-driver
train
java
90cf3812b50881783310ce4fd904f3dd2e195424
diff --git a/lib/inspectors/data.js b/lib/inspectors/data.js index <HASH>..<HASH> 100644 --- a/lib/inspectors/data.js +++ b/lib/inspectors/data.js @@ -2,6 +2,7 @@ var iconv = require('iconv-lite'); var zlib = require('zlib'); var fs = require('fs'); var fse = require('fs-extra'); +var path = require('path'); var MAX_REQ_SIZE = 256 * 1024; var MAX_RES_SIZE = 512 * 1024; var LOCALHOST = '127.0.0.1'; @@ -185,6 +186,10 @@ function emitDataEvents(req, res, proxy) { if (!exportsFile) { return; } + var root = req.rules.exports.root; + if (root) { + exportsFile = path.join(root, exportsFile); + } fse.ensureFile(exportsFile, function(err) { if (err) { return;
feat: Support exports using relative paths
avwo_whistle
train
js
5ae7cfbd5454b9dd46cd8bf16f3990addc0ebcb4
diff --git a/spec/hook_handler/hook_handler_hook_spec.rb b/spec/hook_handler/hook_handler_hook_spec.rb index <HASH>..<HASH> 100644 --- a/spec/hook_handler/hook_handler_hook_spec.rb +++ b/spec/hook_handler/hook_handler_hook_spec.rb @@ -45,7 +45,7 @@ describe EvalHook::HookHandler, "hook handler hooks" do it "should intercept constant access" do hh = EvalHook::HookHandler.new - def hh.handle_const(context, name) + def hh.handle_const(name) const_value(77) end @@ -55,12 +55,8 @@ describe EvalHook::HookHandler, "hook handler hooks" do it "should allow change constant values using hooking" do hh = EvalHook::HookHandler.new - def hh.handle_const(context, name) - if (name == "Object") - nil - else - const_value(77) - end + def hh.handle_colon2(context, name) + const_value(77) end TEST_CONSTANT_12346 = 8 @@ -80,7 +76,7 @@ describe EvalHook::HookHandler, "hook handler hooks" do it "should intercept constant access" do hh = EvalHook::HookHandler.new - hh.should_receive(:handle_const).with(Object,"A") + hh.should_receive(:handle_const).with("A") hh.evalhook("A") end
adapted test to the new signature of handle_const
tario_evalhook
train
rb
38aa620afac93f07a361640e4887ad6950357be0
diff --git a/src/ol/layer/Layer.js b/src/ol/layer/Layer.js index <HASH>..<HASH> 100644 --- a/src/ol/layer/Layer.js +++ b/src/ol/layer/Layer.js @@ -192,13 +192,14 @@ class Layer extends BaseLayer { } if (map) { this.mapPrecomposeKey_ = listen(map, RenderEventType.PRECOMPOSE, function(evt) { + const renderEvent = /** @type {import("../render/Event.js").default} */ (evt); const layerState = this.getLayerState(); layerState.managed = false; if (this.getZIndex() === undefined) { layerState.zIndex = Infinity; } - evt.frameState.layerStatesArray.push(layerState); - evt.frameState.layerStates[getUid(this)] = layerState; + renderEvent.frameState.layerStatesArray.push(layerState); + renderEvent.frameState.layerStates[getUid(this)] = layerState; }, this); this.mapRenderKey_ = listen(this, EventType.CHANGE, map.render, map); this.changed();
Fix type check errors in ol/layer/Layer
openlayers_openlayers
train
js
ad418c6f20a55a5dd5972bf7f968878ebdb13875
diff --git a/resources/lang/ro-RO/forms.php b/resources/lang/ro-RO/forms.php index <HASH>..<HASH> 100644 --- a/resources/lang/ro-RO/forms.php +++ b/resources/lang/ro-RO/forms.php @@ -188,7 +188,7 @@ return [ 'background-fills' => 'Gradient Fundal (componente, incidente, subsol)', 'banner-background-color' => 'Culoarea de fundal pentru banner', 'banner-padding' => 'Spaţiere banner', - 'fullwidth-banner' => 'Activaţi banner pe toată lăţimea paginii?', + 'fullwidth-banner' => 'Enable full width banner?', 'text-color' => 'Culoare Text', 'dashboard-login' => 'Arătaţi butonul Dashboard în subsol?', 'reds' => 'Roşu (utilizat pentru mesaje de eroare)',
New translations forms.php (Romanian)
CachetHQ_Cachet
train
php
d94ee8676cd7a88327848fbaca504ad79a5852f6
diff --git a/addon/index.js b/addon/index.js index <HASH>..<HASH> 100644 --- a/addon/index.js +++ b/addon/index.js @@ -3,17 +3,22 @@ import Ember from 'ember'; export default function(app, prefix) { var regex = new RegExp('^' + prefix + '\/((?:instance-)?initializers)\/'); var getKeys = (Object.keys || Ember.keys); + var moduleNames = getKeys(requirejs._eak_seen); - getKeys(requirejs._eak_seen).map(function (moduleName) { - return { - moduleName: moduleName, - matches: regex.exec(moduleName) - }; - }) - .filter(function(dep) { - return dep.matches && dep.matches.length === 2; - }) - .forEach(function(dep) { + var deps = []; + for (var i = 0; i < moduleNames.length; i++) { + var moduleName = moduleNames[i]; + var matches = regex.exec(moduleName); + + if (matches && matches.length === 2) { + deps.push({ + moduleName: moduleName, + matches: matches + }); + } + } + + deps.forEach(function(dep) { var moduleName = dep.moduleName; var module = require(moduleName, null, null, true);
Avoid double walking of all modules Currently this addon walks all of the modules twice in order to determine the modules that are initializers and instance initializers. We can squash the `map` and `filter` loops into one. This PR addresses that.
ember-cli_ember-load-initializers
train
js