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
6b7404cbbbda8f5533055584a2309988b0784de6
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -333,7 +333,7 @@ epub_copyright = copyright # The format is a list of tuples containing the path and title. #epub_pre_files = [] -# HTML files shat should be inserted after the pages created by sphinx. +# HTML files that should be inserted after the pages created by sphinx. # The format is a list of tuples containing the path and title. #epub_post_files = []
docs: Fix simple typo, shat -> that There is a small typo in docs/conf.py. Should read `that` rather than `shat`.
tetframework_Tonnikala
train
py
4a63ea334e8ace92d00dc5b81db5355e416451c6
diff --git a/packages/teraslice/lib/cluster/services/cluster/backends/native/messaging.js b/packages/teraslice/lib/cluster/services/cluster/backends/native/messaging.js index <HASH>..<HASH> 100644 --- a/packages/teraslice/lib/cluster/services/cluster/backends/native/messaging.js +++ b/packages/teraslice/lib/cluster/services/cluster/backends/native/messaging.js @@ -257,7 +257,7 @@ module.exports = function messaging(context, logger) { io = require('socket.io-client')(hostURL, { forceNew: true, path: '/native-clustering', - // transports: ['websocket'], + perMessageDeflate: false, query, }); _registerFns(io); @@ -278,6 +278,9 @@ module.exports = function messaging(context, logger) { // cluster_master io = require('socket.io')(server, { path: '/native-clustering', + pingTimeout: configTimeout, + pingInterval: configTimeout + networkLatencyBuffer, + perMessageDeflate: false, serveClient: false, }); _attachRoomsSocketIO();
Use the same logic for the socket.io server in messaging
terascope_teraslice
train
js
3193b0dc3b5445656a8b94425345e3c8475f7533
diff --git a/packages/@vue/cli-service/lib/Service.js b/packages/@vue/cli-service/lib/Service.js index <HASH>..<HASH> 100644 --- a/packages/@vue/cli-service/lib/Service.js +++ b/packages/@vue/cli-service/lib/Service.js @@ -29,7 +29,7 @@ module.exports = class Service { // for testing. this.plugins = this.resolvePlugins(plugins, useBuiltIn) // resolve the default mode to use for each command - // this is provided by plugins as module.exports.defaulModes + // this is provided by plugins as module.exports.defaultModes // so we can get the information without actually applying the plugin. this.modes = this.plugins.reduce((modes, { apply: { defaultModes }}) => { return Object.assign(modes, defaultModes) @@ -146,7 +146,7 @@ module.exports = class Service { // resolve mode // prioritize inline --mode // fallback to resolved default modes from plugins - const mode = args.mode || this.modes[name] + const mode = name === 'build' && args.watch ? 'development' : args.mode || this.modes[name] // load env variables, load user config, apply plugins this.init(mode)
fix(build): default to development mode in build --watch (#<I>)
vuejs_vue-cli
train
js
1f7c24679793e370f230afcdb2e8a5fd78d4e31d
diff --git a/ui/components/signup/index.js b/ui/components/signup/index.js index <HASH>..<HASH> 100644 --- a/ui/components/signup/index.js +++ b/ui/components/signup/index.js @@ -5,10 +5,12 @@ exports.create = function (model, dom) { if (!form) return console.error('must specifiy form element (i.e. <form x-as="form">...</form>'); $(function () { - $(form).ajaxForm({ - method: 'post', - url: model.get('url') || '/signup', - xhrFields: {withCredentials: true} - }); + $(form).ajaxForm(); }); +}; + +exports.provider = function (e, el) { + e.preventDefault(); + if (!el.href) return console.error('must specify a provider url (i.e. <a href="/signin/provider">...</a>'); + $.popupWindow(el.href); }; \ No newline at end of file
remove unused script and added provider export
psirenny_derby-user
train
js
1c5adf402f22ebc0786443e9abb3e0ef4b8b0965
diff --git a/executor/show.go b/executor/show.go index <HASH>..<HASH> 100644 --- a/executor/show.go +++ b/executor/show.go @@ -190,11 +190,6 @@ func (e *ShowExec) fetchShowProcessList() error { pl := sm.ShowProcessList() for _, pi := range pl { - var t uint64 - if len(pi.Info) != 0 { - t = uint64(time.Since(pi.Time) / time.Second) - } - var info string if e.Full { info = pi.Info @@ -208,7 +203,7 @@ func (e *ShowExec) fetchShowProcessList() error { pi.Host, pi.DB, pi.Command, - t, + uint64(time.Since(pi.Time) / time.Second), fmt.Sprintf("%d", pi.State), info, pi.Mem,
fix show processlist (#<I>)
pingcap_tidb
train
go
3e6e9460e229bb232a54915f1fa09996ce9d9350
diff --git a/lib/chef/resource/file.rb b/lib/chef/resource/file.rb index <HASH>..<HASH> 100644 --- a/lib/chef/resource/file.rb +++ b/lib/chef/resource/file.rb @@ -58,7 +58,7 @@ class Chef property :atomic_update, [ true, false ], desired_state: false, default: Chef::Config[:file_atomic_update] property :force_unlink, [ true, false ], desired_state: false, default: false property :manage_symlink_source, [ true, false ], desired_state: false - property :verifications, Array, default: lazy { Array.new } + property :verifications, Array, default: lazy { [] } def verify(command=nil, opts={}, &block) if ! (command.nil? || [String, Symbol].include?(command.class))
can be less verbose about creating Arrays
chef_chef
train
rb
b3cc3a121dc15dc7dd2e4a9558dd5791917ad065
diff --git a/middleware/middleware.js b/middleware/middleware.js index <HASH>..<HASH> 100644 --- a/middleware/middleware.js +++ b/middleware/middleware.js @@ -74,9 +74,6 @@ export default ({ dispatch, getState }) => next => action => { const sendRequest = ({ shouldRenewToken } = {}) => { const headers = { Authorization: selectToken(state), - // NOTE: passing headers is currently only necessary for the pim-indexer - // this should be cleaned up, so the endpoint of an http call is determined by the url - // and not the headers ...(action.payload.headers || {}), ...(shouldRenewToken ? { 'X-Force-Token': 'true' } : {}), };
refactor(ppl/pim-search): Change more names to reflect backend change
commercetools_merchant-center-application-kit
train
js
686eb3de94fbbdbff8430ed5c42585a3f41820a3
diff --git a/Controller/SecurityController.php b/Controller/SecurityController.php index <HASH>..<HASH> 100644 --- a/Controller/SecurityController.php +++ b/Controller/SecurityController.php @@ -106,7 +106,7 @@ class SecurityController extends AbstractController ; return $widget - ? new AjaxResponse('', true, $successMessage, [], $url) + ? new AjaxResponse(null, true, $successMessage, [], $url) : $this->redirect($url); } @@ -140,7 +140,7 @@ class SecurityController extends AbstractController $url = $this->generateUrl($this->container->getParameter('darvin_user.already_logged_in_redirect_route')); return $widget - ? new AjaxResponse('', true, $successMessage, [], $url) + ? new AjaxResponse(null, true, $successMessage, [], $url) : $this->redirect($url); }
Pass null instead of empty string in place of HTML to AJAX response constructor.
DarvinStudio_DarvinUserBundle
train
php
979930b22143de1dd68847d71022511849f94913
diff --git a/vagrant/cookbook/recipes/default.rb b/vagrant/cookbook/recipes/default.rb index <HASH>..<HASH> 100644 --- a/vagrant/cookbook/recipes/default.rb +++ b/vagrant/cookbook/recipes/default.rb @@ -34,6 +34,7 @@ libapache2-mod-php5 git php5-cli php5-curl +php5-gd php5-sqlite php5-mysql php5-intl
added missing php5-gd lib to default recipe
Sylius_Sylius
train
rb
a1983736fe0d8565375aa1eb8a6c602b76c477a1
diff --git a/src/Bkwld/Croppa/Helpers.php b/src/Bkwld/Croppa/Helpers.php index <HASH>..<HASH> 100644 --- a/src/Bkwld/Croppa/Helpers.php +++ b/src/Bkwld/Croppa/Helpers.php @@ -35,7 +35,9 @@ class Helpers { * @see Bkwld\Croppa\Storage::deleteSrc() */ public function delete($url) { - return $this->storage->deleteSrc($this->url->relativePath($url)); + $path = $this->url->relativePath($url); + $this->storage->deleteSrc($path); + $this->storage->deleteCrops($path); } /** @@ -46,7 +48,7 @@ class Helpers { * @see Bkwld\Croppa\Storage::deleteCrops() */ public function reset($url) { - return $this->storage->deleteCrops($this->url->relativePath($url)); + $this->storage->deleteCrops($this->url->relativePath($url)); } /**
Croppa::delete() was intended to delete the src and crops Closes #<I>
BKWLD_croppa
train
php
de0667f6988ba720040e1ed3125418d2b9352d97
diff --git a/Branch-SDK/src/main/java/io/branch/referral/Branch.java b/Branch-SDK/src/main/java/io/branch/referral/Branch.java index <HASH>..<HASH> 100644 --- a/Branch-SDK/src/main/java/io/branch/referral/Branch.java +++ b/Branch-SDK/src/main/java/io/branch/referral/Branch.java @@ -2302,7 +2302,16 @@ public class Branch implements BranchViewHandler.IBranchViewEvents, SystemObserv } networkCount_ = 0; - processNextQueueItem(); + // In rare cases where this method is called directly (eg. when network calls time out), + // starting the next queue item can lead to stack over flow. Ensuring that this is + // queued back to the main thread mitigates this. + Handler handler = new Handler(Looper.getMainLooper()); + handler.post(new Runnable() { + @Override + public void run() { + processNextQueueItem(); + } + }); } private void onRequestSuccess(ServerResponse serverResponse) {
Return to the main thread to kick off the next queue item (#<I>) In rare cases where this method is called directly (eg. when network calls time out), starting the next queue item can lead to stack over flow. Ensuring that this is queued back to the main thread mitigates this.
BranchMetrics_android-branch-deep-linking
train
java
4bf55d20e0c351a8ee483f3df6d7039d27834999
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/mesos/SingularityMesosTaskBuilder.java b/SingularityService/src/main/java/com/hubspot/singularity/mesos/SingularityMesosTaskBuilder.java index <HASH>..<HASH> 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/mesos/SingularityMesosTaskBuilder.java +++ b/SingularityService/src/main/java/com/hubspot/singularity/mesos/SingularityMesosTaskBuilder.java @@ -449,7 +449,7 @@ class SingularityMesosTaskBuilder { commandBldr.setShell(false); } - List<SingularityMesosArtifact> combinedArtifacts = task.getDeploy().getUris().or(Collections.<SingularityMesosArtifact> emptyList()); + List<SingularityMesosArtifact> combinedArtifacts = task.getDeploy().getUris().or(Collections.emptyList()); combinedArtifacts.addAll(task.getPendingTask().getExtraArtifacts()); for (SingularityMesosArtifact artifact : combinedArtifacts) {
Explicit type not required here.
HubSpot_Singularity
train
java
2d51f1c50044f5757d203d09a0b3c6340a83d13d
diff --git a/src/Service/AuthenticationVerificationResult.php b/src/Service/AuthenticationVerificationResult.php index <HASH>..<HASH> 100644 --- a/src/Service/AuthenticationVerificationResult.php +++ b/src/Service/AuthenticationVerificationResult.php @@ -24,7 +24,7 @@ use Surfnet\StepupU2fBundle\Exception\InvalidArgumentException; use Surfnet\StepupU2fBundle\Exception\LogicException; /** - * @SuppressWarnings(PHPMD.TooManyMethods) + * @SuppressWarnings(PHPMD.TooManyPublicMethods) */ final class AuthenticationVerificationResult { diff --git a/src/Service/RegistrationVerificationResult.php b/src/Service/RegistrationVerificationResult.php index <HASH>..<HASH> 100644 --- a/src/Service/RegistrationVerificationResult.php +++ b/src/Service/RegistrationVerificationResult.php @@ -24,7 +24,7 @@ use Surfnet\StepupU2fBundle\Exception\InvalidArgumentException; use Surfnet\StepupU2fBundle\Exception\LogicException; /** - * @SuppressWarnings(PHPMD.TooManyMethods) + * @SuppressWarnings(PHPMD.TooManyPublicMethods) */ final class RegistrationVerificationResult {
Update PHPMD Suppression The suppression was changed from TooManyMethods to TooManyPublicMethods.
OpenConext_Stepup-u2f-bundle
train
php,php
4a0a0f57a870e8531d35502ab2719328eff40a29
diff --git a/lib/process_runner/runner.js b/lib/process_runner/runner.js index <HASH>..<HASH> 100644 --- a/lib/process_runner/runner.js +++ b/lib/process_runner/runner.js @@ -219,15 +219,25 @@ ProcessRunner.prototype.findDependencies = function(testPaths, callback) { }; /** + * + * @param {?Array} names Names of the dependencies to run. Defaults to all the + * dependencies specified in the config file. * @param {Function} callback Callback called when all the processes have * started. */ -ProcessRunner.prototype.start = function(callback) { - var key, value, ops = {}, name, dependencies, func; +ProcessRunner.prototype.start = function(names, callback) { + var i, len, name, value, ops = {}, dependencies, func; + + if (typeof names === 'function') { + callback = names; + names = Object.keys(this._config); + } + + for (i = 0, len = names.length; i < len; i++) { + name = names[i]; - for (key in this._config) { - if (this._config.hasOwnProperty(key)) { - value = this._config[key]; + if (this._config.hasOwnProperty(name)) { + value = this._config[name]; name = value.name; dependencies = value.depends;
Allow user to pass names of the dependencies to run to the start method.
cloudkick_whiskey
train
js
b5ab962d7019e02431ae379f315b7d46f4ce289f
diff --git a/functions.php b/functions.php index <HASH>..<HASH> 100644 --- a/functions.php +++ b/functions.php @@ -8,8 +8,23 @@ * @since Timber 0.1 */ +/** + * If you are installing Timber as a Composer dependency in your theme, you'll need this block + * to load your dependencies and initialize Timber. If you are using Timber via the WordPress.org + * plug-in, you can safely delete this block. + */ +$composer_autoload = __DIR__ . '/vendor/autoload.php'; +if ( file_exists($composer_autoload) ) { + require_once( $composer_autoload ); + $timber = new Timber\Timber(); +} +/** + * This ensures that Timber is loaded and available as a PHP class. + * If not, it gives an error message to help direct developers on where to activate + */ if ( ! class_exists( 'Timber' ) ) { + add_action( 'admin_notices', function() { echo '<div class="error"><p>Timber not activated. Make sure you activate the plugin in <a href="' . esc_url( admin_url( 'plugins.php#timber' ) ) . '">' . esc_url( admin_url( 'plugins.php' ) ) . '</a></p></div>'; });
Include pattern for loading Timber via Composer
timber_starter-theme
train
php
8033e25663e4be61b309563843b0f674083219e0
diff --git a/src/ol/renderer/canvas/tilelayer.js b/src/ol/renderer/canvas/tilelayer.js index <HASH>..<HASH> 100644 --- a/src/ol/renderer/canvas/tilelayer.js +++ b/src/ol/renderer/canvas/tilelayer.js @@ -227,9 +227,7 @@ ol.renderer.canvas.TileLayer.prototype.prepareFrame = function(frameState, layer canvas.width = width; canvas.height = height; } else { - if (this.renderedExtent_ && !ol.extent.equals(imageExtent, this.renderedExtent_)) { - context.clearRect(0, 0, width, height); - } + context.clearRect(0, 0, width, height); oversampling = this.oversampling_; } }
Vector tile rendering requires canvas to be cleared
openlayers_openlayers
train
js
2ff3790a90d475aefc191dd73fb25d0693af0f48
diff --git a/lib/Record.php b/lib/Record.php index <HASH>..<HASH> 100644 --- a/lib/Record.php +++ b/lib/Record.php @@ -637,6 +637,16 @@ class Record extends Base implements \ArrayAccess, \IteratorAggregate, \Countabl } /** + * Returns whether the data is loaded + * + * @return bool + */ + public function isLoaded() + { + return $this->loaded; + } + + /** * Sets the primary key field * * @param string $primaryKey
added isLoaded method for record clas
twinh_wei
train
php
fdf829675c6afeb81298c1ac33c9a88c648d779f
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -14,7 +14,7 @@ function SweetjsFilter(inputTree, options) { SweetjsFilter.prototype = Object.create(Filter.prototype); SweetjsFilter.prototype.constructor = SweetjsFilter; -SweetjsFilter.prototype.extensions = ['js']; +SweetjsFilter.prototype.extensions = ['js', 'sjs']; SweetjsFilter.prototype.targetExtension = 'js'; SweetjsFilter.prototype.processString = function (str) {
Added .sjs extension in use by the community
sindresorhus_broccoli-sweetjs
train
js
3a4d2859921665221715969748c478cb437208f0
diff --git a/spectra.js b/spectra.js index <HASH>..<HASH> 100644 --- a/spectra.js +++ b/spectra.js @@ -425,6 +425,10 @@ Spectra.fn.prototype.rgbNumber = function() { return (this.red() << 16) | (this.green() << 8) | (this.blue()); }; + + // Use hex string function for toString operations + // to allow direct assignment to css properties + Spectra.fn.prototype.toString = Spectra.fn.prototype.hex; /** * API Functions
Use hex string for toString() Use hex string function for spectra object's toString() method. This allows for direct assignment to css properties.
avp_spectra
train
js
4a4cdc6999c73da4833898474db06ef06e32baf7
diff --git a/src/com/backendless/servercode/RunnerContext.java b/src/com/backendless/servercode/RunnerContext.java index <HASH>..<HASH> 100644 --- a/src/com/backendless/servercode/RunnerContext.java +++ b/src/com/backendless/servercode/RunnerContext.java @@ -103,6 +103,16 @@ public class RunnerContext extends AbstractContext this.eventContext = eventContext; } + public Map<String, String> getHttpHeaders() + { + return httpHeaders; + } + + public void setHttpHeaders( Map<String, String> httpHeaders ) + { + this.httpHeaders = httpHeaders; + } + @Override public String toString() { @@ -110,6 +120,7 @@ public class RunnerContext extends AbstractContext sb.append( "missingProperties=" ).append( missingProperties ); sb.append( ", prematureResult=" ).append( prematureResult ); sb.append( ", eventContext=" ).append( eventContext ); + sb.append( ", httpHeaders=" ).append( httpHeaders ); sb.append( ", " ).append(super.toString()); sb.append( "}" ); return sb.toString();
BKNDLSS-<I> - added httpHeaders to RunnerContext
Backendless_Android-SDK
train
java
84ca4e25a3cd40dfdaa50743f7892fc28446dbc0
diff --git a/hazelcast/src/main/java/com/hazelcast/nio/tcp/TcpIpConnectionManager.java b/hazelcast/src/main/java/com/hazelcast/nio/tcp/TcpIpConnectionManager.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/nio/tcp/TcpIpConnectionManager.java +++ b/hazelcast/src/main/java/com/hazelcast/nio/tcp/TcpIpConnectionManager.java @@ -72,7 +72,7 @@ public class TcpIpConnectionManager implements ConnectionManager, PacketHandler // TODO Introducing this to allow disabling the spoofing checks on-demand // if there is a use-case that gets affected by the change. If there are no reports of misbehaviour we can remove than in // next release. - private static final boolean SPOOFING_CHECKS = parseBoolean(getProperty("hazelcast.nio.tcp.spoofing.checks", "true")); + private static final boolean SPOOFING_CHECKS = parseBoolean(getProperty("hazelcast.nio.tcp.spoofing.checks", "false")); final LoggingService loggingService;
Disable spoofing checks by default (#<I>)
hazelcast_hazelcast
train
java
7f749cd68df844a235bc7c40df56ad852801e1f1
diff --git a/packages/@keynote/cli/bin/keynote.js b/packages/@keynote/cli/bin/keynote.js index <HASH>..<HASH> 100755 --- a/packages/@keynote/cli/bin/keynote.js +++ b/packages/@keynote/cli/bin/keynote.js @@ -24,7 +24,7 @@ program .option('-p, --theme <theme>', 'use specified theme (default: @keynote/theme-default)') .option('--debug', 'build in development mode for debugging') .action((file = 'keynote.vue', { debug, dest, theme }) => { - const outDir = dest ? path.resolve(dest) : null + const outDir = dest ? require('path').resolve(dest) : null wrapCommand(require('./build'))({ file, debug, outDir, theme }) })
fix: Add missing import for path package
znck_vue-slides
train
js
ff2f3c933625f55950ccb5915d2f22896f1ec504
diff --git a/pysat/utils/_core.py b/pysat/utils/_core.py index <HASH>..<HASH> 100644 --- a/pysat/utils/_core.py +++ b/pysat/utils/_core.py @@ -681,6 +681,9 @@ def display_available_instruments(inst_loc=None, show_inst_mod=None, if show_platform_name is None and inst_loc is None: show_platform_name = True + plat_keys = sorted([platform for platform in inst_info.keys()]) + else: + plat_keys = inst_info.keys() if show_inst_mod is None and inst_loc is not None: show_inst_mod = True @@ -696,7 +699,7 @@ def display_available_instruments(inst_loc=None, show_inst_mod=None, header = "{:s} [Tag Inst_ID] Description".format(header) print(header) print("-" * len(header)) - for platform in inst_info.keys(): + for platform in plat_keys: for name in inst_info[platform].keys(): mod_str = "" for inst_id in inst_info[platform][name]['inst_ids_tags'].keys():
STY: added platform sorting Added sorting by platform if the platform is being displayed.
rstoneback_pysat
train
py
f87df412d2b040a8cf63e818fb499e5815337663
diff --git a/librosa/core/constantq.py b/librosa/core/constantq.py index <HASH>..<HASH> 100644 --- a/librosa/core/constantq.py +++ b/librosa/core/constantq.py @@ -556,7 +556,7 @@ def __trim_stack(cqt_resp, n_bins): '''Helper function to trim and stack a collection of CQT responses''' # cleanup any framing errors at the boundaries - max_col = min([x.shape[1] for x in cqt_resp]) + max_col = min(x.shape[1] for x in cqt_resp) cqt_resp = np.vstack([x[:, :max_col] for x in cqt_resp][::-1])
Use generator expression instead of making a list
librosa_librosa
train
py
7ceff2331f788b89435d7a7e302929d44181f583
diff --git a/lib/eye/process/monitor.rb b/lib/eye/process/monitor.rb index <HASH>..<HASH> 100644 --- a/lib/eye/process/monitor.rb +++ b/lib/eye/process/monitor.rb @@ -11,7 +11,7 @@ private :no_pid_file elsif process_pid_running?(newpid) self.pid = newpid - info "load_external_pid_file: process <#{self.pid}> from pid_file found and already running" + info "load_external_pid_file: process <#{self.pid}> from pid_file found and already running (#{Eye::SystemResources.args(self.pid)})" :ok else @last_loaded_pid = newpid diff --git a/lib/eye/system_resources.rb b/lib/eye/system_resources.rb index <HASH>..<HASH> 100644 --- a/lib/eye/system_resources.rb +++ b/lib/eye/system_resources.rb @@ -57,6 +57,10 @@ class Eye::SystemResources end end + def args(pid) + Eye::Sigar.proc_args(pid).join(' ').strip rescue '-' + end + def resources(pid) { :memory => memory(pid), :cpu => cpu(pid),
logging process args when load from pid_file
kostya_eye
train
rb,rb
751b1e6b7940e8f66b6a9a249fad8547beee5d7b
diff --git a/outline.js b/outline.js index <HASH>..<HASH> 100644 --- a/outline.js +++ b/outline.js @@ -42,6 +42,8 @@ OutlinePlugin.prototype.disable = function() { }; var scratch0 = vec3.create(); +var epsilon = 0.001; +var scratch1 = [1+epsilon, 1+epsilon, 1+epsilon]; OutlinePlugin.prototype.tick = function() { var hit = this.game.raycastVoxels(); @@ -57,6 +59,7 @@ OutlinePlugin.prototype.tick = function() { scratch0[1] = hit.voxel[1]; scratch0[2] = hit.voxel[0]; mat4.translate(this.modelMatrix, this.modelMatrix, scratch0); + mat4.scale(this.modelMatrix, this.modelMatrix, scratch1); }; OutlinePlugin.prototype.render = function() {
Expand outline by a small offset to prevent z-fighting
voxel_voxel-outline
train
js
545998084b6f9b4b7683747e50daac295001dbbf
diff --git a/Service/TranslationManager.php b/Service/TranslationManager.php index <HASH>..<HASH> 100644 --- a/Service/TranslationManager.php +++ b/Service/TranslationManager.php @@ -16,6 +16,7 @@ use ONGR\ElasticsearchDSL\Aggregation\Bucketing\TermsAggregation; use ONGR\ElasticsearchDSL\Query\MatchAllQuery; use ONGR\ElasticsearchDSL\Query\TermsQuery; use ONGR\ElasticsearchBundle\Service\Repository; +use ONGR\FilterManagerBundle\Twig\PagerExtension; use ONGR\TranslationsBundle\Document\Message; use ONGR\TranslationsBundle\Document\Translation; use ONGR\TranslationsBundle\Event\Events; @@ -119,16 +120,17 @@ class TranslationManager unset($content['messages']); } - try { - foreach ($content as $key => $value) { - $document->{'set'.ucfirst($key)}($value); + foreach ($content as $key => $value) { + $method = 'set' . ucfirst($key); + + if (!method_exists($document, $method)) { + throw new \LogicException('Illegal variable provided for translation'); } - $document->setUpdatedAt(new \DateTime()); - } catch (\Error $e) { - throw new \LogicException('Illegal variable provided for translation'); + $document->$method($value); } + $document->setUpdatedAt(new \DateTime()); $this->repository->getManager()->persist($document); $this->repository->getManager()->commit(); }
changed try-catch to if in TranslationManage::update
ongr-io_TranslationsBundle
train
php
e736fe4d51c4f3a24739e8da41589e90fc450e68
diff --git a/fireplace/cards/karazhan/collectible.py b/fireplace/cards/karazhan/collectible.py index <HASH>..<HASH> 100644 --- a/fireplace/cards/karazhan/collectible.py +++ b/fireplace/cards/karazhan/collectible.py @@ -37,9 +37,9 @@ class KAR_033: powered_up = HOLDING_DRAGON, Find(ENEMY_MINIONS + (ATK <= 3)) play = HOLDING_DRAGON & Destroy(TARGET) -# class KAR_035: -# "Priest of the Feast" - +class KAR_035: + "Priest of the Feast" + events = OWN_SPELL_PLAY.on(Heal(FRIENDLY_HERO, 3)) # class KAR_036: # "Arcane Anomaly" diff --git a/tests/test_karazhan.py b/tests/test_karazhan.py index <HASH>..<HASH> 100644 --- a/tests/test_karazhan.py +++ b/tests/test_karazhan.py @@ -78,3 +78,11 @@ def test_book_wyrm(): assert len(game.player2.field) == 1 game.end_turn() +def test_priest_of_the_feast(): + game = prepare_game() + priest = game.player1.give("KAR_035") + game.player1.give(DAMAGE_5).play(target=game.player1.hero) + assert game.player1.hero.health == 25 + priest.play() + game.player1.give(THE_COIN).play() + assert game.player1.hero.health == 28 \ No newline at end of file
Implement "Priest of the Feast" with test KAR_<I>
jleclanche_fireplace
train
py,py
c227ed6d3f9e97500cd3f3c29568a5af345790e5
diff --git a/src/attributes.js b/src/attributes.js index <HASH>..<HASH> 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -617,6 +617,11 @@ function getNumElementsFromAttributes(gl, attribs) { * * @param {WebGLRenderingContext} gl A WebGLRenderingContext * @param {module:twgl.Arrays} arrays Your data + * @param {module:twgl.BufferInfo} [srcBufferInfo] An existing + * buffer info to start from. WebGLBuffers etc specified + * in the srcBufferInfo will be used in a new BufferInfo + * with any arrays specfied overriding the ones in + * srcBufferInfo. * @return {module:twgl.BufferInfo} A BufferInfo * @memberOf module:twgl/attributes */
update docs for createBufferInfoFromArrays
greggman_twgl.js
train
js
3b568cd74b1f4a02c77e47f366c4c363eb7a2d8d
diff --git a/src/webui/src/components/Footer/index.js b/src/webui/src/components/Footer/index.js index <HASH>..<HASH> 100644 --- a/src/webui/src/components/Footer/index.js +++ b/src/webui/src/components/Footer/index.js @@ -49,7 +49,10 @@ export default class Footer extends React.Component { <div className={classes.right}> Powered by&nbsp; - <img className={classes.logo} src={logo} alt="Verdaccio" title="Verdaccio"/> + { /* Can't switch to HTTPS due it hosted on GitHub Pages */ } + <a href="http://www.verdaccio.org/"> + <img className={classes.logo} src={logo} alt="Verdaccio" title="Verdaccio"/> + </a> &nbsp;/&nbsp; {__APP_VERSION__} </div>
refactor: add links to verdaccio official website
verdaccio_verdaccio
train
js
77d2992d5164157226840b5e998e76416b42a218
diff --git a/html/pfappserver/root/static/admin/config/items.js b/html/pfappserver/root/static/admin/config/items.js index <HASH>..<HASH> 100644 --- a/html/pfappserver/root/static/admin/config/items.js +++ b/html/pfappserver/root/static/admin/config/items.js @@ -55,7 +55,9 @@ var ItemView = function(options) { // Display the switch in a modal var read = $.proxy(this.readItem, this); - options.parent.on('click', id + ' .item [href$="/read"], ' + id + ' [href$="/clone"], .createItem', read); + options.parent.on('click', id + ' .item [href$="/read"]', read); + options.parent.on('click', id + ' [href$="/clone"]', read); + options.parent.on('click', '.createItem', read); // Save the modifications from the modal var update = $.proxy(this.updateItem, this);
Split up the click selector for the read action
inverse-inc_packetfence
train
js
3bc128299b213aa953eeacd4fca040412f6bc1eb
diff --git a/packages/colony-js-client/src/lib/EthersWrappedWallet/index.js b/packages/colony-js-client/src/lib/EthersWrappedWallet/index.js index <HASH>..<HASH> 100644 --- a/packages/colony-js-client/src/lib/EthersWrappedWallet/index.js +++ b/packages/colony-js-client/src/lib/EthersWrappedWallet/index.js @@ -40,6 +40,14 @@ export default class EthersWrappedWallet { return this.wallet.signMessage(payload); } + async getNonce(): Promise<number | void> { + // MetaMask logs a warning if the nonce is already set, so only set the + // nonce for other wallet types. + return this.wallet.subtype === 'metamask' + ? undefined + : this.getTransactionCount(); + } + /** * Given a partial transaction request, sets the remaining required fields, * signs the transaction with the Purser wallet and sends it using the @@ -58,7 +66,7 @@ export default class EthersWrappedWallet { .mul(new BigNumber('12')) .div(new BigNumber('10')), gasPrice: gasPrice ? new BigNumber(gasPrice) : await this.getGasPrice(), - nonce: nonce || (await this.getTransactionCount()), + nonce: nonce || (await this.getNonce()), to, value, };
Don't set MM nonce * Do not set the nonce for MetaMask wallets (`EthersWrappedWallet`)
JoinColony_colonyJS
train
js
a9c0d4154b5a2fe908a5bab212146e44c4e2a95a
diff --git a/sem/runner.py b/sem/runner.py index <HASH>..<HASH> 100644 --- a/sem/runner.py +++ b/sem/runner.py @@ -153,9 +153,17 @@ class SimulationRunner(object): end = time.time() # Time execution if execution.returncode > 0: - print('Simulation exited with an error.' - '\nStderr: %s\nStdout: %s' % (execution.stderr, - execution.stdout)) + complete_command = [self.script] + complete_command.extend(command[1:]) + complete_command = "./waf --run \"%s\"" % ' '.join(complete_command) + + raise Exception(('Simulation exited with an error.\n' + 'Params: %s\n' + '\nStderr: %s\n' + 'Stdout: %s\n' + 'Use the following command to reproduce:\n%s' + % (parameter, execution.stderr, + execution.stdout, complete_command))) current_result['time'] = end-start
Provide the user with a command to replicate crashing simulations
signetlabdei_sem
train
py
1f797d54f9616e663ef630c6d8c2b2b531bfb59c
diff --git a/src/web/header.php b/src/web/header.php index <HASH>..<HASH> 100644 --- a/src/web/header.php +++ b/src/web/header.php @@ -46,7 +46,7 @@ function <?php echo $iname; ?>loadMessagesXHROHandler() { for (var i = 0; i < oXMLData.length; i++) { sHTML += "<div class=\"messageblock\">\r\n"; sHTML += " <div class=\"header\">\r\n"; - sHTML += " <div class=\"date_time\">" + oXMLData[i].getElementsByTagName("date_time")[0].childNodes[0].data + "</div>\r\n"; + sHTML += " <div class=\"datetime\">" + oXMLData[i].getElementsByTagName("date_time")[0].childNodes[0].data + "</div>\r\n"; sHTML += " <div class=\"username\"><span class=\"name\">" + oXMLData[i].getElementsByTagName("sendername")[0].childNodes[0].data + "</span> <span class=\"said\">said...</span></div>\r\n"; sHTML += " </div>\r\n";
Consistent class name for datetimes
peeto_DarkChat
train
php
8d01c88edf73bd79bce3c10c3648c0e70489e2ba
diff --git a/tests/PhpCodeExtractorTest.php b/tests/PhpCodeExtractorTest.php index <HASH>..<HASH> 100644 --- a/tests/PhpCodeExtractorTest.php +++ b/tests/PhpCodeExtractorTest.php @@ -17,6 +17,8 @@ class PhpCodeExtractorTest extends PHPUnit_Framework_TestCase $this->assertInstanceOf('Gettext\\Translation', $translations->find(null, 'text 7 (with parenthesis)')); $this->assertInstanceOf('Gettext\\Translation', $translations->find(null, 'text 8 "with escaped double quotes"')); $this->assertInstanceOf('Gettext\\Translation', $translations->find(null, 'text 9 \'with single quotes\'')); + + $this->assertCount(12, $translations); } public function testMultiline() diff --git a/tests/files/phpcode.php b/tests/files/phpcode.php index <HASH>..<HASH> 100644 --- a/tests/files/phpcode.php +++ b/tests/files/phpcode.php @@ -45,3 +45,5 @@ </div> </div> </div>"); +?> +<p><?php __(''); ?></p> \ No newline at end of file
added a simple test for #<I>
oscarotero_Gettext
train
php,php
df3926916e791a95863b86fb423de35724e439ae
diff --git a/ui/ui.js b/ui/ui.js index <HASH>..<HASH> 100644 --- a/ui/ui.js +++ b/ui/ui.js @@ -238,9 +238,12 @@ shaka.ui.Overlay.createUI_ = function(container, video, config) { const player = new shaka.Player(video); const ui = new shaka.ui.Overlay(player, container, video, config); - // If the browser's native controls are disabled, use UI TextDisplayer. + // If the browser's native controls are disabled, use UI TextDisplayer. Right + // now because the factory must be a constructor and () => {} can't be a + // constructor. if (!video.controls) { - player.configure('textDisplayFactory', + player.configure( + 'textDisplayFactory', function() { return new shaka.ui.TextDisplayer(video, container); }); }
Correct Factory-Constructor Syntax Right now because the text displayer factory must be a constructor and () => {} can't be a constructor, we need to change function-syntax used in ui/ui.js. Change-Id: Ib<I>b<I>c5a<I>a<I>ed<I>b1bee<I>dad
google_shaka-player
train
js
0946ad7665fea32fccb7577cba3d8e619dc10e24
diff --git a/squad/core/notification.py b/squad/core/notification.py index <HASH>..<HASH> 100644 --- a/squad/core/notification.py +++ b/squad/core/notification.py @@ -109,5 +109,6 @@ def __send_notification__(project, notification): emails = [r.email for r in recipients] message = EmailMultiAlternatives(subject, text_message, sender, emails) - message.attach_alternative(html_message, "text/html") + if project.html_mail: + message.attach_alternative(html_message, "text/html") message.send() diff --git a/test/core/test_notification.py b/test/core/test_notification.py index <HASH>..<HASH> 100644 --- a/test/core/test_notification.py +++ b/test/core/test_notification.py @@ -149,3 +149,13 @@ class TestSendNotification(TestCase): send_notification(self.project) self.assertEqual(2, len(mail.outbox)) + + def test_send_plain_text_only(self): + self.project.subscriptions.create(email='foo@example.com') + self.project.html_mail = False + self.project.save() + ProjectStatus.create_or_update(self.build2) + + send_notification(self.project) + msg = mail.outbox[0] + self.assertEqual(0, len(msg.alternatives))
core/notification: send plain text-only emails
Linaro_squad
train
py,py
749a56f85b089bfde53db486c50fcd89dbd63dcf
diff --git a/src/redux/urlQueryReducer.js b/src/redux/urlQueryReducer.js index <HASH>..<HASH> 100644 --- a/src/redux/urlQueryReducer.js +++ b/src/redux/urlQueryReducer.js @@ -9,6 +9,9 @@ import UrlUpdateTypes from '../UrlUpdateTypes'; /** * Reducer that handles actions that modify the URL query parameters. * In this case, the actions replace a single query parameter at a time. + * + * NOTE: This is *NOT* a Redux reducer. It does not map from (state, action) -> state. + * Instead it "reduces" actions into URL query parameter state. NOT redux state. */ export default function urlQueryReducer(action, location) { const updateType = action && action.meta && action.meta.updateType;
Clarify urlQueryReducer is not a redux reducer
pbeshai_react-url-query
train
js
f3c81d67319e7acf398e8427b9a51cbf0f44bc40
diff --git a/tests/test_components.py b/tests/test_components.py index <HASH>..<HASH> 100644 --- a/tests/test_components.py +++ b/tests/test_components.py @@ -154,9 +154,6 @@ class ComponentTestCase(TestCase): sorted_out = date_sorted_sources(*sources) - import time - time.sleep(.25) - prev = None sort_count = 0 for msg in sorted_out:
dropped an extraneous sleep in the test
quantopian_zipline
train
py
b23c6bd4103b2df9b20e1fc992b5c93badfedefe
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -98,9 +98,21 @@ function LineCounter(contents) { eolIndex = contents.length - 1; } } - return currentLine; } + + /** + * Returns the location (line-nr and column-nr) of a char index + * within the string. + * @returns {{column: number, line: number} + */ + this.locate = function(charIndex) { + var line = this.countUpTo(charIndex); + return { + column: charIndex - startOfLineIndex, + line: line + } + } } module.exports = LineCounter;
"locate"-function to return line and column-number of a char-index
nknapp_line-counter
train
js
edbcf78ae4885ab528b00b1411f211f5b7ecc386
diff --git a/core/src/main/java/com/datastax/oss/driver/internal/core/DefaultCluster.java b/core/src/main/java/com/datastax/oss/driver/internal/core/DefaultCluster.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/datastax/oss/driver/internal/core/DefaultCluster.java +++ b/core/src/main/java/com/datastax/oss/driver/internal/core/DefaultCluster.java @@ -229,8 +229,7 @@ public class DefaultCluster implements Cluster { connectFuture.complete(session); } }, - adminExecutor) - .exceptionally(UncaughtExceptions::log); + adminExecutor); } }
Remove spurious warning when session creation fails The error is already handled in whenCompleteAsync, no need to warn.
datastax_java-driver
train
java
6a7f1db1180f6b390a7bb9f8d207c93859ba7467
diff --git a/lib/restclient/payload.rb b/lib/restclient/payload.rb index <HASH>..<HASH> 100644 --- a/lib/restclient/payload.rb +++ b/lib/restclient/payload.rb @@ -9,7 +9,7 @@ module RestClient def generate(params) if params.is_a?(String) Base.new(params) - elsif params and params.is_a?(Hash) + elsif params.is_a?(Hash) if params.delete(:multipart) == true || has_file?(params) Multipart.new(params) else
removed a redudndant nil-check in payload.rb
rest-client_rest-client
train
rb
93f6ee80af40d0e9474a1acda6368c46857710af
diff --git a/nodeconductor/structure/models.py b/nodeconductor/structure/models.py index <HASH>..<HASH> 100644 --- a/nodeconductor/structure/models.py +++ b/nodeconductor/structure/models.py @@ -129,7 +129,6 @@ class Customer(core_models.UuidMixin, target_models=lambda: Resource.get_private_cloud_models(), path_to_scope='project.customer', ) - nc_service_project_link_count = quotas_fields.CounterQuotaField( target_models=lambda: ServiceProjectLink.get_all_models(), path_to_scope='project.customer', @@ -332,6 +331,10 @@ class Project(core_models.DescribableMixin, target_models=lambda: Resource.get_vm_models(), path_to_scope='project', ) + nc_private_cloud_count = quotas_fields.CounterQuotaField( + target_models=lambda: Resource.get_private_cloud_models(), + path_to_scope='project', + ) nc_service_project_link_count = quotas_fields.CounterQuotaField( target_models=lambda: ServiceProjectLink.get_all_models(), path_to_scope='project',
Add private cloud quotas on project level too. - SAAS-<I>
opennode_waldur-core
train
py
d7ae8f3e45cf3f053f9095443273e67504809cf8
diff --git a/src/main/QafooLabs/Refactoring/Adapters/Symfony/OutputPatchCommand.php b/src/main/QafooLabs/Refactoring/Adapters/Symfony/OutputPatchCommand.php index <HASH>..<HASH> 100644 --- a/src/main/QafooLabs/Refactoring/Adapters/Symfony/OutputPatchCommand.php +++ b/src/main/QafooLabs/Refactoring/Adapters/Symfony/OutputPatchCommand.php @@ -37,6 +37,10 @@ class OutputPatchCommand implements ApplyPatchCommand */ public function apply($patch) { + if (empty($patch)) { + return; + } + $this->output->writeln($patch); } }
Prevent empty patches to render as line breaks.
QafooLabs_php-refactoring-browser
train
php
cd18936fac69a51eea8ba32ca8c031a4e8689b7d
diff --git a/src/lib/baseClient.js b/src/lib/baseClient.js index <HASH>..<HASH> 100644 --- a/src/lib/baseClient.js +++ b/src/lib/baseClient.js @@ -114,7 +114,7 @@ define([ newValue: value, path: absPath }; - return store.setNodeData(absPath, value, true, undefined, mimeType); + return sync.set(absPath, { data: value, mimeType: mimeType }); }).then(function() { fireModuleEvent('change', moduleName, changeEvent); if(moduleName !== 'root') { diff --git a/src/lib/sync.js b/src/lib/sync.js index <HASH>..<HASH> 100644 --- a/src/lib/sync.js +++ b/src/lib/sync.js @@ -767,7 +767,13 @@ define([ } }, - set: function(path) {}, + set: function(path, node) { + if(caching.cachePath(path)) { + return store.setNodeData(path, node.data, true, undefined, node.mimeType); + } else { + return remoteAdapter.set(path, node); + } + }, remove: function(path) { if(caching.cachePath(path)) {
BaseClient~set calls sync.set instead of talking to store directly now. That way caching are evaluated in a central place. (previously storing directly to remote was broken)
remotestorage_remotestorage.js
train
js,js
9c46cf4ec79c6379b06d9308b279957faa99de72
diff --git a/restapi.go b/restapi.go index <HASH>..<HASH> 100644 --- a/restapi.go +++ b/restapi.go @@ -844,13 +844,13 @@ func (s *Session) GuildMemberEdit(guildID, userID string, roles []string) (err e // GuildMemberMove moves a guild member from one voice channel to another/none // guildID : The ID of a Guild. // userID : The ID of a User. -// channelID : The ID of a channel to move user to, or null? +// channelID : The ID of a channel to move user to or nil to remove from voice channel // NOTE : I am not entirely set on the name of this function and it may change // prior to the final 1.0.0 release of Discordgo -func (s *Session) GuildMemberMove(guildID, userID, channelID string) (err error) { +func (s *Session) GuildMemberMove(guildID string, userID string, channelID *string) (err error) { data := struct { - ChannelID string `json:"channel_id"` + ChannelID *string `json:"channel_id"` }{channelID} _, err = s.RequestWithBucketID("PATCH", EndpointGuildMember(guildID, userID), data, EndpointGuildMember(guildID, ""))
Update GuildMemberMove to support removing from all voice channels (#<I>)
bwmarrin_discordgo
train
go
643e6f5e731186c41841dcb8f4e5cabba8266874
diff --git a/console/apps/install.php b/console/apps/install.php index <HASH>..<HASH> 100644 --- a/console/apps/install.php +++ b/console/apps/install.php @@ -267,8 +267,15 @@ class CORE_NAILS_Install extends CORE_NAILS_App ); $vars[] = array( + 'key' => 'APP_DEFAULT_TIMEZONE', + 'label' => 'App Timezone', + 'value' => date_default_timezone_get(), + 'options' => array() + ); + + $vars[] = array( 'key' => 'APP_PRIVATE_KEY', - 'label' => 'App\'s Private Key', + 'label' => 'App Private Key', 'value' => md5(rand(0,1000) . microtime(true)), 'options' => array() );
Added APP_DEFAULT_TIMEZONE to installer
nails_common
train
php
00f8efb32b3e01d39eac88b2a08f1250602dec0e
diff --git a/FormBuilder.php b/FormBuilder.php index <HASH>..<HASH> 100644 --- a/FormBuilder.php +++ b/FormBuilder.php @@ -189,7 +189,7 @@ class FormBuilder { */ public function input($type, $name, $value = null, $options = array()) { - $options['name'] = $name; + if ( ! isset($options['name'])) $options['name'] = $name; // We will get the appropriate value for the given field. We will look for the // value in the session for the value in the old input data then we'll look
Don't override names if they have been explicitly set.
LaravelCollective_html
train
php
0363b5a8b7c4a232699db80b719c02b6216fc997
diff --git a/batman/transitmodel.py b/batman/transitmodel.py index <HASH>..<HASH> 100644 --- a/batman/transitmodel.py +++ b/batman/transitmodel.py @@ -133,7 +133,7 @@ class TransitModel(object): if nthreads > multiprocessing.cpu_count(): raise Exception("Maximum number of threads is "+'{0:d}'.format(multiprocessing.cpu_count())) elif nthreads <= 1: raise Exception("Number of threads must be between 2 and {0:d}".format(multiprocessing.cpu_count())) else: raise Exception("OpenMP not enabled: do not set the nthreads parameter") - self.ds = _rsky._rsky(self.t_supersample, params.t0, params.per, params.a, params.inc*pi/180., params.ecc, params.w*pi/180., self.transittype, self.nthreads) + self.ds = _rsky._rsky(self.t_supersample, params.t0, params.per, params.a, params.inc*pi/180., params.ecc, params.w*pi/180., self.transittype, self.nthreads) def calc_err(self, plot = False): """
correct tab/spacing inconsistency
lkreidberg_batman
train
py
40f6f38221bdd9f72a49bcd7ad176d351829d0e5
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -34,8 +34,9 @@ setup(name='amibaker', ], }, install_requires=[ - "awsclpy", - "fabric", - "jinja2", + "awsclpy==0.2.2", + "Fabric==1.10.2", + "Jinja2==2.7.3", + "PyYAML==3.11", ], zip_safe=False)
Fixed and improve setup.py dependencies
hamidnazari_amibaker
train
py
f6930d4d0ac08415ff688c10994cc2f6aec55c77
diff --git a/spec/javascripts/jax/model_spec.js b/spec/javascripts/jax/model_spec.js index <HASH>..<HASH> 100644 --- a/spec/javascripts/jax/model_spec.js +++ b/spec/javascripts/jax/model_spec.js @@ -17,6 +17,11 @@ describe("Jax.Model", function() { expect(model.find("name").fired).toBeTrue(); }); + + it("should raise an error when searching for a missing ID", function() { + model.addResources({"one": { } }); + expect(function() { model.find("two") }).toThrow(new Error("Resource 'two' not found!")); + }); it("should assign attribute values", function() { model.addResources({ @@ -29,7 +34,7 @@ describe("Jax.Model", function() { }); it("should instantiate a model without default attributes", function() { - expect(function() { new model(); }).not.toThrow(Error); + expect(function() { new model(); }).not.toThrow(); }); });
An extra (passing) test for Jax.Model
sinisterchipmunk_jax
train
js
5b83036723695d7e5f8feeb9c057a3a174d9b363
diff --git a/netdiff/info.py b/netdiff/info.py index <HASH>..<HASH> 100644 --- a/netdiff/info.py +++ b/netdiff/info.py @@ -1,4 +1,4 @@ -VERSION = (0, 2, 0, 'final') +VERSION = (0, 3, 0, 'alpha') __version__ = VERSION
Updated VERSION to <I> alpha
openwisp_netdiff
train
py
f8a1ba10f57ff1999f1f62ddf1614597f8ce459c
diff --git a/lib/built_in_data.rb b/lib/built_in_data.rb index <HASH>..<HASH> 100644 --- a/lib/built_in_data.rb +++ b/lib/built_in_data.rb @@ -41,8 +41,12 @@ module BuiltInData end def load_yaml_data - # allow a standard key to be used for doing defaults in YAML - YAML.load(read_and_erb_process_yaml_file).except('DEFAULTS') + # allow a standard key to be used for defaults in YAML files + YAML.safe_load( + read_and_erb_process_yaml_file, + permitted_classes: [Date], + aliases: true + ).except('DEFAULTS') end def read_and_erb_process_yaml_file
change yaml load to safe_load
wwidea_built_in_data
train
rb
3554bb96ac7f9a9e5759c382d61809bc8475c33a
diff --git a/lib/chef/knife/cookbook_readme_from.rb b/lib/chef/knife/cookbook_readme_from.rb index <HASH>..<HASH> 100644 --- a/lib/chef/knife/cookbook_readme_from.rb +++ b/lib/chef/knife/cookbook_readme_from.rb @@ -1,12 +1,12 @@ require 'chef/knife' -require 'knife_cookbook_readme/readme_model' +require 'pathname' module KnifeCookbookReadme class CookbookReadmeFrom < Chef::Knife deps do require 'chef/cookbook/metadata' require 'erubis' - require 'pathname' + require 'knife_cookbook_readme/readme_model' end banner 'knife cookbook readme from FILE (options)'
Make use of knife's lazy loader
mlafeldt_knife-cookbook-readme
train
rb
d743e8d59fbac4087757f03c234671f649a0c3fc
diff --git a/sdk/src/main/java/com/wonderpush/sdk/remoteconfig/RemoteConfig.java b/sdk/src/main/java/com/wonderpush/sdk/remoteconfig/RemoteConfig.java index <HASH>..<HASH> 100644 --- a/sdk/src/main/java/com/wonderpush/sdk/remoteconfig/RemoteConfig.java +++ b/sdk/src/main/java/com/wonderpush/sdk/remoteconfig/RemoteConfig.java @@ -68,7 +68,7 @@ public class RemoteConfig { JSONObject data = json.optJSONObject("data"); String version = json.getString("version"); Long maxAge = json.optLong("maxAge", json.optLong("cacheTtl", 0)); - Long minAge = json.optLong("minAge", 0); + Long minAge = json.optLong("minAge", json.optLong("cacheMinAge", 0)); Long fetchTime = json.optLong("fetchDate", DateHelper.now().getTime()); return RemoteConfig.with(data == null ? new JSONObject() : data, version, new Date(fetchTime), maxAge, minAge); } catch (JSONException e) {
support for alt syntax "cacheMinAge"
wonderpush_wonderpush-android-sdk
train
java
bc465f467d0f3ccbf03c1b49ea2b2ecb04c0c765
diff --git a/peewee.py b/peewee.py index <HASH>..<HASH> 100644 --- a/peewee.py +++ b/peewee.py @@ -528,6 +528,10 @@ class PostgresqlDatabase(Database): AND relname=%s""", (sequence,)) return bool(res.fetchone()[0]) + def set_search_path(self, *search_path): + path_params = ','.join(['%s'] * len(search_path)) + self.execute('SET search_path TO %s' % path_params, search_path) + class MySQLDatabase(Database): def __init__(self, database, **connect_kwargs): @@ -2729,4 +2733,4 @@ class Model(object): obj = self.select(fields).get(**{self._meta.pk_name: self.get_pk()}) for field_name in fields: - setattr(self, field_name, getattr(obj, field_name)) \ No newline at end of file + setattr(self, field_name, getattr(obj, field_name))
Adding a method for setting the schema search path when using psql
coleifer_peewee
train
py
fdb8ade003d71cbbafc8317636803434ebad57ed
diff --git a/gremlin-core/src/main/java/com/tinkerpop/gremlin/util/iterator/IteratorUtils.java b/gremlin-core/src/main/java/com/tinkerpop/gremlin/util/iterator/IteratorUtils.java index <HASH>..<HASH> 100644 --- a/gremlin-core/src/main/java/com/tinkerpop/gremlin/util/iterator/IteratorUtils.java +++ b/gremlin-core/src/main/java/com/tinkerpop/gremlin/util/iterator/IteratorUtils.java @@ -64,11 +64,7 @@ public class IteratorUtils { } public static <S> List<S> list(final Iterator<S> iterator) { - final List<S> list = new ArrayList<>(); - while (iterator.hasNext()) { - list.add(iterator.next()); - } - return list; + return fill(iterator, new ArrayList<S>()); } ///////////////
Refactor list() method in IteratorUtils to use fill()
apache_tinkerpop
train
java
8df01295c5da0c08a0ac7e14d86129991b58c4ff
diff --git a/classes/fields/pick.php b/classes/fields/pick.php index <HASH>..<HASH> 100644 --- a/classes/fields/pick.php +++ b/classes/fields/pick.php @@ -221,10 +221,12 @@ class PodsField_Pick extends PodsField { 'groupby' => pods_var( 'pick_groupby', $options, null, null, true ) ) ); - foreach ( $results as $result ) { - $result = get_object_vars( $result ); + if ( !empty( $data->table ) ) { + foreach ( $results as $result ) { + $result = get_object_vars( $result ); - $options[ 'data' ][ $result[ $data->field_id ] ] = $result[ $data->field_index ]; + $options[ 'data' ][ $result[ $data->field_id ] ] = $result[ $data->field_index ]; + } } }
Quick patch to avoid errors if table is empty
pods-framework_pods
train
php
fc40bbaa05220497aa24fb37d7c994bbfee73353
diff --git a/lib/OpenLayers/Feature/Vector.js b/lib/OpenLayers/Feature/Vector.js index <HASH>..<HASH> 100644 --- a/lib/OpenLayers/Feature/Vector.js +++ b/lib/OpenLayers/Feature/Vector.js @@ -322,8 +322,6 @@ OpenLayers.Feature.Vector = OpenLayers.Class(OpenLayers.Feature, { * - strokeLinecap: "round", [butt | round | square] * - strokeDashstyle: "solid", [dot | dash | dashdot | longdash | longdashdot | solid] * - pointRadius: 6, - * - hoverPointRadius: 1, - * - hoverPointUnit: "%", * - pointerEvents: "visiblePainted" * - cursor: "" *
These too, right? Unimplemented property docs (see r<I>). git-svn-id: <URL>
openlayers_openlayers
train
js
7d24b7fcbf57e7c393e0c9af740ab9054b2b3258
diff --git a/org.jgrapes.portal/src/org/jgrapes/portal/PortalLocalBackedKVStore.java b/org.jgrapes.portal/src/org/jgrapes/portal/PortalLocalBackedKVStore.java index <HASH>..<HASH> 100644 --- a/org.jgrapes.portal/src/org/jgrapes/portal/PortalLocalBackedKVStore.java +++ b/org.jgrapes.portal/src/org/jgrapes/portal/PortalLocalBackedKVStore.java @@ -78,7 +78,7 @@ public class PortalLocalBackedKVStore extends Component { channel.setAssociated(PortalLocalBackedKVStore.class, event); String keyStart = portalPrefix + PortalLocalBackedKVStore.class.getName() + "/"; - fire(new JsonOutput("retrieveLocalData", keyStart), channel); + channel.respond(new JsonOutput("retrieveLocalData", keyStart)); } @Handler @@ -126,8 +126,8 @@ public class PortalLocalBackedKVStore extends Component { data.remove(action.key()); } } - fire(new JsonOutput("storeLocalData", - new Object[] { actions.toArray() }), channel); + channel.respond(new JsonOutput("storeLocalData", + new Object[] { actions.toArray() })); } @Handler
Use proper queue for JsonOutput events.
mnlipp_jgrapes
train
java
1e1d90b7dfc7b6b193fd62de5f3b4885dadcd5b3
diff --git a/worldengine/draw.py b/worldengine/draw.py index <HASH>..<HASH> 100644 --- a/worldengine/draw.py +++ b/worldengine/draw.py @@ -801,6 +801,6 @@ def draw_scatter_plot_on_file(world, filename): def draw_satellite_on_file(world, filename): - img = ImagePixelSetter(world.width, world.height, filename) + img = PNGWriter(world.width, world.height, filename) draw_satellite(world, img) img.complete()
Updated satellite-drawing routine to use the new PNGWriter-class.
Mindwerks_worldengine
train
py
9c498282d82fbda7ccb3cb3a8960fb2720bdb1ce
diff --git a/src/Contracts/Client.php b/src/Contracts/Client.php index <HASH>..<HASH> 100644 --- a/src/Contracts/Client.php +++ b/src/Contracts/Client.php @@ -8,15 +8,6 @@ use Psr\Http\Message\ResponseInterface; interface Client { /** - * Use custom API Endpoint. - * - * @param string $endpoint - * - * @return $this - */ - public function useCustomApiEndpoint(string $endpoint); - - /** * Get API endpoint URL. * * @return string
Remove useCustomApiEndpoint from contract.
laravie_codex
train
php
2440bab3f8ff427b60819cf0f81bd97131da681d
diff --git a/lib/draw/Renderer.js b/lib/draw/Renderer.js index <HASH>..<HASH> 100644 --- a/lib/draw/Renderer.js +++ b/lib/draw/Renderer.js @@ -64,6 +64,8 @@ Renderer.prototype.drawCell = function drawCell(gfx, data) { } else if(!!data.content.tagName) { gfx.childNodes[0].appendChild(data.content); } + } else { + gfx.childNodes[0].textContent = ''; } this._eventBus.fire('cell.render', {
fix(renderer): update empty cells related to CAM-<I>, CAM-<I>
bpmn-io_table-js
train
js
e52973655883b351a4382b577a361b07c3085556
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -2,6 +2,7 @@ # -*- encoding:utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals +import codecs import re from setuptools import setup @@ -11,16 +12,17 @@ def get_version(filename): """ Return package version as listed in `__version__` in `filename`. """ - init_py = open(filename).read() + with codecs.open(filename, 'r', 'utf-8') as fp: + init_py = fp.read() return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1) version = get_version('flake8_tidy_imports.py') -with open('README.rst') as readme_file: +with codecs.open('README.rst', 'r', 'utf-8') as readme_file: readme = readme_file.read() -with open('HISTORY.rst') as history_file: +with codecs.open('HISTORY.rst', 'r', 'utf-8') as history_file: history = history_file.read() setup(
setup.py - use codecs.open and context manager
adamchainz_flake8-tidy-imports
train
py
80128781c2de9bf096d115b846b80d86bf0a778a
diff --git a/imdb.class.php b/imdb.class.php index <HASH>..<HASH> 100644 --- a/imdb.class.php +++ b/imdb.class.php @@ -10,7 +10,7 @@ * @author Fabian Beiner (mail [AT] fabian-beiner [DOT] de) * @license MIT License * -* @version 4.4.1 (September 28th, 2010) +* @version 4.4.2 (September 30th, 2010) * */
Forgot to change version number... :)
FabianBeiner_PHP-IMDB-Grabber
train
php
422df648baa859c5ad4499f26c5c0143fadc2152
diff --git a/src/collection/index.js b/src/collection/index.js index <HASH>..<HASH> 100644 --- a/src/collection/index.js +++ b/src/collection/index.js @@ -7,24 +7,17 @@ var Element = require('./element'); // factory for generating edge ids when no id is specified for a new element var idFactory = { - prefix: { - nodes: 'n', - edges: 'e' - }, - id: { - nodes: 0, - edges: 0 - }, + prefix: 'ele', + id: 0, generate: function(cy, element, tryThisId){ var json = is.element( element ) ? element._private : element; - var group = json.group; - var id = tryThisId != null ? tryThisId : this.prefix[group] + this.id[group]; + var id = tryThisId != null ? tryThisId : this.prefix + this.id; if( cy.getElementById(id).empty() ){ - this.id[group]++; // we've used the current id, so move it up + this.id++; // we've used the current id, so move it up } else { // otherwise keep trying successive unused ids while( !cy.getElementById(id).empty() ){ - id = this.prefix[group] + ( ++this.id[group] ); + id = this.prefix + ( ++this.id ); } }
fixes autogenerated ids with inferred group
cytoscape_cytoscape.js
train
js
11f3fac890a5ef7e0087667cfa400bc036fd03da
diff --git a/lib/resque/worker.rb b/lib/resque/worker.rb index <HASH>..<HASH> 100644 --- a/lib/resque/worker.rb +++ b/lib/resque/worker.rb @@ -181,7 +181,7 @@ module Resque def reserve queues.each do |queue| log! "Checking #{queue}" - if job = Resque::Job.reserve(queue) + if job = Resque.reserve(queue) log! "Found job on #{queue}" return job end
Make worker use global Resque.reserve method to allow for a single point of override.
resque_resque
train
rb
62fffcb30e6b7448eb8990b607e7c06f2d685ad9
diff --git a/openid/fetchers.py b/openid/fetchers.py index <HASH>..<HASH> 100644 --- a/openid/fetchers.py +++ b/openid/fetchers.py @@ -6,12 +6,12 @@ This module contains the HTTP fetcher interface and several implementations. __all__ = ['fetch', 'getDefaultFetcher', 'setDefaultFetcher', 'HTTPResponse', 'HTTPFetcher', 'createHTTPFetcher', 'HTTPFetchingError', 'HTTPError'] - try: - import urllib2 -except: # Python 3 import urllib.request as urllib2 +except ImportError: + import urllib2 + import time import cStringIO import sys
Reverse order of import checks -- should keep 2to3 from messing things up
necaris_python3-openid
train
py
e51ccff1643d1b5e5a750cb27c229de9de77f70c
diff --git a/lib/sinatra/main.rb b/lib/sinatra/main.rb index <HASH>..<HASH> 100644 --- a/lib/sinatra/main.rb +++ b/lib/sinatra/main.rb @@ -17,7 +17,7 @@ module Sinatra op.on('-e env') { |val| set :environment, val.to_sym } op.on('-s server') { |val| set :server, val } op.on('-p port') { |val| set :port, val.to_i } - op.on('-b addr') { |val| set :bind, val } + op.on('-o addr') { |val| set :bind, val } }.parse!(ARGV.dup) end end
use -o over -b to set bind address to match rackup behavior
sinatra_sinatra
train
rb
b66854db0d9bf6cfc454e2f43bb8c4983960bd6d
diff --git a/code/libraries/koowa/components/com_activities/controller/behavior/loggable.php b/code/libraries/koowa/components/com_activities/controller/behavior/loggable.php index <HASH>..<HASH> 100644 --- a/code/libraries/koowa/components/com_activities/controller/behavior/loggable.php +++ b/code/libraries/koowa/components/com_activities/controller/behavior/loggable.php @@ -92,8 +92,7 @@ class ComActivitiesControllerBehaviorLoggable extends KControllerBehaviorAbstrac $config = new KObjectConfig(array( 'row' => $row, 'status' => $status, - 'context' => $command, - 'event' => $name)); + 'command' => $command)); try { $this->getObject($this->_controller)->add($this->_getActivityData($config)); @@ -119,11 +118,11 @@ class ComActivitiesControllerBehaviorLoggable extends KControllerBehaviorAbstrac */ protected function _getActivityData(KObjectConfig $config) { - $context = $config->context; - $identifier = $this->getActivityIdentifier($context); + $command = $config->command; + $identifier = $this->getActivityIdentifier($command); $data = array( - 'action' => $context->action, + 'action' => $command->action, 'application' => $identifier->domain, 'type' => $identifier->type, 'package' => $identifier->package,
Synced with FW changes. Replaced context with command.
joomlatools_joomlatools-framework
train
php
3ca2072e80fd1dd6cceffee0fa2b762f00240c27
diff --git a/php-typography/class-php-typography.php b/php-typography/class-php-typography.php index <HASH>..<HASH> 100644 --- a/php-typography/class-php-typography.php +++ b/php-typography/class-php-typography.php @@ -2185,7 +2185,7 @@ class PHP_Typography { if ( ! empty( $func ) && ! empty( $func['substr'] ) ) { return preg_replace( $this->regex['controlCharacters'], '', $func['substr']( $previous_textnode->data, - 1 ) ); } - } // @codeCoverageIgnore. + } // @codeCoverageIgnore return ''; } @@ -2206,7 +2206,7 @@ class PHP_Typography { if ( ! empty( $func ) && ! empty( $func['substr'] ) ) { return preg_replace( $this->regex['controlCharacters'], '', $func['substr']( $next_textnode->data, 0, 1 ) ); } - } // @codeCoverageIgnore. + } // @codeCoverageIgnore return ''; }
Code coverage pragma fix
mundschenk-at_php-typography
train
php
3c09a4879d63f9823167072569276304609e6d7a
diff --git a/lib/handlers.js b/lib/handlers.js index <HASH>..<HASH> 100644 --- a/lib/handlers.js +++ b/lib/handlers.js @@ -38,7 +38,6 @@ export const handlers = { list, listItem, text, - escape: text, // To do: remove next major linkReference: reference, imageReference: reference, table, @@ -56,10 +55,7 @@ const p = macro('P', '\n') * @returns {string} */ function textDecoration(enter, value, exit) { - // Previously, remark sometimes gave empty nodes. - /* c8 ignore next */ - const clean = String(value || '') - return '\\f' + enter + clean + '\\f' + exit + return '\\f' + enter + value + '\\f' + exit } /**
Remove ancient remark fallbacks
remarkjs_remark-man
train
js
34bd539faa4a377196754e11cfe059f9a7fea600
diff --git a/insights/specs/sos_archive.py b/insights/specs/sos_archive.py index <HASH>..<HASH> 100644 --- a/insights/specs/sos_archive.py +++ b/insights/specs/sos_archive.py @@ -92,6 +92,8 @@ class SosSpecs(Specs): 'sos_commands/general/subscription-manager_list_--installed'] ) sysctl = simple_file("sos_commands/kernel/sysctl_-a") + systemctl_list_unit_files = simple_file("sos_commands/systemd/systemctl_list-unit-files") + systemctl_list_units = simple_file("sos_commands/systemd/systemctl_list-units") uname = simple_file("sos_commands/kernel/uname_-a") uptime = simple_file("sos_commands/general/uptime") vgdisplay = simple_file("vgdisplay")
Copied simple file specs changes from insights_archive to sos_archive (#<I>)
RedHatInsights_insights-core
train
py
91d05082e43008f2617d468fdd6c0de95855fe7f
diff --git a/actionpack/lib/action_dispatch/middleware/params_parser.rb b/actionpack/lib/action_dispatch/middleware/params_parser.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_dispatch/middleware/params_parser.rb +++ b/actionpack/lib/action_dispatch/middleware/params_parser.rb @@ -38,8 +38,6 @@ module ActionDispatch request.params_parsers = @parsers - request.request_parameters - @app.call(env) end end
stop eagerly parsing parameters Parameters will not be parsed until they are specifically requested via the `request_parameters` method.
rails_rails
train
rb
abea49d8fac715d5548f1dae79c36382fc5c6f8e
diff --git a/dynect/client.go b/dynect/client.go index <HASH>..<HASH> 100644 --- a/dynect/client.go +++ b/dynect/client.go @@ -167,7 +167,7 @@ func (c *Client) Do(method, endpoint string, requestData, responseData interface switch resp.StatusCode { case 200: - if resp.ContentLength == 0 || resp.ContentLength == -1 { + if resp.ContentLength == 0 { // Zero-length content body? log.Println("dynect: warning: zero-length response body; skipping decoding of response") return nil
Remove resp.ContentLength == -1 check It looks like -1 this is valid in this situation, from the net.http docs: // ContentLength records the length of the associated content. The // value -1 indicates that the length is unknown. Unless Request.Method // is "HEAD", values >= 0 indicate that the given number of bytes may // be read from Body. ContentLength int<I> and the Dyn API isn't returning a COntent-Length header
nesv_go-dynect
train
go
9e70d6279fee015aefffebfa7c8c606308ad9142
diff --git a/src/structures/Guild.js b/src/structures/Guild.js index <HASH>..<HASH> 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -542,12 +542,12 @@ class Guild { * @example * // see how many members will be pruned * guild.pruneMembers(12, true) - * .then(pruned => console.log(`This will prune ${pruned} people!`); + * .then(pruned => console.log(`This will prune ${pruned} people!`)) * .catch(console.error); * @example * // actually prune the members * guild.pruneMembers(12) - * .then(pruned => console.log(`I just pruned ${pruned} people!`); + * .then(pruned => console.log(`I just pruned ${pruned} people!`)) * .catch(console.error); */ pruneMembers(days, dry = false) {
Fix erroneous docs examples (#<I>)
discordjs_discord.js
train
js
b52ff4e014db3720e1af36135438b841bdf478cb
diff --git a/exemelopy/__version__.py b/exemelopy/__version__.py index <HASH>..<HASH> 100644 --- a/exemelopy/__version__.py +++ b/exemelopy/__version__.py @@ -1,4 +1,4 @@ __author__ = 'Phillip B Oldham' __author_email__ = 'phillip.oldham@gmail.com' -__version__ = '0.0.2' +__version__ = '0.0.3' __licence__ = 'MIT'
small version bump to reflect updates from FWRD
OldhamMade_exemelopy
train
py
ecd238e91846f3197ec7a441fa6a1f18eeb438b4
diff --git a/test/specs/modules/Search/Search-test.js b/test/specs/modules/Search/Search-test.js index <HASH>..<HASH> 100644 --- a/test/specs/modules/Search/Search-test.js +++ b/test/specs/modules/Search/Search-test.js @@ -462,7 +462,7 @@ describe('Search', () => { searchResultsIsOpen() // click outside - domEvent.click(document) + domEvent.click(document.body) searchResultsIsClosed() })
test(Search): fix tests on second run (#<I>)
Semantic-Org_Semantic-UI-React
train
js
dbab44ae41afabc029183ab9a2bf6aac34a66972
diff --git a/backends/etcdv3/client.go b/backends/etcdv3/client.go index <HASH>..<HASH> 100644 --- a/backends/etcdv3/client.go +++ b/backends/etcdv3/client.go @@ -26,6 +26,11 @@ func NewEtcdClient(machines []string, cert, key, caCert string, basicAuth bool, DialTimeout: 5 * time.Second, } + if basicAuth { + cfg.Username = username + cfg.Password = password + } + tlsEnabled := false tlsConfig := &tls.Config{ InsecureSkipVerify: false,
support etcdv3 basicauth
kelseyhightower_confd
train
go
2a500edc8267942c364e5df5fa83ab7a94fbf53c
diff --git a/pysyge/pysyge.py b/pysyge/pysyge.py index <HASH>..<HASH> 100644 --- a/pysyge/pysyge.py +++ b/pysyge/pysyge.py @@ -392,7 +392,7 @@ class GeoLocator: upon `detailed` flag state. """ - if type(ip) is str: + if isinstance(ip, str): seek = self._get_pos(ip) if seek > 0: return self._parse_location(seek, detailed=detailed)
Check type chaged for isinstance
idlesign_pysyge
train
py
b23931095592c0accbba45ee9ca70467745788db
diff --git a/partridge/utilities.py b/partridge/utilities.py index <HASH>..<HASH> 100644 --- a/partridge/utilities.py +++ b/partridge/utilities.py @@ -6,15 +6,6 @@ import pandas as pd from pandas.core.common import flatten -__all__ = [ - "detect_encoding", - "empty_df", - "lru_cache", - "remove_node_attributes", - "setwrap", -] - - def empty_df(columns=None): columns = [] if columns is None else columns empty = {col: [] for col in columns}
Remove __all__ import directive from utilities.py It's not necessary since we've moved functools lru_cache import in the last commit.
remix_partridge
train
py
039b78647e8c3581caed9842e7e61f352eaf39c7
diff --git a/www/javascript/swat-calendar.js b/www/javascript/swat-calendar.js index <HASH>..<HASH> 100644 --- a/www/javascript/swat-calendar.js +++ b/www/javascript/swat-calendar.js @@ -532,6 +532,18 @@ SwatCalendar.prototype.draw = function() yyyy = yyyy + 1900; } + // sanity check. make sure the date is in the valid range + var display_date = new Date(yyyy, mm - 1, dd); + if (display_date < this.start_date) { + yyyy = this.start_date.getFullYear(); + mmm = this.start_date.getMonth() + 1; + dd = this.start_date.getDate(); + } else if (display_date >= this.end_date) { + yyyy = this.end_date.getFullYear(); + mm = this.end_date.getMonth() + 1; + dd = this.end_date.getDate(); + } + var new_date = new Date(yyyy, mm - 1, 1); var start_day = new_date.getDay();
Add sanity check to prevent drawing months outside the valid range. svn commit r<I>
silverorange_swat
train
js
28401ac94948684da78a8e5f8f046d51340d5009
diff --git a/src/Event/Event.php b/src/Event/Event.php index <HASH>..<HASH> 100644 --- a/src/Event/Event.php +++ b/src/Event/Event.php @@ -198,6 +198,10 @@ class Event extends EventSourcedAggregateRoot public function deleteTranslation( Language $language ) { + if (!array_key_exists($language->getCode(), $this->translations)) { + return; + } + $this->apply( new TranslationDeleted( new String($this->eventId),
III-<I>: Ensure translation removal of a translation that doesn't exist does not result in additional events
cultuurnet_udb3-php
train
php
6663b9d1e3043011b43564212690d0aaf0c7bfb0
diff --git a/lib/weblib.php b/lib/weblib.php index <HASH>..<HASH> 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1298,6 +1298,7 @@ function wikify_links($string) { function fix_non_standard_entities($string) { $text = preg_replace('/&#0*([0-9]+);?/', '&#$1;', $string); $text = preg_replace('/&#x0*([0-9a-fA-F]+);?/', '&#x$1;', $text); + $text = preg_replace('/\p{Cc}/u', ' ', $text); return $text; }
MDL-<I> fix invalid XML unicode characters when uses KSES filtering - credit goes to Jenny Gray
moodle_moodle
train
php
31e83fe4ab53c40371d1744e4b4cfae8375ef2c7
diff --git a/indra/tools/reading/util/__init__.py b/indra/tools/reading/util/__init__.py index <HASH>..<HASH> 100644 --- a/indra/tools/reading/util/__init__.py +++ b/indra/tools/reading/util/__init__.py @@ -0,0 +1,17 @@ +def get_s3_root(s3_base, job_queue="run_db_reading_queue"): + return s3_base + 'logs/%s/' % job_queue + + +def get_s3_job_prefix(s3_base, job_name, job_queue="run_db_reading_queue"): + s3_root = get_s3_root(s3_base, job_queue) + return s3_root + '%s/' % job_name + + +def get_s3_and_job_prefixes(base_name, group_name=None): + """Returns the s3 prefix and job prefix.""" + if not group_name: + s3_base = base_name + job_base = base_name + else: + s3_base, job_base = [group_name + d + base_name for d in ['/', '_']] + return 'reading_results/' + s3_base + '/', job_base
Move functions that regularize s3 naming into indra. These functions used to live in indra_db.
sorgerlab_indra
train
py
50023ad11d50909cdd08e4814d630ed18d7a4af7
diff --git a/lib/faraday.rb b/lib/faraday.rb index <HASH>..<HASH> 100644 --- a/lib/faraday.rb +++ b/lib/faraday.rb @@ -14,7 +14,7 @@ require 'forwardable' # conn.get '/' # module Faraday - VERSION = "0.9.0.rc3" + VERSION = "0.9.0.rc4" class << self # Public: Gets or sets the root path that Faraday is being loaded from.
Release <I>.rc4
lostisland_faraday
train
rb
9998e9ea190eeb5647e97a5a4d07bca1ab6c94a7
diff --git a/cmd/api-response.go b/cmd/api-response.go index <HASH>..<HASH> 100644 --- a/cmd/api-response.go +++ b/cmd/api-response.go @@ -24,10 +24,10 @@ import ( ) const ( - timeFormatAMZ = "2006-01-02T15:04:05.000Z" // Reply date format - maxObjectList = 1000 // Limit number of objects in a listObjectsResponse. - maxUploadsList = 1000 // Limit number of uploads in a listUploadsResponse. - maxPartsList = 1000 // Limit number of parts in a listPartsResponse. + timeFormatAMZ = "2006-01-02T15:04:05Z" // Reply date format + maxObjectList = 1000 // Limit number of objects in a listObjectsResponse. + maxUploadsList = 1000 // Limit number of uploads in a listUploadsResponse. + maxPartsList = 1000 // Limit number of parts in a listPartsResponse. ) // LocationResponse - format for location response.
api: Response timeFormat do not need to have nano-second precision. Fixes an error reported by s3verify.
minio_minio
train
go
356beb34b8f2224f8c63165c6e99d9f84c51fac2
diff --git a/lib/police_state.rb b/lib/police_state.rb index <HASH>..<HASH> 100644 --- a/lib/police_state.rb +++ b/lib/police_state.rb @@ -6,6 +6,7 @@ module PoliceState extend ActiveSupport::Concern included do + raise ArgumentError, "Including class must implement ActiveModel::Dirty" unless include?(ActiveModel::Dirty) extend HelperMethods end diff --git a/spec/police_state_spec.rb b/spec/police_state_spec.rb index <HASH>..<HASH> 100644 --- a/spec/police_state_spec.rb +++ b/spec/police_state_spec.rb @@ -1,7 +1,15 @@ require "spec_helper" RSpec.describe PoliceState do - it "is a kind of module" do - expect(PoliceState).to be_kind_of(Module) + describe "inclusion" do + context "when class does not include ActiveModel::Dirty" do + it "raises an ArgumentError" do + expect { + Class.new do + include PoliceState + end + }.to raise_error(ArgumentError) + end + end end end
Raises ArgumentError unless including class implements ActiveModel::Dirty
ianpurvis_police_state
train
rb,rb
cfe94b73bf76e6910b19f00258f8177c42c67b1e
diff --git a/lib/mail/network/retriever_methods/imap.rb b/lib/mail/network/retriever_methods/imap.rb index <HASH>..<HASH> 100644 --- a/lib/mail/network/retriever_methods/imap.rb +++ b/lib/mail/network/retriever_methods/imap.rb @@ -36,7 +36,7 @@ module Mail # #=> Returns the first 10 emails in ascending order # class IMAP < Retriever - require 'net/imap' + require 'net/imap' unless defined?(Net::IMAP) def initialize(values) self.settings = { :address => "localhost", diff --git a/lib/mail/network/retriever_methods/pop3.rb b/lib/mail/network/retriever_methods/pop3.rb index <HASH>..<HASH> 100644 --- a/lib/mail/network/retriever_methods/pop3.rb +++ b/lib/mail/network/retriever_methods/pop3.rb @@ -32,7 +32,7 @@ module Mail # #=> Returns the first 10 emails in ascending order # class POP3 < Retriever - require 'net/pop' + require 'net/pop' unless defined?(Net::POP) def initialize(values) self.settings = { :address => "localhost",
Do not require Net::IMAP or Net::POP if they're already loaded
mikel_mail
train
rb,rb
57486b672ca65d74ce820844fa8621d2819c67bf
diff --git a/org/xbill/DNS/Rcode.java b/org/xbill/DNS/Rcode.java index <HASH>..<HASH> 100644 --- a/org/xbill/DNS/Rcode.java +++ b/org/xbill/DNS/Rcode.java @@ -33,6 +33,9 @@ public static final int NXDOMAIN = 3; /** The operation requested is not implemented */ public static final int NOTIMP = 4; +/** Deprecated synonym for NOTIMP. */ +public static final int NOTIMPL = 4; + /** The operation was refused by the server */ public static final int REFUSED = 5; @@ -78,6 +81,7 @@ static { rcodes.add(SERVFAIL, "SERVFAIL"); rcodes.add(NXDOMAIN, "NXDOMAIN"); rcodes.add(NOTIMP, "NOTIMP"); + rcodes.addAlias(NOTIMP, "NOTIMPL"); rcodes.add(REFUSED, "REFUSED"); rcodes.add(YXDOMAIN, "YXDOMAIN"); rcodes.add(YXRRSET, "YXRRSET");
Make NOTIMPL a synonym for NOTIMP, for compatibility. git-svn-id: <URL>
dnsjava_dnsjava
train
java
1ccdb978d0d9d4f5ea08564f20ea817ccaeb7720
diff --git a/lib/common/constants.js b/lib/common/constants.js index <HASH>..<HASH> 100644 --- a/lib/common/constants.js +++ b/lib/common/constants.js @@ -22,7 +22,7 @@ function constantsFactory (path) { }, Logging: { Colors: { - critcal: 'red', + critical: 'red', error: 'red', warning: 'yellow', info: 'green',
Fix typo for logging.critical coloring constant
RackHD_on-core
train
js
e3709724852cc5de8a8574371239d6aea8a7e0cf
diff --git a/jayschema.js b/jayschema.js index <HASH>..<HASH> 100644 --- a/jayschema.js +++ b/jayschema.js @@ -118,14 +118,24 @@ JaySchema.prototype.getSchema = function(resolvedId) { // ****************************************************************** JaySchema._gatherRefs = function(obj) { var result = []; - var keys = Object.keys(obj); - if (obj.$ref) { result.push(obj.$ref); } - for (var index = 0, len = keys.length; index !== len; ++index) { - var key = keys[index]; - if (typeof obj[key] === 'object') { - result = result.concat(JaySchema._gatherRefs(obj[key])); + + var currentObj = obj; + var keys = Object.keys(currentObj); + var subObjects = []; + + do { + + if (currentObj.hasOwnProperty('$ref')) { result.push(currentObj.$ref); } + + for (var index = 0, len = keys.length; index !== len; ++index) { + var prop = currentObj[keys[index]]; + if (typeof prop === 'object') { subObjects.push(prop); } } - } + + currentObj = subObjects.pop(); + + } while(currentObj); + return result; };
make _gatherRefs non-recursive
natesilva_jayschema
train
js
be8fefe38d1a392b6b78018777d9b02a2c2e541e
diff --git a/src/BayesianModel/BayesianModel.py b/src/BayesianModel/BayesianModel.py index <HASH>..<HASH> 100644 --- a/src/BayesianModel/BayesianModel.py +++ b/src/BayesianModel/BayesianModel.py @@ -333,7 +333,7 @@ class BayesianModel(nx.DiGraph): Checks if all the states of node are present in state_list. If present returns True else returns False. """ - if sorted(states_list) == sorted(self.node[node]['_states']): + if sorted(states_list) == sorted([state['name'] for state in self.node[node]['_states']]): return True else: return False
correct _all_states_present_in_list function
pgmpy_pgmpy
train
py
ad48c3085f267d4b2a3b615b30e0b149d52c514b
diff --git a/src/Database/Traits/CamelCaseModel.php b/src/Database/Traits/CamelCaseModel.php index <HASH>..<HASH> 100644 --- a/src/Database/Traits/CamelCaseModel.php +++ b/src/Database/Traits/CamelCaseModel.php @@ -33,7 +33,7 @@ trait CamelCaseModel public function getAttribute($key) { if (method_exists($this, $key)) { - return $this->getRelationshipFromMethod($key); + return $this->getRelationValue($key); } return parent::getAttribute($this->getSnakeKey($key));
Fixed a bug that was causing problems with relationships
kirkbushell_eloquence
train
php
16c64a0c1e6a93a2010fecce01d8f516d0f81cd7
diff --git a/src/NodeCollection.php b/src/NodeCollection.php index <HASH>..<HASH> 100644 --- a/src/NodeCollection.php +++ b/src/NodeCollection.php @@ -499,6 +499,17 @@ class NodeCollection implements \IteratorAggregate, \Countable, \ArrayAccess { return $this; } + /** + * Apply callback on each element in the node collection. + * + * @param callable $callback Callback to apply on each element. + * @return $this + */ + public function each(callable $callback) { + array_walk($this->nodes, $callback); + return $this; + } + public function __clone() { $copy = []; foreach ($this->nodes as $node) {
Added each method to NodeCollection
grom358_pharborist
train
php
17e9af282aebf3e16a7ebd8541d0e6166584b34a
diff --git a/helpers/copy.go b/helpers/copy.go index <HASH>..<HASH> 100644 --- a/helpers/copy.go +++ b/helpers/copy.go @@ -7,6 +7,8 @@ import ( ) func Copy(sourcePath, destinationPath string) { + Expect(sourcePath).NotTo(BeEmpty()) + Expect(destinationPath).NotTo(BeEmpty()) err := exec.Command("cp", "-a", sourcePath, destinationPath).Run() Expect(err).NotTo(HaveOccurred()) }
Add assertions to ensure source and destination aren't empty
cloudfoundry_inigo
train
go
f6c0ce5ba65633b1fe9ad7de254f284b26cbda38
diff --git a/lib/jsonapi/renderer/document.rb b/lib/jsonapi/renderer/document.rb index <HASH>..<HASH> 100644 --- a/lib/jsonapi/renderer/document.rb +++ b/lib/jsonapi/renderer/document.rb @@ -45,7 +45,7 @@ module JSONAPI def errors_hash {}.tap do |hash| - hash[:errors] = @errors.map(&:as_jsonapi) + hash[:errors] = @errors.flat_map(&:as_jsonapi) end end
Allow arrays of arrays of errors. (#<I>)
jsonapi-rb_jsonapi-renderer
train
rb
84b121db82eec61e34941a5fe2afc54c72bc63ba
diff --git a/salt/state.py b/salt/state.py index <HASH>..<HASH> 100644 --- a/salt/state.py +++ b/salt/state.py @@ -583,6 +583,7 @@ class State(object): self.opts['grains'], self.opts['id'], self.opts['environment'], + pillar=self._pillar_override ) ret = pillar.compile_pillar() if self._pillar_override and isinstance(self._pillar_override, dict):
Make CLI pillar data available to HighState class instances
saltstack_salt
train
py
dc8daa20751f1ca9c590d2d095a65ef0bd430ae4
diff --git a/src/zoid/buttons/util.js b/src/zoid/buttons/util.js index <HASH>..<HASH> 100644 --- a/src/zoid/buttons/util.js +++ b/src/zoid/buttons/util.js @@ -88,20 +88,20 @@ export function applePaySession() : ?ApplePaySessionConfigRequest { listeners.validatemerchant({ validationURL: e.validationURL }); }; - session.onpaymentmethodselected = () => { - listeners.paymentmethodselected(); + session.onpaymentmethodselected = (e) => { + listeners.paymentmethodselected({ paymentMethod: e.paymentMethod }); }; - session.onshippingmethodselected = () => { - listeners.shippingmethodselected(); + session.onshippingmethodselected = (e) => { + listeners.shippingmethodselected({ shippingMethod: e.shippingMethod }); }; - session.onshippingcontactselected = () => { - listeners.shippingcontactselected(); + session.onshippingcontactselected = (e) => { + listeners.shippingcontactselected({ shippingContact: e.shippingContact }); }; session.onpaymentauthorized = (e) => { - listeners.paymentauthorized(e.payment); + listeners.paymentauthorized({ payment: e.payment }); }; session.oncancel = () => {
Update Apple Pay Events (#<I>)
paypal_paypal-checkout-components
train
js
64ad5dd3b6681afe4c3f3438c91dba759baf8292
diff --git a/src/Module.php b/src/Module.php index <HASH>..<HASH> 100644 --- a/src/Module.php +++ b/src/Module.php @@ -189,10 +189,6 @@ abstract class Module unset(self::$modules[$moduleClassName]); } - if ($module->namespace == "") { - throw new Exceptions\ImplementationException("The module " . get_class($module) . ' does not supply the $namespace property'); - } - self::$modules[$moduleClassName] = $module; }
As composer will be handling autoloading I removed the requirement for a module to define a namespace.
RhubarbPHP_Rhubarb
train
php