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 |
|---|---|---|---|---|---|
9e6721a741160e01f706526df62c38d9ed62cb48 | diff --git a/telemetry/telemetry/core/memory_cache_http_server.py b/telemetry/telemetry/core/memory_cache_http_server.py
index <HASH>..<HASH> 100644
--- a/telemetry/telemetry/core/memory_cache_http_server.py
+++ b/telemetry/telemetry/core/memory_cache_http_server.py
@@ -70,7 +70,8 @@ class MemoryCacheHTTPServer(SocketServer.ThreadingMixIn,
fs = os.fstat(fd.fileno())
content_type = mimetypes.guess_type(file_path)[0]
zipped = False
- if content_type and content_type.startswith('text/'):
+ if content_type in ['text/html', 'text/css',
+ 'application/javascript']:
zipped = True
response = zlib.compress(response, 9)
self.resource_map[file_path] = { | [Telemetry] Compress JavaScript in addition to HTML/CSS.
This saves about another 3MB of server memory usage on the intl1 page cycler.
BUG=<I>
TEST=intl1 page cycler on mac
NOTRY=True
TBR=<EMAIL>
Review URL: <URL> | catapult-project_catapult | train | py |
8da0521d4cecdd8e8af8d09ba2a6127b760e931b | diff --git a/_config.php b/_config.php
index <HASH>..<HASH> 100644
--- a/_config.php
+++ b/_config.php
@@ -6,5 +6,5 @@ define('SHOP_PATH',BASE_PATH.DIRECTORY_SEPARATOR.SHOP_DIR);
Object::useCustomClass('Currency','ShopCurrency', true);
if($checkoutsteps = CheckoutPage::config()->steps){
- SteppedCheckout::setupSteps($checkoutsteps, CheckoutPage::config()->first_step);
+ SteppedCheckout::setupSteps($checkoutsteps);
} | Update _config.php
Additional unnecessary argument. The function setupSteps, within class SteppedCheckout, only requires $steps. | silvershop_silvershop-core | train | php |
bb541c1b988984f74cbb744969736b81fefa8a13 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -4,15 +4,20 @@ uModbus is a pure Python implementation of the Modbus protocol with support
for Python 2.7, 3.3, 3.4, 3.5 and Pypy. uModbus has no runtime depedencies.
"""
+import os
from setuptools import setup
+cwd = os.path.dirname(os.path.abspath(__name__))
+
+long_description = open(os.path.join(cwd, 'README.rst'), 'r').read()
+
setup(name='uModbus',
version='0.2.0',
author='Auke Willem Oosterhoff',
author_email='oosterhoff@baopt.nl',
description='Implementation of the Modbus protocol in pure Python.',
url='https://github.com/AdvancedClimateSystems/umodbus/',
- long_description=__doc__,
+ long_description=long_description,
license='MPL',
packages=[
'umodbus', | Fix long_description of setup.py. | AdvancedClimateSystems_uModbus | train | py |
62b945e4b0a4e9f1ffc1759cf23a28e4d566348b | diff --git a/components/query-assist/query-assist.js b/components/query-assist/query-assist.js
index <HASH>..<HASH> 100644
--- a/components/query-assist/query-assist.js
+++ b/components/query-assist/query-assist.js
@@ -248,9 +248,11 @@ export default class QueryAssist extends RingComponentWithShortcuts {
this.setupRequestHandler(this.props);
this.setShortcutsEnabled(this.props.focus);
- const request = this.props.autoOpen ? this.requestData() : this.requestStyleRanges();
+ const request = this.props.autoOpen
+ ? this.boundRequestHandler().then(::this.setFocus)
+ : this.requestStyleRanges().catch(::this.setFocus);
+
request.
- catch(::this.setFocus).
/* For some reason one more tick before attachMutationEvents is required */
then(() => new Promise(resolve => setTimeout(resolve, 0))).
then(::this.attachMutationEvents); | RG-<I> QueryAssist: parameter that open assist suggest immediately when it's shown
Former-commit-id: f<I>b<I>b<I>b9d<I>f<I>bed<I>fa<I>b | JetBrains_ring-ui | train | js |
9aaa8ebbd9207ec23dabbe2c84398c4a2149d82b | diff --git a/packages/ember-metal-views/lib/renderer.js b/packages/ember-metal-views/lib/renderer.js
index <HASH>..<HASH> 100755
--- a/packages/ember-metal-views/lib/renderer.js
+++ b/packages/ember-metal-views/lib/renderer.js
@@ -6,7 +6,7 @@ import {
subscribers
} from "ember-metal/instrumentation";
import buildComponentTemplate from "ember-views/system/build-component-template";
-import { indexOf } from "ember-metal/array";
+import { indexOf } from "ember-metal/enumerable_utils";
//import { deprecation } from "ember-views/compat/attrs-proxy";
function Renderer(_helper) { | Use `indexOf` from EnumerableUtils.
It properly defers to the object or polyfil as needed. | emberjs_ember.js | train | js |
3e8716c70ec473dd1ad7225b0a16a593faa79df4 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -22,13 +22,19 @@ function renameDeep(obj, cb) {
throw new Error('deep-rename-keys expects an object');
}
- obj = rename(obj, cb);
- var res = {};
+ var res;
+ if(typeOf(obj) === 'array')
+ res = [];
+ else
+ {
+ obj = rename(obj, cb);
+ res = {};
+ }
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
var val = obj[key];
- if (typeOf(val) === 'object') {
+ if (typeOf(val) === 'object' || typeOf(val) === 'array') {
res[key] = renameDeep(val, cb);
} else {
res[key] = val; | Objects nested in Arrays are processed | jonschlinkert_deep-rename-keys | train | js |
439eab2f5197f6c5ed9304c94a04f3c0b6194871 | diff --git a/bundles/org.eclipse.orion.client.editor/web/examples/textview/textStylerOptions.js b/bundles/org.eclipse.orion.client.editor/web/examples/textview/textStylerOptions.js
index <HASH>..<HASH> 100644
--- a/bundles/org.eclipse.orion.client.editor/web/examples/textview/textStylerOptions.js
+++ b/bundles/org.eclipse.orion.client.editor/web/examples/textview/textStylerOptions.js
@@ -131,10 +131,8 @@ define("examples/textview/textStylerOptions", ['orion/bootstrap', 'orion/textvie
if (className) {
var color = elements[settingName];
- var weight = elements['fontWeight'];
result.push("." + theme + " ." + className + " {");
result.push("\tcolor: " + color + ";");
- result.push("\tfont-weight: " + weight + ";");
result.push("}");
}
} | Bug <I> - retaining default font weight for keywords after theming | eclipse_orion.client | train | js |
a23c832f3f0becf96d51bfc1fb071d5a2350a177 | diff --git a/src/org/parosproxy/paros/control/Control.java b/src/org/parosproxy/paros/control/Control.java
index <HASH>..<HASH> 100644
--- a/src/org/parosproxy/paros/control/Control.java
+++ b/src/org/parosproxy/paros/control/Control.java
@@ -40,11 +40,9 @@ import org.zaproxy.zap.extension.brk.ExtensionBreak;
import org.zaproxy.zap.extension.compare.ExtensionCompare;
import org.zaproxy.zap.extension.encoder2.ExtensionEncoder2;
import org.zaproxy.zap.extension.help.ExtensionHelp;
-import org.zaproxy.zap.extension.params.ExtensionParams;
import org.zaproxy.zap.extension.portscan.ExtensionPortScan;
import org.zaproxy.zap.extension.pscan.ExtensionPassiveScan;
import org.zaproxy.zap.extension.search.ExtensionSearch;
-import org.zaproxy.zap.extension.test.ExtensionTest;
/** | Corrected imports to fix issue 8, reported by duartejcsilva. | zaproxy_zaproxy | train | java |
3a928ee353f957d0c24e2ff4d946c006ba09860f | diff --git a/src/server/pachyderm_test.go b/src/server/pachyderm_test.go
index <HASH>..<HASH> 100644
--- a/src/server/pachyderm_test.go
+++ b/src/server/pachyderm_test.go
@@ -3796,6 +3796,12 @@ func TestLazyPipeline(t *testing.T) {
require.NoError(t, err)
_, err = c.PutFile(dataRepo, "master", "file", strings.NewReader("foo\n"))
require.NoError(t, err)
+ // We put 2 files, 1 of which will never be touched by the pipeline code.
+ // This is an important part of the correctness of this test because the
+ // job-shim sets up a goro for each pipe, pipes that are never opened will
+ // leak but that shouldn't prevent the job from completing.
+ _, err = c.PutFile(dataRepo, "master", "file2", strings.NewReader("foo\n"))
+ require.NoError(t, err)
require.NoError(t, c.FinishCommit(dataRepo, "master"))
commitInfos, err := c.FlushCommit([]*pfsclient.Commit{commit}, nil)
require.NoError(t, err) | Makes TestLazyPipeline slightly harder. | pachyderm_pachyderm | train | go |
b4637f2eab37e2fcbbf7b637af4500c948f5257e | diff --git a/lib/dump_rake.rb b/lib/dump_rake.rb
index <HASH>..<HASH> 100644
--- a/lib/dump_rake.rb
+++ b/lib/dump_rake.rb
@@ -63,6 +63,10 @@ class DumpRake
end
def self.cleanup(options = {})
+ unless options[:leave].nil? || /^\d+$/ === options[:leave] || options[:leave].downcase == 'none'
+ raise 'LEAVE should be number or "none"'
+ end
+
to_delete = []
all_dumps = Dump.list(options.merge(:all => true)) | complain if LEAVE is not none and is not a number | toy_dump | train | rb |
6af7c0d093e0b51149a773092be1d3197cf465d8 | diff --git a/test/custom_sharding.py b/test/custom_sharding.py
index <HASH>..<HASH> 100755
--- a/test/custom_sharding.py
+++ b/test/custom_sharding.py
@@ -123,6 +123,10 @@ primary key (id)
utils.run_vtctl(['ApplySchema', '-sql=' + sql, 'test_keyspace'],
auto_log=True)
+ # reload schema everywhere so the QueryService knows about the tables
+ for t in [shard_0_master, shard_0_rdonly]:
+ utils.run_vtctl(['ReloadSchema', t.tablet_alias], auto_log=True)
+
# insert data on shard 0
self._insert_data('0', 100, 10) | Removing one source of flakiness in this test. | vitessio_vitess | train | py |
65e1c38b9e0ef1a765598bb4276e1df1436392ea | diff --git a/owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/model/EntityType.java b/owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/model/EntityType.java
index <HASH>..<HASH> 100644
--- a/owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/model/EntityType.java
+++ b/owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/model/EntityType.java
@@ -61,8 +61,6 @@ import static org.semanticweb.owlapi.vocab.OWLRDFVocabulary.RDFS_DATATYPE;
@SuppressWarnings("javadoc")
public final class EntityType<E extends OWLEntity> implements Serializable {
- private static final long serialVersionUID = 30402L;
-
/**
* class entity
*/ | Removed serialVersionUID which is not needed here | matthewhorridge_owlapi-gwt | train | java |
d167490113d7e1d5bdb6d72cbacaded70ed28bc4 | diff --git a/agent.go b/agent.go
index <HASH>..<HASH> 100644
--- a/agent.go
+++ b/agent.go
@@ -411,21 +411,18 @@ func (s *sandbox) unsetAndRemoveSandboxStorage(path string) error {
span.SetTag("path", path)
defer span.Finish()
- if _, ok := s.storages[path]; ok {
- removeSbs, err := s.unSetSandboxStorage(path)
- if err != nil {
- return err
- }
+ removeSbs, err := s.unSetSandboxStorage(path)
+ if err != nil {
+ return err
+ }
- if removeSbs {
- if err := s.removeSandboxStorage(path); err != nil {
- return err
- }
+ if removeSbs {
+ if err := s.removeSandboxStorage(path); err != nil {
+ return err
}
-
- return nil
}
- return grpcStatus.Errorf(codes.NotFound, "Sandbox storage with path %s not found", path)
+
+ return nil
}
func (s *sandbox) getContainer(id string) (*container, error) { | sandbox: Remove redundant check
Remove the check in `unsetAndRemoveSandboxStorage()`; that exact check
is performed by the called function `unSetSandboxStorage()`. | kata-containers_agent | train | go |
73857db43c2ada7774b758298fb6c1ce5d8a4878 | diff --git a/lib/arjdbc/jdbc/adapter.rb b/lib/arjdbc/jdbc/adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/arjdbc/jdbc/adapter.rb
+++ b/lib/arjdbc/jdbc/adapter.rb
@@ -271,6 +271,12 @@ module ActiveRecord
def select(*args)
execute(*args)
end
+
+ def translate_exception(e, message)
+ puts e.backtrace if $DEBUG || ENV['DEBUG']
+ super
+ end
+ protected :translate_exception
end
end
end
diff --git a/test/jdbc_common.rb b/test/jdbc_common.rb
index <HASH>..<HASH> 100644
--- a/test/jdbc_common.rb
+++ b/test/jdbc_common.rb
@@ -20,6 +20,6 @@ require 'helper'
require 'test/unit'
# Comment/uncomment to enable logging to be loaded for any of the database adapters
-# require 'db/logger'
+require 'db/logger' if $DEBUG || ENV['DEBUG'] | Dump more info (logging, exception backtraces) when $DEBUG or ENV['DEBUG'] set | jruby_activerecord-jdbc-adapter | train | rb,rb |
28ddebd06242f0cdaa78ae5e353e98c6faaac1fa | diff --git a/test/main.js b/test/main.js
index <HASH>..<HASH> 100644
--- a/test/main.js
+++ b/test/main.js
@@ -126,6 +126,7 @@ describe('gulp-browserify', function() {
B.once('data', function(fakeFile) {
should.exist(fakeFile);
should.exist(fakeFile.contents);
+ done();
}).on('postbundle', function(data) {
String(data).should.equal(fs.readFileSync('test/expected/normal.js', 'utf8'));
}); | this should fix the multiple callbacks | deepak1556_gulp-browserify | train | js |
d8dcaa595e72eca5b0e37c1208aead209bc9e06f | diff --git a/db_upgrade.py b/db_upgrade.py
index <HASH>..<HASH> 100644
--- a/db_upgrade.py
+++ b/db_upgrade.py
@@ -59,7 +59,7 @@ def doPostgreSQLUpgrade(db_conn, nonce_table_name='oid_nonces'):
"""%nonce_table_name
cur.execute(sql)
cur.close()
- conn.commit()
+ db_conn.commit() | [project @ conn -> db_conn again] | openid_python-openid | train | py |
615c9a34eff87562e725edbe9a030ab1a3d25e82 | diff --git a/templates/element/customThemeStyleSheet.php b/templates/element/customThemeStyleSheet.php
index <HASH>..<HASH> 100644
--- a/templates/element/customThemeStyleSheet.php
+++ b/templates/element/customThemeStyleSheet.php
@@ -20,12 +20,16 @@ use Cake\Core\Configure;
<style>
::selection {
- background: <?php echo Configure::read('app.customThemeMainColor'); ?>; /* WebKit/Blink Browsers */
+ background: <?php echo Configure::read('app.customThemeMainColor'); ?>;
color: #fff;
}
- ::-moz-selection {
- background: <?php echo Configure::read('app.customThemeMainColor'); ?>; /* Gecko Browsers */
- color: #fff;
+
+ h2.info::selection,
+ h2.info b::selection,
+ #flashMessage.success::selection,
+ #flashMessage.success b::selection {
+ background-color: #fff;
+ color: #000;
}
.box h3, | css selection was not visible if background is same color as selection | foodcoopshop_foodcoopshop | train | php |
2a7abb8ea08b3cf26c21954ab4354ede666d283f | diff --git a/src/Symfony/Components/DependencyInjection/Builder.php b/src/Symfony/Components/DependencyInjection/Builder.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Components/DependencyInjection/Builder.php
+++ b/src/Symfony/Components/DependencyInjection/Builder.php
@@ -440,11 +440,11 @@ class Builder extends Container
}
else
{
- $replaceParameter = function ($match) use ($parameters)
+ $replaceParameter = function ($match) use ($parameters, $value)
{
if (!array_key_exists($name = strtolower($match[2]), $parameters))
{
- throw new \RuntimeException(sprintf('The parameter "%s" must be defined.', $name));
+ throw new \RuntimeException(sprintf('The parameter "%s" must be defined (used in the following expression: "%s").', $name, $value));
}
return $parameters[$name]; | [DependencyInjection] tweaked an error message to ease debugging | symfony_symfony | train | php |
4cfefdab2beb8b821f70e2568ab5220c20af3407 | diff --git a/ginga/web/pgw/ipg.py b/ginga/web/pgw/ipg.py
index <HASH>..<HASH> 100644
--- a/ginga/web/pgw/ipg.py
+++ b/ginga/web/pgw/ipg.py
@@ -397,9 +397,12 @@ class WebServer(object):
self.http_server = None
self.server = None
- def get_viewer(self, v_id):
+ def get_viewer(self, v_id, viewer_class=None, width=512, height=512,
+ force_new=False):
from IPython.display import display, HTML
- v = self.factory.get_viewer(v_id)
+ v = self.factory.get_viewer(v_id, viewer_class=viewer_class,
+ width=width, height=height,
+ force_new=force_new)
url = v.top.url
viewer = v.fitsimage
viewer.url = url | Added force_new kwarg to get_viewer() method
- API allows user to force a viewer to be recreated instead of using
a cached one | ejeschke_ginga | train | py |
e6f5079a48094eeba3dab9dca52b16b58ddc3634 | diff --git a/actionpack/test/controller/action_pack_assertions_test.rb b/actionpack/test/controller/action_pack_assertions_test.rb
index <HASH>..<HASH> 100644
--- a/actionpack/test/controller/action_pack_assertions_test.rb
+++ b/actionpack/test/controller/action_pack_assertions_test.rb
@@ -131,6 +131,10 @@ class AssertResponseWithUnexpectedErrorController < ActionController::Base
def index
raise 'FAIL'
end
+
+ def show
+ render :text => "Boom", :status => 500
+ end
end
module Admin
@@ -483,6 +487,16 @@ class ActionPackAssertionsControllerTest < Test::Unit::TestCase
rescue Test::Unit::AssertionFailedError => e
assert e.message.include?('FAIL')
end
+
+ def test_assert_response_failure_response_with_no_exception
+ @controller = AssertResponseWithUnexpectedErrorController.new
+ get :show
+ assert_response :success
+ flunk 'Expected non-success response'
+ rescue Test::Unit::AssertionFailedError
+ rescue
+ flunk "assert_response failed to handle failure response with missing, but optional, exception."
+ end
end
class ActionPackHeaderTest < Test::Unit::TestCase | Test for assert_response for failure response without an exception. [#<I> state:resolved] | rails_rails | train | rb |
ef377565dcdad47e1b1d54c34ad3be85424b0601 | diff --git a/script-base.js b/script-base.js
index <HASH>..<HASH> 100644
--- a/script-base.js
+++ b/script-base.js
@@ -19,6 +19,7 @@ var Generator = module.exports = function Generator() {
this.scriptAppName = this._.camelize(this._.capitalize(this.appname)) + generalUtils.appName(this);
this.classedFileName = this._.capitalizeFile(this.name);
this.classedName = this._.capitalizeClass(this.name);
+ this.stylesLanguage = this.config.get('styles-language');
if (typeof this.options.appPath === 'undefined') {
this.options.appPath = this.options.appPath || 'src/scripts';
@@ -38,7 +39,7 @@ var Generator = module.exports = function Generator() {
this.stylesSuffix = '.css';
- switch(this.config.get('styles-language')) {
+ switch(this.stylesLanguage) {
case 'sass':
this.stylesSuffix = '.sass';
break; | Proxy stylesLanguage to component subgenerator | react-webpack-generators_generator-react-webpack | train | js |
9c2d1632f4009355488021a86938008e2c2e2e5e | diff --git a/gcsproxy/listing_proxy_test.go b/gcsproxy/listing_proxy_test.go
index <HASH>..<HASH> 100644
--- a/gcsproxy/listing_proxy_test.go
+++ b/gcsproxy/listing_proxy_test.go
@@ -801,7 +801,26 @@ func (t *ListingProxyTest) NoteRemoval_ListingRequired_NoConflict() {
}
func (t *ListingProxyTest) NoteRemoval_ListingRequired_Conflict() {
- AssertTrue(false, "TODO")
+ var err error
+ name := t.dirName + "foo/"
+
+ // Note a removal.
+ err = t.lp.NoteRemoval(name)
+ AssertEq(nil, err)
+
+ // Simulate a successful listing from GCS containing the name.
+ listing := &storage.Objects{
+ Prefixes: []string{name},
+ }
+
+ ExpectCall(t.bucket, "ListObjects")(Any(), Any()).
+ WillOnce(oglemock.Return(listing, nil))
+
+ _, subdirs, err := t.lp.List()
+ AssertEq(nil, err)
+
+ // There should be no results.
+ ExpectThat(subdirs, ElementsAre())
}
func (t *ListingProxyTest) NoteRemoval_PrevListingConflicts() { | ListingProxyTest.NoteRemoval_ListingRequired_Conflict | jacobsa_timeutil | train | go |
886f239fda80f1c6d45dab39b51adb1ac4752e04 | diff --git a/deliver/lib/deliver/detect_values.rb b/deliver/lib/deliver/detect_values.rb
index <HASH>..<HASH> 100644
--- a/deliver/lib/deliver/detect_values.rb
+++ b/deliver/lib/deliver/detect_values.rb
@@ -62,7 +62,7 @@ module Deliver
if options[:ipa]
options[:platform] ||= FastlaneCore::IpaFileAnalyser.fetch_app_platform(options[:ipa])
elsif options[:pkg]
- options[:platform] = 'mac'
+ options[:platform] = 'osx'
end
end
end | platform bug (#<I>) | fastlane_fastlane | train | rb |
16a732021cb6f07c6809d280bc04833cf073edd6 | diff --git a/hazelcast/src/main/java/com/hazelcast/map/tx/TxnSetOperation.java b/hazelcast/src/main/java/com/hazelcast/map/tx/TxnSetOperation.java
index <HASH>..<HASH> 100644
--- a/hazelcast/src/main/java/com/hazelcast/map/tx/TxnSetOperation.java
+++ b/hazelcast/src/main/java/com/hazelcast/map/tx/TxnSetOperation.java
@@ -64,8 +64,8 @@ public class TxnSetOperation extends BasePutOperation implements MapTxnOperation
if (record == null || version == record.getVersion()){
recordStore.set(dataKey, dataValue, ttl);
shouldBackup = true;
+ eventType = (record == null ? EntryEventType.ADDED : EntryEventType.UPDATED);
}
- eventType = (record == null ? EntryEventType.ADDED : EntryEventType.UPDATED);
}
public long getVersion() { | fire update event after updates in txn. fix | hazelcast_hazelcast | train | java |
7eb588591d1cf500a8363ab5b18e82b9a7ebd0e6 | diff --git a/src/main/java/net/joelinn/quartz/jobstore/RedisJobStore.java b/src/main/java/net/joelinn/quartz/jobstore/RedisJobStore.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/joelinn/quartz/jobstore/RedisJobStore.java
+++ b/src/main/java/net/joelinn/quartz/jobstore/RedisJobStore.java
@@ -139,6 +139,8 @@ public class RedisJobStore implements JobStore {
.addMixIn(HolidayCalendar.class, HolidayCalendarMixin.class)
.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+ mapper.setTypeFactory(mapper.getTypeFactory().withClassLoader(loadHelper.getClassLoader()));
+
if (redisCluster && jedisCluster == null) {
Set<HostAndPort> nodes = buildNodesSetFromHost();
JedisPoolConfig jedisPoolConfig = new JedisPoolConfig(); | Use classloader specified by the ClassLoadHelper
Tell the ObjectMapper to use the ClassLoad specified in the
ClassLoadHelper. This allows jobs to be written in Clojure for example
by telling Quartz to use a custom ClassLoadHelper and to use Clojure's
DynamicClassLoader. | jlinn_quartz-redis-jobstore | train | java |
4f3a99179a79fa15bc9a6c3ee65a0778f91b5855 | diff --git a/src/Assetic/Filter/ScssphpFilter.php b/src/Assetic/Filter/ScssphpFilter.php
index <HASH>..<HASH> 100644
--- a/src/Assetic/Filter/ScssphpFilter.php
+++ b/src/Assetic/Filter/ScssphpFilter.php
@@ -14,6 +14,7 @@ namespace Assetic\Filter;
use Assetic\Asset\AssetInterface;
use Assetic\Factory\AssetFactory;
use Assetic\Util\CssUtils;
+use Leafo\ScssPhp\Compiler;
/**
* Loads SCSS files using the PHP implementation of scss, scssphp.
@@ -46,7 +47,7 @@ class ScssphpFilter implements DependencyExtractorInterface
public function filterLoad(AssetInterface $asset)
{
- $sc = new \scssc();
+ $sc = new Compiler();
if ($this->compass) {
new \scss_compass($sc);
}
@@ -95,7 +96,7 @@ class ScssphpFilter implements DependencyExtractorInterface
public function getChildren(AssetFactory $factory, $content, $loadPath = null)
{
- $sc = new \scssc();
+ $sc = new Compiler();
$sc->addImportPath($loadPath);
foreach($this->importPaths as $path) {
$sc->addImportPath($path); | Update ScssPhpFilter.php
Class replacement for new ScssPhp structure | kriswallsmith_assetic | train | php |
26c0c62a628fb1e1033a529969df333b5ac77c46 | diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -50,7 +50,7 @@ var outputFileMin = join(buildDir,outputFile + ".min.js");
var packageConfig = require('./package.json');
// a failing test breaks the whole build chain
-gulp.task('build', ['build-browser', 'build-browser-gzip']);
+gulp.task('build', ['babel', 'build-browser', 'build-browser-gzip']);
gulp.task('default', ['lint','test', 'build']); | Add babel task to gulp build | molbiodiv_biojs-io-biom | train | js |
0032faef133249b333da095e55fe3889f799fdd7 | diff --git a/src/GitElephant/Objects/Diff/DiffChunkLineAdded.php b/src/GitElephant/Objects/Diff/DiffChunkLineAdded.php
index <HASH>..<HASH> 100644
--- a/src/GitElephant/Objects/Diff/DiffChunkLineAdded.php
+++ b/src/GitElephant/Objects/Diff/DiffChunkLineAdded.php
@@ -36,4 +36,14 @@ class DiffChunkLineAdded extends DiffChunkLineChanged
$this->setContent($content);
$this->setType(self::ADDED);
}
+
+ /**
+ * Get destination line number
+ *
+ * @return int
+ */
+ public function getOriginNumber()
+ {
+ return '';
+ }
} | getOriginNumber of an added line is always empty | matteosister_GitElephant | train | php |
dfd234c720a4dbc60e2262ab596a9ed3babc83b6 | diff --git a/keanu-project/src/main/java/io/improbable/keanu/distributions/hyperparam/Diffs.java b/keanu-project/src/main/java/io/improbable/keanu/distributions/hyperparam/Diffs.java
index <HASH>..<HASH> 100644
--- a/keanu-project/src/main/java/io/improbable/keanu/distributions/hyperparam/Diffs.java
+++ b/keanu-project/src/main/java/io/improbable/keanu/distributions/hyperparam/Diffs.java
@@ -20,8 +20,6 @@ public class Diffs {
public static final ParameterName SIGMA = new ParameterName("SIGMA");
public static final ParameterName THETA = new ParameterName("THETA");
public static final ParameterName LAMBDA = new ParameterName("LAMBDA");
- public static final ParameterName LEFT = new ParameterName("LEFT");
- public static final ParameterName RIGHT = new ParameterName("RIGHT");
private final TreeSet<Diff> diffs = Sets.newTreeSet(); | Remove unnecessary params from diffs | improbable-research_keanu | train | java |
68e5e9303245053c73c7b8ddf4a7416ec48c8507 | diff --git a/lib/config-to-webpack.js b/lib/config-to-webpack.js
index <HASH>..<HASH> 100644
--- a/lib/config-to-webpack.js
+++ b/lib/config-to-webpack.js
@@ -9,13 +9,19 @@ module.exports = function(config) {
var vendorChunk = 'vendors';
var context = path.resolve(config.client.app.path);
if (_.isString(config.client.app.buildPattern)) {
- config.client.app.buildPattern = [{
- pattern: config.client.app.buildPattern,
- splitVendor: true
- }];
+ config.client.app.buildPattern = [
+ config.client.app.buildPattern
+ ];
}
var entries = _.reduce(config.client.app.buildPattern, function(memo, ruleSet) {
+ if (_.isString(ruleSet)) {
+ ruleSet = {
+ pattern: ruleSet,
+ splitVendor: true
+ };
+ }
+
_.forEach(glob.sync(ruleSet.pattern), function(file) {
var filename = path.parse(file).name; | feat(webpack): buildPattern can also be a list of strings | emartech_boar-tasks-client | train | js |
4ecd75ca483157dc84ed81b315a7e46ca5faf985 | diff --git a/lib/components/user/notification-prefs-pane.js b/lib/components/user/notification-prefs-pane.js
index <HASH>..<HASH> 100644
--- a/lib/components/user/notification-prefs-pane.js
+++ b/lib/components/user/notification-prefs-pane.js
@@ -368,6 +368,7 @@ class PhoneNumberEditor extends Component {
<p>
Please check the SMS messaging app on your mobile phone
for a text message with a verification code, and enter the code below.
+ The verification code expires after 10 minutes.
</p>
<ControlLabel>Verification code:</ControlLabel>
<ControlStrip> | refactor(PhoneNumberEditor): Mention code expiration in SMS instructions. | opentripplanner_otp-react-redux | train | js |
b4aa48fb72fe44140efad75133b9bc8f0f67b56e | diff --git a/pandas/tests/indexes/multi/test_reindex.py b/pandas/tests/indexes/multi/test_reindex.py
index <HASH>..<HASH> 100644
--- a/pandas/tests/indexes/multi/test_reindex.py
+++ b/pandas/tests/indexes/multi/test_reindex.py
@@ -133,3 +133,31 @@ def test_reindex_not_all_tuples():
tm.assert_index_equal(res, idx)
expected = np.array([0, 1, 2, -1], dtype=np.intp)
tm.assert_numpy_array_equal(indexer, expected)
+
+
+def test_reindex_limit_arg_with_multiindex():
+ # GH21247
+
+ idx = MultiIndex.from_tuples([(3, "A"), (4, "A"), (4, "B")])
+
+ df = pd.Series([0.02, 0.01, 0.012], index=idx)
+
+ new_idx = MultiIndex.from_tuples(
+ [
+ (3, "A"),
+ (3, "B"),
+ (4, "A"),
+ (4, "B"),
+ (4, "C"),
+ (5, "B"),
+ (5, "C"),
+ (6, "B"),
+ (6, "C"),
+ ]
+ )
+
+ with pytest.raises(
+ ValueError,
+ match="limit argument only valid if doing pad, backfill or nearest reindexing",
+ ):
+ df.reindex(new_idx, fill_value=0, limit=1) | TST: Test reindex w/ multiindex df (GH<I>) (#<I>) | pandas-dev_pandas | train | py |
99dbd74d0866532ac466bc633f2cf4d2e932b09e | diff --git a/lib/codemirror.js b/lib/codemirror.js
index <HASH>..<HASH> 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -2613,7 +2613,7 @@
e_preventDefault(e);
var ourRange, ourIndex, startSel = doc.sel;
- if (addNew) {
+ if (addNew && !e.shiftKey) {
ourIndex = doc.sel.contains(start);
if (ourIndex > -1)
ourRange = doc.sel.ranges[ourIndex]; | Make shift-ctrl-click extend the primary selection
Issue #<I> | codemirror_CodeMirror | train | js |
9d960e68cada4fc10dfa1cdfb6132649cdadf67e | diff --git a/core/src/main/java/hudson/ClassicPluginStrategy.java b/core/src/main/java/hudson/ClassicPluginStrategy.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/hudson/ClassicPluginStrategy.java
+++ b/core/src/main/java/hudson/ClassicPluginStrategy.java
@@ -70,6 +70,7 @@ import java.util.jar.JarFile;
import java.util.jar.Manifest;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.jenkinsci.bytecode.Transformer;
public class ClassicPluginStrategy implements PluginStrategy {
@@ -696,8 +697,7 @@ public class ClassicPluginStrategy implements PluginStrategy {
}
/**
- * {@link AntClassLoader} with a few methods exposed and {@link Closeable} support.
- * Deprecated as of Java 7, retained only for Java 6.
+ * {@link AntClassLoader} with a few methods exposed, {@link Closeable} support, and {@link Transformer} support.
*/
private final class AntClassLoader2 extends AntClassLoader implements Closeable {
private final Vector pathComponents; | Updated Javadoc of AntClassLoader2. | jenkinsci_jenkins | train | java |
ca2fd3194c101c82250d40edaf5b02d03f80a15d | diff --git a/hererocks.py b/hererocks.py
index <HASH>..<HASH> 100755
--- a/hererocks.py
+++ b/hererocks.py
@@ -1437,7 +1437,7 @@ class RioLua(Lua):
# from a git repo that does not have them, like the default one.
if len(built_luac_objs) > 0:
if using_cl():
- run("link", "/nologo", "/out:luac.exe", built_luac_objs, [lib_obj for lib_obj in lib_objs if lib_obj != "lopcodes.obj"])
+ run("link", "/nologo", "/out:luac.exe", built_luac_objs, lib_objs)
if os.path.exists("luac.exe.manifest"):
run("mt", "/nologo", "-manifest", "luac.exe.manifest", "-outputresource:luac.exe") | Revert incorrect fix for the Lua <I>-work2 VS problem | mpeterv_hererocks | train | py |
22a2b3def3a15a5a03e0a5bd4dc681504a0ca296 | diff --git a/mkdocs_macros/plugin.py b/mkdocs_macros/plugin.py
index <HASH>..<HASH> 100644
--- a/mkdocs_macros/plugin.py
+++ b/mkdocs_macros/plugin.py
@@ -296,7 +296,7 @@ class MacrosPlugin(BasePlugin):
The python module must contain the following hook:
- declare_env(env):
+ define_env(env):
"Declare environment for jinja2 templates for markdown"
env.variables['a'] = 5
@@ -588,4 +588,4 @@ class MacrosPlugin(BasePlugin):
"""
# exeute the functions in the various modules
for func in self.post_build_functions:
- func(self)
\ No newline at end of file
+ func(self) | Fixed docstring. Function actually expects define_env, not declare_env. | fralau_mkdocs_macros_plugin | train | py |
89e833a145a6d585eabdf881809f1a99f217239a | diff --git a/packages/docs/build/markdown-it.js b/packages/docs/build/markdown-it.js
index <HASH>..<HASH> 100644
--- a/packages/docs/build/markdown-it.js
+++ b/packages/docs/build/markdown-it.js
@@ -11,12 +11,16 @@ const md = require('markdown-it')({
permalinkSymbol: '',
permalinkClass: '',
slugify: str => {
- const slug = String(str)
+ let slug = String(str)
.trim()
.toLowerCase()
- .replace(/[^a-z0-9 -]/g, '')
+ .replace(/[^a-z0-9 -]/g, c => c.charCodeAt(0).toString(16))
.replace(/\s+/g, '-')
+ if (slug.charAt(0).match(/[^a-z]/g)) {
+ slug = 'section-' + slug
+ }
+
return encodeURIComponent(slug)
},
}) | fix(docs): fix anchors in non-latin translations (#<I>) | vuetifyjs_vuetify | train | js |
804f2c17a9a4868f1b2b608a7bb0aed8a11e3a23 | diff --git a/src/Controller/AppController.php b/src/Controller/AppController.php
index <HASH>..<HASH> 100644
--- a/src/Controller/AppController.php
+++ b/src/Controller/AppController.php
@@ -5,6 +5,7 @@ namespace App\Controller;
use Cake\Controller\Controller;
use Cake\Core\Configure;
use Cake\Event\EventInterface;
+use Cake\Http\Cookie\Cookie;
use Cake\ORM\TableRegistry;
/**
@@ -78,8 +79,6 @@ class AppController extends Controller
{
parent::beforeRender($event);
$this->set('appAuth', $this->AppAuth);
- $loggedUser = $this->AppAuth->user();
- $this->set('loggedUser', $loggedUser['firstname'] . ' ' . $loggedUser['lastname']);
}
/**
@@ -99,6 +98,7 @@ class AppController extends Controller
if (empty($query->first())) {
$this->Flash->error(__('You_have_been_signed_out.'));
$this->AppAuth->logout();
+ $this->response = $this->response->withCookie((new Cookie('remember_me')));
$this->redirect(Configure::read('app.slugHelper')->getHome());
}
} | remove cookie if user is not validated | foodcoopshop_foodcoopshop | train | php |
a07f4584d92c47d9af52b35d4bb1a43c5e0ca51b | diff --git a/src/Google/IO/Curl.php b/src/Google/IO/Curl.php
index <HASH>..<HASH> 100644
--- a/src/Google/IO/Curl.php
+++ b/src/Google/IO/Curl.php
@@ -73,8 +73,11 @@ class Google_IO_Curl extends Google_IO_Abstract
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
- // 1 is CURL_SSLVERSION_TLSv1, which is not always defined in PHP.
- curl_setopt($curl, CURLOPT_SSLVERSION, 1);
+
+ // The SSL version will be determined by the underlying library
+ // @see https://github.com/google/google-api-php-client/pull/644
+ //curl_setopt($curl, CURLOPT_SSLVERSION, 1);
+
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, true); | * Leave the unrelying curl library decide what SSL version to use. As discussed in case #<I>. | googleapis_google-api-php-client | train | php |
077a822bc0e856f8f76a51a9c1351bad355f9c8c | diff --git a/tests/scripts/config/karma.browserstack.conf.js b/tests/scripts/config/karma.browserstack.conf.js
index <HASH>..<HASH> 100644
--- a/tests/scripts/config/karma.browserstack.conf.js
+++ b/tests/scripts/config/karma.browserstack.conf.js
@@ -21,6 +21,12 @@ module.exports = function(config) {
os: 'OS X',
os_version: 'Sierra'
},
+ chrome_windows: {
+ base: 'BrowserStack',
+ browser: 'chrome',
+ os: 'Windows',
+ os_version: '10'
+ },
edge_windows: {
base: 'BrowserStack',
browser: 'Edge',
@@ -29,6 +35,6 @@ module.exports = function(config) {
}
},
- browsers: ['safari_mac', 'firefox_mac', 'chrome_mac', 'edge_windows']
+ browsers: ['safari_mac', 'firefox_mac', 'chrome_mac', 'chrome_windows', 'edge_windows']
}));
}; | Add chrome for windows to browser test list | weepower_wee-core | train | js |
788ec08c4f3e53b1f3dbaa40c19a0a71c21cdf42 | diff --git a/horizon/workflows/base.py b/horizon/workflows/base.py
index <HASH>..<HASH> 100644
--- a/horizon/workflows/base.py
+++ b/horizon/workflows/base.py
@@ -438,11 +438,7 @@ class Step(object):
def has_required_fields(self):
"""Returns True if action contains any required fields."""
- for key in self.contributes:
- field = self.action.fields.get(key, None)
- if (field and field.required):
- return True
- return False
+ return any(field.required for field in self.action.fields.values())
class WorkflowMetaclass(type): | Bad workflow-steps check: has_required_fields
Many of the tabs on the Instance Creation screen don't show a "*"
despite having require fields. This is due to faulty logic in determining
whether the workflow-step has require fields. (Previously, only keys from
the contributes list were checked.)
Change-Id: Id<I>da<I>c<I>f8d<I>d7fd<I>ead0c3bb<I>
Closes-Bug: <I> | openstack_horizon | train | py |
c9fa7a3265792d44f1b43309165b7a3e1dff9961 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -28,7 +28,7 @@ setup(
long_description=__doc__,
install_requires=reqs,
packages=['parker'],
- scripts=['bin/parker-clean', 'bin/parker-crawl']
+ scripts=['bin/parker-clean', 'bin/parker-crawl'],
data_files=[
('/etc/parker', [
'etc/parker/client.json', | Minor syntax error in setup. Add that comma. | nefarioustim_parker | train | py |
a952464c8104a9d76833afd29e021d0afdb8f539 | diff --git a/src/render.js b/src/render.js
index <HASH>..<HASH> 100644
--- a/src/render.js
+++ b/src/render.js
@@ -43,14 +43,21 @@ function render(element, screen) {
const id = ReactInstanceHandles.createReactRootID();
// Mounting the app
- const transaction = ReactUpdates.ReactReconcileTransaction.getPooled(),
- component = instantiateReactComponent(element);
+ const component = instantiateReactComponent(element);
// Injecting the screen
ReactBlessedIDOperations.setScreen(screen);
- transaction.perform(() => {
- component.mountComponent(id, transaction, {});
+ // The initial render is synchronous but any updates that happen during
+ // rendering, in componentWillMount or componentDidMount, will be batched
+ // according to the current batching strategy.
+ ReactUpdates.batchedUpdates(() => {
+ // Batched mount component
+ const transaction = ReactUpdates.ReactReconcileTransaction.getPooled();
+ transaction.perform(() => {
+ component.mountComponent(id, transaction, {});
+ });
+ ReactUpdates.ReactReconcileTransaction.release(transaction);
});
// Returning the screen so the user can attach listeners etc. | Fixed a nasty bug with initial render not being batched | Yomguithereal_react-blessed | train | js |
f6b2dd9cfd77fc849bd3636ab9bee2f126f72efc | diff --git a/compaction_filter.go b/compaction_filter.go
index <HASH>..<HASH> 100644
--- a/compaction_filter.go
+++ b/compaction_filter.go
@@ -26,8 +26,8 @@ type CompactionFilter interface {
}
// NewNativeCompactionFilter creates a CompactionFilter object.
-func NewNativeCompactionFilter(c *C.rocksdb_comparator_t) Comparator {
- return nativeComparator{c}
+func NewNativeCompactionFilter(c *C.rocksdb_compactionfilter_t) CompactionFilter {
+ return nativeCompactionFilter{c}
}
type nativeCompactionFilter struct { | return a CompactionFilter instead of a Comparator in NewNativeCompactionFilter
Fixes #<I> | tecbot_gorocksdb | train | go |
ff435340f13b1147efeff77af17f0e698dcd165e | diff --git a/lib/minimalist/test_helper.rb b/lib/minimalist/test_helper.rb
index <HASH>..<HASH> 100644
--- a/lib/minimalist/test_helper.rb
+++ b/lib/minimalist/test_helper.rb
@@ -4,5 +4,9 @@ module Minimalist
def login_as(user)
@request.session[:user_id] = user ? users(user).id : nil
end
+
+ def current_user
+ @current_user ||= User.find(@request.session[:user_id])
+ end
end
end
\ No newline at end of file | add current_user method to test helper for helper tests | wwidea_minimalist_authentication | train | rb |
f9de096f6d1a58d6ca25d08e85697a0b61a3370c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -17,7 +17,7 @@ setup(
packages=['internetarchive'],
entry_points = dict(
console_scripts = [
- 'internetarchive = bin.archive:main',
+ 'internetarchive = bin.internetarchive_cli:main',
]
),
url='https://github.com/jjjake/ia-wrapper', | Renamed bin/archive.py to bin/internetarchive_cli.py, reflect these changes in setup.py | jjjake_internetarchive | train | py |
d343483074894b9c2ffb4d0029d5b0a7de62f202 | diff --git a/papermill/execute.py b/papermill/execute.py
index <HASH>..<HASH> 100644
--- a/papermill/execute.py
+++ b/papermill/execute.py
@@ -180,6 +180,7 @@ def parameterize_notebook(nb, parameters, report_mode=False):
after = nb.cells[param_cell_index + 1 :]
else:
# Inject to the top of the notebook
+ logger.warning("Input notebook does not contain a cell with tag 'parameters'")
before = []
after = nb.cells | Log a warning if the input notebook doesn't have
a parameters cell | nteract_papermill | train | py |
998f28209e4e0382a8c4926c03f5437fd62a3646 | diff --git a/ghost/admin/assets/lib/uploader.js b/ghost/admin/assets/lib/uploader.js
index <HASH>..<HASH> 100644
--- a/ghost/admin/assets/lib/uploader.js
+++ b/ghost/admin/assets/lib/uploader.js
@@ -80,7 +80,7 @@
data.submit();
});
},
- dropZone: $dropzone,
+ dropZone: settings.fileStorage ? $dropzone : null,
progressall: function (e, data) {
var progress = parseInt(data.loaded / data.total * 100, 10);
if (!settings.editor) {$progress.find('div.js-progress').css({"position": "absolute", "top": "40px"}); } | Fix for dropzone
no issue
- dropzone is disabled when fileStorage = false | TryGhost_Ghost | train | js |
3c43e87423ca0f0013f4896cf35aa77e652f0c3e | diff --git a/js/directives/form.js b/js/directives/form.js
index <HASH>..<HASH> 100644
--- a/js/directives/form.js
+++ b/js/directives/form.js
@@ -597,6 +597,7 @@ formsAngular
unwatch();
var elementHtml = '';
var theRecord = scope[attrs.model || 'record']; // By default data comes from scope.record
+ theRecord = theRecord || {};
if ((attrs.subschema || attrs.model) && !attrs.forceform) {
elementHtml = '';
} else { | Cope with case where scope doesn't create record | forms-angular_forms-angular | train | js |
5ebff12d11ab926a7cb7d113844c22fb1d05de92 | diff --git a/lang/fr/hotpot.php b/lang/fr/hotpot.php
index <HASH>..<HASH> 100755
--- a/lang/fr/hotpot.php
+++ b/lang/fr/hotpot.php
@@ -36,7 +36,11 @@ $string['showxmlsource'] = 'Afficher la source XML';
$string['showxmltree'] = 'Afficher l\'arbre XML';
$string['showhtmlsource'] = 'Afficher la source HTML';
$string['enterafilename'] = 'Veuillez saisir un nom de fichier';
-
+
+ // show.php (javascript messages, so must be double escaped. i.e. "it's" ==> 'it\\\'s' OR "it\\'s")
+$string['copytoclipboard'] = 'Copier dans le presse-papier';
+$string['copiedtoclipboard'] = 'Le contenu de cette page a �t� copi� dans le presse-papier';
+
// lib.php
$string['noactivity'] = 'Aucune activit�';
$string['inprogress'] = 'En cours'; | Javascript messages for Copy to Clipboard in show.php | moodle_moodle | train | php |
2e8d75eb5c5392fc681c6618d33df74e17de8352 | diff --git a/go/libkb/skb.go b/go/libkb/skb.go
index <HASH>..<HASH> 100644
--- a/go/libkb/skb.go
+++ b/go/libkb/skb.go
@@ -263,9 +263,6 @@ func (s *SKB) unverifiedPassphraseStream(lctx LoginContext, passphrase string) (
}
func (s *SKB) UnlockSecretKey(lctx LoginContext, passphrase string, tsec Triplesec, pps *PassphraseStream, secretStorer SecretStorer) (key GenericKey, err error) {
- if key = s.decryptedSecret; key != nil {
- return
- }
var unlocked []byte
switch s.Priv.Encryption {
@@ -306,6 +303,12 @@ func (s *SKB) UnlockSecretKey(lctx LoginContext, passphrase string, tsec Triples
default:
err = BadKeyError{fmt.Sprintf("Can't unlock secret with protection type %d", int(s.Priv.Encryption))}
}
+
+ if key = s.decryptedSecret; key != nil {
+ // Key is already unlocked and unpacked, do not parse again.
+ return
+ }
+
if err == nil {
key, err = s.parseUnlocked(unlocked)
} | UnlockSecretKey: try to decrypt even if already unlocked
UnlockSecretKey had a side effect that it would accept wrong passphrase
(or equivalent Triplesec or PassphraseStream), return cached unlocked
key, and not signal in any way that passphrase was incorrect. | keybase_client | train | go |
22494e125f7c679d9046c379113a7bffb984f553 | diff --git a/build/webpack.prod.js b/build/webpack.prod.js
index <HASH>..<HASH> 100644
--- a/build/webpack.prod.js
+++ b/build/webpack.prod.js
@@ -3,7 +3,6 @@ const webpack = require('webpack');
const VERSION = JSON.stringify(require('../package.json').version);
const root = require('./helpers').root;
-const CopyWebpackPlugin = require('copy-webpack-plugin');
const BANNER =
`ReDoc - OpenAPI/Swagger-generated API Reference Documentation
------------------------------------------------------------- | remove unused import from webpack config | Rebilly_ReDoc | train | js |
8105c57c57dbce8ee1b1bbe99868642ebc6d84fc | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -31,7 +31,7 @@ setup(
name="monolithe",
packages=find_packages(exclude=["*tests*"]),
include_package_data=True,
- version="1.4.0",
+ version="1.4.1",
description="Monolithe is a sdk generator",
author="Nuage Networks",
author_email="opensource@nuagnetworks.net", | Updating version for latest csharp support for nuget | nuagenetworks_monolithe | train | py |
8e33b438c5108fe9625f7390e55f0c51c6e79299 | diff --git a/raiden/api/v1/encoding.py b/raiden/api/v1/encoding.py
index <HASH>..<HASH> 100644
--- a/raiden/api/v1/encoding.py
+++ b/raiden/api/v1/encoding.py
@@ -271,7 +271,7 @@ class ChannelStateSchema(BaseSchema):
@staticmethod
def get_balance(channel_state: NettingChannelState) -> int:
- return channel.get_distributable(channel_state.our_state, channel_state.partner_state)
+ return channel.get_balance(channel_state.our_state, channel_state.partner_state)
@staticmethod
def get_state(channel_state: NettingChannelState) -> str: | Fix calculation if balance field of ChannelStateSchema | raiden-network_raiden | train | py |
987b705e8aff8a3c4dda9b07d9978a8368209d05 | diff --git a/system/Entity.php b/system/Entity.php
index <HASH>..<HASH> 100644
--- a/system/Entity.php
+++ b/system/Entity.php
@@ -588,7 +588,8 @@ class Entity
$tmp = ! is_null($value) ? ($asArray ? [] : new \stdClass) : null;
if (function_exists('json_decode'))
{
- if ((is_string($value) && (strpos($value, '[') === 0 || strpos($value, '{') === 0 || (strpos($value, '"') === 0 && strrpos($value, '"') === 0 ))) || is_numeric($value))
+ $strlen = is_strimg($value) ? strlen($value) : 0;
+ if (($strlen > 1 && is_string($value) && ((strpos($value, '[') === 0 && strrpos($value, ']') === $strlen - 1) || (strpos($value, '{') === 0 && strrpos($value, '}') === $strlen - 1) || (strpos($value, '"') === 0 && strrpos($value, '"') === $strlen - 1))) || is_numeric($value))
{
$tmp = json_decode($value, $asArray); | JSON format checking improved
#<I>
(...) And I thought the correct code was (strpos($value, '"') === 0 && strrpos($value, '"') === strlen($value) - 1 ) (...) | codeigniter4_CodeIgniter4 | train | php |
c22c79a13a8017540d80d088d3b697159a1af729 | diff --git a/ceph_deploy/osd.py b/ceph_deploy/osd.py
index <HASH>..<HASH> 100644
--- a/ceph_deploy/osd.py
+++ b/ceph_deploy/osd.py
@@ -2,6 +2,7 @@ import argparse
import logging
import os
import sys
+from textwrap import dedent
from cStringIO import StringIO
@@ -410,6 +411,21 @@ def make(parser):
"""
Prepare a data disk on remote host.
"""
+ sub_command_help = dedent("""
+ Manage OSDs by preparing a data disk on remote host.
+
+ For paths, first prepare and then activate:
+
+ ceph-deploy osd prepare {osd-node-name}:/path/to/osd
+ ceph-deploy osd activate {osd-node-name}:/path/to/osd
+
+ For disks or journals the `create` command will do prepare and activate
+ for you.
+ """
+ )
+ parser.formatter_class = argparse.RawDescriptionHelpFormatter
+ parser.description = sub_command_help
+
parser.add_argument(
'subcommand',
metavar='SUBCOMMAND',
@@ -471,7 +487,7 @@ def make_disk(parser):
nargs='+',
metavar='HOST:DISK',
type=colon_separated,
- help='host and disk to zap',
+ help='host and disk (or path)',
)
parser.add_argument(
'--zap-disk', | improve osd help by adding example of activation by paths | ceph_ceph-deploy | train | py |
0a91afca905f29230a792748b9adb5333aff610a | diff --git a/js/typed.js b/js/typed.js
index <HASH>..<HASH> 100644
--- a/js/typed.js
+++ b/js/typed.js
@@ -324,7 +324,9 @@
var id = this.el.attr('id');
this.el.after('<span id="' + id + '"/>')
this.el.remove();
- this.cursor.remove();
+ if (typeof this.cursor !== 'undefined') {
+ this.cursor.remove();
+ }
// Send the callback
self.options.resetCallback();
} | Patch: if no cursor were present, the reset function would throw an error. | mattboldt_typed.js | train | js |
712607b3fc6190516b8278e2eebdc4d0c4a4f07e | diff --git a/photos/photos.py b/photos/photos.py
index <HASH>..<HASH> 100644
--- a/photos/photos.py
+++ b/photos/photos.py
@@ -12,6 +12,7 @@ logger = logging.getLogger(__name__)
queue_resize = dict()
hrefs = None
+created_galleries = {}
def initialized(pelican):
p = os.path.expanduser('~/Pictures')
@@ -140,6 +141,10 @@ def process_gallery_photo(generator, article, gallery):
# strip whitespaces
gallery = gallery.strip()
+ if gallery in created_galleries:
+ article.photo_gallery.append((gallery, created_galleries[gallery]))
+ continue
+
dir_gallery = os.path.join(
os.path.expanduser(generator.settings['PHOTO_LIBRARY']),
gallery)
@@ -175,6 +180,7 @@ def process_gallery_photo(generator, article, gallery):
generator.settings['PHOTO_THUMB'])
article.photo_gallery.append((gallery, articleGallery))
+ created_galleries[gallery] = articleGallery
else:
logger.error('photos: Gallery does not exist: %s at %s', gallery, dir_gallery) | galleries should only be created once per language, and also be available only once in the output | getpelican_pelican-plugins | train | py |
9159571ec483f5b798e85c2ee94673fa1075384c | diff --git a/retrofit/src/main/java/retrofit/RequestBuilder.java b/retrofit/src/main/java/retrofit/RequestBuilder.java
index <HASH>..<HASH> 100644
--- a/retrofit/src/main/java/retrofit/RequestBuilder.java
+++ b/retrofit/src/main/java/retrofit/RequestBuilder.java
@@ -35,6 +35,7 @@ final class RequestBuilder implements RequestInterceptor.RequestFacade {
private final RestMethodInfo.ParamUsage[] paramUsages;
private final String requestMethod;
private final boolean isSynchronous;
+ private final boolean isObservable;
private final FormUrlEncodedTypedOutput formBody;
private final MultipartTypedOutput multipartBody;
@@ -50,6 +51,7 @@ final class RequestBuilder implements RequestInterceptor.RequestFacade {
paramUsages = methodInfo.requestParamUsage;
requestMethod = methodInfo.requestMethod;
isSynchronous = methodInfo.isSynchronous;
+ isObservable = methodInfo.isObservable;
headers = new ArrayList<Header>();
if (methodInfo.headers != null) {
@@ -163,7 +165,7 @@ final class RequestBuilder implements RequestInterceptor.RequestFacade {
return;
}
int count = args.length;
- if (!isSynchronous) {
+ if (!isSynchronous && !isObservable) {
count -= 1;
}
for (int i = 0; i < count; i++) { | Last argument should be handled for observable methods | square_retrofit | train | java |
9b51976e6ed7c0a860f658b20581588ea7f7a7fe | diff --git a/client/state/plugins/installed/status/actions.js b/client/state/plugins/installed/status/actions.js
index <HASH>..<HASH> 100644
--- a/client/state/plugins/installed/status/actions.js
+++ b/client/state/plugins/installed/status/actions.js
@@ -3,6 +3,8 @@
*/
import { PLUGIN_NOTICES_REMOVE } from 'calypso/state/action-types';
+import 'calypso/state/plugins/init';
+
export function removePluginStatuses( ...statuses ) {
return {
type: PLUGIN_NOTICES_REMOVE, | Plugins: Add missing state init in status actions (#<I>) | Automattic_wp-calypso | train | js |
3adcd08fc8157380adc778ba218fcf0f36f68546 | diff --git a/spec/controllers/socializer/activities/likes_controller_spec.rb b/spec/controllers/socializer/activities/likes_controller_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/controllers/socializer/activities/likes_controller_spec.rb
+++ b/spec/controllers/socializer/activities/likes_controller_spec.rb
@@ -71,7 +71,7 @@ module Socializer
# Create a like
before { post :create, id: note_activity.guid, format: :js }
# Destroy the like
- before { post :destroy, id: note_activity.guid, format: :js }
+ before { delete :destroy, id: note_activity.guid, format: :js }
it 'does not like the note anymore' do
expect(user.likes?(note_activity.activity_object)).to be_falsey | change verb from post to delete for the destroy action | socializer_socializer | train | rb |
d7d52e6e645a2d7026ddfa688175c5d6ee6cedee | diff --git a/src/styles/auto-prefix.js b/src/styles/auto-prefix.js
index <HASH>..<HASH> 100644
--- a/src/styles/auto-prefix.js
+++ b/src/styles/auto-prefix.js
@@ -28,7 +28,7 @@ export default {
userAgent: userAgent,
});
- return prefixer.prefix;
+ return (style) => prefixer.prefix(style);
}
}, | Fix this reference of prefix function
This was a critical regression caused by returning
the function without binding it to the prefixer
object. By capturing the prefixer inside a closure
we can safely call the prefix function.
This regression effectively disabled the prefixer
entirely. | mui-org_material-ui | train | js |
9470f7fce17258d2f1436f6158b675dd1f94e788 | diff --git a/lib/Editor.js b/lib/Editor.js
index <HASH>..<HASH> 100644
--- a/lib/Editor.js
+++ b/lib/Editor.js
@@ -118,7 +118,7 @@ Editor.getOpenParams = Promise.method(function (givenPath) {
}, Promise.resolve());
});
-Editor.parseCoordinate = function (n) { return parseInt(n, 10) - 1; };
+Editor.parseCoordinate = function (n) { return (parseInt(n, 10) - 1) || 0; };
Editor.exists = Promise.method(function (givenPath) {
return fs.openAsync(givenPath, 'r')
.then(function (fd) { return fs.closeAsync(fd); }) | fix(open): bugfix for opening paths without coordinates | slap-editor_editor-widget | train | js |
92a11f502ec18cf934605f28dbfe4b7fb9faadd7 | diff --git a/airflow/cli/commands/db_command.py b/airflow/cli/commands/db_command.py
index <HASH>..<HASH> 100644
--- a/airflow/cli/commands/db_command.py
+++ b/airflow/cli/commands/db_command.py
@@ -86,6 +86,13 @@ def shell(args):
env["PGPASSWORD"] = url.password or ""
env['PGDATABASE'] = url.database
execute_interactive(["psql"], env=env)
+ elif url.get_backend_name() == 'mssql':
+ env = os.environ.copy()
+ env['MSSQL_CLI_SERVER'] = url.host
+ env['MSSQL_CLI_DATABASE'] = url.database
+ env['MSSQL_CLI_USER'] = url.username
+ env['MSSQL_CLI_PASSWORD'] = url.password
+ execute_interactive(["mssql-cli"], env=env)
else:
raise AirflowException(f"Unknown driver: {url.drivername}") | Support mssql in airflow db shell (#<I>)
We currently do not support mssql shell in the DB. This would ease troubleshooting for mssql | apache_airflow | train | py |
994ab11dbce34e0a16df925198ddd91efebaf6be | diff --git a/classes/Boom/Finder.php b/classes/Boom/Finder.php
index <HASH>..<HASH> 100644
--- a/classes/Boom/Finder.php
+++ b/classes/Boom/Finder.php
@@ -43,6 +43,10 @@ abstract class Finder
public function find()
{
+ if ( ! $this->_filtersApplied) {
+ $this->_query = $this->_applyFilters($this->_query);
+ }
+
return $this->_query->find_all();
} | Bugfix: Finder::find() not applying filters | boomcms_boom-core | train | php |
ff7476c1271b8f5c6be684129e0fc05f03e12ca1 | diff --git a/neuropythy/hcp/core.py b/neuropythy/hcp/core.py
index <HASH>..<HASH> 100644
--- a/neuropythy/hcp/core.py
+++ b/neuropythy/hcp/core.py
@@ -221,6 +221,9 @@ def subject(path, name=Ellipsis, meta_data=None, check_path=True, filter=None,
# in this case, because the hcp dataset actually calls down through here (with a pseudo-path),
# we don't need to run any of the filters that are run below (they have already been run)
if pimms.is_int(path):
+ if default_alignment != 'MSMAll':
+ warnings.warn('%s alignment requested, but MSMAll used for HCP release subject'
+ % (default_alignment,))
try: return data['hcp'].subjects[path]
except Exception: pass
# convert the path to a pseudo-dir; this may fail if the user is requesting a subject by name... | added warning is default_alignment gets quashed | noahbenson_neuropythy | train | py |
9cd555494be70bf3e9c1b36d8e140dc184833310 | diff --git a/src/element.js b/src/element.js
index <HASH>..<HASH> 100644
--- a/src/element.js
+++ b/src/element.js
@@ -1,4 +1,5 @@
-var $Node = require("./node");
+var _ = require("./utils"),
+ $Node = require("./node");
/**
* Used to represent a DOM element or collection
@@ -14,9 +15,7 @@ function $Element(element, /*INTERNAL*/collection) {
if (!(this instanceof $Element)) return new $Element(element, collection);
if (element && collection === true) {
- for (var i = 0, n = this.length = element.length; i < n; ++i) {
- this[i] = this[i - n] = $Element(element[i]);
- }
+ Array.prototype.push.apply(this, _.map(element, $Element));
} else {
$Node.call(this, element);
} | remove negative index support (performance is pure) | chemerisuk_better-dom | train | js |
aafdd94c17f7b64d2a42f5191eb06f45ba7a157e | diff --git a/aiocache/serializers.py b/aiocache/serializers.py
index <HASH>..<HASH> 100644
--- a/aiocache/serializers.py
+++ b/aiocache/serializers.py
@@ -6,7 +6,7 @@ logger = logging.getLogger(__file__)
try:
import ujson as json
except ImportError:
- logger.warning("ujson module not found, usin json")
+ logger.warning("ujson module not found, using json")
import json | Fixed spelling error in serializers.py (#<I>) | argaen_aiocache | train | py |
49cf252b618a80d02b779f95fe1189d849870373 | diff --git a/multiqc/modules/cutadapt/cutadapt.py b/multiqc/modules/cutadapt/cutadapt.py
index <HASH>..<HASH> 100755
--- a/multiqc/modules/cutadapt/cutadapt.py
+++ b/multiqc/modules/cutadapt/cutadapt.py
@@ -101,7 +101,11 @@ class MultiqcModule(BaseMultiqcModule):
# Get sample name from end of command line params
if l.startswith('Command line parameters'):
s_name = l.split()[-1]
- s_name = self.clean_s_name(s_name, f['root'])
+ # Manage case where sample name is '-' (reading from stdin)
+ if s_name == '-':
+ s_name = f['s_name']
+ else:
+ s_name = self.clean_s_name(s_name, f['root'])
if s_name in self.cutadapt_data:
log.debug("Duplicate sample name found! Overwriting: {}".format(s_name))
self.cutadapt_data[s_name] = dict() | Fix cutadapt sample name handing when reading from stdin (fixes ewels/MultiQC#<I>) | ewels_MultiQC | train | py |
d4482533c2362939e043389315b4003296c0e3f4 | diff --git a/packages/webpack/lib/utils/errors.js b/packages/webpack/lib/utils/errors.js
index <HASH>..<HASH> 100644
--- a/packages/webpack/lib/utils/errors.js
+++ b/packages/webpack/lib/utils/errors.js
@@ -2,10 +2,11 @@
const { EOL } = require('os');
-class BuildError {
+class BuildError extends Error {
constructor(stack) {
+ super();
this.name = this.constructor.name;
- this.stack = `${this.name} in ${stack.replace(/\033?\[[0-9]{1,2}m/g, '')}`;
+ this.stack = `${this.name}: ${stack.replace(/\033?\[[0-9]{1,2}m/g, '')}`;
this.message = this.stack.slice(0, this.stack.indexOf(EOL));
}
} | refactor(webpack): set up proper inheritance | untool_untool | train | js |
faf61ac063eb52e5235ae9ae44cc63c07555f550 | diff --git a/edalize/edatool.py b/edalize/edatool.py
index <HASH>..<HASH> 100644
--- a/edalize/edatool.py
+++ b/edalize/edatool.py
@@ -305,7 +305,11 @@ class Edatool(object):
_s = "'{}' exited with an error code"
raise RuntimeError(_s.format(cmd))
- def _write_fileset_to_f_file(self, output_file, include_vlogparams = True):
+ def _filter_verilog_files(src_file):
+ ft = src_file.file_type
+ return ft.startswith("verilogSource") or ft.startswith("systemVerilogSource")
+
+ def _write_fileset_to_f_file(self, output_file, include_vlogparams = True, filter_func = _filter_verilog_files):
""" Write a file list (*.f) file
Returns a list of all files which were not added to the *.f file
@@ -328,7 +332,7 @@ class Edatool(object):
f.write("+incdir+" + id + '\n')
for src_file in src_files:
- if (src_file.file_type.startswith("verilogSource") or src_file.file_type.startswith("systemVerilogSource")):
+ if (filter_func is None or filter_func(src_file)):
f.write(src_file.name + '\n')
else:
unused_files.append(src_file) | Specify files in a filelist through a filter func
Add a feature to the _write_fileset_to_f_file() function: a filter_func
argument can be specified with a callback to include only some files in
the final file list. | olofk_edalize | train | py |
6f97065448b4976b8d3d2c49fb557ac56375c60c | diff --git a/threadedcomments/forms.py b/threadedcomments/forms.py
index <HASH>..<HASH> 100644
--- a/threadedcomments/forms.py
+++ b/threadedcomments/forms.py
@@ -2,6 +2,7 @@ from django import forms
from django.contrib.comments.forms import CommentForm
from django.conf import settings
from django.utils.hashcompat import sha_constructor
+from django.utils.translation import ugettext_lazy as _
from threadedcomments.models import ThreadedComment
@@ -10,7 +11,7 @@ class ThreadedCommentForm(CommentForm):
def __init__(self, target_object, parent=None, data=None, initial=None):
self.base_fields.insert(
- self.base_fields.keyOrder.index('comment'), 'title',
+ self.base_fields.keyOrder.index('comment'), _('title'),
forms.CharField(
required=False,
max_length=getattr(settings, 'COMMENTS_TITLE_MAX_LENGTH', 255) | title field label doesn't get translated Fixes #<I>
Thanks sq9mev | HonzaKral_django-threadedcomments | train | py |
2936683321e2a63d403d3f4264e0b9e20e0a43fa | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -23,5 +23,8 @@ setup(
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Localization',
],
- long_description=readme
+ long_description=readme,
+ install_requires=[
+ 'numpy',
+ ],
) | setup.py - add install_requires
`numpy` is a hard requirement and thus should be listed | MrMinimal64_timezonefinder | train | py |
81b7131c863cd35433eb87645d114605729f7ec4 | diff --git a/daiquiri/formatter.py b/daiquiri/formatter.py
index <HASH>..<HASH> 100644
--- a/daiquiri/formatter.py
+++ b/daiquiri/formatter.py
@@ -18,7 +18,7 @@ except ImportError:
DEFAULT_FORMAT = (
- "%(asctime)s [%(process)d] %(color)s%(levelname)s "
+ "%(asctime)s [%(process)d] %(color)s%(levelname)-8.8s "
"%(name)s: %(message)s%(color_stop)s"
)
diff --git a/daiquiri/tests/test_daiquiri.py b/daiquiri/tests/test_daiquiri.py
index <HASH>..<HASH> 100644
--- a/daiquiri/tests/test_daiquiri.py
+++ b/daiquiri/tests/test_daiquiri.py
@@ -47,7 +47,7 @@ class TestDaiquiri(testtools.TestCase):
))
warnings.warn("omg!")
line = stream.getvalue()
- self.assertIn("WARNING py.warnings: ", line)
+ self.assertIn("WARNING py.warnings: ", line)
self.assertIn("daiquiri/tests/test_daiquiri.py:48: "
"UserWarning: omg!\n warnings.warn(\"omg!\")\n",
line) | Indent levelname by default
This change indents levelname for a nicer output. | jd_daiquiri | train | py,py |
fe008fdbaf291529721475efea778ef5c03b58e0 | diff --git a/tests/Collection/ShuffleTest.php b/tests/Collection/ShuffleTest.php
index <HASH>..<HASH> 100644
--- a/tests/Collection/ShuffleTest.php
+++ b/tests/Collection/ShuffleTest.php
@@ -16,7 +16,8 @@ class ShuffleTest extends TestCase
{
public function testShuffle()
{
- $this->assertNotSame([1, 2, 3, 4], shuffle([1, 2, 3, 4]));
- $this->assertSame([], \array_diff([1, 2, 3, 4], shuffle([1, 2, 3, 4])));
+ $arr = range(1, 10);
+ $this->assertNotSame($arr, shuffle($arr));
+ $this->assertSame([], \array_diff($arr, shuffle($arr)));
}
}
\ No newline at end of file | Use larger array for _\shuffle tests | lodash-php_lodash-php | train | php |
f36c43bfe4223e794b8ba1ef5fe28e72bc551d8d | diff --git a/lib/Cake/View/Helper/TimeHelper.php b/lib/Cake/View/Helper/TimeHelper.php
index <HASH>..<HASH> 100644
--- a/lib/Cake/View/Helper/TimeHelper.php
+++ b/lib/Cake/View/Helper/TimeHelper.php
@@ -763,7 +763,7 @@ class TimeHelper extends AppHelper {
* @param int $date Timestamp to format.
* @return string formatted string with correct encoding.
*/
- function _strftime($format, $date) {
+ protected function _strftime($format, $date) {
$format = strftime($format, $date);
$encoding = Configure::read('App.encoding'); | Add protected to method picked from <I> | cakephp_cakephp | train | php |
1a2c2360da6f491277331f69ba830bd20946151c | diff --git a/src/validators/required-if.js b/src/validators/required-if.js
index <HASH>..<HASH> 100644
--- a/src/validators/required-if.js
+++ b/src/validators/required-if.js
@@ -43,4 +43,4 @@ const validate = (val, ruleObj, propertyName, inputObj) => {
const message = required.message;
-export default {validate, message};
+export default {validate, message, And, Or}; | Export `And` `Or` | cermati_satpam | train | js |
4b9ee0d01c4eeb288fa59ae32cd4e317e779cae0 | diff --git a/tests/TestCase/Database/QueryTest.php b/tests/TestCase/Database/QueryTest.php
index <HASH>..<HASH> 100644
--- a/tests/TestCase/Database/QueryTest.php
+++ b/tests/TestCase/Database/QueryTest.php
@@ -872,8 +872,10 @@ class QueryTest extends TestCase {
$field->add('SELECT min(id) FROM comments');
return $exp
->gt($field, 100, 'integer');
- })
- ->execute();
+ });
+
+ debug($result->sql());
+ $rsult = $result->execute();
$this->assertCount(0, $result);
} | Figuring out what SQL is offending SQL Server | cakephp_cakephp | train | php |
a19f3ae53cce2087c063d0037b6b595390de30fe | diff --git a/spec/lib/models/work-item-spec.js b/spec/lib/models/work-item-spec.js
index <HASH>..<HASH> 100644
--- a/spec/lib/models/work-item-spec.js
+++ b/spec/lib/models/work-item-spec.js
@@ -167,9 +167,9 @@ describe('Workitem Model', function () {
it('should create ipmi pollers and then find them with findPollers', function () {
var nodeId = '47bd8fb80abc5a6b5e7b10df';
return workitems.createIpmiPollers(nodeId).then(function (items) {
- items = _.sortBy(items, 'node');
+ items = _.sortBy(items, 'id');
return workitems.findPollers().then(function (pollers) {
- pollers = _.sortBy(pollers, 'node');
+ pollers = _.sortBy(pollers, 'id');
expect(pollers).to.have.length(3);
pollers.forEach(function (poller, index) {
expect(poller.id).to.equal(items[index].id); | Fixing broken work item model unit test | RackHD_on-core | train | js |
e3ce46cfe703fd5999ae88a8c0a7114d1cd307af | diff --git a/src/leipzig.js b/src/leipzig.js
index <HASH>..<HASH> 100644
--- a/src/leipzig.js
+++ b/src/leipzig.js
@@ -34,6 +34,11 @@ var Leipzig = function(elements, opts) {
skip: opts.class.skip || 'gloss__line--skip'
};
+ // remove horizontal spacing between gloss words
+ this.spacing = (typeof opts.spacing !== 'undefined')
+ ? opts.spacing
+ : true;
+
// automatically mark the first line as 'original'
this.firstLineOrig = (typeof opts.firstLineOrig !== 'undefined')
? opts.firstLineOrig
@@ -102,6 +107,10 @@ Leipzig.prototype.format = function(groups, wrapper) {
groups.forEach(function(group) {
var glossWordClasses = [_this.class.word];
+ if (!_this.spacing) {
+ glossWordClasses.push(_this.class.noSpace);
+ }
+
glossWordClasses = glossWordClasses.join(' ');
output.push('<div class="' + glossWordClasses + '">'); | Add option for controlling spacing between aligned words | bdchauvette_leipzig.js | train | js |
d814118131a998d6c4ecdead2f0b1d27a50d01a4 | diff --git a/AdvancedHTMLParser/Tags.py b/AdvancedHTMLParser/Tags.py
index <HASH>..<HASH> 100644
--- a/AdvancedHTMLParser/Tags.py
+++ b/AdvancedHTMLParser/Tags.py
@@ -1876,6 +1876,29 @@ class AdvancedTag(object):
return None
+ def getParentElementCustomFilter(self, filterFunc):
+ '''
+ getParentElementCustomFilter - Runs through parent on up to document root, returning the
+
+ first tag which filterFunc(tag) returns True.
+
+ @param filterFunc <function/lambda> - A function or lambda expression that should return "True" if the passed node matches criteria.
+
+ @return <AdvancedTag/None> - First match, or None
+
+
+ @see getFirstElementCustomFilter for matches against children
+ '''
+ parentNode = self.parentNode
+ while parentNode:
+
+ if filterFunc(parentNode) is True:
+ return parentNode
+
+ parentNode = parentNode.parentNode
+
+ return None
+
def getPeersByAttr(self, attrName, attrValue):
'''
getPeersByAttr - Gets peers (elements on same level) which match an attribute/value combination. | Implement AdvancedTag.getParentElementCustomFunction which takes a lambda and reutrns the first parent of given node which matches (returns True) | kata198_AdvancedHTMLParser | train | py |
349f3875178ab62cda3ed7cd35c5ab8d5b208aaa | diff --git a/parfait-core/src/main/java/io/pcp/parfait/timing/ThreadValue.java b/parfait-core/src/main/java/io/pcp/parfait/timing/ThreadValue.java
index <HASH>..<HASH> 100644
--- a/parfait-core/src/main/java/io/pcp/parfait/timing/ThreadValue.java
+++ b/parfait-core/src/main/java/io/pcp/parfait/timing/ThreadValue.java
@@ -49,7 +49,7 @@ public interface ThreadValue<T> {
public static class WeakReferenceThreadMap<T> implements ThreadValue<T> {
- protected final LoadingCache<Thread, T> loadingCache = CacheBuilder.newBuilder().build(new CacheLoader<Thread, T>() {
+ protected final LoadingCache<Thread, T> loadingCache = CacheBuilder.newBuilder().weakKeys().build(new CacheLoader<Thread, T>() {
@Override
public T load(Thread thread) throws Exception {
return initialValue(); | Fix non-weak reference regression introduced with Guava upgrade
In 0c<I>c<I>ed<I>c<I>d4ee<I>eab<I>b<I>b<I>d5, this map was migrated to
LoadingCache. The weakKeys() builder method accidentally got dropped and
the defaults are to hold strong references. This commit re-introduces the
weakKeys() builder method for the LoadingCache. | performancecopilot_parfait | train | java |
67c42dda0bebecc9ad649f2c3b4a20712dbc0100 | diff --git a/src/java/com/threerings/cast/bundle/BundledComponentRepository.java b/src/java/com/threerings/cast/bundle/BundledComponentRepository.java
index <HASH>..<HASH> 100644
--- a/src/java/com/threerings/cast/bundle/BundledComponentRepository.java
+++ b/src/java/com/threerings/cast/bundle/BundledComponentRepository.java
@@ -345,18 +345,16 @@ public class BundledComponentRepository
_setcache.put(dpath, aset);
}
- // if this is a shadow image, no need to freak out as they are
- // optional
- if (StandardActions.SHADOW_TYPE.equals(type)) {
- return null;
- }
-
// if that failed too, we're hosed
if (aset == null) {
- Log.warning("Unable to locate tileset for action '" +
- imgpath + "' " + component + ".");
- if (_wipeOnFailure) {
- _bundle.wipeBundle(false);
+ // if this is a shadow image, no need to freak out as they
+ // are optional
+ if (!StandardActions.SHADOW_TYPE.equals(type)) {
+ Log.warning("Unable to locate tileset for action '" +
+ imgpath + "' " + component + ".");
+ if (_wipeOnFailure) {
+ _bundle.wipeBundle(false);
+ }
}
return null;
} | Just fail to freak out, don't fail to load shadows at all.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1 | threerings_narya | train | java |
d411f9db3487fb348c44445e93723b6e7bba6cba | diff --git a/viewer.js b/viewer.js
index <HASH>..<HASH> 100644
--- a/viewer.js
+++ b/viewer.js
@@ -95,12 +95,12 @@
, drawAnnotationPointButton = new Button('\uf040', 'Draw new annotation point (close with shift-click)')
, moveAnnotationButton = new Button('\uf047', 'Move annotation point')
, deleteAnnotationPointButton = new Button('\uf00d', 'Delete annotation point')
- , deleteAnnotationButton = new Button('\uf1f8', 'Delete annotation')
- , annotationButtons = [ addNewAnnotationButton,
- deleteAnnotationButton,
+ , deleteAnnotationButton = new Button('\uf1f8', 'Delete active annotation')
+ , annotationButtons = [ deleteAnnotationButton,
deleteAnnotationPointButton,
moveAnnotationButton,
- drawAnnotationPointButton]
+ drawAnnotationPointButton,
+ addNewAnnotationButton]
// contains all active buttons
, buttons = defaultButtons.slice()
@@ -868,7 +868,7 @@
}
activePolygon = self.solution;
} else if(annotationsEditable){
- console.log("should have active polygon");
+ console.log("No active polygon. Click on a polygon to edit it!");
return;
} else {
console.log("invalid POLYGON_DRAW state"); | changed tooltips and warnings, rearranged some buttons | pfirpfel_image-viewer | train | js |
79b76303f63e447c5cffa94a3f00546a0074de33 | diff --git a/gwpy/data/series.py b/gwpy/data/series.py
index <HASH>..<HASH> 100644
--- a/gwpy/data/series.py
+++ b/gwpy/data/series.py
@@ -124,7 +124,9 @@ class Series(Array):
try:
return self._index
except AttributeError:
- if self.logx:
+ if not self.size:
+ self.index = numpy.ndarray(0)
+ elif self.logx:
logdx = (numpy.log10(self.x0.value + self.dx.value) -
numpy.log10(self.x0.value))
logx1 = numpy.log10(self.x0.value) + self.shape[-1] * logdx | Series.index: fix bug with empty series | gwpy_gwpy | train | py |
17d684ee6892346bc3d2d4763fcec75ad1a06ff5 | diff --git a/tests/lax_test.py b/tests/lax_test.py
index <HASH>..<HASH> 100644
--- a/tests/lax_test.py
+++ b/tests/lax_test.py
@@ -2245,6 +2245,25 @@ class LaxTest(jtu.JaxTestCase):
(x,), (1.,)))(1.)
self.assertLen(jaxpr.jaxpr.eqns, 2)
+ def test_named_call(self):
+
+ def named_call(f, name):
+ def named_f(*args):
+ f_ = jax.linear_util.wrap_init(lambda: (f(*args),))
+ out, = lax.named_call_p.bind(f_, name=name)
+ return out
+ return named_f
+
+ def square(x):
+ return x ** 2
+
+ @jax.jit
+ def f(x):
+ return named_call(square, 'name_for_testing')(x)
+
+ c = jax.xla_computation(f)(2)
+ self.assertIn('name_for_testing', c.as_hlo_text())
+
class LazyConstantTest(jtu.JaxTestCase):
def _Check(self, make_const, expected): | Add named_call test
Add named_call test in lax test. | tensorflow_probability | train | py |
5589ab5cf11d02a6ba5dd888e18fbccef7787d56 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -19,6 +19,7 @@ module.exports.createReceiver = function( params ) {
var transConfig = params.transports;
var receiver = new this.Receiver( {
+ authorize: params.authorize,
baseDir: params.baseDir
} ); | Add authorize to createReceiver() convenience method | BlueRival_json-fling | train | js |
86ef7676c8780397937d1714b86eacaf26c61c71 | diff --git a/install/lang/ko_utf8/installer.php b/install/lang/ko_utf8/installer.php
index <HASH>..<HASH> 100644
--- a/install/lang/ko_utf8/installer.php
+++ b/install/lang/ko_utf8/installer.php
@@ -332,8 +332,8 @@ $string['unicoderecommended'] = '모든 자료를 유니코드(UTF-8)로 저장
$string['unicoderequired'] = '모든 자료가 유니코드(UTF-8)로 저장되야 합니다. 새 설정은 기본 문자코드가 유니코드로 저장되어 있다고 가정하고 작동이 됩니다. 만일 업그레이드 중이라면 반드시 UTF-8 변환과정을 수행하여야만 합니다.(관리화면 참조)';
$string['upgradingactivitymodule'] = '활동 모듈 갱신';
$string['upgradingbackupdb'] = '백업 데이터베이스 갱신';
-$string['upgradingblocksdb'] = '블록 데이터베이스 갱신';
-$string['upgradingblocksplugin'] = '블록 플러그인 갱신';
+$string['upgradingblocksdb'] = '블럭 데이터베이스 갱신';
+$string['upgradingblocksplugin'] = '블럭 플러그인 갱신';
$string['upgradingcompleted'] = '갱신 완료 /n';
$string['upgradingcourseformatplugin'] = '강좌 포맷 플러그인 갱신';
$string['upgradingenrolplugin'] = '출석 플러그인 갱신'; | Automatic installer.php lang files by installer_builder (<I>) | moodle_moodle | train | php |
945502ea5a0727a64b62d19773178921f86f6817 | diff --git a/components/rack/rack-int/src/main/java/org/torquebox/rack/deployers/AppRackYamlParsingDeployer.java b/components/rack/rack-int/src/main/java/org/torquebox/rack/deployers/AppRackYamlParsingDeployer.java
index <HASH>..<HASH> 100644
--- a/components/rack/rack-int/src/main/java/org/torquebox/rack/deployers/AppRackYamlParsingDeployer.java
+++ b/components/rack/rack-int/src/main/java/org/torquebox/rack/deployers/AppRackYamlParsingDeployer.java
@@ -108,7 +108,6 @@ public class AppRackYamlParsingDeployer extends AbstractVFSParsingDeployer<RackA
List<ClassPathEntry> classPaths = AbstractRubyStructureDeployer.getClassPathEntries( rackRoot.getChild( "lib" ), rackRoot );
classPaths.addAll( AbstractRubyStructureDeployer.getClassPathEntries( rackRoot.getChild( "vendor/jars" ), rackRoot ) );
- // TODO: Add classpath entry for java libraries
ContextInfo context = StructureMetaDataFactory.createContextInfo("", metaDataPaths, classPaths);
result.addContext(context);
return result; | Remove the TODO as it's now TODONE. | torquebox_torquebox | train | java |
7b985591cd6a489b723e63c457d60f3e4e06a7fb | diff --git a/classes/Kohana/Model/Store/Purchase.php b/classes/Kohana/Model/Store/Purchase.php
index <HASH>..<HASH> 100644
--- a/classes/Kohana/Model/Store/Purchase.php
+++ b/classes/Kohana/Model/Store/Purchase.php
@@ -73,7 +73,7 @@ class Kohana_Model_Store_Purchase extends Jam_Model implements Purchasable {
{
if (($index = $this->search_same_item($new_item)) !== NULL)
{
- $this->items[$index]->quantity += $new_item->quantity;
+ $this->items[$index]->quantity = $this->items[$index]->quantity + 1;
}
else
{ | fix weird __set/__get bug with += | OpenBuildings_purchases | train | php |
0e85184b798e0dcaa10ed88344b6d6d6527e074c | diff --git a/modules/page/html/render/message.js b/modules/page/html/render/message.js
index <HASH>..<HASH> 100644
--- a/modules/page/html/render/message.js
+++ b/modules/page/html/render/message.js
@@ -118,14 +118,24 @@ function showContext (element) {
// ensure context is visible
scrollParent.scrollTop = Math.max(0, scrollParent.scrollTop - 100)
}
+
+ // HACK: sometimes the body gets affected!? Why no just hack it!!!
+ if (document.body.scrollTop > 0) {
+ document.body.scrollTop = 0
+ }
}
function getScrollParent (element) {
while (element.parentNode) {
- if (element.parentNode.scrollTop > 10) {
+ if (element.parentNode.scrollTop > 10 && isScroller(element.parentNode)) {
return element.parentNode
} else {
element = element.parentNode
}
}
}
+
+function isScroller (element) {
+ var value = window.getComputedStyle(element)['overflow-y']
+ return (value === 'auto' || value === 'scroll')
+} | trying to stop body from scrolling sometimes on anchor link | ssbc_patchwork | train | js |
d3ca63250225491e869f88b8b85cbd1fe64fd783 | diff --git a/ctrl/game.js b/ctrl/game.js
index <HASH>..<HASH> 100644
--- a/ctrl/game.js
+++ b/ctrl/game.js
@@ -13,7 +13,7 @@ module.exports = (sbot, myIdent) => {
const gameSSBDao = GameSSBDao(sbot);
const gameChallenger = GameChallenger(sbot, myIdent);
- function getMyIdent() {PlayerUtils
+ function getMyIdent() {
return myIdent;
}
diff --git a/ui/game/gameView.js b/ui/game/gameView.js
index <HASH>..<HASH> 100644
--- a/ui/game/gameView.js
+++ b/ui/game/gameView.js
@@ -3,6 +3,8 @@ var Chessground = require('chessground').Chessground;
module.exports = (gameCtrl) => {
+ const myIdent = gameCtrl.getMyIdent();
+
function renderBoard(gameId) {
var vDom = m('div', {
class: 'cg-board-wrap ssb-chess-board-large'
@@ -12,8 +14,10 @@ module.exports = (gameCtrl) => {
var chessGround = Chessground(vDom.dom, {});
gameCtrl.getSituation(gameId).then(situation => {
+
chessGround.set({
- fen: situation.fen
+ fen: situation.fen,
+ orientation: situation.players[myIdent].colour
});
})
}); | Flip board orientation if the player is playing as black. | Happy0_ssb-chess | train | js,js |
f8d607e5485b416de14ddea7bf7da5c7edc393ca | diff --git a/carrot/messaging.py b/carrot/messaging.py
index <HASH>..<HASH> 100644
--- a/carrot/messaging.py
+++ b/carrot/messaging.py
@@ -165,7 +165,8 @@ class Consumer(object):
self.channel.basic_consume(queue=self.queue, no_ack=True,
callback=self._receive_callback,
consumer_tag=self.__class__.__name__)
- yield self.channel.wait()
+ while True:
+ self.channel.wait()
def iterqueue(self, limit=None):
"""Iterator that yields all pending messages, at most limit | Revert to the old version of Consumer.wait() Thanks Alexander Solovyov! | ask_carrot | train | py |
269fd0e8ca29b011af9d2295d3272dc5ed1534b1 | diff --git a/stagpy/stagyydata.py b/stagpy/stagyydata.py
index <HASH>..<HASH> 100644
--- a/stagpy/stagyydata.py
+++ b/stagpy/stagyydata.py
@@ -748,7 +748,7 @@ class StagyyData:
rproffile = self.filename('rprof.h5')
self._stagdat['rprof'] = stagyyparsers.rprof_h5(
rproffile, list(phyvars.RPROF.keys()))
- if self._stagdat['rprof'] is not None:
+ if self._stagdat['rprof'][0] is not None:
return self._stagdat['rprof']
rproffile = self.filename('rprof.dat')
if self.hdf5 and not rproffile.is_file(): | Fix fallback to ASCII if rprof.h5 doesn't exist | StagPython_StagPy | train | py |
be2a09dc1372d077a7f6e0526846f0900e4e26e2 | diff --git a/eZ/Publish/Core/FieldType/XmlText/Schema.php b/eZ/Publish/Core/FieldType/XmlText/Schema.php
index <HASH>..<HASH> 100644
--- a/eZ/Publish/Core/FieldType/XmlText/Schema.php
+++ b/eZ/Publish/Core/FieldType/XmlText/Schema.php
@@ -238,12 +238,17 @@ class Schema
/**
* Determines if the tag is inline
*
- * @param \DOMNode|\DOMElement $element
+ * @param \DOMNode|\DOMElement|string $element
*
* @return bool
*/
- public function isInline( DOMNode $element )
+ public function isInline( $element )
{
+ if ( is_string( $element ) )
+ {
+ return $this->schema[$element]['isInline'];
+ }
+
// Use specific custom tag setting if set
if ( $element->nodeName === 'custom' && $element instanceof DOMElement )
{ | Fixed: isInline() not working with string while still used | ezsystems_ezpublish-kernel | train | php |
a393f5c4a49ffd312994008c39260d8fda6d007b | diff --git a/lib/zuul.js b/lib/zuul.js
index <HASH>..<HASH> 100644
--- a/lib/zuul.js
+++ b/lib/zuul.js
@@ -88,7 +88,7 @@ Zuul.prototype.run = function(done) {
var phantom = PhantomBrowser(config);
self.emit('browser', phantom);
phantom.once('done', function(results) {
- done(results.failed === 0);
+ done(results.failed === 0 && results.passed > 0);
});
return phantom.start();
} | phantomjs run fails if nothing passes | airtap_airtap | train | js |
b5d81551ac7ba7bb8e481d79ac6969c2cd85733b | diff --git a/lib/jamf/api/connection/token.rb b/lib/jamf/api/connection/token.rb
index <HASH>..<HASH> 100644
--- a/lib/jamf/api/connection/token.rb
+++ b/lib/jamf/api/connection/token.rb
@@ -73,7 +73,6 @@ module Jamf
else
raise ArgumentError, 'Must provide either pw: or token_string:'
end
-
end # init
# Initialize from password
@@ -103,8 +102,9 @@ module Jamf
@auth_token = str
@user = resp.body.dig :account, :username
+
# use this token to get a fresh one with a known expiration
- keep_alive
+ refresh
end # init_from_token_string
# @return [String]
@@ -162,7 +162,7 @@ module Jamf
end
# Use this token to get a fresh one
- def keep_alive
+ def refresh
raise 'Token has expired' if expired?
keep_alive_token_resp = token_connection(KEEP_ALIVE_RSRC, token: @auth_token).post
@@ -173,7 +173,7 @@ module Jamf
# parse_token_from_response keep_alive_rsrc.post('')
expires
end
- alias refresh keep_alive
+ alias keep_alive refresh
# Make this token invalid
def invalidate | in Token, use 'refresh' as the main method name, and keep_alive as an alias | PixarAnimationStudios_ruby-jss | train | rb |
1c8f23384b618d3b55ab9a7234507f82ed1c10ca | diff --git a/safe/postprocessors/minimum_needs_postprocessor.py b/safe/postprocessors/minimum_needs_postprocessor.py
index <HASH>..<HASH> 100644
--- a/safe/postprocessors/minimum_needs_postprocessor.py
+++ b/safe/postprocessors/minimum_needs_postprocessor.py
@@ -58,7 +58,10 @@ class MinimumNeedsPostprocessor(AbstractPostprocessor):
if self.impact_total is not None or self.minimum_needs is not None:
self._raise_error('clear needs to be called before setup')
- self.impact_total = int(round(params['impact_total']))
+ try:
+ self.impact_total = int(round(params['impact_total']))
+ except ValueError:
+ self.impact_total = self.NO_DATA_TEXT
self.minimum_needs = params['function_params']['minimum needs']
def process(self): | gracefully recover from #<I> | inasafe_inasafe | train | py |
01207e999e10f7ed19275da1cf399296ecccfad7 | diff --git a/go-ari-library.go b/go-ari-library.go
index <HASH>..<HASH> 100644
--- a/go-ari-library.go
+++ b/go-ari-library.go
@@ -12,11 +12,11 @@ type NV_Event struct {
ARI_Event string
}
-func Init(in chan string, out chan *NV_Event) {
- go func(in chan string, out chan *NV_Event) {
+func Init(in chan []byte, out chan *NV_Event) {
+ go func(in chan []byte, out chan *NV_Event) {
for instring := range in {
var e *NV_Event
- json.Unmarshal([]byte(instring), e)
+ json.Unmarshal(instring, e)
out <- e
}
}(in, out) | Inbound channel needs to be []byte not string | nvisibleinc_go-ari-library | train | go |
ff908eb0090c958104acc9d143e08121d5b14eb0 | diff --git a/library/ZfRest/Controller/Auth.php b/library/ZfRest/Controller/Auth.php
index <HASH>..<HASH> 100644
--- a/library/ZfRest/Controller/Auth.php
+++ b/library/ZfRest/Controller/Auth.php
@@ -11,7 +11,7 @@
namespace ZfRest\Controller;
-use ZfRest\Model\View\User;
+use ZfRest\Model\User;
/**
* {@inheritdoc}
@@ -39,7 +39,12 @@ trait Auth
final public function getCurrentUser()
{
if ($this->hasAuth() && null === self::$user) {
- self::$user = User::loadWithPermissions(self::$auth, $this->getContext());
+ $user = User::loadWithPermissions(self::$auth, $this->getContext());
+
+ if ($user) {
+ self::$user = $user->toArray();
+ self::$user['permissions'] = $user->permissions;
+ }
}
return self::$user; | Missed the toArray() call | douggr_benri | train | php |
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.