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
|
|---|---|---|---|---|---|
611573ce54dd27a44b1cc59a83481a098e83efec
|
diff --git a/Flash/FileUpload.php b/Flash/FileUpload.php
index <HASH>..<HASH> 100644
--- a/Flash/FileUpload.php
+++ b/Flash/FileUpload.php
@@ -99,7 +99,8 @@ class sb_Flash_FileUpload{
//$this->name = sb_Strings::clean_file_name($this->upload['name']);
$this->name = $this->uploaded_file['name'];
$this->path = $destination_directory.'/'.$this->name;
- $ext = array_pop(explode('.', $this->name));
+ $arr = explode('.', $this->name);
+ $ext = array_pop($arr);
$this->ext = strtolower($ext);
$this->sizeK = round($this->uploaded_file['size']/1000);
|
FileUpload has problem using end() switched to array_pop
|
surebert_surebert-framework
|
train
|
php
|
3954ecc595d7a06543d1f950d2860b6db2fc13ba
|
diff --git a/parsedmarc/elastic.py b/parsedmarc/elastic.py
index <HASH>..<HASH> 100644
--- a/parsedmarc/elastic.py
+++ b/parsedmarc/elastic.py
@@ -296,12 +296,14 @@ def save_forensic_report_to_elasticsearch(forensic_report):
arrival_date = parsedmarc.human_timestamp_to_datetime(arrival_date_human)
search = forensic_index.search()
- to_query = {"match": {"sample.headers.to": headers["to"]}}
from_query = {"match": {"sample.headers.from": headers["from"]}}
subject_query = {"match": {"sample.headers.subject": headers["subject"]}}
arrival_date_query = {"match": {"sample.headers.arrival_date": arrival_date
- }}
- q = Q(to_query) & Q(from_query) & Q(subject_query) & Q(arrival_date_query)
+ }}
+ q = Q(from_query) & Q(subject_query) & Q(arrival_date_query)
+ if "to" in headers:
+ to_query = {"match": {"sample.headers.to": headers["to"]}}
+ q & Q(to_query)
search.query = q
existing = search.execute()
|
<I> - Fix saving to Elasticsearch when the to header is mising from forensic sample
|
domainaware_parsedmarc
|
train
|
py
|
de4ae26a9ce9e6a5bc7570a86b9c57859589a3bc
|
diff --git a/salt/log/setup.py b/salt/log/setup.py
index <HASH>..<HASH> 100644
--- a/salt/log/setup.py
+++ b/salt/log/setup.py
@@ -175,19 +175,20 @@ class SaltColorLogRecord(logging.LogRecord):
logging.LogRecord.__init__(self, *args, **kwargs)
reset = TextFormat('reset')
+ clevel = LOG_COLORS['levels'].get(self.levelname, reset)
+ cmsg = LOG_COLORS['msgs'].get(self.levelname, reset)
+
# pylint: disable=E1321
self.colorname = '%s[%-17s]%s' % (LOG_COLORS['name'],
self.name,
reset)
- self.colorlevel = '%s[%-8s]%s' % (LOG_COLORS['levels'][self.levelname],
+ self.colorlevel = '%s[%-8s]%s' % (clevel,
self.levelname,
TextFormat('reset'))
self.colorprocess = '%s[%5s]%s' % (LOG_COLORS['process'],
self.process,
reset)
- self.colormsg = '%s%s%s' % (LOG_COLORS['msgs'][self.levelname],
- self.msg,
- reset)
+ self.colormsg = '%s%s%s' % (cmsg, self.msg, reset)
# pylint: enable=E1321
|
Some 3rd-party modules (e.g. gnupg) define custom log levels that emit
at INFO level and above. This patch sets the color data lookups to
default to TextFormat('reset') rather than producing a stack trace
every time a log message is generated from an affected module.
|
saltstack_salt
|
train
|
py
|
8c4fa07dd529c3c89df6f7b686b333d939401c54
|
diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -52,6 +52,8 @@ module.exports = function(grunt) {
external: ['crypto', 'zlib', 'node-localstorage', 'node-fetch', 'asn1.js', 'jwk-to-pem'],
transform: [
["babelify", {
+ global: true,
+ only: /^(?:.*\/node_modules\/asmcrypto\.js\/|(?!.*\/node_modules\/)).*$/, // Only babelify asmcrypto in node_modules
plugins: ["transform-async-to-generator",
"syntax-async-functions",
"transform-regenerator",
@@ -76,6 +78,8 @@ module.exports = function(grunt) {
external: ['crypto', 'zlib', 'node-localstorage', 'node-fetch', 'asn1.js', 'jwk-to-pem'],
transform: [
["babelify", {
+ global: true,
+ only: /^(?:.*\/node_modules\/asmcrypto\.js\/|(?!.*\/node_modules\/)).*$/, // Only babelify asmcrypto in node_modules
plugins: ["transform-async-to-generator",
"syntax-async-functions",
"transform-regenerator",
|
babelify asmcrypto.js
|
openpgpjs_openpgpjs
|
train
|
js
|
02ccbf9318f2088b1eeff2dd4fc6f463a2663b8d
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,7 @@ setup(
url='https://github.com/bitprophet/botox',
packages=["botox"],
- install_requires=["boto>=2.0", "prettytable", "decorator>=3.0"],
+ install_requires=["boto>=2.0", "decorator>=3.0"],
classifiers=[
'Development Status :: 3 - Alpha',
|
Nuke PrettyTable for now, should be optional
|
bitprophet_botox
|
train
|
py
|
267a9ac8a045151996c1576f050e20511c4a8e0d
|
diff --git a/test.js b/test.js
index <HASH>..<HASH> 100644
--- a/test.js
+++ b/test.js
@@ -1,7 +1,7 @@
'use strict'
var test = require('tape')
-var Packet = require('.')
+var Packet = require('./')
test('Packet defaults', function (t) {
var instance = new Packet({})
|
Tests should pass on node <I> and <I>.
|
mcollina_aedes-packet
|
train
|
js
|
e605209ad645bfb5407eed19ecd005dcdbb16e94
|
diff --git a/question/type/calculated/questiontype.php b/question/type/calculated/questiontype.php
index <HASH>..<HASH> 100644
--- a/question/type/calculated/questiontype.php
+++ b/question/type/calculated/questiontype.php
@@ -587,7 +587,7 @@ class qtype_calculated extends question_type {
*/
public function save_question($question, $form) {
global $DB;
- if ($this->wizardpagesnumber() == 1) {
+ if ($this->wizardpagesnumber() == 1 || $question->qtype == 'calculatedsimple') {
$question = parent::save_question($question, $form);
return $question;
}
|
MDL-<I> Saving datasets from edit_calculatedsimple_form.php
Bypassing the 3 steps savequestion() of calculated.
|
moodle_moodle
|
train
|
php
|
40aa7f279d6994bee52615e09db380f7d04984bd
|
diff --git a/spec/lib/files_spec.rb b/spec/lib/files_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/files_spec.rb
+++ b/spec/lib/files_spec.rb
@@ -293,10 +293,10 @@ describe '[Files]' do
end
end
- describe '#remove_third_party_account' do
+ describe '#remove_third_party_account', :skip do
+ skip 'not implemented for tests'
it_should_behave_like 'an api request' do
let(:command) { :remove_third_party_account }
- let(:args) { PROVIDER_ID }
end
end
|
There is no third party services test (#<I>)
So I skip those tests
|
ONLYOFFICE_onlyoffice_api_gem
|
train
|
rb
|
7e13da1820e3c769136db121989c774d155b949d
|
diff --git a/cumulusci/tasks/bulkdata/load.py b/cumulusci/tasks/bulkdata/load.py
index <HASH>..<HASH> 100644
--- a/cumulusci/tasks/bulkdata/load.py
+++ b/cumulusci/tasks/bulkdata/load.py
@@ -420,6 +420,7 @@ class LoadData(BaseSalesforceApiTask, SqlAlchemyMixin):
mapping["action"] == "insert"
and self._is_person_accounts_enabled
and mapping["sf_object"].lower() == "contact"
+ # FIXME: IsPersonAccount needs to exist as a Column
):
self._sql_bulk_insert_from_records(
connection=conn,
|
person account Contact IDs successfully load into id table
|
SFDO-Tooling_CumulusCI
|
train
|
py
|
b49037afbca2cc40eaf39d1b8cf8b11a6637caa1
|
diff --git a/lib/errors.js b/lib/errors.js
index <HASH>..<HASH> 100644
--- a/lib/errors.js
+++ b/lib/errors.js
@@ -69,7 +69,9 @@ var handler = function(err, req, res, next) {
res.status(statusCode);
- if (typeof req.app.logger.error === 'function') {
+ console.log(req.app);
+
+ if (req.app.logger && typeof req.app.logger.error === 'function') {
req.app.logger.error(req.url, err.stack || err);
}
else if (typeof req.app.error === 'function') {
|
handling req.app.logger undefined
|
feathersjs_errors
|
train
|
js
|
7ac507d9ffd19e03737345408b62a732ec706c73
|
diff --git a/plugin/forward/proxy.go b/plugin/forward/proxy.go
index <HASH>..<HASH> 100644
--- a/plugin/forward/proxy.go
+++ b/plugin/forward/proxy.go
@@ -2,6 +2,7 @@ package forward
import (
"crypto/tls"
+ "runtime"
"sync/atomic"
"time"
@@ -36,6 +37,7 @@ func NewProxy(addr string, tlsConfig *tls.Config) *Proxy {
avgRtt: int64(timeout / 2),
}
p.client = dnsClient(tlsConfig)
+ runtime.SetFinalizer(p, (*Proxy).finalizer)
return p
}
@@ -91,6 +93,9 @@ func (p *Proxy) Down(maxfails uint32) bool {
// close stops the health checking goroutine.
func (p *Proxy) close() {
p.probe.Stop()
+}
+
+func (p *Proxy) finalizer() {
p.transport.Stop()
}
|
plugin/forward: close connection manager in proxy finalizer (#<I>)
- connManager() goroutine will stop when Proxy is about to be
garbage collected. This means that no queries are in progress,
and no queries are going to come
|
coredns_coredns
|
train
|
go
|
33f5ed8a8717db5a35285e37a649c8fa3e6e1f17
|
diff --git a/indra/tools/reading/readers.py b/indra/tools/reading/readers.py
index <HASH>..<HASH> 100644
--- a/indra/tools/reading/readers.py
+++ b/indra/tools/reading/readers.py
@@ -578,6 +578,7 @@ class ReadingData(object):
% (self.reader, self.tcid))
stmts = []
else:
+ processor.set_statements_pmid(None)
stmts = processor.statements
return stmts
|
Set pmids to None for db reading.
|
sorgerlab_indra
|
train
|
py
|
aba67bba0605c0d3b6479a3ac190c3e3e661c106
|
diff --git a/nat/utils.py b/nat/utils.py
index <HASH>..<HASH> 100644
--- a/nat/utils.py
+++ b/nat/utils.py
@@ -21,6 +21,8 @@ import os
encoders = {}
encoders["forwardSlash"] = ("/", "%2F")
encoders["colon"] = (":", "%3A")
+encoders["greater"] = (">", "%3E")
+encoders["smaller"] = (">", "%3C")
|
Adding encoding for special caracters of DOI.
|
BlueBrain_nat
|
train
|
py
|
4a14b709acd70666e54e5cfac4dde08390446c72
|
diff --git a/core/lib/generators/refinery/form/templates/app/controllers/plural_name_controller.rb b/core/lib/generators/refinery/form/templates/app/controllers/plural_name_controller.rb
index <HASH>..<HASH> 100644
--- a/core/lib/generators/refinery/form/templates/app/controllers/plural_name_controller.rb
+++ b/core/lib/generators/refinery/form/templates/app/controllers/plural_name_controller.rb
@@ -7,7 +7,7 @@ class <%= class_name.pluralize %>Controller < ApplicationController
end
def thank_you
- @page = Page.find_by_link_url("/<%= plural_name %>/thank_you", :include => [:parts, :slugs])
+ @page = Refinery::Page.find_by_link_url("/<%= plural_name %>/thank_you", :include => [:parts, :slugs])
end
def new
@@ -39,7 +39,7 @@ class <%= class_name.pluralize %>Controller < ApplicationController
protected
def find_page
- @page = Page.find_by_link_url('/<%= plural_name %>/new', :include => [:parts, :slugs])
+ @page = Refinery::Page.find_by_link_url('/<%= plural_name %>/new', :include => [:parts, :slugs])
end
end
|
Refinery::Page not Page
|
refinery_refinerycms
|
train
|
rb
|
c4bfca8b7b808149f67d7c45316928ea23253b7d
|
diff --git a/src/main/java/net/bootsfaces/component/ajax/AJAXRenderer.java b/src/main/java/net/bootsfaces/component/ajax/AJAXRenderer.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/bootsfaces/component/ajax/AJAXRenderer.java
+++ b/src/main/java/net/bootsfaces/component/ajax/AJAXRenderer.java
@@ -267,6 +267,9 @@ public class AJAXRenderer extends CoreRenderer {
StringBuilder s = generateAJAXCall(context, (IAJAXComponent) component, null);
String script = s.toString() + ";";
String defaultEvent = ((IAJAXComponent) component).getDefaultEventName();
+ if (component instanceof CommandButton)
+ if (script.length() > 0 && "click".equals(defaultEvent))
+ script += ";return false;";
rw.writeAttribute("on" + defaultEvent, script, null);
}
}
|
fixed the AJAX behavior of command buttons
|
TheCoder4eu_BootsFaces-OSP
|
train
|
java
|
0d96b46a0f7a196d4ff77efee757053ce7d1bac7
|
diff --git a/lib/rails_best_practices/reviews/check_save_return_value_review.rb b/lib/rails_best_practices/reviews/check_save_return_value_review.rb
index <HASH>..<HASH> 100644
--- a/lib/rails_best_practices/reviews/check_save_return_value_review.rb
+++ b/lib/rails_best_practices/reviews/check_save_return_value_review.rb
@@ -1,8 +1,8 @@
# encoding: utf-8
module RailsBestPractices
module Reviews
- # Review all code to make sure we either check the return value of "save"
- # or use "save!"
+ # Review all code to make sure we either check the return value of "save", "update_attributes"
+ # and "create" or use "save!", "update_attributes!", or "create!", respectively.
#
# See the best practice details here http://rails-bestpractices.com/posts/2012/11/02/check-the-return-value-of-save-otherwise-use-save/
#
|
Docs for check_save_return_value
Documenting all the work it does.
|
flyerhzm_rails_best_practices
|
train
|
rb
|
72b7a28003d8b8553854ff2fba358736677de3f1
|
diff --git a/app/src/Bolt/Storage.php b/app/src/Bolt/Storage.php
index <HASH>..<HASH> 100644
--- a/app/src/Bolt/Storage.php
+++ b/app/src/Bolt/Storage.php
@@ -1462,8 +1462,6 @@ class Storage
return false;
}
- // echo "<pre>\n" . util::var_dump($this->app['config']['contenttypes'], true) . "</pre>\n";
-
// See if we've either given the correct contenttype, or try to find it by name or singular_name.
if (isset($this->app['config']['contenttypes'][$contenttypeslug])) {
$contenttype = $this->app['config']['contenttypes'][$contenttypeslug];
@@ -1473,21 +1471,14 @@ class Storage
$contenttype = $this->app['config']['contenttypes'][$key];
}
}
-
}
if (!empty($contenttype)) {
-
- $contenttype['slug'] = makeSlug($contenttype['name']);
- $contenttype['singular_slug'] = makeSlug($contenttype['singular_name']);
-
return $contenttype;
-
} else {
return false;
}
-
}
|
Fix: don't set the slug for contenttype in getContentType().
|
bolt_bolt
|
train
|
php
|
6cd783eafc9ccca02cea3d5d594112c7b922d216
|
diff --git a/packages/base-element/src/lib/decorators.js b/packages/base-element/src/lib/decorators.js
index <HASH>..<HASH> 100644
--- a/packages/base-element/src/lib/decorators.js
+++ b/packages/base-element/src/lib/decorators.js
@@ -378,8 +378,7 @@ const jsonSchemaPropsDecorator = clazz => {
props[propName] = {
type: propType,
- reflect:
- property.type === 'boolean' || property.reflect ? true : false,
+ reflect: property.reflect ? true : false,
attribute: paramCase(propName),
};
}
|
feat: do not force booleans to reflect
|
bolt-design-system_bolt
|
train
|
js
|
7915c19128eef2644ac1bad48223904807abc540
|
diff --git a/openfisca_core/taxscales.py b/openfisca_core/taxscales.py
index <HASH>..<HASH> 100644
--- a/openfisca_core/taxscales.py
+++ b/openfisca_core/taxscales.py
@@ -146,11 +146,9 @@ class AmountTaxScale(AbstractTaxScale):
self.thresholds.insert(i, threshold)
self.amounts.insert(i, amount)
- def calc(self, base):
- base1 = np.tile(base, (len(self.thresholds), 1)).T
- thresholds1 = np.tile(np.hstack((self.thresholds, np.inf)), (len(base), 1))
- a = max_(min_(base1, thresholds1[:, 1:]) - thresholds1[:, :-1], 0)
- return np.dot(self.amounts, a.T > 0)
+ def calc(self, base, right=False):
+ bracket_indices = np.digitize(base, self.thresholds, right=right)
+ return np.array(self.amounts)[bracket_indices - 1]
class LinearAverageRateTaxScale(AbstractRateTaxScale):
|
Improve implementation of AmountTaxScale.calc
|
openfisca_openfisca-core
|
train
|
py
|
e72b84f7aef50584c7c906746e81656d56640194
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -69,7 +69,7 @@ extras_require = {
'nc_nwcsaf_msg': ['netCDF4 >= 1.1.8'],
'sar_c': ['python-geotiepoints >= 1.1.7', 'gdal'],
'abi_l1b': ['h5netcdf'],
- 'seviri_l2_bufr': ['eccodes >= 2.12.3', 'python-eccodes >= 2.12.3'],
+ 'seviri_l2_bufr': ['eccodes-python'],
'hsaf_grib': ['pygrib'],
# Writers:
'cf': ['h5netcdf >= 0.7.3'],
|
Updated setup.py to only include the pip eccodes-python package as a dependency
|
pytroll_satpy
|
train
|
py
|
afa5b3af12c3c850a6849c37594a8c8cea0ad91b
|
diff --git a/User/InMemoryUserRepository.php b/User/InMemoryUserRepository.php
index <HASH>..<HASH> 100644
--- a/User/InMemoryUserRepository.php
+++ b/User/InMemoryUserRepository.php
@@ -4,9 +4,9 @@ namespace SumoCoders\FrameworkMultiUserBundle\User;
use SumoCoders\FrameworkMultiUserBundle\Security\PasswordResetToken;
use SumoCoders\FrameworkMultiUserBundle\User\Interfaces\User as UserInterface;
-use SumoCoders\FrameworkMultiUserBundle\User\Interfaces\UserRepository;
+use SumoCoders\FrameworkMultiUserBundle\User\Interfaces\UserRepository as UserRepositoryInterface;
-class InMemoryUserRepository implements UserRepository
+class InMemoryUserRepository implements UserRepositoryInterface
{
/** @var User[] */
private $users = [];
|
Create an alias for the user repository interface
|
sumocoders_FrameworkMultiUserBundle
|
train
|
php
|
76183f995e96fb92f42b7baa6830add529d0312e
|
diff --git a/distributed/src/main/java/com/orientechnologies/orient/server/hazelcast/OHazelcastPlugin.java b/distributed/src/main/java/com/orientechnologies/orient/server/hazelcast/OHazelcastPlugin.java
index <HASH>..<HASH> 100755
--- a/distributed/src/main/java/com/orientechnologies/orient/server/hazelcast/OHazelcastPlugin.java
+++ b/distributed/src/main/java/com/orientechnologies/orient/server/hazelcast/OHazelcastPlugin.java
@@ -983,7 +983,9 @@ public class OHazelcastPlugin extends ODistributedAbstractPlugin implements Memb
final long timeout = OGlobalConfiguration.DISTRIBUTED_CRUD_TASK_SYNCH_TIMEOUT.getValueAsLong();
if (averageResponseTime > timeout * 75 / 100) {
- final long sleep = Math.abs(timeout - averageResponseTime);
+ long sleep = Math.abs(timeout - averageResponseTime);
+ if( sleep > 3000)
+ sleep = 3000;
ODistributedServerLog.debug(this, getLocalNodeName(), null, DIRECTION.NONE,
"slowing down request to avoid to fill queues. Wait for %dms (timeout=%d, averageResponseTime=%d)...", sleep, timeout,
|
Distributed: minor, avoided to exceed the pause of 3 secs in case of re-balancing
|
orientechnologies_orientdb
|
train
|
java
|
8a7bdf694dae15efec46f8dfa9f185c7b4720d90
|
diff --git a/lib/ansiblelint/version.py b/lib/ansiblelint/version.py
index <HASH>..<HASH> 100644
--- a/lib/ansiblelint/version.py
+++ b/lib/ansiblelint/version.py
@@ -1 +1 @@
-__version__ = '3.0.0rc7'
+__version__ = '3.0.0rc8'
|
Update version to <I>rc8
|
ansible_ansible-lint
|
train
|
py
|
453aa1bec9262bcc3e30a68555ccd0c2e4c692d9
|
diff --git a/src/client.py b/src/client.py
index <HASH>..<HASH> 100644
--- a/src/client.py
+++ b/src/client.py
@@ -133,8 +133,12 @@ class Client(object):
po = PayloadObject(ENTITY_PO_NUM, None, key)
frame.addPayloadObject(po)
+ def wrappedResponseHandler(response):
+ self.vk = response.getFirstValue("vk")
+ response_handler(response)
+
with self.response_handlers_lock:
- self.response_handlers[seq_num] = response_handler
+ self.response_handlers[seq_num] = wrappedResponseHandler
frame.writeToSocket(self.socket)
def setEntity(self, key):
|
Cache client VK when asynchronously setting entity
|
SoftwareDefinedBuildings_bw2python
|
train
|
py
|
4aba799e1c0db867e5c6b679eb8174e01e80cffd
|
diff --git a/src/components/inputnumber/InputNumber.js b/src/components/inputnumber/InputNumber.js
index <HASH>..<HASH> 100644
--- a/src/components/inputnumber/InputNumber.js
+++ b/src/components/inputnumber/InputNumber.js
@@ -521,7 +521,6 @@ export class InputNumber extends Component {
}
onInputKeyPress(event) {
- event.preventDefault();
let code = event.which || event.keyCode;
let char = String.fromCharCode(code);
const isDecimalSign = this.isDecimalSign(char);
@@ -529,6 +528,8 @@ export class InputNumber extends Component {
if ((48 <= code && code <= 57) || isMinusSign || isDecimalSign) {
this.insert(event, char, { isDecimalSign, isMinusSign });
+
+ event.preventDefault();
}
}
|
Fixed #<I> - InputNumber doesn't submit a form
|
primefaces_primereact
|
train
|
js
|
8762810cd5302cb6f21ae248ea85449c70d44734
|
diff --git a/src/Ibuildings/QA/Tools/PHP/Console/InstallCommand.php b/src/Ibuildings/QA/Tools/PHP/Console/InstallCommand.php
index <HASH>..<HASH> 100644
--- a/src/Ibuildings/QA/Tools/PHP/Console/InstallCommand.php
+++ b/src/Ibuildings/QA/Tools/PHP/Console/InstallCommand.php
@@ -496,18 +496,12 @@ class InstallCommand extends Command
*/
protected function configureBehat(InputInterface $input, OutputInterface $output)
{
-// if (!$this->commandExists('behat')) {
-// $output->writeln("<error>You don't have Behat installed. Not enabling Behat.</error>");
-// $this->settings['enableBehat'] = false;
-// return;
-// }
-
$this->settings['enableBehat'] = true;
$this->settings['featuresDir'] = BASE_DIR .'/features';
}
/**
- * Install some feature examples.
+ * Install Behat yaml files.
*
* @param InputInterface $input
* @param OutputInterface $output
|
Fix some comments and removed some unnecessary codefragment.
|
ibuildingsnl_qa-tools
|
train
|
php
|
4aeb5b968be2a161306b7a2cbdc6ebc9ada482ba
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100755
--- a/index.js
+++ b/index.js
@@ -63,7 +63,7 @@ const getCommandName = (command) => {
const askForCommand = () => {
inquire([{
name: 'command',
- question: 'What would you like to generate?'
+ question: 'What would you like to do?'
}])
.then((answers) => main(answers[0].answer.split(/\s+/)));
};
|
Changed prompt when no command is given
|
gonzofish_angular-librarian
|
train
|
js
|
250db955a8b00abfec6128dc9b4721a30acfa01c
|
diff --git a/cpuinfo/cpuinfo.py b/cpuinfo/cpuinfo.py
index <HASH>..<HASH> 100644
--- a/cpuinfo/cpuinfo.py
+++ b/cpuinfo/cpuinfo.py
@@ -1474,7 +1474,7 @@ def main():
# Make sure we are running on a supported system
arch, bits = parse_arch(DataSource.raw_arch_string)
if not arch in ['X86_32', 'X86_64', 'ARM_7', 'ARM_8']:
- sys.stderr.write("py-cpuinfo currently only works on X86 and ARM CPUs.\n")
+ sys.stderr.write("py-cpuinfo currently only works on X86 and some ARM CPUs.\n")
sys.exit(1)
if __name__ == '__main__':
|
Updated error message for some unsupported cpus.
|
workhorsy_py-cpuinfo
|
train
|
py
|
9cbb02dd6621578f4a0266ed631f2dadf5423f9b
|
diff --git a/install/class.Setup.php b/install/class.Setup.php
index <HASH>..<HASH> 100644
--- a/install/class.Setup.php
+++ b/install/class.Setup.php
@@ -22,7 +22,7 @@
use oat\oatbox\action\Action;
use common_report_Report as Report;
-use oat\oatbox\install\Installer;
+use Zend\ServiceManager\ServiceLocatorAwareInterface;
class tao_install_Setup implements Action
{
@@ -229,6 +229,9 @@ class tao_install_Setup implements Action
foreach($parameters['postInstall'] as $script){
if (isset($script['class']) && is_a($script['class'], Action::class, true)) {
$object = new $script['class']();
+ if(is_a($object, ServiceLocatorAwareInterface::class, true)){
+ $object->setServiceLocator($serviceManager);
+ }
$params = (isset($script['params']) && is_array($script['params'])) ? $script['params'] : [];
call_user_func($object, $params);
}
|
set the service locator for post install scripts
|
oat-sa_tao-core
|
train
|
php
|
42b6781764caf426a2d17180a0a92d34c3f5d329
|
diff --git a/web/concrete/core/Legacy/Loader.php b/web/concrete/core/Legacy/Loader.php
index <HASH>..<HASH> 100644
--- a/web/concrete/core/Legacy/Loader.php
+++ b/web/concrete/core/Legacy/Loader.php
@@ -14,7 +14,11 @@ class Loader {
}
public static function helper($service, $pkgHandle = false) {
- return Core::make('helper/' . $service);
+ if ($pkgHandle !== false) {
+ return Core::make('/packages/' . $pkgHandle . '/helper/' . $service);
+ } else {
+ return Core::make('helper/' . $service);
+ }
}
public static function packageElement($file, $pkgHandle, $args = null) {
|
Added routing for packages
Former-commit-id: <I>f<I>ee<I>cb<I>de5cfe<I>e<I>c<I>efb<I>
|
concrete5_concrete5
|
train
|
php
|
a633a8328ddc2fce1b84478cfa21fe85cd1534df
|
diff --git a/src/Options.php b/src/Options.php
index <HASH>..<HASH> 100644
--- a/src/Options.php
+++ b/src/Options.php
@@ -47,9 +47,4 @@ class Options
{
return "\"{$this->buildDir}/{$file}\"";
}
-
- public function appFile($file)
- {
- return __DIR__ . "/../app/{$file}";
- }
}
diff --git a/tests/OptionsTest.php b/tests/OptionsTest.php
index <HASH>..<HASH> 100644
--- a/tests/OptionsTest.php
+++ b/tests/OptionsTest.php
@@ -30,7 +30,6 @@ class OptionsTest extends \PHPUnit_Framework_TestCase
{
assertThat($this->fileOutput->analyzedDir, is('"./"'));
assertThat($this->fileOutput->toFile('file'), is('"build//file"'));
- assertThat($this->fileOutput->appFile('file'), is(nonEmptyString()));
}
public function testShouldIgnorePdependInCliOutput()
|
Config - delete unused method
|
EdgedesignCZ_phpqa
|
train
|
php,php
|
c4f35f62c3480493b9b579aeac2e0318ef5db681
|
diff --git a/lib/em-hiredis/lock.rb b/lib/em-hiredis/lock.rb
index <HASH>..<HASH> 100644
--- a/lib/em-hiredis/lock.rb
+++ b/lib/em-hiredis/lock.rb
@@ -77,6 +77,7 @@ module EM::Hiredis
EM::Hiredis.logger.debug "Lock: aquired #{@key}"
@locked = true
@expiry = expiry
+ EM.cancel_timer(@expire_timer) if @expire_timer
@expire_timer = EM.add_timer(@timeout) {
EM::Hiredis.logger.debug "Lock: #{@key} will expire in 1s"
@onexpire.call if @onexpire
|
Bugfix in lock when using onexpire
* In the case that the lock is re-acquired (i.e. extended) before the onexpire callback, the old onexpire callback would still fire
|
mloughran_em-hiredis
|
train
|
rb
|
4b52b875c9c5273c8b7122e1c466df5e58377555
|
diff --git a/filterbank.py b/filterbank.py
index <HASH>..<HASH> 100755
--- a/filterbank.py
+++ b/filterbank.py
@@ -553,6 +553,8 @@ if __name__ == "__main__":
help='average along time axis (plot spectrum only)')
parser.add_argument('-s', action='store', default='', dest='plt_filename', type=str,
help='save plot graphic to file (give filename as argument)')
+ parser.add_argument('-S', action='store_true', default=False, dest='save_only',
+ help='Turn off plotting of data and only save to file.')
args = parser.parse_args()
# Open filterbank data
@@ -610,5 +612,6 @@ if __name__ == "__main__":
if args.plt_filename != '':
plt.savefig(args.plt_filename)
- if os.environ.has_key('DISPLAY'):
- plt.show()
+ if not args.save_only:
+ if os.environ.has_key('DISPLAY'):
+ plt.show()
|
Added -S flag for save only (no plotting)
|
UCBerkeleySETI_blimpy
|
train
|
py
|
c8f32cc3648020112e0840d0c492c41616113e84
|
diff --git a/js/lib/mediawiki.DOMPostProcessor.js b/js/lib/mediawiki.DOMPostProcessor.js
index <HASH>..<HASH> 100644
--- a/js/lib/mediawiki.DOMPostProcessor.js
+++ b/js/lib/mediawiki.DOMPostProcessor.js
@@ -311,6 +311,8 @@ function minimizeInlineTags(root, rewriteable_nodes) {
rewrite(root);
} catch (e) {
console.error(e.stack);
+ // make sure we don't hang
+ process.exit(1);
}
}
@@ -1287,6 +1289,8 @@ DOMPostProcessor.prototype.doPostProcess = function ( document ) {
this.processors[i](document, this.env);
} catch ( e ) {
console.error(e.stack);
+ // make sure we don't hang
+ process.exit(1);
}
}
this.emit( 'document', document );
diff --git a/js/lib/mediawiki.WikitextSerializer.js b/js/lib/mediawiki.WikitextSerializer.js
index <HASH>..<HASH> 100644
--- a/js/lib/mediawiki.WikitextSerializer.js
+++ b/js/lib/mediawiki.WikitextSerializer.js
@@ -1717,6 +1717,8 @@ WSP.serializeDOM = function( node, chunkCB ) {
}
} catch (e) {
console.log(e.stack);
+ // don't hang
+ process.exit(1);
}
};
|
Exit quickly on fatal errors, so we don't hang
Change-Id: I0b<I>b2a<I>dd<I>ba<I>aacb<I>dc<I>c<I>c
|
wikimedia_parsoid
|
train
|
js,js
|
7de537284f929bf7d24346759d783aae87727e66
|
diff --git a/src/cli.js b/src/cli.js
index <HASH>..<HASH> 100755
--- a/src/cli.js
+++ b/src/cli.js
@@ -25,6 +25,14 @@ const argv = yargs
describe: 'JSON file that contains the metadata for your application',
config: true
})
+ .options('options.depends', { array: true, hidden: true })
+ .options('options.recommends', { array: true, hidden: true })
+ .options('options.suggests', { array: true, hidden: true })
+ .options('options.enhances', { array: true, hidden: true })
+ .options('options.preDepends', { array: true, hidden: true })
+ .options('options.categories', { array: true, hidden: true })
+ .options('options.mimeType', { array: true, hidden: true })
+ .options('options.lintianOverrides', { array: true, hidden: true })
.example('$0 --src dist/app/ --dest dist/installer/ --arch i386', 'use metadata from `dist/app/`')
.example('$0 --src dist/app/ --dest dist/installer/ --config config.json', 'use metadata from `config.json`')
.wrap(null)
|
Ensure that certain CLI options are always parsed as arrays (#<I>)
Fixes #<I>.
|
electron-userland_electron-installer-debian
|
train
|
js
|
99c81de45f403416908e06cb97b0811a4306bc6b
|
diff --git a/level.go b/level.go
index <HASH>..<HASH> 100644
--- a/level.go
+++ b/level.go
@@ -67,7 +67,10 @@ var Levels = map[Level]*LevelMetadata{
},
}
-func fromLevelName(levelName string) Level {
+// ParseLevel returns a `golog.Level` from a string level.
+// Note that all existing log levels (name, prefix and color) can be customized
+// and new one can be added by the package-level `golog.Levels` map variable.
+func ParseLevel(levelName string) Level {
for level, meta := range Levels {
if meta.Name == levelName {
return level
diff --git a/logger.go b/logger.go
index <HASH>..<HASH> 100644
--- a/logger.go
+++ b/logger.go
@@ -185,7 +185,7 @@ func (l *Logger) DisableNewLine() *Logger {
// Returns itself.
func (l *Logger) SetLevel(levelName string) *Logger {
l.mu.Lock()
- l.Level = fromLevelName(levelName)
+ l.Level = ParseLevel(levelName)
l.mu.Unlock()
return l
|
export the fromLevelName to 'golog.ParseLevel'
|
kataras_golog
|
train
|
go,go
|
1e8f05b0eebc0fc37b3dbfbe3b4440a97d512b03
|
diff --git a/lib/unidom/common/version.rb b/lib/unidom/common/version.rb
index <HASH>..<HASH> 100644
--- a/lib/unidom/common/version.rb
+++ b/lib/unidom/common/version.rb
@@ -1,5 +1,5 @@
module Unidom
module Common
- VERSION = '1.7.2'.freeze
+ VERSION = '1.8'.freeze
end
end
|
1, Migrate the version from <I> to <I>.
|
topbitdu_unidom-common
|
train
|
rb
|
63e586586b250e029c3edcde7584d1eef5a107f8
|
diff --git a/src/main/java/org/jboss/netty/handler/timeout/WriteTimeoutHandler.java b/src/main/java/org/jboss/netty/handler/timeout/WriteTimeoutHandler.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jboss/netty/handler/timeout/WriteTimeoutHandler.java
+++ b/src/main/java/org/jboss/netty/handler/timeout/WriteTimeoutHandler.java
@@ -38,7 +38,7 @@ import org.jboss.netty.util.ExternalResourceReleasable;
* @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/
-@ChannelPipelineCoverage("one")
+@ChannelPipelineCoverage("all")
public class WriteTimeoutHandler extends SimpleChannelDownstreamHandler implements ExternalResourceReleasable {
static final ChannelWriteTimeoutException EXCEPTION = new ChannelWriteTimeoutException();
|
WriteTimeoutHandler's pipeline coverage is actually "all"
|
netty_netty
|
train
|
java
|
5b9acf23c65fe457739c20e8f27586c1d3ec149c
|
diff --git a/lib/fetch/util.js b/lib/fetch/util.js
index <HASH>..<HASH> 100644
--- a/lib/fetch/util.js
+++ b/lib/fetch/util.js
@@ -195,7 +195,7 @@ function appendFetchMetadata (httpRequest) {
header = httpRequest.mode
// 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.
- httpRequest.headersList.append('sec-fetch-mode', header)
+ httpRequest.headersList.set('sec-fetch-mode', header)
// https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header
// TODO
|
fix(fetch): set don't append sec-fetch-mode
|
mcollina_undici
|
train
|
js
|
46bf6af11b5c0a8c52df11286761fd9a66f44d10
|
diff --git a/src/Keboola/StorageApi/Client.php b/src/Keboola/StorageApi/Client.php
index <HASH>..<HASH> 100644
--- a/src/Keboola/StorageApi/Client.php
+++ b/src/Keboola/StorageApi/Client.php
@@ -1291,7 +1291,7 @@ class Client
$this->log($message, ['source' => 'AWS SDK PHP debug']);
}
};
- $options['debug'] = [
+ $s3options['debug'] = [
'logfn' => function ($message) use ($logfn) {
call_user_func($logfn, $message);
},
|
fix - upload file aws debug
|
keboola_storage-api-php-client
|
train
|
php
|
f2efea64d79b59fd3d43115fe839d49a32822274
|
diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -89,7 +89,7 @@ module.exports = function(grunt) {
if (!selector_plugins) return;
if (selector_plugins.indexOf(',') !== -1) {
- selector_plugins = '{' + plugins.split(/\s*,\s*/).join(',') + '}';
+ selector_plugins = '{' + selector_plugins.split(/\s*,\s*/).join(',') + '}';
}
// javascript
|
renamed the undefined plugins variable to selector_plugins
|
selectize_selectize.js
|
train
|
js
|
10194de133956fc342fd0cd32e4c53389467f105
|
diff --git a/core/commands/files.go b/core/commands/files.go
index <HASH>..<HASH> 100644
--- a/core/commands/files.go
+++ b/core/commands/files.go
@@ -774,7 +774,7 @@ stat' on the file or any of its ancestors.
if retErr == nil {
retErr = err
} else {
- log.Error("files: error closing file mfs file descriptor", err)
+ flog.Error("files: error closing file mfs file descriptor", err)
}
}
}()
|
core/commands/files: log.Error -> flog.Error
This seems like a tiny leftover.
|
ipfs_go-ipfs
|
train
|
go
|
ed5a686c6e741d9a0c8ebdfa2e2d7db2735d8ce6
|
diff --git a/src/Endpoint/Abstracts/AbstractModelEndpoint.php b/src/Endpoint/Abstracts/AbstractModelEndpoint.php
index <HASH>..<HASH> 100644
--- a/src/Endpoint/Abstracts/AbstractModelEndpoint.php
+++ b/src/Endpoint/Abstracts/AbstractModelEndpoint.php
@@ -126,7 +126,7 @@ abstract class AbstractModelEndpoint extends AbstractSmartEndpoint implements Mo
$idKey = $this->modelIdKey();
if ($id !== null) {
if (isset($this->attributes[$idKey])) {
- $this->reset();
+ $this->clear();
}
$this->set($idKey, $id);
} else if (!isset($this->attributes[$idKey])) {
|
Don't reset Model, just Clear the attributes
|
MichaelJ2324_PHP-REST-Client
|
train
|
php
|
d4f73e49e19823e13efb3be336e0126b38b1ff39
|
diff --git a/lib/json_api_client/helpers/callbacks.rb b/lib/json_api_client/helpers/callbacks.rb
index <HASH>..<HASH> 100644
--- a/lib/json_api_client/helpers/callbacks.rb
+++ b/lib/json_api_client/helpers/callbacks.rb
@@ -4,26 +4,8 @@ module JsonApiClient
extend ActiveSupport::Concern
included do
- include ActiveSupport::Callbacks
- define_callbacks :save, :destroy, :create, :update
- end
-
- module ClassMethods
-
- [:save, :destroy, :create, :update].each do |operation|
- [:before, :after, :around].each do |type|
- define_method "#{type}_#{operation}" do |*methods, &block|
-
- if block
- set_callback operation, type, *methods, block
- else
- set_callback operation, type, *methods
- end
-
- end
- end
- end
-
+ extend ActiveModel::Callbacks
+ define_model_callbacks :save, :destroy, :create, :update
end
def save
@@ -40,7 +22,6 @@ module JsonApiClient
end
end
-
end
end
end
|
utilize ActiveModel::Callbacks which is a cleaner interface than ActiveSupport::Callbacks (it does use AS:C under the hood)
|
JsonApiClient_json_api_client
|
train
|
rb
|
aa0dcd971177458a701161c64b2ceb78c9fbdf16
|
diff --git a/webpack.config.dev.js b/webpack.config.dev.js
index <HASH>..<HASH> 100644
--- a/webpack.config.dev.js
+++ b/webpack.config.dev.js
@@ -1,6 +1,11 @@
const path = require('path');
module.exports = {
+ devServer: {
+ historyApiFallback: {
+ index: '/docs/'
+ }
+ },
entry: {
index: './docs/index.js',
},
|
webpack dev config for spa
|
Canner_canner
|
train
|
js
|
587acdc824ee409f507c3f313149b20d6cab157c
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -7,5 +7,5 @@ setup(
description="""Wrapper to the ArcGIS REST API, and a Python analogue to the Javascript APIs""",
author="ESRI",
author_email="jscheirer@esri.com",
- packages=['arcrest']
+ packages=['arcrest', 'arcrest.admin']
)
|
Update to setup.py to include admin subpackage
|
jasonbot_arcrest
|
train
|
py
|
15c6a1752aa248b583e3e0de6edc3130cec8f842
|
diff --git a/options-sanitize.php b/options-sanitize.php
index <HASH>..<HASH> 100755
--- a/options-sanitize.php
+++ b/options-sanitize.php
@@ -175,7 +175,7 @@ function of_sanitize_typography( $input, $option ) {
'color' => ''
) );
- if ( isset( $option['options']['faces'] ) ) {
+ if ( isset( $option['options']['faces'] ) && isset( $input['face'] ) ) {
if ( array_key_exists( $input['face'], $option['options']['faces'] ) ) {
$output['face'] = $input['face'];
}
|
Check that ['face'] is set for restore of defaults.
|
wpplex_wp-options
|
train
|
php
|
4ea0cb79c370f3d8e06005ce2b6bd0220b7ab240
|
diff --git a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php
+++ b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php
@@ -84,7 +84,7 @@ trait InteractsWithDatabase
*/
public function seed($class = 'DatabaseSeeder')
{
- $this->artisan('db:seed', ['--class' => $class]);
+ $this->artisan('db:seed', ['--class' => $class, '--no-interaction' => true]);
return $this;
}
|
Update InteractsWithDatabase.php (#<I>)
|
laravel_framework
|
train
|
php
|
d74da81b4465bdbc0e1f826fded3f60fce148b0e
|
diff --git a/src/main/java/hex/glm/GLM2.java b/src/main/java/hex/glm/GLM2.java
index <HASH>..<HASH> 100644
--- a/src/main/java/hex/glm/GLM2.java
+++ b/src/main/java/hex/glm/GLM2.java
@@ -411,10 +411,11 @@ public class GLM2 extends ModelJob {
setHighAccuracy();
_iter = 0;
new GLMIterationTask(GLM2.this,_dinfo,glmt._glm, true, true, true, null,_ymu,_reg,new Iteration()).asyncExec(_dinfo._adaptedFrame);
+ return;
}
checkGradient(newBeta, glmt2.gradient(l2pen()));
if(n_folds > 1) nextLambda(glmt,newBeta); // need to call xval first
- else nextLambda(glmt,glmt._val);
+ else nextLambda(glmt,glmt2._val);
}
}).asyncExec(_dinfo._adaptedFrame);
} else { // already got all the info
|
Fix GLm2 to store validation in all cases.
|
h2oai_h2o-2
|
train
|
java
|
4499ab5fdeca46416cfc4a50a376eba4eb8e16b4
|
diff --git a/activerecord/test/cases/result_test.rb b/activerecord/test/cases/result_test.rb
index <HASH>..<HASH> 100644
--- a/activerecord/test/cases/result_test.rb
+++ b/activerecord/test/cases/result_test.rb
@@ -5,14 +5,16 @@ module ActiveRecord
def result
Result.new(['col_1', 'col_2'], [
['row 1 col 1', 'row 1 col 2'],
- ['row 2 col 1', 'row 2 col 2']
+ ['row 2 col 1', 'row 2 col 2'],
+ ['row 3 col 1', 'row 3 col 2'],
])
end
def test_to_hash_returns_row_hashes
assert_equal [
{'col_1' => 'row 1 col 1', 'col_2' => 'row 1 col 2'},
- {'col_1' => 'row 2 col 1', 'col_2' => 'row 2 col 2'}
+ {'col_1' => 'row 2 col 1', 'col_2' => 'row 2 col 2'},
+ {'col_1' => 'row 3 col 1', 'col_2' => 'row 3 col 2'},
], result.to_hash
end
|
Strengthen test with different nb of rows and columns
|
rails_rails
|
train
|
rb
|
be160249373619ce24cf68b49c46971c84bd8189
|
diff --git a/core-bundle/src/Resources/contao/library/Contao/System.php b/core-bundle/src/Resources/contao/library/Contao/System.php
index <HASH>..<HASH> 100644
--- a/core-bundle/src/Resources/contao/library/Contao/System.php
+++ b/core-bundle/src/Resources/contao/library/Contao/System.php
@@ -451,15 +451,6 @@ abstract class System
static::loadLanguageFile('countries');
include TL_ROOT . '/system/config/countries.php';
- // HOOK: add custom logic
- if (isset($GLOBALS['TL_HOOKS']['getCountries']) && is_array($GLOBALS['TL_HOOKS']['getCountries']))
- {
- foreach ($GLOBALS['TL_HOOKS']['getCountries'] as $callback)
- {
- static::importStatic($callback[0])->$callback[1]($return, $countries);
- }
- }
-
foreach ($countries as $strKey=>$strName)
{
$arrAux[$strKey] = isset($GLOBALS['TL_LANG']['CNT'][$strKey]) ? utf8_romanize($GLOBALS['TL_LANG']['CNT'][$strKey]) : $strName;
|
[Core] Corrected the "getCountries" hook which was executed twice due to a merge error
|
contao_contao
|
train
|
php
|
3ff0349e0c553918ebc64b49de8427e482f01d4f
|
diff --git a/test/android-sdk.js b/test/android-sdk.js
index <HASH>..<HASH> 100644
--- a/test/android-sdk.js
+++ b/test/android-sdk.js
@@ -6,6 +6,7 @@
require("../src/Config").setSilentConsole(true);
var Console = require("../src/Console");
var AndroidSDK = require("../src/AndroidSDK");
+var ShellJS = require("shelljs");
exports.tests = {
@@ -66,6 +67,9 @@ exports.tests = {
// TODO create test project in tmp and test path.
test.equal(true, true);
test.done();
+
+ // Clean up removing project skeleton directory.
+ ShellJS.rm('-rf', path);
}
});
});
|
test: In android-sdk.js::generateProjectTemplate() cleanup after test
Remove the generated project skeleton in com.example.Foo/ so repeatedly
running the test does not fail on an already existing directory.
|
crosswalk-project_crosswalk-app-tools
|
train
|
js
|
6223fef6fbc36578a0cf474bdddca3330939a541
|
diff --git a/java/src/com/google/template/soy/passes/ElementAttributePass.java b/java/src/com/google/template/soy/passes/ElementAttributePass.java
index <HASH>..<HASH> 100644
--- a/java/src/com/google/template/soy/passes/ElementAttributePass.java
+++ b/java/src/com/google/template/soy/passes/ElementAttributePass.java
@@ -271,10 +271,9 @@ final class ElementAttributePass implements CompilerFileSetPass {
boolean iAmAnElementCallingAnElement = !delegateTemplateName.isEmpty();
ImmutableSet.Builder<String> foundNormalAttr = ImmutableSet.builder();
- openTagNode.getChildren().stream()
- .filter(p -> p.getKind() == Kind.HTML_ATTRIBUTE_NODE)
- .map(HtmlAttributeNode.class::cast)
- .filter(attr -> attr.getStaticKey() != null)
+ SoyTreeUtils.getAllMatchingNodesOfType(
+ openTagNode, HtmlAttributeNode.class, attr -> attr.getStaticKey() != null)
+ .stream()
.forEach(
attrNode -> {
String attrKey = attrNode.getStaticKey();
|
Capture reserved attributes within conditionals
GITHUB_BREAKING_CHANGES=n/a
-------------
Created by MOE: <URL>
|
google_closure-templates
|
train
|
java
|
2bb5e1cba3b7e48e2a043671141a7ee6baddbfc6
|
diff --git a/abilian/web/forms/__init__.py b/abilian/web/forms/__init__.py
index <HASH>..<HASH> 100644
--- a/abilian/web/forms/__init__.py
+++ b/abilian/web/forms/__init__.py
@@ -140,7 +140,7 @@ class FormContext(object):
def __enter__(self):
if not has_app_context():
- return
+ return self
self.__existing = getattr(g, '__form_ctx__', None)
if self.__existing:
|
fix FormContext when no app contxt exist yet
|
abilian_abilian-core
|
train
|
py
|
4dc50c22b544ebbc845dbd0a78d37a69c2584b2b
|
diff --git a/pelix/http/basic.py b/pelix/http/basic.py
index <HASH>..<HASH> 100644
--- a/pelix/http/basic.py
+++ b/pelix/http/basic.py
@@ -371,6 +371,19 @@ class _HttpServerFamily(ThreadingMixIn, HTTPServer):
self.server_bind()
self.server_activate()
+
+ def process_request(self, request, client_address):
+ """
+ Starts a new thread to process the request, adding the client address
+ in its name.
+ """
+ thread = threading.Thread(name="HttpService-{0}-Client-{1}"\
+ .format(self.server_port, client_address),
+ target=self.process_request_thread,
+ args=(request, client_address))
+ thread.daemon = self.daemon_threads
+ thread.start()
+
# ------------------------------------------------------------------------------
@ComponentFactory(http.FACTORY_HTTP_BASIC)
@@ -774,10 +787,12 @@ class HttpService(object):
self._logger)
# Property update (if port was 0)
- self._port = self._server.socket.getsockname()[1]
+ self._port = self._server.server_port
# Run it in a separate thread
- self._thread = threading.Thread(target=self._server.serve_forever)
+ self._thread = threading.Thread(target=self._server.serve_forever,
+ name="HttpService-{0}-Server" \
+ .format(self._port))
self._thread.daemon = True
self._thread.start()
|
Threads of the HTTP Service now have a name
Simplifies debugging
|
tcalmant_ipopo
|
train
|
py
|
04d53707075690089e92007612b29cdd0ba87d9e
|
diff --git a/eccodes_grib/messages.py b/eccodes_grib/messages.py
index <HASH>..<HASH> 100644
--- a/eccodes_grib/messages.py
+++ b/eccodes_grib/messages.py
@@ -15,7 +15,7 @@
# limitations under the License.
from __future__ import absolute_import, division, print_function, unicode_literals
-from builtins import bytes
+from builtins import bytes, isinstance, str
import collections
import typing as T # noqa
@@ -122,14 +122,16 @@ class Index(collections.Mapping):
def __len__(self):
return len(self.index_keys)
- def select(self, query):
+ def select(self, dict_query={}, **query):
# type: (T.Dict[str, T.Any]) -> T.Generator[Message, None, None]
+ query.update(dict_query)
if set(query) != set(self.index_keys):
raise ValueError("all index keys must have a value.")
for key, value in query.items():
bkey = key.encode(self.key_encoding)
- bvalue = value.encode(self.value_encoding)
- eccodes.codes_index_select(self.codes_index, bkey, bvalue)
+ if isinstance(value, str):
+ value = value.encode(self.value_encoding)
+ eccodes.codes_index_select(self.codes_index, bkey, value)
while True:
try:
yield Message.fromindex(codes_index=self.codes_index)
|
Nicer select signature and allow non str values.
|
ecmwf_cfgrib
|
train
|
py
|
f2760c8dbb20f3e4be068bc7fb5fd386b90248e7
|
diff --git a/km3pipe/io/jpp.py b/km3pipe/io/jpp.py
index <HASH>..<HASH> 100644
--- a/km3pipe/io/jpp.py
+++ b/km3pipe/io/jpp.py
@@ -28,7 +28,7 @@ __status__ = "Development"
def get_jpp_version():
"""Return the Jpp version or None if not available."""
- command = "JPrint -v"
+ command = "JPrint -v | grep version:"
try:
out = subprocess.getoutput(command)
except AttributeError: # TODO: python 2.7
|
Fix version extraction due to changes to Jpp output
|
tamasgal_km3pipe
|
train
|
py
|
8eaa4160aac9d8a1e3e1284ba3cdee7aa2868a6c
|
diff --git a/src/db/Driver.php b/src/db/Driver.php
index <HASH>..<HASH> 100644
--- a/src/db/Driver.php
+++ b/src/db/Driver.php
@@ -28,6 +28,10 @@ class Driver extends BaseDriver implements BootstrapInterface
* @var string table name
*/
public $tableName = '{{%queue}}';
+ /**
+ * @var boolean ability to delete released messages from table
+ */
+ public $deleteReleased = false;
public function init()
{
@@ -103,11 +107,18 @@ class Driver extends BaseDriver implements BootstrapInterface
*/
public function release($message)
{
- $this->db->createCommand()->update(
- $this->tableName,
- ['finished_at' => time()],
- ['id' => $message['id']]
- )->execute();
+ if ($this->deleteReleased) {
+ $this->db->createCommand()->delete(
+ $this->tableName,
+ ['id' => $message['id']]
+ )->execute();
+ } else {
+ $this->db->createCommand()->update(
+ $this->tableName,
+ ['finished_at' => time()],
+ ['id' => $message['id']]
+ )->execute();
+ }
}
/**
|
Ability to delete released messages from table of DB driver
|
yiisoft_yii2-queue
|
train
|
php
|
c05b699b746ba93aa82b648ede44b207f12d7390
|
diff --git a/LiSE/rule.py b/LiSE/rule.py
index <HASH>..<HASH> 100644
--- a/LiSE/rule.py
+++ b/LiSE/rule.py
@@ -354,7 +354,8 @@ class Rule(object):
curtime = engine.time
for trigger in self.triggers:
result = trigger(engine, *args)
- engine.time = curtime
+ if engine.time != curtime:
+ engine.time = curtime
if result:
return True
return False
|
Don't set the time unnecessarily
This is probably redundant. Feeling a bit paranoid.
|
LogicalDash_LiSE
|
train
|
py
|
ee0505ff520cef2d82e1889b733f7c45edcd55dd
|
diff --git a/micro/orm/creator/Model.php b/micro/orm/creator/Model.php
index <HASH>..<HASH> 100644
--- a/micro/orm/creator/Model.php
+++ b/micro/orm/creator/Model.php
@@ -17,13 +17,14 @@ class Model {
public function addManyToOne($member,$name,$className,$nullable=false){
if(\array_key_exists($member, $this->members)===false){
$this->addMember(new Member($member));
- //$this->removeMember($name);
+ $this->removeMember($name);
}
$this->members[$member]->addManyToOne($name,$className,$nullable);
}
public function removeMember($memberName){
- unset($this->members[$memberName]);
+ if($this->members[$memberName]->isPrimary()===false)
+ unset($this->members[$memberName]);
}
public function addOneToMany($member,$mappedBy,$className){
|
dont remove primary fields in ManyToOne
|
phpMv_ubiquity
|
train
|
php
|
c0de109f83d0cf5af6b65dfca5f8f4189ac10469
|
diff --git a/tasks/dev.js b/tasks/dev.js
index <HASH>..<HASH> 100644
--- a/tasks/dev.js
+++ b/tasks/dev.js
@@ -6,7 +6,7 @@ module.exports = function (gulp, config) {
connect.server({
root: config.example.dist,
fallback: path.join(config.example.dist, 'index.html'),
- port: process.env.PORT || 8000,
+ port: config.example.port || process.env.PORT || 8000,
livereload: true
});
});
|
adding config option for port alongside process.env.PORT
|
JedWatson_react-component-gulp-tasks
|
train
|
js
|
ef771552b74aa03925c201603f9430602192e818
|
diff --git a/actionpack/lib/action_dispatch/routing.rb b/actionpack/lib/action_dispatch/routing.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_dispatch/routing.rb
+++ b/actionpack/lib/action_dispatch/routing.rb
@@ -366,16 +366,5 @@ module ActionDispatch
end
end
end
-
- ActiveSupport::Inflector.module_eval do
- # Ensures that routes are reloaded when Rails inflections are updated.
- def inflections_with_route_reloading(&block)
- returning(inflections_without_route_reloading(&block)) {
- ActionDispatch::Routing::Routes.reload! if block_given?
- }
- end
-
- alias_method_chain :inflections, :route_reloading
- end
end
end
|
Don't really care about reloading routes when inflections are
changed.
|
rails_rails
|
train
|
rb
|
7d3db5e020af7a62080655cbfa316789e4d8d7c7
|
diff --git a/pymemcache/client/base.py b/pymemcache/client/base.py
index <HASH>..<HASH> 100644
--- a/pymemcache/client/base.py
+++ b/pymemcache/client/base.py
@@ -755,6 +755,14 @@ class Client(object):
def _store_cmd(self, name, values, expire, noreply, cas=None):
cmds = []
keys = []
+
+ extra = b''
+ if cas is not None:
+ extra += b' ' + cas
+ if noreply:
+ extra += b' noreply'
+ expire = six.text_type(expire).encode('ascii')
+
for key, data in six.iteritems(values):
# must be able to reliably map responses back to the original order
keys.append(key)
@@ -771,15 +779,9 @@ class Client(object):
except UnicodeEncodeError as e:
raise MemcacheIllegalInputError(str(e))
- extra = b''
- if cas is not None:
- extra += b' ' + cas
- if noreply:
- extra += b' noreply'
-
cmds.append(name + b' ' + key + b' ' +
six.text_type(flags).encode('ascii') +
- b' ' + six.text_type(expire).encode('ascii') +
+ b' ' + expire +
b' ' + six.text_type(len(data)).encode('ascii') +
extra + b'\r\n' + data + b'\r\n')
|
minor tweaks for an extra <I>% gain
|
pinterest_pymemcache
|
train
|
py
|
f838ddc617e81ac3df41ab26dedab8bcab0a2b4b
|
diff --git a/steam/client/user.py b/steam/client/user.py
index <HASH>..<HASH> 100644
--- a/steam/client/user.py
+++ b/steam/client/user.py
@@ -10,7 +10,7 @@ class SteamUser(object):
"""Holds various functionality and data related to a steam user
"""
_pstate = None
- steam_id = SteamID()
+ steam_id = SteamID() #: steam id
relationship = EFriendRelationship.NONE #: friendship status
def __init__(self, steam_id, steam):
|
SteamUser: added docstring for steam_id
|
ValvePython_steam
|
train
|
py
|
4246b9ab1a7fc6a58be2be9a7559ec25754adf6e
|
diff --git a/lib/mongo_mapper.rb b/lib/mongo_mapper.rb
index <HASH>..<HASH> 100644
--- a/lib/mongo_mapper.rb
+++ b/lib/mongo_mapper.rb
@@ -1,5 +1,4 @@
# encoding: UTF-8
-# Make sure you have the correct versions of the gems (see gemspec) in your load path.
require 'plucky'
require 'active_support/all'
require 'active_model'
|
Note no longer needed thanks to bundler
|
mongomapper_mongomapper
|
train
|
rb
|
7ca014e1a88b385cd26b876acb6070a790fa32db
|
diff --git a/FlowCal/mef.py b/FlowCal/mef.py
index <HASH>..<HASH> 100644
--- a/FlowCal/mef.py
+++ b/FlowCal/mef.py
@@ -620,7 +620,7 @@ def get_transform_fxn(data_beads,
2. The fluorescence of each subpopulation is calculated, for each
channel in `mef_channels`.
3. Some subpopulations are then discarded if they are close to either
- the minimum or the maximum cannel range limits. In addition, if the
+ the minimum or the maximum channel range limits. In addition, if the
MEF value of some subpopulation is unknown (represented as a
``np.nan`` in `mef_values`), the whole subpopulation is also
discarded.
|
Fixed typo in mef.get_transform_fxn's docstring.
|
taborlab_FlowCal
|
train
|
py
|
1e174d87673975e512ad644e148bc57eede86b06
|
diff --git a/lib/dalli/server.rb b/lib/dalli/server.rb
index <HASH>..<HASH> 100644
--- a/lib/dalli/server.rb
+++ b/lib/dalli/server.rb
@@ -266,10 +266,10 @@ module Dalli
value = Zlib::Inflate.inflate(value) if (flags & FLAG_COMPRESSED) != 0
value = Marshal.load(value) if (flags & FLAG_MARSHALLED) != 0
value
- rescue TypeError
- raise DalliError, "Unable to unmarshal value: '#{value}'"
+ rescue TypeError, ArgumentError
+ raise DalliError, "Unable to unmarshal value: #{$!.message}"
rescue Zlib::Error
- raise DalliError, "Unable to uncompress value: '#{value}'"
+ raise DalliError, "Unable to uncompress value: #{$!.message}"
end
def cas_response
|
Better handling of unmarshalling issues, closes GH-<I>
|
petergoldstein_dalli
|
train
|
rb
|
cd9e7fbc4f0fc560bb389dfd8ad9b97201ce4bd0
|
diff --git a/pkg/kubectl/resource_printer.go b/pkg/kubectl/resource_printer.go
index <HASH>..<HASH> 100644
--- a/pkg/kubectl/resource_printer.go
+++ b/pkg/kubectl/resource_printer.go
@@ -247,7 +247,7 @@ func (h *HumanReadablePrinter) HandledResources() []string {
var podColumns = []string{"POD", "IP", "CONTAINER(S)", "IMAGE(S)", "HOST", "LABELS", "STATUS", "CREATED", "MESSAGE"}
var podTemplateColumns = []string{"TEMPLATE", "CONTAINER(S)", "IMAGE(S)", "PODLABELS"}
var replicationControllerColumns = []string{"CONTROLLER", "CONTAINER(S)", "IMAGE(S)", "SELECTOR", "REPLICAS"}
-var serviceColumns = []string{"NAME", "LABELS", "SELECTOR", "IP", "PORT(S)"}
+var serviceColumns = []string{"NAME", "LABELS", "SELECTOR", "IP(S)", "PORT(S)"}
var endpointColumns = []string{"NAME", "ENDPOINTS"}
var nodeColumns = []string{"NAME", "LABELS", "STATUS"}
var statusColumns = []string{"STATUS"}
|
Change IP to IP(S) in service columns for kubectl get
|
kubernetes_kubernetes
|
train
|
go
|
2e4a5d6fd17f6cf685f29881f3ae04df73ce058d
|
diff --git a/saltant/models/base_task_instance.py b/saltant/models/base_task_instance.py
index <HASH>..<HASH> 100644
--- a/saltant/models/base_task_instance.py
+++ b/saltant/models/base_task_instance.py
@@ -124,7 +124,7 @@ class BaseTaskInstanceManager(ModelManager):
instance just created.
"""
# Make arguments an empty dictionary if None
- if not arguments:
+ if arguments is None:
arguments = {}
# Create the object
|
Make a test against None slightly better
|
saltant-org_saltant-py
|
train
|
py
|
83546b1062b34cc2431812517a1e3723a5e4b508
|
diff --git a/hazelcast/src/main/java/com/hazelcast/internal/memory/impl/UnsafeUtil.java b/hazelcast/src/main/java/com/hazelcast/internal/memory/impl/UnsafeUtil.java
index <HASH>..<HASH> 100644
--- a/hazelcast/src/main/java/com/hazelcast/internal/memory/impl/UnsafeUtil.java
+++ b/hazelcast/src/main/java/com/hazelcast/internal/memory/impl/UnsafeUtil.java
@@ -36,12 +36,12 @@ public final class UnsafeUtil {
/**
* If this constant is {@code true}, then {@link #UNSAFE} refers to a usable {@link sun.misc.Unsafe} instance.
*/
- static final boolean UNSAFE_AVAILABLE;
+ public static final boolean UNSAFE_AVAILABLE;
/**
* The {@link sun.misc.Unsafe} instance which is available and ready to use.
*/
- static final Unsafe UNSAFE;
+ public static final Unsafe UNSAFE;
private static final ILogger LOGGER = Logger.getLogger(UnsafeUtil.class);
|
Made UnsafeUtil constants public
Made UnsafeUtil constants public, so they can be used instead of the
deprecated UnsafeHelper. This is important for dependent projects like
Hazelcast Hibernate, which still use the outdated class. We also have
to fix this, since Hazelcast itself has a cyclic dependency on those
external modules.
|
hazelcast_hazelcast
|
train
|
java
|
86eb4800d64caa961b526986497ea5196d425ac5
|
diff --git a/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java b/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java
index <HASH>..<HASH> 100644
--- a/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java
+++ b/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java
@@ -1171,7 +1171,8 @@ public class TypeAnnotations {
scan(tree.clazz);
scan(tree.args);
- scan(tree.def);
+ // The class body will already be scanned.
+ // scan(tree.def);
}
@Override
@@ -1242,5 +1243,10 @@ public class TypeAnnotations {
}
}
}
+
+ @Override
+ public String toString() {
+ return super.toString() + ": sigOnly: " + sigOnly;
+ }
}
}
|
Prevent duplicate visit for anonymous classes.
Improve debugging output.
|
wmdietl_jsr308-langtools
|
train
|
java
|
97797f9c98a0f764811648d25a9252f72eb4b1d8
|
diff --git a/test/www/jxcore/lib/wifiBasedNativeMock.js b/test/www/jxcore/lib/wifiBasedNativeMock.js
index <HASH>..<HASH> 100644
--- a/test/www/jxcore/lib/wifiBasedNativeMock.js
+++ b/test/www/jxcore/lib/wifiBasedNativeMock.js
@@ -919,16 +919,23 @@ var setupListeners = function (thaliWifiInfrastructure) {
}
var peerAvailable = !!wifiPeer.hostAddress;
+ var oldPeer = peerAvailabilities[wifiPeer.peerIdentifier];
+ var isSamePeer = peerAvailable && oldPeer &&
+ oldPeer.generation === wifiPeer.generation;
+
if (peerAvailable) {
peerAvailabilities[wifiPeer.peerIdentifier] = wifiPeer;
} else {
delete peerAvailabilities[wifiPeer.peerIdentifier];
}
- peerAvailabilityChangedCallback([{
- peerIdentifier: wifiPeer.peerIdentifier,
- peerAvailable: peerAvailable,
- generation: wifiPeer.generation
- }]);
+
+ if (!isSamePeer) {
+ peerAvailabilityChangedCallback([{
+ peerIdentifier: wifiPeer.peerIdentifier,
+ peerAvailable: peerAvailable,
+ generation: wifiPeer.generation
+ }]);
+ }
}
);
thaliWifiInfrastructure.on(
|
Changed wifiPeerAvailabilityChanged in wifiBasedNativeMock
|
thaliproject_Thali_CordovaPlugin
|
train
|
js
|
ab46cd5672e96865997c0f53d8dc59e7cb0ccb09
|
diff --git a/renku/ui/service/serializers/cache.py b/renku/ui/service/serializers/cache.py
index <HASH>..<HASH> 100644
--- a/renku/ui/service/serializers/cache.py
+++ b/renku/ui/service/serializers/cache.py
@@ -115,7 +115,7 @@ class ProjectCloneContext(RepositoryCloneRequest):
def set_missing_id(self, data, **kwargs):
"""Set project_id when missing."""
if not data.get("project_id"):
- data["project_id"] = lambda: uuid.uuid4().hex
+ data["project_id"] = uuid.uuid4().hex
return data
|
fix(service): fix project_id not being autogenerated if missing in request schema (#<I>)
|
SwissDataScienceCenter_renku-python
|
train
|
py
|
fa0cfc6014d4f951df2d5a196d917506024cdb7a
|
diff --git a/openquake/commonlib/oqvalidation.py b/openquake/commonlib/oqvalidation.py
index <HASH>..<HASH> 100644
--- a/openquake/commonlib/oqvalidation.py
+++ b/openquake/commonlib/oqvalidation.py
@@ -422,6 +422,9 @@ class OqParam(valid.ParamSet):
if self.risk_investigation_time is None:
raise InvalidFile('Please set the risk_investigation_time in'
' %s' % job_ini)
+ elif self.aggregate_by:
+ raise InvalidFile('aggregate_by cannot be set in %s [not ebrisk]'
+ % job_ini)
# check for GMFs from file
if (self.inputs.get('gmfs', '').endswith('.csv')
|
Forbidded aggregate_by except in ebrisk
|
gem_oq-engine
|
train
|
py
|
9eec6f8ff148cf34099b5124c3fdfa9c59109120
|
diff --git a/debug/abaaso.js b/debug/abaaso.js
index <HASH>..<HASH> 100644
--- a/debug/abaaso.js
+++ b/debug/abaaso.js
@@ -1618,12 +1618,9 @@ if (typeof global.abaaso === "undefined") global.abaaso = (function () {
asc = /\s*asc$/i,
desc = /\s*desc$/i,
nil = /^null/,
- self = this,
key = this.key,
result = [],
- order = [],
records = [],
- registry = {},
bucket;
queries.each(function (query) { if (String(query).isEmpty()) throw Error(label.error.invalidArguments); });
|
Removed unneeded variables from data.sort
|
avoidwork_abaaso
|
train
|
js
|
d67fb44803f19a7e009db663aab8268377d5fb23
|
diff --git a/thumbor/loaders/http_loader.py b/thumbor/loaders/http_loader.py
index <HASH>..<HASH> 100644
--- a/thumbor/loaders/http_loader.py
+++ b/thumbor/loaders/http_loader.py
@@ -77,6 +77,7 @@ def return_contents(response, url, callback, context):
context.metrics.timing('original_image.time_info.' + x, response.time_info[x] * 1000)
context.metrics.timing('original_image.time_info.bytes_per_second', len(response.body) / response.time_info['total'])
result.buffer = response.body
+ context.metrics.incr('original_image.response_bytes', len(response.body))
callback(result)
|
measure the size of the images loaded via http
we recently had an incident where the resource-consumption of our thumbor cluster skyrocketed and we assume that it was because of increased sizes of images that are fetched from S3. having the size of the response body would have been a great help to triage the issue.
|
thumbor_thumbor
|
train
|
py
|
4323024f75b688f1ec7ccc7d18cab7775da9f4d1
|
diff --git a/TheCannon/run_lamost_example.py b/TheCannon/run_lamost_example.py
index <HASH>..<HASH> 100644
--- a/TheCannon/run_lamost_example.py
+++ b/TheCannon/run_lamost_example.py
@@ -38,8 +38,8 @@ dataset.diagnostics_ref_labels()
#dataset.continuum_normalize()
# learn the model from the reference_set
-#model = CannonModel(dataset, 2) # 2 = quadratic model
-#model.fit() # model.train would work equivalently.
+model = CannonModel(dataset, 2) # 2 = quadratic model
+model.fit() # model.train would work equivalently.
# check the model
#model.diagnostics()
|
update dataset with normalized spectra
|
annayqho_TheCannon
|
train
|
py
|
2ad72993e470ff21ae62153411fb9c10be5caf63
|
diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -12,7 +12,9 @@
#
import os
import sys
-sys.path.insert(0, os.path.abspath('../pyemu'))
+sys.path.insert(0, os.path.join('..','pyemu'))
+sys.path.append(os.path.join(".."))
+
# -- Project information -----------------------------------------------------
@@ -38,6 +40,7 @@ extensions.append('autoapi.extension')
autoapi_type = 'python'
autoapi_dirs = [os.path.join('..','pyemu')]
+
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
|
more attempts at rdt build
|
jtwhite79_pyemu
|
train
|
py
|
6bcf22c5328ed710af444862270fac43a97b39b3
|
diff --git a/lib/UnsafeCachePlugin.js b/lib/UnsafeCachePlugin.js
index <HASH>..<HASH> 100644
--- a/lib/UnsafeCachePlugin.js
+++ b/lib/UnsafeCachePlugin.js
@@ -17,6 +17,7 @@ function getCacheId(request) {
return JSON.stringify({
context: request.context,
path: request.path,
+ query: request.query,
request: request.request
});
}
|
Include query when caching webpack-bug #<I>
|
webpack_enhanced-resolve
|
train
|
js
|
c4643bdbd89a48bed05b78e75e92b43603d2deca
|
diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Database/Eloquent/Model.php
+++ b/src/Illuminate/Database/Eloquent/Model.php
@@ -1604,9 +1604,9 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab
if ($this->incrementing) {
$this->insertAndSetId($query, $attributes);
}
-
- // If the table is not incrementing we'll simply insert this attributes as they
- // are, as this attributes arrays must contain an "id" column already placed
+
+ // If the table isn't incrementing we'll simply insert these attributes as they
+ // are. These attribute arrays must contain an "id" column previously placed
// there by the developer as the manually determined key for these models.
else {
$query->insert($attributes);
|
Fixed tenses in comment
"attributes" and "arrays" are plural, so "these" should be used rather than "this". Also, "attributes arrays" should be "attribute arrays", I'm pretty sure. You wouldn't say "There are two cars lots", right?
|
laravel_framework
|
train
|
php
|
2d2f1464d462de8e1debe3322e733bd2412269fc
|
diff --git a/test/integration/server/calendarserver.php b/test/integration/server/calendarserver.php
index <HASH>..<HASH> 100644
--- a/test/integration/server/calendarserver.php
+++ b/test/integration/server/calendarserver.php
@@ -63,6 +63,12 @@ $server->addPlugin(
);
+/* WebDAV Sync */
+$server->addPlugin(
+ new Sabre\DAV\Sync\Plugin()
+);
+
+
// Support for html frontend
$browser = new Sabre\DAV\Browser\Plugin();
$server->addPlugin($browser);
|
Enable webdav-sync
Does this work?
|
lambdabaa_dav
|
train
|
php
|
29af24e0205914077d89ab7d3fc5d76600df64fe
|
diff --git a/src/components/cursor.js b/src/components/cursor.js
index <HASH>..<HASH> 100644
--- a/src/components/cursor.js
+++ b/src/components/cursor.js
@@ -275,7 +275,11 @@ module.exports.Component = registerComponent('cursor', {
}
// Unset current intersection.
- if (this.intersectedEl) { this.clearCurrentIntersection(); }
+ if (this.intersectedEl) {
+ this.clearCurrentIntersection();
+ // Already intersecting.
+ if (this.intersectedEl === intersectedEl) { return; }
+ }
this.setIntersection(intersectedEl, intersection);
},
|
fix not emitting click event twice in a intersection
If a intersection has already been processed in
clearCurrentIntersection, it isn't necessary to process it any more.
|
aframevr_aframe
|
train
|
js
|
e3675dca7ce888649af31552e7c700b97bcd418a
|
diff --git a/azure-mgmt-eventgrid/tests/test_azure_mgmt_eventgrid.py b/azure-mgmt-eventgrid/tests/test_azure_mgmt_eventgrid.py
index <HASH>..<HASH> 100644
--- a/azure-mgmt-eventgrid/tests/test_azure_mgmt_eventgrid.py
+++ b/azure-mgmt-eventgrid/tests/test_azure_mgmt_eventgrid.py
@@ -42,7 +42,7 @@ class MgmtEventGridTest(AzureMgmtTestCase):
self.assertEqual(topic.name, topic_name)
# Create a new event subscription to this topic
- scope = "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/" + resource_group.name + "/providers/Microsoft.EventGrid/topics/" + topic_name
+ scope = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/" + resource_group.name + "/providers/Microsoft.EventGrid/topics/" + topic_name
destination = azure.mgmt.eventgrid.models.WebHookEventSubscriptionDestination("https://requestb.in/upue0lup")
filter = azure.mgmt.eventgrid.models.EventSubscriptionFilter()
|
Resetting the subscription ID to enable playback of tests.
|
Azure_azure-sdk-for-python
|
train
|
py
|
bc03c29216b5d1ddc401fa4020eb7bd4a459b289
|
diff --git a/telethon/tl/custom/message.py b/telethon/tl/custom/message.py
index <HASH>..<HASH> 100644
--- a/telethon/tl/custom/message.py
+++ b/telethon/tl/custom/message.py
@@ -46,7 +46,7 @@ class Message(ChatGetter, SenderGetter):
self._sender = entities.get(self._sender_id)
if self._sender:
self._input_sender = get_input_peer(self._sender)
- if not getattr(self._input_sender, 'access_hash', None):
+ if not getattr(self._input_sender, 'access_hash', True):
self._input_sender = None
else:
self._input_sender = None
@@ -64,8 +64,10 @@ class Message(ChatGetter, SenderGetter):
self._input_chat = input_chat
if not self._input_chat and self._chat:
self._input_chat = get_input_peer(self._chat)
- if not getattr(self._input_sender, 'access_hash', None):
+ if not getattr(self._input_chat, 'access_hash', True):
# Telegram may omit the hash in updates -> invalid peer
+ # However things like InputPeerSelf() or InputPeerChat(id)
+ # are still valid so default to getting "True" on not found
self._input_chat = None
if getattr(self.original_message, 'fwd_from', None):
|
Fix logical bugs when getting input peers in custom.Message
Such as incorrectly handling InputPeerSelf/InputPeerChat and
using self._input_sender when self._input_chat was expected.
|
LonamiWebs_Telethon
|
train
|
py
|
ed1e758bf97250b06219269c53cecfe4d89ae157
|
diff --git a/querydsl-sql-codegen/src/main/java/com/querydsl/sql/codegen/ExtendedBeanSerializer.java b/querydsl-sql-codegen/src/main/java/com/querydsl/sql/codegen/ExtendedBeanSerializer.java
index <HASH>..<HASH> 100644
--- a/querydsl-sql-codegen/src/main/java/com/querydsl/sql/codegen/ExtendedBeanSerializer.java
+++ b/querydsl-sql-codegen/src/main/java/com/querydsl/sql/codegen/ExtendedBeanSerializer.java
@@ -29,6 +29,8 @@ import com.querydsl.sql.codegen.support.PrimaryKeyData;
* {@code ExtendedBeanSerializer} outputs primary key based {@code equals}, {@code hashCode} and
* {@code toString} implementations
*
+ * Requires column annotation generation to be enabled
+ *
* @author tiwe
*
*/
|
Added note on requirement of columnAnnotation for ExtendedBeanSerializer
|
querydsl_querydsl
|
train
|
java
|
80d3c47b44878bf1d3052cfc30a6aff211d99167
|
diff --git a/packages/cx-google-maps/src/MarkerClusterer.js b/packages/cx-google-maps/src/MarkerClusterer.js
index <HASH>..<HASH> 100644
--- a/packages/cx-google-maps/src/MarkerClusterer.js
+++ b/packages/cx-google-maps/src/MarkerClusterer.js
@@ -46,8 +46,9 @@ export class MarkerClusterer extends PureContainer {
exclude: { averageCenter: true },
});
- // TODO: Expand as needed
- if (changes.gridSize || changes.minimumClusterSize) markerClusterer.repaint();
+ // TODO: See if any changes should be omitted from repaint
+ if (changes && Object.keys(changes).length)
+ markerClusterer.repaint();
}
initMarkerClusterer(context, instance) {
|
MarkerClusterer: repaint on other changes
|
codaxy_cx-google-maps
|
train
|
js
|
badc72a084f3d28538a459bf7d1f7173811bc25d
|
diff --git a/classes/PodsAPI.php b/classes/PodsAPI.php
index <HASH>..<HASH> 100644
--- a/classes/PodsAPI.php
+++ b/classes/PodsAPI.php
@@ -11397,10 +11397,10 @@ class PodsAPI {
*/
public function get_storage_types() {
$storage_types = [
- 'none' => _x( 'None (No Fields)', 'storage type label', 'pods' ),
- 'options' => _x( 'Options', 'storage type label', 'pods' ),
- 'meta' => _x( 'Meta', 'storage type label', 'pods' ),
- 'table' => _x( 'Table', 'storage type label', 'pods' ),
+ 'none' => _x( 'None (No Fields)', 'storage type label', 'pods' ),
+ 'option' => _x( 'Options', 'storage type label', 'pods' ),
+ 'meta' => _x( 'Meta', 'storage type label', 'pods' ),
+ 'table' => _x( 'Table', 'storage type label', 'pods' ),
];
/**
|
Use ‘option’ instead of ‘options’ for settings storage (more uniformly)
|
pods-framework_pods
|
train
|
php
|
915a37f5caad54b0b7ee893543b81c6057d58500
|
diff --git a/addok/core.py b/addok/core.py
index <HASH>..<HASH> 100644
--- a/addok/core.py
+++ b/addok/core.py
@@ -65,6 +65,8 @@ class Result(object):
def __init__(self, _id):
doc = DB.hgetall(_id)
for key, value in doc.items():
+ if key.startswith(b'h|'):
+ continue
setattr(self, key.decode(), value.decode())
self.score = float(self.importance)
|
Do not create a Result attr for each housenumber
|
addok_addok
|
train
|
py
|
7bbc0353826bb701a5cd96d8f8082c2f1be3429a
|
diff --git a/nodeconductor/structure/views.py b/nodeconductor/structure/views.py
index <HASH>..<HASH> 100644
--- a/nodeconductor/structure/views.py
+++ b/nodeconductor/structure/views.py
@@ -1007,6 +1007,7 @@ class ServiceSettingsViewSet(core_mixins.EagerLoadMixin,
if obj is None:
return
+ # TODO [TM:3/21/17] clean it up after WAL-634. Clean up service settings update tests as well.
if obj.customer and not obj.shared:
return permissions.is_owner(request, view, obj)
else:
|
Link code to the issue through TODO [WAL-<I>]
|
opennode_waldur-core
|
train
|
py
|
9079e77d4ca8fedc62c2040f691dfd2e7205217d
|
diff --git a/distutils/sysconfig.py b/distutils/sysconfig.py
index <HASH>..<HASH> 100644
--- a/distutils/sysconfig.py
+++ b/distutils/sysconfig.py
@@ -165,9 +165,8 @@ def _get_python_inc_from_config(plat_specific, spec_prefix):
platform Python installation, while the current Python
executable is from the build platform installation.
"""
- if not spec_prefix:
- return
- return get_config_var('CONF' * plat_specific + 'INCLUDEPY')
+ if spec_prefix is None:
+ return get_config_var('CONF' * plat_specific + 'INCLUDEPY')
def _get_python_inc_posix_prefix(prefix):
|
Fix, again, finding headers during cross compiling
|
pypa_setuptools
|
train
|
py
|
c9ad9dedaf4ca2d779529631963794ea3cf71a91
|
diff --git a/src/models/observation.js b/src/models/observation.js
index <HASH>..<HASH> 100644
--- a/src/models/observation.js
+++ b/src/models/observation.js
@@ -76,7 +76,7 @@ module.exports = (sequelize, DataTypes) => {
this.setDataValue('phenomenonTime', new Date(value).toISOString());
}
},
- result: { type: DataTypes.JSONB, allowNull: false },
+ result: { type: DataTypes.STRING, allowNull: false },
resultTime: {
// Note: Many resource-constrained sensing devices do not have a clock.
// As a result, a client may omit resultTime when POST new Observations,
|
Amend result data type from #<I> (#<I>)
|
mozilla-sensorweb_sensorthings
|
train
|
js
|
6b24c01a1bdf8a79ede56f2316c228c8c2b7bdf2
|
diff --git a/temporal_data.py b/temporal_data.py
index <HASH>..<HASH> 100644
--- a/temporal_data.py
+++ b/temporal_data.py
@@ -161,6 +161,16 @@ class CpredicateAnchor:
self.node = node
+
+ def get_node(self):
+ """
+ Returns the node of the element
+ @rtype: xml Element
+ @return: the node of the element
+ """
+ return self.node
+
+
def set_id(self,this_id):
"""
Set the identifier for the token
|
added get_node function to predicateAnchor
|
cltl_KafNafParserPy
|
train
|
py
|
3ff27d33eb9791f1d3c687256e016b69fb0d777b
|
diff --git a/lib/virtualbox.js b/lib/virtualbox.js
index <HASH>..<HASH> 100644
--- a/lib/virtualbox.js
+++ b/lib/virtualbox.js
@@ -24,4 +24,12 @@ Provider.prototype.halt = function (name, node, callback) {
// ---
+Provider.prototype.shellSpec = function (name, node, callback) {
+ // TODO: add code here
+ callback(new Error('VirtualBox provider not implemented'));
+ //
+};
+
+// ---
+
exports.Provider = Provider;
|
Added method to extract shell specs.
|
websecurify_node-vortex
|
train
|
js
|
1b3b1485d12f446f87132c6351fb2211af87d655
|
diff --git a/ext/qml/extconf.rb b/ext/qml/extconf.rb
index <HASH>..<HASH> 100644
--- a/ext/qml/extconf.rb
+++ b/ext/qml/extconf.rb
@@ -11,6 +11,7 @@ class Configurator
find_dependencies
@cppflags = []
@ldflags = []
+ @debug_enabled = enable_config('debug')
end
def find_dependencies
@@ -35,9 +36,10 @@ class Configurator
def build_plugins
puts "building plugins..."
+ qmake_opts = @debug_enabled ? 'CONFIG+=debug' : ''
Pathname(__FILE__).+("../plugins").children.select(&:directory?).each do |dir|
Dir.chdir(dir) do
- system("#{@qmake}") && system('make') or abort "failed to build plugin: #{dir.basename}"
+ system("#{@qmake} #{qmake_opts}") && system('make clean') && system('make') or abort "failed to build plugin: #{dir.basename}"
end
end
end
@@ -65,7 +67,7 @@ class Configurator
end
$CPPFLAGS += " -std=c++11 -Wall -Wextra -pipe"
- if enable_config('debug')
+ if @debug_enabled
$CPPFLAGS += " -O0 -ggdb3"
else
$CPPFLAGS += " -O3"
|
Improve plugin build in extconf.rb
|
seanchas116_ruby-qml
|
train
|
rb
|
dfd9d82c0e5acad090bf90f55e2238038a84f491
|
diff --git a/packages/ember-views/lib/views/component.js b/packages/ember-views/lib/views/component.js
index <HASH>..<HASH> 100644
--- a/packages/ember-views/lib/views/component.js
+++ b/packages/ember-views/lib/views/component.js
@@ -48,7 +48,7 @@ function validateAction(component, actionName) {
```handlebars
<!-- app-profile template -->
<h1>{{person.title}}</h1>
- <img {{bind-attr src=person.avatar}}>
+ <img src={{person.avatar}}>
<p class='signature'>{{person.signature}}</p>
```
|
[DOC release] Remove `{{bind-attr}}` in Component Docs
|
emberjs_ember.js
|
train
|
js
|
dda48a0cea7d996cbba53b8f06871ebd44a1c0bb
|
diff --git a/ui/js/pods-dfv/_src/pick/views/select-view.js b/ui/js/pods-dfv/_src/pick/views/select-view.js
index <HASH>..<HASH> 100644
--- a/ui/js/pods-dfv/_src/pick/views/select-view.js
+++ b/ui/js/pods-dfv/_src/pick/views/select-view.js
@@ -357,7 +357,7 @@ export const SelectView = Marionette.CollectionView.extend( {
}
// Initialize select2
- $select2.selectWoo( jQuery.extend( select2Options, select2Overrides ) );
+ $select2.selectWoo( jQuery.extend( true, select2Options, select2Overrides ) );
// Get a reference to the ul container of the visual UI portion. Can't do this until select2 is initialized
$ulContainer = $select2.parent().find( SELECT2_UL_TARGET );
|
Force extend to do a deep merge
|
pods-framework_pods
|
train
|
js
|
528ea5a872d1d547154e4a164cca19db804d50e4
|
diff --git a/aws-sdk-core/spec/aws/xml/builder_spec.rb b/aws-sdk-core/spec/aws/xml/builder_spec.rb
index <HASH>..<HASH> 100644
--- a/aws-sdk-core/spec/aws/xml/builder_spec.rb
+++ b/aws-sdk-core/spec/aws/xml/builder_spec.rb
@@ -234,6 +234,16 @@ module Aws
XML
end
+ it 'correctly serializes newlines' do
+ expect(xml(string:"\n")).to eq(<<-XML)
+<xml>
+ <String>
+</String>
+</xml>
+ XML
+ end
+
+
it 'applies xml attribute members to the structure' do
shapes['StructureShape']['members']['String']['xmlAttribute'] = true
shapes['StructureShape']['members']['String']['locationName'] = 'encode'
|
Added a test to cover XML newline strings.
|
aws_aws-sdk-ruby
|
train
|
rb
|
3af05719ade023118a65f00983d6623a988dfdac
|
diff --git a/app/angular/src/server/index.js b/app/angular/src/server/index.js
index <HASH>..<HASH> 100755
--- a/app/angular/src/server/index.js
+++ b/app/angular/src/server/index.js
@@ -159,7 +159,9 @@ Promise.all([webpackValid, serverListening])
}
})
.catch(error => {
- logger.error(error);
+ if (error instanceof Error) {
+ logger.error(error);
+ }
if (program.smokeTest) {
process.exit(1);
}
|
Integrate changes from #<I> into app/angular
|
storybooks_storybook
|
train
|
js
|
fadb954676f2627d7211e8fa723de65b539c9a7d
|
diff --git a/salt/state.py b/salt/state.py
index <HASH>..<HASH> 100644
--- a/salt/state.py
+++ b/salt/state.py
@@ -1585,10 +1585,10 @@ class State(object):
inject_globals['__env__'] = 'base'
if 'result' not in ret or ret['result'] is False:
- with context.func_globals_inject(self.states[cdata['full']],
- **inject_globals):
- ret = self.states[cdata['full']](*cdata['args'],
- **cdata['kwargs'])
+ self.states.inject_globals = inject_globals
+ ret = self.states[cdata['full']](*cdata['args'],
+ **cdata['kwargs'])
+ self.states.inject_globals = {}
if 'check_cmd' in low and '{0[state]}.mod_run_check_cmd'.format(low) not in self.states:
ret.update(self._run_check_cmd(low))
self.verify_ret(ret)
|
Use new method for injecting globals into state functions
|
saltstack_salt
|
train
|
py
|
e373070e6c8f03fb4be8cadfe52ecce8ae8dd0ae
|
diff --git a/world/components.go b/world/components.go
index <HASH>..<HASH> 100644
--- a/world/components.go
+++ b/world/components.go
@@ -374,6 +374,12 @@ func (maker ComponentMaker) garden(includeDefaultStack bool) ifrit.Runner {
config.ExecRunnerBin = filepath.Join(maker.GardenConfig.GardenBinPath, "dadoo")
config.NSTarBin = filepath.Join(maker.GardenConfig.GardenBinPath, "nstar")
config.RuntimePluginBin = filepath.Join(maker.GardenConfig.GardenBinPath, "runc")
+ ports, err := maker.PortAllocator.ClaimPorts(10)
+ startPort := int(ports)
+ poolSize := 10
+ Expect(err).NotTo(HaveOccurred())
+ config.PortPoolStart = &startPort
+ config.PortPoolSize = &poolSize
config.DefaultRootFS = defaultRootFS
|
use the port allocator to allocate garden's port pool
|
cloudfoundry_inigo
|
train
|
go
|
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.