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
|
---|---|---|---|---|---|
41afa5e683b1d53b196f31a04ec49588538dd31f | diff --git a/lib/popstar/migration.rb b/lib/popstar/migration.rb
index <HASH>..<HASH> 100644
--- a/lib/popstar/migration.rb
+++ b/lib/popstar/migration.rb
@@ -8,7 +8,7 @@ module Popstar
rules.each do |rule|
if rule[:action] == :create
rule[:model].all.each do |model|
- model.send(target).inc(:popularity, rule[:rate].call(model))
+ model.send(target).try(:inc, :popularity, rule[:rate].call(model))
end
end
end
diff --git a/lib/popstar/version.rb b/lib/popstar/version.rb
index <HASH>..<HASH> 100644
--- a/lib/popstar/version.rb
+++ b/lib/popstar/version.rb
@@ -1,3 +1,3 @@
module Popstar
- VERSION = "0.0.3.5"
+ VERSION = "0.0.3.6"
end | Added try catch to increase popularity call | matteodepalo_popstar | train | rb,rb |
8374b2fc852050cd26ddd91cf82e3d819a2b63ef | diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb
index <HASH>..<HASH> 100644
--- a/railties/lib/rails/generators/app_base.rb
+++ b/railties/lib/rails/generators/app_base.rb
@@ -181,7 +181,7 @@ module Rails
def webserver_gemfile_entry
return [] if options[:skip_puma]
comment = 'Use Puma as the app server'
- GemfileEntry.new('puma', nil, comment)
+ GemfileEntry.new('puma', '~> 3.0', comment)
end
def include_all_railties?
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index <HASH>..<HASH> 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -366,6 +366,11 @@ class AppGeneratorTest < Rails::Generators::TestCase
end
end
+ def test_generator_defaults_to_puma_version
+ run_generator [destination_root]
+ assert_gem "puma", "'~> 3.0'"
+ end
+
def test_generator_if_skip_puma_is_given
run_generator [destination_root, "--skip-puma"]
assert_no_file "config/puma.rb" | [close #<I>] Use puma <I>+
Puma <I> and up introduced compatibility to read from `config/puma.rb` when booting from the command `$ rails server`<URL> | rails_rails | train | rb,rb |
810c5b9e5af83da457bd2c986b50f49eda23e848 | diff --git a/mod/quiz/db/upgrade.php b/mod/quiz/db/upgrade.php
index <HASH>..<HASH> 100644
--- a/mod/quiz/db/upgrade.php
+++ b/mod/quiz/db/upgrade.php
@@ -1034,21 +1034,6 @@ function xmldb_quiz_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2011051223, 'quiz');
}
- if ($oldversion < 2011051224) {
-
- // Define field hintformat to be added to question_hints table.
- $table = new xmldb_table('question_hints');
- $field = new xmldb_field('hintformat', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED,
- XMLDB_NOTNULL, null, '0');
-
- // Conditionally launch add field partiallycorrectfeedbackformat
- if (!$dbman->field_exists($table, $field)) {
- $dbman->add_field($table, $field);
- }
-
- upgrade_mod_savepoint(true, 2011051224, 'quiz');
- }
-
if ($oldversion < 2011051225) {
// Define table quiz_report to be renamed to quiz_reports
$table = new xmldb_table('quiz_report'); | MDL-<I> unnecessary upgrade step copied into quiz upgrade script. | moodle_moodle | train | php |
e3c643356df6c0f631b7f5f3f6848491c5dffd41 | diff --git a/hydpy/auxs/calibtools.py b/hydpy/auxs/calibtools.py
index <HASH>..<HASH> 100644
--- a/hydpy/auxs/calibtools.py
+++ b/hydpy/auxs/calibtools.py
@@ -150,7 +150,6 @@ class SumAdaptor(Adaptor):
self,
*rules: Rule[parametertools.Parameter],
):
- super().__init__()
self._rules = tuple(rules)
def __call__(
@@ -292,7 +291,6 @@ class FactorAdaptor(Adaptor):
]
] = None,
):
- super().__init__()
self._rule = rule
self._reference = str(getattr(reference, "name", reference))
self._mask = getattr(mask, "name", mask) if mask else None | Remove `super().__init__()` from the `Protocol` subclasses of module `calibtools`, as this raises a TypeError: (Protocols cannot be instantiated) in later versions of Python <I>. | hydpy-dev_hydpy | train | py |
a8469fa67c445b994d6a19d3b3ba192acdeb7ddf | diff --git a/a10_neutron_lbaas/v2/handler_member.py b/a10_neutron_lbaas/v2/handler_member.py
index <HASH>..<HASH> 100644
--- a/a10_neutron_lbaas/v2/handler_member.py
+++ b/a10_neutron_lbaas/v2/handler_member.py
@@ -12,16 +12,19 @@
# License for the specific language governing permissions and limitations
# under the License.
+
import binascii
+import logging
import re
import acos_client.errors as acos_errors
import handler_base_v2
import v2_context as a10
-
# tenant names allow some funky characters; we do not, as of 4.1.0
non_alpha = re.compile('[^0-9a-zA-Z_-]')
+LOG = logging.getLogger(__name__)
+
class MemberHandler(handler_base_v2.HandlerBaseV2): | Added missing logger to member handler | a10networks_a10-neutron-lbaas | train | py |
7e4d1085812726a6921bd9e745ac479ae57f069e | diff --git a/lib/conceptql/database.rb b/lib/conceptql/database.rb
index <HASH>..<HASH> 100644
--- a/lib/conceptql/database.rb
+++ b/lib/conceptql/database.rb
@@ -38,7 +38,6 @@ module ConceptQL
new_key = k.sub(opt_regexp, '')
h[new_key] = v
end
- db_opts
end
def extensions | Remove bug that caused infinite recursion | outcomesinsights_conceptql | train | rb |
fb0c8c7b518e0f82f88872ca25464040483ebde8 | diff --git a/app/scripts/main.js b/app/scripts/main.js
index <HASH>..<HASH> 100644
--- a/app/scripts/main.js
+++ b/app/scripts/main.js
@@ -1,4 +1,5 @@
(function () {
+ 'use strict';
var navdrawerContainer = document.querySelector('.navdrawer-container');
var appbarElement = document.querySelector('.app-bar');
var menuBtn = document.querySelector('.menu'); | Fix linking issues with scripts/main | material-components_material-components-web | train | js |
17febe1fc3662e090d672622a8b7d3622df723aa | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -54,10 +54,19 @@ setup(
url='https://github.com/rootpy/root_numpy',
download_url='http://pypi.python.org/packages/source/r/'
'root_numpy/root_numpy-%s.tar.gz' % __version__,
- packages=['root_numpy','root_numpy.tests'],
+ packages=[
+ 'root_numpy',
+ 'root_numpy.extern',
+ 'root_numpy.tests',
+ ],
package_data={
- 'root_numpy': ['tests/data/*.root']},
- ext_modules=[librootnumpy, libnumpyhist, libinnerjoin],
+ 'root_numpy': ['tests/data/*.root'],
+ },
+ ext_modules=[
+ librootnumpy,
+ libnumpyhist,
+ libinnerjoin,
+ ],
classifiers=[
"Programming Language :: Python",
"Topic :: Utilities", | missing root_numpy.extern in setup.py packages | scikit-hep_root_numpy | train | py |
8bb1f16c975ef2eae89dc5309b15d3c523e67c1a | diff --git a/fit/body.py b/fit/body.py
index <HASH>..<HASH> 100644
--- a/fit/body.py
+++ b/fit/body.py
@@ -31,10 +31,7 @@ class Body(list):
index += 1
written.append(number)
- if number not in self.definitions: # FIXME
- self.definitions[number] = item._definition
-
- chunks.append(self.definitions[number].write(current))
+ chunks.append(item._definition.write(current))
chunks.append(item.write(current))
return "".join(chunks)
diff --git a/fit/record/definition.py b/fit/record/definition.py
index <HASH>..<HASH> 100644
--- a/fit/record/definition.py
+++ b/fit/record/definition.py
@@ -78,7 +78,7 @@ class Definition(Record):
def write(self, index):
from fit.record.header import DefinitionHeader
- chunk = pack("<BBHB", 0, self.BIG, self.number, len(self.fields))
+ chunk = pack("<BBHB", 0, self.LITTLE, self.number, len(self.fields))
return DefinitionHeader(index).write() + chunk + self.fields.write()
def build_message(self, buffer): | Wow, I can write FIT files | rembish_fit | train | py,py |
382b94025551b526ed2a33fe1e6f917b6a2202b5 | diff --git a/src/SchillingSoapWrapper.php b/src/SchillingSoapWrapper.php
index <HASH>..<HASH> 100644
--- a/src/SchillingSoapWrapper.php
+++ b/src/SchillingSoapWrapper.php
@@ -43,7 +43,7 @@ class SchillingSoapWrapper
$wsdl_uri = $this->getWsdlUri($class);
// Init SOAP client
- $this->client = new SoapClient($wsdl_uri, ['trace' => true, 'exceptions' => true]);
+ $this->client = new SoapClient($wsdl_uri, ['trace' => true, 'exceptions' => true, 'cache_wsdl' => WSDL_CACHE_MEMORY]);
// Add authentication to the query
$request = $this->addAuthHeader($arguments); | Added WSDL cache for memory | lasselehtinen_schilling-soap-wrapper | train | php |
66b71dc4806c6f4e8d3fe9afe2b22cb37e3dd8b5 | diff --git a/example1/App.js b/example1/App.js
index <HASH>..<HASH> 100644
--- a/example1/App.js
+++ b/example1/App.js
@@ -178,7 +178,7 @@ class Registration extends React.Component {
// When user clicks on the submit button, wait until validity of
// the form is known (!= null) and only then proceed with the
// onSubmit handler.
- this.props.onFormValid((valid, props) => {
+ this.props.onFormValid((valid) => {
if (valid) {
let {fields: {email}} = this.props.appState
alert(`Registration successful! Email=${email}`) //eslint-disable-line no-alert | Remove forgotten unused arg from example | vacuumlabs_react-custom-validation | train | js |
caea033f1a7ec263b02dd099cd2cd6d5df64e73b | diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/Config.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/Config.java
index <HASH>..<HASH> 100644
--- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/Config.java
+++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/Config.java
@@ -115,7 +115,6 @@ public class Config {
this.apiVersion = apiVersion;
this.namespace = namespace;
this.enabledProtocols = enabledProtocols;
- this.trustCerts = trustCerts;
this.caCertFile = caCertFile;
this.caCertData = caCertData;
this.clientCertFile = clientCertFile; | Remove redudant assignment from Config. | fabric8io_kubernetes-client | train | java |
ba24b1983245ed84fc948df98d413335c35a7ef2 | diff --git a/bundles/org.eclipse.orion.client.core/web/orion/widgets/SiteEditor.js b/bundles/org.eclipse.orion.client.core/web/orion/widgets/SiteEditor.js
index <HASH>..<HASH> 100644
--- a/bundles/org.eclipse.orion.client.core/web/orion/widgets/SiteEditor.js
+++ b/bundles/org.eclipse.orion.client.core/web/orion/widgets/SiteEditor.js
@@ -508,7 +508,7 @@ dojo.declare("orion.widgets.SiteEditor", [dijit.layout.ContentPane, dijit._Templ
return updatedSiteConfig;
} else {
siteConfig.HostingStatus = status;
- return this._siteConfiguration;
+ return siteConfig;
}
});
this._busyWhile(deferred);
@@ -520,7 +520,7 @@ dojo.declare("orion.widgets.SiteEditor", [dijit.layout.ContentPane, dijit._Templ
autoSave: function() {
if (this.isDirty()) {
- this.save(null, false);
+ this.save(false);
}
setTimeout(dojo.hitch(this, this.autoSave), AUTOSAVE_INTERVAL);
}, | Clean up a few things from previous commit | eclipse_orion.client | train | js |
9bb7539fc657727887aabc8fe9636864e3945e90 | diff --git a/MarkovText/MarkovText.py b/MarkovText/MarkovText.py
index <HASH>..<HASH> 100644
--- a/MarkovText/MarkovText.py
+++ b/MarkovText/MarkovText.py
@@ -25,7 +25,8 @@ class Markov:
sentences = re.split(r'(?<!\w\.\w.)(?<![A-Z][a-z]\.)(?<=\.|\?|!)\s', text)
# '' is a special symbol for the start of a sentence like pymarkovchain uses
for sentence in sentences:
- words = sentence.strip().replace('"','').split() # split each sentence into its constituent words
+ sentence = sentence.replace('"','').replace('“','"').replace('”','"') # remove quotes
+ words = sentence.strip().split() # split each sentence into its constituent words
if len(words) == 0:
continue
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -23,7 +23,7 @@ setup(
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
- version='0.1dev1',
+ version='0.1dev4',
description='A package to generate text via Markov chain using sample text',
long_description=long_description, | Remove quotes from the text. Update version | kwkelly_MarkovText | train | py,py |
6486995862f74480ad88ac1afc779c8c11f7e7b2 | diff --git a/django_user_agents/utils.py b/django_user_agents/utils.py
index <HASH>..<HASH> 100644
--- a/django_user_agents/utils.py
+++ b/django_user_agents/utils.py
@@ -1,12 +1,15 @@
from hashlib import md5
from django.core.cache import cache
+from django.utils.six import text_type
from user_agents import parse
def get_cache_key(ua_string):
# Some user agent strings are longer than 250 characters so we use its MD5
+ if isinstance(ua_string, text_type):
+ ua_string = ua_string.encode('utf-8')
return ''.join(['django_user_agents.', md5(ua_string).hexdigest()]) | use six to check if strings need encoding to bytes before hashing | selwin_django-user_agents | train | py |
8bc90b05463c010f1349657ecea6654c4f8e7f25 | diff --git a/lib/ethereum/abi/contract_translator.rb b/lib/ethereum/abi/contract_translator.rb
index <HASH>..<HASH> 100644
--- a/lib/ethereum/abi/contract_translator.rb
+++ b/lib/ethereum/abi/contract_translator.rb
@@ -155,6 +155,7 @@ module Ethereum
def listen(log, noprint: true)
result = decode_event log.topics, log.data
p result if noprint
+ result['_from'] = Utils.encode_hex(log.address)
result
rescue ValueError
nil # api compatibility | include log origin in log parse result | cryptape_ruby-ethereum | train | rb |
1357e11119fe0438eb61e76416195c3dd8186974 | diff --git a/manager-bundle/src/HttpKernel/ContaoKernel.php b/manager-bundle/src/HttpKernel/ContaoKernel.php
index <HASH>..<HASH> 100644
--- a/manager-bundle/src/HttpKernel/ContaoKernel.php
+++ b/manager-bundle/src/HttpKernel/ContaoKernel.php
@@ -146,10 +146,6 @@ class ContaoKernel extends Kernel
if (file_exists($this->getRootDir().'/config/parameters.yml')) {
$loader->load($this->getRootDir().'/config/parameters.yml');
}
-
- if (file_exists($this->getRootDir().'/config/security.yml')) {
- $loader->load($this->getRootDir().'/config/security.yml');
- }
/** @var ConfigPluginInterface[] $plugins */
$plugins = $this->getPluginLoader()->getInstancesOf(PluginLoader::CONFIG_PLUGINS); | [Manager] Revert "Support using a custom security.yml file (see #<I>)."
This reverts commit e2c<I>d<I>a4b<I>b<I>b<I>b7f9c<I>fbb9. | contao_contao | train | php |
987c3fa950bf16c3878e9d27f785738e2fe6dfc2 | diff --git a/tasks/copy.js b/tasks/copy.js
index <HASH>..<HASH> 100644
--- a/tasks/copy.js
+++ b/tasks/copy.js
@@ -5,8 +5,8 @@ module.exports = function(gulp, opt) {
var revReplace = require('gulp-rev-replace');
gulp.task('copy-src', function() {
- return gulp.src('./app/src/**/*.ts', {base: './app/src'})
- .pipe(gulp.dest(opt.destFolder + '/source'));
+ return gulp.src('./app/src/**/*.ts', {base: './app'})
+ .pipe(gulp.dest(opt.destFolder));
});
gulp.task('copy', function() {
diff --git a/tasks/watch.js b/tasks/watch.js
index <HASH>..<HASH> 100644
--- a/tasks/watch.js
+++ b/tasks/watch.js
@@ -16,7 +16,7 @@ module.exports = function (gulp, opt) {
* from within their editor/IDE.
*/
if (opt.watchTs) {
- gulp.watch('app/src/**/*.ts', ['make-script']);
+ gulp.watch('app/src/**/*.ts', ['make-script', 'copy-src']);
}
if (opt.watchOl) {
gulp.watch('app/assets/libs/ol3/src/**/*.js', function() { | Copy source correctly to build dir when file changes | TissueMAPS_TmClient | train | js,js |
908503ee891757c8f46e4528657c740249df49ff | diff --git a/build/npm/postinstall.js b/build/npm/postinstall.js
index <HASH>..<HASH> 100644
--- a/build/npm/postinstall.js
+++ b/build/npm/postinstall.js
@@ -33,7 +33,7 @@ function yarnInstall(location, opts) {
yarnInstall('extensions'); // node modules shared by all extensions
-if (!(process.platform === 'win32' && process.env['npm_config_arch'] === 'arm64')) {
+if (!(process.platform === 'win32' && (process.arch === 'arm64' || process.env['npm_config_arch'] === 'arm64'))) {
yarnInstall('remote'); // node modules used by vscode server
yarnInstall('remote/web'); // node modules used by vscode web
} | ignore remote and web when yarn in arm<I> | Microsoft_vscode | train | js |
92acf8ae992b96ea362fcddc04745f5235f740b6 | diff --git a/aws/resource_aws_ec2_managed_prefix_list.go b/aws/resource_aws_ec2_managed_prefix_list.go
index <HASH>..<HASH> 100644
--- a/aws/resource_aws_ec2_managed_prefix_list.go
+++ b/aws/resource_aws_ec2_managed_prefix_list.go
@@ -114,7 +114,7 @@ func resourceAwsEc2ManagedPrefixListCreate(d *schema.ResourceData, meta interfac
input.PrefixListName = aws.String(v.(string))
}
- if v, ok := d.GetOk("tags"); ok && len(v.(map[string]interface{})) > 0 {
+ if len(tags) > 0 {
input.TagSpecifications = ec2TagSpecificationsFromKeyValueTags(tags, "prefix-list")
}
@@ -209,7 +209,7 @@ func resourceAwsEc2ManagedPrefixListRead(d *schema.ResourceData, meta interface{
func resourceAwsEc2ManagedPrefixListUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).ec2conn
- if d.HasChangeExcept("tags") {
+ if d.HasChangesExcept("tags", "tags_all") {
input := &ec2.ModifyManagedPrefixListInput{
PrefixListId: aws.String(d.Id()),
} | add logic to update in ec2 resources | terraform-providers_terraform-provider-aws | train | go |
3fa79a3f4c27ccd487c379a7338192fd7e539a5c | diff --git a/nirum/__init__.py b/nirum/__init__.py
index <HASH>..<HASH> 100644
--- a/nirum/__init__.py
+++ b/nirum/__init__.py
@@ -2,5 +2,5 @@
~~~~~~~~~~~~~~~
"""
-__version_info__ = 0, 3, 6
+__version_info__ = 0, 3, 7
__version__ = '.'.join(str(v) for v in __version_info__) | <I> (#<I>) | nirum-lang_nirum-python | train | py |
13114fddbc947c0db6802992ecf6098eef44d4bb | diff --git a/lib/Elastica/Document.php b/lib/Elastica/Document.php
index <HASH>..<HASH> 100644
--- a/lib/Elastica/Document.php
+++ b/lib/Elastica/Document.php
@@ -80,7 +80,7 @@ class Elastica_Document {
* To use this feature you have to call the following command in the
* elasticsearch directory:
* <code>
- * ./bin/plugin install mapper-attachments
+ * ./bin/plugin -install elasticsearch/elasticsearch-mapper-attachments/1.2.0
* </code>
* This installs the tika file analysis plugin. More infos about supported formats
* can be found here: {@link http://tika.apache.org/0.7/formats.html} | Link how to install attachment mapper updated | ruflin_Elastica | train | php |
010f167386ef26bdad739a7024e4c6a805bb8f8f | diff --git a/src/com/aoindustries/taglib/RedirectTag.java b/src/com/aoindustries/taglib/RedirectTag.java
index <HASH>..<HASH> 100644
--- a/src/com/aoindustries/taglib/RedirectTag.java
+++ b/src/com/aoindustries/taglib/RedirectTag.java
@@ -189,7 +189,7 @@ public class RedirectTag
}
}
- response.setHeader("Location", location);
+ IncludeTag.setLocation(request, response, location);
IncludeTag.sendError(request, response, status);
SkipPageHandler.setPageSkipped(request);
throw new SkipPageException(); | Now allowing sendError and redirect from within ao:include | aoindustries_ao-taglib | train | java |
c9218018030005e90bec76b0696161d06716c89c | diff --git a/scripts/tofuversion.py b/scripts/tofuversion.py
index <HASH>..<HASH> 100755
--- a/scripts/tofuversion.py
+++ b/scripts/tofuversion.py
@@ -12,7 +12,7 @@ import warnings
###################################################
-#_TOFUPATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
+# _TOFUPATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
_TOFUPATH = os.path.join(os.path.join(os.path.dirname(__file__), '..'), 'tofu')
_DBOOL = {'verb': True, 'warn': True, 'force': False}
_ENVVAR = False
diff --git a/tofu/version.py b/tofu/version.py
index <HASH>..<HASH> 100644
--- a/tofu/version.py
+++ b/tofu/version.py
@@ -1,2 +1,2 @@
# Do not edit, pipeline versioning governed by git tags!
-__version__ = '1.4.3b4-54-g9333d09c'
+__version__ = '1.4.3b4-55-ge15c111e' | [Issue<I>] PEP8 Compliance | ToFuProject_tofu | train | py,py |
c738fc03ead8593ae5e965e56c48091ccbf4fca5 | diff --git a/modules/activiti-webapp/src/main/webapp/js/activiti-core.js b/modules/activiti-webapp/src/main/webapp/js/activiti-core.js
index <HASH>..<HASH> 100644
--- a/modules/activiti-webapp/src/main/webapp/js/activiti-core.js
+++ b/modules/activiti-webapp/src/main/webapp/js/activiti-core.js
@@ -1673,9 +1673,12 @@ Activiti.thirdparty.toISO8601 = function()
Activiti.support.inputDate = function()
{
+ /* Temporarily disabled due to WebKit bug. See ACT-296
var i = document.createElement("input");
i.setAttribute("type", "date");
return (i.type !== "text")
+ */
+ return false;
}(); | Fix for: ACT-<I> - work around for Webkit bug. | Activiti_Activiti | train | js |
80a253bcea1e3cb99295f53f04c0558190dca5f3 | diff --git a/enocean/protocol/eep.py b/enocean/protocol/eep.py
index <HASH>..<HASH> 100644
--- a/enocean/protocol/eep.py
+++ b/enocean/protocol/eep.py
@@ -161,15 +161,15 @@ class EEP(object):
return None
if eep_rorg not in self.telegrams.keys():
- self.logger.warn('Cannot find rorg in EEP!')
+ self.logger.warn('Cannot find rorg %s in EEP!', hex(eep_rorg))
return None
if rorg_func not in self.telegrams[eep_rorg].keys():
- self.logger.warn('Cannot find func in EEP!')
+ self.logger.warn('Cannot find rorg %s func %s in EEP!', hex(eep_rorg), hex(rorg_func))
return None
if rorg_type not in self.telegrams[eep_rorg][rorg_func].keys():
- self.logger.warn('Cannot find type in EEP!')
+ self.logger.warn('Cannot find rorg %s func %s type %s in EEP!', hex(eep_rorg), hex(rorg_func), hex(rorg_type))
return None
profile = self.telegrams[eep_rorg][rorg_func][rorg_type] | Improve error messages if packet not found in EEP
Add some more detail to the error messages if a packet cannot be found in the EEP. | kipe_enocean | train | py |
2460d3856eec0ad6884e2214aa889aa6d58c5b04 | diff --git a/salt/modules/inspectlib/query.py b/salt/modules/inspectlib/query.py
index <HASH>..<HASH> 100644
--- a/salt/modules/inspectlib/query.py
+++ b/salt/modules/inspectlib/query.py
@@ -440,6 +440,7 @@ class Query(EnvLoader):
return "{0} Gb".format(round((float(size) / 0x400 / 0x400 / 0x400), 2))
filter = kwargs.get('filter')
+ offset = kwargs.get('offset', 0)
timeformat = kwargs.get("time", "tz")
if timeformat not in ["ticks", "tz"]:
@@ -467,9 +468,12 @@ class Query(EnvLoader):
'dir, file and/or link.'.format(", ".join(incl_type)))
self.db.open()
+ if "total" in args:
+ return {'total': len(self.db.get(PayloadFile))}
+
brief = kwargs.get("brief")
pld_files = list() if brief else dict()
- for pld_data in self.db.get(PayloadFile):
+ for pld_data in self.db.get(PayloadFile)[offset:offset + 1000]:
if brief:
pld_files.append(pld_data.path)
else: | Add "total" only. Add offset slicing (avoid truncated data) | saltstack_salt | train | py |
ec39bb79eebabe24551b090397f5275c557954ac | diff --git a/acceptance-tests/src/test/java/me/atam/atam4jsampleapp/FailingTestAcceptanceTest.java b/acceptance-tests/src/test/java/me/atam/atam4jsampleapp/FailingTestAcceptanceTest.java
index <HASH>..<HASH> 100644
--- a/acceptance-tests/src/test/java/me/atam/atam4jsampleapp/FailingTestAcceptanceTest.java
+++ b/acceptance-tests/src/test/java/me/atam/atam4jsampleapp/FailingTestAcceptanceTest.java
@@ -10,7 +10,8 @@ public class FailingTestAcceptanceTest extends AcceptanceTest {
@Test
public void givenSampleApplicationStartedWithFailingTest_whenHealthCheckCalledBeforeTestRun_thenFailureMessageReceived() {
+ String expectedMessage = String.format("%s 1. Was expecting false to be true", AcceptanceTestsHealthCheck.FAILURE_MESSAGE);
applicationConfigurationDropwizardTestSupport = Atam4jApplicationStarter.startApplicationWith(FailingTest.class);
- checkResponseIsErrorAndWithMessage(AcceptanceTestsHealthCheck.FAILURE_MESSAGE + " 1. Was expecting false to be true", getResponseFromHealthCheck());
+ checkResponseIsErrorAndWithMessage(expectedMessage, getResponseFromHealthCheck());
}
} | Improve readability
- by using String.format instead of concatenation | atam4j_atam4j | train | java |
09306e306b815784a77064a388e8d492c76d3f98 | diff --git a/channel.js b/channel.js
index <HASH>..<HASH> 100644
--- a/channel.js
+++ b/channel.js
@@ -122,7 +122,7 @@ var Channel = define(
var promise = defer()
channel.reducers.push({ next: f, state: start, promise: promise })
react(channel)
- return promise
+ return go(identity, promise)
}
}) | Return value if resolved in time. | Gozala_reducers | train | js |
8a85842860f50f6f24bf6dc7d43f906b188654ce | diff --git a/go/stats/statsd/statsd_test.go b/go/stats/statsd/statsd_test.go
index <HASH>..<HASH> 100644
--- a/go/stats/statsd/statsd_test.go
+++ b/go/stats/statsd/statsd_test.go
@@ -452,6 +452,5 @@ func TestMakeCommonTags(t *testing.T) {
assert.Equal(t, 0, len(res1))
expected2 := []string{"a:b", "c:d"}
res2 := makeCommonTags(map[string]string{"a": "b", "c": "d"})
- sort.Strings(res2)
- assert.EqualValues(t, expected2, res2)
+ assert.ElementsMatch(t, expected2, res2)
} | Address review comment: use ElementsMatch | vitessio_vitess | train | go |
490878245147086dbf6829fda284c0e9a51ef494 | diff --git a/ext_localconf.php b/ext_localconf.php
index <HASH>..<HASH> 100644
--- a/ext_localconf.php
+++ b/ext_localconf.php
@@ -3,4 +3,4 @@ if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = 'FluidTYPO3\Site\Command\SiteCommandController';
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = 'FluidTYPO3\\Site\\Command\\SiteCommandController'; | [TASK] Double escape backslashes in class name | FluidTYPO3_site | train | php |
d7eafe8d99d8bac6c2568c489cd3ee0b763af5d4 | diff --git a/lib/watir-webdriver/browser.rb b/lib/watir-webdriver/browser.rb
index <HASH>..<HASH> 100644
--- a/lib/watir-webdriver/browser.rb
+++ b/lib/watir-webdriver/browser.rb
@@ -46,8 +46,8 @@ module Watir
def inspect
'#<%s:0x%x url=%s title=%s>' % [self.class, hash*2, url.inspect, title.inspect]
- rescue Errno::ECONNREFUSED
- '#<%s:0x%x closed=true>' % [self.class, hash*2]
+ rescue
+ '#<%s:0x%x closed=%s>' % [self.class, hash*2, @closed.to_s]
end
# | Browser#inspect shouldn't fail on other errors | watir_watir | train | rb |
b1f520328158c9b29ace66a4c04506c5df87a4c9 | diff --git a/webpack.config.js b/webpack.config.js
index <HASH>..<HASH> 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -5,6 +5,8 @@ const BabelMinify = require("babel-minify-webpack-plugin");
let DEV = false
+const node_modules = (...p) => path.resolve(__dirname, 'node_modules', ...p)
+
// --watch option means dev mode
if (process.argv.includes('--watch')) {
DEV = true
@@ -24,7 +26,8 @@ module.exports = {
test: /\.js$/,
include: [
path.resolve(__dirname, 'src'),
- path.resolve(__dirname, 'node_modules', 'custom-attributes'), // ES6+
+ node_modules('custom-attributes'), // ES6+
+ node_modules('element-behaviors'), // ES6+
],
use: [
{ | simpler path node_modules creation in webpack config | trusktr_infamous | train | js |
f57cb43ec88df085dc4dd5751cea7a6bc7d7f234 | diff --git a/lib/scenic/view.rb b/lib/scenic/view.rb
index <HASH>..<HASH> 100644
--- a/lib/scenic/view.rb
+++ b/lib/scenic/view.rb
@@ -14,11 +14,11 @@ module Scenic
end
def to_schema
- <<-DEFINITION.strip_heredoc
- create_view :#{name}, sql_definition:<<-\SQL
- #{definition}
- SQL
+ <<-DEFINITION
+ create_view :#{name}, sql_definition: <<-\SQL
+ #{definition.indent(2)}
+ SQL
DEFINITION
end
end | Improve formatting of dumped view
* Blank line should go above the view to separate it from content above
and still guarantee a blank line between views
* `stip_heredoc` wasn't working as expected. Postgres does a reasonable
job of formatting the query, we just want to be sure it is readable in
the schema. `indent` helps with that.
*Before:*

*After:*
 | scenic-views_scenic | train | rb |
a0363e2ca69c77f420313e9bfd614a13c92ce8bb | diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/relation/finder_methods.rb
+++ b/activerecord/lib/active_record/relation/finder_methods.rb
@@ -176,7 +176,7 @@ module ActiveRecord
join_dependency = construct_join_dependency_for_association_find
relation = construct_relation_for_association_find(join_dependency)
- relation = relation.except(:select, :order).select("1 AS _one").limit(1)
+ relation = relation.except(:select, :order).select("1 AS one").limit(1)
case id
when Array, Hash
diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb
index <HASH>..<HASH> 100644
--- a/activerecord/test/cases/finder_test.rb
+++ b/activerecord/test/cases/finder_test.rb
@@ -46,7 +46,7 @@ class FinderTest < ActiveRecord::TestCase
end
def test_exists_does_not_select_columns_without_alias
- assert_sql(/SELECT\W+1 AS _one FROM ["`]topics["`]\W+LIMIT 1/) do
+ assert_sql(/SELECT\W+1 AS one FROM ["`]topics["`]/i) do
Topic.exists?
end
end | Address ORA-<I> errors because of the heading underscore. | rails_rails | train | rb,rb |
331e28c680584e7d4885d7ad1071824d9d6e9a66 | diff --git a/lib/rprogram/compat.rb b/lib/rprogram/compat.rb
index <HASH>..<HASH> 100644
--- a/lib/rprogram/compat.rb
+++ b/lib/rprogram/compat.rb
@@ -25,14 +25,10 @@ module RProgram
# Compat.paths #=> ["/bin", "/usr/bin"]
#
def Compat.paths
- # return an empty array in case
- # the PATH variable does not exist
- return [] unless ENV['PATH']
-
- if Compat.platform =~ /mswin(32|64)/
- return ENV['PATH'].split(';')
+ if ENV['PATH']
+ ENV['PATH'].split(File::PATH_SEPARATOR)
else
- return ENV['PATH'].split(':')
+ []
end
end | Split ENV['PATH'] using File::PATH_SEPARATOR (per advice of raggi). | postmodern_rprogram | train | rb |
0fe96ec46a8754a9ea313a869d3a0078180595ab | diff --git a/lxd/device/nic_bridged.go b/lxd/device/nic_bridged.go
index <HASH>..<HASH> 100644
--- a/lxd/device/nic_bridged.go
+++ b/lxd/device/nic_bridged.go
@@ -805,7 +805,10 @@ func (d *nicBridged) postStop() error {
routes = append(routes, util.SplitNTrimSpace(d.config["ipv4.routes.external"], ",", -1, true)...)
routes = append(routes, util.SplitNTrimSpace(d.config["ipv6.routes.external"], ",", -1, true)...)
networkNICRouteDelete(d.config["parent"], routes...)
- d.removeFilters(d.config)
+
+ if shared.IsTrue(d.config["security.mac_filtering"]) || shared.IsTrue(d.config["security.ipv4_filtering"]) || shared.IsTrue(d.config["security.ipv6_filtering"]) {
+ d.removeFilters(d.config)
+ }
return nil
} | lxd/device/nic/bridged: Only call d.removeFilters in postStop if filtering enabled
Avoids clearing externally added ebtables rules when filtering is not enabled.
This avoids removing 3rd party rules that happen to match rules that would have been added
by LXD if filtering was enabled.
Fixes #<I> | lxc_lxd | train | go |
847d6de900e36b55ada0453799abe89edb8b8909 | diff --git a/lib/https/server-agent.js b/lib/https/server-agent.js
index <HASH>..<HASH> 100644
--- a/lib/https/server-agent.js
+++ b/lib/https/server-agent.js
@@ -3,7 +3,7 @@ var Q = require('q');
var ca = require('./ca');
var MAX_SERVERS = 320;
var MAX_PORT = 60000;
-var curPort = 40000;
+var curPort = 42002;
var TIMEOUT = 6000;
// var DELAY = 100; | refactor: Modify the port range of https server | avwo_whistle | train | js |
f6b5dd139c55606f7c17f103ed01d91f0c37d0cc | diff --git a/app/controllers/apicasso/application_controller.rb b/app/controllers/apicasso/application_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/apicasso/application_controller.rb
+++ b/app/controllers/apicasso/application_controller.rb
@@ -193,7 +193,7 @@ module Apicasso
# Check for SQL injection before requests and
# raise a exception when find
def bad_request?
- raise ActionController::BadRequest.new('Bad hacker, stop be bully or I will tell to your mom!') unless sql_injection(resource, params.to_unsafe_h)
+ raise ActionController::BadRequest.new('Bad hacker, stop be bully or I will tell to your mom!') unless sql_injection(resource)
end
# @TODO | Update to `sql_injection?` method call in app/controllers/apicasso/application_controller.rb | autoforce_APIcasso | train | rb |
e976afa3c4cd069bcf352744bad3f2682c1b27e7 | diff --git a/lib/spout/version.rb b/lib/spout/version.rb
index <HASH>..<HASH> 100644
--- a/lib/spout/version.rb
+++ b/lib/spout/version.rb
@@ -3,7 +3,7 @@ module Spout
MAJOR = 0
MINOR = 7
TINY = 0
- BUILD = "pre" # nil, "pre", "rc", "rc2"
+ BUILD = "beta1" # nil, "pre", "rc", "rc2"
STRING = [MAJOR, MINOR, TINY, BUILD].compact.join('.')
end | Version bump to <I>.beta1 | nsrr_spout | train | rb |
8e5d95df08dfb73fa7716f15c228f40205c62486 | diff --git a/command/agent/consul/client.go b/command/agent/consul/client.go
index <HASH>..<HASH> 100644
--- a/command/agent/consul/client.go
+++ b/command/agent/consul/client.go
@@ -180,8 +180,8 @@ func (c *ServiceClient) Run() {
if failures == 0 {
c.logger.Printf("[WARN] consul.sync: failed to update services in Consul: %v", err)
}
- failures++
}
+ failures++
if !retryTimer.Stop() {
// Timer already expired, since the timer may
// or may not have been read in the select{} | Always increment failures...
...as it's used in calculating the backoff | hashicorp_nomad | train | go |
2f60c9760ce0f538b0c15078fea2b4547839aac9 | diff --git a/app/templates/src/main/webapp/app/components/alert/_alert.service.js b/app/templates/src/main/webapp/app/components/alert/_alert.service.js
index <HASH>..<HASH> 100644
--- a/app/templates/src/main/webapp/app/components/alert/_alert.service.js
+++ b/app/templates/src/main/webapp/app/components/alert/_alert.service.js
@@ -3,7 +3,7 @@
angular.module('<%=angularAppName%>')
.provider('AlertService', function () {
this.toast = false;
-
+ /*jshint validthis: true */
this.$get = ['$timeout', '$sce'<% if (enableTranslation) { %>, '$translate'<% } %>, function($timeout, $sce<% if (enableTranslation) { %>,$translate<% } %>) {
var toast = this.toast,
alertId = 0, // unique id for each alert. Starts from 0. | code cleanup, add a jshint comment to not take into account strict mode violation | jhipster_generator-jhipster | train | js |
7f42e20ba8c4028905daf02a8552703643adaee6 | diff --git a/lib/client.js b/lib/client.js
index <HASH>..<HASH> 100644
--- a/lib/client.js
+++ b/lib/client.js
@@ -52,7 +52,7 @@ Freshdesk.prototype.req = function (method, url, qs, data, cb) {
}
Freshdesk.prototype.listAllTickets = function (params, cb) {
- this.req('GET', '{domain}/api/v2/tickets'.replace('{domain}', this.domain), params, null, cb)
+ this.req('GET', `${this.domain}/api/v2/tickets`, params, null, cb)
}
Freshdesk.prototype.listAllTicketFields = function (cb) {
@@ -135,5 +135,8 @@ Freshdesk.prototype.listAllContactFields = function (cb) {
this.req('GET', '{domain}/api/v2/contact_fields'.replace('{domain}', this.domain), null, null, cb)
}
+Freshdesk.prototype.listAllCompanies = function (cb) {
+ this.req('GET', `${this.domain}/api/v2/companies`, null, null, cb)
+}
-module.exports = Freshdesk;
\ No newline at end of file
+module.exports = Freshdesk; | API: added method `listAllCompanies` | arjunkomath_node-freshdesk-api | train | js |
7c427ef55340d8bf9091687bc27c2e2b965238b1 | diff --git a/lib/yard/code_objects/base.rb b/lib/yard/code_objects/base.rb
index <HASH>..<HASH> 100644
--- a/lib/yard/code_objects/base.rb
+++ b/lib/yard/code_objects/base.rb
@@ -339,7 +339,6 @@ module YARD
# as a +String+ for the definition of the code object only (not the block)
def source=(statement)
if statement.respond_to?(:source)
- self.line = statement.line
self.signature = statement.first_line
@source = format_source(statement.source.strip)
else | Remove unused self.line setting method.
This method was initiating a dispatch to method_missing, since the method
did not exist, and was silently setting an attribute on the object that
is never used. | lsegal_yard | train | rb |
4fb5f228603ed984afda0fd10699171a240f923d | diff --git a/lib/emites/request.rb b/lib/emites/request.rb
index <HASH>..<HASH> 100644
--- a/lib/emites/request.rb
+++ b/lib/emites/request.rb
@@ -20,11 +20,12 @@ module Emites
def options
{
- method: args[:method],
- params: args[:params],
- body: body,
- headers: headers,
- userpwd: token
+ method: args[:method],
+ params: args[:params],
+ body: body,
+ headers: headers,
+ userpwd: token,
+ accept_encoding: "gzip"
}.reject {|k,v| v.nil?}
end
diff --git a/spec/emites/http_spec.rb b/spec/emites/http_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/emites/http_spec.rb
+++ b/spec/emites/http_spec.rb
@@ -26,6 +26,7 @@ describe Emites::Http do
with("https://sandbox.emites.com.br/api/v1/some_resource",
method: verb,
userpwd: "#{token}:x",
+ accept_encoding: "gzip",
headers: {
"Accept" => "application/json",
"Content-Type" => "application/json", | Added gzip compression to requests | myfreecomm_emites-client-ruby | train | rb,rb |
45661ad2f6d1530dd88ca8d373c29ba2f93cb1a0 | diff --git a/src/Persistence_SQL.php b/src/Persistence_SQL.php
index <HASH>..<HASH> 100644
--- a/src/Persistence_SQL.php
+++ b/src/Persistence_SQL.php
@@ -441,6 +441,7 @@ class Persistence_SQL extends Persistence
public function delete(Model $m, $id)
{
$delete = $this->action($m, 'delete');
+ $delete->reset('where'); // because it could have join there..
$delete->where($m->getElement($m->id_field), $id);
$m->hook('beforeDeleteQuery', [$delete]);
try { | IMPORTANT: we already have ID so it's safe to delete where conditions on delete. | atk4_data | train | php |
fb198a06454c2d648ed9b8410a33a76fc7274976 | diff --git a/lib/db/leveldb_dbinstance.go b/lib/db/leveldb_dbinstance.go
index <HASH>..<HASH> 100644
--- a/lib/db/leveldb_dbinstance.go
+++ b/lib/db/leveldb_dbinstance.go
@@ -541,7 +541,7 @@ func (db *Instance) dropFolder(folder []byte) {
// Remove all sequences related to the folder
sequenceKey := db.sequenceKey([]byte(folder), 0)
- dbi = t.NewIterator(util.BytesPrefix(sequenceKey[:4]), nil)
+ dbi = t.NewIterator(util.BytesPrefix(sequenceKey[:keyPrefixLen+keyFolderLen]), nil)
for dbi.Next() {
db.Delete(dbi.Key(), nil)
} | lib/db: Actually delete the correct sequence prefix | syncthing_syncthing | train | go |
79acfd42a4c9eccc1d365412fca9186b568e4d6d | diff --git a/glitter/assets/fields.py b/glitter/assets/fields.py
index <HASH>..<HASH> 100644
--- a/glitter/assets/fields.py
+++ b/glitter/assets/fields.py
@@ -18,7 +18,7 @@ class GroupedModelChoiceField(ModelChoiceField):
self.group_label = group_label
# Need correct ordering, and category titles
- self.queryset = self.queryset.select_related().order_by('category', 'title')
+ self.queryset = self.queryset.select_related('category').order_by('category', 'title')
def _get_choices(self):
""" | Fix performance for AssetForeignKey
#<I> made category optional, and with null ForeignKeys we have to force a select_related on them. | developersociety_django-glitter | train | py |
6b6fa0f9461f9a86a93c308a3b67b2bc72af5bd9 | diff --git a/spec/lib/dump_rake/dump_reader_spec.rb b/spec/lib/dump_rake/dump_reader_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/dump_rake/dump_reader_spec.rb
+++ b/spec/lib/dump_rake/dump_reader_spec.rb
@@ -304,13 +304,13 @@ describe DumpReader do
@versions = []
@migrate_down_task = double('migrate_down_task')
- expect(@migrate_down_task).to receive('invoke').exactly(2).times.with {
+ expect(@migrate_down_task).to receive('invoke').exactly(3).times do
version = DumpRake::Env['VERSION']
@versions << version
if version == '6'
raise ActiveRecord::IrreversibleMigration
end
- }
+ end
expect(@migrate_down_task).to receive('reenable').exactly(3).times
expect($stderr).to receive('puts').with("Irreversible migration: 6") | remove using `with` with block | toy_dump | train | rb |
abd17086daca6e8cf761425b762089520b2a9e32 | diff --git a/MediaAdmin/EventSubscriber/FolderSubscriber.php b/MediaAdmin/EventSubscriber/FolderSubscriber.php
index <HASH>..<HASH> 100644
--- a/MediaAdmin/EventSubscriber/FolderSubscriber.php
+++ b/MediaAdmin/EventSubscriber/FolderSubscriber.php
@@ -59,7 +59,7 @@ class FolderSubscriber implements EventSubscriberInterface
);
$folders = $this->folderRepository->findByParentAndSite($parentFolder->getId(), $parentFolder->getSiteId());
- if (is_array($folders)) {
+ if (count($folders) > 0) {
foreach ($folders as $folder) {
$oldPath = $folder->getPath();
$folder->setPath($parentFolder->getPath() . '/' . $folder->getFolderId()); | Fix broken folder subscriber (#<I>) | open-orchestra_open-orchestra-media-admin-bundle | train | php |
c44fe7dd6ab20bd14b92f2077eef7fa0ad815597 | diff --git a/lib/rnes/ppu.rb b/lib/rnes/ppu.rb
index <HASH>..<HASH> 100644
--- a/lib/rnes/ppu.rb
+++ b/lib/rnes/ppu.rb
@@ -271,7 +271,7 @@ module Rnes
pattern_line_high_byte = read_sprite_pattern_line(pattern_line_low_byte_address + TILE_HEIGHT)
TILE_WIDTH.times do |x_in_pattern|
index_in_pattern_line_byte = TILE_WIDTH - 1 - x_in_pattern
- sprite_palette_index = pattern_line_low_byte[index_in_pattern_line_byte] | pattern_line_high_byte[index_in_pattern_line_byte] << 1 | palette_id << 2
+ sprite_palette_index = pattern_line_low_byte[index_in_pattern_line_byte] | (pattern_line_high_byte[index_in_pattern_line_byte] << 1) | (palette_id << 2)
if sprite_palette_index % 4 != 0
color_id = read_color_id(sprite_palette_index)
y_in_pattern = TILE_HEIGHT - 1 - y_in_pattern if reversed_vertically | Refactor parentheses for more consistency | r7kamura_rnes | train | rb |
c2d9bbb77f602ae41382fe4f60db9a3f8c9e641c | diff --git a/lib/site_prism/page.rb b/lib/site_prism/page.rb
index <HASH>..<HASH> 100644
--- a/lib/site_prism/page.rb
+++ b/lib/site_prism/page.rb
@@ -11,7 +11,7 @@ module SitePrism
visit expanded_url
end
- def displayed?(seconds = Capybara.default_wait_time)
+ def displayed?(seconds = Waiter.default_wait_time)
raise SitePrism::NoUrlMatcherForPage if url_matcher.nil?
begin
Waiter.wait_until_true(seconds) {
diff --git a/lib/site_prism/waiter.rb b/lib/site_prism/waiter.rb
index <HASH>..<HASH> 100644
--- a/lib/site_prism/waiter.rb
+++ b/lib/site_prism/waiter.rb
@@ -8,4 +8,12 @@ module SitePrism::Waiter
}
raise TimeoutException.new, "Timed out while waiting for block to return true."
end
+
+ def self.default_wait_time
+ @@default_wait_time
+ end
+
+ private
+
+ @@default_wait_time = Capybara.default_wait_time
end
\ No newline at end of file | Reduce dependency on Capybara.default_wait_time by wrapping in locally controlled variable. | natritmeyer_site_prism | train | rb,rb |
a4e472f265a3a5e00b6bbc7f34e9918558958afa | diff --git a/src/JsonEditorPluginsAsset.php b/src/JsonEditorPluginsAsset.php
index <HASH>..<HASH> 100755
--- a/src/JsonEditorPluginsAsset.php
+++ b/src/JsonEditorPluginsAsset.php
@@ -25,6 +25,7 @@ class JsonEditorPluginsAsset extends AssetBundle
];
public $depends = [
+ JsonEditorAsset::class,
SelectizeAsset::class,
CKEditorAsset::class,
JqueryAsset::class | Update JsonEditorPluginsAsset.php
JsonEditorPluginsAsset was made optional a while ago and should be registered manually in order to use the CKEditor or Filefly plugin. However it needs implicitely the JsonEditorAsset. | dmstr_yii2-json-editor | train | php |
e62afc84611088588aca4abce0b9f08fdfc40c1e | diff --git a/andes/utils/streaming.py b/andes/utils/streaming.py
index <HASH>..<HASH> 100644
--- a/andes/utils/streaming.py
+++ b/andes/utils/streaming.py
@@ -279,7 +279,10 @@ class Streaming(object):
sleep(0.2)
self.dimec.broadcast('Idxvgs', self.Idxvgs)
sleep(0.2)
- self.dimec.broadcast('SysParam', self.SysParam)
+ try:
+ self.dimec.broadcast('SysParam', self.SysParam)
+ except:
+ self.system.Log.warning('SysParam broadcast error. Check bus coordinates.')
sleep(0.2)
else:
if type(recepient) != list: | Catch SysParam exception when xcoord and ycoord are lists | cuihantao_andes | train | py |
cd858e962a0b85f5b17e1be47e6a827287b8af13 | diff --git a/ssyncer/strack.py b/ssyncer/strack.py
index <HASH>..<HASH> 100644
--- a/ssyncer/strack.py
+++ b/ssyncer/strack.py
@@ -42,7 +42,7 @@ class strack:
self.client = sclient()
def map(key, data):
- return data[key] if key in data else ""
+ return str(data[key]) if key in data else ""
self.metadata = {
"id": map("id", track_data), | String cast for all track's metadata | Sliim_soundcloud-syncer | train | py |
9dcb69b423ec821dbed799dbb913dc5231b9ae25 | diff --git a/lib/device.js b/lib/device.js
index <HASH>..<HASH> 100644
--- a/lib/device.js
+++ b/lib/device.js
@@ -94,7 +94,7 @@ class Device extends EventEmitter {
let str = data.toString('utf8');
// Remove non-printable characters to invalid JSON from devices
- str = str.replace(/[\x00-\x09\x0B-\x0C\x0E-\x1F\x7F-\x9F]/g, '');
+ str = str.replace(/[\x00-\x09\x0B-\x0C\x0E-\x1F\x7F-\x9F]/g, ''); // eslint-disable-line
this.debug('<- Message: `' + str + '`');
try { | Disable linting for unicode cleanup | aholstenson_miio | train | js |
5d59cd8d6a8181cafa55af6189e0984b618e19be | diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
@@ -626,6 +626,7 @@ module ActiveRecord
indexes
end
+ # Returns an array of +MysqlColumn+ objects for the table specified by +table_name+.
def columns(table_name, name = nil)#:nodoc:
sql = "SHOW FIELDS FROM #{quote_table_name(table_name)}"
columns = []
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
@@ -244,6 +244,7 @@ module ActiveRecord
end
end
+ # Returns an array of +SQLiteColumn+ objects for the table specified by +table_name+.
def columns(table_name, name = nil) #:nodoc:
table_structure(table_name).map do |field|
case field["dflt_value"] | Added docs for #columns on some adapters | rails_rails | train | rb,rb |
62052e6f5e29dda0cbb993dcd9dc5008745b9122 | diff --git a/lib/query/query.js b/lib/query/query.js
index <HASH>..<HASH> 100644
--- a/lib/query/query.js
+++ b/lib/query/query.js
@@ -92,13 +92,13 @@ class Query extends SqlObject {
return;
}
try {
- try {
- conn.execute(self, this._params, options, callback);
- } catch (e) {
- callback(e);
- }
- } finally {
+ conn.execute(self, this._params, options, (...args) => {
+ conn.close();
+ callback(...args);
+ });
+ } catch (e) {
conn.close();
+ callback(e);
}
});
} | Fix unwanted close call while query executing. | sqbjs_sqb | train | js |
5d50d7576662d308c623ff71cd1e1e9aede6a00b | diff --git a/binding/owlapi/src/test/java/it/unibz/inf/ontop/owlapi/RedundantJoinFKProfTest.java b/binding/owlapi/src/test/java/it/unibz/inf/ontop/owlapi/RedundantJoinFKProfTest.java
index <HASH>..<HASH> 100644
--- a/binding/owlapi/src/test/java/it/unibz/inf/ontop/owlapi/RedundantJoinFKProfTest.java
+++ b/binding/owlapi/src/test/java/it/unibz/inf/ontop/owlapi/RedundantJoinFKProfTest.java
@@ -12,7 +12,8 @@ public class RedundantJoinFKProfTest extends AbstractOWLAPITest {
public static void setUp() throws Exception {
initOBDA("/test/redundant_join/redundant_join_fk_create.sql",
"/test/redundant_join/redundant_join_fk_test.obda",
- "/test/redundant_join/redundant_join_fk_test.owl");
+ "/test/redundant_join/redundant_join_fk_test.owl",
+ "/test/redundant_join/redundant_join_fk_test.properties");
}
@AfterClass | Properties file now also used by RedundantJoinFKProfTest. | ontop_ontop | train | java |
ff090fee08ea893169347a13d915312e18eee054 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -22,9 +22,10 @@ function warn(reason) {
* Fittings is the default framework provider for BigPipe.
*
* @constructor
+ * @param {BigPipe} bigpipe
* @api public
*/
-function Fittings() {
+function Fittings(bigpipe) {
/* Checkout http://github.com/bigpipe/bigpipe.js for example usage */
} | [minor] We should move all bigpipe logic in to fittings. | bigpipe_fittings | train | js |
b7b51698f683bdbdddd1622c71b33ab5a2f591f2 | diff --git a/library/Opf/Auth/Driver/Mysql.php b/library/Opf/Auth/Driver/Mysql.php
index <HASH>..<HASH> 100644
--- a/library/Opf/Auth/Driver/Mysql.php
+++ b/library/Opf/Auth/Driver/Mysql.php
@@ -24,6 +24,10 @@ class Mysql implements DriverInterface
{
$user = \Model::factory('User')->where('email', $username)->find_one();
- return password_verify($password, $user->password);
+ if($user) {
+ return password_verify($password, $user->password);
+ }
+
+ return false;
}
} | fix php notice when user is empty | ofeige_opf | train | php |
013e04ca6e6e97d80202745c4cd8e28ab9c5176e | diff --git a/tests/integration/states/test_file.py b/tests/integration/states/test_file.py
index <HASH>..<HASH> 100644
--- a/tests/integration/states/test_file.py
+++ b/tests/integration/states/test_file.py
@@ -1263,11 +1263,11 @@ class FileTest(ModuleCase, SaltReturnAssertsMixin):
if IS_WINDOWS:
ret = self.run_state(
- 'file.directory', name=tmp_dir, recurse={'mode'},
+ 'file.directory', name=tmp_dir, recurse=['mode'],
follow_symlinks=True, win_owner='Administrators')
else:
ret = self.run_state(
- 'file.directory', name=tmp_dir, recurse={'mode'},
+ 'file.directory', name=tmp_dir, recurse=['mode'],
file_mode=644, dir_mode=755)
self.assertSaltTrueReturn(ret) | Recurse kwarg of state.directory state shall be a list of None | saltstack_salt | train | py |
4fdf50c4694a5cb91180bcc1f5e5583289cb9234 | diff --git a/src/scripts/services/famous.js b/src/scripts/services/famous.js
index <HASH>..<HASH> 100644
--- a/src/scripts/services/famous.js
+++ b/src/scripts/services/famous.js
@@ -29,12 +29,14 @@ var requirements = [
"famous/surfaces/InputSurface",
"famous/transitions/Easing",
"famous/transitions/SpringTransition",
+ "famous/transitions/TransitionableTransform",
"famous/transitions/Transitionable",
"famous/utilities/KeyCodes",
"famous/utilities/Timer",
"famous/views/Scrollview",
"famous/views/Scroller",
- "famous/views/GridLayout"
+ "famous/views/GridLayout",
+ "famous/views/RenderController"
]
require.config({ | add TransitionableTransform, RenderController to imports | Famous_famous-angular | train | js |
ffa35409eb3531940624d58de98506468e4c7d4e | diff --git a/firefox/src/js/firefox-utils.js b/firefox/src/js/firefox-utils.js
index <HASH>..<HASH> 100644
--- a/firefox/src/js/firefox-utils.js
+++ b/firefox/src/js/firefox-utils.js
@@ -68,8 +68,16 @@ webdriver.firefox.utils.unwrap = function(thing) {
}
// unwrap is not available on older branches (3.5 and 3.6) - Bug 533596
+
if (XPCNativeWrapper && "unwrap" in XPCNativeWrapper) {
- return XPCNativeWrapper.unwrap(thing);
+ try {
+ return XPCNativeWrapper.unwrap(thing);
+ } catch(e) {
+ //Unwrapping will fail for JS literals - numbers, for example. Catch
+ // the exception and proceed, it will eventually be returend as-is.
+ Logger.dumpn("Unwrap failed: " + e);
+ }
+
}
if (thing['wrappedJSObject']) { | EranMes: Fix for Firefox 4. XPCNativeWrapper throws if it's passed a literal - catch nhis exception and move on to returning the value itself.
r<I> | SeleniumHQ_selenium | train | js |
cb0a5b4c4cc0488e8eecf060832b1370151cd0eb | diff --git a/micrometer-core/src/main/java/io/micrometer/core/instrument/logging/LoggingMeterRegistry.java b/micrometer-core/src/main/java/io/micrometer/core/instrument/logging/LoggingMeterRegistry.java
index <HASH>..<HASH> 100644
--- a/micrometer-core/src/main/java/io/micrometer/core/instrument/logging/LoggingMeterRegistry.java
+++ b/micrometer-core/src/main/java/io/micrometer/core/instrument/logging/LoggingMeterRegistry.java
@@ -159,7 +159,7 @@ public class LoggingMeterRegistry extends StepMeterRegistry {
}
String writeMeter(Meter meter, Printer print) {
- return print.id() + StreamSupport.stream(meter.measure().spliterator(), false)
+ return StreamSupport.stream(meter.measure().spliterator(), false)
.map(ms -> {
String msLine = ms.getStatistic().getTagValueRepresentation() + "=";
switch (ms.getStatistic()) {
@@ -176,7 +176,7 @@ public class LoggingMeterRegistry extends StepMeterRegistry {
return msLine + decimalOrNan(ms.getValue());
}
})
- .collect(joining(", ", " ", ""));
+ .collect(joining(", ", print.id() + " ", ""));
}
@Override | Replace concatenation with smaller one in LoggingMeterRegistry (#<I>) | micrometer-metrics_micrometer | train | java |
c557b6e6b510867483d723edb35eaa2fce82f61d | diff --git a/lib/Configuration.js b/lib/Configuration.js
index <HASH>..<HASH> 100644
--- a/lib/Configuration.js
+++ b/lib/Configuration.js
@@ -239,7 +239,7 @@ export default class Configuration {
pathToImportedModule: fromFile,
});
}
- if (!MERGABLE_CONFIG_OPTIONS.includes(key)) {
+ if (MERGABLE_CONFIG_OPTIONS.indexOf(key) === -1) {
// This key shouldn't be merged
return value;
} | Fix Node v4 build
Node 4 apparently doesn't have the `includes` function specified on
Arrays. | Galooshi_import-js | train | js |
873a0f4043833b939be53101e49cc74bb25c9989 | diff --git a/lib/ServerMiddleware/HSTS.php b/lib/ServerMiddleware/HSTS.php
index <HASH>..<HASH> 100644
--- a/lib/ServerMiddleware/HSTS.php
+++ b/lib/ServerMiddleware/HSTS.php
@@ -30,6 +30,6 @@ class HSTS implements ServerMiddlewareInterface {
}
$response = $frame->next($request);
$suffix = $this->includeSubdomains ? ';includeSubDomains' : '';
- return $response->withHeader("Strict-Transport-Security", "max-age=" . $this->maxAge . ";" . $suffix);
+ return $response->withHeader("Strict-Transport-Security", "max-age=" . $this->maxAge . $suffix);
}
} | Fixed double ; in Hsts header line | ircmaxell_Tari-PHP | train | php |
bec6249918561032298765127f9d3e9f7e3c3327 | diff --git a/client/client.js b/client/client.js
index <HASH>..<HASH> 100644
--- a/client/client.js
+++ b/client/client.js
@@ -156,7 +156,7 @@ client.reduxMiddleware = (store) => (next) => (action) => {
const {type} = action
const start = performanceNow()
const result = next(action)
- const ms = (performanceNow() - start).toFixed(2)
+ const ms = (performanceNow() - start).toFixed(0)
if (!R.contains(action.type, MIDDLEWARE_ACTION_IGNORE)) {
client.sendCommand('redux.action.done', {type, ms, action})
} | Removes sub-millisecond precision in logging. | infinitered_reactotron | train | js |
fa6ac601d66b3e52159b753bb79a18409239595b | diff --git a/lib/stack_master/commands/lint.rb b/lib/stack_master/commands/lint.rb
index <HASH>..<HASH> 100644
--- a/lib/stack_master/commands/lint.rb
+++ b/lib/stack_master/commands/lint.rb
@@ -19,6 +19,7 @@ module StackMaster
Tempfile.open(['stack', ".#{proposed_stack.template_format}"]) do |f|
f.write(proposed_stack.template_body)
+ f.flush
system('cfn-lint', f.path).nil?
puts "cfn-lint run complete"
end | Make sure we flush the buffers
Prevents sending incomplete file to cfn-lint | envato_stack_master | train | rb |
4ddbc78b53f2e2e6e1e430c9e480a524d8509c3b | diff --git a/eqcorrscan/utils/catalogue2DD.py b/eqcorrscan/utils/catalogue2DD.py
index <HASH>..<HASH> 100644
--- a/eqcorrscan/utils/catalogue2DD.py
+++ b/eqcorrscan/utils/catalogue2DD.py
@@ -209,7 +209,7 @@ def write_catalogue(event_list, max_sep=1, min_link=8):
Sfile_util.readheader(slave_sfile).longitude,\
Sfile_util.readheader(slave_sfile).depth)
if dist_calc(master_location, slave_location) > max_sep:
- break
+ continue
links=0 # Count the number of linkages
for pick in master_picks:
if pick.phase not in ['P','S']: | Bug-fix in write_catalog
Replace break statement for coping with distance between events, with
continue.
Former-commit-id: 6a9c<I>c<I>cb4e<I>faa<I>c0e1bce4d<I> | eqcorrscan_EQcorrscan | train | py |
8783e86120ce1b28fb589e66be3b2213434acd93 | diff --git a/execjs/__init__.py b/execjs/__init__.py
index <HASH>..<HASH> 100755
--- a/execjs/__init__.py
+++ b/execjs/__init__.py
@@ -41,16 +41,16 @@ runtimes = execjs._runtimes.runtimes
get_from_environment = execjs._runtimes.get_from_environment
-def eval(source):
- return get().eval(source)
-eval.__doc__= AbstractRuntime.eval.__doc__
+def eval(source, cwd=None):
+ return get().eval(source, cwd)
+eval.__doc__ = AbstractRuntime.eval.__doc__
-def exec_(source):
- return get().exec_(source)
-exec_.__doc__= AbstractRuntime.exec_.__doc__
+def exec_(source, cwd=None):
+ return get().exec_(source, cwd)
+exec_.__doc__ = AbstractRuntime.exec_.__doc__
-def compile(source):
- return get().compile(source)
-compile.__doc__= AbstractRuntime.compile.__doc__
+def compile(source, cwd=None):
+ return get().compile(source, cwd)
+compile.__doc__ = AbstractRuntime.compile.__doc__ | Added cwd argument to module-level functions | doloopwhile_PyExecJS | train | py |
637a7ca2adaf399fbd05be701767840814034692 | diff --git a/models/Domain.php b/models/Domain.php
index <HASH>..<HASH> 100644
--- a/models/Domain.php
+++ b/models/Domain.php
@@ -39,7 +39,7 @@ class Domain extends \hipanel\base\Model
/** @inheritdoc */
public function attributeLabels () {
- return $this->margeAttributeLabels([
+ return $this->mergeAttributeLabels([
'epp_client_id' => Yii::t('app', 'EPP client ID'),
'remoteid' => Yii::t('app', 'Remote ID'),
'statuses' => Yii::t('app', 'Statuses'), | renamed to mergeAttributeLabels from margeA... | hiqdev_hipanel-module-domain | train | php |
ea0bdf2e4bde363971b6650aaa41b06cbaecd625 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,9 +1,6 @@
import os
from setuptools import find_packages, setup
-with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
- README = readme.read()
-
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
@@ -13,11 +10,14 @@ setup(
packages=find_packages(),
include_package_data=True,
license='MIT License',
- description=' Behave test runner for Django.',
- long_description=README,
+ description='Behave BDD integration for Django',
url='https://github.com/mixxorz/behave-django',
author='Mitchel Cabuloy',
author_email='[email protected]',
+ install_requires=[
+ 'behave',
+ 'Django>=1.7'
+ ],
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Console', | Added dependencies to setup.py | behave_behave-django | train | py |
4fc6fe61db0d8eb59f33fd80bed42a0c4fb8e077 | diff --git a/src/main/java/org/dynjs/runtime/builtins/URLCodec.java b/src/main/java/org/dynjs/runtime/builtins/URLCodec.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/dynjs/runtime/builtins/URLCodec.java
+++ b/src/main/java/org/dynjs/runtime/builtins/URLCodec.java
@@ -178,6 +178,7 @@ public class URLCodec {
}
r.append(s);
+ ++k;
}
} | Increment the indexing var while decoding. Whoops. | dynjs_dynjs | train | java |
a924ae706aa519d8c95c1b92865457b6eba000eb | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@ with (here / 'README.md').open(encoding='utf-8') as f:
setup(
name='pythonanywhere',
- version='0.6',
+ version='0.7',
description='PythonAnywhere helper tools for users',
long_description=long_description,
url='https://github.com/pythonanywhere/helper_scripts/', | Bumped version. by: Giles | pythonanywhere_helper_scripts | train | py |
9bb1a79c02a4b9c0b9e02b7d15507b808d4ce824 | diff --git a/test/test_retry.rb b/test/test_retry.rb
index <HASH>..<HASH> 100644
--- a/test/test_retry.rb
+++ b/test/test_retry.rb
@@ -1,4 +1,5 @@
-require 'snmp/manager'
+require 'test/unit'
+require 'snmp'
class TimeoutManager < SNMP::Manager
attr_accessor :response_count
@@ -39,7 +40,7 @@ class MismatchIdTransport
def send(data, host, port)
bad_id_data = data.dup
- bad_msg = Message.decode(data)
+ bad_msg = SNMP::Message.decode(data)
bad_msg.pdu.request_id -= 3 # corrupt request_id
@data << bad_msg.encode # insert corrupted PDU before real data
@data << data | Tweak test so that it can run standalone | hallidave_ruby-snmp | train | rb |
5ac4a32e010308d209b8534fed824ae7d5683e98 | diff --git a/goose/cleaners.py b/goose/cleaners.py
index <HASH>..<HASH> 100644
--- a/goose/cleaners.py
+++ b/goose/cleaners.py
@@ -246,7 +246,8 @@ class DocumentCleaner(object):
bad_divs += 1
elif div is not None:
replaceNodes = self.get_replacement_nodes(doc, div)
- div.clear()
+ for child in self.parser.childNodes(div):
+ div.remove(child)
for c, n in enumerate(replaceNodes):
div.insert(c, n) | #<I> - remove childnode one by one to keep parent node | goose3_goose3 | train | py |
7f1510a6b47d4b99ffa95c5d0cd8d5e8fcda4713 | diff --git a/lib/active_scaffold/bridges/tiny_mce.rb b/lib/active_scaffold/bridges/tiny_mce.rb
index <HASH>..<HASH> 100644
--- a/lib/active_scaffold/bridges/tiny_mce.rb
+++ b/lib/active_scaffold/bridges/tiny_mce.rb
@@ -11,7 +11,7 @@ class ActiveScaffold::Bridges::TinyMce < ActiveScaffold::DataStructures::Bridge
def self.javascripts
case ActiveScaffold.js_framework
when :jquery
- ['tinymce-jquery', 'jquery/tiny_mce_bridge']
+ ['tinymce-jquery', 'jquery/tiny_mce_bridge', 'jquery/tiny_mce_bridge_settings']
when :prototype
['tinymce', 'prototype/tiny_mce_bridge']
end | Included the jquery/tiny_mce_bridge_settings file. | activescaffold_active_scaffold | train | rb |
cc6a542cf2faa79495c4505a9423d044f473520a | diff --git a/slick.grid.js b/slick.grid.js
index <HASH>..<HASH> 100644
--- a/slick.grid.js
+++ b/slick.grid.js
@@ -1150,7 +1150,7 @@ if (typeof Slick === "undefined") {
function scrollTo(y) {
y = Math.max(y, 0);
- y = Math.min(y, th - viewportH);
+ y = Math.min(y, th - viewportH + (viewportHasHScroll ? scrollbarDimensions.height : 0));
var oldOffset = offset; | Fix #<I> - vertical bounds checking wasn't accounting for the scrollbar. | coatue-oss_slickgrid2 | train | js |
751c56e147275422babb6813c4d8b205e117bb24 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -36,8 +36,9 @@ class ToxWithRecreate(Tox):
setup(
name='nomenclate',
- version='1.0.1',
+ version='1.0.2',
packages=find_packages(),
+ package_data={b'configYML': ['nomenclate/core/*.yml']},
include_package_data=True,
url='https://github.com/andresmweber/nomenclate',
license='MIT', | Added config file to the pypi dist via setup.py as it was not recognized in the bdist_wheel automatically | AndresMWeber_Nomenclate | train | py |
4a25cc3f46989519b4cd37191703c5ad40f07f1c | diff --git a/src/java/com/threerings/io/Streamer.java b/src/java/com/threerings/io/Streamer.java
index <HASH>..<HASH> 100644
--- a/src/java/com/threerings/io/Streamer.java
+++ b/src/java/com/threerings/io/Streamer.java
@@ -423,12 +423,20 @@ public class Streamer
_target = target;
// if this is a non-anonymous inner class, freak out because we cannot stream those
- if (_target.isLocalClass() || _target.isAnonymousClass() ||
- (_target.isMemberClass() && !Modifier.isStatic(_target.getModifiers()))) {
- throw new IllegalArgumentException(
- "Cannot stream non-static inner class: " + _target.getName());
+ try {
+ if (_target.isLocalClass() || _target.isAnonymousClass() ||
+ (_target.isMemberClass() && !Modifier.isStatic(_target.getModifiers()))) {
+ throw new IllegalArgumentException(
+ "Cannot stream non-static inner class: " + _target.getName());
+ }
+ } catch (InternalError ie) {
+ // The checks on the class's localness are capable of throwing these. If we do, let's
+ // give better errors than the ones the JVM is willing to give.
+ log.warning("Internal error in checking localness of class: " +
+ "[class=" + _target.getName() + "]");
+ throw ie;
}
-
+
// if our target class is an array, we want to get a handle on a streamer delegate that
// we'll use to stream our elements
if (_target.isArray()) { | If we fail spectacularly in checking localness, let's print out what class is having trouble, since the java libs don't actually do that.
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 |
5ddd57845cccce91cf3f05f8d7c10ac094408503 | diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/ternPlugins/amqp.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/ternPlugins/amqp.js
index <HASH>..<HASH> 100644
--- a/bundles/org.eclipse.orion.client.javascript/web/javascript/ternPlugins/amqp.js
+++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/ternPlugins/amqp.js
@@ -1,6 +1,6 @@
/*******************************************************************************
* @license
- * Copyright (c) 2015, 2016 IBM Corporation and others.
+ * Copyright (c) 2015, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials are made
* available under the terms of the Eclipse Public License v1.0
* (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
@@ -104,7 +104,6 @@ define([
c.overwrite = true;
});
});
- delete cachedQuery;
}
}
} | Bug <I> - Usage of delete operator on a variable | eclipse_orion.client | train | js |
cd53e38d375c50d74828362ef6735f6862cd6f1d | diff --git a/classes/ezperflogger.php b/classes/ezperflogger.php
index <HASH>..<HASH> 100644
--- a/classes/ezperflogger.php
+++ b/classes/ezperflogger.php
@@ -269,13 +269,14 @@ class eZPerfLogger
/// @todo log warning
continue;
}
- $datetime = DateTime::createFromFormat( 'd/M/Y:H:i:s O', $matches[4] );
- if ( !$datetime )
+
+ $time = strtotime( implode( ' ', explode( ':', str_replace( '/', '.', $str ), 2 ) ) );
+ if ( !$time )
{
/// @todo log warning
continue;
}
- $time = $datetime->format( 'U' );
+
$ip = $matches[1];
if ( $time == $startTime ) | Allow log file parsing to work on php <I> | gggeek_ezperformancelogger | train | php |
9cc2ff1434c0d34452c8e02da63fd4c919261509 | diff --git a/pandora/models/pandora.py b/pandora/models/pandora.py
index <HASH>..<HASH> 100644
--- a/pandora/models/pandora.py
+++ b/pandora/models/pandora.py
@@ -88,9 +88,23 @@ class PlaylistModel(PandoraModel):
"""
audio_url = None
url_map = data.get("audioUrlMap")
-
+ audio_url = data.get("audioUrl")
+
+ # Only an audio URL, not a quality map. This happens for most of the
+ # mobile client tokens and some of the others now. In this case
+ # substitute the empirically determined default values in the format
+ # used by the rest of the function so downstream consumers continue to
+ # work.
+ if audio_url and not url_map:
+ url_map = {
+ BaseAPIClient.HIGH_AUDIO_QUALITY: {
+ "audioUrl": audio_url,
+ "bitrate": 64,
+ "encoding": "aacplus",
+ }
+ }
# No audio url available (e.g. ad tokens)
- if not url_map:
+ elif not url_map:
return None
valid_audio_formats = [BaseAPIClient.HIGH_AUDIO_QUALITY, | Support new-style audio URLs
Pandora now returns two different responses to the API depending on
which API key the client is using and the tuner endpoint. Instead of a
quality map only a single audio URL is returned which is of AAC SBR
format. This change accommodates that and returns the proper bitrate and
format based on empirical testing.
see: #<I> | mcrute_pydora | train | py |
f6ccd2c15c4876728cac443bba963e8e34ea8920 | diff --git a/includes/_rewrites.php b/includes/_rewrites.php
index <HASH>..<HASH> 100644
--- a/includes/_rewrites.php
+++ b/includes/_rewrites.php
@@ -1,7 +1,7 @@
<?php
defined( 'ABSPATH' ) or die( 'This plugin must be run within the scope of WordPress.' );
-function eduadmin_rewrite_init()
+function eduadmin_rewrite_init($rewrites)
{
add_rewrite_tag('%courseSlug%', '([^&]+)');
add_rewrite_tag('%courseId%', '([^&]+)');
@@ -59,8 +59,10 @@ function eduadmin_rewrite_init()
add_rewrite_rule($courseFolder . '/?$', 'index.php?page_id=' . $listView, 'top');
}
}
+
+ return $rewrites;
}
-add_action('init', 'eduadmin_rewrite_init');
+//add_action('init', 'eduadmin_rewrite_init');
add_filter('option_rewrite_rules', 'eduadmin_rewrite_init', 5);
?>
\ No newline at end of file | Fix for rewrites, provided by grafikfabriken.nu | MultinetInteractive_EduAdmin-WordPress | train | php |
2634303f82680829bde0e2b67fd5bb6a621e976c | diff --git a/v2/forecast.go b/v2/forecast.go
index <HASH>..<HASH> 100644
--- a/v2/forecast.go
+++ b/v2/forecast.go
@@ -14,7 +14,7 @@ const (
)
type Flags struct {
- DarkSkyUnavailable string `json:""`
+ DarkSkyUnavailable string `json:"darksky-unavailable"`
DarkSkyStations []string `json:"darksky-stations"`
DataPointStations []string `json:"datapoint-stations"`
ISDStations []string `json:"isds-stations"`
@@ -70,7 +70,7 @@ type Forecast struct {
Timezone string `json:"timezone"`
Offset float64 `json:"offset"`
Currently DataPoint `json:"currently"`
- Minutely DataBlock `json:"Minutely"`
+ Minutely DataBlock `json:"minutely"`
Hourly DataBlock `json:"hourly"`
Daily DataBlock `json:"daily"`
Alerts []alert `json:"alerts"` | fix a few missed json encodings | mlbright_darksky | train | go |
bc1e5755a9a9e247099872cc64f2fe498847ec1a | diff --git a/lib/async-map.js b/lib/async-map.js
index <HASH>..<HASH> 100644
--- a/lib/async-map.js
+++ b/lib/async-map.js
@@ -26,7 +26,8 @@ function asyncMap () {
, a = l * n
if (!a) return cb_(null, [])
function cb (er) {
- if (errState) return
+ if (er && !errState) errState = er
+
var argLen = arguments.length
for (var i = 1; i < argLen; i ++) if (arguments[i] !== undefined) {
data[i - 1] = (data[i - 1] || []).concat(arguments[i])
@@ -43,10 +44,7 @@ function asyncMap () {
})
}
- if (er || --a === 0) {
- errState = er
- cb_.apply(null, [errState].concat(data))
- }
+ if (--a === 0) cb_.apply(null, [errState].concat(data))
}
// expect the supplied cb function to be called
// "n" times for each thing in the array. | wait for all callbacks to complete | npm_slide-flow-control | train | js |
d1144d0b315d070a95f77ad2f54fd06191047204 | diff --git a/tests/run-child.js b/tests/run-child.js
index <HASH>..<HASH> 100644
--- a/tests/run-child.js
+++ b/tests/run-child.js
@@ -15,7 +15,7 @@ if (argv.language) {
}
process.send({success: true});
} catch (e) {
- process.send({error: e.message});
+ process.send({error: JSON.stringify(e)});
}
}
});
diff --git a/tests/run.js b/tests/run.js
index <HASH>..<HASH> 100644
--- a/tests/run.js
+++ b/tests/run.js
@@ -49,7 +49,7 @@ for (var language in testSuite) {
// over and over again.
setTimeout(function() {
if (o.error) {
- throw new Error(o.error);
+ throw JSON.parse(o.error);
} else if (o.success) {
done();
} | Test suite: fixed missing diff in error message | PrismJS_prism | train | js,js |
d5c236fb0eaf05a06b557b2f1dec7e45a2ec3733 | diff --git a/src/DatabaseLayer.php b/src/DatabaseLayer.php
index <HASH>..<HASH> 100644
--- a/src/DatabaseLayer.php
+++ b/src/DatabaseLayer.php
@@ -3,8 +3,6 @@ namespace Thru\ActiveRecord;
use Monolog\Logger;
use Thru\ActiveRecord\DatabaseLayer\ConfigurationException;
-use Thru\ActiveRecord\DatabaseLayer\IndexException;
-use Thru\ActiveRecord\DatabaseLayer\TableDoesntExistException;
class DatabaseLayer
{
@@ -16,6 +14,7 @@ class DatabaseLayer
private $logger;
/**
+ * @throws ConfigurationException
* @return DatabaseLayer
*/
public static function getInstance() | Remove unneded use(), add docblock. | Thruio_ActiveRecord | train | php |
05827cf73deabd816d43ed8668081b3894b88861 | diff --git a/bin/test.js b/bin/test.js
index <HASH>..<HASH> 100644
--- a/bin/test.js
+++ b/bin/test.js
@@ -28,7 +28,7 @@ mkdirp.sync(TMP)
series(URLS.map(function (url) {
return function (cb) {
- var name = /\/([^.]+)\.git$/.exec(url)[1]
+ var name = /\/([^.\/]+)\.git$/.exec(url)[1]
var args = [ 'clone', url, path.join(TMP, name) ]
// TODO: Start `git` in a way that works on Windows – PR welcome!
spawn('git', args, cb) | tests: don't create nested folders when git cloning | standard_standard-engine | train | js |
0f6fea7fc7d57af6faf7193fc30f36be020f3f3b | diff --git a/bugwarrior/services/gitlab.py b/bugwarrior/services/gitlab.py
index <HASH>..<HASH> 100644
--- a/bugwarrior/services/gitlab.py
+++ b/bugwarrior/services/gitlab.py
@@ -205,6 +205,11 @@ class GitlabService(IssueService):
'label_template': self.label_template,
}
+
+ def get_owner(self, issue):
+ if issue[1]['assignee'] != None and issue[1]['assignee']['username']:
+ return issue[1]['assignee']['username']
+
def filter_repos(self, repo):
if self.exclude_repos:
if repo['path_with_namespace'] in self.exclude_repos: | Added only_if_assigned to gitlab | ralphbean_bugwarrior | train | py |
e292edd7f51155c410ac56ed2b260db928317dea | diff --git a/src/components/ScrollMarker.js b/src/components/ScrollMarker.js
index <HASH>..<HASH> 100644
--- a/src/components/ScrollMarker.js
+++ b/src/components/ScrollMarker.js
@@ -52,7 +52,7 @@ export default {
},
visible: {
type: Boolean,
- defualt: () => false
+ default: () => false
},
spacing: {
type: Number, | Fix default spelling mistake
Fixes the VueJS warning "[Vue warn]: Invalid key "defualt" in validation rules object for prop "visible"." | chrishurlburt_vue-scrollview | train | js |
e5b2613d9f592d533186cf2120a16269ddebdaa8 | diff --git a/src/ArrayContainer.php b/src/ArrayContainer.php
index <HASH>..<HASH> 100644
--- a/src/ArrayContainer.php
+++ b/src/ArrayContainer.php
@@ -254,17 +254,17 @@ class ArrayContainer implements ArrayAccess, Iterator
if ($value = $value->arrayAccessByKey($keyPart)) {
break;
} else {
- return;
+ return null;
}
}
}
if (! isset($value[$keyPart])) {
- return;
+ return null;
}
if (is_array($value[$keyPart]) && ! array_key_exists($keyPart, $value)) {
- return;
+ return null;
}
$value = $value[$keyPart];
} | :rotating_light: Fixing phpmd linter issues as per #<I> | tapestry-cloud_tapestry | train | php |
fdf986871afb311a4fe0dae8957908f338f57a7f | diff --git a/ffn/finance.py b/ffn/finance.py
index <HASH>..<HASH> 100644
--- a/ffn/finance.py
+++ b/ffn/finance.py
@@ -784,6 +784,19 @@ def calc_risk_return_ratio(self):
return self.mean() / self.std()
+def calc_information_ratio(self, benchmark):
+ """
+ http://en.wikipedia.org/wiki/Information_ratio
+ """
+ diff_rets = self - benchmark
+ diff_std = diff_rets.std()
+
+ if np.isnan(diff_std) or diff_std == 0:
+ return 0.0
+
+ return diff_rets.mean() / diff_std
+
+
def calc_total_return(prices):
return (prices.ix[-1] / prices.ix[0]) - 1
@@ -900,6 +913,7 @@ def extend_pandas():
PandasObject.to_monthly = to_monthly
PandasObject.asfreq_actual = asfreq_actual
PandasObject.drop_duplicate_cols = drop_duplicate_cols
+ PandasObject.calc_information_ratio = calc_information_ratio
def calc_inv_vol_weights(returns): | added calc_information_ratio | pmorissette_ffn | train | py |
6d4ed2174ee68b09782b4a9c748353854ff06f3b | diff --git a/src/videojs5.hlsjs.js b/src/videojs5.hlsjs.js
index <HASH>..<HASH> 100644
--- a/src/videojs5.hlsjs.js
+++ b/src/videojs5.hlsjs.js
@@ -94,6 +94,13 @@
}
});
+ Object.keys(Hls.Events).forEach(function(key) {
+ var eventName = Hls.Events[key];
+ hls.on(eventName, function(event, data) {
+ tech.trigger(eventName, data);
+ });
+ });
+
// attach hlsjs to videotag
hls.attachMedia(el);
hls.loadSource(source.src); | Broadcast level loaded event on tech.
This allows consumers to get at custom metadata from the HLS manifest. | Peer5_videojs-contrib-hls.js | train | js |
f487cf9489fe3a8199f4510c13b3aa6b867fa985 | diff --git a/src/components/Loading/Loading.js b/src/components/Loading/Loading.js
index <HASH>..<HASH> 100644
--- a/src/components/Loading/Loading.js
+++ b/src/components/Loading/Loading.js
@@ -34,16 +34,29 @@ export default class Loading extends React.Component {
* Specify whether you would like the small variant of <Loading>
*/
small: PropTypes.bool,
+
+ /**
+ * Specify an description that would be used to best describe the loading state
+ */
+ description: PropTypes.string,
};
static defaultProps = {
active: true,
withOverlay: true,
small: false,
+ description: 'Active loading indicator',
};
render() {
- const { active, className, withOverlay, small, ...other } = this.props;
+ const {
+ active,
+ className,
+ withOverlay,
+ small,
+ description,
+ ...other
+ } = this.props;
const loadingClasses = classNames(`${prefix}--loading`, className, {
[`${prefix}--loading--small`]: small,
@@ -57,6 +70,7 @@ export default class Loading extends React.Component {
const loading = (
<div
{...other}
+ aria-label={description}
aria-live={active ? 'assertive' : 'off'}
className={loadingClasses}>
<svg className={`${prefix}--loading__svg`} viewBox="-75 -75 150 150"> | fix(Loading): adds aria-label and description property to component (#<I>)
* fix: adds property description
* fix: adds description property to aria-label
* fix: typo
* fix: typo | carbon-design-system_carbon-components-react | train | js |
6539a1a6c0ac230c9a0357016c0f2ee8a78ffad2 | diff --git a/rtree/index.py b/rtree/index.py
index <HASH>..<HASH> 100644
--- a/rtree/index.py
+++ b/rtree/index.py
@@ -7,8 +7,6 @@ from . import core
import pickle
-import sys
-
RT_Memory = 0
@@ -1508,7 +1506,6 @@ class Property(object):
def get_filename(self):
return core.rt.IndexProperty_GetFileName(self.handle).decode()
-
def set_filename(self, value):
if isinstance(value, str):
value = value.encode('utf-8')
@@ -1520,7 +1517,6 @@ class Property(object):
def get_dat_extension(self):
return core.rt.IndexProperty_GetFileNameExtensionDat(self.handle).decode()
-
def set_dat_extension(self, value):
if isinstance(value, str):
value = value.encode('utf-8')
@@ -1533,7 +1529,6 @@ class Property(object):
def get_idx_extension(self):
return core.rt.IndexProperty_GetFileNameExtensionIdx(self.handle).decode()
-
def set_idx_extension(self, value):
if isinstance(value, str):
value = value.encode('utf-8') | Rebase branch for changes related to dropping Python 2 support | Toblerity_rtree | train | py |
9b58479967d51f46ef9e983db9bedcab132a466c | diff --git a/magic.py b/magic.py
index <HASH>..<HASH> 100644
--- a/magic.py
+++ b/magic.py
@@ -69,6 +69,7 @@ class Magic:
return magic_file(self.cookie, filename)
def __del__(self):
+ # during shutdown magic_close may have been cleared already
if self.cookie and magic_close:
magic_close(self.cookie)
self.cookie = None | explain change to __del__ | ahupp_python-magic | train | py |
3c0babaca072ecab61534186434884e360ef260b | diff --git a/tinymce/widgets.py b/tinymce/widgets.py
index <HASH>..<HASH> 100644
--- a/tinymce/widgets.py
+++ b/tinymce/widgets.py
@@ -129,7 +129,7 @@ class TinyMCE(Textarea):
final_attrs['name'] = name
mce_config = self.profile.copy()
mce_config.update(self.mce_attrs)
- mce_config['selector'] += '#{0}'.format(final_attrs['id'])
+ mce_config['selector'] = mce_config.get('selector', 'textarea') + '#{0}'.format(final_attrs['id'])
if mce_config.get('inline', False):
html = '<div{0}>{1}</div>\n'.format(flatatt(final_attrs), escape(value))
else: | Adds a safeguard against missing TinyMCE 'selector' property | romanvm_django-tinymce4-lite | train | py |
945384cca227924e8f7f1eb9151e124de5871766 | diff --git a/js/test/base/functions/test.number.js b/js/test/base/functions/test.number.js
index <HASH>..<HASH> 100644
--- a/js/test/base/functions/test.number.js
+++ b/js/test/base/functions/test.number.js
@@ -17,7 +17,7 @@ assert (numberToString (7.9e27) === '7900000000000000000000000000');
assert (numberToString (-12.345) === '-12.345');
assert (numberToString (12.345) === '12.345');
assert (numberToString (0) === '0');
-// this line breaks the test
+// the following line breaks the test
// see https://github.com/ccxt/ccxt/issues/5744
// assert (numberToString (0.00000001) === '0.00000001'); | test.number.js minor edits | ccxt_ccxt | train | js |
Subsets and Splits