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 |
|---|---|---|---|---|---|
e5f106c6986360787a389dcfa72a15381362e62a | diff --git a/code/forms/OrderForm.php b/code/forms/OrderForm.php
index <HASH>..<HASH> 100644
--- a/code/forms/OrderForm.php
+++ b/code/forms/OrderForm.php
@@ -73,8 +73,8 @@ class OrderForm extends Form {
// 2) Payment fields
$currentOrder = ShoppingCart::current_order();
- $total = '$' . number_format($currentOrder->Total(), 2);//TODO: make this multi-currency
- $paymentFields = Payment::combined_form_fields("$total " . $currentOrder->Currency(), $currentOrder->Total());
+ //$total = '$' . number_format($currentOrder->Total(), 2);//TODO: make this multi-currency
+ $paymentFields = Payment::combined_form_fields($currentOrder->Total());
foreach($paymentFields as $field) $rightFields->push($field);
if($paymentRequiredFields = Payment::combined_form_requirements()) $requiredFields = array_merge($requiredFields, $paymentRequiredFields);
@@ -209,7 +209,7 @@ class OrderForm extends Form {
$payment->Amount->Amount = $order->Total();
$payment->write();
- //prepare $data
+ //prepare $data - ie put into the $data array any fields that may need to be there for payment
// Process payment, get the result back
$result = $payment->processPayment($data, $form); | modifed the way Payment::combined_form_fields is called | silvershop_silvershop-core | train | php |
ca7cf12f2fbdf2b9989686ba82b39e9cb7bed8e8 | diff --git a/lib/vcenter_lib/version.rb b/lib/vcenter_lib/version.rb
index <HASH>..<HASH> 100644
--- a/lib/vcenter_lib/version.rb
+++ b/lib/vcenter_lib/version.rb
@@ -1,3 +1,3 @@
module VcenterLib
- VERSION = '0.0.1'.freeze
+ VERSION = '0.0.2'.freeze
end | m<I>'s version bumper | m-31_vcenter_lib | train | rb |
16cebd393a9fb256d8293df79e75ba66fe408e13 | diff --git a/pyqode/python/modes/code_completion.py b/pyqode/python/modes/code_completion.py
index <HASH>..<HASH> 100644
--- a/pyqode/python/modes/code_completion.py
+++ b/pyqode/python/modes/code_completion.py
@@ -86,6 +86,7 @@ class JediCompletionProvider(CompletionProvider):
"""
Completes python code using `jedi`_.
"""
+ retVal = []
try:
import jedi
retVal = []
@@ -114,6 +115,8 @@ class JediCompletionProvider(CompletionProvider):
suggestionType)
retVal.append(Completion(completion.name, icon=icon,
tooltip=desc.split(':')[1]))
+ except ImportError:
+ logger.error("Failed to import jedi. Check your jedi installation")
except Exception as e:
logger.error("Jedi failed to provide completions. Error: %s" % e)
return retVal | jedi fails to import properly in a frozen application, this completly break the code completion. With this fix, the document word completion will work fin on frozen app (we loose Jedi however) | pyQode_pyqode.python | train | py |
5afd98c24188bdaf5cc7bf4204fe34a247cba4c2 | diff --git a/lib/licensee/version.rb b/lib/licensee/version.rb
index <HASH>..<HASH> 100644
--- a/lib/licensee/version.rb
+++ b/lib/licensee/version.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
module Licensee
- VERSION = '9.14.1'
+ VERSION = '9.15.0'
end | Bump licensee to <I> | licensee_licensee | train | rb |
0ca670e3b5e513c6aa7feb0da2fd49c3445ccbfc | diff --git a/src/LinearAlgebra/Vector.php b/src/LinearAlgebra/Vector.php
index <HASH>..<HASH> 100644
--- a/src/LinearAlgebra/Vector.php
+++ b/src/LinearAlgebra/Vector.php
@@ -191,6 +191,18 @@ class Vector implements \ArrayAccess
}
/**
+ * Print the vector as a string
+ * Ex:
+ * [1, 2, 3]
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return '[' . implode(', ', $this->A) . ']';
+ }
+
+ /**
* ArrayAccess INTERFACE
*/ | Add add toString method to Vector. | markrogoyski_math-php | train | php |
bf034992668acbb260bad7ffdc1c8ca727f1bf4b | diff --git a/src/components/com_people/domains/entities/person.php b/src/components/com_people/domains/entities/person.php
index <HASH>..<HASH> 100644
--- a/src/components/com_people/domains/entities/person.php
+++ b/src/components/com_people/domains/entities/person.php
@@ -44,6 +44,10 @@ final class ComPeopleDomainEntityPerson extends ComActorsDomainEntityActor
const USERTYPE_REGISTERED = 'registered';
const USERTYPE_ADMINISTRATOR = 'administrator';
const USERTYPE_SUPER_ADMINISTRATOR = 'super-administrator';
+
+ const GENDER_MALE = 'male';
+ const GENDER_FEMALE = 'female';
+ CONST GENDER_NEUTRAL = 'neutral';
/**
* Initializes the default configuration for the object.
@@ -109,7 +113,10 @@ final class ComPeopleDomainEntityPerson extends ComActorsDomainEntityActor
'required' => AnDomain::VALUE_NOT_EMPTY,
'default' => self::USERTYPE_GUEST,
),
- 'gender',
+ 'gender' => array(
+ 'required' => AnDomain::VALUE_NOT_EMPTY,
+ 'default' => self::GENDER_NEUTRAL,
+ ),
'lastVisitDate' => array(
'default' => 'date'
), | Person Entity
- added: default value of neutral for the gender field.
Note: we may remove gender alltoghether. | anahitasocial_anahita | train | php |
53357fa82c3f94d11260458c169c83b6a08ca055 | diff --git a/ftfy/bad_codecs/utf8_variants.py b/ftfy/bad_codecs/utf8_variants.py
index <HASH>..<HASH> 100644
--- a/ftfy/bad_codecs/utf8_variants.py
+++ b/ftfy/bad_codecs/utf8_variants.py
@@ -68,9 +68,8 @@ CESU8_RE = re.compile(CESU8_EXPR)
# CESU-8, which have to be handled carefully on Python 2.
SURROGATE_EXPR = (b'(\xed[\xa0-\xbf][\x80-\xbf])')
-# This expression matches the Java encoding of U+0. We don't need to check
-# for its truncated version, because that will get passed on to the standard
-# UTF-8 decoder, which will agree that we need to see more bytes.
+# This expression matches the Java encoding of U+0, including if it's
+# truncated and we need more bytes.
NULL_EXPR = b'(\xc0(\x80|$))' | fix comment about truncated encoding of U<I> | LuminosoInsight_python-ftfy | train | py |
5e1f623585c77b3c8bbf20b1154042cf87f998c1 | diff --git a/meshio/__about__.py b/meshio/__about__.py
index <HASH>..<HASH> 100644
--- a/meshio/__about__.py
+++ b/meshio/__about__.py
@@ -4,7 +4,7 @@ __version__ = '1.11.3'
__author__ = u'Nico Schlömer'
__author_email__ = 'nico.schloemer@gmail.com'
__copyright__ = \
- u'Copyright (c) 2015-2018, {} <{}>'.format(__author__, __email__)
+ u'Copyright (c) 2015-2018, {} <{}>'.format(__author__, __author_email__)
__website__ = 'https://github.com/nschloe/meshio'
__license__ = 'License :: OSI Approved :: MIT License'
__status__ = 'Development Status :: 5 - Production/Stable' | another fix for __about__ | nschloe_meshio | train | py |
e6237140f7179ffc2b2aae346071d07fef79fc03 | diff --git a/packages/ember-routing/lib/system/route.js b/packages/ember-routing/lib/system/route.js
index <HASH>..<HASH> 100644
--- a/packages/ember-routing/lib/system/route.js
+++ b/packages/ember-routing/lib/system/route.js
@@ -1059,6 +1059,26 @@ Ember.Route = Ember.Object.extend(Ember.ActionHandler, {
By default, the `setupController` hook sets the `content` property of
the controller to the `model`.
+ If you implement the `setupController` hook in your Route, it will
+ prevent this default behavior. If you want to preserve that behavior
+ when implementing your `setupController` function, make sure to call
+ `_super`:
+
+ ```js
+ App.PhotosRoute = Ember.Route.extend({
+ model: function() {
+ return App.Photo.find();
+ },
+
+ setupController: function (controller, model) {
+ // Call _super for default behavior
+ this._super(controller, model);
+ // Implement your custom setup after
+ this.controllerFor('application').set('showingPhotos', true);
+ }
+ });
+ ```
+
This means that your template will get a proxy for the model as its
context, and you can act as though the model itself was the context. | [DOC beta] Docs for over-riding default behavior in `setupController` | emberjs_ember.js | train | js |
585714bc7aefaabc8b2544aa530c6701bb4cc3f3 | diff --git a/lib/beaker-hostgenerator/data.rb b/lib/beaker-hostgenerator/data.rb
index <HASH>..<HASH> 100644
--- a/lib/beaker-hostgenerator/data.rb
+++ b/lib/beaker-hostgenerator/data.rb
@@ -1949,7 +1949,10 @@ module BeakerHostGenerator
# }
def get_platform_info(bhg_version, platform, hypervisor)
info = get_osinfo(bhg_version)[platform]
- {}.deep_merge!(info[:general]).deep_merge!(info[hypervisor])
+ result = {}
+ result.deep_merge!(info[:general]) if info[:general]
+ result.deep_merge!(info[hypervisor]) if info[hypervisor]
+ result
end
# Perform any adjustments or modifications necessary to the given node | Deal with nil when merging | puppetlabs_beaker-hostgenerator | train | rb |
9d99abb51e66ea20f145a4f4b99bbf9a5e9bd57b | diff --git a/resttest.py b/resttest.py
index <HASH>..<HASH> 100644
--- a/resttest.py
+++ b/resttest.py
@@ -164,8 +164,11 @@ class ValidatorJson:
# default to false, if we have a check it has to hit either count or expected checks!
output = False
- if self.operator is not None and self.operator == "empty":
- # nothing found, but we didn't expect anything. pass!
+ if self.operator is not None and self.operator == "exists":
+ # require actual value
+ output = True if self.actual is not None else False
+ elif self.operator is not None and self.operator == "empty":
+ # expect no actual value
output = True if self.actual is None else False
elif self.count is not None and (isinstance(self.actual, dict) or isinstance(self.actual, list)):
logging.debug("ValidatorJson: " + str(len(self.actual)) + " == " + str(self.count) + " ? " + str(len(self.actual) == self.count)) | Added 'exists' operator to simply check for element existance, similar to 'empty' checking it doesn't exist | svanoort_pyresttest | train | py |
af3c3604285b9312dd18f5e254eb8a09672e28ad | diff --git a/python/thunder/utils/ec2.py b/python/thunder/utils/ec2.py
index <HASH>..<HASH> 100644
--- a/python/thunder/utils/ec2.py
+++ b/python/thunder/utils/ec2.py
@@ -36,6 +36,10 @@ def install_thunder(master, opts):
ssh(master, opts, "rm -rf thunder && git clone https://github.com/freeman-lab/thunder.git")
ssh(master, opts, "chmod u+x thunder/python/bin/build")
ssh(master, opts, "thunder/python/bin/build")
+ # copy local data examples to all workers
+ ssh(master, opts, "yum install -y pssh")
+ ssh(master, opts, "pssh -h /root/spark-ec2/slaves mkdir -p /root/thunder/python/thunder/utils/data/")
+ ssh(master, opts, "~/spark-ec2/copy-dir /root/thunder/python/thunder/utils/data/")
# install pip
ssh(master, opts, "wget http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz"
"#md5=62a9f08dd5dc69d76734568a6c040508") | Copy local data examples to all workers
This ensures that loading local example data also works on EC2 | thunder-project_thunder | train | py |
696f3a3ada8d748baa5719106e9b20b0fa716561 | diff --git a/batch.go b/batch.go
index <HASH>..<HASH> 100644
--- a/batch.go
+++ b/batch.go
@@ -20,6 +20,9 @@ import (
// take permanent effect only after a successful return is seen in
// caller.
//
+// The maximum batch size and delay can be adjusted with DB.MaxBatchSize
+// and DB.MaxBatchDelay, respectively.
+//
// Batch is only useful when there are multiple goroutines calling it.
func (db *DB) Batch(fn func(*Tx) error) error {
errCh := make(chan error, 1) | Add batch size and delay docs
This commit adds documentation for batch size and delay to the
DB.Batch() call. Previously there was no reference to these properties
from the Batch() call so it was nearly impossible for anyone to
know to adjust these settings.
Thanks to Kelly Sommers for bringing the doc issue to my attention. | boltdb_bolt | train | go |
29931635f5a6bd58814d77fd519439a015c01adb | diff --git a/src/Models/AdminModel.php b/src/Models/AdminModel.php
index <HASH>..<HASH> 100644
--- a/src/Models/AdminModel.php
+++ b/src/Models/AdminModel.php
@@ -9,7 +9,7 @@ use Symfony\Component\HttpFoundation\File\File;
/**
* Class AdminModel.
*/
-class AdminModel extends Model
+abstract class AdminModel extends Model
{
/**
* @var array Files to save.
@@ -105,6 +105,11 @@ class AdminModel extends Model
return $this->files;
}
+ public function setFiles($files)
+ {
+ $this->files = $files;
+ }
+
/**
* @return bool
*/ | Make AdminModel abstract and add method to manually set uploaded files. | despark_ignicms | train | php |
de2164ff7f32bcccdd3e647adecf37295729a33b | diff --git a/main.py b/main.py
index <HASH>..<HASH> 100755
--- a/main.py
+++ b/main.py
@@ -7,6 +7,9 @@ from xml.etree import ElementTree
from xml.dom import minidom
+__version__ = "0.9"
+
+
POWERLOG_LINE_RE = re.compile(r"^D ([\d:.]+) ([^(]+)\(\) - (.+)$")
OUTPUTLOG_LINE_RE = re.compile(r"\[Power\] ()([^(]+)\(\) - (.+)$")
@@ -558,6 +561,7 @@ class PowerLogParser:
def toxml(self):
root = ElementTree.Element("HearthstoneReplay")
+ root.attrib["version"] = __version__
for game in self.ast:
root.append(game.xml())
return pretty_xml(root) | Add a version attribute to the root tag | HearthSim_python-hsreplay | train | py |
fdec22d2a91e61d9726c3d2187775f19a8d07c73 | diff --git a/core/src/main/java/io/ddf/DDF.java b/core/src/main/java/io/ddf/DDF.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/io/ddf/DDF.java
+++ b/core/src/main/java/io/ddf/DDF.java
@@ -360,6 +360,10 @@ public abstract class DDF extends ALoggable //
return this.getManager().getEngine();
}
+ public DDFManager.EngineType getEngineType() {
+ return this.getManager().getEngineType();
+ }
+
// ////// MetaData that deserves to be right here at the top level ////////
public Schema getSchema() { | add method to getEngineType in DDF | ddf-project_DDF | train | java |
2c99926825bdc45f7808711efa4b155653f07339 | diff --git a/pyrogram/__init__.py b/pyrogram/__init__.py
index <HASH>..<HASH> 100644
--- a/pyrogram/__init__.py
+++ b/pyrogram/__init__.py
@@ -16,7 +16,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
-__version__ = "1.0.4"
+__version__ = "1.0.5"
__license__ = "GNU Lesser General Public License v3 or later (LGPLv3+)"
__copyright__ = "Copyright (C) 2017-2020 Dan <https://github.com/delivrance>" | Update Pyrogram to <I> | pyrogram_pyrogram | train | py |
4901e6664a9a69faa98988294c39a88446dcafcb | diff --git a/src/Traits/ControllerTrait.php b/src/Traits/ControllerTrait.php
index <HASH>..<HASH> 100644
--- a/src/Traits/ControllerTrait.php
+++ b/src/Traits/ControllerTrait.php
@@ -229,7 +229,7 @@ trait ControllerTrait
* @param array $options
* @return mixed
*/
- public static function removingHandler(array $options)
+ public static function removalHandler(array $options)
{
if (!$options['entity']) {
throw new HttpException(404, "Entity not found");
@@ -258,7 +258,7 @@ trait ControllerTrait
* @param array $options
* @return \Symfony\Component\HttpFoundation\Response
*/
- public static function SerializedRemovingHandler(array $options)
+ public static function SerializedRemovalHandler(array $options)
{
return self::Serialize(
self::removingHandler($options), | Added proper naming for removalHandler | mindlahus_symfony-assets | train | php |
fef6e75348a82a2fdfdea00f2ce6421c15bff8ff | diff --git a/src/components/SimpleCommandFactory.php b/src/components/SimpleCommandFactory.php
index <HASH>..<HASH> 100644
--- a/src/components/SimpleCommandFactory.php
+++ b/src/components/SimpleCommandFactory.php
@@ -53,6 +53,10 @@ class SimpleCommandFactory implements CommandFactoryInterface
/** @var Model $command */
$command = $this->container->get($className, $config);
+ if ($args) {
+ $command->load($args, '');
+ }
+
return $command;
}
} | added command loading with given args in SimpleCommandFactory | hiqdev_yii2-autobus | train | php |
24a3950db98744fd30b65c118ff05a22b3a8e6f2 | diff --git a/www/skins/prod/jquery.WorkZone.js b/www/skins/prod/jquery.WorkZone.js
index <HASH>..<HASH> 100644
--- a/www/skins/prod/jquery.WorkZone.js
+++ b/www/skins/prod/jquery.WorkZone.js
@@ -566,6 +566,10 @@ var p4 = p4 || {};
if (!frame.hasClass('closed'))
{
+ // hide tabs content
+ var activeTabIdx = $('#idFrameC .tabs').tabs("option", "active");
+ $('#idFrameC .tabs > div:eq('+activeTabIdx+')').hide();
+
frame.data('openwidth', frame.width());
frame.animate({width: 100},
300,
@@ -595,6 +599,9 @@ var p4 = p4 || {};
frame.removeClass('closed');
$('.escamote', frame).show();
frame.unbind('click.escamote');
+ // show tabs content
+ var activeTabIdx = $('#idFrameC .tabs').tabs("option", "active");
+ $('#idFrameC .tabs > div:eq('+activeTabIdx+')').show();
}
}
}; | Fix #<I> workzone content is displayed when it is closed | alchemy-fr_Phraseanet | train | js |
408344575f69c4dfba1899549dd21b233e7e60d2 | diff --git a/base/tests.py b/base/tests.py
index <HASH>..<HASH> 100644
--- a/base/tests.py
+++ b/base/tests.py
@@ -89,6 +89,13 @@ class TestLogin(TestCase):
response = self.client.get("/", follow=True)
self.assertRedirects(response, reverse('external'))
+ def test_site_map(self):
+ response = self.client.get("/site_map/")
+ self.assertEqual(response.status_code, 200)
+ self.client.login(username="u", password="pwd")
+ response = self.client.get("/site_map/")
+ self.assertEqual(response.status_code, 200)
+
class TestHomepage(TestCase):
def setUp(self):
self.u = User.objects.create_user(username="u", password="pwd") | Added a test for the site map | knagra_farnsworth | train | py |
b23e53f6b851e31984705c83f90239693791ff7f | diff --git a/boomer/boomer.go b/boomer/boomer.go
index <HASH>..<HASH> 100644
--- a/boomer/boomer.go
+++ b/boomer/boomer.go
@@ -98,7 +98,7 @@ type Boomer struct {
}
func (b *Boomer) startProgress() {
- if b.Output == "" {
+ if b.Output != "" {
return
}
b.bar = pb.New(b.N)
@@ -107,14 +107,14 @@ func (b *Boomer) startProgress() {
}
func (b *Boomer) finalizeProgress() {
- if b.Output == "" {
+ if b.Output != "" {
return
}
b.bar.Finish()
}
func (b *Boomer) incProgress() {
- if b.Output == "" {
+ if b.Output != "" {
return
}
b.bar.Increment() | Don't report progress in csv mode. | rakyll_hey | train | go |
784ac99eac8e4511140f53bc533651c27f29e605 | diff --git a/src/main/java/water/util/Utils.java b/src/main/java/water/util/Utils.java
index <HASH>..<HASH> 100644
--- a/src/main/java/water/util/Utils.java
+++ b/src/main/java/water/util/Utils.java
@@ -1379,8 +1379,7 @@ public class Utils {
}
public static void printConfusionMatrix(StringBuilder sb, long[][] cm, String[] domain, boolean html) {
- assert(cm != null);
- assert(domain != null);
+ if (cm == null || domain == null) return;
for (int i=0; i<cm.length; ++i) assert(cm.length == cm[i].length);
if (html) DocGen.HTML.arrayHead(sb);
// Sum up predicted & actuals | Bail out from printing Confusion Matrix if domain or cm is null. | h2oai_h2o-2 | train | java |
e1e43ff112780cc3d43ecbfeba9918686ad2bc62 | diff --git a/components/lib/multiselect/MultiSelect.js b/components/lib/multiselect/MultiSelect.js
index <HASH>..<HASH> 100644
--- a/components/lib/multiselect/MultiSelect.js
+++ b/components/lib/multiselect/MultiSelect.js
@@ -486,7 +486,7 @@ export const MultiSelect = React.memo(React.forwardRef((props, ref) => {
for (let optgroup of props.options) {
let filteredSubOptions = FilterService.filter(getOptionGroupChildren(optgroup), searchFields, filterValue, props.filterMatchMode, props.filterLocale);
if (filteredSubOptions && filteredSubOptions.length) {
- filteredGroups.push({ ...optgroup, ...{ items: filteredSubOptions } });
+ filteredGroups.push({ ...optgroup, ...{ [props.optionGroupChildren] : filteredSubOptions } });
}
}
return filteredGroups; | Fix #<I>: Multiselect filtering with groups (#<I>) | primefaces_primereact | train | js |
3f512651f306f5409228965e47d60774c57e87a9 | diff --git a/cards.go b/cards.go
index <HASH>..<HASH> 100644
--- a/cards.go
+++ b/cards.go
@@ -209,12 +209,16 @@ func (c *CardClient) List(params *CardListParams) (*CardList, error) {
// on updates they are simply the parameter name.
func (c *CardParams) appendTo(values *url.Values, creating bool) {
if creating {
- values.Add("card[number]", c.Number)
- values.Add("card[exp_month]", c.Month)
- values.Add("card[exp_year]", c.Year)
+ if len(c.Token) > 0 {
+ values.Add("card", c.Token)
+ } else {
+ values.Add("card[number]", c.Number)
+ values.Add("card[exp_month]", c.Month)
+ values.Add("card[exp_year]", c.Year)
- if len(c.CVC) > 0 {
- values.Add("card[cvc]", c.CVC)
+ if len(c.CVC) > 0 {
+ values.Add("card[cvc]", c.CVC)
+ }
}
} | Changed appendTo() to look if CardParams.Token is set, and if so, to use it. This fixes
Cards.Create() when using a stripe token from stripe.js | stripe_stripe-go | train | go |
8344066ec0457f31685492d0f8ec7f43f37c082d | diff --git a/asyncpg/_testbase.py b/asyncpg/_testbase.py
index <HASH>..<HASH> 100644
--- a/asyncpg/_testbase.py
+++ b/asyncpg/_testbase.py
@@ -96,6 +96,9 @@ class ConnectedTestCase(ClusterTestCase):
def tearDown(self):
try:
self.con.close()
+ # Give event loop another iteration so that connection
+ # transport has a chance to properly close.
+ self.loop.run_until_complete(asyncio.sleep(0, loop=self.loop))
self.con = None
finally:
super().tearDown() | tests: Fix asyncio unclosed transport warnings | MagicStack_asyncpg | train | py |
a02f5b93559a0d0b6dd11f298fa09d0b613b30ec | diff --git a/cloudvolume/datasource/precomputed/metadata.py b/cloudvolume/datasource/precomputed/metadata.py
index <HASH>..<HASH> 100644
--- a/cloudvolume/datasource/precomputed/metadata.py
+++ b/cloudvolume/datasource/precomputed/metadata.py
@@ -626,10 +626,10 @@ Hops:
self.info['scales'] = self.info['scales'][0:1]
def add_resolution(self, res, encoding=None, chunk_size=None, info=None):
- if isinstance(res[0], float):
+ if lib.floating(res):
factor = Vec(*res, dtype=float) / self.resolution(0)
else:
- factor = Vec(*res, dtype=float) // self.resolution(0)
+ factor = Vec(*res) // self.resolution(0)
return self.add_scale(factor, encoding, chunk_size, info) | fix(resolution): integer resolution accidently converted to float | seung-lab_cloud-volume | train | py |
8e9b03e076fa6d24d35274ab8e3a8e9bc8569b80 | diff --git a/src/resources/views/admin/_form.blade.php b/src/resources/views/admin/_form.blade.php
index <HASH>..<HASH> 100644
--- a/src/resources/views/admin/_form.blade.php
+++ b/src/resources/views/admin/_form.blade.php
@@ -10,7 +10,7 @@
<file-manager related-table="{{ $model->getTable() }}" :related-id="{{ $model->id ?? 0 }}"></file-manager>
<file-field type="image" field="image_id" data="{{ $model->image }}"></file-field>
-<files related-table="{{ $model->getTable() }}" :related-id="{{ $model->id ?? 0 }}"></files>
+<files-field related-table="{{ $model->getTable() }}" :related-id="{{ $model->id ?? 0 }}"></files-field>
@include('core::form._title-and-slug')
<div class="form-group"> | <files-field> in place of <files> | TypiCMS_Objects | train | php |
c56542adca38e4f51055c08dc741d5a48b657c9f | diff --git a/tests/hamming_test.go b/tests/hamming_test.go
index <HASH>..<HASH> 100644
--- a/tests/hamming_test.go
+++ b/tests/hamming_test.go
@@ -13,6 +13,10 @@ func TestHamming(t *testing.T) {
{"AAAA", "AABB", 2},
{"BAAA", "AAAA", 1},
{"BAAA", "CCCC", 4},
+ {"karolin", "kathrin", 3},
+ {"karolin", "kerstin", 3},
+ {"1011101", "1001001", 2},
+ {"2173896", "2233796", 3},
}
for _, c := range cases { | Add more tests to the Hamming function. | xrash_smetrics | train | go |
9586a51f7ccfe064cd5180d7085d373e4f1960b9 | diff --git a/lib/sandstorm/filters/base.rb b/lib/sandstorm/filters/base.rb
index <HASH>..<HASH> 100644
--- a/lib/sandstorm/filters/base.rb
+++ b/lib/sandstorm/filters/base.rb
@@ -63,11 +63,11 @@ module Sandstorm
ret
end
- def find_by_ids(ids)
+ def find_by_ids(*ids)
lock { _ids.collect {|id| _find_by_id(id) } }
end
- def find_by_ids!(ids)
+ def find_by_ids!(*ids)
ret = lock { _ids.collect {|id| _find_by_id(id) } }
unless ids.length.eql?(ret.length)
raise ::Sandstorm::Records::Errors::RecordsNotFound.new(@associated_class, ids - ret.map(&:id)) | re-add find_by_ids globbing, got dropped | flapjack_zermelo | train | rb |
a2b01584230f02635b0196c50e96b975fd0fb3b9 | diff --git a/course/mod.php b/course/mod.php
index <HASH>..<HASH> 100644
--- a/course/mod.php
+++ b/course/mod.php
@@ -56,6 +56,9 @@
if (is_string($return)) {
error($return, "view.php?id=$mod->course");
}
+ add_to_log($mod->course, "course", "update mod",
+ "../mod/$mod->modulename/view.php?id=$mod->coursemodule",
+ "$mod->modulename $mod->instance");
add_to_log($mod->course, $mod->modulename, "update",
"view.php?id=$mod->coursemodule",
"$mod->instance", $mod->coursemodule);
@@ -94,6 +97,9 @@
if (! set_field("course_modules", "section", $sectionid, "id", $mod->coursemodule)) {
error("Could not update the course module with the correct section");
}
+ add_to_log($mod->course, "course", "add mod",
+ "../mod/$mod->modulename/view.php?id=$mod->coursemodule",
+ "$mod->modulename $mod->instance");
add_to_log($mod->course, $mod->modulename, "add",
"view.php?id=$mod->coursemodule",
"$mod->instance", $mod->coursemodule); | Adding back the missing logs ... they are needed by recent activity - doh! | moodle_moodle | train | php |
9cc1ef63ac91923f2bfd3aafdd3608dd3e1da16b | diff --git a/src/Yubikey/Validate.php b/src/Yubikey/Validate.php
index <HASH>..<HASH> 100644
--- a/src/Yubikey/Validate.php
+++ b/src/Yubikey/Validate.php
@@ -136,7 +136,7 @@ class Validate
*/
public function setUseSecure($use)
{
- if (!is_boolean($use)) {
+ if (!is_bool($use)) {
throw new \InvalidArgumentException('"Use secure" value must be boolean');
}
$this->useSecure = $use; | correcting is_boolean to is_bool in set secure | enygma_yubikey | train | php |
7e70bd415815a5dcca19df0eb99735fe43d5cbf3 | diff --git a/test/deep_pluck_at_model_test.rb b/test/deep_pluck_at_model_test.rb
index <HASH>..<HASH> 100644
--- a/test/deep_pluck_at_model_test.rb
+++ b/test/deep_pluck_at_model_test.rb
@@ -10,4 +10,10 @@ class DeepPluckAtModelTest < Minitest::Test
expected = {'name' => 'Pearl' , :posts => [{'name' => "post4"}, {'name' => "post5"}]}
assert_equal(expected, User.where(:name => %w(Pearl)).first.deep_pluck(:name, :posts => [:name]))
end
+
+ def test_2_level_deep_with_id
+ user = User.find_by(name: 'Pearl')
+ expected = {'id' => user.id, 'name' => 'Pearl', :posts => [{'name' => "post4"}, {'name' => "post5"}]}
+ assert_equal(expected, user.deep_pluck(:id, :name, posts: :name))
+ end
end | test that id should not disappear | khiav223577_deep_pluck | train | rb |
0fd0d68962bfde407b6a35116efe277293e43962 | diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb
index <HASH>..<HASH> 100644
--- a/activerecord/test/cases/base_test.rb
+++ b/activerecord/test/cases/base_test.rb
@@ -895,7 +895,7 @@ class BasicsTest < ActiveRecord::TestCase
assert g.save
# Reload and check that we have all the geometric attributes.
- h = Geometric.find(g.id)
+ h = ActiveRecord::IdentityMap.without { Geometric.find(g.id) }
assert_equal '(5,6.1)', h.a_point
assert_equal '[(2,3),(5.5,7)]', h.a_line_segment
@@ -923,7 +923,7 @@ class BasicsTest < ActiveRecord::TestCase
assert g.save
# Reload and check that we have all the geometric attributes.
- h = Geometric.find(g.id)
+ h = ActiveRecord::IdentityMap.without { Geometric.find(g.id) }
assert_equal '(5,6.1)', h.a_point
assert_equal '[(2,3),(5.5,7)]', h.a_line_segment | Bypass IdentityMap in PostgreSQL geometric tests.
The identity map cache prevents us from seeing the DB formatted strings. | rails_rails | train | rb |
8a2d3d97ec43a05ffd8dca7716dfe3013fd16e9d | diff --git a/lib/role_authorization/roles/manager.rb b/lib/role_authorization/roles/manager.rb
index <HASH>..<HASH> 100644
--- a/lib/role_authorization/roles/manager.rb
+++ b/lib/role_authorization/roles/manager.rb
@@ -9,8 +9,8 @@ module RoleAuthorization
attr_accessor :klass
def initialize
- @global_roles = {}
- @object_roles = []
+ @global_roles = []
+ @object_roles = {}
@groups = Hash.new
@creations = Hash.new(Array.new)
@nicknames = Hash.new {|hash, key| key} | fix bug in manager initialization where global is an arry and object is the hash | asceth_role_authorization | train | rb |
6b79ff852485291e7a534e12448288328e2d6c61 | diff --git a/core/src/com/google/inject/internal/InternalContext.java b/core/src/com/google/inject/internal/InternalContext.java
index <HASH>..<HASH> 100644
--- a/core/src/com/google/inject/internal/InternalContext.java
+++ b/core/src/com/google/inject/internal/InternalContext.java
@@ -106,7 +106,7 @@ final class InternalContext {
* DependencyAndSource objects, which can add to several tens of megabytes in large applications.
*/
private static final class DependencyStack {
- private Object[] elements = new Object[10];
+ private Object[] elements = new Object[16];
private int size = 0;
public void add(Object dependencyOrKey, Object source) { | Change initial DependencyStack size from <I> to <I> | sonatype_sisu-guice | train | java |
e96799cb72eafa06c040d6cd9418c8e35fce17e6 | diff --git a/test/expiration.js b/test/expiration.js
index <HASH>..<HASH> 100644
--- a/test/expiration.js
+++ b/test/expiration.js
@@ -4,9 +4,9 @@ require('../');
describe('Expiration', function () {
- describe('cc-expiration', function () {
+ beforeEach(angular.mock.module('credit-cards'));
- beforeEach(angular.mock.module('credit-cards'));
+ describe('cc-exp-month', function () {
var scope, controller;
beforeEach(angular.mock.inject(function ($injector) { | rearrange in prep for year + cc-exp tests | bendrucker_angular-credit-cards | train | js |
93d795b1acf848f8aa26724ad53f11a17b1ee8a9 | diff --git a/doapi/droplet.py b/doapi/droplet.py
index <HASH>..<HASH> 100644
--- a/doapi/droplet.py
+++ b/doapi/droplet.py
@@ -4,7 +4,6 @@ from .base import Actionable, ResourceWithID, Region, Size, Kernel, \
Networks, BackupWindow, ResourceWithDroplet, Taggable, \
fromISO8601
from .image import Image
-from .tag import Tag ### TODO: Fix circular import
class Droplet(Actionable, ResourceWithID, Taggable):
"""
@@ -74,7 +73,7 @@ class Droplet(Actionable, ResourceWithID, Taggable):
:vartype status: string
:var tags: tags that have been applied to the droplet
- :vartype tags: list of `Tag`s
+ :vartype tags: list of strings
:var vcpus: number of virtual CPUs
:vartype vcpus: int
@@ -109,12 +108,6 @@ class Droplet(Actionable, ResourceWithID, Taggable):
if self.get('created_at') is not None and \
not isinstance(self.created_at, datetime):
self.created_at = fromISO8601(self.created_at)
- tags = []
- for t in self.get('tags', []):
- if not isinstance(t, Tag):
- t = Tag(t, doapi_manager=self.doapi_manager)
- tags.append(t)
- self.tags = tags
@property
def active(self): | `Droplet.tags` is now a list of strings
Converting just a string (rather than an actual dict/object) into a `Tag` isn't
really the right thing to do. Also, this gets rid of the circular import
problem. | jwodder_doapi | train | py |
6bd7e85a537155eb291cdfca75d5f8ca0ae2270f | diff --git a/src/wormhole/test/test_transit.py b/src/wormhole/test/test_transit.py
index <HASH>..<HASH> 100644
--- a/src/wormhole/test/test_transit.py
+++ b/src/wormhole/test/test_transit.py
@@ -1572,6 +1572,7 @@ class Full(ServerBase, unittest.TestCase):
s.set_transit_key(KEY)
r.set_transit_key(KEY)
+ # TODO: this sometimes fails with EADDRINUSE
shints = yield s.get_connection_hints()
rhints = yield r.get_connection_hints() | test_transit sometimes fails with EADDRINUSE on travis | warner_magic-wormhole | train | py |
c18fefe14648aa76b959469fa9551f78eb53276d | diff --git a/jodd-proxetta/src/main/java/jodd/proxetta/ClassInfo.java b/jodd-proxetta/src/main/java/jodd/proxetta/ClassInfo.java
index <HASH>..<HASH> 100644
--- a/jodd-proxetta/src/main/java/jodd/proxetta/ClassInfo.java
+++ b/jodd-proxetta/src/main/java/jodd/proxetta/ClassInfo.java
@@ -26,6 +26,7 @@
package jodd.proxetta;
import java.lang.annotation.Annotation;
+import java.util.Map;
/**
* Various target class information.
@@ -53,10 +54,21 @@ public interface ClassInfo {
String getReference();
/**
+ * Returns array of super classes.
+ */
+ public String[] getSuperClasses();
+
+ /**
* Returns annotation information or <code>null</code> if target class has no annotations.
*/
AnnotationInfo[] getAnnotations();
+ /**
+ * Returns a map of generic definitions. Keys are map names and values are
+ * raw types (after erasure).
+ */
+ Map<String, String> getGenerics();
+
// ---------------------------------------------------------------- annotations
/**
@@ -95,5 +107,4 @@ public interface ClassInfo {
return false;
}
-
-}
+}
\ No newline at end of file | Expose one more method in ClassInfo | oblac_jodd | train | java |
2350d216a5617ffbdd26d41612a9f51dd3c3c3c0 | diff --git a/src/js/utils/styles.js b/src/js/utils/styles.js
index <HASH>..<HASH> 100644
--- a/src/js/utils/styles.js
+++ b/src/js/utils/styles.js
@@ -23,7 +23,11 @@ export const baseStyle = css`
export const controlBorderStyle = css`
border: ${props => props.theme.global.control.border.width} solid
- ${props => normalizeColor('border', props.theme)};
+ ${props =>
+ normalizeColor(
+ props.theme.global.control.border.color || 'border',
+ props.theme,
+ )};
border-radius: ${props => props.theme.global.control.border.radius};
`; | adding control to input style (#<I>) | grommet_grommet | train | js |
a6816a0cce6db6030e756d6f248341a2fab567ac | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -28,7 +28,7 @@ setup(
packages=['django_prices_vatlayer'],
include_package_data=True,
classifiers=CLASSIFIERS,
- install_requires=['Django', 'requests', 'dj-database-url'],
+ install_requires=['Django', 'requests', 'dj-database-url', 'psycopg2'],
platforms=['any'],
test_suite='django_prices_vatlayer.tests',
tests_require=['pytest', 'pytest-django'], | Add psycopg2 to requirements | mirumee_django-prices-vatlayer | train | py |
e59db2a9612e99793bd4917447adfe00dc4d5d6d | diff --git a/holoviews/plotting/mpl/__init__.py b/holoviews/plotting/mpl/__init__.py
index <HASH>..<HASH> 100644
--- a/holoviews/plotting/mpl/__init__.py
+++ b/holoviews/plotting/mpl/__init__.py
@@ -136,8 +136,8 @@ Store.register({Curve: CurvePlot,
Polygons: PolygonPlot}, 'matplotlib', style_aliases=style_aliases)
-MPLPlot.sideplots.update({Histogram: SideHistogramPlot})
-
+MPLPlot.sideplots.update({Histogram: SideHistogramPlot,
+ GridSpace: GridPlot})
options = Store.options(backend='matplotlib')
# Charts | Added GridPlot to potential plots | pyviz_holoviews | train | py |
9e85e80089a6b67f9533fbbc34cf44eea537f9f8 | diff --git a/assets/js/log.js b/assets/js/log.js
index <HASH>..<HASH> 100644
--- a/assets/js/log.js
+++ b/assets/js/log.js
@@ -208,9 +208,6 @@
}
function stringify(obj) {
- if (obj === undefined) {
- return 'undefined';
- }
if (!obj) {
return obj + '';
} | refactor: Output null&undefined | avwo_whistle | train | js |
5eb09e21462731a8811bd6869803f472e10511dd | diff --git a/salesforce/tests/test_integration.py b/salesforce/tests/test_integration.py
index <HASH>..<HASH> 100644
--- a/salesforce/tests/test_integration.py
+++ b/salesforce/tests/test_integration.py
@@ -9,6 +9,7 @@ from decimal import Decimal
import datetime
import pytz
import random
+import string
from django.conf import settings
from django.db import connections | add a random slug to emails to prevent multiple test runs from clobbering each other (gah!) | django-salesforce_django-salesforce | train | py |
cf49c966d76101ead7f88fc30d1c156c89bb8aff | diff --git a/providers/nats/nats.go b/providers/nats/nats.go
index <HASH>..<HASH> 100644
--- a/providers/nats/nats.go
+++ b/providers/nats/nats.go
@@ -16,10 +16,6 @@ import (
"github.com/sirupsen/logrus"
)
-var (
- mutex = &sync.Mutex{}
-)
-
// Nats provides nats publish and subscribe
type Nats struct {
client stan.Conn
@@ -150,6 +146,7 @@ func (n *Nats) Shutdown() {
n.shutdown = true
var wg sync.WaitGroup
for k, v := range n.topics {
+ wg.Add(1)
logrus.Infof("Shutting down sub for %s", k)
go func(v *stan.Subscription) {
(*v).Close() | Add to waitgroup for each topci | lileio_pubsub | train | go |
cfdea04e2eb95b9ce9c80ee6d49a2ce2416c6d04 | diff --git a/salt/modules/kvm_hyper.py b/salt/modules/kvm_hyper.py
index <HASH>..<HASH> 100644
--- a/salt/modules/kvm_hyper.py
+++ b/salt/modules/kvm_hyper.py
@@ -46,6 +46,8 @@ def __virtual__():
return False
if __grains__['virtual'] != 'physical':
return False
+ if __grains__['kernel'] != 'Linux':
+ return False
if 'kvm_' not in open('/proc/modules').read():
return False
if not has_libvirt: | adding check to bypass kvm on FreeBSD | saltstack_salt | train | py |
ea60745dbd510046fce4365f7375dfe5c2c4cd48 | diff --git a/ui/src/components/table/table-body.js b/ui/src/components/table/table-body.js
index <HASH>..<HASH> 100644
--- a/ui/src/components/table/table-body.js
+++ b/ui/src/components/table/table-body.js
@@ -57,6 +57,7 @@ export default {
}
if (this.$listeners['row-click'] !== void 0) {
+ data.class['cursor-pointer'] = true
data.on = {
click: evt => {
this.$emit('row-click', evt, row) | feat(QTable): Auto add 'cursor-pointer' class on tr when there is a 'row-click' listener (on grid this must be added by hand) #<I> (#<I>) | quasarframework_quasar | train | js |
292abce4ad5f09110ceb12f15390a230bcda489f | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -67,7 +67,7 @@ install_requires = [
'munkres>=1.0.7',
'Unidecode>=0.4.19',
'autosemver',
- 'inspire-schemas~=50.0,>=50.0.0',
+ 'inspire-schemas~=51.0,>=51.0.0',
]
packages = find_packages() | setup: bump inspire-schemas to version ~<I> | inspirehep_inspire-json-merger | train | py |
771698029cf12b83f72e631f27e2e3af9d65fcfd | diff --git a/mutex.go b/mutex.go
index <HASH>..<HASH> 100644
--- a/mutex.go
+++ b/mutex.go
@@ -40,6 +40,10 @@ func (m *Mutex) Lock() error {
}
for i := 0; i < m.tries; i++ {
+ if i != 0 {
+ time.Sleep(m.delay)
+ }
+
start := time.Now()
n := 0
@@ -59,8 +63,6 @@ func (m *Mutex) Lock() error {
for _, pool := range m.pools {
m.release(pool, value)
}
-
- time.Sleep(m.delay)
}
return ErrFailed | Update mutex.go
do not sleep after all tries failed | go-redsync_redsync | train | go |
152d0d28dc630e5ac5529492bd1773dcb0d04ac1 | diff --git a/h2o-py/h2o/h2o.py b/h2o-py/h2o/h2o.py
index <HASH>..<HASH> 100644
--- a/h2o-py/h2o/h2o.py
+++ b/h2o-py/h2o/h2o.py
@@ -1094,7 +1094,7 @@ def interaction(data, factors, pairwise, max_factors, min_occurrence, destinatio
return get_frame(parms["dest"])
-def as_list(data, use_pandas=True):
+def as_list(data, use_pandas=True, header=True):
"""
Convert an H2O data object into a python-specific object.
@@ -1106,13 +1106,17 @@ def as_list(data, use_pandas=True):
:param data: an H2O data object.
:param use_pandas: If True, try to use pandas for reading in the data.
+ :param header: If True, return column names as first element in list
:returns: List of list (Rows x Columns).
"""
assert_is_type(data, H2OFrame)
assert_is_type(use_pandas, bool)
- return H2OFrame.as_data_frame(data, use_pandas=use_pandas)
-
+ assert_is_type(header, bool)
+ frame = H2OFrame.as_data_frame(data, use_pandas=use_pandas)
+ if not header:
+ frame.pop(0)
+ return frame
def demo(funcname, interactive=True, echo=True, test=False): | add header option to as_list to control column names being returned | h2oai_h2o-3 | train | py |
29f6a51ee766ecad67217c11d2816268f37f1a84 | diff --git a/db/sql/slice_utils.go b/db/sql/slice_utils.go
index <HASH>..<HASH> 100644
--- a/db/sql/slice_utils.go
+++ b/db/sql/slice_utils.go
@@ -50,7 +50,7 @@ func SliceIt(pointerToASlice interface{}, it ValIterator) error {
if sliceElemPtr {
sliceElemType = sliceElemType.Elem()
}
- for i := 0; i < 5; i++ {
+ for {
row := reflect.New(sliceElemType)
if stop := it.GetNext(row.Interface()); stop {
break | ODPM-<I> removed safety for loop upper bound from slice_utils.go | ligato_cn-infra | train | go |
186a620ef1d013fb20a9f0eab168bcff1fe8a308 | diff --git a/ui/mirage/config.js b/ui/mirage/config.js
index <HASH>..<HASH> 100644
--- a/ui/mirage/config.js
+++ b/ui/mirage/config.js
@@ -413,6 +413,9 @@ export default function() {
this.get(`http://${host}/v1/client/fs/ls/:allocation_id`, clientAllocationFSLsHandler);
this.get(`http://${host}/v1/client/stat/ls/:allocation_id`, clientAllocationFSStatHandler);
+ this.get(`http://${host}/v1/client/fs/cat/:allocation_id`, clientAllocationCatHandler);
+ this.get(`http://${host}/v1/client/fs/stream/:allocation_id`, clientAllocationStreamHandler);
+ this.get(`http://${host}/v1/client/fs/readat/:allocation_id`, clientAllocationReadAtHandler);
this.get(`http://${host}/v1/client/stats`, function({ clientStats }) {
return this.serialize(clientStats.find(host)); | Include all client fs endpoints in the hosts block | hashicorp_nomad | train | js |
7f9c921788b2a39f682784703a82f34e5f01ef76 | diff --git a/openquake/commonlib/oqvalidation.py b/openquake/commonlib/oqvalidation.py
index <HASH>..<HASH> 100644
--- a/openquake/commonlib/oqvalidation.py
+++ b/openquake/commonlib/oqvalidation.py
@@ -76,7 +76,7 @@ class OqParam(valid.ParamSet):
valid.intensity_measure_types_and_levels, None)
# hazard_imtls = valid.Param(valid.intensity_measure_types_and_levels, {})
interest_rate = valid.Param(valid.positivefloat)
- investigation_time = valid.Param(valid.positivefloat, 50.)
+ investigation_time = valid.Param(valid.positivefloat, None)
loss_curve_resolution = valid.Param(valid.positiveint, 50)
lrem_steps_per_interval = valid.Param(valid.positiveint, 0)
steps_per_interval = valid.Param(valid.positiveint, 0) | investigation_time has a default of None | gem_oq-engine | train | py |
a3a9b303f7168462989eb382d571f8f35dd27c08 | diff --git a/testgrid/cmd/configurator/prow.go b/testgrid/cmd/configurator/prow.go
index <HASH>..<HASH> 100644
--- a/testgrid/cmd/configurator/prow.go
+++ b/testgrid/cmd/configurator/prow.go
@@ -41,8 +41,9 @@ func applySingleProwjobAnnotations(c *Config, pc *prowConfig.Config, j prowConfi
description := j.Name
mustMakeGroup := j.Annotations[testgridCreateTestGroupAnnotation] == "true"
+ mustNotMakeGroup := j.Annotations[testgridCreateTestGroupAnnotation] == "false"
dashboards, addToDashboards := j.Annotations[testgridDashboardsAnnotation]
- mightMakeGroup := mustMakeGroup || addToDashboards
+ mightMakeGroup := (mustMakeGroup || addToDashboards || jobType != prowapi.PresubmitJob) && !mustNotMakeGroup
if mightMakeGroup {
if c.config.FindTestGroup(testGroupName) != nil { | By default, create a group for every post/periodic job | kubernetes_test-infra | train | go |
a09d68b2034b14355f877d75f7d493b92e36d4b8 | diff --git a/Cake/ORM/Entity.php b/Cake/ORM/Entity.php
index <HASH>..<HASH> 100644
--- a/Cake/ORM/Entity.php
+++ b/Cake/ORM/Entity.php
@@ -357,7 +357,7 @@ class Entity implements \ArrayAccess, \JsonSerializable {
* @return array
*/
public function jsonSerialize() {
- return $this->_properties;
+ return $this->toArray();
}
/** | Serializing an entity into JSON should call accessors.
Converting entities into JSON should call accessor methods incase they
modify on read. | cakephp_cakephp | train | php |
ea337e1f297615e4208bf78668121f38388b7a6f | diff --git a/lib/pool.js b/lib/pool.js
index <HASH>..<HASH> 100644
--- a/lib/pool.js
+++ b/lib/pool.js
@@ -162,10 +162,15 @@ class Pool extends EventEmitter {
if (err) {
return cb(err);
}
- const executeCmd = conn.execute(sql, values, cb);
- executeCmd.once('end', () => {
+ try {
+ const executeCmd = conn.execute(sql, values, cb);
+ executeCmd.once('end', () => {
+ conn.release();
+ });
+ } catch (e) {
conn.release();
- });
+ throw e;
+ }
});
} | If execute() throws an exception, release the connection | sidorares_node-mysql2 | train | js |
fcc2cd5a8faff4d56f57111687d0267545a01f05 | diff --git a/lib/active_job/queue_adapters/resque_adapter.rb b/lib/active_job/queue_adapters/resque_adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/active_job/queue_adapters/resque_adapter.rb
+++ b/lib/active_job/queue_adapters/resque_adapter.rb
@@ -1,10 +1,12 @@
require 'resque'
require 'active_support/core_ext/enumerable'
require 'active_support/core_ext/array/access'
+
begin
require 'resque-scheduler'
-rescue LoadError
- require 'resque_scheduler'
+rescue LoadError => e
+ $stderr.puts 'The ActiveJob resque adapter requires resque-scheduler. Please add it to your Gemfile and run bundle install'
+ raise e
end
module ActiveJob | Improve the error message when resque-scheduler is not available | rails_rails | train | rb |
e6874d9ff6cbb713cc26baee2a2c153d0cdf1feb | diff --git a/mod/forum/lib.php b/mod/forum/lib.php
index <HASH>..<HASH> 100644
--- a/mod/forum/lib.php
+++ b/mod/forum/lib.php
@@ -444,7 +444,31 @@ function forum_get_course_forum($courseid, $type) {
}
$forum->timemodified = time();
$forum->id = insert_record("forum", $forum);
- return get_record_sql("SELECT * from forum WHERE id = '$forum->id'");
+
+ if ($forum->type != "teacher") {
+ if (! $module = get_record("modules", "name", "forum")) {
+ notify("Could not find forum module!!");
+ return false;
+ }
+ $mod->course = $courseid;
+ $mod->module = $module->id;
+ $mod->instance = $forum->id;
+ $mod->section = 0;
+ if (! $mod->coursemodule = add_course_module($mod) ) { // assumes course/lib.php is loaded
+ notify("Could not add a new course module to the course '$course->fullname'");
+ return false;
+ }
+ if (! $sectionid = add_mod_to_section($mod) ) { // assumes course/lib.php is loaded
+ notify("Could not add the new course module to that section");
+ return false;
+ }
+ if (! set_field("course_modules", "section", $sectionid, "id", $mod->coursemodule)) {
+ notify("Could not update the course module with the correct section");
+ return false;
+ }
+ }
+
+ return get_record("forum", "id", "$forum->id");
}
} | Brand-new news and social forums are now also assigned course modules and
put in section 0 of the course. | moodle_moodle | train | php |
d375f9b73da0e12f7eff41f19c78cd66423a7fed | diff --git a/test/test.request.js b/test/test.request.js
index <HASH>..<HASH> 100644
--- a/test/test.request.js
+++ b/test/test.request.js
@@ -125,7 +125,9 @@ tape( 'if a query is successful, a JSON object is returned to a provided callbac
function clbk( error, response, body ) {
if ( error ) {
- throw error;
+ t.ok( false, error.message );
+ t.end();
+ return;
}
t.equal( typeof response, 'object', 'second argument is an object' );
@@ -155,7 +157,9 @@ tape( 'HTTPS is supported', function test( t ) {
function clbk( error, response, body ) {
if ( error ) {
- throw error;
+ t.ok( false, error.message );
+ t.end();
+ return;
}
t.equal( typeof response, 'object', 'second argument is an object' ); | Update request tests to not throw in the event of an unexpected error | kgryte_github-get | train | js |
a285a70ce45328582a8819adca1459e571e5a769 | diff --git a/gwpy/io/nds/__init__.py b/gwpy/io/nds/__init__.py
index <HASH>..<HASH> 100644
--- a/gwpy/io/nds/__init__.py
+++ b/gwpy/io/nds/__init__.py
@@ -27,7 +27,6 @@ from math import (floor, ceil)
from ... import (version, detector)
from ...detector import Channel
from ...time import Time
-from ...timeseries import (TimeSeries, TimeSeriesList)
from .kerberos import * | io.nds: removed unused import | gwpy_gwpy | train | py |
2448ee041137384fc683684ccbb9644e6e0c1907 | diff --git a/code/libraries/koowa/components/com_activities/activity/interface.php b/code/libraries/koowa/components/com_activities/activity/interface.php
index <HASH>..<HASH> 100644
--- a/code/libraries/koowa/components/com_activities/activity/interface.php
+++ b/code/libraries/koowa/components/com_activities/activity/interface.php
@@ -53,7 +53,7 @@ interface ComActivitiesActivityInterface
*
* @link http://activitystrea.ms/specs/json/1.0/#activity See published property.
*
- * @return KDate The published date.
+ * @return KDateInterface The published date.
*/
public function getActivityPublished(); | re #<I> Improved doc block
Reference interface instead of concrete class. | joomlatools_joomlatools-framework | train | php |
bc25bbf7da1f5855ea2a8f466ab3c1fe984b376f | diff --git a/lib/SimpleSAML/XML/MetaDataStore.php b/lib/SimpleSAML/XML/MetaDataStore.php
index <HASH>..<HASH> 100644
--- a/lib/SimpleSAML/XML/MetaDataStore.php
+++ b/lib/SimpleSAML/XML/MetaDataStore.php
@@ -73,7 +73,7 @@ class SimpleSAML_XML_MetaDataStore {
}
if (!isset($this->hostmap[$set])) {
- throw new Exception('No default entities defined for metadata set [' . $set . ']');
+ throw new Exception('No default entities defined for metadata set [' . $set . '] (host:' . $currenthost. ')');
}
if (!isset($currenthost)) {
throw new Exception('Could not get HTTP_HOST, in order to resolve default entity ID'); | Adding debug info about host to lookup for missing metadata. | simplesamlphp_saml2 | train | php |
39fd86b221691ce9959265d826d24aaacc96617a | diff --git a/i18n/ko-kr.js b/i18n/ko-kr.js
index <HASH>..<HASH> 100644
--- a/i18n/ko-kr.js
+++ b/i18n/ko-kr.js
@@ -32,7 +32,7 @@ export default {
noData: '데이터가 없습니다.',
noResults: '결과가 없습니다.',
loader: '로드 중...',
- selectedRows: rows => rows > 0 ? `${rows} 개(가)${rows === 1 ? '' : 's'} 선택 되었습니다.` : '선택된 항목이 없습니다.',
+ selectedRows: rows => rows > 0 ? `${rows} 개가 선택 되었습니다.` : '선택된 항목이 없습니다.',
rowsPerPage: '페이지 당 개수:',
allRows: '전체',
pagination: (start, end, total) => `${total} 중 ${start}-${end}`,
@@ -50,7 +50,7 @@ export default {
superscript: '위 첨자',
hyperlink: '링크',
toggleFullscreen: '전체 화면',
- quote: 'Quote',
+ quote: '따옴표',
left: '왼쪽 정렬',
center: '가운데 정렬',
right: '오른쪽 정렬', | Update Korean translation. (#<I>)
* Update Korean translation
* Update ko-kr.js | quasarframework_quasar | train | js |
cdcc9b24d41e135e6681b6466aebdb31e2943430 | diff --git a/pdf/conduit/_version.py b/pdf/conduit/_version.py
index <HASH>..<HASH> 100644
--- a/pdf/conduit/_version.py
+++ b/pdf/conduit/_version.py
@@ -1 +1 @@
-__version__ = '1.8.5'
+__version__ = '1.8.6'
diff --git a/pdf/modify/_version.py b/pdf/modify/_version.py
index <HASH>..<HASH> 100644
--- a/pdf/modify/_version.py
+++ b/pdf/modify/_version.py
@@ -1 +1 @@
-__version__ = '2.2.2'
+__version__ = '2.2.3' | BUMP conduit and modify versions to support enhanced canvas constructor | mrstephenneal_pdfconduit | train | py,py |
e4442cd9d9092fc1927980902938a5a467933ea7 | diff --git a/niworkflows/interfaces/confounds.py b/niworkflows/interfaces/confounds.py
index <HASH>..<HASH> 100644
--- a/niworkflows/interfaces/confounds.py
+++ b/niworkflows/interfaces/confounds.py
@@ -25,7 +25,9 @@ class ExpandModelInputInterface(BaseInterfaceInputSpec):
model_formula = traits.Str(
'(dd1(rps + wm + csf + gsr))^^2 + others', usedefault=True,
desc='Formula for generating model expansions. By default, the '
- '32-parameter expansion will be generated.')
+ '32-parameter expansion will be generated. Note that any expressions '
+ 'to be expanded *must* be in parentheses, even if they include only '
+ 'a single variable (e.g., (x)^2, not x^2).')
output_file = traits.Str(desc='Output path')
@@ -476,6 +478,8 @@ def parse_formula(model_formula, parent_data, unscramble=False):
model_formula: str
Expression for the model formula, e.g.
'(a + b)^^2 + dd1(c + (d + e)^3) + f'
+ Note that any expressions to be expanded *must* be in parentheses,
+ even if they include only a single variable (e.g., (x)^2, not x^2).
parent_data: pandas DataFrame
A tabulation of all values usable in the model formula. Each additive
term in `model_formula` should correspond either to a variable in this | include cautionary note re formula format | poldracklab_niworkflows | train | py |
3ab06a7931591d8eb50b83052946a9dd8db88d4b | diff --git a/lib/jubilee/cli.rb b/lib/jubilee/cli.rb
index <HASH>..<HASH> 100644
--- a/lib/jubilee/cli.rb
+++ b/lib/jubilee/cli.rb
@@ -15,7 +15,7 @@ module Jubilee
def test_java_version!(version)
if version[0..2] < "1.8"
- puts("Error: Jubilee requires JDK 1.7.0 or later. You can use the official Oracle distribution or the OpenJDK version.")
+ puts("Error: Jubilee requires JDK 1.8.0 or later. You can use the official Oracle distribution or the OpenJDK version.")
exit 1
end
end | update jdk requirement to <I> | isaiah_jubilee | train | rb |
087f96fc3a9bbf7b4fff1bdd601ece93d3fb7fc6 | diff --git a/acceptance/tests/aix/aix_package_provider.rb b/acceptance/tests/aix/aix_package_provider.rb
index <HASH>..<HASH> 100644
--- a/acceptance/tests/aix/aix_package_provider.rb
+++ b/acceptance/tests/aix/aix_package_provider.rb
@@ -2,6 +2,12 @@ test_name "aix package provider should work correctly"
confine :to, :platform => /aix/
+dir = "/tmp/aix-packages-#{$$}"
+
+teardown do
+ on hosts, "rm -rf #{dir}"
+end
+
def assert_package_version(package, expected_version)
# The output of lslpp is a colon-delimited list like:
# sudo:sudo.rte:1.8.6.4: : :C: :Configurable super-user privileges runtime: : : : : : :0:0:/:
@@ -12,8 +18,6 @@ def assert_package_version(package, expected_version)
end
end
-dir = "/tmp/aix-packages-#{$$}"
-
package = 'sudo.rte'
version1 = '1.7.10.4'
version2 = '1.8.6.4' | Cleanup tmp dir after running aix package provider test | puppetlabs_puppet | train | rb |
6c18039ac897e5c0a99b094a2ec138336693159f | diff --git a/core/src/main/java/io/ddf/content/APersistenceHandler.java b/core/src/main/java/io/ddf/content/APersistenceHandler.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/io/ddf/content/APersistenceHandler.java
+++ b/core/src/main/java/io/ddf/content/APersistenceHandler.java
@@ -25,6 +25,9 @@ public abstract class APersistenceHandler extends ADDFFunctionalGroupHandler imp
private boolean mPersitable = true;
public boolean isPersistable() {
+ if(this.getDDF().getUUID() == null || this.getDDF().getTableName() == null) {
+ return false;
+ }
return this.mPersitable;
} | if ddf's uuid is null it's not persitable | ddf-project_DDF | train | java |
01c26fc6dfa65913fa1ea1e2be78f2de6f36b839 | diff --git a/src/RedisClustr.js b/src/RedisClustr.js
index <HASH>..<HASH> 100644
--- a/src/RedisClustr.js
+++ b/src/RedisClustr.js
@@ -79,8 +79,8 @@ RedisClustr.prototype.getClient = function(port, host, master) {
err.code === 'NR_CLOSED' ||
/Redis connection to .* failed.*/.test(err.message)
) {
- // broken connection so force a new client to be created (node_redis will reconnect other errors)
- if (err.code === 'CONNECTION_BROKEN') self.connections[name] = null;
+ // broken/closed connection so force a new client to be created (node_redis should reconnect other errors)
+ if (err.code === 'CONNECTION_BROKEN' || err.code === 'NR_CLOSED') self.connections[name] = null;
self.emit('connectionError', err, cli);
self.getSlots();
return; | fix: discard client on NR_CLOSED errors, node-redis doesn't reconnect | gosquared_redis-clustr | train | js |
ea9e79b43dfbeb1855d0f4578c8df6aebd4542b1 | diff --git a/parsl/tests/test_bash_apps/test_pipeline.py b/parsl/tests/test_bash_apps/test_pipeline.py
index <HASH>..<HASH> 100644
--- a/parsl/tests/test_bash_apps/test_pipeline.py
+++ b/parsl/tests/test_bash_apps/test_pipeline.py
@@ -50,9 +50,16 @@ def test_increment(depth=5):
for key in futs:
if key > 0:
fu = futs[key]
- data = open(fu.result().filepath, 'r').read().strip()
+ file = fu.result()
+ filename = file.filepath
+
+ # this test is a bit close to a test of the specific implementation
+ # of File
+ assert not hasattr(file, 'local_path'), "File on local side has overridden local_path, file: {}".format(repr(file))
+
+ data = open(filename, 'r').read().strip()
assert data == str(
- key), "[TEST] incr failed for key: {0} got: {1}".format(key, data)
+ key), "[TEST] incr failed for key: {0} got data: {1} from filename {2}".format(key, data, filename)
def test_increment_slow(depth=5, dur=0.5): | Make pipeline test assert that result files don't have remote path set (#<I>)
This is to catch issue #<I>, which I have experienced in real life
when developing a post-#<I> staging provider - staging providers might
modify the submit-side File object in such a way that attempts to pull
the submit-side posix path out of that File object instead give the remote
path.
This is likely to only be a problem when implementing interesting
file:// scheme providers - this test (correctly) fails for me on
one such provider that I have been working on. | Parsl_parsl | train | py |
8b45b8889d05d9795051c9ba8daba9c81f179426 | diff --git a/tcex/stix/indicator/indicator.py b/tcex/stix/indicator/indicator.py
index <HASH>..<HASH> 100644
--- a/tcex/stix/indicator/indicator.py
+++ b/tcex/stix/indicator/indicator.py
@@ -137,7 +137,7 @@ class StixIndicator(StixModel):
]
mappings = list(itertools.chain(*mappings))
except:
- self.logger.log.error(f'''Error occurred parsing pattern: {stix_data.get('pattern')}''')
+ self.logger.log.trace(f'''Error occurred parsing pattern: {stix_data.get('pattern')}''')
return mappings
def _file_consume_handler(self, indicators: Iterable[dict]): | changing log message level for pervious commit | ThreatConnect-Inc_tcex | train | py |
c24651c3eaf364b50576fa4eeb5ec3fab21995ac | diff --git a/tests/test-timber-pagination.php b/tests/test-timber-pagination.php
index <HASH>..<HASH> 100644
--- a/tests/test-timber-pagination.php
+++ b/tests/test-timber-pagination.php
@@ -73,6 +73,16 @@ class TestTimberPagination extends Timber_UnitTestCase {
$this->assertEquals( 'http://example.org/page/5/?s=post', $pagination['pages'][4]['link'] );
}
+ function testPaginationSearchPrettyWithPostnameNextPrev() {
+ $this->setPermalinkStructure('/%postname%/');
+ $posts = $this->factory->post->create_many( 55 );
+ $archive = home_url( '?s=post' );
+ $this->go_to( $archive );
+ query_posts( 's=post' );
+ $pagination = Timber::get_pagination();
+ $this->assertEquals( 'http://example.org/page/2/?s=post', $pagination['next']['link'] );
+ }
+
function testPaginationSearchPretty() {
$struc = '/blog/%year%/%monthnum%/%postname%/';
global $wp_rewrite; | ref #<I> -- made failing test | timber_timber | train | php |
c1ef683e81494a098395237e86b484842a4a4c8c | diff --git a/windpowerlib/wind_turbine_cluster.py b/windpowerlib/wind_turbine_cluster.py
index <HASH>..<HASH> 100644
--- a/windpowerlib/wind_turbine_cluster.py
+++ b/windpowerlib/wind_turbine_cluster.py
@@ -147,8 +147,7 @@ class WindTurbineCluster(object):
Returns
-------
- cluster_power_curve : pd.DataFrame
- Calculated power curve of the wind turbine cluster.
+ self
"""
# Assign wind farm power curves to wind farms of wind turbine cluster
@@ -174,4 +173,5 @@ class WindTurbineCluster(object):
cluster_power_curve.columns = ['power']
# Return wind speed (index) to a column of the data frame
cluster_power_curve.reset_index('wind_speed', inplace=True)
- return cluster_power_curve
+ self.power_curve = cluster_power_curve
+ return self | Assign turbine cluster power curve to object | wind-python_windpowerlib | train | py |
f3e55cba1d6919a69071dca440249a6d0df64343 | diff --git a/version/info.go b/version/info.go
index <HASH>..<HASH> 100644
--- a/version/info.go
+++ b/version/info.go
@@ -43,11 +43,11 @@ func init() {
buildInfo := prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "prometheus_build_info",
- Help: "A metric with a constant '1' value labeled by version, revision, and branch from which Prometheus was built.",
+ Help: "A metric with a constant '1' value labeled by version, revision, branch, and goversion from which Prometheus was built.",
},
- []string{"version", "revision", "branch"},
+ []string{"version", "revision", "branch", "goversion"},
)
- buildInfo.WithLabelValues(Version, Revision, Branch).Set(1)
+ buildInfo.WithLabelValues(Version, Revision, Branch, GoVersion).Set(1)
prometheus.MustRegister(buildInfo)
} | Include goversion in build_info metric | prometheus_prometheus | train | go |
67aa1391c12013aae70e08f5bbabb94e74b10a6d | diff --git a/src/utils.js b/src/utils.js
index <HASH>..<HASH> 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -81,9 +81,9 @@ function proxyCustomImporters(importers, loaderContext) {
return [].concat(importers).map(
(importer) =>
function proxyImporter(...args) {
- this.webpackLoaderContext = loaderContext;
+ const self = { ...this, webpackLoaderContext: loaderContext };
- return importer.apply(this, args);
+ return importer.apply(self, args);
}
);
} | fix: crash in custom importers with worker threads (#<I>) | webpack-contrib_sass-loader | train | js |
ad3a05cf89f1cb8020ac757cde08356f9328584a | diff --git a/base/src/main/java/uk/ac/ebi/atlas/utils/ExperimentInfo.java b/base/src/main/java/uk/ac/ebi/atlas/utils/ExperimentInfo.java
index <HASH>..<HASH> 100644
--- a/base/src/main/java/uk/ac/ebi/atlas/utils/ExperimentInfo.java
+++ b/base/src/main/java/uk/ac/ebi/atlas/utils/ExperimentInfo.java
@@ -9,8 +9,10 @@ import java.util.SortedSet;
/*
I'm a useful class, just old. I show up as rows on Experiments page, and at latest experiments.
-Find out why I need to be a bean, and if possible unbean me!
-lastUpdate is a String that is later parsed, which you could improve.
+I am a bean so that setting properties is convenient but this could change.
+I could have a toJson method, and then there will be no need for reflection-based serialization that we're currently
+(and confusingly) doing.
+lastUpdate is a String that is later parsed, which, if you implement a toJson method, you could improve.
*/
public class ExperimentInfo implements Comparable<ExperimentInfo> { | Comment outlaying my future vision of how to improve ExperimentInfo | ebi-gene-expression-group_atlas | train | java |
bf69573f76317a453a03362025420f2531f886a5 | diff --git a/documentcloud.py b/documentcloud.py
index <HASH>..<HASH> 100644
--- a/documentcloud.py
+++ b/documentcloud.py
@@ -264,7 +264,7 @@ class documentcloud(object):
Example usage:
>> documentcloud.documents.search('salazar')
-
+
"""
page = 1
document_list = []
@@ -276,16 +276,33 @@ class documentcloud(object):
else:
break
return [Document(d) for d in document_list]
+
+ @staticmethod
+ def get(id):
+ """
+ Retrieve a particular document using it's unique identifier.
+
+ Example usage:
+
+ >> documentcloud.documents.get(u'71072-oir-final-report')
+
+ """
+ url = documentcloud.BASE_URL + 'documents/%s.json' % id
+ req = urllib2.Request(url)
+ response = urllib2.urlopen(req)
+ data = response.read()
+ return Document(json.loads(data).get("document"))
if __name__ == '__main__':
from pprint import pprint
- document_list = documentcloud.documents.search('ruben salazar')
- obj = document_list[0]
- pprint(obj.__dict__)
+ #document_list = documentcloud.documents.search('ruben salazar')
+ #obj = document_list[0]
+ #pprint(obj.__dict__)
#pprint(obj.resources.__dict__)
#print obj.get_page_text(1)
-
+ obj = documentcloud.documents.get(u'71072-oir-final-report')
+ pprint(obj.__dict__) | Added a document.get() method that will retrieve a record by its ID | datadesk_python-documentcloud | train | py |
fe3687a19026d0908a9addf0e306e92a018dfd6e | diff --git a/lxd/container.go b/lxd/container.go
index <HASH>..<HASH> 100644
--- a/lxd/container.go
+++ b/lxd/container.go
@@ -456,7 +456,7 @@ func containerLXDLoad(d *Daemon, name string) (container, error) {
baseConfig: baseConfig,
baseDevices: baseDevices}
- s, err := storageForFilename(d, c.PathGet(""))
+ s, err := storageForFilename(d, shared.VarPath("containers", strings.Split(name, "/")[0]))
if err != nil {
shared.Log.Warn("Couldn't detect storage.", log.Ctx{"container": c.NameGet()})
c.Storage = d.Storage | Use parent's storage type for snapshots
Not all snapshots can be represented on the filesystem and LXD ensures
that snapshots are of the same type as their parent, so just check the
parent instead. | lxc_lxd | train | go |
7a88d224dc88db5a0a54eef7dc405b7bd90bf646 | diff --git a/lib/active_rest_client/request.rb b/lib/active_rest_client/request.rb
index <HASH>..<HASH> 100644
--- a/lib/active_rest_client/request.rb
+++ b/lib/active_rest_client/request.rb
@@ -238,7 +238,7 @@ module ActiveRestClient
ActiveRestClient::Logger.debug " \033[1;4;32m#{ActiveRestClient::NAME}\033[0m #{@instrumentation_name} - Etag copy is the same as the server"
return :not_modified
end
- if response.try(:proxied)
+ if response.respond_to?(:proxied) && response.proxied
ActiveRestClient::Logger.debug " \033[1;4;32m#{ActiveRestClient::NAME}\033[0m #{@instrumentation_name} - Response was proxied, unable to determine size"
else
ActiveRestClient::Logger.debug " \033[1;4;32m#{ActiveRestClient::NAME}\033[0m #{@instrumentation_name} - Response received #{response.body.size} bytes"
diff --git a/lib/active_rest_client/version.rb b/lib/active_rest_client/version.rb
index <HASH>..<HASH> 100644
--- a/lib/active_rest_client/version.rb
+++ b/lib/active_rest_client/version.rb
@@ -1,3 +1,3 @@
module ActiveRestClient
- VERSION = "0.9.55"
+ VERSION = "0.9.56"
end | Ensure try is only called if the method responds to it for Rails 3 support | whichdigital_active-rest-client | train | rb,rb |
b3c93bf5101af1ab979fbebd98d3e3e52ea4e87c | diff --git a/intranet/settings/__init__.py b/intranet/settings/__init__.py
index <HASH>..<HASH> 100644
--- a/intranet/settings/__init__.py
+++ b/intranet/settings/__init__.py
@@ -20,6 +20,7 @@ SECRET_DATABASE_URL should be of the following form:
"""
SECRET_DATABASE_URL = None # type: str
ADMINS = None # type: List[Tuple[str,str]]
+USE_SASL = True
try:
from .secret import * # noqa
@@ -358,7 +359,6 @@ CSL_REALM = "CSL.TJHSST.EDU" # CSL Realm
HOST = "ion.tjhsst.edu"
LDAP_REALM = CSL_REALM
LDAP_SERVER = "ldap://iodine-ldap.tjhsst.edu"
-USE_SASL = True
KINIT_TIMEOUT = 15 # seconds before pexpect timeouts
AUTHUSER_DN = "cn=authuser,dc=tjhsst,dc=edu" | allow overriding USE_SASL | tjcsl_ion | train | py |
a3a072911cf3e56deb030ea7cec847fe62c25088 | diff --git a/backand_sync_s3.js b/backand_sync_s3.js
index <HASH>..<HASH> 100644
--- a/backand_sync_s3.js
+++ b/backand_sync_s3.js
@@ -10,6 +10,7 @@ var rename = require("gulp-rename");
var download = require('gulp-downloader');
var jeditor = require("gulp-json-editor");
var parallelize = require("concurrent-transform");
+var notify = require("gulp-notify");
var sts_url = require('./config').sts_url;
@@ -27,6 +28,20 @@ function dist(folder, appName){
if (appName){
storedData = storedData[appName];
}
+ else {
+ storedData = _.first(_.values(storeData))
+ }
+ if (!storedData){
+ return gulp.src(folder)
+ .pipe(notify({
+ message: "No credentials for this app",
+ title: "Failure",
+ notifier: function (options, callback) {
+ console.log(options.title + ":" + options.message);
+ callback();
+ }
+ }));
+ }
var credentials = storedData.credentials;
var info = storedData.info; | Notify on Missing Credentials | backand_backand-hosting-s3 | train | js |
51529df3880ebb67c919b5a55c55880af77bd336 | diff --git a/agrona/src/test/java/org/agrona/collections/IntArrayListTest.java b/agrona/src/test/java/org/agrona/collections/IntArrayListTest.java
index <HASH>..<HASH> 100644
--- a/agrona/src/test/java/org/agrona/collections/IntArrayListTest.java
+++ b/agrona/src/test/java/org/agrona/collections/IntArrayListTest.java
@@ -313,4 +313,15 @@ public class IntArrayListTest
list.addInt(7);
assertThat(list.capacity(), is(IntArrayList.INITIAL_CAPACITY));
}
+
+ @Test
+ public void shouldWrapLessZeroLengthArrayThenGrow()
+ {
+ final IntArrayList list = new IntArrayList();
+
+ list.wrap(new int[0], 0);
+
+ list.addInt(7);
+ assertThat(list.capacity(), is(IntArrayList.INITIAL_CAPACITY));
+ }
}
\ No newline at end of file | [Java] Add zero length array test. Issue #<I>. | real-logic_agrona | train | java |
da77bcb4cf919336eb249f3e7648f7c3b5aae428 | diff --git a/js/analyzer.js b/js/analyzer.js
index <HASH>..<HASH> 100644
--- a/js/analyzer.js
+++ b/js/analyzer.js
@@ -22,7 +22,7 @@ YoastSEO_Analyzer.prototype.init = function() {
};
YoastSEO_Analyzer.prototype.toLowCase = function() {
- this.config.keywordLowerCase = this.config.keyword.toLocaleLowerCase();
+ this.config.keywordLowerCase = this.config.keyword.toLocaleLowerCase().trim();
};
/** | added trim to the keyword to strip unnecessary spaces to improve matching | Yoast_YoastSEO.js | train | js |
ca43eee3970c244087b7d8dfccb2357f3f34cc19 | diff --git a/features/step_definitions/clearance/clearance_steps.rb b/features/step_definitions/clearance/clearance_steps.rb
index <HASH>..<HASH> 100644
--- a/features/step_definitions/clearance/clearance_steps.rb
+++ b/features/step_definitions/clearance/clearance_steps.rb
@@ -36,12 +36,12 @@ end
Then /^I should be signed in$/ do
Given %{I am on the homepage}
- Then %{I should see "Sign out"}
+ Then %{I should see "sign out"}
end
Then /^I should be signed out$/ do
Given %{I am on the homepage}
- Then %{I should see "Sign in"}
+ Then %{I should see "sign in"}
end
Given /^(?:I am|I have|I) signed in (?:with|as) "(.*)"$/ do |email| | Don't require that the sign in and sign out links be in title case. | rubygems_rubygems.org | train | rb |
c6ac40c285c1f0dfef96650f47bcf0b7ac9dca3d | diff --git a/src/Khill/Fontawesome/FontAwesomeServiceProvider.php b/src/Khill/Fontawesome/FontAwesomeServiceProvider.php
index <HASH>..<HASH> 100755
--- a/src/Khill/Fontawesome/FontAwesomeServiceProvider.php
+++ b/src/Khill/Fontawesome/FontAwesomeServiceProvider.php
@@ -9,7 +9,14 @@ class FontAwesomeServiceProvider extends ServiceProvider
public function boot()
{
- $this->package('khill/fontawesome');
+ /*
+ * If the package method exists, we're using Laravel 4
+ */
+ if (method_exists($this, 'package')) {
+
+ $this->package('khill/fontawesome');
+
+ }
include __DIR__.'/../../routes.php';
} | This should fix incompatability with Laravel 5 | kevinkhill_FontAwesomePHP | train | php |
5414bc743469d0624e6f5efce48dc90f7795956d | diff --git a/statics/src/main/java/com/codeborne/selenide/junit5/ScreenShooterExtension.java b/statics/src/main/java/com/codeborne/selenide/junit5/ScreenShooterExtension.java
index <HASH>..<HASH> 100644
--- a/statics/src/main/java/com/codeborne/selenide/junit5/ScreenShooterExtension.java
+++ b/statics/src/main/java/com/codeborne/selenide/junit5/ScreenShooterExtension.java
@@ -65,10 +65,11 @@ public class ScreenShooterExtension implements BeforeAllCallback, AfterEachCallb
if (captureSuccessfulTests) {
log.info(screenshot(driver()));
} else {
- final Optional<Throwable> executionException = context.getExecutionException();
- if (executionException.isPresent() && executionException.get() instanceof UIAssertionError) {
- log.info(screenshot(driver()));
- }
+ context.getExecutionException().ifPresent((error) -> {
+ if (!(error instanceof UIAssertionError)) {
+ log.info(screenshot(driver()));
+ }
+ });
}
} | bugfix: ScreenShooterExtension should take screenshots for ALL error (except UIAssertionError) | selenide_selenide | train | java |
704ff9e1f870cec41006ff7a52225c23e1bb3a99 | diff --git a/Grido/DataSources/ArraySource.php b/Grido/DataSources/ArraySource.php
index <HASH>..<HASH> 100644
--- a/Grido/DataSources/ArraySource.php
+++ b/Grido/DataSources/ArraySource.php
@@ -50,15 +50,16 @@ class ArraySource extends \Nette\Object implements IDataSource
}
/**
+ * @param array $data
* @param array $condition
* @return void
*/
- protected function getFilter(array $condition)
+ protected function getFilter(array $data, array $condition)
{
$value = $condition[1];
$condition = $this->formatFilterCondition($condition);
- return array_filter($this->data, function ($row) use ($value, $condition) {
+ return array_filter($data, function ($row) use ($value, $condition) {
if ($condition[1] === 'LIKE') {
if (strlen($value) <= 2) {
return TRUE;
@@ -148,14 +149,14 @@ class ArraySource extends \Nette\Object implements IDataSource
*/
public function suggest($column, array $conditions)
{
- $selection = $this->data;
+ $data = $this->data;
foreach ($conditions as $condition) {
- $selection = $this->getFilter($selection, $condition);
+ $data = $this->getFilter($data, $condition);
}
$suggestions = array();
- foreach ($selection as $row) {
+ foreach ($data as $row) {
$suggestions[] = (string)$row[$column];
} | DataSources\ArraySource: Reverted & Typo | o5_grido | train | php |
0196063f3ed7bfd6b86f8861f68398df47d0f6d1 | diff --git a/lib/spatial_features/has_spatial_features/feature_import.rb b/lib/spatial_features/has_spatial_features/feature_import.rb
index <HASH>..<HASH> 100644
--- a/lib/spatial_features/has_spatial_features/feature_import.rb
+++ b/lib/spatial_features/has_spatial_features/feature_import.rb
@@ -27,8 +27,8 @@ module SpatialFeatures
end
def import_features(imports)
- features.destroy_all
- features << imports.flat_map(&:features)
+ self.features.destroy_all
+ self.features = imports.flat_map(&:features)
end
def validate_features!(imports, skip_invalid = false) | Be obvious that `features` is an association | culturecode_spatial_features | train | rb |
92d695767ef83b0a5d94f1ab890ad143b2c4cb54 | diff --git a/go/libkb/leveldb.go b/go/libkb/leveldb.go
index <HASH>..<HASH> 100644
--- a/go/libkb/leveldb.go
+++ b/go/libkb/leveldb.go
@@ -296,10 +296,6 @@ func (l *LevelDb) isCorrupt(err error) bool {
if strings.Contains(err.Error(), "corrupt") {
return true
}
- // if our db is in a bad state with too many open files also nuke
- if strings.Contains(strings.ToLower(err.Error()), "too many open files") {
- return true
- }
return false
} | nuke nuking on too many open files error (#<I>) | keybase_client | train | go |
a2bc044d7b87ae64ae02453dc381c45149e20e08 | diff --git a/src/zoid/buttons/util.js b/src/zoid/buttons/util.js
index <HASH>..<HASH> 100644
--- a/src/zoid/buttons/util.js
+++ b/src/zoid/buttons/util.js
@@ -56,11 +56,11 @@ export function createVenmoExperiment() : Experiment | void {
}
if (isIos() && isSafari()) {
- return createExperiment('enable_venmo_ios', 50);
+ return createExperiment('enable_venmo_ios', 90);
}
if (isAndroid() && isChrome()) {
- return createExperiment('enable_venmo_android', 50);
+ return createExperiment('enable_venmo_android', 90);
}
}
@@ -116,7 +116,7 @@ export function applePaySession() : ?ApplePaySessionConfigRequest {
session.oncancel = () => {
listeners.cancel();
};
-
+
return {
addEventListener: (name, handler) => {
listeners[name] = handler; | Ramp venmo experiment to <I>% (#<I>) | paypal_paypal-checkout-components | train | js |
ab6066bf51875dbfff5013662d2c9d2b2a07c5c2 | diff --git a/lxd/main_nsexec.go b/lxd/main_nsexec.go
index <HASH>..<HASH> 100644
--- a/lxd/main_nsexec.go
+++ b/lxd/main_nsexec.go
@@ -296,17 +296,6 @@ bool change_namespaces(int pidfd, int nsfd, unsigned int flags)
return setns(fd, 0) == 0;
}
-bool setnsat(int ns_fd, const char *ns)
-{
- __do_close int fd = -EBADF;
-
- fd = openat(ns_fd, ns, O_RDONLY | O_CLOEXEC);
- if (fd < 0)
- return false;
-
- return setns(fd, 0) == 0;
-}
-
static ssize_t lxc_read_nointr(int fd, void *buf, size_t count)
{
ssize_t ret; | nsexec: remove unused setnsat()
It's not used anymore after the previous changes. | lxc_lxd | train | go |
1c5a41d71310412146b602bee25ce8917ab5667d | diff --git a/pythongrid.py b/pythongrid.py
index <HASH>..<HASH> 100755
--- a/pythongrid.py
+++ b/pythongrid.py
@@ -78,7 +78,6 @@ class Job(object):
self.kwlist = kwlist if kwlist is not None else {}
self.cleanup = cleanup
self.ret = None
- self.exception = None
self.environment = None
self.replace_env = False
self.working_dir = os.getcwd()
@@ -131,14 +130,16 @@ class Job(object):
Executes function f with given arguments
and writes return value to field ret.
If an exception is encountered during execution, ret will
- remain empty and the exception will be written
- to the exception field of the Job object.
+ contain a pickled version of it.
Input data is removed after execution to save space.
"""
try:
self.ret = self.function(*self.args, **self.kwlist)
+ del self.args
+ del self.kwlist
except Exception as e:
self.ret = e
+ traceback.print_exc(e)
@property
def native_specification(self): | Made error a little easier to track down by making tracebacks get printed for exceptions in the local logs. | pygridtools_gridmap | train | py |
44420b570423c95b48ec22124d5264a4e201e6c4 | diff --git a/tests/manual_performance.py b/tests/manual_performance.py
index <HASH>..<HASH> 100644
--- a/tests/manual_performance.py
+++ b/tests/manual_performance.py
@@ -72,6 +72,7 @@ def time_one(args, test, queue):
with Timer() as t:
func(filepath)
queue.put(t.msecs)
+ queue.put(resource.getrusage(resource.RUSAGE_SELF).ru_maxrss / 1000.0)
parser = argparse.ArgumentParser(description='Angr performance tests')
@@ -128,7 +129,7 @@ for test in tests:
p.start()
p.join()
runs.append(queue.get())
- mems.append(resource.getrusage(resource.RUSAGE_CHILDREN).ru_maxrss / 1000.0)
+ mems.append(queue.get())
pbar.update(i + 1)
print('')
tests[test]['runs'] = runs | performance: fix wrong RAM measurement
It was getting the max RAM usage of the children, and not the max RAM
usage of the process executing the test | angr_angr | train | py |
600597adfcabfaf6bc0ffe688a6e91430c16a8c0 | diff --git a/condoor/controller.py b/condoor/controller.py
index <HASH>..<HASH> 100644
--- a/condoor/controller.py
+++ b/condoor/controller.py
@@ -56,7 +56,7 @@ class Controller(object):
maxread=65536,
searchwindowsize=4000,
env={"TERM": "VT100"}, # to avoid color control characters
- echo=False # KEEP YOUR DIRTY HANDS OFF FROM ECHO!
+ echo=True # KEEP YOUR DIRTY HANDS OFF FROM ECHO!
)
self._session.delaybeforesend = 0.3
rows, cols = self._session.getwinsize() | Echo on for session. It was not working with some jumphosts | kstaniek_condoor | train | py |
07cb846da5f2e9c2a7e57a691a533f8ffb21328d | diff --git a/src/nu/validator/gnu/xml/aelfred2/XmlParser.java b/src/nu/validator/gnu/xml/aelfred2/XmlParser.java
index <HASH>..<HASH> 100755
--- a/src/nu/validator/gnu/xml/aelfred2/XmlParser.java
+++ b/src/nu/validator/gnu/xml/aelfred2/XmlParser.java
@@ -3618,7 +3618,10 @@ final class XmlParser {
warnAboutPrivateUseChar();
}
} else {
- fatal("Unmatched low surrogate.");
+ if (prev != 0) {
+ // the prev == 0 situation is bogus, but better not to fail
+ fatal("Unmatched low surrogate.");
+ }
}
prev = c;
} else { | Suppress surrogate error when prev hasn't been set correctly.
--HG--
extra : convert_revision : svn%3A<I>f-c<I>-<I>-bfe8-c<I>dd<I>/trunk%<I> | validator_validator | train | java |
8fdc51403d76253112510606dcc387bc2b0aacf7 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
from setuptools import setup
setup(name='pynnotator',
- version='0.10',
+ version='0.11',
description='A Python Annotation Framework for VCFs using multiple tools (Ex. VEP, SnpEff and SnpSift) and databases (Ex. 1000genomes, dbSNP and dbnfsp) .',
url='http://github.com/raonyguimaraes/pynnotator',
author='Raony Guimaraes', | last release before upgrading mendelmd | raonyguimaraes_pynnotator | train | py |
8e7916971ed24642a15c572e42d21bebf1f4557d | diff --git a/holoviews/plotting/bokeh/renderer.py b/holoviews/plotting/bokeh/renderer.py
index <HASH>..<HASH> 100644
--- a/holoviews/plotting/bokeh/renderer.py
+++ b/holoviews/plotting/bokeh/renderer.py
@@ -31,12 +31,12 @@ class BokehRenderer(Renderer):
plot, fmt = self._validate(obj, fmt)
if fmt == 'html':
- html = self.figure_data(obj)
+ html = self.figure_data(plot)
html = '<center>%s</center>' % html
return html, {'file-ext':fmt, 'mime_type':MIME_TYPES[fmt]}
elif fmt == 'json':
types = [DataSource, Figure]
- plotobjects = [o for tp in types for o in obj.state.select({'type': tp})]
+ plotobjects = [o for tp in types for o in plot.state.select({'type': tp})]
data = {}
for plotobj in plotobjects:
json = plotobj.vm_serialize(changed_only=True) | Fixed direct rendering of objects on BokehRenderer | pyviz_holoviews | train | py |
3f81dc57b83d9141d4884e255c704b7f3582dad7 | diff --git a/src/Stack/Builder.php b/src/Stack/Builder.php
index <HASH>..<HASH> 100644
--- a/src/Stack/Builder.php
+++ b/src/Stack/Builder.php
@@ -18,6 +18,8 @@ class Builder
if (func_num_args() > 0) {
$spec = func_get_args();
$this->specs->unshift($spec);
+ } else {
+ throw new \InvalidArgumentException("Missing argument(s) when calling unshift");
}
return $this;
@@ -28,6 +30,8 @@ class Builder
if (func_num_args() > 0) {
$spec = func_get_args();
$this->specs->push($spec);
+ } else {
+ throw new \InvalidArgumentException("Missing argument(s) when calling push");
}
return $this; | Throw Invalid Argument Exception when no args passed through to push and unshift | stackphp_builder | train | php |
d9537435e45606d90b11b925548851b7c289584d | diff --git a/unyt/_unit_lookup_table.py b/unyt/_unit_lookup_table.py
index <HASH>..<HASH> 100644
--- a/unyt/_unit_lookup_table.py
+++ b/unyt/_unit_lookup_table.py
@@ -275,6 +275,5 @@ default_base_units = {
dimensions.temperature: 'K',
dimensions.angle: 'radian',
dimensions.current_mks: 'A',
- dimensions.amount: 'mol',
dimensions.luminous_intensity: 'cd',
}
diff --git a/unyt/dimensions.py b/unyt/dimensions.py
index <HASH>..<HASH> 100644
--- a/unyt/dimensions.py
+++ b/unyt/dimensions.py
@@ -27,8 +27,6 @@ temperature = Symbol("(temperature)", positive=True)
angle = Symbol("(angle)", positive=True)
#: current_mks
current_mks = Symbol("(current_mks)", positive=True)
-#: amount
-amount = Symbol("(amount)", positive=True)
#: luminous_intensity
luminous_intensity = Symbol("(luminous_intensity)", positive=True)
#: dimensionless
@@ -36,7 +34,7 @@ dimensionless = sympify(1)
#: A list of all of the base dimensions
base_dimensions = [mass, length, time, temperature, angle, current_mks,
- dimensionless, amount, luminous_intensity]
+ dimensionless, luminous_intensity]
#
# Derived dimensions | Remove "amount" dimensions. The related stuff in unit_systems will be handled later | yt-project_unyt | 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.