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 |
|---|---|---|---|---|---|
a39184a0af404da56d2ae36f3032cce52cdc1701 | diff --git a/gossipsub_test.go b/gossipsub_test.go
index <HASH>..<HASH> 100644
--- a/gossipsub_test.go
+++ b/gossipsub_test.go
@@ -597,7 +597,7 @@ func TestGossipsubGraftPruneRetry(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
- hosts := getNetHosts(t, ctx, 20)
+ hosts := getNetHosts(t, ctx, 10)
psubs := getGossipsubs(ctx, hosts)
denseConnect(t, hosts)
@@ -645,7 +645,7 @@ func TestGossipsubControlPiggyback(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
- hosts := getNetHosts(t, ctx, 20)
+ hosts := getNetHosts(t, ctx, 10)
psubs := getGossipsubs(ctx, hosts)
denseConnect(t, hosts) | smaller net sizes for tests that exercise full queues
so that travis doesn't get killed by OOM. | libp2p_go-libp2p-pubsub | train | go |
4be593fd100e856ddedea6159b7cf09902daf166 | diff --git a/lib/Gitter/Repository.php b/lib/Gitter/Repository.php
index <HASH>..<HASH> 100644
--- a/lib/Gitter/Repository.php
+++ b/lib/Gitter/Repository.php
@@ -77,9 +77,10 @@ class Repository
public function add($files = '.')
{
if (is_array($files)) {
- $files = implode('" "', $files);
+ $files = implode(' ', array_map('escapeshellarg', $files));
+ } else {
+ $files = escapeshellarg($files);
}
- $files = "\"$files\"";
$this->getClient()->run($this, "add $files"); | use escapeshellarg for file name escaping | klaussilveira_gitter | train | php |
01753ebea60824d3eed0f8a6b179ca587c25f8aa | diff --git a/src/Hostnet/FormTwigBridge/PHPRenderer.php b/src/Hostnet/FormTwigBridge/PHPRenderer.php
index <HASH>..<HASH> 100644
--- a/src/Hostnet/FormTwigBridge/PHPRenderer.php
+++ b/src/Hostnet/FormTwigBridge/PHPRenderer.php
@@ -24,6 +24,7 @@ class PHPRenderer
throw new \DomainException('The FormRenderer needs an environment with the FormExtension');
}
$this->environment = $environment;
+ $this->environment->getExtension('form')->initRuntime($this->environment);
}
/** | When rendering a form field, rather then a template, as the first thing, the environment was still missing | hostnet_form-twig-bridge | train | php |
8a5426a1b16647dcd338e65f377e22cc07271b57 | diff --git a/Slug.php b/Slug.php
index <HASH>..<HASH> 100644
--- a/Slug.php
+++ b/Slug.php
@@ -70,7 +70,7 @@ class Slug extends Behavior
if ($this->unique) {
$suffix = 1;
while (!$this->checkUniqueSlug()) {
- $this->owner->{$this->slug_attribute} = $slug . $this->replacement . ++$suffix;
+ $this->owner->{$this->slug_attribute} = $slug . $this->replacement . $suffix++;
}
}
}
@@ -104,9 +104,19 @@ class Slug extends Behavior
*/
private function checkUniqueSlug()
{
+ $primaryKeys = $this->owner->primaryKey();
+ $filter = ['not', []];
+ foreach ($primaryKeys as $primaryKey) {
+ $filter[1][$primaryKey] = $this->owner->$primaryKey;
+ }
$model = DynamicModel::validateData(
[$this->slug_attribute => $this->owner->{$this->slug_attribute}],
- [[$this->slug_attribute, 'unique', 'targetClass' => $this->owner]]
+ [[
+ $this->slug_attribute,
+ 'unique',
+ 'targetClass' => $this->owner,
+ 'filter' => $filter
+ ]]
);
return !$model->hasErrors($this->slug_attribute);
} | added uniqueness based on row.
also updated row so it only appends one instead of double on first go. | zelenin_yii2-slug-behavior | train | php |
82c01e5a9509adfa4fc4f81edd2cc6f16906e862 | diff --git a/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py b/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py
index <HASH>..<HASH> 100644
--- a/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py
+++ b/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py
@@ -114,9 +114,6 @@ class TypeSmokeTest(unittest.TestCase):
lambda ignored_a, ignored_b: None, b'')
del plugin
- @unittest.skipIf(
- platform.python_implementation() == "PyPy",
- 'TODO(issue 7672): figure out why this fails on PyPy')
def testCallCredentialsFromPluginUpDown(self):
plugin = cygrpc.CredentialsMetadataPlugin(_metadata_plugin_callback, b'')
call_credentials = cygrpc.call_credentials_metadata_plugin(plugin) | remove skipIf from TypeSmokeTest (issue <I>)
remove skipIfStatement from
TypeSmokeTest.testCallCredentialsFromPluginUpDown since the test passes
on PyPy variants <I> and newer since these variants have improved
compatibility support for the C-Extensions | grpc_grpc | train | py |
984aeba9a5f33644e18162fd14ab2ff474450b7a | diff --git a/src/Rector/MethodCall/MethodNameReplacerRector.php b/src/Rector/MethodCall/MethodNameReplacerRector.php
index <HASH>..<HASH> 100644
--- a/src/Rector/MethodCall/MethodNameReplacerRector.php
+++ b/src/Rector/MethodCall/MethodNameReplacerRector.php
@@ -123,7 +123,7 @@ CODE_SAMPLE
private function matchOldToNewMethods(): array
{
foreach ($this->activeTypes as $activeType) {
- if ($this->perClassOldToNewMethods[$activeType]) {
+ if (isset($this->perClassOldToNewMethods[$activeType])) {
return $this->perClassOldToNewMethods[$activeType];
}
} | Fix MethodNameReplacerRector for active types [ref #<I>] | rectorphp_rector | train | php |
8de11701c96b17057f2ccf80e1e97a328d3f6de9 | diff --git a/shorten/keystores.py b/shorten/keystores.py
index <HASH>..<HASH> 100644
--- a/shorten/keystores.py
+++ b/shorten/keystores.py
@@ -69,3 +69,11 @@ class RedisKeystore(object):
def __getitem__(self, key):
return self._redis.get(key)
+
+ def get_redis(self):
+ return self._redis
+
+ def set_redis(self, v):
+ self._redis = v
+
+ property(get_redis, set_redis) | Added getter/setter for redis | chrlie_shorten | train | py |
1dd7c37c0b538f93026ce5e8d0bc4ae9f4fba25c | diff --git a/karma.conf.js b/karma.conf.js
index <HASH>..<HASH> 100644
--- a/karma.conf.js
+++ b/karma.conf.js
@@ -4,7 +4,7 @@ process.env.CHROME_BIN = require('puppeteer').executablePath();
module.exports = function (config) {
config.set({
- frameworks: ['jasmine'],
+ frameworks: ['jasmine', 'webpack'],
reporters: [
'spec',
'junit',
@@ -28,7 +28,7 @@ module.exports = function (config) {
module: {
rules: webpackConfig.module.rules,
},
- devtool: 'inline-source-map',
+ devtool: 'eval-cheap-source-map',
externals: {
angular: 'angular',
}, | Added webpack plugin to karma config | NYULibraries_primo-explore-clickable-logo-to-any-link | train | js |
314ec839f8f61c396d55bb4cd4ee01f2d2be5772 | diff --git a/modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/mail/EmailTestCase.java b/modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/mail/EmailTestCase.java
index <HASH>..<HASH> 100644
--- a/modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/mail/EmailTestCase.java
+++ b/modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/mail/EmailTestCase.java
@@ -37,9 +37,7 @@ public class EmailTestCase extends PluggableActivitiTestCase {
wiser.stop();
// Fix for slow Jenkins
- while (wiser.getServer().isRunning()) {
- Thread.sleep(100L);
- }
+ Thread.sleep(250L);
super.tearDown();
} | (trying) to fix qa build part 2 | Activiti_Activiti | train | java |
2f7875c8127253dbba7c5eadfbe123079f41881f | diff --git a/hazelcast/src/main/java/com/hazelcast/config/TcpIpConfig.java b/hazelcast/src/main/java/com/hazelcast/config/TcpIpConfig.java
index <HASH>..<HASH> 100644
--- a/hazelcast/src/main/java/com/hazelcast/config/TcpIpConfig.java
+++ b/hazelcast/src/main/java/com/hazelcast/config/TcpIpConfig.java
@@ -20,6 +20,9 @@ import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
+/**
+ * Contains the configuration for the tcp-ip join mechanism.
+ */
public class TcpIpConfig {
private int connectionTimeoutSeconds = 5;
@@ -30,11 +33,29 @@ public class TcpIpConfig {
private String requiredMember = null;
+ /**
+ * Adds a 'well known' member.
+ *
+ * Each HazelcastInstance will try to connect to at least one of the members to find all other members
+ * and create a cluster.
+ *
+ * @param member the member to add.
+ * @return the updated configuration.
+ * @see #getMembers()
+ */
public TcpIpConfig addMember(final String member) {
this.members.add(member);
return this;
}
+ /**
+ * Removes all members.
+ *
+ * Can safely be called when there are no members.
+ *
+ * @return the updated configuration.
+ * @see #addMember(String)
+ */
public TcpIpConfig clear() {
members.clear();
return this; | Improved Javadoc for TcpIpConfig | hazelcast_hazelcast | train | java |
cec7fd7dffef7cdfa53d8049f89a983c3ba70584 | diff --git a/src/View/Helper/BootstrapModalHelper.php b/src/View/Helper/BootstrapModalHelper.php
index <HASH>..<HASH> 100644
--- a/src/View/Helper/BootstrapModalHelper.php
+++ b/src/View/Helper/BootstrapModalHelper.php
@@ -42,6 +42,7 @@ class BootstrapModalHelper extends Helper {
* Extra options (useless if $title not specified) :
* - close: Add close buttons to header (default true)
* - no-body: Do not open the body after the create (default false)
+ * - size: Modal size (small, large or custom classes)
**/
public function create($title = null, $options = array()) {
@@ -72,7 +73,7 @@ class BootstrapModalHelper extends Helper {
$size = 'modal-sm';
break;
default:
- $size = '';
+ $size = $options['size'];
break;
}
unset($options['size']); | Improve ModalHelper::Create size flexibility
I use a custom 'modal-xl' class to make modals even larger than lg. For this to work, the modal helper needs to accepts a size class string it doesn't understand. I don't see an adverse effect in letting the user choose their own size class(es). | Holt59_cakephp3-bootstrap-helpers | train | php |
3cc457db266f5a20f3fa9c6e9ebeb9f4d03ed575 | diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php
index <HASH>..<HASH> 100644
--- a/lib/outputcomponents.php
+++ b/lib/outputcomponents.php
@@ -232,7 +232,9 @@ class labelled_html_component extends moodle_html_component {
$this->label = new html_label();
$this->label->for = $for;
if (empty($for)) {
- $this->generate_id();
+ if (empty($this->id)) {
+ $this->generate_id();
+ }
$this->label->for = $this->id;
}
$this->label->text = $text;
diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php
index <HASH>..<HASH> 100644
--- a/lib/outputrenderers.php
+++ b/lib/outputrenderers.php
@@ -1799,6 +1799,9 @@ class moodle_core_renderer extends moodle_renderer_base {
$field->prepare();
$this->prepare_event_handlers($field);
$output = $this->output_start_tag('span', array('class' => "textfield $field->name"));
+ if (!empty($field->label)) {
+ $output .= $this->label($field->label);
+ }
$output .= $this->output_empty_tag('input', array(
'type' => 'text',
'name' => $field->name, | MDL-<I> Fixed a number of small API issues in components and renderers | moodle_moodle | train | php,php |
d09be7b261bc5c0eb22fdb1aa7ad3bc4c6087114 | diff --git a/tools/interop_matrix/client_matrix.py b/tools/interop_matrix/client_matrix.py
index <HASH>..<HASH> 100644
--- a/tools/interop_matrix/client_matrix.py
+++ b/tools/interop_matrix/client_matrix.py
@@ -281,6 +281,7 @@ LANG_RELEASE_MATRIX = {
('v1.27.3', ReleaseInfo(runtimes=['python'])),
('v1.30.0', ReleaseInfo(runtimes=['python'])),
('v1.31.1', ReleaseInfo(runtimes=['python'])),
+ ('v1.32.0', ReleaseInfo(runtimes=['python'])),
]),
'node':
OrderedDict([
@@ -341,6 +342,7 @@ LANG_RELEASE_MATRIX = {
('v1.27.3', ReleaseInfo()),
('v1.30.0', ReleaseInfo()),
('v1.31.1', ReleaseInfo()),
+ ('v1.32.0', ReleaseInfo()),
]),
'php':
OrderedDict([
@@ -374,6 +376,7 @@ LANG_RELEASE_MATRIX = {
('v1.27.3', ReleaseInfo()),
('v1.30.0', ReleaseInfo()),
('v1.31.1', ReleaseInfo()),
+ ('v1.32.0', ReleaseInfo()),
]),
'csharp':
OrderedDict([
@@ -412,5 +415,6 @@ LANG_RELEASE_MATRIX = {
('v1.27.3', ReleaseInfo()),
('v1.30.0', ReleaseInfo()),
('v1.31.1', ReleaseInfo()),
+ ('v1.32.0', ReleaseInfo()),
]),
} | interop for <I> for python, ruby, php, csharp | grpc_grpc | train | py |
544a24557d91aca64d426e39114a7a3e70f66576 | diff --git a/pyqode/core/panels/search_and_replace.py b/pyqode/core/panels/search_and_replace.py
index <HASH>..<HASH> 100644
--- a/pyqode/core/panels/search_and_replace.py
+++ b/pyqode/core/panels/search_and_replace.py
@@ -599,6 +599,7 @@ class SearchAndReplacePanel(Panel, Ui_SearchPanel):
selection_end)
deco.set_background(QtGui.QBrush(self.background))
deco.set_outline(self._outline)
+ deco.set_foreground(QtCore.Qt.black)
deco.draw_order = 1
return deco | Fix unreadable search occurences if foreground color is white
Use black instead of using the previously set foreground color | pyQode_pyqode.core | train | py |
104aac0d6c65e2e8273c4395d169e2f7362dc127 | diff --git a/projects/constellate-dev-utils/modules/projects/createPublishPackageJson.js b/projects/constellate-dev-utils/modules/projects/createPublishPackageJson.js
index <HASH>..<HASH> 100644
--- a/projects/constellate-dev-utils/modules/projects/createPublishPackageJson.js
+++ b/projects/constellate-dev-utils/modules/projects/createPublishPackageJson.js
@@ -44,6 +44,18 @@ module.exports = function createPublishPackageJson(project, versions) {
),
sourcePkgJson.dependencies || {},
),
+ devDependencies: Object.assign(
+ {},
+ // Add devDependencies references to our constellate dependencies
+ project.devDependencies.reduce(
+ (acc, dependencyName) =>
+ Object.assign(acc, {
+ [allProjects[dependencyName].packageName]: `^${versions[dependencyName]}`,
+ }),
+ {},
+ ),
+ sourcePkgJson.devDependencies || {},
+ ),
},
) | Updates the publish process to take constellate dev dependencies into account. | constellators_constellate | train | js |
d164768a4bff2004464411528ed4d5fb610bba33 | diff --git a/lib/devise.rb b/lib/devise.rb
index <HASH>..<HASH> 100644
--- a/lib/devise.rb
+++ b/lib/devise.rb
@@ -4,7 +4,7 @@ module Devise
autoload :FailureApp, 'devise/failure_app'
ALL = [:authenticatable, :confirmable, :recoverable, :rememberable,
- :timeoutable, :trackable, :validatable].freeze
+ :timeoutable, :trackable, :validatable]
# Maps controller names to devise modules
CONTROLLERS = {
@@ -13,9 +13,9 @@ module Devise
:confirmations => :confirmable
}.freeze
- STRATEGIES = [:authenticatable].freeze
- SERIALIZERS = [:authenticatable, :rememberable].freeze
- TRUE_VALUES = [true, 1, '1', 't', 'T', 'true', 'TRUE'].freeze
+ STRATEGIES = [:authenticatable]
+ SERIALIZERS = [:authenticatable, :rememberable]
+ TRUE_VALUES = [true, 1, '1', 't', 'T', 'true', 'TRUE']
# Maps the messages types that are used in flash message. This array is not
# frozen, so you can add messages from your own strategies. | Do not freeze arrays, allowing other plugins to extend Devise | plataformatec_devise | train | rb |
cc9084c744b3ba3525f464adeaa7edaea64abf41 | diff --git a/torchtext/data/pipeline.py b/torchtext/data/pipeline.py
index <HASH>..<HASH> 100644
--- a/torchtext/data/pipeline.py
+++ b/torchtext/data/pipeline.py
@@ -18,7 +18,7 @@ class Pipeline(object):
def call(self, x, *args):
if isinstance(x, list):
- return [self(tok, *args) for tok in x]
+ return [self.convert_token(tok, *args) for tok in x]
return self.convert_token(x, *args)
def add_before(self, pipeline): | Fix bug in Pipeline call where we run the whole Pipeline on list input | pytorch_text | train | py |
d7eb1cfa332ac851257c7e365d5f6de90805e6e0 | diff --git a/blockstack_client/constants.py b/blockstack_client/constants.py
index <HASH>..<HASH> 100644
--- a/blockstack_client/constants.py
+++ b/blockstack_client/constants.py
@@ -30,6 +30,7 @@ import json
import tempfile
import subprocess
import fcntl
+import blockstack
import virtualchain
from .version import __version__, __version_major__, __version_minor__, __version_patch__
@@ -294,10 +295,10 @@ BLOCKSTACK_BURN_ADDRESS = virtualchain.hex_hash160_to_address(BLOCKSTACK_BURN_PU
# never changes, so safe to duplicate to avoid gratuitous imports
MAXIMUM_NAMES_PER_ADDRESS = 25
-RPC_MAX_ZONEFILE_LEN = 4096 # 4KB
+RPC_MAX_ZONEFILE_LEN = blockstack.lib.config.RPC_MAX_ZONEFILE_LEN
RPC_MAX_PROFILE_LEN = 1024000 # 1MB
-MAX_RPC_LEN = RPC_MAX_ZONEFILE_LEN * 110 # maximum blockstackd RPC length--100 zonefiles with overhead
+MAX_RPC_LEN = blockstack.lib.config.MAX_RPC_LEN
if os.environ.get("BLOCKSTACK_TEST_MAX_RPC_LEN"):
MAX_RPC_LEN = int(os.environ.get("BLOCKSTACK_TEST_MAX_RPC_LEN"))
print("Overriding MAX_RPC_LEN to {}".format(MAX_RPC_LEN)) | get RPC size constants from blockstack | blockstack_blockstack-core | train | py |
66ea35f671a381bb9572c3483289cc3f767d9c7b | diff --git a/test/Parser/ParserTest.php b/test/Parser/ParserTest.php
index <HASH>..<HASH> 100644
--- a/test/Parser/ParserTest.php
+++ b/test/Parser/ParserTest.php
@@ -49,4 +49,13 @@ class ParserTest extends TestCase
$this->assertSame(13, $this->parser->parse([Grammar::T_X, Grammar::T_I, Grammar::T_I, Grammar::T_I]));
$this->assertSame(111, $this->parser->parse([Grammar::T_C, Grammar::T_X, Grammar::T_I]));
}
+
+ /**
+ * Test Parse with Lookahead Tokens
+ */
+ public function testParseWithLookaheadTokens()
+ {
+ $this->assertSame(9, $this->parser->parse([Grammar::T_IX]));
+ $this->assertSame(99, $this->parser->parse([Grammar::T_XC, Grammar::T_IX]));
+ }
} | Include test for parse lookahead tokens | wandersonwhcr_romans | train | php |
ca41e4f0d3ff0115efb6c803d9f1cc04b6f21778 | diff --git a/ServiceProvider.php b/ServiceProvider.php
index <HASH>..<HASH> 100755
--- a/ServiceProvider.php
+++ b/ServiceProvider.php
@@ -7,6 +7,7 @@ use Illuminate\Contracts\Foundation\CachesConfiguration;
use Illuminate\Contracts\Foundation\CachesRoutes;
use Illuminate\Contracts\Support\DeferrableProvider;
use Illuminate\Database\Eloquent\Factory as ModelFactory;
+use Illuminate\View\Compilers\BladeCompiler;
abstract class ServiceProvider
{
@@ -105,6 +106,22 @@ abstract class ServiceProvider
}
/**
+ * Register the given view components with a custom prefix.
+ *
+ * @param string $prefix
+ * @param array $components
+ * @return void
+ */
+ protected function loadViewComponentsAs($prefix, array $components)
+ {
+ $this->callAfterResolving(BladeCompiler::class, function ($blade) use ($prefix, $components) {
+ foreach ($components as $component) {
+ $blade->component($component, $prefix.'-'.Str::snake(class_basename($component), '-'));
+ }
+ });
+ }
+
+ /**
* Register a translation file namespace.
*
* @param string $path | [7.x] Allow easier component prefixing (#<I>)
* Allow easier component prefixing
* Update ServiceProvider.php | illuminate_support | train | php |
53551ade87054e44c55c62609e998e03cabc95cc | diff --git a/mode/groovy/groovy.js b/mode/groovy/groovy.js
index <HASH>..<HASH> 100644
--- a/mode/groovy/groovy.js
+++ b/mode/groovy/groovy.js
@@ -25,7 +25,7 @@ CodeMirror.defineMode("groovy", function(config, parserConfig) {
}
if (/\d/.test(ch)) {
stream.eatWhile(/[\w\.]/);
- if (stream.eat(/eE/)) { stream.eat(/+\-/); stream.eatWhile(/\d/); }
+ if (stream.eat(/eE/)) { stream.eat(/\+\-/); stream.eatWhile(/\d/); }
return "number";
}
if (ch == "/") { | [groovy mode] Fix Regexp that FF doesn't accept
Closes #<I> | codemirror_CodeMirror | train | js |
ac9ccdec7224ee7f7bbd2700a33357baaef6a4c0 | diff --git a/hcn/hcnerrors.go b/hcn/hcnerrors.go
index <HASH>..<HASH> 100644
--- a/hcn/hcnerrors.go
+++ b/hcn/hcnerrors.go
@@ -7,6 +7,7 @@ import (
"github.com/Microsoft/hcsshim/internal/hcserror"
"github.com/Microsoft/hcsshim/internal/interop"
+ "github.com/sirupsen/logrus"
)
func checkForErrors(methodName string, hr error, resultBuffer *uint16) error {
@@ -25,7 +26,9 @@ func checkForErrors(methodName string, hr error, resultBuffer *uint16) error {
}
if errorFound {
- return hcserror.New(hr, methodName, result)
+ returnError := hcserror.New(hr, methodName, result)
+ logrus.Debugf(returnError.Error()) // HCN errors logged for debugging.
+ return returnError
}
return nil | All HNS errors are debug logged. | Microsoft_hcsshim | train | go |
f616b25693289ed9c2dbfdb298c635dce79c03ce | diff --git a/src/core/services/interimElement/interimElement.js b/src/core/services/interimElement/interimElement.js
index <HASH>..<HASH> 100644
--- a/src/core/services/interimElement/interimElement.js
+++ b/src/core/services/interimElement/interimElement.js
@@ -358,10 +358,14 @@ function InterimElementProvider() {
}
// Hide the latest showing interim element.
- return closeElement(showingInterims[showingInterims.length - 1]);
+ return closeElement(showingInterims.pop());
function closeElement(interim) {
+ if (!interim) {
+ return $q.when(reason);
+ }
+
var hideAction = interim
.remove(reason, false, options || { })
.catch(function(reason) { return reason; })
@@ -369,7 +373,6 @@ function InterimElementProvider() {
hidePromises.splice(hidePromises.indexOf(hideAction), 1);
});
- showingInterims.splice(showingInterims.indexOf(interim), 1);
hidePromises.push(hideAction);
return interim.deferred.promise; | fix(toast): remove the interim element from the list before closing element (#<I>) | angular_material | train | js |
31596ff3befa3de2d6e4b05fef9f06fd9a9d4700 | diff --git a/app/inputs/custom_inputs/surround_input.rb b/app/inputs/custom_inputs/surround_input.rb
index <HASH>..<HASH> 100644
--- a/app/inputs/custom_inputs/surround_input.rb
+++ b/app/inputs/custom_inputs/surround_input.rb
@@ -3,8 +3,7 @@ module CustomInputs
include UiBibz::Ui::Core
def input(wrapper_options)
- options = options || {}
- options = options.merge({ builder: @builder })
+ options = @options.merge({ builder: @builder })
UiBibz::Ui::Core::SurroundField.new(attribute_name, options, input_html_options).render
end | fix surround_input for simple_form | thooams_Ui-Bibz | train | rb |
c83393c2bb1ffccd6d6d62cad0c85e6eedc33776 | diff --git a/lib/rake/extensiontask.rb b/lib/rake/extensiontask.rb
index <HASH>..<HASH> 100755
--- a/lib/rake/extensiontask.rb
+++ b/lib/rake/extensiontask.rb
@@ -482,6 +482,11 @@ Java extension should be preferred.
def fake_rb(platform, version)
<<-FAKE_RB
+ # Pre-load resolver library before faking, in order to avoid error
+ # "cannot load such file -- win32/resolv" when it is required later on.
+ # See also: https://github.com/tjschuck/rake-compiler-dev-box/issues/5
+ require 'resolv'
+
class Object
remove_const :RUBY_PLATFORM
remove_const :RUBY_VERSION | Pre-load resolver library before faking, in order to avoid error
"cannot load such file -- win<I>/resolv" when it is required later on.
This solves issue <URL> | rake-compiler_rake-compiler | train | rb |
0211b553dc81b4192550a431d7cded2ab5c96995 | diff --git a/src/Zip.php b/src/Zip.php
index <HASH>..<HASH> 100644
--- a/src/Zip.php
+++ b/src/Zip.php
@@ -270,8 +270,8 @@ class Zip implements ExtractableInterface
*
* @return boolean True on success
*
- * @since 1.0
* @throws \RuntimeException
+ * @since 1.0
*/
protected function extractNative($archive, $destination)
{
@@ -285,7 +285,7 @@ class Zip implements ExtractableInterface
// Make sure the destination folder exists
if (!Folder::create($destination))
{
- throw new \RuntimeException('Unable to create destination folder ' . \dirname($path));
+ throw new \RuntimeException('Unable to create destination folder ' . \dirname($destination));
}
// Read files in the archive
@@ -298,16 +298,13 @@ class Zip implements ExtractableInterface
continue;
}
- $stream = $zip->getStream($file);
+ $buffer = $zip->getFromIndex($index);
- if ($stream === false)
+ if ($buffer === false)
{
throw new \RuntimeException('Unable to read ZIP entry');
}
- $buffer = stream_get_contents($stream);
- fclose($stream);
-
if (File::write($destination . '/' . $file, $buffer) === false)
{
throw new \RuntimeException('Unable to write ZIP entry to file ' . $destination . '/' . $file); | Tweaked unzipping for performance. | joomla-framework_archive | train | php |
76ee79c11a3514d8c3b0035b9771dc5d0c516a3d | diff --git a/src/Behat/Mink/Compiler/PearCompiler.php b/src/Behat/Mink/Compiler/PearCompiler.php
index <HASH>..<HASH> 100644
--- a/src/Behat/Mink/Compiler/PearCompiler.php
+++ b/src/Behat/Mink/Compiler/PearCompiler.php
@@ -51,6 +51,7 @@ class PearCompiler
->ignoreVCS(true)
->name('*.php')
->name('*.xliff')
+ ->name('*.xml')
->name('*.feature')
->name('LICENSE')
->notName('PharCompiler.php')
diff --git a/src/Behat/Mink/Compiler/PharCompiler.php b/src/Behat/Mink/Compiler/PharCompiler.php
index <HASH>..<HASH> 100644
--- a/src/Behat/Mink/Compiler/PharCompiler.php
+++ b/src/Behat/Mink/Compiler/PharCompiler.php
@@ -54,6 +54,7 @@ class PharCompiler
$finder->files()
->ignoreVCS(true)
->name('*.php')
+ ->name('*.xml')
->name('*.xliff')
->name('LICENSE')
->notName('PharCompiler.php') | added xml to packages compilers | minkphp_Mink | train | php,php |
a9d542d722c4f2945385c8f9ad5a71eaa098ed5e | diff --git a/src/utils/color.js b/src/utils/color.js
index <HASH>..<HASH> 100644
--- a/src/utils/color.js
+++ b/src/utils/color.js
@@ -241,8 +241,15 @@
return this;
},
- clone: function() {
- return me.pool.pull("me.Color", this.r, this.g, this.b, this.a);
+ /**
+ * Create a new copy of this color object.
+ * @name clone
+ * @memberOf me.Color
+ * @function
+ * @return {me.Color} Reference to the newly cloned object
+ */
+ clone : function () {
+ return me.pool.pull("me.Color", this.r, this.g, this.b, this.alpha);
},
/** | Add documentation for me.Color.clone and fix a bug with alpha | melonjs_melonJS | train | js |
60c067ceb82d70188795939328538c7a13e84ffc | diff --git a/src/ServiceManager.php b/src/ServiceManager.php
index <HASH>..<HASH> 100644
--- a/src/ServiceManager.php
+++ b/src/ServiceManager.php
@@ -617,6 +617,11 @@ class ServiceManager implements ServiceLocatorInterface
));
}
+ // Do not call initializers if we do not have an instance
+ if ($instance === null) {
+ return $instance;
+ }
+
foreach ($this->initializers as $initializer) {
if ($initializer instanceof InitializerInterface) {
$initializer->initialize($instance, $this); | [zendframework/zf2#<I>] review
- do not call initializers if we have a null value | mxc-commons_mxc-servicemanager | train | php |
049a7865140d2280247cac90c6ca32bca3c796d3 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,12 +1,9 @@
from setuptools import setup
-import seacucumber
DESCRIPTION = "A Django email backend for Amazon Simple Email Service, backed by celery."
LONG_DESCRIPTION = open('README.rst').read()
-version_str = '%d.%d' % (seacucumber.VERSION[0], seacucumber.VERSION[1])
-
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
@@ -19,7 +16,7 @@ CLASSIFIERS = [
setup(
name='seacucumber',
- version=version_str,
+ version='1.5',
packages=[
'seacucumber',
'seacucumber.management',
@@ -33,5 +30,5 @@ setup(
long_description=LONG_DESCRIPTION,
platforms=['any'],
classifiers=CLASSIFIERS,
- install_requires=['boto>=2.2.1'],
+ install_requires=['boto>=2.3.0'],
) | Bumping minimum supported boto version to <I> so we can make use of the more fine-grained SES exceptions. | duointeractive_sea-cucumber | train | py |
20359166312f9acaf451708e0205bb08e0d0d85f | diff --git a/lib/perforated/compatibility/fetch_multi.rb b/lib/perforated/compatibility/fetch_multi.rb
index <HASH>..<HASH> 100644
--- a/lib/perforated/compatibility/fetch_multi.rb
+++ b/lib/perforated/compatibility/fetch_multi.rb
@@ -24,8 +24,12 @@ module Perforated
end
def self.supports_fetch_multi?
- Perforated.cache.respond_to?(:fetch_multi) &&
- !Perforated.cache.instance_of?(ActiveSupport::Cache::MemoryStore)
+ cache = Perforated.cache
+
+ cache.respond_to?(:fetch_multi) && !(
+ cache.instance_of?(ActiveSupport::Cache::MemoryStore) ||
+ cache.instance_of?(ActiveSupport::Cache::NullStore)
+ )
end
end
end | Use custom implementation of fetch_multi for ActiveSupport NullStore | sorentwo_perforated | train | rb |
0790f427591d3af2e027a1b818a42026007071fb | diff --git a/ui/plugins/controller.js b/ui/plugins/controller.js
index <HASH>..<HASH> 100644
--- a/ui/plugins/controller.js
+++ b/ui/plugins/controller.js
@@ -270,7 +270,7 @@ treeherder.controller('PluginCtrl', [
return thBuildApi.retriggerJob($scope.repoName, requestId);
}
}).then(function() {
- thNotify.send("Retriggered job (" + $scope.job.job_type_symbol + ")",
+ thNotify.send("Retriggered job: " + $scope.jobSearchStr,
'success');
}).catch(function(e) {
// Generic error eg. the user doesn't have LDAP access | Bug <I> - Display full Job name in retrigger notification | mozilla_treeherder | train | js |
23ac8247a9078c2ae5eecc16392cd748c8d15aed | diff --git a/xmlenc/decrypt_test.go b/xmlenc/decrypt_test.go
index <HASH>..<HASH> 100644
--- a/xmlenc/decrypt_test.go
+++ b/xmlenc/decrypt_test.go
@@ -57,8 +57,7 @@ func TestCanDecrypt(t *testing.T) {
assert.Equal(t, expectedPlaintext, string(buf))
}
-// TODO(ross): remove 'Failing' from the function name when PR #80 lands
-func FailingTestCanDecryptWithoutCertificate(t *testing.T) {
+func TestCanDecryptWithoutCertificate(t *testing.T) {
doc := etree.NewDocument()
err := doc.ReadFromString(input)
assert.NoError(t, err) | Remove 'Failing' from certificate missing check | crewjam_saml | train | go |
238a2259dd25ef4a8d0e07fd75e14e916b7eb7f0 | diff --git a/src/split.js b/src/split.js
index <HASH>..<HASH> 100644
--- a/src/split.js
+++ b/src/split.js
@@ -52,7 +52,7 @@ export class Group {
* @private
* @param {Tape} tape - The input tape.
* @param {Iterable} sep - An iterable of separators.
- * @returns {AsyncIterable} An iterable of tapes.
+ * @returns {AsyncIterableIterator} An iterable of tapes.
*/
export function _split(tape, sep) {
return new Split(tape, sep); | :books: docs(split): Correct ReturnType for _split. | aureooms_js-tape | train | js |
2eafa6066806d99084bc2d76e3081900d6b527e3 | diff --git a/src/main/java/org/couchbase/mock/control/handlers/OpfailCommandHandler.java b/src/main/java/org/couchbase/mock/control/handlers/OpfailCommandHandler.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/couchbase/mock/control/handlers/OpfailCommandHandler.java
+++ b/src/main/java/org/couchbase/mock/control/handlers/OpfailCommandHandler.java
@@ -49,7 +49,7 @@ public class OpfailCommandHandler extends MockCommand {
}
int count = payload.get("count").getAsInt();
- int iCode = payload.get("code").getAsInt();
+ short iCode = payload.get("code").getAsShort();
for (ErrorCode rc : ErrorCode.values()) {
if (iCode == rc.value()) { | Cast opfail error code to short
Java's short is signed, while we're likely receiving an unsigned
variant. Error codes themselves in the mock are shorts (again, signed)
Change-Id: Iff<I>a<I>d2fc4a<I>b<I>ee6e<I>df<I>c7ba<I>f6
Reviewed-on: <URL> | couchbase_CouchbaseMock | train | java |
4673bd05fc68f087cd4cc990c88a31ca36e63c9d | diff --git a/test/utils/db-utils.js b/test/utils/db-utils.js
index <HASH>..<HASH> 100644
--- a/test/utils/db-utils.js
+++ b/test/utils/db-utils.js
@@ -26,6 +26,7 @@ module.exports.reset = async () => {
const dbExists = await fs.pathExists(filenameOrig);
if (dbExists) {
+ await db.knex.destroy();
await fs.copyFile(filenameOrig, filename);
} else {
await knexMigrator.reset({force: true}); | Destroyed connection before restoring DB file
no issue
- we've seen some instances of SQLite saying "database disk image is malformed"
- I think this happens because we copy the file whilst we are still connected to
the old DB
- this commit destroys the connection before copying the clean file to the live
DB file | TryGhost_Ghost | train | js |
fdc011efa64a092bd4a11048406106a8d75e8ea7 | diff --git a/components/table/header.js b/components/table/header.js
index <HASH>..<HASH> 100644
--- a/components/table/header.js
+++ b/components/table/header.js
@@ -79,11 +79,6 @@ export default class Header extends PureComponent {
columns.map((column, index) => {
const columnStyle = widths[index + 1] ? {width: widths[index + 1]} : null;
const props = {key: index, column, onSort, sortKey, sortOrder, style: columnStyle};
- if (caption) {
- if (selectable && index === 0) {
- props.colSpan = 2;
- }
- }
headerCells.push(<HeaderCell {...props}/>);
}); | RG-<I> Drop colSpan hacking because now we always have meta column
Former-commit-id: <I>d<I>a<I>b<I>ed7eaa9ec<I>e<I>b8 | JetBrains_ring-ui | train | js |
e87cc9ac1ee10746bee161b911b3ad483f6f7b1a | diff --git a/elasticsearch-api/test/integration/yaml_test_runner.rb b/elasticsearch-api/test/integration/yaml_test_runner.rb
index <HASH>..<HASH> 100644
--- a/elasticsearch-api/test/integration/yaml_test_runner.rb
+++ b/elasticsearch-api/test/integration/yaml_test_runner.rb
@@ -223,6 +223,9 @@ module Elasticsearch
# Skip version
if skip && skip['skip']['version']
+
+ return skip['skip']['reason'] ? skip['skip']['reason'] : true if skip['skip']['version'] == 'all'
+
min, max = skip['skip']['version'].split('-').map(&:strip)
min_normalized = sprintf "%03d-%03d-%03d", | [API] Added support for the `all` value for `skip` in the YAML integration tests
Related: elasticsearch#<I> | elastic_elasticsearch-ruby | train | rb |
b1014d71d5fa48c3d2c3794d713a34b699db2ac7 | diff --git a/ng-swagger-gen.js b/ng-swagger-gen.js
index <HASH>..<HASH> 100644
--- a/ng-swagger-gen.js
+++ b/ng-swagger-gen.js
@@ -846,7 +846,7 @@ function operationId(given, method, url, allKnown) {
if (generate) {
id = toIdentifier(method + url);
} else {
- id = given;
+ id = toIdentifier(given);
}
var duplicated = allKnown.has(id);
if (duplicated) { | Support invalid characters in operationId
Fixes #<I> | cyclosproject_ng-swagger-gen | train | js |
bb27801826f7e86e19dbd302b339f948e4b9c21b | diff --git a/src/plugins/ProgressBar.js b/src/plugins/ProgressBar.js
index <HASH>..<HASH> 100644
--- a/src/plugins/ProgressBar.js
+++ b/src/plugins/ProgressBar.js
@@ -14,7 +14,8 @@ export default class ProgressBar extends Plugin {
// set default options
const defaultOptions = {
- replaceTargetContent: false
+ replaceTargetContent: false,
+ fixed: false
}
// merge default options with the ones set by user | ProgressBar should not be fixed by default | transloadit_uppy | train | js |
e49558dbb217c3f82f7040f4b30d1a9573552c02 | diff --git a/python/dllib/src/bigdl/dllib/keras/engine/topology.py b/python/dllib/src/bigdl/dllib/keras/engine/topology.py
index <HASH>..<HASH> 100644
--- a/python/dllib/src/bigdl/dllib/keras/engine/topology.py
+++ b/python/dllib/src/bigdl/dllib/keras/engine/topology.py
@@ -37,7 +37,9 @@ class KerasNet(ZooKerasLayer):
loss: Criterion to be used. One can alternatively pass in the corresponding string
representation, such as 'mse'.
metrics: List of validation methods to be used. Default is None if no validation is needed.
- One can alternatively use ['accuracy'].
+ For convenience, string representations are supported: 'accuracy' (or 'acc'),
+ 'top5accuracy' (or 'top5acc'), 'mae', 'auc', 'treennaccuracy' and 'loss'.
+ For example, you can either use [Accuracy()] or ['accuracy'].
"""
if isinstance(optimizer, six.string_types):
optimizer = to_bigdl_optim_method(optimizer) | Update doc for metrics in compile (#<I>)
* update compile metrics doc
* update | intel-analytics_BigDL | train | py |
c83a2c597399f610533a549bc0708c4cf0066a59 | diff --git a/config/environment.rb b/config/environment.rb
index <HASH>..<HASH> 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -11,10 +11,10 @@ Rails::Initializer.run do |config|
:lib => 'clearance',
:source => 'http://gems.github.com',
:version => '0.7.0'
- config.gem "thoughtbot-pacecar",
+ config.gem "ddollar-pacecar",
:lib => 'pacecar',
:source => 'http://gems.github.com',
- :version => '1.1.5'
+ :version => '1.1.6'
config.gem 'mislav-will_paginate',
:version => '~> 2.3.11',
:lib => 'will_paginate', | switch to ddollar-pacecar until the like changes are merged into upstream | rubygems_rubygems.org | train | rb |
9f138098f24b0192a6d9bfb723d0dfe198df68d5 | diff --git a/demos/rpg/game.js b/demos/rpg/game.js
index <HASH>..<HASH> 100644
--- a/demos/rpg/game.js
+++ b/demos/rpg/game.js
@@ -86,19 +86,19 @@ window.onload = function() {
function (direction) {
if (direction.x < 0) {
if (!this.isPlaying("walk_left"))
- this.pauseAnimation().playAnimation("walk_left", 10, -1);
+ this.pauseAnimation().playAnimation("walk_left", 20, -1);
}
if (direction.x > 0) {
if (!this.isPlaying("walk_right"))
- this.pauseAnimation().playAnimation("walk_right", 10, -1);
+ this.pauseAnimation().playAnimation("walk_right", 20, -1);
}
if (direction.y < 0) {
if (!this.isPlaying("walk_up"))
- this.pauseAnimation().playAnimation("walk_up", 10, -1);
+ this.pauseAnimation().playAnimation("walk_up", 20, -1);
}
if (direction.y > 0) {
if (!this.isPlaying("walk_down"))
- this.pauseAnimation().playAnimation("walk_down", 10, -1);
+ this.pauseAnimation().playAnimation("walk_down", 20, -1);
}
if(!direction.x && !direction.y) {
this.pauseAnimation(); | Slowed down the RPG demo's walking animation | craftyjs_Crafty | train | js |
37375383e80bee6f400042c502d8e67c833de042 | diff --git a/wordfreq_builder/wordfreq_builder/word_counts.py b/wordfreq_builder/wordfreq_builder/word_counts.py
index <HASH>..<HASH> 100644
--- a/wordfreq_builder/wordfreq_builder/word_counts.py
+++ b/wordfreq_builder/wordfreq_builder/word_counts.py
@@ -12,9 +12,11 @@ def count_tokens(filename):
"""
Count tokens that appear in a file, running each line through our
simple tokenizer.
+
+ Unicode errors in the input data will become token boundaries.
"""
counts = defaultdict(int)
- with open(filename, encoding='utf-8') as infile:
+ with open(filename, encoding='utf-8', errors='replace') as infile:
for line in infile:
for token in simple_tokenize(line.strip()):
counts[token] += 1 | cope with occasional Unicode errors in the input | LuminosoInsight_wordfreq | train | py |
e42a95be8e233684eb372e0e630dc7ce634ea8f0 | diff --git a/tensorboard/plugins/profile/__init__.py b/tensorboard/plugins/profile/__init__.py
index <HASH>..<HASH> 100644
--- a/tensorboard/plugins/profile/__init__.py
+++ b/tensorboard/plugins/profile/__init__.py
@@ -0,0 +1,13 @@
+# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License. | Add copyright header to profile plugin init file (#<I>) | tensorflow_tensorboard | train | py |
4eb4974909d4af4cf55f49553585a2722101654d | diff --git a/src/app/components/timeSeries.js b/src/app/components/timeSeries.js
index <HASH>..<HASH> 100644
--- a/src/app/components/timeSeries.js
+++ b/src/app/components/timeSeries.js
@@ -112,6 +112,9 @@ function (_, kbn) {
if (result.length) {
this.stats.avg = (this.stats.total / result.length);
this.stats.current = result[result.length-1][1];
+ if (this.stats.current === null && result.length > 1) {
+ this.stats.current = result[result.length-2][1];
+ }
}
return result;
diff --git a/src/test/specs/timeSeries-specs.js b/src/test/specs/timeSeries-specs.js
index <HASH>..<HASH> 100644
--- a/src/test/specs/timeSeries-specs.js
+++ b/src/test/specs/timeSeries-specs.js
@@ -26,6 +26,15 @@ define([
expect(points.length).to.be(4);
expect(points[1][1]).to.be(0);
});
+
+ it('if last is null current should pick next to last', function() {
+ series = new TimeSeries({
+ datapoints: [[10,1], [null, 2]]
+ });
+ series.getFlotPairs('null', yAxisFormats);
+ expect(series.stats.current).to.be(10);
+ });
+
});
describe('series overrides', function() { | Graph: change to current legend value handling, if last value is null, current will pick next to last value, Closes #<I> | grafana_grafana | train | js,js |
66c9f10b008177070714e230f0c824ec60995cbe | diff --git a/styledocco.js b/styledocco.js
index <HASH>..<HASH> 100644
--- a/styledocco.js
+++ b/styledocco.js
@@ -138,7 +138,7 @@ var makeSections = exports.makeSections = function(blocks) {
.map(function(section) {
// Run through marked parser to generate HTML.
return {
- title: section.title,
+ title: section.title ? section.title.trim() : '',
docs: trimNewLines(marked.parser(section.docs)),
code: trimNewLines(section.code)
}; | Trim section titles for better url slugs | jacobrask_styledocco | train | js |
e708d7b56dab3060182ac78b494a70e41a8d0c8f | diff --git a/NavigationReactMobile/sample/medley/createStateNavigator.js b/NavigationReactMobile/sample/medley/createStateNavigator.js
index <HASH>..<HASH> 100644
--- a/NavigationReactMobile/sample/medley/createStateNavigator.js
+++ b/NavigationReactMobile/sample/medley/createStateNavigator.js
@@ -13,10 +13,8 @@ export default () => {
var {state} = stateNavigator.parseLink(url);
var fluentNavigator = stateNavigator.fluent();
var stateKeys = ['sceneNorth', 'sceneEast', 'sceneSouth', 'sceneWest'];
- for(var i = 0; i < stateKeys.length; i++){
- if (stateKeys[i] !== state.key)
- fluentNavigator = fluentNavigator.navigate(stateKeys[i]);
- }
+ for(var i = 0; i < stateKeys.length && stateKeys[i] !== state.key; i++)
+ fluentNavigator = fluentNavigator.navigate(stateKeys[i]);
return fluentNavigator.navigate(state.key).url;
})); | Moved fluent check out of if so loop stops | grahammendick_navigation | train | js |
15b0218bf22789bb0cf741bca50c345fb371c1e4 | diff --git a/libagent/gpg/__init__.py b/libagent/gpg/__init__.py
index <HASH>..<HASH> 100644
--- a/libagent/gpg/__init__.py
+++ b/libagent/gpg/__init__.py
@@ -296,7 +296,7 @@ def main(device_type):
help='initialize hardware-based GnuPG identity')
p.add_argument('user_id')
p.add_argument('-e', '--ecdsa-curve', default='nist256p1')
- p.add_argument('-t', '--time', type=int, default=int(time.time()))
+ p.add_argument('-t', '--time', type=int, default=0)
p.add_argument('-v', '--verbose', default=0, action='count')
p.add_argument('-s', '--subkey', default=False, action='store_true') | Default GPG key creation time to 0 (i.e. Jan 1 <I>) | romanz_trezor-agent | train | py |
45c2a4b6419957f40d68a432ed18fb9eadad7f11 | diff --git a/spec/integration/ssh_spec.rb b/spec/integration/ssh_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/integration/ssh_spec.rb
+++ b/spec/integration/ssh_spec.rb
@@ -207,7 +207,7 @@ describe Gas::Ssh do
# Code to prepare the github environment for testing
@sample_rsa = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDn74QR9yHb+hcid8iH3+FTaEwnKtwjttseJDbIA2PaivN2uvESrvHlp8Ss/cRox3fFu34QR5DpdOhlfULjTX7yKVuxhaNrAJaqg8rX8hgr9U1Botnyy1DBueEyyA3o1fxRkmwTf6FNnkt1BxWP635tD0lbmUubwaadXjQqPOf3Uw=="
-
+ Gas.delete(@nickname)
Gas::Ssh.stub!(:get_username_and_password_and_authenticate).and_return(@credentials)
#Gas::GithubSpeaker.stub!(:get_username_and_password_and_authenticate).and_return({:account_name => @username, :password => @password})
#Gas::Ssh::GithubSpeaker.stub!(:get_username_and_password_and_authenticate).and_return({:account_name => @username, :password => @password}) | actually caught a bug in a test where the mysterious account needed to be deleted in a before :all block... also got another test working with vcr tapes | walle_gas | train | rb |
55393782012fbd4b9251aefe282661c42b342946 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -23,6 +23,19 @@ import io
import sys
from setuptools import setup
+from setuptools.command.test import test
+
+class PytestTest(test):
+ def finalize_options(self):
+ test.finalize_options(self)
+ self.test_args = ['tests/', ]
+ self.test_suite = True
+
+ def run_tests(self):
+ from sys import exit
+ from pytest import main
+ exit(main(self.test_args))
+
# Hack to import _version file without importing upoints/__init__.py, its
# purpose is to allow import without requiring dependencies at this point.
@@ -100,4 +113,6 @@ setup(
obsoletes=['earth_distance'],
install_requires=install_requires,
tests_require=['pytest', 'pytest-cov'],
+ tests_require=['pytest', ],
+ cmdclass={'test': PytestTest},
) | Support running pytest from setup.py | JNRowe_upoints | train | py |
b48f6bb438a193174df569beef24d193d5cd954c | diff --git a/src/service/translate.js b/src/service/translate.js
index <HASH>..<HASH> 100644
--- a/src/service/translate.js
+++ b/src/service/translate.js
@@ -1389,7 +1389,7 @@ angular.module('pascalprecht.translate').provider('$translate', ['$STORAGE_KEY',
// if there isn't a translation table for the language we've requested,
// we load it asynchronously
- if (!$translationTable[key] && $loaderFactory) {
+ if (!$translationTable[key] && $loaderFactory && !langPromises[key]) {
$nextLang = key;
langPromises[key] = loadAsync(key).then(function (translation) {
translations(translation.key, translation.table); | fix(translateService): prevent multiple XHR calls | angular-translate_angular-translate | train | js |
c7505c7be66589934c828ba58dbba3f9a03acbe0 | diff --git a/driver/crate/crate.go b/driver/crate/crate.go
index <HASH>..<HASH> 100644
--- a/driver/crate/crate.go
+++ b/driver/crate/crate.go
@@ -23,6 +23,7 @@ type Driver struct {
const tableName = "schema_migrations"
func (driver *Driver) Initialize(url string) error {
+ url = strings.Replace(url, "crate", "http", 1)
db, err := sql.Open("crate", url)
if err != nil {
return err
diff --git a/driver/crate/crate_test.go b/driver/crate/crate_test.go
index <HASH>..<HASH> 100644
--- a/driver/crate/crate_test.go
+++ b/driver/crate/crate_test.go
@@ -14,7 +14,7 @@ func TestMigrate(t *testing.T) {
host := os.Getenv("CRATE_PORT_4200_TCP_ADDR")
port := os.Getenv("CRATE_PORT_4200_TCP_PORT")
- url := fmt.Sprintf("http://%s:%s", host, port)
+ url := fmt.Sprintf("crate://%s:%s", host, port)
driver := &Driver{} | Crate driver was using wrong url scheme. The migrate CLI never had a chance to select the correct driver | gemnasium_migrate | train | go,go |
acb9cffe9a7a75f0e9f6ae4186544ab78e385047 | diff --git a/spec/graphql/schema/build_from_definition_spec.rb b/spec/graphql/schema/build_from_definition_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/graphql/schema/build_from_definition_spec.rb
+++ b/spec/graphql/schema/build_from_definition_spec.rb
@@ -233,6 +233,17 @@ union U = Hello
assert_equal 63, built_schema.types["U"].ast_node.definition_line
end
+ it 'supports descriptions and definition_line' do
+ schema = <<-SCHEMA
+"""
+"""
+type Query {
+ f1: Int
+}
+ SCHEMA
+ refute_nil GraphQL::Schema.from_definition(schema)
+ end
+
it 'maintains built-in directives' do
schema = <<-SCHEMA
schema { | test(BuildFromDefinition): added test to confirm changes to handle frozen strings in Lexer | rmosolgo_graphql-ruby | train | rb |
44af6d58168d68f2104936e2b6955888a5ca50a6 | diff --git a/framework/gii/GiiModule.php b/framework/gii/GiiModule.php
index <HASH>..<HASH> 100644
--- a/framework/gii/GiiModule.php
+++ b/framework/gii/GiiModule.php
@@ -107,7 +107,7 @@ class GiiModule extends CWebModule
'user'=>array(
'class'=>'CWebUser',
'stateKeyPrefix'=>'gii',
- 'loginUrl'=>array('gii/default/login'),
+ 'loginUrl'=>Yii::app()->createUrl('gii/default/login'),
),
));
$this->generatorPaths[]='gii.generators'; | (Fixes issue <I>) | yiisoft_yii | train | php |
0647bb660bce2f0116923194833fde9a747e286e | diff --git a/thjs.js b/thjs.js
index <HASH>..<HASH> 100644
--- a/thjs.js
+++ b/thjs.js
@@ -1061,7 +1061,7 @@ function raw(type, arg, callback)
packet.js.c = chan.id;
packet.from = hn;
debug("CLOSING",chan.type,JSON.stringify(packet.js));
- hn.send(packet);
+ if(chan.recvAt) hn.send(packet); // only error if we've ever gotten something
chan.callback(packet.js.err, packet, chan, function(){});
}
}
@@ -1145,7 +1145,7 @@ function channel(type, arg, callback)
chan.err = function(err){
if(chan.errored) return;
chan.errored = {js:{err:err,c:chan.id}};
- hn.send(chan.errored);
+ if(chan.recvAt) hn.send(chan.errored);
chan.done();
}; | only send errors if we've received something | telehash_e3x-js | train | js |
6fe405f056ebe8b9aeb433ed21757b47317372b2 | diff --git a/src/AssetLibraryServiceProvider.php b/src/AssetLibraryServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/AssetLibraryServiceProvider.php
+++ b/src/AssetLibraryServiceProvider.php
@@ -24,7 +24,7 @@ class AssetLibraryServiceProvider extends ServiceProvider
public function boot()
{
$this->publishes([
- __DIR__.'/../config/assetlibrary.php' => config_path('assetlibrary.php'),
+ __DIR__.'/../config/thinktomorrow/assetlibrary.php' => config_path('assetlibrary.php'),
], 'config');
// use this if your package has routes | Moved config file to thinktomorrow folder | thinktomorrow_assetlibrary | train | php |
d2eb3b9ff5f52810067ac59969a3c4272772bdb3 | diff --git a/storage/memory.go b/storage/memory.go
index <HASH>..<HASH> 100644
--- a/storage/memory.go
+++ b/storage/memory.go
@@ -40,7 +40,6 @@ type MemoryStore struct {
AuthorizeCodes map[string]StoreAuthorizeCode
IDSessions map[string]fosite.Requester
AccessTokens map[string]fosite.Requester
- Implicit map[string]fosite.Requester
RefreshTokens map[string]fosite.Requester
PKCES map[string]fosite.Requester
Users map[string]MemoryUserRelation
@@ -56,7 +55,6 @@ func NewMemoryStore() *MemoryStore {
AuthorizeCodes: make(map[string]StoreAuthorizeCode),
IDSessions: make(map[string]fosite.Requester),
AccessTokens: make(map[string]fosite.Requester),
- Implicit: make(map[string]fosite.Requester),
RefreshTokens: make(map[string]fosite.Requester),
PKCES: make(map[string]fosite.Requester),
Users: make(map[string]MemoryUserRelation), | fix(storage): remove unused field (#<I>)
Related #<I> | ory_fosite | train | go |
7fd7f1a5b334bd794d31fcbf068aaec98483c911 | diff --git a/tornado/ioloop.py b/tornado/ioloop.py
index <HASH>..<HASH> 100644
--- a/tornado/ioloop.py
+++ b/tornado/ioloop.py
@@ -257,9 +257,6 @@ class IOLoop(object):
for callback in callbacks:
self._run_callback(callback)
- if self._callbacks:
- poll_timeout = 0.0
-
if self._timeouts:
now = time.time()
while self._timeouts:
@@ -274,6 +271,11 @@ class IOLoop(object):
poll_timeout = min(milliseconds, poll_timeout)
break
+ if self._callbacks:
+ # If any callbacks or timeouts called add_callback,
+ # we don't want to wait in poll() before we run them.
+ poll_timeout = 0.0
+
if not self._running:
break | Check for the existence of callbacks after running all timeouts | tornadoweb_tornado | train | py |
eafbad5da3b187a06709074646d66179724230b3 | diff --git a/controls/js/src/kirki.js b/controls/js/src/kirki.js
index <HASH>..<HASH> 100644
--- a/controls/js/src/kirki.js
+++ b/controls/js/src/kirki.js
@@ -328,7 +328,7 @@ var kirki = {
clear = jQuery( '.kirki-input-container[data-id="' + control.id + '"] .wp-picker-clear' );
if ( clear.length ) {
clear.click( function() {
- control.setting.set( '' );
+ kirki.setting.set( control.id, '' );
});
}
}, 200 ); | bugfix for clear button in color controls | aristath_kirki | train | js |
bd800f4c793fdcff2347a263c39c4256107b417f | diff --git a/setuptools/tests/test_build_meta.py b/setuptools/tests/test_build_meta.py
index <HASH>..<HASH> 100644
--- a/setuptools/tests/test_build_meta.py
+++ b/setuptools/tests/test_build_meta.py
@@ -236,3 +236,23 @@ class TestBuildMetaBackend:
build_backend = self.get_build_backend()
build_backend.build_sdist("temp")
+
+ _relative_path_import_files = {
+ 'setup.py': DALS("""
+ __import__('setuptools').setup(
+ name='foo',
+ version=__import__('hello').__version__,
+ py_modules=['hello']
+ )"""),
+ 'hello.py': '__version__ = "0.0.0"',
+ 'setup.cfg': DALS("""
+ [sdist]
+ formats=zip
+ """)
+ }
+
+ def test_build_sdist_relative_path_import(self, tmpdir_cwd):
+ build_files(self._relative_path_import_files)
+ build_backend = self.get_build_backend()
+ with pytest.raises(ImportError):
+ build_backend.build_sdist("temp") | Add test for relative path imports in build_meta
Failing test adapted from PR #<I> | pypa_setuptools | train | py |
b3236fecf55c24caffe6707a5c5663289b5c45e9 | diff --git a/src/windows/SmsProxy.js b/src/windows/SmsProxy.js
index <HASH>..<HASH> 100644
--- a/src/windows/SmsProxy.js
+++ b/src/windows/SmsProxy.js
@@ -4,7 +4,7 @@ module.exports = {
var chatMessage = new Windows.ApplicationModel.Chat.ChatMessage();
chatMessage.body = args[1];
- const validRecipent = args[0].every(function (r) {
+ const validRecipent = args[0] && args[0].every(function (r) {
return !r == false;
});
if (validRecipent) { | Added a check for arg[0] | cordova-sms_cordova-sms-plugin | train | js |
dff33caa7b81c8392550d3721c7a112e95e42e93 | diff --git a/api/dataprocessor.go b/api/dataprocessor.go
index <HASH>..<HASH> 100644
--- a/api/dataprocessor.go
+++ b/api/dataprocessor.go
@@ -351,7 +351,7 @@ func (s *Server) getTarget(ctx context.Context, req models.Req) (points []schema
cntFixed,
), req.OutInterval, nil
} else {
- fixed, err := s.getSeriesFixed(ctx, req, consolidation.None)
+ fixed, err := s.getSeriesFixed(ctx, req, req.Consolidator)
return fixed, req.OutInterval, err
}
} else { | Fix broken consolidation
Seems like this was broken here: <URL> | grafana_metrictank | train | go |
d20f0c4128af3cef4d8b996e887ba1f4469b2579 | diff --git a/lxd/devices.go b/lxd/devices.go
index <HASH>..<HASH> 100644
--- a/lxd/devices.go
+++ b/lxd/devices.go
@@ -291,6 +291,11 @@ func deviceTaskBalance(d *Daemon) {
// Set the new pinning
for ctn, set := range pinning {
+ // Confirm the container didn't just stop
+ if !ctn.IsRunning() {
+ continue
+ }
+
sort.Strings(set)
err := ctn.CGroupSet("cpuset.cpus", strings.Join(set, ","))
if err != nil { | Reduce load balancing error messages
On very loaded systems it's not uncommon for container status to change
during the balancing run, so check for the container status rigth before
applying the new configuration too. | lxc_lxd | train | go |
292f093ea2887001aba7db5fea8d23f0892e99e8 | diff --git a/lib/PhpWriter/Psr4Writer.php b/lib/PhpWriter/Psr4Writer.php
index <HASH>..<HASH> 100644
--- a/lib/PhpWriter/Psr4Writer.php
+++ b/lib/PhpWriter/Psr4Writer.php
@@ -10,7 +10,7 @@ class Psr4Writer extends BasePsr4Writer implements ClassWriter
public function write(PHPType $php, $content)
{
foreach ($this->namespaces as $namespace => $dir) {
- if (strpos($php->getNamespace() . "\\", $namespace) === 0) {
+ if (strpos(trim($php->getNamespace()) . "\\", $namespace) === 0) {
$d = strtr(substr($php->getNamespace(), strlen($namespace)), "\\", "/");
$dir = rtrim($dir, "/") . "/" . $d;
if (! is_dir($dir) && ! mkdir($dir, 0777, true)) { | Update Psr4Writer.php
Removing white characters worked for me | goetas-webservices_xsd2php | train | php |
1084ed0db8613158216b9da7e313c1f8345ae4ab | diff --git a/html5lib/__init__.py b/html5lib/__init__.py
index <HASH>..<HASH> 100644
--- a/html5lib/__init__.py
+++ b/html5lib/__init__.py
@@ -31,5 +31,5 @@ __all__ = ["HTMLParser", "parse", "parseFragment", "getTreeBuilder",
"getTreeWalker", "serialize", "__version__"]
# this has to be at the top level, see how setup.py parses this
-#: Distribution version number, which asymptotically approaches 1.
+#: Distribution version number.
__version__ = "0.9999999999-dev" | Asymptote no more | html5lib_html5lib-python | train | py |
bac603afd6f274244ebc0599ca3a4d39b3978472 | diff --git a/pkg/controller/node/nodecontroller.go b/pkg/controller/node/nodecontroller.go
index <HASH>..<HASH> 100644
--- a/pkg/controller/node/nodecontroller.go
+++ b/pkg/controller/node/nodecontroller.go
@@ -73,6 +73,8 @@ const (
evictionRateLimiterBurst = 1
// The amount of time the nodecontroller polls on the list nodes endpoint.
apiserverStartupGracePeriod = 10 * time.Minute
+ // The amount of time the nodecontroller should sleep between retrying NodeStatus updates
+ retrySleepTime = 20 * time.Millisecond
)
type zoneState string
@@ -535,6 +537,7 @@ func (nc *NodeController) monitorNodeStatus() error {
glog.Errorf("Failed while getting a Node to retry updating NodeStatus. Probably Node %s was deleted.", name)
break
}
+ time.Sleep(retrySleepTime)
}
if err != nil {
glog.Errorf("Update status of Node %v from NodeController exceeds retry count."+ | Sleep between NodeStatus update retries | kubernetes_kubernetes | train | go |
192969f2e6221cc9a07822de775925b2ffc68590 | diff --git a/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java b/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java
index <HASH>..<HASH> 100644
--- a/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java
+++ b/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java
@@ -137,6 +137,10 @@ public class AccessPoint implements RequestContext, BeanNameAware {
}
String contextPath = getContextPath(httpRequest);
if (!origRequestPath.startsWith(contextPath)) {
+ if(contextPath.startsWith(origRequestPath)) {
+ // missing trailing '/', just omit:
+ return "";
+ }
return null;
}
return origRequestPath.substring(contextPath.length());
@@ -321,7 +325,10 @@ public class AccessPoint implements RequestContext, BeanNameAware {
SearchResults results = collection.getResourceIndex().query(wbRequest);
if(results.getResultsType().equals(
WaybackConstants.RESULTS_TYPE_CAPTURE)) {
-
+ CaptureSearchResults cResults = (CaptureSearchResults) results;
+ SearchResult closest = cResults.getClosest(wbRequest);
+ closest.put(WaybackConstants.RESULT_CLOSEST_INDICATOR,
+ WaybackConstants.RESULT_CLOSEST_VALUE);
query.renderUrlResults(httpRequest,httpResponse,wbRequest,
results,uriConverter); | FEATURE: added closest indicator for queries, allowed missing trailing '/' on requests to base of AccessPoint
git-svn-id: <URL> | iipc_openwayback | train | java |
d2e026bd778f93a38d0bbe440c74f9fd4a018c89 | diff --git a/src/Google/Service/Compute.php b/src/Google/Service/Compute.php
index <HASH>..<HASH> 100644
--- a/src/Google/Service/Compute.php
+++ b/src/Google/Service/Compute.php
@@ -1467,6 +1467,10 @@ class Google_Service_Compute extends Google_Service
'type' => 'string',
'required' => true,
),
+ 'port' => array(
+ 'location' => 'query',
+ 'type' => 'integer',
+ ),
),
),'insert' => array(
'path' => '{project}/zones/{zone}/instances',
@@ -4450,6 +4454,8 @@ class Google_Service_Compute_Instances_Resource extends Google_Service_Resource
* @param string $zone The name of the zone for this request.
* @param string $instance Name of the instance scoping this request.
* @param array $optParams Optional parameters.
+ *
+ * @opt_param int port Which COM port to retrieve data from.
* @return Google_Service_Compute_SerialPortOutput
*/
public function getSerialPortOutput($project, $zone, $instance, $optParams = array()) | Updated Compute.php
This change has been generated by a script that has detected changes in the
discovery doc of the API.
Check <URL> | googleapis_google-api-php-client | train | php |
9347b80b7faa3d2d40f990c20a8f60fee3f8762f | diff --git a/tests/test__fitter.py b/tests/test__fitter.py
index <HASH>..<HASH> 100644
--- a/tests/test__fitter.py
+++ b/tests/test__fitter.py
@@ -48,6 +48,14 @@ class Test_fitter(_ut.TestCase):
f.__repr__()
f.fit()
+
+ # Check results and error bars. The small error / large reduced chi^2
+ # ensures that there is no autoscaling of the covariance matrix / error bars,
+ # which is the default (CRAZY!!) behavior of many professional packages including
+ # lmfit and scipy's curve_fit()
+ self.assertAlmostEqual(6.958333341520, f.p_fit['a1'].value)
+ self.assertAlmostEqual(0.2808363344234, f.p_fit['a2'].stderr)
+
_s.tweaks.set_figure_window_geometry(position=[0,0])
_s.pylab.ginput(timeout=self.plot_delay)
f.__repr__()
@@ -55,7 +63,7 @@ class Test_fitter(_ut.TestCase):
# Check that the reduced chi^2 is roughly correct
r = f.get_reduced_chi_squareds()
self.assertIs(type(r), list)
- self.assertAlmostEqual(r[0], 29.2238, 2)
+ self.assertAlmostEqual(r[0], 29.2238095)
# trim the data
f.set(xmin=1.5, xmax=6.5) | Fitter test checks for autoscale of covariance | Spinmob_spinmob | train | py |
69ae27b6739300b4e3e12e9b911d208a999ca8cc | diff --git a/tests/test_heroku.py b/tests/test_heroku.py
index <HASH>..<HASH> 100644
--- a/tests/test_heroku.py
+++ b/tests/test_heroku.py
@@ -368,10 +368,10 @@ class TestHerokuLocalRunner(object):
with pytest.raises(TimeoutError):
runner.start()
- def test_kill(self, runner):
- runner.start()
- runner.kill()
- runner.log.assert_called_with('Local Heroku process terminated')
+ # def test_kill(self, runner):
+ # runner.start()
+ # runner.kill()
+ # runner.log.assert_called_with('Local Heroku process terminated')
def test_start_when_shell_command_fails(self, runner):
runner.shell_command = 'nonsense' | Is it this test in particular? | Dallinger_Dallinger | train | py |
e7036496cb1ebb5e3c12fb048dc09139f4974da1 | 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
@@ -24,7 +24,7 @@ from salesforce.testrunner.example.models import (Account, Contact, Lead, User,
Product, Pricebook, PricebookEntry, Note, Task,
Organization, models_template,
)
-from salesforce import router, DJANGO_110_PLUS
+from salesforce import router, DJANGO_110_PLUS, DJANGO_111_PLUS
import salesforce
from ..backend.test_helpers import skip, skipUnless, expectedFailure, expectedFailureIf # test decorators
from ..backend.test_helpers import current_user, default_is_sf, sf_alias, uid
@@ -447,6 +447,7 @@ class BasicSOQLRoTest(TestCase):
finally:
account.delete()
+ @expectedFailureIf(QUIET_KNOWN_BUGS and DJANGO_111_PLUS)
def test_bulk_update(self):
"""Create two Contacts by one request in one command, find them.
""" | Silenced a test for bulk update that can not be easily repaired | django-salesforce_django-salesforce | train | py |
49f35592658dcb4aba6a7d3d68879231a7fb28a8 | diff --git a/cloudvolume/frontends/graphene.py b/cloudvolume/frontends/graphene.py
index <HASH>..<HASH> 100644
--- a/cloudvolume/frontends/graphene.py
+++ b/cloudvolume/frontends/graphene.py
@@ -443,8 +443,10 @@ class CloudVolumeGraphene(CloudVolumePrecomputed):
def get_leaves_v1(self, root_id, bbox, mip):
root_id = int(root_id)
+ api = GrapheneApiVersion("v1")
+
url = posixpath.join(
- self.meta.base_path, self.meta.api_version.path(self.meta.server_path),
+ self.meta.base_path, api.path(self.meta.server_path),
"node", str(root_id), "leaves"
)
bbox = Bbox.create(bbox, context=self.meta.bounds(mip), bounded=self.bounded) | fix(graphene): make sure api v1 is used in v1 specific code | seung-lab_cloud-volume | train | py |
d6fbbf25438c8b1c33aa5e01f3b50dcb8c526d4c | diff --git a/thoth_solver/python.py b/thoth_solver/python.py
index <HASH>..<HASH> 100644
--- a/thoth_solver/python.py
+++ b/thoth_solver/python.py
@@ -124,8 +124,7 @@ def resolve_package_versions(dependency_tree, ignore_version_ranges, index_url):
requirement += dependency['required_version']
# TODO: add possibility to specify version range explicitly
- dependency['resolved_versions'] = solver.solve([requirement], all_versions=True).\
- pop(dependency['package_name'])
+ dependency['resolved_versions'] = list(solver.solve([requirement], all_versions=True).values())[0]
def get_all_locked_stacks(dependency_tree, index_url=None, exclude_packages=None): | We do not care about actual package names returned | thoth-station_solver | train | py |
aab4b572df54fdafe20f5dc52c90ca5e7c9b1320 | diff --git a/progressbar/__about__.py b/progressbar/__about__.py
index <HASH>..<HASH> 100644
--- a/progressbar/__about__.py
+++ b/progressbar/__about__.py
@@ -19,7 +19,7 @@ A Python Progressbar library to provide visual (yet text based) progress to
long running operations.
'''.strip().split())
__email__ = 'wolph@wol.ph'
-__version__ = '3.32.1'
+__version__ = '3.33.0'
__license__ = 'BSD'
__copyright__ = 'Copyright 2015 Rick van Hattem (Wolph)'
__url__ = 'https://github.com/WoLpH/python-progressbar' | Incrementing version to <I> | WoLpH_python-progressbar | train | py |
3d95a139f53f31b36b0b7cbe161303f8c21aba55 | diff --git a/masonite/routes.py b/masonite/routes.py
index <HASH>..<HASH> 100644
--- a/masonite/routes.py
+++ b/masonite/routes.py
@@ -37,7 +37,7 @@ class Route():
def set_post_params(self):
""" If the route is a Post, swap the QUERY_STRING """
fields = None
- if 'POST' == self.environ['REQUEST_METHOD']:
+ if 'POST' in self.environ['REQUEST_METHOD']:
fields = cgi.FieldStorage(
fp=self.environ['wsgi.input'], environ=self.environ, keep_blank_values=1)
return fields | changes equals to in for post params | MasoniteFramework_masonite | train | py |
f89a62ebca35e76edc5ad02755743597dbccafb9 | diff --git a/karma.conf.js b/karma.conf.js
index <HASH>..<HASH> 100644
--- a/karma.conf.js
+++ b/karma.conf.js
@@ -90,18 +90,24 @@ module.exports = function(config) {
// OSX Maverick
- 'SL_Chrome_OSX9': {
+ 'SL_Chrome44_OSX10_10': {
base: 'SauceLabs',
browserName: 'chrome',
- version: '40',
+ version: '44',
platform: 'OS X 10.10'
},
- 'SL_Firefox_OSX9': {
+ 'SL_Firefox_OSX10_10': {
base: 'SauceLabs',
browserName: 'firefox',
version: '38',
platform: 'OS X 10.10'
},
+ 'SL_Firefox_OSX10_10': {
+ base: 'SauceLabs',
+ browserName: 'firefox',
+ version: '42',
+ platform: 'OS X 10.10'
+ },
'SL_Safari': {
base: 'SauceLabs',
browserName: 'safari',
@@ -110,10 +116,10 @@ module.exports = function(config) {
},
//Win 8.1
- 'SL_Chrome_WIN81': {
+ 'SL_Chrome44_WIN81': {
base: 'SauceLabs',
browserName: 'chrome',
- version: '40',
+ version: '44',
platform: 'Windows 8.1'
},
// 'SL_Firefox_WIN81': { | try fix SL tests : test various platform | plepers_nanogl | train | js |
8388f5347e8f67b90c6fa20edfe7a24aa2d32dfc | diff --git a/public/assets/appCore.js b/public/assets/appCore.js
index <HASH>..<HASH> 100644
--- a/public/assets/appCore.js
+++ b/public/assets/appCore.js
@@ -1715,12 +1715,10 @@ $(function () {
}).then(() => {
return new Promise((resolve, reject) => {
$.getScript(HOME + "assetsPublic/core.min.js", function (data, textStatus, jqxhr) {
- console.log('carregou');
- if (jqxhr.status === 200) {
+ if (jqxhr.status === 200)
resolve(data);
- } else {
+ else
reject(0);
- }
});
});
}).then(() => { | get core js async and wait its load | edineibauer_uebConfig | train | js |
91cdb357d41acddb7abef747e2ad942a899131eb | diff --git a/uploadfs.js b/uploadfs.js
index <HASH>..<HASH> 100644
--- a/uploadfs.js
+++ b/uploadfs.js
@@ -35,6 +35,21 @@ function Uploadfs() {
self._storage = require('./lib/storage/' + self._storage + '.js')();
}
+ // If you want to deliver your images
+ // over a CDN then this could be set in options
+ if (options.cdn !== undefined) {
+ if ( !_.isObject(options.cdn) ||
+ !_.isString(options.cdn.url) ||
+ (options.cdn.enabled !== undefined && !_.isBoolean(options.cdn.enabled))
+ ) {
+ return callback('CDN must be a valid object: {enabled: boolean, url: string}');
+ }
+ if (options.cdn.enabled === undefined) {
+ options.cdn.enabled = true;
+ }
+ self.cdn = options.cdn;
+ }
+
// Load image backend
self._image = options.image;
if (typeof (self._image) === 'string') {
@@ -336,6 +351,9 @@ function Uploadfs() {
};
self.getUrl = function (options, callback) {
+ if (self.cdn.enabled) {
+ return self.cdn.url;
+ }
return self._storage.getUrl(options, callback);
}; | [SZINT-<I>] – Include a CDN-option to uploadfs | punkave_uploadfs | train | js |
5e1a618415ce1606e244db3a6c7210ca0627d90d | diff --git a/broker/options.go b/broker/options.go
index <HASH>..<HASH> 100644
--- a/broker/options.go
+++ b/broker/options.go
@@ -5,10 +5,9 @@ type Options struct{}
type PublishOptions struct{}
type SubscribeOptions struct {
- // AutoAck defaults to true
+ // AutoAck defaults to true. When a handler returns
+ // with a nil error the message is acked.
AutoAck bool
- // NumHandlers defaults to 1
- NumHandlers int
// Subscribers with the same queue name
// will create a shared subscription where each
// receives a subset of messages.
@@ -29,14 +28,7 @@ func DisableAutoAck() SubscribeOption {
}
}
-// NumHandlers sets the number of concurrent handlers to create
-// for a subscriber.
-func NumHandlers(i int) SubscribeOption {
- return func(o *SubscribeOptions) {
- o.NumHandlers = i
- }
-}
-
+// QueueName sets the name of the queue to share messages on
func QueueName(name string) SubscribeOption {
return func(o *SubscribeOptions) {
o.Queue = name
@@ -45,8 +37,7 @@ func QueueName(name string) SubscribeOption {
func newSubscribeOptions(opts ...SubscribeOption) SubscribeOptions {
opt := SubscribeOptions{
- AutoAck: true,
- NumHandlers: 1,
+ AutoAck: true,
}
for _, o := range opts { | Screw num handlers, this adds complexity for concurrency which we dont need | micro_go-micro | train | go |
3c04f22ebab4639c6c0389ac83c00bd8aa7d5b02 | diff --git a/lib/objectFactory.js b/lib/objectFactory.js
index <HASH>..<HASH> 100644
--- a/lib/objectFactory.js
+++ b/lib/objectFactory.js
@@ -61,7 +61,10 @@ var create = function (params) {
// Add the remaining data. The constructors might mutate this and we only
// want to add what is left
for (var key in data) {
- this[key] = data[key];
+ // Don't override existing props
+ if (!this[key]) {
+ this[key] = data[key];
+ }
};
}; | Don't overwrite existing props (solves issue where props returned by an API overwrite those provided by the ObjectPrototype declaration) | jhsware_component-registry | train | js |
16a8cd953a548f92fa233e3b91bb1e5a050f8910 | diff --git a/config/module.config.php b/config/module.config.php
index <HASH>..<HASH> 100644
--- a/config/module.config.php
+++ b/config/module.config.php
@@ -130,7 +130,7 @@ return array(
'jobs/sidebar/index' => __DIR__ . '/../view/sidebar/index.phtml',
'jobs/form/list-filter' => __DIR__ . '/../view/form/list-filter.phtml',
'jobs/form/apply-identifier' => __DIR__ . '/../view/form/apply-identifier.phtml',
- 'jobs-publish-on-yawik' => __DIR__ . '/../module/Jobs/view/modals/yawik.phtml',
+ 'jobs-publish-on-yawik' => __DIR__ . '/../view/modals/yawik.phtml',
'jobs-publish-on-jobsintown' => __DIR__ . '/../view/modals/jobsintown.phtml',
'jobs-publish-on-homepage' => __DIR__ . '/../view/modals/homepage.phtml',
'jobs-terms-and-conditions' => __DIR__ . '/../view/jobs/index/terms.phtml', | [Jobs] fixes link to the yawik channel description | yawik_jobs | train | php |
3f339e9500b25bee6b523b2f34bf9cd183befed6 | diff --git a/pythongrid.py b/pythongrid.py
index <HASH>..<HASH> 100755
--- a/pythongrid.py
+++ b/pythongrid.py
@@ -145,7 +145,7 @@ class Job(object):
del self.kwlist
except Exception as e:
self.ret = e
- traceback.print_exc(e)
+ traceback.print_exc()
@property
def native_specification(self):
@@ -314,7 +314,7 @@ def _collect_jobs(sid, jobids, joblist, con, uniq_id, temp_dir='/scratch/', wait
print("Check log files for more information: ", file=sys.stderr)
print("stdout:", log_stdout_fn, file=sys.stderr)
print("stderr:", log_stderr_fn, file=sys.stderr)
- traceback.print_exc(detail)
+ print("Exception: {}".format(detail))
sys.exit(2)
job_output_list.append(job_output) | Fixed calls to traceback.print_exc() to actually use the correct syntax. | pygridtools_gridmap | train | py |
5f1169b9a20667c0de2653fe4366691fb26c3702 | diff --git a/salt/loader.py b/salt/loader.py
index <HASH>..<HASH> 100644
--- a/salt/loader.py
+++ b/salt/loader.py
@@ -15,12 +15,14 @@ import inspect
import tempfile
import functools
import threading
+import traceback
import types
from collections import MutableMapping
from zipimport import zipimporter
# Import salt libs
import salt.config
+import salt.defaults.exitcodes
import salt.syspaths
import salt.utils.context
import salt.utils.files
@@ -1462,6 +1464,17 @@ class LazyLoader(salt.utils.lazy.LazyDict):
self.missing_modules[name] = error
return False
except SystemExit as error:
+ try:
+ fn_, _, caller, _ = traceback.extract_tb(sys.exc_info()[2])[-1]
+ except Exception:
+ pass
+ else:
+ tgt_fn = os.path.join('salt', 'utils', 'process.py')
+ if fn_.endswith(tgt_fn) and '_handle_signals' in caller:
+ # Race conditon, SIGTERM or SIGINT received while loader
+ # was in process of loading a module. Call sys.exit to
+ # ensure that the process is killed.
+ sys.exit(salt.defaults.exitcodes.EX_OK)
log.error(
'Failed to import {0} {1} as the module called exit()\n'.format(
self.tag, name | Fix race when SIGTERM/SIGINT received while lazyloading a module
This try/except block is designed to keep some bozo from putting a
sys.exit() in their code and causing the minion to stop. The stack from
the exception is inspected, and if our signal handling ran the
sys.exit() then we re-run that sys.exit(). | saltstack_salt | train | py |
759f8da8470691df3ad71fd75f774e2a64766809 | diff --git a/src/createDOMForm.js b/src/createDOMForm.js
index <HASH>..<HASH> 100644
--- a/src/createDOMForm.js
+++ b/src/createDOMForm.js
@@ -37,7 +37,9 @@ function getScrollableContainer(n) {
/* eslint no-cond-assign:0 */
while ((nodeName = node.nodeName.toLowerCase()) !== 'body') {
const overflowY = computedStyle(node, 'overflowY');
- if (node !== n && (overflowY === 'auto' || overflowY === 'scroll')) {
+ // https://stackoverflow.com/a/36900407/3040605
+ if (node !== n && (overflowY === 'auto' || overflowY === 'scroll') &&
+ node.scrollHeight > node.clientHeight) {
return node;
}
node = node.parentNode; | fix: scrollable node is not scrollable in some situations (#<I>)
close ant-design/ant-design#<I> | react-component_form | train | js |
2f9b3295c16e400dba9d40829d5897d7e07e514b | diff --git a/decorating/animation.py b/decorating/animation.py
index <HASH>..<HASH> 100755
--- a/decorating/animation.py
+++ b/decorating/animation.py
@@ -153,7 +153,7 @@ def space_wave(phase, amplitude=12, frequency=0.1):
def _spinner(control):
if not sys.stdout.isatty(): # not send to pipe/redirection
- return
+ return # pragma: no cover
colorize_no_reset = partial(color.colorize, autoreset=False)
@@ -364,7 +364,7 @@ class WritingDecorator(decorator.Decorator):
sys.stdout = sys.__stdout__
-def _killed():
+def _killed(): # pragma: no cover
AnimatedDecorator.stop()
WritingDecorator.stop()
AnimatedDecorator.spinner.stream.dump.close() | Ignore some lines which covering doesn't makes sense
I need test properly later. | ryukinix_decorating | train | py |
58dc31e1ae00def150b13016c7aa0d471eca33ce | diff --git a/combyne.js b/combyne.js
index <HASH>..<HASH> 100644
--- a/combyne.js
+++ b/combyne.js
@@ -555,10 +555,6 @@ var render = function() {
}
obj = normalizeArgument(capture, context)
-
- if (obj == null) {
- obj = { prop: capture };
- }
}
else if (mode.exists("filter")) {
if (mode.exists("skip")) { | Removed unused and undocumented code that doesn't seem to do much of anything useful. | tbranyen_combyne | train | js |
2094e919d1afb6873b3b6dd616e13e8146152c02 | diff --git a/assets/js/script.js b/assets/js/script.js
index <HASH>..<HASH> 100755
--- a/assets/js/script.js
+++ b/assets/js/script.js
@@ -43,7 +43,7 @@ var DefaultTheme = {
{
"Comments" :
{
- "comment" : $("#textbox").text(),
+ "comment" : $("#textbox").html(),
"content_id" : $(".content").attr("data-attr-id")
}
},
diff --git a/views/comment/comment.php b/views/comment/comment.php
index <HASH>..<HASH> 100755
--- a/views/comment/comment.php
+++ b/views/comment/comment.php
@@ -28,8 +28,6 @@
<?php endif; ?>
</div>
</div>
- <?php $model = new Comments(); ?>
- <?php $comment->parent_id = $comment->parent_id; ?>
<?php $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
'id'=>'comment-form',
'htmlOptions' => array('class' => 'comment-form') | I really need to think through more comment stuff... | ciims_ciims-themes-default | train | js,php |
6ad158dd1493eb8bbc2a661fe822726605173f16 | diff --git a/net/swarm/swarm_test.go b/net/swarm/swarm_test.go
index <HASH>..<HASH> 100644
--- a/net/swarm/swarm_test.go
+++ b/net/swarm/swarm_test.go
@@ -139,7 +139,10 @@ func SubtestSwarm(t *testing.T, SwarmNum int, MsgNum int) {
for k := 0; k < MsgNum; k++ { // with k messages
msg := "ping"
log.Debugf("%s %s %s (%d)", s1.local, msg, p, k)
- stream.Write([]byte(msg))
+ if _, err := stream.Write([]byte(msg)); err != nil {
+ errChan <- err
+ continue
+ }
}
// read it later
@@ -200,7 +203,7 @@ func SubtestSwarm(t *testing.T, SwarmNum int, MsgNum int) {
// check any errors (blocks till consumer is done)
for err := range errChan {
if err != nil {
- t.Fatal(err.Error())
+ t.Error(err.Error())
}
} | swarm test: reporting errors fix | ipfs_go-ipfs | train | go |
ca5354ffb1b96dbfdc555f394035b3c76348f662 | diff --git a/release/ray_release/tests/test_wheels.py b/release/ray_release/tests/test_wheels.py
index <HASH>..<HASH> 100644
--- a/release/ray_release/tests/test_wheels.py
+++ b/release/ray_release/tests/test_wheels.py
@@ -181,7 +181,9 @@ class WheelsFinderTest(unittest.TestCase):
def override_env(path, env):
this_env["env"] = env
- with patch("ray_release.config.load_and_render_yaml_template", override_env):
+ with patch(
+ "ray_release.config.load_and_render_yaml_template", override_env
+ ), patch("ray_release.config.get_test_environment", lambda: {}):
load_test_cluster_env(
Test(cluster=dict(cluster_env="invalid")),
ray_wheels_url="https://no-commit-url", | [ci/release] Fix test_wheels (#<I>) | ray-project_ray | train | py |
cb82e069764416c68bde8ef53add9be12f5dd753 | diff --git a/src/main/java/nebula/plugin/metrics/model/Info.java b/src/main/java/nebula/plugin/metrics/model/Info.java
index <HASH>..<HASH> 100644
--- a/src/main/java/nebula/plugin/metrics/model/Info.java
+++ b/src/main/java/nebula/plugin/metrics/model/Info.java
@@ -32,7 +32,7 @@ import java.util.stream.Collectors;
/**
* Environment.
*/
-@Data
+@Value
@JsonPropertyOrder({"build", "scm", "ci", "environmentVariables", "systemProperties", "javaVersion", "detailedJavaVersion", "nebulaFeatures"})
public class Info {
private static final String UNKNOWN = "UNKNOWN";
@@ -88,12 +88,7 @@ public class Info {
@NonNull
private String detailedJavaVersion;
- public void setJavaVersion(String javaRuntimeName, String javaVersion, String javaVendor) {
- this.javaVersion = javaVersion;
- this.detailedJavaVersion = determineJavaVersion(javaRuntimeName, javaVersion, javaVendor);
- }
-
- private static String determineJavaVersion(String javaRuntimeName, String javaVersion, String javaVendor) {
+ public static String determineJavaVersion(String javaRuntimeName, String javaVersion, String javaVendor) {
if(javaVersion.isEmpty()) {
return UNKNOWN.toLowerCase();
} | Realized I can do this as a value class | nebula-plugins_gradle-metrics-plugin | train | java |
3c9662da2daa5ce2804b48e1eb2379a760162b32 | diff --git a/motor/__init__.py b/motor/__init__.py
index <HASH>..<HASH> 100644
--- a/motor/__init__.py
+++ b/motor/__init__.py
@@ -194,9 +194,6 @@ class MotorSocket(object):
self.stream.read_bytes(num_bytes, callback)
def close(self):
- # TODO: examine this, decide if it's correct, and if so explain why
- self.stream.set_close_callback(None)
-
sock = self.stream.socket
try:
try: | No need to clear IOStream.close_callback in MotorSocket.close()
The check, above, for "child_gr.dead" makes it redundant (and slightly incorrect) to clear the close callback in MotorSocket.close() | mongodb_motor | train | py |
510a57f5444b52ac101f9841242fab0726c50fce | diff --git a/libraries/legacy/view/legacy.php b/libraries/legacy/view/legacy.php
index <HASH>..<HASH> 100644
--- a/libraries/legacy/view/legacy.php
+++ b/libraries/legacy/view/legacy.php
@@ -484,7 +484,7 @@ class JViewLegacy extends JObject
*
* @since 12.2
*/
- public function setModel(JModelLegacy $model, $default = false)
+ public function setModel($model, $default = false)
{
$name = strtolower($model->getName());
$this->_models[$name] = $model; | Fix failing unit tests. This isn't an error in itself but it breaks a unit test that relies on injecting a mock model into JViewLegacy. | joomla_joomla-framework | train | php |
1bed00e1dfe585c8f093adb3dd015c51302c5c62 | diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php
index <HASH>..<HASH> 100644
--- a/DependencyInjection/Configuration.php
+++ b/DependencyInjection/Configuration.php
@@ -26,6 +26,10 @@ class Configuration implements ConfigurationInterface
->isRequired()
->cannotBeEmpty()
->end() // sitekey
+ ->scalarNode('secret')
+ ->isRequired()
+ ->cannotBeEmpty()
+ ->end() // secret
->arrayNode('validation')
->isRequired()
->cannotBeEmpty()
diff --git a/DependencyInjection/NietonfirGoogleReCaptchaExtension.php b/DependencyInjection/NietonfirGoogleReCaptchaExtension.php
index <HASH>..<HASH> 100644
--- a/DependencyInjection/NietonfirGoogleReCaptchaExtension.php
+++ b/DependencyInjection/NietonfirGoogleReCaptchaExtension.php
@@ -24,6 +24,8 @@ class NietonfirGoogleReCaptchaExtension extends Extension
// set the reCAPTCHA API key
$container->setParameter('nietonfir_google_recaptcha.sitekey', $config['sitekey']);
+ // set the reCAPTCHA API secret
+ $container->setParameter('nietonfir_google_recaptcha.secret', $config['secret']);
// set required validation parameters
foreach($config['validation'] as $k => $v) { | Require the API secret in the bundle configuration
and expose it as a parameter | nietonfir_GoogleRecaptchaBundle | train | php,php |
3c913f77b181cedcacba3b5064e0a369cabb67ed | diff --git a/test/__setup.js b/test/__setup.js
index <HASH>..<HASH> 100644
--- a/test/__setup.js
+++ b/test/__setup.js
@@ -1,4 +1,5 @@
'use strict';
+/*eslint no-console: 0*/
if (process.env.LOG_TESTS) {
require('../lib').logSink.on('log', function(log) {
diff --git a/test/pubsub.integration-tests.js b/test/pubsub.integration-tests.js
index <HASH>..<HASH> 100644
--- a/test/pubsub.integration-tests.js
+++ b/test/pubsub.integration-tests.js
@@ -15,8 +15,6 @@ describe('Pub/Sub integration', function() {
var subscriber;
before(function() {
- magicbus.logSink.on('log', console.log);
-
broker = magicbus.createBroker(serviceDomainName, appName, connectionInfo);
publisher = magicbus.createPublisher(broker);
subscriber = magicbus.createSubscriber(broker); | Ignore console rule when logging tests | twindagger_magicbus | train | js,js |
21a76777849700d5d051b1b2747a8db28a38c873 | diff --git a/cablemap.core/cablemap/core/reader.py b/cablemap.core/cablemap/core/reader.py
index <HASH>..<HASH> 100644
--- a/cablemap.core/cablemap/core/reader.py
+++ b/cablemap.core/cablemap/core/reader.py
@@ -167,6 +167,7 @@ _C14N_FIXES = {
u'HALIF': u'HALIFAX',
u'KUALALUMP': u'KUALALUMPUR',
u'WELLINGOTN': u'WELLINGTON',
+ u'WELLLINGTON': u'WELLINGTON',
u'BKK': u'BANGKOK',
u'KINSTON': u'KINGSTON',
u'BISHTEK': u'BISHKEK',
diff --git a/cablemap.core/tests/test_reader_id_c14n.py b/cablemap.core/tests/test_reader_id_c14n.py
index <HASH>..<HASH> 100644
--- a/cablemap.core/tests/test_reader_id_c14n.py
+++ b/cablemap.core/tests/test_reader_id_c14n.py
@@ -88,6 +88,7 @@ _TEST_DATA = (
(u'02USDA12', u'02USDAFAS12'),
('10CDCATLANTAGA12', u'10CDCATLANTA12'),
('10BRASIIA12', '10BRASILIA12'),
+ ('10WELLLINGTON12', '10WELLINGTON12'),
)
def test_c14n(): | C<I>N WELLLINGTON -> WELLINGTON | heuer_cablemap | train | py,py |
295ea6f96002ecc05ab307620c3ea6a3603ff716 | diff --git a/src/Builder.php b/src/Builder.php
index <HASH>..<HASH> 100644
--- a/src/Builder.php
+++ b/src/Builder.php
@@ -21,7 +21,7 @@ class Builder
private $adapter;
/**
- * @var string
+ * @var CollectionNameInterface
*/
private $collectionName;
@@ -54,17 +54,6 @@ class Builder
}
/**
- * @deprecated use buildMapper() instead
- * @throws \Exception
- * @return MapperInterface
- */
- public function build()
- {
- trigger_error("Method build() is deprecated, use buildMapper() instead.", E_USER_DEPRECATED);
- return $this->buildMapper();
- }
-
- /**
* @return MapperInterface
* @throws \Exception
*/
@@ -95,9 +84,9 @@ class Builder
* @param CollectionNameInterface $collectinName
* @return Builder
*/
- public function collectionName(CollectionNameInterface $collectinName)
+ public function collectionName(CollectionNameInterface $collectionName)
{
- $this->collectionName = $collectinName;
+ $this->collectionName = $collectionName;
return $this;
} | Removed deprecated build() in Builder; fixed typo in Builder | g4code_data-mapper | train | php |
41bfb8ae5275c2be28983c0e850ac6439bbc4256 | diff --git a/telethon/client/uploads.py b/telethon/client/uploads.py
index <HASH>..<HASH> 100644
--- a/telethon/client/uploads.py
+++ b/telethon/client/uploads.py
@@ -30,7 +30,9 @@ class _CacheType:
return self._cls == other
-def _resize_photo_if_needed(file, is_image, width=1280, height=1280):
+def _resize_photo_if_needed(
+ file, is_image, width=64, height=64, background=(255, 255, 255)):
+
# https://github.com/telegramdesktop/tdesktop/blob/12905f0dcb9d513378e7db11989455a1b764ef75/Telegram/SourceFiles/boxes/photo_crop_box.cpp#L254
if (not is_image
or PIL is None
@@ -47,8 +49,16 @@ def _resize_photo_if_needed(file, is_image, width=1280, height=1280):
return file
image.thumbnail((width, height), PIL.Image.ANTIALIAS)
+
+ # We could save the resized image with the original format, but
+ # JPEG often compresses better -> smaller size -> faster upload
+ # We need to mask away the alpha channel ([3]), since otherwise
+ # IOError is raised when trying to save alpha channels in JPEG.
+ result = PIL.Image.new('RGB', image.size, background)
+ result.paste(image, mask=image.split()[3])
+
buffer = io.BytesIO()
- image.save(buffer, 'JPEG')
+ result.save(buffer, 'JPEG')
buffer.seek(0)
return buffer | Fix photo resizing not working for images with alpha channels | LonamiWebs_Telethon | train | py |
410329b265d1c3ba366ab2fbb1cd64b875a33564 | diff --git a/pysat/instruments/demeter_iap.py b/pysat/instruments/demeter_iap.py
index <HASH>..<HASH> 100644
--- a/pysat/instruments/demeter_iap.py
+++ b/pysat/instruments/demeter_iap.py
@@ -270,8 +270,8 @@ def clean(inst):
# Need Level 0 files to select data with J >= 1 nA
print("WARNING: Level 0 files needed to finish cleaning data")
- # Select times with at least two ion species
- idx, = np.where(nions > 1)
+ # Select times with at least two ion species
+ idx, = np.where(nions > 1)
else:
idx = slice(0, inst.index.shape[0]) | BUG: DEMETER clean
Moved final selection of indices outside of for loop to avoid unnecessary calls. | rstoneback_pysat | train | py |
d961f490ff1624b7c24a69d546a613768906f05c | diff --git a/activerecord/lib/active_record/relation/batches.rb b/activerecord/lib/active_record/relation/batches.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/relation/batches.rb
+++ b/activerecord/lib/active_record/relation/batches.rb
@@ -46,19 +46,14 @@ module ActiveRecord
# group.each { |person| person.party_all_night! }
# end
def find_in_batches(options = {})
+ options.assert_valid_keys(:start, :batch_size)
+
relation = self
unless arel.orders.blank? && arel.taken.blank?
ActiveRecord::Base.logger.warn("Scoped order and limit are ignored, it's forced to be batch order and batch size")
end
- if (finder_options = options.except(:start, :batch_size)).present?
- raise "You can't specify an order, it's forced to be #{batch_order}" if options[:order].present?
- raise "You can't specify a limit, it's forced to be the batch_size" if options[:limit].present?
-
- relation = apply_finder_options(finder_options)
- end
-
start = options.delete(:start).to_i
batch_size = options.delete(:batch_size) || 1000 | move code out to active_record_deprecated_finders | rails_rails | train | rb |
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.