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
be3d4a8acf74170a406ef6812da6eb993b961cd8
diff --git a/cmd/containerd/containerd.go b/cmd/containerd/containerd.go index <HASH>..<HASH> 100644 --- a/cmd/containerd/containerd.go +++ b/cmd/containerd/containerd.go @@ -26,6 +26,7 @@ import ( _ "github.com/containerd/containerd/gc/scheduler" _ "github.com/containerd/containerd/metrics/cgroups" _ "github.com/containerd/containerd/runtime/v1/linux" + _ "github.com/containerd/containerd/runtime/v2" _ "github.com/containerd/containerd/services/containers" _ "github.com/containerd/containerd/services/content" _ "github.com/containerd/containerd/services/diff"
Explicitly import runtime v2 in the test containerd binary.
containerd_containerd
train
go
3cd0f991ddf417e5a611a90a9ce53f740f7b4e38
diff --git a/library/Garp/ErrorHandler.php b/library/Garp/ErrorHandler.php index <HASH>..<HASH> 100644 --- a/library/Garp/ErrorHandler.php +++ b/library/Garp/ErrorHandler.php @@ -109,7 +109,7 @@ class Garp_ErrorHandler { $mailer = new Garp_Mailer(); return $mailer->send(array( 'to' => $to, - 'subject' => $subjectPrefix . 'An application error occurred' + 'subject' => $subjectPrefix . 'An application error occurred', 'message' => $errorMessage )); }
Added missing comma to error handler mail call
grrr-amsterdam_garp3
train
php
0ee77644633b72fa9a44edf64c32526aec5de2fc
diff --git a/lib/hqmf-parser/2.0/document.rb b/lib/hqmf-parser/2.0/document.rb index <HASH>..<HASH> 100644 --- a/lib/hqmf-parser/2.0/document.rb +++ b/lib/hqmf-parser/2.0/document.rb @@ -258,7 +258,7 @@ module HQMF2 criteria.instance_variable_set(:@source_data_criteria, collapsed_source_data_criteria[criteria.id]) end handle_variable(criteria) if criteria.variable - + handle_specific_source_data_criteria_reference(criteria) @reference_ids.concat(criteria.children_criteria) if criteria.temporal_references criteria.temporal_references.each do |tr| @@ -266,5 +266,16 @@ module HQMF2 end end end + + # For specific occurrence data criteria, make sure the source data criteria reference points + # to the correct source data criteria. + def handle_specific_source_data_criteria_reference(criteria) + sdc = find(@source_data_criteria, :id, criteria.source_data_criteria) + if criteria && !criteria.specific_occurrence.nil? && !sdc.nil? && + sdc.specific_occurrence.nil? && !find(@source_data_criteria, :id, criteria.id).nil? + criteria.instance_variable_set(:@source_data_criteria, criteria.id) + end + end + end end
Fix for issue with specific occurrences The HQMF parser now makes sure specific occurrence data criteria have the correct source data criteria reference (to bring the parsed HQMF in line with the parsed SimpleXML)
projectcypress_health-data-standards
train
rb
2ef4c58ce7e0b4e8eef6fe7629740cfd0b970134
diff --git a/lib/isono/amqp_client.rb b/lib/isono/amqp_client.rb index <HASH>..<HASH> 100644 --- a/lib/isono/amqp_client.rb +++ b/lib/isono/amqp_client.rb @@ -80,10 +80,13 @@ module Isono } @amqp_client.callback { on_connect - blk.call if blk + if blk + blk.arity == 1 ? blk.call(:success) : blk.call + end } @amqp_client.errback { logger.error("Failed to connect to the broker: #{amqp_server_uri}") + blk.call(:error) if blk && blk.arity == 1 } # Note: Thread.current[:mq] is utilized in amqp gem. Thread.current[:mq] = ::MQ.new(@amqp_client)
add arity check to use single proc for both success and fail callback.
axsh_isono
train
rb
e69c1c4ec7a72da928c42c0f49664706dc8a809c
diff --git a/tail/tail.go b/tail/tail.go index <HASH>..<HASH> 100644 --- a/tail/tail.go +++ b/tail/tail.go @@ -34,7 +34,7 @@ type TailOptions struct { ReadFrom string `long:"read_from" description:"Location in the file from which to start reading. Values: beginning, end, last. Last picks up where it left off, if the file has not been rotated, otherwise beginning. When --backfill is set, it will override this option=beginning" default:"last"` Stop bool `long:"stop" description:"Stop reading the file after reaching the end rather than continuing to tail. When --backfill is set, it will override this option=true"` Poll bool `long:"poll" description:"use poll instead of inotify to tail files"` - StateFile string `long:"statefile" description:"File in which to store the last read position. Defaults to a file with the same path as the log file and the suffix .leash.state. If tailing multiple files, default is forced."` + StateFile string `long:"statefile" description:"File in which to store the last read position. Defaults to a file in /tmp named $logfile.leash.state. If tailing multiple files, default is forced."` } // Statefile mechanics when ReadFrom is 'last' @@ -182,7 +182,7 @@ func tailSingleFile(tailer *tail.Tail, file string, stateFile string) chan strin }).Warn("Failed to open statefile for writing. File location will not be saved.") } - ticker := time.NewTimer(time.Second) + ticker := time.NewTicker(time.Second) state := State{} go func() { for range ticker.C {
fix typo that broke state file maintenance. Also fixes file rotation following issues
honeycombio_honeytail
train
go
911b30b966b0eec37f28e5403b28396cf8e8a416
diff --git a/examples/image-streamer/api300/build_plan.rb b/examples/image-streamer/api300/build_plan.rb index <HASH>..<HASH> 100644 --- a/examples/image-streamer/api300/build_plan.rb +++ b/examples/image-streamer/api300/build_plan.rb @@ -1,4 +1,4 @@ -# (C) Copyright 2017 Hewlett Packard Enterprise Development LP +-47++# (C) Copyright 2017 Hewlett Packard Enterprise Development LP # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ require_relative '../../_client_i3s' # Gives access to @client # Example: Create a build plan for an API300 Image Streamer -# NOTE: This will create a plan script named 'Build_Plan_1', then delete it. +# NOTE: This will create a build plan named 'Build_Plan_1', then delete it. options = { name: 'Build_Plan_1', oeBuildPlanType: 'Deploy'
Fixing comment in example for build plan
HewlettPackard_oneview-sdk-ruby
train
rb
5a3687775b9bc5e3c56c671a4df977ae74214286
diff --git a/app/models/renalware/letters/letter.rb b/app/models/renalware/letters/letter.rb index <HASH>..<HASH> 100644 --- a/app/models/renalware/letters/letter.rb +++ b/app/models/renalware/letters/letter.rb @@ -56,7 +56,6 @@ module Renalware } singleton_class.send(:alias_method, :in_progress, :pending) - scope :reverse, -> { order("#{effective_date_sort} asc") } scope :reversed, -> { order("#{effective_date_sort} asc") } scope :ordered, -> { order("#{effective_date_sort} desc") } scope :with_letterhead, -> { includes(:letterhead) } diff --git a/app/presenters/renalware/dashboard/dashboard_presenter.rb b/app/presenters/renalware/dashboard/dashboard_presenter.rb index <HASH>..<HASH> 100644 --- a/app/presenters/renalware/dashboard/dashboard_presenter.rb +++ b/app/presenters/renalware/dashboard/dashboard_presenter.rb @@ -27,7 +27,7 @@ module Renalware @letters_in_progress ||= begin present_letters( Letters::Letter - .reverse + .reversed .where("author_id = ? or created_by_id = ?", user.id, user.id) .in_progress .includes(:author, :patient, :letterhead)
Rename reverse scope reversed on Letter
airslie_renalware-core
train
rb,rb
9a38ec9c2355f776b0b6d3c860f9b88f9837892d
diff --git a/src/org/openscience/cdk/io/CMLWriter.java b/src/org/openscience/cdk/io/CMLWriter.java index <HASH>..<HASH> 100644 --- a/src/org/openscience/cdk/io/CMLWriter.java +++ b/src/org/openscience/cdk/io/CMLWriter.java @@ -496,7 +496,7 @@ public class CMLWriter extends DefaultChemObjectWriter { childElements.append(" <string convention=\"CDK\" builtin=\"order\"" + bond.getOrder() + "\"/>\n"); } - if (bond.getStereo() == CDKConstants.STEREO_BOND_UP && + if (bond.getStereo() == CDKConstants.STEREO_BOND_UP || bond.getStereo() == CDKConstants.STEREO_BOND_DOWN) { childElements.append(" <scalar dataType=\"xsd:string\" dictRef=\"mdl:stereo\">"); if (bond.getStereo() == CDKConstants.STEREO_BOND_UP) {
I made || out of && in line <I>. This seems more usefull ... git-svn-id: <URL>
cdk_cdk
train
java
4574e9bcf73112b51ecdb40c774fe0d658c365b4
diff --git a/plugins/osdn/registry.go b/plugins/osdn/registry.go index <HASH>..<HASH> 100644 --- a/plugins/osdn/registry.go +++ b/plugins/osdn/registry.go @@ -606,7 +606,7 @@ func (registry *Registry) SetBaseEndpointsHandler(base pconfig.EndpointsConfigHa cn, err := registry.oClient.ClusterNetwork().Get("default") if err != nil { // "can't happen"; StartNode() will already have ensured that there's no error - panic("Failed to get ClusterNetwork: " + err.Error()) + log.Fatalf("Failed to get ClusterNetwork: %v", err) } _, registry.clusterNetwork, _ = net.ParseCIDR(cn.Network) _, registry.serviceNetwork, _ = net.ParseCIDR(cn.ServiceNetwork)
Minor update to previous commit; use log.Fatalf() From review of origin#<I>
openshift_openshift-sdn
train
go
94f957568a36bcc296b3629df082029f098451b3
diff --git a/lib/impromptu.js b/lib/impromptu.js index <HASH>..<HASH> 100644 --- a/lib/impromptu.js +++ b/lib/impromptu.js @@ -198,7 +198,6 @@ Impromptu.prototype._clearError = function(name) { }) } - /** * Expose an instance of Impromptu by default. * @@ -206,18 +205,18 @@ Impromptu.prototype._clearError = function(name) { * Otherwise, you should just treat this instance as global, as if the following block read: * `module.exports = new Impromptu()` */ -; -(function () { +Impromptu.prototype.setGlobalInstance = (function () { var globalImpromptuInstance = new Impromptu() - Impromptu.prototype.setGlobalImpromptu = function (impromptuInstance) { - if (impromptuInstance instanceof Impromptu) { - globalImpromptuInstance = impromptuInstance - } - } Object.defineProperty(module, 'exports', { get: function () { return globalImpromptuInstance } }) + + return function (impromptuInstance) { + if (impromptuInstance instanceof Impromptu) { + globalImpromptuInstance = impromptuInstance + } + } }())
Invert the closure used to define the global impromptu instance.
impromptu_impromptu
train
js
0ea2cd6fe9d6b6f6a55d0afb1c7a5040ac65fcac
diff --git a/src/MageTest/PhpSpec/MagentoExtension/Specification/ControllerBehavior.php b/src/MageTest/PhpSpec/MagentoExtension/Specification/ControllerBehavior.php index <HASH>..<HASH> 100644 --- a/src/MageTest/PhpSpec/MagentoExtension/Specification/ControllerBehavior.php +++ b/src/MageTest/PhpSpec/MagentoExtension/Specification/ControllerBehavior.php @@ -24,7 +24,7 @@ namespace MageTest\PhpSpec\MagentoExtension\Specification; use PhpSpec\ObjectBehavior; use Prophecy\Argument; -use Zend_Controller_Request_Abstract as Request; +use Mage_Core_Controller_Request_Http as Request; use Zend_Controller_Response_Abstract as Response; /**
Update request class so specing of controllers can progress
MageTest_MageSpec
train
php
8f3ec27f725800cdfc7a38208854c2a68937fa25
diff --git a/eventsourcing/__init__.py b/eventsourcing/__init__.py index <HASH>..<HASH> 100644 --- a/eventsourcing/__init__.py +++ b/eventsourcing/__init__.py @@ -1 +1 @@ -__version__ = "7.2.3" +__version__ = "7.2.4dev0"
Increased version number to <I>dev0.
johnbywater_eventsourcing
train
py
95b450f0d15ce8bc8854a3dc1927e602336968a7
diff --git a/run_tests.py b/run_tests.py index <HASH>..<HASH> 100755 --- a/run_tests.py +++ b/run_tests.py @@ -3,6 +3,7 @@ import sys import shutil import tempfile +import django from django.conf import settings @@ -54,7 +55,10 @@ def main(): from django.test.utils import get_runner test_runner = get_runner(settings)(verbosity=2, interactive=True) - failures = test_runner.run_tests(['django_extensions', 'django_extensions.tests']) + apps = ['django_extensions'] + if django.VERSION[:2] >= (1,6): + apps.append('django_extensions.tests') + failures = test_runner.run_tests(apps) sys.exit(failures) finally:
fix/workaround for tests to run on all versions of Django.
django-extensions_django-extensions
train
py
ffc962059eb3bb698bfe9fe675382d1a607920ec
diff --git a/lib/router/transition.js b/lib/router/transition.js index <HASH>..<HASH> 100644 --- a/lib/router/transition.js +++ b/lib/router/transition.js @@ -235,7 +235,18 @@ Transition.prototype = { // TODO: add tests for merged state retry()s this.abort(); var newTransition = this.router.transitionByIntent(this.intent, false); - newTransition.method(this.urlMethod); + + // inheriting a `null` urlMethod is not valid + // the urlMethod is only set to `null` when + // the transition is initiated *after* the url + // has been updated (i.e. `router.handleURL`) + // + // in that scenario, the url method cannot be + // inherited for a new transition because then + // the url would not update even though it should + if (this.urlMethod !== null) { + newTransition.method(this.urlMethod); + } return newTransition; },
Fix issue with retrying initial transition. When the initial transition is aborted and subsequently retried, the `urlMethod` of `null` was being inherited. This meant that upon retry, the URL would never be updated.
tildeio_router.js
train
js
37b3d185ff4a8e6aafe9dcada8271a6f1b23fa28
diff --git a/v3/package_test.go b/v3/package_test.go index <HASH>..<HASH> 100644 --- a/v3/package_test.go +++ b/v3/package_test.go @@ -62,7 +62,7 @@ var _ = Describe("package features", func() { session = cf.Cf("curl", fmt.Sprintf("/v3/packages/%s/download", copiedPackageGuid), "--output", app_package_path).Wait(DEFAULT_TIMEOUT) Expect(session).To(Exit(0)) - session = runner.Run("unzip", app_package_path, "-d", tmpdir) + session = runner.Run("unzip", "-l", app_package_path) Expect(session.Wait(DEFAULT_TIMEOUT)).To(Exit(0)) Expect(session.Out).To(Say("dora.rb")) })
package download test justs lists zip contents
cloudfoundry_cf-acceptance-tests
train
go
5cf4916126d809029e8ca794fd414c48763d488f
diff --git a/tests/Library/test_config.inc.php b/tests/Library/test_config.inc.php index <HASH>..<HASH> 100644 --- a/tests/Library/test_config.inc.php +++ b/tests/Library/test_config.inc.php @@ -58,11 +58,9 @@ require_once OX_BASE_PATH . 'core/oxfunctions.php'; // As in new bootstrap to get db instance. $oConfigFile = new OxConfigFile(OX_BASE_PATH . "config.inc.php"); OxRegistry::set("OxConfigFile", $oConfigFile); +oxRegistry::set("oxConfig", new oxConfig()); if ($sTestType == 'acceptance') { - oxRegistry::set("oxConfig", new oxConfig()); oxRegistry::set("oxConfig", oxNew('oxConfig')); -} else { - oxRegistry::set("oxConfig", new oxConfig()); } // As in new bootstrap to get db instance.
ESDEV-<I> Refactor test_config (cherry picked from commit 2e<I>f)
OXID-eSales_oxideshop_ce
train
php
b0e8eeabc3c8dc6a362c02dec3456b0876880503
diff --git a/lib50/_api.py b/lib50/_api.py index <HASH>..<HASH> 100644 --- a/lib50/_api.py +++ b/lib50/_api.py @@ -505,13 +505,11 @@ class Git: git = self.set(command, **format_args) git_command = f"git {' '.join(git._args)}" - git_command = re.sub(' +', ' ', git_command) # Format to show in git info logged_command = git_command for opt in [Git.cache, Git.working_area]: logged_command = logged_command.replace(str(opt), "") - logged_command = re.sub(' +', ' ', logged_command) # Log pretty command in info logger.info(termcolor.colored(logged_command, attrs=["bold"])) diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -23,6 +23,6 @@ setup( python_requires=">= 3.6", packages=["lib50"], url="https://github.com/cs50/lib50", - version="2.0.1", + version="2.0.2", include_package_data=True )
avoid crashing when filenames have > 1 contiguous spaces
cs50_lib50
train
py,py
504fa48c023e6c91a33f36f9d1d0476dd0f19046
diff --git a/core-bundle/src/Resources/contao/forms/Form.php b/core-bundle/src/Resources/contao/forms/Form.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/forms/Form.php +++ b/core-bundle/src/Resources/contao/forms/Form.php @@ -53,14 +53,19 @@ class Form extends \Hybrid */ public function generate() { - $str = parent::generate(); - if (TL_MODE == 'BE') { - $str = preg_replace('/name="[^"]+" ?/i', '', $str); + $objTemplate = new \BackendTemplate('be_wildcard'); + + $objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['CTE']['form'][0]) . ' ###'; + $objTemplate->id = $this->id; + $objTemplate->link = $this->title; + $objTemplate->href = 'contao/main.php?do=form&amp;table=tl_form_field&amp;id=' . $this->id; + + return $objTemplate->parse(); } - return $str; + return parent::generate(); }
[Core] Do not render forms in the back end preview (see #<I>)
contao_contao
train
php
406f90140049faf57c4ea1dd394c6f575b63b580
diff --git a/src/Core/Framework/DataAbstractionLayer/Field/PasswordField.php b/src/Core/Framework/DataAbstractionLayer/Field/PasswordField.php index <HASH>..<HASH> 100644 --- a/src/Core/Framework/DataAbstractionLayer/Field/PasswordField.php +++ b/src/Core/Framework/DataAbstractionLayer/Field/PasswordField.php @@ -21,7 +21,7 @@ class PasswordField extends Field implements StorageAware */ private $hashOptions; - public function __construct(string $storageName, string $propertyName, int $algorithm = PASSWORD_ARGON2I, array $hashOptions = []) + public function __construct(string $storageName, string $propertyName, int $algorithm = PASSWORD_BCRYPT, array $hashOptions = []) { parent::__construct($propertyName); $this->storageName = $storageName;
NTR - Change default password encryption to bcrypt
shopware_platform
train
php
37f41eb2d14aa37e329134cb90ee90abef8d4e42
diff --git a/code/controllers/FoxyCart_Controller.php b/code/controllers/FoxyCart_Controller.php index <HASH>..<HASH> 100644 --- a/code/controllers/FoxyCart_Controller.php +++ b/code/controllers/FoxyCart_Controller.php @@ -189,18 +189,22 @@ class FoxyCart_Controller extends Page_Controller { // associate with this order $ProductOption->OrderID = $transaction->ID; - - // write + + // extend OrderDetail parsing, allowing for custom fields in FoxyCart + $this->extend('handleOrderItem', $decrypted, $product, $ProductOption); + + // write $ProductOption->write(); } } + + } - // allow this to be extended - $this->extend('handleDecryptedFeed',$encrypted, $decrypted); + } public function sso() {
FoxyCart_Controller::handleDataFeed update update $this->extend to extend OrderDetail. allows for recording of custom fields from FoxyCart data feed
dynamic_foxystripe
train
php
6cffc5d452dc20c2c87fd1d994758aba8d3db241
diff --git a/Kwc/Newsletter/EditSubscriber/Component.php b/Kwc/Newsletter/EditSubscriber/Component.php index <HASH>..<HASH> 100644 --- a/Kwc/Newsletter/EditSubscriber/Component.php +++ b/Kwc/Newsletter/EditSubscriber/Component.php @@ -23,7 +23,7 @@ class Kwc_Newsletter_EditSubscriber_Component extends Kwc_Form_Component throw new Kwf_Exception_NotFound(); } $this->_recipient = Kwc_Mail_Redirect_Component::parseRecipientParam($postData['recipient']); - $this->processInput($params); + parent::processInput($postData); } protected function _initForm()
fixed editSubscriber processInput, called parent correctly
koala-framework_koala-framework
train
php
e581f2690ad61a9f74ee14a04ae9746d1a001087
diff --git a/accounts/abi/bind/backends/simulated.go b/accounts/abi/bind/backends/simulated.go index <HASH>..<HASH> 100644 --- a/accounts/abi/bind/backends/simulated.go +++ b/accounts/abi/bind/backends/simulated.go @@ -152,7 +152,7 @@ func (b *SimulatedBackend) EstimateGasLimit(sender common.Address, contract *com vmenv := core.NewEnv(statedb, chainConfig, b.blockchain, msg, block.Header(), vm.Config{}) gaspool := new(core.GasPool).AddGas(common.MaxBig) - _, gas, err := core.ApplyMessage(vmenv, msg, gaspool) + _, gas, _, err := core.NewStateTransition(vmenv, msg, gaspool).TransitionDb() return gas, err }
accounts/abi/bind/backends: estimate needed gas, not used
ethereum_go-ethereum
train
go
3516069756488969657801c82de3d3f89925f2ce
diff --git a/text/boolean.js b/text/boolean.js index <HASH>..<HASH> 100644 --- a/text/boolean.js +++ b/text/boolean.js @@ -17,7 +17,7 @@ BooleanType.set('DOMBox', Db.external(function () { proto.set = function (value) { var label; if (this.dom.firstChild) this.dom.removeChild(this.dom.firstChild); - label = this.ns[value.valueOf() ? '_trueString' : '_falseString']; + label = this.ns[value.valueOf() ? '_trueLabel' : '_falseLabel']; this.dom.appendChild(label.toDOM(this.document)); }; return Box;
Update up to changes in dbjs
medikoo_dbjs-dom
train
js
98ff98e2b3d535f2f9fe70f8778a092a19463442
diff --git a/src/Controller/Controller.php b/src/Controller/Controller.php index <HASH>..<HASH> 100644 --- a/src/Controller/Controller.php +++ b/src/Controller/Controller.php @@ -173,6 +173,24 @@ class Controller implements EventListener { public $viewClass = 'Cake\View\View'; /** + * The path to this controllers view templates. + * Example `Articles` + * + * Set automatically using conventions in Controller::__construct(). + * + * @var string + */ + public $viewPath; + +/** + * The name of the view file to render. The name specified + * is the filename in /app/Template/<SubFolder> without the .ctp extension. + * + * @var string + */ + public $view = null; + +/** * Instance of the View created during rendering. Won't be set until after * Controller::render() is called. * @@ -214,16 +232,6 @@ class Controller implements EventListener { public $methods = array(); /** - * The path to this controllers view templates. - * Example `Articles` - * - * Set automatically using conventions in Controller::__construct(). - * - * @var string - */ - public $viewPath; - -/** * Constructor. * * Sets a number of properties based on conventions if they are empty. To override the
Add missing property to Controller. This property was lost in the shuffle but should exist on Controller, as it is modified by methods like setRequest().
cakephp_cakephp
train
php
ec566f8418350e2e279689e533759813198c7197
diff --git a/test/models/invitable_test.rb b/test/models/invitable_test.rb index <HASH>..<HASH> 100644 --- a/test/models/invitable_test.rb +++ b/test/models/invitable_test.rb @@ -241,6 +241,9 @@ class InvitableTest < ActiveSupport::TestCase user = User.invite!(:email => "valid@email.com") assert_equal user, existing_user assert_equal ['has already been taken'], user.errors[:email] + same_user = User.invite!("email" => "valid@email.com") + assert_equal same_user, existing_user + assert_equal ['has already been taken'], same_user.errors[:email] end test 'should return a record with errors if user with pending invitation was found by e-mail' do
test for issue #<I> - shouldnot allow user with same email to persist
scambra_devise_invitable
train
rb
0557f6493b7df1266bcafbd134e337a0617fe82a
diff --git a/src/main/java/webGrude/elements/Instantiator.java b/src/main/java/webGrude/elements/Instantiator.java index <HASH>..<HASH> 100644 --- a/src/main/java/webGrude/elements/Instantiator.java +++ b/src/main/java/webGrude/elements/Instantiator.java @@ -3,8 +3,6 @@ package webGrude.elements; import java.util.ArrayList; import java.util.List; -import javax.swing.text.html.HTML; - import org.jsoup.nodes.Element; @SuppressWarnings("rawtypes") @@ -14,7 +12,8 @@ public class Instantiator { static { classes = new ArrayList<Class>(); classes.add(String.class); - classes.add(HTML.class); + classes.add(Link.class); + classes.add(Element.class); } public static boolean typeIsKnown(final Class c){ @@ -25,6 +24,8 @@ public class Instantiator { public static <T> T instanceForNode(final Element node, final Class<T> c){ if(c.equals(Element.class)) return (T) node; + if(c.equals(Link.class)) + return (T) new Link<T>(); return (T) node.text(); } }
Adding more type to Instantiator
beothorn_webGrude
train
java
6dd7a57562393a2b90d0b077e3df8fc2aba3fa26
diff --git a/main.js b/main.js index <HASH>..<HASH> 100644 --- a/main.js +++ b/main.js @@ -41,7 +41,7 @@ // // Note to Photoshop engineers: This zstring must be kept in sync with the zstring in // generate.jsx in the Photoshop repo. - MENU_LABEL = "$$$/JavaScripts/Generator/WebAssets/Menu=Web Assets", + MENU_LABEL = "$$$/JavaScripts/Generator/ImageAssets/Menu=Image Assets", DELAY_TO_WAIT_UNTIL_USER_DONE = 300, MAX_SIMULTANEOUS_UPDATES = 50;
Change MENU_LABEL from Web Assets to Image Assets
adobe-photoshop_generator-assets
train
js
8255c4c7b4acda267c5f99d8a31c865a901ec510
diff --git a/src/test/java/com/codeborne/selenide/drivercommands/WebDriverWrapperTest.java b/src/test/java/com/codeborne/selenide/drivercommands/WebDriverWrapperTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/codeborne/selenide/drivercommands/WebDriverWrapperTest.java +++ b/src/test/java/com/codeborne/selenide/drivercommands/WebDriverWrapperTest.java @@ -12,7 +12,7 @@ class WebDriverWrapperTest { @Test void name() { WebDriver webDriver = mock(WebDriver.class); - WebDriverWrapper driver = new WebDriverWrapper(new SelenideConfig(), webDriver); + WebDriverWrapper driver = new WebDriverWrapper(new SelenideConfig(), webDriver, null); driver.close();
#<I> fix error after merging
selenide_selenide
train
java
082eff64f70192cd0f98c8b20012c0524d89294c
diff --git a/source/Core/exception/oxlanguageexception.php b/source/Core/exception/oxlanguageexception.php index <HASH>..<HASH> 100644 --- a/source/Core/exception/oxlanguageexception.php +++ b/source/Core/exception/oxlanguageexception.php @@ -22,6 +22,8 @@ /** * Exception class for a non existing language local + * + * @deprecated since 5.2.8 (2016.02.05); Will be removed as not used in code. */ class oxLanguageException extends oxException { diff --git a/source/Core/oxlang.php b/source/Core/oxlang.php index <HASH>..<HASH> 100644 --- a/source/Core/oxlang.php +++ b/source/Core/oxlang.php @@ -421,8 +421,6 @@ class oxLang extends oxSuperCfg * @param int $iLang optional language number * @param bool $blAdminMode on special case you can force mode, to load language constant from admin/shops language file * - * @throws oxLanguageException in debug mode - * * @return string */ public function translateString($sStringToTranslate, $iLang = null, $blAdminMode = null)
Remove misleading method description about oxLanguageException. Deprecate oxLanguageException class oxLanguageException is not thrown in code.
OXID-eSales_oxideshop_ce
train
php,php
128de528b8734641dd8e940c2f1640121256eb82
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -77,7 +77,6 @@ setup( py_modules=['enaml_native_barcode'], data_files=find_data_files("enaml-native-barcode", ['android', 'ios', 'src']), install_requires=['enaml-native-cli'], - classifiers=["Framework :: enaml-native"], entry_points={ #: Add any other recipes here 'p4a_recipe': [
I guess I can't create my own classifier
codelv_enaml-native-barcode
train
py
dcdee0fae4f5c6eb3b8038f135becfd7b3aa5810
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/connection.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/connection.js index <HASH>..<HASH> 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/connection.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/connection.js @@ -222,21 +222,19 @@ class Connection extends EventEmitter { } _getDefaultReader(mimeType) { - if (mimeType === graphBinaryMimeType) + if (mimeType === graphBinaryMimeType) { return graphBinaryReader; + } - return mimeType === graphSON2MimeType - ? new serializer.GraphSON2Reader() - : new serializer.GraphSONReader(); + return mimeType === graphSON2MimeType ? new serializer.GraphSON2Reader() : new serializer.GraphSONReader(); } _getDefaultWriter(mimeType) { - if (mimeType === graphBinaryMimeType) + if (mimeType === graphBinaryMimeType) { return graphBinaryWriter; + } - return mimeType === graphSON2MimeType - ? new serializer.GraphSON2Writer() - : new serializer.GraphSONWriter(); + return mimeType === graphSON2MimeType ? new serializer.GraphSON2Writer() : new serializer.GraphSONWriter(); } _pingHeartbeat() {
lib/driver/connection.js: fix eslint errors
apache_tinkerpop
train
js
2c52571cea1e184acf541d1a3e3341a9e3edb388
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -36,7 +36,7 @@ extensions = [ 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.coverage', - 'sphinx.ext.pngmath', + 'sphinx.ext.imgmath', 'sphinx.ext.viewcode', # 'sphinx.ext.napoleon', # 'numpy_ext.numpydoc'
pngmath to imgmath to meet new sphinx packages
scikit-learn-contrib_hdbscan
train
py
4fb5ab336e48bad960111e5b1d610b9bc351f93c
diff --git a/salt/utils/find.py b/salt/utils/find.py index <HASH>..<HASH> 100644 --- a/salt/utils/find.py +++ b/salt/utils/find.py @@ -74,7 +74,7 @@ the following: group: group name md5: MD5 digest of file contents - mode: file permissions (as integer) + mode: file permissions (as as octal string) mtime: last modification time (as time_t) name: file basename path: file absolute path @@ -453,7 +453,7 @@ class PrintOption(Option): one or more of the following: group = group name md5 = MD5 digest of file contents - mode = file mode (as integer) + mode = file mode (as octal string) mtime = last modification time (as time_t) name = file basename path = file absolute path @@ -489,7 +489,7 @@ class PrintOption(Option): _FILE_TYPES.get(stat.S_IFMT(fstat[stat.ST_MODE]), '?') ) elif arg == 'mode': - result.append(fstat[stat.ST_MODE]) + result.append(oct(fstat[stat.ST_MODE])[-3:]) elif arg == 'mtime': result.append(fstat[stat.ST_MTIME]) elif arg == 'user':
print option mode presented in human readable value
saltstack_salt
train
py
0c777bace2aed1833e068358461de62bbd59cd0c
diff --git a/actionpack/lib/action_dispatch/routing/route.rb b/actionpack/lib/action_dispatch/routing/route.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_dispatch/routing/route.rb +++ b/actionpack/lib/action_dispatch/routing/route.rb @@ -1,3 +1,5 @@ +require 'active_support/core_ext/module/deprecation' + module ActionDispatch module Routing class Route #:nodoc: @@ -45,6 +47,7 @@ module ActionDispatch def to_a [@app, @conditions, @defaults, @name] end + deprecate :to_a def to_s @to_s ||= begin diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -333,7 +333,7 @@ module ActionDispatch def add_route(app, conditions = {}, requirements = {}, defaults = {}, name = nil, anchor = true) raise ArgumentError, "Invalid route name: '#{name}'" unless name.blank? || name.to_s.match(/^[_a-z]\w*$/i) route = Route.new(self, app, conditions, requirements, defaults, name, anchor) - @set.add_route(*route) + @set.add_route(route.app, route.conditions, route.defaults, route.name) named_routes[name] = route if name routes << route route
stop being clever and just call methods on the Route object
rails_rails
train
rb,rb
fac0a9da6d7357b73d5ca0da4cf7cdc399b23151
diff --git a/test/rules-special-test.js b/test/rules-special-test.js index <HASH>..<HASH> 100644 --- a/test/rules-special-test.js +++ b/test/rules-special-test.js @@ -26,6 +26,23 @@ describe('Tokenizer Special Rules', function () { }) }) + describe('single function is a successful rule', function () { + var p = new Tokenizer(options) + + it('should return 0 match', function (done) { + p.continue(0) + p.addRule(1, 'consume') + p.continue() + p.addRule(function () {}) + p.addRule(function () { + assert(false) + }) + p.write('abc') + + done() + }) + }) + describe('single function and single rule', function () { var p = new Tokenizer(options) var i = 0
Added test for no subrule rule
pierrec_node-atok
train
js
a684a8a880b1c048ec8b37e03650ff2c84c6c9de
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -101,7 +101,7 @@ def find_package_data( setup( name='django-simplestatic', - version='0.0.1', + version='0.0.2', url='https://github.com/ericflo/django-simplestatic', license='MIT', description='A highly opinionated drop-in library for static file management in Django',
Fix the distribution to actually include the .jar file
ericflo_django-simplestatic
train
py
37046c3ce1802023065428c59e7132ca5a64a453
diff --git a/src/Parser.php b/src/Parser.php index <HASH>..<HASH> 100644 --- a/src/Parser.php +++ b/src/Parser.php @@ -921,7 +921,7 @@ class Parser { private function blockAhead($blockBeginColumn) { $quoteLevel=0; if($this->getToken(1)->kind == TokenManager::EOL) { - $t; + $t=null; $i = 2; $quoteLevel=0; do {
fix $t for hhvm
koara_koara-php
train
php
5349c00e750f3f3980aa48f38858912423e3aa39
diff --git a/src/VCR/VCRException.php b/src/VCR/VCRException.php index <HASH>..<HASH> 100644 --- a/src/VCR/VCRException.php +++ b/src/VCR/VCRException.php @@ -2,7 +2,14 @@ namespace VCR; -class VCRException extends \InvalidArgumentException +use Assert\InvalidArgumentException; + +class VCRException extends InvalidArgumentException { const LIBRARY_HOOK_DISABLED = 500; + + public function __construct($message, $code, $propertyPath = null, $value = null, array $constraints = array()) + { + parent::__construct($message, $code, $propertyPath, $value, $constraints); + } }
Fixed: The new Assert library uses a different signature for exceptions.
php-vcr_php-vcr
train
php
152603b9e43e25f3cab7ec76c97c8b635562b97b
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -63,3 +63,8 @@ PostgresQuery.prototype.handleRowDescription = function (message) { QueryStream.prototype.handleRowDescription.call(this, message) this.emit('fields', message.fields) } + +PostgresQuery.prototype.handleReadyForQuery = function () { + this.emit('close') + QueryStream.prototype.handleReadyForQuery.call(this) +}
emit 'close' event when query is completed
grncdr_node-any-db
train
js
35de7e892031410d4894e7e2378f9ebe0a38349e
diff --git a/db/migrate/20170222131211_change_pool_columns_to_dates.rb b/db/migrate/20170222131211_change_pool_columns_to_dates.rb index <HASH>..<HASH> 100644 --- a/db/migrate/20170222131211_change_pool_columns_to_dates.rb +++ b/db/migrate/20170222131211_change_pool_columns_to_dates.rb @@ -1,6 +1,6 @@ class ChangePoolColumnsToDates < ActiveRecord::Migration def up - if connection.adapter_name.downcase != 'sqlite3' + unless connection.adapter_name.downcase.include?('sqlite') change_column(:katello_pools, :start_date, 'timestamp USING CAST(start_date AS timestamp without time zone)') change_column(:katello_pools, :end_date, 'timestamp USING CAST(end_date AS timestamp without time zone)') end @@ -9,7 +9,7 @@ class ChangePoolColumnsToDates < ActiveRecord::Migration end def down - if connection.adapter_name.downcase != 'sqlite3' + unless connection.adapter_name.downcase.include?('sqlite') change_column(:katello_pools, :start_date, :string, :limit => 255) change_column(:katello_pools, :end_date, :string, :limit => 255) end
Refs #<I> - Check if adapter includes sqlite Turns out the adapter is SQlite which downcases to sqlite and does not match the name of the adapter that one would specify in the database.yml. This switches to check for include to match sqlite in case Rails for some reason changes this name.
Katello_katello
train
rb
5526ddb5110849507185baae7988be0dc53f66e2
diff --git a/__pkginfo__.py b/__pkginfo__.py index <HASH>..<HASH> 100644 --- a/__pkginfo__.py +++ b/__pkginfo__.py @@ -27,7 +27,7 @@ classifiers = ['Development Status :: 5 - Production/Stable', author = "Rocky Bernstein" author_email = "rocky@gnu.org" ftp_url = None -license = 'PSF2' +license = 'MIT' mailing_list = None modname = 'columnize'
Update __pkginfo__.py Changte license from PSF2 to MIT.
rocky_pycolumnize
train
py
4b2e97e235e7d4ba8c578e26cf4ad989e663fb66
diff --git a/PhoneGapLib/javascripts/core/notification.js b/PhoneGapLib/javascripts/core/notification.js index <HASH>..<HASH> 100644 --- a/PhoneGapLib/javascripts/core/notification.js +++ b/PhoneGapLib/javascripts/core/notification.js @@ -51,16 +51,6 @@ Notification.prototype.activityStop = function() { PhoneGap.exec(null, null, "Notification", "activityStop", []); }; -// iPhone only -Notification.prototype.loadingStart = function(options) { - console.warn("Notification.loadingStart is deprecated and will be removed in 1.0. It will be moved to the plugins repo."); - PhoneGap.exec(null, null, "Notification","loadingStart", [options]); -}; -// iPhone only -Notification.prototype.loadingStop = function() { - console.warn("Notification.loadingStop is deprecated and will be removed in 1.0. It will be moved to the plugins repo."); - PhoneGap.exec(null, null, "Notification","loadingStop", []); -}; /** * Causes the device to blink a status LED. * @param {Integer} count The number of blinks.
Removed JavaScript interface for #<I>
apache_cordova-ios
train
js
0cb6768113c8adf01692b9e154231e48b7d0f752
diff --git a/ca/django_ca/admin.py b/ca/django_ca/admin.py index <HASH>..<HASH> 100644 --- a/ca/django_ca/admin.py +++ b/ca/django_ca/admin.py @@ -110,6 +110,10 @@ class CertificateMixin(object): actions.pop('delete_selected', '') return actions + def hpkp_pin(self, obj): + return obj.hpkp_pin + hpkp_pin.short_description = _('HPKP pin') + def cn_display(self, obj): if obj.cn: return obj.cn
fix short-description for hpkp pin
mathiasertl_django-ca
train
py
5d12af767c7f3184e7b29dce0a7e5d9e7b90d4ee
diff --git a/gtk/gtk_since_3_12.go b/gtk/gtk_since_3_12.go index <HASH>..<HASH> 100644 --- a/gtk/gtk_since_3_12.go +++ b/gtk/gtk_since_3_12.go @@ -449,11 +449,11 @@ func (v *Popover) SetPointingTo(rect gdk.Rectangle) { } // GetPointingTo is a wrapper around gtk_popover_get_pointing_to(). -func (v *Popover) GetPointingTo(rect *gdk.Rectangle) bool { - var crect C.GdkRectangle - isSet := C.gtk_popover_get_pointing_to(v.native(), &crect) - *rect = *gdk.WrapRectangle(uintptr(unsafe.Pointer(&crect))) - return gobool(isSet) +func (v *Popover) GetPointingTo() (*gdk.Rectangle, bool) { + var cRect *C.GdkRectangle + isSet := C.gtk_popover_get_pointing_to(v.native(), cRect) + rect := gdk.WrapRectangle(uintptr(unsafe.Pointer(cRect))) + return rect, gobool(isSet) } // SetPosition is a wrapper around gtk_popover_set_position().
adjust GetPointingTo() to conform to golang coding conventions
gotk3_gotk3
train
go
080f1ec8d4efa775a3f86119c9f15baec9b138c7
diff --git a/packages/article/article-body/article-body.web.js b/packages/article/article-body/article-body.web.js index <HASH>..<HASH> 100644 --- a/packages/article/article-body/article-body.web.js +++ b/packages/article/article-body/article-body.web.js @@ -4,12 +4,12 @@ import ArticleRow from "./article-body-row"; const ArticleBody = props => { const { section, content: bodyContent, contextUrl } = props; - const contentArray = bodyContent.map((data, index) => { + const contentArray = bodyContent.map((rowData, index) => { const item = { - data, + data: Object.assign({}, rowData), index }; - if (data.name === "ad") { + if (rowData.name === "ad") { item.data.attributes = { ...item.data.attributes, ...{ section, contextUrl }
fix: use mutable object as apollo uses immutables (#<I>)
newsuk_times-components
train
js
f07db9a0167baeade74849c6235ce64fd05a46dd
diff --git a/gffutils/create.py b/gffutils/create.py index <HASH>..<HASH> 100644 --- a/gffutils/create.py +++ b/gffutils/create.py @@ -473,6 +473,11 @@ class _DBCreator(object): c.execute('DROP INDEX IF EXISTS featuretype') c.execute('CREATE INDEX featuretype ON features (featuretype)') + # speeds computation 1000x in some cases + logger.info("Running ANALYSE features") + c.execute('ANALYZE features') + + self.conn.commit() self.warnings = self.iterator.warnings
Added running 'analyze features' on created table This apperas to speed computation sugnifficantly in some cases.
daler_gffutils
train
py
32a7e7e63ac1fa8da057b07f21722985d4397cd5
diff --git a/app/readers/fasta.py b/app/readers/fasta.py index <HASH>..<HASH> 100644 --- a/app/readers/fasta.py +++ b/app/readers/fasta.py @@ -16,8 +16,7 @@ def get_protein_acc_iter(fastafn): def parse_protein_identifier(record): - ## FIXME now parsing uniprot only... - return record.id.split('|')[1] + return record.id def get_sequence_iter(fastafn):
MSGF apparently outputs full fasta IDs, not only accession numbers
glormph_msstitch
train
py
9e74a3be0c4aba26cde1c6b9e438781b8609d73c
diff --git a/src/test/java/com/algolia/search/saas/SimpleTest.java b/src/test/java/com/algolia/search/saas/SimpleTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/algolia/search/saas/SimpleTest.java +++ b/src/test/java/com/algolia/search/saas/SimpleTest.java @@ -239,7 +239,7 @@ public class SimpleTest { JSONObject res = client.listIndexes(); assertTrue(contains(res.getJSONArray("items"), indexName, "name")); client.deleteIndex(indexName); - Thread.sleep(2000); + Thread.sleep(4000); JSONObject resAfter = client.listIndexes(); assertFalse(contains(resAfter.getJSONArray("items"), indexName, "name")); }
Increase waiting time of test<I>
algolia_algoliasearch-client-android
train
java
94b50d0f607bcde3857b66166af9d60a96d0c4e2
diff --git a/pkg/proc/native/proc_linux.go b/pkg/proc/native/proc_linux.go index <HASH>..<HASH> 100644 --- a/pkg/proc/native/proc_linux.go +++ b/pkg/proc/native/proc_linux.go @@ -370,9 +370,14 @@ func (dbp *Process) wait(pid, options int) (int, *sys.WaitStatus, error) { func (dbp *Process) setCurrentBreakpoints(trapthread *Thread) error { for _, th := range dbp.threads { if th.CurrentBreakpoint == nil { - err := th.SetCurrentBreakpoint() - if err != nil { - return err + if err := th.SetCurrentBreakpoint(); err != nil { + if err == sys.ESRCH { + // This thread quit between the point where we received the breakpoint and + // the stop signal. + delete(dbp.threads, th.ID) + } else { + return err + } } } }
proc/native/linux: tolerate ESRCH error in setCurrentBreakpoints A thread could terminate between the point when we stop for a breakpoint and the point where we send a stop signal to all threads, if this happens setCurrentBreakpoints will fail with an error. We should tolerate this. For some reason this happens very frequently when running delve on processes with the race detector enabed.
go-delve_delve
train
go
6490438ac22f4c2aaf50606148464029f6a632c1
diff --git a/domt.js b/domt.js index <HASH>..<HASH> 100644 --- a/domt.js +++ b/domt.js @@ -214,7 +214,7 @@ Template.prototype.init = function(node) { // and also doesn't preload images. Might run scripts, though. fragment = doc = document.createDocumentFragment(); } - var tagName = match(/^\s*<(\w+)[\s>]/i, html); + var tagName = match(/^\s*<\s*([^\s>]+)[\s>]/i, html); var wrapperTag = 'div'; if (tagName) { tagName = tagName.toLowerCase();
Support any tag name - typically with a dash in it
kapouer_domt
train
js
d3689a7144781fccb8062989e117ad5b219e444e
diff --git a/src/class-extended-taxonomy.php b/src/class-extended-taxonomy.php index <HASH>..<HASH> 100644 --- a/src/class-extended-taxonomy.php +++ b/src/class-extended-taxonomy.php @@ -130,6 +130,7 @@ class Extended_Taxonomy { 'items_list_navigation' => sprintf( '%s list navigation', $this->tax_plural ), 'items_list' => sprintf( '%s list', $this->tax_plural ), 'most_used' => 'Most Used', + 'back_to_items' => sprintf( '&larr; Back to %s', $this->tax_plural ), 'no_item' => sprintf( 'No %s', $this->tax_singular_low ), # Custom label );
Add support for the `back_to_items` taxonomy label.
johnbillion_extended-cpts
train
php
bb6ea85a41ffc166001180ab884e1f6faf6eaadc
diff --git a/lib/meta_inspector/version.rb b/lib/meta_inspector/version.rb index <HASH>..<HASH> 100644 --- a/lib/meta_inspector/version.rb +++ b/lib/meta_inspector/version.rb @@ -1,3 +1,3 @@ module MetaInspector - VERSION = '4.7.2' + VERSION = '5.0.0.rc1' end
start development of MetaInspector <I>
jaimeiniesta_metainspector
train
rb
ef495160767d5ce02a8723a5cdd988f5ce87b132
diff --git a/src/Sparkline.php b/src/Sparkline.php index <HASH>..<HASH> 100644 --- a/src/Sparkline.php +++ b/src/Sparkline.php @@ -341,6 +341,21 @@ class Sparkline } imagepng($this->file, $savePath); } + + /** + * @return string + */ + public function toBase64() + { + if (!$this->file) { + $this->generate(); + } + ob_start(); + imagepng($this->file); + $buffer = ob_get_clean(); + ob_end_clean(); + return base64_encode($buffer); + } public function destroy() { @@ -380,4 +395,4 @@ class Sparkline return preg_match('/^#?+[0-9a-f]{3}(?:[0-9a-f]{3})?$/i', $color); } -} \ No newline at end of file +}
Create method to return base<I>
davaxi_Sparkline
train
php
e8df759f211a0bda4c34e6a9af8c0ab168991d2c
diff --git a/src/Symfony/Component/HttpKernel/KernelInterface.php b/src/Symfony/Component/HttpKernel/KernelInterface.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpKernel/KernelInterface.php +++ b/src/Symfony/Component/HttpKernel/KernelInterface.php @@ -18,7 +18,7 @@ use Symfony\Component\Config\Loader\LoaderInterface; /** * The Kernel is the heart of the Symfony system. * - * It manages an environment made of bundles. + * It manages an environment made of application kernel and bundles. * * @author Fabien Potencier <fabien@symfony.com> */ @@ -67,7 +67,7 @@ interface KernelInterface extends HttpKernelInterface, \Serializable public function getBundle($name); /** - * Returns the file path for a given resource. + * Returns the file path for a given bundle resource. * * A Resource can be a file or a directory. *
Make KernelInterface docblock more fit for bundle-less environment
symfony_symfony
train
php
8b53aa01a487c5d1cc5ec2bc5dc7f013e9c54ccf
diff --git a/Lib/ufo2ft/postProcessor.py b/Lib/ufo2ft/postProcessor.py index <HASH>..<HASH> 100644 --- a/Lib/ufo2ft/postProcessor.py +++ b/Lib/ufo2ft/postProcessor.py @@ -88,6 +88,10 @@ class PostProcessor(object): seen = {} rename_map = {} for name in self.otf.getGlyphOrder(): + # Ignore glyphs that aren't in the source, as they are usually generated + # and we lack information about them. + if name not in self.glyphSet: + continue prod_name = self._build_production_name(self.glyphSet[name]) # strip invalid characters not allowed in postscript glyph names
Ignore glyph names not in source when building production names
googlefonts_ufo2ft
train
py
eaebe2025796d12541c659348155a0c034e0126a
diff --git a/lib/active_remote/attributes.rb b/lib/active_remote/attributes.rb index <HASH>..<HASH> 100644 --- a/lib/active_remote/attributes.rb +++ b/lib/active_remote/attributes.rb @@ -4,7 +4,6 @@ module ActiveRemote include ::ActiveModel::AttributeMethods included do - attribute_method_suffix "" if attribute_method_matchers.none? { |matcher| matcher.prefix == "" && matcher.suffix == "" } attribute_method_suffix "=" end
Remove patch for old version of rails
liveh2o_active_remote
train
rb
3f81ff8463df931d8f1c2574610b62660c06a01d
diff --git a/allocate.go b/allocate.go index <HASH>..<HASH> 100644 --- a/allocate.go +++ b/allocate.go @@ -473,11 +473,13 @@ func Headless(a *ExecAllocator) { // DisableGPU is the command line option to disable the GPU process. // -// The --disable-gpu option is a temporary work around for a few bugs -// in headless mode. But now it's not longer required. References: +// The --disable-gpu option is a temporary workaround for a few bugs +// in headless mode. According to the references below, it's no longer required: // - https://bugs.chromium.org/p/chromium/issues/detail?id=737678 // - https://github.com/puppeteer/puppeteer/pull/2908 // - https://github.com/puppeteer/puppeteer/pull/4523 +// But according to this reported issue, it's still required in some cases: +// - https://github.com/chromedp/chromedp/issues/904 func DisableGPU(a *ExecAllocator) { Flag("disable-gpu", true)(a) }
mention that --disable-gpu is still required in some cases
chromedp_chromedp
train
go
4263e51090473ae2ed7959910a9a5f591fc6fff5
diff --git a/tests/TestCase/Model/Behavior/EncryptedFieldsBehaviorTest.php b/tests/TestCase/Model/Behavior/EncryptedFieldsBehaviorTest.php index <HASH>..<HASH> 100644 --- a/tests/TestCase/Model/Behavior/EncryptedFieldsBehaviorTest.php +++ b/tests/TestCase/Model/Behavior/EncryptedFieldsBehaviorTest.php @@ -22,7 +22,7 @@ class EncryptedFieldsBehaviorTest extends TestCase * @var array */ public $fixtures = [ - 'plugin.qobo/utils.users', + 'plugin.Qobo/Utils.Users', ]; /** diff --git a/tests/TestCase/UtilityTest.php b/tests/TestCase/UtilityTest.php index <HASH>..<HASH> 100644 --- a/tests/TestCase/UtilityTest.php +++ b/tests/TestCase/UtilityTest.php @@ -10,7 +10,7 @@ use Webmozart\Assert\Assert; class UtilityTest extends TestCase { public $fixtures = [ - 'plugin.CakeDC/Users.users' + 'plugin.CakeDC/Users.Users' ]; /**
Fix Fixture name (task #<I>)
QoboLtd_cakephp-utils
train
php,php
94d5a10b9c79928178e9b0c67fc15fd88b0ea55e
diff --git a/src/diamond/collector.py b/src/diamond/collector.py index <HASH>..<HASH> 100644 --- a/src/diamond/collector.py +++ b/src/diamond/collector.py @@ -140,7 +140,7 @@ class Collector(object): old = self.last_values[path] # Check for rollover if new < old: - old = old + max_value + old = old - max_value # Get Change in X (value) dy = new - old # Get Change in Y (time)
Fixed issue that would create incorrect or negative metrics while using the derivative function if a counter rolled over
python-diamond_Diamond
train
py
8c8826279eaafad24c3f7b865fcc1f3d9af7f630
diff --git a/resources/s3-buckets.go b/resources/s3-buckets.go index <HASH>..<HASH> 100644 --- a/resources/s3-buckets.go +++ b/resources/s3-buckets.go @@ -140,7 +140,8 @@ func (e *S3Bucket) RemoveAllObjects() error { func (e *S3Bucket) Properties() types.Properties { properties := types.NewProperties() - properties.Set("Name", e.name) + properties.Set("Name", e.name). + properties.Set("CreationDate", e.CreationDate) for _, tag := range e.tags { properties.SetTag(tag.Key, tag.Value) diff --git a/resources/s3-objects.go b/resources/s3-objects.go index <HASH>..<HASH> 100644 --- a/resources/s3-objects.go +++ b/resources/s3-objects.go @@ -102,7 +102,8 @@ func (e *S3Object) Properties() types.Properties { Set("Bucket", e.bucket). Set("Key", e.key). Set("VersionID", e.versionID). - Set("IsLatest", e.latest) + Set("IsLatest", e.latest). + Set("CreationDate", e.CreationDate) } func (e *S3Object) String() string {
Feature <I> S3 CreationDate property (#<I>) * Add CreationDate property Add CreationDate to properties so that S3 can be filtered based on when the resource was created. * correct syntax add . to the end of previous line to follow existing syntax. * correct syntax remove unnecessary brackets
rebuy-de_aws-nuke
train
go,go
70d7d73931d9d020f4980d106a25526821833aaf
diff --git a/src/test/java/org/jongo/FindOneTest.java b/src/test/java/org/jongo/FindOneTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/jongo/FindOneTest.java +++ b/src/test/java/org/jongo/FindOneTest.java @@ -84,6 +84,20 @@ public class FindOneTest extends JongoTestCase { @Test public void canFindOneWithOid() throws Exception { /* given */ + ObjectId id = ObjectId.get(); + Friend john = new Friend(id, "John"); + collection.save(john); + + Friend foundFriend = collection.findOne("{_id:#}", id).as(Friend.class); + + /* then */ + assertThat(foundFriend).isNotNull(); + assertThat(foundFriend.getId()).isEqualTo(id); + } + + @Test + public void canFindOneWithOidAsString() throws Exception { + /* given */ ObjectId id = new ObjectId(); Friend john = new Friend(id, "John"); collection.save(john);
Add findOne by id test
bguerout_jongo
train
java
eada576e864d8b37b7ccf43b885ac138754253fd
diff --git a/posix.go b/posix.go index <HASH>..<HASH> 100644 --- a/posix.go +++ b/posix.go @@ -1,3 +1,8 @@ //+build !windows -package acl \ No newline at end of file +package acl + +import "os" + +// Chmod is os.Chmod. +var Chmod = os.Chmod
Added Chmod as alias for os.Chmod on non-Windows
hectane_go-acl
train
go
803a9e11b719dea0e1c7a1179313a258efae7f55
diff --git a/core/server/services/themes/validate.js b/core/server/services/themes/validate.js index <HASH>..<HASH> 100644 --- a/core/server/services/themes/validate.js +++ b/core/server/services/themes/validate.js @@ -6,7 +6,7 @@ const tpl = require('@tryghost/tpl'); const errors = require('@tryghost/errors'); const messages = { - themeHasErrors: 'Theme {name} is not compatible or contains errors.', + themeHasErrors: 'Theme {theme} is not compatible or contains errors.', activeThemeHasFatalErrors: 'The currently active theme "{theme}" has fatal errors.', activeThemeHasErrors: 'The currently active theme "{theme}" has errors, but will still work.' };
:bug: fixed `name is not defined` error when uploading invalid theme
TryGhost_Ghost
train
js
fc8d7dda7ff13ae08ff181ff7b4b050e6dbed31d
diff --git a/test/space/space_utils_test.py b/test/space/space_utils_test.py index <HASH>..<HASH> 100644 --- a/test/space/space_utils_test.py +++ b/test/space/space_utils_test.py @@ -21,6 +21,7 @@ from __future__ import print_function, division, absolute_import from future import standard_library standard_library.install_aliases() +from past.builtins import basestring # External module imports import pytest @@ -77,12 +78,12 @@ def test_vector_numpy(): inp = ['a', 'b', 'c'] x = vector(inp) assert isinstance(x, odl.NtuplesVector) - assert np.issubdtype(x.dtype, 'S') + assert np.issubdtype(x.dtype, basestring) assert all_equal(x, inp) x = vector([1, 2, 'inf']) # Becomes string type assert isinstance(x, odl.NtuplesVector) - assert np.issubdtype(x.dtype, 'S') + assert np.issubdtype(x.dtype, basestring) assert all_equal(x, ['1', '2', 'inf']) # Input not one-dimensional
BUG: fixed python 3 string/unicode in vector test
odlgroup_odl
train
py
047cef58c1765f1a2d4f65343e1c2bfe438fba2f
diff --git a/master/buildbot/steps/source.py b/master/buildbot/steps/source.py index <HASH>..<HASH> 100644 --- a/master/buildbot/steps/source.py +++ b/master/buildbot/steps/source.py @@ -635,13 +635,18 @@ class SVN(Source): if self.svnurl: return self.computeRepositoryURL(self.svnurl) else: + if branch is None: + m = ("The SVN source step belonging to builder '%s' does not know " + "which branch to work with. This means that the change source " + "did not specify a branch and that defaultBranch is None." \ + % self.build.builder.name) + raise RuntimeError(m) + computed = self.computeRepositoryURL(self.baseURL) if self.branch_placeholder in self.baseURL: return computed.replace(self.branch_placeholder, branch) else: - # Throwing a TypeError here is probably better than checking - # out everything under baseURL return computed + branch def startVC(self, branch, revision, patch):
Raise a RuntimeError when the branch from the SourceStamp and defaultBranch are both None.
buildbot_buildbot
train
py
2dbecc28cc73ec1bc18e3ecb678bc3b003b8a1dc
diff --git a/plaso/cli/extraction_tool.py b/plaso/cli/extraction_tool.py index <HASH>..<HASH> 100644 --- a/plaso/cli/extraction_tool.py +++ b/plaso/cli/extraction_tool.py @@ -89,7 +89,7 @@ class ExtractionTool( be expanded or if an invalid parser or plugin name is specified. """ parser_filter_expression = self._parser_filter_expression - if parser_filter_expression: + if not parser_filter_expression: operating_system_family = knowledge_base.GetValue('operating_system') operating_system_product = knowledge_base.GetValue( 'operating_system_product')
Fixed manual parser selection being ignored #<I> (#<I>)
log2timeline_plaso
train
py
e867735a7ccbb579aecdd841b3dcf0e0ce6e792a
diff --git a/src/GeneratorAggregateHack.php b/src/GeneratorAggregateHack.php index <HASH>..<HASH> 100644 --- a/src/GeneratorAggregateHack.php +++ b/src/GeneratorAggregateHack.php @@ -3,19 +3,18 @@ namespace JLSalinas\RWGen; trait GeneratorAggregateHack { + protected $generator = null; public function send($value) { - static $generator = null; - - if ($generator === null) { + if ($this->generator === null) { if ($value === null) { return; } - $generator = $this->getGenerator(); + $this->generator = $this->getGenerator(); } - $generator->send($value); + $this->generator->send($value); if ($value === null) { - $generator = null; + $this->generator = null; } }
Fix static generator causing only one output at a time
jotaelesalinas_php-rwgen
train
php
173c7283617630f29204a2c39671cd72da192411
diff --git a/pandas/tseries/period.py b/pandas/tseries/period.py index <HASH>..<HASH> 100644 --- a/pandas/tseries/period.py +++ b/pandas/tseries/period.py @@ -509,7 +509,7 @@ class PeriodIndex(Int64Index): data = np.array(data, dtype='O') if freq is None and len(data) > 0: - freq = getattr(data[0], 'freq') + freq = getattr(data[0], 'freq', None) if freq is None: raise ValueError(('freq not specified and cannot be inferred '
BUG: default value for freq should be None
pandas-dev_pandas
train
py
ee094608ccffc408eb18e3096294e648adf1b1bb
diff --git a/lib/active_admin/views/show_page.rb b/lib/active_admin/views/show_page.rb index <HASH>..<HASH> 100644 --- a/lib/active_admin/views/show_page.rb +++ b/lib/active_admin/views/show_page.rb @@ -44,9 +44,17 @@ module ActiveAdmin "#{active_admin_config.resource_name} ##{resource.id}" end - def default_main_content - attributes_table *show_view_columns + module DefaultMainContent + def default_main_content + attributes_table *default_attribute_table_rows + end + + def default_attribute_table_rows + resource.class.columns.collect{|column| column.name.to_sym } + end end + + include DefaultMainContent end end end
Moved ShowPage#default_main_content to a module that is included This allows us to include more modules which will set default content on the show screen for resources.
activeadmin_activeadmin
train
rb
79ff6b4628d5ff05a6e5196bb8a0c5b7c701e0af
diff --git a/tests/unit/components/sl-translate-test.js b/tests/unit/components/sl-translate-test.js index <HASH>..<HASH> 100644 --- a/tests/unit/components/sl-translate-test.js +++ b/tests/unit/components/sl-translate-test.js @@ -45,21 +45,6 @@ test( 'Renders as a span tag with no classes', function( assert ) { ); }); -/** - * That it renders and functions as expected - */ -test( 'DOM and content of rendered translation', function( assert ) { - this.subject({ - key: 'the_key', - translateService - }); - - assert.equal( - Ember.$.trim( this.$().text() ), - 'TRANSLATE: the_key' - ); -}); - test( 'On initialization, extractParameterKeys() filters passed parameters', function( assert ) { const component = this.subject({ key: 'the_key',
removed the DOM and content of rendered translation test since it is covered in the integration test.
softlayer_sl-ember-translate
train
js
ee1e97b5a38bb30607dd24b22041f463a850d6fd
diff --git a/lib/blanket.js b/lib/blanket.js index <HASH>..<HASH> 100644 --- a/lib/blanket.js +++ b/lib/blanket.js @@ -59,7 +59,7 @@ var parseAndModify = (typeof exports === 'undefined' ? window.falafel : require( }, _trackingArraySetup: [], _prepareSource: function(source){ - return source.replace(/'/g,"\\'").replace(/(\r\n|\n|\r)/gm,"\n").split('\n'); + return source.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/(\r\n|\n|\r)/gm,"\n").split('\n'); }, _trackingSetup: function(filename,sourceArray){
Existing escape slashes need to be escaped change \ to \\ in source.
alex-seville_blanket
train
js
e27978d7ffebfdbd6cd286d55c50f46ec8a2a31a
diff --git a/spyder/utils/ipython/spyder_kernel.py b/spyder/utils/ipython/spyder_kernel.py index <HASH>..<HASH> 100644 --- a/spyder/utils/ipython/spyder_kernel.py +++ b/spyder/utils/ipython/spyder_kernel.py @@ -22,7 +22,7 @@ PY2 = sys.version[0] == '2' # Check if we are running under an external interpreter # We add "spyder" to sys.path for external interpreters, # so relative imports work! -IS_EXT_INTERPRETER = os.environ.get('EXTERNAL_INTERPRETER', '').lower() == "true" +IS_EXT_INTERPRETER = os.environ.get('SPY_EXTERNAL_INTERPRETER') == "True" # Excluded variables from the Variable Explorer (i.e. they are not # shown at all there)
IPython kernel: Prefix all env vars we set for it with SPY This way there are less chances of clashes with user defined vars.
spyder-ide_spyder-kernels
train
py
aed0bb9c309022a11866226699f3e75e995938d8
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -29,6 +29,13 @@ setup( "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", ], entry_points={ 'sqlalchemy.dialects': [
Add trove classifiers for the specific supported python versions
sqlalchemy-redshift_sqlalchemy-redshift
train
py
7b333d5937e8f9770aa380a8a794fd57559fbd65
diff --git a/nodefire.js b/nodefire.js index <HASH>..<HASH> 100644 --- a/nodefire.js +++ b/nodefire.js @@ -696,7 +696,7 @@ function delegateNodeFire(method) { function wrapNodeFire(method) { NodeFire.prototype[method] = function() { return new NodeFire( - this.$firebase[method].apply(this.$firebase, arguments), undefined, this.$host); + this.$firebase[method].apply(this.$firebase, arguments), this.$scope, this.$host); }; }
Fixed bug caused by not passing scope in wrapNodeFire() (#2) The example in the README actually doesn't work out of the box because the scope is not passed along when `root()` is called in `theUser: stuff.root().child('users/{baz.qux}').get()`. The fix is to pass along `this.$scope` within `wrapNodeFire()` so each method has access to that same scope.
pkaminski_nodefire
train
js
6cc750b07c55e37c8b2483079affc164b00b30e0
diff --git a/service-runner.js b/service-runner.js index <HASH>..<HASH> 100755 --- a/service-runner.js +++ b/service-runner.js @@ -55,8 +55,14 @@ ServiceRunner.prototype.run = function run (conf) { var config = self.config; var name = config.package && config.package.name || 'service-runner'; + // display the version + if (self.options.displayVersion) { + console.log(name + ' ' + config.package.version); + process.exit(0); + } + // do we need to use Docker instead of starting normally ? - if(self.options.useDocker) { + if (self.options.useDocker) { self.options.basePath = self._basePath; return docker(self.options, self.config); } @@ -274,20 +280,13 @@ ServiceRunner.prototype._getOptions = function (opts) { process.exit(0); } - // version - if (args.v) { - var meta = require(path.join(__dirname, './package.json')); - console.log(meta.name + ' ' + meta.version); - process.exit(0); - } - - if (!opts) { // Use args args.b = args.b || args.f; opts = { num_workers: args.n, configFile: args.c, + displayVersion: args.v, build: args.b, forceBuild: args.f, dockerStart: args.s,
Minor fix: Display the version of the service, not that of service-runner
wikimedia_service-runner
train
js
3c626e9e354a754e547e2fa6288652b640f1593f
diff --git a/lib/Thelia/Tests/bootstrap.php b/lib/Thelia/Tests/bootstrap.php index <HASH>..<HASH> 100644 --- a/lib/Thelia/Tests/bootstrap.php +++ b/lib/Thelia/Tests/bootstrap.php @@ -7,7 +7,7 @@ */ $env = "test"; define('THELIA_ROOT', __DIR__ .'/../../../../'); -$loader = require __DIR__ . '/../../../autoload.php'; +$loader = require __DIR__ . '/../../../vendor/autoload.php'; require THELIA_ROOT . '/local/config/config_db.php';
fix propel version in composer file and exclude some directory in phpunit code-coverage parameter
thelia_core
train
php
47a2672d4f5f48f64825c5d56609327585683dbc
diff --git a/treeherder/webapp/api/views.py b/treeherder/webapp/api/views.py index <HASH>..<HASH> 100644 --- a/treeherder/webapp/api/views.py +++ b/treeherder/webapp/api/views.py @@ -322,8 +322,11 @@ class JobsViewSet(viewsets.ViewSet): if objs: option_collections = jm.refdata_model.get_all_option_collections() for job in objs: - job["platform_opt"] = option_collections[ - job["option_collection_hash"]]['opt'] + opt = job.get("option_collection_hash", None) + if (opt): + job["platform_opt"] = option_collections[opt]['opt'] + else: + job["platform_opt"] = None return Response(objs)
fixed issue from lightsofappolo wrt option_collection in the view
mozilla_treeherder
train
py
a09648898a15a0acdf16c32bd29855f2ff0c2600
diff --git a/lib/maruku/input/html_helper.rb b/lib/maruku/input/html_helper.rb index <HASH>..<HASH> 100644 --- a/lib/maruku/input/html_helper.rb +++ b/lib/maruku/input/html_helper.rb @@ -155,7 +155,7 @@ module MaRuKu::In::Markdown::SpanLevelParser end def error(s) - raise Exception, "Error: #{s} \n"+ inspect, caller + raise "Error: #{s} \n"+ inspect, caller end def inspect
Handle malformed raw HTML more gracefully.
bhollis_maruku
train
rb
2731808deb1fd375651706cb67f9313f984c28f8
diff --git a/livelossplot/__init__.py b/livelossplot/__init__.py index <HASH>..<HASH> 100644 --- a/livelossplot/__init__.py +++ b/livelossplot/__init__.py @@ -1,6 +1,7 @@ from .core import draw_plot from .generic_plot import PlotLosses -from .keras_plot import PlotLossesKeras - -# TODO: -# * import keras plot only if there is keras +try: + from .keras_plot import PlotLossesKeras +except: + # import keras plot only if there is keras + pass
conditional import of PlotLossesKeras
stared_livelossplot
train
py
23d4d5a505bd1715cffe8d9ee70634c75c73dfbe
diff --git a/test/main.js b/test/main.js index <HASH>..<HASH> 100644 --- a/test/main.js +++ b/test/main.js @@ -15,7 +15,7 @@ describe('sinon-doublist-fs', function() { beforeEach(function(hookDone) { sinonDoublist(sinon, this); sinonDoublistFs(fs, this); - this.name = '/foo'; + this.names = ['/foo']; hookDone(); }); @@ -47,11 +47,13 @@ describe('sinon-doublist-fs', function() { describe('#existsSync()', function() { it('should detect stub', function(testDone) { - var batch = new Batch(); + should.equal(fs.existsSync(this.names[0]), false); + this.stubFile(this.names[0]).make(); + should.equal(fs.existsSync(this.names[0]), true); - should.equal(fs.existsSync(this.name), false); - this.stubFile(this.name).make(); - should.equal(fs.existsSync(this.name), true); + should.equal(fs.existsSync(this.names[1]), false); + this.stubFile(this.names[1]).make(); + should.equal(fs.existsSync(this.names[1]), true); testDone(); }); });
Add multi-file stub test
codeactual_sinon-doublist-fs
train
js
8e2b6eb8d3d9169a825dfb511817a4e03e67ffbd
diff --git a/requires.js b/requires.js index <HASH>..<HASH> 100644 --- a/requires.js +++ b/requires.js @@ -1,6 +1,9 @@ 'use strict'; const evalInWindow = (expression) => { + if (typeof expression === 'function') { + expression = `(${expression})()` + } return new Promise((resolve, reject) => { chrome.devtools.inspectedWindow.eval(expression, (result, error) => { if (error) @@ -50,7 +53,9 @@ const loadRequire = (path) => { } const getRequirePaths = () => { - return evalInWindow('Object.keys(require.cache)') + return evalInWindow(() => { + return Object.keys(require.cache) + }) } const getRequires = () => { @@ -62,7 +67,7 @@ const getRequires = () => { } const getRequireGraph = () => { - var collector = '(' + (function () { + return evalInWindow(() => { var collectModules = function (module) { var name = module.filename if (name.indexOf(process.resourcesPath) === 0) { @@ -74,6 +79,5 @@ const getRequireGraph = () => { } } return collectModules(process.mainModule) - }).toString() + ')()' - return evalInWindow(collector) + }) }
Support passing function to evalInWindow
electron_devtron
train
js
d31ddc5fc49a344e45b3c37743b87269ef2c2046
diff --git a/pymemcache/client/hash.py b/pymemcache/client/hash.py index <HASH>..<HASH> 100644 --- a/pymemcache/client/hash.py +++ b/pymemcache/client/hash.py @@ -15,7 +15,7 @@ class HashClient(object): def __init__( self, servers, - hasher=None, + hasher=RendezvousHash, serializer=None, deserializer=None, connect_timeout=None, @@ -70,8 +70,7 @@ class HashClient(object): self._dead_clients = {} self._last_dead_check_time = time.time() - if hasher is None: - self.hasher = RendezvousHash() + self.hasher = hasher() self.default_kwargs = { 'connect_timeout': connect_timeout,
make the hasher class pluggable in HashClient
pinterest_pymemcache
train
py
5c191c2e3af174ecd05b6a1710583f5ca0f6ad06
diff --git a/seaglass/trunk/seaglass/src/main/java/com/seaglasslookandfeel/ui/SeaGlassRootPaneUI.java b/seaglass/trunk/seaglass/src/main/java/com/seaglasslookandfeel/ui/SeaGlassRootPaneUI.java index <HASH>..<HASH> 100644 --- a/seaglass/trunk/seaglass/src/main/java/com/seaglasslookandfeel/ui/SeaGlassRootPaneUI.java +++ b/seaglass/trunk/seaglass/src/main/java/com/seaglasslookandfeel/ui/SeaGlassRootPaneUI.java @@ -184,7 +184,7 @@ public class SeaGlassRootPaneUI extends BasicRootPaneUI implements SynthUI { installClientDecorations(root); } // Need the content pane to not be opaque. - ((JComponent) root.getContentPane()).setOpaque(false); + LookAndFeel.installProperty((JComponent) root.getContentPane(), "opaque", Boolean.FALSE); } /**
Use LookAndFeel.installProperty to set content pane opacity, so as not to override anything set by the user.
khuxtable_seaglass
train
java
3092333a70a2180080dd8653bf7938b3fa5c4bd4
diff --git a/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableSession.java b/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableSession.java index <HASH>..<HASH> 100644 --- a/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableSession.java +++ b/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableSession.java @@ -121,7 +121,10 @@ public class BigtableSession implements Closeable { private synchronized static SslContext createSslContext() throws SSLException { if (sslBuilder == null) { - sslBuilder = GrpcSslContexts.forClient(); + // TODO(igorbernstein2): figure out why .ciphers(null) is necessary + // Without it, the dataflow-reimport test fails with: + // "javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)" + sslBuilder = GrpcSslContexts.forClient().ciphers(null); } return sslBuilder.build(); }
Fix dataflow ssl handshake issue. (#<I>) Currently the job fails with: "javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)"
googleapis_cloud-bigtable-client
train
java
85f83f4a1b21d96258e33f8817025509e6730534
diff --git a/v1/worker.go b/v1/worker.go index <HASH>..<HASH> 100644 --- a/v1/worker.go +++ b/v1/worker.go @@ -43,7 +43,7 @@ func (worker *Worker) Launch() error { errorsChan := make(chan error) sig := make(chan os.Signal, 1) signal.Notify(sig, os.Interrupt, syscall.SIGTERM) - quitting := false + var signalsReceived uint go func() { for { @@ -63,16 +63,19 @@ func (worker *Worker) Launch() error { select { case s := <-sig: log.WARNING.Printf("Signal received: %v", s) - if quitting { - return + signalsReceived++ + + if signalsReceived < 2 { + // After first Ctrl+C start quitting the worker gracefully + log.WARNING.Print("Waiting for running tasks to finish before shutting down") + go func() { + worker.Quit() + errorsChan <- errors.New("Worker quit gracefully") + }() + } else { + // Abort the program when user hits Ctrl+C second time in a row + errorsChan <- errors.New("Worker quit abruptly") } - - quitting = true - log.WARNING.Print("Waiting for running tasks to finish before shutting down") - go func() { - worker.Quit() - errorsChan <- errors.New("Worker quit") - }() } } }()
First Ctrl+C starts graceful shutdown. Second Ctrl+C abruptly ends the program.
RichardKnop_machinery
train
go
706a0c09a09e71e00e2a067b125194e286569ebb
diff --git a/web/concrete/src/Database/Connection.php b/web/concrete/src/Database/Connection.php index <HASH>..<HASH> 100644 --- a/web/concrete/src/Database/Connection.php +++ b/web/concrete/src/Database/Connection.php @@ -15,7 +15,7 @@ class Connection extends \Doctrine\DBAL\Connection { if (!isset(static::$entityManager)) { $conn = $this->getParams(); - $config = Setup::createConfiguration(false, DIR_DOCTRINE_PROXY_CLASSES, new DoctrineCacheDriver()); + $config = Setup::createConfiguration(false, DIR_DOCTRINE_PROXY_CLASSES, new DoctrineCacheDriver('expensive')); $driverImpl = $config->newDefaultAnnotationDriver(DIR_BASE_CORE . '/' . DIRNAME_CLASSES); $config->setMetadataDriverImpl($driverImpl); static::$entityManager = EntityManager::create($conn, $config);
Setting doctrine em as expensive cache Former-commit-id: <I>d7a<I>e9c<I>eb6e<I>baf<I>bbef<I>bcfa<I>
concrete5_concrete5
train
php
5bc27feb0bfa0203b808414affd6ff9b811d9f9e
diff --git a/agent/structs/check_type.go b/agent/structs/check_type.go index <HASH>..<HASH> 100644 --- a/agent/structs/check_type.go +++ b/agent/structs/check_type.go @@ -77,7 +77,7 @@ func (c *CheckType) Empty() bool { // IsAlias checks if this is an alias check. func (c *CheckType) IsAlias() bool { - return c.AliasService != "" + return c.AliasNode != "" || c.AliasService != "" } // IsScript checks if this is a check that execs some kind of script.
agent/structs: check is alias if node is empty
hashicorp_consul
train
go
51bd8f663cb4f5b60defbc6f42705846c57a5524
diff --git a/src/Middleware/LocaleCookieRedirect.php b/src/Middleware/LocaleCookieRedirect.php index <HASH>..<HASH> 100644 --- a/src/Middleware/LocaleCookieRedirect.php +++ b/src/Middleware/LocaleCookieRedirect.php @@ -31,7 +31,7 @@ class LocaleCookieRedirect extends Middleware public function handle(Request $request, Closure $next) { // If the request URL is ignored from localization. - if ($this->shouldIgnore($request)) return $next($request); + if ($this->shouldIgnore($request) || class_basename($next($request)) === 'StreamedResponse') return $next($request); $segment = $request->segment(1, null);
Don't send locale cookie if next request returns a StreamedResponse
ARCANEDEV_Localization
train
php
d6d025dd1804403ba1308d59fef86db4bdd8b7d2
diff --git a/Generator/ContentEntityType.php b/Generator/ContentEntityType.php index <HASH>..<HASH> 100644 --- a/Generator/ContentEntityType.php +++ b/Generator/ContentEntityType.php @@ -199,6 +199,7 @@ class ContentEntityType extends EntityTypeBase { 'component_type' => 'PHPMethod', 'containing_component' => '%requester', 'declaration' => 'public static function baseFieldDefinitions(\Drupal\Core\Entity\EntityTypeInterface $entity_type)', + 'doxygen_first' => '{@inheritdoc}', 'body' => $method_body, ];
Fixed baseFieldDefinitions() in generated content entity type missing its @inheritdoc comment. Fixes #<I>.
drupal-code-builder_drupal-code-builder
train
php
15e39f9541cf133b067f4d15b8ef9eb55705a652
diff --git a/src/Parser.php b/src/Parser.php index <HASH>..<HASH> 100644 --- a/src/Parser.php +++ b/src/Parser.php @@ -35,12 +35,9 @@ class Parser try { $object = $this->elementFactory->make($element['name']); } catch (InvalidElementException $e) { - // Try to find a reservation for this element and set $object to that - // if its an instance of ElementInterface, if its an array then just set - // $element and try to re-make the object using element factory. - // If no reservation is found then rethrow $e - throw $e; + $object = $this->getReservation($element['name']); } + // Set some stuff $object->setCollection($this->collection); $object->setAttributes($element['attributes']);
Adding logic to get reservation out if an element does not exist with the specified name
encorephp_giml
train
php
8995ff6a34b534558d12c07b85657b50a333c1dc
diff --git a/tests/test_watermark.py b/tests/test_watermark.py index <HASH>..<HASH> 100644 --- a/tests/test_watermark.py +++ b/tests/test_watermark.py @@ -111,13 +111,9 @@ class TestWatermarkMethodsPdfrw(unittest.TestCase): def test_watermark_label(self): """Apply a watermark label to a PDF file.""" - w = Watermark(self.pdf_path, use_receipt=False, open_file=False, tempdir=self.temp.name) label = os.path.basename(self.pdf_path) labeled = Label(self.pdf_path, label, tempdir=self.temp.name).write(cleanup=False) - # Assert the watermark file exists - self.assertTrue(os.path.exists(label)) - # Assert watermarked PDF file exists self.assertTrue(os.path.exists(labeled))
FIX issue with test_watermark_label method
mrstephenneal_pdfconduit
train
py
90273ee12cefce1fd38bc9842e39f7fe0ae5784a
diff --git a/ppb/events.py b/ppb/events.py index <HASH>..<HASH> 100644 --- a/ppb/events.py +++ b/ppb/events.py @@ -97,7 +97,7 @@ class ButtonPressed: @dataclass class ButtonReleased: """ - Fired when a button is pressed + Fired when a button is released """ button: MouseButton position: Vector diff --git a/ppb/systems.py b/ppb/systems.py index <HASH>..<HASH> 100644 --- a/ppb/systems.py +++ b/ppb/systems.py @@ -64,9 +64,11 @@ class PygameEventPoller(System): def on_update(self, update, signal): for pygame_event in pygame.event.get(): - ppb_event = self.event_map.get(pygame_event.type) - if ppb_event is not None: - signal(getattr(self, ppb_event)(pygame_event, update.scene)) + methname = self.event_map.get(pygame_event.type) + if methname is not None: + ppbevent = getattr(self, methname)(pygame_event, update.scene) + if ppbevent: + signal(ppbevent) def quit(self, event, scene): return events.Quit()
Handle if a pygame event handler doesn't return data
ppb_pursuedpybear
train
py,py
299dd32467b2a749ce2ed309d5b647eb4ce0d1a7
diff --git a/vasppy/poscar.py b/vasppy/poscar.py index <HASH>..<HASH> 100644 --- a/vasppy/poscar.py +++ b/vasppy/poscar.py @@ -7,6 +7,11 @@ from pymatgen import Lattice as pmg_Lattice from pymatgen import Structure as pmg_Structure from pymatgen.io.cif import CifWriter +# Ignore SIG_PIPE and don't throw exceptions on it... +# http://newbebweb.blogspot.co.uk/2012/02/python-head-ioerror-errno-32-broken.html +from signal import signal, SIGPIPE, SIG_DFL +signal( SIGPIPE, SIG_DFL ) + def parity( list ): return( sum( list )%2 )
Restore signal handler for SIGPIPE
bjmorgan_vasppy
train
py
dbaefd1f15bb0f51d9e492da5b1add249f5ee4ad
diff --git a/world/components.go b/world/components.go index <HASH>..<HASH> 100644 --- a/world/components.go +++ b/world/components.go @@ -621,9 +621,21 @@ func (maker commonComponentMaker) garden(includeDefaultStack bool, fs ...func(*r Expect(err).NotTo(HaveOccurred()) config.PortPoolStart = &startPort - gardenRunner := runner.NewGardenRunner(config) + gdn := ifrit.RunFunc(func(signals <-chan os.Signal, ready chan<- struct{}) error { + gdn := runner.Start(config) + close(ready) + + var err error + for { + select { + case <-signals: + err = gdn.DestroyAndStop() + return err + } + } + }) - members = append(members, grouper.Member{Name: "garden", Runner: gardenRunner}) + members = append(members, grouper.Member{Name: "garden", Runner: gdn}) return grouper.NewOrdered(os.Interrupt, members) }
use GardenRunner.Start to start the garden process - GardenRunner removed the start check for `garden.started` in the log lines. We switch to use the Start method instead in order to ensure the garden server is up and running prior to sending requests to it.
cloudfoundry_inigo
train
go
84e8531e18d316e5278197911a061766f8838259
diff --git a/src/Illuminate/Database/Query/Builder.php b/src/Illuminate/Database/Query/Builder.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Database/Query/Builder.php +++ b/src/Illuminate/Database/Query/Builder.php @@ -1363,19 +1363,6 @@ class Builder } /** - * Execute the query as a fresh "select" statement. - * - * @param array $columns - * @return array|static[] - * - * @deprecated since version 5.1. Use get instead. - */ - public function getFresh($columns = ['*']) - { - return $this->get($columns); - } - - /** * Run the query as a "select" statement against the connection. * * @return array
Removed deprecated getFresh method
laravel_framework
train
php
9dc7bc0ea7606780ad6df13bb978b6185b0df97f
diff --git a/lazy_record/base/query_methods.py b/lazy_record/base/query_methods.py index <HASH>..<HASH> 100644 --- a/lazy_record/base/query_methods.py +++ b/lazy_record/base/query_methods.py @@ -6,11 +6,7 @@ class QueryMethods(object): """ Find record by +id+, raising RecordNotFound if no record exists. """ - result = Query(cls).where(id=id).first() - if result: - return result - else: - raise RecordNotFound({'id': id}) + return cls.find_by(id=id) @classmethod def find_by(cls, **kwargs):
refactored QueryMethods.find
ECESeniorDesign_lazy_record
train
py
3d58a765f7f946c1e1e554662663eb2d534cc351
diff --git a/main.js b/main.js index <HASH>..<HASH> 100644 --- a/main.js +++ b/main.js @@ -6,9 +6,11 @@ const express = require('express'); const fs = require('fs'); const path = require('path'); -const utils = require(__dirname + '/lib/utils'); // Get common adapter utils +const utils = require('./lib/utils'); // Get common adapter utils const LE = require(utils.controllerDir + '/lib/letsencrypt.js'); const mime = require('mime-types'); +const adapterName = require('./package.json').name.split('.').pop(); + let session;// = require('express-session'); let cookieParser;// = require('cookie-parser'); let bodyParser;// = require('body-parser'); @@ -38,7 +40,7 @@ function startAdapter(options) { options = options || {}; Object.assign(options,{ - name: 'web', + name: adapterName, objectChange: (id, obj) => { if (obj && obj.common && obj.common.webExtension && obj.native && (extensions[id.substring('system.adapter.'.length)] ||
(bluefox) preparations for compact mode
ioBroker_ioBroker.web
train
js
fdd28075a239da742c35344bde775d745e5c0146
diff --git a/Kwf/Controller/Front.php b/Kwf/Controller/Front.php index <HASH>..<HASH> 100644 --- a/Kwf/Controller/Front.php +++ b/Kwf/Controller/Front.php @@ -128,7 +128,8 @@ class Kwf_Controller_Front extends Zend_Controller_Front if (isset($argv[1]) && $argv[1] == 'symfony') { unset($argv[0]); unset($argv[1]); - $cmd = './symfony/bin/console --ansi '.implode(' ', array_map('escapeshellarg', $argv)); + if (!in_array("--no-ansi", $argv)) $argv[] = '--ansi'; + $cmd = './symfony/bin/console '.implode(' ', array_map('escapeshellarg', $argv)); passthru($cmd, $retVar); exit($retVar); }
ansi for symfony commands can be deactivated now by adding no-ansi
koala-framework_koala-framework
train
php
245728b2389e824808193fd08b152364407d99a0
diff --git a/schedule/__init__.py b/schedule/__init__.py index <HASH>..<HASH> 100644 --- a/schedule/__init__.py +++ b/schedule/__init__.py @@ -343,7 +343,7 @@ class Job(object): time_values = time_str.split(':') if len(time_values) == 3: hour, minute, second = time_values - elif len(time_values) == 1 and self.unit == 'minutes': + elif len(time_values) == 2 and self.unit == 'minutes': hour = 0 minute = 0 _, second = time_values
Fix a bug where the at(':SS') syntax wasn't working
dbader_schedule
train
py
ce829e86ca1bde95efb39fbed7d80edc44b75bb8
diff --git a/modules/appnexusBidAdapter.js b/modules/appnexusBidAdapter.js index <HASH>..<HASH> 100644 --- a/modules/appnexusBidAdapter.js +++ b/modules/appnexusBidAdapter.js @@ -999,9 +999,22 @@ function hidedfpContainer(elementId) { } } +function hideSASIframe(elementId) { + try { + // find script tag with id 'sas_script'. This ensures it only works if you're using Smart Ad Server. + const el = document.getElementById(elementId).querySelectorAll("script[id^='sas_script']"); + if (el[0].nextSibling && el[0].nextSibling.localName === 'iframe') { + el[0].nextSibling.style.setProperty('display', 'none'); + } + } catch (e) { + // element not found! + } +} + function outstreamRender(bid) { - // push to render queue because ANOutstreamVideo may not be loaded yet hidedfpContainer(bid.adUnitCode); + hideSASIframe(bid.adUnitCode); + // push to render queue because ANOutstreamVideo may not be loaded yet bid.renderer.push(() => { window.ANOutstreamVideo.renderAd({ tagId: bid.adResponse.tag_id,
appnexus bid adapter - fix outstream render issue with smart ad server (#<I>)
prebid_Prebid.js
train
js