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
68df0496fb3895ee3d1db9ca184d4d09408a97e9
diff --git a/src/Common/Console/Command/Make/Controller.php b/src/Common/Console/Command/Make/Controller.php index <HASH>..<HASH> 100644 --- a/src/Common/Console/Command/Make/Controller.php +++ b/src/Common/Console/Command/Make/Controller.php @@ -93,6 +93,7 @@ class Controller extends BaseMaker $aControllers = array_filter(explode(',', $aFields['CONTROLLER_NAME'])); $aMethods = explode(',', $aFields['METHODS']); + sort($aControllers); foreach ($aControllers as $sController) { diff --git a/src/Common/Console/Command/Make/Model.php b/src/Common/Console/Command/Make/Model.php index <HASH>..<HASH> 100644 --- a/src/Common/Console/Command/Make/Model.php +++ b/src/Common/Console/Command/Make/Model.php @@ -199,6 +199,8 @@ class Model extends BaseMaker $aModels = explode(',', $aFields['MODEL_NAME']); $aModelData = []; + sort($aModels); + foreach ($aModels as $sModelName) { $aModelData[] = $this->prepareModelName($oInput, $sModelName); }
Ensure models and controllers are in alphabetical order when `make:`ing
nails_common
train
php,php
d19e8972ef9fdbca8906f5a96a9a191bb7c99c64
diff --git a/lib/Client.php b/lib/Client.php index <HASH>..<HASH> 100644 --- a/lib/Client.php +++ b/lib/Client.php @@ -4,6 +4,7 @@ namespace Amp\Artax; use Amp\Artax\Cookie\ArrayCookieJar; use Amp\Artax\Cookie\Cookie; +use Amp\Artax\Cookie\CookieFormatException; use Amp\Artax\Cookie\CookieJar; use Amp\Artax\Cookie\PublicSuffixList; use Amp\ByteStream\GzipInputStream; @@ -172,7 +173,7 @@ class Client implements HttpClient { yield from $this->doWrite($request, $uri, $options, $previousResponse, $deferred); } catch (HttpException $e) { if ($deferred) { - $deferred->resolve($e); + $deferred->fail($e); } } }); @@ -600,7 +601,7 @@ class Client implements HttpClient { $cookie = $cookie->withDomain("." . $cookieDomain); } $this->cookieJar->store($cookie); - } catch (\InvalidArgumentException $e) { + } catch (CookieFormatException $e) { // Ignore malformed Set-Cookie headers } }
Fix minor issues discovered by @bwoebi
amphp_artax
train
php
3594b0c207795acc78d666087ff4269c3a3ad738
diff --git a/Eloquent/Builder.php b/Eloquent/Builder.php index <HASH>..<HASH> 100755 --- a/Eloquent/Builder.php +++ b/Eloquent/Builder.php @@ -1114,9 +1114,9 @@ class Builder $results = []; foreach ($relations as $name => $constraints) { - // If the "relation" value is actually a numeric key, we can assume that no - // constraints have been specified for the eager load and we'll just put - // an empty Closure with the loader so that we can treat all the same. + // If the "name" value is a numeric key, we can assume that no + // constraints have been specified. We'll just put an empty + // Closure there, so that we can treat them all the same. if (is_numeric($name)) { $name = $constraints; @@ -1127,9 +1127,9 @@ class Builder }]; } - // We need to separate out any nested includes. Which allows the developers + // We need to separate out any nested includes, which allows the developers // to load deep relationships using "dots" without stating each level of - // the relationship with its own key in the array of eager load names. + // the relationship with its own key in the array of eager-load names. $results = $this->addNestedWiths($name, $results); $results[$name] = $constraints;
Improve comments (#<I>)
illuminate_database
train
php
51c3eb2dc9c01d79ab87c43c1e68ddf5ba4c0588
diff --git a/picturefill.js b/picturefill.js index <HASH>..<HASH> 100644 --- a/picturefill.js +++ b/picturefill.js @@ -40,6 +40,12 @@ picImg.src = matchedEl.getAttribute( "data-src" ); matchedEl.appendChild( picImg ); + if(picImg.hasAttribute("width")){ + picImg.removeAttribute("width"); + } + if(picImg.hasAttribute("height")){ + picImg.removeAttribute("height"); + } } else if( picImg ){ picImg.parentNode.removeChild( picImg );
Add temp fix for IE attribute issue A messy fix which removes the width and height attributes automatically added when img element is created in IE < 9
scottjehl_picturefill
train
js
ac86d299ebc4c98af55c9743ca7b961c15088c8d
diff --git a/belpy/statements.py b/belpy/statements.py index <HASH>..<HASH> 100644 --- a/belpy/statements.py +++ b/belpy/statements.py @@ -583,6 +583,12 @@ class Complex(Statement): else: self.bound = bound + def monomers_interactions_only(self, agent_set): + return self.monomers_one_step(agent_set) + + def assemble_interactions_only(self, model, agent_set): + return self.assemble_one_step(model, agent_set) + def monomers_one_step(self, agent_set): """In this (very simple) implementation, proteins in a complex are each given site names corresponding to each of the other members
Delegate interactions -> one_step for Complex stmts
sorgerlab_indra
train
py
966831691983f34b0aec84189c49e1b642407a54
diff --git a/test/integration/deploy_trigger_test.go b/test/integration/deploy_trigger_test.go index <HASH>..<HASH> 100644 --- a/test/integration/deploy_trigger_test.go +++ b/test/integration/deploy_trigger_test.go @@ -18,7 +18,7 @@ import ( testserver "github.com/openshift/origin/test/util/server" ) -const maxUpdateRetries = 5 +const maxUpdateRetries = 10 func TestTriggers_manual(t *testing.T) { const namespace = "test-triggers-manual"
deploy: bump number of retries in trigger integration test
openshift_origin
train
go
bfdf61929be706be16ce3ae1e6e5a936b001c091
diff --git a/wafer/schedule/views.py b/wafer/schedule/views.py index <HASH>..<HASH> 100644 --- a/wafer/schedule/views.py +++ b/wafer/schedule/views.py @@ -41,7 +41,7 @@ def make_schedule_row(schedule_day, slot, seen_items): """Create a row for the schedule table.""" row = ScheduleRow(schedule_day, slot) skip = [] - for item in slot.scheduleitem_set.all(): + for item in slot.scheduleitem_set.select_related('talk', 'page').all(): if item in seen_items: # Inc rowspan seen_items[item]['rowspan'] += 1
Also load talks and pages when looking up schedule items.
CTPUG_wafer
train
py
064f76ec323329f4ace8b7f4b7c717b4874773e0
diff --git a/aws/resource_aws_cloudwatch_metric_stream_test.go b/aws/resource_aws_cloudwatch_metric_stream_test.go index <HASH>..<HASH> 100644 --- a/aws/resource_aws_cloudwatch_metric_stream_test.go +++ b/aws/resource_aws_cloudwatch_metric_stream_test.go @@ -237,7 +237,7 @@ func TestAccAWSCloudWatchMetricStream_tags(t *testing.T) { Config: testAccAWSCloudWatchMetricStreamConfigTags(rName), Check: resource.ComposeTestCheckFunc( testAccCheckCloudWatchMetricStreamExists(resourceName, &metricStream), - resource.TestCheckResourceAttr(resourceName, "tags.#", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), ), }, { @@ -552,9 +552,9 @@ resource "aws_cloudwatch_metric_stream" "test" { firehose_arn = "arn:${data.aws_partition.current.partition}:firehose:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:deliverystream/MyFirehose" output_format = "json" - tags { + tags = { Name = %[1]q - Mercedes = "Toto" + Mercedes = "Toto" } } `, rName)
tests/r/cloudwatch_metric_stream: Fix tags fix
terraform-providers_terraform-provider-aws
train
go
5d95a80f8dff182e78f2381fd499d4196410ddac
diff --git a/lib/ark/utility.rb b/lib/ark/utility.rb index <HASH>..<HASH> 100644 --- a/lib/ark/utility.rb +++ b/lib/ark/utility.rb @@ -64,5 +64,37 @@ module Ark text.gsub(/^/, ' ' * indent) end end + + class Line + def initialize() + @lines = [[]] + @line = 0 + end + + def push(str) + @lines[@line] << str.to_s + end + + def wrap(text, width: 78, indent: 0) + text = Text.wrap(text, width: width, indent: indent) + self.next(text) + self.next() + end + + def next(str=nil) + @lines << [] + @line += 1 + self.push(str) if str + end + + def skip(str=nil) + self.next() + self.next(str) + end + + def print() + @lines.map {|line| line.join(' ') }.join("\n") + end + end end
Added Line class for building formatted text
aetherised_ark-util
train
rb
72e79772d5654520517598f5f602fb42ee94e9f5
diff --git a/test/json_schemer_test.rb b/test/json_schemer_test.rb index <HASH>..<HASH> 100644 --- a/test/json_schemer_test.rb +++ b/test/json_schemer_test.rb @@ -672,7 +672,7 @@ class JSONSchemerTest < Minitest::Test if ENV['WRITE_FIXTURES'] == 'true' fixture.write("#{JSON.pretty_generate(output)}\n") else - assert output == JSON.parse(fixture.read) + assert_equal(output, JSON.parse(fixture.read)) end end end
Use assert_equal in fixture specs Output for failures is slightly better this way.
davishmcclurg_json_schemer
train
rb
2216e3db8c60d7f95b3a9e010856a3015a3d83b4
diff --git a/lib/ruby_motion_query.rb b/lib/ruby_motion_query.rb index <HASH>..<HASH> 100644 --- a/lib/ruby_motion_query.rb +++ b/lib/ruby_motion_query.rb @@ -5,7 +5,7 @@ end Motion::Project::App.setup do |app| parent = File.join(File.dirname(__FILE__), '..') files = [File.join(parent, 'motion/ruby_motion_query/stylesheet.rb')] - tiles << [File.join(parent, 'motion/ruby_motion_query/validation_event.rb')] + files << [File.join(parent, 'motion/ruby_motion_query/validation_event.rb')] files << [File.join(parent, 'motion/ruby_motion_query/stylers/ui_view_styler.rb')] files << File.join(parent, 'motion/ruby_motion_query/stylers/ui_control_styler.rb') files << Dir.glob(File.join(parent, "motion/**/*.rb"))
tiles... files.... same thing right?
infinitered_rmq
train
rb
8a15ddee1da65efaf600f748259ddfdf891e648f
diff --git a/spec/shared/consul/active_record_spec.rb b/spec/shared/consul/active_record_spec.rb index <HASH>..<HASH> 100644 --- a/spec/shared/consul/active_record_spec.rb +++ b/spec/shared/consul/active_record_spec.rb @@ -26,10 +26,10 @@ describe Consul::ActiveRecord do end user_0 = klass.new(:role => "guest") user_0.assignable_roles.should =~ %w[guest admin] - expect(user_0.valid?).to be true + user_0.valid?.should be(true) user_1 = klass.new(:role => "invalid-value") - expect(user_1.valid?).to be false + user_1.valid?.should be(false) end end end
revert rspec expect syntax to .should syntax to support Ruby <I>
makandra_consul
train
rb
bfec84bc15345194ae4f49e94b53f1d0974408f3
diff --git a/lib/client.js b/lib/client.js index <HASH>..<HASH> 100644 --- a/lib/client.js +++ b/lib/client.js @@ -3,7 +3,6 @@ var net = require('net'); var crypto = require('crypto'); var EventEmitter = require('events').EventEmitter; -var Query = require(__dirname+'/query'); var utils = require(__dirname + '/utils'); var Client = function(config) { @@ -151,7 +150,7 @@ var dateParser = { } }; -Query.dataTypes = { +Client.dataTypes = { 20: intParser, 21: intParser, 23: intParser, @@ -175,7 +174,7 @@ p.processDataRow = function(dataRow) { var field, dataType; for(var i = 0, len = row.length; i < len; i++) { field = fields[i] || 0 - var dataType = Query.dataTypes[field.dataTypeID]; + var dataType = Client.dataTypes[field.dataTypeID]; if(dataType) { row[i] = dataType.fromDbValue(row[i]); }
removed reamining references to query
brianc_node-postgres
train
js
fc5e8ad747fad6ddb5d5874abbe2aa0f44adc3f8
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ setup( packages=['ploy_ezjail'], install_requires=[ 'setuptools', - 'ploy >= 1.0.2', + 'ploy >= 1.0.2, < 2dev', 'lazy'], entry_points=""" [ploy.plugins]
There are plans for ploy 2, with a different API.
ployground_ploy_ezjail
train
py
dfe8216b44ae685790fe2f820df2b8b0d02e52dd
diff --git a/segmentstore/server/host/src/main/java/io/pravega/segmentstore/server/host/handler/AppendProcessor.java b/segmentstore/server/host/src/main/java/io/pravega/segmentstore/server/host/handler/AppendProcessor.java index <HASH>..<HASH> 100644 --- a/segmentstore/server/host/src/main/java/io/pravega/segmentstore/server/host/handler/AppendProcessor.java +++ b/segmentstore/server/host/src/main/java/io/pravega/segmentstore/server/host/handler/AppendProcessor.java @@ -71,8 +71,8 @@ public class AppendProcessor extends DelegatingRequestProcessor { //region Members static final Duration TIMEOUT = Duration.ofMinutes(1); - private static final int HIGH_WATER_MARK = 128 * 1024; - private static final int LOW_WATER_MARK = 64 * 1024; + private static final int HIGH_WATER_MARK = 640 * 1024; // 640KB + private static final int LOW_WATER_MARK = 320 * 1024; // 320KB private static final String EMPTY_STACK_TRACE = ""; private final StreamSegmentStore store; private final ServerConnection connection;
Issue <I>: Increase client throttling limit (#<I>) * Increases the throttling limit by a factor of 5 to ensure the clients are not blocked
pravega_pravega
train
java
5c56a7100f5e274b4138c2fff9b6d111565fad1e
diff --git a/glue/ligolw/lsctables.py b/glue/ligolw/lsctables.py index <HASH>..<HASH> 100644 --- a/glue/ligolw/lsctables.py +++ b/glue/ligolw/lsctables.py @@ -1840,7 +1840,7 @@ class SimInspiral(object): return getattr(self, "eff_dist_%s" % instrument[0].lower()) def get_chirp_dist(self,instrument,ref_mass = 1.40): - return self.get_eff_dist() * (2.**(-1./5) * ref_mass / self.mchirp)**(5./6) + return self.get_eff_dist(instrument) * (2.**(-1./5) * ref_mass / self.mchirp)**(5./6) SimInspiralTable.RowType = SimInspiral
fixed typo in lsctables
gwastro_pycbc-glue
train
py
df263328c7eb06c34ad023e5d284670d02f39908
diff --git a/chess/gaviota.py b/chess/gaviota.py index <HASH>..<HASH> 100644 --- a/chess/gaviota.py +++ b/chess/gaviota.py @@ -163,8 +163,13 @@ class NativeTablebases(object): ret = self.libgtb.tb_probe_WDL_hard(stm, ep_square, castling, c_ws, c_bs, c_wp, c_bp, ctypes.byref(info)) dtm = 1 - # Probe failed, forbidden or unknown. - if not ret or info.value == 3 or info.value == 7: + # Probe forbidden. + if info.value == 3: + logging.warning("Tablebase for %s marked as forbidden", board.fen()) + return None + + # Probe failed or unknown. + if not ret or info.value == 7: return None # Draw.
Log a warning for forbidden probes
niklasf_python-chess
train
py
6f084f292932c464a30b56edb9edbe238bdcf0aa
diff --git a/daemon/graphdriver/copy/copy.go b/daemon/graphdriver/copy/copy.go index <HASH>..<HASH> 100644 --- a/daemon/graphdriver/copy/copy.go +++ b/daemon/graphdriver/copy/copy.go @@ -189,15 +189,15 @@ func DirCopy(srcDir, dstDir string, copyMode Mode, copyXattrs bool) error { case os.ModeNamedPipe: fallthrough case os.ModeSocket: - if rsystem.RunningInUserNS() { - // cannot create a device if running in user namespace - return nil - } if err := unix.Mkfifo(dstPath, stat.Mode); err != nil { return err } case os.ModeDevice: + if rsystem.RunningInUserNS() { + // cannot create a device if running in user namespace + return nil + } if err := unix.Mknod(dstPath, stat.Mode, int(stat.Rdev)); err != nil { return err }
Fix FIFO, sockets and device files when run in user NS commit <I>c<I>e<I> "Don't create devices if in a user namespace" introduced check, which meant to skip mknod operation when run in user namespace, but instread skipped FIFO and socket files copy.
moby_moby
train
go
dd3777df5ebcc48ee56e0bf8eb6a3ad6b63e510c
diff --git a/allocate_test.go b/allocate_test.go index <HASH>..<HASH> 100644 --- a/allocate_test.go +++ b/allocate_test.go @@ -13,7 +13,7 @@ import ( "fmt" ) -func ExampleBasicZero() { +func ExampleZero() { type SimplePtrStruct struct { PtrField *int }
Renamed example function for proper godoc generation
cjrd_allocate
train
go
335c55212ee3dc23283a7b9064ab34a0a00ea652
diff --git a/test/rmdir.js b/test/rmdir.js index <HASH>..<HASH> 100644 --- a/test/rmdir.js +++ b/test/rmdir.js @@ -17,9 +17,9 @@ test('rmdirSync() on missing directory', (t) => { }) }) +const FILE_PATH = __filename if (process.platform.indexOf('win') !== 0) { // https://github.com/nodejs/node/issues/8797 - const FILE_PATH = __filename asyncHelper.assertAsyncError(test, lib.rmdir, [ FILE_PATH ], 'rmdir() on file instead of directory') @@ -28,4 +28,12 @@ if (process.platform.indexOf('win') !== 0) { lib.rmdirSync(FILE_PATH) }) }) +} else { + asyncHelper.assertAsyncNoError(test, lib.rmdir, [ FILE_PATH ], 'rmdir() on file instead of directory') + + test('rmdirSync() on file instead of directory', (t) => { + t.notThrows(() => { + lib.rmdirSync(FILE_PATH) + }) + }) }
improve test coverage in AppVeyor
jokeyrhyme_idempotent-fs.js
train
js
7a50295c49e4f044c9e7d5ec7ed989005bae31e9
diff --git a/doc/plugins/exports.js b/doc/plugins/exports.js index <HASH>..<HASH> 100644 --- a/doc/plugins/exports.js +++ b/doc/plugins/exports.js @@ -80,4 +80,4 @@ exports.nodeVisitor = { // filter out non-API symbols before the addDocletRef finisher is called e.finishers.unshift(filter); } -}; \ No newline at end of file +};
Making @elemoine and GitHub happy Reminder to self: everyone wants a new line at the end of a file.
openlayers_openlayers
train
js
d3b63c09d3867f64887fae8fd4edfcda7f01344a
diff --git a/salt/output/highstate.py b/salt/output/highstate.py index <HASH>..<HASH> 100644 --- a/salt/output/highstate.py +++ b/salt/output/highstate.py @@ -125,7 +125,10 @@ def output(data): changes += 'Invalid Changes data: {0}'.format( ret['changes']) else: - changes += salt.output.out_format(ret['changes'], 'nested', __opts__) + pass_opts = __opts__ + if __opts__['color']: + pass_opts['color'] = 'CYAN' + changes += salt.output.out_format(ret['changes'], 'nested', pass_opts) hstrs.append(('{0}{1}{2[ENDC]}' .format(tcolor, changes, colors)))
Pass in CYAN to the nested outputter for changes output
saltstack_salt
train
py
758d9454db45c98ac3c84c2aa1c36583a9887f08
diff --git a/lib/cache.js b/lib/cache.js index <HASH>..<HASH> 100644 --- a/lib/cache.js +++ b/lib/cache.js @@ -491,7 +491,7 @@ function get(options) { content: options, file: 'citizen.txt' }); - return helpers.copy(matchingKeys); + return helpers.copy(matchingKeys[options.scope]); } // Throw an error if the required arguments aren't provided } else {
Fixed a bug when using cache get for an entire scope - Instead of returning the scope, cache.get() was returning the parent object with the scope nested within it. It now returns the scope itself.
jaysylvester_citizen
train
js
f432430256b3a60a1a84d70b960f15a750d4f8f9
diff --git a/test/issue377_test.go b/test/issue377_test.go index <HASH>..<HASH> 100644 --- a/test/issue377_test.go +++ b/test/issue377_test.go @@ -2,11 +2,12 @@ package test import ( "errors" - "log" "os" "sync" "testing" + "github.com/anacrolix/log" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require"
Use anacrolix/log in test
anacrolix_torrent
train
go
d4fa5d000ca6078ebc461b820a759f45554a245f
diff --git a/lib/Cake/bootstrap.php b/lib/Cake/bootstrap.php index <HASH>..<HASH> 100644 --- a/lib/Cake/bootstrap.php +++ b/lib/Cake/bootstrap.php @@ -90,12 +90,16 @@ if (!defined('TMP')) { /** * Path to the logs directory. */ +if (!defined('LOGS')) { define('LOGS', TMP . 'logs' . DS); +} /** * Path to the cache files directory. It can be shared between hosts in a multi-server setup. */ +if (!defined('CACHE')) { define('CACHE', TMP . 'cache' . DS); +} /** * Path to the vendors directory.
Allow an App to define its own LOGS and CACHE paths outside TMP
cakephp_cakephp
train
php
b514586c8bcac2e13ee16e9244a7b1957e8f870b
diff --git a/lib/awesome_print/ext/awesome_puppet.rb b/lib/awesome_print/ext/awesome_puppet.rb index <HASH>..<HASH> 100644 --- a/lib/awesome_print/ext/awesome_puppet.rb +++ b/lib/awesome_print/ext/awesome_puppet.rb @@ -29,7 +29,7 @@ module AwesomePrint def awesome_puppet_type(object) return '' if object.nil? - return object.to_s unless object.respond_to?(:name) + return object.to_s unless object.respond_to?(:name) && object.respond_to?(:title) h = object.to_hash.merge(:name => object.name, :title => object.title) res_str = awesome_hash(h) "#{object.class} #{res_str.gsub(':', '')}"
fixes error with puppet <I> and type display
nwops_puppet-debugger
train
rb
0b1a5a4f7457264b210341be45f5090dd65a41a5
diff --git a/lib/stdlog.js b/lib/stdlog.js index <HASH>..<HASH> 100644 --- a/lib/stdlog.js +++ b/lib/stdlog.js @@ -81,10 +81,14 @@ fs.mkdirSync(_logDir); } - console.log(_logDir); + var _latestLogFile = resolve(_logDir, "_latest.log"); + var _timeStampedLogFile = resolve(_logDir, timeString() + ".log"); - logFilePaths.push(resolve(_logDir, timeString() + ".log")); - logFilePaths.push(resolve(_logDir, "_latest.log")); + if (fs.existsSync(_latestLogFile)) { + fs.unlinkSync(_latestLogFile); + } + + logFilePaths.push(_latestLogFile, _timeStampedLogFile); logStream(process.stdout); // Print output via STDERR in red
Make sure that _latest.log really only contains output from the current session (by deleting the previously generated file)
adobe-photoshop_generator-core
train
js
ad0ff72972729de72df5e4d69761a91c9b541303
diff --git a/bika/lims/browser/invoicefolder.py b/bika/lims/browser/invoicefolder.py index <HASH>..<HASH> 100644 --- a/bika/lims/browser/invoicefolder.py +++ b/bika/lims/browser/invoicefolder.py @@ -69,6 +69,8 @@ class InvoiceFolderContentsView(BikaListingView): self.contentsMethod = self.getInvoiceBatches items = BikaListingView.folderitems(self) for x, item in enumerate(items): + if 'obj' not in item: + continue obj = item['obj'] title_link = "<a href='%s'>%s</a>" % (item['url'], item['title']) items[x]['replace']['title'] = title_link
Fix missing attribute check from <I>bd<I>
senaite_senaite.core
train
py
ee072e30e86f3be8a0266edc7cb46c5fa4ce213c
diff --git a/tests/helpers/CMTest/library/CMTest/TestCase.php b/tests/helpers/CMTest/library/CMTest/TestCase.php index <HASH>..<HASH> 100644 --- a/tests/helpers/CMTest/library/CMTest/TestCase.php +++ b/tests/helpers/CMTest/library/CMTest/TestCase.php @@ -155,8 +155,10 @@ abstract class CMTest_TestCase extends PHPUnit_Framework_TestCase { 'params' => $params, ); $request = $this->createRequest('/ajax/null', $body, $scopeView, $scopeComponent); - if ($environment && $environment->hasViewer()) { - $request->getSession()->setUser($environment->getViewer()); + if ($environment) { + $request->mockMethod('getViewer')->set(function () use ($environment) { + return $environment->getViewer(); + }); } return $this->processRequest($request); }
Use mocka to getViewer() on request
cargomedia_cm
train
php
6560fb7ea574d2ba96d95d727ed1dd3cd10fd574
diff --git a/build/gulpfile.scan.js b/build/gulpfile.scan.js index <HASH>..<HASH> 100644 --- a/build/gulpfile.scan.js +++ b/build/gulpfile.scan.js @@ -76,7 +76,7 @@ function nodeModules(destinationExe, destinationPdb, platform) { const exe = () => { return gulp.src(dependenciesSrc, { base: '.', dot: true }) - .pipe(filter(['**/*.node'])) + .pipe(filter(['**/*.node', '!**/prebuild/**/*.node'])) .pipe(gulp.dest(destinationExe)); };
add filter for prebuild node files
Microsoft_vscode
train
js
22a5f5cc03cacfd3a9426449b1743f69c0279e3f
diff --git a/src/ofxstatement/statement.py b/src/ofxstatement/statement.py index <HASH>..<HASH> 100644 --- a/src/ofxstatement/statement.py +++ b/src/ofxstatement/statement.py @@ -67,9 +67,6 @@ class Statement(Printable): self.currency = currency self.account_type = account_type - def recalculate_balance(self): - recalculate_balance(self) - def assert_valid(self): if not(self.start_balance is None or self.end_balance is None): total_amount = sum(sl.amount for sl in self.lines)
Removed method recalculate_balance().
kedder_ofxstatement
train
py
ed6bbbcf0bb6907af2e4af9d04b38237d2274788
diff --git a/addon/models/resource.js b/addon/models/resource.js index <HASH>..<HASH> 100644 --- a/addon/models/resource.js +++ b/addon/models/resource.js @@ -471,7 +471,15 @@ const Resource = Ember.Object.extend(ResourceOperationsMixin, { try { meta = this.constructor.metaForProperty(property); } catch (e) { - meta = this.get('content').constructor.metaForProperty(property); + // Could be a Ember Proxy object. Try that, otherwise throw original error. + // This could contain a very useful message ("could not find computed property + // with key `property`" on undefined relationships for example) + const content = this.get('content'); + if (content && content.constructor.metaForProperty) { + meta = content.constructor.metaForProperty(property); + } else { + throw e; + } } return meta; },
Improve relationMetadata error handling/throwing (#<I>)
pixelhandler_ember-jsonapi-resources
train
js
117695caa318f0ffe5339ea600d50465103516e1
diff --git a/src/main/java/org/minimalj/frontend/page/BaseTableEditorPage.java b/src/main/java/org/minimalj/frontend/page/BaseTableEditorPage.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/minimalj/frontend/page/BaseTableEditorPage.java +++ b/src/main/java/org/minimalj/frontend/page/BaseTableEditorPage.java @@ -10,6 +10,7 @@ import org.minimalj.frontend.editor.Editor.SimpleEditor; import org.minimalj.frontend.form.Form; import org.minimalj.model.validation.ValidationMessage; import org.minimalj.util.CloneHelper; +import org.minimalj.util.IdUtils; import org.minimalj.util.resources.Resources; abstract class BaseTableEditorPage<VIEW, T> extends TableDetailPage<VIEW> { @@ -177,7 +178,7 @@ abstract class BaseTableEditorPage<VIEW, T> extends TableDetailPage<VIEW> { @Override protected T createObject() { - return CloneHelper.clone(selection); + return IdUtils.hasId(getClazz()) ? CloneHelper.clone(selection) : selection; } @Override
TableEditor: only clone for Identifiables Dependables work better that way
BrunoEberhard_minimal-j
train
java
50ebd65bc35fcef965431b7089c55fcf9122f69d
diff --git a/sample_app/config/environment.rb b/sample_app/config/environment.rb index <HASH>..<HASH> 100644 --- a/sample_app/config/environment.rb +++ b/sample_app/config/environment.rb @@ -5,7 +5,7 @@ # ENV['RAILS_ENV'] ||= 'production' # Specifies gem version of Rails to use when vendor/rails is not present -RAILS_GEM_VERSION = '2.2.0' unless defined? RAILS_GEM_VERSION +RAILS_GEM_VERSION = '2.2.2' unless defined? RAILS_GEM_VERSION # Bootstrap the Rails environment, frameworks, and default configuration require File.join(File.dirname(__FILE__), 'boot')
environment updated to rails<I>
enriclluelles_route_translator
train
rb
6916600766199d49eb43eb66cef40296924010ea
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/fileCommands.js b/bundles/org.eclipse.orion.client.ui/web/orion/fileCommands.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.ui/web/orion/fileCommands.js +++ b/bundles/org.eclipse.orion.client.ui/web/orion/fileCommands.js @@ -320,9 +320,10 @@ define(['i18n!orion/navigate/nls/messages', 'require', 'orion/webui/littlelib', } var deferreds = []; var summary = []; + var choice = this; selectedItems.forEach(function(item) { var func = isCopy ? fileClient.copyFile : fileClient.moveFile; - deferreds.push(func.apply(fileClient, [item.Location, this.path]).then( + deferreds.push(func.apply(fileClient, [item.Location, choice.path]).then( function(newItem) { summary.push({ oldValue: item,
Bug <I> - Copying using the suggested list of destinations does not work
eclipse_orion.client
train
js
a39f2657b1ae8d61c6018766f8d250b1401beace
diff --git a/activerecord/lib/active_record/autosave_association.rb b/activerecord/lib/active_record/autosave_association.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/autosave_association.rb +++ b/activerecord/lib/active_record/autosave_association.rb @@ -147,12 +147,12 @@ module ActiveRecord # add_autosave_association_callbacks(reflect_on_association(name)) # end ASSOCIATION_TYPES.each do |type| - module_eval %{ + module_eval <<-CODE, __FILE__, __LINE__ + 1 def #{type}(name, options = {}) super add_autosave_association_callbacks(reflect_on_association(name)) end - } + CODE end # Adds a validate and save callback for the association as specified by
Add module_eval missing file_name and line_number args [#<I> state:resolved]
rails_rails
train
rb
ffa72455d5d9e6b65cd09b11da445013888de8c8
diff --git a/gspread/utils.py b/gspread/utils.py index <HASH>..<HASH> 100644 --- a/gspread/utils.py +++ b/gspread/utils.py @@ -11,7 +11,11 @@ This module contains utility functions. import sys import re from functools import wraps -from collections import defaultdict, Sequence +from collections import defaultdict +try: + from collections.abc import Sequence +except ImportError: + from collections import Sequence from itertools import chain from google.auth.credentials import Credentials as Credentials
Support old and new collections.abc.Sequence (#<I>) Addresses #<I>
burnash_gspread
train
py
e69c47efe9876c6f9dd0ba33f4e5b3213523484c
diff --git a/dimod/discrete/discrete_quadratic_model.py b/dimod/discrete/discrete_quadratic_model.py index <HASH>..<HASH> 100644 --- a/dimod/discrete/discrete_quadratic_model.py +++ b/dimod/discrete/discrete_quadratic_model.py @@ -29,7 +29,7 @@ from dimod.serialization.fileview import VariablesSection, _BytesIO from dimod.variables import Variables from typing import List, Tuple, Union, Generator -Linear = Union[List[Tuple], Generator[Tuple, None, None]] +LinearTriplets = Union[List[Tuple], Generator[Tuple, None, None]] __all__ = ['DiscreteQuadraticModel', 'DQM'] @@ -419,7 +419,7 @@ class DiscreteQuadraticModel: return self._cydqm.get_quadratic_case( self.variables.index(u), u_case, self.variables.index(v), v_case) - def add_constraint_as_quadratic(self, terms: Linear, lagrange_multiplier: float, + def add_constraint_as_quadratic(self, terms: LinearTriplets, lagrange_multiplier: float, constant: float): """Add a linear constraint as a quadratic objective.
change the type Linear to LinearTriplet since Linear is too general
dwavesystems_dimod
train
py
36e2f7b0108de9e68ebe16d273753d26f62cc2bd
diff --git a/includes/class-freemius.php b/includes/class-freemius.php index <HASH>..<HASH> 100755 --- a/includes/class-freemius.php +++ b/includes/class-freemius.php @@ -4019,7 +4019,6 @@ if ( $this->_menu->is_activation_page() && $this->is_theme() - && fs_request_is_action( $this->get_unique_affix() . '_show_optin' ) ) { $this->_show_theme_activation_optin_dialog(); }
[menu-manager] Removed redundant check that is already being checked in is_activation_page().
Freemius_wordpress-sdk
train
php
b7898b6bc5d9a3dc97e2b8fb6ab28548617d6004
diff --git a/lockfile.go b/lockfile.go index <HASH>..<HASH> 100644 --- a/lockfile.go +++ b/lockfile.go @@ -93,7 +93,7 @@ func (l Lockfile) TryLock() error { panic(ErrNeedAbsPath) } - tmplock, err := ioutil.TempFile(filepath.Dir(name), "") + tmplock, err := ioutil.TempFile(filepath.Dir(name), filepath.Base(name)+".") if err != nil { return err }
Add a prefix for the lock hard links To know to which lock the file is referring to
nightlyone_lockfile
train
go
acc78680fa9cbc0e7e0510fc79b076adc9212063
diff --git a/lettuce/core.py b/lettuce/core.py index <HASH>..<HASH> 100644 --- a/lettuce/core.py +++ b/lettuce/core.py @@ -157,8 +157,10 @@ class StepDescription(object): self.file = filename if self.file: self.file = fs.relpath(self.file) + else: + self.file = "unknown file" - self.line = line + self.line = line or 0 class ScenarioDescription(object):
avoiding `None` filename and line number in step descriptions. It's an attempt to close #<I>, which seems to happen in windows
aloetesting_aloe_django
train
py
b103a25ed1d814e071b0d2f3bb2ee51129b2116c
diff --git a/test/aplus-adapter.js b/test/aplus-adapter.js index <HASH>..<HASH> 100644 --- a/test/aplus-adapter.js +++ b/test/aplus-adapter.js @@ -1,3 +1,15 @@ -exports.resolved = null; -exports.rejected = null; -exports.deferred = null; \ No newline at end of file +var IOU = require('../index') + + +exports.resolved = IOU.Promise.resolve; + +exports.rejected = IOU.Promise.reject; + +exports.deferred = function () { + var deferred = {} + deferred.promise = new IOU.Promise(function (resolve, reject) { + deferred.resolve = resolve; + deferred.reject = reject; + }); + return deferred; +}; \ No newline at end of file
aplus test adapter On branch v_2_ecma6 modified: test/aplus-adapter.js
kixxauth_iou
train
js
3112ad3d5cde939163765148662be19ff116dee6
diff --git a/etcd/kv_etcd.go b/etcd/kv_etcd.go index <HASH>..<HASH> 100644 --- a/etcd/kv_etcd.go +++ b/etcd/kv_etcd.go @@ -16,7 +16,7 @@ import ( const ( Name = "etcd-kv" defHost = "http://etcd.portworx.com:4001" - defaultRetryCount = 5 + defaultRetryCount = 20 defaultIntervalBetweenRetries = time.Millisecond * 500 )
etcd logs show that the snapshot completion time is around 7 seconds. So bump up the retries to <I>, so we retry for about <I> seconds before giving up (this seems a lot to me).
portworx_kvdb
train
go
a05ced4ef04819cca829afad3709c8a4a92323f4
diff --git a/spec/controllers/bag_types_controller_spec.rb b/spec/controllers/bag_types_controller_spec.rb index <HASH>..<HASH> 100644 --- a/spec/controllers/bag_types_controller_spec.rb +++ b/spec/controllers/bag_types_controller_spec.rb @@ -2,4 +2,27 @@ require 'rails_helper' RSpec.describe BagTypesController, :type => :controller do + describe 'GET #new' do + it 'renders the new template' do + get :new + expect(response).to render_template('new') + end + end + + describe 'POST #create' do + context "with valid attributes" do + it 'creates a new bag type' do + expect { post :create, bag_type: { description: "Green Bag" } }.to change(BagType, :count).by(1) + expect(response).to redirect_to(bag_types_path) + end + end + + context "with invalid attributes" do + it 'creates a new bag type' do + expect { post :create, bag_type: { description: nil } }.to change(BagType, :count).by(0) + expect(response).to render_template(:new) + end + end + end + end
Set up rspec controller tests for new/create action.
airslie_renalware-core
train
rb
d541f8d3f8c670e2463883561e04eb7c159d6b4c
diff --git a/tasks/indent.js b/tasks/indent.js index <HASH>..<HASH> 100644 --- a/tasks/indent.js +++ b/tasks/indent.js @@ -63,7 +63,7 @@ module.exports = function(grunt) { newFile.push(line); }); - grunt.file.write(dest, newFile.join('\n')); + grunt.file.write(dest, newFile.join(grunt.util.linefeed)); }); });
Changed write to use grunt.util.linefeed line endings. This change lets Grunt (or user configuration) decided what line ending to use in the saved file.
stevenbenner_grunt-indent
train
js
4bf9d4ac657e54d755fcb6bea1bbbdb665609158
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,6 @@ setuptools.setup( )), classifiers=[ 'Development Status :: 4 - Beta', - 'Framework :: Odoo', 'Intended Audience :: Developers', 'License :: OSI Approved :: ' 'GNU Lesser General Public License v3 (LGPLv3)',
odoo is not a pypi framework
acsone_setuptools-odoo
train
py
6381f002fe9d44dc34fd02aff072abfbe548f342
diff --git a/bfg9000/builtins/packages.py b/bfg9000/builtins/packages.py index <HASH>..<HASH> 100644 --- a/bfg9000/builtins/packages.py +++ b/bfg9000/builtins/packages.py @@ -74,10 +74,18 @@ def boost_package(build, env, name, version=None): raise ValueError("version {ver} doesn't meet requirement {req}" .format(ver=curr_version, req=req_version)) - # TODO: Figure out what to do for Windows, which usually has Boost's version - # number and build settings in the filename. + if env.platform.name == 'windows': + # XXX: Support other configurations. + vs_version = env.getvar('VISUALSTUDIOVERSION').replace('.', '') + libname = 'boost_{name}-vc{vs}-mt-{version}'.format( + name=name, vs=vs_version, + version=str(curr_version).replace('.', '_') + ) + else: + libname = 'boost_' + name + return BoostPackage( - [headers], [_find_library(env, 'boost_' + name, search_dirs)], + [headers], [_find_library(env, libname, search_dirs)], curr_version )
Speculative support for Boost-on-Windows
jimporter_bfg9000
train
py
5075adbfaa68a0a30402c386f76297a09ddcd080
diff --git a/internal/uvm/create_lcow.go b/internal/uvm/create_lcow.go index <HASH>..<HASH> 100644 --- a/internal/uvm/create_lcow.go +++ b/internal/uvm/create_lcow.go @@ -99,7 +99,7 @@ func NewDefaultOptionsLCOW(id, owner string) *OptionsLCOW { ConsolePipe: "", SCSIControllerCount: 1, UseGuestConnection: true, - ExecCommandLine: fmt.Sprintf("/bin/gcs -log-format json -loglevel %s", logrus.StandardLogger().Level.String()), + ExecCommandLine: fmt.Sprintf("/bin/gcs -v4 -log-format json -loglevel %s", logrus.StandardLogger().Level.String()), ForwardStdout: false, ForwardStderr: true, OutputHandler: parseLogrus(id),
Enable bridge v4 on all v2 LCOW activations
Microsoft_hcsshim
train
go
df741794f6049e03c2571d75736b9514253f6f00
diff --git a/tests/helper.rb b/tests/helper.rb index <HASH>..<HASH> 100644 --- a/tests/helper.rb +++ b/tests/helper.rb @@ -8,7 +8,7 @@ def lorem_file end # check to see which credentials are available and add others to the skipped tags list -all_providers = ['aws', 'bluebox', 'brightbox', 'dnsimple', 'ecloud', 'gogrid', 'google', 'linode', 'local', 'newservers', 'rackspace', 'slicehost', 'zerigo'] +all_providers = ['aws', 'bluebox', 'brightbox', 'dnsimple', 'ecloud', 'gogrid', 'google', 'linode', 'local', 'newservers', 'rackspace', 'slicehost', 'voxel', 'zerigo'] available_providers = Fog.providers.map {|provider| provider.downcase} for provider in (all_providers - available_providers) Formatador.display_line("[yellow]Skipping tests for [bold]#{provider}[/] [yellow]due to lacking credentials (add some to '~/.fog' to run them)[/]")
Prevent voxel tests running if missing credentials
fog_fog
train
rb
e591b35f4f7dca9692ee682f6744d5c1fae9ec2c
diff --git a/test/test_pkcs11_structs.rb b/test/test_pkcs11_structs.rb index <HASH>..<HASH> 100644 --- a/test/test_pkcs11_structs.rb +++ b/test/test_pkcs11_structs.rb @@ -150,4 +150,17 @@ class TestPkcs11Structs < Test::Unit::TestCase assert_equal ["2010", "12", "31"], s.values, 'values of CK_DATE' assert_equal( {:day=>"31", :month=>"12", :year=>"2010"}, s.to_hash, 'CK_DATE as hash' ) end + + def test_bignum_attribute + bignum = [-1].pack("l_").unpack("L_")[0] + attr = CK_ATTRIBUTE.new(CKA_KEY_TYPE, bignum) + assert_equal bignum, attr.value, "The bignum value should set" + end + + def test_bignum_mechanism + bignum = [-1].pack("l_").unpack("L_")[0] + mech = CK_MECHANISM.new(bignum-1, bignum) + assert_equal bignum-1, mech.mechanism, "The bignum mechanism should set" + assert_equal [-1].pack("l_"), mech.pParameter, "The bignum parameter is retrieved as String" + end end
Add tests for Bignums as attribute value, mechanism value and mechanism parameter.
larskanis_pkcs11
train
rb
53e116cf4feffaa6ddfe4c5999685a0459fc5d96
diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer.php index <HASH>..<HASH> 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer.php @@ -106,6 +106,7 @@ class Indexer 'settings' => [ 'number_of_shards' => $this->index->getOptions()->getShards(), 'number_of_replicas' => $this->index->getOptions()->getReplicas(), + 'max_result_window' => $this->index->getOptions()->getMaxResultWindow(), 'analysis' => $this->index->getAnalysis() ], 'mappings' => [
fix : conf:max_result_window (es) is now used when creating index by searchengine
alchemy-fr_Phraseanet
train
php
053541bef912e2088fc322465b7f8486c0f08eec
diff --git a/pyfnnd/_fnndeconv.py b/pyfnnd/_fnndeconv.py index <HASH>..<HASH> 100644 --- a/pyfnnd/_fnndeconv.py +++ b/pyfnnd/_fnndeconv.py @@ -172,7 +172,13 @@ def deconvolve(F, C0=None, theta0=None, dt=0.02, rate=0.5, tau=1., sigma, alpha, beta, lamb, gamma = theta if C0 is None: - n0 = lamb * dt * np.ones(nt) + + # it's necessary to vary the value of n0 according to the noise level. + # when total noise is higher, n0 needs to be set higher or optimization + # fails completely. however, when total noise is small then setting n0 + # too high will mean that n_best will have a significant baseline non- + # zero spike probability (which probably ought to be absorbed by beta). + n0 = 10 * np.ones(nt) * (sigma / np.sqrt(npix)) C0 = signal.lfilter(np.r_[1], np.r_[1, -gamma], n0, axis=0) # if we're not learning the parameters, this step is all we need to do
improved initialization of n0 with a hack that is unlikely to be robust - n0 needs to be scaled according to noise levels
alimuldal_PyFNND
train
py
408d5aadbd7459e6babcbdc9c86bd6fff46983a3
diff --git a/freak.js b/freak.js index <HASH>..<HASH> 100644 --- a/freak.js +++ b/freak.js @@ -37,14 +37,16 @@ function freak(obj, root, parent, prop) { } for (var prop in x) { - if (y.hasOwnProperty(prop)) { - if (!deepEqual(x[prop], y[prop])) { + if (x.hasOwnProperty(prop)) { + if (y.hasOwnProperty(prop)) { + if (!deepEqual(x[prop], y[prop])) { + return false; + } + } + else { return false; } } - else { - return false; - } } return true;
<I> Bugfix in deepEqual(). Was not working on polyfilled arrays in IE8
atmin_freak
train
js
956c06e35cd5a28a2c06195e9bd608841506ee69
diff --git a/javascript/webpack.config.js b/javascript/webpack.config.js index <HASH>..<HASH> 100644 --- a/javascript/webpack.config.js +++ b/javascript/webpack.config.js @@ -83,6 +83,6 @@ if (TARGET === 'build') { }); } -if (TARGET === undefined) { +if (TARGET !== 'build' && TARGET !== 'start') { module.exports = webpackConfig; }
Export webpackConfig if not running build or start
Graylog2_graylog2-server
train
js
38534639a106284fc5f9cd3b150bd5b364d43027
diff --git a/src/formatter/propNameSorter.js b/src/formatter/propNameSorter.js index <HASH>..<HASH> 100644 --- a/src/formatter/propNameSorter.js +++ b/src/formatter/propNameSorter.js @@ -1,13 +1,17 @@ /* @flow */ +const isKeyOrRefProps = (propName: string) => ['key', 'ref'].includes(propName); + export default (sortProps: boolean) => (a: string, b: string): -1 | 0 | 1 => { if (a === b) { return 0; } - if (['key', 'ref'].includes(a)) { + if (isKeyOrRefProps(a) && isKeyOrRefProps(b)) { + return 1; + } else if (isKeyOrRefProps(a)) { return -1; - } else if (['key', 'ref'].includes(b)) { + } else if (isKeyOrRefProps(b)) { return 1; }
fix(formatting): Make the props "key" and "ref" order predictibale (#<I>)
algolia_react-element-to-jsx-string
train
js
ebc503b599aef93ef97ce740fd407a2e18043d85
diff --git a/lib/backup/storage/object.rb b/lib/backup/storage/object.rb index <HASH>..<HASH> 100644 --- a/lib/backup/storage/object.rb +++ b/lib/backup/storage/object.rb @@ -24,7 +24,7 @@ module Backup # descending. The newest backup storage object comes in Backup::Storage::Object.load[0] # and the oldest in Backup::Storage::Object.load[-1] def load - if File.exist?(storage_file) && !File.zero?(storage_file) + if File.exist?(storage_file) and not File.zero?(storage_file) YAML.load_file(storage_file).sort { |a,b| b.time <=> a.time } else [] diff --git a/spec/storage/object_spec.rb b/spec/storage/object_spec.rb index <HASH>..<HASH> 100644 --- a/spec/storage/object_spec.rb +++ b/spec/storage/object_spec.rb @@ -28,6 +28,7 @@ describe Backup::Storage::Object do obj_3 = Backup::Storage::S3.new; obj_3.time = '2011.00.00.00.00.00' File.expects(:exist?).returns(true) + File.expects(:zero?).returns(false) YAML.expects(:load_file).with( File.join(Backup::DATA_PATH, Backup::TRIGGER, 's3.yml') ).returns(YAML.load([obj_1, obj_2, obj_3].to_yaml))
Fixed a spec that wasn't updated yet when File.zero? got implemented.
backup_backup
train
rb,rb
6b8e71c2fd4f3bb64f70ab9729b5c85079ebe16c
diff --git a/applications/desktop/webpack.common.js b/applications/desktop/webpack.common.js index <HASH>..<HASH> 100644 --- a/applications/desktop/webpack.common.js +++ b/applications/desktop/webpack.common.js @@ -3,6 +3,11 @@ const path = require("path"); const webpack = require("webpack"); const configurator = require("@nteract/webpack-configurator"); +const tsLoaderConfig = { + loader: "ts-loader", + options: { transpileOnly: true } +}; + const nodeModules = { jmp: "commonjs jmp", canvas: "commonjs canvas", @@ -30,7 +35,7 @@ const mainConfig = { rules: [ { test: /\.tsx?$/, - use: [{ loader: "ts-loader", options: { transpileOnly: true } }] + use: [tsLoaderConfig] } ] }, @@ -58,7 +63,7 @@ const rendererConfig = { rules: [ { test: /\.tsx?$/, - use: [{ loader: "ts-loader", options: { transpileOnly: true } }] + use: [tsLoaderConfig] } ] },
keep ts loader config consistent in one spot
nteract_nteract
train
js
427274abb79751451dac6e22a5cc382a1f6386bc
diff --git a/metno/__init__.py b/metno/__init__.py index <HASH>..<HASH> 100644 --- a/metno/__init__.py +++ b/metno/__init__.py @@ -102,7 +102,7 @@ class MetWeatherData: return False self.data = await resp.json() except (asyncio.TimeoutError, aiohttp.ClientError) as err: - _LOGGER.error("%s returned %s", self._api_url, err) + _LOGGER.error("Access to %s returned error '%s'", self._api_url, type(err).__name__) return False except ValueError: _LOGGER.exception("Unable to parse json response from %s", self._api_url)
Improved logged error (#<I>) * Improved logged error * Increased timeout from <I> to <I> (site often slow) * Update metno/__init__.py
Danielhiversen_pyMetno
train
py
289950e3d8adf76e2cf84b8d090a10b15550766a
diff --git a/lib/onebox/engine/standard_embed.rb b/lib/onebox/engine/standard_embed.rb index <HASH>..<HASH> 100644 --- a/lib/onebox/engine/standard_embed.rb +++ b/lib/onebox/engine/standard_embed.rb @@ -119,7 +119,7 @@ module Onebox return nil unless html_doc favicon = html_doc.css('link[rel="shortcut icon"], link[rel="icon shortcut"], link[rel="shortcut"], link[rel="icon"]').first - favicon = favicon.nil? ? nil : favicon['href']&.strip + favicon = favicon.nil? ? nil : (favicon['href'].nil? ? nil : favicon['href'].strip) if favicon && favicon.match(/^https?:\/\//i).nil? uri = URI(url)
make tests pass on <I>
discourse_onebox
train
rb
d35ba6462926d0da5e393871f545193809720f7e
diff --git a/lib/rest-graph/rails_util.rb b/lib/rest-graph/rails_util.rb index <HASH>..<HASH> 100644 --- a/lib/rest-graph/rails_util.rb +++ b/lib/rest-graph/rails_util.rb @@ -178,7 +178,7 @@ module RestGraph::RailsUtil end def rest_graph_in_canvas? - !rest_graph_options[:canvas].empty? || @fb_sig_in_canvas + !rest_graph_options[:canvas].empty? end def rest_graph_canvas
rails_util.rb: removed @fb_sig_in_canvas hack
godfat_rest-core
train
rb
d8d44b80cc31aec57784b96c27e89403fd0b0420
diff --git a/internal/pkg/gateway/api.go b/internal/pkg/gateway/api.go index <HASH>..<HASH> 100644 --- a/internal/pkg/gateway/api.go +++ b/internal/pkg/gateway/api.go @@ -28,12 +28,6 @@ import ( "google.golang.org/grpc/status" ) -type endorserResponse struct { - action *peer.ChaincodeEndorsedAction - err *gp.ErrorDetail - timeoutExpired bool -} - // Evaluate will invoke the transaction function as specified in the SignedProposal func (gs *Server) Evaluate(ctx context.Context, request *gp.EvaluateRequest) (*gp.EvaluateResponse, error) { if request == nil {
Remove redundant type definition (#<I>) The code that used this was rewritten in a previous commit.
hyperledger_fabric
train
go
4f32ae8e1467470a374f82a22078265f186abaca
diff --git a/Extraction/Extractor/JmsExtractor.php b/Extraction/Extractor/JmsExtractor.php index <HASH>..<HASH> 100644 --- a/Extraction/Extractor/JmsExtractor.php +++ b/Extraction/Extractor/JmsExtractor.php @@ -116,6 +116,14 @@ class JmsExtractor implements ExtractorInterface /** @var PropertyMetadata $item */ foreach ($meta->propertyMetadata as $item) { + // This is to prevent property of discriminator field name to not being complete + if (isset($meta->discriminatorFieldName) + && $item->name == $meta->discriminatorFieldName + && !isset($item->type['name']) + ) { + $item->type = ['name' => 'string', 'params' => []]; + } + if ($this->shouldSkipProperty($exclusionStrategies, $item, $subContext)) { continue; }
fix discriminator information type not being complete for jms extractor
mpoiriert_swagger
train
php
9c35ee63d5e2d2156fea1bdd7ba44634930446c4
diff --git a/library/CM/Migration/Cli.php b/library/CM/Migration/Cli.php index <HASH>..<HASH> 100644 --- a/library/CM/Migration/Cli.php +++ b/library/CM/Migration/Cli.php @@ -31,7 +31,8 @@ class CM_Migration_Cli extends CM_Cli_Runnable_Abstract { */ public function add($namespace = null, $name = null) { if (null === $name) { - $name = CM_Util::exec('git rev-parse --abbrev-ref HEAD'); + $defaultName = CM_Util::exec('git rev-parse --abbrev-ref HEAD'); + $name = $this->_getStreamInput()->read(sprintf('Migration script name [%s]:', $defaultName), $defaultName); } $adapter = new CM_File_Filesystem_Adapter_Local($this->_getMigrationPathByModule($namespace)); $filesystem = new CM_File_Filesystem($adapter);
Ask for the script name if needed
cargomedia_cm
train
php
033bf821a2be1d462d13aacfed899c0bf3e5b457
diff --git a/routes/recordEdit.js b/routes/recordEdit.js index <HASH>..<HASH> 100644 --- a/routes/recordEdit.js +++ b/routes/recordEdit.js @@ -91,6 +91,7 @@ var route = function (req, res, next) { record: req.linz.record, actionUrl: linz.api.url.getAdminLink(req.linz.model, 'save', req.linz.record._id), customAttributes: res.locals.customAttributes, + pageTitle: `Editing '${req.linz.record.title}'`, scripts, styles, });
Added a page title for record editing.
linzjs_linz
train
js
12882b26be09f94fd9939262fac800cfaaa8a27f
diff --git a/lib/punchblock/connection.rb b/lib/punchblock/connection.rb index <HASH>..<HASH> 100644 --- a/lib/punchblock/connection.rb +++ b/lib/punchblock/connection.rb @@ -27,7 +27,7 @@ module Punchblock blather_keys = [:username, :password, :host, :port, :certs] blather_options = options.select { |key, value| blather_keys.include? key } options.reject! { |key, value| blather_keys.include? key } - raise ArgumentError unless @username = blather_options[:username] && blather_options[:password] + raise ArgumentError unless (@username = blather_options[:username]) && blather_options[:password] setup *blather_options.values
Fix a typo which was causing the connection's username to be set to the password
adhearsion_punchblock
train
rb
99cece0fd140e897712a9ad659152676b1124fe6
diff --git a/lib/generators/anaconda/templates/config/initializers/anaconda.rb b/lib/generators/anaconda/templates/config/initializers/anaconda.rb index <HASH>..<HASH> 100644 --- a/lib/generators/anaconda/templates/config/initializers/anaconda.rb +++ b/lib/generators/anaconda/templates/config/initializers/anaconda.rb @@ -9,7 +9,7 @@ Anaconda.config do |config| config.file_types = { audio: /(\.|\/)(wav|mp3|m4a|aiff|ogg|flac)$/, video: /(\.|\/)(mp[e]?g|mov|avi|mp4|m4v)$/, - image: /(\.|\/)(jp[e]?g|png|bmp)$/, + image: /(\.|\/)(jp[e]?g|png|bmp|gif)$/, resource: /(\.|\/)(pdf|ppt[x]?|doc[x]?|xls[x]?)$/, } end \ No newline at end of file
Add gif as a default supported file type.
ForgeApps_anaconda
train
rb
1eb5ad567c1c12982fdf09432e7054b0f9c586fd
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ setup( install_requires=[ 'django-modeldict>=1.1.6', 'nexus>=0.2.3', - 'django-jsonfield', + 'django-jsonfield==0.6', ], license='Apache License 2.0', tests_require=tests_require,
Lock json field at <I>
disqus_gargoyle
train
py
3e8e15bbcd25dfadfb7a8a9b71ee4c3fad9e87d4
diff --git a/src/Adapter/Phpunit/XmlConfiguration.php b/src/Adapter/Phpunit/XmlConfiguration.php index <HASH>..<HASH> 100644 --- a/src/Adapter/Phpunit/XmlConfiguration.php +++ b/src/Adapter/Phpunit/XmlConfiguration.php @@ -154,7 +154,7 @@ class XmlConfiguration /** * Adds a <php><env name="XXX" value="YYY"/></php> to set environment variables * and generates the <php> block if not present. - * + * * @param string $name Environment variable name * @param string $value Value of the variable to set */ diff --git a/src/Config.php b/src/Config.php index <HASH>..<HASH> 100644 --- a/src/Config.php +++ b/src/Config.php @@ -60,7 +60,8 @@ class Config /** * @return bool */ - public function isPhpunitConfigured() { + public function isPhpunitConfigured() + { return isset($this->config->phpunit); }
Apply fixes from StyleCI (#<I>)
humbug_humbug
train
php,php
497e24508ed4ffd634a18b249a5367d18dd7cc12
diff --git a/scapy/contrib/homepluggp.py b/scapy/contrib/homepluggp.py index <HASH>..<HASH> 100644 --- a/scapy/contrib/homepluggp.py +++ b/scapy/contrib/homepluggp.py @@ -158,7 +158,7 @@ class SLAC_varfield_cnf(Packet): StrFixedLenField("RunID", b"\x00" * 8, 8), StrFixedLenField("RSVD", b"\x00" * 8, 8), StrFixedLenField("NetworkID", b"\x00" * 7, 7), - ShortField("Reserved", 0), + ByteField("Reserved", 0x0), StrFixedLenField("NMK", b"\x00" * 16, 16)]
Fix CM_SLAC_MATCH_CNF second RSVD The CM_SLAC_MATCH_CNF second RSVD has 1 byte, replaced ShortField (2 bytes) with ByteField
secdev_scapy
train
py
483f797fc45a407d6ffd41b31894b98e718ee865
diff --git a/test_functools.py b/test_functools.py index <HASH>..<HASH> 100644 --- a/test_functools.py +++ b/test_functools.py @@ -72,3 +72,31 @@ class TestMethodCache: copy.deepcopy(ob) ob.method(1) copy.deepcopy(ob) + + def test_magic_methods(self): + """ + Test method_cache with __getitem__ and __getattr__. + """ + class ClassUnderTest: + getitem_calls = 0 + getattr_calls = 0 + + @method_cache + def __getitem__(self, item): + self.getitem_calls += 1 + return item + + @method_cache + def __getattr__(self, name): + self.getattr_calls += 1 + return name + + ob = ClassUnderTest() + + # __getitem__ + _ = ob[1] + ob[1] + assert ob.getitem_calls == 1 + + # __getattr__ + _ = ob.one + ob.one + assert ob.getattr_calls == 1
Add a test for `method_cache` on the `__getitem__` and `__getattr__` magic methods.
jaraco_jaraco.functools
train
py
ef842a553bef2e30b5838e63a7939b6e78caa215
diff --git a/lib/xcodeproj/project.rb b/lib/xcodeproj/project.rb index <HASH>..<HASH> 100644 --- a/lib/xcodeproj/project.rb +++ b/lib/xcodeproj/project.rb @@ -479,12 +479,14 @@ module Xcodeproj # @return [Nil] If no file reference could be found. # def reference_for_path(absolute_path) - unless Pathname.new(absolute_path).absolute? + absolute_pathname = Pathname.new(absolute_path) + + unless absolute_pathname.absolute? raise ArgumentError, "Paths must be absolute #{absolute_path}" end objects.find do |child| - child.isa == 'PBXFileReference' && child.real_path == absolute_path + child.isa == 'PBXFileReference' && child.real_path == absolute_pathname end end
Fixed issue #<I> In class Xcodeproj::Project, reference_for_path failed if called with a string parameter: when comparing absolute_path and child.real_path, ensure that both terms are Pathname objects.
CocoaPods_Xcodeproj
train
rb
4325a4d23ac792cc9a523bfb3a0cfde5ec332a28
diff --git a/mod/lti/locallib.php b/mod/lti/locallib.php index <HASH>..<HASH> 100644 --- a/mod/lti/locallib.php +++ b/mod/lti/locallib.php @@ -889,12 +889,7 @@ function lti_tool_configuration_from_content_item($typeid, $messagetype, $ltiver } if (isset($item->url)) { $url = new moodle_url($item->url); - // Assign item URL to securetoolurl or toolurl depending on its scheme. - if (strtolower($url->get_scheme()) === 'https') { - $config->securetoolurl = $url->out(false); - } else { - $config->toolurl = $url->out(false); - } + $config->toolurl = $url->out(false); $config->typeid = 0; } else { $config->typeid = $typeid;
MDL-<I> LTI Content Item: does not populate tool url when https
moodle_moodle
train
php
9a307a07f3c85da515c64620c3410df40afe1261
diff --git a/session/txn.go b/session/txn.go index <HASH>..<HASH> 100644 --- a/session/txn.go +++ b/session/txn.go @@ -378,6 +378,7 @@ func (txn *LazyTxn) Rollback() error { // LockKeys Wrap the inner transaction's `LockKeys` to record the status func (txn *LazyTxn) LockKeys(ctx context.Context, lockCtx *kv.LockCtx, keys ...kv.Key) error { + failpoint.Inject("beforeLockKeys", func() {}) t := time.Now() var originState txninfo.TxnRunningState
session: Add failpoint session/beforeLoockKeys (#<I>)
pingcap_tidb
train
go
7d14a7c7830ed3ebe1024c5be4a79e79c07f6afd
diff --git a/luigi/interface.py b/luigi/interface.py index <HASH>..<HASH> 100644 --- a/luigi/interface.py +++ b/luigi/interface.py @@ -40,12 +40,12 @@ from luigi import execution_summary from luigi.cmdline_parser import CmdlineParser -def setup_interface_logging(conf_file=None): +def setup_interface_logging(conf_file=''): # use a variable in the function object to determine if it has run before if getattr(setup_interface_logging, "has_run", False): return - if conf_file is None: + if conf_file == '': logger = logging.getLogger('luigi-interface') logger.setLevel(logging.DEBUG)
bugfix: Don't crash when logging isn't specified This fixes something that briefly broke the the other day. Set default conf_file value to empty string within function setup_interface_logging such that logging will not try to using a logging.conf file which doesn't exist. (#<I>)
spotify_luigi
train
py
199e2c43337dc18eafd7288ea65b5ff8944fccc4
diff --git a/version/version.go b/version/version.go index <HASH>..<HASH> 100644 --- a/version/version.go +++ b/version/version.go @@ -14,4 +14,4 @@ package version -const Version = "0.3.0+git" +const Version = "0.3.1"
version: bump to <I>
rkt_rkt
train
go
9274b63478e0b844ff9d16167581c33705e47e36
diff --git a/para-server/src/main/java/com/erudika/para/search/ElasticSearchUtils.java b/para-server/src/main/java/com/erudika/para/search/ElasticSearchUtils.java index <HASH>..<HASH> 100644 --- a/para-server/src/main/java/com/erudika/para/search/ElasticSearchUtils.java +++ b/para-server/src/main/java/com/erudika/para/search/ElasticSearchUtils.java @@ -74,6 +74,7 @@ public final class ElasticSearchUtils { " \"tag\": {\"type\": \"string\", \"index\": \"not_analyzed\"},\n" + " \"id\": {\"type\": \"string\", \"index\": \"not_analyzed\"},\n" + " \"key\": {\"type\": \"string\", \"index\": \"not_analyzed\"},\n" + + " \"name\": {\"type\": \"string\", \"index\": \"not_analyzed\"},\n" + " \"type\": {\"type\": \"string\", \"index\": \"not_analyzed\"},\n" + " \"tags\": {\"type\": \"string\", \"index\": \"not_analyzed\"},\n" + " \"email\": {\"type\": \"string\", \"index\": \"not_analyzed\"},\n" +
fixed #<I> - name field is case-sensitive
Erudika_para
train
java
08f2fbbf45115628aaa8d8472ac0eb9c9136a70b
diff --git a/uk_geo_utils/management/commands/import_cleaned_addresses.py b/uk_geo_utils/management/commands/import_cleaned_addresses.py index <HASH>..<HASH> 100644 --- a/uk_geo_utils/management/commands/import_cleaned_addresses.py +++ b/uk_geo_utils/management/commands/import_cleaned_addresses.py @@ -6,6 +6,12 @@ from uk_geo_utils.helpers import get_address_model class Command(BaseCommand): + help = ( + "Deletes all data in Address model AND any related tables,", + "and replaces Address model data with that in the cleaned AddressBase CSVs.", + "Data in related tables will need to be imported/rebuilt seperately", + ) + def add_arguments(self, parser): parser.add_argument( "cleaned_ab_path", @@ -38,7 +44,7 @@ class Command(BaseCommand): cursor = connection.cursor() self.stdout.write("clearing existing data..") - cursor.execute("TRUNCATE TABLE %s;" % (self.table_name)) + cursor.execute("TRUNCATE TABLE %s CASCADE;" % (self.table_name)) self.stdout.write("importing from %s.." % (cleaned_file_path)) cursor.copy_expert(
Make import_cleaned_addresses drop related tables This is necessary if your ONSUD_MODEL is related to your ADDRESS_MODEL, as is the case in UK-Polling-Stations. Without this the related table prevents the Address table from being truncated.
DemocracyClub_uk-geo-utils
train
py
b168484bac6c56288143d6c1cfbd09ec003a0667
diff --git a/SoftLayer/fixtures/SoftLayer_Network_Subnet.py b/SoftLayer/fixtures/SoftLayer_Network_Subnet.py index <HASH>..<HASH> 100644 --- a/SoftLayer/fixtures/SoftLayer_Network_Subnet.py +++ b/SoftLayer/fixtures/SoftLayer_Network_Subnet.py @@ -33,7 +33,7 @@ getObject = { 'tag': {'id': 100123, 'name': 'subnet: test tag'}, } - ] + ], 'ipAddresses': [ {'id': 123456, 'ipAddress': '16.26.26.25'},
Update SoftLayer_Network_Subnet.py
softlayer_softlayer-python
train
py
6f9771c0cccae1baca25dc362166c4fdea9fd9b6
diff --git a/spec/multi_json_spec.rb b/spec/multi_json_spec.rb index <HASH>..<HASH> 100644 --- a/spec/multi_json_spec.rb +++ b/spec/multi_json_spec.rb @@ -169,22 +169,6 @@ describe MultiJson do it_behaves_like 'has options', MultiJson - # %w(gson jr_jackson json_gem json_pure nsjsonserialization oj ok_json yajl).each do |adapter| - # next if !jruby? && %w(gson jr_jackson).include?(adapter) - # next if !macruby? && adapter == 'nsjsonserialization' - # next if jruby? && %w(oj yajl).include?(adapter) - - # context adapter do - # it_behaves_like 'an adapter', adapter - # end - # end - - # %w(json_gem json_pure).each do |adapter| - # context adapter do - # it_behaves_like 'JSON-like adapter', adapter - # end - # end - describe 'aliases' do if jruby? describe 'jrjackson' do
Remove commented out part of the spec
intridea_multi_json
train
rb
d03a0a51e8f4aab9b0cc68b92f022c501d0c6310
diff --git a/lib/fedora.js b/lib/fedora.js index <HASH>..<HASH> 100644 --- a/lib/fedora.js +++ b/lib/fedora.js @@ -20,6 +20,7 @@ exports.configure = function configure(config) { port : config.fedoraPort, auth : config.fedoraAuth }; + winston.log("info", "Fedora package configured") }
Added message to show configuration has happened
jcftang_node-fedora
train
js
918e60f6a48457b2a7a9be07439c32539336e24f
diff --git a/cli/src/main/java/org/owasp/dependencycheck/App.java b/cli/src/main/java/org/owasp/dependencycheck/App.java index <HASH>..<HASH> 100644 --- a/cli/src/main/java/org/owasp/dependencycheck/App.java +++ b/cli/src/main/java/org/owasp/dependencycheck/App.java @@ -301,6 +301,7 @@ public class App { || (v.getUnscoredSeverity() != null && SeverityUtil.estimateCvssV2(v.getUnscoredSeverity()) >= cvssFailScore) || (cvssFailScore <= 0.0f)) { //safety net to fail on any if for some reason the above misses on 0 retCode = 1; + break; } } }
Break out of loop looking for high enough vulnerabilities as soon as possible.
jeremylong_DependencyCheck
train
java
d9be205e79b7b82b2f30e30c1aa456d2681e6a95
diff --git a/lib/psxlsgen.php b/lib/psxlsgen.php index <HASH>..<HASH> 100644 --- a/lib/psxlsgen.php +++ b/lib/psxlsgen.php @@ -155,6 +155,8 @@ if( !defined( "PHP_SIMPLE_XLS_GEN" ) ) { header ( "Pragma: no-cache" ); if (!strstr($HTTP_USER_AGENT,"MSIE")) { $attachment=" attachment;"; + } else { + $attachment=""; } header("Content-Type: application/x-msexcel\r\n"); header("Content-Disposition:$attachment filename=$this->filename.xls\r\n\r\n");
Fixed an uninitialised variable
moodle_moodle
train
php
cbac04db3826d6671f032a268c621a653171a3b9
diff --git a/Lib/fontbakery/specifications/googlefonts.py b/Lib/fontbakery/specifications/googlefonts.py index <HASH>..<HASH> 100644 --- a/Lib/fontbakery/specifications/googlefonts.py +++ b/Lib/fontbakery/specifications/googlefonts.py @@ -1714,17 +1714,17 @@ def com_google_fonts_check_098(style, else: familynames = typographic_familynames + failed = False for font_familyname in familynames: - if font_familyname in font_metadata.name: - yield PASS, ("METADATA.pb font.name field contains" - " font name in right format." - " ('{}' in '{}')").format(font_familyname, - font_metadata.name) - else: + if font_familyname not in font_metadata.name: + failed = True yield FAIL, ("METADATA.pb font.name field (\"{}\")" " does not match correct font name format (\"{}\")." "").format(font_metadata.name, font_familyname) + if not failed: + yield PASS, ("METADATA.pb font.name field contains" + " font name in right format.") @check(
fix check/<I> not yielding any result. (issue #<I>)
googlefonts_fontbakery
train
py
216d4b56063df36fdbd62a1298551c532839b2dc
diff --git a/samples/simple-api-server.js b/samples/simple-api-server.js index <HASH>..<HASH> 100644 --- a/samples/simple-api-server.js +++ b/samples/simple-api-server.js @@ -14,7 +14,7 @@ var options = unifile.defaultConfig; // define users (login/password) wich will be authorized to access the www folder (read and write) options.www.users = { "admin": "admin" -} +}; // use unifile as a middleware app.use(unifile.middleware(express, app, options));
code check with jshint
silexlabs_unifile
train
js
cc001bcfd478cc0409226d7b9edb8fb6f29feb2a
diff --git a/optaplanner-examples/src/main/java/org/optaplanner/examples/scrabble/domain/solver/CellUpdatingVariableListener.java b/optaplanner-examples/src/main/java/org/optaplanner/examples/scrabble/domain/solver/CellUpdatingVariableListener.java index <HASH>..<HASH> 100644 --- a/optaplanner-examples/src/main/java/org/optaplanner/examples/scrabble/domain/solver/CellUpdatingVariableListener.java +++ b/optaplanner-examples/src/main/java/org/optaplanner/examples/scrabble/domain/solver/CellUpdatingVariableListener.java @@ -26,6 +26,11 @@ import org.optaplanner.examples.scrabble.domain.ScrabbleWordDirection; public class CellUpdatingVariableListener implements VariableListener<ScrabbleWordAssignment> { @Override + public boolean requiresUniqueEntityEvents() { + return true; + } + + @Override public void beforeEntityAdded(ScoreDirector scoreDirector, ScrabbleWordAssignment wordAssignment) { // Do nothing }
Fix scrabble example (requires unique events)
kiegroup_optaplanner
train
java
41b6e108d8dbbebdfeeb6e7d5b5bfcf58c9d12e9
diff --git a/js/gdax.js b/js/gdax.js index <HASH>..<HASH> 100644 --- a/js/gdax.js +++ b/js/gdax.js @@ -246,11 +246,14 @@ module.exports = class gdax extends Exchange { parseTrade (trade, market = undefined) { let timestamp = undefined; - if (trade['time']) { + if ('time' in trade) { timestamp = this.parse8601 (trade['time']); - } else { + } else if ('created_at' in trade) { timestamp = this.parse8601 (trade['created_at']); } + let iso8601 = undefined; + if (typeof timestamp !== 'undefined') + iso8601 = this.iso8601 (timestamp); let side = (trade['side'] === 'buy') ? 'sell' : 'buy'; let symbol = undefined; if (!market) { @@ -283,7 +286,7 @@ module.exports = class gdax extends Exchange { 'order': orderId, 'info': trade, 'timestamp': timestamp, - 'datetime': this.iso8601 (timestamp), + 'datetime': iso8601, 'symbol': symbol, 'type': type, 'side': side,
added proper timestamp handling for gdax parseTrade to proper place fix #<I>
ccxt_ccxt
train
js
5c9bf7a30599355e96554983eaad1d581619811d
diff --git a/server/conn.go b/server/conn.go index <HASH>..<HASH> 100644 --- a/server/conn.go +++ b/server/conn.go @@ -42,6 +42,7 @@ import ( "net" "runtime" "strings" + "time" "github.com/juju/errors" "github.com/ngaut/log" @@ -254,8 +255,10 @@ func (cc *clientConn) dispatch(data []byte) error { token := cc.server.getToken() + startTs := time.Now() defer func() { cc.server.releaseToken(token) + log.Debugf("[TIME_CMD] %v %d", time.Now().Sub(startTs), cmd) }() switch cmd { @@ -363,6 +366,7 @@ func (cc *clientConn) writeEOF() error { } func (cc *clientConn) handleQuery(sql string) (err error) { + startTs := time.Now() rs, err := cc.ctx.Execute(sql) if err != nil { return errors.Trace(err) @@ -372,6 +376,7 @@ func (cc *clientConn) handleQuery(sql string) (err error) { } else { err = cc.writeOK() } + log.Debugf("[TIME_QUERY] %v %s", time.Now().Sub(startTs), sql) return errors.Trace(err) }
server: Add some time cost logs for query and cmd (#<I>)
pingcap_tidb
train
go
ffc0e48d6936377e4e5cbcf0019466b1e52b3f25
diff --git a/common_test.go b/common_test.go index <HASH>..<HASH> 100644 --- a/common_test.go +++ b/common_test.go @@ -26,7 +26,7 @@ import ( func TestInt64ToBytes(t *testing.T) { testInts := []int64{math.MinInt64, math.MaxInt64, -1, 0, 1} for i := -100; i <= 100; i++ { - testInts = append(testInts, int64(10000000000*i+100)) + testInts = append(testInts, 10000000000*int64(i)+100) } for _, x := range testInts { buf := int64ToBytes(x)
Bug fix: the unit tests didn't run on <I> bit sytems. Fix this.
seehuhn_fortuna
train
go
4d1e19185c41cb4c3b07c1531ce6c73bcf2369b0
diff --git a/lib/grit_adapter/file_access/status.rb b/lib/grit_adapter/file_access/status.rb index <HASH>..<HASH> 100644 --- a/lib/grit_adapter/file_access/status.rb +++ b/lib/grit_adapter/file_access/status.rb @@ -9,12 +9,24 @@ module DTK::Common; class GritAdapter; class FileAccess class Status < Hash def initialize(grit_status_obj) super() - [:added,:deleted,:changed,:untracked].each do |file_state| -# paths_with_file_state = grit_status_obj.send(file_state).map{|info|info[0]} + FileStates.each do |file_state| paths_with_file_state = grit_status_obj.send(file_state).map{|info|info[1].path} self[file_state] = paths_with_file_state unless paths_with_file_state.empty? end end + + def any_changes?() + !!FileStates.find{|fs|self[fs]} + end + + def shift_untracked_to_added!() + if untracked = self.delete(:untracked) + self[:added] = (self[:added]||[]) + untracked + end + self + end + + FileStates = [:added,:deleted,:changed,:untracked] end end end; end; end
put in methods to check if any status changes and to shift untyracked to added
rich-dtk_dtk-common
train
rb
c288192ee454cb4b1c450f9649b80d9d72957141
diff --git a/tocncx.py b/tocncx.py index <HASH>..<HASH> 100644 --- a/tocncx.py +++ b/tocncx.py @@ -99,6 +99,16 @@ those conforming to the relaxed constraints of OPS 2.0''')) self.makeFiguresList() if self.lot.childNodes: self.makeTablesList() + if front.article_meta.author_notes_contributions: + anc = nav.appendChild(self.toc.createElement('navPoint')) + anc.setAttribute('id', 'contributions') + anc.setAttribute('playOrder', str(self.playOrder)) + self.playOrder += 1 + anc_lbl = anc.appendChild(self.toc.createElement('navLabel')) + anc_lbl.appendChild(self.makeText('Author Contributions')) + anc_con = anc.appendChild(self.toc.createElement('content')) + src_str = 'main.{0}.xml#contributions'.format(self.jid) + anc_con.setAttribute('src', src_str) def structureParse(self, srcnode, dstnode = None, depth = 0, first = True): '''The structure of an article's <body> content can be analyzed in
Author Contributions is now working for Collection Mode
SavinaRoja_OpenAccess_EPUB
train
py
b4656e89b7910c120ccd782399d8acdddd76012f
diff --git a/src/Layer.js b/src/Layer.js index <HASH>..<HASH> 100644 --- a/src/Layer.js +++ b/src/Layer.js @@ -82,7 +82,6 @@ Layer.prototype.destroy = function() { this._textureStoreChangeHandler); this._textureStore.removeEventListener('textureInvalid', this._textureStoreChangeHandler); - this._stage.removeEventListener('resize', this._handleStageResize); this._stage = null; this._source = null; this._geometry = null;
Remove teardown logic for event listener that was never added.
google_marzipano
train
js
dd64b01fdd044a354680eb56543b38bc9b86241e
diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/QueryCompiler.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/QueryCompiler.php index <HASH>..<HASH> 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/QueryCompiler.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/QueryCompiler.php @@ -38,6 +38,8 @@ class QueryCompiler private function injectThesaurusConcepts(Query $query) { + // TODO We must restrict thesaurus matching for IN queries, and only + // search in each field's root concepts. $nodes = $query->getTermNodes(); $concepts = $this->thesaurus->findConceptsBulk($nodes);
Warn about missing search-time filtering
alchemy-fr_Phraseanet
train
php
45c527c66521393fa8fafe2eb33e9761357119d4
diff --git a/core/eolearn/core/eodata_io.py b/core/eolearn/core/eodata_io.py index <HASH>..<HASH> 100644 --- a/core/eolearn/core/eodata_io.py +++ b/core/eolearn/core/eodata_io.py @@ -60,7 +60,8 @@ def save_eopatch(eopatch, filesystem, patch_location, features=..., overwrite_pe compress_level) for ftype, fname, path in eopatch_features) with concurrent.futures.ThreadPoolExecutor() as executor: - executor.map(lambda params: params[0].save(*params[1:]), features_to_save) + # Note: The following is intentionally wrapped in a list in order to get back potential exceptions + list(executor.map(lambda params: params[0].save(*params[1:]), features_to_save)) def load_eopatch(eopatch, filesystem, patch_location, features=..., lazy_loading=False):
added fix regarding exception raising when saving to a bucket
sentinel-hub_eo-learn
train
py
97c950a09539c4935615c34f0393059950b51381
diff --git a/molgenis-data-vcf/src/main/java/org/molgenis/data/vcf/utils/VcfUtils.java b/molgenis-data-vcf/src/main/java/org/molgenis/data/vcf/utils/VcfUtils.java index <HASH>..<HASH> 100644 --- a/molgenis-data-vcf/src/main/java/org/molgenis/data/vcf/utils/VcfUtils.java +++ b/molgenis-data-vcf/src/main/java/org/molgenis/data/vcf/utils/VcfUtils.java @@ -277,11 +277,13 @@ public class VcfUtils AttributeMetaData idAttribute = entity.getEntityMetaData().getIdAttribute(); for (AttributeMetaData refAttribute : refAttributes) { - if (!refAttribute.isSameAs(idAttribute)) + if (!refAttribute.isSameAs(idAttribute) && !refAttribute.getDataType().equals(MREF) + && !refAttribute.getDataType().equals(XREF)) { if (secondValuePresent) additionalInfoFields = additionalInfoFields + PIPE_SEPARATOR; additionalInfoFields = additionalInfoFields + entity.get(refAttribute.getName()); secondValuePresent = true; + } } return additionalInfoFields;
Prevent xref/mref fields to be inserted into the info field as object.toString()
molgenis_molgenis
train
java
48c628c9ea91ffe4b572d1a546198f80b9ca963a
diff --git a/webapps/Gruntfile.js b/webapps/Gruntfile.js index <HASH>..<HASH> 100644 --- a/webapps/Gruntfile.js +++ b/webapps/Gruntfile.js @@ -54,7 +54,10 @@ module.exports = function(grunt) { options: { liverreload: false, }, - files: ['node_modules/camunda-commons-ui/{lib,resources}/**/*.less'], + files: [ + 'ui/common/styles/**/*.less', + 'node_modules/camunda-commons-ui/{lib,resources}/**/*.less' + ], tasks: ['less'] } };
improve(build): watch less files in ui/common/styles
camunda_camunda-bpm-platform
train
js
0abf212d143c900ececb1495c0186df3c750d133
diff --git a/src/postmate.js b/src/postmate.js index <HASH>..<HASH> 100644 --- a/src/postmate.js +++ b/src/postmate.js @@ -186,7 +186,7 @@ class ChildAPI { class Postmate { static debug = false; - static Promise = window.Promise; + static Promise = Promise; /** * Sets options related to the Parent
Removing reference to window so class definition does not fail
dollarshaveclub_postmate
train
js
40fc073de0e617cb391eb7b97daa142f48dbf254
diff --git a/remix-lib/src/execution/execution-context.js b/remix-lib/src/execution/execution-context.js index <HASH>..<HASH> 100644 --- a/remix-lib/src/execution/execution-context.js +++ b/remix-lib/src/execution/execution-context.js @@ -221,6 +221,7 @@ function ExecutionContext () { } this.checkpointAndCommit = function (cb, checkpointCount) { + // due to issue https://github.com/ethereumjs/ethereumjs-vm/issues/567 if (this.vm().stateManager._checkpointCount > (checkpointCount || 0)) { return this.vm().stateManager.commit(() => { cb()
add comment explaining the the reason for checking the checkpointCount variable
ethereum_remix
train
js
83f75c292d12989b528c30eacd228e4962075ffa
diff --git a/lib/lita/handlers/karma/upgrade/decay.rb b/lib/lita/handlers/karma/upgrade/decay.rb index <HASH>..<HASH> 100644 --- a/lib/lita/handlers/karma/upgrade/decay.rb +++ b/lib/lita/handlers/karma/upgrade/decay.rb @@ -17,7 +17,8 @@ module Lita::Handlers::Karma::Upgrade backfill_term(term, score.to_i) end - redis.incr('support:decay') + redis.del('support:decay') + redis.incr('support:decay_with_negatives') end private @@ -75,7 +76,7 @@ module Lita::Handlers::Karma::Upgrade end def decay_already_processed? - redis.exists('support:decay') + redis.exists('support:decay_with_negatives') end def decay_enabled?
Update the key used to indicate decay is up-to-date This will cause anyone using decay in the broken version to acquire the missing actions
jimmycuadra_lita-karma
train
rb
bed6fce5c2713a3f6e3866a723d7c011540bc9bb
diff --git a/src/ansiblelint/utils.py b/src/ansiblelint/utils.py index <HASH>..<HASH> 100644 --- a/src/ansiblelint/utils.py +++ b/src/ansiblelint/utils.py @@ -131,50 +131,6 @@ def ansible_template( LINE_NUMBER_KEY = "__line__" FILENAME_KEY = "__file__" -VALID_KEYS = [ - "name", - "action", - "when", - "async", - "poll", - "notify", - "first_available_file", - "include", - "include_tasks", - "import_tasks", - "import_playbook", - "tags", - "register", - "ignore_errors", - "delegate_to", - "local_action", - "transport", - "remote_user", - "sudo", - "sudo_user", - "sudo_pass", - "when", - "connection", - "environment", - "args", - "any_errors_fatal", - "changed_when", - "failed_when", - "check_mode", - "delay", - "retries", - "until", - "su", - "su_user", - "su_pass", - "no_log", - "run_once", - "become", - "become_user", - "become_method", - FILENAME_KEY, -] - BLOCK_NAME_TO_ACTION_TYPE_MAP = { "tasks": "task", "handlers": "handler",
Removed unused VALID_KEYS (#<I>)
ansible_ansible-lint
train
py
7195bb8daf94a01c7214cbdad747a0d3ca599372
diff --git a/modules/query/StopTimesTable.js b/modules/query/StopTimesTable.js index <HASH>..<HASH> 100644 --- a/modules/query/StopTimesTable.js +++ b/modules/query/StopTimesTable.js @@ -29,7 +29,7 @@ const StopTime = require('../gtfs/StopTime.js'); function getStopTimesByTrip(db, tripId, date, callback) { // Check Cache for StopTimes - let cacheKey = db.id + "-" + tripId; + let cacheKey = db.id + "-" + tripId + "-" + date; let cache = cache_stoptimesByTrip.get(cacheKey); if ( cache !== null ) { return callback(null, cache); @@ -122,7 +122,7 @@ function getStopTimesByTrip(db, tripId, date, callback) { function getStopTimeByTripStop(db, tripId, stopId, date, callback) { // Cache Cache for StopTimes - let cacheKey = db.id + "-" + tripId + '-' + stopId; + let cacheKey = db.id + "-" + tripId + "-" + stopId + "-" + date; let cache = cache_stoptimesByTripStop.get(cacheKey); if ( cache !== null ) { return callback(null, cache);
StopTimes Query: update cache ids use the requested date in the cache ids
right-track_right-track-core
train
js