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 |
|---|---|---|---|---|---|
fd8ca26e729ea132f9fe1d301e97fb6aa1f1b341 | diff --git a/ocrd/ocrd/resource_manager.py b/ocrd/ocrd/resource_manager.py
index <HASH>..<HASH> 100644
--- a/ocrd/ocrd/resource_manager.py
+++ b/ocrd/ocrd/resource_manager.py
@@ -134,7 +134,7 @@ class OcrdResourceManager():
return ret
def get_resource_dir(self, location):
- return join(VIRTUAL_ENV, 'ocrd-resources') if location == 'virtualenv' and VIRTUAL_ENV else \
+ return join(VIRTUAL_ENV, 'share', 'ocrd-resources') if location == 'virtualenv' and VIRTUAL_ENV else \
join(XDG_CACHE_HOME, 'ocrd-resources') if location == 'cache' else \
join(XDG_DATA_HOME, 'ocrd-resources') if location == 'data' else \
join(XDG_CONFIG_HOME, 'ocrd-resources') if location == 'config' else \ | :bug: resmgr: virtualenv location was missing "share" | OCR-D_core | train | py |
76ed6e488d77c9c301070c1417129051bf8faf99 | diff --git a/scale/interface.go b/scale/interface.go
index <HASH>..<HASH> 100644
--- a/scale/interface.go
+++ b/scale/interface.go
@@ -33,6 +33,9 @@ type Quantitative interface {
// and last major ticks returned by Ticks(o) will equal the
// lower and upper bounds of the input domain.
Nice(o TickOptions)
+
+ // A Quantitative scale is also a Ticker.
+ Ticker
}
// A QQ maps from a source Quantitative scale to a destination | scale: a Quantitative scale is also a Ticker | aclements_go-moremath | train | go |
929109a0907fabc9a23cd1295bda9e48f307b46e | diff --git a/lib/interceptor.js b/lib/interceptor.js
index <HASH>..<HASH> 100644
--- a/lib/interceptor.js
+++ b/lib/interceptor.js
@@ -17,12 +17,12 @@ class RowProcessorInterceptor extends Interceptor {
parserFactory(config, true);
}
- static get type() {
+ static get name() {
return "data-processor-row";
}
get type() {
- return RowProcessorInterceptor.type;
+ return RowProcessorInterceptor.name;
}
receive(request, oldRequest) { | fix(interceptor): Fix the name and type of the interceptor | Kronos-Integration_kronos-interceptor-object-data-processor-row | train | js |
6265dfb9101a5a36d9532c6ed0f2ca5533b0200f | diff --git a/app/src/js/modules/omnisearch.js b/app/src/js/modules/omnisearch.js
index <HASH>..<HASH> 100644
--- a/app/src/js/modules/omnisearch.js
+++ b/app/src/js/modules/omnisearch.js
@@ -39,8 +39,8 @@
q: term
};
},
- results: function (data, page) {
- console.log('omnisearch: results');
+ processResults: function (data) {
+ console.log('omnisearch: processResults');
var results = [];
$.each(data, function (index, item) {
results.push({ | Migrate results to processResults | bolt_bolt | train | js |
3f847c90df6cf659bbcc20ad277fc0eb453dc9d6 | diff --git a/src/com/google/javascript/jscomp/DefaultPassConfig.java b/src/com/google/javascript/jscomp/DefaultPassConfig.java
index <HASH>..<HASH> 100644
--- a/src/com/google/javascript/jscomp/DefaultPassConfig.java
+++ b/src/com/google/javascript/jscomp/DefaultPassConfig.java
@@ -934,7 +934,6 @@ public final class DefaultPassConfig extends PassConfig {
passes.add(j2clClinitPrunerPass);
passes.add(j2clConstantHoisterPass);
passes.add(j2clEqualitySameRewriterPass);
- passes.add(j2clMarkPureFunctions);
}
assertAllLoopablePasses(passes);
@@ -2738,19 +2737,6 @@ public final class DefaultPassConfig extends PassConfig {
}
};
- /**
- * A loopable pure function identifier pass. Run in the main
- * loop so functions can become pure after removing clinits.
- */
- private final PassFactory j2clMarkPureFunctions =
- new PassFactory("markPureFunctions", false) {
- @Override
- protected CompilerPass create(AbstractCompiler compiler) {
- return new PureFunctionIdentifier.Driver(
- compiler, options.debugFunctionSideEffectsPath, false);
- }
- };
-
/** Rewrites J2CL constructs to be more optimizable. */
private final PassFactory j2clPass =
new PassFactory("j2clPass", true) { | Automated g4 rollback of changelist <I>.
*** Reason for rollback ***
It increases the running time of JSCompiler and causes timeout sometimes.
*** Original change description ***
Run a pure function identifier in the main optimization loop when j2clpass is enabled. This allows functions to become pure as clinits get pruned.
***
-------------
Created by MOE: <URL> | google_closure-compiler | train | java |
9fff9ba0b3a3e50b59b6988527e5649fc0cd111a | diff --git a/logical/secret.go b/logical/secret.go
index <HASH>..<HASH> 100644
--- a/logical/secret.go
+++ b/logical/secret.go
@@ -32,7 +32,7 @@ type Secret struct {
}
func (s *Secret) Validate() error {
- if s.Lease <= 0 {
+ if s.Lease < 0 {
return fmt.Errorf("lease duration must not be less than zero")
}
if s.LeaseGracePeriod < 0 { | logical: validation should allow 0 leases | hashicorp_vault | train | go |
580a1f3d0ad55dde08b4c6c3866f99a198661b40 | diff --git a/spyder/widgets/sourcecode/codeeditor.py b/spyder/widgets/sourcecode/codeeditor.py
index <HASH>..<HASH> 100644
--- a/spyder/widgets/sourcecode/codeeditor.py
+++ b/spyder/widgets/sourcecode/codeeditor.py
@@ -1917,15 +1917,14 @@ class CodeEditor(TextEditBaseWidget):
diff_curly = 0
add_indent = False
prevline = None
+ if not self.get_block_indentation(block_nb - 1):
+ return False
for prevline in range(block_nb-1, -1, -1):
cursor.movePosition(QTextCursor.PreviousBlock)
prevtext = to_text_string(cursor.block().text()).rstrip()
-
- if ((self.is_python_like()
- and not prevtext.strip().startswith('#')
- and prevtext)
- or prevtext):
-
+
+ if prevtext:
+
if (prevtext.strip().endswith(')')
or prevtext.strip().endswith(']')
or prevtext.strip().endswith('}')): | fixes issue #<I>
If the previous line is unindented, the next one will be aswell. | spyder-ide_spyder | train | py |
1c5b401dd0df1d4f37be6e04bb6db13faf49e8b3 | diff --git a/Class.js b/Class.js
index <HASH>..<HASH> 100644
--- a/Class.js
+++ b/Class.js
@@ -37,7 +37,7 @@ module.exports = function Class(parent, proto) {
if(!proto) { proto = parent }
proto.prototype = parent.prototype
- var cls = function() { if(this._initialize) { this._initialize.apply(this, arguments) }}
+ var cls = function() { if(this._init) { this._init.apply(this, arguments) }}
cls.prototype = new proto(function(context, method, args) {
var target = parent
while(target = target.prototype) { | Make it _init - much shorter, much better | marcuswestin_std.js | train | js |
39fc362b9b8538a30f39d49cf9222d275930d745 | diff --git a/railties/lib/rails/generators/rails/app/templates/config/application.rb b/railties/lib/rails/generators/rails/app/templates/config/application.rb
index <HASH>..<HASH> 100644
--- a/railties/lib/rails/generators/rails/app/templates/config/application.rb
+++ b/railties/lib/rails/generators/rails/app/templates/config/application.rb
@@ -33,7 +33,7 @@ module <%= app_const_base %>
# config.i18n.default_locale = :de
<%- unless options.skip_active_record? -%>
- # For not swallow errors in after_commit/after_rollback callbacks.
+ # Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
<%- end -%>
end | Change "For not..." to "Do not...". | rails_rails | train | rb |
a2a9ebb0785e4df79694d71f73f595e910987c29 | diff --git a/commands/commands.go b/commands/commands.go
index <HASH>..<HASH> 100644
--- a/commands/commands.go
+++ b/commands/commands.go
@@ -243,7 +243,7 @@ var Commands = []cli.Command{
Flags: []cli.Flag{
cli.BoolFlag{
Name: "force, f",
- Usage: "Remove local configuration even if machine cannot be removed",
+ Usage: "Remove local configuration even if machine cannot be removed, also implies an automatic yes (`-y`)",
},
cli.BoolFlag{
Name: "y", | Minor fix updating the sub-command rm usage with -f.
This is a follow up for #<I> | docker_machine | train | go |
7489d3a33f8de8f7617b20408af9c08de14fa57b | diff --git a/blockstack_gpg/gpg.py b/blockstack_gpg/gpg.py
index <HASH>..<HASH> 100644
--- a/blockstack_gpg/gpg.py
+++ b/blockstack_gpg/gpg.py
@@ -269,6 +269,11 @@ def gpg_verify_key( key_id, key_data, config_dir=None ):
config_dir = get_config_dir( config_dir )
sanitized_key_id = "".join( key_id.upper().split(" ") )
+
+ if len(sanitized_key_id) < 16:
+ log.debug("Fingerprint is too short to be secure")
+ return False
+
fingerprint = gpg_key_fingerprint( key_data, config_dir=config_dir )
if fingerprint is None:
log.debug("Failed to fingerprint key") | require fingerprints to have more than <I> characters (thanks @vsund!) | blockstack-packages_blockstack-gpg | train | py |
7ea11747be53847629176d206c47fbe853dd90b0 | diff --git a/doc/source/conf.py b/doc/source/conf.py
index <HASH>..<HASH> 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -117,14 +117,16 @@ master_doc = 'index'
project = u'Authomatic'
copyright = u'2013, Peter Hudec'
+# TODO: Put version in one place.
+
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
-version = '0.0.0'
+version = '0.0.8'
# The full version, including alpha/beta/rc tags.
-release = '0.0.5'
+release = version
# 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
@@ -2,7 +2,7 @@ from setuptools import setup,find_packages
setup(
name='Authomatic',
- version='0.0.7',
+ version='0.0.8', # TODO: Put version in one place.
packages=find_packages(),
package_data={'': ['*.txt', '*.rst']},
author='Peter Hudec', | Updated the version number to <I>. | authomatic_authomatic | train | py,py |
693c2b5bb2e073b51d33d77acd420ad824187161 | diff --git a/lib/Ajax.php b/lib/Ajax.php
index <HASH>..<HASH> 100644
--- a/lib/Ajax.php
+++ b/lib/Ajax.php
@@ -33,7 +33,7 @@ class Ajax extends AbstractModel {
exit;
}
function getAjaxOutput(){
- return join(';',$this->ajax_output);
+ return join(';',$this->ajax_output) . ';';
}
function ajaxFlush(){
// Now, since we are returning AJAX stuff, we don't need to render anything. | - Fixed problem with Ajax.php not putting ; when combining strings | atk4_atk4 | train | php |
7fbf20e5d545c9a8622625c980a68bc49f228924 | diff --git a/src/special/karma.js b/src/special/karma.js
index <HASH>..<HASH> 100644
--- a/src/special/karma.js
+++ b/src/special/karma.js
@@ -155,7 +155,7 @@ function collectReporters(config, pluginInfo) {
const reporterMapping = collectInstalledPluginOfType('reporter', pluginInfo);
const installedReporters = Object.keys(reporterMapping);
// config defines a property reporters: ['<name>', ...]
- return Object.values(wrapToMap(config.reporters))
+ return wrapToArray(config.reporters)
.filter(name => installedReporters.includes(name))
.map(name => reporterMapping[name]);
}
@@ -167,7 +167,9 @@ function collectPreprocessors(config, pluginInfo) {
const preprocessorMapping = collectInstalledPluginOfType('preprocessor', pluginInfo);
const installedPreprocessors = Object.keys(preprocessorMapping);
// config defines a property preprocessors: {'<file-glob>': '<name>'}, ... }
- return [...new Set(Object.values(wrapToMap(config.preprocessors))
+ const preprocessors = wrapToMap(config.preprocessors);
+ return [...new Set(Object.keys(preprocessors)
+ .map(k => preprocessors[k])
.filter(name => installedPreprocessors.includes(name))
.map(name => preprocessorMapping[name]))];
} | Replace Object.values(m) with Object.keys(m).map(k => m[k])
* Improves backwards compatibility with node 6 on appveyor, until we get an updated version of @babel/polyfill working | depcheck_depcheck | train | js |
d518f6bbac8108ccc8aa6d5b2c839df5803da892 | diff --git a/doc-src/templates/api-versions/model_documentor.rb b/doc-src/templates/api-versions/model_documentor.rb
index <HASH>..<HASH> 100644
--- a/doc-src/templates/api-versions/model_documentor.rb
+++ b/doc-src/templates/api-versions/model_documentor.rb
@@ -102,6 +102,7 @@ class MethodDocumentor
@lines << " Called when a response from the service is returned. If a"
@lines << " callback is not supplied, you must call {AWS.Request.send}"
@lines << " on the returned request object to initiate the request."
+ @lines << " @context [AWS.Request] the request object being sent."
@lines << " @param err [Error] the error object returned from the request."
@lines << " Set to `null` if the request is successful."
@lines << " @param data [Object] the de-serialized data returned from"
diff --git a/lib/request.js b/lib/request.js
index <HASH>..<HASH> 100644
--- a/lib/request.js
+++ b/lib/request.js
@@ -327,6 +327,7 @@ AWS.Request = inherit({
* @callback callback function(err, data)
* If a callback is supplied, it is called when a response is returned
* from the service.
+ * @context [AWS.Request] the request object being sent.
* @param err [Error] the error object returned from the request.
* Set to `null` if the request is successful.
* @param data [Object] the de-serialized data returned from | Document `this` in operation callbacks.
References #<I> | aws_aws-sdk-js | train | rb,js |
3ba61b30f823eabe11e8debd2f90feb4bbea1e87 | diff --git a/azurerm/internal/services/storage/resource_arm_storage_account.go b/azurerm/internal/services/storage/resource_arm_storage_account.go
index <HASH>..<HASH> 100644
--- a/azurerm/internal/services/storage/resource_arm_storage_account.go
+++ b/azurerm/internal/services/storage/resource_arm_storage_account.go
@@ -636,7 +636,7 @@ func resourceArmStorageAccountCreate(d *schema.ResourceData, meta interface{}) e
accessTier, ok := d.GetOk("access_tier")
if !ok {
// default to "Hot"
- accessTier = storage.Hot
+ accessTier = string(storage.Hot)
}
parameters.AccountPropertiesCreateParameters.AccessTier = storage.AccessTier(accessTier.(string)) | r/storage_account: casting to a string | terraform-providers_terraform-provider-azurerm | train | go |
81823e89cd021d95ed69d03916e14183afff6aef | diff --git a/aio/tools/examples/shared/boilerplate/cli/protractor.conf.js b/aio/tools/examples/shared/boilerplate/cli/protractor.conf.js
index <HASH>..<HASH> 100644
--- a/aio/tools/examples/shared/boilerplate/cli/protractor.conf.js
+++ b/aio/tools/examples/shared/boilerplate/cli/protractor.conf.js
@@ -9,7 +9,11 @@ exports.config = {
'./e2e/**/*.e2e-spec.ts'
],
capabilities: {
- 'browserName': 'chrome'
+ 'browserName': 'chrome',
+ // For Travis CI only
+ chromeOptions: {
+ binary: process.env.CHROME_BIN
+ }
},
directConnect: true,
baseUrl: 'http://localhost:4200/', | build(aio): fix example protractor config for Travis (#<I>)
Without setting the CHROME_BIN Travis will not use the correct version
of Chrome for running e2e tests.
Closes #<I>
PR Close #<I> | angular_angular | train | js |
86eb7cc61c35dfcc6691051c73d606cb0f4cac44 | diff --git a/domain-management/src/main/java/org/jboss/as/domain/management/security/LdapGroupSearcherFactory.java b/domain-management/src/main/java/org/jboss/as/domain/management/security/LdapGroupSearcherFactory.java
index <HASH>..<HASH> 100644
--- a/domain-management/src/main/java/org/jboss/as/domain/management/security/LdapGroupSearcherFactory.java
+++ b/domain-management/src/main/java/org/jboss/as/domain/management/security/LdapGroupSearcherFactory.java
@@ -209,7 +209,7 @@ public class LdapGroupSearcherFactory {
if (groupRef != null && groupRef.size() > 0) {
NamingEnumeration<String> groupRefValues = (NamingEnumeration<String>) groupRef.getAll();
while (groupRefValues.hasMore()) {
- String distingushedName = groupRefValues.next();
+ String distingushedName = groupRefValues.next().replace("\\", "\\\\").replace("/", "\\/");
SECURITY_LOGGER.tracef("Group found with distinguishedName=%s", distingushedName);
String simpleName = null;
if (groupNameAttribute != null) { | [WFLY-<I>] now escapes the DN properly for group search | wildfly_wildfly | train | java |
04a57f1544626c2ecc4ed2e38c600e19f96bf772 | diff --git a/core/src/main/java/io/undertow/server/protocol/ajp/AjpServerRequestConduit.java b/core/src/main/java/io/undertow/server/protocol/ajp/AjpServerRequestConduit.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/io/undertow/server/protocol/ajp/AjpServerRequestConduit.java
+++ b/core/src/main/java/io/undertow/server/protocol/ajp/AjpServerRequestConduit.java
@@ -20,6 +20,7 @@ package io.undertow.server.protocol.ajp;
import java.io.IOException;
import java.nio.ByteBuffer;
+import java.nio.channels.ClosedChannelException;
import java.nio.channels.FileChannel;
import java.util.concurrent.TimeUnit;
@@ -224,7 +225,7 @@ public class AjpServerRequestConduit extends AbstractStreamSourceConduit<StreamS
if (finishListener != null) {
finishListener.handleEvent(this);
}
- return read;
+ throw new ClosedChannelException();
} else if (headerBuffer.hasRemaining()) {
return 0;
} else { | UNDERTOW-<I> Make sure that an exception is reported if the AJP channel is closed unexpectedly, instead of returning -1 | undertow-io_undertow | train | java |
3d168965b385a096fec7fffa3fb9e3fb47adaba2 | diff --git a/src/task/helpers.php b/src/task/helpers.php
index <HASH>..<HASH> 100644
--- a/src/task/helpers.php
+++ b/src/task/helpers.php
@@ -44,7 +44,7 @@ function artisan($command, $options = [])
? '{{deploy_path}}/current/artisan'
: '{{release_path}}/artisan';
- $output = run("{{bin/php}} {{release_path}}/artisan $command");
+ $output = run("{{bin/php}} $artisan $command");
if (in_array('showOutput', $options)) {
writeln("<info>$output</info>"); | :ambulance: Enable some artisan tasks to run in current folder | lorisleiva_laravel-deployer | train | php |
59bec07ebc781fe26253c9367d1b37cebdd5499f | diff --git a/tofu/geom/_core_Optics.py b/tofu/geom/_core_Optics.py
index <HASH>..<HASH> 100644
--- a/tofu/geom/_core_Optics.py
+++ b/tofu/geom/_core_Optics.py
@@ -567,7 +567,7 @@ class CrystalBragg(utils.ToFuObject):
Z = float(Z)
frame_cent = np.atleast_1d(frame_cent).ravel()
- assert frame_cent.size == 2
+ ssue202_SpectroX2DCrystalassert frame_cent.size == 2
frame_ang = float(frame_ang)
ang_bragg = np.atleast_1d(ang_bragg).ravel() | [Issue<I>] Tested, about to merge with Issue<I> | ToFuProject_tofu | train | py |
b2016af08ab2a01645ece96199d350c3360e2de6 | diff --git a/src/webrtc/media-plugin.js b/src/webrtc/media-plugin.js
index <HASH>..<HASH> 100644
--- a/src/webrtc/media-plugin.js
+++ b/src/webrtc/media-plugin.js
@@ -16,6 +16,7 @@ function MediaPlugin(session, name, id) {
this._pcListeners = {};
this._pc = null;
+ this._messageProxyList = ['webrtcup', 'hangup', 'media'];
}
Helpers.inherits(MediaPlugin, Plugin);
@@ -178,8 +179,13 @@ MediaPlugin.prototype.processIncomeMessage = function(message) {
return MediaPlugin.super_.prototype.processIncomeMessage.call(self, message);
})
.then(function(result) {
- if ('trickle' == message['janus']) {
- self._onTrickle(message);
+ var janusType = message['janus'];
+ if (self._messageProxyList.indexOf(janusType) !== -1) {
+ self.emit(janusType, message);
+ } else {
+ if ('trickle' == janusType) {
+ self._onTrickle(message);
+ }
}
return result;
}); | list of janus types to proxy as separate events | cargomedia_janus-gateway-js | train | js |
e3417eeb9d73450a6fa64462888903e9679e12c7 | diff --git a/tasks/lib/changelog.js b/tasks/lib/changelog.js
index <HASH>..<HASH> 100755
--- a/tasks/lib/changelog.js
+++ b/tasks/lib/changelog.js
@@ -162,8 +162,6 @@ var writeChangelog = function(stream, commits, version) {
breaks: {}
};
- sections.breaks[EMPTY_COMPONENT] = [];
-
commits.forEach(function(commit) {
var section = sections[commit.type];
var component = commit.component || EMPTY_COMPONENT;
@@ -174,6 +172,8 @@ var writeChangelog = function(stream, commits, version) {
}
commit.breaks.forEach(function(breakMsg) {
+ sections.breaks[EMPTY_COMPONENT] = sections.breaks[EMPTY_COMPONENT] || [];
+
sections.breaks[EMPTY_COMPONENT].push({
subject: breakMsg,
hash: commit.hash, | chore(changelog): avoid writing empty sections | karma-runner_karma | train | js |
f99efce15513216ae4bd1462daeee8b0d12d2a1e | diff --git a/zsl/testing/db.py b/zsl/testing/db.py
index <HASH>..<HASH> 100644
--- a/zsl/testing/db.py
+++ b/zsl/testing/db.py
@@ -13,3 +13,5 @@ class DbTestCase(object):
def createSchema(self, engine):
metadata.bind = engine
metadata.create_all(engine)
+
+ | Add newline at the end of the file. | AtteqCom_zsl | train | py |
332231ea4cceed8495f0beecd6e6158eaaba8a38 | diff --git a/lib/http.js b/lib/http.js
index <HASH>..<HASH> 100644
--- a/lib/http.js
+++ b/lib/http.js
@@ -209,9 +209,11 @@ function IncomingMessage(stream) {
// * `this.headers` will store the regular headers (and none of the special colon headers)
this.headers = {};
this.trailers = undefined;
+ this._lastHeadersSeen = undefined;
// * Other metadata is filled in when the headers arrive.
stream.once('headers', this._onHeaders.bind(this));
+ stream.once('end', this._onEnd.bind(this));
}
IncomingMessage.prototype = Object.create(PassThrough.prototype, { constructor: { value: IncomingMessage } });
@@ -240,12 +242,15 @@ IncomingMessage.prototype._onHeaders = function _onHeaders(headers) {
}
}
- // * The next header block, if any, will represent the trailers
- this.stream.once('headers', this._onTrailers.bind(this));
+ // * The last header block, if it's not the first, will represent the trailers
+ var self = this;
+ this.stream.on('headers', function(headers) {
+ self._lastHeadersSeen = headers;
+ });
};
-IncomingMessage.prototype._onTrailers = function _onTrailers(trailers) {
- this.trailers = trailers;
+IncomingMessage.prototype._onEnd = function _onEnd() {
+ this.trailers = this._lastHeadersSeen;
};
IncomingMessage.prototype.setTimeout = noop; | Using the last HEADERS frame for trailers instead of the second one. Fixes #<I>. | molnarg_node-http2-protocol | train | js |
9819e419045b5c165deb2115f0f63e0c85c20060 | diff --git a/src/main/java/net/spy/memcached/vbucket/ConfigurationProviderHTTP.java b/src/main/java/net/spy/memcached/vbucket/ConfigurationProviderHTTP.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/spy/memcached/vbucket/ConfigurationProviderHTTP.java
+++ b/src/main/java/net/spy/memcached/vbucket/ConfigurationProviderHTTP.java
@@ -266,7 +266,9 @@ public class ConfigurationProviderHTTP extends SpyObject implements Configuratio
}
return buffer.toString();
} finally {
- reader.close();
+ if (reader != null) {
+ reader.close();
+ }
}
} | Fixed issue regarding connecting to a non-existent bucket
Connecting to a Membase server correctly, but specifying a
bucket that doesn't exist causes the BufferedReader in the
readToString function to be null. This causes a NPE when we
attempt to close the reader.
Change-Id: I7f<I>c<I>b<I>b<I>bf<I>aded<I>b<I>a
Reviewed-on: <URL> | dustin_java-memcached-client | train | java |
b8c223db732cca00bf83a6ec0be69722b6a459ce | diff --git a/js/zaif.js b/js/zaif.js
index <HASH>..<HASH> 100644
--- a/js/zaif.js
+++ b/js/zaif.js
@@ -207,18 +207,18 @@ module.exports = class zaif extends Exchange {
for (let i = 0; i < currencyIds.length; i++) {
const currencyId = currencyIds[i];
const code = this.safeCurrencyCode (currencyId);
- const balance = this.safeValue (funds, currencyId);
+ const balance = this.safeString (funds, currencyId);
const account = this.account ();
account['free'] = balance;
account['total'] = balance;
if (deposit !== undefined) {
if (currencyId in deposit) {
- account['total'] = this.safeNumber (deposit, currencyId);
+ account['total'] = this.safeString (deposit, currencyId);
}
}
result[code] = account;
}
- return this.parseBalance (result);
+ return this.parseBalance (result, false);
}
async fetchOrderBook (symbol, limit = undefined, params = {}) { | zaif string-based parseBalance | ccxt_ccxt | train | js |
783a9e3a29d9736431f821fb7418ac1f025f3762 | diff --git a/tofu/spectro/_rockingcurve.py b/tofu/spectro/_rockingcurve.py
index <HASH>..<HASH> 100644
--- a/tofu/spectro/_rockingcurve.py
+++ b/tofu/spectro/_rockingcurve.py
@@ -1397,9 +1397,9 @@ def CrystalBragg_plot_power_ratio_vs_glancing_angle(
label=(
r'normal pola.,' + '\n' +
r' ({}): $\alpha$=({}) arcmin'.format(
- let_keydd, np.round(alpha_deg[j]*60, 3)
+ let_keydd, np.round(alpha_deg[j]*60, 3)
),
- )
+ ),
)
ax.plot(
dth[1, 0, j, :], | [#<I>] PEP8 corrections 3 | ToFuProject_tofu | train | py |
74d4098373804ed4c20f111ebb3b54ae6b6b68ea | diff --git a/Controller/PageController.php b/Controller/PageController.php
index <HASH>..<HASH> 100644
--- a/Controller/PageController.php
+++ b/Controller/PageController.php
@@ -68,8 +68,8 @@ class PageController extends Controller
$cms->setCurrentPage($page);
- // NEXT_MAJOR: remove the usage of $this->getRequest() by injecting the request action method in 4.0 (BC break)
- return $this->getPageServiceManager()->execute($page, $this->getRequest());
+ // NEXT_MAJOR: remove the usage of $this->getRequestObject() by injecting the request action method in 4.0 (BC break)
+ return $this->getPageServiceManager()->execute($page, $this->getRequestObject());
}
/**
@@ -107,7 +107,7 @@ class PageController extends Controller
/**
* @return Request
*/
- private function getRequest()
+ private function getRequestObject()
{
return $this->container->get('request_stack')->getCurrentRequest();
} | Rename getRequest method for sf<I> compatibility (#<I>) | sonata-project_SonataPageBundle | train | php |
5bd126557cdbfccef9d0b282230cdd671c003c4f | diff --git a/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileWriter.java b/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileWriter.java
index <HASH>..<HASH> 100644
--- a/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileWriter.java
+++ b/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileWriter.java
@@ -850,7 +850,7 @@ public class ParquetFileWriter {
// copy the data for all chunks
long start = -1;
long length = 0;
- long blockCompressedSize = 0;
+ long blockUncompressedSize = 0L;
for (int i = 0; i < columnsInOrder.size(); i += 1) {
ColumnChunkMetaData chunk = columnsInOrder.get(i);
@@ -891,10 +891,10 @@ public class ParquetFileWriter {
chunk.getTotalSize(),
chunk.getTotalUncompressedSize()));
- blockCompressedSize += chunk.getTotalSize();
+ blockUncompressedSize += chunk.getTotalUncompressedSize();
}
- currentBlock.setTotalByteSize(blockCompressedSize);
+ currentBlock.setTotalByteSize(blockUncompressedSize);
endBlock();
} | PARQUET-<I>: ParquetFileWriter Records Compressed Bytes instead of Uncompressed Bytes (#<I>) | apache_parquet-mr | train | java |
f5f67dff858e717aee37a0eca552ddfaf296b5b2 | diff --git a/Controller/WorkspaceController.php b/Controller/WorkspaceController.php
index <HASH>..<HASH> 100644
--- a/Controller/WorkspaceController.php
+++ b/Controller/WorkspaceController.php
@@ -301,7 +301,7 @@ class WorkspaceController extends Controller
$user = $this->security->getToken()->getUser();
$this->workspaceManager->create($config, $user);
$this->tokenUpdater->update($this->security->getToken());
- $route = $this->router->generate('claro_workspace_list');
+ $route = $this->router->generate('claro_workspace_by_user');
$msg = $this->get('translator')->trans(
'successfull_workspace_creation',
array('%name%' => $form->get('name')->getData()), 'platform' | Redirect user to his workspaces page after creating one | claroline_CoreBundle | train | php |
3de8d846ac39ef77a0288107bb3742b69ddbdb24 | diff --git a/lib/slackbotsy/bot.rb b/lib/slackbotsy/bot.rb
index <HASH>..<HASH> 100644
--- a/lib/slackbotsy/bot.rb
+++ b/lib/slackbotsy/bot.rb
@@ -20,7 +20,12 @@ module Slackbotsy
## use set of tokens for (more or less) O(1) lookup on multiple channels
def parse_outgoing_tokens(tokens)
- (tokens.respond_to?(:split) ? tokens.split(/[,\s]+/) : Array(tokens)).to_set
+ case tokens
+ when String
+ tokens.split(/[,\s]+/)
+ when Array
+ tokens
+ end.to_set
end
## setup http connection for sending async incoming webhook messages to slack | make sure string/array to_set handling is more reliable | rlister_slackbotsy | train | rb |
edd0ef71893a3116ce67357f76b354fd24c6444b | diff --git a/bin/linelint.js b/bin/linelint.js
index <HASH>..<HASH> 100644
--- a/bin/linelint.js
+++ b/bin/linelint.js
@@ -69,6 +69,6 @@ res.forEach(function (f) {
// Check should we exit with an error
res.forEach(function (f) {
if (f.lines > 0) {
- process.exit(0);
+ process.exit(1);
}
}); | Ensure correct exit code is used. | evanshortiss_linelint | train | js |
f5bee0a4ecb390b82f7e977191dca75524d726e3 | diff --git a/v2/websocket/transport.go b/v2/websocket/transport.go
index <HASH>..<HASH> 100644
--- a/v2/websocket/transport.go
+++ b/v2/websocket/transport.go
@@ -53,7 +53,6 @@ func (w *ws) Connect() error {
log.Printf("connecting ws to %s", w.BaseURL)
ws, resp, err := d.Dial(w.BaseURL, nil)
if err != nil {
- close(w.downstream) // signal to parent connection failure thru listen channel
if err == websocket.ErrBadHandshake {
log.Printf("bad handshake: status code %d", resp.StatusCode)
} | removed cpu loop if websocket dial fails | bitfinexcom_bitfinex-api-go | train | go |
04177079ac8ca97f0b054ec6727fa9c1ab8189e5 | diff --git a/ikp3db.py b/ikp3db.py
index <HASH>..<HASH> 100644
--- a/ikp3db.py
+++ b/ikp3db.py
@@ -17,7 +17,7 @@ import traceback
import types
import inspect
import threading
-import queue
+import mutiprocessing
import types
import argparse
import datetime
@@ -563,7 +563,7 @@ class IKPdb(object):
self.mainpyfile = ''
self._active_breakpoint_lock = threading.Lock()
self._active_thread_lock = threading.Lock()
- self._command_q = queue.Queue(maxsize=1)
+ self._command_q = multiprocessing.Queue(maxsize=1)
# tracing is disabled until required
self.execution_started = False | IMP: Replace Queue with multiprocessing.Queue to prepare for multiprocessing support | cmorisse_ikp3db | train | py |
94a666cbcc7f774d98f76fb0db5d6f5b22a48ccc | diff --git a/src/getConfig.js b/src/getConfig.js
index <HASH>..<HASH> 100644
--- a/src/getConfig.js
+++ b/src/getConfig.js
@@ -107,6 +107,7 @@ module.exports = function getConfig({
{
loader: 'css-loader',
options: {
+ minimize: minify,
modules: true
}
},
@@ -175,6 +176,13 @@ module.exports = function getConfig({
chunkFilename: minify ? '[hash].chunk.[id].js' : 'chunk.[id].js'
},
//endregion
+ //region Minification
+ optimization: {
+ minimize: minify,
+ nodeEnv: minify ? 'production' : 'development',
+ concatenateModules: true
+ },
+ //endregion
//region Dev Server
devServer: {
port, | Added explicit "optimization" block
Probably redundant with --mode production flag | wildpeaks_package-webpack-config-web | train | js |
66fd752f6c0ed2ce961c34e5a8696cbab89a8cce | diff --git a/src/Leevel/Support/Dto.php b/src/Leevel/Support/Dto.php
index <HASH>..<HASH> 100644
--- a/src/Leevel/Support/Dto.php
+++ b/src/Leevel/Support/Dto.php
@@ -81,7 +81,7 @@ abstract class Dto implements IArray, ArrayAccess
throw new TypeError($e);
}
- // 遍历所有属性会校验所有属性值是否初始化
+ // 遍历校验所有公共属性值是否初始化
$this->all();
} | refactor(support): Refact comment of dto | hunzhiwange_framework | train | php |
4863bd9723effd4ae29a363e3f00efbcce55da99 | diff --git a/sprd/manager/PrintTypeEqualizer.js b/sprd/manager/PrintTypeEqualizer.js
index <HASH>..<HASH> 100644
--- a/sprd/manager/PrintTypeEqualizer.js
+++ b/sprd/manager/PrintTypeEqualizer.js
@@ -96,7 +96,7 @@ define(["js/core/Bindable", "sprd/util/ProductUtil", "sprd/entity/ConcreteElemen
},
equalizeConfigurations: function(product, configurations, targetPrintType) {
- if (!configurations || !product || this.$equalizingConfigurations) {
+ if (!configurations || !configurations.length || configurations.length < 2 || !product || this.$equalizingConfigurations) {
return;
} | A single configuration is considered equalised. We do nothing in that case. | spreadshirt_rAppid.js-sprd | train | js |
c4860f6c2953f93d6dd5d52fc8a3250748033508 | diff --git a/types/canonical_json.go b/types/canonical_json.go
index <HASH>..<HASH> 100644
--- a/types/canonical_json.go
+++ b/types/canonical_json.go
@@ -113,5 +113,8 @@ func CanonicalHeartbeat(heartbeat *Heartbeat) CanonicalJSONHeartbeat {
}
func CanonicalTime(t time.Time) string {
- return t.Format(timeFormat)
+ // note that sending time over go-wire resets it to
+ // local time, we need to force UTC here, so the
+ // signatures match
+ return t.UTC().Format(timeFormat)
} | Force CanonicalTime to UTC
fixes issue with vote serialization breaking the signatures | tendermint_tendermint | train | go |
ef97274b250afd610807d087e6dbf6700afe2ced | diff --git a/lib/client/live_reload.js b/lib/client/live_reload.js
index <HASH>..<HASH> 100644
--- a/lib/client/live_reload.js
+++ b/lib/client/live_reload.js
@@ -3,8 +3,7 @@
// Detects changes in client files and sends an event to connected browsers instructing them to refresh the page
'use strict';
-var chokidar, consoleMessage, cssExtensions, lastRun, pathlib, log,
- __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) {return i;}} return -1; };
+var chokidar, consoleMessage, cssExtensions, lastRun, pathlib, log;
require('colors');
@@ -60,7 +59,7 @@ module.exports = function(ss, options) {
//
onChange = function (path) {
var action, _ref;
- action = (_ref = pathlib.extname(path), __indexOf.call(cssExtensions, _ref) >= 0) ? 'updateCSS' : 'reload';
+ action = (_ref = pathlib.extname(path), cssExtensions.indexOf(_ref) >= 0) ? 'updateCSS' : 'reload';
if ((Date.now() - lastRun[action]) > 1000) { // Reload browser max once per second
log.info('✎'.green, consoleMessage[action].grey);
ss.publish.all('__ss:' + action); | perf(array): indexOf direct call
No need to support Node JS without Array.indexOf | socketstream_socketstream | train | js |
9ebb86def978ddb310bd3d898eff551822ea7be2 | diff --git a/angr/analyses/girlscout.py b/angr/analyses/girlscout.py
index <HASH>..<HASH> 100644
--- a/angr/analyses/girlscout.py
+++ b/angr/analyses/girlscout.py
@@ -796,4 +796,22 @@ class GirlScout(Analysis):
return ret
-from ..blade import Blade
\ No newline at end of file
+ def gen_callmap_sif(self, filepath):
+ '''
+ Generate a sif file
+ :return:
+ '''
+ graph = self.call_map
+
+ if graph is None:
+ raise AngrGirlScoutError('Please generate the call graph first.')
+
+ f = open(filepath, "wb")
+
+ for src, dst in graph.edges():
+ f.write("0x%x\tDirectEdge\t0x%x\n" % (src, dst))
+
+ f.close()
+
+from ..blade import Blade
+from ..errors import AngrGirlScoutError
\ No newline at end of file
diff --git a/angr/errors.py b/angr/errors.py
index <HASH>..<HASH> 100644
--- a/angr/errors.py
+++ b/angr/errors.py
@@ -38,4 +38,7 @@ class AngrCFGError(AngrError):
pass
class AngrBackwardSlicingError(AngrError):
+ pass
+
+class AngrGirlScoutError(AngrError):
pass
\ No newline at end of file | Support generating a sif file of the callmap | angr_angr | train | py,py |
cf73ee1e5eb4754db9d65a338239078e1874db84 | diff --git a/src/Applications/Repository/Application.php b/src/Applications/Repository/Application.php
index <HASH>..<HASH> 100644
--- a/src/Applications/Repository/Application.php
+++ b/src/Applications/Repository/Application.php
@@ -181,10 +181,16 @@ class Application extends AbstractRepository
$result = $qb->getQuery()->execute();
return $result;
}
-
+
+ /**
+ * @param $user Auth\Entity\AnonymousUser
+ * @param $applyId
+ * @return null |
+ */
public function findDraft($user, $applyId)
{
if ($user instanceOf UserInterface) {
+ //
$user = $user->getId();
} | [Jobs] restores a job from a draft, when a new job is chosen
(refs #<I>, gh-<I>) | yawik_applications | train | php |
e8a440752777fa9603ff5ee653067a6d6665912e | diff --git a/source/php/NewBlog.php b/source/php/NewBlog.php
index <HASH>..<HASH> 100644
--- a/source/php/NewBlog.php
+++ b/source/php/NewBlog.php
@@ -46,4 +46,33 @@ class NewBlog
$this->addDefaultRole($user->ID, $blogId);
}
}
+
+ /**
+ * Adds the specified userid to a specified or all blogs
+ * @param integer $userId User id to add
+ * @param integer $blogId Specific blog_id (leave null for all)
+ */
+ public function addDefaultRole($userId, $blogId = null)
+ {
+ // Single
+ if ($blogId) {
+ if (is_user_member_of_blog($userId, $blogId)) {
+ return false;
+ }
+
+ add_user_to_blog($blogId, $userId, $this->defaultRole);
+ return true;
+ }
+
+ // Multiple
+ foreach (get_sites() as $site) {
+ if (is_user_member_of_blog($userId, $site->blog_id)) {
+ continue;
+ }
+
+ add_user_to_blog($site->blog_id, $userId, $this->defaultRole);
+ }
+
+ return true;
+ }
} | Fixes missing function in new blog routine | helsingborg-stad_active-directory-api-wp-integration | train | php |
f560a0bf74ad31c7b1d3de99114ca2e5bcec47f9 | diff --git a/honcho/command.py b/honcho/command.py
index <HASH>..<HASH> 100644
--- a/honcho/command.py
+++ b/honcho/command.py
@@ -129,8 +129,7 @@ class Honcho(compat.with_metaclass(Commander, object)):
try:
options.func(self, options)
except CommandError as e:
- if e.message:
- log.error(e.message)
+ log.error(str(e))
sys.exit(1)
@arg('task', help='Task to show help for', nargs='?') | Python 3: exceptions don't have message attributes | nickstenning_honcho | train | py |
c157e9d175173ebb2a2dd420a40533c7efeae43c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -4,21 +4,24 @@ from setuptools import setup
from ripe.atlas.cousteau.version import __version__
+install_requires = ["python-dateutil"],
+
tests_require = [
- 'nose',
- 'coverage',
- 'mock',
- 'jsonschema'
+ "nose",
+ "coverage",
+ "mock",
+ "jsonschema"
]
setup(
- name='ripe.atlas.cousteau',
+ name="ripe.atlas.cousteau",
version=__version__,
packages=["ripe", "ripe.atlas", "ripe.atlas.cousteau"],
namespace_packages=["ripe", "ripe.atlas"],
include_package_data=True,
- description='Python wrapper for RIPE ATLAS API',
- author_email='atlas-dev@ripe.net',
+ description="Python wrapper for RIPE ATLAS API",
+ author_email="atlas-dev@ripe.net",
+ install_requires=install_requires,
tests_require=tests_require,
test_suite="nose.collector",
) | add dependency package for parsing dates + change to double quotes | RIPE-NCC_ripe-atlas-cousteau | train | py |
596f5d1af340a78ec4d1b2666e5f281564f21479 | diff --git a/lib/jekyll.rb b/lib/jekyll.rb
index <HASH>..<HASH> 100644
--- a/lib/jekyll.rb
+++ b/lib/jekyll.rb
@@ -160,11 +160,11 @@ module Jekyll
questionable_path.insert(0, "/") if questionable_path.start_with?("~")
clean_path = File.expand_path(questionable_path, "/")
- clean_path.sub!(%r!\A\w:/!, "/")
- if clean_path.start_with?(base_directory.sub(%r!\A\w:/!, "/"))
+ if clean_path.start_with?(base_directory)
clean_path
else
+ clean_path.sub!(%r!\A\w:/!, "/")
File.join(base_directory, clean_path)
end
end | Proposed fix for #<I>
Strip drive name only when necessary. | jekyll_jekyll | train | rb |
381c406450eb78b71c1a7c3f3ac4bdb50211f06b | diff --git a/asyncwebsockets/client.py b/asyncwebsockets/client.py
index <HASH>..<HASH> 100644
--- a/asyncwebsockets/client.py
+++ b/asyncwebsockets/client.py
@@ -31,3 +31,10 @@ async def open_websocket(url: str):
yield ws
finally:
await ws.close()
+
+
+try:
+ import curio.meta
+ curio.meta.safe_generator(open_websocket.__wrapped__)
+except ImportError:
+ pass | Fix curio module by marking the open_websocket agen safe. | Fuyukai_asyncwebsockets | train | py |
7cd8c044ef29f10ec6e1f47430237fb0232d25ee | diff --git a/addon/-private/radar/models/radar.js b/addon/-private/radar/models/radar.js
index <HASH>..<HASH> 100644
--- a/addon/-private/radar/models/radar.js
+++ b/addon/-private/radar/models/radar.js
@@ -286,7 +286,7 @@ export default class Radar {
this._nextScroll = undefined;
this._nextAdjustment = undefined;
- this._scrollHandler = run.bind(this, () => {
+ this._scrollHandler = run.bind(this, (offsets) => {
if (this.isTracking) {
this._nextScroll = run.scheduleOnce('sync', this, this.filterMovement, offsets);
}
@@ -294,8 +294,8 @@ export default class Radar {
this._resizeHandler = run.bind(this, () => {
this._nextResize = run.debounce(this, this.resizeSatellites, this.resizeDebounce);
});
- this._scrollAdjuster = run.bind(this, () => {
- this._nextAdjustment = run.scheduleOnce('sync', this, this.updateScrollPosition);
+ this._scrollAdjuster = run.bind(this, (offsets) => {
+ this._nextAdjustment = run.scheduleOnce('sync', this, this.updateScrollPosition, offsets);
});
let handlerOpts = SUPPORTS_PASSIVE ? { capture: true, passive: true } : true; | fix(radar): resolves conflicts from last merge | html-next_vertical-collection | train | js |
51c5da70392dfc9588356864fa1770dec127a0dd | diff --git a/idletiming_conn.go b/idletiming_conn.go
index <HASH>..<HASH> 100644
--- a/idletiming_conn.go
+++ b/idletiming_conn.go
@@ -4,6 +4,7 @@ package idletiming
import (
"net"
+ "strings"
"sync/atomic"
"time"
)
@@ -99,7 +100,7 @@ func (c *IdleTimingConn) Read(b []byte) (int, error) {
n, err := c.conn.Read(b)
c.markActive(n)
totalN = totalN + n
- timedOut := isTimeout(err)
+ timedOut := isTimeout(err) && strings.Index(err.Error(), "read") == 0
if timedOut {
// Ignore timeouts when using deadline based on IdleTimeout
err = nil
@@ -133,7 +134,7 @@ func (c *IdleTimingConn) Write(b []byte) (int, error) {
n, err := c.conn.Write(b)
c.markActive(n)
totalN = totalN + n
- timedOut := isTimeout(err)
+ timedOut := isTimeout(err) && strings.Index(err.Error(), "write") == 0
if timedOut {
// Ignore timeouts when using deadline based on IdleTimeout
err = nil | getlantern/lantern#<I> Idletiming checks type of timeout error (read vs write) | getlantern_idletiming | train | go |
631757d75519e21b6e8e015e017f92cf838bd947 | diff --git a/js/bootstrap-datetimepicker.js b/js/bootstrap-datetimepicker.js
index <HASH>..<HASH> 100644
--- a/js/bootstrap-datetimepicker.js
+++ b/js/bootstrap-datetimepicker.js
@@ -515,9 +515,10 @@
left = offset.left;
}
- if(left+220 > document.body.clientWidth){
- left = document.body.clientWidth-220;
- }
+ var bodyWidth = document.body.clientWidth || window.innerWidth;
+ if (left + 220 > bodyWidth) {
+ left = bodyWidth - 220;
+ }
if (this.pickerPosition == 'top-left' || this.pickerPosition == 'top-right') {
top = offset.top - this.picker.outerHeight(); | Fixed issue where document.body.clientWidth was 0 when datetimepicker is shown in modal and overflow:hidden is specified which caused picker to render off-screen. | smalot_bootstrap-datetimepicker | train | js |
425b2c712fd961d4bdbb3b9b87a5dad4ecaa4bfd | diff --git a/htlcswitch/switch_test.go b/htlcswitch/switch_test.go
index <HASH>..<HASH> 100644
--- a/htlcswitch/switch_test.go
+++ b/htlcswitch/switch_test.go
@@ -2903,7 +2903,7 @@ func checkHtlcEvents(t *testing.T, events <-chan interface{},
event)
}
- case <-time.After(time.Second):
+ case <-time.After(5 * time.Second):
t.Fatalf("expected event: %v", expected)
}
} | htlcswitch/switch_test: increase checkHtlcEvents timeout
This flakes locally for me on darwin. | lightningnetwork_lnd | train | go |
0622f129d3e2bef933788012dddaded11471e429 | diff --git a/oci8.go b/oci8.go
index <HASH>..<HASH> 100644
--- a/oci8.go
+++ b/oci8.go
@@ -376,7 +376,7 @@ import (
"math"
"reflect"
"regexp"
- "runtime"
+ //"runtime"
"strconv"
"strings"
"time"
@@ -928,7 +928,7 @@ func (c *OCI8Conn) prepare(ctx context.Context, query string) (driver.Stmt, erro
}
ss := &OCI8Stmt{c: c, s: s, bp: (**C.OCIBind)(bp), defp: (**C.OCIDefine)(defp)}
- runtime.SetFinalizer(ss, (*OCI8Stmt).Close)
+ //runtime.SetFinalizer(ss, (*OCI8Stmt).Close)
return ss, nil
}
@@ -938,7 +938,7 @@ func (s *OCI8Stmt) Close() error {
}
s.closed = true
- runtime.SetFinalizer(s, nil)
+ //runtime.SetFinalizer(s, nil)
C.OCIHandleFree(
s.s,
C.OCI_HTYPE_STMT) | temporary disabled runtime.SetFinalizer | mattn_go-oci8 | train | go |
30e2d8287a63173eb10a8ad3650dabc92b8df7a7 | diff --git a/affirm.py b/affirm.py
index <HASH>..<HASH> 100644
--- a/affirm.py
+++ b/affirm.py
@@ -25,6 +25,15 @@ import inspect
from collections import OrderedDict
def make_assert_message(frame, regex):
+ def extract_condition():
+ code_context = inspect.getframeinfo(frame)[3]
+ if not code_context:
+ return ''
+ match = re.search(regex, code_context[0])
+ if not match:
+ return ''
+ return match.group(1).strip()
+
class ReferenceFinder(ast.NodeVisitor):
def __init__(self):
self.names = []
@@ -40,13 +49,9 @@ def make_assert_message(frame, regex):
def visit_Name(self, node):
self.names.append(node.id)
- code_context = inspect.getframeinfo(frame)[3]
- if not code_context:
- return ''
- match = re.search(regex, code_context[0])
- if not match:
- return ''
- condition = match.group(1).strip()
+ condition = extract_condition()
+ if not condition:
+ return
deref = ReferenceFinder().find(ast.parse(condition), frame)
deref_str = ''
if deref: | factored out condition parsing | elifiner_affirm | train | py |
1038b3a905622d2fced778fc6997c04dd750ac38 | diff --git a/go/service/gregor.go b/go/service/gregor.go
index <HASH>..<HASH> 100644
--- a/go/service/gregor.go
+++ b/go/service/gregor.go
@@ -639,9 +639,12 @@ func (g *gregorHandler) OnConnect(ctx context.Context, conn *rpc.Connection,
// If we get a random OnConnect on some other connection that is not g.conn, then
// just reject it.
- if g.conn != nil && conn != g.conn {
+ g.connMutex.Lock()
+ if conn != g.conn {
+ g.connMutex.Unlock()
return chat.ErrDuplicateConnection
}
+ g.connMutex.Unlock()
timeoutCli := WrapGenericClientWithTimeout(cli, GregorRequestTimeout, chat.ErrChatServerTimeout)
chatCli := chat1.RemoteClient{Cli: chat.NewRemoteClient(g.G(), cli)} | actually keep failing on nil but lock check | keybase_client | train | go |
00003292e2aad5d83efa65a8e55ca56dd7f0606e | diff --git a/tests/functional.py b/tests/functional.py
index <HASH>..<HASH> 100644
--- a/tests/functional.py
+++ b/tests/functional.py
@@ -75,8 +75,8 @@ def functional_tests():
logging.info("Creating a queue with a link")
check_call(tej + ['setup', destination,
- '--queue', '~/tej 2/queue',
- '--make-link', '~/tej 2/link'])
+ '--queue', 'tej 2/queue',
+ '--make-link', 'tej 2/link'])
assert Path('~/tej 2/queue').expand_user().is_dir()
with Path('~/tej 2/link').expand_user().open('r') as fp:
assert fp.read() == ('tejdir: %s\n' % | Change functional test to setup with relative path | VisTrails_tej | train | py |
7cd00132c82cac094d15ede00cf9ab61603f37a9 | diff --git a/pysat/_meta.py b/pysat/_meta.py
index <HASH>..<HASH> 100644
--- a/pysat/_meta.py
+++ b/pysat/_meta.py
@@ -784,7 +784,7 @@ class Meta(object):
current_label : str
The hidden attribute to be updated that actually stores metadata
default : float
- Deafult setting to use for label if there is no attribute
+ Default setting to use for label if there is no attribute
value (default=np.nan)
use_names_default : bool
if True, MetaData variable names are used as the default | MAINT: spelling
Fixed spelling in Meta docstring. | rstoneback_pysat | train | py |
15d36d8d1d9f65e707fde82c32e60f7056ca05e6 | diff --git a/src/Mpociot/VatCalculator/VatCalculator.php b/src/Mpociot/VatCalculator/VatCalculator.php
index <HASH>..<HASH> 100644
--- a/src/Mpociot/VatCalculator/VatCalculator.php
+++ b/src/Mpociot/VatCalculator/VatCalculator.php
@@ -571,6 +571,24 @@ class VatCalculator
*/
public function isValidVATNumber($vatNumber)
{
+ $details = self::getVATDetails($vatNumber);
+
+ if ($details) {
+ return $details->valid;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * @param $vatNumber
+ *
+ * @throws VATCheckUnavailableException
+ *
+ * @return object|false
+ */
+ public function getVATDetails($vatNumber)
+ {
$vatNumber = str_replace([' ', '-', '.', ','], '', trim($vatNumber));
$countryCode = substr($vatNumber, 0, 2);
$vatNumber = substr($vatNumber, 2);
@@ -582,7 +600,7 @@ class VatCalculator
'countryCode' => $countryCode,
'vatNumber' => $vatNumber,
]);
- return $result->valid;
+ return $result;
} catch (SoapFault $e) {
return false;
} | Update VatCalculator.php: Added getVATDetails()
The new function getVATDetails($vatNumber) will return the details of the soap response (requestDate, valid, name, address, as well as countryCode, vatNumber). This data can be stored for reference and financial investigations. | mpociot_vat-calculator | train | php |
89fa29d821bfdc5a5b0d47366949f013b08425f8 | diff --git a/src/State.php b/src/State.php
index <HASH>..<HASH> 100644
--- a/src/State.php
+++ b/src/State.php
@@ -2,6 +2,7 @@
namespace Reroute;
+use ReflectionMethod;
use ReflectionFunction;
use ReflectionException;
use BadMethodCallException;
@@ -43,8 +44,12 @@ class State
public function run()
{
$call = $this->state;
- while (is_callable($call)) {
- $reflection = new ReflectionFunction($call);
+ do {
+ if (is_object($call) && method_exists($call, '__invoke')) {
+ $reflection = new ReflectionMethod($call, '__invoke');
+ } else {
+ $reflection = new ReflectionFunction($call);
+ }
$parameters = $reflection->getParameters();
$arguments = [];
foreach ($parameters as $key => $value) {
@@ -63,7 +68,8 @@ class State
}
}
$call = call_user_func_array($call, $arguments);
- }
+ $this->arguments = [];
+ } while (is_callable($call));
return $call;
} | this needs to work slightly differently if we required __invoke support. also, after each loop reset $arguments, it is really only applicable for the actual state, not for subsequent calls (defaults should be used there) | monolyth-php_reroute | train | php |
cca9ee59f115733cdb3eea79eb8e42d16f993f7d | diff --git a/kubespawner/spawner.py b/kubespawner/spawner.py
index <HASH>..<HASH> 100644
--- a/kubespawner/spawner.py
+++ b/kubespawner/spawner.py
@@ -1596,7 +1596,7 @@ class KubeSpawner(Spawner):
if data is not None:
if data["status"]["phase"] == 'Pending':
return None
- ctr_stat = data["status"]["containerStatuses"]
+ ctr_stat = data["status"].get("containerStatuses")
if ctr_stat is None: # No status, no container (we hope)
# This seems to happen when a pod is idle-culled.
return 1 | Access containerStatuses key with get()
There are some scenarios in which a pod will have a status
value but not a containerStatuses value. This change prevents
a KeyError in that case.
Closes: #<I> | jupyterhub_kubespawner | train | py |
9180e0f83c8119b9264c6b87899bfc4611d80183 | diff --git a/tile_generator/config.py b/tile_generator/config.py
index <HASH>..<HASH> 100644
--- a/tile_generator/config.py
+++ b/tile_generator/config.py
@@ -109,7 +109,7 @@ class Config(dict):
'package': package
}]
if package.get('is_decorator', False):
- release['requires_meta_buildpack'] = True
+ release['requires_meta_buildpack'] = True
if 'is_app' in flags:
manifest = package.get('manifest', { 'name': package['name'] })
if not 'is_docker' in flags:
@@ -441,6 +441,9 @@ class Config(dict):
def update_compilation_vm_disk_size(self, manifest):
package_file = manifest.get('path')
+ if not os.path.exists(package_file):
+ print('Package file "{}" not found! Please check the manifest path in your tile.yml file.'.format(package_file), file=sys.stderr)
+ sys.exit(1)
package_size = os.path.getsize(package_file) // (1024 * 1024) # bytes to megabytes
self['compilation_vm_disk_size'] = max(self['compilation_vm_disk_size'], 4 * package_size) | catch missing package file with an error instead of a stack trace | cf-platform-eng_tile-generator | train | py |
4b2584f2b5b86e7c005b39092133993a119adbc0 | diff --git a/src/main/java/eu/hansolo/tilesfx/chart/ChartData.java b/src/main/java/eu/hansolo/tilesfx/chart/ChartData.java
index <HASH>..<HASH> 100644
--- a/src/main/java/eu/hansolo/tilesfx/chart/ChartData.java
+++ b/src/main/java/eu/hansolo/tilesfx/chart/ChartData.java
@@ -59,12 +59,18 @@ public class ChartData implements Comparable<ChartData> {
public ChartData() {
this("", 0, Tile.BLUE, Instant.now());
}
+ public ChartData(final String NAME) {
+ this(NAME, 0, Tile.BLUE, Instant.now());
+ }
public ChartData(double VALUE) {
this("", VALUE, Tile.BLUE, Instant.now());
}
public ChartData(final double VALUE, final Instant TIMESTAMP) {
this("", VALUE, Tile.BLUE, TIMESTAMP);
}
+ public ChartData(final String NAME, final Color COLOR) {
+ this(NAME, 0, COLOR);
+ }
public ChartData(final String NAME, final double VALUE) {
this(NAME, VALUE, Tile.BLUE, Instant.now());
} | Added two constructors to ChartData | HanSolo_tilesfx | train | java |
de68f83c1f810a97d8c5b2adea36ebecaceb0201 | diff --git a/pyrogram/types/object.py b/pyrogram/types/object.py
index <HASH>..<HASH> 100644
--- a/pyrogram/types/object.py
+++ b/pyrogram/types/object.py
@@ -56,7 +56,7 @@ class Object(metaclass=Meta):
"_": obj.__class__.__name__,
**{
attr: (
- "*" * len(getattr(obj, attr))
+ "*" * 9
if attr == "phone_number" else
str(datetime.fromtimestamp(getattr(obj, attr)))
if attr.endswith("date") else | Use fixed length mask instead of dynamic length (#<I>) | pyrogram_pyrogram | train | py |
0c6f137f0d02ec91758dc310172f6a80664e6560 | diff --git a/Bundle/WidgetBundle/Controller/WidgetController.php b/Bundle/WidgetBundle/Controller/WidgetController.php
index <HASH>..<HASH> 100644
--- a/Bundle/WidgetBundle/Controller/WidgetController.php
+++ b/Bundle/WidgetBundle/Controller/WidgetController.php
@@ -231,10 +231,12 @@ class WidgetController extends Controller
$this->get('victoire_widget_map.builder')->build($view, $this->get('doctrine.orm.entity_manager'));
$widgetView = WidgetMapHelper::getWidgetMapByWidgetAndView($widget, $view)->getView();
- $widgetViewReference = $this->container->get('victoire_view_reference.repository')
- ->getOneReferenceByParameters(['viewId' => $view->getId()]);
+ if(!$view instanceof \Victoire\Bundle\TemplateBundle\Entity\Template) {
+ $widgetViewReference = $this->container->get('victoire_view_reference.repository')
+ ->getOneReferenceByParameters(['viewId' => $view->getId()]);
+ $widgetView->setReference($widgetViewReference);
+ }
- $widgetView->setReference($widgetViewReference);
$this->get('victoire_core.current_view')->setCurrentView($view);
try {
$form = $this->get('form.factory')->create('victoire_widget_style_type', $widget, [ | Fix bug during Widget stylize action to avoid ViewReference crushing when Widget's View is a Template | Victoire_victoire | train | php |
60510ef8bb84f559be87495f52f012b418f96f7d | diff --git a/org/xbill/DNS/Name.java b/org/xbill/DNS/Name.java
index <HASH>..<HASH> 100644
--- a/org/xbill/DNS/Name.java
+++ b/org/xbill/DNS/Name.java
@@ -494,7 +494,6 @@ toWire(DataByteOutputStream out, Compression c) throws IOException {
out.writeString((byte []) name[i]);
}
}
- out.writeByte(0);
}
/** | toWire() was broken
git-svn-id: <URL> | dnsjava_dnsjava | train | java |
e2660f2075806cf0e153b7ddef311feca9bfee4a | diff --git a/lib/router.js b/lib/router.js
index <HASH>..<HASH> 100644
--- a/lib/router.js
+++ b/lib/router.js
@@ -16,6 +16,8 @@ module.exports = function (app) {
}
analytics.screenView({screenName: ctx.canonicalPath});
document.querySelector('#app').scrollTop = 0;
+ app.$broadcast('closeShim');
+ app.$broadcast('closeModalPrompt');
next();
}); | force close shim on navigation change | mozilla_webmaker-android | train | js |
694bdb3e4c7ef7bcd48dd4e129b79e1e12f594f2 | diff --git a/v0.1/clientside/unhosted/unhosted.js b/v0.1/clientside/unhosted/unhosted.js
index <HASH>..<HASH> 100644
--- a/v0.1/clientside/unhosted/unhosted.js
+++ b/v0.1/clientside/unhosted/unhosted.js
@@ -75,7 +75,8 @@ function Unhosted() {
return xmlhttp.responseText;
}
function checkPubSign(cmd, PubSign, nick) {
- return (makeRsaFromSubNick(nick).doPublic(parseBigInt(PubSign.replace(/[ \n]+/g, ""), 16)).toString(16).replace(/^1f+00/, '') == sha1.hex(cmd));
+ var rsa = makeRsaFromSubNick(nick);
+ return (parseBigInt(PubSign.replace(/[ \n]+/g, ""), 16).modPowInt(rsa.e, rsa.n).toString(16).replace(/^1f+00/, '') == sha1.hex(cmd));
}
//public:
obj.importPub = function(writeCaps, nick) { | brought doPublic into checkPubSign | remotestorage_remotestorage.js | train | js |
21e27739b62a14c1b6d450dd958bc7bacf2cc2ff | diff --git a/src/Hal/Component/File/Finder.php b/src/Hal/Component/File/Finder.php
index <HASH>..<HASH> 100644
--- a/src/Hal/Component/File/Finder.php
+++ b/src/Hal/Component/File/Finder.php
@@ -39,22 +39,13 @@ class Finder
private $excludedDirs = [];
/**
- * Flags for RecursiveDirectoryIterator
- *
- * @var integer
- */
- private $flags;
-
- /**
* @param string[] $extensions regex of file extensions to include
* @param string[] $excludedDirs regex of directories to exclude
- * @param int $flags
*/
- public function __construct(array $extensions = ['php'], array $excludedDirs = [], $flags = null)
+ public function __construct(array $extensions = ['php'], array $excludedDirs = [])
{
$this->extensions = $extensions;
$this->excludedDirs = $excludedDirs;
- $this->flags = $flags;
}
/**
@@ -69,7 +60,7 @@ class Finder
foreach ($paths as $path) {
if (is_dir($path)) {
$path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
- $directory = new RecursiveDirectoryIterator($path, $this->flags);
+ $directory = new RecursiveDirectoryIterator($path);
$iterator = new RecursiveIteratorIterator($directory);
$filterRegex = sprintf( | Solve passing null instead of int by removing the flag on the Finder, that is unused by the code. | phpmetrics_PhpMetrics | train | php |
751639b30d233ea61227f995866468af56b6c9ca | diff --git a/lxd/device/gpu_mdev.go b/lxd/device/gpu_mdev.go
index <HASH>..<HASH> 100644
--- a/lxd/device/gpu_mdev.go
+++ b/lxd/device/gpu_mdev.go
@@ -122,7 +122,7 @@ func (d *gpuMdev) startVM() (*deviceConfig.RunConfig, error) {
if mdevUUID == "" || !shared.PathExists(fmt.Sprintf("/sys/bus/pci/devices/%s/%s", pciAddress, mdevUUID)) {
mdevUUID = uuid.New()
- err = ioutil.WriteFile(filepath.Join(fmt.Sprintf("/sys/bus/pci/devices/%s/mdev_supported_types/%s/create", pciAddress, d.config["mdev"])), []byte(mdevUUID), 200)
+ err = ioutil.WriteFile(filepath.Join(fmt.Sprintf("/sys/bus/pci/devices/%s/mdev_supported_types/%s/create", pciAddress, d.config["mdev"])), []byte(mdevUUID), 0200)
if err != nil {
if os.IsNotExist(err) {
return nil, fmt.Errorf("The requested profile %q does not exist", d.config["mdev"]) | lxd/device: Fix vgpu file permissions. | lxc_lxd | train | go |
3b84cc9d315c7c276596c991106f5ae06df6a260 | diff --git a/example/serializers.py b/example/serializers.py
index <HASH>..<HASH> 100644
--- a/example/serializers.py
+++ b/example/serializers.py
@@ -1,7 +1,9 @@
from rest_framework import serializers
+from example.models import Blog
-class BlogSerializer(serializers.Serializer):
+class BlogSerializer(serializers.ModelSerializer):
class Meta:
+ model = Blog
fields = ('name', ) | Switched example serializer to use ModelSerializer | django-json-api_django-rest-framework-json-api | train | py |
d65194d66ed62b0aaa5aa6591b52044a1a429644 | diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant/environment.rb
+++ b/lib/vagrant/environment.rb
@@ -158,6 +158,7 @@ module Vagrant
# logger which should be used to log internals only. For outward
# facing information, use {#ui}.
def logger
+ return parent.logger if parent
@logger ||= Util::ResourceLogger.new(resource, self)
end
diff --git a/test/vagrant/environment_test.rb b/test/vagrant/environment_test.rb
index <HASH>..<HASH> 100644
--- a/test/vagrant/environment_test.rb
+++ b/test/vagrant/environment_test.rb
@@ -254,6 +254,15 @@ class EnvironmentTest < Test::Unit::TestCase
assert_equal result, @env.logger
assert_equal result, @env.logger
end
+
+ should "return the parent's local data if a parent exists" do
+ @env = mock_environment
+ @env.stubs(:parent).returns(mock_environment)
+ result = @env.parent.logger
+
+ Vagrant::Util::ResourceLogger.expects(:new).never
+ assert_equal result, @env.logger
+ end
end
context "loading" do | Only initialize a logger on the parent environment | hashicorp_vagrant | train | rb,rb |
370cb988286b1a6dc780d84c4e6cb78dd4bdc7e2 | diff --git a/lib/techs/css-base.js b/lib/techs/css-base.js
index <HASH>..<HASH> 100644
--- a/lib/techs/css-base.js
+++ b/lib/techs/css-base.js
@@ -22,7 +22,7 @@ exports.Tech = INHERIT(base.Tech, {
url = url.substring(0, i);
}
- if (this.tech.opts.freeze && FREEZE.isFreezableUrl(url)) {
+ if (this.tech.opts.freeze && this.isFreezableUrl(url)) {
url = FREEZE.processPath(url);
}
@@ -31,6 +31,10 @@ exports.Tech = INHERIT(base.Tech, {
url = (resolved == url ? PATH.relative(PATH.dirname(path), url) : resolved) + postUrl;
return JSON.stringify(url);
+ },
+
+ isFreezableUrl: function(url) {
+ return FREEZE.isFreezableUrl(url);
}
}) | Add flexibility to freeze
So I can extend tech with my custom extensions in this way
my-tech.js
```js
isFreezableUrl: function(url) {
return this.__base(url) || myRe.test(url)
}
``` | borschik_borschik | train | js |
48cf001461ec7fded47872a6f22482df18d01c5c | diff --git a/controller/clusterinfoupdater.go b/controller/clusterinfoupdater.go
index <HASH>..<HASH> 100644
--- a/controller/clusterinfoupdater.go
+++ b/controller/clusterinfoupdater.go
@@ -123,7 +123,7 @@ func (c *clusterInfoUpdater) updateClusterInfo(cluster appv1.Cluster, info *cach
} else {
clusterInfo.ConnectionState.Status = appv1.ConnectionStatusUnknown
if appCount == 0 {
- clusterInfo.ConnectionState.Message = "Cluster has no application and not being monitored."
+ clusterInfo.ConnectionState.Message = "Cluster has no applications and is not being monitored."
}
} | fix: Minor cleanup for app errors #<I> (#<I>)
First timer commit to fix a gramma issue | argoproj_argo-cd | train | go |
f2bd6bd839f46ab17616f90004bffc5f8547c26d | diff --git a/shared/api/resource.go b/shared/api/resource.go
index <HASH>..<HASH> 100644
--- a/shared/api/resource.go
+++ b/shared/api/resource.go
@@ -155,6 +155,9 @@ type ResourcesNetworkCard struct {
VendorID string `json:"vendor_id,omitempty" yaml:"vendor_id,omitempty"`
Product string `json:"product,omitempty" yaml:"product,omitempty"`
ProductID string `json:"product_id,omitempty" yaml:"product_id,omitempty"`
+
+ // API extension: resources_network_firmware
+ FirmwareVersion string `json:"firmware_version,omitempty" yaml:"firmware_version,omitempty"`
}
// ResourcesNetworkCardPort represents a network port on the system | shared/api: Add FirmwareVersion to ResourcesNetworkCard | lxc_lxd | train | go |
ee83d063ced454ca8e8a2b99a6ae0c2173b4dfad | diff --git a/lib/dimples/renderer.rb b/lib/dimples/renderer.rb
index <HASH>..<HASH> 100644
--- a/lib/dimples/renderer.rb
+++ b/lib/dimples/renderer.rb
@@ -14,7 +14,10 @@ module Dimples
output = engine.render(scope, context) { body }.strip
@source.metadata[:rendered_contents] = output
- template = @site.templates[@source.metadata[:layout]]
+ if @source.metadata[:layout]
+ template = @site.templates[@source.metadata[:layout]]
+ end
+
return output if template.nil?
template.render(context, output) | Check for an actual layout key before trying to grab a template | waferbaby_dimples | train | rb |
c28e52d1aff91c6b28e3b88a531e0ad54e26410d | diff --git a/IO/fcsreader.py b/IO/fcsreader.py
index <HASH>..<HASH> 100755
--- a/IO/fcsreader.py
+++ b/IO/fcsreader.py
@@ -98,8 +98,8 @@ class FCS_Parser(object):
header = {}
header['FCS format'] = file_handle.read(6)
- if header['FCS format'] != 'FCS3.0':
- warnings.warn("""This parser was designed with the FCS 3.0 format in mind. It may or may not work for other FCS formats.""")
+ #if header['FCS format'] != 'FCS3.0':
+ #warnings.warn("""This parser was designed with the FCS 3.0 format in mind. It may or may not work for other FCS formats.""")
file_handle.read(4) # 4 space characters after the FCS format | Removed fcs format warning for FCS <> <I> | eyurtsev_FlowCytometryTools | train | py |
05501003db73dfb725b6ec3aa0185525bc5f475a | diff --git a/tdiary/cli.rb b/tdiary/cli.rb
index <HASH>..<HASH> 100644
--- a/tdiary/cli.rb
+++ b/tdiary/cli.rb
@@ -122,6 +122,7 @@ module TDiary
%w(
README.md
Gemfile
+ Gemfile.lock
config.ru
tdiary.conf.beginner
tdiary.conf.sample | the Gemfile.lock should be copied | tdiary_tdiary-core | train | rb |
8a486404db00e0ce84b2f2d1f86281ee26211fbb | diff --git a/spec/shared_engine/app/controllers/shared_engine/users_controller.rb b/spec/shared_engine/app/controllers/shared_engine/users_controller.rb
index <HASH>..<HASH> 100644
--- a/spec/shared_engine/app/controllers/shared_engine/users_controller.rb
+++ b/spec/shared_engine/app/controllers/shared_engine/users_controller.rb
@@ -21,7 +21,11 @@ module SharedEngine
end
def index_relation
- @users = User.where('id > 0').order('first_name ASC').all
+ @users = if defined?(ActiveRecord::Base) && User < ActiveRecord::Base
+ User.where('id > 0').order('first_name ASC').all
+ else
+ User.limit(100).sort_by(&:first_name)
+ end
respond_to do |format|
format.xml { render_for_api params[:api_template].to_sym, :xml => @users } | makes index_relation dependent from ORM | fabrik42_acts_as_api | train | rb |
52b3d986b51e1d232ed1e96aeccaec5512e6641c | diff --git a/salt/states/file.py b/salt/states/file.py
index <HASH>..<HASH> 100644
--- a/salt/states/file.py
+++ b/salt/states/file.py
@@ -4723,6 +4723,11 @@ def copy(
try:
if os.path.isdir(source):
shutil.copytree(source, name, symlinks=True)
+ for root, dirs, files in os.walk(name):
+ for dir_ in dirs:
+ __salt__['file.chown'](os.path.join(root, dir_), user, group)
+ for file_ in files:
+ __salt__['file.chown'](os.path.join(root, file_), user, group)
else:
shutil.copy(source, name)
ret['changes'] = {name: source} | Added changes for fix_<I> | saltstack_salt | train | py |
8e105a55383a3c94dfe3507c37b79a5e4fe85276 | diff --git a/actionpack/lib/action_dispatch/http/upload.rb b/actionpack/lib/action_dispatch/http/upload.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_dispatch/http/upload.rb
+++ b/actionpack/lib/action_dispatch/http/upload.rb
@@ -27,7 +27,7 @@ module ActionDispatch
@tempfile = hash[:tempfile]
raise(ArgumentError, ':tempfile is required') unless @tempfile
- @original_filename = encode_filename(hash[:filename])
+ @original_filename = hash[:filename]
@content_type = hash[:type]
@headers = hash[:head]
end
@@ -66,13 +66,6 @@ module ActionDispatch
def eof?
@tempfile.eof?
end
-
- private
-
- def encode_filename(filename)
- # Encode the filename in the utf8 encoding, unless it is nil
- filename.force_encoding(Encoding::UTF_8).encode! if filename
- end
end
end
end | rack <I> encodes the filenames in posts correctly now | rails_rails | train | rb |
980d7ff3f0912b50d8daa69833970ebade213f90 | diff --git a/lib/server-request.js b/lib/server-request.js
index <HASH>..<HASH> 100644
--- a/lib/server-request.js
+++ b/lib/server-request.js
@@ -23,7 +23,7 @@ class ServerRequest {
send(options) {
return new Promise((resolve, reject) => {
if (options.method === 'POST' || options.method === 'PUT') {
- options.headers['content-length'] = options.body.length;
+ options.headers['content-length'] = Buffer.byteLength(options.body, 'utf8');
} else {
delete options.body;
} | Correct request body length (#<I>) | flywheelsports_hydra | train | js |
b2cb008b87ec162660c7b58f354134aa4a3d31dd | diff --git a/lib/coral/action/extract.rb b/lib/coral/action/extract.rb
index <HASH>..<HASH> 100644
--- a/lib/coral/action/extract.rb
+++ b/lib/coral/action/extract.rb
@@ -40,7 +40,7 @@ class Extract < Plugin::Action
def execute
super do |node, network|
unless @package.extract(settings[:path])
- self.status = code.extract_failure
+ myself.status = code.extract_failure
end
end
end | Fixing self issues in the extract action provider. | coralnexus_corl | train | rb |
c76b528f01b2385cb9ae50debaf5e73ae72545ff | diff --git a/truffle.js b/truffle.js
index <HASH>..<HASH> 100644
--- a/truffle.js
+++ b/truffle.js
@@ -14,7 +14,7 @@ module.exports = {
solc: {
optimizer: {
enabled: true,
- runs: 200
+ runs: 5000
}
}
}; | Strongly optimize for cheaper transactions
At the cost of slightly more expensive deployment. | urbit_azimuth | train | js |
c9ab5c6119799979908842a34ac8c9f93828562e | diff --git a/test/plugin/test_out_buffered_stdout.rb b/test/plugin/test_out_buffered_stdout.rb
index <HASH>..<HASH> 100644
--- a/test/plugin/test_out_buffered_stdout.rb
+++ b/test/plugin/test_out_buffered_stdout.rb
@@ -1,5 +1,6 @@
require_relative '../helper'
require 'fluent/test'
+require 'fluent/plugin/out_buffered_stdout'
class BufferedStdoutOutputTest < Test::Unit::TestCase
def setup | Add missing requires in buffered output plugin tests | fluent_fluentd | train | rb |
f702e27485981562ed7b88ecd3f8485af4c61b62 | diff --git a/utils/cmd.go b/utils/cmd.go
index <HASH>..<HASH> 100644
--- a/utils/cmd.go
+++ b/utils/cmd.go
@@ -247,7 +247,10 @@ func StartMining(ethereum *eth.Ethereum) bool {
addr := ethereum.KeyManager().Address()
go func() {
- miner = ethminer.NewDefaultMiner(addr, ethereum)
+ if miner == nil {
+ miner = ethminer.NewDefaultMiner(addr, ethereum)
+ }
+
// Give it some time to connect with peers
time.Sleep(3 * time.Second)
for !ethereum.IsUpToDate() {
@@ -255,7 +258,6 @@ func StartMining(ethereum *eth.Ethereum) bool {
}
logger.Infoln("Miner started")
- miner := ethminer.NewDefaultMiner(addr, ethereum)
miner.Start()
}()
RegisterInterrupt(func(os.Signal) {
@@ -269,10 +271,14 @@ func StartMining(ethereum *eth.Ethereum) bool {
func StopMining(ethereum *eth.Ethereum) bool {
if ethereum.Mining && miner != nil {
miner.Stop()
+
logger.Infoln("Miner stopped")
+
ethereum.Mining = false
+
return true
}
+
return false
} | Fixed miner stopping / starting:wq | ethereum_go-ethereum | train | go |
db080ed44832d3840f336e8b7f774ff273518ecd | diff --git a/src/java/arjdbc/sqlite3/SQLite3RubyJdbcConnection.java b/src/java/arjdbc/sqlite3/SQLite3RubyJdbcConnection.java
index <HASH>..<HASH> 100644
--- a/src/java/arjdbc/sqlite3/SQLite3RubyJdbcConnection.java
+++ b/src/java/arjdbc/sqlite3/SQLite3RubyJdbcConnection.java
@@ -152,6 +152,13 @@ public class SQLite3RubyJdbcConnection extends RubyJdbcConnection {
});
}
+ @JRubyMethod(name = "close")
+ public IRubyObject close(final ThreadContext context) {
+ IRubyObject returnValue = super.close(context);
+ disconnect(context);
+ return returnValue;
+ }
+
// NOTE: interestingly it supports getGeneratedKeys but not executeUpdate
// + the driver does not report it supports it via the meta-data yet does
@Override | sqlite3 default disconnect! method will call @connection.close. I really don't
want to drift from their source so I am just making mysql connection close call
disconnect. I half wonder if our close on RubyJdbcConnection should be doing
this? | jruby_activerecord-jdbc-adapter | train | java |
e797f6eb0dddc73ed7f9dd78c3ebba7424bca7e1 | diff --git a/javascript/firefox-driver/js/wrappedElement.js b/javascript/firefox-driver/js/wrappedElement.js
index <HASH>..<HASH> 100644
--- a/javascript/firefox-driver/js/wrappedElement.js
+++ b/javascript/firefox-driver/js/wrappedElement.js
@@ -83,6 +83,12 @@ WebElement.clickElement = function(respond, parameters) {
if (!isOption && this.enableNativeEvents && nativeMouse && node && useNativeClick && thmgr_cls) {
fxdriver.logging.info('Using native events for click');
+ var win = goog.dom.getWindow(goog.dom.getOwnerDocument(unwrapped));
+ for (var frame = win.frameElement; frame; frame = win.frameElement) {
+ frame.scrollIntoView();
+ win = goog.dom.getWindow(goog.dom.getOwnerDocument(frame));
+ }
+
var inViewAfterScroll = bot.action.scrollIntoView(
unwrapped,
new goog.math.Coordinate(elementHalfWidth, elementHalfHeight)); | Fixing frame scrolling, second try | SeleniumHQ_selenium | train | js |
d3f30e2832f7dedae548aab14bcf3d30767b2572 | diff --git a/library/WT/Stats.php b/library/WT/Stats.php
index <HASH>..<HASH> 100644
--- a/library/WT/Stats.php
+++ b/library/WT/Stats.php
@@ -657,7 +657,7 @@ class WT_Stats {
WT_I18N::translate_c('unknown people', 'Unknown').' - '.$per_u;
return "<img src=\"https://chart.googleapis.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_unknown},{$color_female},{$color_male}&chf=bg,s,ffffff00&chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".$chart_title."\" title=\"".$chart_title."\" />";
} else {
- $chd = self::_array_to_extended_encoding(array($tot_f, $tot_m));
+ $chd = self::_array_to_extended_encoding(array(4095*$tot_f/$tot, 4095*$tot_m/$tot));
$chl =
WT_I18N::translate('Females').' - '.$per_f.'|'.
WT_I18N::translate('Males').' - '.$per_m; | Fix: when there are more than <I> individuals of either sex, and no individuals with unknown sex, then the sex-distribution pie-chart fails. See <URL> | fisharebest_webtrees | train | php |
f95f48d6e8d46bdf1ca0935000f2bf17cecafc48 | diff --git a/helper-scripts/wsgi-loader.py b/helper-scripts/wsgi-loader.py
index <HASH>..<HASH> 100644
--- a/helper-scripts/wsgi-loader.py
+++ b/helper-scripts/wsgi-loader.py
@@ -191,7 +191,7 @@ class RequestHandler:
env['wsgi.version'] = (1, 0)
env['wsgi.multithread'] = False
env['wsgi.multiprocess'] = True
- env['wsgi.run_once'] = True
+ env['wsgi.run_once'] = False
if env.get('HTTPS','off') in ('on', '1', 'true', 'yes'):
env['wsgi.url_scheme'] = 'https'
else: | set run_once to False in the wsgi loader
As suggested by @snaury in #<I>. This should improve wsgi app performance as this setting is used to indicate to wsgi apps to skip caching. | phusion_passenger | train | py |
8f260614952c42f974b07399296e5244c5f57af3 | diff --git a/planet/cli/cli.py b/planet/cli/cli.py
index <HASH>..<HASH> 100644
--- a/planet/cli/cli.py
+++ b/planet/cli/cli.py
@@ -30,8 +30,7 @@ LOGGER = logging.getLogger(__name__)
default="warning",
help=("Optional: set verbosity level to warning, info, or debug.\
Defaults to warning."))
-@click.option('-q',
- '--quiet',
+@click.option('--quiet',
is_flag=True,
default=False,
help='Disable ANSI control output.') | Removed -q as a valid quiet input. | planetlabs_planet-client-python | train | py |
8b2a195efdf538cdca08bad5b3a755026ee9d0bf | diff --git a/post-processor.go b/post-processor.go
index <HASH>..<HASH> 100644
--- a/post-processor.go
+++ b/post-processor.go
@@ -96,14 +96,14 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
if p.config.Cpu_sockets != "" {
vm_opt_params.Cpu_sockets, err = strconv.Atoi(p.config.Cpu_sockets)
if err != nil {
- panic(err)
+ return err
}
}
vm_opt_params.Ram = Unspecified
if p.config.Ram != "" {
vm_opt_params.Ram, err = strconv.Atoi(p.config.Ram)
if err != nil {
- panic(err)
+ return err
}
} | fixed some remnants of the error swallowing | hashicorp_packer | train | go |
65df2b88124f5bc92d09367719d2515df31557ce | diff --git a/versions/util/postgresql.py b/versions/util/postgresql.py
index <HASH>..<HASH> 100644
--- a/versions/util/postgresql.py
+++ b/versions/util/postgresql.py
@@ -146,11 +146,12 @@ def create_current_version_unique_identity_indexes(app_name, database=None):
connection = database_connection(database)
with connection.cursor() as cursor:
for model in versionable_models(app_name):
- table_name = model._meta.db_table
- index_name = '%s_%s_identity_v_uniq' % (app_name, table_name)
- if not index_exists(cursor, index_name):
- cursor.execute("CREATE UNIQUE INDEX %s ON %s(%s) WHERE version_end_date IS NULL"
- % (index_name, table_name, 'identity'))
- indexes_created += 1
+ if getattr(model._meta, 'managed', True):
+ table_name = model._meta.db_table
+ index_name = '%s_%s_identity_v_uniq' % (app_name, table_name)
+ if not index_exists(cursor, index_name):
+ cursor.execute("CREATE UNIQUE INDEX %s ON %s(%s) WHERE version_end_date IS NULL"
+ % (index_name, table_name, 'identity'))
+ indexes_created += 1
return indexes_created | Do not try to create UNIQUE indexes on non-managed models | swisscom_cleanerversion | train | py |
746f629d7b1f46ec7091c6ebcbc703ee3e3ab568 | diff --git a/src/server/Uploader.js b/src/server/Uploader.js
index <HASH>..<HASH> 100644
--- a/src/server/Uploader.js
+++ b/src/server/Uploader.js
@@ -220,7 +220,11 @@ class Uploader {
this.emitProgress(bytesUploaded, null)
})
- const formData = { [this.options.fieldname]: file }
+ const formData = Object.assign(
+ {},
+ this.options.metadata,
+ { [this.options.fieldname]: file }
+ )
request.post({ url: this.options.endpoint, formData }, (error, response, body) => {
if (error || response.statusCode >= 400) {
console.error(`error: ${error} status: ${response ? response.statusCode : null}`) | Pass multipart form fields to upload endpoint
Send the custom form fields defined by the Uppy client along to the
upload endpoint. Allows eg. the AwsS3 plugin to work for remote files.
Fixes <URL> | transloadit_uppy-server | train | js |
2826a392c86a5d025d440156c2b47054d600ab4e | diff --git a/tempora/tests/test_schedule.py b/tempora/tests/test_schedule.py
index <HASH>..<HASH> 100644
--- a/tempora/tests/test_schedule.py
+++ b/tempora/tests/test_schedule.py
@@ -64,13 +64,14 @@ class TestCommands:
two_days_from_now = day_from_now + daily
assert day_from_now < next_cmd < two_days_from_now
- @pytest.mark.parametrize("hour", range(24))
- def test_command_at_noon_distant_local(self, hour):
+ @pytest.mark.parametrize("hour", range(10, 14))
+ @pytest.mark.parametrize("tz_offset", (14, -14))
+ def test_command_at_noon_distant_local(self, hour, tz_offset):
"""
Run test_command_at_noon, but with the local timezone
more than 12 hours away from UTC.
"""
- with freezegun.freeze_time(f"2020-01-10 {hour:02}:01", tz_offset=-14):
+ with freezegun.freeze_time(f"2020-01-10 {hour:02}:01", tz_offset=tz_offset):
self.test_command_at_noon() | Test both <I> and -<I> timezone offsets. Ref #8. | jaraco_tempora | train | py |
dc53a0798280aa4b9933b0ab19c736348a818d43 | diff --git a/spec/mongo/sdam_spec.rb b/spec/mongo/sdam_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/mongo/sdam_spec.rb
+++ b/spec/mongo/sdam_spec.rb
@@ -11,7 +11,7 @@ describe 'Server Discovery and Monitoring' do
before(:all) do
Mongo::Client.new(spec.uri_string).tap do |client|
- @client = client.with(connect_timeout: 0.1)
+ @client = client.with(connect_timeout: 0.1, heartbeat_frequency: 100)
end.close
end | RUBY-<I> Increase heartbeat_frequency on client used in sdam test | mongodb_mongo-ruby-driver | train | rb |
1d6865237fdc8d184123d1e89193578da56d73b3 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -14,7 +14,7 @@
from setuptools import setup
-version = '1.1.5'
+version = '1.2.0'
setup(
name='datalab', | Release <I> (#<I>) | googledatalab_pydatalab | train | py |
b78374212bd02079d1ee7756946cdba2232cc2a3 | diff --git a/chef/lib/chef/platform.rb b/chef/lib/chef/platform.rb
index <HASH>..<HASH> 100644
--- a/chef/lib/chef/platform.rb
+++ b/chef/lib/chef/platform.rb
@@ -80,6 +80,14 @@ class Chef
:mdadm => Chef::Provider::Mdadm
}
},
+ :amazon => {
+ :default => {
+ :service => Chef::Provider::Service::Redhat,
+ :cron => Chef::Provider::Cron,
+ :package => Chef::Provider::Package::Yum,
+ :mdadm => Chef::Provider::Mdadm
+ }
+ },
:scientific => {
:default => {
:service => Chef::Provider::Service::Redhat, | CHEF-<I>, amzn is redhat-like | chef_chef | train | rb |
33c04032bac7f55039d6eb436403f5890939884b | diff --git a/sprd/manager/ProductManager.js b/sprd/manager/ProductManager.js
index <HASH>..<HASH> 100644
--- a/sprd/manager/ProductManager.js
+++ b/sprd/manager/ProductManager.js
@@ -1052,7 +1052,8 @@ define(["sprd/manager/IProductManager", "underscore", "flow", "sprd/util/Product
if (configuration.$._size.$.width === 0 || configuration.$._size.$.height === 0) {
configuration.bind('sizeChanged', closedFn)
} else {
- configuration.set(this.getConfigurationPosition(configuration, printArea, printType, options), PREVENT_VALIDATION_OPTIONS);
+ var transform = options.transform || this.getConfigurationPosition(configuration, printArea, printType, options);
+ configuration.set(transform, PREVENT_VALIDATION_OPTIONS);
}
}, | DEV-<I> do not recalculate positioning for bending text | spreadshirt_rAppid.js-sprd | train | js |
ca10570a8f6c1036c3d9c0cd4255870401aaba0e | diff --git a/internal/dic/sysdic_test.go b/internal/dic/sysdic_test.go
index <HASH>..<HASH> 100644
--- a/internal/dic/sysdic_test.go
+++ b/internal/dic/sysdic_test.go
@@ -754,7 +754,12 @@ func TestSystemDicUniGroupList01(t *testing.T) {
func BenchmarkSysDicIPA(b *testing.B) {
for i := 0; i < b.N; i++ {
loadInternalSysDic(IPADicPath)
+ }
+}
+func BenchmarkSysDicUni(b *testing.B) {
+ for i := 0; i < b.N; i++ {
+ loadInternalSysDic(UniDicPath)
}
} | Add a benchmark for unidic loading | ikawaha_kagome | train | go |
d9a5214f4bff1a010d89a85d7c081fadaae9e417 | diff --git a/server/server.go b/server/server.go
index <HASH>..<HASH> 100644
--- a/server/server.go
+++ b/server/server.go
@@ -510,7 +510,6 @@ func (s *Server) serveRaftInfo(w http.ResponseWriter, req *http.Request) {
info["name"] = s.raftServer.Name()
info["state"] = s.raftServer.State()
info["leader"] = s.raftServer.Leader()
- info["state"] = s.raftServer.State()
info["peers"] = peers
w.Write(ensurePrettyPrint(req, info))
} | Update server.go
Remove duped Raft info | rqlite_rqlite | train | go |
fc63a419daafb9093be12198e063d67c00b8ca0d | diff --git a/modules/wycs/src/wycs/transforms/VerificationCheck.java b/modules/wycs/src/wycs/transforms/VerificationCheck.java
index <HASH>..<HASH> 100644
--- a/modules/wycs/src/wycs/transforms/VerificationCheck.java
+++ b/modules/wycs/src/wycs/transforms/VerificationCheck.java
@@ -131,7 +131,7 @@ public class VerificationCheck implements Transform<WycsFile> {
}
public static int getMaxReductions() {
- return 500; // default value
+ return 1000; // default value
}
public void setMaxReductions(int limit) {
@@ -143,7 +143,7 @@ public class VerificationCheck implements Transform<WycsFile> {
}
public static int getMaxInferences() {
- return 200; // default value
+ return 500; // default value
}
public void setMaxInferences(int limit) { | WyIL: Updated timeouts for Verification.
The purpose of this was simply to help ensure all examples in the SCP
paper verify. | Whiley_WhileyCompiler | train | java |
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.