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
afb16921f85b2279d9d29ba96c649110bef3c6db
diff --git a/lib/appsignal/agent.rb b/lib/appsignal/agent.rb index <HASH>..<HASH> 100644 --- a/lib/appsignal/agent.rb +++ b/lib/appsignal/agent.rb @@ -36,7 +36,7 @@ module Appsignal rescue Exception => ex Appsignal.logger.error "Exception while communicating with "\ "AppSignal: #{ex}" - handle_result nil + stop_logging end end diff --git a/spec/appsignal/agent_spec.rb b/spec/appsignal/agent_spec.rb index <HASH>..<HASH> 100644 --- a/spec/appsignal/agent_spec.rb +++ b/spec/appsignal/agent_spec.rb @@ -25,7 +25,7 @@ describe Appsignal::Agent do it "handles exceptions in transmit" do subject.transmitter.stub(:transmit).and_raise(Exception.new) - subject.should_receive(:handle_result).with(nil) + subject.should_receive(:stop_logging) Appsignal.logger.should_receive(:error). with('Exception while communicating with AppSignal: Exception') end
Directly stop logging after a transmit exception
appsignal_appsignal-ruby
train
rb,rb
56bffdd126d1fa167c8a193ded1018cccc486f2a
diff --git a/core-bundle/src/EventListener/InitializeSystemListener.php b/core-bundle/src/EventListener/InitializeSystemListener.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/EventListener/InitializeSystemListener.php +++ b/core-bundle/src/EventListener/InitializeSystemListener.php @@ -73,10 +73,11 @@ class InitializeSystemListener } $routeName = $request->attributes->get('_route'); + $route = $this->router->generate($routeName, $request->attributes->get('_route_params')); $this->setConstants( $this->getScopeFromRequest($request), - $this->router->generate($routeName, $request->attributes->get('_route_params')) + substr($route, strlen($request->getBasePath())) ); $this->boot($routeName, $request->getBasePath());
[Core] Set TL_SCRIPT to the relative base path
contao_contao
train
php
c956bcb13c287baf1d4ae1b2c9ae83d43423d67f
diff --git a/whisper/whisper.go b/whisper/whisper.go index <HASH>..<HASH> 100644 --- a/whisper/whisper.go +++ b/whisper/whisper.go @@ -16,8 +16,9 @@ import ( ) const ( - statusMsg = 0x0 - envelopesMsg = 0x01 + statusMsg = 0x0 + envelopesMsg = 0x01 + whisperVersion = 0x02 ) type MessageEvent struct { @@ -56,7 +57,7 @@ func New() *Whisper { // p2p whisper sub protocol handler whisper.protocol = p2p.Protocol{ Name: "shh", - Version: 2, + Version: uint(whisperVersion), Length: 2, Run: whisper.msgHandler, } @@ -64,6 +65,10 @@ func New() *Whisper { return whisper } +func (self *Whisper) Version() uint { + return self.protocol.Version +} + func (self *Whisper) Start() { wlogger.Infoln("Whisper started") go self.update()
Move version to const and expose via Version()
ethereum_go-ethereum
train
go
006c1921157fe5e223ce7f2711127ab8074804ad
diff --git a/lib/beaker-answers/version.rb b/lib/beaker-answers/version.rb index <HASH>..<HASH> 100644 --- a/lib/beaker-answers/version.rb +++ b/lib/beaker-answers/version.rb @@ -1,5 +1,5 @@ module BeakerAnswers module Version - STRING = '0.6.0' + STRING = '0.7.0' end end
(GEM) update beaker-answers version to <I>
puppetlabs_beaker-answers
train
rb
234a3a8ab998d20a715ce72e4a4992879469aaaf
diff --git a/lib/stax/stack.rb b/lib/stax/stack.rb index <HASH>..<HASH> 100644 --- a/lib/stax/stack.rb +++ b/lib/stax/stack.rb @@ -34,6 +34,10 @@ module Stax cf(:status, [stack_name], quiet: true) end + def stack_notification_arns + cf(:dump, [stack_name], quiet: true) + end + def exists? cf(:exists, [stack_name], quiet: true) end
add method to get notification arns from existing stack
rlister_stax
train
rb
de1fac629d61783e52327df7efea28a395d19d42
diff --git a/lib/kuppayam/version.rb b/lib/kuppayam/version.rb index <HASH>..<HASH> 100644 --- a/lib/kuppayam/version.rb +++ b/lib/kuppayam/version.rb @@ -1,3 +1,3 @@ module Kuppayam - VERSION = '0.1.1' + VERSION = '0.1.2' end
releasing the new version of the gem after fixing the bug
right-solutions_kuppayam
train
rb
106b68afeacb3e21e9c1407931e2a790930815c3
diff --git a/lib/overcommit/hook_context/pre_push.rb b/lib/overcommit/hook_context/pre_push.rb index <HASH>..<HASH> 100644 --- a/lib/overcommit/hook_context/pre_push.rb +++ b/lib/overcommit/hook_context/pre_push.rb @@ -18,6 +18,18 @@ module Overcommit::HookContext end PushedRef = Struct.new(:local_ref, :local_sha1, :remote_ref, :remote_sha1) do + def forced? + `git rev-list #{remote_sha1} ^#{local_sha1}`.chomp.any? + end + + def created? + remote_sha1 == '0' * 40 + end + + def deleted? + local_sha1 == '0' * 40 + end + def to_s "#{local_ref} #{local_sha1} #{remote_ref} #{remote_sha1}" end
Add helpers to PushedRef Add helpers which indicate whether the ref has been created, deleted, or force-pushed.
sds_overcommit
train
rb
a21fd85b0845cd7ab3dbe19ab5982f6530127c53
diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb index <HASH>..<HASH> 100644 --- a/lib/sinatra/base.rb +++ b/lib/sinatra/base.rb @@ -1,3 +1,4 @@ +# coding: utf-8 # frozen_string_literal: true # external dependencies @@ -1532,6 +1533,10 @@ module Sinatra # Starts the server by running the Rack Handler. def start_server(handler, server_settings, handler_name) + # Ensure we initialize middleware before startup, to match standard Rack + # behavior, by ensuring an instance exists: + prototype + # Run the instance we created: handler.run(self, server_settings) do |server| unless supress_messages? $stderr.puts "== Sinatra (v#{Sinatra::VERSION}) has taken the stage on #{port} for #{environment} with backup from #{handler_name}"
Initialize middleware before first request, as is the case with direct Rack usage.
sinatra_sinatra
train
rb
a6ebaff0549853f6dcd770af70005bd80a738709
diff --git a/lib/nodes/bundle.js b/lib/nodes/bundle.js index <HASH>..<HASH> 100644 --- a/lib/nodes/bundle.js +++ b/lib/nodes/bundle.js @@ -146,8 +146,8 @@ var BundleNode = exports.BundleNode = INHERIT(MagicNode, { arch.setNode(buildNode); - bundleNode && arch.link(buildNode, bundleNode); - magicNode && arch.link(magicNode, buildNode); + bundleNode && arch.addParents(buildNode, bundleNode); + magicNode && arch.addChildren(buildNode, magicNode); arch.setNode(buildNode.getMetaNode(), buildNode,
Use new Arch API in BundleNode
bem-archive_bem-tools
train
js
0d09532697f784922416cba004e45b9a71680dc7
diff --git a/lib/dot_grid/cli.rb b/lib/dot_grid/cli.rb index <HASH>..<HASH> 100644 --- a/lib/dot_grid/cli.rb +++ b/lib/dot_grid/cli.rb @@ -8,7 +8,7 @@ module DotGrid version "dot_grid #{DotGrid::VERSION}" opt :file_name, "File Name", :type => :string, :default => "dotgrid.pdf" opt :orientation, "Orientation of pages (portrait/landscape)", type: :string, default: "portrait" - opt :page_types, "Types of pages desired: Types of pages desired: DotGrid, Planner, Grid, HorizontalRule, Checkerboard", type: :string, default: "Planner" + opt :page_types, "Types of pages desired: Types of pages desired: DotGrid, Planner, Grid, HorizontalRule, Checkerboard", type: :string, default: "planner" opt :dot_weight, "Dot Weight", :type => :float, :default => 1.5 opt :margin, "Border", :type => :float, :default => 0.0 opt :page_size, "Page Size (LEGAL, LETTER)", :type => :string, :default => "LETTER"
Lower Case 'Planner' so Correct
slabounty_dot_grid
train
rb
1bd7b888700df26b651e1a212d67015aeb9705f0
diff --git a/library/src/main/java/hotchemi/android/rate/AppRate.java b/library/src/main/java/hotchemi/android/rate/AppRate.java index <HASH>..<HASH> 100644 --- a/library/src/main/java/hotchemi/android/rate/AppRate.java +++ b/library/src/main/java/hotchemi/android/rate/AppRate.java @@ -96,23 +96,23 @@ public class AppRate { } public static boolean showRateDialogIfMeetsConditions(Activity activity) { - if (singleton.isDebug || singleton.shouldShowRateDialog()) { + boolean isMeetsConditions = singleton.isDebug || singleton.shouldShowRateDialog(); + if (isMeetsConditions) { singleton.showRateDialog(activity); - return true; } - return false; + return isMeetsConditions; } public static boolean passSignificantEvent(Activity activity) { - if (singleton.isDebug || singleton.isOverEventPass()) { + boolean isMeetsConditions = singleton.isDebug || singleton.isOverEventPass(); + if (isMeetsConditions) { singleton.showRateDialog(activity); - return true; } else { Context context = activity.getApplicationContext(); int eventTimes = PreferenceHelper.getEventTimes(context); PreferenceHelper.setEventTimes(context, ++eventTimes); - return false; } + return isMeetsConditions; } public void showRateDialog(Activity activity) {
fix sample and refactoring.
hotchemi_Android-Rate
train
java
2d485f42e2d0288fb095e8d5624d025673825277
diff --git a/tests/test_industrial_test.py b/tests/test_industrial_test.py index <HASH>..<HASH> 100644 --- a/tests/test_industrial_test.py +++ b/tests/test_industrial_test.py @@ -243,6 +243,7 @@ class FakeStepAttempt: return iter(self.result) def iter_steps(self, client): + yield self.stage.as_result() yield self.stage.as_result(self.result[0][1]) @@ -1874,8 +1875,11 @@ class TestAttemptSuite(TestCase): steps = list(attempt_suite._iter_bs_manager_steps( bs_manager, client, fake_bootstrap(), True)) self.assertEqual([ + {'test_id': 'fake-bootstrap-id'}, {'test_id': 'fake-bootstrap-id', 'result': '1'}, + {'test_id': 'fake-1-id'}, {'test_id': 'fake-1-id', 'result': '1'}, + {'test_id': 'fake-2-id'}, {'test_id': 'fake-2-id', 'result': '1'}, {'test_id': 'destroy-env'}, {'test_id': 'destroy-env', 'result': True},
Add initial yield to FakeStepAttempt.
juju_juju
train
py
76b528cbb96510d70775358ace2670a9141118f6
diff --git a/bulbs/videos/api.py b/bulbs/videos/api.py index <HASH>..<HASH> 100644 --- a/bulbs/videos/api.py +++ b/bulbs/videos/api.py @@ -56,12 +56,13 @@ class VideoViewSet(viewsets.ModelViewSet): raise ImproperlyConfigured("Video encoding settings aren't defined.") base_url = "s3://%s" % s3_path + default_notification_url = request.build_absolute_uri(reverse('bulbs.videos.views.notification')) payload = { 'input': '%s/original' % base_url, 'outputs': [], 'notifications': [{ - "url": request.build_absolute_uri(reverse('bulbs.videos.views.notification')), + "url": settings.VIDEO_ENCODING.get("notification_url", default_notification_url), "format": "json" }] } diff --git a/bulbs/videos/views.py b/bulbs/videos/views.py index <HASH>..<HASH> 100644 --- a/bulbs/videos/views.py +++ b/bulbs/videos/views.py @@ -13,7 +13,7 @@ from django.views.decorators.cache import cache_control from .models import Video - +@cache_control(no_cache=True) @csrf_exempt def notification(request): if request.method != "POST":
Adding a notification endpoint settings
theonion_django-bulbs
train
py,py
7f8ae4fedf59a4fd14bb799a19b0202822c0493a
diff --git a/i3pystatus/mem.py b/i3pystatus/mem.py index <HASH>..<HASH> 100644 --- a/i3pystatus/mem.py +++ b/i3pystatus/mem.py @@ -1,6 +1,8 @@ from i3pystatus import IntervalModule from psutil import virtual_memory +MEGABYTE = 1024**2 + class Mem(IntervalModule): """ Shows memory load @@ -19,15 +21,10 @@ class Mem(IntervalModule): def run(self): vm = virtual_memory() - avail_mem = int(round(vm.available/1024, 0)) - used_mem = int(round(vm.used/1024, 0)) - percent_used_mem = int(round(vm.percent/1024, 0)) - total_mem = int(round(vm.total/1024, 0)) - #free_swap = int(round(phymem_usage().free/1024,0)) self.output = { "full_text" : self.format.format( - used_mem=used_mem, - avail_mem=avail_mem, - total_mem=total_mem, - percent_used_mem=percent_used_mem) + used_mem=int(round(vm.used/MEGABYTE, 0)), + avail_mem=int(round(vm.available/MEGABYTE, 0)), + total_mem=int(round(vm.total/MEGABYTE, 0)), + percent_used_mem=vm.percent) }
mem: correct divider to megabyte (was kilobyte), don't divide percentage #<I>
enkore_i3pystatus
train
py
06e9cfdc6712aa98ed147d472bda6afddc006b81
diff --git a/run/repo-version.js b/run/repo-version.js index <HASH>..<HASH> 100644 --- a/run/repo-version.js +++ b/run/repo-version.js @@ -12,6 +12,8 @@ const repoVersion = describeProc.stdout let repoBranch; if (process.env.TRAVIS_BRANCH) { repoBranch = process.env.TRAVIS_BRANCH; +} else if (process.env.CIRCLE_BRANCH) { + repoBranch = process.env.CIRCLE_BRANCH; } else { const revProc = spawnSync("git", ["rev-parse", "--abbrev-ref", "HEAD"]); repoBranch = revProc.stdout.toString().trim();
allow circleci to determine the right branch
streamplace_streamplace
train
js
4e9954222b7843a6ce20f7a72c0e320c244ab66b
diff --git a/webpack.config.build.js b/webpack.config.build.js index <HASH>..<HASH> 100644 --- a/webpack.config.build.js +++ b/webpack.config.build.js @@ -28,7 +28,6 @@ module.exports = [ output: { path: path.join(__dirname, 'dist'), filename: 'react-fullpage.js', - library: 'ReactFullpage', libraryTarget: 'commonjs2', }, }),
- Fixing common js builds after webpack upgrade
alvarotrigo_react-fullpage
train
js
edc44f11310b2d035a8c48fe9ea802a3b97365eb
diff --git a/oct2py/core.py b/oct2py/core.py index <HASH>..<HASH> 100644 --- a/oct2py/core.py +++ b/oct2py/core.py @@ -566,6 +566,8 @@ class Oct2Py(object): stream_handler(engine.repl.interrupt()) raise Oct2PyError('Timed out, interrupting') except EOF: + if not self._engine: + return stream_handler(engine.repl.child.before) self.restart() raise Oct2PyError('Session died, restarting')
Do not restart if we have intentionally exited, fixes #<I>
blink1073_oct2py
train
py
c5062edd6dca227a1d3a3a505da7d7d57251cccf
diff --git a/src/Field/Configurator/AssociationConfigurator.php b/src/Field/Configurator/AssociationConfigurator.php index <HASH>..<HASH> 100644 --- a/src/Field/Configurator/AssociationConfigurator.php +++ b/src/Field/Configurator/AssociationConfigurator.php @@ -57,6 +57,11 @@ final class AssociationConfigurator implements FieldConfiguratorInterface } if (true === $field->getCustomOption(AssociationField::OPTION_AUTOCOMPLETE)) { + $targetCrudControllerFqcn = $field->getCustomOption(AssociationField::OPTION_CRUD_CONTROLLER); + if (null === $targetCrudControllerFqcn) { + throw new \RuntimeException(sprintf('The "%s" field cannot be autocompleted because it doesn\'t define the related CRUD controller FQCN with the "setCrudController()" method.', $field->getProperty())); + } + // this enables autocompletion for compatible associations $field->setFormTypeOptionIfNotSet('attr.data-widget', 'select2');
Fixed an edge condition with autocomplete in Association fields
EasyCorp_EasyAdminBundle
train
php
7a74b78940014d099b1e41b676bf9973c57312e9
diff --git a/core/server/services/bulk-email/mailgun.js b/core/server/services/bulk-email/mailgun.js index <HASH>..<HASH> 100644 --- a/core/server/services/bulk-email/mailgun.js +++ b/core/server/services/bulk-email/mailgun.js @@ -40,7 +40,7 @@ function getInstance() { return null; } -// recipients format: +// recipientData format: // { // 'test@example.com': { // name: 'Test User', @@ -73,12 +73,17 @@ function send(message, recipientData, replacements) { to: Object.keys(recipientData), from: message.from, 'h:Reply-To': message.replyTo, - 'recipient-variables': recipientData, subject: messageContent.subject, html: messageContent.html, - text: messageContent.plaintext + text: messageContent.plaintext, + 'recipient-variables': recipientData }; + // add a reference to the original email record for easier mapping of mailgun event -> email + if (message.id) { + messageData['v:email-id'] = message.id; + } + if (bulkEmailConfig && bulkEmailConfig.mailgun && bulkEmailConfig.mailgun.tag) { messageData['o:tag'] = [bulkEmailConfig.mailgun.tag, 'bulk-email']; }
Included email-id as user variable when sending bulk emails via mailgun no issue - adding user variables via the mailgun API when sending emails means that events related to email have those variables attached to them - adding the `email.id` value to user variables means we can easily associate mailgun events to emails, otherwise we'd have look up the batch via `email_batches.provider_id` then use a join to get back to the associated email
TryGhost_Ghost
train
js
1c86a60b9145b5345048a56465b2f75ee984793d
diff --git a/spec/rubocop/formatter/json_formatter_spec.rb b/spec/rubocop/formatter/json_formatter_spec.rb index <HASH>..<HASH> 100644 --- a/spec/rubocop/formatter/json_formatter_spec.rb +++ b/spec/rubocop/formatter/json_formatter_spec.rb @@ -41,7 +41,8 @@ RSpec.describe RuboCop::Formatter::JSONFormatter do formatter.file_started(files[0], {}) expect(summary[:offense_count]).to eq(0) formatter.file_finished(files[0], [ - double('offense1'), double('offense2') + instance_double(RuboCop::Cop::Offense), + instance_double(RuboCop::Cop::Offense) ]) expect(summary[:offense_count]).to eq(2) end @@ -82,7 +83,12 @@ RSpec.describe RuboCop::Formatter::JSONFormatter do subject(:hash) { formatter.hash_for_file(file, offenses) } let(:file) { File.expand_path('spec/spec_helper.rb') } - let(:offenses) { [double('offense1'), double('offense2')] } + let(:offenses) do + [ + instance_double(RuboCop::Cop::Offense), + instance_double(RuboCop::Cop::Offense) + ] + end before do count = 0
Use verifying doubles in JsonFormatter spec
rubocop-hq_rubocop
train
rb
6709db481c113287d64340170248f0dae661665b
diff --git a/blueflood-core/src/main/java/com/rackspacecloud/blueflood/service/Configuration.java b/blueflood-core/src/main/java/com/rackspacecloud/blueflood/service/Configuration.java index <HASH>..<HASH> 100644 --- a/blueflood-core/src/main/java/com/rackspacecloud/blueflood/service/Configuration.java +++ b/blueflood-core/src/main/java/com/rackspacecloud/blueflood/service/Configuration.java @@ -148,13 +148,17 @@ public class Configuration { return list; } - @VisibleForTesting public void setProperty(String name, String val) { props.setProperty(name, val); } + public void setProperty(Enum<? extends ConfigDefaults> name, String value) { + setProperty(name.toString(), value); + } - @VisibleForTesting public void clearProperty(String name) { props.remove(name); } + public void clearProperty(Enum<? extends ConfigDefaults> name) { + clearProperty(name.toString()); + } }
Add methods to manually change config values, instead of having to set system properties.
rackerlabs_blueflood
train
java
d995bfba4269d09abd5a03edf97ee0af01d863e9
diff --git a/lib/capybara/selector.rb b/lib/capybara/selector.rb index <HASH>..<HASH> 100644 --- a/lib/capybara/selector.rb +++ b/lib/capybara/selector.rb @@ -44,4 +44,4 @@ end Capybara::Selector.add(:xpath) { |xpath| xpath } Capybara::Selector.add(:css) { |css| XPath::HTML.from_css(css) } -Capybara::Selector.add(:id, :for => Symbol) { |id| XPath.generate { |x| x.descendant(:*)[x.attr(:id) == id.to_s] } } +Capybara::Selector.add(:id, :for => Symbol) { |id| XPath.descendant(:*)[XPath.attr(:id) == id.to_s] }
Nicer implementation of :id selector
teamcapybara_capybara
train
rb
5dfe5fb6f41fd3aed12ba9577f3a9e80be210984
diff --git a/src/Arara/Process/Action/Daemon.php b/src/Arara/Process/Action/Daemon.php index <HASH>..<HASH> 100644 --- a/src/Arara/Process/Action/Daemon.php +++ b/src/Arara/Process/Action/Daemon.php @@ -184,7 +184,10 @@ class Daemon extends Callback gc_enable(); // Callback for handle when process is terminated - $control->signal()->prependHandler(SIGTERM, array($this, 'setAsDying')); + $control->signal()->prependHandler(SIGTERM, function () use ($context) { + $this->setAsDying(); + $context->pidfile->finalize(); + }); $control->signal()->setHandler(SIGTSTP, SIG_IGN); $control->signal()->setHandler(SIGTTOU, SIG_IGN); $control->signal()->setHandler(SIGTTIN, SIG_IGN); @@ -221,9 +224,6 @@ class Daemon extends Callback // Create pidfile $context->pidfile->initialize(); - - // Define pidfile cleanup - register_shutdown_function(array($context->pidfile, 'finalize')); } /**
Remove Pidfile only when daemon is dying
Arara_Process
train
php
225627200d94945a0470135b5794a1b72819c33b
diff --git a/lib/sub_diff.rb b/lib/sub_diff.rb index <HASH>..<HASH> 100644 --- a/lib/sub_diff.rb +++ b/lib/sub_diff.rb @@ -1,4 +1,4 @@ -require 'sub_diff/sub' +require 'sub_diff/gsub' require 'sub_diff/version' module SubDiff
Require gsub instead of sub gsub already requires sub
shuber_sub_diff
train
rb
a7fdc45eed80f967bd1dd7b0cd650672af431aa7
diff --git a/agent/exec/containerd/adapter.go b/agent/exec/containerd/adapter.go index <HASH>..<HASH> 100644 --- a/agent/exec/containerd/adapter.go +++ b/agent/exec/containerd/adapter.go @@ -143,7 +143,7 @@ func withMounts(ctx context.Context, ms []api.Mount) containerd.SpecOpts { } } -func (c *containerAdapter) create(ctx context.Context) error { +func (c *containerAdapter) prepare(ctx context.Context) error { if c.image == nil { return errors.New("image has not been pulled") } diff --git a/agent/exec/containerd/controller.go b/agent/exec/containerd/controller.go index <HASH>..<HASH> 100644 --- a/agent/exec/containerd/controller.go +++ b/agent/exec/containerd/controller.go @@ -134,7 +134,7 @@ func (r *controller) Prepare(ctx context.Context) error { } } - if err := r.adapter.create(ctx); err != nil { + if err := r.adapter.prepare(ctx); err != nil { if isContainerCreateNameConflict(err) { if _, err := r.adapter.inspect(ctx); err != nil { return err
containerd: rename adapter.create to adapter.prepare It is called from controller.Prepare and this seems to better reflect its purpose.
docker_swarmkit
train
go,go
54e694a10bcec5df24a66a0d13ccb7b132ad7c57
diff --git a/packages/core/parcel-bundler/src/packagers/RawPackager.js b/packages/core/parcel-bundler/src/packagers/RawPackager.js index <HASH>..<HASH> 100644 --- a/packages/core/parcel-bundler/src/packagers/RawPackager.js +++ b/packages/core/parcel-bundler/src/packagers/RawPackager.js @@ -1,4 +1,5 @@ const Packager = require('./Packager'); +const path = require('path'); const fs = require('../utils/fs'); class RawPackager extends Packager { @@ -12,6 +13,11 @@ class RawPackager extends Packager { contents = await fs.readFile(contents ? contents.path : asset.name); } + // Create sub-directories if needed + if (this.bundle.name.includes(path.sep)) { + await fs.mkdirp(path.dirname(this.bundle.name)); + } + this.size = contents.length; await fs.writeFile(this.bundle.name, contents); }
Fix writing files in subfolders inside dist directory (#<I>)
parcel-bundler_parcel
train
js
86f77ab87a2d89494c98feb15985b119ed6c0dec
diff --git a/src/main/java/com/github/kongchen/swagger/docgen/mustache/OutputTemplate.java b/src/main/java/com/github/kongchen/swagger/docgen/mustache/OutputTemplate.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/kongchen/swagger/docgen/mustache/OutputTemplate.java +++ b/src/main/java/com/github/kongchen/swagger/docgen/mustache/OutputTemplate.java @@ -186,6 +186,7 @@ public class OutputTemplate { // different indexs, no special handling required return; } + Collections.sort(apiDocuments); int i = 0; for (MustacheDocument apiDocument : apiDocuments) { apiDocument.setIndex(i); // requires delete of final modifier
OutputTemplate - apiDocuments consistent order In current implementation there is no consistent order of apiDocument within mustache templates. This change introduces sorting by request path if apiDocuments have no indexes defined.
kongchen_swagger-maven-plugin
train
java
7b31e76ecd8dfda9c22b585b8bf0d54ccc10870d
diff --git a/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/task/TaskQueryDto.java b/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/task/TaskQueryDto.java index <HASH>..<HASH> 100644 --- a/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/task/TaskQueryDto.java +++ b/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/task/TaskQueryDto.java @@ -191,7 +191,7 @@ public class TaskQueryDto extends AbstractQueryDto<TaskQuery> { private List<VariableQueryParameterDto> processVariables; private List<VariableQueryParameterDto> caseInstanceVariables; - private List<TaskQueryDto> orQueries = new ArrayList<TaskQueryDto>(); + private List<TaskQueryDto> orQueries; public TaskQueryDto() { @@ -1368,6 +1368,7 @@ public class TaskQueryDto extends AbstractQueryDto<TaskQuery> { TaskQueryDto dto = new TaskQueryDto(); if (!isOrQueryActive) { + dto.orQueries = new ArrayList<TaskQueryDto>(); for (TaskQuery orQuery: taskQuery.getOrQueries()) { dto.orQueries.add(fromQuery(orQuery, true)); }
feat(rest): adds OR queries for task resource related to CAM-<I>
camunda_camunda-bpm-platform
train
java
5eb649e810034f1d69ca92263f81a392140d74de
diff --git a/lib/mw/ApiRequest.js b/lib/mw/ApiRequest.js index <HASH>..<HASH> 100644 --- a/lib/mw/ApiRequest.js +++ b/lib/mw/ApiRequest.js @@ -303,8 +303,7 @@ ApiRequest.prototype.request = function(options, callback) { if (mwApiServer) { var urlobj = url.parse(options.uri); options.headers.Host = urlobj.hostname; - urlobj.host = mwApiServer; - options.uri = url.format(urlobj); + options.uri = mwApiServer; } // Proxy options should only be applied to MW API endpoints.
Use mwApiServer as the provider of the full URI of the MW API Change-Id: I6b<I>fd<I>c<I>d<I>c<I>c8c<I>a<I>ac9f1b<I>c
wikimedia_parsoid
train
js
0679debf752a644ceabd4f162dd6ea39b4a3ff15
diff --git a/spec/lib/models/work-item-spec.js b/spec/lib/models/work-item-spec.js index <HASH>..<HASH> 100644 --- a/spec/lib/models/work-item-spec.js +++ b/spec/lib/models/work-item-spec.js @@ -184,7 +184,7 @@ describe('Models.WorkItem', function () { it('should create ipmi pollers for a node', function () { var nodeId = '47bd8fb80abc5a6b5e7b10de'; return workitems.createIpmiPollers(nodeId).then(function (items) { - expect(items).to.have.length(3); + expect(items).to.have.length(4); items.forEach(function (item) { expect(item.name).to.equal('Pollers.IPMI'); expect(item.node).to.equal(nodeId); @@ -198,7 +198,7 @@ describe('Models.WorkItem', function () { items = _.sortBy(items, 'id'); return workitems.findPollers().then(function (pollers) { pollers = _.sortBy(pollers, 'id'); - expect(pollers).to.have.length(3); + expect(pollers).to.have.length(4); pollers.forEach(function (poller, index) { expect(poller.id).to.equal(items[index].id); expect(poller.config.command).to.equal(items[index].config.command);
MAG-<I> Update unit test to algin with work-item.js update
RackHD_on-core
train
js
180a5029bc3a2f0c1023c2c63b552766dc524c41
diff --git a/lib/git/index.py b/lib/git/index.py index <HASH>..<HASH> 100644 --- a/lib/git/index.py +++ b/lib/git/index.py @@ -1023,7 +1023,7 @@ class IndexFile(LazyMixin, diff.Diffable): Returns List(path_string, ...) list of paths that have been removed effectively. This is interesting to know in case you have provided a directory or - globs. Paths are relative to the + globs. Paths are relative to the repository. """ args = list() if not working_tree: diff --git a/test/git/test_commit.py b/test/git/test_commit.py index <HASH>..<HASH> 100644 --- a/test/git/test_commit.py +++ b/test/git/test_commit.py @@ -88,6 +88,11 @@ class TestCommit(TestBase): # traversal should stop when the beginning is reached self.failUnlessRaises(StopIteration, first.traverse().next) + # parents of the first commit should be empty ( as the only parent has a null + # sha ) + assert len(first.parents) == 0 + + @patch_object(Git, '_call_process') def test_rev_list_bisect_all(self, git): """
git.commit: Added test to assure we handle the first commit correctly regarding its parents
gitpython-developers_GitPython
train
py,py
c4fe62a630fa44b68aa699a4144e2e1cc94f1925
diff --git a/lib/cast/preprocessor.rb b/lib/cast/preprocessor.rb index <HASH>..<HASH> 100644 --- a/lib/cast/preprocessor.rb +++ b/lib/cast/preprocessor.rb @@ -31,7 +31,7 @@ module C filename = file.path file.puts text end - output = `#{full_command(filename)} 2>&1` + output = `#{full_command(filename)}` if $? == 0 return output else diff --git a/test/preprocessor_test.rb b/test/preprocessor_test.rb index <HASH>..<HASH> 100644 --- a/test/preprocessor_test.rb +++ b/test/preprocessor_test.rb @@ -84,4 +84,8 @@ EOS assert_match(/int two = 2;/, output) assert_match(/int three = 3;/, output) end + def test_proprocess_warning + output = cpp.preprocess("#warning warning me!") + assert output.gsub(/^#.*\n/,"").gsub(/[ \t\n]/,"").length == 0 + end end
Fix preprocessor output Error message is mixed into the output of the preprocessor. Message of "#warning" should be output to stderr.
oggy_cast
train
rb,rb
c4527f492c177c4741f58e4e706c6090848cf7c8
diff --git a/lib/Thulium/FrontController.php b/lib/Thulium/FrontController.php index <HASH>..<HASH> 100644 --- a/lib/Thulium/FrontController.php +++ b/lib/Thulium/FrontController.php @@ -35,7 +35,9 @@ class FrontController { $this->_uriAction = $this->_uri->getAction(); - if ($this->_isNoAction()) { + if ($this->_isNoController()) { + $this->_redirectToDefault(); + } else if ($this->_isNoAction()) { $this->_redirectToIndex(); } else { $this->_currentController = $this->controllerResolver->getCurrentController(); @@ -61,6 +63,16 @@ class FrontController return $this->_currentController; } + private function _isNoController() + { + return !$this->_uri->getRawController(); + } + + private function _redirectToDefault() + { + $this->_redirect('/' . $this->_defaults['controller'] . '/' . $this->_defaults['action']); + } + private function _isNoAction() { return !$this->_uriAction;
Fix redirecting to default controller when no exists.
letsdrink_ouzo
train
php
bb4beed165faedb025a4bb5323ee17353032be53
diff --git a/shared/src/main/java/com/couchbase/lite/LiveQueryChange.java b/shared/src/main/java/com/couchbase/lite/LiveQueryChange.java index <HASH>..<HASH> 100644 --- a/shared/src/main/java/com/couchbase/lite/LiveQueryChange.java +++ b/shared/src/main/java/com/couchbase/lite/LiveQueryChange.java @@ -1,6 +1,6 @@ package com.couchbase.lite; -class LiveQueryChange { +public class LiveQueryChange { //--------------------------------------------- // member variables //---------------------------------------------
LiveQueryChange class should be `public` to be accessible from other packages.
couchbase_couchbase-lite-android
train
java
f31f05d8b8666d394dbc090437fe7ba2e8982fed
diff --git a/Inpsyde/Sniffs/CodeQuality/FunctionBodyStartSniff.php b/Inpsyde/Sniffs/CodeQuality/FunctionBodyStartSniff.php index <HASH>..<HASH> 100644 --- a/Inpsyde/Sniffs/CodeQuality/FunctionBodyStartSniff.php +++ b/Inpsyde/Sniffs/CodeQuality/FunctionBodyStartSniff.php @@ -86,7 +86,7 @@ class FunctionBodyStartSniff implements Sniff $error = ($isMultiLineDeclare || $isSingleLineSignature) && $bodyLine !== ($openerLine + 2) - || $isSingleLineDeclare && $bodyLine !== ($openerLine + 1); + || $isSingleLineDeclare && $bodyLine > ($openerLine + 2); if (!$error) { return [null, null, null]; diff --git a/tests/fixtures/function-body-start.php b/tests/fixtures/function-body-start.php index <HASH>..<HASH> 100644 --- a/tests/fixtures/function-body-start.php +++ b/tests/fixtures/function-body-start.php @@ -8,7 +8,8 @@ function foo() return 'foo'; } -// @phpcsWarningCodeOnNextLine WrongForSingleLineDeclaration +// tolerate this as PHPStorm code styler cannot distinguish between +// single line and multiline function declarations. See issue #32 function bar() { @@ -66,7 +67,6 @@ class BarBarBar return 'foo'; } - // @phpcsWarningCodeOnNextLine WrongForSingleLineDeclaration private function bar() {
Allow blank line after single line declaration #<I>
inpsyde_php-coding-standards
train
php,php
3c1854858615918f633ccfc9215f72330f284c00
diff --git a/powerunit/src/main/java/ch/powerunit/TestDelegate.java b/powerunit/src/main/java/ch/powerunit/TestDelegate.java index <HASH>..<HASH> 100644 --- a/powerunit/src/main/java/ch/powerunit/TestDelegate.java +++ b/powerunit/src/main/java/ch/powerunit/TestDelegate.java @@ -48,7 +48,7 @@ import java.lang.annotation.Target; * </pre> * * @author borettim - * @since 1.0.2 + * @since 0.2.0 */ @Documented @Retention(RetentionPolicy.RUNTIME) diff --git a/powerunit/src/main/java/ch/powerunit/TestDelegator.java b/powerunit/src/main/java/ch/powerunit/TestDelegator.java index <HASH>..<HASH> 100644 --- a/powerunit/src/main/java/ch/powerunit/TestDelegator.java +++ b/powerunit/src/main/java/ch/powerunit/TestDelegator.java @@ -34,7 +34,7 @@ import java.lang.annotation.Target; * parameter. * * @author borettim - * @since 1.0.2 + * @since 0.2.0 */ @Documented @Retention(RetentionPolicy.RUNTIME)
Issue #<I> - Correction javadoc
powerunit_powerunit
train
java,java
53ed410ad3cb8a91a9f53fdaec646d167115f5e9
diff --git a/enrol/imsenterprise/enrol.php b/enrol/imsenterprise/enrol.php index <HASH>..<HASH> 100644 --- a/enrol/imsenterprise/enrol.php +++ b/enrol/imsenterprise/enrol.php @@ -486,6 +486,7 @@ function process_group_tag($tagcontents){ $this->log_line("Course $coursecode not found in Moodle's course idnumbers."); } else { // Create the (hidden) course(s) if not found + $course = new object(); $course->fullname = $group->description; $course->shortname = $coursecode; $course->idnumber = $coursecode; @@ -543,13 +544,13 @@ function process_group_tag($tagcontents){ }else{ $course->sortorder = 1000; } - if($course->id = insert_record('course', $course)){ + if($course->id = insert_record('course', addslashes_object($course))){ // Setup the blocks $page = page_create_object(PAGE_COURSE_VIEW, $course->id); blocks_repopulate_page($page); // Return value not checked because you can always edit later - $section = NULL; + $section = new object(); $section->course = $course->id; // Create a default section. $section->section = 0; $section->id = insert_record("course_sections", $section);
MDL-<I> Course object not escaped before insert - patch by Aaron C Spike
moodle_moodle
train
php
679d3a27962b0baa79dede4f1a6465160cfa76ac
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -16,8 +16,11 @@ setup( 'Intended Audience :: Education', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', 'Topic :: Scientific/Engineering :: Astronomy', ], packages=[
Advertise troves for Python <I> through <I>
skyfielders_python-skyfield
train
py
3b167ffdcc72c1cb3ecb7dfc6b1581a6a09652f5
diff --git a/src/bselect.js b/src/bselect.js index <HASH>..<HASH> 100644 --- a/src/bselect.js +++ b/src/bselect.js @@ -273,8 +273,11 @@ $("<input type='text' class='bselect-search-input' />").attr({ role: "combobox", "aria-expanded": "false", - "aria-autocomplete": "list", - "aria-owns": "bselect-option-list-" + id + "aria-owns": "bselect-option-list-" + id, + + // The W3C documentation says that role="combobox" should have aria-autocomplete, + // but the validator tells us that this is invalid. Very strange. + //"aria-autocomplete": "list" }).appendTo( search ); $("<span class='bselect-search-icon'><i class='icon-search' /></span>").appendTo( search );
Removed the invalid aria-autocomplete property from the search input
gustavohenke_bselect
train
js
5e7be4fd325f418576c22d389f49651b920a1df1
diff --git a/algoliasearch/src/test/java/com/algolia/search/saas/IndexTest.java b/algoliasearch/src/test/java/com/algolia/search/saas/IndexTest.java index <HASH>..<HASH> 100644 --- a/algoliasearch/src/test/java/com/algolia/search/saas/IndexTest.java +++ b/algoliasearch/src/test/java/com/algolia/search/saas/IndexTest.java @@ -449,6 +449,7 @@ public class IndexTest extends PowerMockTestCase { List<String> hostsArray = (List<String>) Whitebox.getInternalState(client, "readHosts"); hostsArray.set(0, appId + "-dsn.algolia.biz"); Whitebox.setInternalState(client, "readHosts", hostsArray); + client.setConnectTimeout(2000); //And an index that does not cache search queries index.disableSearchCache();
Tests: Explicitly set connectTimeout before testing it
algolia_algoliasearch-client-android
train
java
bb9640f6637ddbffff8063a51880838411531b55
diff --git a/test/entry.js b/test/entry.js index <HASH>..<HASH> 100644 --- a/test/entry.js +++ b/test/entry.js @@ -2,3 +2,15 @@ import { jsdom } from 'jsdom'; global.document = jsdom('<!doctype html><html><body></body></html>'); global.window = document.defaultView; +global.navigator = global.window.navigator; +window.localStorage = window.sessionStorage = { + getItem(key) { + return this[key]; + }, + setItem(key, value) { + this[key] = value; + }, + removeItem(key) { + this[key] = undefined; + }, +};
test(Tests): Fixing test jsdom mock Adding navigator to test mock
Raathigesh_dazzle
train
js
6811f91da251f0378ab1de14bab59c5bfdef08f8
diff --git a/lib/framework/newrhom/newrhom_object_factory.rb b/lib/framework/newrhom/newrhom_object_factory.rb index <HASH>..<HASH> 100644 --- a/lib/framework/newrhom/newrhom_object_factory.rb +++ b/lib/framework/newrhom/newrhom_object_factory.rb @@ -144,7 +144,7 @@ module Rhom self.new(objHash); end - def self._normalize_args_for_find(what, args_hash = {}, normalized_string_args, normalized_vector_args) + def self._normalize_args_for_find(what, args_hash, normalized_string_args, normalized_vector_args) # 1) Normalize LIMITS normalized_string_args.merge!(self.klass_model.buildFindLimits(what, args_hash)) @@ -435,4 +435,4 @@ module Rhom Object.const_set(klass_model_obj.model_name.intern, klass_instance) end end -end \ No newline at end of file +end
lib/framework/newrhom/newrhom_object_factory.rb: Rhom.RhomObjectFactory._normalize_args_for_find was fixed.
rhomobile_rhodes
train
rb
8d41f39702152be34303f067f618a2ffa9714bd2
diff --git a/kafka/consumer/group.py b/kafka/consumer/group.py index <HASH>..<HASH> 100644 --- a/kafka/consumer/group.py +++ b/kafka/consumer/group.py @@ -117,7 +117,7 @@ class KafkaConsumer(six.Iterator): session_timeout_ms (int): The timeout used to detect failures when using Kafka's group management facilities. Default: 30000 max_poll_records (int): The maximum number of records returned in a - single call to poll(). + single call to poll(). Default: 500 receive_buffer_bytes (int): The size of the TCP receive buffer (SO_RCVBUF) to use when reading data. Default: None (relies on system defaults). The java client defaults to 32768. @@ -223,7 +223,7 @@ class KafkaConsumer(six.Iterator): 'partition_assignment_strategy': (RangePartitionAssignor, RoundRobinPartitionAssignor), 'heartbeat_interval_ms': 3000, 'session_timeout_ms': 30000, - 'max_poll_records': sys.maxsize, + 'max_poll_records': 500, 'receive_buffer_bytes': None, 'send_buffer_bytes': None, 'socket_options': [(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)],
Default max_poll_records to Java default of <I> (#<I>)
dpkp_kafka-python
train
py
8c9f8e25111f0987fa74a8f1a8ada10e8d092ab0
diff --git a/src/mako/http/Response.php b/src/mako/http/Response.php index <HASH>..<HASH> 100644 --- a/src/mako/http/Response.php +++ b/src/mako/http/Response.php @@ -409,6 +409,21 @@ class Response } /** + * Removes a response header. + * + * @access public + * @param string $name Header name + * @return \mako\http\Response + */ + + public function removeHeader($name) + { + unset($this->headers[strtolower($name)]); + + return $this; + } + + /** * Returns the response headers. * * @access public
Added removeHeader method to Response class
mako-framework_framework
train
php
bebcaf10dc39a96a3486c8d297bca08ed0431f33
diff --git a/src/effects/SSAOEffect.js b/src/effects/SSAOEffect.js index <HASH>..<HASH> 100644 --- a/src/effects/SSAOEffect.js +++ b/src/effects/SSAOEffect.js @@ -22,8 +22,10 @@ import fragmentShader from "./glsl/ssao/shader.frag"; * different radii, one for rough AO and one for fine details. * * This effect supports depth-aware upsampling and should be rendered at a lower - * resolution. If you intend to render SSAO at full resolution, do not provide a - * downsampled normalDepthBuffer and make sure to disable depthAwareUpsampling. + * resolution. The resolution should match that of the downsampled normals and + * depth. If you intend to render SSAO at full resolution, do not provide a + * downsampled `normalDepthBuffer` and make sure to disable + * `depthAwareUpsampling`. * * It's recommended to specify a relative render resolution using the * `resolutionScale` constructor parameter to avoid undesired sampling patterns.
Clarify that resolutions should match up
vanruesc_postprocessing
train
js
94ac74b4caf70f2e9d856990c804068f9a63ec79
diff --git a/saspy/sasbase.py b/saspy/sasbase.py index <HASH>..<HASH> 100644 --- a/saspy/sasbase.py +++ b/saspy/sasbase.py @@ -481,9 +481,14 @@ class SASsession(): In Zeppelin, the html LST results can be displayed via print("%html "+ ll['LST']) to diplay as HTML. + + OR, as I've added an HTML method to the SASsession object which does the correct thing for Jupyter or Zeppelin + you can just use that instead of manually importing IPython's HTML or using Zeppelin's print(%html ...), + that way it will work in either notebook. + i.e,: results = sas.submit("data a; x=1; run; proc print;run') print(results['LOG']) - HTML(results['LST']) + sas.HTML(results['LST']) ''' if self.nosub: return dict(LOG=code, LST='')
doc sas.HTML for Jup and Zep
sassoftware_saspy
train
py
15baef43ecf762898ea45b085d05c309f170fb9b
diff --git a/core/API/Request.php b/core/API/Request.php index <HASH>..<HASH> 100644 --- a/core/API/Request.php +++ b/core/API/Request.php @@ -94,7 +94,7 @@ class Request $defaultRequest['segment'] = $requestRaw['segment']; } - if (empty($defaultRequest['format_metrics'])) { + if (!isset($defaultRequest['format_metrics'])) { $defaultRequest['format_metrics'] = 'bc'; } }
Fix bug w/ format_metrics defaulting, if format_metrics=0 is used, it will always revert to format_metrics=bc, since empty($request['format_metrics']) is used.
matomo-org_matomo
train
php
e68dc1ababba8a4ffaa1e1ce595d4fb1372ab492
diff --git a/salt/modules/state.py b/salt/modules/state.py index <HASH>..<HASH> 100644 --- a/salt/modules/state.py +++ b/salt/modules/state.py @@ -290,6 +290,16 @@ def highstate(test=None, } return ret + low_data_ = show_lowstate() + lows_ = [] + for item in low_data_: + lows_.append('{0}.{1}'.format(item['state'], item['fun'])) + + disabled = _disabled(lows_) + if disabled: + __context__['retcode'] = 1 + return disabled + conflict = _check_queue(queue, kwargs) if conflict is not None: return conflict @@ -461,12 +471,12 @@ def sls(mods, st_.push_active() try: high_, errors = st_.render_highstate({saltenv: mods}) - lowstate_ = show_lowstate() - lows_ = [] - for item in lowstate_: - lows_.append('{0}.{1}'.format(item['state'], item['fun'])) + high_data_ = st_.state.compile_high_data(high_) + highs_ = [] + for item in high_data_: + highs_.append('{0}.{1}'.format(item['state'], item['fun'])) - disabled = _disabled(lows_) + disabled = _disabled(highs_) if disabled: __context__['retcode'] = 1 return disabled
Found an issue in the sls function when disabling states. Originally I had used the show_lowstate to get what would be applied to the minion, to check for disabled states. Turns out this shows what would be applied during a high state and not from an SLS file. Switching to using st_.state.compile_high_data inside the SLS and moving the show_lowstate call into the highstate function where it's correct.
saltstack_salt
train
py
0e09761f80f841544432ba3a40d7b3cf31771815
diff --git a/src/python/pipelines_utils/utils.py b/src/python/pipelines_utils/utils.py index <HASH>..<HASH> 100644 --- a/src/python/pipelines_utils/utils.py +++ b/src/python/pipelines_utils/utils.py @@ -74,7 +74,7 @@ def determine_output_format(outformat): if outformat: return outformat else: - log("No output format specified - assuming sdf") + log("No output format specified - using sdf") return 'sdf' def open_output(basename, ext, compress):
reverting change in log message as that is used extensively in tests
InformaticsMatters_pipelines-utils
train
py
3dc6a4020ec899d5793e09b671d758539914a2ba
diff --git a/xtuml/model.py b/xtuml/model.py index <HASH>..<HASH> 100644 --- a/xtuml/model.py +++ b/xtuml/model.py @@ -346,13 +346,13 @@ class MetaModel(object): self.associations = list() self.id_generator = id_generator - def define_class(self, kind, attributes): + def define_class(self, kind, attributes, doc=''): ''' Define and return a new class in the meta model. ''' Cls = type(kind, (BaseObject,), dict(__r__=dict(), __q__=dict(), __c__=dict(), __m__=self, - __a__=attributes)) + __a__=attributes, __doc__=doc)) self.classes[kind] = Cls return Cls
model: allow doc-strings to be set on class definitions
xtuml_pyxtuml
train
py
7514a215563f7d04bf9170454b13b5bd9a8f1b0f
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -45,7 +45,7 @@ gulp.task('build:esm', ['inline-templates'], (callback) => { * This is a temporary solution until ngc is supported --watch mode. * @see: https://github.com/angular/angular/issues/12867 */ -gulp.task('build:esm:watch', () => { +gulp.task('build:esm:watch', ['build:esm'], () => { gulp.watch('src/**/*', ['build:esm']); });
Fix bug with building library in watch mode.
nowzoo_nowzoo-angular-bootstrap-lite
train
js
ed379b7d99f8b8a6733e87217cdaa6c9ad0a604a
diff --git a/prometheus/counter.go b/prometheus/counter.go index <HASH>..<HASH> 100644 --- a/prometheus/counter.go +++ b/prometheus/counter.go @@ -70,9 +70,6 @@ func (c *counter) Add(v float64) { // if you want to count the same thing partitioned by various dimensions // (e.g. number of HTTP requests, partitioned by response code and // method). Create instances with NewCounterVec. -// -// CounterVec embeds MetricVec. See there for a full list of methods with -// detailed documentation. type CounterVec struct { *metricVec } diff --git a/prometheus/vec.go b/prometheus/vec.go index <HASH>..<HASH> 100644 --- a/prometheus/vec.go +++ b/prometheus/vec.go @@ -35,8 +35,7 @@ type metricVec struct { hashAddByte func(h uint64, b byte) uint64 } -// newMetricVec returns an initialized MetricVec. The concrete value is -// returned for embedding into another struct. +// newMetricVec returns an initialized metricVec. func newMetricVec(desc *Desc, newMetric func(lvs ...string) Metric) *metricVec { return &metricVec{ children: map[uint64][]metricWithLabelValues{},
Remove remaining references to MetricVec from doc comments MetricVec is un-experted by now. godoc handles that correctly by showing the methods of the embedded un-exported metricVec with the exported type (CounterVec, SummaryVec, ...) that embeds metricVec.
prometheus_client_golang
train
go,go
eff08a799a7efb6b6ecf4d4cefd3ff37e905784b
diff --git a/src/Entity/Shipment.php b/src/Entity/Shipment.php index <HASH>..<HASH> 100644 --- a/src/Entity/Shipment.php +++ b/src/Entity/Shipment.php @@ -102,7 +102,6 @@ class Shipment public function __construct() { $this->setShipper(new Shipper()); - $this->setShipFrom(new ShipFrom()); $this->setShipTo(new ShipTo()); $this->setShipmentServiceOptions(new ShipmentServiceOptions()); $this->setService(new Service());
Make sure ShipFrom is not created by default and can be set to null
gabrielbull_php-ups-api
train
php
41e4ec2e1df33cf1a1c4340416072c88e66cddf8
diff --git a/scs_core/data/interval.py b/scs_core/data/interval.py index <HASH>..<HASH> 100644 --- a/scs_core/data/interval.py +++ b/scs_core/data/interval.py @@ -19,8 +19,8 @@ class Interval(JSONable): # ---------------------------------------------------------------------------------------------------------------- @classmethod - def construct(cls, prev_time, time): - diff = None if prev_time is None else round(time.timestamp() - prev_time.timestamp(), 3) + def construct(cls, prev_time, time, precision=3): + diff = None if prev_time is None else round(time.timestamp() - prev_time.timestamp(), precision) return Interval(time, diff)
Added precision field to Interval constructor.
south-coast-science_scs_core
train
py
14bfd72b5e50fa714b414c3021026edcc4e2962e
diff --git a/examples/docgen/docs/.vuepress/config.js b/examples/docgen/docs/.vuepress/config.js index <HASH>..<HASH> 100644 --- a/examples/docgen/docs/.vuepress/config.js +++ b/examples/docgen/docs/.vuepress/config.js @@ -4,7 +4,7 @@ const cwd = path.join(__dirname, '..') const { parse } = require('vue-docgen-api') module.exports = async () => { - const docFiles = glob.sync('components/**/*.md', { cwd }).map((f) => '/' + f) + const sidebar = glob.sync('components/**/*.md', { cwd }).map((f) => '/' + f) const components = await Promise.all( glob.sync('../src/components/**/*.{vue,js,jsx,ts,tsx}', { cwd, absolute: true }).map(async (path) => { return { @@ -22,8 +22,7 @@ module.exports = async () => { dest: path.join(__dirname, '../../dist'), title: 'VuePress DocGen Live', themeConfig: { - search: false, - sidebar: docFiles + sidebar }, plugins: [ ['live'],
docs: add search to the docgen example
vue-styleguidist_vue-styleguidist
train
js
1fcb2818b5f6c1623fec841ddd994a800aefc5d4
diff --git a/kaleo/views.py b/kaleo/views.py index <HASH>..<HASH> 100644 --- a/kaleo/views.py +++ b/kaleo/views.py @@ -2,16 +2,16 @@ from django import http from django.utils import simplejson as json from django.views.decorators.http import require_http_methods -from django.contrib.auth.decorators import login_required - from account.models import EmailAddress from kaleo.forms import InviteForm from kaleo.models import JoinInvitation -@login_required @require_http_methods(["POST"]) def invite(request): + if not request.user.is_authenticated(): + data = {"status": "ERROR", "message": "not authenticated"} + return http.HttpResponseBadRequest(json.dumps(data), content_type="application/json") form = InviteForm(request.POST) if form.is_valid(): email = form.cleaned_data["email_address"]
Improved HTTP response when user not authenticated Returning a HTTP redirect from login_required is designed for the web browser and a human as the end-user; invite is used by JavaScript. Return an error more suitable for the end-user.
pinax_pinax-invitations
train
py
4715f25f0019e97f77280a8cec3434400f094f47
diff --git a/python2/pyinotify.py b/python2/pyinotify.py index <HASH>..<HASH> 100755 --- a/python2/pyinotify.py +++ b/python2/pyinotify.py @@ -1790,7 +1790,7 @@ class WatchManager: watch_.proc_fun = proc_fun if auto_add: - watch_.proc_fun = auto_add + watch_.auto_add = auto_add ret_[awd] = True log.debug('Updated watch - %s', self._wmd[awd])
Fixed auto_add handling in method update_watch (contributed by Matthew Webber <EMAIL>).
seb-m_pyinotify
train
py
7f3c2b6502f5dde8bf0d358b6d5f0ee35f9de687
diff --git a/app/src/Bolt/TwigExtension.php b/app/src/Bolt/TwigExtension.php index <HASH>..<HASH> 100644 --- a/app/src/Bolt/TwigExtension.php +++ b/app/src/Bolt/TwigExtension.php @@ -1445,5 +1445,4 @@ class TwigExtension extends \Twig_Extension { return json_decode($string); } - }
One more in TwigExtension.php
bolt_bolt
train
php
af5a010df3d6e31ca16e6dea19fca8f31e70bd1f
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 @@ -471,6 +471,10 @@ class NAppsManager: for dir_file in os.walk(path): files.extend([dir_file[0] + '/' + file for file in dir_file[2]]) + # Filter the files with the napp_name in their path + # Example: home/user/napps/kytos/, napp_name = kronos + # This filter will get all files from: + # home/user/napps/kytos/kronos/* files = list(filter(lambda x: napp_name in x, files)) ignored_files = [".git"] @@ -492,6 +496,7 @@ class NAppsManager: # Create the '.napp' package napp_file = tarfile.open(napp_name + '.napp', 'x:xz') for local_f in files: + # remove the path name from the file name napp_file.add(local_f.replace(path+'/', '')) napp_file.close()
Adding comments to example better what is done
kytos_kytos-utils
train
py
2dc592acdf3f7c1a0c333a8164649936bb82d983
diff --git a/lib/cucumber/ast/tags.rb b/lib/cucumber/ast/tags.rb index <HASH>..<HASH> 100644 --- a/lib/cucumber/ast/tags.rb +++ b/lib/cucumber/ast/tags.rb @@ -27,7 +27,7 @@ module Cucumber end def count(tag) - if @tag_names.respond_to?(:count) + if @tag_names.respond_to?(:count) && @tag_names.method(:count).arity > 0 @tag_names.count(tag) # 1.9 else @tag_names.select{|t| t == tag}.length # 1.8
Fix to make sure the correct #count method is called
cucumber_cucumber-ruby
train
rb
c914f6d60c043aee4b317eb0da1c87ea309708ca
diff --git a/packages/vaex-core/vaex/scopes.py b/packages/vaex-core/vaex/scopes.py index <HASH>..<HASH> 100644 --- a/packages/vaex-core/vaex/scopes.py +++ b/packages/vaex-core/vaex/scopes.py @@ -73,6 +73,14 @@ class _BlockScope(object): self.i2 = int(i2) self.values = dict(self.variables) + def get(self, attr, default=None): # otherwise pdb crashes during pytest + if attr == "__tracebackhide__": + return False + return default + + def __contains__(self, name): # otherwise pdb crashes during pytest + return name in self.buffers # not sure this should also include varibles, columns and virtual columns + def _ensure_buffer(self, column): if column not in self.buffers: logger.debug("creating column for: %s", column)
fix(core): pytest + pdb crashed since it uses BlockScope as frame, mock it
vaexio_vaex
train
py
c506091532444f26cf0cb6d3b8f1440483ddfb9e
diff --git a/src/PeskyCMF/Console/Commands/CmfMakeScaffoldCommand.php b/src/PeskyCMF/Console/Commands/CmfMakeScaffoldCommand.php index <HASH>..<HASH> 100644 --- a/src/PeskyCMF/Console/Commands/CmfMakeScaffoldCommand.php +++ b/src/PeskyCMF/Console/Commands/CmfMakeScaffoldCommand.php @@ -319,7 +319,7 @@ VIEW; foreach ($this->getJoinableRelationNames($table) as $relationName) { $contains[] = "'{$relationName}' => ['*'],"; } - return implode('', $contains); + return implode('\n ', $contains); } protected function getJoinableRelationNames(TableInterface $table) {
CmfMakeScaffoldCommand - fixed relations list to read for item details
swayok_PeskyCMF
train
php
ee04f752808ebd4a615d29f52be939beb3f9a7f7
diff --git a/src/main/java/com/stratio/specs/GivenGSpec.java b/src/main/java/com/stratio/specs/GivenGSpec.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/stratio/specs/GivenGSpec.java +++ b/src/main/java/com/stratio/specs/GivenGSpec.java @@ -478,6 +478,22 @@ public class GivenGSpec extends BaseGSpec { } /** + * Swith to the iFrame where id matches idframe + * + * @param idframe + */ + @Given("^I switch to iframe with '([^:]*?):([^:]*?)'$") + public void seleniumIdFrame(String method, String idframe) throws IllegalAccessException, NoSuchFieldException, ClassNotFoundException { + assertThat(commonspec.locateElement(method, idframe, 1)); + + if (method.equals("id") || method.equals("name")){ + commonspec.getDriver().switchTo().frame(idframe); + } + else + throw new ClassNotFoundException("Can not use this method to switch iframe"); + } + + /** * Switches to a parent frame/ iframe. */ @Given("^I switch to a parent frame$")
[QA-<I>] iFrame switch method added (#<I>) * QA-<I> iFrame switch method added * allow additional methods when locating elements
Stratio_bdt
train
java
5af4b62fe731758ae2b20fbd737a558f457ea6b9
diff --git a/examples/multi_word_matches.py b/examples/multi_word_matches.py index <HASH>..<HASH> 100644 --- a/examples/multi_word_matches.py +++ b/examples/multi_word_matches.py @@ -45,6 +45,8 @@ def read_gazetteer(tokenizer, loc, n=-1): if i >= n: break phrase = tokenizer(phrase) + if all((t.is_lower and t.prob >= -10) for t in phrase): + continue if len(phrase) >= 2: yield phrase
* Filter out phrases that consist of common, lower-case words.
explosion_spaCy
train
py
6b9074fbf28fc871581204f5106c819004ed3aa3
diff --git a/test/ResourceStreamTest.php b/test/ResourceStreamTest.php index <HASH>..<HASH> 100644 --- a/test/ResourceStreamTest.php +++ b/test/ResourceStreamTest.php @@ -62,6 +62,10 @@ class ResourceStreamTest extends TestCase { $this->expectException(StreamException::class); Loop::run(function () { + try { /* prevent crashes with phpdbg due to SIGPIPE not being handled... */ + Loop::onSignal(defined("SIGPIPE") ? SIGPIPE : 13, function () {}); + } catch (Loop\UnsupportedFeatureException $e) {} + list($a, $b) = $this->getStreamPair(); $message = \str_repeat(".", self::LARGE_MESSAGE_SIZE); @@ -79,6 +83,10 @@ class ResourceStreamTest extends TestCase { $this->expectException(StreamException::class); Loop::run(function () { + try { /* prevent crashes with phpdbg due to SIGPIPE not being handled... */ + Loop::onSignal(defined("SIGPIPE") ? SIGPIPE : 13, function () {}); + } catch (Loop\UnsupportedFeatureException $e) {} + list($a, $b) = $this->getStreamPair(); $message = \str_repeat(".", 8192 /* default chunk size */);
Prevent SIGPIPE test aborts with phpdbg
amphp_byte-stream
train
php
cf59acdfed7b38fd6812d29b871d427032055c98
diff --git a/estnltk_core/estnltk_core/base_text.py b/estnltk_core/estnltk_core/base_text.py index <HASH>..<HASH> 100644 --- a/estnltk_core/estnltk_core/base_text.py +++ b/estnltk_core/estnltk_core/base_text.py @@ -42,7 +42,7 @@ class BaseText: __slots__ = ['text', 'meta', '__dict__', '_shadowed_layers'] def __init__(self, text: str = None) -> None: - assert text is None or isinstance(text, str), "Text takes string as an argument!" + assert text is None or isinstance(text, str), "{} takes string as an argument!".format( self.__class__.__name__ ) # self.text: str super().__setattr__('text', text) # self._shadowed_layers: Mapping[str, Layer]
Updated BaseText: removed class name hard-coding
estnltk_estnltk
train
py
e226fcbcdb1589bba58a6a3dc6ddca0682d3a79b
diff --git a/flask_injector.py b/flask_injector.py index <HASH>..<HASH> 100644 --- a/flask_injector.py +++ b/flask_injector.py @@ -15,7 +15,7 @@ import flask try: import flask_restplus except ImportError: - flask_resplus = None + flask_restplus = None from injector import Injector, inject from flask import Config, Request from werkzeug.local import Local, LocalManager, LocalProxy
Fix typo (#<I>)
alecthomas_flask_injector
train
py
81857d414a427accfa3d22f995c5b5bfbdedef0f
diff --git a/api/app/s3.go b/api/app/s3.go index <HASH>..<HASH> 100644 --- a/api/app/s3.go +++ b/api/app/s3.go @@ -175,15 +175,11 @@ func createBucket(app *App) (*s3Env, error) { env.locationConstraint = bucket.S3LocationConstraint env.endpoint = bucket.S3Endpoint case err := <-errChan: - switch err.(type) { - case *iam.Error: - if env.bucket != "" { - s.Bucket(env.bucket).DelBucket() - } - case *s3.Error: - if userName != "" { - iamEndpoint.DeleteUser(userName) - } + if env.bucket != "" { + s.Bucket(env.bucket).DelBucket() + } + if userName != "" { + iamEndpoint.DeleteUser(userName) } return nil, err }
api/app: removed unnecessary type switching It does not matter which error happened.
tsuru_tsuru
train
go
32995b07ea8411504ce16064fcb095875c761787
diff --git a/tasks/jshint.js b/tasks/jshint.js index <HASH>..<HASH> 100644 --- a/tasks/jshint.js +++ b/tasks/jshint.js @@ -19,6 +19,10 @@ module.exports = function(grunt) { force: false }); + // Report JSHint errors but dont fail the task + var force = options.force; + delete options.force; + // Read JSHint options from a specified jshintrc file. if (options.jshintrc) { options = grunt.file.readJSON(options.jshintrc); @@ -41,10 +45,6 @@ module.exports = function(grunt) { var globals = options.globals; delete options.globals; - // Report JSHint errors but dont fail the task - var force = options.force; - delete options.force; - grunt.verbose.writeflags(options, 'JSHint options'); grunt.verbose.writeflags(globals, 'JSHint globals');
prevent the jshintrc option from wiping out the force option
gruntjs_grunt-contrib-jshint
train
js
536d26b18662a338592d4fd339915676ed6d600c
diff --git a/src/View/CrudView.php b/src/View/CrudView.php index <HASH>..<HASH> 100644 --- a/src/View/CrudView.php +++ b/src/View/CrudView.php @@ -105,7 +105,7 @@ class CrudView extends View } $internal = $this->Blocks->get($name, $default); - return $viewblock . $internal; + return $internal . $viewblock; } /**
Switch around how extending viewblocks works
FriendsOfCake_crud-view
train
php
ffa5e539df2dcdd49191f44b52f3af3cf850d806
diff --git a/symphony/lib/toolkit/class.lang.php b/symphony/lib/toolkit/class.lang.php index <HASH>..<HASH> 100755 --- a/symphony/lib/toolkit/class.lang.php +++ b/symphony/lib/toolkit/class.lang.php @@ -6,7 +6,6 @@ } ## Provice an interface for transliterations - /* function _t($str){ $patterns = array_keys(Lang::Transliterations()); @@ -16,7 +15,7 @@ return $str; } - */ + Class Dictionary{ private $_strings;
Fixed small bug with _t function
symphonycms_symphony-2
train
php
c13582511a20416e8cd72b69f1fb33fd2331bf6f
diff --git a/master/buildbot/steps/slave.py b/master/buildbot/steps/slave.py index <HASH>..<HASH> 100644 --- a/master/buildbot/steps/slave.py +++ b/master/buildbot/steps/slave.py @@ -135,7 +135,7 @@ class RemoveDirectory(buildstep.BuildStep): return self.finished(SUCCESS) -class MakeDirectory(BuildStep): +class MakeDirectory(buildstep.BuildStep): """ Create a directory on the slave. """ @@ -149,7 +149,7 @@ class MakeDirectory(BuildStep): flunkOnFailure = True def __init__(self, dir, **kwargs): - BuildStep.__init__(self, **kwargs) + buildstep.BuildStep.__init__(self, **kwargs) self.addFactoryArguments(dir = dir) self.dir = dir @@ -158,7 +158,7 @@ class MakeDirectory(BuildStep): if not slavever: raise BuildSlaveTooOldError("slave is too old, does not know " "about mkdir") - cmd = LoggedRemoteCommand('mkdir', {'dir': self.dir }) + cmd = buildstep.LoggedRemoteCommand('mkdir', {'dir': self.dir }) d = self.runCommand(cmd) d.addCallback(lambda res: self.commandComplete(cmd)) d.addErrback(self.failed)
Add missing 'buildstep.' in MakeDirectory.
buildbot_buildbot
train
py
1756a9478ef5c5545a72080d2db39db8a2bc6bc3
diff --git a/guava/src/com/google/common/collect/CollectPreconditions.java b/guava/src/com/google/common/collect/CollectPreconditions.java index <HASH>..<HASH> 100644 --- a/guava/src/com/google/common/collect/CollectPreconditions.java +++ b/guava/src/com/google/common/collect/CollectPreconditions.java @@ -16,7 +16,6 @@ package com.google.common.collect; -import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkState; import com.google.common.annotations.GwtCompatible; @@ -35,8 +34,11 @@ final class CollectPreconditions { } } - static void checkNonnegative(int value, String name) { - checkArgument(value >= 0, "%s cannot be negative: %s", name, value); + static int checkNonnegative(int value, String name) { + if (value < 0) { + throw new IllegalArgumentException(name + " cannot be negative but was: " + value); + } + return value; } /**
Shuffling from internal-only change. ------------- Created by MOE: <URL>
google_guava
train
java
3ecdc057b5dd68fc4e577484296b3ba91370a8f3
diff --git a/builtin/providers/digitalocean/resource_digitalocean_droplet_test.go b/builtin/providers/digitalocean/resource_digitalocean_droplet_test.go index <HASH>..<HASH> 100644 --- a/builtin/providers/digitalocean/resource_digitalocean_droplet_test.go +++ b/builtin/providers/digitalocean/resource_digitalocean_droplet_test.go @@ -371,24 +371,6 @@ func testAccCheckDigitalOceanDropletRecreated(t *testing.T, } } -// Not sure if this check should remain here as the underlaying -// function is changed and is tested indirectly by almost all -// other test already -// -//func Test_new_droplet_state_refresh_func(t *testing.T) { -// droplet := godo.Droplet{ -// Name: "foobar", -// } -// resourceMap, _ := resource_digitalocean_droplet_update_state( -// &terraform.InstanceState{Attributes: map[string]string{}}, &droplet) -// -// // See if we can access our attribute -// if _, ok := resourceMap.Attributes["name"]; !ok { -// t.Fatalf("bad name: %s", resourceMap.Attributes) -// } -// -//} - var testAccCheckDigitalOceanDropletConfig_basic = fmt.Sprintf(` resource "digitalocean_ssh_key" "foobar" { name = "foobar"
provider/digitalocean: Removal of an old test that was causing the CI acceptance tests to hang
hashicorp_terraform
train
go
4bf53ef3483f8035b7d4ac6a698b46dca839997b
diff --git a/api-spec-testing/test_file.rb b/api-spec-testing/test_file.rb index <HASH>..<HASH> 100644 --- a/api-spec-testing/test_file.rb +++ b/api-spec-testing/test_file.rb @@ -207,11 +207,15 @@ module Elasticsearch def clear_snapshots_and_repositories(client) if repositories = client.snapshot.get_repository repositories.keys.each do |repository| - if snapshots = client.snapshot.get(repository: repository, snapshot: '_all')['snapshots'] - snapshots.each do |s| - client.snapshot.delete(repository: repository, snapshot: s['snapshot']) + responses = client.snapshot.get(repository: repository, snapshot: '_all')['responses'] + next unless responses + + responses.each do |response| + response['snapshots'].each do |snapshot| + client.snapshot.delete(repository: repository, snapshot: snapshot['snapshot']) end end + client.snapshot.delete_repository(repository: repository) end end
Test Runner: Update the way snapshots are cleaned up
elastic_elasticsearch-ruby
train
rb
2c19d693a9c4376ea28f9d4b3803d1fbbb480e1b
diff --git a/core/src/main/java/org/infinispan/AbstractDelegatingCache.java b/core/src/main/java/org/infinispan/AbstractDelegatingCache.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/infinispan/AbstractDelegatingCache.java +++ b/core/src/main/java/org/infinispan/AbstractDelegatingCache.java @@ -91,7 +91,7 @@ public abstract class AbstractDelegatingCache<K, V> implements Cache<K, V> { * @see {@link org.infinispan.CacheSupport#set(Object, Object)} */ protected void set(K key, V value) { - put(key, value); + cache.put(key, value); } public V putIfAbsent(K key, V value, long lifespan, TimeUnit unit) {
Fix commit for PutNoReturn optimizations
infinispan_infinispan
train
java
eaadf2cc7e8e0238b978609e2121dad854436bc8
diff --git a/test/runner/time/TimerPointTest.php b/test/runner/time/TimerPointTest.php index <HASH>..<HASH> 100644 --- a/test/runner/time/TimerPointTest.php +++ b/test/runner/time/TimerPointTest.php @@ -212,12 +212,12 @@ class TimerPointTest extends TaoPhpUnitTestRunner [ new TimePoint(null, 1459335300, TimePoint::TYPE_START, TimePoint::TARGET_CLIENT), new TimePoint(null, 1459335311, TimePoint::TYPE_START, TimePoint::TARGET_CLIENT), - -11000, + -110000, ], [ new TimePoint(null, 1459335300, TimePoint::TYPE_START, TimePoint::TARGET_CLIENT), new TimePoint(null, 1459335289, TimePoint::TYPE_START, TimePoint::TARGET_CLIENT), - 11000, + 110000, ], [ new TimePoint(null, 1459335300, TimePoint::TYPE_START, TimePoint::TARGET_CLIENT),
Fix the unit test of TimePoint since the precision has changed
oat-sa_extension-tao-test
train
php
f446df180d2def1cea9fde525385cfd7c6790180
diff --git a/lib/template.js b/lib/template.js index <HASH>..<HASH> 100644 --- a/lib/template.js +++ b/lib/template.js @@ -164,8 +164,8 @@ module.exports = (options = {}) => { const mount = (mountInputs) => { let formatted = []; const mounts = { - mountPoints: [{ ContainerPath: '/tmp', SourceVolume: 'tmp' }], - volumes: [{ Name: 'tmp' }] + mountPoints: [], + volumes: [] }; if (typeof mountInputs === 'object') formatted = mountInputs; @@ -180,6 +180,11 @@ module.exports = (options = {}) => { }); } + if (formatted.indexOf('/tmp') === -1) { + mounts.mountPoints.push({ ContainerPath: '/tmp', SourceVolume: 'tmp' }); + mounts.volumes.push({ Name: 'tmp' }); + } + formatted.forEach((container, i) => { const name = 'mnt-' + i;
Only add /tmp if it's not there already (#<I>)
mapbox_ecs-watchbot
train
js
a1be60d3bef156110b646fdd59a3e2e393e9f589
diff --git a/io/stream_writer_test.go b/io/stream_writer_test.go index <HASH>..<HASH> 100644 --- a/io/stream_writer_test.go +++ b/io/stream_writer_test.go @@ -1,4 +1,4 @@ -// Copyright 2016 tsuru authors. All rights reserved. +// Copyright 2017 tsuru authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -242,7 +242,9 @@ func (s *S) TestSimpleJsonMessageFormatterJsonInJson(c *check.C) { parts = append(parts, []byte(`{"message":"no json 2\n"}`)) outBuf := bytes.Buffer{} streamWriter := NewStreamWriter(&outBuf, nil) - streamWriter.Write(bytes.Join(parts, []byte("\n"))) + written, err := streamWriter.Write(bytes.Join(parts, []byte("\n"))) + c.Assert(err, check.IsNil) + c.Assert(written, check.Equals, 4612) c.Assert(outBuf.String(), check.Equals, "no json 1\n"+ "latest: Pulling from tsuru/static\n"+ "a6aa3b66376f: Already exists\n"+
io: assert for number of chars written
tsuru_tsuru
train
go
882809ebadfa3d1bb9daafa742c3b896ff352c2d
diff --git a/lib/gitomator/task.rb b/lib/gitomator/task.rb index <HASH>..<HASH> 100644 --- a/lib/gitomator/task.rb +++ b/lib/gitomator/task.rb @@ -35,6 +35,10 @@ module Gitomator context.hosting end + def tagging + context.tagging + end + def ci context.ci end
add the tagging() method to Gitomator::BaseTask
gitomator_gitomator
train
rb
7246316a3b451f306635c0bbb74dbfd80e774210
diff --git a/documentation/manual/working/javaGuide/main/ws/code/javaguide/ws/controllers/OpenIDController.java b/documentation/manual/working/javaGuide/main/ws/code/javaguide/ws/controllers/OpenIDController.java index <HASH>..<HASH> 100644 --- a/documentation/manual/working/javaGuide/main/ws/code/javaguide/ws/controllers/OpenIDController.java +++ b/documentation/manual/working/javaGuide/main/ws/code/javaguide/ws/controllers/OpenIDController.java @@ -4,8 +4,6 @@ package javaguide.ws.controllers; -import play.twirl.api.Html; - // #ws-openid-controller // ###insert: package controllers; @@ -15,6 +13,7 @@ import java.util.concurrent.CompletionStage; import play.data.*; import play.libs.openid.*; import play.mvc.*; +import play.twirl.api.Html; import javax.inject.Inject;
Added import play.twirl.api.Html; (#<I>) * Added import play.twirl.api.Html; It is required in line <I>. * Remove duplicated import (cherry picked from commit f<I>b<I>feeaa2d<I>f<I>f<I>a<I>e<I>)
playframework_playframework
train
java
319cc3a0dea91d94fc98ce4a8cfdb62fdc51db22
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,10 +3,11 @@ from setuptools import setup, find_packages config = { 'description': "A suite of tools for portable automated scientific protocols.", 'author': "OpenTrons", + 'author_email': 'info@opentrons.com', 'url': 'http://opentrons.com', 'version': '0.4', 'install_requires': ['pyyaml'], - 'packages': find_packages(), + 'packages': find_packages(exclude=["tests"]), 'package_data': { "labsuite": [ "config/containers/**/*.yml",
Setup: Author email and exclude tests from the package.
Opentrons_opentrons
train
py
055c11155d3c7341ed3a941a311edf1997a5a6d8
diff --git a/core/field.js b/core/field.js index <HASH>..<HASH> 100644 --- a/core/field.js +++ b/core/field.js @@ -231,9 +231,9 @@ Blockly.Field.prototype.getSize = function() { */ Blockly.Field.prototype.getScaledBBox_ = function() { var bBox = this.borderRect_.getBBox(); - bBox.width *= this.sourceBlock_.workspace.scale; - bBox.height *= this.sourceBlock_.workspace.scale; - return bBox; + // Create new object, as getBBox can return an uneditable SVGRect. + return {width: bBox.width * this.sourceBlock_.workspace.scale, + height: bBox.height * this.sourceBlock_.workspace.scale}; }; /**
Update getScaledBBox_ to return new object to fix issue in IE.
LLK_scratch-blocks
train
js
9d5fd086f54ed059ee26853b84f419bef207f0d6
diff --git a/src/app.js b/src/app.js index <HASH>..<HASH> 100644 --- a/src/app.js +++ b/src/app.js @@ -91,6 +91,7 @@ var defaults = { keywordAnalysisActive: true, contentAnalysisActive: true, hasSnippetPreview: true, + debounceRefresh: true, }; /** @@ -245,6 +246,8 @@ function verifyArguments( args ) { * @param {Function} args.marker The marker to use to apply the list of marks retrieved from an assessment. * * @param {SnippetPreview} args.snippetPreview The SnippetPreview object to be used. + * @param {boolean} [args.debouncedRefresh] Whether or not to debounce the + * refresh function. Defaults to true. * * @constructor */ @@ -259,7 +262,9 @@ var App = function( args ) { this.config = args; - this.refresh = debounce( this.refresh.bind( this ), inputDebounceDelay ); + if ( args.debouncedRefresh === true ) { + this.refresh = debounce( this.refresh.bind( this ), inputDebounceDelay ); + } this._pureRefresh = throttle( this._pureRefresh.bind( this ), this.config.typeDelay ); this.callbacks = this.config.callbacks;
Add optional debounce to the app -- needs to be unbound for the replacement
Yoast_YoastSEO.js
train
js
6340dab67f89d0b73c31c3463fcbe12536c0f124
diff --git a/tinkergraph-gremlin/src/main/java/com/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java b/tinkergraph-gremlin/src/main/java/com/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java index <HASH>..<HASH> 100644 --- a/tinkergraph-gremlin/src/main/java/com/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java +++ b/tinkergraph-gremlin/src/main/java/com/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java @@ -27,8 +27,6 @@ import java.util.Set; * @author Marko A. Rodriguez (http://markorodriguez.com) * @author Stephen Mallette (http://stephen.genoprime.com) */ -@Graph.OptOut(test = "com.tinkerpop.gremlin.structure.GraphTest", method = "shouldImplementAndExposeFeatures", reason = "cause i said so!") -@Graph.OptOut(test = "com.tinkerpop.gremlin.structure.PropertyTest$BasicPropertyTest", method = "shouldHaveStandardStringRepresentation", reason = "cause i said so son!") public class TinkerGraph implements Graph, Serializable { protected Long currentId = -1l;
Remove OptOut annotations on TinkerGraph.
apache_tinkerpop
train
java
79f55c04db30fe7353d78993a6642483596d63de
diff --git a/src/Blockade/Firewall.php b/src/Blockade/Firewall.php index <HASH>..<HASH> 100644 --- a/src/Blockade/Firewall.php +++ b/src/Blockade/Firewall.php @@ -53,7 +53,7 @@ class Firewall } /** - * Add a exemption to this Firewall. If a request passes this + * Add an exemption to this Firewall. If a request passes this * exemption it will be granted explicit access, skipping any * other firewall rules. * @@ -109,7 +109,7 @@ class Firewall * * @param Request $request The request to check * @return Boolean true if the request is granted explicit access - * via a exemption, false if the request passed but has not been + * via an exemption, false if the request passed but has not been * granted explicit access (allowing other firewalls to check) * @throws AuthenticationException if the request is not authenticated * @throws AuthorizationException if the request is not authorized @@ -117,14 +117,15 @@ class Firewall public function check(Request $request) { //first check the exemptions. If the request passes any of - //these, skip all other rules and firewalls. + //these, skip all other rules and grant explicit access. foreach ($this->exemptions as $exemption) { try { if (true === $this->checkRule($request, $exemption)) { return true; } - //catch any security exceptions - we dont want - //to fail the firewall if an exemption fails + //catch any exceptions - a failed exemption shouldn't + //fail the firewall entirely. Just move to on to the + //next one. } catch (BlockadeException $e) {} }
Firewall - small fixes in comments.
glynnforrest_blockade
train
php
121cbc317bbef9b0e974be52c256f1dd9fd6cce6
diff --git a/src/Class.Timers.js b/src/Class.Timers.js index <HASH>..<HASH> 100644 --- a/src/Class.Timers.js +++ b/src/Class.Timers.js @@ -32,7 +32,7 @@ Class.Timers = new Class({ * @return {Class} */ addTimer: function(key, fn) { - this.timers[key] = fn; + this.timers[key] = Function.from(fn); return this; }, @@ -63,7 +63,7 @@ Class.Timers = new Class({ this.clearTimer(key); if (this.timers[key]) { - this.$timers[key] = window.setTimeout(this.timers[key].apply(this, args), delay || 0); + this.$timers[key] = this.timers[key].delay(delay, this, args); } return this; @@ -81,7 +81,7 @@ Class.Timers = new Class({ this.clearTimer(key); if (this.timers[key]) { - this.$timers[key] = window.setInterval(this.timers[key].apply(this, args), interval || 0); + this.$timers[key] = this.timers[key].periodical(interval, this, args); } return this;
Updated to use built in function methods
titon_toolkit
train
js
ffffd49c88a958734a8c83c0e413a18b099dfe07
diff --git a/pyemma/coordinates/data/iterable.py b/pyemma/coordinates/data/iterable.py index <HASH>..<HASH> 100644 --- a/pyemma/coordinates/data/iterable.py +++ b/pyemma/coordinates/data/iterable.py @@ -172,11 +172,6 @@ class LaggedIterator(object): return self.next() def next(self): - try: - data_lagged = self._it_lagged.next() - except StopIteration: - self._it.close() - raise data = self._it.next() itraj = None if self._return_trajindex:
[iterable] lagged iter: do not call next twice on lagged iter instance.
markovmodel_PyEMMA
train
py
a2f8184ebfa8a4211a8da8ea04c1f1e42c00bb4c
diff --git a/classes/PodsAPI.php b/classes/PodsAPI.php index <HASH>..<HASH> 100644 --- a/classes/PodsAPI.php +++ b/classes/PodsAPI.php @@ -3545,7 +3545,7 @@ class PodsAPI { delete_transient( 'pods_wp_cpt_ct' ); } - $wpdb->query( "DELETE FROM `{$wpdb->options}` WHERE `option_name` LIKE '_transient_pods_get_%'" ); + $wpdb->query( "DELETE FROM `{$wpdb->options}` WHERE `option_name` LIKE '_transient_pods_%'" ); wp_cache_flush(); }
Delete all transients in flush
pods-framework_pods
train
php
f51cfce4511e5b339fb3be11f5a9cf7baea69234
diff --git a/dom/src/main/java/org/isisaddons/module/excel/dom/util/ExcelServiceImpl.java b/dom/src/main/java/org/isisaddons/module/excel/dom/util/ExcelServiceImpl.java index <HASH>..<HASH> 100644 --- a/dom/src/main/java/org/isisaddons/module/excel/dom/util/ExcelServiceImpl.java +++ b/dom/src/main/java/org/isisaddons/module/excel/dom/util/ExcelServiceImpl.java @@ -29,7 +29,7 @@ import org.apache.isis.applib.annotation.Programmatic; import org.apache.isis.applib.services.bookmark.BookmarkService; import org.apache.isis.applib.value.Blob; import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager; -import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi; +import org.apache.isis.core.metamodel.spec.SpecificationLoader; import org.apache.isis.core.runtime.system.context.IsisContext; import org.apache.isis.core.runtime.system.persistence.PersistenceSession; @@ -127,7 +127,7 @@ public class ExcelServiceImpl { // ////////////////////////////////////// - private SpecificationLoaderSpi getSpecificationLoader() { + private SpecificationLoader getSpecificationLoader() { return IsisContext.getSpecificationLoader(); }
fixing after change to internal APIs of <I>-SNAPSHOT
isisaddons-legacy_isis-module-excel
train
java
484caef4f30c8a3ef12e2d97f6b02ca1223c6273
diff --git a/tasks/webpack.js b/tasks/webpack.js index <HASH>..<HASH> 100644 --- a/tasks/webpack.js +++ b/tasks/webpack.js @@ -21,7 +21,7 @@ const configWatchPatterns = config.webpack.tsWatchPatterns.map((cPath) => path.j const webpackWatchPatterns = [ ...webpackSourcePatterns, - configWatchPatterns + ...configWatchPatterns ]; if (config.webpack.watchScss) {
fix: 🐛 Missing destructuring (#<I>)
biotope_biotope-build
train
js
4077ea2d53637525f2de2cf5d8944a6b34200b08
diff --git a/server/src/site/js/orientdb-api.js b/server/src/site/js/orientdb-api.js index <HASH>..<HASH> 100644 --- a/server/src/site/js/orientdb-api.js +++ b/server/src/site/js/orientdb-api.js @@ -93,7 +93,9 @@ function ODatabase(databasePath) { } if (authProxy != null && authProxy != '') { authProxy = '/' + authProxy; - } + }else + authProxy = ''; + if (type == null || type == '') { type = 'GET'; } @@ -341,7 +343,7 @@ function ODatabase(databasePath) { } this.transformResponse = function(msg) { - if (this.getEvalResponse() && typeof msg != 'object') { + if (this.getEvalResponse() && msg.length > 0 && typeof msg != 'object' ) { return eval("(" + msg + ")"); } else { return msg;
Fixed problem with authProxy: server didn't work.
orientechnologies_orientdb
train
js
d11a16c6ea52bb37267b327f0a857eb59abc1916
diff --git a/tests/runall.py b/tests/runall.py index <HASH>..<HASH> 100755 --- a/tests/runall.py +++ b/tests/runall.py @@ -1,17 +1,15 @@ #!/usr/bin/python """Run ***ALL*** the testorz!!!""" -import unittest -import imp import glob import os +import sys +import unittest cwd = os.path.dirname(globals().get('__file__', os.getcwd())) -test_list = [(os.path.basename(f)[:-3], f) - for f in glob.glob(os.path.join(cwd, 'test_*.py'))] -for test_module, test_file in test_list: - test_runner = imp.load_source(test_module, test_file) - print 'Running test suit "%s"' % test_module - suite = unittest.defaultTestLoader.loadTestsFromModule(test_runner) - unittest.TextTestRunner(verbosity=2).run(suite) +tests = unittest.TestLoader().discover(cwd) +runner = unittest.TextTestRunner(verbosity=2) +result = runner.run(tests) +if not result.wasSuccessful(): + sys.exit(1)
Run tests more sensibly. Use the unittest suite better. Have proper exit codes.
lyda_misspell-check
train
py
16c0858e21a3e938bea18cf827445bb38b8bf650
diff --git a/lib/processCss.js b/lib/processCss.js index <HASH>..<HASH> 100644 --- a/lib/processCss.js +++ b/lib/processCss.js @@ -179,7 +179,7 @@ module.exports = function processCss(inputSource, inputMap, options, callback) { ]); if(minimize) { - var minimizeOptions = assign({}, query); + var minimizeOptions = assign({}, query.minimize); ["zindex", "normalizeUrl", "discardUnused", "mergeIdents", "reduceIdents", "autoprefixer"].forEach(function(name) { if(typeof minimizeOptions[name] === "undefined") minimizeOptions[name] = false;
fix: `minimizeOptions` should be `query.minimize`! It's a mistake according to the doc. Init `minimizeOptions` should be `query.minimize` rather than just query. <URL>
webpack-contrib_css-loader
train
js
ecc95c04b68817e5542edc562acb88163fb8e13c
diff --git a/src/AwsWrappers/AwsConfigDataProvider.php b/src/AwsWrappers/AwsConfigDataProvider.php index <HASH>..<HASH> 100644 --- a/src/AwsWrappers/AwsConfigDataProvider.php +++ b/src/AwsWrappers/AwsConfigDataProvider.php @@ -54,7 +54,7 @@ class AwsConfigDataProvider $cacheFile = \sys_get_temp_dir() . "/iam.role.cache"; } $cacheAdapter = new DoctrineCacheAdapter(new FilesystemCache($cacheFile)); - $data['credentials'] = CredentialProvider::cache(CredentialProvider::defaultProvider(), $cacheAdapter); + $data['credentials'] = CredentialProvider::cache(CredentialProvider::ecsCredentials(), $cacheAdapter); } $this->config = $data;
Default use ecs credential in iam role authentication mode
oasmobile_php-aws-wrappers
train
php
e5797cd4adf79dde9358baf35cadcf6e7baa625e
diff --git a/calendar/export_execute.php b/calendar/export_execute.php index <HASH>..<HASH> 100644 --- a/calendar/export_execute.php +++ b/calendar/export_execute.php @@ -29,7 +29,7 @@ $allowed_time = array('weeknow', 'weeknext', 'monthnow', 'monthnext', 'recentupc if(!empty($what) && !empty($time)) { if(in_array($what, $allowed_what) && in_array($time, $allowed_time)) { - $courses = get_my_courses($user->id); + $courses = get_my_courses($user->id, NULL, 'id, visible, shortname'); $include_user = ($what == 'all'); if ($include_user) { @@ -99,7 +99,6 @@ if(!empty($what) && !empty($time)) { die(); } } - $whereclause = calendar_sql_where($timestart, $timeend, $include_user ? array($user->id) : false, false, array_keys($courses), false); if($whereclause === false) { $events = array();
Small improvement. Reducing the list of fields returned by get_my_courses(). Merged from MOODLE_<I>_STABLE
moodle_moodle
train
php
8a6d419d99a3859a9ac01a02fb700c2f427787ae
diff --git a/lib/graphql-docs/generator.rb b/lib/graphql-docs/generator.rb index <HASH>..<HASH> 100644 --- a/lib/graphql-docs/generator.rb +++ b/lib/graphql-docs/generator.rb @@ -90,7 +90,9 @@ module GraphQLDocs unless @options[:landing_pages][:query].nil? query_landing_page = @options[:landing_pages][:query] query_landing_page = File.read(query_landing_page) - if @renderer.has_yaml?(query_landing_page) + if @renderer.respond_to?(:has_yaml?) && \ + @renderer.has_yaml?(query_landing_page) && \ + @renderer.respond_to?(:yaml_split) pieces = @renderer.yaml_split(query_landing_page) pieces[2] = pieces[2].chomp metadata = pieces[1, 3].join("\n")
Not every renderer will have YAML support
gjtorikian_graphql-docs
train
rb
4ac1a92ec4dcc9355f0390087cba8807ca1c3358
diff --git a/app/components/sidenav.js b/app/components/sidenav.js index <HASH>..<HASH> 100644 --- a/app/components/sidenav.js +++ b/app/components/sidenav.js @@ -38,7 +38,7 @@ export default Component(() => ( top: '0', height: '200px' }}> - <Sidenav.Item showIcon icon={<Icon name="user"/>}/> + <Sidenav.Item showIcon icon={<Icon name="person"/>}/> <Sidenav.Item showIcon icon={<Icon name="dashboard"/>} selected/> <Sidenav.Separator/> <Sidenav.Item showIcon icon={<Icon name="settings"/>}/>
Fixed missing icon on sidenav demo page
garth_snabbdom-material
train
js
8ff4b2345a79d290f74f9b7d572bb3908b6ab640
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -25,6 +25,6 @@ setup(name='astral', author_email='python@sffjunkie.co.uk', url="http://www.sffjunkie.co.uk/python-astral.html", license='Apache-2.0', - package_dir={'': 'src'}, + package_dir={'': 'astral'}, py_modules=['astral'] )
Changed to match new source directory.
sffjunkie_astral
train
py
8401d9a19cb95f1dea21c425bf7df67d4544aee0
diff --git a/src/ActionButton/ActionButton.react.js b/src/ActionButton/ActionButton.react.js index <HASH>..<HASH> 100755 --- a/src/ActionButton/ActionButton.react.js +++ b/src/ActionButton/ActionButton.react.js @@ -50,7 +50,10 @@ const propTypes = { /** * If specified it'll be shown before text */ - icon: PropTypes.string, + icon: PropTypes.oneOfType([ + PropTypes.element, + PropTypes.string, + ]), /** * Leave it empty if you don't want any transition after press. Otherwise, it will be trnasform * to another view - depends on transition value.
[ActionButton] Change propTypes to allow elements for icons (#<I>)
xotahal_react-native-material-ui
train
js