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
9e698c74832b4e019a8418aae7853b56181260ab
diff --git a/ryu/ofproto/ofproto_v1_0_parser.py b/ryu/ofproto/ofproto_v1_0_parser.py index <HASH>..<HASH> 100644 --- a/ryu/ofproto/ofproto_v1_0_parser.py +++ b/ryu/ofproto/ofproto_v1_0_parser.py @@ -83,6 +83,12 @@ class OFPPhyPort(ofproto_parser.namedtuple('OFPPhyPort', ( 'port_no', 'hw_addr', 'name', 'config', 'state', 'curr', 'advertised', 'supported', 'peer'))): + _TYPE = { + 'ascii': [ + 'hw_addr', + ] + } + @classmethod def parser(cls, buf, offset): port = struct.unpack_from(ofproto_v1_0.OFP_PHY_PORT_PACK_STR, @@ -2102,6 +2108,13 @@ class OFPFlowMod(MsgBase): @_set_msg_type(ofproto_v1_0.OFPT_PORT_MOD) class OFPPortMod(MsgBase): + + _TYPE = { + 'ascii': [ + 'hw_addr', + ] + } + def __init__(self, datapath, port_no, hw_addr, config, mask, advertise): super(OFPPortMod, self).__init__(datapath) self.port_no = port_no
of<I>: fix json representation of OFPPhyPort.hw_addr and OFPPortMod.hw_addr
osrg_ryu
train
py
3a587e8337381b43741c643ac70e5bfce88b08a9
diff --git a/core/src/main/java/hudson/tasks/junit/CaseResult.java b/core/src/main/java/hudson/tasks/junit/CaseResult.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/tasks/junit/CaseResult.java +++ b/core/src/main/java/hudson/tasks/junit/CaseResult.java @@ -119,7 +119,7 @@ public final class CaseResult extends TestObject implements Comparable<CaseResul /** * Gets the duration of the test, in seconds */ - // TODO: wait for stapler 1.60 to do this : @Exported + @Exported public float getDuration() { return duration; }
Exporting the duration to the remote API. (we are already long past Stapler <I>.) git-svn-id: <URL>
jenkinsci_jenkins
train
java
600bc2b16eb9fe1e7b3bee757fa80a5fa177d5fd
diff --git a/lib/inspectors/res.js b/lib/inspectors/res.js index <HASH>..<HASH> 100644 --- a/lib/inspectors/res.js +++ b/lib/inspectors/res.js @@ -263,10 +263,15 @@ module.exports = function(req, res, next) { var maxRetryCount = 1; var retryCount = 0; var retryXHost = 0; + var resetCount = 0; var retryReq = function(err) { if (retryCount >= maxRetryCount) { - res.response(util.wrapGatewayError(util.getErrorStack(err || new Error('socket connect timeout')))); - return; + var code = err && err.code; + if (resetCount > 1 || code !== 'ECONNRESET') { + var stack = util.getErrorStack(err || new Error('socket connect timeout')); + return res.response(util.wrapGatewayError(stack)); + } + ++resetCount; } ++retryCount; if (proxyUrl) {
refactor: retry ECONNRESET
avwo_whistle
train
js
25aac400c9ecb909ead7455f1a382424afdabdd4
diff --git a/src/Models/User.php b/src/Models/User.php index <HASH>..<HASH> 100644 --- a/src/Models/User.php +++ b/src/Models/User.php @@ -203,8 +203,8 @@ class User extends BaseSystemModel implements AuthenticatableContract, CanResetP } $password = ArrayUtils::get($record, 'password'); - if (ArrayUtils::getBool($params, 'admin') && !empty($password)) { - $model->password = ArrayUtils::get($record, 'password'); + if (!empty($password)) { + $model->password = $password; } $model->update($record);
Bugfix - allowing system/user to update password
dreamfactorysoftware_df-core
train
php
886a52d6eded698f7f84ee2bbdedd6d84628a16d
diff --git a/MAVProxy/mavproxy.py b/MAVProxy/mavproxy.py index <HASH>..<HASH> 100755 --- a/MAVProxy/mavproxy.py +++ b/MAVProxy/mavproxy.py @@ -1435,7 +1435,7 @@ def vcell_to_battery_percent(vcell): elif vcell > 3.81: # 3.81 is 17% remaining, from flight logs return 17.0 + 83.0 * (vcell - 3.81) / (4.1 - 3.81) - elif vcell > 3.81: + elif vcell > 3.2: # below 3.2 it degrades fast. It's dead at 3.2 return 0.0 + 17.0 * (vcell - 3.20) / (3.81 - 3.20) # it's dead or disconnected
Fix copy/paste error. Before, a cell voltage lower or equal to <I> always returned <I> because the second `elif` was never entered.
ArduPilot_MAVProxy
train
py
629fc87e0834dfa33b7e8cc7afeafaee5b3d6fb0
diff --git a/src/main/java/org/jboss/pressgang/ccms/rest/v1/jaxrsinterfaces/RESTBaseInterfaceV1.java b/src/main/java/org/jboss/pressgang/ccms/rest/v1/jaxrsinterfaces/RESTBaseInterfaceV1.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jboss/pressgang/ccms/rest/v1/jaxrsinterfaces/RESTBaseInterfaceV1.java +++ b/src/main/java/org/jboss/pressgang/ccms/rest/v1/jaxrsinterfaces/RESTBaseInterfaceV1.java @@ -60,6 +60,19 @@ import org.jboss.pressgang.ccms.rest.v1.expansion.ExpandDataTrunk; public interface RESTBaseInterfaceV1 { /* CONSTANTS */ + /* UTILITY FUNCTIONS */ + @POST + @Path("/minhash/get/json") + @Produces(MediaType.APPLICATION_JSON) + @Consumes(MediaType.APPLICATION_XML) + IntegerWrapper getMinHash(final String xml); + + @POST + @Path("/minhash/get/json") + @Produces(MediaType.MEDIA_TYPE_WILDCARD) + @Consumes(MediaType.MEDIA_TYPE_WILDCARD) + void recalculateMinHash(); + /* SYSTEM FUNCTIONS */ /**
Added endpoints for minhash calculation and updating
pressgang-ccms_PressGangCCMSRESTv1Common
train
java
492a3b09fa9487414ead574e41692ae3fca0e5b3
diff --git a/terraform/transform_deposed.go b/terraform/transform_deposed.go index <HASH>..<HASH> 100644 --- a/terraform/transform_deposed.go +++ b/terraform/transform_deposed.go @@ -57,6 +57,7 @@ func (t *DeposedTransformer) Transform(g *Graph) error { Addr: addr, Index: i, RecordedProvider: providerAddr, + ResolvedProvider: providerAddr, }) } }
deposed nodes need the resolved provider too The provider is looked up by the ResolvedProvider
hashicorp_terraform
train
go
c6d81e6ddd40e5b3fe601f207422e77fd2c5c393
diff --git a/lib/nexpose/site.rb b/lib/nexpose/site.rb index <HASH>..<HASH> 100644 --- a/lib/nexpose/site.rb +++ b/lib/nexpose/site.rb @@ -138,10 +138,6 @@ module Nexpose # Configuration version. Default: 3 attr_accessor :config_version - # Whether or not this site is dynamic. - # Dynamic sites are created through Asset Discovery Connections. - attr_accessor :dynamic - # Asset filter criteria if this site is dynamic. attr_accessor :search_criteria @@ -161,7 +157,6 @@ module Nexpose @id = -1 @risk_factor = 1.0 @config_version = 3 - @is_dynamic = false @schedules = [] @included_scan_targets = { addresses: [], asset_groups: [] } @excluded_scan_targets = { addresses: [], asset_groups: [] } @@ -175,7 +170,7 @@ module Nexpose # Returns true when the site is dynamic. def isdynamic? - @dynamic + !@discovery_config.nil? end # Adds an asset to this site by host name. @@ -501,8 +496,7 @@ module Nexpose tags: @tags.map{|tag| tag.to_h}, alerts: @alerts.map {|alert| alert.to_h }, organization: @organization.to_h, - users: users, - dynamic: @dynamic || 0 + users: users } end
Correctly assigning excluded ip/host targets to exclude collection in helper methods.
rapid7_nexpose-client
train
rb
f05862c478bdf2aab195bd6806a4dc8e072d7191
diff --git a/indra/util/statement_presentation.py b/indra/util/statement_presentation.py index <HASH>..<HASH> 100644 --- a/indra/util/statement_presentation.py +++ b/indra/util/statement_presentation.py @@ -19,7 +19,7 @@ def _get_keyed_stmts(stmt_list): if 1 < len(ag_ns) < 6: for pair in permutations(ag_ns, 2): yield key + tuple(pair), s - if len(ag_ns) <= 2: + if len(ag_ns) == 2: continue key += tuple(sorted(ag_ns)) elif verb == 'Conversion':
Avoid skipping complexes with only one entity listed n times.
sorgerlab_indra
train
py
b13078e4b551787d890b6af97b6b8cc457cc0b94
diff --git a/detect_secrets/core/potential_secret.py b/detect_secrets/core/potential_secret.py index <HASH>..<HASH> 100644 --- a/detect_secrets/core/potential_secret.py +++ b/detect_secrets/core/potential_secret.py @@ -103,10 +103,10 @@ class PotentialSecret: 'is_verified': self.is_verified, } - if self.line_number: + if hasattr(self, 'line_number') and self.line_number: attributes['line_number'] = self.line_number - if self.is_secret is not None: + if hasattr(self, 'is_secret') and self.is_secret is not None: attributes['is_secret'] = self.is_secret return attributes
Added checks to avoid AttributeError in potential_secret.py
Yelp_detect-secrets
train
py
b11ee94db934699b414a110dcf153d6da6216bf5
diff --git a/scot/__init__.py b/scot/__init__.py index <HASH>..<HASH> 100644 --- a/scot/__init__.py +++ b/scot/__init__.py @@ -9,8 +9,6 @@ from __future__ import absolute_import from . import config -backends = ['backend_builtin', 'backend_sklearn'] - # default backend # TODO: set default backend in config from . import backend_builtin @@ -22,3 +20,6 @@ from .connectivity import Connectivity from . import datatools __all__ = ['Workspace', 'Connectivity', 'datatools'] +__version__ = "0.1.0" + +backends = ['backend_builtin', 'backend_sklearn'] diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -2,11 +2,9 @@ from setuptools import setup from codecs import open +from scot import __version__ as ver -with open('VERSION', encoding='utf-8') as version: - ver = version.read().strip() - with open('README.md', encoding='utf-8') as readme: long_description = readme.read()
Define __version__ in __init__ and read it in setup.py
scot-dev_scot
train
py,py
313a8d667a30ed68de62d3d7b8b57bbb31652133
diff --git a/config.js b/config.js index <HASH>..<HASH> 100644 --- a/config.js +++ b/config.js @@ -3,7 +3,7 @@ var config = { disableLogs: false, port: 3232, // Uncomment to make BWS a forking server - cluster: true, + // cluster: true, // Uncomment to use the nr of availalbe CPUs // clusterInstances: 4,
revert dflt config
bitpay_bitcore-wallet-service
train
js
b0f136f57304e24f46f8ed91d4c652b0f5a99973
diff --git a/src/main/java/com/synopsys/integration/blackduck/codelocation/bdio2legacy/UploadBdio2Callable.java b/src/main/java/com/synopsys/integration/blackduck/codelocation/bdio2legacy/UploadBdio2Callable.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/synopsys/integration/blackduck/codelocation/bdio2legacy/UploadBdio2Callable.java +++ b/src/main/java/com/synopsys/integration/blackduck/codelocation/bdio2legacy/UploadBdio2Callable.java @@ -44,7 +44,9 @@ public class UploadBdio2Callable implements Callable<UploadOutput> { HttpUrl url = apiDiscovery.metaSingleResponse(BlackDuckApiClient.SCAN_DATA_PATH).getUrl(); BlackDuckResponseRequest request = new BlackDuckRequestBuilder() .postFile(uploadTarget.getUploadFile(), ContentType.create(uploadTarget.getMediaType(), StandardCharsets.UTF_8)) - .buildBlackDuckResponseRequest(url); + .addHeader("X-BD-PROJECT-NAME", projectAndVersion.getName()) + .addHeader("X-BD-VERSION-NAME", projectAndVersion.getVersion()) + .buildBlackDuckResponseRequest(url); try (Response response = blackDuckApiClient.execute(request)) { String responseString = response.getContentString();
feat: UploadBdio2Callable: set project and version headers
blackducksoftware_blackduck-common
train
java
bdd874f0278b52855b371ee17df398e174b20c9d
diff --git a/mtp_common/nomis.py b/mtp_common/nomis.py index <HASH>..<HASH> 100644 --- a/mtp_common/nomis.py +++ b/mtp_common/nomis.py @@ -98,7 +98,8 @@ def credit_prisoner(prison_id, prisoner_number, amount, credit_id, description, 'type': 'MRPR', 'description': description, 'amount': amount, - 'client_transaction_id': str(credit_id) + 'client_transaction_id': str(credit_id), + 'client_unique_ref': str(credit_id) } return post( '/prison/{prison_id}/offenders/{prisoner_number}/transactions'.format(
Populate unique client ref field when creating NOMIS transactions
ministryofjustice_money-to-prisoners-common
train
py
784cc49a47d16b0dbf8c2544fae926e3145957f3
diff --git a/pfr/utils/playParsing.py b/pfr/utils/playParsing.py index <HASH>..<HASH> 100644 --- a/pfr/utils/playParsing.py +++ b/pfr/utils/playParsing.py @@ -510,6 +510,9 @@ def addTeamColumns(features): features = pd.DataFrame(features) features.team.fillna(method='bfill', inplace=True) features.opp.fillna(method='bfill', inplace=True) + # ffill for last row + features.team.fillna(method='ffill', inplace=True) + features.opp.fillna(method='ffill', inplace=True) return features @pfr.decorators.memoized
ffill to fill last row for team and opp
mdgoldberg_sportsref
train
py
7f8c21432f4340e0d7fa26f8dfe201acfc42fcd4
diff --git a/lib/cookbook.js b/lib/cookbook.js index <HASH>..<HASH> 100644 --- a/lib/cookbook.js +++ b/lib/cookbook.js @@ -6,11 +6,14 @@ var Q = require('q'), argv = require('optimist').argv; function Cookbook(opts){ - this.config = opts.config; + var self = this; + + this.config = opts.config || {}; this.recipes = opts.recipes; - // @todo (lucas) Extract providesConfig from recipes, - // copy into config, dont override existing keys. + Object.keys(this.recipes).map(function(recipeName){ + self.config = util._extend(self.recipes[recipeName].recipe.providesConfig, self.config); + }); } Cookbook.prototype.exec = function(taskName, opts, done){
Mixin recipe configs to cookbook.
imlucas_mott
train
js
bb5a3b1e75d4162e532e4aea6abd28d8b70be907
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,3 @@ -import assign from "core-js/library/fn/object/assign"; import joi from "joi"; import optionsSchema from "./utils/optionsSchema"; @@ -32,15 +31,12 @@ function remarkGenericExtensions(options = {}) { return false; } - const settings = Object::assign( - {}, - { - debug: false, - placeholderAffix: "::", - elements: {} - }, - options - ); + const settings = { + debug: false, + placeholderAffix: "::", + elements: {}, + ...options + }; // Escape the user provided placeholder affix for use in regex settings.placeholderAffix = settings.placeholderAffix::escapeRegExp();
chore(module): replace `Object::assign` by es6 spread operator
medfreeman_remark-generic-extensions
train
js
e3677c14cd7d4f780204e660ae0b5ebadccd43a3
diff --git a/src/Collections/Collection.php b/src/Collections/Collection.php index <HASH>..<HASH> 100644 --- a/src/Collections/Collection.php +++ b/src/Collections/Collection.php @@ -581,7 +581,7 @@ class Collection implements \ArrayAccess, \Iterator, \Countable } $modelSchema = $this->getModelSchema(); - list($count) = $this->calculateAggregates(new Count($modelSchema->schemaName . "." . $modelSchema->uniqueIdentifierColumnName)); + list($count) = $this->calculateAggregates(new Count($modelSchema->uniqueIdentifierColumnName)); return $count; }
Fix for count aggregate (reverted from commit 9fcefdfe6e<I>abeb3bcaa<I>cbc<I>d<I>)
RhubarbPHP_Module.Stem
train
php
94549985bc88730e2c38dff9c7b82a0b4d38f451
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -48,9 +48,9 @@ copyright = u'2011, Jannis Leidel and contributors' # built documents. # # The short X.Y version. -version = '0.3' +version = '0.4' # The full version, including alpha/beta/rc tags. -release = '0.3' +release = '0.4' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/queued_storage/__init__.py b/queued_storage/__init__.py index <HASH>..<HASH> 100644 --- a/queued_storage/__init__.py +++ b/queued_storage/__init__.py @@ -1,2 +1,2 @@ # following PEP 386, versiontools will pick it up -__version__ = (0, 3, 0, "final", 0) +__version__ = (0, 4, 0, "final", 0)
Bumped version to <I>.
jazzband_django-queued-storage
train
py,py
b3e775a780a20caad0ba85d7de9458e1da71eb73
diff --git a/MySQLdb/cursors.py b/MySQLdb/cursors.py index <HASH>..<HASH> 100644 --- a/MySQLdb/cursors.py +++ b/MySQLdb/cursors.py @@ -110,14 +110,17 @@ class BaseCursor(object): return x if isinstance(args, (tuple, list)): - return tuple(literal(ensure_bytes(arg)) for arg in args) + ret = tuple(literal(ensure_bytes(arg)) for arg in args) elif isinstance(args, dict): - return {ensure_bytes(key): literal(ensure_bytes(val)) - for (key, val) in args.items()} + ret = {ensure_bytes(key): literal(ensure_bytes(val)) + for (key, val) in args.items()} else: # If it's not a dictionary let's try escaping it anyways. # Worst case it will throw a Value error - return literal(ensure_bytes(args)) + ret = literal(ensure_bytes(args)) + + ensure_bytes = None # break circular reference + return ret def _check_executed(self): if not self._executed:
fix Cursor.executemany created many circular references (#<I>)
PyMySQL_mysqlclient-python
train
py
3b07393ea84c57b0c5b995045a2b983df7821d93
diff --git a/pkg/kubelet/metrics/collectors/log_metrics_test.go b/pkg/kubelet/metrics/collectors/log_metrics_test.go index <HASH>..<HASH> 100644 --- a/pkg/kubelet/metrics/collectors/log_metrics_test.go +++ b/pkg/kubelet/metrics/collectors/log_metrics_test.go @@ -20,25 +20,19 @@ import ( "strings" "testing" - "github.com/prometheus/client_golang/prometheus" - "k8s.io/component-base/metrics/testutil" statsapi "k8s.io/kubernetes/pkg/kubelet/apis/stats/v1alpha1" ) func TestNoMetricsCollected(t *testing.T) { - ch := make(chan prometheus.Metric) - collector := &logMetricsCollector{ podStats: func() ([]statsapi.PodStats, error) { return []statsapi.PodStats{}, nil }, } - collector.Collect(ch) - num := len(ch) - if num != 0 { - t.Fatalf("Channel expected to be empty, but received %d", num) + if err := testutil.CollectAndCompare(collector, strings.NewReader(""), ""); err != nil { + t.Fatal(err) } }
Refactor UT with testutil from k/k.
kubernetes_kubernetes
train
go
0410389b3421496c17b9f96d4f271be4f72db287
diff --git a/node-binance-api.js b/node-binance-api.js index <HASH>..<HASH> 100644 --- a/node-binance-api.js +++ b/node-binance-api.js @@ -402,7 +402,7 @@ let api = function Binance( options = {} ) { timeout: Binance.options.recvWindow, followAllRedirects: true }; - if ( flags.type === 'SIGNED' || flags.type === 'TRADE' || flags.type === 'USER_DATA' ) { + if ( flags.type === 'SIGNED' || flags.type === 'TRADE' || flags.type === 'USER_DATA' || ( Binance.options.test && flags.type === 'MARKET_DATA' ) ) { if ( !Binance.options.APISECRET ) return reject( 'Invalid API Secret' ); data.timestamp = new Date().getTime() + Binance.info.timeOffset; query = makeQueryString( data );
Futures promiseRequest: Fix "Mandatory parameter 'timestamp' was not sent, was empty/null, or malformed." -<I>
jaggedsoft_node-binance-api
train
js
e796b1d6c543a819bc84fc22c68cacc077fa99da
diff --git a/lib/Context.js b/lib/Context.js index <HASH>..<HASH> 100644 --- a/lib/Context.js +++ b/lib/Context.js @@ -7,7 +7,9 @@ class HTTPContext { } setHeaders(dict) { - + for (let header in dict) + if (dict.hasOwnProperty(header)) + this.response.header(header, dict[header]); } static get STATUSES (){
added setHeaders for context.HTTP
julien-sarazin_idylle
train
js
c01020575a8dcb332c22dedab3dfc1460b1c06bd
diff --git a/src/Synapse/TestHelper/MapperTestCase.php b/src/Synapse/TestHelper/MapperTestCase.php index <HASH>..<HASH> 100644 --- a/src/Synapse/TestHelper/MapperTestCase.php +++ b/src/Synapse/TestHelper/MapperTestCase.php @@ -229,4 +229,11 @@ abstract class MapperTestCase extends PHPUnit_Framework_TestCase return Arr::get($sqlStrings, $key); } + + protected function assertRegExpOnSqlString($regexp, $sqlStringKey = 0) + { + $sqlString = $this->getSqlString($sqlStringKey); + + $this->assertRegExp($regexp, $sqlString); + } }
Refs #<I> - Add helper method to perform a regex assertion on captured sql strings.
synapsestudios_synapse-base
train
php
e3cb8e6c7874d7dfe1d4d1c7f5c9765b681fb647
diff --git a/commands/hugo.go b/commands/hugo.go index <HASH>..<HASH> 100644 --- a/commands/hugo.go +++ b/commands/hugo.go @@ -764,7 +764,7 @@ func (c *commandeer) handleEvents(watcher *watcher.Batcher, if ev.Op&fsnotify.Chmod == fsnotify.Chmod { continue } - if ev.Op&fsnotify.Remove == fsnotify.Remove { + if ev.Op&fsnotify.Remove == fsnotify.Remove || ev.Op&fsnotify.Rename == fsnotify.Rename { for _, configFile := range c.configFiles { counter := 0 for watcher.Add(configFile) != nil {
Add configFile(s) back to the watch list after RENAME event too Alleviates #<I>
gohugoio_hugo
train
go
3801c039db3c7a8133d7a20b57b84f7c4147bfc2
diff --git a/robolectric/src/test/java/org/robolectric/android/controller/ActivityControllerTest.java b/robolectric/src/test/java/org/robolectric/android/controller/ActivityControllerTest.java index <HASH>..<HASH> 100644 --- a/robolectric/src/test/java/org/robolectric/android/controller/ActivityControllerTest.java +++ b/robolectric/src/test/java/org/robolectric/android/controller/ActivityControllerTest.java @@ -2,7 +2,7 @@ package org.robolectric.android.controller; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThrows; +import static org.junit.Assert.fail; import static org.robolectric.Shadows.shadowOf; import android.app.Activity; @@ -262,7 +262,11 @@ public class ActivityControllerTest { ActivityController<InvalidStateActivity> configController = Robolectric.buildActivity(InvalidStateActivity.class).setup(); - assertThrows(RuntimeException.class, () -> configController.configurationChange(config)); + try { + configController.configurationChange(config); + fail("Expected Exception"); + } catch (RuntimeException expected) { + } } @Test
Cannot use assertThrows on this version of JUnit
robolectric_robolectric
train
java
34bca066c2a19f6f3693076e1b5c325063b03cb6
diff --git a/server.go b/server.go index <HASH>..<HASH> 100644 --- a/server.go +++ b/server.go @@ -431,12 +431,14 @@ func (s *Server) Start() { } for _, sink := range s.spanSinks { + logrus.WithField("sink", sink.Name()).Info("Starting span sink") if err := sink.Start(s.TraceClient); err != nil { logrus.WithError(err).WithField("sink", sink).Fatal("Error starting span sink") } } for _, sink := range s.metricSinks { + logrus.WithField("sink", sink.Name()).Info("Starting metric sink") if err := sink.Start(s.TraceClient); err != nil { logrus.WithError(err).WithField("sink", sink).Fatal("Error starting metric sink") }
Add two info loglines for when we're starting sinks
stripe_veneur
train
go
684ee073a660bf261e1c00f54ac5c0002bb8be3f
diff --git a/src/main/java/com/couchbase/lite/internal/AttachmentInternal.java b/src/main/java/com/couchbase/lite/internal/AttachmentInternal.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/couchbase/lite/internal/AttachmentInternal.java +++ b/src/main/java/com/couchbase/lite/internal/AttachmentInternal.java @@ -126,6 +126,14 @@ public class AttachmentInternal { // I can't handle this myself; my caller will look it up from the getDigest if (digest == null) throw new CouchbaseLiteException(Status.BAD_ATTACHMENT); + + if (attachInfo.containsKey("revpos")) { + int revPos = ((Number) attachInfo.get("revpos")).intValue(); + if (revPos <= 0) { + throw new CouchbaseLiteException(Status.BAD_ATTACHMENT); + } + setRevpos(revPos); + } } else { throw new CouchbaseLiteException(Status.BAD_ATTACHMENT); }
Fix attachment revpos not being set when follows=true During the pull replication, the revpos of an attachment could be set to a parent revision while the follows=true. If the revpos value doesn't get preserved, the revpos will be set to the current generation. Later, when pushing an updated document again, the attachment info will contain a wrong revpos and result to the missing_stub error on CouchDB. SyncGateway currently ignores the issue and doesn't overwrite the revpos value on the server side. Ported the fix from <URL>
couchbase_couchbase-lite-java-core
train
java
4789fa3b8c61cef95a369edac4110f7fd77d535d
diff --git a/packages/ra-ui-materialui/src/detail/SimpleShowLayout.js b/packages/ra-ui-materialui/src/detail/SimpleShowLayout.js index <HASH>..<HASH> 100644 --- a/packages/ra-ui-materialui/src/detail/SimpleShowLayout.js +++ b/packages/ra-ui-materialui/src/detail/SimpleShowLayout.js @@ -49,7 +49,7 @@ const sanitizeRestProps = ({ * ); * export default App; */ -export const SimpleShowLayout = ({ +const SimpleShowLayout = ({ basePath, className, children,
SimpleShowLayout exported twice.
marmelab_react-admin
train
js
63ede93257227c6223ef17bd7166c0ec9147f959
diff --git a/src/controllers/RestController.php b/src/controllers/RestController.php index <HASH>..<HASH> 100755 --- a/src/controllers/RestController.php +++ b/src/controllers/RestController.php @@ -16,6 +16,7 @@ class RestController extends \yii\rest\Controller return ArrayHelper::merge(parent::behaviors(), [ 'exceptionFilter' => [ 'class' => ErrorToExceptionFilter::class, + 'oauth2Module' => $this->module, ], ]); }
pass oauth2Module to RestController behaviors
tecnocen-com_yii2-oauth2-server
train
php
d84cff405963ad45cb78808baca224fb7bc95f5a
diff --git a/views/widget/header-logo.blade.php b/views/widget/header-logo.blade.php index <HASH>..<HASH> 100644 --- a/views/widget/header-logo.blade.php +++ b/views/widget/header-logo.blade.php @@ -1,6 +1,6 @@ @extends('widget.header-widget') @section('widget') - <div class="c-header__logo"> + <div class="c-header__logo t-header__logo"> <a href="{{$home}}"> {!! $logotype !!} </a>
Allow the theme to affect logotype in customizer
helsingborg-stad_Municipio
train
php
3833d1feb5b98d2b6cbd148c1dd419dab0ed9c8e
diff --git a/src/photini/__init__.py b/src/photini/__init__.py index <HASH>..<HASH> 100644 --- a/src/photini/__init__.py +++ b/src/photini/__init__.py @@ -1,4 +1,4 @@ from __future__ import unicode_literals __version__ = '2022.1.1' -build = '1919 (6cdc862)' +build = '1920 (f5511d2)' diff --git a/src/photini/descriptive.py b/src/photini/descriptive.py index <HASH>..<HASH> 100644 --- a/src/photini/descriptive.py +++ b/src/photini/descriptive.py @@ -200,7 +200,9 @@ class TabWidget(QtWidgets.QWidget): self.config_store = QtWidgets.QApplication.instance().config_store self.image_list = image_list self.form = QtWidgets.QFormLayout() - self.setLayout(self.form) + self.setLayout(QtWidgets.QVBoxLayout()) + self.layout().addLayout(self.form) + self.layout().addStretch(1) # construct widgets self.widgets = {} # title
Add stretch to descriptive tab This keeps the widgets correctly aligned when the window is made very large. This problem only occurs on PySide6.
jim-easterbrook_Photini
train
py,py
809c78afc78597a7355ba2e3962518ebca8a89d7
diff --git a/scripts/build.js b/scripts/build.js index <HASH>..<HASH> 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -31,13 +31,20 @@ shell.config.verbose = true; shell.cd(`${env.sourceFolder}`); if (env.isWindows) { - exec(`cmake -DWANT_SYNCAPI=OFF -DCMAKE_GENERATOR_PLATFORM=${process.arch} .`); - exec('cmake --build .'); + let flags = '-DWANT_SYNCAPI=OFF '; + let output = ''; + + if (!env.isVerbose) { + flags = ''; + output = ' > NUL'; + } + exec(`cmake ${flags}-DCMAKE_GENERATOR_PLATFORM=${process.arch} .${output}`); + exec(`cmake --build .${output}`); } else { const flags = '-w'; let configureCmd = `./configure CFLAGS='${flags}' --without-syncapi --disable-shared --with-pic --without-cppunit`; let makeCmd = 'make'; - if (!process.env.ZK_INSTALL_VERBOSE) { + if (!env.isVerbose) { configureCmd += ' --enable-silent-rules --quiet'; makeCmd += ' --no-print-directory --quiet'; }
fix: less verbose Windows builds
yfinkelstein_node-zookeeper
train
js
af2ed58fccebff06bfc028fa124c84b51fb01013
diff --git a/src/Entity/Ranking.php b/src/Entity/Ranking.php index <HASH>..<HASH> 100644 --- a/src/Entity/Ranking.php +++ b/src/Entity/Ranking.php @@ -18,13 +18,13 @@ abstract class Ranking extends MPNContentEntityBase implements MPNEntityInterfac ); } - public abstract function getBaseTable(); + abstract public function getBaseTable(); - public abstract function getEntityRelated(); + abstract public function getEntityRelated(); - public abstract function getStorageName(); + abstract public function getStorageName(); - public abstract function getPosition(); + abstract public function getPosition(); public function determinePosition($results) { $position = 0;
refactoring - clean Ranking abstract entity
mespronos_mespronos
train
php
ca6641b4b6dcab5e153f725a9e82672fc2f16251
diff --git a/gtk/gtk.go b/gtk/gtk.go index <HASH>..<HASH> 100644 --- a/gtk/gtk.go +++ b/gtk/gtk.go @@ -6552,6 +6552,17 @@ func (v *Range) SetRange(min, max float64) { C.gtk_range_set_range(v.native(), C.gdouble(min), C.gdouble(max)) } +// GetInverted() is a wrapper around gtk_range_get_inverted(). +func (v *Range) GetInverted() bool { + c := C.gtk_range_get_inverted(v.native()) + return gobool(c) +} + +// SetInverted() is a wrapper around gtk_range_set_inverted(). +func (v *Range) SetInverted(inverted bool) { + C.gtk_range_set_inverted(v.native(), gbool(inverted)) +} + // IRecentChooser is an interface type implemented by all structs // embedding a RecentChooser. It is meant to be used as an argument type // for wrapper functions that wrap around a C GTK function taking a
expose get/set invert functions for GtkRange
gotk3_gotk3
train
go
78e2b18c431d9165bf9d048938b4dfebba56d177
diff --git a/steamfiles/appinfo.py b/steamfiles/appinfo.py index <HASH>..<HASH> 100644 --- a/steamfiles/appinfo.py +++ b/steamfiles/appinfo.py @@ -1,3 +1,4 @@ +import copy import struct from collections import OrderedDict @@ -17,12 +18,11 @@ def loads(content): def dump(obj, fp): - for chunk in AppinfoEncoder(obj).iter_encode(): - fp.write(chunk) + fp.write(dumps(obj)) def dumps(obj): - raise NotImplementedError + return b''.join(AppinfoEncoder(obj).iter_encode()) class AppinfoDecoder:
[Appinfo] Both dump() and dumps() are now implemented
leovp_steamfiles
train
py
e7203987ae394614ff660fa9c68967633b679f95
diff --git a/bind.go b/bind.go index <HASH>..<HASH> 100644 --- a/bind.go +++ b/bind.go @@ -29,7 +29,7 @@ func BindType(driverName string) int { return QUESTION case "sqlite3": return QUESTION - case "oci8", "ora", "goracle": + case "oci8", "ora", "goracle", "godror": return NAMED case "sqlserver": return AT
Closes #<I> small fix for godror support after goracle package name changed while goracle is deprecated because of naming (trademark) issues.
jmoiron_sqlx
train
go
40ecf990537db62554a076ac59fcd9271538f9c6
diff --git a/packages/idyll-document/test/vars/vars.js b/packages/idyll-document/test/vars/vars.js index <HASH>..<HASH> 100644 --- a/packages/idyll-document/test/vars/vars.js +++ b/packages/idyll-document/test/vars/vars.js @@ -5,12 +5,28 @@ import ast from './ast.json' describe('Component state initialization', () => { it('creates the expected state', () => { - const doc = new InteractiveDocument({ast}) + const doc = new InteractiveDocument({ast}); expect(doc.state).toEqual({x: 2, frequency: 1}); }); it('creates the expected derived vars', () => { - const doc = new InteractiveDocument({ast}) + const doc = new InteractiveDocument({ast}); + expect(doc.derivedVars).toEqual({ + xSquared: { + value: 4, + update: expect.any(Function) + } + }); + }); + + it('can return the expected derived var values', () => { + const doc = new InteractiveDocument({ast}); expect(doc.getDerivedVars()).toEqual({xSquared: 4}); }); + + it('can update the derived vars', () => { + const doc = new InteractiveDocument({ast}); + doc.derivedVars.xSquared.update({x: 3, frequency: 5}); + expect(doc.getDerivedVars()).toEqual({xSquared: 9}); + }); });
More vars and derived vars tests, including updates
idyll-lang_idyll
train
js
599c791a99b43a9d0f348683aaaaa6a0500ec76c
diff --git a/__tests__/cells/identity-test.js b/__tests__/cells/identity-test.js index <HASH>..<HASH> 100644 --- a/__tests__/cells/identity-test.js +++ b/__tests__/cells/identity-test.js @@ -10,6 +10,11 @@ var identity = require('../../lib/cells/identity.js'); describe('identity', function(){ it('formats correctly', function() { var value = "never odd or even"; - expect(identity(value)).toEqual({value: value}); + var formatted = "Never odd or even"; + + expect(identity({ + original: value, + formatted: formatted + })).toEqual({value: formatted}); }); }); \ No newline at end of file
Fix identity test Related to #<I>.
reactabular_reactabular
train
js
7196696e7f8c6c5d5626055176dbe9fceb8c23e5
diff --git a/pymatgen/core/spectrum.py b/pymatgen/core/spectrum.py index <HASH>..<HASH> 100644 --- a/pymatgen/core/spectrum.py +++ b/pymatgen/core/spectrum.py @@ -114,6 +114,9 @@ class Spectrum(MSONable): return self.__class__(self.x, self.y / other, *self._args, **self._kwargs) + __floordiv__ = __truediv__ + __div__ = __truediv__ + def __str__(self): return self.__class__.__name__
Fix div in py2.
materialsproject_pymatgen
train
py
fd60c3fe8ab8d7176cd12f0c9322797f4ba7c915
diff --git a/lib/poolparty/base_packages/haproxy.rb b/lib/poolparty/base_packages/haproxy.rb index <HASH>..<HASH> 100644 --- a/lib/poolparty/base_packages/haproxy.rb +++ b/lib/poolparty/base_packages/haproxy.rb @@ -4,7 +4,7 @@ module PoolParty def enable package({:name => "haproxy"}) - end + end end end diff --git a/lib/poolparty/pool/cloud.rb b/lib/poolparty/pool/cloud.rb index <HASH>..<HASH> 100644 --- a/lib/poolparty/pool/cloud.rb +++ b/lib/poolparty/pool/cloud.rb @@ -74,6 +74,7 @@ module PoolParty def add_poolparty_base_requirements heartbeat + haproxy end def add_service(serv) diff --git a/spec/pool/cloud_spec.rb b/spec/pool/cloud_spec.rb index <HASH>..<HASH> 100644 --- a/spec/pool/cloud_spec.rb +++ b/spec/pool/cloud_spec.rb @@ -203,7 +203,7 @@ describe "Cloud" do @cloud.add_poolparty_base_requirements end it "should add resources onto the heartbeat class inside the cloud" do - @cloud.services.size.should == 1 + @cloud.services.size.should > 0 end it "should store the class heartbeat" do @cloud.services.first.class.should == "heartbeat".class_constant @@ -252,6 +252,8 @@ describe "Cloud" do end it "should include custom functions" do @manifest.should =~ /define line\(\$file/ + + # puts @manifest end end end
Added haproxy into the requirements
auser_poolparty
train
rb,rb,rb
d9e6da2a8e41337285e2f3d3d6b6f040d446a9e2
diff --git a/checkList/checkList.go b/checkList/checkList.go index <HASH>..<HASH> 100644 --- a/checkList/checkList.go +++ b/checkList/checkList.go @@ -1,7 +1,7 @@ package checkList import ( - "errors" + "log" "os/exec" "sync" @@ -109,7 +109,7 @@ func hasLicense(taskName string) (message string, success bool) { hasLicense, err := util.FileExists("license", "licensing") if err != nil { - errors.New("There was a problem with finding the file") + log.Fatal(err) } if hasLicense { @@ -122,7 +122,7 @@ func hasLicense(taskName string) (message string, success bool) { func hasReadme(taskName string) (message string, success bool) { hasReadme, err := util.FileExists("readme") if err != nil { - errors.New("There was a problem with finding the file") + log.Fatal(err) } if hasReadme { @@ -135,7 +135,7 @@ func hasReadme(taskName string) (message string, success bool) { func hasContribution(taskName string) (message string, success bool) { hasContribution, err := util.FileExists("contribution", "contribute", "contributing") if err != nil { - errors.New("There was a problem with finding the file") + log.Fatal(err) } if hasContribution {
chore: Make it pass through gometalinter
karolgorecki_goprove
train
go
2aa71112a6c8c01c6b26ac942aea0d7de6a7dd00
diff --git a/packages/node_modules/@webex/plugin-meetings/src/meeting/index.js b/packages/node_modules/@webex/plugin-meetings/src/meeting/index.js index <HASH>..<HASH> 100644 --- a/packages/node_modules/@webex/plugin-meetings/src/meeting/index.js +++ b/packages/node_modules/@webex/plugin-meetings/src/meeting/index.js @@ -1093,6 +1093,15 @@ export default class Meeting extends StatelessWebexPlugin { }; } + const getTotalJmt = this.getTotalJmt(); + + if (getTotalJmt) { + options.joinTimes = { + ...options.joinTimes, + getTotalJmt + }; + } + if (options.type === MQA_STATS.CA_TYPE) { payload = Metrics.initMediaPayload(options.event, identifiers, options); } @@ -5396,4 +5405,15 @@ export default class Meeting extends StatelessWebexPlugin { return undefined; } + + /** + * + * @returns {string} duration between call initiate and successful locus join (even if it is in lobby) + */ + getTotalJmt() { + const start = this.startCallInitiateJoinReq; + const end = this.endJoinReqResp; + + return (start && end) ? end - start : undefined; + } }
feat(meetings): add totalJmt joinTime metric
webex_spark-js-sdk
train
js
5f1754aa3cc7d9cb8e5caceec123d1673bfdb4ea
diff --git a/rapidoid-pages/src/test/java/org/rapidoid/pages/PlaygroundWidgetTest.java b/rapidoid-pages/src/test/java/org/rapidoid/pages/PlaygroundWidgetTest.java index <HASH>..<HASH> 100644 --- a/rapidoid-pages/src/test/java/org/rapidoid/pages/PlaygroundWidgetTest.java +++ b/rapidoid-pages/src/test/java/org/rapidoid/pages/PlaygroundWidgetTest.java @@ -43,7 +43,7 @@ public class PlaygroundWidgetTest extends PagesTestCommons { hasRegex(ctx, play, "<span[^>]*?>10</span>"); hasRegex(ctx, play, "<button[^>]*?>\\+</button>"); - hasRegex(ctx, play, "<input [^>]*?css=\"border: 1px;\">"); + hasRegex(ctx, play, "<input [^>]*?style=\"border: 1px;\">"); } }
Adapted test to the attribute renaming ("css" into "style").
rapidoid_rapidoid
train
java
3a730543fb185ab591fa9e03bf4b97cbde090343
diff --git a/karma.conf.js b/karma.conf.js index <HASH>..<HASH> 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -21,6 +21,12 @@ module.exports = function(config) { if (process.env.CI && process.env.SAUCE_ACCESS_KEY) { var customLaunchers = { + sauceLabsChrome: { + base: 'SauceLabs', + browserName: 'chrome', + browserVersion: '79.0', + platformName: 'Windows 10' + }, sauceLabsEdge: { base: 'SauceLabs', browserName: 'MicrosoftEdge', @@ -46,11 +52,6 @@ module.exports = function(config) { deviceName: 'Android GoogleAPI Emulator', platformVersion: '9.0', platformName: 'Android' - }, - sauceLabsIE8: { - base: 'SauceLabs', - browserName: 'internet explorer', - version: 8 } };
Migrate testing from IE8 to Chrome IE8 is obsolete.
ruslansagitov_loud
train
js
c05383b99574660fa750e239a404a7b6d8634865
diff --git a/redisson/src/main/java/org/redisson/executor/TasksRunnerService.java b/redisson/src/main/java/org/redisson/executor/TasksRunnerService.java index <HASH>..<HASH> 100644 --- a/redisson/src/main/java/org/redisson/executor/TasksRunnerService.java +++ b/redisson/src/main/java/org/redisson/executor/TasksRunnerService.java @@ -130,7 +130,7 @@ public class TasksRunnerService implements RemoteExecutorService { params.setStartTime(newStartTime); RFuture<Void> future = asyncScheduledServiceAtFixed(params.getExecutorId(), params.getRequestId()).scheduleAtFixedRate(params); try { - executeRunnable(params); + executeRunnable(params, false); } catch (Exception e) { // cancel task if it throws an exception future.cancel(true);
Fixed - RScheduledExecutorService.scheduleAtFixedRate() stops work after some time. #<I>
redisson_redisson
train
java
80ea640901b2495e184780932647f7418bb91b31
diff --git a/lib/webrat/selenium/location_strategy_javascript/label.js b/lib/webrat/selenium/location_strategy_javascript/label.js index <HASH>..<HASH> 100644 --- a/lib/webrat/selenium/location_strategy_javascript/label.js +++ b/lib/webrat/selenium/location_strategy_javascript/label.js @@ -10,7 +10,7 @@ RegExp.escape = function(text) { ); } return text.replace(arguments.callee.sRE, '\\$1'); -} +}; var allLabels = inDocument.getElementsByTagName("label"); var regExp = new RegExp('^\\W*' + RegExp.escape(locator) + '(\\b|$)', 'i'); @@ -30,7 +30,13 @@ candidateLabels = candidateLabels.sortBy(function(s) { }); var locatedLabel = candidateLabels.first(); -var labelFor = locatedLabel.getAttribute('for') || locatedLabel.htmlFor; +var labelFor = null; + +if (locatedLabel.getAttribute('for')) { + labelFor = locatedLabel.getAttribute('for'); +} else if (locatedLabel.attributes['for']) { // IE + labelFor = locatedLabel.attributes['for'].nodeValue; +} if ((labelFor == null) && (locatedLabel.hasChildNodes())) { return locatedLabel.getElementsByTagName('button')[0]
Fix selenium webrat tests in FF/Safari -- locatedLabel.htmlFor returns empty string in FF/Safari which breaks location strategy for label
brynary_webrat
train
js
be31d411edc5e777d68e06858588d1025e9c819d
diff --git a/Geometry/point.py b/Geometry/point.py index <HASH>..<HASH> 100644 --- a/Geometry/point.py +++ b/Geometry/point.py @@ -206,6 +206,7 @@ class Point(object): @classmethod def units(cls): ''' + XXX missing doc string ''' return [cls(1,0,0),cls(0,1,0),cls(0,0,1)]
units missing doc string - still missing but explicit
JnyJny_Geometry
train
py
d6e729889ee2856154b041c866bcbabed3713804
diff --git a/schema_salad/main.py b/schema_salad/main.py index <HASH>..<HASH> 100644 --- a/schema_salad/main.py +++ b/schema_salad/main.py @@ -40,7 +40,7 @@ def printrdf(workflow, # type: str g = jsonld_context.makerdf(workflow, wf, ctx) print(g.serialize(format=sr)) -def chunk_messages(msg): # type: (str) -> List[Tuple[int, str]] +def chunk_messages(msg): # type: (str) -> List[Tuple[int, str]] arr = [] lst = msg.split("\n") while len(lst): @@ -54,7 +54,7 @@ def chunk_messages(msg): # type: (str) -> List[Tuple[int, str]] lst = list(itertools.dropwhile(lambda x: x.startswith(' '), lst[1:])) return arr -def to_one_line_messages(msg): # type: (str) -> str +def to_one_line_messages(msg): # type: (str) -> str ret = [] max_elem = (0, '') for (indent, msg) in chunk_messages(msg):
Fix for pylint
common-workflow-language_schema_salad
train
py
f0256ebbbef05e97a6f581e659147d84fb99aad7
diff --git a/lib/modules/apostrophe-pages/lib/pagesCursor.js b/lib/modules/apostrophe-pages/lib/pagesCursor.js index <HASH>..<HASH> 100644 --- a/lib/modules/apostrophe-pages/lib/pagesCursor.js +++ b/lib/modules/apostrophe-pages/lib/pagesCursor.js @@ -28,9 +28,6 @@ module.exports = { self.addFilter('ancestors', { def: false, - set: function(c) { - self.set('ancestors', c); - }, after: function(results, callback) { var options = self.get('ancestors');
restored test behavior, removed unnecessary else clause, removed unnecessary setter used for debugging
apostrophecms_apostrophe
train
js
4b905b8422d8fe5f2c71ef211cd97e8dd729bd29
diff --git a/Component/Routing/Route/Route.php b/Component/Routing/Route/Route.php index <HASH>..<HASH> 100755 --- a/Component/Routing/Route/Route.php +++ b/Component/Routing/Route/Route.php @@ -2,11 +2,15 @@ namespace Fapi\Component\Routing\Route; +use \InvalidArgumentException; + /** * Fapi\Component\Routing\Route\Route */ class Route { + public static $availableMethods = array('HEAD', 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'PURGE', 'OPTIONS', 'TRACE', 'CONNECT'); + /** * Path of the Route *
Adds list of methods allowed for Route
rybakdigital_fapi
train
php
951352507c88bc2430bf21d00adf16b1e55de105
diff --git a/ez_setup.py b/ez_setup.py index <HASH>..<HASH> 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -31,7 +31,7 @@ try: except ImportError: USER_SITE = None -DEFAULT_VERSION = "3.4.3" +DEFAULT_VERSION = "3.4.4" DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" def _python_cmd(*args): diff --git a/setuptools/version.py b/setuptools/version.py index <HASH>..<HASH> 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '3.4.3' +__version__ = '3.4.4'
Bumped to <I> in preparation for next release.
pypa_setuptools
train
py,py
efd6700b0a4ab9db589cc363c4b4fc5efa33c88e
diff --git a/lib/python/dxpy/program_builder.py b/lib/python/dxpy/program_builder.py index <HASH>..<HASH> 100644 --- a/lib/python/dxpy/program_builder.py +++ b/lib/python/dxpy/program_builder.py @@ -87,6 +87,14 @@ def upload_program(src_dir, uploaded_resources, check_name_collisions=True, over program_id = dxpy.api.programNew(program_spec)["id"] - dxpy.api.programSetProperties(program_id, {"project": dxpy.WORKSPACE_ID, "properties": {"name": program_spec["name"]}}) + properties = {"name": program_spec["name"]} + if "short_description" in program_spec: + properties["short_description"] = program_spec["short_description"] + if "description" in program_spec: + properties["description"] = program_spec["description"] + if "category" in program_spec: + properties["category"] = program_spec["category"] + + dxpy.api.programSetProperties(program_id, {"project": dxpy.WORKSPACE_ID, "properties": properties}) return program_id
Populate properties short_description, description, and category.
dnanexus_dx-toolkit
train
py
315e459570c6285a0761f917477a364daac1028a
diff --git a/modules/wybs/src/wybs/lang/Build.java b/modules/wybs/src/wybs/lang/Build.java index <HASH>..<HASH> 100644 --- a/modules/wybs/src/wybs/lang/Build.java +++ b/modules/wybs/src/wybs/lang/Build.java @@ -97,4 +97,30 @@ public interface Build { public <T> Path.Entry<T> create(Path.ID id, Content.Type<T> ct, Path.Entry<?>... sources) throws IOException; } + + /** + * A build rule is an abstraction describing how a set of one or more source + * files should be compiled. Each build rule is associated with a builder + * responsible for compiling matching files. + * + * @author David J. Pearce + * + */ + public interface Rule { + + /** + * <p> + * Apply this rule to a given compilation group, producing a set of + * generated files. This set may be empty if the rule does not match + * against any source file in the group. + * </p> + * + * @param The + * set of files currently being compiled. + * @return The set of files generated by this rule (which may be empty, + * but cannot be <code>null</code>). + * @throws IOException + */ + public Set<Path.Entry<?>> apply(Set<Path.Entry<?>> group) throws IOException; + } }
WyBS: Working on improved design of the build system. It's coming along, though still a few things to figure out.
Whiley_WhileyCompiler
train
java
6643e6fdf4bc19d1349854daeeb1c7d758262a0f
diff --git a/bokeh/client/session.py b/bokeh/client/session.py index <HASH>..<HASH> 100644 --- a/bokeh/client/session.py +++ b/bokeh/client/session.py @@ -167,7 +167,7 @@ class ClientSession(object): """ self.connect() if not self._connection.connected: - raise IOError("Cannot pull session document because we failed to connect to the server") + raise IOError("Cannot pull session document because we failed to connect to the server (to start the server, try the 'bokeh serve' command)") if self._document is None: doc = Document() @@ -202,7 +202,7 @@ class ClientSession(object): self.connect() if not self._connection.connected: - raise IOError("Cannot push session document because we failed to connect to the server") + raise IOError("Cannot push session document because we failed to connect to the server (to start the server, try the 'bokeh serve' command)") self._connection.push_doc(doc) if self._document is None: self._attach_document(doc)
Specifically suggest running 'bokeh serve' if we can't connect to server
bokeh_bokeh
train
py
8e1bba92715ff05af39817d00e293d408c3074dd
diff --git a/test/mp/helpers/entry-runtime-with-compiler.js b/test/mp/helpers/entry-runtime-with-compiler.js index <HASH>..<HASH> 100644 --- a/test/mp/helpers/entry-runtime-with-compiler.js +++ b/test/mp/helpers/entry-runtime-with-compiler.js @@ -31,7 +31,8 @@ Vue.prototype.$mount = function ( imports: { test: { name: 'test' }, test2: { name: 'test2' }, - test3: { name: 'test3' } + test3: { name: 'test3' }, + child: { name: 'child' } }, transformAssetUrls: { img: 'src'
test: fix entry runtime, add components: "child"
kaola-fed_megalo
train
js
5df4e590ddb5425cd52a4965ab7b04e0356a8ebe
diff --git a/google-cloud-logging/test/google/cloud/logging/middleware_test.rb b/google-cloud-logging/test/google/cloud/logging/middleware_test.rb index <HASH>..<HASH> 100644 --- a/google-cloud-logging/test/google/cloud/logging/middleware_test.rb +++ b/google-cloud-logging/test/google/cloud/logging/middleware_test.rb @@ -46,8 +46,14 @@ describe Google::Cloud::Logging::Middleware, :mock_logging do } describe "#initialize" do + let(:default_credentials) { OpenStruct.new empty: true } + it "creates a default logger object if one isn't provided" do - middleware = Google::Cloud::Logging::Middleware.new rack_app + Google::Cloud::Logging::Project.stub :default_project, project do + Google::Cloud::Logging::Credentials.stub :default, default_credentials do + middleware = Google::Cloud::Logging::Middleware.new rack_app + end + end middleware.logger.must_be_kind_of Google::Cloud::Logging::Logger end
Stub project_id for unit test failure
googleapis_google-cloud-ruby
train
rb
a6da372b1be0b36154d23a5dff8cfa3aa379957e
diff --git a/Model/Variant.php b/Model/Variant.php index <HASH>..<HASH> 100644 --- a/Model/Variant.php +++ b/Model/Variant.php @@ -269,7 +269,7 @@ class Variant implements VariantInterface /** * {@inheritdoc} */ - public function setDeletedAt(\DateTime $deletedAt) + public function setDeletedAt(\DateTime $deletedAt = null) { $this->deletedAt = $deletedAt;
Added option to undelete resource (product) and separete listing of products and deleted products cleanup Update product.yml Update Product.php fixed namings
Sylius_Variation
train
php
9ec5b47a1a4cf0b5910917aa6785720d1b817239
diff --git a/tests/models.py b/tests/models.py index <HASH>..<HASH> 100644 --- a/tests/models.py +++ b/tests/models.py @@ -2965,10 +2965,10 @@ class TestCountUnionRegression(ModelTestCase): lhs = User.select() rhs = User.select() - query = (lhs & rhs) + query = (lhs | rhs) self.assertSQL(query, ( 'SELECT "t1"."id", "t1"."username" FROM "users" AS "t1" ' - 'INTERSECT ' + 'UNION ' 'SELECT "t2"."id", "t2"."username" FROM "users" AS "t2"'), []) self.assertEqual(query.count(), 5) @@ -2976,7 +2976,7 @@ class TestCountUnionRegression(ModelTestCase): query = query.limit(3) self.assertSQL(query, ( 'SELECT "t1"."id", "t1"."username" FROM "users" AS "t1" ' - 'INTERSECT ' + 'UNION ' 'SELECT "t2"."id", "t2"."username" FROM "users" AS "t2" ' 'LIMIT ?'), [3]) self.assertEqual(query.count(), 3)
MySQL doesn't support INTERSECT.
coleifer_peewee
train
py
b6b2cce467f37b6a3ebfea668604bb9ec2f00f09
diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb index <HASH>..<HASH> 100644 --- a/lib/axlsx/workbook/worksheet/cell.rb +++ b/lib/axlsx/workbook/worksheet/cell.rb @@ -175,14 +175,14 @@ module Axlsx # @option options [String] color an 8 letter rgb specification # @option options [Symbol] scheme must be one of :none, major, :minor def initialize(row, value="", options={}) - self.row=row + self.row=row @styles = row.worksheet.workbook.styles - @style = 0 - @type = cell_type_from_value(value) @row.cells << self options.each do |o| self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" end + @style ||= 0 + @type ||= cell_type_from_value(value) @value = cast_value(value) end
Little performance improvement. It doesn't need to do type detection if it is passed by options
randym_axlsx
train
rb
05dad88ff43cc2f4185fb3da9a6c37d0630045e7
diff --git a/test/libs/router.spec.js b/test/libs/router.spec.js index <HASH>..<HASH> 100644 --- a/test/libs/router.spec.js +++ b/test/libs/router.spec.js @@ -5,9 +5,14 @@ import Router from 'src/libs/router'; describe('Class Router', () => { - it('should throw an error if passed object is not an object', () => { + describe('static newUrl() method', () => { - (() => { Router.create().should.throw('Passed Object must be an object {}')}); + it('should return url object with fragment property', () => { + + let url = Router.newUrl('http://www.mydomain.com/path/to/somewhere.html?a=1&b=2'); + url.fragment.should.equal('/path/to/somewhere.html?a=1&b=2'); + + }); });
Router.test: added tests for Router.newUrl; removed no needed test
SerkanSipahi_app-decorators
train
js
084079f446570ba43114857ea1a54df896201419
diff --git a/airflow/www/extensions/init_security.py b/airflow/www/extensions/init_security.py index <HASH>..<HASH> 100644 --- a/airflow/www/extensions/init_security.py +++ b/airflow/www/extensions/init_security.py @@ -35,7 +35,8 @@ def init_xframe_protection(app): return def apply_caching(response): - response.headers["X-Frame-Options"] = "DENY" + if not x_frame_enabled: + response.headers["X-Frame-Options"] = "DENY" return response app.after_request(apply_caching)
Set X-Frame-Options header to DENY only if X_FRAME_ENABLED is set to true. (#<I>)
apache_airflow
train
py
3105bd70e4d25c1f075104faf37b73d60affafe4
diff --git a/prometheus/metric.go b/prometheus/metric.go index <HASH>..<HASH> 100644 --- a/prometheus/metric.go +++ b/prometheus/metric.go @@ -235,6 +235,16 @@ func (state *metricState) collect(metrics []metric, mtype metricType, name, help state.mutex.Lock() switch mtype { + case counter, gauge: + metrics = append(metrics, metric{ + mtype: mtype, + name: name, + help: help, + value: state.value, + time: state.time, + labels: state.labels, + }) + case histogram: for _, bucket := range state.buckets { metrics = append(metrics, metric{ @@ -264,17 +274,6 @@ func (state *metricState) collect(metrics []metric, mtype metricType, name, help labels: state.labels, }, ) - - default: - metrics = append(metrics, metric{ - mtype: mtype, - name: name, - help: help, - value: state.value, - time: state.time, - labels: state.labels, - }) - } state.mutex.Unlock()
don't risk producing metrics of unknown types
segmentio_stats
train
go
637b0133a8b706bffa09f41071cc7bd6a5e8f7b4
diff --git a/app/webroot/test.php b/app/webroot/test.php index <HASH>..<HASH> 100644 --- a/app/webroot/test.php +++ b/app/webroot/test.php @@ -18,7 +18,6 @@ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ set_time_limit(0); -ini_set('memory_limit','128M'); ini_set('display_errors', 1); /** * Use the DS to separate the directories in other defines
Removing memory limit configuration from test.php. Was problematic in that it would override php.ini settings which could be higher.
cakephp_cakephp
train
php
25a044d99b5d213ee1176d8c9f93930709e431a1
diff --git a/doc/conf.py b/doc/conf.py index <HASH>..<HASH> 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -88,6 +88,19 @@ pygments_style = 'sphinx' # turn off flags by hand using :no-members: autodoc_default_flags = ['members', 'show-inheritance', 'inherited-members'] +# This value selects what content will be inserted into the main body of an autoclass directive. +# The possible values are: +# +# "class" +# Only the class’ docstring is inserted. This is the default. You can still document __init__ as a separate method using automethod or the members option to autoclass. +# +# "both" +# Both the class’ and the __init__ method’s docstring are concatenated and inserted. +# +# "init" +# Only the __init__ method’s docstring is inserted. +autoclass_content = 'both' + # Show the code used to generate a plot with matplotlib plot_include_source = True
[doc] Document cythonized code
fredRos_pypmc
train
py
9ed6cb897fcfe418a3d5a00947ae4fbb465dd955
diff --git a/tests/bootstrap-dist.php b/tests/bootstrap-dist.php index <HASH>..<HASH> 100644 --- a/tests/bootstrap-dist.php +++ b/tests/bootstrap-dist.php @@ -7,6 +7,5 @@ use Proem\Loader\Autoloader; $loader = new AutoLoader(); $loader->registerNamespaces([ 'Proem\\Tests' => 'tests/lib', - 'Proem' => 'lib', - 'PHPUnit_' => '/usr/share/php/PHPUnit' -])->register(); + 'Proem' => 'lib' +])->registerPearPrefix('PHPUnit_', '/usr/share/php/PHPUnit')->register();
Fixing bootstrap-dist.php to use PearPrefixes for PHPUnit
proem-components_signal
train
php
9358496dc4b2fa101ca1365aedd9ec1fb345c876
diff --git a/lib/rr/adapters/test_unit_1.rb b/lib/rr/adapters/test_unit_1.rb index <HASH>..<HASH> 100644 --- a/lib/rr/adapters/test_unit_1.rb +++ b/lib/rr/adapters/test_unit_1.rb @@ -34,7 +34,9 @@ module RR alias_method :teardown_without_rr, :teardown def teardown_with_rr RR.verify + rescue => e teardown_without_rr + raise e end alias_method :teardown, :teardown_with_rr end
Fix Test::Unit adapters to ensure teardown is run if RR.verify borks
rr_rr
train
rb
46fd71b63d1f42ebd2c33718b94b87025f9b298d
diff --git a/src/implementations/react/src/elements/components/GlobalNav/GlobalNav.js b/src/implementations/react/src/elements/components/GlobalNav/GlobalNav.js index <HASH>..<HASH> 100644 --- a/src/implementations/react/src/elements/components/GlobalNav/GlobalNav.js +++ b/src/implementations/react/src/elements/components/GlobalNav/GlobalNav.js @@ -18,6 +18,8 @@ class GlobalNav extends Component { links: PropTypes.arrayOf(PropTypes.object), onHeaderClick: PropTypes.func, onSuperHeaderClick: PropTypes.func, + onModuleClick: PropTypes.func, + onSubmoduleClick: PropTypes.func, superHeaderLabel: PropTypes.string, superHeaderLink: PropTypes.string }), @@ -161,4 +163,3 @@ class GlobalNav extends Component { } export default GlobalNav; -
add proptypes for sidenav callbacks through globalnav
Autodesk_hig
train
js
8267e0d117a49e95fc4cc06811293d3b5627f95b
diff --git a/src/CartItem.php b/src/CartItem.php index <HASH>..<HASH> 100644 --- a/src/CartItem.php +++ b/src/CartItem.php @@ -226,10 +226,8 @@ class CartItem */ public function getDiscount($format = true) { - $discount = $this->discount; - return \App::make(LaraCart::SERVICE)->formatMoney( - $discount, + $this->discount, $this->locale, $this->internationalFormat, $format
no reason to store it in avariable
lukepolo_laracart
train
php
63fbda3bc5d62aa35c342a182ccd3c66f7246373
diff --git a/src/withAutofillProps.js b/src/withAutofillProps.js index <HASH>..<HASH> 100644 --- a/src/withAutofillProps.js +++ b/src/withAutofillProps.js @@ -3,6 +3,7 @@ import wrapDisplayName from 'recompose/wrapDisplayName' const startAnimationName = 'onAutofillStart' const endAnimationName = 'onAutofillCancel' +const styleElementId = 'autofill-style' const isWebkit = () => navigator.userAgent.indexOf('WebKit') !== -1 @@ -16,9 +17,13 @@ const emptyAnimation = animationName => { } const injectStyle = style => { - const styleElement = document.createElement('style') + let styleElement = document.getElementById(styleElementId) - document.head.appendChild(styleElement) + if (!styleElement) { + styleElement = document.createElement('style') + styleElement.id = styleElementId + document.head.appendChild(styleElement) + } let styleSheet = styleElement.sheet
create only one style element to inject to
klarna_higher-order-components
train
js
f8ee085dc7deb8fb88e2b60fb4cbcb414272ec8d
diff --git a/lxc/main.go b/lxc/main.go index <HASH>..<HASH> 100644 --- a/lxc/main.go +++ b/lxc/main.go @@ -343,7 +343,7 @@ func (c *cmdGlobal) PreRun(cmd *cobra.Command, args []string) error { } if !shared.StringInSlice(cmd.Name(), []string{"init", "launch"}) { - fmt.Fprintf(os.Stderr, i18n.G("To start your first instance, try: lxc launch ubuntu:18.04")+"\n") + fmt.Fprintf(os.Stderr, i18n.G("To start your first instance, try: lxc launch ubuntu:20.04")+"\n") flush = true }
lxc: suggest <I> as the first container to launch instead of <I>
lxc_lxd
train
go
2d22f62562a090f509854d35e47c75029d2f19e8
diff --git a/lib/scruffy/version.rb b/lib/scruffy/version.rb index <HASH>..<HASH> 100644 --- a/lib/scruffy/version.rb +++ b/lib/scruffy/version.rb @@ -2,7 +2,7 @@ module Scruffy module VERSION #:nodoc: MAJOR = 0 MINOR = 2 - TINY = 5 + TINY = 6 STRING = [MAJOR, MINOR, TINY].join('.') end
Changed version to <I>
brasten_scruffy
train
rb
ac9b223c51a51a7d09e294cf1d331b6607043a94
diff --git a/scripts/config.js b/scripts/config.js index <HASH>..<HASH> 100644 --- a/scripts/config.js +++ b/scripts/config.js @@ -8,6 +8,7 @@ const flow = require('rollup-plugin-flow-no-whitespace') const version = process.env.VERSION || require('../package.json').version const weexVersion = process.env.WEEX_VERSION || require('../packages/weex-vue-framework/package.json').version const featureFlags = require('./feature-flags') +const vueCoreVersion = '2.6.6' // const banner = // '/*!\n' + @@ -260,7 +261,8 @@ function genConfig (name) { const vars = { __WEEX__: !!opts.weex, __WEEX_VERSION__: weexVersion, - __VERSION__: version + __VERSION__: vueCoreVersion, + __MEGALO_VERSION__: version } // feature flags Object.keys(featureFlags).forEach(key => { diff --git a/src/platforms/mp/entry-runtime.js b/src/platforms/mp/entry-runtime.js index <HASH>..<HASH> 100644 --- a/src/platforms/mp/entry-runtime.js +++ b/src/platforms/mp/entry-runtime.js @@ -2,4 +2,6 @@ import Vue from './runtime/index' +Vue.megaloVersion = '__MEGALO_VERSION__' + export default Vue
feat: use Vue core as Vue.version and add Vue.megaloVersion #<I>
kaola-fed_megalo
train
js,js
527cafb42b0b3a7cd0da84355c2f00b7365452b4
diff --git a/lib/createMd.js b/lib/createMd.js index <HASH>..<HASH> 100644 --- a/lib/createMd.js +++ b/lib/createMd.js @@ -40,7 +40,7 @@ function showState(state) { line.push(state.indicator ? 'X' : ' '); //line.push(state.noSubscribe ? 'NS' : ''); - line.push(state.role ? '`' + state.role.replace(/\|/g, '\|') + '`' : ''); //escape | character inside table cell! + line.push(state.role ? '``' + state.role.replace(/\|/g, '\|') + '``' : ''); //escape | character inside table cell! return line; }
with double backticks single backtick is allowed
ioBroker_ioBroker.type-detector
train
js
fca8e6e018bdac9cebe18d115d397fad034ede02
diff --git a/juju/constraints.py b/juju/constraints.py index <HASH>..<HASH> 100644 --- a/juju/constraints.py +++ b/juju/constraints.py @@ -81,6 +81,11 @@ def normalize_value(value): if value.isdigit(): return int(value) + + if value.lower() == 'true': + return True + if value.lower() == 'false': + return False return value
Added boolean entries to normalize values.
juju_python-libjuju
train
py
4258facd7e72269f21702af2580c281432ee9107
diff --git a/extensions/breadcrumb-trail.php b/extensions/breadcrumb-trail.php index <HASH>..<HASH> 100644 --- a/extensions/breadcrumb-trail.php +++ b/extensions/breadcrumb-trail.php @@ -131,7 +131,7 @@ class Breadcrumb_Trail { /* Add 'browse' label if it should be shown. */ if ( true === $this->args['show_browse'] ) - $breadcrumb .= "\n\t\t\t" . '<span class="trail-browse">' . $this->args['labels']['browse'] . '</span>'; + $breadcrumb .= "\n\t\t\t" . '<span class="trail-browse">' . $this->args['labels']['browse'] . '</span> '; /* Adds the 'trail-begin' class around first item if there's more than one item. */ if ( 1 < count( $this->items ) )
Need space at the end of the 'browse' argument.
justintadlock_hybrid-core
train
php
2d7ef5f17c904ea52cedcb23dfefb322c271ded7
diff --git a/lib/leaflet-rails/version.rb b/lib/leaflet-rails/version.rb index <HASH>..<HASH> 100644 --- a/lib/leaflet-rails/version.rb +++ b/lib/leaflet-rails/version.rb @@ -1,5 +1,5 @@ module Leaflet module Rails - VERSION = "0.4.5" + VERSION = "0.5.0.beta1" end end
Update version number to <I>.beta1.
axyjo_leaflet-rails
train
rb
2dba36808adc79267b311de6ecd0a068f8d2958b
diff --git a/checkmgr/metrics.go b/checkmgr/metrics.go index <HASH>..<HASH> 100644 --- a/checkmgr/metrics.go +++ b/checkmgr/metrics.go @@ -44,6 +44,10 @@ func (cm *CheckManager) ActivateMetric(name string) bool { func (cm *CheckManager) AddMetricTags(metricName string, tags []string, appendTags bool) bool { tagsUpdated := false + if !cm.enabled { + return tagsUpdated + } + if appendTags && len(tags) == 0 { return tagsUpdated }
upd: short circuit AddMetricTags if check management is not enabled
circonus-labs_circonus-gometrics
train
go
a7675228cc95fe63939e2cfe883bea72127c5046
diff --git a/src/Controller/Backend/BackendBase.php b/src/Controller/Backend/BackendBase.php index <HASH>..<HASH> 100644 --- a/src/Controller/Backend/BackendBase.php +++ b/src/Controller/Backend/BackendBase.php @@ -56,7 +56,9 @@ abstract class BackendBase extends Base // Handle the case where the route doesn't equal the role. if ($roleRoute === null) { - $roleRoute = $route; + $roleRoute = $this->getRoutePermission($route); + } else { + $roleRoute = $this->getRoutePermission($roleRoute); } // Sanity checks for doubles in in contenttypes. This has to be done @@ -119,6 +121,24 @@ abstract class BackendBase extends Base } /** + * Temporary hack to get the permission name associated with the route. + * + * @internal + * + * @param string $route + * + * @return string + */ + private function getRoutePermission($route) + { + if ($route === 'omnisearch-results') { + return 'omnisearch'; + } + + return $route; + } + + /** * Set the authentication cookie in the response. * * @param Response $response
Temporary hack to get the permission name associated with the route
bolt_bolt
train
php
059d22bd77e0757d96ffc36f2043c2fda2e92a88
diff --git a/app/models/issn_record.rb b/app/models/issn_record.rb index <HASH>..<HASH> 100644 --- a/app/models/issn_record.rb +++ b/app/models/issn_record.rb @@ -1,3 +1,4 @@ class IssnRecord < ActiveRecord::Base belongs_to :manifestation + validates :body, presence: true, uniqueness: {scope: :issn_type} end
add valiation to IssnRecord
next-l_enju_biblio
train
rb
4a2a5a6a82a688d1cbee90e25031c900589384a3
diff --git a/Kwf/Loader.php b/Kwf/Loader.php index <HASH>..<HASH> 100644 --- a/Kwf/Loader.php +++ b/Kwf/Loader.php @@ -35,7 +35,14 @@ class Kwf_Loader { static $namespaces; if (!isset($namespaces)) { - $namespaces = include VENDOR_PATH.'/composer/autoload_namespaces.php'; + $namespaces = array(); + $composerNamespaces = include VENDOR_PATH.'/composer/autoload_namespaces.php'; + foreach ($composerNamespaces as $namespace => $path) { + if (strpos($namespace, '\\') === false && substr($namespace, -1) != '_') { + $namespace = $namespace.'_'; + } + $namespaces[$namespace] = $path; + } } static $classMap; if (!isset($classMap)) {
Normalize the composer namepaces to fit for our Kwf_Loader e.g. PHPExcel -> PHPExcel_
koala-framework_koala-framework
train
php
850fd1ab3db7ee27c0aefad49b38cef621dc3134
diff --git a/src/test/org/openscience/cdk/coverage/SignatureCoverageTest.java b/src/test/org/openscience/cdk/coverage/SignatureCoverageTest.java index <HASH>..<HASH> 100644 --- a/src/test/org/openscience/cdk/coverage/SignatureCoverageTest.java +++ b/src/test/org/openscience/cdk/coverage/SignatureCoverageTest.java @@ -18,6 +18,7 @@ */ package org.openscience.cdk.coverage; +import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; @@ -39,7 +40,7 @@ public class SignatureCoverageTest extends CoverageAnnotationTest { @Test public void testCoverage() { - super.runCoverageTest(); + Assert.assertTrue(super.runCoverageTest()); } }
Added the missing assert: runCoverageTest() returns a boolean stating the success
cdk_cdk
train
java
2ff694eaefbb7efd2089d9c2ecb8b7575bfa55cf
diff --git a/findbugs/src/java/edu/umd/cs/findbugs/detect/FindOpenStream.java b/findbugs/src/java/edu/umd/cs/findbugs/detect/FindOpenStream.java index <HASH>..<HASH> 100644 --- a/findbugs/src/java/edu/umd/cs/findbugs/detect/FindOpenStream.java +++ b/findbugs/src/java/edu/umd/cs/findbugs/detect/FindOpenStream.java @@ -258,7 +258,8 @@ public class FindOpenStream extends ResourceTrackingDetector<Stream, FindOpenStr // Does this instruction close the stream? INVOKESPECIAL inv = (INVOKESPECIAL) ins; - if (getInstanceValue(frame, inv, cpg).isInstance() && + if (frame.isValid() && + getInstanceValue(frame, inv, cpg).isInstance() && matchMethod(inv, cpg, resource.getResourceClass(), "<init>")) return true; } @@ -275,7 +276,8 @@ public class FindOpenStream extends ResourceTrackingDetector<Stream, FindOpenStr // Does this instruction close the stream? INVOKEVIRTUAL inv = (INVOKEVIRTUAL) ins; - if (!getInstanceValue(frame, inv, cpg).isInstance()) + if (!frame.isValid() || + !getInstanceValue(frame, inv, cpg).isInstance()) return false; // It's a close if the invoked class is any subtype of the stream base class.
Check that frame is valid before getting a ResourceValue from it. git-svn-id: <URL>
spotbugs_spotbugs
train
java
e0cab8f91a978df82fe78d863322475577ddb532
diff --git a/src/Page.php b/src/Page.php index <HASH>..<HASH> 100644 --- a/src/Page.php +++ b/src/Page.php @@ -99,7 +99,7 @@ final class Page implements PageInterface return; } - return new self($this->adapter, $this->strategy, $this->perPage, $this->number + 1); + return $this->getPage($this->number + 1); } /** @@ -111,7 +111,7 @@ final class Page implements PageInterface return; } - return new self($this->adapter, $this->strategy, $this->perPage, $this->number - 1); + return $this->getPage($this->number - 1); } /** @@ -219,4 +219,16 @@ final class Page implements PageInterface return $this->itemsWithOneExtra; } + + /** + * Creates a new page with the given number. + * + * @param integer $number + * + * @return Page + */ + private function getPage($number) + { + return new self($this->adapter, $this->strategy, $this->perPage, $number); + } }
Refactor page creation to single method in Page
kgilden_pager
train
php
3c08a308ed85bb5cc64c6fd847738158d086557b
diff --git a/test/db/postgres_config.rb b/test/db/postgres_config.rb index <HASH>..<HASH> 100644 --- a/test/db/postgres_config.rb +++ b/test/db/postgres_config.rb @@ -12,3 +12,7 @@ POSTGRES_CONFIG[:port] = ENV['PGPORT'] if ENV['PGPORT'] unless ( ps = ENV['PREPARED_STATEMENTS'] || ENV['PS'] ).nil? POSTGRES_CONFIG[:prepared_statements] = ps end + +unless ( it = ENV['INSERT_RETURNING'] ).nil? + POSTGRES_CONFIG[:insert_returning] = it +end
support running Postgres' tests with "INSERT RETURNING" configuration
jruby_activerecord-jdbc-adapter
train
rb
025949a54b31c78f900ca172fc1ffff63ff5fae6
diff --git a/src/qtism/data/AssessmentItem.php b/src/qtism/data/AssessmentItem.php index <HASH>..<HASH> 100644 --- a/src/qtism/data/AssessmentItem.php +++ b/src/qtism/data/AssessmentItem.php @@ -39,7 +39,6 @@ use qtism\data\processing\ResponseProcessing; use qtism\common\utils\Format; use \SplObjectStorage; use \InvalidArgumentException; -use \SplObserver; /** * The AssessmentItem QTI class implementation. It contains all the information @@ -796,4 +795,9 @@ class AssessmentItem extends QtiComponent implements QtiIdentifiable, IAssessmen return new QtiComponentCollection($comp); } + + public function __clone() + { + $this->setObservers(new SplObjectStorage()); + } }
Remove observers while cloned.
oat-sa_qti-sdk
train
php
946e709b4de6fb123ab0646f979814fd21c6e2aa
diff --git a/src/voronoi.js b/src/voronoi.js index <HASH>..<HASH> 100644 --- a/src/voronoi.js +++ b/src/voronoi.js @@ -28,13 +28,14 @@ export default class Voronoi { } while (j !== i); if (j !== i) { // Stopped when walking forward; walk backward. + const k = halfedges[i % 3 === 0 ? i + 2 : i - 1]; const e1 = e; j = i; - while (true) { + do { j = halfedges[j % 3 === 0 ? j + 2 : j - 1]; if (j === -1 || triangles[j] !== t) break; edges[e++] = Math.floor(j / 3); - } + } while (j !== k); if (e1 < e) { edges.subarray(e0, e1).reverse(); edges.subarray(e0, e).reverse();
Fix #<I> hang on bad triangulation.
d3_d3-delaunay
train
js
858163c3f55064dcbff3a3895bbb787cf37753fa
diff --git a/adaptors/mongoose-normalize.adp.js b/adaptors/mongoose-normalize.adp.js index <HASH>..<HASH> 100644 --- a/adaptors/mongoose-normalize.adp.js +++ b/adaptors/mongoose-normalize.adp.js @@ -23,6 +23,9 @@ var MongooseNormalize = module.exports = cip.extend(function(mongooseAdp) { */ MongooseNormalize.prototype.normalizeItem = function(item) { var normalizedItem = this._normalizeActual(item); + if (!normalizedItem) { + return normalizedItem; + } if (this.mongooseAdp._hasEagerLoad) { this.mongooseAdp._eagerLoad.forEach(function(attr) {
fix cases where no results and normalize is on
thanpolas_entity
train
js
365513b07b910acd752a5f58c33b8cc8abc112b5
diff --git a/middleware/modelExport.js b/middleware/modelExport.js index <HASH>..<HASH> 100644 --- a/middleware/modelExport.js +++ b/middleware/modelExport.js @@ -348,7 +348,7 @@ module.exports = { if (getTransposeFn(form, fieldName, 'export')) { - return promises.push(getTransposeFn(form, fieldName, 'export')(doc[fieldName]) + return promises.push(getTransposeFn(form, fieldName, 'export')(doc[fieldName], doc) .then((val) => (doc[fieldName] = val))); }
also pass the record to transpose functions
linzjs_linz
train
js
b227fe7e2afd438c134e9d4b600f1f5e882483c2
diff --git a/test/test_controller.go b/test/test_controller.go index <HASH>..<HASH> 100644 --- a/test/test_controller.go +++ b/test/test_controller.go @@ -114,7 +114,11 @@ func unmarshalControllerExample(data []byte) (map[string]interface{}, error) { } func (s *ControllerSuite) generateControllerExamples(t *c.C) map[string]interface{} { - cmd := exec.Command(exec.DockerImage(imageURIs["controller-examples"]), "/bin/flynn-controller-examples") + cmd := exec.CommandUsingCluster( + s.clusterClient(t), + exec.DockerImage(imageURIs["controller-examples"]), + "/bin/flynn-controller-examples", + ) cmd.Env = map[string]string{ "CONTROLLER_KEY": s.clusterConf(t).Key, "SKIP_MIGRATE_DOMAIN": "true",
test: Use explicit cluster client in controller examples test
flynn_flynn
train
go
aea529d9f6d1a0ffbd34a7a36d1fc7db41dc8fbc
diff --git a/tlv/record.go b/tlv/record.go index <HASH>..<HASH> 100644 --- a/tlv/record.go +++ b/tlv/record.go @@ -57,6 +57,20 @@ func (f *Record) Size() uint64 { return f.sizeFunc() } +// Type returns the type of the underlying TLV record. +func (f *Record) Type() Type { + return f.typ +} + +// Encode writes out the TLV record to the passed writer. This is useful when a +// caller wants to obtain the raw encoding of a *single* TLV record, outside +// the context of the Stream struct. +func (f *Record) Encode(w io.Writer) error { + var b [8]byte + + return f.encoder(w, f.value, &b) +} + // MakePrimitiveRecord creates a record for common types. func MakePrimitiveRecord(typ Type, val interface{}) Record { var (
tlv: add new Type() and Encode() methods to Record In this commit, we add two new method so the `Record` struct: Type() and Encode(). These are useful when a caller is handling a record and may not know its underlying type and may need to encode a record in isolation.
lightningnetwork_lnd
train
go
62a41a45700639367dbdd1daa1bebd71667d3134
diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLSelect.java b/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLSelect.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLSelect.java +++ b/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLSelect.java @@ -2153,8 +2153,6 @@ public class OCommandExecutorSQLSelect extends OCommandExecutorSQLResultsetAbstr } } - metricRecorder.recordInvolvedIndexesMetric(index); - OIndexCursor cursor; indexIsUsedInOrderBy = orderByOptimizer.canBeUsedByOrderBy(index, orderedFields) && !(index.getInternal() instanceof OChainedIndexProxy); @@ -2169,6 +2167,9 @@ public class OCommandExecutorSQLSelect extends OCommandExecutorSQLResultsetAbstr context.setVariable("$limit", limit); cursor = operator.executeIndexQuery(context, index, keyParams, ascSortOrder); + if(cursor!=null){ + metricRecorder.recordInvolvedIndexesMetric(index); + } } catch (OIndexEngineException e) { throw e;
Fix EXPLAIN with multiple indexes
orientechnologies_orientdb
train
java
9b473ca57bbbaef01b908fff4b8f673832934540
diff --git a/test/integration/advanced.js b/test/integration/advanced.js index <HASH>..<HASH> 100644 --- a/test/integration/advanced.js +++ b/test/integration/advanced.js @@ -5,7 +5,7 @@ var blockchain = require('./_blockchain') describe('bitcoinjs-lib (advanced)', function () { it('can create an OP_RETURN transaction', function (done) { - this.timeout(20000) + this.timeout(30000) var network = bitcoin.networks.testnet var keyPair = bitcoin.ECPair.makeRandom({ network: network }) diff --git a/test/integration/crypto.js b/test/integration/crypto.js index <HASH>..<HASH> 100644 --- a/test/integration/crypto.js +++ b/test/integration/crypto.js @@ -59,7 +59,7 @@ describe('bitcoinjs-lib (crypto)', function () { }) it('can recover a private key from duplicate R values', function (done) { - this.timeout(10000) + this.timeout(30000) var inputs = [ {
tests/integration: bump timeouts to <I>s each
BitGo_bitgo-utxo-lib
train
js,js
ac231246960634077cba2d5e17f288ee83a9928c
diff --git a/Storage.php b/Storage.php index <HASH>..<HASH> 100644 --- a/Storage.php +++ b/Storage.php @@ -8,7 +8,7 @@ namespace Joomla\Session; -use Joomla\Filter\Input; +use Joomla\Filter\InputFilter; /** * Custom session storage handler for PHP @@ -49,7 +49,7 @@ abstract class Storage */ public static function getInstance($name = 'none', $options = array()) { - $filter = new Input; + $filter = new InputFilter; $name = strtolower($filter->clean($name, 'word')); if (empty(self::$instances[$name]))
Fix remaining test errors and failures.
joomla-framework_session
train
php
8329b2beed34cfa386e1872d9a8cdd9773fb41db
diff --git a/lib/util/json.js b/lib/util/json.js index <HASH>..<HASH> 100644 --- a/lib/util/json.js +++ b/lib/util/json.js @@ -13,7 +13,8 @@ const DATES_FIELD = '___dates___' * @returns {String} */ exports.stringify = function(value, space) { - const seen = [] + const seen = new Map() + let incr = 0 return JSON.stringify(value, (k, v) => { if (v) { @@ -31,12 +32,12 @@ exports.stringify = function(value, space) { } } - const seenIndex = seen.indexOf(v) + const seenIndex = seen.get(v) - if (seenIndex !== -1) { + if (seenIndex !== undefined) { v = { [OBJECTREF_FIELD]: seenIndex } } else { - seen.push(v) + seen.set(v, incr++) } } }
improve the performance of json stringification
Backendless_JS-Code-Runner
train
js
a34f13473a1faed14e13f6908552126b4d4b54eb
diff --git a/lib/cache.js b/lib/cache.js index <HASH>..<HASH> 100644 --- a/lib/cache.js +++ b/lib/cache.js @@ -163,11 +163,11 @@ var Cache = global.shipp.cache = module.exports = { options.concurrency = options.concurrency || 1; function complete() { - options.concurrency++; - if (--remaining === 0) { agent.destroy(); done(errors.length ? errors : null); + } else { + options.concurrency++; warmNext(); } }
Fix iteration problem in Cache#warm
shippjs_shipp-server
train
js
d7914adfa8269a49e82aa7bd87b504376af90ee2
diff --git a/tests/integration/utils/get-server.js b/tests/integration/utils/get-server.js index <HASH>..<HASH> 100644 --- a/tests/integration/utils/get-server.js +++ b/tests/integration/utils/get-server.js @@ -26,12 +26,22 @@ function getServer (options, callback) { nock('http://localhost:5984') // PouchDB sends a request to see if db exists .get('/_users/') - .reply(200, {}) - // mocks for bootstrapping design dock - .put('/_users') - .reply(201, {}) - .put('/_users/_design/byId') - .reply(201) + .query({}) + .reply(200, {db_name: '_users'}) + // design docs + .post('/_users/_bulk_docs') + .reply(201, [ + { + ok: true, + id: '_design/byId', + rev: '1-234' + }, + { + ok: true, + id: '_design/byToken', + rev: '1-234' + } + ]) server.register({ register: hapiAccount,
test: adaptions for @hoodie/account-server-api@3
hoodiehq_hoodie-account-server
train
js
f1691ab943330b70003df9375f735570009395ce
diff --git a/test/lib/activity.js b/test/lib/activity.js index <HASH>..<HASH> 100644 --- a/test/lib/activity.js +++ b/test/lib/activity.js @@ -61,8 +61,9 @@ var validActivityObject = function(obj) { assert.isString(obj.id); assert.include(obj, "objectType"); assert.isString(obj.objectType); - assert.include(obj, "displayName"); - assert.isString(obj.displayName); + if (_.has(obj, "displayName")) { + assert.isString(obj.displayName); + } if (_.has(obj, "published")) { validDate(obj.published); }
Don't require displayName for object
pump-io_pump.io
train
js
8218e2e52c793be029bbaa54e1f93c205eaa28c2
diff --git a/config/platform.php b/config/platform.php index <HASH>..<HASH> 100644 --- a/config/platform.php +++ b/config/platform.php @@ -166,7 +166,6 @@ return [ 'footer' => 'Footer menu', ], - /* |-------------------------------------------------------------------------- | Filesystem Disks @@ -185,7 +184,6 @@ return [ //TODO:: 'attachment' => 'public', ], - /* |-------------------------------------------------------------------------- | Images diff --git a/src/Platform/Http/Controllers/Systems/MediaController.php b/src/Platform/Http/Controllers/Systems/MediaController.php index <HASH>..<HASH> 100644 --- a/src/Platform/Http/Controllers/Systems/MediaController.php +++ b/src/Platform/Http/Controllers/Systems/MediaController.php @@ -24,7 +24,7 @@ class MediaController extends Controller */ public function __construct() { - $this->filesystem = config('platform.disks.media','public'); + $this->filesystem = config('platform.disks.media', 'public'); } /**
Apply fixes from StyleCI (#<I>) [ci skip] [skip ci]
orchidsoftware_platform
train
php,php
691ccf1376d1796ff1177c824d2b54c6912a1432
diff --git a/lib/PeachySQL.php b/lib/PeachySQL.php index <HASH>..<HASH> 100644 --- a/lib/PeachySQL.php +++ b/lib/PeachySQL.php @@ -194,7 +194,6 @@ class PeachySQL { // PHP from just copying the same $data reference (see // http://www.php.net/manual/en/mysqli-stmt.bind-result.php#92505). - $rows[$i] = []; foreach ($data as $k => $v) { $rows[$i][$k] = $v; } @@ -206,6 +205,7 @@ class PeachySQL { } } + $stmt->free_result(); $stmt->close(); }
Free mysql result before closing statement
theodorejb_peachy-sql
train
php