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 |
|---|---|---|---|---|---|
1cf9dec7618721ebea0fa841f0c761368899b4ad | diff --git a/qunit/qunit.js b/qunit/qunit.js
index <HASH>..<HASH> 100644
--- a/qunit/qunit.js
+++ b/qunit/qunit.js
@@ -439,6 +439,10 @@ var config = {
// block until document ready
blocking: true,
+ // when enabled, show only failing tests
+ // gets persisted through sessionStorage and can be changed in UI via checkbox
+ hidepassed: false,
+
// by default, run previously failed tests first
// very useful in combination with "Hide passed tests" checked
reorder: true,
@@ -721,7 +725,7 @@ addEvent(window, "load", function() {
}
}
});
- if ( defined.sessionStorage && sessionStorage.getItem("qunit-filter-passed-tests") ) {
+ if ( config.hidepassed || defined.sessionStorage && sessionStorage.getItem("qunit-filter-passed-tests") ) {
filter.checked = true;
var ol = document.getElementById("qunit-tests");
ol.className = ol.className + " hidepass";
diff --git a/test/test.js b/test/test.js
index <HASH>..<HASH> 100644
--- a/test/test.js
+++ b/test/test.js
@@ -1,3 +1,5 @@
+QUnit.config.hidepassed = true;
+
test("module without setup/teardown (default)", function() {
expect(1);
ok(true); | Expose QUnit.config.hidepassed setting. Overrides sessionStorage and enables enabling the feature programmatically. Fixes #<I> | JamesMGreene_qunit-assert-html | train | js,js |
7f0b50e6aa9b2b1ab85d93b6353e480fddd4ca5f | diff --git a/gwpy/spectrum/lal_.py b/gwpy/spectrum/lal_.py
index <HASH>..<HASH> 100644
--- a/gwpy/spectrum/lal_.py
+++ b/gwpy/spectrum/lal_.py
@@ -155,6 +155,9 @@ def lal_psd(timeseries, segmentlength, noverlap=None, method='welch',
# get cached window
if window is None:
window = generate_lal_window(segmentlength, dtype=timeseries.dtype)
+ elif isinstance(window, (tuple, str)):
+ window = generate_lal_window(segmentlength, type_=window,
+ dtype=timeseries.dtype)
elif isinstance(window, Window):
window = window.to_lal()
# get cached FFT plan
@@ -166,7 +169,7 @@ def lal_psd(timeseries, segmentlength, noverlap=None, method='welch',
# check data length
size = timeseries.size
numsegs = 1 + int((size - segmentlength) / stride)
- if method is 'median-mean' and numsegs % 2:
+ if method == 'median-mean' and numsegs % 2:
numsegs -= 1
if not numsegs:
raise ValueError("Cannot calculate median-mean spectrum with " | spectrum.lal_: fix bug in windowing, and numsegs | gwpy_gwpy | train | py |
710e42d3ea64f9c3e80fb0ffc98979ec89899926 | diff --git a/pdf2image/parsers.py b/pdf2image/parsers.py
index <HASH>..<HASH> 100644
--- a/pdf2image/parsers.py
+++ b/pdf2image/parsers.py
@@ -41,11 +41,15 @@ def parse_buffer_to_png(data):
images = []
- index = 0
-
- while index < len(data):
- file_size = data[index:].index(b'IEND') + 8 # 4 bytes for IEND + 4 bytes for CRC
- images.append(Image.open(BytesIO(data[index:index+file_size])))
- index += file_size
+ c1 = 0
+ c2 = 0
+ data_len = len(data)
+ while c1 < data_len:
+ # IEND can appear in a PNG without being the actual end
+ if data[c2:c2 + 4] == b'IEND' and (c2 + 8 == data_len or data[c2+9:c2+12] == b'PNG'):
+ images.append(Image.open(BytesIO(data[c1:c2 + 8])))
+ c1 = c2 + 8
+ c2 = c1
+ c2 += 1
return images | Add support for buffer containing IEND bytes
Fixes: #<I> | Belval_pdf2image | train | py |
50a6177d3f5e72b742108a8333d34912c238245e | diff --git a/src/main/java/io/ebean/querybean/generator/SimpleModuleInfoWriter.java b/src/main/java/io/ebean/querybean/generator/SimpleModuleInfoWriter.java
index <HASH>..<HASH> 100644
--- a/src/main/java/io/ebean/querybean/generator/SimpleModuleInfoWriter.java
+++ b/src/main/java/io/ebean/querybean/generator/SimpleModuleInfoWriter.java
@@ -63,6 +63,7 @@ class SimpleModuleInfoWriter {
FileObject jfo = processingContext.createManifestWriter();
if (jfo != null) {
Writer writer = jfo.openWriter();
+ writer.write("Generated-By: Ebean query bean generator\n");
writer.write(manifestEntityPackages(allEntityPackages));
writer.write("\n");
writer.close(); | #<I> Add Generated-By attribute into manifest | ebean-orm_querybean-generator | train | java |
d88297e091c4df9bed23dfbfe55c95e28a6365f2 | diff --git a/galpy/util/bovy_plot.py b/galpy/util/bovy_plot.py
index <HASH>..<HASH> 100644
--- a/galpy/util/bovy_plot.py
+++ b/galpy/util/bovy_plot.py
@@ -1034,6 +1034,8 @@ def scatterplot(x,y,*args,**kwargs):
cntrSmooth - use ndimage.gaussian_filter to smooth before contouring
+ levels - contour-levels
+
onedhists - if True, make one-d histograms on the sides
onedhistx - if True, make one-d histograms on the side of the x distribution | doc tweak for scatterplot [ci skip] | jobovy_galpy | train | py |
868267fe722f1bff068837796b0e867100e21b88 | diff --git a/jsonschema.py b/jsonschema.py
index <HASH>..<HASH> 100644
--- a/jsonschema.py
+++ b/jsonschema.py
@@ -630,10 +630,11 @@ class RefResolver(object):
"""
- def __init__(self, base_uri, referrer, store=()):
+ def __init__(self, base_uri, referrer, store=(), cache_remote=True):
self.base_uri = base_uri
self.referrer = referrer
self.store = dict(store, **_meta_schemas())
+ self.cache_remote = cache_remote
@classmethod
def from_schema(cls, schema, *args, **kwargs):
@@ -702,7 +703,10 @@ class RefResolver(object):
"""
- return json.load(urlopen(uri))
+ result = json.load(urlopen(uri))
+ if self.cache_remote:
+ self.store[uri] = result
+ return result
class ErrorTree(object): | Make RefResolver cache remote refs by default
Add cache_remote flag to init to turn it off | Julian_jsonschema | train | py |
d24de31206d07eecc7f212554c0f9587d1974d40 | diff --git a/src/main/java/org/jboss/netty/channel/socket/nio/NioWorker.java b/src/main/java/org/jboss/netty/channel/socket/nio/NioWorker.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jboss/netty/channel/socket/nio/NioWorker.java
+++ b/src/main/java/org/jboss/netty/channel/socket/nio/NioWorker.java
@@ -267,6 +267,7 @@ class NioWorker implements Runnable {
if (preallocatedBuffer == null) {
// TODO Magic number
+ // FIXME: OOPS - the new buffer should not be shared by more than one connection
preallocatedBuffer = channel.getConfig().getBufferFactory().getBuffer(1048576);
} | Found a design flaw - marking as fixme | netty_netty | train | java |
3481f9d462419898185273d46082785408dd9111 | diff --git a/lib.js b/lib.js
index <HASH>..<HASH> 100644
--- a/lib.js
+++ b/lib.js
@@ -15,6 +15,7 @@ function getLogger(label) {
, "error": console.log
, "fatal": console.log
}
+ log.setLevel = function noop() {};
}
// Scrub credentials. | Support setLevel() with a stub | jhs_audit_couchdb | train | js |
b22bfb55300120fd7cdd0d99a9b0315afaaed733 | diff --git a/ddl/ddl_worker.go b/ddl/ddl_worker.go
index <HASH>..<HASH> 100644
--- a/ddl/ddl_worker.go
+++ b/ddl/ddl_worker.go
@@ -519,7 +519,7 @@ func (w *worker) runDDLJob(d *ddlCtx, t *meta.Meta, job *model.Job) (ver int64,
if job.State != model.JobStateCancelled {
log.Errorf("[ddl-%s] run DDL job err %v", w, errors.ErrorStack(err))
} else {
- log.Infof("[ddl-%s] the DDL job is normal to cancel because %v", w, errors.ErrorStack(err))
+ log.Infof("[ddl-%s] the DDL job is normal to cancel because %v", w, err)
}
job.Error = toTError(err) | ddl: just print error message when ddl job is normal to calcel, to eliminate noisy log (#<I>) | pingcap_tidb | train | go |
e247248c0ab9c11d7a963b695fb0842c8aa02051 | diff --git a/src/commons/org/codehaus/groovy/grails/commons/GrailsDomainClassProperty.java b/src/commons/org/codehaus/groovy/grails/commons/GrailsDomainClassProperty.java
index <HASH>..<HASH> 100644
--- a/src/commons/org/codehaus/groovy/grails/commons/GrailsDomainClassProperty.java
+++ b/src/commons/org/codehaus/groovy/grails/commons/GrailsDomainClassProperty.java
@@ -24,8 +24,9 @@ public interface GrailsDomainClassProperty {
String IDENTITY = "id";
String VERSION = "version";
- String OPTIONAL = "optional";
+ String OPTIONAL = "optionals";
String TRANSIENT = "transients";
+ String CONSTRAINTS = "constraints";
String EVANESCENT = "evanescent";
String RELATIONSHIPS = "relationships";
Object META_CLASS = "metaClass"; | renamed "optional" to "optionals" for consistency
git-svn-id: <URL> | grails_grails-core | train | java |
0979d7400724d3f7cb339daef021ea038c4b19f7 | diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -55,6 +55,7 @@ gulp.task('upgrade', async () => {
await _exec('git', ['reset', '--hard']);
await _exec('git', ['fetch', '--all', '--prune']);
await _exec('git', ['pull', '--rebase']);
+ await _exec('npm', ['install', '--ignore-scripts']);
return _exec('npm', ['update', '--dev']);
}); | Updated the `upgrade` build task | cedx_lcov.js | train | js |
f51dec3d1263a42c122a41b6f1fc110c2f21f1f3 | diff --git a/src/project/ProjectManager.js b/src/project/ProjectManager.js
index <HASH>..<HASH> 100644
--- a/src/project/ProjectManager.js
+++ b/src/project/ProjectManager.js
@@ -32,9 +32,9 @@
* This module dispatches these events:
* - beforeProjectClose -- before _projectRoot changes
* - beforeAppClose -- before Brackets quits entirely
- * - projectOpen -- after _projectRoot changes
- * - projectRefresh -- after project tree is rebuilt, when projectOpen is not--
- * dispatched because _projectRoot has not changed
+ * - projectOpen -- after _projectRoot changes and the tree is re-rendered
+ * - projectRefresh -- when project tree is re-rendered for a reason other than
+ * a project being opened (e.g. from the Refresh command)
* - projectFilesChange -- sent if one of the project files has changed--
* added, removed, renamed, etc.
* | Tweaked comment for projectRefresh | adobe_brackets | train | js |
2db8eeb1cfc324f859a0e0dc29b32133ace9d47c | diff --git a/android/app/src/main/java/com/reactnativenavigation/core/RctManager.java b/android/app/src/main/java/com/reactnativenavigation/core/RctManager.java
index <HASH>..<HASH> 100644
--- a/android/app/src/main/java/com/reactnativenavigation/core/RctManager.java
+++ b/android/app/src/main/java/com/reactnativenavigation/core/RctManager.java
@@ -75,8 +75,9 @@ public class RctManager {
}
mReactManager = builder.build();
- setupDevSupportHandler(mReactManager);
-
+ if (reactActivity.getUseDeveloperSupport()) {
+ setupDevSupportHandler(mReactManager);
+ }
return mReactManager;
} | Setup devSupportHandler only in debug | wix_react-native-navigation | train | java |
8d97aaf9a4c048b0b293c9c387af7b2d51dca472 | diff --git a/glue/ligolw/utils/process.py b/glue/ligolw/utils/process.py
index <HASH>..<HASH> 100644
--- a/glue/ligolw/utils/process.py
+++ b/glue/ligolw/utils/process.py
@@ -79,7 +79,9 @@ def append_process(xmldoc, program = None, version = None, cvs_repository = None
process.program = program
process.version = version
process.cvs_repository = cvs_repository
- if cvs_entry_time is not None:
+ # FIXME: remove the "" case when the git versioning business is
+ # sorted out
+ if cvs_entry_time is not None and cvs_entry_time != "":
process.cvs_entry_time = gpstime.GpsSecondsFromPyUTC(time.mktime(time.strptime(cvs_entry_time, "%Y/%m/%d %H:%M:%S")))
else:
process.cvs_entry_time = None | Emergency fix for version metadata breakage caused by transition to git. | gwastro_pycbc-glue | train | py |
b480484d7bab21a630e773ad3b3795a82b5dfa3b | diff --git a/lib/server.js b/lib/server.js
index <HASH>..<HASH> 100644
--- a/lib/server.js
+++ b/lib/server.js
@@ -33,8 +33,7 @@ RunnerServer.prototype = new function () {
if (options.proxy.useProxy && url.match(prefix)) {
proxy.proxyRequest(req, res, {
host: options.proxy.host,
- port: options.proxy.port,
- buffer: proxy.buffer(req)
+ port: options.proxy.port
});
} else {
next(); | Minor fix in server, removed proxy.buffer (legacy code) | envone_ember-runner | train | js |
1f5437902e6bd5dab8e09996bc48ddf32b2137f1 | diff --git a/src/widgets/views/LogoLink.php b/src/widgets/views/LogoLink.php
index <HASH>..<HASH> 100644
--- a/src/widgets/views/LogoLink.php
+++ b/src/widgets/views/LogoLink.php
@@ -1,10 +1,14 @@
<?php
+/** @var array $options */
+/** @var string $image */
+/** @var string $url */
+
use yii\helpers\Html;
?>
<?php if (!empty($image)) : ?>
- <?= Html::a(Html::img($image), $url) ?>
+ <?= Html::a(Html::img($image, $options), $url) ?>
<?php else : ?>
- <?= Html::a($name, $url) ?>
+ <?= Html::a($name, $url, $options) ?>
<?php endif ?> | Added php doc, added options to Html::img | hiqdev_yii2-thememanager | train | php |
56d000de2ea6da73a428ef574a5e895525ad4e31 | diff --git a/cas-management-webapp/src/main/webapp/js/app/app-angular.js b/cas-management-webapp/src/main/webapp/js/app/app-angular.js
index <HASH>..<HASH> 100644
--- a/cas-management-webapp/src/main/webapp/js/app/app-angular.js
+++ b/cas-management-webapp/src/main/webapp/js/app/app-angular.js
@@ -420,6 +420,7 @@ if (array.length == 3) {
if (pattern == "")
return true;
var patt = new RegExp(pattern);
+ return true;
} catch (e) {
return false;
} | Fix bug in form validation for proxy service regex. | apereo_cas | train | js |
716c23fce83668e1674e8cd620afd082a52a8cf3 | diff --git a/src/Webfactory/Doctrine/ORMTestInfrastructure/ORMInfrastructure.php b/src/Webfactory/Doctrine/ORMTestInfrastructure/ORMInfrastructure.php
index <HASH>..<HASH> 100644
--- a/src/Webfactory/Doctrine/ORMTestInfrastructure/ORMInfrastructure.php
+++ b/src/Webfactory/Doctrine/ORMTestInfrastructure/ORMInfrastructure.php
@@ -296,9 +296,18 @@ class ORMInfrastructure
*/
protected function createAnnotationLoader()
{
- return function ($annotationClass) {
+ $loader = function ($annotationClass) {
return class_exists($annotationClass, true);
};
+ if (method_exists($loader, 'bindTo')) {
+ // Starting with PHP 5.4, the object context is bound to created closures. The context is not needed
+ // in the function above and as we will store the function in an attribute, this would create a
+ // circular reference between object and function. That would delay the garbage collection and
+ // the cleanup that happens in __destruct.
+ // To avoid these issues, we simply remove the context from the lambda function.
+ $loader = $loader->bindTo(null);
+ }
+ return $loader;
}
/** | removed function context to avoid circular references; that ensures immediate object destruction as soon as there are no more external references, which avoids pollution of the memory during test runs | webfactory_doctrine-orm-test-infrastructure | train | php |
0d0cea9430e3ea868faa15d744a1e8005132d8dc | diff --git a/bumpy.py b/bumpy.py
index <HASH>..<HASH> 100644
--- a/bumpy.py
+++ b/bumpy.py
@@ -8,6 +8,7 @@ CONFIG = {
'cli': False,
'abbrev': True,
+ 'suppress': (),
}
LOCALE = {
@@ -80,7 +81,7 @@ class _Task:
return _highlight('[' + self.name + ']', color)
def __print(self, id, *args):
- if ('all' not in self.suppress) and (id not in self.suppress):
+ if ('all' not in self.suppress) and (id not in self.suppress) and ('all' not in CONFIG['suppress']) and (id not in CONFIG['suppress']):
print LOCALE[id].format(*args)
def match(self, name): | Add a config option to suppress messages for all commands | scizzorz_bumpy | train | py |
182a1c047a036a1f77b6fff0ac771eb3a6c9aacf | diff --git a/spyderlib/plugins/editor.py b/spyderlib/plugins/editor.py
index <HASH>..<HASH> 100644
--- a/spyderlib/plugins/editor.py
+++ b/spyderlib/plugins/editor.py
@@ -1846,7 +1846,7 @@ class Editor(SpyderPluginWidget):
if self.__set_eol_chars:
editor.set_eol_chars(sourcecode.get_eol_chars_from_os_name(os_name))
- @Slot()
+ @Slot(bool)
def toggle_show_blanks(self, checked):
editor = self.get_current_editor()
editor.set_blanks_enabled(checked) | Editor: Fix slot signature for the new method to show blank spaces | spyder-ide_spyder | train | py |
fa5a36bfc868ea0f137d47507ed654d7868738af | diff --git a/org/postgresql/util/PSQLDriverVersion.java b/org/postgresql/util/PSQLDriverVersion.java
index <HASH>..<HASH> 100644
--- a/org/postgresql/util/PSQLDriverVersion.java
+++ b/org/postgresql/util/PSQLDriverVersion.java
@@ -3,7 +3,7 @@
* Copyright (c) 2004-2005, PostgreSQL Global Development Group
*
* IDENTIFICATION
-* $PostgreSQL: pgjdbc/org/postgresql/util/PSQLDriverVersion.java,v 1.10 2005/07/24 11:06:50 jurka Exp $
+* $PostgreSQL: pgjdbc/org/postgresql/util/PSQLDriverVersion.java,v 1.11 2005/10/07 06:24:57 jurka Exp $
*
*-------------------------------------------------------------------------
*/
@@ -21,7 +21,7 @@ import org.postgresql.Driver;
*/
public class PSQLDriverVersion {
- public static int buildNumber = 402;
+ public static int buildNumber = 403;
public static void main(String args[]) {
java.net.URL url = Driver.class.getResource("/org/postgresql/Driver.class"); | Release build <I> to make XA available. | pgjdbc_pgjdbc | train | java |
28d64f615524afa26895946f3a90ea6635cd2fec | diff --git a/lib/travis/redis_pool.rb b/lib/travis/redis_pool.rb
index <HASH>..<HASH> 100644
--- a/lib/travis/redis_pool.rb
+++ b/lib/travis/redis_pool.rb
@@ -10,8 +10,8 @@ module Travis
@options = options.delete(:pool) || {}
@options[:size] ||= 10
@options[:timeout] ||= 10
- @pool = ConnectionPool.new(options) do
- ::Redis.new(options)
+ @pool = ConnectionPool.new(@options) do
+ ::Redis.new(@options)
end
end | the redis pool was not using the modified default pool size or timeout | travis-ci_travis-core | train | rb |
68bab44b876a1a5af0a4807a215bdedc5e9bf9f1 | diff --git a/app/controllers/caboose/pages_controller.rb b/app/controllers/caboose/pages_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/caboose/pages_controller.rb
+++ b/app/controllers/caboose/pages_controller.rb
@@ -446,13 +446,10 @@ module Caboose
# GET /admin/pages/sitemap-options
def admin_sitemap_options
- parent_id = params[:parent_id]
- d = Domain.where(:domain => request.host_with_port).first
- top_page = Page.index_page(d.site_id)
- p = !parent_id.nil? ? Page.find(parent_id) : top_page
+ parent_id = params[:parent_id]
+ p = parent_id ? Page.find(parent_id) : Page.index_page(@site.id)
options = []
- sitemap_helper(top_page, options)
-
+ sitemap_helper(p, options)
render :json => options
end | Fixed page sitemap options to show only pages for the current site. | williambarry007_caboose-cms | train | rb |
7a29fe33ae66a4a04df9ed378aafd7181f6f74a5 | diff --git a/kundera-cassandra/src/main/java/com/impetus/client/cassandra/thrift/ThriftClient.java b/kundera-cassandra/src/main/java/com/impetus/client/cassandra/thrift/ThriftClient.java
index <HASH>..<HASH> 100644
--- a/kundera-cassandra/src/main/java/com/impetus/client/cassandra/thrift/ThriftClient.java
+++ b/kundera-cassandra/src/main/java/com/impetus/client/cassandra/thrift/ThriftClient.java
@@ -882,6 +882,7 @@ public class ThriftClient extends CassandraClientBase implements Client<CassQuer
if(conditions != null)
{
keyRange.setRow_filter(conditions);
+ keyRange.setRow_filterIsSet(true);
} | Added check on row filter is set. | Impetus_Kundera | train | java |
74d981af4a4e0b5e4001ee0a2f5d8eeacec71cd0 | diff --git a/lib/components/map/bounds-updating-overlay.js b/lib/components/map/bounds-updating-overlay.js
index <HASH>..<HASH> 100644
--- a/lib/components/map/bounds-updating-overlay.js
+++ b/lib/components/map/bounds-updating-overlay.js
@@ -9,6 +9,11 @@ import {
} from '../../util/itinerary'
import { getActiveItinerary, getActiveSearch } from '../../util/state'
+/**
+ * This MapLayer component will automatically update the leaflet bounds
+ * depending on what data is in the redux store. This component does not
+ * "render" anything on the map.
+ */
class BoundsUpdatingOverlay extends MapLayer {
createLeafletElement () {}
diff --git a/lib/components/map/connected-park-and-ride-overlay.js b/lib/components/map/connected-park-and-ride-overlay.js
index <HASH>..<HASH> 100644
--- a/lib/components/map/connected-park-and-ride-overlay.js
+++ b/lib/components/map/connected-park-and-ride-overlay.js
@@ -9,7 +9,7 @@ class ConnectedParkAndRideOverlay extends Component {
componentDidMount () {
const params = {}
if (this.props.maxTransitDistance) {
- params['maxTransitDistance'] = this.props.maxTransitDistance
+ params.maxTransitDistance = this.props.maxTransitDistance
}
// TODO: support config-defined bounding envelope | refactor: some small edits to address PR review comments | opentripplanner_otp-react-redux | train | js,js |
9a49ca939595139539def5b524621ebfbe4b704c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -5,12 +5,12 @@ from distutils.core import setup
setup(
name = 'pygame_vkeyboard',
packages = ['pygame_vkeyboard'], # this must be the same as the name above
- version = '1.0',
+ version = '1.1',
description = 'Visual keyboard for Pygame engine. Aims to be easy to use as highly customizable as well.',
author = 'Félix Voituret',
author_email = 'felix.voituret@gmail.com',
url = 'https://github.com/Faylixe/pygame_vkeyboard',
- download_url = 'https://github.com/Faylixe/pygame_vkeyboard/tarball/1.0',
+ download_url = 'https://github.com/Faylixe/pygame_vkeyboard/tarball/1.1',
install_requires=[
'pygame',
], | Updates to <I> for distribution | Faylixe_pygame_vkeyboard | train | py |
0fa8959d7981ee13b0a4030cb189703e9898cf56 | diff --git a/lib/puppet-lint/plugins/check_resources.rb b/lib/puppet-lint/plugins/check_resources.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet-lint/plugins/check_resources.rb
+++ b/lib/puppet-lint/plugins/check_resources.rb
@@ -154,23 +154,25 @@ PuppetLint.new_check(:file_mode) do
break if value_token.value =~ sym_mode
break if value_token.type == :UNDEF
- notify_type = :warning
-
- if PuppetLint.configuration.fix && value_token.value =~ /\A[0-7]{3}\Z/
- value_token.value = "0#{value_token.value.to_s}"
- value_token.type = :SSTRING
- notify_type = :fixed
- end
-
- notify notify_type, {
+ notify :warning, {
:message => msg,
:linenumber => value_token.line,
:column => value_token.column,
+ :token => value_token,
}
end
end
end
end
+
+ def fix(problem)
+ if problem[:token].value =~ /\A[0-7]{3}\Z/
+ problem[:token].type = :SSTRING
+ problem[:token].value = "0#{problem[:token].value.to_s}"
+ else
+ raise PuppetLint::NoFix
+ end
+ end
end
# Public: Check the tokens of each File resource instance for an ensure | Convert file_mode check to new fix method | rodjek_puppet-lint | train | rb |
86873d85dc1bd6392a9d656cb680c2baa816276c | diff --git a/test/index.test.js b/test/index.test.js
index <HASH>..<HASH> 100644
--- a/test/index.test.js
+++ b/test/index.test.js
@@ -38,4 +38,19 @@ describe('Kerouac', function() {
});
});
+ describe('front matter parser registration', function() {
+ var site = kerouac();
+ site.fm(function(data) {
+ if (data == 'foobar') { return { foo: 'bar' }; }
+ return undefined;
+ })
+
+ it('should parse using registered parser', function() {
+ var foo = "foobar"
+
+ var data = site.fm(foo);
+ expect(data.foo).to.equal('bar');
+ });
+ });
+
}); | Add test case for front matter parser registration. | jaredhanson_kerouac | train | js |
eb3674de4db25322c2fc0c529d85a82ef7769816 | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -50,9 +50,9 @@ copyright = u'2011, Atsushi Odagiri'
# built documents.
#
# The short X.Y version.
-version = '1.0a3'
+version = '1.0b1'
# The full version, including alpha/beta/rc tags.
-release = '1.0a3'
+release = '1.0b1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -27,7 +27,7 @@ setup(
author_email="aodagx@gmail.com",
description="dispatch request on wsgi application.",
long_description=readme + "\n" + changes,
- version="1.0a3",
+ version="1.0b1",
test_suite="webdispatch",
license="MIT",
install_requires=requires, | prep for <I>b1 | aodag_WebDispatch | train | py,py |
697a135ba6acbdd6d8457384b2eb15c518b51af7 | diff --git a/src/Phinx/Console/Command/Init.php b/src/Phinx/Console/Command/Init.php
index <HASH>..<HASH> 100644
--- a/src/Phinx/Console/Command/Init.php
+++ b/src/Phinx/Console/Command/Init.php
@@ -84,7 +84,7 @@ class Init extends Command
protected function resolvePath(InputInterface $input)
{
// get the migration path from the config
- $path = $input->getArgument('path');
+ $path = (string)$input->getArgument('path');
$format = strtolower($input->getOption('format'));
if (!in_array($format, ['yml', 'json', 'php'])) {
diff --git a/src/Phinx/Db/Adapter/AbstractAdapter.php b/src/Phinx/Db/Adapter/AbstractAdapter.php
index <HASH>..<HASH> 100644
--- a/src/Phinx/Db/Adapter/AbstractAdapter.php
+++ b/src/Phinx/Db/Adapter/AbstractAdapter.php
@@ -256,6 +256,6 @@ abstract class AbstractAdapter implements AdapterInterface
{
$input = $this->getInput();
- return ($input && $input->hasOption('dry-run')) ? $input->getOption('dry-run') : false;
+ return ($input && $input->hasOption('dry-run')) ? (bool)$input->getOption('dry-run') : false;
}
} | Fix errors reported by PHPStan | cakephp_phinx | train | php,php |
20bc5ebe4f55ec1be88e2b3dce95678c78e42087 | diff --git a/client/js/Panels/SetEditor/SetEditorController.js b/client/js/Panels/SetEditor/SetEditorController.js
index <HASH>..<HASH> 100644
--- a/client/js/Panels/SetEditor/SetEditorController.js
+++ b/client/js/Panels/SetEditor/SetEditorController.js
@@ -28,6 +28,7 @@ define(['js/Utils/GMEConcepts',
SetEditorController.prototype.getOrderedMemberListInfo = function (memberListContainerObject) {
var result = [],
+ aspects = this._client.getMetaAspectNames(this._memberListContainerID) || [],
setNames = memberListContainerObject.getSetNames() || [],
manualAspectsRegistry = memberListContainerObject.getRegistry(REGISTRY_KEYS.CROSSCUTS) || [],
manualAspectSetNames = [],
@@ -38,7 +39,7 @@ define(['js/Utils/GMEConcepts',
manualAspectSetNames.push(element.SetID);
});
- setNames = _.difference(setNames, manualAspectSetNames);
+ setNames = _.difference(setNames, manualAspectSetNames, aspects);
len = setNames.length;
while (len--) { | bugfix: filter out aspect names from getSetNames
Former-commit-id: 9cbb<I>d<I>c<I>c<I>f<I>caf4 | webgme_webgme-engine | train | js |
5cd11d51c19321981a6234a7765c7a5be6913433 | diff --git a/python/pyspark/shell.py b/python/pyspark/shell.py
index <HASH>..<HASH> 100644
--- a/python/pyspark/shell.py
+++ b/python/pyspark/shell.py
@@ -29,6 +29,9 @@ from pyspark.storagelevel import StorageLevel
# this is the equivalent of ADD_JARS
add_files = os.environ.get("ADD_FILES").split(',') if os.environ.get("ADD_FILES") != None else None
+if os.environ.get("SPARK_EXECUTOR_URI"):
+ SparkContext.setSystemProperty("spark.executor.uri", os.environ["SPARK_EXECUTOR_URI"])
+
sc = SparkContext(os.environ.get("MASTER", "local[*]"), "PySparkShell", pyFiles=add_files)
print """Welcome to | Set spark.executor.uri from environment variable (needed by Mesos)
The Mesos backend uses this property when setting up a slave process. It is similarly set in the Scala repl (org.apache.spark.repl.SparkILoop), but I couldn't find any analogous for pyspark. | apache_spark | train | py |
080719ca72ee7afaa3f4856a262db96234907e82 | diff --git a/root_pandas/readwrite.py b/root_pandas/readwrite.py
index <HASH>..<HASH> 100644
--- a/root_pandas/readwrite.py
+++ b/root_pandas/readwrite.py
@@ -389,6 +389,15 @@ def to_root(df, path, key='my_ttree', mode='w', store_index=True, *args, **kwarg
raise IOError("cannot open file {0}".format(path))
if not rfile.IsWritable():
raise IOError("file {0} is not writable".format(path))
+
+ # Navigate to the requested directory
+ for d_name in key.split('/')[:-1]:
+ rfile = rfile.mkdir(d_name)
+ rfile.cd()
+
+ # The key is now just the top component
+ key = key.split('/')[-1]
+
# If a tree with that name exists, we want to update it
existing_tree = rfile.Get(key)
tree = array2tree(arr, name=key, tree=existing_tree) | Allow trees to be written to folders | scikit-hep_root_pandas | train | py |
520cfaeaed6d66f98e2038534dae9a7a3e849f49 | diff --git a/lib/layers/headers.js b/lib/layers/headers.js
index <HASH>..<HASH> 100644
--- a/lib/layers/headers.js
+++ b/lib/layers/headers.js
@@ -5,6 +5,7 @@
var path = require('path'),
express = require('express'),
async = require('async'),
+ nodeurl = require('url'),
/** cache values */
ONE_HOUR = 60 * 60,
@@ -139,8 +140,9 @@ module.exports = function(options) {
// If the url does not contain any valid file extension, let other middlewares handle the `content-type`.
// It may be some dynamic content handled by express router for example.
- if (!/\/$/.test(url)) {
- type = mime.lookup(url);
+ var urlPath = nodeurl.parse(url).pathname;
+ if (!/\/$/.test(urlPath)) {
+ type = mime.lookup(urlPath);
res.setHeader('Content-Type', type);
} | Parse URL and use path to lookup mime type
Lookups were failing when query params existed on the path, resulting
in a content-type of application/octet-stream.
Using the path instead resolves this issue.
related to #7
related to #<I> | h5bp_server-configs-node | train | js |
bbe799e1e03396dfe0375a2dc4daa8239788929a | diff --git a/klab/cluster_template/cluster_template.py b/klab/cluster_template/cluster_template.py
index <HASH>..<HASH> 100644
--- a/klab/cluster_template/cluster_template.py
+++ b/klab/cluster_template/cluster_template.py
@@ -182,7 +182,12 @@ class ClusterTemplate():
def verify_internal_data(self):
first_job_dict_len = len(self.job_dicts[0])
for job_dict in self.job_dicts[1:]:
- assert( len(job_dict) == first_job_dict_len )
+ if len(job_dict) != first_job_dict_len:
+ print self.job_dicts[0]
+ print
+ print job_dict
+ print first_job_dict_len, len(job_dict)
+ raise AssertionError
for arg in self.list_required_arguments:
assert( arg + '_list' in self.settings_dict )
self.format_settings_dict() | Replacing assertion with extra debugging information | Kortemme-Lab_klab | train | py |
681200ffd6cca147fd2dc6718c80ec700962d905 | diff --git a/third_party/tvcm/src/tvcm/ui/pie_chart.js b/third_party/tvcm/src/tvcm/ui/pie_chart.js
index <HASH>..<HASH> 100644
--- a/third_party/tvcm/src/tvcm/ui/pie_chart.js
+++ b/third_party/tvcm/src/tvcm/ui/pie_chart.js
@@ -97,8 +97,11 @@ tvcm.exportTo('tvcm.ui', function() {
}
});
+ var titleWidth = this.querySelector(
+ '#title').getBoundingClientRect().width;
return {
- width: 2 * MIN_RADIUS + 2 * maxLabelWidth,
+ width: Math.max(2 * MIN_RADIUS + 2 * maxLabelWidth,
+ titleWidth * 1.1),
height: 40 + Math.max(2 * MIN_RADIUS,
leftTextHeightSum,
rightTextHeightSum) * 1.25 | Include titleWidth in minSize computation | catapult-project_catapult | train | js |
7bc63d9c6749e63d84a372fc7dcf1418c8db7840 | diff --git a/lib/radiant/gem_dependency_fix.rb b/lib/radiant/gem_dependency_fix.rb
index <HASH>..<HASH> 100644
--- a/lib/radiant/gem_dependency_fix.rb
+++ b/lib/radiant/gem_dependency_fix.rb
@@ -7,12 +7,11 @@ module Rails
@load_paths_added = @loaded = @frozen = true
return
end
- self.name
- # if self.requirement
- # gem self.name, "#{self.requirement.requirements}"
- # else
- # gem self.name
- # end
+ if self.requirement
+ gem self.name, "#{self.requirement.requirements}"
+ else
+ gem self.name
+ end
@spec = Gem.loaded_specs[name]
@frozen = @spec.loaded_from.include?(self.class.unpacked_path) if @spec
@load_paths_added = true | undo this change since it doesn't allow specifying of versions | radiant_radiant | train | rb |
8ec7120a785454156e694918c40c791732ef72f7 | diff --git a/OAuth/Response/PathUserResponse.php b/OAuth/Response/PathUserResponse.php
index <HASH>..<HASH> 100644
--- a/OAuth/Response/PathUserResponse.php
+++ b/OAuth/Response/PathUserResponse.php
@@ -87,7 +87,15 @@ class PathUserResponse extends AbstractUserResponse
*/
protected function getValueForPath($path, $exception = true)
{
- $steps = explode('.', $this->getPath($path));
+ try {
+ $steps = explode('.', $this->getPath($path));
+ } catch (AuthenticationException $e) {
+ if (!$exception) {
+ return null;
+ }
+
+ throw $e;
+ }
$value = $this->response;
foreach ($steps as $step) { | getPath throws exception so we must catch it in getValueForPath; | hwi_HWIOAuthBundle | train | php |
3d8584435b148310493c6b5584f954ac3089fc11 | diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/RemoveUserActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/RemoveUserActionTest.java
index <HASH>..<HASH> 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/RemoveUserActionTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/RemoveUserActionTest.java
@@ -23,6 +23,7 @@ import org.junit.Before;
import org.junit.Test;
import org.sonar.api.web.UserRole;
import org.sonar.db.component.ComponentDto;
+import org.sonar.db.organization.OrganizationDto;
import org.sonar.db.user.UserDto;
import org.sonar.server.exceptions.BadRequestException;
import org.sonar.server.exceptions.ForbiddenException;
@@ -276,6 +277,10 @@ public class RemoveUserActionTest extends BasePermissionWsTest<RemoveUserAction>
}
private void loginAsAdmin() {
- userSession.login("admin").setGlobalPermissions(SYSTEM_ADMIN);
+ loginAsOrganizationAdmin(db.getDefaultOrganization());
+ }
+
+ private void loginAsOrganizationAdmin(OrganizationDto org) {
+ userSession.login().addOrganizationPermission(org.getUuid(), SYSTEM_ADMIN);
}
} | SONAR-<I> verify authorization on organization | SonarSource_sonarqube | train | java |
994de5a691e7fbebc93bef4bdaa92c15de612b3c | diff --git a/clint/utils.py b/clint/utils.py
index <HASH>..<HASH> 100644
--- a/clint/utils.py
+++ b/clint/utils.py
@@ -1,5 +1,9 @@
# -*- coding: utf-8 -*-
+
import sys
+import errno
+from os import makedirs
+
def progressbar(it, prefix='', size=32, hide=False):
@@ -27,7 +31,8 @@ def is_collection(obj):
return False
return hasattr(obj, '__getitem__')
-
+
+
def fixedwidth(string, width=15):
"""Adds column to output steam."""
if len(string) > width:
@@ -39,8 +44,9 @@ def fixedwidth(string, width=15):
def mkdir_p(path):
"""mkdir -p"""
try:
- os.makedirs(path)
+ makedirs(path)
except OSError as exc: # Python >2.5
if exc.errno == errno.EEXIST:
pass
- else: raise
\ No newline at end of file
+ else:
+ raise | errno support to mkdir_p | kennethreitz_clint | train | py |
161a7822bacc5905f5fe0dfcc936ef5b1538e07b | diff --git a/tests/lax_numpy_indexing_test.py b/tests/lax_numpy_indexing_test.py
index <HASH>..<HASH> 100644
--- a/tests/lax_numpy_indexing_test.py
+++ b/tests/lax_numpy_indexing_test.py
@@ -757,6 +757,11 @@ class IndexingTest(jtu.JaxTestCase):
x = lnp.array([1, 2, 3])
self.assertRaises(TypeError, lambda: x[3.5])
+ def testIndexOutOfBounds(self): # https://github.com/google/jax/issues/2245
+ array = lnp.ones(5)
+ self.assertAllClose(array, array[:10], check_dtypes=True)
+
+
def _broadcastable_shapes(shape):
"""Returns all shapes that broadcast to `shape`."""
def f(rshape): | Added test case for indexing out of bounds | tensorflow_probability | train | py |
53baafb9aa19f87a514b7ceffdd765368049f3cf | diff --git a/test/helper.rb b/test/helper.rb
index <HASH>..<HASH> 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -9,4 +9,9 @@ require 'docusign_login_config'
VCR.configure do |c|
c.cassette_library_dir = "test/fixtures/vcr"
c.hook_into :fakeweb
+
+ c.filter_sensitive_data('%ACCOUNT_ID%') { DocusignRest.account_id }
+ c.filter_sensitive_data('%USERNAME%') { DocusignRest.username }
+ c.filter_sensitive_data('%PASSWORD%') { DocusignRest.password }
+ c.filter_sensitive_data('%INTEGRATOR_KEY%') { DocusignRest.integrator_key }
end | Filter sensitive data from VCR cassets | jondkinney_docusign_rest | train | rb |
a4244749671cb33b09ae0006ccec8490063a7db2 | diff --git a/src/presenters/UsersPresenter.php b/src/presenters/UsersPresenter.php
index <HASH>..<HASH> 100644
--- a/src/presenters/UsersPresenter.php
+++ b/src/presenters/UsersPresenter.php
@@ -8,6 +8,7 @@ use Crm\ApplicationModule\User\DownloadUserData;
use Crm\UsersModule\Auth\Access\AccessToken;
use Crm\UsersModule\Auth\UserManager;
use Crm\UsersModule\Events\NotificationEvent;
+use Crm\UsersModule\Events\UserSignOutEvent;
use Crm\UsersModule\Forms\ChangePasswordFormFactory;
use Crm\UsersModule\Forms\RequestPasswordFormFactory;
use Crm\UsersModule\Forms\ResetPasswordFormFactory;
@@ -87,6 +88,11 @@ class UsersPresenter extends FrontendPresenter
public function renderResetPassword($id)
{
+ if ($this->getUser()->isLoggedIn()) {
+ $this->emitter->emit(new UserSignOutEvent($this->getUser()));
+ $this->getUser()->logout(true);
+ }
+
if (is_null($id)) {
$this->redirect('requestPassword');
} | Fixes logout when reseting password
n_token was not previously invalidated, therefore user was re-logged on subsequent AJAX request
remp/helpdesk#<I> | remp2020_crm-users-module | train | php |
dafd9901a79832c724eacaff9e2ab079e8641149 | diff --git a/java/src/com/google/template/soy/i18ndirectives/FormatNumDirective.java b/java/src/com/google/template/soy/i18ndirectives/FormatNumDirective.java
index <HASH>..<HASH> 100644
--- a/java/src/com/google/template/soy/i18ndirectives/FormatNumDirective.java
+++ b/java/src/com/google/template/soy/i18ndirectives/FormatNumDirective.java
@@ -113,6 +113,8 @@ class FormatNumDirective implements SoyJavaPrintDirective, SoyLibraryAssistedJsS
if (args.size() > 1) {
// A keyword for ULocale was passed (like 'native', for instance, to use native characters).
uLocale = uLocale.setKeywordValue("numbers", args.get(1).stringValue());
+ } else {
+ uLocale.setKeywordValue("numbers", "local");
}
NumberFormat numberFormat; | Default to 'local' Character set for numbers in Java renderer.
Closure will, by default, use local characters for number formatting, which
means that for some locales, Soy templates formatted by JavaScript and Java
will differ under the current behavior. This unifies the behavior.
-------------
Created by MOE: <URL> | google_closure-templates | train | java |
729be1ab37a2eb35cbda4a3ca8be2bf70bdfd3c1 | diff --git a/lib/weblib.php b/lib/weblib.php
index <HASH>..<HASH> 100644
--- a/lib/weblib.php
+++ b/lib/weblib.php
@@ -273,6 +273,13 @@ function text_to_html($text, $smiley=true, $para=true) {
$text = eregi_replace("([[:space:]])www.([^[:space:]]*)([[:alnum:]#?/&=])",
"\\1<A HREF=\"http://www.\\2\\3\" TARGET=\"newpage\">www.\\2\\3</A>", $text);
+ // Remove any whitespace that may be between HTML tags
+ $text = eregi_replace(">([[:space:]]+)<", "><", $text);
+
+ // Remove any returns that precede or follow HTML tags
+ $text = eregi_replace("([\n\r])+<", " <", $text);
+ $text = eregi_replace(">([\n\r])+", "> ", $text);
+
// Make returns into HTML newlines.
$text = nl2br($text); | Experimental filters to remove returns from before and after tags, which
should mean neater formatting of lists and so on. Needs testing. | moodle_moodle | train | php |
9b8eee454387dc86ad2cda08c019c9362b67a596 | diff --git a/openquake/engine/performance.py b/openquake/engine/performance.py
index <HASH>..<HASH> 100644
--- a/openquake/engine/performance.py
+++ b/openquake/engine/performance.py
@@ -57,7 +57,7 @@ class EnginePerformanceMonitor(PerformanceMonitor):
self.task = None
self.task_id = None
self.tracing = tracing
- self.flush = flush
+ self._flush = flush
if tracing:
self.tracer = logs.tracing(operation)
@@ -69,7 +69,7 @@ class EnginePerformanceMonitor(PerformanceMonitor):
in the same task.
"""
return self.__class__(operation, self.job_id, self.task,
- self.tracing, self.flush)
+ self.tracing, self._flush)
def on_exit(self):
"""
@@ -86,7 +86,7 @@ class EnginePerformanceMonitor(PerformanceMonitor):
pymemory=self.mem,
pgmemory=None)
self.cache.add(perf)
- if self.flush:
+ if self._flush:
self.cache.flush()
def __enter__(self):
@@ -100,7 +100,7 @@ class EnginePerformanceMonitor(PerformanceMonitor):
if self.tracing:
self.tracer.__exit__(etype, exc, tb)
-## makes sure the performance results are flushed in the db at the end
+# make sure the performance results are flushed in the db at the end
atexit.register(EnginePerformanceMonitor.cache.flush) | Removed the confusion with the flush method introduced in risklib
Former-commit-id: fdaf<I>e3aa<I>a<I>d<I>b6bc<I>efc2cc | gem_oq-engine | train | py |
75713f806fd514eb24ae97d33dd0afeed3a091b8 | diff --git a/src/Assetic/Filter/Yui/BaseCompressorFilter.php b/src/Assetic/Filter/Yui/BaseCompressorFilter.php
index <HASH>..<HASH> 100644
--- a/src/Assetic/Filter/Yui/BaseCompressorFilter.php
+++ b/src/Assetic/Filter/Yui/BaseCompressorFilter.php
@@ -77,12 +77,8 @@ abstract class BaseCompressorFilter implements FilterInterface
$options[] = $this->lineBreak;
}
- $options[] = $input = tempnam(sys_get_temp_dir(), 'assetic');
- file_put_contents($input, $content);
-
- $proc = new Process(implode(' ', array_map('escapeshellarg', $options)));
+ $proc = new Process(implode(' ', array_map('escapeshellarg', $options)), null, array(), $content);
$code = $proc->run();
- unlink($input);
if (0 < $code) {
throw new \RuntimeException($proc->getErrorOutput()); | updated yui filter to use stdin | kriswallsmith_assetic | train | php |
d4c07640b64d1d5691222f828df8c1a882f58136 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -7,6 +7,8 @@ module.exports = exports = function(options) {
var defaults = {
pattern: ['**/*.css', '!**/_*/*', '!**/_*'],
parser: undefined,
+ stringifier: undefined,
+ syntax: undefined,
plugins: {},
map: {inline: true},
removeExcluded: false
@@ -58,6 +60,8 @@ module.exports = exports = function(options) {
from: path.join(metalsmith._source, key),
to: path.join(metalsmith._destination, key),
parser: options.parser,
+ stringifier: options.stringifier,
+ syntax: options.syntax,
map: options.map
})
.then((function(file, result) { | Also added the stringifier and syntax options. | arccoza_metalsmith-with-postcss | train | js |
1cb261bce94e7eb5bccccd282f938074e758f5bc | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -8,11 +8,14 @@ import setuptools
_metadata = {}
with open("src/txkube/_metadata.py") as f:
exec(f.read(), _metadata)
+with open("README.rst") as f:
+ _metadata["description"] = f.read()
setuptools.setup(
name="txkube",
version=_metadata["version_string"],
description="A Twisted-based Kubernetes client.",
+ long_description=_metadata["description"],
author="txkube Developers",
url="https://github.com/leastauthority.com/txkube",
license="MIT", | Add the README as the long description. | LeastAuthority_txkube | train | py |
465d296d1159479915aac2323f75033eb59af952 | diff --git a/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/message/TransactionApplicationData.java b/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/message/TransactionApplicationData.java
index <HASH>..<HASH> 100644
--- a/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/message/TransactionApplicationData.java
+++ b/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/message/TransactionApplicationData.java
@@ -336,8 +336,15 @@ public class TransactionApplicationData implements Serializable, MobicentsTransa
* @return the sipSessionKey
*/
public MobicentsSipSessionKey getSipSessionKey() {
- if(sipServletMessage != null) {
- return sipServletMessage.getSipSessionKey();
+ if(logger.isDebugEnabled()) {
+ logger.debug("local session Key is " + sipSessionKey);
+ }
+ if(sipSessionKey == null && sipServletMessage != null) {
+ MobicentsSipSessionKey sessionKey = sipServletMessage.getSipSessionKey();
+ if(logger.isDebugEnabled()) {
+ logger.debug("session Key from sipservletmessage is " + sessionKey);
+ }
+ sipSessionKey = sessionKey;
}
return sipSessionKey;
} | Issue #<I> fixing code to return the local key first if it's not null | RestComm_sip-servlets | train | java |
568a244dc03854ff120fa943930bf4fb2e25a927 | diff --git a/synth.py b/synth.py
index <HASH>..<HASH> 100644
--- a/synth.py
+++ b/synth.py
@@ -54,5 +54,5 @@ s.copy(templates)
# Node.js specific cleanup
# '''
subprocess.run(['npm', 'install'])
-subprocess.run(['npm', 'run', 'lint'])
+subprocess.run(['npm', 'run', 'fix'])
subprocess.run(['npx', 'compileProtos', 'src']) | chore: run fix instead of lint in synthfile (#<I>) | googleapis_nodejs-spanner | train | py |
ba4ef363ca01cba2114297efb68c293daf1fbce8 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -273,13 +273,13 @@ module.exports = function(options) {
function acceptGlobalOptions() {
// Truly global options not specific to a module
-
if (options.testModule) {
// Test command lines have arguments not
// intended as command line task arguments
self.argv = {
_: []
};
+ self.options.shortName = self.options.shortName || 'test';
} else {
self.argv = argv;
} | provide a shortname when testModule is in effect | apostrophecms_apostrophe | train | js |
fd674f944882bfd9afb917ecc690a743d10d51bf | diff --git a/src/system/modules/metamodels/MetaModels/DcGeneral/Events/Table/InputScreens/InputScreenBase.php b/src/system/modules/metamodels/MetaModels/DcGeneral/Events/Table/InputScreens/InputScreenBase.php
index <HASH>..<HASH> 100644
--- a/src/system/modules/metamodels/MetaModels/DcGeneral/Events/Table/InputScreens/InputScreenBase.php
+++ b/src/system/modules/metamodels/MetaModels/DcGeneral/Events/Table/InputScreens/InputScreenBase.php
@@ -37,13 +37,13 @@ class InputScreenBase
*/
protected static function getMetaModelFromModel(ModelInterface $model)
{
- if (!(($model->getProviderName() == 'tl_metamodel_dcasetting') && $model->getId()))
+ if (!(($model->getProviderName() == 'tl_metamodel_dcasetting') && $model->getProperty('pid')))
{
throw new DcGeneralInvalidArgumentException(
sprintf(
- 'Model must originate from tl_metamodel_dcasetting and be saved, this one originates from %s and has id %s',
+ 'Model must originate from tl_metamodel_dcasetting and be saved, this one originates from %s and has pid %s',
$model->getProviderName(),
- $model->getId()
+ $model->getProperty('pid')
)
);
} | Handle pid correctly instead of throwing the Exception for new models. | MetaModels_core | train | php |
4ca157cf57cce4c1974ed6cf5af594e4bc0440af | diff --git a/src/main/java/org/mockito/MockingDetails.java b/src/main/java/org/mockito/MockingDetails.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/mockito/MockingDetails.java
+++ b/src/main/java/org/mockito/MockingDetails.java
@@ -105,7 +105,7 @@ public interface MockingDetails {
* <p>
* This method throws meaningful exception when object wrapped by MockingDetails is not a mock.
*
- * @since 2.2.4
+ * @since 2.2.6
*/
String printInvocations();
} | Updated @since tag after the release | mockito_mockito | train | java |
4cc2dda585a6e7f6fa8f801c2be42064204c71d8 | diff --git a/pywal/theme.py b/pywal/theme.py
index <HASH>..<HASH> 100644
--- a/pywal/theme.py
+++ b/pywal/theme.py
@@ -19,8 +19,11 @@ def list_out():
user_themes = [theme.name.replace(".json", "")
for theme in list_themes_user()]
- last_used_theme = util.read_file(os.path.join(
- CACHE_DIR, "last_used_theme"))[0].replace(".json", "")
+ try:
+ last_used_theme = util.read_file(os.path.join(
+ CACHE_DIR, "last_used_theme"))[0].replace(".json", "")
+ except FileNotFoundError:
+ last_used_theme = ""
if user_themes:
print("\033[1;32mUser Themes\033[0m:") | Fix FileNotFoundError if theme has never been set | dylanaraps_pywal | train | py |
1a79bddc21392c5224101b4c5b13b3399682de70 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -126,5 +126,14 @@ exports.decryptData = function(ticket) {
* @param {JSON Object} ticket - ticket need be deleted
*/
exports.delete = function(ticket) {
+ if (!this.isValid(ticket))
+ throw new Error('Ticket is not valid');
+
ticket["expiration"] = new Date(0);
+
+ if (ticket["data"])
+ delete ticket["data"];
+
+ let salt = generateRandomString(SALT_LENGTH);
+ ticket["signature"] = salt + md5(`${salt} : ${ticket["expiration"]} : ${_secret}`);
}
\ No newline at end of file | Fixed bug with ticket re-signing after its deleting | SSharyk_encrypted-ticket | train | js |
c540fd8b84f8a134d577b4096ba5e1df0fbf8977 | diff --git a/test/e2e/apimachinery/webhook.go b/test/e2e/apimachinery/webhook.go
index <HASH>..<HASH> 100644
--- a/test/e2e/apimachinery/webhook.go
+++ b/test/e2e/apimachinery/webhook.go
@@ -500,10 +500,6 @@ func registerWebhookForAttachingPod(f *framework.Framework, context *certContext
namespace := f.Namespace.Name
configName := attachingPodWebhookConfigName
- // A webhook that cannot talk to server, with fail-open policy
- failOpenHook := failingWebhook(namespace, "fail-open.k8s.io")
- policyIgnore := admissionregistrationv1beta1.Ignore
- failOpenHook.FailurePolicy = &policyIgnore
_, err := client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().Create(&admissionregistrationv1beta1.ValidatingWebhookConfiguration{
ObjectMeta: metav1.ObjectMeta{ | cleanup: remove useless code
`failOpenHook` is validate against `configmaps`, it has nothing to
do with pod attaching. | kubernetes_kubernetes | train | go |
fab89070d40bafb40d91c71a370e25dd0f9cd858 | diff --git a/index.php b/index.php
index <HASH>..<HASH> 100644
--- a/index.php
+++ b/index.php
@@ -26,7 +26,7 @@ if (getParam('status') == 'success') {
}
} else {
$payInitParameter = new PayInitParameter();
- $payInitParameter->setAccountid($payInitParameter::SAFERPAYTESTACCOUNT_ACCOUNTID);
+ $payInitParameter->setAccountid(PayInitParameter::SAFERPAYTESTACCOUNT_ACCOUNTID);
$payInitParameter->setAmount($amount);
$payInitParameter->setCurrency($currency);
$payInitParameter->setDescription(sprintf('Ordernumber: %s', '000001')); | fix mistake, the class (interface) is meant for constant | payment_saferpay | train | php |
709f7efd46f0c0e7bb2ab6d34c61240336c55ad4 | diff --git a/lib/hammer_cli_katello/product.rb b/lib/hammer_cli_katello/product.rb
index <HASH>..<HASH> 100644
--- a/lib/hammer_cli_katello/product.rb
+++ b/lib/hammer_cli_katello/product.rb
@@ -30,6 +30,8 @@ module HammerCLIKatello
end
class InfoCommand < HammerCLIKatello::InfoCommand
+ include HammerCLIKatello::ScopedNameCommand
+
output do
field :id, "Product ID"
field :name, "Name"
@@ -58,7 +60,6 @@ module HammerCLIKatello
end
end
- apipie_options
end
class UpdateCommand < HammerCLIKatello::UpdateCommand
@@ -69,6 +70,7 @@ module HammerCLIKatello
end
class DeleteCommand < HammerCLIKatello::DeleteCommand
+ include HammerCLIKatello::ScopedNameCommand
success_message "Product destroyed"
failure_message "Could not destroy the product" | Add name/orgid lookup to info and delete commands
To test this you will need <URL> | Katello_hammer-cli-katello | train | rb |
c29f4a38ee8beeb9d3dffd0fd444b43d4affb98d | diff --git a/src/Repo/Agg/Def/Account/Mapper.php b/src/Repo/Agg/Def/Account/Mapper.php
index <HASH>..<HASH> 100644
--- a/src/Repo/Agg/Def/Account/Mapper.php
+++ b/src/Repo/Agg/Def/Account/Mapper.php
@@ -15,7 +15,7 @@ class Mapper
public function __construct()
{
parent::__construct();
- $this->_map[Agg::AS_REF] = Repo::AS_DOWNLINE . '.' . Customer::ATTR_HUMAN_REF;
+ $this->map[Agg::AS_REF] = Repo::AS_DOWNLINE . '.' . Customer::ATTR_HUMAN_REF;
}
}
\ No newline at end of file | MOBI-<I> - Code review for admin grids | praxigento_mobi_mod_downline | train | php |
3c2f3010785d8061415dbb3bac04be312123b931 | diff --git a/activerecord/test/cases/adapters/mysql2/mysql2_adapter_test.rb b/activerecord/test/cases/adapters/mysql2/mysql2_adapter_test.rb
index <HASH>..<HASH> 100644
--- a/activerecord/test/cases/adapters/mysql2/mysql2_adapter_test.rb
+++ b/activerecord/test/cases/adapters/mysql2/mysql2_adapter_test.rb
@@ -200,7 +200,7 @@ class Mysql2AdapterTest < ActiveRecord::Mysql2TestCase
def test_doesnt_error_when_a_set_query_is_called_while_preventing_writes
@conn.while_preventing_writes do
- assert_nil @conn.execute("SET NAMES utf8")
+ assert_nil @conn.execute("SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci")
end
end | Don't change `collation_connection` in the current connection
We have a test case for `collation_connection` session variable, so it
should not be changed in any other test.
Fixes #<I>. | rails_rails | train | rb |
5c8d9b83d1607f239c3e0595aa5bac7873de8bcf | diff --git a/Classes/Facet/AbstractFacetRenderer.php b/Classes/Facet/AbstractFacetRenderer.php
index <HASH>..<HASH> 100644
--- a/Classes/Facet/AbstractFacetRenderer.php
+++ b/Classes/Facet/AbstractFacetRenderer.php
@@ -26,6 +26,7 @@ namespace ApacheSolrForTypo3\Solr\Facet;
use ApacheSolrForTypo3\Solr\Query\LinkBuilder;
use ApacheSolrForTypo3\Solr\Search;
+use ApacheSolrForTypo3\Solr\System\Configuration\TypoScriptConfiguration;
use ApacheSolrForTypo3\Solr\Template;
use ApacheSolrForTypo3\Solr\Util;
use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -64,7 +65,9 @@ abstract class AbstractFacetRenderer implements FacetRenderer
protected $facetConfiguration;
/**
- * @var array
+ * Configuration
+ *
+ * @var TypoScriptConfiguration
*/
protected $solrConfiguration; | [TASK] Fix scrutinizer issues in AbstractFacetRenderer | TYPO3-Solr_ext-solr | train | php |
d301d8c25e49c842a24b27c2c050aaebac768721 | diff --git a/salt/modules/sysrc.py b/salt/modules/sysrc.py
index <HASH>..<HASH> 100644
--- a/salt/modules/sysrc.py
+++ b/salt/modules/sysrc.py
@@ -2,12 +2,17 @@
'''
sysrc module for FreeBSD
'''
+
+# Import Python libs
from __future__ import absolute_import
+# Import Salt libs
import salt.utils
from salt.exceptions import CommandExecutionError
+__virtualname__ = 'sysrc'
+
__func_alias__ = {
'set_': 'set'
}
@@ -17,7 +22,9 @@ def __virtual__():
'''
Only runs if sysrc exists
'''
- return salt.utils.which_bin('sysrc')
+ if salt.utils.which_bin('sysrc') is not None:
+ return True
+ return False
def get(**kwargs): | The return value of `__virtual__` should never be `None` | saltstack_salt | train | py |
f4ba8087912ec6ebecdd1a3c506ca05ff91236f3 | diff --git a/lib/rubocop/cop/lint/shadowed_exception.rb b/lib/rubocop/cop/lint/shadowed_exception.rb
index <HASH>..<HASH> 100644
--- a/lib/rubocop/cop/lint/shadowed_exception.rb
+++ b/lib/rubocop/cop/lint/shadowed_exception.rb
@@ -155,16 +155,6 @@ module RuboCop
end
end
- # @param [RuboCop::AST::Node] rescue_group is a node of array_type
- def rescued_exceptions(rescue_group)
- klasses = *rescue_group
- klasses.map do |klass|
- next unless klass.const_type?
-
- klass.source
- end.compact
- end
-
def find_shadowing_rescue(rescues)
rescued_groups = rescued_groups_for(rescues)
rescued_groups.zip(rescues).each do |group, res| | Remove an unused method
Follow up #<I>. | rubocop-hq_rubocop | train | rb |
b1e2372761efbe9c13c37fd0a43b1ffabd9bf53f | diff --git a/mlaunch.py b/mlaunch.py
index <HASH>..<HASH> 100755
--- a/mlaunch.py
+++ b/mlaunch.py
@@ -1,8 +1,7 @@
#!/usr/bin/python
from pymongo import Connection
-from pymongo.connection import AutoReconnect
-from pymongo.errors import OperationFailure
+from pymongo.errors import AutoReconnect, OperationFailure
import subprocess
import argparse
import threading | changed AutoReconnect import path from to pymongo.errors. | rueckstiess_mtools | train | py |
32356cceee19951c40f0f81c64d51d073d43260a | diff --git a/test/spec.js b/test/spec.js
index <HASH>..<HASH> 100644
--- a/test/spec.js
+++ b/test/spec.js
@@ -67,13 +67,13 @@ describe( "Toposort", function() {
var t = new Toposort();
t.add( "3", "1" )
- .add( "2", "3" )
- .add( "4", ["2", "3"] )
- .add( "5", ["3", "4"] )
.add( "6", ["3", "4", "5"] )
.add( "7", "1" )
- .add( "8", ["1", "2", "3", "4", "5"] )
- .add( "9", ["8", "6", "7"] );
+ .add( "9", ["8", "6", "7"] )
+ .add( "4", ["2", "3"] )
+ .add( "2", "3" )
+ .add( "5", ["3", "4"] )
+ .add( "8", ["1", "2", "3", "4", "5"] );
var out = t.sort().reverse(); | test: Shuffle the add order for the more complex test | gustavohenke_toposort | train | js |
6aba1e7df2506404ee597290416642b9de8344d0 | diff --git a/core/src/test/java/org/testcontainers/junit/wait/HostPortWaitStrategyTest.java b/core/src/test/java/org/testcontainers/junit/wait/HostPortWaitStrategyTest.java
index <HASH>..<HASH> 100644
--- a/core/src/test/java/org/testcontainers/junit/wait/HostPortWaitStrategyTest.java
+++ b/core/src/test/java/org/testcontainers/junit/wait/HostPortWaitStrategyTest.java
@@ -18,7 +18,7 @@ public class HostPortWaitStrategyTest extends AbstractWaitStrategyTest<HostPortW
*/
@Test
public void testWaitUntilReady_Success() {
- waitUntilReadyAndSucceed("nc -lp 8080");
+ waitUntilReadyAndSucceed("while true; do nc -lp 8080; done");
}
/** | Improve reliability of HostPortWaitStrategyTest | testcontainers_testcontainers-java | train | java |
1e0aa6aa710eff5993aee8291ad3f0575d9e8036 | diff --git a/jquery.maskMoney.js b/jquery.maskMoney.js
index <HASH>..<HASH> 100644
--- a/jquery.maskMoney.js
+++ b/jquery.maskMoney.js
@@ -244,17 +244,17 @@
}
}
- input.bind('keypress',keypressEvent);
- input.bind('keydown',keydownEvent);
- input.bind('blur',blurEvent);
- input.bind('focus',focusEvent);
+ input.bind('keypress.maskMoney',keypressEvent);
+ input.bind('keydown.maskMoney',keydownEvent);
+ input.bind('blur.maskMoney',blurEvent);
+ input.bind('focus.maskMoney',focusEvent);
input.bind('mask', mask);
input.one('unmaskMoney',function() {
- input.unbind('focus',focusEvent);
- input.unbind('blur',blurEvent);
- input.unbind('keydown',keydownEvent);
- input.unbind('keypress',keypressEvent);
+ input.unbind('focus.maskMoney',focusEvent);
+ input.unbind('blur.maskMoney',blurEvent);
+ input.unbind('keydown.maskMoney',keydownEvent);
+ input.unbind('keypress.maskMoney',keypressEvent);
if ($.browser.msie) {
this.onpaste= null; | Added namespace to jQuery events to avoid conflicts with any other plugins. | plentz_jquery-maskmoney | train | js |
8c4ea64b0d45b45bd30c622642083dff97f6831c | diff --git a/salt/utils/gitfs.py b/salt/utils/gitfs.py
index <HASH>..<HASH> 100644
--- a/salt/utils/gitfs.py
+++ b/salt/utils/gitfs.py
@@ -954,6 +954,9 @@ class Pygit2(GitProvider):
the empty directories within it in the "blobs" list
'''
for entry in iter(tree):
+ if entry.oid not in self.repo:
+ # Entry is a submodule, skip it
+ continue
blob = self.repo[entry.oid]
if not isinstance(blob, pygit2.Tree):
continue
@@ -1065,6 +1068,9 @@ class Pygit2(GitProvider):
the file paths and symlink info in the "blobs" dict
'''
for entry in iter(tree):
+ if entry.oid not in self.repo:
+ # Entry is a submodule, skip it
+ continue
obj = self.repo[entry.oid]
if isinstance(obj, pygit2.Blob):
repo_path = os.path.join(prefix, entry.name) | pygit2: skip submodules when traversing tree
Submodules cannot at this time be traversed by Pygit2 in the same way as
directories. Ignore them when traversing to get the file_list or
dir_list.
Fixes #<I> | saltstack_salt | train | py |
936dc2142101a05e9dd108fdf6497069bf8fd9be | diff --git a/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityTaskReconciliation.java b/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityTaskReconciliation.java
index <HASH>..<HASH> 100644
--- a/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityTaskReconciliation.java
+++ b/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityTaskReconciliation.java
@@ -99,6 +99,7 @@ public class SingularityTaskReconciliation implements Managed {
if (!schedulerDriver.isPresent()) {
LOG.trace("Not running reconciliation - no schedulerDriver present");
+ isRunningReconciliation.set(false);
return ReconciliationState.NO_DRIVER;
} | Fix reconciler lockup with no driver present.
Otherwise, if the reconciler runs without a driver, it will lock up and never run again. | HubSpot_Singularity | train | java |
96213f82a44be646d1c337ff5543fb157b0bb253 | diff --git a/src/main/java/com/aoindustries/website/framework/WebPage.java b/src/main/java/com/aoindustries/website/framework/WebPage.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/aoindustries/website/framework/WebPage.java
+++ b/src/main/java/com/aoindustries/website/framework/WebPage.java
@@ -336,7 +336,7 @@ abstract public class WebPage extends ErrorReportingServlet {
resp,
redirect,
EmptyURIParameters.getInstance(),
- false,
+ true,
false,
LastModifiedServlet.AddLastModifiedWhen.FALSE,
page.getRedirectType()
@@ -427,7 +427,7 @@ abstract public class WebPage extends ErrorReportingServlet {
resp,
redirect,
EmptyURIParameters.getInstance(),
- false,
+ true,
false,
LastModifiedServlet.AddLastModifiedWhen.FALSE,
page.getRedirectType() | Sending absolute URLs in redirect for maximum backwards compatibility. | aoindustries_aoweb-framework | train | java |
1f15ae36b43894c2d21d9834cc231e95aa19693b | diff --git a/infoqscraper/presentation.py b/infoqscraper/presentation.py
index <HASH>..<HASH> 100644
--- a/infoqscraper/presentation.py
+++ b/infoqscraper/presentation.py
@@ -228,6 +228,10 @@ class Downloader(object):
DownloadFailedException is raised if some resources cannot be fetched.
"""
+ # Avoid wasting time and bandwidth if we known that conversion will fail.
+ if not self.overwrite and os.path.exists(self.output):
+ raise Exception("File %s already exist and --overwrite not specified" % self.output)
+
video = self.download_video()
raw_slides = self.download_slides() | Better --overwrite handling.
It makes no sense wasting time and bandwidth if the file already exist.
It is better to check if the file exist before doing anything | cykl_infoqscraper | train | py |
0f1fcd3f5596bede9a3d29e62b085d91dde8b25f | diff --git a/library/CM/Search/Index/Cli.php b/library/CM/Search/Index/Cli.php
index <HASH>..<HASH> 100644
--- a/library/CM/Search/Index/Cli.php
+++ b/library/CM/Search/Index/Cli.php
@@ -12,7 +12,6 @@ class CM_Search_Index_Cli extends CM_Cli_Runnable_Abstract {
$indexes = $this->_getIndexes();
}
foreach ($indexes as $index) {
- $this->_echo('Creating search index `' . $index->getIndex()->getName() . '`...');
$index->createVersioned();
$index->getIndex()->refresh();
} | t<I>: Remove echo again, until we have the OutputStream stuff | cargomedia_cm | train | php |
fd7490e3e2171e9c4cc5f3e94f415c1ddd457260 | diff --git a/pkg/model/openstackmodel/servergroup.go b/pkg/model/openstackmodel/servergroup.go
index <HASH>..<HASH> 100644
--- a/pkg/model/openstackmodel/servergroup.go
+++ b/pkg/model/openstackmodel/servergroup.go
@@ -174,7 +174,7 @@ func (b *ServerGroupModelBuilder) buildInstances(c *fi.ModelBuilderContext, sg *
instanceTask.FloatingIP = t
}
default:
- if !b.UsesSSHBastion() {
+ if b.Cluster.Spec.Topology.Nodes == "public" {
t := &openstacktasks.FloatingIP{
Name: fi.String(fmt.Sprintf("%s-%s", "fip", *instanceTask.Name)),
Lifecycle: b.Lifecycle, | Only add floating IPs to nodes if we have a public topology for nodes | kubernetes_kops | train | go |
8b27187882bb80f2dfc05f1365c88620f72033ac | diff --git a/lib/geometry/obround.rb b/lib/geometry/obround.rb
index <HASH>..<HASH> 100644
--- a/lib/geometry/obround.rb
+++ b/lib/geometry/obround.rb
@@ -40,7 +40,7 @@ The {Obround} class cluster represents a rectangle with semicircular end caps
def self.new(*args)
case args.size
when 1
- CenteredRectangle.new(args[0])
+ CenteredObround.new(args[0])
when 2
if args.all? {|a| a.is_a?(Numeric) }
CenteredObround.new(Size[*args]) | Fixed bad copypasta in Obround | bfoz_geometry | train | rb |
afe100df3756d50002083b80a9d1b91d58b3d503 | diff --git a/stomp/utils.py b/stomp/utils.py
index <HASH>..<HASH> 100644
--- a/stomp/utils.py
+++ b/stomp/utils.py
@@ -1,4 +1,7 @@
-import hashlib
+try:
+ from hashlib import md5
+except ImportError:
+ from md5 import new as md5
import time
import random
@@ -17,7 +20,7 @@ def _uuid( *args ):
# if we can't get a network address, just imagine one
a = random.random() * 100000000000000000L
data = str(t) + ' ' + str(r) + ' ' + str(a) + ' ' + str(args)
- md5 = hashlib.md5()
+ md5 = md5()
md5.update(data)
data = md5.hexdigest()
return data | support for pre-<I> versions of Python (patch provided by Martin Pieuchot) | jasonrbriggs_stomp.py | train | py |
8a03728650b87839255de5da977c830970669858 | diff --git a/pyfolio/tests/test_timeseries.py b/pyfolio/tests/test_timeseries.py
index <HASH>..<HASH> 100644
--- a/pyfolio/tests/test_timeseries.py
+++ b/pyfolio/tests/test_timeseries.py
@@ -339,7 +339,7 @@ class TestStats(TestCase):
expected, DECIMAL_PLACES)
def test_tail_ratio(self):
- returns = np.random.randn(1000)
+ returns = np.random.randn(10000)
self.assertAlmostEqual(
timeseries.tail_ratio(returns),
1., DECIMAL_PLACES) | TST Add more samples to increase stability of tail_ratio test. | quantopian_pyfolio | train | py |
6702982fbe3c39e49626beeb21f5022788aff291 | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -24,7 +24,7 @@ class Mock(MagicMock):
MOCK_MODULES = ['gi.repository', 'Gtk', 'GObject', 'sorting', 'choice',
'queueing_tool.queues.choice', 'queueing_tool.network.sorting',
- 'scipy', 'numpy', 'numpy.random', 'graph_tool']
+ 'scipy', 'numpy', 'numpy.random', 'graph_tool.all']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES) | Fixed error on read the docs | djordon_queueing-tool | train | py |
0cae2d0a74f51a247609d252ea61928d55c70734 | diff --git a/zhaquirks/tuya/ts0041_zemismart.py b/zhaquirks/tuya/ts0041_zemismart.py
index <HASH>..<HASH> 100644
--- a/zhaquirks/tuya/ts0041_zemismart.py
+++ b/zhaquirks/tuya/ts0041_zemismart.py
@@ -25,7 +25,7 @@ class TuyaZemismartSmartRemote0041(TuyaSmartRemote):
signature = {
# SizePrefixedSimpleDescriptor(endpoint=1, profile=260, device_type=0, device_version=1, input_clusters=[0, 1, 6], output_clusters=[25, 10])
- MODELS_INFO: [("_TZ3000_tk3s5tyg", "TS0041")],
+ MODELS_INFO: [("_TZ3000_tk3s5tyg", "TS0041"), ("_TZ3400_keyjqthh", "TS0041")],
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID, | Added missing device model (#<I>) | dmulcahey_zha-device-handlers | train | py |
71dd34c0ff540b33ab3021905a52c118de5878c5 | diff --git a/tests/functional/codegen/test_struct_return.py b/tests/functional/codegen/test_struct_return.py
index <HASH>..<HASH> 100644
--- a/tests/functional/codegen/test_struct_return.py
+++ b/tests/functional/codegen/test_struct_return.py
@@ -16,7 +16,8 @@ def modify_nested_tuple(_human: Human) -> Human:
human: Human = _human
# do stuff, edit the structs
- human.animal.fur = slice(concat(human.animal.fur, " is great"), 0, 32)
+ # (13 is the length of the result)
+ human.animal.fur = slice(concat(human.animal.fur, " is great"), 0, 13)
return human
""" | fix slice length in a new test | ethereum_vyper | train | py |
eefba18bf67d9cfff6c55befe7f109f9721bf11e | diff --git a/aliyun/log/logclient.py b/aliyun/log/logclient.py
index <HASH>..<HASH> 100755
--- a/aliyun/log/logclient.py
+++ b/aliyun/log/logclient.py
@@ -2457,7 +2457,7 @@ class LogClient(object):
:type retries_failed: int
:param retries_failed: specify retrying times for failed tasks. e.g. 10
- :return: ''
+ :return: LogResponse
:raise: Exception
"""
@@ -2484,7 +2484,7 @@ class LogClient(object):
)
migration_manager = MigrationManager(config)
migration_manager.migrate()
- return ''
+ return LogResponse({})
def copy_data(self, project, logstore, from_time, to_time=None,
to_client=None, to_project=None, to_logstore=None, | Add return LogResponse for es_migration | aliyun_aliyun-log-python-sdk | train | py |
93278be0fb0061d61cb3f114aa82b594ca06c1b7 | diff --git a/sanitized_dump/config.py b/sanitized_dump/config.py
index <HASH>..<HASH> 100644
--- a/sanitized_dump/config.py
+++ b/sanitized_dump/config.py
@@ -66,6 +66,6 @@ class Configuration:
self.config['strategy'][model_table_name] = field_name_strategy
- def write_configuration_file(self, file_path):
+ def write_configuration_file(self, file_path=standard_file_path):
with open(file_path, "w") as config_file:
yaml.dump(self.config, config_file, default_flow_style=False) | Save config to root of project by default | andersinno_django-sanitized-dump | train | py |
3b88949112121542f50c19e1b4db516ce85dc389 | diff --git a/tcases-lib/src/main/java/org/cornutum/tcases/Reducer.java b/tcases-lib/src/main/java/org/cornutum/tcases/Reducer.java
index <HASH>..<HASH> 100644
--- a/tcases-lib/src/main/java/org/cornutum/tcases/Reducer.java
+++ b/tcases-lib/src/main/java/org/cornutum/tcases/Reducer.java
@@ -173,7 +173,7 @@ public class Reducer
{
setSamples( 10);
setResampleFactor( 0.0);
- setGenFactory( new TupleGeneratorFactory());
+ setGenFactory( null);
}
/**
@@ -416,7 +416,10 @@ public class Reducer
*/
public void setGenFactory( ITestCaseGeneratorFactory genFactory)
{
- genFactory_ = genFactory;
+ genFactory_ =
+ genFactory == null
+ ? new TupleGeneratorFactory()
+ : genFactory;
}
/** | Reducer: Handle when reset to default generator factory. | Cornutum_tcases | train | java |
6a91d69953a96869c546ff348a085e374ab34322 | diff --git a/lib/tiny_mce_helper.rb b/lib/tiny_mce_helper.rb
index <HASH>..<HASH> 100644
--- a/lib/tiny_mce_helper.rb
+++ b/lib/tiny_mce_helper.rb
@@ -56,8 +56,7 @@ module TinyMCEHelper
def include_tiny_mce_if_needed
if @uses_tiny_mce
- include_tiny_mce_js
- tiny_mce_init
+ include_tiny_mce_js + tiny_mce_init
end
end
-end
\ No newline at end of file
+end | include_tiny_mce_if_needed didn't include javascript include | kete_tiny_mce | train | rb |
381a429127e158abb253cdca69ae099a0455685e | diff --git a/packages/neos-ui/src/Containers/Modals/AddNode/index.js b/packages/neos-ui/src/Containers/Modals/AddNode/index.js
index <HASH>..<HASH> 100644
--- a/packages/neos-ui/src/Containers/Modals/AddNode/index.js
+++ b/packages/neos-ui/src/Containers/Modals/AddNode/index.js
@@ -161,7 +161,7 @@ export default class AddNodeModal extends PureComponent {
}
handleDialogEditorValueChange(elementName, value) {
- const newValues = Object.assign({}, this.state.elementValues);
+ const newValues = this.state.elementValues;
newValues[elementName] = value;
this.setState({elementValues: newValues});
} | BUGFIX: fix elements loosing focus in creation dialog
If `elementValues` becomes a new object each time, React decides to
recreate all editors from scratch, thus they loose focus. | neos_neos-ui | train | js |
2a938ad5e773c35bfaec282a150e77032563f059 | diff --git a/ci/ci_build.rb b/ci/ci_build.rb
index <HASH>..<HASH> 100755
--- a/ci/ci_build.rb
+++ b/ci/ci_build.rb
@@ -66,6 +66,7 @@ cd "#{root_dir}/actionpack" do
puts "[CruiseControl] Building ActionPack"
puts
build_results[:actionpack] = system 'gem bundle && rake'
+ build_results[:actionpack_isolated] = system 'rake test:isolated'
end
cd "#{root_dir}/actionmailer" do | Run AP isolated tests on CI | rails_rails | train | rb |
f0af4b90c93d6826a12f449da3a3d29e25b2396b | diff --git a/rake-tasks/crazy_fun/mappings/visualstudio.rb b/rake-tasks/crazy_fun/mappings/visualstudio.rb
index <HASH>..<HASH> 100644
--- a/rake-tasks/crazy_fun/mappings/visualstudio.rb
+++ b/rake-tasks/crazy_fun/mappings/visualstudio.rb
@@ -271,7 +271,6 @@ module CrazyFunDotNet
unmerged_dir = File.join(base_dir, "unmerged")
unmerged_dir = File.join(unmerged_dir, framework_ver)
unmerged_path = File.join(unmerged_dir, args[:out])
- mkdir_p output_dir
full_path = File.join(output_dir, args[:out])
desc_path = full_path.gsub("/", Platform.dir_separator)
@@ -299,6 +298,7 @@ module CrazyFunDotNet
target = exec task_name do |cmd|
puts "Merging: #{task_name} as #{desc_path}"
+ FileUtils.mkdir_p output_dir
cmd.command = "third_party/dotnet/ilmerge/ILMerge.exe"
cmd.parameters = params.join " "
end | JimEvans: Moving mkdir_p call to correct place in .NET MergeAssemblies method for the build process.
r<I> | SeleniumHQ_selenium | train | rb |
e46505f206310d99649f2a2043611e2945ff5ea4 | diff --git a/Consumption/Extension/LoggerExtension.php b/Consumption/Extension/LoggerExtension.php
index <HASH>..<HASH> 100644
--- a/Consumption/Extension/LoggerExtension.php
+++ b/Consumption/Extension/LoggerExtension.php
@@ -34,8 +34,8 @@ class LoggerExtension implements ExtensionInterface
if ($context->getLogger()) {
$context->getLogger()->debug(sprintf(
'Skip setting context\'s logger "%s". Another one "%s" has already been set.',
- get_class($context->getLogger()),
- get_class($this->logger)
+ get_class($this->logger),
+ get_class($context->getLogger())
));
} else {
$context->setLogger($this->logger); | [consumption] Correct message in LoggerExtension | php-enqueue_enqueue | train | php |
077f1b482804360b59098c1e93984d69f68897a0 | diff --git a/emit/message.py b/emit/message.py
index <HASH>..<HASH> 100644
--- a/emit/message.py
+++ b/emit/message.py
@@ -16,7 +16,7 @@ class Message(object):
def __dir__(self):
'get directory of attributes. include bundle.'
- return sorted(list(['bundle'] + self.bundle.keys()))
+ return sorted(list(['bundle'] + list(self.bundle.keys())))
def __repr__(self):
'representation of this message' | make __dir__ compatible with Py3k | BrianHicks_emit | train | py |
69dcd9f3c09b8a866dc81dc5529d11a764d1f44a | diff --git a/codenerix_payments/migrations/0001_initial.py b/codenerix_payments/migrations/0001_initial.py
index <HASH>..<HASH> 100644
--- a/codenerix_payments/migrations/0001_initial.py
+++ b/codenerix_payments/migrations/0001_initial.py
@@ -32,7 +32,7 @@ class Migration(migrations.Migration):
('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
('updated', models.DateTimeField(auto_now=True, verbose_name='Updated')),
('name', models.CharField(max_length=15, unique=True, verbose_name='Name')),
- ('symbol', models.CharField(max_length=3, unique=True, verbose_name='Symbol')),
+ ('symbol', models.CharField(max_length=2, unique=True, verbose_name='Symbol')),
('iso4217', models.CharField(max_length=3, unique=True, verbose_name='ISO 4217 Code')),
('price', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Price')),
], | That should never been pushed, sorry! | codenerix_django-codenerix-payments | train | py |
2c46a917dc94c7bf495eec209112ed3c47ecfeb2 | diff --git a/client/lib/post-normalizer/rule-create-better-excerpt.js b/client/lib/post-normalizer/rule-create-better-excerpt.js
index <HASH>..<HASH> 100644
--- a/client/lib/post-normalizer/rule-create-better-excerpt.js
+++ b/client/lib/post-normalizer/rule-create-better-excerpt.js
@@ -25,7 +25,7 @@ export default function createBetterExcerpt( post ) {
dom.innerHTML = post.content;
// Ditch any photo captions with the wp-caption-text class, styles, scripts
- forEach( dom.querySelectorAll( '.wp-caption-text, style, script' ), removeElement );
+ forEach( dom.querySelectorAll( '.wp-caption-text, style, script, blockquote[class^="instagram-"]' ), removeElement );
// limit to paras and brs
dom.innerHTML = striptags( dom.innerHTML, [ 'p', 'br' ] );
@@ -39,10 +39,12 @@ export default function createBetterExcerpt( post ) {
element.parentNode && element.parentNode.removeChild( element );
} );
- // now strip any p's that are empty
+ // now strip any p's that are empty and remove styles
forEach( dom.querySelectorAll( 'p' ), function( element ) {
if ( trim( element.textContent ).length === 0 ) {
element.parentNode && element.parentNode.removeChild( element );
+ } else {
+ element.removeAttribute( 'style' );
}
} ); | Reader: Remove instagram posts from excerpts, remove styles too (#<I>) | Automattic_wp-calypso | train | js |
2d8e15a5651408fe40b7365334625c487625a1e0 | diff --git a/commands/version.go b/commands/version.go
index <HASH>..<HASH> 100644
--- a/commands/version.go
+++ b/commands/version.go
@@ -58,7 +58,7 @@ func setBuildDate() {
fmt.Println(err)
return
}
- fi, err := os.Lstat(filepath.Join(dir, "hugo"))
+ fi, err := os.Lstat(filepath.Join(dir, filepath.Base(fname)))
if err != nil {
fmt.Println(err)
return | Version uses binary name instead of hugo
On Windows the binary name is hugo.exe and running hugo version results in
this error:
GetFileAttributesEx D:\Dev\Go\gopath\bin\hugo: The system cannot find the file specified.
This fixes that error and allows the binary name to be something other
than hugo on any OS. | gohugoio_hugo | train | go |
7bc833ea2ea33b62d7b5cb975750a7af22fb28e9 | diff --git a/spec/integration/numeric_validator/spec_helper.rb b/spec/integration/numeric_validator/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/integration/numeric_validator/spec_helper.rb
+++ b/spec/integration/numeric_validator/spec_helper.rb
@@ -22,7 +22,6 @@ class BasketballPlayer
validates_is_number :height, :weight
end
-
BasketballPlayer.auto_migrate!
@@ -48,4 +47,5 @@ class City
#
validates_is_number :founded_in, :message => "Foundation year must be an integer"
-end
\ No newline at end of file
+end
+City.auto_migrate!
\ No newline at end of file | [dm-validations] Automigrate this model, too | emmanuel_aequitas | train | rb |
ed9d1c8811dce05787ed8c5bf686461f7a44d874 | diff --git a/src/frontend/org/voltdb/utils/PersistentBinaryDeque.java b/src/frontend/org/voltdb/utils/PersistentBinaryDeque.java
index <HASH>..<HASH> 100644
--- a/src/frontend/org/voltdb/utils/PersistentBinaryDeque.java
+++ b/src/frontend/org/voltdb/utils/PersistentBinaryDeque.java
@@ -699,7 +699,9 @@ public class PersistentBinaryDeque implements BinaryDeque {
return;
}
ReadCursor reader = m_readCursors.remove(cursorId);
- if (reader != null && reader.m_segment != null) {
+ // If we never did a poll from this segment for this cursor,
+ // there is no reader initialized for this cursor.
+ if (reader != null && reader.m_segment != null && reader.m_segment.getReader(cursorId) != null) {
try {
reader.m_segment.getReader(cursorId).close();
} | ENG-<I>: Reader for cursor will be null if nothing was read from that segment yet. (#<I>)
Added check for null. | VoltDB_voltdb | train | java |
97bf329ee2232193595dac461b0770fd7e1cd14a | diff --git a/core/server/services/members/api.js b/core/server/services/members/api.js
index <HASH>..<HASH> 100644
--- a/core/server/services/members/api.js
+++ b/core/server/services/members/api.js
@@ -3,6 +3,7 @@ const settingsCache = require('../settings/cache');
const urlUtils = require('../../lib/url-utils');
const MembersApi = require('@tryghost/members-api');
const common = require('../../lib/common');
+const ghostVersion = require('../../lib/ghost-version');
const mail = require('../mail');
const models = require('../../models');
@@ -79,7 +80,12 @@ function getStripePaymentConfig() {
checkoutSuccessUrl: siteUrl,
checkoutCancelUrl: siteUrl,
product: stripePaymentProcessor.config.product,
- plans: stripePaymentProcessor.config.plans
+ plans: stripePaymentProcessor.config.plans,
+ appInfo: {
+ name: 'Ghost',
+ version: ghostVersion.original,
+ url: 'https://ghost.org/'
+ }
};
} | Passed appInfo to members-api stripe instance
no-issue | TryGhost_Ghost | train | js |
b8f2454325123638798feff44d1c591eb46d92c4 | diff --git a/lib/shoulda/matchers/active_model/validate_uniqueness_of_matcher.rb b/lib/shoulda/matchers/active_model/validate_uniqueness_of_matcher.rb
index <HASH>..<HASH> 100644
--- a/lib/shoulda/matchers/active_model/validate_uniqueness_of_matcher.rb
+++ b/lib/shoulda/matchers/active_model/validate_uniqueness_of_matcher.rb
@@ -65,10 +65,8 @@ module Shoulda
# To fix this, you'll need to write this instead:
#
# describe Post do
- # it do
- # Post.create!(content: 'Here is the content')
- # should validate_uniqueness_of(:title)
- # end
+ # subject { Post.new(content: 'Here is the content') }
+ # it { should validate_uniqueness_of(:title) }
# end
#
# Or, if you're using
@@ -76,10 +74,8 @@ module Shoulda
# `post` factory defined which automatically sets `content`, you can say:
#
# describe Post do
- # it do
- # FactoryGirl.create(:post)
- # should validate_uniqueness_of(:title)
- # end
+ # subject { FactoryGirl.build(:post) }
+ # it { should validate_uniqueness_of(:title) }
# end
#
# #### Qualifiers | Updated docs for `ValidateUniquenessOfMatcher` [ci skip] | thoughtbot_shoulda-matchers | train | rb |
b1cd2b7703b20768cb1cdf2bc75a095df15b6200 | diff --git a/expynent/patterns.py b/expynent/patterns.py
index <HASH>..<HASH> 100644
--- a/expynent/patterns.py
+++ b/expynent/patterns.py
@@ -286,5 +286,6 @@ PHONE_NUMBER = {
# RegEx pattern to match Spanish phone numbers
'ES': r'^(?:\+34|0)\d{9}$',
# RegEx pattern to match Taiwan phone numbers
- 'TW': r'^(?:\+886|0)((?:9\d{8})|(?:[2-8]\d{7,8}))$'
+ 'TW': r'^(?:\+886|0)((?:9\d{8})|(?:[2-8]\d{7,8}))$',
+ 'NI': '(\+?505)?\d{8}'
} | Updated NI Phone number regex to a better one | lk-geimfari_expynent | train | py |
2b42479e360662426593e949b134e68ac14caad3 | diff --git a/lib/rbnacl/auth/one_time.rb b/lib/rbnacl/auth/one_time.rb
index <HASH>..<HASH> 100644
--- a/lib/rbnacl/auth/one_time.rb
+++ b/lib/rbnacl/auth/one_time.rb
@@ -1,4 +1,9 @@
module Crypto
+ # Secret Key Authenticators
+ #
+ # These provide a means of verifying the integrity of a message, but only
+ # with the knowledge of a shared key. This can be a preshared key, or one
+ # that is derived through some cryptographic protocol.
module Auth
# Computes an authenticator using poly1305
# | Document Auth namespace
Now <I>% doc'd in yard | crypto-rb_rbnacl | train | rb |
632b178254f09ada4199ec61d1520be3b9b55836 | diff --git a/chatterbot/__init__.py b/chatterbot/__init__.py
index <HASH>..<HASH> 100644
--- a/chatterbot/__init__.py
+++ b/chatterbot/__init__.py
@@ -4,7 +4,7 @@ import sys
if 'install' not in sys.argv and 'egg_info' not in sys.argv:
from .chatterbot import ChatBot
-__version__ = '0.4.7'
+__version__ = '0.4.8'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com' | Updated release version to <I> | gunthercox_ChatterBot | train | py |
e44222528b5d16fa8706cd1c881b401a8f958523 | diff --git a/tests/test_templatetags.py b/tests/test_templatetags.py
index <HASH>..<HASH> 100644
--- a/tests/test_templatetags.py
+++ b/tests/test_templatetags.py
@@ -59,6 +59,7 @@ def test_add_href_target(rf):
'html': (
'<a href="http://www.google.com"></a>'
'<a href="https://www.google.com"></a>'
+ '<a href="http://www.example.com"></a>'
'<a href="/selling-online-overseas"></a>'
'<a href="/export-opportunities"></a>'
)
@@ -68,6 +69,7 @@ def test_add_href_target(rf):
assert html == (
'<a href="http://www.google.com" rel="noopener noreferrer" target="_blank" title="Opens in a new window"></a>'
'<a href="https://www.google.com" rel="noopener noreferrer" target="_blank" title="Opens in a new window"></a>'
+ '<a href="http://www.example.com"></a>'
'<a href="/selling-online-overseas"></a>'
'<a href="/export-opportunities"></a>'
) | GTRANSFORM-<I> add additional test assertion | uktrade_directory-components | train | py |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.