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 |
|---|---|---|---|---|---|
4a4a635d2fe5eab711cca2f429e758c0301cbb6f | diff --git a/Collection.php b/Collection.php
index <HASH>..<HASH> 100644
--- a/Collection.php
+++ b/Collection.php
@@ -161,7 +161,7 @@ class Collection implements ArrayAccess, ArrayableInterface, Countable, Iterator
*/
public function map(Closure $callback)
{
- return array_map($callback, $this->items);
+ return new static(array_map($callback, $this->items));
}
/**
@@ -172,9 +172,7 @@ class Collection implements ArrayAccess, ArrayableInterface, Countable, Iterator
*/
public function filter(Closure $callback)
{
- $this->items = array_filter($this->items, $callback);
-
- return $this;
+ return new static(array_filter($this->items, $callback));
}
/** | Collection `map` and `filter` both return new `Collection` instances now. Closes #<I>. | illuminate_support | train | php |
fe2c5d5de09149634f29bca9ce17624dd91e4629 | diff --git a/frontend-maven-plugin/src/main/java/com/github/eirslett/maven/plugins/frontend/mojo/InstallNodeAndNpmMojo.java b/frontend-maven-plugin/src/main/java/com/github/eirslett/maven/plugins/frontend/mojo/InstallNodeAndNpmMojo.java
index <HASH>..<HASH> 100644
--- a/frontend-maven-plugin/src/main/java/com/github/eirslett/maven/plugins/frontend/mojo/InstallNodeAndNpmMojo.java
+++ b/frontend-maven-plugin/src/main/java/com/github/eirslett/maven/plugins/frontend/mojo/InstallNodeAndNpmMojo.java
@@ -12,7 +12,7 @@ import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.settings.crypto.SettingsDecrypter;
import org.apache.maven.settings.Server;
-@Mojo(name="install-node-and-npm", defaultPhase = LifecyclePhase.GENERATE_RESOURCES)
+@Mojo(name="install-node-and-npm", defaultPhase = LifecyclePhase.GENERATE_RESOURCES, threadSafe = true)
public final class InstallNodeAndNpmMojo extends AbstractFrontendMojo {
/** | ThreadSafe Node and NPM installation
add threadsafe annotation to InstallNodeAndNpmMojo | eirslett_frontend-maven-plugin | train | java |
52a22db7d5b61e2474c69680dc2b1119ec0f064e | diff --git a/lxd/network/network_load.go b/lxd/network/network_load.go
index <HASH>..<HASH> 100644
--- a/lxd/network/network_load.go
+++ b/lxd/network/network_load.go
@@ -1,9 +1,6 @@
package network
import (
- "github.com/pkg/errors"
-
- "github.com/lxc/lxd/lxd/project"
"github.com/lxc/lxd/lxd/state"
)
@@ -43,21 +40,3 @@ func LoadByName(s *state.State, project string, name string) (Network, error) {
return n, nil
}
-
-// Validate validates the supplied network name and configuration for the specified network type.
-func Validate(name string, netType string, config map[string]string) error {
- driverFunc, ok := drivers[netType]
- if !ok {
- return ErrUnknownDriver
- }
-
- n := driverFunc()
- n.init(nil, 0, project.Default, name, netType, "", config, "Unknown")
-
- err := n.ValidateName(name)
- if err != nil {
- return errors.Wrapf(err, "Network name invalid")
- }
-
- return n.Validate(config)
-} | lxd/network/network/load: Removes unused Validate | lxc_lxd | train | go |
30cbca675d20e36ce42481b77f8e53cef2805be8 | diff --git a/contribs/gmf/src/controllers/abstractdesktop.js b/contribs/gmf/src/controllers/abstractdesktop.js
index <HASH>..<HASH> 100644
--- a/contribs/gmf/src/controllers/abstractdesktop.js
+++ b/contribs/gmf/src/controllers/abstractdesktop.js
@@ -94,7 +94,9 @@ gmf.AbstractDesktopController = function(config, $scope, $injector) {
interactions: config.mapInteractions || ol.interaction.defaults({
pinchRotate: false,
altShiftDragRotate: false
- })
+ }),
+ loadTilesWhileAnimating: true,
+ loadTilesWhileInteracting: true
});
/** | Load tiles while animating and interacting (desktop) | camptocamp_ngeo | train | js |
ea58a68ee3b1b0a51a47055f2346921cde9e6238 | diff --git a/Tests/Unit/System/DateTime/FormatServiceTest.php b/Tests/Unit/System/DateTime/FormatServiceTest.php
index <HASH>..<HASH> 100644
--- a/Tests/Unit/System/DateTime/FormatServiceTest.php
+++ b/Tests/Unit/System/DateTime/FormatServiceTest.php
@@ -116,7 +116,7 @@ class FormatServiceTest extends UnitTest
*/
public function canIsoToTimestampIllegalDate()
{
- $this->assertEquals(-62169987600, $this->formatService->IsoToTimestamp('0000-00-00T00:00:00Z'));
+ $this->assertEquals(0, $this->formatService->IsoToTimestamp('02-16-2017T20:13:57Z'));
}
/**
@@ -164,7 +164,7 @@ class FormatServiceTest extends UnitTest
*/
public function canUtcIsoToTimestampIllegalDate()
{
- $this->assertEquals(-62169984000, $this->formatService->utcIsoToTimestamp('0000-00-00T00:00:00Z'));
+ $this->assertEquals(0, $this->formatService->utcIsoToTimestamp('02-16-2017T20:13:57Z'));
}
/** | Fixed one test that would yield another result with PHP <I> | TYPO3-Solr_ext-solr | train | php |
5402dc1ec896ace83e163b52efea47ef9a8e681d | diff --git a/bcbio/variation/mutect2.py b/bcbio/variation/mutect2.py
index <HASH>..<HASH> 100644
--- a/bcbio/variation/mutect2.py
+++ b/bcbio/variation/mutect2.py
@@ -106,7 +106,7 @@ def mutect2_caller(align_bams, items, ref_file, assoc_files,
params += _add_tumor_params(paired, items, gatk_type)
params += _add_region_params(region, out_file, items, gatk_type)
- if is_paired(align_bams[0]):
+ if all(is_paired(bam) for bam in align_bams):
orientation_filter = True
else:
orientation_filter = False | Only do that when all BAMs are paired | bcbio_bcbio-nextgen | train | py |
cf628f88b8c77b59325f8184fc64c281722c0386 | diff --git a/hollow/src/main/java/com/netflix/hollow/api/codegen/CodeGeneratorConfig.java b/hollow/src/main/java/com/netflix/hollow/api/codegen/CodeGeneratorConfig.java
index <HASH>..<HASH> 100644
--- a/hollow/src/main/java/com/netflix/hollow/api/codegen/CodeGeneratorConfig.java
+++ b/hollow/src/main/java/com/netflix/hollow/api/codegen/CodeGeneratorConfig.java
@@ -35,6 +35,7 @@ public class CodeGeneratorConfig {
this.getterPrefix = getterPrefix;
}
+ // Make it easier to automatically use defaults for next major version
public void initWithNextMajorVersionDefaults_V3() {
usePackageGrouping = true;
useBooleanFieldErgonomics = true; | added comment about initWithNextMajorVersionDefaults_V3 | Netflix_hollow | train | java |
c308312c15096f67c1e2875913a7f7b474e7e0f3 | diff --git a/SpiffWorkflow/task.py b/SpiffWorkflow/task.py
index <HASH>..<HASH> 100644
--- a/SpiffWorkflow/task.py
+++ b/SpiffWorkflow/task.py
@@ -279,6 +279,10 @@ class Task(object):
self.children[0]._set_state(self.FUTURE)
else:
self._drop_children(force=True)
+ if taskinfo['is_looping'] or \
+ taskinfo['is_sequential_mi'] or \
+ taskinfo['is_parallel_mi']:
+ self.task_spec._predict(self)
self._sync_children(self.task_spec.outputs)
def _getstate(self):
diff --git a/tests/SpiffWorkflow/camunda/ResetTokenTestMIParallel.py b/tests/SpiffWorkflow/camunda/ResetTokenTestMIParallel.py
index <HASH>..<HASH> 100644
--- a/tests/SpiffWorkflow/camunda/ResetTokenTestMIParallel.py
+++ b/tests/SpiffWorkflow/camunda/ResetTokenTestMIParallel.py
@@ -70,8 +70,6 @@ class ResetTokenTestMIParallel(BaseTestCase):
'answer': 'c'},
]
for step in steps:
- print(step)
- print(self.workflow.get_ready_user_tasks())
task = self.workflow.get_ready_user_tasks()[0]
self.assertEqual(step['taskname'], task.task_spec.name)
task.update_data({step['formvar']: step['answer']}) | Make sure that this task is predicted - in hindsight, this may also set the state to FUTURE and I won't have to do it above | knipknap_SpiffWorkflow | train | py,py |
54d1b2d691238e692df680a36fc95ca51a882dac | diff --git a/latex/build.py b/latex/build.py
index <HASH>..<HASH> 100644
--- a/latex/build.py
+++ b/latex/build.py
@@ -6,6 +6,14 @@ from tempdir import TempDir
class LaTeXError(Exception):
+ """LaTeX call exception."""
+
+ #: Contents of the log-file that was generated (if any).
+ log = None
+
+ #: The :class:`subprocess.CalledProcessError` that was thrown originally.
+ call_exc = None
+
def __str__(self):
return str(self.log) | Added docs for LaTeXError. | mbr_latex | train | py |
73225a083aec8545a8f6c2adb57e826217bed98f | diff --git a/src/main/org/openscience/cdk/dict/DictionaryDatabase.java b/src/main/org/openscience/cdk/dict/DictionaryDatabase.java
index <HASH>..<HASH> 100644
--- a/src/main/org/openscience/cdk/dict/DictionaryDatabase.java
+++ b/src/main/org/openscience/cdk/dict/DictionaryDatabase.java
@@ -56,7 +56,7 @@ public class DictionaryDatabase {
"chemical", "elements", "descriptor-algorithms","reaction-processes"
};
private String[] dictionaryTypes = {
- "xml", "xml", "owl", "owl_React"
+ "xml", "owl", "owl", "owl_React"
};
private Hashtable<String, Dictionary> dictionaries; | Fixed reading of the cdk/dict/data/elements.owl database which is now in OWL | cdk_cdk | train | java |
3b6cd85a94e13fb626eada5e81849dd1a8901ae7 | diff --git a/DataFixtures/ORM/LoadOrdersData.php b/DataFixtures/ORM/LoadOrdersData.php
index <HASH>..<HASH> 100644
--- a/DataFixtures/ORM/LoadOrdersData.php
+++ b/DataFixtures/ORM/LoadOrdersData.php
@@ -100,7 +100,7 @@ class LoadOrdersData extends DataFixture
$payment->setCurrency($order->getCurrency());
$payment->setState($this->getPaymentState());
- $order->setPayment($payment);
+ $order->addPayment($payment);
$this->get('event_dispatcher')->dispatch(SyliusCheckoutEvents::FINALIZE_PRE_COMPLETE, new GenericEvent($order));
} | Deprecate the old getPayment and setPayment methods. | Sylius_SyliusFixturesBundle | train | php |
4833cad86e374cc971a12797df27453533fa7a2c | diff --git a/lib/nrser/rspex.rb b/lib/nrser/rspex.rb
index <HASH>..<HASH> 100644
--- a/lib/nrser/rspex.rb
+++ b/lib/nrser/rspex.rb
@@ -102,6 +102,8 @@ module NRSER::RSpex
end
end # #called_with
+ alias_method :when_called_with, :called_with
+
end # module ExampleGroup
end # module NRSER:RSpex | Add when_called_with alias for called_with | nrser_nrser.rb | train | rb |
237f75c58d83a5483b341e4252b3301ab6c83591 | diff --git a/aiogram/types/reply_keyboard.py b/aiogram/types/reply_keyboard.py
index <HASH>..<HASH> 100644
--- a/aiogram/types/reply_keyboard.py
+++ b/aiogram/types/reply_keyboard.py
@@ -41,7 +41,7 @@ class ReplyKeyboardMarkup(base.TelegramObject):
:rtype: :obj:`types.ReplyKeyboardMarkup`
"""
row = []
- for index, button in enumerate(args):
+ for index, button in enumerate(args, start=1):
row.append(button)
if index % self.row_width == 0:
self.keyboard.append(row) | Fix ReplyKeyboardMarkup's add method
Fix when add method taking multiple buttons was adding one button to a new row and then adding items to rows according to row_width | aiogram_aiogram | train | py |
5ceee4e7b573459eeb8ee6f14a13f7c23cfafc05 | diff --git a/views/js/ui/usermgr.js b/views/js/ui/usermgr.js
index <HASH>..<HASH> 100644
--- a/views/js/ui/usermgr.js
+++ b/views/js/ui/usermgr.js
@@ -61,9 +61,9 @@ define([
type: 'GET'
}).done(function(response) {
- $rendering = $(layout(response));
- $edits = $rendering.find('.icon-edit');
- $removes = $rendering.find('.icon-result-nok');
+ var $rendering = $(layout(response));
+ var $edits = $rendering.find('.icon-edit');
+ var $removes = $rendering.find('.icon-result-nok');
for (var i = 0; i < response.records; i++) {
$edits.eq(i).click(function() {
@@ -78,8 +78,8 @@ define([
}
// Now $rendering takes the place of $elt...
- $forwardBtn = $rendering.find('.usermgr-forward');
- $backwardBtn = $rendering.find('.usermgr-backward');
+ var $forwardBtn = $rendering.find('.usermgr-forward');
+ var $backwardBtn = $rendering.find('.usermgr-backward');
$forwardBtn.click(function() {
userMgr._next($rendering, options, data); | 'use strict' but forgot to add var statements. | oat-sa_tao-core | train | js |
23073787eea11fe591d6ebd6336284be2f634f14 | diff --git a/view/frontend/web/js/view/payment/method-renderer/checkoutcom_google_pay.js b/view/frontend/web/js/view/payment/method-renderer/checkoutcom_google_pay.js
index <HASH>..<HASH> 100755
--- a/view/frontend/web/js/view/payment/method-renderer/checkoutcom_google_pay.js
+++ b/view/frontend/web/js/view/payment/method-renderer/checkoutcom_google_pay.js
@@ -207,7 +207,6 @@ define(
*/
function processPayment(paymentData)
{
- //self.logEvent(JSON.parse(paymentData.paymentMethodToken.token));
$.post(
Utilities.getUrl('payment/placeorder'),
{ | Removed unused code in google pay js | checkout_checkout-magento2-plugin | train | js |
13758ed6a61a1f2c209f197534f48423cc2dddd2 | diff --git a/bundle/Controller/Controller.php b/bundle/Controller/Controller.php
index <HASH>..<HASH> 100644
--- a/bundle/Controller/Controller.php
+++ b/bundle/Controller/Controller.php
@@ -7,7 +7,7 @@ use eZ\Bundle\EzPublishCoreBundle\Controller as BaseController;
abstract class Controller extends BaseController
{
/**
- * @return \Netgen\EzPlatformSite\API\Site
+ * @return \Netgen\EzPlatformSiteApi\API\Site
*/
public function getSite()
{
@@ -17,12 +17,12 @@ abstract class Controller extends BaseController
/**
* Returns the root location object for current siteaccess configuration.
*
- * @return \Netgen\EzPlatformSite\API\Values\Location
+ * @return \Netgen\EzPlatformSiteApi\API\Values\Location
*/
public function getRootLocation()
{
- $rootLocation = parent::getRootLocation();
-
- return $this->getSite()->getLoadService()->loadLocation($rootLocation->id);
+ return $this->getSite()->getLoadService()->loadLocation(
+ $this->getConfigResolver()->getParameter('content.tree_root.location_id')
+ );
}
} | Fix base controller to not load root location twice | netgen_ezplatform-site-api | train | php |
09059ecd5d1f079e6842b37efbf01198b519a7f3 | diff --git a/src/main/java/me/moocar/logbackgelf/Transport.java b/src/main/java/me/moocar/logbackgelf/Transport.java
index <HASH>..<HASH> 100644
--- a/src/main/java/me/moocar/logbackgelf/Transport.java
+++ b/src/main/java/me/moocar/logbackgelf/Transport.java
@@ -7,6 +7,7 @@ import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.net.SocketException;
+import java.util.Locale;
import java.util.List;
/**
@@ -16,7 +17,8 @@ public class Transport {
private final InetAddress graylog2ServerAddress;
private final int graylog2ServerPort;
- private final SocketAddress loopbackAddress = new InetSocketAddress("localhost", 0);
+ private final SocketAddress loopbackAddress = System.getProperty("os.name").toLowerCase(Locale.ENGLISH).indexOf("windows") > -1 ?
+ new InetSocketAddress("localhost", 0) : new InetSocketAddress(0);
public Transport(int graylog2ServerPort, InetAddress graylog2ServerAddress) {
this.graylog2ServerPort = graylog2ServerPort; | d<I>ac6aab9b2e<I>dda<I>df<I>abd fixed an issue with Windows but broke Linux system, this should work across both | Moocar_logback-gelf | train | java |
45bf55cc90045e748211c8e35fceef34639da913 | diff --git a/lib/lita/handlers/users.rb b/lib/lita/handlers/users.rb
index <HASH>..<HASH> 100644
--- a/lib/lita/handlers/users.rb
+++ b/lib/lita/handlers/users.rb
@@ -5,9 +5,9 @@ module Lita
class Users
extend Lita::Handler::ChatRouter
- route /^users\s+find\s+(.+)/i, :find, command: true, help: {
+ route(/^users\s+find\s+(.+)/i, :find, command: true, help: {
t("help.find_key") => t("help.find_value")
- }
+ })
# Outputs the name, ID, and mention name of a user matching the search query.
# @param response [Lita::Response] The response object. | Parenthesize method call with ambiguous regex literal. | litaio_lita | train | rb |
9b46fe3b229d27a2455a0cc9946998dc2c89d227 | diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js
index <HASH>..<HASH> 100644
--- a/src/style_manager/model/PropertyStack.js
+++ b/src/style_manager/model/PropertyStack.js
@@ -10,6 +10,9 @@ export default Property.extend({
// The separator used to join layer values
layerSeparator: ', ',
+ // Prepend new layers in the list
+ prepend: 0,
+
// Layer preview
preview: 0
},
diff --git a/src/style_manager/view/PropertyStackView.js b/src/style_manager/view/PropertyStackView.js
index <HASH>..<HASH> 100644
--- a/src/style_manager/view/PropertyStackView.js
+++ b/src/style_manager/view/PropertyStackView.js
@@ -68,9 +68,16 @@ export default PropertyCompositeView.extend({
addLayer() {
const model = this.model;
const layers = this.getLayers();
+ const prepend = model.get('prepend');
const properties = model.get('properties').deepClone();
properties.each(property => property.set('value', ''));
- const layer = layers.add({ properties }, { active: 1 });
+ const layer = layers.add(
+ { properties },
+ {
+ active: 1,
+ ...(prepend && { at: 0 })
+ }
+ );
// In detached mode inputValueChanged will add new 'layer value'
// to all subprops | Add `prepend` option to the stack style manager type | artf_grapesjs | train | js,js |
452f5939aab125aa4cacbdd0435f8d09804b7669 | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -26,7 +26,7 @@ Dir["./spec/support/**/*.rb"].sort.each {|f| require f}
Capybara.app = Rack::ShowExceptions.new(Testbed::Application)
# Checks for pending migrations before tests are run.
# If you are not using ActiveRecord, you can remove this line.
-ActiveRecord::Migration.check_pending! if ::Rails.version >= "4.0" && defined?(ActiveRecord::Migration)
+ActiveRecord::Migration.maintain_test_schema! if ::Rails.version >= "4.0" && defined?(ActiveRecord::Migration)
Capybara.register_driver :poltergeist do |app| | Modify spec helper to try and get travis to run again | kjayma_surveyor_gui | train | rb |
5bd6bc57301d3a187923daf8cc44564dc0354f48 | diff --git a/bika/lims/browser/fields/uidreferencefield.py b/bika/lims/browser/fields/uidreferencefield.py
index <HASH>..<HASH> 100644
--- a/bika/lims/browser/fields/uidreferencefield.py
+++ b/bika/lims/browser/fields/uidreferencefield.py
@@ -101,6 +101,8 @@ class UIDReferenceField(StringField):
:rtype: BaseContent | list[BaseContent]
"""
value = StringField.get(self, context, **kwargs)
+ if not value:
+ return [] if self.multiValued else None
if self.multiValued:
# Only return objects which actually exist; this is necessary here
# because there are no HoldingReferences. This opens the
@@ -125,6 +127,8 @@ class UIDReferenceField(StringField):
:rtype: string | list[string]
"""
value = StringField.get(self, context, **kwargs)
+ if not value:
+ return [] if self.multiValued else None
if self.multiValued:
ret = value
else: | Remove verbosity of UIDReference.get when no value is assigned | senaite_senaite.core | train | py |
3804d38c6d654880ec642862f1819c97c7f426e6 | diff --git a/shared/chat/conversation/messages/message-popup/header.js b/shared/chat/conversation/messages/message-popup/header.js
index <HASH>..<HASH> 100644
--- a/shared/chat/conversation/messages/message-popup/header.js
+++ b/shared/chat/conversation/messages/message-popup/header.js
@@ -76,7 +76,7 @@ const MessagePopupHeader = (props: {
</Kb.Text>
</Kb.Box>
<Kb.Text type="BodySmall">{formatTimeForPopup(timestamp)}</Kb.Text>
- {deviceRevokedAt && (
+ {!!deviceRevokedAt && (
<Kb.Box2
gap="small"
fullWidth={true} | Fix mobile crasher (#<I>) | keybase_client | train | js |
084fa910d07cef6ef70be7da60e6f1c978dc4eef | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -75,7 +75,8 @@ function load(filename) {
/**
* Get a function that a client can use to update metadata with authentication
- * information from a Google Auth credential object.
+ * information from a Google Auth credential object, which comes from the
+ * googleauth library.
* @param {Object} credential The credential object to use
* @return {function(Object, callback)} Metadata updater function
*/ | Added comment about where Google credentials come from | grpc_grpc-node | train | js |
64172a6e9fb83824a8d364f3021f09482f6e7731 | diff --git a/py3status/modules/xrandr_rotate.py b/py3status/modules/xrandr_rotate.py
index <HASH>..<HASH> 100644
--- a/py3status/modules/xrandr_rotate.py
+++ b/py3status/modules/xrandr_rotate.py
@@ -58,6 +58,9 @@ class Py3status:
vertical_icon = 'V'
vertical_rotation = 'left'
+ def __init__(self):
+ self.displayed = ''
+
def _call(self, cmd):
process = Popen(cmd, stdout=PIPE, shell=True)
output = process.communicate()[0] or ""
@@ -106,9 +109,10 @@ class Py3status:
all_outputs = self._get_all_outputs()
selected_screen_disconnected = self.screen is not None and self.screen not in all_outputs
if selected_screen_disconnected and self.hide_if_disconnected:
+ self.displayed = ''
full_text = ''
else:
- if not hasattr(self, 'displayed'):
+ if not self.displayed:
self.displayed = self._get_current_rotation_icon(all_outputs)
screen = self.screen or all_outputs[0] if len(all_outputs) == 1 else 'ALL' | Fix not initialized 'displayed' field in xrandr_rotate | ultrabug_py3status | train | py |
32b5ecfbd3bb7a3d88e555d30d24f146f4379133 | diff --git a/src/helpers/DiffHelper.php b/src/helpers/DiffHelper.php
index <HASH>..<HASH> 100644
--- a/src/helpers/DiffHelper.php
+++ b/src/helpers/DiffHelper.php
@@ -16,11 +16,13 @@ class DiffHelper
}
$content = '<div class="pull-right">';
- $content .= '<span class="badge ' . $class . '" style="font-size:0.9em">';
- $content .= '<b>' . intval($arg1) . '</b> ';
+ $content .= '<span class="badge" style="font-size:0.9em">';
+ $content .= '<b>' . intval($arg1) . '</b>';
+ $content .= '</span> ';
+ $content .= '<span class="badge ' . $class . '" style="font-size:0.8em">';
$content .= '<i>';
- if ($diff > 0) {
+ if ($diff >= 0) {
$content .= '+';
}
$content .= round($diff, 2); | Making dashboard diffs a bit more readable | remp2020_crm-application-module | train | php |
9ac053ac7b173bc53547d577f4e6954b46870f8c | diff --git a/host/scan_analog.py b/host/scan_analog.py
index <HASH>..<HASH> 100644
--- a/host/scan_analog.py
+++ b/host/scan_analog.py
@@ -12,7 +12,7 @@ class AnalogScan(ScanBase):
def __init__(self, config_file, definition_file=None, bit_file=None, device=None, scan_identifier="scan_analog", scan_data_path=None):
super(AnalogScan, self).__init__(config_file=config_file, definition_file=definition_file, bit_file=bit_file, device=device, scan_identifier=scan_identifier, scan_data_path=scan_data_path)
- def scan(self, mask_steps=3, repeat_command=100, scan_parameter='PlsrDAC', scan_parameter_value=180):
+ def scan(self, mask_steps=3, repeat_command=100, scan_parameter='PlsrDAC', scan_parameter_value=100):
'''Scan loop
Parameters | MAINT: should be <I> by default | SiLab-Bonn_pyBAR | train | py |
eba1ad6cbd3313d1a456e11449ef9da07f71390b | diff --git a/src/bezier/_curve_helpers.py b/src/bezier/_curve_helpers.py
index <HASH>..<HASH> 100644
--- a/src/bezier/_curve_helpers.py
+++ b/src/bezier/_curve_helpers.py
@@ -334,8 +334,10 @@ def _compute_length(nodes):
first_deriv = (num_nodes - 1) * (nodes[:, 1:] - nodes[:, :-1])
if num_nodes == 0:
raise ValueError("Curve should have at least one node.")
- elif num_nodes == 1:
+
+ if num_nodes == 1:
return 0.0
+
if num_nodes == 2:
# NOTE: We convert to 1D to make sure NumPy uses vector norm.
return np.linalg.norm(first_deriv[:, 0], ord=2) | Fixing lint error (unnecessary else after raise/return). | dhermes_bezier | train | py |
73dc376b6a4fbde2af653fa4400cdd725a58d71d | diff --git a/src/ToastContainer.js b/src/ToastContainer.js
index <HASH>..<HASH> 100644
--- a/src/ToastContainer.js
+++ b/src/ToastContainer.js
@@ -78,7 +78,12 @@ module.exports = React.createClass({
toastId,
key,
ref: `toasts__${ key }`,
- handleOnClick: this._handle_toast_on_click,
+ handleOnClick: (e) => {
+ if ("function" === typeof optionsOverride.handleOnClick) {
+ optionsOverride.handleOnClick();
+ }
+ return this._handle_toast_on_click(e);
+ },
handleRemove: this._handle_toast_remove,
},
}); | feat(ToastContainer): add support for optionsOverride.handleOnClick
* So react component actions can be dispatched
* Closes #<I>
* Original | tomchentw_react-toastr | train | js |
3dec89d5d692ab0fabf85b22a20e7e030bb4635a | diff --git a/core/src/main/java/org/jboss/jca/core/connectionmanager/listener/TxConnectionListener.java b/core/src/main/java/org/jboss/jca/core/connectionmanager/listener/TxConnectionListener.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/jboss/jca/core/connectionmanager/listener/TxConnectionListener.java
+++ b/core/src/main/java/org/jboss/jca/core/connectionmanager/listener/TxConnectionListener.java
@@ -177,7 +177,7 @@ public class TxConnectionListener extends AbstractConnectionListener
else
{
StringTokenizer st = new StringTokenizer(value, ",");
- while (doDelistResource && st.hasMoreTokens())
+ while (doSetRollbackOnly && st.hasMoreTokens())
{
if (getPool().getName().equals(st.nextToken()))
doSetRollbackOnly = false; | JBJCA-<I> fixing the condition with doSetRollbackOnly boolean (#<I>) | ironjacamar_ironjacamar | train | java |
fb5c1141b68d80bfbac4c91a03149f7c49b9b103 | diff --git a/wtforms_html5.py b/wtforms_html5.py
index <HASH>..<HASH> 100644
--- a/wtforms_html5.py
+++ b/wtforms_html5.py
@@ -1,3 +1,5 @@
+# -*- coding: UTF-8 -*-
+
"""
Generates render keywords for widgets of WTForms HTML5 fields. | added encoding for py<I> support | brutus_wtforms-html5 | train | py |
d6864e52f96a58dbc62d3db49f67bb5e9d58880c | diff --git a/zappa/handler.py b/zappa/handler.py
index <HASH>..<HASH> 100644
--- a/zappa/handler.py
+++ b/zappa/handler.py
@@ -9,6 +9,7 @@ import json
import inspect
import collections
import zipfile
+import base64
import boto3
import sys
@@ -457,8 +458,14 @@ class LambdaHandler(object):
zappa_returndict['headers'] = {}
for key, value in response.headers:
zappa_returndict['headers'][key] = value
+
if settings.BINARY_SUPPORT:
- zappa_returndict["isBase64Encoded"] = "true"
+ try:
+ base64.b64decode(zappa_returndict['body'])
+ zappa_returndict["isBase64Encoded"] = "true"
+ except BaseException:
+ pass
+
# To ensure correct status codes, we need to
# pack the response as a deterministic B64 string and raise it
# as an error to match our APIGW regex. | fixed error when using this for normal HTTP endpoints. | Miserlou_Zappa | train | py |
fe9ccdf21a8e6af72fd5e2eb1ff36e6d8003ee32 | diff --git a/p2p/transport/websocket/conn_browser.go b/p2p/transport/websocket/conn_browser.go
index <HASH>..<HASH> 100644
--- a/p2p/transport/websocket/conn_browser.go
+++ b/p2p/transport/websocket/conn_browser.go
@@ -64,22 +64,21 @@ func (c *Conn) Read(b []byte) (int, error) {
for {
c.currDataMut.RLock()
- n, err := c.currData.Read(b)
+ n, _ := c.currData.Read(b)
c.currDataMut.RUnlock()
- if err != nil && err != io.EOF {
- // Return any unexpected errors immediately.
- return n, err
- } else if n == 0 || err == io.EOF {
- // There is no data ready to be read. Wait for more data or for the
- // connection to be closed.
- select {
- case <-c.dataSignal:
- continue
- case <-c.closeSignal:
- return c.readAfterErr(b)
- }
- } else {
- return n, err
+
+ if n != 0 {
+ // Data was ready. Return the number of bytes read.
+ return n, nil
+ }
+
+ // There is no data ready to be read. Wait for more data or for the
+ // connection to be closed.
+ select {
+ case <-c.dataSignal:
+ continue
+ case <-c.closeSignal:
+ return c.readAfterErr(b)
}
}
} | Simplify Conn.Read logic | libp2p_go-libp2p | train | go |
5b6de53b18a037a5b3ba0c20e7472ccbf1afccba | diff --git a/Editor/src/com/kotcrab/vis/editor/module/project/FontCacheModule.java b/Editor/src/com/kotcrab/vis/editor/module/project/FontCacheModule.java
index <HASH>..<HASH> 100644
--- a/Editor/src/com/kotcrab/vis/editor/module/project/FontCacheModule.java
+++ b/Editor/src/com/kotcrab/vis/editor/module/project/FontCacheModule.java
@@ -34,7 +34,7 @@ public class FontCacheModule extends ProjectModule implements WatchListener {
public static final int MIN_FONT_SIZE = 5;
public static final int DEFAULT_FONT_SIZE = 20;
- public static final String DEFAULT_TEXT = "Quick fox jumps over the lazy dog";
+ public static final String DEFAULT_TEXT = "Thq quick brown fox jumps over the lazy dog";
private FileAccessModule fileAccess;
private AssetsWatcherModule watcherModule; | Change default text to actually include all letters | kotcrab_vis-ui | train | java |
bb81275e62d11234dff1d944fc0f10e92dcb209d | diff --git a/shared/util/feature-flags.native.js b/shared/util/feature-flags.native.js
index <HASH>..<HASH> 100644
--- a/shared/util/feature-flags.native.js
+++ b/shared/util/feature-flags.native.js
@@ -17,7 +17,7 @@ const ff: FeatureFlags = {
newTeamBuildingForChatAllowMakeTeam: false,
outOfDateBanner: false,
plansEnabled: false,
- useNewRouter: true,
+ useNewRouter: false,
walletsEnabled: true,
} | no new router on master (#<I>) | keybase_client | train | js |
2d29e1ab5da130dca41d380d2047aad0c7f5699f | diff --git a/lib/acts_as_revisable/acts/deletable.rb b/lib/acts_as_revisable/acts/deletable.rb
index <HASH>..<HASH> 100644
--- a/lib/acts_as_revisable/acts/deletable.rb
+++ b/lib/acts_as_revisable/acts/deletable.rb
@@ -2,6 +2,9 @@ module WithoutScope
module ActsAsRevisable
module Deletable
def self.included(base)
+ base.instance_eval do
+ define_callbacks :before_revise_on_destroy, :after_revise_on_destroy
+ end
end
def destroy
@@ -19,7 +22,11 @@ module WithoutScope
end
self.revisable_revised_at = self.revisable_deleted_at
- self.save(:without_revision => true)
+
+ return false unless run_callbacks(:before_revise_on_destroy) { |r, o| r == false}
+ returning(self.save(:without_revision => true)) do
+ run_callbacks(:after_revise_on_destroy)
+ end
end
end
end | add callbacks for revisions created on destroy | rich_acts_as_revisable | train | rb |
119e406bbedc48d18767fbb1125866fd2bfa7861 | diff --git a/parsers/AcfunFormat.js b/parsers/AcfunFormat.js
index <HASH>..<HASH> 100644
--- a/parsers/AcfunFormat.js
+++ b/parsers/AcfunFormat.js
@@ -43,7 +43,7 @@ function AcfunParser(jsond){
console.log('[Dbg] ' + data.text);
continue;
}
- data.text = x.n.replace(/\r/g,"\n");
+ data.text = x.n; /*.replace(/\r/g,"\n");*/
data.text = data.text.replace(/\ /g,"\u00a0");
console.log(data.text);
if(x.p != null){ | Fixed AcFun parser to not change \r to \n | jabbany_CommentCoreLibrary | train | js |
e99a0c5bc9d920b5d1780e81d7ed8d61f0737384 | diff --git a/pyensembl/ensembl_release.py b/pyensembl/ensembl_release.py
index <HASH>..<HASH> 100644
--- a/pyensembl/ensembl_release.py
+++ b/pyensembl/ensembl_release.py
@@ -44,6 +44,10 @@ class EnsemblRelease(Genome):
species = check_species_object(species)
return (release, species, server)
+ # Using a WeakValueDictionary instead of an ordinary dict to prevent a
+ # memory leak in cases where we test many different releases in sequence.
+ # When all the references to a particular EnsemblRelease die then that
+ # genome should also be removed from this cache.
_genome_cache = WeakValueDictionary()
@classmethod | added comment explaining use of WeakValueDictionary | openvax_pyensembl | train | py |
588f3046dbd13e737f5e9c665b981dfaa401e6ab | diff --git a/tests/__init__.py b/tests/__init__.py
index <HASH>..<HASH> 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -9,11 +9,15 @@ __author__ = 'Edgar Walker, Fabian Sinz, Dimitri Yatsenko'
import logging
from os import environ
+
+# turn on verbose logging
+logging.basicConfig(level=logging.DEBUG)
+
import datajoint as dj
__all__ = ['__author__', 'PREFIX', 'CONN_INFO']
-logging.basicConfig(level=logging.DEBUG)
+
# Connection for testing
CONN_INFO = dict(
@@ -27,11 +31,10 @@ PREFIX = environ.get('DJ_TEST_DB_PREFIX', 'djtest')
def setup_package():
"""
Package-level unit test setup
- :return:
+ Turns off safemode
"""
dj.config['safemode'] = False
-
def teardown_package():
"""
Package-level unit test teardown. | move logging verbosity to top | datajoint_datajoint-python | train | py |
bf708aa824bf082f7041039dd1e9c1a3c8a0ef7b | diff --git a/framework/yii/db/pgsql/Schema.php b/framework/yii/db/pgsql/Schema.php
index <HASH>..<HASH> 100644
--- a/framework/yii/db/pgsql/Schema.php
+++ b/framework/yii/db/pgsql/Schema.php
@@ -225,7 +225,7 @@ SQL;
}
$citem = [$foreignTable];
foreach ($columns as $idx => $column) {
- $citem[$fcolumns[$idx]] = $column;
+ $citem[$column] = $fcolumns[$idx];
}
$table->foreignKeys[] = $citem;
} | Fixes #<I>: foreign key is incorrectly determined for pgsql. | yiisoft_yii2-debug | train | php |
5f83cd879e69ae64c5bd361a6e0e6b6fbc96df46 | diff --git a/website/siteConfig.js b/website/siteConfig.js
index <HASH>..<HASH> 100644
--- a/website/siteConfig.js
+++ b/website/siteConfig.js
@@ -37,7 +37,7 @@ const siteConfig = {
{doc: 'design/index', label: 'Docs'},
{href: '/community/', label: 'Community'},
{href: 'https://www.apache.org', label: 'Apache'},
- {href: '/download.html', label: 'Download'},
+ {href: '/downloads.html', label: 'Download'},
],
/* path to images for header/footer */ | Fix download link in header links (#<I>) | apache_incubator-druid | train | js |
1f11bf0a33e9b468fe4f7203bdb3a58f4fd75299 | diff --git a/richtextfx/src/main/java/org/fxmisc/richtext/model/SegmentOpsBase.java b/richtextfx/src/main/java/org/fxmisc/richtext/model/SegmentOpsBase.java
index <HASH>..<HASH> 100644
--- a/richtextfx/src/main/java/org/fxmisc/richtext/model/SegmentOpsBase.java
+++ b/richtextfx/src/main/java/org/fxmisc/richtext/model/SegmentOpsBase.java
@@ -32,7 +32,7 @@ public abstract class SegmentOpsBase<SEG, S> implements SegmentOps<SEG, S> {
@Override
public final String getText(SEG seg) {
- return seg == empty ? "\0" : realGetText(seg);
+ return seg == empty ? "" : realGetText(seg);
}
public abstract String realGetText(SEG seg); | Fix bug: empty segment has no text | FXMisc_RichTextFX | train | java |
4aa115f67741bdf2284a78816112ffd4b02d462f | diff --git a/packages/hoc-input/src/index.js b/packages/hoc-input/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/hoc-input/src/index.js
+++ b/packages/hoc-input/src/index.js
@@ -1 +1,2 @@
export { default, formInputProps } from "./formInput";
+export { default as styledInput } from "./styledComponents/Wrapper"; | feat(hoc-input): export the wrapper style as part of the lib
affects: @crave/farmblocks-hoc-input | CraveFood_farmblocks | train | js |
e150429296bd555df06f7f0ef59d3e92bdbda9a1 | diff --git a/tests/test_main.py b/tests/test_main.py
index <HASH>..<HASH> 100755
--- a/tests/test_main.py
+++ b/tests/test_main.py
@@ -4474,6 +4474,34 @@ def test_blackwing_corruptor():
assert game.player1.hero.health == 27
+def test_crackle():
+ game = prepare_game(SHAMAN, SHAMAN)
+ crackle = game.player1.give("GVG_038")
+ crackle.play(target=game.player2.hero)
+ assert game.player2.hero.health in (24, 25, 26, 27)
+ assert game.player1.overloaded == 1
+
+
+def test_crackle_malygos():
+ game = prepare_game(SHAMAN, SHAMAN)
+ malygos = game.player1.give("EX1_563")
+ malygos.play()
+ game.end_turn(); game.end_turn()
+
+ crackle = game.player1.give("GVG_038")
+ crackle.play(target=game.player2.hero)
+ assert game.player2.hero.health in (19, 20, 21, 22)
+ assert game.player1.overloaded == 1
+
+
+def test_i_am_murloc():
+ game = prepare_game()
+ iammurloc = game.player1.give("PRO_001a")
+ iammurloc.play()
+ assert len(game.player1.field) in (3, 4, 5)
+ assert game.player1.field[0].id == "PRO_001at"
+
+
def main():
for name, f in globals().items():
if name.startswith("test_") and callable(f): | Add tests for Crackle and I Am Murloc | jleclanche_fireplace | train | py |
c4890d949bb975a9824ecabd9c64d678ac9c6293 | diff --git a/cmd/admin-trace.go b/cmd/admin-trace.go
index <HASH>..<HASH> 100644
--- a/cmd/admin-trace.go
+++ b/cmd/admin-trace.go
@@ -111,7 +111,7 @@ EXAMPLES:
`,
}
-const timeFormat = "15:04:05.000"
+const timeFormat = "2006-01-02T15:04:05:000"
var (
colors = []color.Attribute{color.FgCyan, color.FgWhite, color.FgYellow, color.FgGreen} | trace: display time in UTC format (#<I>) | minio_mc | train | go |
2b40ce8d70b4d16544933d402ef0e30cf72d0cb9 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,7 @@ with open('requirements.txt') as f:
setuptools.setup(
name="luthor-for-lex",
- version='0.0.11',
+ version='0.0.12.dev0',
author="Troy Larson",
author_email="troylar@gmail.com",
description="Easy Lex bot manager", | Back to development: <I> | troylar_luthor-for-lex | train | py |
fcc78dae1f7ecef76abacadc98657d5780a713f0 | diff --git a/modules_v4/example-theme.disable/module.php b/modules_v4/example-theme.disable/module.php
index <HASH>..<HASH> 100644
--- a/modules_v4/example-theme.disable/module.php
+++ b/modules_v4/example-theme.disable/module.php
@@ -20,8 +20,7 @@ use const PATHINFO_EXTENSION;
* Example theme. Here we are extending an existing theme.
* Instead, you could extend AbstractModule and implement ModuleThemeInterface directly.
*/
-return new class extends MinimalTheme implements ModuleCustomInterface
-{
+return new class extends MinimalTheme implements ModuleCustomInterface {
use ModuleCustomTrait;
/** | Apply fixes from StyleCI (#<I>) | fisharebest_webtrees | train | php |
b337905bfeaef123fd9a59b4c8510863a881b8df | diff --git a/goldman/response.py b/goldman/response.py
index <HASH>..<HASH> 100644
--- a/goldman/response.py
+++ b/goldman/response.py
@@ -17,6 +17,31 @@ class Response(FalconResponse):
super(Response, self).__init__(*args, **kwargs)
self.serializer = None
+ self._init_default_headers()
+
+ def _init_default_headers(self):
+ """ Initialize the response object with default headers
+
+ A summary of the rational behind adding the headers
+ by default is detailed below.
+
+ Vary Header
+ ~~~~~~~~~~~
+
+ The `Vary` header will let caches know which request
+ headers should be considered when looking up a cached
+ document.
+
+ The `Vary` header should specify `Accept` since our
+ resources commonly support multiple representations
+ of the data (serializers). The representation is
+ determined by the Accept header.
+
+ The `Vary` header should specify `Prefer` according
+ to RFC 7240.
+ """
+
+ self.set_header('Vary', 'Accept, Prefer')
def disable_caching(self):
""" Add some headers so the client won't cache the response | include a Vary header on our responses by default
The value is currently 'Accept, Prefer' & the comments in the commit
describe the rational | sassoo_goldman | train | py |
c33f3b34bad9a7bc44dccb2c27b2f33dd5bb9c07 | diff --git a/test/regression/issue_4383.py b/test/regression/issue_4383.py
index <HASH>..<HASH> 100755
--- a/test/regression/issue_4383.py
+++ b/test/regression/issue_4383.py
@@ -55,10 +55,18 @@ with driver.Cluster(initial_servers=['source1', 'source2', 'target'], output_fol
}).run(conn)
utils.print_with_time("Waiting a few seconds for backfill to get going")
- time.sleep(2)
- status = tbl.status().run(conn)
- assert status["status"]["ready_for_writes"] == True, 'Table is not ready for writes:\n' + pprint.pformat(status)
- assert status["status"]["all_replicas_ready"] == False, 'All replicas incorrectly reporting ready:\n' + pprint.pformat(status)
+ deadline = time.time() + 2
+ while True:
+ status = tbl.status().run(conn)
+ try:
+ assert status["status"]["ready_for_writes"] == True, 'Table is not ready for writes:\n' + pprint.pformat(status)
+ assert status["status"]["all_replicas_ready"] == False, 'All replicas incorrectly reporting ready:\n' + pprint.pformat(status)
+ break
+ except AssertionError:
+ if time.time() > deadline:
+ raise
+ else:
+ time.sleep(.05)
utils.print_with_time("Shutting down servers")
cluster.check_and_stop() | makign regression/issue_<I> less timing dependent | rethinkdb_rethinkdb | train | py |
8cd6163975c6c0cf2ac776d87ffef8f4c16f5668 | diff --git a/ecell4/deprecated.py b/ecell4/deprecated.py
index <HASH>..<HASH> 100644
--- a/ecell4/deprecated.py
+++ b/ecell4/deprecated.py
@@ -16,7 +16,11 @@ def deprecated(suggest=None):
doc = "[Deprecated]\n"
else:
doc = "[Deprecated] Use '" + suggest + "' instead.\n"
- wrapper.__doc__ = doc + wrapper.__doc__
+
+ if wrapper.__doc__ is None:
+ wrapper.__doc__ = doc
+ else:
+ wrapper.__doc__ = doc + wrapper.__doc__
return wrapper
return decorator | fix: Check whether the original docstring is not None when deprecated | ecell_ecell4 | train | py |
08e3c14c67e6d58eb642073ce676849a9198d911 | diff --git a/app/resonant-reference-app/Router.js b/app/resonant-reference-app/Router.js
index <HASH>..<HASH> 100644
--- a/app/resonant-reference-app/Router.js
+++ b/app/resonant-reference-app/Router.js
@@ -90,6 +90,7 @@ var Router = Backbone.Router.extend({
window.mainPage.switchToolchain(toolchainId)
.then(() => {
window.mainPage.widgetPanels.setWidgets(params.widgets);
+ window.mainPage.overlay.closeOverlay();
});
} else if (changedToolchain) {
// The user didn't change the widgets that were
@@ -100,10 +101,12 @@ var Router = Backbone.Router.extend({
.then(() => {
window.mainPage.widgetPanels.setWidgets(
window.mainPage.toolchain.getMeta('preferredWidgets'));
+ window.mainPage.overlay.closeOverlay();
});
} else if (changedWidgets) {
// We're only changing which widgets should be open
window.mainPage.widgetPanels.setWidgets(params.widgets);
+ window.mainPage.overlay.closeOverlay();
}
}
}, | Close the overlay when URLs are pasted | Kitware_candela | train | js |
f6be26e4b58bc70920f272ef850b9a9f6f8dc9d5 | diff --git a/test/complex.js b/test/complex.js
index <HASH>..<HASH> 100644
--- a/test/complex.js
+++ b/test/complex.js
@@ -332,7 +332,7 @@ describe('Complex Queue', function() {
})
it('drain should still work with persistent queues', function (done) {
- var initialQueue = new Queue(function (n, cb) {
+ var q = new Queue(function (n, cb) {
setTimeout(cb, 1);
}, {
store: {
@@ -342,17 +342,12 @@ describe('Complex Queue', function() {
}
})
var drained = false;
- initialQueue.on('drain', function () {
+ q.on('drain', function () {
drained = true;
- });
- initialQueue.push(1);
-
- setTimeout(function () {
- initialQueue.destroy();
-
- assert.ok(drained);
done();
- }, 20)
+ });
+ q.push(1);
+ this.q = q;
})
it('drain should still work when there are persisted items at load time', function (done) { | Not sure why travis is complaining... | diamondio_better-queue | train | js |
01342788496f46b47f075950fde2d15ec3a375ff | diff --git a/openquake/calculators/classical.py b/openquake/calculators/classical.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/classical.py
+++ b/openquake/calculators/classical.py
@@ -185,6 +185,7 @@ def classical(sources, src_filter, gsims, param, monitor):
truncation_level = param['truncation_level']
imtls = param['imtls']
src_group_id = sources[0].src_group_id
+ assert src_group_id is not None
# sanity check: the src_group must be the same for all sources
for src in sources[1:]:
assert src.src_group_id == src_group_id
diff --git a/openquake/calculators/reportwriter.py b/openquake/calculators/reportwriter.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/reportwriter.py
+++ b/openquake/calculators/reportwriter.py
@@ -27,9 +27,8 @@ import sys
import ast
import mock
import time
-import operator
-from openquake.baselib import parallel, general
+from openquake.baselib import parallel
from openquake.baselib.general import humansize, AccumDict
from openquake.baselib.python3compat import encode
from openquake.commonlib import readinput, source | Cleanup [skip CI] | gem_oq-engine | train | py,py |
1a7a56a70629ca086ef7939af9a0c92351fd01db | diff --git a/src/playbacks/hls/hls.js b/src/playbacks/hls/hls.js
index <HASH>..<HASH> 100644
--- a/src/playbacks/hls/hls.js
+++ b/src/playbacks/hls/hls.js
@@ -230,6 +230,7 @@ class HLS extends Playback {
if (this.dvrInUse !== previousDvrInUse) {
this.updateSettings()
this.trigger('playback:dvr', this.dvrInUse)
+ this.trigger('playback:stats:add', {'dvr': this.dvrInUse})
}
} | hls: dispatch dvrInUse stats (close #<I>) | clappr_clappr | train | js |
989419d9af9a8a87ba40188f64d97dd267b3f6a7 | diff --git a/src/app/drivers/options.py b/src/app/drivers/options.py
index <HASH>..<HASH> 100644
--- a/src/app/drivers/options.py
+++ b/src/app/drivers/options.py
@@ -486,6 +486,6 @@ peptable_options.update({
'phosphorylation from the protein expression variation in the sample. '
'This file can also be a gene names or ENSG table. Accession should be '
'in the first column. The file is preferably generated from a search '
- 'without the relevant PTM, and should not be normalized to channel '
- 'medians'},
+ 'without the relevant PTM, and can be a median-center normalized table. '
+ },
}) | Correction in options help, it is not a bad idea to total-protein-correct with a median-centered protein table | glormph_msstitch | train | py |
9f77c2af26352f060b8d1016f9d9a554914ecc58 | diff --git a/lib/gzipped_tar/reader.rb b/lib/gzipped_tar/reader.rb
index <HASH>..<HASH> 100644
--- a/lib/gzipped_tar/reader.rb
+++ b/lib/gzipped_tar/reader.rb
@@ -10,8 +10,9 @@ module GZippedTar
end
def read(path)
- result = reader.detect { |entry| entry.full_name == path }
- result && result.read
+ result = nil
+ reader.each { |entry| result = entry.read if entry.full_name == path }
+ result
ensure
reader.rewind
end | Tar results don't include Enumerable in old Rubygems.
Also, we need to read the value while enumerating, rather than afterwards. | pat_gzipped_tar | train | rb |
4833bcafd4a0ae086c1ac2a431956d129fecb27e | diff --git a/ninja-appengine-module/src/main/java/ninja/appengine/NinjaAppengineEnvironmentImpl.java b/ninja-appengine-module/src/main/java/ninja/appengine/NinjaAppengineEnvironmentImpl.java
index <HASH>..<HASH> 100644
--- a/ninja-appengine-module/src/main/java/ninja/appengine/NinjaAppengineEnvironmentImpl.java
+++ b/ninja-appengine-module/src/main/java/ninja/appengine/NinjaAppengineEnvironmentImpl.java
@@ -79,6 +79,9 @@ public class NinjaAppengineEnvironmentImpl implements
proxy.setProperty(LocalDatastoreService.NO_STORAGE_PROPERTY,
Boolean.toString(true));
+ proxy.setProperty(LocalDatastoreService.FORCE_IS_HIGH_REP_PROPERTY,
+ Boolean.toString(true));
+
proxy.setProperty(LocalSearchService.USE_RAM_DIRECTORY,
Boolean.toString(true)); | force high replication datastore in test mode | ninjaframework_ninja-appengine | train | java |
6da1af90467aadc1d89c7a8c1d36a4a811df85fe | diff --git a/vdf/__init__.py b/vdf/__init__.py
index <HASH>..<HASH> 100644
--- a/vdf/__init__.py
+++ b/vdf/__init__.py
@@ -89,7 +89,7 @@ def parse(fp, mapper=dict, merge_duplicate_keys=True, escaped=True):
re_keyvalue = re.compile(r'^("(?P<qkey>(?:\\.|[^\\"])+)"|(?P<key>#?[a-z0-9\-\_\\\?$%]+))'
r'([ \t]*('
r'"(?P<qval>(?:\\.|[^\\"])*)(?P<vq_end>")?'
- r'|(?P<val>[a-z0-9\-\_\\\?\*\.]+)'
+ r'|(?P<val>(?:(?<!/)/(?!/)|[a-z0-9\-\_\\\?\*\.])+)'
r'))?',
flags=re.I) | Added support for single / inside unquoted values | ValvePython_vdf | train | py |
d8bdb19c0ec665c5ced27f3c07fe8fc47ff1573a | diff --git a/dataviews/plots.py b/dataviews/plots.py
index <HASH>..<HASH> 100644
--- a/dataviews/plots.py
+++ b/dataviews/plots.py
@@ -1459,7 +1459,7 @@ class ScatterPlot(CurvePlot):
self._stack = self._check_stack(points, Scatter)
self.ax = None
- super(ScatterPlot, self).__init__(zorder, **kwargs)
+ Plot.__init__(self, zorder, **kwargs)
def __call__(self, axis=None, cyclic_index=0, lbrt=None): | Fixed bug in ScatterPlot, not allowing display of unstacked View | pyviz_holoviews | train | py |
10211b0c0d5d2a74bae7d52465a13e2a1c5d81f1 | diff --git a/pyarlo/__init__.py b/pyarlo/__init__.py
index <HASH>..<HASH> 100644
--- a/pyarlo/__init__.py
+++ b/pyarlo/__init__.py
@@ -184,7 +184,8 @@ class PyArlo(object):
device.get('state') == 'provisioned':
base = ArloBaseStation(name, device, self.__token, self)
devices['base_station'].append(base)
- self.__base_stations.append(base)
+ if base not in self.__base_stations:
+ self.__base_stations.append(base)
return devices | Fixes memory leak on self.__base_stations list (#<I>) | tchellomello_python-arlo | train | py |
7a2f17c007c18d152fa3a1fcf5e06fc4dac902f1 | diff --git a/lib/model-api/renderer.rb b/lib/model-api/renderer.rb
index <HASH>..<HASH> 100644
--- a/lib/model-api/renderer.rb
+++ b/lib/model-api/renderer.rb
@@ -85,7 +85,7 @@ module ModelApi
end
end
opts = ModelApi::Utils.contextual_metadata_opts(attr_metadata, opts)
- opts[:operation] = :show
+ opts[:operation] ||= :show
if value.respond_to?(:map)
return value.map do |elem|
elem.is_a?(ActiveRecord::Base) ? serializable_object(elem, opts) : elem | Bug fix for issue whereby current operation was getting corrupted rendering nested objects. | PrecisionHawk_model-api | train | rb |
f816987edca374f144b175540cafbcd4e134c65e | diff --git a/src/Mpociot/BotMan/Button.php b/src/Mpociot/BotMan/Button.php
index <HASH>..<HASH> 100644
--- a/src/Mpociot/BotMan/Button.php
+++ b/src/Mpociot/BotMan/Button.php
@@ -96,4 +96,4 @@ class Button implements JsonSerializable
{
return $this->toArray();
}
-}
\ No newline at end of file
+} | Apply fixes from StyleCI (#<I>) | botman_botman | train | php |
76016ad4e1c20b49cd94c0b9f3fdc0b5c783ed27 | diff --git a/pypot/server/snap.py b/pypot/server/snap.py
index <HASH>..<HASH> 100644
--- a/pypot/server/snap.py
+++ b/pypot/server/snap.py
@@ -151,17 +151,17 @@ class SnapRobotServer(AbstractServer):
return rr.get_primitive_properties_list(primitive)
# Hacks (no restfull) to record movements
- # TODO allow to choose motors motors
@self.app.get('/primitive/MoveRecorder/<move_name>/start')
@make_snap_compatible_response
def start_move_recorder(move_name):
rr.start_move_recorder(move_name, rr.get_motors_list('motors'))
return 'Done!'
- @self.app.get('/primitive/MoveRecorder/<move_name>/start/')
+ @self.app.get('/primitive/MoveRecorder/<move_name>/start/<motors>')
@make_snap_compatible_response
- def start_move_recorder(move_name):
- rr.start_move_recorder(move_name, rr.get_motors_list('motors'))
+ def start_move_recorder(move_name,motors):
+ motors = [m for m in motors[:-1].split(';')]
+ rr.start_move_recorder(move_name, motors)
return 'Done!'
@self.app.get('/primitive/MoveRecorder/<move_name>/stop') | ajout multi motor recording in Snap! | poppy-project_pypot | train | py |
cfb19f48ac2eb558a39828c9290e26b166dc6e1d | diff --git a/pypump/models/collection.py b/pypump/models/collection.py
index <HASH>..<HASH> 100644
--- a/pypump/models/collection.py
+++ b/pypump/models/collection.py
@@ -23,7 +23,9 @@ _log = logging.getLogger(__name__)
class Collection(AbstractModel):
- def __init__(self, id):
+ def __init__(self, id=None, *args, **kwargs):
+ super(Collection, self).__init__(*args, **kwargs)
+
self.id = id
@property
@@ -78,6 +80,7 @@ class Collection(AbstractModel):
return "<{type}: {id}>".format(type=self.TYPE, id=self.id)
def unserialize(self, data):
+ self.id = data["id"] if "id" in data else None
self.display_name = data["displayName"] if "displayName" in data else None
self.content = data["content"] if "content" in data else None
self.links = dict() | Fix #<I> (collections) | xray7224_PyPump | train | py |
9d29f1ee543ae585119bfb2414186f559cbef99d | diff --git a/bin/samp-server-cli.py b/bin/samp-server-cli.py
index <HASH>..<HASH> 100755
--- a/bin/samp-server-cli.py
+++ b/bin/samp-server-cli.py
@@ -346,8 +346,22 @@ def main(argv):
config = options.pop('config')
if config is not None:
- shutil.copy(os.path.join(workdir, convert_path(config, workdir)),
- os.path.join(workdir, 'server.cfg'))
+ config_paths = [
+ os.path.join(workdir, 'configs', config),
+ os.path.join(workdir, 'configs', config + '.cfg'),
+ os.path.join(workdir, convert_path(config, workdir)),
+ os.path.join(workdir, convert_path(config, workdir) + '.cfg'),
+ ]
+ config_path = None
+ for path in config_paths:
+ if os.path.exists(path):
+ config_path = path
+ shutil.copy(path, os.path.join(workdir, 'server.cfg'))
+ break
+ if not config_path:
+ print('Could not find the config file. '
+ 'Tried the follwoing paths:\n- %s' % '\n- '.join(config_paths))
+ sys.exit(1)
no_config = options.pop('no_config')
no_launch = options.pop('no_launch') | Search for config file in <workdir>/configs/ | Zeex_samp-server-cli | train | py |
acd75c6a5daa41c70178baddd3d777ac1472a452 | diff --git a/lib/rack/test/uploaded_file.rb b/lib/rack/test/uploaded_file.rb
index <HASH>..<HASH> 100644
--- a/lib/rack/test/uploaded_file.rb
+++ b/lib/rack/test/uploaded_file.rb
@@ -57,9 +57,7 @@ module Rack
tempfile.rewind
buf = String.new
- until tempfile.eof?
- buffer << tempfile.readpartial(65536, buf)
- end
+ buffer << tempfile.readpartial(65_536, buf) until tempfile.eof?
tempfile.rewind | Satisfy pointless rubucop demands | rack-test_rack-test | train | rb |
6c0303dadf7a60c48127ce0c837c1678ecdc01a2 | diff --git a/src/test/java/org/jdbdt/DBSetupTest.java b/src/test/java/org/jdbdt/DBSetupTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/jdbdt/DBSetupTest.java
+++ b/src/test/java/org/jdbdt/DBSetupTest.java
@@ -57,6 +57,7 @@ public class DBSetupTest extends DBTestCase {
if (populate) {
populate(dataSet);
assertSame(dataSet,table.getSnapshot());
+ assertTrue(dataSet.isReadOnly());
}
else {
nExpected += getDAO().count(); | DBSetupTest: additional assertion to check if a data set becomes read-only
after being used with populate() | JDBDT_jdbdt | train | java |
70351009ac268210eb7d8b8ccfee9fc409e7e54e | diff --git a/src/Contao/View/Contao2BackendView/Subscriber/WidgetBuilder.php b/src/Contao/View/Contao2BackendView/Subscriber/WidgetBuilder.php
index <HASH>..<HASH> 100644
--- a/src/Contao/View/Contao2BackendView/Subscriber/WidgetBuilder.php
+++ b/src/Contao/View/Contao2BackendView/Subscriber/WidgetBuilder.php
@@ -201,7 +201,7 @@ class WidgetBuilder implements EnvironmentAwareInterface
}
// Check the class.
- if (CheckBox::class !== (new \ReflectionClass($strClass))->getName()) {
+ if (in_array(CheckBox::class, class_parents($strClass))) {
return true;
} | Not detected if the widget is a checkbox class with reflection #<I> | contao-community-alliance_dc-general | train | php |
21beb86f8fb38ff44b9cfa4668c4e67f95d8b344 | diff --git a/forms/gridfield/GridFieldAddNewButton.php b/forms/gridfield/GridFieldAddNewButton.php
index <HASH>..<HASH> 100644
--- a/forms/gridfield/GridFieldAddNewButton.php
+++ b/forms/gridfield/GridFieldAddNewButton.php
@@ -23,7 +23,7 @@ class GridFieldAddNewButton implements GridField_HTMLProvider {
public function getHTMLFragments($gridField) {
if(!$this->buttonName) {
// provide a default button name, can be changed by calling {@link setButtonName()} on this component
- $this->buttonName = _t('GridField.Add', 'Add {name}', array('name' => $gridField->getModelClass()));
+ $this->buttonName = _t('GridField.Add', 'Add {name}', array('name' => singleton($gridField->getModelClass())->singular_name()));
}
$data = new ArrayData(array( | MINOR Using localized name rather than model class for GridFieldAddNewButton UI (related to <I>d<I>cf and pull request #<I>) | silverstripe_silverstripe-framework | train | php |
969ab319f89dbf9abda83f30b32dc4c88388c5e1 | diff --git a/lib/dimples/version.rb b/lib/dimples/version.rb
index <HASH>..<HASH> 100644
--- a/lib/dimples/version.rb
+++ b/lib/dimples/version.rb
@@ -1,3 +1,3 @@
module Dimples
- VERSION = "0.1"
+ VERSION = "1.0.0"
end
\ No newline at end of file | Switched to semantic versioning. | waferbaby_dimples | train | rb |
4e4e0926da5500fe52a7afab1635f8df410c43ac | diff --git a/salt/utils/minions.py b/salt/utils/minions.py
index <HASH>..<HASH> 100644
--- a/salt/utils/minions.py
+++ b/salt/utils/minions.py
@@ -348,18 +348,18 @@ class CkMinions(object):
tgt = ipaddress.ip_network(tgt)
# Target is a network
proto = 'ipv{0}'.format(tgt.version)
- if proto not in self.opts['grains']:
+ if proto not in grains:
match = False
else:
- match = salt.utils.network.in_subnet(tgt, self.opts['grains'][proto])
+ match = salt.utils.network.in_subnet(tgt, grains[proto])
except: # pylint: disable=bare-except
try:
# Target should be an address
proto = 'ipv{0}'.format(ipaddress.ip_address(tgt).version)
- if proto not in self.opts['grains']:
+ if proto not in grains:
match = False
else:
- match = tgt in self.opts['grains'][proto]
+ match = tgt in grains[proto]
except: # pylint: disable=bare-except
log.error('Invalid IP/CIDR target {0}"'.format(tgt)) | Utilize prepared grains var in master-side ipcidr matching
At least partially fixes #<I> et al. (tnx @fantasy<I> for analysis) | saltstack_salt | train | py |
4ee7be97dcd2ef4fb5c044f0bf507bcf22b359c3 | diff --git a/src/PathReducer/WeightedRandomPathReducer.php b/src/PathReducer/WeightedRandomPathReducer.php
index <HASH>..<HASH> 100644
--- a/src/PathReducer/WeightedRandomPathReducer.php
+++ b/src/PathReducer/WeightedRandomPathReducer.php
@@ -31,14 +31,15 @@ class WeightedRandomPathReducer extends AbstractPathReducer
} finally {
if ($newPath->countVertices() === $path->countVertices()) {
$try = 1;
+ $maxTries = $path->countVertices();
$pathWeight = $this->rebuildPathWeight($path, $pathWeight);
}
else {
$this->updatePathWeight($pathWeight, $path, $i, $j);
}
+ $try++;
}
}
- $try++;
}
// Can not reduce the reproduce path (any more). | Improve weighted random path reducer | tienvx_mbt-bundle | train | php |
663d33e9b4d6bb488889a8ff6aa272cbb44cec10 | diff --git a/codalib/bagatom.py b/codalib/bagatom.py
index <HASH>..<HASH> 100644
--- a/codalib/bagatom.py
+++ b/codalib/bagatom.py
@@ -42,7 +42,8 @@ def wrapAtom(xml, id, title, author=None, updated=None, author_uri=None, alt=Non
entryTag,
ATOM + "link",
rel='alternate',
- href=alt)
+ href=alt,
+ type="text/html")
if updated != None:
updatedTag.text = updated.strftime(TIME_FORMAT_STRING)
diff --git a/tests/bagatom/test_makeObjectFeed.py b/tests/bagatom/test_makeObjectFeed.py
index <HASH>..<HASH> 100644
--- a/tests/bagatom/test_makeObjectFeed.py
+++ b/tests/bagatom/test_makeObjectFeed.py
@@ -49,6 +49,6 @@ def test_simpleFeed():
'/a:feed//a:entry/a:link[@rel="alternate"]',
namespaces={'a': atom_ns}
)
- print etree.tostring(feed.getroottree(), pretty_print=True)
assert len(elements) == 1
+ assert elements[0].attrib["type"] == "text/html" | added type attr to alternate links, added relevant assert in simple feed test | unt-libraries_codalib | train | py,py |
c388cbdce7a5c04be0a2b7fd8a8d562a598c9653 | diff --git a/plugin/summernote-ext-video.js b/plugin/summernote-ext-video.js
index <HASH>..<HASH> 100644
--- a/plugin/summernote-ext-video.js
+++ b/plugin/summernote-ext-video.js
@@ -94,6 +94,7 @@
.attr('width', '640').attr('height', '360');
} else {
// this is not a known video link. Now what, Cat? Now what?
+ return false;
}
return $video[0];
@@ -244,9 +245,14 @@
// restore range
editor.restoreRange($editable);
-
- // insert video node
- editor.insertNode($editable, createVideoNode(url));
+
+ // build node
+ var $node = createVideoNode(url);
+
+ if ($node) {
+ // insert video node
+ editor.insertNode($editable, $node);
+ }
}).fail(function () {
// when cancel button clicked
editor.restoreRange($editable); | Fixed video plugin for urls that don't match any of the video url patterns | summernote_summernote | train | js |
33a76aea37f2f790f45d3c1103cafe2c9945f654 | diff --git a/pyclustering/cluster/kmeans.py b/pyclustering/cluster/kmeans.py
index <HASH>..<HASH> 100755
--- a/pyclustering/cluster/kmeans.py
+++ b/pyclustering/cluster/kmeans.py
@@ -602,7 +602,10 @@ class kmeans:
maximum_change = float('inf')
else:
- changes = self.__metric(self.__centers, updated_centers)
+ if self.__metric.get_type() != type_metric.USER_DEFINED:
+ changes = self.__metric(self.__centers, updated_centers)
+ else:
+ changes = [self.__metric(center, updated_center) for center, updated_center in zip(self.__centers, updated_centers)]
maximum_change = numpy.max(changes)
return maximum_change | Fix kmeans for user defined metrics | annoviko_pyclustering | train | py |
aeab6cd578fa8e06c5683b8eebb69bff245a8aeb | diff --git a/python/bigdl/utils/common.py b/python/bigdl/utils/common.py
index <HASH>..<HASH> 100644
--- a/python/bigdl/utils/common.py
+++ b/python/bigdl/utils/common.py
@@ -283,14 +283,17 @@ def create_spark_conf():
sparkConf.setAll(bigdl_conf.items())
return sparkConf
-
def get_spark_context(conf = None):
"""
Get the current active spark context and create one if no active instance
:param conf: combining bigdl configs into spark conf
:return: SparkContext
"""
- with SparkContext._lock: # Compatible with Spark1.5.1
+ if hasattr(SparkContext, "getOrCreate"):
+ return SparkContext.getOrCreate(conf=conf or create_spark_conf())
+ else:
+ # Might have threading issue but we cann't add _lock here
+ # as it's not RLock in spark1.5
if SparkContext._active_spark_context is None:
SparkContext(conf=conf or create_spark_conf())
return SparkContext._active_spark_context | Ignore some folders from doctest scanning (#<I>)
* remove movielens downloading from unittest
* fix spark<I> Lock problem
* fix return | intel-analytics_BigDL | train | py |
8be2f63973a70e21f1d9c1dff777f5a11e8f9981 | diff --git a/backgrid-grouped-columns.js b/backgrid-grouped-columns.js
index <HASH>..<HASH> 100644
--- a/backgrid-grouped-columns.js
+++ b/backgrid-grouped-columns.js
@@ -117,6 +117,8 @@
});
});
+ column.set("childcolumn",true);
+
// Add main column
rows[colNesting.length].push(column.set("attributes", {
colspan: 1,
@@ -152,6 +154,12 @@
// Set attributes. Loop cells of rows.
_.each(self.headerRows, function(headerRow) {
_.each(headerRow.cells, function(cell) {
+ if(self.rotateChild && cell.column.get('childcolumn')){
+ cell.$el.addClass('rotate');
+ }
+ if(!cell.column.get('childcolumn') && cell.column.attributes.prefix) {
+ cell.$el.html(cell.column.attributes.prefix + cell.$el.html());
+ }
cell.$el.prop(cell.column.get("attributes"));
});
}); | - added option to rotate child header text
- ability to add prefix text to child header text | FortesSolutions_backgrid-grouped-columns | train | js |
6931f822faf92ec2ec32d3a5202de9ef16abcec3 | diff --git a/salt/engines/thorium.py b/salt/engines/thorium.py
index <HASH>..<HASH> 100644
--- a/salt/engines/thorium.py
+++ b/salt/engines/thorium.py
@@ -1,10 +1,7 @@
-# -*- coding: utf-8 -*-
"""
Manage the Thorium complex event reaction system
"""
-from __future__ import absolute_import, print_function, unicode_literals
-# Import salt libs
import salt.thorium | Drop Py2 and six on salt/engines/thorium.py | saltstack_salt | train | py |
3c7649932b235f0bee48b5113f0cfdd0e282d774 | diff --git a/spec/knapsack_pro/runners/queue/rspec_runner_spec.rb b/spec/knapsack_pro/runners/queue/rspec_runner_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/knapsack_pro/runners/queue/rspec_runner_spec.rb
+++ b/spec/knapsack_pro/runners/queue/rspec_runner_spec.rb
@@ -129,6 +129,36 @@ describe KnapsackPro::Runners::Queue::RSpecRunner do
subject
end
end
+
+ context 'when RSpec split by test examples feature is enabled' do
+ before do
+ expect(KnapsackPro::Config::Env).to receive(:rspec_split_by_test_examples?).and_return(true)
+ end
+
+ context 'when tag option is provided' do
+ let(:args) { '--tag example-value' }
+
+ it do
+ expect { subject }.to raise_error(/It is not allowed to use the RSpec tag option at the same time with RSpec split by test examples feature/)
+ end
+ end
+
+ context 'when tag option is provided as -t' do
+ let(:args) { '-t example-value' }
+
+ it do
+ expect { subject }.to raise_error(/It is not allowed to use the RSpec tag option at the same time with RSpec split by test examples feature/)
+ end
+ end
+
+ context 'when tag option is provided without delimiter' do
+ let(:args) { '-texample-value' }
+
+ it do
+ expect { subject }.to raise_error(/It is not allowed to use the RSpec tag option at the same time with RSpec split by test examples feature/)
+ end
+ end
+ end
end
context 'when args not provided' do | test case to raise exception when tag option is used with rspec split by test examples feature | KnapsackPro_knapsack_pro-ruby | train | rb |
1084bdf27488316469f407b2ff1dc2846bb49b95 | diff --git a/test/aria/widgets/skin/button/verticalAlign/VerticalAlignParent.js b/test/aria/widgets/skin/button/verticalAlign/VerticalAlignParent.js
index <HASH>..<HASH> 100644
--- a/test/aria/widgets/skin/button/verticalAlign/VerticalAlignParent.js
+++ b/test/aria/widgets/skin/button/verticalAlign/VerticalAlignParent.js
@@ -35,13 +35,8 @@ Aria.classDefinition({
var tpl = this.tpl = this.testDiv.getElementsByTagName("div")[0];
var widgetDom = this.getElementsByClassName(tpl, "xWidget")[0];
var spans = widgetDom.getElementsByTagName("span");
- var innerDom;
+ var innerDom = this.getElementsByClassName(tpl, "xFrameContent")[0] || spans[1];
var skinName = aria.widgets.AriaSkin.skinName;
- if (skinName == "atskin") {
- innerDom = this.getElementsByClassName(tpl, "xFrameContent")[0];
- } else {
- innerDom = spans[1];
- }
return {
skinName : skinName, | fix #<I> ButtonVerticalAlignTestSuite
Allowing tests from ButtonVerticalAlignTestSuite to pass for other skins
than atskin and atflatskin. | ariatemplates_ariatemplates | train | js |
b70f9cc3a15629f7fc06e383794cd818676dd6e9 | diff --git a/src/main/ruby/resque/jruby_worker.rb b/src/main/ruby/resque/jruby_worker.rb
index <HASH>..<HASH> 100644
--- a/src/main/ruby/resque/jruby_worker.rb
+++ b/src/main/ruby/resque/jruby_worker.rb
@@ -496,8 +496,9 @@ module Resque
( JRubyWorker::RESQUE_2x ? WorkerRegistry : Worker ).class_eval do
# Returns a single worker object. Accepts a string id.
- def self.find(worker_id)
- if exists?(worker_id)
+ def self.find(worker_id, options = nil)
+ skip_exists = options && options[:skip_exists]
+ if skip_exists || exists?(worker_id)
# NOTE: a pack so that Resque::Worker.find returns
# correct JRubyWorker class for thread-ed workers:
host, pid, thread, queues = JRubyWorker.split_id(worker_id)
@@ -509,6 +510,8 @@ module Resque
worker = Worker.new(*queues_args)
end
worker.to_s = worker_id
+ worker.hostname = host if worker.respond_to?(:hostname=)
+ worker.pid = pid.to_i if worker.respond_to?(:pid=)
worker
else
nil | Resque::Worker#find has an optional second options arg (since <I>)
... also set hostname/pid like super does - just to be a better citizen | kares_jruby-rack-worker | train | rb |
830db5ed7733165835521eb3ed2b4cc4cf696e14 | diff --git a/astar.go b/astar.go
index <HASH>..<HASH> 100644
--- a/astar.go
+++ b/astar.go
@@ -61,20 +61,22 @@ func Path(from, to Pather) (path []Pather, distance float64, found bool) {
current := heap.Pop(nq).(*node)
current.open = false
current.closed = true
+
+ if current == nm.get(to) {
+ // Found a path to the goal.
+ p := []Pather{}
+ curr := current
+ for curr != nil {
+ p = append(p, curr.pather)
+ curr = curr.parent
+ }
+ return p, current.cost, true
+ }
+
+
for _, neighbor := range current.pather.PathNeighbors() {
cost := current.cost + current.pather.PathNeighborCost(neighbor)
neighborNode := nm.get(neighbor)
- if neighbor == to {
- // Found a path to the goal.
- p := []Pather{}
- curr := neighborNode
- curr.parent = current
- for curr != nil {
- p = append(p, curr.pather)
- curr = curr.parent
- }
- return p, cost, true
- }
if cost < neighborNode.cost {
if neighborNode.open {
heap.Remove(nq, neighborNode.index) | Patch for beefsack/go-astar Issue 1, moving goal condition check in astar.go to preserve optimality | beefsack_go-astar | train | go |
01814bba896e72eb26954b4e2069469cb5e06f3b | diff --git a/test/test_helper.rb b/test/test_helper.rb
index <HASH>..<HASH> 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -15,6 +15,7 @@ if ENV["COVERAGE"]
end
require 'bundler'
+Bundler.setup
require 'minitest/autorun'
require 'action_pack'
require 'action_controller' | This will allow you to run the "rake" command by itself, as mentioned in the README, without requiring you to prefix with bundle exec | haml_haml | train | rb |
e28096260e38293957389d21f639e8fdd8271df6 | diff --git a/src/main/java/com/google/devtools/j2objc/gen/ObjectiveCHeaderGenerator.java b/src/main/java/com/google/devtools/j2objc/gen/ObjectiveCHeaderGenerator.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/google/devtools/j2objc/gen/ObjectiveCHeaderGenerator.java
+++ b/src/main/java/com/google/devtools/j2objc/gen/ObjectiveCHeaderGenerator.java
@@ -142,7 +142,7 @@ public class ObjectiveCHeaderGenerator extends ObjectiveCSourceFileGenerator {
ITypeBinding binding = Types.getTypeBinding(node);
String pkg = binding.getPackage().getName();
- if (NameTable.hasPrefix(pkg)) {
+ if (NameTable.hasPrefix(pkg) && binding.isTopLevel()) {
String unprefixedName = NameTable.camelCaseQualifiedName(binding.getQualifiedName());
if (binding.isInterface()) {
// Protocols can't be used in typedefs. | Only define typedefs for unprefixed types if they are top-level types. | google_j2objc | train | java |
d9a5396c1dee5f848ee997a440d4a4f2d9158823 | diff --git a/records.py b/records.py
index <HASH>..<HASH> 100644
--- a/records.py
+++ b/records.py
@@ -189,6 +189,10 @@ class RecordCollection(object):
return rows
+ def as_dict(self, ordered=False):
+ return self.all(as_dict=not(ordered), as_ordereddict=ordered)
+
+
class Database(object):
"""A Database connection.""" | allow calling as_dict on entire RecordCollection | kennethreitz_records | train | py |
de70d1787cf8b6f109199b9d7e71cdb890bf1665 | diff --git a/moto/core/access_control.py b/moto/core/access_control.py
index <HASH>..<HASH> 100644
--- a/moto/core/access_control.py
+++ b/moto/core/access_control.py
@@ -1,3 +1,17 @@
+"""
+This implementation is NOT complete, there are many things to improve.
+The following is a list of the most important missing features and inaccuracies.
+
+TODO add support for more principals, apart from IAM users and assumed IAM roles
+TODO add support for the Resource and Condition parts of IAM policies
+TODO add support and create tests for all services in moto (for example, API Gateway is probably not supported currently)
+TODO implement service specific error messages (currently, EC2 and S3 are supported separately, everything else defaults to the errors IAM returns)
+TODO include information about the action's resource in error messages (once the Resource element in IAM policies is supported)
+TODO check all other actions that are performed by the action called by the user (for example, autoscaling:CreateAutoScalingGroup requires permission for iam:CreateServiceLinkedRole too - see https://docs.aws.amazon.com/autoscaling/ec2/userguide/control-access-using-iam.html)
+TODO add support for resource-based policies
+
+"""
+
import json
import logging
import re
@@ -319,8 +333,6 @@ class IAMPolicyStatement(object):
if self._check_element_matches("Action", action):
is_action_concerned = True
- # TODO: check Resource/NotResource and Condition
-
if is_action_concerned:
if self._statement["Effect"] == "Allow":
return PermissionResult.PERMITTED | Collected TODOs in the header of the access_control file. | spulec_moto | train | py |
b5ae61016c0c3450ec9b04db34831990786c0e4a | diff --git a/src/Str.php b/src/Str.php
index <HASH>..<HASH> 100644
--- a/src/Str.php
+++ b/src/Str.php
@@ -135,6 +135,8 @@ final class Str implements \Countable {
*
* This operation is case-insensitive
*
+ * The empty string is not considered to be a part of any other string
+ *
* @param string $suffix the other string to search for
* @return bool whether the supplied other string can be found at the end of this string
*/
diff --git a/tests/index.php b/tests/index.php
index <HASH>..<HASH> 100644
--- a/tests/index.php
+++ b/tests/index.php
@@ -63,6 +63,7 @@ assert($testStrObj->endsWithIgnoreCase('ld') === true);
assert($testStrObj->endsWithIgnoreCase('lD') === true);
assert($testStrObj->endsWithIgnoreCase('rl') === false);
assert($testStrObj->endsWithIgnoreCase('rL') === false);
+assert($testStrObj->endsWithIgnoreCase('') === false);
assert((string) Str::from(" \r\n".$testStr." \n")->trim() === $testStr);
assert((string) Str::from(" \r\n".$testStr." \n")->trim('ab') === " \r\n".$testStr." \n"); | Clarify existing behavior of 'endsWithIgnoreCase' with empty needle | delight-im_PHP-Str | train | php,php |
be3de2f3b67c88f615d8d01e084354a904e4a509 | diff --git a/bitshares/transactionbuilder.py b/bitshares/transactionbuilder.py
index <HASH>..<HASH> 100644
--- a/bitshares/transactionbuilder.py
+++ b/bitshares/transactionbuilder.py
@@ -184,6 +184,7 @@ class TransactionBuilder(dict):
unsigned/partial transaction in order to simplify later
signing (e.g. for multisig or coldstorage)
"""
+ self.constructTx()
accountObj = Account(account)
authority = accountObj[permission]
# We add a required_authorities to be able to identify | [txbuilder] construct tx prior to adding additional data | bitshares_python-bitshares | train | py |
cfbf61f60c56ba7b710882ad1c8f296d40b09a87 | diff --git a/src/SilverStripe/BehatExtension/Context/BasicContext.php b/src/SilverStripe/BehatExtension/Context/BasicContext.php
index <HASH>..<HASH> 100644
--- a/src/SilverStripe/BehatExtension/Context/BasicContext.php
+++ b/src/SilverStripe/BehatExtension/Context/BasicContext.php
@@ -115,8 +115,8 @@ JS;
$javascript = <<<JS
if ('undefined' !== typeof window.jQuery) {
- $(document).ready(function() {
- window.jQuery('body').removeAttribute('data-jserrors');
+ window.jQuery(document).ready(function() {
+ window.jQuery('body').removeAttr('data-jserrors');
});
}
JS; | wait for DOM to remove attribute
use window.jQuery instead of $
updated to removeAttr method | jeffreyguo_SS-Behat-quicksetup | train | php |
a4434a352344a722bc205df9ad598bb0f38e16fb | diff --git a/src/ServiceContainer/WordpressBehatExtension.php b/src/ServiceContainer/WordpressBehatExtension.php
index <HASH>..<HASH> 100644
--- a/src/ServiceContainer/WordpressBehatExtension.php
+++ b/src/ServiceContainer/WordpressBehatExtension.php
@@ -162,6 +162,7 @@ class WordpressBehatExtension implements ExtensionInterface
$loader->load('services.yml');
$container->setParameter('wordpress.wordpress.default_driver', $config['default_driver']);
+ $container->setParameter('wordpress.path', $config['path']);
$container->setParameter('wordpress.parameters', $config);
$this->setupWpcliDriver($loader, $container, $config); | Create `wordpress.path` param for Symphony | paulgibbs_behat-wordpress-extension | train | php |
039661156116cb6d3c5c8e372ed4d81af221453b | diff --git a/spec/unit/application/face_base_spec.rb b/spec/unit/application/face_base_spec.rb
index <HASH>..<HASH> 100755
--- a/spec/unit/application/face_base_spec.rb
+++ b/spec/unit/application/face_base_spec.rb
@@ -55,6 +55,7 @@ describe Puppet::Application::FaceBase do
it "should stop if the first thing found is not an action" do
app.command_line.stubs(:args).returns %w{banana count_args}
expect { app.run }.to exit_with 1
+ @logs.first.should_not be_nil
@logs.first.message.should =~ /has no 'banana' action/
end | maint: better error reporting when test fails
This test ensures, among other things, that we get a log message. If that
fails, we were trying to call a random method on nil; making that an assertion
means that we get a nice message rather than a failure that needs decoding. | puppetlabs_puppet | train | rb |
35ecf52fccf8626e8db91e8c4abf3f5a9a556f5d | diff --git a/lib/tasks.php b/lib/tasks.php
index <HASH>..<HASH> 100644
--- a/lib/tasks.php
+++ b/lib/tasks.php
@@ -23,6 +23,7 @@ group('deploy',function() {
}else
{
$cmd[] = "mkdir -p {$app->env->shared_dir}/uploads";
+ $cmd[] = "mkdir -p {$app->env->release_dir}/public";
$cmd[] = "rm -rf {$app->env->release_dir}/public/uploads";
$cmd[] = "ln -s {$app->env->shared_dir}/uploads {$app->env->release_dir}/public/uploads";
} | Make sure there is a public folder, just in case there isn't one in the repo. | tamagokun_pomander-wordpress | train | php |
d587a2bc75294c4874d3049d485b3c9ab55f3c2e | diff --git a/lib/generators/cantango/permit_generator.rb b/lib/generators/cantango/permit_generator.rb
index <HASH>..<HASH> 100644
--- a/lib/generators/cantango/permit_generator.rb
+++ b/lib/generators/cantango/permit_generator.rb
@@ -35,7 +35,7 @@ module Cantango
return "#{name}_permit.erb" if user?
return "#{name}_account_permit.erb" if account?
- is_group? ? "#{name}_group_permit.rb" : "#{name}_permit.rb"
+ is_group? ? "#{name}_role_group_permit.rb" : "#{name}_role_permit.rb"
end
end
end
diff --git a/lib/generators/cantango/role_permit/role_permit_generator.rb b/lib/generators/cantango/role_permit/role_permit_generator.rb
index <HASH>..<HASH> 100644
--- a/lib/generators/cantango/role_permit/role_permit_generator.rb
+++ b/lib/generators/cantango/role_permit/role_permit_generator.rb
@@ -30,6 +30,8 @@ module Cantango
include Cantango::Generators::LicenseBase
include Cantango::Generators::PermitGenerator
+ alias_method :role_group, :role
+
def is_group?
options[:group]
end | fixed role and role_group generators | kristianmandrup_cantango | train | rb,rb |
39089dcc028b7cbec65ef73b1d2253f520b0a61a | diff --git a/lib/Bugsnag.js b/lib/Bugsnag.js
index <HASH>..<HASH> 100644
--- a/lib/Bugsnag.js
+++ b/lib/Bugsnag.js
@@ -155,14 +155,17 @@ export class Configuration {
* an instance of Report.
*/
registerBeforeSendCallback = (callback) => {
- this.beforeSendCallbacks.add(callback)
+ this.beforeSendCallbacks.push(callback)
}
/**
* Remove a callback from the before-send pipeline
*/
unregisterBeforeSendCallback = (callback) => {
- this.beforeSendCallbacks.remove(callback);
+ const index = this.beforeSendCallbacks.indexOf(callback);
+ if (index != -1) {
+ this.beforeSendCallbacks.splice(index, 1);
+ }
}
/** | [js] Remove shim in register/unregister callbacks
s/add/push
s/remove/splice | bugsnag_bugsnag-react-native | train | js |
33ba6c3bc10aa7fa5d97c736c649569de7e058a9 | diff --git a/tests/unit/grains/test_disks.py b/tests/unit/grains/test_disks.py
index <HASH>..<HASH> 100644
--- a/tests/unit/grains/test_disks.py
+++ b/tests/unit/grains/test_disks.py
@@ -117,9 +117,13 @@ class DisksGrainsTestCase(TestCase, LoaderModuleMockMixin):
"1",
"1",
]
- with patch("glob.glob", MagicMock(return_value=files)), patch(
- "salt.utils.path.readlink", MagicMock(side_effect=links)
- ), patch("salt.utils.files.fopen", mock_open(read_data=contents)):
+
+ patch_glob = patch("glob.glob", autospec=True, return_value=files)
+ patch_readlink = patch(
+ "salt.utils.path.readlink", autospec=True, side_effect=links
+ )
+ patch_fopen = patch("salt.utils.files.fopen", mock_open(read_data=contents))
+ with patch_glob, patch_readlink, patch_fopen:
ret = disks._linux_disks()
assert ret == {"disks": ["sda", "sdb", "vda"], "SSDs": []}, ret | Added autospec=True to test_disks.py unit test
- Added autospec=True to "patch" instructions
- Extracted patches from "with" block and pre-defined them to improve
the code readability | saltstack_salt | train | py |
a0aebf3b6c89ef9cef2b93b57b2baa947a285c20 | diff --git a/tests/PHPUnit/Fixtures/InvalidVisits.php b/tests/PHPUnit/Fixtures/InvalidVisits.php
index <HASH>..<HASH> 100644
--- a/tests/PHPUnit/Fixtures/InvalidVisits.php
+++ b/tests/PHPUnit/Fixtures/InvalidVisits.php
@@ -73,7 +73,7 @@ class Test_Piwik_Fixture_InvalidVisits extends Test_Piwik_BaseFixture
$t->setUserAgent('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729) (globalexcludeduseragent)');
$t->setIp('211.1.2.3');
self::checkResponse($t->doTrackPageView('visit from global excluded User Agent'));
-
+return;
// test with excluded IP
$t->setUserAgent('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729)'); // restore normal user agent
$t->setIp($excludedIp); | Investigating travis build failure... (<I>th commit) | matomo-org_matomo | train | php |
50ca669149b0c4a92f10c5a33cd71aeae500c16b | diff --git a/test/test.js b/test/test.js
index <HASH>..<HASH> 100644
--- a/test/test.js
+++ b/test/test.js
@@ -155,7 +155,7 @@ describe('chai-immutable (' + typeEnv + ')', function () {
// }
fail(function () {
expect(actual).to.equal(expected);
- }, 'AssertionError: expected { Object (foo) } to equal { Object (bar) }');
+ }, 'expected { Object (foo) } to equal { Object (bar) }');
});
it('should fail given a non-Immutable value', function () {
@@ -760,7 +760,7 @@ describe('chai-immutable (' + typeEnv + ')', function () {
// }
fail(function () {
assert.equal(actual, expected);
- }, 'AssertionError: expected { Object (foo) } to equal { Object (bar) }');
+ }, 'expected { Object (foo) } to equal { Object (bar) }');
});
it('should fail given a non-Immutable value', function () { | Fix tests around AssertionError messages | astorije_chai-immutable | train | js |
11f7e9652701664cf63ee60319dcddc2dcf203a4 | diff --git a/dbt/compilation.py b/dbt/compilation.py
index <HASH>..<HASH> 100644
--- a/dbt/compilation.py
+++ b/dbt/compilation.py
@@ -112,8 +112,8 @@ class Compiler(object):
src_fqn = ".".join(source_model)
ref_fqn = ".".join(other_model_fqn)
- if not self.model_can_reference(model, other_model):
- compiler_error(model, "Model '{}' exists but cannot be referenced from dependency model '{}'".format(ref_fqn, src_fqn))
+ #if not self.model_can_reference(model, other_model):
+ # compiler_error(model, "Model '{}' exists but cannot be referenced from dependency model '{}'".format(ref_fqn, src_fqn))
if not other_model.is_enabled:
raise RuntimeError("Model '{}' depends on model '{}' which is disabled in the project config".format(src_fqn, ref_fqn)) | disable model scoping (for now) | fishtown-analytics_dbt | train | py |
358165225aee6a6382a93761948b0efa3051ab90 | diff --git a/test/require.plain.js b/test/require.plain.js
index <HASH>..<HASH> 100644
--- a/test/require.plain.js
+++ b/test/require.plain.js
@@ -1,3 +1,4 @@
+'use strict';
/*
* This is an ugly hack that simply reads a couple of source files
* and adds `module.exports` so we can require it:
@@ -5,7 +6,7 @@
* var plain = requirePlain({
* base: 'path/to/source', // optional, prefixed to all files
* files: ['a.js', 'b.js'],
- * exports: "someLocalVariable"
+ * exports: 'someLocalVariable'
* });
*/
var fs = require('fs');
@@ -21,7 +22,7 @@ module.exports = function(options) {
counter++;
var file = __dirname + '/~require.plain.' + counter + '.js';
- var base = options.base || "";
+ var base = options.base || '';
var source = [
'/* temporarily created from libsass.js and sass.js */'
]; | fixing require.plain to satisfy jshint | medialize_sass.js | train | js |
4deab89876e1771815bf47c2bb15b5b20b379fa1 | diff --git a/lib/twingly/url.rb b/lib/twingly/url.rb
index <HASH>..<HASH> 100644
--- a/lib/twingly/url.rb
+++ b/lib/twingly/url.rb
@@ -22,7 +22,7 @@ module Twingly
def extract_url_and_domain(potential_url)
url = Addressable::URI.heuristic_parse(potential_url)
- domain = PublicSuffix.parse(url.host)
+ domain = PublicSuffix.parse(url.host) if url
[url, domain]
rescue PublicSuffix::DomainInvalid, Addressable::URI::InvalidURIError
diff --git a/lib/version.rb b/lib/version.rb
index <HASH>..<HASH> 100644
--- a/lib/version.rb
+++ b/lib/version.rb
@@ -1,5 +1,5 @@
module Twingly
module URL
- VERSION = '1.1.2'
+ VERSION = '1.1.3'
end
end | Don't extract domain if there's no valid url | twingly_twingly-url | train | rb,rb |
df364c3c7a198e33ab3b34544915d5c9cdc3b1d6 | diff --git a/opentsdb/__init__.py b/opentsdb/__init__.py
index <HASH>..<HASH> 100644
--- a/opentsdb/__init__.py
+++ b/opentsdb/__init__.py
@@ -2,4 +2,4 @@ from .tsdb_client import TSDBClient, TSDBConnectProtocols
from .metrics import Counter, Gauge
from .exceptions import *
-__version__ = '0.5.0'
+__version__ = '0.5.1'
diff --git a/opentsdb/tsdb_client.py b/opentsdb/tsdb_client.py
index <HASH>..<HASH> 100644
--- a/opentsdb/tsdb_client.py
+++ b/opentsdb/tsdb_client.py
@@ -71,9 +71,6 @@ class TSDBClient:
if isinstance(value, Metric):
self.__setattr__(key, value)
- def __getattr__(self, item):
- return getattr(self, item)
-
def __setattr__(self, key, value):
if isinstance(value, Metric):
if value.client is None: | Remove unused override for __getattr__. It may help to avoid cycling in some cases. | scarchik_opentsdb-py | train | py,py |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.