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 |
|---|---|---|---|---|---|
257a0e81f1ea3697569048bb3aa571adbed75d0b | diff --git a/Slide.php b/Slide.php
index <HASH>..<HASH> 100644
--- a/Slide.php
+++ b/Slide.php
@@ -7,7 +7,8 @@ use yii\helpers\ArrayHelper;
/**
* Slide is representation of each slide for Swiper widget.
- * If you want, you can use it directly.
+ * Do not use it directly if you don't really know what
+ * you are doing.
*
* @package romkaChev\yii2\swiper
*/
@@ -98,8 +99,7 @@ class Slide extends Object
}
/**
- * This function just calls normalization
- * of options
+ * @inheritdoc
*/
public function init()
{
diff --git a/Swiper.php b/Swiper.php
index <HASH>..<HASH> 100644
--- a/Swiper.php
+++ b/Swiper.php
@@ -496,6 +496,10 @@ class Swiper extends Widget
}
/**
+ * This function converts non-[[\romkaChev\yii2\swiper\Slide]] item
+ * to [[\romkaChev\yii2\swiper\Slide]], merging batch options,
+ * automatically sets id and class and so on...
+ *
* @param string|mixed[]|Slide $item
* @param int $index
*
@@ -781,8 +785,6 @@ class Swiper extends Widget
}
/**
- * This function renders an item
- *
* @param Slide $slide
*
* @see \romkaChev\yii2\swiper\Swiper::$items | removed dumb comments and add some phpdoc | romka-chev_yii2-swiper | train | php,php |
f6e843825d0c23a23cc86441f9a1c1fb28078f66 | diff --git a/openpnm/core/Base.py b/openpnm/core/Base.py
index <HASH>..<HASH> 100644
--- a/openpnm/core/Base.py
+++ b/openpnm/core/Base.py
@@ -2,7 +2,6 @@ import warnings
import uuid
import numpy as np
from collections import namedtuple
-from openpnm.models.misc import from_neighbor_throats, from_neighbor_pores
from openpnm.utils import Workspace, logging
from openpnm.utils.misc import PrintableList, SettingsDict, Docorator
docstr = Docorator()
@@ -1299,6 +1298,7 @@ class Base(dict):
array([1.5, 2.5])
"""
+ from openpnm.models.misc import from_neighbor_throats, from_neighbor_pores
if propname.startswith('throat'):
values = from_neighbor_throats(target=self, prop=propname, mode=mode)
elif propname.startswith('pore'): | Move model import inside Base methods to avoid circular import | PMEAL_OpenPNM | train | py |
32b8d8e68b944db88e776d3676c973be5c8d339b | diff --git a/textbuilder.go b/textbuilder.go
index <HASH>..<HASH> 100644
--- a/textbuilder.go
+++ b/textbuilder.go
@@ -33,6 +33,7 @@ var colorMap = map[string]Attribute{
"blue": ColorBlue,
"black": ColorBlack,
"cyan": ColorCyan,
+ "yellow": ColorYellow,
"white": ColorWhite,
"default": ColorDefault,
"green": ColorGreen, | Add missing 'yellow' to TextBuilder
'yellow' wasn't included in the colorMap used by TextBuilder, making it impossible to specify that very handy color from within text. | gizak_termui | train | go |
554683cee8c6a93121f8ec78ffe018dba0e6812a | diff --git a/src/elements/OO.ui.LabeledElement.js b/src/elements/OO.ui.LabeledElement.js
index <HASH>..<HASH> 100644
--- a/src/elements/OO.ui.LabeledElement.js
+++ b/src/elements/OO.ui.LabeledElement.js
@@ -41,6 +41,9 @@ OO.ui.LabeledElement.static.label = null;
/**
* Set the label.
*
+ * An empty string will result in the label being hidden. A string containing only whitespace will
+ * be converted to a single
+ *
* @method
* @param {jQuery|string|Function|null} label Label nodes; text; a function that retuns nodes or
* text; or null for no label
@@ -50,8 +53,13 @@ OO.ui.LabeledElement.prototype.setLabel = function ( label ) {
var empty = false;
this.label = label = OO.ui.resolveMsg( label ) || null;
- if ( typeof label === 'string' && label.trim() ) {
- this.$label.text( label );
+ if ( typeof label === 'string' && label.length ) {
+ if ( label.match( /^\s*$/ ) ) {
+ // Convert whitespace only string to a single non-breaking space
+ this.$label.html( ' ' );
+ } else {
+ this.$label.text( label );
+ }
} else if ( label instanceof jQuery ) {
this.$label.empty().append( label );
} else { | Allow whitespace labels
They still must not be empty-string, but this makes it possible to pass
" " and have it work the way you might hope. Internally we convert this
to " " and set as HTML instead of text because the browser won't
respect whitespace.
Change-Id: Ie<I>b<I>fc<I>f3ad<I>b<I>d<I>cbc2d<I>c<I>bad | wikimedia_oojs-ui | train | js |
46a7074a2f7b82c665a45f539ea4c494f18d5a64 | diff --git a/pyperf/_compare.py b/pyperf/_compare.py
index <HASH>..<HASH> 100644
--- a/pyperf/_compare.py
+++ b/pyperf/_compare.py
@@ -305,6 +305,12 @@ def compare_suites_by_speed(all_results, args):
else:
slower.append(item)
+ def sort_key(item):
+ return item[1].norm_mean
+
+ slower.sort(key=sort_key, reverse=True)
+ faster.sort(key=sort_key)
+
empty_line = False
for title, results, sort_reverse in (
('Slower', slower, True),
@@ -314,8 +320,6 @@ def compare_suites_by_speed(all_results, args):
if not results:
continue
- results.sort(key=lambda item: item[1].norm_mean, reverse=sort_reverse)
-
if empty_line:
print()
print("%s (%s):" % (title, len(results))) | Cleanup compare_suites_by_speed()
Simplify the code to sort lists. | vstinner_perf | train | py |
bd9f355d2ce5b9f827c41bbfa3c93fc5fadd9b4e | diff --git a/src/Configuration/LaravelNamingStrategy.php b/src/Configuration/LaravelNamingStrategy.php
index <HASH>..<HASH> 100644
--- a/src/Configuration/LaravelNamingStrategy.php
+++ b/src/Configuration/LaravelNamingStrategy.php
@@ -8,7 +8,7 @@ use Illuminate\Support\Str;
class LaravelNamingStrategy implements NamingStrategy
{
/**
- * @type Str
+ * @var Str
*/
protected $str; | Update LaravelNamingStrategy.php (#<I>)
/** @type Str */ is not valid docstring and doctrine annotations try to use it as annotation with JMS Serializer and Doctrine Annotation and throw Exception on this. Probably that should be changed to /** @var Str */ | laravel-doctrine_orm | train | php |
97b1deabf806a57736b46c649d763e49a806d32c | diff --git a/maas/client/viscera/raids.py b/maas/client/viscera/raids.py
index <HASH>..<HASH> 100644
--- a/maas/client/viscera/raids.py
+++ b/maas/client/viscera/raids.py
@@ -110,6 +110,8 @@ class RaidsType(ObjectType):
:type spare_devices: iterable of mixed type of `BlockDevice` or
`Partition`
"""
+ if isinstance(level, RaidLevel):
+ level = level.value
params = {
'level': str(level),
} | viscera: raids: correctly handle RaidLevel in create() (#<I>)
When the RAID level is given as a RaidLevel enum, use the enum value
rather than converting it to a string directly. | maas_python-libmaas | train | py |
255a36c2806f42ad96538d7a456fe020de708b13 | diff --git a/superset/viz.py b/superset/viz.py
index <HASH>..<HASH> 100644
--- a/superset/viz.py
+++ b/superset/viz.py
@@ -148,9 +148,8 @@ class BaseViz(object):
# Backward compatibility hack
since_words = since.split(' ')
- if (
- len(since_words) == 2 and
- since_words[1] in ['days', 'years', 'hours', 'day', 'year']):
+ grains = ['days', 'years', 'hours', 'day', 'year', 'weeks']
+ if (len(since_words) == 2 and since_words[1] in grains):
since += ' ago'
from_dttm = utils.parse_human_datetime(since) | [hotfix] user dashboard says '<I> weeks' (#<I>) | apache_incubator-superset | train | py |
e2ad80096831ecc091ee64ba6db72c9193b806cb | diff --git a/module/FzyCommon/src/FzyCommon/Entity/BaseNull.php b/module/FzyCommon/src/FzyCommon/Entity/BaseNull.php
index <HASH>..<HASH> 100755
--- a/module/FzyCommon/src/FzyCommon/Entity/BaseNull.php
+++ b/module/FzyCommon/src/FzyCommon/Entity/BaseNull.php
@@ -41,7 +41,7 @@ abstract class BaseNull implements BaseInterface
/**
* Helper method to allow entities to set $this->property = $entity->asDoctrineProperty()
* which will translate setting a null entity to setting a null value
- * @return \App\Entity\Base|null
+ * @return \FzyCommon\Entity\Base|null
*/
public function asDoctrineProperty()
{
@@ -95,7 +95,7 @@ abstract class BaseNull implements BaseInterface
return new \DateTime();
}
- public function tsGetFormatted(\DateTime $tsProperty = null, $format)
+ public function tsGetFormatted(\DateTime $tsProperty = null, $format = self::DEFAULT_DATE_FORMAT, $timezone = null)
{
return null;
} | Fixing namespace issue, conforming to interface. | foush_common | train | php |
170c59e9102ab5ee6b2ad5a9072d3312b64ef36d | diff --git a/src/docs/conf.py b/src/docs/conf.py
index <HASH>..<HASH> 100644
--- a/src/docs/conf.py
+++ b/src/docs/conf.py
@@ -316,5 +316,5 @@ class Mock(MagicMock):
def __getattr__(cls, name):
return Mock()
-MOCK_MODULES = ['numpy', 'cython', 'sympy', 'matplotlib', 'yaml', 'assimulo', 'sbml']
+MOCK_MODULES = ['numpy', 'cython', 'sympy', 'matplotlib', 'assimulo', 'sbml']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES) | removed yaml fromm mocks | theosysbio_means | train | py |
7e2d53d0eea67781d217fbe20cef15279cc8bd4c | diff --git a/src/main/java/com/headius/invokebinder/Binder.java b/src/main/java/com/headius/invokebinder/Binder.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/headius/invokebinder/Binder.java
+++ b/src/main/java/com/headius/invokebinder/Binder.java
@@ -1068,7 +1068,7 @@ public class Binder {
if (type().parameterCount() != 1 || !Throwable.class.isAssignableFrom(type().parameterType(0))) {
throw new InvalidTransformException("incoming signature must have one Throwable type as its sole argument: " + type());
}
- return invoke(MethodHandles.throwException(type().returnType(), (Class<Throwable>)type().parameterType(0)));
+ return invoke(MethodHandles.throwException(type().returnType(), type().parameterType(0).asSubclass(Throwable.class)));
}
/** | use Class.asSubClass instead of an unchecked cast to verify the cast at
runtime | headius_invokebinder | train | java |
f0bbb92bcf6ddb282a3b45ac3ed57f41282b7803 | diff --git a/examples/src/main/java/org/bitcoinj/examples/ForwardingService.java b/examples/src/main/java/org/bitcoinj/examples/ForwardingService.java
index <HASH>..<HASH> 100644
--- a/examples/src/main/java/org/bitcoinj/examples/ForwardingService.java
+++ b/examples/src/main/java/org/bitcoinj/examples/ForwardingService.java
@@ -108,7 +108,7 @@ public class ForwardingService {
@Override
public void onSuccess(TransactionConfidence result) {
System.out.println("Confirmation received.");
- forwardCoins(tx);
+ forwardCoins();
}
@Override
@@ -128,7 +128,7 @@ public class ForwardingService {
} catch (InterruptedException ignored) {}
}
- private static void forwardCoins(Transaction tx) {
+ private static void forwardCoins() {
try {
// Now send the coins onwards.
SendRequest sendRequest = SendRequest.emptyWallet(forwardingAddress); | ForwardingService: Get rid of unused forwardCoins() method argument. | bitcoinj_bitcoinj | train | java |
f5b9b755eaf7c5935a6b5c6b1014cc3df90323bc | diff --git a/scripts/get_bump_version.py b/scripts/get_bump_version.py
index <HASH>..<HASH> 100644
--- a/scripts/get_bump_version.py
+++ b/scripts/get_bump_version.py
@@ -27,5 +27,5 @@ vers, status, since, gsha = get_version_from_git()
if status == "":
print("No X.X.X-devel[rc] tag.")
else:
- print(vers + "." + status + "."+ gsha[1:])
+ print(vers + "-" + status + "-"+ gsha[1:]) | Use dash to be compliant with XXX-devel pattern. | bokeh_bokeh | train | py |
2d808a58c83bf14a10728774c8d76cd410a5d4cb | diff --git a/src/Exceptions/OAuthServerException.php b/src/Exceptions/OAuthServerException.php
index <HASH>..<HASH> 100644
--- a/src/Exceptions/OAuthServerException.php
+++ b/src/Exceptions/OAuthServerException.php
@@ -39,4 +39,14 @@ class OAuthServerException extends Exception
{
return $this->response;
}
+
+ /**
+ * Get HTTP response status code.
+ *
+ * @return int
+ */
+ public function getStatusCode()
+ {
+ return $this->response->getStatusCode();
+ }
} | Allow access to HTTP response status code. | laravel_passport | train | php |
c142ef809fdcf4fe912d2a42c9f19389253a2c21 | diff --git a/netpyne/plotting/plotter.py b/netpyne/plotting/plotter.py
index <HASH>..<HASH> 100644
--- a/netpyne/plotting/plotter.py
+++ b/netpyne/plotting/plotter.py
@@ -24,7 +24,7 @@ colorList = [[0.42, 0.67, 0.84], [0.90, 0.76, 0.00], [0.42, 0.83, 0.59], [0.90,
class MultiFigure:
"""A class which defines a figure object"""
- def __init__(self, kind, sim=None, subplots=None, rcParams=None, **kwargs):
+ def __init__(self, kind, sim=None, subplots=None, rcParams=None, autosize=0.35, **kwargs):
if not sim:
from .. import sim
@@ -64,6 +64,13 @@ class MultiFigure:
dpi = kwargs['dpi']
else:
dpi = self.rcParams['figure.dpi']
+
+ if autosize:
+ maxplots = np.max([nrows, ncols])
+ figSize0 = figSize[0] + (maxplots-1)*(figSize[0]*autosize)
+ figSize1 = figSize[1] + (maxplots-1)*(figSize[1]*autosize)
+ figSize = [figSize0, figSize1]
+
self.fig, self.ax = plt.subplots(nrows, ncols, figsize=figSize, dpi=dpi)
self.plotters = [] | added autosizing feature to scale fig with num subplots | Neurosim-lab_netpyne | train | py |
d4d7c3ed6e44e4fe7c439f70f5c34fea28ff2c26 | diff --git a/src/test/java/org/roaringbitmap/TestRoaringBitmap.java b/src/test/java/org/roaringbitmap/TestRoaringBitmap.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/roaringbitmap/TestRoaringBitmap.java
+++ b/src/test/java/org/roaringbitmap/TestRoaringBitmap.java
@@ -3161,7 +3161,6 @@ public class TestRoaringBitmap {
short data5[] = {};
short data6[] = {};
Assert.assertFalse(Util.unsignedIntersects(data5, data5.length, data6, data6.length));
-
}
@Test | Add test case to test unsignedIntersects() method | RoaringBitmap_RoaringBitmap | train | java |
8baf3b0e9e316bfe0f8a12b70fa8bfc865d77d65 | diff --git a/src/components/ebay-carousel/index.js b/src/components/ebay-carousel/index.js
index <HASH>..<HASH> 100644
--- a/src/components/ebay-carousel/index.js
+++ b/src/components/ebay-carousel/index.js
@@ -406,7 +406,7 @@ function getSlide({ index, itemsPerSlide }, i = index) {
* @param {-1|1} delta 1 for right and -1 for left.
* @return {number}
*/
-function getNextIndex({ index, items, slideWidth }, delta) {
+function getNextIndex({ index, items, slideWidth, itemsPerSlide }, delta) {
let i = index;
let item;
@@ -419,9 +419,12 @@ function getNextIndex({ index, items, slideWidth }, delta) {
// If going right, then we just want the next item not fully in view.
if (delta === RIGHT) return i % items.length;
- // If going left, go as far left as possible while keeping this item fully in view.
+ // If items per slide is set we must show the same items on the same slide.
+ if (itemsPerSlide) return i;
+
+ // If going left without items per slide, go as far left as possible while keeping this item fully in view.
const targetOffset = item.right - slideWidth;
- do item = items[--i]; while (item && item.left > targetOffset);
+ do item = items[--i]; while (item && item.left >= targetOffset);
return i + 1;
} | Ensure items-per-slide slides do not change based on direciton. | eBay_ebayui-core | train | js |
1f8e4f21325b2de7caf6525fc1eceeaf7629b552 | diff --git a/lib/mail/Mail.php b/lib/mail/Mail.php
index <HASH>..<HASH> 100644
--- a/lib/mail/Mail.php
+++ b/lib/mail/Mail.php
@@ -1756,8 +1756,7 @@ class Mail implements \JsonSerializable
/**
* Disable sandbox mode on a MailSettings object
*
- * This allows you to send a test email to ensure that your request
- * body is valid and formatted correctly.
+ * This to ensure that your request is not in sandbox mode.
*
* @throws TypeException
*/ | docs: rewrite function description (#<I>)
I found that the function description did not match the way it works. | sendgrid_sendgrid-php | train | php |
61354f0e3c5f1bb0fcd5b3af7147fb599750cf6a | diff --git a/packages/ember-testing/lib/helpers.js b/packages/ember-testing/lib/helpers.js
index <HASH>..<HASH> 100644
--- a/packages/ember-testing/lib/helpers.js
+++ b/packages/ember-testing/lib/helpers.js
@@ -55,6 +55,7 @@ asyncHelper('visit', visit);
@method click
@param {String} selector jQuery selector for finding element on the DOM
+ @param {Object} context A DOM Element, Document, or jQuery to use as context
@return {RSVP.Promise}
@public
*/ | [DOC release] Add documentation for click 2nd argument | emberjs_ember.js | train | js |
cbcdeb3fce08cc8b8d232cec84363b8f47530d84 | diff --git a/lib/stackdeck/context.rb b/lib/stackdeck/context.rb
index <HASH>..<HASH> 100644
--- a/lib/stackdeck/context.rb
+++ b/lib/stackdeck/context.rb
@@ -15,7 +15,7 @@ module StackDeck
pre_range, post_range = context_ranges(lines, index)
@before_lineno = pre_range.begin
@before = lines[pre_range]
- @line = lines[index].chomp
+ @line = lines[index]
@after = lines[post_range]
else
@line = lines.join("\n")
@@ -24,7 +24,7 @@ module StackDeck
class File < Context
def initialize(filename, lineno)
- super ::File.readlines(filename), lineno
+ super ::File.readlines(filename).map {|l| l.chomp }, lineno
end
end
end | Oops.. context lines shouldn't have trailing \n. | matthewd_stackdeck | train | rb |
0b82e4c718fb56db4208d782a7727497daa9d8d5 | diff --git a/spec/maxminddb_spec.rb b/spec/maxminddb_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/maxminddb_spec.rb
+++ b/spec/maxminddb_spec.rb
@@ -39,8 +39,8 @@ describe MaxMindDB do
expect(city_db.lookup(ip)).to be_found
end
- it 'returns FI as the country iso code' do
- expect(country_db.lookup(ip).country.iso_code).to eq('FI')
+ it 'returns LV as the country iso code' do
+ expect(country_db.lookup(ip).country.iso_code).to eq('LV')
end
end | Updated maxminddb_spec.rb for the recent GeoLite2 change. | yhirose_maxminddb | train | rb |
77bb97ba24dd3560cd66db71286bb48b1cb60f0b | diff --git a/spec/dummy/db/seeds/pathology/pathology_seeder.rb b/spec/dummy/db/seeds/pathology/pathology_seeder.rb
index <HASH>..<HASH> 100644
--- a/spec/dummy/db/seeds/pathology/pathology_seeder.rb
+++ b/spec/dummy/db/seeds/pathology/pathology_seeder.rb
@@ -13,7 +13,7 @@ module Renalware
patient.observation_requests.find_or_create_by!(id: row["id"].to_i) do |obr|
obr.description = request_desc
obr.requestor_order_number = row["order_no"]
- obr.requested_at = random_date_between(1.days.ago, 2.months.ago)
+ obr.requested_at = random_date_between(1.days.ago, 2.years.ago)
obr.requestor_name = row["requestor_name"]
end
end
@@ -29,7 +29,7 @@ module Renalware
request.observations.create!(
description: observation_desc,
result: row["result"],
- observed_at: request.requested_at + 9.hours
+ observed_at: request.requested_at + 24.hours
)
end
end | Seed OBRs over a period of 2 years | airslie_renalware-core | train | rb |
63916f8ce878f742aaf2a88627092779cddc68ee | diff --git a/Eloquent/Collection.php b/Eloquent/Collection.php
index <HASH>..<HASH> 100755
--- a/Eloquent/Collection.php
+++ b/Eloquent/Collection.php
@@ -158,6 +158,17 @@ class Collection extends BaseCollection implements QueueableCollection
}
/**
+ * Load a set of related existences onto the collection.
+ *
+ * @param array|string $relations
+ * @return $this
+ */
+ public function loadExists($relations)
+ {
+ return $this->loadAggregate($relations, '*', 'exists');
+ }
+
+ /**
* Load a set of relationships onto the collection if they are not already eager loaded.
*
* @param array|string $relations
diff --git a/Eloquent/Model.php b/Eloquent/Model.php
index <HASH>..<HASH> 100644
--- a/Eloquent/Model.php
+++ b/Eloquent/Model.php
@@ -620,6 +620,17 @@ abstract class Model implements Arrayable, ArrayAccess, Jsonable, JsonSerializab
}
/**
+ * Eager load related model existence values on the model.
+ *
+ * @param array|string $relations
+ * @return $this
+ */
+ public function loadExists($relations)
+ {
+ return $this->loadAggregate($relations, '*', 'exists');
+ }
+
+ /**
* Eager load relationship column aggregation on the polymorphic relation of a model.
*
* @param string $relation | [8.x] Add loadExists on Model and Eloquent Collection (#<I>)
* Add loadExists on Model and Eloquent Collection
* Update Collection.php | illuminate_database | train | php,php |
a990770e569e9255830609c0c1dfbde7cd4db637 | diff --git a/require.php b/require.php
index <HASH>..<HASH> 100644
--- a/require.php
+++ b/require.php
@@ -9,7 +9,7 @@
* @license https://www.gnu.org/licenses/lgpl.html
* @author Hunter Perrin <hperrin@gmail.com>
* @copyright SciActive.com
- * @link http://sciactive.com/
+ * @link http://requirephp.org
*/
define('REQUIREPHP_MAX_DEPTH', 80); | Changed website to requirephp.org. | sciactive_requirephp | train | php |
3bf4b276a348ec44764fd8e1a854c875586f4702 | diff --git a/lib/hyrax/engine.rb b/lib/hyrax/engine.rb
index <HASH>..<HASH> 100644
--- a/lib/hyrax/engine.rb
+++ b/lib/hyrax/engine.rb
@@ -83,7 +83,7 @@ module Hyrax
# Force CatalogController to use our SearchState class, which has an important
# work-around for some highly suspect SPARQL-gem monkeypatching.
- CatalogController.search_state_class = Hyrax::SearchState if CatalogController.search_state_class == Blacklight::SearchState
+ CatalogController.search_state_class = Hyrax::SearchState if CatalogController.try(:search_state_class) == Blacklight::SearchState
end
initializer 'requires' do | soften dependendy on search_state_class for app generation
search_state_class isn't defined on CatalogController until after blacklight
generator has run, but `Hyrax::Engine` needs to execute before that in
generation. | samvera_hyrax | train | rb |
eb750381ea49269fb82ca45db6122e4ccbeb403e | diff --git a/tests/Clinner/Command/Tests/CommandTest.php b/tests/Clinner/Command/Tests/CommandTest.php
index <HASH>..<HASH> 100644
--- a/tests/Clinner/Command/Tests/CommandTest.php
+++ b/tests/Clinner/Command/Tests/CommandTest.php
@@ -217,6 +217,13 @@ class CommandTest extends \PHPUnit_Framework_TestCase
$this->assertAttributeEquals($args, '_arguments', $command);
}
+ /**
+ * Set a private property to a Command $object.
+ *
+ * @param \Clinner\Command\Command $object The object to update.
+ * @param string $name The private property name.
+ * @param mixed $value The new value for the property.
+ */
protected function _setPrivateProperty($object, $name, $value)
{
$property = new \ReflectionProperty(
@@ -228,6 +235,14 @@ class CommandTest extends \PHPUnit_Framework_TestCase
$property->setValue($object, $value);
}
+ /**
+ * Get the value of a private property from a Command $object.
+ *
+ * @param \Clinner\Command\Command $object The object to inspect.
+ * @param string $name The private property name.
+ *
+ * @return mixed
+ */
protected function _getPrivateProperty($object, $name)
{
$property = new \ReflectionProperty( | Added proper PHPDoc blocks to non-test methods in CommandTest class. | ncuesta_Clinner | train | php |
a0be9f04200732aa6beb7390257386c6dad8ba00 | diff --git a/aedes.js b/aedes.js
index <HASH>..<HASH> 100644
--- a/aedes.js
+++ b/aedes.js
@@ -288,7 +288,7 @@ Aedes.prototype.close = function (cb) {
function doneClose () {
that.emit('closed')
cb = cb || noop
- cb()
+ that.mq.close(cb)
}
}
diff --git a/test/basic.js b/test/basic.js
index <HASH>..<HASH> 100644
--- a/test/basic.js
+++ b/test/basic.js
@@ -321,6 +321,19 @@ test('closes', function (t) {
})
})
+test('closes gracefully', function (t) {
+ t.plan(3)
+
+ var broker = aedes()
+ var client = noError(connect(setup(broker)))
+ eos(client.conn, t.pass.bind('client closes'))
+
+ broker.close(function (err) {
+ t.error(err, 'no error')
+ t.ok(broker.mq.closed, 'broker mq closes')
+ })
+})
+
test('testing other event', function (t) {
var broker = aedes()
var client = setup(broker) | Gracefully Close mqemitter (#<I>)
* Gracefully Close mqemitter
* Added a unit test for gracefully close broker.mq | mcollina_aedes | train | js,js |
7fc501f824f6eaf1a80ca1e427d763f17aad78d0 | diff --git a/database/pdo/query.php b/database/pdo/query.php
index <HASH>..<HASH> 100644
--- a/database/pdo/query.php
+++ b/database/pdo/query.php
@@ -354,7 +354,7 @@ class PDO_Query
*/
private function _process_value($value)
{
- if ($value == "NOW()") {
+ if ($value === "NOW()") {
return "'" . time() - date("Z", time()) . "'";
} else {
return $this->_conn()->quote($value); | Fixed an issue where updating a database row with certain values would cause it to be treated as "NOW()". | nirix_radium | train | php |
816198cd57efde99e5d8b26cf2d282433aadc867 | diff --git a/container/lxd/server.go b/container/lxd/server.go
index <HASH>..<HASH> 100644
--- a/container/lxd/server.go
+++ b/container/lxd/server.go
@@ -244,11 +244,8 @@ func (s *Server) UpdateContainerProfiles(name string, profiles []string) error {
}
op := resp.Get()
- logger.Debugf("updated %q, waiting on %s", name, op.Description)
+ logger.Debugf("updated %q profiles, waiting on %s", name, op.Description)
err = resp.Wait()
- if err != nil {
- logger.Tracef("updating %q failed on %q", name, err)
- }
return errors.Trace(err)
} | update logging from UpdateContainerProfiles | juju_juju | train | go |
256251ae3781f1654981617d8d16087a9aefce64 | diff --git a/lib/loga/sidekiq.rb b/lib/loga/sidekiq.rb
index <HASH>..<HASH> 100644
--- a/lib/loga/sidekiq.rb
+++ b/lib/loga/sidekiq.rb
@@ -4,7 +4,7 @@ module Loga
module Sidekiq
def self.configure_logging
return unless defined?(::Sidekiq)
- return if Gem::Version.new('5.0') > Gem::Version.new(::Sidekiq::VERSION)
+ return if Gem::Version.new(::Sidekiq::VERSION) < Gem::Version.new('5.0')
::Sidekiq.configure_server do |config|
config.options[:job_logger] = Loga::Sidekiq::JobLogger | Tweak guard clause in Loga::Sidekiq.configure_logging | FundingCircle_loga | train | rb |
7c92063f96fc10e0a0861dfa7f42cf857f835756 | diff --git a/config/routes.rb b/config/routes.rb
index <HASH>..<HASH> 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -7,9 +7,7 @@ Spree::Core::Engine.routes.draw do
:skip => [:unlocks, :omniauth_callbacks],
:path_names => { :sign_out => 'logout' },
:path_prefix => :user
-end
-Spree::Core::Engine.routes.prepend do
resources :users, :only => [:edit, :update]
devise_scope :spree_user do
@@ -24,8 +22,8 @@ Spree::Core::Engine.routes.prepend do
put '/password/change' => 'user_passwords#update', :as => :update_password
end
- match '/checkout/registration' => 'checkout#registration', :via => :get, :as => :checkout_registration
- match '/checkout/registration' => 'checkout#update_registration', :via => :put, :as => :update_checkout_registration
+ get '/checkout/registration' => 'checkout#registration', :as => :checkout_registration
+ put '/checkout/registration' => 'checkout#update_registration', :as => :update_checkout_registration
resource :session do
member do | Use a single routes.draw block
Rails 4 doesn't allow couple routes any longer | spree_spree_auth_devise | train | rb |
4f1e8667c37dc527edaeece313fc67851b3b63ed | diff --git a/lib/AbstractPicoPlugin.php b/lib/AbstractPicoPlugin.php
index <HASH>..<HASH> 100644
--- a/lib/AbstractPicoPlugin.php
+++ b/lib/AbstractPicoPlugin.php
@@ -187,7 +187,7 @@ abstract class AbstractPicoPlugin implements PicoPluginInterface
*/
public function getDependencies()
{
- return $this->dependsOn;
+ return (array) $this->dependsOn;
}
/** | Cast AbstractPicoPlugin::$dependsOn to array
Plugin devs could come up with the idea of setting AbstractPicoPlugin::$dependsOn to a string (single dependency) or null (no dependencies) | picocms_Pico | train | php |
59ef0c991cdfe3d9785984df0c6bc59ef6b06aff | diff --git a/tests/Symfony/Tests/Component/Form/Type/FileTypeTest.php b/tests/Symfony/Tests/Component/Form/Type/FileTypeTest.php
index <HASH>..<HASH> 100644
--- a/tests/Symfony/Tests/Component/Form/Type/FileTypeTest.php
+++ b/tests/Symfony/Tests/Component/Form/Type/FileTypeTest.php
@@ -122,7 +122,7 @@ class FileTypeTest extends TestCase
'token' => '123456',
'name' => 'original_name.jpg',
), $this->form->getClientData());
- $this->assertEquals($tmpPath, $this->form->getData());
+ $this->assertEquals(realpath($tmpPath), realpath($this->form->getData()));
}
public function testSubmitEmpty()
@@ -165,6 +165,6 @@ class FileTypeTest extends TestCase
'token' => '',
'name' => '',
), $this->form->getClientData());
- $this->assertEquals($tmpPath, $this->form->getData());
+ $this->assertEquals(realpath($tmpPath), realpath($this->form->getData()));
}
} | [Form] fixed two unit tests | symfony_symfony | train | php |
94e38520ef3478630987363222d83f471b14908d | diff --git a/examples/todos-require/js/todoModel.js b/examples/todos-require/js/todoModel.js
index <HASH>..<HASH> 100644
--- a/examples/todos-require/js/todoModel.js
+++ b/examples/todos-require/js/todoModel.js
@@ -26,7 +26,7 @@ define(['stapes'], function(Stapes) {
return this.getAllAsArray();
} else if (state === 'active') {
return this.getLeft();
- } else if (state === 'complted') {
+ } else if (state === 'completed') {
return this.getComplete();
}
},
diff --git a/examples/todos/js/todoModel.js b/examples/todos/js/todoModel.js
index <HASH>..<HASH> 100644
--- a/examples/todos/js/todoModel.js
+++ b/examples/todos/js/todoModel.js
@@ -25,7 +25,7 @@ var TodoModel = Stapes.subclass({
return this.getAllAsArray();
} else if (state === 'active') {
return this.getLeft();
- } else if (state === 'complted') {
+ } else if (state === 'completed') {
return this.getComplete();
}
}, | fixed a bug where the completed filter did not work | hay_stapes | train | js,js |
24f0f0a9ae09ea493d462c0e3762757d02efc177 | diff --git a/src/Ubiquity/cache/Preloader.php b/src/Ubiquity/cache/Preloader.php
index <HASH>..<HASH> 100644
--- a/src/Ubiquity/cache/Preloader.php
+++ b/src/Ubiquity/cache/Preloader.php
@@ -245,7 +245,7 @@ class Preloader {
* @return \Ubiquity\cache\Preloader
*/
public function addUbiquityWorkerman() {
- $this->addClasses ( [ '\\Ubiquity\\servers\\workerman\\WorkermanServer','\\Ubiquity\\utils\\http\\foundation\\WorkermanHttp' ] );
+ $this->addClasses ( [ 'Ubiquity\\servers\\workerman\\WorkermanServer','Ubiquity\\utils\\http\\foundation\\WorkermanHttp' ] );
return $this;
}
@@ -255,7 +255,7 @@ class Preloader {
* @return \Ubiquity\cache\Preloader
*/
public function addUbiquitySwoole() {
- $this->addClasses ( [ '\\Ubiquity\\servers\\swoole\\SwooleServer','\\Ubiquity\\utils\\http\\foundation\\SwooleHttp' ] );
+ $this->addClasses ( [ 'Ubiquity\\servers\\swoole\\SwooleServer','Ubiquity\\utils\\http\\foundation\\SwooleHttp' ] );
return $this;
} | [skip ci] Fix preloading for Swoole & Workerman | phpMv_ubiquity | train | php |
a197eb612b4e94e5c79487643e7ff4a2097cd76e | diff --git a/lib/adhearsion/voip/asterisk/manager_interface.rb b/lib/adhearsion/voip/asterisk/manager_interface.rb
index <HASH>..<HASH> 100644
--- a/lib/adhearsion/voip/asterisk/manager_interface.rb
+++ b/lib/adhearsion/voip/asterisk/manager_interface.rb
@@ -29,6 +29,8 @@ module Adhearsion
#
class ManagerInterface
+ CAUSAL_EVENT_NAMES = ["queuestatus", "sippeers", "parkedcalls", "status", "dahdishowchannels"] unless defined? CAUSAL_EVENT_NAMES
+
class << self
def connect(*args)
@@ -61,13 +63,7 @@ module Adhearsion
# @return [String] the downcase()'d name of the event name for which to wait
#
def has_causal_events?(name, headers={})
- name = name.to_s.downcase
- case name
- when "queuestatus", "sippeers", "parkedcalls", "status"
- true
- else
- false
- end
+ CAUSAL_EVENT_NAMES.include? name.to_s.downcase
end
## | Fixing a bug with Adhearsion's handling of the DAHDIShowChannels AMI action. | adhearsion_adhearsion | train | rb |
b12f2b915097306077087cd2f02d2a5a73e3e92f | diff --git a/tests/tags/else.test.js b/tests/tags/else.test.js
index <HASH>..<HASH> 100644
--- a/tests/tags/else.test.js
+++ b/tests/tags/else.test.js
@@ -24,6 +24,11 @@ describe('Tag: else', function () {
}).to.throwError(/Unexpected tag "else" on line 1\./);
});
+ it('does not accept conditionals/args (use elseif, elif)', function () {
+ expect(function () {
+ swig.render('{% if foo %}{% else what %}{% endif %}');
+ }).to.throwError(/"else" tag does not accept any tokens. Found "what" on line 1\./);
+ });
});
describe('Tag: elseif, elif', function () {
@@ -47,5 +52,4 @@ describe('Tag: elseif, elif', function () {
swig.render('{% elseif %}foo');
}).to.throwError(/Unexpected tag "elseif" on line 1\./);
});
-
}); | coverage: else <I>% | Thunf_swiger | train | js |
e4c9eb614e447f6c19adf328267341e1c5335ac8 | diff --git a/build/rollup.config.min.js b/build/rollup.config.min.js
index <HASH>..<HASH> 100644
--- a/build/rollup.config.min.js
+++ b/build/rollup.config.min.js
@@ -5,5 +5,5 @@ config.plugins.push(uglify());
export default Object.assign(config, {
format: 'umd',
dest: 'lib/index.min.js',
- moduleName: 'toxicPredicateFuntions'
+ moduleName: 'toxicUtils'
});
diff --git a/build/rollup.config.umd.js b/build/rollup.config.umd.js
index <HASH>..<HASH> 100644
--- a/build/rollup.config.umd.js
+++ b/build/rollup.config.umd.js
@@ -2,5 +2,5 @@ import base from './rollup.config.base';
export default Object.assign(base('umd'), {
format: 'umd',
dest: 'lib/index.browser.js',
- moduleName: 'toxicPredicateFunctions'
+ moduleName: 'toxicUtils'
}); | [update] rename to toxicUtils
what:
why:
how: | toxic-johann_toxic-utils | train | js,js |
93293e0916cfbd5a6cf868716a8ff3f74297ef37 | diff --git a/packages/pob/lib/generators/common/babel/CommonBabelGenerator.js b/packages/pob/lib/generators/common/babel/CommonBabelGenerator.js
index <HASH>..<HASH> 100644
--- a/packages/pob/lib/generators/common/babel/CommonBabelGenerator.js
+++ b/packages/pob/lib/generators/common/babel/CommonBabelGenerator.js
@@ -599,7 +599,7 @@ export default class CommonBabelGenerator extends Generator {
}
// eslint: https://github.com/benmosher/eslint-plugin-import/issues/2132
// jest: https://github.com/facebook/jest/issues/9771
- if (!pkg.main) {
+ if (!pkg.main && exportName === '.') {
pkg.main = exportTarget.default || exportTarget.require;
}
} else if (target === 'browser') { | fix(pob): dont add any script as main, only "." | christophehurpeau_pob-lerna | train | js |
74bb49a96a148b380b3e3914fc203244644672cf | diff --git a/lib/fsr/cmd/originate.rb b/lib/fsr/cmd/originate.rb
index <HASH>..<HASH> 100644
--- a/lib/fsr/cmd/originate.rb
+++ b/lib/fsr/cmd/originate.rb
@@ -17,7 +17,8 @@ module FSR
@target_options[:origination_caller_id_number] ||= args[:caller_id_number] || FSR::DEFAULT_CALLER_ID_NUMBER
@target_options[:origination_caller_id_name] ||= args[:caller_id_name] || FSR::DEFAULT_CALLER_ID_NAME
- @target_options[:originate_timeout] ||= args[:timeout] || @target_options[:timeout] || 15
+ @target_options[:originate_timeout] ||= args[:timeout] || @target_options[:timeout] || 30
+ @target_options[:ignore_early_media] ||= true
end
# Send the command to the event socket, using bgapi by default. | make sure ignore_early_media has a default (true) | vangberg_librevox | train | rb |
ec92f86a2f6fe52c8a74ca6b95a3d1bec1f2ad0e | diff --git a/jsonerror.go b/jsonerror.go
index <HASH>..<HASH> 100644
--- a/jsonerror.go
+++ b/jsonerror.go
@@ -76,7 +76,7 @@ func (ec *ErrorCollection) AddErrorCollection(errs *ErrorCollection) {
}
// Return a list of all contained errors
-func (ec *ErrorCollection) Error() string {
+func (ec ErrorCollection) Error() string {
ec.lock.RLock()
defer ec.lock.RUnlock()
str := "" | Minor bug fix
- Now compatible with panic( ) | pjebs_jsonerror | train | go |
f55ad50863a55165499b16d0cecdefeb2708f015 | diff --git a/test/meta_test.rb b/test/meta_test.rb
index <HASH>..<HASH> 100644
--- a/test/meta_test.rb
+++ b/test/meta_test.rb
@@ -40,8 +40,8 @@ class ApiVersionTest < Test::Unit::TestCase
"display_name": "unstable",
"supported": false,
},
- ].to_json
+ ].as_json
- assert_equal versions, ShopifyAPI::Meta.admin_versions.to_json
+ assert_equal versions, ShopifyAPI::Meta.admin_versions.as_json
end
end | fix: update test to handle activeresource.to_json in Ruby <I> | Shopify_shopify_api | train | rb |
3bc13489b1a49b2a8fcd4b6136712113017c6c83 | diff --git a/Slim/App.php b/Slim/App.php
index <HASH>..<HASH> 100644
--- a/Slim/App.php
+++ b/Slim/App.php
@@ -592,7 +592,7 @@ class App
$params = [$e->getRequest(), $e->getResponse(), $e->getAllowedMethods()];
} elseif ($e instanceof NotFoundException) {
$handler = 'notFoundHandler';
- $params = [$e->getRequest(), $e->getResponse()];
+ $params = [$e->getRequest(), $e->getResponse(), $e];
} elseif ($e instanceof SlimException) {
// This is a Stop exception and contains the response
return $e->getResponse(); | Send Exception also into NotFoundHandler | slimphp_Slim | train | php |
b2f3c8359aa20fead4f434910b787152ee31d935 | diff --git a/tempy/tempy.py b/tempy/tempy.py
index <HASH>..<HASH> 100755
--- a/tempy/tempy.py
+++ b/tempy/tempy.py
@@ -404,22 +404,18 @@ class DOMElement:
raise DOMModByIndexError(self, "Given index invalid.")
else:
result = []
- search_func = lambda s: [x for x in self.childs if x._name == s]
if isinstance(arg, str):
- result = search_func(arg)
- else:
+ arg = [arg, ]
+ for x in arg:
try:
- for x in arg:
- result.extend(search_func(x))
- except:
- pass
+ result.append(getattr(self, x))
+ except AttributeError:
+ raise DOMModByKeyError(self, "Given search key invalid. No child found")
if result:
for x in result:
self.childs.remove(x)
if isinstance(x, DOMElement):
x.parent = False
- else:
- raise DOMModByKeyError(self, "Given search key invalid. No child found")
return result
def empty(self): | pop method light refactor, sligthly faster, more explicit. | Hrabal_TemPy | train | py |
196dec11b45cd1593809be715d4dbbfe79770763 | diff --git a/src/Nether/Database/Struct/TableClassInfo.php b/src/Nether/Database/Struct/TableClassInfo.php
index <HASH>..<HASH> 100644
--- a/src/Nether/Database/Struct/TableClassInfo.php
+++ b/src/Nether/Database/Struct/TableClassInfo.php
@@ -119,7 +119,7 @@ class TableClassInfo {
$this->Indexes[$Inst->Name] = $Inst->Learn($this);
else
- $this->Attributes[$Inst->Name] = $Inst->Learn($this);
+ $this->Attributes[] = $Inst->Learn($this);
return;
} | attribs list not keyed | netherphp_database | train | php |
c382f68a1ea8c3518b8248afbfa5af65e2c316d0 | diff --git a/bcbio/variation/genotype.py b/bcbio/variation/genotype.py
index <HASH>..<HASH> 100644
--- a/bcbio/variation/genotype.py
+++ b/bcbio/variation/genotype.py
@@ -184,7 +184,8 @@ def batch_for_variantcall(samples):
"""
from bcbio.pipeline import run_info
convert_to_list = set(["config__algorithm__tools_on", "config__algorithm__tools_off"])
- default_keys = set(["metadata__batch"])
+ default_keys = set(["metadata__batch", "config__algorithm__validate",
+ "config__algorithm__validate_regions"])
to_process, extras = _dup_samples_by_variantcaller(samples, require_bam=False)
batch_groups = collections.defaultdict(list)
to_process = [utils.to_single_data(x) for x in to_process] | CWL: always set validate and validate_regions
CWL batching requires all outputs present (and nil if unset), but the
previously set None defaults do not pass any command line arguments to
the batch command so they're not included in the output. | bcbio_bcbio-nextgen | train | py |
9e91f53444d304bf21bd8d5afa10512142777107 | diff --git a/website/src/components/charts/bar/props.js b/website/src/components/charts/bar/props.js
index <HASH>..<HASH> 100644
--- a/website/src/components/charts/bar/props.js
+++ b/website/src/components/charts/bar/props.js
@@ -324,6 +324,24 @@ export default [
controlGroup: 'Labels',
},
{
+ key: 'labelFormat',
+ scopes: '*',
+ description: (
+ <span>
+ how to format label,{' '}
+ <a
+ href="https://github.com/d3/d3-format/blob/master/README.md#format"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ see d3.format() documentation
+ </a>
+ .
+ </span>
+ ),
+ type: '{string|Function}',
+ },
+ {
key: 'labelSkipWidth',
scopes: '*',
description: 'Skip label if bar width is lower than provided value, ignored if 0 (px).', | Added the formatLabel prop to the Bar chart documentation. | plouc_nivo | train | js |
2b8c2909c1b757f5f4d2a01e21887fc58893ae43 | diff --git a/src/mixins/isMobile/index.js b/src/mixins/isMobile/index.js
index <HASH>..<HASH> 100644
--- a/src/mixins/isMobile/index.js
+++ b/src/mixins/isMobile/index.js
@@ -21,21 +21,23 @@
*/
export default {
- data: () => ({
- isMobile: this.isMobile()
- }),
+ data() {
+ return {
+ isMobile: this._isMobile()
+ }
+ },
beforeMount() {
- window.addEventListener('resize', this.onResize)
+ window.addEventListener('resize', this._onResize)
},
beforeDestroy() {
- window.removeEventListener('resize', this.onResize)
+ window.removeEventListener('resize', this._onResize)
},
methods: {
- onResize() {
+ _onResize() {
// Update mobile mode
- this.isMobile = this.isMobile()
+ this.isMobile = this._isMobile()
},
- isMobile() {
+ _isMobile() {
return window.outerWidth <= 768
}
} | Fix the isMobile mixin
* Use a real method for data to have access to `this`
* Rename private methods with a _ prefix | nextcloud_nextcloud-vue | train | js |
830de05bf9f3dd72a8d863764a0925e11b5a6673 | diff --git a/lib/replies-fetcher.js b/lib/replies-fetcher.js
index <HASH>..<HASH> 100644
--- a/lib/replies-fetcher.js
+++ b/lib/replies-fetcher.js
@@ -44,7 +44,7 @@ function fetch(videoID, commentID) {
return { html: replies.html_content };
}).catch(function (error) {
debug('fetch failed: "%s", %d', error.message, error.status);
- if (error.status && error.status !== 200) {
+ if (error.status !== 200) {
if (numRetries++ < MAX_RETRIES) {
debug('Retry %d of %d', numRetries, MAX_RETRIES);
return fetch(videoID, commentID); | always retry, even if no statusCode (e.g. SOCKET_HANGUP) | philbot9_youtube-comment-api | train | js |
f04b922afff7974824d597e79ec1bfc5ae2b0cb1 | diff --git a/cmd/config.go b/cmd/config.go
index <HASH>..<HASH> 100644
--- a/cmd/config.go
+++ b/cmd/config.go
@@ -444,8 +444,6 @@ type GoogleSafeBrowsingConfig struct {
// SyslogConfig defines the config for syslogging.
type SyslogConfig struct {
- Network string
- Server string
StdoutLevel *int
SyslogLevel *int
}
diff --git a/cmd/shell.go b/cmd/shell.go
index <HASH>..<HASH> 100644
--- a/cmd/shell.go
+++ b/cmd/shell.go
@@ -183,8 +183,8 @@ func StatsAndLogging(statConf StatsdConfig, logConf SyslogConfig) (metrics.Statt
tag := path.Base(os.Args[0])
syslogger, err := syslog.Dial(
- logConf.Network,
- logConf.Server,
+ "",
+ "",
syslog.LOG_INFO|syslog.LOG_LOCAL0, // default, overridden by log calls
tag)
FailOnError(err, "Could not connect to Syslog")
diff --git a/test/boulder-config-next.json b/test/boulder-config-next.json
index <HASH>..<HASH> 100644
--- a/test/boulder-config-next.json
+++ b/test/boulder-config-next.json
@@ -1,7 +1,5 @@
{
"syslog": {
- "network": "",
- "server": "",
"stdoutlevel": 6,
"sysloglevel": 4
}, | Remove support for TCP-based logging (#<I>) | letsencrypt_boulder | train | go,go,json |
a9575e3e2e0046d52d77f5bb179dcb390969cba2 | diff --git a/src/basic/Picker.ios.js b/src/basic/Picker.ios.js
index <HASH>..<HASH> 100644
--- a/src/basic/Picker.ios.js
+++ b/src/basic/Picker.ios.js
@@ -210,6 +210,7 @@ class PickerNB extends Component {
<Container style={this.props.modalStyle}>
{this.renderHeader()}
<FlatList
+ testID={this.props.testID}
data={this.state.dataSource}
keyExtractor={(item, index) => String(index)}
renderItem={({ item }) => ( | propagate testID to FlatList for Picker.ios (#<I>) | GeekyAnts_NativeBase | train | js |
d87b74c56aea77fa66cd6eda28d7ebeca557be6a | diff --git a/lang/en_us/moodle.php b/lang/en_us/moodle.php
index <HASH>..<HASH> 100644
--- a/lang/en_us/moodle.php
+++ b/lang/en_us/moodle.php
@@ -484,6 +484,7 @@ $string['opentoguests'] = "Guest access";
$string['optional'] = "optional";
$string['order'] = "Order";
$string['outline'] = "Outline";
+$string['parentlanguage'] = "en";
$string['participants'] = "Participants";
$string['password'] = "Password";
$string['passwordchanged'] = "Password has been changed"; | Parent language is "en" :-) | moodle_moodle | train | php |
76b674b02169e9daed3775a3def988675096f3ab | diff --git a/xclim/indices/_synoptic.py b/xclim/indices/_synoptic.py
index <HASH>..<HASH> 100644
--- a/xclim/indices/_synoptic.py
+++ b/xclim/indices/_synoptic.py
@@ -23,6 +23,7 @@ def jetstream_metric_woolings(
"""Strength and latitude of jetstream.
Identify latitude and strength of maximum smoothed zonal wind speed in the region from 15 to 75°N and -60 to 0°E.
+ WARNING: This metric expects eastward wind component (u) to be on a regular grid (i.e. Plate Carree, 1D lat and lon)
Parameters
----------
@@ -73,7 +74,9 @@ def jetstream_metric_woolings(
window_size = 61
cutoff = 1 / filter_freq
if ua.time.size <= filter_freq or ua.time.size <= window_size:
- raise ValueError(f"Time series is too short to apply 61-day Lanczos filter (got a length of {ua.time.size})")
+ raise ValueError(
+ f"Time series is too short to apply 61-day Lanczos filter (got a length of {ua.time.size})"
+ )
# compute low-pass filter weights
lanczos_weights = compute_low_pass_filter_weights( | add warning that js metric expects a regular grid | Ouranosinc_xclim | train | py |
ab4b1336b874022ba800fbf82a39d35f4d169b94 | diff --git a/ariane_procos/gears.py b/ariane_procos/gears.py
index <HASH>..<HASH> 100644
--- a/ariane_procos/gears.py
+++ b/ariane_procos/gears.py
@@ -163,7 +163,7 @@ class DirectoryGear(InjectorGearSkeleton):
if SystemGear.fqdn is None:
SystemGear.fqdn = SystemGear.hostname
- LOGGER.info(str(SystemGear.fqdn))
+ LOGGER.debug("FQDN : " + str(SystemGear.fqdn))
self.current_possible_network = [
current_possible_location_config,
@@ -765,7 +765,7 @@ class MappingGear(InjectorGearSkeleton):
operating_system.container_id = None
if self.osi_container is None:
- LOGGER.info(str(SystemGear.fqdn))
+ LOGGER.debug("FQDN : " + str(SystemGear.fqdn))
if SystemGear.fqdn is None:
SystemGear.fqdn = SystemGear.hostname
self.osi_container = Container( | [ACPPOS-<I>] fix fqdn logs | echinopsii_net.echinopsii.ariane.community.plugin.procos | train | py |
8f9ab56b0aa7af7f11e247da05475daba73f04dc | diff --git a/lib/active_merchant/billing/gateways/epay.rb b/lib/active_merchant/billing/gateways/epay.rb
index <HASH>..<HASH> 100644
--- a/lib/active_merchant/billing/gateways/epay.rb
+++ b/lib/active_merchant/billing/gateways/epay.rb
@@ -134,7 +134,7 @@ module ActiveMerchant #:nodoc:
end
def add_creditcard_or_reference(post, credit_card_or_reference)
- if credit_card_or_reference.is_a?(CreditCard)
+ if credit_card_or_reference.respond_to?(:number)
add_creditcard(post, credit_card_or_reference)
else
add_reference(post, credit_card_or_reference.to_s) | ePay: Check if it looks like a credit card instead of if it actually is a credit card object | activemerchant_active_merchant | train | rb |
10613f7139a3dfd90866ebf8945a73117c6e15a8 | diff --git a/packages/magellan-mocha-plugin/.eslintrc.js b/packages/magellan-mocha-plugin/.eslintrc.js
index <HASH>..<HASH> 100644
--- a/packages/magellan-mocha-plugin/.eslintrc.js
+++ b/packages/magellan-mocha-plugin/.eslintrc.js
@@ -7,4 +7,15 @@ module.exports = {
'import/no-nodejs-modules': 'off',
'no-process-exit': 'off',
},
+ overrides: [
+ {
+ files: [ './test_support/**/*' ],
+ rules: {
+ 'jest/expect-expect': 'off',
+ 'jest/no-disabled-tests': 'off',
+ 'jest/valid-title': 'off',
+ 'jest/no-identical-title': 'off',
+ },
+ },
+ ],
}; | chore: Disable jest rules that doesn't make sense for test fixtures (#<I>) | Automattic_wp-calypso | train | js |
76007f107000717e850e3e8b83d6840740f33e5d | diff --git a/runtimes/assemblyscript/cli-runner.js b/runtimes/assemblyscript/cli-runner.js
index <HASH>..<HASH> 100644
--- a/runtimes/assemblyscript/cli-runner.js
+++ b/runtimes/assemblyscript/cli-runner.js
@@ -19,8 +19,12 @@ async function main(runtime, module, input, expected) {
console.log("output:");
console.log(JSON.stringify(res, null, 2));
} catch(err) {
- console.log("error output:");
- console.log(err);
+ console.log("output:");
+ let res = {
+ "error": "Eval failed",
+ "message": err.message
+ };
+ console.log(JSON.stringify(res, null,2));
}
} | fix(wasm) Slightly more consistent error | querycert_qcert | train | js |
9ea9a72b20d505ca5636479d40961f5d2964652a | diff --git a/lib/opal/nodes/base.rb b/lib/opal/nodes/base.rb
index <HASH>..<HASH> 100644
--- a/lib/opal/nodes/base.rb
+++ b/lib/opal/nodes/base.rb
@@ -89,8 +89,8 @@ module Opal
scope.top_scope
end
- def s(*args)
- @compiler.s(*args)
+ def s(type, *children)
+ ::Opal::AST::Node.new(type, children, location: @sexp.loc)
end
def expr? | Source maps: Ensure that Nodes don't eat location while creating new sexps | opal_opal | train | rb |
2caf2a94b606df65f7057eeb2b2d632f4b39a6e5 | diff --git a/src/PeskyCMF/Auth/Middleware/CmfAuth.php b/src/PeskyCMF/Auth/Middleware/CmfAuth.php
index <HASH>..<HASH> 100644
--- a/src/PeskyCMF/Auth/Middleware/CmfAuth.php
+++ b/src/PeskyCMF/Auth/Middleware/CmfAuth.php
@@ -21,7 +21,7 @@ class CmfAuth {
: redirect($loginUrl);
} else {
/** @var RecordInterface|Authenticatable $user */
- \Event::fire(new CmfUserAuthenticated($cmfConfig::getUser()));
+ \Event::dispatch(new CmfUserAuthenticated($cmfConfig::getUser()));
$response = $next($request);
if ($response->getStatusCode() === HttpCode::FORBIDDEN && stripos($response->getContent(), 'unauthorized') !== false) { | CmfAuth - \Event::fire() fixed by \Event::dispatch() | swayok_PeskyCMF | train | php |
bf10d0047046f8cc8c78685f430d991b027d071a | diff --git a/lib/barista/compiler.rb b/lib/barista/compiler.rb
index <HASH>..<HASH> 100644
--- a/lib/barista/compiler.rb
+++ b/lib/barista/compiler.rb
@@ -90,7 +90,7 @@ module Barista
def compile!
location = @options.fetch(:origin, 'inline')
@compiled_content = compile(@context, location)
- @compiled_content = preamble(location) + @compiled_content if Barista.add_preamble?
+ @compiled_content = preamble(location) + @compiled_content if Barista.add_preamble? unless location == 'inline'
@compiled = true
end | Don't add the preamble to inline compiles. | Sutto_barista | train | rb |
6ca75487abf9ba46b8e90b016a31120b0c8d7c41 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -13,7 +13,7 @@ class Auth {
constructor (options) {
this.config = {
local: local,
- provided: options
+ provided: options || {}
}
} | fix: ensure that provided config is an object | cubic-js_cubic | train | js |
5d8f230121529423f223c429ff24f3427ac862cc | diff --git a/test/rcd_test/ext/mri/extconf.rb b/test/rcd_test/ext/mri/extconf.rb
index <HASH>..<HASH> 100644
--- a/test/rcd_test/ext/mri/extconf.rb
+++ b/test/rcd_test/ext/mri/extconf.rb
@@ -16,5 +16,8 @@ else
puts "Gem::Platform.local.to_s: #{Gem::Platform.local.to_s.inspect}"
puts "-"*70
+ have_func('rb_thread_call_without_gvl', 'ruby/thread.h') ||
+ raise("rb_thread_call_without_gvl() not found")
+
create_makefile("rcd_test/rcd_test_ext")
end | Make sure functions of the C-API of ruby can be found in extconf.rb | rake-compiler_rake-compiler-dock | train | rb |
aeb344f893b0c69f85ca1bcdc72b06343e104d32 | diff --git a/app/lib/webpack/ssr/plugin.ssr-prod-artifacts.js b/app/lib/webpack/ssr/plugin.ssr-prod-artifacts.js
index <HASH>..<HASH> 100644
--- a/app/lib/webpack/ssr/plugin.ssr-prod-artifacts.js
+++ b/app/lib/webpack/ssr/plugin.ssr-prod-artifacts.js
@@ -27,6 +27,8 @@ module.exports = class SsrProdArtifacts {
*/
const appPkg = require(appPaths.resolve.app('package.json'))
const cliPkg = require(appPaths.resolve.cli('package.json'))
+
+ delete appPkg.dependencies['@quasar/extras']
const appDeps = getFixedDeps(appPkg.dependencies)
const cliDeps = cliPkg.dependencies | feat(app): small addition to previous commit for SSR builds (do not add @quasar/extras for production package.json) | quasarframework_quasar | train | js |
410fb089f92d914c609fa5b82e10df63ffb6279d | diff --git a/angr/analyses/forward_analysis.py b/angr/analyses/forward_analysis.py
index <HASH>..<HASH> 100644
--- a/angr/analyses/forward_analysis.py
+++ b/angr/analyses/forward_analysis.py
@@ -181,7 +181,8 @@ class ForwardAnalysis(object):
while not self.should_abort and self._entries:
- entry_info = self._entries.pop()
+ entry_info = self._entries[0]
+ self._entries = self._entries[1:]
self._handle_entry(entry_info) | ForwardAnalysis: fix the bug where entries are popped out of entry list in a reversed order. | angr_angr | train | py |
c760e1323f9ca1c21d5f0cb0b1127c6d83462f7b | diff --git a/builder/amazon/common/step_security_group.go b/builder/amazon/common/step_security_group.go
index <HASH>..<HASH> 100644
--- a/builder/amazon/common/step_security_group.go
+++ b/builder/amazon/common/step_security_group.go
@@ -45,7 +45,9 @@ func (s *StepSecurityGroup) Run(state multistep.StateBag) multistep.StepAction {
port := s.CommConfig.Port()
if port == 0 {
- panic("port must be set to a non-zero value.")
+ if s.CommConfig.Type != "none" {
+ panic("port must be set to a non-zero value.")
+ }
}
// Create the group | don't panic if the communicator is none and the port is 0 | hashicorp_packer | train | go |
9e47a18d2463bd62060f3f7a7e35bfa2889c5544 | diff --git a/core-bundle/src/Resources/contao/library/Contao/Model.php b/core-bundle/src/Resources/contao/library/Contao/Model.php
index <HASH>..<HASH> 100644
--- a/core-bundle/src/Resources/contao/library/Contao/Model.php
+++ b/core-bundle/src/Resources/contao/library/Contao/Model.php
@@ -358,9 +358,18 @@ abstract class Model
}
$arrSet = $this->preSave($arrSet);
+ // track primary key changes
+ if (isset($this->arrModified[static::$strPk]))
+ {
+ $strPk = $this->arrModified[static::$strPk];
+ }
+ else {
+ $strPk = $this->{static::$strPk};
+ }
+
$this->objDatabase->prepare("UPDATE " . static::$strTable . " %s WHERE " . static::$strPk . "=?")
->set($arrSet)
- ->execute($this->{static::$strPk});
+ ->execute($strPk);
$this->arrModified = array(); | [Core] TODO <I>: Track primary key modifications. | contao_contao | train | php |
97f3692b05965c5734914909714abcf24c8f618d | diff --git a/fireplace/carddata/minions/basic.py b/fireplace/carddata/minions/basic.py
index <HASH>..<HASH> 100644
--- a/fireplace/carddata/minions/basic.py
+++ b/fireplace/carddata/minions/basic.py
@@ -29,6 +29,13 @@ class NEW1_009:
if self.game.currentPlayer is self.owner:
target.heal(1)
+# Bloodsail Corsair
+class NEW1_025:
+ def activate(self):
+ weapon = self.owner.opponent.hero.weapon
+ if self.owner.opponent.hero.weapon:
+ weapon.loseDurability(1)
+
# Voodoo Doctor
class EX1_011:
@@ -39,6 +46,12 @@ class EX1_011:
class EX1_015:
activate = drawCard
+# Acidic Swamp Ooze
+class EX1_066:
+ def activate(self):
+ if self.owner.opponent.hero.weapon:
+ self.owner.opponent.hero.weapon.destroy()
+
# Succubus
class EX1_306:
activate = discard(1)
@@ -48,6 +61,14 @@ class EX1_506:
def activate(self):
self.owner.summon("EX1_506a")
+# Harrison Jones
+class EX1_558:
+ def activate(self):
+ weapon = self.owner.opponent.hero.weapon
+ if weapon:
+ weapon.destroy()
+ self.owner.draw(weapon.getProperty("durability"))
+
# Priestess of Elune
class EX1_583:
targeting = TARGET_FRIENDLY_HERO | Implement Acidic Swamp Ooze, Bloodsail Corsair and Harrison Jones | jleclanche_fireplace | train | py |
726e734403ec94a185ca7860dd9f5bfe3227e80c | diff --git a/analysis/farm.py b/analysis/farm.py
index <HASH>..<HASH> 100755
--- a/analysis/farm.py
+++ b/analysis/farm.py
@@ -14,6 +14,8 @@ import os
import sys
import numpy
import healpy
+import subprocess
+import time
import ugali.analysis.isochrone
import ugali.analysis.kernel
@@ -193,6 +195,16 @@ class Farm:
command = '%s %s %i %s'%(self.config.params['queue']['script'], configfile_queue, pix[ii], outfile)
command_queue = 'sbatch --account=kicp --partition=kicp-ht --output=%s --job-name=%s --mem=10000 %s'%(logfile, self.config.params['queue']['jobname'], command)
print command_queue
+
+ while True:
+ n_submitted = int(subprocess.Popen('squeue -u bechtol | wc\n',
+ shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE).communicate()[0].split()[0]) - 1
+ if n_submitted < 100:
+ break
+ else:
+ print '%i jobs already in queue, waiting ...'%(n_submitted)
+ time.sleep(15)
+
os.system(command_queue)
#break | Don't submit too many jobs simulataneously | DarkEnergySurvey_ugali | train | py |
9ddd4845241a600488dc451e66d971b0d83eb0d6 | diff --git a/lnwallet/channel.go b/lnwallet/channel.go
index <HASH>..<HASH> 100644
--- a/lnwallet/channel.go
+++ b/lnwallet/channel.go
@@ -5896,6 +5896,16 @@ func (lc *LightningChannel) State() *channeldb.OpenChannel {
return lc.channelState
}
+// MarkCommitmentBroadcasted marks the channel as a commitment transaction has
+// been broadcast, either our own or the remote, and we should watch the chain
+// for it to confirm before taking any further action.
+func (lc *LightningChannel) MarkCommitmentBroadcasted() error {
+ lc.Lock()
+ defer lc.Unlock()
+
+ return lc.channelState.MarkCommitmentBroadcasted()
+}
+
// ActiveHtlcs returns a slice of HTLC's which are currently active on *both*
// commitment transactions.
func (lc *LightningChannel) ActiveHtlcs() []channeldb.HTLC { | lnwallet/channel: export method MarkCommitmentBroadcasted | lightningnetwork_lnd | train | go |
3991b0ebe343f8d4e0ea3e1bf853de695ac3e16c | diff --git a/store.go b/store.go
index <HASH>..<HASH> 100644
--- a/store.go
+++ b/store.go
@@ -52,14 +52,14 @@ type StoreCallbacks struct {
ItemValRead func(c *Collection, i *Item,
r io.ReaderAt, offset int64, valLength uint32) error
+ ItemValAddRef func(c *Collection, i *Item)
+ ItemValDecRef func(c *Collection, i *Item)
+
// Invoked when a Store is reloaded (during NewStoreEx()) from
// disk, this callback allows the user to optionally supply a key
// comparison func for each collection. Otherwise, the default is
// the bytes.Compare func.
KeyCompareForCollection func(collName string) KeyCompare
-
- ItemValAddRef func(c *Collection, i *Item)
- ItemValDecRef func(c *Collection, i *Item)
}
type ItemCallback func(*Collection, *Item) (*Item, error) | Moved ItemValAddRef/DecRef funcs upwards. | steveyen_gkvlite | train | go |
1b429082fb64922a978a2fd406b612e9752c7dfb | diff --git a/lib/Fhaculty/Graph/Set/Vertices.php b/lib/Fhaculty/Graph/Set/Vertices.php
index <HASH>..<HASH> 100644
--- a/lib/Fhaculty/Graph/Set/Vertices.php
+++ b/lib/Fhaculty/Graph/Set/Vertices.php
@@ -270,7 +270,7 @@ class Vertices implements Countable, IteratorAggregate, VerticesAggregate
* @throws InvalidArgumentException if criterium is unknown
* @see self::getVertexOrder()
*/
- public function getVerticesOrder($orderBy = self::ORDER_FIFO, $desc = false)
+ public function getVerticesOrder($orderBy, $desc = false)
{
if ($orderBy === self::ORDER_RANDOM) {
// shuffle the vertex positions | Fix outdated default parameter to be required
The parameter was meant to be required and its default value didn't work
in the first place.
Fixes clue/graph-uml#<I> | graphp_graph | train | php |
3b58bf088c34e267bfa28c7fb497979825e8f073 | diff --git a/from_markdown.js b/from_markdown.js
index <HASH>..<HASH> 100644
--- a/from_markdown.js
+++ b/from_markdown.js
@@ -2,7 +2,7 @@ import markdownit from "markdown-it"
import {BlockQuote, OrderedList, BulletList, ListItem,
HorizontalRule, Paragraph, Heading, CodeBlock, Image, HardBreak,
EmMark, StrongMark, LinkMark, CodeMark} from "../schema"
-import {Mark, Fragment} from "../model"
+import {Mark} from "../model"
import sortedInsert from "../util/sortedinsert"
// :: (Schema, string, ?Object) → Node
@@ -135,9 +135,8 @@ class MarkdownParseState {
// :: (NodeType, ?Object, ?[Node]) → ?Node
// Add a node at the current position.
addNode(type, attrs, content) {
- content = type.fixContent(Fragment.from(content), attrs)
- if (!content) return null
- let node = type.create(attrs, content, this.marks)
+ let node = type.createAndFill(attrs, content, this.marks)
+ if (!node) return null
this.push(node)
return node
} | Introduce createChecked and createAndFill in NodeType
Remove fixContent | ProseMirror_prosemirror-markdown | train | js |
d4c4bcec62e7286324e908eb553e495ff84e87b4 | diff --git a/gorp_test.go b/gorp_test.go
index <HASH>..<HASH> 100644
--- a/gorp_test.go
+++ b/gorp_test.go
@@ -207,6 +207,15 @@ func TestUIntPrimaryKey(t *testing.T) {
if err != nil {
t.Error(err)
}
+ if p1.Id != 1 {
+ t.Errorf("%d != 1", p1.Id)
+ }
+ if p2.Id != 1 {
+ t.Errorf("%d != 1", p2.Id)
+ }
+ if p3.Id != 1 {
+ t.Errorf("%d != 1", p3.Id)
+ }
}
func TestPersistentUser(t *testing.T) { | #<I> - add assertions on post-insert bound Id field | go-gorp_gorp | train | go |
0c20610fd362620e56a59feaf303b0bc6f63f125 | diff --git a/crabpy_pyramid/tests/test_functional.py b/crabpy_pyramid/tests/test_functional.py
index <HASH>..<HASH> 100644
--- a/crabpy_pyramid/tests/test_functional.py
+++ b/crabpy_pyramid/tests/test_functional.py
@@ -343,3 +343,20 @@ class CrabFunctionalTests(FunctionalTests):
def test_get_land_by_unexisting_id(self):
res = self.testapp.get('/crab/landen/MORDOR', status=404)
self.assertEqual('404 Not Found', res.status)
+
+@unittest.skipUnless(
+ run_crab_integration_tests(),
+ 'No CRAB Integration tests required'
+)
+class HttpCachingFunctionalTests(FunctionalTests):
+ def test_list_gewesten(self):
+ res = self.testapp.get('/crab/gewesten')
+ self.assertEqual('200 OK', res.status)
+ self.assertIn('ETag', res.headers)
+
+ def test_http_304_res(self):
+ res = self.testapp.get('/crab/gewesten')
+ self.assertEqual('200 OK', res.status)
+ etag = res.headers['Etag']
+ res2 = self.testapp.get('/crab/gewesten', headers={'If-None-Match': etag})
+ self.assertEqual('304 Not Modified', res.status) | Basic functional tests for conditional http. Refs #<I> | OnroerendErfgoed_crabpy_pyramid | train | py |
e64f2c175d9d9f79b8e667b9449c241b7215a4d3 | diff --git a/aeron-cluster/src/test/java/io/aeron/cluster/StartFromTruncatedRecordingLogTest.java b/aeron-cluster/src/test/java/io/aeron/cluster/StartFromTruncatedRecordingLogTest.java
index <HASH>..<HASH> 100644
--- a/aeron-cluster/src/test/java/io/aeron/cluster/StartFromTruncatedRecordingLogTest.java
+++ b/aeron-cluster/src/test/java/io/aeron/cluster/StartFromTruncatedRecordingLogTest.java
@@ -148,7 +148,7 @@ public class StartFromTruncatedRecordingLogTest
@Test
public void shouldBeAbleToStartClusterFromTruncatedRecordingLog()
{
- assertTimeoutPreemptively(ofSeconds(10), () ->
+ assertTimeoutPreemptively(ofSeconds(45), () ->
{
stopAndStartClusterWithTruncationOfRecordingLog();
assertClusterIsFunctioningCorrectly(); | [Java] Increase timeout on StartFromTruncatedRecordingLogTest. | real-logic_aeron | train | java |
2852310c3211fc78d462e502842fad0607f8d68a | diff --git a/glue/ligolw/lsctables.py b/glue/ligolw/lsctables.py
index <HASH>..<HASH> 100644
--- a/glue/ligolw/lsctables.py
+++ b/glue/ligolw/lsctables.py
@@ -1458,8 +1458,7 @@ class CoincRingdownTable(table.Table):
"frequency": "real_8",
"quality": "real_8",
"snr": "real_8",
- "false_alarm_rate": "real_8",
- "uncombined-ifar": "real_8"
+ "false_alarm_rate": "real_8"
}
# FIXME: like some other tables here, this table should have the
# constraint that the coinc_event_id column is a primary key. this | removed uncombined-ifo colum from coinc_ringdown table | gwastro_pycbc-glue | train | py |
6fded9c82e619b43fc24e5767a38962612972a0c | diff --git a/src/ZipStream.php b/src/ZipStream.php
index <HASH>..<HASH> 100644
--- a/src/ZipStream.php
+++ b/src/ZipStream.php
@@ -312,12 +312,9 @@ class ZipStream
*
* Examples:
*
- * // create a temporary file stream and write text to it
- * $fp = tmpfile();
- * fwrite($fp, 'The quick brown fox jumped over the lazy dog.');
- *
+ * $stream = $response->getBody();
* // add a file named 'streamfile.txt' from the content of the stream
- * $x->addFileFromPsr7Stream('streamfile.txt', $fp);
+ * $x->addFileFromPsr7Stream('streamfile.txt', $stream);
*
* @return void
*/ | fix doc comment example for psr7stream (#<I>)
fix #<I> | maennchen_ZipStream-PHP | train | php |
e62b504d52f903e9ee6d7d5eb9c43cdf2b14a1fe | diff --git a/cairocffi/surfaces.py b/cairocffi/surfaces.py
index <HASH>..<HASH> 100644
--- a/cairocffi/surfaces.py
+++ b/cairocffi/surfaces.py
@@ -13,6 +13,7 @@
import io
import sys
import ctypes
+import weakref
from . import ffi, cairo, _check_status, constants
from .fonts import FontOptions, _encode_string
@@ -81,8 +82,15 @@ class KeepAlive(object):
def __init__(self, *objects):
self.objects = objects
+ weakself = weakref.ref(self)
+
+ def closure(_):
+ value = weakself()
+ if value is not None:
+ value.instances.remove(value)
+
callback = ffi.callback(
- 'cairo_destroy_func_t', lambda _: self.instances.remove(self))
+ 'cairo_destroy_func_t', closure)
# cairo wants a non-NULL closure pointer.
self.closure = (callback, callback) | Resolve circular dependency in KeepAlive object. | Kozea_cairocffi | train | py |
61ba74619f4592277b72aee1c613a18bb76fdb56 | diff --git a/openfisca_core/legislations.py b/openfisca_core/legislations.py
index <HASH>..<HASH> 100644
--- a/openfisca_core/legislations.py
+++ b/openfisca_core/legislations.py
@@ -90,8 +90,18 @@ def compact_dated_node_json(dated_node_json, code = None, instant = None):
tax_scale.add_bracket(threshold, amount)
return tax_scale
- # MarginalRateTaxScale
- tax_scale = taxscales.MarginalRateTaxScale(name = code, option = dated_node_json.get('option'))
+ rates_kind = dated_node_json.get('rates_kind', None)
+ if rates_kind == "average":
+ # LinearAverageRateTaxScale
+ tax_scale = taxscales.LinearAverageRateTaxScale(
+ name = code,
+ option = dated_node_json.get('option'),
+ unit = dated_node_json.get('unit'),
+ )
+ else:
+ # MarginalRateTaxScale
+ tax_scale = taxscales.MarginalRateTaxScale(name = code, option = dated_node_json.get('option'))
+
for dated_slice_json in dated_node_json['slices']:
base = dated_slice_json.get('base', 1)
assert not isinstance(base, list) | Adapt legislations to deal with average tax scales | openfisca_openfisca-core | train | py |
9be384ce29398be49b44a90868ec58ad970b1bc4 | diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php
index <HASH>..<HASH> 100644
--- a/DependencyInjection/Configuration.php
+++ b/DependencyInjection/Configuration.php
@@ -107,6 +107,26 @@ class Configuration implements ConfigurationInterface
->ifTrue(function($v) { return isset($v['debug']); })
->thenInvalid('The "debug" name cannot be used as it is reserved for the handler of the profiler')
->end()
+ ->setExample(array(
+ 'syslog' => array(
+ 'type' => 'stream',
+ 'path' => '/var/log/symfony.log',
+ 'level' => 'ERROR',
+ 'bubble' => 'false',
+ 'formatter' => 'my_formatter',
+ 'processors' => array('some_callable')
+ ),
+ 'main' => array(
+ 'type' => 'fingerscrossed',
+ 'action_level' => 'WARNING',
+ 'buffer_size' => 30,
+ 'handler' => 'custom',
+ ),
+ 'custom' => array(
+ 'type' => 'service',
+ 'id' => 'my_handler'
+ )
+ ))
->end()
->end()
; | [MonologBundle] added configuration info | symfony_monolog-bundle | train | php |
d630c21fe6a6fb448671cff419394acb7dd40e4e | diff --git a/src/BackgroundProcess.php b/src/BackgroundProcess.php
index <HASH>..<HASH> 100755
--- a/src/BackgroundProcess.php
+++ b/src/BackgroundProcess.php
@@ -47,7 +47,7 @@ class BackgroundProcess
*
* @codeCoverageIgnore
*/
- public function __construct($command)
+ public function __construct($command = null)
{
$this->command = $command;
$this->serverOS = $this->getOS();
@@ -62,6 +62,7 @@ class BackgroundProcess
*/
public function run($outputFile = '/dev/null', $append = false)
{
+ if(is_null($this->command)) return;
switch ($this->getOS()) {
case self::OS_WINDOWS:
shell_exec(sprintf('%s &', $this->command, $outputFile));
@@ -133,6 +134,16 @@ class BackgroundProcess
return $this->pid;
}
+
+ /**
+ * Set the process id.
+ *
+ * @param $pid
+ */
+ public function setPid($pid)
+ {
+ $this->pid = $pid;
+ }
/**
* @return int | Allow resume the process any time by setting process id
With those updates we could execute a command save the pid on the database and if we need to do something while the process is running we can return and do something like that.
```
$process = new BackgroundProcess();
$process->setPid($my_process_id);
$process->stop();
``` | cocur_background-process | train | php |
5dc7bb7233efee125922cc63e286c96a73b9326c | diff --git a/src/ajax.js b/src/ajax.js
index <HASH>..<HASH> 100644
--- a/src/ajax.js
+++ b/src/ajax.js
@@ -66,8 +66,7 @@ jQuery.fn.extend({
},
serializeArray: function() {
return this.map(function(){
- return jQuery.nodeName(this, "form") ?
- jQuery.makeArray(this.elements) : this;
+ return this.elements ? jQuery.makeArray(this.elements) : this;
})
.filter(function(){
return this.name && !this.disabled && | jquery ajax: closes #<I>. Slight modification on serializeArray, shorter and faster code, and allows a custom form object. | jquery_jquery | train | js |
cb05bc80f67eb08646c9f58c7e7676d924250bcf | diff --git a/lib/transports/index.js b/lib/transports/index.js
index <HASH>..<HASH> 100644
--- a/lib/transports/index.js
+++ b/lib/transports/index.js
@@ -1,5 +1,15 @@
/**
+ * Module dependencies
+ */
+
+var XHR = require('./polling-xhr')
+ , JSONP = require('./polling-jsonp')
+ , websocket = require('./websocket')
+ , flashsocket = require('./flashsocket')
+ , util = require('../util')
+
+/**
* Export transports.
*/ | Refactored transports index deps | socketio_engine.io-client | train | js |
7049cb5185bf1ac922a90028994f5817b40f1ed1 | diff --git a/src/DefaultNode.php b/src/DefaultNode.php
index <HASH>..<HASH> 100644
--- a/src/DefaultNode.php
+++ b/src/DefaultNode.php
@@ -38,9 +38,11 @@ class DefaultNode implements Fertile, Node
static::validateAttributes($attributes);
$this->tagName = $tagName;
$this->attributes = $attributes;
- $children = array_map(function($child){
- return is_string($child) ? new TextNode($child) : $child;
- }, $children);
+ foreach($children as &$child) {
+ if(is_string($child)) {
+ $child = new TextNode($child);
+ }
+ }
$this->children = $children;
}
@@ -179,7 +181,6 @@ class DefaultNode implements Fertile, Node
/** HELPER METHODS */
/**
- * @todo trim whitespace
* @param $class
*/
protected function addClass($class) { | replaced array_map with foreach for performance | mschop_NoTeePHP | train | php |
8e4f2ab1c775fba997eb8608ead4b5bef5dddf47 | diff --git a/isso/views/comments.py b/isso/views/comments.py
index <HASH>..<HASH> 100644
--- a/isso/views/comments.py
+++ b/isso/views/comments.py
@@ -887,7 +887,7 @@ class API(object):
except ValueError:
return BadRequest("limit should be integer")
comments = self.comments.fetch(**args)
- base = conf.get('base')
+ base = conf.get('base').rstrip('/')
hostname = urlparse(base).netloc
# Let's build an Atom feed. | feed: remove trailing / from base URL
This way, one can use "/" as base URL. This is only valid if we are
sure that URI should always have a leading "/". Is that the case?
Fix #<I>. | posativ_isso | train | py |
2edb22b60077b7b710396804ce7f4dd364aa0633 | diff --git a/core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/DefaultExamSystem.java b/core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/DefaultExamSystem.java
index <HASH>..<HASH> 100644
--- a/core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/DefaultExamSystem.java
+++ b/core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/DefaultExamSystem.java
@@ -226,8 +226,7 @@ public class DefaultExamSystem implements ExamSystem {
for (Option option : combinedOptions) {
boolean found = false;
for (Class<?> c : requestedOptionTypes) {
- option.getClass().asSubclass(c);
- found = true;
+ found = c.isAssignableFrom(option.getClass());
break;
}
if (!found) { | [PAXEXAM-<I>] fixed broken exception logic | ops4j_org.ops4j.pax.exam2 | train | java |
41ec04a2a440bdee972eebc76efdf657655ee0e9 | diff --git a/lib/lebowski/foundation/mixins/positioned_element.rb b/lib/lebowski/foundation/mixins/positioned_element.rb
index <HASH>..<HASH> 100644
--- a/lib/lebowski/foundation/mixins/positioned_element.rb
+++ b/lib/lebowski/foundation/mixins/positioned_element.rb
@@ -16,6 +16,17 @@ module Lebowski
return 0
end
+ def position_relative_to(obj)
+ if not obj.kind_of? PositionedElement
+ raise ArgumentInvalidTypeError.new "obj", obj, PositionedElement
+ end
+
+ x = position.x - obj.position.x
+ y = position.y - obj.position.y
+
+ return Coords.new(x, y)
+ end
+
def scroll_to_visible()
end | Added method position_relative_to to the PositionedElement mixin | FrozenCanuck_Lebowski | train | rb |
9c09dfb1262d7ebfa53145adb73b3ed988c7e637 | diff --git a/gremlin-test/src/main/java/com/tinkerpop/gremlin/structure/TransactionTest.java b/gremlin-test/src/main/java/com/tinkerpop/gremlin/structure/TransactionTest.java
index <HASH>..<HASH> 100644
--- a/gremlin-test/src/main/java/com/tinkerpop/gremlin/structure/TransactionTest.java
+++ b/gremlin-test/src/main/java/com/tinkerpop/gremlin/structure/TransactionTest.java
@@ -524,6 +524,8 @@ public class TransactionTest extends AbstractGremlinTest {
AbstractGremlinSuite.assertVertexEdgeCounts(1, 0);
}
+ // todo: is this a feature. neo4j doesn't respect transactional state in getVertices()
+
@Ignore("Still fails even in TinkerPop3")
@Test
@FeatureRequirement(featureClass = Graph.Features.GraphFeatures.class, feature = Graph.Features.GraphFeatures.FEATURE_TRANSACTIONS) | Add todo for failing test. | apache_tinkerpop | train | java |
064f044e98e6630a39cbe0f0911d023c1c228a22 | diff --git a/mysite/ruby/deploy.rb b/mysite/ruby/deploy.rb
index <HASH>..<HASH> 100644
--- a/mysite/ruby/deploy.rb
+++ b/mysite/ruby/deploy.rb
@@ -85,7 +85,7 @@ namespace :deploy do
if !exists?(:prevent_devbuild)
# Run the mighty dev/build, as a webserver user if requested.
if exists?(:webserver_user)
- run "sudo -u #{webserver_user} #{latest_release}/#{_sake_path} dev/build flush=1"
+ run "sudo su #{webserver_user} -c \"#{latest_release}/#{_sake_path} dev/build flush=1\""
else
run "#{latest_release}/#{_sake_path} dev/build flush=1"
end | sudo su in away that the remote server can understand | silverstripe-archive_deploynaut | train | rb |
1c6eba55fdfdee536e6cc1fe4a0f4864827fd36c | diff --git a/src/widgets/DynamicFormWidget.php b/src/widgets/DynamicFormWidget.php
index <HASH>..<HASH> 100644
--- a/src/widgets/DynamicFormWidget.php
+++ b/src/widgets/DynamicFormWidget.php
@@ -35,6 +35,20 @@ class DynamicFormWidget extends \wbraganca\dynamicform\DynamicFormWidget
});
JS
);
+ // For init Destination Region Inputs
+ $view->registerJs(<<<JS
+ $('.{$this->widgetContainer}').on('afterInsert', function(e, item) {
+ var destinationRegionInputs = $(item).find('[data-destination-field]');
+ if (destinationRegionInputs.length) {
+ destinationRegionInputs.each(function() {
+ if (typeof tryToResolveDestinationRange === 'function') {
+ $(this).on('select2:selecting', tryToResolveDestinationRange);
+ }
+ });
+ }
+ });
+JS
+ );
// For init select2
$view->registerJs(<<<JS
$('.{$this->widgetContainer}').on('afterInsert afterDelete', function(e, item) { | Added Dynamic Field initer | hiqdev_hipanel-core | train | php |
732518387596ccd88b7381f5dd7bbc2c95b17b19 | diff --git a/kafka_utils/kafka_manual_throttle/main.py b/kafka_utils/kafka_manual_throttle/main.py
index <HASH>..<HASH> 100644
--- a/kafka_utils/kafka_manual_throttle/main.py
+++ b/kafka_utils/kafka_manual_throttle/main.py
@@ -116,7 +116,7 @@ def human_throttle(throttle):
if throttle is None:
return "N/A"
- return humanfriendly.format_size(int(throttle), binary=True)
+ return humanfriendly.format_size(int(throttle), binary=True) + "/s"
def print_throttles(zk, brokers): | KAFKA-<I>: Change unit printed in debugging commands from MiB to MiB/s | Yelp_kafka-utils | train | py |
64ca7e7d52b5d5d3f18021574cfc03de4fb31c04 | diff --git a/src/EventQueue.php b/src/EventQueue.php
index <HASH>..<HASH> 100644
--- a/src/EventQueue.php
+++ b/src/EventQueue.php
@@ -129,7 +129,7 @@ class EventQueue extends \SplPriorityQueue implements EventQueueInterface
{
$priority = new EventQueuePriority;
$priority->value = $this->priorities[$command];
- $priority->timestamp = microtime(true);
+ $priority->timestamp = microtime(true) * 10000;
return $priority;
} | Fixed EventQueue comparison not working due to priority timestamp not being an integer | phergie_phergie-irc-bot-react | train | php |
12e2e44f23361b42dc2bc38f7afde2286b92a1eb | diff --git a/lib/thumbnailer.js b/lib/thumbnailer.js
index <HASH>..<HASH> 100644
--- a/lib/thumbnailer.js
+++ b/lib/thumbnailer.js
@@ -24,6 +24,12 @@ function Thumbnailer(opts) {
*/
Thumbnailer.prototype.execute = function(description, localPaths, onComplete) {
var _this = this;
+
+ // Convert single path array
+ if (!_.isArray(localPaths)) {
+ localPaths = [localPaths];
+ }
+
// parameters for a single execution
// of the thumbnailer.
_.extend(this, { | convert single path to array to keep Thumbnailer.execute api the same | bcoe_thumbd | train | js |
f45da3c7b168d34e7d3c520068dc24364753a74a | diff --git a/lib/plugins/package/lib/packageService.js b/lib/plugins/package/lib/packageService.js
index <HASH>..<HASH> 100644
--- a/lib/plugins/package/lib/packageService.js
+++ b/lib/plugins/package/lib/packageService.js
@@ -16,6 +16,7 @@ module.exports = {
'yarn-*.log',
'.serverless/**',
'.serverless_plugins/**',
+ 'node_modules/aws-sdk/**',
],
getIncludes(include) { | perf(packaging): Exclude "aws-sdk" dependency (#<I>)
As it's unconditionally provided in AWS environment | serverless_serverless | train | js |
1d37728817921be7c5e4db0c19ed4e750d0f51ca | diff --git a/src/main/java/redis/clients/jedis/JedisPool.java b/src/main/java/redis/clients/jedis/JedisPool.java
index <HASH>..<HASH> 100644
--- a/src/main/java/redis/clients/jedis/JedisPool.java
+++ b/src/main/java/redis/clients/jedis/JedisPool.java
@@ -1,8 +1,5 @@
package redis.clients.jedis;
-import java.io.IOException;
-import java.net.UnknownHostException;
-
import redis.clients.util.FixedResourcePool;
public class JedisPool extends FixedResourcePool<Jedis> {
@@ -29,12 +26,17 @@ public class JedisPool extends FixedResourcePool<Jedis> {
@Override
protected Jedis createResource() {
Jedis jedis = new Jedis(this.host, this.port, this.timeout);
- try {
- jedis.connect();
- } catch (UnknownHostException e) {
- throw new JedisException(e);
- } catch (IOException e) {
- throw new JedisException(e);
+ boolean done = false;
+ while (!done) {
+ try {
+ jedis.connect();
+ done = true;
+ } catch (Exception e) {
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e1) {
+ }
+ }
}
return jedis;
} | If it is not possible to create the resource, keep trying until it can | xetorthio_jedis | train | java |
3c2f84cd13619a3cee11dfc48a0c4a862922c863 | diff --git a/phpunit.php b/phpunit.php
index <HASH>..<HASH> 100644
--- a/phpunit.php
+++ b/phpunit.php
@@ -1,3 +1,5 @@
<?php
include './vendor/autoload.php';
+
+class_alias('Fuel\Common\Arr', 'Arr');
diff --git a/src/Fuel/Config/Container.php b/src/Fuel/Config/Container.php
index <HASH>..<HASH> 100644
--- a/src/Fuel/Config/Container.php
+++ b/src/Fuel/Config/Container.php
@@ -196,7 +196,7 @@ class Container extends DataContainer
{
$extension = pathinfo($path, PATHINFO_EXTENSION);
$handler = $this->getHandler($extension);
- $config = arr_merge($config, $handler->load($path));
+ $config = \Arr::merge($config, $handler->load($path));
}
if ($group) | replaced arr functions by Arr static methods | fuelphp_config | train | php,php |
e57f1c9844a3841ba3325625e97a19b1f9ab6fd0 | diff --git a/lib/Gentle/Bitbucket/API/Repositories/Issues.php b/lib/Gentle/Bitbucket/API/Repositories/Issues.php
index <HASH>..<HASH> 100644
--- a/lib/Gentle/Bitbucket/API/Repositories/Issues.php
+++ b/lib/Gentle/Bitbucket/API/Repositories/Issues.php
@@ -17,7 +17,7 @@ use Gentle\Bitbucket\API\Repositories;
/**
* Issue class
*
- * [Class description]
+ * Provides functionality for interacting with an issue tracker.
*
* @author Alexandru G. <alex@gentle.ro>
*/
diff --git a/lib/Gentle/Bitbucket/API/User/Repositories.php b/lib/Gentle/Bitbucket/API/User/Repositories.php
index <HASH>..<HASH> 100644
--- a/lib/Gentle/Bitbucket/API/User/Repositories.php
+++ b/lib/Gentle/Bitbucket/API/User/Repositories.php
@@ -16,7 +16,8 @@ use Gentle\Bitbucket\API;
/**
* Repositories class
*
- * [Class description]
+ * Get the details of the repositories associated with
+ * an individual or team account.
*
* @author Alexandru G. <alex@gentle.ro>
*/ | added short description for user/repositories and repositries/issues classes | gentlero_bitbucket-api | train | php,php |
5f1348f6310ce688c6aca52ef2f8fbef0f9376fa | diff --git a/daflib.py b/daflib.py
index <HASH>..<HASH> 100644
--- a/daflib.py
+++ b/daflib.py
@@ -124,8 +124,10 @@ class SPK(Ephemeris):
init, intlen, rsize, n = self.daf[stop-3:stop]
coefficient_count = (rsize - 2) // component_count
print(summary)
- self.jalpha = T0 + summary.start_second / S_PER_DAY
- self.jomega = T0 + summary.stop_second / S_PER_DAY
+ # TODO: use intlen directly to create days_per_set
+ self.jalpha = T0 + init / S_PER_DAY
+ self.jomega = self.jalpha + intlen * n / S_PER_DAY
+ print('omega:', init + intlen * n)
print(init, intlen, rsize, n)
data = self.daf.bytes(summary.start_index, stop)
s = np.ndarray((n, rsize), self.daf.endian + 'd', data)
@@ -139,8 +141,8 @@ def main2():
s = SPK('jup310.bsp')
p = s.position(3, T0)
print(p)
- # p = s.position(502, T0)
- # print(p)
+ p = s.position(502, T0)
+ print(p)
def main():
with open('jup310.bsp', 'rb') as f: | Make predictions exact by fixing time endpoints | brandon-rhodes_python-jplephem | train | py |
73df93969a28efe6e98459a38564ca77295afe62 | diff --git a/src/ol/renderer/canvas/canvastilelayerrenderer.js b/src/ol/renderer/canvas/canvastilelayerrenderer.js
index <HASH>..<HASH> 100644
--- a/src/ol/renderer/canvas/canvastilelayerrenderer.js
+++ b/src/ol/renderer/canvas/canvastilelayerrenderer.js
@@ -197,6 +197,10 @@ ol.renderer.canvas.TileLayer.prototype.prepareFrame =
if (goog.isDef(layerState.extent)) {
extent = ol.extent.getIntersection(extent, layerState.extent);
}
+ if (ol.extent.isEmpty(extent)) {
+ // Return false to prevent the rendering of the layer.
+ return false;
+ }
var tileRange = tileGrid.getTileRangeForExtentAndResolution(
extent, tileResolution); | No composeFrame if layer and view don't intersect
ol.renderer.canvas.TileLayer#prepareFrame immediately returns false if the layer extent and the view extent do not intersect. | openlayers_openlayers | train | js |
65e04510b1576a0bfddd307f19154a44f0fb58d8 | diff --git a/pandas/core/internals.py b/pandas/core/internals.py
index <HASH>..<HASH> 100644
--- a/pandas/core/internals.py
+++ b/pandas/core/internals.py
@@ -327,10 +327,6 @@ class Block(PandasObject):
fill_value=fill_value, mask_info=mask_info)
return self.make_block(new_values, fastpath=True)
- def get(self, item):
- loc = self.items.get_loc(item)
- return self.values[loc]
-
def iget(self, i):
return self.values[i]
@@ -1662,13 +1658,6 @@ class NonConsolidatableMixIn(object):
assert locs.tolist() == [0]
self.values = values
- def get(self, item):
- if self.ndim == 1:
- loc = self.items.get_loc(item)
- return self.values[loc]
- else:
- return self.values
-
def putmask(self, mask, new, align=True, inplace=False, axis=0,
transpose=False, mgr=None):
"""
@@ -4730,8 +4719,6 @@ def _concat_indexes(indexes):
def _block2d_to_blocknd(values, placement, shape, labels, ref_items):
""" pivot to the labels shape """
- from pandas.core.internals import make_block
-
panel_shape = (len(placement),) + shape
# TODO: lexsort depth needs to be 2!! | CLN: remove unused get methods in internals (#<I>)
* Remove unused get methods that would raise AttributeError if called
* Remove unnecessary import | pandas-dev_pandas | train | 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.