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
30f256e2c1dd66fd1f1af5730bfb7c21fb6d1b8a
diff --git a/src/feat/agents/host/host_agent.py b/src/feat/agents/host/host_agent.py index <HASH>..<HASH> 100644 --- a/src/feat/agents/host/host_agent.py +++ b/src/feat/agents/host/host_agent.py @@ -57,6 +57,16 @@ class HostedPartner(agent.BasePartner): def on_restarted(self, agent): agent.call_next(agent.check_if_agency_hosts, self.recipient) + if self.static_name: + agent.resolve_alert(self.static_name, "Restarted") + + def on_died(self, agent): + if self.static_name: + agent.raise_alert(self.static_name, "Agent died") + + def on_buried(self, agent): + if self.static_name: + agent.raise_alert(self.static_name, "Agent was buried!!") @feat.register_restorator
Host agent raises and resolves alerts when static agents are dying/getting resterted.
f3at_feat
train
py
df8b5978044d3c83c97240d0505f2006bdad6051
diff --git a/eiostream.js b/eiostream.js index <HASH>..<HASH> 100644 --- a/eiostream.js +++ b/eiostream.js @@ -14,8 +14,7 @@ function EngineStream(socket) { // forwarding write stream.write = socket.write.bind(socket) - // circular of request so it can be parsed for cookies, etc. - stream.req = socket.transport.request + stream.transport = socket.transport return stream }
Update eiostream.js
Raynos_engine.io-stream
train
js
1d62936b016d46dc7b791c09794ca42a24343afb
diff --git a/lib/fastlane/actions/ensure_xcode_version.rb b/lib/fastlane/actions/ensure_xcode_version.rb index <HASH>..<HASH> 100644 --- a/lib/fastlane/actions/ensure_xcode_version.rb +++ b/lib/fastlane/actions/ensure_xcode_version.rb @@ -12,7 +12,7 @@ module Fastlane versions_match = selected_version == "Xcode #{required_version}" - raise "Selected Xcode version doesn't match your requirement.\nExpected: Xcode #{required_version}\nActual: #{selected_version}" unless versions_match + raise "Selected Xcode version doesn't match your requirement.\nExpected: Xcode #{required_version}\nActual: #{selected_version}\nTo correct this, use xcode_select." unless versions_match end #####################################################
Mention xcode_select as a way to resolve the mismatch of Xcode versions
fastlane_fastlane
train
rb
72abcd4e9156fe38f562d68182b501065948b10f
diff --git a/app_namespace/tests/tests.py b/app_namespace/tests/tests.py index <HASH>..<HASH> 100644 --- a/app_namespace/tests/tests.py +++ b/app_namespace/tests/tests.py @@ -132,3 +132,27 @@ class LoaderTestCase(TestCase): self.assertTrue(mark in template_namespace) self.assertTrue(mark_title in template_namespace) + + def test_extend_with_super(self): + """ + Here we simulate the existence of a template + named admin/base_site.html on the filesystem + overriding the title markup of the template + with a {{ super }}. + """ + context = Context({}) + mark_ok = '<title> | Django site admin - APP NAMESPACE</title>' + mark_ko = '<title> - APP NAMESPACE</title>' + + template_directory = Template( + '{% extends "admin/base.html" %}' + '{% block title %}{{ block.super }} - APP NAMESPACE{% endblock %}' + ).render(context) + + template_namespace = Template( + '{% extends "admin:admin/base_site.html" %}' + '{% block title %}{{ block.super }} - APP NAMESPACE{% endblock %}' + ).render(context) + + self.assertTrue(mark_ok in template_namespace) + self.assertTrue(mark_ko in template_directory)
Add a test for being sure about the {{ block.super }} behavior
Fantomas42_django-app-namespace-template-loader
train
py
133f1048e88d6147a0c78b2e38af60a007a1fe0a
diff --git a/msk/repo_action.py b/msk/repo_action.py index <HASH>..<HASH> 100644 --- a/msk/repo_action.py +++ b/msk/repo_action.py @@ -81,7 +81,7 @@ class SkillData(GlobalContext): default_branch = self.repo_git.symbolic_ref('refs/remotes/origin/HEAD') self.repo_git.reset(default_branch, hard=True) - upgrade_branch = 'upgrade/' + self.name + upgrade_branch = 'upgrade-' + self.name self.repo.checkout_branch(upgrade_branch) if not self.repo.git.diff(skill_module) and self.repo.git.ls_files(skill_module): @@ -106,7 +106,7 @@ class SkillData(GlobalContext): default_branch = self.repo_git.symbolic_ref('refs/remotes/origin/HEAD') self.repo_git.reset(default_branch, hard=True) - branch_name = 'add/' + self.name + branch_name = 'add-' + self.name self.repo.checkout_branch(branch_name) self.repo.git.add(self.name) self.repo.git.commit(message='Add ' + self.name)
Change skill branch naming convention to not use slashes If a branch called either `add` or `upgrade` exists, it will cause errors
MycroftAI_mycroft-skills-kit
train
py
b3db9dfd249996b4d6d89c401e5f85a052fd594c
diff --git a/mapclassify/classifiers.py b/mapclassify/classifiers.py index <HASH>..<HASH> 100644 --- a/mapclassify/classifiers.py +++ b/mapclassify/classifiers.py @@ -2355,7 +2355,6 @@ class UserDefined(MapClassifier): legend=legend, legend_kwds=legend_kwds, classification_kwds={"bins": self.bins}, # for UserDefined - fmt=fmt, ) if not axis_on: ax.axis("off")
BUG: fmt belongs to legend_kwds, no longer stand-alone
pysal_mapclassify
train
py
99b06f8bce894796b27045c4aea626c62290d78d
diff --git a/msgpong_test.go b/msgpong_test.go index <HASH>..<HASH> 100644 --- a/msgpong_test.go +++ b/msgpong_test.go @@ -99,7 +99,7 @@ func TestPongBIP0031(t *testing.T) { readmsg := btcwire.NewMsgPong(0) err = readmsg.BtcDecode(&buf, pver) if err == nil { - t.Errorf("decode of MsgPong succeeded when it shouldn't have", + t.Errorf("decode of MsgPong succeeded when it shouldn't have %v", spew.Sdump(buf)) }
Add format specifier in pong test error output. The error message did not have a format specifier even though it was passing an argument to show. Found by go vet.
btcsuite_btcd
train
go
da6bdd317295863645bd8cdbd0d4a0f8f3d3c06b
diff --git a/lib/sprockets/sass_cache_store.rb b/lib/sprockets/sass_cache_store.rb index <HASH>..<HASH> 100644 --- a/lib/sprockets/sass_cache_store.rb +++ b/lib/sprockets/sass_cache_store.rb @@ -9,11 +9,11 @@ module Sprockets end def _store(key, version, sha, contents) - environment.cache_set(key, {:version => version, :sha => sha, :contents => contents}) + environment.cache_set("sass/#{key}", {:version => version, :sha => sha, :contents => contents}) end def _retrieve(key, version, sha) - if obj = environment.cache_get(key) + if obj = environment.cache_get("sass/#{key}") return unless obj[:version] == version return unless obj[:sha] == sha obj[:obj]
Prepend sass/ to key
rails_sprockets
train
rb
db684ad0dd7f568ec263ebbb081b3959713fff51
diff --git a/tools/run_tests/xds_k8s_test_driver/tests/affinity_test.py b/tools/run_tests/xds_k8s_test_driver/tests/affinity_test.py index <HASH>..<HASH> 100644 --- a/tools/run_tests/xds_k8s_test_driver/tests/affinity_test.py +++ b/tools/run_tests/xds_k8s_test_driver/tests/affinity_test.py @@ -45,10 +45,14 @@ class AffinityTest(xds_k8s_testcase.RegularXdsKubernetesTestCase): @staticmethod def is_supported(config: skips.TestConfig) -> bool: - if config.client_lang in (_Lang.CPP | _Lang.GO | _Lang.JAVA | - _Lang.PYTHON): - # Versions prior to v1.40.x don't support Affinity. + if config.client_lang in _Lang.CPP | _Lang.JAVA: return not config.version_lt('v1.40.x') + elif config.client_lang == _Lang.GO: + return not config.version_lt('v1.41.x') + elif config.client_lang == _Lang.PYTHON: + # TODO(https://github.com/grpc/grpc/issues/27430): supported after + # the issue is fixed. + return False return True def test_affinity(self) -> None: # pylint: disable=too-many-statements
[xDS interop] Fix the affinity test support range (#<I>)
grpc_grpc
train
py
aa5002df2f70f07a8016028eab3eab5b561c987e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ with open('README') as f: setup( name='Flask-Table', packages=['flask_table'], - version='0.3.0', + version='0.3.1', author='Andrew Plummer', author_email='plummer574@gmail.com', url='https://github.com/plumdog/flask_table',
Bump to version <I>
plumdog_flask_table
train
py
7c05a16bb84c6093422fa344f7dfad4a77a66441
diff --git a/publishable/config/voyager_dummy.php b/publishable/config/voyager_dummy.php index <HASH>..<HASH> 100644 --- a/publishable/config/voyager_dummy.php +++ b/publishable/config/voyager_dummy.php @@ -42,7 +42,7 @@ return [ */ 'models' => [ - //'namespace' => 'App\\', + //'namespace' => 'App\\Models\\', ], /*
Update voyager_dummy.php (#<I>) default model route while creating bread
the-control-group_voyager
train
php
5678abdc4eb4c220dc0e613a640328654b7dcc1a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -21,6 +21,7 @@ files = [ 'pyontutils/ilx_utils.py', 'pyontutils/namespaces.py', 'pyontutils/necromancy.py', + 'pyontutils/neurons/__init__.py', 'pyontutils/neurons/core.py', 'pyontutils/neurons/lang.py', 'pyontutils/obo_io.py',
setup.py added missing __init__.py for neurons
tgbugs_pyontutils
train
py
665c6f6112d13def7d48b04f20e03d05c940d124
diff --git a/src/test/java/com/stripe/StripeTest.java b/src/test/java/com/stripe/StripeTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/stripe/StripeTest.java +++ b/src/test/java/com/stripe/StripeTest.java @@ -1286,16 +1286,6 @@ public class StripeTest { assertEquals(transfers.size(), 1); } - @Test(expected=InvalidRequestException.class) - public void testTransferReversalCreate() throws StripeException { - Transfer tr = Transfer.create(getTransferParams()); - Map<String, Object> params = new HashMap<String, Object>(); - TransferReversalCollection reversals = tr.getReversals(); - reversals.create(params); - // post-condition: we expect an InvalidRequestException here (caught by JUnit), - // because in test mode, transfers are automatically sent - } - @Test public void testRecipientCreate() throws StripeException { Recipient recipient = Recipient.create(defaultRecipientParams);
Delete TransferReversalCreate test The test asserted stripe functionality, but the tests should assert that the bindings interact with Stripe correctly.
stripe_stripe-java
train
java
ddf4673ce8b89dc7a207c015ec9a3c9ec047290b
diff --git a/tests/inttests/lib/KushkiIntTest.php b/tests/inttests/lib/KushkiIntTest.php index <HASH>..<HASH> 100644 --- a/tests/inttests/lib/KushkiIntTest.php +++ b/tests/inttests/lib/KushkiIntTest.php @@ -144,7 +144,7 @@ class KushkiIntTest extends \PHPUnit_Framework_TestCase { $token = $tokenTransaction->getToken(); sleep(CommonUtils::THREAD_SLEEP); $chargeTransaction = $this->newSecretKushki->charge($token, $amount); - $ticket = $chargeTransaction->getTicketNumberApi(); + $ticket = $chargeTransaction->getTicketNumber(); sleep(CommonUtils::THREAD_SLEEP); $voidTransaction = $this->secretKushki->voidCharge($ticket, $amount);
[KV-<I>] Refactor
Kushki_kushki-php
train
php
2aa163828a743a377f9aac8a079e3ca987f6a775
diff --git a/yfinance/utils.py b/yfinance/utils.py index <HASH>..<HASH> 100644 --- a/yfinance/utils.py +++ b/yfinance/utils.py @@ -44,7 +44,8 @@ def empty_df(index=[]): def get_json(url, proxy=None, session=None): session = session or _requests - html = session.get(url=url, proxies=proxy).text + headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'} + html = session.get(url=url, proxies=proxy, headers=headers).text if "QuoteSummaryStore" not in html: html = session.get(url=url, proxies=proxy).text
Add headers to session Add headers to session
ranaroussi_fix-yahoo-finance
train
py
4a36e9159a99778674d71679198abf6e90173126
diff --git a/plenum/test/waits.py b/plenum/test/waits.py index <HASH>..<HASH> 100644 --- a/plenum/test/waits.py +++ b/plenum/test/waits.py @@ -76,7 +76,7 @@ def expectedPoolInterconnectionTime(nodeCount): # TODO check actual state # multiply by 2 because we need to re-create connections which can be done on a second re-try only # (we may send pings on some of the re-tries) - return min(0.8 * config.TestRunningTimeLimitSec, + return max(0.8 * config.TestRunningTimeLimitSec, interconnectionCount * nodeConnectionTimeout + 2 * config.RETRY_TIMEOUT_RESTRICTED + 2)
[INDY-<I>] Radical increase checkConnected timeout
hyperledger_indy-plenum
train
py
f0a0222328287a00d4ecf1a3d655e118f3ddc0e2
diff --git a/src/models/Core.js b/src/models/Core.js index <HASH>..<HASH> 100644 --- a/src/models/Core.js +++ b/src/models/Core.js @@ -141,6 +141,10 @@ export class Parameter extends Immutable.Record({ } _inferType(type) { + if (!type) { + return null + } + if (type.match(/double/) || type.match(/float/)) { return 'number' }
fixed a minor bug on type infer
luckymarmot_API-Flow
train
js
cb2970396378a51e16f9deff78cf1699219dfb15
diff --git a/src/editor/index.js b/src/editor/index.js index <HASH>..<HASH> 100644 --- a/src/editor/index.js +++ b/src/editor/index.js @@ -312,6 +312,22 @@ module.exports = config => { }, /** + * Get stylable entity from the selected component. + * If you select the component without classes the entity is the Component + * itself and all changes will go inside its 'style' property. Otherwise, + * if the selected component has one or more classes, the function will + * return the corresponding CSS Rule + * @return {Model} + */ + getSelectedToStyle() { + let selected = em.getSelected(); + + if (selected) { + return this.StyleManager.getModelToStyle(selected); + } + }, + + /** * Set device to the editor. If the device exists it will * change the canvas to the proper width * @return {this}
Add getSelectedToStyle to the editor API
artf_grapesjs
train
js
e0eb6d4b18b62aeb757b24edb6ed966a8f72a889
diff --git a/src/main/java/com/klarna/hiverunner/builder/HiveShellBase.java b/src/main/java/com/klarna/hiverunner/builder/HiveShellBase.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/klarna/hiverunner/builder/HiveShellBase.java +++ b/src/main/java/com/klarna/hiverunner/builder/HiveShellBase.java @@ -337,8 +337,8 @@ class HiveShellBase implements HiveShell { hiveServerContainer.getBaseDir().getRoot().getAbsolutePath()); Preconditions.checkArgument(isTargetFileWithinTestDir, - "All resource target files should be created in a subdirectory to the test case basedir : %s", - resource); + "All resource target files should be created in a subdirectory to the test case basedir %s : %s", + hiveServerContainer.getBaseDir().getRoot().getAbsolutePath(), resource.getTargetFile()); } protected final void assertFileExists(Path file) {
Better error message when resource file is outside of test dir
klarna_HiveRunner
train
java
4d26589f6d37d9fe6e7a65eedaf19e4fbf9bcded
diff --git a/src/k8s/statefulSet.js b/src/k8s/statefulSet.js index <HASH>..<HASH> 100644 --- a/src/k8s/statefulSet.js +++ b/src/k8s/statefulSet.js @@ -66,7 +66,7 @@ function checkStatefulSet (client, namespace, name, outcome, resolve, wait) { }, ms) } -function createStatefulSet (client, statefulSet) { +function createStatefulSet (client, deletes, statefulSet) { const namespace = statefulSet.metadata.namespace || 'default' const name = statefulSet.metadata.name let create = (resolve, reject) =>
fix: added deletes param to createStatefulSet
npm-wharf_hikaru
train
js
4d16c443de74793bf413f08d427dce6ac3ec9461
diff --git a/isort/finders.py b/isort/finders.py index <HASH>..<HASH> 100644 --- a/isort/finders.py +++ b/isort/finders.py @@ -265,7 +265,7 @@ class ReqsBaseFinder(BaseFinder): Flask-RESTFul -> flask_restful """ if self.mapping: - name = self.mapping.get(name, name) + name = self.mapping.get(name.replace("-","_"), name) return name.lower().replace("-", "_") def find(self, module_name: str) -> Optional[str]:
Bug fix for #<I> Bug fix for improper handling of packages with - (dash) in name
timothycrosley_isort
train
py
9d13ac00849d88faa2ac5c64d23c90cc40055a76
diff --git a/core/server/master/src/main/java/alluxio/master/file/FileSystemMasterClientRestServiceHandler.java b/core/server/master/src/main/java/alluxio/master/file/FileSystemMasterClientRestServiceHandler.java index <HASH>..<HASH> 100644 --- a/core/server/master/src/main/java/alluxio/master/file/FileSystemMasterClientRestServiceHandler.java +++ b/core/server/master/src/main/java/alluxio/master/file/FileSystemMasterClientRestServiceHandler.java @@ -415,13 +415,10 @@ public final class FileSystemMasterClientRestServiceHandler { @Path(SCHEDULE_ASYNC_PERSIST) @ReturnType("java.lang.Void") public Response scheduleAsyncPersist(@QueryParam("path") final String path) { - return RestUtils.call(new RestUtils.RestCallable<Void>() { - @Override - public Void call() throws Exception { - Preconditions.checkNotNull(path, "required 'path' parameter is missing"); - mFileSystemMaster.scheduleAsyncPersistence(new AlluxioURI(path)); - return null; - } + return RestUtils.call((RestUtils.RestCallable<Void>) () -> { + Preconditions.checkNotNull(path, "required 'path' parameter is missing"); + mFileSystemMaster.scheduleAsyncPersistence(new AlluxioURI(path)); + return null; }); }
replace anonymous type with lambda (#<I>)
Alluxio_alluxio
train
java
7308cdc89dd3eec2949a976ff1f32c07051e5733
diff --git a/basic_auth.go b/basic_auth.go index <HASH>..<HASH> 100644 --- a/basic_auth.go +++ b/basic_auth.go @@ -53,9 +53,9 @@ func (b *basicAuth) authenticate(r *http.Request) bool { return false } - // In simple mode, prevent authentication with empty credentials if User or - // Password is not set. - if b.opts.AuthFunc == nil && (b.opts.User == "" || b.opts.Password == "") { + // In simple mode, prevent authentication with empty credentials if User is + // not set. Allow empty passwords to support non-password use-cases. + if b.opts.AuthFunc == nil && b.opts.User == "" { return false }
[bugfix] Allow empty passwords again. Reverts part of <I>e9a2b<I>.
goji_httpauth
train
go
0af8c2574ece0228d545cdf0ea865169d0b13757
diff --git a/syntax/tokens.go b/syntax/tokens.go index <HASH>..<HASH> 100644 --- a/syntax/tokens.go +++ b/syntax/tokens.go @@ -318,8 +318,8 @@ const ( TsGtr AndTest = BinTestOperator(andAnd) OrTest = BinTestOperator(orOr) - // TODO(mvdan): == is a pattern match, not a comparison; use a - // more appropriate name like TsMatch in 2.0 + // TODO(mvdan): == and != are pattern matches; use more + // appropriate names like TsMatch and TsNoMatch in 2.0 TsEqual = BinTestOperator(equal) TsNequal = BinTestOperator(nequal) TsBefore = BinTestOperator(rdrIn)
syntax: TsEqual TODO for <I> also affects TsNequal
mvdan_sh
train
go
de269f969bfd64b78f7c2ec67655db65962f0a63
diff --git a/src/Psalm/Checker/Statements/Expression/AssignmentChecker.php b/src/Psalm/Checker/Statements/Expression/AssignmentChecker.php index <HASH>..<HASH> 100644 --- a/src/Psalm/Checker/Statements/Expression/AssignmentChecker.php +++ b/src/Psalm/Checker/Statements/Expression/AssignmentChecker.php @@ -404,6 +404,10 @@ class AssignmentChecker )) { return false; } + + $context->vars_in_scope[$var_id] = Type::getMixed(); + + return Type::getMixed(); } return $assign_value_type;
Void return types shouldn’t magically become null ones
vimeo_psalm
train
php
8475487c0651678ca550168386c796f33bf43f07
diff --git a/interfaces/HtmlRequestInterface.php b/interfaces/HtmlRequestInterface.php index <HASH>..<HASH> 100644 --- a/interfaces/HtmlRequestInterface.php +++ b/interfaces/HtmlRequestInterface.php @@ -93,7 +93,7 @@ interface HtmlRequestInterface extends LogAwareObjectInterface{ * Redirect to generated internal URL; * @return null */ - public function goToPage($controller, $action = null, $params = array()); + public function goToPage($controller, $action = null, $params = array(), $module = null); /** * Reload current page diff --git a/web/Controller.php b/web/Controller.php index <HASH>..<HASH> 100644 --- a/web/Controller.php +++ b/web/Controller.php @@ -218,10 +218,11 @@ class Controller extends LogAwareObject { * @param string $controller Controller name where it must be redirected * @param string $action Action name where it must be redirected. Index is the default selected action * @param array $params Optional a list of params can be added also + * @param string $module Optional a different module * @return bool */ - public function goToPage($controller, $action = 'index', $params = []) { - return $this->request->goToPage($controller, $action, $params); + public function goToPage($controller, $action = 'index', $params = [], $module = null) { + return $this->request->goToPage($controller, $action, $params, $module); } /**
Fix request intereface and controller to allow module select on page redirect.
mpf-soft_mpf
train
php,php
872f79947f58bbff422d1eac102696fa84ab8116
diff --git a/lib/nrser/core_ext/hash.rb b/lib/nrser/core_ext/hash.rb index <HASH>..<HASH> 100644 --- a/lib/nrser/core_ext/hash.rb +++ b/lib/nrser/core_ext/hash.rb @@ -19,6 +19,9 @@ class Hash def str_keys! *args, &block; stringify_keys! *args, &block; end def str_keys *args, &block; stringify_keys *args, &block; end + def to_options! *args, &block; symbolize_keys! *args, &block; end + def to_options *args, &block; symbolize_keys *args, &block; end + # See {NRSER.bury!} def bury! key_path,
Fix {Hash#to_options} method alias (ActiveSupport's fault this time)
nrser_nrser.rb
train
rb
6188e0c231c4c7435f5a54e017b9ac95b53791fc
diff --git a/EventListener/DisallowedExtensionValidationListener.php b/EventListener/DisallowedExtensionValidationListener.php index <HASH>..<HASH> 100644 --- a/EventListener/DisallowedExtensionValidationListener.php +++ b/EventListener/DisallowedExtensionValidationListener.php @@ -18,4 +18,4 @@ class DisallowedExtensionValidationListener throw new ValidationException('error.blacklist'); } } -} \ No newline at end of file +}
Added newline in ValidationListener.
1up-lab_OneupUploaderBundle
train
php
5eebf02e5f05b92a9fc52decff3e0ebea19f0011
diff --git a/server/server_test.go b/server/server_test.go index <HASH>..<HASH> 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -104,7 +104,8 @@ func RunServerWithConfig(configFile string) (srv *Server, opts *Options) { func TestVersionMatchesTag(t *testing.T) { tag := os.Getenv("TRAVIS_TAG") - if tag == "" { + // Travis started to return '' when no tag is set. Support both now. + if tag == "" || tag == "''" { t.SkipNow() } // We expect a tag of the form vX.Y.Z. If that's not the case,
Fixed TestVersionMatchesTag test When no tag was set, os.Getenv("TRAVIS_TAG") would return empty string. Travis now set TRAVIS_TAG to `''`. So check for both.
nats-io_gnatsd
train
go
10c23ff69de2dd1a5b074ac0dc841aa3b01c06a6
diff --git a/src/main/java/com/lazerycode/jmeter/testrunner/TestManager.java b/src/main/java/com/lazerycode/jmeter/testrunner/TestManager.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/lazerycode/jmeter/testrunner/TestManager.java +++ b/src/main/java/com/lazerycode/jmeter/testrunner/TestManager.java @@ -94,6 +94,7 @@ public class TestManager { for (String file : tests) { if(generateReports) { File outputReportFolder = new File(reportDirectory+File.separator+ FilenameUtils.removeExtension(file)); + LOGGER.info("Will generate HTML report in {}", outputReportFolder.getAbsolutePath()); if(outputReportFolder.mkdirs()) { thisTestArgs.setReportsDirectory(outputReportFolder.getAbsolutePath()); } else {
Remove date_time suffix from path when generating html report Add logging This closes #<I>
jmeter-maven-plugin_jmeter-maven-plugin
train
java
a60729c901d53dc3c1688706c4c22904d720cbb6
diff --git a/lib/gcli/ui/inputter.js b/lib/gcli/ui/inputter.js index <HASH>..<HASH> 100644 --- a/lib/gcli/ui/inputter.js +++ b/lib/gcli/ui/inputter.js @@ -355,6 +355,9 @@ Inputter.prototype.onKeyUp = function(ev) { this._caretChange = Caret.TO_ARG_END; var inputState = this.getInputState(); this._processCaretChange(inputState); + if (this._choice == null) { + this._choice = 0; + } this.requisition.complete(inputState.cursor, this._choice); } this.lastTabDownAt = 0;
Bug <I> (updown): Prevent completion error this._choice == null is valid, but not when we want to complete the default choice.
joewalker_gcli
train
js
010b17db40e1dd35e81d2126028e922ee16c7d01
diff --git a/src/Pool.php b/src/Pool.php index <HASH>..<HASH> 100644 --- a/src/Pool.php +++ b/src/Pool.php @@ -52,9 +52,9 @@ class Pool implements FutureInterface private $isRealized = false; /** - * The option values for 'before', 'after', and 'error' can be a callable, - * an associative array containing event data, or an array of event data - * arrays. Event data arrays contain the following keys: + * The option values for 'before', 'complete', 'error' and 'end' can be a + * callable, an associative array containing event data, or an array of + * event data arrays. Event data arrays contain the following keys: * * - fn: callable to invoke that receives the event * - priority: Optional event priority (defaults to 0) @@ -65,8 +65,9 @@ class Pool implements FutureInterface * @param array $options Associative array of options * - pool_size: (int) Maximum number of requests to send concurrently * - before: (callable|array) Receives a BeforeEvent - * - after: (callable|array) Receives a CompleteEvent + * - complete: (callable|array) Receives a CompleteEvent * - error: (callable|array) Receives a ErrorEvent + * - end: (callable|array) Receives an EndEvent */ public function __construct( ClientInterface $client,
Corrects event docs for Pool constructor. * Changes "after" to "complete" * Adds missing "end" event
guzzle_guzzle
train
php
84b7af363f7f1b297322ef7b47055f11d9b353c3
diff --git a/regions/shapes/__init__.py b/regions/shapes/__init__.py index <HASH>..<HASH> 100644 --- a/regions/shapes/__init__.py +++ b/regions/shapes/__init__.py @@ -3,5 +3,6 @@ """ from .circle import * from .ellipse import * +from .point import * from .polygon import * from .rectangle import *
Add missing include for point.py
astropy_regions
train
py
9207a5005d7248e04f40e3e63dbef40a7faa66ab
diff --git a/src/share/classes/com/sun/source/util/AbstractTypeProcessor.java b/src/share/classes/com/sun/source/util/AbstractTypeProcessor.java index <HASH>..<HASH> 100644 --- a/src/share/classes/com/sun/source/util/AbstractTypeProcessor.java +++ b/src/share/classes/com/sun/source/util/AbstractTypeProcessor.java @@ -208,6 +208,9 @@ public abstract class AbstractTypeProcessor extends AbstractProcessor { TreePath p = Trees.instance(env).getPath(elem); typeProcess(elem, p); + + // report errors accumulated during type checking + log.reportDeferredDiagnostics(); if (!hasInvokedTypeProcessingOver && elements.isEmpty() && log.nerrors == 0) { typeProcessingOver();
Undo the previous commit. The reportDeferredDiagnostics is actually necessary to report the additional errors found by the type checkers.
wmdietl_jsr308-langtools
train
java
c4c1f4b05badc7f6006ce39306b14c0a532a05e4
diff --git a/src/Parser.php b/src/Parser.php index <HASH>..<HASH> 100644 --- a/src/Parser.php +++ b/src/Parser.php @@ -60,6 +60,10 @@ class Parser { { case 'curl': $this->c->get($url); + if(isset($this->c->error_code) && !empty($this->c->error_code)) + { + return false; + } $responce=$this->c->response; break; case 'file':
get returns fail when response code diferent from <I>
iWedmak_laravel-5-extra-curl
train
php
fae4c7ca7d9a60c873ca0e608918df345cecce2f
diff --git a/python/sparknlp/embeddings.py b/python/sparknlp/embeddings.py index <HASH>..<HASH> 100644 --- a/python/sparknlp/embeddings.py +++ b/python/sparknlp/embeddings.py @@ -7,6 +7,12 @@ import threading import time import sparknlp.pretrained as _pretrained + +# DONT REMOVE THIS IMPORT +from sparknlp.annotator import WordEmbeddingsModel +#### + + class Embeddings: def __init__(self, embeddings): self.jembeddings = embeddings
[skip travis] import word embedding models as embeddings for jvm compatibility
JohnSnowLabs_spark-nlp
train
py
6e5e934131c1b61b00e8acfd73c81af5f8e64b3d
diff --git a/scapy.py b/scapy.py index <HASH>..<HASH> 100755 --- a/scapy.py +++ b/scapy.py @@ -3611,10 +3611,15 @@ class Packet(Gen): return f[attr] return self.payload.getfieldval(attr) + def getfield_and_val(self, attr): + for f in self.fields, self.overloaded_fields, self.default_fields: + if f.has_key(attr): + return self.fieldtype.get(attr),f[attr] + return self.payload.getfield_and_val(attr) + def __getattr__(self, attr): if self.initialized: - v = self.getfieldval(attr) - fld = self.fieldtype.get(attr,None) + fld,v = self.getfield_and_val(attr) if fld is not None: return fld.i2h(self, v) return v @@ -4395,6 +4400,8 @@ class NoPayload(Packet,object): return "",[] def getfieldval(self, attr): raise AttributeError(attr) + def getfield_and_val(self, attr): + raise AttributeError(attr) def __getattr__(self, attr): if attr in self.__dict__: return self.__dict__[attr]
Fixed bug in Packet.__getattr__() The search for the field value was done recursively while the field object search was only local. This prevented i2h() to be called when the asked field was not in the first layer.
secdev_scapy
train
py
3dede7b4f3fd3ab603402693e2b559cc93e70a4d
diff --git a/packages/material-ui/src/Table/Table.js b/packages/material-ui/src/Table/Table.js index <HASH>..<HASH> 100644 --- a/packages/material-ui/src/Table/Table.js +++ b/packages/material-ui/src/Table/Table.js @@ -10,7 +10,6 @@ export const styles = theme => ({ width: '100%', borderCollapse: 'collapse', borderSpacing: 0, - overflow: 'hidden', }, });
[Table] Remove overflow (#<I>) The overflow hidden style is preventing the sticky position to work. I can't think of a good motivation for having this style by default. Let's remove it.
mui-org_material-ui
train
js
9b242005fa7fa99c7d0432921de93a83d22c9e34
diff --git a/src/array/concatMap.js b/src/array/concatMap.js index <HASH>..<HASH> 100644 --- a/src/array/concatMap.js +++ b/src/array/concatMap.js @@ -11,6 +11,7 @@ import curry from '../function/curry' * @return {Array} A newly created array of the concated values * @example * concatMap(x => [x, x], [1, 2, 3]) // => [1, 1, 2, 2, 3, 3] + * concatMap(x => x, [[1, 2], [3, 4], [5, 6]]) // => [1, 2, 3, 4, 5, 6] * * // It's also curried * diff --git a/tests/array/concatMap.js b/tests/array/concatMap.js index <HASH>..<HASH> 100644 --- a/tests/array/concatMap.js +++ b/tests/array/concatMap.js @@ -8,6 +8,13 @@ test('concatMap -- Apples function to values and merges arrays', t => { t.end() }) +test('concatMap -- Shrinks the array', t => { + const results = concatMap(x => x, [[1, 2], [3, 4], [5, 6]]) + + t.same(results, [1, 2, 3, 4, 5, 6]) + t.end() +}) + test('concatMap -- Is properly curried', t => { const con = concatMap(x => [x, x])
Upgraded concatMaps tests/docs
dhershman1_kyanite
train
js,js
771015b5c7bb6d45855540da625105be31128619
diff --git a/spec/ruby-lint/file_scanner_spec.rb b/spec/ruby-lint/file_scanner_spec.rb index <HASH>..<HASH> 100644 --- a/spec/ruby-lint/file_scanner_spec.rb +++ b/spec/ruby-lint/file_scanner_spec.rb @@ -23,6 +23,12 @@ describe RubyLint::FileScanner do scanner.directories.include?(app).should == false end + example 'glob Ruby source files in a single directory' do + scanner = RubyLint::FileScanner.new([@lib_dir]) + + scanner.glob_ruby_files.empty?.should == false + end + example 'glob Ruby source files in multiple directories' do scanner = RubyLint::FileScanner.new([@lib_dir, @rails_dir])
Test for globbing files in a single directory.
YorickPeterse_ruby-lint
train
rb
ff0e02480c151a0781a42398db12ac682070323f
diff --git a/src/PatternLab/InstallerUtil.php b/src/PatternLab/InstallerUtil.php index <HASH>..<HASH> 100644 --- a/src/PatternLab/InstallerUtil.php +++ b/src/PatternLab/InstallerUtil.php @@ -503,9 +503,13 @@ class InstallerUtil { // see if the package has a listener self::scanForListener($pathBase); - // see if the package is a pattern engine + // address other specific needs based on type if ($type == "patternlab-patternengine") { self::scanForPatternEngineRule($pathBase); + } else if ($type == "patternlab-starterkit") { + Config::updateConfigOption("starterKit",$name); + } else if ($type == "patternlab-styleguidekit") { + Config::updateConfigOption("styleguideKit",$name); } }
handle setting needed config options based upon package type
pattern-lab_patternlab-php-core
train
php
33dd8d52288907335c438a19322470f0022f56c6
diff --git a/cohorts/plot.py b/cohorts/plot.py index <HASH>..<HASH> 100644 --- a/cohorts/plot.py +++ b/cohorts/plot.py @@ -18,7 +18,7 @@ from scipy.stats import mannwhitneyu, fisher_exact import seaborn as sb import pandas as pd -def stripboxplot(x, y, data): +def stripboxplot(x, y, data, **kwargs): """ Overlay a stripplot on top of a boxplot. """ @@ -31,10 +31,11 @@ def stripboxplot(x, y, data): sb.stripplot( x=x, y=y, - jitter=0.05, - color=".3", data=data, - ax=ax + ax=ax, + jitter=kwargs.pop("jitter", 0.05), + color=kwargs.pop("color", "0.3"), + **kwargs ) def fishers_exact_plot(data, condition1, condition2):
Allow for custom jitter/etc. in stripboxplot
hammerlab_cohorts
train
py
871316c9677a0ad2b85e965e8f9987025a69bf49
diff --git a/pyghmi/util/webclient.py b/pyghmi/util/webclient.py index <HASH>..<HASH> 100644 --- a/pyghmi/util/webclient.py +++ b/pyghmi/util/webclient.py @@ -162,7 +162,7 @@ class SecureHTTPConnection(httplib.HTTPConnection, object): def grab_json_response(self, url, data=None, referer=None, headers=None): self.lastjsonerror = None - body, status = self.grab_json_response_with_status(self, url, data, referer, headers) + body, status = self.grab_json_response_with_status(url, data, referer, headers) if status == 200: return body self.lastjsonerror = body
Correct mistake with refactoring JSON calls The arguments were incorrect. Change-Id: If<I>c6d<I>b<I>bf<I>b<I>a<I>ad<I>de<I>
openstack_pyghmi
train
py
58fda24be8ff472d7eb78b910b3587594ed46064
diff --git a/ChildNode/replaceWith.js b/ChildNode/replaceWith.js index <HASH>..<HASH> 100644 --- a/ChildNode/replaceWith.js +++ b/ChildNode/replaceWith.js @@ -15,7 +15,7 @@ function ReplaceWith(Ele) { } parent.insertBefore(this.previousSibling, arguments[i]); } - if (firstIsNode) parent.replaceChild(this, Ele); + if (firstIsNode) parent.replaceChild(Ele, this); } if (!Element.prototype.replaceWith) Element.prototype.replaceWith = ReplaceWith;
Fixes issue with replaceWith, it was replacing in reverse
subhaze_fbow
train
js
5b3e971c5ce3b3f9f546c2546bc93ef4c6d651b5
diff --git a/src/structures/Message.js b/src/structures/Message.js index <HASH>..<HASH> 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -159,7 +159,7 @@ class Message { const clone = Util.cloneObject(this); this._edits.unshift(clone); - this.editedTimestamp = data.edited_timestamp; + this.editedTimestamp = new Date(data.edited_timestamp).getTime(); if ('content' in data) this.content = data.content; if ('pinned' in data) this.pinned = data.pinned; if ('tts' in data) this.tts = data.tts;
Message.editedTimestamp should be a number (#<I>)
discordjs_discord.js
train
js
b30fcc26a2a31514b6dedebb82c8fb8765aba7bc
diff --git a/devices/titan_products.js b/devices/titan_products.js index <HASH>..<HASH> 100644 --- a/devices/titan_products.js +++ b/devices/titan_products.js @@ -10,11 +10,12 @@ module.exports = [ vendor: 'Titan Products', description: 'Room CO2, humidity & temperature sensor', fromZigbee: [fz.battery, fz.humidity, fz.temperature, fz.co2], - exposes: [e.battery(), e.humidity(), e.temperature(), e.co2()], + exposes: [e.battery_voltage(), e.humidity(), e.temperature(), e.co2()], toZigbee: [], configure: async (device, coordinatorEndpoint, logger) => { const endpoint = device.getEndpoint(1); await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'msTemperatureMeasurement', 'msCO2']); + await endpoint.read('genPowerCfg', ['batteryVoltage']); await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['msRelativeHumidity']); }, },
Fix TPZRCO2HT-Z3 battery reporting (#<I>) Koenkk/zigbee2mqtt#<I>
Koenkk_zigbee-shepherd-converters
train
js
46dd393ad15524de0ba15557e7cd3c4d691a3491
diff --git a/cid.go b/cid.go index <HASH>..<HASH> 100644 --- a/cid.go +++ b/cid.go @@ -404,10 +404,15 @@ func (c *Cid) UnmarshalJSON(b []byte) error { obj := struct { CidTarget string `json:"/"` }{} - err := json.Unmarshal(b, &obj) + objptr := &obj + err := json.Unmarshal(b, &objptr) if err != nil { return err } + if objptr == nil { + *c = Cid{} + return nil + } if obj.CidTarget == "" { return fmt.Errorf("cid was incorrectly formatted") @@ -430,6 +435,9 @@ func (c *Cid) UnmarshalJSON(b []byte) error { // Note that this formatting comes from the IPLD specification // (https://github.com/ipld/specs/tree/master/ipld) func (c Cid) MarshalJSON() ([]byte, error) { + if !c.Defined() { + return []byte("null"), nil + } return []byte(fmt.Sprintf("{\"/\":\"%s\"}", c.String())), nil }
Handel undefined Cid is JSON representation.
ipfs_go-cid
train
go
05db172b88ccc5302f5d465680f80c06093891bd
diff --git a/fixsvgstack.jquery.js b/fixsvgstack.jquery.js index <HASH>..<HASH> 100644 --- a/fixsvgstack.jquery.js +++ b/fixsvgstack.jquery.js @@ -6,7 +6,7 @@ // The fix is for webkit browsers only // [https://bugs.webkit.org/show_bug.cgi?id=91790]() - if(!$.browser.webkit) { + if(!(/WebKit/.test(navigator.userAgent))) { // return functions that do nothing but support chaining $.fn.fixSVGStack = function() { return this; }; $.fn.fixSVGStackBackground = function() { return this; };
compatibility with jQuery <I> $.browser was removed from jquery in <I> - as this fix is for webkit browsers only there is no chance to use $.support
preciousforever_SVG-Stacker
train
js
360a8058d9713b1ec14ccb93b5834bcf8d3ea6d9
diff --git a/core-bundle/src/Resources/contao/classes/Backend.php b/core-bundle/src/Resources/contao/classes/Backend.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/classes/Backend.php +++ b/core-bundle/src/Resources/contao/classes/Backend.php @@ -347,7 +347,11 @@ abstract class Backend extends Controller } \define('CURRENT_ID', (Input::get('table') ? $id : Input::get('id'))); - $this->Template->headline = $GLOBALS['TL_LANG']['MOD'][$module][0]; + + if (isset($GLOBALS['TL_LANG']['MOD'][$module][0])) + { + $this->Template->headline = $GLOBALS['TL_LANG']['MOD'][$module][0]; + } // Add the module style sheet if (isset($arrModule['stylesheet']))
Fix another E_WARNING issue (see #<I>) Description ----------- We should maybe keep this PR open and see what else we find. 😄 Commits ------- a<I>af<I> Fix another E_WARNING issue
contao_contao
train
php
28ae55a3ce1ada4e1bcac57357bc69244887121d
diff --git a/spec/unit/sql/postgres_spec.rb b/spec/unit/sql/postgres_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/sql/postgres_spec.rb +++ b/spec/unit/sql/postgres_spec.rb @@ -19,7 +19,7 @@ describe "Postgres Extensions" do end it 'should create a table object from the name' do - table = mock('SQLite3 Table') + table = mock('Postgres Table') SQL::Postgres::Table.should_receive(:new).with(@pe, 'users').and_return(table) @pe.table('users').should == table @@ -46,7 +46,7 @@ describe "Postgres Extensions" do SQL::Postgres::Table.new(@adapter, 'users') end - it 'should create SQLite3 Column objects from the returned column structs' do + it 'should create Postgres Column objects from the returned column structs' do SQL::Postgres::Column.should_receive(:new).with(@cs1).and_return(@col1) SQL::Postgres::Column.should_receive(:new).with(@cs2).and_return(@col2) SQL::Postgres::Table.new(@adapter, 'users')
Get rid of SQLite3 mentions int the postgres specs
datamapper_dm-migrations
train
rb
468cc57297754b3ae6bc52d959e55b868612eb11
diff --git a/admin/cli/install.php b/admin/cli/install.php index <HASH>..<HASH> 100644 --- a/admin/cli/install.php +++ b/admin/cli/install.php @@ -164,6 +164,7 @@ require_once($CFG->libdir.'/moodlelib.php'); require_once($CFG->libdir.'/deprecatedlib.php'); require_once($CFG->libdir.'/adminlib.php'); require_once($CFG->libdir.'/componentlib.class.php'); +require_once($CFG->dirroot.'/cache/lib.php'); require($CFG->dirroot.'/version.php'); $CFG->target_release = $release; diff --git a/lib/moodlelib.php b/lib/moodlelib.php index <HASH>..<HASH> 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -7030,9 +7030,6 @@ class core_string_manager implements string_manager { */ public function get_revision() { global $CFG; - if (!$this->usediskcache) { - return -1; - } if (isset($CFG->langrev)) { return (int)$CFG->langrev; } else {
MDL-<I> cache: Added missing include and fixed old lang manager setting
moodle_moodle
train
php,php
5cf03d3ad8cb5aad5df1462a52c1d8d595a323c2
diff --git a/tests/test.attachments.js b/tests/test.attachments.js index <HASH>..<HASH> 100644 --- a/tests/test.attachments.js +++ b/tests/test.attachments.js @@ -119,11 +119,10 @@ adapters.map(function(adapter) { }); asyncTest("Testing with invalid docs", function() { - var invalidDoc = {'_id': '_invalid', foo: "bar"}; + var invalidDoc = {'_id': '_invalid', foo: 'bar'}; initTestDB(this.name, function(err, db) { - db.bulkDocs({docs: [invalidDoc, binAttDoc]}, function (err, info) { - ok(info[0].error, 'first doc is invalid'); - ok(info[1].ok, 'second doc is valid'); + db.bulkDocs({docs: [invalidDoc, binAttDoc]}, function(err, info) { + ok(err, 'bad request'); start(); }); });
(#<I>) - Use Blobs for attachments: update Test Update test saving an attachment together with an invalid doc. Now receives error.
pouchdb_pouchdb
train
js
ecf2371ebbe2d7c603a3216244d4ebf1272a0b51
diff --git a/lib/custom/tests/MW/View/Engine/TwigTest.php b/lib/custom/tests/MW/View/Engine/TwigTest.php index <HASH>..<HASH> 100644 --- a/lib/custom/tests/MW/View/Engine/TwigTest.php +++ b/lib/custom/tests/MW/View/Engine/TwigTest.php @@ -21,7 +21,7 @@ class TwigTest extends \PHPUnit\Framework\TestCase } $this->mock = $this->getMockBuilder( '\Twig_Environment' ) - ->setMethods( array( 'getLoader', 'loadTemplate' ) ) + ->setMethods( array( 'getExtensions', 'getLoader', 'loadTemplate' ) ) ->disableOriginalConstructor() ->getMock(); @@ -39,6 +39,10 @@ class TwigTest extends \PHPUnit\Framework\TestCase { $v = new \Aimeos\MW\View\Standard( [] ); + $this->mock->expects( $this->once() )->method( 'getExtensions' ) + ->will( $this->returnValue( array( [] ) ) ); + + $view = $this->getMockBuilder( '\Twig_Template' ) ->setConstructorArgs( array ( $this->mock ) ) ->setMethods( array( 'getBlockNames', 'render', 'renderBlock' ) )
Adapt tests for new Twig versions
aimeos_ai-twig
train
php
d09a87b814bdce2b2b913fd1a01be69a8b12532c
diff --git a/src/drivers/webextension/js/inject.js b/src/drivers/webextension/js/inject.js index <HASH>..<HASH> 100644 --- a/src/drivers/webextension/js/inject.js +++ b/src/drivers/webextension/js/inject.js @@ -19,7 +19,7 @@ .split('.') .reduce( (value, method) => - value && value.hasOwnProperty(method) + value && value instanceof Object && value.hasOwnProperty(method) ? value[method] : undefined, window
Fix error in console need to check type before call hasOwnProperty Look at this <URL>
AliasIO_Wappalyzer
train
js
eb6a93c0f0195dbb81f1e6931b3244c72d9ce376
diff --git a/python/ray/tests/py3_test.py b/python/ray/tests/py3_test.py index <HASH>..<HASH> 100644 --- a/python/ray/tests/py3_test.py +++ b/python/ray/tests/py3_test.py @@ -96,6 +96,7 @@ def test_args_intertwined(ray_start_regular): test_function(local_method, actor_method) ray.get(remote_test_function.remote(local_method, actor_method)) + def test_asyncio_actor(ray_start_regular): @ray.remote class AsyncBatcher(object): diff --git a/python/ray/tests/test_actor.py b/python/ray/tests/test_actor.py index <HASH>..<HASH> 100644 --- a/python/ray/tests/test_actor.py +++ b/python/ray/tests/test_actor.py @@ -2853,4 +2853,3 @@ ray.get(actor.ping.remote()) run_string_as_driver(driver_script) detached_actor = ray.experimental.get_actor(actor_name) assert ray.get(detached_actor.ping.remote()) == "pong" -
[hotfix] fix lint (#<I>)
ray-project_ray
train
py,py
cf037c302a380f97110b027f47d4a13a3c80b8a2
diff --git a/src/runtime.js b/src/runtime.js index <HASH>..<HASH> 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -207,7 +207,7 @@ function suppressValue(val, autoescape) { val = (val !== undefined && val !== null) ? val : ''; if(autoescape && !(val instanceof SafeString)) { - val = lib.escape(''+val); + val = lib.escape(val.toString()); } return val;
use toString instead of shorthand casting
mozilla_nunjucks
train
js
824f9755fbea855a4c0a5d34bdb28dcd0213bffc
diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/inject/MoreThanOneScopeAnnotationOnClass.java b/core/src/main/java/com/google/errorprone/bugpatterns/inject/MoreThanOneScopeAnnotationOnClass.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/inject/MoreThanOneScopeAnnotationOnClass.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/inject/MoreThanOneScopeAnnotationOnClass.java @@ -43,6 +43,7 @@ import java.util.List; */ @BugPattern( name = "InjectMoreThanOneScopeAnnotationOnClass", + altNames = "MoreThanOneScopeAnnotationOnClass", summary = "A class can be annotated with at most one scope annotation.", explanation = "Annotating a class with more than one scope annotation is "
Allow MoreThanOneScopeAnnotationOnClass as an alternate name to address InjectMoreThanOneScopeAnnotationOnClass. MOE_MIGRATED_REVID=<I>
google_error-prone
train
java
2b201eb0e370f9948beb165799ff7741e8e9dd24
diff --git a/kie-api/src/main/java/org/kie/api/KieServices.java b/kie-api/src/main/java/org/kie/api/KieServices.java index <HASH>..<HASH> 100644 --- a/kie-api/src/main/java/org/kie/api/KieServices.java +++ b/kie-api/src/main/java/org/kie/api/KieServices.java @@ -27,6 +27,7 @@ import org.kie.api.io.KieResources; import org.kie.api.logger.KieLoggers; import org.kie.api.marshalling.KieMarshallers; import org.kie.api.persistence.jpa.KieStoreServices; +import org.kie.api.runtime.Environment; import org.kie.api.runtime.KieContainer; import org.kie.api.runtime.KieSessionConfiguration; @@ -141,6 +142,14 @@ public interface KieServices { KieSessionConfiguration newKieSessionConfiguration(Properties properties); /** + * Instantiate and return an Environment + * + * @return + * The Environment + */ + Environment newEnvironment(); + + /** * A Factory for this KieServices */ public static class Factory {
allow to create a new Environment from KieServices
kiegroup_drools
train
java
b16dfde9086acdc40d59920de32ff52f525a29fa
diff --git a/tooling/vis/cfg-visualization.js b/tooling/vis/cfg-visualization.js index <HASH>..<HASH> 100644 --- a/tooling/vis/cfg-visualization.js +++ b/tooling/vis/cfg-visualization.js @@ -40,10 +40,10 @@ network.destroy(); } - var visGraph = generateNodesAndEdges(controlFlowGraph); - network = new vis.Network(container, visGraph, visualizationOptions); - - return network; + setTimeout(function() { + var visGraph = generateNodesAndEdges(controlFlowGraph); + network = new vis.Network(container, visGraph, visualizationOptions); + }, 0); } function generateNodesAndEdges(cfg) {
Resolves a timing problem with destroying the visjs network graph
mariusschulz_styx
train
js
e572482ce6b269e603d2ddd4d06998eda9b5a16d
diff --git a/test/reader_test.rb b/test/reader_test.rb index <HASH>..<HASH> 100644 --- a/test/reader_test.rb +++ b/test/reader_test.rb @@ -303,7 +303,7 @@ class ReaderTest < Minitest::Test def test_read_after_close reader = Reader.new(fixture("valid/valid_mono_pcm_16_44100.wav")) - buffer = reader.read(1024) + reader.read(1024) reader.close assert_raises(IOError) { reader.read(1024) } end
Avoiding unnecessary variable assignment to avoid warning
jstrait_wavefile
train
rb
fc956e084a967ddb451707a595dcdcfbc4de3f78
diff --git a/python/ray/serve/utils.py b/python/ray/serve/utils.py index <HASH>..<HASH> 100644 --- a/python/ray/serve/utils.py +++ b/python/ray/serve/utils.py @@ -399,7 +399,10 @@ class MockImportedBackend: } for _ in range(len(batch))] async def other_method(self, batch): - return [await request.body() for request in batch] + responses = [] + for request in batch: + responses.append(await request.body()) + return responses def compute_iterable_delta(old: Iterable,
[Hotfix] Lint (#<I>)
ray-project_ray
train
py
30a288d5a07789b443bd84f198d8baefb5bbda67
diff --git a/fft/fft.go b/fft/fft.go index <HASH>..<HASH> 100644 --- a/fft/fft.go +++ b/fft/fft.go @@ -195,9 +195,11 @@ func radix2FFT(x []complex128) []complex128 { for n := 0; n < blocks; n++ { nb := n * stage for j := 0; j < s_2; j++ { - w_n := r[j+nb+s_2] * factors[blocks*j] - t[j+nb] = r[j+nb] + w_n - t[j+nb+s_2] = r[j+nb] - w_n + idx := j + nb + idx2 := idx + s_2 + w_n := r[idx2] * factors[blocks*j] + t[idx] = r[idx] + w_n + t[idx2] = r[idx] - w_n } } }
Only compute indexes once - small speedup
mjibson_go-dsp
train
go
02a27cfc3586d682e1031d1b4f9464e12440464e
diff --git a/molgenis-omx-protocolviewer/src/main/webapp/js/protocolviewer.js b/molgenis-omx-protocolviewer/src/main/webapp/js/protocolviewer.js index <HASH>..<HASH> 100644 --- a/molgenis-omx-protocolviewer/src/main/webapp/js/protocolviewer.js +++ b/molgenis-omx-protocolviewer/src/main/webapp/js/protocolviewer.js @@ -161,7 +161,8 @@ function checkExistenceOfAllSubNodes(node) { } function retrieveNodeInfo(node, recursive, options) { - $('#spinner').modal('show'); + if(recursive) + $('#spinner').modal('show'); $ .ajax({ url : 'molgenis.do?__target=ProtocolViewer&__action=download_json_getprotocol', @@ -181,10 +182,12 @@ function retrieveNodeInfo(node, recursive, options) { }); } } - $('#spinner').modal('hide'); + if(recursive) + $('#spinner').modal('hide'); }, error : function() { - $('#spinner').modal('hide'); + if(recursive) + $('#spinner').modal('hide'); } }); }
only show spinner for recursive (=expensive) server calls
molgenis_molgenis
train
js
f1140031de2e57db2471d6cc0ef544c154012953
diff --git a/src/Serializer/SerializerAbstract.php b/src/Serializer/SerializerAbstract.php index <HASH>..<HASH> 100644 --- a/src/Serializer/SerializerAbstract.php +++ b/src/Serializer/SerializerAbstract.php @@ -15,7 +15,7 @@ use League\Fractal\Pagination\CursorInterface; use League\Fractal\Pagination\PaginatorInterface; use League\Fractal\Resource\ResourceInterface; -abstract class SerializerAbstract +abstract class SerializerAbstract implements Serializer { /** * Serialize a collection.
Added Serializer interface to SerializerAbstract
thephpleague_fractal
train
php
777520eb2638b007749760a69e23eaa885c5c251
diff --git a/symphony/content/content.systemextensions.php b/symphony/content/content.systemextensions.php index <HASH>..<HASH> 100755 --- a/symphony/content/content.systemextensions.php +++ b/symphony/content/content.systemextensions.php @@ -41,6 +41,8 @@ $td3 = Widget::TableData($about['version']); if ($about['author'][0] && is_array($about['author'][0])) { + $value = ""; + for($i = 0; $i < count($about['author']); ++$i) { $author = $about['author'][$i]; $link = $author['name']; @@ -51,9 +53,11 @@ elseif(isset($author['email'])) $link = Widget::Anchor($author['name'], 'mailto:' . $author['email']); - $td4->appendChild($link); - if ($i != count($about['author']) - 1)$td4->appendChild(new XMLElement("span", ",&nbsp;")); + $comma = ($i != count($about['author']) - 1) ? ", " : ""; + $value .= $link->generate() . $comma; } + + $td4->setValue($value); } else { $link = $about['author']['name'];
Commas are no longer wrapped in a span element (see previous commit)
symphonycms_symphony-2
train
php
3ce9295f31e7c0afb2a1b29e9c6742fb8fafadac
diff --git a/arcana/repository/xnat.py b/arcana/repository/xnat.py index <HASH>..<HASH> 100644 --- a/arcana/repository/xnat.py +++ b/arcana/repository/xnat.py @@ -70,6 +70,7 @@ class XnatRepo(Repository): DERIVED_FROM_FIELD = '__derived_from__' PROV_SCAN = '__prov__' PROV_RESOURCE = 'PROV' + depth = 2 def __init__(self, server, project_id, cache_dir, user=None, password=None, check_md5=True, race_cond_delay=30,
added fixed depth of XNAT repository as 2
MonashBI_arcana
train
py
a684dd010a6470aba2d3137ec17b2128af2e249d
diff --git a/app/publisher/zip.go b/app/publisher/zip.go index <HASH>..<HASH> 100644 --- a/app/publisher/zip.go +++ b/app/publisher/zip.go @@ -265,11 +265,12 @@ func (zh *zipHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request) { http.Error(rw, "Server error", http.StatusInternalServerError) return } - f, err := zw.CreateHeader( - &zip.FileHeader{ - Name: file.path, - Method: zip.Store, - }) + zh := zip.FileHeader{ + Name: file.path, + Method: zip.Store, + } + zh.SetModTime(fr.ModTime()) + f, err := zw.CreateHeader(&zh) if err != nil { log.Printf("Could not create %q in zip: %v", file.path, err) http.Error(rw, "Server error", http.StatusInternalServerError)
app/publisher: add zip download file times Change-Id: I2a<I>a<I>d2a<I>ca3b<I>fbc<I>b8b<I>
perkeep_perkeep
train
go
b44c4c28b3bd6eca3037a61c72b6b73141472d10
diff --git a/packages/availity-workflow/scripts/start.js b/packages/availity-workflow/scripts/start.js index <HASH>..<HASH> 100644 --- a/packages/availity-workflow/scripts/start.js +++ b/packages/availity-workflow/scripts/start.js @@ -139,15 +139,9 @@ function web() { const percent = Math.round(percentage * 100); - if (previousPercent === percent) { - return; - } - previousPercent = percent; - - if (percent % 10 === 0 && msg !== null && msg !== undefined && msg.trim() !== '') { - + if (previousPercent !== percent && percent % 10 === 0 && msg !== null && msg !== undefined && msg.trim() !== '') { Logger.info(`${chalk.dim('Webpack')} ${percent}% ${msg}`); - + previousPercent = percent; } }));
fix the percentage calculation for webpack progress
Availity_availity-workflow
train
js
1f1bf3304054f630e1c460d64af51edcfa543955
diff --git a/test/unit/lookup_test.rb b/test/unit/lookup_test.rb index <HASH>..<HASH> 100644 --- a/test/unit/lookup_test.rb +++ b/test/unit/lookup_test.rb @@ -12,10 +12,10 @@ class LookupTest < GeocoderTestCase end def test_search_returns_empty_array_when_no_results - silence_warnings do - Geocoder::Lookup.all_services_except_test.each do |l| - lookup = Geocoder::Lookup.get(l) - set_api_key!(l) + Geocoder::Lookup.all_services_except_test.each do |l| + lookup = Geocoder::Lookup.get(l) + set_api_key!(l) + silence_warnings do assert_equal [], lookup.send(:results, Geocoder::Query.new("no results")), "Lookup #{l} does not return empty array when no results." end
Be more specific about silencing warnings.
alexreisner_geocoder
train
rb
3dcd4d186c15a298e9e428fff3a0ae0652701adb
diff --git a/Block/MediaBlockService.php b/Block/MediaBlockService.php index <HASH>..<HASH> 100644 --- a/Block/MediaBlockService.php +++ b/Block/MediaBlockService.php @@ -101,6 +101,11 @@ class MediaBlockService extends BaseBlockService public function buildEditForm(FormMapper $formMapper, BlockInterface $block) { $contextChoices = $this->getContextChoices(); + + if (!$block->getSetting('mediaId') instanceof MediaInterface) { + $this->load($block); + } + $formatChoices = $this->getFormatChoices($block->getSetting('mediaId')); $formMapper->add('settings', 'sonata_type_immutable_array', array(
Load the media in buildform
sonata-project_SonataMediaBundle
train
php
4481e98564181ecf1c3e110d5d578f74efc7d7fa
diff --git a/contrib/distributed_rails_event_store/postgresql_queue/lib/postgresql_queue.rb b/contrib/distributed_rails_event_store/postgresql_queue/lib/postgresql_queue.rb index <HASH>..<HASH> 100644 --- a/contrib/distributed_rails_event_store/postgresql_queue/lib/postgresql_queue.rb +++ b/contrib/distributed_rails_event_store/postgresql_queue/lib/postgresql_queue.rb @@ -18,7 +18,13 @@ module PostgresqlQueue ).where(event_id: [first_event.event_id, last_event.event_id]). order("id ASC").pluck(:id) eisid_first, eisid_last = eisids.first, eisids.last + eisid_first -=1 + eisid_last+=1 + # FIXME! + # We should get all EventInStream between after..eisid_last + # instead of eisid_first..eisid_last because there can be + # another IDs there from other streams and linked events! eis = RailsEventStoreActiveRecord::EventInStream. where("id >= #{eisid_first} AND id <= #{eisid_last}"). order("id ASC").to_a
Handle a failing situation when we were missing 1 record in "eis" because it was in a named stream. I think this whole solution requires some changes to properly handle linked events. We should get all EventInStream between after..eisid_last instead of eisid_first..eisid_last because there can be another IDs there from other streams and linked events!
RailsEventStore_rails_event_store
train
rb
f07c5d5bb9cb806147dd5f24f15a946ccbf43577
diff --git a/tests/try_with.js b/tests/try_with.js index <HASH>..<HASH> 100644 --- a/tests/try_with.js +++ b/tests/try_with.js @@ -45,4 +45,23 @@ describe('tryWith', function(){ }, function(reason){test_finished(reason ? reason : new Error('tryWith callback rejected!'));}); }); + + it('should immediately fail despite a retry strategy deciding to retry', function(testFinished) { + var testError = new Error('Test critical error'); + testError.name = 'TestError'; + testError.labels = { + critical: true + }; + + var errorLoader = function errorLoader(aggregateConstructor, aggregateID) { + return when.reject(testError); + }; + + tryWith(errorLoader, DummyAggregate, 'dummy-3', function(){}).done(function() { + testFinished(new Error('Unexpected success - tryWith() was supposed to reject')); + }, function(tryWithError) { + assert(tryWithError.name, 'TestError'); + testFinished(); + }); + }); }); \ No newline at end of file
Added a test case which checks whether the newly-added critical error checking in tryWith works as expected (i.e. rejects despite the strategy's decision).
rkaw92_esdf
train
js
200d27fa65cf61e170cc5deccb69110e80dd3034
diff --git a/src/main/java/com/codeborne/selenide/impl/AbstractSelenideElement.java b/src/main/java/com/codeborne/selenide/impl/AbstractSelenideElement.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/codeborne/selenide/impl/AbstractSelenideElement.java +++ b/src/main/java/com/codeborne/selenide/impl/AbstractSelenideElement.java @@ -224,7 +224,7 @@ abstract class AbstractSelenideElement implements InvocationHandler { return shouldNot(proxy, prefix, (Condition[]) args[0]); } - protected boolean isImage() { + protected Boolean isImage() { WebElement img = getActualDelegate(); if (!"img".equalsIgnoreCase(img.getTagName())) { throw new IllegalArgumentException("Method isImage() is only applicable for img elements");
make it compilable with Java 6
selenide_selenide
train
java
c282aef314aa11f605b45e16dd27ae849f31d682
diff --git a/test/helper.rb b/test/helper.rb index <HASH>..<HASH> 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -13,7 +13,7 @@ class TestSlim < MiniTest::Unit::TestCase end def teardown - String.send(:remove_method, :html_safe?) if String.method_defined?(:html_safe?) + String.send(:undef_method, :html_safe?) if String.method_defined?(:html_safe?) Slim::Filter::DEFAULT_OPTIONS.delete(:use_html_safe) end
Undefine the method more cleanly.
slim-template_slim
train
rb
e3c1c0c86c1d5c3e60588c2fdc2739afd81e0109
diff --git a/src/consumer/runner.js b/src/consumer/runner.js index <HASH>..<HASH> 100644 --- a/src/consumer/runner.js +++ b/src/consumer/runner.js @@ -113,6 +113,18 @@ module.exports = class Runner extends EventEmitter { continue } + if (e.type === 'UNKNOWN_MEMBER_ID') { + this.logger.error('The coordinator is not aware of this member, re-joining the group', { + groupId: this.consumerGroup.groupId, + memberId: this.consumerGroup.memberId, + error: e.message, + }) + + this.consumerGroup.memberId = null + await this.consumerGroup.joinAndSync() + continue + } + this.onCrash(e) break } @@ -401,7 +413,11 @@ module.exports = class Runner extends EventEmitter { return } - if (isRebalancing(e) || e.name === 'KafkaJSNotImplemented') { + if ( + isRebalancing(e) || + e.type === 'UNKNOWN_MEMBER_ID' || + e.name === 'KafkaJSNotImplemented' + ) { return bail(e) }
fix: handle unknown_member_id from offsetCommit
tulios_kafkajs
train
js
6eaaf752496aa813087888bc2eb4c81b3cb15bf2
diff --git a/tests/test_cli.py b/tests/test_cli.py index <HASH>..<HASH> 100755 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -68,4 +68,11 @@ def test_convert_command(from_path, to_path, from_format, to_format): mwtabfiles_study_ids_set = set(mwf.study_id for mwf in mwtabfiles_list) mwtabfiles_analysis_ids_set = set(mwf.analysis_id for mwf in mwtabfiles_list) assert mwtabfiles_study_ids_set.issubset({"ST000001", "ST000002"}) - assert mwtabfiles_analysis_ids_set.issubset({"AN000001", "AN000002"}) \ No newline at end of file + assert mwtabfiles_analysis_ids_set.issubset({"AN000001", "AN000002"}) + +@pytest.mark.parametrize("input_value, args", [ + ("AN000001", "tests/example_data/tmp") +]) +def test_download_command(input_value, args): + command = "python-m mwtab download {} {}" + assert os.system(command) == 0
Begins adding unit test for download commandline method.
MoseleyBioinformaticsLab_mwtab
train
py
38e536e4706e77c67849a0ef71a5c924f5919b88
diff --git a/internal/client/client.go b/internal/client/client.go index <HASH>..<HASH> 100644 --- a/internal/client/client.go +++ b/internal/client/client.go @@ -2,7 +2,6 @@ package client import ( - "fmt" "os" "github.com/goreleaser/goreleaser/pkg/config" @@ -31,5 +30,5 @@ func New(ctx *context.Context) (Client, error) { if ctx.TokenType == context.TokenTypeGitLab { return NewGitLab(ctx) } - return nil, fmt.Errorf("client is not yet implemented: %s", ctx.TokenType) + return nil, nil }
Fixed token required if release is disabled #<I> (#<I>)
goreleaser_goreleaser
train
go
7b3597d1ddc5c486bf8f1c6f6dd3bc20ac2230f8
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ #!/usr/bin/env python +import os import pypandoc try: @@ -9,14 +10,17 @@ except ImportError: use_setuptools() from setuptools import setup -readme = pypandoc.convert_file('README.md', 'rst') -changelog = pypandoc.convert_file('CHANGELOG.md', 'rst') +long_description = 'This library provides the python client for the Packet API.' +if os.path.isfile('README.md') and os.path.isfile('CHANGELOG.md'): + readme = pypandoc.convert_file('README.md', 'rst') + changelog = pypandoc.convert_file('CHANGELOG.md', 'rst') + long_description = readme + '\n' + changelog setup( name='packet-python', version='1.36.0', description='Packet API client', - long_description=readme + '\n' + changelog, + long_description=long_description, url='https://github.com/packethost/packet-python', author='Packet Developers', license='LGPL v3',
setup.py: handle missing readme/changelog files This is the case when running tests under tox.
packethost_packet-python
train
py
1a79ab365194b27f24c491ca55969ab8f6af1740
diff --git a/wurlitzer.py b/wurlitzer.py index <HASH>..<HASH> 100644 --- a/wurlitzer.py +++ b/wurlitzer.py @@ -210,9 +210,9 @@ class Wurlitzer(object): data = os.read(fd, 1024) if not data: # pipe closed, stop polling it - os.close(fd) pipes.remove(fd) poller.unregister(fd) + os.close(fd) else: handler = getattr(self, '_handle_%s' % name) handler(data)
closing socket descriptor after removing from array and unregistering from poller
minrk_wurlitzer
train
py
c25373bb63881dcb5bdb6976e9edfb7a99836d6d
diff --git a/app/controllers/securities_controller.py b/app/controllers/securities_controller.py index <HASH>..<HASH> 100644 --- a/app/controllers/securities_controller.py +++ b/app/controllers/securities_controller.py @@ -115,10 +115,9 @@ def __get_model_for_details( # Profit/loss model.profit_loss = model.value - model.total_paid - if abs(model.value) > abs(model.total_paid): - model.profit_loss_perc = model.profit_loss * 100 / model.value - else: - model.profit_loss_perc = model.value * 100 / model.profit_loss + model.profit_loss_perc = abs(model.profit_loss) * 100 / model.total_paid + if abs(model.value) < abs(model.total_paid): + model.profit_loss_perc *= -1 # Income model.income = sec_agg.get_income_total() model.income_perc = model.income * 100 / model.total_paid
correcting the unrealized gains/loss % calc
MisterY_gnucash-portfolio
train
py
b7f5db6be5174d0fd74d36a0b97b7518a5e67aad
diff --git a/pifpaf/drivers/gnocchi.py b/pifpaf/drivers/gnocchi.py index <HASH>..<HASH> 100644 --- a/pifpaf/drivers/gnocchi.py +++ b/pifpaf/drivers/gnocchi.py @@ -87,7 +87,7 @@ url = %s""" % (self.tempdir, self.port, pg.url)) self.putenv("GNOCCHI_PORT", str(self.port)) self.putenv("URL", "gnocchi://localhost:%d" % self.port) self.putenv("GNOCCHI_HTTP_URL", self.http_url) - self.putenv("GNOCCHI_ENDPOINT", self.http_url) - self.putenv("OS_AUTH_TYPE", "gnocchi-noauth") - self.putenv("GNOCCHI_USER_ID", "admin") - self.putenv("GNOCCHI_PROJECT_ID", "admin") + self.putenv("GNOCCHI_ENDPOINT", self.http_url, True) + self.putenv("OS_AUTH_TYPE", "gnocchi-noauth", True) + self.putenv("GNOCCHI_USER_ID", "admin", True) + self.putenv("GNOCCHI_PROJECT_ID", "admin", True)
gnocchi: fix a regression on variable names These ones should not be prefixed.
jd_pifpaf
train
py
fb02112a63f534b4d3bd0723b940478079bed5b8
diff --git a/core-bundle/src/Resources/contao/drivers/DC_Table.php b/core-bundle/src/Resources/contao/drivers/DC_Table.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/drivers/DC_Table.php +++ b/core-bundle/src/Resources/contao/drivers/DC_Table.php @@ -4302,7 +4302,7 @@ Backend.makeParentViewSortable("ul_' . CURRENT_ID . '"); // call the panelLayout_callbacck default: - $arrCallback = $GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['panelLayout_callback'][$strSubPanelKey]; + $arrCallback = $GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['panel_callback'][$strSubPanelKey]; if (is_array($arrCallback)) { $this->import($arrCallback[0]);
[Core] the callback is now named "panel_callback"
contao_contao
train
php
8364e52c9d59cbc68f7b94ca5f7f6299ff174a3d
diff --git a/marabunta/parser.py b/marabunta/parser.py index <HASH>..<HASH> 100644 --- a/marabunta/parser.py +++ b/marabunta/parser.py @@ -14,7 +14,7 @@ YAML_EXAMPLE = u""" migration: options: # --workers=0 --stop-after-init are automatically added - install_command: odoo.py + install_command: odoo install_args: --log-level=debug versions: - version: 0.0.1 @@ -24,7 +24,7 @@ migration: post: # executed after 'addons' - anthem songs::install addons: - upgrade: # executed as odoo.py --stop-after-init -i/-u ... + upgrade: # executed as odoo --stop-after-init -i/-u ... - base - document # remove: # uninstalled with a python script
Update docstring to use odoo command instead of odoo.py
camptocamp_marabunta
train
py
d43af22b2b449b74dd15c4d6ed41734baa2be33b
diff --git a/command/agent/config.go b/command/agent/config.go index <HASH>..<HASH> 100644 --- a/command/agent/config.go +++ b/command/agent/config.go @@ -602,6 +602,9 @@ func (a *AdvertiseAddrs) Merge(b *AdvertiseAddrs) *AdvertiseAddrs { if b.Serf != "" { result.Serf = b.Serf } + if b.HTTP != "" { + result.HTTP = b.HTTP + } return &result }
Merging the value of http advertise addr if user is providing one
hashicorp_nomad
train
go
7359360fbc7177d5e8a0653a46b8f0987d19b8cc
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ setup( ], license='License :: OSI Approved :: MIT License', keywords='design-by-contract precondition postcondition validation', - packages=find_packages(exclude=['tests']), + packages=find_packages(exclude=['tests*']), install_requires=install_requires, extras_require={ 'dev': [
Excluded all tests from package (#<I>) The test directories tests_* are erronously included in the package. With this patch they are excluded in the package building. Fixes #<I>.
Parquery_icontract
train
py
3efff3311b52222b7d06bf63ce97f8a42572bc06
diff --git a/arthur/_version.py b/arthur/_version.py index <HASH>..<HASH> 100644 --- a/arthur/_version.py +++ b/arthur/_version.py @@ -1,2 +1,2 @@ # Versions compliant with PEP 440 https://www.python.org/dev/peps/pep-0440 -__version__ = "0.1.0" +__version__ = "0.1.1"
Update version number to <I>
chaoss_grimoirelab-kingarthur
train
py
2412fe641ada51fd2192b0e1cf81d8d74b9aefeb
diff --git a/tests/lib/screenshot-testing/support/diff-viewer.js b/tests/lib/screenshot-testing/support/diff-viewer.js index <HASH>..<HASH> 100644 --- a/tests/lib/screenshot-testing/support/diff-viewer.js +++ b/tests/lib/screenshot-testing/support/diff-viewer.js @@ -69,7 +69,7 @@ DiffViewerGenerator.prototype.generate = function (callback) { var expectedUrl = self.getUrlForPath(entry.expected), screenshotRepo = options['screenshot-repo'] || 'piwik/piwik-ui-tests', pathPrefix = options['screenshot-repo'] ? '/Test/UI' : '', - expectedUrlGithub = 'https://raw.github.com/' + screenshotRepo + '/master' + pathPrefix + expectedUrlGithub = 'https://raw.githubusercontent.com/' + screenshotRepo + '/master' + pathPrefix + '/expected-ui-screenshots/' + entry.name + '.png'; var expectedHtml = '';
github changed their URLs to githubusercontent.com
matomo-org_matomo
train
js
6f58fbd4eded5dc2ac5400f23e601c7db51326db
diff --git a/fmn/lib/models.py b/fmn/lib/models.py index <HASH>..<HASH> 100644 --- a/fmn/lib/models.py +++ b/fmn/lib/models.py @@ -350,7 +350,9 @@ class Preference(BASE): batch_count = sa.Column(sa.Integer, nullable=True) # Hold the state of start/stop commands to the irc bot and others. - enabled = sa.Column(sa.Boolean, default=True, nullable=False) + # Disabled by default so that we can provide robust default filters without + # forcing new users into an opt-out situation. + enabled = sa.Column(sa.Boolean, default=False, nullable=False) openid = sa.Column( sa.Text,
Disable messaging out of the box.
fedora-infra_fmn.lib
train
py
09c63449b767c19bdc8a8ddff16002b2d118346e
diff --git a/django_extensions/management/commands/find_template.py b/django_extensions/management/commands/find_template.py index <HASH>..<HASH> 100644 --- a/django_extensions/management/commands/find_template.py +++ b/django_extensions/management/commands/find_template.py @@ -19,4 +19,4 @@ class Command(LabelCommand): except TemplateDoesNotExist: sys.stderr.write("No template found\n") else: - print(template.name) + sys.stdout.write(self.style.SUCCESS((template.name)))
change print into self.stdout
django-extensions_django-extensions
train
py
3de0fc6a45a12e7db6a4ff07e262c1c11d5fb82b
diff --git a/lib/github3.js b/lib/github3.js index <HASH>..<HASH> 100644 --- a/lib/github3.js +++ b/lib/github3.js @@ -235,5 +235,15 @@ github3.getForks = function (repo,name,callback) { this._get('/repos/'+name+'/'+repo+'/forks',callback) } +/* + Repository Watchers + @class github3 + @method getWatchers +*/ + +github3.getWatchers = function (repo,name,callback) { + this._get('/repos/'+name+'/'+repo+'/watchers',callback) +} + /* EOF */ \ No newline at end of file diff --git a/test/api.test.js b/test/api.test.js index <HASH>..<HASH> 100644 --- a/test/api.test.js +++ b/test/api.test.js @@ -135,6 +135,17 @@ vows.describe('api tests').addBatch({ assert.equal(typeof(data), 'object'); } }, + // getWatchers + 'when making a call to getWatchers(github3,edwardhotchkiss,':{ + topic:function(){ + github3.getWatchers('github3','edwardhotchkiss', this.callback); + }, + 'we should receive no errors, and data back':function(error, data) { + console.log(data); + assert.equal(error, null); + assert.equal(typeof(data), 'object'); + } + }, }).export(module);
added method/test to retrieve list of people watching a repository
edwardhotchkiss_github3
train
js,js
0c481071d39d32f4ef5d6098104e17854e387d8e
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -107,45 +107,8 @@ function start (params = {}) { serverClose('SIGINT') }) - /** - * A list of promises which listen to different - * events in the application which need to resolved - * until the server is fully started. - * - * By adding a new promise in the list below the - * <code>serverStartedPromise</code> will wait - * for that promise (and the rest of the promises - * in the array) to resolve. - */ - var serverStartedPromise = Promise.all([ - createEventPromise('event:strategyInitialized') - ]) - - serverStartedPromise.then(function () { - server.emit('event:serverStarted', 'true') - }) return Promise.resolve() } -/** - * Create an Promise which listen for a event. - * - * @param eventName - for the event that the promise will listen for - * @returns {Promise} A Promise which will resolve when the event fires - */ -function createEventPromise (eventName) { - return new Promise( - function (resolve, reject) { - server.on(eventName, function (initialized) { - if (initialized) { - resolve() - } else { - reject() - } - }) - } - ) -} - module.exports = server module.exports.start = start
Removed code after discussion with Emil, we don’t believe this is used and it is a bit strange
KTH_kth-node-server
train
js
e2b56d0a09143bfbd54862baf603bd9c1ffdb369
diff --git a/storage/sql/config.go b/storage/sql/config.go index <HASH>..<HASH> 100644 --- a/storage/sql/config.go +++ b/storage/sql/config.go @@ -242,6 +242,10 @@ func (s *MySQL) open(logger log.Logger) (*conn, error) { if s.Host[0] != '/' { cfg.Net = "tcp" cfg.Addr = s.Host + + if s.Port != 0 { + cfg.Addr = net.JoinHostPort(s.Host, strconv.Itoa(int(s.Port))) + } } else { cfg.Net = "unix" cfg.Addr = s.Host
fix(storage/mysql): add missing port to the address
dexidp_dex
train
go
784dd48486fc4772ff659590edf661f3c0a87fa9
diff --git a/Auth.php b/Auth.php index <HASH>..<HASH> 100644 --- a/Auth.php +++ b/Auth.php @@ -980,6 +980,14 @@ class Auth return $return; } + $zxcvbn = new Zxcvbn(); + + if ($zxcvbn->passwordStrength($password)['score'] < intval($this->config->password_min_score)) { + $return['message'] = $this->lang['password_weak']; + + return $return; + } + if ($password !== $repeatpassword) { // Passwords don't match $return['message'] = $this->lang["newpassword_nomatch"];
Added a password strength check to resetPass
PHPAuth_PHPAuth
train
php
de73747a946b735e0ab0feb5d9f35749fd7578b2
diff --git a/lxd/network/network.go b/lxd/network/network.go index <HASH>..<HASH> 100644 --- a/lxd/network/network.go +++ b/lxd/network/network.go @@ -283,6 +283,20 @@ func (n *Network) setup(oldConfig map[string]string) error { } } + // Enable VLAN filtering for Linux bridges. + if n.config["bridge.driver"] != "openvswitch" { + err = BridgeVLANFilterSetStatus(n.name, "1") + if err != nil { + return err + } + + // Set the default PVID for new ports to 1. + err = BridgeVLANSetDefaultPVID(n.name, "1") + if err != nil { + return err + } + } + // Bring it up _, err = shared.RunCommand("ip", "link", "set", "dev", n.name, "up") if err != nil {
lxd/network: Enable VLAN filtering for managed Linux bridges Sets default PVID to 1.
lxc_lxd
train
go
e81677a56b54c88e9b9d873738f3f13599917b72
diff --git a/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/async/BulkMutation.java b/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/async/BulkMutation.java index <HASH>..<HASH> 100644 --- a/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/async/BulkMutation.java +++ b/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/async/BulkMutation.java @@ -72,7 +72,7 @@ public class BulkMutation { @VisibleForTesting static Logger LOG = new Logger(BulkMutation.class); - public static final long MAX_RPC_WAIT_TIME_NANOS = TimeUnit.MINUTES.toNanos(5); + public static final long MAX_RPC_WAIT_TIME_NANOS = TimeUnit.MINUTES.toNanos(7); private final AtomicLong batchIdGenerator = new AtomicLong(); private static StatusRuntimeException toException(Status status) {
Increasing the staleness timeout to 7 minutes. (#<I>)
googleapis_cloud-bigtable-client
train
java
95f9a35e1a24040772dd71cb460f008a21810e1f
diff --git a/salt/modules/iptables.py b/salt/modules/iptables.py index <HASH>..<HASH> 100644 --- a/salt/modules/iptables.py +++ b/salt/modules/iptables.py @@ -116,6 +116,20 @@ def set_policy(table='filter', chain=None, policy=None): return out +def save(filename): + ''' + Save the current in-memory rules to disk + + CLI Example:: + + salt '*' iptables.save /etc/sysconfig/iptables + ''' + os.makedirs(os.path.dirname(filename)) + cmd = 'iptables-save > {0}'.format(filename) + out = __salt__['cmd.run'](cmd) + return out + + def append(table='filter', rule=None): ''' Append a rule to the specified table/chain.
Add the ability to save rules to disk
saltstack_salt
train
py
bae20c135c6d7634756ddbad3a8729f8dd67ebf6
diff --git a/src/LaravelRepositoriesServiceProvider.php b/src/LaravelRepositoriesServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/LaravelRepositoriesServiceProvider.php +++ b/src/LaravelRepositoriesServiceProvider.php @@ -6,10 +6,19 @@ use Illuminate\Support\ServiceProvider; use Saritasa\LaravelRepositories\Repositories\RepositoryFactory; use Saritasa\LaravelRepositories\Contracts\IRepositoryFactory; +/** + * Package providers. Registers package implementation in DI container. + * Make settings needed to correct work. + */ class LaravelRepositoriesServiceProvider extends ServiceProvider { + /** + * Register package implementation in DI container. + * + * @return void + */ public function register(): void { - $this->app->bind(IRepositoryFactory::class, RepositoryFactory::class); + $this->app->singleton(IRepositoryFactory::class, RepositoryFactory::class); } }
Change type of implementation of IRepositoryFactory in DI container to singleton. Improve package provider documentation.
Saritasa_php-laravel-repositories
train
php
f7ea6cf0d7dec4e8a7a595ce53ec827878fa554d
diff --git a/cnxpublishing/tests/test_db.py b/cnxpublishing/tests/test_db.py index <HASH>..<HASH> 100644 --- a/cnxpublishing/tests/test_db.py +++ b/cnxpublishing/tests/test_db.py @@ -1077,7 +1077,7 @@ INSERT INTO modules VALUES (1, 'Module', 'referenced module', DEFAULT, DEFAULT, 1, 1, - 0, 'admin', 'log', NULL, NULL, NULL, + 0, 'admin', 'log', DEFAULT, NULL, NULL, 'en', '{admin}', NULL, '{admin}', DEFAULT, DEFAULT) RETURNING uuid || '@' || major_version""") doc_ident_hash = cursor.fetchone()[0] @@ -1450,7 +1450,7 @@ VALUES (1, 'Module', 'm10000', %s, 'v1', '1', DEFAULT, DEFAULT, DEFAULT, 1, 1, - 0, 'admin', 'log', NULL, NULL, NULL, + 0, 'admin', 'log', DEFAULT, NULL, NULL, 'en', '{admin}', NULL, '{admin}', DEFAULT, DEFAULT), (2, 'Module', 'm10000', %s, 'v2',
Change tests to insert DEFAULT stateid instead of NULL
openstax_cnx-publishing
train
py
77fa0c93b82f22675e147c4b7e6e371aa882e354
diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -115,10 +115,15 @@ describe('loads', function () { /* istanbul ignore next */ .on('error', function (err) { throw err; + }) + /* istanbul ignore next */ + .on('timeout', function (err) { + throw err; }); - xhr.timeout = 200; - loads(xhr, ee).emit('load'); + xhr.timeout = 10; + loads(xhr, ee); + ee.emit('end'); }); it('emits a `stream` event when onload has data', function (next) {
[test] Test that everything is cleared on `end`
unshiftio_loads
train
js
487541e1778dd6c57f6fcb0a482a02e1bcd5f25d
diff --git a/conftest.py b/conftest.py index <HASH>..<HASH> 100644 --- a/conftest.py +++ b/conftest.py @@ -25,11 +25,18 @@ def client_token(client): def clean_response(response): """Remove a few info from the response before writing cassettes.""" - if not isinstance(response, dict): - return response - response["headers"].pop("Set-Cookie", None) - response["headers"].pop("Date", None) - response["headers"].pop("P3P", None) + remove_headers = {"Set-Cookie", "Date", "P3P"} + if isinstance(response["headers"], dict): + # Normal client stores headers as dict + for header_name in remove_headers: + response["headers"].pop(header_name, None) + elif isinstance(response["headers"], list): + # Tornado client stores headers as a list of 2-tuples + response["headers"] = [ + (name, value) + for name, value in response["headers"] + if name not in remove_headers + ] return response
test: make clean response work with tornado client
browniebroke_deezer-python
train
py