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 |
|---|---|---|---|---|---|
e874f9056dfcfdb66fa4140777169da490e2683d | diff --git a/dipper/sources/HPOAnnotations.py b/dipper/sources/HPOAnnotations.py
index <HASH>..<HASH> 100644
--- a/dipper/sources/HPOAnnotations.py
+++ b/dipper/sources/HPOAnnotations.py
@@ -486,7 +486,7 @@ class HPOAnnotations(Source):
pub = re.sub(r' *', '', pub) # fixed now but just in case
# there have been several malformed PMIDs curies
- if pub[:4] != 'http' or \
+ if pub[:4] != 'http' and \
graph.curie_regexp.fullmatch(pub) is None:
LOG.warning(
'Record %s has a malformed Pub %s', did, pub) | forgot to update the logic in the currently unused ingest | monarch-initiative_dipper | train | py |
721849d1b40101d4211f4c82d4d3dcb48f10bffe | diff --git a/lib/infusionsoft/request.rb b/lib/infusionsoft/request.rb
index <HASH>..<HASH> 100644
--- a/lib/infusionsoft/request.rb
+++ b/lib/infusionsoft/request.rb
@@ -1,4 +1,5 @@
module Infusionsoft
+ # Incase Infusionsoft ever creates a restful API :)
module Request
# Perform an GET request
def get(service_call, *args) | adding comments to explain why other rest methods are here | nateleavitt_infusionsoft | train | rb |
41b733ce4f4567e826cdcdb0ebeae0630e200e2f | diff --git a/lib/config/definitions.js b/lib/config/definitions.js
index <HASH>..<HASH> 100644
--- a/lib/config/definitions.js
+++ b/lib/config/definitions.js
@@ -555,15 +555,13 @@ const options = [
stage: 'package',
type: 'json',
default: {
- force: {
- unpublishSafe: false,
- recreateClosed: true,
- rebaseStalePrs: true,
- groupName: 'Pin Dependencies',
- commitMessageAction: 'Pin',
- group: {
- commitMessageTopic: 'dependencies',
- },
+ unpublishSafe: false,
+ recreateClosed: true,
+ rebaseStalePrs: true,
+ groupName: 'Pin Dependencies',
+ commitMessageAction: 'Pin',
+ group: {
+ commitMessageTopic: 'dependencies',
},
},
cli: false, | fix: Revert "fix: force pin dependencies config"
This reverts commit <I>bdf6bb3dcdb<I>dd<I>a0a<I>f2d<I>a<I>a2. | renovatebot_renovate | train | js |
68933e2b9c7506d67da131ad4122bfe04605b08d | diff --git a/merb-core/spec/public/directory_structure/directory/config/router.rb b/merb-core/spec/public/directory_structure/directory/config/router.rb
index <HASH>..<HASH> 100644
--- a/merb-core/spec/public/directory_structure/directory/config/router.rb
+++ b/merb-core/spec/public/directory_structure/directory/config/router.rb
@@ -1,3 +1,3 @@
-Merb::Router.prepare do |r|
- r.default_routes
-end
\ No newline at end of file
+Merb::Router.prepare do
+ default_routes
+end | Updated config/router.rb for new API. | wycats_merb | train | rb |
fcfda9f3124e0e985960e43cc0818836b157d299 | diff --git a/http.go b/http.go
index <HASH>..<HASH> 100644
--- a/http.go
+++ b/http.go
@@ -645,20 +645,18 @@ func (resp *Response) resetSkipHeader() {
}
func reuseBody(body []byte) []byte {
- if cap(body) > maxReuseBodyCap {
+ // Reuse body buffer only if its' capacity has been used for
+ // at least 1/7 of the full capacity during the last usage.
+ // This should reduce memory fragmentation in the long run.
+
+ bodyCap := cap(body)
+ bodyLen := len(body)
+ if bodyLen > 0 && ((bodyCap-bodyLen)>>3) > bodyLen {
return nil
}
return body[:0]
}
-// maxReuseBodyLen is the maximum request and response body buffer capacity,
-// which may be reused.
-//
-// Body is thrown to GC if its' capacity exceeds this limit.
-//
-// This limits memory waste and memory fragmentation when re-using body buffers.
-const maxReuseBodyCap = 8 * 1024
-
// Read reads request (including body) from the given r.
//
// RemoveMultipartFormFiles or Reset must be called after | Issue #<I>: increased client and server throughput when working with big bodies | valyala_fasthttp | train | go |
417538f664016a50f9444b4faa6f4ee3f2ed49c7 | diff --git a/src/core/component-1-util-B-select.js b/src/core/component-1-util-B-select.js
index <HASH>..<HASH> 100644
--- a/src/core/component-1-util-B-select.js
+++ b/src/core/component-1-util-B-select.js
@@ -33,7 +33,7 @@ _cs.select_parse = function (spec) {
var txt = spec;
var m;
while (txt !== "") {
- if ((m = txt.match(/^\s*(?:\.)?\s*([a-zA-Z$_][a-zA-Z$0-9_:-]*|\*{1,2})/)) !== null)
+ if ((m = txt.match(/^\s*(?:\.)?\s*([a-zA-Z$_][a-zA-Z$0-9_:-]*)/)) !== null)
path.push(m[1]);
else if ((m = txt.match(/^\s*\[\s*(\d+|\*{1,2})\s*\]/)) !== null)
path.push(m[1]); | we cannot match against wildcard path segments as it makes no sense in practical scenarios | rse_componentjs | train | js |
5ee9942e1f57db46a0ee572ff3513e52dfaaaf59 | diff --git a/metal/mmtl/glue/glue_preprocess.py b/metal/mmtl/glue/glue_preprocess.py
index <HASH>..<HASH> 100644
--- a/metal/mmtl/glue/glue_preprocess.py
+++ b/metal/mmtl/glue/glue_preprocess.py
@@ -91,7 +91,7 @@ def get_task_tsv_config(task_name, split):
"sent1_idx": 3 if split in ["train", "dev"] else 1,
"sent2_idx": -1,
"label_idx": 1 if split in ["train", "dev"] else -1,
- "skip_rows": 1,
+ "skip_rows": 0 if split in ["train", "dev"] else 1,
"label_fn": label_fn,
"inv_label_fn": inv_label_fn,
"label_type": int, | Fix header off-by-one in COLA. | HazyResearch_metal | train | py |
df6dca2a239e924f4955a1e7a3d6e5f893594c67 | diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb
index <HASH>..<HASH> 100644
--- a/spec/dummy/config/application.rb
+++ b/spec/dummy/config/application.rb
@@ -42,7 +42,7 @@ module Dummy
config.ga_tracking_id = ''
- config.app_title = 'Peoplefinder Dummy'
+ config.app_title = 'People Finder Dummy'
config.elastic_search_url = ''
end | Change the name of the dummy app
- 'Peoplefinder' sounds awful in the screen reader
- 'People Finder' reads much better | ministryofjustice_peoplefinder | train | rb |
bf8e2de88bcb79452ea4c5959ad9a31df3595517 | diff --git a/templates/admin/custom-styles.php b/templates/admin/custom-styles.php
index <HASH>..<HASH> 100644
--- a/templates/admin/custom-styles.php
+++ b/templates/admin/custom-styles.php
@@ -23,6 +23,10 @@ $your_styles = $style_post->post_content;
// Template
// -------------------------------------------------------------------------------------------------------------------
+if ( ! empty( $_GET['debug'] ) ) { // Debug
+ $theme_styles = \Pressbooks\Sanitize\normalize_css_urls( $theme_styles, 'http://DEBUG' );
+}
+
if ( ! empty( $_GET['custom_styles_error'] ) ) {
// Conversion failed
printf( '<div class="error">%s</div>', __( 'Error: Something went wrong. See logs for more details.', 'pressbooks' ) ); | Add a debug switch for Custom Styles. (#<I>) | pressbooks_pressbooks | train | php |
568376bc6856fb29f9d0a1203695143a8843649f | diff --git a/ssbio/pipeline/gempro.py b/ssbio/pipeline/gempro.py
index <HASH>..<HASH> 100644
--- a/ssbio/pipeline/gempro.py
+++ b/ssbio/pipeline/gempro.py
@@ -177,7 +177,7 @@ class GEMPRO(Object):
self._root_dir = path
- for d in [self.base_dir, self.model_dir, self.data_dir, self.genes_dir, self.structures_dir]:
+ for d in [self.base_dir, self.model_dir, self.data_dir, self.genes_dir]:#, self.structures_dir]:
ssbio.utils.make_dir(d)
log.info('{}: GEM-PRO project location'.format(self.base_dir))
@@ -219,14 +219,14 @@ class GEMPRO(Object):
else:
return None
- @property
- def structures_dir(self):
- """str: Directory where all structures are stored."""
- # XTODO: replace storage of structures in individual protein directories with this to reduce redundancy
- if self.base_dir:
- return op.join(self.base_dir, 'structures')
- else:
- return None
+ # @property
+ # def structures_dir(self):
+ # """str: Directory where all structures are stored."""
+ # # XTODO: replace storage of structures in individual protein directories with this to reduce redundancy
+ # if self.base_dir:
+ # return op.join(self.base_dir, 'structures')
+ # else:
+ # return None
def load_cobra_model(self, model):
"""Load a COBRApy Model object into the GEM-PRO project. | Remove structures_dir for now, to be developed later | SBRG_ssbio | train | py |
d2fba7bb62de06f085df89ac344afcd207baccaa | diff --git a/dht.go b/dht.go
index <HASH>..<HASH> 100644
--- a/dht.go
+++ b/dht.go
@@ -23,7 +23,7 @@ import (
var log = u.Logger("dht")
-const doPinging = true
+const doPinging = false
// TODO. SEE https://github.com/jbenet/node-ipfs/blob/master/submodules/ipfs-dht/index.js | logging, logging, and some minor logging | libp2p_go-libp2p-kad-dht | train | go |
6865ba72edcda31c717037435e7985e9e4139dd9 | diff --git a/test/test_crud.py b/test/test_crud.py
index <HASH>..<HASH> 100644
--- a/test/test_crud.py
+++ b/test/test_crud.py
@@ -102,7 +102,7 @@ def create_test(scenario_def, test, ignore_result):
if expected_c is not None:
expected_name = expected_c.get('name')
if expected_name is not None:
- db_coll = db_coll = self.db[expected_name]
+ db_coll = self.db[expected_name]
else:
db_coll = self.db.test
self.assertEqual(list(db_coll.find()), expected_c['data']) | Redundant assignment in test_crud.py. | mongodb_mongo-python-driver | train | py |
424cc4c03d42378b30f864d2e111af7eeb50f806 | diff --git a/lib/zest.js b/lib/zest.js
index <HASH>..<HASH> 100644
--- a/lib/zest.js
+++ b/lib/zest.js
@@ -523,9 +523,10 @@ var rules = {
combinator: /^(?: +([^ \w*]) +|( )+|([^ \w*]))(?! *$)/,
attr: /^\[([\w\-]+)(?:([^\w]?=)(inside))?\]/,
pseudo: /^(:[\w\-]+)(?:\((inside)\))?/,
- inside: /(?:"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|<[^"'>]*>|\\["'>]|[^"'>])+/
+ inside: /(?:"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|<[^"'>]*>|\\["'>]|[^"'>])*/
};
+rules.inside = replace(rules.inside, '[^"\'>]*', rules.inside);
rules.attr = replace(rules.attr, 'inside', makeInside('\\[', '\\]'));
rules.pseudo = replace(rules.pseudo, 'inside', makeInside('\\(', '\\)'));
rules.simple = replace(rules.simple, 'pseudo', rules.pseudo); | allow 3 levels of nesting in selectors | chjj_zest | train | js |
a8499f01ed85477bf8b3df4d9b50f96985731c38 | diff --git a/tests/config.php b/tests/config.php
index <HASH>..<HASH> 100644
--- a/tests/config.php
+++ b/tests/config.php
@@ -1,4 +1,5 @@
<?php
+define('PHPUNIT_UPLOADCARE_TESTSUITE', true);
define('UC_PUBLIC_KEY', 'demopublickey');
define('UC_SECRET_KEY', 'demoprivatekey');
date_default_timezone_set('UTC'); | unit test were failing because PHPUNIT_UPLOADCARE_TESTSUITE constant wasn't defined | uploadcare_uploadcare-php | train | php |
936150a306379f2aecf397749ed647d1da587060 | diff --git a/Collection.php b/Collection.php
index <HASH>..<HASH> 100755
--- a/Collection.php
+++ b/Collection.php
@@ -618,14 +618,14 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
/**
* Sort through each item with a callback.
*
- * @param callable $callback
+ * @param callable|null $callback
* @return static
*/
- public function sort(callable $callback)
+ public function sort(callable $callback = null)
{
$items = $this->items;
- uasort($items, $callback);
+ $callback ? uasort($items, $callback) : natcasesort($items);
return new static($items);
} | Allow a collection of scalars to be easily sorted | illuminate_support | train | php |
827778b7e3019e05137f45324960cd68af8b251d | diff --git a/lib/fake_rest_services.rb b/lib/fake_rest_services.rb
index <HASH>..<HASH> 100644
--- a/lib/fake_rest_services.rb
+++ b/lib/fake_rest_services.rb
@@ -6,11 +6,11 @@ require 'fake_rest_services/models/redirect'
module FakeRestServices
class Application < Sinatra::Base
post '/fixtures' do
- Fixture.create(url: params['url'], content: params['content']) and status 200
+ Fixture.create(url: params['url'], content: params['content'])
end
delete '/fixtures/all' do
- Fixture.destroy_all and status 200
+ Fixture.delete_all
end
post '/redirects' do
@@ -18,11 +18,11 @@ module FakeRestServices
end
get /.*/ do
- Fixture.where(url: request.fullpath).last.try(:content) or perform_redirect(request) or status 404
+ Fixture.where(url: request.fullpath).last.try(:content) or try_redirect(request) or status 404
end
private
- def perform_redirect(request)
+ def try_redirect(request)
r = Redirect.all.find do |r|
request.fullpath =~ /#{r.pattern}/
end | better method name for redirecting; removing unnecessary 'status XXX' | artemave_REST-assured | train | rb |
95de67ae8e7e839d5b1f9a8df8829a6e17a411d8 | diff --git a/src/Traits/ManipulationTrait.php b/src/Traits/ManipulationTrait.php
index <HASH>..<HASH> 100644
--- a/src/Traits/ManipulationTrait.php
+++ b/src/Traits/ManipulationTrait.php
@@ -57,9 +57,9 @@ trait ManipulationTrait
/**
* @param string|NodeList|\DOMNode $input
*
- * @return NodeList
+ * @return array|NodeList|\Traversable
*/
- protected function inputAsNodeList($input) {
+ protected function inputPrepareAsTraversable($input) {
if ($input instanceof \DOMNode) {
$nodes = [$input];
} else if (is_string($input)) {
@@ -70,6 +70,17 @@ trait ManipulationTrait
throw new \InvalidArgumentException();
}
+ return $nodes;
+ }
+
+ /**
+ * @param string|NodeList|\DOMNode $input
+ *
+ * @return NodeList
+ */
+ protected function inputAsNodeList($input) {
+ $nodes = $this->inputPrepareAsTraversable($input);
+
$newNodes = $this->newNodeList();
foreach ($nodes as $node) { | Break-up inputAsNodeList() into two methods. | scotteh_php-dom-wrapper | train | php |
ee1a1ba65e82b3619f305c51df437cc7c9dad9db | diff --git a/core/src/main/java/com/orientechnologies/orient/core/storage/fs/OMMapManager.java b/core/src/main/java/com/orientechnologies/orient/core/storage/fs/OMMapManager.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/orientechnologies/orient/core/storage/fs/OMMapManager.java
+++ b/core/src/main/java/com/orientechnologies/orient/core/storage/fs/OMMapManager.java
@@ -210,6 +210,8 @@ public class OMMapManager {
// LOAD THE PAGE
try {
entry = mapBuffer(iFile, iBeginOffset, bufferSize);
+ } catch (IllegalArgumentException e) {
+ throw e;
} catch (Exception e) {
// REDUCE MAX MEMORY TO FORCE EMPTY BUFFERS
maxMemory = maxMemory * 90 / 100; | Re thrown a non-io exception | orientechnologies_orientdb | train | java |
eb74696dc9b4d634c6fc0b90fbf078dd10dd8765 | diff --git a/openquake/utils/tasks.py b/openquake/utils/tasks.py
index <HASH>..<HASH> 100644
--- a/openquake/utils/tasks.py
+++ b/openquake/utils/tasks.py
@@ -48,7 +48,7 @@ def distribute(task_func, (name, data), tf_args=None, ath=None, ath_args=None):
:param dict tf_args: The remaining (keyword) parameters for `task_func`
:param ath: an asynchronous task handler function, may only be specified
for a task whose results are ignored.
- :param dict ath_args: The remaining (keyword) parameters for `ath`
+ :param dict ath_args: The keyword parameters for `ath`
:returns: A list where each element is a result returned by a subtask.
If an `ath` function is passed we return whatever it returns.
""" | more enhanced documentation
Former-commit-id: <I>a0a4cf3c<I>e<I>bc<I>a<I>ac<I>a<I>f6 | gem_oq-engine | train | py |
82f7dea3a24cf279b3f9c9bca9cfafac27cc6d4a | diff --git a/src/Providers/PaytmWalletProvider.php b/src/Providers/PaytmWalletProvider.php
index <HASH>..<HASH> 100644
--- a/src/Providers/PaytmWalletProvider.php
+++ b/src/Providers/PaytmWalletProvider.php
@@ -49,9 +49,9 @@ class PaytmWalletProvider{
throw new \Exception('Invalid checksum');
}
- public function getResponseMessage() {
- return $this->response()->RESPMSG;
- }
+ public function getResponseMessage() {
+ return @$this->response()->RESPMSG;
+ }
public function api_call($url, $params){ | Suppress error
Suppress error in case if response is not available | anandsiddharth_laravel-paytm-wallet | train | php |
428fd98ba0d6273be0d57802ed444552387e67f6 | diff --git a/command/state.go b/command/state.go
index <HASH>..<HASH> 100644
--- a/command/state.go
+++ b/command/state.go
@@ -4,6 +4,7 @@ import (
"fmt"
"os"
"path/filepath"
+ "strings"
"github.com/hashicorp/errwrap"
"github.com/hashicorp/terraform/state"
@@ -208,7 +209,7 @@ func remoteState(
}
// Initialize the remote client based on the local state
- client, err := remote.NewClient(local.Remote.Type, local.Remote.Config)
+ client, err := remote.NewClient(strings.ToLower(local.Remote.Type), local.Remote.Config)
if err != nil {
return nil, errwrap.Wrapf(fmt.Sprintf(
"Error initializing remote driver '%s': {{err}}", | Handles upper case characters in the cached state file's remote type
If the cached state file contains a remote type field with upper case
characters, eg 'Consul', it was no longer possible to find the 'consul'
remote plugin. | hashicorp_terraform | train | go |
d284fb3d883065d1af249c2cee088b3d22c82843 | diff --git a/src/actions/index.js b/src/actions/index.js
index <HASH>..<HASH> 100644
--- a/src/actions/index.js
+++ b/src/actions/index.js
@@ -112,7 +112,7 @@ function buildDirectionsQuery(state) {
// Add any waypoints.
if (waypoints.length) {
waypoints.forEach((waypoint) => {
- query = query.concat(waypoint.geometery.coordinates);
+ query = query.concat(waypoint.geometry.coordinates);
query.push(';');
});
} | s/geometery/geometry/ | mapbox_mapbox-gl-directions | train | js |
aa0f9ccfc1fe9956cf59e1eea1adf2fa3e72b24b | diff --git a/email_log/tests/tests.py b/email_log/tests/tests.py
index <HASH>..<HASH> 100644
--- a/email_log/tests/tests.py
+++ b/email_log/tests/tests.py
@@ -1,5 +1,11 @@
from __future__ import unicode_literals
+try:
+ from unittest import skipUnless
+except ImportError: # Python 2.6
+ from django.utils.unittest import skipUnless
+from django import VERSION
+from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.test.utils import override_settings
from django.utils.six import text_type
@@ -109,3 +115,14 @@ class AdminTests(TestCase):
page = self.client.get('/admin/email_log/email/{0}/delete/'
.format(email.pk))
self.assertEqual(page.status_code, 403)
+
+
+class SouthSupportTests(TestCase):
+
+ @skipUnless(VERSION < (1, 7, 0), "test only applies to 1.6 and below")
+ def test_import_migrations_module(self):
+ try:
+ from email_log.migrations import __doc__ # noqa
+ except ImproperlyConfigured as e:
+ exception = e
+ self.assertIn("SOUTH_MIGRATION_MODULES", exception.args[0]) | Add test for South ImproperlyConfigured error | treyhunner_django-email-log | train | py |
af2c26eb0ceff2d80bdf26417e524f39e5e938ce | diff --git a/lib/Shipmile/Api/Orders.php b/lib/Shipmile/Api/Orders.php
index <HASH>..<HASH> 100644
--- a/lib/Shipmile/Api/Orders.php
+++ b/lib/Shipmile/Api/Orders.php
@@ -34,7 +34,7 @@ class Orders
return $response;
}
- public function markReady($order_id, array $options = array())
+ public function markReady(array $options = array())
{
$body = (isset($options['body']) ? $options['body'] : array()); | BugFix: Passed two variables in pickup instead of one | shipmile_shipmile-api-php | train | php |
e6122a6cf9982788b8585f402eade107c3ae112d | diff --git a/server-coreless/src/main/java/org/openqa/selenium/server/browserlaunchers/HTABrowserLauncher.java b/server-coreless/src/main/java/org/openqa/selenium/server/browserlaunchers/HTABrowserLauncher.java
index <HASH>..<HASH> 100644
--- a/server-coreless/src/main/java/org/openqa/selenium/server/browserlaunchers/HTABrowserLauncher.java
+++ b/server-coreless/src/main/java/org/openqa/selenium/server/browserlaunchers/HTABrowserLauncher.java
@@ -89,6 +89,12 @@ public class HTABrowserLauncher implements BrowserLauncher {
File selRunnerDest = new File(coreDir, "RemoteRunner.hta");
File testRunnerSrc = new File(coreDir, "TestRunner.html");
File testRunnerDest = new File(coreDir, "TestRunner.hta");
+ // custom user-extensions
+ File userExt = this.configuration.getUserExtensions();
+ if (userExt != null) {
+ File selUserExt = new File(coreDir, "scripts/user-extensions.js");
+ f.copyFile(userExt, selUserExt, null, true);
+ }
f.copyFile(selRunnerSrc, selRunnerDest);
f.copyFile(testRunnerSrc, testRunnerDest);
} catch (IOException e) { | Fix SRC-<I> [User Extension is Not Loaded When Launching with *iehta] with patch from adam goucher.
r<I> | SeleniumHQ_selenium | train | java |
e1f700912478b4d58927e7a18c55dcc57b105323 | diff --git a/client/webpack.config.js b/client/webpack.config.js
index <HASH>..<HASH> 100644
--- a/client/webpack.config.js
+++ b/client/webpack.config.js
@@ -208,9 +208,7 @@ const webpackConfig = {
safari10: false,
}
: {
- compress: {
- passes: 2,
- },
+ compress: true,
mangle: true,
} ),
}, | build: Do only one compression pass (#<I>) | Automattic_wp-calypso | train | js |
505da97282f3751dfb93abebc7c0aa033c9e00d8 | diff --git a/bulbs/contributions/serializers.py b/bulbs/contributions/serializers.py
index <HASH>..<HASH> 100644
--- a/bulbs/contributions/serializers.py
+++ b/bulbs/contributions/serializers.py
@@ -40,7 +40,7 @@ class ContributionReportingSerializer(serializers.ModelSerializer):
("title", obj.content.title),
("url", obj.content.get_absolute_url()),
("content_type", obj.content.__class__.__name__),
- ("feature_type", obj.content.feature_type),
+ ("feature_type", getattr(obj.content.feature_type, "name", None)),
("published", timezone.localtime(obj.content.published))
])
@@ -97,4 +97,3 @@ class ContentReportingSerializer(serializers.ModelSerializer):
def get_published(self, obj):
return timezone.localtime(obj.published)
- | Let's use the name for the feature type, instead of just the id | theonion_django-bulbs | train | py |
11dde19a6c4ca44cd71cbad8f25396a86ebbeb54 | diff --git a/closure/goog/tweak/tweakui.js b/closure/goog/tweak/tweakui.js
index <HASH>..<HASH> 100644
--- a/closure/goog/tweak/tweakui.js
+++ b/closure/goog/tweak/tweakui.js
@@ -526,7 +526,7 @@ goog.tweak.EntriesPanel.prototype.createComboBoxDom_ =
var values = tweak.getValidValues();
for (var i = 0, il = values.length; i < il; ++i) {
var optionElem = dh.createElement('option');
- optionElem.text = values[i];
+ optionElem.text = String(values[i]);
selectElem.appendChild(optionElem);
}
ret.appendChild(selectElem); | Fix a type warning, and make type warnings default to errors
for closureCompiled.
R=agrieve
DELTA=2 (1 added, 0 deleted, 1 changed)
Revision created by MOE tool push_codebase.
MOE_MIGRATION=<I>
git-svn-id: <URL> | google_closure-library | train | js |
b09fe7157bd7ee445c2a1a58f76206bf63c0a1b0 | diff --git a/internal/uidriver/glfw/ui.go b/internal/uidriver/glfw/ui.go
index <HASH>..<HASH> 100644
--- a/internal/uidriver/glfw/ui.go
+++ b/internal/uidriver/glfw/ui.go
@@ -691,8 +691,9 @@ func (u *UserInterface) run(context driver.UIContext) error {
u.setWindowSize(ww, wh, u.isFullscreen(), u.vsync)
}
- // Set the window size and the window position in this order on Linux (X) (#1118),
- // but this is inverted on Windows. This is very tricky, but there is no obvious way to solve this.
+ // Set the window size and the window position in this order on Linux or other UNIX using X (#1118),
+ // but this should be inverted on Windows. This is very tricky, but there is no obvious way to solve this.
+ // This doesn't matter on macOS.
if runtime.GOOS == "windows" {
setPosition()
setSize() | uidriver/glfw: Update comments | hajimehoshi_ebiten | train | go |
c9d23fffa88ff84142206aaea6a6b0aa187ce493 | diff --git a/lib/custom/src/MShop/Customer/Manager/Laravel.php b/lib/custom/src/MShop/Customer/Manager/Laravel.php
index <HASH>..<HASH> 100644
--- a/lib/custom/src/MShop/Customer/Manager/Laravel.php
+++ b/lib/custom/src/MShop/Customer/Manager/Laravel.php
@@ -453,7 +453,7 @@ class Laravel
$stmt->bind( $idx++, $context->getLocale()->getSiteId(), \Aimeos\MW\DB\Statement\Base::PARAM_INT );
$stmt->bind( $idx++, $item->getLabel() );
- $stmt->bind( $idx++, $item->getCode() );
+ $stmt->bind( $idx++, $billingAddress->getEmail() );
$stmt->bind( $idx++, $billingAddress->getCompany() );
$stmt->bind( $idx++, $billingAddress->getVatID() );
$stmt->bind( $idx++, $billingAddress->getSalutation() ); | Fixed saving modified code/e-mail | aimeos_ai-laravel | train | php |
2c59f8ea3e36c484d5b6e6a61141175bfb1a7523 | diff --git a/lib/usb-connection.js b/lib/usb-connection.js
index <HASH>..<HASH> 100644
--- a/lib/usb-connection.js
+++ b/lib/usb-connection.js
@@ -29,7 +29,7 @@ try {
// var VENDOR_REQ_IN = usb.LIBUSB_REQUEST_TYPE_VENDOR | usb.LIBUSB_RECIPIENT_DEVICE | usb.LIBUSB_ENDPOINT_IN;
} catch (e) {
haveusb = false;
- log.error('WARNING: No usb controller found on this system.');
+ log.error('WARNING: No USB controller found on this system. Please run npm install -g t2-cli to compile USB drivers for your version of node');
}
var Daemon = require('./usb/usb-daemon'); | Update error message for USB controller when the version of node is changed (#<I>) | tessel_t2-cli | train | js |
7d2d538776719d610a5524e5bdf5cc07057991db | diff --git a/app/controllers/katello/content_search_controller.rb b/app/controllers/katello/content_search_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/katello/content_search_controller.rb
+++ b/app/controllers/katello/content_search_controller.rb
@@ -541,12 +541,18 @@ module Katello
def multi_repo_content_search(content_class, search_obj, repos, offset, default_field, search_mode = :all, in_repo = nil)
user = current_user
search = Tire::Search::Search.new(content_class.index)
+
+ query_options = {
+ :lowercase_expanded_terms => false,
+ :default_field => default_field
+ }
+
search.instance_eval do
query do
if search_obj.is_a?(Array) || search_obj.nil?
all
else
- string search_obj, :default_field => default_field
+ string search_obj, query_options
end
end | Fixes #<I>: Allow searching on capital letters for Packages in CS. | Katello_katello | train | rb |
65158726796d82c269f8959f619e632736684d7e | diff --git a/src/Command/GeneratorConfigFormBaseCommand.php b/src/Command/GeneratorConfigFormBaseCommand.php
index <HASH>..<HASH> 100644
--- a/src/Command/GeneratorConfigFormBaseCommand.php
+++ b/src/Command/GeneratorConfigFormBaseCommand.php
@@ -8,18 +8,10 @@ namespace Drupal\AppConsole\Command;
class GeneratorConfigFormBaseCommand extends GeneratorFormCommand {
- protected function getFormType ()
- {
- return 'ConfigFormBase';
- }
-
- protected function getCommandName ()
- {
- return 'generate:form:config';
- }
-
protected function configure()
{
+ $this->setFormType('ConfigFormBase');
+ $this->setCommandName('generate:form:config');
parent::configure();
} | Use new setter methods at parent class | hechoendrupal_drupal-console | train | php |
f0258bdd739450104cc196cbea750450f391e763 | diff --git a/src/Illuminate/Database/DetectsLostConnections.php b/src/Illuminate/Database/DetectsLostConnections.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Database/DetectsLostConnections.php
+++ b/src/Illuminate/Database/DetectsLostConnections.php
@@ -34,7 +34,7 @@ trait DetectsLostConnections
'reset by peer',
'Physical connection is not usable',
'TCP Provider: Error code 0x68',
- 'Name or service not known',
+ 'getaddrinfo failed: Name or service not known',
'ORA-03114',
'Packets out of order. Expected',
]); | Stricter error message in place of "Name or service not known" | laravel_framework | train | php |
0a9ee8d6eebec5bb5f3e0ee16305301d825921bb | diff --git a/openquake/server/static/js/engine.js b/openquake/server/static/js/engine.js
index <HASH>..<HASH> 100644
--- a/openquake/server/static/js/engine.js
+++ b/openquake/server/static/js/engine.js
@@ -195,7 +195,7 @@
function(jqXHR, textStatus, errorThrown)
{
if (jqXHR.status == 404) {
- diaerror.show(false, "Removing calculation", "The removal command for:<br><b>(" + calc_id + ") " + calc_desc + "</b> is failed.");
+ diaerror.show(false, "Removing calculation", "Removal command for:<br><b>(" + calc_id + ") " + calc_desc + "</b> failed.");
}
else {
diaerror.show(false, "Removing calculation " + calc_id, "Failed: " + textStatus); | Changed title The removal command for bla bla is failed to Removal command bla bla failed
Former-commit-id: d<I>acd8cf9f4b<I>b0fb<I>b3c<I>c<I>a5f9a | gem_oq-engine | train | js |
786801717c9853bd0a13b57962a65d86359b6f15 | diff --git a/ext_emconf.php b/ext_emconf.php
index <HASH>..<HASH> 100755
--- a/ext_emconf.php
+++ b/ext_emconf.php
@@ -25,7 +25,7 @@ $EM_CONF[$_EXTKEY] = array(
'constraints' => array(
'depends' => array(
'php' => '5.3.0-0.0.0',
- 'typo3' => '6.2.1-6.2.99',
+ 'typo3' => '6.2.1-7.1.99',
'extbase' => '6.2.0-6.2.99',
),
'conflicts' => array( | Updated TYPO3 version max to 7.x | webdevops_TYPO3-metaseo | train | php |
cdeb6b7fd79b5a5ff2290cb089ae4a6388cc0dc1 | diff --git a/lib/adash/config.rb b/lib/adash/config.rb
index <HASH>..<HASH> 100644
--- a/lib/adash/config.rb
+++ b/lib/adash/config.rb
@@ -5,6 +5,7 @@ module Adash
@@client_id = f.readline.chomp
@@client_secret = f.readline.chomp
@@redirect_port = f.readline.chomp.to_i
+ @@credentials_path = "#{Dir.home}/.config/adash/config"
end
def self.client_id
@@ -18,5 +19,9 @@ module Adash
def self.redirect_port
@@redirect_port
end
+
+ def self.credentials_path
+ @@credentials_path
+ end
end
end | Add self.credentionals_path to Adash::Config | aycabta_amazon-drs | train | rb |
e8e1804e02f737a01c47abe898e11bde22a70952 | diff --git a/lib/metro/views/yaml_view.rb b/lib/metro/views/yaml_view.rb
index <HASH>..<HASH> 100644
--- a/lib/metro/views/yaml_view.rb
+++ b/lib/metro/views/yaml_view.rb
@@ -22,7 +22,7 @@ module Metro
# @return a Hash that contains the contents of the view.
#
def self.parse(view_path)
- YAML.load File.read yaml_view_path(view_path)
+ YAML.load(File.read(yaml_view_path(view_path))) or { }
end
# | YAML View will now handle empty YAML files by returning a hash and not a bool | burtlo_metro | train | rb |
7222e8a99c7381ff9a20ed105a4f3fa71aa586d8 | diff --git a/bokeh/glyphs.py b/bokeh/glyphs.py
index <HASH>..<HASH> 100644
--- a/bokeh/glyphs.py
+++ b/bokeh/glyphs.py
@@ -228,6 +228,8 @@ class Circle(Marker):
# Other kinds of Markers, to match what GGplot provides
class Square(Marker):
__view_model__ = "square"
+ size = DataSpec(units="screen", default=4)
+ angle = DataSpec
class Triangle(Marker):
__view_model__ = "triangle" | Fixing square marker to have the additional dataspecs per BokehJS | bokeh_bokeh | train | py |
32a311b8d70e56d942a5be171331d7a0e7a78119 | diff --git a/tests/__init__.py b/tests/__init__.py
index <HASH>..<HASH> 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -133,6 +133,23 @@ class StripeItem(dict):
return self.deleted
+ @classmethod
+ def class_url(cls):
+ return "/v1/test-items/"
+
+ def instance_url(self):
+ """Superficial mock that emulates instance_url."""
+ id = self.get("id")
+ base = self.class_url()
+ return "%s/%s" % (base, id)
+
+ def request(self, method, url, params) -> dict:
+ """Superficial mock that emulates request method."""
+ assert method == "post"
+ for key, value in params.items():
+ self.__setattr__(key, value)
+ return self
+
class StripeList(dict):
"""Mock a generic Stripe Iterable. | tests: Add StripeItem.request mock method | dj-stripe_dj-stripe | train | py |
e5cd1a26387ba2e91a9d4a597bd18c0e41a5470a | diff --git a/salt/utils/versions.py b/salt/utils/versions.py
index <HASH>..<HASH> 100644
--- a/salt/utils/versions.py
+++ b/salt/utils/versions.py
@@ -90,10 +90,14 @@ def _format_warning(message, category, filename, lineno, line=None):
@contextlib.contextmanager
def _patched_format_warning():
- saved = warnings.formatwarning
- warnings.formatwarning = _format_warning
- yield
- warnings.formatwarning = saved
+ if six.PY2:
+ saved = warnings.formatwarning
+ warnings.formatwarning = _format_warning
+ yield
+ warnings.formatwarning = saved
+ else:
+ # Under Py3 we no longer have to patch warnings.formatwarning
+ yield
def warn_until(version, | We don't have to patch `warnings.formatwarning` under Py3 | saltstack_salt | train | py |
0046a53344e898500a8741e560103dc6de8cbc72 | diff --git a/lib/praxis-blueprints/blueprint.rb b/lib/praxis-blueprints/blueprint.rb
index <HASH>..<HASH> 100644
--- a/lib/praxis-blueprints/blueprint.rb
+++ b/lib/praxis-blueprints/blueprint.rb
@@ -281,7 +281,7 @@ module Praxis
attributes.each do | name, attr |
# Note: we can freely pass master view for attributes that aren't blueprint/containers because
# their dump methods will ignore it (they always dump everything regardless)
- attribute name, view: :master
+ attribute name, view: :default
end
end
end | Make :master views usable (non-recursive for the most part) by rendering subviews using :default | praxis_praxis-blueprints | train | rb |
084a4182b633da3fffeaf369ab2f55e86681577b | diff --git a/resources/views/tools/bread/edit-add.blade.php b/resources/views/tools/bread/edit-add.blade.php
index <HASH>..<HASH> 100644
--- a/resources/views/tools/bread/edit-add.blade.php
+++ b/resources/views/tools/bread/edit-add.blade.php
@@ -153,7 +153,7 @@
<option value="">-- {{ __('voyager::generic.none') }} --</option>
@foreach($fieldOptions as $tbl)
<option value="{{ $tbl['field'] }}"
- @if($dataType->order_column == $tbl['field']) selected @endif
+ @if(isset($dataType) && $dataType->order_column == $tbl['field']) selected @endif
>{{ $tbl['field'] }}</option>
@endforeach
</select>
@@ -169,7 +169,7 @@
<option value="">-- {{ __('voyager::generic.none') }} --</option>
@foreach($fieldOptions as $tbl)
<option value="{{ $tbl['field'] }}"
- @if($dataType->order_display_column == $tbl['field']) selected @endif
+ @if(isset($dataType) && $dataType->order_display_column == $tbl['field']) selected @endif
>{{ $tbl['field'] }}</option>
@endforeach
</select> | Ordering fix (#<I>)
Datatype is not defined when adding BREAD to a table, so this was failing | the-control-group_voyager | train | php |
fca7fbfaf0ed3ce81fa76cacf77b1403c808ee35 | diff --git a/lxd/instance/drivers/driver_lxc.go b/lxd/instance/drivers/driver_lxc.go
index <HASH>..<HASH> 100644
--- a/lxd/instance/drivers/driver_lxc.go
+++ b/lxd/instance/drivers/driver_lxc.go
@@ -5493,7 +5493,7 @@ func (d *lxc) FileSFTPConn() (net.Conn, error) {
return forkfileConn, nil
}
- // Check for ongoing operations (that may involve shifting).
+ // Check for ongoing operations (that may involve shifting or replacing the root volume).
_ = operationlock.Get(d.Project(), d.Name()).Wait()
// Setup reverter. | lxd/instance/drivers/driver/lxc: Improve comment in FileSFTPConn | lxc_lxd | train | go |
0801f9723bb84b8f2fb9fec0c50f4605dda34cc6 | diff --git a/src/Symfony/Component/DomCrawler/FormFieldRegistry.php b/src/Symfony/Component/DomCrawler/FormFieldRegistry.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/DomCrawler/FormFieldRegistry.php
+++ b/src/Symfony/Component/DomCrawler/FormFieldRegistry.php
@@ -15,6 +15,8 @@ use Symfony\Component\DomCrawler\Field\FormField;
/**
* This is an internal class that must not be used directly.
+ *
+ * @internal
*/
class FormFieldRegistry
{ | Tag the FormFieldRegistry as being internal | symfony_symfony | train | php |
75e34412133c9a1a332dfa863fbf57f5e40991cb | diff --git a/rbac_test.go b/rbac_test.go
index <HASH>..<HASH> 100644
--- a/rbac_test.go
+++ b/rbac_test.go
@@ -84,3 +84,29 @@ func TestRbacPermission(t *testing.T) {
t.Fatalf("role-c should not have %s because of the unbinding with role-b", pB)
}
}
+
+func BenchmarkRbacGranted(b *testing.B) {
+ rbac = New()
+ rA.AddPermission(pA)
+ rB.AddPermission(pB)
+ rC.AddPermission(pC)
+ rbac.Add(rA)
+ rbac.Add(rB)
+ rbac.Add(rC)
+ for i := 0; i < b.N; i++ {
+ rbac.IsGranted("role-a", pA, nil)
+ }
+}
+
+func BenchmarkRbacNotGranted(b *testing.B) {
+ rbac = New()
+ rA.AddPermission(pA)
+ rB.AddPermission(pB)
+ rC.AddPermission(pC)
+ rbac.Add(rA)
+ rbac.Add(rB)
+ rbac.Add(rC)
+ for i := 0; i < b.N; i++ {
+ rbac.IsGranted("role-a", pB, nil)
+ }
+} | add benchmark of IsGranted | mikespook_gorbac | train | go |
a86948fb23f508dfe51042080cddc5650ad24b7b | diff --git a/test/draw_line_string.test.js b/test/draw_line_string.test.js
index <HASH>..<HASH> 100644
--- a/test/draw_line_string.test.js
+++ b/test/draw_line_string.test.js
@@ -573,7 +573,7 @@ test('draw_line_string continue LineString', t => {
properties: {},
geometry: {
type: 'LineString',
- coordinates: coordinates
+ coordinates: coordinates.slice(0)
}
};
const line = new LineString(context, geojson);
@@ -603,5 +603,14 @@ test('draw_line_string continue LineString', t => {
/start or the end/,
'not at line endpoint'
);
+ drawLineStringMode(context, { featureId: 1, from: [0, 0] });
+ t.equal(context._test.line.id, 1, 'initialized with correct line');
+ t.deepEqual(context._test.line.coordinates, [[0, 0], ...coordinates],
+ 'added one coordinate at the start endpoint');
+
+ drawLineStringMode(context, { featureId: 1, from: [10, 10] });
+ t.deepEqual(context._test.line.coordinates, [[0, 0], ...coordinates, [10, 10]],
+ 'added one coordinate at the end endpoint');
+
t.end();
}); | Test line continuation initialization at both endpoints | mapbox_mapbox-gl-draw | train | js |
a2d45b722e4025271375cb57b331d802381c305a | diff --git a/spock/plugins/helpers/physics.py b/spock/plugins/helpers/physics.py
index <HASH>..<HASH> 100644
--- a/spock/plugins/helpers/physics.py
+++ b/spock/plugins/helpers/physics.py
@@ -76,7 +76,7 @@ class PhysicsPlugin(PluginBase):
self.pos.on_ground = mtv.y > 0
self.apply_vector(mtv)
- def clear_velocity(self, _ = None, __ = None):
+ def clear_velocity(self, _=None, __=None):
self.vec.__init__(0, 0, 0)
def get_drag(self, vec): | flake8 is important /s | SpockBotMC_SpockBot | train | py |
b4006bcfc9f30e60def4cd2bb4496a4ba9da9fb4 | diff --git a/tool/tctl/common/helpers_test.go b/tool/tctl/common/helpers_test.go
index <HASH>..<HASH> 100644
--- a/tool/tctl/common/helpers_test.go
+++ b/tool/tctl/common/helpers_test.go
@@ -110,6 +110,7 @@ func makeAndRunTestAuthServer(t *testing.T, opts ...testServerOptionFunc) (auth
}
cfg.CachePolicy.Enabled = false
+ cfg.Proxy.DisableWebInterface = true
auth, err = service.NewTeleport(cfg)
require.NoError(t, err)
require.NoError(t, auth.Start())
diff --git a/tool/tctl/common/resource_command_test.go b/tool/tctl/common/resource_command_test.go
index <HASH>..<HASH> 100644
--- a/tool/tctl/common/resource_command_test.go
+++ b/tool/tctl/common/resource_command_test.go
@@ -29,6 +29,9 @@ import (
// TestDatabaseResource tests tctl db rm/get commands.
func TestDatabaseResource(t *testing.T) {
fileConfig := &config.FileConfig{
+ Global: config.Global{
+ DataDir: t.TempDir(),
+ },
Databases: config.Databases{
Service: config.Service{
EnabledFlag: "true", | Fix tctl db resource UT (#<I>) | gravitational_teleport | train | go,go |
c229542e72314608027af9642fed86b2d4f15c97 | diff --git a/packages/react-jsx-highcharts/src/components/Series/Series.js b/packages/react-jsx-highcharts/src/components/Series/Series.js
index <HASH>..<HASH> 100644
--- a/packages/react-jsx-highcharts/src/components/Series/Series.js
+++ b/packages/react-jsx-highcharts/src/components/Series/Series.js
@@ -24,7 +24,6 @@ const Series = memo(
visible = true,
children = null,
axisId,
- colorAxisId,
requiresAxis = true,
...restProps
}) => {
@@ -49,7 +48,7 @@ const Series = memo(
const providerValueRef = useRef(null);
const axis = useAxis(axisId);
- const colorAxis = useColorAxis(colorAxisId);
+ const colorAxis = useColorAxis();
useEffect(() => {
if (requiresAxis && !axis) return; | Don't allow coloraxis to be referenced by id | whawker_react-jsx-highcharts | train | js |
591f3b884a8b10079b9f7206390f9ea7d3ad3217 | diff --git a/src/livestreamer_cli/main.py b/src/livestreamer_cli/main.py
index <HASH>..<HASH> 100644
--- a/src/livestreamer_cli/main.py
+++ b/src/livestreamer_cli/main.py
@@ -174,6 +174,7 @@ def output_stream_http(plugin, streams):
server.close(True)
player.close()
+ server.close()
def output_stream_passthrough(stream): | cli: Explicitly close the server listening socket.
Avoids a ResourceWarning for “--player-continuous-http” mode. | streamlink_streamlink | train | py |
7afdf5fdf21c73abb55819c76ef32808d8b61afa | diff --git a/Behat/DefaultContext.php b/Behat/DefaultContext.php
index <HASH>..<HASH> 100644
--- a/Behat/DefaultContext.php
+++ b/Behat/DefaultContext.php
@@ -70,9 +70,13 @@ abstract class DefaultContext extends RawMinkContext implements Context, KernelA
*/
public function purgeDatabase(BeforeScenarioScope $scope)
{
- $purger = new ORMPurger($this->getService('doctrine.orm.entity_manager'));
- $purger->setPurgeMode(ORMPurger::PURGE_MODE_TRUNCATE);
+ $entityManager = $this->getService('doctrine.orm.entity_manager');
+ $entityManager->getConnection()->executeUpdate("SET foreign_key_checks = 0;");
+
+ $purger = new ORMPurger($entityManager);
$purger->purge();
+
+ $entityManager->getConnection()->executeUpdate("SET foreign_key_checks = 1;");
}
/** | The most shameful hack ever made, but works | Sylius_SyliusResourceBundle | train | php |
39be766fe48a552ac012e0414f80603d2249f58a | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -14,16 +14,14 @@ end
RSpec.configure do |config|
config.color = true
- config.order = "random"
- config.formatter = ENV["CI"] == "true" ? :progress : :documentation
config.disable_monkey_patching!
+ config.example_status_persistence_file_path = "./tmp/rspec-examples.txt"
config.filter_run_when_matching :focus
- config.example_status_persistence_file_path = "./tmp/rspec-status.txt"
+ config.formatter = ENV["CI"] == "true" ? :progress : :documentation
+ config.mock_with(:rspec) { |mocks| mocks.verify_partial_doubles = true }
+ config.order = "random"
config.shared_context_metadata_behavior = :apply_to_host_groups
-
- config.mock_with :rspec do |mocks|
- mocks.verify_partial_doubles = true
- end
+ config.warnings = true
config.expect_with :rspec do |expectations|
expectations.syntax = :expect | Added Ruby warnings to RSpec helper.
Ensures we are being good citizens by not causing warnings for
downstream gems/projects.
The configurations settings were alpha-sorted for faster ability to
scan. | bkuhlmann_versionaire | train | rb |
23dbb8889adb060e1334058925b2a2bf4ceeb5d5 | diff --git a/src/android/CameraLauncher.java b/src/android/CameraLauncher.java
index <HASH>..<HASH> 100644
--- a/src/android/CameraLauncher.java
+++ b/src/android/CameraLauncher.java
@@ -435,11 +435,7 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
// Restore exif data to file
if (this.encodingType == JPEG) {
String exifPath;
- if (this.saveToPhotoAlbum) {
- exifPath = FileHelper.getRealPath(uri, this.cordova);
- } else {
- exifPath = uri.getPath();
- }
+ exifPath = uri.getPath();
exif.createOutFile(exifPath);
exif.writeExifData();
} | CB-<I>: Removing FileHelper call that was failing on Samsung Galaxy S3, now that we have a real path, we only need to update the MediaStore, not pull from it in this case | apache_cordova-plugin-camera | train | java |
29f036f7a58f554d616665bd9bddaee7207c60fc | diff --git a/lib/user_stream/version.rb b/lib/user_stream/version.rb
index <HASH>..<HASH> 100644
--- a/lib/user_stream/version.rb
+++ b/lib/user_stream/version.rb
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
module UserStream
- VERSION = "1.0.0"
+ VERSION = "1.1.0"
end | Version bump to <I>. | mitukiii_userstream | train | rb |
96aa840f0df2c3095b15582a324515cf37de78a8 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -7,8 +7,13 @@ except ImportError:
use_setuptools()
from setuptools import setup
-import textwrap
import os
+import sys
+import textwrap
+
+extra_tests_require = []
+if sys.version_info < (3, 0):
+ extra_tests_require.append('mock==1.0.1')
ROOT = os.path.abspath(os.path.dirname(__file__))
@@ -33,8 +38,7 @@ setup(
tests_require=[
'nose==1.3',
'django-setuptest==0.1.4',
- 'mock==1.0.1'
- ],
+ ] + extra_tests_require,
test_suite='setuptest.setuptest.SetupTestSuite',
keywords = "aws ses sns seacucumber boto",
classifiers=['Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Topic :: Internet :: WWW/HTTP'] | Removing mock from setup.py for Python 3.x | ofa_django-bouncy | train | py |
b76ff86acb555703c3a4afd0142bab6d18ab7d3e | diff --git a/org/postgresql/test/jdbc2/ArrayTest.java b/org/postgresql/test/jdbc2/ArrayTest.java
index <HASH>..<HASH> 100644
--- a/org/postgresql/test/jdbc2/ArrayTest.java
+++ b/org/postgresql/test/jdbc2/ArrayTest.java
@@ -81,7 +81,7 @@ public class ArrayTest extends TestCase
assertTrue(arrrs.next());
assertEquals(3,arrrs.getInt(1));
assertEquals(3,arrrs.getInt(2));
- assertFalse(arrrs.next());
+ assertTrue(!arrrs.next());
assertTrue(arrrs.previous());
assertEquals(3,arrrs.getInt(2));
arrrs.first();
@@ -106,7 +106,7 @@ public class ArrayTest extends TestCase
assertTrue(arrrs.next());
assertEquals(3, arrrs.getInt(1));
assertEquals("fa\"b", arrrs.getString(2));
- assertFalse(arrrs.next());
+ assertTrue(!arrrs.next());
arrrs.close();
rs.close(); | My version of junit (<I>) doesn't have assertFalse. ArrayTest uses
it in a couple of places. This patch changes assertFalse(condition)
to assertTrue(!condition).
Oliver Jowett | pgjdbc_pgjdbc | train | java |
e8f0b5e35b869fb5e62549d460ca9cdfe8e1d259 | diff --git a/src/victory-container/victory-container.js b/src/victory-container/victory-container.js
index <HASH>..<HASH> 100644
--- a/src/victory-container/victory-container.js
+++ b/src/victory-container/victory-container.js
@@ -28,9 +28,10 @@ export default class VictoryContainer extends React.Component {
* children. VictoryContainer works with VictoryArea, VictoryAxis, VictoryBar, VictoryLine,
* VictoryScatter, VictoryChart, VictoryGroup, and VictoryStack.
* If no children are provided, VictoryContainer will render an empty SVG.
- * Props from children are used to determine defauly style, height, and width.
+ * Props from children are used to determine default style, height, and width.
*/
- children: React.PropTypes.oneOfType([ React.PropTypes.arrayOf(React.PropTypes.node),
+ children: React.PropTypes.oneOfType([
+ React.PropTypes.arrayOf(React.PropTypes.node),
React.PropTypes.node
]),
/** | adding tests for victory container and they all pass so far | FormidableLabs_victory | train | js |
3e786b1128a4249508dd6492aea10322ec4a16d9 | diff --git a/fireplace/card.py b/fireplace/card.py
index <HASH>..<HASH> 100644
--- a/fireplace/card.py
+++ b/fireplace/card.py
@@ -615,6 +615,9 @@ class Secret(Spell):
pass
def _set_zone(self, value):
+ if value == Zone.PLAY:
+ # Move secrets to the SECRET Zone when played
+ value = Zone.SECRET
if self.zone == Zone.SECRET:
self.controller.secrets.remove(self)
if value == Zone.SECRET:
@@ -627,10 +630,6 @@ class Secret(Spell):
return False
return super().is_playable()
- def summon(self):
- super().summon()
- self.zone = Zone.SECRET
-
def reveal(self):
return self.game.queue_actions(self, [Reveal(self)]) | Move Secrets to Zone.SECRET when played into Zone.PLAY | jleclanche_fireplace | train | py |
4e5ecf6eded72752ece9f07e6ba2aee41f4a35cc | diff --git a/lib/paleta/version.rb b/lib/paleta/version.rb
index <HASH>..<HASH> 100644
--- a/lib/paleta/version.rb
+++ b/lib/paleta/version.rb
@@ -1,3 +1,3 @@
module Paleta
- VERSION = '0.0.3'
+ VERSION = '0.0.4'
end | bumped version to <I> | jordanstephens_paleta | train | rb |
5b1191d625026f63db071a4936292a8a99388400 | diff --git a/lib/maxminddb/version.rb b/lib/maxminddb/version.rb
index <HASH>..<HASH> 100644
--- a/lib/maxminddb/version.rb
+++ b/lib/maxminddb/version.rb
@@ -1,3 +1,3 @@
module MaxMindDB
- VERSION = "0.1.3"
+ VERSION = "0.1.4"
end | Changed the version to '<I>'. | yhirose_maxminddb | train | rb |
0e37930d71f6fa27c71b799ac8d77c4c76e96dd3 | diff --git a/lib/transition-to-from-auto.js b/lib/transition-to-from-auto.js
index <HASH>..<HASH> 100644
--- a/lib/transition-to-from-auto.js
+++ b/lib/transition-to-from-auto.js
@@ -123,8 +123,8 @@
}
}
- transition.transitionProp = transitionProp;
- transition.transitionEnd = transitionEnd;
+ transition.prop = transitionProp;
+ transition.end = transitionEnd;
if (typeof module !== "undefined" && module.exports){
module.exports = transition; | .prop and .end for detected transition | 75lb_transition-to-from-auto | train | js |
12e89948a37a7ad22ffbd69480b788a78f505836 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -14,7 +14,7 @@ with open('requirements/base.txt') as f:
with open('requirements/test.txt') as f:
tests_reqs = [line for line in f.read().split('\n') if line]
with open('requirements/contrib.txt') as f:
- tests_reqs = [line for line in f.read().split('\n') if line]
+ tests_reqs.extend([line for line in f.read().split('\n') if line])
if sys.version_info[0] > 2:
readme = open('README.rst', encoding='utf-8').read() | :wrench: Fix test packages | peergradeio_flask-mongo-profiler | train | py |
e2cf6c16e37c5213ab0349af071b7ce439e6603f | diff --git a/rkt/pods.go b/rkt/pods.go
index <HASH>..<HASH> 100644
--- a/rkt/pods.go
+++ b/rkt/pods.go
@@ -943,16 +943,25 @@ func (p *pod) getAppsImageManifests() (AppsImageManifests, error) {
return aim, nil
}
-// getApps returns a list of apps in the pod
-func (p *pod) getApps() (schema.AppList, error) {
+// getManifest returns the PodManifest of the pod
+func (p *pod) getManifest() (*schema.PodManifest, error) {
pmb, err := p.readFile("pod")
if err != nil {
return nil, fmt.Errorf("error reading pod manifest: %v", err)
}
- pm := new(schema.PodManifest)
+ pm := &schema.PodManifest{}
if err = pm.UnmarshalJSON(pmb); err != nil {
return nil, fmt.Errorf("invalid pod manifest: %v", err)
}
+ return pm, nil
+}
+
+// getApps returns a list of apps in the pod
+func (p *pod) getApps() (schema.AppList, error) {
+ pm, err := p.getManifest()
+ if err != nil {
+ return nil, err
+ }
return pm.Apps, nil
} | rkt: factor out code to get PodManifest | rkt_rkt | train | go |
9f656733469396b79f5c5fcf00011a4f93044371 | diff --git a/pig/src/main/java/com/twitter/elephantbird/pig/util/PigToThrift.java b/pig/src/main/java/com/twitter/elephantbird/pig/util/PigToThrift.java
index <HASH>..<HASH> 100644
--- a/pig/src/main/java/com/twitter/elephantbird/pig/util/PigToThrift.java
+++ b/pig/src/main/java/com/twitter/elephantbird/pig/util/PigToThrift.java
@@ -11,8 +11,9 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-import org.apache.log4j.LogManager;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.apache.pig.backend.executionengine.ExecException;
import org.apache.pig.data.DataBag;
import org.apache.pig.data.DataByteArray;
@@ -43,7 +44,7 @@ import com.twitter.elephantbird.util.TypeRef;
* Any remaining fields will be left unset.
*/
public class PigToThrift<T extends TBase<?, ?>> {
- public static final Logger LOG = LogManager.getLogger(PigToThrift.class);
+ public static final Logger LOG = LoggerFactory.getLogger(PigToThrift.class);
private TStructDescriptor structDesc; | fix build error from log4j being used in PigToThrift | twitter_elephant-bird | train | java |
65e87c44cbd89cdccdb33d5fecf9c18e52931f8c | diff --git a/src/Model/Write/Products/Iterator.php b/src/Model/Write/Products/Iterator.php
index <HASH>..<HASH> 100644
--- a/src/Model/Write/Products/Iterator.php
+++ b/src/Model/Write/Products/Iterator.php
@@ -352,6 +352,9 @@ class Iterator extends EavIterator
$parentIds = array_keys($parentChildMap);
$result = array_combine($parentIds, array_fill(0, count($parentIds), []));
foreach ($iterator as $entity) {
+ if (!isset($map[$entity['entity_id']])) {
+ continue;
+ }
$parentId = $map[$entity['entity_id']];
if ($this->skipEntityChild($entity, $stockMap, $parentId)) {
@@ -528,6 +531,9 @@ class Iterator extends EavIterator
$type = $types->factory($fakeProduct);
if (!$type->isComposite($fakeProduct)) {
+ foreach ($group as $entityId => $entity) {
+ $childrenIds[$entityId] = $type->getChildrenIds($entityId, false);
+ }
continue;
}
@@ -678,4 +684,4 @@ class Iterator extends EavIterator
$attributes = $this->filterEntityAttributes($attributes);
return $attributes;
}
-}
\ No newline at end of file
+} | stock qty on simple product
This update is for including simple product on getting quantity stock value | EmicoEcommerce_Magento2TweakwiseExport | train | php |
e9de66aca2007a679de4ba11ea14ef061dca2f6e | diff --git a/graphicscontext.go b/graphicscontext.go
index <HASH>..<HASH> 100644
--- a/graphicscontext.go
+++ b/graphicscontext.go
@@ -67,6 +67,8 @@ func (c *graphicsContext) needsRestoring(context *opengl.Context) (bool, error)
}
func (c *graphicsContext) initializeIfNeeded() error {
+ // glViewport must be called at every frame on iOS
+ ui.GLContext().ResetViewportSize()
if !c.initialized {
if err := graphics.Initialize(ui.GLContext()); err != nil {
return err | graphics: Reset Viewport cache at each frame | hajimehoshi_ebiten | train | go |
440570e5fd4b2eb88968d54941e796f646e3581d | diff --git a/lib/installer.js b/lib/installer.js
index <HASH>..<HASH> 100644
--- a/lib/installer.js
+++ b/lib/installer.js
@@ -177,25 +177,19 @@ exports.promptAdminUser = function (callback) {
};
/**
- * Creates a hoodie admin user
+ * Creates a Pocket admin user
*/
exports.saveAdminUser = function (cfg, couch_pwd, user, callback) {
- // couchdb user doc
- var doc = {
- _id: 'org.couchdb.user:' + user.name,
- roles: ['hoodie-admin:' + cfg.id],
- type: 'user',
- name: user.name,
- password: user.password
- };
- // add auth info to db url
- var db_url = url.parse(cfg.couch.url);
- db_url.auth = cfg.couch.username + ':' + couch_pwd;
-
- var path = '/_users/' + encodeURIComponent(doc._id);
- var user_url = url.resolve(db_url, path);
- couchr.put(user_url, doc, callback);
+ request({
+ url: cfg.couch.url + '/_config/admins/' + encodeURIComponent(user.name),
+ method: 'PUT',
+ body: '"' + user.password + '"',
+ auth: {
+ user: cfg.couch.username,
+ pass: couch_pwd
+ }
+ }, callback)
};
/** | create full _admin user for pocket instead of using hoodie-admin:appid role | hoodiehq_hoodie-server | train | js |
f918fbbd54f5d0bd5893dc3fbc2883bb5727f7e2 | diff --git a/lib/rack/oauth2/server/authorize/request_with_connect_params.rb b/lib/rack/oauth2/server/authorize/request_with_connect_params.rb
index <HASH>..<HASH> 100644
--- a/lib/rack/oauth2/server/authorize/request_with_connect_params.rb
+++ b/lib/rack/oauth2/server/authorize/request_with_connect_params.rb
@@ -1,6 +1,9 @@
class Rack::OAuth2::Server::Authorize
module RequestWithConnectParams
- CONNECT_EXT_PARAMS = [:nonce, :display, :prompt, :request, :request_uri, :id_token]
+ CONNECT_EXT_PARAMS = [
+ :nonce, :display, :prompt, :max_age, :ui_locales, :claims_locales,
+ :id_token_hint, :login_hint, :acr_values, :claims, :request, :request_uri
+ ]
def self.prepended(klass)
klass.send :attr_optional, *CONNECT_EXT_PARAMS | support more request params (max_age, login_hint etc.) | nov_openid_connect | train | rb |
f0c2ff832e41ac382170acf9de6599c29a1c7b76 | diff --git a/ontrack-ui/src/main/java/net/nemerosa/ontrack/boot/resources/BranchResourceDecorator.java b/ontrack-ui/src/main/java/net/nemerosa/ontrack/boot/resources/BranchResourceDecorator.java
index <HASH>..<HASH> 100644
--- a/ontrack-ui/src/main/java/net/nemerosa/ontrack/boot/resources/BranchResourceDecorator.java
+++ b/ontrack-ui/src/main/java/net/nemerosa/ontrack/boot/resources/BranchResourceDecorator.java
@@ -178,6 +178,13 @@ public class BranchResourceDecorator extends AbstractResourceDecorator<Branch> {
branch.getType() == BranchType.TEMPLATE_INSTANCE
&& resourceContext.isProjectFunctionGranted(branch, BranchTemplateMgt.class)
)
+ // Template instance connection
+ .link(
+ "_templateInstanceConnect",
+ on(BranchController.class).connectTemplateInstance(branch.getId()),
+ branch.getType() == BranchType.CLASSIC
+ && resourceContext.isProjectFunctionGranted(branch, BranchTemplateMgt.class)
+ )
// Template instance synchronisation
.link(
"_templateInstanceSync", | #<I> Form to get the connection setup - link | nemerosa_ontrack | train | java |
5d79ee63fc6e393b98f3c80c3137efc764823d1a | diff --git a/modules/tester.js b/modules/tester.js
index <HASH>..<HASH> 100644
--- a/modules/tester.js
+++ b/modules/tester.js
@@ -70,11 +70,11 @@ var Tester = function(casper, options) {
});
this.on('success', function(success) {
- this.exporter.addSuccess(success.file, success.message);
+ this.exporter.addSuccess(fs.absolute(success.file), success.message);
});
this.on('fail', function(failure) {
- this.exporter.addFailure(failure.file, failure.message, failure.details || "test failed", failure.type || "unknown");
+ this.exporter.addFailure(fs.absolute(failure.file), failure.message, failure.details || "test failed", failure.type || "unknown");
this.testResults.failures.push(failure);
});
diff --git a/modules/xunit.js b/modules/xunit.js
index <HASH>..<HASH> 100644
--- a/modules/xunit.js
+++ b/modules/xunit.js
@@ -96,7 +96,7 @@ function generateClassName(classname) {
script = script.substring(fs.workingDirectory.length + 1);
return script.substring(0, script.lastIndexOf('.'));
}
- return classname;
+ return classname || "unknown";
}
/** | refs 1d<I>e5 - generateClassname does not remove file extension now if given an already relative path as parameter | casperjs_casperjs | train | js,js |
5cb6c664aa1619f7bf399627bab91f8330cc9fdc | diff --git a/openupgradelib/openupgrade.py b/openupgradelib/openupgrade.py
index <HASH>..<HASH> 100644
--- a/openupgradelib/openupgrade.py
+++ b/openupgradelib/openupgrade.py
@@ -22,6 +22,7 @@
import sys
import os
import inspect
+import uuid
import logging
from contextlib import contextmanager
from . import openupgrade_tools
@@ -992,8 +993,18 @@ def migrate(no_version=False):
(module, stage, version))
try:
# The actual function is called here
- with cr.savepoint():
- func(cr, version)
+ if hasattr(cr, 'savepoint'):
+ with cr.savepoint():
+ func(cr, version)
+ else:
+ name = uuid.uuid1().hex
+ cr.execute('SAVEPOINT "%s"' % name)
+ try:
+ func(cr, version)
+ cr.execute('RELEASE SAVEPOINT "%s"' % name)
+ except:
+ cr.execute('ROLLBACK TO SAVEPOINT "%s"' % name)
+ raise
except Exception as e:
logger.error(
"%s: error in migration script %s: %s" % | [FIX] support OpenERP version that don't have cr.savepoint | OCA_openupgradelib | train | py |
d1e8bb3899435973784d86b59725438c56d29f33 | diff --git a/bcbio/utils.py b/bcbio/utils.py
index <HASH>..<HASH> 100644
--- a/bcbio/utils.py
+++ b/bcbio/utils.py
@@ -113,7 +113,14 @@ def s3_handle(fname):
bucket, key = s3_bucket_key(fname)
s3 = boto.connect_s3()
- s3b = s3.get_bucket(bucket)
+ try:
+ s3b = s3.get_bucket(bucket)
+ except boto.exception.S3ResponseError, e:
+ # if we don't have bucket permissions but folder permissions, try without validation
+ if e.status == 403:
+ s3b = s3.get_bucket(bucket, validate=False)
+ else:
+ raise
s3key = s3b.get_key(key)
return S3Handle(s3key) | Enable streaming of files from buckets without access permissions. Fix for getting HiSeq X Ten data | bcbio_bcbio-nextgen | train | py |
20f22f761807a7d2ce049d48154ccd579eaaaf96 | diff --git a/Kernel.php b/Kernel.php
index <HASH>..<HASH> 100644
--- a/Kernel.php
+++ b/Kernel.php
@@ -63,9 +63,15 @@ class Kernel extends Component
$this->container->set($id, $definition);
}
- foreach ($this->config->get('bootstrappers') as $item) {
+ foreach ($this->config->get('bootstrappers') as $key => $value) {
/** @var \ManaPHP\BootstrapperInterface $bootstrapper */
- $bootstrapper = $this->container->get($item);
+ if (is_int($key)) {
+ $bootstrapper = $this->container->get($value);
+ } else {
+ $this->container->set($key, $value);
+ $bootstrapper = $this->container->get($key);
+ }
+
$bootstrapper->bootstrap();
} | refactor ManaPHP\Kernel | manaphp_framework | train | php |
61b0ab0e7784604610a028e30b9fca0e5fa661e8 | diff --git a/lib/lyricfy.rb b/lib/lyricfy.rb
index <HASH>..<HASH> 100644
--- a/lib/lyricfy.rb
+++ b/lib/lyricfy.rb
@@ -36,6 +36,9 @@ module Lyricfy
fetcher = klass.new(artist_name: artist, song_name: song)
if lyric_body = fetcher.search
+ #def lyric_body.to_s
+ #self.join("\n")
+ #end
result = OpenStruct.new(artist: artist, song: song, body: lyric_body)
break
end
diff --git a/test/lyricfy_test.rb b/test/lyricfy_test.rb
index <HASH>..<HASH> 100644
--- a/test/lyricfy_test.rb
+++ b/test/lyricfy_test.rb
@@ -42,6 +42,17 @@ describe Lyricfy::Fetcher do
end
end
end
+
+ describe "lyric found" do
+ it "should return lyrics" do
+ fetcher = Lyricfy::Fetcher.new :metro_lyrics
+ VCR.use_cassette('metro_lyrics_200') do
+ result = fetcher.search('2pac', 'Life Goes On')
+ result.body.must_be_instance_of Array
+ result.body.to_s.must_include 'Life as a baller'
+ end
+ end
+ end
end
end
end | Made song.body respond to to_s so that you can easily print lyrics
without using an each iterator | javichito_Lyricfy | train | rb,rb |
b13f64531685beb3c5ee315b6d2409e43f980c01 | diff --git a/lib/Doctrine/ODM/PHPCR/UnitOfWork.php b/lib/Doctrine/ODM/PHPCR/UnitOfWork.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/ODM/PHPCR/UnitOfWork.php
+++ b/lib/Doctrine/ODM/PHPCR/UnitOfWork.php
@@ -814,7 +814,8 @@ class UnitOfWork
$path = $this->getDocumentId($document);
$session = $this->dm->getPhpcrSession();
$vm = $session->getWorkspace()->getVersionManager();
- return $vm->getBaseVersion($path)->getPredecessors();
+ $vh = $vm->getVersionHistory($path);
+ return (array)$vh->getAllVersions();
}
/** | use versionhistory to get all predecessors | doctrine_phpcr-odm | train | php |
283bd4e033aed592298ceb32ee03ce658b3273a6 | diff --git a/moco-core/src/main/java/com/github/dreamhead/moco/websocket/ActualWebSocketServer.java b/moco-core/src/main/java/com/github/dreamhead/moco/websocket/ActualWebSocketServer.java
index <HASH>..<HASH> 100644
--- a/moco-core/src/main/java/com/github/dreamhead/moco/websocket/ActualWebSocketServer.java
+++ b/moco-core/src/main/java/com/github/dreamhead/moco/websocket/ActualWebSocketServer.java
@@ -39,7 +39,7 @@ public class ActualWebSocketServer implements WebSocketServer {
return uri;
}
- public void sendOpen(final Channel channel) {
+ private void sendConnected(final Channel channel) {
if (connected != null) {
MessageContent messageContent = this.connected.readFor(null);
channel.writeAndFlush(new TextWebSocketFrame(messageContent.toString()));
@@ -56,7 +56,7 @@ public class ActualWebSocketServer implements WebSocketServer {
} else {
handshaker.handshake(channel, request);
addChannel(channel);
- sendOpen(channel);
+ sendConnected(channel);
}
}
} | made send connected in websocket server private | dreamhead_moco | train | java |
18e0d91bf95cdf3d7d91ee13527ee339a9c133df | diff --git a/environments/dev/common/config/main-local.php b/environments/dev/common/config/main-local.php
index <HASH>..<HASH> 100644
--- a/environments/dev/common/config/main-local.php
+++ b/environments/dev/common/config/main-local.php
@@ -11,6 +11,9 @@ return [
'mail' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail',
+ // send all mails to a file by default. You have to set
+ // 'useFileTransport' to false and configure a transport
+ // for the mailer to send real emails.
'useFileTransport' => true,
],
], | added explicit comment about file transport to mail config
fixes #<I> | yiisoft_yii2-app-advanced | train | php |
cfba5db1e4f958bd5daab083362d75c3b407dca8 | diff --git a/lib/apple_tv_converter.rb b/lib/apple_tv_converter.rb
index <HASH>..<HASH> 100644
--- a/lib/apple_tv_converter.rb
+++ b/lib/apple_tv_converter.rb
@@ -114,6 +114,7 @@ module AppleTvConverter
# ice - Icelandic -> isl
# ita - Italian
# jpn - Japanese
+ # jap - Japanese -> jpn
# kor - Korean
# lav - Latvian
# lit - Lithuanian
@@ -140,6 +141,7 @@ module AppleTvConverter
'gre' => 'ell',
'ice' => 'isl',
'rum' => 'ron',
+ 'jap' => 'jpn',
'may' => nil
} | Convert 'jap' language to 'jpn' | gokuu_apple-tv-converter | train | rb |
fa4edd700ebc1b3614bcd953c215d3f2ab2e0b35 | diff --git a/collector/meminfo_linux.go b/collector/meminfo_linux.go
index <HASH>..<HASH> 100644
--- a/collector/meminfo_linux.go
+++ b/collector/meminfo_linux.go
@@ -45,6 +45,10 @@ func parseMemInfo(r io.Reader) (map[string]float64, error) {
for scanner.Scan() {
line := scanner.Text()
parts := strings.Fields(line)
+ // Workaround for empty lines occasionally occur in CentOS 6.2 kernel 3.10.90.
+ if len(parts) == 0 {
+ continue
+ }
fv, err := strconv.ParseFloat(parts[1], 64)
if err != nil {
return nil, fmt.Errorf("invalid value in meminfo: %s", err) | Fix accidently empty lines in meminfo_linux (#<I>)
* Fix accidently empty lines in meminfo_linux | prometheus_node_exporter | train | go |
91625705d41fd12c5e9a4b76b7b98c5102498948 | diff --git a/core-bundle/tests/Monolog/ContaoTableProcessorTest.php b/core-bundle/tests/Monolog/ContaoTableProcessorTest.php
index <HASH>..<HASH> 100644
--- a/core-bundle/tests/Monolog/ContaoTableProcessorTest.php
+++ b/core-bundle/tests/Monolog/ContaoTableProcessorTest.php
@@ -108,7 +108,12 @@ class ContaoTableProcessorTest extends TestCase
['::1', '::1'],
['192.168.1.111', '192.168.1.0'],
['10.10.10.10', '10.10.10.0'],
- // TODO test with IPv6
+ ['FE80:0000:0000:0000:0202:B3FF:FE1E:8329', 'FE80:0000:0000:0000:0202:B3FF:FE1E:0000'],
+ ['FE80::0202:B3FF:FE1E:8329', 'FE80::0202:B3FF:FE1E:0000'],
+ ['2001:DB8:0:1', '2001:DB8:0:0000'],
+ ['3ffe:1900:4545:3:200:f8ff:fe21:67cf', '3ffe:1900:4545:3:200:f8ff:fe21:0000'],
+ ['fe80:0:0:0:200:f8ff:fe21:67cf', 'fe80:0:0:0:200:f8ff:fe21:0000'],
+ ['fe80::200:f8ff:fe21:67cf', 'fe80::200:f8ff:fe21:0000'],
];
}
} | [Core] Added IPv6 anonymization tests | contao_contao | train | php |
0b63da9d5aad9382515cc04f840a4ad73c269d4d | diff --git a/activemodel/lib/active_model/secure_password.rb b/activemodel/lib/active_model/secure_password.rb
index <HASH>..<HASH> 100644
--- a/activemodel/lib/active_model/secure_password.rb
+++ b/activemodel/lib/active_model/secure_password.rb
@@ -3,6 +3,7 @@ module ActiveModel
extend ActiveSupport::Concern
class << self; attr_accessor :min_cost; end
+ self.min_cost = false
module ClassMethods
# Adds methods to set and authenticate against a BCrypt password.
@@ -13,8 +14,8 @@ module ActiveModel
# you wish to turn off validations, pass <tt>validations: false</tt> as an
# argument. You can add more validations by hand if need be.
#
- # If you don't need the confirmation validation, just don't set any
- # value to the password_confirmation attribute and the the validation
+ # If you don't need the confirmation validation, just don't set any
+ # value to the password_confirmation attribute and the the validation
# will not be triggered.
#
# You need to add bcrypt-ruby (~> 3.0.0) to Gemfile to use #has_secure_password: | Initialize #min_cost to avoid warning in Ruby <I> | rails_rails | train | rb |
97099aef9ddd588e24d0ffafd55d9b63d8b14fc2 | diff --git a/lmdb/txn_test.go b/lmdb/txn_test.go
index <HASH>..<HASH> 100644
--- a/lmdb/txn_test.go
+++ b/lmdb/txn_test.go
@@ -6,7 +6,7 @@ import (
"testing"
)
-func TestTxnUpdate(t *testing.T) {
+func TestTxn_Update(t *testing.T) {
env := setup(t)
defer clean(env, t)
@@ -43,7 +43,7 @@ func TestTxnUpdate(t *testing.T) {
}
}
-func TestTxnViewSub(t *testing.T) {
+func TestTxn_View_noSubTxn(t *testing.T) {
env := setup(t)
defer clean(env, t)
@@ -64,7 +64,7 @@ func TestTxnViewSub(t *testing.T) {
}
}
-func TestTxnUpdateSub(t *testing.T) {
+func TestTxn_Sub(t *testing.T) {
env := setup(t)
defer clean(env, t)
@@ -125,7 +125,7 @@ func TestTxnUpdateSub(t *testing.T) {
}
}
-func TestTxnFlags(t *testing.T) {
+func TestTxn_Flags(t *testing.T) {
env := setup(t)
path, err := env.Path()
if err != nil { | rename txn tests to be consistent with cursor_test.go | bmatsuo_lmdb-go | train | go |
0325c7430feb5f87418bbcf88958a1bb9790535b | diff --git a/azurerm/resource_arm_virtual_network_gateway.go b/azurerm/resource_arm_virtual_network_gateway.go
index <HASH>..<HASH> 100644
--- a/azurerm/resource_arm_virtual_network_gateway.go
+++ b/azurerm/resource_arm_virtual_network_gateway.go
@@ -349,19 +349,10 @@ func resourceArmVirtualNetworkGatewayDelete(d *schema.ResourceData, meta interfa
return fmt.Errorf("Error waiting for AzureRM Virtual Network Gateway %s to be removed: %+v", name, err)
}
- // Gateways are not fully cleaned up when the API indicates the delete operation
- // has finished, this workaround was suggested by Azure support to avoid conflicts
- // when modifying/deleting the related subnet or network. Although the API indicated
- // that the Virtual Network Gateway does not exist anymore, there is still a link
- // to the Gateway Subnet it has been associated with. This causes an error when
- // trying to delete the Gateway Subnet immediately after the Virtual Network Gateway
- // has been deleted.
-
d.SetId("")
return nil
}
-// TODO check if this is necessary?
func virtualNetworkGatewayStateRefreshFunc(client *ArmClient, resourceGroupName string, virtualNetworkGateway string, withNotFound bool) resource.StateRefreshFunc {
return func() (interface{}, string, error) {
resp, err := client.vnetGatewayClient.Get(resourceGroupName, virtualNetworkGateway) | virtual_network_gateway: Removed comments on subnet deletion workaround | terraform-providers_terraform-provider-azurerm | train | go |
4d8092fee563b23a56a86ee61a6daaf68cdc5bcd | diff --git a/datatableview/columns.py b/datatableview/columns.py
index <HASH>..<HASH> 100644
--- a/datatableview/columns.py
+++ b/datatableview/columns.py
@@ -338,13 +338,16 @@ if get_version().split('.') >= ['1', '6']:
class BooleanColumn(Column):
model_field_class = models.BooleanField
handles_field_classes = [models.BooleanField, models.NullBooleanField]
+ lookup_types = ('exact', 'in')
class IntegerColumn(Column):
model_field_class = models.IntegerField
handles_field_classes = [models.IntegerField, models.AutoField]
+ lookup_types = ('exact', 'in')
class FloatColumn(Column):
model_field_class = models.FloatField
handles_field_classes = [models.FloatField, models.DecimalField]
+ lookup_types = ('exact', 'in') | Fix lookup types for boolean/number fields
Relying on the generic Column base class for these is too implicit. | pivotal-energy-solutions_django-datatable-view | train | py |
7e88e4c1c82cf12a628d6347b1380202abf20edd | diff --git a/pages/Category/components/Products/connector.js b/pages/Category/components/Products/connector.js
index <HASH>..<HASH> 100644
--- a/pages/Category/components/Products/connector.js
+++ b/pages/Category/components/Products/connector.js
@@ -18,7 +18,7 @@ const mapStateToProps = (state, props) => ({
* @return {Object} The extended component props.
*/
const mapDispatchToProps = dispatch => ({
- getProducts: categoryId => dispatch(fetchCategoryProducts(categoryId)),
+ getProducts: (categoryId, offset) => dispatch(fetchCategoryProducts(categoryId, offset)),
});
/** | PWA-<I> Send offset to action. | shopgate_pwa | train | js |
e11ec81fbf40bd8e914687e1e7b30593bb3cdf5a | diff --git a/cheroot/test/test_conn.py b/cheroot/test/test_conn.py
index <HASH>..<HASH> 100644
--- a/cheroot/test/test_conn.py
+++ b/cheroot/test/test_conn.py
@@ -804,23 +804,18 @@ def test_Content_Length_Non_Int(test_client):
""" Try a request where Content-Length header is non-compatible
"""
- conn = test_client.get_connection()
-
- conn.putrequest('POST', '/upload', skip_host=True)
- conn.putheader('Host', conn.host)
- conn.putheader('Content-Type', 'text/plain')
- conn.putheader('Content-Length', 'not-an-integer')
- conn.endheaders()
-
- response = conn.getresponse()
- status_line, actual_headers, actual_resp_body = webtest.shb(response)
+ status_line, actual_headers, actual_resp_body = test_client.post(
+ '/upload',
+ headers=[
+ ('Content-Type', 'text/plain'),
+ ('Content-Length', 'not-an-integer'),
+ ],
+ )
actual_status = int(status_line[:3])
assert actual_status == 400
assert actual_resp_body == b'Malformed Content-Length Header.'
- conn.close()
-
@pytest.mark.parametrize(
'uri,expected_resp_status,expected_resp_body', | Rewrite non-int content-length test to use client
Make it a higher-level test | cherrypy_cheroot | train | py |
c0a583e225f62bc0bc5ef0e72b78e26dd956debc | diff --git a/api/python/setup.py b/api/python/setup.py
index <HASH>..<HASH> 100644
--- a/api/python/setup.py
+++ b/api/python/setup.py
@@ -57,7 +57,7 @@ setup(
'numpy>=1.14.0', # required by pandas, but missing from its dependencies.
'packaging>=16.8',
'pandas>=0.19.2',
- 'pyarrow>=0.9.0,<0.14', # as of 7/5/19: linux/circleci bugs on 0.14
+ 'pyarrow>=0.14.1', # as of 7/5/19: linux/circleci bugs on 0.14.0
'requests>=2.12.4',
'ruamel.yaml<=0.15.70',
'tqdm>=4.26.0', | see if pyarrow <I> works in CI (#<I>) | quiltdata_quilt | train | py |
709e4d41fff8bf686d4e44b3d8ce3529abc79a66 | diff --git a/test/sass/engine_test.rb b/test/sass/engine_test.rb
index <HASH>..<HASH> 100755
--- a/test/sass/engine_test.rb
+++ b/test/sass/engine_test.rb
@@ -115,14 +115,16 @@ class SassEngineTest < Test::Unit::TestCase
def test_exceptions
EXCEPTION_MAP.each do |key, value|
+ line = 10
begin
- Sass::Engine.new(key).render
+ Sass::Engine.new(key, :filename => __FILE__, :line => line).render
rescue Sass::SyntaxError => err
value = [value] unless value.is_a?(Array)
assert_equal(value.first, err.message, "Line: #{key}")
- assert_equal(value[1] || key.split("\n").length, err.sass_line, "Line: #{key}")
- assert_match(/\(sass\):[0-9]+/, err.backtrace[0], "Line: #{key}")
+ assert_equal(__FILE__, err.sass_filename)
+ assert_equal((value[1] || key.split("\n").length) + line - 1, err.sass_line, "Line: #{key}")
+ assert_match(/#{Regexp.escape(__FILE__)}:[0-9]+/, err.backtrace[0], "Line: #{key}")
else
assert(false, "Exception not raised for\n#{key}")
end | [Sass] Test for :line-setting. | sass_ruby-sass | train | rb |
afcc765f597b09b085a2c6f73e2b05d65ba09b4e | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -53,9 +53,7 @@ module.exports = class WebappWebpackPlugin {
if (this.options.inject) {
// Hook into the html-webpack-plugin processing and add the html
tap(compilation, 'html-webpack-plugin-before-html-processing', 'WebappWebpackPlugin', (htmlPluginData, callback) => {
- if (htmlPluginData.plugin.options.favicons !== false) {
- htmlPluginData.html = htmlPluginData.html.replace(/(<\/head>)/i, result + '$&');
- }
+ htmlPluginData.html = htmlPluginData.html.replace(/(<\/head>)/i, result + '$&');
return callback(null, htmlPluginData);
});
} | fix: do not rely on html-webpack-plugin's internals | brunocodutra_webapp-webpack-plugin | train | js |
8a3f951c33e7be3a1e215c4f3fb89a16caf8ca4f | diff --git a/src/model/Stats/StatsRepository.php b/src/model/Stats/StatsRepository.php
index <HASH>..<HASH> 100644
--- a/src/model/Stats/StatsRepository.php
+++ b/src/model/Stats/StatsRepository.php
@@ -41,9 +41,9 @@ class StatsRepository extends Repository
public function updateKey($key, $value)
{
- $this->getTable()
- ->where(['key' => $key])
- ->update(['value' => $value]);
+ $this->getDatabase()->query(
+ 'INSERT INTO stats (`key`, `value`) VALUES (?, ?) ON DUPLICATE KEY UPDATE value=VALUES(value)', $key, $value
+ );
}
public static function insertOrUpdateQuery($key, $valueQuery) | Loading stats value from cache if not too old | remp2020_crm-application-module | train | php |
3bc12631b1c5504cf9fbe7848b3f21b1052a9598 | diff --git a/devices.js b/devices.js
index <HASH>..<HASH> 100755
--- a/devices.js
+++ b/devices.js
@@ -1837,6 +1837,14 @@ const devices = [
ota: ota.zigbeeOTA,
},
{
+ zigbeeModel: ['LCF005'],
+ model: '8718696170557',
+ vendor: 'Philips',
+ description: 'Hue Calla outdoor',
+ extend: hue.light_onoff_brightness_colortemp_colorxy,
+ ota: ota.zigbeeOTA,
+ },
+ {
zigbeeModel: ['1744130P7'],
model: '1744130P7',
vendor: 'Philips', | Support Hue Calla Large (#<I>)
Add support of "Hue Calla Large" - my first pull request ever | Koenkk_zigbee-shepherd-converters | train | js |
fd8a6ff64735632f3e8125f139f068eed46c24e4 | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -53,12 +53,24 @@ module Poise
def patch_module(mod, name, obj, &block)
class_name = Chef::Mixin::ConvertToClassName.convert_to_class_name(name.to_s)
- raise "#{mod.name}::#{class_name} is already defined" if mod.const_defined?(class_name, false)
+ if mod.const_defined?(class_name, false)
+ old_class = mod.const_get(class_name, false)
+ # We are only allowed to patch over things installed by patch_module
+ raise "#{mod.name}::#{class_name} is already defined" if !old_class.instance_variable_get(:@poise_spec_helper)
+ # Remove it before setting to avoid the redefinition warning
+ mod.send(:remove_const, class_name)
+ end
+ # Tag our objects so we know we are allows to overwrite those, but not other stuff.
+ obj.instance_variable_set(:@poise_spec_helper, true)
mod.const_set(class_name, obj)
begin
block.call
ensure
- mod.send(:remove_const, class_name)
+ if old_class
+ mod.const_set(class_name, old_class)
+ else
+ mod.send(:remove_const, class_name)
+ end
end
end | Allow redefining stuff if it was us that set it in the first place.
This means you can redefine resources/providers in a nested fashion. | poise_poise | train | rb |
fd7b77f765e34734e29dc4085a042e401ecaf8f6 | diff --git a/src/Pho/Kernel/Kernel.php b/src/Pho/Kernel/Kernel.php
index <HASH>..<HASH> 100644
--- a/src/Pho/Kernel/Kernel.php
+++ b/src/Pho/Kernel/Kernel.php
@@ -176,6 +176,8 @@ class Kernel extends Init
/**
* Imports from a given Pho backup file
+ *
+ * @see Kernel::export()
*
* @param string $blob
*
@@ -186,7 +188,7 @@ class Kernel extends Init
if(!$this->is_running) {
throw new Exceptions\KernelNotRunningException();
}
- $import = json_decode($blob, true);
+ $import = unserialize($blob);
foreach($import as $key=>$value) {
$this->database()->restore($key, 0, $value);
}
@@ -227,6 +229,11 @@ class Kernel extends Init
/**
* Exports in Pho backup file format
+ *
+ * There was a problem with json_encode in large files
+ * hence switched to php serialize format instead.
+ *
+ * @see Kernel::import
*
* @return string
*/
@@ -241,7 +248,7 @@ class Kernel extends Init
// if($key!="index") // skip list
$return[$key] = $this->database()->dump($key);
}
- return json_encode($return);
+ return serialize($return);
}
-}
\ No newline at end of file
+} | switched to php serialize for import/export
otherwise it fails with large files | phonetworks_pho-microkernel | train | php |
a4274110de7537744e146d3c86062631bb5d76c2 | diff --git a/index.test.js b/index.test.js
index <HASH>..<HASH> 100644
--- a/index.test.js
+++ b/index.test.js
@@ -3,7 +3,7 @@ Licensed under the MIT license. See LICENSE file in the repository root for full
import { copy, emptyDir, readFile } from "fs-extra";
import path from "path";
-import runTestsFromFileSystem from "./index";
+import runTestsFromFileSystem from ".";
const expectedFileName = "expected.txt"; | removed index file name from import path in tests
using Node module resolution | DevSnicket_eunice-run-tests-from-file-system | train | js |
02e7dbbb61d0834f94acd9da5b64d11374b00b5a | diff --git a/marrow/mongo/query/__init__.py b/marrow/mongo/query/__init__.py
index <HASH>..<HASH> 100644
--- a/marrow/mongo/query/__init__.py
+++ b/marrow/mongo/query/__init__.py
@@ -78,7 +78,7 @@ class Ops(Container):
del self.operations[name]
def __iter__(self):
- return iter(self.operations.items())
+ return iter(self.operations.keys())
def __len__(self):
return len(self.operations) | Make compatible with direct pymongo usage. | marrow_mongo | train | py |
e199219197037430c8f61050047545a259073e94 | diff --git a/packages/razzle/config/runPlugin.js b/packages/razzle/config/runPlugin.js
index <HASH>..<HASH> 100644
--- a/packages/razzle/config/runPlugin.js
+++ b/packages/razzle/config/runPlugin.js
@@ -6,6 +6,10 @@ function runPlugin(plugin, config, { target, dev }, webpack) {
return runPlugin({ name: plugin }, config, { target, dev }, webpack);
}
+ if (typeof plugin === 'function') {
+ return plugin(config, { target, dev }, webpack);
+ }
+
if (typeof plugin.func === 'function') {
// Used for writing plugin tests
return plugin.func(config, { target, dev }, webpack, plugin.options); | add support for function as plugin (#<I>) | jaredpalmer_razzle | train | js |
91176e80cf611ce7d60e52bc94e81adf51aa2931 | diff --git a/test/test_prototype_transforms_functional.py b/test/test_prototype_transforms_functional.py
index <HASH>..<HASH> 100644
--- a/test/test_prototype_transforms_functional.py
+++ b/test/test_prototype_transforms_functional.py
@@ -488,6 +488,15 @@ def perspective_segmentation_mask():
@register_kernel_info_from_sample_inputs_fn
+def center_crop_image_tensor():
+ for image, output_size in itertools.product(
+ make_images(sizes=((16, 16), (7, 33), (31, 9))),
+ [[4, 3], [42, 70], [4]], # crop sizes < image sizes, crop_sizes > image sizes, single crop size
+ ):
+ yield SampleInput(image, output_size)
+
+
+@register_kernel_info_from_sample_inputs_fn
def center_crop_bounding_box():
for bounding_box, output_size in itertools.product(make_bounding_boxes(), [(24, 12), [16, 18], [46, 48], [12]]):
yield SampleInput(
@@ -495,6 +504,7 @@ def center_crop_bounding_box():
)
+@register_kernel_info_from_sample_inputs_fn
def center_crop_segmentation_mask():
for mask, output_size in itertools.product(
make_segmentation_masks(image_sizes=((16, 16), (7, 33), (31, 9))), | [proto] Updated center_crop tests (#<I>)
* [proto] Added missing decorator for center_crop_segmentation_mask tests
* Added center_crop_image_tensor | pytorch_vision | train | py |
4cd401d3c76a0371df2d6a0c0ffec166a6d73263 | diff --git a/src/directives/objectBuilder.js b/src/directives/objectBuilder.js
index <HASH>..<HASH> 100644
--- a/src/directives/objectBuilder.js
+++ b/src/directives/objectBuilder.js
@@ -31,14 +31,7 @@ module.exports = function() {
'</div>',
replace: true,
link: function($scope) {
- $scope.data = $scope.data || {};
- $scope.dataArray = [];
- for (var key in $scope.data) {
- $scope.dataArray.push({
- key: key,
- value: $scope.data[key]
- });
- }
+ init();
$scope.addValue = function() {
$scope.dataArray.push({key: '', value: ''});
@@ -52,6 +45,8 @@ module.exports = function() {
$scope.addValue();
}
+ $scope.$watch('data', init);
+
$scope.$watch('dataArray', function(newValue) {
$scope.data = {};
for (var i in newValue) {
@@ -59,6 +54,17 @@ module.exports = function() {
$scope.data[item.key] = item.value;
}
}, true);
+
+ function init() {
+ $scope.data = $scope.data || {};
+ $scope.dataArray = [];
+ for (var key in $scope.data) {
+ $scope.dataArray.push({
+ key: key,
+ value: $scope.data[key]
+ });
+ }
+ }
}
};
}; | FOR-<I>: Improved 'objectBuilder' directive. | formio_ngFormBuilder | train | js |
c06b7b2c262d4bad76fc4e83a4c91ee2dc7dcce2 | diff --git a/insteonplm/tools.py b/insteonplm/tools.py
index <HASH>..<HASH> 100644
--- a/insteonplm/tools.py
+++ b/insteonplm/tools.py
@@ -62,7 +62,7 @@ def console(loop, log, devicelist):
if 1 == 1:
device = conn.protocol.devices.get_device('14627a')
- device.lightOnLevel.connect(self.async_light_on_level_callback)
+ device.lightOnLevel.connect(async_light_on_level_callback)
device.light_on()
log.debug('Sent light on request') | Updated tools.py for testing | nugget_python-insteonplm | 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.