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
cf591a992c23e2c29f44f50990d6bbcd938015cb
diff --git a/lib/oxidized/model/ironware.rb b/lib/oxidized/model/ironware.rb index <HASH>..<HASH> 100644 --- a/lib/oxidized/model/ironware.rb +++ b/lib/oxidized/model/ironware.rb @@ -16,7 +16,9 @@ class IronWare < Oxidized::Model #end cmd :all do |cfg| - cfg.each_line.to_a[1..-2].join + # sometimes ironware inserts arbitrary whitespace after commands are + # issued on the CLI, from run to run. this normalises the output. + cfg.each_line.to_a[1..-2].drop_while { |e| e.match /^\s+$/ }.join end cmd 'show version' do |cfg| @@ -56,7 +58,7 @@ class IronWare < Oxidized::Model cmd 'show running-config' do |cfg| arr = cfg.each_line.to_a - arr[3..-1].join unless arr.length < 3 + arr[2..-1].join unless arr.length < 2 end cfg :telnet do
occasionally ironware randomly inserts extraneous blank lines
ytti_oxidized
train
rb
15895f7e92ffce102b88c3edbf3c5b3862e26e2b
diff --git a/openquake/server/static/js/engineweb.js b/openquake/server/static/js/engineweb.js index <HASH>..<HASH> 100644 --- a/openquake/server/static/js/engineweb.js +++ b/openquake/server/static/js/engineweb.js @@ -221,15 +221,6 @@ } }); - /* - var Outputs = Backbone.Collection.extend( - { - model: Output, - url: '/icebox/outputs' - }); - var outputs = new Outputs(); - */ - var refresh_calcs; function setTimer() { @@ -244,13 +235,6 @@ calculations.fetch({reset: true}); setTimer(); - // var output_table = new OutputTable({ outputs: outputs }); - // outputs.fetch({reset: true}); - - // /* TODO. output collection should observe the calculation one */ - // setInterval(function() { outputs.fetch({reset: true}) }, 10000); - - /* XXX. Reset the input file value to ensure the change event will be always triggered */ $(document).on("click", 'input[name=archive]',
Remove stale code from engineweb.js
gem_oq-engine
train
js
49f4e3e624005c30fbd38bb1cd71682ef6767a0c
diff --git a/blockstack/lib/storage/crawl.py b/blockstack/lib/storage/crawl.py index <HASH>..<HASH> 100644 --- a/blockstack/lib/storage/crawl.py +++ b/blockstack/lib/storage/crawl.py @@ -109,8 +109,9 @@ def cached_zonefile_dir( zonefile_dir, zonefile_hash ): # split into directories, so we don't try to cram millions of files into one directory zonefile_dir_parts = [] - for i in xrange(0, len(zonefile_hash), 2): - zonefile_dir_parts.append( zonefile_hash[i:i+8] ) + interval = 2 + for i in xrange(0, len(zonefile_hash), interval): + zonefile_dir_parts.append( zonefile_hash[i:i+interval] ) zonefile_dir_path = os.path.join(zonefile_dir, "/".join(zonefile_dir_parts)) return zonefile_dir_path
zonefile cache directories are broken down by byte
blockstack_blockstack-core
train
py
aaf989ad2673601b266ce5654a1d1483c71101e5
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -85,11 +85,11 @@ function attempt(attempts, command, options, end) { case 'win32': processOptions.tmpFiles = writeTempBatchFile(command); var sudoCmd = [ - Node.path.join( + encloseDoubleQuotes(Node.path.join( Node.path.dirname(module.filename), Node.process.platform, 'elevate.exe' - ), + )), '-wait', processOptions.tmpFiles.batch ].join(' ');
enquote call to elevate.exe (#8)
automation-stack_electron-sudo
train
js
98253feb60d0162a9abce3b58234753ce4518e31
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -19,7 +19,7 @@ module.exports = class GazeButton extends React.Component { } componentWillUnmount() { - clearCountdown(); + this.clearCountdown(); } resetRemainingTime() {
add missing 'this' to clearCountdown method call
mathdroid_react-360-gaze-button
train
js
1d40180e8c114da210760ec09f6bab9126a059ea
diff --git a/SlimPostgres/App.php b/SlimPostgres/App.php index <HASH>..<HASH> 100644 --- a/SlimPostgres/App.php +++ b/SlimPostgres/App.php @@ -366,9 +366,8 @@ class App private function getBaseUrl() { - global $config; $baseUrl = "https://"; - if ($config['domainUseWww']) { + if ($this->config['domainUseWww']) { $baseUrl .= "www."; } $baseUrl .= $this->getHostWithoutWww();
fix config var problem in method
it-all_slim-postgres
train
php
47ccb6f82dc45c5ce6a7eabafa87941676560987
diff --git a/face/geomajas-face-pure-gwt/client-impl/src/main/java/org/geomajas/puregwt/client/map/render/MapRendererImpl.java b/face/geomajas-face-pure-gwt/client-impl/src/main/java/org/geomajas/puregwt/client/map/render/MapRendererImpl.java index <HASH>..<HASH> 100644 --- a/face/geomajas-face-pure-gwt/client-impl/src/main/java/org/geomajas/puregwt/client/map/render/MapRendererImpl.java +++ b/face/geomajas-face-pure-gwt/client-impl/src/main/java/org/geomajas/puregwt/client/map/render/MapRendererImpl.java @@ -201,9 +201,8 @@ public class MapRendererImpl implements MapRenderer { Layer<?> layer = event.getLayer(); if (layer instanceof RasterLayer) { for (int i = 0; i < htmlContainer.getChildCount(); i++) { - // TODO is this right??? - HtmlObject htmlObject = htmlContainer.getChild(i); - htmlObject.setOpacity(((RasterLayer) layer).getOpacity()); + HtmlContainer layerContainer = layerRenderers.get(layer).getHtmlContainer(); + layerContainer.setOpacity(((RasterLayer) layer).getOpacity()); } } else if (layer instanceof VectorLayer) { // TODO implement me...
PURE-<I>: Only the opacity of the html container that represents the given RasterLayer is changed.
geomajas_geomajas-project-client-gwt2
train
java
94ae2e1c3d3d3114688cdd9b695d1e75af80020d
diff --git a/lib/codemirror.js b/lib/codemirror.js index <HASH>..<HASH> 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -1285,6 +1285,7 @@ on(te, "compositionstart", function() { var start = cm.getCursor("from"); + if (input.composing) input.composing.range.clear() input.composing = { start: start, range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"})
Make sure composition underlines are removed even if events are fired in bad order Issue #<I>
codemirror_CodeMirror
train
js
8d996502e1757f1f2d01e09b3afcd8d483406738
diff --git a/lib/scalra.js b/lib/scalra.js index <HASH>..<HASH> 100644 --- a/lib/scalra.js +++ b/lib/scalra.js @@ -52,6 +52,13 @@ document.addEventListener ("DOMContentLoaded", function () { var onSocketEvent = (typeof onSocketEvent === 'function' ? onSocketEvent : undefined); var type = (typeof connectType === 'string' ? connectType : 'http'); var host = (typeof connectHost === 'string' ? connectHost : document.location.hostname); + // FIXME: + const location_host = document.location.host.split(':'); + let port = parseInt(location_host[location_host.length - 1]) - 8; + if (typeof(basePort) !== 'number') { + basePort = port; + } + // var port = (typeof basePort === 'number' ? basePort : document.location.host.split(':')); console.log('connectType: ' + type); console.log('connectHost: ' + host);
get basePort from url by default
imonology_scalra
train
js
cc80dea1466986c74a31b49a870ce58b1aed55c4
diff --git a/simulator/src/test/java/com/hazelcast/simulator/agent/AgentSmokeTest.java b/simulator/src/test/java/com/hazelcast/simulator/agent/AgentSmokeTest.java index <HASH>..<HASH> 100644 --- a/simulator/src/test/java/com/hazelcast/simulator/agent/AgentSmokeTest.java +++ b/simulator/src/test/java/com/hazelcast/simulator/agent/AgentSmokeTest.java @@ -50,7 +50,6 @@ public class AgentSmokeTest { public static void setUp() throws Exception { userDir = System.getProperty("user.dir"); - System.setProperty("worker.testmethod.timeout", "5"); System.setProperty("user.dir", "./dist/src/main/dist"); LOGGER.info("Agent bind address for smoke test: " + AGENT_IP_ADDRESS); @@ -67,12 +66,12 @@ public class AgentSmokeTest { public static void tearDown() throws Exception { try { agentsClient.stop(); - agentStarter.stop(); } finally { Hazelcast.shutdownAll(); System.setProperty("user.dir", userDir); + deleteQuiet(new File("./dist/src/main/dist/workers")); } }
Removed override of property "worker.testmethod.timeout" to fix timeout issue on build server.
hazelcast_hazelcast-simulator
train
java
e101cede8ace0e36c679bf3ef3fe9afc4b6536ff
diff --git a/hazelcast/src/main/java/com/hazelcast/internal/diagnostics/Diagnostics.java b/hazelcast/src/main/java/com/hazelcast/internal/diagnostics/Diagnostics.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/internal/diagnostics/Diagnostics.java +++ b/hazelcast/src/main/java/com/hazelcast/internal/diagnostics/Diagnostics.java @@ -71,10 +71,10 @@ public class Diagnostics { * <p/> * Every HazelcastInstance will get its own history of log files. * <p/> - * The default is 10. + * The default is 50. */ @SuppressWarnings("checkstyle:magicnumber") - public static final HazelcastProperty MAX_ROLLED_FILE_SIZE_MB = new HazelcastProperty(PREFIX + ".max.rolled.file.size.mb", 10) + public static final HazelcastProperty MAX_ROLLED_FILE_SIZE_MB = new HazelcastProperty(PREFIX + ".max.rolled.file.size.mb", 50) .setDeprecatedName("hazelcast.performance.monitor.max.rolled.file.size.mb"); /**
Upgraded Diagnostics file size to <I>mb From <I>mb. I see that diagnostics files can fill up pretty quickly and then you start to loose history due to rollover. So now we can keep 5x as much history by default.
hazelcast_hazelcast
train
java
ea5d3e5d268edf91fcd34808992bbad6c908604e
diff --git a/src/OrbitDB.js b/src/OrbitDB.js index <HASH>..<HASH> 100644 --- a/src/OrbitDB.js +++ b/src/OrbitDB.js @@ -119,8 +119,8 @@ class OrbitDB { // .on('end', () => resolve(buf)) // }).catch((e) => reject(e)); resolve(JSON.stringify({ - name: 'localhost dev network', - publishers: ['localhost:3333'] + name: 'Orbit DEV network', + publishers: ['178.62.241.75:3333'] })) }); };
Change placeholder network info to devnet
orbitdb_orbit-db
train
js
135f555c47b958cd623c71ff0096ab34f5071362
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -600,8 +600,6 @@ Pagelet.readable('stringify', function stringify(data, replacer) { * @api private */ Pagelet.readable('discover', function discover() { - if (!this.length) return this.emit('discover'); - var req = this._req , res = this._res , pagelet = this;
[fix] always discover to allow single pagelets to work
bigpipe_pagelet
train
js
082da35e382361863b79c0ca42205d5a52b4390a
diff --git a/src/python/grpcio_tests/commands.py b/src/python/grpcio_tests/commands.py index <HASH>..<HASH> 100644 --- a/src/python/grpcio_tests/commands.py +++ b/src/python/grpcio_tests/commands.py @@ -231,6 +231,9 @@ class TestGevent(setuptools.Command): # TODO(https://github.com/grpc/grpc/pull/15411) enable this test 'unit._server_test.ServerTest.test_failed_port_binding_exception', ) + BANNED_MACOS_TESTS = ( + # TODO(https://github.com/grpc/grpc/issues/15411) enable this test + 'unit._dynamic_stubs_test.DynamicStubTest',) description = 'run tests with gevent. Assumes grpc/gevent are installed' user_options = [] @@ -258,6 +261,8 @@ class TestGevent(setuptools.Command): runner = tests.Runner() if sys.platform == 'win32': runner.skip_tests(self.BANNED_TESTS + self.BANNED_WINDOWS_TESTS) + elif sys.platform == 'darwin': + runner.skip_tests(self.BANNED_TESTS + self.BANNED_MACOS_TESTS) else: runner.skip_tests(self.BANNED_TESTS) result = gevent.spawn(runner.run, loader.suite)
Add a list of banned macOS gevent tests (#<I>)
grpc_grpc
train
py
f4e9215bf3323e951e31bea1516cf02220788a09
diff --git a/EventListener/Traits/ClassChecker.php b/EventListener/Traits/ClassChecker.php index <HASH>..<HASH> 100644 --- a/EventListener/Traits/ClassChecker.php +++ b/EventListener/Traits/ClassChecker.php @@ -13,7 +13,7 @@ trait ClassChecker /** * @param string $classAnalyzer class analyzer FQCN - * @return this + * @return self */ public function setClassAnalyser($classAnalyzer) {
(minor) Fixed some phpDocs (@return self)
blast-project_BaseEntitiesBundle
train
php
001e36be092904b9d0f1133cb6de64b3682a4f73
diff --git a/spec/datagrid/helper_spec.rb b/spec/datagrid/helper_spec.rb index <HASH>..<HASH> 100644 --- a/spec/datagrid/helper_spec.rb +++ b/spec/datagrid/helper_spec.rb @@ -20,7 +20,7 @@ describe Datagrid::Helper do ) } let(:grid) { SimpleReport.new } - describe ".report_table" do + describe ".datagrid_table" do before(:each) do subject.stub!(:datagrid_order_for).and_return(subject.content_tag(:div, "", :class => "order")) end @@ -50,6 +50,23 @@ describe Datagrid::Helper do ) end end + + describe ".datagrid_order_for" do + it "should render ordreing layout" do + class OrderedGrid + include Datagrid + scope { Entry } + column(:category) + end + report = OrderedGrid.new + subject.datagrid_order_for(report, report.column_by_name(:category)).should equal_to_dom(<<-HTML) +<div class="order"> +<a href="ordered_grid%5Bdescending%5D=&amp;ordered_grid%5Border%5D=category" class="order asc">ASC</a> <a href="ordered_grid%5Bdescending%5D=true&amp;ordered_grid%5Border%5D=category" class="order desc">DESC</a> +</div> +HTML + end + + end end
Fixed #datagrid_order_for helper
bogdan_datagrid
train
rb
9b19005273da79b96628aa3541a7bf9db6293f22
diff --git a/Tests/Unit/Sync/Panther/StorageManager/MysqlStorageManagerTest.php b/Tests/Unit/Sync/Panther/StorageManager/MysqlStorageManagerTest.php index <HASH>..<HASH> 100644 --- a/Tests/Unit/Sync/Panther/StorageManager/MysqlStorageManagerTest.php +++ b/Tests/Unit/Sync/Panther/StorageManager/MysqlStorageManagerTest.php @@ -130,6 +130,21 @@ class MysqlStorageManagerTest extends \PHPUnit_Framework_TestCase } /** + * Test record removal while connection is malfunctioning. + */ + public function testRemoveRecordWhileConnectionIsMalfunctioning() + { + $testRecordId = 123; + + $this->connection->expects($this->once()) + ->method('delete') + ->with(self::TABLE_NAME, ['id' => $testRecordId]) + ->will($this->throwException(new \Exception('Connection is not working'))); + + $this->service->removeRecord($testRecordId); + } + + /** * Test next records retrieval with invalid parameters. */ public function testGetNextRecords()
Add test to achieve <I>% test coverage
ongr-archive_ConnectionsBundle
train
php
c0ad2d3f771b4e0330a991ef61cd0e1a51c6aadf
diff --git a/src/Zeus/Helpers/Controller/Helpers.php b/src/Zeus/Helpers/Controller/Helpers.php index <HASH>..<HASH> 100644 --- a/src/Zeus/Helpers/Controller/Helpers.php +++ b/src/Zeus/Helpers/Controller/Helpers.php @@ -73,7 +73,7 @@ class Helpers implements HelpersInterface * @param string $message * @param boolean $useDate */ - public function filePutContents($filepath, $contents, $message, $usedate = true) + public static function filePutContents($filepath, $contents, $message, $usedate = true) { $suffix = ''; diff --git a/src/Zeus/Helpers/Controller/HelpersInterface.php b/src/Zeus/Helpers/Controller/HelpersInterface.php index <HASH>..<HASH> 100644 --- a/src/Zeus/Helpers/Controller/HelpersInterface.php +++ b/src/Zeus/Helpers/Controller/HelpersInterface.php @@ -35,7 +35,7 @@ interface HelpersInterface * @param string $message * @param boolean $useDate */ - public function filePutContents($filepath, $contents, $message, $usedate = true); + public static function filePutContents($filepath, $contents, $message, $usedate = true); /** * Camelize string.
make filePutsContents method called statically
GetOlympus_Zeus-Core
train
php,php
cdbd1e61ef47c58394a3fffd8bc1884b15b68ece
diff --git a/src/request/sign-transaction/SignTransaction.js b/src/request/sign-transaction/SignTransaction.js index <HASH>..<HASH> 100644 --- a/src/request/sign-transaction/SignTransaction.js +++ b/src/request/sign-transaction/SignTransaction.js @@ -182,7 +182,7 @@ class SignTransaction { * @param {number} [minDecimals] * @returns {string} */ - _formatNumber(value, maxDecimals = 5, minDecimals = 2) { + _formatNumber(value, maxDecimals = 5, minDecimals = 0) { const roundingFactor = 10 ** maxDecimals; value = Math.floor(value * roundingFactor) / roundingFactor;
Hide value decimals if there aren't any
nimiq_keyguard-next
train
js
e20ca9cb0d3fbc178cbb54ed3299a157a68db89b
diff --git a/ical.js b/ical.js index <HASH>..<HASH> 100755 --- a/ical.js +++ b/ical.js @@ -115,6 +115,7 @@ ); newDate = addTZ(newDate, params); + newDate.dateOnly = true; // Store as string - worst case scenario return storeValParam(name)(newDate, curr) diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100755 --- a/test/test.js +++ b/test/test.js @@ -43,6 +43,12 @@ vows.describe('node-ical').addBatch({ , 'has a summary (invalid colon handling tolerance)' : function(topic){ assert.equal(topic.summary, '[Async]: Everything Express') } + , 'has a date only start datetime' : function(topic){ + assert.equal(topic.start.dateOnly, true) + } + , 'has a date only end datetime' : function(topic){ + assert.equal(topic.end.dateOnly, true) + } } , 'event d4c8' :{ topic : function(events){
Adding a dateOnly property when only the date is given. Fixes #<I>
peterbraden_ical.js
train
js,js
6097c8fbab771848f40244ded07efc9f7efc13fc
diff --git a/cloudflare.go b/cloudflare.go index <HASH>..<HASH> 100644 --- a/cloudflare.go +++ b/cloudflare.go @@ -35,6 +35,20 @@ func NewZone() *Zone { return &Zone{} } +// ZoneIDByName retrieves a zone's ID from the name. +func (api *API) ZoneIDByName(zoneName string) (string, error) { + res, err := api.ListZones(zoneName) + if err != nil { + return "", err + } + for _, zone := range res { + if zone.Name == zoneName { + return zone.ID, nil + } + } + return "", errors.New("Zone could not be found") +} + // Params can be turned into a URL query string or a body // TODO: Give this func a better name func (api *API) makeRequest(method, uri string, params interface{}) ([]byte, error) {
Add ZoneIDByName convenience method to get a zone's ID
cloudflare_cloudflare-go
train
go
02ca1124e90248acde14ec408252bd01aac58680
diff --git a/examples/pptxgenjs-demo.js b/examples/pptxgenjs-demo.js index <HASH>..<HASH> 100644 --- a/examples/pptxgenjs-demo.js +++ b/examples/pptxgenjs-demo.js @@ -183,7 +183,7 @@ function execGenSlidesFuncs(type) { { 'placeholder': { options: { name:'body', type:'body', x:0.6, y:1.5, w:12, h:5.25 }, - text: '(supports custom placeholder text!)', + text: '(supports custom placeholder text!)' } } ] @@ -199,8 +199,8 @@ function execGenSlidesFuncs(type) { { 'image': objImg }, { 'placeholder': { - text: '(add homepage URL)', - options: { name:'body', type:'body', x:0.0, y:6.45, w:'100%', h:1, fontFace:'Courier', color:'FFFFFF', fontSize:32, align:'c' } + options: { name:'body', type:'body', x:0.0, y:6.45, w:'100%', h:1, fontFace:'Courier', color:'FFFFFF', fontSize:32, align:'c' }, + text: '(add homepage URL)' } } ]
removed a piece of ES6 code
gitbrent_PptxGenJS
train
js
0567deb9430ef4ef7cb42983e54e96cd3de06bc1
diff --git a/src/Providers/OEmbed.php b/src/Providers/OEmbed.php index <HASH>..<HASH> 100644 --- a/src/Providers/OEmbed.php +++ b/src/Providers/OEmbed.php @@ -183,16 +183,15 @@ class OEmbed extends Provider implements ProviderInterface $images[] = $this->bag->get('url'); } - if ($this->bag->has('image')) { - $images[] = $this->bag->get('image'); - } - - if ($this->bag->has('thumbnail')) { - $images[] = $this->bag->get('thumbnail'); - } - - if ($this->bag->has('thumbnail_url')) { - $images[] = $this->bag->get('thumbnail_url'); + foreach ([ 'image', 'thumbnail', 'thumbnail_url' ] as $type) { + if ($this->bag->has($type)) { + $ret = $this->bag->get($type); + if (is_array($ret)) { + $images = array_merge($images, $ret); + } else { + $images[] = $ret; + } + } } return $images;
Issue #<I> - OEmbed doesn't handle returned arrays of images
oscarotero_Embed
train
php
4a02a757fde29ba21d241c838c8114f64a393fae
diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb index <HASH>..<HASH> 100644 --- a/lib/sinatra/base.rb +++ b/lib/sinatra/base.rb @@ -850,6 +850,8 @@ module Sinatra include Helpers include Templates + URI = ::URI.const_defined?(:Parser) ? ::URI::Parser.new : ::URI + attr_accessor :app attr_reader :template_cache @@ -971,7 +973,7 @@ module Sinatra route = @request.path_info route = '/' if route.empty? and not settings.empty_path_info? return unless match = pattern.match(route) - values += match.captures.to_a.map { |v| force_encoding URI.decode(v) if v } + values += match.captures.to_a.map { |v| force_encoding URI.unescape(v) if v } if values.any? original, @params = params, params.merge('splat' => [], 'captures' => values) @@ -1486,8 +1488,6 @@ module Sinatra end end - URI = ::URI.const_defined?(:Parser) ? ::URI::Parser.new : ::URI - def encoded(char) enc = URI.escape(char) enc = "(?:#{escaped(char, enc).join('|')})" if enc == char
Use URI::Parser#unescape instead of URI::decode URI::decode is deprecated as of Ruby <I>. See: - <URL>
sinatra_sinatra
train
rb
fa3cbbba4dc04306e07f84bb441b9b805e8d20a0
diff --git a/tensorflow_probability/python/distributions/distribution_properties_test.py b/tensorflow_probability/python/distributions/distribution_properties_test.py index <HASH>..<HASH> 100644 --- a/tensorflow_probability/python/distributions/distribution_properties_test.py +++ b/tensorflow_probability/python/distributions/distribution_properties_test.py @@ -472,6 +472,9 @@ class ParameterPropertiesTest(test_util.TestCase): 'TruncatedNormal', 'Uniform') not_annotated_dists = ('Empirical|event_ndims=0', 'Empirical|event_ndims=1', 'Empirical|event_ndims=2', 'FiniteDiscrete', + # cov_perturb_factor is not annotated since its shape + # could be a vector or a matrix. + 'MultivariateNormalDiagPlusLowRankCovariance', 'MultivariateStudentTLinearOperator', 'PoissonLogNormalQuadratureCompound', 'StoppingRatioLogistic',)
Blocklist MVNDiagCovariancePlusLowRankCovariance from ShapeFn tests. PiperOrigin-RevId: <I>
tensorflow_probability
train
py
e6cac50dbe2b707e3293df19f0674c41728f5313
diff --git a/tfatool/cgi.py b/tfatool/cgi.py index <HASH>..<HASH> 100644 --- a/tfatool/cgi.py +++ b/tfatool/cgi.py @@ -35,7 +35,7 @@ def prep_request(method, entrypoint, url=URL, req_kwargs=None, **params): req_kwargs = req_kwargs or {} request = requests.Request(method, resource, params=params, **req_kwargs) prepped = session.prepare_request(request) - logger.info("Request: {}".format(prepped.url)) + logger.debug("Request: {}".format(prepped.url)) return prepped diff --git a/tfatool/sync.py b/tfatool/sync.py index <HASH>..<HASH> 100644 --- a/tfatool/sync.py +++ b/tfatool/sync.py @@ -72,7 +72,8 @@ def _sync_file(destination_dir, fileinfo): def _get_file(fileinfo): - url = URL + "/" + str(PosixPath(fileinfo.directory, fileinfo.filename)) + img_path = urljoin(fileinfo.directory, fileinfo.filename) + url = urljoin(URL, img_path) logger.info("Requesting file: {}".format(url)) request = requests.get(url, stream=True) return request
tfatool/cgi.py CGI request logging at debug level
TadLeonard_tfatool
train
py,py
85c2260b11865e337349a30a258a0e5313f0f55c
diff --git a/internal/service/networkmanager/site_data_source_test.go b/internal/service/networkmanager/site_data_source_test.go index <HASH>..<HASH> 100644 --- a/internal/service/networkmanager/site_data_source_test.go +++ b/internal/service/networkmanager/site_data_source_test.go @@ -48,7 +48,7 @@ resource "aws_networkmanager_site" "test" { global_network_id = aws_networkmanager_global_network.test.id location { - latitude = "18.0029784" + latitude = "18.0029784" longitude = "-76.7897987" }
Fix terrafmt errors in acceptance test configurations.
terraform-providers_terraform-provider-aws
train
go
da987bd30cf1407f79ea190fe0e2d02dd3b12cf0
diff --git a/nox.py b/nox.py index <HASH>..<HASH> 100644 --- a/nox.py +++ b/nox.py @@ -347,6 +347,7 @@ def clean(session): get_path('.cache'), get_path('.coverage'), get_path('build'), + get_path('src', 'bezier', '__pycache__'), get_path('tests', '__pycache__'), get_path('tests', 'functional', '__pycache__'), get_path('tests', 'unit', '__pycache__'),
Updating `nox -s clean` for inplace Python 3 installs.
dhermes_bezier
train
py
ec1fb4f369d26f0a65a6c938b57e1c122eec2fa6
diff --git a/acceptance/lib/puppet_x/acceptance/external_cert_fixtures.rb b/acceptance/lib/puppet_x/acceptance/external_cert_fixtures.rb index <HASH>..<HASH> 100644 --- a/acceptance/lib/puppet_x/acceptance/external_cert_fixtures.rb +++ b/acceptance/lib/puppet_x/acceptance/external_cert_fixtures.rb @@ -35,7 +35,7 @@ class ExternalCertFixtures end def host_entry - @host_entry ||= "127.0.0.3 #{master_name} #{master_short_name} puppet\n" + @host_entry ||= "127.0.0.3 #{master_name} #{master_short_name} puppet" end def root_ca_cert
(PUP-<I>) Removed newline from host_entry test fixture This commit removes the newline character from the end of the host_entry method in the acceptance test ExternalCertFixtures. The presence of this character was causing the jetty_external_root_ca.rb test, when run on Debian, to not properly set the needed hostname entry into the /etc/hosts file.
puppetlabs_puppet
train
rb
b987ead53f4bf92818902eb1ed18262c68ed454b
diff --git a/tests/SessionTests.php b/tests/SessionTests.php index <HASH>..<HASH> 100644 --- a/tests/SessionTests.php +++ b/tests/SessionTests.php @@ -90,6 +90,20 @@ class SessionTests extends PHPUnit_Framework_TestCase } + public function testSetOptionWithError() + { + + $this->assertFalse(@static::getInstance()->setOption(CURLOPT_FILE, 'nope')); + + } + + public function testSetOptionArrayWithError() + { + + $this->assertFalse(@static::getInstance()->setOption(array(CURLOPT_FOLLOWLOCATION => true, CURLOPT_FILE => 'nope'))); + + } + public function testSetProtectedOption() {
Added another session test for <I>% coverage.
jyggen_curl
train
php
93fa56eb85e96baebbf2fce4c350c8e4df5df449
diff --git a/src/com/google/javascript/jscomp/parsing/TypeTransformationParser.java b/src/com/google/javascript/jscomp/parsing/TypeTransformationParser.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/parsing/TypeTransformationParser.java +++ b/src/com/google/javascript/jscomp/parsing/TypeTransformationParser.java @@ -268,11 +268,20 @@ public final class TypeTransformationParser { // No need to add a new warning because the validation does it return false; } + fixLineNumbers(expr); // Store the result if the AST is valid typeTransformationAst = expr; return true; } + private void fixLineNumbers(Node expr) { + // TODO(tbreisacher): Also fix column numbers. + expr.setLineno(expr.getLineno() + templateLineno - 1); + for (Node child : expr.children()) { + fixLineNumbers(child); + } + } + /** * A template type expression must be of the form type(typename, TTLExp,...) * or type(typevar, TTLExp...)
Adjust line numbers of TTL expressions to their correct values. The column numbers are still wrong for some nodes, but this makes it easier to debug TTL issues. ------------- Created by MOE: <URL>
google_closure-compiler
train
java
460915447592ed9d95d17449df1339ea9771438b
diff --git a/packages/tree/src/model/node.js b/packages/tree/src/model/node.js index <HASH>..<HASH> 100644 --- a/packages/tree/src/model/node.js +++ b/packages/tree/src/model/node.js @@ -132,7 +132,7 @@ export default class Node { this.expand(null, store.autoExpandParent); } - if (key && store.currentNodeKey && this.key === store.currentNodeKey) { + if (key && store.currentNodeKey !== undefined && this.key === store.currentNodeKey) { store.currentNode = this; }
Tree: fix current-node-key === 0 bug
ElemeFE_element
train
js
46d95b4c5fda9f25d37cb0b605a10d15a1d710a1
diff --git a/src/trackers/redmine.py b/src/trackers/redmine.py index <HASH>..<HASH> 100644 --- a/src/trackers/redmine.py +++ b/src/trackers/redmine.py @@ -8,6 +8,29 @@ from trackers.base import IssueTracker import requests import json import urllib +import color + +_PRIORITY_COLORS = { + 'Immediate': color.bright_red, + 'Urgent': color.red, + 'High': color.bright_yellow, + 'Normal': color.bright_blue, + 'Low': color.green, +} + +_STATUS_COLORS = { + 'New': color.bright_yellow, + 'In Progress': color.bright_cyan, + 'Resolved': color.green, +} + + +def _format(value, format_dict): + try: + func = format_dict[value] + return func(value) + except KeyError: + return value class Redmine(IssueTracker): @@ -43,7 +66,9 @@ class Redmine(IssueTracker): except KeyError: data['parent'] = None status = self._get_field_name(json_data, "status") + status = _format(status, _STATUS_COLORS) priority = self._get_field_name(json_data, "priority") + priority = _format(priority, _PRIORITY_COLORS) assignee = self._get_field_name(json_data, "assigned_to", "Not assigned") data['text'] = "[{}/{}] - {} - ({})".format(priority, status,
Coloring redmine statuses and priorities
pignacio_issue2branch
train
py
4c8deae96067a9694a0edbd28b8feb6051012006
diff --git a/lib/listings/base.rb b/lib/listings/base.rb index <HASH>..<HASH> 100644 --- a/lib/listings/base.rb +++ b/lib/listings/base.rb @@ -112,7 +112,9 @@ module Listings def query_items(params) @params = params - @data_source = Sources::DataSource.for(self.model_class) + + @data_source = self.model_class + @data_source = Sources::DataSource.for(@data_source) unless @data_source.is_a?(Sources::DataSource) filter_items(self.scoped_params) end diff --git a/lib/listings/sources/object_data_source.rb b/lib/listings/sources/object_data_source.rb index <HASH>..<HASH> 100644 --- a/lib/listings/sources/object_data_source.rb +++ b/lib/listings/sources/object_data_source.rb @@ -55,7 +55,11 @@ module Listings::Sources class DataSource class << self def for_with_object(model) - ObjectDataSource.new(model) + if model.is_a?(Array) # TODO Enumerable + ObjectDataSource.new(model) + else + for_without_object(model) + end end alias_method_chain :for, :object
Allow listing model to be a block that returns the DataSource to be used. Restrict ObjectDataSource to act upon Array only
manastech_listings
train
rb,rb
a2515b4d5c116a8ae010b517c69492f90cc6e438
diff --git a/lib/config-generator.js b/lib/config-generator.js index <HASH>..<HASH> 100644 --- a/lib/config-generator.js +++ b/lib/config-generator.js @@ -193,7 +193,7 @@ class ConfigGenerator { } if (this.webpackConfig.useTypeScriptLoader) { - this.webpackConfig.addLoader({ + rules.push({ test: /\.tsx?$/, exclude: /node_modules/, use: tsLoaderUtil.getLoaders(this.webpackConfig)
Fix ts-loader being added everytime getWebpackConfig is called
symfony_webpack-encore
train
js
584068c26e00bfeb7c4623876552d50f4e9c1618
diff --git a/src/camera.js b/src/camera.js index <HASH>..<HASH> 100644 --- a/src/camera.js +++ b/src/camera.js @@ -121,6 +121,10 @@ export class IsometricCamera extends Camera { constructor(scene, options = {}) { super(scene); this.axis = options.axis || { x: 0, y: 1 }; + if (this.axis.length === 2) { + this.axis = { x: this.axis[0], y: this.axis[1] }; // allow axis to also be passed as 2-elem array + } + this.meter_view_mat = mat4.create(); GLProgram.removeTransform('camera');
camera: also allow isometric axis to be passed as 2-elem array
tangrams_tangram
train
js
4fac690ace82f84c2edafa7349166112ce043b37
diff --git a/lib/classes/plugin_manager.php b/lib/classes/plugin_manager.php index <HASH>..<HASH> 100644 --- a/lib/classes/plugin_manager.php +++ b/lib/classes/plugin_manager.php @@ -753,6 +753,13 @@ class core_plugin_manager { global $CFG; if (empty($branch)) { $branch = $CFG->branch; + if (empty($branch)) { + // During initial install there is no branch set. + require($CFG->dirroot . '/version.php'); + $branch = (int)$branch; + // Force CFG->branch to int value during install. + $CFG->branch = $branch; + } } $return = true; foreach ($this->get_plugins() as $type => $plugins) {
MDL-<I> core: changed branch behaviour during initial install.
moodle_moodle
train
php
6ead8f7abad9f26d8128242e34c3467c55258499
diff --git a/atomicpuppy/atomicpuppy.py b/atomicpuppy/atomicpuppy.py index <HASH>..<HASH> 100644 --- a/atomicpuppy/atomicpuppy.py +++ b/atomicpuppy/atomicpuppy.py @@ -216,14 +216,26 @@ class Page: e.get("eventType"), e.get("eventId")) return None try: - metadata = json.loads(e["metaData"]) + metadata = e.get("metaData") + metadata = json.loads(metadata) if metadata else {} except KeyError: metadata = {} + except ValueError: + self._logger.error( + "Failed to parse json metaData for %s message %s", + e.get("eventType"), e.get("eventId")) + return None try: - link_metadata = json.loads(e["linkMetaData"]) + link_metadata = e.get("linkMetaData") + link_metadata = json.loads(link_metadata) if link_metadata else None except KeyError: link_metadata = None + except ValueError: + self._logger.error( + "Failed to parse json linkMetaData for %s message %s", + e.get("eventType"), e.get("eventId")) + return None type = e["eventType"]
Catch exeption raised by event missing metaData and linkMetaData
madedotcom_atomicpuppy
train
py
2a2b2c427a7437bebd5805c0308bee5716a510d7
diff --git a/lib/6to5/transformers/unicode-regex.js b/lib/6to5/transformers/unicode-regex.js index <HASH>..<HASH> 100644 --- a/lib/6to5/transformers/unicode-regex.js +++ b/lib/6to5/transformers/unicode-regex.js @@ -1,6 +1,6 @@ -var regexpu = require("regexpu"); -var b = require("ast-types").builders; -var _ = require("lodash"); +var rewritePattern = require("regexpu/rewrite-pattern"); +var b = require("ast-types").builders; +var _ = require("lodash"); exports.Literal = function (node) { var regex = node.regex; @@ -10,6 +10,6 @@ exports.Literal = function (node) { if (!_.contains(regex.flags, "u")) return; _.pull(flags, "u"); - var pattern = regexpu.rewritePattern(regex.pattern, regex.flags); + var pattern = rewritePattern(regex.pattern, regex.flags); return b.literal(new RegExp(pattern, flags.join(""))); };
more specific require for regexpu to prevent unneccesary loading
babel_babel
train
js
154f677d094c80fd9a46374bbd22b23821010dd6
diff --git a/capsule/src/main/java/Capsule.java b/capsule/src/main/java/Capsule.java index <HASH>..<HASH> 100644 --- a/capsule/src/main/java/Capsule.java +++ b/capsule/src/main/java/Capsule.java @@ -3381,9 +3381,9 @@ public class Capsule implements Runnable { final String rename = (String) fileAndRename[1]; Path res = lib; - if (!lib.startsWith(getWritableAppCache())) { + if (rename != null && !lib.startsWith(getWritableAppCache())) { try { - res = getWritableAppCache().resolve(rename != null ? rename : lib.getFileName().toString()); + res = getWritableAppCache().resolve(rename); log(LOG_DEBUG, "Copying native lib " + lib + " to " + res); Files.copy(lib, res, StandardCopyOption.REPLACE_EXISTING); fileAndRename[0] = res;
Copy native libs to writeable app cache only if rename != null
puniverse_capsule
train
java
0a0185d9b4be3acea41d8466c36de7b0d8d2c721
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ setup( author_email='[email protected]', url='https://github.com/slok/prometheus-python', packages=packages, - package_data={'': ['LICENSE']}, + package_data={'': ['LICENSE', 'requirements.txt']}, package_dir={'prometheus': 'prometheus'}, include_package_data=True, install_requires=requires,
Added requirements to setup.py
slok_prometheus-python
train
py
2dc479fa3b5c549c0fb0f0311344c5e264550729
diff --git a/lib/skroutz/resource.rb b/lib/skroutz/resource.rb index <HASH>..<HASH> 100644 --- a/lib/skroutz/resource.rb +++ b/lib/skroutz/resource.rb @@ -28,7 +28,7 @@ class Skroutz::Resource protected - def respond_to?(method, include_priv = false) + def respond_to_missing?(method, include_priv = false) method_name = method.to_s if attributes.nil? super
Use respond_to_missing? instead of overriding respond_to in Resource
skroutz_skroutz.rb
train
rb
74d35c103894490f4408b3d4242fedef2410d155
diff --git a/db-migrator-integration-test/src/test/java/org/javalite/db_migrator/AbstractIntegrationSpec.java b/db-migrator-integration-test/src/test/java/org/javalite/db_migrator/AbstractIntegrationSpec.java index <HASH>..<HASH> 100644 --- a/db-migrator-integration-test/src/test/java/org/javalite/db_migrator/AbstractIntegrationSpec.java +++ b/db-migrator-integration-test/src/test/java/org/javalite/db_migrator/AbstractIntegrationSpec.java @@ -29,7 +29,7 @@ import static org.javalite.db_migrator.DbUtils.closeQuietly; public abstract class AbstractIntegrationSpec { - protected String execute(String dir, String... args) { + protected String execute(String dir, String... args)throws IOException, InterruptedException { OutputStream outos = null; PrintStream outps = null; OutputStream erros = null;
#<I> - db-migrator-integration-test not passing on Travis due to security
javalite_activejdbc
train
java
9f4938466675584126be1e0322542421ba56ae76
diff --git a/lib/userlist/config.rb b/lib/userlist/config.rb index <HASH>..<HASH> 100644 --- a/lib/userlist/config.rb +++ b/lib/userlist/config.rb @@ -33,9 +33,8 @@ module Userlist end def method_missing(name, *args, &block) - name = name.to_s - if respond_to_missing?(name) + name = name.to_s method = name.match?(/=$/) ? :[]= : :[] name = name.sub(/=$/, '').to_sym config.public_send(method, name, *args, &block)
Only convert to string when it's needed
userlistio_userlist-ruby
train
rb
874cef2f7571356c8028bbe8cb6ca76e14bb34a6
diff --git a/src/plugins/plugin-debug.js b/src/plugins/plugin-debug.js index <HASH>..<HASH> 100644 --- a/src/plugins/plugin-debug.js +++ b/src/plugins/plugin-debug.js @@ -96,7 +96,7 @@ define('seajs/plugin-debug', [], function() { var div = document.createElement('div') div.innerHTML = html - document.body.appendChild(div) + appendToBody(div) var buttons = div.getElementsByTagName('button') @@ -151,5 +151,22 @@ define('seajs/plugin-debug', [], function() { '; path=/; expires=' + date.toUTCString() } + + var MAX_TRY = 100 + var pollCount = 0 + + function appendToBody(div) { + pollCount++ + + if (document.body) { + document.body.appendChild(div) + } + else if (pollCount < MAX_TRY) { + setTimeout(function() { + appendToBody(div) + }, 200) + } + } + });
Do not throw error when document.body is unready
seajs_seajs
train
js
033258f59ad28743766da133cf8a0e1cfd29993f
diff --git a/test/e2e/specs/wp-signup-spec.js b/test/e2e/specs/wp-signup-spec.js index <HASH>..<HASH> 100644 --- a/test/e2e/specs/wp-signup-spec.js +++ b/test/e2e/specs/wp-signup-spec.js @@ -1483,7 +1483,7 @@ describe( `[${ host }] Sign Up (${ screenSize }, ${ locale })`, function() { } ); } ); - describe( 'Import a site while signing up @parallel', function() { + describe.skip( 'Import a site while signing up @parallel', function() { // Currently must use a Wix or GoDaddy site to be importable through this flow. const siteURL = 'https://hi6822.wixsite.com/eat-here-its-good'; const userName = dataHelper.getNewBlogName();
Disable import in Sign up (#<I>)
Automattic_wp-calypso
train
js
1efcca0e872a68dc3d9ff75ea066a279c2b7b717
diff --git a/pyArango/database.py b/pyArango/database.py index <HASH>..<HASH> 100644 --- a/pyArango/database.py +++ b/pyArango/database.py @@ -59,7 +59,7 @@ class Database(object) : self.collections[colName] = colObj else : - raise updateError(data["errorMessage"], data) + raise UpdateError(data["errorMessage"], data) def reloadGraphs(self) : "reloads the graph list"
Fixing typo in call to UpdateError exception
ArangoDB-Community_pyArango
train
py
f5da61d1342d3b7ba267c996f913a2481ecaccaa
diff --git a/bundles/org.eclipse.orion.client.core/static/js/commands.js b/bundles/org.eclipse.orion.client.core/static/js/commands.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.core/static/js/commands.js +++ b/bundles/org.eclipse.orion.client.core/static/js/commands.js @@ -467,6 +467,7 @@ eclipse.Command = (function() { }); } dojo.addClass(image, 'commandImage'); + dojo.addClass(link, 'commandLink'); dojo.place(image, link, "last"); return link; },
add link class to links (this also increases hit area of image and spacing a bit)
eclipse_orion.client
train
js
6bd214862d952a6721ddca00793214b524d9ba8a
diff --git a/macroeco/models/_curves.py b/macroeco/models/_curves.py index <HASH>..<HASH> 100644 --- a/macroeco/models/_curves.py +++ b/macroeco/models/_curves.py @@ -230,13 +230,13 @@ class mete_sar_gen(curve): lower = 1 upper = array_size + 1 S = 0 - print S0,N0 + #print S0,N0 if S0 < 1 or np.isnan(S0): # Give up if S0 too small return np.nan, N0*a while lower < N0: - print lower + #print lower if upper > N0: upper = N0 + 1 @@ -279,7 +279,7 @@ class mete_sar_gen(curve): def _upscale_step(self, a, S0, N0, array_size, approx): N1 = N0*a - print a + # print a def eq(S1, N1, a, S0, array_size, approx): return S0-self._downscale_step(1/a, S1, N1, array_size, approx)[0]
Commented printing in mete_sar fxn
jkitzes_macroeco
train
py
4dae9ca02ff5d2a404a0e28a789549eb943cc43a
diff --git a/src/Client/StreamHandler.php b/src/Client/StreamHandler.php index <HASH>..<HASH> 100644 --- a/src/Client/StreamHandler.php +++ b/src/Client/StreamHandler.php @@ -316,6 +316,10 @@ class StreamHandler private function add_debug(array $request, &$options, $value, &$params) { + if ($value === false) { + return; + } + static $map = [ STREAM_NOTIFY_CONNECT => 'CONNECT', STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED',
debug=false validation added
guzzle_RingPHP
train
php
d5d66f7024eec6797fc11ef4cf3e2b1e931d1761
diff --git a/views/single.blade.php b/views/single.blade.php index <HASH>..<HASH> 100644 --- a/views/single.blade.php +++ b/views/single.blade.php @@ -16,6 +16,12 @@ </div> </div> + @if (is_active_sidebar('content-area')) + <div class="grid sidebar-content-area"> + <?php dynamic_sidebar('content-area'); ?> + </div> + @endif + @if (is_single() && comments_open()) <div class="grid"> <div class="grid-sm-12">
Added content-widget-area to single posts
helsingborg-stad_Municipio
train
php
c8808ee5e5059657d8704734f66513da4540e210
diff --git a/drools-planner-examples/src/main/java/org/drools/planner/examples/nurserostering/solver/move/factory/ShiftAssignmentPillarPartSwitchMoveFactory.java b/drools-planner-examples/src/main/java/org/drools/planner/examples/nurserostering/solver/move/factory/ShiftAssignmentPillarPartSwitchMoveFactory.java index <HASH>..<HASH> 100644 --- a/drools-planner-examples/src/main/java/org/drools/planner/examples/nurserostering/solver/move/factory/ShiftAssignmentPillarPartSwitchMoveFactory.java +++ b/drools-planner-examples/src/main/java/org/drools/planner/examples/nurserostering/solver/move/factory/ShiftAssignmentPillarPartSwitchMoveFactory.java @@ -178,7 +178,7 @@ public class ShiftAssignmentPillarPartSwitchMoveFactory extends AbstractMoveFact } - private class LowestDayIndexAssignmentSequenceIterator implements Iterator<AssignmentSequence> { + private static class LowestDayIndexAssignmentSequenceIterator implements Iterator<AssignmentSequence> { private Iterator<AssignmentSequence> leftIterator; private Iterator<AssignmentSequence> rightIterator;
findbugs be a _static_ inner class?
kiegroup_optaplanner
train
java
833bf2945f7f020d8485c8e18dcbb78ce7ec1b2a
diff --git a/stl/__about__.py b/stl/__about__.py index <HASH>..<HASH> 100644 --- a/stl/__about__.py +++ b/stl/__about__.py @@ -1,6 +1,6 @@ __package_name__ = 'numpy-stl' __import_name__ = 'stl' -__version__ = '2.10.1' +__version__ = '2.11.0' __author__ = 'Rick van Hattem' __author_email__ = '[email protected]' __description__ = ' '.join('''
Incrementing version to <I>
WoLpH_numpy-stl
train
py
141b7981279db077c424f3211c447548762edd01
diff --git a/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php b/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php +++ b/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php @@ -28,10 +28,11 @@ class ClassCollectionLoader * @param string $name The cache name prefix * @param Boolean $autoReload Whether to flush the cache when the cache is stale or not * @param Boolean $adaptive Whether to remove already declared classes or not + * @param string $extension File extension of the resulting file * * @throws \InvalidArgumentException When class can't be loaded */ - static public function load($classes, $cacheDir, $name, $autoReload, $adaptive = false) + static public function load($classes, $cacheDir, $name, $autoReload, $adaptive = false, $extension = '.php') { // each $name can only be loaded once per PHP process if (isset(self::$loaded[$name])) { @@ -50,7 +51,7 @@ class ClassCollectionLoader $name = $name.'-'.substr(md5(implode('|', $classes)), 0, 5); } - $cache = $cacheDir.'/'.$name.'.php'; + $cache = $cacheDir.'/'.$name.$extension; // auto-reload $reload = false;
make it possible to define the file extension
symfony_symfony
train
php
0841516f31f6d0fca0e2e542c5a8714b7823c0e3
diff --git a/lib/aws/pageable_response.rb b/lib/aws/pageable_response.rb index <HASH>..<HASH> 100644 --- a/lib/aws/pageable_response.rb +++ b/lib/aws/pageable_response.rb @@ -36,21 +36,21 @@ module Aws # hash to the constructor. If the hash is empty, then paging # will be disabled. # - # # disables pagigng - # page = PageableResponse.new(response, paging_rules: {}) - # page.last_page? - # #=> true + # # disables pagigng + # page = PageableResponse.new(response, paging_rules: {}) + # page.last_page? + # #=> true # # ### Tokens # # If you want to configure paging you must specify at least # the `tokens` entry: # - # paging_rules = { - # 'tokens' => { - # 'input_param' => 'response_key', - # } - # } + # paging_rules = { + # 'tokens' => { + # 'input_param' => 'response_key', + # } + # } # # Tokens should be a hash of request parameter names as keys, and # response data member names as values. The `response.data` is
Corrected the indentation of a few documentation examples.
aws_aws-sdk-ruby
train
rb
ff30bea0877f1ef4b177e48a2a2b6f34b7aaa298
diff --git a/osmnx/simplification.py b/osmnx/simplification.py index <HASH>..<HASH> 100644 --- a/osmnx/simplification.py +++ b/osmnx/simplification.py @@ -113,10 +113,19 @@ def _build_path(G, node, endpoints, path): # if this successor is already in the path, ignore it, otherwise add # it to the path path.append(successor) - if successor not in endpoints: - # if this successor is not an endpoint, recursively call - # build_path until you find an endpoint - path = _build_path(G, successor, endpoints, path) + while successor not in endpoints: + nodes = [n for n in G.successors(successor) if n not in path] + # If nodes is empty, we should be on a self contained ring + # If nodes is longer than one, we fork into two paths + if len(nodes) == 1: + successor = nodes[0] + path.append(successor) + else: + # if this successor is not an endpoint, recursively call + # build_path until you find an endpoint + return _build_path(G, successor, endpoints, path) + + # We only enter this else statement if the while loop finishes properly! else: # if this successor is an endpoint, we've completed the path, # so return it
fix _build_path to cover long roads without RecursionError
gboeing_osmnx
train
py
ec07b52ea9c00b4b2b0e3915c443ff9263862e11
diff --git a/lib/declarative_authorization/obligation_scope.rb b/lib/declarative_authorization/obligation_scope.rb index <HASH>..<HASH> 100644 --- a/lib/declarative_authorization/obligation_scope.rb +++ b/lib/declarative_authorization/obligation_scope.rb @@ -246,15 +246,13 @@ module Authorization case [existing_join.class, path_join.class] when [Symbol, Hash] - joins.delete(existing_join) - joins << path_join + joins[joins.index(existing_join)] = path_join when [Hash, Hash] - joins.delete(existing_join) - joins << path_join.deep_merge(existing_join) + joins[joins.index(existing_join)] = path_join.deep_merge(existing_join) when [NilClass, Hash], [NilClass, Symbol] joins << path_join end - end + end case obligation_conditions.length when 0 then
don't re-order joins; merge in place instead
stffn_declarative_authorization
train
rb
1d1b7b2624745e8d3605a159a0de37fb8ac95f5a
diff --git a/example/sp-wsgi/sp.py b/example/sp-wsgi/sp.py index <HASH>..<HASH> 100755 --- a/example/sp-wsgi/sp.py +++ b/example/sp-wsgi/sp.py @@ -877,8 +877,17 @@ if __name__ == '__main__': POLICY = service_conf.POLICY add_urls() - - ds.DefaultSignature(service_conf.SIGN_ALG, service_conf.DIGEST_ALG) + sign_alg = None + digest_alg = None + try: + sign_alg = service_conf.SIGN_ALG + except: + pass + try: + digest_alg = service_conf.DIGEST_ALG + except: + pass + ds.DefaultSignature(sign_alg, digest_alg) SRV = wsgiserver.CherryPyWSGIServer((HOST, PORT), application)
Changed the sp to accept config files without sign and digest configurations.
IdentityPython_pysaml2
train
py
6829e8168ee588952813f84232cbf58d71c9ec47
diff --git a/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/models/textModelTests.js b/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/models/textModelTests.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/models/textModelTests.js +++ b/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/models/textModelTests.js @@ -10,6 +10,7 @@ ******************************************************************************/ /*eslint-env browser, amd, mocha*/ +/*eslint-disable missing-nls*/ define(["chai/chai", 'orion/editor/textModel', 'orion/editor/annotations'], function(chai, mTextModel) { var assert = chai.assert;
[nobug] - disable missing nls warning in test file
eclipse_orion.client
train
js
6bf02657b6ccc47d01fa19f1ccc496480bd768c5
diff --git a/src/Psalm/Internal/Codebase/ClassConstantByWildcardResolver.php b/src/Psalm/Internal/Codebase/ClassConstantByWildcardResolver.php index <HASH>..<HASH> 100644 --- a/src/Psalm/Internal/Codebase/ClassConstantByWildcardResolver.php +++ b/src/Psalm/Internal/Codebase/ClassConstantByWildcardResolver.php @@ -55,6 +55,6 @@ final class ClassConstantByWildcardResolver $matched_class_constant_types[] = $class_constant_storage->type->getAtomicTypes(); } - return array_values(array_merge(...$matched_class_constant_types)); + return array_values(array_merge([], ...$matched_class_constant_types)); } }
qa: ensure `array_merge` has at least one argument
vimeo_psalm
train
php
fa46ddaf5a7c52f632c171d8502e56f65c02d630
diff --git a/lib/ftl/client.rb b/lib/ftl/client.rb index <HASH>..<HASH> 100644 --- a/lib/ftl/client.rb +++ b/lib/ftl/client.rb @@ -37,9 +37,11 @@ module Ftl def initialize(args=nil, opts={}) load_config(opts) - @con = Fog::Compute.new(:provider => 'AWS', :aws_secret_access_key => options['SECRET_ACCESS_KEY'], :aws_access_key_id => options['ACCESS_KEY_ID']) if args && args.length > 0 arg = args.reverse.pop + if (arg != 'edit') + @con = Fog::Compute.new(:provider => 'AWS', :aws_secret_access_key => options['SECRET_ACCESS_KEY'], :aws_access_key_id => options['ACCESS_KEY_ID']) + end send(arg, args - [arg]) else Ftl.help
Don't try to initialize Fog if the command is "edit"
lodestone_ftl
train
rb
83ca1345abe09edbd389eba0593c3e2a030680bc
diff --git a/pydsl/Parser/Weighted.py b/pydsl/Parser/Weighted.py index <HASH>..<HASH> 100644 --- a/pydsl/Parser/Weighted.py +++ b/pydsl/Parser/Weighted.py @@ -159,7 +159,7 @@ class WeightedParser(TopDownParser): #result += self.__recursive_parser(alternative.rightside, data, alternative, showerrors) alternative_result = self.__handle_alternative(alternative.rightside, data, alternative, showerrors) for x in alternative_result: - if x.symbollist == alternative.rightside: #Filters incomplete attempts + if list(x.symbollist) == list(alternative.rightside): #Filters incomplete attempts result.append(ParseTree(x.leftpos, x.rightpos, [onlysymbol], data[x.leftpos:x.rightpos], production, valid = True)) #TODO: Add child if showerrors and not result:
fixed tuple and list comparison
nesaro_pydsl
train
py
0b90095eafe2d4f09e4c2bb89ab8b54abc7b4257
diff --git a/packages/core/parcel-bundler/src/Logger.js b/packages/core/parcel-bundler/src/Logger.js index <HASH>..<HASH> 100644 --- a/packages/core/parcel-bundler/src/Logger.js +++ b/packages/core/parcel-bundler/src/Logger.js @@ -42,7 +42,7 @@ class Logger { return; } - this.write(this.chalk.yellow(message)); + this.write(this.chalk.yellow(`${emoji.warning} ${message}`)); } error(err) { diff --git a/packages/core/parcel-bundler/src/utils/emoji.js b/packages/core/parcel-bundler/src/utils/emoji.js index <HASH>..<HASH> 100644 --- a/packages/core/parcel-bundler/src/utils/emoji.js +++ b/packages/core/parcel-bundler/src/utils/emoji.js @@ -4,3 +4,4 @@ const supportsEmoji = process.platform !== 'win32' || process.env.VSCODE_PID; exports.progress = supportsEmoji ? '⏳' : '∞'; exports.success = supportsEmoji ? '✨' : '√'; exports.error = supportsEmoji ? '🚨' : '×'; +exports.warning = supportsEmoji ? '⚠️' : '‼';
Add a warning emoji to the logger (#<I>)
parcel-bundler_parcel
train
js,js
f00cffc0c1e2f2ef19f4de5af5159fb00ee6be92
diff --git a/cloud_blobstore/s3.py b/cloud_blobstore/s3.py index <HASH>..<HASH> 100644 --- a/cloud_blobstore/s3.py +++ b/cloud_blobstore/s3.py @@ -6,8 +6,8 @@ import typing from boto3.s3.transfer import TransferConfig -from botocore.vendored.requests.exceptions import ConnectTimeout, ReadTimeout from botocore.exceptions import EndpointConnectionError +from botocore.vendored.requests.exceptions import ConnectTimeout, ReadTimeout from . import ( BlobMetadataField, @@ -24,7 +24,7 @@ def CatchTimeouts(meth): def wrapped(*args, **kwargs): try: return meth(*args, **kwargs) - except (ConnectTimeout, ReadTimeout, EndpointConnectionError) as ex: + except (ConnectTimeout, EndpointConnectionError, ReadTimeout) as ex: raise BlobStoreTimeoutError(ex) return wrapped
Update exception thrown to match s3/botocore's change. (#<I>)
HumanCellAtlas_cloud-blobstore
train
py
1eb6fb89f79a189a94846d37457733f314fd38fd
diff --git a/sparc/apps/cache/cache.py b/sparc/apps/cache/cache.py index <HASH>..<HASH> 100644 --- a/sparc/apps/cache/cache.py +++ b/sparc/apps/cache/cache.py @@ -171,11 +171,16 @@ class cache(object): area.initialize() while True: try: - new = area.import_source(source) + count = 0 + for item in source.items(): + if area.cache(item): + count += 1 + if kwargs['exit_'].is_set(): + break if ITransactionalCacheArea.providedBy(area): area.commit() logger.info("Found %d new items in cachablesource %s" % \ - (new, kwargs['cacheablesource'].attrib['id'])) + (count, kwargs['cacheablesource'].attrib['id'])) notify(CompletedCachableSourcePoll(source)) except Exception: if ITransactionalCacheArea.providedBy(area): @@ -205,7 +210,7 @@ class cache(object): while threading.active_count() > 1: time.sleep(.001) except KeyboardInterrupt: - logger.info("Exiting application.") + logger.info("KeyboardInterrupt signal caught, shutting down pollers...") exit_.set()
iterate cache source manually, so to be able to catch interupt signal faster
davisd50_sparc.apps.cache
train
py
6cdc571aa7db661f9676077ca04dd2d73cb1f209
diff --git a/src/frontend/org/voltdb/compiler/statements/DropTopic.java b/src/frontend/org/voltdb/compiler/statements/DropTopic.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/compiler/statements/DropTopic.java +++ b/src/frontend/org/voltdb/compiler/statements/DropTopic.java @@ -23,6 +23,7 @@ import org.hsqldb_voltpatches.VoltXMLElement; import org.voltdb.catalog.CatalogMap; import org.voltdb.catalog.Database; import org.voltdb.catalog.Topic; +import org.voltdb.common.Constants; import org.voltdb.compiler.DDLCompiler; import org.voltdb.compiler.DDLCompiler.DDLStatement; import org.voltdb.compiler.DDLCompiler.StatementProcessor; @@ -56,6 +57,7 @@ public class DropTopic extends StatementProcessor { VoltXMLElement tableXML = m_schema.findChild("table", name.toUpperCase()); if (tableXML != null) { tableXML.attributes.remove("topicName"); + tableXML.attributes.put("export", Constants.CONNECTORLESS_STREAM_TARGET_NAME); } } return true;
ENG-<I>: when dropping a topic, make sure to add the stream back to unspecified target connector (#<I>)
VoltDB_voltdb
train
java
f18ebf23c37f03c9173be32424608654b2818137
diff --git a/src/infi/projector/plugins/builtins/version/__init__.py b/src/infi/projector/plugins/builtins/version/__init__.py index <HASH>..<HASH> 100644 --- a/src/infi/projector/plugins/builtins/version/__init__.py +++ b/src/infi/projector/plugins/builtins/version/__init__.py @@ -119,7 +119,7 @@ class VersionPlugin(CommandPlugin): with open('setup.py') as fd: has_c_extensions = 'ext_modules' in fd.read() - for distribution in : + for distribution in self.arguments.get("--distributions").split(','): for pypi in self.arguments.get("--pypi-servers").split(','): if not pypi: continue
HOSTDEV-<I> fixing previous commit
Infinidat_infi.projector
train
py
417bb88bdc6f8894848f9b27e3ea963945898704
diff --git a/src/Search/Results.php b/src/Search/Results.php index <HASH>..<HASH> 100644 --- a/src/Search/Results.php +++ b/src/Search/Results.php @@ -21,7 +21,7 @@ class Results /** * @param array $items - * @param Integer $totalItems + * @param \ValueObjects\Number\Integer $totalItems */ public function __construct(array $items, Integer $totalItems) { @@ -38,7 +38,7 @@ class Results } /** - * @return Integer + * @return \ValueObjects\Number\Integer */ public function getTotalItems() {
III-<I>: Use complete class name for Integer type hinting in docblocks to prevent IDE confusion with int.
cultuurnet_udb3-php
train
php
ae3adf4f4f3b1270d9f8b41a02b61d47d9b89012
diff --git a/core/flyout_vertical.js b/core/flyout_vertical.js index <HASH>..<HASH> 100644 --- a/core/flyout_vertical.js +++ b/core/flyout_vertical.js @@ -237,7 +237,7 @@ Blockly.VerticalFlyout.prototype.setMetrics_ = function(xyRatio) { this.workspace_.translate(this.workspace_.scrollX + metrics.absoluteLeft, this.workspace_.scrollY + metrics.absoluteTop); - this.clipRect_.setAttribute('height', metrics.viewHeight + 'px'); + this.clipRect_.setAttribute('height', Math.max(0, metrics.viewHeight) + 'px'); this.clipRect_.setAttribute('width', metrics.viewWidth + 'px'); }; @@ -269,7 +269,7 @@ Blockly.VerticalFlyout.prototype.position = function() { } // Record the height for Blockly.Flyout.getMetrics_ - this.height_ = targetWorkspaceMetrics.viewHeight - y; + this.height_ = Math.max(0, targetWorkspaceMetrics.viewHeight - y); this.setBackgroundPath_(this.width_, this.height_);
Don't attempt to give the flyout negative height Fixes #<I>
LLK_scratch-blocks
train
js
b58f860fc1c614223baad7ed6775115fa5322eb5
diff --git a/lib/survey_gizmo/api/survey.rb b/lib/survey_gizmo/api/survey.rb index <HASH>..<HASH> 100644 --- a/lib/survey_gizmo/api/survey.rb +++ b/lib/survey_gizmo/api/survey.rb @@ -7,7 +7,7 @@ module SurveyGizmo; module API # @return [$2] attribute :id, Integer attribute :team, Integer - attribute :_type, String + attribute :type, String attribute :_subtype, String attribute :status, String attribute :forward_only, Boolean diff --git a/spec/resource_spec.rb b/spec/resource_spec.rb index <HASH>..<HASH> 100644 --- a/spec/resource_spec.rb +++ b/spec/resource_spec.rb @@ -47,7 +47,7 @@ describe "Survey Gizmo Resource" do end describe SurveyGizmo::API::Survey do - let(:create_attributes){ {:title => 'Spec', :_type => 'survey', :status => 'In Design'} } + let(:create_attributes){ {:title => 'Spec', :type => 'survey', :status => 'In Design'} } let(:get_attributes) { create_attributes.merge(:id => 1234) } let(:update_attributes){ {:title => 'Updated'} } let(:first_params){ {:id => 1234} }
renamed survey.rb variable to allow creation of surveys (previously returned errors)
jarthod_survey-gizmo-ruby
train
rb,rb
351952c8fddb949ba3ae9794528063e3f3dc6d04
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -260,9 +260,6 @@ DailymotionAPI.prototype.upload = function(options) { }, formData: { file: fs.createReadStream(options.filepath) - }, - headers: { - 'Content-Type': 'video/mp4' } }, function(e, r, body) { try { var uploadRes = JSON.parse(body); }
Fixed content-type override mistake
OtaK_dailymotion-sdk-node
train
js
643c75f1548e4fabedc45a1413d3cd5dc8421f46
diff --git a/Command/GenerateDoctrineDocumentCommand.php b/Command/GenerateDoctrineDocumentCommand.php index <HASH>..<HASH> 100644 --- a/Command/GenerateDoctrineDocumentCommand.php +++ b/Command/GenerateDoctrineDocumentCommand.php @@ -7,7 +7,7 @@ use Sensio\Bundle\GeneratorBundle\Command\Helper\DialogHelper; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Doctrine\ODM\MongoDB\Mapping\Types\Type; +use Doctrine\ODM\MongoDB\Types\Type; class GenerateDoctrineDocumentCommand extends GenerateDoctrineCommand {
For compatibility with doctrine/mongodb-odm:dev-master, the location of Mappings/Types has changed
iambrosi_IsmaAmbrosiGeneratorBundle
train
php
f1956874c203c13477024ff8f622eb74f8f24e39
diff --git a/api.py b/api.py index <HASH>..<HASH> 100644 --- a/api.py +++ b/api.py @@ -35,9 +35,9 @@ from pyemma.msm.ui.hmsm_bayesian_estimator import BayesianHMSMEstimator as _Baye from flux import tpt as tpt_factory from pyemma.msm.estimators.msm_estimator import MSMEstimator as _MSMEstimator -from ui import ImpliedTimescales -from ui import MSM -from ui import cktest as chapman_kolmogorov +from util import ImpliedTimescales +from models import MSM +from util import cktest as chapman_kolmogorov __author__ = "Benjamin Trendelkamp-Schroer, Martin Scherer, Frank Noe"
changed ui to util in import
markovmodel_msmtools
train
py
3683cd6b5cc45bb518be07e99fc3abe0e0b3102c
diff --git a/lib/DataManager/DataHandlerDrivers/PdoHandlerDriver.php b/lib/DataManager/DataHandlerDrivers/PdoHandlerDriver.php index <HASH>..<HASH> 100644 --- a/lib/DataManager/DataHandlerDrivers/PdoHandlerDriver.php +++ b/lib/DataManager/DataHandlerDrivers/PdoHandlerDriver.php @@ -15,6 +15,8 @@ namespace CondorcetPHP\Condorcet\DataManager\DataHandlerDrivers; use CondorcetPHP\Condorcet\CondorcetException; use CondorcetPHP\Condorcet\CondorcetVersion; +use CondorcetPHP\Condorcet\DataManager\DataContextInterface; + class PdoHandlerDriver implements DataHandlerDriverInterface {
Fix property type DataContextInterface for PDO driver (PHP <I>)
julien-boudry_Condorcet
train
php
11310954ead5bc13d35aa1115bee7fa6c2eb16f8
diff --git a/version.php b/version.php index <HASH>..<HASH> 100644 --- a/version.php +++ b/version.php @@ -29,11 +29,11 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2014041101.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2014041500.00; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes. -$release = '2.7beta (Build: 20140411)'; // Human-friendly version name +$release = '2.7beta+ (Build: 20140415)'; // Human-friendly version name $branch = '27'; // This version's branch. $maturity = MATURITY_BETA; // This version's maturity level.
on-demand release <I>beta+
moodle_moodle
train
php
79db35f964e37b563cf63da519eced9ba07ab8bb
diff --git a/src/Tymon/JWTAuth/JWTAuth.php b/src/Tymon/JWTAuth/JWTAuth.php index <HASH>..<HASH> 100755 --- a/src/Tymon/JWTAuth/JWTAuth.php +++ b/src/Tymon/JWTAuth/JWTAuth.php @@ -103,7 +103,7 @@ class JWTAuth { $id = $this->provider->getSubject($this->token); - if (! $user = $this->auth->loginUsingId($id) ) + if (! $user = $this->auth->onceUsingId($id) ) { return false; } @@ -202,7 +202,7 @@ class JWTAuth { } /** - * Magically call the JWT driver + * Magically call the JWT provider * * @param string $method * @param array $parameters
adding once using id method to remove session/cookie dependency
tymondesigns_jwt-auth
train
php
cf0eec4c2e11a855deac7f5c8e45be88f6c3ea71
diff --git a/core/testMinimumPhpVersion.php b/core/testMinimumPhpVersion.php index <HASH>..<HASH> 100644 --- a/core/testMinimumPhpVersion.php +++ b/core/testMinimumPhpVersion.php @@ -100,7 +100,7 @@ if (!function_exists('Piwik_ExitWithMessage')) { </ul>'; } if ($optionalLinkBack) { - $optionalLinkBack = '<a href="javascript:window.back();">Go Back</a><br/>'; + $optionalLinkBack = '<a href="javascript:window.history.back();">Go Back</a><br/>'; } $headerPage = file_get_contents(PIWIK_INCLUDE_PATH . '/plugins/Zeitgeist/templates/simpleLayoutHeader.tpl'); $footerPage = file_get_contents(PIWIK_INCLUDE_PATH . '/plugins/Zeitgeist/templates/simpleLayoutFooter.tpl');
Fix: window.back() does not exist! Uncaught TypeError: Object [object global] has no method 'back' --> window.history.back()
matomo-org_matomo
train
php
61f06abf19361c8021f3952847b14f727ae1fa7c
diff --git a/lib/fastlane_core/configuration.rb b/lib/fastlane_core/configuration.rb index <HASH>..<HASH> 100644 --- a/lib/fastlane_core/configuration.rb +++ b/lib/fastlane_core/configuration.rb @@ -62,7 +62,7 @@ module FastlaneCore # `if value == nil` instead of ||= because false is also a valid value - value ||= @values[key] + value = @values[key] # TODO: configuration files if value == nil @@ -74,6 +74,7 @@ module FastlaneCore value = false if (value == nil and not option.is_string) # by default boolean flags are false while value == nil and !option.optional + Helper.log.info "To not be asked about this value, you can specify it using '#{option.key}'".yellow value = ask("#{option.description}: ") # Also store this value to use it from now on begin
Added information on how to not be asked about a value
fastlane_fastlane
train
rb
a0fb9e8e65c9aa9a4fabb2ab507627e9877f39d6
diff --git a/mod/wiki/ewiki/plugins/moodle/moodle_wikidump.php b/mod/wiki/ewiki/plugins/moodle/moodle_wikidump.php index <HASH>..<HASH> 100644 --- a/mod/wiki/ewiki/plugins/moodle/moodle_wikidump.php +++ b/mod/wiki/ewiki/plugins/moodle/moodle_wikidump.php @@ -402,21 +402,7 @@ function ewiki_page_wiki_dump_send($exportbinaries=0, $exportformats=0, $withvir if(!$exportdestinations) { $archivename=$wname.".zip"; - if (empty($CFG->zip)) { // Use built-in php-based zip function - include_once("$CFG->libdir/pclzip/pclzip.lib.php"); - $archive = new PclZip("$exportbasedir/$archivename"); - if (($list = $archive->create($filestozip,'',"$exportbasedir/")) == 0) { - error($archive->errorInfo(true)); - } - } else { // Use external zip program - $files = ""; - foreach ($filestozip as $file) { - $files .= $wname."/".basename($file); - $files .= " "; - } - $command = "cd $exportbasedir ; $CFG->zip -r $archivename $files"; - Exec($command); - } + zip_files($filestozip, "$exportbasedir/$archivename"); #-- Headers Header("Content-type: application/zip");
merged from MOODLE_<I>_STABLE; updated zipping code - see bug #<I>
moodle_moodle
train
php
73e9c2907f8e126fa72a6c42408e1848320bd2e5
diff --git a/lib/authlogic/acts_as_authentic/queries/find_with_case.rb b/lib/authlogic/acts_as_authentic/queries/find_with_case.rb index <HASH>..<HASH> 100644 --- a/lib/authlogic/acts_as_authentic/queries/find_with_case.rb +++ b/lib/authlogic/acts_as_authentic/queries/find_with_case.rb @@ -21,27 +21,11 @@ module Authlogic # @api private def execute - bind(comparison).first + @model_class.where(comparison).first end private - # - comparison - Arel::Nodes::Equality - # - # @api private - def bind(comparison) - if AR_GEM_VERSION >= Gem::Version.new("5") - bind = ActiveRecord::Relation::QueryAttribute.new( - @field, - @value, - ActiveRecord::Type::Value.new - ) - @model_class.where(comparison, bind) - else - @model_class.where(comparison) - end - end - # @api private # @return Arel::Nodes::Equality def comparison
FindWithCase no longer needs to support AR <I> The where(condition, bind) signature is an AR <I> thing, not needed in <I> or <I>. We dropped support for AR <I> when it reached EoL.
binarylogic_authlogic
train
rb
1e279b0778107ad057e8cb747372a68d1d1fd7be
diff --git a/src/sap.ui.layout/src/sap/ui/layout/FixFlex.js b/src/sap.ui.layout/src/sap/ui/layout/FixFlex.js index <HASH>..<HASH> 100644 --- a/src/sap.ui.layout/src/sap/ui/layout/FixFlex.js +++ b/src/sap.ui.layout/src/sap/ui/layout/FixFlex.js @@ -244,9 +244,15 @@ sap.ui.define(["jquery.sap.global", "sap/ui/core/Control", "sap/ui/core/EnabledP */ FixFlex.prototype._changeFlexibleContainerScroll = function () { - var $flexibleContainer = this.$("FlexibleContainer"); + var $flexibleContainer = this.$("FlexibleContainer"), + containerHeight = $flexibleContainer.height(), + childrenHeight = $flexibleContainer.children().height(); - if ($flexibleContainer.height() > $flexibleContainer.children().height()) { + if (containerHeight == childrenHeight){ + return; + } + + if (containerHeight > childrenHeight) { $flexibleContainer.addClass('sapUiFixFlexFlexibleContainerHeight'); } else { $flexibleContainer.removeClass('sapUiFixFlexFlexibleContainerHeight');
[INTERNAL] sap.ui.layout.FixFlex: Flexible container scrolling is now ok Change-Id: I<I>bd<I>de0f4a4fcf<I>d0c<I>ad<I>f
SAP_openui5
train
js
a2032c3042b0828b8ee3e5856f53264c26968f23
diff --git a/tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php b/tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php index <HASH>..<HASH> 100644 --- a/tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php +++ b/tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php @@ -20,6 +20,13 @@ abstract class ThunderJavascriptTestBase extends WebDriverTestBase { use StringTranslationTrait; /** + * Keep CSS animations enabled for JavaScript tests. + * + * @var bool + */ + protected $disableCssAnimations = FALSE; + + /** * Modules to enable. * * The test runner will merge the $modules lists from this class, the class
Issue #<I> by mtodor, chr.fritsch: Failing tests with Drupal <I>
BurdaMagazinOrg_thunder-distribution
train
php
195c73d04708c8b0471af9c80e25361f7dee8e25
diff --git a/app/src/Bolt/BaseExtension.php b/app/src/Bolt/BaseExtension.php index <HASH>..<HASH> 100644 --- a/app/src/Bolt/BaseExtension.php +++ b/app/src/Bolt/BaseExtension.php @@ -46,6 +46,10 @@ abstract class BaseExtension extends \Twig_Extension implements BaseExtensionInt // Don't get config just yet. Let 'Extensions' handle this when activating. // $this->getConfig(); + $this->functionlist = array(); + $this->filterlist = array(); + $this->snippetlist = array(); + } /** @@ -212,7 +216,7 @@ abstract class BaseExtension extends \Twig_Extension implements BaseExtensionInt public function addTwigFilter($name, $callback) { - $this->functionlist[] = new \Twig_SimpleFilter($name, array($this, $callback)); + $this->filterlist[] = new \Twig_SimpleFilter($name, array($this, $callback)); }
Prevent some notices: make sure 'getFunctions()' and 'getFilters()' always returns an array.
bolt_bolt
train
php
fb9afc79e929d2987ed99296cd9c29366c9f5523
diff --git a/test/runtime/connectivity.go b/test/runtime/connectivity.go index <HASH>..<HASH> 100644 --- a/test/runtime/connectivity.go +++ b/test/runtime/connectivity.go @@ -93,6 +93,15 @@ var runtimeConnectivityTest = func(datapathMode string) func() { return true }, "Endpoints are not ready", &helpers.TimeoutConfig{Timeout: 150 * time.Second}) Expect(err).Should(BeNil()) + + err = helpers.WithTimeout(func() bool { + res := vm.ContainerExec(helpers.Server, "netperf -H 127.0.0.1 -l 1") + if !res.WasSuccessful() { + logger.Info("Waiting for netserver to come up") + } + return res.WasSuccessful() + }, "netserver did not come up in time", &helpers.TimeoutConfig{Timeout: 20 * time.Second}) + Expect(err).Should(BeNil(), "timeout while waiting for netserver to start inside netperf container") }, 150) AfterEach(func() {
test: Wait for netperf server to be up before connecting to it Test netserver availability before testing connectivity Fixes: #<I>
cilium_cilium
train
go
05cbb65a310f4ff7523196f1493eb51c4bb98ddc
diff --git a/config/src/main/java/com/typesafe/config/impl/ConfigImplUtil.java b/config/src/main/java/com/typesafe/config/impl/ConfigImplUtil.java index <HASH>..<HASH> 100644 --- a/config/src/main/java/com/typesafe/config/impl/ConfigImplUtil.java +++ b/config/src/main/java/com/typesafe/config/impl/ConfigImplUtil.java @@ -32,11 +32,7 @@ final public class ConfigImplUtil { return a.equals(b); } - public static boolean isC0Control(final char ch) { - return isC0Control((int)ch); - } - - public static boolean isC0Control(int codepoint) { + static boolean isC0Control(int codepoint) { return (codepoint >= 0x0000 && codepoint <= 0x001F); }
Removed char version of isC0Control and made non public
lightbend_config
train
java
a4fcfcee5dba08b736404de7fd96868466bd49a1
diff --git a/lib/scrolls.rb b/lib/scrolls.rb index <HASH>..<HASH> 100644 --- a/lib/scrolls.rb +++ b/lib/scrolls.rb @@ -6,6 +6,35 @@ require "scrolls/version" module Scrolls extend self + # Public: Initialize a Scrolls logger + # + # Convienence method to prepare for future releases. Currently mimics + # behavior found in other methods. + # + # options - A hash of key/values for configuring Scrolls + # + def init(options) + stream = options.fetch(:stream, STDOUT) + facility = options.fetch(:facility, Syslog::LOG_USER) + time_unit = options.fetch(:time_unit, "seconds") + timestamp = options.fetch(:timestamp, false) + exceptions = options.fetch(:exceptions, "multi") + global_ctx = options.fetch(:global_context, {}) + + Log.stream = stream + Log.facility = facility if facility + Log.time_unit = time_unit unless time_unit == "seconds" + Log.add_timestamp = timestamp unless timestamp == false + + if exceptions == "single" + Log.single_line_exceptions = true + end + + unless global_ctx == {} + Log.global_context = global_ctx + end + end + # Public: Set a context in a block for logs # # data - A hash of key/values to prepend to each log in a block
Introduce Scrolls.init to prepare for future releases.
asenchi_scrolls
train
rb
813770ac7493d165f35e438d1ea0b8825b3ebfe7
diff --git a/tests/test_library.py b/tests/test_library.py index <HASH>..<HASH> 100644 --- a/tests/test_library.py +++ b/tests/test_library.py @@ -338,6 +338,9 @@ def test_library_ShowSection_search(tvshows, show): episode = season.episode(episode=1) _test_library_search(tvshows, episode) + # Additional test for mapping field to the correct libtype + assert tvshows.search(unwatched=True) # equal to episode.unwatched=True + def test_library_MusicSection_search(music, artist): artist.addGenre("test_search")
Add additional test for libtype fallback for search field
pkkid_python-plexapi
train
py
b5785065524ae6f3addce2fc1d4cbadfd5b0dc29
diff --git a/recorder.go b/recorder.go index <HASH>..<HASH> 100644 --- a/recorder.go +++ b/recorder.go @@ -55,11 +55,13 @@ func (r *Recorder) init() { ticker := time.NewTicker(1 * time.Second) go func() { for range ticker.C { + r.RLock() // Only attempt to send spans if we're announced and if the buffer is not empty if sensor.agent.canSend() && len(r.spans) > 0 { log.debug("Sending spans to agent", len(r.spans)) r.send() } + r.RUnlock() } }() } @@ -140,7 +142,9 @@ func (r *Recorder) RecordSpan(span *spanS) { func (r *Recorder) send() { go func() { + r.Lock() _, err := sensor.agent.request(sensor.agent.makeURL(agentTracesURL), "POST", r.spans) + r.Unlock() r.Reset()
Lock & RLock r.spans on loop and span send
instana_go-sensor
train
go
101b5488abc5d975f7771505978023888fb97c1b
diff --git a/shinken/macroresolver.py b/shinken/macroresolver.py index <HASH>..<HASH> 100644 --- a/shinken/macroresolver.py +++ b/shinken/macroresolver.py @@ -343,19 +343,19 @@ class MacroResolver(Borg): # Get Fri 15 May 11:42:39 CEST 2009 def _get_long_date_time(self): - return time.strftime("%a %d %b %H:%M:%S %Z %Y", time.localtime()).decode('UTF-8', 'ignore') + return time.strftime("%a %d %b %H:%M:%S %Z %Y").decode('UTF-8', 'ignore') # Get 10-13-2000 00:30:28 def _get_short_date_time(self): - return time.strftime("%d-%m-%Y %H:%M:%S", time.localtime()) + return time.strftime("%d-%m-%Y %H:%M:%S") # Get 10-13-2000 def _get_date(self): - return time.strftime("%d-%m-%Y", time.localtime()) + return time.strftime("%d-%m-%Y") # Get 00:30:28 def _get_time(self): - return time.strftime("%H:%M:%S", time.localtime()) + return time.strftime("%H:%M:%S") # Get epoch time def _get_timet(self):
Remove useless second parameter of time.strftime(). This defaults to localtime() anyway, no need to pass it.
Alignak-monitoring_alignak
train
py
d3b97a3b5ce8aa87345ea39ad4adc7f465efa62d
diff --git a/pull_into_place/commands/05_design_models.py b/pull_into_place/commands/05_design_models.py index <HASH>..<HASH> 100644 --- a/pull_into_place/commands/05_design_models.py +++ b/pull_into_place/commands/05_design_models.py @@ -13,7 +13,7 @@ Options: --nstruct NUM, -n NUM [default: 10] The number of design jobs to run. - --max-runtime TIME [default: 3:00:00] + --max-runtime TIME [default: 12:00:00] The runtime limit for each design job. The default value is set pretty low so that the short queue is available by default. This should work fine more often than not, but you also shouldn't be diff --git a/pull_into_place/commands/08_validate_designs.py b/pull_into_place/commands/08_validate_designs.py index <HASH>..<HASH> 100644 --- a/pull_into_place/commands/08_validate_designs.py +++ b/pull_into_place/commands/08_validate_designs.py @@ -13,7 +13,7 @@ Options: --nstruct NUM, -n NUM [default: 500] The number of simulations to run per design. - --max-runtime TIME [default: 24:00:00] + --max-runtime TIME [default: 12:00:00] The runtime limit for each validation job. --max-memory MEM [default: 2G]
Set consistent runtime limits for each step.
Kortemme-Lab_pull_into_place
train
py,py
d0d6ce1bf4f7dc6490e5c30c0513ec919c3dfee2
diff --git a/src/armet/resources/model.py b/src/armet/resources/model.py index <HASH>..<HASH> 100644 --- a/src/armet/resources/model.py +++ b/src/armet/resources/model.py @@ -86,7 +86,8 @@ class BaseModel(base.BaseResource): if self.prefetch: # Prefetch all related attributes and store in a cache. # This significantly reduces the number of queries. - queryset = queryset.prefetch_related(*self._prefetch_related_cache) + # queryset = queryset.prefetch_related(*self._prefetch_related_cache) + pass # Return the queryset if we still have it. return queryset
Commented this out for now.
armet_python-armet
train
py
f34a0baee81b4d9bea9c2ffc13abb334cb52f803
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -267,7 +267,7 @@ Color.prototype = { const lum = []; for (const [i, element] of rgb.entries()) { const chan = element / 255; - lum[i] = (chan <= 0.039_28) ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4; + lum[i] = (chan <= 0.040_45) ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4; } return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
use correct WCAG luminance constant (fixes #<I>)
Qix-_color
train
js
5e4312feede7c2511b4d61a5723077c1b16c142d
diff --git a/spacy/cli/train.py b/spacy/cli/train.py index <HASH>..<HASH> 100644 --- a/spacy/cli/train.py +++ b/spacy/cli/train.py @@ -84,11 +84,11 @@ def train(_, lang, output_dir, train_data, dev_data, n_iter=20, n_sents=0, pbar.update(len(docs)) with nlp.use_params(optimizer.averages): - scorer = nlp.evaluate(corpus.dev_docs(nlp, gold_preproc=False)) with (output_path / ('model%d.pickle' % i)).open('wb') as file_: dill.dump(nlp, file_, -1) - - + with (output_path / ('model%d.pickle' % i)).open('rb') as file_: + nlp_loaded = dill.load(file_) + scorer = nlp_loaded.evaluate(corpus.dev_docs(nlp_loaded, gold_preproc=False)) print_progress(i, losses, scorer.scores) finally: print("Saving model...")
Evaluate loaded class, to ensure save/load works
explosion_spaCy
train
py
249fa5edf8478f26814cf45da82d800a2cfc5ba0
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js b/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js +++ b/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js @@ -63,8 +63,8 @@ exports.EditorCommandFactory = (function() { return keyBinding; } - function handleStatus(status) { - if (status && typeof status.HTML !== "undefined") { //$NON-NLS-0$ + function handleStatus(status, allowHTML) { + if (!allowHTML && status && typeof status.HTML !== "undefined") { //$NON-NLS-0$ delete status.HTML; } var statusService = serviceRegistry.getService("orion.page.message"); //$NON-NLS-0$ @@ -83,7 +83,7 @@ exports.EditorCommandFactory = (function() { } else { errorToDisplay = error; } - handleStatus(errorToDisplay); + handleStatus(errorToDisplay, true /*allow HTML for auth errors*/); } // create commands common to all editors
Fix: HTML rendered as text in 'Auth required' workflow
eclipse_orion.client
train
js
3ea6abc486047ba9f8a987104c86e8aa7ed6d7d0
diff --git a/lib/calais.js b/lib/calais.js index <HASH>..<HASH> 100644 --- a/lib/calais.js +++ b/lib/calais.js @@ -137,7 +137,7 @@ Calais.prototype = { } }); }).on('error', function(e) { - console.log('Problem with the Open Calais Request (' + e.message + ')'); + return callback('Problem with the Open Calais Request (' + e.message + ')'); }); req.end(this.options.content);
replaced the log with the callback response
mcantelon_node-calais
train
js
6b1078baa4ec0e5708350d891e9dbfcb0a3c5ef2
diff --git a/pyes/es.py b/pyes/es.py index <HASH>..<HASH> 100644 --- a/pyes/es.py +++ b/pyes/es.py @@ -1554,7 +1554,7 @@ class ResultSet(object): for k, v in entry.items(): if k in ["count", "max", "min", "total_count", "mean", "total"]: continue - entry[k] = datetime.fromtimestamp(v / 1e3) + entry[k] = datetime.utcfromtimestamp(v / 1e3) def __len__(self): return self.total diff --git a/tests/test_queryset.py b/tests/test_queryset.py index <HASH>..<HASH> 100644 --- a/tests/test_queryset.py +++ b/tests/test_queryset.py @@ -87,7 +87,7 @@ class QuerySetTests(ESTestCase): self.assertEqual(values, [u'11111', u'22222',u'33333']) values = model.objects.dates("date", kind="year") self.assertEqual(len(values), 1) - self.assertEqual(values, [datetime(2012, 1, 1, 1, 0)]) + self.assertEqual(values, [datetime(2012, 1, 1, 0, 0)]) facets = model.objects.facet("uuid").size(0).facets uuid_facets=facets["uuid"]
Times are stored as UTC milliseconds since the epoch
aparo_pyes
train
py,py
d1b9549cfc30d3eba16eb7dede1c495d9affb663
diff --git a/fluent_blogs/models/managers.py b/fluent_blogs/models/managers.py index <HASH>..<HASH> 100644 --- a/fluent_blogs/models/managers.py +++ b/fluent_blogs/models/managers.py @@ -103,8 +103,8 @@ class TranslatableEntryQuerySet(TranslatableQuerySet, EntryQuerySet): super(TranslatableEntryQuerySet, self).__init__(*args, **kwargs) self._rel_language_codes = None - def _clone(self, klass=None, setup=False, **kw): - c = super(TranslatableQuerySet, self)._clone(**kw) + def _clone(self, *args, **kw): + c = super(TranslatableQuerySet, self)._clone(*args, **kw) c._rel_language_codes = self._rel_language_codes return c
Fix queryset issues with .datetimes(), for admin
django-fluent_django-fluent-blogs
train
py
c9853d19d560813257a3134e6412f6808736d2c8
diff --git a/app/models/socializer/activity_object.rb b/app/models/socializer/activity_object.rb index <HASH>..<HASH> 100644 --- a/app/models/socializer/activity_object.rb +++ b/app/models/socializer/activity_object.rb @@ -31,7 +31,7 @@ module Socializer has_many :circles, foreign_key: 'author_id' has_many :ties, foreign_key: 'contact_id' - has_many :memberships, -> { where active: true }, foreign_key: 'member_id' + has_many :memberships, -> { Membership.active }, foreign_key: 'member_id' # Validations validates :activitable, presence: true
use the membership active scope for the memberships relation conditions
socializer_socializer
train
rb
a6d1b2479e991524abf86c6bc983af4194c185a4
diff --git a/jieba/analyse/textrank.py b/jieba/analyse/textrank.py index <HASH>..<HASH> 100644 --- a/jieba/analyse/textrank.py +++ b/jieba/analyse/textrank.py @@ -20,10 +20,6 @@ class UndirectWeightedGraph: self.graph[start].append((start, end, weight)) self.graph[end].append((end, start, weight)) - def refactor(self): - for n, _ in self.graph.items(): - self.graph[n].sort() - def rank(self): ws = collections.defaultdict(float) outSum = collections.defaultdict(float)
build stable sort for graph iteration, then we can get stable result and adatpe details for python 3~
fxsjy_jieba
train
py
cd746f3069726b5999013eb75ab4c9dacde888d4
diff --git a/src/structures/MessageMentions.js b/src/structures/MessageMentions.js index <HASH>..<HASH> 100644 --- a/src/structures/MessageMentions.js +++ b/src/structures/MessageMentions.js @@ -1,6 +1,5 @@ 'use strict'; -const GuildMember = require('./GuildMember'); const Collection = require('../util/Collection'); const { ChannelTypes } = require('../util/Constants'); const Util = require('../util/Util'); @@ -174,6 +173,7 @@ class MessageMentions { */ has(data, { ignoreDirect = false, ignoreRoles = false, ignoreEveryone = false } = {}) { if (!ignoreEveryone && this.everyone) return true; + const GuildMember = require('./GuildMember'); if (!ignoreRoles && data instanceof GuildMember) { for (const role of this.roles.values()) if (data.roles.cache.has(role.id)) return true; }
fix(message_mentions): lazy require GuildMember to avoid circular (#<I>)
discordjs_discord.js
train
js