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
|
---|---|---|---|---|---|
92ddcaa8afb0153cc97f6001419615d487c48fbf | diff --git a/lib/puppet/type/user.rb b/lib/puppet/type/user.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/type/user.rb
+++ b/lib/puppet/type/user.rb
@@ -423,7 +423,10 @@ module Puppet
resource at the same time. For instance, Puppet creates a home directory for a managed
user if `ensure => present` and the user does not exist at the time of the Puppet run.
If the home directory is then deleted manually, Puppet will not recreate it on the next
- run."
+ run.
+
+ Note that on Windows, this manages creation/deletion of the user profile instead of the
+ home directory. The user profile is stored in the `C:\Users\<username>` directory."
defaultto false | (PUP-<I>) Update the managehome property's docs for Windows
On Windows, the managehome property manages creation/deletion of
the user profile, _not_ the home directory. This commit updates
the docs with this information. | puppetlabs_puppet | train | rb |
fabb401783b71405d7cc4257ba8f93456384ab66 | diff --git a/cwtools/corewebsite.py b/cwtools/corewebsite.py
index <HASH>..<HASH> 100644
--- a/cwtools/corewebsite.py
+++ b/cwtools/corewebsite.py
@@ -8,7 +8,7 @@ from twisted.python.filepath import FilePath
from cwtools import testing, htmltools, jsimp
from ecmaster import closurecompiler
from lytics.endpoint import Analytics
-from webmagic.untwist import BetterResource, BetterFile
+from webmagic.untwist import BetterResource, BetterFile, ConnectionTrackingSite
class Compiler(BetterResource):
@@ -77,5 +77,5 @@ class Root(BetterResource):
def makeSite(reactor, testPackages):
root = Root(reactor, testPackages)
- site = server.Site(root, clock=reactor)
+ site = ConnectionTrackingSite(root, clock=reactor)
return site | cwtools/corewebsite.py: use ConnectionTrackingSite, just like minervasite does. | ludiosarchive_Coreweb | train | py |
3216a3b8799aa0df3d229201f95ae8f20477b589 | diff --git a/tasks/responsive_images.js b/tasks/responsive_images.js
index <HASH>..<HASH> 100644
--- a/tasks/responsive_images.js
+++ b/tasks/responsive_images.js
@@ -502,7 +502,8 @@ module.exports = function(grunt) {
return processImage(srcPath, dstPath, sizeOptions, tally, callback);
} else {
grunt.verbose.ok('File already exists: ' + dstPath);
- return callback();
+ // defer the callback
+ setImmediate(callback);
}
} else {
return processImage(srcPath, dstPath, sizeOptions, tally, callback); | Fix recursive function
When you have a few thousands files and you run the option task `newFilesOnly`, an error occurs `Maximum call stack size exceeded`. Fix this issue by scheduling the "immediate" execution of callback after I/O events callbacks and before `setTimeout `and `setInterval ` —More info on `setImmediate` function here: <URL> | andismith_grunt-responsive-images | train | js |
c8e145f05d535c8e73e9b8bfcf69097f97e3e57a | diff --git a/gcloud/datastore/entity.py b/gcloud/datastore/entity.py
index <HASH>..<HASH> 100644
--- a/gcloud/datastore/entity.py
+++ b/gcloud/datastore/entity.py
@@ -213,7 +213,8 @@ class Entity(dict):
exist only locally.
"""
key = self._must_key
- entity = key.get()
+ connection = self._must_dataset.connection()
+ entity = key.get(connection=connection)
if entity:
self.update(entity)
diff --git a/gcloud/datastore/test_entity.py b/gcloud/datastore/test_entity.py
index <HASH>..<HASH> 100644
--- a/gcloud/datastore/test_entity.py
+++ b/gcloud/datastore/test_entity.py
@@ -264,7 +264,8 @@ class _Key(object):
def path(self):
return self._path
- def get(self):
+ def get(self, connection=None):
+ self._connection_used = connection
return self._stored | Adding back dataset's connection in Entity.reload. | googleapis_google-cloud-python | train | py,py |
12e46fd452ff5fa4872ba8717278d92303599629 | diff --git a/docs/source/conf.py b/docs/source/conf.py
index <HASH>..<HASH> 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -48,16 +48,16 @@ master_doc = 'index'
# General information about the project.
project = u'mist'
-copyright = u'2015, Mist.io Inc'
+copyright = u'2016, Mist.io Inc'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
-version = '1.2.4'
+version = '1.7'
# The full version, including alpha/beta/rc tags.
-release = '1.2.4'
+release = '1.7.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,7 @@ requires = [
'argcomplete',
'pyyaml',
'prettytable',
- 'ansible'
+ 'ansible==1.9.3'
]
@@ -20,7 +20,7 @@ def readme():
setup(
name='mist',
- version='1.5',
+ version='1.7',
description='Python client for mist.io',
long_description=readme(),
classifiers=[ | update version and remove ansible dependency | mistio_mist.client | train | py,py |
600841fcbfab53bac346a74b513f116d25c18ee1 | diff --git a/pyxmpp/roster.py b/pyxmpp/roster.py
index <HASH>..<HASH> 100644
--- a/pyxmpp/roster.py
+++ b/pyxmpp/roster.py
@@ -77,7 +77,7 @@ class RosterItem(StanzaPayloadObject):
ns=get_node_ns_uri(node)
if ns and ns!=ROSTER_NS or node.name!="item":
raise ValueError,"XML node is not a roster item"
- jid=JID(node.prop("jid"))
+ jid=JID(node.prop("jid").decode("utf-8"))
subscription=node.prop("subscription")
if subscription not in ("none","from","to","both","remove"):
subscription="none" | - fixed handling of non-ascii JIDs in roster (thanks to Andrew Diederich) | Jajcus_pyxmpp2 | train | py |
3c35026a32569a310b486de54001bf6ba05da2a2 | diff --git a/components/users.js b/components/users.js
index <HASH>..<HASH> 100644
--- a/components/users.js
+++ b/components/users.js
@@ -368,7 +368,7 @@ SteamCommunity.prototype.getUserInventoryContents = function(userID, appID, cont
if (err) {
if (err.message == "HTTP error 403" && body === null) {
// 403 with a body of "null" means the inventory/profile is private.
- if(userID.getSteamID64() == self.steamID.getSteamID64()) {
+ if (self.steamID && userID.getSteamID64() == self.steamID.getSteamID64()) {
// We can never get private profile error for our own inventory!
self._notifySessionExpired(err);
} | Check if instance is logged in before comparing steamids (fixes #<I>) | DoctorMcKay_node-steamcommunity | train | js |
9f745102488835713a830378e84916ef8ec2f860 | diff --git a/libraries/mako/mako/request.php b/libraries/mako/mako/request.php
index <HASH>..<HASH> 100644
--- a/libraries/mako/mako/request.php
+++ b/libraries/mako/mako/request.php
@@ -66,6 +66,12 @@ namespace mako
protected static $method = 'GET';
/**
+ * Was the request made using HTTPS?
+ */
+
+ protected static $secure = false;
+
+ /**
* Array holding all the URL segments.
*/
@@ -156,6 +162,10 @@ namespace mako
// Which request method was used?
static::$method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'UNKNOWN';
+
+ // Was the request made using HTTPS?
+
+ static::$secure = (!empty($_SERVER['HTTPS']) && filter_var($_SERVER['HTTPS'], FILTER_VALIDATE_BOOLEAN)) ? true : false;
}
}
else
@@ -536,6 +546,18 @@ namespace mako
}
/**
+ * Was the reqeust made using HTTPS?
+ *
+ * @access public
+ * @return boolean
+ */
+
+ public static function isSecure()
+ {
+ return static::$secure;
+ }
+
+ /**
* Returns the buffered output of the requested controller.
*
* @access public | Added Request::isSecure method | mako-framework_framework | train | php |
44a868ce588407aee4cef9e3e12c0f925113056e | diff --git a/src/Functional/Functional.php b/src/Functional/Functional.php
index <HASH>..<HASH> 100644
--- a/src/Functional/Functional.php
+++ b/src/Functional/Functional.php
@@ -654,7 +654,7 @@ function concat(string $separator = ''): Closure
*
* @template T
* @param callable(...mixed): T $callable
- * @param array<int, mixed> ...$args
+ * @param array $args
* @return Closure(): T
*/
function lazy(callable $callable, ...$args): Closure
@@ -665,6 +665,7 @@ function lazy(callable $callable, ...$args): Closure
* @psalm-return T
*/
static function () use ($callable, $args) {
+ /** @psalm-suppress MixedArgument */
return call($callable, ...$args);
};
}
@@ -674,7 +675,7 @@ function lazy(callable $callable, ...$args): Closure
*
* @template T
* @param callable(...mixed): T $callable
- * @param array<int, mixed> ...$args
+ * @param array ...$args
* @return mixed
* @psalm-return T
*/ | Less-specific about lazy and call arguments type | leocavalcante_siler | train | php |
e978b176cf340731323c06e1d8528bd30c913c53 | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -114,7 +114,7 @@ const configureGrunt = function (grunt) {
options: {
ui: 'bdd',
reporter: grunt.option('reporter') || 'spec',
- timeout: '30000',
+ timeout: '60000',
save: grunt.option('reporter-output'),
require: ['core/server/overrides'],
retries: '3', | Increased Mocha timeout to <I>s
no issue
- allow for random platform delays in tests | TryGhost_Ghost | train | js |
e4a22255ccb818f8b55a20f56ddcfda869db250f | diff --git a/hugolib/menu_test.go b/hugolib/menu_test.go
index <HASH>..<HASH> 100644
--- a/hugolib/menu_test.go
+++ b/hugolib/menu_test.go
@@ -91,7 +91,10 @@ type testMenuState struct {
oldBaseUrl interface{}
}
-func TestPageMenu(t *testing.T) {
+// temporarily disabled
+// will be enabled once the cast related build issues is fixed
+// todo bep
+func _TestPageMenu(t *testing.T) {
ts := setupMenuTests(t)
defer resetMenuTestState(ts) | Temporarily disable failing menu test | gohugoio_hugo | train | go |
87449e04f26a298915a283fdb35478968ab9c446 | diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php
@@ -106,10 +106,21 @@ EOF
$builder = new ProcessBuilder(array(PHP_BINARY, '-S', $input->getArgument('address'), $router));
$builder->setWorkingDirectory($documentRoot);
$builder->setTimeout(null);
- $builder->getProcess()->run(function ($type, $buffer) use ($output) {
+ $process = $builder->getProcess();
+ $process->run(function ($type, $buffer) use ($output) {
if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
$output->write($buffer);
}
});
+
+ if (!$process->isSuccessful()) {
+ $output->writeln('<error>Built-in server terminated unexpectedly</error>');
+
+ if (OutputInterface::VERBOSITY_VERBOSE > $output->getVerbosity()) {
+ $output->writeln('<error>Run the command again with -v option for more details</error>');
+ }
+ }
+
+ return $process->getExitCode();
}
} | backport more error information from <I> to <I>
The commit on master was:
server:run command: provide more error information
The server:run command didn't provide many information when the executed
command exited unexpectedly. Now, the process' exit code is passed through
and an error message is displayed. | symfony_symfony | train | php |
599f28983e1f56e377286b37c2dd45faf3f467fa | diff --git a/guice/common/src/main/java/com/peterphi/std/guice/restclient/resteasy/impl/ResteasyClientFactoryImpl.java b/guice/common/src/main/java/com/peterphi/std/guice/restclient/resteasy/impl/ResteasyClientFactoryImpl.java
index <HASH>..<HASH> 100644
--- a/guice/common/src/main/java/com/peterphi/std/guice/restclient/resteasy/impl/ResteasyClientFactoryImpl.java
+++ b/guice/common/src/main/java/com/peterphi/std/guice/restclient/resteasy/impl/ResteasyClientFactoryImpl.java
@@ -89,6 +89,10 @@ public class ResteasyClientFactoryImpl implements StoppableService
final RemoteExceptionClientResponseFilter remoteExceptionClientResponseFilter,
final JAXBContextResolver jaxbContextResolver)
{
+ // Make sure that if we're called multiple times (e.g. because of a guice CreationException failing startup after us) we start fresh
+ if (ResteasyProviderFactory.peekInstance() != null)
+ ResteasyProviderFactory.clearInstanceIfEqual(ResteasyProviderFactory.peekInstance());
+
this.resteasyProviderFactory = ResteasyProviderFactory.getInstance();
resteasyProviderFactory.registerProviderInstance(jaxbContextResolver); | Bugfix: in the event of a CreationException happening after resteasy client initialisation, we could duplicate provider registrations. This change makes sure that we start fresh every time | petergeneric_stdlib | train | java |
77134a08b2135c4073fc9b9e84cf710fbe2f14e2 | diff --git a/calendar/tests/privacy_test.php b/calendar/tests/privacy_test.php
index <HASH>..<HASH> 100644
--- a/calendar/tests/privacy_test.php
+++ b/calendar/tests/privacy_test.php
@@ -104,7 +104,7 @@ class core_calendar_privacy_testcase extends provider_testcase {
// Add a Calendar Subscription and Group Calendar Event to Course 3.
$this->create_test_calendar_subscription('course', 'https://calendar.google.com/', $user->id, 0, $course3->id);
- $this->create_test_standard_calendar_event('group', $user->id, time(), '', 0, $course1->id, $course3group->id);
+ $this->create_test_standard_calendar_event('group', $user->id, time(), '', 0, $course3->id, $course3group->id);
// The user will be in these contexts.
$usercontextids = [ | MDL-<I> core_calendar: Fix test_get_contexts_for_userid() test
This issue is part of the MDL-<I> Epic. | moodle_moodle | train | php |
408ef69c6c65141b8d11d8513c34c9d2795fd67b | diff --git a/packages/pob/lib/generators/monorepo/index.js b/packages/pob/lib/generators/monorepo/index.js
index <HASH>..<HASH> 100644
--- a/packages/pob/lib/generators/monorepo/index.js
+++ b/packages/pob/lib/generators/monorepo/index.js
@@ -18,6 +18,12 @@ const getAppTypes = (configs) => {
return [...appTypes];
};
+const hasDist = (configs) => {
+ return configs.some(
+ (config) => config && config.project && config.project.type === 'lib',
+ );
+};
+
module.exports = class PobMonorepoGenerator extends Generator {
constructor(args, opts) {
super(args, opts);
@@ -162,7 +168,10 @@ module.exports = class PobMonorepoGenerator extends Generator {
testing: this.pobLernaConfig.testing,
useYarn2: this.options.useYarn2,
appTypes: JSON.stringify(getAppTypes(this.packageConfigs)),
- ignorePaths: '',
+ ignorePaths:
+ this.pobLernaConfig.typescript && hasDist(this.packageConfigs)
+ ? '/dist'
+ : '',
});
this.composeWith(require.resolve('../lib/doc'), { | fix: missing dist prettierignore monorepo with lib | christophehurpeau_pob-lerna | train | js |
42dd2272de97076b66ab4e4948fc80989efa1cd6 | diff --git a/lib/writeexcel/workbook.rb b/lib/writeexcel/workbook.rb
index <HASH>..<HASH> 100644
--- a/lib/writeexcel/workbook.rb
+++ b/lib/writeexcel/workbook.rb
@@ -2972,8 +2972,8 @@ class Workbook < BIFFWriter
end
# Change length field of the first MSODRAWINGGROUP block. Case 2 and 3.
- tmp = data.dup
- tmp[0, limit + 4] = ""
+ tmp = data[0, limit + 4]
+ data[0, limit + 4] = ""
tmp[2, 2] = [limit].pack('v')
append(tmp) | * bug fix: endless loop when image size > <I>
in add_mso_drawing_group_continue(data)
this bug was found by Kyle's mail. thanks Kyle. | cxn03651_writeexcel | train | rb |
c91c28f2ff31dc1b528e096d743e1da2338fbe30 | diff --git a/face/geomajas-face-gwt/client/src/test/java/org/geomajas/gwt/client/map/MapViewTest.java b/face/geomajas-face-gwt/client/src/test/java/org/geomajas/gwt/client/map/MapViewTest.java
index <HASH>..<HASH> 100644
--- a/face/geomajas-face-gwt/client/src/test/java/org/geomajas/gwt/client/map/MapViewTest.java
+++ b/face/geomajas-face-gwt/client/src/test/java/org/geomajas/gwt/client/map/MapViewTest.java
@@ -86,7 +86,7 @@ public class MapViewTest {
// zoom out beyond maximum bounds
mapView.setCurrentScale(0.2, MapView.ZoomOption.LEVEL_CLOSEST);
// should zoom out as far as possible
- handler.expect(new Bbox(0, -50, 1000, 500), 0.2, false);
+ handler.expect(new Bbox(100, 0, 800, 400), 0.25, false);
// zoom in beyond maximum scale
mapView.setCurrentScale(3, MapView.ZoomOption.LEVEL_CLOSEST);
// should zoom in as far as possible | GWT-<I>: unit test was wrong | geomajas_geomajas-project-client-gwt2 | train | java |
1eafcd16988a8b9aca51ab0e1134841c79e5bfb8 | diff --git a/lib/protocol/Connection.js b/lib/protocol/Connection.js
index <HASH>..<HASH> 100644
--- a/lib/protocol/Connection.js
+++ b/lib/protocol/Connection.js
@@ -451,7 +451,7 @@ Connection.prototype.disconnect = function disconnect(cb) {
self.enqueue(request.disconnect(), done);
}
- if (this._queue.empty && !this._queue.busy) {
+ if (this.isIdle()) {
return enqueueDisconnect();
}
this._queue.once('drain', enqueueDisconnect);
@@ -558,7 +558,7 @@ Connection.prototype.close = function close() {
if (this.readyState === 'closed') {
return;
}
- if (this._queue.empty && !this._queue.busy) {
+ if (this.isIdle()) {
return closeConnection();
}
this._queue.once('drain', closeConnection);
@@ -570,6 +570,10 @@ Connection.prototype.destroy = function destroy(err) {
}
};
+Connection.prototype.isIdle = function isIdle() {
+ return this._queue.empty && !this._queue.busy;
+};
+
Connection.prototype.setAutoCommit = function setAutoCommit(autoCommit) {
this._transaction.autoCommit = autoCommit;
}; | Expose connection.IsIdle (#<I>) | SAP_node-hdb | train | js |
1f6f83fd933f923942590a9af867c55cdaf01639 | diff --git a/app/models/neighborly/balanced/payment.rb b/app/models/neighborly/balanced/payment.rb
index <HASH>..<HASH> 100644
--- a/app/models/neighborly/balanced/payment.rb
+++ b/app/models/neighborly/balanced/payment.rb
@@ -12,6 +12,10 @@ module Neighborly::Balanced
payment_choice: :creditcard)
end
+ def debit
+ @debit.try(:sanitize)
+ end
+
def successful?
%w(pending succeeded).include? @debit.try(:status)
end | Expose debit information through a hash on Payment class | FromUte_dune-balanced-creditcard | train | rb |
2bb4d3bc70c835ee163e144a218346160bc17b63 | diff --git a/cli/django.py b/cli/django.py
index <HASH>..<HASH> 100644
--- a/cli/django.py
+++ b/cli/django.py
@@ -11,18 +11,18 @@ app = typer.Typer()
@app.command()
def autoconfigure(
- repo_url: str,
+ repo_url: str = typer.Argument(..., help="url of remote git repository of your django project"),
domain_name: str = typer.Option(
"your-username.pythonanywhere.com",
"-d",
"--domain",
- help="Domain name, eg www.mydomain.com [default: your-username.pythonanywhere.com]",
+ help="Domain name, eg www.mydomain.com",
),
python_version: str = typer.Option(
"3.6",
"-p",
"--python-version",
- help="Python version, eg '3.8' [default: 3.6]",
+ help="Python version, eg '3.8'",
),
nuke: bool = typer.Option(
False, | #5 fixes autoconfigure django help strings as defaults are autogenerated | pythonanywhere_helper_scripts | train | py |
63870aae1ec60f3f0fb62e6bed39f42d23bc11dd | diff --git a/tests/test_decorators.py b/tests/test_decorators.py
index <HASH>..<HASH> 100644
--- a/tests/test_decorators.py
+++ b/tests/test_decorators.py
@@ -401,3 +401,13 @@ def test_cli_with_conflicting_short_options():
assert hug.test.cli(test) == ('Value', 'Value2')
assert hug.test.cli(test, abe1='hi', abe2='there') == ('hi', 'there')
+
+def test_cli_with_directives():
+ '''Test to ensure it's possible to use directives with hug CLIs'''
+ @hug.cli()
+ def test(hug_timer):
+ return float(hug_timer)
+
+ assert isinstance(test(), float)
+ assert test(hug_timer=4) == 4
+ assert isinstance(hug.test.cli(test), float) | Add test for directives in use with hug clis | hugapi_hug | train | py |
4cc24ad1e692afccc9aeb97d6eafca95f8c6becc | diff --git a/apiserver/facades/agent/instancemutater/interface.go b/apiserver/facades/agent/instancemutater/interface.go
index <HASH>..<HASH> 100644
--- a/apiserver/facades/agent/instancemutater/interface.go
+++ b/apiserver/facades/agent/instancemutater/interface.go
@@ -8,7 +8,6 @@ import (
"github.com/juju/charm/v8"
- "github.com/juju/juju/core/cache"
"github.com/juju/juju/core/instance"
"github.com/juju/juju/core/lxdprofile"
"github.com/juju/juju/core/status"
@@ -66,11 +65,3 @@ type Charm interface {
type Application interface {
CharmURL() *charm.URL
}
-
-// ModelCacheMachine represents a point of use Machine from the cache package.
-type ModelCacheMachine interface {
- ContainerType() instance.ContainerType
- IsManual() bool
- WatchLXDProfileVerificationNeeded() (cache.NotifyWatcher, error)
- WatchContainers() (cache.StringsWatcher, error)
-} | Remove unused interface ModelCacheMachine | juju_juju | train | go |
4d53dc7856e40e11ed1abdfb373d132e31179fd4 | diff --git a/src/Lib/Parser/SearchParse.php b/src/Lib/Parser/SearchParse.php
index <HASH>..<HASH> 100755
--- a/src/Lib/Parser/SearchParse.php
+++ b/src/Lib/Parser/SearchParse.php
@@ -58,7 +58,7 @@ class SearchParse extends TemplateParse
}
if (preg_match('~<meta property="og:description" content="(.*?)">~', $line, $this->matches)) {
- $result['description'] = $this->matches[1];
+ $result['description'] = utf8_encode(trim($this->matches[1]));
}
if (preg_match('~<span class="dark_text">Type:</span>~', $line)) { | fix odd utf8 issue with search item descriptions | jikan-me_jikan | train | php |
d5697d4c9527fb737d80d83ba9ae978679f999d4 | diff --git a/packages/idyll-document/src/utils/index.js b/packages/idyll-document/src/utils/index.js
index <HASH>..<HASH> 100644
--- a/packages/idyll-document/src/utils/index.js
+++ b/packages/idyll-document/src/utils/index.js
@@ -3,7 +3,7 @@ const entries = require('object.entries');
export const evalExpression = (acc, expr, key, context) => {
let e;
- if (key && (key.match(/on[A-Z].*/) || key.match(/handle[A-Z].*/))) {
+ if (key && (key.match(/^on[A-Z].*/) || key.match(/^handle[A-Z].*/))) {
let setState = setState;
e = `
(() => { | fix regexs for detecting keys that look like callbacks | idyll-lang_idyll | train | js |
a54dd491f0badb38ea8e34405e176fe1f1aecbf5 | diff --git a/uw_sws/section.py b/uw_sws/section.py
index <HASH>..<HASH> 100644
--- a/uw_sws/section.py
+++ b/uw_sws/section.py
@@ -282,7 +282,12 @@ def _json_to_section(section_data,
section.is_independent_study = False
section.class_website_url = section_data["ClassWebsiteUrl"]
- section.sln = section_data["SLN"]
+
+ if is_valid_sln(section_data["SLN"]):
+ section.sln = section_data["SLN"]
+ else:
+ section.sln = 0
+
if "SummerTerm" in section_data:
section.summer_term = section_data["SummerTerm"]
else: | set section.sln to 0 if the value is not valid | uw-it-aca_uw-restclients-sws | train | py |
d897956362fbb167715c8bf31b1489adc49654cc | diff --git a/src/Symfony/Component/Filesystem/Filesystem.php b/src/Symfony/Component/Filesystem/Filesystem.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/Filesystem/Filesystem.php
+++ b/src/Symfony/Component/Filesystem/Filesystem.php
@@ -301,10 +301,15 @@ class Filesystem
*/
public function symlink($originDir, $targetDir, $copyOnWindows = false)
{
- if ($copyOnWindows && !function_exists('symlink')) {
- $this->mirror($originDir, $targetDir);
+ if ('\\' === DIRECTORY_SEPARATOR) {
+ $originDir = strtr($originDir, '/', '\\');
+ $targetDir = strtr($targetDir, '/', '\\');
+
+ if ($copyOnWindows) {
+ $this->mirror($originDir, $targetDir);
- return;
+ return;
+ }
}
$this->mkdir(dirname($targetDir)); | Ensure backend slashes for symlinks on Windows systems
Resolves: #<I> | symfony_symfony | train | php |
4bfdc8956e8fe4c138bc3eedb6801c7f85ee8575 | diff --git a/zappa/core.py b/zappa/core.py
index <HASH>..<HASH> 100644
--- a/zappa/core.py
+++ b/zappa/core.py
@@ -397,7 +397,9 @@ class Zappa(object):
# Need to manually add setuptools
pkg_list.append('setuptools')
- pip.main(["install", "--quiet", "--target", venv_site_packages_dir] + pkg_list)
+ pip_return_code = pip.main(["install", "--quiet", "--target", venv_site_packages_dir] + pkg_list)
+ if pip_return_code:
+ raise EnvironmentError("Pypi lookup failed")
return ve_path | check pip return code
So we can stop deployment in case pip fails to lookup libraries. | Miserlou_Zappa | train | py |
fae3c12a5d0b61e4b11f156b2ea20d03b738f3ac | diff --git a/ipyrad/core/assembly.py b/ipyrad/core/assembly.py
index <HASH>..<HASH> 100644
--- a/ipyrad/core/assembly.py
+++ b/ipyrad/core/assembly.py
@@ -138,7 +138,7 @@ class Assembly(object):
nameordered = self.samples.keys()
nameordered.sort()
return pd.DataFrame([self.samples[i].stats for i in nameordered],
- index=nameordered)
+ index=nameordered).dropna( axis=1, how='all')
#dtype=[int, int, int, int, int, float, float, int]) | added a smidge of code to assemble.stats to dropna(axis=1, how='all') to
drop all columns (axis=1) where all results are NaN | dereneaton_ipyrad | train | py |
159c1e5e589c51b711a21a9c339a1880358c0d4d | diff --git a/ipyvolume/_version.py b/ipyvolume/_version.py
index <HASH>..<HASH> 100644
--- a/ipyvolume/_version.py
+++ b/ipyvolume/_version.py
@@ -1,6 +1,6 @@
-__version_tuple__ = (0, 6, 0, 'alpha.7')
-__version__ = '0.6.0-alpha.7'
+__version_tuple__ = (0, 6, 0, 'alpha.8')
+__version__ = '0.6.0-alpha.8'
__version_tuple_js__ = (0, 6, 0, 'alpha.7')
__version_js__ = '0.6.0-alpha.7'
# kept for embedding in offline mode, we don't care about the patch version since it should be compatible | 🔖 py <I>-alpha<I> released | maartenbreddels_ipyvolume | train | py |
d2ebd4d5dbf02660cea568b0f64c31caeaf1b12f | diff --git a/src/Iterator/Model.php b/src/Iterator/Model.php
index <HASH>..<HASH> 100755
--- a/src/Iterator/Model.php
+++ b/src/Iterator/Model.php
@@ -24,7 +24,7 @@ class Model extends \Mwyatt\Core\AbstractIterator implements \Mwyatt\Core\Iterat
*/
public function getIds()
{
- return $this->pluckUnique('id');
+ return $this->pluckUnique('id')->getArrayCopy();
}
@@ -48,7 +48,7 @@ class Model extends \Mwyatt\Core\AbstractIterator implements \Mwyatt\Core\Iterat
*/
public function extractProperty($property)
{
- return $this->pluck($property);
+ return $this->pluck($property)->getArrayCopy();
}
@@ -59,7 +59,13 @@ class Model extends \Mwyatt\Core\AbstractIterator implements \Mwyatt\Core\Iterat
*/
public function extractPropertyUnique($property)
{
- return $this->pluckUnique($property);
+ return $this->pluckUnique($property)->getArrayCopy();
+ }
+
+
+ public function getKeyedByProperty($property)
+ {
+ return parent::getKeyedByProperty($property)->getArrayCopy();
} | fix model iterator plugin to collection | mwyatt_core | train | php |
fbb6f6be1ef589298b27314d9e6ad92a01093641 | diff --git a/lib/will_paginate/view_helpers.rb b/lib/will_paginate/view_helpers.rb
index <HASH>..<HASH> 100644
--- a/lib/will_paginate/view_helpers.rb
+++ b/lib/will_paginate/view_helpers.rb
@@ -114,7 +114,8 @@ module WillPaginate
end
model_count = collection.total_pages > 1 ? 5 : collection.size
- model_name = will_paginate_translate "models.#{model_key}", :count => model_count do |_, opts|
+ defaults = ["models.#{model_key}"]
+ defaults << Proc.new { |_, opts|
if model.respond_to? :model_name
model.model_name.human(:count => opts[:count])
else
@@ -122,7 +123,8 @@ module WillPaginate
raise "can't pluralize model name: #{model.inspect}" unless name.respond_to? :pluralize
opts[:count] == 1 ? name : name.pluralize
end
- end
+ }
+ model_name = will_paginate_translate defaults, :count => model_count
if collection.total_pages < 2
i18n_key = :"page_entries_info.single_page#{html_key}" | i<I>n: fix model_name fallback for Rails | mislav_will_paginate | train | rb |
01c4425665bd30983197a22c4ce035cdfa821a3e | diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/internal/DefaultTempFolder.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/internal/DefaultTempFolder.java
index <HASH>..<HASH> 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/internal/DefaultTempFolder.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/internal/DefaultTempFolder.java
@@ -95,7 +95,7 @@ public class DefaultTempFolder implements TempFolder {
try {
Files.walkFileTree(tempDir.toPath(), DeleteRecursivelyFileVisitor.INSTANCE);
} catch (IOException e) {
- LOG.trace("Failed to delete temp folder", e);
+ LOG.error("Failed to delete temp folder", e);
}
} | SONAR-<I> fix log level when fail to delete temp directory | SonarSource_sonarqube | train | java |
1b8b34a04d3d3edc81497269db021b0812b0df74 | diff --git a/src/lib/Item.php b/src/lib/Item.php
index <HASH>..<HASH> 100644
--- a/src/lib/Item.php
+++ b/src/lib/Item.php
@@ -70,6 +70,16 @@ class Item extends NonSequentialIdModel
}
/**
+ * Return the time difference between 0 and the end of the duration.
+ *
+ * @return \DateInterval
+ */
+ public function getDuration()
+ {
+ return DateTime::createFromFormat('U', 0)->diff(DateTime::createFromFormat('U', $this->duration));
+ }
+
+ /**
* Return the highest bid amount placed.
*
* @return float | Added getDuration() method to Item model | hamjoint_mustard | train | php |
efcb8e5f19004159f111fb793ae831f551477bcd | diff --git a/lib/cave/form/builder.rb b/lib/cave/form/builder.rb
index <HASH>..<HASH> 100644
--- a/lib/cave/form/builder.rb
+++ b/lib/cave/form/builder.rb
@@ -27,12 +27,3 @@ class Cave::Form::Builder < ActionView::Helpers::FormBuilder
@template.content_tag 'div', raw, class: "control-group #{name} #{error_class}"
end
end
-
-module ActionView::Helpers::FormHelper
- def form_for record, options={}, &proc
- if record.is_a? Cave::Form
- options[:builder] ||= Cave::Form::Builder
- end
- super record, options, &proc
- end
-end
\ No newline at end of file | Don't monkey-patch form_for | jamesdabbs_cave | train | rb |
4b6f7909712ec87cb6cfa9a4617db19abfbbcc81 | diff --git a/lib/parser.js b/lib/parser.js
index <HASH>..<HASH> 100644
--- a/lib/parser.js
+++ b/lib/parser.js
@@ -199,11 +199,11 @@ exports.parse_calendar = function(data, timezone) {
var state = expect("BEGIN", "VCALENDAR", parse_component(calendar));
for(var i=0; i<data.length-1; ++i) {
- if(state === undefined)
- throw new ParseError("Mismatched BEGIN/END tags");
-
if(!data[i].length)
continue;
+
+ if(state === undefined)
+ throw new ParseError("Mismatched BEGIN/END tags");
// Peek ahead to find line continuations...
var j = i; | Be more tolerant of new lines when parsing.
No longer throws errors when empty blank lines are added to the end of a
vcalendar string to parse. | tritech_node-icalendar | train | js |
7d1b063406da62ada702fc7be7b134d96fb36a89 | diff --git a/services/visual_recognition/v3.js b/services/visual_recognition/v3.js
index <HASH>..<HASH> 100644
--- a/services/visual_recognition/v3.js
+++ b/services/visual_recognition/v3.js
@@ -110,7 +110,8 @@ module.exports = function (RED) {
});
});
});
- } // else
+
+
async.parallel(asyncTasks, function(error, deletedList){
if (deletedList.length===nbTodelete) {
msg.payload='see msg.result.error';
@@ -123,7 +124,10 @@ module.exports = function (RED) {
node.send(msg);
node.status({});
});
- });
+
+ } // else
+
+ }); // list classifiers
} // delete all func | refactor code for codacy... | watson-developer-cloud_node-red-node-watson | train | js |
be45024759571b31186d8ccf26a74cafa92b36d2 | diff --git a/src/system/modules/metamodels/MetaModelDatabase.php b/src/system/modules/metamodels/MetaModelDatabase.php
index <HASH>..<HASH> 100644
--- a/src/system/modules/metamodels/MetaModelDatabase.php
+++ b/src/system/modules/metamodels/MetaModelDatabase.php
@@ -481,6 +481,7 @@ class MetaModelDatabase extends Controller
if($field['sortable'])
{
$arrSorting[] = $field['field_attribute'];
+ $arrDCA['fields'][$field['field_attribute']]['sorting'] = true;
}
}
@@ -488,7 +489,7 @@ class MetaModelDatabase extends Controller
$arrDCA['list']['sorting']['fields'] = $arrSorting;
// Set Sorting panelLayout from current renderSettings
- $arrDCA['list']['sorting']['panelLayout'] .= $objMetaModelRenderSettings->get('panelLayout');
+ $arrDCA['list']['sorting']['panelLayout'] = $objMetaModelRenderSettings->get('panelLayout');
}
if (in_array($objMetaModel->get('mode'), array(3, 4, 6))) | Update panles and sorting for fields. | MetaModels_core | train | php |
b4978745e708457c7a0d20025bfcf1fef0d66f9e | diff --git a/Templates/default.blade.php b/Templates/default.blade.php
index <HASH>..<HASH> 100644
--- a/Templates/default.blade.php
+++ b/Templates/default.blade.php
@@ -79,18 +79,16 @@
</tbody>
</table>
<div style="clear:both; position:relative;">
- <div style="position:absolute; left:0pt; width:250pt;">
- <h4>Notes:</h4>
- <div class="panel panel-default">
- <div class="panel-body">
- @if($invoice->notes)
+ @if($invoice->notes)
+ <div style="position:absolute; left:0pt; width:250pt;">
+ <h4>Notes:</h4>
+ <div class="panel panel-default">
+ <div class="panel-body">
{{ $invoice->notes }}
- @else
-
- @endif
+ </div>
</div>
</div>
- </div>
+ @endif
<div style="margin-left: 300pt;">
<h4>Total:</h4>
<table class="table table-bordered"> | Hide notes if no notes
Rather than displaying an empty notes box, this hides the notes box completely if there are no notes. | ConsoleTVs_Invoices | train | php |
84f84e10c83023a7015ac1368b0141b4e8dfbf3d | diff --git a/categories/settings.py b/categories/settings.py
index <HASH>..<HASH> 100644
--- a/categories/settings.py
+++ b/categories/settings.py
@@ -5,7 +5,7 @@ from django.db.models import Q
DEFAULT_SETTINGS = {
'ALLOW_SLUG_CHANGE': False,
- 'CACHE_VIEW_LENGTH': 0,
+ 'CACHE_VIEW_LENGTH': 600,
'RELATION_MODELS': [],
'M2M_REGISTRY': {},
'FK_REGISTRY': {}, | Updated the default view caching to <I>, which is the django default instead of forcing the views to NEVER cache at all. | callowayproject_django-categories | train | py |
19ab1e9984763ad5590837c5dcd1f68a83ab89db | diff --git a/apps/staging_log_test.go b/apps/staging_log_test.go
index <HASH>..<HASH> 100644
--- a/apps/staging_log_test.go
+++ b/apps/staging_log_test.go
@@ -20,7 +20,7 @@ var _ = Describe("An application being staged", func() {
It("has its staging log streamed during a push", func() {
push := Cf("push", AppName, "-p", doraPath)
- Expect(push).To(Say("Installing dependencies"))
+ // Expect(push).To(Say("Installing dependencies"))
Expect(push).To(Say("Uploading droplet"))
Expect(push).To(Say("App started"))
}) | Disable check that fails due to known race condition
This should be enabled as part of [#<I>] | cloudfoundry_cf-acceptance-tests | train | go |
64d2b3c872b3c0c5270f2cc701c02fd2bf42c1fa | diff --git a/achilles-cql/src/main/java/info/archinnov/achilles/embedded/CQLEmbeddedServer.java b/achilles-cql/src/main/java/info/archinnov/achilles/embedded/CQLEmbeddedServer.java
index <HASH>..<HASH> 100644
--- a/achilles-cql/src/main/java/info/archinnov/achilles/embedded/CQLEmbeddedServer.java
+++ b/achilles-cql/src/main/java/info/archinnov/achilles/embedded/CQLEmbeddedServer.java
@@ -80,7 +80,7 @@ public class CQLEmbeddedServer extends AchillesEmbeddedServer {
&& cassandraHost.contains(":")) {
String[] split = cassandraHost.split(":");
configMap.put(CONNECTION_CONTACT_POINTS_PARAM, split[0]);
- configMap.put(CONNECTION_PORT_PARAM, split[1]);
+ configMap.put(CONNECTION_PORT_PARAM, Integer.parseInt(split[1]));
} else {
createAchillesKeyspace(keyspaceName);
configMap.put(CONNECTION_CONTACT_POINTS_PARAM, CASSANDRA_TEST_HOST); | Fixes Class cast exception when parsing String as integer | doanduyhai_Achilles | train | java |
f7f8f4589fc3e511c6167da6605ac379fd00de41 | diff --git a/src/utils/Slide/index.js b/src/utils/Slide/index.js
index <HASH>..<HASH> 100644
--- a/src/utils/Slide/index.js
+++ b/src/utils/Slide/index.js
@@ -143,6 +143,9 @@ class Slide extends React.Component<Props, State> {
id={id}
aria-labelledby={ariaLabelledBy}
visible={visible}
+ onClick={ev => {
+ ev.stopPropagation();
+ }}
>
{children}
</StyledSlide> | FIX: Slide onClick propagation (#<I>) | kiwicom_orbit-components | train | js |
c8fb2322341cbd90cab8948cee29e15b1582090e | diff --git a/src/PhantomInstaller/Installer.php b/src/PhantomInstaller/Installer.php
index <HASH>..<HASH> 100644
--- a/src/PhantomInstaller/Installer.php
+++ b/src/PhantomInstaller/Installer.php
@@ -275,7 +275,7 @@ class Installer
if ($os !== 'unknown') {
copy($targetDir . $sourceName, $targetName);
- chmod($targetName, self::PHANTOMJS_CHMODE);
+ chmod($targetName, static::PHANTOMJS_CHMODE);
}
self::dropClassWithPathToInstalledBinary($targetName); | use static to access chmod constant
to allow override via extending class | jakoch_phantomjs-installer | train | php |
9f2224faf1830f70a96e42ec0fecd7bd2cc38269 | diff --git a/packages/tree-view/src/TreeItem.js b/packages/tree-view/src/TreeItem.js
index <HASH>..<HASH> 100644
--- a/packages/tree-view/src/TreeItem.js
+++ b/packages/tree-view/src/TreeItem.js
@@ -10,11 +10,9 @@ const TreeItem = props => {
collapsed,
defaultCollapsed,
expandByDoubleClick,
- getKeyboardOpenId,
icon,
id,
label,
- setKeyboardOpenId,
stylesheet,
...otherProps
} = props;
@@ -22,9 +20,11 @@ const TreeItem = props => {
defaultSelected,
getActiveTreeItemId,
getCurrentItemClicked,
+ getKeyboardOpenId,
isControlled,
onFocus,
- selected
+ selected,
+ setKeyboardOpenId
} = otherProps;
const getActiveId = () => {
if (isControlled()) { | refactor: switch internal props to ...otherProps | Autodesk_hig | train | js |
a09cc6e957487e4685b9378a19e4100f6049e7de | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -23,6 +23,7 @@ module.exports = function (grunt) {
compress: {
drop_console: true
},
+ mangle: false,
preserveComments: false
},
build: {
@@ -39,7 +40,7 @@ module.exports = function (grunt) {
description: '<%= pkg.description %>',
url: '<%= pkg.url %>',
options: {
- outdir: './docs',
+ outdir: './docs/latest',
linkNatives: true,
paths: ['./src/']
} | The packaging process no longer mangles function names. | djipco_webmidi | train | js |
61398aafc5af07c8b0ce813106dbd1f48c844b8e | diff --git a/input/tangy-photo-capture.js b/input/tangy-photo-capture.js
index <HASH>..<HASH> 100644
--- a/input/tangy-photo-capture.js
+++ b/input/tangy-photo-capture.js
@@ -171,7 +171,7 @@ export class TangyPhotoCapture extends PolymerElement {
clear: t('clear')
}
// Start streaming video
- navigator.mediaDevices.getUserMedia({video: true})
+ navigator.mediaDevices.getUserMedia({video: { facingMode: { exact: "environment" } }})
.then(mediaStream => {
this.shadowRoot.querySelector('video').srcObject = mediaStream;
const track = mediaStream.getVideoTracks()[0]; | preset rear camera for tangy-photo-capture | Tangerine-Community_tangy-form | train | js |
2f757543e28dc79726399086a5bab2ace8cd7bf0 | diff --git a/tabular_predDB/binary_creation/setup.py b/tabular_predDB/binary_creation/setup.py
index <HASH>..<HASH> 100644
--- a/tabular_predDB/binary_creation/setup.py
+++ b/tabular_predDB/binary_creation/setup.py
@@ -17,9 +17,9 @@ includes = [
'tabular_predDB.LocalEngine',
'tabular_predDB.cython_code.State',
'numpy',
- # 'tabular_predDB.python_utils.plot_utils',
- # 'pylab',
- # 'matplotlib.backends.backend_qt4agg',
+ 'tabular_predDB.python_utils.plot_utils',
+ 'pylab',
+ 'matplotlib.backends.backend_qt4agg',
]
buildOptions = dict( | BUGFIX: uncomment includes, else running fails on import error | probcomp_crosscat | train | py |
517d1993555562a4451fc32863f6a2b31ce4ad80 | diff --git a/rut/src/test/java/io/norberg/rut/RadixTrieTest.java b/rut/src/test/java/io/norberg/rut/RadixTrieTest.java
index <HASH>..<HASH> 100644
--- a/rut/src/test/java/io/norberg/rut/RadixTrieTest.java
+++ b/rut/src/test/java/io/norberg/rut/RadixTrieTest.java
@@ -186,6 +186,17 @@ public class RadixTrieTest {
assertThat(captor.isMatch(), is(false));
}
+ @Test
+ public void testEndAtSplitDoesNotMatch() {
+ RadixTrie<String> rdx = RadixTrie.builder(String.class)
+ .insert("a1", "a1")
+ .insert("a2", "a2")
+ .build();
+ final RadixTrie.Captor captor = rdx.captor();
+ assertThat(rdx.lookup("a", captor), is(nullValue()));
+ assertThat(captor.isMatch(), is(false));
+ }
+
@Test(expected = IllegalArgumentException.class)
public void verifyUnclosedCaptureFails() {
RadixTrie.builder(String.class) | failing test for rdx early path end bug | danielnorberg_rut | train | java |
4f5300003c3a56c286b76729a2a40378ca9bf5f2 | diff --git a/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol3.java b/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol3.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol3.java
+++ b/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol3.java
@@ -137,7 +137,6 @@ public class JnlpSlaveAgentProtocol3 extends AgentProtocol {
/**
* Flag to control the activation of JNLP3 protocol.
- * This feature is being A/B tested right now.
*
* <p>
* Once this will be on by default, the flag and this field will disappear. The system property is
@@ -151,11 +150,8 @@ public class JnlpSlaveAgentProtocol3 extends AgentProtocol {
static {
forceEnabled = SystemProperties.optBoolean(JnlpSlaveAgentProtocol3.class.getName() + ".enabled");
- if (forceEnabled != null)
+ if (forceEnabled != null) {
ENABLED = forceEnabled;
- else {
- byte hash = Util.fromHexString(Jenkins.getActiveInstance().getLegacyInstanceId())[0];
- ENABLED = (hash%10)==0;
}
}
} | [JENKINS-<I>] Stop A/B testing JNLP3 | jenkinsci_jenkins | train | java |
3ca6d0ef9ad6d7c21f252c390674907952f653ee | diff --git a/views/js/qtiCreator/helper/xincludeRenderer.js b/views/js/qtiCreator/helper/xincludeRenderer.js
index <HASH>..<HASH> 100644
--- a/views/js/qtiCreator/helper/xincludeRenderer.js
+++ b/views/js/qtiCreator/helper/xincludeRenderer.js
@@ -74,7 +74,7 @@ define([
//reload the wiget to rfresh the rendering with the new href
xincludeWidget.refresh();
}, loadedClasses);
- _.each(xincludeHandlers, handler => handler(xinclude.attr('href'), className));
+ _.each(xincludeHandlers, handler => handler(xinclude.attr('href'), className, xi.serial));
} else {
//loading failure :
xinclude.removeAttr('href'); | fix: fix passage css format on Items | oat-sa_extension-tao-itemqti | train | js |
da992961cb66b3468b8ad572cfdc2d615e0b6a71 | diff --git a/lib/cinch/version.rb b/lib/cinch/version.rb
index <HASH>..<HASH> 100644
--- a/lib/cinch/version.rb
+++ b/lib/cinch/version.rb
@@ -1,3 +1,4 @@
module Cinch
+ # Version of the library
VERSION = '2.0.0'
end | document Cinch::Version constant | cinchrb_cinch | train | rb |
464aa7762b866e067d1a3108a14e58d41c1a3bbd | diff --git a/satpy/tests/writer_tests/test_ninjogeotiff.py b/satpy/tests/writer_tests/test_ninjogeotiff.py
index <HASH>..<HASH> 100644
--- a/satpy/tests/writer_tests/test_ninjogeotiff.py
+++ b/satpy/tests/writer_tests/test_ninjogeotiff.py
@@ -904,3 +904,17 @@ def test_create_unknown_tags(test_image_small_arctic_P):
PhysicValue="N/A",
SatelliteNameID=6500014,
Locatie="Hozomeen")
+
+
+def test_str_ids(test_image_small_arctic_P):
+ """Test that channel and satellit IDs can be str."""
+ from satpy.writers.ninjogeotiff import NinJoTagGenerator
+ NinJoTagGenerator(
+ test_image_small_arctic_P,
+ 42,
+ "quorn.tif",
+ ChannelID="la manche",
+ DataType="GPRN",
+ PhysicUnit="N/A",
+ PhysicValue="N/A",
+ SatelliteNameID="trollsat") | Added test to confirm string IDs are accepted.
On the side of NinJo there exists an interest to move from numerical IDs
to string IDs for the satellite and channel IDs in the ninjogeotiff
headers. The ninjogeotiff writer has no objection to this. Confirm
this no-objection with a unit test. | pytroll_satpy | train | py |
c3abd598a507c63bbfb4ddac5824aa2aa5f73508 | diff --git a/test/performance/benchmark_server.js b/test/performance/benchmark_server.js
index <HASH>..<HASH> 100644
--- a/test/performance/benchmark_server.js
+++ b/test/performance/benchmark_server.js
@@ -44,10 +44,10 @@ var serviceProto = grpc.loadPackageDefinition(protoPackage).grpc.testing;
/**
* Create a buffer filled with size zeroes
* @param {number} size The length of the buffer
- * @return {Buffer} The Buffer.from
+ * @return {Buffer} The New Buffer
*/
function zeroBuffer(size) {
- var zeros = Buffer.from(size);
+ var zeros = Buffer.alloc(size);
zeros.fill(0);
return zeros;
} | replace usage of Buffer.from with Buffer.alloc | grpc_grpc-node | train | js |
2c186cd02ecc4360489748d8cf203f16c36bd4e2 | diff --git a/lib/components/form/settings-selector-panel.js b/lib/components/form/settings-selector-panel.js
index <HASH>..<HASH> 100644
--- a/lib/components/form/settings-selector-panel.js
+++ b/lib/components/form/settings-selector-panel.js
@@ -208,13 +208,13 @@ class SettingsSelectorPanel extends Component {
{/* The transit mode selected */}
{hasTransit(mode) && (<div style={{ marginBottom: 16 }}>
<div className='setting-label'>Use</div>
- <div style={{ textAlign: 'right' }}>
+ <div style={{ textAlign: 'left' }}>
{transitModes.map((mode, k) => {
let classNames = ['select-button']
if (this._modeIsActive(mode)) classNames.push('active')
return <Button key={mode.mode}
className={classNames.join(' ')}
- style={{ marginTop: 3, marginBottom: 3 }}
+ style={{ marginTop: 3, marginBottom: 3, marginLeft: 0, marginRight: 5 }}
onClick={() => this._toggleTransitMode(mode)}
>
<div | feat(form): Change styling/alignment of mode selection buttons | opentripplanner_otp-react-redux | train | js |
176d80cfe25d42e68f6f5748fdb874f9dbb1a2c1 | diff --git a/lib/monitor.js b/lib/monitor.js
index <HASH>..<HASH> 100644
--- a/lib/monitor.js
+++ b/lib/monitor.js
@@ -47,7 +47,7 @@ ReqCounter.prototype.registerEvents = function (server) {
server.emit = function () {
var args = arguments;
if (args[0] !== 'connection' && args[0] !== 'request') {
- origEmit.apply(server, arguments);
+ origEmit.apply(this, arguments);
return;
}
@@ -65,7 +65,7 @@ ReqCounter.prototype.registerEvents = function (server) {
if (data && data.length) {
that._transfered += data.length;
}
- origWrite.apply(stream, arguments);
+ origWrite.apply(this, arguments);
};
stream.on('close', function () {
@@ -103,7 +103,7 @@ ReqCounter.prototype.registerEvents = function (server) {
};
/*jslint plusplus:true*/
}
- origEmit.apply(server, arguments);
+ origEmit.apply(this, arguments);
};
}; | Fix stream.write() and server.emit() overrides to call the original
methods with the correct this context.
Contributed on behalf of Box Inc. | yahoo_monitr | train | js |
ae37e12f385e576009a26b7917466e653845c135 | diff --git a/scripts/update-to-master.php b/scripts/update-to-master.php
index <HASH>..<HASH> 100644
--- a/scripts/update-to-master.php
+++ b/scripts/update-to-master.php
@@ -82,8 +82,8 @@ deleteCacheFolder('cache/trl');
$c = file(".gitignore", FILE_IGNORE_NEW_LINES);
$c[] = '/build';
$c[] = '/vendor';
-$c[] = 'bower.json';
-$c[] = '.bowerrc';
+$c[] = '/bower.json';
+$c[] = '/.bowerrc';
$c = array_filter($c); //remove empty lines
$c = array_unique($c);
file_put_contents('.gitignore', implode("\n", $c)."\n"); | specify gitignore path with / so our sync doesn't use this isgnore in subfolders | koala-framework_koala-framework | train | php |
849888e7ff8ecaab8f8b63dbf9094b9303017883 | diff --git a/lib/active_record/transitions.rb b/lib/active_record/transitions.rb
index <HASH>..<HASH> 100644
--- a/lib/active_record/transitions.rb
+++ b/lib/active_record/transitions.rb
@@ -26,7 +26,7 @@ module ActiveRecord
included do
include ::Transitions
- before_validation :set_initial_state
+ after_initialize :set_initial_state
validates_presence_of :state
validate :state_inclusion
end
diff --git a/test/test_active_record.rb b/test/test_active_record.rb
index <HASH>..<HASH> 100644
--- a/test/test_active_record.rb
+++ b/test/test_active_record.rb
@@ -3,7 +3,7 @@ require 'active_support/core_ext/module/aliasing'
class CreateTrafficLights < ActiveRecord::Migration
def self.up
- create_table(:traffic_lights) do |t|
+ create_table(:traffic_lights) do |t|
t.string :state
t.string :name
end
@@ -59,6 +59,11 @@ class TestActiveRecord < Test::Unit::TestCase
@light = TrafficLight.create!
end
+ test "new record has the initial state set" do
+ @light = TrafficLight.new
+ assert_equal "off", @light.state
+ end
+
test "states initial state" do
assert @light.off?
assert_equal :off, @light.current_state | New records have their state set after initialization
Initial state was set using before_validation, which resulted in a nil state
for new records. Instead of using the before_validate hook, use the
after_initialize hook to make sure the state is properly set. | troessner_transitions | train | rb,rb |
1698c89a4941f5f88f3b6fe358b0d058a864e5ee | diff --git a/django_mako_plus/__init__.py b/django_mako_plus/__init__.py
index <HASH>..<HASH> 100644
--- a/django_mako_plus/__init__.py
+++ b/django_mako_plus/__init__.py
@@ -5,5 +5,5 @@
# The version of DMP - used by sdist to publish to PyPI
-__version__ = '2.4.7'
+__version__ = '2.4.8' | fixed a versioning error again. last one had issues. | doconix_django-mako-plus | train | py |
0cce7acd70c1cb7df3b447c982a6e83313fd6b0d | diff --git a/ecs-init/docker/docker.go b/ecs-init/docker/docker.go
index <HASH>..<HASH> 100644
--- a/ecs-init/docker/docker.go
+++ b/ecs-init/docker/docker.go
@@ -53,6 +53,10 @@ const (
// maxRetries specifies the maximum number of retries for ping to return
// a successful response from the docker socket
maxRetries = 5
+ // CAP_NET_ADMIN to start agent
+ // For more information on capabilities, please read this manpage:
+ // http://man7.org/linux/man-pages/man7/capabilities.7.html
+ CAP_NET_ADMIN = "NET_ADMIN"
)
// Client enables business logic for running the Agent inside Docker
@@ -228,6 +232,7 @@ func (c *Client) getHostConfig() *godocker.HostConfig {
Binds: binds,
NetworkMode: networkMode,
UsernsMode: usernsMode,
+ CapAdd: []string{CAP_NET_ADMIN},
}
} | Adding CAP_NET_ADMIN for starting agent | aws_amazon-ecs-agent | train | go |
fd0832d9fa93cabe9ce9a9153dc923f2cf39cb5f | diff --git a/losser/losser.py b/losser/losser.py
index <HASH>..<HASH> 100644
--- a/losser/losser.py
+++ b/losser/losser.py
@@ -51,8 +51,16 @@ def _write_csv(f, table_):
``f`` could be an opened file, sys.stdout, or a StringIO.
"""
- # We assume that each dict in the list has the same keys.
fieldnames = table_[0].keys()
+ set_fieldname = set(table_[0].keys())
+ # go through all the fields and find all the field names
+ for row in table_:
+ set_fieldname.update(set(row.keys()))
+
+ # append the additonal fields sorted onto the end
+ additional_fields = sorted(set_fieldname - set(table_[0].keys()))
+ fieldnames += additional_fields
+
writer = unicodecsv.DictWriter(f, fieldnames, encoding='utf-8')
writer.writeheader() | when writing to csv, go through all rows keys first to determine headers | ckan_losser | train | py |
716ba7915302c5badf0d41018a3369fd65869916 | diff --git a/pagoda/cooper.py b/pagoda/cooper.py
index <HASH>..<HASH> 100644
--- a/pagoda/cooper.py
+++ b/pagoda/cooper.py
@@ -131,11 +131,8 @@ class Markers:
with open(filename, 'rb') as handle:
reader = c3d.Reader(handle)
- # make sure the c3d file's frame rate matches our world.
- assert self.world.dt == 1. / reader.frame_rate()
-
# set up a map from marker label to index in the data stream.
- labels = [s.strip() for s in reader.point_labels()]
+ labels = [s.strip() for s in reader.point_labels]
logging.info('%s: loaded marker labels %s', filename, labels)
self.channels = self._interpret_channels(labels) | Move to newer version of c3d module. | EmbodiedCognition_pagoda | train | py |
a7c89d5b65df2486ccf78f43fcffdc18dff76bd7 | diff --git a/tests/parsers/test_gherkinlint.py b/tests/parsers/test_gherkinlint.py
index <HASH>..<HASH> 100644
--- a/tests/parsers/test_gherkinlint.py
+++ b/tests/parsers/test_gherkinlint.py
@@ -5,18 +5,18 @@ from __future__ import unicode_literals
import codecs
import os.path
-import inlineplz.parsers.gherkinlint as gherkin_lint
+import inlineplz.parsers.gherkinlint as gherkinlint
-gherkin_lint_path = os.path.join(
+gherkinlint_path = os.path.join(
'tests',
'testdata',
'parsers',
'gherkin-lint.txt'
)
-def test_eslint():
- with codecs.open(gherkin_lint_path, encoding='utf-8', errors='replace') as inputfile:
- messages = sorted(list(gherkin_lint.GherkinLintParser().parse(inputfile.read())))
+def test_gherkinlint():
+ with codecs.open(gherkinlint_path, encoding='utf-8', errors='replace') as inputfile:
+ messages = sorted(list(gherkinlint.GherkinLintParser().parse(inputfile.read())))
print (messages)
assert messages[0][2] == 'Feature name is already used in: features/fake.feature'
assert messages[0][1] == 1 | fixing typo and making the gherkin-lint python-acceptable alias more consistent (#<I>) | guykisel_inline-plz | train | py |
773157f108b17130ea4877796b808ca23d263001 | diff --git a/service/http/service.go b/service/http/service.go
index <HASH>..<HASH> 100644
--- a/service/http/service.go
+++ b/service/http/service.go
@@ -9,6 +9,7 @@ import (
"github.com/spiral/roadrunner/service/rpc"
"github.com/spiral/roadrunner/util"
"golang.org/x/net/http2"
+ "golang.org/x/net/http2/h2c"
"net/http"
"net/http/fcgi"
"net/url"
@@ -99,7 +100,13 @@ func (s *Service) Serve() error {
s.handler.Listen(s.throw)
if s.cfg.EnableHTTP() {
- s.http = &http.Server{Addr: s.cfg.Address, Handler: s}
+ var h2s *http2.Server
+ if s.cfg.EnableHTTP2() && !s.cfg.EnableTLS() {
+ h2s = &http2.Server{}
+ s.http = &http.Server{Addr: s.cfg.Address, Handler: h2c.NewHandler(s, h2s)}
+ } else {
+ s.http = &http.Server{Addr: s.cfg.Address, Handler: s}
+ }
}
if s.cfg.EnableTLS() { | Attempt to add h2c handling (http2 w/o ssl) | spiral_roadrunner | train | go |
33a41f002718b662e02d3e7c49b37d8a79ae1c42 | diff --git a/lib/rbbt/rest/common/users.rb b/lib/rbbt/rest/common/users.rb
index <HASH>..<HASH> 100644
--- a/lib/rbbt/rest/common/users.rb
+++ b/lib/rbbt/rest/common/users.rb
@@ -15,7 +15,7 @@ module Sinatra
target_url = request.env["REQUEST_URI"]
Log.warn{ "Unauthorized access to #{target_url}" }
session[:target_url] = target_url
- redirect '/login'
+ redirect to('/login')
end
def logout!
@@ -59,20 +59,20 @@ module Sinatra
session[:user] = user
if session[:target_url]
url = session.delete :target_url
- redirect url
+ redirect to(url)
else
- redirect '/'
+ redirect to('/')
end
else
Log.warn{ "Failed login attempt #{[user, pass] * ": "}" }
session[:user] = nil
- redirect '/login'
+ redirect to('/login')
end
end
app.get '/logout' do
session[:user] = nil
- redirect '/'
+ redirect to('/')
end
end
end | Fix: redirect -> redirect to(...) | mikisvaz_rbbt-rest | train | rb |
e575a386660a73010d3008d0d2f9845f9a9dc2f6 | diff --git a/node.js b/node.js
index <HASH>..<HASH> 100644
--- a/node.js
+++ b/node.js
@@ -109,7 +109,7 @@ var server = connect.createServer(
);
// bind the server to a port, choose your port:
-server.listen(8080); // 80 is the default web port and 443 for TLS
+server.listen(80); // 80 is the default web port and 443 for TLS
// Your server is running :-)
console.log('Node server is running!'); | changed default port back to <I>; | h5bp_server-configs-node | train | js |
731d5f6c15a6c7009eb2eebd6c294223fd3b95df | diff --git a/src/ox_modules/module-web.js b/src/ox_modules/module-web.js
index <HASH>..<HASH> 100644
--- a/src/ox_modules/module-web.js
+++ b/src/ox_modules/module-web.js
@@ -249,10 +249,11 @@ export default class WebModule extends WebDriverModule {
}
// maximize browser window
try {
- if (this.driver.capabilities.browserName === 'MicrosoftEdge') {
+ if (['MicrosoftEdge', 'msedge'].includes(this.driver.capabilities.browserName)) {
// FIXME: this should be refactored
// ignore
// fails on lambdatest
+ // fails on browserstack sometimes
} else {
await this.driver.maximizeWindow();
await this.driver.setTimeout({ 'implicit': this.waitForTimeout }); | CBS-<I> UNKNOWN_ERROR at web.init() using EDGE on browserstack (#<I>) | oxygenhq_oxygen | train | js |
7db47660cf50dbac05be190c9a2c79664ea09283 | diff --git a/pylatex/utils.py b/pylatex/utils.py
index <HASH>..<HASH> 100644
--- a/pylatex/utils.py
+++ b/pylatex/utils.py
@@ -186,7 +186,8 @@ def dumps_list(l, *, escape=True, token='%\n', mapper=None, as_content=True):
mapper = [mapper]
for m in mapper:
- strings = map(lambda x: _latex_item_to_string(m(x)), strings)
+ strings = [m(s) for s in strings]
+ strings = [_latex_item_to_string(s) for s in strings]
return NoEscape(token.join(strings)) | Change fix for #<I> a bit to work for lists of mappers | JelteF_PyLaTeX | train | py |
43e49cb4efe8c21d0444d489ea73f7628441dc94 | diff --git a/public/js/date-range-picker.js b/public/js/date-range-picker.js
index <HASH>..<HASH> 100644
--- a/public/js/date-range-picker.js
+++ b/public/js/date-range-picker.js
@@ -2,7 +2,7 @@ define([
'comps/moment/min/moment.min',
'plugins/admin/libs/bootstrap-daterangepicker/daterangepicker',
'css!plugins/admin/libs/bootstrap-daterangepicker/daterangepicker-bs3'
-], function (moment) {
+], function () {
var now = moment();
var defaults = {
startDate: moment().subtract(29, 'days'), | refactoring: 解决moment = undefined 通过全局获取 | miaoxing_admin | train | js |
d2427a924cee4c8d0b4a0db7712890dd75ddc649 | diff --git a/catalog/app/components/JsonEditor/Input.js b/catalog/app/components/JsonEditor/Input.js
index <HASH>..<HASH> 100644
--- a/catalog/app/components/JsonEditor/Input.js
+++ b/catalog/app/components/JsonEditor/Input.js
@@ -73,6 +73,8 @@ function hasBrackets(valueStr) {
)
}
+const willBeNullInJson = (value) => typeof value === 'number' && !Number.isFinite(value)
+
export default function Input({
columnId,
data,
@@ -113,12 +115,11 @@ export default function Input({
)
const onBlur = React.useCallback(() => {
- if (columnId !== COLUMN_IDS.KEY || R.is(String, value)) {
- onChange(value)
- } else {
- onChange(JSON.stringify(value))
- }
- }, [onChange, columnId, value])
+ if (R.is(String, value)) return onChange(value)
+ if (columnId === COLUMN_IDS.KEY) return onChange(valueStr)
+ if (willBeNullInJson(value)) return onChange(null)
+ return onChange(value)
+ }, [onChange, columnId, value, valueStr])
const onKeyDown = React.useCallback(
(event) => { | handle Infinity (#<I>) | quiltdata_quilt | train | js |
0b0dda49b0a0246f562fbd4d90300dcc07953341 | diff --git a/lib/engineyard-serverside/configuration.rb b/lib/engineyard-serverside/configuration.rb
index <HASH>..<HASH> 100644
--- a/lib/engineyard-serverside/configuration.rb
+++ b/lib/engineyard-serverside/configuration.rb
@@ -227,11 +227,11 @@ module EY
end
def precompile_assets?
- precompile_assets == true
+ precompile_assets == true || precompile_assets == "true"
end
def skip_precompile_assets?
- precompile_assets == false
+ precompile_assets == false || precompile_assets == "false"
end
# Assume downtime required if stack is not specified (nil) just in case. | Account for String command line option precompile_assets.
This would normally be made a def_boolean_option, but we rely
on having a 'not set' setting, nil, which tells us to smartly
detect if assets need compilation. Checking for string 'true'
solves the issue. | engineyard_engineyard-serverside | train | rb |
8880233578f92fe478755c1bbb8309748eeeee65 | diff --git a/pyinstrument/renderers/speedscope.py b/pyinstrument/renderers/speedscope.py
index <HASH>..<HASH> 100644
--- a/pyinstrument/renderers/speedscope.py
+++ b/pyinstrument/renderers/speedscope.py
@@ -196,7 +196,9 @@ class SpeedscopeRenderer(Renderer):
def render(self, session: Session):
frame = self.preprocess(session.root_frame())
- sprofile = SpeedscopeProfile(session.program,
+ id_: str = time.strftime("%Y-%m-%dT%H-%M-%S", time.localtime(session.start_time))
+ name: str = "CPU profile for {} at {}".format(session.program, id_)
+ sprofile = SpeedscopeProfile(name,
self.render_frame(frame),
session.duration)
@@ -206,8 +208,6 @@ class SpeedscopeRenderer(Renderer):
sframe_list: list[SpeedscopeFrame] = [
sframe for sframe in iter(self._frame_to_index)]
- id_: str = time.strftime("%Y-%m-%dT%H-%M-%S", time.localtime(session.start_time))
- name: str = "CPU profile for {} at {}".format(session.program, id_)
shared_dict = {"frames": sframe_list}
speedscope_file = SpeedscopeFile(name, [sprofile], shared_dict) | SpeedscopeRenderer: make profile title informative
This commit modifies the display title of a speedscope profile
exported from pyinstrument to include the timestamp of when the
profile was generated (which also happens to be argument to
`--load-prev` needed to render output in other formats). | joerick_pyinstrument | train | py |
e093702fc30c44fe96735582e680492e02f55193 | diff --git a/nodeup/pkg/model/secrets.go b/nodeup/pkg/model/secrets.go
index <HASH>..<HASH> 100644
--- a/nodeup/pkg/model/secrets.go
+++ b/nodeup/pkg/model/secrets.go
@@ -60,19 +60,17 @@ func (b *SecretBuilder) Build(c *fi.ModelBuilderContext) error {
if b.SecretStore != nil {
key := "dockerconfig"
- dockercfg, err := b.SecretStore.Secret(key)
- if err != nil {
- return err
- }
- contents := string(dockercfg.Data)
-
- t := &nodetasks.File{
- Path: filepath.Join("root", ".docker", "config.json"),
- Contents: fi.NewStringResource(contents),
- Type: nodetasks.FileType_File,
- Mode: s("0600"),
+ dockercfg, _ := b.SecretStore.Secret(key)
+ if dockercfg != nil {
+ contents := string(dockercfg.Data)
+ t := &nodetasks.File{
+ Path: filepath.Join("root", ".docker", "config.json"),
+ Contents: fi.NewStringResource(contents),
+ Type: nodetasks.FileType_File,
+ Mode: s("0600"),
+ }
+ c.AddTask(t)
}
- c.AddTask(t)
}
// if we are not a master we can stop here | Don't error if the dockerconfig isn't present | kubernetes_kops | train | go |
b83567a55ac3eeb78dc728f8f32a34b51717baa9 | diff --git a/openquake/calculators/tests/ucerf_event_based_test.py b/openquake/calculators/tests/ucerf_event_based_test.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/tests/ucerf_event_based_test.py
+++ b/openquake/calculators/tests/ucerf_event_based_test.py
@@ -16,13 +16,16 @@
# You should have received a copy of the GNU Affero General Public License
# along with OpenQuake. If not, see <http://www.gnu.org/licenses/>.
+import h5py
+import unittest
from openquake.qa_tests_data import ucerf
-from openquake.calculators.tests import CalculatorTestCase, check_platform
+from openquake.calculators.tests import CalculatorTestCase
class UcerfTestCase(CalculatorTestCase):
def test(self):
- check_platform('xenial') # because there is h5py 2.6
+ if h5py.__version__ < '2.3.0':
+ raise unittest.SkipTest # UCERF requires vlen arrays
out = self.run_calc(ucerf.__file__, 'job.ini', exports='txt')
num_exported = len(out['gmf_data', 'txt'])
# just check that two realizations are exported | Added an explicit check on h5py.__version__ | gem_oq-engine | train | py |
ef1911e13212ba96e7e281bc4a2df18aca36491b | diff --git a/tika/tika.py b/tika/tika.py
index <HASH>..<HASH> 100755
--- a/tika/tika.py
+++ b/tika/tika.py
@@ -543,7 +543,6 @@ def callServer(verb, serverEndpoint, service, data, headers, verbose=Verbose, ti
effectiveRequestOptions.update(requestOptions)
resp = verbFn(serviceUrl, encodedData, **effectiveRequestOptions)
- encodedData.close() # closes the file reading data
if verbose:
print(sys.stderr, "Request headers: ", headers) | Remove closing on bytes
Actually as the callServer get's the reader from the parent, the parent should be responsible for closing it. If the caller needs to have the file opened less time it should manage the read itself and after that call callServer with bytes directly in my opinion. | chrismattmann_tika-python | train | py |
b984421a3e864e12ae22aacddb591c7c6f1b7da6 | diff --git a/src/build.js b/src/build.js
index <HASH>..<HASH> 100755
--- a/src/build.js
+++ b/src/build.js
@@ -43,7 +43,7 @@ for (let type in db) {
);
}
- // Cache the hightest ranking type for this extension
+ // Cache the highest ranking type for this extension
if (keep === entry) byExtension[ext] = entry;
});
} | Correct spelling mistake (#<I>) | broofa_node-mime | train | js |
8a703522c7f4e0283b177803f4de4a9dea995912 | diff --git a/tangy-form-reducer.js b/tangy-form-reducer.js
index <HASH>..<HASH> 100644
--- a/tangy-form-reducer.js
+++ b/tangy-form-reducer.js
@@ -98,6 +98,7 @@ const tangyFormReducer = function (state = initialState, action) {
case 'UNLOCK':
return Object.assign({}, state, {
complete: false,
+ hasUnlocked: true,
endUnixtime: undefined,
form: Object.assign({}, state.form, {
complete: false,
diff --git a/tangy-form-response-model.js b/tangy-form-response-model.js
index <HASH>..<HASH> 100644
--- a/tangy-form-response-model.js
+++ b/tangy-form-response-model.js
@@ -7,6 +7,7 @@ export class TangyFormResponseModel {
this.items = []
// States.
this.complete = false
+ this.hasUnlocked = false
// Focus indexes.
// @TODO: We can probably get rid of these indexes.
this.focusIndex = 0 | Add TangyFormResponse.hasLocked property, set it when first submitting | Tangerine-Community_tangy-form | train | js,js |
ccae58fe46bb8eafa886ca0981e0f8eac5d8f05a | diff --git a/src/experi/run.py b/src/experi/run.py
index <HASH>..<HASH> 100644
--- a/src/experi/run.py
+++ b/src/experi/run.py
@@ -315,7 +315,7 @@ def run_pbs_jobs(
if prev_jobids:
# Continue to append all previous jobs to submit_cmd so subsequent jobs die along
# with the first.
- submit_cmd += ["-W", "depend=afterok:{} ".format(",".join(prev_jobids))]
+ submit_cmd += ["-W", "depend=afterok:{} ".format(":".join(prev_jobids))]
# acutally run the command
logger.info(str(submit_cmd)) | BUG Dependent jobs are separated by colon | malramsay64_experi | train | py |
acf4d093bbd1715b1e3aa020089502e27a9d6594 | diff --git a/PHPCI/Plugin/PhpMessDetector.php b/PHPCI/Plugin/PhpMessDetector.php
index <HASH>..<HASH> 100755
--- a/PHPCI/Plugin/PhpMessDetector.php
+++ b/PHPCI/Plugin/PhpMessDetector.php
@@ -86,6 +86,11 @@ class PhpMessDetector implements \PHPCI\Plugin
$suffixes = ' --suffixes ' . implode(',', $this->suffixes);
}
+ if (!empty($this->rules) && !is_array($this->rules)) {
+ $this->phpci->logFailure('The "rules" option must be an array.');
+ return false;
+ }
+
foreach ($this->rules as &$rule) {
if (strpos($rule, '/') !== false) {
$rule = $this->phpci->buildPath . $rule; | Updating PHPMD to enforce rules being an array. Fixes #<I> | dancryer_PHPCI | train | php |
83000164b3c13681b0d172865580d7a1e9b55dca | diff --git a/protempa-framework/src/main/java/org/protempa/QuerySession.java b/protempa-framework/src/main/java/org/protempa/QuerySession.java
index <HASH>..<HASH> 100644
--- a/protempa-framework/src/main/java/org/protempa/QuerySession.java
+++ b/protempa-framework/src/main/java/org/protempa/QuerySession.java
@@ -38,6 +38,16 @@ public class QuerySession {
public Query getQuery() {
return query;
}
+
+ public void addPropositionToCache (Object uid, Proposition proposition) {
+ this.propositionCache.put(uid, proposition);
+ }
+
+ public void addPropositionsToCache (List<Proposition> propositions) {
+ for (Proposition p : propositions) {
+ addPropositionToCache(p.getUniqueIdentifier(), p);
+ }
+ }
public List<Proposition> getReferences(Proposition prop, String name) throws DataSourceReadException {
List<Proposition> references = new LinkedList<Proposition>(); | Added two new methods, addPropositionToCache() and addPropositionsToCache(), to add Proposition objects to the cache for later retrieval. For example, the cache will be used when the getReferences() method is called to materialize Proposition objects using their UID. | eurekaclinical_protempa | train | java |
a33f11f225a7e34609a16b155c030a6b1b327a4f | diff --git a/test/e2e/es_cluster_logging.go b/test/e2e/es_cluster_logging.go
index <HASH>..<HASH> 100644
--- a/test/e2e/es_cluster_logging.go
+++ b/test/e2e/es_cluster_logging.go
@@ -30,8 +30,7 @@ import (
. "github.com/onsi/gomega"
)
-// Flaky issue #17873
-var _ = Describe("Cluster level logging using Elasticsearch [Flaky]", func() {
+var _ = Describe("Cluster level logging using Elasticsearch [Feature:Elasticsearch]", func() {
f := NewFramework("es-logging")
BeforeEach(func() { | mark Elasticsearch test as Feature | kubernetes_kubernetes | train | go |
983becee8ff7a1975d49e9ee6258bff56fd80503 | diff --git a/lib/resque_cleaner/server.rb b/lib/resque_cleaner/server.rb
index <HASH>..<HASH> 100644
--- a/lib/resque_cleaner/server.rb
+++ b/lib/resque_cleaner/server.rb
@@ -1,3 +1,5 @@
+require 'yaml'
+
# Extends Resque Web Based UI.
# Structure has been borrowed from ResqueScheduler.
module ResqueCleaner | resque <I> seems requiring yaml | ono_resque-cleaner | train | rb |
4b4849c1a7ba6caf3fb45b5a8bdd6e4edbcc62b0 | diff --git a/intake/source/cache.py b/intake/source/cache.py
index <HASH>..<HASH> 100644
--- a/intake/source/cache.py
+++ b/intake/source/cache.py
@@ -270,7 +270,7 @@ class FileCache(BaseCache):
self._ensure_cache_dir()
subdir = self._hash(urlpath)
- files_in = open_files(urlpath, 'rb')
+ files_in = open_files(urlpath, 'rb', **self._storage_options)
files_out = [open_files([self._path(f.path, subdir)], 'wb',
**self._storage_options)[0]
for f in files_in] | Passing storage options to open_files for download. | intake_intake | train | py |
75fd92fd98364342906034fac48524ab6e9f30be | diff --git a/salt/modules/pacman.py b/salt/modules/pacman.py
index <HASH>..<HASH> 100644
--- a/salt/modules/pacman.py
+++ b/salt/modules/pacman.py
@@ -78,6 +78,14 @@ def latest_version(*names, **kwargs):
except (ValueError, IndexError):
pass
+ pkgs = {}
+
+ for name in names:
+ if not ret[name]:
+ if not pkgs:
+ pkgs = list_pkgs()
+ if name in pkgs:
+ ret[name] = pkgs[name]
# Return a string if only one package name passed
if len(names) == 1:
return ret[names[0]] | Return locally installed version if no newer is available | saltstack_salt | train | py |
5500cc3e6fd0f4768c51c626f125572e082cdddc | diff --git a/moto/awslambda/models.py b/moto/awslambda/models.py
index <HASH>..<HASH> 100644
--- a/moto/awslambda/models.py
+++ b/moto/awslambda/models.py
@@ -115,7 +115,7 @@ class LambdaFunction(object):
#print "moto_lambda_debug: ", mycode
sys.stdout = codeOut
sys.stderr = codeErr
- exec mycode
+ exec(mycode)
exec_err = codeErr.getvalue()
exec_out = codeOut.getvalue()
result = "\n".join([exec_out, exec_err]) | attmpt 3 not liking Python 3 very much at the moment | spulec_moto | train | py |
11eef251b2348d1c895e70911ff4ad9d58e8cd19 | diff --git a/superset/db_engine_specs/base.py b/superset/db_engine_specs/base.py
index <HASH>..<HASH> 100644
--- a/superset/db_engine_specs/base.py
+++ b/superset/db_engine_specs/base.py
@@ -1255,6 +1255,14 @@ class BaseEngineSpec: # pylint: disable=too-many-public-methods
)
@classmethod
+ def is_select_query(cls, parsed_query: ParsedQuery) -> bool:
+ """
+ Determine if the statement should be considered as SELECT statement.
+ Some query dialects do not contain "SELECT" word in queries (eg. Kusto)
+ """
+ return parsed_query.is_select()
+
+ @classmethod
@utils.memoized
def get_column_spec(
cls,
diff --git a/superset/sql_lab.py b/superset/sql_lab.py
index <HASH>..<HASH> 100644
--- a/superset/sql_lab.py
+++ b/superset/sql_lab.py
@@ -217,7 +217,7 @@ def execute_sql_statement(
query.select_as_cta_used = True
# Do not apply limit to the CTA queries when SQLLAB_CTAS_NO_LIMIT is set to true
- if parsed_query.is_select() and not (
+ if db_engine_spec.is_select_query(parsed_query) and not (
query.select_as_cta_used and SQLLAB_CTAS_NO_LIMIT
):
if SQL_MAX_ROW and (not query.limit or query.limit > SQL_MAX_ROW): | feat: Add "is_select_query" method to base engine spec to make it possible to override it (#<I>) | apache_incubator-superset | train | py,py |
5affb919f2f6ee9c7655d73593e1fafb20915a86 | diff --git a/build.go b/build.go
index <HASH>..<HASH> 100644
--- a/build.go
+++ b/build.go
@@ -528,6 +528,9 @@ func ldflags() string {
b.WriteString(fmt.Sprintf(" -X main.commit=%s", getGitSha()))
b.WriteString(fmt.Sprintf(" -X main.buildstamp=%d", buildStamp()))
b.WriteString(fmt.Sprintf(" -X main.buildBranch=%s", getGitBranch()))
+ if v := os.Getenv("LDFLAGS"); v != "" {
+ b.WriteString(fmt.Sprintf(" -extldflags=%s", v))
+ }
return b.String()
} | Build: Allow extending of LDFLAGS in build.go (#<I>)
Allow extending LDFALGS by setting LDFLAGS to be able to pass
-zrelro,-znow for Arch Linux packaging
to get full relro. | grafana_grafana | train | go |
1c98d05202adcdbc031418472ba228c5edd61e8a | diff --git a/simuvex/plugins/solver.py b/simuvex/plugins/solver.py
index <HASH>..<HASH> 100644
--- a/simuvex/plugins/solver.py
+++ b/simuvex/plugins/solver.py
@@ -259,6 +259,15 @@ class SimSolver(SimStatePlugin):
raise SimValueError("concretized %d values (%d required) in exactly_n" % (len(r), n))
return r
+ def exactly_int(self, e, extra_constraints=(), default=None):
+ r = self.any_n_int(e, 1, extra_constraints=extra_constraints)
+ if len(r) != 1:
+ if default is None:
+ raise SimValueError("concretized %d values (%d required) in exactly_n" % (len(r), n))
+ else:
+ return default
+ return r
+
def unique(self, e, extra_constraints=()):
if type(e) is not claripy.A:
return True | Added an exactly_int() function to SimSolver. | angr_angr | train | py |
e46213b2e1bb7de25279cdac9d92524c44dc62fb | diff --git a/lib/chronic/repeater.rb b/lib/chronic/repeater.rb
index <HASH>..<HASH> 100644
--- a/lib/chronic/repeater.rb
+++ b/lib/chronic/repeater.rb
@@ -110,13 +110,10 @@ module Chronic
# returns the next occurance of this repeatable.
def next(pointer)
[email protected]? || raise("Start point must be set before calling #next")
- [:future, :none, :past].include?(pointer) || raise("First argument 'pointer' must be one of :past or :future")
- #raise("Repeatable#next must be overridden in subclasses")
end
def this(pointer)
[email protected]? || raise("Start point must be set before calling #this")
- [:future, :past, :none].include?(pointer) || raise("First argument 'pointer' must be one of :past, :future, :none")
end
def to_s | these should never raise as a prior check is done against context | mojombo_chronic | train | rb |
3515d603a837dabc9fb095b7557174df54af9dcb | diff --git a/fedora_messaging/tests/unit/test_cli.py b/fedora_messaging/tests/unit/test_cli.py
index <HASH>..<HASH> 100644
--- a/fedora_messaging/tests/unit/test_cli.py
+++ b/fedora_messaging/tests/unit/test_cli.py
@@ -486,7 +486,8 @@ class CallbackFromFilesytem(TestCase):
os.path.join(FIXTURES_DIR, "bad_cb") + ":missing"
)
- if sys.version_info >= (3, 10):
+ if sys.version_info >= (3, 10) and sys.version_info < (3, 10, 4):
+ # https://github.com/python/cpython/issues/90398
exc_msg = "invalid syntax. Perhaps you forgot a comma?"
else:
exc_msg = "invalid syntax" | Adjust to a message change in Python <I> | fedora-infra_fedora-messaging | train | py |
5a04df33b42d4619955cee49403fee62bbf52048 | diff --git a/core/src/test/java/org/hibernate/ogm/backendtck/queries/JpaQueriesTest.java b/core/src/test/java/org/hibernate/ogm/backendtck/queries/JpaQueriesTest.java
index <HASH>..<HASH> 100644
--- a/core/src/test/java/org/hibernate/ogm/backendtck/queries/JpaQueriesTest.java
+++ b/core/src/test/java/org/hibernate/ogm/backendtck/queries/JpaQueriesTest.java
@@ -152,10 +152,12 @@ public class JpaQueriesTest extends JpaTestCase {
@After
public void closeEmAndRemoveEntities() throws Exception {
- em.getTransaction().commit();
- removeEntities();
- em.close();
-
+ //Do not hide the real cause with an NPE if there are initialisation issues:
+ if ( em != null ) {
+ em.getTransaction().commit();
+ removeEntities();
+ em.close();
+ }
}
@Override | OGM-<I> Make sure the JpaQueriesTest doesn't hide the real cause when failing to initialize | hibernate_hibernate-ogm | train | java |
54031a6b1da76dc08ad444b7d57e5fd7214fd65e | diff --git a/tests/query/netinfo/test_base.py b/tests/query/netinfo/test_base.py
index <HASH>..<HASH> 100644
--- a/tests/query/netinfo/test_base.py
+++ b/tests/query/netinfo/test_base.py
@@ -26,7 +26,7 @@ Project link:
https://github.com/funilrys/PyFunceble
Project documentation:
- https://pyfunceble.readthedocs.io/en/master/
+ https://pyfunceble.readthedocs.io/en/dev/
Project homepage:
https://pyfunceble.github.io/ | fixup! Introduction of the tests of the base of all netinfo interfaces. | funilrys_PyFunceble | train | py |
52c28b616a2c6b094ec58e04e48a6642c6f82b01 | diff --git a/vagrant_box_defaults.rb b/vagrant_box_defaults.rb
index <HASH>..<HASH> 100644
--- a/vagrant_box_defaults.rb
+++ b/vagrant_box_defaults.rb
@@ -5,7 +5,7 @@ Vagrant.require_version ">= 2.2.0"
$SERVER_BOX = "cilium/ubuntu-dev"
$SERVER_VERSION= "185"
$NETNEXT_SERVER_BOX= "cilium/ubuntu-next"
-$NETNEXT_SERVER_VERSION= "79"
+$NETNEXT_SERVER_VERSION= "80"
@v419_SERVER_BOX= "cilium/ubuntu-4-19"
@v419_SERVER_VERSION= "26"
@v49_SERVER_BOX= "cilium/ubuntu" | vagrant: bump bpf-next vagrant box version
Pull in latest BPF kernel tree from bpf-next which contains extended
bpf_{get,set}sockopt() helper support for sock_addr programs [0].
[0] <URL> | cilium_cilium | train | rb |
3cf9f94235371587e5c631d7b29f129ccdfa2855 | diff --git a/Annis-web/src/main/webapp/javascript/annis/CorpusListWindow.js b/Annis-web/src/main/webapp/javascript/annis/CorpusListWindow.js
index <HASH>..<HASH> 100644
--- a/Annis-web/src/main/webapp/javascript/annis/CorpusListWindow.js
+++ b/Annis-web/src/main/webapp/javascript/annis/CorpusListWindow.js
@@ -105,7 +105,7 @@ Ext.onReady(function()
id: id,
closable:true,
maximizable: false,
- width:800,
+ width: (Ext.getBody().getViewSize().width - windowSearchFormWidth - 25),
height:Ext.getBody().getViewSize().height - 35,
//border:false,
plain:true, | - resize the CorpusListWindow according to the real size of the browser | korpling_ANNIS | train | js |
b41504d0fab472f33f927e97807e9d7d5b93aa47 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -20,6 +20,8 @@ import gui
version = gui.__version__
if sys.version_info > (3, ):
version += "-py3k"
+else:
+ version += "-py2x"
# append install on windows
if len(sys.argv) == 1 and sys.platform.startswith("win"): | add -py2x to version in setup | reingart_gui2py | train | py |
709bec9e16a5f02de7ff4c617ff1732eb8a648bf | diff --git a/core/query.go b/core/query.go
index <HASH>..<HASH> 100644
--- a/core/query.go
+++ b/core/query.go
@@ -2,6 +2,7 @@ package core
import (
"sync"
+ "time"
"github.com/degdb/degdb/protocol"
"github.com/degdb/degdb/query"
@@ -54,9 +55,19 @@ func (s *server) ExecuteQuery(q *protocol.QueryRequest) ([]*protocol.Triple, err
return
}
triplesLock.Lock()
+ // TODO(d4l3k): Deduplicate triples
triples = append(triples, msg.GetQueryResponse().Triples...)
triplesLock.Unlock()
- wg.Done()
+ done := make(chan bool, 1)
+ go func() {
+ wg.Done()
+ done <- true
+ }()
+ go func() {
+ time.Sleep(10 * time.Second)
+ done <- true
+ }()
+ <-done
}()
}
wg.Wait() | Added timeout to unrooted queries | degdb_degdb | train | go |
28f6da0e4e89d35411b19d5a5977a9d9f305f5f9 | diff --git a/lib/spork/run_strategy/forking.rb b/lib/spork/run_strategy/forking.rb
index <HASH>..<HASH> 100644
--- a/lib/spork/run_strategy/forking.rb
+++ b/lib/spork/run_strategy/forking.rb
@@ -20,6 +20,7 @@ class Spork::RunStrategy::Forking < Spork::RunStrategy
end
def preload
+ require test_framework.entry_point
test_framework.preload
end | fixes regression where entry point was not being loaded | sporkrb_spork | train | rb |
47277f281eb0e7d484555e4d210b0ddb42974793 | diff --git a/staging/src/k8s.io/client-go/testing/actions.go b/staging/src/k8s.io/client-go/testing/actions.go
index <HASH>..<HASH> 100644
--- a/staging/src/k8s.io/client-go/testing/actions.go
+++ b/staging/src/k8s.io/client-go/testing/actions.go
@@ -439,8 +439,18 @@ func (a ActionImpl) GetSubresource() string {
return a.Subresource
}
func (a ActionImpl) Matches(verb, resource string) bool {
+ // Stay backwards compatible.
+ if !strings.Contains(resource, "/") {
+ return strings.EqualFold(verb, a.Verb) &&
+ strings.EqualFold(resource, a.Resource.Resource)
+ }
+
+ parts := strings.SplitN(resource, "/", 2)
+ topresource, subresource := parts[0], parts[1]
+
return strings.EqualFold(verb, a.Verb) &&
- strings.EqualFold(resource, a.Resource.Resource)
+ strings.EqualFold(topresource, a.Resource.Resource) &&
+ strings.EqualFold(subresource, a.Subresource)
}
func (a ActionImpl) DeepCopy() Action {
ret := a | Allow Action's Matches function to specify a subresource.
In other parts of the system (notably in RBAC rules), the "resource/subresource" notation is common to specify an explicit subresource. This makes this notation available to tests that use the `Matches` function on client actions as well.
Backwards compatibility is kept by ignoring the `Subresource` field if no specific subresource is defined in the resource string itself. | kubernetes_kubernetes | train | go |
ac20257aae95e633d69468770646e3f90c4f302c | diff --git a/admin/lang.php b/admin/lang.php
index <HASH>..<HASH> 100644
--- a/admin/lang.php
+++ b/admin/lang.php
@@ -628,6 +628,9 @@ function lang_fix_value_before_save($value='') {
if ($CFG->lang != "zh_hk" and $CFG->lang != "zh_tw") { // Some MB languages include backslash bytes
$value = str_replace("\\","",$value); // Delete all slashes
}
+ if (ini_get_bool('magic_quotes_sybase')) { // Unescape escaped sybase quotes
+ $value = str_replace("''", "'", $value);
+ }
$value = str_replace("'", "\\'", $value); // Add slashes for '
$value = str_replace('"', "\\\"", $value); // Add slashes for "
$value = str_replace("%","%%",$value); // Escape % characters | Now sybase quotes are properly handled by the lang editor. Part of MDL-<I>
Merged from MOODLE_<I>_STABLE | moodle_moodle | train | php |
25c3c0aa1718d1aefd73e2df47234f17622b15b3 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -47,7 +47,7 @@ ext_modules=[
if use_cython:
from Cython.Build import cythonize
try:
- ext_modules = cythonize(join('pybasicbayes','**','*.pyx'))
+ ext_modules = cythonize(os.path.join('pybasicbayes','**','*.pyx'))
except:
warn('Failed to generate extension module code from Cython files')
diff --git a/tests/test_gammadirichlet.py b/tests/test_gammadirichlet.py
index <HASH>..<HASH> 100644
--- a/tests/test_gammadirichlet.py
+++ b/tests/test_gammadirichlet.py
@@ -8,7 +8,7 @@ from nose.plugins.attrib import attr
import pybasicbayes.distributions as distributions
-@attr('GammaCompoundDirichlet')
+@attr('GammaCompoundDirichlet', 'slow')
class TestDirichletCompoundGamma(object):
def test_weaklimit(self):
a = distributions.CRP(10,1) | mark test_gammadirichlet as slow, fix os.path.join in setup.py | mattjj_pybasicbayes | train | py,py |
aede34079dc94806171b4188a0fb43c8aad483b3 | diff --git a/builder/azure/arm/config.go b/builder/azure/arm/config.go
index <HASH>..<HASH> 100644
--- a/builder/azure/arm/config.go
+++ b/builder/azure/arm/config.go
@@ -787,6 +787,10 @@ func assertRequiredParametersSet(c *Config, errs *packer.MultiError) {
for _, rid := range c.UserAssignedManagedIdentities {
r, err := client.ParseResourceID(rid)
if err != nil {
+ err := fmt.Errorf("Error parsing resource ID from `user_assigned_managed_identities`; please make sure"+
+ " that this value follows the full resource id format: "+
+ "/subscriptions/<SUBSCRIPTON_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<USER_ASSIGNED_IDENTITY_NAME>.\n"+
+ " Original error: %s", err)
errs = packer.MultiErrorAppend(errs, err)
} else {
if !strings.EqualFold(r.Provider, "Microsoft.ManagedIdentity") { | provide more helpful error message than the one returned by the client, without context | hashicorp_packer | train | go |
Subsets and Splits