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
|
---|---|---|---|---|---|
7246585a705ee0ac5370e7b5c4ee3b8fea924d9f
|
diff --git a/lib/db/access.php b/lib/db/access.php
index <HASH>..<HASH> 100644
--- a/lib/db/access.php
+++ b/lib/db/access.php
@@ -150,8 +150,8 @@ $moodle_capabilities = array(
'guest' => CAP_PREVENT,
'student' => CAP_PREVENT,
'teacher' => CAP_PREVENT,
- 'editingteacher' => CAP_PREVENT,
- 'coursecreator' => CAP_PREVENT,
+ 'editingteacher' => CAP_ALLOW,
+ 'coursecreator' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
),
@@ -166,8 +166,8 @@ $moodle_capabilities = array(
'guest' => CAP_PREVENT,
'student' => CAP_PREVENT,
'teacher' => CAP_PREVENT,
- 'editingteacher' => CAP_PREVENT,
- 'coursecreator' => CAP_PREVENT,
+ 'editingteacher' => CAP_ALLOW,
+ 'coursecreator' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
),
|
setting default value for backup/restore capabilities for teacheredit and coursecreators
|
moodle_moodle
|
train
|
php
|
aa0e1bb71fa13e2332aa1ae87bbeaa8cec54ccb0
|
diff --git a/lib/filesystem.js b/lib/filesystem.js
index <HASH>..<HASH> 100644
--- a/lib/filesystem.js
+++ b/lib/filesystem.js
@@ -106,6 +106,7 @@ function fsSize(callback) {
exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) {
if (!error) {
let lines = stdout.toString().split('\n');
+ if (lines && lines[0] && lines[0].toLowerCase().startsWith('filesystem')) { lines.shift(); }
data = parseDf(lines);
if (callback) {
callback(data);
@@ -115,6 +116,7 @@ function fsSize(callback) {
exec('df -kPT', { maxBuffer: 1024 * 1024 }, function (error, stdout) {
if (!error) {
let lines = stdout.toString().split('\n');
+ if (lines && lines[0] && lines[0].toLowerCase().startsWith('filesystem')) { lines.shift(); }
data = parseDf(lines);
}
if (callback) {
|
fsSize() adapted parsing linux
|
sebhildebrandt_systeminformation
|
train
|
js
|
164ddfc5271f04ff27b6557f40199978453268d7
|
diff --git a/tests.py b/tests.py
index <HASH>..<HASH> 100644
--- a/tests.py
+++ b/tests.py
@@ -45,8 +45,8 @@ class TestCode(unittest.TestCase):
:return: nothing
"""
- for i in range(len(self.raw_dividers)):
- try:
+ try:
+ for i in range(len(self.raw_dividers)):
# Try to match the raw divider with the result
# of the function:
if i != 35 and i != 0:
@@ -56,6 +56,8 @@ class TestCode(unittest.TestCase):
)
elif i == 35 and i != 0:
self.assertNotEqual(self.raw_dividers[i], area4.divider(i))
+ finally:
+ pass
def test_splitter(self):
"""
|
Put a pass in the finally wrapper
|
area4lib_area4
|
train
|
py
|
cf75d69030a59b50bdfc02d332b864bffb353651
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -6,7 +6,7 @@ version = '1.0.6'
install_requires = [
"djangorestframework>=3.7.7",
"django>=2.2.1",
- "PyJWT>=1.6.1",
+ "PyJWT==1.6.1",
"requests>=2.20.0",
"cryptography>=2.3",
]
|
Lock pyjwt version to <I>
|
ridi_django-oauth2
|
train
|
py
|
0f85a7660f47466f97ae864f3c8a0a786c539ef7
|
diff --git a/lib/active_job/queue_adapters/disc_adapter.rb b/lib/active_job/queue_adapters/disc_adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/active_job/queue_adapters/disc_adapter.rb
+++ b/lib/active_job/queue_adapters/disc_adapter.rb
@@ -4,11 +4,11 @@ require 'msgpack'
module ActiveJob
module QueueAdapters
class DiscAdapter
- def enqueue(job)
+ def self.enqueue(job)
enqueue_at(job, nil)
end
- def enqueue_at(job, timestamp)
+ def self.enqueue_at(job, timestamp)
Disc.disque.push(
job.queue_name,
{
|
ActiveJob wants clas methods
|
pote_disc
|
train
|
rb
|
6bafb1fa5ccaa2e08c6068712f5f60d7d2ef79aa
|
diff --git a/symphony/lib/toolkit/class.databasequery.php b/symphony/lib/toolkit/class.databasequery.php
index <HASH>..<HASH> 100644
--- a/symphony/lib/toolkit/class.databasequery.php
+++ b/symphony/lib/toolkit/class.databasequery.php
@@ -454,10 +454,11 @@ class DatabaseQuery extends DatabaseStatement
*/
public function countProjection($col = '*')
{
+ $ignoredParts = ['statement', 'cache', 'projection', 'order by', 'limit', 'offset'];
$cp = new DatabaseQuery($this->getDB(), ["COUNT($col)"]);
foreach ($this->getSQL() as $part) {
$type = current(array_keys($part));
- if (in_array($type, ['statement', 'cache', 'projection'], true)) {
+ if (in_array($type, $ignoredParts, true)) {
continue;
}
$cp->unsafeAppendSQLPart($type, current(array_values($part)));
|
Ignore order by, limit and offset in new counts
They are not needed !
Picked from <I>faa
Picked from c<I>ceb<I>d
Picked from c<I>c3b0
|
symphonycms_symphony-2
|
train
|
php
|
3a40c0e44f9f7118f8afb12b0a917f9843110fc0
|
diff --git a/reactfx/src/main/java/org/reactfx/EitherEventStream.java b/reactfx/src/main/java/org/reactfx/EitherEventStream.java
index <HASH>..<HASH> 100644
--- a/reactfx/src/main/java/org/reactfx/EitherEventStream.java
+++ b/reactfx/src/main/java/org/reactfx/EitherEventStream.java
@@ -70,6 +70,24 @@ public interface EitherEventStream<L, R> extends EventStream<Either<L, R>> {
return split(either -> either.mapRight(f));
}
+ default <L1, R1> EitherEventStream<L1, R1> split(
+ Function<? super L, Either<L1, R1>> leftMap,
+ Function<? super R, Either<L1, R1>> rightMap) {
+ return split(either -> either.isLeft()
+ ? leftMap.apply(either.getLeft())
+ : rightMap.apply(either.getRight()));
+ }
+
+ default <L1> EitherEventStream<L1, R> splitLeft(
+ Function<? super L, Either<L1, R>> leftMap) {
+ return split(leftMap, Either::right);
+ }
+
+ default <R1> EitherEventStream<L, R1> splitRight(
+ Function<? super R, Either<L, R1>> rightMap) {
+ return split(Either::left, rightMap);
+ }
+
default <T> EventStream<T> unify(
Function<? super L, ? extends T> leftMap,
Function<? super R, ? extends T> rightMap) {
|
Add some convenient split() methods to EitherEventStream.
|
TomasMikula_ReactFX
|
train
|
java
|
6776b22d717acd3af9e1c018c8aaf842c1bc23b4
|
diff --git a/lib/chef/application.rb b/lib/chef/application.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/application.rb
+++ b/lib/chef/application.rb
@@ -84,11 +84,11 @@ class Chef::Application
Chef::Config.merge!(config)
rescue SocketError => error
- Chef::Application.fatal!("Error getting config file #{Chef::Config[:config_file]}", 2)
+ Chef::Application.fatal!("Error getting config file #{config[:config_file]}", 2)
rescue Chef::Exceptions::ConfigurationError => error
- Chef::Application.fatal!("Error processing config file #{Chef::Config[:config_file]} with error #{error.message}", 2)
+ Chef::Application.fatal!("Error processing config file #{config[:config_file]} with error #{error.message}", 2)
rescue Exception => error
- Chef::Application.fatal!("Unknown error processing config file #{Chef::Config[:config_file]} with error #{error.message}", 2)
+ Chef::Application.fatal!("Unknown error processing config file #{config[:config_file]} with error #{error.message}", 2)
end
end
|
CHEF-<I>: fixed config_file path lookup in exception text
|
chef_chef
|
train
|
rb
|
c11181b35c1e917aed824db7de01bf1137e48e2f
|
diff --git a/libraries/lithium/action/Request.php b/libraries/lithium/action/Request.php
index <HASH>..<HASH> 100644
--- a/libraries/lithium/action/Request.php
+++ b/libraries/lithium/action/Request.php
@@ -350,7 +350,7 @@ class Request extends \lithium\core\Object {
while (in_array(basename($base), array('app', 'webroot'))) {
$base = ltrim(dirname($base), '.');
}
- return $base;
+ return rtrim($base, '/');
}
}
diff --git a/libraries/lithium/http/Router.php b/libraries/lithium/http/Router.php
index <HASH>..<HASH> 100644
--- a/libraries/lithium/http/Router.php
+++ b/libraries/lithium/http/Router.php
@@ -64,7 +64,7 @@ class Router extends \lithium\core\StaticObject {
if (strpos($path, '#') === 0 || strpos($path, 'mailto') === 0 || strpos($path, '://')) {
return $path;
}
- $base = rtrim(isset($context) ? $context->env('base') : '', '/');
+ $base = isset($context) ? $context->env('base') : '';
$path = trim($path, '/');
return "{$base}/{$path}";
}
|
Refactoring `Router`, `action\Request` to properly calculate base directory for links and assets.
|
UnionOfRAD_framework
|
train
|
php,php
|
3d551e25e01bd95c190766869bf0260debe07ead
|
diff --git a/configs/config_build.go b/configs/config_build.go
index <HASH>..<HASH> 100644
--- a/configs/config_build.go
+++ b/configs/config_build.go
@@ -1,6 +1,8 @@
package configs
import (
+ "sort"
+
version "github.com/hashicorp/go-version"
"github.com/hashicorp/hcl2/hcl"
)
@@ -28,7 +30,16 @@ func buildChildModules(parent *Config, walker ModuleWalker) (map[string]*Config,
calls := parent.Module.ModuleCalls
- for _, call := range calls {
+ // We'll sort the calls by their local names so that they'll appear in a
+ // predictable order in any logging that's produced during the walk.
+ callNames := make([]string, 0, len(calls))
+ for k := range calls {
+ callNames = append(callNames, k)
+ }
+ sort.Strings(callNames)
+
+ for _, callName := range callNames {
+ call := calls[callName]
path := make([]string, len(parent.Path)+1)
copy(path, parent.Path)
path[len(path)-1] = call.Name
|
configs: BuildConfig sorts child modules by name
This is not strictly necessary, but since this is not a
performance-critical codepath we'll do this because it makes life easier
for callers that want to print out user-facing logs about build process,
or who are logging actions taken as part of a unit test.
|
hashicorp_terraform
|
train
|
go
|
f3c1cbbd54497fa002169413d915d0a7f28ba21b
|
diff --git a/lib/cassette/http/request.rb b/lib/cassette/http/request.rb
index <HASH>..<HASH> 100644
--- a/lib/cassette/http/request.rb
+++ b/lib/cassette/http/request.rb
@@ -26,7 +26,7 @@ module Cassette
end
def log_request
- -> (request) { Cassette.logger.debug "Request: #{request.inspect}" }
+ lambda { |request| Cassette.logger.debug "Request: #{request.inspect}" }
end
def check_response
diff --git a/lib/cassette/http/ticket_response.rb b/lib/cassette/http/ticket_response.rb
index <HASH>..<HASH> 100644
--- a/lib/cassette/http/ticket_response.rb
+++ b/lib/cassette/http/ticket_response.rb
@@ -32,7 +32,7 @@ module Cassette
end
def access_key
- -> (hash, key) { hash.try(:[], key) }
+ lambda { |hash, key| hash.try(:[], key) }
end
def attributes
|
Back to <I>.x compatible lambdas
|
locaweb_cassette
|
train
|
rb,rb
|
8ee11e437c62d5b9ca475fe088ebc885dc21a8ba
|
diff --git a/umap/sparse_nndescent.py b/umap/sparse_nndescent.py
index <HASH>..<HASH> 100644
--- a/umap/sparse_nndescent.py
+++ b/umap/sparse_nndescent.py
@@ -27,7 +27,7 @@ from umap.rp_tree import search_sparse_flat_tree
locale.setlocale(locale.LC_NUMERIC, "C")
[email protected](parallel=True)
[email protected]()
def sparse_nn_descent(
inds,
indptr,
@@ -154,7 +154,7 @@ def sparse_nn_descent(
return deheap_sort(current_graph)
[email protected](parallel=True)
[email protected]()
def sparse_init_from_random(
n_neighbors,
inds,
@@ -186,7 +186,7 @@ def sparse_init_from_random(
return
[email protected](parallel=True)
[email protected]()
def sparse_init_from_tree(
tree,
inds,
|
Remove some parallels in sparse nndescent
|
lmcinnes_umap
|
train
|
py
|
bcfbbce9828d68297b90a342c535b6bc0c20e80a
|
diff --git a/lib/declarative_authorization/obligation_scope.rb b/lib/declarative_authorization/obligation_scope.rb
index <HASH>..<HASH> 100644
--- a/lib/declarative_authorization/obligation_scope.rb
+++ b/lib/declarative_authorization/obligation_scope.rb
@@ -107,9 +107,16 @@ module Authorization
end
# Returns the model associated with the given path.
- def model_for( path )
- reflection = reflection_for( path )
- reflection.respond_to?( :klass ) ? reflection.klass : reflection
+ def model_for (path)
+ reflection = reflection_for(path)
+
+ if reflection.respond_to?(:proxy_reflection)
+ reflection.proxy_reflection.klass
+ elsif reflection.respond_to?(:klass)
+ reflection.klass
+ else
+ reflection
+ end
end
# Returns the reflection corresponding to the given path.
|
Fixes third possible unnecessary query on AR proxy [ledermann]
|
stffn_declarative_authorization
|
train
|
rb
|
66892dbca8fd46175cc5a31179c1610975e3c436
|
diff --git a/lxd/instance/instance_interface.go b/lxd/instance/instance_interface.go
index <HASH>..<HASH> 100644
--- a/lxd/instance/instance_interface.go
+++ b/lxd/instance/instance_interface.go
@@ -182,4 +182,5 @@ type CriuMigrationArgs struct {
type Info struct {
Name string // Name of an instance driver, e.g. "lxc"
Version string // Version number of a loaded instance driver
+ Error error // Whether there is an operational impediment.
}
|
lxd/instance/instance/interface: Adds Error field to Info struct
For returning driver availability errors.
|
lxc_lxd
|
train
|
go
|
58ec903cd4eb9790d1a757a9d680d03d801d794d
|
diff --git a/actionpack/test/controller/redirect_test.rb b/actionpack/test/controller/redirect_test.rb
index <HASH>..<HASH> 100644
--- a/actionpack/test/controller/redirect_test.rb
+++ b/actionpack/test/controller/redirect_test.rb
@@ -266,15 +266,17 @@ class RedirectTest < ActionController::TestCase
end
def test_redirect_to_nil
- assert_raise(ActionController::ActionControllerError) do
+ error = assert_raise(ActionController::ActionControllerError) do
get :redirect_to_nil
end
+ assert_equal "Cannot redirect to nil!", error.message
end
def test_redirect_to_params
- assert_raise(ActionController::ActionControllerError) do
+ error = assert_raise(ActionController::ActionControllerError) do
get :redirect_to_params
end
+ assert_equal "Cannot redirect to a parameter hash!", error.message
end
def test_redirect_to_with_block
|
Added assertion for error messages for redirection to nil and params
As both `redirect_to_nil` and `redirect_to_params` are raising same `ActionController::ActionControllerError` so it’s good to assert error messages as well
|
rails_rails
|
train
|
rb
|
533a320a942fd8722cbaa196142d3972a69572b0
|
diff --git a/plugins/gradle/src/main/java/org/wildfly/swarm/plugin/gradle/PackageTask.java b/plugins/gradle/src/main/java/org/wildfly/swarm/plugin/gradle/PackageTask.java
index <HASH>..<HASH> 100644
--- a/plugins/gradle/src/main/java/org/wildfly/swarm/plugin/gradle/PackageTask.java
+++ b/plugins/gradle/src/main/java/org/wildfly/swarm/plugin/gradle/PackageTask.java
@@ -90,7 +90,7 @@ public class PackageTask extends DefaultTask {
this.tool = new BuildTool(resolvingHelper)
- .projectArtifact(project.getGroup().toString(), project.getName(), project.getVersion().toString(),
+ .projectArtifact(this.jarTask.getGroup().toString(), this.jarTask.getBaseName(), this.jarTask.getVersion(),
getPackaging(), getProjectArtifactFile())
.mainClass(getMainClassName())
.bundleDependencies(getBundleDependencies())
|
SWARM-<I>: Gradle plugin does not package archiveTask (#<I>)
|
thorntail_thorntail
|
train
|
java
|
202113efa1487eaaaf38a34b892ed648ff6d0869
|
diff --git a/lib/chamber/version.rb b/lib/chamber/version.rb
index <HASH>..<HASH> 100644
--- a/lib/chamber/version.rb
+++ b/lib/chamber/version.rb
@@ -1,3 +1,3 @@
module Chamber
- VERSION = '2.1.7'
+ VERSION = '2.1.8'
end
|
Version Bump to <I>
|
thekompanee_chamber
|
train
|
rb
|
897e2fc721f696e0be281d5fa52f6982970697d1
|
diff --git a/src/main/java/com/kurento/ktool/rom/processor/model/Model.java b/src/main/java/com/kurento/ktool/rom/processor/model/Model.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/kurento/ktool/rom/processor/model/Model.java
+++ b/src/main/java/com/kurento/ktool/rom/processor/model/Model.java
@@ -157,6 +157,10 @@ public class Model {
this.name = name;
}
+ public String getKurentoVersion() {
+ return kurentoVersion;
+ }
+
public String getVersion() {
return version;
}
@@ -246,7 +250,6 @@ public class Model {
}
public void resolveModel(ModelManager modelManager) {
-
if (resolutionState == ResolutionState.IN_PROCESS) {
throw new KurentoRomProcessorException(
"Found a dependency cycle in plugin '" + this.name + "'");
@@ -261,6 +264,10 @@ public class Model {
this.resolutionState = ResolutionState.IN_PROCESS;
+ if (kurentoVersion == null && version != null) {
+ kurentoVersion = version;
+ }
+
resolveImports(modelManager);
resolveTypes(modelManager);
addInfoForGeneration(modelManager);
|
Set kurentoVersion as Version if it is not set
This should happen only with core project
Change-Id: I9f3d<I>aebfad<I>ff<I>d6fd9fbfa<I>c<I>f
|
Kurento_kurento-module-creator
|
train
|
java
|
917aeb7677d601a9f34a29f782cb0e6c05f26741
|
diff --git a/spinoff/util/python.py b/spinoff/util/python.py
index <HASH>..<HASH> 100644
--- a/spinoff/util/python.py
+++ b/spinoff/util/python.py
@@ -104,3 +104,11 @@ def clean_tb_twisted(tb_lines):
('twisted/python/failure.py', 'throwExceptionIntoGenerator'),
]
return clean_tb(tb_lines, excludes)
+
+
+def dump_method_call(name, args, kwargs):
+ return "%s(%s%s)" % (
+ name,
+ ", ".join(map(repr, args)),
+ "" if not kwargs else ", ".join("%s=%r" % kv for kv in kwargs.items())
+ )
|
Added the dump_method_call utility for convenient tracing of method call signatures
|
eallik_spinoff
|
train
|
py
|
632b5e0bab4c6eb89f6647cb25dbdcf049ea89c5
|
diff --git a/lib/rack/handler/reel.rb b/lib/rack/handler/reel.rb
index <HASH>..<HASH> 100644
--- a/lib/rack/handler/reel.rb
+++ b/lib/rack/handler/reel.rb
@@ -76,6 +76,7 @@ module Rack
def normalize_options(options)
options = options.inject({}) { |h, (k,v)| h[k.downcase] = v ; h }
options[:rackup] = options[:config] if options[:config]
+ options[:port] = options[:port].to_i if options[:port]
options
end
end
|
Ensure that we have fixnum port in options
|
celluloid_reel
|
train
|
rb
|
40563839fd655c876aab7068e8d56cdb6cf9564f
|
diff --git a/src/Command/Snapshot/SnapshotListCommand.php b/src/Command/Snapshot/SnapshotListCommand.php
index <HASH>..<HASH> 100644
--- a/src/Command/Snapshot/SnapshotListCommand.php
+++ b/src/Command/Snapshot/SnapshotListCommand.php
@@ -51,15 +51,16 @@ class SnapshotListCommand extends CommandBase
return 1;
}
- $headers = ['Created', '% Complete', 'Snapshot name'];
+ $headers = ['Created', 'Snapshot name', '% Complete', 'Result'];
$rows = [];
foreach ($results as $result) {
$payload = $result->payload;
$snapshot_name = !empty($payload['backup_name']) ? $payload['backup_name'] : 'N/A';
$rows[] = [
date('Y-m-d H:i:s', strtotime($result->created_at)),
- $result->getCompletionPercent(),
new AdaptiveTableCell($snapshot_name, ['wrap' => false]),
+ $result->getCompletionPercent(),
+ str_replace('Failure', '<error>Failure</error>', ucfirst($result->result)),
];
}
|
Show if a snapshot failed in snapshot:list
|
platformsh_platformsh-cli
|
train
|
php
|
de9224d1609e3cc0932e24fecfcca7b35de015a4
|
diff --git a/src/utils/clone.js b/src/utils/clone.js
index <HASH>..<HASH> 100644
--- a/src/utils/clone.js
+++ b/src/utils/clone.js
@@ -1,9 +1,23 @@
-define( function () {
+define([
+ 'utils/isArray'
+], function (
+ isArray
+) {
'use strict';
return function ( source ) {
- var target = {}, key;
+ var target, key;
+
+ if ( !source || typeof source !== 'object' ) {
+ return source;
+ }
+
+ if ( isArray( source ) ) {
+ return source.slice();
+ }
+
+ target = {};
for ( key in source ) {
if ( source.hasOwnProperty( key ) ) {
|
make clone module general-purpose
|
ractivejs_ractive
|
train
|
js
|
7e906a10ffd7d6de46b876c8625aef72daf4238f
|
diff --git a/karaage/pbsmoab/logs.py b/karaage/pbsmoab/logs.py
index <HASH>..<HASH> 100755
--- a/karaage/pbsmoab/logs.py
+++ b/karaage/pbsmoab/logs.py
@@ -113,7 +113,7 @@ def parse_logs(log_list, date, machine_name, log_type):
avail_mem_per_core = machine.mem_per_core * 1024
if data['list_pmem'] * data['cores'] > data['list_mem']:
- if data['list_pmem'] > avail_mem_per_core:
+ if data['list_pmem'] * data['cores'] > avail_mem_per_core * data['cores']:
data['cpu_usage'] = ceil(data['list_pmem']/avail_mem_per_core * data['act_wall_time'] * data['cores'])
else:
if data['list_mem'] > avail_mem_per_core * data['cores']:
|
Multiply both sides of equation by data['cores'].
No changes to algorithm.
|
Karaage-Cluster_karaage
|
train
|
py
|
e5b1467572d851afe9af1f60bdb4f98b4c5e04a9
|
diff --git a/classes/apis.php b/classes/apis.php
index <HASH>..<HASH> 100644
--- a/classes/apis.php
+++ b/classes/apis.php
@@ -473,6 +473,10 @@ class ShopgatePluginApi extends ShopgateObject implements ShopgatePluginApiInter
$responseData["currency"] = $cartData['currency'];
}
+ if (!empty($cartData['customer'])) {
+ $responseData["customer"] = $cartData['customer'];
+ }
+
$shippingMethods = array();
if (!empty($cartData['shipping_methods'])) {
foreach ($cartData["shipping_methods"] as $shippingMethod) {
|
extend the check_cart response with customer_groups
|
shopgate_cart-integration-sdk
|
train
|
php
|
dfc0cbbe77c41165cf724d9e2e80fbf661386e87
|
diff --git a/config/application.rb b/config/application.rb
index <HASH>..<HASH> 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -5,6 +5,7 @@ require 'configuration_extensions/configuration_extensions'
require 'radius'
require 'trusty_cms/extension_loader'
require 'trusty_cms/initializer'
+require 'compass'
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
@@ -18,6 +19,7 @@ module TrustyCms
include TrustyCms::Initializer
config.autoload_paths += %W(#{config.root}/lib)
+ Sass.load_paths << Compass::Frameworks['compass'].stylesheets_directory
# Enable the asset pipeline
config.assets.enabled = true
|
Modify application config so compass gets recognized
|
pgharts_trusty-cms
|
train
|
rb
|
44b1f7ca70f102881dfd34d1d5623485376c7e55
|
diff --git a/lib/zipkin-tracer/zipkin_null_tracer.rb b/lib/zipkin-tracer/zipkin_null_tracer.rb
index <HASH>..<HASH> 100644
--- a/lib/zipkin-tracer/zipkin_null_tracer.rb
+++ b/lib/zipkin-tracer/zipkin_null_tracer.rb
@@ -7,5 +7,9 @@ module Trace
span = Span.new(name, trace_id)
yield span
end
+
+ def flush!
+ # NOOP
+ end
end
end
|
Add a noop flush! in null tracer
|
openzipkin_zipkin-ruby
|
train
|
rb
|
512b6294047655f87c385487f4469de9f70edb24
|
diff --git a/lib/random_bytes.rb b/lib/random_bytes.rb
index <HASH>..<HASH> 100644
--- a/lib/random_bytes.rb
+++ b/lib/random_bytes.rb
@@ -15,7 +15,7 @@ module RandomBytes
module_function
def buf(size)
- buf = Sodium::Buffer.new(:void, size, true)
+ buf = Sodium::Buffer.new(:void, size)
randombytes_buf(buf, size)
buf
end
|
no need to initialize buf with zeros
|
Asmod4n_ruby-ffi-libsodium
|
train
|
rb
|
d4213e4b55672363313bd91a98fe878b12390667
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,7 @@ readme.close()
setup(
name='django-bootstrap-pagination',
- version='0.1.8',
+ version='0.1.9',
keywords="django bootstrap pagination templatetag",
author=u'Jason McClellan',
author_email='[email protected]',
|
Incrementing version to <I>
|
jmcclell_django-bootstrap-pagination
|
train
|
py
|
2cb8405736ca2a88954b0575a9df627fff72a1cc
|
diff --git a/src/wait-for.js b/src/wait-for.js
index <HASH>..<HASH> 100644
--- a/src/wait-for.js
+++ b/src/wait-for.js
@@ -94,7 +94,7 @@ function waitFor(
if (!usingFakeTimers) {
clearInterval(intervalId)
- setImmediate(() => observer.disconnect())
+ observer.disconnect()
}
if (error) {
|
fix: Disconnect MutationObserver synchronously in wait-for (#<I>)
* Disconnect MutationObserver synchronously in wait-for
* Revert the pre-commit change to be able to commit
* Remove legacy disconnect
|
testing-library_dom-testing-library
|
train
|
js
|
54eddf467cfb9d7c5ccd6dba001859f3c5b035c4
|
diff --git a/src/Command/GenerateCommand.php b/src/Command/GenerateCommand.php
index <HASH>..<HASH> 100644
--- a/src/Command/GenerateCommand.php
+++ b/src/Command/GenerateCommand.php
@@ -32,7 +32,8 @@ class GenerateCommand extends Command
'pattern',
'p',
InputOption::VALUE_REQUIRED,
- 'The printf pattern.'
+ 'The printf pattern.',
+ '%s'
)
->addOption(
'delimiter',
@@ -59,7 +60,7 @@ class GenerateCommand extends Command
'f',
InputOption::VALUE_REQUIRED,
'The output format (json, xml, csv, php, printf, vprintf)',
- 'vprintf'
+ 'printf'
)
->addOption(
'count',
|
Switch back to printf format with default "%s" pattern.
|
bit3archive_faker-cli
|
train
|
php
|
4c02887ceb28cddd53d45d9eaa555d76774ff79e
|
diff --git a/blockstack_zones/parse_zone_file.py b/blockstack_zones/parse_zone_file.py
index <HASH>..<HASH> 100644
--- a/blockstack_zones/parse_zone_file.py
+++ b/blockstack_zones/parse_zone_file.py
@@ -10,6 +10,7 @@ Known limitations:
'TXT', 'SRV', 'SPF', 'URI'
"""
+import os
import copy
import datetime
import time
@@ -317,8 +318,10 @@ def parse_line(parser, record_token, parsed_records):
rr, unmatched = parser.parse_known_args(record_token)
assert len(unmatched) == 0, "Unmatched fields: %s" % unmatched
except (SystemExit, AssertionError, InvalidLineException):
- import traceback
- traceback.print_exc()
+ if os.environ.get("BLOCKSTACK_DEBUG", None) == "1":
+ import traceback
+ traceback.print_exc()
+
# invalid argument
raise InvalidLineException(line)
|
don't report parse errors unless BLOCKSTACK_DEBUG is set (thanks @cryptocracy!)
|
blockstack_zone-file-py
|
train
|
py
|
294b9bc13016c6e1236305366c5ac7653edf7fdb
|
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index <HASH>..<HASH> 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -5,6 +5,6 @@
Changelog
=========
-* 1.0.0 [2016-04-23]: Final release of 1.0.0 branch
-* 1.0.0rc1 [2016-04-22]: Initial commit, forked a subset from putil PyPI
+* 1.0.0 [2016-05-01]: Final release of 1.0.0 branch
+* 1.0.0rc1 [2016-05-01]: Initial commit, forked a subset from putil PyPI
package
diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -65,7 +65,7 @@ copyright = u'2013-2016, Pablo Acosta-Serafini'
# The short X.Y version.
version = '1.0'
# The full version, including alpha/beta/rc tags.
-release = '1.0rc1'
+release = '1.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/pexdoc/version.py b/pexdoc/version.py
index <HASH>..<HASH> 100644
--- a/pexdoc/version.py
+++ b/pexdoc/version.py
@@ -7,7 +7,7 @@
###
# Global variables
###
-VERSION_INFO = (1, 0, 0, 'candidate', 1)
+VERSION_INFO = (1, 0, 0, 'final', 0)
###
|
Bumped version to <I>
|
pmacosta_pexdoc
|
train
|
rst,py,py
|
123d3041f4d0f2620f16e7286dd6e76f324e6bd7
|
diff --git a/lib/fog/connection.rb b/lib/fog/connection.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/connection.rb
+++ b/lib/fog/connection.rb
@@ -56,12 +56,11 @@ unless Fog.mocking?
if params[:body]
if params[:body].is_a?(String)
- body = StringIO.new(params[:body])
+ connection.write(params[:body])
else
- body = params[:body]
- end
- while chunk = body.read(CHUNK_SIZE)
- connection.write(chunk)
+ while chunk = params[:body].read(CHUNK_SIZE)
+ connection.write(chunk)
+ end
end
end
|
simplify connection.write when body is string
|
fog_fog
|
train
|
rb
|
6e184035ef063dba82def927f6d11292c5d20b20
|
diff --git a/src/Native5/Route/UrlInterpreter.php b/src/Native5/Route/UrlInterpreter.php
index <HASH>..<HASH> 100644
--- a/src/Native5/Route/UrlInterpreter.php
+++ b/src/Native5/Route/UrlInterpreter.php
@@ -55,7 +55,7 @@ class UrlInterpreter {
} else {
$controllerName = $commandArray[0];
}
- $controllerName = preg_replace( '/[-_](.?)/e',"strtoupper('$1')", strtolower( $controllerName) );
+ $controllerName = preg_replace( '/[-_](.?)/e',"strtoupper('$1')", $controllerName );
if($controllerName == '') {
$controllerName = 'home';
}
|
Fixed issue with case interpretation of URL's
|
native5_native5-sdk-client-php
|
train
|
php
|
4121284fcf2c05c4a349edf1ec20fbfa04269e3f
|
diff --git a/src/App.php b/src/App.php
index <HASH>..<HASH> 100644
--- a/src/App.php
+++ b/src/App.php
@@ -10,6 +10,8 @@ final class App
{
/** @var ContainerInterface */
private $container;
+ /** @var MiddlewarePipe */
+ private $pipe;
/** @var View\Manager */
private $view;
@@ -126,7 +128,7 @@ final class App
/**
* Proxies to MiddlewarePipe::pipe.
*
- * @param string $path
+ * @param string|callable $path
* @param callable $handler
*/
public function add($path, $handler = null)
diff --git a/src/Router.php b/src/Router.php
index <HASH>..<HASH> 100644
--- a/src/Router.php
+++ b/src/Router.php
@@ -17,6 +17,8 @@ final class Router
private $middleware = [];
/** @var array */
private $paramHandlers = [];
+ /** @var RelayBuilder */
+ private $relayBuilder;
public function __construct()
{
|
Don't you scrutinize me!
|
tonis-io-legacy_tonis
|
train
|
php,php
|
77520b676937bcf88997913bd77daf949ac91060
|
diff --git a/cwltool/job.py b/cwltool/job.py
index <HASH>..<HASH> 100644
--- a/cwltool/job.py
+++ b/cwltool/job.py
@@ -26,7 +26,7 @@ _logger = logging.getLogger("cwltool")
needs_shell_quoting_re = re.compile(r"""(^$|[\s|&;()<>\'"$@])""")
-FORCE_SHELLED_POPEN = os.getenv("CWLTOOL_FORCE_SHELL_POPEN", "1") == "1"
+FORCE_SHELLED_POPEN = os.getenv("CWLTOOL_FORCE_SHELL_POPEN", "0") == "1"
SHELL_COMMAND_TEMPLATE = """#!/bin/bash
python "run_job.py" "job.json"
|
Disable job script stuff by default to restore old behavior if not using job script extension.
|
common-workflow-language_cwltool
|
train
|
py
|
f89078c5aaf0a044b8d5fe86ba49a9e765f8a29c
|
diff --git a/jodd-core/src/main/java/jodd/io/ZipUtil.java b/jodd-core/src/main/java/jodd/io/ZipUtil.java
index <HASH>..<HASH> 100644
--- a/jodd-core/src/main/java/jodd/io/ZipUtil.java
+++ b/jodd-core/src/main/java/jodd/io/ZipUtil.java
@@ -227,7 +227,14 @@ public class ZipUtil {
}
}
- File file = (destDir != null) ? new File(destDir, entryName) : new File(entryName);
+ final File file = (destDir != null) ? new File(destDir, entryName) : new File(entryName);
+
+ // check for Zip slip FLAW
+ final File rootDir = destDir != null ? destDir : new File(".");
+ if (!FileUtil.isAncestor(rootDir, file, true)) {
+ throw new IOException("Unzipping");
+ }
+
if (entry.isDirectory()) {
if (!file.mkdirs()) {
if (!file.isDirectory()) {
|
Fix the Zip slip (closes #<I>)
|
oblac_jodd
|
train
|
java
|
25881e38c8b15e14933cc8fda869722d973fb6a5
|
diff --git a/lib/seed-fu/seeder.rb b/lib/seed-fu/seeder.rb
index <HASH>..<HASH> 100644
--- a/lib/seed-fu/seeder.rb
+++ b/lib/seed-fu/seeder.rb
@@ -76,7 +76,7 @@ module SeedFu
end
def find_or_initialize_record(data)
- @model_class.where(constraint_conditions(data)).first ||
+ @model_class.where(constraint_conditions(data)).take ||
@model_class.new
end
|
Remove implicit ordering when searching existing row by constraint
|
mbleigh_seed-fu
|
train
|
rb
|
3f42562de766a90f35ffa9a9efd1234814ad390c
|
diff --git a/dist/vue.js b/dist/vue.js
index <HASH>..<HASH> 100644
--- a/dist/vue.js
+++ b/dist/vue.js
@@ -83,7 +83,7 @@ function toString (val) {
}
/**
- * Convert a input value to a number for persistence.
+ * Convert an input value to a number for persistence.
* If the conversion fails, return original string.
*/
function toNumber (val) {
|
chore: fix comment typo (#<I>)
correct "a input" to "an input"
|
kaola-fed_megalo
|
train
|
js
|
3c8e758caa11abe63040058ba136a68d2b620ea3
|
diff --git a/setuptools/tests/fixtures.py b/setuptools/tests/fixtures.py
index <HASH>..<HASH> 100644
--- a/setuptools/tests/fixtures.py
+++ b/setuptools/tests/fixtures.py
@@ -6,9 +6,6 @@ import pytest
from . import contexts
-SRC_DIR = pathlib.Path(__file__).parents[2]
-
-
@pytest.fixture
def user_override(monkeypatch):
"""
@@ -32,7 +29,7 @@ def tmpdir_cwd(tmpdir):
@pytest.fixture
def src_dir():
"""The project source directory available via fixture."""
- return SRC_DIR
+ return pathlib.Path(__file__).parents[2]
@pytest.fixture
|
Avoid indirection in src_dir
|
pypa_setuptools
|
train
|
py
|
6c78a462856ef44af7272492f260769a308576bf
|
diff --git a/src/ocrmypdf/optimize.py b/src/ocrmypdf/optimize.py
index <HASH>..<HASH> 100644
--- a/src/ocrmypdf/optimize.py
+++ b/src/ocrmypdf/optimize.py
@@ -172,14 +172,6 @@ def extract_image_generic(
# jpeg_quality_estimate = 117.0 * (bytes_per_pixel ** 0.213)
# if jpeg_quality_estimate < 65:
# return None
-
- # We could get the ICC profile here, but there's no need to look at it
- # for quality transcoding
- # if icc:
- # stream = BytesIO(raw_jpeg.read_raw_bytes())
- # iccbytes = icc.read_bytes()
- # with Image.open(stream) as im:
- # im.save(jpg_name(root, xref), icc_profile=iccbytes)
try:
imgname = root / f'{xref:08d}'
with imgname.open('wb') as f:
|
optimize: remove inaccurate about ICCs
pikepdf will now get the ICC profile out and put it in the JPEG.
|
jbarlow83_OCRmyPDF
|
train
|
py
|
76fe696118a57f9b662ec52838f159482a931502
|
diff --git a/modules/components/Route.js b/modules/components/Route.js
index <HASH>..<HASH> 100644
--- a/modules/components/Route.js
+++ b/modules/components/Route.js
@@ -72,7 +72,7 @@ var Route = React.createClass({
getUnreservedProps: function (props) {
return withoutProperties(props, RESERVED_PROPS);
- },
+ }
},
|
Removed trailing comma
Trailing commas don't work in old versions of IE, and are not present
in the rest of the codebase. Removed the one that remained, which
allows Google Closure compiler to compiles this code.
|
taion_rrtr
|
train
|
js
|
601915cede0b0e64aaf55458047e2031b16d2505
|
diff --git a/wireprotocol/3_2_support.js b/wireprotocol/3_2_support.js
index <HASH>..<HASH> 100644
--- a/wireprotocol/3_2_support.js
+++ b/wireprotocol/3_2_support.js
@@ -329,6 +329,11 @@ WireProtocol.prototype.getMore = function(
queryOptions.session = cursorState.session;
}
+ // We need to increment the statement id if we're in a transaction
+ if (options.session && options.session.inTransaction()) {
+ incrementStatementId(options.session);
+ }
+
// Write out the getMore command
connection.write(query, queryOptions, queryCallback);
};
|
refactor(wire-protocol): ensure stmtId is incremented on getMore
|
mongodb_node-mongodb-native
|
train
|
js
|
74161992e1010fbf687d57cc285c2c3dd7ffa752
|
diff --git a/test/fixture/nuxt.config.js b/test/fixture/nuxt.config.js
index <HASH>..<HASH> 100644
--- a/test/fixture/nuxt.config.js
+++ b/test/fixture/nuxt.config.js
@@ -54,7 +54,5 @@ module.exports = {
method: 'GET'
}
]
- },
-
-
+ }
}
|
chore: fix lint issues
|
nuxt-community_pwa-module
|
train
|
js
|
9c2cb644964e8b523511b84b916e81d824dafe71
|
diff --git a/lib/tools/system-calls.js b/lib/tools/system-calls.js
index <HASH>..<HASH> 100644
--- a/lib/tools/system-calls.js
+++ b/lib/tools/system-calls.js
@@ -871,12 +871,12 @@ systemCallMethods.ls = async function (remotePath, opts = []) {
*/
systemCallMethods.fileSize = async function (remotePath) {
try {
- let files = await this.ls(remotePath, ['-la']);
+ const files = await this.ls(remotePath, ['-la']);
if (files.length !== 1) {
throw new Error(`Remote path is not a file`);
}
- // https://regex101.com/r/fOs4P4/6
- let match = /[rwx-]{10}[\s\d]*\s[^\s]+\s+[^\s]+\s+(\d+)/.exec(files[0]);
+ // https://regex101.com/r/fOs4P4/8
+ const match = /[rwxsStT\-\+]{10}[\s\d]*\s[^\s]+\s+[^\s]+\s+(\d+)/.exec(files[0]);
if (!match || _.isNaN(parseInt(match[1], 10))) {
throw new Error(`Unable to parse size from list output: '${files[0]}'`);
}
|
Fix the list of acceptable chars in permissions string (#<I>)
|
appium_appium-adb
|
train
|
js
|
836cae0e9be4035c16b17430f6d4273e68f5d518
|
diff --git a/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/rest/OrientDBHttpAPIResource.java b/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/rest/OrientDBHttpAPIResource.java
index <HASH>..<HASH> 100644
--- a/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/rest/OrientDBHttpAPIResource.java
+++ b/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/rest/OrientDBHttpAPIResource.java
@@ -85,7 +85,7 @@ public class OrientDBHttpAPIResource extends AbstractResource
}
if(sb.charAt(sb.length()-1)=='/')sb.setLength(sb.length()-1);
String queryString = request.getUrl().getQueryString();
- if(!Strings.isEmpty(queryString)) sb.append('?').append(queryString);
+ if(!Strings.isEmpty(queryString)) sb.append(queryString);
final String url = sb.toString();
final StringWriter sw = new StringWriter();
|
Remove extra ? in url to orientdb http API
|
OrienteerBAP_wicket-orientdb
|
train
|
java
|
b1525325a55268512863c76cec1c461075c792df
|
diff --git a/cwltool/draft2tool.py b/cwltool/draft2tool.py
index <HASH>..<HASH> 100644
--- a/cwltool/draft2tool.py
+++ b/cwltool/draft2tool.py
@@ -372,9 +372,9 @@ class CommandLineTool(Process):
"writable": t.get("writable")
}
else:
- if t["entryname"] or t["writable"]:
+ if t.get("entryname") or t.get("writable"):
t = copy.deepcopy(t)
- if t["entryname"]:
+ if t.get("entryname"):
t["entry"]["basename"] = t["entryname"]
t["entry"]["writable"] = t.get("writable")
ls[i] = t["entry"]
|
Fix entryname and writable
In InitialWorkDirRequirement section
if listing is set as Expression that
returns list of objects like
[
{
"entry": inputs.input_name
}
]
where input_name is File, cwltool
shouldn't fail trying to get
"entryname" or "writable" fields
from the Dict.
|
common-workflow-language_cwltool
|
train
|
py
|
4be983dbf42b019930449af1a3c46f76aa40781a
|
diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -1133,7 +1133,7 @@ function handleWSMessage(opts, data, flags) {
if (_data.is_private) {
if (client.directMessages[channelID]) return;
- client.directMessages[channelID] = new DMChannel(DMTranslator, _data);
+ client.directMessages[channelID] = new DMChannel(client._uIDToDM, _data);
return emit(client, message, client.directMessages[channelID]);
} else {
if (client.channels[channelID]) return;
@@ -1148,7 +1148,7 @@ function handleWSMessage(opts, data, flags) {
if (_data.is_private === true) {
emit(client, message, client.directMessages[_data.id]);
delete client.directMessages[_data.id];
- return delete DMTranslator[_data.recipient.id];
+ return delete client._uIDToDM[_data.recipient.id];
}
emit(client, message, client.servers[_data.guild_id].channels[_data.id]);
delete client.servers[_data.guild_id].channels[_data.id];
|
Fix crashes on creation/deletion of DMChannels
|
izy521_discord.io
|
train
|
js
|
a31c1902f1d8bde9c36091cab5fd0eebe4ce4628
|
diff --git a/lib/fog/aws/models/storage/file.rb b/lib/fog/aws/models/storage/file.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/aws/models/storage/file.rb
+++ b/lib/fog/aws/models/storage/file.rb
@@ -76,6 +76,9 @@ module Fog
if @acl
options['x-amz-acl'] ||= @acl
end
+ if content_type
+ options['Content-Type'] = content_type
+ end
data = connection.put_object(directory.key, @key, @body, options)
@etag = data.headers['ETag']
true
diff --git a/lib/fog/google/models/storage/file.rb b/lib/fog/google/models/storage/file.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/google/models/storage/file.rb
+++ b/lib/fog/google/models/storage/file.rb
@@ -79,6 +79,9 @@ module Fog
if @acl
options['x-amz-acl'] ||= @acl
end
+ if content_type
+ options['Content-Type'] = content_type
+ end
data = connection.put_object(directory.key, @key, @body, options)
@etag = data.headers['ETag']
true
|
[aws|storage] pass content_type through model correctly
|
fog_fog
|
train
|
rb,rb
|
a0f826127d115360b17ac73f39cfe1e569db731f
|
diff --git a/addon/components/sl-date-time.js b/addon/components/sl-date-time.js
index <HASH>..<HASH> 100755
--- a/addon/components/sl-date-time.js
+++ b/addon/components/sl-date-time.js
@@ -62,9 +62,11 @@ export default Ember.Component.extend( TooltipEnabled, {
switch ( this.get( 'format' ) ) {
case 'date':
formattedString = momentValue.format( 'YYYY-MM-DD' );
+ break;
case 'relative':
formattedString = momentValue.fromNow();
+ break;
default:
case 'datetime':
|
Add "break" that should have been added in prior refactor
|
softlayer_sl-ember-components
|
train
|
js
|
84f551137556a56ff4d11c6d159a98c1a5fb1d28
|
diff --git a/w1thermsensor/cli.py b/w1thermsensor/cli.py
index <HASH>..<HASH> 100644
--- a/w1thermsensor/cli.py
+++ b/w1thermsensor/cli.py
@@ -10,8 +10,6 @@ from itertools import count
from .core import W1ThermSensor
-W1ThermSensor.BASE_DIRECTORY = "test/mockedsensors"
-
def resolve_type_name(ctx, param, value): # pylint: disable=unused-argument
"""Resolve CLI option type name"""
|
Remove mocked sensor from cli
|
timofurrer_w1thermsensor
|
train
|
py
|
e03ad0d52f5300b38a8eeef7882ef7110c985587
|
diff --git a/src/Server.php b/src/Server.php
index <HASH>..<HASH> 100644
--- a/src/Server.php
+++ b/src/Server.php
@@ -48,10 +48,12 @@ class Server implements EmitterAwareInterface
/**
* New server instance
+ *
+ * @param string $pathToPrivateKey
*/
- public function __construct()
+ public function __construct($pathToPrivateKey)
{
- $this->setDefaultResponseType(new BearerTokenResponse());
+ $this->setDefaultResponseType(new BearerTokenResponse($pathToPrivateKey));
$this->setDefaultAccessTokenTTL(new DateInterval('PT01H')); // default token TTL of 1 hour
}
@@ -89,7 +91,7 @@ class Server implements EmitterAwareInterface
* Enable a grant type on the server
*
* @param \League\OAuth2\Server\Grant\GrantTypeInterface $grantType
- * @param ResponseTypeInterface $responseType
+ * @param ResponseTypeInterface $responseType
* @param DateInterval $accessTokenTTL
*/
public function enableGrantType(
|
Server constructor expects path to private key
|
thephpleague_oauth2-server
|
train
|
php
|
7f8a17c0b054c81fe7f264d4204df025cd812b9f
|
diff --git a/src/Behat/Testwork/Tester/Result/TestResults.php b/src/Behat/Testwork/Tester/Result/TestResults.php
index <HASH>..<HASH> 100644
--- a/src/Behat/Testwork/Tester/Result/TestResults.php
+++ b/src/Behat/Testwork/Tester/Result/TestResults.php
@@ -12,7 +12,6 @@ namespace Behat\Testwork\Tester\Result;
use ArrayIterator;
use Countable;
-use Iterator;
use IteratorAggregate;
/**
|
TestResults does not need Iterator
|
Behat_Behat
|
train
|
php
|
f0c96c1e1eca6c04257bcc45f208df808a53cc6b
|
diff --git a/extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/user/UserVerificationService.java b/extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/user/UserVerificationService.java
index <HASH>..<HASH> 100644
--- a/extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/user/UserVerificationService.java
+++ b/extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/user/UserVerificationService.java
@@ -271,7 +271,8 @@ public class UserVerificationService {
// Get generator based on user's key and provided configuration
TOTPGenerator totp = new TOTPGenerator(key.getSecret(),
- confService.getMode(), confService.getDigits());
+ confService.getMode(), confService.getDigits(),
+ TOTPGenerator.DEFAULT_START_TIME, confService.getPeriod());
// Verify provided TOTP against value produced by generator
if ((code.equals(totp.generate()) || code.equals(totp.previous()))
|
GUACAMOLE-<I>: Take configured "totp-period" into account when generating tokens.
|
glyptodon_guacamole-client
|
train
|
java
|
695e568f24df284e7a10d14d34606277f7073034
|
diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py
index <HASH>..<HASH> 100644
--- a/pandas/core/indexes/base.py
+++ b/pandas/core/indexes/base.py
@@ -220,7 +220,7 @@ class Index(IndexOpsMixin, PandasObject):
_typ = "index"
_data: Union[ExtensionArray, np.ndarray]
- _id: _Identity
+ _id: Optional[_Identity] = None
_name: Label = None
# MultiIndex.levels previously allowed setting the index name. We
# don't allow this anymore, and raise if it happens rather than
@@ -541,10 +541,14 @@ class Index(IndexOpsMixin, PandasObject):
--------
Index.identical : Works like ``Index.is_`` but also checks metadata.
"""
- try:
- return self._id is other._id
- except AttributeError:
+ if self is other:
+ return True
+ elif not hasattr(other, "_id"):
return False
+ elif com.any_none(self._id, other._id):
+ return False
+ else:
+ return self._id is other._id
def _reset_identity(self) -> None:
"""
|
BUG: Index._id (#<I>)
|
pandas-dev_pandas
|
train
|
py
|
fab6a899d8443ead2d39827b630b40cb87ce3ad2
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -120,7 +120,8 @@ function gatherReferences(file, project) {
var cache = {};
var filePath = file.filePath();
var directory = file.directory;
- var ast = file.namespace('mdast').ast;
+ var space = file.namespace('mdast');
+ var ast = space.tree || space.ast;
var getDefinition;
var prefix = '';
@@ -300,7 +301,8 @@ function gatherExposedFactory() {
*/
function gather(file) {
var filePath = file.filePath();
- var ast = file.namespace('mdast').ast;
+ var space = file.namespace('mdast');
+ var ast = space.tree || space.ast;
/*
* Ignore files without AST or filename.
|
Add support for future changes in unified
|
remarkjs_remark-validate-links
|
train
|
js
|
2cc2904bec4a56c2966d8c94cec372e917af270a
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -396,7 +396,7 @@ var Umzug = module.exports = redefine.Class(/** @lends Umzug.prototype */ {
},
/**
- * Loads all migrations.
+ * Loads all migrations in ascending order.
*
* @returns {Promise.<Migration[]>}
* @private
@@ -413,6 +413,17 @@ var Umzug = module.exports = redefine.Class(/** @lends Umzug.prototype */ {
})
.map(function (path) {
return new Migration(path, this.options);
+ })
+ .then(function (migrations) {
+ return migrations.sort(function (a, b) {
+ if (a.file > b.file) {
+ return 1;
+ } else if (a.file < b.file) {
+ return -1;
+ } else {
+ return 0;
+ }
+ });
});
},
|
Move sort from `pending` to `_findMigrations`
|
sequelize_umzug
|
train
|
js
|
42a05c1df51d2aebcc516226a6a3d709c108ec7a
|
diff --git a/gulp/tasks/watch.js b/gulp/tasks/watch.js
index <HASH>..<HASH> 100644
--- a/gulp/tasks/watch.js
+++ b/gulp/tasks/watch.js
@@ -17,6 +17,7 @@ export default function(gulp, plugins, args, config, taskTarget, browserSync) {
if (!args.production) {
// Styles
gulp.watch([
+ path.join('*.{scss,sass}'),
path.join(dirs.source, dirs.styles, '**/*.{scss,sass}'),
path.join(dirs.source, dirs.modules, '**/*.{scss,sass}')
])
|
Gulp now also watches the main plugin files
|
Dan503_mq-scss
|
train
|
js
|
7ca6c09c4428c9b8a07d66562cb0a758a69f064c
|
diff --git a/packages/insomnia-smoke-test/core/app.test.js b/packages/insomnia-smoke-test/core/app.test.js
index <HASH>..<HASH> 100644
--- a/packages/insomnia-smoke-test/core/app.test.js
+++ b/packages/insomnia-smoke-test/core/app.test.js
@@ -123,7 +123,7 @@ describe('Application launch', function() {
await expect(pdfCanvas.isExisting()).resolves.toBe(true);
});
- xit('shows deploy to portal for design documents', async () => {
+ it('shows deploy to portal for design documents', async () => {
await client.correctlyLaunched(app);
await onboarding.skipOnboardingFlow(app);
@@ -136,7 +136,7 @@ describe('Application launch', function() {
await home.openDocumentMenuDropdown(card);
// Click the "Deploy to Portal" button, installed from that plugin
- await dropdown.clickDropdownItemByText(card, 'Deploy to Portal');
+ await dropdown.clickOpenDropdownItemByText(app, 'Deploy to Portal');
// Ensure a modal opens, then close it - the rest is plugin behavior
await modal.waitUntilOpened(app, { title: 'Deploy to Portal' });
|
Deploy to portal smoke test works again (#<I>)
|
getinsomnia_insomnia
|
train
|
js
|
605c92ba362d21722099fb8429ca47a05001ceb9
|
diff --git a/lib/js/scope.js b/lib/js/scope.js
index <HASH>..<HASH> 100644
--- a/lib/js/scope.js
+++ b/lib/js/scope.js
@@ -119,12 +119,15 @@ function process(ast, scope){
var isVariableInit = isVariableDeclarator && parent.init === token;
var isLeftOfAssignment = isAssignmentExpression && parent.left === token && parent.operator !== '=';
var isRightOfAssignment = isAssignmentExpression && parent.right === token;
+ // is it for..in variable? (mark its name as used)
+ var declarationParent = this.top(3);
+ var isVarInForIn = isVariableDeclarator && declarationParent && declarationParent.type === 'ForInStatement';
if (isFunctionName || isLabel ||
!isObjectKey && !isObjectValue &&
!isMemberExpressionProperty && !isMemberExpressionObject &&
!isLeftOfAssignment && !isRightOfAssignment &&
- !isVariableInit)
+ !isVariableInit && !isVarInForIn)
return;
}
|
js/scope: mark for..in var name as used
|
basisjs_basisjs-tools-ast
|
train
|
js
|
dc3806c672ab8cd4ec0e03add1cf138c69cfd444
|
diff --git a/tools/profiling/microbenchmarks/bm_json.py b/tools/profiling/microbenchmarks/bm_json.py
index <HASH>..<HASH> 100644
--- a/tools/profiling/microbenchmarks/bm_json.py
+++ b/tools/profiling/microbenchmarks/bm_json.py
@@ -203,4 +203,5 @@ def expand_json(js, js2 = None):
row['real_time'] = bm2['real_time']
row['iterations'] = bm2['iterations']
bm2['already_used'] = True
+ break
yield row
|
Fix a noise creating bug in bm_json (for bm_diff)
|
grpc_grpc
|
train
|
py
|
901b873268a283a479c5ae7d69cc7c86ecff3377
|
diff --git a/core/file-tree/index.js b/core/file-tree/index.js
index <HASH>..<HASH> 100644
--- a/core/file-tree/index.js
+++ b/core/file-tree/index.js
@@ -65,7 +65,7 @@ function fileTree(dir) {
var urlToFile = dir + '/' + targetFile,
baseName = path.basename(dir);
- urlToFile = path.normalize(urlToFile);
+ urlToFile = path.normalize(urlToFile).replace(/\\/g, '/');
var urlFromHostRoot = urlToFile.replace('../','/');
outputJSON[baseName] = outputJSON[baseName];
@@ -156,4 +156,4 @@ module.exports.scan = function () {
GlobalWrite();
},5000);
}
-};
\ No newline at end of file
+};
|
Fix for windows environment.
Because of backslashes in windows urls to files were not created. Simple string manipulation fixed the issue.
|
sourcejs_Source
|
train
|
js
|
30bf93534ab6a7def75a9ffb72f7310203fdd613
|
diff --git a/modules/activiti-cycle/src/test/java/org/activiti/cycle/impl/connector/demo/DemoConnectorTest.java b/modules/activiti-cycle/src/test/java/org/activiti/cycle/impl/connector/demo/DemoConnectorTest.java
index <HASH>..<HASH> 100644
--- a/modules/activiti-cycle/src/test/java/org/activiti/cycle/impl/connector/demo/DemoConnectorTest.java
+++ b/modules/activiti-cycle/src/test/java/org/activiti/cycle/impl/connector/demo/DemoConnectorTest.java
@@ -101,6 +101,9 @@ public class DemoConnectorTest {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("targetName", "xxx.txt");
parameters.put("copyCount", 2);
+ parameters.put("targetFolderConnector", conn);
+ parameters.put("targetFolder", "/demo/minutes");
+
conn.executeParameterizedAction(file1.getId(), CopyArtifactAction.class.getName(), parameters);
List<RepositoryNode> nodes = DemoConnector.nodes;
|
fixed test case after refactoring form handling for artifact actions
|
Activiti_Activiti
|
train
|
java
|
ad046f6470da63798552bb83925c86890cc0e8d7
|
diff --git a/classes/phing/filters/ConcatFilter.php b/classes/phing/filters/ConcatFilter.php
index <HASH>..<HASH> 100644
--- a/classes/phing/filters/ConcatFilter.php
+++ b/classes/phing/filters/ConcatFilter.php
@@ -87,7 +87,7 @@ class ConcatFilter extends BaseParamFilterReader implements ChainableReader
* during reading
* @throws BuildException
*/
- public function read($len = 0)
+ public function read($len = null)
{
// do the "singleton" initialization
if (!$this->getInitialized()) {
|
Fixed wrong init value (#<I>)
|
phingofficial_phing
|
train
|
php
|
8abb132f8aea29561841036f8824b0bd02fbf121
|
diff --git a/src/Contracts/Hydrator/HydratesRelatedInterface.php b/src/Contracts/Hydrator/HydratesRelatedInterface.php
index <HASH>..<HASH> 100644
--- a/src/Contracts/Hydrator/HydratesRelatedInterface.php
+++ b/src/Contracts/Hydrator/HydratesRelatedInterface.php
@@ -43,7 +43,7 @@ interface HydratesRelatedInterface
* @param ResourceInterface $resource
* @param object $record
* the domain record that the resource represents
- * @return object[]
+ * @return object[]|null
* the related record(s) that were hydrated.
*/
public function hydrateRelated(ResourceInterface $resource, $record);
|
[Refactor] Allow hydrates related to return null
Some hydration of related resource do not require any related
records to be returned for persistence. As such, allow a hydrator
that implements this interface to return a void (null) result.
|
cloudcreativity_json-api
|
train
|
php
|
15fb53bfbb96d1df41bcf34e048207b3af3bf33a
|
diff --git a/h2o-core/src/main/java/water/rapids/ast/prims/mungers/AstDdply.java b/h2o-core/src/main/java/water/rapids/ast/prims/mungers/AstDdply.java
index <HASH>..<HASH> 100644
--- a/h2o-core/src/main/java/water/rapids/ast/prims/mungers/AstDdply.java
+++ b/h2o-core/src/main/java/water/rapids/ast/prims/mungers/AstDdply.java
@@ -213,6 +213,7 @@ public class AstDdply extends AstPrimitive {
_result = new double[res.numCols()];
for (int i = 0; i < res.numCols(); i++)
_result[i] = res.vec(i).at(0);
+ res.remove();
} else if (val.isNum())
_result = new double[]{val.getNum()};
else if (val.isNums())
|
Fix leak of a temporary frame in AstDdply
|
h2oai_h2o-3
|
train
|
java
|
4ed45539e964f99a55f13dbe20eb4a55b617be6b
|
diff --git a/test/utils/shared.js b/test/utils/shared.js
index <HASH>..<HASH> 100644
--- a/test/utils/shared.js
+++ b/test/utils/shared.js
@@ -4,6 +4,12 @@ var expect = chai.expect;
var utils = require('../../dist/utils/shared');
describe ('utils/shared', () => {
+ describe ('idKeys', () => {
+ it ('should split strings on a common character', () => {
+ expect(utils.idKeys('one.two.three.four')).to.be.an('Array')
+ .and.to.contain('one', 'two', 'three', 'four');
+ });
+ });
describe('keyname', () => {
it ('should not strip leading numbers by default', () => {
var result = utils.keyname('foo/01-bar.baz');
|
Add tests for new utils/shared/idKeys
|
cloudfour_drizzle-builder
|
train
|
js
|
deee1328de154183301a54741bc41dae8659c072
|
diff --git a/lib/rspec-puppet/example/function_example_group.rb b/lib/rspec-puppet/example/function_example_group.rb
index <HASH>..<HASH> 100644
--- a/lib/rspec-puppet/example/function_example_group.rb
+++ b/lib/rspec-puppet/example/function_example_group.rb
@@ -15,6 +15,8 @@ module RSpec::Puppet
# This method is used by the `run` matcher to trigger the function execution, and provides a uniform interface across all puppet versions.
def execute(*args)
+ # puppet 4 arguments are immutable
+ args.map(&:freeze)
Puppet.override(@overrides, "rspec-test scope") do
@func.call(@overrides[:global_scope], *args)
end
|
Make sure all parameters are frozen before executing a function
|
rodjek_rspec-puppet
|
train
|
rb
|
a19fd6ed6e3f35be6cfc646dd29861265981fae7
|
diff --git a/images/image.go b/images/image.go
index <HASH>..<HASH> 100644
--- a/images/image.go
+++ b/images/image.go
@@ -315,7 +315,8 @@ func Children(ctx context.Context, provider content.Provider, desc ocispec.Descr
MediaTypeDockerSchema2LayerForeign, MediaTypeDockerSchema2LayerForeignGzip,
MediaTypeDockerSchema2Config, ocispec.MediaTypeImageConfig,
ocispec.MediaTypeImageLayer, ocispec.MediaTypeImageLayerGzip,
- ocispec.MediaTypeImageLayerNonDistributable, ocispec.MediaTypeImageLayerNonDistributableGzip:
+ ocispec.MediaTypeImageLayerNonDistributable, ocispec.MediaTypeImageLayerNonDistributableGzip,
+ MediaTypeContainerd1Checkpoint, MediaTypeContainerd1CheckpointConfig:
// childless data types.
return nil, nil
default:
|
Add checkpoint media types to handler
|
containerd_containerd
|
train
|
go
|
b3d1b8e5271e51a348f3fddb9b1188e50c8869f3
|
diff --git a/core/src/main/java/com/dtolabs/rundeck/plugins/scm/ImportResult.java b/core/src/main/java/com/dtolabs/rundeck/plugins/scm/ImportResult.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/dtolabs/rundeck/plugins/scm/ImportResult.java
+++ b/core/src/main/java/com/dtolabs/rundeck/plugins/scm/ImportResult.java
@@ -20,7 +20,7 @@ public interface ImportResult {
/**
* @return imported job
*/
- JobRevReference getJob();
+ JobScmReference getJob();
/**
* @return true if a new job was created
|
import result includes previous import metadata in result job
|
rundeck_rundeck
|
train
|
java
|
a352b53f905c940c6f967d489aa3466ec22ee63e
|
diff --git a/src/providers/chartbeat/chartbeat-test.js b/src/providers/chartbeat/chartbeat-test.js
index <HASH>..<HASH> 100644
--- a/src/providers/chartbeat/chartbeat-test.js
+++ b/src/providers/chartbeat/chartbeat-test.js
@@ -26,7 +26,7 @@
expect(window.pSUPERFLY).to.exist;
expect(window._sf_async_config).to.equal(analytics.providers[0].settings);
done();
- }, 500);
+ }, 1000);
});
|
increasing timeout on chartbeat test so that it passes
|
segmentio_analytics.js-core
|
train
|
js
|
5ee7ff336ded3f14fcc69084c19bd450eca15524
|
diff --git a/src/Manager.php b/src/Manager.php
index <HASH>..<HASH> 100644
--- a/src/Manager.php
+++ b/src/Manager.php
@@ -309,7 +309,7 @@ class Manager
$functions = ['trans', 'trans_choice', 'Lang::get', 'Lang::choice', 'Lang::trans', 'Lang::transChoice', '@lang', '@choice'];
$pattern =
- // See https://regex101.com/r/jS5fX0/3
+ // See https://regex101.com/r/jS5fX0/4
'[^\w]'. // Must not start with any alphanum or _
'(?<!->)'. // Must not start with ->
'('.implode('|', $functions).')'.// Must start with one of the functions
@@ -317,7 +317,7 @@ class Manager
"[\'\"]".// Match " or '
'('.// Start a new group to match:
'[a-zA-Z0-9_-]+'.// Must start with group
- "([.][^\1)]+)+".// Be followed by one or more items/keys
+ "([.][^\1)$]+)+".// Be followed by one or more items/keys
')'.// Close group
"[\'\"]".// Closing quote
"[\),]" // Close parentheses or new parameter
|
ignore concatenated vars when syncing
|
themsaid_laravel-langman
|
train
|
php
|
130121711c3258cc5cb6123379f2b4b419851c6e
|
diff --git a/dev/run-tests.py b/dev/run-tests.py
index <HASH>..<HASH> 100755
--- a/dev/run-tests.py
+++ b/dev/run-tests.py
@@ -249,15 +249,6 @@ def get_zinc_port():
return random.randrange(3030, 4030)
-def kill_zinc_on_port(zinc_port):
- """
- Kill the Zinc process running on the given port, if one exists.
- """
- cmd = "%s -P |grep %s | grep LISTEN | awk '{ print $2; }' | xargs kill"
- lsof_exe = which("lsof")
- subprocess.check_call(cmd % (lsof_exe if lsof_exe else "/usr/sbin/lsof", zinc_port), shell=True)
-
-
def exec_maven(mvn_args=()):
"""Will call Maven in the current directory with the list of mvn_args passed
in and returns the subprocess for any further processing"""
@@ -267,7 +258,6 @@ def exec_maven(mvn_args=()):
zinc_flag = "-DzincPort=%s" % zinc_port
flags = [os.path.join(SPARK_HOME, "build", "mvn"), "--force", zinc_flag]
run_cmd(flags + mvn_args)
- kill_zinc_on_port(zinc_port)
def exec_sbt(sbt_args=()):
|
fix security issue of zinc(update run-tests.py)
|
apache_spark
|
train
|
py
|
46f63c30e30364eb04160df71056d4d34e97af21
|
diff --git a/git/cmd.py b/git/cmd.py
index <HASH>..<HASH> 100644
--- a/git/cmd.py
+++ b/git/cmd.py
@@ -4,7 +4,7 @@
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
-import os, sys
+import os, sys, platform, time
from util import *
from exc import GitCommandError
@@ -87,6 +87,11 @@ class Git(object):
"""Wait for the process and return its status code.
:raise GitCommandError: if the return status is not 0"""
+
+ #HACK: These two lines are necessary because OSX raises an error if you try to .wait() right after creating the process object.
+ # It is only necessary when using GUI frameworks to instantiate an application.
+ if platform.system().startswith("Darwin") and "pyside" in sys.modules.keys() or "PySide" in sys.modules.keys():
+ time.sleep(0.1)
status = self.proc.wait()
if status != 0:
raise GitCommandError(self.args, status, self.proc.stderr.read())
|
Hacked the wait function so that it works with pyside in OS X by using "sleep()".
|
gitpython-developers_GitPython
|
train
|
py
|
56dea6a3ca7a71215cf7aa126a84528d00bfb722
|
diff --git a/spec/support/mock_http_service.rb b/spec/support/mock_http_service.rb
index <HASH>..<HASH> 100644
--- a/spec/support/mock_http_service.rb
+++ b/spec/support/mock_http_service.rb
@@ -27,6 +27,9 @@ module Koala
SECRET = OAUTH_DATA['secret']
SUBSCRIPTION_DATA = TEST_DATA["subscription_test_data"]
+ # fix our specs to use ok_json, so we always get the same results from to_json
+ MultiJson.engine = :ok_json
+
# Loads the mock response data via ERB to substitue values for TEST_DATA (see oauth/access_token)
mock_response_file_path = File.join(File.dirname(__FILE__), '..', 'fixtures', 'mock_facebook_responses.yml')
RESPONSES = YAML.load(ERB.new(IO.read(mock_response_file_path)).result(binding))
|
Mock tests use the okjson engine to ensure consistent behavior (e.g. string formation) across environments.
|
arsduo_koala
|
train
|
rb
|
04cedea7e4c53ae5aefd27ad65a32ee5c2106db0
|
diff --git a/packages/gluestick/src/commands/autoUpgrade/updateDependencies.js b/packages/gluestick/src/commands/autoUpgrade/updateDependencies.js
index <HASH>..<HASH> 100644
--- a/packages/gluestick/src/commands/autoUpgrade/updateDependencies.js
+++ b/packages/gluestick/src/commands/autoUpgrade/updateDependencies.js
@@ -17,11 +17,13 @@ const { install: installDeps, cleanSync: cleanDeps } = require('../../lib/npmDep
const updateDependencies = (
logger: Logger, projectPackage: ProjectPackage, mismatchedModules: MismatchedModules,
) => {
- const updatedPackage: ProjectPackage = {
- dependencies: {},
- devDependencies: {},
- ...projectPackage,
- };
+ const updatedPackage: ProjectPackage = projectPackage;
+ if (!updatedPackage.dependencies) {
+ updatedPackage.dependencies = {};
+ }
+ if (!updatedPackage.devDependencies) {
+ updatedPackage.devDependencies = {};
+ }
Object.keys(mismatchedModules).forEach((dep: string): void => {
const depPackage = mismatchedModules[dep];
|
don't reorder fileds in package.json
|
TrueCar_gluestick
|
train
|
js
|
43dddcafe4bc6b013615acdac0bf54313bb648e1
|
diff --git a/aiogram/contrib/middlewares/i18n.py b/aiogram/contrib/middlewares/i18n.py
index <HASH>..<HASH> 100644
--- a/aiogram/contrib/middlewares/i18n.py
+++ b/aiogram/contrib/middlewares/i18n.py
@@ -50,7 +50,7 @@ class I18nMiddleware(BaseMiddleware):
translations = {}
for name in os.listdir(self.path):
- if not os.path.isdir(self.path):
+ if not os.path.isdir(os.path.join(self.path, name)):
continue
mo_path = os.path.join(self.path, name, 'LC_MESSAGES', self.domain + '.mo')
|
Oops. Wrong path.
|
aiogram_aiogram
|
train
|
py
|
86992971f852159956ad29f8eedde715ec4bbc89
|
diff --git a/code/model/UserDefinedForm.php b/code/model/UserDefinedForm.php
index <HASH>..<HASH> 100755
--- a/code/model/UserDefinedForm.php
+++ b/code/model/UserDefinedForm.php
@@ -280,10 +280,10 @@ class UserDefinedForm extends Page {
*
* @return ArrayList
*/
- public function FilteredEmailRecipients() {
+ public function FilteredEmailRecipients($data = null, $form = null) {
$recipients = new ArrayList($this->getComponents('EmailRecipients')->toArray());
- $this->extend('updateFilteredEmailRecipients', $recipients);
+ $this->extend('updateFilteredEmailRecipients', $recipients, $data, $form);
return $recipients;
}
@@ -964,7 +964,7 @@ JS
);
// email users on submit.
- if($this->FilteredEmailRecipients()) {
+ if($recipients = $this->FilteredEmailRecipients($data, $form)) {
$email = new UserDefinedForm_SubmittedFormEmail($submittedFields);
if($attachments){
@@ -979,7 +979,7 @@ JS
}
}
- foreach($this->FilteredEmailRecipients() as $recipient) {
+ foreach($recipients as $recipient) {
$email->populateTemplate($recipient);
$email->populateTemplate($emailData);
$email->setFrom($recipient->EmailFrom);
|
FEATURE: Add data and form arguments to Filtered Email Recipients
Most use cases for Filtered Email Recipients will probably require
using the data submitted via the user form.
|
silverstripe_silverstripe-userforms
|
train
|
php
|
c87501f9aaf91540cc6841f16f7619a4b536cb70
|
diff --git a/lib/css/base.js b/lib/css/base.js
index <HASH>..<HASH> 100644
--- a/lib/css/base.js
+++ b/lib/css/base.js
@@ -357,30 +357,23 @@
},
remove: {
- value: function (propagate) {
- if (!propagate) {
- this.detach();
- }
-
- this.forEach(function (child) {
- child.remove(true);
- });
-
- this._parent = null;
-
- Array.prototype.splice.call(this, 0);
+ value: function (recursive) {
+ if (this._parent) {
+ var index = this.index();
- return this;
- }
- },
+ if (index !== -1) {
+ this._parent.splice(index, 1);
+ this._parent = null;
+ }
+ }
- detach: {
- value: function () {
- var index = this.index();
+ if (recursive) {
+ this.forEach(function (child) {
+ child._parent = null;
+ child.remove(recursive);
+ });
- if (index !== -1) {
- Array.prototype.splice.call(this._parent, index, 1);
- this._parent = null;
+ this.splice(0);
}
return this;
|
merged 'remove' and 'detach' methods
|
stylecow_stylecow
|
train
|
js
|
3693a27ec70b77c6ac53d40543cb32826084c242
|
diff --git a/addons/info/src/components/Node.js b/addons/info/src/components/Node.js
index <HASH>..<HASH> 100644
--- a/addons/info/src/components/Node.js
+++ b/addons/info/src/components/Node.js
@@ -58,14 +58,15 @@ export default function Node(props) {
paddingRight: 3,
};
- Object.assign(containerStyle, leftPad);
+ // Keep a copy so that further mutations to containerStyle don't impact us:
+ const containerStyleCopy = Object.assign({}, containerStyle, leftPad);
const { name, text, children } = getData(node);
// Just text
if (!name) {
return (
- <div style={containerStyle}>
+ <div style={containerStyleCopy}>
<span style={tagStyle}>{text}</span>
</div>
);
@@ -74,7 +75,7 @@ export default function Node(props) {
// Single-line tag
if (!children) {
return (
- <div style={containerStyle}>
+ <div style={containerStyleCopy}>
<span style={tagStyle}><{name}</span>
<Props
node={node}
@@ -89,9 +90,6 @@ export default function Node(props) {
);
}
- // Keep a copy so that further mutations to containerStyle don't impact us:
- const containerStyleCopy = Object.assign({}, containerStyle);
-
// tag with children
return (
<div>
|
Fix storybooks/storybook#<I> - issue with react fiber and immutable props.
|
storybooks_storybook
|
train
|
js
|
bb9de101a23c29b898bf91a1f7619d807d132583
|
diff --git a/topydo/cli/TopydoCompleter.py b/topydo/cli/TopydoCompleter.py
index <HASH>..<HASH> 100644
--- a/topydo/cli/TopydoCompleter.py
+++ b/topydo/cli/TopydoCompleter.py
@@ -30,7 +30,9 @@ from topydo.lib.RelativeDate import relative_date_to_date
def _subcommands(p_word_before_cursor):
""" Generator for subcommand name completion. """
- subcommands = [sc for sc in sorted(_SUBCOMMAND_MAP.keys()) if
+ sc_map = config().aliases()
+ sc_map.update(_SUBCOMMAND_MAP)
+ subcommands = [sc for sc in sorted(sc_map.keys()) if
sc.startswith(p_word_before_cursor)]
for command in subcommands:
yield Completion(command, -len(p_word_before_cursor))
|
Add aliases into completion in prompt mode
|
bram85_topydo
|
train
|
py
|
5cad718c225fe8120b3ae39c3c470eb6c496f465
|
diff --git a/opinel/utils/aws.py b/opinel/utils/aws.py
index <HASH>..<HASH> 100644
--- a/opinel/utils/aws.py
+++ b/opinel/utils/aws.py
@@ -125,7 +125,7 @@ def handle_truncated_response(callback, params, entities):
for entity in entities:
if entity in response:
results[entity] = results[entity] + response[entity]
- for marker_name in ['NextToken', 'Marker']:
+ for marker_name in ['NextToken', 'Marker', 'PaginationToken']:
if marker_name in response and response[marker_name]:
params[marker_name] = response[marker_name]
marker_found = True
|
Add one marker value (for resourcetaggingapi)
|
nccgroup_opinel
|
train
|
py
|
9b0929582874cab3b3d18e283a841c43fd198eaf
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -4,13 +4,19 @@ import sys
import setuptools
-root_dir = pathlib.Path(__file__).parent.resolve()
+root_dir = pathlib.Path(__file__).parent
description = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)"
-long_description = (root_dir / 'README.rst').read_text(encoding='utf-8')
+# When dropping Python < 3.5, change to:
+# long_description = (root_dir / 'README.rst').read_text(encoding='utf-8')
+with (root_dir / 'README.rst').open(encoding='utf-8') as f:
+ long_description = f.read()
-exec((root_dir / 'websockets' / 'version.py').read_text(encoding='utf-8'))
+# When dropping Python < 3.5, change to:
+# exec((root_dir / 'websockets' / 'version.py').read_text(encoding='utf-8'))
+with (root_dir / 'websockets' / 'version.py').open(encoding='utf-8') as f:
+ exec(f.read())
py_version = sys.version_info[:2]
|
Adjust f<I>a4ad for compatibility with Python <I>.
|
aaugustin_websockets
|
train
|
py
|
eac0dee9d6110d340ea7df6885486b4327052d2f
|
diff --git a/pkg/ipam/node.go b/pkg/ipam/node.go
index <HASH>..<HASH> 100644
--- a/pkg/ipam/node.go
+++ b/pkg/ipam/node.go
@@ -1002,10 +1002,6 @@ func (n *Node) syncToAPIServer() (err error) {
}
for retry := 0; retry < 2; retry++ {
- if node.Spec.IPAM.Pool == nil {
- node.Spec.IPAM.Pool = ipamTypes.AllocationMap{}
- }
-
node.Spec.IPAM.Pool = pool
scopedLog.WithField("poolSize", len(node.Spec.IPAM.Pool)).Debug("Updating node in apiserver")
|
ipam: Remove superfluous if statement
The `node.Spec.IPAM.Pool` value is always overwritten after the removed
`if` statement, so there is no need to initialize it.
|
cilium_cilium
|
train
|
go
|
500b3c43bb637e1f72c4067867902d5f1ae90945
|
diff --git a/addon/components/sl-modal-header.js b/addon/components/sl-modal-header.js
index <HASH>..<HASH> 100755
--- a/addon/components/sl-modal-header.js
+++ b/addon/components/sl-modal-header.js
@@ -45,7 +45,13 @@ export default Ember.Component.extend({
ariaLabelledBy: Ember.computed(
'elementId',
function() {
- return 'modalTitle' + this.get( 'elementId' );
+ const elementId = this.get( 'elementId' );
+
+ if ( elementId ) {
+ return 'modalTitle' + elementId;
+ }
+
+ return null;
}
)
});
|
Closes softlayer/sl-ember-components#<I>
|
softlayer_sl-ember-components
|
train
|
js
|
731b344316a5a3c86148cabf9ceb9577ece4eb35
|
diff --git a/src/test/java/org/kaazing/gateway/service/http/directory/DirectoryServiceEmbeddedGWTestIT.java b/src/test/java/org/kaazing/gateway/service/http/directory/DirectoryServiceEmbeddedGWTestIT.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/kaazing/gateway/service/http/directory/DirectoryServiceEmbeddedGWTestIT.java
+++ b/src/test/java/org/kaazing/gateway/service/http/directory/DirectoryServiceEmbeddedGWTestIT.java
@@ -86,21 +86,9 @@ public class DirectoryServiceEmbeddedGWTestIT {
@Rule
public TestRule chain = outerRule(robot).around(gateway);
- @Robotic(script = "get.content.type.xsa")
- @Test(timeout = 5000)
- public void testGetContentTypeXSA() throws Exception {
- robot.join();
- }
-
@Robotic(script = "get.content.type.xsj")
@Test(timeout = 5000)
public void testGetContentTypeXSJ() throws Exception {
robot.join();
}
-
- @Robotic(script = "get.content.type.xsja")
- @Test(timeout = 5000)
- public void testGetContentTypeXSJA() throws Exception {
- robot.join();
- }
}
|
Removed bridge requests that are no longer used
|
kaazing_gateway
|
train
|
java
|
ff41b02fb6755b19f8049cf66f05e77251370f99
|
diff --git a/src/Ractive.prototype/observe.js b/src/Ractive.prototype/observe.js
index <HASH>..<HASH> 100644
--- a/src/Ractive.prototype/observe.js
+++ b/src/Ractive.prototype/observe.js
@@ -34,7 +34,7 @@
observer = new Observer( root, keypath, callback, options );
if ( !options || options.init !== false ) {
- observer.update();
+ observer.update( true );
}
registerDependant( observer );
@@ -57,13 +57,13 @@
};
Observer.prototype = {
- update: function () {
+ update: function ( init ) {
var value;
// TODO create, and use, an internal get method instead - we can skip checks
value = this.root.get( this.keypath, true );
- if ( !isEqual( value, this.value ) ) {
+ if ( !isEqual( value, this.value ) || init ) {
// wrap the callback in a try-catch block, and only throw error in
// debug mode
try {
|
force observer init for cases where initial value is undefined
|
ractivejs_ractive
|
train
|
js
|
79636c1cdbb2ef70c16118fa35a1ed9021cde90f
|
diff --git a/lib/rspreedly/subscriber.rb b/lib/rspreedly/subscriber.rb
index <HASH>..<HASH> 100644
--- a/lib/rspreedly/subscriber.rb
+++ b/lib/rspreedly/subscriber.rb
@@ -19,6 +19,7 @@ module RSpreedly
:on_trial,
:payment_method,
:ready_to_renew,
+ :ready_to_renew_since,
:recurring,
:screen_name,
:store_credit,
|
Added ready_to_renew_since to Subscriber attributes
|
rlivsey_rspreedly
|
train
|
rb
|
63a56dadd2d65d1cbc707c36bbe0014ddae7fbdf
|
diff --git a/nion/swift/DocumentController.py b/nion/swift/DocumentController.py
index <HASH>..<HASH> 100755
--- a/nion/swift/DocumentController.py
+++ b/nion/swift/DocumentController.py
@@ -780,10 +780,11 @@ class DocumentController(Window.Window):
match_items.update(display_item.data_items)
match_items.update(display_item.graphics)
computations_set = set()
- computation: typing.Optional[Symbolic.Computation] = None # for typing
for computation in document_model.computations:
if set(computation.output_items).intersection(match_items):
computations_set.add(computation)
+ if set(computation.input_items).intersection(match_items):
+ computations_set.add(computation)
computations = list(computations_set)
if len(computations) > 1:
def handle_selection(computation: typing.Optional[Symbolic.Computation]) -> None:
|
Show computations with extended display items as inputs too.
|
nion-software_nionswift
|
train
|
py
|
47cb53bd8be5aa880ddb20cca4571ad3430bd33f
|
diff --git a/domain.go b/domain.go
index <HASH>..<HASH> 100644
--- a/domain.go
+++ b/domain.go
@@ -1087,6 +1087,7 @@ type DomainGraphic struct {
type DomainVideoAccel struct {
Accel3D string `xml:"accel3d,attr,omitempty"`
+ Accel2D string `xml:"accel2d,attr,omitempty"`
}
type DomainVideoModel struct {
diff --git a/domain_test.go b/domain_test.go
index <HASH>..<HASH> 100644
--- a/domain_test.go
+++ b/domain_test.go
@@ -2868,6 +2868,7 @@ var domainTestData = []struct {
Primary: "yes",
Accel: &DomainVideoAccel{
Accel3D: "yes",
+ Accel2D: "no",
},
},
Address: &DomainAddress{
@@ -2884,7 +2885,7 @@ var domainTestData = []struct {
Expected: []string{
`<video>`,
` <model type="cirrus" heads="1" ram="4096" vram="8192" vram64="8192" vgamem="256" primary="yes">`,
- ` <acceleration accel3d="yes"></acceleration>`,
+ ` <acceleration accel3d="yes" accel2d="no"></acceleration>`,
` </model>`,
` <driver vgaconf="io"></driver>`,
` <address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x0" multifunction="on"></address>`,
|
Add accel2d attribute support for video devices
|
libvirt_libvirt-go-xml
|
train
|
go,go
|
6e5690031a750aab61ff43a93d0d8034cf69465f
|
diff --git a/lib/action_kit_api/page.rb b/lib/action_kit_api/page.rb
index <HASH>..<HASH> 100644
--- a/lib/action_kit_api/page.rb
+++ b/lib/action_kit_api/page.rb
@@ -7,8 +7,6 @@ module ActionKitApi
# class. Please refer to the ActionKit API documentation for more
# information about pages
class Page < ApiDataModel
- include Searchable
-
# Required
attr_accessor :id, :name, :title
attr_reader :type # Page type can't change
|
Made Page class unsearchable, this might have caused issues with the searchability of sub-types and the Page parent really shouldn't be used most of the time
|
Democracy-for-America_ActionKitApi
|
train
|
rb
|
fb8f3270c6d669a7cd19344385bb0da0c4c051c0
|
diff --git a/lib/maxminddb.rb b/lib/maxminddb.rb
index <HASH>..<HASH> 100644
--- a/lib/maxminddb.rb
+++ b/lib/maxminddb.rb
@@ -184,7 +184,7 @@ module MaxMindDB
return ip_or_hostname if RUBY_VERSION.to_f >= 2.4 && klass == Integer
addr = IPAddr.new(ip_or_hostname)
- addr = addr.ipv4_compat if addr.ipv4?
+ addr = addr.ipv4_mapped if addr.ipv4?
addr.to_i
end
|
Prefer the IPv4-Mapped IPv6 Address
- This form is not deprecated
- Ruby commit which deprecated the method, in <I>
<URL>
|
yhirose_maxminddb
|
train
|
rb
|
e7d9754da697cf801fa7610205c5b85e30cafc39
|
diff --git a/flask_user/user_manager__settings.py b/flask_user/user_manager__settings.py
index <HASH>..<HASH> 100644
--- a/flask_user/user_manager__settings.py
+++ b/flask_user/user_manager__settings.py
@@ -60,6 +60,7 @@ class UserManager__Settings(object):
#: The application name displayed in email templates and page template footers.
USER_APP_NAME = 'USER_APP_NAME'
+ USER_APP_VERSION = "v1.0"
USER_CORPORATION_NAME = 'MyCorp'
USER_COPYRIGHT_YEAR = 2019
|
Update user_manager__settings.py
|
lingthio_Flask-User
|
train
|
py
|
8f2b3e0f614b5ca29f779dd8346d372fb6aaf404
|
diff --git a/aws_lambda/aws_lambda.py b/aws_lambda/aws_lambda.py
index <HASH>..<HASH> 100755
--- a/aws_lambda/aws_lambda.py
+++ b/aws_lambda/aws_lambda.py
@@ -173,6 +173,9 @@ def pip_install_to_target(path):
"""
print('Gathering pip packages')
for r in pip.operations.freeze.freeze():
+ if r.startswith('Python=='):
+ # For some reason Python is coming up in pip freeze.
+ continue
pip.main(['install', r, '-t', path, '--ignore-installed'])
|
don't try to install python with Pip
|
nficano_python-lambda
|
train
|
py
|
f2dbbdd0c6306980b65d194781c8b98f19ef779d
|
diff --git a/aws/resource_aws_iot_thing_test.go b/aws/resource_aws_iot_thing_test.go
index <HASH>..<HASH> 100644
--- a/aws/resource_aws_iot_thing_test.go
+++ b/aws/resource_aws_iot_thing_test.go
@@ -19,6 +19,7 @@ func TestAccAWSIotThing_basic(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
+ ErrorCheck: testAccErrorCheck(t, iot.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSIotThingDestroy,
Steps: []resource.TestStep{
@@ -52,6 +53,7 @@ func TestAccAWSIotThing_full(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
+ ErrorCheck: testAccErrorCheck(t, iot.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSIotThingDestroy,
Steps: []resource.TestStep{
|
tests/r/iot_thing: Add ErrorCheck
|
terraform-providers_terraform-provider-aws
|
train
|
go
|
83dbbf2629619a7162d1137c879f9f685d93a8ca
|
diff --git a/src/Common/Model/Base.php b/src/Common/Model/Base.php
index <HASH>..<HASH> 100644
--- a/src/Common/Model/Base.php
+++ b/src/Common/Model/Base.php
@@ -449,7 +449,7 @@ abstract class Base
*/
public function update($iId, array $aData = []): bool
{
- $this->triggerEvent(static::EVENT_UPDATING, [&$aData, $this]);
+ $this->triggerEvent(static::EVENT_UPDATING, [&$aData, $this, $iId]);
$sAlias = $this->getTableAlias(true);
$sTable = $this->getTableName(true);
|
Pass ID to the model `EVENT_UPDATING` event
|
nails_common
|
train
|
php
|
21a4172ab6cbbdbb1f89664d51e1553f04e5b37e
|
diff --git a/ext/nio4r/org/nio4r/Selector.java b/ext/nio4r/org/nio4r/Selector.java
index <HASH>..<HASH> 100644
--- a/ext/nio4r/org/nio4r/Selector.java
+++ b/ext/nio4r/org/nio4r/Selector.java
@@ -7,6 +7,7 @@ import java.io.IOException;
import java.nio.channels.Channel;
import java.nio.channels.SelectableChannel;
import java.nio.channels.SelectionKey;
+import java.nio.channels.CancelledKeyException;
import org.jruby.Ruby;
import org.jruby.RubyArray;
@@ -207,7 +208,14 @@ public class Selector extends RubyObject {
Iterator selectedKeys = this.selector.selectedKeys().iterator();
while(selectedKeys.hasNext()) {
SelectionKey key = (SelectionKey)selectedKeys.next();
- processKey(key);
+ try {
+ processKey(key);
+ } catch(CancelledKeyException ie) {
+ continue;
+ // TODO: what to do?
+ //throw runtime.newIOError(ie.getLocalizedMessage());
+ }
+
selectedKeys.remove();
if(block.isGiven()) {
|
preventing CancelledKeyException, which randomly happens when selector selects an already closed key
|
socketry_nio4r
|
train
|
java
|
83eb320dbfb1c4353f5cd381c8704dd2145d1c57
|
diff --git a/ginga/util/plots.py b/ginga/util/plots.py
index <HASH>..<HASH> 100644
--- a/ginga/util/plots.py
+++ b/ginga/util/plots.py
@@ -342,7 +342,8 @@ class ContourPlot(Plot):
lbl.set(rotation=45, horizontalalignment='right')
# Set the pan and zoom position & redraw
- self.plot_panzoom()
+ #self.plot_panzoom()
+ self.draw()
except Exception as e:
self.logger.error("Error making contour plot: %s" % (
@@ -528,8 +529,6 @@ class SurfacePlot(Plot):
kwargs = {'axisbg': '#808080'}
self.ax = self.fig.gca(projection='3d', **kwargs)
- self.ax.set_aspect('equal', adjustable='box')
- #self.ax.cla()
self.set_titles(ytitle='Y', xtitle='X',
title='Surface Plot')
|
Fixes for recent changes to matplotlib
- fixes some plotting errors for contour and surface plots in
ginga.util.plots that cropped up with the recent matplotlib changes
|
ejeschke_ginga
|
train
|
py
|
56ffd806a017969d76ac77fe657688335103c4c9
|
diff --git a/build_tools/compiler/template_processor.rb b/build_tools/compiler/template_processor.rb
index <HASH>..<HASH> 100644
--- a/build_tools/compiler/template_processor.rb
+++ b/build_tools/compiler/template_processor.rb
@@ -9,6 +9,8 @@ module Compiler
end
def process
+ # The block supplied to render_erb is invoked every time yield is called
+ # in the template. This happens via the `binding`.
render_erb do |section = :layout|
handle_yield(section)
end
diff --git a/spec/support/uses_of_yield.rb b/spec/support/uses_of_yield.rb
index <HASH>..<HASH> 100644
--- a/spec/support/uses_of_yield.rb
+++ b/spec/support/uses_of_yield.rb
@@ -5,6 +5,8 @@ class UsesOfYieldInTemplate
def call
uses_of_yield = []
+ # The block supplied to render_erb is invoked every time yield is called in
+ # the template. This happens via the `binding`.
render_erb do |section|
uses_of_yield << section
end
|
Describe the magic block passed to ERB
|
alphagov_govuk_template
|
train
|
rb,rb
|
f0f4ad21ccab9c85686a8b513613bcee92e03d39
|
diff --git a/serf/events.go b/serf/events.go
index <HASH>..<HASH> 100644
--- a/serf/events.go
+++ b/serf/events.go
@@ -127,6 +127,7 @@ func (s *Serf) nodeJoin(n *memberlist.Node) {
Status: StatusAlive,
}
s.memberMap[n.Name] = mem
+ s.members = append(s.members, mem)
} else {
oldStatus = mem.Status
mem.Status = StatusAlive
|
Herp derp level <I>. Add member to array.
|
hashicorp_serf
|
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.