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
|
|---|---|---|---|---|---|
ca90ffd18cba1bb0347fc4cc96cf15bfdfef0a17
|
diff --git a/packages/perspective-viewer-d3fc/src/js/chartConfig.js b/packages/perspective-viewer-d3fc/src/js/chartConfig.js
index <HASH>..<HASH> 100644
--- a/packages/perspective-viewer-d3fc/src/js/chartConfig.js
+++ b/packages/perspective-viewer-d3fc/src/js/chartConfig.js
@@ -126,10 +126,10 @@ export function configureMultiSvg(isSplitBy, gridlines, barSeries, dataset, colo
.style("opacity", 0);
function configureTooltip(data) {
- let html;
- if (!isSplitBy) {
- html = groups.map((group, i) => `${group}: <b>${data.crossValue[i]}</b>`);
- }
+ let html = groups.map((group, i) => {
+ const groupValue = isSplitBy ? data.data.group[i] : data.crossValue[i];
+ return `${group}: <b>${groupValue}</b>`;
+ });
d3.select(this)
.on("mouseover", () => {
const barRect = this.getBoundingClientRect();
|
Tooltip groups now work for split by charts
|
finos_perspective
|
train
|
js
|
3f4e0dbe68925021f56398494b0ae38bb18c2aac
|
diff --git a/lib/knapsack_pro/runners/test_unit_runner.rb b/lib/knapsack_pro/runners/test_unit_runner.rb
index <HASH>..<HASH> 100644
--- a/lib/knapsack_pro/runners/test_unit_runner.rb
+++ b/lib/knapsack_pro/runners/test_unit_runner.rb
@@ -8,18 +8,20 @@ module KnapsackPro
runner = new(KnapsackPro::Adapters::TestUnitAdapter)
if runner.test_files_to_execute_exist?
- #require 'rspec/core/rake_task'
+ task_name = 'knapsack_pro:test_unit_run'
- #task_name = 'knapsack_pro:test_unit_run'
- #if Rake::Task.task_defined?(task_name)
- #Rake::Task[task_name].clear
- #end
+ if Rake::Task.task_defined?(task_name)
+ Rake::Task[task_name].clear
+ end
- #RSpec::Core::RakeTask.new(task_name) do |t|
- #t.rspec_opts = "#{args} --default-path #{runner.test_dir}"
- #t.pattern = runner.test_file_paths
- #end
- #Rake::Task[task_name].invoke
+ Rake::TestTask.new(task_name) do |t|
+ t.warning = false
+ t.libs << runner.test_dir
+ t.test_files = runner.test_file_paths
+ t.options = args
+ end
+
+ Rake::Task[task_name].invoke
end
end
end
|
[wip] try to figure out how to run test-unit
|
KnapsackPro_knapsack_pro-ruby
|
train
|
rb
|
4793dd54fc6e3b6bf26add18412c846b79224a41
|
diff --git a/sportsreference/ncaaf/roster.py b/sportsreference/ncaaf/roster.py
index <HASH>..<HASH> 100644
--- a/sportsreference/ncaaf/roster.py
+++ b/sportsreference/ncaaf/roster.py
@@ -254,7 +254,8 @@ class Player(AbstractPlayer):
"""
all_stats_dict = {}
- for table_id in ['passing', 'rushing', 'defense', 'scoring']:
+ for table_id in ['passing', 'rushing', 'defense', 'scoring',
+ 'receiving']:
table_items = utils._get_stats_table(player_info,
'table#%s' % table_id)
career_items = utils._get_stats_table(player_info,
|
Add NCAAF player receiving stats
For a handful of NCAAF players, the "Receiving & Rushing" table has an
ID of `receiving` instead of the commonly-used `rushing`. The former was
not being parsed, and the relevant stats were ignored for those players.
Simply adding that ID to the list of tables to parse resolves the issue.
|
roclark_sportsreference
|
train
|
py
|
a6ef5cf647c084fb6d8f0a4935b9005fbe4be881
|
diff --git a/pymbar/mbar.py b/pymbar/mbar.py
index <HASH>..<HASH> 100644
--- a/pymbar/mbar.py
+++ b/pymbar/mbar.py
@@ -313,12 +313,13 @@ class MBAR:
It also counts the efficiency of the sampling, which is simply the ratio
of the effective number of samples at a given state to the total number
- of samples collected.
+ of samples collected. This is printed in verbose output, but is not
+ returned for now.
Returns
-------
N_eff : np.ndarray, float, shape=(K)
- estimated number of states contributing to estimates at each
+ estimated number of samples contributing to estimates at each
state i. An estimate to how many samples collected just at state
i would result in similar statistical efficiency as the MBAR
simulation. Valid for both sampled states (in which the weight
|
Updating the documentation for effective sample number.
|
choderalab_pymbar
|
train
|
py
|
8db72b9b7118ceed5992455c6fcc9be5414a2a26
|
diff --git a/google-cloud-pubsub/acceptance/pubsub/pubsub_test.rb b/google-cloud-pubsub/acceptance/pubsub/pubsub_test.rb
index <HASH>..<HASH> 100644
--- a/google-cloud-pubsub/acceptance/pubsub/pubsub_test.rb
+++ b/google-cloud-pubsub/acceptance/pubsub/pubsub_test.rb
@@ -297,7 +297,7 @@ describe Google::Cloud::Pubsub, :pubsub do
p.add role, member
end
- topic.policy(force: true).role(role).must_include member
+ topic.policy.role(role).must_include member
end
it "allows policy to be updated on a subscription" do
|
Fix args to Topic#policy in acceptance test
Update for removal of memoization.
[refs #<I>]
|
googleapis_google-cloud-ruby
|
train
|
rb
|
c89121737f4092d3e41b3693877d1a5127fccb43
|
diff --git a/idx/cassandra/cassandra.go b/idx/cassandra/cassandra.go
index <HASH>..<HASH> 100644
--- a/idx/cassandra/cassandra.go
+++ b/idx/cassandra/cassandra.go
@@ -345,16 +345,22 @@ func (c *CasIdx) rebuildIndex() {
pre := time.Now()
gate := make(chan struct{}, c.cfg.initLoadConcurrency)
var wg sync.WaitGroup
+ defPool := sync.Pool{
+ New: func() interface{} {
+ return []schema.MetricDefinition{}
+ },
+ }
var num int
for _, partition := range cluster.Manager.GetPartitions() {
wg.Add(1)
go func(p int32) {
gate <- struct{}{}
+ defs := defPool.Get().([]schema.MetricDefinition)
defer func() {
+ defPool.Put(defs[:0])
wg.Done()
<-gate
}()
- var defs []schema.MetricDefinition
defs = c.LoadPartitions([]int32{p}, defs, pre)
num += c.MemoryIndex.LoadPartition(p, defs)
}(partition)
|
Use a pool to reuse def buffers
|
grafana_metrictank
|
train
|
go
|
19f362eb62c7d725ab78bdcb8e7d4dc447c7ee2e
|
diff --git a/views/js/qtiCreator/widgets/interactions/uploadInteraction/states/Question.js b/views/js/qtiCreator/widgets/interactions/uploadInteraction/states/Question.js
index <HASH>..<HASH> 100644
--- a/views/js/qtiCreator/widgets/interactions/uploadInteraction/states/Question.js
+++ b/views/js/qtiCreator/widgets/interactions/uploadInteraction/states/Question.js
@@ -63,11 +63,11 @@ define([
// THEN only -- Any kind of file -- is shown in the selection box.
types[0].selected = true;
} else {
- for (let i in types) {
- if (_.indexOf(preselected, types[i].mime) >= 0) {
- types[i].selected = true;
+ types.forEach(type => {
+ if (preselected.indexOf(type.mime) >= 0) {
+ type.selected = true;
}
- }
+ });
}
$form.html(
|
fix: refactor code forEach, indexOf
|
oat-sa_extension-tao-itemqti
|
train
|
js
|
5537ba9c22e143931e3062f61716d99eff9d2f11
|
diff --git a/core/modelcheckers/probsolver/src/main/java/org/overture/modelcheckers/probsolver/ProbSolverUtil.java b/core/modelcheckers/probsolver/src/main/java/org/overture/modelcheckers/probsolver/ProbSolverUtil.java
index <HASH>..<HASH> 100644
--- a/core/modelcheckers/probsolver/src/main/java/org/overture/modelcheckers/probsolver/ProbSolverUtil.java
+++ b/core/modelcheckers/probsolver/src/main/java/org/overture/modelcheckers/probsolver/ProbSolverUtil.java
@@ -387,7 +387,7 @@ public class ProbSolverUtil
}
- private IAnimator animator;
+ private static IAnimator animator;
public static void setLoggingLevel(Level level)
{
|
changed the native link to prob to static. Only one machine config is being used at the moment so we dont need to re-init the machine. Major speed improvement
|
overturetool_overture
|
train
|
java
|
e939914eb8cb43034d761ac121131d1f042881e5
|
diff --git a/src/Warp/Templating/Morpheus.php b/src/Warp/Templating/Morpheus.php
index <HASH>..<HASH> 100644
--- a/src/Warp/Templating/Morpheus.php
+++ b/src/Warp/Templating/Morpheus.php
@@ -10,7 +10,7 @@ namespace Warp\Templating;
use Warp\Utils\FileHandle;
-class Morpheus implements ITemplateEngine
+class Morpheus
{
const FILE_EXTENSION = ".morph.php";
const XML_HEADER = "<?xml version='1.0' encoding='UTF-8'?>";
|
Temporarily removed ITemplateEngine from Morpheus
|
jakejosol_warp-framework
|
train
|
php
|
663bcb9f9757f9ad2aaf0be1c5a7fbf2fad309fe
|
diff --git a/lib/delorean.rb b/lib/delorean.rb
index <HASH>..<HASH> 100644
--- a/lib/delorean.rb
+++ b/lib/delorean.rb
@@ -58,3 +58,14 @@ class << Time
alias_method :now_without_delorean, :now
def now; Delorean.now; end
end
+
+if RUBY_VERSION >= "1.9.3"
+ class << Date
+ alias_method :today_without_delorean, :today
+
+ def today(sg=Date::ITALY)
+ t = Time.now
+ Date.civil(t.year, t.mon, t.mday)
+ end
+ end
+end
|
Override Date.today in Ruby <I>+.
It was changed to use a C implementation, and replacing Time.now
doesn't change Date.today anymore.
|
bebanjo_delorean
|
train
|
rb
|
cb28eb5611cec713ebd10d2f00ee57ddc29b3e64
|
diff --git a/src/scripts/dataset/dataset.store.js b/src/scripts/dataset/dataset.store.js
index <HASH>..<HASH> 100644
--- a/src/scripts/dataset/dataset.store.js
+++ b/src/scripts/dataset/dataset.store.js
@@ -106,6 +106,9 @@ let datasetStore = Reflux.createStore({
options = options ? options : {};
options.isPublic = !userStore.data.token;
+ // set active job if passed in query param
+ if (options.appId) {this.update({activeJob: options.appId});}
+
// update selection & current upload data
this.update({selectedSnapshot: datasetId, currentUploadId: uploadStore.data.projectId});
|
Set activeJob from query param
|
OpenNeuroOrg_openneuro
|
train
|
js
|
b6a78cbe4da1f4a70bda97e78b8e34780b38d044
|
diff --git a/test/processImage.js b/test/processImage.js
index <HASH>..<HASH> 100644
--- a/test/processImage.js
+++ b/test/processImage.js
@@ -607,12 +607,17 @@ describe('express-processimage', () => {
},
}),
}));
-
+
it('should not have uncaught error when processing an image with bugos resize value', () => {
config.secondGuessSourceContentType = true;
- return expect('GET /ancillaryChunks.png?ignoreAspectRatio&resize=22239,200&crop=center', 'to yield response', {
- errorPassedToNext: /sharp: ignoreAspectRatio\(\) operation must follow resize/,
- });
+ return expect(
+ 'GET /ancillaryChunks.png?ignoreAspectRatio&resize=22239,200&crop=center',
+ 'to yield response',
+ {
+ errorPassedToNext:
+ /sharp: ignoreAspectRatio\(\) operation must follow resize/,
+ }
+ );
});
});
|
Run prettier on test/processImage.js
|
papandreou_express-processimage
|
train
|
js
|
c9d62ff57912de079fe4ed7c1527dc143c235eb9
|
diff --git a/features/support/hooks.rb b/features/support/hooks.rb
index <HASH>..<HASH> 100644
--- a/features/support/hooks.rb
+++ b/features/support/hooks.rb
@@ -1,3 +1,3 @@
Before('@slow') do
- @aruba_timeout_seconds = 15
+ @aruba_timeout_seconds = 30
end
diff --git a/lib/gauntlt/attack_adapters/support/cli_helper.rb b/lib/gauntlt/attack_adapters/support/cli_helper.rb
index <HASH>..<HASH> 100644
--- a/lib/gauntlt/attack_adapters/support/cli_helper.rb
+++ b/lib/gauntlt/attack_adapters/support/cli_helper.rb
@@ -21,5 +21,5 @@ end
World(Gauntlt::Support::CliHelper)
Before('@slow') do
- @aruba_timeout_seconds = 15
+ @aruba_timeout_seconds = 30
end
\ No newline at end of file
|
Bump @slow timeout to <I>s to get jruby to pass on travis
|
gauntlt_gauntlt
|
train
|
rb,rb
|
dad36db447a501be68d9c864791b4bd66ca89e84
|
diff --git a/packages/perspective-viewer-d3fc/src/js/d3fcChart.js b/packages/perspective-viewer-d3fc/src/js/d3fcChart.js
index <HASH>..<HASH> 100644
--- a/packages/perspective-viewer-d3fc/src/js/d3fcChart.js
+++ b/packages/perspective-viewer-d3fc/src/js/d3fcChart.js
@@ -82,6 +82,8 @@ function renderBar(config, container, horizontal, hiddenElements, update) {
.call(chart);
drawLegend(legend, container, hiddenElements);
+
+ removeCanvasElement(container);
}
// CONFIGURE CHART ELEMENTS
@@ -236,6 +238,12 @@ function drawLegend(legend, container, hiddenElements) {
}
}
+function removeCanvasElement(container) {
+ // Remove the canvas element; it's empty but blocks direct element selection on the svg viewbox.
+ let canvas = container.getElementsByTagName("d3fc-canvas")[0];
+ canvas.remove();
+}
+
// PREP DATA
function interpretLabels(config) {
let labels = {
|
delete canvas element that obstructs element-inspection-selection
|
finos_perspective
|
train
|
js
|
867d89191b5cd72ebcec128e02b6c49e4b7add8d
|
diff --git a/client/api/_add-commands.js b/client/api/_add-commands.js
index <HASH>..<HASH> 100644
--- a/client/api/_add-commands.js
+++ b/client/api/_add-commands.js
@@ -60,3 +60,4 @@ export default function _addCommands() {
.map(addId)
.forEach(addAction);
}
+
|
chore(add-commands) add "\n"
|
cloudcmd_deepword
|
train
|
js
|
cce84f61074e2e0e7a33bb36e825b9f028f8da2a
|
diff --git a/Container.php b/Container.php
index <HASH>..<HASH> 100644
--- a/Container.php
+++ b/Container.php
@@ -6,6 +6,8 @@ class Container extends \Pimple {
private $brain_modules;
+ private $brain_modules_classes = [ ];
+
private static $modules_booted = FALSE;
public static function boot( \Pimple $container, $with_modules = TRUE, $with_hooks = TRUE ) {
@@ -54,7 +56,11 @@ class Container extends \Pimple {
if ( ! $this->getModules() instanceof \SplObjectStorage ) {
throw new \DomainException;
}
- $this->getModules()->attach( $module );
+ $class = get_class( $module );
+ if ( ! in_array( $class, $this->brain_modules_classes, TRUE ) ) {
+ $this->brain_modules_classes[] = $class;
+ $this->getModules()->attach( $module );
+ }
}
public static function bootModules( Container $instance, $with_hooks = TRUE ) {
|
Avoid same module being added multiple times
Take track of module classes in the $brain_module_classes object
variable (array) to avoid same module being added multiple times
|
gmazzap_Brain
|
train
|
php
|
c2626db1d3bde4cf4c20f2dafa6c4d07e1300d4b
|
diff --git a/mozilla_django_oidc/views.py b/mozilla_django_oidc/views.py
index <HASH>..<HASH> 100644
--- a/mozilla_django_oidc/views.py
+++ b/mozilla_django_oidc/views.py
@@ -169,7 +169,7 @@ class OIDCLogoutView(View):
if logout_from_op:
logout_url = import_string(logout_from_op)()
- # Log out the Django user, only if she was actually logged in.
+ # Log out the Django user if they were logged in.
auth.logout(request)
return HttpResponseRedirect(logout_url)
|
Make comment gender neutral (#<I>)
|
mozilla_mozilla-django-oidc
|
train
|
py
|
eef6fb324c5ec3f9ac42daf5eaf143d8c87d7c2c
|
diff --git a/src/scripts/dataset/dataset.store.js b/src/scripts/dataset/dataset.store.js
index <HASH>..<HASH> 100644
--- a/src/scripts/dataset/dataset.store.js
+++ b/src/scripts/dataset/dataset.store.js
@@ -218,7 +218,7 @@ let datasetStore = Reflux.createStore({
// Metadata ----------------------------------------------------------------------
updateName(value, callback) {
- scitran.updateProject(this.data.dataset._id, {name: value}, () => {
+ scitran.updateProject(this.data.dataset._id, {label: value}, () => {
this.updateDescription('Name', value, callback);
});
},
|
Updated dataset name changing to match scitran
|
OpenNeuroOrg_openneuro
|
train
|
js
|
33b06ced6d60abac3e0342f86a1cb16fc981ab0a
|
diff --git a/tests.py b/tests.py
index <HASH>..<HASH> 100644
--- a/tests.py
+++ b/tests.py
@@ -1281,7 +1281,7 @@ class FieldTypeTests(BasePeeweeTestCase):
user_indexes = self.get_sorted_indexes(User)
if BACKEND == 'mysql':
- entry_indexes.pop(0)
+ user_indexes.pop(0)
self.assertEqual(user_indexes, [
('users_active', False),
|
Tests are now passing on both sqlite and mysql!
|
coleifer_peewee
|
train
|
py
|
fe34d214bb60b2a2224a344f03faad9510ce2cd4
|
diff --git a/src/chocolatechip/collection.js b/src/chocolatechip/collection.js
index <HASH>..<HASH> 100755
--- a/src/chocolatechip/collection.js
+++ b/src/chocolatechip/collection.js
@@ -16,15 +16,14 @@
},
unique : function() {
- if (!this.length) return [];
- var o = {}, i, l = this.length, r = [];
- for(i=0; i<l;i+=1) o[this[i]] = this[i];
- for(i in o) {
- if (o.hasOwnProperty(i)) {
- r.push(o[i]);
+ var ret = [];
+ var sort = this.sort();
+ sort.forEach(function(ctx, idx) {
+ if (ret.indexOf(ctx) === -1) {
+ ret.push(ctx);
}
- }
- return r;
+ });
+ return ret.length ? ret : [];
},
eq : function ( index ) {
|
Updated [].unique to work with nodes.
[].unique will not filter out duplicate DOM nodes from a collection.
|
chocolatechip-ui_chocolatechipui
|
train
|
js
|
b6cb27b4d844f0b0ad052185e6140b06a9d242a7
|
diff --git a/app/presenters/carnival/base_admin_presenter.rb b/app/presenters/carnival/base_admin_presenter.rb
index <HASH>..<HASH> 100644
--- a/app/presenters/carnival/base_admin_presenter.rb
+++ b/app/presenters/carnival/base_admin_presenter.rb
@@ -192,7 +192,7 @@ module Carnival
end
def table_name
- model_class.send("table_name")
+ model_class.table_name
end
def searchable_fields
|
Remove send call since the target method name is known
|
Vizir_carnival
|
train
|
rb
|
40c763194c17c178ad75689ee145323803e3f360
|
diff --git a/core/src/main/java/hudson/model/Computer.java b/core/src/main/java/hudson/model/Computer.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/hudson/model/Computer.java
+++ b/core/src/main/java/hudson/model/Computer.java
@@ -615,6 +615,8 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
*/
@Exported
public final boolean isIdle() {
+ if (!oneOffExecutors.isEmpty())
+ return false;
for (Executor e : executors)
if(!e.isIdle())
return false;
|
[HUDSON-<I>] patch from nairb<I> to check for flyweight tasks in Computer.isIdle()
git-svn-id: <URL>
|
jenkinsci_jenkins
|
train
|
java
|
937e3f4a5ecd0aa4ef90b2c51b0a68043308173c
|
diff --git a/src/main/java/org/dita/dost/invoker/Arguments.java b/src/main/java/org/dita/dost/invoker/Arguments.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/dita/dost/invoker/Arguments.java
+++ b/src/main/java/org/dita/dost/invoker/Arguments.java
@@ -88,6 +88,10 @@ abstract class Arguments {
final String os = System.getProperty("os.name");
if (os != null && os.startsWith("Windows")) {
return false;
+ } else if (System.getenv("NO_COLOR") != null) {
+ return false;
+ } else if (Objects.equals(System.getenv("TERM"), "dumb")) {
+ return false;
}
return Boolean.parseBoolean(Configuration.configuration.getOrDefault("cli.color", "true"));
}
|
Add support for disabling color in CLI using TERM or NO_COLOR
|
dita-ot_dita-ot
|
train
|
java
|
08afe8f3cbb76a7b57cda1528764440b75296a8c
|
diff --git a/eqcorrscan/utils/clustering.py b/eqcorrscan/utils/clustering.py
index <HASH>..<HASH> 100644
--- a/eqcorrscan/utils/clustering.py
+++ b/eqcorrscan/utils/clustering.py
@@ -52,8 +52,12 @@ def cross_chan_coherence(st1, st2, i=0):
if tr2:
cccoh+=normxcorr2(tr1,tr2[0].data)[0][0]
kchan+=1
- cccoh=cccoh/kchan
- return (cccoh, i)
+ if kchan:
+ cccoh=cccoh/kchan
+ return (cccoh, i)
+ else:
+ warnings.warn('No matching channels')
+ return (0, i)
def distance_matrix(stream_list, cores=1):
"""
|
Allow no matching channels in cross_chan_coherence
#Will return zero if no channels match, and raise a warning
Former-commit-id: <I>f<I>e<I>e<I>d<I>fe8c<I>c4fe<I>f
|
eqcorrscan_EQcorrscan
|
train
|
py
|
74abb27ad04dd58e5862bc07f28f2ea0b6bd5af9
|
diff --git a/src/A128KW.php b/src/A128KW.php
index <HASH>..<HASH> 100644
--- a/src/A128KW.php
+++ b/src/A128KW.php
@@ -19,8 +19,6 @@ class A128KW
/**
* @param string $kek The Key Encryption Key
- *
- * @throws \InvalidArgumentException If the size of the KEK is invalid
*/
protected static function checkKEKSize($kek)
{
|
Update A<I>KW.php
|
Spomky-Labs_aes-key-wrap
|
train
|
php
|
bc248e9a15f6abf330f32aa4a1a4a24675a953cf
|
diff --git a/tools/transpiler/gulp-traceur.js b/tools/transpiler/gulp-traceur.js
index <HASH>..<HASH> 100644
--- a/tools/transpiler/gulp-traceur.js
+++ b/tools/transpiler/gulp-traceur.js
@@ -33,6 +33,7 @@ function gulpTraceur(options, resolveModuleName) {
var sourceMap = result.sourceMap;
if (sourceMap) {
+ sourceMap.file = file.relative;
var sourceMapFile = cloneFile(file, {
path: file.path.replace(/\.\w+$/, '.map'),
contents: JSON.stringify(sourceMap)
|
fix(build) use relative path in file property inside sourcemap
|
angular_angular
|
train
|
js
|
c11116822afcdaab05ccd9f76549e9089bb44f47
|
diff --git a/examples/doh.js b/examples/doh.js
index <HASH>..<HASH> 100644
--- a/examples/doh.js
+++ b/examples/doh.js
@@ -26,12 +26,12 @@ const buf = dnsPacket.encode({
})
const options = {
- hostname: 'dns.google.com',
+ hostname: 'dns.google',
port: 443,
- path: '/experimental',
+ path: '/dns-query',
method: 'POST',
headers: {
- 'Content-Type': 'application/dns-udpwireformat',
+ 'Content-Type': 'application/dns-message',
'Content-Length': Buffer.byteLength(buf)
}
}
|
Update DoH example from internet-draft to RFC <I>. (#<I>)
|
mafintosh_dns-packet
|
train
|
js
|
0494fefe40f2df6944f3feec1bf941a00abc8e11
|
diff --git a/lib/ronin/repository.rb b/lib/ronin/repository.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/repository.rb
+++ b/lib/ronin/repository.rb
@@ -19,6 +19,9 @@
require 'ronin/exceptions/duplicate_repository'
require 'ronin/exceptions/repository_not_found'
+require 'ronin/model/has_name'
+require 'ronin/model/has_title'
+require 'ronin/model/has_description'
require 'ronin/model/has_license'
require 'ronin/model/has_authors'
require 'ronin/model'
@@ -38,6 +41,9 @@ module Ronin
class Repository
include Model
+ include Model::HasName
+ include Model::HasTitle
+ include Model::HasDescription
include Model::HasAuthors
include Model::HasLicense
include DataPaths
|
Included Model::HasName, Model::HasTitle and Model::HasDescription into Repository.
|
ronin-ruby_ronin
|
train
|
rb
|
12e7b13cf2f877001b6c9dc6512955f6e14fb6fd
|
diff --git a/pyspider/fetcher/phantomjs_fetcher.js b/pyspider/fetcher/phantomjs_fetcher.js
index <HASH>..<HASH> 100644
--- a/pyspider/fetcher/phantomjs_fetcher.js
+++ b/pyspider/fetcher/phantomjs_fetcher.js
@@ -56,7 +56,7 @@ if (system.args.length !== 2) {
page.settings.userAgent = fetch.headers['User-Agent'];
}
// this may cause memory leak: https://github.com/ariya/phantomjs/issues/12903
- page.settings.loadImages = fetch.load_images ? true : false;
+ page.settings.loadImages = fetch.load_images === undefined ? true : fetch.load_images;
page.settings.resourceTimeout = fetch.timeout ? fetch.timeout * 1000 : 120*1000;
if (fetch.headers) {
page.customHeaders = fetch.headers;
|
enable phantomjs load_image by default to prevent memleak
|
binux_pyspider
|
train
|
js
|
f38ceee677376699f29c9780e8cda70cd20e7597
|
diff --git a/question/type/multichoice/questiontype.php b/question/type/multichoice/questiontype.php
index <HASH>..<HASH> 100644
--- a/question/type/multichoice/questiontype.php
+++ b/question/type/multichoice/questiontype.php
@@ -346,12 +346,11 @@ class question_multichoice_qtype extends default_questiontype {
}
function grade_responses(&$question, &$state, $cmoptions) {
+ $state->raw_grade = 0;
if($question->options->single) {
$response = reset($state->responses);
if ($response) {
$state->raw_grade = $question->options->answers[$response]->fraction;
- } else {
- $state->raw_grade = 0;
}
} else {
foreach ($state->responses as $response) {
@@ -360,10 +359,11 @@ class question_multichoice_qtype extends default_questiontype {
}
}
}
-
+
// Make sure we don't assign negative or too high marks
$state->raw_grade = min(max((float) $state->raw_grade,
0.0), 1.0) * $question->maxgrade;
+
// Apply the penalty for this attempt
$state->penalty = $question->penalty * $question->maxgrade;
|
Fix multiple-choice multiple-answer grading code. Merged from MOODLE_<I>_STABLE.
|
moodle_moodle
|
train
|
php
|
65f4077da078f4a8515b1c91f610427c687c337d
|
diff --git a/app/controllers/devise_token_auth/sessions_controller.rb b/app/controllers/devise_token_auth/sessions_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/devise_token_auth/sessions_controller.rb
+++ b/app/controllers/devise_token_auth/sessions_controller.rb
@@ -14,10 +14,11 @@ module DeviseTokenAuth
if resource_class.case_insensitive_keys.include?(field)
q_value.downcase!
end
- q = "uid = ? AND provider='email'"
- if field != :email
- q = "#{field.to_s} = ? AND provider='email'"
+ q = "#{field.to_s} = ? AND provider='email'"
+
+ if ActiveRecord::Base.connection.adapter_name.downcase.starts_with? 'mysql'
+ q = "BINARY " + q
end
@resource = resource_class.where(q, q_value).first
|
Refactor and fix mysql error
|
lynndylanhurley_devise_token_auth
|
train
|
rb
|
09816ebdb18faaefa1f8c39849e86dd194042c2c
|
diff --git a/lib/meta/list.py b/lib/meta/list.py
index <HASH>..<HASH> 100644
--- a/lib/meta/list.py
+++ b/lib/meta/list.py
@@ -383,7 +383,7 @@ class List(memory_region.MemoryRegion):
def static_bitspan(cls, **kwargs):
declarations = kwargs.setdefault('declarations', cls.DECLARATIONS)
- if not declarations:
+ if declarations is None:
raise ListError('no static declarations to parse bitspan from')
memory_base = kwargs.setdefault('memory_base', cls.MEMORY_BASE)
|
fix declarations in static_bitspan
|
frank2_paranoia
|
train
|
py
|
10756d5f169cdd626414efecbcfe5db0926cf8ae
|
diff --git a/salt/utils/verify.py b/salt/utils/verify.py
index <HASH>..<HASH> 100644
--- a/salt/utils/verify.py
+++ b/salt/utils/verify.py
@@ -43,6 +43,7 @@ def zmq_version():
# zmq 2.1dev could be built against a newer libzmq
if "dev" in ver and not point:
log.warn('Using dev zmq module, please report unexpected results')
+ return True
elif point and point >= 9:
return True
elif major > 2 or (major == 2 and minor > 1):
|
Successfully return from the version check when using a dev copy of zmq.
|
saltstack_salt
|
train
|
py
|
8e46eb919788a7a99abd41f79c8c846115810d82
|
diff --git a/salt/utils/raetevent.py b/salt/utils/raetevent.py
index <HASH>..<HASH> 100644
--- a/salt/utils/raetevent.py
+++ b/salt/utils/raetevent.py
@@ -39,7 +39,7 @@ class SaltEvent(object):
lanename=self.node,
dirpath=self.sock_dir)
self.router_yard = yarding.Yard(
- prefix='com',
+ prefix='master',
yid=0,
dirpath=self.sock_dir)
self.stack.addRemoteYard(self.router_yard)
|
Finish killing lanemane com
|
saltstack_salt
|
train
|
py
|
33dd7afddc4052d5e939ba42b6dddec008405570
|
diff --git a/progressbar/__about__.py b/progressbar/__about__.py
index <HASH>..<HASH> 100644
--- a/progressbar/__about__.py
+++ b/progressbar/__about__.py
@@ -19,7 +19,7 @@ A Python Progressbar library to provide visual (yet text based) progress to
long running operations.
'''.strip().split())
__email__ = 'wolph@wol.ph'
-__version__ = '3.46.0'
+__version__ = '3.46.1'
__license__ = 'BSD'
__copyright__ = 'Copyright 2015 Rick van Hattem (Wolph)'
__url__ = 'https://github.com/WoLpH/python-progressbar'
|
Incrementing version to v<I>
|
WoLpH_python-progressbar
|
train
|
py
|
2ee2fd5df07322d09d442a4cfbebe87fda3676db
|
diff --git a/src/main/java/org/acra/util/HttpRequest.java b/src/main/java/org/acra/util/HttpRequest.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/acra/util/HttpRequest.java
+++ b/src/main/java/org/acra/util/HttpRequest.java
@@ -92,7 +92,9 @@ public final class HttpRequest {
final String algorithm = TrustManagerFactory.getDefaultAlgorithm();
final TrustManagerFactory tmf = TrustManagerFactory.getInstance(algorithm);
- tmf.init(config.keyStoreFactory().create(context));
+ if (config.keyStoreFactory() != null) {
+ tmf.init(config.keyStoreFactory().create(context));
+ }
final SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, tmf.getTrustManagers(), null);
|
Fixed NPE during HTTPS send when a KeyStoreFactory is not specified.
|
ACRA_acra
|
train
|
java
|
5518c2d2a84a456c432a77507ec08b2847cac32a
|
diff --git a/typelib/registry.py b/typelib/registry.py
index <HASH>..<HASH> 100644
--- a/typelib/registry.py
+++ b/typelib/registry.py
@@ -66,12 +66,17 @@ class TypeRegistry(object):
False if a type with the given fqn already exists.
"""
+ if fqn is None:
+ ipdb.set_trace()
if fqn in self.type_cache:
+ existing_type = self.type_cache[fqn]
+ if existing_type == newtype:
+ return existing_type
# ensure current one is unresolved otherwise throw an error
- if self.type_cache[fqn].is_resolved:
+ elif existing_type.is_resolved:
raise errors.DuplicateTypeException(fqn)
elif newtype is not None:
- self.type_cache[fqn].copy_from(newtype)
+ existing_type.copy_from(newtype)
else:
# Do nothing when current type is unresolved and newtype is None
# we wanted to create an unresolved type at this point anyway
|
Allowing registration of type if 'equality check' succeeds
|
panyam_typecube
|
train
|
py
|
e680a674f86fd3f8d750138521e90a4d2bed6946
|
diff --git a/app/controllers/api/v1/organizations_controller.rb b/app/controllers/api/v1/organizations_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/api/v1/organizations_controller.rb
+++ b/app/controllers/api/v1/organizations_controller.rb
@@ -54,8 +54,7 @@ class Api::V1::OrganizationsController < Api::V1::ApiController
respond :collection => Organization.without_deleting.readable.where(query_params)
end
- # DOC GENERATED AUTOMATICALLY: REMOVE THIS LINE TO PREVENT REGENARATING NEXT TIME
- api :GET, "/organizations/:id", "Show an organization"
+ api :GET, "/organizations/:label", "Show an organization"
def show
respond
end
|
Fixes #<I> - Fixes small documentation issue where organization can
only be retrieved from the API via it's label and not ID.
|
Katello_katello
|
train
|
rb
|
11fda55c382fb915ec519eab69f06b376d05c12d
|
diff --git a/lib/did_you_mean.rb b/lib/did_you_mean.rb
index <HASH>..<HASH> 100644
--- a/lib/did_you_mean.rb
+++ b/lib/did_you_mean.rb
@@ -106,7 +106,7 @@ module DidYouMean
end
# Updates the primary formatter used to format the suggestions.
- def self.formatter=(*)
+ def self.formatter=(formatter)
@formatter = formatter
end
|
Fixes bug where formatter= does not set anything
|
yuki24_did_you_mean
|
train
|
rb
|
175b55363c2c967d0e3cef87e9dd56257a3ed690
|
diff --git a/src/Traits/EventTrait.php b/src/Traits/EventTrait.php
index <HASH>..<HASH> 100644
--- a/src/Traits/EventTrait.php
+++ b/src/Traits/EventTrait.php
@@ -122,7 +122,7 @@ trait EventTrait
return;
}
- $method = $halt ? 'until' : 'fire';
+ $method = $halt ? 'until' : method_exists($dispatcher, 'fire') ? 'fire' : 'dispatch';
return $dispatcher->{$method}($event, $payload);
}
diff --git a/tests/Traits/EventTraitTest.php b/tests/Traits/EventTraitTest.php
index <HASH>..<HASH> 100644
--- a/tests/Traits/EventTraitTest.php
+++ b/tests/Traits/EventTraitTest.php
@@ -55,7 +55,8 @@ class EventTraitTest extends PHPUnit_Framework_TestCase
$dispatcher = m::mock('Illuminate\Contracts\Events\Dispatcher');
- $dispatcher->shouldReceive('fire')->once();
+ $method = method_exists($dispatcher, 'fire') ? 'fire' : 'dispatch';
+ $dispatcher->shouldReceive($method)->once();
$eventTrait->setDispatcher($dispatcher);
|
Support for Laravel <I> method fire renamed to dispatch (#7)
|
cartalyst_support
|
train
|
php,php
|
4a126ffc8e4bdc2f5f5b8fd6c929aecaf806b6fe
|
diff --git a/claripy/frontends/constrained_frontend.py b/claripy/frontends/constrained_frontend.py
index <HASH>..<HASH> 100644
--- a/claripy/frontends/constrained_frontend.py
+++ b/claripy/frontends/constrained_frontend.py
@@ -113,7 +113,7 @@ class ConstrainedFrontend(Frontend): # pylint:disable=abstract-method
if len(to_simplify) == 0:
return self.constraints
- simplified = simplify(And(*self.constraints)).split(['And']) #pylint:disable=no-member
+ simplified = simplify(And(*to_simplify)).split(['And']) #pylint:disable=no-member
self.constraints = no_simplify + simplified
return self.constraints
|
simplify only the constraints that should be simplified
|
angr_claripy
|
train
|
py
|
2926b53602a37f83725068ccb3b9699373f8c97a
|
diff --git a/ethtool.go b/ethtool.go
index <HASH>..<HASH> 100644
--- a/ethtool.go
+++ b/ethtool.go
@@ -29,6 +29,7 @@ import (
"bytes"
"encoding/hex"
"fmt"
+ "strings"
"syscall"
"unsafe"
)
@@ -473,7 +474,7 @@ func (e *Ethtool) Stats(intf string) (map[string]uint64, error) {
var result = make(map[string]uint64)
for i := 0; i != int(drvinfo.n_stats); i++ {
b := gstrings.data[i*ETH_GSTRING_LEN : i*ETH_GSTRING_LEN+ETH_GSTRING_LEN]
- key := string(bytes.Trim(b, "\x00"))
+ key := string(b[:strings.Index(string(b), "\x00")])
if len(key) != 0 {
result[key] = stats.data[i]
}
|
Fix garbled statistics names
Stats are null terminated strings, but output may contain garbage between them. Current code
that converts C strings to Go strings doesn't handle these cases, as it only trims zeros at the
end of the string.
Fix based on: <URL>
|
safchain_ethtool
|
train
|
go
|
a877180ead3ed14c0b496408c118529b2b44c5e3
|
diff --git a/lib/bootstrap_forms/form_builder.rb b/lib/bootstrap_forms/form_builder.rb
index <HASH>..<HASH> 100644
--- a/lib/bootstrap_forms/form_builder.rb
+++ b/lib/bootstrap_forms/form_builder.rb
@@ -126,7 +126,7 @@ module BootstrapForms
@field_options[:class] = 'btn btn-primary'
content_tag(:div, :class => 'form-actions') do
- super(name, *(args << @field_options)) + ' ' + button_tag(I18n.t('bootstrap_forms.buttons.cancel'), :type => 'reset', :class => 'btn cancel')
+ super(name, *(args << @field_options)) + ' ' + link_to(I18n.t('bootstrap_forms.buttons.cancel'), (@field_options[:back] || :back), :class => 'btn cancel')
end
end
|
fixing Cancel button for #<I>
|
sethvargo_bootstrap_forms
|
train
|
rb
|
f05fdf5514425dce862c7477d71b6719aa834e9f
|
diff --git a/lib/coral_core/mixin/action/node.rb b/lib/coral_core/mixin/action/node.rb
index <HASH>..<HASH> 100644
--- a/lib/coral_core/mixin/action/node.rb
+++ b/lib/coral_core/mixin/action/node.rb
@@ -68,7 +68,16 @@ module Node
# Add batch operations
nodes.each do |node|
batch.add(node.name) do
- node.run(plugin_provider, settings)
+ dbg(plugin_provider, 'action provider')
+
+ exec_config = Config.new(settings)
+ exec_config.delete(:parallel)
+ exec_config.delete(:nodes)
+ exec_config.delete(:node_provider)
+
+ dbg(exec_config, 'action config')
+
+ node.action(plugin_provider, exec_config)
code.success
end
end
@@ -76,8 +85,8 @@ module Node
# Reduce to single status
status = code.success
- batch.each do |name, code|
- if code != code.success
+ batch.each do |name, action_status|
+ if action_status != code.success
status = code.batch_error
break
end
|
Fixing some issues with the node action mixin.
|
coralnexus_corl
|
train
|
rb
|
ab47c0b26fd8ff530d1194430368d6606777fbea
|
diff --git a/core/server/worker/src/test/java/alluxio/worker/block/allocator/AllocatorFactoryTest.java b/core/server/worker/src/test/java/alluxio/worker/block/allocator/AllocatorFactoryTest.java
index <HASH>..<HASH> 100644
--- a/core/server/worker/src/test/java/alluxio/worker/block/allocator/AllocatorFactoryTest.java
+++ b/core/server/worker/src/test/java/alluxio/worker/block/allocator/AllocatorFactoryTest.java
@@ -28,7 +28,7 @@ import org.junit.rules.TemporaryFolder;
* Test {@link Allocator.Factory} by passing different allocate strategy class names with alluxio
* conf and test if it generates the correct {@link Allocator} instance.
*/
-public class AllocatorFactoryTest {
+final public class AllocatorFactoryTest {
private BlockMetadataManagerView mManagerView;
/** Rule to create a new temporary folder during each test. */
|
make the AllocatorFactoryTest class final
|
Alluxio_alluxio
|
train
|
java
|
d6e16faaf00e9373df5aa977c620aebf375d1c31
|
diff --git a/linkedin/linkedin.py b/linkedin/linkedin.py
index <HASH>..<HASH> 100644
--- a/linkedin/linkedin.py
+++ b/linkedin/linkedin.py
@@ -168,7 +168,12 @@ class LinkedInApplication(object):
def get_profile(self, member_id=None, member_url=None, selectors=None,
params=None, headers=None):
if member_id:
- url = '%s/id=%s' % (ENDPOINTS.PEOPLE, str(member_id))
+ if type(member_id) is list:
+ # Batch request, ids as CSV.
+ url = '%s::(%s)' % (ENDPOINTS.PEOPLE,
+ ','.join(member_id))
+ else:
+ url = '%s/id=%s' % (ENDPOINTS.PEOPLE, str(member_id))
elif member_url:
url = '%s/url=%s' % (ENDPOINTS.PEOPLE, urllib.quote_plus(member_url))
else:
|
extend get_profile to handle member_id as list
|
ozgur_python-linkedin
|
train
|
py
|
ee24fb50eefc2cb860d2c2fb6557ab184523c509
|
diff --git a/memote/suite/cli/runner.py b/memote/suite/cli/runner.py
index <HASH>..<HASH> 100644
--- a/memote/suite/cli/runner.py
+++ b/memote/suite/cli/runner.py
@@ -179,7 +179,6 @@ def new(directory, replay):
def _test_history(model, solver, manager, commit, pytest_args, skip):
model = callbacks.validate_model(None, "model", model)
model.solver = solver
- # TODO: This needs to be restructured to use an SQLite database.
_, result = api.test_model(
model, results=True, pytest_args=pytest_args, skip=skip)
manager.store(result, commit=commit)
|
chore: remove comment since SQL is handled now
|
opencobra_memote
|
train
|
py
|
80e0c6f8daa77850d6c60dfd800d0da789bb08d3
|
diff --git a/lib/dicom/logging.rb b/lib/dicom/logging.rb
index <HASH>..<HASH> 100644
--- a/lib/dicom/logging.rb
+++ b/lib/dicom/logging.rb
@@ -64,7 +64,11 @@ module DICOM
def method_missing(method_name, *args, &block)
if method_name.to_s =~ /(log|info|fatal|error|debug)/
- if block_given?
+ # rails use their own buffered logger which does not
+ # works with progname + block as the std logger does
+ if defined?(Rails)
+ @target.send(method_name, "DICOM: " + args.first)
+ elsif block_given?
@target.send(method_name, *args) { yield }
else
@target.send(method_name, "DICOM") { args.first }
|
Rails logger fix
Rails doesn't use std Logger and there is no support for progname
with block call:
logger.info("DICOM") {"message"}
We have to add "DICOM: " to our messages.
|
dicom_ruby-dicom
|
train
|
rb
|
84da9224856b4d49ef00b8639c009e96ecc759b9
|
diff --git a/ndio/remote/neurodata.py b/ndio/remote/neurodata.py
index <HASH>..<HASH> 100644
--- a/ndio/remote/neurodata.py
+++ b/ndio/remote/neurodata.py
@@ -754,6 +754,8 @@ class neurodata(Remote):
tmpfile.write(req.content)
tmpfile.seek(0)
h5file = h5py.File(tmpfile.name, "r")
+ if 'ANNOIDS' not in h5file:
+ return []
return [i for i in h5file['ANNOIDS']]
raise IOError("Could not successfully mock HDF5 file for parsing.")
@@ -976,9 +978,10 @@ class neurodata(Remote):
for i in r:
tmpfile = ramon.to_hdf5(i, tmpfile)
- url = self.url("{}/{}/".format(token, channel))
- files = {'file': ('ramon.hdf5', open(tmpfile.name, 'rb'))}
- res = requests.post(url, files=files)
+ url = self.url("{}/{}/overwrite".format(token, channel))
+ req = urllib2.Request(url, tmpfile.read())
+ import pdb; pdb.set_trace()
+ res = urllib2.urlopen(req)
if res.status_code == 404:
raise RemoteDataUploadError('[400] Could not upload {}'
|
Use urllib2 to handle ramon upload
|
jhuapl-boss_intern
|
train
|
py
|
b721d621acf83d614b9677c2c4168e309904f36e
|
diff --git a/lib/gcli/index.js b/lib/gcli/index.js
index <HASH>..<HASH> 100644
--- a/lib/gcli/index.js
+++ b/lib/gcli/index.js
@@ -21,10 +21,8 @@ define(function(require, exports, module) {
var Requisition = require('gcli/cli').Requisition;
- var CommandOutputListView = require('gcli/ui/command_output_view').CommandOutputListView;
var Popup = require('gcli/ui/popup').Popup;
var Inputter = require('gcli/ui/inputter').Inputter;
- var Hinter = require('gcli/ui/hinter').Hinter;
var FocusManager = require('gcli/ui/focus').FocusManager;
var ArgFetcher = require('gcli/ui/arg_fetch').ArgFetcher;
@@ -63,21 +61,6 @@ define(function(require, exports, module) {
options.inputter = new options.inputter(options);
}
- // We need to init the popup children before the Popup itself
- if (options.children == null) {
- options.children = [
- new Hinter(options),
- new CommandOutputListView(options)
- ];
- }
- else {
- for (var i = 0; i < options.children.length; i++) {
- if (typeof options.children[i] === 'function') {
- options.children[i] = new options.children[i](options);
- }
- }
- }
-
// The Popup has most dependencies
if (options.popup == null) {
options.popup = new Popup(options);
|
Bug <I> (noscroll): NON-FF Popup should create Hinter
Really Hinter isn't required - it's small and gets in the way
of simplifying styling so we can get rid of absolute positioning
|
joewalker_gcli
|
train
|
js
|
45561b5ee7189e3721ca9bb48583f09415df790e
|
diff --git a/pyxmpp2/mainloop/poll.py b/pyxmpp2/mainloop/poll.py
index <HASH>..<HASH> 100644
--- a/pyxmpp2/mainloop/poll.py
+++ b/pyxmpp2/mainloop/poll.py
@@ -63,7 +63,12 @@ class PollMainLoop(MainLoopBase):
fileno = handler.fileno()
if old_fileno is not None and fileno != old_fileno:
del self._handlers[old_fileno]
- self.poll.unregister(old_fileno)
+ try:
+ self.poll.unregister(old_fileno)
+ except KeyError:
+ # The socket has changed, but the old one isn't registered,
+ # e.g. ``prepare`` wants to connect again
+ pass
if not prepared:
self._unprepared_handlers[handler] = fileno
if not fileno:
|
fix: a socket may be unregistered when not registered
If a connection failed (e.g. network unreachable because no IPv6 access
available), the socket will change, but not the handler.
|
Jajcus_pyxmpp2
|
train
|
py
|
4a0b8f7208eef39bf513f3554f0388b8c7e93fb1
|
diff --git a/core/src/test/java/io/atomix/core/AbstractAtomixTest.java b/core/src/test/java/io/atomix/core/AbstractAtomixTest.java
index <HASH>..<HASH> 100644
--- a/core/src/test/java/io/atomix/core/AbstractAtomixTest.java
+++ b/core/src/test/java/io/atomix/core/AbstractAtomixTest.java
@@ -70,19 +70,23 @@ public abstract class AbstractAtomixTest {
.build())
.collect(Collectors.toList());
- return Atomix.builder()
+ Atomix.Builder builder = Atomix.builder()
.withClusterName("test")
.withDataDirectory(new File("target/test-logs/" + id))
.withLocalNode(localNode)
.withCoreNodes(coreNodes)
.withBootstrapNodes(bootstrapNodes)
- .addPartitionGroup(RaftPartitionGroup.builder("core")
- .withPartitionSize(3)
- .withNumPartitions(3)
- .build())
.addPartitionGroup(PrimaryBackupPartitionGroup.builder("data")
.withNumPartitions(3)
.build());
+ if (!coreNodes.isEmpty()) {
+ builder.addPartitionGroup(RaftPartitionGroup.builder("core")
+ .withPartitionSize(3)
+ .withNumPartitions(3)
+ .withDataDirectory(new File("target/test-logs/core/"))
+ .build());
+ }
+ return builder;
}
/**
|
Include data directory for Raft partition group in tests.
|
atomix_atomix
|
train
|
java
|
212a34a0c137fd0c2221367f03ca7ffcec61352f
|
diff --git a/src/metadata/MetadataProvider.js b/src/metadata/MetadataProvider.js
index <HASH>..<HASH> 100644
--- a/src/metadata/MetadataProvider.js
+++ b/src/metadata/MetadataProvider.js
@@ -66,12 +66,13 @@ export default class MetadataProvider {
static canonizeArray(obj) {
if (!obj) return obj; // this is so the canonizeSchema method doesn't have to check every property for undefined
- if (_.isArray(obj))
+ if (Array.isArray(obj))
return obj;
// let's create an array
return Object.keys(obj).map((property) => {
- if (!_.isObject(obj[property]))
+ let isObject = obj[property] && typeof obj[property] === "object";
+ if (!isObject)
throw Error('cannot generate canonical array. Every field should be an object');
return {name: property, ...obj[property]};
});
|
Refactored isArray and isObject
|
redux-autoform_redux-autoform
|
train
|
js
|
ab8ca1a2e8a09105fc9b41890d83008100f15033
|
diff --git a/trakt/client.py b/trakt/client.py
index <HASH>..<HASH> 100644
--- a/trakt/client.py
+++ b/trakt/client.py
@@ -5,6 +5,7 @@ from trakt.request import TraktRequest
import logging
import requests
+import socket
log = logging.getLogger(__name__)
@@ -49,8 +50,27 @@ class TraktClient(object):
prepared = request.prepare()
- # TODO retrying requests on 502, 503 errors
- return self._session.send(prepared)
+ # TODO retrying requests on 502, 503 errors?
+
+ try:
+ return self._session.send(prepared)
+ except socket.gaierror, e:
+ code, _ = e
+
+ if code != 8:
+ raise e
+
+ log.warn('Encountered socket.gaierror (code: 8)')
+
+ return self._rebuild().send(prepared)
+
+ def _rebuild(self):
+ log.info('Rebuilding session and connection pools...')
+
+ # Rebuild the connection pool (old pool has stale connections)
+ self._session = requests.Session()
+
+ return self._session
def __getitem__(self, path):
parts = path.strip('/').split('/')
|
Rebuild session on socket.gaierror (code: 8)
|
fuzeman_trakt.py
|
train
|
py
|
a45cfd224a1c46d2083249ffa7efc25b01176e64
|
diff --git a/homie/device.py b/homie/device.py
index <HASH>..<HASH> 100644
--- a/homie/device.py
+++ b/homie/device.py
@@ -69,7 +69,7 @@ class HomieDevice:
self.nodes = []
self.callback_topics = {}
- self.device_name = getattr(settings, "DEVICE_NAME", b"mydevice")
+ self.device_name = getattr(settings, "DEVICE_NAME", "")
# Generate unique id if settings has no DEVICE_ID
try:
|
Send empty string if device name is not set
|
microhomie_microhomie
|
train
|
py
|
bc6fe6fbcf6617612c50282fafb2ffb5d80cf880
|
diff --git a/src/transformers/models/auto/processing_auto.py b/src/transformers/models/auto/processing_auto.py
index <HASH>..<HASH> 100644
--- a/src/transformers/models/auto/processing_auto.py
+++ b/src/transformers/models/auto/processing_auto.py
@@ -38,7 +38,7 @@ logger = logging.get_logger(__name__)
PROCESSOR_MAPPING_NAMES = OrderedDict(
[
("clip", "CLIPProcessor"),
- ("flava", "FLAVAProcessor"),
+ ("flava", "FlavaProcessor"),
("groupvit", "CLIPProcessor"),
("layoutlmv2", "LayoutLMv2Processor"),
("layoutlmv3", "LayoutLMv3Processor"),
|
Change to FlavaProcessor in PROCESSOR_MAPPING_NAMES (#<I>)
|
huggingface_pytorch-pretrained-BERT
|
train
|
py
|
4203808350b31f70f7ce8fa8825c7648cd35751c
|
diff --git a/mapping/sql/r2rml/src/main/java/it/unibz/inf/ontop/spec/mapping/serializer/OBDAMappingTransformer.java b/mapping/sql/r2rml/src/main/java/it/unibz/inf/ontop/spec/mapping/serializer/OBDAMappingTransformer.java
index <HASH>..<HASH> 100644
--- a/mapping/sql/r2rml/src/main/java/it/unibz/inf/ontop/spec/mapping/serializer/OBDAMappingTransformer.java
+++ b/mapping/sql/r2rml/src/main/java/it/unibz/inf/ontop/spec/mapping/serializer/OBDAMappingTransformer.java
@@ -154,8 +154,10 @@ public class OBDAMappingTransformer {
//add object declaration to predObj node
//term 0 is always the subject, we are interested in term 1
object = func.getTerm(1);
- }
- else {
+ } else if (predURIString.equals(IriConstants.RDF_TYPE)) {
+ object = func.getTerm(1);
+
+ } else {
//add object declaration to predObj node
//term 0 is always the subject, term 1 is the predicate, we check term 2 to have the object
|
Bugfix: handling of rdfType predicate during r2rml export
|
ontop_ontop
|
train
|
java
|
596d2953b2a56ec98aaef927c667b8ed5db01941
|
diff --git a/peep.py b/peep.py
index <HASH>..<HASH> 100755
--- a/peep.py
+++ b/peep.py
@@ -55,7 +55,13 @@ activate('pip>=0.6.2') # Before 0.6.2, the log module wasn't there, so some
import pip
from pip.commands.install import InstallCommand
-from pip.download import url_to_path
+try:
+ from pip.download import url_to_path # 1.5.6
+except ImportError:
+ try:
+ from pip.util import url_to_path # 0.7.0
+ except ImportError:
+ from pip.util import url_to_filename as url_to_path # 0.6.2
from pip.index import PackageFinder, Link
from pip.log import logger
from pip.req import parse_requirements
|
Look for url_to_path() in various places for old pips.
|
erikrose_peep
|
train
|
py
|
ae7be034d63da0560bbb80a17d7e322b42270edb
|
diff --git a/vstutils/__init__.py b/vstutils/__init__.py
index <HASH>..<HASH> 100644
--- a/vstutils/__init__.py
+++ b/vstutils/__init__.py
@@ -1,2 +1,2 @@
# pylint: disable=django-not-available
-__version__: str = '5.0.4'
+__version__: str = '5.0.5'
|
Release <I>
### Changelog:
* Fix: Call `toInner` of nested model in `NestedModel` field.
|
vstconsulting_vstutils
|
train
|
py
|
54171575519222b3f63afa501f7717b5febbbf24
|
diff --git a/rules.go b/rules.go
index <HASH>..<HASH> 100644
--- a/rules.go
+++ b/rules.go
@@ -51,8 +51,6 @@ import (
// may be automatically freed, it should not be copied.
type Rules struct{ cptr *C.YR_RULES }
-var dummy *[]MatchRule
-
// A MatchRule represents a rule successfully matched against a block
// of data.
type MatchRule struct {
|
Remove unexported dummy variable that has been ununsed for some time
|
hillu_go-yara
|
train
|
go
|
0f27f19c57db2846783b108ff67e23249cb99a2c
|
diff --git a/test/best-practises-rules.js b/test/best-practises-rules.js
index <HASH>..<HASH> 100644
--- a/test/best-practises-rules.js
+++ b/test/best-practises-rules.js
@@ -15,6 +15,14 @@ describe('Linter', function() {
assert.ok(report.messages[0].message.includes('payable'));
});
+ it('should not raise warn when fallback is payable', function () {
+ const code = contractWith('function () public payable {}');
+
+ const report = linter.processStr(code, config());
+
+ assert.equal(report.warningCount, 0);
+ });
+
});
function config() {
|
<I>-implement-warning-when-fallback-is-not-payable
|
protofire_solhint
|
train
|
js
|
ece58efe8ff735545de099cad756b4ed40a11ed4
|
diff --git a/components/select/select.js b/components/select/select.js
index <HASH>..<HASH> 100644
--- a/components/select/select.js
+++ b/components/select/select.js
@@ -386,6 +386,10 @@ export default class Select extends Component {
nextState.selected = Select._getEmptyValue(multiple);
}
+ if (multiple && !nextState.selected) {
+ nextState.selected = prevState.selected;
+ }
+
const {selected} = {...prevState, ...nextState};
if (selected && multiple) {
nextState.multipleMap = buildMultipleMap(selected);
|
RG-<I> fix crash when opening select with multiple limit
|
JetBrains_ring-ui
|
train
|
js
|
cb4f5b376a925b638d36b3055e7360418c2a317a
|
diff --git a/roku/core.py b/roku/core.py
index <HASH>..<HASH> 100644
--- a/roku/core.py
+++ b/roku/core.py
@@ -28,6 +28,7 @@ COMMANDS = {
'search': 'Search',
'enter': 'Enter',
'literal': 'Lit',
+ 'power': 'Power',
}
SENSORS = ('acceleration', 'magnetic', 'orientation', 'rotation')
|
Add power to keypress commands. Closes #<I>.
|
jcarbaugh_python-roku
|
train
|
py
|
7ef3b136727f1edc784b7682db604080c1843805
|
diff --git a/xchange-poloniex/src/main/java/org/knowm/xchange/poloniex/service/polling/PoloniexMarketDataServiceRaw.java b/xchange-poloniex/src/main/java/org/knowm/xchange/poloniex/service/polling/PoloniexMarketDataServiceRaw.java
index <HASH>..<HASH> 100644
--- a/xchange-poloniex/src/main/java/org/knowm/xchange/poloniex/service/polling/PoloniexMarketDataServiceRaw.java
+++ b/xchange-poloniex/src/main/java/org/knowm/xchange/poloniex/service/polling/PoloniexMarketDataServiceRaw.java
@@ -53,8 +53,8 @@ public class PoloniexMarketDataServiceRaw extends PoloniexBasePollingService {
// lets wait a seconds and save our self a call for each ticker in our calling for loop.
private HashMap<String, PoloniexMarketData> TickermarketData;
- private final long cashe_delay = 1000L;
- private long next_refresh = System.currentTimeMillis() + cashe_delay;
+ private final long cache_delay = 1000L;
+ private long next_refresh = System.currentTimeMillis() + cache_delay;
public PoloniexTicker getPoloniexTicker(CurrencyPair currencyPair) throws IOException {
@@ -69,7 +69,7 @@ public class PoloniexMarketDataServiceRaw extends PoloniexBasePollingService {
throw new ExchangeException(e.getError(), e);
} finally {
// also nice to take a short break on an error
- next_refresh = now + cashe_delay;
+ next_refresh = now + cache_delay;
}
}
|
Fixed spelling of cache_delay.
|
knowm_XChange
|
train
|
java
|
6816aa0f2a4ce881429eeb79733ebd1319e79bd5
|
diff --git a/src/main/java/com/netflix/config/ConcurrentMapConfiguration.java b/src/main/java/com/netflix/config/ConcurrentMapConfiguration.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/netflix/config/ConcurrentMapConfiguration.java
+++ b/src/main/java/com/netflix/config/ConcurrentMapConfiguration.java
@@ -56,7 +56,7 @@ public class ConcurrentMapConfiguration extends AbstractConfiguration {
}
@Override
- protected final void addPropertyDirect(String key, Object value) {
+ protected void addPropertyDirect(String key, Object value) {
props.put(key, value);
}
|
make addPropertyDirect() non-final so that subclass can override.
|
Netflix_archaius
|
train
|
java
|
8455da46a85f92255e24959ff3ad54226f3fda96
|
diff --git a/Kwf/Controller/Action/Cli/ClearCacheController.php b/Kwf/Controller/Action/Cli/ClearCacheController.php
index <HASH>..<HASH> 100644
--- a/Kwf/Controller/Action/Cli/ClearCacheController.php
+++ b/Kwf/Controller/Action/Cli/ClearCacheController.php
@@ -16,6 +16,25 @@ class Kwf_Controller_Action_Cli_ClearCacheController extends Kwf_Controller_Acti
exit;
}
+ public function memcacheAction()
+ {
+ if (!Kwf_Cache_Simple::$memcacheHost) {
+ echo "memcache not configured for host\n";
+ exit;
+ }
+ $s = Kwf_Cache_Simple::$memcacheHost.':'.Kwf_Cache_Simple::$memcachePort;
+ echo "Clear the complete memcache on $s?\nThis will effect all other webs using this memcache host.\nAre you REALLY sure you want to do that? [N/y]\n";
+ $stdin = fopen('php://stdin', 'r');
+ $input = trim(strtolower(fgets($stdin, 2)));
+ fclose($stdin);
+ if (($input == 'y')) {
+ Kwf_Cache_Simple::getMemcache()->flush();
+ echo "done\n";
+ exit;
+ }
+ exit(1);
+ }
+
public function writeMaintenanceAction()
{
Kwf_Util_Maintenance::writeMaintenanceBootstrapSelf();
|
add clear-cache action that allows deleting the full memcache
should be used with care
|
koala-framework_koala-framework
|
train
|
php
|
c54d769f41354da7fd2953ac3d7eaea2b1ab568a
|
diff --git a/pact/pact-tests/src/test/java/eu/stratosphere/pact/test/pactPrograms/WordCountITCase.java b/pact/pact-tests/src/test/java/eu/stratosphere/pact/test/pactPrograms/WordCountITCase.java
index <HASH>..<HASH> 100644
--- a/pact/pact-tests/src/test/java/eu/stratosphere/pact/test/pactPrograms/WordCountITCase.java
+++ b/pact/pact-tests/src/test/java/eu/stratosphere/pact/test/pactPrograms/WordCountITCase.java
@@ -220,8 +220,8 @@ public class WordCountITCase extends TestBase {
compareResultsByLinesInMemory(COUNTS, resultPath);
// clean up hdfs
- // getFilesystemProvider().delete(textPath, true);
- // getFilesystemProvider().delete(resultPath, true);
+ getFilesystemProvider().delete(textPath, true);
+ getFilesystemProvider().delete(resultPath, true);
}
@Parameters
|
- Added clean up for WordCount integration test
|
apache_flink
|
train
|
java
|
f06aae38fbcd9c8c293764c6934f034b2b29bd3f
|
diff --git a/select2.js b/select2.js
index <HASH>..<HASH> 100755
--- a/select2.js
+++ b/select2.js
@@ -672,7 +672,10 @@
opts.initSelection = function (element, callback) {
var data = [];
$(splitVal(element.val(), opts.separator)).each(function () {
- data.push({id: this, text: this});
+ var id = this, text = this, tags=opts.tags;
+ if ($.isFunction(tags)) tags=tags();
+ $(tags).each(function() { if (equal(this.id, id)) { text = this.text; return false; } });
+ data.push({id: id, text: text});
});
callback(data);
|
better handling of tags that are not just strings. fixes #<I>
|
select2_select2
|
train
|
js
|
2b1fa5e1ab7e98a1a5205d7ae6aa90aee46b50dc
|
diff --git a/lib/sync/pending-processor.js b/lib/sync/pending-processor.js
index <HASH>..<HASH> 100644
--- a/lib/sync/pending-processor.js
+++ b/lib/sync/pending-processor.js
@@ -131,8 +131,8 @@ function doUpdate(datasetId, pendingChange, callback) {
if (err) {
debugError('[%s] Failed to save collision uid = %s : err = %j', datasetId, uid, err);
}
- return saveUpdate(datasetId, pendingChange, SYNC_UPDATE_TYPES.COLLISION, null, callback);
});
+ return saveUpdate(datasetId, pendingChange, SYNC_UPDATE_TYPES.COLLISION, null, callback);
}
}
});
@@ -191,8 +191,8 @@ function doDelete(datasetId, pendingChange, callback) {
if (err) {
debugError('[%s] Failed to save collision uid = %s : err = %j', datasetId, err);
}
- return saveUpdate(datasetId, pendingChange, SYNC_UPDATE_TYPES.COLLISION, null, callback);
});
+ return saveUpdate(datasetId, pendingChange, SYNC_UPDATE_TYPES.COLLISION, null, callback);
}
}
});
|
🔥 do not wait for the callback to be invoked in the collisionHandler
|
feedhenry_fh-mbaas-api
|
train
|
js
|
1892cfe40a98c432b550d70c4bfd68aed42332be
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -537,6 +537,10 @@ class ListingManager {
// Filter out listings that we just deleted
this.actions.remove = this.actions.remove.filter((id) => remove.indexOf(id) === -1);
+
+ // Update cached listings
+ this.listings = this.listings.filter((listing) => remove.indexOf(listing.id) === -1);
+
this.emit('actions', this.actions);
return callback(null, body);
|
Update cached listings after deleting listings
|
Nicklason_node-bptf-listings
|
train
|
js
|
b07c2ba82b53a5c1903684ae7407473b0cf6ce4e
|
diff --git a/src/Common/SelectInterface.php b/src/Common/SelectInterface.php
index <HASH>..<HASH> 100644
--- a/src/Common/SelectInterface.php
+++ b/src/Common/SelectInterface.php
@@ -81,7 +81,7 @@ interface SelectInterface extends QueryInterface, WhereInterface, OrderByInterfa
/**
*
- * Adds a FROM table and columns to the query.
+ * Adds a FROM element to the query; quotes the table name automatically.
*
* @param string $spec The table specification; "foo" or "foo AS bar".
*
@@ -92,6 +92,18 @@ interface SelectInterface extends QueryInterface, WhereInterface, OrderByInterfa
/**
*
+ * Adds a raw unquoted FROM element to the query; useful for adding FROM
+ * elements that are functions.
+ *
+ * @param string $spec The table specification, e.g. "function_name()".
+ *
+ * @return self
+ *
+ */
+ public function fromRaw($spec);
+
+ /**
+ *
* Adds an aliased sub-select to the query.
*
* @param string|Select $spec If a Select object, use as the sub-select;
|
udpate interface with fromRaw()
|
auraphp_Aura.SqlQuery
|
train
|
php
|
a238660ca1cc79c259555965752ccf7bedc96a43
|
diff --git a/salt/states/keystone.py b/salt/states/keystone.py
index <HASH>..<HASH> 100644
--- a/salt/states/keystone.py
+++ b/salt/states/keystone.py
@@ -581,8 +581,8 @@ def endpoint_absent(name, profile=None, **connection_args):
return ret
# Delete service
__salt__['keystone.endpoint_delete'](name,
- profile=profile,
- **connection_args)
+ profile=profile,
+ **connection_args)
ret['comment'] = 'Endpoint for service "{0}" has been deleted'.format(name)
ret['changes']['endpoint'] = 'Deleted'
return ret
|
Missed spaces for indentation
|
saltstack_salt
|
train
|
py
|
49b132d1f3afa3cfb00aa1916b482a6ba258eaf3
|
diff --git a/lib/braid/operations.rb b/lib/braid/operations.rb
index <HASH>..<HASH> 100644
--- a/lib/braid/operations.rb
+++ b/lib/braid/operations.rb
@@ -294,7 +294,7 @@ module Braid
FileUtils.mkdir_p(Braid::LOCAL_CACHE_DIR)
msg "Caching '#{url}' into '#{dir}'."
- status, out, err = exec!("git clone --mirror #{url} #{dir}")
+ status, out, err = exec!("git clone --no-checkout #{url} #{dir}")
end
end
end
|
use no-checkout instead of mirror [Roman Heinrich ]
this makes the local cache work for git versions before <I>
|
cristibalan_braid
|
train
|
rb
|
65ca3d9ed56932245b7719d7e3259f5a88d36cf3
|
diff --git a/google-cloud-pubsub/lib/google/cloud/pubsub/subscriber/timed_unary_buffer.rb b/google-cloud-pubsub/lib/google/cloud/pubsub/subscriber/timed_unary_buffer.rb
index <HASH>..<HASH> 100644
--- a/google-cloud-pubsub/lib/google/cloud/pubsub/subscriber/timed_unary_buffer.rb
+++ b/google-cloud-pubsub/lib/google/cloud/pubsub/subscriber/timed_unary_buffer.rb
@@ -135,7 +135,7 @@ module Google
synchronize do
return {} if @register.empty?
reg = @register
- @register = Concurrent::Map.new
+ @register = {}
reg
end
|
refactor(pubsub): Only set @register to a Hash
pr: #<I>
|
googleapis_google-cloud-ruby
|
train
|
rb
|
508895f8a2fad7caeb18437a25c98056b9b76832
|
diff --git a/src/tree/builder/NewTreeAdapter.js b/src/tree/builder/NewTreeAdapter.js
index <HASH>..<HASH> 100644
--- a/src/tree/builder/NewTreeAdapter.js
+++ b/src/tree/builder/NewTreeAdapter.js
@@ -61,10 +61,7 @@ class NewTreeAdapter {
insertText( node, text ) {
if ( node instanceof Heading || node instanceof Paragraph ) {
- // Add text to node's textContainer, make one if it does not exist yet.
- if ( ! node.textContainer ) {
- node.textContainer = new TextContainer();
- }
+ // Add text to the heading or paragraph.
node.textContainer.appendText( text );
} else {
// Get the previous sibling of this node.
@@ -74,10 +71,8 @@ class NewTreeAdapter {
// Append text to the paragraph.
prevChild.textContainer.appendText( text );
} else {
- // Else: make a new paragraph.
+ // Else: wrap the text in a (implicit) paragraph and add it to the tree.
const paragraph = new Paragraph();
- // This can be refactored...
- paragraph.textContainer = new TextContainer();
paragraph.textContainer.appendText( text );
node.children.push( paragraph );
}
|
Refactored appending text to headers and paragraphs a bit.
|
Yoast_YoastSEO.js
|
train
|
js
|
905bbb10476016e1d7fb0434f357e77fcdc9581d
|
diff --git a/atomic_reactor/plugins/pre_bump_release.py b/atomic_reactor/plugins/pre_bump_release.py
index <HASH>..<HASH> 100644
--- a/atomic_reactor/plugins/pre_bump_release.py
+++ b/atomic_reactor/plugins/pre_bump_release.py
@@ -36,9 +36,6 @@ class BumpReleasePlugin(PreBuildPlugin):
return {"append": True}
return {}
- # The target parameter is no longer used by this plugin. It's
- # left as an optional parameter to allow a graceful transition
- # in osbs-client.
def __init__(self, workflow, append=False):
"""
constructor
|
bump_release: remove outdated comment
There is no "target" parameter.
|
projectatomic_atomic-reactor
|
train
|
py
|
63ddb0fde68d085a8c48437ef57cc76a5997a85a
|
diff --git a/src/Hydrator/Hydrator.php b/src/Hydrator/Hydrator.php
index <HASH>..<HASH> 100644
--- a/src/Hydrator/Hydrator.php
+++ b/src/Hydrator/Hydrator.php
@@ -378,7 +378,7 @@ class Hydrator extends AbstractHydrator
}
list($class, $method, $lazyLoading) = $this->metadata->getProvidersInfo($mappedFieldName);
- $key = $class.$method;
+ $key = $class.$method.spl_object_hash($object);
if (! isset($this->providerLoadingDone[$key]) && ($enforceLoading || ! $lazyLoading)) {
|
Fix lazy loading triggerring on several objects of the same class.
Fix lazy loading triggering on several objects of the same class.
|
kassko_data-mapper
|
train
|
php
|
8fdc052a6752baa0101be208bb0296fe6350c024
|
diff --git a/actionpack/lib/action_view/asset_paths.rb b/actionpack/lib/action_view/asset_paths.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_view/asset_paths.rb
+++ b/actionpack/lib/action_view/asset_paths.rb
@@ -4,6 +4,8 @@ require 'action_controller/metal/exceptions'
module ActionView
class AssetPaths #:nodoc:
+ URI_REGEXP = %r{^[-a-z]+://|^cid:|^//}
+
attr_reader :config, :controller
def initialize(config, controller = nil)
@@ -37,7 +39,7 @@ module ActionView
end
def is_uri?(path)
- path =~ %r{^[-a-z]+://|^cid:|^//}
+ path =~ URI_REGEXP
end
private
|
Extract asset paths uri regexp to a constant
Avoid compiling the regexp all the time.
|
rails_rails
|
train
|
rb
|
1cf65b4889abd9c98dba913714a6f39db610bb7f
|
diff --git a/src/AdamWathan/BootForms/BootForm.php b/src/AdamWathan/BootForms/BootForm.php
index <HASH>..<HASH> 100644
--- a/src/AdamWathan/BootForms/BootForm.php
+++ b/src/AdamWathan/BootForms/BootForm.php
@@ -2,9 +2,9 @@
class BootForm
{
- private $builder;
- private $basicFormBuilder;
- private $horizontalFormBuilder;
+ protected $builder;
+ protected $basicFormBuilder;
+ protected $horizontalFormBuilder;
public function __construct(BasicFormBuilder $basicFormBuilder, HorizontalFormBuilder $horizontalFormBuilder)
{
diff --git a/src/AdamWathan/BootForms/HorizontalFormBuilder.php b/src/AdamWathan/BootForms/HorizontalFormBuilder.php
index <HASH>..<HASH> 100644
--- a/src/AdamWathan/BootForms/HorizontalFormBuilder.php
+++ b/src/AdamWathan/BootForms/HorizontalFormBuilder.php
@@ -8,7 +8,7 @@ use AdamWathan\Form\FormBuilder;
class HorizontalFormBuilder extends BasicFormBuilder
{
- private $columnSizes;
+ protected $columnSizes;
protected $builder;
|
Make extension easier by protecting these privates.
|
adamwathan_bootforms
|
train
|
php,php
|
b7ab1e79d4dbbd9b758e84bab78cc02aebcfe5af
|
diff --git a/src/effects/SelectiveBloomEffect.js b/src/effects/SelectiveBloomEffect.js
index <HASH>..<HASH> 100644
--- a/src/effects/SelectiveBloomEffect.js
+++ b/src/effects/SelectiveBloomEffect.js
@@ -15,9 +15,10 @@ import { BloomEffect } from "./BloomEffect.js";
/**
* A selective bloom effect.
*
- * This effect applies bloom only to selected objects. For this, all objects in
- * the scene need to be rendered again: non-selected objects are rendered solid
- * black to properly occlude selected objects and the scene background.
+ * This effect applies bloom only to selected objects by using layers. Make sure
+ * to enable the selection layer for all relevant lights:
+ *
+ * `lights.forEach((l) => l.layers.enable(bloomEffect.selection.layer));`
*
* Attention: If you don't need to limit bloom to a subset of objects, consider
* using the {@link BloomEffect} instead for better performance.
|
Adjust doc comment
Related to #<I>
|
vanruesc_postprocessing
|
train
|
js
|
6ecb96ebfa7b843e01f4c4b4ece1c1ca49fd1d78
|
diff --git a/cmd/influxd/run.go b/cmd/influxd/run.go
index <HASH>..<HASH> 100644
--- a/cmd/influxd/run.go
+++ b/cmd/influxd/run.go
@@ -231,9 +231,8 @@ func openServer(path string, u *url.URL, b *messaging.Broker, initializing, conf
openServerClient(s, joinURLs)
} else {
if len(joinURLs) == 0 {
- //This is the first broker, so it always spins up a client to itself for now
- // TODO corylanou: when we have roles enabled, this will have to change as you can
- // spin up a broker without a client
+ // If a config exists, but no joinUrls are specified, fall back to the broker URL
+ // TODO: Make sure we have a leader, and then spin up the server
joinURLs = []*url.URL{b.URL()}
}
openServerClient(s, joinURLs)
|
clarifying a comment on starting up servers
|
influxdata_influxdb
|
train
|
go
|
9c01a610b9b35dbcf17b4513c68acd2754a17b28
|
diff --git a/dispatch/helpers.py b/dispatch/helpers.py
index <HASH>..<HASH> 100644
--- a/dispatch/helpers.py
+++ b/dispatch/helpers.py
@@ -37,7 +37,7 @@ class ThemeHelper():
@staticmethod
def fetch_theme_urls(theme_name):
try:
- urls = importlib.import_module("themes." + theme_name + ".urls")
+ urls = importlib.import_module("dispatch.themes." + theme_name + ".urls")
except ImportError:
urls = importlib.import_module("dispatch.apps.frontend.themes.default.urls")
return urls.theme_urls
@@ -46,12 +46,12 @@ class ThemeHelper():
def get_static_dir(theme_name=False):
if not theme_name:
theme_name = ThemeHelper.get_current_theme()
- return '/themes/' + theme_name + '/static/'
+ return 'dispatch/themes/' + theme_name + '/static/'
@staticmethod
def get_template_dir(theme_name=False):
if not theme_name:
theme_name = ThemeHelper.get_current_theme()
- return 'themes/' + theme_name + '/templates/'
+ return 'dispatch/themes/' + theme_name + '/templates/'
|
modifying theme helper for new directory
|
ubyssey_dispatch
|
train
|
py
|
0db7d5e6eac91ab3b40ca7899c9dae249e859e49
|
diff --git a/handshake.py b/handshake.py
index <HASH>..<HASH> 100644
--- a/handshake.py
+++ b/handshake.py
@@ -15,7 +15,7 @@ WS_GUID = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
WS_VERSION = '13'
MAX_REDIRECTS = 10
HDR_TIMEOUT = 5
-MAX_HDR_LEN = 512
+MAX_HDR_LEN = 1024
class Handshake(object):
@@ -65,7 +65,11 @@ class Handshake(object):
start_time = time.time()
- while hdr[-4:] != '\r\n\r\n' and len(hdr) < MAX_HDR_LEN:
+ while hdr[-4:] != '\r\n\r\n':
+ if len(hdr) == MAX_HDR_LEN:
+ raise HandshakeError('request exceeds maximum header '
+ 'length of %d' % MAX_HDR_LEN)
+
hdr += self.sock.recv(1)
time_diff = time.time() - start_time
|
Increased max header length and added error rather than silent fail
|
taddeus_wspy
|
train
|
py
|
59aa91e0a8d7028ad2af1d76c15e71abed381e2a
|
diff --git a/lib/photocopier/ftp.rb b/lib/photocopier/ftp.rb
index <HASH>..<HASH> 100644
--- a/lib/photocopier/ftp.rb
+++ b/lib/photocopier/ftp.rb
@@ -66,7 +66,7 @@ module Photocopier
end
def lftp_mirror_arguments(reverse, exclude = [])
- mirror = "mirror --delete --use-cache --verbose --allow-chown --allow-suid --no-umask --parallel=2"
+ mirror = "mirror --delete --use-cache --verbose --allow-chown --allow-suid --no-umask --parallel=5"
mirror << " --reverse" if reverse
exclude.each do |glob|
mirror << " --exclude-glob #{glob}"
|
Increase ftp parallel to 5
|
welaika_photocopier
|
train
|
rb
|
bad3842a22ac628153a6d28e812e9867645d7175
|
diff --git a/src/CurlSoapClient.php b/src/CurlSoapClient.php
index <HASH>..<HASH> 100644
--- a/src/CurlSoapClient.php
+++ b/src/CurlSoapClient.php
@@ -50,7 +50,7 @@ class CurlSoapClient extends \SoapClient
$options = $this->curlOptions + array(
CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_SSL_VERIFYHOST => true,
+ CURLOPT_SSL_VERIFYHOST => 2,
CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => $headers,
|
Change unsupported value for CURLOPT_SSL_VERIFYHOST
|
phaza_curl-soap-client
|
train
|
php
|
06db9c31a773ce1b7bf31745c694590dde9d10c4
|
diff --git a/server/sonar-server/src/test/java/org/sonar/ce/settings/ComputeEngineSettingsTest.java b/server/sonar-server/src/test/java/org/sonar/ce/settings/ComputeEngineSettingsTest.java
index <HASH>..<HASH> 100644
--- a/server/sonar-server/src/test/java/org/sonar/ce/settings/ComputeEngineSettingsTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/ce/settings/ComputeEngineSettingsTest.java
@@ -37,7 +37,7 @@ import org.sonar.db.DbClient;
import org.sonar.db.property.PropertiesDao;
import org.sonar.db.property.PropertyDto;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static java.util.concurrent.TimeUnit.SECONDS;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.entry;
import static org.mockito.Mockito.mock;
@@ -303,7 +303,7 @@ public class ComputeEngineSettingsTest {
public void blockingExecute() throws InterruptedException {
this.start();
- this.latch.await(100, MILLISECONDS);
+ this.latch.await(5, SECONDS);
}
@Override
|
SONAR-<I> stabilize ComputeEngineSettingsTest
be less optimistic on speed of build, wait longer for concurrent thread
|
SonarSource_sonarqube
|
train
|
java
|
14932fa16e16bc6dcd7575120efb044a69d07336
|
diff --git a/src/java/arjdbc/jdbc/RubyJdbcConnection.java b/src/java/arjdbc/jdbc/RubyJdbcConnection.java
index <HASH>..<HASH> 100644
--- a/src/java/arjdbc/jdbc/RubyJdbcConnection.java
+++ b/src/java/arjdbc/jdbc/RubyJdbcConnection.java
@@ -1128,7 +1128,7 @@ public class RubyJdbcConnection extends RubyObject {
return RubyString.newUnicodeString(runtime, string.toString());
}
- private IRubyObject objectToRuby(
+ protected IRubyObject objectToRuby(
final Ruby runtime, final ResultSet resultSet, final Object object)
throws SQLException {
if ( object == null && resultSet.wasNull() ) return runtime.getNil();
@@ -1136,7 +1136,7 @@ public class RubyJdbcConnection extends RubyObject {
return JavaUtil.convertJavaToRuby(runtime, object);
}
- private IRubyObject arrayToRuby(
+ protected IRubyObject arrayToRuby(
final Ruby runtime, final ResultSet resultSet, final Array array)
throws SQLException {
if ( array == null && resultSet.wasNull() ) return runtime.getNil();
|
allow objectToRuby and arrayToRuby overrides - will need them for PG
|
jruby_activerecord-jdbc-adapter
|
train
|
java
|
9b3bd27e7d9eb932337edf6b52fcd276a00f1b23
|
diff --git a/tasks/jasmine.js b/tasks/jasmine.js
index <HASH>..<HASH> 100644
--- a/tasks/jasmine.js
+++ b/tasks/jasmine.js
@@ -65,7 +65,7 @@ module.exports = function(grunt) {
setup(options);
- var files = grunt.file.expandFiles(grunt.util._.pluck(this.files, 'src'));
+ var files = this.file.src;
jasmine.buildSpecrunner(files,options);
// If we're just building (e.g. for web), skip phantom.
|
remove expandFiles, grunt does it for us now
|
gruntjs_grunt-contrib-jasmine
|
train
|
js
|
595929db69ff7ad2749a96882fb29e6eeacd6ae0
|
diff --git a/packages/tiptap-extensions/src/nodes/Blockquote.js b/packages/tiptap-extensions/src/nodes/Blockquote.js
index <HASH>..<HASH> 100644
--- a/packages/tiptap-extensions/src/nodes/Blockquote.js
+++ b/packages/tiptap-extensions/src/nodes/Blockquote.js
@@ -20,8 +20,8 @@ export default class Blockquote extends Node {
}
}
- commands({ type, schema }) {
- return () => toggleWrap(type, schema.nodes.paragraph)
+ commands({ type }) {
+ return () => toggleWrap(type)
}
keys({ type }) {
|
fix: blockquote unwrap not working
Closes #<I>
|
scrumpy_tiptap
|
train
|
js
|
c41bd0a2ea380ca47f994b2ddf9b71e7395a189c
|
diff --git a/modules/carambolaBidAdapter.js b/modules/carambolaBidAdapter.js
index <HASH>..<HASH> 100644
--- a/modules/carambolaBidAdapter.js
+++ b/modules/carambolaBidAdapter.js
@@ -89,7 +89,7 @@ function CarambolaAdapter() {
}
}
- let server = bid.params.server || 'route.carambo.la';
+ let server = bid.params.server || 'hb.route.carambo.la';
let cbolaHbApiUrl = '//' + server + '/' + REQUEST_PATH;
// the responses of the bid requests
|
Carambola header bidding adaptor - changing the server url. (#<I>)
|
prebid_Prebid.js
|
train
|
js
|
11716cb636192994e4dcd3d996274a6735aa30d7
|
diff --git a/build/tasks/ci.js b/build/tasks/ci.js
index <HASH>..<HASH> 100644
--- a/build/tasks/ci.js
+++ b/build/tasks/ci.js
@@ -1,4 +1,4 @@
var gulp = require('gulp');
// gulp.task('ci', ['default', 'coveralls']);
-gulp.task('ci', 'default');
+gulp.task('ci', ['default']);
|
chore(ci-build-task): changed ci task to try travis
|
aurelia-ui-toolkits_aurelia-materialize-bridge
|
train
|
js
|
d3e4819fb2b9d4920d1e86c866b6e00679de71a5
|
diff --git a/phonopy/interface/phonopy_yaml.py b/phonopy/interface/phonopy_yaml.py
index <HASH>..<HASH> 100644
--- a/phonopy/interface/phonopy_yaml.py
+++ b/phonopy/interface/phonopy_yaml.py
@@ -52,7 +52,7 @@ from phonopy.structure.atoms import Atoms, PhonopyAtoms
class phonopyYaml:
def __init__(self, filename):
- with open(filename) as infile :
+ with open(filename) as infile :
self._data = yaml.load( infile, Loader=Loader)
self._lattice = self._data['lattice']
|
Correct indentation in yaml iface.
|
atztogo_phonopy
|
train
|
py
|
2e9ca5d42785f1a6268ece48457a9e070e0a05d7
|
diff --git a/driver/src/test/unit/org/mongodb/Fixture.java b/driver/src/test/unit/org/mongodb/Fixture.java
index <HASH>..<HASH> 100644
--- a/driver/src/test/unit/org/mongodb/Fixture.java
+++ b/driver/src/test/unit/org/mongodb/Fixture.java
@@ -16,6 +16,8 @@
package org.mongodb;
+import org.mongodb.binding.AsyncClusterBinding;
+import org.mongodb.binding.AsyncReadWriteBinding;
import org.mongodb.binding.ClusterBinding;
import org.mongodb.binding.ReadWriteBinding;
import org.mongodb.connection.Cluster;
@@ -133,6 +135,11 @@ public final class Fixture {
return new ClusterBinding(getCluster(), ReadPreference.primary(), 1, SECONDS);
}
+ public static AsyncReadWriteBinding getAsyncBinding() {
+ getMongoClient();
+ return new AsyncClusterBinding(getCluster(), ReadPreference.primary(), 1, SECONDS);
+ }
+
public static Cluster getCluster() {
getMongoClient();
return mongoClient.getCluster();
|
Added Fixture.getAsyncBinding
|
mongodb_mongo-java-driver
|
train
|
java
|
3c98130f15a912307a7362e7dda38c4670b30042
|
diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -98,9 +98,9 @@ Server.prototype.serveClient = function(v){
this._serveClient = v;
if (v && !clientSource) {
- clientSource = read(require.resolve('socket.io-client/socket.io.js'), 'utf-8');
+ clientSource = read(require.resolve('socket.io-client/dist/socket.io.min.js'), 'utf-8');
try {
- clientSourceMap = read(require.resolve('socket.io-client/socket.io.js.map'), 'utf-8');
+ clientSourceMap = read(require.resolve('socket.io-client/dist/socket.io.js.map'), 'utf-8');
} catch(err) {
debug('could not load sourcemap file');
}
@@ -304,6 +304,7 @@ Server.prototype.serve = function(req, res){
debug('serve client source');
res.setHeader('Content-Type', 'application/javascript');
res.setHeader('ETag', expectedEtag);
+ res.setHeader('X-SourceMap', 'socket.io.js.map');
res.writeHead(200);
res.end(clientSource);
};
|
[chore] Update client location and serve minified file (#<I>)
Following <URL>
|
socketio_socket.io
|
train
|
js
|
581d419fdce54cfbccb1462258bbc7d04149c771
|
diff --git a/helpers/TbHtml.php b/helpers/TbHtml.php
index <HASH>..<HASH> 100755
--- a/helpers/TbHtml.php
+++ b/helpers/TbHtml.php
@@ -2004,7 +2004,7 @@ EOD;
ob_start();
echo self::openTag('div', $groupOptions);
if ($label !== false)
- CHtml::activeLabelEx($model, $attribute, $labelOptions);
+ echo CHtml::activeLabelEx($model, $attribute, $labelOptions);
echo self::formControls($input . $error . $help, $controlOptions);
echo '</div>';
return ob_get_clean();
|
Fix another minor bug in the previous commit
|
crisu83_yiistrap
|
train
|
php
|
96b8f941112328c83a17ad7a399787a7072e6e07
|
diff --git a/lib/boxen/reporter.rb b/lib/boxen/reporter.rb
index <HASH>..<HASH> 100644
--- a/lib/boxen/reporter.rb
+++ b/lib/boxen/reporter.rb
@@ -40,7 +40,9 @@ module Boxen
end
def close_failures
+ version = sha
failures.each do |issue|
+ config.api.add_comment(config.reponame, issue.number, "Succeeded at version #{version}.")
config.api.close_issue(config.reponame, issue.number)
end
end
diff --git a/test/boxen_reporter_test.rb b/test/boxen_reporter_test.rb
index <HASH>..<HASH> 100644
--- a/test/boxen_reporter_test.rb
+++ b/test/boxen_reporter_test.rb
@@ -140,8 +140,12 @@ class BoxenReporterTest < Boxen::Test
issues = Array.new(3) { |i| stub('issue', :number => i*2 + 2) }
@reporter.stubs(:failures).returns(issues)
+ sha = 'decafbad'
+ @reporter.stubs(:sha).returns(sha)
+
api = mock('api')
issues.each do |issue|
+ api.expects(:add_comment).with(repo, issue.number, "Succeeded at version #{sha}.")
api.expects(:close_issue).with(repo, issue.number)
end
@config.stubs(:api).returns(api)
|
Add comment when auto-closing issues
|
boxen_boxen
|
train
|
rb,rb
|
8b1a203f46392d9804b3e3530ce8f0895fc2164d
|
diff --git a/src/com/backendless/Files.java b/src/com/backendless/Files.java
index <HASH>..<HASH> 100644
--- a/src/com/backendless/Files.java
+++ b/src/com/backendless/Files.java
@@ -416,7 +416,7 @@ public final class Files
public boolean exists( String path )
{
StringUtils.checkNotNullOrEmpty( path, ExceptionMessage.NULL_PATH );
- return Invoker.invokeSync( FILE_MANAGER_SERVER_ALIAS, "exists", new Object[] { Backendless.getApplicationId(), Backendless.getVersion(), path } );
+ return Invoker.<Boolean>invokeSync( FILE_MANAGER_SERVER_ALIAS, "exists", new Object[] { Backendless.getApplicationId(), Backendless.getVersion(), path } );
}
public void exists( String path, AsyncCallback<Boolean> responder )
|
Fixed return type for "exists" method
|
Backendless_Android-SDK
|
train
|
java
|
a4481dc4d18d1003aeba38931bbeec4fb69c9b57
|
diff --git a/js/remote.js b/js/remote.js
index <HASH>..<HASH> 100644
--- a/js/remote.js
+++ b/js/remote.js
@@ -813,11 +813,7 @@ Transaction.prototype.submit = function () {
// XXX make sure self.hash is available.
self.remote.request_transaction_entry(self.hash, ledger_closed)
.on('success', function (message) {
- // XXX Fake results for now.
- if (!message.metadata.result)
- message.metadata.result = 'tesSUCCESS';
-
- self.set_state(message.metadata.result); // XXX Untested.
+ self.set_state(message.metadata.TransactionResult);
self.emit('final', message);
})
.on('error', function (message) {
|
JS: report final transaction status.
|
ChainSQL_chainsql-lib
|
train
|
js
|
487a2270758769e8b1453391b958b23f85d5b6ce
|
diff --git a/src/toil/batchSystems/lsf.py b/src/toil/batchSystems/lsf.py
index <HASH>..<HASH> 100644
--- a/src/toil/batchSystems/lsf.py
+++ b/src/toil/batchSystems/lsf.py
@@ -217,7 +217,13 @@ class LSFBatchSystem(BatchSystemSupport):
and a how long they have been running for (in seconds).
"""
times = {}
- currentjobs = set(self.lsfJobIDs[x] for x in self.getIssuedBatchJobIDs())
+ currentjobs = set()
+ for x in self.getIssuedBatchJobIDs():
+ if x in self.lsfJobIDs:
+ currentjobs.add(self.lsfJobIDs[x])
+ else:
+ #not yet started
+ pass
process = subprocess.Popen(["bjobs"], stdout = subprocess.PIPE)
for curline in process.stdout:
|
fix case where a job has been put in currentjobs, but not yet dispatched to lsf
|
DataBiosphere_toil
|
train
|
py
|
5abbd0f96fa4c3e9b2ff29cb5610c5d46ea427e8
|
diff --git a/pkg/volume/flocker/flocker_volume_test.go b/pkg/volume/flocker/flocker_volume_test.go
index <HASH>..<HASH> 100644
--- a/pkg/volume/flocker/flocker_volume_test.go
+++ b/pkg/volume/flocker/flocker_volume_test.go
@@ -41,7 +41,7 @@ func newTestableProvisioner(assert *assert.Assertions, options volume.VolumeOpti
assert.NoError(err, "Can't find the plugin by name")
provisioner, err := plug.(*flockerPlugin).newProvisionerInternal(options, &fakeFlockerUtil{})
-
+ assert.NoError(err, fmt.Sprintf("Can't create new provisioner:%v", err))
return tmpDir, provisioner
}
|
Fix swallowed error in tests for flocker package
|
kubernetes_kubernetes
|
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.