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
b291a00688efa4f6e403270feebe1adc5542252a
diff --git a/service/gcs/bridge/bridge.go b/service/gcs/bridge/bridge.go index <HASH>..<HASH> 100644 --- a/service/gcs/bridge/bridge.go +++ b/service/gcs/bridge/bridge.go @@ -41,6 +41,9 @@ var capabilities = prot.GcsCapabilities{ }, }, RuntimeOsType: prot.OsTypeLinux, + GuestDefinedCapabilities: prot.GcsGuestCapabilities{ + SignalProcessSupported: true, + }, } // UnknownMessage represents the default handler logic for an unmatched request diff --git a/service/gcs/prot/protocol.go b/service/gcs/prot/protocol.go index <HASH>..<HASH> 100644 --- a/service/gcs/prot/protocol.go +++ b/service/gcs/prot/protocol.go @@ -249,7 +249,14 @@ type GcsCapabilities struct { // GuestDefinedCapabilities define any JSON object that will be directly // passed to a client of the HCS. This can be useful to pass runtime // specific capabilities not tied to the platform itself. - GuestDefinedCapabilities interface{} `json:",omitempty"` + GuestDefinedCapabilities GcsGuestCapabilities `json:",omitempty"` +} + +// GcsGuestCapabilities represents the customized guest capabilities supported +// by this GCS. +type GcsGuestCapabilities struct { + NamespaceAddRequestSupported bool `json:",omitempty"` + SignalProcessSupported bool `json:",omitempty"` } // MessageBase is the base type embedded in all messages sent from the HCS to
Return GuestDefinedCapabilities with SignalProcess support
Microsoft_hcsshim
train
go,go
631e10af7dc48a9cf7c4d358d53a52fa9836f0f5
diff --git a/SimpleAudioIndexer/__init__.py b/SimpleAudioIndexer/__init__.py index <HASH>..<HASH> 100755 --- a/SimpleAudioIndexer/__init__.py +++ b/SimpleAudioIndexer/__init__.py @@ -629,7 +629,7 @@ class SimpleAudioIndexer(object): seconds_passed = 0 for split_index, splitted_file_timestamp in enumerate( self.__timestamps[timestamp_basename]): - total_seconds = self.get_audio_duration_seconds( + total_seconds = self._get_audio_duration_seconds( "{}/staging/{}".format( self.src_dir, staged_splitted_file_basenames[split_index]
Missed an additional underscore for list audio method
aalireza_SimpleAudioIndexer
train
py
8ae17e6eb966a68d5295a4c05ec7b2066af7088c
diff --git a/config/application.rb b/config/application.rb index <HASH>..<HASH> 100644 --- a/config/application.rb +++ b/config/application.rb @@ -74,6 +74,8 @@ module Peoplefinder # NOTE: may need to eager load paths instead if lib code is commonly called config.autoload_paths << Rails.root.join('lib') + require Rails.root.join('lib', 'csv_publisher', 'user_behavior_report.rb') + config.active_record.sqlite3.represent_boolean_as_integer = true end
CT-<I> Autoloading has changed - require module in lib directly (#<I>) Generate report on production failed with NameError (uninitialized constant Admin::ManagementController::CsvPublisher): app/controllers/admin/management_controller.rb:7:in `generate_user_behavior_report'
ministryofjustice_peoplefinder
train
rb
f379d8ce256159a4fc7ce58abf87c609a4a0c3ab
diff --git a/AlphaTwirl/EventReader/ProgressMonitor.py b/AlphaTwirl/EventReader/ProgressMonitor.py index <HASH>..<HASH> 100755 --- a/AlphaTwirl/EventReader/ProgressMonitor.py +++ b/AlphaTwirl/EventReader/ProgressMonitor.py @@ -55,12 +55,12 @@ class MPProgressMonitor(object): def monitor(self): if time.time() - self.lastTime < 0.1: return self.lastTime = time.time() - self.present() + self._present() def last(self): - self.present() + self._present() - def present(self): + def _present(self): while not self.queue.empty(): report = self.queue.get() self._presentation.present(report)
rename present() _present(), indicating private
alphatwirl_alphatwirl
train
py
bff2a582ecc5b26440dc4c7b2ee4b745403b57f2
diff --git a/src/test/java/cleanzephyr/rubycollect4j/RubyHashTest.java b/src/test/java/cleanzephyr/rubycollect4j/RubyHashTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/cleanzephyr/rubycollect4j/RubyHashTest.java +++ b/src/test/java/cleanzephyr/rubycollect4j/RubyHashTest.java @@ -188,4 +188,14 @@ public class RubyHashTest { assertEquals(ra(2, 4, 6), ints); } + @Test + public void testEmptyʔ() { + rh = rh(1, 2, 3, 4, 5, 6); + assertFalse(rh.emptyʔ()); + rh = rh(); + assertTrue(rh.emptyʔ()); + rh = rh(null, null); + assertFalse(rh.emptyʔ()); + } + }
Add test for RubyHash::empty?
wnameless_rubycollect4j
train
java
810facaac050878991d2890f0a74dbde3b4314e4
diff --git a/tests/appveyor_test_cases.py b/tests/appveyor_test_cases.py index <HASH>..<HASH> 100644 --- a/tests/appveyor_test_cases.py +++ b/tests/appveyor_test_cases.py @@ -57,24 +57,6 @@ class TestAppMethods(unittest.TestCase): app.close() lackey.wait(0.9) - def test_app_title(self): - """ - App selected by title should capture existing window if open, - including case-insensitive matches. - """ - app = lackey.App("notepad.exe") - app.open() - lackey.wait(2) - app2 = lackey.App("Notepad") - app3 = lackey.App("notepad") - lackey.wait(1) - - self.assertTrue(app2.isRunning()) - self.assertTrue(app3.isRunning()) - self.assertEqual(app2.getName(), app.getName()) - self.assertEqual(app3.getName(), app.getName()) - app.close() - class TestScreenMethods(unittest.TestCase): def setUp(self): self.primaryScreen = lackey.Screen(0)
Removed app title test in AppVeyor Unsure why this doesn’t work in Appveyor, but it works locally so I’m assuming it has something to do with the environment.
glitchassassin_lackey
train
py
6500bd897f3d93da90a5d813ffabed4d5ff5f361
diff --git a/guava/src/com/google/common/collect/ComparisonChain.java b/guava/src/com/google/common/collect/ComparisonChain.java index <HASH>..<HASH> 100644 --- a/guava/src/com/google/common/collect/ComparisonChain.java +++ b/guava/src/com/google/common/collect/ComparisonChain.java @@ -41,6 +41,9 @@ import javax.annotation.Nullable; * nonzero</i> comparison result in the chain, or will be zero if every * comparison result was zero. * + * <p><b>Note:</b> {@code ComparisonChain} instances are <b>immutable</b>. For + * this utility to work correctly, calls must be chained as illustrated above. + * * <p>Performance note: Even though the {@code ComparisonChain} caller always * invokes its {@code compare} methods unconditionally, the {@code * ComparisonChain} implementation stops calling its inputs' {@link
Warn about immutability. ------------- Created by MOE: <URL>
google_guava
train
java
16b69ecb7cb2ff5d324a24e02924cdadfc755b8a
diff --git a/src/utils/getPurchaseEstimate.js b/src/utils/getPurchaseEstimate.js index <HASH>..<HASH> 100644 --- a/src/utils/getPurchaseEstimate.js +++ b/src/utils/getPurchaseEstimate.js @@ -48,13 +48,16 @@ export function getPurchaseEstimate({ client, amount, rate, remaining }) { ? new BigNumber(remaining) .multipliedBy(new BigNumber(rate)) .dividedBy(new BigNumber(client.toWei('1'))) - .decimalPlaces(18) + .decimalPlaces(0) .toString(10) : null const excessCoinAmount = isValidAmount && excedes - ? weiAmount.minus(usedCoinAmount).toString(10) + ? weiAmount + .minus(usedCoinAmount) + .decimalPlaces(0) + .toString(10) : null return { expectedMETamount, excedes, usedCoinAmount, excessCoinAmount }
Fix issue in purchase estimates when MET price is extremely low
autonomoussoftware_metronome-wallet-ui-logic
train
js
538c84c7ea72c85cb0328fe7e3e32e7eeac69239
diff --git a/src/js/flowchart.js b/src/js/flowchart.js index <HASH>..<HASH> 100644 --- a/src/js/flowchart.js +++ b/src/js/flowchart.js @@ -2724,7 +2724,7 @@ '#{id} .flowchart-relation[data-shape="polyline"] .flowchart-relation-text,', '#{id} .flowchart-relation[data-shape="bessel"] .flowchart-relation-text {cursor: move}', - '#{id} .flowchart-element-focused .flowchart-relation-text {pointer-events: auto; border: 1px solid {activeColor}}', + '#{id} .flowchart-element-focused .flowchart-relation-text {opacity: 1; pointer-events: auto; border: 1px solid {activeColor}}', '#{id} .flowchart-svg-canvas .flowchart-relation-line:hover {stroke: {activeColor}!important}',
* fix double click not work in relation element without text.
easysoft_zui
train
js
4568c0f79f65568f3bc1094b8f78e3cf3e4256aa
diff --git a/openxc-it/src/main/java/com/openxc/remote/sources/trace/TraceVehicleDataSourceTest.java b/openxc-it/src/main/java/com/openxc/remote/sources/trace/TraceVehicleDataSourceTest.java index <HASH>..<HASH> 100644 --- a/openxc-it/src/main/java/com/openxc/remote/sources/trace/TraceVehicleDataSourceTest.java +++ b/openxc-it/src/main/java/com/openxc/remote/sources/trace/TraceVehicleDataSourceTest.java @@ -91,7 +91,7 @@ public class TraceVehicleDataSourceTest extends AndroidTestCase { startTrace(source); assertTrue(receivedNumericalCallback); assertTrue(receivedBooleanCallback); - assertEquals(receivedBoolean, false); + assertEquals(receivedBoolean, true); } @SmallTest
Update trace test with new included boolean.
openxc_openxc-android
train
java
08dd7eaf6859093fce17bb0a14917be7b99d8bd6
diff --git a/querydsl-core/src/main/java/com/mysema/query/group/GroupBy.java b/querydsl-core/src/main/java/com/mysema/query/group/GroupBy.java index <HASH>..<HASH> 100644 --- a/querydsl-core/src/main/java/com/mysema/query/group/GroupBy.java +++ b/querydsl-core/src/main/java/com/mysema/query/group/GroupBy.java @@ -248,17 +248,17 @@ public class GroupBy<S> implements ResultTransformer<Map<S, Group>> { @Override public <T> T getOne(Expression<T> expr) { - return get(expr); + return this.<T, T>get(expr); } @Override public <T> Set<T> getSet(Expression<T> expr) { - return get(expr); + return this.<T, Set<T>>get(expr); } @Override public <T> List<T> getList(Expression<T> expr) { - return get(expr); + return this.<T, List<T>>get(expr); } private <T, R> R get(Expression<T> expr) {
Fixed generics that break under some older Java version
querydsl_querydsl
train
java
84d411f010509fb8df8849f02b6124cf0ea55afb
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -39,8 +39,8 @@ function _update(current, name, fn) { var lookupKey = key; key = lookupIndex(current, key); if (key === undefined) { - throw new Error(`no object found by ${lookupKey}. autocreate is not supported`); - } + throw new Error('no object found by ' + lookupKey + '. autocreate is not supported'); + } } if (current[key] === undefined) {
fix message interpolation when throwing lookup error - accidental usage of ES6 interpolation causes problems when processing code that expected to be ES5-compatible. this commit replaces interpolation by string concatenation
akuzko_update-js
train
js
256d1e2a44529e596b7893838e48705ebfdbb1af
diff --git a/examples/file_uncompress.js b/examples/file_uncompress.js index <HASH>..<HASH> 100644 --- a/examples/file_uncompress.js +++ b/examples/file_uncompress.js @@ -12,7 +12,8 @@ var outputFile = process.argv[3] || path.basename(inputFile, lz4.extension) var decoder = lz4.createDecoderStream() -var input = fs.createReadStream( inputFile ) +// Higher buffer size increases performance +var input = fs.createReadStream( inputFile, { highWaterMark: 4 << 20 } ) var output = fs.createWriteStream( outputFile ) // Timing
Added buffer size in uncompress example (throughput is doubled)
pierrec_node-lz4
train
js
e5c40d83a06247e556d39226a782f43557b14250
diff --git a/lib/rest-ftp-daemon/job.rb b/lib/rest-ftp-daemon/job.rb index <HASH>..<HASH> 100644 --- a/lib/rest-ftp-daemon/job.rb +++ b/lib/rest-ftp-daemon/job.rb @@ -271,7 +271,8 @@ module RestFtpDaemon ftp_connect_and_login # Connect remote server, login and chdir - ftp_chdir_or_buildpath @target_url.path + path = '/' + Helpers.extract_dirname(@target_url.path).to_s + ftp_chdir_or_buildpath path # Check source files presence and compute total size, they should be there, coming from Dir.glob() @transfer_total = 0
bugfix: a target path without subdirs caused a process crash
bmedici_rest-ftp-daemon
train
rb
320124b6a46e0fe39e06ffaf8cbb2e490ca6a060
diff --git a/gobblin-aws/src/main/java/gobblin/aws/GobblinAWSClusterLauncher.java b/gobblin-aws/src/main/java/gobblin/aws/GobblinAWSClusterLauncher.java index <HASH>..<HASH> 100644 --- a/gobblin-aws/src/main/java/gobblin/aws/GobblinAWSClusterLauncher.java +++ b/gobblin-aws/src/main/java/gobblin/aws/GobblinAWSClusterLauncher.java @@ -548,7 +548,7 @@ public class GobblinAWSClusterLauncher { private String buildClusterWorkerCommand(String memory) { StringBuilder userDataCmds = new StringBuilder().append("#!/bin/bash").append("\n"); - String clusterWorkerClassName = GobblinAWSClusterMaster.class.getSimpleName(); + String clusterWorkerClassName = GobblinAWSTaskRunner.class.getSimpleName(); // Connect to NFS server // TODO: Replace with EFS when available in GA
Minor change: Changed the Gobblin Worker log file name prefix
apache_incubator-gobblin
train
java
583743c4961a862d82ae131d00e383366c68ace3
diff --git a/devices/philips.js b/devices/philips.js index <HASH>..<HASH> 100644 --- a/devices/philips.js +++ b/devices/philips.js @@ -213,7 +213,7 @@ module.exports = [ vendor: 'Philips', description: 'Hue white E12', meta: {turnsOffAtBrightness1: true}, - extend: hueExtend.light_onoff_brightness(), + extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}), ota: ota.zigbeeOTA, }, {
Add color temp for philips hue <I> (#<I>)
Koenkk_zigbee-shepherd-converters
train
js
7574bb3027376b2840048751d6378d45e190296a
diff --git a/scapy/utils.py b/scapy/utils.py index <HASH>..<HASH> 100644 --- a/scapy/utils.py +++ b/scapy/utils.py @@ -714,6 +714,7 @@ class RawPcapWriter: try: p = pkt.next() except StopIteration: + self._write_header("") return self._write_header(p) self._write_packet(p)
wrpcap() creates a valid PCAP file when called with an empty list --HG-- branch : issue-<I>
secdev_scapy
train
py
006413e379fc6e4b22f5b9a0a9b6d395fc76a6fa
diff --git a/fastlane/lib/fastlane/swift_fastlane_function.rb b/fastlane/lib/fastlane/swift_fastlane_function.rb index <HASH>..<HASH> 100644 --- a/fastlane/lib/fastlane/swift_fastlane_function.rb +++ b/fastlane/lib/fastlane/swift_fastlane_function.rb @@ -232,7 +232,7 @@ module Fastlane # Adds newlines between each documentation element. documentation = documentation_elements.flat_map { |element| [element, separator] }.tap(&:pop).join("\n") - return "/**\n#{documentation}\n*/\n" + return "/**\n#{documentation.gsub('/*', '/\\*')}\n*/\n" end def swift_parameter_documentation
[Fastlane.Swift] Sanitize Swift document comments (#<I>)
fastlane_fastlane
train
rb
5ae4564a1c35248871c22462229fda278a3c1f15
diff --git a/classes/Collector.php b/classes/Collector.php index <HASH>..<HASH> 100644 --- a/classes/Collector.php +++ b/classes/Collector.php @@ -221,6 +221,10 @@ abstract class QM_Collector { } public static function hide_qm() { + if ( ! defined( 'QM_HIDE_SELF' ) ) { + return false; + } + if ( null === self::$hide_qm ) { self::$hide_qm = QM_HIDE_SELF; }
Don't try to access `QM_HIDE_SELF` before it's defined. Fixes #<I>.
johnbillion_query-monitor
train
php
57534ef69125a7cabb5b3039696b3eee00913f71
diff --git a/dist/milsymbol.js b/dist/milsymbol.js index <HASH>..<HASH> 100644 --- a/dist/milsymbol.js +++ b/dist/milsymbol.js @@ -2728,7 +2728,7 @@ function textfields(){ } } //Land or letterbased SIDC - if(isNaN(this.SIDC) || this.properties.dimension == "Ground"){ + if(isNaN(this.SIDC) || this.properties.baseDimension == "Ground"){ gStrings.L1 = this.dtg; if(this.altitudeDepth||this.location){ a = [];
Think we should use baseDimension here and not dimension
spatialillusions_milsymbol
train
js
6d44a1349ef23f8969eeec91b0facb0adf6df52b
diff --git a/lib/arel/algebra/header.rb b/lib/arel/algebra/header.rb index <HASH>..<HASH> 100644 --- a/lib/arel/algebra/header.rb +++ b/lib/arel/algebra/header.rb @@ -4,9 +4,7 @@ module Arel def initialize(attrs = []) @attributes = attrs.to_ary - @names = Hash.new do |h,k| - h[k] = @attributes.detect { |a| a.named?(k) } - end + @names = {} end def each @@ -55,7 +53,8 @@ module Arel end def find_by_name(name) - @names[name.to_sym] + k = name.to_sym + @names[k] ||= @attributes.detect { |a| a.named?(k) } end def find_by_attribute(attr)
PERF: fewer objects, less lambdas, less memory
rails_rails
train
rb
b665d8fcf239d92278698ea1ecd5e5aaafef26b4
diff --git a/cluster.go b/cluster.go index <HASH>..<HASH> 100644 --- a/cluster.go +++ b/cluster.go @@ -703,12 +703,12 @@ func (c *ClusterClient) WithContext(ctx context.Context) *ClusterClient { if ctx == nil { panic("nil context") } - c2 := c.copy() + c2 := c.clone() c2.ctx = ctx return c2 } -func (c *ClusterClient) copy() *ClusterClient { +func (c *ClusterClient) clone() *ClusterClient { cp := *c cp.init() return &cp diff --git a/ring.go b/ring.go index <HASH>..<HASH> 100644 --- a/ring.go +++ b/ring.go @@ -381,12 +381,12 @@ func (c *Ring) WithContext(ctx context.Context) *Ring { if ctx == nil { panic("nil context") } - c2 := c.copy() + c2 := c.clone() c2.ctx = ctx return c2 } -func (c *Ring) copy() *Ring { +func (c *Ring) clone() *Ring { cp := *c return &cp }
Rename copy to clone
go-redis_redis
train
go,go
71177fe9776d8cf958ac3054885f891f49c1ef4d
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -86,10 +86,10 @@ setup( packages=find_packages(exclude=['tests', 'tests.*']), install_requires=[ - 'six>=1.10.0', - 'graphql-core>=2.0', - 'graphql-relay>=0.4.5', - 'promise>=2.1', + 'six>=1.10.0,<2', + 'graphql-core>=2.0,<3', + 'graphql-relay>=0.4.5,<1', + 'promise>=2.1,<3', ], tests_require=tests_require, extras_require={
Prevent requirement breaking changes I have a project still in <I> thats has been broken in my last release since it used `'graphql-core>=<I>'` in the `install_requires`. Since `graphql-core` has released version <I> with breaking changes and there was no instruction to maintain version 1, it was included as a dependency. This prevents this situation for the future.
graphql-python_graphene
train
py
ee3b8c49f7b0ecc5097362e4e40996abd1905f0a
diff --git a/sexpr/grammar.py b/sexpr/grammar.py index <HASH>..<HASH> 100644 --- a/sexpr/grammar.py +++ b/sexpr/grammar.py @@ -15,7 +15,6 @@ grammar_str_form = \ class Grammar(Matcher): default_options = {} - default_parser_options = {} def __init__(self, source, options = None): rules = source.get('rules', {}) @@ -27,7 +26,7 @@ class Grammar(Matcher): try: self.root = self.options.get('root', list(rules.items())[0][0]) except IndexError: - self.root = None + raise ValueError('Cannot load root node. Grammar is ill-formed.') def sexpr(self, sexpr): if isinstance(sexpr, Sexpr):
Throw ValueError if loading root rule fails
IwoHerka_sexpr
train
py
75049fdd15d5ee04343c168eedb1c2f4fd054704
diff --git a/zipline/finance/performance.py b/zipline/finance/performance.py index <HASH>..<HASH> 100644 --- a/zipline/finance/performance.py +++ b/zipline/finance/performance.py @@ -133,8 +133,6 @@ omitted). """ import logbook -import datetime -import pytz import math import numpy as np @@ -154,7 +152,6 @@ class PerformanceTracker(object): def __init__(self, sim_params): self.sim_params = sim_params - self.started_at = datetime.datetime.utcnow().replace(tzinfo=pytz.utc) self.period_start = self.sim_params.period_start self.period_end = self.sim_params.period_end @@ -230,7 +227,6 @@ class PerformanceTracker(object): Returns a dict object of the form described in header comments. """ return { - 'started_at': self.started_at, 'period_start': self.period_start, 'period_end': self.period_end, 'progress': self.progress,
MAINT: Removes unused started_at member from performance tracker.
quantopian_zipline
train
py
a65466237f42350da0b04a66268035a42eb1980e
diff --git a/lib/jitsu/commands/wizard.js b/lib/jitsu/commands/wizard.js index <HASH>..<HASH> 100644 --- a/lib/jitsu/commands/wizard.js +++ b/lib/jitsu/commands/wizard.js @@ -4,19 +4,27 @@ * (C) 2012, Nodejitsu Inc. * */ - -var fs = require('fs'), - path = require('path'), - common = require('../common'), - cpr = common.cpr, - rimraf = common.rimraf, + +var fs = require('fs'), + path = require('path'), + common = require('../common'), + cpr = common.cpr, + rimraf = common.rimraf, npmModule = require('npm'), - jitsu = require('../../jitsu'); + jitsu = require('../../jitsu'), + utile = require('utile'); var thisPath = process.cwd(); module.exports = function (callback) { + // + // Allows arbitrary amount of arguments + // + if(arguments.length) { + callback = utile.args(arguments).callback; + } + jitsu.plugins.cli.executeCommand(['help'], callback); };
[api][fix] made/added argument currying congruent in functions
nodejitsu_jitsu
train
js
187f02f8846e36f5f7cb2fca070b60a371f40575
diff --git a/termgraph.py b/termgraph.py index <HASH>..<HASH> 100755 --- a/termgraph.py +++ b/termgraph.py @@ -32,7 +32,7 @@ def main(args): # read data labels, data = read_data(args['filename']) - chart(labels, data) + chart(labels, data, args) def chart(labels, data, args):
Fix args being passed to chart
mkaz_termgraph
train
py
50a3be2118aba22554d22eaa1e7795a294bb9803
diff --git a/lib/calabash/android/device.rb b/lib/calabash/android/device.rb index <HASH>..<HASH> 100644 --- a/lib/calabash/android/device.rb +++ b/lib/calabash/android/device.rb @@ -46,7 +46,7 @@ module Calabash def test_server_responding? begin - http_client.get(HTTP::Request.new('ping')).body == 'pong' + http_client.get(HTTP::Request.new('ping'), retries: 1).body == 'pong' rescue HTTP::Error => _ false end
Android::Device: #test_server_responding? don't auto retry
calabash_calabash
train
rb
20f0d5b80ab91185c0deccd6f2e248b9223e3ec7
diff --git a/AcmeClient.php b/AcmeClient.php index <HASH>..<HASH> 100644 --- a/AcmeClient.php +++ b/AcmeClient.php @@ -82,7 +82,27 @@ class AcmeClient implements AcmeClientInterface $payload['contact'] = ['mailto:'.$email]; } - return (array) $this->requestResource('POST', ResourcesDirectory::NEW_REGISTRATION, $payload); + $response = (array) $this->requestResource('POST', ResourcesDirectory::NEW_REGISTRATION, $payload); + $links = $this->httpClient->getLastLinks(); + foreach ($links as $link) { + if ('terms-of-service' === $link['rel']) { + $agreement = substr($link[0], 1, -1); + $payload = []; + $payload['resource'] = ResourcesDirectory::REGISTRATION; + $payload['agreement'] = $agreement; + + $this->httpClient->signedRequest( + 'POST', + $this->httpClient->getLastLocation(), + $payload, + true + ); + + break; + } + } + + return $response; } /**
Automatically agreed with agrement (#<I>)
acmephp_core
train
php
f211484991e9d6697fb26e742aa567be46a06c1a
diff --git a/tasks/titanium.js b/tasks/titanium.js index <HASH>..<HASH> 100644 --- a/tasks/titanium.js +++ b/tasks/titanium.js @@ -67,14 +67,18 @@ module.exports = function(grunt) { function(callback) { return execCommand('create', createOpts, callback); }, function(callback) { + console.log(self.filesSrc); + console.log(self.files); + // copy all from "files" to destination self.files.forEach(function(fileObj) { var base = path.dirname(fileObj.orig.src), match = base.match(/^([^\*]+)/), - relPath = match ? match[1] : '.'; + relPath = match ? match[1] : '.', + dest = fileObj.dest || path.join(buildOpts.projectDir, 'Resources'); fileObj.src.forEach(function(file) { - fs.copySync(file, path.join(fileObj.dest, path.relative(relPath, file))); + fs.copySync(file, path.join(dest, path.relative(relPath, file))); }); });
process files/src from grunt config
tonylukasavage_grunt-titanium
train
js
546d202f3a7d1ac5139f5b9908c67be3d7c427e9
diff --git a/dev/FixtureBlueprint.php b/dev/FixtureBlueprint.php index <HASH>..<HASH> 100644 --- a/dev/FixtureBlueprint.php +++ b/dev/FixtureBlueprint.php @@ -129,8 +129,9 @@ class FixtureBlueprint { $parsedItems = array(); $items = preg_split('/ *, */',trim($fieldVal)); foreach($items as $item) { - // Check for correct format: =><relationname>.<identifier> - if(!preg_match('/^=>[^\.]+\.[^\.]+/', $item)) { + // Check for correct format: =><relationname>.<identifier>. + // Ignore if the item has already been replaced with a numeric DB identifier + if(!is_numeric($item) && !preg_match('/^=>[^\.]+\.[^\.]+/', $item)) { throw new InvalidArgumentException(sprintf( 'Invalid format for relation "%s" on class "%s" ("%s")', $fieldName,
Don't complain about pre-replaced YAML fixture relations
silverstripe_silverstripe-framework
train
php
402c895947e0fee85c4d59fa90f6f767a7c7ecb0
diff --git a/deblur/workflow.py b/deblur/workflow.py index <HASH>..<HASH> 100644 --- a/deblur/workflow.py +++ b/deblur/workflow.py @@ -819,15 +819,11 @@ def launch_workflow(seqs_fp, working_dir, mean_error, error_dist, # Step 1: Trim sequences to specified length output_trim_fp = join(working_dir, "%s.trim" % basename(seqs_fp)) - if trim_length > 0: - with open(output_trim_fp, 'w') as out_f: - for label, seq in trim_seqs( - input_seqs=sequence_generator(seqs_fp), - trim_len=trim_length): - out_f.write(">%s\n%s\n" % (label, seq)) - else: - # If trim length is -1, files are already trimmed - os.symlink(seqs_fp, output_trim_fp) + with open(output_trim_fp, 'w') as out_f: + for label, seq in trim_seqs( + input_seqs=sequence_generator(seqs_fp), + trim_len=trim_length): + out_f.write(">%s\n%s\n" % (label, seq)) # Step 2: Dereplicate sequences output_derep_fp = join(working_dir, "%s.derep" % basename(output_trim_fp))
Regression: trimming was possibly passing .gz files to vsearch; not adding a test as this is a removal of code which was added in this past cycle
biocore_deblur
train
py
0bf4d8c4f867a9917e522a07460ddea99bc96434
diff --git a/spead2/__init__.py b/spead2/__init__.py index <HASH>..<HASH> 100644 --- a/spead2/__init__.py +++ b/spead2/__init__.py @@ -160,8 +160,9 @@ class Descriptor(object): class Item(Descriptor): def __init__(self, *args, **kw): + value = kw.pop('value', None) super(Item, self).__init__(*args, **kw) - self._value = None + self._value = value self.version = 1 @property
Allow initial value to be provided for Item in constructor
ska-sa_spead2
train
py
b38d1a11709478e4acdd6b4cae3eede3fbfcc635
diff --git a/src/gluonnlp/data/stream.py b/src/gluonnlp/data/stream.py index <HASH>..<HASH> 100644 --- a/src/gluonnlp/data/stream.py +++ b/src/gluonnlp/data/stream.py @@ -103,19 +103,27 @@ class _LazyTransformDataStream(DataStream): def __iter__(self): stream_iter = iter(self._stream) - try: - item = next(stream_iter) - except StopIteration: - return - istuple = isinstance(item, tuple) - if istuple: - yield self._fn(*item) - for item in stream_iter: + + # Yield must be hidden in closure so that __iter__ is called before + # __next__ is called. This is important, as calling iter(self._stream) + # may trigger multi-threaded or multi-processing prefetching of the + # stream. + def _closure(): + try: + item = next(stream_iter) + except StopIteration: + return + istuple = isinstance(item, tuple) + if istuple: yield self._fn(*item) - else: - yield self._fn(item) - for item in stream_iter: + for item in stream_iter: + yield self._fn(*item) + else: yield self._fn(item) + for item in stream_iter: + yield self._fn(item) + + return _closure() class DatasetStream(DataStream):
Fix LazyTransformDataStream prefetching (#<I>)
dmlc_gluon-nlp
train
py
5d37b9f069579edb58ceed408c37d16940a9a5e3
diff --git a/lib/lhc/interceptors/throttle.rb b/lib/lhc/interceptors/throttle.rb index <HASH>..<HASH> 100644 --- a/lib/lhc/interceptors/throttle.rb +++ b/lib/lhc/interceptors/throttle.rb @@ -33,7 +33,7 @@ class LHC::Throttle < LHC::Interceptor def break_when_quota_reached! options = request.options.dig(:throttle) track = (self.class.track || {}).dig(options[:provider]) - return unless track + return if track.blank? || track[:remaining].blank? || track[:limit].blank? # avoid floats by multiplying with 100 remaining = track[:remaining] * 100 limit = track[:limit] diff --git a/spec/interceptors/throttle/main_spec.rb b/spec/interceptors/throttle/main_spec.rb index <HASH>..<HASH> 100644 --- a/spec/interceptors/throttle/main_spec.rb +++ b/spec/interceptors/throttle/main_spec.rb @@ -77,5 +77,14 @@ describe LHC::Throttle do it 'does not raise an exception' do LHC.get('http://local.ch', options) end + + context 'no remaining tracked, but break enabled' do + let(:break_option) { '90%' } + + it 'does not fail if a remaining was not tracked yet' do + LHC.get('http://local.ch', options) + LHC.get('http://local.ch', options) + end + end end end
Fix case where tacked reamining is nil (#<I>)
local-ch_lhc
train
rb,rb
3c689d5a0a722a90004a9e7815b9b15e75800131
diff --git a/scripts/importer/mtasks/berkeley.py b/scripts/importer/mtasks/berkeley.py index <HASH>..<HASH> 100644 --- a/scripts/importer/mtasks/berkeley.py +++ b/scripts/importer/mtasks/berkeley.py @@ -30,12 +30,12 @@ def do_ucb_photo(events, stubs, args, tasks, task_obj, log): photom = json.loads(jsontxt) photom = sorted(photom, key=lambda kk: kk['ObjName']) for phot in pbar(photom, desc=current_task): - name = phot['ObjName'] - events, name = add_event(tasks, args, events, name, log) + oldname = phot['ObjName'] + events, name = add_event(tasks, args, events, oldname, log) sec_source = events[name].add_source(srcname=sec_ref, url=sec_refurl, bibcode=sec_refbib, secondary=True) - events[name].add_quantity('alias', name, sec_source) + events[name].add_quantity('alias', oldname, sec_source) sources = [sec_source] if phot['Reference']: sources += [events[name].add_source(bibcode=phot['Reference'])]
MAINT: have 'berkeley' stuff store 'oldname'.
astrocatalogs_astrocats
train
py
fe4f8d1ceaf4b2f3514e83544c9d49db5d69615c
diff --git a/src/js/components/Select/Select.js b/src/js/components/Select/Select.js index <HASH>..<HASH> 100644 --- a/src/js/components/Select/Select.js +++ b/src/js/components/Select/Select.js @@ -72,9 +72,11 @@ const Select = forwardRef( messages, multiple, name, + onBlur, onChange, onClick, onClose, + onFocus, onKeyDown, onMore, onOpen, @@ -295,6 +297,8 @@ const Select = forwardRef( open={open} alignSelf={alignSelf} focusIndicator={focusIndicator} + onFocus={onFocus} + onBlur={onBlur} gridArea={gridArea} margin={margin} onOpen={onRequestOpen}
Fix: Introducing Select onBlur and onFocus (#<I>) * Select onBlur and onFocus: introduced both to select component * Small cleanup * Small syntax fix
grommet_grommet
train
js
3dc4f00fd0535d113017d6946d55365023d7e295
diff --git a/graffiti/graph/graph.go b/graffiti/graph/graph.go index <HASH>..<HASH> 100644 --- a/graffiti/graph/graph.go +++ b/graffiti/graph/graph.go @@ -103,14 +103,14 @@ type graphElement struct { // Node of the graph type Node struct { - graphElement + graphElement `mapstructure:",squash"` } // Edge of the graph linked by a parent and a child type Edge struct { - graphElement - Parent Identifier - Child Identifier + graphElement `mapstructure:",squash"` + Parent Identifier + Child Identifier } // Graph errors diff --git a/js/runtime.go b/js/runtime.go index <HASH>..<HASH> 100644 --- a/js/runtime.go +++ b/js/runtime.go @@ -392,6 +392,7 @@ func (r *Runtime) Exec(code string) (v otto.Value, err error) { return v, err } +// CallFunction takes the source of a function and evaluate it with the specifed parameters func (r *Runtime) CallFunction(source string, params ...interface{}) (otto.Value, error) { result, err := r.Exec("(" + source + ")") if err != nil { @@ -431,6 +432,7 @@ func (r *Runtime) Start() { // Stop the runtime evaluation loop func (r *Runtime) Stop() { + r.stopEventLoop <- true } // NewRuntime returns a new JavaScript runtime environment
graph: allow to use mapstructure on nodes and edges
skydive-project_skydive
train
go,go
66ec93a63fc47118a29ff0a7186badf1df54d0b9
diff --git a/Kwc/Directories/List/ViewMap/Coordinates/Component.php b/Kwc/Directories/List/ViewMap/Coordinates/Component.php index <HASH>..<HASH> 100644 --- a/Kwc/Directories/List/ViewMap/Coordinates/Component.php +++ b/Kwc/Directories/List/ViewMap/Coordinates/Component.php @@ -21,8 +21,7 @@ class Kwc_Directories_List_ViewMap_Coordinates_Component extends Kwc_Abstract_Aj ->where(new Kwf_Model_Select_Expr_Higher('longitude', $lowestLng)) ->where(new Kwf_Model_Select_Expr_Higher('latitude', $lowestLat)) ->where(new Kwf_Model_Select_Expr_Lower('longitude', $highestLng)) - ->where(new Kwf_Model_Select_Expr_Lower('latitude', $highestLat)) - ->order('name', 'ASC'); + ->where(new Kwf_Model_Select_Expr_Lower('latitude', $highestLat)); $parentComponentClass = $this->getData()->parent->componentClass; $itemDirectory = $this->getData()->parent->parent->getComponent()->getItemDirectory();
there is no sorting needed because this component shoews points on a map, sorting by name also causes an error if there is no row called map in table
koala-framework_koala-framework
train
php
7b9028bd2ea7028c11fe4e6d965c3f05215dbb77
diff --git a/sklearn_porter/Estimator.py b/sklearn_porter/Estimator.py index <HASH>..<HASH> 100644 --- a/sklearn_porter/Estimator.py +++ b/sklearn_porter/Estimator.py @@ -104,8 +104,8 @@ class Estimator(EstimatorApiABC): import BaseSearchCV # pylint: disable=protected-access except ImportError: L.warn('Your installed version of scikit-learn ' - 'v% does not support optimizers in general.', - sklearn_version) + 'v% does not support optimizers in general.', + sklearn_version) else: if isinstance(est, BaseSearchCV): L.info('Yes, the estimator is embedded in an optimizer.')
feature/oop-api-refactoring: Indent string on multiple lines correctly
nok_sklearn-porter
train
py
0776cf69576fd4c0ef06b4a02d67e13258859857
diff --git a/yotta/init.py b/yotta/init.py index <HASH>..<HASH> 100644 --- a/yotta/init.py +++ b/yotta/init.py @@ -71,4 +71,10 @@ def execCommand(args): # TODO: more questions ( bugs url,...), check that the name is available in # the registry... + # Create folders while initing + folders_to_creat = ["./source", "./test", "./" + c.getName()] + for folder_name in folders_to_creat: + if not os.path.exists(folder_name): + os.mkdir(folder_name) + c.writeDescription()
Creating folders while initing
ARMmbed_yotta
train
py
3126d36e8f29b1f494b000b8b2185d6e51067ce8
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -15,7 +15,6 @@ setup( description='User-friendly billing for communal households', long_description=open('README.rst').read() if exists("README.rst") else "", install_requires=[ - 'django>=1.8', 'django-hordak>=1.1.0', 'path.py', 'django-model-utils>=2.5.0', @@ -31,5 +30,6 @@ setup( 'six', 'python-dateutil', 'django-adminlte2>=0.1.4', + 'django>=1.8', ], )
Attempt to fix installation error (perhaps similar to <URL>)
adamcharnock_swiftwind
train
py
aeed43d4df0bc9a2baadb5e29854a6df31aa14f9
diff --git a/packages/xod-client-browser/test-func/pageObjects/PromptPopup.js b/packages/xod-client-browser/test-func/pageObjects/PromptPopup.js index <HASH>..<HASH> 100644 --- a/packages/xod-client-browser/test-func/pageObjects/PromptPopup.js +++ b/packages/xod-client-browser/test-func/pageObjects/PromptPopup.js @@ -15,7 +15,7 @@ PromptPopup.findOnPage = async page => { }; PromptPopup.waitOnPage = async page => { - await page.waitFor('.PopupPrompt', { timeout: 2000 }); + await page.waitFor('.PopupPrompt', { timeout: 5000 }); return PromptPopup.findOnPage(page); };
chore(xod-client-browser): enlarge timeout for mostly failed by timeout selector
xodio_xod
train
js
863557ca35435e04b7e8c75b01ec2abf47ee2032
diff --git a/kiali/models.py b/kiali/models.py index <HASH>..<HASH> 100644 --- a/kiali/models.py +++ b/kiali/models.py @@ -3,7 +3,7 @@ from kiali.client import ApiObject class Data (ApiObject): __slots__ = [ 'id', "source", 'target', 'version', 'text', 'color', 'style', 'rate', 'service', 'group_by', - "is_root", "is_circuit_breaker", "flag_circuit_breaker" + "is_root", "has_CB" ] def __repr__(self): diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ from distutils.core import setup setup(name='kiali-client', packages=['kiali'], - version='0.3.5', + version='0.3.6', description='Python client to communicate with Kiali server over HTTP(S)', author='Guilherme Baufaker Rego', author_email='[email protected]',
Updating Client to <I>
kiali_kiali-client-python
train
py,py
c68065463fb590bff3b9166210b2ba2b7679e603
diff --git a/openquake/calculators/base.py b/openquake/calculators/base.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/base.py +++ b/openquake/calculators/base.py @@ -664,11 +664,11 @@ class HazardCalculator(BaseCalculator): logging.info('Computing hazard maps for PoEs=%s', oq.poes) with mon: N = len(self.sitecol.complete) - ct = oq.concurrent_tasks + ct = oq.concurrent_tasks or 1 if 'hcurves' in self.datastore: kinds = self.datastore['hcurves'] hmaps_dt = numpy.dtype( - [('%s-%s' % (imt, poe), float) + [('%s-%s' % (imt, poe), F32) for imt in oq.imtls for poe in oq.poes]) for kind in kinds: self.datastore.create_dset(
Parallelized save_hmaps [skip hazardlib][demos] Former-commit-id: e<I>c7f9bc4d<I>f<I>e<I>b0b8c3ce9acb8bb<I>c
gem_oq-engine
train
py
92beb556a9fe185b502038a78d7ed2d8b97ef0c7
diff --git a/gcloud/storage/connection.py b/gcloud/storage/connection.py index <HASH>..<HASH> 100644 --- a/gcloud/storage/connection.py +++ b/gcloud/storage/connection.py @@ -414,13 +414,7 @@ class Connection(_Base): if isinstance(bucket, Bucket): return bucket - # Support Python 2 and 3. - try: - string_type = six.string_types - except NameError: # pragma: NO COVER PY3k - string_type = str - - if isinstance(bucket, string_type): + if isinstance(bucket, six.string_types): return Bucket(connection=self, name=bucket) raise TypeError('Invalid bucket: %s' % bucket)
No need for 'try: ... except:' when we have 'six'.
googleapis_google-cloud-python
train
py
9e6f132844b9f29d7c9846c364f8fa3a31be6205
diff --git a/src/typeahead/typeahead.js b/src/typeahead/typeahead.js index <HASH>..<HASH> 100644 --- a/src/typeahead/typeahead.js +++ b/src/typeahead/typeahead.js @@ -325,7 +325,7 @@ var Typeahead = (function() { .val('') .removeData() .addClass('tt-hint') - .removeAttr('id name placeholder') + .removeAttr('id name placeholder required') .prop('disabled', true) .attr({ autocomplete: 'off', spellcheck: 'false' });
Remove required attribute from hint. Closes #<I>.
twitter_typeahead.js
train
js
0f36257cf98eb14e11b79a86626514d3c53c949a
diff --git a/app/assets/javascripts/foreman_proxmox/proxmox.js b/app/assets/javascripts/foreman_proxmox/proxmox.js index <HASH>..<HASH> 100644 --- a/app/assets/javascripts/foreman_proxmox/proxmox.js +++ b/app/assets/javascripts/foreman_proxmox/proxmox.js @@ -35,9 +35,7 @@ function cdromSelected(item) { }, success: function(isos) { $('#host_compute_attributes_config_attributes_cdrom_iso').empty(); - console.log('isos='+isos); $.each(isos, function(i,iso){ - console.log('iso='+iso); $('#host_compute_attributes_config_attributes_cdrom_iso').append($("<option></option>").val(iso.volid).text(iso.volid)); }); }
Refactor Remove unnecessary debug logs
theforeman_foreman_fog_proxmox
train
js
7d5d390a271a5069600cf990d7e1ee1ff50c712a
diff --git a/lib/rtkit/cr_series.rb b/lib/rtkit/cr_series.rb index <HASH>..<HASH> 100644 --- a/lib/rtkit/cr_series.rb +++ b/lib/rtkit/cr_series.rb @@ -57,7 +57,7 @@ module RTKIT super(series_uid, 'CR', study, options) # Default attributes: @images = Array.new - @image_uids = Hash.new + @associated_images = Hash.new # Register ourselves with the study: @study.add_series(self) end @@ -94,7 +94,7 @@ module RTKIT def add_image(image) raise ArgumentError, "Invalid argument 'image'. Expected Image, got #{image.class}." unless image.is_a?(Image) @images << image - @image_uids[image.uid] = image + @associated_images[image.uid] = image end # Computes a hash code for this object. @@ -118,7 +118,7 @@ module RTKIT def image(*args) raise ArgumentError, "Expected one or none arguments, got #{args.length}." unless [0, 1].include?(args.length) if args.length == 1 - return @image_uids[args.first] + return @associated_images[args.first] else # No argument used, therefore we return the first Image instance: return @images.first
Rename a class variable This makes it equal to that of of the RTImage class.
dicom_rtkit
train
rb
83ec58e46b8f37ea17703123e7b9901fea7363b8
diff --git a/lib/dill/widget.rb b/lib/dill/widget.rb index <HASH>..<HASH> 100644 --- a/lib/dill/widget.rb +++ b/lib/dill/widget.rb @@ -219,7 +219,7 @@ module Dill # Compares the current widget with +value+, waiting for the comparison # to return +true+. def ==(value) - wait_for { cast_to(value) == value } + wait_for { cast_to_type_of(value) == value } end # Calls +=~+ on this widget's text content. @@ -235,7 +235,7 @@ module Dill # Compares the current widget with +value+, waiting for the comparison # to return +false+. def !=(value) - wait_for { cast_to(value) != value } + wait_for { cast_to_type_of(value) != value } end def checkpoint(wait_time) @@ -340,7 +340,7 @@ module Dill protected - def cast_to(value) + def cast_to_type_of(value) case value when Float to_f
[widget] Clarify method name.
mojotech_capybara-ui
train
rb
d67ed6daa2ddaf0fd08ab07c5cfe8fe34c484fa3
diff --git a/lib/openscap/version.rb b/lib/openscap/version.rb index <HASH>..<HASH> 100644 --- a/lib/openscap/version.rb +++ b/lib/openscap/version.rb @@ -10,5 +10,5 @@ # module OpenSCAP - VERSION = '0.4.0' + VERSION = '0.4.1' end
ruby-openscap-<I> - Rubocop fixes - Allows for bzip2ed memory to be used as OpenSCAP::Source - requires OpenSCAP-<I> base package
OpenSCAP_ruby-openscap
train
rb
5d6a2e6a5e1053be2648406b09187f38b6cba5d6
diff --git a/domaintools_async/__init__.py b/domaintools_async/__init__.py index <HASH>..<HASH> 100644 --- a/domaintools_async/__init__.py +++ b/domaintools_async/__init__.py @@ -1,8 +1,6 @@ """Adds async capabilities to the base product object""" import asyncio -import aiohttp from httpx import AsyncClient -import ssl from domaintools.base_results import Results diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ from os import path from setuptools import Extension, find_packages, setup from setuptools.command.test import test as TestCommand -requires = ['requests', 'aiohttp', 'dateparser'] +requires = ['httpx', 'dateparser'] packages = ['domaintools', 'domaintools_async'] diff --git a/tox.ini b/tox.ini index <HASH>..<HASH> 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,7 @@ passenv=TEST_USER TEST_KEY deps= pytest pytest-cov - requests + httpx vcrpy . commands=py.test --capture=sys --cov domaintools tests
Remove some unused imports and modify dependencies.
DomainTools_python_api
train
py,py,ini
8793d69a708e5f9458d9c78ace93129dc9a8db2a
diff --git a/lib/growl/growl.rb b/lib/growl/growl.rb index <HASH>..<HASH> 100644 --- a/lib/growl/growl.rb +++ b/lib/growl/growl.rb @@ -1,4 +1,3 @@ - module Growl @@path = 'growlnotify' @@ -212,6 +211,7 @@ module Growl switch :port switch :auth switch :crypt + switch :url end
Add url switch Adding the url switch allows for Growl.url to be called. What this brings is the ability to link a notification to a specific url in the notification itself.
tj_growl
train
rb
8544a13efa382f11bebf37baa011a80c1294ca17
diff --git a/thinc/api.py b/thinc/api.py index <HASH>..<HASH> 100644 --- a/thinc/api.py +++ b/thinc/api.py @@ -12,7 +12,7 @@ from .util import to_categorical, get_width, xp2torch, torch2xp from .backends import get_ops, set_current_ops, get_current_ops, use_device from .backends import Ops, CupyOps, NumpyOps -from .layers import Affine, Dropout, Embed, ExtractWindow, HashEmbed, LayerNorm +from .layers import Affine, CauchySimilarity, Dropout, Embed, ExtractWindow, HashEmbed, LayerNorm from .layers import Maxout, Mish, MultiSoftmax, ReLu, Residual, Softmax, BiLSTM, LSTM from .layers import add, bidirectional, chain, clone, concatenate, foreach, noop
add CauchySimilarity also to api
explosion_thinc
train
py
24bf62bf4c21816962fc20aa129d0b8350b347e7
diff --git a/lib/interceptor.js b/lib/interceptor.js index <HASH>..<HASH> 100644 --- a/lib/interceptor.js +++ b/lib/interceptor.js @@ -10,7 +10,7 @@ const parserFactory = require('./data-processor-row'); */ class RowProcessorInterceptor extends Interceptor { - constructor(endpoint, config) { + constructor(config, endpoint) { super(endpoint, config); // just validate the config once
fix(constructor): Changed the order of config, and endpoint
Kronos-Integration_kronos-interceptor-object-data-processor-row
train
js
b379e5fdbeca67b9bad1f0762dc0ccacc9115b9c
diff --git a/satpy/scene.py b/satpy/scene.py index <HASH>..<HASH> 100644 --- a/satpy/scene.py +++ b/satpy/scene.py @@ -1522,12 +1522,11 @@ def _check_file_protocols_for_dicts(filenames): def _check_file_protocols(filenames): local_files, remote_files, fs_files = _sort_files_to_local_remote_and_fsfiles(filenames) - try: - new_fs_files = _filenames_to_fsfile(remote_files) - except ImportError: - return filenames - return local_files + fs_files + new_fs_files + if remote_files: + return local_files + fs_files + _filenames_to_fsfile(remote_files) + + return local_files + fs_files def _sort_files_to_local_remote_and_fsfiles(filenames):
Let import error stop processing when remote files can't be handled
pytroll_satpy
train
py
63fd88ca5c255a84b61ce81c41dfe9928ea101d9
diff --git a/activerecord/lib/active_record/associations/has_many_association.rb b/activerecord/lib/active_record/associations/has_many_association.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/associations/has_many_association.rb +++ b/activerecord/lib/active_record/associations/has_many_association.rb @@ -41,6 +41,14 @@ module ActiveRecord end end + def empty? + if has_cached_counter? + size.zero? + else + super + end + end + private # Returns the number of records in this collection. diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -807,6 +807,13 @@ class HasManyAssociationsTest < ActiveRecord::TestCase end end + def test_calling_empty_with_counter_cache + post = posts(:welcome) + assert_queries(0) do + assert_not post.comments.empty? + end + end + def test_custom_named_counter_cache topic = topics(:first)
If a counter_cache exists, use it for #empty?
rails_rails
train
rb,rb
5f988e66d2f31af79d39f23614b0d47b52f0c887
diff --git a/spyder/plugins/editor/plugin.py b/spyder/plugins/editor/plugin.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/editor/plugin.py +++ b/spyder/plugins/editor/plugin.py @@ -888,15 +888,12 @@ class Editor(SpyderPluginWidget): self.main.debug_toolbar_actions += debug_toolbar_actions # ---- Source menu/toolbar construction ---- - source_menu_actions = [eol_menu, - showblanks_action, + source_menu_actions = [showblanks_action, scrollpastend_action, showindentguides_action, show_classfunc_dropdown_action, showcode_analysis_pep8_action, show_docstring_warnings_action, - trailingspaces_action, - fixindentation_action, MENU_SEPARATOR, self.todo_list_action, self.warning_list_action, @@ -905,7 +902,11 @@ class Editor(SpyderPluginWidget): MENU_SEPARATOR, self.previous_edit_cursor_action, self.previous_cursor_action, - self.next_cursor_action] + self.next_cursor_action, + MENU_SEPARATOR, + eol_menu, + trailingspaces_action, + fixindentation_action] self.main.source_menu_actions += source_menu_actions source_toolbar_actions = [self.todo_list_action,
Editor: Reorganize Source menu a bit
spyder-ide_spyder
train
py
66273227df6389e5393e504d1db5d16ccd3b1c08
diff --git a/recipe/shelf.py b/recipe/shelf.py index <HASH>..<HASH> 100644 --- a/recipe/shelf.py +++ b/recipe/shelf.py @@ -36,11 +36,11 @@ def ingredient_from_validated_dict(ingr_dict, selectable): return InvalidIngredient(error=error) except VisitError as e: # Lark returns the InvalidColumnError wrapped in a VisitError - if isinstance(e.__context__, InvalidColumnError): + if isinstance(e.orig_exc, InvalidColumnError): # custom exception handling error = { "type": "invalid_column", - "extra": {"column_name": e.__context__.column_name}, + "extra": {"column_name": e.orig_exc.column_name}, } return InvalidIngredient(error=error) else:
user VisitError.orig_exc
juiceinc_recipe
train
py
1e31d1e6277553c54ad524581d3c6bed0016766c
diff --git a/scripts/reenroller.rb b/scripts/reenroller.rb index <HASH>..<HASH> 100644 --- a/scripts/reenroller.rb +++ b/scripts/reenroller.rb @@ -41,6 +41,7 @@ module RightScale # === Return # true:: Always return true def run(options) + check_privileges AgentConfig.root_dir = AgentConfig.right_link_root_dirs if RightScale::Platform.windows? @@ -81,10 +82,6 @@ module RightScale res = system("/etc/init.d/rightlink #{action} > /dev/null") end true - rescue Errno::EACCES => e - STDERR.puts e.message - STDERR.puts "Try elevating privilege (sudo/runas) before invoking this command." - exit(2) end # Create options hash from command line arguments @@ -149,7 +146,7 @@ module RightScale rescue Errno::ESRCH false end - + # Version information # # === Return
acu<I> make rs_reenroll to check privileges before doing anything
rightscale_right_link
train
rb
37edeb06b23b4806ee7e7fd7a88bbaaf316a1f62
diff --git a/pyrogram/__init__.py b/pyrogram/__init__.py index <HASH>..<HASH> 100644 --- a/pyrogram/__init__.py +++ b/pyrogram/__init__.py @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see <http://www.gnu.org/licenses/>. -__version__ = "1.0.0b2" +__version__ = "1.0.0" __license__ = "GNU Lesser General Public License v3 or later (LGPLv3+)" __copyright__ = "Copyright (C) 2017-2020 Dan <https://github.com/delivrance>"
Update Pyrogram to <I>
pyrogram_pyrogram
train
py
56d3ba5568a8df488305d64b3824fa59a668eacd
diff --git a/latinol/latinol.py b/latinol/latinol.py index <HASH>..<HASH> 100644 --- a/latinol/latinol.py +++ b/latinol/latinol.py @@ -13,7 +13,7 @@ RULES = ((ur'cc', ur'ks'), (ur'qu([eiéí])', ur'k\1'), (ur'ü', ur'u'), (ur'q([aouáóú])', ur'k\1'), - (ur'w', ur'gu'), + (ur'w(\S|.|$)', ur'gu\1'), (ur'y([^aeiouáóúéí]|$)', ur'i\1'))
fix capitalization for w => gu
hso_latinol.py
train
py
03f298e9772fe55ccd59a0c32f900ba0f6bfabba
diff --git a/lib/core/engine/iteration.js b/lib/core/engine/iteration.js index <HASH>..<HASH> 100644 --- a/lib/core/engine/iteration.js +++ b/lib/core/engine/iteration.js @@ -105,6 +105,8 @@ class Iteration { if (recordVideo && !combine) { await setOrangeBackground(browser.getDriver()); await video.record(); + // Give ffmpeg some time to settle + await Promise.delay(400); } await browser.loadAndWait(url, options.pageCompleteCheck);
Give ffmpeg some extra time before we start
sitespeedio_browsertime
train
js
e78ca0f575b0169e88706a1cab414903116edbcb
diff --git a/salt/client/__init__.py b/salt/client/__init__.py index <HASH>..<HASH> 100644 --- a/salt/client/__init__.py +++ b/salt/client/__init__.py @@ -1054,6 +1054,10 @@ class LocalClient(object): if raw['data']['return'] == {}: continue + if 'return' in raw['data']['return'] and \ + raw['data']['return']['return'] == {}: + continue + # if we didn't originally target the minion, lets add it to the list if raw['data']['id'] not in minions: minions.add(raw['data']['id'])
Fixing a weird edge case when using salt syndics and targetting via pillar. Without this fix the master of masters ends up in an infinite loop since the data returned from the minions is differently structured than if a sync was not in use. (#<I>)
saltstack_salt
train
py
4170f0ecf2419f7d940c11477d45da3894f2cd37
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -150,6 +150,7 @@ def CDF_build(self, ppath): 'OS=' + os_name, 'ENV=' + env_name, 'CURSES=no', + 'SHARED=no', 'UCOPTIONS=-Dsingle_underscore', 'all',] cmd2 = ['make',
Trying to get build working on Travis CI
rstoneback_pysatCDF
train
py
7aeb46467a12ef2dd7e1f4799119d86f39ee48ff
diff --git a/commands/authenticate.go b/commands/authenticate.go index <HASH>..<HASH> 100644 --- a/commands/authenticate.go +++ b/commands/authenticate.go @@ -100,9 +100,11 @@ func (cmd *Authenticate) Handle(mechanisms map[string]sasl.Server, conn Authenti return err } - scanner.Scan() - if err := scanner.Err(); err != nil { - return err + if !scanner.Scan() { + if err := scanner.Err(); err != nil { + return err + } + return errors.New("unexpected EOF") } encoded = scanner.Text()
commands: Properly handle EOF in Authenticate.Handle scanner.Scan returns false but scanner.Err returns nil in case of EOF.
emersion_go-imap
train
go
987aa218839d557b27675953b46b1dcc387b04b0
diff --git a/datasource/configdrive/configdrive.go b/datasource/configdrive/configdrive.go index <HASH>..<HASH> 100644 --- a/datasource/configdrive/configdrive.go +++ b/datasource/configdrive/configdrive.go @@ -69,7 +69,9 @@ func (cd *configDrive) FetchMetadata() (metadata datasource.Metadata, err error) metadata.SSHPublicKeys = m.SSHAuthorizedKeyMap metadata.Hostname = m.Hostname - metadata.NetworkConfig, err = cd.tryReadFile(path.Join(cd.openstackRoot(), m.NetworkConfig.ContentPath)) + if m.NetworkConfig.ContentPath != "" { + metadata.NetworkConfig, err = cd.tryReadFile(path.Join(cd.openstackRoot(), m.NetworkConfig.ContentPath)) + } return }
configdrive: check the network config path Check to make sure that a network config path has been specified before trying to read from it. Otherwise, it will end up trying to read a directory.
coreos_coreos-cloudinit
train
go
29fe235035f3927c5d6af74ee132d0ea7bf65071
diff --git a/lib/headerNameSpecialCases.js b/lib/headerNameSpecialCases.js index <HASH>..<HASH> 100644 --- a/lib/headerNameSpecialCases.js +++ b/lib/headerNameSpecialCases.js @@ -70,10 +70,11 @@ module.exports = { 'x-att-deviceid': 'X-ATT-DeviceId', 'x-cdn': 'X-CDN', 'x-csa-complaints': 'x-csa-complaints', - 'x-ua-compatible': 'X-UA-Compatible', + 'x-originating-ip': 'X-Originating-IP', 'x-riferimento-message-id': 'X-Riferimento-Message-ID', 'x-sg-eid': 'X-SG-EID', 'x-tiporicevuta': 'X-TipoRicevuta', + 'x-ua-compatible': 'X-UA-Compatible', 'x-verificasicurezza': 'X-VerificaSicurezza', 'x-xss-protection': 'X-XSS-Protection' };
Added special case for X-Original-IP header name.
papandreou_messy
train
js
28fb571ccd3b8451741c806428bef23726d87e92
diff --git a/sendbeacon.js b/sendbeacon.js index <HASH>..<HASH> 100755 --- a/sendbeacon.js +++ b/sendbeacon.js @@ -12,7 +12,7 @@ function polyfill() { }; function sendBeacon(url, data) { - const event = this.event && this.event.type; + const event = this.event && this.event.type ? this.event.type : this.event; const sync = event === 'unload' || event === 'beforeunload'; const xhr = ('XMLHttpRequest' in this) ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
fix: so that sync will not always be false the old state makes sync always false because the value for event will always be true/false not 'unload' or 'beforeunload'
miguelmota_Navigator.sendBeacon
train
js
207b0062f8c56f1d9f6498b0787868c04ef23e78
diff --git a/src/spec.js b/src/spec.js index <HASH>..<HASH> 100644 --- a/src/spec.js +++ b/src/spec.js @@ -14,5 +14,5 @@ * limitations under the License. */ -var testContext = require.context('.', true, /\.spec\.ts/); +var testContext = require.context('.', true, /\.spec\.ts$/); testContext.keys().map(testContext);
chore: use better regular expression for unit test paths
google_neuroglancer
train
js
fa5d8bbc46bc2dde67fbb83f3b7407a319c80361
diff --git a/cassandra/connection.py b/cassandra/connection.py index <HASH>..<HASH> 100644 --- a/cassandra/connection.py +++ b/cassandra/connection.py @@ -374,6 +374,8 @@ class Connection(object): @defunct_on_error def _handle_options_response(self, options_response): + if self.is_defunct: + return log.debug("Received options response on new Connection from %s" % self.host) self.supported_cql_versions = options_response.cql_versions self.remote_supported_compressions = options_response.options['COMPRESSION'] @@ -410,6 +412,8 @@ class Connection(object): @defunct_on_error def _handle_startup_response(self, startup_response): + if self.is_defunct: + return if isinstance(startup_response, ReadyMessage): log.debug("Got ReadyMessage on new Connection from %s" % self.host) if self._compressor:
Prevent infinite loop when errored on initial connection
datastax_python-driver
train
py
d0a42c2bcee75a5c9db590141336c02bb83dd796
diff --git a/src/kff.BindingView.js b/src/kff.BindingView.js index <HASH>..<HASH> 100644 --- a/src/kff.BindingView.js +++ b/src/kff.BindingView.js @@ -676,7 +676,8 @@ kff.BindingView = kff.createClass( filterModel = this.collectionFilter.model || null; filterFnName = this.collectionFilter.fn; - a = this.collectionBinder.collection.array; + if(this.collectionBinder.collection instanceof kff.Collection) a = this.collectionBinder.collection.array; + else if(this.collectionBinder.collection instanceof Array) a = this.collectionBinder.collection; for(i = 0, l = a.length; i < l; i++) { item = a[i];
fix(kff.BindingView): filtered collection binding doesn't work with plain array
karfcz_kff
train
js
efe13861b40244e5304800b50322cf52848bbe46
diff --git a/lib/cucumber_analytics/version.rb b/lib/cucumber_analytics/version.rb index <HASH>..<HASH> 100644 --- a/lib/cucumber_analytics/version.rb +++ b/lib/cucumber_analytics/version.rb @@ -1,3 +1,3 @@ module CucumberAnalytics - VERSION = '1.5.2' + VERSION = '1.6.0' end
Version bump. Incremented the gem version to <I> in preparation for the upcoming release.
enkessler_cucumber_analytics
train
rb
c5ff224db2e91184523dd86da708f91efa0dd73d
diff --git a/src/sap.ui.core/src/sap/ui/base/ManagedObjectMetadata.js b/src/sap.ui.core/src/sap/ui/base/ManagedObjectMetadata.js index <HASH>..<HASH> 100644 --- a/src/sap.ui.core/src/sap/ui/base/ManagedObjectMetadata.js +++ b/src/sap.ui.core/src/sap/ui/base/ManagedObjectMetadata.js @@ -766,6 +766,7 @@ function( // as oClassInfo is volatile, we need to store the info this._oDesignTime = oClassInfo.metadata["designtime"] || oClassInfo.metadata["designTime"]; + this._sProvider = oClassInfo.metadata["provider"]; if ( oClassInfo.metadata.__version > 1.0 ) { this.generateAccessors(); @@ -792,6 +793,7 @@ function( this._sDefaultAggregation = this._sDefaultAggregation || oParent._sDefaultAggregation; this._sDefaultProperty = this._sDefaultProperty || oParent._sDefaultProperty; this._mAllSpecialSettings = jQuery.extend({}, oParent._mAllSpecialSettings, this._mSpecialSettings); + this._sProvider = this._sProvider || oParent._sProvider; } else { this._mAllEvents = this._mEvents; this._mAllProperties = this._mProperties;
[INTERNAL] ManagedObject: Possibility to use own provider class Change-Id: If<I>ca3bfb<I>f<I>bfadf1fb1bf9cafade7b<I>
SAP_openui5
train
js
cca310be62c302295b3713e4bbcab3442136abc4
diff --git a/provisioning/src/main/java/org/wildfly/build/StandaloneAetherArtifactFileResolver.java b/provisioning/src/main/java/org/wildfly/build/StandaloneAetherArtifactFileResolver.java index <HASH>..<HASH> 100644 --- a/provisioning/src/main/java/org/wildfly/build/StandaloneAetherArtifactFileResolver.java +++ b/provisioning/src/main/java/org/wildfly/build/StandaloneAetherArtifactFileResolver.java @@ -119,8 +119,8 @@ public class StandaloneAetherArtifactFileResolver extends AetherArtifactFileReso */ public static List<RemoteRepository> getStandardRemoteRepositories() { final List<RemoteRepository> remoteRepositories = new ArrayList<>(); - remoteRepositories.add(new RemoteRepository.Builder("central","default","http://central.maven.org/maven2/").build()); - remoteRepositories.add(new RemoteRepository.Builder("jboss-community-repository", "default", "http://repository.jboss.org/nexus/content/groups/public/").build()); + remoteRepositories.add(new RemoteRepository.Builder("central","default","https://central.maven.org/maven2/").build()); + remoteRepositories.add(new RemoteRepository.Builder("jboss-community-repository", "default", "https://repository.jboss.org/nexus/content/groups/public/").build()); return remoteRepositories; } }
[WFBUILD-<I>] Use https URLs for standard remote repositories
wildfly_wildfly-build-tools
train
java
a489edd91bebc6fce0b0aaf8a78de4f02538abba
diff --git a/jsonapi/resource.py b/jsonapi/resource.py index <HASH>..<HASH> 100644 --- a/jsonapi/resource.py +++ b/jsonapi/resource.py @@ -107,9 +107,9 @@ class Resource(object): for field in model._meta.fields: if field.rel and field.rel.multiple: # relationship is ForeignKey - if field.rel.to in model_resource_map: + related_model = field.rel.to + if related_model in model_resource_map: # there is resource for related model - related_model = field.rel.to related_resource = model_resource_map[related_model] fields[related_resource.Meta.name] = { "type": Resource.FIELD_TYPES.TO_ONE,
unify method (make similar to method with the same functionality)
pavlov99_jsonapi
train
py
91f6c2afe0e2bfd7d2970f22d3f169523f3711f2
diff --git a/tests/example_spec.js b/tests/example_spec.js index <HASH>..<HASH> 100644 --- a/tests/example_spec.js +++ b/tests/example_spec.js @@ -403,7 +403,7 @@ describe('Kitchen Sink [000]', function(){ }) - it('cy.uncheck() - uncheck a checkbox or radio element [00k]', function(){ + it('cy.uncheck() - uncheck a checkbox element [00k]', function(){ // SOME OF THESE ARE COMMENTED OUT DUE TO AN // ERROR CURRENTLY IN CYPRESS @@ -421,7 +421,7 @@ describe('Kitchen Sink [000]', function(){ // **** Check Value **** // // cy.uncheck() accepts a value argument - // that unchecks only checkboxes or radios + // that unchecks only checkboxes // with matching values // // cy.get('.action-check [type='checkbox']').check('checkbox1').uncheck('checkbox1').should('not.be.checked')
removed radio el's from cy.uncheck description.
cypress-io_cypress-example-kitchensink
train
js
f15cfa08c1a02a776eeb9f90c7d24590c1ab9cdf
diff --git a/repository/upload/repository.class.php b/repository/upload/repository.class.php index <HASH>..<HASH> 100755 --- a/repository/upload/repository.class.php +++ b/repository/upload/repository.class.php @@ -13,7 +13,8 @@ class repository_upload extends repository { global $SESSION, $action, $CFG; parent::__construct($repositoryid, $context, $options); if($action=='upload'){ - $this->info = repository_store_to_filepool('repo_upload_file'); + $filepath = '/'.uniqid().'/'; + $this->info = repository_store_to_filepool('repo_upload_file', 'user_draft', $filepath); } }
"MDL-<I>, use a random path for uploaded file"
moodle_moodle
train
php
9e054ce3b9f444470c2f1fab55eb9ae1557c8e61
diff --git a/widgets/TbButtonGroup.php b/widgets/TbButtonGroup.php index <HASH>..<HASH> 100644 --- a/widgets/TbButtonGroup.php +++ b/widgets/TbButtonGroup.php @@ -115,6 +115,7 @@ class TbButtonGroup extends CWidget 'items'=>isset($button['items']) ? $button['items'] : array(), 'ajaxOptions'=>isset($button['ajaxOptions']) ? $button['ajaxOptions'] : array(), 'htmlOptions'=>isset($button['htmlOptions']) ? $button['htmlOptions'] : array(), + 'dropdownOptions'=>isset($button['dropdownOptions']) ? $button['dropdownOptions'] : array(), 'encodeLabel'=>isset($button['encodeLabel']) ? $button['encodeLabel'] : $this->encodeLabel, )); }
added possibility to set dropdownOptions for TbButtonGroup (Issue #<I>)
clevertech_YiiBooster
train
php
7aefd0cbdbc01aa344c5b2f3261734c4a2afe313
diff --git a/transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java b/transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java index <HASH>..<HASH> 100644 --- a/transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java +++ b/transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java @@ -39,7 +39,7 @@ import java.util.Map; * <p>When not used in a {@link ServerBootstrap} context, the {@link #bind()} methods are useful for connectionless * transports such as datagram (UDP).</p> */ -abstract class AbstractBootstrap<B extends AbstractBootstrap<B, C>, C extends Channel> implements Cloneable { +public abstract class AbstractBootstrap<B extends AbstractBootstrap<B, C>, C extends Channel> implements Cloneable { private volatile EventLoopGroup group; private volatile ChannelFactory<? extends C> channelFactory;
Make AbstractBootstrap public .. to work around the issue with JDK reflection described here: <URL>
netty_netty
train
java
abe0f9098a08d5c59a5e34a61919186b5dad864a
diff --git a/plugins/remark.js b/plugins/remark.js index <HASH>..<HASH> 100644 --- a/plugins/remark.js +++ b/plugins/remark.js @@ -16,6 +16,21 @@ class Remark { typeof remark === 'object' && typeof slideshow === 'object'); } + async configure() { + await this.page.emulateMedia(null); + await this.page.evaluate(_ => { + for (let j = 0; j < document.styleSheets.length; j++) { + const sheet = document.styleSheets[j]; + if (!sheet.rules) continue; + for (let i = sheet.rules.length - 1; i >= 0; i--) { + if (sheet.rules[i].cssText.indexOf('@media print') >= 0) { + sheet.deleteRule(i); + } + } + } + }); + } + slideCount() { return this.page.evaluate(_ => slideshow.getSlideCount()); }
Work-around Remark rendering issue with screen media emulation
astefanutti_decktape
train
js
1710f2378d9a72d68c7c2f8a8e9ad9a4824da83d
diff --git a/examples/LedControlExample.js b/examples/LedControlExample.js index <HASH>..<HASH> 100644 --- a/examples/LedControlExample.js +++ b/examples/LedControlExample.js @@ -36,7 +36,7 @@ function loop() { } function loop2() { lc2.clearDisplay(); - lc2.showNumber(0, (Date.now()-startTime)/20, 0, 3, false, 3, true) + lc2.showNumber(0, (Date.now()-startTime)/20, 1, 4, false, 3, true) lc2.showNumber(0, (Date.now()-startTime)/100, 0, 3, false, 7, true); if(Date.now()-startTime>100000) startTime = Date.now();
added ! to characters, updated package with node version number, optimised number conversions
sebleedelisle_rpi-led-control
train
js
bd2109dfc39ec7c4f146ca70c6af52e32b669d34
diff --git a/mod/assignment/simpletest/test_assignment_portfolio_callers.php b/mod/assignment/simpletest/test_assignment_portfolio_callers.php index <HASH>..<HASH> 100644 --- a/mod/assignment/simpletest/test_assignment_portfolio_callers.php +++ b/mod/assignment/simpletest/test_assignment_portfolio_callers.php @@ -18,7 +18,7 @@ class testAssignmentPortfolioCallers extends portfoliolib_test { parent::setUp(); $assignment_types = new stdClass(); $assignment_types->type = GENERATOR_SEQUENCE; - $assignment_types->options = array('upload'); + $assignment_types->options = array('online'); $settings = array('quiet' => 1, 'modules_list' => array($this->module_type), 'assignment_grades' => true,
MDL-<I>: assignment portfolio unit tests should not try and use file-ish assignment types yet
moodle_moodle
train
php
e72dda571371b891c26e6e11885be154cbe4aae3
diff --git a/jupyter-js-widgets/src/utils.js b/jupyter-js-widgets/src/utils.js index <HASH>..<HASH> 100644 --- a/jupyter-js-widgets/src/utils.js +++ b/jupyter-js-widgets/src/utils.js @@ -186,7 +186,7 @@ function typeset(element, text) { */ var escape_html = function(text) { var esc = document.createElement('div'); - esc.innerHTML = text; + esc.textContent = text; return esc.innerHTML; };
Update escape_html function to return HTML character entity encoded characters based on input.
jupyter-widgets_ipywidgets
train
js
e471fc6c9daaa50eab10b58f9a71594239222ec3
diff --git a/version.php b/version.php index <HASH>..<HASH> 100644 --- a/version.php +++ b/version.php @@ -29,11 +29,11 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2014041700.01; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2014042200.00; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes. -$release = '2.7beta+ (Build: 20140417)'; // Human-friendly version name +$release = '2.7beta+ (Build: 20140422)'; // Human-friendly version name $branch = '27'; // This version's branch. $maturity = MATURITY_BETA; // This version's maturity level.
on-demand release <I>beta+
moodle_moodle
train
php
425c8f2146ca19d25820755935b1f00efed3d218
diff --git a/lib/watch.js b/lib/watch.js index <HASH>..<HASH> 100644 --- a/lib/watch.js +++ b/lib/watch.js @@ -140,7 +140,7 @@ module.exports = function(chrome) { log('Hot reloading', file) chrome.send('Runtime.evaluate', { expression: updateSrc(file) }) - .then(Promise.all(Array.from(chrome.styles.values()).map(style => { + .then(() => Promise.all(Array.from(chrome.styles.values()).map(style => { const string = style.text.split(file).join(file.split('?')[0] + '?' + Date.now()) if (string !== style.text) {
then takes a function, if not Promise.all runs first
porsager_wright
train
js
bf4a365fd0e13985956a840a9789b6f964cc4934
diff --git a/events/observer.js b/events/observer.js index <HASH>..<HASH> 100644 --- a/events/observer.js +++ b/events/observer.js @@ -140,7 +140,7 @@ sb.events.observer = { //handle keypresses this.documentKeyPress = sb.events.add(document, 'keypress', this.delegateEvents); - if(sb.browser.agent === 'ie' && sb.browser.version < 8){ + if(sb.browser.agent === 'ie' && sb.browser.version < 9){ this.handleIEEventBubbles(); }
event observer handles IE bubble events for change and submit even with IE 8, not needed for 9+
surebert_surebert-framework
train
js
de4543ecb4c615527294002f0de1bb47667d2fa9
diff --git a/client/index.js b/client/index.js index <HASH>..<HASH> 100644 --- a/client/index.js +++ b/client/index.js @@ -45,20 +45,26 @@ const render = () => { // Match routes based on location object: match({ routes, location }, (error, redirectLocation, renderProps) => { if (error) console.log(error) - // Get array of route handler components: - const { components } = renderProps - - // Define locals to be provided to all lifecycle hooks: - const locals = { - path: renderProps.location.pathname, - query: renderProps.location.query, - params: renderProps.params, - host: window.location.host, + let locals = { // Allow lifecycle hooks to dispatch Redux actions: dispatch, getState } + let components + + if (renderProps) { + // Get array of route handler components: + components = renderProps.components + + // Define locals to be provided to all lifecycle hooks: + locals = {...locals, + path: renderProps.location.pathname, + query: renderProps.location.query, + params: renderProps.params, + host: window.location.host, + } + } // Don't fetch data for initial route, server has already done the work: if (window.INITIAL_STATE) {
Fix warning when renderProps is undefined. Closes #<I>
nossas_bonde-client
train
js
eb6d11e48ec3de77b9081a9f55b9f5ddd5017d6d
diff --git a/gss/src/test/java/org/globus/gsi/gssapi/test/GlobusGSSContextTest.java b/gss/src/test/java/org/globus/gsi/gssapi/test/GlobusGSSContextTest.java index <HASH>..<HASH> 100644 --- a/gss/src/test/java/org/globus/gsi/gssapi/test/GlobusGSSContextTest.java +++ b/gss/src/test/java/org/globus/gsi/gssapi/test/GlobusGSSContextTest.java @@ -62,6 +62,16 @@ public class GlobusGSSContextTest extends TestCase { System.setProperty("org.globus.gsi.gssapi.provider", "org.globus.gsi.gssapi.GlobusGSSManagerImpl"); + if (clientContext != null) { + clientContext.dispose(); + clientContext = null; + } + + if (serverContext != null) { + serverContext.dispose(); + serverContext = null; + } + GSSManager manager = getGSSManager(); @@ -82,10 +92,12 @@ public class GlobusGSSContextTest extends TestCase { protected void tearDown() throws Exception { if (clientContext != null) { clientContext.dispose(); + clientContext = null; } if (serverContext != null) { serverContext.dispose(); + serverContext = null; } }
These fixes take of the issue that was visible on certain non-server class machines where Java was allocating <I>MB max.
jglobus_JGlobus
train
java
89942c8c8f9c2f49f08e31e59bea5e670acbb876
diff --git a/src/crd/writer.js b/src/crd/writer.js index <HASH>..<HASH> 100644 --- a/src/crd/writer.js +++ b/src/crd/writer.js @@ -176,7 +176,11 @@ function validateFields(fields) { } field.type = type; if (typeof field.length !== 'number') { - field.length = 1; + if (field.type.name === 'ascii') { + field.length = 0; + } else { + field.length = 1; + } } if (field.length < 0 || field.length > 255) { throw new Error('field length must be a number in the range 0-255');
default length for ascii is variable
cheminfo_chem-ram-db
train
js
0504e6fc329b8d64a4612b0a199a1a0a176ba9f7
diff --git a/lib/net/ssh/authentication/methods/publickey.rb b/lib/net/ssh/authentication/methods/publickey.rb index <HASH>..<HASH> 100644 --- a/lib/net/ssh/authentication/methods/publickey.rb +++ b/lib/net/ssh/authentication/methods/publickey.rb @@ -82,6 +82,8 @@ module Net when USERAUTH_FAILURE return false + when USERAUTH_SUCCESS + return true else raise Net::SSH::Exception, "unexpected reply to USERAUTH_REQUEST: #{message.type} (#{message.inspect})"
fixing to work with windows and wingftpserver connecting with public key
net-ssh_net-ssh
train
rb
e682ec222a9801486084314bd67dc633d9f95a6d
diff --git a/src/Common/Service/Profiler.php b/src/Common/Service/Profiler.php index <HASH>..<HASH> 100644 --- a/src/Common/Service/Profiler.php +++ b/src/Common/Service/Profiler.php @@ -87,8 +87,8 @@ class Profiler $aBacktrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); $aCaller = $aBacktrace[1]; - $sCaller = $aCaller['class'] . - '->' . $aCaller['function']; + $sCaller = (!empty($aCaller['class']) ? $aCaller['class'] . '->' : '') . + (!empty($aCaller['function']) ? $aCaller['function'] : 'Unknown'); if (!$sLabel) { $sLabel = $sCaller;
Improved Profiler rendering of caller details
nails_common
train
php
41e5301693c96f5341d0f05e5dc6fa9effd19b1e
diff --git a/python/testing/__init__.py b/python/testing/__init__.py index <HASH>..<HASH> 100644 --- a/python/testing/__init__.py +++ b/python/testing/__init__.py @@ -0,0 +1,14 @@ +import unittest + +def test_module(m, runner=None): + if runner is None: + runner = unittest.TestRunner() + suite = unittest.TestSuite() + for key in dir(m): + val = getattr(m, key) + try: + if issubclass(val, unittest.TestCase): + suite.addTest(val) + except: + pass + return runner.run(suite) \ No newline at end of file
Workaround for micropython-lib unittest module main() being buggy/unhelpful with module introspection
adafruit_Adafruit_Blinka
train
py
10b968ee7f6a1b3807ee88b0889295093533e585
diff --git a/quest-owlapi3/src/test/java/it/unibz/inf/ontop/reformulation/tests/LeftJoinProfTest.java b/quest-owlapi3/src/test/java/it/unibz/inf/ontop/reformulation/tests/LeftJoinProfTest.java index <HASH>..<HASH> 100644 --- a/quest-owlapi3/src/test/java/it/unibz/inf/ontop/reformulation/tests/LeftJoinProfTest.java +++ b/quest-owlapi3/src/test/java/it/unibz/inf/ontop/reformulation/tests/LeftJoinProfTest.java @@ -129,7 +129,6 @@ public class LeftJoinProfTest { assertFalse(NO_SELF_LJ_OPTIMIZATION_MSG, containsMoreThanOneOccurrence(sql, "\"PROFESSORS\"")); } - @Ignore("Not supported yet") @Test public void testFullName1() throws Exception { @@ -155,7 +154,6 @@ public class LeftJoinProfTest { assertFalse(NO_SELF_LJ_OPTIMIZATION_MSG, containsMoreThanOneOccurrence(sql, "\"PROFESSORS\"")); } - @Ignore("TODO: add the fix point to enable it") @Test public void testFullName2() throws Exception {
Two tests enabled in LeftJoinProfTest.
ontop_ontop
train
java
350ed970b5db10bce42d8faf0049dced9842f5b6
diff --git a/app/worker.js b/app/worker.js index <HASH>..<HASH> 100644 --- a/app/worker.js +++ b/app/worker.js @@ -1,17 +1,6 @@ const {createContext, Script} = require('vm') const { Request, Response, Headers } = require("node-fetch"); -class FetchEvent { - constructor(request) { - this.type = 'fetch'; - this.request = request; - } - - respondWith(response) { - this.response = Promise.resolve(response); - } -} - class Worker { constructor(workerContents, {forwardHost, fetch} = {}) { this.listeners = { @@ -37,10 +26,14 @@ class Worker { } - async executeFetchEvent(...args) { - const event = new FetchEvent(new Request(...args)); - this.triggerEvent("fetch", event); - return await event.response; + executeFetchEvent(...args) { + let response = null; + this.triggerEvent("fetch", { + type: 'fetch', + request: new Request(...args), + respondWith: (r) => response = r + }); + return Promise.resolve(response); } addEventListener(event, listener) {
Removing an Unnecessary Class
gja_cloudflare-worker-local
train
js
2a1e977168ddce10bc14dba12ffe99216284025a
diff --git a/src/notebook/menu/index.js b/src/notebook/menu/index.js index <HASH>..<HASH> 100644 --- a/src/notebook/menu/index.js +++ b/src/notebook/menu/index.js @@ -4,6 +4,8 @@ import { showSaveAsDialog, } from '../api/save'; +import { tildify } from '../native-window'; + import { executeCell, newKernel, @@ -11,7 +13,7 @@ import { saveAs, killKernel, } from '../actions'; -import { ipcRenderer as ipc, webFrame } from 'electron'; +import { ipcRenderer as ipc, webFrame, BrowserWindow } from 'electron'; import { publish, @@ -29,8 +31,9 @@ export function triggerSaveAs(store, dispatch) { if (!filename) { return; } - const { notebook } = store.getState(); + const { notebook, executionState} = store.getState(); dispatch(saveAs(filename, notebook)); + BrowserWindow.getFocusedWindw().setTitle(`${tildify(filename)} - ${executionState}`); } ); }
Updated focused browser window title on saveAs
nteract_nteract
train
js
44d0b0ca6c0051614749ec39a377b1c62954888b
diff --git a/visidata/loaders/npy.py b/visidata/loaders/npy.py index <HASH>..<HASH> 100644 --- a/visidata/loaders/npy.py +++ b/visidata/loaders/npy.py @@ -91,4 +91,4 @@ def save_npy(vd, p, sheet): arr = np.array(data, dtype=dtype) with p.open_bytes(mode='w') as outf: - np.save(outf, arr, **self.options.getall('npy_')) + np.save(outf, arr, **sheet.options.getall('npy_'))
[npy-] fix typo in save
saulpw_visidata
train
py
f0326ac44e6dc4c01d80ee9a206a84bf58a3e9ed
diff --git a/python_modules/dagster-test/dagster_test/fixtures/docker_compose.py b/python_modules/dagster-test/dagster_test/fixtures/docker_compose.py index <HASH>..<HASH> 100644 --- a/python_modules/dagster-test/dagster_test/fixtures/docker_compose.py +++ b/python_modules/dagster-test/dagster_test/fixtures/docker_compose.py @@ -9,7 +9,7 @@ import pytest from .utils import BUILDKITE [email protected] [email protected](scope="module") def docker_compose_cm(test_directory): @contextmanager def docker_compose( diff --git a/python_modules/dagster-test/dagster_test/fixtures/utils.py b/python_modules/dagster-test/dagster_test/fixtures/utils.py index <HASH>..<HASH> 100644 --- a/python_modules/dagster-test/dagster_test/fixtures/utils.py +++ b/python_modules/dagster-test/dagster_test/fixtures/utils.py @@ -16,7 +16,7 @@ def retrying_requests(): yield session [email protected] [email protected](scope="module") def test_directory(request): yield os.path.dirname(request.fspath)
make some docker-compose fixtures module-scoped (#<I>) Summary: These allow you to have fixtures that only run docker-compose once per module Test Plan: BK Reviewers: jmsanders
dagster-io_dagster
train
py,py
7bbf23234ce94ede8ac0e77bbf96bbe6d807f64c
diff --git a/PhoneGapLib/javascripts/core/contact.js b/PhoneGapLib/javascripts/core/contact.js index <HASH>..<HASH> 100644 --- a/PhoneGapLib/javascripts/core/contact.js +++ b/PhoneGapLib/javascripts/core/contact.js @@ -66,5 +66,5 @@ ContactManager.prototype.contactsCount = function(successCallback, errorCallback } PhoneGap.addConstructor(function() { - if (typeof navigator.ContactManager == "undefined") navigator.ContactManager = new ContactManager(); + if (typeof navigator.contacts == "undefined") navigator.contacts = new ContactManager(); });
Updated to conform to MobileSpec. navigator.ContactManager becomes navigator.contacts see <URL>
apache_cordova-ios
train
js
ca61a8ac76be36dc97fb7a55354356863246c674
diff --git a/metaextract/metaextract.py b/metaextract/metaextract.py index <HASH>..<HASH> 100644 --- a/metaextract/metaextract.py +++ b/metaextract/metaextract.py @@ -50,6 +50,9 @@ class metaextract(Command): 'scripts', 'tests_require', 'tests_suite']: if hasattr(self.distribution, key): data[key] = getattr(self.distribution, key) + # dict_items objects can not be serialized with json + if data[key].__class__.__name__ == 'dict_items': + data[key] = list(data[key]) # keep list ordered! for func in ['has_ext_modules']:
Fix json serialization for dict_items on py3 (#4) With python<I>, data_files is a 'dict_items' object which is not serializable. Closes #4
toabctl_metaextract
train
py