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 |
|---|---|---|---|---|---|
c6777038cce3d0788bce1c4cd1cac7cc73e2d40c | diff --git a/Theme.php b/Theme.php
index <HASH>..<HASH> 100644
--- a/Theme.php
+++ b/Theme.php
@@ -227,8 +227,12 @@ class Theme implements Arrayable
*/
public function boot()
{
- foreach ($this->getFiles() as $file) {
- require $this->path . '/' . $file;
+ foreach ($this->getFiles() as $filename) {
+ $path = $this->path . '/' . $filename;
+
+ if (file_exists($path)) {
+ require $path;
+ };
}
}
@@ -291,7 +295,7 @@ class Theme implements Arrayable
$path = $this->path . "/config/config.php";
- if ( ! file_exists($path)) {
+ if (! file_exists($path)) {
$path = $this->path . "/config/{$filename}.php";
} | only require theme's file if the file is exist | pingpong-labs_themes | train | php |
04fa40d94cad83b4e3b03bbb58c9c9b2805760d4 | diff --git a/src/electronApi.js b/src/electronApi.js
index <HASH>..<HASH> 100644
--- a/src/electronApi.js
+++ b/src/electronApi.js
@@ -4,6 +4,7 @@
* Split Electron API from the main code
*/
+var path = require('path');
var electron;
try {
// eslint-disable-next-line global-require
@@ -119,7 +120,8 @@ function isDev() {
}
if (typeof process.execPath === 'string') {
- return process.execPath.toLowerCase().endsWith('electron');
+ var execFileName = path.basename(process.execPath).toLowerCase();
+ return execFileName.startsWith('electron');
}
return process.env.NODE_ENV === 'development' | fix(api): isDev should work properly when execName starts with electron | megahertz_electron-log | train | js |
0c8c4797fb8ecb5d284eb1b5cf43d5bf3584602e | diff --git a/psamm/commands/excelexport.py b/psamm/commands/excelexport.py
index <HASH>..<HASH> 100644
--- a/psamm/commands/excelexport.py
+++ b/psamm/commands/excelexport.py
@@ -85,8 +85,6 @@ class ExcelExportCommand(Command):
media_sheet.write_string(0, 3, 'Upper Limit')
default_flux = model.get_default_flux_limit()
- if default_flux is None:
- default_flux = 1000
for x, (compound, reaction, lower, upper) in enumerate(
model.parse_medium()):
diff --git a/psamm/commands/tableexport.py b/psamm/commands/tableexport.py
index <HASH>..<HASH> 100644
--- a/psamm/commands/tableexport.py
+++ b/psamm/commands/tableexport.py
@@ -90,8 +90,6 @@ class ExportTableCommand(Command):
print('{}\t{}\t{}\t{}'.format('Compound ID', 'Reaction ID',
'Lower Limit', 'Upper Limit'))
default_flux = self._model.get_default_flux_limit()
- if default_flux is None:
- default_flux = 1000
for compound, reaction, lower, upper in self._model.parse_medium():
if lower is None: | Two commands rely on get_default_flux_limit, not assign <I> manually | zhanglab_psamm | train | py,py |
e5ee3ba1048b981bf980a8f5b23a16959eee9221 | diff --git a/test_natsort/test_natsort_cmp.py b/test_natsort/test_natsort_cmp.py
index <HASH>..<HASH> 100644
--- a/test_natsort/test_natsort_cmp.py
+++ b/test_natsort/test_natsort_cmp.py
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+"""These test the natcmp() function."""
import sys
from functools import partial | Updated the tests to match the repo's style. | SethMMorton_natsort | train | py |
64b9672f59b7dadf098e62f26b61fff60cf5f401 | diff --git a/code/checkout/CheckoutComponentValidator.php b/code/checkout/CheckoutComponentValidator.php
index <HASH>..<HASH> 100644
--- a/code/checkout/CheckoutComponentValidator.php
+++ b/code/checkout/CheckoutComponentValidator.php
@@ -28,7 +28,12 @@ class CheckoutComponentValidator extends RequiredFields {
$valid = false;
}
if(!$valid){
- $this->form->sessionMessage("There are problems with the data you entered. See below:", "bad");
+ $this->form->sessionMessage(
+ _t(
+ "CheckoutComponentValidator.INVALIDMESSAGE",
+ "There are problems with the data you entered. See below:"
+ ), "bad"
+ );
}
return $valid;
diff --git a/code/checkout/CheckoutForm.php b/code/checkout/CheckoutForm.php
index <HASH>..<HASH> 100644
--- a/code/checkout/CheckoutForm.php
+++ b/code/checkout/CheckoutForm.php
@@ -42,4 +42,8 @@ class CheckoutForm extends Form {
return $this->controller->redirectBack();
}
+ public function getConfig(){
+ return $this->config;
+ }
+
} | Allow getting component config from checkout form
Tided component validator message | silvershop_silvershop-core | train | php,php |
91b6cc96e59d56a156e224f097bd84ccbf5d58b6 | diff --git a/secure_js_login/honypot/views.py b/secure_js_login/honypot/views.py
index <HASH>..<HASH> 100644
--- a/secure_js_login/honypot/views.py
+++ b/secure_js_login/honypot/views.py
@@ -18,6 +18,7 @@ from django.template import RequestContext
from django.utils.translation import ugettext as _
from django.shortcuts import render_to_response
from django.views.decorators.csrf import csrf_exempt
+from django.contrib.auth import authenticate, get_user_model
from secure_js_login.honypot.forms import HoneypotForm
from secure_js_login.honypot.models import HonypotAuth
@@ -34,6 +35,16 @@ def login_honeypot(request):
if form.is_valid():
username = form.cleaned_data["username"]
password = form.cleaned_data["password"]
+
+ # Don't store password from existing users:
+ if request.user.is_authenticated(): # Logged in user used the honypot?!?
+ password="***"
+ else:
+ user_model = get_user_model()
+ existing_user = user_model.objects.filter(username=username).exists()
+ if existing_user:
+ password="***"
+
HonypotAuth.objects.add(request, username, password)
messages.error(request, _("username/password wrong."))
form = HoneypotForm(initial={"username": username}) | Don't store honypot passwords from existing users | discontinue_django-secure-js-login | train | py |
5b89607e4bd256f0b13731ad58f958160f8b39aa | diff --git a/lib/Redisent/Redisent.php b/lib/Redisent/Redisent.php
index <HASH>..<HASH> 100644
--- a/lib/Redisent/Redisent.php
+++ b/lib/Redisent/Redisent.php
@@ -11,8 +11,11 @@ define('CRLF', sprintf('%s%s', chr(13), chr(10)));
/**
* Wraps native Redis errors in friendlier PHP exceptions
+ * Only declared if class doesn't already exist to ensure compatibility with php-redis
*/
-class RedisException extends Exception {
+if (! class_exists('RedisException')) {
+ class RedisException extends Exception {
+ }
}
/** | Fix issue #<I> by ensuring RedisException is not redeclared | chrisboulton_php-resque | train | php |
05c8108e27540e8678441e3b134c5c983a541525 | diff --git a/scss/cssdefs.py b/scss/cssdefs.py
index <HASH>..<HASH> 100644
--- a/scss/cssdefs.py
+++ b/scss/cssdefs.py
@@ -288,7 +288,6 @@ _spaces_re = re.compile(r'\s+')
_expand_rules_space_re = re.compile(r'\s*{')
_collapse_properties_space_re = re.compile(r'([:#])\s*{')
_variable_re = re.compile('^\\$[-a-zA-Z0-9_]+$')
-_undefined_re = re.compile('^(?:\\$[-a-zA-Z0-9_]+|undefined)$')
_strings_re = re.compile(r'([\'"]).*?\1')
diff --git a/scss/functions/compass/helpers.py b/scss/functions/compass/helpers.py
index <HASH>..<HASH> 100644
--- a/scss/functions/compass/helpers.py
+++ b/scss/functions/compass/helpers.py
@@ -15,7 +15,6 @@ import os.path
import time
from scss import config
-from scss.cssdefs import _undefined_re
from scss.functions.library import FunctionLibrary
from scss.types import BooleanValue, ListValue, NumberValue, QuotedStringValue, StringValue
from scss.util import escape, to_str | Eliminate _undefined_re once and for all. | Kronuz_pyScss | train | py,py |
2cbc85aed3128df77abcc3dc8b7388df28be98f4 | diff --git a/lib/resque/worker.rb b/lib/resque/worker.rb
index <HASH>..<HASH> 100644
--- a/lib/resque/worker.rb
+++ b/lib/resque/worker.rb
@@ -498,7 +498,7 @@ module Resque
# Returns an Array of string pids of all the other workers on this
# machine. Useful when pruning dead workers on startup.
def solaris_worker_pids
- `ps -A -o pid,comm | grep ruby | grep -v grep | grep -v "resque-web"`.split("\n").map do |line|
+ `ps -A -o pid,comm | grep [r]uby | grep -v "resque-web"`.split("\n").map do |line|
real_pid = line.split(' ')[0]
pargs_command = `pargs -a #{real_pid} 2>/dev/null | grep [r]esque | grep -v "resque-web"`
if pargs_command.split(':')[1] == " resque-#{Resque::Version}" | grep [t]hing means you dont need grep -v grep | resque_resque | train | rb |
3321b650a23c4626795fab5125bf6811df61d111 | diff --git a/endpoints/users_id_token.py b/endpoints/users_id_token.py
index <HASH>..<HASH> 100644
--- a/endpoints/users_id_token.py
+++ b/endpoints/users_id_token.py
@@ -22,6 +22,7 @@ will be provided elsewhere in the future.
from __future__ import absolute_import
import base64
+import hmac
import json
import logging
import os
@@ -625,8 +626,8 @@ def _verify_signed_jwt_with_certs(
# Check the signature on 'signed' by encrypting 'signature' with the
# public key and confirming the result matches the SHA256 hash of
- # 'signed'.
- verified = (hexsig == local_hash)
+ # 'signed'. hmac.compare_digest(a, b) is used to avoid timing attacks.
+ verified = hmac.compare_digest(hexsig, local_hash)
if verified:
break
except Exception, e: # pylint: disable=broad-except | Use hmac.compare_digest to compare signatures. (#<I>) | cloudendpoints_endpoints-python | train | py |
a356c4e7bd9f993c73e01711ed92b5769fea170a | diff --git a/eZ/Publish/Core/FieldType/Tests/RichText/Converter/Xslt/Xhtml5ToDocbookTest.php b/eZ/Publish/Core/FieldType/Tests/RichText/Converter/Xslt/Xhtml5ToDocbookTest.php
index <HASH>..<HASH> 100644
--- a/eZ/Publish/Core/FieldType/Tests/RichText/Converter/Xslt/Xhtml5ToDocbookTest.php
+++ b/eZ/Publish/Core/FieldType/Tests/RichText/Converter/Xslt/Xhtml5ToDocbookTest.php
@@ -89,7 +89,8 @@ class Xhtml5ToDocbookTest extends BaseTest
protected function getConversionValidationSchema()
{
return array(
- __DIR__ . "/_fixtures/docbook/custom_schemas/youtube.rng"
+ __DIR__ . "/_fixtures/docbook/custom_schemas/youtube.rng",
+ __DIR__ . "/../../../../RichText/Resources/schemas/docbook/docbook.iso.sch.xsl",
);
}
} | EZP-<I>: tests: add schematron rules to xhtml5 edit to docbook converter tests | ezsystems_ezpublish-kernel | train | php |
193b63b1f90ba64b77a3cd82ec849ea3012b6e66 | diff --git a/sharer.js b/sharer.js
index <HASH>..<HASH> 100644
--- a/sharer.js
+++ b/sharer.js
@@ -132,6 +132,24 @@
};
that.urlSharer(shareUrl, params);
},
+ 'xing': function() {
+ shareUrl = 'https://www.xing.com/app/user';
+ params = {
+ 'op': 'share',
+ 'url': this.getValue('data-url'),
+ 'title': this.getValue('data-title')
+ };
+ },
+ 'buffer': function() {
+ shareUrl = 'http://https://buffer.com/add';
+ params = {
+ url: this.getValue('data-url'),
+ title: this.getValue('data-url'),
+ via: this.getValue('data-twitter-username'),
+ picture: this.getValue('data-picture')
+ };
+ this.urlSharer(shareUrl, params);
+ },
'default': function () {}
};
return (sharers[sharer] || sharers['default'])(); | adding Xing and Buffer sharers | ellisonleao_sharer.js | train | js |
eb36c1aadc704e02d84c0fe5b6ea0269deef7870 | diff --git a/go/libkb/features.go b/go/libkb/features.go
index <HASH>..<HASH> 100644
--- a/go/libkb/features.go
+++ b/go/libkb/features.go
@@ -156,6 +156,14 @@ func (s *FeatureFlagSet) EnabledWithError(m MetaContext, f Feature) (on bool, er
"features": S{Val: string(f)},
}
err = m.G().API.GetDecode(m, arg, &raw)
+ switch err.(type) {
+ case nil:
+ case LoginRequiredError:
+ // No features for logged-out users
+ return false, nil
+ default:
+ return false, err
+ }
if err != nil {
return false, err
} | no features for logged-out users (#<I>) | keybase_client | train | go |
3ab679215c44a4a908a624542358f95a02ff2d5f | diff --git a/lib/kamerling/repos.rb b/lib/kamerling/repos.rb
index <HASH>..<HASH> 100644
--- a/lib/kamerling/repos.rb
+++ b/lib/kamerling/repos.rb
@@ -42,7 +42,7 @@ module Kamerling
end
def task_repo
- @task_repo ||= TaskRepo.new(db)
+ @task_repo ||= TaskRepo.new(db, project_repo: project_repo)
end
private
diff --git a/lib/kamerling/task_repo.rb b/lib/kamerling/task_repo.rb
index <HASH>..<HASH> 100644
--- a/lib/kamerling/task_repo.rb
+++ b/lib/kamerling/task_repo.rb
@@ -1,10 +1,17 @@
# frozen_string_literal: true
+require 'sequel'
+require_relative 'project_repo'
require_relative 'repo'
require_relative 'task'
module Kamerling
class TaskRepo < Repo
+ def initialize(db = Sequel.sqlite, project_repo: ProjectRepo.new(db))
+ super(db)
+ @project_repo = project_repo
+ end
+
def for_project(project)
table.where(project_id: project.id).all.map(&Task.method(:new))
end
@@ -20,6 +27,8 @@ module Kamerling
private
+ attr_reader :project_repo
+
def klass
Task
end | TaskRepo: add dependency on a project repo | chastell_kamerling | train | rb,rb |
1841d07ddc9c75ed8adf17389157b3256396d107 | diff --git a/server/src/main/java/com/netflix/conductor/bootstrap/Main.java b/server/src/main/java/com/netflix/conductor/bootstrap/Main.java
index <HASH>..<HASH> 100644
--- a/server/src/main/java/com/netflix/conductor/bootstrap/Main.java
+++ b/server/src/main/java/com/netflix/conductor/bootstrap/Main.java
@@ -62,10 +62,17 @@ public class Main {
*/
Thread.sleep(EMBEDDED_ES_INIT_TIME);
} catch (Exception ioe) {
+ ioe.printStackTrace(System.err);
System.exit(3);
}
}
- serverInjector.getInstance(IndexDAO.class).setup();
+
+ try {
+ serverInjector.getInstance(IndexDAO.class).setup();
+ } catch (Exception e){
+ e.printStackTrace(System.err);
+ System.exit(3);
+ }
System.out.println("\n\n\n");
@@ -80,6 +87,7 @@ public class Main {
try {
server.start();
} catch (IOException ioe) {
+ ioe.printStackTrace(System.err);
System.exit(3);
}
});
@@ -88,6 +96,7 @@ public class Main {
try {
server.start();
} catch (Exception ioe) {
+ ioe.printStackTrace(System.err);
System.exit(3);
}
}); | Add more error handling and stack output on failure. | Netflix_conductor | train | java |
e87b421dd91979c321035ffdd097238799bcfd26 | diff --git a/app/lib/webpack/electron/create-node-chain.js b/app/lib/webpack/electron/create-node-chain.js
index <HASH>..<HASH> 100644
--- a/app/lib/webpack/electron/create-node-chain.js
+++ b/app/lib/webpack/electron/create-node-chain.js
@@ -68,6 +68,11 @@ module.exports = (nodeType, cfg, configName) => {
.use('ts-loader')
.loader('ts-loader')
.options({
+ // While `noEmit: true` is needed in the tsconfig preset to prevent VSCode errors,
+ // it prevents emitting transpiled files when run into node context
+ compilerOptions: {
+ noEmit: false
+ },
onlyCompileBundledFiles: true,
transpileOnly: false
}) | fix(app): fix TS file support for electron | quasarframework_quasar | train | js |
fe180eddb6dc113db7a0782a5fc7b2d2dfa52e0f | diff --git a/salt/modules/ansiblegate.py b/salt/modules/ansiblegate.py
index <HASH>..<HASH> 100644
--- a/salt/modules/ansiblegate.py
+++ b/salt/modules/ansiblegate.py
@@ -180,10 +180,10 @@ class AnsibleModuleCaller(object):
timeout=self.timeout,
)
proc_out.run()
- if six.PY3:
- proc_out_stdout = proc_out.stdout.decode()
- else:
+ if six.PY2:
proc_out_stdout = proc_out.stdout
+ else:
+ proc_out_stdout = proc_out.stdout.decode()
proc_exc = salt.utils.timed_subprocess.TimedProc(
[sys.executable, module.__file__],
stdin=proc_out_stdout, | Reverse the logic so Python 2 workaround is not the default | saltstack_salt | train | py |
f4b5e1bf005c450e2aed27ac4fd07ac61134fe89 | diff --git a/app/jobs/create_pulp_disk_space_notifications.rb b/app/jobs/create_pulp_disk_space_notifications.rb
index <HASH>..<HASH> 100644
--- a/app/jobs/create_pulp_disk_space_notifications.rb
+++ b/app/jobs/create_pulp_disk_space_notifications.rb
@@ -6,4 +6,8 @@ class CreatePulpDiskSpaceNotifications < ApplicationJob
def perform
Katello::UINotifications::Pulp::ProxyDiskSpace.deliver!
end
+
+ def humanized_name
+ _('Pulp disk space notification')
+ end
end
diff --git a/app/jobs/send_expire_soon_notifications.rb b/app/jobs/send_expire_soon_notifications.rb
index <HASH>..<HASH> 100644
--- a/app/jobs/send_expire_soon_notifications.rb
+++ b/app/jobs/send_expire_soon_notifications.rb
@@ -6,4 +6,8 @@ class SendExpireSoonNotifications < ApplicationJob
def perform
Katello::UINotifications::Subscriptions::ExpireSoon.deliver!
end
+
+ def humanized_name
+ _('Subscription expiration notification')
+ end
end | Fixes #<I> - Humanized name for notification jobs | Katello_katello | train | rb,rb |
feb0496a26e06a426b93bf49ec5e69fda64ee960 | diff --git a/src/Naming/PropertyNaming.php b/src/Naming/PropertyNaming.php
index <HASH>..<HASH> 100644
--- a/src/Naming/PropertyNaming.php
+++ b/src/Naming/PropertyNaming.php
@@ -11,17 +11,13 @@ final class PropertyNaming
return lcfirst($this->fqnToShortName($fqn));
}
- public function fqnToShortName(string $fqn): string
+ private function fqnToShortName(string $fqn): string
{
if (! Strings::contains($fqn, '\\')) {
return $fqn;
}
- $nameSpaceParts = explode('\\', $fqn);
-
- /** @var string $lastNamePart */
- $lastNamePart = end($nameSpaceParts);
-
+ $lastNamePart = Strings::after($fqn, '\\', - 1);
if (Strings::endsWith($lastNamePart, 'Interface')) {
return Strings::substring($lastNamePart, 0, - strlen('Interface'));
} | make use of Strings::after() | rectorphp_rector | train | php |
22e3bbbf0aa711fcab3876ac1a34b8cdff8a0ccd | diff --git a/miner/worker_test.go b/miner/worker_test.go
index <HASH>..<HASH> 100644
--- a/miner/worker_test.go
+++ b/miner/worker_test.go
@@ -357,7 +357,7 @@ func testEmptyWork(t *testing.T, chainConfig *params.ChainConfig, engine consens
for i := 0; i < 2; i += 1 {
select {
case <-taskCh:
- case <-time.NewTimer(4 * time.Second).C:
+ case <-time.NewTimer(30 * time.Second).C:
t.Error("new task timeout")
}
} | miner: increase worker test timeout (#<I>)
TestEmptyWork* occasionally fails due to timeout. Increase the timeout. | ethereum_go-ethereum | train | go |
18d3e759458b7b6e3d615fa554949b8815f15669 | diff --git a/src/event.js b/src/event.js
index <HASH>..<HASH> 100644
--- a/src/event.js
+++ b/src/event.js
@@ -1,6 +1,6 @@
/*
* A number of helper functions used for managing events.
- * Many of the ideas behind this code orignated from
+ * Many of the ideas behind this code originated from
* Dean Edwards' addEvent library.
*/
jQuery.event = { | jquery event: fixed a typo in a comment. | jquery_jquery | train | js |
263a33b94d9a689d0fc5ba5c16bc92be9538e9fb | diff --git a/lib/raven/configuration.rb b/lib/raven/configuration.rb
index <HASH>..<HASH> 100644
--- a/lib/raven/configuration.rb
+++ b/lib/raven/configuration.rb
@@ -1,7 +1,7 @@
require 'uri'
module Raven
- class Configuration # rubocop:disable Metrics/ClassLength
+ class Configuration
# Directories to be recognized as part of your app. e.g. if you
# have an `engines` dir at the root of your project, you may want
# to set this to something like /(app|config|engines|lib)/ | Remove unnecessary disabling of Metrics/ClassLength rule (#<I>) | getsentry_raven-ruby | train | rb |
1644f00d345dfe03213cf24175451327634317ef | diff --git a/src/scs_core/estate/configuration.py b/src/scs_core/estate/configuration.py
index <HASH>..<HASH> 100644
--- a/src/scs_core/estate/configuration.py
+++ b/src/scs_core/estate/configuration.py
@@ -77,9 +77,18 @@ class Configuration(JSONable):
@classmethod
- def construct_from_jdict(cls, jdict):
+ def construct_from_jdict(cls, jdict, skeleton=False):
if not jdict:
- return None
+ if skeleton:
+ return cls(None, None, None, None, None,
+ None, None, None, None, None,
+ None, None, None, None, None,
+ None, None, None, None, None,
+ None, None, None, None, None,
+ None, None, None, None, None,
+ None, None, None, None)
+ else:
+ return None
hostname = jdict.get('hostname')
packs = PackageVersions.construct_from_jdict(jdict.get('packs')) | Upgraded configuration_csv.py | south-coast-science_scs_core | train | py |
bdd3a8886740accff44d4f059b33cf839f51ff71 | diff --git a/shell/tests/src/test/java/org/jboss/forge/addon/shell/parser/CommandCompletionTest.java b/shell/tests/src/test/java/org/jboss/forge/addon/shell/parser/CommandCompletionTest.java
index <HASH>..<HASH> 100644
--- a/shell/tests/src/test/java/org/jboss/forge/addon/shell/parser/CommandCompletionTest.java
+++ b/shell/tests/src/test/java/org/jboss/forge/addon/shell/parser/CommandCompletionTest.java
@@ -142,4 +142,14 @@ public class CommandCompletionTest
allOf(containsString(Career.MEDICINE.toString()), containsString(Career.MECHANICS.toString())));
}
+ @Test
+ public void testUISelectManyWithEnum() throws Exception
+ {
+ test.waitForCompletion("foocommand --manyCareer ME", "foocommand --manyCareer M",
+ 5, TimeUnit.SECONDS);
+ String stdOut = test.waitForCompletion(5, TimeUnit.SECONDS);
+ Assert.assertThat(stdOut,
+ allOf(containsString(Career.MEDICINE.toString()), containsString(Career.MECHANICS.toString())));
+ }
+
} | Added failing test with UISelectMany | forge_core | train | java |
620f4cf823693bae8b1dd5bdbbac236825c1abe5 | diff --git a/lib/sprockets/context.rb b/lib/sprockets/context.rb
index <HASH>..<HASH> 100644
--- a/lib/sprockets/context.rb
+++ b/lib/sprockets/context.rb
@@ -76,9 +76,10 @@ module Sprockets
# resolve("./bar.js")
# # => "/path/to/app/javascripts/bar.js"
#
- def resolve(path, options = {}, &block)
+ def resolve(path, options = {})
pathname = Pathname.new(path)
attributes = environment.attributes_for(pathname)
+ options = {base_path: self.pathname.dirname}.merge(options)
if pathname.absolute?
if environment.stat(pathname)
@@ -97,7 +98,7 @@ module Sprockets
end
end
- resolve(path) do |candidate|
+ environment._resolve(path, options).each do |candidate|
if self.content_type == environment.content_type_of(candidate)
return candidate
end
@@ -105,11 +106,7 @@ module Sprockets
raise FileNotFound, "couldn't find file '#{path}'"
else
- if block_given?
- environment.resolve(path, {base_path: self.pathname.dirname}.merge(options), &block)
- else
- environment.resolve!(path, {base_path: self.pathname.dirname}.merge(options))
- end
+ environment.resolve!(path, options)
end
end | Remove block given to context#resolve | rails_sprockets | train | rb |
ec505fbe08b6532d82a3a25c12c1052e4dd1e400 | diff --git a/src/adapters/EasyRtcAdapter.js b/src/adapters/EasyRtcAdapter.js
index <HASH>..<HASH> 100644
--- a/src/adapters/EasyRtcAdapter.js
+++ b/src/adapters/EasyRtcAdapter.js
@@ -25,6 +25,14 @@ class EasyRtcAdapter extends NoOpAdapter {
this.easyrtc.setPeerClosedListener((clientId) => {
delete this.remoteClients[clientId];
+ const pendingMediaRequests = this.pendingMediaRequests.get(clientId);
+ if (pendingMediaRequests) {
+ const msg = "The user disconnected before the media stream was resolved.";
+ Object.keys(pendingMediaRequests).forEach((streamName) => {
+ pendingMediaRequests[streamName].reject(msg);
+ });
+ this.pendingMediaRequests.delete(clientId);
+ }
});
} | properly reject promises and remove clientId from pendingMediaRequests Map when the participant disconnect | networked-aframe_networked-aframe | train | js |
79380fe601801d76247c71b423bf677d60e9d522 | diff --git a/tests/unit/test_meta.py b/tests/unit/test_meta.py
index <HASH>..<HASH> 100644
--- a/tests/unit/test_meta.py
+++ b/tests/unit/test_meta.py
@@ -36,7 +36,7 @@ class MetaImageTest(unittest.TestCase):
print("Created: {}".format(cls._temp_path))
@my_vcr.use_cassette('tests/unit/cassettes/test_meta_pxbounds_overlap.yaml', filter_headers=['authorization'])
- def test_image_pxbounds_overlapping(self):
+ def test_image_pxbounds_overlapping(self, clip=True):
wv2 = CatalogImage('1030010076B8F500')
_bands, ysize, xsize = wv2.shape
image_shape = shape(wv2) | fixing test for clip pxbounds | DigitalGlobe_gbdxtools | train | py |
aac52c81a56a382218e8daddab3043322d9814f2 | diff --git a/src/ossos-pipeline/ossos/downloads/cutouts/source.py b/src/ossos-pipeline/ossos/downloads/cutouts/source.py
index <HASH>..<HASH> 100644
--- a/src/ossos-pipeline/ossos/downloads/cutouts/source.py
+++ b/src/ossos-pipeline/ossos/downloads/cutouts/source.py
@@ -161,6 +161,7 @@ class SourceCutout(object):
"""
if self._tempfile is not None:
self._tempfile.close()
+ self._tempfile = None
def _lazy_refresh(self):
if self._stale: | Set tempfile to None after close so that a new 'disk' file is created if the user needs to re-measure a source. resolves #<I> | OSSOS_MOP | train | py |
62b942a5100746e0f36e6e5509f7df0715eab5d9 | diff --git a/version.php b/version.php
index <HASH>..<HASH> 100644
--- a/version.php
+++ b/version.php
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2019012400.00; // YYYYMMDD = weekly release date of this DEV branch.
+$version = 2019013000.00; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes. | MDL-<I> core_completion: new cap version bump | moodle_moodle | train | php |
952c98aa7a1cb645cf7c31febf4a67a896382aa2 | diff --git a/src/Database/Drivers/MySQLDriver.php b/src/Database/Drivers/MySQLDriver.php
index <HASH>..<HASH> 100755
--- a/src/Database/Drivers/MySQLDriver.php
+++ b/src/Database/Drivers/MySQLDriver.php
@@ -65,7 +65,7 @@ class MySQLDriver implements DriverInterface
$config['database_host'],
$config['database_port'],
$config['database_name'],
- isset($config['database_charset']) ? $config['database_charset'] ? DriverInterface::DEFAULT_CHARSET
+ isset($config['database_charset']) ? $config['database_charset'] : DriverInterface::DEFAULT_CHARSET,
),
$config['database_user'],
$config['database_pwd'] | fixed mysql driver auto commit | JanHuang_database | train | php |
9e668cde7784cfda1d5ed1ad206e041242f72be2 | diff --git a/azurerm/resource_arm_image.go b/azurerm/resource_arm_image.go
index <HASH>..<HASH> 100644
--- a/azurerm/resource_arm_image.go
+++ b/azurerm/resource_arm_image.go
@@ -83,7 +83,7 @@ func resourceArmImage() *schema.Resource {
"caching": {
Type: schema.TypeString,
Optional: true,
- Default: compute.None,
+ Default: string(compute.None),
ValidateFunc: validation.StringInSlice([]string{
string(compute.None),
string(compute.ReadOnly),
@@ -127,7 +127,7 @@ func resourceArmImage() *schema.Resource {
"caching": {
Type: schema.TypeString,
Optional: true,
- Computed: true,
+ Default: string(compute.None),
ValidateFunc: validation.StringInSlice([]string{
string(compute.None),
string(compute.ReadOnly), | Slight modification for make compiler happy :) | terraform-providers_terraform-provider-azurerm | train | go |
ddd37bb2a8a7411ef0cad3cc03d4b4eee65bb104 | diff --git a/lib/implementation.js b/lib/implementation.js
index <HASH>..<HASH> 100644
--- a/lib/implementation.js
+++ b/lib/implementation.js
@@ -350,6 +350,9 @@ module.exports = function(self, options) {
fromArrays = fromArrays.concat(self.findJoinsInSchema(doc, field.schema));
});
}
+ if (field.type === 'object' && typeof doc[field.name] === 'object') {
+ fromArrays = fromArrays.concat(self.findJoinsInSchema(doc[field.name], field.schema));
+ }
}
), function(field) {
return { doc: doc, field: field, value: doc[field.name] }; | Map joins properly when committing when nested in object fields. Thanks to Eric Wong for the patch. | apostrophecms_apostrophe-workflow | train | js |
2a5270690ce3ea0b7896b9a7a592a732e86f329f | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -182,7 +182,10 @@ metadata = scanallmeta(['{0}/{1}'.format(srcdir, x) for x in
# Coulomb modules
mods1, fns1 = get_module_list(metadata, 'coulomb',
include_list = inc_dirs)
-lib_srcs += fns1
+if sys.version_info >= (3,0):
+ lib_srcs += fns1
+else:
+ lib_srcs += [ fn.encode('ascii') for fn in fns1 ]
print('* Found the following Coulomb modules:')
for f90name, f90type, name, features, methods in mods1:
@@ -206,7 +209,10 @@ lib_srcs += [ '%s/python/f90/coulomb_dispatch.f90' % (srcdir),
# Potential modules
mods2, fns2 = get_module_list(metadata, 'potentials',
include_list = inc_dirs)
-lib_srcs += fns2
+if sys.version_info >= (3,0):
+ lib_srcs += fns2
+else:
+ lib_srcs += [ fn.encode('ascii') for fn in fns2 ]
print('* Found the following potential modules:')
for f90name, f90type, name, features, methods in mods2: | Python 3: Fix to run in both Python 2 and Python 3. | Atomistica_atomistica | train | py |
9166acb5a7b4addf897ea81a0d1defa41e8d7aba | diff --git a/Bundle/CoreBundle/Resources/public/js/edit/victoire.js b/Bundle/CoreBundle/Resources/public/js/edit/victoire.js
index <HASH>..<HASH> 100644
--- a/Bundle/CoreBundle/Resources/public/js/edit/victoire.js
+++ b/Bundle/CoreBundle/Resources/public/js/edit/victoire.js
@@ -92,7 +92,7 @@ function enableSortableSlots(){
updateWidgetPosition(sorted, ui);
} else {
$vic(this).sortable('cancel');
- $vic('new-widget-button.disabled').each(function(index, el) {
+ $vic('new-widget-button.disabled, .vic-hover-widget.disabled').each(function(index, el) {
$vic(el).removeClass('disabled');
});
}
@@ -112,7 +112,7 @@ function updateWidgetPosition(sorted, ui) {
ajaxCall.fail(function() {
$vic(".vic-slot").each(function(){
$vic(this).sortable('cancel');
- $vic('new-widget-button.disabled', '.vic-hover-widget.disabled').each(function(index, el) {
+ $vic('new-widget-button.disabled, .vic-hover-widget.disabled').each(function(index, el) {
$vic(el).removeClass('disabled');
});
}); | when a widget is droped at the same place, re-enable sortable behavior | Victoire_victoire | train | js |
0fd3a55bf1fff1bfec6d4351edae1abf9aea4e89 | diff --git a/eZ/Publish/API/Repository/Tests/Stubs/TrashServiceStub.php b/eZ/Publish/API/Repository/Tests/Stubs/TrashServiceStub.php
index <HASH>..<HASH> 100644
--- a/eZ/Publish/API/Repository/Tests/Stubs/TrashServiceStub.php
+++ b/eZ/Publish/API/Repository/Tests/Stubs/TrashServiceStub.php
@@ -1,6 +1,6 @@
<?php
/**
- * File containing the ContentServiceStub class
+ * File containing the TrashServiceStub class
*
* @copyright Copyright (C) 1999-2012 eZ Systems AS. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
@@ -16,7 +16,7 @@ use \eZ\Publish\API\Repository\Values\Content\LocationCreateStruct;
use \eZ\Publish\API\Repository\Values\Content\TrashItem;
/**
- * Location service, used for complex subtree operations
+ * Trash service used for content/location trash handling.
*
* @package eZ\Publish\API\Repository
*/ | Fixed: Typos in doc comments. | ezsystems_ezpublish-kernel | train | php |
a238d1615484714e1c97e9a005e5fe52d4d1af67 | diff --git a/spec/unit/virtus/attribute/boolean/coerce_spec.rb b/spec/unit/virtus/attribute/boolean/coerce_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/virtus/attribute/boolean/coerce_spec.rb
+++ b/spec/unit/virtus/attribute/boolean/coerce_spec.rb
@@ -80,6 +80,6 @@ describe Virtus::Attribute::Boolean, '#coerce' do
context 'with "Foo"' do
let(:value) { 'Foo' }
- it { should equal(value) }
+ specify { expect { subject }.to raise_error }
end
end | Update spec to reflect recent change in coercible | solnic_virtus | train | rb |
81a4255f87c14d9feca2f3a31b67fbfff12c1fb3 | diff --git a/lib/bundle_views/index.js b/lib/bundle_views/index.js
index <HASH>..<HASH> 100644
--- a/lib/bundle_views/index.js
+++ b/lib/bundle_views/index.js
@@ -50,7 +50,7 @@ app.get('/viewsetup.js', function(req, res) {
});
app.get('/view/:bundle_name*', function(req, res, next) {
- var bundleName = req.param('bundle_name');
+ var bundleName = req.query.bundle_name;
var bundle = Bundles.find(bundleName);
// We start out assuming the user is trying to reach the index page | use req.query instead of deprecated req.param() | nodecg_nodecg | train | js |
77e24552a617abccba732861ae13b1a87ef5fe7f | diff --git a/pandas/tseries/tests/test_period.py b/pandas/tseries/tests/test_period.py
index <HASH>..<HASH> 100644
--- a/pandas/tseries/tests/test_period.py
+++ b/pandas/tseries/tests/test_period.py
@@ -1929,10 +1929,12 @@ class TestPeriodIndex(TestCase):
def test_get_loc_msg(self):
idx = period_range('2000-1-1', freq='A', periods=10)
bad_period = Period('2012', 'A')
+ self.assertRaises(KeyError, idx.get_loc, bad_period)
+
try:
idx.get_loc(bad_period)
except KeyError as inst:
- self.assert_(inst.message == bad_period)
+ self.assert_(inst.args[0] == bad_period)
def test_append_concat(self):
# #1815 | TST: fix broken test case on py3 and add assertRaises #<I> | pandas-dev_pandas | train | py |
3c7c063454af2fa4714ee19bea4b7ee61b983147 | diff --git a/lib/moneta/adapters/activerecord.rb b/lib/moneta/adapters/activerecord.rb
index <HASH>..<HASH> 100644
--- a/lib/moneta/adapters/activerecord.rb
+++ b/lib/moneta/adapters/activerecord.rb
@@ -116,9 +116,10 @@ module Moneta
# (see Proxy#each_key)
def each_key(&block)
- return enum_for(:each_key) { @table.count } unless block_given?
-
- @table.pluck(:k).each { |k| yield(k) }
+ with_connection do |conn|
+ return enum_for(:each_key) { conn.select_value(arel_sel.project(table[key_column].count)) } unless block_given?
+ conn.select_values(arel_sel.project(table[key_column])).each { |k| yield(k) }
+ end
self
end | Fix broken active record each_key after Arel changes | moneta-rb_moneta | train | rb |
ed19050d5ce19f281d6134bb4e8b3d5acafe53cb | diff --git a/addon/mixins/sortable-item.js b/addon/mixins/sortable-item.js
index <HASH>..<HASH> 100644
--- a/addon/mixins/sortable-item.js
+++ b/addon/mixins/sortable-item.js
@@ -187,14 +187,18 @@ export default Mixin.create({
*/
didInsertElement() {
this._super();
- this._tellGroup('registerItem', this);
+ // scheduled to prevent deprecation warning:
+ // "never change properties on components, services or models during didInsertElement because it causes significant performance degradation"
+ run.schedule("afterRender", this, "_tellGroup", "registerItem", this);
},
/**
@method willDestroyElement
*/
willDestroyElement() {
- this._tellGroup('deregisterItem', this);
+ // scheduled to prevent deprecation warning:
+ // "never change properties on components, services or models during didInsertElement because it causes significant performance degradation"
+ run.schedule("afterRender", this, "_tellGroup", "deregisterItem", this);
},
/** | Schedule registering/deregistering in afterRender
Prevents deprecation warnings of "never change properties on components,
services or models during didInsertElement because it causes significant
performance degradation”.
This doesn’t get triggered in the dummy app, but can do if you have a
custom component which has any computed properties on `group.items` etc… | heroku_ember-sortable | train | js |
c67593935290348d67d025326a4f74590723c403 | diff --git a/protractor_spec.js b/protractor_spec.js
index <HASH>..<HASH> 100644
--- a/protractor_spec.js
+++ b/protractor_spec.js
@@ -15,7 +15,8 @@ var IGNORED_TESTS = [
// Disable for now.
'closure/goog/testing/fs/integration_test.html',
'closure/goog/debug/fpsdisplay_test.html',
- 'closure/goog/net/jsloader_test.html'
+ 'closure/goog/net/jsloader_test.html',
+ 'closure/goog/net/filedownloader_test.html'
];
describe('Run all Closure unit tests', function() { | Blacklist filedownloader_test
It's flaky on Sauce labs. | google_closure-library | train | js |
d560c3a06742c9803cbf22c1da72e2bf69343c25 | diff --git a/aeron-archive/src/main/java/io/aeron/archive/Archive.java b/aeron-archive/src/main/java/io/aeron/archive/Archive.java
index <HASH>..<HASH> 100644
--- a/aeron-archive/src/main/java/io/aeron/archive/Archive.java
+++ b/aeron-archive/src/main/java/io/aeron/archive/Archive.java
@@ -798,7 +798,7 @@ public final class Archive implements AutoCloseable
private AuthenticatorSupplier authenticatorSupplier;
private Counter controlSessionsCounter;
- private int errorBufferLength = 0;
+ private int errorBufferLength;
private ErrorHandler errorHandler;
private AtomicCounter errorCounter;
private CountedErrorHandler countedErrorHandler;
@@ -905,7 +905,7 @@ public final class Archive implements AutoCloseable
if (null == markFile)
{
- if (0 == errorBufferLength && null == errorHandler)
+ if (0 == errorBufferLength)
{
errorBufferLength = Configuration.errorBufferLength();
}
@@ -914,8 +914,7 @@ public final class Archive implements AutoCloseable
}
errorHandler = CommonContext.setupErrorHandler(
- errorHandler,
- new DistinctErrorLog(markFile.errorBuffer(), epochClock, US_ASCII));
+ errorHandler, new DistinctErrorLog(markFile.errorBuffer(), epochClock, US_ASCII));
if (null == aeron)
{ | [Java] Set Archive errorBufferLength from config when constructing mark file regardless of if an error handler is provided. | real-logic_aeron | train | java |
872b5fd2ff5cc5f29ab88778b71cc97fb59ecf66 | diff --git a/driver/src/main/org/mongodb/MongoMappingCursor.java b/driver/src/main/org/mongodb/MongoMappingCursor.java
index <HASH>..<HASH> 100644
--- a/driver/src/main/org/mongodb/MongoMappingCursor.java
+++ b/driver/src/main/org/mongodb/MongoMappingCursor.java
@@ -18,7 +18,7 @@ package org.mongodb;
import org.mongodb.connection.ServerAddress;
-public class MongoMappingCursor<T, U> implements MongoCursor<U> {
+class MongoMappingCursor<T, U> implements MongoCursor<U> {
private final MongoCursor<T> proxied;
private final Function<T, U> mapper; | MongoMappingCursor doesn't need to be public | mongodb_mongo-java-driver | train | java |
5059e87f6291089f457f9584c3758d679072f67d | diff --git a/src/sap.m/test/sap/m/qunit/Page.qunit.js b/src/sap.m/test/sap/m/qunit/Page.qunit.js
index <HASH>..<HASH> 100755
--- a/src/sap.m/test/sap/m/qunit/Page.qunit.js
+++ b/src/sap.m/test/sap/m/qunit/Page.qunit.js
@@ -54,7 +54,7 @@ sap.ui.define([
var oHtml = new HTML({
- content : '<h1 id="qunit-header">QUnit Page for sap.m.Page</h1><h2 id="qunit-banner"></h2><h2 id="qunit-userAgent"></h2><ol id="qunit-tests"></ol>'
+ content : '<h1 id="qunit-header">Header</h1><h2 id="qunit-banner"></h2><h2 id="qunit-userAgent"></h2><ol id="qunit-tests"></ol>'
});
var oButton = new Button("bigButton", {
text: "Test", | [FIX] sap.m.Page: QUnit minor fix
- Change the header text of the tested page,
since it is confusing.
BCP: <I>
Change-Id: I4f<I>e9c<I>be<I>f6cec<I>b1dbe8dc4 | SAP_openui5 | train | js |
e3e6da99f6c7b93b2f6306a26c406e20d1c15cd7 | diff --git a/spec/ImageDiffSpec.js b/spec/ImageDiffSpec.js
index <HASH>..<HASH> 100644
--- a/spec/ImageDiffSpec.js
+++ b/spec/ImageDiffSpec.js
@@ -408,8 +408,11 @@ describe('ImageUtils', function() {
it('should remove imagediff from global space', function () {
imagediff.noConflict();
- expect(imagediff === that).toEqual(false);
- expect(global.imagediff === that).toEqual(false);
+ if (!require) {
+ // TODO Is there a better way to do this?
+ expect(imagediff === that).toEqual(false);
+ expect(global.imagediff === that).toEqual(false);
+ }
});
it('should return imagediff', function () { | Short circuit conflict test when in node. | HumbleSoftware_js-imagediff | train | js |
255065580cd8e8fabb2e2756501c65eafdddcdc7 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -33,7 +33,6 @@ function stopEvent (e) {
function makeOnDragOver (elem) {
return function (e) {
- if (e.target !== elem) return
e.stopPropagation()
e.preventDefault()
if (elem instanceof window.Element) elem.classList.add('drag') | fix dragenter
where do i return my programming license? | feross_drag-drop | train | js |
023bdcf1217b8f86de250f53391ad3b1e356949d | diff --git a/storage/memory.go b/storage/memory.go
index <HASH>..<HASH> 100644
--- a/storage/memory.go
+++ b/storage/memory.go
@@ -187,11 +187,6 @@ func (s *MemoryStore) InvalidateAuthorizeCodeSession(ctx context.Context, code s
return nil
}
-func (s *MemoryStore) DeleteAuthorizeCodeSession(_ context.Context, code string) error {
- delete(s.AuthorizeCodes, code)
- return nil
-}
-
func (s *MemoryStore) CreatePKCERequestSession(_ context.Context, code string, req fosite.Requester) error {
s.PKCES[code] = req
return nil
@@ -248,11 +243,6 @@ func (s *MemoryStore) DeleteRefreshTokenSession(_ context.Context, signature str
return nil
}
-func (s *MemoryStore) CreateImplicitAccessTokenSession(_ context.Context, code string, req fosite.Requester) error {
- s.Implicit[code] = req
- return nil
-}
-
func (s *MemoryStore) Authenticate(_ context.Context, name string, secret string) error {
rel, ok := s.Users[name]
if !ok { | fix(storage): remove unused methods (#<I>) | ory_fosite | train | go |
7fd1ca66d8e483892f7f34acd062c2eb7571297c | diff --git a/Swat/SwatForm.php b/Swat/SwatForm.php
index <HASH>..<HASH> 100644
--- a/Swat/SwatForm.php
+++ b/Swat/SwatForm.php
@@ -180,9 +180,6 @@ class SwatForm extends SwatDisplayableContainer
if (self::$default_salt !== null)
$this->setSalt(self::$default_salt);
- if (self::$default_authentication_token !== null)
- $this->setAuthenticationToken(self::$default_authentication_token);
-
$this->requires_id = true;
$this->addJavaScript('packages/swat/javascript/swat-form.js', | I was wrong. This code is not supposed to be here at all.
svn commit r<I> | silverorange_swat | train | php |
a2c56b9866e7598d11b2fa5f8b530945ee70585d | diff --git a/pkg/datapath/linux/config/config.go b/pkg/datapath/linux/config/config.go
index <HASH>..<HASH> 100644
--- a/pkg/datapath/linux/config/config.go
+++ b/pkg/datapath/linux/config/config.go
@@ -147,7 +147,6 @@ func (h *HeaderfileWriter) WriteNodeConfig(w io.Writer, cfg *datapath.LocalNodeC
cDefinesMap["POLICY_MAP_SIZE"] = fmt.Sprintf("%d", policymap.MaxEntries)
cDefinesMap["IPCACHE_MAP"] = ipcachemap.Name
cDefinesMap["IPCACHE_MAP_SIZE"] = fmt.Sprintf("%d", ipcachemap.MaxEntries)
- // TODO(anfernee): Update Documentation/concepts/ebpf/maps.rst when egress gateway support is merged.
cDefinesMap["EGRESS_POLICY_MAP"] = egressmap.PolicyMapName
cDefinesMap["EGRESS_POLICY_MAP_SIZE"] = fmt.Sprintf("%d", egressmap.MaxPolicyEntries)
cDefinesMap["POLICY_PROG_MAP_SIZE"] = fmt.Sprintf("%d", policymap.PolicyCallMaxEntries) | datapath: remove stale doc TODO
The doc update happened with commit
d<I>d<I>e<I>ab ("doc: Add Egress Gateway Getting Started Guide"). | cilium_cilium | train | go |
67345ab1b39f280380d7cc82d235f674902f4b25 | diff --git a/CHANGES b/CHANGES
index <HASH>..<HASH> 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,11 @@
Sea Cucumber Change Log
+1.5.2
+=====
+
+* Correct an old import that relied on an outdated reference
+ in boto.__init__ (lijoantony)
+
1.5.1
=====
@@ -43,4 +49,4 @@ Sea Cucumber Change Log
1.0
===
-* Initial release.
\ No newline at end of file
+* Initial release.
diff --git a/seacucumber/__init__.py b/seacucumber/__init__.py
index <HASH>..<HASH> 100644
--- a/seacucumber/__init__.py
+++ b/seacucumber/__init__.py
@@ -4,4 +4,4 @@ backed by celery. The interesting bits are in backend.py and tasks.py. The
rest of the contents of this module are largely optional.
"""
# In the form of Major, Minor.
-VERSION = (1, 5, 1)
+VERSION = (1, 5, 2)
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,7 @@ CLASSIFIERS = [
setup(
name='seacucumber',
- version='1.5.1',
+ version='1.5.2',
packages=[
'seacucumber',
'seacucumber.management', | Releasing <I>. | duointeractive_sea-cucumber | train | CHANGES,py,py |
805238d937a3b378a04aa813b8a294eb99fcdc0d | diff --git a/src/pythonModules/meteorpi_server/meteorpi_server/query_api.py b/src/pythonModules/meteorpi_server/meteorpi_server/query_api.py
index <HASH>..<HASH> 100644
--- a/src/pythonModules/meteorpi_server/meteorpi_server/query_api.py
+++ b/src/pythonModules/meteorpi_server/meteorpi_server/query_api.py
@@ -220,7 +220,7 @@ def add_routes(meteor_app, url_path=''):
length = size - byte1
if byte2 is not None:
- length = byte2 - byte1
+ length = byte2 - byte1 + 1
with open(filename_or_fp, 'rb') as f:
f.seek(byte1) | Bugfix to handling of partial content requests to meteorpi_server. See comments on thread <URL> | camsci_meteor-pi | train | py |
cc6b7a4863b73ffa499ab9c70aea3e3f53c2c171 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -21,7 +21,7 @@ function addValueBindLocator() {
function loadAndWaitForAureliaPage(pageUrl) {
browser.get(pageUrl);
- return browser.executeAsyncScript(
+ return browser.executeScript(
'var cb = arguments[arguments.length - 1];' +
'if (window.webpackJsonp && document.querySelector("[aurelia-app]")) { cb("Aurelia composed") }' +
'document.addEventListener("aurelia-composed", function (e) {' +
@@ -33,7 +33,7 @@ function loadAndWaitForAureliaPage(pageUrl) {
}
function waitForRouterComplete() {
- return browser.executeAsyncScript(
+ return browser.executeScript(
'var cb = arguments[arguments.length - 1];' +
'document.querySelector("[aurelia-app]")' +
'.aurelia.subscribeOnce("router:navigation:complete", function() {' + | fix(index): Replace executeAyncScript with executeScript (#4)
Fixes the issue described in: <URL> | aurelia_protractor-plugin | train | js |
922d560d7a736dceb68a1d5b494f79ca04a81c5c | diff --git a/tests/test__data.py b/tests/test__data.py
index <HASH>..<HASH> 100644
--- a/tests/test__data.py
+++ b/tests/test__data.py
@@ -256,7 +256,7 @@ class Test_fitter(_ut.TestCase):
self.fixtures_path = None
self.databox = None
- def test_bevington_reduced_chi_squared(self):
+ def test_bevington_reduced_chi_squareds(self):
"""
Test against Example 7.1 in Bevington.
"""
@@ -267,9 +267,10 @@ class Test_fitter(_ut.TestCase):
f.set_data(self.databox[0], self.databox[1], 0.05)
f.fit()
- value_from_fit = f.reduced_chi_squared()
+ value_from_fit = f.reduced_chi_squareds()
value_from_bevington = 1.5
self.assertAlmostEqual(value_from_fit, value_from_bevington, 1)
+
if __name__ == "__main__":
_ut.main() | Changed name to match the API, the test still fails as the return type is different. | Spinmob_spinmob | train | py |
ea0178d379d3ef503da49aa738cc4b1912a9eda9 | diff --git a/lib/aws4signer.js b/lib/aws4signer.js
index <HASH>..<HASH> 100644
--- a/lib/aws4signer.js
+++ b/lib/aws4signer.js
@@ -48,7 +48,7 @@ var aws4signer = function (esRequest, parent) {
const url = require('url')
var urlObj = url.parse(esURL)
- esRequest.headers = Object.assign({ 'host': urlObj.hostname }, esRequest.headers)
+ esRequest.headers = Object.assign({ 'host': urlObj.hostname, 'Content-Type': 'application/json' }, esRequest.headers)
esRequest.path = urlObj.path
aws4.sign(esRequest, credentials)
diff --git a/test/aws4signing.js b/test/aws4signing.js
index <HASH>..<HASH> 100644
--- a/test/aws4signing.js
+++ b/test/aws4signing.js
@@ -9,7 +9,6 @@ describe('aws4signer', function () {
var r = {
uri: 'http://127.0.0.1:9200/_search?q=test',
method: 'GET',
- headers: {'Content-Type': 'application/json'},
body: '{"query": { "match_all": {} }, "fields": ["*"], "_source": true }'
} | set `content-type` header by default & allow to be overriden
by esRequest | taskrabbit_elasticsearch-dump | train | js,js |
7644b6d9865049f4ee99dfe1507f63200c520677 | diff --git a/sos/report/plugins/autofs.py b/sos/report/plugins/autofs.py
index <HASH>..<HASH> 100644
--- a/sos/report/plugins/autofs.py
+++ b/sos/report/plugins/autofs.py
@@ -54,6 +54,11 @@ class Autofs(Plugin):
r"(password=)[^,\s]*",
r"\1********"
)
+ self.do_cmd_output_sub(
+ "automount -m",
+ r"(password=)[^,\s]*",
+ r"\1********"
+ )
class RedHatAutofs(Autofs, RedHatPlugin): | [autofs]: obsfucate password in `automount -m` cmd
This patch adds scrubbing of plain text password
from the output of `automount -m` command.
Before Patch :
test | -fstype=cifs,username=user,password=pass //server/sambashare
After Patch :
test | -fstype=cifs,username=user,password=**** //server/sambashare | sosreport_sos | train | py |
d4458ecbc0d39f4b4ea7b81f18ab5b0661756842 | diff --git a/src/parsimmon.js b/src/parsimmon.js
index <HASH>..<HASH> 100644
--- a/src/parsimmon.js
+++ b/src/parsimmon.js
@@ -116,12 +116,12 @@ Parsimmon.Parser = P(function(_, _super, Parser) {
var result = true;
var failure;
- for (var i = 0; i < min; i += 1) {
+ for (var times = 0; times < min; times += 1) {
result = self._(stream, success, firstFailure);
if (!result) return onFailure(stream, failure);
}
- for (; i < max && result; i += 1) {
+ for (; times < max && result; times += 1) {
result = self._(stream, success, secondFailure);
} | change iteration variable name in Parser::times
from `i` to more descriptive `times`
prep commit, to avoid collision with the variable meaning "character
index in stream" | jneen_parsimmon | train | js |
94fd67b7f97142bda274187e463320834a58cc15 | diff --git a/mpd.py b/mpd.py
index <HASH>..<HASH> 100644
--- a/mpd.py
+++ b/mpd.py
@@ -225,7 +225,7 @@ class MPDClient(object):
def _getitem(self):
items = list(self._readitems())
if len(items) != 1:
- raise ProtocolError, "Expected 1 item, got %i" % len(items)
+ return
return items[0][1]
def _getlist(self): | mpd.py: making _getitem return None if no item is returned
update and addid should normally always return a single item, so previously
an exception was raised if we got nothing. However, when used in a
command_list, only the *last* call to update will return an item. So
return None instead of raising an exception if we get nothing. | Mic92_python-mpd2 | train | py |
0cfb83d30bbabd807ec411e38b55bd257c194df9 | diff --git a/webapps/ui/common/tests/develop.conf.js b/webapps/ui/common/tests/develop.conf.js
index <HASH>..<HASH> 100644
--- a/webapps/ui/common/tests/develop.conf.js
+++ b/webapps/ui/common/tests/develop.conf.js
@@ -1,5 +1,9 @@
'use strict';
+/*
+TESTED=dashboard TESTED_APP=cockpit grunt test-e2e --protractorConfig=./ui/common/tests/develop.conf.js
+*/
+
var chai = require('chai');
var promised = require('chai-as-promised');
chai.use(promised); | improve(test-conf): add usage notes | camunda_camunda-bpm-platform | train | js |
911aba7dd85a7429d4add718690d6cbfd3b53cc1 | diff --git a/auth/ldap/lib.php b/auth/ldap/lib.php
index <HASH>..<HASH> 100644
--- a/auth/ldap/lib.php
+++ b/auth/ldap/lib.php
@@ -512,7 +512,7 @@ function auth_iscreator($username=0) {
}
if ((! $CFG->ldap_creators) OR (! $CFG->ldap_memberattribute)) {
- return false;
+ return null;
}
return auth_ldap_isgroupmember($username, $CFG->ldap_creators); | Return null in case creators are not defined | moodle_moodle | train | php |
0f372cd005b47a45746d43fc8fae028c037a4854 | diff --git a/src/components/TablePagination.js b/src/components/TablePagination.js
index <HASH>..<HASH> 100644
--- a/src/components/TablePagination.js
+++ b/src/components/TablePagination.js
@@ -98,8 +98,8 @@ function TablePagination(props) {
},
}}
rowsPerPageOptions={options.rowsPerPageOptions}
- onChangePage={handlePageChange}
- onChangeRowsPerPage={handleRowChange}
+ onPageChange={handlePageChange}
+ onRowsPerPageChange={handleRowChange}
/>
</div>
</MuiTableCell> | wrong named props mui5 fix (#1) | gregnb_mui-datatables | train | js |
361428aa92d8e1a0cf11d30b0a6dd7620db6dcf9 | diff --git a/lib/right_http_connection.rb b/lib/right_http_connection.rb
index <HASH>..<HASH> 100644
--- a/lib/right_http_connection.rb
+++ b/lib/right_http_connection.rb
@@ -76,7 +76,7 @@ them.
# Length of the post-error probationary period during which all requests will fail
HTTP_CONNECTION_RETRY_DELAY = 15 unless defined?(HTTP_CONNECTION_RETRY_DELAY)
# Secure communication between gateway and clouds
- USE_SSL = true unless defined?(HTTP_USE_SSL)
+ USE_SSL = true unless defined?(USE_SSL)
# SSL certificate authority file path
CA_FILE_PATH = "/opt/rightscale/certs" unless defined?(CA_FILE_PATH)
# SSL client certificate file path | Refs #<I> Modifying the type for USE SSL configuration | rightscale_right_http_connection | train | rb |
7786b9d5f55f5c05b26be2f5c1a4d20f59958548 | diff --git a/src/BaseAbstract.js b/src/BaseAbstract.js
index <HASH>..<HASH> 100644
--- a/src/BaseAbstract.js
+++ b/src/BaseAbstract.js
@@ -192,6 +192,10 @@ class BaseAbstract {
* @return {Object|Array}
*/
clearSystemFields (data) {
+ if (data === null || typeof data === 'undefined') {
+ return data;
+ }
+
if (!this._systemFields) {
throw new this.Error(this.Error.CODES.NO_SYSTEM_FIELDS);
} | chg: clearSystemFields check data for null and undefined | mafjs_api-abstract | train | js |
d503b8690ab036b44cbf8f9c038136c4544aec3c | diff --git a/lib/build.api.js b/lib/build.api.js
index <HASH>..<HASH> 100644
--- a/lib/build.api.js
+++ b/lib/build.api.js
@@ -64,14 +64,14 @@ module.exports = function (Aquifer) {
};
// Initialize drush and the build promise chain.
- drush.init()
+ drush.init({log: true})
// Delete current build.
.then(buildStep('Removing possible existing build...', function () {
fs.removeSync(self.destination);
}))
// Run drush make.
.then(buildStep('Executing drush make...', function () {
- return drush.spawn(['make', make, self.destination]);
+ return drush.exec(['make', make, self.destination]);
}))
// Create symlinks.
.then(buildStep('Creating symlinks...', function () {
diff --git a/lib/refresh.api.js b/lib/refresh.api.js
index <HASH>..<HASH> 100644
--- a/lib/refresh.api.js
+++ b/lib/refresh.api.js
@@ -29,7 +29,7 @@ module.exports = function (Aquifer) {
commands.forEach(function (args) {
functions.push(function() {
- return drush.spawn(location.concat(args));
+ return drush.exec(location.concat(args), {log: true});
});
}); | Use exec instead of spawn now that exec can do the logging like we want. | aquifer_aquifer | train | js,js |
5ba40863b1a0ed4d7cf7059a5aa579231d3e8691 | diff --git a/src/BinCommand.php b/src/BinCommand.php
index <HASH>..<HASH> 100644
--- a/src/BinCommand.php
+++ b/src/BinCommand.php
@@ -4,6 +4,7 @@ namespace Bamarni\Composer\Bin;
use Composer\Console\Application as ComposerApplication;
use Composer\Factory;
+use Composer\IO\IOInterface;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\StringInput;
@@ -103,6 +104,8 @@ class BinCommand extends BaseCommand
$this->chdir($namespace);
$input = new StringInput((string) $input . ' --working-dir=.');
+ $this->getIO()->writeError('<info>Run with <comment>' . $input->__toString() . '</comment></info>', true, IOInterface::VERBOSE);
+
return $application->doRun($input, $output);
}
@@ -132,7 +135,7 @@ class BinCommand extends BaseCommand
private function chdir($dir)
{
chdir($dir);
- $this->getIO()->writeError('<info>Changed current directory to ' . $dir . '</info>');
+ $this->getIO()->writeError('<info>Changed current directory to ' . $dir . '</info>', true, IOInterface::VERBOSE);
}
private function createConfig() | Add debug logs (#<I>)
* Add debug logs
* Change write to writeError | bamarni_composer-bin-plugin | train | php |
c9117941c9ddb5661e9daa7ad1263fc8e84df989 | diff --git a/src/Traits/Stats.php b/src/Traits/Stats.php
index <HASH>..<HASH> 100644
--- a/src/Traits/Stats.php
+++ b/src/Traits/Stats.php
@@ -26,10 +26,10 @@ use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
use Seat\Eveapi\Models\Character\CharacterInfoSkill;
use Seat\Eveapi\Models\Character\CharacterSkill;
-use Seat\Eveapi\Models\Character\CharacterWalletJournal;
use Seat\Eveapi\Models\Industry\CharacterMining;
use Seat\Eveapi\Models\Killmails\KillmailDetail;
use Seat\Eveapi\Models\Wallet\CharacterWalletBalance;
+use Seat\Eveapi\Models\Wallet\CharacterWalletJournal;
/**
* Class Stats. | fix: correct path for CharacterWallet Journal class (#<I>)
* Correct path for CharacterWallet Journal class
* Update Stats.php
Changed import order per CI | eveseat_web | train | php |
b147e2ac6861c14a366a63386110f9810df524a6 | diff --git a/src/AbstractRecursiveIterator.php b/src/AbstractRecursiveIterator.php
index <HASH>..<HASH> 100644
--- a/src/AbstractRecursiveIterator.php
+++ b/src/AbstractRecursiveIterator.php
@@ -38,9 +38,9 @@ abstract class AbstractRecursiveIterator extends AbstractIterator
*/
protected function _construct()
{
- parent::_construct();
-
$this->_resetParents();
+
+ parent::_construct();
}
/**
@@ -79,7 +79,7 @@ abstract class AbstractRecursiveIterator extends AbstractIterator
/**
* Adds an iterable parent onto the stack.
- *
+ *
* The stack is there to maintain a trace of hierarchy.
*
* @since [*next-version*] | Reversed order of operations in `_construct()` | Dhii_iterator-abstract | train | php |
f66c1bb4a22de5feb344b8b96da510b6e8b26c3b | diff --git a/lib/rules/no-print.js b/lib/rules/no-print.js
index <HASH>..<HASH> 100644
--- a/lib/rules/no-print.js
+++ b/lib/rules/no-print.js
@@ -5,7 +5,7 @@ module.exports = {
return {
'printStatement:enter': function(node) {
context.report({
- message: `Unpexected '${node.start.text.toUpperCase()}' statement.`,
+ message: `'${node.start.text.toUpperCase()}' statements should only be used for debugging purposes.`,
loc: {
start: node.start,
end: node.stop
diff --git a/lib/rules/no-stop.js b/lib/rules/no-stop.js
index <HASH>..<HASH> 100644
--- a/lib/rules/no-stop.js
+++ b/lib/rules/no-stop.js
@@ -5,7 +5,7 @@ module.exports = {
return {
'stopStatement:enter': function(node) {
context.report({
- message: `Unpexected 'STOP' statement.`,
+ message: "'STOP' statements should only be used for debugging purposes.",
loc: {
start: node.start,
end: node.stop | Change verbiage for no-print and no-stop | willowtreeapps_wist | train | js,js |
2a21bf617e2775ac01779951e95a96e61c78a222 | diff --git a/lib/resource.rb b/lib/resource.rb
index <HASH>..<HASH> 100644
--- a/lib/resource.rb
+++ b/lib/resource.rb
@@ -31,7 +31,8 @@ module RestClient
:url => url,
:user => user,
:password => password,
- :headers => headers)
+ :headers => headers,
+ :proxy => RestClient.proxy)
end
def post(payload, headers={})
@@ -40,7 +41,8 @@ module RestClient
:payload => payload,
:user => user,
:password => password,
- :headers => headers)
+ :headers => headers,
+ :proxy => RestClient.proxy)
end
def put(payload, headers={})
@@ -49,7 +51,8 @@ module RestClient
:payload => payload,
:user => user,
:password => password,
- :headers => headers)
+ :headers => headers,
+ :proxy => RestClient.proxy)
end
def delete(headers={})
@@ -57,7 +60,8 @@ module RestClient
:url => url,
:user => user,
:password => password,
- :headers => headers)
+ :headers => headers,
+ :proxy => RestClient.proxy)
end
# Construct a subresource, preserving authentication. | Make sure Resources get the proxy too. | rest-client_rest-client | train | rb |
c54eb5eba160390ef57c4dfc37f5553b48105568 | diff --git a/src/Mollie/API/Object/Payment.php b/src/Mollie/API/Object/Payment.php
index <HASH>..<HASH> 100644
--- a/src/Mollie/API/Object/Payment.php
+++ b/src/Mollie/API/Object/Payment.php
@@ -192,6 +192,13 @@ class Mollie_API_Object_Payment
public $expiredDatetime;
/**
+ * Date and time the payment failed in ISO-8601 format.
+ *
+ * @var string|null
+ */
+ public $failedDatetime;
+
+ /**
* The profile ID this payment belongs to.
*
* @example pfl_xH2kP6Nc6X | Add the new failedDatetime to the payment object | mollie_mollie-api-php | train | php |
fd18abf5038e8b87234de3d55b24ca1bc3ccbe19 | diff --git a/telluric/collections.py b/telluric/collections.py
index <HASH>..<HASH> 100644
--- a/telluric/collections.py
+++ b/telluric/collections.py
@@ -2,10 +2,10 @@ import os
import os.path
import warnings
import contextlib
-from collections import Sequence, OrderedDict
+from collections import Sequence, OrderedDict, defaultdict
from functools import partial
from itertools import islice
-from typing import Set, Iterator, Dict, Callable, Optional, Any, Union
+from typing import Set, Iterator, Dict, Callable, Optional, Any, Union, DefaultDict
import fiona
from shapely.geometry import CAP_STYLE
@@ -36,20 +36,21 @@ def dissolve(collection, aggfunc=None):
function to its properties.
"""
+ new_properties = {}
if aggfunc:
- new_properties = {}
- for name in collection.attribute_names:
- # noinspection PyBroadException
+ temp_properties = defaultdict(list) # type: DefaultDict[Any, Any]
+ for feature in collection:
+ for key, value in feature.attributes.items():
+ temp_properties[key].append(value)
+
+ for key, values in temp_properties.items():
try:
- new_properties[name] = aggfunc(collection.get_values(name))
+ new_properties[key] = aggfunc(values)
except Exception:
# We just do not use these results
pass
- else:
- new_properties = {}
-
return GeoFeature(collection.cascaded_union, new_properties) | Invert iteration order for efficiency | satellogic_telluric | train | py |
c539a85eb7fd03085e95a12b430da5a15a3000b6 | diff --git a/core/parts.py b/core/parts.py
index <HASH>..<HASH> 100644
--- a/core/parts.py
+++ b/core/parts.py
@@ -95,7 +95,7 @@ class BUS(object):
"""
self._lock = True
- if(offset >= self.current_max_offset):
+ if(offset > self.current_max_offset):
raise BUSError("Offset({}) exceeds address space of BUS({})".format(offset, self.current_max_offset))
self.reads += 1
for addresspace, device in self.index.items():
@@ -115,7 +115,7 @@ class BUS(object):
see read_word_.
"""
self._lock = True
- if(offset >= self.current_max_offset):
+ if(offset > self.current_max_offset):
raise BUSError("Offset({}) exceeds address space of BUS({})".format(offset, self.current_max_offset))
self.writes += 1 | fixed a bug in the address checking of the BUS | daknuett_py_register_machine2 | train | py |
4c7c25a1d1afe161aa77e9d1c767743fe8bc34e8 | diff --git a/test_nameko_sentry.py b/test_nameko_sentry.py
index <HASH>..<HASH> 100644
--- a/test_nameko_sentry.py
+++ b/test_nameko_sentry.py
@@ -867,7 +867,7 @@ class TestEndToEnd(object):
@pytest.fixture
def sentry_dsn(self, free_port):
- return 'eventlet+http://user:pass@localhost:{}/1'.format(free_port)
+ return 'eventlet+http://user:pass@127.0.0.1:{}/1'.format(free_port)
@pytest.fixture
def sentry_stub(self, container_factory, sentry_dsn, tracker): | must use <I> rather than localhost in stub sentry dsn | nameko_nameko-sentry | train | py |
fc41835e7a0cbb932d9495d611dd10f5e24a6e62 | diff --git a/lib/active_record/connection_adapters/oracle_enhanced_column_dumper.rb b/lib/active_record/connection_adapters/oracle_enhanced_column_dumper.rb
index <HASH>..<HASH> 100644
--- a/lib/active_record/connection_adapters/oracle_enhanced_column_dumper.rb
+++ b/lib/active_record/connection_adapters/oracle_enhanced_column_dumper.rb
@@ -47,7 +47,8 @@ module ActiveRecord #:nodoc:
spec[:scale] = column.scale.inspect if !column.scale.nil?
spec[:null] = 'false' if !column.null
spec[:as] = column.virtual_column_data_default if column.virtual?
- spec[:default] = default_string(column.default) if column.has_default? && !column.virtual?
+ spec[:default] = schema_default(column) if column.has_default? && !column.virtual?
+ spec.delete(:default) if spec[:default].nil?
if column.virtual?
# Supports backwards compatibility with older OracleEnhancedAdapter versions where 'NUMBER' virtual column type is not included in dump | Don't type cast the default on the column | rsim_oracle-enhanced | train | rb |
eda4a73ba60e5d2b6966a80d94b6d58c6c0a043d | diff --git a/core-bundle/src/EventListener/InitializeSystemListener.php b/core-bundle/src/EventListener/InitializeSystemListener.php
index <HASH>..<HASH> 100644
--- a/core-bundle/src/EventListener/InitializeSystemListener.php
+++ b/core-bundle/src/EventListener/InitializeSystemListener.php
@@ -374,6 +374,7 @@ class InitializeSystemListener extends ScopeAwareListener
// Check the request token upon POST requests
$token = new CsrfToken('_csrf', Input::post('REQUEST_TOKEN'));
+ // FIXME: This forces all routes handling POST data to pase a REQUEST_TOKEN
if ($_POST && !$this->tokenManager->isTokenValid($token)) {
// Force a JavaScript redirect upon Ajax requests (IE requires absolute link) | [Core] Added a FIXME for the REQUEST_TOKEN handling | contao_contao | train | php |
fc0355505ecd800256300f9bbca24477082f9de4 | diff --git a/lib/aws/core/client.rb b/lib/aws/core/client.rb
index <HASH>..<HASH> 100644
--- a/lib/aws/core/client.rb
+++ b/lib/aws/core/client.rb
@@ -19,8 +19,8 @@ module Aws
MISSING_REGION = 'a region must be specified'
# @option options [required, String] :region
- def initialize options = {}
- super
+ def initialize(options = {})
+ super(options)
@region = determine_region
end | Added more missing parenthesis. | aws_aws-sdk-ruby | train | rb |
560de0b0ec6c106e9d836557c84efdcbf689c3f7 | diff --git a/pyknow/fieldconstraint.py b/pyknow/fieldconstraint.py
index <HASH>..<HASH> 100644
--- a/pyknow/fieldconstraint.py
+++ b/pyknow/fieldconstraint.py
@@ -40,7 +40,10 @@ class ORFC(FieldConstraint):
class NOTFC(FieldConstraint):
- pass
+ def __rlshift__(self, other):
+ """Pass the binding to the internal element."""
+ self[0].__rlshift__(other)
+ return self
class L(Bindable, FieldConstraint):
diff --git a/pyknow/pattern.py b/pyknow/pattern.py
index <HASH>..<HASH> 100644
--- a/pyknow/pattern.py
+++ b/pyknow/pattern.py
@@ -3,7 +3,7 @@ class Bindable:
if not isinstance(other, str):
raise TypeError("%s can only be binded to a string" % self)
elif self.__bind__ is not None:
- raise RuntimeError("%s can only be binded once" % self)
+ raise RuntimeError("%s can only be binded once" % repr(self))
else:
self.__bind__ = other
return self | Making easier asignation of negated FC. | buguroo_pyknow | train | py,py |
a59c1e39b4895d624382c9949ea2bb19535e9a06 | diff --git a/lib/omnibus/packagers/appx.rb b/lib/omnibus/packagers/appx.rb
index <HASH>..<HASH> 100644
--- a/lib/omnibus/packagers/appx.rb
+++ b/lib/omnibus/packagers/appx.rb
@@ -52,7 +52,7 @@ module Omnibus
# @see Base#package_name
def package_name
- "#{project.package_name}-#{project.build_version}-#{project.build_iteration}.appx"
+ "#{project.package_name}-#{project.build_version}-#{project.build_iteration}-#{Config.windows_arch}.appx"
end
#
diff --git a/spec/unit/packagers/appx_spec.rb b/spec/unit/packagers/appx_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/packagers/appx_spec.rb
+++ b/spec/unit/packagers/appx_spec.rb
@@ -41,8 +41,12 @@ module Omnibus
end
describe "#package_name" do
+ before do
+ allow(Config).to receive(:windows_arch).and_return(:foo_arch)
+ end
+
it "includes the name, version, and build iteration" do
- expect(subject.package_name).to eq("project-1.2.3-2.appx")
+ expect(subject.package_name).to eq("project-1.2.3-2-foo_arch.appx")
end
end | include architecture as part of appx file names | chef_omnibus | train | rb,rb |
68b8db40c51cb67f069d72b857fdc0d5fc309243 | diff --git a/assets/message-bus.js b/assets/message-bus.js
index <HASH>..<HASH> 100644
--- a/assets/message-bus.js
+++ b/assets/message-bus.js
@@ -35,7 +35,7 @@ window.MessageBus = (function() {
(function(){
- var prefixes = ["","webkit","ms","moz","ms"];
+ var prefixes = ["","webkit","ms","moz"];
for(var i=0; i<prefixes.length; i++) {
var prefix = prefixes[i];
var check = prefix + (prefix === "" ? "hidden" : "Hidden"); | We don't need ms twice | SamSaffron_message_bus | train | js |
9486f2d9958ca97e6940d2975fecd2d5b30bdfb9 | diff --git a/ev3dev2/button.py b/ev3dev2/button.py
index <HASH>..<HASH> 100644
--- a/ev3dev2/button.py
+++ b/ev3dev2/button.py
@@ -130,7 +130,7 @@ class ButtonCommon(object):
"""
if new_state is None:
new_state = set(self.buttons_pressed)
- old_state = self._state
+ old_state = self._state if hasattr(self, '_state') else set()
self._state = new_state
state_diff = new_state.symmetric_difference(old_state) | Fix Button process() on Micropython
Micropython doesn't handle deep superclass constructors properly, so the _state attribute wasn't initialized. | ev3dev_ev3dev-lang-python | train | py |
683205c8b6cfd55f65b7fe489b24854e089eab42 | diff --git a/lib/helpers/request.js b/lib/helpers/request.js
index <HASH>..<HASH> 100644
--- a/lib/helpers/request.js
+++ b/lib/helpers/request.js
@@ -8,11 +8,16 @@ export default function doRequest (body) {
.then(() => {
const deferred = Q.defer();
let promise = deferred.promise;
+ const dataObj = {query, variables};
+ const payload =
+ headers['Content-Type'] === 'text/plain' ?
+ JSON.stringify(dataObj) :
+ dataObj;
const req = request
.post(endpoint || '/graphql')
.set(headers)
- .send({query, variables});
+ .send(payload);
req
.end((error, res) => { | allow setting content type as text/plain | relax_relate | train | js |
f58e6d4efe00fdd433e72fd5580a2717c16fb230 | diff --git a/lib/jsi/schema/ref.rb b/lib/jsi/schema/ref.rb
index <HASH>..<HASH> 100644
--- a/lib/jsi/schema/ref.rb
+++ b/lib/jsi/schema/ref.rb
@@ -81,8 +81,8 @@ module JSI
if schema_resource_root.is_a?(Schema)
resolve_fragment_ptr = schema_resource_root.method(:resource_root_subschema)
else
- # Note: reinstantiate_nonschemas_as_schemas, implemented in Schema#resource_root_subschema, is not
- # implemented for remote refs when the schema_resource_root is not a schema.
+ # Note: Schema#resource_root_subschema will reinstantiate nonschemas as schemas.
+ # not implemented for remote refs when the schema_resource_root is not a schema.
resolve_fragment_ptr = -> (ptr) { ptr.evaluate(schema_resource_root) }
end
end | minor reword code comment in Schema::Ref | notEthan_jsi | train | rb |
af026147802a2d5da9c060eae115a10706e24b41 | diff --git a/actstream/templatetags/activity_tags.py b/actstream/templatetags/activity_tags.py
index <HASH>..<HASH> 100644
--- a/actstream/templatetags/activity_tags.py
+++ b/actstream/templatetags/activity_tags.py
@@ -166,7 +166,7 @@ def actor_url(parser, token):
"""
bits = token.split_contents()
- if len(bits) != 4:
+ if len(bits) != 2:
raise TemplateSyntaxError, "Accepted format {% actor_url [actor_instance] %}"
else:
return DisplayActivityActorUrl(*bits[1:]) | Corrected the number of expected bits in the actor_url template tag. | justquick_django-activity-stream | train | py |
6717afd34905a0d8d60e98619a61b8b6cbbad54c | diff --git a/bika/lims/adapters/referencewidgetvocabulary.py b/bika/lims/adapters/referencewidgetvocabulary.py
index <HASH>..<HASH> 100644
--- a/bika/lims/adapters/referencewidgetvocabulary.py
+++ b/bika/lims/adapters/referencewidgetvocabulary.py
@@ -28,7 +28,12 @@ class DefaultReferenceWidgetVocabulary(object):
# first with all queries
contentFilter = dict((k, v) for k, v in base_query.items())
contentFilter.update(search_query)
- brains = catalog(contentFilter)
+ try:
+ brains = catalog(contentFilter)
+ except:
+ from bika.lims import logger
+ logger.info(contentFilter)
+ raise
if brains and searchTerm:
_brains = []
if len(searchFields) == 0 \ | Better error logging for failed catalog queries | senaite_senaite.core | train | py |
9275900d2dcd382cd21c5cec45fbb2ef00d44655 | diff --git a/libraries/client.js b/libraries/client.js
index <HASH>..<HASH> 100644
--- a/libraries/client.js
+++ b/libraries/client.js
@@ -200,7 +200,7 @@ client.prototype._handleMessage = function(message) {
if (self.twitchClient !== 1 && self.twitchClient !== 2) {
if (message.params.length >= 2) {
self.logger.event('timeout');
- self.emit('timeout', message.params[0], message.params[1].split(' ')[1]);
+ self.emit('timeout', message.params[0], message.params[1]);
}
else {
self.logger.event('clearchat'); | fix bug in timeout event not sending correct username | twitch-irc_twitch-irc | train | js |
c17b2890ca2411bf85b0089baff2bd59017ddd58 | diff --git a/translate/tests/test_translator.py b/translate/tests/test_translator.py
index <HASH>..<HASH> 100644
--- a/translate/tests/test_translator.py
+++ b/translate/tests/test_translator.py
@@ -19,7 +19,7 @@ class TestTranslator(unittest.TestCase):
def test_love(self):
love = translator('en', 'zh-TW', 'I love you')
- self.assertEqual(love['sentences'][0]['trans'], '我愛你')
+ self.assertEqual(love['sentences'][0]['trans'].encode('utf-8').decode('utf-8'), '我愛你')
if __name__ == '__main__':
unittest.main() | decode/encode utf-8 | jjangsangy_py-translate | train | py |
afdd8683e49ef5a4c0092f2639a11ca0ab374060 | diff --git a/model/Database.php b/model/Database.php
index <HASH>..<HASH> 100644
--- a/model/Database.php
+++ b/model/Database.php
@@ -391,7 +391,7 @@ abstract class SS_Database {
//DB Abstraction: remove this ===true option as a possibility?
if($spec === true) {
- $spec = "($index)";
+ $spec = "(\"$index\")";
}
//Indexes specified as arrays cannot be checked with this line: (it flattens out the array) | BUGFIX: Added double quotes to column names in automatically generated indexes for many_many relationships (this time in the right place, should not interfere with index name - all tests pass) | silverstripe_silverstripe-framework | train | php |
026af156b784c3d14e4b29f7764ffbb648954dc5 | diff --git a/wpull/pipeline/tasks/writer.py b/wpull/pipeline/tasks/writer.py
index <HASH>..<HASH> 100644
--- a/wpull/pipeline/tasks/writer.py
+++ b/wpull/pipeline/tasks/writer.py
@@ -30,9 +30,9 @@ class FileWriterSetupTask(ItemTask[AppSession]):
return session.factory.new('FileWriter') # is a NullWriter
elif args.output_document:
- session.factory.class_map['FileWriter'] = SingleDocumentWriter(
- args.output_document, headers_included=args.save_headers)
- return session.factory.new('FileWriter')
+ session.factory.class_map['FileWriter'] = SingleDocumentWriter
+ return session.factory.new('FileWriter', args.output_document,
+ headers_included=args.save_headers)
use_dir = (len(args.urls) != 1 or args.page_requisites
or args.recursive) | tasks: Fix FileWriter init args passed to wrong function | ArchiveTeam_wpull | train | py |
b0829593f8bb33f54db0e72c92cf802334d1a7d4 | diff --git a/param/__init__.py b/param/__init__.py
index <HASH>..<HASH> 100644
--- a/param/__init__.py
+++ b/param/__init__.py
@@ -2033,7 +2033,9 @@ class Color(Parameter):
class Range(NumericTuple):
- "A numeric range with optional bounds and softbounds"
+ """
+ A numeric range with optional bounds and softbounds.
+ """
__slots__ = ['bounds', 'inclusive_bounds', 'softbounds', 'step'] | Make Range docstring match conventions (#<I>) | pyviz_param | train | py |
01b01aa63a562605be9b505b580cfd356c435e50 | diff --git a/poetry/utils/env.py b/poetry/utils/env.py
index <HASH>..<HASH> 100644
--- a/poetry/utils/env.py
+++ b/poetry/utils/env.py
@@ -286,7 +286,13 @@ class EnvManager(object):
python_minor = env["minor"]
# Check if we are inside a virtualenv or not
- in_venv = os.environ.get("VIRTUAL_ENV") is not None
+ # Conda sets CONDA_PREFIX in its envs, see
+ # https://github.com/conda/conda/issues/2764
+ env_prefix = os.environ.get("VIRTUAL_ENV", os.environ.get("CONDA_PREFIX"))
+ conda_env_name = os.environ.get("CONDA_DEFAULT_ENV")
+ # It's probably not a good idea to pollute Conda's global "base" env, since
+ # most users have it activated all the time.
+ in_venv = env_prefix is not None and conda_env_name != "base"
if not in_venv or env is not None:
# Checking if a local virtualenv exists
@@ -315,8 +321,8 @@ class EnvManager(object):
return VirtualEnv(venv)
- if os.environ.get("VIRTUAL_ENV") is not None:
- prefix = Path(os.environ["VIRTUAL_ENV"])
+ if env_prefix is not None:
+ prefix = Path(env_prefix)
base_prefix = None
else:
prefix = Path(sys.prefix) | Detect Conda when looking for a virtual env (#<I>)
Currently Poetry will detect that it is running in a usual virtual env
created with "python -m venv" and will not create an additional env.
This commit extends this logic to Conda, which uses different
environment variables to indicate running in a virtual env.
Conda's "base" env is treated specially to avoid polluting global
namespace. | sdispater_poetry | train | py |
9948939792617cc19b7320172b4765a83626d4a2 | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -13,7 +13,7 @@
import sys, os
-sys.path.append(os.path.abspath("../sphinx-pyreverse"))
+sys.path.insert(0, os.path.abspath("../sphinx-pyreverse"))
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the | Added importing to the begining | alendit_sphinx-pyreverse | train | py |
9294c277a775226369ff1f6a411bbc83700436b0 | diff --git a/parser_test.go b/parser_test.go
index <HASH>..<HASH> 100644
--- a/parser_test.go
+++ b/parser_test.go
@@ -36,6 +36,16 @@ func TestParseParams(t *testing.T) {
{"select ? /* ? / ? */ ?", "select @p1 /* ? / ? */ @p2", 2},
{"select $", "select $", 0},
{"select x::y", "select x::y", 0},
+ {"select '", "select '", 0},
+ {"select \"", "select \"", 0},
+ {"select [", "select [", 0},
+ {"select []", "select []", 0},
+ {"select -", "select -", 0},
+ {"select /", "select /", 0},
+ {"select 1/1", "select 1/1", 0},
+ {"select /*", "select /*", 0},
+ {"select /**", "select /**", 0},
+ {"select /*/", "select /*/", 0},
}
for _, v := range values { | increase test coverage for parser.go | denisenkom_go-mssqldb | train | go |
b47ab96800fa3878afb3bc96d75a4a74fc269d35 | diff --git a/lib/dpl/provider/pypi.rb b/lib/dpl/provider/pypi.rb
index <HASH>..<HASH> 100644
--- a/lib/dpl/provider/pypi.rb
+++ b/lib/dpl/provider/pypi.rb
@@ -1,7 +1,7 @@
module DPL
class Provider
class PyPI < Provider
- DEFAULT_SERVER = 'http://pypi.python.org/pypi'
+ DEFAULT_SERVER = 'https://pypi.python.org/pypi'
PYPIRC_FILE = '~/.pypirc'
def self.install_setuptools | Use TLS endpoint as default value for PyPI server. Refs #<I>. | travis-ci_dpl | train | rb |
34a4301a506422a9885bac102f2ebd5ede10de94 | diff --git a/app/models/content.rb b/app/models/content.rb
index <HASH>..<HASH> 100644
--- a/app/models/content.rb
+++ b/app/models/content.rb
@@ -347,10 +347,8 @@ class Content < ActiveRecord::Base
def atom_enclosures(xml)
end
- def atom_content(xml)
- xml.content(:type => 'xhtml') do
- xml.div(:xmlns => 'http://www.w3.org/1999/xhtml') { xml << html(:all) }
- end
+ def atom_content(entry)
+ entry.content(html(:all), :type => 'html')
end
end | Fix escaping in feed for comments. | publify_publify | train | rb |
6cd07c7cf04e4a07c1da670cd3d13384647c44ba | diff --git a/server/events_test.go b/server/events_test.go
index <HASH>..<HASH> 100644
--- a/server/events_test.go
+++ b/server/events_test.go
@@ -231,7 +231,7 @@ func TestSystemAccountNewConnection(t *testing.T) {
t.Fatalf("Error unmarshalling connect event message: %v", err)
}
if cem.Server.ID != s.ID() {
- t.Fatalf("Expected server to be %q, got %q", s.ID(), cem.Server)
+ t.Fatalf("Expected server to be %q, got %q", s.ID(), cem.Server.ID)
}
if cem.Server.Seq == 0 {
t.Fatalf("Expected sequence to be non-zero")
@@ -279,7 +279,7 @@ func TestSystemAccountNewConnection(t *testing.T) {
}
if dem.Server.ID != s.ID() {
- t.Fatalf("Expected server to be %q, got %q", s.ID(), dem.Server)
+ t.Fatalf("Expected server to be %q, got %q", s.ID(), dem.Server.ID)
}
if dem.Server.Seq == 0 {
t.Fatalf("Expected sequence to be non-zero") | Fixed improper field pass to Fatalf() | nats-io_gnatsd | train | go |
f4ab4a5ce7dcfd4dadd770686169a56c468b76cc | diff --git a/datapoint/Observation.py b/datapoint/Observation.py
index <HASH>..<HASH> 100644
--- a/datapoint/Observation.py
+++ b/datapoint/Observation.py
@@ -17,3 +17,12 @@ class Observation(object):
self.days = []
# TODO: Add functions to get the latest observation and previous ones.
+ # We always want the final day in the list of days, and the final timestep
+ # in that day.
+
+ def now(self):
+ """
+ Return the final timestep available.
+ """
+
+ return self.days[-1].timesteps[-1] | Add function to return most recent observation timestep | jacobtomlinson_datapoint-python | train | py |
45e642531130ca4a8311606e1bdb19c364a9b8f2 | diff --git a/spec/process_shared/semaphore_spec.rb b/spec/process_shared/semaphore_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/process_shared/semaphore_spec.rb
+++ b/spec/process_shared/semaphore_spec.rb
@@ -15,7 +15,7 @@ module ProcessShared
begin
val = mem.get_int(0)
# ensure other procs have a chance to interfere
- sleep 0.001 if rand(100) == 0
+ sleep 0.002 if rand(50) == 0
mem.put_int(0, val + 1)
rescue => e
"#{Process.pid} die'ing because #{e}" | Be more sleepy in test to ensure failure when not locking. | pmahoney_process_shared | train | rb |
41eac95fddb7497d6b6100f45fc09075b7cc6699 | diff --git a/infoq.py b/infoq.py
index <HASH>..<HASH> 100644
--- a/infoq.py
+++ b/infoq.py
@@ -229,13 +229,13 @@ class InfoQ(object):
def download(self, url, dir_path, filename=None):
if not filename:
filename = url.rsplit('/', 1)[1]
+ path = os.path.join(dir_path, filename)
content = self.fetch(url)
-
- with open(os.path.join(dir_path, filename), "w") as f:
+ with open(path, "w") as f:
f.write(content)
- return filename
+ return path
def download_all(self, urls, dir_path):
""" Download all the resources specified by urls into dir_path. The resulting | Fix bug in download.
Return the full path of the file rather than the basename | cykl_infoqscraper | train | py |
7246282c212a35047b2d6cc6885f4e84f3b2eb58 | diff --git a/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OTxSegment.java b/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OTxSegment.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OTxSegment.java
+++ b/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OTxSegment.java
@@ -379,7 +379,7 @@ public class OTxSegment extends OSingleFileSegment {
case OPERATION_DELETE:
// CREATE A NEW HOLE FOR THE TEMPORARY OLD RECORD KEPT UNTIL COMMIT
- dataSegment.deleteRecord(oldDataOffset);
+ //dataSegment.deleteRecord(oldDataOffset);
break;
}
} | Fixed issue <I>, but need more checks about this. | orientechnologies_orientdb | train | java |
fa92e1713936aa2d855bb5af471e3f66bbb0a46c | diff --git a/js/chrome/login.js b/js/chrome/login.js
index <HASH>..<HASH> 100644
--- a/js/chrome/login.js
+++ b/js/chrome/login.js
@@ -37,4 +37,9 @@ var $loginForm = $('#login form').submit(function (event) {
}
}
});
-});
\ No newline at end of file
+});
+
+if ($('#homebtn').length) {
+ jsbin.settings.home = document.cookie.split('home=')[1].split(';')[0];
+ document.title = jsbin.settings.home + '@' + document.title;
+}
\ No newline at end of file
diff --git a/js/jsbin.js b/js/jsbin.js
index <HASH>..<HASH> 100644
--- a/js/jsbin.js
+++ b/js/jsbin.js
@@ -42,6 +42,6 @@ jQuery.expr[':'].host = function(obj, index, meta, stack) {
//= require "vendor/json2"
//= require "editors/editors"
//= require "render/render"
-//= require "chrome/beta"
+// require "chrome/beta"
//= require "chrome/app"
})(this, document); | Removed beta and set name@ in login | jsbin_jsbin | train | js,js |
0614894a15d94d208fc56ebeab78480bbe5dcbc2 | diff --git a/go/acct/radius.go b/go/acct/radius.go
index <HASH>..<HASH> 100644
--- a/go/acct/radius.go
+++ b/go/acct/radius.go
@@ -218,7 +218,7 @@ func (h *PfAcct) RADIUSSecret(ctx context.Context, remoteAddr net.Addr, raw []by
switchInfo, err := h.SwitchLookup(macStr, ip)
if err != nil {
- logError(h.LoggerCtx, "RADIUSSecret: Switch '" + ip +"' not found :"+err.Error())
+ logError(h.LoggerCtx, "RADIUSSecret: Switch '"+ip+"' not found :"+err.Error())
return nil, nil, err
}
@@ -286,6 +286,12 @@ func packetToMap(ctx context.Context, p *radius.Packet) map[string]interface{} {
}
}
+ if val, found := attributes["Calling-Station-Id"]; found {
+ if mac, err := mac.NewFromString(val); err == nil {
+ attributes["Calling-Station-Id"] = mac.String()
+ }
+ }
+
return attributes
} | Format the calling-station-id before sending it | inverse-inc_packetfence | train | go |
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.