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
|
---|---|---|---|---|---|
4915c84765d904f610c4f7ee3d8b112d2e4b72cd
|
diff --git a/views/js/qtiCreator/widgets/interactions/hottextInteraction/states/Question.js b/views/js/qtiCreator/widgets/interactions/hottextInteraction/states/Question.js
index <HASH>..<HASH> 100755
--- a/views/js/qtiCreator/widgets/interactions/hottextInteraction/states/Question.js
+++ b/views/js/qtiCreator/widgets/interactions/hottextInteraction/states/Question.js
@@ -95,7 +95,8 @@ define([
data: {
container: container,
widget: _widget
- }
+ },
+ qtiInclude: false
});
}
};
|
fix: Remove shared stimulus toolbar icon in hottext interaction
|
oat-sa_extension-tao-itemqti
|
train
|
js
|
d354de9d80fe322abbf1d6744cb75b4dd2664627
|
diff --git a/tensorflowonspark/util.py b/tensorflowonspark/util.py
index <HASH>..<HASH> 100644
--- a/tensorflowonspark/util.py
+++ b/tensorflowonspark/util.py
@@ -9,12 +9,23 @@ from __future__ import print_function
import os
import socket
+import errno
+from socket import error as socket_error
def get_ip_address():
"""Simple utility to get host IP address."""
- s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
- s.connect(("8.8.8.8", 80))
- return s.getsockname()[0]
+ try:
+ s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ s.connect(("8.8.8.8", 80))
+ ip_address = s.getsockname()[0]
+ except socket_error as sockerr:
+ if sockerr.errno != errno.ENETUNREACH:
+ raise sockerr
+ ip_address = socket.gethostbyname(socket.getfqdn())
+ finally:
+ s.close()
+
+ return ip_address
def find_in_path(path, file):
|
Workaround for firewall proxy isue with get_ip_address
|
yahoo_TensorFlowOnSpark
|
train
|
py
|
598229912046ddd447f8e1a120f973c98b4ee86e
|
diff --git a/wxmplot/plotconfigframe.py b/wxmplot/plotconfigframe.py
index <HASH>..<HASH> 100644
--- a/wxmplot/plotconfigframe.py
+++ b/wxmplot/plotconfigframe.py
@@ -201,11 +201,16 @@ class PlotConfigFrame(wx.Frame):
raxes = None
if len(axes) > 1:
raxes = axes[1]
- user_lims = self.conf.user_limits[laxes]
-
+ try:
+ user_lims = self.conf.user_limits[laxes]
+ except:
+ user_lims = 4*[None]
auto_b = wx.CheckBox(panel,-1, ' From Data ', (-1, -1), (-1, -1))
auto_b.Bind(wx.EVT_CHECKBOX,self.onAutoBounds)
- auto_b.SetValue(self.conf.user_limits[laxes] == 4*[None])
+ try:
+ auto_b.SetValue(self.conf.user_limits[laxes] == 4*[None])
+ except:
+ pass
xb0, xb1 = laxes.get_xlim()
yb0, yb1 = laxes.get_ylim()
|
add checks (for histogram configs -- needs work)
|
newville_wxmplot
|
train
|
py
|
7f37ec405fff000bbea46aed0f31571c50c954b1
|
diff --git a/src/Command/Project/Variable/ProjectVariableSetCommand.php b/src/Command/Project/Variable/ProjectVariableSetCommand.php
index <HASH>..<HASH> 100644
--- a/src/Command/Project/Variable/ProjectVariableSetCommand.php
+++ b/src/Command/Project/Variable/ProjectVariableSetCommand.php
@@ -21,7 +21,7 @@ class ProjectVariableSetCommand extends CommandBase
->addArgument('value', InputArgument::REQUIRED, 'The variable value')
->addOption('json', null, InputOption::VALUE_NONE, 'Mark the value as JSON')
->addOption('no-visible-build', null, InputOption::VALUE_NONE, 'Do not expose this variable at build time')
- ->addOption('no-visible-runtime', null, InputOption::VALUE_NONE, 'Do not expose this variable in runtime')
+ ->addOption('no-visible-runtime', null, InputOption::VALUE_NONE, 'Do not expose this variable at runtime')
->setDescription('Set a variable for a project');
$this->addProjectOption()
->addNoWaitOption();
|
Tiny text change (after commit <I>dd4)
|
platformsh_platformsh-cli
|
train
|
php
|
c2120582e4d27d2a64131820a46392af60f1e8b6
|
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb
index <HASH>..<HASH> 100644
--- a/activerecord/test/cases/associations/has_many_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_associations_test.rb
@@ -241,6 +241,13 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
assert_equal "defaulty", bulb.name
end
+ def test_build_from_association_sets_inverse_instance
+ car = Car.new(name: "honda")
+
+ bulb = car.bulbs.build
+ assert_equal car, bulb.car
+ end
+
def test_do_not_call_callbacks_for_delete_all
car = Car.create(name: "honda")
car.funky_bulbs.create!
@@ -2146,6 +2153,13 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
assert_equal "Post", tagging.taggable_type
end
+ def test_build_from_polymorphic_association_sets_inverse_instance
+ post = Post.new
+ tagging = post.taggings.build
+
+ assert_equal post, tagging.taggable
+ end
+
def test_dont_call_save_callbacks_twice_on_has_many
firm = companies(:first_firm)
contract = firm.contracts.create!
|
Add regression test for setting inverse instances on normal & polymorphic relationships when building objects on new records
|
rails_rails
|
train
|
rb
|
1fa4f3a61de04968b7dcab37e66fc65886b958e0
|
diff --git a/src/metpy/plots/declarative.py b/src/metpy/plots/declarative.py
index <HASH>..<HASH> 100644
--- a/src/metpy/plots/declarative.py
+++ b/src/metpy/plots/declarative.py
@@ -1317,7 +1317,7 @@ class PlotObs(HasTraits):
parent = Instance(Panel)
_need_redraw = Bool(default_value=True)
- level = Union([Int(allow_none=True), Instance(units.Quantity)])
+ level = Union([Int(allow_none=True), Instance(units.Quantity)], default_value=None)
level.__doc__ = """The level of the field to be plotted.
This is a value with units to choose the desired plot level. For example, selecting the
diff --git a/tests/plots/test_declarative.py b/tests/plots/test_declarative.py
index <HASH>..<HASH> 100644
--- a/tests/plots/test_declarative.py
+++ b/tests/plots/test_declarative.py
@@ -553,7 +553,6 @@ def test_plotobs_subset_default_nolevel(sample_obs):
"""Test PlotObs subsetting with minimal config."""
obs = PlotObs()
obs.data = sample_obs
- obs.level = None
truth = pd.DataFrame([('2020-08-06 13:00', 'KDEN', 500, 7, 15),
('2020-08-06 12:59', 'KOKC', 500, 8, 16)],
|
ENH: Make None the default level for PlotObs.
|
Unidata_MetPy
|
train
|
py,py
|
c34c0af6a4bbc602cc48ab66a657a82da540b2d9
|
diff --git a/src/you_get/extractors/universal.py b/src/you_get/extractors/universal.py
index <HASH>..<HASH> 100644
--- a/src/you_get/extractors/universal.py
+++ b/src/you_get/extractors/universal.py
@@ -99,6 +99,14 @@ def universal_download(url, output_dir='.', merge=True, info_only=False, **kwarg
for rel_url in rel_urls:
urls += [ r1(r'(.*/)', url) + rel_url ]
+ # site-relative path
+ rel_urls = []
+ rel_urls += re.findall(r'href="(/[^"]+\.jpe?g)"', page, re.I)
+ rel_urls += re.findall(r'href="(/[^"]+\.png)"', page, re.I)
+ rel_urls += re.findall(r'href="(/[^"]+\.gif)"', page, re.I)
+ for rel_url in rel_urls:
+ urls += [ r1(r'(https?://[^/]+)', url) + rel_url ]
+
# MPEG-DASH MPD
mpd_urls = re.findall(r'src="(https?://[^"]+\.mpd)"', page)
for mpd_url in mpd_urls:
|
[universal] support site-relative path
|
soimort_you-get
|
train
|
py
|
822f5ee7b1390be6863eb5ebaef71e9a7f059244
|
diff --git a/requery/src/main/java/io/requery/sql/EntityDataStore.java b/requery/src/main/java/io/requery/sql/EntityDataStore.java
index <HASH>..<HASH> 100644
--- a/requery/src/main/java/io/requery/sql/EntityDataStore.java
+++ b/requery/src/main/java/io/requery/sql/EntityDataStore.java
@@ -56,6 +56,7 @@ import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;
import java.util.Arrays;
+import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;
@@ -232,7 +233,7 @@ public class EntityDataStore<T> implements BlockingEntityStore<T> {
return result;
}
}
- return null;
+ return Collections.emptySet();
}
@Override
|
Resolve #<I> insert with empty collection should return non-null empty set
|
requery_requery
|
train
|
java
|
19961f8881a9111f23dc73aeb2851849021c7ea2
|
diff --git a/dicom2nifti/convert_ge.py b/dicom2nifti/convert_ge.py
index <HASH>..<HASH> 100644
--- a/dicom2nifti/convert_ge.py
+++ b/dicom2nifti/convert_ge.py
@@ -7,6 +7,7 @@ dicom2nifti
from __future__ import print_function
import dicom2nifti.patch_pydicom_encodings
+from dicom2nifti.exceptions import ConversionError
dicom2nifti.patch_pydicom_encodings.apply()
@@ -165,6 +166,13 @@ def _get_full_block(grouped_dicoms):
size_t = len(data_blocks)
full_block = numpy.zeros((size_x, size_y, size_z, size_t), dtype=data_blocks[0].dtype)
for index in range(0, size_t):
+ if full_block[:, :, :, index].shape != data_blocks[index].shape:
+ logger.warning('Missing slices (slice count mismatch between timepoint %s and %s)')
+ logger.warning('---------------------------------------------------------')
+ logger.warning(full_block[:, :, :, index].shape)
+ logger.warning(data_blocks[index].shape)
+ logger.warning('---------------------------------------------------------')
+ raise ConversionError("MISSING_DICOM_FILES")
full_block[:, :, :, index] = data_blocks[index]
return full_block
|
icometrix/dicom2nifti#<I>:
Improved error handling in case of missing slices in 4D sequences
|
icometrix_dicom2nifti
|
train
|
py
|
582c7068f3ec1e253cfeb5c6e4949a1a60c71684
|
diff --git a/lib/pdf_forms/field.rb b/lib/pdf_forms/field.rb
index <HASH>..<HASH> 100644
--- a/lib/pdf_forms/field.rb
+++ b/lib/pdf_forms/field.rb
@@ -17,7 +17,7 @@ module PdfForms
(@options ||= []) << $1
else
line.strip!
- key, value = line.split(": ")
+ key, value = line.split(": ", 2)
key.gsub!(/Field/, "")
key = key.split(/(?=[A-Z])/).map(&:downcase).join('_').split(":")[0]
diff --git a/test/field_test.rb b/test/field_test.rb
index <HASH>..<HASH> 100644
--- a/test/field_test.rb
+++ b/test/field_test.rb
@@ -50,5 +50,15 @@ END
assert_equal 'BarTown', f.bar
end
-end
+ VALUE_WITH_COLON = <<-END
+FieldType: Text
+FieldName: Date
+FieldNameAlt: Date: most recent
+END
+ def test_field_values_with_colons
+ f = PdfForms::Field.new VALUE_WITH_COLON
+ assert_equal 'Date: most recent', f.name_alt
+ end
+
+end
|
Support field properties with values that have `: ` in them. Fixes #<I>.
|
jkraemer_pdf-forms
|
train
|
rb,rb
|
960ee90f4b48110c538638e554363768620c6c0e
|
diff --git a/lib/datastores/file_system.rb b/lib/datastores/file_system.rb
index <HASH>..<HASH> 100644
--- a/lib/datastores/file_system.rb
+++ b/lib/datastores/file_system.rb
@@ -7,7 +7,7 @@ class FileSystemAttachmentDataStoreError < AttachmentDataStoreError; end
module AttachmentSaver
module DataStores
module FileSystem
- RETRIES = 100
+ RETRIES = 100 # max attempts at finding a unique storage key. very rare to have to retry at all, so if it fails after 100 attempts, something's seriously wrong.
def self.included(base)
base.attachment_options[:storage_directory] ||= File.join(RAILS_ROOT, 'public') # this is the part of the full filename that _doesn't_ form part of the HTTP path to the files
|
added a comment on the RETRIES constant
|
willbryant_attachment_saver
|
train
|
rb
|
521d04cf978f9f496d66dcfb98d09d643a680e33
|
diff --git a/user/edit.php b/user/edit.php
index <HASH>..<HASH> 100644
--- a/user/edit.php
+++ b/user/edit.php
@@ -91,7 +91,7 @@
// Copy data into $USER session variable
$usernew = (array)$usernew;
foreach ($usernew as $variable => $value) {
- $USER->$variable = $value;
+ $USER->$variable = stripslashes($value);
}
if (isset($USER->newadminuser)) {
unset($USER->newadminuser);
|
Stripslashes off data before adding them to current USER session record
|
moodle_moodle
|
train
|
php
|
44be42c9221168098c46bd83ee7fe0a42ad82351
|
diff --git a/caravel/models.py b/caravel/models.py
index <HASH>..<HASH> 100644
--- a/caravel/models.py
+++ b/caravel/models.py
@@ -744,10 +744,6 @@ class SqlaTable(Model, Queryable, AuditMixinNullable):
"table-condensed"))
@property
- def name(self):
- return self.table_name
-
- @property
def metrics_combo(self):
return sorted(
[
|
Remove duplicate code for property name of SqlaTable (#<I>)
|
apache_incubator-superset
|
train
|
py
|
b98974e77799cb7705a3381afc7d34a1e0337ef1
|
diff --git a/test/fixtures/pivotal/spec/SpecHelper.js b/test/fixtures/pivotal/spec/SpecHelper.js
index <HASH>..<HASH> 100755
--- a/test/fixtures/pivotal/spec/SpecHelper.js
+++ b/test/fixtures/pivotal/spec/SpecHelper.js
@@ -1,5 +1,5 @@
beforeEach(function () {
- jasmine.Expectation.addMatchers({
+ jasmine.addMatchers({
toBePlaying: function () {
return {
compare: function (actual, expected) {
|
Fix call to addMatchers in the spec helper
|
gruntjs_grunt-contrib-jasmine
|
train
|
js
|
46cc5e14063e1741dffd51f8f098792f70b5217e
|
diff --git a/squad/settings.py b/squad/settings.py
index <HASH>..<HASH> 100644
--- a/squad/settings.py
+++ b/squad/settings.py
@@ -191,12 +191,12 @@ LOGGING = {
'django': {
'handlers': ['console'],
'propagate': False,
- 'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'),
+ 'level': DEBUG and 'DEBUG' or os.getenv('DJANGO_LOG_LEVEL', 'INFO'),
},
'': {
'handlers': ['console'],
'propagate': False,
- 'level': os.getenv('SQUAD_LOG_LEVEL', 'INFO'),
+ 'level': DEBUG and 'DEBUG' or os.getenv('SQUAD_LOG_LEVEL', 'INFO'),
}
}
}
|
settings: force debug logging when DEBUG is True
|
Linaro_squad
|
train
|
py
|
08bba5defc46094bea86234cc75edeeeebc2ca34
|
diff --git a/src/models/size.js b/src/models/size.js
index <HASH>..<HASH> 100644
--- a/src/models/size.js
+++ b/src/models/size.js
@@ -34,7 +34,7 @@ var SizeModel = Axis.extend({
if(this.use == 'indicator' && this.domainMin == null && this.domainMax == null) {
var domain = this.scale.domain();
- this.set({domainMin: domain[0], domainMax: domain[1]});
+ //this.set({domainMin: domain[0], domainMax: domain[1]});
}
}
});
|
Don't push size domain to model/url
It's not GUI-configurable and thus always follows data
|
vizabi_vizabi
|
train
|
js
|
c97a39260162aa5dd8a5bbb4e05d10098f0f0a19
|
diff --git a/ansible/modules/hashivault/hashivault_list.py b/ansible/modules/hashivault/hashivault_list.py
index <HASH>..<HASH> 100644
--- a/ansible/modules/hashivault/hashivault_list.py
+++ b/ansible/modules/hashivault/hashivault_list.py
@@ -15,7 +15,7 @@ short_description: Hashicorp Vault list
description:
- The M(hashivault_list) module lists keys in Hashicorp Vault. By
default this will list top-level keys under `/secret`, but you
- can provide an alternate location as I(secret). This includes both
+ can provide an alternate location as *secret*. This includes both
immediate subkeys and subkey paths, like the `vault list` command.
options:
secret:
@@ -23,7 +23,7 @@ options:
- 'secret path to list. If this does not begin with a `/`
then it is interpreted as a subpath of `/secret`. This
is always interpreted as a "directory": if a key `/secret/foo`
- exists, and you pass `/secret/foo` as I(secret), then the key
+ exists, and you pass `/secret/foo` as *secret*, then the key
itself will not be returned, but subpaths like
`/secret/foo/bar` will.'
default: ''
|
Remove ansible docs that break sphinx
|
TerryHowe_ansible-modules-hashivault
|
train
|
py
|
06f437d217950c18291cd4b1db3df90f5440ed28
|
diff --git a/util/utils.go b/util/utils.go
index <HASH>..<HASH> 100644
--- a/util/utils.go
+++ b/util/utils.go
@@ -22,6 +22,12 @@ var (
IpfsVersionPath = "/ipns/dist.ipfs.io"
)
+func init() {
+ if dist := os.Getenv("IPFS_DIST_PATH"); dist != "" {
+ IpfsVersionPath = dist
+ }
+}
+
const fetchSizeLimit = 1024 * 1024 * 512
func ApiEndpoint(ipfspath string) (string, error) {
|
allow overriding of dists path
|
ipfs_ipfs-update
|
train
|
go
|
0062d3fbc979aa39804f6f1007a6291ca9004ee4
|
diff --git a/core/src/main/java/com/datastax/oss/driver/internal/core/cql/CqlRequestHandler.java b/core/src/main/java/com/datastax/oss/driver/internal/core/cql/CqlRequestHandler.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/datastax/oss/driver/internal/core/cql/CqlRequestHandler.java
+++ b/core/src/main/java/com/datastax/oss/driver/internal/core/cql/CqlRequestHandler.java
@@ -358,7 +358,7 @@ public class CqlRequestHandler
Message responseMessage = responseFrame.message;
if (responseMessage instanceof SchemaChange) {
// TODO schema agreement, and chain setFinalResult to the result
- setFinalError(new UnsupportedOperationException("TODO handle schema agreement"));
+ setFinalResult((Result) responseMessage, responseFrame, this);
} else if (responseMessage instanceof Result) {
LOG.debug("[{}] Got result, completing", logPrefix);
setFinalResult((Result) responseMessage, responseFrame, this);
|
Successfully complete future with SchemaChange result
Until JAVA-<I> is implemented, simply complete futures that resulted in
schema change.
|
datastax_java-driver
|
train
|
java
|
428302504d9c568ee7dfcdb54d28dee43fac3e84
|
diff --git a/shinken/satellite.py b/shinken/satellite.py
index <HASH>..<HASH> 100644
--- a/shinken/satellite.py
+++ b/shinken/satellite.py
@@ -654,7 +654,7 @@ class Satellite(BaseSatellite):
except Exception , exp:
logger.debug("A satellite raised an unknown exception : %s (%s)" % (exp, type(exp)))
try:
- logger.debug(''.join(Pyro.util.getPyroTraceback(exp) if PYRO_VERSION < "4.0" else Pyro.util.getPyroTraceback()))
+ logger.debug(''.join(if_else(PYRO_VERSION < "4.0", Pyro.util.getPyroTraceback(exp), Pyro.util.getPyroTraceback())))
except:
pass
raise
|
replaced another ternary in satellite.py
|
Alignak-monitoring_alignak
|
train
|
py
|
81f8a5d714b88c780933de6bbb5c9a8ba372b806
|
diff --git a/benchmark_test.go b/benchmark_test.go
index <HASH>..<HASH> 100644
--- a/benchmark_test.go
+++ b/benchmark_test.go
@@ -3,7 +3,7 @@ package wrap_test
import (
"testing"
- "github.com/bbrks/wrap"
+ "github.com/bbrks/wrap/v2"
)
func benchmarkWrap(b *testing.B, limit int) {
diff --git a/example_test.go b/example_test.go
index <HASH>..<HASH> 100644
--- a/example_test.go
+++ b/example_test.go
@@ -3,7 +3,7 @@ package wrap_test
import (
"fmt"
- "github.com/bbrks/wrap"
+ "github.com/bbrks/wrap/v2"
)
func ExampleWrap() {
diff --git a/go.mod b/go.mod
index <HASH>..<HASH> 100644
--- a/go.mod
+++ b/go.mod
@@ -1,3 +1,3 @@
-module github.com/bbrks/wrap
+module github.com/bbrks/wrap/v2
go 1.13
diff --git a/wrapper_test.go b/wrapper_test.go
index <HASH>..<HASH> 100644
--- a/wrapper_test.go
+++ b/wrapper_test.go
@@ -5,7 +5,7 @@ import (
"testing"
"unicode/utf8"
- "github.com/bbrks/wrap"
+ "github.com/bbrks/wrap/v2"
)
// tests contains various line lengths to test our wrap functions.
|
Declare module as v2 in go.mod file
|
bbrks_wrap
|
train
|
go,go,mod,go
|
b2a9887095a6ac89fae191408437c4ef9cddb856
|
diff --git a/lib/netsuite/utilities.rb b/lib/netsuite/utilities.rb
index <HASH>..<HASH> 100644
--- a/lib/netsuite/utilities.rb
+++ b/lib/netsuite/utilities.rb
@@ -91,6 +91,8 @@ module NetSuite
!e.message.include?('An unexpected error has occurred. Technical Support has been alerted to this problem.') &&
!e.message.include?('Session invalidation is in progress with different thread') &&
!e.message.include?('SuiteTalk concurrent request limit exceeded. Request blocked.') &&
+ # maintenance is the new outage: this message is being used for intermittent errors
+ !e.message.include?('The account you are trying to access is currently unavailable while we undergo our regularly scheduled maintenance.') &&
!e.message.include?('The Connection Pool is not intialized.') &&
# it looks like NetSuite mispelled their error message...
!e.message.include?('The Connection Pool is not intiialized.')
|
Retry on maintenance errors
On many accounts I'm seeing this error occur intermittently when there is not any scheduled maintenance
|
NetSweet_netsuite
|
train
|
rb
|
54fd61e11fae2056aee024c70cf3cd5a88885e3c
|
diff --git a/src/views/marker.blade.php b/src/views/marker.blade.php
index <HASH>..<HASH> 100644
--- a/src/views/marker.blade.php
+++ b/src/views/marker.blade.php
@@ -78,6 +78,15 @@ markers.push(marker_{!! $id !!});
@endif
google.maps.event.addListener(marker_{!! $id !!}, 'click', function() {
+
+ @if (isset($options['autoClose']) && $options['autoClose'])
+
+ for (var i = 0; i < infowindows.length; i++) {
+ infowindows[i].close();
+ }
+
+ @endif
+
infowindow_{!! $id !!}.open({!! $options['map'] !!}, marker_{!! $id !!});
});
|
Adding the option 'autoClose' with automatically closes all information windows when another one is clicked.
|
bradcornford_Googlmapper
|
train
|
php
|
55eef917095c5419cead96f314028cbeee44ff26
|
diff --git a/src/main/java/org/graylog2/database/MongoBridge.java b/src/main/java/org/graylog2/database/MongoBridge.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/graylog2/database/MongoBridge.java
+++ b/src/main/java/org/graylog2/database/MongoBridge.java
@@ -89,6 +89,8 @@ public class MongoBridge {
dbObj.put("facility", event.getFacility());
dbObj.put("level", event.getLevel());
dbObj.put("created_at", (int) (System.currentTimeMillis()/1000));
+ // Documents in capped collections cannot grow so we have to do that now and cannot just add 'deleted => true' later.
+ dbObj.put("deleted", false);
coll.insert(dbObj);
}
|
deleted flag must also be prepared for plain syslog messages of course
|
Graylog2_graylog2-server
|
train
|
java
|
308336996615dcd86eec745211ff6ac06a630420
|
diff --git a/src/main/java/org/jfree/graphics2d/svg/SVGGraphics2D.java b/src/main/java/org/jfree/graphics2d/svg/SVGGraphics2D.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jfree/graphics2d/svg/SVGGraphics2D.java
+++ b/src/main/java/org/jfree/graphics2d/svg/SVGGraphics2D.java
@@ -282,7 +282,8 @@ public class SVGGraphics2D extends Graphics2D {
this.sb.append("<path ").append(getSVGPathData(path)).append("/>");
this.sb.append("</g>");
} else {
- System.out.println("draw(" + s + ")");
+ System.out.println("*draw(" + s + ")");
+ draw(new GeneralPath(s));
}
}
|
In draw(Shape) provide a default to draw as a GeneralPath.
|
jfree_jfreesvg
|
train
|
java
|
5fabf0d2422d56d5f4b9b0ed8baf57e1f6134256
|
diff --git a/salt/cloud/clouds/vultrpy.py b/salt/cloud/clouds/vultrpy.py
index <HASH>..<HASH> 100644
--- a/salt/cloud/clouds/vultrpy.py
+++ b/salt/cloud/clouds/vultrpy.py
@@ -284,7 +284,7 @@ def create(vm_):
get_configured_provider(),
__opts__,
search_global=False,
- default=15,
+ default=None,
)
# Bootstrap
|
Change hard_timeout value to avoid use of timeout command
Vultr images seem to have an issue utilizing the timeout command line
util. So change this to not default to using it.
The symptom is that salt-cloud hangs forever in the ssh command that has
timeout set.
Fixes <I>
@cro @techhat
|
saltstack_salt
|
train
|
py
|
6473e3fffffccdd5ea06ee579a28d492f3d52406
|
diff --git a/themes-book/pressbooks-book/functions.php b/themes-book/pressbooks-book/functions.php
index <HASH>..<HASH> 100644
--- a/themes-book/pressbooks-book/functions.php
+++ b/themes-book/pressbooks-book/functions.php
@@ -498,7 +498,7 @@ function pressbooks_theme_pdf_css_override( $scss ) {
}
// a11y Font Size
- if ( isset( $options['pdf_fontsize'] ) ) {
+ if ( @$options['pdf_fontsize'] ) {
if ( ! $sass->isCurrentThemeCompatible( 2 ) ) {
$scss .= 'body { font-size: 1.3em; line-height: 1.3; }' . "\n";
}
|
Only apply increased font size if set _and_ true.
|
pressbooks_pressbooks
|
train
|
php
|
9ead0198b86264c168e4c9dc1188e1c2d530e369
|
diff --git a/test/domain_test.rb b/test/domain_test.rb
index <HASH>..<HASH> 100644
--- a/test/domain_test.rb
+++ b/test/domain_test.rb
@@ -163,7 +163,8 @@ end
class GitHubLdapPosixGroupsWithRecursionFallbackTest < GitHub::Ldap::Test
def self.test_server_options
{
- user_fixtures: FIXTURES.join('github-with-subgroups.ldif').to_s,
+ custom_schemas: FIXTURES.join('posixGroup.schema.ldif'),
+ user_fixtures: FIXTURES.join('github-with-posixGroups.ldif').to_s,
# so we exercise the recursive group search fallback
recursive_group_search_fallback: true
}
@@ -192,7 +193,8 @@ end
class GitHubLdapPosixGroupsTest < GitHub::Ldap::Test
def self.test_server_options
{
- user_fixtures: FIXTURES.join('github-with-subgroups.ldif').to_s,
+ custom_schemas: FIXTURES.join('posixGroup.schema.ldif'),
+ user_fixtures: FIXTURES.join('github-with-posixGroups.ldif').to_s,
# so we test the test the non-recursive group membership search
recursive_group_search_fallback: false
}
|
Use custom schema for posixGroup tests
|
github_github-ldap
|
train
|
rb
|
fa77b2307e7caab69b67757f03e2aebc4f8dbcd6
|
diff --git a/src/Element/Identify.php b/src/Element/Identify.php
index <HASH>..<HASH> 100644
--- a/src/Element/Identify.php
+++ b/src/Element/Identify.php
@@ -21,7 +21,7 @@ trait Identify
*/
public function name() : string
{
- return $this->attributes['name'];
+ return $this->attributes['name'] ?? '';
}
/**
|
might be unset, return empty string in that case
|
monolyth-php_formulaic
|
train
|
php
|
dbfe3bea7b4430c07760051de1ace2fcc7c81cb5
|
diff --git a/digitalocean/Manager.py b/digitalocean/Manager.py
index <HASH>..<HASH> 100644
--- a/digitalocean/Manager.py
+++ b/digitalocean/Manager.py
@@ -178,5 +178,11 @@ class Manager(BaseAPI):
"""
return SSHKey.get_object(api_token=self.token, ssh_key_id=ssh_key_id)
+ def get_action(self, action_id):
+ """
+ Return an Action object by a specific ID.
+ """
+ return Action.get_object(api_token=self.token, action_id=action_id)
+
def __str__(self):
return "%s" % (self.token)
|
Implemented the method to get an Action directly from the Manager #<I>
|
koalalorenzo_python-digitalocean
|
train
|
py
|
4ec214a0c7f56f5178cdad96f30d1050e2747db7
|
diff --git a/glue/ligolw/lsctables.py b/glue/ligolw/lsctables.py
index <HASH>..<HASH> 100644
--- a/glue/ligolw/lsctables.py
+++ b/glue/ligolw/lsctables.py
@@ -480,6 +480,10 @@ class SnglBurstTable(table.Table):
class SnglBurst(object):
__slots__ = SnglBurstTable.validcolumns.keys()
+ #
+ # Tile properties
+ #
+
def get_start(self):
return lal.LIGOTimeGPS(self.start_time, self.start_time_ns)
@@ -514,6 +518,9 @@ class SnglBurst(object):
self.central_freq = (band[0] + band[1])/2.0
self.bandwidth = abs(band)
+ #
+ # "Most significant pixel" properties
+ #
def get_ms_start(self):
return lal.LIGOTimeGPS(self.ms_start_time, self.ms_start_time_ns)
|
Add some comments to SnglBurstTable.
|
gwastro_pycbc-glue
|
train
|
py
|
1bfe5d5adf0162c211de20886fcffff44f819fc5
|
diff --git a/src/Entities/PaymentCard.php b/src/Entities/PaymentCard.php
index <HASH>..<HASH> 100644
--- a/src/Entities/PaymentCard.php
+++ b/src/Entities/PaymentCard.php
@@ -151,4 +151,14 @@ final class PaymentCard extends Entity
{
return $this->getAttribute('createdTime');
}
+
+ /**
+ * @param string $value
+ *
+ * @return $this
+ */
+ public function setCvv($value)
+ {
+ return $this->setAttribute('cvv', $value);
+ }
}
|
Added cvv to PaymentCard
|
Rebilly_rebilly-php
|
train
|
php
|
b3a067d010f8350d7c0d2d377986ddb746f82f05
|
diff --git a/simpycity/core.py b/simpycity/core.py
index <HASH>..<HASH> 100644
--- a/simpycity/core.py
+++ b/simpycity/core.py
@@ -395,6 +395,9 @@ class Function(meta_query):
return "SELECT %s %s %s" % (columns, from_cl, func)
+# enjoys special handling in SimpleModel.__getattribute__
+class Property(Function):
+ pass
class Raw(meta_query):
diff --git a/simpycity/model.py b/simpycity/model.py
index <HASH>..<HASH> 100644
--- a/simpycity/model.py
+++ b/simpycity/model.py
@@ -274,7 +274,11 @@ class SimpleModel(Construct):
rs = attr(*args, **my_args)
d_out("SimpleModel.__getattribute__: attr returned rs of %s" %rs)
return rs
- return instance
+
+ if "Property" in mro:
+ return instance()
+ else:
+ return instance
else:
return attr
|
Add Property query callable: auto-evaluated in model.
|
commandprompt_Simpycity
|
train
|
py,py
|
911a31bc62df4a3fb0ff50730cd0fb0686b23b89
|
diff --git a/test/integration/generated_gtop_test.rb b/test/integration/generated_gtop_test.rb
index <HASH>..<HASH> 100644
--- a/test/integration/generated_gtop_test.rb
+++ b/test/integration/generated_gtop_test.rb
@@ -4,7 +4,11 @@ require 'gir_ffi_test_helper'
# contains types with bad names, like 'glibtop_cpu'.
describe 'The generated GTop module' do
before do
- GirFFI.setup :GTop
+ begin
+ GirFFI.setup :GTop
+ rescue
+ skip 'No GIR data for GTop available'
+ end
end
describe 'Glibtop' do
|
Skip GTop tests if introspection data is missing
|
mvz_gir_ffi
|
train
|
rb
|
08615d85ecf4e6590a1f79eb33e91e42f570878c
|
diff --git a/auto_ml/utils.py b/auto_ml/utils.py
index <HASH>..<HASH> 100644
--- a/auto_ml/utils.py
+++ b/auto_ml/utils.py
@@ -1,6 +1,7 @@
from sklearn.base import BaseEstimator, TransformerMixin
+# originally implemented to be consistent with sklearn's API, but currently used outside of a pipeline
class SplitOutput(BaseEstimator, TransformerMixin):
def __init__(self, output_column_name):
|
adds comment to explain current format of SplitColumn
|
ClimbsRocks_auto_ml
|
train
|
py
|
287e842b654994a324dbbeb92c81d4d33309eb88
|
diff --git a/shoebot/data.py b/shoebot/data.py
index <HASH>..<HASH> 100644
--- a/shoebot/data.py
+++ b/shoebot/data.py
@@ -274,6 +274,17 @@ class BezierPath(Grob, TransformMixin, ColorMixin):
def ellipse(self,x,y,w,h):
self.data.append(PathElement(ELLIPSE,x,y,w,h))
self.closepath()
+
+ ## alternative ellipse implementation, more consistent with nodebox primitives
+ #def ellipse(self,x,y,w,h):
+ #k = 0.5522847498
+ #self.moveto(x,y+h/2)
+ #self.curveto(x,y+(1-k)*h/2,x+(1-k)*w/2,y,x+w/2,y)
+ #self.curveto(x+(1+k)*w/2,y,x+w,y+(1-k)*h/2,x+w,y+h/2)
+ #self.curveto(x+w,y+(1+k)*h/2,x+(1+k)*w/2,y+h,x+w/2,y+h)
+ #self.curveto(x+(1-k)*w/2,y+h,x,y+(1+k)*h/2,x,y+h/2)
+ #self.closepath()
+
def rect(self, x, y, w, h, roundness=0.0, rectmode='corner'):
if not roundness:
self.moveto(x, y)
|
added in data.py an alternative ellipse implementation, that uses pure curveto calls, and is more consistent with nodebox way of making oval primitives. I kept it commented out anyway, as it could be useful as a tip once we want to implement boolean operations on paths but for now it doesn't make any difference and may even slow the code
|
shoebot_shoebot
|
train
|
py
|
91fa24101ff0efc8f095ac8f1be81821a08402ad
|
diff --git a/src/Illuminate/Database/Schema/PostgresBuilder.php b/src/Illuminate/Database/Schema/PostgresBuilder.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Database/Schema/PostgresBuilder.php
+++ b/src/Illuminate/Database/Schema/PostgresBuilder.php
@@ -30,7 +30,7 @@ class PostgresBuilder extends Builder
{
$tables = [];
- $excludedTables = ['spatial_ref_sys'];
+ $excludedTables = $this->connection->getConfig('excluded_drop_tables') ?? ['spatial_ref_sys'];
foreach ($this->getAllTables() as $row) {
$row = (array) $row;
|
Exposed the ability to exclude tables from being dropped via config parameters
|
laravel_framework
|
train
|
php
|
781b39027a1156250eaa85da82dd84c084bac221
|
diff --git a/api/unitassigner/unitassigner_test.go b/api/unitassigner/unitassigner_test.go
index <HASH>..<HASH> 100644
--- a/api/unitassigner/unitassigner_test.go
+++ b/api/unitassigner/unitassigner_test.go
@@ -115,11 +115,20 @@ type fakeWatchCaller struct {
func (f *fakeWatchCaller) APICall(objType string, version int, id, request string, param, response interface{}) error {
f.Lock()
defer f.Unlock()
- f.request = request
- f.params = param
- _, ok := response.(*params.StringsWatchResult)
- if !ok {
- f.c.Errorf("Expected *params.StringsWatchResult as response, but was %#v", response)
+
+ // We only care for the first request as that is all the tests
+ // assert on. The watcher (StringsWatcher) is continuously
+ // running and this function gets called repeatedly
+ // overwriting f.request leading to intermittent failures.
+ // Fixes: https://bugs.launchpad.net/juju/+bug/1606302
+
+ if f.request == "" {
+ f.request = request
+ f.params = param
+ _, ok := response.(*params.StringsWatchResult)
+ if !ok {
+ f.c.Errorf("Expected *params.StringsWatchResult as response, but was %#v", response)
+ }
}
return f.err
}
|
api/unitassigner: fix intermittent test failure
The TestWatchUnitAssignment unit test was failing intermittently because
the test assumed that the underlying StringsWatcher would only run once.
When the watcher runs more than once the f.request field gets
overwritten triggering the assertion failure.
Fixes [LP:#<I>](<URL>)
|
juju_juju
|
train
|
go
|
537133c1853fd481d8a5799a127fef90b9f61e8a
|
diff --git a/src/commands/accesslogs.js b/src/commands/accesslogs.js
index <HASH>..<HASH> 100644
--- a/src/commands/accesslogs.js
+++ b/src/commands/accesslogs.js
@@ -7,6 +7,7 @@ const { ONE_HOUR, toTimestamp } = require('@clevercloud/client/cjs/utils/date.js
const Addon = require('../models/addon.js');
const AppConfig = require('../models/app_configuration.js');
const Logger = require('../logger.js');
+const User = require('../models/user.js');
const { getFormatter } = require('../models/accesslogs.js');
const { sendToApi, sendToWarp10 } = require('../models/send-to-api.js');
@@ -46,8 +47,14 @@ async function getIds (addonId, alias) {
};
}
const appConfig = await AppConfig.getAppData(alias).toPromise();
+ if (appConfig.org_id != null) {
+ return {
+ orgaId: appConfig.org_id,
+ appId: appConfig.app_id,
+ };
+ }
return {
- orgaId: appConfig.org_id,
+ orgaId: await User.getCurrentId(),
appId: appConfig.app_id,
};
}
|
Fix accesslogs with app in personal orga
|
CleverCloud_clever-tools
|
train
|
js
|
7dbf67f8cf7977a00d9b1c962506f1f04f89c5dc
|
diff --git a/Accessor.php b/Accessor.php
index <HASH>..<HASH> 100644
--- a/Accessor.php
+++ b/Accessor.php
@@ -4,6 +4,7 @@ namespace Modulus\Utility;
use Modulus\Directives\Csrf;
use Modulus\Directives\Using;
+use Modulus\Directives\Partial;
use Modulus\Utility\GlobalVariables;
use App\Resolvers\DirectivesResolver;
use AtlantisPHP\Medusa\Template as Medusa;
@@ -66,6 +67,7 @@ class Accessor
$medusa->setViewsDirectory(self::$viewsDirectory);
$medusa->setViewsExtension(self::$viewsExtension);
+ $medusa->register(Partial::class);
$medusa->register(Using::class);
$medusa->register(Csrf::class);
$medusa->register(ConfigToJsonString::class);
@@ -93,4 +95,4 @@ class Accessor
return self::$viewComponent->view($path, $data);
}
-}
\ No newline at end of file
+}
|
Feat: added partials directive
Added a new directive
|
modulusphp_utility
|
train
|
php
|
cb95a6e852e4ad831437d63af1625ec5e8f8535b
|
diff --git a/base/src/main/java/uk/ac/ebi/atlas/experimentpage/baseline/BaselineProfilesHeatMap.java b/base/src/main/java/uk/ac/ebi/atlas/experimentpage/baseline/BaselineProfilesHeatMap.java
index <HASH>..<HASH> 100644
--- a/base/src/main/java/uk/ac/ebi/atlas/experimentpage/baseline/BaselineProfilesHeatMap.java
+++ b/base/src/main/java/uk/ac/ebi/atlas/experimentpage/baseline/BaselineProfilesHeatMap.java
@@ -64,6 +64,7 @@ public class BaselineProfilesHeatMap {
geneQueryResponse.getAllGeneIds().size(), asGeneSets,
stopwatch.elapsed(TimeUnit.MILLISECONDS) / 1000D);
+ profiles.setTotalResultCount(profiles.size());
return profiles;
}
|
Set total result count in the most ridiculous way possible (probably we could do without this property, as far as I’m aware it’s not used anywhere and if needed it could be the size of the wrapped collection)
|
ebi-gene-expression-group_atlas
|
train
|
java
|
14fe5d12b6510e0d6b2b35c70564700dec357b24
|
diff --git a/lib/ronin/platform/extension.rb b/lib/ronin/platform/extension.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/platform/extension.rb
+++ b/lib/ronin/platform/extension.rb
@@ -106,11 +106,11 @@ module Ronin
# instance_eval the extension block
context_block = Extension.load_context_block(path)
+ @paths << path
+
if context_block
catch_all { instance_eval(&context_block) }
end
-
- @paths << path
end
return true
|
Add the path to Extension#paths before loading it, to prevent circular includes.
|
ronin-ruby_ronin
|
train
|
rb
|
4266a61285776ecef87706adf91ceed8b7d7cfbb
|
diff --git a/actionview/lib/action_view/railtie.rb b/actionview/lib/action_view/railtie.rb
index <HASH>..<HASH> 100644
--- a/actionview/lib/action_view/railtie.rb
+++ b/actionview/lib/action_view/railtie.rb
@@ -37,7 +37,7 @@ module ActionView
end
end
- initializer "action_view.collection_caching" do |app|
+ initializer "action_view.collection_caching", after: "action_controller.set_configs" do |app|
ActiveSupport.on_load(:action_controller) do
PartialRenderer.collection_cache = app.config.action_controller.cache_store
end
|
make the collection_caching initializer run after the Action Controller configs are setup
|
rails_rails
|
train
|
rb
|
c52e6921115c4b4d625034b828d5d23eb1ebaeb6
|
diff --git a/kytos/utils/napps.py b/kytos/utils/napps.py
index <HASH>..<HASH> 100644
--- a/kytos/utils/napps.py
+++ b/kytos/utils/napps.py
@@ -464,7 +464,11 @@ class NAppsManager:
package that will be POSTed to the napp server.
"""
- files = os.listdir()
+ files = []
+ path = '/'.join(os.path.abspath(__file__).split('/')[:-1])+'/'
+ for (dirpath, dirnames, filenames) in os.walk(path):
+ files.extend([dirpath +'/'+ file for file in filenames])
+
ignored_files = [".git"]
with open(".gitignore", 'r') as kytosignore:
for line in kytosignore:
|
Updating how ignore files on napps
|
kytos_kytos-utils
|
train
|
py
|
20dc7f2a24f62409201ceec76439685b69091ee6
|
diff --git a/Ys.js b/Ys.js
index <HASH>..<HASH> 100644
--- a/Ys.js
+++ b/Ys.js
@@ -172,6 +172,9 @@ var handle_request = function(req,res){
if(typeof(route[HANDLERS][req.method.toLowerCase()])==="undefined")
continue;
+ if(match.length > 1)
+ req.$1 = match[1];
+
var handler = route[HANDLERS][req.method.toLowerCase()];
if(typeof(handler)==="function"){
handler(req,res);
|
added access to one matched group in URL from request
|
nabriski_Ys
|
train
|
js
|
8c4e08508f140ce06b6c914fa72ac47d63a839b6
|
diff --git a/pypresence/baseclient.py b/pypresence/baseclient.py
index <HASH>..<HASH> 100644
--- a/pypresence/baseclient.py
+++ b/pypresence/baseclient.py
@@ -113,6 +113,9 @@ class BaseClient:
if isinstance(payload, Payload):
payload = payload.data
payload = json.dumps(payload)
+
+ assert self.sock_writer is not None, "You must connect your client before sending events!"
+
self.sock_writer.write(
struct.pack(
'<II',
|
fix common misconception about having to connect client first
|
qwertyquerty_pypresence
|
train
|
py
|
88a1fbf68548aab5abc88d511784d274d73ea749
|
diff --git a/jax/interpreters/xla.py b/jax/interpreters/xla.py
index <HASH>..<HASH> 100644
--- a/jax/interpreters/xla.py
+++ b/jax/interpreters/xla.py
@@ -266,7 +266,15 @@ def _jaxpr_computation(jaxpr, backend, axis_env, const_vals, freevar_shapes, *ar
_map(write, jaxpr.invars, map(c.ParameterWithShape, arg_shapes))
_prefetch_jaxpr_literals(jaxpr)
for eqn in jaxpr.eqns:
- eqn.params.pop('backend', None)
+ # For nested jits, the outer jit sets the backend on all inner jits unless
+ # an inner-jit also has a conflicting explicit backend specification.
+ inner_backend = eqn.params.pop('backend', None)
+ if inner_backend and inner_backend != backend:
+ msg = (
+ "Explicit outer-jit backend specification {} must match"
+ "explicit inner-jit backend specification {}.")
+ raise ValueError(msg.format(backend, inner_backend))
+
if not eqn.restructure:
in_nodes = list(map(read, eqn.invars))
else:
|
Error on nested conflicting explicit jit backend specifications.
|
tensorflow_probability
|
train
|
py
|
8db2973aca2b895ea425938f61bf565ba16f8299
|
diff --git a/tests/gitlab_test.py b/tests/gitlab_test.py
index <HASH>..<HASH> 100644
--- a/tests/gitlab_test.py
+++ b/tests/gitlab_test.py
@@ -30,7 +30,7 @@ class UsersTest(unittest.TestCase):
# get X pages
assert isinstance(git.getusers(page=2), list) # compatible with 2.6
assert isinstance(git.getusers(per_page=4), list) # compatible with 2.6
- self.assertIsNotNone(git.getusers(page=7)) # check against false
+ self.assertEqual(git.getusers(page=800), list("")) # check against false
self.assertTrue(git.getusers(per_page=43)) # check against false
def testcurrentuser(self):
|
fixed again for python <I>
|
pyapi-gitlab_pyapi-gitlab
|
train
|
py
|
ccdc335bc1d30d958e56242e81340e93c992cb29
|
diff --git a/api/models/index.js b/api/models/index.js
index <HASH>..<HASH> 100644
--- a/api/models/index.js
+++ b/api/models/index.js
@@ -1,7 +1,3 @@
-var util = require('../fin/util'),
- map = util.map,
- bind = util.bind
-
// nothing here yet :)
var customModels = module.exports = {
process: process
@@ -41,7 +37,6 @@ var _createModelConstructor = function(modelName, modelDescription) {
}
modelConstructor.prototype = CustomModelPrototype
modelConstructor.description = modelDescription
- modelConstructor.properties = map(modelDescription, function(propDescr) { return propDescr.id })
}
var CustomModelPrototype = {
|
Turns out we don't need properties to be defined by themselves, and therefore not bind either. We can also do without bind, so let's just scrap all of util
|
marcuswestin_fin
|
train
|
js
|
2b7b136e0a01f8beb19d31571934db5a98774c87
|
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -16,7 +16,7 @@ module ActionDispatch
:shallow, :blocks, :defaults, :options]
class Constraints #:nodoc:
- def self.new(app, constraints, request = Rack::Request)
+ def self.new(app, constraints, request)
if constraints.any?
super(app, constraints, request)
else
|
default value is never used, so make it required
|
rails_rails
|
train
|
rb
|
ba21c435bdc9bed1ec72cc1f20fa769f56f53f18
|
diff --git a/test/extractRbnfFunctionByType.js b/test/extractRbnfFunctionByType.js
index <HASH>..<HASH> 100644
--- a/test/extractRbnfFunctionByType.js
+++ b/test/extractRbnfFunctionByType.js
@@ -169,7 +169,7 @@ describe('extractRbnfFunctionByType', () => {
.renderSpelloutNumbering(2439871)
.replace(/\u00ad/g, ''),
'to equal',
- 'to millioner firehundrede og niogtredive tusinde ottehundrede og enoghalvfjerds'
+ 'to millioner firehundrede og niogtredive tusind ottehundrede og enoghalvfjerds'
);
});
|
Update expected Danish spellout cardinal string
|
papandreou_node-cldr
|
train
|
js
|
5b397e08e6827e7819f0d34eaf8ba2530188e787
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -0,0 +1,20 @@
+from distutils.core import setup
+
+setup(
+ name='django-gravatar',
+ version='0.1.0',
+ description='Basic Gravatar support with helper methods and templatetags.',
+ author='Tristan Waddington',
+ author_email='[email protected]',
+ url='https://github.com/twaddington/django-gravatar',
+ packages=['django_gravatar', 'django_gravatar.templatetags'],
+ classifiers=[
+ 'Development Status :: 3 - Alpha', # 4 Beta, 5 Production/Stable
+ 'Environment :: Web Environment',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: MIT License',
+ 'Operating System :: OS Independent',
+ 'Programming Language :: Python',
+ 'Framework :: Django',
+ ]
+)
|
Updated setup.py script.
|
twaddington_django-gravatar
|
train
|
py
|
363eed068ad0380c9744299525f70253415861d2
|
diff --git a/benchexec/tools/ultimate.py b/benchexec/tools/ultimate.py
index <HASH>..<HASH> 100644
--- a/benchexec/tools/ultimate.py
+++ b/benchexec/tools/ultimate.py
@@ -64,7 +64,10 @@ class UltimateTool(benchexec.tools.template.BaseTool):
status = result.RESULT_UNKNOWN
break
elif line.startswith('ERROR'):
- status = 'ERROR'
+ if line.startswith('ERROR: INVALID WITNESS FILE'):
+ status = line
+ else:
+ status = 'ERROR'
break
return status
|
recognize invalid witness and produce appropriate result (change string at your convenience for compatibility with other witness validators)
|
sosy-lab_benchexec
|
train
|
py
|
372ed35d980df334ab3e1fea3c22bfa765b24e00
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -21,7 +21,7 @@ module.exports = {
var outputPath = this.readConfig('outputPath');
var buildEnv = this.readConfig('environment');
- var Builder = require('ember-cli/lib/models/builder');
+ var Builder = this.project.require('ember-cli/lib/models/builder');
var builder = new Builder({
ui: this.ui,
outputPath: outputPath,
diff --git a/tests/unit/index-nodetest.js b/tests/unit/index-nodetest.js
index <HASH>..<HASH> 100644
--- a/tests/unit/index-nodetest.js
+++ b/tests/unit/index-nodetest.js
@@ -111,7 +111,12 @@ describe('build plugin', function() {
context = {
ui: mockUi,
- project: { name: function() { return 'test-project'; }, addons: [], root: 'tests/dummy' },
+ project: {
+ name: function() { return 'test-project'; },
+ require: function(mod) { return require(mod); },
+ addons: [],
+ root: 'tests/dummy'
+ },
config: {
build: {
buildEnv: 'development',
|
Ensure we are using the Builder from the project's version of ember-cli
In an `npm link` situation, the way we were requiring builder would load the builder
from the devDepencies of this plugin, which can be a problem if it is not the same
as the project's version.
|
martinic_ember-cli-deploy-build-plus
|
train
|
js,js
|
90d95e2c7417260037417e1d653fa28b4f6974ef
|
diff --git a/src/Illuminate/Database/Connectors/MySqlConnector.php b/src/Illuminate/Database/Connectors/MySqlConnector.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Database/Connectors/MySqlConnector.php
+++ b/src/Illuminate/Database/Connectors/MySqlConnector.php
@@ -23,7 +23,7 @@ class MySqlConnector extends Connector implements ConnectorInterface
// connection's behavior, and some might be specified by the developers.
$connection = $this->createConnection($dsn, $config, $options);
- if (isset($config['database'])) {
+ if (! empty($config['database'])) {
$connection->exec("use `{$config['database']}`;");
}
|
Update MySqlConnector.php (#<I>)
|
laravel_framework
|
train
|
php
|
3761a2cbefdd2f9cc3c8ea7b5d0369ddd6003d8c
|
diff --git a/tests/laser/smt/independece_solver_test.py b/tests/laser/smt/independece_solver_test.py
index <HASH>..<HASH> 100644
--- a/tests/laser/smt/independece_solver_test.py
+++ b/tests/laser/smt/independece_solver_test.py
@@ -73,12 +73,14 @@ def test_dependence_map():
assert x in dependence_map.buckets[0].variables
assert y in dependence_map.buckets[0].variables
assert z in dependence_map.buckets[0].variables
+ assert len(set(dependence_map.buckets[0].variables)) == 3
assert conditions[0] in dependence_map.buckets[0].conditions
assert conditions[1] in dependence_map.buckets[0].conditions
assert a in dependence_map.buckets[1].variables
assert b in dependence_map.buckets[1].variables
+ assert len(set(dependence_map.buckets[1].variables)) == 2
assert conditions[2] in dependence_map.buckets[1].conditions
|
add check to tests
This ensures that not only the variables are in the list, but they
are the only variables in that list
|
ConsenSys_mythril-classic
|
train
|
py
|
8cd47dc5cb493fe14ecc96d8108cb28cdc6cc498
|
diff --git a/abydos/tests/test_util.py b/abydos/tests/test_util.py
index <HASH>..<HASH> 100644
--- a/abydos/tests/test_util.py
+++ b/abydos/tests/test_util.py
@@ -303,6 +303,8 @@ class RationalTestCases(unittest.TestCase):
self.assertEqual(Rational(3)/2, Rational(3, 2))
self.assertEqual(2/Rational(3), Rational(2, 3))
self.assertEqual(Rational(3).__rtruediv__(2), Rational(2, 3))
+ self.assertEqual(Rational(3).__rdiv__(2), Rational(2, 3))
+ self.assertEqual(Rational(3).__div__(2), Rational(3, 2))
# **
self.assertEqual(Rational(1, 2)**2, Rational(1, 4))
|
added some specific tests targeting different division calls (useful for testing coverage in Python3)
|
chrislit_abydos
|
train
|
py
|
b87ef60dd8d0eed0bfd5002ec40074ca6d148d6c
|
diff --git a/jaraco/itertools.py b/jaraco/itertools.py
index <HASH>..<HASH> 100644
--- a/jaraco/itertools.py
+++ b/jaraco/itertools.py
@@ -172,6 +172,11 @@ class Count(object):
>>> unl_c = Count(None)
>>> inf_c = Count(float('Inf'))
+ Unlimited or limited by infinity are equivalent.
+
+ >>> unl_c == inf_c
+ True
+
An unlimited counter is useful for wrapping an iterable to get the
count after it's consumed.
@@ -196,6 +201,10 @@ class Count(object):
else:
return 'all'
+ def __eq__(self, other):
+ return vars(self) == vars(other)
+
+
class islice(object):
"""May be applied to an iterable to limit the number of items returned.
Works similarly to count, except is called only once on an iterable.
|
Explicitly make unlimited counters equivalent and allow them to be compared.
|
jaraco_jaraco.itertools
|
train
|
py
|
39914db679b008d7400a165b974f5d7ceec19e1f
|
diff --git a/libcontainer/process_linux.go b/libcontainer/process_linux.go
index <HASH>..<HASH> 100644
--- a/libcontainer/process_linux.go
+++ b/libcontainer/process_linux.go
@@ -124,9 +124,9 @@ func (p *setnsProcess) start() (retErr error) {
if err := p.execSetns(); err != nil {
return fmt.Errorf("error executing setns process: %w", err)
}
- if len(p.cgroupPaths) > 0 {
- if err := cgroups.EnterPid(p.cgroupPaths, p.pid()); err != nil && !p.rootlessCgroups {
- // On cgroup v2 + nesting + domain controllers, EnterPid may fail with EBUSY.
+ for _, path := range p.cgroupPaths {
+ if err := cgroups.WriteCgroupProc(path, p.pid()); err != nil && !p.rootlessCgroups {
+ // On cgroup v2 + nesting + domain controllers, WriteCgroupProc may fail with EBUSY.
// https://github.com/opencontainers/runc/issues/2356#issuecomment-621277643
// Try to join the cgroup of InitProcessPid.
if cgroups.IsCgroup2UnifiedMode() {
|
runc exec: don't skip non-existing cgroups
The function used here, cgroups.EnterPid, silently skips non-existing
paths, and it does not look like a good idea to do so for an existing
container with already configured cgroups.
Switch to cgroups.WriteCgroupProc which does not do that, so in case
a cgroup does not exist, we'll get an error.
|
opencontainers_runc
|
train
|
go
|
0dcc820fe6b8c46da677dfd9574d80186c2150a1
|
diff --git a/lib/less/browser.js b/lib/less/browser.js
index <HASH>..<HASH> 100644
--- a/lib/less/browser.js
+++ b/lib/less/browser.js
@@ -22,6 +22,8 @@ less.watch = function () { return this.watchMode = true };
less.unwatch = function () { return this.watchMode = false };
if (less.env === 'development') {
+ less.optimization = 0;
+
if (/!watch/.test(location.hash)) {
less.watch();
}
@@ -34,6 +36,8 @@ if (less.env === 'development') {
});
}
}, 1000);
+} else {
+ less.optimization = 3;
}
@@ -78,7 +82,9 @@ function loadStyleSheet(sheet, callback, async) {
callback(null, sheet, { local: true });
} else {
// Use remote copy (re-parse)
- new(less.Parser)({ optimization: 3 }).parse(data, function (e, root) {
+ new(less.Parser)({
+ optimization: less.optimization
+ }).parse(data, function (e, root) {
if (e) { return error(e, sheet.href) }
try {
callback(root, sheet, { local: false, lastModified: lastModified });
|
set optimization level depending on less.env
|
less_less.js
|
train
|
js
|
33195e3f320600ca518597fa94be067f59d30a5f
|
diff --git a/wes_service/toil_wes.py b/wes_service/toil_wes.py
index <HASH>..<HASH> 100644
--- a/wes_service/toil_wes.py
+++ b/wes_service/toil_wes.py
@@ -71,9 +71,15 @@ class ToilWorkflow(object):
# link the cwl and json into the cwd
if workflow_url.startswith("file://"):
- os.link(workflow_url[7:], os.path.join(cwd, "wes_workflow." + wftype))
+ try:
+ os.link(workflow_url[7:], os.path.join(cwd, "wes_workflow." + wftype))
+ except OSError:
+ os.symlink(workflow_url[7:], os.path.join(cwd, "wes_workflow." + wftype))
workflow_url = os.path.join(cwd, "wes_workflow." + wftype)
- os.link(self.input_json, os.path.join(cwd, "wes_input.json"))
+ try:
+ os.link(self.input_json, os.path.join(cwd, "wes_input.json"))
+ except OSError:
+ os.symlink(self.input_json, os.path.join(cwd, "wes_input.json"))
self.input_json = os.path.join(cwd, "wes_input.json")
extra_options = self.sort_toil_options(opts.getoptlist("extra"))
|
cope with /tmp being on a different device
|
common-workflow-language_workflow-service
|
train
|
py
|
aef8af6e6b9ee9301a352c227482891fb1c94f8c
|
diff --git a/resources/provision/ses.js b/resources/provision/ses.js
index <HASH>..<HASH> 100644
--- a/resources/provision/ses.js
+++ b/resources/provision/ses.js
@@ -80,13 +80,13 @@ exports.handler = function(event, context) {
// Then delete any of the old rules
tasks[1] = _.partial(convergeRuleSetStateDelete, sns, oldRules);
+ // And delete any of the new rules
+ tasks[2] = _.partial(convergeRuleSetStateDelete, sns, newRules);
- if (event.RequestType === 'Delete') {
- tasks[2] = _.partial(convergeRuleSetStateDelete, sns, newRules);
- } else {
- tasks[2] = _.partial(convergeRuleSetStateCreate, sns, newRules);
+ // Create any new ones?
+ if (event.RequestType !== 'Delete') {
+ tasks[3] = _.partial(convergeRuleSetStateCreate, sns, newRules);
}
-
var onResult = function(e, response) {
responseData.error = e ? e.toString() : undefined;
var status = e ? cfnResponse.FAILED : cfnResponse.SUCCESS;
|
Fix latent bug where SES-based rules weren't properly updated during stack updates
|
mweagle_Sparta
|
train
|
js
|
877c0fc973680e6dcfcd64f8d67d832eaceebd55
|
diff --git a/karma-ng.conf.js b/karma-ng.conf.js
index <HASH>..<HASH> 100644
--- a/karma-ng.conf.js
+++ b/karma-ng.conf.js
@@ -199,10 +199,6 @@ function makeConfig(packageName, argv) {
'*.ciscospark.com'
],
tunnelDomains: [
- 'whistler-prod.onint.ciscospark.com',
- 'whistler.onint.ciscospark.com',
- 'internal-testing-services.wbx2.com',
- 'calendar-whistler.onint.ciscospark.com',
'127.0.0.1',
'localhost'
],
diff --git a/wdio.conf.js b/wdio.conf.js
index <HASH>..<HASH> 100644
--- a/wdio.conf.js
+++ b/wdio.conf.js
@@ -513,10 +513,6 @@ exports.config = {
'*.ciscospark.com'
],
tunnelDomains: [
- 'whistler-prod.onint.ciscospark.com',
- 'whistler.onint.ciscospark.com',
- 'internal-testing-services.wbx2.com',
- 'calendar-whistler.onint.ciscospark.com',
'127.0.0.1',
'localhost'
],
|
chore(saucelabs): tunnelDomain fixup [skip ci]
|
webex_spark-js-sdk
|
train
|
js,js
|
348884315688f75123ee5118ab870efa020a65f3
|
diff --git a/dipper/models/assoc/G2PAssoc.py b/dipper/models/assoc/G2PAssoc.py
index <HASH>..<HASH> 100644
--- a/dipper/models/assoc/G2PAssoc.py
+++ b/dipper/models/assoc/G2PAssoc.py
@@ -62,7 +62,7 @@ class G2PAssoc(Assoc):
return
- def add_association_to_graph(self, g):
+ def add_association_to_graph(self, g, nobnodes=False):
"""
The reified relationship between a genotype (or any genotype part) and a phenotype
is decorated with some provenance information.
@@ -79,7 +79,8 @@ class G2PAssoc(Assoc):
if self.start_stage_id or self.end_stage_id is not None:
stage_process_id = '-'.join((str(self.start_stage_id), str(self.end_stage_id)))
stage_process_id = '_'+re.sub(':', '', stage_process_id)
- # TODO deal with nobnodes
+ if nobnodes:
+ stage_process_id = ':'+stage_process_id
self.gu.addIndividualToGraph(g, stage_process_id, None,
self.g2p_types['developmental_process'])
self.gu.addTriple(g, stage_process_id,
|
enable adding composite stage as nobnode
|
monarch-initiative_dipper
|
train
|
py
|
eda3612ed116c4e53f2095f33a27afa4e0dafbf7
|
diff --git a/src/FileManager.php b/src/FileManager.php
index <HASH>..<HASH> 100644
--- a/src/FileManager.php
+++ b/src/FileManager.php
@@ -38,7 +38,7 @@ class FileManager
$this->fs = $fs;
$this->autoloaderUtil = $autoloaderUtil;
$this->rootDirectory = rtrim($this->realPath($this->normalizeSlashes($rootDirectory)), '/');
- $this->twigDefaultPath = $twigDefaultPath ? $this->relativizePath($twigDefaultPath) : null;
+ $this->twigDefaultPath = $twigDefaultPath ? rtrim($this->relativizePath($twigDefaultPath), '/') : null;
}
public function setIO(SymfonyStyle $io)
|
trimming paths to avoid extra slashes
|
symfony_maker-bundle
|
train
|
php
|
2ed4a0cf55adae1260676704b089271ef3dd0b44
|
diff --git a/gwpy/timeseries/core.py b/gwpy/timeseries/core.py
index <HASH>..<HASH> 100644
--- a/gwpy/timeseries/core.py
+++ b/gwpy/timeseries/core.py
@@ -771,17 +771,18 @@ class TimeSeriesBaseDict(OrderedDict):
end='\r')
if i == nsteps:
gprint('')
- # pad to end of request if required
- if iend < float(end):
- dt = float(end) - float(iend)
- for channel in out:
- nsamp = dt * out[channel].sample_rate.value
- out[channel].append(
- numpy.ones(nsamp, dtype=out[channel].dtype) * pad)
- # match request exactly
+
+ # pad to end of request if required
+ if len(qsegs) and iend < float(end):
+ dt = float(end) - float(iend)
for channel in out:
- if istart > start or iend < end:
- out[channel] = out[channel].crop(start, end)
+ nsamp = dt * out[channel].sample_rate.value
+ out[channel].append(
+ numpy.ones(nsamp, dtype=out[channel].dtype) * pad)
+ # match request exactly
+ for channel in out:
+ if istart > start or iend < end:
+ out[channel] = out[channel].crop(start, end)
if verbose:
gprint('Success.')
|
TimeSeriesBaseDict.fetch: fixed bug in pad segments
This commit fixes a bug whereby a multi-segment fetch (via `pad=xxx`) would raise a ValueError
|
gwpy_gwpy
|
train
|
py
|
8e1eb94c87705f8fb871ca2c9c66efc8bdd40701
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -73,7 +73,7 @@ module.exports = function (remoteApi, localApi, serializer) {
if (data.type == 'source') {
if(!hasSource(name))
- return stream.write(null, new Error('no source:'+name))
+ return stream.destroy(new Error('no source:'+name))
var source, sink = pullWeird.sink(stream)
try {
@@ -85,7 +85,7 @@ module.exports = function (remoteApi, localApi, serializer) {
}
else if (data.type == 'sink') {
if(!hasSink(name))
- return stream.write(null, new Error('no sink:'+name))
+ return stream.destroy(new Error('no sink:'+name))
var sink, source = pullWeird.source(stream)
try {
@@ -97,7 +97,7 @@ module.exports = function (remoteApi, localApi, serializer) {
}
else if (data.type == 'duplex') {
if(!hasDuplex(name))
- return stream.write(null, new Error('no duplex:'+name))
+ return stream.destroy(new Error('no duplex:'+name))
var s1 = pullWeird(stream)
try {
|
use stream.destroy to kill a stream
|
ssbc_muxrpc
|
train
|
js
|
96e1fdf426b70cd8f9fd320620ffff5886e05784
|
diff --git a/lib/upgradelib.php b/lib/upgradelib.php
index <HASH>..<HASH> 100644
--- a/lib/upgradelib.php
+++ b/lib/upgradelib.php
@@ -920,6 +920,8 @@ function external_delete_descriptions($component) {
* upgrade logging functions
*/
function upgrade_handle_exception($ex, $plugin = null) {
+ global $CFG;
+
// rollback everything, we need to log all upgrade problems
abort_all_db_transactions();
|
missing global preventing full debug during upgrade as was planned
|
moodle_moodle
|
train
|
php
|
890552c69d2a690a0fbbedb6c0b12be7ecb22ca0
|
diff --git a/includes/DHL_Receiver.php b/includes/DHL_Receiver.php
index <HASH>..<HASH> 100644
--- a/includes/DHL_Receiver.php
+++ b/includes/DHL_Receiver.php
@@ -4,8 +4,8 @@
* Authors-Website: http://petschko.org/
* Date: 28.01.2017
* Time: 19:17
- * Update: -
- * Version: 0.0.1
+ * Update: 20.03.2017
+ * Version: 1.0.0
*
* Notes: Contains the DHL_Receiver class
*/
@@ -14,6 +14,19 @@
* Class DHL_Receiver
*/
class DHL_Receiver extends DHL_SendPerson {
+ /**
+ * DHL_Receiver constructor.
+ */
+ public function __construct() {
+ parent::__construct();
+ }
+
+ /**
+ * Clears Memory
+ */
+ public function __destruct() {
+ parent::__destruct();
+ }
/**
* Returns a Class for the DHL-SendPerson
|
Added dummy constructor & destructor
|
Petschko_dhl-php-sdk
|
train
|
php
|
30b18e7bbd3ffd15e20947afec486a4295c05272
|
diff --git a/src/main/java/net/seninp/gi/tinker/Evaluator.java b/src/main/java/net/seninp/gi/tinker/Evaluator.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/seninp/gi/tinker/Evaluator.java
+++ b/src/main/java/net/seninp/gi/tinker/Evaluator.java
@@ -75,8 +75,9 @@ public class Evaluator {
NumerosityReductionStrategy.EXACT, 0.01);
RePairGrammar grammar = RePairFactory.buildGrammar(saxData);
- GrammarRules rules = grammar.toGrammarRulesData();
+ grammar.expandRules();
grammar.buildIntervals(saxData, series, w);
+ GrammarRules rules = grammar.toGrammarRulesData();
GrammarRules prunedRules = RulePrunerFactory.performPruning(series, rules);
|
fixing the sampler [ci skip]
|
jMotif_GI
|
train
|
java
|
ebe6903e45f8716599c4e13c8ad27d5ca0dc1988
|
diff --git a/querydsl-core/src/main/java/com/mysema/query/ResultTransformer.java b/querydsl-core/src/main/java/com/mysema/query/ResultTransformer.java
index <HASH>..<HASH> 100644
--- a/querydsl-core/src/main/java/com/mysema/query/ResultTransformer.java
+++ b/querydsl-core/src/main/java/com/mysema/query/ResultTransformer.java
@@ -1,6 +1,19 @@
+/*
+ * Copyright (c) 2010 Mysema Ltd.
+ * All rights reserved.
+ *
+ */
package com.mysema.query;
-
+/**
+ * Executes query on a Projectable and transforms results into T. This can be used for example
+ * to group projected columns or to filter out duplicate results.
+ *
+ * @see com.mysema.query.support.GroupBy
+ * @author sasa
+ *
+ * @param <T> Transformations target type
+ */
public interface ResultTransformer<T> {
public T transform(Projectable projectable);
|
Added javadocs to ResultTransformer
|
querydsl_querydsl
|
train
|
java
|
8f24f171cd424f1e7a4a32e13bad007f0e9c6531
|
diff --git a/lib/Handler.php b/lib/Handler.php
index <HASH>..<HASH> 100644
--- a/lib/Handler.php
+++ b/lib/Handler.php
@@ -10,6 +10,7 @@
*/
namespace EzSystems\EzPlatformSolrSearchEngine;
+use eZ\Publish\API\Repository\SearchService;
use eZ\Publish\SPI\Persistence\Content;
use eZ\Publish\SPI\Persistence\Content\Location;
use eZ\Publish\SPI\Persistence\Content\Handler as ContentHandler;
@@ -446,11 +447,17 @@ class Handler implements SearchHandlerInterface, Capable
public function supports($capabilityFlag)
{
- // @todo change to use constants once we require 6.12 and higher (or change if constants are backported to 6.7)
- if ($capabilityFlag < 8 || $capabilityFlag === 64) {
- return true;
+ switch ($capabilityFlag) {
+ case SearchService::CAPABILITY_SCORING:
+ case SearchService::CAPABILITY_FACETS:
+ case SearchService::CAPABILITY_CUSTOM_FIELDS:
+ //case SearchService::CAPABILITY_SPELLCHECK:
+ //case SearchService::CAPABILITY_HIGHLIGHT:
+ //case SearchService::CAPABILITY_SUGGEST:
+ case SearchService::CAPABILITY_ADVANCED_FULLTEXT:
+ return true;
+ default:
+ return false;
}
-
- return false;
}
}
|
EZP-<I>: Take advantage of capability constants on <I>+
For cleaner code, also easier to see what is not implemented.
|
ezsystems_ezplatform-solr-search-engine
|
train
|
php
|
eab3bb31c69f9072047a4c446b419522c23a9e9b
|
diff --git a/src/server.js b/src/server.js
index <HASH>..<HASH> 100755
--- a/src/server.js
+++ b/src/server.js
@@ -211,7 +211,6 @@ export default class Renderer {
if (err) {
console.error(err);
}
- console.info('----\n==> ✅ %s is running.', config.app.title);
console.info('==> 💻 Open http://%s:%s in a browser to view the app.', config.server.host, config.server.port);
});
}
|
do not rely on app in config anymore
|
bdefore_universal-redux
|
train
|
js
|
61f824798c65b00721bda812228c5357e83bbcd7
|
diff --git a/karma.conf.js b/karma.conf.js
index <HASH>..<HASH> 100644
--- a/karma.conf.js
+++ b/karma.conf.js
@@ -34,7 +34,7 @@ colors = true;
// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
-logLevel = LOG_DEBUG;
+logLevel = LOG_INFO;
// enable / disable watching file and executing tests whenever any file changes
autoWatch = true;
|
test: Use log level of INFO for karma
|
jtrussell_angular-snap.js
|
train
|
js
|
49dffb6b2e629a1e3872190519d27799521fa713
|
diff --git a/src/config/config.php b/src/config/config.php
index <HASH>..<HASH> 100644
--- a/src/config/config.php
+++ b/src/config/config.php
@@ -21,6 +21,13 @@ return [
'directory' => 'assets',
/**
+ * Whether or not we should cache the intermediate steps to disk.
+ *
+ * @var boolean
+ */
+ 'intermediate-steps' => TRUE,
+
+ /**
* Should we be using a single file for each asset, or multiple?
*
* @var boolean TRUE - one file per provided source file
|
Adding in more configuration values to help to deal with resource contention (caching intermediate steps to disk)
|
awjudd_l4-assetprocessor
|
train
|
php
|
165db0bd325ac882c6c4c8482d46ab79276710d0
|
diff --git a/org.openbel.framework.core/src/test/java/org/openbel/framework/core/equivalence/StatementEquivalencerTest.java b/org.openbel.framework.core/src/test/java/org/openbel/framework/core/equivalence/StatementEquivalencerTest.java
index <HASH>..<HASH> 100644
--- a/org.openbel.framework.core/src/test/java/org/openbel/framework/core/equivalence/StatementEquivalencerTest.java
+++ b/org.openbel.framework.core/src/test/java/org/openbel/framework/core/equivalence/StatementEquivalencerTest.java
@@ -111,7 +111,7 @@ public class StatementEquivalencerTest {
StatementEquivalencer.equivalenceInternal(edges, edgeStmts, eqn, eqe);
- printIssue10(edges, edgeStmts);
+ // printIssue10(edges, edgeStmts);
Assert.assertEquals(2, edgeStmts.get(1).size());
}
|
Commented out print to std out in unit test
|
OpenBEL_openbel-framework
|
train
|
java
|
5e82194c9e68d78d7c617db083d1395d917c11c0
|
diff --git a/src/models/configuration.js b/src/models/configuration.js
index <HASH>..<HASH> 100644
--- a/src/models/configuration.js
+++ b/src/models/configuration.js
@@ -24,12 +24,22 @@ function getConfigPath () {
return path.resolve(configDir, 'clever-tools.json');
}
+async function isFile (path) {
+ try {
+ const pathStat = await fs.stat(path);
+ return pathStat.isFile();
+ }
+ catch (e) {
+ return false;
+ }
+}
+
async function maybeMigrateFromLegacyConfigurationPath () {
// This used to be a file
const configDir = getConfigDir();
- const configDirStat = await fs.stat(configDir);
+ const legacyConfig = await isFile(configDir);
// If it is still a file, we replace it with a dir and move it inside
- if (configDirStat.isFile()) {
+ if (legacyConfig) {
const tmpConfigFile = `${configDir}.tmp`;
const configFile = getConfigPath();
|
config: fix ENOENT when ~/.config/clever-cloud doesn't exist
|
CleverCloud_clever-tools
|
train
|
js
|
2745e1408a09d76023877a2865e6cc466d54c820
|
diff --git a/test/storetest.py b/test/storetest.py
index <HASH>..<HASH> 100644
--- a/test/storetest.py
+++ b/test/storetest.py
@@ -32,7 +32,7 @@ def testStore(store):
now = int(time.time())
server_url = 'http://www.myopenid.com/openid'
- def genAssoc(issued=0, lifetime=600):
+ def genAssoc(issued, lifetime=600):
sec = generateSecret(20)
hdl = generateHandle(128)
return Association(hdl, sec, now + issued, lifetime, 'HMAC-SHA1')
@@ -55,7 +55,7 @@ def testStore(store):
assert ((not expectedPresent and not present) or
(expectedPresent and present))
- assoc = genAssoc()
+ assoc = genAssoc(issued=0)
# Make sure that a missing association returns no result
checkRetrieve(server_url)
@@ -101,7 +101,9 @@ def testStore(store):
# explicitly
checkRetrieve(server_url, assoc2.handle, assoc2)
- # More recent, but expires earlier than assoc2 or assoc
+ # More recent, and expires earlier than assoc2 or assoc. Make sure
+ # that we're picking the one with the latest issued date and not
+ # taking into account the expiration.
assoc3 = genAssoc(issued=2, lifetime=100)
store.storeAssociation(server_url, assoc3)
|
[project @ Clarify the store test documentation]
|
openid_python-openid
|
train
|
py
|
4ef5125980850a8371de3fc234733176ed1b386d
|
diff --git a/pharen.php b/pharen.php
index <HASH>..<HASH> 100644
--- a/pharen.php
+++ b/pharen.php
@@ -1784,9 +1784,9 @@ class StringNode extends LeafNode{
}
}
-class KeywordNode extends StringNode{
+class KeywordNode extends LeafNode{
public function compile() {
- return parent::compile();
+ return '"'.parent::compile().'"';
}
}
|
Use LeafNode semantics for keywords.
This will translate pharen-specific characters to PHP-ones. So ! to __exclam for example.
|
Scriptor_pharen
|
train
|
php
|
cd3e84586d6518edff5614e2a707280eac75dbb5
|
diff --git a/constance/admin.py b/constance/admin.py
index <HASH>..<HASH> 100644
--- a/constance/admin.py
+++ b/constance/admin.py
@@ -37,6 +37,7 @@ FIELDS = {
int: INTEGER_LIKE,
Decimal: (fields.DecimalField, {'widget': NUMERIC_WIDGET}),
str: STRING_LIKE,
+ list: STRING_LIKE,
datetime: (fields.DateTimeField, {'widget': widgets.AdminSplitDateTime}),
date: (fields.DateField, {'widget': widgets.AdminDateWidget}),
time: (fields.TimeField, {'widget': widgets.AdminTimeWidget}),
|
add admin ui support for constance keys as lists
fixes #<I>
|
jazzband_django-constance
|
train
|
py
|
e29bf14688f85f3042e94d003a9a652d8d095d29
|
diff --git a/spec/shared/database.rb b/spec/shared/database.rb
index <HASH>..<HASH> 100644
--- a/spec/shared/database.rb
+++ b/spec/shared/database.rb
@@ -70,4 +70,8 @@ RSpec.shared_context 'database' do
column :author, String
end
end
+
+ after do
+ rom.disconnect
+ end
end
|
Disconnect container after spec examples finish
|
rom-rb_rom
|
train
|
rb
|
9ca2dabc207cb876e962e2fb48fec82c03b138e4
|
diff --git a/test/configs.tests.js b/test/configs.tests.js
index <HASH>..<HASH> 100644
--- a/test/configs.tests.js
+++ b/test/configs.tests.js
@@ -259,8 +259,7 @@ describe('Packages', /* @this */ function(){
done();
});
});
- // for (const id in configs){
- // it(id, testPackage.bind(this, id));
- // }
- it('eslint-config-typescript', testPackage.bind(this, 'eslint-config-typescript')); //TODELETE
+ for (const id in configs){
+ it(id, testPackage.bind(this, id));
+ }
});
|
Re-enabled tests running on all configs, not just the new one
|
wildpeaks_packages-eslint-config
|
train
|
js
|
f80d65cc8d943ba9c97d38c3bf36adefc3325c92
|
diff --git a/doc/conf.py b/doc/conf.py
index <HASH>..<HASH> 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -107,7 +107,7 @@ for mod_name in MOCK_MODULES:
# ----------------------- READTHEDOCS ------------------
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
-import GPy
+#import GPy
if on_rtd:
sys.path.append("../GPy")
|
removing GPy import from conf (may put back in)
|
SheffieldML_GPy
|
train
|
py
|
e56e83080806f1f004a8f6f206d070009ec006e0
|
diff --git a/ios/src/playn/ios/IOSKeyboard.java b/ios/src/playn/ios/IOSKeyboard.java
index <HASH>..<HASH> 100644
--- a/ios/src/playn/ios/IOSKeyboard.java
+++ b/ios/src/playn/ios/IOSKeyboard.java
@@ -44,15 +44,13 @@ class IOSKeyboard implements Keyboard
@Override
public void getText(TextType textType, String label, String initVal,
final Callback<String> callback) {
- UIAlertView view = new UIAlertView(new RectangleF(12f, 45f, 260f, 25f));
+ UIAlertView view = new UIAlertView();
view.set_Title(label);
view.AddButton("Cancel");
view.AddButton("OK");
view.set_AlertViewStyle(UIAlertViewStyle.wrap(UIAlertViewStyle.PlainTextInput));
final UITextField field = view.GetTextField(0);
- field.set_UserInteractionEnabled(true);
- field.set_BackgroundColor(UIColor.get_White());
field.set_ReturnKeyType(UIReturnKeyType.wrap(UIReturnKeyType.Done));
switch (textType) {
|
Get rid of some superfluous property setting.
Also, passing that rectangle to the UIAlertView ctor was causing it to do some goofy things with
its text field positioning.
|
threerings_playn
|
train
|
java
|
cb21d040f4ae2c98e2797513cde0c4de1118918c
|
diff --git a/lib/simpletest/testmoodlelib.php b/lib/simpletest/testmoodlelib.php
index <HASH>..<HASH> 100644
--- a/lib/simpletest/testmoodlelib.php
+++ b/lib/simpletest/testmoodlelib.php
@@ -1164,6 +1164,22 @@ class moodlelib_test extends UnitTestCase {
unset_user_preference('_test_user_preferences_pref');
$this->assertTrue(!isset($USER->preference['_test_user_preferences_pref']));
+ // Test 1333 char values (no need for unicode, there are already tests for that in DB tests)
+ $longvalue = str_repeat('a', 1333);
+ set_user_preference('_test_long_user_preference', $longvalue);
+ $this->assertEqual($longvalue, get_user_preferences('_test_long_user_preference'));
+ $this->assertEqual($longvalue,
+ $DB->get_field('user_preferences', 'value', array('userid' => $USER->id, 'name' => '_test_long_user_preference')));
+
+ // Test > 1333 char values, coding_exception expected
+ $longvalue = str_repeat('a', 1334);
+ try {
+ set_user_preference('_test_long_user_preference', $longvalue);
+ $this->assertFail('Exception expected - longer than 1333 chars not allowed as preference value');
+ } catch (Exception $e) {
+ $this->assertTrue($e instanceof coding_exception);
+ }
+
//test invalid params
try {
set_user_preference('_test_user_preferences_pref', array());
|
MDL-<I> grade: added tests for set_user_preference() and the <I> limit
Added to tests to check that both the "limit" case of using <I>
chars is allowed and <I> causes coding exception to happen
|
moodle_moodle
|
train
|
php
|
bbadc33507810fd788a88bf31825b20cee51e045
|
diff --git a/infoblox_client/connector.py b/infoblox_client/connector.py
index <HASH>..<HASH> 100644
--- a/infoblox_client/connector.py
+++ b/infoblox_client/connector.py
@@ -470,7 +470,7 @@ class Connector(object):
valid = wapi_version and isinstance(wapi_version, six.string_types)
if not valid:
raise ValueError("Invalid argument was passed")
- version_match = re.search('(\d+)\.(\d+)', wapi_version)
+ version_match = re.search(r'(\d+)\.(\d+)', wapi_version)
if version_match:
if int(version_match.group(1)) >= \
CLOUD_WAPI_MAJOR_VERSION:
|
Fix a code coverage issue with pep8 (#<I>)
Fix a regexp presented as a string.
|
infobloxopen_infoblox-client
|
train
|
py
|
699b563ea8ccd037bdf421c6747039f724f6c4e3
|
diff --git a/Goutte/Tests/ClientTest.php b/Goutte/Tests/ClientTest.php
index <HASH>..<HASH> 100644
--- a/Goutte/Tests/ClientTest.php
+++ b/Goutte/Tests/ClientTest.php
@@ -67,6 +67,16 @@ class ClientTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('test', $this->historyPlugin->getLastRequest()->getHeader('X-Test'));
}
+ public function testCustomUserAgent()
+ {
+ $guzzle = $this->getGuzzle();
+ $client = new Client();
+ $client->setClient($guzzle);
+ $client->setHeader('User-Agent', 'foo');
+ $crawler = $client->request('GET', 'http://www.example.com/');
+ $this->assertEquals('foo', $this->historyPlugin->getLastRequest()->getHeader('User-Agent'));
+ }
+
public function testUsesAuth()
{
$guzzle = $this->getGuzzle();
|
Added test case to show usage.
|
FriendsOfPHP_Goutte
|
train
|
php
|
5e9f8ac06663f71c152366ce9d6b9c026d024acf
|
diff --git a/lib/numina/image/__init__.py b/lib/numina/image/__init__.py
index <HASH>..<HASH> 100644
--- a/lib/numina/image/__init__.py
+++ b/lib/numina/image/__init__.py
@@ -23,9 +23,9 @@ import copy
import numpy
import pyfits
-class Image(object):
+class DiskImage(object):
def __init__(self, filename, extension=None):
- super(Image, self).__init__()
+ super(DiskImage, self).__init__()
self.data = None
self.meta = None
self.filename = filename
@@ -52,11 +52,11 @@ class Image(object):
self.hdulist = None
def __copy__(self):
- new = Image(filename=self.filename)
+ new = DiskImage(filename=self.filename)
return new
def __str__(self):
- return 'Image(filename="%s", extension="%s")' % (self.filename, self.extension)
+ return 'DiskImage(filename="%s", extension="%s")' % (self.filename, self.extension)
def __getstate__(self):
return dict(filename=self.filename, extension=self.extension)
|
Image renamed to DiskImage
|
guaix-ucm_pyemir
|
train
|
py
|
8b08cf2da8b7f6f713148efabf9cbc30240698fd
|
diff --git a/packages/components/bolt-table/src/table.js b/packages/components/bolt-table/src/table.js
index <HASH>..<HASH> 100644
--- a/packages/components/bolt-table/src/table.js
+++ b/packages/components/bolt-table/src/table.js
@@ -241,9 +241,9 @@ class BoltTable extends withLitHtml() {
if (classIndex === -1) {
attributes.push({ key: 'class', value: classes });
} else {
- attributes[classIndex].value = `${
- attributes[classIndex].value
- } ${classes}`;
+ attributes[classIndex].value = Array.from(
+ new Set(`${attributes[classIndex].value} ${classes}`.split(' ')),
+ ).join(' ');
}
}
|
fix(@bolt/components-table): remove duplicated classes
|
bolt-design-system_bolt
|
train
|
js
|
eaa64260e4b76a243b0e1cdd4eed01354a269f00
|
diff --git a/src/de/lmu/ifi/dbs/elki/result/MultiResult.java b/src/de/lmu/ifi/dbs/elki/result/MultiResult.java
index <HASH>..<HASH> 100644
--- a/src/de/lmu/ifi/dbs/elki/result/MultiResult.java
+++ b/src/de/lmu/ifi/dbs/elki/result/MultiResult.java
@@ -12,7 +12,7 @@ public class MultiResult implements Result {
* Store the actual results
*/
private ArrayList<Result> results;
-
+
/**
* Constructor
*
@@ -69,12 +69,16 @@ public class MultiResult implements Result {
@SuppressWarnings("unchecked")
public <C> ArrayList<C> filterResults(Class<?> restrictionClass) {
ArrayList<C> res = new ArrayList<C>();
- for (Result result : results)
- try {
- res.add((C) restrictionClass.cast(result));
- } catch (ClassCastException e) {
- // skip non-matching items
+ for(Result result : results) {
+ if(result != null) {
+ try {
+ res.add((C) restrictionClass.cast(result));
+ }
+ catch(ClassCastException e) {
+ // skip non-matching items
+ }
}
+ }
return res;
}
}
|
Increase robustness wrt. null pointers.
|
elki-project_elki
|
train
|
java
|
02a2043f80bc725fe6b9120fe98e887f2efded61
|
diff --git a/model/search/ResultIndexIterator.php b/model/search/ResultIndexIterator.php
index <HASH>..<HASH> 100644
--- a/model/search/ResultIndexIterator.php
+++ b/model/search/ResultIndexIterator.php
@@ -81,6 +81,7 @@ class ResultIndexIterator implements \Iterator
$this->resultService = $this->getServiceLocator()->get(ResultServerService::SERVICE_ID);
$this->ensureNotEmpty();
+ $this->ensureValidResult();
}
/**
|
Check of first result from iterator
|
oat-sa_extension-tao-outcomeui
|
train
|
php
|
121154c961558c1a31c04de00a1f6b677e8d47fb
|
diff --git a/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/GermanSpellerRule.java b/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/GermanSpellerRule.java
index <HASH>..<HASH> 100644
--- a/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/GermanSpellerRule.java
+++ b/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/GermanSpellerRule.java
@@ -92,6 +92,7 @@ public class GermanSpellerRule extends CompoundAwareHunspellRule {
put("[sS]chee?selonge?", "Chaiselongue");
put("Re[kc]amiere", "Récamière");
put("legen[td]lich", "lediglich");
+ put("einundhalb", "eineinhalb");
put("[mM]illion(en)?mal", w -> Collections.singletonList(StringTools.uppercaseFirstChar(w.replaceFirst("mal", " Mal"))));
put("desweitere[nm]", "des Weiteren");
putRepl("einzigste[mnrs]?", "einzigst", "einzig");
|
[de] suggest "eineinhalb" for "einundhalb"
|
languagetool-org_languagetool
|
train
|
java
|
55d25555c899963e38518014c41cf40d44cee1cd
|
diff --git a/lib/graphql/static_validation/validator.rb b/lib/graphql/static_validation/validator.rb
index <HASH>..<HASH> 100644
--- a/lib/graphql/static_validation/validator.rb
+++ b/lib/graphql/static_validation/validator.rb
@@ -37,9 +37,12 @@ module GraphQL
end
context.visitor.visit
- # Post-validation: allow validators to register handlers on rewritten query nodes
rewrite_result = rewrite.document
- GraphQL::InternalRepresentation::Visit.visit_each_node(rewrite_result.operation_definitions, context.each_irep_node_handlers)
+
+ if context.each_irep_node_handlers.any?
+ # Post-validation: allow validators to register handlers on rewritten query nodes
+ GraphQL::InternalRepresentation::Visit.visit_each_node(rewrite_result.operation_definitions, context.each_irep_node_handlers)
+ end
{
errors: context.errors,
|
Validation: Don't traverse irep for nothing when no handlers are registered
|
rmosolgo_graphql-ruby
|
train
|
rb
|
afc77be354e2ea284bda7a55d0be36ebabda220a
|
diff --git a/NavigationReact/sample/native/web/SceneNavigator.js b/NavigationReact/sample/native/web/SceneNavigator.js
index <HASH>..<HASH> 100644
--- a/NavigationReact/sample/native/web/SceneNavigator.js
+++ b/NavigationReact/sample/native/web/SceneNavigator.js
@@ -25,7 +25,7 @@ class SceneNavigator extends Component{
var {startStyle, endStyle, style} = this.props;
var sceneContexts = crumbs.concat({state, url});
var scenes = sceneContexts.map((sceneContext, i) => {
- var {component: Component, props} = this.state.scenes[sceneContext.url];
+ var {component: Scene, props} = this.state.scenes[sceneContext.url];
var last = sceneContexts.length === i + 1;
return (
<Motion key={sceneContext.url}
@@ -33,7 +33,7 @@ class SceneNavigator extends Component{
style={getStyle(sceneContext.state.endStyle, endStyle(last))}>
{(interpolatingStyle) =>
<div style={getStyle(sceneContext.state.style, style(interpolatingStyle, last))}>
- <Component {...props} />
+ <Scene {...props} />
</div>
}
</Motion>
|
Renamed Component to Scene for clarity
|
grahammendick_navigation
|
train
|
js
|
808856c6f61fc0718662a2a0d81271040913fc0a
|
diff --git a/lang/en_utf8/enrol_flatfile.php b/lang/en_utf8/enrol_flatfile.php
index <HASH>..<HASH> 100644
--- a/lang/en_utf8/enrol_flatfile.php
+++ b/lang/en_utf8/enrol_flatfile.php
@@ -2,7 +2,17 @@
$string['enrolname'] = 'Flat file';
-$string['description'] = 'This method will repeatedly check for and process a specially-formatted text file in the location that you specify. The file can look something like this:
+$string['description'] = 'This method will repeatedly check for and process a specially-formatted text file in the location that you specify.
+The file is a comma separated file assumed to have four or six fields per line:
+* operation, role, idnumber(user), idnumber(course) [, starttime, endtime]
+where:
+* operation = add | del
+* role = student | teacher | teacheredit
+* idnumber(user) = idnumber in the user table NB not id
+* idnumber(course) = idnumber in the course table NB not id
+* starttime = start time (in seconds since epoch) - optional
+* endtime = end time (in seconds since epoch) - optional
+It could look something like this:
<pre>
add, student, 5, CF101
add, teacher, 6, CF101
|
Imporved the documentation for flatfile enrolment plugin on the configuration page
Backported from MOODLE_<I>_STABLE
|
moodle_moodle
|
train
|
php
|
7578223bd6900c2c21fc153e9e663a0b57c39a18
|
diff --git a/taggit_labels/widgets.py b/taggit_labels/widgets.py
index <HASH>..<HASH> 100644
--- a/taggit_labels/widgets.py
+++ b/taggit_labels/widgets.py
@@ -3,6 +3,7 @@ from django.forms.util import flatatt
from django.utils.safestring import mark_safe
from django.utils import six
+from taggit.models import Tag
from taggit.utils import edit_string_for_tags
@@ -12,16 +13,12 @@ class LabelWidget(forms.TextInput):
selectable labels.
"""
input_type = 'hidden'
- model = None
+ model = Tag
def __init__(self, *args, **kwargs):
- model = kwargs.pop('model', None)
- if model is None:
- from taggit.models import Tag
- model = Tag
- self.model = model
+ self.model = kwargs.pop('model', None) or self.model
super(LabelWidget, self).__init__(*args, **kwargs)
-
+
@property
def is_hidden(self):
return False
|
Fix overloading model via subclass
Previous code only used model from kwarg or default Tag
model, overwriting self.model (from the class) in any case.
|
bennylope_django-taggit-labels
|
train
|
py
|
1360eb07b66bcb318961121cc294907c260c81b1
|
diff --git a/projects/ninux/ninux/settings.example.py b/projects/ninux/ninux/settings.example.py
index <HASH>..<HASH> 100755
--- a/projects/ninux/ninux/settings.example.py
+++ b/projects/ninux/ninux/settings.example.py
@@ -139,6 +139,7 @@ INSTALLED_APPS = (
'nodeshot.core.links',
'nodeshot.core.monitoring',
'nodeshot.core.services',
+ 'nodeshot.core.mailing',
'nodeshot.contrib.hardware',
'nodeshot.contrib.planning',
'tastypie'
|
updated settings.example.py to include mailing app
|
ninuxorg_nodeshot
|
train
|
py
|
7f1bbc4999e4134e1752713218506639a8cfd643
|
diff --git a/e2e/csi/csi.go b/e2e/csi/csi.go
index <HASH>..<HASH> 100644
--- a/e2e/csi/csi.go
+++ b/e2e/csi/csi.go
@@ -107,8 +107,7 @@ func (tc *CSIVolumesTest) TestEBSVolumeClaim(f *framework.F) {
"aws-ebs0 node plugins did not become healthy")
// register a volume
- // TODO: we don't have a unique ID threaded thru the jobspec yet
- volID := "ebs-vol0"
+ volID := "ebs-vol[0]"
err := volumeRegister(volID, "csi/input/volume-ebs.hcl")
require.NoError(err)
tc.volumeIDs = append(tc.volumeIDs, volID)
|
E2E: CSI test should use expected unique-volume name
|
hashicorp_nomad
|
train
|
go
|
a818379e79a7ea218b58cb4efc01cc2f45f40d4f
|
diff --git a/NotyWidget.php b/NotyWidget.php
index <HASH>..<HASH> 100644
--- a/NotyWidget.php
+++ b/NotyWidget.php
@@ -91,6 +91,11 @@ class NotyWidget extends Widget
if ($this->enableSessionFlash) {
$flashes = Yii::$app->session->getAllFlashes();
+
+ if (empty($flashes)) {
+ return;
+ }
+
$view = $this->getView();
$script = "";
@@ -106,9 +111,9 @@ class NotyWidget extends Widget
$script .= "$.noty.setText({$type}.options.id, '{$text}');\r\n";
$script .= "$.noty.setType({$type}.options.id, '{$type}');\r\n";
}
+
+ $view->registerJs($script);
}
-
- $view->registerJs($script);
}
/**
@@ -177,4 +182,4 @@ JS;
return Html::tag('i', '', ['class' => $class]) . ' ';
}
-}
\ No newline at end of file
+}
|
Bug Fixed
Fixed a problem when you set 'enableSessionFlash' to false.
|
Shifrin_yii2-noty
|
train
|
php
|
3c674689d50fa4b138a0d750c797030c14e32b5f
|
diff --git a/php/rmapi.class.php b/php/rmapi.class.php
index <HASH>..<HASH> 100755
--- a/php/rmapi.class.php
+++ b/php/rmapi.class.php
@@ -81,13 +81,15 @@ class RMAPI{
case "POST":
$curl_options = $curl_defaults;
- $curl_options["CURLOPT_POSTFIELDS"] = $request_body;
+ $curl_options["CURLOPT_POSTFIELDS"] = json_encode(
+ $request_body);
$curl_options["CURLOPT_POST"] = true;
break;
case "PUT":
$curl_options = $curl_defaults;
- $curl_options["CURLOPT_POSTFIELDS"] = $request_body;
+ $curl_options["CURLOPT_POSTFIELDS"] = json_encode(
+ $request_body);
$curl_options["CURLOPT_CUSTOMREQUEST"] = $method;
break;
|
Added json_encode() to request_body in POST and PUT requests
|
ReachmailInc_WebAPISamples
|
train
|
php
|
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.