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
c4532ec22a8ff225771d4b70862afc255141cb77
diff --git a/src/Payline/PaylineSDK.php b/src/Payline/PaylineSDK.php index <HASH>..<HASH> 100644 --- a/src/Payline/PaylineSDK.php +++ b/src/Payline/PaylineSDK.php @@ -342,7 +342,10 @@ class PaylineSDK */ public function __construct($merchant_id, $access_key, $proxy_host, $proxy_port, $proxy_login, $proxy_password, $environment, $pathLog = null, $logLevel = Logger::INFO, $externalLogger = null, $defaultTimezone = "Europe/Paris") { - $merchant_id = $merchant_id+''; // prevent cast errors. Mechant ID has to be a string. + if (is_int($merchant_id)) { + $merchant_id = (string) $merchant_id; + } + date_default_timezone_set($defaultTimezone); if ($externalLogger) { $this->logger = $externalLogger;
Fixed bad cast for merchant_id
PaylineByMonext_payline-php-sdk
train
php
cec3684b2cbbb6f62b17182cdc8c2b34eeac535b
diff --git a/modules/kontraktor-http/src/main/javascript/kontraktor-client/kontraktor-client.js b/modules/kontraktor-http/src/main/javascript/kontraktor-client/kontraktor-client.js index <HASH>..<HASH> 100644 --- a/modules/kontraktor-http/src/main/javascript/kontraktor-client/kontraktor-client.js +++ b/modules/kontraktor-http/src/main/javascript/kontraktor-client/kontraktor-client.js @@ -123,7 +123,7 @@ class KClient { console.log("closed connection"); } if ( ! res.isCompleted() ) - res.complete(null,err); + res.complete(null,"closed"); }); socket.onopen( event=> { this.currentSocket.socket = socket;
fix ReferenceError: err is not defined
RuedigerMoeller_kontraktor
train
js
504b91438b4fc0f1ced89730c38ffcdbbcecbbcb
diff --git a/lib/entity.js b/lib/entity.js index <HASH>..<HASH> 100644 --- a/lib/entity.js +++ b/lib/entity.js @@ -26,9 +26,6 @@ exports = module.exports = function(settings, logger) { entity.id = 'file://' + path.dirname(pkginfo.find(require.main)); } - // TODO: Make this pkg.name, probably default it in repl itself - entity.name = path.basename(entity.id); - var aliases = settings.get('entity/aliases'); // FIX TOML var arr, i, len; diff --git a/lib/repl.js b/lib/repl.js index <HASH>..<HASH> 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -2,6 +2,7 @@ * Module dependencies. */ var repl = require('repl') + , pkginfo = require('pkginfo') , util = require('util'); @@ -73,6 +74,10 @@ exports = module.exports = function(container) { self.log('running as',process.pid,process.argv[1]); } + + var pkg = pkginfo.read(require.main).package; + self.name(pkg.name); + return self; }
Default REPL prompt to package name.
bixbyjs_bixby-common
train
js,js
4a4938c67b9f3ccefcd95a1c724ac617b8e30782
diff --git a/apiblueprint_view/parser.py b/apiblueprint_view/parser.py index <HASH>..<HASH> 100644 --- a/apiblueprint_view/parser.py +++ b/apiblueprint_view/parser.py @@ -69,8 +69,8 @@ class ApibpParser: raise SuspiciousFileOperation("extension not in whitelist") # recursively replace any includes in child files - include_apibp = self._replace_includes( - open(include_path, 'r').read()) + with open(include_path, 'r') as f: + include_apibp = self._replace_includes(f.read()) apibp = apibp.replace( '<!-- include(' + match + ') -->', include_apibp) @@ -98,7 +98,8 @@ class ApibpParser: pass def parse(self): - apibp = open(self.blueprint, 'r').read() + with open(self.blueprint, 'r') as f: + apibp = f.read() if self.process_includes: apibp = self._replace_includes(apibp) self.api = parse(apibp)
fix ResourceWarning: unclosed file
chris48s_django-apiblueprint-view
train
py
27e1b28b34e32d70f0fb38b717405d0b27327c63
diff --git a/builtin/providers/azurerm/resource_arm_eventhub_authorization_rule.go b/builtin/providers/azurerm/resource_arm_eventhub_authorization_rule.go index <HASH>..<HASH> 100644 --- a/builtin/providers/azurerm/resource_arm_eventhub_authorization_rule.go +++ b/builtin/providers/azurerm/resource_arm_eventhub_authorization_rule.go @@ -45,11 +45,7 @@ func resourceArmEventHubAuthorizationRule() *schema.Resource { ForceNew: true, }, - "location": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, + "location": locationSchema(), "listen": { Type: schema.TypeBool,
Making use of the Location Schema
hashicorp_terraform
train
go
96a90be554be8ebd531c68cc30c2944bf072ad17
diff --git a/para-server/src/main/java/com/erudika/para/ParaServer.java b/para-server/src/main/java/com/erudika/para/ParaServer.java index <HASH>..<HASH> 100644 --- a/para-server/src/main/java/com/erudika/para/ParaServer.java +++ b/para-server/src/main/java/com/erudika/para/ParaServer.java @@ -49,6 +49,7 @@ import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.ServiceLoader; +import java.util.concurrent.TimeUnit; import javax.annotation.PreDestroy; import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; @@ -344,6 +345,8 @@ public class ParaServer implements WebApplicationInitializer, Ordered { } // Disable Jetty version header dcf.getHttpConfiguration().setSendServerVersion(false); + // Increase idle timeout + dcf.getHttpConfiguration().setIdleTimeout(TimeUnit.MINUTES.toMillis(5)); } } }
increased idle timeout for all requests due to failing batch writes with <I>
Erudika_para
train
java
b20f3859933ff3c02213d7ac253844594878cb98
diff --git a/source/awesome_tool/statemachine/storage/storage.py b/source/awesome_tool/statemachine/storage/storage.py index <HASH>..<HASH> 100644 --- a/source/awesome_tool/statemachine/storage/storage.py +++ b/source/awesome_tool/statemachine/storage/storage.py @@ -38,7 +38,7 @@ class StateMachineStorage(Observable): STATEMACHINE_FILE = 'statemachine.yaml' LIBRARY_FILE = 'library.yaml' - def __init__(self, base_path): + def __init__(self, base_path='/tmp'): Observable.__init__(self) self.storage_utils = StorageUtils(base_path)
Set default base_bath for storage Most methods of storage do not use the class base path anyway.
DLR-RM_RAFCON
train
py
c6bca5dde99a929154e5aa5510a50aae8c5f712a
diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -251,6 +251,37 @@ describe('firstChunk()', function () { done(); })); }); + + it('should work even when consuming the stream in the callback', function (done) { + var callbackCalled = false; + var inputStream = streamtest[version].fromChunks(content.split('')); + var fCStream; + + fCStream = inputStream + .pipe(firstChunkStream({chunkLength: 7}, function (err, chunk, enc, cb) { + if (err) { + done(err); + return; + } + + assert.equal(chunk.toString('utf-8'), content.substr(0, 7)); + callbackCalled = true; + + fCStream.pipe(streamtest[version].toText(function (err, text) { + if (err) { + done(err); + return; + } + + assert.deepEqual(text, content); + assert(callbackCalled, 'Callback has been called.'); + + done(); + })); + + cb(null, chunk); + })); + }); }); describe('and insufficient content', function () {
Adding a test for piping in the callback
sindresorhus_first-chunk-stream
train
js
f592063fb57cb201ec207e7d330cc0754c14ffb0
diff --git a/lib/navigationlib.php b/lib/navigationlib.php index <HASH>..<HASH> 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -2715,7 +2715,8 @@ class global_navigation extends navigation_node { // Just a link to course competency. $title = get_string('competencies', 'core_competency'); $path = new moodle_url("/admin/tool/lp/coursecompetencies.php", array('courseid' => $course->id)); - $coursenode->add($title, $path, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/competencies', '')); + $coursenode->add($title, $path, navigation_node::TYPE_SETTING, null, 'competencies', + new pix_icon('i/competencies', '')); } if ($navoptions->grades) { $url = new moodle_url('/grade/report/index.php', array('id'=>$course->id));
MDL-<I> navigation: Add node key to competencies navigation node
moodle_moodle
train
php
ba7effa973a8d35b24408b0cdd2c75585ebc5afc
diff --git a/lib/dep_selector/package_version.rb b/lib/dep_selector/package_version.rb index <HASH>..<HASH> 100644 --- a/lib/dep_selector/package_version.rb +++ b/lib/dep_selector/package_version.rb @@ -12,7 +12,7 @@ module DepSelector def generate_gecode_constraints pkg_mv = package.gecode_model_var - pkg_densely_packed_version = package.densely_packed_versions["= #{version}"].first + pkg_densely_packed_version = package.densely_packed_versions.index(version) guard = (pkg_mv.must == pkg_densely_packed_version) conjunction = dependencies.inject(guard){ |acc, dep| acc & dep.generate_gecode_constraint }
PackageVersion now uses whatever was set as its version to get its densely packed version. This is in service of the larger goal of abstracting versions so that users can use whatever objects they like to indicate versions and constraints, so long as the conform to the duck-typing requirements, of course.
chef_dep-selector
train
rb
a966ca543cf892010986081299c3a956c33fe086
diff --git a/pymatgen/ext/cod.py b/pymatgen/ext/cod.py index <HASH>..<HASH> 100644 --- a/pymatgen/ext/cod.py +++ b/pymatgen/ext/cod.py @@ -132,7 +132,8 @@ class COD(object): structures.append({"structure": s, "cod_id": int(cod_id), "sg": sg}) except Exception: - print("Structure.from_str failed while parsing CIF file:\n", r.text) + import warnings + warnings.warn("\nStructure.from_str failed while parsing CIF file:\n%s" % r.text) raise return structures
Warn and re-raise
materialsproject_pymatgen
train
py
be83f3ecb50baa4102748fc6255ea59814107a73
diff --git a/lib/capture.js b/lib/capture.js index <HASH>..<HASH> 100644 --- a/lib/capture.js +++ b/lib/capture.js @@ -1,5 +1,7 @@ var deep = require('deep'); +var data; + // capture extra data about the currently running test // this is reset between each test
Don't use a global in capture.js, or else deep.extend fails in horrible ways
rprieto_supersamples
train
js
dedb05914bc453039ce9729fa89c233de8f1d8e5
diff --git a/go/client/cmd_passphrase_remember.go b/go/client/cmd_passphrase_remember.go index <HASH>..<HASH> 100644 --- a/go/client/cmd_passphrase_remember.go +++ b/go/client/cmd_passphrase_remember.go @@ -24,8 +24,8 @@ type CmdPassphraseRemember struct { func NewCmdPassphraseRemember(cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command { return cli.Command{ Name: "remember", - ArgumentHelp: "[bool]", - Usage: "Remember your keybase account passphrase.", + ArgumentHelp: "[<true|false>]", + Usage: "Set whether your account passphrase should be remembered across restarts. Run with no arguments to check status.", Action: func(c *cli.Context) { cl.ChooseCommand(NewCmdPassphraseRememberRunner(g), "change", c) },
tweak remember passphrase help copy (#<I>)
keybase_client
train
go
004aba66306b8be69184d8309c73bea794d87957
diff --git a/phoebe/parameters/parameters.py b/phoebe/parameters/parameters.py index <HASH>..<HASH> 100644 --- a/phoebe/parameters/parameters.py +++ b/phoebe/parameters/parameters.py @@ -1157,13 +1157,7 @@ class ParameterSet(object): else: kwargs = {} - # TODO: why the try except here? - try: - self.set(twig, value, **kwargs) - except ValueError, msg: - # TODO: custom error type for more than 1 result and mention - # changing dict_set_all@settings - raise ValueError(msg) + self.set(twig, value, **kwargs) def __contains__(self, twig): """
don't catch exceptions in setitem by catching and raising the error, some of the traceback is hidden, which can make debugging difficult
phoebe-project_phoebe2
train
py
5737164207298408c809645b9e52b60b056f6cf1
diff --git a/lib/as2.js b/lib/as2.js index <HASH>..<HASH> 100644 --- a/lib/as2.js +++ b/lib/as2.js @@ -24,6 +24,8 @@ var _ = require("lodash"); var toAS2 = function(obj) { var as2 = _.cloneDeep(obj); + as2["@context"] = "https://www.w3.org/ns/activitystreams"; + as2["@id"] = as2.id; delete as2.id; diff --git a/test/as2-test.js b/test/as2-test.js index <HASH>..<HASH> 100644 --- a/test/as2-test.js +++ b/test/as2-test.js @@ -62,6 +62,10 @@ suite.addBatch({ return as2(act); }, + "it has an @context": function(act) { + assert.isTrue(act.hasOwnProperty("@context")); + assert.equal(act["@context"], "https://www.w3.org/ns/activitystreams"); + }, "id is renamed to @id": function(act) { assert.isFalse(act.hasOwnProperty("id")); assert.equal(act["@id"], "urn:uuid:77451568-ce6a-42eb-8a9f-60ece187725f");
Properly include an @context definition Many
pump-io_pump.io
train
js,js
9619de1d84633e34b41917b162bbdac7babd65b3
diff --git a/rados/conn.go b/rados/conn.go index <HASH>..<HASH> 100644 --- a/rados/conn.go +++ b/rados/conn.go @@ -127,10 +127,10 @@ func (c *Conn) ListPools() (names []string, err error) { // SetConfigOption sets the value of the configuration option identified by // the given name. func (c *Conn) SetConfigOption(option, value string) error { - c_opt, c_val := C.CString(option), C.CString(value) - defer C.free(unsafe.Pointer(c_opt)) - defer C.free(unsafe.Pointer(c_val)) - ret := C.rados_conf_set(c.cluster, c_opt, c_val) + cOpt, cVal := C.CString(option), C.CString(value) + defer C.free(unsafe.Pointer(cOpt)) + defer C.free(unsafe.Pointer(cVal)) + ret := C.rados_conf_set(c.cluster, cOpt, cVal) return getError(ret) }
rados: naming conventions: c_opt/c_val -> cOpt/cVal Fix up variable names that don't meet Go standards. Command: gofmt -w -r "c_opt -> cOpt" rados/conn.go Command: gofmt -w -r "c_val -> cVal" rados/conn.go
ceph_go-ceph
train
go
8b497bbce31a0b786c36a3ecdb8347ed030729c9
diff --git a/lib/datalib.php b/lib/datalib.php index <HASH>..<HASH> 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -1292,6 +1292,12 @@ function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user if (defined('MDL_PERFDB')) { global $PERF ; $PERF->dbqueries++; $PERF->logwrites++;}; + if ($CFG->type = 'oci8po') { + if (empty($info)) { + $info = ' '; + } + } + $result = $db->Execute('INSERT INTO '. $CFG->prefix .'log (time, userid, course, ip, module, cmid, action, url, info) VALUES (' . "'$timenow', '$userid', '$courseid', '$REMOTE_ADDR', '$module', '$cm', '$action', '$url', '$info')");
Prevent Oracle to fail when inserting records with log->info empty (will be solved once we got all those NOT NULL fields fixed) Merged from MOODLE_<I>_STABLE
moodle_moodle
train
php
74b6ec1b93ec24ee15700f962f404b17748018f0
diff --git a/bootstrap.js b/bootstrap.js index <HASH>..<HASH> 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -1,11 +1,15 @@ module.exports = function(grunt) { // Initialize global configuration variables. var config = grunt.file.readJSON('Gruntconfig.json'); - grunt.initConfig({ - config: config - }); + if (grunt.config.getRaw() === undefined) { + grunt.initConfig({ + config: config + }); + } + else { + grunt.config.set('config', config); + } - // Set up default global configuration. var GDT = require('./lib/init')(grunt); GDT.init();
Allow project to initialize configuration object.
phase2_grunt-drupal-tasks
train
js
5154c8ad1cf225ecfe351312e657fbc8588c000c
diff --git a/zhihu/post.py b/zhihu/post.py index <HASH>..<HASH> 100644 --- a/zhihu/post.py +++ b/zhihu/post.py @@ -143,7 +143,6 @@ class Post(JsonAsSoupMixin, BaseZhihu): :return: 无 :rtype: None """ - print(1213) if mode not in ["html", "md", "markdown"]: raise ValueError("`mode` must be 'html', 'markdown' or 'md'," " got {0}".format(mode))
remove print at post.save
7sDream_zhihu-py3
train
py
366e0d622ca7099cb5bf67665461780994cc6a8b
diff --git a/lib/clever-ruby.rb b/lib/clever-ruby.rb index <HASH>..<HASH> 100644 --- a/lib/clever-ruby.rb +++ b/lib/clever-ruby.rb @@ -156,8 +156,8 @@ module Clever begin error_obj = Clever::JSON.load(rbody) error_obj = Util.symbolize_names(error_obj) - error = error_obj[:error] or raise StripeError.new # escape from parsing - rescue MultiJson::DecodeError, StripeError + error = error_obj[:error] or raise CleverError.new # escape from parsing + rescue MultiJson::DecodeError, CleverError raise APIError.new("Invalid response object from API: #{rbody.inspect} (HTTP response code was #{rcode})", rcode, rbody) end
Replace references to StripError with CleverError
Clever_clever-ruby
train
rb
54fb814f990b521da9ad244b7d831fee5c770b14
diff --git a/src/de/invation/code/toval/misc/wd/AbstractComponentContainer.java b/src/de/invation/code/toval/misc/wd/AbstractComponentContainer.java index <HASH>..<HASH> 100644 --- a/src/de/invation/code/toval/misc/wd/AbstractComponentContainer.java +++ b/src/de/invation/code/toval/misc/wd/AbstractComponentContainer.java @@ -38,8 +38,8 @@ public abstract class AbstractComponentContainer<O extends NamedComponent> { private static final String COMPONENT_FILE_FORMAT = "%s%s%s"; private boolean ignoreIncompatibleFiles = DEFAULT_IGNORE_INCOMPATIBLE_FILES; - private final Map<String, O> components = new HashMap<>(); - private final Map<String, File> componentFiles = new HashMap<>(); + protected final Map<String, O> components = new HashMap<>(); + protected final Map<String, File> componentFiles = new HashMap<>(); private String basePath = null; private SimpleDebugger debugger = null; private boolean useSubdirectoriesForComponents = DEFAULT_USE_SUBDIRECTORIES_FOR_COMPONENTS;
changed modifiers from attributes components and componentFiles from private to protected in AbstractComponentContainer, s.th. subclasses can access them
GerdHolz_TOVAL
train
java
4b1dd223954535b689f0d7e9e66d2a83d5d64d1a
diff --git a/example/rnn/lstm_bucketing.py b/example/rnn/lstm_bucketing.py index <HASH>..<HASH> 100644 --- a/example/rnn/lstm_bucketing.py +++ b/example/rnn/lstm_bucketing.py @@ -1,6 +1,7 @@ import numpy as np import mxnet as mx import argparse +import os parser = argparse.ArgumentParser(description="Train RNN on Penn Tree Bank", formatter_class=argparse.ArgumentDefaultsHelpFormatter) @@ -32,6 +33,8 @@ parser.add_argument('--disp-batches', type=int, default=50, def tokenize_text(fname, vocab=None, invalid_label=-1, start_label=0): + if not os.path.isfile(fname): + raise IOError("Please use get_ptb_data.sh to download requied file (data/ptb.train.txt)") lines = open(fname).readlines() lines = [filter(None, i.split(' ')) for i in lines] sentences, vocab = mx.rnn.encode_sentences(lines, vocab=vocab, invalid_label=invalid_label,
lstm_bucketing now shows more information if the file is not present.wq (#<I>)
apache_incubator-mxnet
train
py
fc5baf77618faa9af238fa00a95ce1a10e2e7192
diff --git a/js/calendar.js b/js/calendar.js index <HASH>..<HASH> 100644 --- a/js/calendar.js +++ b/js/calendar.js @@ -899,13 +899,22 @@ if(!String.prototype.formatNum) { }); }; + Calendar.prototype._templatePath = function(name) { + if (typeof this.options.tmpl_path == 'function') { + return this.options.tmpl_path(name) + } + else { + return this.options.tmpl_path + name + '.html'; + } + }; + Calendar.prototype._loadTemplate = function(name) { if(this.options.templates[name]) { return; } var self = this; $.ajax({ - url: this.options.tmpl_path + name + '.html', + url: self._templatePath(name), dataType: 'html', type: 'GET', async: false, @@ -915,7 +924,6 @@ if(!String.prototype.formatNum) { }); }; - Calendar.prototype._update = function() { var self = this;
Make it possible to set options.tmpl_path to a function returning a path based on the name of a template _or_ a string containing the root path to html templates. The change makes it possible to override the paths or generate them on the server-side if the deployment method requires that. An example is the sprockets asset pipeline used by Rails which adds a digest to an asset's filename based on the contents of each individual file.
Serhioromano_bootstrap-calendar
train
js
2a1d57e7d8625f4f1157ebbe667e16994aaa58ab
diff --git a/src/Services/RemoteWeb.php b/src/Services/RemoteWeb.php index <HASH>..<HASH> 100644 --- a/src/Services/RemoteWeb.php +++ b/src/Services/RemoteWeb.php @@ -418,8 +418,10 @@ class RemoteWeb extends BaseRestService $contentType = Curl::getInfo('content_type'); $result = $this->fixLinks($result); $response = ResponseFactory::create($result, $contentType, $status); - if ('chunked' === array_get($resultHeaders, 'Transfer-Encoding')) { - unset($resultHeaders['Transfer-Encoding']); + if ('chunked' === array_get(array_change_key_case($resultHeaders, CASE_LOWER), 'transfer-encoding')) { + // don't relay this header through to client as it isn't handled well in some cases + unset($resultHeaders['Transfer-Encoding']); // normal header case + unset($resultHeaders['transfer-encoding']); // Restlet has all lower for this header } $response->setHeaders($resultHeaders);
DF-<I> Restlet transfer encoding is lower case
dreamfactorysoftware_df-rws
train
php
ae1e7dc3dfb813bf2666e819bd85e1d2eaf3ab03
diff --git a/lib/__init__.py b/lib/__init__.py index <HASH>..<HASH> 100644 --- a/lib/__init__.py +++ b/lib/__init__.py @@ -20,7 +20,7 @@ import wcs_functions __taskname__ = "betadrizzle" # Begin Version Information ------------------------------------------- -__version__ = '4.0.1dev8260' +__version__ = '4.0.1dev8265' # End Version Information --------------------------------------------- # Revision based version info try:
Betadrizzle: Fixed a problem with the single drizzle WCS being corrupted by non-default parameter settings for the final WCS. Added the revision number to the version ID. WJH git-svn-id: <URL>
spacetelescope_drizzlepac
train
py
76b86aa09aadaf4b77a71975451f19aa39b4167f
diff --git a/aeron-cluster/src/test/java/io/aeron/cluster/ClusterNodeRestartTest.java b/aeron-cluster/src/test/java/io/aeron/cluster/ClusterNodeRestartTest.java index <HASH>..<HASH> 100644 --- a/aeron-cluster/src/test/java/io/aeron/cluster/ClusterNodeRestartTest.java +++ b/aeron-cluster/src/test/java/io/aeron/cluster/ClusterNodeRestartTest.java @@ -56,6 +56,7 @@ public class ClusterNodeRestartTest @After public void after() { + CloseHelper.close(container); CloseHelper.close(clusteredMediaDriver); clusteredMediaDriver.archive().context().deleteArchiveDirectory();
[Java]: make sure to close container on test exit.
real-logic_aeron
train
java
74da8491c0510a4078570dc1dfc7ebe156559eb7
diff --git a/spec/unit/platform/query_helpers_spec.rb b/spec/unit/platform/query_helpers_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/platform/query_helpers_spec.rb +++ b/spec/unit/platform/query_helpers_spec.rb @@ -17,7 +17,6 @@ # require "spec_helper" -require "chef-powershell" if ChefUtils.windows? describe "Chef::Platform#supports_dsc_invoke_resource?" do
Updated the chef client to retrieve certs from the Windows registry. Tests included. This is PR3 since I keep trashing them
chef_chef
train
rb
346d51c00be57467172573947b64db7697f82e68
diff --git a/ftr/extractor.py b/ftr/extractor.py index <HASH>..<HASH> 100644 --- a/ftr/extractor.py +++ b/ftr/extractor.py @@ -216,8 +216,13 @@ class ContentExtractor(object): if not items: continue + if isinstance(items, basestring): + # In case xpath returns only one element. + items = [items] + if len(items) == 1: item = items[0] + try: self.title = item.text @@ -242,7 +247,7 @@ class ContentExtractor(object): break else: - LOGGER.warning(u'%s items for title %s', + LOGGER.warning(u'Multiple items (%s) for title pattern %s.', items, pattern) def _extract_author(self): @@ -252,7 +257,14 @@ class ContentExtractor(object): return for pattern in self.config.author: - for item in self.parsed_tree.xpath(pattern): + + items = self.parsed_tree.xpath(pattern) + + if isinstance(items, basestring): + # In case xpath returns only one element. + items = [items] + + for item in items: try: stripped_author = item.text.strip() @@ -297,7 +309,14 @@ class ContentExtractor(object): found = False for pattern in self.config.date: - for item in self.parsed_tree.xpath(pattern): + + items = self.parsed_tree.xpath(pattern) + + if isinstance(items, basestring): + # In case xpath returns only one element. + items = [items] + + for item in items: try: stripped_date = item.text.strip()
Handle the case where XPath expression returns only a string and not a list, in all relevant locations.
1flow_python-ftr
train
py
4225799475599767566d809d22f60c1414b396ca
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -65,6 +65,7 @@ function install (Vue, options) { $validator._undefineValidatorToValidationScope(keypath, validator) $validator._deleteManagedValidator(keypath, validator) + $validator._undefineModelValidationScope(keypath) if (!$validator._isManagedValidator()) { for (var key in $validator.validation) { diff --git a/lib/validator.js b/lib/validator.js index <HASH>..<HASH> 100644 --- a/lib/validator.js +++ b/lib/validator.js @@ -239,8 +239,10 @@ module.exports = { _unwatchModel: function (keypath) { var unwatch = this._validatorWatchers[keypath] - unwatch() - delete this._validatorWatchers[keypath] + if(unwatch) { + unwatch() + delete this._validatorWatchers[keypath] + } }, _addManagedValidator: function (keypath, validator) {
fixed 'unwatch is not a function' problem when trying to validate object's subitem. for example v-model="obj.item" v-validate="required" was causing error when trying to unwatch the element.
kazupon_vue-validator
train
js,js
60fd281c572c58a6d1388b22c4601899497c8956
diff --git a/src/modules/proto/render-once/index.js b/src/modules/proto/render-once/index.js index <HASH>..<HASH> 100644 --- a/src/modules/proto/render-once/index.js +++ b/src/modules/proto/render-once/index.js @@ -83,8 +83,6 @@ module.exports = function (container) { var yDelta = mousewheel.getDelta(event); var xDelta = mousewheel.getDelta(event, true); grid.updateScroll(grid.rowPixelRange.clamp(grid.scrollTop - yDelta), grid.colPixelRange.clamp(grid.scrollLeft - xDelta)); - //console.log('delta: ', xDelta, yDelta); - //console.log('scroll: ', grid.scrollLeft, grid.scrollTop); calcOffsetAndDraw(); }; $container.on('mousewheel', onMouseWheel);
remove old logs for sanity
gridgrid_grid
train
js
7ff218a5fc7e303f0fd482ccf8de49d5287257d1
diff --git a/gns3server/modules/virtualbox/__init__.py b/gns3server/modules/virtualbox/__init__.py index <HASH>..<HASH> 100644 --- a/gns3server/modules/virtualbox/__init__.py +++ b/gns3server/modules/virtualbox/__init__.py @@ -277,6 +277,7 @@ class VirtualBox(IModule): try: if not self._vboxwrapper and not self._vboxmanager: + print("START SERVICE") self._start_vbox_service() vbox_instance = VirtualBoxVM(self._vboxwrapper,
Fixes issue when adding multiple VirtualBox VMs. Remove early release dialog.
GNS3_gns3-server
train
py
11f2232247276409643e7c4ebedcb8f482cd5061
diff --git a/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/im/authentication/PermissionUtils.java b/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/im/authentication/PermissionUtils.java index <HASH>..<HASH> 100644 --- a/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/im/authentication/PermissionUtils.java +++ b/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/im/authentication/PermissionUtils.java @@ -36,6 +36,9 @@ public final class PermissionUtils { for (final String role : roles) { authorities.add(new SimpleGrantedAuthority(role)); + // add spring security ROLE authority which is indicated by the + // `ROLE_` prefix + authorities.add(new SimpleGrantedAuthority("ROLE_" + role)); } return authorities;
add prefixed ROLE_ to granted authorities to work with out-of-the-box spring security
eclipse_hawkbit
train
java
319b19fcc69c7a2058a881dd99f7b8704f86455a
diff --git a/config.go b/config.go index <HASH>..<HASH> 100644 --- a/config.go +++ b/config.go @@ -2,12 +2,11 @@ package tempredis import "fmt" -// Config is a simple map of config keys to config values. These config values -// will be fed to redis-server on startup. +// Config is a key-value map of Redis config settings. type Config map[string]string -// Address returns the dial-able address for a Redis server configured with -// this Config struct. +// Host returns the host for a Redis server configured with this Config as +// "host:port". func (c Config) Host() string { bind, ok := c["bind"] if !ok { @@ -32,9 +31,9 @@ func (c Config) URL() string { } } -// Password returns the required password for a Redis server configured with -// this Config struct. If the server doesn't require authentication, an empty -// string will be returned. +// Password returns the password for a Redis server configured with this +// Config. If the server doesn't require authentication, an empty string will +// be returned. func (c Config) Password() string { return c["requirepass"] }
Tidy up Config comments.
stvp_tempredis
train
go
b2b2b23457e219d1c9216a9cc764413b7755e94f
diff --git a/tabulator/table.py b/tabulator/table.py index <HASH>..<HASH> 100644 --- a/tabulator/table.py +++ b/tabulator/table.py @@ -111,7 +111,9 @@ class Table(object): raise RuntimeError(message) index = None headers = None - for keys, values in self.__items: + values = None + while True: + keys, values = next(self.__items) if keys is not None: headers = keys if index is None:
rebased on next() in iterate
frictionlessdata_tabulator-py
train
py
b3710e07e97b0b8012cf5775760c18d880cde14d
diff --git a/test/unit/features/directives/model-select.spec.js b/test/unit/features/directives/model-select.spec.js index <HASH>..<HASH> 100644 --- a/test/unit/features/directives/model-select.spec.js +++ b/test/unit/features/directives/model-select.spec.js @@ -205,7 +205,7 @@ describe('Directive v-model select', () => { }) it('should warn multiple with non-Array value', () => { - const vm = new Vue({ + new Vue({ data: { test: 'meh' },
fix eslint in tests
IOriens_wxml-transpiler
train
js
1707508e2911c27123bc4cc8b70569f016cc022d
diff --git a/test/functional/ColumnNumberAwareTraitTest.php b/test/functional/ColumnNumberAwareTraitTest.php index <HASH>..<HASH> 100644 --- a/test/functional/ColumnNumberAwareTraitTest.php +++ b/test/functional/ColumnNumberAwareTraitTest.php @@ -85,7 +85,7 @@ class ColumnNumberAwareTraitTest extends TestCase */ public function testSetGetColumnNumberInt() { - $data = rand(0, 99); + $data = rand(1, 99); $subject = $this->createInstance(); $_subject = $this->reflect($subject); diff --git a/test/functional/LineNumberAwareTraitTest.php b/test/functional/LineNumberAwareTraitTest.php index <HASH>..<HASH> 100644 --- a/test/functional/LineNumberAwareTraitTest.php +++ b/test/functional/LineNumberAwareTraitTest.php @@ -85,7 +85,7 @@ class LineNumberAwareTraitTest extends TestCase */ public function testSetGetLineNumberInt() { - $data = rand(0, 99); + $data = rand(1, 99); $subject = $this->createInstance(); $_subject = $this->reflect($subject);
Corrected test Used to sometimes produce 0, where should have produced positive.
Dhii_tokenizer-abstract
train
php,php
f8aa165ebd13d831552356aea9f97d07970c294e
diff --git a/s3transfer/__init__.py b/s3transfer/__init__.py index <HASH>..<HASH> 100644 --- a/s3transfer/__init__.py +++ b/s3transfer/__init__.py @@ -143,7 +143,7 @@ from s3transfer.exceptions import RetriesExceededError, S3UploadFailedError __author__ = 'Amazon Web Services' -__version__ = '0.1.8' +__version__ = '0.1.9' class NullHandler(logging.Handler):
Bumping version to <I>
boto_s3transfer
train
py
3057b04cf61e9b7e3ebc31ebb29ccbcd3b774fba
diff --git a/scigraph.py b/scigraph.py index <HASH>..<HASH> 100755 --- a/scigraph.py +++ b/scigraph.py @@ -56,7 +56,9 @@ class State: '{t}{t}{t}req.headers[\'Accept\'] = output\n' '{t}{t}prep = req.prepare()\n' '{t}{t}resp = s.send(prep)\n' - '{t}{t}if resp.headers[\'content-type\'] == \'application/json\':\n' + '{t}{t}if not resp.ok:\n' + '{t}{t}{t}return None\n' + '{t}{t}elif resp.headers[\'content-type\'] == \'application/json\':\n' '{t}{t}{t}return resp.json()\n' '{t}{t}elif resp.headers[\'content-type\'].startswith(\'text/plain\'):\n' '{t}{t}{t}return resp.text\n'
added a check to see if the response from scigraph is ok, if not return None
tgbugs_pyontutils
train
py
d620e68453a3354cc04f9d9efe794c354fdcfc1f
diff --git a/test/moment/days_in_month.js b/test/moment/days_in_month.js index <HASH>..<HASH> 100644 --- a/test/moment/days_in_month.js +++ b/test/moment/days_in_month.js @@ -19,8 +19,8 @@ exports.days_in_month = { "days in month leap years" : function(test) { test.expect(4); - test.equal(moment([2010, 1]).daysInMonth(), 28, "Feb 2010 should have 29 days"); - test.equal(moment([2100, 1]).daysInMonth(), 28, "Feb 2100 should have 29 days"); + test.equal(moment([2010, 1]).daysInMonth(), 28, "Feb 2010 should have 28 days"); + test.equal(moment([2100, 1]).daysInMonth(), 28, "Feb 2100 should have 28 days"); test.equal(moment([2008, 1]).daysInMonth(), 29, "Feb 2008 should have 29 days"); test.equal(moment([2000, 1]).daysInMonth(), 29, "Feb 2000 should have 29 days"); test.done();
Test messages were not accurate to the tests #<I>
moment_moment
train
js
cc7f8c38ec917242230eefc2008bdec1b070a765
diff --git a/tests/Dependency/DelegateContainerTest.php b/tests/Dependency/DelegateContainerTest.php index <HASH>..<HASH> 100644 --- a/tests/Dependency/DelegateContainerTest.php +++ b/tests/Dependency/DelegateContainerTest.php @@ -44,6 +44,30 @@ class DelegateContainerTest extends \PHPUnit_Framework_TestCase $delegate->get('foo'); } + public function testAggregatedRetrieval() + { + $c = $this->prophesize(Container::class); + $c->has('list')->willReturn(true); + $c->get('list')->willReturn([ + 'foo' => 'bar', + ]); + $c->attach(new AnyValueToken())->willReturn(null); + + $c1 = $this->prophesize(Container::class); + $c1->has('list')->willReturn(true); + $c1->get('list')->willReturn([ + 'bar' => 'baz', + ]); + $c1->attach(new AnyValueToken())->willReturn(null); + + $container = new DelegateContainer([$c->reveal(), $c1->reveal()]); + + $this->assertSame([ + 'foo' => 'bar', + 'bar' => 'baz', + ], $container->get('list')); + } + public function testRetrievalExceptionWithoutContainers() { $delegate = new DelegateContainer([]);
Add test case for aggregation
phOnion_framework
train
php
58ea736ed62216b2906732c69178cb4414083c98
diff --git a/superset/connectors/sqla/models.py b/superset/connectors/sqla/models.py index <HASH>..<HASH> 100644 --- a/superset/connectors/sqla/models.py +++ b/superset/connectors/sqla/models.py @@ -517,9 +517,6 @@ class SqlaTable(Model, BaseDatasource): for col, ascending in orderby: direction = asc if ascending else desc - print('-='*20) - print([col, ascending]) - print('-='*20) qry = qry.order_by(direction(col)) if row_limit:
[cleanup] removing print() artefacts (#<I>)
apache_incubator-superset
train
py
7a5b1fc555b9ff3da907cdcd49fae1e7d0fd1e91
diff --git a/lib/datalib.php b/lib/datalib.php index <HASH>..<HASH> 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -2678,7 +2678,7 @@ function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user global $db, $CFG, $USER; - if ($cm === '') { // postgres won't translate empty string to its default + if ($cm === '' || is_null($cm)) { // postgres won't translate empty string to its default $cm = 0; }
Fixed when $cm is NULL, postgres still reports error.
moodle_moodle
train
php
7b5acf1bed187d22255ef03bb4bdac33e1b885e3
diff --git a/src/Chullo.php b/src/Chullo.php index <HASH>..<HASH> 100644 --- a/src/Chullo.php +++ b/src/Chullo.php @@ -75,10 +75,9 @@ class Chullo implements IFedoraClient $transaction ); if ($response->getStatusCode() != 200) { - return $response; + return null; } -// return $response->getBody(); return $response; }
Restore null response for now Not sure if `null` is good for the client or even <I> is the only response code we care <I> Not Modified is an option also which will also never return a body.
Islandora-CLAW_chullo
train
php
ec137b856df3f37a320ba45277bed3cb0839735e
diff --git a/src/samples/java/SPP_Sample.java b/src/samples/java/SPP_Sample.java index <HASH>..<HASH> 100755 --- a/src/samples/java/SPP_Sample.java +++ b/src/samples/java/SPP_Sample.java @@ -436,6 +436,10 @@ public class SPP_Sample implements Serializable { } } +interface FPInterfaceWithSerialVer extends Serializable { + final long serialVersionUID = 1L; +} + class StringProducer { public String getString() { return "foo";
add sample of fp with interfaces having serialVer as per #<I>
mebigfatguy_fb-contrib
train
java
1823527fbcb7fb64521e8a47cb12ee78785acd36
diff --git a/bin/wstunnel.js b/bin/wstunnel.js index <HASH>..<HASH> 100755 --- a/bin/wstunnel.js +++ b/bin/wstunnel.js @@ -27,7 +27,8 @@ module.exports = (Server, Client) => { .usage(Help) .string("s") .string("t") - .string("proxy") + .string("p") + .alias('p', "proxy") .alias('t', "tunnel") .boolean('c') .boolean('http')
Enable the "-p" option as an alias for the "--proxy" option
mhzed_wstunnel
train
js
f54f64bdfd459acd963ce50b20e9abed35dd58f4
diff --git a/core/codegen/platform/src/main/java/org/overture/codegen/traces/TraceStmBuilder.java b/core/codegen/platform/src/main/java/org/overture/codegen/traces/TraceStmBuilder.java index <HASH>..<HASH> 100644 --- a/core/codegen/platform/src/main/java/org/overture/codegen/traces/TraceStmBuilder.java +++ b/core/codegen/platform/src/main/java/org/overture/codegen/traces/TraceStmBuilder.java @@ -4,6 +4,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Set; +import org.overture.ast.definitions.SFunctionDefinition; import org.overture.ast.definitions.SOperationDefinition; import org.overture.ast.lex.Dialect; import org.overture.ast.statements.ACallStm; @@ -476,6 +477,16 @@ public class TraceStmBuilder extends AnswerAdaptor<TraceNodeData> isOp = true; } + else if(callStm.getRootdef() instanceof SFunctionDefinition) + { + SFunctionDefinition func = (SFunctionDefinition) callStm.getRootdef(); + + if(func.getPredef() == null) + { + // The pre condition is true + return null; + } + } } else { Logger.getLog().printErrorln("Expected VDM source node to be a call statement at this point in '"
Fix for construction of the 'meetsPreCond' check Calls to functions were not taken into account
overturetool_overture
train
java
e5c40d02d9c5d287337e9ca316c76725deaf1a63
diff --git a/src/Compiler.php b/src/Compiler.php index <HASH>..<HASH> 100644 --- a/src/Compiler.php +++ b/src/Compiler.php @@ -2702,6 +2702,18 @@ class Compiler } /** + * Returns list of variables + * + * @api + * + * @return array + */ + public function getVariables() + { + return $this->registeredVars; + } + + /** * Adds to list of parsed files * * @api diff --git a/src/Server.php b/src/Server.php index <HASH>..<HASH> 100644 --- a/src/Server.php +++ b/src/Server.php @@ -143,6 +143,11 @@ class Server return true; } } + + $metaVars = crc32(serialize($this->scss->getVariables())); + if ($metaVars!=$metadata['vars']) { + return true; + } $etag = $metadata['etag']; @@ -213,6 +218,7 @@ class Server serialize(array( 'etag' => $etag, 'imports' => $this->scss->getParsedFiles(), + 'vars' => crc32(serialize($this->scss->getVariables())), )) );
quick check to needsCompile for changed registeredVars with a crc<I> hash
leafo_scssphp
train
php,php
be38fbc8052b63db5e504a60b77bd11c8b3e170a
diff --git a/lib/how_is/report.rb b/lib/how_is/report.rb index <HASH>..<HASH> 100644 --- a/lib/how_is/report.rb +++ b/lib/how_is/report.rb @@ -26,7 +26,7 @@ module HowIs "There are #{number_of_type} #{type_label}s open. " + "The average #{type_label} age is #{a.send("average_#{type}_age")}, and the " + - "oldest was opened on #{a.send("oldest_#{type}_date").strftime(oldest_date_format)}" + "oldest was opened on #{a.send("oldest_#{type}_date").strftime(oldest_date_format)}." end end
~~~punctuation~~~
duckinator_inq
train
rb
abecaf776e474ea9122ce405596a4b8466d2b11f
diff --git a/bids/layout/index.py b/bids/layout/index.py index <HASH>..<HASH> 100644 --- a/bids/layout/index.py +++ b/bids/layout/index.py @@ -38,7 +38,12 @@ def _check_path_matches_patterns(path, patterns, root=None): # Path now can be downcast to str path = str(path) for patt in patterns: - if isinstance(patt, (str, Path)): + if isinstance(patt, Path): + patt = str( + patt if root is None + else patt.relative_to(root) + ) + if isinstance(patt, str): if str(patt) in path: return True elif patt.search(path):
fix: relativeness also affects Path patterns
bids-standard_pybids
train
py
88635b79f5032c0d5e516f787e2e5b35e2819c9b
diff --git a/components/Kladr/Kladr.js b/components/Kladr/Kladr.js index <HASH>..<HASH> 100644 --- a/components/Kladr/Kladr.js +++ b/components/Kladr/Kladr.js @@ -70,7 +70,7 @@ export default class Kladr extends React.Component<Props, State> { {this._renderAddress(value.address)} </div>} {validation} - <Link icon="edit" onClick={this._handleOpen}> + <Link icon="Edit" onClick={this._handleOpen}> {change} </Link> {this.state.opened && this._renderModal()}
Change deprecated icon name (#<I>)
skbkontur_retail-ui
train
js
62f4bffb0dd9c872e44db5517d2353932cd77f4a
diff --git a/tensorflow_hub/native_module_test.py b/tensorflow_hub/native_module_test.py index <HASH>..<HASH> 100644 --- a/tensorflow_hub/native_module_test.py +++ b/tensorflow_hub/native_module_test.py @@ -321,7 +321,19 @@ class TFHubStatelessModuleTest(tf.test.TestCase): m = hub.Module(module_spec) m(v) - self.assertEqual(g1.as_graph_def(), g2.as_graph_def()) + # The MLIR Bridge may arbitrarily apply internal-only attributes to graphs + # that are not intended to be consumed by external users. In this particular + # instance, the bridge will add an internal-only attribute as the result of + # using manual control dependencies above. Filter out the internal-only + # attributes to allow equality checking on the meaningfully public structure + # of the graph. + g2_graph_def = g2.as_graph_def() + for node in g2_graph_def.node: + for attr in list(node.attr.keys()): + if attr.startswith("_"): + del node.attr[attr] + + self.assertEqual(g1.as_graph_def(), g2_graph_def) with tf.Graph().as_default() as g3: v = tf.compat.v1.placeholder(dtype=tf.int64, name="v")
Emit a New Metric Tracking Manual Control Deps Graph Analysis now checks for the new `_has_manual_control_dependencies` attr being present in any node within a graph in order to mark this graph as using manual control deps. This will give us visibility into how prevalent manual control dep usage is within TF2 where they are unsupported and silently dropped. PiperOrigin-RevId: <I>
tensorflow_hub
train
py
b3e15a38d8cc81138c738536a1caa760efcc82be
diff --git a/pythran/interface.py b/pythran/interface.py index <HASH>..<HASH> 100644 --- a/pythran/interface.py +++ b/pythran/interface.py @@ -120,10 +120,11 @@ class ToolChain(object): return module_so def check_compile(self, msg, code): try: + tmperr=TemporaryFile() tmpfile=NamedTemporaryFile(suffix=".cpp") tmpfile.write(code) tmpfile.flush() - check_call([self.compiler] + self.cppflags + self.cxxflags + [ tmpfile.name, "-o" , "/dev/null"] + self.get_include_flags() + self.ldflags) + check_call([self.compiler] + self.cppflags + self.cxxflags + [ tmpfile.name, "-o" , "/dev/null"] + self.get_include_flags() + self.ldflags, stderr=tmperr) except: raise EnvironmentError(errno.ENOPKG, msg)
[tcmalloc] fix hooks for tcmalloc
serge-sans-paille_pythran
train
py
ece9486182db705923e3f04618c5f6a37e71076d
diff --git a/pkg/helm/environment/environment.go b/pkg/helm/environment/environment.go index <HASH>..<HASH> 100644 --- a/pkg/helm/environment/environment.go +++ b/pkg/helm/environment/environment.go @@ -28,11 +28,12 @@ import ( "github.com/spf13/pflag" + "k8s.io/client-go/util/homedir" "k8s.io/helm/pkg/helm/helmpath" ) // DefaultHelmHome is the default HELM_HOME. -var DefaultHelmHome = filepath.Join("$HOME", ".helm") +var DefaultHelmHome = filepath.Join(homedir.HomeDir(), ".helm") // EnvSettings describes all of the environment settings. type EnvSettings struct {
fix(helm): home env not set on Windows When setting $HELM_HOME, only $HOME was considered. This variable is not always present on Windows.
helm_helm
train
go
75b4df9437ca277709e9b61fbb9aa5c20d96820e
diff --git a/wallace/app.py b/wallace/app.py index <HASH>..<HASH> 100644 --- a/wallace/app.py +++ b/wallace/app.py @@ -22,5 +22,5 @@ def start(): if __name__ == "__main__": + app.debug = True app.run() - print session
Put Flask in debug mode
berkeley-cocosci_Wallace
train
py
d45242f976ff2c22b6be6ec7479839786a970912
diff --git a/app/models/pay/subscription.rb b/app/models/pay/subscription.rb index <HASH>..<HASH> 100644 --- a/app/models/pay/subscription.rb +++ b/app/models/pay/subscription.rb @@ -62,7 +62,7 @@ module Pay end def metered_items? - metered + !!metered end def self.find_by_processor_and_id(processor, processor_id)
Make sure metered_items? returns a boolean
jasoncharnes_pay
train
rb
038e5c5b859820e4f698dcd237c6904f57bb5107
diff --git a/src/java/com/threerings/presents/server/Authenticator.java b/src/java/com/threerings/presents/server/Authenticator.java index <HASH>..<HASH> 100644 --- a/src/java/com/threerings/presents/server/Authenticator.java +++ b/src/java/com/threerings/presents/server/Authenticator.java @@ -64,7 +64,7 @@ public abstract class Authenticator final AuthResponseData rdata = createResponseData(); final AuthResponse rsp = new AuthResponse(rdata); - getInvoker().postUnit(new Invoker.Unit("auth:" + req.getCredentials()) { + getInvoker().postUnit(new Invoker.Unit("authenticateConnection") { public boolean invoke() { try { processAuthentication(conn, rsp);
Differentiating these invokers turns out not to be especially useful. Let's avoid log spam and call them all the same thing. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1
threerings_narya
train
java
4fb08014810b1727c6adbe817191022aec8edf38
diff --git a/lib/api.js b/lib/api.js index <HASH>..<HASH> 100644 --- a/lib/api.js +++ b/lib/api.js @@ -3,14 +3,14 @@ */ // Internal packages: -const package = require('../package.json') +const self = require('../package.json') , sink = require('./sink') , util = require('./util') , validator = require('./validator') ; const Sink = sink.Sink -, version = package.version +, version = self.version ; /**
"package" is a reserved word in ES6
w3c_specberus
train
js
ef79966fb723308473cb00c02b333165bd5048ad
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -230,12 +230,14 @@ module.exports = { let config = type === 'head' ? this._config : this._configForTest; let policyString = type === 'head' ? this._policyString : this._policyStringForTest; - this.ui.writeWarnLine( - 'Content Security Policy does not support report only mode if delivered via meta element. ' + - "Either set `ENV['ember-cli-content-security-policy'].reportOnly` to `false` or remove `'meta'` " + - "from `ENV['ember-cli-content-security-policy'].delivery`.", - config.reportOnly - ); + if (this._config.reportOnly && this._config.delivery.indexOf('meta') !== -1) { + this.ui.writeWarnLine( + 'Content Security Policy does not support report only mode if delivered via meta element. ' + + "Either set `reportOnly` to `false` or remove `'meta' from `delivery` in " + + '`config/content-security-policy.js`.', + config.reportOnly + ); + } unsupportedDirectives(config.policy).forEach(function(name) { let msg = 'CSP delivered via meta does not support `' + name + '`, ' +
Prevent unnecessary meta + reportOnly warning (#<I>) * Prevent unnecessary meta + reportOnly warning This warning was being output when `test-head` was rendered, even if both of the settings mentioned in the message were set to avoid it. * update warning message to follow new configuration
rwjblue_ember-cli-content-security-policy
train
js
5eb86ece058428cd5f931ec9663a915db8541980
diff --git a/lib/test.js b/lib/test.js index <HASH>..<HASH> 100644 --- a/lib/test.js +++ b/lib/test.js @@ -499,13 +499,20 @@ Test.prototype.spawn = function spawnTest (cmd, args, options, name, extra) { bailOnFail(this, child.stdout, parser) child.stdout.emit('data', '# Subtest: ' + name + '\n') + // The only thing that's actually *required* to be a valid TAP output + // is a plan and/or at least one ok/not-ok line. If we don't get any + // of those, then emit a bogus 1..0 so we read it as a skip. var sawTests = false parser.once('assert', function () { sawTests = true }) + parser.once('plan', function () { + sawTests = true + }) + child.stdout.on('end', function () { - // if there's been literally no output, then emit the minimum viable tap + parser.write('\n') if (!sawTests) child.stdout.emit('data', '1..0\n') parser.end()
Also read plan as valid tap output Otherwise test-less <I> things get another <I> output.
tapjs_node-tap
train
js
fc16ab713bcb29fb62c321fed0f949cd764788d2
diff --git a/lib/droplet_kit/mappings/database_user_mapping.rb b/lib/droplet_kit/mappings/database_user_mapping.rb index <HASH>..<HASH> 100644 --- a/lib/droplet_kit/mappings/database_user_mapping.rb +++ b/lib/droplet_kit/mappings/database_user_mapping.rb @@ -6,7 +6,7 @@ module DropletKit mapping DatabaseUser root_key singular: 'user', plural: 'users', scopes: [:read] - property :name, scopes: [:read] + property :name, scopes: [:read, :create] property :role, scopes: [:read, :create] property :password, scopes: [:read, :create] end
[DatabaseUser] Add name to create scope (#<I>)
digitalocean_droplet_kit
train
rb
93048d7ccd7b5b9d5d6630818f6c451da7e70132
diff --git a/scenarios/kubernetes_aws.py b/scenarios/kubernetes_aws.py index <HASH>..<HASH> 100755 --- a/scenarios/kubernetes_aws.py +++ b/scenarios/kubernetes_aws.py @@ -193,7 +193,7 @@ if __name__ == '__main__': # Assume we're upping, testing, and downing a cluster by default PARSER.add_argument( - '--cluster', default='e2e-kops-aws.test-aws.k8s.io', help='Name of the aws cluster') + '--cluster', default='e2e-kops-aws-canary.test-aws.k8s.io', help='Name of the aws cluster') PARSER.add_argument( '--down', default='true', help='If we need to set --down in e2e.go') PARSER.add_argument(
kops scenario: Fix the DNS name, interfering with main job
kubernetes_test-infra
train
py
8270393b616be348eb0bb59e9ce4267b2ed8bc4b
diff --git a/atlassian/rest_client.py b/atlassian/rest_client.py index <HASH>..<HASH> 100644 --- a/atlassian/rest_client.py +++ b/atlassian/rest_client.py @@ -76,7 +76,7 @@ class AtlassianRestAPI(object): return '/'.join([self.api_root, self.api_version, resource]) @staticmethod - def url_joiner(url, path, trailing): + def url_joiner(url, path, trailing=None): url_link = '/'.join(s.strip('/') for s in [url, path]) if trailing: url_link += '/'
Fix error with the confluence page history cleaning
atlassian-api_atlassian-python-api
train
py
7e4e010a5281cb5ccc3201deb96d6401f81c2286
diff --git a/Model/Behavior/FileGrabberBehavior.php b/Model/Behavior/FileGrabberBehavior.php index <HASH>..<HASH> 100644 --- a/Model/Behavior/FileGrabberBehavior.php +++ b/Model/Behavior/FileGrabberBehavior.php @@ -20,7 +20,7 @@ class FileGrabberBehavior extends UploadBehavior { $model->data[$model->alias][$field] = array( 'name' => $file_name, - 'type' => $headers['Content-Type'] + 'type' => $headers['Content-Type'], 'tmp_name' => $tmp_file, 'error' => 1, 'size' => $headers['Content-Length'],
Added missing comma, closes #<I>
FriendsOfCake_cakephp-upload
train
php
e4ce80a48be6c8c88465dc78efa71695a7c551ad
diff --git a/docstring_parser/google.py b/docstring_parser/google.py index <HASH>..<HASH> 100644 --- a/docstring_parser/google.py +++ b/docstring_parser/google.py @@ -246,7 +246,7 @@ class GoogleParser: # Add elements from each chunk for title, chunk in chunks.items(): # Determine indent - indent_match = re.search(r"^\s+", chunk) + indent_match = re.search(r"^\s*", chunk) if not indent_match: raise ParseError('Can\'t infer indent from "{}"'.format(chunk)) indent = indent_match.group() diff --git a/docstring_parser/tests/test_google.py b/docstring_parser/tests/test_google.py index <HASH>..<HASH> 100644 --- a/docstring_parser/tests/test_google.py +++ b/docstring_parser/tests/test_google.py @@ -647,3 +647,19 @@ def test_broken_arguments() -> None: param - poorly formatted """ ) + + +def test_empty_example() -> None: + docstring = parse( + """Short description + + Example: + + Raises: + IOError: some error + """ + ) + + assert len(docstring.meta) == 2 + assert docstring.meta[0].args == ['examples'] + assert docstring.meta[0].description == ""
google: don't crash on empty sections
rr-_docstring_parser
train
py,py
f541d82e20480169c79e4791d824a419c915ad60
diff --git a/tests/URLEncodeTest.php b/tests/URLEncodeTest.php index <HASH>..<HASH> 100644 --- a/tests/URLEncodeTest.php +++ b/tests/URLEncodeTest.php @@ -26,6 +26,17 @@ class URLEncodeTest extends PHPUnit_Framework_TestCase $this->assertEquals('Robin', $results['hits'][0]['firstname']); $obj = $this->index->getObject("a/go/?a"); $this->assertEquals('Robin', $obj['firstname']); + $res = $this->index->saveObject(array("firstname" => "Roger", "objectID" => "a/go/?a")); + $this->index->waitTask($res['taskID']); + $results = $this->index->search(''); + $this->assertEquals(1, $results['nbHits']); + $this->assertEquals('Roger', $results['hits'][0]['firstname']); + $res = $this->index->partialUpdateObject(array("firstname" => "Rodrigo", "objectID" => "a/go/?a")); + $this->index->waitTask($res['taskID']); + $results = $this->index->search(''); + $this->assertEquals(1, $results['nbHits']); + $this->assertEquals('Rodrigo', $results['hits'][0]['firstname']); + } private $client; private $index;
Added tests for saveObject and partialUpdateObject
algolia_algoliasearch-client-php
train
php
8de2056725b47f9a62d444710730db7ae8280cea
diff --git a/src/Response/AlexaResponse.php b/src/Response/AlexaResponse.php index <HASH>..<HASH> 100644 --- a/src/Response/AlexaResponse.php +++ b/src/Response/AlexaResponse.php @@ -97,7 +97,10 @@ class AlexaResponse implements Jsonable if( ! is_null($this->speech) && $this->speech instanceof Speech ) $response['outputSpeech'] = $this->speech->toArray(); - $response['sessionAttributes'] = $this->getSessionData(); + $sessionAttributes = $this->getSessionData(); + + if($sessionAttributes && count($sessionAttributes) > 0) + $responseData['sessionAttributes'] = $sessionAttributes; $responseData['response'] = $response;
Update AlexaResponse.php
develpr_alexa-app
train
php
8904df48065779a0bc481180ad74063c19216871
diff --git a/src/Extensions/StepCallback.php b/src/Extensions/StepCallback.php index <HASH>..<HASH> 100644 --- a/src/Extensions/StepCallback.php +++ b/src/Extensions/StepCallback.php @@ -62,7 +62,7 @@ class StepCallback */ protected $stepCallback; - protected $variables = []; + protected $variables; /** * Add a valiable to callback variables, passed to callback as parameter @@ -129,7 +129,7 @@ class StepCallback $extra = [] ) { if (!isset($this->stepCallback[$step])) { - return null; + return false; } foreach ($this->stepCallback[$step] as $callback) { @@ -152,5 +152,6 @@ class StepCallback public function __contstruct() { $this->stepCallback = []; + $this->variables = []; } } diff --git a/tests/src/Extensions/StepCallbackTest.php b/tests/src/Extensions/StepCallbackTest.php index <HASH>..<HASH> 100644 --- a/tests/src/Extensions/StepCallbackTest.php +++ b/tests/src/Extensions/StepCallbackTest.php @@ -56,7 +56,7 @@ class StepCallbackTest extends \PHPUnit_Framework_TestCase } /** - * @covers Phramework\Extensions\StepCallback::add + * @covers Phramework\Extensions\StepCallback::call */ public function testCall() {
Return false when StepCallback::call has not defined passed step
phramework_phramework
train
php,php
52ec290d394809c83e0bed2a4821d10dafcac4fd
diff --git a/GearmanManager.php b/GearmanManager.php index <HASH>..<HASH> 100644 --- a/GearmanManager.php +++ b/GearmanManager.php @@ -633,7 +633,7 @@ class GearmanManager { if(empty($this->functions)){ $this->log("No workers found"); posix_kill($this->parent_pid, SIGUSR1); - exit(1); + exit(); } $this->validate_lib_workers(); diff --git a/pecl-manager.php b/pecl-manager.php index <HASH>..<HASH> 100755 --- a/pecl-manager.php +++ b/pecl-manager.php @@ -189,7 +189,7 @@ class GearmanPeclManager extends GearmanManager { (!class_exists($func) || !method_exists($func, "run"))){ $this->log("Function $func not found in ".$props["path"]); posix_kill($this->parent_pid, SIGUSR2); - exit(1); + exit(); } } } @@ -199,3 +199,4 @@ class GearmanPeclManager extends GearmanManager { $mgr = new GearmanPeclManager(); ?> +
On second thought, don't exit(1) from children processes.
brianlmoon_GearmanManager
train
php,php
531deb16d465896e9518eebff53969ced7a5e077
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -22,7 +22,7 @@ module.exports = function (grunt) { // firefox { browserName: "firefox", - platform: "Windows XP", + platform: "Windows 8.1", version: "3.6" }, { browserName: "firefox",
change emulation environment for firefox <I> test to windows <I>
fhopeman_justlazy
train
js
9d4cbbf6ebc95549e72b710b30a83bbed3aa1192
diff --git a/brozzler/worker.py b/brozzler/worker.py index <HASH>..<HASH> 100644 --- a/brozzler/worker.py +++ b/brozzler/worker.py @@ -35,6 +35,7 @@ import doublethink import tempfile import urlcanon from requests.structures import CaseInsensitiveDict +import rethinkdb as r class ExtraHeaderAdder(urllib.request.BaseHandler): def __init__(self, extra_headers): @@ -546,6 +547,10 @@ class BrozzlerWorker: pass time.sleep(0.5) self.logger.info("shutdown requested") + except r.ReqlError as e: + self.logger.error( + "caught rethinkdb exception, will try to proceed", + exc_info=True) except brozzler.ShutdownRequested: self.logger.info("shutdown requested") except: diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ def find_package_data(package): setuptools.setup( name='brozzler', - version='1.1b11.dev242', + version='1.1b11.dev243', description='Distributed web crawling with browsers', url='https://github.com/internetarchive/brozzler', author='Noah Levitt',
handle another rethinkdb outage corner case
internetarchive_brozzler
train
py,py
d263b169660e973f37f1ddafd04031cc25b7c635
diff --git a/nodeconductor/logging/middleware.py b/nodeconductor/logging/middleware.py index <HASH>..<HASH> 100644 --- a/nodeconductor/logging/middleware.py +++ b/nodeconductor/logging/middleware.py @@ -32,13 +32,13 @@ class CaptureEventContextMiddleware(object): def process_request(self, request): user = getattr(request, 'user', None) if user.is_anonymous(): - reset_log_context() + reset_context() return context = user._get_log_context('user') context['ip_address'] = get_ip_address(request) - set_log_context(context) + set_context(context) def process_response(self, request, response): - reset_current_context() + reset_context() return response
Fix names (NC-<I>)
opennode_waldur-core
train
py
dd5e1f5650c1c92c82a842e51af006439d713122
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ setup( url = "https://github.com/neherlab/treetime", packages=['treetime'], install_requires = [ - 'biopython>=1.66', + 'biopython>=1.66,<=1.76', 'numpy>=1.10.4', 'pandas>=0.17.1', 'scipy>=0.16.1' diff --git a/treetime/__init__.py b/treetime/__init__.py index <HASH>..<HASH> 100644 --- a/treetime/__init__.py +++ b/treetime/__init__.py @@ -1,5 +1,5 @@ from __future__ import print_function, division, absolute_import -version="0.7.6" +version="0.8.0" class TreeTimeError(Exception): """TreeTimeError class"""
limit biopython version to <=<I>
neherlab_treetime
train
py,py
f0db81d1c102859fdbc69e63d234550618a77753
diff --git a/lib/ext.js b/lib/ext.js index <HASH>..<HASH> 100644 --- a/lib/ext.js +++ b/lib/ext.js @@ -251,10 +251,10 @@ internals.onPostHandler = function (request, reply) { } if (internals.config.meta.successStatusCode) { - return reply(response).code(internals.config.meta.successStatusCode); + return reply.continue(response).code(internals.config.meta.successStatusCode); } - return reply(response); + return reply.continue(response); } return reply.continue();
fix: reply.continue instead of reply
fknop_hapi-pagination
train
js
a24e37626c9cbc521f742b4d9b630b3cd5364792
diff --git a/paramiko/auth_handler.py b/paramiko/auth_handler.py index <HASH>..<HASH> 100644 --- a/paramiko/auth_handler.py +++ b/paramiko/auth_handler.py @@ -597,7 +597,7 @@ class AuthHandler (object): for i in range(n): responses.append(m.get_text()) result = self.transport.server_object.check_auth_interactive_response(responses) - if isinstance(type(result), InteractiveQuery): + if isinstance(result, InteractiveQuery): # make interactive query instead of response self._interactive_query(result) return
Fix bug in handling multiple interactive queries If repeated interaction is needed, check_auth_interactive_response returns an InteractiveQuery object. Unfortunately a bug caused it not to be recognized, causing autheintication to fail. This fixes said bug by properly looking at the type of the returned object.
paramiko_paramiko
train
py
4c84067205611557f45dc35d708e5c832866c6ed
diff --git a/spyder/widgets/editor.py b/spyder/widgets/editor.py index <HASH>..<HASH> 100644 --- a/spyder/widgets/editor.py +++ b/spyder/widgets/editor.py @@ -746,6 +746,12 @@ class EditorStack(QWidget): def closeEvent(self, event): self.threadmanager.close_all_threads() self.analysis_timer.timeout.disconnect(self.analyze_script) + + # Remove editor references from the outline explorer settings + if self.outlineexplorer is not None: + for finfo in self.data: + self.outlineexplorer.remove_editor(finfo.editor) + QWidget.closeEvent(self, event) if is_pyqt46: self.destroyed.emit() @@ -2012,10 +2018,6 @@ class EditorStack(QWidget): editor.zoom_out.connect(lambda: self.zoom_out.emit()) editor.zoom_reset.connect(lambda: self.zoom_reset.emit()) editor.sig_eol_chars_changed.connect(lambda eol_chars: self.refresh_eol_chars(eol_chars)) - if self.outlineexplorer is not None: - # Removing editor reference from outline explorer settings: - editor.destroyed.connect(lambda obj=editor: - self.outlineexplorer.remove_editor(obj)) self.find_widget.set_editor(editor)
Changed where editors are removed from the outline editor This was not working because when the signal `destroyed` is fired, it is already too late, the editor is not an editor anymore, it's a simple widget. Therefore, it is not removed from the the outline explorer settings. This needs to be done before the editors are destroyed so we pass the right id to the outline explorer. We do it instead within the `closeEvent` method of the EditorStack.
spyder-ide_spyder
train
py
8a725e9c032fc26a4f73bfae065e251d644df4ac
diff --git a/item.go b/item.go index <HASH>..<HASH> 100644 --- a/item.go +++ b/item.go @@ -72,6 +72,10 @@ func (item *Item) Read(p []byte) (int, error) { return n, nil } +func (item *Item) At(i int) byte { + return item.bytes[i] +} + func (item *Item) Bytes() []byte { return item.bytes[0:item.length] }
allow a specific byte to be accessed by position
karlseguin_bytepool
train
go
637ce4f28911814b67a706d41f8a54b207328196
diff --git a/config/hoe.rb b/config/hoe.rb index <HASH>..<HASH> 100644 --- a/config/hoe.rb +++ b/config/hoe.rb @@ -59,7 +59,7 @@ hoe = Hoe.new(GEM_NAME, VERS) do |p| # == Optional p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n") - p.extra_deps = ['ruby-hmac','>= 0.3.1'] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ] + p.extra_deps = [['ruby-hmac','>= 0.3.1'] ] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ] #p.spec_extras = {} # A hash of extra values to set in the gemspec.
Fixed a problem with the dependencies.
oauth-xx_oauth-ruby
train
rb
232563d67e79686820c5732d8dfa1bb77bb261b3
diff --git a/github-release-from-changelog.js b/github-release-from-changelog.js index <HASH>..<HASH> 100755 --- a/github-release-from-changelog.js +++ b/github-release-from-changelog.js @@ -121,17 +121,22 @@ var versionRe = new RegExp(versionStartStringRe + version.replace(/\./, ".")); var footerLinkRe = new RegExp("$\\["); changelogLines.some(function(line, i) { + argv.debug && console.log("MATCH", line.match(versionRe)); if (!start && line.match(versionRe)) { start = true; + argv.debug && console.log("START"); } else if ( start && (line.match(versionStartRe) || line.match(footerLinkRe)) ) { + argv.debug && console.log("END"); return true; } else if (start) { + argv.debug && console.log(line); // between start & end, collect lines body.push(line); } + argv.debug && console.log("IGNORED " + line); }); body = body.join("\n").trim();
Add undocumented debug option
MoOx_github-release-from-changelog
train
js
718a010d7bcc7dbf6493d388f0344c00989a6782
diff --git a/rest_framework_nested/viewsets.py b/rest_framework_nested/viewsets.py index <HASH>..<HASH> 100644 --- a/rest_framework_nested/viewsets.py +++ b/rest_framework_nested/viewsets.py @@ -35,3 +35,23 @@ class NestedViewSetMixin(object): for query_param, field_name in parent_lookup_kwargs.items(): orm_filters[field_name] = self.kwargs[query_param] return queryset.filter(**orm_filters) + + def initialize_request(self, request, *args, **kwargs): + """ + Adds the parent params from URL inside the children data available + """ + request = super().initialize_request(request, *args, **kwargs) + + for url_kwarg, fk_filter in self._get_parent_lookup_kwargs().items(): + # fk_filter is alike 'grandparent__parent__pk' + parent_arg = fk_filter.partition('__')[0] + for querydict in [request.data, request.query_params]: + initial_mutability = getattr(querydict, '_mutable', None) + if initial_mutability is not None: + querydict._mutable = True + + querydict[parent_arg] = kwargs[url_kwarg] + + if initial_mutability is not None: + querydict._mutable = initial_mutability + return request
NestedViewSetMixin will inject the parent arg on the data This allows .create() calls on children resources to need to to duplicate the information already provided on the url
alanjds_drf-nested-routers
train
py
301226073626150c0a3038ef2bfb2332482835f0
diff --git a/examples/dirtree.rb b/examples/dirtree.rb index <HASH>..<HASH> 100644 --- a/examples/dirtree.rb +++ b/examples/dirtree.rb @@ -68,6 +68,7 @@ App.new do flow :margin_top => 1, :margin_left => 0, :width => :expand, :height => ht do @t = tree :data => model, :width_pc => 30, :border_attrib => borderattrib rend = @t.renderer # just test method out. + rend.row_selected_attr = BOLD @t.bind :TREE_WILL_EXPAND_EVENT do |node| path = File.join(*node.user_object_path) dirs = _directories path @@ -94,13 +95,14 @@ App.new do lister node end end # select - $def_bg_color = :blue + #$def_bg_color = :blue + @form.bgcolor = :blue @t.expand_node last # @t.mark_parents_expanded last # make parents visible @l = listbox :width_pc => 70, :border_attrib => borderattrib, :selection_mode => :single, :name => 'll', :left_margin => 1 - @l.row_focussed_attr = REVERSE @l.renderer directory_renderer(@l) + @l.renderer().row_focussed_attr = REVERSE @l.bind :LIST_SELECTION_EVENT do |ev| message ev.source.current_value #selected_value
testing out renderer and row_focussed_attr
mare-imbrium_canis
train
rb
5d3d1a10094617bbe5868eb4a1c7c7162ae2d208
diff --git a/packages/simplebar/src/simplebar.js b/packages/simplebar/src/simplebar.js index <HASH>..<HASH> 100755 --- a/packages/simplebar/src/simplebar.js +++ b/packages/simplebar/src/simplebar.js @@ -570,19 +570,12 @@ export default class SimpleBar { * on scrollbar handle drag movement starts */ onDragStart(e, axis = 'y') { - // Preventing the event's default action stops text being - // selectable during the drag. - e.preventDefault(); - // Prevent event leaking - e.stopPropagation(); - const scrollbar = this.axis[axis].scrollbar.el; // Measure how far the user's mouse is from the top of the scrollbar drag handle. const eventOffset = axis === 'y' ? e.pageY : e.pageX; - this.axis[axis].dragOffset = - eventOffset - scrollbar.getBoundingClientRect()[this.axis[axis].offsetAttr]; + eventOffset - scrollbar.getBoundingClientRect()[this.axis[axis].offsetAttr]; this.draggedAxis = axis; document.addEventListener('mousemove', this.drag); @@ -596,6 +589,7 @@ export default class SimpleBar { let eventOffset, track; e.preventDefault(); + e.stopPropagation(); track = this.axis[this.draggedAxis].track;
Add missing stopPropagation on mouseup
Grsmto_simplebar
train
js
a1f8794b740536dcf4f4a0aec1be6785b022f5a2
diff --git a/src/kundera-spark/spark-teradata/src/test/java/com/impetus/client/spark/SparkTeradataClientTest.java b/src/kundera-spark/spark-teradata/src/test/java/com/impetus/client/spark/SparkTeradataClientTest.java index <HASH>..<HASH> 100644 --- a/src/kundera-spark/spark-teradata/src/test/java/com/impetus/client/spark/SparkTeradataClientTest.java +++ b/src/kundera-spark/spark-teradata/src/test/java/com/impetus/client/spark/SparkTeradataClientTest.java @@ -77,7 +77,7 @@ public class SparkTeradataClientTest extends SparkBaseTest @Test public void testTeradataWithSpark() { - testQuery(); + // testQuery(); } /**
removed spark teradata failing case due to cp issue
Impetus_Kundera
train
java
b9a6ff0b90bdf327671aeaa8a1db1e4b2e0b159e
diff --git a/orcas_core/build_source/orcas_diff/src/main/java/de/opitzconsulting/orcas/diff/InitDiffRepository.java b/orcas_core/build_source/orcas_diff/src/main/java/de/opitzconsulting/orcas/diff/InitDiffRepository.java index <HASH>..<HASH> 100644 --- a/orcas_core/build_source/orcas_diff/src/main/java/de/opitzconsulting/orcas/diff/InitDiffRepository.java +++ b/orcas_core/build_source/orcas_diff/src/main/java/de/opitzconsulting/orcas/diff/InitDiffRepository.java @@ -374,6 +374,7 @@ public class InitDiffRepository DiffRepository.getPrimaryKeyMerge().consNameIsConvertToUpperCase = true; DiffRepository.getPrimaryKeyMerge().indexnameIsConvertToUpperCase = true; DiffRepository.getPrimaryKeyMerge().statusDefaultValue = EnableType.ENABLE; + DiffRepository.getPrimaryKeyMerge().tablespaceIsConvertToUpperCase = true; DiffRepository.setMviewLogMerge( new MviewLogMerge() {
toUpperCase for tablespace in primaryKeys
opitzconsulting_orcas
train
java
e37751b80dedca19ab3747f1c117d79f1125d535
diff --git a/src/AdminGeneratorServiceProvider.php b/src/AdminGeneratorServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/AdminGeneratorServiceProvider.php +++ b/src/AdminGeneratorServiceProvider.php @@ -39,11 +39,11 @@ class AdminGeneratorServiceProvider extends ServiceProvider */ public function register() { - $this->app->bindShared('le-admin.command.instance.new', function ($app) { + $this->app->singleton('le-admin.command.instance.new', function ($app) { return $app->make('Lokielse\AdminGenerator\Console\Commands\CreateInstanceCommand'); }); - $this->app->bindShared('le-admin.command.entity.new', function ($app) { + $this->app->singleton('le-admin.command.entity.new', function ($app) { return $app->make('Lokielse\AdminGenerator\Console\Commands\CreateEntityCommand'); }); @@ -52,4 +52,4 @@ class AdminGeneratorServiceProvider extends ServiceProvider 'le-admin.command.entity.new' ]); } -} \ No newline at end of file +}
bindShared should be singleton in With laravel framework <I> [Symfony\Component\Debug\Exception\FatalThrowableError] Fatal error: Call to undefined method Illuminate\Foundation\Application::bindShared() bindShared is removed and singleton should be used instead <URL>
lokielse_laravel-admin-generator
train
php
17d7ee0eeabc9ccd3d3beebfeb78b9e1160bc472
diff --git a/lib/classes/antivirus/scanner.php b/lib/classes/antivirus/scanner.php index <HASH>..<HASH> 100644 --- a/lib/classes/antivirus/scanner.php +++ b/lib/classes/antivirus/scanner.php @@ -52,6 +52,21 @@ abstract class scanner { } /** + * Config get method. + * + * @param string $property config property to get. + * + * @return mixed + * @throws \coding_exception + */ + public function get_config($property) { + if (property_exists($this->config, $property)) { + return $this->config->$property; + } + throw new \coding_exception('Config property "' . $property . '" doesn\'t exist'); + } + + /** * Are the antivirus settings configured? * * @return bool True if plugin has been configured.
MDL-<I> antivirus: Add config getter to base class. Improving architecture to make it testable.
moodle_moodle
train
php
08582e7971320ad62575a4567e0bae1fb2377714
diff --git a/libraries/lithium/data/source/Database.php b/libraries/lithium/data/source/Database.php index <HASH>..<HASH> 100755 --- a/libraries/lithium/data/source/Database.php +++ b/libraries/lithium/data/source/Database.php @@ -414,12 +414,16 @@ abstract class Database extends \lithium\data\Source { } $namespace = preg_replace('/\w+$/', '', $model); $relations = $model ? $model::relations() : array(); + $schema = $model::schema(); foreach ($fields as $scope => $field) { switch (true) { case (is_numeric($scope) && $field == '*'): $result[$model] = array_keys($model::schema()); break; + case (is_numeric($scope) && isset($schema[$field])): + $result[$model][] = $field; + break; case (is_numeric($scope) && isset($relations[$field])): $scope = $field; case (in_array($scope, $relations, true) && $field == '*'):
Fixed issue with specifying fields in SQL queries. Thanks Howard3.
UnionOfRAD_framework
train
php
de9936601deb9bca87275ffd9d67253f8d818d5e
diff --git a/pymemcache/__init__.py b/pymemcache/__init__.py index <HASH>..<HASH> 100644 --- a/pymemcache/__init__.py +++ b/pymemcache/__init__.py @@ -1 +1 @@ -__version__ = '1.2.1' +__version__ = '1.2.2'
Increasing version for pypi
pinterest_pymemcache
train
py
b4a7e65b3ba3ce2cdd6733f8917d7110bf339086
diff --git a/pandas/tests/window/test_rolling.py b/pandas/tests/window/test_rolling.py index <HASH>..<HASH> 100644 --- a/pandas/tests/window/test_rolling.py +++ b/pandas/tests/window/test_rolling.py @@ -7,7 +7,7 @@ from pandas.errors import UnsupportedFunctionCall import pandas.util._test_decorators as td import pandas as pd -from pandas import DataFrame, Series, date_range +from pandas import DataFrame, Series, compat, date_range import pandas._testing as tm from pandas.core.window import Rolling @@ -150,6 +150,7 @@ def test_closed_one_entry(func): @pytest.mark.parametrize("func", ["min", "max"]) [email protected](not compat.IS64, reason="GH-35294") def test_closed_one_entry_groupby(func): # GH24718 ser = pd.DataFrame( @@ -682,6 +683,7 @@ def test_iter_rolling_datetime(expected, expected_index, window): ), ], ) [email protected](not compat.IS64, reason="GH-35294") def test_rolling_positional_argument(grouping, _index, raw): # GH 34605
TST: xfail more <I>-bits (#<I>)
pandas-dev_pandas
train
py
8556b47d4b8d4bf2ac0f73aec957fbb37fc49612
diff --git a/packages/core/parcel-bundler/test/hmr.js b/packages/core/parcel-bundler/test/hmr.js index <HASH>..<HASH> 100644 --- a/packages/core/parcel-bundler/test/hmr.js +++ b/packages/core/parcel-bundler/test/hmr.js @@ -10,12 +10,14 @@ const json5 = require('json5'); const sinon = require('sinon'); describe('hmr', function() { - let b, ws; + let b, ws, stub; beforeEach(function() { + stub = sinon.stub(console, 'clear'); rimraf.sync(__dirname + '/input'); }); afterEach(function(done) { + stub.restore(); let finalise = () => { if (b) { b.stop();
Don’t clear console in the tests
parcel-bundler_parcel
train
js
d2e3002a27ec7b9e3f60bd649364f0f87967c474
diff --git a/printer/printer.go b/printer/printer.go index <HASH>..<HASH> 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -248,21 +248,6 @@ func (p *printer) semiRsrv(s string, pos token.Pos, fallback bool) { p.wantSpace = true } -func (p *printer) hasInline(pos, nline token.Pos) bool { - if len(p.comments) < 1 { - return false - } - for _, c := range p.comments { - if c.Hash > nline { - return false - } - if c.Hash > pos { - return true - } - } - return false -} - func (p *printer) commentsUpTo(pos token.Pos) { if len(p.comments) < 1 { return @@ -959,6 +944,21 @@ func startsWithLparen(s *ast.Stmt) bool { return false } +func (p *printer) hasInline(pos, nline token.Pos) bool { + if len(p.comments) < 1 { + return false + } + for _, c := range p.comments { + if c.Hash > nline { + return false + } + if c.Hash > pos { + return true + } + } + return false +} + func (p *printer) stmts(stmts []*ast.Stmt) { if len(stmts) == 0 { return
printer: move hasInline closer to its use
mvdan_sh
train
go
8b50d876f9f41833332d70eba1e944f1fbb330a9
diff --git a/src/DoctrineDataFixtureModule/Command/ImportCommand.php b/src/DoctrineDataFixtureModule/Command/ImportCommand.php index <HASH>..<HASH> 100644 --- a/src/DoctrineDataFixtureModule/Command/ImportCommand.php +++ b/src/DoctrineDataFixtureModule/Command/ImportCommand.php @@ -45,6 +45,8 @@ class ImportCommand extends Command protected $em; + const PURGE_MODE_TRUNCATE = 2; + protected function configure() { parent::configure(); @@ -65,7 +67,7 @@ EOT $purger = new ORMPurger(); if($input->getOption('purge-with-truncate')) { - $purger->setPurgeMode(2); + $purger->setPurgeMode(self::PURGE_MODE_TRUNCATE); } $executor = new ORMExecutor($this->em, $purger);
Added Purge Mode as Constant
Hounddog_DoctrineDataFixtureModule
train
php
1d3cca927e5e5ef020b06f84d7f1eccb7b3887ce
diff --git a/src/TokenRunner/DocBlock/MalformWorker/SwitchedTypeAndNameMalformWorker.php b/src/TokenRunner/DocBlock/MalformWorker/SwitchedTypeAndNameMalformWorker.php index <HASH>..<HASH> 100644 --- a/src/TokenRunner/DocBlock/MalformWorker/SwitchedTypeAndNameMalformWorker.php +++ b/src/TokenRunner/DocBlock/MalformWorker/SwitchedTypeAndNameMalformWorker.php @@ -30,7 +30,11 @@ final class SwitchedTypeAndNameMalformWorker implements MalformWorkerInterface continue; } - if ($match['name'] === '' || $match['type'] === '') { + if ($match['name'] === '') { + continue; + } + + if ($match['type'] === '') { continue; }
[PHPStanRules] Run only on presenter/control (#<I>)
Symplify_CodingStandard
train
php
07946a59020e3a05a2300b978e9f541ce673bf07
diff --git a/src/collectors/postgres/postgres.py b/src/collectors/postgres/postgres.py index <HASH>..<HASH> 100644 --- a/src/collectors/postgres/postgres.py +++ b/src/collectors/postgres/postgres.py @@ -420,6 +420,31 @@ class ConnectionStateStats(QueryStats): ) AS tmp2 ON tmp.mstate=tmp2.mstate ORDER BY 1 """ + post_96_query = """ + SELECT tmp.state AS key,COALESCE(count,0) FROM + (VALUES ('active'), + ('waiting'), + ('idle'), + ('idletransaction'), + ('unknown') + ) AS tmp(state) + LEFT JOIN + (SELECT CASE WHEN wait_event IS NOT NULL THEN 'waiting' + WHEN state= 'idle' THEN 'idle' + WHEN state= 'idle in transaction' THEN 'idletransaction' + WHEN state = 'active' THEN 'active' + ELSE 'unknown' END AS state, + count(*) AS count + FROM pg_stat_activity + WHERE pid != pg_backend_pid() + GROUP BY CASE WHEN wait_event IS NOT NULL THEN 'waiting' + WHEN state= 'idle' THEN 'idle' + WHEN state= 'idle in transaction' THEN 'idletransaction' + WHEN state = 'active' THEN 'active' + ELSE 'unknown' END + ) AS tmp2 + ON tmp.state=tmp2.state ORDER BY 1 + """ class LockStats(QueryStats):
Fixed in PostgreSQL <I> pg_stat_activity incompatibility in PostgreSQL collector
python-diamond_Diamond
train
py
398996c7f222afa086fa8e18aae39bee8dd184cf
diff --git a/registry.go b/registry.go index <HASH>..<HASH> 100644 --- a/registry.go +++ b/registry.go @@ -57,12 +57,12 @@ func (r *registry) hash(b *builderState) int { } var h uint64 = 14695981039346656037 - h ^= (final * fnvPrime) - h ^= (b.finalVal * fnvPrime) + h = (h ^ final) * fnvPrime + h = (h ^ b.finalVal) * fnvPrime for _, t := range b.transitions { - h ^= (uint64(t.key) * fnvPrime) - h ^= (t.val * fnvPrime) - h ^= (uint64(t.dest.id) * fnvPrime) + h = (h ^ uint64(t.key)) * fnvPrime + h = (h ^ t.val) * fnvPrime + h = (h ^ uint64(t.dest.offset)) * fnvPrime } return int(h % uint64(r.tableSize)) }
fix hash implementation our hash code was ported incorrectly and resulted in way too many states ending up in the same bucket fixing this improved file format compatibility with fst crate
couchbase_vellum
train
go
73ddd4787b4d794a7b7cc28e9baecf4b7a56aea3
diff --git a/tsdb/index/inmem/inmem.go b/tsdb/index/inmem/inmem.go index <HASH>..<HASH> 100644 --- a/tsdb/index/inmem/inmem.go +++ b/tsdb/index/inmem/inmem.go @@ -92,7 +92,10 @@ func (i *Index) SeriesSketches() (estimator.Sketch, estimator.Sketch, error) { // Since indexes are not shared across shards, the count returned by SeriesN // cannot be combined with other shards' counts. func (i *Index) SeriesN() int64 { - return int64(len(i.series)) + i.mu.RLock() + n := int64(len(i.series)) + i.mu.RUnlock() + return n } // Measurement returns the measurement object from the index by the name
Fix race in SeriesN and CreateSeriesIfNotExists
influxdata_influxdb
train
go
c42097b688ccd5579967cfb4ae8be2c798b48510
diff --git a/main/core/Library/Installation/Updater/Updater120000.php b/main/core/Library/Installation/Updater/Updater120000.php index <HASH>..<HASH> 100644 --- a/main/core/Library/Installation/Updater/Updater120000.php +++ b/main/core/Library/Installation/Updater/Updater120000.php @@ -39,7 +39,6 @@ class Updater120000 extends Updater public function preUpdate() { $this->saveOldTabsTables(); - $this->deactivateActivityResourceType(); } public function saveOldTabsTables() @@ -96,6 +95,7 @@ class Updater120000 extends Updater $this->linkWidgetsInstanceToContainers(); $this->restoreWidgetInstancesConfigs(); $this->checkDesktopTabs(); + $this->deactivateActivityResourceType(); } private function updateHomeTabType()
Update Updater<I>.php (#<I>) set in post update in place of pre update
claroline_Distribution
train
php
c9b767b74aaf9058568082a6541524e485894881
diff --git a/telluric/collections.py b/telluric/collections.py index <HASH>..<HASH> 100644 --- a/telluric/collections.py +++ b/telluric/collections.py @@ -53,18 +53,10 @@ def dissolve(collection, aggfunc=None): else: new_properties = {} - if 'raster_url' in collection.attribute_names: - final_raster = merge_all([feature.get_raster() for feature in collection]) - dest_file = tempfile.NamedTemporaryFile(suffix=".tiff") - final_raster.save(dest_file) - - new_geometry = final_raster.footprint() - new_properties['raster_url'] = dest_file.name - - else: - new_geometry = cascaded_union([feature.geometry for feature in collection]) - - return GeoFeature(new_geometry, new_properties) + return GeoFeature( + cascaded_union([feature.geometry for feature in collection]), + new_properties + ) class BaseCollection(Sequence, NotebookPlottingMixin):
Make dissolve raster-agnostic
satellogic_telluric
train
py
cfae15864c5661e6ff62d8b01ad4afa62bf5ff2c
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -140,7 +140,8 @@ function _make_generateLog(metrics, func, start_time, config, context) { time_sec: time_sec_nanosec[0], time_nanosec: time_sec_nanosec[1], duration: Math.ceil(time_sec_nanosec[0] * 1000000000.0 + time_sec_nanosec[1]), - client_id: config.clientId + client_id: config.clientId, + installMethod: config.installMethod } if (COLDSTART === true) { @@ -184,7 +185,8 @@ function setConfig(configObject) { clientId: configObject && (configObject.token || configObject.clientId) || process.env.IOPIPE_TOKEN || process.env.IOPIPE_CLIENTID || '', debug: configObject && configObject.debug || process.env.IOPIPE_DEBUG || false, networkTimeout: configObject && configObject.networkTimeout || 5000, - timeoutWindow: configObject && configObject.timeoutWindow || 50 + timeoutWindow: configObject && configObject.timeoutWindow || 50, + installMethod: configObject && configObject.installMethod || process.env.IOPIPE_INSTALL_METHOD || "manual" } }
Add installMethod (#<I>)
iopipe_iopipe-js-core
train
js
24afbe55845065ae3ecaa71a86dc40fdcd6f792d
diff --git a/MAVProxy/modules/lib/wxhorizon.py b/MAVProxy/modules/lib/wxhorizon.py index <HASH>..<HASH> 100755 --- a/MAVProxy/modules/lib/wxhorizon.py +++ b/MAVProxy/modules/lib/wxhorizon.py @@ -24,6 +24,7 @@ class HorizonIndicator(): '''child process - this holds all the GUI elements''' self.parent_pipe_send.close() + from MAVProxy.modules.lib import wx_processguard from MAVProxy.modules.lib.wx_loader import wx from MAVProxy.modules.lib.wxhorizon_ui import HorizonFrame # Create wx application
Update horizon module to allow wx to be imported on macOS 1. import wx_processguard in the wxhorizon child_task before importing wx
ArduPilot_MAVProxy
train
py
fafdf0a5cb76147241ea8079a593b009fd6ebdc8
diff --git a/calendar-bundle/src/Resources/contao/modules/ModuleEventlist.php b/calendar-bundle/src/Resources/contao/modules/ModuleEventlist.php index <HASH>..<HASH> 100644 --- a/calendar-bundle/src/Resources/contao/modules/ModuleEventlist.php +++ b/calendar-bundle/src/Resources/contao/modules/ModuleEventlist.php @@ -219,6 +219,32 @@ class ModuleEventlist extends Events } unset($arrAllEvents); + + // Limit the number of recurrences if both the event list and the event + // allow unlimited recurrences (see #4037) + if (!$this->numberOfItems) + { + $unset = array(); + + foreach ($arrEvents as $k=>$v) + { + if ($v['recurring'] && !$v['recurrences']) + { + if (!isset($unset[$v['id']])) + { + $unset[$v['id']] = true; + } + else + { + unset($arrEvents[$k]); + } + } + } + + unset($unset); + $arrEvents = array_values($arrEvents); + } + $total = \count($arrEvents); $limit = $total; $offset = 0;
Prevent unlimited recurrences in the event list (see #<I>) Description ----------- - Commits ------- <I>e Prevent unlimited recurrences in the event list <I>b<I>b<I> Only show the repeated event once
contao_contao
train
php