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
d50844cbc2584708e292e86f680219bfdf057b97
diff --git a/will/mixins/schedule.py b/will/mixins/schedule.py index <HASH>..<HASH> 100644 --- a/will/mixins/schedule.py +++ b/will/mixins/schedule.py @@ -135,7 +135,7 @@ class ScheduleMixin(object): # and that seems more useful. possible_times = [] for i in range(start_hour, end_hour): - for j in range(0, 59): + for j in range(0, 60): possible_times.append((i,j)) times = random.sample(possible_times, num_times_per_day)
Fix random task scheduling never being scheduled for minute <I> of an hour
skoczen_will
train
py
32b6b190c8c31efa6c49c5a72e1ef55b5e9e9106
diff --git a/resources/assets/js/include/remote_validator.js b/resources/assets/js/include/remote_validator.js index <HASH>..<HASH> 100644 --- a/resources/assets/js/include/remote_validator.js +++ b/resources/assets/js/include/remote_validator.js @@ -170,7 +170,9 @@ var RemoteValidator = function( form ) if (target.is(input_selector)) { - var field_box = target.parents('.field').first(); + // i18n fields contain a child .field element + var field_box = target.parents('.field:not(.localization)').first(); + if (field_box.length !== 1) { return;
Fixed i<I>n field error visibility when it occurs in a different language (#<I>)
arbory_arbory
train
js
32dcacc70ba8894e0720b68f1f74a2c558a9e7c2
diff --git a/model.go b/model.go index <HASH>..<HASH> 100644 --- a/model.go +++ b/model.go @@ -5,6 +5,7 @@ import ( "fmt" "reflect" "regexp" + "strconv" "time" ) @@ -244,6 +245,9 @@ func setFieldValue(field reflect.Value, value interface{}) { if field.IsValid() { switch field.Kind() { case reflect.Int, reflect.Int32, reflect.Int64: + if str, ok := value.(string); ok { + value, _ = strconv.Atoi(str) + } field.SetInt(reflect.ValueOf(value).Int()) default: field.Set(reflect.ValueOf(value))
Convert str to int if it is when set field
jinzhu_gorm
train
go
11632b4e7b93b5687b14ac81b57251e1443a79f5
diff --git a/lib/soulmate.rb b/lib/soulmate.rb index <HASH>..<HASH> 100644 --- a/lib/soulmate.rb +++ b/lib/soulmate.rb @@ -23,7 +23,7 @@ module Soulmate def redis @redis ||= ( - url = URI(@redis_url || "redis://127.0.0.1:6379/0") + url = URI(@redis_url || ENV["REDISTOGO_URL"] || "redis://127.0.0.1:6379/0") ::Redis.new({ :host => url.host,
reading connection string from ENV[REDISTOGO_URL] to support solumate on heroku
sethherr_soulheart
train
rb
ab8765e5abf409a9f870a169da5644870361ee43
diff --git a/src/custard.php b/src/custard.php index <HASH>..<HASH> 100644 --- a/src/custard.php +++ b/src/custard.php @@ -10,10 +10,10 @@ use Symfony\Component\Console\Application; const CUSTARD_VERSION = "0.1"; const CUSTARD_NAME = "Custard"; -chdir(__DIR__ . "/../../../"); +chdir(__DIR__ . "/../../../../"); // Initiate our bootstrap script to boot all libraries required. -require_once "boot.php"; +require_once "vendor/rhubarbphp/rhubarb/platform/boot.php"; // Disable exception trapping as there will be no valid URL handler able to return a sensible // interpretation of the exception details. CLI scripts are never seen publicly so it is more
Fixed boot script path for working from rhubarb project root when used as a dependency
RhubarbPHP_Custard
train
php
0f58f9eab9dbc9129f4bd5494f90b7a7e09e8d7d
diff --git a/lib/logging/log_event.rb b/lib/logging/log_event.rb index <HASH>..<HASH> 100644 --- a/lib/logging/log_event.rb +++ b/lib/logging/log_event.rb @@ -13,7 +13,7 @@ module Logging # * $3 == method name (might be nil) CALLER_RGXP = %r/([-\.\/\(\)\w]+):(\d+)(?::in `(\w+)')?/o #CALLER_INDEX = 2 - CALLER_INDEX = ((defined? JRUBY_VERSION and JRUBY_VERSION[%r/^1.6/]) or (RUBY_ENGINE[%r/^rbx/i])) ? 1 : 2 + CALLER_INDEX = ((defined? JRUBY_VERSION and JRUBY_VERSION[%r/^1.6/]) or (defined? RUBY_ENGINE and RUBY_ENGINE[%r/^rbx/i])) ? 1 : 2 # :startdoc: # call-seq:
Fixing RUBY_ENGINE definition for ruby <I>
TwP_logging
train
rb
3eb893302db3d9f12fbe61f33bba5b1931033a19
diff --git a/lib/tasks.js b/lib/tasks.js index <HASH>..<HASH> 100644 --- a/lib/tasks.js +++ b/lib/tasks.js @@ -27,7 +27,18 @@ module.exports = function(self) { // Return a `req` object suitable for use with putPage, getPage, etc. // that has full admin permissions. For use in command line tasks self.getTaskReq = function() { - return { user: { permissions: { admin: true } } }; + return { + user: { + permissions: { + admin: true + } + }, + // TODO: this will be hard to sustain + // as we add more methods to the request + // prototype. + traceIn: function() {}, + traceOut: function() {} + }; }; var taskFailed = false;
Need a more complete fake req object for tasks
apostrophecms_apostrophe
train
js
8e948a475c35e342de9f3362b9bc8793c3d7342e
diff --git a/provision.go b/provision.go index <HASH>..<HASH> 100644 --- a/provision.go +++ b/provision.go @@ -495,7 +495,7 @@ func createNewSpartaCustomResourceEntry(resourceName string, logger *logrus.Logg logger.WithFields(logrus.Fields{ "Resource": resourceName, "NodeJSFunctionName": jsName, - }).Info("Registering Sparta CustomResource function") + }).Debug("Registering Sparta CustomResource function") primaryEntry := fmt.Sprintf("exports[\"%s\"] = createForwarder(\"/%s\");\n", jsName,
Reduce logging level for impl details
mweagle_Sparta
train
go
5f124166eb58ee166caec92bf4c3ee2b32e1a218
diff --git a/tests/functional/discovery_test.go b/tests/functional/discovery_test.go index <HASH>..<HASH> 100644 --- a/tests/functional/discovery_test.go +++ b/tests/functional/discovery_test.go @@ -144,7 +144,7 @@ func TestDiscoverySecondPeerFirstNoResponse(t *testing.T) { resp, err = etcdtest.PutForm(fmt.Sprintf("%s%s", s.URL(), "/v2/keys/_etcd/registry/2/ETCDTEST"), v) assert.Equal(t, resp.StatusCode, http.StatusCreated) - proc, err := startServer([]string{"-discovery", s.URL() + "/v2/keys/_etcd/registry/2"}) + proc, err := startServer([]string{"-retry-interval", "0.2", "-discovery", s.URL() + "/v2/keys/_etcd/registry/2"}) if err != nil { t.Fatal(err.Error()) } @@ -152,7 +152,7 @@ func TestDiscoverySecondPeerFirstNoResponse(t *testing.T) { // TODO(bp): etcd will take 30 seconds to shutdown, figure this // out instead - time.Sleep(35 * time.Second) + time.Sleep(1 * time.Second) client := http.Client{} _, err = client.Get("/")
feat(tests/discovery): use low retry interval In TestDiscoverySecondPeerFirstNoResponse use a low retryinterval so the test doesn't take forever.
etcd-io_etcd
train
go
0f9a4c797cb6b7477b68e51c618de8cc42bc6a56
diff --git a/mesh-plugin.js b/mesh-plugin.js index <HASH>..<HASH> 100644 --- a/mesh-plugin.js +++ b/mesh-plugin.js @@ -125,10 +125,6 @@ MesherPlugin.prototype.splitVoxelArray = function(voxels) { // compute the custom mesh now var blockMesh = this.meshCustomBlock(value,x,y,z); - z = voxels.position[0]*32 - y = voxels.position[1]*32 - x = voxels.position[2]*32 - blockMesh.position = [x,y,z]; this.porousMeshes.push(blockMesh); } else if (!isTransparent[value]) { solidVoxels.data[i] = value | (1<<15); // opaque bit
Remove .position on porous mesh, shader now uses modelMatrix
voxel_voxel-mesher
train
js
0d280c8a4e916a08b3e9a351d5039a0447e7d01c
diff --git a/src/renderer/map/Renderer.Map.Canvas.js b/src/renderer/map/Renderer.Map.Canvas.js index <HASH>..<HASH> 100644 --- a/src/renderer/map/Renderer.Map.Canvas.js +++ b/src/renderer/map/Renderer.Map.Canvas.js @@ -209,6 +209,7 @@ Z.renderer.map.Canvas = Z.renderer.map.Renderer.extend(/** @lends Z.renderer.map panels.mapMask.style.height = height + 'px'; panels.controlWrapper.style.width = width + 'px'; panels.controlWrapper.style.height = height + 'px'; + this._updateCanvasSize(); }, getPanel: function() {
resolve occasional canvas distorts when resizing.
maptalks_maptalks.js
train
js
4baa3b11eadc944dfb919afb66a0420f378c8121
diff --git a/generators/app/index.js b/generators/app/index.js index <HASH>..<HASH> 100644 --- a/generators/app/index.js +++ b/generators/app/index.js @@ -170,6 +170,10 @@ module.exports = class AppGenerator extends Generator { const type = provider === 'rest' ? 'express' : provider; this.dependencies.push(`@feathersjs/${type}`); + + if (provider === 'primus') { + this.dependencies.push('ws'); + } }); this._packagerInstall(this.dependencies, {
Adds 'ws' package if 'primus' is selected (#<I>)
feathersjs_generator-feathers
train
js
0d725106f664c89485b60aee42628accf6dcd2b6
diff --git a/src/Utils/Message.php b/src/Utils/Message.php index <HASH>..<HASH> 100644 --- a/src/Utils/Message.php +++ b/src/Utils/Message.php @@ -84,7 +84,7 @@ class Message * * @param mixed $message * - * @return \ArkEcosystem\Crypto\Message + * @return \ArkEcosystem\Crypto\Utils\Message */ public static function new($message): self {
fix: return type of the new method (#<I>)
ArkEcosystem_php-crypto
train
php
1e8d917f7a785aa8a87977efa2d63c4f41e42e10
diff --git a/Parsedown.php b/Parsedown.php index <HASH>..<HASH> 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -16,7 +16,7 @@ class Parsedown { # - # Synopsis + # Philosophy # # Markdown is intended to be easy-to-read by humans - those of us who read
replace synopsis with a more appropriate word
erusev_parsedown
train
php
57813fef6a6bb8c38747d4528df1aa92b5270f3e
diff --git a/packages/blueprint/lib/object.js b/packages/blueprint/lib/object.js index <HASH>..<HASH> 100644 --- a/packages/blueprint/lib/object.js +++ b/packages/blueprint/lib/object.js @@ -1,18 +1,19 @@ const CoreObject = require ('core-object'); +const objectPath = require ('object-path'); /** - * @class Object + * @class BlueprintObject * - * Base class for all Objects in the Blueprint framework. We use core-object instead + * Base class for all objects in the Blueprint framework. We use core-object instead * of native JavaScript classes available in ES6 because the class definition cannot * contain any data. This, however, does not prevent classes created from core-objects * from being extending by ES6 classes. */ -const Object = CoreObject.extend ({}); +module.exports = CoreObject.extend ({ + init () { + this._super.apply (this, arguments); + + CoreObject.mixin (this, objectPath); + } +}); -/** - * Base class for all objects in the Blueprint framework. - * - * @type {CoreObject} - */ -module.exports = Object;
Mixin objectPath to BlueprintObject
onehilltech_blueprint
train
js
5ff1964a264fb08cc4f77088728c69d989775daa
diff --git a/pycbc/psd/analytical.py b/pycbc/psd/analytical.py index <HASH>..<HASH> 100644 --- a/pycbc/psd/analytical.py +++ b/pycbc/psd/analytical.py @@ -19,6 +19,7 @@ from pycbc.types import FrequencySeries, zeros import lalsimulation +import numpy # build a list of usable PSD functions from lalsimulation _name_prefix = 'SimNoisePSD' @@ -68,8 +69,7 @@ def from_lalsimulation(func, length, delta_f, low_freq_cutoff): """ psd = FrequencySeries(zeros(length), delta_f=delta_f) kmin = int(low_freq_cutoff / delta_f) - for k in xrange(kmin, length): - psd[k] = func(k * delta_f) + psd.data[kmin:] = map(func, numpy.arange(length)[kmin:] * delta_f) return psd def from_string(psd_name, length, delta_f, low_freq_cutoff):
Bug <I>: patch to speed up analytic psd generation
gwastro_pycbc
train
py
995cd0f63d4adae2ed312878aaeb80912e0cdc1a
diff --git a/cobra/core/ArrayBasedModel.py b/cobra/core/ArrayBasedModel.py index <HASH>..<HASH> 100644 --- a/cobra/core/ArrayBasedModel.py +++ b/cobra/core/ArrayBasedModel.py @@ -380,8 +380,14 @@ class SMatrix_lil(lil_matrix): def update(self, value_dict): """update matrix without propagating to model""" - for index, value in value_dict.iteritems(): - lil_matrix.__setitem__(self, index, value) + if len(value_dict) < 100: # TODO benchmark for heuristic + for index, value in value_dict.iteritems(): + lil_matrix.__setitem__(self, index, value) + else: + matrix = lil_matrix.todok(self) + matrix.update(value_dict) + self = SMatrix_lil(matrix.tolil(), model=self._model) + self._model._S = self def todok(self): new = SMatrix_dok(lil_matrix.todok(self), model=self._model) @@ -392,6 +398,7 @@ class SMatrix_lil(lil_matrix): matrix = lil_matrix.todok(self) matrix.resize(shape) self = SMatrix_lil(matrix.tolil(), model=self._model) + self._model._S = self SMatrix_classes = {"scipy.dok_matrix": SMatrix_dok,
improve ArrayBasedModel (lil) creation Now only ~ 5% slower than master instead of ~ <I>%
opencobra_cobrapy
train
py
00698f08b795008a5c67bec6181cd7dcaa02eb39
diff --git a/projects/impl/src/main/java/org/jboss/forge/addon/projects/ui/NewProjectWizardImpl.java b/projects/impl/src/main/java/org/jboss/forge/addon/projects/ui/NewProjectWizardImpl.java index <HASH>..<HASH> 100644 --- a/projects/impl/src/main/java/org/jboss/forge/addon/projects/ui/NewProjectWizardImpl.java +++ b/projects/impl/src/main/java/org/jboss/forge/addon/projects/ui/NewProjectWizardImpl.java @@ -403,7 +403,10 @@ public class NewProjectWizardImpl implements UIWizard, NewProjectWizard .getServices(getClass().getClassLoader(), FacetFactory.class).get(); for (Class<? extends ProjectFacet> facet : requiredFacets) { - facetFactory.install(project, facet); + if (!project.hasFacet(facet)) + { + facetFactory.install(project, facet); + } } } }
FORGE-<I>: Project:New should not reinstall facets
forge_core
train
java
25d09606a1ad73cc343620122a7ce8b4315e8eeb
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -118,4 +118,27 @@ describe("s3", function () { }); }); }); + + it("deletes an object", function(done) { + var client = createClient(); + var params = { + Bucket: s3Bucket, + Delete: { + Objects: [ + { + Key: remoteFile, + }, + ], + }, + }; + var deleter = client.deleteObjects(params); + deleter.on('end', function() { + done(); + }); + }); + + it("uploads a folder"); + + it("downloads a folder"); + });
passing test for deleting an s3 object
andrewrk_node-s3-client
train
js
4ba6babb8f30fe4dac2b1d6ec6a2e1c7a05f28f2
diff --git a/plugins/update.js b/plugins/update.js index <HASH>..<HASH> 100644 --- a/plugins/update.js +++ b/plugins/update.js @@ -157,7 +157,7 @@ module.exports = Plugin.extend({ if (err) return cb(err); var code = JSON.parse(self.square.package.source) - , current = bundle.version + , current = bundle.version || self.version(bundle.meta.content) , source; code.bundle[key].version = version;
[minor] allow version to be parsed from content if it is not set in square.json
observing_square
train
js
6c4e8471cd282dea9c1ce4c47f5e00dfe37b8928
diff --git a/course/lib.php b/course/lib.php index <HASH>..<HASH> 100644 --- a/course/lib.php +++ b/course/lib.php @@ -434,9 +434,13 @@ function print_log_selector_form($course, $selecteduser=0, $selecteddate="today" } if ($showgroups) { - $cgroups = get_groups($course->id); - foreach ($cgroups as $cgroup) { - $groups[$cgroup->id] = $cgroup->name; + if ($cgroups = get_groups($course->id)) { + foreach ($cgroups as $cgroup) { + $groups[$cgroup->id] = $cgroup->name; + } + } + else { + $groups = array(); } choose_from_menu ($groups, "group", $selectedgroup, get_string("allgroups") ); }
Merged from MOODLE_<I>_STABLE: Fixing warning about invalid argument for foreach in course/lib.php in log selector form
moodle_moodle
train
php
be1d001cda968ba8ff149afb11b60fac1aeb1d83
diff --git a/lib/database_cleaner/sequel/transaction.rb b/lib/database_cleaner/sequel/transaction.rb index <HASH>..<HASH> 100644 --- a/lib/database_cleaner/sequel/transaction.rb +++ b/lib/database_cleaner/sequel/transaction.rb @@ -4,7 +4,18 @@ module DatabaseCleaner class Transaction include ::DatabaseCleaner::Sequel::Base + def self.check_fiber_brokenness + if !@checked_fiber_brokenness && Fiber.new { Thread.current }.resume != Thread.current + raise RuntimeError, "This ruby engine's Fibers are not compatible with Sequel's connection pool. " + + "To work around this, please use DatabaseCleaner.cleaning with a block instead of " + + "DatabaseCleaner.start and DatabaseCleaner.clean" + end + @checked_fiber_brokenness = true + end + def start + self.class.check_fiber_brokenness + @fibers||= [] db= self.db f= Fiber.new do
add check for fiber brokenness where fibers are used
DatabaseCleaner_database_cleaner
train
rb
edce39ff4b2e3717867b86fd0539f24d1f021314
diff --git a/lib/api/JsonSchemaLib/read.js b/lib/api/JsonSchemaLib/read.js index <HASH>..<HASH> 100644 --- a/lib/api/JsonSchemaLib/read.js +++ b/lib/api/JsonSchemaLib/read.js @@ -139,22 +139,16 @@ function readReferencedFiles (schema, callback) { // Have we finished reading everything? if (filesToRead.length === 0 && filesBeingRead.length === 0) { - return callbackOnce(null, schema); + return callback(null, schema); } - // Start reading any files that haven't been read yet - for (i = 0; i < filesToRead.length; i++) { + // In sync mode, just read the next file. + // In async mode, start reading all files in the queue + var numberOfFilesToRead = schema.config.sync ? 1 : filesToRead.length; + + for (i = 0; i < numberOfFilesToRead; i++) { file = filesToRead[i]; - safeCall(readFile, file, callbackOnce); + safeCall(readFile, file, callback); } - // Unlike `safeCall`, this ignores subsequent calls rather than throwing an error. - function callbackOnce (err, result) { - if (callbackCalled) { - return; - } - - callbackCalled = true; - callback(err, result); - } }
Fixed a bug that led to the same file being read multiple times in synchronous mode
JamesMessinger_json-schema-lib
train
js
0335f1dee52307d2d4b06bd6429e995d5857fd98
diff --git a/server/const.go b/server/const.go index <HASH>..<HASH> 100644 --- a/server/const.go +++ b/server/const.go @@ -40,7 +40,7 @@ var ( const ( // VERSION is the current version for the server. - VERSION = "2.1.3-RC02" + VERSION = "2.1.3-RC03" // PROTO is the currently supported protocol. // 0 was the original
Bump to version <I>-RC<I>
nats-io_gnatsd
train
go
4b6020a8772276b8538b6e022464c2e28ee49077
diff --git a/core/src/main/java/com/graphhopper/routing/weighting/custom/CustomWeighting.java b/core/src/main/java/com/graphhopper/routing/weighting/custom/CustomWeighting.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/graphhopper/routing/weighting/custom/CustomWeighting.java +++ b/core/src/main/java/com/graphhopper/routing/weighting/custom/CustomWeighting.java @@ -140,7 +140,8 @@ public final class CustomWeighting extends AbstractWeighting { @Override public long calcEdgeMillis(EdgeIteratorState edgeState, boolean reverse) { - return Math.round(calcSeconds(edgeState.getDistance(), edgeState, reverse) * 1000); + // we truncate to long here instead of rounding to make it consistent with FastestWeighting, maybe change to rounding later + return (long) (calcSeconds(edgeState.getDistance(), edgeState, reverse) * 1000); } @Override
Custom weighting calcEdgeMillis truncate instead of round * just for consistency and easier migration with/from FastestWeighting
graphhopper_graphhopper
train
java
474ac65ce83abe74487c042d049670bbeb16b316
diff --git a/lib/mongo_client.js b/lib/mongo_client.js index <HASH>..<HASH> 100644 --- a/lib/mongo_client.js +++ b/lib/mongo_client.js @@ -82,7 +82,12 @@ var validOptionNames = [ 'user', 'password', 'authMechanism', - 'compression' + 'compression', + 'fsync', + 'readPreferenceTags', + 'numberOfRetries', + 'autoReconnect', + 'auto_reconnect' ]; var ignoreOptionNames = ['native_parser']; @@ -610,13 +615,11 @@ function createServer(self, options, callback) { // Set default options var servers = translateOptions(options); - console.log(servers[0].s.clonedOptions); - console.log(servers[0].s.options); - // Propegate the events to the client var collectedEvents = collectEvents(self, servers[0]); + // Connect to topology - servers[0].connect(options, function(err, topology) { + servers[0].connect(function(err, topology) { if (err) return callback(err); // Clear out all the collected event listeners clearAllEvents(servers[0]);
fix(mongo-client): options should not be passed to `connect` Passing `options` to the `connect` object for parsed topologies in `createServer` effectively overrides the options that were originally passed into the client. NODE-<I>
mongodb_node-mongodb-native
train
js
00ac6d212e593c39658e6583d7837b202d6ca693
diff --git a/test/unit/resources/individual/users/user-test.js b/test/unit/resources/individual/users/user-test.js index <HASH>..<HASH> 100644 --- a/test/unit/resources/individual/users/user-test.js +++ b/test/unit/resources/individual/users/user-test.js @@ -3,7 +3,7 @@ import reactDom from 'react-dom/server'; import cheerio from 'cheerio'; import microformats from 'microformat-node'; -import {string, integer, url} from '@travi/any'; +import {string, word, integer, url} from '@travi/any'; import {assert} from 'chai'; import skinDeep from 'skin-deep'; @@ -13,10 +13,10 @@ const User = createUser(React); suite('user component test', () => { const user = { id: string(), - displayName: string(), + displayName: word(), name: { - first: string(), - last: string() + first: word(), + last: word() }, avatar: { src: url(),
generated names with `word` instead of `string` to prevent special character issues
travi-org_admin.travi.org-components
train
js
3f1a855b9b2626c18d704fffe3f14b720030bdea
diff --git a/hwt/code.py b/hwt/code.py index <HASH>..<HASH> 100644 --- a/hwt/code.py +++ b/hwt/code.py @@ -179,7 +179,9 @@ def SwitchLogic(cases, default=None): assigTop.Else(statements) hasElse = True else: - pass + raise HwtSyntaxError("Condition is not signal, it is not certain" + " if this is an error or desire ", cond) + if assigTop is None: if default is None:
SwitchLogic: add extra assert when using const as condition
Nic30_hwt
train
py
9d028d0014840f295c35e1edd85e049d561864a3
diff --git a/guava/src/com/google/common/collect/ImmutableTable.java b/guava/src/com/google/common/collect/ImmutableTable.java index <HASH>..<HASH> 100644 --- a/guava/src/com/google/common/collect/ImmutableTable.java +++ b/guava/src/com/google/common/collect/ImmutableTable.java @@ -18,6 +18,7 @@ package com.google.common.collect; import static com.google.common.base.Preconditions.checkNotNull; +import com.google.common.annotations.Beta; import com.google.common.annotations.GwtCompatible; import com.google.common.base.MoreObjects; import com.google.common.collect.Tables.AbstractCell; @@ -59,6 +60,7 @@ public abstract class ImmutableTable<R, C, V> extends AbstractTable<R, C, V> * * @since 21.0 */ + @Beta public static <T, R, C, V> Collector<T, ?, ImmutableTable<R, C, V>> toImmutableTable( Function<? super T, ? extends R> rowFunction, Function<? super T, ? extends C> columnFunction,
Add @Beta to the ImmutableTable collectors. ------------- Created by MOE: <URL>
google_guava
train
java
31e5a3501e87a5a0f27a9cc12b6ceea63a565af8
diff --git a/src/PhiremockExtension/Config.php b/src/PhiremockExtension/Config.php index <HASH>..<HASH> 100644 --- a/src/PhiremockExtension/Config.php +++ b/src/PhiremockExtension/Config.php @@ -208,7 +208,7 @@ class Config return; } - if ($config['start_delay']) { + if (is_int($config['start_delay']) && $config['start_delay'] >= 0) { $this->delay = (int) $config['start_delay']; } }
Fix inability to use zero delay (#<I>) The default config has start_delay as zero, which is skipped over by the if condition due to zero's falseness
mcustiel_phiremock-codeception-extension
train
php
6cd95245e676c705baceb9e6c7e975aba6372f79
diff --git a/Stagehand/FSM/State.php b/Stagehand/FSM/State.php index <HASH>..<HASH> 100644 --- a/Stagehand/FSM/State.php +++ b/Stagehand/FSM/State.php @@ -117,7 +117,7 @@ class Stagehand_FSM_State */ function &getEvent($event) { - if (!array_key_exists($event, $this->_events)) { + if (!$this->hasEvent($event)) { $return = null; return $return; }
- getEvent(): Refactored with hasEvent() method.
phpmentors-jp_stagehand-fsm
train
php
72fcf371bc42279676533142c82e34713e77ea75
diff --git a/lib/arm/instructions/logic_instruction.rb b/lib/arm/instructions/logic_instruction.rb index <HASH>..<HASH> 100644 --- a/lib/arm/instructions/logic_instruction.rb +++ b/lib/arm/instructions/logic_instruction.rb @@ -35,6 +35,10 @@ module Arm # do pc relative addressing with the difference to the instuction # 8 is for the funny pipeline adjustment (ie pointing to fetch and not execute) right = @left.position - self.position - 8 + if( (right < 0) && ((opcode == :add) || (opcode == :sub)) ) + right *= -1 # this works as we never issue sub only add + set_opcode :sub # so (as we can't change the sign permanently) we can change the opcode + end # and the sign even for sub (becuase we created them) raise "No negatives implemented #{self} #{right} " if right < 0 left = :pc end
one more hack couldn’t fix the problem in salaam, don’t know the position upon creation, only after assembly….
ruby-x_rubyx-arm
train
rb
2f4e045a298963fb832b484217b6869088bb0e75
diff --git a/scripts/run.py b/scripts/run.py index <HASH>..<HASH> 100755 --- a/scripts/run.py +++ b/scripts/run.py @@ -223,7 +223,7 @@ class H2OCloudNode: main_class = "water.H2OClientApp" else: main_class = "water.H2OApp" - if "JAVA_HOME" in os.environ: + if "JAVA_HOME" in os.environ and not sys.pqlatform == "win32": java = os.environ["JAVA_HOME"] + "/bin/java" else: java = "java"
just use java when platform is windows
h2oai_h2o-3
train
py
97483e416abb04e40cf31076246863f4bc1e3804
diff --git a/master/buildbot/process/workerforbuilder.py b/master/buildbot/process/workerforbuilder.py index <HASH>..<HASH> 100644 --- a/master/buildbot/process/workerforbuilder.py +++ b/master/buildbot/process/workerforbuilder.py @@ -228,7 +228,6 @@ class LatentWorkerForBuilder(AbstractWorkerForBuilder): return defer.succeed(False) self.state = States.DETACHED - log.msg("substantiating worker %s" % (self,)) d = self.substantiate(build) return d diff --git a/master/buildbot/worker/latent.py b/master/buildbot/worker/latent.py index <HASH>..<HASH> 100644 --- a/master/buildbot/worker/latent.py +++ b/master/buildbot/worker/latent.py @@ -98,6 +98,8 @@ class AbstractLatentWorker(AbstractWorker): return self.conn is not None def substantiate(self, wfb, build): + log.msg("substantiating worker %s" % (wfb,)) + if self.conn is not None: self._clearBuildWaitTimer() self._setBuildWaitTimer() @@ -241,6 +243,8 @@ class AbstractLatentWorker(AbstractWorker): @defer.inlineCallbacks def insubstantiate(self, fast=False): + log.msg("insubstantiating worker %s" % (self,)) + self.insubstantiating = True self._clearBuildWaitTimer() d = self.stop_instance(fast)
latent: Move log messages to consistent place
buildbot_buildbot
train
py,py
522ad13720f73415d01033856eb8f3ea11986014
diff --git a/test/test_topology.py b/test/test_topology.py index <HASH>..<HASH> 100644 --- a/test/test_topology.py +++ b/test/test_topology.py @@ -253,7 +253,7 @@ class TestSingleServerTopology(TopologyTest): available = False t.request_check_all() with self.assertRaises(ConnectionFailure): - t.select_server(writable_server_selector, server_wait_time=0.1) + t.select_server(writable_server_selector, server_wait_time=1) # The server is temporarily down. self.assertIsNone(s.description.round_trip_time) @@ -261,10 +261,13 @@ class TestSingleServerTopology(TopologyTest): # Bring it back, RTT is now 30 milliseconds. available = True round_trip_time = 20 - t.request_check_all() - # We didn't forget prior average: .8 * 105 + .2 * 20 = 88. - self.assertAlmostEqual(88, s.description.round_trip_time) + def test(): + t.request_check_all() + # We didn't forget prior average: .8 * 105 + .2 * 20 = 88. + return round(abs(88 - s.description.round_trip_time), 7) == 0 + + wait_until(test, 'calculate correct new average') class TestMultiServerTopology(TopologyTest):
More reliable test_round_trip_time.
mongodb_mongo-python-driver
train
py
b70ec495e9f460e14f0d994897e40aef1e43d042
diff --git a/lib/webcomment.py b/lib/webcomment.py index <HASH>..<HASH> 100644 --- a/lib/webcomment.py +++ b/lib/webcomment.py @@ -25,6 +25,7 @@ __revision__ = "$Id$" import time import math import os +import cgi from datetime import datetime, timedelta # Invenio imports: @@ -1558,7 +1559,10 @@ def notify_admin_of_new_comment(comID): Title = %s''' % (star_score, title) washer = EmailWasher() - body = washer.wash(body) + try: + body = washer.wash(body) + except: + body = cgi.escape(body) record_info = webcomment_templates.tmpl_email_new_comment_admin(id_bibrec) out = '''
WebComment: fix washing of email to admin * Some invalid markup can still be entered in comments, leading to possible failure of the washing of the email to the admin. In these cases, simply cgi.escape() the content.
inveniosoftware-attic_invenio-comments
train
py
b3490f420e039e17ede5307a454f85ccfc69f56b
diff --git a/test/main.js b/test/main.js index <HASH>..<HASH> 100644 --- a/test/main.js +++ b/test/main.js @@ -2,10 +2,6 @@ import '../filter-widget/filter-widget.test'; import '../list-table/list-table.test'; import '../property-table/property-table.test'; -import '../data-admin/components/paginate-footer/paginate-footer.test'; -import '../data-admin/components/search-control/search-control.test'; -import '../data-admin/components/manage-toolbar/manage-toolbar.test'; -import '../data-admin/ViewMap.test'; import '../util/string/string.test'; import '../util/field/field.test'; import '../paginate-widget/paginate-widget.test';
FIX: removes other data-admin component test
roemhildtg_spectre-canjs
train
js
fbf0c06e845b585f6ee3bfe5a7470772ab7d86d3
diff --git a/scour/scour.py b/scour/scour.py index <HASH>..<HASH> 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -2109,7 +2109,7 @@ def removeDefaultAttributeValue(node, attribute): """ Removes the DefaultAttribute 'attribute' from 'node' if specified conditions are fulfilled - Warning: Does NOT check if the attribute is actually valid for the passed element type for increased preformance! + Warning: Does NOT check if the attribute is actually valid for the passed element type for increased performance! """ if not node.hasAttribute(attribute.name): return 0 @@ -2134,7 +2134,7 @@ def removeDefaultAttributeValue(node, attribute): return 0 -def removeDefaultAttributeValues(node, options, tainted=set()): +def removeDefaultAttributeValues(node, options, tainted=None): u"""'tainted' keeps a set of attributes defined in parent nodes. For such attributes, we don't delete attributes with default values.""" @@ -2142,6 +2142,9 @@ def removeDefaultAttributeValues(node, options, tainted=set()): if node.nodeType != Node.ELEMENT_NODE: return 0 + if tainted is None: + tainted = set() + # Conditionally remove all default attributes defined in 'default_attributes' (a list of 'DefaultAttribute's) # # For increased performance do not iterate the whole list for each element but run only on valid subsets
Avoid mutating a mutable kwarg
scour-project_scour
train
py
497b7169f63b14581590a00344a8a7b80da477f6
diff --git a/gpiozero/input_devices.py b/gpiozero/input_devices.py index <HASH>..<HASH> 100644 --- a/gpiozero/input_devices.py +++ b/gpiozero/input_devices.py @@ -825,7 +825,7 @@ class DistanceSensor(SmoothedInputDevice): :param int queue_len: The length of the queue used to store values read from the sensor. - This defaults to 30. + This defaults to 9. :param float max_distance: The :attr:`value` attribute reports a normalized value between 0 (too
Correct docstring for DistanceSensor's queue_len, close #<I>
RPi-Distro_python-gpiozero
train
py
467cebb0a120e11be1e58b1e6adc5fe3be6654cd
diff --git a/course/edit_form.php b/course/edit_form.php index <HASH>..<HASH> 100644 --- a/course/edit_form.php +++ b/course/edit_form.php @@ -256,9 +256,9 @@ class course_edit_form extends moodleform { $mform->addElement('header','', get_string('groups', 'group')); $choices = array(); - $choices[NOGROUPS] = get_string('no'); - $choices[SEPARATEGROUPS] = get_string('separate'); - $choices[VISIBLEGROUPS] = get_string('visible'); + $choices[NOGROUPS] = get_string('groupsnone', 'group'); + $choices[SEPARATEGROUPS] = get_string('groupsseparate', 'group'); + $choices[VISIBLEGROUPS] = get_string('groupsvisible', 'group'); $mform->addElement('select', 'groupmode', get_string('groupmode'), $choices); $mform->setHelpButton('groupmode', array('groupmode', get_string('groupmode')), true); $mform->setDefault('groupmode', 0);
MDL-<I> - Use existing group setting strings on course edit form so can be better translated. Patch from Daniel Miksik merged from MOODLE_<I>_STABLE
moodle_moodle
train
php
1081c5315dd8cf9262af5753a2a1b02df97a4a8f
diff --git a/lib/wavefile/writer.rb b/lib/wavefile/writer.rb index <HASH>..<HASH> 100644 --- a/lib/wavefile/writer.rb +++ b/lib/wavefile/writer.rb @@ -30,6 +30,7 @@ module WaveFile # # If no block is given, then sample data can be written until the close method is called. def initialize(file_name, format) + @file_name = file_name @file = File.open(file_name, "wb") @format = format diff --git a/test/writer_test.rb b/test/writer_test.rb index <HASH>..<HASH> 100644 --- a/test/writer_test.rb +++ b/test/writer_test.rb @@ -78,7 +78,17 @@ class WriterTest < Test::Unit::TestCase assert_equal(read_file(:expected, file_name), read_file(:actual, file_name)) end - + + def test_file_name + file_name = "#{OUTPUT_FOLDER}/example.wav" + + writer = Writer.new(file_name, Format.new(1, 8, 44100)) + assert_equal("#{OUTPUT_FOLDER}/example.wav", writer.file_name) + + writer.close + assert_equal("#{OUTPUT_FOLDER}/example.wav", writer.file_name) + end + def test_closed? writer = Writer.new("#{OUTPUT_FOLDER}/closed_test.wav", Format.new(1, 16, 44100)) assert_equal(false, writer.closed?)
Fixing @file_name attribute to actually be set on Writer. Fixes #3 Previously, it would always return nil.
jstrait_wavefile
train
rb,rb
5dc317b69ca2b04b2cbcc4906e2300a9b835ed84
diff --git a/acceptance/ui/features/steps/hosts_steps.rb b/acceptance/ui/features/steps/hosts_steps.rb index <HASH>..<HASH> 100644 --- a/acceptance/ui/features/steps/hosts_steps.rb +++ b/acceptance/ui/features/steps/hosts_steps.rb @@ -20,7 +20,14 @@ end def visitHostsPage() @hosts_page = Hosts.new - @hosts_page.load + # + # FIXME: For some reason the following load fails on Chrome for this page, + # even though the same syntax works on FF + # @hosts_page.load + # expect(@hosts_page).to be_displayed + within(".navbar-collapse") do + click_link("Hosts") + end expect(@hosts_page).to be_displayed end
Navigate to Hosts via the navbar rather than the URL
control-center_serviced
train
rb
b21e810a4ae62d20bb9d3c77d441a513dda946cf
diff --git a/lib/addressable/uri.rb b/lib/addressable/uri.rb index <HASH>..<HASH> 100644 --- a/lib/addressable/uri.rb +++ b/lib/addressable/uri.rb @@ -719,6 +719,7 @@ module Addressable self.authority = options[:authority] if options[:authority] self.path = options[:path] if options[:path] self.query = options[:query] if options[:query] + self.query_values = options[:query_values] if options[:query_values] self.fragment = options[:fragment] if options[:fragment] end end
query_values set as part of initialization
sporkmonger_addressable
train
rb
885f04b38e6ec109dacccc6f4ec36825f3254c8b
diff --git a/ella/newman/media/js/kobayashi.js b/ella/newman/media/js/kobayashi.js index <HASH>..<HASH> 100644 --- a/ella/newman/media/js/kobayashi.js +++ b/ella/newman/media/js/kobayashi.js @@ -1,4 +1,4 @@ -KOBAYASHI_VERSION = '2009-07-20'; +KOBAYASHI_VERSION = '2009-08-13'; // Debugging tools ;;; function alert_dump(obj, name) { @@ -636,6 +636,9 @@ ContentByHashLib.LOADED_MEDIA = {}; // - just_get: 'hash' Instructs the function to return the modified hash instead of applying it to location. // Using this option disables the support of multiple '#'-separated specifiers. // Other than the first one are ignored. +// - just_set: Instructs the function to change the URL without triggering the hashchange event. +// - nohistory: When true, the change of the location will not create a record in the browser history +// (location.replace will be used). // - _hash_preproc: Internal. Set when adr is used to preprocess the hash // to compensate for hash and LOADED_URLS inconsistencies. function adr(address, options) {
Updated version info and adr()'s comments
ella_ella
train
js
4003da0fddb46e4e880b42ce4801576c7d31f032
diff --git a/db.go b/db.go index <HASH>..<HASH> 100644 --- a/db.go +++ b/db.go @@ -877,7 +877,7 @@ func (db *DB) openHeadBlock(dir string) (*HeadBlock, error) { ) wal, err := OpenSegmentWAL(wdir, l, 5*time.Second) if err != nil { - return nil, errors.Wrap(err, "open WAL %s") + return nil, errors.Wrapf(err, "open WAL %s", dir) } h, err := OpenHeadBlock(dir, log.With(db.logger, "block", dir), wal, db.compactor)
Log the directory when the WAL cannot be opened Fixes #<I>
prometheus_prometheus
train
go
328a16117380b22f27d8e60cf6715e926c08e60b
diff --git a/cloudkey.py b/cloudkey.py index <HASH>..<HASH> 100644 --- a/cloudkey.py +++ b/cloudkey.py @@ -155,7 +155,7 @@ class File(Api): result = self.upload() c = pycurl.Curl() - c.setopt(pycurl.URL, result['url']) + c.setopt(pycurl.URL, str(result['url'])) c.setopt(pycurl.FOLLOWLOCATION, True) c.setopt(pycurl.HTTPPOST, [('file', (pycurl.FORM_FILE, file))])
pycurl needs str as pycurl.URL
dailymotion_cloudkey-py
train
py
75b65eac68f7e74ecf5ab7827403c6c301798b7e
diff --git a/djsupervisor/config.py b/djsupervisor/config.py index <HASH>..<HASH> 100644 --- a/djsupervisor/config.py +++ b/djsupervisor/config.py @@ -278,6 +278,13 @@ exclude=true ; All programs are auto-reloaded by default. [program:__defaults__] autoreload=true +redirect_stderr=true + +[supervisord] +{% if settings.DEBUG %} +loglevel=debug +{% endif %} + """
make supervisord print logging into in debug mode
rfk_django-supervisor
train
py
0a003f621d9aa4b01f0e11361c1d4d8421d6f999
diff --git a/src/Traits/HasPermissions.php b/src/Traits/HasPermissions.php index <HASH>..<HASH> 100644 --- a/src/Traits/HasPermissions.php +++ b/src/Traits/HasPermissions.php @@ -73,6 +73,10 @@ trait HasPermissions */ protected function getStoredPermission($permissions) { + if (is_numeric($permissions)) { + return app(Permission::class)->findById($permissions, $this->getDefaultGuardName()); + } + if (is_string($permissions)) { return app(Permission::class)->findByName($permissions, $this->getDefaultGuardName()); }
Allow get stored permission by id
spatie_laravel-permission
train
php
afd3191038ef1501be4a1a4350da46914e14186e
diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index <HASH>..<HASH> 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -25,11 +25,6 @@ except NotImplementedError: PROJECT_DIR_PATH = os.path.realpath(os.path.curdir) -def remove_file(file_path): - if os.path.exists(file_path): - os.remove(file_path) - - def remove_open_source_project_only_files(): file_names = [ 'CONTRIBUTORS.txt', @@ -75,11 +70,11 @@ def remove_heroku_files(): 'requirements.txt', ] for file_name in file_names: - remove_file(os.path.join(PROJECT_DIR_PATH, file_name)) + os.remove(os.path.join(PROJECT_DIR_PATH, file_name)) def remove_dotenv_file(): - remove_file(os.path.join(PROJECT_DIR_PATH, '.env')) + os.remove(os.path.join(PROJECT_DIR_PATH, '.env')) def remove_grunt_files():
Get rid of remove_file() from post hook
pydanny_cookiecutter-django
train
py
eccea7411f9793464ace8636c2a8a1cd39a90bc4
diff --git a/src/interactive-auth.js b/src/interactive-auth.js index <HASH>..<HASH> 100644 --- a/src/interactive-auth.js +++ b/src/interactive-auth.js @@ -293,7 +293,9 @@ InteractiveAuth.prototype = { }, ); if (!background) { - prom = prom.catch(this._completionDeferred.reject); + prom = prom.catch((e) => { + this._completionDeferred.reject(e); + }); } else { // We ignore all failures here (even non-UI auth related ones) // since we don't want to suddenly fail if the internet connection
Fix error handling in interactive-auth Now that we are using bluebird, `defer.reject` is not implicitly bound, so we need to call it properly rather than just passing it into the catch handler. This fixes an error: promise.js:<I> Uncaught TypeError: Cannot read property 'promise' of undefined
matrix-org_matrix-js-sdk
train
js
8db7fd7239aa2973b4816fe4a2e7a1180fdf9c29
diff --git a/UI/src/components/widgets/codeanalysis/view.js b/UI/src/components/widgets/codeanalysis/view.js index <HASH>..<HASH> 100644 --- a/UI/src/components/widgets/codeanalysis/view.js +++ b/UI/src/components/widgets/codeanalysis/view.js @@ -293,7 +293,7 @@ } ctrl.getDashStatus = function getDashStatus() { - + if(ctrl.librarySecurityThreatStatus == undefined) return 'ignore'; switch (ctrl.librarySecurityThreatStatus.level) { case 4: return 'critical';
Fix for the ulimited amount of console errors when there is no open source data
Hygieia_Hygieia
train
js
be427db8e5dcc1302c7475e1ee1f058a2ddf8cb3
diff --git a/src/PHPMailer.php b/src/PHPMailer.php index <HASH>..<HASH> 100644 --- a/src/PHPMailer.php +++ b/src/PHPMailer.php @@ -1721,9 +1721,10 @@ class PHPMailer fwrite($mail, $header); fwrite($mail, $body); $result = pclose($mail); + $addrinfo = static::parseAddresses($toAddr); $this->doCallback( ($result === 0), - [$toAddr], + [[$addrinfo['address'], $addrinfo['name']]], $this->cc, $this->bcc, $this->Subject, @@ -1876,7 +1877,17 @@ class PHPMailer if ($this->SingleTo && count($toArr) > 1) { foreach ($toArr as $toAddr) { $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params); - $this->doCallback($result, [$toAddr], $this->cc, $this->bcc, $this->Subject, $body, $this->From, []); + $addrinfo = static::parseAddresses($toAddr); + $this->doCallback( + $result, + [[$addrinfo['address'], $addrinfo['name']]], + $this->cc, + $this->bcc, + $this->Subject, + $body, + $this->From, + [] + ); } } else { $result = $this->mailPassthru($to, $this->Subject, $body, $header, $params);
Make use of $to in doCallback consistent
PHPMailer_PHPMailer
train
php
42c95dc9a38f607a75d5d9fe7df3c8efdf965bc2
diff --git a/src/viz.js b/src/viz.js index <HASH>..<HASH> 100644 --- a/src/viz.js +++ b/src/viz.js @@ -112,6 +112,12 @@ d3plus.viz = function() { vars.g.titles.enter().append("g") .attr("id","titles") + // Enter Timeline Group + vars.g.timeline = vars.svg.selectAll("g#timeline").data(["timeline"]) + vars.g.timeline.enter().append("g") + .attr("id","timeline") + .attr("transform","translate(0,"+vars.height.default+")") + // Enter Key Group vars.g.key = vars.svg.selectAll("g#key").data(["key"]) vars.g.key.enter().append("g") @@ -175,6 +181,7 @@ d3plus.viz = function() { vars.app_width = vars.width.default; d3plus.ui.titles(vars); d3plus.ui.key(vars); + d3plus.ui.timeline(vars); vars.app_height = vars.height.default - vars.margin.top - vars.margin.bottom; vars.graph.height = vars.app_height-vars.graph.margin.top-vars.graph.margin.bottom;
created timeline group and add call to timeline function
alexandersimoes_d3plus
train
js
e01b20d2960f5d81f30067a7bd69b685b6860a63
diff --git a/main.go b/main.go index <HASH>..<HASH> 100644 --- a/main.go +++ b/main.go @@ -17,7 +17,7 @@ var ( debug = kingpin.Flag("debug", "Enable debug mode. This disables forwarding to syslog").Bool() uaaEndpoint = kingpin.Flag("uaa-endpoint", "UAA endpoint.").Required().String() dopplerEndpoint = kingpin.Flag("doppler-endpoint", "UAA endpoint.").Required().String() - syslogServer = kingpin.Flag("syslog-server", "Syslog server.").Required().String() + syslogServer = kingpin.Flag("syslog-server", "Syslog server.").String() subscriptionId = kingpin.Flag("subscription-id", "Id for the subscription.").Default("firehose").String() firehoseUser = kingpin.Flag("firehose-user", "User with firehose permissions.").Default("doppler").String() firehosePassword = kingpin.Flag("firehose-password", "Password for firehose user.").Default("doppler").String()
Dont make syslog connection a requirement.
cloudfoundry-community_firehose-to-syslog
train
go
cd5df271e5d0c8245adf458b440bf0a4eaef2045
diff --git a/eth_utils/encoding.py b/eth_utils/encoding.py index <HASH>..<HASH> 100644 --- a/eth_utils/encoding.py +++ b/eth_utils/encoding.py @@ -1,10 +1,6 @@ -import math - - def int_to_big_endian(value): - byte_length = max(math.ceil(value.bit_length() / 8), 1) - return value.to_bytes(byte_length, byteorder='big') + return value.to_bytes((value.bit_length() + 7) // 8 or 1, 'big') def big_endian_to_int(value): - return int.from_bytes(value, byteorder='big') + return int.from_bytes(value, 'big')
Faster int_to_big_endian implementation
ethereum_eth-utils
train
py
c76c6f9d2a3f98f32c2b791078559bdea59287ab
diff --git a/tests/test_view.py b/tests/test_view.py index <HASH>..<HASH> 100644 --- a/tests/test_view.py +++ b/tests/test_view.py @@ -58,6 +58,36 @@ class ViewTestCase(unittest.TestCase): actual = view.load_template("partial") self.assertEquals(actual, "Loaded from dictionary") + def test_template_path(self): + """ + Test that View.template_path is respected. + + """ + class Tagless(View): + pass + + view = Tagless() + self.assertRaises(IOError, view.render) + + view = Tagless() + view.template_path = "examples" + self.assertEquals(view.render(), "No tags...") + + def test_template_path_for_partials(self): + """ + Test that View.template_path is respected for partials. + + """ + class TestView(View): + template = "Partial: {{>tagless}}" + + view = TestView() + self.assertRaises(IOError, view.render) + + view = TestView() + view.template_path = "examples" + self.assertEquals(view.render(), "Partial: No tags...") + def test_template_load_from_multiple_path(self): path = Simple.template_path Simple.template_path = ('examples/nowhere','examples',)
Added test cases to check that View.template_path is respected.
defunkt_pystache
train
py
b1e44a850b8fc75fcfd818bf710d45f9e24789ff
diff --git a/src/pyctools/tools/editor.py b/src/pyctools/tools/editor.py index <HASH>..<HASH> 100644 --- a/src/pyctools/tools/editor.py +++ b/src/pyctools/tools/editor.py @@ -410,7 +410,7 @@ class OutputIcon(IOIcon): py_class = re.compile(':py:class:`(~[\w\.]*\.)?(.*?)`') -py_mod = re.compile(':py:mod:`\.*(\w*)(\W*<[\w\.]*>)?`') +py_mod = re.compile(':py:mod:`\.*(\S*)(\s*<[\w\.]*>)?`') py_other = re.compile(':py:(data|meth|obj):`(.*?)`') def strip_sphinx_domains(text): @@ -874,7 +874,10 @@ class NetworkArea(QtWidgets.QGraphicsScene): local_vars = {} with open(file_name) as f: code = compile(f.read(), file_name, 'exec') - exec(code, global_vars, local_vars) + try: + exec(code, global_vars, local_vars) + except ImportError as ex: + logger.error(str(ex)) if 'Network' not in local_vars: # not a recognised script logger.error('Script not recognised')
Don't crash loading script with missing components
jim-easterbrook_pyctools
train
py
7a257f325dfd48c2ecb3a536b4bfcb361519d520
diff --git a/pages/lib/refinery/pages/instance_methods.rb b/pages/lib/refinery/pages/instance_methods.rb index <HASH>..<HASH> 100644 --- a/pages/lib/refinery/pages/instance_methods.rb +++ b/pages/lib/refinery/pages/instance_methods.rb @@ -10,7 +10,7 @@ module Refinery def error_404(exception=nil) if (@page = ::Refinery::Page.where(:menu_match => "^/404$").includes(:parts).first).present? # render the application's custom 404 page with layout and meta. - render :template => '/refinery/pages/show', :formats => [:html], :status => 404 + render_with_templates?(:status => 404) return false else super
Allow <I> page to have custom view/layout templates.
refinery_refinerycms
train
rb
d302a7b866fa1d0268bc86520fbea718d49772cc
diff --git a/js/assessments/keywordDensityAssessment.js b/js/assessments/keywordDensityAssessment.js index <HASH>..<HASH> 100644 --- a/js/assessments/keywordDensityAssessment.js +++ b/js/assessments/keywordDensityAssessment.js @@ -26,8 +26,7 @@ var calculateKeywordDensityResult = function( keywordDensity, i18n, keywordCount " which is way over the advised %3$s maximum;" + " the focus keyword was found %2$d times." ); - /* Translators: This is the maximum keyword density, localize the number for your language (e.g. 2,5) */ - max = i18n.dgettext( "js-text-analysis", "2.5" ) + "%"; + max = "2.5%"; text = i18n.sprintf( text, keywordDensityPercentage, keywordCount, max ); } @@ -41,8 +40,7 @@ var calculateKeywordDensityResult = function( keywordDensity, i18n, keywordCount " which is over the advised %3$s maximum;" + " the focus keyword was found %2$d times." ); - /* Translators: This is the maximum keyword density, localize the number for your language (e.g. 2,5) */ - max = i18n.dgettext( "js-text-analysis", "2.5" ) + "%"; + max = "2.5%"; text = i18n.sprintf( text, keywordDensityPercentage, keywordCount, max ); }
Remove translatable number It's a bad idea
Yoast_YoastSEO.js
train
js
992828d911513b532daa737582720d80efbb7635
diff --git a/src/com/google/javascript/jscomp/Linter.java b/src/com/google/javascript/jscomp/Linter.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/Linter.java +++ b/src/com/google/javascript/jscomp/Linter.java @@ -42,7 +42,8 @@ public class Linter { SourceFile file = SourceFile.fromFile(path.toString()); Compiler compiler = new Compiler(); CompilerOptions options = new CompilerOptions(); - options.setLanguageIn(LanguageMode.ECMASCRIPT6); + options.setLanguageIn(LanguageMode.ECMASCRIPT6_STRICT); + options.setLanguageIn(LanguageMode.ECMASCRIPT5); options.setCodingConvention(new GoogleCodingConvention()); options.setWarningLevel(DiagnosticGroups.MISSING_REQUIRE, CheckLevel.WARNING); options.setWarningLevel(DiagnosticGroups.EXTRA_REQUIRE, CheckLevel.WARNING);
Fix the language-out so that the linter will actually run. ------------- Created by MOE: <URL>
google_closure-compiler
train
java
e9618b0d078c6eb4b174c0f614970d13417cb116
diff --git a/packer/plugin/builder.go b/packer/plugin/builder.go index <HASH>..<HASH> 100644 --- a/packer/plugin/builder.go +++ b/packer/plugin/builder.go @@ -22,13 +22,13 @@ func (b *cmdBuilder) Prepare(config interface{}) error { return b.builder.Prepare(config) } -func (b *cmdBuilder) Run(ui packer.Ui, hook packer.Hook) { +func (b *cmdBuilder) Run(ui packer.Ui, hook packer.Hook) packer.Artifact { defer func() { r := recover() b.checkExit(r, nil) }() - b.builder.Run(ui, hook) + return b.builder.Run(ui, hook) } func (c *cmdBuilder) checkExit(p interface{}, cb func()) { diff --git a/packer/plugin/builder_test.go b/packer/plugin/builder_test.go index <HASH>..<HASH> 100644 --- a/packer/plugin/builder_test.go +++ b/packer/plugin/builder_test.go @@ -13,7 +13,9 @@ func (helperBuilder) Prepare(interface{}) error { return nil } -func (helperBuilder) Run(packer.Ui, packer.Hook) {} +func (helperBuilder) Run(packer.Ui, packer.Hook) packer.Artifact { + return nil +} func TestBuilder_NoExist(t *testing.T) { assert := asserts.NewTestingAsserts(t, true)
packer/plugin: Properly supports Artifacts
hashicorp_packer
train
go,go
dabf201f5aa7e416f70c9cf037e69ae3aded8ad3
diff --git a/lib/active_remote/base.rb b/lib/active_remote/base.rb index <HASH>..<HASH> 100644 --- a/lib/active_remote/base.rb +++ b/lib/active_remote/base.rb @@ -1,3 +1,4 @@ +require 'active_remote/bulk' require 'active_remote/dsl' require 'active_remote/persistence' require 'active_remote/rpc' @@ -9,6 +10,7 @@ module ActiveRemote extend ::ActiveModel::Callbacks include ::ActiveModel::Serializers::JSON + include ::ActiveRemote::Bulk include ::ActiveRemote::DSL include ::ActiveRemote::Persistence include ::ActiveRemote::RPC
How about we load up the bulk stuff!
liveh2o_active_remote
train
rb
aa85ea9947bde2342cd006427da653319ee39192
diff --git a/codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttProperties.java b/codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttProperties.java index <HASH>..<HASH> 100644 --- a/codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttProperties.java +++ b/codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttProperties.java @@ -109,6 +109,11 @@ public final class MqttProperties { return properties; } + /** + * MQTT property base class + * + * @param <T> property type + */ public abstract static class MqttProperty<T> { final T value; final int propertyId; @@ -117,6 +122,23 @@ public final class MqttProperties { this.propertyId = propertyId; this.value = value; } + + /** + * Get MQTT property value + * + * @return property value + */ + public T value() { + return value; + } + + /** + * Get MQTT property ID + * @return property ID + */ + public int propertyId() { + return propertyId; + } } public static final class IntegerProperty extends MqttProperty<Integer> {
Make MQTT property value publicly accessible (#<I>) Motivation: There was no way to read MQTT properties outside of `io.netty.handler.codec.mqtt` package Modification: Expose `MqttProperties.MqttProperty` fields `value` and `propertyId` via public methods Result: It's possible to read MQTT properties now
netty_netty
train
java
7a60429e3c7344cfc985b682e3dc6e2d8dbcd5d7
diff --git a/telemetry/telemetry/internal/util/binary_manager.py b/telemetry/telemetry/internal/util/binary_manager.py index <HASH>..<HASH> 100644 --- a/telemetry/telemetry/internal/util/binary_manager.py +++ b/telemetry/telemetry/internal/util/binary_manager.py @@ -195,7 +195,7 @@ def FetchBinaryDependencies( except dependency_manager.NoPathFoundError as e: logging.error('Error when trying to prefetch paths for %s: %s', - target_platform, e.message) + target_platform, e) if fetch_devil_deps: devil_env.config.Initialize()
Minor Python 3 fix Makes one minor fix for Python 3 compatibility found while converting some GPU code, as exceptions no longer have a message attribute. Bug: chromium:<I> Change-Id: I6dcadb0c<I>b<I>d4a8e<I>c Reviewed-on: <URL>
catapult-project_catapult
train
py
475b0e9b66d726cff3d79163024067c5133ce229
diff --git a/molgenis-core-ui/src/main/java/org/molgenis/ui/MolgenisMenuController.java b/molgenis-core-ui/src/main/java/org/molgenis/ui/MolgenisMenuController.java index <HASH>..<HASH> 100644 --- a/molgenis-core-ui/src/main/java/org/molgenis/ui/MolgenisMenuController.java +++ b/molgenis-core-ui/src/main/java/org/molgenis/ui/MolgenisMenuController.java @@ -54,7 +54,11 @@ public class MolgenisMenuController model.addAttribute(KEY_MENU_ID, menuId); MolgenisUiMenuItem activeItem = menu.getActiveItem(); - if (activeItem == null) logger.warn("main menu does not contain any (accessible) items"); + if (activeItem == null) + { + logger.warn("main menu does not contain any (accessible) items"); + return "forward:/login"; + } String pluginId = activeItem != null ? activeItem.getId() : VoidPluginController.ID; String contextUri = new StringBuilder(URI).append('/').append(menuId).append('/').append(pluginId).toString();
show login when access to all plugins is denied
molgenis_molgenis
train
java
5cd69496dcc11055cc1e05153f3f4961f585e7ac
diff --git a/spinoff/actor/cell.py b/spinoff/actor/cell.py index <HASH>..<HASH> 100644 --- a/spinoff/actor/cell.py +++ b/spinoff/actor/cell.py @@ -496,7 +496,7 @@ class Cell(_BaseCell): # TODO: inherit from Greenlet? if not silent: other << ('_unwatched', self.ref) if not other.is_local: - self.node.unwatch_node(other.uri.node, report_to=self.ref) + self.node.unwatch_node(other.uri.node, self.ref) def _watched(self, other): if not self.watchers:
Pass watcher ref to unwatch_node as a positional arg
eallik_spinoff
train
py
e09a46097f2fe254191f5fa3d8734836ff5519a6
diff --git a/cmd2.py b/cmd2.py index <HASH>..<HASH> 100755 --- a/cmd2.py +++ b/cmd2.py @@ -350,8 +350,8 @@ def path_complete(text, line, begidx, endidx, dir_exe_only=False, dir_only=False # Build the search string search_str = os.path.join(dirname, text + '*') - # Expand "~" to the real user directory - search_str = os.path.expanduser(search_str) + # Expand "~" to the real user directory + search_str = os.path.expanduser(search_str) # Find all matching path completions path_completions = glob.glob(search_str)
~ only needs to be expanded if search text was entered
python-cmd2_cmd2
train
py
38cc8ae2b378413a385156cc6a7cf07cfffced85
diff --git a/webpack.config.js b/webpack.config.js index <HASH>..<HASH> 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -249,6 +249,10 @@ if ( calypsoEnv === 'desktop' ) { // NOTE: order matters. vendor must be before manifest. webpackConfig.plugins = webpackConfig.plugins.concat( [ new webpack.optimize.CommonsChunkPlugin( { name: 'vendor', minChunks: Infinity } ), + new webpack.optimize.CommonsChunkPlugin( { + async: 'tinymce', + minChunks: ( { resource } ) => resource && /node_modules[\/\\]tinymce/.test( resource ), + } ), new webpack.optimize.CommonsChunkPlugin( { name: 'manifest' } ), ] );
Split "node_modules/tinymce/*" into its own chunk.
Automattic_wp-calypso
train
js
d60086203a11bba1c355558abecfa0945986a206
diff --git a/mbuild/trajectory.py b/mbuild/trajectory.py index <HASH>..<HASH> 100755 --- a/mbuild/trajectory.py +++ b/mbuild/trajectory.py @@ -1,3 +1,8 @@ +from mbuild.formats.gromacs import save_gromacs +from mbuild.formats.lammps import save_lammps +from mbuild.formats.mol2 import save_mol2 +from mbuild.formats.xyz import save_xyz + __author__ = 'sallai' import sys @@ -201,6 +206,15 @@ class Trajectory(md.Trajectory): def save(self, filename, **kwargs): if filename.endswith(".hoomdxml"): save_hoomdxml(traj=self, filename=filename, **kwargs) + elif filename.endswith(".gro") or filename.endswith(".top"): + basename = filename.split('.')[:-1] + save_gromacs(traj=self, basename=basename, **kwargs) + elif filename.endswith(".xyz"): + save_xyz(traj=self, filename=filename, **kwargs) + elif filename.endswith(".mol2"): + save_mol2(traj=self, filename=filename, **kwargs) + elif filename.startswith("data.") or filename.startswith(".lmp"): + save_lammps(traj=self, filename=filename, **kwargs) else: super(Trajectory, self).save(filename, **kwargs)
added *.mol2, data.*, *.lmp, *.xyz, *.gro, *.top and *.hoomdxml to recognized save functions
mosdef-hub_mbuild
train
py
cf9eb6fbf28f3425972cf5f6d9cee8d591987339
diff --git a/uni_form/helpers.py b/uni_form/helpers.py index <HASH>..<HASH> 100644 --- a/uni_form/helpers.py +++ b/uni_form/helpers.py @@ -121,9 +121,9 @@ class Fieldset(object): ''' Fieldset container. Renders to a <fieldset>. ''' - def __init__(self, legend, *fields, **args): - self.css_class = args.get('css_class', None) - self.css_id = args.get('css_id', None) + def __init__(self, legend, *fields, **kwargs): + self.css_class = kwargs.get('css_class', None) + self.css_id = kwargs.get('css_id', None) self.legend = legend self.fields = fields
Renaming wrong named args to kwargs
django-crispy-forms_django-crispy-forms
train
py
4607aa396791f8254ac9e0a729c831359b9e6eb3
diff --git a/lib/statistics.js b/lib/statistics.js index <HASH>..<HASH> 100644 --- a/lib/statistics.js +++ b/lib/statistics.js @@ -20,6 +20,7 @@ class Statistics { add(value) { this.stats.push(value); + return this; } summarize(options) {
Make it possible to chain adding statistics.
sitespeedio_pagexray
train
js
d552efcee024d1a9d17a88f72aca9e006256b89a
diff --git a/user/view.php b/user/view.php index <HASH>..<HASH> 100644 --- a/user/view.php +++ b/user/view.php @@ -168,8 +168,8 @@ if ($mycourses = get_my_courses($user->id)) { $courselisting = ''; foreach ($mycourses as $mycourse) { - if ($mycourse->visible) { - $courselisting .= "<a href=\"$CFG->wwwroot/course/view.php?id=$mycourse->id\">$mycourse->fullname</a>, "; + if ($mycourse->visible and $mycourse->category) { + $courselisting .= "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&course=$mycourse->id\">$mycourse->fullname</a>, "; } } print_row(get_string('courses').':', rtrim($courselisting,', ')); @@ -231,7 +231,13 @@ } echo "</tr></table></center>\n"; - forum_print_user_discussions($course->id, $user->id); + $isseparategroups = ($course->groupmode == SEPARATEGROUPS and + $course->groupmodeforce and + !isteacheredit($course->id)); + + $groupid = $isseparategroups ? get_current_group($course->id) : NULL; + + forum_print_user_discussions($course->id, $user->id, $groupid); print_footer($course);
Links to enrolled courses in user profile page now link to the user profile page in that course. Makes it easy to see their discussions etc
moodle_moodle
train
php
91fe558d3457a9b84ca870e3c68539a7fe9f541d
diff --git a/asammdf/blocks/v2_v3_blocks.py b/asammdf/blocks/v2_v3_blocks.py index <HASH>..<HASH> 100644 --- a/asammdf/blocks/v2_v3_blocks.py +++ b/asammdf/blocks/v2_v3_blocks.py @@ -2812,7 +2812,11 @@ class HeaderBlock: self.comment_addr = 0 self.program_addr = 0 self.dg_nr = 0 - self.author_field = "{:\0<32}".format(getuser()).encode("latin-1") + try: + user = getuser() + except ModuleNotFoundError: + user = "" + self.author_field = "{:\0<32}".format(user).encode("latin-1") self.department_field = "{:\0<32}".format("").encode("latin-1") self.project_field = "{:\0<32}".format("").encode("latin-1") self.subject_field = "{:\0<32}".format("").encode("latin-1")
fix(blocks.v2_v3_blocks): ModuleNotFoundError: No module named 'pwd'
danielhrisca_asammdf
train
py
677d30d8053b5e24fcd7174483f2e2907e76b0ab
diff --git a/public/jwlib/collection/abstractMap.js b/public/jwlib/collection/abstractMap.js index <HASH>..<HASH> 100644 --- a/public/jwlib/collection/abstractMap.js +++ b/public/jwlib/collection/abstractMap.js @@ -549,18 +549,17 @@ JW.extend(JW.AbstractMap, JW.IndexedCollection, { * @returns {JW.Proxy} `<T>` Proxy of the replaced item. If not modified - `undefined`. */ trySet: function(item, key) { - var oldItem = this.json[key]; - if (oldItem === item) { + var result = JW.Map.trySet(this.json, item, key); + if (result === undefined) { return; } - if (!this.json.hasOwnProperty(key)) { + var oldItem = result.get(); + if (oldItem === undefined) { ++this._length; - } - this.json[key] = item; - if (this._ownsItems && (oldItem !== undefined)) { + } else if (this._ownsItems) { oldItem.destroy(); } - return new JW.Proxy(oldItem); + return result; }, /**
Refactored JW.Map.trySet method.
enepomnyaschih_jwidget
train
js
c6ce324e2dff3463e02bf78ceb83792627f56cff
diff --git a/src/PhpImap/Mailbox.php b/src/PhpImap/Mailbox.php index <HASH>..<HASH> 100644 --- a/src/PhpImap/Mailbox.php +++ b/src/PhpImap/Mailbox.php @@ -668,7 +668,7 @@ class Mailbox $mails = $this->imap('fetch_overview', [implode(',', $mailsIds), (SE_UID == $this->imapSearchOption) ? FT_UID : 0]); if (\is_array($mails) && \count($mails)) { foreach ($mails as &$mail) { - if (isset($mail->subject)) { + if (!empty($mail->subject)) { $mail->subject = $this->decodeMimeStr($mail->subject, $this->getServerEncoding()); } if (isset($mail->from) and !empty($mail->from)) {
Fixes "decodeMimeStr() Can not decode an empty" error when mail has no subject.
barbushin_php-imap
train
php
7578d3002ba25a5864f508b31338f8257d648cce
diff --git a/lib/faker/games/control.rb b/lib/faker/games/control.rb index <HASH>..<HASH> 100644 --- a/lib/faker/games/control.rb +++ b/lib/faker/games/control.rb @@ -23,7 +23,7 @@ module Faker # @return [String] # # @example - # Faker::Games::Control.character #=> "Dimensional Research" + # Faker::Games::Control.location #=> "Dimensional Research" # # @faker.version 2.13.0 def location
fix typo (#<I>)
stympy_faker
train
rb
2c69e2ea757be9492a095aa22b5d51234c4b4102
diff --git a/src/java/org/apache/cassandra/db/ColumnSerializer.java b/src/java/org/apache/cassandra/db/ColumnSerializer.java index <HASH>..<HASH> 100644 --- a/src/java/org/apache/cassandra/db/ColumnSerializer.java +++ b/src/java/org/apache/cassandra/db/ColumnSerializer.java @@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory; import org.apache.cassandra.io.IColumnSerializer; import org.apache.cassandra.io.util.FileDataInput; import org.apache.cassandra.utils.ByteBufferUtil; +import org.apache.cassandra.utils.FBUtilities; public class ColumnSerializer implements IColumnSerializer { @@ -116,6 +117,11 @@ public class ColumnSerializer implements IColumnSerializer else { long ts = dis.readLong(); + long now = FBUtilities.timestampMicros(); + + if (ts > now) // fixing the timestamp from the future to be 'now' in micros + ts = now; // helps with CASSANDRA-4561 as remote nodes can send schema with wrong nanoTime() timestamps + ByteBuffer value = ByteBufferUtil.readWithLength(dis); return (b & COUNTER_UPDATE_MASK) != 0 ? new CounterUpdateColumn(name, value, ts)
change ColumnSerializer.deserialize to be able fix timestamps from future, related to CASSANDRA-<I>
Stratio_stratio-cassandra
train
java
9e29351e6a0dafa9e91290599f37e85aadc659fd
diff --git a/tests/webapp/api/test_resultset_api.py b/tests/webapp/api/test_resultset_api.py index <HASH>..<HASH> 100644 --- a/tests/webapp/api/test_resultset_api.py +++ b/tests/webapp/api/test_resultset_api.py @@ -156,8 +156,7 @@ def test_resultset_list_without_jobs(webapp, initial_data, jm.store_result_set_data(sample_resultset) resp = webapp.get( - reverse("resultset-list", kwargs={"project": jm.project}), - {"with_jobs": "false"} + reverse("resultset-list", kwargs={"project": jm.project}) ) assert resp.status_int == 200 @@ -169,9 +168,7 @@ def test_resultset_list_without_jobs(webapp, initial_data, assert meta == { u'count': len(results), - u'filter_params': { - u"with_jobs": u"false", - }, + u'filter_params': {}, u'repository': u'test_treeherder' }
Bug <I> - Remove leftover references to with_jobs URL parameter Since it was removed in bug <I>.
mozilla_treeherder
train
py
329d567eb44fd211e9ef54b4425276f95863b46e
diff --git a/servers/src/main/java/tachyon/worker/block/allocator/MaxFreeAllocator.java b/servers/src/main/java/tachyon/worker/block/allocator/MaxFreeAllocator.java index <HASH>..<HASH> 100644 --- a/servers/src/main/java/tachyon/worker/block/allocator/MaxFreeAllocator.java +++ b/servers/src/main/java/tachyon/worker/block/allocator/MaxFreeAllocator.java @@ -26,8 +26,8 @@ import tachyon.worker.block.meta.StorageTier; import tachyon.worker.block.meta.TempBlockMeta; /** -* An allocator that allocate a block in the storage dir with most free space. -*/ + * An allocator that allocates a block in the storage dir with most free space. + */ public class MaxFreeAllocator implements Allocator { private final BlockMetadataManager mMetaManager;
Update the comment of MaxFreeAllocator
Alluxio_alluxio
train
java
6b929019c89f4d32326da5cb87789e6442a851a0
diff --git a/lang/fr/lesson.php b/lang/fr/lesson.php index <HASH>..<HASH> 100644 --- a/lang/fr/lesson.php +++ b/lang/fr/lesson.php @@ -129,8 +129,11 @@ $string['maximumnumberofanswersbranches'] = 'Nombre maximal de r $string['maximumnumberofattempts'] = 'Nombre maximal de tentatives'; $string['maxtime'] = 'Dur�e maximale (minutes)'; $string['maxtimewarning'] = 'Il vous reste $a minute(s) pour terminer la le�on.'; -$string['mediafile'] = 'Fichier m�dia'; +$string['mediaclose'] = 'Afficher un bouton fermer&nbsp;: '; +$string['mediafile'] = 'Pop-up vers fichier ou page web'; $string['mediafilepopup'] = 'Cliquer ici pour afficher le fichier m�dia de cette le�on.'; +$string['mediaheight'] = 'Hauteur fen�tre&nbsp;: '; +$string['mediawidth'] = ' largeur&nbsp;: '; $string['minimumnumberofquestions'] = 'Nombre minimal de questions'; $string['modattempts'] = 'Permettre la critique par les �tudiants'; $string['modattemptsnoteacher'] = 'La critique par les �tudiants ne fonctionne que pour les �tudiants.';
Few lang entries for the new features for media file
moodle_moodle
train
php
76f7412a755017cb7c9af343765ef823ecc55c2a
diff --git a/core/server/apps/permissions.js b/core/server/apps/permissions.js index <HASH>..<HASH> 100644 --- a/core/server/apps/permissions.js +++ b/core/server/apps/permissions.js @@ -33,9 +33,11 @@ AppPermissions.prototype.read = function () { }; AppPermissions.prototype.checkPackageContentsExists = function () { + var self = this; + // Mostly just broken out for stubbing in unit tests return new Promise(function (resolve) { - fs.exists(this.packagePath, function (exists) { + fs.exists(self.packagePath, function (exists) { resolve(exists); }); });
Stop packagePath variable from being undefined
TryGhost_Ghost
train
js
14c2ad55b6cb7ebe5315c126485ae0b5823b95b9
diff --git a/lib/transaction/websockets.js b/lib/transaction/websockets.js index <HASH>..<HASH> 100644 --- a/lib/transaction/websockets.js +++ b/lib/transaction/websockets.js @@ -12,6 +12,9 @@ var WebSocketLibrary = (function() { if( configuration instanceof Server ) { this.io = configuration; return; + + } else if( configuration.constructor.name == "Server" ) { + log.warn( "configuration is an instance of 'Server', but wasn't detected as socket.io instance. This indicates a possible socket.io version conflict between your application and absync! absync will probably not work." ); } // Is the configuration just a port number?
[FEATURE] Warn when possible socket.io conflict was detected
oliversalzburg_absync
train
js
114c0cf22fcb29377a4859d1c83d6595afa47ad7
diff --git a/hrpg/core.py b/hrpg/core.py index <HASH>..<HASH> 100644 --- a/hrpg/core.py +++ b/hrpg/core.py @@ -77,17 +77,23 @@ def cli(): # TODO fix hackish default setting - might be a docopt config opt? elif args['user'] or not (args['tasks'] or args['task']): req = requests.get(API_URI_BASE + '/user', headers=config) + res = req.json() if req.status_code == 200: - res = req.json() pprint(res['stats']) - print('\n...and a whole crapload of other stuff...') + print('\n...and a whole crapload of other stuff') else: print('Unhandled HTTP status code') raise NotImplementedError # GET tasks elif args['tasks']: - raise NotImplementedError + req = requests.get(API_URI_BASE + '/user/tasks', headers=config) + res = req.json() + if req.status_code == 200: + print('You have %d tasks (some completed or ongoing)' % len(res)) + else: + print('Unhandled HTTP status code') + raise NotImplementedError # GET task elif args['task']:
stub GET /user/tasks
ASMfreaK_habitipy
train
py
14ff94da34d5ce911ef588f019d5a9d386bd534a
diff --git a/packages/@vue/cli-plugin-babel/codemods/usePluginPreset.js b/packages/@vue/cli-plugin-babel/codemods/usePluginPreset.js index <HASH>..<HASH> 100644 --- a/packages/@vue/cli-plugin-babel/codemods/usePluginPreset.js +++ b/packages/@vue/cli-plugin-babel/codemods/usePluginPreset.js @@ -37,5 +37,5 @@ module.exports = function (fileInfo, api) { node.value = { cooked: '@vue/cli-plugin-babel/preset', raw: '@vue/cli-plugin-babel/preset' } }) - return root.toSource() + return root.toSource({ lineTerminator: '\n' }) }
fix: force lines to be ended with lf, fix windows tests
vuejs_vue-cli
train
js
8e62c0a9a22ff235e453a44db0e65bffd8a0ee31
diff --git a/testem.js b/testem.js index <HASH>..<HASH> 100644 --- a/testem.js +++ b/testem.js @@ -14,7 +14,6 @@ module.exports = { process.env.CI ? '--no-sandbox' : null, '--headless', '--disable-gpu', - '--disable-dev-shm-usage', '--disable-software-rasterizer', '--mute-audio', '--remote-debugging-port=0',
remove `--disable-dev-shm-usage` from testem.js looks like it is causing issues during build in circleci: <URL>
sethbrasile_ember-audio
train
js
102a3a5e9e1c8b0caec748ec115049544174893d
diff --git a/lib/workers/repository/updates/generate.js b/lib/workers/repository/updates/generate.js index <HASH>..<HASH> 100644 --- a/lib/workers/repository/updates/generate.js +++ b/lib/workers/repository/updates/generate.js @@ -180,6 +180,11 @@ function generateBranchConfig(branchUpgrades) { config.hasTypes = true; } else { config.upgrades.sort((a, b) => { + // istanbul ignore if + if (a.fileReplacePosition && b.fileReplacePosition) { + // This is because we need to replace from the bottom of the file up + return a.fileReplacePosition > b.fileReplacePosition ? -1 : 1; + } if (a.depName < b.depName) return -1; if (a.depName > b.depName) return 1; return 0;
fix(maven): sort updates to same file from bottom up
renovatebot_renovate
train
js
fc87620c10882321c38c6921b90986c4bc1c062f
diff --git a/client/lib/stripe/index.js b/client/lib/stripe/index.js index <HASH>..<HASH> 100644 --- a/client/lib/stripe/index.js +++ b/client/lib/stripe/index.js @@ -227,7 +227,7 @@ function useStripeJs( stripeConfiguration ) { return; } debug( 'loading stripe.js...' ); - await loadScriptAsync( stripeConfiguration.js_url ); + await loadScript( stripeConfiguration.js_url ); debug( 'stripe.js loaded!' ); isSubscribed && setStripeLoading( false ); isSubscribed && setStripeLoadingError(); @@ -245,12 +245,6 @@ function useStripeJs( stripeConfiguration ) { return { stripeJs, isStripeLoading, stripeLoadingError }; } -function loadScriptAsync( url ) { - return new Promise( ( resolve, reject ) => { - loadScript( url, loadError => ( loadError ? reject( loadError ) : resolve() ) ); - } ); -} - /** * React custom Hook for loading the Stripe Configuration *
Stripe: loadScript already returns a promise (#<I>)
Automattic_wp-calypso
train
js
e0ccc6d0cbf7b17e8c7288297c717f3b3d499679
diff --git a/CHANGELOG b/CHANGELOG index <HASH>..<HASH> 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -Changes to 0.4.21 +Changes to 0.4.21, 0.4.22 - Unify dll loader between the standard and compat library, fixing load failures on some previously supported platforms. diff --git a/magic/loader.py b/magic/loader.py index <HASH>..<HASH> 100644 --- a/magic/loader.py +++ b/magic/loader.py @@ -1,5 +1,6 @@ import ctypes import sys +import glob def load_lib(): libmagic = None diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ setuptools.setup( author='Adam Hupp', author_email='[email protected]', url="http://github.com/ahupp/python-magic", - version='0.4.21', + version='0.4.22', long_description=read('README.md'), long_description_content_type='text/markdown', packages=['magic'],
Fix yet another import error Seems to hit windows, probably OSX. We have great test coverage across linux distros, not so much elsewhere. Tested on my windows box by manually installing the wheel file.
ahupp_python-magic
train
CHANGELOG,py,py
f75876dde62e23b228cf4c66e1c88c42ed934696
diff --git a/tests/BaseTest.php b/tests/BaseTest.php index <HASH>..<HASH> 100644 --- a/tests/BaseTest.php +++ b/tests/BaseTest.php @@ -76,15 +76,29 @@ abstract class BaseTest extends TestCase { 7 // Mass change template ]; + protected static $dotEnv; + + /** + * Read configuration settings from .env file + */ + public static function setUpBeforeClass() { + self::$dotEnv = new Dotenv(); + self::$dotEnv->load(__DIR__ . '/../.env'); + } + + /** + * Forget configuration settings + */ + public static function tearDownAfterClass () { + self::$dotEnv = null; + } + /** * Make API available * * @throws \Exception on error */ public function setUp() { - $dotenv = new Dotenv(); - $dotenv->load(__DIR__ . '/../.env'); - $config = [ 'url' => getenv('URL'), 'key' => getenv('KEY')
Read configuration settings from .env file only once per test class
bheisig_i-doit-api-client-php
train
php
60b66025be223972bc2525d943f316f839a56076
diff --git a/experiments/src/main/java/samples/NeuralNetViz.java b/experiments/src/main/java/samples/NeuralNetViz.java index <HASH>..<HASH> 100644 --- a/experiments/src/main/java/samples/NeuralNetViz.java +++ b/experiments/src/main/java/samples/NeuralNetViz.java @@ -11,12 +11,12 @@ public class NeuralNetViz extends NeuralNetMnist { } protected void startTraining(Layer[] ls) { - _trainer = new Trainer.MapReduce(ls, 0, self()); - //_trainer = new Trainer.Direct(ls); + //_trainer = new Trainer.MapReduce(ls, 0, self()); + _trainer = new Trainer.Threaded(ls, 0, self()); // Basic visualization of images and weights JFrame frame = new JFrame("H2O"); - frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); MnistCanvas canvas = new MnistCanvas(_trainer); frame.setContentPane(canvas.init()); frame.pack();
Use the threaded version for NN visualization.
h2oai_h2o-2
train
java
c8745c70f01f31fa4c023cd833214f3a90bd86fa
diff --git a/modules/org.opencms.editors.ade/resources/system/workplace/resources/editors/ade/js/cms.toolbar.js b/modules/org.opencms.editors.ade/resources/system/workplace/resources/editors/ade/js/cms.toolbar.js index <HASH>..<HASH> 100644 --- a/modules/org.opencms.editors.ade/resources/system/workplace/resources/editors/ade/js/cms.toolbar.js +++ b/modules/org.opencms.editors.ade/resources/system/workplace/resources/editors/ade/js/cms.toolbar.js @@ -409,7 +409,7 @@ return; } timer.handleDiv.removeClass('ui-widget-header').css({ - 'width': '24px', + 'width': '24px' }).children().removeClass('ui-corner-all ui-state-default').not('a.cms-' + timer.adeMode).css('display', 'none'); }
- removed superfluous comma
alkacon_opencms-core
train
js
07e9e91233b1f7c6ef456085410188f1d6f21e00
diff --git a/Controller/Api/v2.php b/Controller/Api/v2.php index <HASH>..<HASH> 100644 --- a/Controller/Api/v2.php +++ b/Controller/Api/v2.php @@ -230,8 +230,9 @@ class V2 extends \Magento\Framework\App\Action\Action */ public function getPaymentResponse($order) { - return ($this->data->session_id && !empty($this->data->session_id)) - ? $this->api->getPaymentDetails($this->data->session_id) + $sessionId = $this->getRequest()->getParam('cko-session-id'); + return ($sessionId && !empty($sessionId)) + ? $this->api->getPaymentDetails($sessionId) : $this->requestPayment($order); }
Updated the Session Id retrieval logic
checkout_checkout-magento2-plugin
train
php
8b9a3f9f7c939133abb72a5e3d02bfda3ea7fdb4
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name='snipsmanagercore', - version='0.2.0.0.0', + version='0.1.7.0.0', description='The Snips manager core utilities for creating end-to-end assistants', author='Snips', author_email='[email protected]',
Correct version number to comply with PyPi
snipsco_snipsmanagercore
train
py
3f631cea09d4c5630a52139bb231feb816dc80c4
diff --git a/app/src/scripts/user/user.store.js b/app/src/scripts/user/user.store.js index <HASH>..<HASH> 100644 --- a/app/src/scripts/user/user.store.js +++ b/app/src/scripts/user/user.store.js @@ -1,5 +1,5 @@ // dependencies ---------------------------------------------------------------------- - +import Raven from 'raven-js' import React from 'react' import Reflux from 'reflux' import actions from './user.actions.js' @@ -41,6 +41,10 @@ let UserStore = Reflux.createStore({ this.signOut() } else { this.update({ scitran: res.body }, { persist: true }) + Raven.setUserContext({ + email: user.profile.email, + id: user.profile._id, + }) } }) } @@ -153,6 +157,11 @@ let UserStore = Reflux.createStore({ { persist: true }, ) + Raven.setUserContext({ + email: user.profile.email, + id: user.profile._id, + }) + crn.verifyUser((err, res) => { if (res.body.code === 403) { // Pass only the scitran required user values to createUser @@ -261,6 +270,7 @@ let UserStore = Reflux.createStore({ * browser storage. */ clearAuth() { + Raven.setUserContext() delete window.localStorage.token delete window.localStorage.provider delete window.localStorage.profile
Add user context to Raven error reporting.
OpenNeuroOrg_openneuro
train
js
0022a97f244e0c1b7f95172fa92de938984d96a6
diff --git a/blocks/navigation/block_navigation.php b/blocks/navigation/block_navigation.php index <HASH>..<HASH> 100644 --- a/blocks/navigation/block_navigation.php +++ b/blocks/navigation/block_navigation.php @@ -107,12 +107,16 @@ class block_navigation extends block_base { if (!empty($CFG->navcourselimit)) { $limit = $CFG->navcourselimit; } + $expansionlimit = 0; + if (!empty($this->config->expansionlimit)) { + $expansionlimit = $this->config->expansionlimit; + } $arguments = array( 'id' => $this->instance->id, 'instance' => $this->instance->id, 'candock' => $this->instance_can_be_docked(), 'courselimit' => $limit, - 'expansionlimit' => $this->config->expansionlimit + 'expansionlimit' => $expansionlimit ); $this->page->requires->yui_module(array('core_dock', 'moodle-block_navigation-navigation'), 'M.block_navigation.init_add_tree', array($arguments)); }
blocks-navigation MDL-<I> Fixed notice when block config doesn't already exist
moodle_moodle
train
php
9d13649398e98a9ff998932f44bfd058c712eff4
diff --git a/master/buildbot/test/unit/test_steps_shell.py b/master/buildbot/test/unit/test_steps_shell.py index <HASH>..<HASH> 100644 --- a/master/buildbot/test/unit/test_steps_shell.py +++ b/master/buildbot/test/unit/test_steps_shell.py @@ -127,6 +127,20 @@ class TestShellCommandExecution(steps.BuildStepMixin, unittest.TestCase): self.expectOutcome(result=SUCCESS, status_text=["'echo", "hello'"]) return self.runStep() + def test_run_list(self): + self.setupStep( + shell.ShellCommand(workdir='build', + command=['trial', '-b', '-B', 'buildbot.test'])) + self.expectCommands( + ExpectShell(workdir='build', + command=['trial', '-b', '-B', 'buildbot.test'], + usePTY="slave-config") + + 0 + ) + self.expectOutcome(result=SUCCESS, + status_text=["'trial", "-b", "...'"]) + return self.runStep() + def test_run_env(self): self.setupStep( shell.ShellCommand(workdir='build', command="echo hello"),
add a test for command=[..]
buildbot_buildbot
train
py
01878f0ad294c37d55c85b1a8e660027d282d6b9
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IResource.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IResource.java index <HASH>..<HASH> 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IResource.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IResource.java @@ -24,7 +24,6 @@ import java.util.Map; import ca.uhn.fhir.model.dstu.composite.ContainedDt; import ca.uhn.fhir.model.dstu.composite.NarrativeDt; -import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.IdDt;
removed unused import from IResource
jamesagnew_hapi-fhir
train
java
4863675d28e841fb0ec8b85e77940599d7b5f013
diff --git a/aiogram/utils/exceptions.py b/aiogram/utils/exceptions.py index <HASH>..<HASH> 100644 --- a/aiogram/utils/exceptions.py +++ b/aiogram/utils/exceptions.py @@ -7,6 +7,7 @@ - MessageNotModified - MessageToForwardNotFound - MessageToDeleteNotFound + - MessageToPinNotFound - MessageIdentifierNotSpecified - MessageTextIsEmpty - MessageCantBeEdited @@ -182,6 +183,13 @@ class MessageToDeleteNotFound(MessageError): match = 'message to delete not found' +class MessageToPinNotFound(MessageError): + """ + Will be raised when you try to pin deleted or unknown message. + """ + match = 'message to pin not found' + + class MessageToReplyNotFound(MessageError): """ Will be raised when you try to reply to very old or deleted or unknown message.
Add exception MessageToPinNotFound (#<I>)
aiogram_aiogram
train
py
4d12c037de649c98e7c2d58f927e77c0927d85c4
diff --git a/lib/cfoundry/client.rb b/lib/cfoundry/client.rb index <HASH>..<HASH> 100644 --- a/lib/cfoundry/client.rb +++ b/lib/cfoundry/client.rb @@ -23,6 +23,11 @@ require "cfoundry/v2/client" module CFoundry class Client < BaseClient def self.new(*args) + puts "DEPRECATION WARNING: Please use CFoundry::Client.get instead of CFoundry::Client.new" + get(*args) + end + + def self.get(*args) CFoundry::V2::Client.new(*args).tap { |client| client.info } end end diff --git a/spec/cfoundry/client_spec.rb b/spec/cfoundry/client_spec.rb index <HASH>..<HASH> 100644 --- a/spec/cfoundry/client_spec.rb +++ b/spec/cfoundry/client_spec.rb @@ -5,7 +5,7 @@ describe CFoundry::Client do CFoundry::V2::Client.any_instance.stub(:info) end - subject { CFoundry::Client.new('http://example.com') } + subject { CFoundry::Client.get('http://example.com') } it "returns a v2 client" do subject.should be_a(CFoundry::V2::Client)
Add deprecation warning to CFoundry::Client.new
cloudfoundry-attic_cfoundry
train
rb,rb
14fa54e1e5763087323d5efb9c4857b50bca7935
diff --git a/molgenis-search-elasticsearch/src/main/java/org/molgenis/elasticsearch/index/IndexRequestGenerator.java b/molgenis-search-elasticsearch/src/main/java/org/molgenis/elasticsearch/index/IndexRequestGenerator.java index <HASH>..<HASH> 100644 --- a/molgenis-search-elasticsearch/src/main/java/org/molgenis/elasticsearch/index/IndexRequestGenerator.java +++ b/molgenis-search-elasticsearch/src/main/java/org/molgenis/elasticsearch/index/IndexRequestGenerator.java @@ -138,8 +138,7 @@ public class IndexRequestGenerator if (mrefIds != null) id = mrefIds; if (mrefKeys != null) key = mrefKeys; } - // FIXME https://github.com/molgenis/molgenis/issues/1401 - value = Joiner.on(" , ").join((Collection<?>) value); + value = Joiner.on(",").join((Collection<?>) value); } if (id != null) doc.put("id-" + attrName, id); if (key != null) doc.put("key-" + attrName, key);
Fix for github issue #<I>
molgenis_molgenis
train
java