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
c342a0ab4f2b3c525b43b41b57a689cd92468809
diff --git a/rinoh/document.py b/rinoh/document.py index <HASH>..<HASH> 100644 --- a/rinoh/document.py +++ b/rinoh/document.py @@ -117,9 +117,8 @@ class DocumentPart(list): return len(self.pages) def prepare(self): - for flowable in (flowable for target in self.flowable_targets - for flowable in target.flowables): - flowable.prepare(self.document) + for flowable_target in self.flowable_targets: + flowable_target.prepare() def render(self): self.pages = [] diff --git a/rinoh/layout.py b/rinoh/layout.py index <HASH>..<HASH> 100644 --- a/rinoh/layout.py +++ b/rinoh/layout.py @@ -81,6 +81,10 @@ class FlowableTarget(object): self.append_flowable(flowable) return self + def prepare(self): + for flowable in self.flowables: + flowable.prepare(self.document) + def render(self): """Render the flowabless assigned to this flowable target, in the order that they have been added."""
Delegate prepare to FlowableTarget
brechtm_rinohtype
train
py,py
c8e5358cc33602f777037d64f94ec7081c98123c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -7,15 +7,15 @@ deps = { 'eth': [ "cached-property>=1.5.1,<2", "eth-bloom>=1.0.3,<2.0.0", - "eth-keys>=0.2.1,<0.4.0", - "eth-typing>=2.2.0,<3.0.0", - "eth-utils>=1.9.4,<2.0.0", + "eth-keys>=0.4.0,<0.5.0", + "eth-typing>=3.0.0,<4.0.0", + "eth-utils>=2.0.0,<3.0.0", "lru-dict>=1.1.6", "mypy_extensions>=0.4.1,<1.0.0", "py-ecc>=1.4.7,<5.0.0", "pyethash>=0.1.27,<1.0.0", - "rlp>=2,<3", - "trie==2.0.0-alpha.5", + "rlp>=3,<4", + "trie>=2.0.0,<3", ], # The eth-extra sections is for libraries that the evm does not # explicitly need to function and hence should not depend on.
Update rlp, eth-keys, eth-utils, eth-typing, trie dependencies
ethereum_py-evm
train
py
1da40b6d024a3c14ca98874cc7c01b60cf74fa60
diff --git a/resources/example-behaviour.js b/resources/example-behaviour.js index <HASH>..<HASH> 100644 --- a/resources/example-behaviour.js +++ b/resources/example-behaviour.js @@ -81,6 +81,6 @@ exampleNS.getRendererFromQueryString = function() { } else if ('renderer' in obj) { return [obj['renderer']]; } else { - return ['webgl', 'canvas', 'dom']; + return undefined; } };
Change renderer order in getRendererFromQueryString To order should be the same as ol.DEFAULT_RENDERER_HINTS. See #<I>
openlayers_openlayers
train
js
9ee405428125c602cfe93f9c76de00f581823eee
diff --git a/lib/venice/receipt.rb b/lib/venice/receipt.rb index <HASH>..<HASH> 100644 --- a/lib/venice/receipt.rb +++ b/lib/venice/receipt.rb @@ -130,7 +130,7 @@ module Venice return receipt else - raise RECEIPT_VERIFICATION_ERRORS_BY_STATUS_CODE[status] || ReceiptVerificationError + raise (RECEIPT_VERIFICATION_ERRORS_BY_STATUS_CODE[status] || ReceiptVerificationError), "#{status}" end rescue => error
Raising error with error code as message
nomad_venice
train
rb
25401c649c0aadc6ac3183ff41657f5e3c6a5724
diff --git a/peerset.go b/peerset.go index <HASH>..<HASH> 100644 --- a/peerset.go +++ b/peerset.go @@ -1,7 +1,7 @@ package peerset import ( - peer "gx/ipfs/QmNefBbWHR9JEiP3KDVqZsBLQVRmH3GBG2D2Ke24SsFqfW/go-libp2p/p2p/peer" + peer "gx/ipfs/QmSN2ELGRp4T9kjqiSsSNJRUeR9JKXzQEgwe1HH3tdSGbC/go-libp2p/p2p/peer" "sync" )
update utp and cleanup more godeps along the way License: MIT
libp2p_go-libp2p-peer
train
go
f8359d109270fa54aa19a4a946322f28fbb2f520
diff --git a/source/date picker.js b/source/date picker.js index <HASH>..<HASH> 100644 --- a/source/date picker.js +++ b/source/date picker.js @@ -265,6 +265,14 @@ export default class DatePicker extends PureComponent const { format, onChange } = this.props // https://github.com/gpbl/react-day-picker/issues/473 + // Remove any hours/minutes/seconds/milliseconds from the selected date. + // By default it's set to `12:00` for some strange reason. + // Perhaps because if such a selected date, when converted to a number + // and then back to a `Date` object, will still yield the same day + // in the calendar regardless of time zone differences + // between the place of serialization and the place of deserialization. + // I'm using PostgreSQL's `timezone with timestamp` instead + // so dates are always serialized and deserialized with the same time zone. selected_day = new Date(selected_day.getFullYear(), selected_day.getMonth(), selected_day.getDate()) // `onChange` fires but the `value`
Comments on resetting hours/minutes
catamphetamine_react-responsive-ui
train
js
50b48384fca2e626fedab49a1896b5ed3e8ecdbf
diff --git a/lib/hue/cli.rb b/lib/hue/cli.rb index <HASH>..<HASH> 100644 --- a/lib/hue/cli.rb +++ b/lib/hue/cli.rb @@ -25,17 +25,25 @@ module Hue end end - desc 'light ID STATE', 'Access a light' + desc 'light ID STATE [COLOR]', 'Access a light' + long_desc <<-LONGDESC + Examples: \n + hue light 1 on --hue 12345 \n + hue light 1 --bri 25 \n + hue light 1 --alert lselect \n + hue light 1 off + LONGDESC option :hue, :type => :numeric - option :saturation, :type => :numeric - option :brightness, :type => :numeric + option :sat, :type => :numeric + option :bri, :type => :numeric + option :alert, :type => :string def light(id, state = nil) light = client.light(id) puts light.name body = options.dup - body[:on] = state unless state.nil? - light.set_state(body) if body.length > 0 + body[:on] = (state == 'on' || !(state == 'off')) + puts light.set_state(body) if body.length > 0 end private
Update on/off state and update brightness, saturation, alert
soffes_hue
train
rb
3bb6a4ae43c9b3b7d6abc58bd5c415251f3caf5b
diff --git a/lib/sonos/device/speaker.rb b/lib/sonos/device/speaker.rb index <HASH>..<HASH> 100644 --- a/lib/sonos/device/speaker.rb +++ b/lib/sonos/device/speaker.rb @@ -10,7 +10,7 @@ module Sonos::Device include Sonos::Endpoint::Device include Sonos::Endpoint::ContentDirectory - MODEL_NUMBERS = ['S3', 'S5', 'S9', 'ZP90', 'Sub'] + MODEL_NUMBERS = ['S3', 'S5', 'S9', 'ZP90', 'Sub', 'ZP120'] attr_reader :icon
Adding Connect:AMP (ZP<I>)
gotwalt_sonos
train
rb
872af6418f25e8321dedaae23ea92d0ab72eb553
diff --git a/hearthstone/cardxml.py b/hearthstone/cardxml.py index <HASH>..<HASH> 100644 --- a/hearthstone/cardxml.py +++ b/hearthstone/cardxml.py @@ -14,7 +14,8 @@ class CardXML(object): for e in self.xml.findall("./Tag"): tag = int(e.attrib["enumID"]) if tag in gametags: - self.tags[tag] = self._get_tag(e) + tag = GameTag(tag) + self.tags[tag] = self._get_tag(e) e = self.xml.findall("HeroPower") self.hero_power = e and e[0].attrib["cardID"] or None
Allow invalid GameTags without dying on them Followup on <I>c<I>bba0e<I>d<I>c<I>f6d3fc<I>a
HearthSim_python-hearthstone
train
py
350028ca6b1214bc12c20ff3b466733e1d0af3ac
diff --git a/word2vec.go b/word2vec.go index <HASH>..<HASH> 100644 --- a/word2vec.go +++ b/word2vec.go @@ -239,6 +239,10 @@ type Match struct { // CosN computes the n most similar words to the expression. Returns an error if the // expression could not be evaluated. func (m *Model) CosN(e Expr, n int) ([]Match, error) { + if n == 0 { + return nil, nil + } + v, err := e.Eval(m) if err != nil { return nil, err @@ -297,6 +301,10 @@ type multiMatches struct { // MultiCosN takes a list of expressions and computes the // n most similar words for each. func MultiCosN(m *Model, exprs []Expr, n int) ([][]Match, error) { + if n == 0 { + return make([][]Match, len(exprs)), nil + } + vecs := make([]Vector, len(exprs)) for i, e := range exprs { v, err := e.Eval(m)
fix panics for n = 0 in CosN and derivatives
sajari_word2vec
train
go
1889a0071c945faadc2bd494ce6b2d358baa7b44
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ test_requirements = [ ] setup( - name='pyup', + name='pyupio', version='0.1.0', description="A tool to update all your projects requirements", long_description=readme + '\n\n' + history,
pyup is taken on pypi :(
pyupio_pyup
train
py
d5bb0e317988965306b1ccb395fafc4554aba49c
diff --git a/src/ajax/ajaxTest.js b/src/ajax/ajaxTest.js index <HASH>..<HASH> 100644 --- a/src/ajax/ajaxTest.js +++ b/src/ajax/ajaxTest.js @@ -3,7 +3,7 @@ module("ajax"); // Safari 3 randomly crashes when running these tests, // but only in the full suite - you can run just the Ajax // tests and they'll pass -//if ( !jQuery.browser.safari ) { +if ( !jQuery.browser.safari ) { test("$.ajax() - success callbacks", function() { expect( 8 ); @@ -625,4 +625,4 @@ test("custom timeout does not set error message when timeout occurs, see #970", } -//} +}
Re-disabled the ajax tests in Safari 3.
jquery_jquery
train
js
6dd04da585011a2731182dae6823e96826579f7d
diff --git a/lib/export.js b/lib/export.js index <HASH>..<HASH> 100644 --- a/lib/export.js +++ b/lib/export.js @@ -529,10 +529,16 @@ function convertDefinition(valueDef, dataElementsSpecs, enclosingNamespace, base currentAllOf.push({ refType: [`${STANDARD_TYPE_URI}${namespaceToURLPathSegment(refid.namespace)}/${refid.name}`]}); } } else { + let schemaConstraint = null; if (constraintInfo.constraint.isA.isPrimitive) { - currentAllOf.push(makePrimitiveObject(constraintInfo.constraint.isA)); + schemaConstraint = makePrimitiveObject(constraintInfo.constraint.isA); } else { - currentAllOf.push({$ref: makeRef(constraintInfo.constraint.isA, enclosingNamespace, baseSchemaURL)}); + schemaConstraint = {$ref: makeRef(constraintInfo.constraint.isA, enclosingNamespace, baseSchemaURL)}; + } + if (isOrWasAList(constraintInfo.constraintTarget)) { + currentAllOf.push({ items: schemaConstraint }); + } else { + currentAllOf.push(schemaConstraint); } } } else if (constraintInfo.constraint instanceof IncludesTypeConstraint) {
Non-ref type constraints are now properly referenced on a list.
standardhealth_shr-json-schema-export
train
js
ade8418b1243e38bfcc187ceb77410f555eb2a8a
diff --git a/exchanges/btce.js b/exchanges/btce.js index <HASH>..<HASH> 100644 --- a/exchanges/btce.js +++ b/exchanges/btce.js @@ -9,6 +9,8 @@ var trader = function(key, secret) { this.secret = secret; this.name = 'BTC-E'; + _.bindAll(this); + this.btce = new BTCE(this.key, this.secret); console.log(util.now(), 'initialized ' + this.name + ' trader'); } diff --git a/gekko.js b/gekko.js index <HASH>..<HASH> 100644 --- a/gekko.js +++ b/gekko.js @@ -24,7 +24,7 @@ var tradeConfig = { shortEMA: 10, longEMA: 21, // amount of samples to remember and base initial EMAs on - candles: 20, + candles: 100, // max difference between first and last trade to base price calculation on sampleSize: 10, // in seconds // the difference between the EMAs (to act as triggers) @@ -53,7 +53,7 @@ var consultant = require('./methods/' + tradingMethod.toLowerCase().split(' ').j consultant.emit('init', tradeConfig, publicMtgox); // whenever the consultant advices to sell or buy we can act on the information -var inform = function(what, meta) { +var inform = function(what, price, meta) { console.log('(ADVICE)', util.now(), what, meta); } consultant.on('advice', inform);
fixed context bug in the BTCe trade method
askmike_gekko
train
js,js
27d3d88188914d83d1e55121dc738674a321b477
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -27,7 +27,7 @@ function gulpReplaceRef(opts) { var strToReplace = srcFile.path.match( opts.srcMatch )[0], stream, targetMatch = opts.targetMatch; - vfs.src(opts.src).pipe(stream = es.map(function(phpFile, cb){ + vfs.src(opts.target).pipe(stream = es.map(function(phpFile, cb){ //console.log(phpFile.path); var content = phpFile.contents.toString(); if(targetMatch(srcFile.path).test(content)){
renamed option.src to option.target
weisuke_gulp-replace-ref
train
js
7c6ac5480f641a7e1aa094d7c1a7571ef61c7b12
diff --git a/go/client/cmd_wallet.go b/go/client/cmd_wallet.go index <HASH>..<HASH> 100644 --- a/go/client/cmd_wallet.go +++ b/go/client/cmd_wallet.go @@ -30,7 +30,9 @@ func newCmdWallet(cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Comman } subcommands = append(subcommands, getBuildSpecificWalletCommands(cl, g)...) return cli.Command{ - Name: "wallet", - Subcommands: subcommands, + Name: "wallet", + Usage: "Send and receive Stellar XLM", + ArgumentHelp: "[arguments...]", + Subcommands: subcommands, } }
Make wallet show up in keybase -h (#<I>) * Make wallet show up in keybase -h * Fix typo
keybase_client
train
go
af3197b3bd9b9328d0405486b297bf350992c997
diff --git a/builder.go b/builder.go index <HASH>..<HASH> 100644 --- a/builder.go +++ b/builder.go @@ -392,7 +392,7 @@ func (b *Builder) Run(step *Step, exec Executor, noRunsRemaining bool) error { } if len(b.RunConfig.WorkingDir) > 0 { - if err := exec.EnsureContainerPath(b.RunConfig.WorkingDir); err != nil { + if err := exec.EnsureContainerPathAs(b.RunConfig.WorkingDir, b.RunConfig.User, nil); err != nil { return err } }
builder: create WORKDIR with USER ownership
openshift_imagebuilder
train
go
7cb2250d12da1cf59d72942a95e162fa5c2a6fc7
diff --git a/zake/tests/test_client.py b/zake/tests/test_client.py index <HASH>..<HASH> 100644 --- a/zake/tests/test_client.py +++ b/zake/tests/test_client.py @@ -218,8 +218,8 @@ class TestClient(test.Test): updates.append((data, stat)) ev.set() + k_watchers.DataWatch(self.client, "/b", func=notify_me) with start_close(self.client) as c: - k_watchers.DataWatch(c, "/b", func=notify_me) with c.transaction() as txn: txn.create("/b") txn.check("/c", version=0) @@ -297,8 +297,8 @@ class TestClient(test.Test): updates.append((data, stat)) ev.set() + k_watchers.DataWatch(self.client, "/b", func=notify_me) with start_close(self.client) as c: - k_watchers.DataWatch(self.client, "/b", func=notify_me) ev.wait() ev.clear() c.ensure_path("/b")
Watches can be set before client is started now
yahoo_Zake
train
py
9e5909e213427b3c83fd638bca62c41c76ece77d
diff --git a/src/app/auth/migrations/20140823144643_user_login_history.php b/src/app/auth/migrations/20140823144643_user_login_history.php index <HASH>..<HASH> 100644 --- a/src/app/auth/migrations/20140823144643_user_login_history.php +++ b/src/app/auth/migrations/20140823144643_user_login_history.php @@ -14,7 +14,7 @@ class UserLoginHistory extends AbstractMigration $table = $this->table( 'UserLoginHistories' ); $table->addColumn( 'uid', 'integer' ) ->addColumn( 'type', 'integer', [ 'length' => 1 ] ) - ->addColumn( 'ip', 'string', [ 'length' => 16 ] ) + ->addColumn( 'ip', 'string', [ 'length' => 45 ] ) ->addColumn( 'user_agent', 'string' ) ->addColumn( 'created_at', 'integer' ) ->addColumn( 'updated_at', 'integer', [ 'null' => true, 'default' => null ] )
bump up user login history ip character length for ipv6
infusephp_auth
train
php
d4bfb3fe85d797091315e886f6a23ce5e0c92d63
diff --git a/integration_tests/blockstack_integration_tests/scenarios/testlib.py b/integration_tests/blockstack_integration_tests/scenarios/testlib.py index <HASH>..<HASH> 100644 --- a/integration_tests/blockstack_integration_tests/scenarios/testlib.py +++ b/integration_tests/blockstack_integration_tests/scenarios/testlib.py @@ -1057,21 +1057,14 @@ def get_name_blockchain_record(name): return blockstack_cli_get_name_blockchain_record(name) -def blockstack_cli_get_name_blockchain_history( name, start_block=None, end_block=None, config_path=None): +def blockstack_cli_get_name_blockchain_history( name, page, config_path=None): """ get name blockchain history """ if not has_nodejs_cli(): raise Exception("Missing blockstack-cli") - resp = None - if start_block is not None and end_block is not None: - resp = nodejs_cli('get_blockchain_history', name, start_block, end_block) - elif start_block is not None: - resp = nodejs_cli('get_blockchain_history', name, start_block) - else: - resp = nodejs_cli('get_blockchain_history', name) - + resp = nodejs_cli('get_blockchain_history', name, page) return json.loads(resp)
sync CLI out-call for getting a name's history with the new API
blockstack_blockstack-core
train
py
6da0184318321b72823cb9fe0be1118a86da2f6a
diff --git a/gmn/src/d1_gmn/settings_test.py b/gmn/src/d1_gmn/settings_test.py index <HASH>..<HASH> 100644 --- a/gmn/src/d1_gmn/settings_test.py +++ b/gmn/src/d1_gmn/settings_test.py @@ -214,8 +214,8 @@ ROOT_URLCONF = 'd1_gmn.app.urls' INSTALLED_APPS = [ 'django.contrib.staticfiles', - 'd1_gmn.app.startup.GMNStartupChecks', 'd1_gmn.app', + 'd1_gmn.app.startup.GMNStartupChecks', ] SECRET_KEY = '<Do not modify this placeholder value>'
Fix bug in GMN that caused mgmt commands to be ignored
DataONEorg_d1_python
train
py
00f758a73cec1c7b20efec20130f852450ba270f
diff --git a/lib/tocer/parsers/header.rb b/lib/tocer/parsers/header.rb index <HASH>..<HASH> 100644 --- a/lib/tocer/parsers/header.rb +++ b/lib/tocer/parsers/header.rb @@ -11,7 +11,7 @@ module Tocer end def prefix - String markdown[/#{PUNCTUATION}{1,}/] + String markdown[/#{PUNCTUATION}{1,}/o] end def content diff --git a/spec/lib/tocer/cli_spec.rb b/spec/lib/tocer/cli_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/tocer/cli_spec.rb +++ b/spec/lib/tocer/cli_spec.rb @@ -128,13 +128,13 @@ RSpec.describe Tocer::CLI do shared_examples_for "a version command" do it "prints version" do result = -> { cli } - expect(&result).to output(/#{Tocer::Identity::VERSION_LABEL}\n/).to_stdout + expect(&result).to output(/#{Tocer::Identity::VERSION_LABEL}\n/o).to_stdout end end shared_examples_for "a help command" do it "prints usage" do - pattern = /#{Tocer::Identity::VERSION_LABEL}\scommands:\n/ + pattern = /#{Tocer::Identity::VERSION_LABEL}\scommands:\n/o result = -> { cli } expect(&result).to output(pattern).to_stdout
Fixed Rubocop Performance/ConstantRegexp issues Ensures regular expression isn't constructed more than once.
bkuhlmann_tocer
train
rb,rb
32ce3940a66199ee815b196faad6a7a135561aa0
diff --git a/source/rafcon/gui/mygaphas/utils/cache/image_cache.py b/source/rafcon/gui/mygaphas/utils/cache/image_cache.py index <HASH>..<HASH> 100644 --- a/source/rafcon/gui/mygaphas/utils/cache/image_cache.py +++ b/source/rafcon/gui/mygaphas/utils/cache/image_cache.py @@ -155,7 +155,19 @@ class ImageCache(object): # Changed drawing parameter for key in parameters: - if key not in self.__last_parameters or self.__last_parameters[key] != parameters[key]: + try: + if key not in self.__last_parameters or self.__last_parameters[key] != parameters[key]: + return False + except (AttributeError, ValueError): + # Some values cannot be compared and raise an exception on comparison (e.g. numpy.ndarray). In this + # case, just return False and do not cache. + try: + # Catch at least the ndarray-case, as this could occure relatively often + import numpy + if isinstance(self.__last_parameters[key], numpy.ndarray): + return numpy.array_equal(self.__last_parameters[key], parameters[key]) + except ImportError: + return False return False return True
fix(image_cache): Support ndarray and handle other types gracefully
DLR-RM_RAFCON
train
py
e7e6bd2b26a118f6fd3c11ebd8b59ea3cc99c493
diff --git a/src/Components/SchemaToOpenApiDefinition.php b/src/Components/SchemaToOpenApiDefinition.php index <HASH>..<HASH> 100644 --- a/src/Components/SchemaToOpenApiDefinition.php +++ b/src/Components/SchemaToOpenApiDefinition.php @@ -63,7 +63,7 @@ trait SchemaToOpenApiDefinition return [ 'type' => $type, 'format' => $format, - 'description' => $column->comment, + 'description' => strval($column->comment), ]; }
OpenApiDefinition requires description to be string, not null
dreamfactorysoftware_df-core
train
php
b49231ca91a85b567291535a2f81a1e1bd9df50f
diff --git a/spec/tophat_spec.rb b/spec/tophat_spec.rb index <HASH>..<HASH> 100644 --- a/spec/tophat_spec.rb +++ b/spec/tophat_spec.rb @@ -68,6 +68,14 @@ describe TopHat do it "should respond to the 'canonical' helper" do @template.respond_to?(:canonical).should be_true end + + it "should respond to the 'twitter_card' helper" do + @template.respond_to?(:twitter_card).should be_true + end + + it "should respond to the 'html_tag' helper" do + @template.respond_to?(:html_tag).should be_true + end end describe '.current' do
test for existence of twitter_card helper
stve_tophat
train
rb
7f44fd6454fee0e2ee33e39130b2966e6c826c6f
diff --git a/ropetest/projecttest.py b/ropetest/projecttest.py index <HASH>..<HASH> 100644 --- a/ropetest/projecttest.py +++ b/ropetest/projecttest.py @@ -450,7 +450,8 @@ class ProjectTest(unittest.TestCase): self.assertEquals(myfolder, path_to_resource( self.project, myfolder.real_path, type='folder')) - def test_getting_files(self): + @testutils.run_only_for_unix + def test_ignoring_symlinks_inside_project(self): project2 = testutils.sample_project(folder_name='sampleproject2') mod = project2.root.create_file('mod.py') try: diff --git a/ropetest/testutils.py b/ropetest/testutils.py index <HASH>..<HASH> 100644 --- a/ropetest/testutils.py +++ b/ropetest/testutils.py @@ -62,6 +62,16 @@ def run_only_for_25(func): return do_nothing +def run_only_for_unix(func): + """Should be used as a decorator for a unittest.TestCase test method""" + if os.name == 'posix': + return func + else: + def do_nothing(self): + pass + return do_nothing + + def assert_raises(exception_class): """Should be used as a decorator for a unittest.TestCase test method""" def _assert_raises(func):
not running symlink test on windows
python-rope_rope
train
py,py
8a952d3a5f41939b249bc85e7cb3b81ee41ff873
diff --git a/kafka/src/main/java/com/alibaba/otter/canal/kafka/producer/CanalKafkaStarter.java b/kafka/src/main/java/com/alibaba/otter/canal/kafka/producer/CanalKafkaStarter.java index <HASH>..<HASH> 100644 --- a/kafka/src/main/java/com/alibaba/otter/canal/kafka/producer/CanalKafkaStarter.java +++ b/kafka/src/main/java/com/alibaba/otter/canal/kafka/producer/CanalKafkaStarter.java @@ -121,7 +121,7 @@ public class CanalKafkaStarter { Message message = server.getWithoutAck(clientIdentity, kafkaProperties.getCanalBatchSize()); // 获取指定数量的数据 long batchId = message.getId(); try { - int size = message.getEntries().size(); + int size = message.isRaw() ? message.getRawEntries().size() : message.getEntries().size(); if (batchId != -1 && size != 0) { if (!StringUtils.isEmpty(destination.getTopic())) { Topic topic = new Topic();
fix bug: kafka get row data for performance
alibaba_canal
train
java
3e425b93576699acd52dad656931fcac9a2299b6
diff --git a/Factory/CurrencyFactory.php b/Factory/CurrencyFactory.php index <HASH>..<HASH> 100755 --- a/Factory/CurrencyFactory.php +++ b/Factory/CurrencyFactory.php @@ -22,14 +22,6 @@ use WellCommerce\Bundle\DoctrineBundle\Factory\AbstractEntityFactory; */ class CurrencyFactory extends AbstractEntityFactory { - /** - * @var string - */ - protected $supportsInterface = CurrencyInterface::class; - - /** - * @return CurrencyInterface - */ public function create() : CurrencyInterface { /** @var $currency CurrencyInterface */ diff --git a/Factory/CurrencyRateFactory.php b/Factory/CurrencyRateFactory.php index <HASH>..<HASH> 100755 --- a/Factory/CurrencyRateFactory.php +++ b/Factory/CurrencyRateFactory.php @@ -22,14 +22,6 @@ use WellCommerce\Bundle\DoctrineBundle\Factory\AbstractEntityFactory; */ class CurrencyRateFactory extends AbstractEntityFactory { - /** - * @var string - */ - protected $supportsInterface = CurrencyRateInterface::class; - - /** - * @return CurrencyRateInterface - */ public function create() : CurrencyRateInterface { /** @var $currencyRate CurrencyRateInterface */
Removed deprecations in factories
WellCommerce_CurrencyBundle
train
php,php
af657f438e365950b7760eb24cedb0208bc4cd8e
diff --git a/src/Authentication/OAuth20Login.php b/src/Authentication/OAuth20Login.php index <HASH>..<HASH> 100644 --- a/src/Authentication/OAuth20Login.php +++ b/src/Authentication/OAuth20Login.php @@ -44,6 +44,7 @@ class OAuth20Login extends Login */ public function __construct(array $configAttributes, array $authorization, array $authentication) { + parent::__construct($configAttributes, $authentication); if (empty($authorization['oauth_api']['credentials'])) { throw new UserException("OAuth API credentials not supplied in config"); } @@ -71,8 +72,6 @@ class OAuth20Login extends Login 'user' => $oAuthData, 'attr' => $this->configAttributes ]; - - parent::__construct($configAttributes, $authentication); } /** @@ -80,7 +79,6 @@ class OAuth20Login extends Login */ protected function getAuthRequest(array $config) : RestRequest { - parent::getAuthRequest($config); if (!empty($config['params'])) { $config['params'] = UserFunction::build($config['params'], $this->params); }
fix: parent ctor call, parent ctor must not be called in getAuthRequest (produces invalid request)
keboola_generic-extractor
train
php
cb96dc99e67c6ccbd077df7e1e6068d91e1507ec
diff --git a/src/main/java/org/paylogic/fogbugz/FogbugzCase.java b/src/main/java/org/paylogic/fogbugz/FogbugzCase.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/paylogic/fogbugz/FogbugzCase.java +++ b/src/main/java/org/paylogic/fogbugz/FogbugzCase.java @@ -28,7 +28,7 @@ public class FogbugzCase { public FogbugzCase(int id, String title, int openedBy, int assignedTo, List<String> tags, boolean isOpen, String featureBranch, - String originalBranch, String targetBranch, String milestone, String approvedRevision) { + String originalBranch, String targetBranch, String approvedRevision, String milestone) { this.id = id; this.title = title; this.openedBy = openedBy; @@ -44,7 +44,7 @@ public class FogbugzCase { public FogbugzCase(int id, String title, int openedBy, int assignedTo, String tags, boolean isOpen, String featureBranch, - String originalBranch, String targetBranch, String milestone, String approvedRevision) { + String originalBranch, String targetBranch, String approvedRevision, String milestone) { this.id = id; this.title = title; this.openedBy = openedBy;
Constructor params wrong way around
paylogic_java-fogbugz
train
java
4c33d517d9f4e6312ab23398cfaa6ca5a6177315
diff --git a/activerecord/lib/active_record/attribute_methods/primary_key.rb b/activerecord/lib/active_record/attribute_methods/primary_key.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/attribute_methods/primary_key.rb +++ b/activerecord/lib/active_record/attribute_methods/primary_key.rb @@ -5,7 +5,7 @@ module ActiveRecord # Returns this record's primary key value wrapped in an Array if one is available def to_key - key = send(self.class.primary_key) + key = self.id [key] if key end
#id is an alias for whatever the primary key is
rails_rails
train
rb
0c7e95e05f40fb2f552a7af8f1b1bab3879a20ba
diff --git a/glim/command.py b/glim/command.py index <HASH>..<HASH> 100644 --- a/glim/command.py +++ b/glim/command.py @@ -11,8 +11,9 @@ class CommandAdapter: for name, obj in inspect.getmembers(module): if name != 'Command' and 'Command' in name: - cobject = getattr(module, name) - commands.append(cobject) + if name != 'GlimCommand': + cobject = getattr(module, name) + commands.append(cobject) return commands
fix base command is being registered into glim cli
aacanakin_glim
train
py
fb25160fec8d50a5b243cb3523551495816a6817
diff --git a/generator/index.js b/generator/index.js index <HASH>..<HASH> 100644 --- a/generator/index.js +++ b/generator/index.js @@ -52,7 +52,7 @@ module.exports = (api, options = {}) => { if (api.hasPlugin('router')) { console.log('\n') require('@vue/cli-shared-utils/lib/logger').warn( - 'It is detected that you are using Vue Router. If you are using history mode, you must push the default route when the root component is loaded. Learn more at https://goo.gl/GM1xZG.' + 'It is detected that you are using Vue Router. If you are using history mode, you must push the default route when the root component is loaded. Learn more at https://goo.gl/GM1xZG .' ) } }
fix(generator): router warning url not clickable
nklayman_vue-cli-plugin-electron-builder
train
js
4ee2e7a067a98b160854d6bb743d9e8359f9b90a
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -29,7 +29,7 @@ module.exports = function(options, cb) { options.db = options.db || {} var watcher_options = { - ignored: /[\/\\]\.|node_modules/, + ignored: /[\/\\]\.|node_modules|incomplete/, persistent: false, ignoreInitial: true, usePolling: false, @@ -75,7 +75,7 @@ module.exports = function(options, cb) { setTimeout(function() { process.exit(0) - , 1000}) + }, 1000) }) process.on('uncaughtException', function(e) { @@ -88,6 +88,6 @@ module.exports = function(options, cb) { setTimeout(function() { process.exit(1) - , 1000}) + }, 1000) }) }
fix(watcher): Ignore incomplete directory, typo
ezseed_watcher
train
js
672d456e3f31efe805182827bf41a85b28c2b892
diff --git a/fut/core.py b/fut/core.py index <HASH>..<HASH> 100644 --- a/fut/core.py +++ b/fut/core.py @@ -78,6 +78,7 @@ def itemParse(item_data): 'playStyle': item_data['itemData'].get('playStyle'), # used only for players 'discardValue': item_data['itemData']['discardValue'], 'itemType': item_data['itemData']['itemType'], + 'cardType': item_data['itemData'].get("cardsubtypeid"), # used only for cards 'owners': item_data['itemData']['owners'], 'offers': item_data.get('offers'), 'currentBid': item_data.get('currentBid'),
added 'cardType' key for item dict
futapi_fut
train
py
8ad5ca4664667baf78d249ccb98f83490a6e2abc
diff --git a/graylog2-server/src/main/java/org/graylog2/security/encryption/EncryptedValueService.java b/graylog2-server/src/main/java/org/graylog2/security/encryption/EncryptedValueService.java index <HASH>..<HASH> 100644 --- a/graylog2-server/src/main/java/org/graylog2/security/encryption/EncryptedValueService.java +++ b/graylog2-server/src/main/java/org/graylog2/security/encryption/EncryptedValueService.java @@ -18,6 +18,7 @@ package org.graylog2.security.encryption; import org.graylog2.security.AESTools; +import javax.annotation.Nullable; import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; @@ -48,7 +49,11 @@ public class EncryptedValueService { .build(); } + @Nullable public String decrypt(EncryptedValue encryptedValue) { + if (!encryptedValue.isSet()) { + return null; + } return AESTools.decrypt(encryptedValue.value(), encryptionKey, encryptedValue.salt()); } }
Return null when no encryptedValue is set (#<I>)
Graylog2_graylog2-server
train
java
69aa2a8731729f8bd4c173d98eaadfa2afb4a2d0
diff --git a/pandas/tests/tools/test_to_datetime.py b/pandas/tests/tools/test_to_datetime.py index <HASH>..<HASH> 100644 --- a/pandas/tests/tools/test_to_datetime.py +++ b/pandas/tests/tools/test_to_datetime.py @@ -832,7 +832,7 @@ class TestToDatetime: msg = ( "is a bad directive in format|" - "second must be in 0..59: 00:01:99|" + "second must be in 0..59|" "Given date string not likely a datetime" ) with pytest.raises(ValueError, match=msg): @@ -886,7 +886,7 @@ class TestToDatetime: msg = ( "is a bad directive in format|" "Given date string not likely a datetime|" - "second must be in 0..59: 00:01:99" + "second must be in 0..59" ) with pytest.raises(ValueError, match=msg): pd.to_datetime( @@ -1660,7 +1660,11 @@ class TestToDatetimeMisc: # gh-17637 # we are overflowing Timedelta range here - msg = "Python int too large to convert to C long" + msg = ( + "(Python int too large to convert to C long)|" + "(long too big to convert)|" + "(int too big to convert)" + ) with pytest.raises(OverflowError, match=msg): date_range(start="1/1/1700", freq="B", periods=100000)
TST: Fix failing test from #<I> (#<I>)
pandas-dev_pandas
train
py
da79dbc5db80f7bbc8f9011d187b5d839acd3dcb
diff --git a/.eslintrc.js b/.eslintrc.js index <HASH>..<HASH> 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -170,6 +170,13 @@ module.exports = { 'no-whitespace-before-property': 'error', 'nonblock-statement-body-position': ['error', 'below'], 'operator-assignment': 'error', + 'spaced-comment': ['error', 'always', { + // Characters which may be glued to the start of a comment block, but + // which do not violate the rule. The "*" is for jsdoc's "/**" syntax, + // and the "!" is for the "/*!" of license headers which are passed + // verbatim through the compiler. + 'markers': ['*', '!'], + }], // }}} // "ECMAScript 6" rules: {{{
build: allow forced license header syntax in eslint The block comment syntax "/*!" is used to force a license header to appear in the output of the Closure Compiler and other tools, but we need eslint to allow it. Issue #<I> Change-Id: I7a<I>ba0ffcdbdd<I>dbe<I>ca<I>b5ccbdf2fed
google_shaka-player
train
js
1a49676da072e9a8d6ef0603c98dc74eb00f28b4
diff --git a/ReText/window.py b/ReText/window.py index <HASH>..<HASH> 100644 --- a/ReText/window.py +++ b/ReText/window.py @@ -843,9 +843,9 @@ class ReTextWindow(QMainWindow): if mimetype is None: enabled = True elif markupClass == markups.MarkdownMarkup: - enabled = (mimetype in ("text/x-retext-markdown", "text/x-markdown", "text/markdown")) + enabled = (mimetype == "text/markdown") elif markupClass == markups.ReStructuredTextMarkup: - enabled = (mimetype in ("text/x-retext-rst", "text/x-rst")) + enabled = (mimetype == "text/x-rst") else: enabled = False action[0].setEnabled(enabled)
Remove support for old MIME types in export extensions The MIME type for Markdown is documented in RFC <I>. For reStructuredText, see: <URL>
retext-project_retext
train
py
1e5146be5430b3a44f4fed4248f72c39236facd3
diff --git a/framework/pluginapi/pflags.go b/framework/pluginapi/pflags.go index <HASH>..<HASH> 100644 --- a/framework/pluginapi/pflags.go +++ b/framework/pluginapi/pflags.go @@ -86,5 +86,5 @@ func AddConfigPFlagPtr(fset *pflag.FlagSet, config *string) { if config == nil { return } - fset.String(ConfigFlagName, "", "path to the plugin configuration file") + fset.StringVar(config, ConfigFlagName, "", "path to the plugin configuration file") }
Fix AddConfigPFlag functions (#<I>) Fixes bug that caused ConfigFlagName flags to not be added properly.
palantir_godel
train
go
df14615e11846bcf01ad0dbfd2e13c20527c6a69
diff --git a/src/java/com/threerings/media/sprite/Sprite.java b/src/java/com/threerings/media/sprite/Sprite.java index <HASH>..<HASH> 100644 --- a/src/java/com/threerings/media/sprite/Sprite.java +++ b/src/java/com/threerings/media/sprite/Sprite.java @@ -1,5 +1,5 @@ // -// $Id: Sprite.java,v 1.33 2001/12/19 07:43:09 mdb Exp $ +// $Id: Sprite.java,v 1.34 2002/01/07 23:51:52 shaper Exp $ package com.threerings.media.sprite; @@ -319,11 +319,11 @@ public class Sprite implements DirectionCodes */ public void move (Path path) { - // save our path - _path = path; + // initialize the path + path.init(this, System.currentTimeMillis()); - // and initialize it - _path.init(this, System.currentTimeMillis()); + // and save it off + _path = path; } /**
Initialize the path before saving it off so that the animation manager can't attempt to move a sprite along a path that isn't fully prepared. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1
threerings_narya
train
java
6b310bdc19215c83a6adfefc3000515c29f2b478
diff --git a/fireplace/cards.py b/fireplace/cards.py index <HASH>..<HASH> 100644 --- a/fireplace/cards.py +++ b/fireplace/cards.py @@ -176,6 +176,9 @@ class Card(Entity): def onOwnTurnBegin(self): self.exhausted = False + if hasattr(self.data.__class__, "onOwnTurnBegin"): + return self.data.__class__.onOwnTurnBegin(self) + def discard(self): logging.info("Discarding %r" % (self)) self.zone = Zone.GRAVEYARD
Process onOwnTurnBegin() event for all cards
jleclanche_fireplace
train
py
ded808e017f0d3ab3ceb2b8178a09a26bbba6b87
diff --git a/geomdl/CPGen.py b/geomdl/CPGen.py index <HASH>..<HASH> 100644 --- a/geomdl/CPGen.py +++ b/geomdl/CPGen.py @@ -304,10 +304,10 @@ class Grid(object): This method accepts the following keyword arguments: - * num_bumps (int): Number of bumps (i.e. hills) to be generated on the 2D grid. Default: 0 - * all_positive (bool): Generate all bumps on the positive z direction. Default: False - * bump_height (float): z-value of the generated bumps on the grid. Default: 5.0 - * smoothness (int): defines the boundaries of the hill base in terms of grid points. Default: 3 + * ``num_bumps``: number of bumps (i.e. hills) to be generated on the 2D grid. *Default: 0* + * ``all_positive``: generate all bumps on the positive z direction. *Default: False* + * ``bump_height``: z-value of the generated bumps on the grid. *Default: 5.0* + * ``smoothness``: defines the boundaries of the hill base in terms of grid points. *Default: 3* """ num_bumps = kwargs.get("num_bumps", 0)
Updated hill generator method docstrings
orbingol_NURBS-Python
train
py
4bb6be4154f0e4d164bce65b81b285a7cb000077
diff --git a/lib/shikashi/privileges.rb b/lib/shikashi/privileges.rb index <HASH>..<HASH> 100644 --- a/lib/shikashi/privileges.rb +++ b/lib/shikashi/privileges.rb @@ -85,26 +85,6 @@ public @all = true end - def redirect(method_name, method_wrapper_class) - allow method_name - @redirect_hash[method_name] = method_wrapper_class - end - - def handle_redirection(klass, recv, method_name, sandbox) - rclass = @redirect_hash[method_name.to_sym] - - if rclass - if block_given? - rclass.redirect_handler(klass, recv, method_name, 0, sandbox) do |mh| - yield(mh) - end - else - rclass.redirect_handler(klass, recv, method_name, 0, sandbox) - end - else - nil - end - end end def initialize @@ -191,21 +171,6 @@ public @allowed_methods << method_name end - def handle_redirection(klass, recv, method_name, sandbox) - if @last_allowed - if block_given? - @last_allowed.handle_redirection(klass, recv, method_name, sandbox) do |mh| - yield(mh) - end - else - @last_allowed.handle_redirection(klass, recv, method_name, sandbox) - end - else - nil - end - - end - def allow?(klass, recv, method_name, method_id) m = nil
removed redirection stuff ffrom privileges.rb
tario_shikashi
train
rb
bd63e1ac146320bfbe11592dc510db29d5d329b6
diff --git a/handlers/dictionary/scripts.py b/handlers/dictionary/scripts.py index <HASH>..<HASH> 100644 --- a/handlers/dictionary/scripts.py +++ b/handlers/dictionary/scripts.py @@ -79,7 +79,7 @@ def _drupal_process(dico): } for d in dico] -@cached("dictionary_dump", 1000) +# @cached("dictionary_dump", 1000) @exception_handler def drupal_dictionary_dump(): dico = [ieml_term_model(t['_id']) for t in terms_db().get_all_terms()][:10]
Remove caching for drupal dump exemple
IEMLdev_ieml
train
py
d96178346c8a35f595b044139bb171d4b47b65e2
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -69,12 +69,11 @@ class Venv(Command): setup( name='asciietch', - version='1.0.4', + version='1.0.5', description=description, long_description=long_description, url='https://github.com/linkedin/asciietch', author='Steven R. Callister', - author_email='scallist@linkedin.com', cmdclass={'venv': Venv, 'test': PyTest, 'pytest': PyTest,
Bumping version to <I> properly
linkedin_asciietch
train
py
bc8f1ced98859f22a957ce85c0f18a94805bd5e7
diff --git a/Cake/Test/TestCase/ORM/EntityTest.php b/Cake/Test/TestCase/ORM/EntityTest.php index <HASH>..<HASH> 100644 --- a/Cake/Test/TestCase/ORM/EntityTest.php +++ b/Cake/Test/TestCase/ORM/EntityTest.php @@ -927,4 +927,24 @@ class EntityTest extends TestCase { $this->assertEquals(5, $entity->get('foo')); } +/** + * Test that accessible() and single property setting works. + * + * @return + */ + public function testSetWithAccessibleSingleProperty() { + $entity = new Entity(['foo' => 1, 'bar' => 2]); + $entity->accessible('title', true); + + $entity->set(['title' => 'test', 'body' => 'Nope']); + $this->assertEquals('test', $entity->title); + $this->assertNull($entity->body); + + $entity->body = 'Yep'; + $this->assertEquals('Yep', $entity->body, 'Single set should bypass guards.'); + + $entity->set('body', 'Yes'); + $this->assertEquals('Yes', $entity->body, 'Single set should bypass guards.'); + } + }
Add tests for single set + accessible properties.
cakephp_cakephp
train
php
e3ee11d12f8a972267e5154d1cdb0948658a13c9
diff --git a/src/livestreamer/logger.py b/src/livestreamer/logger.py index <HASH>..<HASH> 100644 --- a/src/livestreamer/logger.py +++ b/src/livestreamer/logger.py @@ -1,5 +1,7 @@ import sys +from threading import Lock + class Logger(object): Levels = ["none", "error", "warning", "info", "debug"] Format = "[{module}][{level}] {msg}\n" @@ -7,6 +9,7 @@ class Logger(object): def __init__(self): self.output = sys.stdout self.level = 0 + self.lock = Lock() def new_module(self, module): return LoggerModule(self, module) @@ -28,11 +31,12 @@ class Logger(object): msg = msg.format(*args, **kw) - self.output.write(Logger.Format.format(module=module, - level=Logger.Levels[level], - msg=msg)) - if hasattr(self.output, "flush"): - self.output.flush() + with self.lock: + self.output.write(Logger.Format.format(module=module, + level=Logger.Levels[level], + msg=msg)) + if hasattr(self.output, "flush"): + self.output.flush() class LoggerModule(object): def __init__(self, manager, module):
logger: Add a thread lock.
streamlink_streamlink
train
py
728405d5837cda9d9bd918a82e895fc0db74822d
diff --git a/tests/ChunkDecoder/ForecastPeriodChunkDecoderTest.php b/tests/ChunkDecoder/ForecastPeriodChunkDecoderTest.php index <HASH>..<HASH> 100644 --- a/tests/ChunkDecoder/ForecastPeriodChunkDecoderTest.php +++ b/tests/ChunkDecoder/ForecastPeriodChunkDecoderTest.php @@ -126,15 +126,6 @@ class ForecastPeriodChunkDecoderTest extends \PHPUnit_Framework_TestCase "remaining" => "CNL", ), array( - "chunk" => "2818/2610 CNL", - "from_day" => 28, - "from_hour" => 18, - "to_day" => 26, - "to_hour" => 10, - "is_valid" => false, - "remaining" => "CNL", - ), - array( "chunk" => "2818/2818 CNL", "from_day" => 28, "from_hour" => 18, @@ -145,4 +136,4 @@ class ForecastPeriodChunkDecoderTest extends \PHPUnit_Framework_TestCase ), ); } -} \ No newline at end of file +}
Update ForecastPeriodChunkDecoderTest.php Don't test from_day vs to_day. <I> <= <I> is wrong but <I> <= <I> ist OK. Due to changing of the month. I'm not sure what max difference is allowed. So don't test at all.
SafranCassiopee_php-taf-decoder
train
php
4d88f40c810c310d9291558c2a8c4cd2e37bf562
diff --git a/lib/Doctrine/Common/Cli/Configuration.php b/lib/Doctrine/Common/Cli/Configuration.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/Common/Cli/Configuration.php +++ b/lib/Doctrine/Common/Cli/Configuration.php @@ -81,6 +81,6 @@ class Configuration */ public function hasAttribute($name) { - return isset($this->_attribute[$name]); + return isset($this->_attributes[$name]); } } \ No newline at end of file diff --git a/tests/Doctrine/Tests/Common/Cli/AllTests.php b/tests/Doctrine/Tests/Common/Cli/AllTests.php index <HASH>..<HASH> 100644 --- a/tests/Doctrine/Tests/Common/Cli/AllTests.php +++ b/tests/Doctrine/Tests/Common/Cli/AllTests.php @@ -19,6 +19,7 @@ class AllTests { $suite = new \Doctrine\Tests\DoctrineTestSuite('Doctrine Common CLI Tests'); + $suite->addTestSuite('Doctrine\Tests\Common\Cli\ConfigurationTest'); $suite->addTestSuite('Doctrine\Tests\Common\Cli\OptionTest'); $suite->addTestSuite('Doctrine\Tests\Common\Cli\OptionGroupTest'); $suite->addTestSuite('Doctrine\Tests\Common\Cli\StyleTest');
[<I>] Added unit tests for CLI Configuration. Fixed hasAttrbibute() issue of undefined property.
doctrine_annotations
train
php,php
1c7af96161f14009dbac7637199de93687f22e32
diff --git a/spec/ModelSpec.js b/spec/ModelSpec.js index <HASH>..<HASH> 100644 --- a/spec/ModelSpec.js +++ b/spec/ModelSpec.js @@ -12,7 +12,7 @@ describe('model', function() { }); }); - it("can create a model and listen for changes to a single property", function(done) { + it('should create a model and listen for changes to a single property', function(done) { // Create a new model. var model = Model(); @@ -26,4 +26,15 @@ describe('model', function() { // Set x. model.set('x', 30); }); + + it('should call fn only once for multiple updates', function(done) { + var model = Model(); + model.when('x', function (x) { + expect(x).toBe(30); + done(); + }); + model.set('x', 10); + model.set('x', 20); + model.set('x', 30); + }); }); diff --git a/src/model.js b/src/model.js index <HASH>..<HASH> 100644 --- a/src/model.js +++ b/src/model.js @@ -51,7 +51,7 @@ define([], function () { // If there is not already a list // of callbacks for the given key, - if(callbacks[key]) { + if(!callbacks[key]) { // then create one. callbacks[key] = [];
Added unit test for call fn only once for multiple updates
curran_model
train
js,js
b98c9627d28648da9d3a6a1ea580326bba85eb64
diff --git a/runtests.py b/runtests.py index <HASH>..<HASH> 100755 --- a/runtests.py +++ b/runtests.py @@ -165,6 +165,14 @@ class TracGitHubTests(unittest.TestCase): conf.set('repositories', 'nogh.dir', os.path.realpath('%s/.git' % NOGHGIT)) conf.set('repositories', 'nogh.type', 'git') + # Show changed files in timeline, which will trigger the + # IPermissionPolicy code paths + conf.set('timeline', 'changeset_show_files', '-1') + old_permission_policies = conf.get('trac', 'permission_policies') + if 'GitHubPolicy' not in old_permission_policies: + conf.set('trac', 'permission_policies', + 'GitHubPolicy, %s' % old_permission_policies) + with open(CONF, 'wb') as fp: conf.write(fp)
tests: Add test coverage for GitHubPolicy GitHubPolicy.check_permission did not yet have test coverage. Enable a few options that will at least run the code.
trac-hacks_trac-github
train
py
f2d4ab54c0c79c3d75c824a7b181210457c61bc1
diff --git a/src/test/java/javascalautils/TestSome.java b/src/test/java/javascalautils/TestSome.java index <HASH>..<HASH> 100644 --- a/src/test/java/javascalautils/TestSome.java +++ b/src/test/java/javascalautils/TestSome.java @@ -126,6 +126,13 @@ public class TestSome extends BaseAssert { assertEquals(TEXT_VALUE.length(), mapped.get().intValue()); } + @Test(expected = BrokenFunctionException.class) + public void map_fail() { + option.map(v -> { + throw new Exception("Oh darn, this went FUBAR!"); + }); + } + @Test public void flatMap() { Option<Integer> mapped = option.flatMap(v -> Option.apply(v.length())); @@ -133,6 +140,13 @@ public class TestSome extends BaseAssert { assertEquals(TEXT_VALUE.length(), mapped.get().intValue()); } + @Test(expected = BrokenFunctionException.class) + public void flatMap_fail() { + option.flatMap(v -> { + throw new Exception("Oh darn, this went FUBAR!"); + }); + } + @Test public void isEmpty() { assertFalse(option.isEmpty());
#<I> added test cases for Option.map/flatMap with failing functions
pnerg_java-scala-util
train
java
fde1b93a0f5aa903b35c4d22cdd3cef8a790dcb6
diff --git a/core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalCheckpointThread.java b/core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalCheckpointThread.java index <HASH>..<HASH> 100644 --- a/core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalCheckpointThread.java +++ b/core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalCheckpointThread.java @@ -72,8 +72,8 @@ public final class UfsJournalCheckpointThread extends Thread { * @param journal the journal */ public UfsJournalCheckpointThread(JournalEntryStateMachine master, UfsJournal journal) { - mMaster = Preconditions.checkNotNull(master); - mJournal = Preconditions.checkNotNull(journal); + mMaster = Preconditions.checkNotNull(master, "master"); + mJournal = Preconditions.checkNotNull(journal, "journal"); mShutdownQuietWaitTimeMs = journal.getQuietPeriodMs(); mJournalCheckpointSleepTimeMs = (int) Configuration.getMs(PropertyKey.MASTER_JOURNAL_TAILER_SLEEP_TIME_MS);
[SMALLFIX] Supply the variable name to Preconditions.checkNotNull
Alluxio_alluxio
train
java
10dcb99ac556913eaebb4c8d29a23e43be8224eb
diff --git a/src/livestreamer/stream/hls.py b/src/livestreamer/stream/hls.py index <HASH>..<HASH> 100644 --- a/src/livestreamer/stream/hls.py +++ b/src/livestreamer/stream/hls.py @@ -264,7 +264,7 @@ class HLSStream(HTTPStream): res = session_.http.get(url, exception=IOError, **request_params) try: - parser = hls_playlist.load(res.text, base_uri=url) + parser = hls_playlist.load(res.text, base_uri=res.url) except ValueError as err: raise IOError("Failed to parse playlist: {0}".format(err))
stream.hls: Handle variant playlists that redirect. Resolves #<I>.
streamlink_streamlink
train
py
20d46a808bf5664a696c054261ff2b35fc65d72a
diff --git a/src/videocontext.js b/src/videocontext.js index <HASH>..<HASH> 100644 --- a/src/videocontext.js +++ b/src/videocontext.js @@ -34,7 +34,7 @@ export default class VideoContext{ * * @example * var canvasElement = document.getElemenyById("canvas"); - * var ctx = new VideoContext(canvasElement, function(){console.error("Sorry, your browser dosen\'t support WebGL");}); + * var ctx = new VideoContext(cgit pull https://github.com/tjenkinson/VideoContext.git patch-2anvasElement, function(){console.error("Sorry, your browser dosen\'t support WebGL");}); * var videoNode = ctx.createVideoSourceNode("video.mp4"); * videoNode.connect(ctx.destination); * videoNode.start(0);
Add a "canvas" property to get the associated canvas
bbc_VideoContext
train
js
b88895881a8d6a399101cf593c6442dc0a6421b0
diff --git a/Kwf/Assets/Dependency/HttpUrl.php b/Kwf/Assets/Dependency/HttpUrl.php index <HASH>..<HASH> 100644 --- a/Kwf/Assets/Dependency/HttpUrl.php +++ b/Kwf/Assets/Dependency/HttpUrl.php @@ -39,4 +39,14 @@ class Kwf_Assets_Dependency_HttpUrl extends Kwf_Assets_Dependency_Abstract throw new Kwf_Exception("Unknown file type"); } } + + public function getContentsPacked() + { + return null; + } + + public function getIdentifier() + { + return $this->_url; + } }
assets dependency httpUrl supports now new abstract methods from <I>
koala-framework_koala-framework
train
php
6829002d3b6c70ac90b72cad3c5e6a635e4c3112
diff --git a/clients/web/test/testUtils.js b/clients/web/test/testUtils.js index <HASH>..<HASH> 100644 --- a/clients/web/test/testUtils.js +++ b/clients/web/test/testUtils.js @@ -11,17 +11,16 @@ window.alert = function (msg) { expect('Alert was used').toBe('Alerts should not be present'); }; -// Augment jQuery's click() function to follow href properties in links if they -// exist. -var origClick = $.fn.click; -$.fn.click = function (data, fn) { - var href = this.attr('href'); - if (href) { - window.location.assign(href); - } else { - origClick.apply(this, arguments); - } -}; +// Augment jQuery's click() function to follow href properties in links if they exist. +$.fn.click = _.wrap($.fn.click, function (old) { + var args = Array.prototype.slice.call(arguments, 1); + var href = $(this).attr('href'); + if (args.length === 0 && href) { + window.location = href; + } else { + old.apply(this, args); + } +}); // Timeout to wait for asynchronous actions girderTest.TIMEOUT = 5000;
Fix $.fn.click override functionality in testing environment
girder_girder
train
js
b117c296a5de60771b84cdef467d7676aebcab1b
diff --git a/ellipsoid/ellipsoid_test.go b/ellipsoid/ellipsoid_test.go index <HASH>..<HASH> 100755 --- a/ellipsoid/ellipsoid_test.go +++ b/ellipsoid/ellipsoid_test.go @@ -526,7 +526,7 @@ type testobject_airport struct { delta float64 } -func TestAirport(t *testing.T) { +func testAirport(t *testing.T) { epsilon := 50.0 all_tests := []testobject_airport{ {"Istanbul to Delhi",41.1, 29, 28.67, 77.21, 4550},
Commented out failing tests to be fixed.
StefanSchroeder_Golang-Ellipsoid
train
go
df991e34d07e299c586b057eb002e8eefdaa876a
diff --git a/ffi/build.py b/ffi/build.py index <HASH>..<HASH> 100755 --- a/ffi/build.py +++ b/ffi/build.py @@ -110,6 +110,8 @@ def main_posix(kind, library_ext): os.environ['LLVM_LIBS'] = ' '.join(libs.split()) cxxflags = run_llvm_config(llvm_config, ["--cxxflags"]) + # on OSX cxxflags has null bytes at the end of the string, remove them + cxxflags = cxxflags.replace('\0', '') cxxflags = cxxflags.split() + ['-fno-rtti', '-g'] os.environ['LLVM_CXXFLAGS'] = ' '.join(cxxflags)
Remove NUL emitted by cxxflags on OSX. As title.
numba_llvmlite
train
py
ab8db5f14de2c38de70c149d0079b5d4b70f86a3
diff --git a/definitions/npm/react-redux_v5.x.x/flow_v0.30.x-/react-redux_v5.x.x.js b/definitions/npm/react-redux_v5.x.x/flow_v0.30.x-/react-redux_v5.x.x.js index <HASH>..<HASH> 100644 --- a/definitions/npm/react-redux_v5.x.x/flow_v0.30.x-/react-redux_v5.x.x.js +++ b/definitions/npm/react-redux_v5.x.x/flow_v0.30.x-/react-redux_v5.x.x.js @@ -80,6 +80,13 @@ declare module 'react-redux' { declare function connect<S, A, OP, SP, DP, P>( mapStateToProps: MapStateToProps<S, OP, SP>, + mapDispatchToProps: Null, + mergeProps: MergeProps<SP, DP, OP, P>, + options?: ConnectOptions + ): Connector<OP, P>; + + declare function connect<S, A, OP, SP, DP, P>( + mapStateToProps: MapStateToProps<S, OP, SP>, mapDispatchToProps: MapDispatchToProps<A, OP, DP>, mergeProps: MergeProps<SP, DP, OP, P>, options?: ConnectOptions
Supporting connect() with null mapDispatchToProps (#<I>)
flow-typed_flow-typed
train
js
02c2676755f0c5ac59264b380bc959b3a28af0bd
diff --git a/safe_qgis/utilities.py b/safe_qgis/utilities.py index <HASH>..<HASH> 100644 --- a/safe_qgis/utilities.py +++ b/safe_qgis/utilities.py @@ -692,9 +692,9 @@ def setupLogger(): from raven.handlers.logging import SentryHandler from raven import Client #pylint: enable=F0401 - myClient = Client('http://5aee75e47c6740af842b3ef138d3ad33:16160af' - 'd794847b98a34e1fde0ed5a8d@sentry.linfiniti.com/' - '4') + myClient = Client( + 'http://c64a83978732474ea751d432ab943a6b' + ':d9d8e08786174227b9dcd8a4c3f6e9da@sentry.linfiniti.com/5') mySentryHandler = SentryHandler(myClient) mySentryHandler.setFormatter(myFormatter) mySentryHandler.setLevel(logging.ERROR)
Updated url for sentry logging handler
inasafe_inasafe
train
py
680abc960fae0c04890001a73351c158de0ebc22
diff --git a/lib/bootstrap_form/helpers/bootstrap.rb b/lib/bootstrap_form/helpers/bootstrap.rb index <HASH>..<HASH> 100644 --- a/lib/bootstrap_form/helpers/bootstrap.rb +++ b/lib/bootstrap_form/helpers/bootstrap.rb @@ -7,7 +7,7 @@ module BootstrapForm end def primary(name = nil, options = {}) - options.merge! class: 'btn btn-primary' + options.reverse_merge! class: 'btn btn-primary' submit(name, options) end diff --git a/test/bootstrap_other_components_test.rb b/test/bootstrap_other_components_test.rb index <HASH>..<HASH> 100644 --- a/test/bootstrap_other_components_test.rb +++ b/test/bootstrap_other_components_test.rb @@ -51,4 +51,9 @@ class BootstrapOtherComponentsTest < ActionView::TestCase expected = %{<input class="btn btn-primary" name="commit" type="submit" value="Submit Form" />} assert_equal expected, @builder.primary("Submit Form") end + + test "override primary button classes" do + expected = %{<input class="btn btn-primary disabled" name="commit" type="submit" value="Submit Form" />} + assert_equal expected, @builder.primary("Submit Form", class: "btn btn-primary disabled") + end end
Can't override primary button classes
bootstrap-ruby_bootstrap_form
train
rb,rb
29b4bf6a814360d9ac02558d9a6cd2a5b66a4315
diff --git a/src/core/generator.js b/src/core/generator.js index <HASH>..<HASH> 100644 --- a/src/core/generator.js +++ b/src/core/generator.js @@ -58,7 +58,7 @@ export default class Generator { return getDataAttribute(el, 'rules'); } - if (~['string', 'object'].indexOf(typeof binding.value.rules)) { + if (binding.value && ~['string', 'object'].indexOf(typeof binding.value.rules)) { return binding.value.rules; }
check if the binding value is truthy before attempting to access nested properties closes #<I>
baianat_vee-validate
train
js
f9f10ed512b784006bdf8bd214bb9812d56765df
diff --git a/config.go b/config.go index <HASH>..<HASH> 100644 --- a/config.go +++ b/config.go @@ -23,6 +23,7 @@ const defaultConfig = ` "amazon-chroot": "packer-builder-amazon-chroot", "amazon-instance": "packer-builder-amazon-instance", "digitalocean": "packer-builder-digitalocean", + "docker": "packer-builder-docker", "openstack": "packer-builder-openstack", "qemu": "packer-builder-qemu", "virtualbox": "packer-builder-virtualbox",
main: Default config has docker
hashicorp_packer
train
go
2d8652d7fbdd2a4e07bd694bf941e1eda332b5a4
diff --git a/core/router/fs.go b/core/router/fs.go index <HASH>..<HASH> 100644 --- a/core/router/fs.go +++ b/core/router/fs.go @@ -829,7 +829,7 @@ func serveFile(ctx context.Context, fs http.FileSystem, name string, redirect bo // try to find and send the correct content type based on the filename // and the binary data inside "f". - // detectOrWriteContentType(ctx, d.Name(), f) + detectOrWriteContentType(ctx, d.Name(), f) return "", http.StatusOK }
fix miss content type occurred by commenting this on the previous commit Former-commit-id: <I>cf<I>da<I>cb<I>f<I>b<I>a6a<I>f<I>
kataras_iris
train
go
acc16eac19c383d7ab98e4e32de4bebb8f6ec985
diff --git a/etrago/cluster/disaggregation.py b/etrago/cluster/disaggregation.py index <HASH>..<HASH> 100644 --- a/etrago/cluster/disaggregation.py +++ b/etrago/cluster/disaggregation.py @@ -218,6 +218,16 @@ class Disaggregation: profile.disable() print('Results transferred in ', (time.time() - t)) + profile.enable() + t = time.time() + print('---') + print("Cummulative 'p' for generators, Clustered - Disaggregated:") + print(" ", + self.clustered_network.generators_t['p'].sum().sum() - + self.original_network.generators_t['p'].sum().sum()) + print('Check computed in ', (time.time() - t)) + profile.disable() + # profile.print_stats(sort='cumtime') def transfer_results(self, partial_network, externals,
Add sanity check for cumulative `'p'` values When summing up the `'p'` values for specific buses over all timesteps, the values should be identical, module small rounding errors, for the clustered network and the original network after uniform disaggregation. This commit adds output for the difference of these cumulative values, so that one can immediately spot when the numbers are too far off.
openego_eTraGo
train
py
5d5908ce05fec502e6e6209f50a65ec8a23d2e53
diff --git a/lib/swag_dev/project/tools_provider.rb b/lib/swag_dev/project/tools_provider.rb index <HASH>..<HASH> 100644 --- a/lib/swag_dev/project/tools_provider.rb +++ b/lib/swag_dev/project/tools_provider.rb @@ -71,6 +71,24 @@ class SwagDev::Project::ToolsProvider self end + # Associates the value given by value with the given key. + # + # @param [String|Symbol] name + # @param [Class] value + def []=(name, value) + merge!(name => value) + end + + # Prevents further modifications. + # + # See also ``Object#frozen?``. + # + # @return [self] + def freeze + @items.freeze + super + end + # Get a fresh instance with given name # # @param [Symbol|String] name @@ -125,7 +143,13 @@ class SwagDev::Project::ToolsProvider # @return [Resolver] attr_reader :resolver + # Base items, before (if needed) resolution. + # + # @return [Hash] attr_reader :items + # Used to avoid classes resolution. + # + # @return [Hash] attr_reader :cache end
tools_provider (project) []=() + freeze methods introduced + doc added
SwagDevOps_kamaze-project
train
rb
34cecba506f07e58ab8b820e2d07670bab0ae0f0
diff --git a/template/app/view/cls/Toolbar.js b/template/app/view/cls/Toolbar.js index <HASH>..<HASH> 100644 --- a/template/app/view/cls/Toolbar.js +++ b/template/app/view/cls/Toolbar.js @@ -178,7 +178,7 @@ Ext.define('Docs.view.cls.Toolbar', { return { cls: cls, url: member ? cls+"-"+member.tagname+"-"+member.name : cls, - label: member ? ((member.name === "constructor") ? cls : member.name) : cls, + label: member ? ((member.tagname === "method" && member.name === "constructor") ? "new "+cls : member.name) : cls, inherited: member ? member.owner !== cls : false, 'protected': member ? member['protected'] : false, 'static': member ? member['static'] : false,
Fix rendering of constructor property in menu. Only render the constructor method as "new ClassName".
senchalabs_jsduck
train
js
c6a8576bd96f314b629d09362b857e2371f58eec
diff --git a/templates/default/includes/header.php b/templates/default/includes/header.php index <HASH>..<HASH> 100644 --- a/templates/default/includes/header.php +++ b/templates/default/includes/header.php @@ -64,7 +64,7 @@ foreach ($languages AS $lang => $current) { if ($current) { echo $langnames[$lang] . ' | '; } else { - echo '<a href="' . SimpleSAML_Utilities::addURLparameter(SimpleSAML_Utilities::selfURL(), 'language=' . $lang) . '">' . + echo '<a href="' . htmlspecialchars(SimpleSAML_Utilities::addURLparameter(SimpleSAML_Utilities::selfURL(), 'language=' . $lang)) . '">' . $langnames[$lang] . '</a> | '; } }
Add html entities to language link in header.
simplesamlphp_saml2
train
php
d28f0a5a0bf319af5f62a9e1ee3c30a3ab4fdad1
diff --git a/pinax/messages/tests/tests.py b/pinax/messages/tests/tests.py index <HASH>..<HASH> 100644 --- a/pinax/messages/tests/tests.py +++ b/pinax/messages/tests/tests.py @@ -5,6 +5,7 @@ from django.template import ( Context, Template, ) +from django.test import override_settings from ..models import ( Message, @@ -76,6 +77,23 @@ class TestMessages(BaseTest): self.assertEqual(Thread.ordered([t2, t1, t3]), [t3, t2, t1]) +@override_settings( + TEMPLATES=[ + { + "BACKEND": "django.template.backends.django.DjangoTemplates", + "DIRS": ["%s/templates" % os.path.abspath(os.path.dirname(__file__))], + "APP_DIRS": False, + "OPTIONS": { + "debug": True, + "context_processors": [ + "django.contrib.auth.context_processors.auth", + "pinax_theme_bootstrap.context_processors.theme", + "pinax.messages.context_processors.user_messages", + ] + } + }, + ] +) class TestMessageViews(BaseTest): template_dirs = [ os.path.join(os.path.dirname(__file__), "templates")
Add TEMPLATES override Override TEMPLATES setting in some tests.
pinax_pinax-messages
train
py
4ec1a6a0c78a103f1d862e8775274de122bc6c3c
diff --git a/addons/after/gemini_viewer_addon/__init__.py b/addons/after/gemini_viewer_addon/__init__.py index <HASH>..<HASH> 100644 --- a/addons/after/gemini_viewer_addon/__init__.py +++ b/addons/after/gemini_viewer_addon/__init__.py @@ -66,6 +66,8 @@ def exec(report: Report, config_dict: dict, output_summary: OutputSummary): # zip (${hashkey}.zip) if config.with_zip: base_name = f'{output_summary.response_dir}/{report.key}' + with open(f'{base_name}/report.json', 'w', encoding=output_summary.encoding) as f: + f.write(report.to_pretty_json()) shutil.make_archive(base_name, 'zip', f'{output_summary.response_dir}/{report.key}') zip_fullpath = f'{base_name}.zip'
:new: Include report.json in zip which send to aws (gemini_viewer_addon)
tadashi-aikawa_jumeaux
train
py
526885f9a0d35f6660291ef90b3809e3dcfd54a0
diff --git a/spec/decorators/page_decorator_spec.rb b/spec/decorators/page_decorator_spec.rb index <HASH>..<HASH> 100644 --- a/spec/decorators/page_decorator_spec.rb +++ b/spec/decorators/page_decorator_spec.rb @@ -20,6 +20,22 @@ module Landable end end + describe '#page_name' do + let(:page) { create :page, page_name: 'title' } + + it 'lists the page_name' do + page_decorator.page_name.should == 'title' + end + + context 'nil' do + let(:page) { create :page, page_name: nil } + + it 'returns nil' do + page_decorator.page_name.should be_nil + end + end + end + describe '#path' do let(:page) { create :page, path: '/landable' }
Add page_name spec for page decorator
enova_landable
train
rb
4e9e997dba8f89817bdfde01a2f59d45c12406a3
diff --git a/mycluster/slurm.py b/mycluster/slurm.py index <HASH>..<HASH> 100644 --- a/mycluster/slurm.py +++ b/mycluster/slurm.py @@ -268,7 +268,7 @@ echo -e "Complete========\n" return script_str -def submit(script_name, immediate, depends_on = False, depends_on_always_run = False): +def submit(script_name, immediate, depends_on = None, depends_on_always_run = False): job_id = None if not immediate: if depends_on and depends_on_always_run: @@ -278,7 +278,7 @@ def submit(script_name, immediate, depends_on = False, depends_on_always_run = F job_id = int(output.split(' ')[-1].strip()) except: print 'Job submission failed: '+output - elif depends_on: + elif depends_on is not None: with os.popen('sbatch --dependency=afterok:%s %s' % (depends_on, script_name)) as f: output = f.readline() try:
job dependencies for slurm
zenotech_MyCluster
train
py
10e98b0a512fc43090ec854f9d740367392d4867
diff --git a/blockstore/lib/config.py b/blockstore/lib/config.py index <HASH>..<HASH> 100644 --- a/blockstore/lib/config.py +++ b/blockstore/lib/config.py @@ -1028,6 +1028,7 @@ def write_config_file( blockstore_opts=None, bitcoind_opts=None, utxo_opts=None, with open(config_file, "w") as fout: + os.fchmod( fout.fileno(), 0600 ) parser.write( fout ) return True
Ensure that blockstore's settings are <I>
blockstack_blockstack-core
train
py
2252e04545efd2ba0edaf91aa37d55adc90477f1
diff --git a/branches.php b/branches.php index <HASH>..<HASH> 100644 --- a/branches.php +++ b/branches.php @@ -81,7 +81,7 @@ if ($surn) { $surn_script = utf8_script($surn); echo '<fieldset><legend>', WT_ICON_BRANCHES, ' ', PrintReady($surn), '</legend>'; $indis = indis_array($surn, $soundex_std, $soundex_dm); - usort($indis, array('WT_Person', 'CompareBirtDate')); + uasort($indis, array('WT_Person', 'CompareBirtDate')); echo '<ol>'; foreach ($indis as $person) { $famc = $person->getPrimaryChildFamily();
#<I> - Branches list (sn <I>) - "random surname" (wrong sort used - duplicates appearing)
fisharebest_webtrees
train
php
f00f160b01d27ed0d446f4389dfb5e3fc5a60eef
diff --git a/src/Http/routes.php b/src/Http/routes.php index <HASH>..<HASH> 100644 --- a/src/Http/routes.php +++ b/src/Http/routes.php @@ -62,4 +62,4 @@ Route::get('/telescope-api/monitored-tags', 'MonitoredTagController@index'); Route::post('/telescope-api/monitored-tags/', 'MonitoredTagController@store'); Route::post('/telescope-api/monitored-tags/delete', 'MonitoredTagController@destroy'); -Route::get('/{view?}', 'HomeController@index')->where('view', '(.*)'); +Route::get('/{view?}', 'HomeController@index')->where('view', '(.*)')->name('telescope'); diff --git a/tests/Http/RouteTest.php b/tests/Http/RouteTest.php index <HASH>..<HASH> 100644 --- a/tests/Http/RouteTest.php +++ b/tests/Http/RouteTest.php @@ -83,4 +83,13 @@ class RouteTest extends FeatureTestCase return $this; }); } + + public function test_named_route() + { + + $this->assertEquals( + url(config('telescope.path')), + route('telescope') + ); + } }
Add named route for telescope Allow applications to add the telescope url by a named route.
laravel_telescope
train
php,php
e5159ed4cba1be50bcedcd20de109abdbcc17763
diff --git a/core-bundle/src/Doctrine/Schema/DcaSchemaProvider.php b/core-bundle/src/Doctrine/Schema/DcaSchemaProvider.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Doctrine/Schema/DcaSchemaProvider.php +++ b/core-bundle/src/Doctrine/Schema/DcaSchemaProvider.php @@ -463,11 +463,12 @@ class DcaSchemaProvider ->fetch(\PDO::FETCH_OBJ) ; - if (\in_array(strtolower((string) $largePrefix->Value), ['1', 'on'], true)) { + // The variable no longer exists (as of MySQL 8 and MariaDB 10.3) + if (false === $largePrefix) { return 3072; } - return 767; + return \in_array(strtolower((string) $largePrefix->Value), ['1', 'on'], true) ? 3072 : 767; } /**
[Core] Handle the case that the innodb_large_prefix variable no longer exists (see contao/installation-bundle#<I>).
contao_contao
train
php
1a4cf3cca21246d621e481939ad0fe7c8660364f
diff --git a/src/docgen/generator.js b/src/docgen/generator.js index <HASH>..<HASH> 100644 --- a/src/docgen/generator.js +++ b/src/docgen/generator.js @@ -14,9 +14,9 @@ export default class Generator { isType(type) { const cleanedType = this.cleanType(type); - return !!(this.service.models.find((m) => m.name === cleanedType) - || this.service.enums.find((m) => m.name === cleanedType) - || this.service.unions.find((m) => m.name === cleanedType)); + return !!(this.service.models && this.service.models.find((m) => m.name === cleanedType) + || this.service.enums && this.service.enums.find((m) => m.name === cleanedType) + || this.service.unions && this.service.unions.find((m) => m.name === cleanedType)); } linkType(type) {
Avoid TypeError by not reading properties in undefined objects
flowcommerce_lib-apidoc
train
js
42dedc80b1efb83d0ec37e46fd7f7cffa8a13d22
diff --git a/packages/preprocessors/import.js b/packages/preprocessors/import.js index <HASH>..<HASH> 100644 --- a/packages/preprocessors/import.js +++ b/packages/preprocessors/import.js @@ -1,5 +1,12 @@ var importExpr = /^(\s*)(import\s+.*|from\s+.*)$/gm; +function replace(match) { + if (!/\/\//.test(match[1])) { + return match[1] + 'jsio' + match[2] + } + return match[0]; +} + exports = function(path, moduleDef, opts) { moduleDef.src = moduleDef.src.replace(importExpr, '$1' + 'jsio' + '("$2");'); }
if a js.io line is commented out with //, ignore it!
gameclosure_js.io
train
js
1d0fb41309b8aaa4664eab662cb909343f72d1f8
diff --git a/lib/translation_io/client/sync_operation/create_yaml_pot_file_step.rb b/lib/translation_io/client/sync_operation/create_yaml_pot_file_step.rb index <HASH>..<HASH> 100644 --- a/lib/translation_io/client/sync_operation/create_yaml_pot_file_step.rb +++ b/lib/translation_io/client/sync_operation/create_yaml_pot_file_step.rb @@ -19,7 +19,6 @@ module TranslationIO end source_flat_string_tanslations = all_flat_translations.select do |key, value| - TranslationIO.info "#{key} - #{value}" value.is_a?(String) && key.present? && key.start_with?("#{@source_locale}.") && !key.start_with?("#{@source_locale}.faker.") end diff --git a/lib/translation_io/config.rb b/lib/translation_io/config.rb index <HASH>..<HASH> 100644 --- a/lib/translation_io/config.rb +++ b/lib/translation_io/config.rb @@ -19,7 +19,7 @@ module TranslationIO def yaml_file_paths I18n.load_path.select do |p| - File.exist?(p) + File.exist?(p) && File.extname(p).in? ['.yml', '.yaml'] end end
debug when I<I>n.load_path contains .rb file (don't parse it with YAML parser)
translation_rails
train
rb,rb
a91e53cdadeae9824d41a01b8d2494707f701e9d
diff --git a/lib/app/index.js b/lib/app/index.js index <HASH>..<HASH> 100644 --- a/lib/app/index.js +++ b/lib/app/index.js @@ -294,6 +294,12 @@ App.prototype.validate = function( lvl_publish ){ settingsObj.forEach(function(setting, j) { if( setting.type === 'group' ) { + + if( typeof setting.children == 'undefined' ) + return error("missing `driver[" + i + "].settings" + path + "[" + j + "].children` in app.json"); + + if( !Array.isArray(setting.children) ) + return error("`driver[" + i + "].settings" + path + "[" + j + "].children` in app.json is not an Array."); checkSettingsRecursive.call( this, setting.children, path + `[${j}].children` );
fix crash when a driver setting of type group without children was present (#<I>)
athombv_node-homey-lib
train
js
f3937082400db41f727235208d3d0160695fad71
diff --git a/src/Execution/MutationExecutor.php b/src/Execution/MutationExecutor.php index <HASH>..<HASH> 100644 --- a/src/Execution/MutationExecutor.php +++ b/src/Execution/MutationExecutor.php @@ -113,16 +113,17 @@ class MutationExecutor { $reflection = new ReflectionClass($model); - [$belongsTo, $remaining] = self::partitionArgsByRelationType( + // Extract $morphTo first, as MorphTo extends BelongsTo + [$morphTo, $remaining] = self::partitionArgsByRelationType( $reflection, $args, - BelongsTo::class + MorphTo::class ); - [$morphTo, $remaining] = self::partitionArgsByRelationType( + [$belongsTo, $remaining] = self::partitionArgsByRelationType( $reflection, $remaining, - MorphTo::class + BelongsTo::class ); // Use all the remaining attributes and fill the model
Extract $morphTo first, as MorphTo extends BelongsTo
nuwave_lighthouse
train
php
9fce070e976256ae15bea2b74ff73d29d66a2942
diff --git a/smartfile/__init__.py b/smartfile/__init__.py index <HASH>..<HASH> 100644 --- a/smartfile/__init__.py +++ b/smartfile/__init__.py @@ -143,7 +143,7 @@ class Client(object): been uploaded, you cannot download folders """ # download uses shutil.copyfileobj to download, which copies # the data in chunks - o = file(file_to_be_downloaded, 'wb') + o = open(file_to_be_downloaded, 'wb') return shutil.copyfileobj(self.get('/path/data/', file_to_be_downloaded), o) diff --git a/smartfile/errors.py b/smartfile/errors.py index <HASH>..<HASH> 100644 --- a/smartfile/errors.py +++ b/smartfile/errors.py @@ -28,7 +28,7 @@ class ResponseError(APIError): if self.status_code == 404: self.detail = six.u('Invalid URL, check your API path') else: - self.detail = six.u('Server error; check response for error') + self.detail = six.u('Server error; check response for errors') else: if self.status_code == 400 and 'field_errors' in json: self.detail = json['field_errors']
fixed python3 unsupported call
smartfile_client-python
train
py,py
efc81294ebe08d3a557eac333c30b416f8ecf9ec
diff --git a/lang/en/calendar.php b/lang/en/calendar.php index <HASH>..<HASH> 100644 --- a/lang/en/calendar.php +++ b/lang/en/calendar.php @@ -8,7 +8,7 @@ $string['confirmeventdelete'] = 'Are you sure you want to delete this event?'; $string['courseevents'] = 'Course events'; $string['dayview'] = 'Day View'; $string['daywithnoevents'] = 'There are no events this day.'; -$string['default']; +$string['default'] = 'Default'; $string['deleteevent'] = 'Delete event'; $string['detailedmonthview'] = 'Detailed Month View'; $string['durationnone'] = 'Without duration';
Eloy's finding: Unset $string['default'] variable fixed.
moodle_moodle
train
php
e0d7fbf3db13f65932b98abf69e3c60cf18ee1f8
diff --git a/indra/statements.py b/indra/statements.py index <HASH>..<HASH> 100644 --- a/indra/statements.py +++ b/indra/statements.py @@ -2949,8 +2949,8 @@ class Conversion(Statement): def matches_key(self): keys = [type(self)] keys += [self.subj.matches_key() if self.subj else None] - keys += [agent.matches_key() for agent in self.obj_to] - keys += [agent.matches_key() for agent in self.obj_from] + keys += [agent.matches_key() for agent in sorted_agents(self.obj_to)] + keys += [agent.matches_key() for agent in sorted_agents(self.obj_from)] return str(keys) def set_agent_list(self, agent_list):
Sort sub-lists in Conversions.
sorgerlab_indra
train
py
e825779bb88ff56d73f2e4717170fc72b364c511
diff --git a/pyuploadcare/api.py b/pyuploadcare/api.py index <HASH>..<HASH> 100644 --- a/pyuploadcare/api.py +++ b/pyuploadcare/api.py @@ -146,7 +146,7 @@ def rest_request(verb, path, data=None, timeout=conf.DEFAULT): if response.status_code == 204: return - if response.status_code == 403: + if response.status_code in (401, 403): raise AuthenticationError(response.content) if response.status_code in (400, 404):
Treat <I> responses as AuthenticationError.
uploadcare_pyuploadcare
train
py
2ae1ec0d17490459212edb4c8f775b71b2540dd6
diff --git a/samples/OPM_Sample.java b/samples/OPM_Sample.java index <HASH>..<HASH> 100644 --- a/samples/OPM_Sample.java +++ b/samples/OPM_Sample.java @@ -62,15 +62,3 @@ enum FPEnumValueOf { } } -class OPMParent { - public OPMParent(int i) { - -} - -class FPOPMChild extends OPMParent{ - public FPOPMChild() { - super(1); - } -} -} -
revert e<I>e<I>fb<I>fef<I>e5c<I>ad<I>c<I>f4: add FP for calling parent constructors for OPM
mebigfatguy_fb-contrib
train
java
b06bd9d671a022a691489ce1791d21863dfb907b
diff --git a/client/html/templates/catalog/filter/attribute-body-standard.php b/client/html/templates/catalog/filter/attribute-body-standard.php index <HASH>..<HASH> 100644 --- a/client/html/templates/catalog/filter/attribute-body-standard.php +++ b/client/html/templates/catalog/filter/attribute-body-standard.php @@ -88,9 +88,9 @@ $listAction = $this->config( 'client/html/catalog/lists/url/action', 'list' ); $listConfig = $this->config( 'client/html/catalog/lists/url/config', [] ); $attrMap = $this->get( 'attributeMap', [] ); -$attrIds = $this->param( 'f_attrid', [] ); -$oneIds = $this->param( 'f_oneid', [] ); -$optIds = $this->param( 'f_optid', [] ); +$attrIds = array_filter( $this->param( 'f_attrid', [] ) ); +$oneIds = array_filter( $this->param( 'f_oneid', [] ) ); +$optIds = array_filter( $this->param( 'f_optid', [] ) ); $params = $this->param();
Remove empty attribute IDs so "Your choice" isn't shown
aimeos_ai-client-html
train
php
f20018769838b61134b8b90696c1bb3d23dd9f05
diff --git a/test/functional/index_tests.js b/test/functional/index_tests.js index <HASH>..<HASH> 100644 --- a/test/functional/index_tests.js +++ b/test/functional/index_tests.js @@ -904,6 +904,31 @@ exports['should correctly create index on embedded key'] = { } } +/** + * @ignore + */ +exports['should correctly create index using . keys'] = { + metadata: { requires: { topology: ['single', 'replicaset', 'sharded', 'ssl', 'heap', 'wiredtiger'] } }, + + // The actual test we wish to run + test: function(configuration, test) { + var db = configuration.newDbInstance(configuration.writeConcernMax(), {poolSize:1}); + db.open(function(err, db) { + test.equal(null, err); + var collection = db.collection('embedded_key_indes_1'); + collection.createIndex( + { 'key.external_id': 1, 'key.type': 1 }, + { unique: true, sparse: true, name: 'indexname'}, + function(err, r) { + test.equal(null, err); + + db.close(); + test.done(); + }); + }); + } +} + // /** // * @ignore // */
NODE-<I> added test
mongodb_node-mongodb-native
train
js
e2093d09465bc6a1c74fe9363b7dd112e3fe849b
diff --git a/src/installer/stages/platformio-core.js b/src/installer/stages/platformio-core.js index <HASH>..<HASH> 100644 --- a/src/installer/stages/platformio-core.js +++ b/src/installer/stages/platformio-core.js @@ -317,7 +317,7 @@ export default class PlatformIOCoreStage extends BaseStage { resolve(stdout); } else { if (misc.IS_WINDOWS) { - stderr += '\n If you have antivirus software in a system, try to disable it for a while.'; + stderr = `If you have antivirus/firewall/defender software in a system, try to disable it for a while. \n ${stderr}`; } reject(new Error(`PIP: ${stderr}`)); }
Better explanation about PIP issue on Windows
platformio_platformio-node-helpers
train
js
eff58f917a0e2a6c70421847c4173920ff13688d
diff --git a/galpy/orbit_src/RZOrbit.py b/galpy/orbit_src/RZOrbit.py index <HASH>..<HASH> 100644 --- a/galpy/orbit_src/RZOrbit.py +++ b/galpy/orbit_src/RZOrbit.py @@ -112,7 +112,22 @@ class RZOrbit(OrbitTop): 2011-04-18 - Written - Bovy (NYU) """ if not kwargs.has_key('OmegaP') or kwargs['OmegaP'] is None: - OmegaP= 1 + OmegaP= 1. + if not kwargs.has_key('pot') or kwargs['pot'] is None: + try: + pot= self._pot + except AttributeError: + raise AttributeError("Integrate orbit or specify pot=") + else: + pot= kwargs['pot'] + if isinstance(pot,list): + for p in pot: + if hasattr(p,'OmegaP'): + OmegaP= p.OmegaP() + break + else: + if hasattr(pot,'OmegaP'): + OmegaP= pot.OmegaP() if kwargs.has_key('OmegaP'): kwargs.pop('OmegaP') else:
automatically determine the pattern speed to use when calculating the Jacobi integral
jobovy_galpy
train
py
f34df7060551dd38143a9f7d255f858764d64645
diff --git a/jax/lax_linalg.py b/jax/lax_linalg.py index <HASH>..<HASH> 100644 --- a/jax/lax_linalg.py +++ b/jax/lax_linalg.py @@ -312,9 +312,8 @@ def triangular_solve_jvp_rule_a( def triangular_solve_transpose_rule( cotangent, a, b, left_side, lower, transpose_a, conjugate_a, unit_diagonal): - # Triangular solve is linear in its first argument and nonlinear in its second - # argument, similar to `div`. We need both a JVP rule and a transpose rule - # for the first argument. + # Triangular solve is nonlinear in its first argument and linear in its second + # argument, analogous to `div` but swapped. assert a is not None and b is None cotangent_b = triangular_solve(a, cotangent, left_side, lower, not transpose_a, conjugate_a, unit_diagonal)
fix triangular_solve_transpose_rule comment
tensorflow_probability
train
py
9caf3fe118bda4628b85c52744ae10bd12954373
diff --git a/src/app/Classes/Builder.php b/src/app/Classes/Builder.php index <HASH>..<HASH> 100644 --- a/src/app/Classes/Builder.php +++ b/src/app/Classes/Builder.php @@ -79,6 +79,8 @@ class Builder private function isForbidden($route) { - return $this->template->authorize && !request()->user()->can('access-route', $route); + return $this->template->authorize + && request()->user() + ->cannot('access-route', $route); } }
adds cannot instead of !can
laravel-enso_FormBuilder
train
php
d44327ab958f10d845680a39e0f75add47f2666e
diff --git a/libraries/common/components/Router/helpers/parsed-link/actions.js b/libraries/common/components/Router/helpers/parsed-link/actions.js index <HASH>..<HASH> 100644 --- a/libraries/common/components/Router/helpers/parsed-link/actions.js +++ b/libraries/common/components/Router/helpers/parsed-link/actions.js @@ -45,8 +45,6 @@ const externalLink = (url) => { * @param {string} options.url Link url. * @param {string} options.targetTab Target tab where the page should be opened. * @param {string} options.navigationType Type of the navigation bar that should be displayed. - * @param {string} options.popTabToRoot Type of the navigation bar that should be displayed. - * @param {string} options.flushTab The tab that should be flushed * @param {string} options.backCallback * Javascript callback that is executed when hitting the back button. */
PI-<I>: Deleted JSDoc for removed function parameters
shopgate_pwa
train
js
1ea0ef62e7b42f9955a022a81e62c27111f687da
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages setup(name='pfr', - version='0.4.0.dev0', + version='0.4.0.dev1', description='Scraping data from pro-football-reference.com', url='https://github.com/mdgoldberg/pfr', author='Matt Goldberg',
pypi not working, trying again, incremented dev version
mdgoldberg_sportsref
train
py
1d4631568decaf6a3db54cbdc63a91079bd780bc
diff --git a/src/components/select/select.js b/src/components/select/select.js index <HASH>..<HASH> 100755 --- a/src/components/select/select.js +++ b/src/components/select/select.js @@ -66,6 +66,9 @@ angular.module('material.components.select', [ * **Note:** A value of `undefined` ***is considered a valid value*** (and does not auto-apply this * attribute) since you may wish this to be your "Not Available" or "None" option. * + * **Note:** Using the `value` attribute (as opposed to `ng-value`) always evaluates to a string, so + * `value="null"` will require the test `ng-if="myValue != 'null'"` rather than `ng-if="!myValue"`. + * * @param {expression} ng-model The model! * @param {boolean=} multiple Whether it's multiple. * @param {expression=} md-on-close Expression to be evaluated when the select is closed.
docs(select): Add note about value/ng-value differences. (#<I>) Some users expressed confusion about the fact that the `value` attribute always evaluates to a string as opposed to the `ng-value` attribute which allows any value. Add a note to the docs to describe the differences and give an example of how to properly use `ng-if` with the `value` attribute. Fixes #<I>.
angular_material
train
js
e5a80201f572678c0dff1953a35dc8163de61851
diff --git a/build.js b/build.js index <HASH>..<HASH> 100644 --- a/build.js +++ b/build.js @@ -1,7 +1,7 @@ var stealTools = require("steal-tools"); stealTools.export({ - system: { + steal: { config: __dirname + "/package.json!npm" }, outputs: {
updating build script to work with steal-tools <I>
canjs_can-util
train
js
1794f6a4d36cafcc4eb2a64e0145d937bc81bc34
diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py index <HASH>..<HASH> 100644 --- a/searx/engines/__init__.py +++ b/searx/engines/__init__.py @@ -94,6 +94,8 @@ def load_engine(engine_data): logger.debug('Starting background initialization of %s engine', engine_data['name']) threading.Thread(target=engine_init).start() continue + if engine_attr == 'inactive' and getattr(engine, engine_attr) is True: + return None if getattr(engine, engine_attr) is None: logger.error('Missing engine config attribute: "{0}.{1}"' .format(engine.name, engine_attr))
[enh] add "inactive" attribute to engines This modification allows us to deactivate engines in settings.yml without commenting them out
asciimoo_searx
train
py
b9bb7fcd4b2fc4d51ee26bcec8f4e84b9efad10e
diff --git a/client-js/utilities/fetch-json.js b/client-js/utilities/fetch-json.js index <HASH>..<HASH> 100644 --- a/client-js/utilities/fetch-json.js +++ b/client-js/utilities/fetch-json.js @@ -1,17 +1,20 @@ import 'whatwg-fetch' -export default function fetchJson (verb, url, body) { - var opts = { - method: 'GET', +export default function fetchJson (method, url, body) { + const opts = { + method: method.toUpperCase(), credentials: 'same-origin', headers: { 'Accept': 'application/json', - 'Content-Type': 'application/json' + 'Content-Type': 'application/json', + 'Cache-Control': 'no-cache', + 'Expires': '-1', + 'Pragma': 'no-cache' } } - if (!verb) throw new Error('You must supply a verb to the fetch wrapper') - opts.method = verb.toUpperCase() - if (body) opts.body = JSON.stringify(body) + if (body) { + opts.body = JSON.stringify(body) + } return fetch(url, opts).then((response) => { if (response.status === 200) { return response.json()
Force no-cache on fetch requests (#<I>) Turns out IE <I> aggressively caches fetch / "ajax" requests, which meant SQLPad no longer worked when it switched to a single-page-app. This patch fixes SQLPad for Internet Explorer. IE support is not a focus of this project, but this fix isn't too much out of the way.
rickbergfalk_sqlpad
train
js