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 |
|---|---|---|---|---|---|
3bd36c410c3d7fadc911e91ded07ff08eb2d21da | diff --git a/bakery/management/commands/build.py b/bakery/management/commands/build.py
index <HASH>..<HASH> 100644
--- a/bakery/management/commands/build.py
+++ b/bakery/management/commands/build.py
@@ -91,6 +91,8 @@ settings.py or provide a list as arguments."
# get the relative path that we want to copy into
rel_path = os.path.relpath(dirpath, settings.STATIC_ROOT)
dest_path = os.path.join(target_dir, rel_path[2:])
+ if not os.path.exists(dest_path):
+ os.mkdirs(dest_path)
# run the regex match
m = pattern.search(filename)
if m:
@@ -104,7 +106,7 @@ settings.py or provide a list as arguments."
f_in.close()
# otherwise, just copy the file
else:
- shutil.copy(og_file, os.path.join(dest_path, filename))
+ shutil.copy(og_file, dest_path)
# if gzip isn't enabled, just copy the tree straight over
else:
shutil.copytree(settings.STATIC_ROOT, target_dir) | create path if doesn't exist | datadesk_django-bakery | train | py |
cd44cc5175eb12bc5c518e33b5ae45f4e729418a | diff --git a/marcx.py b/marcx.py
index <HASH>..<HASH> 100644
--- a/marcx.py
+++ b/marcx.py
@@ -219,7 +219,10 @@ class FatRecord(Record):
def remove(self, fieldspec):
"""
- Removes **all** fields with tag `tag`.
+ Removes fields or subfields according to `fieldspec`.
+
+ If a non-control field subfield removal leaves no other subfields,
+ delete the field entirely.
"""
pattern = r'(?P<field>[^.]+)(.(?P<subfield>[^.]+))?' | a bit more info on FatRecord.remove | ubleipzig_marcx | train | py |
a225a8fe95e8e6ba1b45fd3f6b659632e974c411 | diff --git a/lib/nydp/lexical_context.rb b/lib/nydp/lexical_context.rb
index <HASH>..<HASH> 100644
--- a/lib/nydp/lexical_context.rb
+++ b/lib/nydp/lexical_context.rb
@@ -55,8 +55,8 @@ module Nydp
values << at_index(n).inspect
n += 1
end
- parent = parent ? " parent #{parent.to_s}" : ""
- "(context (#{values.join ' '})#{parent})"
+ parent_s = parent ? " parent #{parent.to_s}" : ""
+ "(context (#{values.join ' '})#{parent_s})"
end
end
end | lexical_context: fix error in #to_s | conanite_nydp | train | rb |
4d93e468d6e6d6f51b301a61fb722dd4e55510d7 | diff --git a/framework/web/User.php b/framework/web/User.php
index <HASH>..<HASH> 100644
--- a/framework/web/User.php
+++ b/framework/web/User.php
@@ -13,6 +13,14 @@ use yii\base\HttpException;
use yii\base\InvalidConfigException;
/**
+ * User is an application component that manages the user authentication status.
+ *
+ * In particular, [[User::isGuest]] returns a value indicating whether the current user is a guest or not.
+ * Through methods [[login()]] and [[logout()]], you can change the user authentication status.
+ *
+ * User works with a class implementing the [[Identity]] interface. This class implements
+ * the actual user authentication logic and is often backed by a user database table.
+ *
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
diff --git a/framework/web/UserEvent.php b/framework/web/UserEvent.php
index <HASH>..<HASH> 100644
--- a/framework/web/UserEvent.php
+++ b/framework/web/UserEvent.php
@@ -30,5 +30,5 @@ class UserEvent extends Event
* Event handlers may modify this property to determine whether the login or logout should proceed.
* This property is only meaningful for [[User::EVENT_BEFORE_LOGIN]] and [[User::EVENT_BEFORE_LOGOUT]] events.
*/
- public $isValid;
+ public $isValid = true;
}
\ No newline at end of file | Fixed UserEvent bug.
Updated docs. | yiisoft_yii2-debug | train | php,php |
d6a42db4021b69a9878ae2a1cc246942e09b21b6 | diff --git a/nephele/nephele-server/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionGroupVertex.java b/nephele/nephele-server/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionGroupVertex.java
index <HASH>..<HASH> 100644
--- a/nephele/nephele-server/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionGroupVertex.java
+++ b/nephele/nephele-server/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionGroupVertex.java
@@ -744,12 +744,6 @@ public class ExecutionGroupVertex {
}
this.verticesSharingInstances.addIfAbsent(groupVertex);
-
- System.out.print(getName() + ": ");
- for (final ExecutionGroupVertex v : this.verticesSharingInstances) {
- System.out.print(v.getName() + " ");
- }
- System.out.println("");
}
private void removeFromVerticesSharingInstances(final ExecutionGroupVertex groupVertex) { | Removed debug output in ExecutionGroupVertex | apache_flink | train | java |
e4f24d922b639069d00e831a1916522debed5dc0 | diff --git a/falafel/content.py b/falafel/content.py
index <HASH>..<HASH> 100644
--- a/falafel/content.py
+++ b/falafel/content.py
@@ -117,11 +117,7 @@ def import_tsv():
to_add = []
for d in data:
to_add.extend(list(save_rule(d, CONTENT_PREFIX)))
- apply_changeset(repo,
- to_add,
- "Import content from TSV",
- "Kyle Lape",
- "klape@redhat.com")
+ repo.index.add(to_add)
def apply_changeset(repo, to_add, message, name, email): | Only stage (don't commit) the inital import to content repo | RedHatInsights_insights-core | train | py |
949485dac070df78fc9b06c9758facf6c41a6470 | diff --git a/v2/goi18n/extract_command.go b/v2/goi18n/extract_command.go
index <HASH>..<HASH> 100644
--- a/v2/goi18n/extract_command.go
+++ b/v2/goi18n/extract_command.go
@@ -259,6 +259,9 @@ func extractStringLiteral(expr ast.Expr) (string, bool) {
}
return x + y, true
case *ast.Ident:
+ if v.Obj == nil {
+ return "", false
+ }
switch z := v.Obj.Decl.(type) {
case *ast.ValueSpec:
s, ok := extractStringLiteral(z.Values[0])
diff --git a/v2/goi18n/extract_command_test.go b/v2/goi18n/extract_command_test.go
index <HASH>..<HASH> 100644
--- a/v2/goi18n/extract_command_test.go
+++ b/v2/goi18n/extract_command_test.go
@@ -202,6 +202,18 @@ zero = "Zero translation"
activeFile: []byte(`ConstantID = "ID is a constant"
`),
},
+ {
+ name: "undefined identifier in composite lit",
+ fileName: "file.go",
+ file: `package main
+
+ import "github.com/nicksnyder/go-i18n/v2/i18n"
+
+ var m = &i18n.LocalizeConfig{
+ Funcs: Funcs,
+ }
+ `,
+ },
}
for _, test := range tests { | Add a nil pointer check before dereferencing an identifier's Obj (#<I>)
When walking the AST during extraction, if an identifier in a composite
literal is encountered that does not define in that file, the `Obj`
field of the `ast.Ident` will be nil.
Rather than panicking in this case, have the literal string extraction
function return false (no string found).
Also, add a test case representing this scenario. | nicksnyder_go-i18n | train | go,go |
347df5d93ac3e9ffa1d21253237d7ca3466b5d8c | diff --git a/packages/cli/src/utils/hosting/hosting.js b/packages/cli/src/utils/hosting/hosting.js
index <HASH>..<HASH> 100644
--- a/packages/cli/src/utils/hosting/hosting.js
+++ b/packages/cli/src/utils/hosting/hosting.js
@@ -280,7 +280,7 @@ class Hosting {
}
getURL () {
- return `https://${this.name}--${session.project.instance}.${this.hostingHost}`
+ return `https://${this.name}--${session.project.instance}.${session.location}.${this.hostingHost}`
}
encodePath (pathToEncode) { | fix(cli): proper url for hosting | Syncano_syncano-node | train | js |
634d9215abc93c4f9dad944e21835d7f0e897d25 | diff --git a/src/main/java/kcsaba/image/viewer/ImageComponent.java b/src/main/java/kcsaba/image/viewer/ImageComponent.java
index <HASH>..<HASH> 100644
--- a/src/main/java/kcsaba/image/viewer/ImageComponent.java
+++ b/src/main/java/kcsaba/image/viewer/ImageComponent.java
@@ -171,13 +171,13 @@ class ImageComponent extends JComponent {
AffineTransform tr=new AffineTransform();
switch (resizeStrategy) {
case NO_RESIZE:
- tr.setToTranslation((getWidth()-image.getWidth())/2, (getHeight()-image.getHeight())/2);
+ tr.setToTranslation((getWidth()-image.getWidth())/2.0, (getHeight()-image.getHeight())/2.0);
break;
case SHRINK_TO_FIT:
double shrink = Math.min(getSizeRatio(), 1);
double imageDisplayWidth=image.getWidth()*shrink;
double imageDisplayHeight=image.getHeight()*shrink;
- tr.setToTranslation((getWidth()-imageDisplayWidth)/2, (getHeight()-imageDisplayHeight)/2);
+ tr.setToTranslation((getWidth()-imageDisplayWidth)/2.0, (getHeight()-imageDisplayHeight)/2.0);
tr.scale(shrink, shrink);
break;
default: | Fix inconsistent position between NO_RESIZE and SHRINK_TO_FIT due to rounding. | kazocsaba_imageviewer | train | java |
fb0e58a54a8fb556e80bbc5dcd4ebb748641f81c | diff --git a/ruby/command-t/scanner/jump_scanner.rb b/ruby/command-t/scanner/jump_scanner.rb
index <HASH>..<HASH> 100644
--- a/ruby/command-t/scanner/jump_scanner.rb
+++ b/ruby/command-t/scanner/jump_scanner.rb
@@ -31,7 +31,7 @@ module CommandT
include VIM::PathUtilities
def paths
- jumps_with_filename = jumps.select do |line|
+ jumps_with_filename = jumps.lines.select do |line|
line_contains_filename?(line)
end
filenames = jumps_with_filename[1..-2].map do |line| | Fix CommandTJump under Ruby <I>.x
The jump scanner pulls in a string jumplist. This worked fine under Ruby
<I>, where `String#select` operates in a line-wise fashion. Under Ruby
<I>.x, however, it's a private method and explodes. Using `String#lines`
instead makes things work on both Rubies. | wincent_command-t | train | rb |
e72abc46bcaeeebc8f64f5dfec3fd59c57664e5a | diff --git a/irc/client.py b/irc/client.py
index <HASH>..<HASH> 100644
--- a/irc/client.py
+++ b/irc/client.py
@@ -1275,6 +1275,10 @@ class Event(object):
tags = []
self.tags = tags
+ def __str__(self):
+ return "type: {}, source: {}, target: {}, arguments: {}, tags: {}".format(self.type,
+ self.source, self.target, self.arguments, self.tags)
+
def is_channel(string):
"""Check if a string is a channel name. | allow str(Event) to work | jaraco_irc | train | py |
b4e5574751f38f2a14e00e03b8f2d4a53616e022 | diff --git a/src/AudioPlayer.js b/src/AudioPlayer.js
index <HASH>..<HASH> 100644
--- a/src/AudioPlayer.js
+++ b/src/AudioPlayer.js
@@ -260,7 +260,21 @@ class AudioPlayer extends Component {
}
}
- componentDidUpdate () {
+ componentDidUpdate (prevProps, prevState) {
+ if (typeof this.props.onRepeatStrategyUpdate === 'function') {
+ const prevRepeatStrategy = getRepeatStrategy(
+ prevState.loop,
+ prevState.cycle
+ );
+ const newRepeatStrategy = getRepeatStrategy(
+ this.state.loop,
+ this.state.cycle
+ );
+ if (prevRepeatStrategy !== newRepeatStrategy) {
+ this.props.onRepeatStrategyUpdate(newRepeatStrategy);
+ }
+ }
+
/* if we loaded a new playlist and the currently playing track couldn't
* be found, pause and load the first track in the new playlist.
*/
@@ -726,6 +740,7 @@ AudioPlayer.propTypes = {
stayOnBackSkipThreshold: PropTypes.number,
style: PropTypes.object,
onActiveTrackUpdate: PropTypes.func,
+ onRepeatStrategyUpdate: PropTypes.func,
onShuffleUpdate: PropTypes.func,
onMediaEvent: PropTypes.objectOf(PropTypes.func.isRequired),
audioElementRef: PropTypes.func | onRepeatStrategyUpdate prop included. | benwiley4000_cassette | train | js |
4cc25978a22cd380988593149d504dd655ec9c81 | diff --git a/matgendb/creator.py b/matgendb/creator.py
index <HASH>..<HASH> 100644
--- a/matgendb/creator.py
+++ b/matgendb/creator.py
@@ -247,7 +247,7 @@ class VaspToDbTaskDrone(AbstractDrone):
# DOS data tends to be above the 4Mb limit for mongo docs. A ref
# to the dos file is in the dos_fs_id.
result = coll.find_one({"dir_name": d["dir_name"]},
- fields=["dir_name", "task_id"])
+ ["dir_name", "task_id"])
if result is None or self.update_duplicates:
if self.parse_dos and "calculations" in d:
for calc in d["calculations"]:
diff --git a/matgendb/query_engine.py b/matgendb/query_engine.py
index <HASH>..<HASH> 100644
--- a/matgendb/query_engine.py
+++ b/matgendb/query_engine.py
@@ -376,8 +376,7 @@ class QueryEngine(object):
crit = self._parse_criteria(criteria)
#print("@@ {}.find({}, fields={}, timeout=False)".format(self.collection.name, crit, props))
- cur = self.collection.find(crit, fields=props,
- timeout=False).skip(index)
+ cur = self.collection.find(crit, props).skip(index)
if limit is not None:
cur.limit(limit)
if distinct_key is not None: | Upgrade for pymongo<I> compatibility
field argument to Collection.find() got renamed | materialsproject_pymatgen-db | train | py,py |
a2395b0541046128f75711a1ab0e702d5b399404 | diff --git a/DrdPlus/Tables/Armaments/Armourer.php b/DrdPlus/Tables/Armaments/Armourer.php
index <HASH>..<HASH> 100644
--- a/DrdPlus/Tables/Armaments/Armourer.php
+++ b/DrdPlus/Tables/Armaments/Armourer.php
@@ -198,6 +198,7 @@ class Armourer extends StrictObject
{
/** @noinspection ExceptionsAnnotatingAndHandlingInspection */
return
+ // shooting weapons are two-handed (except minicrossbow), projectiles are not
$this->isTwoHanded($weaponToHoldByBothHands) // the weapon is explicitly two-handed
// or it is melee weapon with length at least 1 (see PPH page 92 right column)
|| ($weaponToHoldByBothHands->isMeleeArmament() | Note about shooting weapons and their two-hands requirement | drdplusinfo_tables | train | php |
8dd18c32c7738f7eeef3ab2b0477ffa2e7b29e7c | diff --git a/stagpy/plates.py b/stagpy/plates.py
index <HASH>..<HASH> 100644
--- a/stagpy/plates.py
+++ b/stagpy/plates.py
@@ -128,14 +128,16 @@ def plot_plate_limits_field(axis, rcmb, ridges, trenches):
xxt = (rcmb + 1.35) * np.cos(trench) # arrow end
yyt = (rcmb + 1.35) * np.sin(trench) # arrow end
axis.annotate('', xy=(xxd, yyd), xytext=(xxt, yyt),
- arrowprops=dict(facecolor='red', shrink=0.05))
+ arrowprops=dict(facecolor='red', shrink=0.05),
+ annotation_clip=False)
for ridge in ridges:
xxd = (rcmb + 1.02) * np.cos(ridge)
yyd = (rcmb + 1.02) * np.sin(ridge)
xxt = (rcmb + 1.35) * np.cos(ridge)
yyt = (rcmb + 1.35) * np.sin(ridge)
axis.annotate('', xy=(xxd, yyd), xytext=(xxt, yyt),
- arrowprops=dict(facecolor='green', shrink=0.05))
+ arrowprops=dict(facecolor='green', shrink=0.05),
+ annotation_clip=False)
def _isurf(snap): | Always show plate limit annotations
Annotations outside of data limits wouldn't show. This commit
fix this with the annotation_clip kwarg. | StagPython_StagPy | train | py |
fcbab21294ec7ae964d00ac9a1b68cf31a10177b | diff --git a/ui/plugins/controller.js b/ui/plugins/controller.js
index <HASH>..<HASH> 100644
--- a/ui/plugins/controller.js
+++ b/ui/plugins/controller.js
@@ -270,6 +270,10 @@ treeherder.controller('PluginCtrl', [
// second is when we have the buildapi id and need to send a request
// to the self serve api (which does not listen over pulse!).
ThJobModel.retrigger($scope.repoName, $scope.job.id).then(function() {
+ // XXX: Bug 1170839 disables buildapi retrigger requests for the ash branch
+ if($scope.repoName === "ash") {
+ return;
+ }
// XXX: Remove this after 1134929 is resolved.
var requestId = getBuildbotRequestId();
if (requestId) {
@@ -294,6 +298,10 @@ treeherder.controller('PluginCtrl', [
$scope.cancelJob = function() {
// See note in retrigger logic.
ThJobModel.cancel($scope.repoName, $scope.job.id).then(function() {
+ // XXX: Bug 1170839 disables buildapi cancel requests for the ash branch
+ if($scope.repoName === "ash") {
+ return;
+ }
// XXX: Remove this after 1134929 is resolved.
var requestId = getBuildbotRequestId();
if (requestId) { | Bug <I> - Don't send retrigger/cancel requests for the ash repository r=emorley | mozilla_treeherder | train | js |
a24f976b71d9e66037ee23400b338d3c47ad81fc | diff --git a/src/Classifiers/MiddlewareClassifier.php b/src/Classifiers/MiddlewareClassifier.php
index <HASH>..<HASH> 100644
--- a/src/Classifiers/MiddlewareClassifier.php
+++ b/src/Classifiers/MiddlewareClassifier.php
@@ -37,8 +37,13 @@ class MiddlewareClassifier implements Classifier
{
$reflection = new ReflectionProperty($this->httpKernel, 'middleware');
$reflection->setAccessible(true);
+ $middlewares = $reflection->getValue($this->httpKernel);
- return $reflection->getValue($this->httpKernel);
+ $reflection = new ReflectionProperty($this->httpKernel, 'routeMiddleware');
+ $reflection->setAccessible(true);
+ $routeMiddlwares = $reflection->getValue($this->httpKernel);
+
+ return array_values(array_unique(array_merge($middlewares, $routeMiddlwares)));
}
protected function getMiddlewareGroupsFromKernel() : array | Include Route Middlewares
Include Route Middlewares when retrieving the Middlewares (getMiddlewares) | stefanzweifel_laravel-stats | train | php |
a72f4ecb3ac2cca30531607d3ce591e7157d7eea | diff --git a/src/Symfony/Component/HttpFoundation/HeaderBag.php b/src/Symfony/Component/HttpFoundation/HeaderBag.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/HttpFoundation/HeaderBag.php
+++ b/src/Symfony/Component/HttpFoundation/HeaderBag.php
@@ -101,11 +101,11 @@ class HeaderBag implements \IteratorAggregate, \Countable
/**
* Returns a header value by name.
*
- * @param string $key The header name
- * @param string|string[] $default The default value
- * @param bool $first Whether to return the first value or all header values
+ * @param string $key The header name
+ * @param string|string[]|null $default The default value
+ * @param bool $first Whether to return the first value or all header values
*
- * @return string|string[] The first header value or default value if $first is true, an array of values otherwise
+ * @return string|string[]|null The first header value or default value if $first is true, an array of values otherwise
*/
public function get($key, $default = null, $first = true)
{ | [HttpFoundation] Fixed phpdoc for get method of HeaderBag | symfony_symfony | train | php |
1b330e7a27c93b6bff4f9c6243d4d1e96cf0d1b6 | diff --git a/lib/middleman/core_extensions/front_matter.rb b/lib/middleman/core_extensions/front_matter.rb
index <HASH>..<HASH> 100644
--- a/lib/middleman/core_extensions/front_matter.rb
+++ b/lib/middleman/core_extensions/front_matter.rb
@@ -17,7 +17,7 @@ module Middleman::CoreExtensions::FrontMatter
frontmatter.touch_file(file)
end
- file_deleted do |file|
+ file_deleted FrontMatter.matcher do |file|
frontmatter.remove_file(file)
end
@@ -52,7 +52,7 @@ module Middleman::CoreExtensions::FrontMatter
class FrontMatter
class << self
def matcher
- %r{^source/.*\.html}
+ %r{source/.*\.html}
end
end
@@ -121,4 +121,4 @@ module Middleman::CoreExtensions::FrontMatter
[data, content]
end
end
-end
\ No newline at end of file
+end | Oops - the change to the frontmatter regex broke it somehow. This reverts that change (but also reigns in the file_deleted hook). | middleman_middleman | train | rb |
5ccf848377b56d3786b6c4336164dd7f7e78ff20 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -59,7 +59,7 @@ setup(
version = versioneer.get_version(),
cmdclass = versioneer.get_cmdclass(),
maintainer = "Eduard Broecker",
- maintainer_email = "eduard at gmx dot de",
+ maintainer_email = "eduard@gmx.de",
url = "http://github.com/ebroecker/canmatrix",
classifiers = filter(None, classifiers.split("\n")),
description = doclines[0], | correct maintainer email for pypi | ebroecker_canmatrix | train | py |
e58a49986eedd35b5d084903626bfe8d9acf3090 | diff --git a/lib/HTMLParser.js b/lib/HTMLParser.js
index <HASH>..<HASH> 100644
--- a/lib/HTMLParser.js
+++ b/lib/HTMLParser.js
@@ -4205,7 +4205,7 @@ function HTMLParser(address, fragmentContext, options) {
case 0x0060: // GRAVE ACCENT
/* falls through */
default:
- attrvaluebuf += String.fromCharCode(c);
+ attrvaluebuf += getMatchingChars(UNQUOTEDATTRVAL);
tokenizer = attribute_value_unquoted_state;
break;
} | A small improvement to attribute value parsing performance.
Use `getMatchingChars` when parsing unquoted attribute values. | fgnass_domino | train | js |
42486e86cc07bbf1167d295f95f30b49f1ef5134 | diff --git a/test/test.document_conversion.v1-experimental.js b/test/test.document_conversion.v1-experimental.js
index <HASH>..<HASH> 100644
--- a/test/test.document_conversion.v1-experimental.js
+++ b/test/test.document_conversion.v1-experimental.js
@@ -73,7 +73,8 @@ describe('document_conversion', function() {
it('should generate a valid payload', function() {
var req = servInstance.convert(payload, noop);
- assert(req.uri.href.startsWith(service_options.url + convertPath));
+ var url = service_options.url + convertPath;
+ assert.equal(req.uri.href.slice(0, url.length), url);
assert.equal(req.method, 'POST');
assert(req.formData);
}); | [DCS] Fixes a failing test for Node.js <I>
The test needed to be updated to not use features from ECMAScript 6.
(String.prototype.startsWith) | watson-developer-cloud_node-sdk | train | js |
236ee5f684730ec8cc54f81d54d1f62f1f5ee444 | diff --git a/ejb3/src/main/java/org/jboss/as/ejb3/remote/LocalEjbReceiver.java b/ejb3/src/main/java/org/jboss/as/ejb3/remote/LocalEjbReceiver.java
index <HASH>..<HASH> 100644
--- a/ejb3/src/main/java/org/jboss/as/ejb3/remote/LocalEjbReceiver.java
+++ b/ejb3/src/main/java/org/jboss/as/ejb3/remote/LocalEjbReceiver.java
@@ -225,8 +225,13 @@ public class LocalEjbReceiver extends EJBReceiver implements Service<LocalEjbRec
@Override
- protected void verify(final String appName, final String moduleName, final String distinctName, final String beanName) throws Exception {
- findBean(appName, moduleName, distinctName, beanName);
+ protected boolean exists(final String appName, final String moduleName, final String distinctName, final String beanName) {
+ try {
+ final EjbDeploymentInformation ejbDeploymentInformation = findBean(appName, moduleName, distinctName, beanName);
+ return ejbDeploymentInformation != null;
+ } catch (IllegalArgumentException iae) {
+ return false;
+ }
}
private EjbDeploymentInformation findBean(final String appName, final String moduleName, final String distinctName, final String beanName) { | EJBCLIENT-<I> Update LocalEjbReceiver to take into account the EJB client API change | wildfly_wildfly | train | java |
632ddf251d924485d4e8a6e0aec7c33a7e4d9a4f | diff --git a/lib/xmlseclibs.php b/lib/xmlseclibs.php
index <HASH>..<HASH> 100644
--- a/lib/xmlseclibs.php
+++ b/lib/xmlseclibs.php
@@ -337,9 +337,10 @@ class XMLSecurityKey {
}
if ($this->cryptParams['library'] == 'openssl') {
if ($this->cryptParams['type'] == 'public') {
- /* Load the fingerprint if this is an X509 certificate. */
- $this->X509Fingerprint = self::calculateX509Fingerprint($this->key);
-
+ if ($isCert) {
+ /* Load the fingerprint if this is an X509 certificate. */
+ $this->X509Fingerprint = self::calculateX509Fingerprint($this->key);
+ }
$this->key = openssl_get_publickey($this->key);
} else {
$this->key = openssl_get_privatekey($this->key, $this->passphrase);
@@ -1540,7 +1541,7 @@ class XMLSecEnc {
$x509cert = $x509certNodes->item(0)->textContent;
$x509cert = str_replace(array("\r", "\n"), "", $x509cert);
$x509cert = "-----BEGIN CERTIFICATE-----\n".chunk_split($x509cert, 64, "\n")."-----END CERTIFICATE-----\n";
- $objBaseKey->loadKey($x509cert);
+ $objBaseKey->loadKey($x509cert, FALSE, TRUE);
}
}
break; | don't calculate the fingerprint for anything that is not an x<I> certificate; this fixes an issue where a key value is included -after- the certificate value in the authnresponse and the fingerprint would be overridden (and set to a null value) | simplesamlphp_saml2 | train | php |
eb2e34792e2d8fb51cdf0d8daed894572e8edc37 | diff --git a/test/helper.rb b/test/helper.rb
index <HASH>..<HASH> 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -26,7 +26,7 @@ class Rake::TestCase < Minitest::Test
include Rake::TaskManager
end
- RUBY = Gem.ruby
+ RUBY = ENV['BUNDLE_RUBY'] || Gem.ruby
def setup
ARGV.clear | Support test-bundled-gems task on ruby core repository | ruby_rake | train | rb |
e6c945c927c6939a226854fe5ef0fd6b2ce7271a | diff --git a/restcomm/restcomm.dao/src/main/java/org/mobicents/servlet/restcomm/dao/mybatis/MybatisUsageDao.java b/restcomm/restcomm.dao/src/main/java/org/mobicents/servlet/restcomm/dao/mybatis/MybatisUsageDao.java
index <HASH>..<HASH> 100644
--- a/restcomm/restcomm.dao/src/main/java/org/mobicents/servlet/restcomm/dao/mybatis/MybatisUsageDao.java
+++ b/restcomm/restcomm.dao/src/main/java/org/mobicents/servlet/restcomm/dao/mybatis/MybatisUsageDao.java
@@ -120,7 +120,6 @@ public final class MybatisUsageDao implements UsageDao {
return usageRecords;
} finally {
session.close();
- System.out.println("Query '" + queryName + "' took " + (System.currentTimeMillis()-startTime) + "ms to complete.");
}
} | Removed System.out.println | RestComm_Restcomm-Connect | train | java |
8a931393e9499795a5c53a8fb8208842643cb38b | diff --git a/lib/chronic.rb b/lib/chronic.rb
index <HASH>..<HASH> 100644
--- a/lib/chronic.rb
+++ b/lib/chronic.rb
@@ -42,7 +42,7 @@ require 'chronic/time_zone'
require 'numerizer/numerizer'
module Chronic
- VERSION = "0.2.3"
+ VERSION = "0.2.4"
class << self
attr_accessor :debug
@@ -129,4 +129,4 @@ class Time
Time.local(year, month, day, hour, minute, second)
end
-end
\ No newline at end of file
+end | update version number to reflect History.txt | mojombo_chronic | train | rb |
abef89168f08a75a8699e18c06f5413a98d44a86 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -113,6 +113,7 @@ entry_points = {
"TaskotronProcessor",
"releng=fedmsg_meta_fedora_infrastructure.releng:RelengProcessor",
"mdapi=fedmsg_meta_fedora_infrastructure.mdapi:MdapiProcessor",
+ "nagios=fedmsg_meta_fedora_infrastructure.nagios:NagiosProcessor",
]
} | Forgotten setup.py line. | fedora-infra_fedmsg_meta_fedora_infrastructure | train | py |
e30cc73b1d4e281a0123cb1d914101b1ce7aaf44 | diff --git a/agent/http_oss_test.go b/agent/http_oss_test.go
index <HASH>..<HASH> 100644
--- a/agent/http_oss_test.go
+++ b/agent/http_oss_test.go
@@ -72,7 +72,8 @@ func TestHTTPAPI_MethodNotAllowed_OSS(t *testing.T) {
testMethodNotAllowed := func(method string, path string, allowedMethods []string) {
t.Run(method+" "+path, func(t *testing.T) {
client := fastClient
- if path == "/v1/agent/leave" {
+ switch path {
+ case "/v1/agent/leave", "/v1/agent/self":
// there are actual sleeps in this code that should take longer
client = slowClient
t.Logf("Using slow http client for leave tests") | Update agent tests to wait a bit longer for the /v1/agent/self endpoint (#<I>) | hashicorp_consul | train | go |
5bf5a823ffdbfd8df7296b78f0218ce6b33a5128 | diff --git a/contractcourt/chain_watcher.go b/contractcourt/chain_watcher.go
index <HASH>..<HASH> 100644
--- a/contractcourt/chain_watcher.go
+++ b/contractcourt/chain_watcher.go
@@ -578,8 +578,20 @@ func (c *chainWatcher) dispatchContractBreach(spendEvent *chainntnfs.SpendDetail
return fmt.Errorf("unable to create breach retribution: %v", err)
}
+ // Nil the curve before printing.
+ if retribution.RemoteOutputSignDesc != nil &&
+ retribution.RemoteOutputSignDesc.DoubleTweak != nil {
+ retribution.RemoteOutputSignDesc.DoubleTweak.Curve = nil
+ }
+ if retribution.LocalOutputSignDesc != nil &&
+ retribution.LocalOutputSignDesc.DoubleTweak != nil {
+ retribution.LocalOutputSignDesc.DoubleTweak.Curve = nil
+ }
+
log.Debugf("Punishment breach retribution created: %v",
- spew.Sdump(retribution))
+ newLogClosure(func() string {
+ return spew.Sdump(retribution)
+ }))
// With the event processed, we'll now notify all subscribers of the
// event. | contractcourt/chain_watcher: don't print curve of DoubleTweak | lightningnetwork_lnd | train | go |
0ec5fbf3b4a0de1ee6f909a555b5edf3757e18fe | diff --git a/airflow/hooks/hive_hooks.py b/airflow/hooks/hive_hooks.py
index <HASH>..<HASH> 100644
--- a/airflow/hooks/hive_hooks.py
+++ b/airflow/hooks/hive_hooks.py
@@ -47,6 +47,7 @@ class HiveCliHook(BaseHook):
True
"""
conn = self.conn
+ schema = schema or conn.schema
if schema:
hql = "USE {schema};\n{hql}".format(**locals()) | Picking up the connection's schema in hive operator | apache_airflow | train | py |
897cd83a8bad21354578b89b27faabd94582a038 | diff --git a/lib/Project/Image.php b/lib/Project/Image.php
index <HASH>..<HASH> 100644
--- a/lib/Project/Image.php
+++ b/lib/Project/Image.php
@@ -114,6 +114,11 @@ class Image extends TimberImage {
$originalWidth = parent::width();
$width = $this->width($customSize);
+ if (!isset($width)) {
+ // if image doesn't exist, width won't be set
+ return 0;
+ }
+
if ($width != $originalWidth) {
// distinct custom dimensions; calculate new based on aspect ratio
$height = floor( $width / $this->aspect() ); | If image file doesn't exist, Image::height() should return 0 | sitecrafting_groot | train | php |
ff1b618854275c5294e43700aac236ca04f158fe | diff --git a/lib/atdis/models/page.rb b/lib/atdis/models/page.rb
index <HASH>..<HASH> 100644
--- a/lib/atdis/models/page.rb
+++ b/lib/atdis/models/page.rb
@@ -32,7 +32,7 @@ module ATDIS
if response.respond_to?(:count)
errors.add(:count, ErrorMessage["is not the same as the number of applications returned", "6.4"]) if count != response.count
end
- if pagination.respond_to?(:per_page)
+ if pagination.respond_to?(:per_page) && pagination.per_page
errors.add(:count, ErrorMessage["should not be larger than the number of results per page", "6.4"]) if count > pagination.per_page
end
end | Only do comparison if both numbers are not nil | openaustralia_atdis | train | rb |
c437a927c4477381d612b5ed4b37c7712875374f | diff --git a/IndexedRedis/utils.py b/IndexedRedis/utils.py
index <HASH>..<HASH> 100644
--- a/IndexedRedis/utils.py
+++ b/IndexedRedis/utils.py
@@ -3,7 +3,6 @@
# Some random utility functions
-
# vim:set ts=8 shiftwidth=8 softtabstop=8 noexpandtab :
@@ -32,9 +31,8 @@ class KeyList(list):
'''
def __getitem__(self, item):
- if isinstance(item, int):
+ if isinstance(item, (int, slice)):
return list.__getitem__(self, item)
-
try:
idx = self.index(item)
except: | Support slicing FIELDS after it is converted to a KeyList | kata198_indexedredis | train | py |
6663664b8922f58d9c1893e0db247c56ccad3993 | diff --git a/src/transforms/ViewLayout.js b/src/transforms/ViewLayout.js
index <HASH>..<HASH> 100644
--- a/src/transforms/ViewLayout.js
+++ b/src/transforms/ViewLayout.js
@@ -17,7 +17,8 @@ var AxisRole = 'axis',
ColHeader = 'column-header',
ColFooter = 'column-footer';
-var tempBounds = new Bounds();
+var AxisOffset = 0.5,
+ tempBounds = new Bounds();
/**
* Layout view elements such as axes and legends.
@@ -184,7 +185,7 @@ function layoutAxis(view, axis, width, height) {
// update bounds
boundStroke(bounds.translate(x, y), item);
- if (set(item, 'x', x + 0.5) | set(item, 'y', y + 0.5)) {
+ if (set(item, 'x', x + AxisOffset) | set(item, 'y', y + AxisOffset)) {
item.bounds = tempBounds;
view.dirty(item);
item.bounds = bounds; | Lift axis half-pixel offset to named constant. | vega_vega-view | train | js |
ad39fba1ed9c609d247011b937e053c1192e9767 | diff --git a/model-test/src/main/java/org/jboss/as/model/test/EAPRepositoryReachableUtil.java b/model-test/src/main/java/org/jboss/as/model/test/EAPRepositoryReachableUtil.java
index <HASH>..<HASH> 100644
--- a/model-test/src/main/java/org/jboss/as/model/test/EAPRepositoryReachableUtil.java
+++ b/model-test/src/main/java/org/jboss/as/model/test/EAPRepositoryReachableUtil.java
@@ -39,7 +39,7 @@ public class EAPRepositoryReachableUtil {
public static boolean isReachable() {
if (reachable == null) {
- if (System.getProperties().contains(TEST_TRANSFORMERS_EAP)) {
+ if (System.getProperties().containsKey(TEST_TRANSFORMERS_EAP)) {
try {
InetAddress.getByName(EAP_REPOSITORY_HOST);
reachable = true; | [WFLY-<I>] More forgiving specification of -Djboss.test.transformers.eap
was: <I>f<I>e5ae<I>d<I>a5c2dfd<I>ad<I> | wildfly_wildfly-core | train | java |
0a0c91195e4131314fa8f0c0c2f20ff59b5c3d04 | diff --git a/salt/modules/linux_lvm.py b/salt/modules/linux_lvm.py
index <HASH>..<HASH> 100644
--- a/salt/modules/linux_lvm.py
+++ b/salt/modules/linux_lvm.py
@@ -444,7 +444,7 @@ def lvcreate(
salt '*' lvm.lvcreate new_volume_name vg_name extents=100 pv=/dev/sdb
salt '*' lvm.lvcreate new_snapshot vg_name snapshot=volume_name size=3G
- .. versionadded:: to_complete
+ .. versionadded:: 0.12.0
Support for thin pools and thin volumes
diff --git a/salt/states/lvm.py b/salt/states/lvm.py
index <HASH>..<HASH> 100644
--- a/salt/states/lvm.py
+++ b/salt/states/lvm.py
@@ -252,7 +252,7 @@ def lv_present(
Any supported options to lvcreate. See
:mod:`linux_lvm <salt.modules.linux_lvm>` for more details.
- .. versionadded:: to_complete
+ .. versionadded:: 2016.11.0
thinvolume
Logical Volume is thinly provisioned | Use the right version on `versionadded` | saltstack_salt | train | py,py |
eace9eb25f59df3f087cc3e03abadff5a440f786 | diff --git a/src/sap.ui.core/test/sap/ui/core/qunit/mvc/AnyViewAsync.qunit.js b/src/sap.ui.core/test/sap/ui/core/qunit/mvc/AnyViewAsync.qunit.js
index <HASH>..<HASH> 100644
--- a/src/sap.ui.core/test/sap/ui/core/qunit/mvc/AnyViewAsync.qunit.js
+++ b/src/sap.ui.core/test/sap/ui/core/qunit/mvc/AnyViewAsync.qunit.js
@@ -37,7 +37,9 @@ sap.ui.define([
success : function(data) {
sSource = oConfig.receiveSource(data);
},
- async : false
+ async : false,
+ // avoid that jQuery executes the loaded code in case of JSView which causes CSP violation
+ dataType: sType === "js" ? "text" : undefined
});
// fake an asynchronous resource request to have control over the delay
@@ -155,4 +157,4 @@ sap.ui.define([
return asyncTestsuite;
-});
\ No newline at end of file
+}); | [INTERNAL] core.mvc: make view loading in test more CSP futureproof
- in case of loading JS resources, the header "text" is used to avoid
evaluating the loaded content by jQuery
Change-Id: I<I>abae4b0bc<I>d3b4efa<I>ca<I>ff5bbcb | SAP_openui5 | train | js |
571dff88ad88c6b058ba5394459d971a726e4310 | diff --git a/satpy/readers/utils.py b/satpy/readers/utils.py
index <HASH>..<HASH> 100644
--- a/satpy/readers/utils.py
+++ b/satpy/readers/utils.py
@@ -202,7 +202,7 @@ def unzip_file(filename):
fdn, tmpfilepath = tempfile.mkstemp()
LOGGER.info("Using temp file for BZ2 decompression:", tmpfilepath)
# If in python 3, try pbzip2
- if sys.version_info > (3, 0):
+ if sys.version_info.major >= 3:
pbzip = shutil.which('pbzip2')
# Run external pbzip2
if pbzip is not None: | Change python version checker to check only the major release number in unzip_files | pytroll_satpy | train | py |
d1ab7f3de08e294f92d7c77cfe1e8adaacbecf0b | diff --git a/imagen/random.py b/imagen/random.py
index <HASH>..<HASH> 100644
--- a/imagen/random.py
+++ b/imagen/random.py
@@ -2,6 +2,7 @@
Two-dimensional pattern generators drawing from various random distributions.
"""
+import warnings
import numpy as np
import param
from param.parameterized import ParamOverrides
@@ -17,9 +18,8 @@ from numbergen import TimeAware, Hash
def seed(seed=None):
"""
Set the seed on the shared RandomState instance.
-
- Convenience function: shortcut to RandomGenerator.random_generator.seed().
"""
+ warnings.warn("Use param.seed instead. To be deprecated.", FutureWarning)
RandomGenerator.random_generator.seed(seed) | Added warning to random.seed function as it should not be used | pyviz_imagen | train | py |
a158e3f054e357f60e2b478133159089b140a3dc | diff --git a/examples/multiple_logging.py b/examples/multiple_logging.py
index <HASH>..<HASH> 100644
--- a/examples/multiple_logging.py
+++ b/examples/multiple_logging.py
@@ -21,7 +21,7 @@ LOGGER = logging.getLogger('enlighten')
DATACENTERS = 5
SYSTEMS = (10, 20) # Range
-FILES = (100, 1000) # Range
+FILES = (10, 100) # Range
def process_files(manager):
@@ -49,7 +49,7 @@ def process_files(manager):
# Iterate through files
for fnum in range(files): # pylint: disable=unused-variable
system.update() # Update count
- time.sleep(random.uniform(0.0001, 0.0005)) # Random processing time
+ time.sleep(random.uniform(0.001, 0.005)) # Random processing time
system.close() # Close counter so it gets removed
# Log status | Use less granular time in examples | Rockhopper-Technologies_enlighten | train | py |
ca1cefab390ec14e9a181701ff66a3396ed4ccc8 | diff --git a/AWSScout2/utils_vpc.py b/AWSScout2/utils_vpc.py
index <HASH>..<HASH> 100644
--- a/AWSScout2/utils_vpc.py
+++ b/AWSScout2/utils_vpc.py
@@ -79,8 +79,11 @@ def list_resources_in_security_group(aws_config, current_config, path, current_p
else:
sg['used_by'][service]['resource_type'][resource_type].append(resource_id)
except Exception as e:
- printInfo('Exception caught.')
- printException(e)
+ vpc_id = current_path[5]
+ if vpc_id == ec2_classic and resource_type == 'elbs':
+ pass
+ else:
+ printException(e)
#
# Add a display name for all known CIDRs | For ELBs in EC2 classic , no ELBs is normal -- ignore exception | nccgroup_Scout2 | train | py |
8575b73298b0daa76f97b76ade42be04a9b106b9 | diff --git a/test/e2e_node/memory_eviction_test.go b/test/e2e_node/memory_eviction_test.go
index <HASH>..<HASH> 100644
--- a/test/e2e_node/memory_eviction_test.go
+++ b/test/e2e_node/memory_eviction_test.go
@@ -33,7 +33,7 @@ import (
// Eviction Policy is described here:
// https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/kubelet-eviction.md
-var _ = framework.KubeDescribe("MemoryEviction [Slow] [Serial]", func() {
+var _ = framework.KubeDescribe("MemoryEviction [Slow] [Serial] [Disruptive]", func() {
f := framework.NewDefaultFramework("eviction-test")
Context("When there is memory pressure", func() { | Label MemoryEviction [Disruptive] | kubernetes_kubernetes | train | go |
5fc2fb4abed32a5fc66f76b6c8888d09406c7646 | diff --git a/tests/export_unittest.py b/tests/export_unittest.py
index <HASH>..<HASH> 100644
--- a/tests/export_unittest.py
+++ b/tests/export_unittest.py
@@ -88,7 +88,6 @@ class GetCalculationsTestCase(BaseExportTestCase):
"""Tests for the :function:`openquake.export.get_calculations` API
function."""
-
def test_get_calculations(self):
# Test that :function:`openquake.export.get_calculations` retrieves
# only _completed_ calculations for the given user, in reverse chrono | removed an excess blank line
Former-commit-id: c8a<I>ee<I>c<I>d<I>ffbc<I>d<I>a<I>f6a | gem_oq-engine | train | py |
2187fddd4384f967735baad6ca8949175131245d | diff --git a/tests/TestCase/Database/ConnectionTest.php b/tests/TestCase/Database/ConnectionTest.php
index <HASH>..<HASH> 100644
--- a/tests/TestCase/Database/ConnectionTest.php
+++ b/tests/TestCase/Database/ConnectionTest.php
@@ -204,9 +204,9 @@ class ConnectionTest extends TestCase {
$sql = 'SELECT 1';
$statement = $this->connection->execute($sql);
$result = $statement->fetch();
- $statement->closeCursor();
$this->assertCount(1, $result);
$this->assertEquals([1], $result);
+ $statement->closeCursor();
}
/** | Moving closeCursor() call after count(), just in case | cakephp_cakephp | train | php |
1cbee5e3ac1b6429da043fca04637e970a2a80a4 | diff --git a/flink-core/src/main/java/org/apache/flink/configuration/MemorySize.java b/flink-core/src/main/java/org/apache/flink/configuration/MemorySize.java
index <HASH>..<HASH> 100644
--- a/flink-core/src/main/java/org/apache/flink/configuration/MemorySize.java
+++ b/flink-core/src/main/java/org/apache/flink/configuration/MemorySize.java
@@ -42,7 +42,7 @@ import static org.apache.flink.util.Preconditions.checkNotNull;
*
*/
@PublicEvolving
-public class MemorySize implements java.io.Serializable {
+public class MemorySize implements java.io.Serializable, Comparable<MemorySize> {
private static final long serialVersionUID = 1L;
@@ -120,6 +120,11 @@ public class MemorySize implements java.io.Serializable {
return bytes + " bytes";
}
+ @Override
+ public int compareTo(MemorySize that) {
+ return Long.compare(this.bytes, that.bytes);
+ }
+
// ------------------------------------------------------------------------
// Calculations
// ------------------------------------------------------------------------ | [hotfix] Make MemorySize comparable. | apache_flink | train | java |
35b2d957c5485f355743eee871775db1ffdae7b5 | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -15,7 +15,8 @@ module.exports = function(grunt) {
commit: true,
commitFiles: ['-a'],
createTag: true,
- push: true
+ push: true,
+ pushTo: 'origin'
}
},
uglify: { | - small fix in grunt-bump config | unnoon_bottom_line | train | js |
a8d94cbb732eb2cbb015c61aa6a5d74f660dd153 | diff --git a/lib/slanger/redis.rb b/lib/slanger/redis.rb
index <HASH>..<HASH> 100644
--- a/lib/slanger/redis.rb
+++ b/lib/slanger/redis.rb
@@ -11,8 +11,8 @@ module Slanger
# Dispatch messages received from Redis to their destination channel.
base.on(:message) do |channel, message|
message = JSON.parse message
- const = message['channel'] =~ /^presence-/ ? 'PresenceChannel' : 'Channel'
- Slanger.const_get(const).find_or_create_by_channel_id(message['channel']).dispatch message, channel
+ klass = message['channel'][/^presence-/] ? PresenceChannel : Channel
+ klass.find_or_create_by_channel_id(message['channel']).dispatch message, channel
end
end | use constant directly instead of with const_get. Bonus points come with the truthiness parody | stevegraham_slanger | train | rb |
a412a505245c8777950143c70fa784ff71bcfcf4 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -19,7 +19,7 @@ def readme():
return f.read()
setup(name='zeroless',
- version='0.3.0',
+ version='0.4.0',
description='A pythonic approach for distributed systems with ZeroMQ.',
long_description=readme(),
classifiers=[ | Updated version of the zeroless module in the setup.py file. | zmqless_python-zeroless | train | py |
eea7136f168ed21fbca4ab3475d4b2feca7412da | diff --git a/CampaignChainActivityGoToWebinarBundle.php b/CampaignChainActivityGoToWebinarBundle.php
index <HASH>..<HASH> 100755
--- a/CampaignChainActivityGoToWebinarBundle.php
+++ b/CampaignChainActivityGoToWebinarBundle.php
@@ -1,4 +1,12 @@
<?php
+/*
+ * This file is part of the CampaignChain package.
+ *
+ * (c) Sandro Groganz <sandro@campaignchain.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
namespace CampaignChain\Activity\GoToWebinarBundle; | CE-<I> Basic MailChimp integration | CampaignChain_activity-gotowebinar | train | php |
a860d043002158e117e9797a4ba25620bcde7163 | diff --git a/packages/components/bolt-text/__tests__/text.js b/packages/components/bolt-text/__tests__/text.js
index <HASH>..<HASH> 100644
--- a/packages/components/bolt-text/__tests__/text.js
+++ b/packages/components/bolt-text/__tests__/text.js
@@ -71,7 +71,7 @@ describe('<bolt-text> Component', () => {
const image = await page.screenshot();
expect(image).toMatchImageSnapshot({
- failureThreshold: '0.01',
+ failureThreshold: '0.03',
failureThresholdType: 'percent',
}); | test: increase failure threshold to 3% | bolt-design-system_bolt | train | js |
7548ac1cffad9b2f971f3064a7c1785ff3dd25c7 | diff --git a/app/controllers/subscriptions_controller.rb b/app/controllers/subscriptions_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/subscriptions_controller.rb
+++ b/app/controllers/subscriptions_controller.rb
@@ -234,11 +234,9 @@ class SubscriptionsController < ApplicationController
end
def create_temp_file(prefix)
- # default external encoding in Ruby 1.9.3 is UTF-8, while binary files use binary encoding - ASCII-8BIT
+ # default external encoding in Ruby 1.9.3 is UTF-8, need to specify that we are opening a binary file (ASCII-8BIT encoding)
f = File.new(
- File.join(find_or_create_temp_dir, "#{prefix}_#{SecureRandom.hex(10)}.zip"),
- (defined? ::Encoding) ? 'w+:ASCII-8BIT' : 'w+',
- 0600)
+ File.join(find_or_create_temp_dir, "#{prefix}_#{SecureRandom.hex(10)}.zip"), 'wb+', 0600)
yield f if block_given?
f.path | switched to a more succinct way to open a binary file | Katello_katello | train | rb |
6ce924fa9f8ab2d96d8d78461d9a88aa0e99ec7b | diff --git a/activemodel/test/cases/serializable/json_test.rb b/activemodel/test/cases/serializable/json_test.rb
index <HASH>..<HASH> 100644
--- a/activemodel/test/cases/serializable/json_test.rb
+++ b/activemodel/test/cases/serializable/json_test.rb
@@ -14,9 +14,11 @@ class Contact
end
end
+ remove_method :attributes if method_defined?(:attributes)
+
def attributes
instance_values
- end unless method_defined?(:attributes)
+ end
end
class JsonSerializationTest < ActiveModel::TestCase
diff --git a/activemodel/test/cases/serializable/xml_test.rb b/activemodel/test/cases/serializable/xml_test.rb
index <HASH>..<HASH> 100644
--- a/activemodel/test/cases/serializable/xml_test.rb
+++ b/activemodel/test/cases/serializable/xml_test.rb
@@ -9,6 +9,8 @@ class Contact
attr_accessor :address, :friends
+ remove_method :attributes if method_defined?(:attributes)
+
def attributes
instance_values.except("address", "friends")
end | fix method redefined warning in activemodel | rails_rails | train | rb,rb |
6b5f3ba0fbf12b8ab34315cd5dbc34ea6a3f58c9 | diff --git a/openid/test/test_auth_request.py b/openid/test/test_auth_request.py
index <HASH>..<HASH> 100644
--- a/openid/test/test_auth_request.py
+++ b/openid/test/test_auth_request.py
@@ -60,6 +60,20 @@ class TestAuthRequestBase(object):
error_message = 'openid.%s unexpectedly present: %s' % (key, actual)
self.failIf(actual is not None, error_message)
+ def test_checkNoAssocHandle(self):
+ self.authreq.assoc = None
+ msg = self.authreq.getMessage(self.realm, self.return_to,
+ self.immediate)
+
+ self.failIfOpenIDKeyExists(msg, 'assoc_handle')
+
+ def test_checkWithAssocHandle(self):
+ msg = self.authreq.getMessage(self.realm, self.return_to,
+ self.immediate)
+
+ self.failUnlessOpenIDValueEquals(msg, 'assoc_handle',
+ self.assoc.handle)
+
def test_addExtensionArg(self):
self.authreq.addExtensionArg('bag:', 'color', 'brown')
self.authreq.addExtensionArg('bag:', 'material', 'paper') | [project @ Check assoc_handle against assoc object] | openid_python-openid | train | py |
223e1dfebea7aefd59cdd1b76e4368a1f2ba5e46 | diff --git a/spyder/plugins/editor.py b/spyder/plugins/editor.py
index <HASH>..<HASH> 100644
--- a/spyder/plugins/editor.py
+++ b/spyder/plugins/editor.py
@@ -1475,9 +1475,10 @@ class Editor(SpyderPluginWidget):
def refresh_save_all_action(self):
"""Enable 'Save All' if there are files to be saved"""
editorstack = self.get_current_editorstack()
- state = any(finfo.editor.document().isModified()
- for finfo in editorstack.data)
- self.save_all_action.setEnabled(state)
+ if editorstack:
+ state = any(finfo.editor.document().isModified()
+ for finfo in editorstack.data)
+ self.save_all_action.setEnabled(state)
def update_warning_menu(self):
"""Update warning list menu""" | Adds a validation for the editorstack existence. | spyder-ide_spyder | train | py |
074787d6832b88a420bfb7a192801a2dbfea2a8e | diff --git a/core/src/test/java/org/infinispan/test/MultipleCacheManagersTest.java b/core/src/test/java/org/infinispan/test/MultipleCacheManagersTest.java
index <HASH>..<HASH> 100644
--- a/core/src/test/java/org/infinispan/test/MultipleCacheManagersTest.java
+++ b/core/src/test/java/org/infinispan/test/MultipleCacheManagersTest.java
@@ -988,13 +988,13 @@ public abstract class MultipleCacheManagersTest extends AbstractCacheTest {
public boolean test(CM mode, IMethodInstance method) {
// If both method and class have the annotation, method annotation has priority.
- A clazzAnnotation = method.getInstance().getClass().getAnnotation(annotationClazz);
A methodAnnotation = method.getMethod().getConstructorOrMethod().getMethod().getAnnotation(annotationClazz);
if (methodAnnotation != null) {
// If a method-level annotation contains current cache mode, run it, otherwise ignore that
return Stream.of(modesRetriever.apply(methodAnnotation)).anyMatch(m -> modeChecker.test(m, mode));
} else {
- return clazzAnnotation != null;
+ // If there is no method-level annotation, always run it
+ return true;
}
}
} | ISPN-<I> Run all test methods when the class isn't annotated @InCacheMode
Or @InTransactionMode | infinispan_infinispan | train | java |
1ea3ff8fdeb285bb5c4fd1d3d5cc8781216d0a2c | diff --git a/guava/src/com/google/common/collect/UnmodifiableIterator.java b/guava/src/com/google/common/collect/UnmodifiableIterator.java
index <HASH>..<HASH> 100644
--- a/guava/src/com/google/common/collect/UnmodifiableIterator.java
+++ b/guava/src/com/google/common/collect/UnmodifiableIterator.java
@@ -23,6 +23,10 @@ import java.util.Iterator;
/**
* An iterator that does not support {@link #remove}.
*
+ * <p>{@code UnmodifiableIterator} is used primarily in conjunction with implementations of
+ * {@link ImmutableCollection}, such as {@link ImmutableList}. You can, however, convert an existing
+ * iterator to an {@code UnmodifiableIterator} using {@link Iterators#unmodifiableIterator}.
+ *
* @author Jared Levy
* @since 2.0
*/ | Give people who have never used UnmodifiableIterator before a hint.
-------------
Created by MOE: <URL> | google_guava | train | java |
0c7ad5fa7f5164ef32295a39e53d1022c9c12faa | diff --git a/masonite/snippets/auth/controllers/RegisterController.py b/masonite/snippets/auth/controllers/RegisterController.py
index <HASH>..<HASH> 100644
--- a/masonite/snippets/auth/controllers/RegisterController.py
+++ b/masonite/snippets/auth/controllers/RegisterController.py
@@ -45,7 +45,7 @@ class RegisterController:
user.verify_email(mail_manager, request)
# Login the user
- if auth.login(request.input(auth_config.AUTH['model'].__auth__), request.input('password')):
+ if auth.login(request.input('name'), request.input('password')):
# Redirect to the homepage
return request.redirect('/home') | fixed issue with logging in with multiple authentications | MasoniteFramework_masonite | train | py |
9b39f2c92704a3e4bf3a98fcf9004a9dfa0e9e27 | diff --git a/src/Strict.php b/src/Strict.php
index <HASH>..<HASH> 100644
--- a/src/Strict.php
+++ b/src/Strict.php
@@ -13,10 +13,7 @@ use function reset;
use function strtolower;
class Strict implements Iterator, ArrayAccess, Countable {
- /**
- * @var array
- */
- protected $container = [];
+ protected array $container = [];
/**
* Hash the initial array, and store in the container. | Declare type for Strict:: property | Ayesh_case-insensitive-array | train | php |
845bf8e9377f13193cb7c66264f8ffb7e05f09d3 | diff --git a/tests/test_twitter.py b/tests/test_twitter.py
index <HASH>..<HASH> 100644
--- a/tests/test_twitter.py
+++ b/tests/test_twitter.py
@@ -114,7 +114,7 @@ async def test_oauth2_bearer_token(oauth2_client):
@oauth2_decorator
async def test_oauth2_nonexisting_endpoint(oauth2_client):
- with pytest.raises(exceptions.DoesNotExist):
+ with pytest.raises(exceptions.HTTPNotFound):
await oauth2_client.api.whereismytweet.get() | tests: expect HTTPNotFound on nonexisting endpoint (?)
it seems to happen consistently and doesn't matter that much I suppose | odrling_peony-twitter | train | py |
02bb72664ea23e347e7962359f0c1e60d9f85ebb | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@ from setuptools import setup
setup(
name="arxiv",
- version="0.1.0",
+ version="0.1.1",
packages=["arxiv"],
# dependencies
@@ -18,5 +18,5 @@ setup(
license="MIT",
keywords="arxiv api wrapper academic journals papers",
url="https://github.com/lukasschwab/arxiv.py",
- download_url="https://github.com/lukasschwab/arxiv.py/tarball/0.1.0",
+ download_url="https://github.com/lukasschwab/arxiv.py/tarball/0.1.1",
)
\ No newline at end of file | Increment version to <I> | lukasschwab_arxiv.py | train | py |
d2aef334c510378e09e859d44ec7775078eb3e59 | diff --git a/wire.py b/wire.py
index <HASH>..<HASH> 100644
--- a/wire.py
+++ b/wire.py
@@ -723,7 +723,7 @@ Note that this is a platform-independent method of activating IME
resources.append(
SessionResource('/session/:sessionId/frame').
- Post('''Change focus to another frame on the page. If the frame ID is \
+ Post('''Change focus to another frame on the page. If the frame `id` is \
`null`, the server
should switch to the page's default content.''').
AddJsonParameter('id', '{string|number|null|WebElement JSON Object}', | LukeIS: updating wire protocol doc from frame switching the parameter is 'id' (so updating reference to it as 'ID' to lowercase). Fixes Issue <I>
r<I> | SeleniumHQ_selenium | train | py |
e086a3e33c84c8b8f51ab86909216fc7aa28f8ae | diff --git a/specs-go/config.go b/specs-go/config.go
index <HASH>..<HASH> 100644
--- a/specs-go/config.go
+++ b/specs-go/config.go
@@ -61,7 +61,7 @@ type User struct {
GID uint32 `json:"gid" platform:"linux,solaris"`
// AdditionalGids are additional group ids set for the container's process.
AdditionalGids []uint32 `json:"additionalGids,omitempty" platform:"linux,solaris"`
- // Username is the user name. (this field is platform dependent)
+ // Username is the user name.
Username string `json:"username,omitempty" platform:"windows"`
} | specs-go/config: Drop "this field is platform dependent" (again)
We dropped these in <I> (specs-go/config: Drop "this field is
platform dependent", <I>-<I>-<I>, #<I>) but f9e<I>e<I> (Windows: User
struct changes, <I>-<I>-<I>, #<I>) was developed in parallel and
brought in a new one. | opencontainers_runtime-spec | train | go |
8c10d25dab8df5992af03adaed3180e6f11fec09 | diff --git a/lib/heroku/helpers/addons/api.rb b/lib/heroku/helpers/addons/api.rb
index <HASH>..<HASH> 100644
--- a/lib/heroku/helpers/addons/api.rb
+++ b/lib/heroku/helpers/addons/api.rb
@@ -1,7 +1,7 @@
module Heroku::Helpers
module Addons
module API
- VERSION="3.switzerland".freeze
+ VERSION="3".freeze
def request(options = {})
defaults = { | Remove switzerland variant from version | heroku_legacy-cli | train | rb |
26f6d042fd44bc15316c7665f4c033e68ae34a97 | diff --git a/src/Kunstmaan/VotingBundle/Services/RepositoryResolver.php b/src/Kunstmaan/VotingBundle/Services/RepositoryResolver.php
index <HASH>..<HASH> 100644
--- a/src/Kunstmaan/VotingBundle/Services/RepositoryResolver.php
+++ b/src/Kunstmaan/VotingBundle/Services/RepositoryResolver.php
@@ -15,7 +15,11 @@ use Kunstmaan\VotingBundle\Event\Facebook\FacebookSendEvent;
*/
class RepositoryResolver
{
-
+ /**
+ * Entity manager
+ */
+ protected $em;
+
/**
* Constructor
* @param Object $em entity manager
@@ -69,4 +73,4 @@ class RepositoryResolver
return $this->em->getRepository($name);
}
-}
\ No newline at end of file
+} | Update RepositoryResolver.php | Kunstmaan_KunstmaanBundlesCMS | train | php |
1b34b59afa0e2a19139a75c8b488e1aefdfc7297 | diff --git a/src/Tomahawk/HttpKernel/Kernel.php b/src/Tomahawk/HttpKernel/Kernel.php
index <HASH>..<HASH> 100644
--- a/src/Tomahawk/HttpKernel/Kernel.php
+++ b/src/Tomahawk/HttpKernel/Kernel.php
@@ -82,7 +82,7 @@ abstract class Kernel implements KernelInterface, TerminableInterface
const MAJOR_VERSION = '2';
const MINOR_VERSION = '0';
const RELEASE_VERSION = '0';
- const EXTRA_VERSION = 'b2';
+ const EXTRA_VERSION = 'b3';
/**
* Constructor. | Update to version <I>b3 [skip ci] | tomahawkphp_framework | train | php |
44a2b69c471760f3124e4bd5da18784680888349 | diff --git a/lib/Models/CatalogItem.js b/lib/Models/CatalogItem.js
index <HASH>..<HASH> 100644
--- a/lib/Models/CatalogItem.js
+++ b/lib/Models/CatalogItem.js
@@ -322,7 +322,6 @@ var CatalogItem = function(terria) {
}
});
-
/**
* Gets the CatalogItems current time.
* This property is an observable version of clock.currentTime, they will always have the same value.
@@ -339,6 +338,22 @@ var CatalogItem = function(terria) {
},
});
+ /**
+ * Gets the CatalogItems current time as the discrete time that time the catalogItem has information for.
+ * Returns undefined if it is not possible to query the time (i.e. the item doesn't have a clock or canUseOwnClock is false).
+ *
+ * @member {Date} The CatalogItems discrete current time.
+ * @memberOf CatalogItem.prototype
+ */
+ knockout.defineProperty(this, 'discreteTime', {
+ get : function() {
+ if (!defined(this.currentTime) || !defined(this.availableDates) || !defined(this.intervals) || (this.intervals.length === 0)) {
+ return undefined;
+ }
+
+ return this.availableDates[this.intervals.indexOf(this.currentTime)];
+ },
+ });
// A property which defines when we are using the terria clock.
// We define this as a knockout property so that we can watch for changes to the propery triggered by observables | [#<I>] CatalogItem: Add a discreteTime property. | TerriaJS_terriajs | train | js |
5598fc8831e009249dc2f5c3eeca1c773142d83a | diff --git a/test/test_dataproperty.py b/test/test_dataproperty.py
index <HASH>..<HASH> 100644
--- a/test/test_dataproperty.py
+++ b/test/test_dataproperty.py
@@ -33,6 +33,8 @@ if six.PY2:
sys.setdefaultencoding("utf-8")
+dateutil = pytest.importorskip("dateutil", minversion="2.7")
+
DATATIME_DATA = datetime.datetime(2017, 1, 2, 3, 4, 5)
nan = float("nan") | Add importorskip to a test file | thombashi_DataProperty | train | py |
33c2f39d5e17eac4d1595b3713782f584a0f03fe | diff --git a/ext/rest/src/main/java/org/minimalj/rest/RestServer.java b/ext/rest/src/main/java/org/minimalj/rest/RestServer.java
index <HASH>..<HASH> 100644
--- a/ext/rest/src/main/java/org/minimalj/rest/RestServer.java
+++ b/ext/rest/src/main/java/org/minimalj/rest/RestServer.java
@@ -16,7 +16,7 @@ public class RestServer {
private static final boolean SECURE = true;
private static final int TIME_OUT = 5 * 60 * 1000;
- private static void start(boolean secure) {
+ public static void start(boolean secure) {
int port = getPort(secure);
if (port > 0) {
LOG.info("Start " + Application.getInstance().getClass().getSimpleName() + " rest server on port " + port + (secure ? " (Secure)" : "")); | RestServer: first step to allow include to normal server | BrunoEberhard_minimal-j | train | java |
73463288f874240902668e9d2b5aab472d36abfe | diff --git a/mrq/basetasks/utils.py b/mrq/basetasks/utils.py
index <HASH>..<HASH> 100644
--- a/mrq/basetasks/utils.py
+++ b/mrq/basetasks/utils.py
@@ -154,6 +154,6 @@ class JobAction(Task):
"_id": {"$in": jobs_by_queue[queue]}
}, {"$set": updates}, multi=True)
- set_queues_size({queue: len(jobs) for queue, jobs in jobs_by_queue.iteritems()})
+ set_queues_size({queue: len(jobs) for queue, jobs in jobs_by_queue.items()})
return stats | Fix iterating keys for python3 (#<I>) | pricingassistant_mrq | train | py |
5191806534c5aafc1eff16b6abc132b430cb6e18 | diff --git a/table.go b/table.go
index <HASH>..<HASH> 100644
--- a/table.go
+++ b/table.go
@@ -21,11 +21,7 @@ type Table struct {
}
func (t *Table) String() string {
- lines := []string{}
- for _, line := range t.Lines() {
- lines = append(lines, line)
- }
- return strings.Join(lines, "\n")
+ return strings.Join(t.Lines(), "\n")
}
var uncolorRegexp = regexp.MustCompile("\033\\[38;5;\\d+m") | Simplify String()
Since t.Lines() already returns a suitable slice, which we won't mutate,
just the the returned one instead of regenerating one.
This easily avoids generating garbage and reduces memory consumption. | dynport_gocli | train | go |
c4d8edc027d2a28441db7581d6b6e61e82649c06 | diff --git a/lib/discordrb/bot.rb b/lib/discordrb/bot.rb
index <HASH>..<HASH> 100644
--- a/lib/discordrb/bot.rb
+++ b/lib/discordrb/bot.rb
@@ -1069,6 +1069,14 @@ module Discordrb
end
raise_event(DisconnectEvent.new(self))
+
+ # Safely close the WS connection and handle any errors that occur there
+ begin
+ @ws.close
+ rescue => e
+ LOGGER.warn 'Got the following exception while closing the WS after being disconnected:'
+ LOGGER.log_exception e
+ end
rescue => e
LOGGER.log_exception e
raise | Make sure the websocket connection is always closed after a close event is received | meew0_discordrb | train | rb |
1ac8e0662fbf4e14570ad8ec490fd4cece15bbe4 | diff --git a/actionpack/test/dispatch/test_request_test.rb b/actionpack/test/dispatch/test_request_test.rb
index <HASH>..<HASH> 100644
--- a/actionpack/test/dispatch/test_request_test.rb
+++ b/actionpack/test/dispatch/test_request_test.rb
@@ -5,7 +5,7 @@ class TestRequestTest < ActiveSupport::TestCase
env = ActionDispatch::TestRequest.new.env
assert_equal "GET", env.delete("REQUEST_METHOD")
- assert_equal nil, env.delete("HTTPS")
+ assert_equal "off", env.delete("HTTPS")
assert_equal "http", env.delete("rack.url_scheme")
assert_equal "example.org", env.delete("SERVER_NAME")
assert_equal "80", env.delete("SERVER_PORT") | Rack: HTTPS is either 'on' or 'off' as of 9b7a<I>e<I>d0c<I>a<I>fc<I>e<I>c<I>d7f | rails_rails | train | rb |
f0e05eded6647e3a7cfaa83a6e95c7e0f5f2cc88 | diff --git a/dodgy/__pkginfo__.py b/dodgy/__pkginfo__.py
index <HASH>..<HASH> 100644
--- a/dodgy/__pkginfo__.py
+++ b/dodgy/__pkginfo__.py
@@ -1,5 +1,5 @@
-VERSION = (0, 1, 2)
+VERSION = (0, 1, 3)
def get_version(): | Bumping version to <I> | landscapeio_dodgy | train | py |
19bcc99736102cdfc82707346499b2fc3c8436a3 | diff --git a/potypo/__main__.py b/potypo/__main__.py
index <HASH>..<HASH> 100644
--- a/potypo/__main__.py
+++ b/potypo/__main__.py
@@ -8,13 +8,6 @@ from .check import Check
from enchant import DictWithPWL
from enchant.checker import SpellChecker
-# TODO: packaging
-# TODO: gh + README
-# TODO: alle .po-files finden
-# TODO: tests schreiben
-# TODO: bei typo: exit 1
-# TODO: config-option für sprachen ohne fail
-
def main():
config = configparser.ConfigParser()
config.read('setup.cfg') | move TODOs from __main__ to README | koebi_potypo | train | py |
3f2ebe468282a61115db0772392e919f050d905d | diff --git a/ResourceLocator/src/UniformResourceLocator.php b/ResourceLocator/src/UniformResourceLocator.php
index <HASH>..<HASH> 100644
--- a/ResourceLocator/src/UniformResourceLocator.php
+++ b/ResourceLocator/src/UniformResourceLocator.php
@@ -248,7 +248,7 @@ class UniformResourceLocator implements ResourceLocatorInterface
$filePath = '/' . ltrim(substr($file, strlen($prefix)), '\/');
if (is_array($path)) {
// Handle scheme lookup.
- $path[1] .= $filePath;
+ $path[1] = trim($path[1] . $filePath, '/');
$found = $this->find($path, $array, $absolute, $all);
if ($found) {
if (!$array) {
@@ -259,7 +259,7 @@ class UniformResourceLocator implements ResourceLocatorInterface
}
} else {
// Handle relative path lookup.
- $path .= $filePath;
+ $path = trim($path . $filePath, '/');
$lookup = $this->base . '/' . $path;
if ($all || file_exists($lookup)) { | UniformResourceLocator: Remove extra slashes from the output | rockettheme_toolbox | train | php |
54d865d9205bfd88ca02ab88e53d6aba96af1ff2 | diff --git a/parse.go b/parse.go
index <HASH>..<HASH> 100644
--- a/parse.go
+++ b/parse.go
@@ -140,7 +140,7 @@ func (p *parser) next() {
case '\n':
p.advance('\n', "")
default:
- p.setTok(p.doToken(r))
+ p.advance(p.doToken(r), "")
}
return
}
@@ -419,7 +419,8 @@ func (p *parser) command() {
var cmd Command
p.push(&cmd.Args)
p.add(Lit{Val: p.lval})
- first := p.lpos
+ fpos := p.lpos
+ fval := p.lval
args:
for p.tok != EOF {
switch {
@@ -438,14 +439,13 @@ func (p *parser) command() {
p.binaryExpr(LOR, cmd)
return
case p.got(LPAREN):
- name := p.lval
p.want(RPAREN)
- if !identRe.MatchString(name) {
- p.posErr(first, "invalid func name %q", name)
+ if !identRe.MatchString(fval) {
+ p.posErr(fpos, "invalid func name %q", fval)
break args
}
fun := FuncDecl{
- Name: Lit{Val: name},
+ Name: Lit{Val: fval},
}
p.push(&fun.Body)
p.command() | Get rid of one more setTok() | mvdan_sh | train | go |
e2713d2cd82e941aef93ba876ace9e295e823126 | diff --git a/src/Elcodi/UserBundle/Entity/Customer.php b/src/Elcodi/UserBundle/Entity/Customer.php
index <HASH>..<HASH> 100644
--- a/src/Elcodi/UserBundle/Entity/Customer.php
+++ b/src/Elcodi/UserBundle/Entity/Customer.php
@@ -432,7 +432,7 @@ class Customer extends AbstractUser implements CustomerInterface
/**
* Sleep implementation for some reason
*
- * Url http://asiermarques.com/2013/symfony2-security-usernamepasswordtokenserialize-must-return-a-string-or-null/
+ * @link http://asiermarques.com/2013/symfony2-security-usernamepasswordtokenserialize-must-return-a-string-or-null/
*/
public function __sleep()
{ | Really changed the annotation
@url to @link | elcodi_elcodi | train | php |
090720bbc7e061ef9fa27fd3a5e060f68c0bcb3e | diff --git a/module.flow.js b/module.flow.js
index <HASH>..<HASH> 100644
--- a/module.flow.js
+++ b/module.flow.js
@@ -198,6 +198,10 @@ declare module '@solana/web3.js' {
keys: Array<{pubkey: PublicKey, isSigner: boolean, isDebitable: boolean}>;
programId: PublicKey;
data: Buffer;
+
+ constructor(
+ opts?: TransactionInstructionCtorFields,
+ ): TransactionInstruction;
}
declare type SignaturePubkeyPair = {| | fix: add transaction instruction ctor to flow def (#<I>) | solana-labs_solana-web3.js | train | js |
850ee23c8d9898e15476b1262ddd6af9aa15d9bb | diff --git a/integration-tests/spec/archive_spec.rb b/integration-tests/spec/archive_spec.rb
index <HASH>..<HASH> 100644
--- a/integration-tests/spec/archive_spec.rb
+++ b/integration-tests/spec/archive_spec.rb
@@ -41,7 +41,7 @@ if embedded_from_disk?
output = `java -Djava.io.tmpdir=#{@tmpdir}/tmp -jar #{archive} \
-S torquebox --version`.split('\n')
output.first.should include(TorqueBox::VERSION)
- glob = Dir.glob('tmp/*')
+ glob = Dir.glob('tmp/wunderboss*')
unless glob.empty?
$stderr.puts "Did not clean up temp dirs #{glob.inspect}"
end | Don't let jffi and other tmp turds fail our archive_spec.rb | torquebox_torquebox | train | rb |
3517f62051d0acfc0869fa7ecdaab73c5380657a | diff --git a/lib/slop.rb b/lib/slop.rb
index <HASH>..<HASH> 100644
--- a/lib/slop.rb
+++ b/lib/slop.rb
@@ -249,7 +249,8 @@ class Slop
option = @options[$1]
argument = $2
when /\A--no-(.+)\z/
- option.force_argument_value(false) if option = @options[$1]
+ option = @options[$1]
+ option.force_argument_value(false) if option
end
end | dont use assignment in postfix conditional | leejarvis_slop | train | rb |
d89fa09c98532b8f96975acf653bf4b11c7354d1 | diff --git a/spec/pycall/conversion_spec.rb b/spec/pycall/conversion_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/pycall/conversion_spec.rb
+++ b/spec/pycall/conversion_spec.rb
@@ -105,10 +105,16 @@ module PyCall
context 'for a unicode string' do
let(:ruby_snowman) { "\u{2603}" }
- let(:python_snowman) { p Conversion.from_ruby(ruby_snowman) }
+ let(:python_snowman) { Conversion.from_ruby(ruby_snowman) }
subject { Conversion.to_ruby(python_snowman) }
it { is_expected.to eq(ruby_snowman) }
end
+
+ context 'for a large size string' do
+ let(:large_string) { 'x' * 10000 }
+ subject { Conversion.to_ruby(Conversion.from_ruby(large_string)) }
+ it { is_expected.to eq(large_string) }
+ end
end
describe '.from_ruby' do | Add an example to investigate #<I> | mrkn_pycall.rb | train | rb |
918063ea320b67a7b7fcc1ada6adb9c1640ab449 | diff --git a/vtkInterface/plotting.py b/vtkInterface/plotting.py
index <HASH>..<HASH> 100755
--- a/vtkInterface/plotting.py
+++ b/vtkInterface/plotting.py
@@ -3,17 +3,17 @@ vtk plotting module
"""
import colorsys
-
-import vtk
-from vtk.util import numpy_support as VN
import numpy as np
-
import vtkInterface
-font_keys = {'arial': vtk.VTK_ARIAL,
- 'courier': vtk.VTK_COURIER,
- 'times': vtk.VTK_TIMES}
-
+try:
+ import vtk
+ from vtk.util import numpy_support as VN
+ font_keys = {'arial': vtk.VTK_ARIAL,
+ 'courier': vtk.VTK_COURIER,
+ 'times': vtk.VTK_TIMES}
+except:
+ pass
def Plot(mesh, **args):
""" | allowed to pass on loading vtk for autodoc for plotting | vtkiorg_vtki | train | py |
bf04ec1ad4b889d05c1dc22bc8eebc2b1ce8ea47 | diff --git a/tensorflow_datasets/text/glue.py b/tensorflow_datasets/text/glue.py
index <HASH>..<HASH> 100644
--- a/tensorflow_datasets/text/glue.py
+++ b/tensorflow_datasets/text/glue.py
@@ -118,6 +118,10 @@ class GlueConfig(tfds.core.BuilderConfig):
"""
super(GlueConfig, self).__init__(
version=tfds.core.Version("2.0.0"),
+ supported_versions=[
+ tfds.core.Version("1.0.0"),
+ tfds.core.Version("1.0.1"),
+ ],
release_notes={
"1.0.0": "New split API (https://tensorflow.org/datasets/splits)",
"1.0.1": "Update dead URL links.", | Add <I>.x GLUE versions as supported.
PiperOrigin-RevId: <I> | tensorflow_datasets | train | py |
eb8b7417964feb729a6d3bce8d386e5bf1b95408 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -21,13 +21,16 @@ module.exports = function (source) {
return accumulator;
}, {});
- options.sourceMap = true;
+ options.sourceMap = this.sourceMap;
options.filename = loaderUtils.getRemainingRequest(this);
result = to5.transform(source, options);
code = result.code;
+
map = result.map;
- map.sourcesContent = [source];
+ if (map) {
+ map.sourcesContent = [source];
+ }
this.callback(null, code, map); | Don't generate sourcemaps if user disables them | babel_babel-loader | train | js |
de10683bbbe3026e954cb85620d46e116419bfd0 | diff --git a/lib/flipper/api/action.rb b/lib/flipper/api/action.rb
index <HASH>..<HASH> 100644
--- a/lib/flipper/api/action.rb
+++ b/lib/flipper/api/action.rb
@@ -29,7 +29,7 @@ module Flipper
end
def self.match?(request)
- !!match.call(request)
+ match.call(request)
end
# Internal: Initializes and runs an action for a given request.
diff --git a/lib/flipper/ui/action.rb b/lib/flipper/ui/action.rb
index <HASH>..<HASH> 100644
--- a/lib/flipper/ui/action.rb
+++ b/lib/flipper/ui/action.rb
@@ -29,7 +29,7 @@ module Flipper
end
def self.match?(request)
- !!match.call(request)
+ match.call(request)
end
# Internal: Initializes and runs an action for a given request. | Make rubo happy by removing double negation | jnunemaker_flipper | train | rb,rb |
31b62aaf259c33214df5a5a4a090868c005702d5 | diff --git a/themes/_administration/header.php b/themes/_administration/header.php
index <HASH>..<HASH> 100644
--- a/themes/_administration/header.php
+++ b/themes/_administration/header.php
@@ -99,7 +99,9 @@ echo '<li><ul>';
foreach (get_all_gedcoms() as $ged_id=>$gedcom) {
if (userGedcomAdmin(WT_USER_ID, $ged_id)) {
echo
- '<li><span><a ', (WT_SCRIPT_NAME=="admin_trees_config.php" && WT_GED_ID==$ged_id ? 'class="current" ' : ''), 'href="admin_trees_config.php?ged='.rawurlencode($gedcom).'">',
+ '<li><span><a ', (WT_SCRIPT_NAME=="admin_trees_config.php" && WT_GED_ID==$ged_id ? 'class="current" ' : ''), 'href="admin_trees_config.php?ged='.rawurlencode($gedcom).'" title="',
+ WT_I18N::translate('%s', htmlspecialchars(get_gedcom_setting($ged_id, 'title'))),
+ '">',
WT_I18N::translate('%s', htmlspecialchars(get_gedcom_setting($ged_id, 'title'))),
'</a></span></li>';
} | Add hover titles to family tree names, so long names that disappear off the edge of the menu bar can be read. | fisharebest_webtrees | train | php |
faa1e47581b3496fbdea3b178c90061db8192b49 | diff --git a/src/ResultPrinter71.php b/src/ResultPrinter71.php
index <HASH>..<HASH> 100755
--- a/src/ResultPrinter71.php
+++ b/src/ResultPrinter71.php
@@ -68,7 +68,6 @@ if ($low && $high) {
if (strpos($exceptionMessage, 'This test did not perform any assertions') !== false) {
$exceptionMessage = $this->setMessageColor('risky', 'This test did not perform any assertions.');
} else {
-
$marker = $this->markers['fail'];
if ($this->colors) { | Apply fixes from StyleCI (#<I>) | mikeerickson_phpunit-pretty-result-printer | train | php |
18d1ad222ef085ac05bd6e3f3aa1a750f2533bd9 | diff --git a/pendulum/duration.py b/pendulum/duration.py
index <HASH>..<HASH> 100644
--- a/pendulum/duration.py
+++ b/pendulum/duration.py
@@ -24,8 +24,9 @@ def _divide_and_round(a, b):
# in Objects/longobject.c.
q, r = divmod(a, b)
- if isinstance(q, float):
- q = int(q)
+ # The output of divmod() is either a float or an int,
+ # but we always want it to be an int.
+ q = int(q)
# round up if either r / b > 0.5, or r / b == 0.5 and q is odd.
# The expression r / b > 0.5 is equivalent to 2 * r > b if b is | Removed unnecessary "if isinstance" check for speed. | sdispater_pendulum | train | py |
09aff1d9396a826f95e3863ba4bb6e824d74c877 | diff --git a/amaascore/transactions/interface.py b/amaascore/transactions/interface.py
index <HASH>..<HASH> 100644
--- a/amaascore/transactions/interface.py
+++ b/amaascore/transactions/interface.py
@@ -340,7 +340,7 @@ class TransactionsInterface(Interface):
response.raise_for_status()
def position_search(self, asset_manager_id, book_ids=None, account_ids=None,
- accounting_types=['Transaction Date'], asset_ids=None,
+ accounting_types=None, asset_ids=None,
position_date=None, include_cash=False,
page_no=None, page_size=None):
self.logger.info('Search Positions - Asset Manager: %s', asset_manager_id)
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@ requires = [
setup(
name='amaascore',
- version='0.6.6',
+ version='0.6.7',
description='Asset Management as a Service - Core SDK',
license='Apache License 2.0',
url='https://github.com/amaas-fintech/amaas-core-sdk-python', | Removed default for accounting type in position search | amaas-fintech_amaas-core-sdk-python | train | py,py |
e5e97274d4680b2778c0b1d92a19c83d71f3ddd4 | diff --git a/consul/rpc.go b/consul/rpc.go
index <HASH>..<HASH> 100644
--- a/consul/rpc.go
+++ b/consul/rpc.go
@@ -244,6 +244,13 @@ RUN_QUERY:
// Update the query meta data
s.setQueryMeta(m)
+ // Check if query must be consistent
+ if b.RequireConsistent {
+ if err := s.consistentRead(); err != nil {
+ return err
+ }
+ }
+
// Run the query function
err := run() | consul: Adding consistent read enforcement | hashicorp_consul | train | go |
e38f25fbca5094fd62c36716816d950bae920e2d | diff --git a/.dreamfactory.php b/.dreamfactory.php
index <HASH>..<HASH> 100644
--- a/.dreamfactory.php
+++ b/.dreamfactory.php
@@ -1,6 +1,6 @@
<?php
/**
- * DreamFactory(tm) Core <http://github.com/dreamfactorysoftware/dsp-core>
+ * DreamFactory(tm) Core <http://github.com/dreamfactorysoftware/df-core>
* Copyright 2012-2015 DreamFactory Software, Inc. <support@dreamfactory.com>
*
* Licensed under the Apache License, Version 2.0 (the "License"); | PSR-2 formatting and removing file license header | dreamfactorysoftware_df-core | train | php |
c1a495edf40124dbbb391acb4e9240f2ac15f8a9 | diff --git a/lib/rails_admin/config/fields/types/serialized.rb b/lib/rails_admin/config/fields/types/serialized.rb
index <HASH>..<HASH> 100644
--- a/lib/rails_admin/config/fields/types/serialized.rb
+++ b/lib/rails_admin/config/fields/types/serialized.rb
@@ -14,7 +14,7 @@ module RailsAdmin
def parse_input(params)
return unless params[name].is_a?(::String)
- params[name] = (params[name].blank? ? nil : (YAML.safe_load(params[name]) || nil))
+ params[name] = (params[name].blank? ? nil : (SafeYAML.load(params[name]) || nil))
end
end
end
diff --git a/lib/rails_admin/engine.rb b/lib/rails_admin/engine.rb
index <HASH>..<HASH> 100644
--- a/lib/rails_admin/engine.rb
+++ b/lib/rails_admin/engine.rb
@@ -7,10 +7,7 @@ require 'rack-pjax'
require 'rails'
require 'rails_admin'
require 'remotipart'
-require 'safe_yaml'
-
-SafeYAML::OPTIONS[:suppress_warnings] = true
-SafeYAML::OPTIONS[:default_mode] = :unsafe
+require 'safe_yaml/load'
module RailsAdmin
class Engine < Rails::Engine | Do not monkey patch the app's YAML
SafeYAML provides a way to avoid monkey-patching the `YAML` object. This
should be used to avoid overwriting the application's `YAML`. | sferik_rails_admin | train | rb,rb |
61fb3d643a10b41aac7345c8ca366db9c7dc79ab | diff --git a/maildir_deduplicate/deduplicate.py b/maildir_deduplicate/deduplicate.py
index <HASH>..<HASH> 100644
--- a/maildir_deduplicate/deduplicate.py
+++ b/maildir_deduplicate/deduplicate.py
@@ -62,7 +62,7 @@ class Deduplicate(object):
def add_maildir(self, maildir_path):
""" Load up a maildir add compute hash for each mail their contain. """
- maildir = Maildir(maildir_path, factory=None)
+ maildir = Maildir(maildir_path, create=False)
# Collate folders by hash.
print("Processing {} mails in {}".format(len(maildir), maildir._path))
for mail_id, message in maildir.iteritems(): | Input maildirs are read-only. | kdeldycke_maildir-deduplicate | train | py |
d7bbc17f6d85e94304f9cf85f04cfb3ebe479a4a | diff --git a/decidim-dev/lib/decidim/dev/test/rspec_support/translation_helpers.rb b/decidim-dev/lib/decidim/dev/test/rspec_support/translation_helpers.rb
index <HASH>..<HASH> 100644
--- a/decidim-dev/lib/decidim/dev/test/rspec_support/translation_helpers.rb
+++ b/decidim-dev/lib/decidim/dev/test/rspec_support/translation_helpers.rb
@@ -108,6 +108,9 @@ module TranslationHelpers
private
def fill_in_i18n_fields(field, tab_selector, localized_values)
+ # Ensure the field is visible in the view to avoid "element has zero size"
+ # errors
+ scroll_to(find(tab_selector))
localized_values.each do |locale, value|
within tab_selector do
click_link I18n.with_locale(locale) { t("name", scope: "locale") }
@@ -117,6 +120,9 @@ module TranslationHelpers
end
def clear_i18n_fields(field, tab_selector, locales)
+ # Ensure the field is visible in the view to avoid "element has zero size"
+ # errors
+ scroll_to(find(tab_selector))
locales.each do |locale|
within tab_selector do
click_link I18n.with_locale(locale) { t("name", scope: "locale") } | Fix the failing consultations system spec (#<I>) | decidim_decidim | train | rb |
5f2c87d41dc38cb768434ee1f0581adc810022c5 | diff --git a/plugins/communicators/ssh/communicator.rb b/plugins/communicators/ssh/communicator.rb
index <HASH>..<HASH> 100644
--- a/plugins/communicators/ssh/communicator.rb
+++ b/plugins/communicators/ssh/communicator.rb
@@ -97,8 +97,13 @@ module VagrantPlugins
@logger.debug("Uploading: #{from} to #{to}")
scp_connect do |scp|
- # Open file read only to fix issue [GH-1036]
- scp.upload!(File.open(from, "r"), to)
+ if File.directory?(from)
+ # Recurisvely upload directories
+ scp.upload!(from, to, :recursive => true)
+ else
+ # Open file read only to fix issue [GH-1036]
+ scp.upload!(File.open(from, "r"), to)
+ end
end
rescue RuntimeError => e
# Net::SCP raises a runtime error for this so the only way we have | Allow SSH upload to upload directories | hashicorp_vagrant | train | rb |
b76643baafb0c7357854098b8c78ed96cc6c963e | diff --git a/Plugin/EventSubscriber.php b/Plugin/EventSubscriber.php
index <HASH>..<HASH> 100644
--- a/Plugin/EventSubscriber.php
+++ b/Plugin/EventSubscriber.php
@@ -11,23 +11,28 @@
namespace Yosymfony\Spress\Core\Plugin;
+/**
+ * Event subscriber.
+ *
+ * @author Victor Puertas <vpgugr@gmail.com>
+ */
class EventSubscriber
{
private $listener = [];
/**
- * Add a listener for one event
+ * Add a listener for one event.
*
* @param string $eventName
- * @param callable $listener
+ * @param \closure $listener
*/
- public function addEventListener($eventName, $listener)
+ public function addEventListener($eventName, \closure $listener)
{
$this->listener[$eventName] = $listener;
}
/**
- * Get event listeners
+ * Get event listeners.
*
* @return array
*/ | Argument 'listener' from addEventListener is a type closure | spress_spress-core | train | php |
edbb04223c645880e135fab87172743da8cf2a2b | diff --git a/src/test/java/org/takes/rq/form/RqFormFakeTest.java b/src/test/java/org/takes/rq/form/RqFormFakeTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/takes/rq/form/RqFormFakeTest.java
+++ b/src/test/java/org/takes/rq/form/RqFormFakeTest.java
@@ -30,7 +30,6 @@ import org.hamcrest.Matchers;
import org.junit.Test;
import org.takes.rq.RqFake;
import org.takes.rq.RqForm;
-import org.takes.rq.RqPrint;
/**
* Test case for {@link RqFormFake}.
@@ -73,7 +72,6 @@ public final class RqFormFakeTest {
key, avalue,
akey, aavalue
);
- new RqPrint(req).printBody(System.err);
MatcherAssert.assertThat(
req.param(key),
Matchers.hasItems(value, avalue) | (#<I>) Remove debug | yegor256_takes | train | java |
55ae181185877c7300eac6044b7f4a65083822d7 | diff --git a/src/ConcurrentPhpUtils/CyclicBarrier.php b/src/ConcurrentPhpUtils/CyclicBarrier.php
index <HASH>..<HASH> 100644
--- a/src/ConcurrentPhpUtils/CyclicBarrier.php
+++ b/src/ConcurrentPhpUtils/CyclicBarrier.php
@@ -177,13 +177,6 @@ class CyclicBarrier extends \Threaded
);
}
- if ($this->isTerminated()) {
- $this->breakBarrier();
- throw new Exception\InterruptedException(
- 'thread was interrupted'
- );
- }
-
if ($g->broken) {
throw new Exception\BrokenBarrierException();
} | check for thread termination in cyclicbarrier | prolic_Concurrent-PHP-Utils | train | php |
4f1b11d801e6d1159cef0ab074bf5278aa680a97 | diff --git a/shared/native/notification-listeners.desktop.js b/shared/native/notification-listeners.desktop.js
index <HASH>..<HASH> 100644
--- a/shared/native/notification-listeners.desktop.js
+++ b/shared/native/notification-listeners.desktop.js
@@ -14,14 +14,23 @@ import type {Dispatch} from '../constants/types/flux'
// notification listeners, store the sentNotifications map in it.
var sentNotifications = {}
+// Keep track of the last time we notified and ignore if its the same
+let lastLoggedInNotifyUsername = null
+
// TODO(mm) Move these to their own actions
export default function (dispatch: Dispatch, notify: any): incomingCallMapType {
return {
'keybase.1.NotifySession.loggedOut': params => {
+ lastLoggedInNotifyUsername = null
notify('Logged out of Keybase')
dispatch(logoutDone())
},
'keybase.1.NotifySession.loggedIn': ({username}, response) => {
+ if (lastLoggedInNotifyUsername === username) {
+ return
+ }
+
+ lastLoggedInNotifyUsername = username
notify('Logged in to Keybase as: ' + username)
dispatch(getCurrentStatus())
response.result() | don't spam users with login notifies | keybase_client | train | js |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.