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
3f070b9c6699424be39c6aabda3db48476bcc2e2
diff --git a/jre_emul/android/libcore/luni/src/main/java/org/apache/harmony/xml/dom/NodeImpl.java b/jre_emul/android/libcore/luni/src/main/java/org/apache/harmony/xml/dom/NodeImpl.java index <HASH>..<HASH> 100644 --- a/jre_emul/android/libcore/luni/src/main/java/org/apache/harmony/xml/dom/NodeImpl.java +++ b/jre_emul/android/libcore/luni/src/main/java/org/apache/harmony/xml/dom/NodeImpl.java @@ -16,6 +16,8 @@ package org.apache.harmony.xml.dom; +import com.google.j2objc.annotations.Weak; + import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; @@ -65,7 +67,7 @@ public abstract class NodeImpl implements Node { * The containing document. This is non-null except for DocumentTypeImpl * nodes created by the DOMImplementation. */ - DocumentImpl document; + @Weak DocumentImpl document; NodeImpl(DocumentImpl document) { this.document = document;
Fix a leak by making NodeImpl.document @Weak.
google_j2objc
train
java
16c4afeafbafd9254e12f8752b7db93293a710f3
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ setup( 'tornado>=4.2,<5', # tchannel deps - 'thriftrw>=0.4,<0.5', + 'thriftrw>=0.4,<0.6', 'threadloop>=1,<2', ], extras_require={
compatibility with thriftrw <I>
uber_tchannel-python
train
py
90e3aaab74cad0a54f842818480fe52a49759b31
diff --git a/documentjs.js b/documentjs.js index <HASH>..<HASH> 100644 --- a/documentjs.js +++ b/documentjs.js @@ -358,7 +358,10 @@ steal('steal', else { // assume its a directory this.files(file, function(path, f){ if(/\.(js|md|markdown)$/.test(f)){ - collection.push( path ) + collection.push( { + src: path, + text: readFile(path) + } ) } }) diff --git a/tags/process.js b/tags/process.js index <HASH>..<HASH> 100644 --- a/tags/process.js +++ b/tags/process.js @@ -111,7 +111,7 @@ steal('steal','../distance',function(s, distance){ // see if it starts with something that looks like a @tag var line = lines[l], match = line.match(matchTag); - + print("--",line) // if we have a tag if ( match ) { // lower case it
creates paths so DocumentJS('can',{}) works
bitovi_documentjs
train
js,js
f0057d508d5bd0412ac892f14cac7bf542e06a41
diff --git a/ipyrad/analysis/window_extracter.py b/ipyrad/analysis/window_extracter.py index <HASH>..<HASH> 100644 --- a/ipyrad/analysis/window_extracter.py +++ b/ipyrad/analysis/window_extracter.py @@ -360,10 +360,14 @@ class WindowExtracter(object): # use provided name else auto gen a name (scaff-start-end) if not name: if isinstance(self._scaffold_idx, int): - self.name = "scaf{}-{}-{}".format( - self._scaffold_idx, - int(self.start), - int(self.end) + # Allow scaffold idxs to be int and don't force to set start/end + if self.end is None: + self.name = "scaf{}".format(self._scaffold_idx) + else: + self.name = "scaf{}-{}-{}".format( + self._scaffold_idx, + int(self.start), + int(self.end) ) else: self.name = "r{}".format(np.random.randint(0, 1e9))
Allow scaffold idxs to be int
dereneaton_ipyrad
train
py
a3c4b59f1190035df98e70635291fce0dc04b91d
diff --git a/pandas/io/tests/test_html.py b/pandas/io/tests/test_html.py index <HASH>..<HASH> 100644 --- a/pandas/io/tests/test_html.py +++ b/pandas/io/tests/test_html.py @@ -358,12 +358,16 @@ class TestReadHtml(tm.TestCase, ReadHtmlMixin): @network def test_multiple_matches(self): + raise nose.SkipTest("pythonxy link seems to have changed") + url = 'http://code.google.com/p/pythonxy/wiki/StandardPlugins' dfs = self.read_html(url, match='Python', attrs={'class': 'wikitable'}) self.assertTrue(len(dfs) > 1) @network def test_pythonxy_plugins_table(self): + raise nose.SkipTest("pythonxy link seems to have changed") + url = 'http://code.google.com/p/pythonxy/wiki/StandardPlugins' dfs = self.read_html(url, match='Python', attrs={'class': 'wikitable'}) zz = [df.iloc[0, 0] for df in dfs]
TST: pythonxs link seems to have changed in test_html.py, skip tests
pandas-dev_pandas
train
py
8ce3f561914d5e8a26b151ecbe3872e854de5d2b
diff --git a/interp/module.go b/interp/module.go index <HASH>..<HASH> 100644 --- a/interp/module.go +++ b/interp/module.go @@ -55,7 +55,7 @@ func (mc ModuleCtx) UnixPath(path string) string { // Use a return error of type ExitStatus to set the exit status. A nil error has // the same effect as ExitStatus(0). If the error is of any other type, the // interpreter will come to a stop. -type ExecModule = func(ctx context.Context, args []string) error +type ExecModule func(ctx context.Context, args []string) error func DefaultExec(ctx context.Context, args []string) error { mc, _ := FromModuleContext(ctx) @@ -263,7 +263,7 @@ func pathExts(env expand.Environ) []string { // Use a return error of type *os.PathError to have the error printed to // stderr and the exit status set to 1. If the error is of any other type, the // interpreter will come to a stop. -type OpenModule = func(ctx context.Context, path string, flag int, perm os.FileMode) (io.ReadWriteCloser, error) +type OpenModule func(ctx context.Context, path string, flag int, perm os.FileMode) (io.ReadWriteCloser, error) func DefaultOpen(ctx context.Context, path string, flag int, perm os.FileMode) (io.ReadWriteCloser, error) { return os.OpenFile(path, flag, perm)
interp: don't use type aliases for functions Type aliases are used to refer to types in other packages. No need for them here.
mvdan_sh
train
go
14b6fdd51eaac14671b1cbd17f69f6cda846557e
diff --git a/src/core/core.scale.js b/src/core/core.scale.js index <HASH>..<HASH> 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -467,6 +467,11 @@ var xTickEnd = this.options.position == "right" ? this.left + 5 : this.right; helpers.each(this.ticks, function(label, index) { + // If the callback returned a null or undefined value, do not draw this line + if (label === undefined || label === null) { + return; + } + var yLineValue = this.getPixelForTick(index); // xvalues for grid lines if (this.options.gridLines.show) {
Bail out, same as the x axis
chartjs_Chart.js
train
js
5123c5df29fe448629cb5bae4de79299e71b6f61
diff --git a/lib/rest-ftp-daemon/jobs/video.rb b/lib/rest-ftp-daemon/jobs/video.rb index <HASH>..<HASH> 100644 --- a/lib/rest-ftp-daemon/jobs/video.rb +++ b/lib/rest-ftp-daemon/jobs/video.rb @@ -59,7 +59,7 @@ module RestFtpDaemon # Read info about source file set_info INFO_SOURCE_CURRENT, source.name begin - movie = FFMPEG::Movie.new(source.path) + movie = FFMPEG::Movie.new(source.path_fs) rescue Errno::ENOENT => exception raise RestFtpDaemon::VideoNotFound, exception.message rescue StandardError => exception
video job: use Location.filepath instead of .path
bmedici_rest-ftp-daemon
train
rb
c476a3d45ccbec07373689284158e59be5a27542
diff --git a/gorilla.py b/gorilla.py index <HASH>..<HASH> 100644 --- a/gorilla.py +++ b/gorilla.py @@ -327,7 +327,6 @@ def patch(destination, name=None, settings=None): data.patches.append(patch) return wrapped - return decorator @@ -380,7 +379,6 @@ def patches(destination, settings=None, traverse_bases=True, data.patches.extend(patches) return wrapped - return decorator @@ -406,7 +404,6 @@ def destination(value): data.override['destination'] = value return wrapped - return decorator @@ -432,7 +429,6 @@ def name(value): data.override['name'] = value return wrapped - return decorator @@ -458,7 +454,6 @@ def settings(**kwargs): data.override.setdefault('settings', {}).update(kwargs) return wrapped - return decorator @@ -486,7 +481,6 @@ def filter(value): data.filter = value return wrapped - return decorator
Make minor stylistic changes Basically unrolling a previous commit since it doesn't validate against PEP8.
christophercrouzet_gorilla
train
py
b9a874bdea2bb28387a6b01ef22363cfcac6638f
diff --git a/src/adapter.js b/src/adapter.js index <HASH>..<HASH> 100644 --- a/src/adapter.js +++ b/src/adapter.js @@ -20,7 +20,9 @@ function createQUnitStartFn (tc, runnerPassedIn) { // eslint-disable-line no-unu var runner = runnerPassedIn || window.QUnit var totalNumberOfTest = 0 var timer = null - var testResult = {} + var testResult = { + errors: [] + } var supportsTestTracking = false var config = (tc.config && tc.config.qunit) || {} var qunitOldTimeout = 13 @@ -98,7 +100,7 @@ function createQUnitStartFn (tc, runnerPassedIn) { // eslint-disable-line no-unu suite: (test.module && [test.module]) || [], success: testResult.success, skipped: test.skipped, - log: testResult.errors || [], + log: testResult.errors, time: new Date().getTime() - timer }
fix: define array prior to array.push (#<I>)
karma-runner_karma-qunit
train
js
35179d009cec10dd1fb15f205fcd467a9f10e771
diff --git a/pyemma/coordinates/tests/test_regspace.py b/pyemma/coordinates/tests/test_regspace.py index <HASH>..<HASH> 100644 --- a/pyemma/coordinates/tests/test_regspace.py +++ b/pyemma/coordinates/tests/test_regspace.py @@ -14,15 +14,17 @@ import numpy as np import pyemma.util.types as types -def RandomDataSource(a=None, b=None, chunksize=1000, n_samples=5, dim=3): - """ - creates random values in intervall [a,b] - """ - data = np.random.random((n_samples, chunksize, dim)) - if a is not None and b is not None: - data *= (b - a) - data += a - return DataInMemory(data) +class RandomDataSource(DataInMemory): + + def __init__(self, a=None, b=None, chunksize=1000, n_samples=5, dim=3): + """ + creates random values in interval [a,b] + """ + data = np.random.random((n_samples, chunksize, dim)) + if a is not None and b is not None: + data *= (b - a) + data += a + super(RandomDataSource, self).__init__(data) class TestRegSpaceClustering(unittest.TestCase):
[test-regspace] derive RandomDataSource from DataInMemory
markovmodel_PyEMMA
train
py
d1a72e8e8654af81dc2ced3356b1a0a670a36076
diff --git a/example.py b/example.py index <HASH>..<HASH> 100644 --- a/example.py +++ b/example.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + # Copyright 2013-2014 DataStax, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/usr/bin/env python - import logging log = logging.getLogger()
Move #! back to top of example.py
datastax_python-driver
train
py
dc06b1dbf381a595dee679321cce29e2cdf30cc4
diff --git a/lib/combi/queue_service.rb b/lib/combi/queue_service.rb index <HASH>..<HASH> 100644 --- a/lib/combi/queue_service.rb +++ b/lib/combi/queue_service.rb @@ -50,7 +50,6 @@ module Combi def publish(*args, &block) @exchange.publish *args do - log "Sent to network drivers: #{args.inspect}" block.call if block_given? end end
Remove very low-level log message to reduce noise
1uptalent_combi
train
rb
30e32d5024bb6ef8b778e5431ed482772433d305
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -38,10 +38,24 @@ def build_ssdeep(): # libtoolize: Install required files for automake returncode = subprocess.call( - "(cd ssdeep-lib && libtoolize && automake --add-missing && autoreconf --force && sh configure && make)", + "(cd ssdeep-lib && libtoolize && autoreconf --force)", shell=True ) if returncode != 0: + # try harder + returncode = subprocess.call( + "(cd ssdeep-lib && automake --add-missing && autoreconf --force)", + shell=True + ) + if returncode != 0: + sys.exit("Failed to reconfigure the project build.") + + returncode = subprocess.call( + "(cd ssdeep-lib && sh configure && make)", + shell=True + ) + + if returncode != 0: sys.exit("Failed while building ssdeep lib.")
build - try harder to build the lib
DinoTools_python-ssdeep
train
py
7cccc250f591703f9e6a0ff1e6a814324f4219e8
diff --git a/docs/src/Form/index.js b/docs/src/Form/index.js index <HASH>..<HASH> 100644 --- a/docs/src/Form/index.js +++ b/docs/src/Form/index.js @@ -28,7 +28,7 @@ class FormExample extends React.Component { { fieldType: 'password', name: 'Password', - helpBlock: 'If you want to make your password strong you could use a password manager', + helpBlock: 'Setting helpBlock can be used to display helpful text', required: true, showLabel: true, validation: function (value) {
Updating help text to something a little more explanatory
mesosphere_reactjs-components
train
js
3319a8c6859cd78c29222d31e5b484a7df467f13
diff --git a/test/index.js b/test/index.js index <HASH>..<HASH> 100644 --- a/test/index.js +++ b/test/index.js @@ -354,6 +354,22 @@ test("Escaping", function() { } }); +test("Escaping \\u2028", function() { + var text = "{{foo}}\u2028{{bar}}"; + var t = Hogan.compile(text); + var s = t.render({foo: 'foo', bar: 'bar'}); + + is(s, "foo\u2028bar", "\\u2028 improperly escaped"); +}); + +test("Escaping \\u2029", function() { + var text = "{{foo}}\u2029{{bar}}"; + var t = Hogan.compile(text); + var s = t.render({foo: 'foo', bar: 'bar'}); + + is(s, "foo\u2029bar", "\\u2029 improperly escaped"); +}); + test("Mustache Injection", function() { var text = "{{foo}}"; var t = Hogan.compile(text);
Add tests for escaping \u<I> and \u<I>.
twitter_hogan.js
train
js
5df978455e047cfe6850212bb4c30c3de22a4d85
diff --git a/symphony/lib/toolkit/class.general.php b/symphony/lib/toolkit/class.general.php index <HASH>..<HASH> 100755 --- a/symphony/lib/toolkit/class.general.php +++ b/symphony/lib/toolkit/class.general.php @@ -489,32 +489,7 @@ ***/ public static function realiseDirectory($path, $mode=0755){ - - if(!empty($path)){ - - if(@file_exists($path) && !@is_dir($path)){ - return false; - - }elseif(!@is_dir($path)){ - - preg_match_all('/([^\/]+)\/?/i', $path, $directories); - - $currDir = ''; - - foreach($directories[0] as $dir){ - - $currDir = $currDir . $dir; - - if(!@file_exists($currDir)){ - if(!mkdir($currDir, intval($mode, 8))){ - return false; - } - } - } - } - } - - return true; + return @mkdir($path, intval($mode, 8), true); } /***
Removed outdated 'General::realiseDirectory()' code, replacing it with a single mkdir call utilising the 'recursive' flag available since PHP <I>
symphonycms_symphony-2
train
php
50852dfbbfe7f7208bea09324cb2c1794295e1bb
diff --git a/superset/datasets/dao.py b/superset/datasets/dao.py index <HASH>..<HASH> 100644 --- a/superset/datasets/dao.py +++ b/superset/datasets/dao.py @@ -79,7 +79,7 @@ class DatasetDAO(BaseDAO): database.get_table(table_name, schema=schema) return True except SQLAlchemyError as ex: # pragma: no cover - logger.error("Got an error %s validating table: %s", str(ex), table_name) + logger.warning("Got an error %s validating table: %s", str(ex), table_name) return False @staticmethod
chore: downgrade expected exception from error to info (#<I>) * chore: reduce number of error logs * info -> warning
apache_incubator-superset
train
py
fe0bab37b0717b96d292c88d90b6795a5e9c27b5
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -199,7 +199,7 @@ Root.prototype.route = function(request, response, callback) { callback = callback || function(err, message) { if (err) return response.error(err, message); - response.error(404, 'cannot find ' + url + '\n'); + response.error(404, 'cannot find ' + request.method + ' ' + url + '\n'); }; var loop = function(err) {
Better info about missing route (#<I>)
mafintosh_root
train
js
9b85b0b82be11926890335ccc66de73cc634208b
diff --git a/python/ray/_private/runtime_env.py b/python/ray/_private/runtime_env.py index <HASH>..<HASH> 100644 --- a/python/ray/_private/runtime_env.py +++ b/python/ray/_private/runtime_env.py @@ -139,9 +139,9 @@ def _hash_modules(path: Path) -> bytes: if not Path(from_file_name).is_dir(): with open(from_file_name, mode="rb") as f: data = f.read(BUF_SIZE) - if not data: - break - md5.update(data) + while len(data) != 0: + md5.update(data) + data = f.read(BUF_SIZE) hash_val = _xor_bytes(hash_val, md5.digest()) return hash_val
[runtime_env] Continue hashing if data is none (#<I>)
ray-project_ray
train
py
fec7e31141def8067a385cb299935e2bfd97bc7c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -21,6 +21,7 @@ setup( install_requires=[ "fonttools>=3.24.0", "attrs>=17.3.0", + "lxml", "typing ; python_version<'3.5'", ], classifiers=[
setup.py: require lxml
fonttools_ufoLib2
train
py
321bd293f16fccfbcd9623b008377b318ad4185a
diff --git a/lib/file-watcher.js b/lib/file-watcher.js index <HASH>..<HASH> 100644 --- a/lib/file-watcher.js +++ b/lib/file-watcher.js @@ -9,6 +9,7 @@ module.exports = { /** * Handle changed files * @param {Object} options + * @param {EventEmitter} emitter * @returns {Function} */ getChangeCallback: function (options, emitter) { @@ -57,8 +58,8 @@ module.exports = { }, /** * Function to be called when watching begins - * @param {Function} log * @param {Object} options + * @param {EventEmitter} emitter * @returns {Function} */ getWatchCallback: function (options, emitter) { @@ -82,11 +83,9 @@ module.exports = { return new Gaze(files); }, /** - * @param {Function} changeFile - * @param {Function} log * @param {Array} files - * @param {socket} io * @param {Object} options + * @param {EventEmitter} emitter */ init: function (files, options, emitter) {
Keep jsdocs in order
BrowserSync_browser-sync
train
js
aff0de6e7fc60daa20df1d63ccb6c771b0dd6999
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -26,7 +26,7 @@ copyright = '2020, bcbio-nextgen contributors' author = 'bcbio-nextgen contributors' # The full version, including alpha/beta/rc tags -version = release = '1.2.0' +version = release = '1.2.4' # -- General configuration --------------------------------------------------- diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ import subprocess import setuptools -VERSION = '1.2.3' +VERSION = '1.2.4' # add bcbio version number and git commit hash of the current revision to version.py try:
Increment version for <I> release.
bcbio_bcbio-nextgen
train
py,py
322594d058549921683c1742a11c0466b62e95f3
diff --git a/clevertap-core/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java b/clevertap-core/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java index <HASH>..<HASH> 100644 --- a/clevertap-core/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java +++ b/clevertap-core/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java @@ -5137,13 +5137,15 @@ public class CleverTapAPI implements CleverTapAPIListener { } /** - * Destroys the current session + * Destroys the current session and resets <i>firstSession</i> flag, if first session lasts more than 20 minutes + * <br><br>For an app like Music Player <li>user installs an app and plays music and then moves to background. + * <li>User then re-launches an App after listening music in background for more than 20 minutes, in this case + * since an app is not yet killed due to background music <i>app installed</i> event must not be raised by SDK */ private void destroySession() { currentSessionId = 0; setAppLaunchPushed(false); if (isFirstSession()) { - // SDK-415 firstSession = false; } getConfigLogger().verbose(getAccountId(), "Session destroyed; Session ID is now 0");
fix(Reinstall tracking): add comments SDK-<I>
CleverTap_clevertap-android-sdk
train
java
ff6419b024ebd14950f9cbc5c95b9e75f4deea86
diff --git a/lib/pavlov/command.rb b/lib/pavlov/command.rb index <HASH>..<HASH> 100644 --- a/lib/pavlov/command.rb +++ b/lib/pavlov/command.rb @@ -1,4 +1,5 @@ require 'active_support/concern' +require_relative 'operation' module Pavlov module Command diff --git a/lib/pavlov/operation.rb b/lib/pavlov/operation.rb index <HASH>..<HASH> 100644 --- a/lib/pavlov/operation.rb +++ b/lib/pavlov/operation.rb @@ -1,6 +1,7 @@ require 'active_support/concern' require 'pavlov/validations' require 'pavlov/helpers' +require_relative 'access_denied' module Pavlov module Operation diff --git a/lib/pavlov/query.rb b/lib/pavlov/query.rb index <HASH>..<HASH> 100644 --- a/lib/pavlov/query.rb +++ b/lib/pavlov/query.rb @@ -1,4 +1,5 @@ require 'active_support/concern' +require_relative 'operation' module Pavlov module Query
Fix for running test against commands and queries.
Factlink_pavlov
train
rb,rb,rb
3b82a94b30ab66317de896f0f180829b435af3d9
diff --git a/includes/generalSettings.php b/includes/generalSettings.php index <HASH>..<HASH> 100644 --- a/includes/generalSettings.php +++ b/includes/generalSettings.php @@ -198,7 +198,7 @@ foreach($eduPages as $p) <i title="<?php esc_attr_e("Shortcode to use in your page", "eduadmin"); ?>">[eduadmin-objectinterest]</i> </td> </tr> - <tr> + <!--<tr> <td><?php echo __("Event interest page", "eduadmin"); ?></td> <td> <select class="form-control" style="width: 300px;" name="eduadmin-interestEventPage" id="eduadmin-interestEventPage"> @@ -223,7 +223,7 @@ foreach($eduPages as $p) <td> <i title="<?php esc_attr_e("Shortcode to use in your page", "eduadmin"); ?>">[eduadmin-eventinterest]</i> </td> - </tr> + </tr>--> </table> <input type="hidden" name="eduadmin-options_have_changed" value="true" /> <p class="submit">
Removed event inquiries, not done yet
MultinetInteractive_EduAdmin-WordPress
train
php
1ba35eb310a07e5ef73971bfb99bddf970c835f0
diff --git a/lib/cfer.rb b/lib/cfer.rb index <HASH>..<HASH> 100644 --- a/lib/cfer.rb +++ b/lib/cfer.rb @@ -57,6 +57,7 @@ module Cfer # @param options [Hash] def converge!(stack_name, options = {}) config(options) + options[:on_failure].upcase! if options[:on_failure] tmpl = options[:template] || "#{stack_name}.rb" cfn = options[:aws_options] || {} @@ -90,7 +91,7 @@ module Cfer end end end - describe! stack_name, options + describe! stack_name, options rescue nil # It's fine if we can't do this. rescue Aws::CloudFormation::Errors::ValidationError => e Cfer::LOGGER.info "CFN validation error: #{e.message}" end
If describe fails at the end of converge, don't panic
seanedwards_cfer
train
rb
073556a6c966f92297e3aefd32af0ba879103adc
diff --git a/cfgrib/dataset.py b/cfgrib/dataset.py index <HASH>..<HASH> 100644 --- a/cfgrib/dataset.py +++ b/cfgrib/dataset.py @@ -283,7 +283,7 @@ def build_geography_coordinates( return geo_dims, geo_shape, geo_coord_vars -def encode_cf_first(data_var_attrs, encode_cf): +def encode_cf_first(data_var_attrs, encode_cf=('parameter', 'time')): coords_map = ENSEMBLE_KEYS[:] if 'parameter' in encode_cf: if 'GRIB_cfName' in data_var_attrs: diff --git a/tests/test_30_dataset.py b/tests/test_30_dataset.py index <HASH>..<HASH> 100644 --- a/tests/test_30_dataset.py +++ b/tests/test_30_dataset.py @@ -55,6 +55,10 @@ def test_dict_merge(): dataset.dict_merge(master, {'two': 3}) +def test_encode_cf_first(): + assert dataset.encode_cf_first({}) + + def test_build_data_var_components_no_encode(): index = messages.FileStream(path=TEST_DATA).index(dataset.ALL_KEYS).subindex(paramId=130) dims, data_var, coord_vars = dataset.build_variable_components(index=index)
<I>% test coverage for dataset.py.
ecmwf_cfgrib
train
py,py
0eb01ad51238faff313eabc7e8470a175cd8e03e
diff --git a/djstripe/models/core.py b/djstripe/models/core.py index <HASH>..<HASH> 100644 --- a/djstripe/models/core.py +++ b/djstripe/models/core.py @@ -2419,3 +2419,7 @@ class Refund(StripeModel): return ( f"{self.human_readable_amount} ({enums.RefundStatus.humanize(self.status)})" ) + + @property + def human_readable_amount(self) -> str: + return get_friendly_currency_amount(self.amount / 100, self.currency) diff --git a/tests/test_refund.py b/tests/test_refund.py index <HASH>..<HASH> 100644 --- a/tests/test_refund.py +++ b/tests/test_refund.py @@ -164,10 +164,7 @@ class RefundTest(AssertStripeFksMixin, TestCase): refund = Refund.sync_from_stripe_data(fake_refund) - self.assertEqual( - f"{refund.human_readable_amount} ({enums.RefundStatus.humanize(fake_refund['status'])})", - str(refund), - ) + self.assertEqual(str(refund), "$20.00 USD (Succeeded)") self.assert_fks(refund, expected_blank_fks=self.default_expected_blank_fks)
Overrode Refund.human_readable_amount This was done so that amount/<I> instead of amount could be passed to it.
dj-stripe_dj-stripe
train
py,py
044d9f351220ad1e2d02b238328cebaf6b75a596
diff --git a/karma.conf.js b/karma.conf.js index <HASH>..<HASH> 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -32,7 +32,7 @@ module.exports = function (config) { } }, reporters: ['progress', 'karma-typescript'], - browsers: ['Chrome', 'Firefox'], + browsers: ['Chrome'], browserStack: { username: process.env.BROWSERSTACK_USERNAME, accessKey: process.env.BROWSERSTACK_KEY
Remove firefox from local testing to speed up local dev. (#<I>) DEV Firefox is covered on travis.
tensorflow_tfjs
train
js
19ea2e37514cef42a8784b86a54ccea09812d927
diff --git a/aws/resource_aws_mq_broker.go b/aws/resource_aws_mq_broker.go index <HASH>..<HASH> 100644 --- a/aws/resource_aws_mq_broker.go +++ b/aws/resource_aws_mq_broker.go @@ -989,6 +989,10 @@ func flattenMQLDAPServerMetadata(apiObject *mq.LdapServerMetadataOutput) []inter } func expandMQLDAPServerMetadata(tfList []interface{}) *mq.LdapServerMetadataInput { + if len(tfList) == 0 || tfList[0] == nil { + return nil + } + apiObject := &mq.LdapServerMetadataInput{} tfMap := tfList[0].(map[string]interface{})
r/mq_broker: Add zero check
terraform-providers_terraform-provider-aws
train
go
dde5867acd2f34f203aa7181a8c7a58f8aff9429
diff --git a/infrastructure/infrastructure.go b/infrastructure/infrastructure.go index <HASH>..<HASH> 100644 --- a/infrastructure/infrastructure.go +++ b/infrastructure/infrastructure.go @@ -92,7 +92,7 @@ func (infra *Infrastructure) createLambdaFunction(svc *lambda.Lambda, roleArn st FunctionName: aws.String("goad"), Handler: aws.String("index.handler"), Role: aws.String(roleArn), - Runtime: aws.String("nodejs"), + Runtime: aws.String("nodejs4.3"), MemorySize: aws.Int64(1536), Publish: aws.Bool(true), Timeout: aws.Int64(300),
and, apparently nodejs(!<I>) was deprecated
goadapp_goad
train
go
2aa6e85ed743df4c3bf38fae55482952048fc427
diff --git a/subchannel.go b/subchannel.go index <HASH>..<HASH> 100644 --- a/subchannel.go +++ b/subchannel.go @@ -26,8 +26,10 @@ import ( "golang.org/x/net/context" ) +// SubChannelOption are used to set options for subchannels. type SubChannelOption func(*SubChannel) +// Isolated is a SubChannelOption that creates an isolated subchannel. func Isolated(s *SubChannel) { s.peers = s.topChannel.peers.newSibling() } @@ -88,6 +90,11 @@ func (c *SubChannel) Peers() *PeerList { return c.peers } +// Isolated returns whether this subchannel is an isolated subchannel. +func (c *SubChannel) Isolated() bool { + return c.topChannel.Peers() != c.peers +} + // Register registers a handler on the subchannel for a service+operation pair func (c *SubChannel) Register(h Handler, operationName string) { c.handlers.register(h, c.ServiceName(), operationName)
Add Isolated to check whether a subchannel is isolated
uber_tchannel-go
train
go
cf12c1c5290aafc70591316d4ce67b1d21d70190
diff --git a/lib/Emitter.php b/lib/Emitter.php index <HASH>..<HASH> 100644 --- a/lib/Emitter.php +++ b/lib/Emitter.php @@ -30,7 +30,7 @@ final class Emitter } /** - * @return \Amp\Promise + * @return \Amp\Iterator */ public function iterate(): Iterator {
Fix annotation (#<I>)
amphp_amp
train
php
0542e5433cc11c30b8864e0c268ad3814baa4c88
diff --git a/src/js/modal.trigger.js b/src/js/modal.trigger.js index <HASH>..<HASH> 100644 --- a/src/js/modal.trigger.js +++ b/src/js/modal.trigger.js @@ -195,6 +195,7 @@ that.waitTimeout = setTimeout(readyToShow, options.waittime); } + var frame = document.getElementById(iframeName); frame.onload = frame.onreadystatechange = function() { $modal.attr('ref', frame.contentWindow.location.href);
* fixed 'frame' ariable declaration in modal.trigger.js.
easysoft_zui
train
js
6a54aa81e23eb51f23db1f0a8bc951869615d7a6
diff --git a/lib/openapi3_parser/nodes/request_body.rb b/lib/openapi3_parser/nodes/request_body.rb index <HASH>..<HASH> 100644 --- a/lib/openapi3_parser/nodes/request_body.rb +++ b/lib/openapi3_parser/nodes/request_body.rb @@ -4,17 +4,21 @@ require "openapi3_parser/node/object" module Openapi3Parser module Nodes + # @see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#requestBodyObject class RequestBody include Node::Object + # @return [String, nil] def description node_data["description"] end + # @return [Map] a map of String: {MediaType}[./MediaType.html] objects def content node_data["content"] end + # @return [Boolean] def required? node_data["required"] end
Documentation for RequestBody node
kevindew_openapi3_parser
train
rb
79f0eff1b7d41b11b33ff8e2f61285cf8c3fbbb0
diff --git a/core/src/main/java/com/graphhopper/reader/osm/conditional/ConditionalTagsInspector.java b/core/src/main/java/com/graphhopper/reader/osm/conditional/ConditionalTagsInspector.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/graphhopper/reader/osm/conditional/ConditionalTagsInspector.java +++ b/core/src/main/java/com/graphhopper/reader/osm/conditional/ConditionalTagsInspector.java @@ -51,10 +51,13 @@ public class ConditionalTagsInspector { this.tagsToCheck.add(tagToCheck + ":conditional"); } - + this.enabledLogs = enabledLogs; - this.permitParser = new ConditionalParser(permittedValues, enabledLogs); - this.restrictiveParser = new ConditionalParser(restrictiveValues, enabledLogs); + + // enable for debugging purposes only as this is too much + boolean logUnsupportedFeatures = false; + this.permitParser = new ConditionalParser(permittedValues, logUnsupportedFeatures); + this.restrictiveParser = new ConditionalParser(restrictiveValues, logUnsupportedFeatures); } static Map<String, Object> createDefaultMapping( Object value )
less logging for #<I>
graphhopper_graphhopper
train
java
d2eebcea08925471e30909a8dd21efdccbbba57a
diff --git a/user-switching.php b/user-switching.php index <HASH>..<HASH> 100644 --- a/user-switching.php +++ b/user-switching.php @@ -158,7 +158,7 @@ class user_switching { # Switch user: if ( switch_to_user( $old_user->ID, self::remember(), false ) ) { - $redirect_to = self::get_redirect(); + $redirect_to = self::get_redirect( $old_user ); if ( $redirect_to ) { wp_safe_redirect( add_query_arg( array( 'user_switched' => 'true', 'switched_back' => 'true' ), $redirect_to ) );
Pass the old user object to `get_redirect()` when switching back, to enable the `login_redirect` filter. See #3.
johnbillion_user-switching
train
php
a816ae1811e43e1582b5fae260dad2682ff94bc5
diff --git a/src/Models/MetadataTrait.php b/src/Models/MetadataTrait.php index <HASH>..<HASH> 100644 --- a/src/Models/MetadataTrait.php +++ b/src/Models/MetadataTrait.php @@ -45,7 +45,13 @@ trait MetadataTrait $tableData = []; - $foo = $connect->getDoctrineSchemaManager()->listTableColumns($table); + $rawFoo = $connect->getDoctrineSchemaManager()->listTableColumns($table); + $foo = []; + foreach ($rawFoo as $key => $val) { + // Work around glitch in Doctrine when reading from MariaDB which added ` characters to root key value + $key = trim($key, '`'); + $foo[$key] = $val; + } foreach ($columns as $column) { // Doctrine schema manager returns columns with lowercased names
Work around glitch in MariaDB and/or Doctrine
Algo-Web_POData-Laravel
train
php
6303105e5f7a105228522a4b9bdd399ef5d53ac9
diff --git a/test/fineuploader/S3Uploads.java b/test/fineuploader/S3Uploads.java index <HASH>..<HASH> 100644 --- a/test/fineuploader/S3Uploads.java +++ b/test/fineuploader/S3Uploads.java @@ -93,7 +93,7 @@ public class S3Uploads extends HttpServlet } // If this is a request to sign a multipart upload-related request, we only need to sign the headers, - // which are passed as the value of a "multipartHeaders" property from Fine Uploader. In this case, + // which are passed as the value of a "headers" property from Fine Uploader. In this case, // we only need to return the signed value. else {
feat(signing S3 requests): use more generic terms when dealing with signatures
FineUploader_fine-uploader
train
java
e141c9a30b8423fce6f8544a482aab0bf2dceb92
diff --git a/src/Model/BlogController.php b/src/Model/BlogController.php index <HASH>..<HASH> 100644 --- a/src/Model/BlogController.php +++ b/src/Model/BlogController.php @@ -10,19 +10,19 @@ use SilverStripe\ORM\PaginatedList; class BlogController extends PageController { - private static $allowed_actions = array( + private static $allowed_actions = [ 'viewArchive', 'rss' - ); + ]; - private static $url_handlers = array( + private static $url_handlers = [ 'archive//$Year!/$Month' => 'viewArchive' - ); + ]; public function index() { $this->blogPosts = $this->getBlogPosts(); - RSSFeed::linkToFeed($this->Link() . 'rss', $this->Title); + RSSFeed::linkToFeed($this->Link() . 'rss/', $this->Title); return $this->render(); }
Add trailing slash for blog
axllent_silverstripe-weblog
train
php
aedabdf0c9f0017f944f4679dd03eaa32559892d
diff --git a/actionHero.js b/actionHero.js index <HASH>..<HASH> 100755 --- a/actionHero.js +++ b/actionHero.js @@ -93,7 +93,7 @@ actionHero.prototype.start = function(params, next){ orderedInitializers['_complete'] = function(){ if(self.api.configData.general.developmentMode == true){ - self.api.log("running in development mode", "info") + self.api.log("running in development mode", "notice") } self.api.running = true; var starters = [];
add a note about running in development mode (notice)
actionhero_actionhero
train
js
6f187903522dc629c4c4f3171775f83021dcc4e5
diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go index <HASH>..<HASH> 100644 --- a/bridge/slack/slack.go +++ b/bridge/slack/slack.go @@ -187,6 +187,25 @@ func (b *Bslack) Send(msg config.Message) (string, error) { b.sc.UpdateMessage(schannel.ID, ts[1], message) return "", nil } + + if msg.Extra != nil { + // check if we have files to upload (from slack, telegram or mattermost) + if len(msg.Extra["file"]) > 0 { + var err error + for _, f := range msg.Extra["file"] { + fi := f.(config.FileInfo) + _, err = b.sc.UploadFile(slack.FileUploadParameters{ + Reader: bytes.NewReader(*fi.Data), + Filename: fi.Name, + Channels: []string{schannel.ID}, + }) + if err != nil { + flog.Errorf("uploadfile %#v", err) + } + } + } + } + _, id, err := b.sc.PostMessage(schannel.ID, message, np) if err != nil { return "", err
Add support to upload files to slack, from bridges with private urls like slack/mattermost/telegram. (slack)
42wim_matterbridge
train
go
0e063fe41a809c5dd21bdc180b12dd6b18e77042
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -142,8 +142,6 @@ class InstallWithConfigurations(install): log.error("\nWARNING: Could not install SoS Kernel as %s user." % self.user) log.info('And "sos -h" to start using Script of Scripts.') -exec(open('pysos/_version.py').read()) - setup(name = "sos", version = __version__, description = 'Script of Scripts (SoS): a lightweight workflow system for the creation of readable workflows',
Remove duplicated code in setup.py. We should have actually just removed the import pysos line
vatlab_SoS
train
py
01e8d15428d27a2ad5b247dad4805c9947c93c4e
diff --git a/salt/runners/thin.py b/salt/runners/thin.py index <HASH>..<HASH> 100644 --- a/salt/runners/thin.py +++ b/salt/runners/thin.py @@ -2,7 +2,7 @@ ''' The thin runner is used to manage the salt thin systems. -Salt Thin is a transport-less version of Salt that can be used to run rouitines +Salt Thin is a transport-less version of Salt that can be used to run routines in a standalone way. This runner has tools which generate the standalone salt system for easy consumption. '''
[doc] typo on runners/thin.py
saltstack_salt
train
py
d60ab60a64bbca95630c53148c542d85b707a45d
diff --git a/src/SDP/AssetRelation.php b/src/SDP/AssetRelation.php index <HASH>..<HASH> 100644 --- a/src/SDP/AssetRelation.php +++ b/src/SDP/AssetRelation.php @@ -59,7 +59,7 @@ class SDP_AssetRelation extends Pluf_Model ), 'description' => array( 'type' => 'Pluf_DB_Field_Varchar', - 'blank' => false, + 'blank' => true, 'size' => 250, 'editable' => true, 'readable' => true
Field "description" is edited to be not required
pluf_cms
train
php
bc19f2e1f98883f648caa8df721a69db715c3fcd
diff --git a/db/migrate/20141215203425_add_column_moderator_id_to_group.rb b/db/migrate/20141215203425_add_column_moderator_id_to_group.rb index <HASH>..<HASH> 100644 --- a/db/migrate/20141215203425_add_column_moderator_id_to_group.rb +++ b/db/migrate/20141215203425_add_column_moderator_id_to_group.rb @@ -3,7 +3,13 @@ class AddColumnModeratorIdToGroup < ActiveRecord::Migration add_column :groups, :moderator_id, :integer Group.all.each do |group| - moderator = ThinkFeelDoDashboard::Moderator.where(group_id: group.id).first + + if defined?(ThinkFeelDoDashboard::Moderator) + moderator = ThinkFeelDoDashboard::Moderator.where(group_id: group.id).first + else + moderator = nil + end + if moderator group.update_attributes(moderator_id: moderator.user_id) else
updated migration to check to see if class exists
NU-CBITS_think_feel_do_dashboard
train
rb
be2c707a4c170063599c3f73d1de55f2652345a2
diff --git a/test/integration/apiserver/apiserver_test.go b/test/integration/apiserver/apiserver_test.go index <HASH>..<HASH> 100644 --- a/test/integration/apiserver/apiserver_test.go +++ b/test/integration/apiserver/apiserver_test.go @@ -246,6 +246,7 @@ func TestCacheControl(t *testing.T) { if err != nil { t.Fatal(err) } + defer resp.Body.Close() cc := resp.Header.Get("Cache-Control") if !strings.Contains(cc, "private") { t.Errorf("expected private cache-control, got %q", cc) @@ -291,6 +292,7 @@ func TestHSTS(t *testing.T) { if err != nil { t.Fatal(err) } + defer resp.Body.Close() cc := resp.Header.Get("Strict-Transport-Security") if !strings.Contains(cc, "max-age=31536000; includeSubDomains") { t.Errorf("expected max-age=31536000; includeSubDomains, got %q", cc)
integration: TestCacheControl and TestHSTS close the ResponseBody
kubernetes_kubernetes
train
go
f50d6626a988238426456427b07d364137f452e1
diff --git a/cas-server-core/src/main/java/org/jasig/cas/ticket/TicketGrantingTicketImpl.java b/cas-server-core/src/main/java/org/jasig/cas/ticket/TicketGrantingTicketImpl.java index <HASH>..<HASH> 100644 --- a/cas-server-core/src/main/java/org/jasig/cas/ticket/TicketGrantingTicketImpl.java +++ b/cas-server-core/src/main/java/org/jasig/cas/ticket/TicketGrantingTicketImpl.java @@ -18,6 +18,7 @@ */ package org.jasig.cas.ticket; +import com.google.common.collect.ImmutableMap; import org.apache.commons.lang3.builder.EqualsBuilder; import org.jasig.cas.authentication.Authentication; import org.jasig.cas.authentication.principal.Service; @@ -153,7 +154,7 @@ public final class TicketGrantingTicketImpl extends AbstractTicket implements Ti */ @Override public synchronized Map<String, Service> getServices() { - return Collections.unmodifiableMap(this.services); + return ImmutableMap.copyOf(this.services); } /**
fixed immutable reference to the services map
apereo_cas
train
java
801c1bda90bef8b6893a72e3223f118b08eafc63
diff --git a/src/treemap.js b/src/treemap.js index <HASH>..<HASH> 100644 --- a/src/treemap.js +++ b/src/treemap.js @@ -10,7 +10,7 @@ var modes = { }; function padNone(node) { - return {x: node.x, y: node.y, dx: node.dx, dy: node.dy}; + return node; } function padStandard(node, padding) {
Use identity function for padNone. Since we don’t modify rect.
d3_d3-hierarchy
train
js
24c33269972824d10b12d0317da7c1f19c65f96d
diff --git a/wffweb/src/main/java/com/webfirmframework/wffweb/css/BorderColorCssValues.java b/wffweb/src/main/java/com/webfirmframework/wffweb/css/BorderColorCssValues.java index <HASH>..<HASH> 100644 --- a/wffweb/src/main/java/com/webfirmframework/wffweb/css/BorderColorCssValues.java +++ b/wffweb/src/main/java/com/webfirmframework/wffweb/css/BorderColorCssValues.java @@ -367,10 +367,8 @@ public class BorderColorCssValues extends AbstractBean<BorderColorCssValues> 16); // Long.parseLong("FFFFFF", 16) gives 16777215L; final long maxCssValue = 16777215L; - if (value > maxCssValue || value < 0) { - return false; - } - return true; + + return !(value > maxCssValue || value < 0); } catch (final NumberFormatException ex) { }
Code improvement Avoided unnecessary if..then..else statements when returning booleans
webfirmframework_wff
train
java
978c8cfdc52b5ac15a87507ae4c4680e9a36af2e
diff --git a/lib/dalli/cas/client.rb b/lib/dalli/cas/client.rb index <HASH>..<HASH> 100644 --- a/lib/dalli/cas/client.rb +++ b/lib/dalli/cas/client.rb @@ -1 +1 @@ -puts "You can remove `require 'dalli/cas/client'` as this code has been rolled into the standard 'dalli/client'. +puts "You can remove `require 'dalli/cas/client'` as this code has been rolled into the standard 'dalli/client'."
Fix SyntaxError: unterminated string meets end of file This is meant to be a deprecation warning, but currently any code that loads this file will raise a SyntaxError.
petergoldstein_dalli
train
rb
25f9134154d31fade1b1f02b817698a77e6f4ee7
diff --git a/test/multisig/commands/prepare_multisig_transfer_test.py b/test/multisig/commands/prepare_multisig_transfer_test.py index <HASH>..<HASH> 100644 --- a/test/multisig/commands/prepare_multisig_transfer_test.py +++ b/test/multisig/commands/prepare_multisig_transfer_test.py @@ -4,6 +4,7 @@ from __future__ import absolute_import, division, print_function, \ from unittest import TestCase +import filters as f from filters.test import BaseFilterTestCase from iota import Address, ProposedTransaction from iota.adapter import MockAdapter @@ -178,8 +179,33 @@ class PrepareMultisigTransferRequestFilterTestCase(BaseFilterTestCase): """ Request contains unexpected parameters. """ - # :todo: Implement test. - self.skipTest('Not implemented yet.') + self.assertFilterErrors( + { + 'changeAddress': + Address(self.trytes_1), + + 'multisigInput': + MultisigAddress( + digests = [self.digest_1, self.digest_2], + trytes = self.trytes_2, + ), + + 'transfers': + [ + ProposedTransaction( + address = Address(self.trytes_3), + value = 42, + ), + ], + + # Oh come on! + 'foo': 'bar', + }, + + { + 'foo': [f.FilterMapper.CODE_EXTRA_KEY], + }, + ) def test_fail_transfers_null(self): """
[#<I>] Documented handling of unexpected param.
iotaledger_iota.lib.py
train
py
08a7fcf1cd8285683c47140b36b3d181e9448273
diff --git a/tests/conftest.py b/tests/conftest.py index <HASH>..<HASH> 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,9 +1,14 @@ import pytest import os +# Note that we have to do this *before* `pipenv.environments` gets imported, +# which is why we're doing it here as a side effect of importing this module. +# CI=1 is necessary as a workaround for https://github.com/pypa/pipenv/issues/4909 +os.environ['CI'] = '1' + def pytest_sessionstart(session): - # CI=1 is necessary as a workaround for https://github.com/pypa/pipenv/issues/4909 - os.environ['CI'] = '1' + import pipenv.environments + assert pipenv.environments.PIPENV_IS_CI @pytest.fixture()
Oops, set the `CI` environment variable even earlier. If I do something like `pytest tests/integration/test_cli.py`, something about the ordering of imports means that `pipenv.environments` gets loaded *before* `pytest_sessionstart` runs, which means that `pipenv.environments.PIPENV_IS_CI` ends up false.
pypa_pipenv
train
py
38abc11c5aa4452c84839cd892edcb1cb3d54f1e
diff --git a/libcentrifugo/handlers.go b/libcentrifugo/handlers.go index <HASH>..<HASH> 100644 --- a/libcentrifugo/handlers.go +++ b/libcentrifugo/handlers.go @@ -233,6 +233,7 @@ func (conn *wsConn) Send(message []byte) error { } func (conn *wsConn) Close(status uint32, reason string) error { + conn.ws.WriteControl(websocket.CloseMessage, websocket.FormatCloseMessage(int(status), reason), time.Now().Add(time.Second)) return conn.ws.Close() } @@ -274,8 +275,7 @@ func (app *Application) RawWebsocketHandler(w http.ResponseWriter, r *http.Reque } err = c.message(message) if err != nil { - logger.ERROR.Println(err) - conn.Close(CloseStatus, "error handling message") + conn.Close(CloseStatus, err.Error()) break } }
send close frame with proper close reason to raw ws conn
centrifugal_centrifugo
train
go
00797cc23b5b3ea81c8cac42bf1eced41ac3fefa
diff --git a/builder/googlecompute/startup.go b/builder/googlecompute/startup.go index <HASH>..<HASH> 100644 --- a/builder/googlecompute/startup.go +++ b/builder/googlecompute/startup.go @@ -21,7 +21,7 @@ GetMetadata () { echo "$(curl -f -H "Metadata-Flavor: Google" ${BASEMETADATAURL}/${1} 2> /dev/null)" } -ZONE=$(GetMetadata zone | grep -oP "[^/]*$") +ZONE=$(basename $(GetMetadata zone)) SetMetadata () { gcloud compute instances add-metadata ${HOSTNAME} --metadata ${1}=${2} --zone ${ZONE}
Update to how zone is extracted from metadata
hashicorp_packer
train
go
2bde8feb85f12c49b96e9d585fe61c7599e3f9f7
diff --git a/src/main/java/org/codehaus/mojo/aspectj/AbstractAjcCompiler.java b/src/main/java/org/codehaus/mojo/aspectj/AbstractAjcCompiler.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/codehaus/mojo/aspectj/AbstractAjcCompiler.java +++ b/src/main/java/org/codehaus/mojo/aspectj/AbstractAjcCompiler.java @@ -469,7 +469,7 @@ public abstract class AbstractAjcCompiler extends AbstractAjcMojo { } ArtifactHandler artifactHandler = project.getArtifact().getArtifactHandler(); - if (!"java".equalsIgnoreCase(artifactHandler.getLanguage())) { + if (!forceAjcCompile && !"java".equalsIgnoreCase(artifactHandler.getLanguage())) { getLog().warn("Not executing aspectJ compiler as the project is not a Java classpath-capable package"); return; }
Issue #<I> - Skipping POM packaging check when forcing ACP compilation. (#<I>)
mojohaus_aspectj-maven-plugin
train
java
fecb8586d90e0d412cf7325ff385d98d24b33331
diff --git a/src/BoomCMS/Core/Page/Query.php b/src/BoomCMS/Core/Page/Query.php index <HASH>..<HASH> 100644 --- a/src/BoomCMS/Core/Page/Query.php +++ b/src/BoomCMS/Core/Page/Query.php @@ -12,6 +12,8 @@ class Query 'tag' => 'Tag', 'template' => 'Template', 'uri' => 'uri', + 'relatedbytags' => 'RelatedByTags', + 'visibleinnavigation' => 'VisibleInNavigation', ]; /** @@ -28,6 +30,8 @@ class Query public function addFilters($finder, array $params) { foreach ($params as $param => $args) { + $param = strtolower($param); + if (isset($this->filterAliases[$param])) { $class = 'BoomCMS\Core\Page\Finder\\' . $this->filterAliases[$param];
Added more options to page query aliases
boomcms_boom-core
train
php
663f388d7b478f43e046d00f6426b2c36b2f7d39
diff --git a/javascript/linkfield.js b/javascript/linkfield.js index <HASH>..<HASH> 100644 --- a/javascript/linkfield.js +++ b/javascript/linkfield.js @@ -63,7 +63,7 @@ jQuery.entwine("linkfield", function($) { }); }, onunmatch: function () { - $('.linkfield-dialog').remove(); + $('.linkfield-dialog.ui-dialog-content').remove(); }, showDialog: function(url) { var dlg = this.getDialog();
remove only dialog box/es have been created (don't remove .linkfield-dialog div which is not a dialog box)
sheadawson_silverstripe-linkable
train
js
3ea54f5c490461e3b323ee42b2c85b405f09a0e4
diff --git a/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java b/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java index <HASH>..<HASH> 100644 --- a/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java +++ b/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java @@ -331,8 +331,6 @@ public class RNPushNotificationHelper { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { // API 26 and higher channel_id = channel_id + "-" + soundName; - - notification.setChannelId(channel_id); } } } @@ -383,6 +381,7 @@ public class RNPushNotificationHelper { checkOrCreateChannel(notificationManager, channel_id, soundUri, priority, vibratePattern); + notification.setChannelId(channel_id); notification.setContentIntent(pendingIntent); JSONArray actionsArray = null;
Fix channel_id of notification.
zo0r_react-native-push-notification
train
java
5e16c0f87e8ff6e0ff6c72b20494fec893309a5f
diff --git a/js/jquery.fileupload-image.js b/js/jquery.fileupload-image.js index <HASH>..<HASH> 100644 --- a/js/jquery.fileupload-image.js +++ b/js/jquery.fileupload-image.js @@ -272,7 +272,7 @@ var file = data.files[data.index], blob = new Blob([ data.imageHead, - // Resized images always have a head size of 20, + // Resized images always have a head size of 20 bytes, // including the JPEG marker and a minimal JFIF header: this._blobSlice.call(file, 20) ], {type: file.type});
Added unit to head size comment.
blueimp_jQuery-File-Upload
train
js
cb894c8ce9d6374c635b559abdc8978e8de2fefd
diff --git a/lib/image.js b/lib/image.js index <HASH>..<HASH> 100644 --- a/lib/image.js +++ b/lib/image.js @@ -3,6 +3,7 @@ module.exports = image; var debug = require('debug')('inliner'); function image(url) { + url = url.replace(/#.*$/, ''); this.emit('progress', 'get image ' + url); return this.get(url, { encoding: 'binary' }).then(function then(res) { if (url.indexOf('data:') === 0) {
fix: ignore fragment identifiers on urls Since the cache is keyyed by URL, it makes sense to ignore the hash fragment identifier.
remy_inliner
train
js
9627e9d74bb6e69c20f14d54beece5ab5c2d6b39
diff --git a/lib/govspeak/template_renderer.rb b/lib/govspeak/template_renderer.rb index <HASH>..<HASH> 100644 --- a/lib/govspeak/template_renderer.rb +++ b/lib/govspeak/template_renderer.rb @@ -17,7 +17,7 @@ module Govspeak def t(*args) options = args.last.is_a?(Hash) ? args.last.dup : {} key = args.shift - I18n.t!(key, options.merge(locale: locale)) + I18n.t!(key, **options.merge(locale: locale)) end def format_with_html_line_breaks(string)
Use splat to pass keyword arguments into method This fixes the following deprecation notice which appeared in the move from Ruby <I> to <I>: ``` lib/govspeak/template_renderer.rb:<I>: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call ```
alphagov_govspeak
train
rb
42584e05b4d2ec60a6fee65eca3e92354d6b6c8d
diff --git a/socketio/server.py b/socketio/server.py index <HASH>..<HASH> 100644 --- a/socketio/server.py +++ b/socketio/server.py @@ -31,7 +31,12 @@ class SocketIOServer(WSGIServer): is set to true. The default value is 0.0.0.0:843 """ self.sockets = {} - self.resource = kwargs.pop('resource', 'socket.io') + if 'namespace' in kwargs: + print("DEPRECATION WARNING: use resource instead of namespace") + self.resource = kwargs.pop('namespace', 'socket.io') + else: + self.resource = kwargs.pop('resource', 'socket.io') + self.transports = kwargs.pop('transports', None) if kwargs.pop('policy_server', True):
support old naming of namespace for now
abourget_gevent-socketio
train
py
96ec24e56a99f744b83d9669d43294a0a5136f7d
diff --git a/grpc_stdio.go b/grpc_stdio.go index <HASH>..<HASH> 100644 --- a/grpc_stdio.go +++ b/grpc_stdio.go @@ -134,6 +134,7 @@ func (c *grpcStdioClient) Run(stdout, stderr io.Writer) { if err != nil { if err == io.EOF || status.Code(err) == codes.Unavailable || + status.Code(err) == codes.Canceled || err == context.Canceled { c.log.Warn("received EOF, stopping recv loop", "err", err) return
Exit stdio read loop on status code canceled too
hashicorp_go-plugin
train
go
0a67b745be4eeb756160e6fa690e6551e0dde5ab
diff --git a/actionpack/lib/action_controller/metal/redirecting.rb b/actionpack/lib/action_controller/metal/redirecting.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_controller/metal/redirecting.rb +++ b/actionpack/lib/action_controller/metal/redirecting.rb @@ -42,8 +42,8 @@ module ActionController # redirect_to :action=>'atom', :status => 302 # # The status code can either be a standard {HTTP Status code}[http://www.iana.org/assignments/http-status-codes] as an - # integer, or a symbol representing the downcased, underscored and symbolized description. Note that the status code - # must be a 3xx HTTP code, or redirection will not occur. + # integer, or a symbol representing the downcased, underscored and symbolized description. + # Note that the status code must be a 3xx HTTP code, or redirection will not occur. # # It is also possible to assign a flash message as part of the redirection. There are two special accessors for commonly used the flash names # +alert+ and +notice+ as well as a general purpose +flash+ bucket.
Tweak linebreak in ActionController::Redirecting doc
rails_rails
train
rb
17a5a4502155d4163d2a44ad4f5316b45f8846c4
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -130,7 +130,7 @@ setup( 'matplotlib==3.0.3 ; python_version < "3.6"', # required for visualizing layer graph (< py36) 'requests', # required for TextA export and WebTagger 'tqdm', # progressbar: for showing progress on time-hungry operations - 'ipython>=7.17.0 ; python_version > "3.6"', # required for integration with Jupyter Notebook-s (> py36) + 'ipython ; python_version > "3.6"', # required for integration with Jupyter Notebook-s (> py36) 'ipython< 7.17.0 ; python_version == "3.6"', # required for integration with Jupyter Notebook-s (= py36) # Specific package requirements for specific Python versions 'conllu>=3.1.1 ; python_version >= "3.6"', # CONLLU for syntax
Updated setup.py: removed ipython version contraint for py><I> (problematic in colab)
estnltk_estnltk
train
py
848776c3da0e4c45d77ad573bb2a250845522b96
diff --git a/railties/lib/rails/generators/named_base.rb b/railties/lib/rails/generators/named_base.rb index <HASH>..<HASH> 100644 --- a/railties/lib/rails/generators/named_base.rb +++ b/railties/lib/rails/generators/named_base.rb @@ -31,6 +31,8 @@ module Rails protected attr_reader :file_name + # FIXME: We are avoiding to use alias because a bug on thor that make + # this method public and add it to the task list. def singular_name file_name end
Add FIXME note about the thor bug
rails_rails
train
rb
2aabd309c711dcb1bbd1db5167deaab6eba21b45
diff --git a/zipkin-ui/js/component_ui/timeStamp.js b/zipkin-ui/js/component_ui/timeStamp.js index <HASH>..<HASH> 100644 --- a/zipkin-ui/js/component_ui/timeStamp.js +++ b/zipkin-ui/js/component_ui/timeStamp.js @@ -12,7 +12,7 @@ export default component(function timeStamp() { }; this.setDateTime = function(time) { - this.$date.val(time.format('MM-DD-YYYY')); + this.$date.val(time.format('YYYY-MM-DD')); this.$time.val(time.format('HH:mm')); }; @@ -27,7 +27,7 @@ export default component(function timeStamp() { }; this.timeChanged = function() { - const time = moment(this.$date.val(), 'MM-DD-YYYY'); + const time = moment(this.$date.val(), 'YYYY-MM-DD'); time.add(moment.duration(this.$time.val())); this.setTimestamp(moment.utc(time)); }; @@ -36,7 +36,7 @@ export default component(function timeStamp() { this.init(); this.on(this.$time, 'change', this.timeChanged); this.$date - .datepicker({format: 'mm-dd-yyyy'}) + .datepicker({format: 'yyyy-mm-dd'}) .on('changeDate', this.dateChanged.bind(this)); }); });
zipkin-ui: change date-picker form to yyyy-mm-dd (#<I>) This is closer to ISO <I>, more widely accepted, and disambiguates day and month.
apache_incubator-zipkin
train
js
4a3e295e24f58d41a4201d591a953b995ec9a00d
diff --git a/src/Input.php b/src/Input.php index <HASH>..<HASH> 100644 --- a/src/Input.php +++ b/src/Input.php @@ -14,7 +14,7 @@ class Input public function __construct($request = null) { if (empty($request)) { - $this->request = Request::createFromGlobals(); + $this->request = Request::createFromGlobals(); } else { $this->request = $request; }
Added shortcuts for accessing $_GET / $_POST array.
werx_core
train
php
61f4b5aa8927c224eacc7e9e87f63e67c4aea1dc
diff --git a/accounts/abi/bind/base.go b/accounts/abi/bind/base.go index <HASH>..<HASH> 100644 --- a/accounts/abi/bind/base.go +++ b/accounts/abi/bind/base.go @@ -256,13 +256,10 @@ func (c *BoundContract) transact(opts *TransactOpts, contract *common.Address, i return nil, errors.New("maxFeePerGas or maxPriorityFeePerGas specified but london is not active yet") } if opts.GasPrice == nil { - price, err := c.transactor.SuggestGasTipCap(ensureContext(opts.Context)) + price, err := c.transactor.SuggestGasPrice(ensureContext(opts.Context)) if err != nil { return nil, err } - if head.BaseFee != nil { - price.Add(price, head.BaseFee) - } opts.GasPrice = price } }
accounts/abi/bind: fix gas price suggestion with pre EIP-<I> clients (#<I>) This fixes transaction sending in the case where an app using go-ethereum <I> is talking to a pre-EIP-<I> RPC node. In this case, the eth_maxPriorityFeePerGas endpoint is not available and we can only rely on eth_gasPrice.
ethereum_go-ethereum
train
go
e93a7cc0a194fbcd14ff4270057258d7bc819857
diff --git a/admin/controllers/Settings.php b/admin/controllers/Settings.php index <HASH>..<HASH> 100644 --- a/admin/controllers/Settings.php +++ b/admin/controllers/Settings.php @@ -101,7 +101,7 @@ class Settings extends BaseAdmin // -------------------------------------------------------------------------- // Get data - $this->data['aSettings'] = appSetting(null, Constants::MODULE_SLUG, true); + $this->data['aSettings'] = appSetting(null, Constants::MODULE_SLUG, null, true); // --------------------------------------------------------------------------
Fixes for AppSettings
nails_module-email
train
php
0674a545d2f45aa1a47cc62ee75e78bb5f2f4e02
diff --git a/integration/integration_suite_test.go b/integration/integration_suite_test.go index <HASH>..<HASH> 100644 --- a/integration/integration_suite_test.go +++ b/integration/integration_suite_test.go @@ -38,7 +38,7 @@ var _ = SynchronizedBeforeSuite(func() []byte { return nil }, func(_ []byte) { // Ginkgo Globals - SetDefaultEventuallyTimeout(3 * time.Second) + SetDefaultEventuallyTimeout(5 * time.Second) // Setup common environment variables apiURL = os.Getenv("CF_API")
change default timeout to 5 seconds for integration tests
cloudfoundry_cli
train
go
3a21477500aaacd713c1ecb3421acaad8fd41d88
diff --git a/src/nodeHandler.js b/src/nodeHandler.js index <HASH>..<HASH> 100644 --- a/src/nodeHandler.js +++ b/src/nodeHandler.js @@ -9,7 +9,8 @@ module.exports = function(req, callback){ url: req.url, method: req.method, headers: req.headers, - body: req.body + body: req.body, + followRedirect: false }, function(error, res, body){ var response; if(res){
disable automatic redirect handling in node request
FamilySearch_fs-js-lite
train
js
e0800efd4af67d6ecd2deaae41e01cd6af9aeff2
diff --git a/swagger_parser/swagger_parser.py b/swagger_parser/swagger_parser.py index <HASH>..<HASH> 100755 --- a/swagger_parser/swagger_parser.py +++ b/swagger_parser/swagger_parser.py @@ -27,7 +27,8 @@ class SwaggerParser(object): paths: dict of path with their actions, parameters, and responses. """ - _HTTP_VERBS = {'get', 'put', 'post', 'delete', 'options', 'head', 'patch'} + _HTTP_VERBS = set('get', 'put', 'post', 'delete', 'options', 'head', + 'patch') def __init__(self, swagger_path=None, swagger_dict=None, use_example=True): """Run parsing from either a file or a dict.
fixed syntax issue breaking Python <I> The `{foo, bar}` syntax for set literals was introduced in Python <I>. This should make the code work again for Python <I>.
Trax-air_swagger-parser
train
py
200e2f5934b356a5aef8cccbad30c3449a152eb7
diff --git a/datecalc-jdk/src/main/java/net/objectlab/kit/datecalc/jdk/CalendarPeriodCountCalculator.java b/datecalc-jdk/src/main/java/net/objectlab/kit/datecalc/jdk/CalendarPeriodCountCalculator.java index <HASH>..<HASH> 100644 --- a/datecalc-jdk/src/main/java/net/objectlab/kit/datecalc/jdk/CalendarPeriodCountCalculator.java +++ b/datecalc-jdk/src/main/java/net/objectlab/kit/datecalc/jdk/CalendarPeriodCountCalculator.java @@ -85,7 +85,7 @@ public class CalendarPeriodCountCalculator implements PeriodCountCalculator<Cale private int dayDiff(final Calendar start, final Calendar end) { final long diff = Math.abs(start.getTimeInMillis() - end.getTimeInMillis()); final double dayDiff = ((double) diff) / MILLIS_IN_DAY; - return (int) (dayDiff); + return (int) Math.round(dayDiff); } public double monthDiff(final Calendar start, final Calendar end, final PeriodCountBasis basis) {
fixed the problem with the <I>/<I> days... on to the standardizing the timezone - local vs. UTC
Appendium_objectlabkit
train
java
a8c196df97654bd60a872c59acddd893a06f57fc
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ with open(os.path.join(__location__, 'metadata.py'), 'r') as f: setup( - name=metadata['name'], + name='tableprint', url=metadata['url'], version=metadata['version'], diff --git a/tableprint/metadata.py b/tableprint/metadata.py index <HASH>..<HASH> 100644 --- a/tableprint/metadata.py +++ b/tableprint/metadata.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- # Version info -__name__ = 'tableprint' -__version__ = '0.6.7' +__version__ = '0.6.8' __license__ = 'MIT' # Project description(s)
removing __name__ from metadata
nirum_tableprint
train
py,py
93d58cb2fff8e61e09d57b446675cfd61c085e3e
diff --git a/src/Zephyrus/Network/RouterEngine.php b/src/Zephyrus/Network/RouterEngine.php index <HASH>..<HASH> 100644 --- a/src/Zephyrus/Network/RouterEngine.php +++ b/src/Zephyrus/Network/RouterEngine.php @@ -44,10 +44,12 @@ abstract class RouterEngine /** * Keeps references of request uri and request method + * + * @param Request $request */ - public function __construct() + public function __construct(Request $request) { - $this->request = RequestFactory::create(); + $this->request = $request; $this->requestedUri = $this->request->getPath(); $this->requestedMethod = $this->request->getMethod(); $this->requestedRepresentation = $this->request->getAccept();
Injected request dependency to RouterEngine
dadajuice_zephyrus
train
php
5d26e1618f8133c5ec5730cfb72f9710bfeece98
diff --git a/js/reveal.js b/js/reveal.js index <HASH>..<HASH> 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -977,9 +977,9 @@ var Reveal = (function(){ function resume() { var wasPaused = dom.wrapper.classList.contains( 'paused' ); + dom.wrapper.classList.remove( 'paused' ); cueAutoSlide(); - dom.wrapper.classList.remove( 'paused' ); if( wasPaused ) { dispatchEvent( 'resumed' );
bugfix - continue autoslide after resume
hakimel_reveal.js
train
js
c87142cb24863edfb1a6070392043f280cba0266
diff --git a/test_flexidate.py b/test_flexidate.py index <HASH>..<HASH> 100644 --- a/test_flexidate.py +++ b/test_flexidate.py @@ -87,7 +87,6 @@ class TestFlexiDate(object): def test_isoformat(self): fd = FlexiDate(2000, 1, 24) - print(fd.isoformat(True)) assert str(fd.isoformat()) == '2000-01-24' def test_from_str(self): @@ -97,7 +96,6 @@ class TestFlexiDate(object): def dotest2(fd): out = FlexiDate.from_str("Not a date") - print(str(out)) assert str(out) == 'None' fd = FlexiDate(2000, 1, 23)
Removing print stmts left in during testing
openknowledge-archive_flexidate
train
py
9eaf45998746a13a9d104f0a7a8e1180b3a25045
diff --git a/pescador/mux.py b/pescador/mux.py index <HASH>..<HASH> 100644 --- a/pescador/mux.py +++ b/pescador/mux.py @@ -395,13 +395,8 @@ class BaseMux(core.Streamer): @property def n_streams(self): - """Return the number of streamers. Will fail if it's an iterable, - in which case just return None. - """ - try: - return len(self.streamers) - except TypeError: - return None + """Return the number of streamers.""" + return len(self.streamers) def activate(self): """Activates the mux as a streamer, choosing which substreams to
remove weird check in n_streams that is actually unnecessary
pescadores_pescador
train
py
861165a1c7ad9fc385b4787deb743400073416c7
diff --git a/LiSE/LiSE/engine.py b/LiSE/LiSE/engine.py index <HASH>..<HASH> 100644 --- a/LiSE/LiSE/engine.py +++ b/LiSE/LiSE/engine.py @@ -803,7 +803,7 @@ class Engine(AbstractEngine, gORM): for (orig, dest) in self._edges_cache.iter_keys(char, branch, tick): yield from unhandled_iter(char, orig, dest, branch, tick) - def _poll_rules(self): + def _follow_rules(self): branch, tick = self.time charmap = self.character rulemap = self.rule
Rename _poll_rules -> _follow_rules
LogicalDash_LiSE
train
py
8722be3e33c58daba8bfae570f0e367678de0f89
diff --git a/openpnm/algorithms/Reaction.py b/openpnm/algorithms/Reaction.py index <HASH>..<HASH> 100644 --- a/openpnm/algorithms/Reaction.py +++ b/openpnm/algorithms/Reaction.py @@ -16,18 +16,22 @@ class GenericReaction(GenericAlgorithm, ModelsMixin): self.settings['algorithm'] = algorithm.name self.settings['quantity'] = algorithm.settings['quantity'] - def apply(self): + def apply(self, A=None, b=None): net = self.simulation.network Ps = net.map_pores(self['pore._id']) # Fetch algorithm object from simulation alg = self.simulation[self.settings['algorithm']] + if A is None: + A = alg.A + if b is None: + b = alg.b quantity = alg.settings['quantity'] x = alg[quantity].copy() self[quantity] = x[Ps] # Regenerate models with new guess self.regenerate_models() # Add S1 to diagonal of A - datadiag = alg.A.diagonal() + datadiag = A.diagonal() datadiag[Ps] = datadiag[Ps] + self[self.settings['rate_model']][:, 1] - alg.A.setdiag(datadiag) - alg.b[Ps] = alg.b[Ps] - self[self.settings['rate_model']][:, 2] + A.setdiag(datadiag) + b[Ps] = b[Ps] - self[self.settings['rate_model']][:, 2]
Adjust solve to accept A and b
PMEAL_OpenPNM
train
py
b84601c106737d34a982c13222d8b2cf269cdb04
diff --git a/public/source/ref.js b/public/source/ref.js index <HASH>..<HASH> 100644 --- a/public/source/ref.js +++ b/public/source/ref.js @@ -43,7 +43,7 @@ var RefViewModel = function(args) { this.color = args.color; this.remoteIsAncestor = ko.computed(function() { if (!self.remoteRef()) return false; - return self.node().isAncestor(self.remoteRef().node()); + return self.node() && self.node().isAncestor(self.remoteRef().node()); }); this.remoteIsOffspring = ko.computed(function() { if (!self.remoteRef()) return false;
Require node to check if remote node is ancestor
FredrikNoren_ungit
train
js
f46b682ca4636d01372155ad47eadf154fc4ddb7
diff --git a/mapsforge-map/src/main/java/org/mapsforge/map/layer/Layer.java b/mapsforge-map/src/main/java/org/mapsforge/map/layer/Layer.java index <HASH>..<HASH> 100644 --- a/mapsforge-map/src/main/java/org/mapsforge/map/layer/Layer.java +++ b/mapsforge-map/src/main/java/org/mapsforge/map/layer/Layer.java @@ -1,6 +1,7 @@ /* * Copyright 2010, 2011, 2012, 2013 mapsforge.org * Copyright 2014 Ludwig M Brinckmann + * Copyright 2015 devemux86 * * This program is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free Software @@ -124,6 +125,8 @@ public abstract class Layer { */ public final void setVisible(boolean visible) { this.visible = visible; + + requestRedraw(); } /**
Layer: request redraw on visibility change
mapsforge_mapsforge
train
java
ae946dae14a2330a318c6bc3c3b07238c78c68ed
diff --git a/src/__tests__/util/helpers.js b/src/__tests__/util/helpers.js index <HASH>..<HASH> 100644 --- a/src/__tests__/util/helpers.js +++ b/src/__tests__/util/helpers.js @@ -19,7 +19,7 @@ export let test = (spec, input, callback) => { } ava(`${spec} (toString)`, t => { - t.same(result, input); + t.deepEqual(result, input); }); };
Update helpers file for AVA <I>.
postcss_postcss-selector-parser
train
js
ec80f7c5399f9a24d5adddf7f6817df1c2d87150
diff --git a/lxd/storage/backend_lxd.go b/lxd/storage/backend_lxd.go index <HASH>..<HASH> 100644 --- a/lxd/storage/backend_lxd.go +++ b/lxd/storage/backend_lxd.go @@ -3884,7 +3884,7 @@ func (b *lxdBackend) ImportCustomVolume(projectName string, poolVol *backup.Conf // Create the storage volume DB records. err := VolumeDBCreate(b, projectName, poolVol.Volume.Name, poolVol.Volume.Description, drivers.VolumeTypeCustom, false, volumeConfig, time.Time{}, drivers.ContentType(poolVol.Volume.ContentType)) if err != nil { - return fmt.Errorf("Failed creating custom volume %q record in project %q: %w", poolVol.Volume.Name, projectName, err) + return err } revert.Add(func() { VolumeDBDelete(b, projectName, poolVol.Volume.Name, drivers.VolumeTypeCustom) })
lxd/storage/backend/lxd: No need to wrap errors from VolumeDBCreate
lxc_lxd
train
go
69ffb8420c85aa000f1a02716b203d13367a5016
diff --git a/fedmsg/commands/relay.py b/fedmsg/commands/relay.py index <HASH>..<HASH> 100644 --- a/fedmsg/commands/relay.py +++ b/fedmsg/commands/relay.py @@ -68,6 +68,8 @@ class RelayCommand(BaseCommand): options=self.config, # Only run this *one* consumer consumers=[RelayConsumer], + # And no producers. + producers=[], # Tell moksha to quiet its logging. framework=False, )
Fedmsg-relay shouldn't run producers. If another package happens to be installed in the system, running `fedmsg-relay` shouldn't inadvertently start that thing.
fedora-infra_fedmsg
train
py
0a4f94e95bf936eebde9732c83ca79f73e9598c7
diff --git a/tasks/client.js b/tasks/client.js index <HASH>..<HASH> 100644 --- a/tasks/client.js +++ b/tasks/client.js @@ -159,6 +159,24 @@ module.exports = function (gulp, config) { port: config.staticServer.port, root: config.build.distPath }); + + if (process.env.SERVE_HTTPS === 'true') { + var fs = require('fs'); + + var httpsOptions = true; + if (process.env.HTTPS_KEY && process.env.HTTPS_CERT) { + httpsOptions = { + key: fs.readFileSync(process.env.HTTPS_KEY), + cert: fs.readFileSync(process.env.HTTPS_CERT) + } + } + + connect.server({ + port: config.staticServer.port + 10000, + root: config.build.distPath, + https: httpsOptions + }); + } }, reloadStaticServer: function() {
feat(https): support serving assets on HTTPS
emartech_boar-tasks-client
train
js
8349722ac283e66ea8cc233238df19775539ff89
diff --git a/lib/Local.js b/lib/Local.js index <HASH>..<HASH> 100644 --- a/lib/Local.js +++ b/lib/Local.js @@ -40,7 +40,7 @@ function Local(){ callback(new LocalError('No output received')); if(data['state'] != 'connected'){ - callback(new LocalError(data['message'])); + callback(new LocalError(data['message']['message'])); } else { that.pid = data['pid']; callback();
Instead of taking the message object, just take message The message field is again an object that contains a message. In order to receive the text, take that.
browserstack_browserstack-local-nodejs
train
js
ed8ee0910ce352edacc25a4809c003987bc1c079
diff --git a/lang/en/moodle.php b/lang/en/moodle.php index <HASH>..<HASH> 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -51,7 +51,6 @@ $string['autosubscribeyes'] = "Yes: when I post, subscribe me to that forum"; $string['availability'] = "Availability"; $string['availablecourses'] = "Available Courses"; $string['backup'] = "Backup"; -$string['backupdir'] = "backupdata"; $string['backupdate'] = "Backup Date"; $string['backupdetails'] = "Backup Details"; $string['backupfilename'] = "backup";
Take out backupdir string due to some backup detected problems related to it.
moodle_moodle
train
php
ab5e45cfa9ed47e28b0bb85a686e1285efdae5b5
diff --git a/lib/params.js b/lib/params.js index <HASH>..<HASH> 100644 --- a/lib/params.js +++ b/lib/params.js @@ -54,13 +54,11 @@ define(function(require, exports, module) { param: function(def, name, source) { var param = def; - source = source || 'url'; - + // Singe edge case for implicit param generation from the url pathparts, // where the pathpart is not defined in params definition. if (typeof def === 'string' && !name) { return { - name: def, source: 'url', optional: false, type: BuiltinTypes.get('string'), @@ -75,18 +73,15 @@ define(function(require, exports, module) { } param.optional = !!param.optional; - param.source = param.source || source; + param.source = param.source || source || "body"; + param.type = param.type || "string"; // allow regular expressions as types if (param.type instanceof RegExp) param.type = new RegExpType(param.type); - if (param.source == "body") - param.type = param.type || "json"; - - param.type = param.type || "string"; - - if (!/^body|url|query$/.test(param.source)) { + + if ( !/^body|url|query$/.test(param.source)) { throw new Error("parameter source muste be 'url', 'query' or 'body'"); }
default source is now body, simplified thigns
cloud9ide_frontdoor
train
js
b28bf907f05c3eab8ed702fe208bcf632ac42062
diff --git a/src/gogoutils/parser.py b/src/gogoutils/parser.py index <HASH>..<HASH> 100644 --- a/src/gogoutils/parser.py +++ b/src/gogoutils/parser.py @@ -4,10 +4,18 @@ except ImportError: from urlparse import urlparse +class ParserError(Exception): + pass + + class Parser(object): """A Parser for urls""" def __init__(self, url): + + if not url: + error = 'url may not be "None" or empty' + raise ParserError(error) self.url = url.lower() def parse_url(self): diff --git a/tests/test_parser.py b/tests/test_parser.py index <HASH>..<HASH> 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -1,4 +1,5 @@ -from gogoutils.parser import Parser +import pytest +from gogoutils.parser import Parser, ParserError def test_parser_url(): @@ -26,3 +27,14 @@ def test_parser_url(): project, repo = Parser(url).parse_url() assert project == 'gogoair' assert repo == 'test' + + +def test_empty_params(): + urls = [ + None, + '', + ] + + for url in urls: + with pytest.raises(ParserError): + g = Parser(url)
Ensure an url is passed to Parser
foremast_gogo-utils
train
py,py
e76fefb8e22a7fe29caa49a0a116441ed9ec90ac
diff --git a/test/buffer.js b/test/buffer.js index <HASH>..<HASH> 100644 --- a/test/buffer.js +++ b/test/buffer.js @@ -16,7 +16,7 @@ module.exports = function runBufferTestSuite() { statsd = null; }); - ['main client', /*'child client', 'child of child client'*/].forEach(function (description, index) { + ['main client', 'child client', 'child of child client'].forEach(function (description, index) { describe(description, function () { describe('UDP', function () { it('should aggregate packets when maxBufferSize is set to non-zero', function (done) {
Uncomment multiple clients in test/buffer.js
brightcove_hot-shots
train
js
f38027dbc768cc7b2bf331e31976303b6bf4de39
diff --git a/src/cryptojwt/key_bundle.py b/src/cryptojwt/key_bundle.py index <HASH>..<HASH> 100755 --- a/src/cryptojwt/key_bundle.py +++ b/src/cryptojwt/key_bundle.py @@ -208,7 +208,8 @@ class KeyBundle(object): except JWKException as err: logger.warning('While loading keys: {}'.format(err)) else: - self._keys.append(_key) + if _key not in self._keys: + self._keys.append(_key) flag = 1 break if not flag:
Don't add keys that are already there.
openid_JWTConnect-Python-CryptoJWT
train
py
cb77398fe1d697352939c464825b97f46eeb88de
diff --git a/lib/MissMatch.js b/lib/MissMatch.js index <HASH>..<HASH> 100644 --- a/lib/MissMatch.js +++ b/lib/MissMatch.js @@ -45,18 +45,10 @@ mm.makeParser = function (src) { */ function validChar(c) { var code = c.charCodeAt(0); - return (code >= 65 && code <= 90) || (code >= 97 && code <= 122); - } - - /** - * Match valid JS object property names. Like variable names - * this is incomplete. - * TODO: A better validation has to be found. - */ - function validProp(c) { - return validChar(c) - || (c === '_') - || ((c.charCodeAt(0) >= 47) && (c.charCodeAt(0) <= 57)); + return (code >= 65 && code <= 90) + || (code >= 97 && code <= 122) + || (code === 95) // '_' + || (code === 36) // '$' } /** @@ -211,7 +203,7 @@ mm.makeParser = function (src) { consume(); // '.' var name = [], property; - while(validProp(peek())) { + while(validChar(peek())) { name.push(next()); }
allow _ and $ in variable names
pb82_MissMatch
train
js
bdd5d5579130091f0e7cd2fa0b668f289251a01e
diff --git a/autolens/autofit/non_linear.py b/autolens/autofit/non_linear.py index <HASH>..<HASH> 100644 --- a/autolens/autofit/non_linear.py +++ b/autolens/autofit/non_linear.py @@ -63,9 +63,7 @@ class NonLinearOptimizer(object): if name is None: name = "" - self.path = "{}/{}".format(conf.instance.output_path, name) - if not os.path.exists(self.path): - os.makedirs(self.path) + self.path = link.make_linked_folder("{}/{}".format(conf.instance.output_path, name)) self.chains_path = "{}/{}".format(self.path, 'chains') if not os.path.exists(self.chains_path): os.makedirs(self.chains_path) @@ -335,7 +333,7 @@ class MultiNest(NonLinearOptimizer): logger.info("Running MultiNest...") self.run(fitness_function.__call__, prior, self.variable.total_priors, - outputfiles_basename="{}/mn".format(link.make_linked_folder(self.chains_path)), + outputfiles_basename="{}/mn".format(self.chains_path), n_live_points=self.n_live_points, const_efficiency_mode=self.const_efficiency_mode, importance_nested_sampling=self.importance_nested_sampling,
link wrapping whole multinest folder (fixes integration test but causes bugs in non_linear
Jammy2211_PyAutoLens
train
py
29da5b909e1124961aed861e46af963c918b7748
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -34,8 +34,6 @@ function validateQuery(query) { } module.exports = function(source) { - this.cacheable && this.cacheable(); - var query = utils.parseQuery(this.query); validateQuery(query); var prefix = escapeStringRegexp(query.prefix || '{{'); diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -1,14 +1,6 @@ import test from 'ava'; import loader from '../index.js'; -test('calls cacheable', t => { - t.plan(1); - const context = { - cacheable: () => t.pass() - }; - loader.call(context, ''); -}); - test('basic usage', t => { t.is( loader.call({}, '{{anotherLoader!hi.js}}'),
no need to call cacheable() in webpack 2
erikdesjardins_interpolate-loader
train
js,js
4b1a5cc92ec6e4aae6d2bf6837c543ef793a5e6a
diff --git a/pyzotero/zotero.py b/pyzotero/zotero.py index <HASH>..<HASH> 100644 --- a/pyzotero/zotero.py +++ b/pyzotero/zotero.py @@ -669,9 +669,9 @@ class Zotero(object): """ verify(payload) if not parentid: - liblevel = '/users/{u}/items?key={k}' + liblevel = '/{t}/{u}/items?key={k}' else: - liblevel = '/users/{u}/items/{i}/children?key={k}' + liblevel = '/{t}/{u}/items/{i}/children?key={k}' # Create one or more new attachments headers = { 'X-Zotero-Write-Token': token(), @@ -682,6 +682,7 @@ class Zotero(object): req = requests.post( url=self.endpoint + liblevel.format( + t=self.library_type, u=self.library_id, i=parentid, k=self.api_key),
Use group type when creating attachments Closes #<I>
urschrei_pyzotero
train
py
210e09b1cbd5be64c953ffb0bb9886947a3395b3
diff --git a/holoviews/core/io.py b/holoviews/core/io.py index <HASH>..<HASH> 100644 --- a/holoviews/core/io.py +++ b/holoviews/core/io.py @@ -31,12 +31,12 @@ from .options import Store from .util import unique_iterator, group_sanitizer, label_sanitizer -def sanitizer(name, replacements={':':'_', '/':'_', '\\':'_'}): +def sanitizer(name, replacements=[(':','_'), ('/','_'), ('\\','_')]): """ String sanitizer to avoid problematic characters in filenames. """ - for k,v in replacements.items(): - name = name.replace(k,v) + for old,new in replacements: + name = name.replace(old,new) return name
Fixed replacements ordering in core.io.sanitizer
pyviz_holoviews
train
py