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 |
|---|---|---|---|---|---|
6af7bd4d6bb17ac4ef858c85f2f0c4560c7c3b92 | diff --git a/src/js/boards.js b/src/js/boards.js
index <HASH>..<HASH> 100644
--- a/src/js/boards.js
+++ b/src/js/boards.js
@@ -130,11 +130,12 @@
if (e.isNew)
{
var DROP = 'drop';
+ var result;
if (setting.hasOwnProperty(DROP) && $.isFunction(setting[DROP]))
{
- setting[DROP](e);
+ result = setting[DROP](e);
}
- e.element.insertBefore(e.target);
+ if(result !== false) e.element.insertBefore(e.target);
}
},
finish: function() | * drop action can be cancel in board. | easysoft_zui | train | js |
ea92af1525b60d4eb6aed8d17fab725592e06ed2 | diff --git a/lib/plans.go b/lib/plans.go
index <HASH>..<HASH> 100644
--- a/lib/plans.go
+++ b/lib/plans.go
@@ -16,6 +16,8 @@ type Plan struct {
Disk string `json:"disk"`
Bandwidth string `json:"bandwidth"`
Price string `json:"price_per_month"`
+ PlanType string `json:"plan_type"`
+ Windows bool `json:"windows"`
Regions []int `json:"available_locations"`
} | Update plans.go
added PlanTypes and Windows to struct 'Plan' following Vultr's plan API response
<URL> | JamesClonk_vultr | train | go |
c2bee817056d21696eb269287edeb110da90ff24 | diff --git a/extensions/multibindings/src/com/google/inject/multibindings/Multibinder.java b/extensions/multibindings/src/com/google/inject/multibindings/Multibinder.java
index <HASH>..<HASH> 100644
--- a/extensions/multibindings/src/com/google/inject/multibindings/Multibinder.java
+++ b/extensions/multibindings/src/com/google/inject/multibindings/Multibinder.java
@@ -72,8 +72,8 @@ import java.util.Set;
* }</code></pre>
*
* <p>Contributing multibindings from different modules is supported. For
- * example, it is okay to have both {@code CandyModule} and {@code ChipsModule}
- * to both create their own {@code Multibinder<Snack>}, and to each contribute
+ * example, it is okay for both {@code CandyModule} and {@code ChipsModule}
+ * to create their own {@code Multibinder<Snack>}, and to each contribute
* bindings to the set of snacks. When that set is injected, it will contain
* elements from both modules.
* | Fix issue <I>, cleanup javadoc for Multibinder
Revision created by MOE tool push_codebase.
MOE_MIGRATION=<I> | sonatype_sisu-guice | train | java |
e0db6e91debe3336397e0e171c634709ce725b39 | diff --git a/impl/src/main/java/org/jboss/weld/bootstrap/events/BeanBuilderImpl.java b/impl/src/main/java/org/jboss/weld/bootstrap/events/BeanBuilderImpl.java
index <HASH>..<HASH> 100644
--- a/impl/src/main/java/org/jboss/weld/bootstrap/events/BeanBuilderImpl.java
+++ b/impl/src/main/java/org/jboss/weld/bootstrap/events/BeanBuilderImpl.java
@@ -153,11 +153,13 @@ public final class BeanBuilderImpl<T> extends BeanAttributesBuilder<T, BeanBuild
public BeanBuilder<T> addInjectionPoints(InjectionPoint... injectionPoints) {
checkArgumentNotNull(injectionPoints, ARG_INJECTION_POINTS);
+ Collections.addAll(this.injectionPoints, injectionPoints);
return this;
}
public BeanBuilder<T> addInjectionPoints(Set<InjectionPoint> injectionPoints) {
checkArgumentNotNull(injectionPoints, ARG_INJECTION_POINTS);
+ this.injectionPoints.addAll(injectionPoints);
return this;
} | Fix missing add of injection points in BeanBuilderImpl. | weld_core | train | java |
7eda51ef4bc48b8d5a7ca0ff0b732344ba75daf3 | diff --git a/src/Phug/Formatter.php b/src/Phug/Formatter.php
index <HASH>..<HASH> 100644
--- a/src/Phug/Formatter.php
+++ b/src/Phug/Formatter.php
@@ -141,7 +141,7 @@ class Formatter implements ModuleContainerInterface
$error->getMessage(),
$error->getCode(),
$error,
- $node->getFile(), //TODO: getFile is not exported in NodeInterface
+ $node->getFile(),
$node->getLine(),
$node->getOffset()
); | getFile will be available on Parser next release | phug-php_formatter | train | php |
dd8b4e714c0b521e282fb8ea2df11b167882c511 | diff --git a/urbansim/utils/misc.py b/urbansim/utils/misc.py
index <HASH>..<HASH> 100644
--- a/urbansim/utils/misc.py
+++ b/urbansim/utils/misc.py
@@ -1,8 +1,6 @@
from __future__ import print_function
import os
-import yaml
-
import numpy as np
import pandas as pd | one more - no longer need to import yaml here | UDST_urbansim | train | py |
a9a063b9b58befacb41238aadeb30e11d137da00 | diff --git a/src/main/java/com/bitmechanic/barrister/Idl2Java.java b/src/main/java/com/bitmechanic/barrister/Idl2Java.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/bitmechanic/barrister/Idl2Java.java
+++ b/src/main/java/com/bitmechanic/barrister/Idl2Java.java
@@ -414,7 +414,7 @@ public class Idl2Java {
private void toFile(String pkgName, String className) throws Exception {
String dirName = mkdirForPackage(pkgName);
- String outfile = dirName + File.separator + className + ".java";
+ String outfile = (dirName + File.separator + className + ".java").replace("/", File.separator);
out("Writing file: " + outfile);
PrintWriter w = new PrintWriter(new FileWriter(outfile));
@@ -423,7 +423,7 @@ public class Idl2Java {
}
private String mkdirForPackage(String pkgName) {
- String dirName = outDir + File.separator + pkgName.replace('.', File.separatorChar);
+ String dirName = (outDir + File.separator + pkgName.replace('.', File.separatorChar)).replace("/", File.separator);
File dir = new File(dirName);
if (!dir.exists()) { | Ensure file/dir paths have correct separator | coopernurse_barrister-java | train | java |
3b0d2cef3b4b4f3f3c7964b05cd5c6bc404b1ef5 | diff --git a/src/CoandaCMS/Coanda/Pages/Repositories/Eloquent/EloquentPageRepository.php b/src/CoandaCMS/Coanda/Pages/Repositories/Eloquent/EloquentPageRepository.php
index <HASH>..<HASH> 100644
--- a/src/CoandaCMS/Coanda/Pages/Repositories/Eloquent/EloquentPageRepository.php
+++ b/src/CoandaCMS/Coanda/Pages/Repositories/Eloquent/EloquentPageRepository.php
@@ -959,11 +959,11 @@ class EloquentPageRepository implements PageRepositoryInterface {
if ($permanent)
{
+ $this->logHistory('deleted', $page->id, ['page_name' => $page->name]);
+
$this->deleteSubPages($page, true);
$this->urls->delete('page', $page->id);
$page->delete();
-
- $this->logHistory('deleted', $page->id, ['page_name' => $page->name]);
}
else
{ | When deleting a page, need to log the fact it was deleted first, otherwise the versions have gone and the name can't be generated. | CoandaCMS_coanda-core | train | php |
70f8de050720b2be4e4b0ddcb0a02a6eaeb45126 | diff --git a/lib/WebDriverExpectedCondition.php b/lib/WebDriverExpectedCondition.php
index <HASH>..<HASH> 100644
--- a/lib/WebDriverExpectedCondition.php
+++ b/lib/WebDriverExpectedCondition.php
@@ -49,6 +49,20 @@ class WebDriverExpectedCondition {
}
/**
+ * An expectation for checking substring of a page Title.
+ *
+ * @param string title The expected substring of Title.
+ * @return bool True when in title, false otherwise.
+ */
+ public static function inTitle($title) {
+ return new WebDriverExpectedCondition(
+ function ($driver) use ($title) {
+ return strstr($driver->getTitle(),$title);
+ }
+ );
+ }
+
+ /**
* An expectation for checking that an element is present on the DOM of a
* page. This does not necessarily mean that the element is visible.
* | added expectation for substring of title. | facebook_php-webdriver | train | php |
f98327e10b5cbadfd0e060ba6b8fe468bbcc706c | diff --git a/app/lib/katello/concerns/base_template_scope_extensions.rb b/app/lib/katello/concerns/base_template_scope_extensions.rb
index <HASH>..<HASH> 100644
--- a/app/lib/katello/concerns/base_template_scope_extensions.rb
+++ b/app/lib/katello/concerns/base_template_scope_extensions.rb
@@ -161,7 +161,7 @@ module Katello
returns String, desc: 'Package version'
end
def host_latest_applicable_rpm_version(host, package)
- host.applicable_rpms.where(name: package).order(:version_sortable).limit(1).pluck(:nvra).first
+ ::Katello::Rpm.latest(host.applicable_rpms.where(name: package)).first.nvra
end
apipie :method, 'Loads Pool objects' do | Fixes #<I> - wrong latest kernel version in Registered Content Hosts report (#<I>) | Katello_katello | train | rb |
f83fc302a504919f6668060110cbb8b64c26dd07 | diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index <HASH>..<HASH> 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -218,7 +218,7 @@ func init() {
// Initialize the CLI app and start Geth
app.Action = geth
app.HideVersion = true // we have a command to print the version
- app.Copyright = "Copyright 2013-2020 The go-ethereum Authors"
+ app.Copyright = "Copyright 2013-2021 The go-ethereum Authors"
app.Commands = []cli.Command{
// See chaincmd.go:
initCommand, | cmd/geth: update copyright year (#<I>) | ethereum_go-ethereum | train | go |
1dc9b04b314d1cda5c338b2981f09923cdd3d9be | diff --git a/web/web.go b/web/web.go
index <HASH>..<HASH> 100644
--- a/web/web.go
+++ b/web/web.go
@@ -140,6 +140,10 @@ func formatEndpoint(v *registry.Value, r int) string {
return fmt.Sprintf(strings.Join(fparts, ""), vals...)
}
+func faviconHandler(w http.ResponseWriter, r *http.Request) {
+ return
+}
+
func indexHandler(w http.ResponseWriter, r *http.Request) {
services, err := (*cmd.DefaultOptions().Registry).ListServices()
if err != nil {
@@ -250,6 +254,7 @@ func run(ctx *cli.Context) {
s.HandleFunc("/registry", registryHandler)
s.HandleFunc("/rpc", handler.RPC)
s.HandleFunc("/query", queryHandler)
+ s.HandleFunc("/favicon.ico", faviconHandler)
s.PathPrefix("/{service:[a-zA-Z0-9]+}").Handler(s.proxy())
s.HandleFunc("/", indexHandler) | add cruft favicon.ico handler so it doesn't error | micro_micro | train | go |
0a208e843df977da8d81266894514fdbb867963c | diff --git a/spec/cucumber/formatter/junit_spec.rb b/spec/cucumber/formatter/junit_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/cucumber/formatter/junit_spec.rb
+++ b/spec/cucumber/formatter/junit_spec.rb
@@ -66,6 +66,29 @@ module Cucumber
it { expect(@doc.xpath('//testsuite/testcase/system-out').first.content).to match(/\s+boo boo\s+/) }
end
+ describe 'is able to handle multiple encodings in pipe' do
+ before(:each) do
+ run_defined_feature
+ @doc = Nokogiri.XML(@formatter.written_files.values.first)
+ end
+
+ define_steps do
+ Given(/a passing ctrl scenario/) do
+ Kernel.puts "encoding"
+ Kernel.puts "pickle".encode("UTF-16")
+ end
+ end
+
+ define_feature "
+ Feature: One passing scenario, one failing scenario
+
+ Scenario: Passing
+ Given a passing ctrl scenario
+ "
+
+ it { expect(@doc.xpath('//testsuite/testcase/system-out').first.content).to match(/\s+encoding\npickle\s+/) }
+ end
+
describe 'a feature with no name' do
define_feature <<-FEATURE
Feature: | Add test for handling captured output encodings in junit | cucumber_cucumber-ruby | train | rb |
e3f22cfa7357b36b5aec893fc34dcf63eeb28119 | diff --git a/tests/xml/test_MultiPartyCallElement.py b/tests/xml/test_MultiPartyCallElement.py
index <HASH>..<HASH> 100644
--- a/tests/xml/test_MultiPartyCallElement.py
+++ b/tests/xml/test_MultiPartyCallElement.py
@@ -37,7 +37,8 @@ class MultiPartyCallElementTest(TestCase, PlivoXmlTestCase):
def test_validation_on_init(self):
expected_error = '["status_callback_events should be among (\'mpc-state-changes\', ' \
- '\'participant-state-changes\', \'participant-speak-events\'). ' \
+ '\'participant-state-changes\', \'participant-speak-events\', ' \
+ '\'participant-digit-input-events\', \'add-participant-api-events\'). ' \
'multiple values should be COMMA(,) separated (actual value: hostages-move)"]'
actual_error = '' | MultiPartyCallElementTest.test_validation_on_init: update expected error
this should probably not be hardcoded, but that looks like a bigger change across the test suite | plivo_plivo-python | train | py |
b3bd79189994d89bfad9a2c7b5a5b0a4789ebea1 | diff --git a/lib/emitter.js b/lib/emitter.js
index <HASH>..<HASH> 100644
--- a/lib/emitter.js
+++ b/lib/emitter.js
@@ -61,6 +61,12 @@ class Emitter {
callback(params[0]);
} else if (paramsLength === 2) {
callback(params[0], params[1]);
+ } else if (paramsLength === 3) {
+ callback(params[0], params[1], params[2]);
+ } else if (paramsLength === 4) {
+ callback(params[0], params[1], params[2], params[3]);
+ } else if (paramsLength === 5) {
+ callback(params[0], params[1], params[2], params[3], params[4]);
} else {
callback.apply(undefined, params);
} | :arrow_up: Upgrade dist file | steelbrain_event-kit | train | js |
9d29b0404b2274c7275f60fdcbe3193dc81107af | diff --git a/control/runner.go b/control/runner.go
index <HASH>..<HASH> 100644
--- a/control/runner.go
+++ b/control/runner.go
@@ -307,6 +307,12 @@ func (r *runner) Start() error {
// Stop handling, gracefully stop all plugins.
func (r *runner) Stop() []error {
var errs []error
+
+ // Stop the monitor
+ r.monitor.Stop()
+
+ // TODO: Actually stop the plugins
+
// For each delegate unregister needed handlers
for _, del := range r.delegates {
e := del.UnregisterHandler(HandlerRegistrationName) | Stop the monitor when runner.Stop() is called | intelsdi-x_snap | train | go |
f6b281f0ef82db395bc965adf85879e2088ce021 | diff --git a/test/commands/console_test.rb b/test/commands/console_test.rb
index <HASH>..<HASH> 100644
--- a/test/commands/console_test.rb
+++ b/test/commands/console_test.rb
@@ -183,9 +183,17 @@ describe Lotus::Commands::Console do
end
end
- it 'preloads application' do
- assert defined?(Frontend::Controllers::Sessions::New), "expected Frontend::Controllers::Sessions::New to be loaded"
- end
+ # This generates random failures due to the race condition.
+ #
+ # I feel confident to ship this change without activating this test.
+ # In an ideal world this shouldn't happen, but I want to ship soon 0.2.0
+ #
+ # Love,
+ # Luca
+ it 'preloads application'
+ # it 'preloads application' do
+ # assert defined?(Frontend::Controllers::Sessions::New), "expected Frontend::Controllers::Sessions::New to be loaded"
+ # end
end
describe 'when manually setting the environment file' do | Muted failing tests introduced by <I>ca<I>f9a<I>fd6c5d<I>f<I>ec. My apologies :crying_cat_face: | hanami_hanami | train | rb |
97682e982781681d88d27baa87cf3a4aa403b45b | diff --git a/src/sos/utils.py b/src/sos/utils.py
index <HASH>..<HASH> 100644
--- a/src/sos/utils.py
+++ b/src/sos/utils.py
@@ -895,10 +895,6 @@ def sos_handle_parameter_(key, defvalue):
NOTE: parmeters will not be handled if it is already defined in
the environment. This makes the parameters variable.
'''
- if key in env.symbols:
- env.logger.warning(
- f'Parameter {key} overrides a Python or SoS keyword.')
-
env.parameter_vars.add(key)
if not env.sos_dict['__args__']:
if isinstance(defvalue, type):
@@ -910,6 +906,10 @@ def sos_handle_parameter_(key, defvalue):
if key in env.sos_dict['__args__']:
return env.sos_dict['__args__'][key]
#
+ if key in env.symbols:
+ env.logger.warning(
+ f'Parameter {key} overrides a Python or SoS keyword.')
+ #
parser = argparse.ArgumentParser()
# thre is a possibility that users specify --cut-off instead of --cut_off for parameter
# cut_off. It owuld be nice to allow both. | Reduce the occurance of warning message #<I> | vatlab_SoS | train | py |
4fab0e5f0f1c65864d122d18428f80702d47ef09 | diff --git a/nodejs/matrix/cost.js b/nodejs/matrix/cost.js
index <HASH>..<HASH> 100644
--- a/nodejs/matrix/cost.js
+++ b/nodejs/matrix/cost.js
@@ -81,6 +81,11 @@ function penalty_costs(penalty, bounds, prmname) {
if( bounds.LBDefined ) {
if( costs[0].lb !== bounds.LB ) {
costs[0].lb = bounds.LB;
+
+ // need to adjust the ub as well.
+ if( penalty.length >= 3 ) {
+ costs[0].ub = penalty[2][0];
+ }
if( LOCAL_DEBUG ) console.log(`${prmname}: s<0 && LB, setting k=0 lb to LB`);
updated = true;
} | adjusting ub when moving k=0 to physical lower bound | ucd-cws_calvin-network-tools | train | js |
e424da92fa17eee6b83d71e9a7daa0ec6efb9a07 | diff --git a/erizo_controller/common/semanticSdp/SimulcastInfo.js b/erizo_controller/common/semanticSdp/SimulcastInfo.js
index <HASH>..<HASH> 100755
--- a/erizo_controller/common/semanticSdp/SimulcastInfo.js
+++ b/erizo_controller/common/semanticSdp/SimulcastInfo.js
@@ -14,14 +14,14 @@ class SimulcastInfo {
sendStreams.forEach((sendStream) => {
alternatives.push(sendStream.clone());
});
- cloned.addSimulcastAlternativeStreams(alternatives);
+ cloned.addSimulcastAlternativeStreams(DirectionWay.SEND, alternatives);
});
this.recv.forEach((recvStreams) => {
const alternatives = [];
recvStreams.forEach((recvStream) => {
alternatives.push(recvStream.clone());
});
- cloned.addSimulcastAlternativeStreams(alternatives);
+ cloned.addSimulcastAlternativeStreams(DirectionWay.RECV, alternatives);
});
return cloned;
} | Fix cloning of SimulcastInfos (#<I>) | lynckia_licode | train | js |
05f4a016375edb0be509b7c186562b58042764a5 | diff --git a/src/js/components/Diagram/diagram.stories.js b/src/js/components/Diagram/diagram.stories.js
index <HASH>..<HASH> 100644
--- a/src/js/components/Diagram/diagram.stories.js
+++ b/src/js/components/Diagram/diagram.stories.js
@@ -48,7 +48,7 @@ class SimpleDiagram extends React.Component {
const connections = [connection('1', '5', { color: 'accent-2' })];
if (topRow.length >= 2) {
connections.push(
- connection('4', '2', { color: 'accent-1', anchor: 'horizontal' }),
+ connection('1', '2', { color: 'accent-1', anchor: 'horizontal' }),
);
}
if (topRow.length >= 3) { | Changed diagram story to remove swastika (#<I>) | grommet_grommet | train | js |
2062c6b85eb0547dcccbb6f4d9507281dfc3ccb5 | diff --git a/src/tokencontext.js b/src/tokencontext.js
index <HASH>..<HASH> 100644
--- a/src/tokencontext.js
+++ b/src/tokencontext.js
@@ -46,6 +46,8 @@ pp.braceIsBlock = function(prevType) {
return true
if (prevType == tt.braceL)
return this.curContext() === types.b_stat
+ if (prevType == tt._var || prevType == tt.name)
+ return false
return !this.exprAllowed
}
diff --git a/test/tests-harmony.js b/test/tests-harmony.js
index <HASH>..<HASH> 100644
--- a/test/tests-harmony.js
+++ b/test/tests-harmony.js
@@ -15666,6 +15666,10 @@ test("[...foo, bar = 1]", {}, {ecmaVersion: 6})
test("for (var a of /b/) {}", {}, {ecmaVersion: 6})
+test("for (var {a} of /b/) {}", {}, {ecmaVersion: 6})
+
+test("for (let {a} of /b/) {}", {}, {ecmaVersion: 6})
+
test("function* bar() { yield /re/ }", {}, {ecmaVersion: 6})
test("() => {}\n/re/", {}, {ecmaVersion: 6}) | Fix token context for braces after let/var/const
Issue #<I> | acornjs_acorn | train | js,js |
d3d3d5d0f4bcc931d374bcbeca86185edcfb03d1 | diff --git a/lib/specjour/manager.rb b/lib/specjour/manager.rb
index <HASH>..<HASH> 100644
--- a/lib/specjour/manager.rb
+++ b/lib/specjour/manager.rb
@@ -61,11 +61,15 @@ module Specjour
def dispatch_loader
@loader_pid = fork do
# at_exit { exit! }
- exec_cmd = "specjour load --printer-uri #{dispatcher_uri} --workers #{worker_size} --task #{worker_task} --project-path #{project_path}"
+ exec_cmd = "load --printer-uri #{dispatcher_uri} --workers #{worker_size} --task #{worker_task} --project-path #{project_path}"
exec_cmd << " --preload-spec #{preload_spec}" if preload_spec
exec_cmd << " --preload-feature #{preload_feature}" if preload_feature
exec_cmd << " --log" if Specjour.log?
exec_cmd << " --quiet" if quiet?
+ exec_ruby = "Specjour::CLI.start(#{exec_cmd.split(' ').inspect})"
+ load_path = ''
+ $LOAD_PATH.each {|p| load_path << "-I#{p} "}
+ exec_cmd = "ruby #{load_path} -rspecjour -e '#{exec_ruby}'"
exec exec_cmd
end
Process.waitall | Run loader outside of bundler's environment | sandro_specjour | train | rb |
08e5ffb5180e69ceb8bb50631ccee1d842dab362 | diff --git a/galpy/orbit_src/planarOrbit.py b/galpy/orbit_src/planarOrbit.py
index <HASH>..<HASH> 100644
--- a/galpy/orbit_src/planarOrbit.py
+++ b/galpy/orbit_src/planarOrbit.py
@@ -307,8 +307,8 @@ class planarOrbit(planarOrbitTop):
HISTORY:
2010-07-10 - Written - Bovy (NYU)
"""
- self.E= [evaluateplanarPotentials(self.orbit[ii,0],
- self.orbit[ii,3],pot)+
+ self.E= [evaluateplanarPotentials(self.orbit[ii,0],pot,
+ phi=self.orbit[ii,3])+
self.orbit[ii,1]**2./2.+self.orbit[ii,2]**2./2.
for ii in range(len(self.t))]
plot.bovy_plot(nu.array(self.t),nu.array(self.E)/self.E[0], | fix plotEt for planarOrbit | jobovy_galpy | train | py |
70618a57eec058f96c1cbf94b93ca6ba31d7fb9a | diff --git a/regions/core/attributes.py b/regions/core/attributes.py
index <HASH>..<HASH> 100644
--- a/regions/core/attributes.py
+++ b/regions/core/attributes.py
@@ -13,6 +13,10 @@ import numpy as np
from .core import PixelRegion, SkyRegion
from .pixcoord import PixCoord
+__all__ = ['RegionAttr', 'ScalarPix', 'OneDPix', 'ScalarLength',
+ 'ScalarSky', 'OneDSky', 'QuantityLength',
+ 'CompoundRegionPix', 'CompoundRegionSky']
+
class RegionAttr(abc.ABC):
"""Descriptor base class""" | Add __all__ to attributes | astropy_regions | train | py |
ed71540f73824ad3363e895aeb63d1590f34619e | diff --git a/src/zoid/buttons/util.js b/src/zoid/buttons/util.js
index <HASH>..<HASH> 100644
--- a/src/zoid/buttons/util.js
+++ b/src/zoid/buttons/util.js
@@ -121,7 +121,7 @@ export function createNoPaylaterExperiment(fundingSource : ?$Values<typeof FUNDI
return;
}
- return createExperiment('disable_paylater', 10);
+ return createExperiment('disable_paylater', 0);
}
export function getNoPaylaterExperiment(fundingSource : ?$Values<typeof FUNDING>) : EligibilityExperiment { | turn off pay later experiment (#<I>) | paypal_paypal-checkout-components | train | js |
e5b5078415d1b3eeb87e03064aac3f199a9a2666 | diff --git a/consul/server_manager/server_manager.go b/consul/server_manager/server_manager.go
index <HASH>..<HASH> 100644
--- a/consul/server_manager/server_manager.go
+++ b/consul/server_manager/server_manager.go
@@ -173,15 +173,11 @@ func (sc *serverConfig) removeServerByKey(targetKey *server_details.Key) {
// shuffleServers shuffles the server list in place
func (sc *serverConfig) shuffleServers() {
- newServers := make([]*server_details.ServerDetails, len(sc.servers))
- copy(newServers, sc.servers)
-
// Shuffle server list
for i := len(sc.servers) - 1; i > 0; i-- {
j := rand.Int31n(int32(i + 1))
- newServers[i], newServers[j] = newServers[j], newServers[i]
+ sc.servers[i], sc.servers[j] = sc.servers[j], sc.servers[i]
}
- sc.servers = newServers
}
// FindServer takes out an internal "read lock" and searches through the list | Shuffle in place
Don't create a copy and save the copy, not necessary any more. | hashicorp_consul | train | go |
c4dc71384665162317f8e561024b7464cb733cae | diff --git a/yapsydir/trunk/test/test_settings.py b/yapsydir/trunk/test/test_settings.py
index <HASH>..<HASH> 100644
--- a/yapsydir/trunk/test/test_settings.py
+++ b/yapsydir/trunk/test/test_settings.py
@@ -13,12 +13,12 @@ TEMP_CONFIG_FILE_NAME=os.path.join(
"tempconfig")
# set correct loading path for yapsy's files
-sys.path.append(
+sys.path.insert(0,
os.path.dirname(
os.path.dirname(
os.path.abspath(__file__))))
-sys.path.append(
+sys.path.insert(0,
os.path.dirname(
os.path.dirname(
os.path.dirname( | Make sure we actually import the version from trunk (and not the system
wide installed one ;) )
--HG--
extra : convert_revision : svn%3A3e6e<I>ca-<I>-<I>-a<I>-d<I>c<I>b3c<I>e%<I> | benhoff_pluginmanager | train | py |
2ffe564e3ead5809e4392ec93bfdb4083df7d28a | diff --git a/cachalot/utils.py b/cachalot/utils.py
index <HASH>..<HASH> 100644
--- a/cachalot/utils.py
+++ b/cachalot/utils.py
@@ -128,10 +128,9 @@ def _get_tables(query, db_alias):
tables = set(query.table_map)
tables.add(query.get_meta().db_table)
- children = query.where.children
- if DJANGO_LTE_1_8:
- children += query.having.children
- subquery_constraints = _find_subqueries(children)
+ subquery_constraints = _find_subqueries(
+ query.where.children + query.having.children if DJANGO_LTE_1_8
+ else query.where.children)
for subquery in subquery_constraints:
tables.update(_get_tables(subquery, db_alias))
if query.extra_select or hasattr(query, 'subquery') \ | Fixes Django <I> compatibility. | noripyt_django-cachalot | train | py |
309e6a0b1081f1b9fc506912d6ad78e196978b07 | diff --git a/sumo/plotting/dos_plotter.py b/sumo/plotting/dos_plotter.py
index <HASH>..<HASH> 100644
--- a/sumo/plotting/dos_plotter.py
+++ b/sumo/plotting/dos_plotter.py
@@ -287,6 +287,15 @@ class SDOSPlotter(object):
ax.plot(energies, densities, label=label,
color=line['colour'])
+ # draw line at Fermi level
+ if not zero_to_efermi:
+ xtick_color = matplotlib.rcParams['xtick.color']
+ ef = self._dos.efermi
+ ax.axvline(ef, color=xtick_color, linestyle='-.', alpha=0.3)
+ else:
+ xtick_color = matplotlib.rcParams['xtick.color']
+ ax.axvline(x=0, color=xtick_color, linestyle='-.', alpha=0.3)
+
ax.set_ylim(plot_data['ymin'], plot_data['ymax'])
ax.set_xlim(xmin, xmax) | draw Fermi level line to the dos diagram | SMTG-UCL_sumo | train | py |
9f6eb0ef65a57c1d69f9a0917e9587c222e590c7 | diff --git a/packer/build.go b/packer/build.go
index <HASH>..<HASH> 100644
--- a/packer/build.go
+++ b/packer/build.go
@@ -312,10 +312,10 @@ PostProcessorRunSeqLoop:
}
keep := defaultKeep
- // When user has not set keep_input_artifuact
+ // When user has not set keep_input_artifact
// corePP.keepInputArtifact is nil.
// In this case, use the keepDefault provided by the postprocessor.
- // When user _has_ set keep_input_atifact, go with that instead.
+ // When user _has_ set keep_input_artifact, go with that instead.
// Exception: for postprocessors that will fail/become
// useless if keep isn't true, heed forceOverride and keep the
// input artifact regardless of user preference. | fix: mispelled variables names in packer/build.go (#<I>) | hashicorp_packer | train | go |
093626731455ab24f31127205e2a504e8a0acb81 | diff --git a/lib/vagrant/util/subprocess.rb b/lib/vagrant/util/subprocess.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant/util/subprocess.rb
+++ b/lib/vagrant/util/subprocess.rb
@@ -26,6 +26,11 @@ module Vagrant
def initialize(*command)
@options = command.last.is_a?(Hash) ? command.pop : {}
@command = command
+ if Platform.windows?
+ locations = `where #{command[0]}`
+ new_command = "#{locations.split("\n")[0]}"
+ @command[0] = new_command if $?.success? and File.exists?(new_command)
+ end
@logger = Log4r::Logger.new("vagrant::util::subprocess")
end | Fixes [GH-<I>] on Windows 8x<I> and Ruby <I>p<I>
Replaces the command with absolute path version if it exists. | hashicorp_vagrant | train | rb |
b64169bd954843d4a7f532f6acd1ecae0acc2bfb | diff --git a/bugwarrior/db.py b/bugwarrior/db.py
index <HASH>..<HASH> 100644
--- a/bugwarrior/db.py
+++ b/bugwarrior/db.py
@@ -234,10 +234,8 @@ def synchronize(issue_generator, conf):
else:
issue_updates['existing'].append(task)
issue_updates['closed'].remove(existing_uuid)
- except MultipleMatches:
- log.name('bugwarrior').error(
- "Multiple matches found for issue: %s" % issue
- )
+ except MultipleMatches as e:
+ log.name('bugwarrior').trace(e)
except NotFound:
issue_updates['new'].append(dict(issue)) | Pass along details of the MultipleMatches exception. | ralphbean_bugwarrior | train | py |
87ea45350e8f5ee960765bc2bd43000f08dc563a | diff --git a/spec/escher.spec.js b/spec/escher.spec.js
index <HASH>..<HASH> 100644
--- a/spec/escher.spec.js
+++ b/spec/escher.spec.js
@@ -229,20 +229,6 @@ describe('Escher', function() {
.toThrow('The request date is not within the accepted time range');
});
- it('should validate request using auth header', function() {
- var escherConfig = configForHeaderValidationWith(nearToGoodDate);
- var headers = [
- ['Date', goodDate.toUTCString()],
- ['Host', 'host.foo.com'],
- ['Authorization', goodAuthHeader()]
- ];
- var requestOptions = requestOptionsWithHeaders(headers);
-
- expect(function() {
- new Escher(escherConfig).authenticate(requestOptions, keyDB);
- }).not.toThrow();
- });
-
it('should not depend on the order of headers', function() {
var headers = [
['Host', 'host.foo.com'], | remove test we don't need, as we already have a JSON test for it: authenticate-valid-get-vanilla-empty-query | emartech_escher-js | train | js |
4e4471f34dfd1541d9dcdcedc5992721ee699c14 | diff --git a/src/http/server/plugin/session.js b/src/http/server/plugin/session.js
index <HASH>..<HASH> 100644
--- a/src/http/server/plugin/session.js
+++ b/src/http/server/plugin/session.js
@@ -163,12 +163,12 @@ module.exports = class Session {
const decoded = await this.unsign(encoded);
if (!decoded) return this.unauthorized(context);
- const [ sid, expiration ] = decoded.split('.');
-
+ const [ identifier, expiration ] = decoded.split('.');
const now = Date.now();
+
if (expiration <= now) return this.unauthorized(context);
- const validate = await this.validate(context, sid);
+ const validate = await this.validate(context, identifier);
if (!validate || typeof validate !== 'object') {
throw new Error('Session - validate object required');
@@ -178,8 +178,6 @@ module.exports = class Session {
if (!validate.valid) return this.unauthorized(context);
context.set('credential', validate.credential);
-
}
-
} | renamed variable, removed line break | vokeio_servey | train | js |
792ff9cbb74d2b84b12b2d9592548c8b37724443 | diff --git a/lib/jrubyfx_tasks.rb b/lib/jrubyfx_tasks.rb
index <HASH>..<HASH> 100644
--- a/lib/jrubyfx_tasks.rb
+++ b/lib/jrubyfx_tasks.rb
@@ -19,7 +19,6 @@ limitations under the License.
require 'open-uri'
require 'rake'
require 'tmpdir'
-require "ant"
require "pathname"
module JRubyFX
@@ -108,6 +107,9 @@ module JRubyFX
if ENV_JAVA["java.runtime.version"].match(/^1\.[0-7]{1}\..*/)
raise "You must install JDK 8 to use the native-bundle packaging tools. You can still create an executable jar, though."
end
+
+ # the native bundling uses ant
+ require "ant"
output_jar = Pathname.new(output_jar)
dist_dir = output_jar.parent | Moving ant deps to native packaging | jruby_jrubyfx | train | rb |
8b3765d56d14344950ba9edbb65cda032a053d16 | diff --git a/test/fixtures/prepare.js b/test/fixtures/prepare.js
index <HASH>..<HASH> 100755
--- a/test/fixtures/prepare.js
+++ b/test/fixtures/prepare.js
@@ -5,7 +5,8 @@ var path = require('path')
var shell = require('shelljs')
var JAVA = 'java -Djava.awt.headless=true -jar'
-var PLANTUML_JAR = path.join(__dirname, '../../vendor/plantuml.jar')
+var INCLUDED_PLANTUML_JAR = path.join(__dirname, '../../vendor/plantuml.jar')
+var PLANTUML_JAR = process.env.PLANTUML_HOME || INCLUDED_PLANTUML_JAR
var TEST_PUML = path.join(__dirname, 'test.puml')
shell.exec(JAVA + ' ' + PLANTUML_JAR + ' ' + TEST_PUML) | Make prepareation of fixtures use PLANTUML_HOME | markushedvall_node-plantuml | train | js |
8cf177f32e32533bd677b7719fa1810bdfcdb0ac | diff --git a/cli/src/main/java/org/jboss/as/cli/impl/ExtensionsLoader.java b/cli/src/main/java/org/jboss/as/cli/impl/ExtensionsLoader.java
index <HASH>..<HASH> 100644
--- a/cli/src/main/java/org/jboss/as/cli/impl/ExtensionsLoader.java
+++ b/cli/src/main/java/org/jboss/as/cli/impl/ExtensionsLoader.java
@@ -138,7 +138,7 @@ class ExtensionsLoader {
if(!module.isDefined()) {
addError("Extension " + ext.getName() + " is missing module attribute");
} else {
- final ModuleIdentifier moduleId = ModuleIdentifier.create(module.asString());
+ final ModuleIdentifier moduleId = ModuleIdentifier.fromString(module.asString());
ModuleClassLoader cl;
try {
cl = moduleLoader.loadModule(moduleId).getClassLoader(); | [WFCORE-<I>] Use fromString instead of create when the text may include a slot | wildfly_wildfly-core | train | java |
17d5b76e86d1b215bd98b56c54af635f93fabb5f | diff --git a/Rest/ContentUserGateway.php b/Rest/ContentUserGateway.php
index <HASH>..<HASH> 100644
--- a/Rest/ContentUserGateway.php
+++ b/Rest/ContentUserGateway.php
@@ -104,6 +104,7 @@ class ContentUserGateway implements EventSubscriberInterface
foreach ($requestHeaders as $headerName => $headerValue) {
$headers[$this->fixHeaderCase($headerName)] = implode('; ', $headerValue);
}
+ $headers['Url'] = $request->getPathInfo();
return new Message($headers, $request->getContent());
} | Added 'Url' expected header to ContentUserGateway Message
Some REST Input Parsers expect an Url as a header, that gets
mapped to __url in the message by the ParsingDispatcher.
The Gateway wasn't setting this index. | ezsystems_PlatformUIBundle | train | php |
be7c4c76af8bacbe96d3114dfea467002d734b5a | diff --git a/lib/knapsack/presenter.rb b/lib/knapsack/presenter.rb
index <HASH>..<HASH> 100644
--- a/lib/knapsack/presenter.rb
+++ b/lib/knapsack/presenter.rb
@@ -54,8 +54,7 @@ module Knapsack
Test on this CI node ran for longer than the max allowed node time execution.
Please regenerate your knapsack report.
-If that didn't help then split your slow test file into smaller test files
-or bump time_offset_in_seconds setting.
+If that doesn't help, you can split your slowest test files into smaller files, or bump up the time_offset_in_seconds setting.
You can also use knapsack_pro gem to automatically divide slow test files between parallel CI nodes.
https://knapsackpro.com/faq/question/how-to-auto-split-test-files-by-test-cases-on-parallel-jobs-ci-nodes?utm_source=knapsack_gem&utm_medium=knapsack_gem_output&utm_campaign=knapsack_gem_time_offset_warning | If that doesn't help, you can split your slowest test files into smaller files, or bump up the time_offset_in_seconds setting. | ArturT_knapsack | train | rb |
0672d2ae867e8f7f67e878429358505daea4aef6 | diff --git a/emoticons/__init__.py b/emoticons/__init__.py
index <HASH>..<HASH> 100644
--- a/emoticons/__init__.py
+++ b/emoticons/__init__.py
@@ -1,5 +1,5 @@
"""django-emoticons"""
-__version__ = '1.0.1'
+__version__ = '1.1'
__license__ = 'BSD License'
__author__ = 'Fantomas42' | Bumping to version <I> | Fantomas42_django-emoticons | train | py |
4394aa52caadc458f7e1838c330737edf21dee3c | diff --git a/caas/kubernetes/provider/bootstrap.go b/caas/kubernetes/provider/bootstrap.go
index <HASH>..<HASH> 100644
--- a/caas/kubernetes/provider/bootstrap.go
+++ b/caas/kubernetes/provider/bootstrap.go
@@ -72,7 +72,7 @@ var controllerServiceSpecs = map[string]*controllerServiceSpec{
ServiceType: core.ServiceTypeClusterIP,
},
caas.K8sCloudOpenStack: {
- ServiceType: core.ServiceTypeLoadBalancer, // TODO(caas): test and verify this.
+ ServiceType: core.ServiceTypeLoadBalancer,
},
caas.K8sCloudMAAS: {
ServiceType: core.ServiceTypeLoadBalancer, // TODO(caas): test and verify this. | Remove TODO because bootstrap to 8ks tested on openstack already | juju_juju | train | go |
7baace12edf83de0a1acf84378815c5861f31699 | diff --git a/normalize-ice.js b/normalize-ice.js
index <HASH>..<HASH> 100644
--- a/normalize-ice.js
+++ b/normalize-ice.js
@@ -1,25 +1,20 @@
var detect = require('./detect');
-var match = require('./match');
var url = require('url');
-function useNewFormat() {
- return match('firefox') || match('chrome', '>=36');
-}
-
module.exports = function(server) {
var uri;
var auth;
// if we have a url parameter parse it
- if (server && server.url && useNewFormat()) {
+ if (server && server.url) {
uri = url.parse(server.url);
auth = (uri.auth || '').split(':');
return {
- url: uri.protocol + uri.host,
- urls: [ uri.protocol + uri.host ],
+ url: uri.protocol + uri.host + (uri.search || ''),
+ urls: [ uri.protocol + uri.host + (uri.search || '') ],
username: auth[0],
- credential: auth[1]
+ credential: server.credential || auth[1]
};
} | Preserve the query component of the ice server url | rtc-io_rtc-core | train | js |
63a113d56453befd615b3e519723ce8e81f79ea0 | diff --git a/src/Multipart/index.js b/src/Multipart/index.js
index <HASH>..<HASH> 100644
--- a/src/Multipart/index.js
+++ b/src/Multipart/index.js
@@ -122,7 +122,7 @@ class Multipart {
/**
* No one wants to read this file, so simply advance it
*/
- if (!handler || !handler.callback) {
+ if (!handler || !handler.callback || !part.filename) {
return Promise.resolve()
} | fix(multipart): do not process file when filename is empty | adonisjs_adonis-bodyparser | train | js |
4478b87f08d64f81a5ef06dbf7cf8599ac6e985e | diff --git a/quantecon/tests/test_mc_tools.py b/quantecon/tests/test_mc_tools.py
index <HASH>..<HASH> 100644
--- a/quantecon/tests/test_mc_tools.py
+++ b/quantecon/tests/test_mc_tools.py
@@ -106,6 +106,16 @@ def test_markovchain_pmatrices():
'period': 1,
'is_aperiodic': True,
},
+ # Reducible mc with a unique recurrent class,
+ # where n-1 is a transient state
+ {'P': np.array([[1, 0], [1, 0]]),
+ 'stationary_dists': np.array([[1, 0]]),
+ 'comm_classes': [np.array([0]), np.array([1])],
+ 'rec_classes': [np.array([0])],
+ 'is_irreducible': False,
+ 'period': 1,
+ 'is_aperiodic': True,
+ },
{'P': Q,
'stationary_dists': Q_stationary_dists,
'comm_classes': [np.array([0, 1]), np.array([2]), np.array([3, 4, 5])], | Add the same test case as in the Julia version | QuantEcon_QuantEcon.py | train | py |
d5a7409f327b22d3f9d1695412688dea35d5c78a | diff --git a/PgBulkInsert/pgbulkinsert-jpa/src/test/java/de/bytefish/pgbulkinsert/jpa/JpaMappingTests.java b/PgBulkInsert/pgbulkinsert-jpa/src/test/java/de/bytefish/pgbulkinsert/jpa/JpaMappingTests.java
index <HASH>..<HASH> 100644
--- a/PgBulkInsert/pgbulkinsert-jpa/src/test/java/de/bytefish/pgbulkinsert/jpa/JpaMappingTests.java
+++ b/PgBulkInsert/pgbulkinsert-jpa/src/test/java/de/bytefish/pgbulkinsert/jpa/JpaMappingTests.java
@@ -68,7 +68,7 @@ public class JpaMappingTests extends TransactionalTestBase {
}
@Test
- public void bulkInsertPersonDataTest() throws SQLException {
+ public void bulkImportSampleEntities() throws SQLException {
// Create a large list of People:
List<SampleEntity> personList = getSampleEntityList(100000);
// Create the JpaMapping: | Issue #<I> Rename Copy and Pasted Method | bytefish_PgBulkInsert | train | java |
093f3cb2a890c5859d0ebca47bd11f7c0654a860 | diff --git a/geomdl/linalg.py b/geomdl/linalg.py
index <HASH>..<HASH> 100644
--- a/geomdl/linalg.py
+++ b/geomdl/linalg.py
@@ -339,6 +339,19 @@ def point_mid(pt1, pt2):
return point_translate(pt1, half_dist_vector)
+@lru_cache(maxsize=os.environ['GEOMDL_CACHE_SIZE'] if "GEOMDL_CACHE_SIZE" in os.environ else 16)
+def matrix_identity(n):
+ """ Generates a NxN identity matrix.
+
+ :param n: size of the matrix
+ :type n: int
+ :return: identity matrix
+ :rtype: list
+ """
+ imat = [[1.0 if i == j else 0.0 for i in range(n)] for j in range(n)]
+ return imat
+
+
def matrix_transpose(m):
""" Transposes the input matrix. | Initial commit of matrix_identitiy | orbingol_NURBS-Python | train | py |
9a2368427d173d1144e45af405737f149069efea | diff --git a/packages/browser/test/integration/common/init.js b/packages/browser/test/integration/common/init.js
index <HASH>..<HASH> 100644
--- a/packages/browser/test/integration/common/init.js
+++ b/packages/browser/test/integration/common/init.js
@@ -43,7 +43,7 @@ function initSDK() {
// One of the tests use manually created breadcrumb without eventId and we want to let it through
if (
- breadcrumb.category.indexOf("sentry" === 0) &&
+ breadcrumb.category.indexOf("sentry") === 0 &&
breadcrumb.event_id &&
!window.allowSentryBreadcrumbs
) { | fix: Act on allowSentryBreadcrumbs when appropriate (#<I>)
The included test, to check for a breadcrumb category starting with "sentry", was improperly written. | getsentry_sentry-javascript | train | js |
04b8635598e58bbae1921f44e356c2a5e68378ba | diff --git a/angr/sim_type.py b/angr/sim_type.py
index <HASH>..<HASH> 100644
--- a/angr/sim_type.py
+++ b/angr/sim_type.py
@@ -35,6 +35,8 @@ class SimType:
return False
for attr in self._fields:
+ if attr == 'size' and self._arch is None and other._arch is None:
+ continue
if getattr(self, attr) != getattr(other, attr):
return False
@@ -96,7 +98,7 @@ class SimType:
class SimTypeBottom(SimType):
"""
- SimTypeBottom basically repesents a type error.
+ SimTypeBottom basically represents a type error.
"""
def __repr__(self): | SimType: Do not crash during comparison if _arch is not set. | angr_angr | train | py |
ec7f0ad2392d898833cf9db1024651f9e67e92d4 | diff --git a/src/master/master.js b/src/master/master.js
index <HASH>..<HASH> 100644
--- a/src/master/master.js
+++ b/src/master/master.js
@@ -83,6 +83,18 @@ export const isActionFromAuthenticPlayer = (
};
/**
+ * Remove player credentials from action payload
+ */
+const stripCredentialsFromAction = action => {
+ if ('payload' in action && 'credentials' in action.payload) {
+ // eslint-disable-next-line no-unused-vars
+ const { credentials, ...payload } = action.payload;
+ action = { ...action, payload };
+ }
+ return action;
+};
+
+/**
* Master
*
* Class that runs the game and maintains the authoritative state.
@@ -136,6 +148,8 @@ export class Master {
return { error: 'unauthorized action' };
}
+ action = stripCredentialsFromAction(action);
+
const key = gameID;
let state; | fix(master): Remove credentials from action payloads after use (#<I>)
Credentials are only used to check if an action is authorized in the
master and should not then be passed on to the reducer etc.
This contributes towards #<I>, because now credentials should not leak
beyond the `Master.onUpdate` method and won’t end up for example in the
game log. | nicolodavis_boardgame.io | train | js |
fd156bca265bf5359de06274e2207471893943ce | diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py
index <HASH>..<HASH> 100644
--- a/salt/modules/zypper.py
+++ b/salt/modules/zypper.py
@@ -1166,8 +1166,10 @@ def install(name=None,
# Handle packages which report multiple new versions
# (affects only kernel packages at this point)
- for pkg in new:
- new[pkg] = new[pkg].split(',')[-1]
+ for pkg_name in new:
+ pkg_data = new[pkg_name]
+ if isinstance(pkg_data, str):
+ new[pkg_name] = pkg_data.split(',')[-1]
ret = salt.utils.compare_dicts(old, new) | Bugfix: handle multi-version package upgrades | saltstack_salt | train | py |
a8312dfefc4f6093fa67761c0d86be781e6e1736 | diff --git a/patroni/__init__.py b/patroni/__init__.py
index <HASH>..<HASH> 100644
--- a/patroni/__init__.py
+++ b/patroni/__init__.py
@@ -30,7 +30,7 @@ class Patroni:
return Etcd(name, config['etcd'])
if 'zookeeper' in config:
return ZooKeeper(name, config['zookeeper'])
- raise Exception('Can not find sutable configuration of distributed configuration store')
+ raise Exception('Can not find suitable configuration of distributed configuration store')
def schedule_next_run(self):
self.next_run += self.nap_time | Fixed a typo in the error message. | zalando_patroni | train | py |
c6b850b1be314bbb0e3c3893d6ca8795ac71e581 | diff --git a/private_storage/fields.py b/private_storage/fields.py
index <HASH>..<HASH> 100644
--- a/private_storage/fields.py
+++ b/private_storage/fields.py
@@ -85,9 +85,6 @@ class PrivateFileField(models.FileField):
# Support list, so joining can be done in a storage-specific manner.
path_parts.extend([self.storage.get_valid_name(dir) for dir in extra_dirs])
- if not path_parts:
- path_parts = [self.get_directory_name()]
-
path_parts.append(self._get_clean_filename(filename))
if django.VERSION >= (1, 10):
filename = posixpath.join(*path_parts) | Fixed Django <I> compatibility in the new generate_filename() | edoburu_django-private-storage | train | py |
87a09e3a99217c5fbcd1a45ae056a9353aa25ccb | 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
@@ -2,7 +2,7 @@ require 'facets/hash/revalue'
module ConceptQL
class Database
- attr :db
+ attr :db, :opts
def initialize(db, opts={})
@db = db
@@ -15,6 +15,7 @@ module ConceptQL
@opts = opts.revalue { |v| v ? v.to_sym : v }
@opts[:data_model] ||= :omopv4
@opts[:database_type] ||= db_type
+ @opts[:impala_mem_limit] ||= ENV['IMPALA_MEM_LIMIT'] if ENV['IMPALA_MEM_LIMIT']
end
def query(statement, opts={})
diff --git a/lib/conceptql/scope.rb b/lib/conceptql/scope.rb
index <HASH>..<HASH> 100644
--- a/lib/conceptql/scope.rb
+++ b/lib/conceptql/scope.rb
@@ -171,7 +171,7 @@ module ConceptQL
end
def mem_limit
- opts[:impala_mem_limit] || ENV['IMPALA_MEM_LIMIT']
+ opts[:impala_mem_limit]
end
end
end | Database#opts exposes options set on database
Also set MEM_LIMIT from environment variable in Database | outcomesinsights_conceptql | train | rb,rb |
c3e380f9694f501b42f8560f5aeb6942a14d9c39 | diff --git a/actionview/lib/action_view/helpers/cache_helper.rb b/actionview/lib/action_view/helpers/cache_helper.rb
index <HASH>..<HASH> 100644
--- a/actionview/lib/action_view/helpers/cache_helper.rb
+++ b/actionview/lib/action_view/helpers/cache_helper.rb
@@ -241,8 +241,6 @@ module ActionView
end
def write_fragment_for(name, options)
- # VIEW TODO: Make #capture usable outside of ERB
- # This dance is needed because Builder can't use capture
pos = output_buffer.length
yield
output_safe = output_buffer.html_safe? | Remove unnecessary comments in cache_helper.rb [ci skip] | rails_rails | train | rb |
48e35a473cfd91c17def6f31c3c3db8dea1884df | diff --git a/tests/unit/components/sl-menu-test.js b/tests/unit/components/sl-menu-test.js
index <HASH>..<HASH> 100755
--- a/tests/unit/components/sl-menu-test.js
+++ b/tests/unit/components/sl-menu-test.js
@@ -588,12 +588,12 @@ test( 'Stream action "hideAll" triggers hideAll()', function( assert ) {
items: testItems,
stream: mockStream
});
- const doActionSpy = sinon.spy( component, 'doAction' );
+ const hideAllSpy = sinon.spy( component, 'hideAll' );
- mockStream.actions[ 'doAction' ]();
+ mockStream.actions[ 'hideAll' ]();
assert.ok(
- doActionSpy.called,
- 'doAction method was called'
+ hideAllSpy.called,
+ 'hideAll method was called'
);
}); | Closes softlayer/sl-ember-components#<I> | softlayer_sl-ember-components | train | js |
eba7a4d1fafa5693874e6d24030d2a31d11bc22e | diff --git a/src/trumbowyg.js b/src/trumbowyg.js
index <HASH>..<HASH> 100644
--- a/src/trumbowyg.js
+++ b/src/trumbowyg.js
@@ -205,7 +205,6 @@ jQuery.trumbowyg = {
'|', 'btnGrp-lists',
'|', 'horizontalRule',
'|', 'removeformat',
-
'fullscreen'
],
btnsAdd: [],
@@ -299,7 +298,7 @@ jQuery.trumbowyg = {
tag: 'right'
},
justifyFull: {
- tag: 'jusitfy'
+ tag: 'justify'
},
unorderedList: {
@@ -800,6 +799,8 @@ jQuery.trumbowyg = {
);
}
+ t.$ed.off('dblclick', 'img');
+
t.$box.remove();
t.$c.removeData('trumbowyg');
$('body').removeClass(prefix + 'body-fullscreen'); | fix: fix some typos on justify | Alex-D_Trumbowyg | train | js |
eb802c7b8f0c480597bd46ccb5612eaba6e00c88 | diff --git a/packages/Sidenav/src/index.js b/packages/Sidenav/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/Sidenav/src/index.js
+++ b/packages/Sidenav/src/index.js
@@ -45,6 +45,10 @@ const Overlay = styled.div`
export class Sidenav extends Component {
componentDidMount() {
+ if (this.props.opened && !this.props.permanent) {
+ document.body.style.overflow = 'hidden'
+ }
+
document.addEventListener('keydown', this.handleKeyDown)
} | :bug: Fixed small bug about scrolling | slupjs_slup | train | js |
88b550881495b4c6c5801fa82a638e49e12fc669 | diff --git a/lib/graphql/schema/member/build_type.rb b/lib/graphql/schema/member/build_type.rb
index <HASH>..<HASH> 100644
--- a/lib/graphql/schema/member/build_type.rb
+++ b/lib/graphql/schema/member/build_type.rb
@@ -109,8 +109,8 @@ module GraphQL
return string unless string.include?("_")
camelized = string.split('_').map(&:capitalize).join
camelized[0] = camelized[0].downcase
- if string.start_with?("__")
- camelized = "__#{camelized}"
+ if (match_data = string.match(/\A(_+)/))
+ camelized = "#{match_data[0]}#{camelized}"
end
camelized
end | fix: when camelizing a string that starts with `_`, keep them | rmosolgo_graphql-ruby | train | rb |
240986f37d770315b8fe8a0965efa099c396439a | diff --git a/lib/searchkick/query.rb b/lib/searchkick/query.rb
index <HASH>..<HASH> 100644
--- a/lib/searchkick/query.rb
+++ b/lib/searchkick/query.rb
@@ -132,21 +132,23 @@ module Searchkick
pp options
puts
- puts "Model Search Data"
- begin
- pp klass.first(3).map { |r| {index: searchkick_index.record_data(r).merge(data: searchkick_index.send(:search_data, r))}}
- rescue => e
- puts "#{e.class.name}: #{e.message}"
- end
- puts
+ if searchkick_index
+ puts "Model Search Data"
+ begin
+ pp klass.first(3).map { |r| {index: searchkick_index.record_data(r).merge(data: searchkick_index.send(:search_data, r))}}
+ rescue => e
+ puts "#{e.class.name}: #{e.message}"
+ end
+ puts
- puts "Elasticsearch Mapping"
- puts JSON.pretty_generate(searchkick_index.mapping)
- puts
+ puts "Elasticsearch Mapping"
+ puts JSON.pretty_generate(searchkick_index.mapping)
+ puts
- puts "Elasticsearch Settings"
- puts JSON.pretty_generate(searchkick_index.settings)
- puts
+ puts "Elasticsearch Settings"
+ puts JSON.pretty_generate(searchkick_index.settings)
+ puts
+ end
puts "Elasticsearch Query"
puts to_curl | Fixed debug option with multiple models - #<I> [skip ci] | ankane_searchkick | train | rb |
137f0e910ce7b190f706d3cb56453fbd65fc7220 | diff --git a/alot/db.py b/alot/db.py
index <HASH>..<HASH> 100644
--- a/alot/db.py
+++ b/alot/db.py
@@ -300,6 +300,17 @@ class Thread(object):
"""returns id of this thread"""
return self._id
+ def has_tag(self, tag):
+ """
+ Checks whether this thread is tagged with the given tag.
+
+ :param tag: tag to check
+ :type tag: string
+ :returns: True if this thread is tagged with the given tag, False otherwise.
+ :rtype: bool
+ """
+ return (tag in self._tags)
+
def get_tags(self):
"""
returns tagsstrings attached to this thread | Add helper to check mail thread for tag
This commit adds a method to Thread that allows to check whether the thread is
tagged with a given tag. | pazz_alot | train | py |
e18fbebbc02bc35a1ba3703396ed25f7789ea40e | diff --git a/client/blocks/google-my-business-stats-nudge/index.js b/client/blocks/google-my-business-stats-nudge/index.js
index <HASH>..<HASH> 100644
--- a/client/blocks/google-my-business-stats-nudge/index.js
+++ b/client/blocks/google-my-business-stats-nudge/index.js
@@ -37,7 +37,7 @@ class GoogleMyBusinessStatsNudge extends Component {
};
componentDidMount() {
- if ( ! this.props.isDismissed ) {
+ if ( this.isVisible() ) {
this.props.recordTracksEvent( 'calypso_google_my_business_stats_nudge_view' );
}
}
@@ -51,8 +51,12 @@ class GoogleMyBusinessStatsNudge extends Component {
this.props.recordTracksEvent( 'calypso_google_my_business_stats_nudge_start_now_button_click' );
};
+ isVisible() {
+ return ! this.props.isDismissed && this.props.visible;
+ }
+
render() {
- if ( this.props.isDismissed || ! this.props.visible ) {
+ if ( ! this.isVisible() ) {
return null;
} | Make sure the calypso_google_my_business_stats_nudge_view event is only triggered when the nudge is visible | Automattic_wp-calypso | train | js |
2a14bd7a88225c02d6c1587bbd061586639b0eb7 | diff --git a/spyderlib/config.py b/spyderlib/config.py
index <HASH>..<HASH> 100644
--- a/spyderlib/config.py
+++ b/spyderlib/config.py
@@ -136,7 +136,7 @@ DEFAULTS = [
('console',
{
'shortcut': "Ctrl+Shift+C",
- 'max_line_count': 300,
+ 'max_line_count': 10000,
'font/family': MONOSPACE,
'font/size': MEDIUM,
'font/italic': False, | Console: increased default maximum line count (buffer depth) up to <I>,<I> lines (instead of only <I> lines) | spyder-ide_spyder | train | py |
21748aacb34c2e926b8bf4d07f950c5ffe194cb9 | diff --git a/src/main/java/org/sql2o/ResultSetIterator.java b/src/main/java/org/sql2o/ResultSetIterator.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/sql2o/ResultSetIterator.java
+++ b/src/main/java/org/sql2o/ResultSetIterator.java
@@ -92,12 +92,12 @@ public class ResultSetIterator<T> implements Iterator<T> {
try {
if (rs.next()) {
- // if we have a converter for this type, we want executeScalar with straight conversion
- if (this.converter != null) {
+ // if we have a converter and are selecting 1 column, we want executeScalar
+ if (this.converter != null && meta.getColumnCount() == 1) {
return (T)converter.convert(ResultSetUtils.getRSVal(rs, 1));
}
- // otherwise we want executeList with object mapping
+ // otherwise we want executeAndFetch with object mapping
Pojo pojo = new Pojo(metadata, isCaseSensitive);
for(int colIdx = 1; colIdx <= meta.getColumnCount(); colIdx++) { | only executeScalar if selecting one column | aaberg_sql2o | train | java |
43f3b59f7c0c8e5d3b12305a57fcae915fbf3b9c | diff --git a/src/engine/sequencer.js b/src/engine/sequencer.js
index <HASH>..<HASH> 100644
--- a/src/engine/sequencer.js
+++ b/src/engine/sequencer.js
@@ -166,4 +166,14 @@ Sequencer.prototype.proceedThread = function (thread) {
}
};
+/**
+ * Retire a thread in the middle, without considering further blocks.
+ * @param {!Thread} thread Thread object to retire.
+ */
+Sequencer.prototype.retireThread = function (thread) {
+ thread.stack = [];
+ thread.stackFrame = [];
+ thread.setStatus(Thread.STATUS_DONE);
+};
+
module.exports = Sequencer; | Add `retireThread` to seqeuencer | LLK_scratch-vm | train | js |
a3753f97ddde354e5fe1276dad55007959d3da34 | diff --git a/Source/com/drew/imaging/tiff/TiffReader.java b/Source/com/drew/imaging/tiff/TiffReader.java
index <HASH>..<HASH> 100644
--- a/Source/com/drew/imaging/tiff/TiffReader.java
+++ b/Source/com/drew/imaging/tiff/TiffReader.java
@@ -135,6 +135,7 @@ public class TiffReader
//
// Handle each tag in this directory
//
+ int invalidTiffFormatCodeCount = 0;
for (int tagNumber = 0; tagNumber < dirTagCount; tagNumber++) {
final int tagOffset = calculateTagOffset(ifdOffset, tagNumber);
@@ -149,7 +150,12 @@ public class TiffReader
// This error suggests that we are processing at an incorrect index and will generate
// rubbish until we go out of bounds (which may be a while). Exit now.
handler.error("Invalid TIFF tag format code: " + formatCode);
- return;
+ // TODO specify threshold as a parameter, or provide some other external control over this behaviour
+ if (++invalidTiffFormatCodeCount > 5) {
+ handler.error("Stopping processing as too many errors seen in TIFF IFD");
+ return;
+ }
+ continue;
}
// 4 bytes dictate the number of components in this tag's data | Don't stop processing TIFF tags when encountering an invalid tag type.
In some cases it _may_ be possible to continue reading tags. The entries
are fixed width, so it's possible to jump directly to the next one,
having stored an error.
However if we have 'left' the IFD (or perhaps were not in one all along)
then we might happily produce hundreds of garbage tags. This implementation
tracks the number of such errors and stops after some threshold.
Relates to #<I>. | drewnoakes_metadata-extractor | train | java |
d45cdf41e2c04fd36102246a4c6e0c83ab815ff7 | diff --git a/upload/admin/controller/sale/order.php b/upload/admin/controller/sale/order.php
index <HASH>..<HASH> 100644
--- a/upload/admin/controller/sale/order.php
+++ b/upload/admin/controller/sale/order.php
@@ -1765,7 +1765,7 @@ class ControllerSaleOrder extends Controller {
$products = $this->model_sale_order->getOrderProducts($order_id);
foreach ($products as $product) {
- $option_weight = '';
+ $option_weight = 0;
$product_info = $this->model_catalog_product->getProduct($product['product_id']); | Update order.php
it should be numberric | opencart_opencart | train | php |
5067de597ca8af537e2e57d1eb53ef27df19c391 | diff --git a/class/StateMachine/FlupdoGenericListing.php b/class/StateMachine/FlupdoGenericListing.php
index <HASH>..<HASH> 100644
--- a/class/StateMachine/FlupdoGenericListing.php
+++ b/class/StateMachine/FlupdoGenericListing.php
@@ -252,7 +252,7 @@ class FlupdoGenericListing implements IListing
} else {
// Check if operator is the last character of filter name
$operator = substr($property, -1);
- if (!preg_match('/^([^><!%~:]+)([><!%~:]+)$/', $property, $m)) {
+ if (!preg_match('/^([^><!%~:?]+)([><!%~:?]+)$/', $property, $m)) {
continue;
}
list(, $property, $operator) = $m;
@@ -278,6 +278,9 @@ class FlupdoGenericListing implements IListing
case '!':
$this->query->where("$p != ?", $value);
break;
+ case '?':
+ $this->query->where($value ? "$p IS NOT NULL" : "$p IS NULL");
+ break;
case ':':
if (is_array($value)) {
if (isset($value['min']) && isset($value['max'])) { | Add `IS NULL` filter | smalldb_libSmalldb | train | php |
ed4dfbb5802d0a9a2ae34537e5bc44babcf0e985 | diff --git a/pyneuroml/analysis/NML2ChannelAnalysis.py b/pyneuroml/analysis/NML2ChannelAnalysis.py
index <HASH>..<HASH> 100644
--- a/pyneuroml/analysis/NML2ChannelAnalysis.py
+++ b/pyneuroml/analysis/NML2ChannelAnalysis.py
@@ -327,7 +327,7 @@ def process_channel_file(channel_file,a):
results = run_lems_file(new_lems_file,a.v)
if a.iv_curve:
- iv_data = compute_iv_curve(channel,(a.clamp_delay + a.clamp_duration),results)
+ iv_data = compute_iv_curve(channel,a,results)
else:
iv_data = None
@@ -466,11 +466,12 @@ def make_overview_dir():
return overview_dir
-def compute_iv_curve(channel,end_time_ms,results,grid=True):
+def compute_iv_curve(channel, a, results, grid=True):
# Based on work by Rayner Lucas here:
# https://github.com/openworm/
# BlueBrainProjectShowcase/blob/master/
- # Channelpedia/iv_analyse.py
+ # Channelpedia/iv_analyse.py
+ end_time_ms = (a.clamp_delay + a.clamp_duration)
dat_path = os.path.join(OUTPUT_DIR,
'%s.i_*.lems.dat' % channel.id)
file_names = glob.glob(dat_path) | Pass entire namespace to plotting function since other attributes besides the end time of the voltage pulse might be used in the future | NeuroML_pyNeuroML | train | py |
368b1e142a1ed0bad828833bc5dd0a5615117a88 | diff --git a/server.js b/server.js
index <HASH>..<HASH> 100644
--- a/server.js
+++ b/server.js
@@ -195,7 +195,7 @@ function parseSummonerFactory(res) {
var temp;
var $ = cheerio.load(game);
game = {};
- game.type = stripNewLines($('.subType').contents().eq(0).text()).slice(0,-2);
+ game.type = stripNewLines($('.subType').contents().eq(0).text());
game.date = stripNewLines($('._timeago').data('data-datetime'));
game.mmr = parseInt(stripNewLines($('.mmr').text()).substring(11));
@@ -238,6 +238,7 @@ function parseSummonerFactory(res) {
var item = {};
item.name = stripNewLines($('.item32').attr('title'));
+ if (item.name) item.name = item.name.substring(item.name.indexOf(">")+1, item.name.indexOf('</b>'));
item.image = $('.item32 .img').css('display');
item.slot = j+1;
items.push(item); | Fixed item name and game type returns in summoner | stephenpoole_op.gg-api | train | js |
f25cb682c50f14aa94f7cacc85a393c6e9576bc8 | diff --git a/lib/iron_mq/client.rb b/lib/iron_mq/client.rb
index <HASH>..<HASH> 100644
--- a/lib/iron_mq/client.rb
+++ b/lib/iron_mq/client.rb
@@ -1,9 +1,18 @@
+require 'yaml'
+
require 'iron_core'
module IronMQ
- # FIXME: read real version
+ @@version = nil
+
def self.version
- '2.0.0'
+ if @@version.nil?
+ v = YAML.load(File.read(File.dirname(__FILE__) + '/../../VERSION.yml'))
+ $stderr.puts v.inspect
+ @@version = [v[:major].to_s, v[:minor].to_s, v[:patch].to_s].join('.')
+ end
+
+ @@version
end
class Client < IronCore::Client | Porting to iron_core - version reading. | iron-io_iron_mq_ruby | train | rb |
0173913574cb62d46ce9abdc2838a16865be7b31 | diff --git a/easy_thumbnails/management/commands/thumbnail_cleanup.py b/easy_thumbnails/management/commands/thumbnail_cleanup.py
index <HASH>..<HASH> 100644
--- a/easy_thumbnails/management/commands/thumbnail_cleanup.py
+++ b/easy_thumbnails/management/commands/thumbnail_cleanup.py
@@ -107,15 +107,15 @@ def queryset_iterator(queryset, chunksize=1000):
The queryset iterator helps to keep the memory consumption down.
And also making it easier to process for weaker computers.
"""
-
- primary_key = 0
- last_pk = queryset.order_by('-pk')[0].pk
- queryset = queryset.order_by('pk')
- while primary_key < last_pk:
- for row in queryset.filter(pk__gt=primary_key)[:chunksize]:
- primary_key = row.pk
- yield row
- gc.collect()
+ if queryset.exists():
+ primary_key = 0
+ last_pk = queryset.order_by('-pk')[0].pk
+ queryset = queryset.order_by('pk')
+ while primary_key < last_pk:
+ for row in queryset.filter(pk__gt=primary_key)[:chunksize]:
+ primary_key = row.pk
+ yield row
+ gc.collect()
class Command(BaseCommand): | Fixing crash that occurred when calling the 'thumbnail_cleanup' command when no thumbnails exist in the database | SmileyChris_easy-thumbnails | train | py |
c27367036986e5a559fec1f13924aa14e927f3c6 | diff --git a/test/com/opera/core/systems/WindowTest.java b/test/com/opera/core/systems/WindowTest.java
index <HASH>..<HASH> 100644
--- a/test/com/opera/core/systems/WindowTest.java
+++ b/test/com/opera/core/systems/WindowTest.java
@@ -103,7 +103,7 @@ public class WindowTest extends OperaDriverTestCase {
}
@Test
- @Ignore(products = CORE, value = "window-manager service is not coupled to gogi tabs")
+ @Ignore(products = CORE, value = "gogi does not quit when closing last window")
public void testCloseShouldQuitBrowserIfLastWindow() {
driver.close();
assertFalse(driver.isRunning()); | Modified my statement about gogi tabs | operasoftware_operaprestodriver | train | java |
c3a08dab634d2d609b8274890f614ba9523bcd45 | diff --git a/views/js/controller/backoffice.js b/views/js/controller/backoffice.js
index <HASH>..<HASH> 100644
--- a/views/js/controller/backoffice.js
+++ b/views/js/controller/backoffice.js
@@ -34,11 +34,7 @@ define([
'use strict';
function checkAjaxResponse(ajaxResponse) {
- if (ajaxResponse && ajaxResponse !== null) {
- return true;
- } else {
- return false;
- }
+ return ajaxResponse && ajaxResponse !== null;
}
function checkAjaxResponseProperties(ajaxResponse) { | Update views/js/controller/backoffice.js | oat-sa_tao-core | train | js |
3257929cb95587e9ab47dbc8345af139f57a26aa | diff --git a/client/runtime.go b/client/runtime.go
index <HASH>..<HASH> 100644
--- a/client/runtime.go
+++ b/client/runtime.go
@@ -64,14 +64,16 @@ func New(host, basePath string, schemes []string) *Runtime {
// TODO: actually infer this stuff from the spec
rt.Consumers = map[string]runtime.Consumer{
- runtime.JSONMime: runtime.JSONConsumer(),
- runtime.XMLMime: runtime.XMLConsumer(),
- runtime.TextMime: runtime.TextConsumer(),
+ runtime.JSONMime: runtime.JSONConsumer(),
+ runtime.XMLMime: runtime.XMLConsumer(),
+ runtime.TextMime: runtime.TextConsumer(),
+ runtime.DefaultMime: runtime.ByteStreamConsumer(),
}
rt.Producers = map[string]runtime.Producer{
- runtime.JSONMime: runtime.JSONProducer(),
- runtime.XMLMime: runtime.XMLProducer(),
- runtime.TextMime: runtime.TextProducer(),
+ runtime.JSONMime: runtime.JSONProducer(),
+ runtime.XMLMime: runtime.XMLProducer(),
+ runtime.TextMime: runtime.TextProducer(),
+ runtime.DefaultMime: runtime.ByteStreamProducer(),
}
rt.Transport = http.DefaultTransport
rt.Jar = nil | add "application/octet-stream" to consumers and producers | go-openapi_runtime | train | go |
83027a1c7243c673cf0d5e23993e473d333bae37 | diff --git a/src/modes/direct_select.js b/src/modes/direct_select.js
index <HASH>..<HASH> 100644
--- a/src/modes/direct_select.js
+++ b/src/modes/direct_select.js
@@ -154,6 +154,7 @@ module.exports = function(ctx, opts) {
features: ctx.store.getSelected().map(f => f.toGeoJSON())
});
selectedCoordPaths = [];
+ fireActionable();
if (feature.isValid() === false) {
ctx.store.delete([featureId]);
ctx.events.changeMode(Constants.modes.SIMPLE_SELECT, null);
diff --git a/src/modes/simple_select.js b/src/modes/simple_select.js
index <HASH>..<HASH> 100644
--- a/src/modes/simple_select.js
+++ b/src/modes/simple_select.js
@@ -275,6 +275,7 @@ module.exports = function(ctx, options = {}) {
},
trash: function() {
ctx.store.delete(ctx.store.getSelectedIds());
+ fireActionable();
},
combineFeatures: function() {
var selectedFeatures = ctx.store.getSelected(); | Add actionable events to trash methods for simple and direct select
Fixes #<I> | mapbox_mapbox-gl-draw | train | js,js |
365f7a0b141299534fa263983515c5ddb216f507 | diff --git a/lib/lifx/client.rb b/lib/lifx/client.rb
index <HASH>..<HASH> 100644
--- a/lib/lifx/client.rb
+++ b/lib/lifx/client.rb
@@ -57,8 +57,10 @@ module LIFX
try_until -> { block.arity == 1 ? block.call(self) : block.call },
timeout: timeout,
timeout_exception: DiscoveryTimeout,
- condition_interval: condition_interval do
+ condition_interval: condition_interval,
+ action_interval: 1 do
discover
+ refresh
end
self
end | Discover now performs Light::Get at intervals. Closes #<I> | LIFX_lifx-gem | train | rb |
6037bef096c1a20751601f36091e3e571ce68dd1 | diff --git a/enabler/src/com/openxc/enabler/SettingsActivity.java b/enabler/src/com/openxc/enabler/SettingsActivity.java
index <HASH>..<HASH> 100644
--- a/enabler/src/com/openxc/enabler/SettingsActivity.java
+++ b/enabler/src/com/openxc/enabler/SettingsActivity.java
@@ -29,6 +29,13 @@ import android.widget.Toast;
import com.openxc.sinks.UploaderSink;
import com.openxc.sources.network.NetworkVehicleDataSource;
+/**
+ * Initialize and display all preferences for the OpenXC Enabler application.
+ *
+ * In order to select a trace file to use as a data source, the device must have
+ * a file manager application installed that responds to the GET_CONTENT intent,
+ * e.g. OI File Manager.
+ */
@TargetApi(12)
public class SettingsActivity extends PreferenceActivity {
private static String TAG = "SettingsActivity"; | Note that a file manager is required to select a trace data source. | openxc_openxc-android | train | java |
8bd5bd583715e8929e94b136c90633655e80a9fb | diff --git a/lxd/device/device_load.go b/lxd/device/device_load.go
index <HASH>..<HASH> 100644
--- a/lxd/device/device_load.go
+++ b/lxd/device/device_load.go
@@ -40,6 +40,8 @@ func load(inst instance.Instance, state *state.State, name string, conf deviceCo
dev = &nicMACVLAN{}
case "sriov":
dev = &nicSRIOV{}
+ case "ovn":
+ dev = &nicOVN{}
}
case "infiniband":
switch nicType { | lxd/device/device/load: Adds OVN nic type support | lxc_lxd | train | go |
6fe5847f071adb672821c1b31fba92653dabb304 | diff --git a/library/Helper/Navigation.php b/library/Helper/Navigation.php
index <HASH>..<HASH> 100644
--- a/library/Helper/Navigation.php
+++ b/library/Helper/Navigation.php
@@ -116,7 +116,7 @@ class Navigation
return '';
}
- return '<ul class="nav-mobile">' . $menu->render(false) . '</div>';
+ return '<ul class="nav-mobile">' . $menu->render(false) . '</ul>';
}
/** | Corrected closing tag for ul | helsingborg-stad_Municipio | train | php |
90864adae0b10413f68b36a8325452172290e8b6 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -57,6 +57,10 @@ setup(
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
],
# What does your project relate to? | update setup file to include <I>, <I>, and <I> | mitsei_dlkit | train | py |
f38b9bc1d6601cc4067c2cb1b5de377deb367ab1 | diff --git a/lib/cmds/blockchain/blockchain.js b/lib/cmds/blockchain/blockchain.js
index <HASH>..<HASH> 100644
--- a/lib/cmds/blockchain/blockchain.js
+++ b/lib/cmds/blockchain/blockchain.js
@@ -65,7 +65,7 @@ Blockchain.prototype.initChainAndGetAddress = function() {
// check if an account already exists, create one if not, return address
result = this.runCommand(this.client.listAccountsCommand());
- if (result.output === undefined || result.output === '' || result.output.indexOf("Fatal") >= 0) {
+ if (result.output === undefined || result.output.match(/{(\w+)}/) === null || result.output.indexOf("Fatal") >= 0) {
console.log("no accounts found".green);
if (this.config.genesisBlock) {
console.log("initializing genesis block".green); | fix for no accounts on init with warning messages | embark-framework_embark | train | js |
0b9781020dec7de0fc18a170f2ac0ac5c7db8be6 | diff --git a/salt/modules/quota.py b/salt/modules/quota.py
index <HASH>..<HASH> 100644
--- a/salt/modules/quota.py
+++ b/salt/modules/quota.py
@@ -64,9 +64,7 @@ def _parse_quota(mount, opts):
continue
comps = line.split()
if mode == 'header':
- if 'Report for' in line:
- pass
- elif 'Block grace time' in line:
+ if 'Block grace time' in line:
blockg, inodeg = line.split(';')
blockgc = blockg.split(': ')
inodegc = inodeg.split(': ') | Remove pylint resulting in no-op overhead | saltstack_salt | train | py |
70ce6ff31e89173f1117df93ac3a152058c4e820 | diff --git a/test/test_core_ext.rb b/test/test_core_ext.rb
index <HASH>..<HASH> 100644
--- a/test/test_core_ext.rb
+++ b/test/test_core_ext.rb
@@ -64,7 +64,7 @@ describe DR::CoreExt do
it "Can compose functions" do
somme=->(x,y) {x+y}
- carre=->(x) {x^2}
+ carre=->(x) {x*x}
carre.compose(somme).(2,3).must_equal(25)
end | Still more tests for core_ext.rb | DamienRobert_drain | train | rb |
f155507dd5a08c2d47d57b1e28cc9bf6bd15ba92 | diff --git a/rake/lib/rake/filelist.rb b/rake/lib/rake/filelist.rb
index <HASH>..<HASH> 100644
--- a/rake/lib/rake/filelist.rb
+++ b/rake/lib/rake/filelist.rb
@@ -10,7 +10,9 @@ module Rake
filenames.each do |fn|
case fn
when Array
- fn.each { |f| self << f }
+ fn.each { |f| self.add(f) }
+ when %r{[*?]}
+ add_matching(fn)
else
self << fn
end
@@ -22,6 +24,7 @@ module Rake
Dir[pattern].each { |fn| self << fn } if pattern
end
end
+ private :add_matching
def to_s
self.join(' ') | Add now handles patterns as a special case.
Add_matching is now private.
git-svn-id: svn+ssh://rubyforge.org/var/svn/rake/trunk@<I> 5af<I>f1-ac1a-<I>-<I>d6-<I>a<I>c<I>ef | ruby_rake | train | rb |
5e1957d9609968cb89b67c04a14f909ee45ccde8 | diff --git a/src/Commands/CrudControllerCommand.php b/src/Commands/CrudControllerCommand.php
index <HASH>..<HASH> 100644
--- a/src/Commands/CrudControllerCommand.php
+++ b/src/Commands/CrudControllerCommand.php
@@ -123,15 +123,15 @@ class CrudControllerCommand extends GeneratorCommand
}
$snippet = <<<EOD
-if (\$request->hasFile('{{fieldName}}')) {
- \$uploadPath = public_path('/uploads/');
-
- \$extension = \$request->file('{{fieldName}}')->getClientOriginalExtension();
- \$fileName = rand(11111, 99999) . '.' . \$extension;
-
- \$request->file('{{fieldName}}')->move(\$uploadPath, \$fileName);
- \$requestData['{{fieldName}}'] = \$fileName;
-}
+ if (\$request->hasFile('{{fieldName}}')) {
+ \$uploadPath = public_path('/uploads/');
+
+ \$extension = \$request->file('{{fieldName}}')->getClientOriginalExtension();
+ \$fileName = rand(11111, 99999) . '.' . \$extension;
+
+ \$request->file('{{fieldName}}')->move(\$uploadPath, \$fileName);
+ \$requestData['{{fieldName}}'] = \$fileName;
+ }
EOD;
$fieldsArray = explode(';', $fields); | Adding indentation to fileSnippet | appzcoder_crud-generator | train | php |
c8880101b3253434c1db3eec40e3be17e2fd23c9 | diff --git a/lib/authem.rb b/lib/authem.rb
index <HASH>..<HASH> 100644
--- a/lib/authem.rb
+++ b/lib/authem.rb
@@ -1,8 +1,8 @@
+require "authem/railtie"
require "active_support/all"
module Authem
autoload :Controller, "authem/controller"
- autoload :Railtie, "authem/railtie"
autoload :Role, "authem/role"
autoload :Session, "authem/session"
autoload :Support, "authem/support" | Move authem/railtie back to explicit require | paulelliott_authem | train | rb |
fc8f87e32f3c35a985bfbba48c0c1f11536a14b7 | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -115,7 +115,7 @@ function configureTasks (grunt) {
//"sauce_firefox",
"sauce_safari",
"sauce_ie_11",
- "sauce_ie_8"
+ //"sauce_ie_8"
],
captureTimeout: 120000
} | removing ie 8 for now | bob-gray_solv | train | js |
53de3fce83b96e3263ecc72c3ff586fe4bf78ded | diff --git a/lib/epub/parser/content_document.rb b/lib/epub/parser/content_document.rb
index <HASH>..<HASH> 100644
--- a/lib/epub/parser/content_document.rb
+++ b/lib/epub/parser/content_document.rb
@@ -25,8 +25,12 @@ module EPUB
# @return [EPUB::ContentDocument::Navigation::Nav] nav Nav object
def parse_navigation(element)
nav = EPUB::ContentDocument::Navigation::Nav.new
- nav.heading = find_heading element
- nav.type = element['type']
+ nav.heading = find_heading(element)
+
+ ns_prefix, _ = element.namespaces.detect {|prefix, uri| uri == EPUB::NAMESPACES['epub']}
+ prefix = ns_prefix.split(':')[1]
+ attr_name = [prefix, 'type'].compact.join(':')
+ nav.type = element[attr_name]
nav
end | Fix for the change of Nokogiri <I> | KitaitiMakoto_epub-parser | train | rb |
5943cde450286f9366656cb4863682cebc322c53 | diff --git a/urwid_datatable/datatable.py b/urwid_datatable/datatable.py
index <HASH>..<HASH> 100644
--- a/urwid_datatable/datatable.py
+++ b/urwid_datatable/datatable.py
@@ -840,7 +840,7 @@ class DataTableRow(urwid.WidgetWrap):
# focus_map = self.focus_map)
self.pile = urwid.Pile([
- (1, urwid.Filler(self.row))
+ ('weight', 1, self.row)
])
self.attr = urwid.AttrMap(self.pile,
attr_map = self.attr_map,
@@ -1578,7 +1578,7 @@ def main():
loop = None
screen = urwid.raw_display.Screen()
- screen.set_terminal_properties(256)
+ screen.set_terminal_properties(16)
foreground_map = {
"table_row": [ "light gray", "light gray" ], | Make rows weighted widgets rather than fixed height. | tonycpsu_panwid | train | py |
02948e1749fff50302fe0ab478495a609d672825 | diff --git a/lib/lhc/version.rb b/lib/lhc/version.rb
index <HASH>..<HASH> 100644
--- a/lib/lhc/version.rb
+++ b/lib/lhc/version.rb
@@ -1,3 +1,3 @@
module LHC
- VERSION ||= '8.0.0'
+ VERSION ||= '8.1.0'
end | increase version (#<I>)
version increase for zipking | local-ch_lhc | train | rb |
214122d73887586fb99401cc9720108d9eba3c65 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@ version = '0.7.dev0'
install_requires = []
test_requires = [
- 'pytest', 'pytest-asyncio', 'coverage<3.99', 'coveralls'
+ 'pytest', 'coverage<3.99', 'coveralls'
]
if sys.version_info[:2] < (3, 0):
@@ -23,6 +23,9 @@ elif sys.version_info[:2] < (3, 3):
test_requires.extend(['mock'])
elif sys.version_info[:2] < (3, 4):
install_requires.append('asyncio')
+ test_requires.append('pytest-asyncio')
+else:
+ test_requires.append('pytest-asyncio')
def read(*rnames): | Add unit tests for FastAGI #<I> - second attempt | gawel_panoramisk | train | py |
77004f6c621f62d4fa9f93f2edc05f4c5c447ba8 | diff --git a/ansigenome/utils.py b/ansigenome/utils.py
index <HASH>..<HASH> 100644
--- a/ansigenome/utils.py
+++ b/ansigenome/utils.py
@@ -212,9 +212,9 @@ def yaml_load(path, input="", err_quit=False):
"""
try:
if len(input) > 0:
- return yaml.load(input)
+ return yaml.safe_load(input)
elif len(path) > 0:
- return yaml.load(file_to_string(path))
+ return yaml.safe_load(file_to_string(path))
except Exception as err:
file = os.path.basename(path)
ui.error("", | Fix code execution vulnerability by switching to yaml.safe_load
Ref: <URL> | nickjj_ansigenome | train | py |
8184049c4a4e75a1a88047f4cf7af22efdf6676a | diff --git a/src/imagelightbox.js b/src/imagelightbox.js
index <HASH>..<HASH> 100644
--- a/src/imagelightbox.js
+++ b/src/imagelightbox.js
@@ -651,8 +651,8 @@
}
},
- _preloadVideos = function () {
- targets.each(function() {
+ _preloadVideos = function (elements) {
+ elements.each(function() {
var videoOptions = $(this).data('ilb2Video');
if (videoOptions) {
var id = $(this).data('ilb2Id');
@@ -763,10 +763,11 @@
_openHistory();
- _preloadVideos();
+ _preloadVideos(targets);
this.addToImageLightbox = function (elements) {
_addTargets(elements);
+ _preloadVideos(elements);
};
this.openHistory = function() { | Added support for video preloading when adding elements to a lightbox | rejas_imagelightbox | train | js |
f4a20fde81e7115d91fd290fc62b42e3d8a816da | diff --git a/pythainlp/util/thai_time.py b/pythainlp/util/thai_time.py
index <HASH>..<HASH> 100644
--- a/pythainlp/util/thai_time.py
+++ b/pythainlp/util/thai_time.py
@@ -82,15 +82,15 @@ def thai_time(time: str, types: str = "24-hour") -> str:
:Example:
- thai_time("8:17").get_time()
+ thai_time("8:17")
# output:
# แปดนาฬิกาสิบเจ็ดนาที
- thai_time("8:17",types="6-hour").get_time()
+ thai_time("8:17", types="6-hour")
# output:
# สองโมงเช้าสิบเจ็ดนาที
- thai_time("8:17",types="modified-6-hour").get_time()
+ thai_time("8:17", types="modified-6-hour")
# output:
# แปดโมงสิบเจ็ดนาที
""" | Update thai_time.py | PyThaiNLP_pythainlp | train | py |
e2ee95d9b2f1bda70b1573bd9daa3c936d18dd49 | diff --git a/tests/commands/migrate_config_test.py b/tests/commands/migrate_config_test.py
index <HASH>..<HASH> 100644
--- a/tests/commands/migrate_config_test.py
+++ b/tests/commands/migrate_config_test.py
@@ -148,6 +148,7 @@ def test_migrate_config_sha_to_rev(tmpdir):
' hooks: []\n'
)
+
@pytest.mark.parametrize('contents', ('', '\n'))
def test_empty_configuration_file_user_error(tmpdir, contents):
cfg = tmpdir.join(C.CONFIG_FILE) | Update migrate_config_test.py
Added second blank line between test_migrate_config_sha_to_rev and test_empty_configuration_file_user_error | pre-commit_pre-commit | train | py |
787712d99e48374adc354a73c12b45e59afc596a | diff --git a/lib/pickle/adapter.rb b/lib/pickle/adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/pickle/adapter.rb
+++ b/lib/pickle/adapter.rb
@@ -106,15 +106,29 @@ module Pickle
# factory-girl adapter
class FactoryGirl < Adapter
def self.factories
- (::Factory.factories.values rescue []).map {|factory| new(factory)}
+ if defined? ::FactoryGirl
+ factories = []
+ ::FactoryGirl.factories.each {|v| factories << new(v)}
+ factories
+ else
+ (::Factory.factories.values rescue []).map {|factory| new(factory)}
+ end
end
def initialize(factory)
- @klass, @name = factory.build_class, factory.factory_name.to_s
+ if defined? ::FactoryGirl
+ @klass, @name = factory.build_class, factory.name.to_s
+ else
+ @klass, @name = factory.build_class, factory.factory_name.to_s
+ end
end
def create(attrs = {})
- Factory(@name, attrs)
+ if defined? ::FactoryGirl
+ ::FactoryGirl.create(@name, attrs)
+ else
+ Factory(@name, attrs)
+ end
end
end | FactoryGirl <I> API is quite different. Adjust adapter to use correct behavior depending on whether new FactoryGirl API is present. | ianwhite_pickle | train | rb |
cac0838da0d85964176dc4ad5de1639a47142f6f | diff --git a/model/RdsResultStorage.php b/model/RdsResultStorage.php
index <HASH>..<HASH> 100644
--- a/model/RdsResultStorage.php
+++ b/model/RdsResultStorage.php
@@ -163,7 +163,7 @@ class RdsResultStorage extends ConfigurableService
->from(self::RESULTS_TABLENAME)
->andWhere(self::RESULTS_TABLE_ID .' = :id')
->setParameter('id', $deliveryResultIdentifier);
- if ($qb->execute()->fetchColumn() == 0) {
+ if ((int) $qb->execute()->fetchColumn() === 0) {
$this->getPersistence()->insert(
self::RESULTS_TABLENAME,
[ | Strict comparison from fetchColumn. | oat-sa_extension-tao-outcomerds | train | php |
d1419b73cecb4cdc6c0ccb1335cf1974679edb61 | diff --git a/lib/podio/models/form.rb b/lib/podio/models/form.rb
index <HASH>..<HASH> 100644
--- a/lib/podio/models/form.rb
+++ b/lib/podio/models/form.rb
@@ -18,6 +18,12 @@ class Podio::Form < ActivePodio::Base
response.body['form_id']
end
+ def find_all_for_app(app_id)
+ list Podio.connection.get { |req|
+ req.url("/form/app/#{app_id}/")
+ }.body
+ end
+
def find(form_id)
member Podio.connection.get("/form/#{form_id}").body
end | Added find method to access all forms of a given app. | podio_podio-rb | train | rb |
2d0dab58df1d2d9c2551e6b34bb662f1de0bd7da | diff --git a/lib/geocoder/lookups/base.rb b/lib/geocoder/lookups/base.rb
index <HASH>..<HASH> 100644
--- a/lib/geocoder/lookups/base.rb
+++ b/lib/geocoder/lookups/base.rb
@@ -190,7 +190,7 @@ module Geocoder
else
JSON.parse(data)
end
- rescue => err
+ rescue
raise_error(ResponseParseError.new(data)) or Geocoder.log(:warn, "Geocoding API's response was not valid JSON: #{data}")
end | "warning: assigned but unused variable - err" | alexreisner_geocoder | train | rb |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.