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
|
---|---|---|---|---|---|
5b71006cac45714c1676c7e2576ee3460e41c62f
|
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
@@ -60,7 +60,7 @@ module ActionDispatch
end
class Mapping #:nodoc:
- IGNORE_OPTIONS = [:only, :except, :shallow, :shallow_path, :shallow_prefix]
+ IGNORE_OPTIONS = [:except, :shallow, :shallow_path, :shallow_prefix]
ANCHOR_CHARACTERS_REGEX = %r{\A(\\A|\^)|(\\Z|\\z|\$)\Z}
attr_reader :scope, :options, :requirements, :conditions, :defaults
@@ -1524,6 +1524,7 @@ module ActionDispatch
options[:as] = name_for_action(options[:as], action)
end
+ options.delete :only
mapping = Mapping.new(@scope, URI.parser.escape(path), options)
app, conditions, requirements, defaults, as, anchor = mapping.to_route
@set.add_route(app, conditions, requirements, defaults, as, anchor)
|
:only is never used in Mapping, so rm the key
|
rails_rails
|
train
|
rb
|
e3525d2433655d6ff726c4983ccbf659a50afe69
|
diff --git a/lib/kpeg/compiled_parser.rb b/lib/kpeg/compiled_parser.rb
index <HASH>..<HASH> 100644
--- a/lib/kpeg/compiled_parser.rb
+++ b/lib/kpeg/compiled_parser.rb
@@ -32,8 +32,8 @@ module KPeg
end
attr_reader :string
- attr_reader :result, :failing_rule_offset
- attr_accessor :pos
+ attr_reader :failing_rule_offset
+ attr_accessor :result, :pos
include Position
@@ -218,6 +218,7 @@ module KPeg
begin
if val = __send__(rule, *args)
other.pos = @pos
+ other.result = @result
else
other.set_failed_rule "#{self.class}##{rule}"
end
|
Fix result not making it back to the external invoker
|
evanphx_kpeg
|
train
|
rb
|
eb990332ece1d99566777fd8f8dc6b10a5c4f42b
|
diff --git a/code/media/koowa/com_files/js/files.grid.js b/code/media/koowa/com_files/js/files.grid.js
index <HASH>..<HASH> 100644
--- a/code/media/koowa/com_files/js/files.grid.js
+++ b/code/media/koowa/com_files/js/files.grid.js
@@ -227,6 +227,20 @@ Files.Grid = new Class({
row.checked = !old;
checkbox.setProperty('checked', !old);
+ var tbody = node.getParent('tbody');
+
+ if (tbody) {
+ var length = tbody.getElements('.selected').length;
+
+ if (length === 1) {
+ tbody.addClass('selected-single').removeClass('selected-multiple');
+ } else if (length > 1) {
+ tbody.addClass('selected-multiple').removeClass('selected-single');
+ } else {
+ tbody.removeClass('selected-multiple').removeClass('selected-single');
+ }
+ }
+
if (fire_events !== false) {
this.fireEvent('afterCheckNode', {row: row, checkbox: checkbox});
}
|
Use selected-single and selected-multiple classes in the grid
|
joomlatools_joomlatools-framework
|
train
|
js
|
9e07b7a577a8a717e86409874808d1cb7390fbe1
|
diff --git a/rest_framework_gis/serializers.py b/rest_framework_gis/serializers.py
index <HASH>..<HASH> 100644
--- a/rest_framework_gis/serializers.py
+++ b/rest_framework_gis/serializers.py
@@ -49,7 +49,10 @@ class GeoFeatureModelSerializer(GeoModelSerializer):
# if 'fields' are declared, make sure it includes 'geo_field'
if self.opts.fields:
if self.opts.geo_field not in self.opts.fields:
- self.opts.fields.append(self.opts.geo_field)
+ # make sure its a list so we can append
+ fields = list(self.opts.fields)
+ fields.append(self.opts.geo_field)
+ self.opts.fields = fields
def to_native(self, obj):
|
allow for list or tuple of field names
|
djangonauts_django-rest-framework-gis
|
train
|
py
|
5654d8f53968fb14feb29c7941e0e42761d105ff
|
diff --git a/src/getConfig.js b/src/getConfig.js
index <HASH>..<HASH> 100644
--- a/src/getConfig.js
+++ b/src/getConfig.js
@@ -304,7 +304,7 @@ module.exports = function getConfig({
//region CSS
const postcssPlugins = [
- postcssPresetEnv({browsers})
+ postcssPresetEnv({overrideBrowserslist: browsers})
];
if (!skipPostprocess && minify){
postcssPlugins.push(
|
Changed how `browsers` is passed to PostCSS
The next major version will most likely remove the `browsers` property altogether, users should have a `.browserlistrc` file or `browserlist` key in their package.json instead.
|
wildpeaks_package-webpack-config-web
|
train
|
js
|
a29e1acadbc4de5154c98d6184ac5493bf9ed394
|
diff --git a/lib/seahorse/client/plugin.rb b/lib/seahorse/client/plugin.rb
index <HASH>..<HASH> 100644
--- a/lib/seahorse/client/plugin.rb
+++ b/lib/seahorse/client/plugin.rb
@@ -20,7 +20,7 @@ module Seahorse
def add_options(config)
self.class.options.each do |option|
name, default = option
- default = default.call(config) if default.is_a?(Proc)
+ default = instance_exec(config, &default) if default.is_a?(Proc)
config.add_option(name, default)
end
end
diff --git a/spec/seahorse/client/plugin_spec.rb b/spec/seahorse/client/plugin_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/seahorse/client/plugin_spec.rb
+++ b/spec/seahorse/client/plugin_spec.rb
@@ -94,6 +94,17 @@ module Seahorse
expect(config.opt2).to equal(20)
end
+ it 'instance evals the block' do
+ plugin = Class.new(Plugin) do
+ def initialize
+ @value = 'instance-value'
+ end
+ option(:value) { @value }
+ end
+ plugin.new.add_options(config)
+ expect(config.value).to eq('instance-value')
+ end
+
end
describe '.handler' do
|
Plugin.option blocks are now instance eval'd to allow the plugin to access internal scope.
|
aws_aws-sdk-ruby
|
train
|
rb,rb
|
6031c723ec27ac3ee185aa2768288ff772086a2b
|
diff --git a/hazelcast-jet-reference-manual/src/main/java/integration/ImdgConnectors.java b/hazelcast-jet-reference-manual/src/main/java/integration/ImdgConnectors.java
index <HASH>..<HASH> 100644
--- a/hazelcast-jet-reference-manual/src/main/java/integration/ImdgConnectors.java
+++ b/hazelcast-jet-reference-manual/src/main/java/integration/ImdgConnectors.java
@@ -42,8 +42,8 @@ public class ImdgConnectors {
static void s1() {
//tag::s1[]
Pipeline p = Pipeline.create();
- BatchStage<Entry<String, Long>> stage = p.drawFrom(Sources.map("myMap"));
- stage.drainTo(Sinks.map("myMap"));
+ BatchStage<Entry<String, Long>> stage = p.drawFrom(Sources.map("inMap"));
+ stage.drainTo(Sinks.map("outMap"));
//end::s1[]
}
|
Use different source and sink map in refman (#<I>)
|
hazelcast_hazelcast
|
train
|
java
|
3649b5a4eadaf59eaa6ad531601ce04e8597b325
|
diff --git a/testutils/timeout.go b/testutils/timeout.go
index <HASH>..<HASH> 100644
--- a/testutils/timeout.go
+++ b/testutils/timeout.go
@@ -39,7 +39,7 @@ func init() {
panic(err)
}
timeoutScaleFactor = fv
- fmt.Println("Scaling timeouts by factor", timeoutScaleFactor)
+ fmt.Fprintln(os.Stderr, "Scaling timeouts by factor", timeoutScaleFactor)
}
}
|
Write timeout scaling message to stderr
We use stdout to communicate with external processes which can cause
failures if this message is printed to stdout.
|
uber_tchannel-go
|
train
|
go
|
575fde74c83b201e1038a9f8a451406d392b7399
|
diff --git a/puz.py b/puz.py
index <HASH>..<HASH> 100644
--- a/puz.py
+++ b/puz.py
@@ -572,7 +572,7 @@ def restore(s, t):
'XYZ.ABC'
"""
t = (c for c in t)
- return ''.join(t.next() if not is_blacksquare(c) else c for c in s)
+ return ''.join(next(t) if not is_blacksquare(c) else c for c in s)
def is_blacksquare(c):
return c == BLACKSQUARE
|
Use next function instead of assuming that t has next method
|
alexdej_puzpy
|
train
|
py
|
db6e08d7afd1e6ae6ecc1ee3a049a5fc8e3e84bb
|
diff --git a/geomdl/operations.py b/geomdl/operations.py
index <HASH>..<HASH> 100644
--- a/geomdl/operations.py
+++ b/geomdl/operations.py
@@ -30,7 +30,7 @@ def insert_knot(obj, param, num, **kwargs):
raise GeomdlException("The number of insertions must be a list or a tuple",
data=dict(num=num))
- if len(num) != obj.pdim:
+ if len(num) != obj.pdimension:
raise GeomdlException("The length of the num array must be equal to the number of parametric dimensions",
data=dict(pdim=obj.pdim, num_len=len(num)))
@@ -143,7 +143,7 @@ def remove_knot(obj, param, num, **kwargs):
raise GeomdlException("The number of removals must be a list or a tuple",
data=dict(num=num))
- if len(num) != obj.pdim:
+ if len(num) != obj.pdimension:
raise GeomdlException("The length of the num array must be equal to the number of parametric dimensions",
data=dict(pdim=obj.pdim, num_len=len(num)))
|
Call correct property for getting parametric dimension
|
orbingol_NURBS-Python
|
train
|
py
|
78b85487ac926fe38a7e3f13232f0c9552b916d1
|
diff --git a/lib/parser.js b/lib/parser.js
index <HASH>..<HASH> 100644
--- a/lib/parser.js
+++ b/lib/parser.js
@@ -22,8 +22,8 @@ var optparse = require('./extern/optparse/lib/optparse');
var constants = require('./constants');
var halt = function(parser) {
+ parser._halted = true;
parser.halt(parser);
- process.exit(0);
};
var getParser = function() {
diff --git a/lib/run.js b/lib/run.js
index <HASH>..<HASH> 100644
--- a/lib/run.js
+++ b/lib/run.js
@@ -382,7 +382,7 @@ function run(cwd, argv) {
concurrency,
options['fail-fast']);
}
- else {
+ else if (!p._halted) {
console.log(p.banner);
}
|
Don't forcefully exit on halt method, just set the halted variable.
|
cloudkick_whiskey
|
train
|
js,js
|
9af042263f7c6e66b4c1402d2f6fc81250c6ce97
|
diff --git a/packages/react-scripts/template/src/App.test.js b/packages/react-scripts/template/src/App.test.js
index <HASH>..<HASH> 100644
--- a/packages/react-scripts/template/src/App.test.js
+++ b/packages/react-scripts/template/src/App.test.js
@@ -5,4 +5,5 @@ import App from './App';
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<App />, div);
+ ReactDOM.unmountComponentAtNode(div);
});
|
Unmount the App in the default test (#<I>)
|
elegantthemes_create-divi-extension
|
train
|
js
|
fe1c0a58c05b0f1604112cf0fbbebd23acfb3847
|
diff --git a/src/Extensions/SiteTreeSubsites.php b/src/Extensions/SiteTreeSubsites.php
index <HASH>..<HASH> 100644
--- a/src/Extensions/SiteTreeSubsites.php
+++ b/src/Extensions/SiteTreeSubsites.php
@@ -15,9 +15,11 @@ use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\FormAction;
use SilverStripe\Forms\ToggleCompositeField;
use SilverStripe\i18n\i18n;
+use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\DataExtension;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\DataQuery;
+use SilverStripe\ORM\Map;
use SilverStripe\ORM\Queries\SQLSelect;
use SilverStripe\Security\Member;
use SilverStripe\Security\Security;
@@ -106,10 +108,11 @@ class SiteTreeSubsites extends DataExtension
public function updateCMSFields(FieldList $fields)
{
$subsites = Subsite::accessible_sites('CMS_ACCESS_CMSMain');
- $subsitesMap = [];
if ($subsites && $subsites->count()) {
$subsitesToMap = $subsites->exclude('ID', $this->owner->SubsiteID);
$subsitesMap = $subsitesToMap->map('ID', 'Title');
+ } else {
+ $subsitesMap = new Map(ArrayList::create());
}
// Master page edit field (only allowed from default subsite to avoid inconsistent relationships)
|
FIX be consistent with the variable setting
So as to avoid fatal errors while attempting to count.
|
silverstripe_silverstripe-subsites
|
train
|
php
|
4ade2398ad0f8c3f89531a57a9913cb856ebf486
|
diff --git a/aeron-driver/src/main/java/uk/co/real_logic/aeron/driver/DriverConductor.java b/aeron-driver/src/main/java/uk/co/real_logic/aeron/driver/DriverConductor.java
index <HASH>..<HASH> 100644
--- a/aeron-driver/src/main/java/uk/co/real_logic/aeron/driver/DriverConductor.java
+++ b/aeron-driver/src/main/java/uk/co/real_logic/aeron/driver/DriverConductor.java
@@ -23,7 +23,6 @@ import uk.co.real_logic.aeron.common.command.RemoveMessageFlyweight;
import uk.co.real_logic.aeron.common.command.SubscriptionMessageFlyweight;
import uk.co.real_logic.aeron.common.concurrent.*;
import uk.co.real_logic.aeron.common.concurrent.logbuffer.GapScanner;
-import uk.co.real_logic.aeron.common.concurrent.ringbuffer.ManyToOneRingBuffer;
import uk.co.real_logic.aeron.common.concurrent.ringbuffer.RingBuffer;
import uk.co.real_logic.aeron.common.event.EventCode;
import uk.co.real_logic.aeron.common.event.EventConfiguration;
|
[Java] Removed unused import.
|
real-logic_aeron
|
train
|
java
|
7f088884b1ae31fa34a6560b9adad64698dc7de1
|
diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -34,7 +34,7 @@ gulp.task('test:compile', function (cb) {
gulp.task('test', ['compile', 'test:compile'], function () {
gulp.src('dist/test/*.js', {read: false})
- .pipe(mocha({reporter: 'spec'}))
+ .pipe(mocha({reporter: 'min'}))
})
gulp.task('example:compile', function (cb) {
|
Changing reporter from spec to min
|
minio_minio-js
|
train
|
js
|
829fe5e300633a1ec12a461b8277b6c816727a5e
|
diff --git a/go/service/user_report.go b/go/service/user_report.go
index <HASH>..<HASH> 100644
--- a/go/service/user_report.go
+++ b/go/service/user_report.go
@@ -23,6 +23,7 @@ type convTranscript struct {
type convTranscriptMsg struct {
SenderUsername string `json:"senderUsername"`
Body chat1.MessageBody `json:"body"`
+ Ctime gregor1.Time `json:"ctime_ms"`
}
// When sending a transcript, send the following number of most recent chat
@@ -56,6 +57,7 @@ func pullTranscript(mctx libkb.MetaContext, chatG *globals.ChatContext, convIDSt
tMsg := convTranscriptMsg{
SenderUsername: mv.SenderUsername,
Body: mv.MessageBody,
+ Ctime: mv.ServerHeader.Ctime,
}
transcript.Messages = append(transcript.Messages, tMsg)
}
|
Add ctime in transcripts (#<I>)
|
keybase_client
|
train
|
go
|
4405b8f1c36529966d0200ba778b0c29e746983e
|
diff --git a/resilience4j-spring/src/main/java/io/github/resilience4j/retry/configure/RetryAspect.java b/resilience4j-spring/src/main/java/io/github/resilience4j/retry/configure/RetryAspect.java
index <HASH>..<HASH> 100644
--- a/resilience4j-spring/src/main/java/io/github/resilience4j/retry/configure/RetryAspect.java
+++ b/resilience4j-spring/src/main/java/io/github/resilience4j/retry/configure/RetryAspect.java
@@ -148,7 +148,7 @@ public class RetryAspect implements Ordered, AutoCloseable {
if (logger.isDebugEnabled()) {
logger.debug(
"Created or retrieved retry '{}' with max attempts rate '{}' for method: '{}'",
- backend, retry.getRetryConfig().getResultPredicate(), methodName);
+ backend, retry.getRetryConfig().getMaxAttempts(), methodName);
}
return retry;
}
|
Issue #<I>: Fix logged retry max attempts value on debug mode (#<I>)
|
resilience4j_resilience4j
|
train
|
java
|
537b1af187d18334236e890c018da03dd9a9c4ad
|
diff --git a/ibis/backends/impala/tests/test_connection_pool.py b/ibis/backends/impala/tests/test_connection_pool.py
index <HASH>..<HASH> 100644
--- a/ibis/backends/impala/tests/test_connection_pool.py
+++ b/ibis/backends/impala/tests/test_connection_pool.py
@@ -8,7 +8,10 @@ def test_connection_pool_size(hdfs, env, test_data_db):
host=env.impala_host,
database=test_data_db,
)
- assert len(client.con.connection_pool) == 1
+
+ # the client cursor may or may not be GC'd, so the connection
+ # pool will contain either zero or one cursor
+ assert len(client.con.connection_pool) in (0, 1)
def test_connection_pool_size_after_close(hdfs, env, test_data_db):
|
test: fix incorrect connection pool test (#<I>)
|
ibis-project_ibis
|
train
|
py
|
5b65693ef883074d7fb3bf3f2f3d7feb5fb89e4d
|
diff --git a/test/test_freeze.py b/test/test_freeze.py
index <HASH>..<HASH> 100644
--- a/test/test_freeze.py
+++ b/test/test_freeze.py
@@ -21,3 +21,6 @@ class FreezeTestCase(unittest.TestCase):
def test_value_to_str3(self):
assert '' == value_to_str(None)
+
+ def test_value_to_str4(self):
+ assert [] == value_to_str([])
|
full coverage for function value_to_str
|
pudo_dataset
|
train
|
py
|
0fedd427458d8cff11404c7e44ff67b15fa680eb
|
diff --git a/src/Providers/TaggingServiceProvider.php b/src/Providers/TaggingServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/Providers/TaggingServiceProvider.php
+++ b/src/Providers/TaggingServiceProvider.php
@@ -9,8 +9,8 @@ use Conner\Tagging\Util;
/**
* Copyright (C) 2014 Robert Conner
*/
-class TaggingServiceProvider extends ServiceProvider {
-
+class TaggingServiceProvider extends ServiceProvider
+{
/**
* Indicates if loading of the provider is deferred.
*/
@@ -22,11 +22,11 @@ class TaggingServiceProvider extends ServiceProvider {
public function boot()
{
$this->publishes([
- __DIR__.'/../config/tagging.php' => config_path('tagging.php')
+ __DIR__.'/../../config/tagging.php' => config_path('tagging.php')
], 'config');
$this->publishes([
- __DIR__.'/../migrations/' => database_path('migrations')
+ __DIR__.'/../../migrations/' => database_path('migrations')
], 'migrations');
}
|
Update service provider to use tags for publish
|
rtconner_laravel-tagging
|
train
|
php
|
2af1e286ee31a50e58e4d4c4edd40492a34e4dbc
|
diff --git a/tests/test_formatting.py b/tests/test_formatting.py
index <HASH>..<HASH> 100644
--- a/tests/test_formatting.py
+++ b/tests/test_formatting.py
@@ -18,7 +18,7 @@ from ansimarkup import AnsiMarkupError
("{level.icon}", lambda r: r == "🐞"),
("{file}", lambda r: r == "test_formatting.py"),
("{file.name}", lambda r: r == "test_formatting.py"),
- ("{file.path}", lambda r: re.fullmatch(r".*tests[/\\]test_formatting.py", r)),
+ ("{file.path}", lambda r: r == __file__),
("{function}", lambda r: r == "test_log_formatters"),
("{module}", lambda r: r == "test_formatting"),
("{thread}", lambda r: re.fullmatch(r"\d+", r)),
|
Make use of __file__ in formatting unit tests (#<I>)
|
Delgan_loguru
|
train
|
py
|
16f6abd9691ea67730cb0f757d29fc34d92c3ef1
|
diff --git a/rake-tasks/checks.rb b/rake-tasks/checks.rb
index <HASH>..<HASH> 100644
--- a/rake-tasks/checks.rb
+++ b/rake-tasks/checks.rb
@@ -48,11 +48,19 @@ def present?(arg)
File.exists?(prefix + File::SEPARATOR + arg)
end
+ if !bool && mac?
+ bool = File.exists?("/Applications/#{arg}.app")
+ end
+
PRESENT_CACHE[arg] = bool
bool
end
+def opera?
+ present?("opera") || present?("Opera")
+end
+
def java?
present?("java") || present?("java.exe")
end
|
SimonStewart: Include the check for opera
r<I>
|
SeleniumHQ_selenium
|
train
|
rb
|
e8c2a233982215ca4f73bd4fb990dc5770070586
|
diff --git a/pkg/drivers/kic/oci/oci.go b/pkg/drivers/kic/oci/oci.go
index <HASH>..<HASH> 100644
--- a/pkg/drivers/kic/oci/oci.go
+++ b/pkg/drivers/kic/oci/oci.go
@@ -186,6 +186,10 @@ func CreateContainerNode(p CreateParams) error {
memcgSwap := hasMemorySwapCgroup()
memcg := hasMemoryCgroup()
+ if !memcgSwap || !memcg {
+ out.WarningT("Cgroup v2 does not allow setting memory, if you want to set memory, please modify your Grub as instructed in https://docs.docker.com/engine/install/linux-postinstall/#your-kernel-does-not-support-cgroup-swap-limit-capabilities")
+ }
+
// https://www.freedesktop.org/wiki/Software/systemd/ContainerInterface/
var virtualization string
if p.OCIBinary == Podman { // enable execing in /var
|
Provide an advice for users on how to modify Grub setting.
|
kubernetes_minikube
|
train
|
go
|
2c5f900ab8064bd5d0793b37cad068dea7271ac2
|
diff --git a/grimoire/elk/enrich.py b/grimoire/elk/enrich.py
index <HASH>..<HASH> 100644
--- a/grimoire/elk/enrich.py
+++ b/grimoire/elk/enrich.py
@@ -190,7 +190,7 @@ class Enrich(object):
item_date = (item_date-item_date.utcoffset()).replace(tzinfo=None)
enrollments = self.get_enrollments(uuid)
- enroll = None
+ enroll = 'Unknown'
if len(enrollments) > 0:
for enrollment in enrollments:
if not item_date:
|
[enrich] Use Unknown when there is no affiliation
|
chaoss_grimoirelab-elk
|
train
|
py
|
3a89c7f33823d209ce71b4eb51c219397466c005
|
diff --git a/snippets/video/video.js b/snippets/video/video.js
index <HASH>..<HASH> 100644
--- a/snippets/video/video.js
+++ b/snippets/video/video.js
@@ -5,7 +5,7 @@ var page = tabris.create("Page", {
tabris.create("Video", {
layoutData: {left: 0, right: 0, top: 0, bottom: 0},
- url: "http://peach.themazzone.com/durian/movies/sintel-1280-stereo.mp4"
+ url: "http://mirrorblender.top-ix.org/movies/sintel-1280-stereo.mp4"
}).appendTo(page);
page.open();
|
Update Sintel movie source
Themazzone mirror was down.
Change-Id: I<I>a5e4b4ccbaf<I>ac0f<I>a0afae1d<I>eeb<I>b
|
eclipsesource_tabris-js
|
train
|
js
|
aff34edcb7512d2346e049e79196f22d80c95ff5
|
diff --git a/Value/Loader/EzTagsValueLoader.php b/Value/Loader/EzTagsValueLoader.php
index <HASH>..<HASH> 100644
--- a/Value/Loader/EzTagsValueLoader.php
+++ b/Value/Loader/EzTagsValueLoader.php
@@ -65,6 +65,7 @@ class EzTagsValueLoader implements ValueLoaderInterface
$tag = new Tag(
array(
'id' => 0,
+ 'parentTagId' => null,
'keywords' => array(
'eng-GB' => 'All tags',
),
|
Root tag has null parent tag ID
|
netgen-layouts_content-browser-ezplatform
|
train
|
php
|
1b8bf5635cbe9a0a8bd75746acb77fbfcc00e7f3
|
diff --git a/src/vdom/dom.js b/src/vdom/dom.js
index <HASH>..<HASH> 100644
--- a/src/vdom/dom.js
+++ b/src/vdom/dom.js
@@ -1,3 +1,8 @@
+function shouldBeProp (value) {
+ const type = typeof value;
+ return type === 'function' || type === 'object';
+}
+
function createElement (el) {
const realNode = document.createElement(el.tagName);
@@ -19,6 +24,8 @@ function createElement (el) {
}
} else if (name.indexOf('on') === 0) {
realNode.addEventListener(name.substring(2).toLowerCase(), value);
+ } else if (shouldBeProp(value)) {
+ realNode[name] = value;
} else {
realNode.setAttribute(name, value);
}
|
Set values as a property if a function or object.
|
skatejs_dom-diff
|
train
|
js
|
7346ccb928751ccd0c0dcb94f18e960c2fbfb88e
|
diff --git a/pypet/pypetlogging.py b/pypet/pypetlogging.py
index <HASH>..<HASH> 100644
--- a/pypet/pypetlogging.py
+++ b/pypet/pypetlogging.py
@@ -496,7 +496,7 @@ class NoInterpolationParser(cp.ConfigParser):
def __init__(self):
try:
# Needed for Python 3, see [http://bugs.python.org/issue21265]
- super(NoInterpolationParser, self).__init__(self, interpolation=None)
+ super(NoInterpolationParser, self).__init__(interpolation=None)
except TypeError:
# Python 2.x
cp.ConfigParser.__init__(self)
|
FIX: Fixed mistake in calling of init function for python 3 in dummy parser.
|
SmokinCaterpillar_pypet
|
train
|
py
|
d24f3642161e83335dc6c4a3cbbf4c6e8eba9552
|
diff --git a/rollbar/test/test_async.py b/rollbar/test/test_async.py
index <HASH>..<HASH> 100644
--- a/rollbar/test/test_async.py
+++ b/rollbar/test/test_async.py
@@ -1,3 +1,4 @@
+import copy
import sys
try:
@@ -15,8 +16,11 @@ ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 6)
@unittest2.skipUnless(ALLOWED_PYTHON_VERSION, 'Async support requires Python3.6+')
class AsyncLibTest(BaseTest):
+ default_settings = copy.deepcopy(rollbar.SETTINGS)
+
def setUp(self):
self.access_token = 'aaaabbbbccccddddeeeeffff00001111'
+ rollbar.SETTINGS = copy.deepcopy(self.default_settings)
rollbar._initialized = False
rollbar.init(self.access_token, handler='async')
|
Make sure SETTINGS are fresh for each testcase
|
rollbar_pyrollbar
|
train
|
py
|
89d076a8f12024edf54fff442b5a8ccb49c2b3fc
|
diff --git a/marathon/models/queue.py b/marathon/models/queue.py
index <HASH>..<HASH> 100644
--- a/marathon/models/queue.py
+++ b/marathon/models/queue.py
@@ -26,7 +26,7 @@ class MarathonQueueItem(MarathonResource):
"""
def __init__(self, app=None, overdue=None, count=None, delay=None, since=None,
- processed_offers_summary=None):
+ processed_offers_summary=None, last_unused_offers=None):
self.app = app if isinstance(
app, MarathonApp) else MarathonApp().from_json(app)
self.overdue = overdue
@@ -35,6 +35,7 @@ class MarathonQueueItem(MarathonResource):
delay, MarathonQueueItemDelay) else MarathonQueueItemDelay().from_json(delay)
self.since = since
self.processed_offers_summary = processed_offers_summary
+ self.last_unused_offers = last_unused_offers
class MarathonQueueItemDelay(MarathonResource):
|
Fix MarathonQueueItem to know about the possible last_unused_offers arg
|
thefactory_marathon-python
|
train
|
py
|
d321da89a96c46566f5576384f5f99e1b16f80ac
|
diff --git a/lib/emir/core.py b/lib/emir/core.py
index <HASH>..<HASH> 100644
--- a/lib/emir/core.py
+++ b/lib/emir/core.py
@@ -105,6 +105,6 @@ def offsets_from_wcs(frames, pixref):
with frame.open() as hdulist:
wcsh = wcs.WCS(hdulist[0].header)
pixval = wcsh.wcs_sky2pix(skyref, 1)
- result[idx + 1] = pixval[0] - pixref[0]
+ result[idx + 1] = -(pixval[0] - pixref[0])
return result
|
Return the difference of offsets (minus the difference of coordinates)
|
guaix-ucm_pyemir
|
train
|
py
|
177ec5194cc585b4f69f6029f09a4497f3bdacb2
|
diff --git a/lxd/storage/drivers/driver_btrfs_volumes.go b/lxd/storage/drivers/driver_btrfs_volumes.go
index <HASH>..<HASH> 100644
--- a/lxd/storage/drivers/driver_btrfs_volumes.go
+++ b/lxd/storage/drivers/driver_btrfs_volumes.go
@@ -762,6 +762,7 @@ func (d *btrfs) SetVolumeQuota(vol Volume, size string, allowUnsafeResize bool,
// Add that to the requested filesystem size (to ignore it from the quota).
sizeBytes += blockSize
+ d.logger.Debug("Accounting for VM image file size", "sizeBytes", sizeBytes)
}
// Apply the limit.
|
lxd/storage/drivers/driver/btrfs/volumes: Add log for VM block file quota accounting in SetVolumeQuota
|
lxc_lxd
|
train
|
go
|
8e93b97363cd6c9d41561eee33bfb7584786f56f
|
diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -1,7 +1,7 @@
/**
* Web socket client for SUGOS
* @module sg-socket-client
- * @version 1.2.4
+ * @version 1.2.5
*/
'use strict'
diff --git a/lib/sg_socket_client.js b/lib/sg_socket_client.js
index <HASH>..<HASH> 100644
--- a/lib/sg_socket_client.js
+++ b/lib/sg_socket_client.js
@@ -61,7 +61,7 @@ function sgSocketClient (...args) {
PubsubExtension,
{
waitToConnect: () => untilConnect,
- untilDisconnect: () => untilDisconnect
+ waitToDisconnect: () => untilDisconnect
}
)
return socket
diff --git a/package.json b/package.json
index <HASH>..<HASH> 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "sg-socket-client",
- "version": "1.2.5",
+ "version": "1.2.6",
"description": "Web socket client for SUGOS",
"main": "lib",
"scripts": {
|
Version incremented to <I>
|
realglobe-Inc_sg-socket-client
|
train
|
js,js,json
|
71d8f87307e33889aea7f390e7e3bed34244a1fb
|
diff --git a/general.js b/general.js
index <HASH>..<HASH> 100644
--- a/general.js
+++ b/general.js
@@ -1,3 +1,5 @@
+import coreIncludes from 'core-js/library/fn/array/includes';
+
/**
* Checks shallow equality
* Re-export of shallow from shallow-equals
@@ -102,7 +104,7 @@ export function formatText() {
* @return {Array} Intersected list of a and b
*/
export function intersectLists(a, b) {
- return a.filter((val) => b.includes(val));
+ return a.filter((val) => coreIncludes(b, val));
}
/**
@@ -403,8 +405,8 @@ function applyFilterOnObject(obj, filterFn) {
*/
function filterFromObject(obj, filter, { isInclusion = true } = {}) {
if (filter && Array.isArray(filter)) {
- return applyFilterOnObject(obj, isInclusion ? ((_, key) => filter.includes(key))
- : ((_, key) => !filter.includes(key)));
+ return applyFilterOnObject(obj, isInclusion ? ((_, key) => coreIncludes(filter, key))
+ : ((_, key) => !coreIncludes(filter, key)));
} else if (filter && typeof filter === 'function') {
// Flip the filter fn's return if it's for inclusion
return applyFilterOnObject(obj, isInclusion ? filter
|
Explicitly import polyfills from core-js rather than relying on them to be globally available
|
bigchaindb_js-utility-belt
|
train
|
js
|
0c39c9c716cd8aa546cf9bec0378c05247f43a5a
|
diff --git a/app/components/validated-select-year-component.js b/app/components/validated-select-year-component.js
index <HASH>..<HASH> 100644
--- a/app/components/validated-select-year-component.js
+++ b/app/components/validated-select-year-component.js
@@ -5,15 +5,19 @@ var YEAR_PREFIX = '20';
App.ValidatedSelectYearComponent = App.ValidatedSelectComponent.extend({
- years: [],
-
content: function() {
- var years = this.get('years'),
+
+ var years = [],
thisYear = new Date().getFullYear();
+
+ if ( years.length > 12 ) return;
+
for ( var i = 0; i < 12; i++ ) {
years.push( YEAR_PREFIX + (thisYear + i).toString().substr(2,3) );
}
+
return years;
- }.property('years')
+
+ }.property()
});
|
Issue #<I> - fix years select content generation
|
dollarshaveclub_ember-uni-form
|
train
|
js
|
aa64ed48cff6bac81a5b321a7e985e5bb0ad5088
|
diff --git a/bcbio/structural/purecn.py b/bcbio/structural/purecn.py
index <HASH>..<HASH> 100644
--- a/bcbio/structural/purecn.py
+++ b/bcbio/structural/purecn.py
@@ -135,7 +135,9 @@ def _run_purecn_dx(out, paired):
return out
def _get_purecn_dx_files(paired, out):
- """Retrieve files generated by PureCN_Dx"""
+ """Retrieve files generated by PureCN_Dx
+ does not check if file exists
+ """
out_base = utils.splitext_plus(out["rds"])[0]
all_files = []
for key, ext in [[("mutation_burden",), "_mutation_burden.csv"],
@@ -143,9 +145,8 @@ def _get_purecn_dx_files(paired, out):
[("signatures",), "_signatures.csv"],
[("chrom_instability",), "_cin.csv"]]:
cur_file = f"{out_base}{ext}"
- if utils.file_exists(cur_file):
- out = tz.update_in(out, key, lambda x: cur_file)
- all_files.append(os.path.basename(cur_file))
+ out = tz.update_in(out, key, lambda x: cur_file)
+ all_files.append(os.path.basename(cur_file))
return out_base, out, all_files
def _run_purecn(paired, work_dir):
|
related to #<I> (#<I>)
|
bcbio_bcbio-nextgen
|
train
|
py
|
d81c2c442948b94e9dab30dfe336ca4f2351c79e
|
diff --git a/packages/cerebral-forms/src/factories/validateField.js b/packages/cerebral-forms/src/factories/validateField.js
index <HASH>..<HASH> 100644
--- a/packages/cerebral-forms/src/factories/validateField.js
+++ b/packages/cerebral-forms/src/factories/validateField.js
@@ -9,8 +9,6 @@ export default function validateFieldFactory (pathTemplate) {
const form = context.state.get(formPath)
const validationResult = runValidation(field, form)
- context.state.merge(fieldPath, validationResult)
-
let dependentFields = []
if (Array.isArray(field.dependsOn)) {
dependentFields = field.dependsOn
|
refactor(forms): remove unnecessary merge from validateField (#<I>)
|
cerebral_cerebral
|
train
|
js
|
167a011a49f7f02243725f841fbc7d0bf68c880f
|
diff --git a/lib/login_system.rb b/lib/login_system.rb
index <HASH>..<HASH> 100644
--- a/lib/login_system.rb
+++ b/lib/login_system.rb
@@ -88,7 +88,7 @@ module LoginSystem
def no_login_required
skip_before_filter :authenticate
skip_before_filter :authorize
- puts _process_action_callbacks.map(&:filter)
+ # puts _process_action_callbacks.map(&:filter)
end
def login_required?
|
Remove a debugging 'puts'
|
pgharts_trusty-cms
|
train
|
rb
|
2a518964f03265f7dfe8aaf81d152a0fb14c7344
|
diff --git a/src/videojs5.hlsjs.js b/src/videojs5.hlsjs.js
index <HASH>..<HASH> 100644
--- a/src/videojs5.hlsjs.js
+++ b/src/videojs5.hlsjs.js
@@ -108,7 +108,7 @@ function Html5HlsJS(source, tech) {
writable: false
});
el.addTextTrack = function() {
- return tech.addTextTrack(arguments);
+ return tech.addTextTrack.apply(tech, arguments)
}
}
|
pass through text track to the tech correctly
|
Peer5_videojs-contrib-hls.js
|
train
|
js
|
1e3b5feb305718c87158692a35c8dd36636d451e
|
diff --git a/src/components/dialogs/find/find.js b/src/components/dialogs/find/find.js
index <HASH>..<HASH> 100644
--- a/src/components/dialogs/find/find.js
+++ b/src/components/dialogs/find/find.js
@@ -32,8 +32,8 @@ var Find = Dialog.extend({
if(!_this.model.state.time.playing) {
_this.time = _this.model.state.time.value;
- _this.model.state.marker.getFrame(_this.time, function(values) {
- if (!values) return;
+ _this.model.state.marker.getFrame(_this.time, function(values, time) {
+ if (!values || (_this.time - time)) return;
_this.redrawDataPoints(values);
});
}
|
Fix countries with bubbles in find country list #<I> (#<I>)
|
vizabi_vizabi
|
train
|
js
|
d1c86e0be64977dda8f35cd2b4e6b9659ad372b3
|
diff --git a/cli.js b/cli.js
index <HASH>..<HASH> 100755
--- a/cli.js
+++ b/cli.js
@@ -126,7 +126,7 @@ function settings(flags, cache) {
value = flag.slice(1).join(':');
- if (value === 'true' || value === undefined) {
+ if (value === 'true' || value === '') {
value = true;
} else if (value === 'false') {
value = false;
|
Fix support for boolean attributes in CLI
This was introduced in
[9ff5faa](<URL>).
|
remarkjs_remark
|
train
|
js
|
95d40a542fa3a5938f9ab6a086671535ab2dcf2f
|
diff --git a/pandasdmx/writer/structure2pd.py b/pandasdmx/writer/structure2pd.py
index <HASH>..<HASH> 100644
--- a/pandasdmx/writer/structure2pd.py
+++ b/pandasdmx/writer/structure2pd.py
@@ -162,6 +162,8 @@ class Writer(BaseWriter):
constraint = constraint.constraints.any()
except AttributeError:
# So the Message must containe a constraint
+ # the following is buggy: Should be linked to a dataflor,
+ # DSD or provision-agreement
constraint = source.constraints.any()
# allow `columns` arg to be a str
|
hint to constraint-related bug in structure2pd
|
dr-leo_pandaSDMX
|
train
|
py
|
8456528ecf9480202a589ce2d7f9155b69bbf1f9
|
diff --git a/src/bindnode/index.js b/src/bindnode/index.js
index <HASH>..<HASH> 100644
--- a/src/bindnode/index.js
+++ b/src/bindnode/index.js
@@ -25,22 +25,16 @@ export default function bindNode(object, key, node, binder, eventOptions) {
eventOptions = eventOptions || {}; // eslint-disable-line no-param-reassign
binder = binder || {}; // eslint-disable-line no-param-reassign
- if (bindNode.temporaryOptionalFlag) { // check out bindOptionalNode
- eventOptions = { // eslint-disable-line no-param-reassign
- ...eventOptions,
- optional: true
- };
- }
-
- delete bindNode.temporaryOptionalFlag;
initMK(object);
const {
- optional,
+ optional = bindNode.temporaryOptionalFlag, // check out bindOptionalNode
exactKey = false
} = eventOptions;
+ delete bindNode.temporaryOptionalFlag;
+
// throw an error when key is falsy
if (!key) {
throw matreshkaError('binding:falsy_key');
|
revert: Previous fi didn't work
|
matreshkajs_matreshka
|
train
|
js
|
617d46a9a5c95d55ffd0a1068ba527988500bc80
|
diff --git a/chorus/src/main/java/org/chorusbdd/chorus/handlers/ProcessesHandler.java b/chorus/src/main/java/org/chorusbdd/chorus/handlers/ProcessesHandler.java
index <HASH>..<HASH> 100644
--- a/chorus/src/main/java/org/chorusbdd/chorus/handlers/ProcessesHandler.java
+++ b/chorus/src/main/java/org/chorusbdd/chorus/handlers/ProcessesHandler.java
@@ -201,7 +201,7 @@ public class ProcessesHandler {
}
- @Step(".*stop process named ([a-zA-Z0-9-_]*) ?.*")
+ @Step(".*stop (?:the ){0,1}process named ([a-zA-Z0-9-_]*) ?.*")
public void stopProcess(String name) {
ChildProcess p = processes.get(name);
if (p != null) {
|
Slightly more flexible wording for stop process handler
|
Chorus-bdd_Chorus
|
train
|
java
|
d838c499572363d9a28984d5fe2d3e8801d9f88f
|
diff --git a/example/main.go b/example/main.go
index <HASH>..<HASH> 100644
--- a/example/main.go
+++ b/example/main.go
@@ -45,9 +45,8 @@ func publish(written *disruptor.Cursor, upstream disruptor.Barrier) {
for previous <= Iterations {
next := previous + 1
- wrap := next - BufferSize
- for wrap > gate {
+ for next-BufferSize > gate {
gate = upstream.Read(next)
}
|
Removing extra allocation dramatically improved the speed--from <I>ns to <I>ns.
|
smartystreets_go-disruptor
|
train
|
go
|
00ca896cb5eef83bab2342b7eb52bbca2b5aa539
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -3,6 +3,7 @@ from distutils.core import setup, Extension
duktape = Extension('dukpy._dukpy',
+ define_macros=[('DUK_OPT_DEEP_C_STACK', '1')],
sources=[os.path.join('duktape', 'duktape.c'),
'pyduktape.c'],
include_dirs=[os.path.join('.', 'duktape')])
|
Compile with deep stack also on OSX
|
amol-_dukpy
|
train
|
py
|
0f58bc9f3db9ace569a76d15320099f808c794cb
|
diff --git a/salt/cloud/clouds/openstack.py b/salt/cloud/clouds/openstack.py
index <HASH>..<HASH> 100644
--- a/salt/cloud/clouds/openstack.py
+++ b/salt/cloud/clouds/openstack.py
@@ -261,7 +261,7 @@ def preferred_ip(vm_, ips):
except Exception:
continue
- return False
+ return False
def ignore_cidr(vm_, ip):
|
Removed extra indent to allow the function to return false if an IP is not able to be converted
|
saltstack_salt
|
train
|
py
|
4bc82d6ed0203fc58a8b0505b0d7632fefb93080
|
diff --git a/saltcloud/clouds/digital_ocean.py b/saltcloud/clouds/digital_ocean.py
index <HASH>..<HASH> 100644
--- a/saltcloud/clouds/digital_ocean.py
+++ b/saltcloud/clouds/digital_ocean.py
@@ -75,7 +75,9 @@ def get_configured_provider():
Return the first configured instance.
'''
return config.is_provider_configured(
- __opts__, 'digital_ocean', ('api_key',)
+ __opts__,
+ __active_profile_name__ or 'digital_ocean',
+ ('api_key',)
)
|
Digital Ocean is now aware of the `__active_profile_name__` context variable. Refs #<I>
|
saltstack_salt
|
train
|
py
|
9b60730624ae45766d045549b14233d6e706742d
|
diff --git a/src/Models/ObjectMap/Entities/Associations/AssociationStubPolymorphic.php b/src/Models/ObjectMap/Entities/Associations/AssociationStubPolymorphic.php
index <HASH>..<HASH> 100644
--- a/src/Models/ObjectMap/Entities/Associations/AssociationStubPolymorphic.php
+++ b/src/Models/ObjectMap/Entities/Associations/AssociationStubPolymorphic.php
@@ -40,6 +40,7 @@ class AssociationStubPolymorphic extends AssociationStubBase
$thisTarg = $this->getTargType();
$thatTarg = $otherStub->getTargType();
$thisBase = $this->getBaseType();
+ $thatBase = $otherStub->getBaseType();
$thisNull = null === $thisTarg;
$thatNull = null === $thatTarg;
if ($thisNull && $thatNull) {
@@ -48,7 +49,7 @@ class AssociationStubPolymorphic extends AssociationStubBase
if ((!$thisNull &&
!$thatNull) &&
($thisBase !== $otherStub->getTargType() ||
- $otherStub->getBaseType() !== $this->getTargType())
+ $thatBase !== $this->getTargType())
) {
return false;
}
@@ -56,7 +57,7 @@ class AssociationStubPolymorphic extends AssociationStubBase
if ($thisNull && ($thatTarg != $thisBase)) {
return false;
}
- if ($thatNull && ($thisTarg != $otherStub->getBaseType())) {
+ if ($thatNull && ($thisTarg != $thatBase)) {
return false;
}
|
Cache calls to other-stub getBaseType
|
Algo-Web_POData-Laravel
|
train
|
php
|
4b697aecb975c56cb34f775b59e8113fe794d79e
|
diff --git a/lib/specjour/rsync_daemon.rb b/lib/specjour/rsync_daemon.rb
index <HASH>..<HASH> 100644
--- a/lib/specjour/rsync_daemon.rb
+++ b/lib/specjour/rsync_daemon.rb
@@ -59,7 +59,7 @@ module Specjour
def config
<<-CONFIG
-# Anonymous Rsync Daemon config for #{project_name}
+# Anonymous rsync daemon config for #{project_name}
#
# Serve this project with the following command:
# $ #{command.join(' ')}
|
Less caps in rsync config
|
sandro_specjour
|
train
|
rb
|
2b758ec040ca8c5126e1c400219435354e5d2378
|
diff --git a/responders/Gmail/gmail.py b/responders/Gmail/gmail.py
index <HASH>..<HASH> 100644
--- a/responders/Gmail/gmail.py
+++ b/responders/Gmail/gmail.py
@@ -37,20 +37,32 @@ class Gmail(Responder):
else:
return None
- def delete_message(self):
+ def delete_message(self, subject, message_id):
pass
- def block_domain(self):
- pass
+ def block_messages(self, subject, query):
+ """Automatically labels matching emails according to query argument.
+ Args
+ Returns:
+ filter_id (int): ID for the created filter
+ """
+ new_filter = {
+ "criteria": {
+ "query": query
+ },
+ "action": { # based on https://developers.google.com/gmail/api/guides/labels
+ "addLabelIds": ["TRASH"],
+ "removeLabelIds": ["INBOX"]
+ }
+ }
- def block_sender(self):
- pass
+ filter_id = self.__gmail_service.users().settings().filters().create(userId=subject, body=new_filter).execute()
+ return filter_id
- def unblock_domain(self):
- pass
-
- def unblock_sender(self):
- pass
+ def unblock_messages(self, subject, filter_id):
+ """Delete a previous created filter by filter ID
+ """
+ filter_id = self.__gmail_service.users().settings().filters().delete(userId=subject, id=filter_id).execute()
def run(self):
Responder.run(self)
|
implemented blocking and unblocking of messages
|
TheHive-Project_Cortex-Analyzers
|
train
|
py
|
5c5fc0f9d3698b5c8745b8ee49b22d13866b8767
|
diff --git a/rainflow.py b/rainflow.py
index <HASH>..<HASH> 100644
--- a/rainflow.py
+++ b/rainflow.py
@@ -8,8 +8,8 @@ from collections import deque, defaultdict
def reversals(series):
"""
- A generator function which iterates over the reversals in the given
- *series* (an iterable). Reversals are the points at which the first
+ A generator function which iterates over the reversals in the iterable
+ *series*. Reversals are the points at which the first
derivative on the series changes sign. The generator never yields
the first and the last points in the series.
"""
|
Cosmetic changes in the docstrings
|
iamlikeme_rainflow
|
train
|
py
|
e0c4b310ec0c440b60e1fb104ba2de13f947c4eb
|
diff --git a/core/codegen/src/main/java/org/overture/codegen/assistant/TypeAssistantCG.java b/core/codegen/src/main/java/org/overture/codegen/assistant/TypeAssistantCG.java
index <HASH>..<HASH> 100644
--- a/core/codegen/src/main/java/org/overture/codegen/assistant/TypeAssistantCG.java
+++ b/core/codegen/src/main/java/org/overture/codegen/assistant/TypeAssistantCG.java
@@ -91,7 +91,7 @@ public class TypeAssistantCG extends AssistantBase
}
public AMethodTypeCG getMethodType(IRInfo info, List<AClassDeclCG> classes,
- String fieldModule, String fieldName, LinkedList<SExpCG> args)
+ String fieldModule, String fieldName, List<SExpCG> args)
throws org.overture.codegen.cgast.analysis.AnalysisException
{
AClassDeclCG classDecl = assistantManager.getDeclAssistant().findClass(classes, fieldModule);
@@ -635,6 +635,19 @@ public class TypeAssistantCG extends AssistantBase
return elementTypes;
}
+ public boolean containsType(List<STypeCG> types, STypeCG searchedType)
+ {
+ for(STypeCG currentType : types)
+ {
+ if(currentType.getClass() == searchedType.getClass())
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
public boolean isNumericType(STypeCG type)
{
return isInt(type) || isRealOrRat(type);
|
Updated the type assistant with utility functionality used in the union type transformation
|
overturetool_overture
|
train
|
java
|
24e5db770697df48b123caadbda5dc2ce96ef00c
|
diff --git a/src/Analyse/Callback/Analyse/Objects/Traversable.php b/src/Analyse/Callback/Analyse/Objects/Traversable.php
index <HASH>..<HASH> 100644
--- a/src/Analyse/Callback/Analyse/Objects/Traversable.php
+++ b/src/Analyse/Callback/Analyse/Objects/Traversable.php
@@ -95,12 +95,12 @@ class Traversable extends AbstractObjectAnalysis
try {
// We need to deactivate the current error handling to
// prevent the host system to do anything stupid.
- set_error_handler(
- function () {
+ set_error_handler(
+ function () {
// Do nothing.
- }
- );
- $parameter = iterator_to_array($data);
+ }
+ );
+ $parameter = iterator_to_array($data);
} catch (\Throwable $e) {
//Restore the previous error handler, and return an empty string.
restore_error_handler();
|
Corected the indention in the traversable analysis.
|
brainworxx_kreXX
|
train
|
php
|
b4c86384e843b905e589616072b0e0f2c44c66df
|
diff --git a/tests/_support/UnitTester.php b/tests/_support/UnitTester.php
index <HASH>..<HASH> 100644
--- a/tests/_support/UnitTester.php
+++ b/tests/_support/UnitTester.php
@@ -27,6 +27,36 @@ class UnitTester extends \Codeception\Actor
*/
/**
+ * @var \tkanstantsin\fileupload\FileManager
+ */
+ private $fileFactory;
+
+ /**
+ * @return \Helper\TestFileFactory
+ */
+ public function getFileFactory(): \Helper\TestFileFactory
+ {
+ if ($this->fileFactory === null) {
+ $this->fileFactory = new \Helper\TestFileFactory();
+ }
+
+ return $this->fileFactory;
+ }
+
+ /**
+ * @see \Helper\TestFileFactory::create()
+ * @param int $type
+ * @param string $alias
+ * @param array $params
+ * @return \tkanstantsin\fileupload\model\IFile
+ * @throws \tkanstantsin\fileupload\config\InvalidConfigException
+ */
+ public function createFile(int $type, string $alias, array $params = []): \tkanstantsin\fileupload\model\IFile
+ {
+ return $this->getFileFactory()->create($type, $alias, $params);
+ }
+
+ /**
* @return \tkanstantsin\fileupload\FileManager
* @throws \LogicException
* @throws \tkanstantsin\fileupload\config\InvalidConfigException
|
test - enh - create factory getter and create file method alias
|
t-kanstantsin_fileupload
|
train
|
php
|
53ccc9a4556f64b728a26b73a6ec5061668942bb
|
diff --git a/spyderlib/spyder.py b/spyderlib/spyder.py
index <HASH>..<HASH> 100644
--- a/spyderlib/spyder.py
+++ b/spyderlib/spyder.py
@@ -1195,9 +1195,10 @@ class MainWindow(QMainWindow):
self.extconsole.setMinimumHeight(0)
if not self.light:
- # Hide Internal Console so that people doesn't use it instead of
+ # Hide Internal Console so that people don't use it instead of
# the External or IPython ones
if self.console.dockwidget.isVisible() and DEV is None:
+ self.console.toggle_view_action.setChecked(False)
self.console.dockwidget.hide()
# Show the Object Inspector and Consoles by default
|
Main Window: Uncheck Internal Console Panes menu entry when it's hidden automatically
|
spyder-ide_spyder
|
train
|
py
|
bc17e6490ac1f24d8d746018cb175b3557e333c4
|
diff --git a/src/Address/LocalityAddressFormatter.php b/src/Address/LocalityAddressFormatter.php
index <HASH>..<HASH> 100644
--- a/src/Address/LocalityAddressFormatter.php
+++ b/src/Address/LocalityAddressFormatter.php
@@ -13,4 +13,4 @@ class LocalityAddressFormatter implements AddressFormatterInterface
$address->getLocality() . ', ' .
$address->getCountry()->getCode();
}
-}
\ No newline at end of file
+}
|
III-<I> Comply to coding standards.
|
cultuurnet_udb3-php
|
train
|
php
|
8af8e6e84f75f326b06629c9da0790e5cb2a08d7
|
diff --git a/websocket.go b/websocket.go
index <HASH>..<HASH> 100644
--- a/websocket.go
+++ b/websocket.go
@@ -218,5 +218,7 @@ func StartListening() error {
// StopListening disables the receiving of messages.
func StopListening() {
- wsconn.closing = true
+ if wsconn != nil {
+ wsconn.closing = true
+ }
}
|
Avoid nil pointer dereference.
|
janimo_textsecure
|
train
|
go
|
4dcdbcaa6a97bb12984976b2868bd168e6dfb8a3
|
diff --git a/packages/wxa-core/src/base/page.js b/packages/wxa-core/src/base/page.js
index <HASH>..<HASH> 100644
--- a/packages/wxa-core/src/base/page.js
+++ b/packages/wxa-core/src/base/page.js
@@ -13,7 +13,7 @@ module.exports.launch = function(instance) {
let category = 'push';
if (type) category = type;
this.router[category](path);
- }, 220);
+ }, 250);
})();
vm.onShareAppMessage = vm.onShareAppMessage || function() {
let pages = getCurrentPages();
diff --git a/packages/wxa-core/src/utils/promisify.js b/packages/wxa-core/src/utils/promisify.js
index <HASH>..<HASH> 100644
--- a/packages/wxa-core/src/utils/promisify.js
+++ b/packages/wxa-core/src/utils/promisify.js
@@ -1,6 +1,7 @@
export default (api, fnName) => {
+ const noPromiseApi = ['createSelectorQuery'];
// 同步方法
- if (/.*Sync$/.test(fnName)) {
+ if (/.*Sync$/.test(fnName) || noPromiseApi.indexOf(fnName) > -1) {
return (...params)=>{
return api(...params);
};
|
chores: make debounce longer
|
wxajs_wxa
|
train
|
js,js
|
3f2ec19c219a55842a1c7f52e3b4b2bf7b5dbb7b
|
diff --git a/activesupport/test/multibyte_conformance_test.rb b/activesupport/test/multibyte_conformance_test.rb
index <HASH>..<HASH> 100644
--- a/activesupport/test/multibyte_conformance_test.rb
+++ b/activesupport/test/multibyte_conformance_test.rb
@@ -36,6 +36,8 @@ class MultibyteConformanceTest < ActiveSupport::TestCase
FileUtils.mkdir_p(CACHE_DIR)
Downloader.download(UNIDATA_URL + UNIDATA_FILE, CACHE_DIR + UNIDATA_FILE)
@proxy = ActiveSupport::Multibyte::Chars
+ rescue
+ skip "Unable to download test data"
end
def test_normalizations_C
@@ -126,4 +128,4 @@ class MultibyteConformanceTest < ActiveSupport::TestCase
def inspect_codepoints(str)
str.to_s.unpack("U*").map{|cp| cp.to_s(16) }.join(' ')
end
-end
\ No newline at end of file
+end
|
Don't fail if unicode.org isn't talking to us
|
rails_rails
|
train
|
rb
|
78d9de81da4ea0f97ff3edc7045863849c032524
|
diff --git a/cmd/juju/commands/upgrademodel_test.go b/cmd/juju/commands/upgrademodel_test.go
index <HASH>..<HASH> 100644
--- a/cmd/juju/commands/upgrademodel_test.go
+++ b/cmd/juju/commands/upgrademodel_test.go
@@ -914,6 +914,19 @@ func (s *UpgradeJujuSuite) TestUpgradeValidateModel(c *gc.C) {
c.Assert(err, gc.ErrorMatches, `a message from the server about the problem`)
}
+func (s *UpgradeJujuSuite) TestUpgradeValidateModelNotImplementedNoError(c *gc.C) {
+ fakeAPI := NewFakeUpgradeJujuAPI(c, s.State)
+
+ fakeAPI.setUpgradeErr = errors.NotImplementedf("")
+
+ command := s.upgradeJujuCommand(nil, fakeAPI, fakeAPI, fakeAPI, fakeAPI)
+ err := cmdtesting.InitCommand(command, []string{})
+ c.Assert(err, jc.ErrorIsNil)
+
+ err = command.Run(cmdtesting.Context(c))
+ c.Assert(err, jc.ErrorIsNil)
+}
+
func (s *UpgradeJujuSuite) TestUpgradeInProgress(c *gc.C) {
fakeAPI := NewFakeUpgradeJujuAPI(c, s.State)
fakeAPI.setVersionErr = ¶ms.Error{
|
Add missing test for the upgrade model command
This test was supposed to land together with commit d1b5f<I> but was
unfortunately skipped.
|
juju_juju
|
train
|
go
|
c638baf173c84a0dbf056a542f44cef91f028456
|
diff --git a/src/Expression.php b/src/Expression.php
index <HASH>..<HASH> 100644
--- a/src/Expression.php
+++ b/src/Expression.php
@@ -33,7 +33,10 @@ class Expression implements Arrayable
{
return new self;
}
-
+ /**
+ * Return a expression
+ * @return \Sokil\Mongo\Cursor|\Sokil\Mongo\Expression
+ */
public function where($field, $value)
{
if(!isset($this->_expression[$field]) || !is_array($value) || !is_array($this->_expression[$field])) {
|
Changes for autocomplete in IDE
|
sokil_php-mongo
|
train
|
php
|
48748c698b1973fd21ca5a458babf001031306d7
|
diff --git a/nptdms/tdmsinfo.py b/nptdms/tdmsinfo.py
index <HASH>..<HASH> 100644
--- a/nptdms/tdmsinfo.py
+++ b/nptdms/tdmsinfo.py
@@ -48,7 +48,7 @@ def main():
def display_properties(tdms_object, level):
if tdms_object.properties:
display("properties:", level)
- for prop, val in tdms_object.properties.iteritems():
+ for prop, val in tdms_object.properties.items():
display("%s: %s" % (prop, val), level)
|
Fix tdmsinfo to run with Python 3
|
adamreeve_npTDMS
|
train
|
py
|
9970b7cdad0f2d269701afe86a6c76b8e27a91c8
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -132,7 +132,7 @@ module.exports = function(bundle, opts) {
console.warn('[HMR builder] Unknown message type from server:', msg.type);
}
});
- childReadline.on('end', function() {
+ server.stdio[3].on('finish', function() {
em.emit('error', new Error("Browserify-HMR lost connection to socket server"));
});
return new RSVP.Promise(function(resolve, reject) {
diff --git a/socket-server.js b/socket-server.js
index <HASH>..<HASH> 100644
--- a/socket-server.js
+++ b/socket-server.js
@@ -89,6 +89,6 @@ parentReadline.on('line', function(line) {
log('Unknow message type', msg.type);
}
});
-parentReadline.on('end', function() {
+parent.on('finish', function() {
process.exit(0);
});
|
Fix detecting when main process and socket server lose connection.
|
Macil_browserify-hmr
|
train
|
js,js
|
f59535b91deba783178ad53a8873f1116a340663
|
diff --git a/lib/formatter/response_helper.js b/lib/formatter/response_helper.js
index <HASH>..<HASH> 100644
--- a/lib/formatter/response_helper.js
+++ b/lib/formatter/response_helper.js
@@ -30,7 +30,7 @@ const ResultKlass = function (params) {
;
oThis.params = params;
- oThis.successData = params.success_data || {};
+ oThis.data = params.success_data || {};
oThis.apiErrorIdentifier = params.api_error_identifier;
oThis.paramsErrorIdentifiers = params.params_error_identifiers;
oThis.internalErrorCode = params.internal_error_identifier || 'openst_base_default';
@@ -101,7 +101,7 @@ ResultKlass.prototype = {
} else {
formattedData.success = true;
formattedData.code = 200;
- formattedData.data = oThis.successData;
+ formattedData.data = oThis.data;
}
return formattedData;
|
changes var name from successData to data
|
ostdotcom_base
|
train
|
js
|
e70a482e4d88d0a766ab69777059ab7d3d7918b7
|
diff --git a/src/LessElephant/LessProject.php b/src/LessElephant/LessProject.php
index <HASH>..<HASH> 100644
--- a/src/LessElephant/LessProject.php
+++ b/src/LessElephant/LessProject.php
@@ -76,7 +76,11 @@ class LessProject
public function __construct($sourceFolder, $sourceFile, $destination, $name = null, LessBinary $lessBinary = null)
{
if (!is_file($destination)) {
- throw new \InvalidArgumentException(sprintf('The destination given (%s) is not a file', $destination));
+ try {
+ touch($destination);
+ } catch (\Exception $e) {
+ throw new \InvalidArgumentException(sprintf('LessElephant is unable to create the given destination css. Error: %s', $e->getMessage()));
+ }
}
if (!is_writable($destination)) {
throw new \InvalidArgumentException(sprintf('LessElephant is not able to write in the given path %s', $destination));
|
try to write the destination css
|
matteosister_LessElephant
|
train
|
php
|
07b14f09789986fa8fbd290592e7ab38264dc26c
|
diff --git a/src/mg/Ding/Bean/Factory/Filter/PropertyFilter.php b/src/mg/Ding/Bean/Factory/Filter/PropertyFilter.php
index <HASH>..<HASH> 100755
--- a/src/mg/Ding/Bean/Factory/Filter/PropertyFilter.php
+++ b/src/mg/Ding/Bean/Factory/Filter/PropertyFilter.php
@@ -120,10 +120,11 @@ class PropertyFilter implements IFilter
*/
private function __construct(array $properties)
{
+ $this->_properties = array();
foreach (array_keys($properties) as $key) {
/* Change keys. 'property' becomes ${property} */
$propName = '${' . $key . '}';
$this->_properties[$propName] = $properties[$key];
}
}
-}
\ No newline at end of file
+}
|
added initialization for properties array in propertyfilter
|
marcelog_Ding
|
train
|
php
|
104f9efd6040a7755f0253c801862dcffc6aa377
|
diff --git a/src/Views.php b/src/Views.php
index <HASH>..<HASH> 100644
--- a/src/Views.php
+++ b/src/Views.php
@@ -343,7 +343,7 @@ class Views
public function remember($lifetime = null)
{
$this->shouldCache = true;
- $this->cacheLifetiem = $lifetime;
+ $this->cacheLifetime = $lifetime;
return $this;
}
|
fix(remember): update property assignment (typo)
`$this->cacheLifetiem` --> `$this->cacheLifetime`
|
cyrildewit_eloquent-viewable
|
train
|
php
|
58b332eedc41cc6f80da1ce7480479ff2804d39f
|
diff --git a/src/crate/crash/command.py b/src/crate/crash/command.py
index <HASH>..<HASH> 100644
--- a/src/crate/crash/command.py
+++ b/src/crate/crash/command.py
@@ -283,8 +283,6 @@ class CrateCmd(object):
return True
except ConnectionError:
self.logger.warn('Use \connect <server> to connect to one or more servers first.')
- except KeyboardInterrupt:
- self.logger.warn("Query not cancelled. Run KILL <jobId> to cancel it")
except ProgrammingError as e:
self.logger.critical(e.message)
if self.error_trace:
diff --git a/src/crate/crash/repl.py b/src/crate/crash/repl.py
index <HASH>..<HASH> 100644
--- a/src/crate/crash/repl.py
+++ b/src/crate/crash/repl.py
@@ -180,6 +180,8 @@ def loop(cmd, history_file):
doc = cli.run()
if doc:
cmd.process(doc.text)
+ except KeyboardInterrupt:
+ cmd.logger.warn("Query not cancelled. Run KILL <jobId> to cancel it")
except EOFError:
cmd.logger.warn(u'Bye!')
return
|
move KeyboardInterrupt handling into repl
Catching KeyboardInterrupt in the CrateCmd makes it impossible to
interrupt processes that use the CrateCmd class (Like the doctests in
Crate do)
This commit moves the KeyboardInterrupt handling into the repl module so
that it will only be caught if crash is used interactively. (That was
the original intention when it was added.)
|
crate_crash
|
train
|
py,py
|
96fd3e97d9c5511296a9cbae66abf147ad5d34ff
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
-VERSION = '2.1.0'
+VERSION = '2.2.0'
long_description = 'This package contains the tools you need to quickly ' \
'integrate your Python back-end with Yoti, so that your ' \
'users can share their identity details with your ' \
|
[SDK-<I>]: Bumped version to <I>
|
getyoti_yoti-python-sdk
|
train
|
py
|
12bbc63bbff51fdb6cf375f350b87c2f3579f4f1
|
diff --git a/scapy/sendrecv.py b/scapy/sendrecv.py
index <HASH>..<HASH> 100644
--- a/scapy/sendrecv.py
+++ b/scapy/sendrecv.py
@@ -74,7 +74,7 @@ def _sndrcv_snd(pks, timeout, inter, verbose, tobesent, hsent, timessent, stopev
except KeyboardInterrupt:
pass
except Exception:
- log_runtime.info("--- Error sending packets", exc_info=True)
+ log_runtime.exception("--- Error sending packets")
if timeout is not None:
stopevent.wait(timeout)
stopevent.set()
|
fixed tracing error in sending thread
|
secdev_scapy
|
train
|
py
|
45ed2a8f1ef0c2a48080a4ef152e78c39f887994
|
diff --git a/nazs/module.py b/nazs/module.py
index <HASH>..<HASH> 100644
--- a/nazs/module.py
+++ b/nazs/module.py
@@ -278,7 +278,8 @@ class Module(object):
# Check model changes
for model in self.models():
- if model.objects.changed().count():
+ if model.objects.changed().count() or \
+ model.objects.deleted().count():
return True
# Nothing passed, module not changed
|
Fix changed property when we have deleted items
|
exekias_droplet
|
train
|
py
|
0b6051fddc103a9ee38cc3b07cdccce7449ccba8
|
diff --git a/simpla.js b/simpla.js
index <HASH>..<HASH> 100644
--- a/simpla.js
+++ b/simpla.js
@@ -19,7 +19,7 @@
var protocol = _ref.protocol;
var host = _ref.host;
- var pathname = _ref.pathname;
+ var pathname = _ref.pathname.replace(/(^\/?)/,"/");
var path = function () {
|
sanitize pathname leading slash for IE
|
simplajs_simpla
|
train
|
js
|
6659306d3b4e227cc9eb8385cbdee2e82a0b4902
|
diff --git a/nailgun/entities.py b/nailgun/entities.py
index <HASH>..<HASH> 100644
--- a/nailgun/entities.py
+++ b/nailgun/entities.py
@@ -627,7 +627,13 @@ class Capsule(Entity, EntityReadMixin, EntitySearchMixin):
return super(Capsule, self).path(which)
-class CommonParameter(Entity):
+class CommonParameter(
+ Entity,
+ EntityCreateMixin,
+ EntityDeleteMixin,
+ EntityReadMixin,
+ EntitySearchMixin,
+ EntityUpdateMixin):
"""A representation of a Common Parameter entity."""
def __init__(self, server_config=None, **kwargs):
|
Update CommonParameters entity.
|
SatelliteQE_nailgun
|
train
|
py
|
570fb3374742fc7d64a0449a69ddfbdcd55699a2
|
diff --git a/src/Form/StorageSettingsForm.php b/src/Form/StorageSettingsForm.php
index <HASH>..<HASH> 100644
--- a/src/Form/StorageSettingsForm.php
+++ b/src/Form/StorageSettingsForm.php
@@ -55,6 +55,13 @@ class StorageSettingsForm extends ConfigFormBase {
return parent::buildForm($form, $form_state);
}
+ public function validateForm(array &$form, FormStateInterface $form_state) {
+ parent::validateForm(
+ $form,
+ $form_state
+ ); // TODO: Change the autogenerated stub
+ }
+
/**
* {@inheritdoc}
*/
diff --git a/src/Plugin/DataType/StrawberryValuesFromFlavorJson.php b/src/Plugin/DataType/StrawberryValuesFromFlavorJson.php
index <HASH>..<HASH> 100644
--- a/src/Plugin/DataType/StrawberryValuesFromFlavorJson.php
+++ b/src/Plugin/DataType/StrawberryValuesFromFlavorJson.php
@@ -9,6 +9,7 @@ use Swaggest\JsonSchema\Exception as JsonSchemaException;
use Swaggest\JsonSchema\InvalidValue as JsonSchemaInvalidValue;
use Drupal\Core\Entity\Plugin\DataType\EntityAdapter;
use frictionlessdata\datapackage\Package;
+use Drupal\strawberryfield\Plugin\Field\FieldType\StrawberryFieldItem;
class StrawberryValuesFromFlavorJson extends Map {
|
Small changes, a missing use statement and a Stub for our settings validation
|
esmero_strawberryfield
|
train
|
php,php
|
3ec915488d1f9732ecbaedd0d92c646a31a55095
|
diff --git a/Twig/CssVersionExtension.php b/Twig/CssVersionExtension.php
index <HASH>..<HASH> 100644
--- a/Twig/CssVersionExtension.php
+++ b/Twig/CssVersionExtension.php
@@ -21,7 +21,7 @@ class CssVersionExtension extends Twig_Extension {
if (file_exists($file))
$string = "?v=" . substr(md5_file($file), 0, 5);
else
- return '';
+ return '?v=' . substr(sha1(microtime()), 0, 6);
return $string;
}
|
add random version when file doesn't exists
|
pmdevelopment_tool-bundle
|
train
|
php
|
9b26d66af1895b2b277bc60a32232f0f9f62f38e
|
diff --git a/src/sos/utils.py b/src/sos/utils.py
index <HASH>..<HASH> 100644
--- a/src/sos/utils.py
+++ b/src/sos/utils.py
@@ -743,12 +743,12 @@ def expand_size(size):
def find_symbolic_links(item):
item = os.path.expanduser(item)
- if os.path.isfile(item):
- return {}
- elif os.path.islink(item):
+ if os.path.islink(item):
if not os.path.exists(item):
env.logger.warning('Non-existent symbolic link {}'.format(item))
return {item: os.path.realpath(item)}
+ elif os.path.isfile(item):
+ return {}
else:
result = {}
for x in os.listdir(item):
|
Fix locating symbolic link if the file itself is a symbolic link
|
vatlab_SoS
|
train
|
py
|
1212c1d80d31f1fd9ab7f3adefbde4eacdbf5ff4
|
diff --git a/src/Guzzle/Http/Message/Header/HeaderCollection.php b/src/Guzzle/Http/Message/Header/HeaderCollection.php
index <HASH>..<HASH> 100644
--- a/src/Guzzle/Http/Message/Header/HeaderCollection.php
+++ b/src/Guzzle/Http/Message/Header/HeaderCollection.php
@@ -47,6 +47,16 @@ class HeaderCollection implements \IteratorAggregate, \Countable, \ArrayAccess,
}
/**
+ * Get an array of header objects
+ *
+ * @return array
+ */
+ public function getAll()
+ {
+ return $this->headers;
+ }
+
+ /**
* Alias of offsetGet
*/
public function get($key)
@@ -95,14 +105,4 @@ class HeaderCollection implements \IteratorAggregate, \Countable, \ArrayAccess,
return $result;
}
-
- /**
- * Get an array of header objects
- *
- * @return array
- */
- public function getAll()
- {
- return $this->headers;
- }
}
|
Cleaning up HeaderCollection docblock
|
guzzle_guzzle3
|
train
|
php
|
910297d2a3f2db86dde51b0e10fe5aad45f1aa1a
|
diff --git a/tests/Generated/Models/Page.php b/tests/Generated/Models/Page.php
index <HASH>..<HASH> 100644
--- a/tests/Generated/Models/Page.php
+++ b/tests/Generated/Models/Page.php
@@ -49,14 +49,6 @@ class Page extends CmsModel
'seo_description',
];
- protected $hidden = [
- 'news',
- 'e_active',
- 'e_position',
- 'e_category_id',
- 'e_user_id',
- ];
-
protected $relationsConfig = [
'showInMenu' => [
'field' => 102,
|
Updated test to match new hidden default
|
czim_laravel-pxlcms
|
train
|
php
|
b6e42cb8a9a854b1c13ec6af097f6e899050fea9
|
diff --git a/lib/blockdevice.js b/lib/blockdevice.js
index <HASH>..<HASH> 100644
--- a/lib/blockdevice.js
+++ b/lib/blockdevice.js
@@ -75,7 +75,7 @@ BlockDevice.prototype = {
return this.close( function( error ) {
if( error != null )
return callback.call( self, error )
- self.open( self.path, self.mode, callback )
+ self.open( callback )
})
}
@@ -155,6 +155,7 @@ BlockDevice.prototype = {
var block = new Buffer( size )
self.fs.read( self.fd, block, 0, size, 0, function( error, bytesRead ) {
+
if( error != null ) {
// EINVAL tells us that the block size
// ain't just right (yet); everything
diff --git a/test/index.js b/test/index.js
index <HASH>..<HASH> 100644
--- a/test/index.js
+++ b/test/index.js
@@ -21,6 +21,10 @@ describe( 'BlockDevice', function() {
device.open( next )
})
+ it( 'repeat device.open()', function( next ) {
+ device.open( next )
+ })
+
it( 'device.readBlocks()', function( next ) {
device.readBlocks( 0, 1, next )
})
|
Update lib/blockdevice: Fix repeat open() erroring
|
jhermsmeier_node-blockdevice
|
train
|
js,js
|
52d9482d9bfa627f3dfec72e08f0be57f6a911ef
|
diff --git a/lib/neo4j/active_node/scope.rb b/lib/neo4j/active_node/scope.rb
index <HASH>..<HASH> 100644
--- a/lib/neo4j/active_node/scope.rb
+++ b/lib/neo4j/active_node/scope.rb
@@ -112,13 +112,12 @@ module Neo4j::ActiveNode
end
end
+ # method_missing is not delegated to super class but to aggregated class
+ # rubocop:disable Style/MethodMissingSuper
def method_missing(name, *params, &block)
- if query_proxy_or_target.respond_to?(name)
- query_proxy_or_target.public_send(name, *params, &block)
- else
- super
- end
+ query_proxy_or_target.public_send(name, *params, &block)
end
+ # rubocop:enable Style/MethodMissingSuper
private
|
Fixing method missing of ScopeEvalContext
|
neo4jrb_neo4j
|
train
|
rb
|
c95557af27c03af293b8f1ee3ebfa9de318caf85
|
diff --git a/builtin/providers/aws/resource_aws_elasticache_cluster.go b/builtin/providers/aws/resource_aws_elasticache_cluster.go
index <HASH>..<HASH> 100644
--- a/builtin/providers/aws/resource_aws_elasticache_cluster.go
+++ b/builtin/providers/aws/resource_aws_elasticache_cluster.go
@@ -337,6 +337,11 @@ func CacheClusterStateRefreshFunc(conn *elasticache.ElastiCache, clusterID, give
// return given state if it's not in pending
if givenState != "" {
+ // check to make sure we have the node count we're expecting
+ if int64(len(c.CacheNodes)) != *c.NumCacheNodes {
+ log.Printf("[DEBUG] Node count is not what is expected: %d found, %d expected", len(c.CacheNodes), *c.NumCacheNodes)
+ return nil, "creating", nil
+ }
// loop the nodes and check their status as well
for _, n := range c.CacheNodes {
if n.CacheNodeStatus != nil && *n.CacheNodeStatus != "available" {
|
Check node length to match expected node count
|
hashicorp_terraform
|
train
|
go
|
95a4d74ce1a318949407eb4d83ad3cd9e054a2e6
|
diff --git a/src/MB_Toolbox_BaseConsumer.php b/src/MB_Toolbox_BaseConsumer.php
index <HASH>..<HASH> 100644
--- a/src/MB_Toolbox_BaseConsumer.php
+++ b/src/MB_Toolbox_BaseConsumer.php
@@ -132,7 +132,7 @@ abstract class MB_Toolbox_BaseConsumer
*
* @return string
*/
- function isSerialized($message) {
+ protected function isSerialized($message) {
return ($message == serialize(false) || @unserialize($message) !== false);
}
|
Add method scope to isSerialized()
|
DoSomething_mb-toolbox
|
train
|
php
|
c0bbbf7e6a6c0953e67b925c0b0732b264e87c33
|
diff --git a/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java b/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
+++ b/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
@@ -944,7 +944,8 @@ public class AmazonS3Client extends AmazonWebServiceClient implements AmazonS3 {
request.addHeader(Headers.STORAGE_CLASS, putObjectRequest.getStorageClass());
}
- if (metadata.getContentLength() <= 0) {
+ // Use internal interface to differentiate 0 from unset.
+ if (metadata.getRawMetadata().get(Headers.CONTENT_LENGTH) == null) {
/*
* There's nothing we can do except for let the HTTP client buffer
* the input stream contents if the caller doesn't tell us how much
|
Differentiate between 0 and unset content length when deciding whether to warm about stream buffering in memory.
|
aws_aws-sdk-java
|
train
|
java
|
40b44cec467524eee6cda4684dee332be06fbf46
|
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 collections import OrderedDict
import csv
import datetime
+import dateutil
import math
import os
import random
|
imports dateutil for parsing dates
|
ClimbsRocks_auto_ml
|
train
|
py
|
be236478af3966d51ae2b0480c7c3c45dae4ed99
|
diff --git a/lib/couchClient.php b/lib/couchClient.php
index <HASH>..<HASH> 100644
--- a/lib/couchClient.php
+++ b/lib/couchClient.php
@@ -68,7 +68,8 @@ class couchClient extends couch {
"group_level" => array ("name" => "group_level", "filter"=>"int"),
"reduce" => array ("name" => "reduce", "filter"=>"jsonEncodeBoolean"),
"include_docs" => array ("name" => "include_docs", "filter"=>"jsonEncodeBoolean"),
- "inclusive_end" => array ("name" => "inclusive_end", "filter"=>"jsonEncodeBoolean")
+ "inclusive_end" => array ("name" => "inclusive_end", "filter"=>"jsonEncodeBoolean"),
+ "attachments" => array ("name" => "attachments", "filter"=>"jsonEncodeBoolean"),
);
|
Added view parameter attachments
Added view parameter attachments to include attachments in returned docs.
|
dready92_PHP-on-Couch
|
train
|
php
|
1c27b369517c1c6795d64dd12db38f312c5ee185
|
diff --git a/peewee.py b/peewee.py
index <HASH>..<HASH> 100644
--- a/peewee.py
+++ b/peewee.py
@@ -4466,7 +4466,7 @@ class ModelOptions(object):
self.valid_fields = set()
self.declared_fields = []
- self.database = database or default_database
+ self.database = database if database is not None else default_database
self.db_table = db_table
self.db_table_func = db_table_func
self.indexes = list(indexes or [])
|
Check database explicitly for None in ModelOptions.
|
coleifer_peewee
|
train
|
py
|
adc7b49bcc4dbbbcccc5a7714a46208ad8337ee2
|
diff --git a/lltk/decorators.py b/lltk/decorators.py
index <HASH>..<HASH> 100755
--- a/lltk/decorators.py
+++ b/lltk/decorators.py
@@ -3,6 +3,21 @@
from functools import wraps
+def language(l):
+ ''' Use this as a decorator (implicitly or explicitly). '''
+
+ # Usage: @language('en') or function = language('en')(function)
+
+ def decorator(f):
+ ''' Decorator used to prepend the language as an argument. '''
+
+ @wraps(f)
+ def wrapper(*args, **kwargs):
+ return f(l, *args, **kwargs)
+ return wrapper
+
+ return decorator
+
def _load_language(f):
''' Decorator used to load a custom method for a given language. '''
|
Add language() decorator in decorators.py
|
lltk_lltk
|
train
|
py
|
249b21af1362fbfbc3c8a31b314ae2b42487fade
|
diff --git a/tests/Webfactory/Doctrine/ORMTestInfrastructure/ORMInfrastructureTest.php b/tests/Webfactory/Doctrine/ORMTestInfrastructure/ORMInfrastructureTest.php
index <HASH>..<HASH> 100644
--- a/tests/Webfactory/Doctrine/ORMTestInfrastructure/ORMInfrastructureTest.php
+++ b/tests/Webfactory/Doctrine/ORMTestInfrastructure/ORMInfrastructureTest.php
@@ -13,7 +13,12 @@ class ORMInfrastructureTest extends \PHPUnit_Framework_TestCase
*/
public function testGetEntityManagerReturnsDoctrineEntityManager()
{
+ $infrastructure = new ORMInfrastructure(array(
+ 'Webfactory\Doctrine\ORMTestInfrastructure\ORMInfrastructureTest\TestEntity'
+ ));
+ $entityManager = $infrastructure->getEntityManager();
+ $this->assertInstanceOf('Doctrine\ORM\EntityManager', $entityManager);
}
/**
@@ -39,6 +44,14 @@ class ORMInfrastructureTest extends \PHPUnit_Framework_TestCase
}
/**
+ * Checks if an imported entity receives a generated ID.
+ */
+ public function testEntityIdIsAvailableAfterImport()
+ {
+
+ }
+
+ /**
* Ensures that entities with non-Doctrine annotations can be used.
*/
public function testInfrastructureCanUseEntitiesWithNonDoctrineAnnotations()
|
implemented first test; added test stub
|
webfactory_doctrine-orm-test-infrastructure
|
train
|
php
|
0f87e2c45af949abc5f659e87e371a95a08c26f2
|
diff --git a/lib/geokit/mappable.rb b/lib/geokit/mappable.rb
index <HASH>..<HASH> 100644
--- a/lib/geokit/mappable.rb
+++ b/lib/geokit/mappable.rb
@@ -74,7 +74,7 @@ module Geokit
to_lat=deg2rad(to.lat)
y=Math.sin(d_lng) * Math.cos(to_lat)
x=Math.cos(from_lat)*Math.sin(to_lat)-Math.sin(from_lat)*Math.cos(to_lat)*Math.cos(d_lng)
- heading=to_heading(Math.atan2(y,x))
+ to_heading(Math.atan2(y,x))
end
# Given a start point, distance, and heading (in degrees), provides
|
warning: assigned but unused variable - heading
|
geokit_geokit
|
train
|
rb
|
327c531d900e62c19feb30f6e5343aaf3ae0d5fc
|
diff --git a/odl/discr/discr_ops.py b/odl/discr/discr_ops.py
index <HASH>..<HASH> 100644
--- a/odl/discr/discr_ops.py
+++ b/odl/discr/discr_ops.py
@@ -201,9 +201,6 @@ def finite_diff(f, out=None, axis=0, dx=1.0, edge_order=2,
# one-sided differences
else:
- if method != 'central':
- raise NotImplementedError('Can only use zero padding with non-'
- 'central differences')
# Numerical differentiation: 1st order edges
if f_data.shape[axis] == 2 or edge_order == 1:
|
ENH: allow non zero padding with forward/backward diff
|
odlgroup_odl
|
train
|
py
|
e6399148780557dfb69bfc7f779d394d96877e4f
|
diff --git a/pysat/_constellation.py b/pysat/_constellation.py
index <HASH>..<HASH> 100644
--- a/pysat/_constellation.py
+++ b/pysat/_constellation.py
@@ -1,5 +1,6 @@
import collections
import importlib
+import warnings
import numpy as np
import pandas as pds
@@ -176,6 +177,12 @@ class Constellation(object):
'bin' (the values of the bin edges.)
"""
+ warnings.warn(' '.join(["constellation.add is deprecated and will be",
+ "removed in pysat 3.0.0. This functionality",
+ "will be added to pysatSeasons in the"
+ "future."]),
+ DeprecationWarning, stacklevel=2)
+
# TODO Update for 2.7 compatability.
if isinstance(data_label, str):
data_label = [data_label, ]
@@ -387,6 +394,12 @@ class Constellation(object):
return { 'data': data_df, 'start':start, 'end':end }
"""
+ warnings.warn(' '.join(["constellation.difference is deprecated and",
+ "will be removed in pysat 3.0.0. This",
+ "functionality will be added to pysatSeasons"
+ "in the future."]),
+ DeprecationWarning, stacklevel=2)
+
labels = [dl1 for dl1, dl2 in data_labels] + \
['1_' + b[0] for b in bounds] + ['2_' + b[1] for b in bounds] + \
['dist']
|
WRN: Add deprecation warnings to constellation functions
|
rstoneback_pysat
|
train
|
py
|
aaea3ffafc62ba6a7e548702d3387a39167dbbcf
|
diff --git a/src/OAuthClient.js b/src/OAuthClient.js
index <HASH>..<HASH> 100644
--- a/src/OAuthClient.js
+++ b/src/OAuthClient.js
@@ -675,7 +675,12 @@ OAuthClient.prototype.createError = function(e, authResponse) {
if(!authResponse || authResponse.body == ""){
- e.error = e.originalMessage;
+ e.error = e.originalMessage || '';
+ e.authResponse = authResponse || ''
+ e.intuit_tid = authResponse.headers()['intuit_tid'] || '';
+ e.originalMessage = authResponse.response.statusText || '';
+ e.error = authResponse.response.statusText || '';
+ e.error_description = authResponse.response.statusText || '';
return e;
}
|
Improved Error Message for HTTP4XX Calls
|
intuit_oauth-jsclient
|
train
|
js
|
27398ed151ce3200eae267eed303e475755b872b
|
diff --git a/salt/config.py b/salt/config.py
index <HASH>..<HASH> 100644
--- a/salt/config.py
+++ b/salt/config.py
@@ -344,6 +344,7 @@ def master_config(path):
'serial': 'msgpack',
'state_verbose': True,
'state_output': 'full',
+ 'search': '',
'nodegroups': {},
'cython_enable': False,
'key_logfile': '/var/log/salt/key',
|
Add search to master defualts
|
saltstack_salt
|
train
|
py
|
6f187b2f72daf0cd93d04beff0e79f19a833b3c1
|
diff --git a/lib/fog/core/service.rb b/lib/fog/core/service.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/core/service.rb
+++ b/lib/fog/core/service.rb
@@ -18,6 +18,26 @@ module Fog
class << self
+ # this is to accomodate Real implementations of Service subclasses
+ # NOTE: it might be good to enforce parameter specs to Mock classes as well.
+ def inject_parameter_specs
+ lambda do |spec|
+ implementation = "Real"
+ self.const_set(implementation, Class.new) unless self.const_defined? implementation
+ realclass = self.const_get implementation
+
+ if realclass.declared_parameters_for(:'self.new', :required).empty?
+ required = declared_parameters_for(:'self.new', :required)
+ realclass.send(:requires, *required)
+ end
+
+ if realclass.declared_parameters_for(:'self.new', :optional).empty?
+ optional = declared_parameters_for(:'self.new', :optional)
+ realclass.send(:recognizes, *optional)
+ end
+ end
+ end
+
def inherited(child)
child.class_eval <<-EOS, __FILE__, __LINE__
module Collections
@@ -35,7 +55,7 @@ module Fog
end
def requirements
- declared_parameters_for :new, :required
+ declared_parameters_for :'self.new', :required
end
def new(options={})
|
Added self.inject_parameter_specs: this returns a block that is used to apply the service's parameter requirements to its Real implementation
|
fog_fog
|
train
|
rb
|
f1f1b3bc7e611450dc06ed1b2c4c90cd7ce7c907
|
diff --git a/core/src/main/java/com/threerings/presents/net/Transport.java b/core/src/main/java/com/threerings/presents/net/Transport.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/threerings/presents/net/Transport.java
+++ b/core/src/main/java/com/threerings/presents/net/Transport.java
@@ -145,7 +145,8 @@ public class Transport
if (_unordered == null) {
int length = Type.values().length;
_unordered = new Transport[length];
- @SuppressWarnings("unchecked") HashIntMap<Transport>[] ordered = new HashIntMap[length];
+ @SuppressWarnings({ "unchecked", "rawtypes" }) HashIntMap<Transport>[] ordered =
+ new HashIntMap[length];
_ordered = ordered;
}
|
Complain not about rawtypes here javac7.
|
threerings_narya
|
train
|
java
|
66c994ac43347c735f0ea4158b38557d32ec5747
|
diff --git a/lib/puppet/interface.rb b/lib/puppet/interface.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/interface.rb
+++ b/lib/puppet/interface.rb
@@ -114,6 +114,7 @@ class Puppet::Interface
def load_actions
path = "puppet/interface/#{name}"
+ loaded = []
self.class.autoloader.search_directories.each do |dir|
fdir = ::File.join(dir, path)
next unless FileTest.directory?(fdir)
@@ -121,6 +122,11 @@ class Puppet::Interface
Dir.chdir(fdir) do
Dir.glob("*.rb").each do |file|
aname = file.sub(/\.rb/, '')
+ if loaded.include?(aname)
+ Puppet.debug "Not loading duplicate action '#{aname}' for '#{name}' from '#{fdir}/#{file}'"
+ next
+ end
+ loaded << aname
Puppet.debug "Loading action '#{aname}' for '#{name}' from '#{fdir}/#{file}'"
require "#{path}/#{aname}"
end
|
Attempting to skip loading of duplicate actions
|
puppetlabs_puppet
|
train
|
rb
|
bda5c0408c52e6ed17ed60dfec71a93ee0b92fb2
|
diff --git a/eZ/Publish/Core/REST/Server/Controller/ContentType.php b/eZ/Publish/Core/REST/Server/Controller/ContentType.php
index <HASH>..<HASH> 100644
--- a/eZ/Publish/Core/REST/Server/Controller/ContentType.php
+++ b/eZ/Publish/Core/REST/Server/Controller/ContentType.php
@@ -593,6 +593,8 @@ class ContentType extends RestController
new Message(
array(
'Content-Type' => $this->request->contentType,
+ // @todo Needs refactoring! Temporary solution so parser has access to URL
+ 'Url' => $this->request->path
),
$this->request->body
)
|
EZP-<I>: pass URL to the FieldDefinitionUpdate parser, required to resolve field type
|
ezsystems_ezpublish-kernel
|
train
|
php
|
b084c2b5eb58e89146bfcd81f563f0d7b3a3e2ed
|
diff --git a/test/index.js b/test/index.js
index <HASH>..<HASH> 100644
--- a/test/index.js
+++ b/test/index.js
@@ -163,6 +163,14 @@ describe('depcheck', () => {
},
}));
+ it('should generate ASTs when multiple globs match filename', () =>
+ testCustomPluggableComponents('multiple_parsers', {
+ parsers: {
+ '*.csv': multipleParserA,
+ 'index.*': multipleParserB,
+ },
+ }));
+
it('should use custom detector to find dependencies', () =>
testCustomPluggableComponents('depend', {
detectors: [
|
Add test about filename matches multiple globs.
|
depcheck_depcheck
|
train
|
js
|
0b64631dacde5df244ebb8ac564b1d794cba7371
|
diff --git a/src/main/java/org/primefaces/extensions/component/layout/Layout.java b/src/main/java/org/primefaces/extensions/component/layout/Layout.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/primefaces/extensions/component/layout/Layout.java
+++ b/src/main/java/org/primefaces/extensions/component/layout/Layout.java
@@ -291,7 +291,7 @@ public class Layout extends UIComponentBase implements Widget, ClientBehaviorHol
double height = Double.valueOf(params.get(clientId + "_height"));
ResizeEvent resizeEvent = new ResizeEvent(pane, behaviorEvent.getBehavior(), width, height);
- event.setPhaseId(behaviorEvent.getPhaseId());
+ resizeEvent.setPhaseId(behaviorEvent.getPhaseId());
super.queueEvent(resizeEvent);
return;
|
set PhaseId for resizeEvent corrected
|
primefaces-extensions_core
|
train
|
java
|
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.