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
d5408e20f410cdaaf8f4cb4f21dfb4ae77008f81
diff --git a/objectpath/core/parser.py b/objectpath/core/parser.py index <HASH>..<HASH> 100644 --- a/objectpath/core/parser.py +++ b/objectpath/core/parser.py @@ -374,11 +374,11 @@ def tokenize(program): source=tokenize_python(program) for ID, value in source: if ID=="(literal)": - symbol=symbol_table[id] + symbol=symbol_table[ID] s=symbol() s.value=value elif ID=="(number)": - symbol=symbol_table[id] + symbol=symbol_table[ID] s=symbol() try: s.value=int(value)
very minor bugs. only to get better score in landscape.io LOL
adriank_ObjectPath
train
py
f5aa9c5364aa3b87f8f8d919c0b2bc0d1bd61b82
diff --git a/kundera-core/src/main/java/com/impetus/kundera/persistence/context/FlushManager.java b/kundera-core/src/main/java/com/impetus/kundera/persistence/context/FlushManager.java index <HASH>..<HASH> 100644 --- a/kundera-core/src/main/java/com/impetus/kundera/persistence/context/FlushManager.java +++ b/kundera-core/src/main/java/com/impetus/kundera/persistence/context/FlushManager.java @@ -290,7 +290,7 @@ public class FlushManager { childNode.setTraversed(true); // flushStack.push(childNode); - stackQueue.push(node); + stackQueue.push(childNode); logEvent(childNode, eventType); } }
Added node in flust queue insted of childNode
Impetus_Kundera
train
java
92efb3913730ef36996e5156d52f1f20b5072afa
diff --git a/engine/env/spark/src/test/java/org/datacleaner/spark/ExampleLaunch.java b/engine/env/spark/src/test/java/org/datacleaner/spark/ExampleLaunch.java index <HASH>..<HASH> 100644 --- a/engine/env/spark/src/test/java/org/datacleaner/spark/ExampleLaunch.java +++ b/engine/env/spark/src/test/java/org/datacleaner/spark/ExampleLaunch.java @@ -61,7 +61,9 @@ public class ExampleLaunch { private static final String DATA_LOCATION = "/datacleaner/test/person_names.txt"; public static void main(String[] args) throws Exception { - System.setProperty("SPARK_HOME", SPARK_HOME); + if (System.getenv("SPARK_HOME") == null) { + System.setProperty("SPARK_HOME", SPARK_HOME); + } final ApplicationDriver launcher = new ApplicationDriver(HDFS_HOSTNAME, HDFS_PORT, HDFS_JAR_LOCATION);
Added SPARK_HOME to example launch since it is anyways needed
datacleaner_DataCleaner
train
java
156b1635c00df5041ca4fc26462dd202ad57bbf9
diff --git a/ssh_check/check.py b/ssh_check/check.py index <HASH>..<HASH> 100644 --- a/ssh_check/check.py +++ b/ssh_check/check.py @@ -73,7 +73,7 @@ class CheckSSH(AgentCheck): client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) client.load_system_host_keys() - exception_message = None + exception_message = "No errors occured" try: # Try to connect to check status of SSH try:
Defaults exception message to string to prevent downstream error The downstream aggregator will not accept `None` for the message.
DataDog_integrations-core
train
py
fe88e2d4caadeb585b22b1b69a3a42a270e02094
diff --git a/templates/route/name.controller.js b/templates/route/name.controller.js index <HASH>..<HASH> 100644 --- a/templates/route/name.controller.js +++ b/templates/route/name.controller.js @@ -15,7 +15,7 @@ angular.module('<%= scriptAppName %>') .component('<%= cameledName %>', { templateUrl: '<%= htmlUrl %>', controller: <%= classedName %>Component, - controllerAs: <%= classedName %> + controllerAs: '<%= cameledName %>Ctrl' }); })();
fix(route): controllerAs should be a string
DaftMonk_generator-ng-component
train
js
83f573d866f5534ea78031a31d31805e85881897
diff --git a/edisgo/flex_opt/storage_positioning.py b/edisgo/flex_opt/storage_positioning.py index <HASH>..<HASH> 100644 --- a/edisgo/flex_opt/storage_positioning.py +++ b/edisgo/flex_opt/storage_positioning.py @@ -358,7 +358,7 @@ def one_storage_per_feeder(edisgo, storage_timeseries, count = 1 storage_obj_list = [] - total_grid_expansion_costs_new = None + total_grid_expansion_costs_new = 'not calculated' for feeder in ranked_feeders.values: logger.debug('Feeder: {}'.format(count)) count += 1
Set to 'not calculated' instead of None
openego_eDisGo
train
py
05b17f92714ac8ad716bb379eea13a2b4ed4ce4e
diff --git a/gson/src/main/java/com/google/gson/internal/bind/TypeAdapters.java b/gson/src/main/java/com/google/gson/internal/bind/TypeAdapters.java index <HASH>..<HASH> 100644 --- a/gson/src/main/java/com/google/gson/internal/bind/TypeAdapters.java +++ b/gson/src/main/java/com/google/gson/internal/bind/TypeAdapters.java @@ -796,7 +796,7 @@ public final class TypeAdapters { constantToName.put(constant, name); } } catch (NoSuchFieldException e) { - throw new AssertionError(); + throw new AssertionError("Missing field in " + classOfT.getName(), e); } } @Override public T read(JsonReader in) throws IOException {
Adding details in the throw exception on a missing field.
google_gson
train
java
4f6554a2b1e73b6f334eb8e6e1c116bb3966a612
diff --git a/morpfw/crud/storage/sqlstorage.py b/morpfw/crud/storage/sqlstorage.py index <HASH>..<HASH> 100644 --- a/morpfw/crud/storage/sqlstorage.py +++ b/morpfw/crud/storage/sqlstorage.py @@ -245,15 +245,26 @@ class SQLStorage(BaseStorage): for k, v in data.items(): if d.get(k, None) != v: d[k] = v - + self.session.flush() return self.model(self.request, collection, r) def delete(self, identifier, model, **kwargs): permanent = kwargs.get("permanent", False) if permanent: model.delete() - else: - model["deleted"] = datetime.now(tz=pytz.UTC) + return + + qs = [] + idfield = self.app.get_identifierfield(self.model.schema) + qs.append(getattr(self.orm_model, idfield) == identifier) + q = self.session.query(self.orm_model).filter(sa.and_(*qs)) + + r = q.first() + if not r: + raise ValueError(identifier) + + d = self.app.get_dataprovider(self.model.schema, r, self) + d["deleted"] = datetime.now(tz=pytz.UTC) class GUID(TypeDecorator):
fix delete implementation when no dictionary style setter
morpframework_morpfw
train
py
39b62a1b6694951d74f1019221b29d95b79157dd
diff --git a/eval.js b/eval.js index <HASH>..<HASH> 100644 --- a/eval.js +++ b/eval.js @@ -13,9 +13,8 @@ function merge (a, b) { return a } -var vmGlobals = new vm.Script('vmGlobals = Object.getOwnPropertyNames(globalThis)') +var vmGlobals = new vm.Script('Object.getOwnPropertyNames(globalThis)') .runInNewContext() - .vmGlobals // Return the exports/module.exports variable set in the content // content (String|VmScript): required
fix: fix VM globals not properly acquired
pierrec_node-eval
train
js
f1dd0811d89280a0f126cf9024fc27f5f48b2169
diff --git a/builder/openstack/step_run_source_server.go b/builder/openstack/step_run_source_server.go index <HASH>..<HASH> 100644 --- a/builder/openstack/step_run_source_server.go +++ b/builder/openstack/step_run_source_server.go @@ -64,6 +64,7 @@ func (s *StepRunSourceServer) Run(state multistep.StateBag) multistep.StepAction AvailabilityZone: s.AvailabilityZone, UserData: userData, ConfigDrive: &s.ConfigDrive, + ServiceClient: computeClient, } var serverOptsExt servers.CreateOptsBuilder
builders/openstack: fix for finding resource by ID. Pass server serviceClient to create params so it can look up resources by ID. Resolves #<I>
hashicorp_packer
train
go
44fb3066dd4c87b80e36c7bf2c1b50b7c31b7fe6
diff --git a/ext/nio4r/org/nio4r/Nio4r.java b/ext/nio4r/org/nio4r/Nio4r.java index <HASH>..<HASH> 100644 --- a/ext/nio4r/org/nio4r/Nio4r.java +++ b/ext/nio4r/org/nio4r/Nio4r.java @@ -153,6 +153,27 @@ public class Nio4r implements Library { } @JRubyMethod + public IRubyObject deregister(ThreadContext context, IRubyObject io) { + Ruby runtime = context.getRuntime(); + Channel raw_channel = ((RubyIO)io).getChannel(); + + if(!(raw_channel instanceof SelectableChannel)) { + throw runtime.newArgumentError("not a selectable IO object"); + } + + SelectableChannel channel = (SelectableChannel)raw_channel; + SelectionKey key = channel.keyFor(selector); + + if(key == null) + return context.nil; + + Monitor monitor = (Monitor)key.attachment(); + monitor.close(context); + + return monitor; + } + + @JRubyMethod public synchronized IRubyObject select(ThreadContext context) { return select(context, context.nil); } @@ -288,6 +309,7 @@ public class Nio4r implements Library { @JRubyMethod public IRubyObject close(ThreadContext context) { + key.cancel(); closed = context.getRuntime().getTrue(); return context.nil; }
Java NIO::Selector#deregister support
socketry_nio4r
train
java
79644e19010fb71e9728b5ccab2c32c22abaf29c
diff --git a/src/test/java/nl/jqno/equalsverifier/internal/prefabvalues/TypeTagTest.java b/src/test/java/nl/jqno/equalsverifier/internal/prefabvalues/TypeTagTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/nl/jqno/equalsverifier/internal/prefabvalues/TypeTagTest.java +++ b/src/test/java/nl/jqno/equalsverifier/internal/prefabvalues/TypeTagTest.java @@ -100,6 +100,17 @@ public class TypeTagTest { assertEquals(new TypeTag(String[].class), actual); } + @Test + public void matchNestedParameterizedGenericField() throws Exception { + Field enclosingField = ContainerContainer.class.getDeclaredField("stringContainer"); + TypeTag enclosingType = TypeTag.of(enclosingField, TypeTag.NULL); + + Field f = Container.class.getDeclaredField("tss"); + TypeTag actual = TypeTag.of(f, enclosingType); + + assertEquals(new TypeTag(List.class, new TypeTag(List.class, new TypeTag(String.class))), actual); + } + @SuppressWarnings("unused") static class ContainerContainer { Container<String> stringContainer; @@ -110,5 +121,6 @@ public class TypeTagTest { T t; List<T> ts; T[] tarr; + List<List<T>> tss; } }
Issue <I>: Add a test case for TypeTag.of
jqno_equalsverifier
train
java
d5d0c318ace93eac9a5e7525a6d94c6e07a9ebc6
diff --git a/skpy/msg.py b/skpy/msg.py index <HASH>..<HASH> 100644 --- a/skpy/msg.py +++ b/skpy/msg.py @@ -576,6 +576,8 @@ class SkypeFileMsg(SkypeMsg): @property @SkypeUtils.cacheResult def fileContent(self): + if not self.file: + return None return self.skype.conn("GET", "{0}/views/original".format(self.file.urlAsm), auth=SkypeConnection.Auth.Authorize).content @@ -601,6 +603,8 @@ class SkypeImageMsg(SkypeFileMsg): @property @SkypeUtils.cacheResult def fileContent(self): + if not self.file: + return None return self.skype.conn("GET", "{0}/views/imgpsh_fullsize".format(self.file.urlAsm), auth=SkypeConnection.Auth.Authorize).content
Return None for file content if no file Fixes #<I>.
Terrance_SkPy
train
py
afcec46dfddc5922171a9dd9326ed2c77f51f40f
diff --git a/discord/audit_logs.py b/discord/audit_logs.py index <HASH>..<HASH> 100644 --- a/discord/audit_logs.py +++ b/discord/audit_logs.py @@ -716,7 +716,7 @@ class AuditLogEntry(Hashable): return self.guild.get_stage_instance(target_id) or Object(id=target_id, type=StageInstance) def _convert_target_sticker(self, target_id: int) -> Union[GuildSticker, Object]: - return self._state.get_sticker(target_id) or Object(id=target_id, type=StageInstance) + return self._state.get_sticker(target_id) or Object(id=target_id, type=GuildSticker) def _convert_target_thread(self, target_id: int) -> Union[Thread, Object]: return self.guild.get_thread(target_id) or Object(id=target_id, type=Thread)
Fix Sticker Objects type being StageInstance
Rapptz_discord.py
train
py
05f8c9b67998d520dff6a77422b7719327663a1b
diff --git a/src/wormling/phparia/Client/AriClient.php b/src/wormling/phparia/Client/AriClient.php index <HASH>..<HASH> 100644 --- a/src/wormling/phparia/Client/AriClient.php +++ b/src/wormling/phparia/Client/AriClient.php @@ -208,6 +208,14 @@ class AriClient } /** + * @param callable|callable $callback + */ + public function onClose(callable $callback) + { + $this->wsClient->on("close", $callback); + } + + /** * @return WebSocket */ public function getWsClient()
Added onClose to ARI client
wormling_phparia
train
php
780843415e17928ee3fb6a63f2c78c1579c45fac
diff --git a/src/Asymmetric/Crypto.php b/src/Asymmetric/Crypto.php index <HASH>..<HASH> 100644 --- a/src/Asymmetric/Crypto.php +++ b/src/Asymmetric/Crypto.php @@ -3,7 +3,12 @@ declare(strict_types=1); namespace ParagonIE\Halite\Asymmetric; use ParagonIE\Halite\Alerts\{ - CannotPerformOperation, InvalidDigestLength, InvalidKey, InvalidMessage, InvalidSalt, InvalidSignature, InvalidType + CannotPerformOperation, + InvalidDigestLength, + InvalidKey, + InvalidMessage, + InvalidSignature, + InvalidType }; use ParagonIE\Halite\{ Util as CryptoUtil,
Do not inline all of these class names.
paragonie_halite
train
php
bbcd1b5fe026d82e40ec8624952db097321c8c10
diff --git a/sdk/src/test/java/com/microsoft/azure/cosmosdb/rx/OfferQueryTest.java b/sdk/src/test/java/com/microsoft/azure/cosmosdb/rx/OfferQueryTest.java index <HASH>..<HASH> 100644 --- a/sdk/src/test/java/com/microsoft/azure/cosmosdb/rx/OfferQueryTest.java +++ b/sdk/src/test/java/com/microsoft/azure/cosmosdb/rx/OfferQueryTest.java @@ -47,7 +47,7 @@ import rx.Observable; public class OfferQueryTest extends TestSuiteBase { - public final static int SETUP_TIMEOUT = 30000; + public final static int SETUP_TIMEOUT = 60000; public final static String DATABASE_ID = getDatabaseId(OfferQueryTest.class); private List<DocumentCollection> createdCollections = new ArrayList<>();
fix travis test timeout by increasing timeout time
Azure_azure-sdk-for-java
train
java
176243d7bffc7f09f6a3818c2da0d280ad97facc
diff --git a/scripts/bam_to_wiggle.py b/scripts/bam_to_wiggle.py index <HASH>..<HASH> 100644 --- a/scripts/bam_to_wiggle.py +++ b/scripts/bam_to_wiggle.py @@ -50,10 +50,6 @@ def main(bam_file, config_file=None, chrom='all', start=0, end=None, wig_file = "%s.wig" % os.path.splitext(bam_file)[0] with open(wig_file, "w") as out_handle: chr_sizes, wig_valid = write_bam_track(bam_file, regions, config, out_handle) - if not wig_valid: - sys.stderr.write("Failed to write wig file\n") - os.remove(wig_file) - sys.exit(1) try: if wig_valid: convert_to_bigwig(wig_file, chr_sizes, config, outfile)
Undo silent failure; needed for empty and other problem lanes in pipelines
bcbio_bcbio-nextgen
train
py
1b0ece03142655cb5ac65ef7d1ae2b9bbff3514b
diff --git a/mapper.go b/mapper.go index <HASH>..<HASH> 100644 --- a/mapper.go +++ b/mapper.go @@ -240,6 +240,22 @@ type PilosaRecord struct { Vals []Val } +// AddVal adds a new value to be range encoded into the given field to the +// PilosaRecord. +func (pr PilosaRecord) AddVal(frame, field string, value int64) { + pr.Vals = append(pr.Vals, Val{Frame: frame, Field: field, Value: value}) +} + +// AddRow adds a new bit to be set to the PilosaRecord. +func (pr PilosaRecord) AddRow(frame string, id uint64) { + pr.Rows = append(pr.Rows, Row{Frame: frame, ID: id}) +} + +// AddRowTime adds a new bit to be set with a timestamp to the PilosaRecord. +func (pr PilosaRecord) AddRowTime(frame string, id uint64, ts time.Time) { + pr.Rows = append(pr.Rows, Row{Frame: frame, ID: id, Time: ts}) +} + // Row represents a bit to set in Pilosa sans column id (which is held by the // PilosaRecord containg the Row). type Row struct {
add some convenience methods to PilosaRecord
pilosa_pdk
train
go
12f428e01cb60d445a0b92f660c7de1c3f73be8c
diff --git a/devices/philips.js b/devices/philips.js index <HASH>..<HASH> 100644 --- a/devices/philips.js +++ b/devices/philips.js @@ -2377,6 +2377,17 @@ module.exports = [ vendor: 'Philips', description: 'Hue Being', extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}), + ota: ota.zigbeeOTA, + meta: {turnsOffAtBrightness1: true}, + }, + { + zigbeeModel: ['4100448U9'], + model: '4100448U9', + vendor: 'Philips', + description: 'Hue Being', + extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}), + ota: ota.zigbeeOTA, + meta: {turnsOffAtBrightness1: true}, }, { zigbeeModel: ['1743630P7', '1743630V7'],
Add <I>U9 (#<I>) * Add <I>U9 Add the US version of the Hue Being light. * Update philips.js
Koenkk_zigbee-shepherd-converters
train
js
6edcab7a1a9989f4210a6320faf253af0a5d09e6
diff --git a/mod/lti/locallib.php b/mod/lti/locallib.php index <HASH>..<HASH> 100644 --- a/mod/lti/locallib.php +++ b/mod/lti/locallib.php @@ -173,9 +173,6 @@ function lti_view($instance) { $requestparams['launch_presentation_return_url'] = $returnurl; } - $requestparams['tool_consumer_info_product_family_code'] = 'moodle'; - $requestparams['tool_consumer_info_version'] = strval($CFG->version); - if (!empty($key) && !empty($secret)) { $parms = lti_sign_parameters($requestparams, $endpoint, "POST", $key, $secret); } else {
MDL-<I> Undo change that Chris already did.
moodle_moodle
train
php
15a267b57d2394dd5cb697f9a80b6df4fc939a76
diff --git a/runtime/state.go b/runtime/state.go index <HASH>..<HASH> 100644 --- a/runtime/state.go +++ b/runtime/state.go @@ -28,7 +28,7 @@ func (s *State) String() string { } return fmt.Sprintf("Up %s", utils.HumanDuration(time.Now().UTC().Sub(s.StartedAt))) } - return fmt.Sprintf("Exit %d", s.ExitCode) + return fmt.Sprintf("Exited (%d) %s ago", s.ExitCode, utils.HumanDuration(time.Now().UTC().Sub(s.FinishedAt))) } func (s *State) IsRunning() bool {
add time since exit in docker ps Docker-DCO-<I>-
moby_moby
train
go
83bd56c49d4db82ee9d1fc11325c94a210e050ab
diff --git a/packages/rest/src/index.js b/packages/rest/src/index.js index <HASH>..<HASH> 100644 --- a/packages/rest/src/index.js +++ b/packages/rest/src/index.js @@ -1,8 +1,9 @@ import axios, { CancelToken } from 'axios'; import { CANCEL } from 'redux-saga' -import * as girder from './girder' -import * as jupyterhub from './jupyterhub' - +import * as girder from './girder'; +import * as jupyterhub from './jupyterhub'; +export * from './girder' +export * from './jupyterhub' var _girderClient = axios.create({ baseURL: `${window.location.origin}/api/v1`
fix(rest): Export all the needed parts
OpenChemistry_oc-web-components
train
js
49daee2a86cad07f558700a38d10b0b74ea551c0
diff --git a/controller/registry/private.py b/controller/registry/private.py index <HASH>..<HASH> 100644 --- a/controller/registry/private.py +++ b/controller/registry/private.py @@ -53,7 +53,7 @@ def publish_release(source, config, target): # construct the new image image['parent'] = image['id'] image['id'] = _new_id() - image['config']['Env'] = _construct_env(image['config']['Env'], config) + image['config']['Env'] = _construct_env(image['config']['Env'], config, target_image, target_tag) # update and tag the new image _commit(target_image, image, _empty_tar_archive(), target_tag) @@ -157,9 +157,11 @@ def _put_tag(image_id, repository_path, tag): # utility functions -def _construct_env(env, config): +def _construct_env(env, config, target_image, target_tag): "Update current environment with latest config" new_env = [] + new_env.append("{}={}".format('DEIS_APP', target_image)) + new_env.append("{}={}".format('DEIS_RELEASE', target_tag)) # see if we need to update existing ENV vars for e in env: k, v = e.split('=', 1)
feat(controller): inject tag version value in environment.
deis_deis
train
py
33fd69e6a6875a909ffaae479c9cdbef1654285f
diff --git a/js/mexc.js b/js/mexc.js index <HASH>..<HASH> 100644 --- a/js/mexc.js +++ b/js/mexc.js @@ -212,7 +212,14 @@ module.exports = class mexc extends Exchange { } async fetchTime (params = {}) { - const response = await this.spotPublicGetCommonTimestamp (params); + const defaultType = this.safeString2 (this.options, 'fetchMarkets', 'defaultType', 'spot'); + const type = this.safeString (params, 'type', defaultType); + const query = this.omit (params, 'type'); + let method = 'spotPublicGetCommonTimestamp'; + if (type === 'contract') { + method = 'contractPublicGetPing'; + } + const response = await this[method] (query); // // spot //
mexc fetchTime contract api
ccxt_ccxt
train
js
b44519e742bf720b01cc090d28c82a63f445da92
diff --git a/builtin/logical/transit/path_export.go b/builtin/logical/transit/path_export.go index <HASH>..<HASH> 100644 --- a/builtin/logical/transit/path_export.go +++ b/builtin/logical/transit/path_export.go @@ -112,9 +112,12 @@ func (b *backend) pathPolicyExportRead( } } + if versionValue < p.MinDecryptionVersion { + return logical.ErrorResponse("version for export is below minimun decryption version"), logical.ErrInvalidRequest + } key, ok := p.Keys[versionValue] if !ok { - return logical.ErrorResponse("version does not exist or is no longer valid"), logical.ErrInvalidRequest + return logical.ErrorResponse("version does not exist or cannot be found"), logical.ErrInvalidRequest } exportKey, err := getExportKey(p, &key, exportType)
Make export errors a bit more meaningful
hashicorp_vault
train
go
28686f909813e37faa4c4fbc6d2abdce6f7775cb
diff --git a/publishable/database/migrations/2018_04_09_052104_create_form_designer_table.php b/publishable/database/migrations/2018_04_09_052104_create_form_designer_table.php index <HASH>..<HASH> 100644 --- a/publishable/database/migrations/2018_04_09_052104_create_form_designer_table.php +++ b/publishable/database/migrations/2018_04_09_052104_create_form_designer_table.php @@ -16,7 +16,7 @@ class CreateFormDesignerTable extends Migration Schema::create('form_designer', function (Blueprint $table) { $table->increments('id'); $table->integer('data_type_id')->unsigned()->nullable(); - $table->json('options'); + $table->text('options'); $table->foreign('data_type_id')->references('id')->on('data_types') ->onDelete('set null');
change type json to text for options in form designer
laraveladminpanel_admin
train
php
0327bcd40a13ec867bc0b6387fe027bdbae0d0e1
diff --git a/tests/plugins/reload/reload_plugin_test.go b/tests/plugins/reload/reload_plugin_test.go index <HASH>..<HASH> 100644 --- a/tests/plugins/reload/reload_plugin_test.go +++ b/tests/plugins/reload/reload_plugin_test.go @@ -460,10 +460,15 @@ func TestReloadCopy100(t *testing.T) { time.Sleep(time.Second * 3) t.Run("ReloadMake100Files", reloadMake100Files) + time.Sleep(time.Second) t.Run("ReloadCopyFiles", reloadCopyFiles) + time.Sleep(time.Second) t.Run("ReloadRecursiveDirsSupport", copyFilesRecursive) + time.Sleep(time.Second) t.Run("RandomChangesInRecursiveDirs", randomChangesInRecursiveDirs) + time.Sleep(time.Second) t.Run("RemoveFilesSupport", removeFilesSupport) + time.Sleep(time.Second) t.Run("ReloadMoveSupport", reloadMoveSupport) time.Sleep(time.Second * 10)
Sleep to wait file copy on slow github actions
spiral_roadrunner
train
go
67ee6b29460fb3e1843a82a50806bf8dd0d00a46
diff --git a/bokeh/glyphs.py b/bokeh/glyphs.py index <HASH>..<HASH> 100644 --- a/bokeh/glyphs.py +++ b/bokeh/glyphs.py @@ -90,9 +90,9 @@ class DataSpec(BaseProperty): # Build the complete dict value = getattr(obj, "_"+self.name, self.default) if type(value) == str: - d = {"name": value, "units": self.units, "default": self.default} + d = {"field": value, "units": self.units, "default": self.default} elif isinstance(value, dict): - d = {"name": self.field, "units": self.units, "default": self.default} + d = {"field": self.field, "units": self.units, "default": self.default} d.update(value) else: # Assume value is a numeric type and is the default value.
should use 'field' instead of 'name' to match js
bokeh_bokeh
train
py
df1cb742433c6be64ca6b798605dab6ad387abfb
diff --git a/NavigationSample/Scripts/navigation.mvc.js b/NavigationSample/Scripts/navigation.mvc.js index <HASH>..<HASH> 100644 --- a/NavigationSample/Scripts/navigation.mvc.js +++ b/NavigationSample/Scripts/navigation.mvc.js @@ -22,9 +22,9 @@ if (req.readyState == 4 && req.status == 200) { var panels = JSON.parse(req.responseText); for (var id in panels) { - win.document.getElementById(id).innerHTML = panels[id]; - if (win.jQuery && win.jQuery.validator) - win.jQuery.validator.unobtrusive.parse('#' + id); + var panel = win.document.getElementById(id); + panel.innerHTML = panels[id]; + panel.dispatchEvent(new Event('refreshajax')); } if (addHistory) history.pushState(newLink, win.document.title, newLink);
Removed calling parse on jquery validation for the new content. Instead raised a refreshajax event against the panel so consumer can do whatever they choose
grahammendick_navigation
train
js
f9761cf9cf8c508191ac77bb081dcfc735e6c37c
diff --git a/assets/message-bus-ajax.js b/assets/message-bus-ajax.js index <HASH>..<HASH> 100644 --- a/assets/message-bus-ajax.js +++ b/assets/message-bus-ajax.js @@ -8,16 +8,11 @@ throw new Error("MessageBus must be loaded before the ajax adapter"); } - var cacheBuster = Math.random() * 10000 | 0; - global.MessageBus.ajax = function(options){ var XHRImpl = (global.MessageBus && global.MessageBus.xhrImplementation) || global.XMLHttpRequest; var xhr = new XHRImpl(); xhr.dataType = options.dataType; var url = options.url; - if (!options.cache){ - url += ((-1 == url.indexOf('?')) ? '?' : '&') + '_=' + (cacheBuster++) - } xhr.open('POST', url); for (var name in options.headers){ xhr.setRequestHeader(name, options.headers[name]);
Remove cache busting implementation from AJAX shim #<I> intended to prevent this from happening, but we only tested with jQuery, whose default for this value is `true`. Our shim for `$.ajax` defaults to `false`, so in that context the desired change didn't take effect. This shim is supposed to be lightweight to address only MessageBus' requirements, so here we remove support for the now unused `cache` option entirely, rather than flipping the default.
SamSaffron_message_bus
train
js
62bdb5c0a04b36e712e32433b6f34d9d2cf19473
diff --git a/oandapyV20/types/types.py b/oandapyV20/types/types.py index <HASH>..<HASH> 100644 --- a/oandapyV20/types/types.py +++ b/oandapyV20/types/types.py @@ -235,6 +235,6 @@ class OrderSpecifier(OAType): def __init__(self, specifier): if str(specifier).startswith('@'): - self._v = ClientID(specifier.lstrip('@')).value + self._v = "@"+ClientID(specifier.lstrip('@')).value else: self._v = OrderID(specifier).value diff --git a/tests/test_types.py b/tests/test_types.py index <HASH>..<HASH> 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -155,11 +155,11 @@ class TestTypes(unittest.TestCase): ), (tp.OrderSpecifier, {"specifier": "@my valid custom id"}, - "my valid custom id", + "@my valid custom id", ), (tp.OrderSpecifier, - {"specifier": "@"+"to long"+"x"*125}, - "to long"+"x"*125, + {"specifier": "@to long"+"x"*125}, + "@to long"+"x"*125, ValueError ), # DateTime
OrderSpecifier is inclusive the '@'
hootnot_oanda-api-v20
train
py,py
613b31413d5191c63a7eaa660f874ee323fd66fa
diff --git a/lib/svtplay_dl/service/radioplay.py b/lib/svtplay_dl/service/radioplay.py index <HASH>..<HASH> 100644 --- a/lib/svtplay_dl/service/radioplay.py +++ b/lib/svtplay_dl/service/radioplay.py @@ -39,7 +39,7 @@ class Radioplay(object): download_hls(options, m3u8_url, base_url) except KeyError: log.error("Can't find any streams.") - sys.error(2) + sys.exit(2) else: try: rtmp = streams["rtmp"]
radioplay: sys.exit is the right one
spaam_svtplay-dl
train
py
d5dda7fe317511fe87a15463e2a78ea88370fe53
diff --git a/cmd/shadowsocks-local/local.go b/cmd/shadowsocks-local/local.go index <HASH>..<HASH> 100644 --- a/cmd/shadowsocks-local/local.go +++ b/cmd/shadowsocks-local/local.go @@ -382,7 +382,7 @@ func main() { ss.SetDebug(debug) if strings.HasSuffix(cmdConfig.Method, "-auth") { - cmdConfig.Method = cmdConfig.Method[:len(cmdConfig.Method)-4] + cmdConfig.Method = cmdConfig.Method[:len(cmdConfig.Method)-5] cmdConfig.Auth = true } diff --git a/cmd/shadowsocks-server/server.go b/cmd/shadowsocks-server/server.go index <HASH>..<HASH> 100644 --- a/cmd/shadowsocks-server/server.go +++ b/cmd/shadowsocks-server/server.go @@ -346,7 +346,7 @@ func main() { ss.SetDebug(debug) if strings.HasSuffix(cmdConfig.Method, "-auth") { - cmdConfig.Method = cmdConfig.Method[:len(cmdConfig.Method)-4] + cmdConfig.Method = cmdConfig.Method[:len(cmdConfig.Method)-5] cmdConfig.Auth = true }
Fix #<I>: command line specifying -auth not working.
shadowsocks_shadowsocks-go
train
go,go
6f619c39cb000843906cb4f78b10c09215cb3b6e
diff --git a/internal/testutil/greeting.go b/internal/testutil/greeting.go index <HASH>..<HASH> 100644 --- a/internal/testutil/greeting.go +++ b/internal/testutil/greeting.go @@ -21,7 +21,8 @@ var Greeting = Torrent{ } const ( - GreetingFileContents = "hello, world\n" + // A null in the middle triggers an error if SQLite stores data as text instead of blob. + GreetingFileContents = "hello,\x00world\n" GreetingFileName = "greeting" )
Include a null byte in the middle of the Greeting test
anacrolix_torrent
train
go
0280d74167b14cf17992765284e9ac9f4948611e
diff --git a/config/config.go b/config/config.go index <HASH>..<HASH> 100644 --- a/config/config.go +++ b/config/config.go @@ -163,5 +163,5 @@ func (c JobConfig) ScrapeInterval() time.Duration { // ScrapeTimeout gets the scrape timeout for a job. func (c JobConfig) ScrapeTimeout() time.Duration { - return stringToDuration(c.GetScrapeInterval()) + return stringToDuration(c.GetScrapeTimeout()) }
Fix scrape timeout in config. The scrape timeout helper was wrapping the scrape interval.
prometheus_prometheus
train
go
050018d48e2c94a36cb0ec61288b1c5519059d36
diff --git a/activejob/lib/active_job/test_helper.rb b/activejob/lib/active_job/test_helper.rb index <HASH>..<HASH> 100644 --- a/activejob/lib/active_job/test_helper.rb +++ b/activejob/lib/active_job/test_helper.rb @@ -284,7 +284,7 @@ module ActiveJob # def test_perform_enqueued_jobs_with_only # perform_enqueued_jobs(only: MyJob) do # MyJob.perform_later(1, 2, 3) # will be performed - # HelloJob.perform_later(1, 2, 3) # will not be perfomed + # HelloJob.perform_later(1, 2, 3) # will not be performed # end # assert_performed_jobs 1 # end
s/perfomed/performed/ [ci skip]
rails_rails
train
rb
a12ec7f49d01a9906fec14a14da262f137b7762b
diff --git a/core/src/main/java/org/bitcoinj/core/PeerGroup.java b/core/src/main/java/org/bitcoinj/core/PeerGroup.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/bitcoinj/core/PeerGroup.java +++ b/core/src/main/java/org/bitcoinj/core/PeerGroup.java @@ -337,9 +337,12 @@ public class PeerGroup implements TransactionBroadcaster { HttpDiscovery.Details[] httpSeeds = params.getHttpSeeds(); if (httpSeeds.length > 0) { // Use HTTP discovery when Tor is active and there is a Cartographer seed, for a much needed speed boost. - OkHttpClient client = new OkHttpClient(); - client.setSocketFactory(torClient.getSocketFactory()); - result.addPeerDiscovery(new HttpDiscovery(params, httpSeeds[0], client)); + OkHttpClient httpClient = new OkHttpClient(); + httpClient.setSocketFactory(torClient.getSocketFactory()); + List<PeerDiscovery> discoveries = Lists.newArrayList(); + for (HttpDiscovery.Details httpSeed : httpSeeds) + discoveries.add(new HttpDiscovery(params, httpSeed, httpClient)); + result.addPeerDiscovery(new MultiplexingDiscovery(params, discoveries)); } else { result.addPeerDiscovery(new TorDiscovery(params, torClient)); }
Fix Tor support does not use all available HTTP seeds.
bitcoinj_bitcoinj
train
java
eb05aa77ba66a139a9e87aafbb2b99269dbb2113
diff --git a/app/Http/RequestHandlers/CheckTree.php b/app/Http/RequestHandlers/CheckTree.php index <HASH>..<HASH> 100644 --- a/app/Http/RequestHandlers/CheckTree.php +++ b/app/Http/RequestHandlers/CheckTree.php @@ -137,7 +137,7 @@ class CheckTree implements RequestHandlerInterface ->get() ->map(static function (object $row): object { // Extract type for pending record - if ($row->type === '' && preg_match('/^0 @[^@]*@ ([_A-Z0-9]+)/', $row->gedcom, $match) === 1) { + if ($row->type === '' && preg_match('/^0( @[^@]*@)? ([_A-Z0-9]+)/', $row->gedcom, $match) === 1) { $row->type = $match[1]; }
Fix: pending changes to the HEAD record not handled in the error check
fisharebest_webtrees
train
php
4a4e9aa4efac8b06d00c1c0fdeb13caf75c4224d
diff --git a/src/Discord/Parts/Interactions/Command/Command.php b/src/Discord/Parts/Interactions/Command/Command.php index <HASH>..<HASH> 100644 --- a/src/Discord/Parts/Interactions/Command/Command.php +++ b/src/Discord/Parts/Interactions/Command/Command.php @@ -161,7 +161,7 @@ class Command extends Part */ public function getUpdatableAttributes(): array { - $attr = [ + return [ 'guild_id' => $this->guild_id ?? null, 'name' => $this->name, 'name_localizations' => $this->name_localizations, @@ -169,16 +169,10 @@ class Command extends Part 'description_localizations' => $this->description_localizations, 'options' => $this->attributes['options'] ?? null, 'default_member_permissions' => $this->default_member_permissions, + 'dm_permission' => $this->dm_permission, 'default_permission' => $this->default_permission, 'type' => $this->type, ]; - - // Guild command might omit this fillable - if (array_key_exists('dm_permission', $this->attributes)) { - $attr['dm_permission'] = $this->dm_permission; - } - - return $attr; } /**
revert dm_permission, naturally always present after created (i.e. before update)
teamreflex_DiscordPHP
train
php
54f89610e39e7761648de031bdffb82c1dc8aacb
diff --git a/lib/Client.php b/lib/Client.php index <HASH>..<HASH> 100644 --- a/lib/Client.php +++ b/lib/Client.php @@ -220,6 +220,10 @@ class Client implements HttpClient { $response = $this->finalizeResponse($request, $parseResult, new Message($bodyEmitter->iterate()), $previousResponse); + if ($deferred) { + $deferred->resolve($response); + } + // Required, otherwise responses without body hang if ($parseResult["headersOnly"]) { // Directly parse again in case we already have the full body but aborted parsing to resolve promise. @@ -248,10 +252,6 @@ class Client implements HttpClient { $this->socketPool->checkin($socket->getResource()); } - if ($deferred) { - $deferred->resolve($response); - } - break; } } catch (ParseException $e) {
Resolve promise once headers are received, not when full request is done
amphp_artax
train
php
4860d1baedd302df9651ea08539095745fbc11ac
diff --git a/src/LoremIpsum.php b/src/LoremIpsum.php index <HASH>..<HASH> 100644 --- a/src/LoremIpsum.php +++ b/src/LoremIpsum.php @@ -83,11 +83,20 @@ class LoremIpsum extends Text return $lorem; } - public function __construct($size = null) + /** + * Constructor. + * Pass array of defaults or simply size property value. + * + * @param array|int $defaults + */ + public function __construct($defaults = null) { - if ($size) { - $this->size = $size; + if (is_scalar($defaults) && $defaults) { + $this->size = $defaults; + return; } + + parent::__construct($defaults); } public function init()
fix LoremIpsum constructor. Otherwise it didn't support seed mechanism.
atk4_ui
train
php
327caba24a88f6c41bc63e50be91ff6c03cd93b6
diff --git a/runtime/lib/adapter/DBMSSQL.php b/runtime/lib/adapter/DBMSSQL.php index <HASH>..<HASH> 100644 --- a/runtime/lib/adapter/DBMSSQL.php +++ b/runtime/lib/adapter/DBMSSQL.php @@ -128,10 +128,6 @@ class DBMSSQL extends DBAdapter $selectText = 'SELECT '; - if (preg_match('/\Aselect(\s+)distinct/i', $sql)) { - $selectText .= 'DISTINCT '; - } - preg_match('/\Aselect(.*)from(.*)/si', $sql, $selectSegment); if(count($selectSegment) == 3) { $selectStatement = trim($selectSegment[1]); @@ -140,6 +136,11 @@ class DBMSSQL extends DBAdapter throw new Exception('DBMSSQL::applyLimit() could not locate the select statement at the start of the query.'); } + if (preg_match('/\Aselect(\s+)distinct/i', $sql)) { + $selectText .= 'DISTINCT '; + $selectStatement = str_ireplace('distinct ', '', $selectStatement); + } + // if we're starting at offset 0 then theres no need to simulate limit, // just grab the top $limit number of rows if($offset == 0) {
[<I>][<I>] Fixed a problem with setting DISTINCT and using LIMIT at the same time with MSSQL server. Closes #<I>
propelorm_Propel
train
php
ea6f9164c0e1bcbc1f3027aa41f84dc9205c740b
diff --git a/src/Error/SentryHandler.php b/src/Error/SentryHandler.php index <HASH>..<HASH> 100644 --- a/src/Error/SentryHandler.php +++ b/src/Error/SentryHandler.php @@ -18,10 +18,10 @@ class SentryHandler { $options = [ 'processors' => [ - 'Raven_SanitizeDataProcessor' + 'Raven_Processor_SanitizeDataProcessor' ], 'processorOptions' => [ - 'Raven_SanitizeDataProcessor' => [ + 'Raven_Processor_SanitizeDataProcessor' => [ 'fields_re' => '/(' . implode('|', Configure::read('CakeMonitor.Sentry.sanitizeFields')) . ')/i' ] ]
Update Sentry Raven_Processor_SanitizeDataProcessor
scherersoftware_cake-monitor
train
php
12f4b7edb2eacfe434cd25305d13261ad857387a
diff --git a/salt/modules/mac_xattr.py b/salt/modules/mac_xattr.py index <HASH>..<HASH> 100644 --- a/salt/modules/mac_xattr.py +++ b/salt/modules/mac_xattr.py @@ -47,7 +47,7 @@ def list(path, hex=False): cmd = 'xattr "{0}"'.format(path) ret = __salt__['cmd.run'](cmd) - if "No such file" in ret: + if "No such file" in ret or not ret: return None attrs_ids = ret.split("\n")
Fix error when there are no extended attributes
saltstack_salt
train
py
1c109ec5b6ad3b98452feb04116ea4c63136104f
diff --git a/course/format/social.php b/course/format/social.php index <HASH>..<HASH> 100644 --- a/course/format/social.php +++ b/course/format/social.php @@ -25,6 +25,11 @@ print_side_block(get_string("people"), "", $moddata, $modicon, "", $leftwidth); +/// Print a form to search forums + $searchform = forum_print_search_form($course, "", true); + $searchform = "<div align=\"center\">$searchform</div>"; + print_side_block(get_string("search","forum"), $searchform, "", "", "", $leftwidth); + /// Then, print all the available resources (Section 0) print_section_block(get_string("activities"), $course, $sections[0], @@ -40,11 +45,6 @@ } -/// Print a form to search forums - $searchform = forum_print_search_form($course, "", true); - $searchform = "<div align=\"center\">$searchform</div>"; - print_side_block(get_string("search","forum"), $searchform, "", "", "", $leftwidth); - /// Admin links and controls print_course_admin_links($course);
Move the search up closer to the top
moodle_moodle
train
php
c26e86ec2c390ff1cdd7cc4d31a7b2912ae6e0ae
diff --git a/src/Console/Commands/StartServer.php b/src/Console/Commands/StartServer.php index <HASH>..<HASH> 100644 --- a/src/Console/Commands/StartServer.php +++ b/src/Console/Commands/StartServer.php @@ -143,7 +143,7 @@ class StartServer extends Command $this->loop->addPeriodicTimer(10, function () { if ($this->getLastRestart() !== $this->lastRestart) { - $this->loop->stop(); + $this->triggerSoftShutdown(); } }); }
Trigger soft-shutdown on timer restart
beyondcode_laravel-websockets
train
php
99f0cdd625b940ff7335135265ee6134b4794ee7
diff --git a/mp3-parser.js b/mp3-parser.js index <HASH>..<HASH> 100644 --- a/mp3-parser.js +++ b/mp3-parser.js @@ -589,6 +589,10 @@ // TODO: Process extended header if present if (tag.header.extendedHeaderFlag) {} + // Go on to read individual frames but only if the tag version is v2.3. This is the only + // version currently supported + if (tag.header.majorVersion !== 3) { return tag; } + // Move offset past the end of the tag header to start reading tag frames offset += 10; while (offset < tagEnd) {
Parse ID3v2 tag frames iff tag version is <I>
biril_mp3-parser
train
js
0ca332f81d8c5be094855f32971da40bed991540
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,5 @@ +import sys + from setuptools import setup, find_packages import populous @@ -8,6 +10,9 @@ requirements = [ "fake-factory", ] +if sys.version_info < (3, 2): + requirements.append('functools32') + setup( name="populous", version=populous.__version__,
Add functools<I> to the requirements for Python < <I>
peopledoc_populous
train
py
9f2d11c177bd64610e4d8db9304a45232637799e
diff --git a/cli/app.go b/cli/app.go index <HASH>..<HASH> 100644 --- a/cli/app.go +++ b/cli/app.go @@ -219,6 +219,11 @@ func scaleToZero(appName string, client controller.Client) error { } processes := make(map[string]int) expected := client.ExpectedScalingEvents(formation.Processes, processes, release.Processes, 1) + + if expected.Count() == 0 { + return nil + } + watcher, err := client.WatchJobEvents(appName, release.ID) if err != nil { return err
cli: Don't wait for job events if expected count is 0 Fixes deleting apps that have been scaled to 0.
flynn_flynn
train
go
7ed4ac0de7c0506a1b782dfbd16f3ab54fd285ba
diff --git a/app/controllers/systems_controller.rb b/app/controllers/systems_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/systems_controller.rb +++ b/app/controllers/systems_controller.rb @@ -150,6 +150,8 @@ class SystemsController < ApplicationController accesible_envs = KTEnvironment.systems_readable(current_organization) begin + @system_groups = SystemGroup.where(:organization_id => current_organization).where(:locked=>false).order(:name) + @systems = [] setup_environment_selector(current_organization, accesible_envs) if @environment
<I> - system by environment page generates error
Katello_katello
train
rb
4d94e1275377ce77ea61b30922921b26ef6f448d
diff --git a/src/test/java/com/kenai/jbosh/AbstractBOSHTest.java b/src/test/java/com/kenai/jbosh/AbstractBOSHTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/kenai/jbosh/AbstractBOSHTest.java +++ b/src/test/java/com/kenai/jbosh/AbstractBOSHTest.java @@ -22,6 +22,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import org.junit.After; import org.junit.Before; +import org.junit.BeforeClass; import static org.junit.Assert.*; /** @@ -38,6 +39,11 @@ public abstract class AbstractBOSHTest { protected BOSHClient session; private final AtomicBoolean cleaningUp = new AtomicBoolean(); + @BeforeClass + public static void hr() { + LOG.info("\n\n\n"); + } + @Before public void setup() throws Exception { cleaningUp.set(false);
Breakup test output with a few blank lines between classes. git-svn-id: <URL>
igniterealtime_jbosh
train
java
0569a034f3355e8fc6c8b0021d286b53bc709ae3
diff --git a/app/models/concerns/hyrax/with_events.rb b/app/models/concerns/hyrax/with_events.rb index <HASH>..<HASH> 100644 --- a/app/models/concerns/hyrax/with_events.rb +++ b/app/models/concerns/hyrax/with_events.rb @@ -10,7 +10,7 @@ module Hyrax # @return [String] def event_class - self.class.name + model_name.name end def events(size = -1)
Use `model_name.name` for event class namespacing Pin the namespacing for events to the model name, not the Ruby class name. In most cases (excepting adopters who have specificially overridden ActiveModel naming behavior) this should have no impact, but loosens the dependency on specific Ruby class names.
samvera_hyrax
train
rb
b99a842275a083962d51436a77f10bb1bce1b587
diff --git a/urbansim/models/transition.py b/urbansim/models/transition.py index <HASH>..<HASH> 100644 --- a/urbansim/models/transition.py +++ b/urbansim/models/transition.py @@ -91,10 +91,11 @@ def remove_rows(data, nrows, accounting_column=None): """ logger.debug('start: removing {} rows in transition model'.format(nrows)) nrows = abs(nrows) # in case a negative number came in + unit_check = data[accounting_column].sum() if accounting_column else len(data) if nrows == 0: return data, _empty_index() - elif nrows > len(data): - raise ValueError('Number of rows to remove exceeds number of rows in table.') + elif nrows > unit_check: + raise ValueError('Number of rows to remove exceeds number of records in table.') remove_rows = sample_rows(nrows, data, accounting_column=accounting_column, replace=False) remove_index = remove_rows.index
fix for cases in which large number of accounting_column records should be removed in transition model
UDST_urbansim
train
py
d5ae9267dcde03ec304d529190aafe8444f5c65a
diff --git a/slf4j-ext/src/main/java/org/slf4j/instrumentation/LogTransformer.java b/slf4j-ext/src/main/java/org/slf4j/instrumentation/LogTransformer.java index <HASH>..<HASH> 100644 --- a/slf4j-ext/src/main/java/org/slf4j/instrumentation/LogTransformer.java +++ b/slf4j-ext/src/main/java/org/slf4j/instrumentation/LogTransformer.java @@ -79,7 +79,7 @@ public class LogTransformer implements ClassFileTransformer { } String[] ignore = { "sun/", "java/", "javax/", "org/slf4j/", - "ch/qos/logback/", "org/apache/log4j/" }; + "ch/qos/logback/", "org/apache/log4j/", "apple/", "com/sun/"}; public Builder ignore(String[] strings) { this.ignore = strings;
added apple and sun to those packages to be ignored
qos-ch_slf4j
train
java
756b2628388cf0141a1b39889c0026c32f6ee162
diff --git a/test/rules/HasCorrectDocblockStyle.php b/test/rules/HasCorrectDocblockStyle.php index <HASH>..<HASH> 100644 --- a/test/rules/HasCorrectDocblockStyle.php +++ b/test/rules/HasCorrectDocblockStyle.php @@ -26,8 +26,8 @@ class HasCorrectDocblockStyle extends \li3_quality\test\Rule { 'TAG_FORMAT' => array( '/', '{:begin}\t?\/\*\*', - '(({:wlinet} \*( [^@].*)?)+)', - '{:wlinet} \*', + '((({:wlinet} \*( [^@].*)?)+)', + '{:wlinet} \*)?', '(({:wlinet} \* @(.*)))', '(({:wlinet} \* (@|[ ]{5})(.*))+)?', '{:wlinet} \*\/',
Update regex to allow only tag based docblocks
UnionOfRAD_li3_quality
train
php
1a15a1871762869e81ab0d5f89f60d8193ed181e
diff --git a/src/Pods/Whatsit/Field.php b/src/Pods/Whatsit/Field.php index <HASH>..<HASH> 100644 --- a/src/Pods/Whatsit/Field.php +++ b/src/Pods/Whatsit/Field.php @@ -101,6 +101,8 @@ class Field extends Whatsit { if ( 'table' === $related_type ) { $related_name = $this->get_arg( 'related_table', $related_name ); + } elseif ( \in_array( $related_type, array( 'user', 'media', 'comment' ), true ) ) { + $related_name = $related_type; } return $related_name;
If user/media/comment, use related type as the related name
pods-framework_pods
train
php
121e14990855ba25d0f324ac982705818d28da49
diff --git a/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java b/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java +++ b/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java @@ -16,8 +16,6 @@ import net.openhft.lang.io.serialization.ObjectSerializer; import net.openhft.lang.model.Byteable; import net.openhft.lang.model.DataValueClasses; import org.jetbrains.annotations.NotNull; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; @@ -367,17 +365,6 @@ public final class ChronicleMapBuilder<K, V> implements ChronicleMapBuilderI<K, } - private void registerBuilderWithReplicationHub() { - - try { - FindFindByName mapByName = new NodeDiscovery().mapByName(); - mapByName.add(this); - } catch (Exception e) { - LOG.error("", e); - } - - } - @Override public ChronicleMapBuilder<K, V> actualSegments(int actualSegments) { delegate.actualSegments(actualSegments);
HCOLL-<I> removed unwanted method
OpenHFT_Chronicle-Map
train
java
0eaa0aacf1edcbdc047327630e0784f41434a8b3
diff --git a/plans/validators.py b/plans/validators.py index <HASH>..<HASH> 100644 --- a/plans/validators.py +++ b/plans/validators.py @@ -93,9 +93,10 @@ class ModelAttributeValidator(ModelCountValidator): def __call__(self, user, quota_dict=None, **kwargs): quota_value = self.get_quota_value(user, quota_dict) not_valid_objects = [] - for obj in self.get_queryset(user): - if not self.check_attribute_value(getattr(obj, self.attribute), quota_value): - not_valid_objects.append(obj) + if not quota_value is None: + for obj in self.get_queryset(user): + if not self.check_attribute_value(getattr(obj, self.attribute), quota_value): + not_valid_objects.append(obj) if not_valid_objects: raise ValidationError( self.get_error_message(quota_value, not_valid_objects=not_valid_objects)
Bug fix - do not validate if quota is None (not set)
django-getpaid_django-plans
train
py
0a30bcaea4af6f451d553f3d56519ccf7b6dd20a
diff --git a/graphql_flask/graphqlview.py b/graphql_flask/graphqlview.py index <HASH>..<HASH> 100644 --- a/graphql_flask/graphqlview.py +++ b/graphql_flask/graphqlview.py @@ -172,4 +172,6 @@ class GraphQLView(View): @staticmethod def get_content_type(request): - return request.content_type + # We use mimetype here since we don't need the other + # information provided by content_type + return request.mimetype
Use request.mimetype instead of request.content_type request.content_type has encoding and other information associated with it. If we send in multipart/form-data, the content_type attribute is not just the mime type which is what we are interested in here, but is a string of the form multipart/form-data;...
graphql-python_flask-graphql
train
py
0223ef5753088964a9ab9c46d818a8202cad140d
diff --git a/src/processbar/processbar.js b/src/processbar/processbar.js index <HASH>..<HASH> 100644 --- a/src/processbar/processbar.js +++ b/src/processbar/processbar.js @@ -135,6 +135,7 @@ module.directive('bspProcessStep', ['$q', function($q) { controllers[0].hideStepElements(); } }, function(error) { + scope.stepIsValid = false; console.error(error); }); };
disable Proceed button is case of upstream validation error
jrief_angular-bootstrap-plus
train
js
eb98097ad234f53d9f14393a41e233c49a4c4428
diff --git a/test/pipeworks_test.js b/test/pipeworks_test.js index <HASH>..<HASH> 100644 --- a/test/pipeworks_test.js +++ b/test/pipeworks_test.js @@ -130,7 +130,7 @@ describe('Pipeworks#fault', function() { it('receives errors with context', function(done) { pipeworks() .fit(function(context, next) { - setImmediate(function() { + process.nextTick(function() { throw new Error('Ozone depleted.'); }); }) @@ -145,7 +145,7 @@ describe('Pipeworks#fault', function() { it('receives errors even with no context', function(done) { pipeworks() .fit(function() { - setImmediate(function() { + process.nextTick(function() { throw new Error('Ozone depleted.'); }); })
Changing setImmediate to process.nextTick for Node <I> compatibility in tests/pipeworks_test.js
kevinswiber_pipeworks
train
js
aea737ffc405750d5a264fffb78edca1260d259b
diff --git a/pymatgen/command_line/bader_caller.py b/pymatgen/command_line/bader_caller.py index <HASH>..<HASH> 100644 --- a/pymatgen/command_line/bader_caller.py +++ b/pymatgen/command_line/bader_caller.py @@ -155,6 +155,8 @@ class BaderAnalysis: self.cube = Cube(fpath) self.structure = self.cube.structure self.nelects = None + chgrefpath = os.path.abspath(chgref_filename) if chgref_filename else None + self.reference_used = bool(chgref_filename) tmpfile = "CHGCAR" if chgcar_filename else "CUBE" with ScratchDir("."):
Update bader_caller.py The chgref option to the bader caller should be applicable to parsing cube files as well.
materialsproject_pymatgen
train
py
3b1aa8866ebadc5577b6713d70f533e489661990
diff --git a/openquake/calculators/classical.py b/openquake/calculators/classical.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/classical.py +++ b/openquake/calculators/classical.py @@ -280,10 +280,15 @@ class PreCalculator(ClassicalCalculator): """ def execute(self): eff_ruptures = AccumDict(accum=0) + # weight, nsites, time + calc_times = AccumDict(accum=numpy.zeros(3, F32)) for src in self.csm.get_sources(): for grp_id in src.src_group_ids: eff_ruptures[grp_id] += src.num_ruptures + calc_times[src.id] += numpy.array( + [src.weight, src.nsites, 0], F32) self.store_csm_info(eff_ruptures) + self.store_source_info(calc_times) return {}
Fixed the preclassical calculator to store the source weights [skip CI]
gem_oq-engine
train
py
4c15e49453fdb1094f838825486d72631533110c
diff --git a/src/client/pkg/grpcutil/grpcutil.go b/src/client/pkg/grpcutil/grpcutil.go index <HASH>..<HASH> 100644 --- a/src/client/pkg/grpcutil/grpcutil.go +++ b/src/client/pkg/grpcutil/grpcutil.go @@ -4,11 +4,13 @@ import ( "google.golang.org/grpc" ) +// Dialer defines a grpc.ClientConn connection dialer. type Dialer interface { Dial(address string) (*grpc.ClientConn, error) CloseConns() error } +// NewDialer creates a Dialer. func NewDialer(opts ...grpc.DialOption) Dialer { return newDialer(opts...) }
Fix linting in grpcutil package
pachyderm_pachyderm
train
go
1decc250f2f7908ec71a0dd4fe138749a753fbd9
diff --git a/core/src/main/java/org/web3j/protocol/core/methods/response/management/AdminNodeInfo.java b/core/src/main/java/org/web3j/protocol/core/methods/response/management/AdminNodeInfo.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/web3j/protocol/core/methods/response/management/AdminNodeInfo.java +++ b/core/src/main/java/org/web3j/protocol/core/methods/response/management/AdminNodeInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Web3 Labs LTD. + * Copyright 2019 Web3 Labs Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at
spotless (#<I>)
web3j_web3j
train
java
7bdfa7609dee6a6e9dad13932eb56998023f5ecc
diff --git a/libagent/device/keepkey_defs.py b/libagent/device/keepkey_defs.py index <HASH>..<HASH> 100644 --- a/libagent/device/keepkey_defs.py +++ b/libagent/device/keepkey_defs.py @@ -9,6 +9,9 @@ from keepkeylib.transport_hid import HidTransport from keepkeylib.transport_webusb import WebUsbTransport from keepkeylib.types_pb2 import IdentityType +get_public_node = Client.get_public_node +sign_identity = Client.sign_identity +Client.state = None def find_device(): """Returns first WebUSB or HID transport."""
Upgrade KeepKey for new libagent code Add get_public_node for KeepKey
romanz_trezor-agent
train
py
0d599a1a7680fc4a35b5f44ba0c3b9aeccccbfaf
diff --git a/src/structures/User.js b/src/structures/User.js index <HASH>..<HASH> 100644 --- a/src/structures/User.js +++ b/src/structures/User.js @@ -324,7 +324,7 @@ class User extends Base { ); json.avatarURL = this.avatarURL(); json.displayAvatarURL = this.displayAvatarURL(); - json.bannerURL = this.bannerURL(); + json.bannerURL = this.banner ? this.bannerURL() : this.banner; return json; }
fix(User): don't generate the banner URL when not cached (#<I>)
discordjs_discord.js
train
js
f159b0a5a8e0c43942e8d60eb27a51f2679afa3e
diff --git a/activerecord/test/cases/adapters/postgresql/range_test.rb b/activerecord/test/cases/adapters/postgresql/range_test.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/cases/adapters/postgresql/range_test.rb +++ b/activerecord/test/cases/adapters/postgresql/range_test.rb @@ -1,4 +1,5 @@ require "cases/helper" +require 'support/postgresql_helper' require 'active_record/base' require 'active_record/connection_adapters/postgresql_adapter' @@ -8,17 +9,19 @@ if ActiveRecord::Base.connection.supports_ranges? end class PostgresqlRangeTest < ActiveRecord::TestCase + self.use_transactional_fixtures = false + include PostgresqlHelper + teardown do @connection.execute 'DROP TABLE IF EXISTS postgresql_ranges' @connection.execute 'DROP TYPE IF EXISTS floatrange' + reset_pg_session end def setup @connection = PostgresqlRange.connection begin @connection.transaction do - @connection.execute 'DROP TABLE IF EXISTS postgresql_ranges' - @connection.execute 'DROP TYPE IF EXISTS floatrange' @connection.execute <<_SQL CREATE TYPE floatrange AS RANGE ( subtype = float8,
cleanup, `reset_pg_session` in range_test.rb Also do not use transactional fixtures. We drop the type and the table after every run, so there is nothing for the transaction to clean up.
rails_rails
train
rb
63b0d42b682a79d87beb899589e18612153543dd
diff --git a/pymc3/variational/callbacks.py b/pymc3/variational/callbacks.py index <HASH>..<HASH> 100644 --- a/pymc3/variational/callbacks.py +++ b/pymc3/variational/callbacks.py @@ -74,7 +74,7 @@ class CheckParametersConvergence(Callback): self.prev = current norm = np.linalg.norm(delta, self.ord) if norm < self.tolerance: - raise StopIteration('Convergence archived at %d' % i) + raise StopIteration('Convergence achieved at %d' % i) @staticmethod def flatten_shared(shared_list):
Corrected typo in convergence callback (#<I>)
pymc-devs_pymc
train
py
d2a13205652e9ea4215bebfed6bb75cc088d306d
diff --git a/pysat/_instrument.py b/pysat/_instrument.py index <HASH>..<HASH> 100644 --- a/pysat/_instrument.py +++ b/pysat/_instrument.py @@ -3123,8 +3123,9 @@ class Instrument(object): 'metadata (MetaHeader). Default attachment ', 'of global attributes to Instrument will ', 'be Deprecated in pysat 3.2.0+. Set ', - '`use_header=True` to remove this ', - 'warning.']), DeprecationWarning, + '`use_header=True` in this load call or ', + 'on instrument instantiation to remove this', + ' warning.']), DeprecationWarning, stacklevel=2) self.meta.transfer_attributes_to_instrument(self) self.meta.mutable = False
DOC: expanded warning Expanded the warning to spell out both places the kwarg can be used.
rstoneback_pysat
train
py
356f9525d8ca4cd45b0b646c228cb33aca87c186
diff --git a/ghost/admin/routes/settings/users/user.js b/ghost/admin/routes/settings/users/user.js index <HASH>..<HASH> 100644 --- a/ghost/admin/routes/settings/users/user.js +++ b/ghost/admin/routes/settings/users/user.js @@ -1,11 +1,18 @@ var SettingsUserRoute = Ember.Route.extend({ model: function (params) { + var self = this; // TODO: Make custom user adapter that uses /api/users/:slug endpoint // return this.store.find('user', { slug: params.slug }); // Instead, get all the users and then find by slug return this.store.find('user').then(function (result) { - return result.findBy('slug', params.slug); + var user = result.findBy('slug', params.slug); + + if (!user) { + return self.transitionTo('error404', 'settings/users/' + params.slug); + } + + return user; }); },
Redirect to error<I> when user not found. Closes #<I>.
TryGhost_Ghost
train
js
b59871dc4ff0d51e62d1b910486cb181453c651c
diff --git a/src/js/services/linkedin.js b/src/js/services/linkedin.js index <HASH>..<HASH> 100644 --- a/src/js/services/linkedin.js +++ b/src/js/services/linkedin.js @@ -2,6 +2,8 @@ module.exports = function(shariff) { var url = encodeURIComponent(shariff.getURL()); + var title = encodeURIComponent(shariff.getTitle()); + var descr = encodeURIComponent(shariff.getMeta('description')); return { popup: true, shareText: { @@ -56,6 +58,6 @@ module.exports = function(shariff) { 'tr': 'LinkedIn\'ta paylaş', 'zh': '在LinkedIn上分享' }, - shareUrl: 'https://www.linkedin.com/cws/share?url=' + url + shariff.getReferrerTrack() + shareUrl: 'https://www.linkedin.com/shareArticle?mini=true&summary=' + descr + '&title=' + title + '&url=' + url }; };
improved share link to linkedIn more control over the title and summary text
heiseonline_shariff
train
js
82c7d255e1ce319879024475081c8cd6647cef01
diff --git a/calendar-bundle/src/Resources/contao/dca/tl_calendar_events.php b/calendar-bundle/src/Resources/contao/dca/tl_calendar_events.php index <HASH>..<HASH> 100644 --- a/calendar-bundle/src/Resources/contao/dca/tl_calendar_events.php +++ b/calendar-bundle/src/Resources/contao/dca/tl_calendar_events.php @@ -703,7 +703,7 @@ class tl_calendar_events extends Backend return ' <div class="cte_type ' . $key . '"><strong>' . $arrRow['title'] . '</strong> - ' . $date . '</div> -<div class="limit_height' . (!$GLOBALS['TL_CONFIG']['doNotCollapse'] ? ' h52' : '') . ' block"> +<div class="limit_height' . (!$GLOBALS['TL_CONFIG']['doNotCollapse'] ? ' h52' : '') . '"> ' . (($arrRow['details'] != '') ? $arrRow['details'] : $arrRow['teaser']) . ' </div>' . "\n"; }
[Calendar] Added a "chosen" widget to the templates editor (see #<I>)
contao_contao
train
php
1f38b8e5d62dab7ff4ddabc425eeef908a78a4c3
diff --git a/pyasn1/type/base.py b/pyasn1/type/base.py index <HASH>..<HASH> 100644 --- a/pyasn1/type/base.py +++ b/pyasn1/type/base.py @@ -221,7 +221,7 @@ class NoValue(object): raise error.PyAsn1Error('Attempted "%s" operation on ASN.1 schema object' % attr) def __repr__(self): - return '<%s object at %s>' % (self.__class__.__name__, id(self)) + return '<%s object at 0x%x>' % (self.__class__.__name__, id(self)) noValue = NoValue()
NoValue.__repr__() should report object address in hex
etingof_pyasn1
train
py
6a3becaecd76cb0daed19e4e72b92a608aedb03b
diff --git a/tests/scripts/unit/wee-screen.js b/tests/scripts/unit/wee-screen.js index <HASH>..<HASH> 100644 --- a/tests/scripts/unit/wee-screen.js +++ b/tests/scripts/unit/wee-screen.js @@ -145,6 +145,42 @@ describe('Screen', () => { expect(state.one).to.equal(true); }); + it('can use function as callback', () => { + function callback() { + state.one = true; + } + + $screen.map({ + size: 3, + callback + }); + + setScreenSize(3); + expect(state.one).to.equal(true); + }); + + it('should execute multiple callbacks', () => { + function callbackOne() { + state.one = true; + } + + function callbackTwo() { + state.two = true; + } + + $screen.map({ + size: 3, + callback: [ + callbackOne, + callbackTwo + ] + }); + + setScreenSize(3); + expect(state.one).to.equal(true); + expect(state.two).to.equal(true); + }); + describe('each', () => { it('should execute callback on each size until max', () => { $screen.map({
Add additional test cases for callback execution
weepower_wee-core
train
js
2d10b9122cc08be90815ce23636beb5a741b5aa1
diff --git a/clustergrammer3/load_data.py b/clustergrammer3/load_data.py index <HASH>..<HASH> 100644 --- a/clustergrammer3/load_data.py +++ b/clustergrammer3/load_data.py @@ -1,10 +1,17 @@ def load_file(net, filename): - import io + import io, sys f = open(filename, 'r') file_string = f.read() - file_string = unicode(file_string) + if (sys.version_info > (3, 0)): + # python 3 + #################### + file_string = str(file_string) + else: + # python 2 + #################### + file_string = unicode(file_string) buff = io.StringIO(file_string) f.close()
workin on unicode/str fix for 2 and 3
MaayanLab_clustergrammer-py
train
py
5506e8d6f63ea2b77cb603f63a01c6e16e2af433
diff --git a/src/data/values/numbers.js b/src/data/values/numbers.js index <HASH>..<HASH> 100644 --- a/src/data/values/numbers.js +++ b/src/data/values/numbers.js @@ -37,6 +37,7 @@ const cardinal = { multiples: { 'hundred': 1e2, 'thousand': 1e3, + 'grand': 1e3, 'million': 1e6, 'billion': 1e9, 'trillion': 1e12, diff --git a/src/term/normalize.js b/src/term/normalize.js index <HASH>..<HASH> 100644 --- a/src/term/normalize.js +++ b/src/term/normalize.js @@ -8,8 +8,8 @@ const normalize = function(term) { str = fixUnicode(str); //convert hyphenations to a multiple-word term str = str.replace(/([a-z])\-([a-z])/g, '$1 $2'); - //hashtags, atmentions - str = str.replace(/^[#@]/, ''); + //hashtags, atmentions, dollar signs + str = str.replace(/^[#@$]/, ''); // coerce single curly quotes str = str.replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]+/g, '\''); // coerce double curly quotes
$ signs are filtered out on numbers, and grand is interpreted as <I>
spencermountain_compromise
train
js,js
631fff55dd7b80f860fb0dd0d6da5a69a2000780
diff --git a/prow/github/client.go b/prow/github/client.go index <HASH>..<HASH> 100644 --- a/prow/github/client.go +++ b/prow/github/client.go @@ -600,6 +600,15 @@ func (r requestError) ErrorMessages() []string { return []string{} } +// NewNotFound returns a NotFound error which may be useful for tests +func NewNotFound() error { + return requestError{ + ClientError: ClientError{ + Errors: []clientErrorSubError{{Message: "status code 404"}}, + }, + } +} + func IsNotFound(err error) bool { if err == nil { return false diff --git a/prow/github/client_test.go b/prow/github/client_test.go index <HASH>..<HASH> 100644 --- a/prow/github/client_test.go +++ b/prow/github/client_test.go @@ -607,6 +607,12 @@ func TestRemoveLabelNotFound(t *testing.T) { } } +func TestNewNotFoundIsNotFound(t *testing.T) { + if !IsNotFound(NewNotFound()) { + t.Error("NewNotFound didn't return an error that was considered a NotFound") + } +} + func TestIsNotFound(t *testing.T) { testCases := []struct { name string
Github: Add NewNotFound to aid in testing
kubernetes_test-infra
train
go,go
9c40d00c4eca25c10214ded502674c2a0b428725
diff --git a/web/concrete/src/Page/Theme/Theme.php b/web/concrete/src/Page/Theme/Theme.php index <HASH>..<HASH> 100644 --- a/web/concrete/src/Page/Theme/Theme.php +++ b/web/concrete/src/Page/Theme/Theme.php @@ -549,7 +549,6 @@ class Theme extends Object $pageThemeFile = $dir . '/' . FILENAME_THEMES_CLASS; if (is_file($pageThemeFile)) { try { - $pkgHandle = PackageList::getHandle($row['pkgID']); if (strlen($pkgHandle)) { $className = '\\Concrete\\Package\\' . camelcase($pkgHandle); } else {
Fixing typo that was leading to this not installing Former-commit-id: <I>bde5ce0b<I>bc1c0afdb3f3f<I>fc<I>b<I>
concrete5_concrete5
train
php
6889aa242f2649943a02b6c86444618bee1ee033
diff --git a/src/helpers.php b/src/helpers.php index <HASH>..<HASH> 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -3,6 +3,7 @@ use Illuminate\Support\Str; use Illuminate\Container\Container; use Illuminate\Contracts\Bus\Dispatcher; +use Laravel\Lumen\Bus\PendingDispatch; if (! function_exists('abort')) { /** @@ -74,7 +75,21 @@ if (! function_exists('dispatch')) { */ function dispatch($job) { - return app(Dispatcher::class)->dispatch($job); + return new PendingDispatch($job); + } +} + +if (! function_exists('dispatch_now')) { + /** + * Dispatch a command to its appropriate handler in the current process. + * + * @param mixed $job + * @param mixed $handler + * @return mixed + */ + function dispatch_now($job, $handler = null) + { + return app(Dispatcher::class)->dispatchNow($job, $handler); } }
Add the dispatch_now helper to Lumen and change the existing dispatch helper to use the new PendingDispatch class.
laravel_lumen-framework
train
php
d9bff5310ac2d303f8ca1ac6352101d7ad12cdf1
diff --git a/examples/src/main/java/org/btrplace/examples/SolverTuning.java b/examples/src/main/java/org/btrplace/examples/SolverTuning.java index <HASH>..<HASH> 100644 --- a/examples/src/main/java/org/btrplace/examples/SolverTuning.java +++ b/examples/src/main/java/org/btrplace/examples/SolverTuning.java @@ -79,7 +79,6 @@ public class SolverTuning implements Example { //We want the best possible solution, computed in up to 5 sec. cra.doOptimize(true); cra.setTimeLimit(5); - cra.setVerbosity(4); //We solve without the repair mode cra.doRepair(false); solve(cra, model, constraints);
fix verbosity in a test
btrplace_scheduler
train
java
bbb585b3db28b0ccf3e0bf5fe5365d137fc550c5
diff --git a/salt/client/ssh/shell.py b/salt/client/ssh/shell.py index <HASH>..<HASH> 100644 --- a/salt/client/ssh/shell.py +++ b/salt/client/ssh/shell.py @@ -109,7 +109,7 @@ class Shell(object): if self.passwd: options.extend(['PasswordAuthentication=yes', - 'PubkeyAuthentication=no']) + 'PubkeyAuthentication=yes']) else: options.extend(['PasswordAuthentication=no', 'PubkeyAuthentication=yes',
Change how salt-ssh connects with sshpass. When the 'passwd' option is set in the rooster file for a host, then salt won't use PubkeyAuthentication even if it is already set up.
saltstack_salt
train
py
52d3d6f54026f4d0590afd4a3ffc096c7c7e3a85
diff --git a/version.php b/version.php index <HASH>..<HASH> 100644 --- a/version.php +++ b/version.php @@ -29,9 +29,9 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2019111300.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2019111500.00; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes. -$release = '3.8beta (Build: 20191112)'; // Human-friendly version name +$release = '3.8rc1 (Build: 20191115)'; // Human-friendly version name $branch = '38'; // This version's branch. -$maturity = MATURITY_BETA; // This version's maturity level. +$maturity = MATURITY_RC; // This version's maturity level.
Moodle release <I>rc1
moodle_moodle
train
php
fbba2ff4cc8aee25a82c2e23b343f20b576baf54
diff --git a/vyper/old_codegen/function_definitions/external_function.py b/vyper/old_codegen/function_definitions/external_function.py index <HASH>..<HASH> 100644 --- a/vyper/old_codegen/function_definitions/external_function.py +++ b/vyper/old_codegen/function_definitions/external_function.py @@ -136,7 +136,7 @@ def generate_lll_for_external_function(code, sig, context, check_nonpayable): kwarg_handlers = _generate_kwarg_handlers(context, sig, pos) - entrance = [base_arg_handlers] + entrance = [] # once args have been handled if len(kwarg_handlers) > 0: @@ -146,6 +146,8 @@ def generate_lll_for_external_function(code, sig, context, check_nonpayable): # one control flow path into the external method pass + entrance += base_arg_handlers + if check_nonpayable and sig.mutability != "payable": # if the contract contains payable functions, but this is not one of them # add an assertion that the value of the call is zero
fix order of base arg hanlders
ethereum_vyper
train
py
126fde964b3570a3747d75cb617f23f7bf0cb45b
diff --git a/src/Expression.php b/src/Expression.php index <HASH>..<HASH> 100644 --- a/src/Expression.php +++ b/src/Expression.php @@ -617,7 +617,7 @@ class Expression implements \ArrayAccess, \IteratorAggregate return $statement; } - // @var Connection Connection + /** @var Connection $connection */ return $connection->execute($this); }
fix comment (#<I>)
atk4_dsql
train
php
53b321571a2f0929ada1c1a066358de33aa402c8
diff --git a/spec/active_record/acts/shopping_cart/item_spec.rb b/spec/active_record/acts/shopping_cart/item_spec.rb index <HASH>..<HASH> 100644 --- a/spec/active_record/acts/shopping_cart/item_spec.rb +++ b/spec/active_record/acts/shopping_cart/item_spec.rb @@ -21,7 +21,7 @@ describe ActiveRecord::Acts::ShoppingCart::Item do describe :item_for do context "no cart item exists for the object" do before do - shopping_cart_items.should_receive(:where).with(:item_id => object.id, :item_type => object.class.name).and_return([]) + shopping_cart_items.should_receive(:where).with(:item => object).and_return([]) end it "returns the shopping cart item object for the requested object" do @@ -31,7 +31,7 @@ describe ActiveRecord::Acts::ShoppingCart::Item do context "a cart item exists for the object" do before do - shopping_cart_items.should_receive(:where).with(:item_id => object.id, :item_type => object.class.name).and_return([ item ]) + shopping_cart_items.should_receive(:where).with(:item => object).and_return([ item ]) end it "returns that item" do
changed spec tests to accept last bugfix for STI
crowdint_acts_as_shopping_cart
train
rb
ca380f11793934e61b9dda6172b8656921c72e11
diff --git a/lib/hbs.js b/lib/hbs.js index <HASH>..<HASH> 100644 --- a/lib/hbs.js +++ b/lib/hbs.js @@ -171,7 +171,7 @@ Instance.prototype.registerPartials = function (directory, done) { if (!err) { var ext = path.extname(filepath); var templateName = path.relative(directory, filepath) - .slice(0, -(ext.length)).replace(/[ -]/g, '_'); + .slice(0, -(ext.length)).replace(/[ -]/g, '_').replace('\\', '/'); handlebars.registerPartial(templateName, data); }
Replace backslash with foreward slash when reading partials
pillarjs_hbs
train
js
19b1134800078702f3238180f348adb262a5f908
diff --git a/src/com/aoindustries/messaging/http/HttpSocketClient.java b/src/com/aoindustries/messaging/http/HttpSocketClient.java index <HASH>..<HASH> 100644 --- a/src/com/aoindustries/messaging/http/HttpSocketClient.java +++ b/src/com/aoindustries/messaging/http/HttpSocketClient.java @@ -37,7 +37,7 @@ import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Element; /** - * Client component for bi-directional messaging over TCP. + * Client component for bi-directional messaging over HTTP. */ public class HttpSocketClient extends AbstractSocketContext<HttpSocket> {
Working on Java implementation of both client and server for HTTP sockets.
aoindustries_aocode-public
train
java
c9b4f2185111ff6873f4d03f2af5f423ccc0ab71
diff --git a/test/fixtures/index.js b/test/fixtures/index.js index <HASH>..<HASH> 100644 --- a/test/fixtures/index.js +++ b/test/fixtures/index.js @@ -35,11 +35,10 @@ function fixtures(basename) { // fixtures with the API Elements JSON missing (should blow up and the // scripts/pretest.js should be ran to mitigate the issue) .filter(fixture => fs.existsSync(fixture.apiDescriptionPath)) - .map(fixture => ({ + .map(fixture => Object.assign({ apiDescription: fs.readFileSync(fixture.apiDescriptionPath, { encoding: 'utf8' }), apiElements: readAPIelements(fixture.apiElementsPath), - ...fixture, - })); + }, fixture)); // prevent invalid fixture names if (array.length < 1) {
test: don't use the splat syntax (Node 6 doesn't have it)
apiaryio_dredd-transactions
train
js
10d60bcc31bfa86f02a2f2b50a70b33d464d8dd1
diff --git a/src/DoctrineModule/ServiceFactory/AbstractDoctrineServiceFactory.php b/src/DoctrineModule/ServiceFactory/AbstractDoctrineServiceFactory.php index <HASH>..<HASH> 100644 --- a/src/DoctrineModule/ServiceFactory/AbstractDoctrineServiceFactory.php +++ b/src/DoctrineModule/ServiceFactory/AbstractDoctrineServiceFactory.php @@ -100,10 +100,10 @@ class AbstractDoctrineServiceFactory implements AbstractFactoryInterface ]; } - if (! isset($config['doctrine_factories'][$mappingType]) || - ! isset($config['doctrine_factories'][$mappingType][$serviceType]) || - ! isset($config['doctrine'][$mappingType][$serviceType][$serviceName]) - ) { + if (! isset( + $config['doctrine_factories'][$mappingType][$serviceType], + $config['doctrine'][$mappingType][$serviceType][$serviceName] + )) { return false; }
Simplified isset in AbstractDoctrineServiceFactory
doctrine_DoctrineModule
train
php
f53f65b82e149d318cb1f1fab36e035f4486c071
diff --git a/km3pipe/db.py b/km3pipe/db.py index <HASH>..<HASH> 100644 --- a/km3pipe/db.py +++ b/km3pipe/db.py @@ -357,26 +357,26 @@ class DBManager(object): ) tcal = run_info.T0_CALIBSETID - try: - pcal = int(run_info.POS_CALIBSETID) - except ValueError: - pcal = 0 - rcal = run_info.ROT_CALIBSETID - - if not tcal or np.isnan(tcal): + if str(tcal) == 'nan': self.log.warning( "No time calibration found for run {} (detector {})".format( run, det_id ) ) tcal = 0 - if not pcal or np.isnan(pcal): + + try: + pcal = int(run_info.POS_CALIBSETID) + except ValueError: self.log.warning( "No position calibration found for run {} (detector {})". format(run, det_id) ) pcal = 0 - if not rcal or np.isnan(rcal): + + try: + rcal = int(run_info.ROT_CALIBSETID) + except ValueError: self.log.warning( "No rotation calibration found for run {} (detector {})". format(run, det_id)
Improve error handling from the db
tamasgal_km3pipe
train
py
35a331f988f766e0b650f4334008c684dba50d6c
diff --git a/src/event/name.js b/src/event/name.js index <HASH>..<HASH> 100644 --- a/src/event/name.js +++ b/src/event/name.js @@ -12,7 +12,7 @@ define(function (require) { require("../regexp/escape"); var EventName, - createClass = require("solv/class"), + createClass = require("../class"), meta = require("../meta"); meta.setRequire(require);
bug fix - changing solv/class to ../class in event/name.js
bob-gray_solv
train
js
f739ef984978ed7838898036b49359737d789410
diff --git a/builtin/providers/aws/resource_aws_ebs_volume.go b/builtin/providers/aws/resource_aws_ebs_volume.go index <HASH>..<HASH> 100644 --- a/builtin/providers/aws/resource_aws_ebs_volume.go +++ b/builtin/providers/aws/resource_aws_ebs_volume.go @@ -186,7 +186,7 @@ func resourceAwsEbsVolumeRead(d *schema.ResourceData, meta interface{}) error { d.SetId("") return nil } - return fmt.Errorf("Error reading EC2 volume %s: %#v", d.Id(), err) + return fmt.Errorf("Error reading EC2 volume %s: %s", d.Id(), err) } return readVolume(d, response.Volumes[0])
Human-readable error for failure to read EC2 volume Previously the format string was using %#v, which prints the whole data structure given. Instead we want to use %s to get the string representation of the error. This fixes #<I>.
hashicorp_terraform
train
go
8e085a774b2bb2a067df5b381597a6e7ee945b6e
diff --git a/src/main/java/water/fvec/TachyonFileVec.java b/src/main/java/water/fvec/TachyonFileVec.java index <HASH>..<HASH> 100644 --- a/src/main/java/water/fvec/TachyonFileVec.java +++ b/src/main/java/water/fvec/TachyonFileVec.java @@ -13,13 +13,16 @@ public class TachyonFileVec extends FileVec { } public static Key make(String serverUri, ClientFileInfo tf, Futures fs) { String fname = tf.getPath(); // Always return absolute path /dir/filename - Key k = Key.make(PersistTachyon.PREFIX + serverUri + fname); long size = tf.getLength(); + Key k = Key.make(PersistTachyon.PREFIX + serverUri + fname); Key k2 = Vec.newKey(k); + new Frame(k2).delete_and_lock(null); // Insert the top-level FileVec key into the store Vec v = new TachyonFileVec(k2,size); DKV.put(k2, v, fs); - new Frame(k,new String[]{fname},new Vec[]{v}).delete_and_lock(null).unlock(null); + Frame fr = new Frame(k,new String[] {fname}, new Vec[] {v}); + fr.update(null); + fr.unlock(null); return k; } private TachyonFileVec(Key key, long len) {super(key,len,Value.TACHYON);}
Mimic Tomas fix for platform vectors.
h2oai_h2o-2
train
java
3fa42d68fff68bc7255e09d0ef5e754d01d96ad1
diff --git a/generators/generator-constants.js b/generators/generator-constants.js index <HASH>..<HASH> 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -20,7 +20,7 @@ // version of docker images const DOCKER_JHIPSTER_REGISTRY = 'jhipster/jhipster-registry:v4.1.1'; const DOCKER_JAVA_JRE = 'openjdk:11-jre-slim-stretch'; -const DOCKER_MYSQL = 'mysql:8.0.15'; +const DOCKER_MYSQL = 'mysql:8.0.16'; const DOCKER_MARIADB = 'mariadb:10.4.3'; const DOCKER_POSTGRESQL = 'postgres:11.2'; const DOCKER_MONGODB = 'mongo:4.0.8';
Update docker mysql image version to <I>
jhipster_generator-jhipster
train
js
74ce744df954120e86629f8c3295858b68a17225
diff --git a/src/main/java/com/googlecode/lanterna/terminal/ansi/UnixLikeTTYTerminal.java b/src/main/java/com/googlecode/lanterna/terminal/ansi/UnixLikeTTYTerminal.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/googlecode/lanterna/terminal/ansi/UnixLikeTTYTerminal.java +++ b/src/main/java/com/googlecode/lanterna/terminal/ansi/UnixLikeTTYTerminal.java @@ -186,6 +186,7 @@ public abstract class UnixLikeTTYTerminal extends UnixLikeTerminal { } private String getSTTYCommand() { - return "/bin/stty"; + return System.getProperty("com.googlecode.lanterna.terminal.UnixTerminal.sttyCommand", + "/bin/stty"); } } \ No newline at end of file
Issue #<I>: Allow customizing stty command by system property
mabe02_lanterna
train
java
20b7f38bc0534841ed3049ba38bb556289f227d9
diff --git a/storage/tests/system.py b/storage/tests/system.py index <HASH>..<HASH> 100644 --- a/storage/tests/system.py +++ b/storage/tests/system.py @@ -27,6 +27,7 @@ from google.cloud.storage._helpers import _base64_md5hash from google.cloud.storage.bucket import LifecycleRuleDelete from google.cloud.storage.bucket import LifecycleRuleSetStorageClass from google.cloud import kms +import google.oauth2 from test_utils.retry import RetryErrors from test_utils.system import unique_resource_id @@ -703,6 +704,12 @@ class TestStorageSignURLs(TestStorageFiles): def setUp(self): super(TestStorageSignURLs, self).setUp() + if ( + type(Config.CLIENT._credentials) + is not google.oauth2.service_account.credentials + ): + self.skipTest("Signing tests requires a service account credential") + logo_path = self.FILES["logo"]["path"] with open(logo_path, "rb") as file_obj: self.LOCAL_FILE = file_obj.read() @@ -964,7 +971,6 @@ class TestStorageRewrite(TestStorageFiles): class TestStorageUpdateStorageClass(TestStorageFiles): - def test_update_storage_class_small_file(self): blob = self.bucket.blob("SmallFile")
Skip signing tests for insufficient credentials (#<I>) * Skip signing tests for insufficient credentials
googleapis_google-cloud-python
train
py
e60dd402a6a664afc6baf3335a23326d8f92e569
diff --git a/lib/mbtiles.js b/lib/mbtiles.js index <HASH>..<HASH> 100644 --- a/lib/mbtiles.js +++ b/lib/mbtiles.js @@ -560,7 +560,7 @@ MBTiles.prototype.putTile = function(z, x, y, data, callback) { this._mapCache[coords].tile_id = id; // Only commit when we can insert at least 100 rows. - if (++this._pending < 100) return this._commit(callback); + if (++this._pending >= 100) return this._commit(callback); else return callback(null); }; @@ -599,7 +599,7 @@ MBTiles.prototype.putGrid = function(z, x, y, data, callback) { this._mapCache[coords].grid_id = id; // Only commit when we can insert at least 100 rows. - if (++this._pending < 100) return this._commit(callback); + if (++this._pending >= 100) return this._commit(callback); else return callback(null); };
Another bug found by @yhahn that lead to comitting too often
mapbox_node-mbtiles
train
js
c471b92053911e49702647ab46d487a54f326ed1
diff --git a/springfox-swagger2/src/main/java/springfox/documentation/swagger2/mappers/ModelMapper.java b/springfox-swagger2/src/main/java/springfox/documentation/swagger2/mappers/ModelMapper.java index <HASH>..<HASH> 100644 --- a/springfox-swagger2/src/main/java/springfox/documentation/swagger2/mappers/ModelMapper.java +++ b/springfox-swagger2/src/main/java/springfox/documentation/swagger2/mappers/ModelMapper.java @@ -53,7 +53,7 @@ import static springfox.documentation.schema.Maps.*; import static springfox.documentation.swagger2.mappers.EnumMapper.*; import static springfox.documentation.swagger2.mappers.Properties.*; -@Mapper(uses = { EnumMapper.class }) +@Mapper public abstract class ModelMapper { public Map<String, Model> mapModels(Map<String, springfox.documentation.schema.Model> from) { if (from == null) {
Removed un-needed mapper reference related to #<I>
springfox_springfox
train
java