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
|
---|---|---|---|---|---|
fb0067754fbb8ded49f669ad6c288427dec5bf2b | diff --git a/src/toil/batchSystems/singleMachine.py b/src/toil/batchSystems/singleMachine.py
index <HASH>..<HASH> 100644
--- a/src/toil/batchSystems/singleMachine.py
+++ b/src/toil/batchSystems/singleMachine.py
@@ -26,7 +26,6 @@ from threading import Lock, Condition
# Python 3 compatibility imports
from six.moves.queue import Empty, Queue
from six.moves import xrange
-from six import iteritems
import toil
from toil.batchSystems.abstractBatchSystem import BatchSystemSupport, InsufficientSystemResources
@@ -231,7 +230,7 @@ class SingleMachineBatchSystem(BatchSystemSupport):
def getRunningBatchJobIDs(self):
now = time.time()
- return {jobID: now - info.time for jobID, info in iteritems(self.runningJobs)}
+ return {jobID: now - info.time for jobID, info in self.runningJobs.items()}
def shutdown(self):
""" | Use list of items rather than generator (resolves #<I>) | DataBiosphere_toil | train | py |
f92da9e99c06fc6d4c9ec8c6d9553028c8afb60c | diff --git a/replacer.py b/replacer.py
index <HASH>..<HASH> 100644
--- a/replacer.py
+++ b/replacer.py
@@ -209,7 +209,7 @@ def replace_in_file(args, in_file, regexp, repl):
try:
with open(in_file, "r") as in_fd:
in_lines = in_fd.readlines()
- except OSError as error:
+ except (OSError, UnicodeDecodeError) as error:
print("Cant open file:", in_file, error)
return
diff --git a/test/test_replacer.py b/test/test_replacer.py
index <HASH>..<HASH> 100644
--- a/test/test_replacer.py
+++ b/test/test_replacer.py
@@ -135,3 +135,10 @@ def test_truncate_long_lines(test_path, long_line, capsys):
assert re.search("-- .* - I'm old - .*", stdout)
assert re.search(r"\+\+ .* - I'm new - .*", stdout)
print(stdout)
+
+
+def test_non_utf_8(test_path, monkeypatch):
+ # Just check it does not crash
+ latin_1_encoded = "café".encode("latin-1")
+ test_path.joinpath("non-utf8.txt").write_bytes(latin_1_encoded)
+ replacer.main(["old", "new"]) | Partial fix for #3
Fix regression introduced by.
commit aad<I>e<I>a<I>bed<I>b6c3b8de<I>e<I> | dmerejkowsky_replacer | train | py,py |
9ae80acde59d9d149ee5e4e2097f209eac6f834f | diff --git a/src/core/util/perf.js b/src/core/util/perf.js
index <HASH>..<HASH> 100644
--- a/src/core/util/perf.js
+++ b/src/core/util/perf.js
@@ -18,7 +18,7 @@ if (process.env.NODE_ENV !== 'production') {
perf.measure(name, startTag, endTag)
perf.clearMarks(startTag)
perf.clearMarks(endTag)
- perf.clearMeasures(name)
+ // perf.clearMeasures(name)
}
}
} | feat: expose performance measures
ref #<I> | kaola-fed_megalo | train | js |
e93060525279fceffdcf975135b6a894c3dc0537 | diff --git a/pygsp/filters.py b/pygsp/filters.py
index <HASH>..<HASH> 100644
--- a/pygsp/filters.py
+++ b/pygsp/filters.py
@@ -35,7 +35,7 @@ class Filter(object):
print('filters should be a list, even if it has only one filter.')
self.g = [filters]
- def analysis(self, G, s, method=None, cheb_order=30, **kwargs):
+ def analysis(self, G, s, method=None, cheb_order=30, verbose=True, **kwargs):
r"""
Operator to analyse a filterbank
@@ -48,6 +48,8 @@ class Filter(object):
wether using an exact method, cheby approx or lanczos
cheb_order : int
Order for chebyshev
+ verbose : Verbosity level (False no log - True display warnings)
+ Default is True
Returns
-------
@@ -86,7 +88,7 @@ class Filter(object):
Nf = len(self.g)
- if self.verbose:
+ if verbose:
print('The analysis method is ', method)
if method == 'exact': | Add some verbosity in filter_analysis. (can now diplay the method) | epfl-lts2_pygsp | train | py |
841dff6182ee0b6a19b595dd83cce60fa937a450 | diff --git a/insteonplm/statechangesignal.py b/insteonplm/statechangesignal.py
index <HASH>..<HASH> 100644
--- a/insteonplm/statechangesignal.py
+++ b/insteonplm/statechangesignal.py
@@ -53,4 +53,5 @@ class StateChangeSignal(object):
return self._stateName
def async_refresh_state(self):
- self._updatemethod()
\ No newline at end of file
+ if self._updatemethod is not None:
+ self._updatemethod()
\ No newline at end of file | Allow readonly devices (motion sensors, etc.) have an update method of None | nugget_python-insteonplm | train | py |
2f4992a6105ff6d1226baefcee15407b4a50ed65 | diff --git a/azurerm/data_source_api_management_api.go b/azurerm/data_source_api_management_api.go
index <HASH>..<HASH> 100644
--- a/azurerm/data_source_api_management_api.go
+++ b/azurerm/data_source_api_management_api.go
@@ -119,7 +119,7 @@ func dataSourceApiManagementApiRead(d *schema.ResourceData, meta interface{}) er
return fmt.Errorf("API Management API %q (Service %q / Resource Group %q) was not found", name, serviceName, resGroup)
}
- return fmt.Errorf("Error retrieving API Management API %q (Resource Group %q): %+v", name, resGroup, err)
+ return fmt.Errorf("Error retrieving API Management API %q (Service %q / Resource Group %q): %+v", name, serviceName, resGroup, err)
}
d.SetId(*resp.ID) | Output APIM Service name on error | terraform-providers_terraform-provider-azurerm | train | go |
edf500992725516b7e83ee3267fc77392c2b1ab3 | diff --git a/lib/sshez/parser.rb b/lib/sshez/parser.rb
index <HASH>..<HASH> 100644
--- a/lib/sshez/parser.rb
+++ b/lib/sshez/parser.rb
@@ -57,14 +57,14 @@ module Sshez
opts.separator ''
opts.separator 'Specific options:'
- options_for_add(opts)
+ options_for_add(opts, options)
# signals that we are in testing mode
opts.on('-t', '--test', 'Writes nothing') do
options.test = true
end
- common_options(opts)
+ common_options(opts, options)
end # OptionParser.new
end
@@ -72,7 +72,7 @@ module Sshez
#
# Returns the options specifice to the add command only
#
- def options_for_add(opts)
+ def options_for_add(opts, options)
opts.on('-p', '--port PORT',
'Specify a port') do |port|
options.file_content.port_text = " Port #{port}\n"
@@ -91,7 +91,7 @@ module Sshez
#
# Returns the standard options
#
- def common_options(opts)
+ def common_options(opts, options)
opts.separator ''
opts.separator 'Common options:' | refactored the options to common and options for add | GomaaK_sshez | train | rb |
fa3212b2a59347adfdbf3103fb11332467ac3e64 | diff --git a/bin/server.js b/bin/server.js
index <HASH>..<HASH> 100755
--- a/bin/server.js
+++ b/bin/server.js
@@ -258,6 +258,7 @@ if (wsport) {
ws.on('error', function (error) {
console.log('## websocket connection error');
console.log(error.stack);
+ handleClose(sock);
});
});
} | server.js: Fix handling of client connection error | skale-me_skale | train | js |
e30a1b7bfb402760f8961105827eac50176043ae | diff --git a/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/olap/computer/FulgoraGraphComputer.java b/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/olap/computer/FulgoraGraphComputer.java
index <HASH>..<HASH> 100644
--- a/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/olap/computer/FulgoraGraphComputer.java
+++ b/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/olap/computer/FulgoraGraphComputer.java
@@ -353,8 +353,7 @@ public class FulgoraGraphComputer implements TitanGraphComputer {
return new Features() {
@Override
public boolean supportsResultGraphPersistCombination(final ResultGraph resultGraph, final Persist persist) {
- return (persist == Persist.NOTHING || persist == Persist.VERTEX_PROPERTIES) &&
- (resultGraph == ResultGraph.NEW || resultGraph == ResultGraph.ORIGINAL);
+ return persist == Persist.NOTHING || persist == Persist.VERTEX_PROPERTIES;
}
@Override | a minor logic fix in FulgoraGraphComputer. | thinkaurelius_titan | train | java |
93fc3ba5dfc2cdd7da138c5e6070202d93859a7d | diff --git a/match/lib/match/storage/google_cloud_storage.rb b/match/lib/match/storage/google_cloud_storage.rb
index <HASH>..<HASH> 100644
--- a/match/lib/match/storage/google_cloud_storage.rb
+++ b/match/lib/match/storage/google_cloud_storage.rb
@@ -212,7 +212,7 @@ module Match
# This can only happen after we went through auth of Google Cloud
available_bucket_identifiers = self.gc_storage.buckets.collect(&:id)
if available_bucket_identifiers.count > 0
- @bucket_name = UI.select("What Google Cloud Storage bucket do you want to use?", available_bucket_identifiers)
+ @bucket_name = UI.select("What Google Cloud Storage bucket do you want to use? (you can define it using the `google_cloud_bucket_name` key)", available_bucket_identifiers)
else
UI.error("Looks like your Google Cloud account for the project ID '#{self.project_id}' doesn't")
UI.error("have any available storage buckets yet. Please visit the following URL") | Add key information to GC bucket selection (#<I>) | fastlane_fastlane | train | rb |
8f47230ea94680272fa4bd4caf4f94d5506ceebb | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -27,7 +27,6 @@ requirements = [
"Twisted[tls,conch] >= 16.0.0",
# Celery packages
- "celery",
"txcelery-py3 >= 1.2.0",
# The package for RW support | Downgraded celery dependency for windows. | Synerty_peek-plugin-base | train | py |
5f7bcc0bfd16b6c3362c338e0d15bcd6fb986303 | diff --git a/mixbox/fields.py b/mixbox/fields.py
index <HASH>..<HASH> 100644
--- a/mixbox/fields.py
+++ b/mixbox/fields.py
@@ -343,8 +343,9 @@ class LongField(TypedField):
class FloatField(TypedField):
def _clean(self, value):
- if value not in (None, ""):
- return float(value)
+ if value in (None, ""):
+ return None
+ return float(value)
class DateTimeField(TypedField): | Added explicit return None to FloatField._clean() | CybOXProject_mixbox | train | py |
d7e92ebe370272d31f0eea1a7aebc768ac52b75d | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -102,7 +102,6 @@ setup(name=PACKAGENAME,
version=VERSION,
description=DESCRIPTION,
scripts=scripts,
- requires=['astropy'],
install_requires=install_requires,
provides=[PACKAGENAME],
author=AUTHOR, | Remove deprecated requires keyword from setup | astropy_pyregion | train | py |
d76d3315b0124fb33042681829b448ad466b827f | diff --git a/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRepository.java b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRepository.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRepository.java
+++ b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRepository.java
@@ -227,6 +227,10 @@ public class GhprbRepository {
} else if ("synchronize".equals(pr.getAction())) {
GhprbPullRequest pull = pulls.get(pr.getNumber());
if (pull == null) {
+ pulls.putIfAbsent(pr.getNumber(), new GhprbPullRequest(pr.getPullRequest(), helper, this));
+ pull = pulls.get(pr.getNumber());
+ }
+ if (pull == null) {
logger.log(Level.SEVERE, "Pull Request #{0} doesn't exist", pr.getNumber());
return;
} | Create missing PR during synchronize trigger
When the GitHub syncronize trigger is sent (e.g. adding commits to a
pull request) it can fail if Jenkins didn't previously know about the
PR. This can happen, for example, if Jenkins missed an `opened`
message, or if the PR was created before GHPRB was enabled.
This fixes this by creating the pull request if it is missing. | jenkinsci_ghprb-plugin | train | java |
9f43d70d24e50a83908b77a9602ee8ece6744b3c | diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php
index <HASH>..<HASH> 100644
--- a/lib/deprecatedlib.php
+++ b/lib/deprecatedlib.php
@@ -194,7 +194,7 @@ function get_recent_enrolments($courseid, $timestart) {
AND l.course = ?
AND l.module = 'course'
AND l.action = 'enrol'
- AND l.info = u.id
+ AND ".$DB->sql_cast_char2int('l.info')." = u.id
AND u.id = ra.userid
AND ra.contextid ".get_related_contexts_string($context)."
ORDER BY l.time ASC"; | MDL-<I> char to int cast problem in get_recent_enrolments() | moodle_moodle | train | php |
cd1fcaafcc7d99afe0f4c59e384163b388c0d670 | diff --git a/modules/webfonts/class-kirki-modules-webfonts.php b/modules/webfonts/class-kirki-modules-webfonts.php
index <HASH>..<HASH> 100644
--- a/modules/webfonts/class-kirki-modules-webfonts.php
+++ b/modules/webfonts/class-kirki-modules-webfonts.php
@@ -73,10 +73,20 @@ class Kirki_Modules_Webfonts {
include_once wp_normalize_path( dirname( __FILE__ ) . '/class-kirki-fonts.php' );
include_once wp_normalize_path( dirname( __FILE__ ) . '/class-kirki-fonts-google.php' );
+ add_action( 'after_setup_theme', array( $this, 'run' ) );
+
+ }
+
+ /**
+ * Run on after_setup_theme.
+ *
+ * @access public
+ * @since 3.0.0
+ */
+ public function run() {
$this->fonts_google = Kirki_Fonts_Google::get_instance();
$this->maybe_fallback_to_link();
$this->init();
-
}
/** | :bug: run main webfonts loader on after_setup_theme. | aristath_kirki | train | php |
288b37747980a142fe4b20bf2a28cc4465b82c7c | diff --git a/wagtailnews/views/editor.py b/wagtailnews/views/editor.py
index <HASH>..<HASH> 100644
--- a/wagtailnews/views/editor.py
+++ b/wagtailnews/views/editor.py
@@ -22,6 +22,18 @@ from ..permissions import format_perms, perms_for_template
OPEN_PREVIEW_PARAM = 'do_preview'
+# Wagtail < 2.6 compatibility
+def bind_to_instance(self, instance, form, request):
+ return self.bind_to(instance=instance, form=form, request=request)
+def bind_to_model(self, model):
+ return self.bind_to(model=model)
+
+from wagtail.admin.edit_handlers import EditHandler
+if hasattr(EditHandler(), 'bind_to'):
+ EditHandler.bind_to_model = bind_to_model
+ EditHandler.bind_to_instance = bind_to_instance
+# Wagtail < 2.6 compatibility ends
+
@lru_cache(maxsize=None)
def get_newsitem_edit_handler(NewsItem): | Monkey patch bind_to_instance and bind_to_model for wagtail < <I> compatibility | neon-jungle_wagtailnews | train | py |
eb5d13b72cec026329383a94ab7b80926f685380 | diff --git a/codegen/src/main/java/org/web3j/codegen/SolidityFunctionWrapper.java b/codegen/src/main/java/org/web3j/codegen/SolidityFunctionWrapper.java
index <HASH>..<HASH> 100644
--- a/codegen/src/main/java/org/web3j/codegen/SolidityFunctionWrapper.java
+++ b/codegen/src/main/java/org/web3j/codegen/SolidityFunctionWrapper.java
@@ -170,7 +170,7 @@ public class SolidityFunctionWrapper extends Generator {
String javadoc = CODEGEN_WARNING + getWeb3jVersion();
return TypeSpec.classBuilder(className)
- .addModifiers(Modifier.PUBLIC, Modifier.FINAL)
+ .addModifiers(Modifier.PUBLIC)
.addJavadoc(javadoc)
.superclass(Contract.class)
.addField(createBinaryDefinition(binary)); | let folks sub-class the generated code.
Even if it subsequently gets regenerated there are
advantages to doing so.
For example, suppose the subclass implements an interface, such as
the ERC<I> standard.
Having an extensible implementation makes this much easier.
Moreover, the rule of thumb in Java is that classes are marked final
only if there's a VM security issue of not marking them so.
This is not the case with these contract wrappers. | web3j_web3j | train | java |
e9a4c29f769061ac2eb80e7fab11cbe614d60c5b | diff --git a/java/client/test/org/openqa/selenium/internal/IgnoredTestPrinter.java b/java/client/test/org/openqa/selenium/internal/IgnoredTestPrinter.java
index <HASH>..<HASH> 100644
--- a/java/client/test/org/openqa/selenium/internal/IgnoredTestPrinter.java
+++ b/java/client/test/org/openqa/selenium/internal/IgnoredTestPrinter.java
@@ -26,7 +26,7 @@ public class IgnoredTestPrinter {
final File out = new File("ignores.json");
Files.write(collector.toJson().getBytes(), out);
- System.out.println("Wrote ignores to " + out.getPath());
+ System.out.println("Wrote ignores to " + out.getAbsolutePath());
}
} | DanielWagnerHall: Dump out the absolute path of the file generated, because I have no idea what working directory jenkins is using
r<I> | SeleniumHQ_selenium | train | java |
2fbc3460e17379d1a9302ce5070dac7a020c6583 | diff --git a/salt/version.py b/salt/version.py
index <HASH>..<HASH> 100644
--- a/salt/version.py
+++ b/salt/version.py
@@ -55,7 +55,7 @@ class SaltStackVersion(object):
# ----- Please refrain from fixing PEP-8 E203 ----------------------->
# The idea is keep this readable
# --------------------------------------------------------------------
- 'Hydrogen': (sys.maxint - 108, 0, 0, 0),
+ 'Hydrogen': (2014, 1, 0, 0),
'Helium': (sys.maxint - 107, 0, 0, 0),
'Lithium': (sys.maxint - 106, 0, 0, 0),
'Beryllium': (sys.maxint - 105, 0, 0, 0), | Hydrogen has been released, update version. | saltstack_salt | train | py |
32e52d0e8cb581b35b528025d55629763e779606 | diff --git a/lib/ctrllr.js b/lib/ctrllr.js
index <HASH>..<HASH> 100644
--- a/lib/ctrllr.js
+++ b/lib/ctrllr.js
@@ -185,19 +185,6 @@ CTRLLR.prototype.initTest = function(test) {
queue = [];
- if (!afterEach) {
- // make sure `afterEach` is defined
- afterEach = [];
- } else if (!(afterEach instanceof Array)) {
- // make sure `afterEach` is an array
- afterEach = [afterEach];
- }
-
- // iterate over all `afterEach` functions, add to `queue`
- afterEach.forEach(function(fn) {
- queue.push(fn);
- });
-
if (!test.config.after) {
// initialize `test.after` as array if not set
test.config.after = [];
@@ -223,6 +210,19 @@ CTRLLR.prototype.initTest = function(test) {
});
});
+ if (!afterEach) {
+ // make sure `afterEach` is defined
+ afterEach = [];
+ } else if (!(afterEach instanceof Array)) {
+ // make sure `afterEach` is an array
+ afterEach = [afterEach];
+ }
+
+ // iterate over all `afterEach` functions, add to `queue`
+ afterEach.forEach(function(fn) {
+ queue.push(fn);
+ });
+
test.config.after = queue;
return test; | moved `afterEach` after test `after` functions | CTRLLA_ctrllr | train | js |
ea6d061c723387614b88f533e5e7fdc6db7c195b | diff --git a/metpy/deprecation.py b/metpy/deprecation.py
index <HASH>..<HASH> 100644
--- a/metpy/deprecation.py
+++ b/metpy/deprecation.py
@@ -119,7 +119,7 @@ class MetpyDeprecationWarning(UserWarning):
pass
-metpyDeprecation = MetpyDeprecationWarning
+metpyDeprecation = MetpyDeprecationWarning # noqa: N816
def _generate_deprecation_message(since, message='', name='', | Mark noqa on case in metpy deprecations. | Unidata_MetPy | train | py |
442db71670f9fe1f0535625060f3781a5b8e7974 | diff --git a/lib/valanga/music_search.rb b/lib/valanga/music_search.rb
index <HASH>..<HASH> 100644
--- a/lib/valanga/music_search.rb
+++ b/lib/valanga/music_search.rb
@@ -43,7 +43,7 @@ module Valanga
begin
session.find("#music_table1")
rescue Capybara::ElementNotFound
- raise Valanga::NotFoundMusicTable, 'Not found music score table(id=music_table1)'
+ break
end
yield session
diff --git a/spec/valanga/music_search_spec.rb b/spec/valanga/music_search_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/valanga/music_search_spec.rb
+++ b/spec/valanga/music_search_spec.rb
@@ -91,9 +91,9 @@ RSpec.describe Valanga::MusicSearch do
context 'when does not find the music' do
it do
- expect do
+ expect(
@music_searcher['muuuusic']
- end.to raise_error Valanga::NotFoundMusicTable
+ ).to be nil
end
end
end | if does not found `#music_table1`, break loop. | mgi166_valanga | train | rb,rb |
40ff5b64ffec3636654a0c6461180e3c4134b2d2 | diff --git a/src/configuration-optimizer-factory.js b/src/configuration-optimizer-factory.js
index <HASH>..<HASH> 100644
--- a/src/configuration-optimizer-factory.js
+++ b/src/configuration-optimizer-factory.js
@@ -17,6 +17,9 @@ var optimizerClasses = [
// DeltaSol BX Plus
require('./configuration-optimizers/resol-deltasol-bx-plus-xxx-configuration-optimizer'),
+ // DeltaSol CS Plus
+ require('./configuration-optimizers/resol-deltasol-cs-plus-xxx-configuration-optimizer'),
+
];
@@ -27,11 +30,11 @@ var ConfigurationOptimizerFactory = {
* Get the configuration optimizer for the given device (identified by its address).
*
* @param {number} deviceAddress VBus address of the device
- * @returns {Promise} A Promise that resolvs to the optimizer for the given device.
+ * @returns {Promise} A Promise that resolvs to the optimizer for the given device or `null` if no optimizer was found.
*/
getOptimizerByDeviceAddress: function(deviceAddress) {
return Q.fcall(function() {
- var result;
+ var result = null;
_.forEach(optimizerClasses, function(Optimizer) {
if (Optimizer.deviceAddress === deviceAddress) { | Change `getOptimizerByDeviceAddress` to return `null` if unknown. | danielwippermann_resol-vbus | train | js |
98321c9208f5aa980548ec958d24746a21c537da | diff --git a/lib/sudo/wrapper.rb b/lib/sudo/wrapper.rb
index <HASH>..<HASH> 100644
--- a/lib/sudo/wrapper.rb
+++ b/lib/sudo/wrapper.rb
@@ -1,18 +1,10 @@
require 'drb/drb'
-require 'drb/acl'
require 'sudo/support/kernel'
require 'sudo/support/process'
require 'sudo/constants'
require 'sudo/system'
require 'sudo/proxy'
-begin
- DRb.current_server
-rescue DRb::DRbServerNotFound
- DRb.start_service nil, nil,
- ACL.new(%w{ deny all allow 127.0.0.1 }, ACL::DENY_ALLOW)
-end
-
module Sudo
class Wrapper | disable client listening completely
until we need it it again (DRb docs says it's necessary only for
non-marshallable objects but, in any case, we are still unable to
sudo-ize a lambda or a Proc ) | gderosa_rubysu | train | rb |
524513e49c1a93afa2aa5da3ec8cda4750da0008 | diff --git a/platform/android/build/android_tools.rb b/platform/android/build/android_tools.rb
index <HASH>..<HASH> 100644
--- a/platform/android/build/android_tools.rb
+++ b/platform/android/build/android_tools.rb
@@ -548,6 +548,10 @@ def start_emulator(cmd)
# the time is out and there is no emulator in device list
puts 'Warning: An emulator is not visible in adb device list. Lets start it again.'
stop_emulator
+ # Restart adb server
+ `#{$adb} kill-server`
+ `#{$adb} start-server`
+
end
fail "Can't start an emulator."
end | Added code to restart adb server if android emulator lost connection to device. | rhomobile_rhodes | train | rb |
9b1a53b327d169303a81730ff7d5144dee90a648 | diff --git a/fmn/lib/__init__.py b/fmn/lib/__init__.py
index <HASH>..<HASH> 100644
--- a/fmn/lib/__init__.py
+++ b/fmn/lib/__init__.py
@@ -74,11 +74,10 @@ def matches(filter, message, valid_paths, rule_cache, config):
arguments = rule['arguments']
rule_cache_key = rule['cache_key']
- if rule_cache_key in rule_cache:
- return rule_cache[rule_cache_key]
-
try:
- rule_cache[rule_cache_key] = fn(config, message, **arguments)
+ if rule_cache_key not in rule_cache:
+ rule_cache[rule_cache_key] = fn(config, message, **arguments)
+
if not rule_cache[rule_cache_key]:
return False
except Exception as e: | Don't return prematurely.
It made it so that as soon as one rule matched for one user, the whole tamale
would evaluate to true for every subsequent user. This incorrectly made it so
that users would suddenly start getting all kinds of messages not relevant to
them; messages would be directed at <I>+ users simultaneously, one after
another, after another. | fedora-infra_fmn.lib | train | py |
ccd7a1339c6cc6e87ee6059250730d79f173a05a | diff --git a/dvc/command/data_sync.py b/dvc/command/data_sync.py
index <HASH>..<HASH> 100644
--- a/dvc/command/data_sync.py
+++ b/dvc/command/data_sync.py
@@ -52,7 +52,7 @@ class CmdDataStatus(CmdBase):
with DvcLock(self.is_locker, self.git):
status = self.cloud.status(self.parsed_args.targets, self.parsed_args.jobs)
- if len(status) != len(self.parsed_args.targets):
+ if len(list(status)) != len(self.parsed_args.targets):
return 1
self._show(status)
diff --git a/dvc/main.py b/dvc/main.py
index <HASH>..<HASH> 100644
--- a/dvc/main.py
+++ b/dvc/main.py
@@ -4,6 +4,7 @@ main entry point / argument parsing for dvc
import sys
from dvc.settings import Settings
+from dvc.logger import Logger
def main():
try: | build: fix errors on python3
These wasn't caught in pull-request as it doesn't
have secure env vars to test sync/pull/push/status. | iterative_dvc | train | py,py |
0f26aee2d045563fd8b28b9d49c50582230fdb19 | diff --git a/test/dummy/app/controllers/tests_controller.rb b/test/dummy/app/controllers/tests_controller.rb
index <HASH>..<HASH> 100644
--- a/test/dummy/app/controllers/tests_controller.rb
+++ b/test/dummy/app/controllers/tests_controller.rb
@@ -1,6 +1,4 @@
class TestsController < ActionController::Base
- include Rails.application.routes.url_helpers if defined?(Rails)
-
def index
url = url_for(params.merge(:only_path => true))
render :text => params.merge(:url => url).inspect | The url helpers are already available | svenfuchs_routing-filter | train | rb |
7ad789fb3987489d9759a34eec67caeabde0361d | diff --git a/src/main/java/au/com/southsky/jfreesane/FrameInputStream.java b/src/main/java/au/com/southsky/jfreesane/FrameInputStream.java
index <HASH>..<HASH> 100644
--- a/src/main/java/au/com/southsky/jfreesane/FrameInputStream.java
+++ b/src/main/java/au/com/southsky/jfreesane/FrameInputStream.java
@@ -46,7 +46,8 @@ class FrameInputStream extends InputStream {
while (readRecord(bigArray) >= 0);
if (imageSize > 0 && imageSize != bigArray.size()) {
- throw new IOException("truncated read (expected " + bigArray.size() + ", got " + imageSize);
+ throw new IOException("truncated read (got " + bigArray.size() + ", expected " + imageSize
+ + ")");
}
// Now, if necessary, put the bytes in the correct order according | Fix logging bug (order reversed) | sjamesr_jfreesane | train | java |
429c02486d5a38255fd454b72c1160b74f33e21c | diff --git a/pkg/proc/proc_test.go b/pkg/proc/proc_test.go
index <HASH>..<HASH> 100644
--- a/pkg/proc/proc_test.go
+++ b/pkg/proc/proc_test.go
@@ -3251,7 +3251,6 @@ func TestCgoStacktrace(t *testing.T) {
}
skipOn(t, "broken - cgo stacktraces", "386")
- skipOn(t, "broken - cgo stacktraces", "arm64")
protest.MustHaveCgo(t)
// Tests that: | pkg/proc: Enable CGO Stacktrace tests on arm<I>
These seem to magically work again on my M1 Mac so, enabling them again. | go-delve_delve | train | go |
01553f6c97b1cda276c1c0cdbcca63d33d16d8c8 | diff --git a/src/WebSocket.php b/src/WebSocket.php
index <HASH>..<HASH> 100644
--- a/src/WebSocket.php
+++ b/src/WebSocket.php
@@ -110,7 +110,10 @@ class WebSocket implements EventEmitterInterface {
}
});
- $stream->on('close', $this->_close);
+ $stream->on('close', function () {
+ $close = $this->_close;
+ $close(1006, 'PHP Stream closed');
+ });
$stream->on('error', function($error) {
$this->emit('error', [$error, $this]); | Fixed issue where PHP stream was emitted | ratchetphp_Pawl | train | php |
3025560094899c584ec88fe68c1152ed6239b394 | diff --git a/src/consts.js b/src/consts.js
index <HASH>..<HASH> 100644
--- a/src/consts.js
+++ b/src/consts.js
@@ -2,4 +2,4 @@ var RUNNING = 0;
var PAUSED = 1;
var CLOSED = 2;
-Asyncplify.state = { RUNNING: RUNNING, PAUSED: PAUSED, CLOSED: CLOSED };
\ No newline at end of file
+Asyncplify.states = { RUNNING: RUNNING, PAUSED: PAUSED, CLOSED: CLOSED };
\ No newline at end of file | rename Asyncplify.state to Asyncplify.states | danylaporte_asyncplify | train | js |
fee86818400a8d890688c298be85bb3c9161efd4 | diff --git a/src/Store/DrupalDBStore.php b/src/Store/DrupalDBStore.php
index <HASH>..<HASH> 100644
--- a/src/Store/DrupalDBStore.php
+++ b/src/Store/DrupalDBStore.php
@@ -97,7 +97,7 @@ class DrupalDBStore extends SqlDBStore {
}
}
- if ($granularity == Event::BAT_HOURLY) {
+ if (($granularity == Event::BAT_HOURLY) && isset($itemized[Event::BAT_HOUR])) {
// Write Hours
foreach ($itemized[Event::BAT_HOUR] as $year => $months) {
foreach ($months as $month => $days) { | Make sure hours are set before attempting to create array | Roomify_bat | train | php |
fd19176bae01bc13c135ace2af65eed737f80c16 | diff --git a/websockets-jsr/src/main/java/io/undertow/websockets/jsr/Encoding.java b/websockets-jsr/src/main/java/io/undertow/websockets/jsr/Encoding.java
index <HASH>..<HASH> 100644
--- a/websockets-jsr/src/main/java/io/undertow/websockets/jsr/Encoding.java
+++ b/websockets-jsr/src/main/java/io/undertow/websockets/jsr/Encoding.java
@@ -127,9 +127,6 @@ public class Encoding implements Closeable {
if (targetType == Boolean.class || targetType == boolean.class) {
return Boolean.valueOf(message);
} else if (targetType == Character.class || targetType == char.class) {
- if (message.length() > 1) {
- throw new DecodeException(message, "Character message larger than 1 character");
- }
return Character.valueOf(message.charAt(0));
} else if (targetType == Byte.class || targetType == byte.class) {
return Byte.valueOf(message); | Just truncate character based websocket messages | undertow-io_undertow | train | java |
8a90469f5da314ee8f35b2584059f7545e5fdab0 | diff --git a/lib/plain_old_model/attribute_assignment.rb b/lib/plain_old_model/attribute_assignment.rb
index <HASH>..<HASH> 100644
--- a/lib/plain_old_model/attribute_assignment.rb
+++ b/lib/plain_old_model/attribute_assignment.rb
@@ -117,16 +117,16 @@ module PlainOldModel
def merge_association_instance_variables_with_attributes(association, attr_name, attributes)
association_instance = send(attr_name)
if association.class == HasOneAssociation
- instance_hash = create_association_hash(association_instance,{})
- merged_result = instance_hash.with_indifferent_access.deep_merge(attributes[attr_name])
+ instance_hash = create_association_hash(association_instance,HashWithIndifferentAccess.new)
+ merged_result = instance_hash.deep_merge(attributes[attr_name])
elsif association.class == HasManyAssociation
association_instance_array = []
if association_instance.nil?
merged_result = attributes[attr_name]
else
for i in 0..association_instance.length-1
- instance_hash = create_association_hash(association_instance[i],{})
- association_instance_array << instance_hash.with_indifferent_access.deep_merge(attributes[attr_name][i])
+ instance_hash = create_association_hash(association_instance[i],HashWithIndifferentAccess.new)
+ association_instance_array << instance_hash.deep_merge(attributes[attr_name][i])
end
merged_result = association_instance_array
end | Passing hash with indifferentaccess | gettyimages_plain_old_model | train | rb |
9004cf60aa76c2291085f7cbce644585d50b9294 | diff --git a/src/Translator/Lang.php b/src/Translator/Lang.php
index <HASH>..<HASH> 100644
--- a/src/Translator/Lang.php
+++ b/src/Translator/Lang.php
@@ -84,11 +84,11 @@ class Lang
* @param string $lang
* @return null
*/
- public static function ini($lang = null)
+ public static function ini($test = null)
{
self::getSupported();
- self::$lang = is_null($lang) ? self::detect() : $lang ;
+ self::$lang = self::detect($test);
exception_if( ! in_array(self::$lang, self::$supported) , LanguageNotSupportedException::class , self::$lang); | update Lang::ini to accept test param | vinala_kernel | train | php |
a85c6424de3d3fa98388026c88791e51393d1729 | diff --git a/components/Sticky/Sticky.js b/components/Sticky/Sticky.js
index <HASH>..<HASH> 100644
--- a/components/Sticky/Sticky.js
+++ b/components/Sticky/Sticky.js
@@ -23,8 +23,6 @@ type State = {
export default class Sticky extends React.Component {
- props: Props;
-
static propTypes = {
side: PropTypes.oneOf(['top', 'bottom']).isRequired,
@@ -41,6 +39,12 @@ export default class Sticky extends React.Component {
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
};
+ static defaultProps: {offset: number} = {
+ offset: 0,
+ };
+
+ props: Props;
+
state: State;
_wrapper: HTMLElement;
@@ -51,10 +55,6 @@ export default class Sticky extends React.Component {
_lastInnerHeight: number = -1;
_layoutSubscription: {remove: () => void};
- static defaultProps: {offset: number} = {
- offset: 0,
- };
-
constructor(props: Props, context: any) {
super(props, context); | [Sticky] Statics on top. | skbkontur_retail-ui | train | js |
941d5cbdeb63d0f6486636ef087186062ca7dad4 | diff --git a/tests/integration/validation/test_read_only_write_only.py b/tests/integration/validation/test_read_only_write_only.py
index <HASH>..<HASH> 100644
--- a/tests/integration/validation/test_read_only_write_only.py
+++ b/tests/integration/validation/test_read_only_write_only.py
@@ -19,7 +19,7 @@ def request_validator(spec):
return RequestValidator(spec)
[email protected]('class')
[email protected](scope='class')
def spec(factory):
spec_dict = factory.spec_from_file("data/v3.0/read_only_write_only.yaml")
return create_spec(spec_dict)
diff --git a/tests/integration/validation/test_security_override.py b/tests/integration/validation/test_security_override.py
index <HASH>..<HASH> 100644
--- a/tests/integration/validation/test_security_override.py
+++ b/tests/integration/validation/test_security_override.py
@@ -13,7 +13,7 @@ def request_validator(spec):
return RequestValidator(spec)
[email protected]('class')
[email protected](scope='class')
def spec(factory):
spec_dict = factory.spec_from_file("data/v3.0/security_override.yaml")
return create_spec(spec_dict) | Update pytest to latest version | p1c2u_openapi-core | train | py,py |
8d3648e76383a846c1b481c958dfcc3179ab2311 | diff --git a/assets/scripts/src/choices.js b/assets/scripts/src/choices.js
index <HASH>..<HASH> 100644
--- a/assets/scripts/src/choices.js
+++ b/assets/scripts/src/choices.js
@@ -860,6 +860,10 @@ export class Choices {
if(this.passedElement.type !== 'text' && !this.dropdown.classList.contains(this.config.classNames.activeState)) {
// For select inputs we always want to show the dropdown if it isn't already showing
this.showDropdown();
+
+ if(this.passedElement.type === 'select-one' && !this.canSearch){
+ this.containerOuter.focus();
+ }
}
// If input is not in focus, it ought to be | (select-one) search = false, click & show dropdown give focus | jshjohnson_Choices | train | js |
0f208a7e443e4d98b7843c151a27de8472d86335 | diff --git a/src/main/java/pro/zackpollard/telegrambot/api/internal/managers/FileManager.java b/src/main/java/pro/zackpollard/telegrambot/api/internal/managers/FileManager.java
index <HASH>..<HASH> 100644
--- a/src/main/java/pro/zackpollard/telegrambot/api/internal/managers/FileManager.java
+++ b/src/main/java/pro/zackpollard/telegrambot/api/internal/managers/FileManager.java
@@ -118,6 +118,7 @@ public class FileManager {
try {
File jarDir = new File(FileManager.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath());
tmpDirectory = new File(jarDir, "tmp");
+ tmpDirectory.mkdirs();
// In case the JVM is not nice enough to delete our files
File[] contents = tmpDirectory.listFiles();
if (contents != null) { | Ensure the tmp folder exists by creating necessary directories | zackpollard_JavaTelegramBot-API | train | java |
8346d1bf53f2f1c5194e8d183c73b8b55ea48464 | diff --git a/test/test_torstate.py b/test/test_torstate.py
index <HASH>..<HASH> 100644
--- a/test/test_torstate.py
+++ b/test/test_torstate.py
@@ -97,6 +97,8 @@ class FakeReactor:
def removeSystemEventTrigger(self, id):
self.test.assertEqual(id, 1)
+ def connectTCP(self, *args, **kw):
+ raise RuntimeError('connectTCP: ' + str(args))
class FakeCircuit:
@@ -189,6 +191,12 @@ class BootstrapTests(unittest.TestCase):
p.proto.post_bootstrap.callback(p.proto)
return d
+ def test_build_tuple(self):
+ d = build_tor_connection((FakeReactor(self), '127.0.0.1', 1234))
+ d.addCallback(self.fail)
+ d.addErrback(lambda x: None)
+ return d
+
def confirm_pid(self, state):
self.assertEqual(state.tor_pid, 1234) | test which at least runs tcp-socket version of build_tor_connection | meejah_txtorcon | train | py |
89768c7f089b948caf46582f71c4a3e3cda62ab3 | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -113,6 +113,25 @@ def without_chronic(&block) # for quick counter-tests ;-)
block.call
end
+def wait_until(timeout=14, frequency=0.1, &block)
+
+ start = Time.now
+
+ loop do
+
+ sleep(frequency)
+
+ #return if block.call == true
+ r = block.call
+ return r if r
+
+ break if Time.now - start > timeout
+ end
+
+ fail "timeout after #{timeout}s"
+end
+alias :wait_for :wait_until
+
class Time
def to_debug_s | Bring in wait_{until|for} helper | jmettraux_rufus-scheduler | train | rb |
df6f8bface06e147646b9936d0b6f9a7b296f43d | diff --git a/umap/umap_.py b/umap/umap_.py
index <HASH>..<HASH> 100644
--- a/umap/umap_.py
+++ b/umap/umap_.py
@@ -1940,7 +1940,7 @@ class UMAP(BaseEstimator):
self._b,
rng_state,
self.repulsion_strength,
- self.initial_alpha,
+ self._initial_alpha,
self.negative_sample_rate,
_input_distance_func,
tuple(self._metric_kwds.values()), | Fix for Alice Beaupré's inverse_transform issue | lmcinnes_umap | train | py |
1ee8f2f6a75971ad6e083a886e9188e2e3565fd0 | diff --git a/src/Minify.php b/src/Minify.php
index <HASH>..<HASH> 100644
--- a/src/Minify.php
+++ b/src/Minify.php
@@ -150,6 +150,7 @@ abstract class Minify
foreach ($this->patterns as $i => $pattern) {
list($pattern, $replacement) = $pattern;
+ $match = null;
if (preg_match($pattern, $content, $match)) {
$matches[$i] = $match;
} | Work around issue scrutinizer reported
Scrutinizer feedback:
"It seems like $match can also be of type string; however,
preg_match() does only seem to accept null|array<integer,string>,
maybe add an additional type check?"
It doesn't really matter what value it is; preg_replace will
just overwrite it with the matched values.
Let's just reset it to null before passing it in there. | matthiasmullie_minify | train | php |
ae91938a9b57aacb9bc708d3bb679d00be50a3d8 | diff --git a/lib/bonsai/page.rb b/lib/bonsai/page.rb
index <HASH>..<HASH> 100644
--- a/lib/bonsai/page.rb
+++ b/lib/bonsai/page.rb
@@ -83,7 +83,7 @@ module Bonsai
end
def parent
- id = permalink[/\/(.+)\/#{slug}\/$/, 1]
+ id = permalink[/\/(.+\/)[^\/]*\/$/, 1]
return nil if id.nil?
parent = Page.find(id) | Don't use the slug in the regex | benschwarz_bonsai | train | rb |
160f8b29d0b3200d944a0e410b631a360a1ce1a2 | diff --git a/lib/discordrb/commands/command_bot.rb b/lib/discordrb/commands/command_bot.rb
index <HASH>..<HASH> 100644
--- a/lib/discordrb/commands/command_bot.rb
+++ b/lib/discordrb/commands/command_bot.rb
@@ -71,7 +71,6 @@ module Discordrb::Commands
super(
log_mode: attributes[:log_mode],
token: attributes[:token],
- application_id: attributes[:application_id],
client_id: attributes[:client_id],
type: attributes[:type],
name: attributes[:name], | Remove the application_id passthrough | meew0_discordrb | train | rb |
6b5cd78cd659dbdc21cd7b99a4a5a2a21ec66992 | diff --git a/core/server/common/src/main/java/alluxio/master/audit/AsyncUserAccessAuditLogWriter.java b/core/server/common/src/main/java/alluxio/master/audit/AsyncUserAccessAuditLogWriter.java
index <HASH>..<HASH> 100644
--- a/core/server/common/src/main/java/alluxio/master/audit/AsyncUserAccessAuditLogWriter.java
+++ b/core/server/common/src/main/java/alluxio/master/audit/AsyncUserAccessAuditLogWriter.java
@@ -1,5 +1,8 @@
package alluxio.master.audit;
+import alluxio.Configuration;
+import alluxio.PropertyKey;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -14,7 +17,7 @@ public final class AsyncUserAccessAuditLogWriter {
private ArrayBlockingQueue<AuditContext> mAuditLogEntries;
public AsyncUserAccessAuditLogWriter() {
- mEnabled = true;
+ mEnabled = Boolean.parseBoolean(Configuration.get(PropertyKey.MASTER_AUDIT_LOGGING_ENABLED));
mAuditLogEntries = new ArrayBlockingQueue<>(QUEUE_SIZE);
} | Set mEnabled using site property. | Alluxio_alluxio | train | java |
e5b8122a6fabc33981bfafa93031ccb0aec6395e | diff --git a/rivescript/rivescript.py b/rivescript/rivescript.py
index <HASH>..<HASH> 100644
--- a/rivescript/rivescript.py
+++ b/rivescript/rivescript.py
@@ -1997,7 +1997,7 @@ the value is unset at the end of the `reply()` method)."""
match = match.group(1)
parts = match.split(" ", 1)
- tag = parts[0]
+ tag = parts[0].lower()
data = parts[1] if len(parts) > 1 else ""
insert = "" # Result of the tag evaluation | Make tag parsing lowercased | aichaos_rivescript-python | train | py |
4db3ba59db87be6a5e21f1b14aa09fff63414229 | diff --git a/writer.go b/writer.go
index <HASH>..<HASH> 100644
--- a/writer.go
+++ b/writer.go
@@ -1,6 +1,6 @@
package disruptor
-import "time"
+import "runtime"
type Writer struct {
written *Cursor
@@ -34,7 +34,7 @@ func (this *Writer) Reserve(count int64) int64 {
for spin := int64(0); this.previous-this.capacity > this.gate; spin++ {
if spin&SpinMask == 0 {
- time.Sleep(time.Nanosecond)
+ runtime.Gosched() // LockSupport.parkNanos(1L); http://bit.ly/1xiDINZ
}
this.gate = this.upstream.Read(0) | Yielding the goroutine. | smartystreets_go-disruptor | train | go |
e24703b46d005e2e9a53ef5f5fcc66603328fcfd | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -22,8 +22,8 @@ hexo.extend.generator.register('spoiler_asset', () => [
]);
hexo.extend.filter.register('after_post_render', (data) => {
- var link_css = "<link rel=\"stylesheet\" href=\"/css/spoiler.css\" type=\"text/css\">";
- var link_js = "<script src=\"/js/spoiler.js\" type=\"text/javascript\" async></script>";
+ var link_css = "<link rel=\"stylesheet\" href=\""+hexo.config.root+"css/spoiler.css\" type=\"text/css\">";
+ var link_js = "<script src=\""+hexo.config.root+"js/spoiler.js\" type=\"text/javascript\" async></script>";
data.content += link_css + link_js;
return data;
}); | fixed url relativity
the spoiler.css and spoiler.js now acknowledge the base
url of the blog | fletchto99_hexo-sliding-spoiler | train | js |
bb0fa9427c6f90bc6ab1acdb69e4aa796514865a | diff --git a/lib/massa/tool.rb b/lib/massa/tool.rb
index <HASH>..<HASH> 100644
--- a/lib/massa/tool.rb
+++ b/lib/massa/tool.rb
@@ -7,9 +7,9 @@ module Massa
def initialize(name, attributes)
@name = name
@description = attributes['description']
- @gem = attributes['gem'].nil? ? true : attributes[:gem]
+ @gem = attributes['gem'].nil? ? true : attributes['gem']
@command = attributes['command']
- @required = attributes['required'].nil? ? true : attributes[:required]
+ @required = attributes['required'].nil? ? true : attributes['required']
end
alias required? required | Fixing 'Tool#initialize' method | lucascaton_massa | train | rb |
50eaec7fbbc7f7ba590676b50ad02e9cc3ee513b | diff --git a/concrete/src/User/UserList.php b/concrete/src/User/UserList.php
index <HASH>..<HASH> 100644
--- a/concrete/src/User/UserList.php
+++ b/concrete/src/User/UserList.php
@@ -263,7 +263,7 @@ class UserList extends DatabaseItemList
if (!($group instanceof \Concrete\Core\User\Group\Group)) {
$group = \Concrete\Core\User\Group\Group::getByName($group);
}
- $this->filterByInAnyGroup([group], $inGroup);
+ $this->filterByInAnyGroup([$group], $inGroup);
}
/** | Fix typo in UserList::filterByGroup | concrete5_concrete5 | train | php |
71055e09a22df6e8bf1bf923e627a1c8725fff5a | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -202,7 +202,6 @@ AFRAME.registerComponent('super-hands', {
if (!this.carried) { // empty hand
this.carried = hitEl;
if (hitEl.is(this.GRABBED_STATE)) { // second hand grab (AKA stretch)
- // TODO: Do we need explicit check that this is grabbed by this.otherController?
hitEl.addState(this.STRETCHED_STATE);
this.stretching = true;
} else { // basic grab
@@ -211,10 +210,7 @@ AFRAME.registerComponent('super-hands', {
this.constraint = new window.CANNON
.LockConstraint(this.el.body, hitEl.body);
this.physics.world.addConstraint(this.constraint);
- } else { // use manual updating
- // TODO: initiate manual hitEl movement
- // actually this may be implied
- }
+ }
}
} else if ((!this.data.dropTargetClasses.length ||
this.data.dropTargetClasses | removed a couple of obsolete todos | wmurphyrd_aframe-super-hands-component | train | js |
d95bd35e1229c632ae649445268956b8ed067553 | diff --git a/aeron-cluster/src/main/java/io/aeron/cluster/Election.java b/aeron-cluster/src/main/java/io/aeron/cluster/Election.java
index <HASH>..<HASH> 100644
--- a/aeron-cluster/src/main/java/io/aeron/cluster/Election.java
+++ b/aeron-cluster/src/main/java/io/aeron/cluster/Election.java
@@ -264,8 +264,11 @@ class Election
case LEADER_READY:
case LEADER_REPLAY:
{
- publishNewLeadershipTermForMember(
- follower, logLeadershipTermId, ctx.clusterClock().timeNanos());
+ if (CommonContext.NULL_SESSION_ID != logSessionId)
+ {
+ publishNewLeadershipTermForMember(
+ follower, logLeadershipTermId, ctx.clusterClock().timeNanos());
+ }
break;
} | [Java] Only respond to canvassPosition events if a logSessionId is available. | real-logic_aeron | train | java |
c681889721c919d8e018d8e7c2cff8b10dbba873 | diff --git a/tests/unit/test.mapreduce.js b/tests/unit/test.mapreduce.js
index <HASH>..<HASH> 100644
--- a/tests/unit/test.mapreduce.js
+++ b/tests/unit/test.mapreduce.js
@@ -41,6 +41,7 @@ describe('test.mapreduce.js-upsert', function () {
});
describe('test.mapreduce.js-utils', function () {
+
it('callbackify should work with a callback', function (done) {
function fromPromise() {
return Promise.resolve(true);
@@ -51,16 +52,19 @@ describe('test.mapreduce.js-utils', function () {
done();
});
});
- it.skip('fin should work without returning a function and it resolves',
+
+ it('fin should work without returning a function and it resolves',
function () {
return utils.fin(Promise.resolve(), function () {
- return {};
+ return Promise.resolve();
}).should.be.fullfilled;
});
+
it('fin should work without returning a function and it rejects',
function () {
return utils.fin(Promise.reject(), function () {
- return {};
+ return Promise.resolve();
}).should.be.rejected;
});
+
}); | (#<I>) - Fix to use promises | pouchdb_pouchdb | train | js |
347201d307fc8c4d87354acf1db676052753eb90 | diff --git a/src/Traits/Collection.php b/src/Traits/Collection.php
index <HASH>..<HASH> 100644
--- a/src/Traits/Collection.php
+++ b/src/Traits/Collection.php
@@ -28,6 +28,7 @@ trait Collection
if (is_null($key)) {
$array = $this->toArray();
+
return $this->count() == 1 ? end($array) : $array;
} | Apply fixes from StyleCI (#<I>) | denpamusic_php-bitcoinrpc | train | php |
b418cca89c01251f042a7f42c31d66544975103c | diff --git a/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-aurora/src/main/java/org/nd4j/nativeblas/Nd4jAuroraOps.java b/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-aurora/src/main/java/org/nd4j/nativeblas/Nd4jAuroraOps.java
index <HASH>..<HASH> 100644
--- a/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-aurora/src/main/java/org/nd4j/nativeblas/Nd4jAuroraOps.java
+++ b/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-aurora/src/main/java/org/nd4j/nativeblas/Nd4jAuroraOps.java
@@ -54,7 +54,7 @@ public class Nd4jAuroraOps implements NativeOps {
if (s != null) {
deviceId = Integer.parseInt(s);
}
- File f = Loader.cacheResource(Loader.getPlatform() + (LOAD_SHARED_LIBRARY ? "/libnd4jaurora.so" : "/nd4jaurora"));
+ File f = Loader.cacheResource(Loader.getPlatform() + (LOAD_SHARED_LIBRARY ? "/libaurora.so" : "/nd4jaurora"));
f.setExecutable(true);
veobin = f.getAbsolutePath();
setDevice(deviceId); | Fix nd4j artifact name | deeplearning4j_deeplearning4j | train | java |
0106900481a06a6cd3a07497a2e2cf8eecaee050 | diff --git a/java/server/test/org/openqa/selenium/server/htmlrunner/CoreSelfTest.java b/java/server/test/org/openqa/selenium/server/htmlrunner/CoreSelfTest.java
index <HASH>..<HASH> 100644
--- a/java/server/test/org/openqa/selenium/server/htmlrunner/CoreSelfTest.java
+++ b/java/server/test/org/openqa/selenium/server/htmlrunner/CoreSelfTest.java
@@ -30,6 +30,7 @@ import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.openqa.selenium.Platform;
import org.openqa.selenium.environment.webserver.AppServer;
+import org.openqa.selenium.os.CommandLine;
import java.io.File;
import java.io.IOException;
@@ -77,9 +78,13 @@ public class CoreSelfTest {
public static Iterable<String> parameters() {
ImmutableSortedSet.Builder<String> browsers = ImmutableSortedSet.naturalOrder();
- // if (CommandLine.find("wires") != null) {
- browsers.add("*firefox");
- // }
+ if (CommandLine.find("chromedriver") != null) {
+ browsers.add("*googlechrome");
+ }
+
+ if (CommandLine.find("wires") != null) {
+// browsers.add("*firefox");
+ }
switch (Platform.getCurrent().family()) {
case MAC: | Switch to using the chromedriver by default for the core self tests
At some point, we should always use every valid browser | SeleniumHQ_selenium | train | java |
071b45741970646af24a4798645341b7227218a7 | diff --git a/src/Kernel.php b/src/Kernel.php
index <HASH>..<HASH> 100644
--- a/src/Kernel.php
+++ b/src/Kernel.php
@@ -55,7 +55,11 @@ function buildCommandDispatcher(
$eventOrPromise = $generator->current();
if ($eventOrPromise instanceof Promise) {
- $generator->send(yield $eventOrPromise);
+ try {
+ $generator->send(yield $eventOrPromise);
+ } catch (\Throwable $exception) {
+ $generator->throw($exception);
+ }
} else {
yield $emit($eventOrPromise);
$generator->next(); | fix kernel bug catching exceptions in command handlers | prooph_micro | train | php |
cadacfded632e87b636ff0b620cc05edad184a88 | diff --git a/simpl/middleware/cors.py b/simpl/middleware/cors.py
index <HASH>..<HASH> 100644
--- a/simpl/middleware/cors.py
+++ b/simpl/middleware/cors.py
@@ -41,7 +41,7 @@ class CORSMiddleware(object): # pylint: disable=R0903
"""Responds to CORS requests."""
- default_methods = ('GET', 'OPTIONS', 'POST', 'PUT', 'HEAD')
+ default_methods = ('GET', 'OPTIONS', 'POST', 'PUT', 'HEAD', 'DELETE')
default_headers = (
'Accept',
'Connection', | feat(cors): add DELETE as a valid, default method | rackerlabs_simpl | train | py |
f56635974eda6ef68ddac79dc07b8683f12660b6 | diff --git a/action/audit.go b/action/audit.go
index <HASH>..<HASH> 100644
--- a/action/audit.go
+++ b/action/audit.go
@@ -64,8 +64,9 @@ func (s *Action) Audit(c *cli.Context) error {
i := 0
for secret := range checked {
- duplicates[secret.content] = append(duplicates[secret.content], secret.name)
-
+ if secret.err == nil {
+ duplicates[secret.content] = append(duplicates[secret.content], secret.name)
+ }
if secret.message != "" {
messages[secret.message] = append(messages[secret.message], secret.name)
}
@@ -122,7 +123,7 @@ func (s *Action) audit(validator *crunchy.Validator, secrets <-chan string, chec
for secret := range secrets {
content, err := s.Store.GetFirstLine(secret)
if err != nil {
- checked <- auditedSecret{name: secret, content: string(content), err: err}
+ checked <- auditedSecret{name: secret, content: string(content), err: err, message: err.Error()}
continue
} | Fixed handling decryption errors during audit (#<I>) | gopasspw_gopass | train | go |
9163fc126e9e8c74707dd7b92c9f9a39fa9e2579 | diff --git a/orm/hook.go b/orm/hook.go
index <HASH>..<HASH> 100644
--- a/orm/hook.go
+++ b/orm/hook.go
@@ -72,15 +72,17 @@ func callHookSlice2(
hook func(context.Context, reflect.Value) error,
) error {
var firstErr error
- for i := 0; i < slice.Len(); i++ {
- v := slice.Index(i)
- if !ptr {
- v = v.Addr()
- }
-
- err := hook(c, v)
- if err != nil && firstErr == nil {
- firstErr = err
+ if slice.IsValid() {
+ for i := 0; i < slice.Len(); i++ {
+ v := slice.Index(i)
+ if !ptr {
+ v = v.Addr()
+ }
+
+ err := hook(c, v)
+ if err != nil && firstErr == nil {
+ firstErr = err
+ }
}
}
return firstErr | bug fix when AfterSelect hook called in has many relation
error reflect.Value.Len zero value | go-pg_pg | train | go |
f8782c8f947b8724de9dc9ce81342feaa008d1c3 | diff --git a/projects/robodj/src/java/robodj/chooser/PlaylistPanel.java b/projects/robodj/src/java/robodj/chooser/PlaylistPanel.java
index <HASH>..<HASH> 100644
--- a/projects/robodj/src/java/robodj/chooser/PlaylistPanel.java
+++ b/projects/robodj/src/java/robodj/chooser/PlaylistPanel.java
@@ -1,5 +1,5 @@
//
-// $Id: PlaylistPanel.java,v 1.5 2001/07/26 01:33:08 mdb Exp $
+// $Id: PlaylistPanel.java,v 1.6 2001/09/14 17:45:46 mdb Exp $
package robodj.chooser;
@@ -152,8 +152,12 @@ public class PlaylistPanel
continue;
}
Entry entry = Chooser.model.getEntry(eid);
- Song song = entry.getSong(sid);
- _plist.add(new PlaylistEntry(entry, song));
+ if (entry != null) {
+ Song song = entry.getSong(sid);
+ _plist.add(new PlaylistEntry(entry, song));
+ } else {
+ Log.warning("Unable to load entry [eid=" + eid + "].");
+ }
}
} | Make sure we can load up an entry for a particular eid that we found in
the playlist.
git-svn-id: <URL> | samskivert_samskivert | train | java |
a12ba3131f9e334bf096efa11864b1e1b071b117 | diff --git a/utils/jsonapi/api.go b/utils/jsonapi/api.go
index <HASH>..<HASH> 100644
--- a/utils/jsonapi/api.go
+++ b/utils/jsonapi/api.go
@@ -5,6 +5,7 @@ import (
"io"
"github.com/justwatchcom/gopass/store/root"
+ "github.com/justwatchcom/gopass/utils/out"
)
// API type holding store and context
@@ -16,12 +17,13 @@ type API struct {
// ReadAndRespond a single message via stdin/stdout
func (api *API) ReadAndRespond(ctx context.Context) error {
+ silentCtx := out.WithHidden(ctx, true)
message, err := readMessage(api.Reader)
if message == nil || err != nil {
return err
}
- return api.respondMessage(ctx, message)
+ return api.respondMessage(silentCtx, message)
}
// RespondError sends err as JSON response via stdout | Do not print status updates while writing messages (#<I>) | gopasspw_gopass | train | go |
3ddb7fe1b35914a9c7465ee9b521e3fb0b828f8a | diff --git a/manifest.php b/manifest.php
index <HASH>..<HASH> 100755
--- a/manifest.php
+++ b/manifest.php
@@ -29,7 +29,7 @@ return array(
'label' => 'QTI test model',
'description' => 'TAO QTI test implementation',
'license' => 'GPL-2.0',
- 'version' => '10.19.1',
+ 'version' => '10.19.2',
'author' => 'Open Assessment Technologies',
'requires' => array(
'taoTests' => '>=6.4.0',
diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php
index <HASH>..<HASH> 100644
--- a/scripts/update/Updater.php
+++ b/scripts/update/Updater.php
@@ -1460,6 +1460,6 @@ class Updater extends \common_ext_ExtensionUpdater {
$this->setVersion('10.17.0');
}
- $this->skip('10.17.0', '10.19.1');
+ $this->skip('10.17.0', '10.19.2');
}
} | Bump to version <I> | oat-sa_extension-tao-testqti | train | php,php |
c604ace9394cdc1c0c0a3002cbb3d90dd64695f3 | diff --git a/examples/mnist-classifier.py b/examples/mnist-classifier.py
index <HASH>..<HASH> 100644
--- a/examples/mnist-classifier.py
+++ b/examples/mnist-classifier.py
@@ -30,6 +30,9 @@ class Main(lmj.tnn.Main):
def get_datasets(self):
return [(x, y.astype('int32')) for x, y in cPickle.load(gzip.open(DATASET))]
-path = os.path.join(tempfile.gettempdir(), 'mnist-classifier.pkl.gz')
-Main().train().save(path)
-print 'saved network to', path
+m = Main()
+path = os.path.join(tempfile.gettempdir(), 'mnist-classifier-%s.pkl.gz' % m.opts.layers)
+if os.path.exists(path):
+ m.net.load(path)
+m.train()
+m.net.save(path) | Save mnist classifier model in a file named with the network topology. | lmjohns3_theanets | train | py |
88bbcbcebf84a8356002bfbe3001b39a2928c24a | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100755
--- a/index.js
+++ b/index.js
@@ -371,6 +371,7 @@ function gulpWPpot(options) {
}
contents += '"Plural-Forms: nplurals=2; plural=(n != 1);\\n"\n';
+ contents += '\n';
// Contents.
var translations = uniqueTranslations(translationsBuffer); | Add a blank line after headers
Add a blank line to separate headers with the first real msgid. Without it some poedit versions get troubles. | rasmusbe_gulp-wp-pot | train | js |
04eb1eea11eca186fd476d09241ee1183f802bee | diff --git a/bottle_sqlalchemy.py b/bottle_sqlalchemy.py
index <HASH>..<HASH> 100644
--- a/bottle_sqlalchemy.py
+++ b/bottle_sqlalchemy.py
@@ -69,6 +69,7 @@ if not hasattr(bottle, 'PluginError'):
class SQLAlchemyPlugin(object):
+ name = 'sqlalchemy'
api = 2
def __init__(self, engine, metadata=None,
@@ -86,7 +87,6 @@ class SQLAlchemyPlugin(object):
self.engine = engine
self.metadata = metadata
self.keyword = keyword
- self.name = 'sqlalchemy_' + self.keyword
self.create = create
self.commit = commit
self.use_kwargs = use_kwargs
@@ -100,6 +100,8 @@ class SQLAlchemyPlugin(object):
if other.keyword == self.keyword:
raise bottle.PluginError("Found another SQLAlchemy plugin with "\
"conflicting settings (non-unique keyword).")
+ elif other.name == self.name:
+ self.name += '_%s' % self.keyword
if self.create and not self.metadata:
raise bottle.PluginError('Define metadata value to create database.') | Only update the plugin name if an other plugin is installed | iurisilvio_bottle-sqlalchemy | train | py |
73145c61760165859a69b8a2554ea9aafc752a45 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -25,6 +25,13 @@ pip install --upgrade --pre pythainlp
Some functionalities, like named-entity recognition, required extra packages.
See https://github.com/PyThaiNLP/pythainlp for installation options.
+
+
+Made with ❤️
+
+PyThaiNLP Team
+
+"We build Thai NLP"
"""
requirements = [
@@ -63,7 +70,7 @@ extras = {
setup(
name="pythainlp",
- version="2.1.dev7",
+ version="2.1.dev8",
description="Thai Natural Language Processing library",
long_description=readme,
long_description_content_type="text/markdown", | PyThaiNLP <I>.dev8 | PyThaiNLP_pythainlp | train | py |
a5bfe72bd25e4b56aa2332c5dcc8d72f4d201eea | diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php
index <HASH>..<HASH> 100644
--- a/cake/libs/view/helpers/js.php
+++ b/cake/libs/view/helpers/js.php
@@ -1,25 +1,21 @@
<?php
-/* SVN FILE: $Id$ */
/**
* Javascript Generator class file.
*
* PHP versions 4 and 5
*
* CakePHP : Rapid Development Framework (http://www.cakephp.org)
- * Copyright 2006-2008, Cake Software Foundation, Inc.
+ * Copyright 2006-2009, Cake Software Foundation, Inc.
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
- * @copyright Copyright 2006-2008, Cake Software Foundation, Inc.
+ * @copyright Copyright 2006-2009, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
* @package cake
* @subpackage cake.cake.libs.view.helpers
* @since CakePHP v 1.2
- * @version $Revision$
- * @modifiedby $LastChangedBy$
- * @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
**/
/**
@@ -61,6 +57,7 @@ class JsHelper extends AppHelper {
* __objects
*
* @var array
+ * @access private
**/
var $__objects = array();
/** | Updating file header and doc blocks. | cakephp_cakephp | train | php |
479baf863e6bd7e5d06b7466a5e869f182feb688 | diff --git a/errors.go b/errors.go
index <HASH>..<HASH> 100644
--- a/errors.go
+++ b/errors.go
@@ -125,6 +125,12 @@ func (se SystemError) Code() SystemErrCode {
return se.code
}
+// IsSystemError returns whether the error is a system error.
+func IsSystemError(err error) bool {
+ _, ok := err.(SystemError)
+ return ok
+}
+
// GetSystemErrorCode returns the code to report for the given error. If the error is a SystemError, we can
// get the code directly. Otherwise treat it as an unexpected error
func GetSystemErrorCode(err error) SystemErrCode { | Add method to check if an error is a SystemError | uber_tchannel-go | train | go |
5e0860f207db66f8528eadeb641eba064acb8de9 | diff --git a/test/acceptance_test_utils.js b/test/acceptance_test_utils.js
index <HASH>..<HASH> 100644
--- a/test/acceptance_test_utils.js
+++ b/test/acceptance_test_utils.js
@@ -19,7 +19,7 @@ function hasClass(element, str) {
// for a moment. We may want to perform a query without waiting until the
// transition is over (because is rather long).
const CURRENT_CRED_PANE_SELECTOR = ".auth0-lock-cred-pane:not(.horizontal-fade-leave):not(.reverse-horizontal-fade-leave)";
-export const CRED_PANE_DELAY = 1200;
+export const CRED_PANE_DELAY = 1500;
// We also perform an animated transition with auxiliary panes.
const AUXILIARY_PANE_SELECTOR_SUFFIX = ":not(.slide-leave)"; | Increse CRED_PANE_DELAY because CI failure | auth0_lock | train | js |
552a174eeb808f5e6f040950e577459919a3361f | diff --git a/lib/utils.js b/lib/utils.js
index <HASH>..<HASH> 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -112,12 +112,14 @@ exports.cleanEcosystemConfig = function(config) {
};
exports.removeEcosystem = function(ecosystems, id) {
- var newEcosystems = [];
+ var index;
ecosystems.forEach(function(e) {
if (e.id !== id) {
- newEcosystems = newEcosystems.concat(e);
+ index = ecosystems.indexOf(e);
+ ecosystems.splice(index, 1);
+ break;
}
});
- return newEcosystems;
+ return ecosystems;
}; | use splice method in removeEcosystem method | kuno_neco | train | js |
dba70d06042ffb096aea17b1d167fc02c9c85e96 | diff --git a/core/workflow/service-engine/src/main/java/org/openengsb/drools/source/RuleBaseSource.java b/core/workflow/service-engine/src/main/java/org/openengsb/drools/source/RuleBaseSource.java
index <HASH>..<HASH> 100644
--- a/core/workflow/service-engine/src/main/java/org/openengsb/drools/source/RuleBaseSource.java
+++ b/core/workflow/service-engine/src/main/java/org/openengsb/drools/source/RuleBaseSource.java
@@ -29,7 +29,7 @@ public abstract class RuleBaseSource {
public enum RuleBaseElement {
Rule, Function, Process, Import, Global,
- }
+ };
protected ResourceHandler<?> getRessourceHandler(RuleBaseElement element) {
throw new UnsupportedOperationException("not implemented for type " + getClass()); | fix missing semicolon after enum-deklaration (xbean-plugin needs this) | openengsb_openengsb | train | java |
8a4ab8c191db735b0e427bf86910795d8a0b5fb9 | diff --git a/Filter/Filter/CustomAppendFormFieldsInterface.php b/Filter/Filter/CustomAppendFormFieldsInterface.php
index <HASH>..<HASH> 100644
--- a/Filter/Filter/CustomAppendFormFieldsInterface.php
+++ b/Filter/Filter/CustomAppendFormFieldsInterface.php
@@ -13,7 +13,7 @@ namespace Da2e\FiltrationBundle\Filter\Filter;
/**
* An interface, which can be used by filter to indicate if it has a custom function for appending form fields.
- * The interface must be used in coupe with FilterHasFormInterface.
+ * The interface should be used in coupe with FilterHasFormInterface.
*
* @author Dmitry Abrosimov <[email protected]>
*/
diff --git a/Filter/Filter/CustomApplyFilterInterface.php b/Filter/Filter/CustomApplyFilterInterface.php
index <HASH>..<HASH> 100644
--- a/Filter/Filter/CustomApplyFilterInterface.php
+++ b/Filter/Filter/CustomApplyFilterInterface.php
@@ -13,7 +13,7 @@ namespace Da2e\FiltrationBundle\Filter\Filter;
/**
* An interface, which can be used by filter to indicate if it has a custom function for applying filtration.
- * The interface must be used in coupe with FilterInterface.
+ * The interface should be used in coupe with FilterInterface.
*
* @author Dmitry Abrosimov <[email protected]>
*/ | Modified PHPDoc for filter interfaces. | dmitrya2e_filtration-bundle | train | php,php |
b374a7d9c7759ddd38f097d0db81cc44aaa989cf | diff --git a/dark/dna.py b/dark/dna.py
index <HASH>..<HASH> 100644
--- a/dark/dna.py
+++ b/dark/dna.py
@@ -110,16 +110,14 @@ def compareDNAReads(read1, read2, matchAmbiguous=True, gapChars=('-'),
read2AmbiguousOffsets.append(offset)
gapMismatchCount += 1
else:
- if b in gapChars:
- if len(AMBIGUOUS[a]) > 1:
+ if len(AMBIGUOUS[a]) > 1:
read1AmbiguousOffsets.append(offset)
+ if b in gapChars:
# b is a gap, a is not.
gapMismatchCount += 1
read2GapOffsets.append(offset)
else:
# Neither is a gap character.
- if len(AMBIGUOUS[a]) > 1:
- read1AmbiguousOffsets.append(offset)
if len(AMBIGUOUS[b]) > 1:
read2AmbiguousOffsets.append(offset)
if _identicalMatch(a, b): | Fix read1/2AmbiguousOffsets. | acorg_dark-matter | train | py |
e6bb118fafedb7c4a492bdadd4b8cbd9918f3c24 | diff --git a/ipyxact/ipyxact.py b/ipyxact/ipyxact.py
index <HASH>..<HASH> 100644
--- a/ipyxact/ipyxact.py
+++ b/ipyxact/ipyxact.py
@@ -153,10 +153,7 @@ class IpxactItem(object):
for f in root.findall("./{}:{}".format(ns[0], c), {ns[0] : ns[1]}):
child = getattr(self, c)[:]
class_name = c[0].upper() + c[1:]
- t = __import__(self.__module__)
- t = getattr(t, 'ipyxact')
- t = getattr(t, class_name)()
- #t = eval(class_name)()
+ t = globals()[class_name]()
t.parse_tree(f, ns)
child.append(t)
setattr(self, c, child) | bugfixes
- Incorporate <URL> such that ipyxact could be used as a git submodule | olofk_ipyxact | train | py |
b92b44d47f64a7e9cb64be3ad31b58a1c2518e41 | diff --git a/src/main/java/com/lonepulse/zombielink/core/MultiThreadedHttpClient.java b/src/main/java/com/lonepulse/zombielink/core/MultiThreadedHttpClient.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/lonepulse/zombielink/core/MultiThreadedHttpClient.java
+++ b/src/main/java/com/lonepulse/zombielink/core/MultiThreadedHttpClient.java
@@ -60,7 +60,7 @@ public enum MultiThreadedHttpClient implements HttpClientContract {
* <br><br>
* @since 1.1.1
*/
- private HttpClient httpClient;
+ private transient HttpClient httpClient;
/** | Update code as advised by FingBugs report | sahan_ZombieLink | train | java |
99c33958b6fe9e52e4898b4acf4f4367475e19d6 | diff --git a/firecloud/fiss.py b/firecloud/fiss.py
index <HASH>..<HASH> 100644
--- a/firecloud/fiss.py
+++ b/firecloud/fiss.py
@@ -1513,7 +1513,7 @@ def _valid_headerline(l):
if len(tsplit) != 2:
return False
- if tsplit[0] == 'entity':
+ if tsplit[0] in ('entity', 'update'):
return tsplit[1] in ('participant_id', 'participant_set_id',
'sample_id', 'sample_set_id',
'pair_id', 'pair_set_id') | Enable the updating of entities by allowing the 'update:' header | broadinstitute_fiss | train | py |
f7e6d2e77c9449b6eae1be2adae7816f7b2f49bb | diff --git a/lib/svtplay_dl/utils/__init__.py b/lib/svtplay_dl/utils/__init__.py
index <HASH>..<HASH> 100644
--- a/lib/svtplay_dl/utils/__init__.py
+++ b/lib/svtplay_dl/utils/__init__.py
@@ -53,10 +53,7 @@ class HTTP(Session):
self.headers[i] = headers[i]
log.debug("HTTP getting %r", url)
- try:
- res = Session.request(self, method, url, verify=self.verify, *args, **kwargs)
- except:
- return None
+ res = Session.request(self, method, url, verify=self.verify, *args, **kwargs)
return res
def split_header(self, headers): | utils: remove the try except from request.
this might cause some other issue. we will see. | spaam_svtplay-dl | train | py |
4f813ce1132f1e6f446616706bd6fe4e116a9fd4 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -6,7 +6,7 @@ const flatten = require('./flatten')
function habitat(prefix, defaults) {
if (!(this instanceof habitat))
- return new habitat(prefix);
+ return new habitat(prefix, defaults);
if (prefix)
this.prefix = prefix.toUpperCase();
if (defaults)
diff --git a/test/habitat.test.js b/test/habitat.test.js
index <HASH>..<HASH> 100644
--- a/test/habitat.test.js
+++ b/test/habitat.test.js
@@ -234,3 +234,12 @@ test('habitat regression: parse floats', function(t) {
t.same(env.get('PI'), 3.14);
t.end();
});
+
+test('new habitat regression: set defaults', function(t) {
+ var env = habitat('', {
+ 'IM-A-DEFAULT': true
+ });
+
+ t.same(env.get('IM-A-DEFAULT'), true);
+ t.end();
+}); | Fix issue #2 - Set defaults when ctor called w/o new | brianloveswords_habitat | train | js,js |
630abeb6932ec8922ae71af15b17b6091397af36 | diff --git a/app/helpers/effective_resources_helper.rb b/app/helpers/effective_resources_helper.rb
index <HASH>..<HASH> 100644
--- a/app/helpers/effective_resources_helper.rb
+++ b/app/helpers/effective_resources_helper.rb
@@ -94,7 +94,7 @@ module EffectiveResourcesHelper
locals[:format_block] = block if block_given?
render(partial: partial, collection: resource, as: :resource, locals: locals.except(:resource), spacer_template: spacer_template)
elsif block_given?
- render(partial, locals) { yield }
+ render(partial, locals) { capture(&block).to_s.html_safe }
else
render(partial, locals)
end | resource_actions_button with block fix | code-and-effect_effective_resources | train | rb |
a8d005eac15bdfc1cfc1f5692242bd3b7bbf7694 | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -353,4 +353,4 @@ texinfo_documents = [
# Example configuration for intersphinx: refer to the Python standard library.
-intersphinx_mapping = {'https://docs.python.org/': None}
+intersphinx_mapping = {'https://docs.python.org/3/': None} | Intersphinx mapping to Python 3 | ipython_ipynb | train | py |
ebd643d5908284e33e0fe0070c78fbb9893df882 | diff --git a/vulture/version.py b/vulture/version.py
index <HASH>..<HASH> 100644
--- a/vulture/version.py
+++ b/vulture/version.py
@@ -1 +1 @@
-__version__ = "2.3"
+__version__ = "2.4" | Update version number to <I> for release. | jendrikseipp_vulture | train | py |
8d294d4d0f231a41739e69f4cd57989cc7bbf819 | diff --git a/src/Transformers/BooleanTransformer.php b/src/Transformers/BooleanTransformer.php
index <HASH>..<HASH> 100644
--- a/src/Transformers/BooleanTransformer.php
+++ b/src/Transformers/BooleanTransformer.php
@@ -47,6 +47,6 @@ class BooleanTransformer implements Transformer
return null;
}
- return !!$value;
+ return !!$value && $value !== 'false';
}
}
\ No newline at end of file | Make sure BooleanTransformer handles "false" as false. | CatLabInteractive_charon | train | php |
63ef74f1dd923ddfd518fba289af05d47fa8cd51 | diff --git a/closure/goog/promise/thenable.js b/closure/goog/promise/thenable.js
index <HASH>..<HASH> 100644
--- a/closure/goog/promise/thenable.js
+++ b/closure/goog/promise/thenable.js
@@ -98,10 +98,6 @@ goog.Thenable.IMPLEMENTED_BY_PROP = '$goog_Thenable';
* corresponding class must have already implemented the interface.
*/
goog.Thenable.addImplementation = function(ctor) {
- // Use bracket notation instead of goog.exportSymbol() so that the compiler
- // won't create a 'var ctor;' extern when the "create externs from exports"
- // mode is enabled.
- ctor.prototype['then'] = ctor.prototype.then;
if (COMPILED) {
ctor.prototype[goog.Thenable.IMPLEMENTED_BY_PROP] = true;
} else { | It should be unnecessary to export the "then" method explicitly.
RELNOTES[INC]: Assume that "remove unused prototype properties in externs" is off.
-------------
Created by MOE: <URL> | google_closure-library | train | js |
d3ec02a313ef8bb6b623149429da5b47a3428bd7 | diff --git a/ontobio/__init__.py b/ontobio/__init__.py
index <HASH>..<HASH> 100644
--- a/ontobio/__init__.py
+++ b/ontobio/__init__.py
@@ -1,6 +1,6 @@
from __future__ import absolute_import
-__version__ = '0.3.0-rc'
+__version__ = '0.3.0rc0'
from .ontol_factory import OntologyFactory
from .ontol import Ontology, Synonym, TextDefinition | reformatting version the way pip likes. | biolink_ontobio | train | py |
84841c53e7053c7f08d2805776fb12eaf4162622 | diff --git a/features/step_definitions/cucumber_rails_steps.rb b/features/step_definitions/cucumber_rails_steps.rb
index <HASH>..<HASH> 100644
--- a/features/step_definitions/cucumber_rails_steps.rb
+++ b/features/step_definitions/cucumber_rails_steps.rb
@@ -14,7 +14,7 @@ module CucumberRailsHelper
end
gem "capybara", :group => :test
gem "rspec-rails", :group => :test
- gem "database_cleaner", { git: "git://github.com/bmabey/database_cleaner.git", :group => :test } unless options.include?(:no_database_cleaner)
+ gem "database_cleaner", { git: "[email protected]:davebrace/database_cleaner.git", :group => :test } unless options.include?(:no_database_cleaner)
gem 'factory_girl', :group => :test unless options.include?(:no_factory_girl)
run_simple 'bundle install'
run_simple 'bundle exec rails generate cucumber:install' | Switched back to using reference to my fork of database_cleaner until a patched version of database_cleaner is released. I had to tweak database_cleaner for Rails 4, the changes were merged but there hasn't been a new release yet. | cucumber_cucumber-rails | train | rb |
0b3cd053a729cfb7c09600d975f69ae253d67820 | diff --git a/lib/generators/spree_favorite_products/install/install_generator.rb b/lib/generators/spree_favorite_products/install/install_generator.rb
index <HASH>..<HASH> 100644
--- a/lib/generators/spree_favorite_products/install/install_generator.rb
+++ b/lib/generators/spree_favorite_products/install/install_generator.rb
@@ -5,8 +5,8 @@ module SpreeFavoriteProducts
class_option :auto_run_migrations, :type => :boolean, :default => false
def add_javascripts
- append_file 'app/assets/javascripts/store/all.js', "//= require store/spree_favorite_products\n"
- append_file 'app/assets/javascripts/admin/all.js', "//= require admin/spree_favorite_products\n"
+ append_file 'app/assets/javascripts/store/all.js', "\n//= require store/spree_favorite_products\n"
+ append_file 'app/assets/javascripts/admin/all.js', "\n//= require admin/spree_favorite_products\n"
end
def add_stylesheets | Update install_generator.rb | vinsol-spree-contrib_spree_favorite_products | train | rb |
aea0a5c1f0202be2c859c29cc76f15a6a7237c2f | diff --git a/confidence.py b/confidence.py
index <HASH>..<HASH> 100644
--- a/confidence.py
+++ b/confidence.py
@@ -159,26 +159,28 @@ class Configuration(Mapping):
reference = self._root.get(path, resolve_references=False)
- if isinstance(reference, Configuration):
- if match.span(0) != (0, len(value)):
+ if match.span(0) != (0, len(value)):
+ if isinstance(reference, Configuration):
raise ConfiguredReferenceError(
'cannot insert namespace at {path} into referring value'.format(path=path),
key=path
)
- return reference
-
- value = '{start}{reference}{end}'.format(
- start=value[:match.start(0)],
- reference=reference,
- end=value[match.end(0):]
- )
+ value = '{start}{reference}{end}'.format(
+ start=value[:match.start(0)],
+ reference=reference,
+ end=value[match.end(0):]
+ )
+ else:
+ value = reference
references.add(path)
- match = self._reference_pattern.search(value)
+ if isinstance(value, str):
+ match = self._reference_pattern.search(value)
+ else:
+ match = None
- # TODO: auto-convert value type to mimic value getting parsed from file?
return value
except NotConfiguredError as e:
# TODO: error should include key that includes the missing reference | Avoid templating 'only references' into a string
Fixes type conversions of referenced ints/bools/floats/… | HolmesNL_confidence | train | py |
a49d13b6936fedb1dc5c840933809f421b34b82e | diff --git a/src/lib/hardcoded.js b/src/lib/hardcoded.js
index <HASH>..<HASH> 100644
--- a/src/lib/hardcoded.js
+++ b/src/lib/hardcoded.js
@@ -39,7 +39,7 @@ define(
var dutchUniversitiesNoSaml= ['leidenuniv.nl', 'leiden.edu', 'uva.nl', 'vu.nl', 'eur.nl', 'maastrichtuniversity.nl',
'ru.nl', 'rug.nl', 'uu.nl', 'tudelft.nl', 'utwente.nl', 'tue.nl', 'tilburguniversity.edu', 'uvt.n', 'wur.nl',
'wageningenuniversity.nl', 'ou.nl', 'lumc.nl', 'amc.nl', 'tuxed.net'];
- var dutchUniversitiesSaml= ['surfnet.nl'];
+ var dutchUniversitiesSaml= ['surfnet.nl', 'fontys.nl'];
for(var i=0;i<dutchUniversitiesSaml.length;i++) {
guesses[dutchUniversitiesSaml[i]]=surfnetSaml;
} | add fontys as SAML domain | remotestorage_remotestorage.js | train | js |
e981b92c5aa46b9e65cfc90acad952fcca266a47 | diff --git a/client/state/sites/launch/actions.js b/client/state/sites/launch/actions.js
index <HASH>..<HASH> 100644
--- a/client/state/sites/launch/actions.js
+++ b/client/state/sites/launch/actions.js
@@ -23,10 +23,11 @@ export const launchSiteOrRedirectToLaunchSignupFlow = ( siteId ) => ( dispatch,
return;
}
- if (
- isCurrentPlanPaid( getState(), siteId ) &&
- getDomainsBySiteId( getState(), siteId ).length > 1
- ) {
+ const isAnchorPodcast = getSiteOption( getState(), siteId, 'anchor_podcast' );
+ const isPaidWithDomain =
+ isCurrentPlanPaid( getState(), siteId ) && getDomainsBySiteId( getState(), siteId ).length > 1;
+
+ if ( isPaidWithDomain || isAnchorPodcast ) {
dispatch( launchSite( siteId ) );
return;
} | Home Screen Task List: Anchor sites launch immediately (#<I>) | Automattic_wp-calypso | train | js |
7e4d933fd3378828e99deaedd2a374da06ae0c2c | diff --git a/etcd3/client.py b/etcd3/client.py
index <HASH>..<HASH> 100644
--- a/etcd3/client.py
+++ b/etcd3/client.py
@@ -136,21 +136,32 @@ class Etcd3Client(object):
for kv in range_response.kvs:
yield (kv.key, kv.value)
- def _build_put_request(self, key, value):
+ def _build_put_request(self, key, value, lease=None):
put_request = etcdrpc.PutRequest()
put_request.key = utils.to_bytes(key)
put_request.value = utils.to_bytes(value)
+
+ if hasattr(lease, 'id'):
+ lease_id = lease.id
+ else:
+ try:
+ lease_id = int(lease)
+ except TypeError:
+ lease_id = 0
+ put_request.lease = lease_id
return put_request
- def put(self, key, value):
+ def put(self, key, value, lease=None):
"""
Save a value to etcd.
:param key: key in etcd to set
:param value: value to set key to
:type value: bytes
+ :param lease: Lease to associate with this key.
+ :type lease: either :class:`.Lease`, or int (ID of lease)
"""
- put_request = self._build_put_request(key, value)
+ put_request = self._build_put_request(key, value, lease=lease)
self.kvstub.Put(put_request)
def _build_delete_request(self, key, | Allow attaching a lease to a key | kragniz_python-etcd3 | train | py |
362fd1d81124ec78c055c0b851da6db89814c737 | diff --git a/src/DoubleBit/OKCoin/Okcoin.php b/src/DoubleBit/OKCoin/Okcoin.php
index <HASH>..<HASH> 100644
--- a/src/DoubleBit/OKCoin/Okcoin.php
+++ b/src/DoubleBit/OKCoin/Okcoin.php
@@ -71,7 +71,15 @@ class Okcoin
}
return $res->getBody();
} catch (\Exception $e) {
- throw new OkcoinException($e->getMessage(), $e->getCode());
+ $message = $e->getMessage();
+ $code = $e->getCode();
+ if (!$message || !is_string($message)) {
+ $message = 'Invalid message';
+ }
+ if (!$code || !is_numeric($code)) {
+ $code = 888;
+ }
+ throw new OkcoinException($message, $code);
}
} | Tried a fix for a weird issue with the exception inheritance | doublebit_okcoin | train | php |
367655fd936c8ebccba3c4f4f9f1f21f327b687e | diff --git a/javacord-api/src/main/java/org/javacord/api/event/audio/AudioSourceFinishedEvent.java b/javacord-api/src/main/java/org/javacord/api/event/audio/AudioSourceFinishedEvent.java
index <HASH>..<HASH> 100644
--- a/javacord-api/src/main/java/org/javacord/api/event/audio/AudioSourceFinishedEvent.java
+++ b/javacord-api/src/main/java/org/javacord/api/event/audio/AudioSourceFinishedEvent.java
@@ -1,23 +1,8 @@
package org.javacord.api.event.audio;
-import org.javacord.api.audio.AudioSource;
-
-import java.util.Optional;
-
/**
* An audio source finished event.
*/
public interface AudioSourceFinishedEvent extends AudioSourceEvent {
- /**
- * Gets the next source of the audio connection.
- *
- * <p>This method is equal to calling {@code getConnection().getCurrentAudioSource()}.
- *
- * @return The next source of the audio connection.
- */
- default Optional<AudioSource> getNextSource() {
- return getConnection().getAudioSource();
- }
-
} | Remove AudioSourceFinishedEvent#getNextSource()
We no longer have a queue, so this method does not make any sense. | Javacord_Javacord | train | java |
0298851f5e87873dda0786fdeec3371bcc77727e | diff --git a/src/Console/Command/User/Create.php b/src/Console/Command/User/Create.php
index <HASH>..<HASH> 100644
--- a/src/Console/Command/User/Create.php
+++ b/src/Console/Command/User/Create.php
@@ -228,7 +228,7 @@ class Create extends Base
private function createUser($aUser, $iGroupId)
{
$oUserModel = Factory::model('User', 'nailsapp/module-auth');
- $aUSer['group_id'] = $iGroupId;
+ $aUser['group_id'] = $iGroupId;
try {
$oUser = $oUserModel->create($aUser, false);
} catch (\Exception $e) { | Typo whenc reating a user on the command line | nails_module-auth | train | php |
36592bb05eac548c97b5ba59f0dd0746cf4d4445 | diff --git a/src/TranslatorServiceProvider.php b/src/TranslatorServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/TranslatorServiceProvider.php
+++ b/src/TranslatorServiceProvider.php
@@ -167,7 +167,7 @@ class TranslatorServiceProvider extends AbstractSignatureServiceProvider
protected function registerMiddleware()
{
- $kernel = $this->getContainer()->get('kernel');
+ $kernel = $this->getContainer()->get('kernel.http');
$kernel->pushMiddleware(
new LocalizationMiddleware($this->getContainer()->get('translator'))
); | fix kernel alias getter from container | bytic_translation | train | php |
e8588a38b917151a121788f44550b00ddb2ea425 | diff --git a/server/libs/request.js b/server/libs/request.js
index <HASH>..<HASH> 100644
--- a/server/libs/request.js
+++ b/server/libs/request.js
@@ -27,7 +27,7 @@ export default {
handleRequest(url, options, req => {
request
.get(req)
- .on('response', resp => {
+ .on('data', resp => {
if (options.status) {
resp.statusCode = options.status
} | Fix POST request gzip issue with proxied SciTran requests. | OpenNeuroOrg_openneuro | train | js |
3bdca320298a77862601eb044af5a4584fb15fa9 | diff --git a/lib/chef/provisioning/aws_driver/driver.rb b/lib/chef/provisioning/aws_driver/driver.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/provisioning/aws_driver/driver.rb
+++ b/lib/chef/provisioning/aws_driver/driver.rb
@@ -161,12 +161,22 @@ module AWSDriver
end
def deep_symbolize_keys(hash_like)
+ # Process arrays first...
+ if hash_like.is_a?(Array)
+ hash_like.length.times do |e|
+ hash_like[e]=deep_symbolize_keys(hash_like[e]) if hash_like[e].respond_to?(:values) or hash_like[e].is_a?(Array)
+ end
+ return hash_like
+ end
+ # Otherwise return ourselves if not a hash
+ return hash_like if not hash_like.respond_to?(:values)
+ # Otherwise we are hash like, push on through...
if hash_like.nil? || hash_like.empty?
return {}
end
r = {}
hash_like.each do |key, value|
- value = deep_symbolize_keys(value) if value.respond_to?(:values)
+ value = deep_symbolize_keys(value) if value.respond_to?(:values) or value.is_a?(Array)
r[key.to_sym] = value
end
r | correctly deep symbolize if lists are involved, like with disks/network interfaces | chef_chef-provisioning-aws | train | rb |
Subsets and Splits