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
a79aca62840719a4d33b1934d33441edfe9bb3f9
diff --git a/lib/smartcoin/version.rb b/lib/smartcoin/version.rb index <HASH>..<HASH> 100644 --- a/lib/smartcoin/version.rb +++ b/lib/smartcoin/version.rb @@ -1,3 +1,3 @@ module Smartcoin - VERSION = "0.1.2" + VERSION = "0.1.3" end
SmartCoin library version <I>
smartcoinpayments_smartcoin-ruby
train
rb
8d683e02cf6d3966ef297cef49f5b4baa9c68b26
diff --git a/org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/UIElementBase.java b/org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/UIElementBase.java index <HASH>..<HASH> 100644 --- a/org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/UIElementBase.java +++ b/org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/UIElementBase.java @@ -1376,7 +1376,7 @@ public abstract class UIElementBase { * @param eventData Data associated with the event. * @param recurse If true, recurse up the parent chain. */ - protected void notifyParent(String eventName, Object eventData, boolean recurse) { + public void notifyParent(String eventName, Object eventData, boolean recurse) { UIElementBase ele = parent; while (ele != null) { @@ -1403,7 +1403,7 @@ public abstract class UIElementBase { * @param eventData Data associated with the event. * @param recurse If true, recurse over all child levels. */ - protected void notifyChildren(String eventName, Object eventData, boolean recurse) { + public void notifyChildren(String eventName, Object eventData, boolean recurse) { notifyChildren(this, eventName, eventData, recurse); }
Make NotifyParent and NotifyChildren public.
carewebframework_carewebframework-core
train
java
1331d13adf2ef6d05fd697665800aea0f5cb46bc
diff --git a/jquery-loadTemplate/jquery.loadTemplate-0.5.4.js b/jquery-loadTemplate/jquery.loadTemplate-0.5.4.js index <HASH>..<HASH> 100644 --- a/jquery-loadTemplate/jquery.loadTemplate-0.5.4.js +++ b/jquery-loadTemplate/jquery.loadTemplate-0.5.4.js @@ -229,6 +229,10 @@ $elem.attr("alt", applyFormatters($elem, value, "alt")); }); + processElements("data-value", template, data, function ($elem, value) { + $elem.val(applyFormatters($elem, value, "value")); + }); + processElements("data-link", template, data, function ($elem, value) { var $linkElem = $("<a/>"); $linkElem.attr("href", applyFormatters($elem, value, "link")); @@ -347,4 +351,4 @@ $.fn.loadTemplate = loadTemplate; $.addTemplateFormatter = addTemplateFormatter; -})(jQuery); \ No newline at end of file +})(jQuery);
Added support for the "value" attribute (e.g. to fill form fields)
codepb_jquery-template
train
js
fe7420ebfd7aa2ad81ae6e0dce9bef0c2831eaeb
diff --git a/dist/createStore.js b/dist/createStore.js index <HASH>..<HASH> 100644 --- a/dist/createStore.js +++ b/dist/createStore.js @@ -55,9 +55,7 @@ function createStore(modules) { if (module.decorateReducer) moduleReducer = module.decorateReducer(moduleReducer); reducerList[module.name] = moduleReducer; }); - config.sagas && config.sagas.forEach(function (saga) { - return sagas.concat(saga); - }); + sagas = config.sagas ? sagas.concat(config.sagas) : sagas; var combinedReducer = (0, _redux.combineReducers)(reducerList); if (config.decorateReducer) { diff --git a/src/createStore.js b/src/createStore.js index <HASH>..<HASH> 100644 --- a/src/createStore.js +++ b/src/createStore.js @@ -36,7 +36,7 @@ export default function createStore(modules, config = {}){ moduleReducer = module.decorateReducer(moduleReducer); reducerList[module.name] = moduleReducer; }); - config.sagas && config.sagas.forEach(saga => sagas.concat(saga)); + sagas = config.sagas ? sagas.concat(config.sagas) : sagas; let combinedReducer = combineReducers(reducerList); if (config.decorateReducer) {
#<I>: fix bug where extra sagas passed in from config were not concatenating to the sagas array
anish000kumar_redux-box
train
js,js
eaead8517b06e4852e4fd14e9a0c28725399e0bb
diff --git a/node-binance-api.js b/node-binance-api.js index <HASH>..<HASH> 100644 --- a/node-binance-api.js +++ b/node-binance-api.js @@ -148,7 +148,7 @@ let api = function Binance( options = {} ) { const reqHandler = cb => ( error, response, body ) => { Binance.info.lastRequest = new Date().getTime(); - Binance.info.lastURL = response.request.uri.href; + if ( response && response.request ) Binance.info.lastURL = response.request.uri.href; Binance.info.statusCode = response.statusCode; Binance.info.usedWeight = response.headers['x-mbx-used-weight-1m'] || 0; Binance.info.orderCount1s = response.headers['x-mbx-order-count-1s'] || 0; @@ -456,7 +456,7 @@ let api = function Binance( options = {} ) { try { Binance.info.lastRequest = new Date().getTime(); Binance.info.statusCode = response.statusCode; - Binance.info.lastURL = response.request.uri.href; + if ( response && response.request ) Binance.info.lastURL = response.request.uri.href; Binance.info.usedWeight = response.headers['x-mbx-used-weight-1m'] || 0; Binance.info.futuresLatency = response.headers['x-response-time'] || 0; if ( !error && response.statusCode == 200 ) return resolve( JSON.parse( body ) );
Fix for "cannot read property 'request' of undefined" during fatal errors
jaggedsoft_node-binance-api
train
js
748f4026c7f66708fd05d5b407c5d9ea9efa3fe4
diff --git a/lib/web_translate_it.rb b/lib/web_translate_it.rb index <HASH>..<HASH> 100644 --- a/lib/web_translate_it.rb +++ b/lib/web_translate_it.rb @@ -16,14 +16,14 @@ require 'web_translate_it/command_line' require 'web_translate_it/project' module WebTranslateIt - + def self.fetch_translations config = Configuration.new locale = I18n.locale.to_s return if config.ignore_locales.include?(locale) config.logger.debug { "➔ Fetching #{locale.upcase} language file(s) from Web Translate It…" } if config.logger WebTranslateIt::Connection.new(config.api_key) do |http| - config.files.find_all{ |file| file.locale == locale }.each do |file| + config.files.find_all{ |file| file.locale.in?(locale, I18n.lang) }.each do |file| response = file.fetch(http) config.logger.debug { "➔ Web Translate It response: #{response}" } if config.logger end
do not fetch locales for static requests
AtelierConvivialite_webtranslateit
train
rb
a8992b01db6d9c0133d8d3dc3175c597e8028f51
diff --git a/tests/test_contentsmanager.py b/tests/test_contentsmanager.py index <HASH>..<HASH> 100644 --- a/tests/test_contentsmanager.py +++ b/tests/test_contentsmanager.py @@ -1667,10 +1667,10 @@ def test_multiple_pairing(tmpdir): model_md = cm.get("notebook.md", content=False, load_alternative_format=False) model_py = cm.get("notebook.py", content=False, load_alternative_format=False) - # ipynb is the older, then py, then md + # ipynb is the oldest one, then py, then md # so that we read cell inputs from the py file - assert model_ipynb["last_modified"] < model_py["last_modified"] - assert model_py["last_modified"] < model_md["last_modified"] + assert model_ipynb["last_modified"] <= model_py["last_modified"] + assert model_py["last_modified"] <= model_md["last_modified"] @skip_if_dict_is_not_ordered
Seen an example with identical timestamps
mwouts_jupytext
train
py
d18fde30625843b51691c5338ca361912d125340
diff --git a/spec/factory_bot/factory_spec.rb b/spec/factory_bot/factory_spec.rb index <HASH>..<HASH> 100644 --- a/spec/factory_bot/factory_spec.rb +++ b/spec/factory_bot/factory_spec.rb @@ -14,18 +14,6 @@ describe FactoryBot::Factory do expect(@factory.build_class).to eq @class end - it "passes a custom creation block" do - strategy = double("strategy", result: nil, add_observer: true) - allow(FactoryBot::Strategy::Build).to receive(:new).and_return strategy - block = -> {} - factory = FactoryBot::Factory.new(:object) - factory.to_create(&block) - - factory.run(FactoryBot::Strategy::Build, {}) - - expect(strategy).to have_received(:result).with(instance_of(FactoryBot::Evaluation)) - end - it "returns associations" do factory = FactoryBot::Factory.new(:post) FactoryBot.register_factory(FactoryBot::Factory.new(:admin))
Remove unhelpful spec This spec was introduced back in <I>c<I>a1e6, at which point it was testing that the to_create block got passed to a proxy object. A lot has changed since then, and this test is no longer testing anything involving to_create (we can remove the call to to_create and it still passes). It is testing that we instantiate a strategy and pass an evaluation to it, but that isn't a helpful test. The behavior we actually care about is well tested in acceptance specs.
thoughtbot_factory_bot
train
rb
29a6583b289293d8e5f17f3c3d3da2187cfb5801
diff --git a/src/frontend/org/voltdb/ClientInterface.java b/src/frontend/org/voltdb/ClientInterface.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/ClientInterface.java +++ b/src/frontend/org/voltdb/ClientInterface.java @@ -371,13 +371,10 @@ public class ClientInterface implements SnapshotDaemon.DaemonInitiator { socket.socket().setKeepAlive(true); if (handler instanceof ClientInputHandler) { + Connection c = m_network.registerChannel(socket, handler, 0); synchronized (m_connections){ - Connection c = null; if (!m_hasDTXNBackPressure) { - c = m_network.registerChannel(socket, handler, SelectionKey.OP_READ); - } - else { - c = m_network.registerChannel(socket, handler, 0); + c.enableReadSelection(); } m_connections.add(c); }
Fix a deadlock when accepting new connections.
VoltDB_voltdb
train
java
2b2d9362bc759ab08ec9f4dcb0da79e6e5b278b1
diff --git a/app/classes/lib.php b/app/classes/lib.php index <HASH>..<HASH> 100644 --- a/app/classes/lib.php +++ b/app/classes/lib.php @@ -879,7 +879,9 @@ function getConfig() // We add these later, because the order is important: By having theme/ourtheme first, // files in that folder will take precedence. For instance when overriding the menu template. $config['twigpath'][] = realpath(__DIR__.'/../theme_defaults'); - $config['twigpath'][] = realpath(__DIR__.'/../extensions'); + + // Deprecated! Extensions that use templates, should add their own path: $this->app['twig.loader.filesystem']->addPath(__DIR__); + // $config['twigpath'][] = realpath(__DIR__.'/../extensions'); return $config;
Change: removed the entire 'app/extensions/' path from Twig by default. From now on, it's the extensions responsibility to add a path, if its' needed: $this->app['twig.loader.filesystem']->addPath(__DIR__);
bolt_bolt
train
php
5c97b9911a2dafde5fd1e4c40cda4e84974eb855
diff --git a/assembla/lib.py b/assembla/lib.py index <HASH>..<HASH> 100644 --- a/assembla/lib.py +++ b/assembla/lib.py @@ -11,6 +11,9 @@ class AssemblaObject(object): def __getitem__(self, key): return self.data[key] + def __setitem__(self, key, value): + self.data[key] = value + def keys(self): return self.data.keys() @@ -20,6 +23,15 @@ class AssemblaObject(object): def get(self, *args, **kwargs): return self.data.get(*args, **kwargs) + def __repr__(self): + if 'name' in self.data: + return "<%s: %s>" % (type(self).__name__, self.data['name']) + + if ('number' in self.data) and ('summary' in self.data): + return "<%s: #%s - %s>" % (type(self).__name__, self.data['number'], self.data['summary']) + + return super(AssemblaObject, self).__repr__() + def assembla_filter(func): """
Allow keys to be set (in anticipation of write commands). Better object __repr__() for spaces and tickets.
markfinger_assembla
train
py
63b45d5645df523168e2b4533247354fd59eb174
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -74,6 +74,8 @@ module.exports = function (grunt) { '!extensions/default/*/unittest-files/**/*', '!extensions/default/*/unittests.js', 'extensions/default/*/**/*', + 'extensions/dev/*', + 'extensions/samples/**/*', 'thirdparty/CodeMirror2/addon/{,*/}*', 'thirdparty/CodeMirror2/keymap/{,*/}*', 'thirdparty/CodeMirror2/lib/{,*/}*',
add extensions/dev and extensions/samples to grunt build
adobe_brackets
train
js
ad96e52c1523ecb07ebb66bf76b730ac3c6fd33f
diff --git a/lib/parslet/expression.rb b/lib/parslet/expression.rb index <HASH>..<HASH> 100644 --- a/lib/parslet/expression.rb +++ b/lib/parslet/expression.rb @@ -37,8 +37,8 @@ class Parslet::Expression rule(:string) { str('\'') >> ( - (str('\\') >> any) / - (str('\'').absnt? >> any) + (str('\\') >> any) | + (str("'").absnt? >> any) ).repeat.as(:string) >> str('\'') } diff --git a/spec/unit/parslet/expression_spec.rb b/spec/unit/parslet/expression_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/parslet/expression_spec.rb +++ b/spec/unit/parslet/expression_spec.rb @@ -18,15 +18,19 @@ describe Parslet::Expression do end end - # REPLACE ME TODO - def match(str) - simple_matcher("match") do |parslet| - parslet.parse(str) + RSpec::Matchers.define :accept do |string| + match do |parslet| + begin + parslet.parse(string) + true + rescue Parslet::ParseFailed + false + end end end context "simple strings ('abc')" do subject { exp("'abc'") } - it { should match('abc') } + it { should accept('abc') } end end \ No newline at end of file
+ Fixing the new examples with all the new code The treetop parser is experimental and will undergo some changes yet.
kschiess_parslet
train
rb,rb
7c810e0bfd619c9cde68ca9ba83ece18be30cd64
diff --git a/src/Http/Middleware/LaravelCaffeineDripMiddleware.php b/src/Http/Middleware/LaravelCaffeineDripMiddleware.php index <HASH>..<HASH> 100644 --- a/src/Http/Middleware/LaravelCaffeineDripMiddleware.php +++ b/src/Http/Middleware/LaravelCaffeineDripMiddleware.php @@ -47,6 +47,13 @@ class LaravelCaffeineDripMiddleware "{$dripper->html}</body>", $content ); + + $content = preg_replace( + '/(<\/body\>?|<\/html\>?|\Z)/', + $dripper->html . '$1', + $content, + 1 + ); $original = $response->original; $response->setContent($content); $response->original = $original;
Added functionality to account for missing body or html closing tags, thanks @tontonsb
GeneaLabs_laravel-caffeine
train
php
709a5c363cf1432936205534ed20d7ed3dc74023
diff --git a/service/s3/customizations.go b/service/s3/customizations.go index <HASH>..<HASH> 100644 --- a/service/s3/customizations.go +++ b/service/s3/customizations.go @@ -21,7 +21,7 @@ func init() { initRequest = func(r *request.Request) { switch r.Operation.Name { - case opPutBucketCors, opPutBucketLifecycle, opPutBucketPolicy, opPutBucketTagging, opDeleteObjects, opPutBucketLifecycleConfiguration: + case opPutBucketCors, opPutBucketLifecycle, opPutBucketPolicy, opPutBucketTagging, opDeleteObjects, opPutBucketLifecycleConfiguration, opPutBucketReplication: // These S3 operations require Content-MD5 to be set r.Handlers.Build.PushBack(contentMD5) case opGetBucketLocation:
service/s3: Add Content-MD5 for PutBucketReplication Adds customizations to the S3 service client for generating MD5 for the PutBucketReplication operation. Fix #<I>
aws_aws-sdk-go
train
go
2a9636e655be317144a0e5678b64d202fcbb5085
diff --git a/varify/samples/management/subcommands/queue.py b/varify/samples/management/subcommands/queue.py index <HASH>..<HASH> 100644 --- a/varify/samples/management/subcommands/queue.py +++ b/varify/samples/management/subcommands/queue.py @@ -9,7 +9,7 @@ from varify.samples.pipeline.handlers import load_samples SAMPLE_DIRS = getattr(settings, 'VARIFY_SAMPLE_DIRS', ()) -log = logging.getLogger(__file__) +log = logging.getLogger(__name__) class Command(BaseCommand):
Use __name__ over __file__ in queue logger
chop-dbhi_varify
train
py
135f529bfc131a9137672be3399e51eecea03f1f
diff --git a/worker/bridge.js b/worker/bridge.js index <HASH>..<HASH> 100644 --- a/worker/bridge.js +++ b/worker/bridge.js @@ -1,10 +1,6 @@ import PromiseWorker from 'promise-worker'; -const uri = process.env.NODE_ENV === 'development' ? - '/panels-worker.js' : - 'https://cdn.uxtemple.com/panels-worker.js'; - -const worker = new Worker(uri); +const worker = new Worker('/panels-worker.js'); const promiseWorker = new PromiseWorker(worker); export default promiseWorker;
fix: always load worker from /panels-worker.js
UXtemple_panels
train
js
7f70c8a95d1318b49d57e09fc3f63998cfa11b63
diff --git a/cake/tests/cases/console/console_output.test.php b/cake/tests/cases/console/console_output.test.php index <HASH>..<HASH> 100644 --- a/cake/tests/cases/console/console_output.test.php +++ b/cake/tests/cases/console/console_output.test.php @@ -200,12 +200,4 @@ class ConsoleOutputTest extends CakeTestCase { $this->output->write('<error>Bad</error> <error>Warning</error> Regular', false); } -/** - * test wrapping blocks at certain widths. - * - * @return void - */ - function testFormatBlock() { - $this->markTestIncomplete('This test needs to be written.'); - } } \ No newline at end of file
Removing a test that doesn't need to be implemented.
cakephp_cakephp
train
php
25d9824615a772ae110eac10c61835a9408571a4
diff --git a/src/Command/DaemonCommand.php b/src/Command/DaemonCommand.php index <HASH>..<HASH> 100644 --- a/src/Command/DaemonCommand.php +++ b/src/Command/DaemonCommand.php @@ -91,16 +91,11 @@ class DaemonCommand extends BackgroundCommand try { $output->writeln('Daemon executing main process.'); parent::background($input, $output); - } catch (\Exception $e) { + } finally { + $output->writeln('Daemon process shutting down.'); if ($pidFile !== null && file_exists($pidFile)) { unlink($pidFile); } - throw $e; - } - - $output->writeln('Daemon process shutting down.'); - if ($pidFile !== null && file_exists($pidFile)) { - unlink($pidFile); } }
Use `finally` to remove duplication
phlib_console-process
train
php
674bb304464869dc7194aae6fe1b14a3840903a2
diff --git a/lib/haml/version.rb b/lib/haml/version.rb index <HASH>..<HASH> 100644 --- a/lib/haml/version.rb +++ b/lib/haml/version.rb @@ -1,3 +1,3 @@ module Haml - VERSION = "3.2.0.alpha.14" + VERSION = "4.0.0.alpha.0" end
Bump to <I>.alpha<I> Note that I've just branch 3-2-stable from master, after a few beta RC's it will become stable. <I> will not be released for at least 6 more months, so don't mistake this for tangible progress on <I>; it's just housekeeping.
haml_haml
train
rb
ba5c0f4a47f53141a62cca4e0a2819242e001564
diff --git a/src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php b/src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php +++ b/src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php @@ -186,6 +186,10 @@ class SymfonyTestsListener extends \PHPUnit_Framework_BaseTestListener public function endTest(\PHPUnit_Framework_Test $test, $time) { if ($this->expectedDeprecations) { + if (!in_array($test->getStatus(), array(\PHPUnit_Runner_BaseTestRunner::STATUS_SKIPPED, \PHPUnit_Runner_BaseTestRunner::STATUS_INCOMPLETE), true)) { + $test->addToAssertionCount(count($this->expectedDeprecations)); + } + restore_error_handler(); if (!in_array($test->getStatus(), array(\PHPUnit_Runner_BaseTestRunner::STATUS_SKIPPED, \PHPUnit_Runner_BaseTestRunner::STATUS_INCOMPLETE, \PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE, \PHPUnit_Runner_BaseTestRunner::STATUS_ERROR), true)) {
Count @expectedDeprecation as an assertion
symfony_symfony
train
php
e16aad38729b279585c00173db313eaf8e0896f5
diff --git a/lib/billy/ssl/certificate_helpers.rb b/lib/billy/ssl/certificate_helpers.rb index <HASH>..<HASH> 100644 --- a/lib/billy/ssl/certificate_helpers.rb +++ b/lib/billy/ssl/certificate_helpers.rb @@ -27,7 +27,7 @@ module Billy # and ensure the location is safely created. Pass # back the resulting path. def write_file(name, contents) - path = File.join(Billy.config.certs_path, name) + path = File.join(Billy.config.certs_path, "#{Process.pid}-#{name}") FileUtils.mkdir_p(File.dirname(path)) File.write(path, contents) path
Include pid in names of temporary files (#<I>)
oesmith_puffing-billy
train
rb
f321bdadc57b3dca04865b0c386523ddadd3e109
diff --git a/src/main/java/org/cp/elements/lang/SystemUtils.java b/src/main/java/org/cp/elements/lang/SystemUtils.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/cp/elements/lang/SystemUtils.java +++ b/src/main/java/org/cp/elements/lang/SystemUtils.java @@ -26,8 +26,8 @@ package org.cp.elements.lang; @SuppressWarnings("unused") public abstract class SystemUtils { - // Present Working Directory (PWD) - public static final String CURRENT_DIRECTORY = System.getProperty("user.dir"); + // define $PATH separator + public static final String PATH_SEPARATOR = System.getProperty("path.separator"); // Java Virtual Machine (JVM) Names public static final String IBM_J9_JVM_NAME = "J9";
Add class member constant referencing the System PATH separator. Remove the CURRENT_DIRECTORY pathname file system reference.
codeprimate-software_cp-elements
train
java
04e512f175b50c60be7b367ec80dba792ea0fc47
diff --git a/lib/conceptql/tree.rb b/lib/conceptql/tree.rb index <HASH>..<HASH> 100644 --- a/lib/conceptql/tree.rb +++ b/lib/conceptql/tree.rb @@ -10,7 +10,7 @@ module ConceptQL end def root(query) - @root ||= traverse(query.statement.symbolize_keys) + @root ||= traverse(query.statement.deep_symbolize_keys) end private
Tree: deep symbolize keys in a statement
outcomesinsights_conceptql
train
rb
2d4794513ea11bb1aee3a40318a33987e9157036
diff --git a/pkg/apis/networking/types.go b/pkg/apis/networking/types.go index <HASH>..<HASH> 100644 --- a/pkg/apis/networking/types.go +++ b/pkg/apis/networking/types.go @@ -491,6 +491,7 @@ type IngressServiceBackend struct { // ServiceBackendPort is the service port being referenced. type ServiceBackendPort struct { // Name is the name of the port on the Service. + // This must be an IANA_SVC_NAME (following RFC6335). // This is a mutually exclusive setting with "Number". // +optional Name string
Update types.go Minor comment on BackendPort Name that should follow IANA. Service port names do not have this restriction so there is a mismatch.
kubernetes_kubernetes
train
go
0c6797d59f0073a341546d17cf52a584e268c028
diff --git a/chess/position.py b/chess/position.py index <HASH>..<HASH> 100644 --- a/chess/position.py +++ b/chess/position.py @@ -23,7 +23,7 @@ import types # TODO: Find a sane order for the members. -san_regex = re.compile('^([NBKRQ])?([a-h])?([1-8])?x?([a-h][1-8])(=[NBRQ])?$') +san_regex = re.compile('^([NBKRQ])?([a-h])?([1-8])?x?([a-h][1-8])(=[NBRQ])?(\+|#)?$') MoveInfo = collections.namedtuple("MoveInfo", [ "move",
Let the SAN regex allow + and # suffixes.
niklasf_python-chess
train
py
39de0478c83fc352eb8d2af054d822fe651cec4d
diff --git a/parfait-spring/src/main/java/com/custardsource/parfait/spring/SelfStartingMonitoringView.java b/parfait-spring/src/main/java/com/custardsource/parfait/spring/SelfStartingMonitoringView.java index <HASH>..<HASH> 100644 --- a/parfait-spring/src/main/java/com/custardsource/parfait/spring/SelfStartingMonitoringView.java +++ b/parfait-spring/src/main/java/com/custardsource/parfait/spring/SelfStartingMonitoringView.java @@ -31,6 +31,10 @@ public class SelfStartingMonitoringView implements Lifecycle { this(MonitorableRegistry.DEFAULT_REGISTRY, monitoringView, quietPeriodInMillis); } + public SelfStartingMonitoringView(MonitorableRegistry registry, MonitoringView monitoringView) { + this(registry, monitoringView, DEFAULT_QUIET_PERIOD); + } + public SelfStartingMonitoringView(MonitorableRegistry registry, MonitoringView monitoringView, final long quietPeriodInMillis) { this.monitoringView = monitoringView; this.monitorableRegistry = registry; @@ -63,4 +67,8 @@ public class SelfStartingMonitoringView implements Lifecycle { public boolean isRunning() { return monitoringView.isRunning(); } + + public static final long defaultQuietPeriod() { + return DEFAULT_QUIET_PERIOD; + } }
Add new constructor that just provides standard default quiescent period, but also provide a static method to return the default period for static import, and Spring config file usage goodness.
performancecopilot_parfait
train
java
2b1fcc4222a8e0d6e18b3d3f5d443c931cfaf7a8
diff --git a/src/commands/run.js b/src/commands/run.js index <HASH>..<HASH> 100644 --- a/src/commands/run.js +++ b/src/commands/run.js @@ -36,7 +36,7 @@ async function startIPFS () { Please install it by going to https://ipfs.io/docs/install`) } - return exec('ipfs', ['daemon']) + return execa('ipfs', ['daemon']) } function getContract (pkg, contract) {
Fix IPFS daemon spawning
aragon_aragon-cli
train
js
c8aca9cd463e64f46f0fb3435b53a544205af62c
diff --git a/core/src/main/java/fi/iki/elonen/NanoHTTPD.java b/core/src/main/java/fi/iki/elonen/NanoHTTPD.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/fi/iki/elonen/NanoHTTPD.java +++ b/core/src/main/java/fi/iki/elonen/NanoHTTPD.java @@ -1102,9 +1102,12 @@ public abstract class NanoHTTPD { FORBIDDEN(403, "Forbidden"), NOT_FOUND(404, "Not Found"), METHOD_NOT_ALLOWED(405, "Method Not Allowed"), + NOT_ACCEPTABLE(406, "Not Acceptable"), REQUEST_TIMEOUT(408, "Request Timeout"), + CONFLICT(409, "Conflict"), RANGE_NOT_SATISFIABLE(416, "Requested Range Not Satisfiable"), INTERNAL_ERROR(500, "Internal Server Error"), + NOT_IMPLEMENTED(501, "Not Implemented"), UNSUPPORTED_HTTP_VERSION(505, "HTTP Version Not Supported"); private final int requestStatus;
Added some HTTP status codes. Closes #<I>
NanoHttpd_nanohttpd
train
java
180edbd8112d42beb9a608ffdecb8ae96ae3ed99
diff --git a/lib/metro/models/properties/animation_property.rb b/lib/metro/models/properties/animation_property.rb index <HASH>..<HASH> 100644 --- a/lib/metro/models/properties/animation_property.rb +++ b/lib/metro/models/properties/animation_property.rb @@ -27,7 +27,7 @@ module Metro # # class Hero < Metro::Model # property :animation, path: "star.png", dimensions: Dimensions.of(25,25) - # dimensions: Metro::Dimensions.of(25,25) } + # dimensions: Dimensions.of(25,25) } # # def draw # animation.image.draw text, x, y, z_order, x_factor, y_factor, color @@ -38,7 +38,7 @@ module Metro # # class Hero < Metro::Model # property :walking, type: :animation, path: "star.png", - # dimensions: Metro::Dimensions.of(25,25) + # dimensions: Dimensions.of(25,25) # # def draw # walking.image.draw text, x, y, z_order, x_factor, y_factor, color
Updated animation property doc for correct use of units
burtlo_metro
train
rb
8e31edab1a1c09d85f12efd8f58c4379b2e8a564
diff --git a/dashboard_app/helpers.py b/dashboard_app/helpers.py index <HASH>..<HASH> 100644 --- a/dashboard_app/helpers.py +++ b/dashboard_app/helpers.py @@ -21,8 +21,9 @@ class DocumentError(ValueError): """ Document error is raised when JSON document is malformed in any way """ - def __init__(self, msg): + def __init__(self, msg, cause=None): super(DocumentError, self).__init__(msg) + self.cause = cause class BundleDeserializer(object): @@ -51,7 +52,7 @@ class BundleDeserializer(object): parse_float=decimal.Decimal) except Exception as ex: raise DocumentError( - "Unable to load document: {0}".format(ex)) + "Unable to load document: {0}".format(ex), ex) def memory_model_to_db_model(self, c_bundle): """
Add ability to chain exceptions to DocumentError
zyga_json-schema-validator
train
py
2c65093b6816cb73718a24953983dbebe7fe9d45
diff --git a/hooker/__main__.py b/hooker/__main__.py index <HASH>..<HASH> 100644 --- a/hooker/__main__.py +++ b/hooker/__main__.py @@ -5,7 +5,10 @@ from .api import EVENTS for arg in sys.argv[1:]: try: - importlib.import_module(arg) + if arg[-3:] == ".py": + importlib.import_module(arg[:-3]) + else: + importlib.import_module(arg) except ModuleNotFoundError: exec(open(arg).read())
[main] Worked around the .py arguments
satori-ng_hooker
train
py
61811a0585cf508958dd076c1457119c225f391a
diff --git a/salt/utils/error.py b/salt/utils/error.py index <HASH>..<HASH> 100644 --- a/salt/utils/error.py +++ b/salt/utils/error.py @@ -6,8 +6,10 @@ Utilities to enable exception reraising across the master commands from __future__ import absolute_import # Import python libs -import exceptions - +try: + import exceptions +except ImportError: + pass # Import salt libs import salt.exceptions
Checking if exceptions module can be imported as it's removed from Python3
saltstack_salt
train
py
698e8de8bf1e5ec1d48ca6a28771c0e35a593695
diff --git a/get-poetry.py b/get-poetry.py index <HASH>..<HASH> 100644 --- a/get-poetry.py +++ b/get-poetry.py @@ -197,7 +197,7 @@ class Installer: dist = os.path.join(dir, 'dist') print(' - Getting dependencies') self.call( - 'pip', 'install', 'poetry=={}'.format(version), + 'python', '-m', 'pip', 'install', 'poetry=={}'.format(version), '--target', dist ) @@ -243,7 +243,7 @@ class Installer: ) self.call( - 'pip', 'install', + 'python', '-m', 'pip', 'install', '--upgrade', '--no-deps', os.path.join(dir, 'poetry-{}-{}.whl'.format(version, tag))
Update get-poetry.py script
sdispater_poetry
train
py
da253044d41b7eced5038000c6932a227630ec01
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -57,7 +57,7 @@ setup( 'ginga.web', 'ginga.web.pgw', 'ginga.web.pgw.js', 'ginga.web.pgw.templates', # Common stuff - 'ginga.misc', 'ginga.misc.plugins', 'ginga.base', + 'ginga.misc', 'ginga.misc.plugins', 'ginga.canvas', 'ginga.canvas.types', 'ginga.util', # Misc 'ginga.icons', 'ginga.doc', 'ginga.tests',
Modified setup.py to remove 'base' directory from install
ejeschke_ginga
train
py
b0a8b19136f8204ee4652db98ace36010a6e0f68
diff --git a/cli.js b/cli.js index <HASH>..<HASH> 100755 --- a/cli.js +++ b/cli.js @@ -42,7 +42,7 @@ CLI.prototype.run = function () { // There was no help options, get IP using canihazip and output it to stdout. else { var canihazip = require('./'); - return canihazip(console.log); + return canihazip().then(console.log); } };
use promise.then rather than callback in cli.js
markogresak_canihazip
train
js
0f29232737df8fe80b3eeb5cc7aae1e8a2895fb0
diff --git a/lib/ehon/version.rb b/lib/ehon/version.rb index <HASH>..<HASH> 100644 --- a/lib/ehon/version.rb +++ b/lib/ehon/version.rb @@ -1,3 +1,3 @@ module Ehon - VERSION = "0.0.1" + VERSION = "0.1.0" end
bumped up version <I>
hekk_ehon
train
rb
1ef15866d0cce4ecb78ef9141c2e7d5b0226ea7e
diff --git a/lib/autowow/commands/vcs.rb b/lib/autowow/commands/vcs.rb index <HASH>..<HASH> 100644 --- a/lib/autowow/commands/vcs.rb +++ b/lib/autowow/commands/vcs.rb @@ -93,6 +93,11 @@ module Autowow cmd + ["reset", "--hard", branch] end + # Doesn't work on Windows + def current_branch_remote + cmd + ["rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}"] + end + include ReflectionUtils::CreateModuleFunctions end end
Adds command to check for branch remote
thisismydesign_autowow
train
rb
f574852125c79d0dc8e92669e044c26ac42a5bd5
diff --git a/pkg/minikube/sysinit/systemd.go b/pkg/minikube/sysinit/systemd.go index <HASH>..<HASH> 100644 --- a/pkg/minikube/sysinit/systemd.go +++ b/pkg/minikube/sysinit/systemd.go @@ -18,6 +18,7 @@ limitations under the License. package sysinit import ( + "errors" "os/exec" "k8s.io/minikube/pkg/minikube/assets" @@ -53,6 +54,9 @@ func (s *Systemd) Disable(svc string) error { // Enable enables a service func (s *Systemd) Enable(svc string) error { + if svc == "kubelet" { + return errors.New("please don't enable kubelet as it creates a race condition; if it starts on systemd boot it will pick up /etc/hosts before we have time to configure /etc/hosts") + } _, err := s.r.RunCmd(exec.Command("sudo", "systemctl", "enable", svc)) return err }
make it impossible to enable the kubelet service
kubernetes_minikube
train
go
535b271fcb9ca74fe7b8e6896f79a7b113f9f05b
diff --git a/lib/jp_prefecture/prefecture.rb b/lib/jp_prefecture/prefecture.rb index <HASH>..<HASH> 100644 --- a/lib/jp_prefecture/prefecture.rb +++ b/lib/jp_prefecture/prefecture.rb @@ -115,6 +115,9 @@ module JpPrefecture # @return [Integer] 見つかった場合は都道府県コード # @return [nil] 見つからない場合は nil def self.find_code_by_name(name) + # nameがnil、空文字の場合は見つからないと判断してnilを返す。 + return nil if name.nil? || name.empty? + name = name.downcase Mapping.data.each do |m|
Appdend gurd to JpPrefecture::Prefecture.find_code_by_name.
chocoby_jp_prefecture
train
rb
a393db24ceb1812a305b4fe83073d3c3522ed487
diff --git a/core/common/src/test/java/alluxio/security/authorization/ModeBitsTest.java b/core/common/src/test/java/alluxio/security/authorization/ModeBitsTest.java index <HASH>..<HASH> 100644 --- a/core/common/src/test/java/alluxio/security/authorization/ModeBitsTest.java +++ b/core/common/src/test/java/alluxio/security/authorization/ModeBitsTest.java @@ -10,6 +10,7 @@ */ package alluxio.security.authorization; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse;
Update ModeBitsTest.java
Alluxio_alluxio
train
java
e615727de71568dfc692bfe74bebfd21142942fe
diff --git a/cdm/src/main/java/ucar/nc2/NetcdfFileWriter.java b/cdm/src/main/java/ucar/nc2/NetcdfFileWriter.java index <HASH>..<HASH> 100644 --- a/cdm/src/main/java/ucar/nc2/NetcdfFileWriter.java +++ b/cdm/src/main/java/ucar/nc2/NetcdfFileWriter.java @@ -469,7 +469,7 @@ public class NetcdfFileWriter { shortName = makeValidObjectName(shortName); if (!isValidDataType(dataType)) - throw new IllegalArgumentException("illegal dataType: "+dataType); + throw new IllegalArgumentException("illegal dataType: "+dataType+" not supported in netcdf-3"); // check unlimited if netcdf-3 if (!version.isNetdf4format()) {
made nicer error message when illegal datatypes encountered trying to write netcdf-3
Unidata_thredds
train
java
70c233e3010ffbcb9eaeeec65944006558afcd43
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -29,8 +29,8 @@ setup( description = "a modern parsing library", license = "MIT", keywords = "Earley LALR parser parsing ast", - url = "https://github.com/erezsh/lark", - download_url = "https://github.com/erezsh/lark/tarball/master", + url = "https://github.com/lark-parser/lark", + download_url = "https://github.com/lark-parser/lark/tarball/master", long_description=''' Lark is a modern general-purpose parsing library for Python.
Update links in pypi (Issue #<I>)
lark-parser_lark
train
py
2e6335d35b3412745facffd3949516a9d54ab0bf
diff --git a/Kwf/Assets/CommonJs/Underscore/TemplateProvider.php b/Kwf/Assets/CommonJs/Underscore/TemplateProvider.php index <HASH>..<HASH> 100644 --- a/Kwf/Assets/CommonJs/Underscore/TemplateProvider.php +++ b/Kwf/Assets/CommonJs/Underscore/TemplateProvider.php @@ -11,7 +11,7 @@ class Kwf_Assets_CommonJs_Underscore_TemplateProvider extends Kwf_Assets_Provide 'underscore' ); - if (file_exists(substr($ret->getAbsoluteFileName(), 0, -15) . '.scss')) { + if (file_exists(substr($ret->getAbsoluteFileName(), 0, -15) . '.scss') && substr($ret->getFileNameWithType(), 0, 13) != 'web/commonjs/') { $ret->addDependency( Kwf_Assets_Dependency_Abstract::DEPENDENCY_TYPE_REQUIRES, new Kwf_Assets_Dependency_File_Scss($this->_providerList, substr($dependencyName, 0, -15) . '.scss')
Fix scss files getting included twice in commonjs when using underscore.tpl
koala-framework_koala-framework
train
php
10356e7453a82b288d8b5b9011890bcae6653735
diff --git a/commons/util/src/main/java/net/automatalib/commons/util/mappings/Mapping.java b/commons/util/src/main/java/net/automatalib/commons/util/mappings/Mapping.java index <HASH>..<HASH> 100644 --- a/commons/util/src/main/java/net/automatalib/commons/util/mappings/Mapping.java +++ b/commons/util/src/main/java/net/automatalib/commons/util/mappings/Mapping.java @@ -36,6 +36,11 @@ import java.util.function.Function; @FunctionalInterface public interface Mapping<D, R> extends Function<D, R> { + @Override + default R apply(D elem) { + return get(elem); + } + /** * Get the range object <code>elem</code> maps to. * @@ -44,10 +49,5 @@ public interface Mapping<D, R> extends Function<D, R> { * * @return the object from the range corresponding to <code>elem</code>. */ - @Override - default R apply(D elem) { - return get(elem); - } - R get(D elem); }
Mapping: move doc to correct method
LearnLib_automatalib
train
java
49fdc026f8eedab17a7f98e8da618270adafb07f
diff --git a/pingparsing/cli.py b/pingparsing/cli.py index <HASH>..<HASH> 100644 --- a/pingparsing/cli.py +++ b/pingparsing/cli.py @@ -22,7 +22,9 @@ QUIET_LOG_LEVEL = logbook.NOTSET def parse_option(): - parser = argparse.ArgumentParser() + parser = argparse.ArgumentParser( + epilog="Issue tracker: https://github.com/thombashi/pingparsing/issues") + if is_use_stdin(): parser.add_argument( "destination_or_file", nargs="+",
Add issue tracker description to pingparsing command
thombashi_pingparsing
train
py
a3301c0dce13f14ff486f2f6eaf9420afe95f4e0
diff --git a/elasticmock/fake_elasticsearch.py b/elasticmock/fake_elasticsearch.py index <HASH>..<HASH> 100644 --- a/elasticmock/fake_elasticsearch.py +++ b/elasticmock/fake_elasticsearch.py @@ -336,7 +336,7 @@ class FakeElasticsearch(Elasticsearch): i = 0 for searchable_index in searchable_indexes: for document in self.__documents_dict[searchable_index]: - if doc_type is not None and document.get('_type') != doc_type: + if doc_type and document.get('_type') != doc_type: continue i += 1 result = { diff --git a/tests/fake_elasticsearch/test_count.py b/tests/fake_elasticsearch/test_count.py index <HASH>..<HASH> 100644 --- a/tests/fake_elasticsearch/test_count.py +++ b/tests/fake_elasticsearch/test_count.py @@ -20,3 +20,8 @@ class TestCount(TestElasticmock): result = self.es.count(index=['users', 'pcs']) self.assertEqual(2, result.get('count')) + + def test_should_count_with_empty_doc_types(self): + self.es.index(index='index', doc_type=DOC_TYPE, body={'data': 'test'}) + count = self.es.count(doc_type=[]) + self.assertEqual(1, count.get('count'))
Fixed count not working with empty doc_type list This will help support Elasticsearch-dsl, which uses doc_type=[] (acceptable by elasticsearch client)
vrcmarcos_elasticmock
train
py,py
3072c3833ac4fb268ae52d286a380875eeebe30f
diff --git a/Branch-SDK/src/io/branch/referral/SystemObserver.java b/Branch-SDK/src/io/branch/referral/SystemObserver.java index <HASH>..<HASH> 100644 --- a/Branch-SDK/src/io/branch/referral/SystemObserver.java +++ b/Branch-SDK/src/io/branch/referral/SystemObserver.java @@ -227,7 +227,8 @@ public class SystemObserver { if ((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 1) { JSONObject packObj = new JSONObject(); try { - String label = appInfo.loadLabel(pm).toString(); + CharSequence labelCs = appInfo.loadLabel(pm); + String label = labelCs == null ? null : labelCs.toString(); if (label != null) packObj.put("name", label); String packName = appInfo.packageName;
A charsequence.toString() is never null Modified this code so it still reflects the old test. However, appInfo.loadLabel(pm) will (currently) not be able to return a null value, as the name or packagename is returned if the label is null. That said, a manufacturer could break this function. Charsequence#toString on a null value raises a NullPointerException
BranchMetrics_android-branch-deep-linking
train
java
234c6dd6850b9966123b90ad1a413d686b439dea
diff --git a/topology/probes/lldp/lldp.go b/topology/probes/lldp/lldp.go index <HASH>..<HASH> 100644 --- a/topology/probes/lldp/lldp.go +++ b/topology/probes/lldp/lldp.go @@ -344,7 +344,10 @@ func (p *Probe) getOrCreate(id graph.Identifier, m graph.Metadata) *graph.Node { // - when the interface is listed in the configuration file or we are in auto discovery mode func (p *Probe) handleNode(n *graph.Node) { firstLayerType, _ := probes.GoPacketFirstLayerType(n) - mac, _ := n.GetFieldString("MAC") + mac, _ := n.GetFieldString("BondSlave.PermMAC") + if mac == "" { + mac, _ = n.GetFieldString("MAC") + } name, _ := n.GetFieldString("Name") if name != "" && mac != "" && firstLayerType == layers.LayerTypeEthernet {
lldp: use permanent mac address instead of mac if present
skydive-project_skydive
train
go
080a33c90459ca08095ea07d9f37f451d5e9c291
diff --git a/upload/system/library/cache.php b/upload/system/library/cache.php index <HASH>..<HASH> 100644 --- a/upload/system/library/cache.php +++ b/upload/system/library/cache.php @@ -10,7 +10,7 @@ class Cache { $class = 'Cache'. $driver; - $this->cache=new $class($expire); + $this->cache = new $class($expire); } else { exit('Error: Could not load cache driver ' . $driver . ' cache!'); } @@ -28,4 +28,3 @@ class Cache { return $this->cache->delete($key); } } -?> \ No newline at end of file
added spaces ( = ) and removed ?>
opencart_opencart
train
php
73b53d933f2285aaa2ecf1672be44eabf2979316
diff --git a/tasklib/backends.py b/tasklib/backends.py index <HASH>..<HASH> 100644 --- a/tasklib/backends.py +++ b/tasklib/backends.py @@ -155,7 +155,7 @@ class TaskWarrior(object): else: escaped_serialized_value = six.u("'{0}'").format(serialized_value) - format_default = lambda: six.u("{0}:{1}").format(field, + format_default = lambda task: six.u("{0}:{1}").format(field, escaped_serialized_value) format_func = getattr(self, 'format_{0}'.format(field),
TaskWarrior: Default formatter needs to take an argument
robgolding_tasklib
train
py
fd7b298218bbb54b73ed610b95dd16cd64d89e53
diff --git a/libraries/commerce/scanner/constants/index.js b/libraries/commerce/scanner/constants/index.js index <HASH>..<HASH> 100644 --- a/libraries/commerce/scanner/constants/index.js +++ b/libraries/commerce/scanner/constants/index.js @@ -28,6 +28,7 @@ export const SCANNER_FORMATS_BARCODE = [ 'CODE_128', 'PDF_417', 'ITF', + 'DATA_MATRIX', ]; export const SCANNER_FORMATS_QR_CODE = ['QR_CODE'];
CCP-<I> added DATA_MATRIX support for scanner
shopgate_pwa
train
js
26f377c4337b2ff7d801a9155fd66992e6d9c57a
diff --git a/pkg/tsdb/cloudwatch/metric_find_query.go b/pkg/tsdb/cloudwatch/metric_find_query.go index <HASH>..<HASH> 100644 --- a/pkg/tsdb/cloudwatch/metric_find_query.go +++ b/pkg/tsdb/cloudwatch/metric_find_query.go @@ -162,7 +162,7 @@ func init() { "AWS/IoT": {"ActionType", "BehaviorName", "CheckName", "JobId", "Protocol", "RuleName", "ScheduledAuditName", "SecurityProfileName"}, "AWS/IoTAnalytics": {"ActionType", "ChannelName", "DatasetName", "DatastoreName", "PipelineActivityName", "PipelineActivityType", "PipelineName"}, "AWS/KMS": {"KeyId"}, - "AWS/Kafka": {"Broker", "Cluster", "Topic"}, + "AWS/Kafka": {"Broker ID", "Cluster Name", "Topic"}, "AWS/Kinesis": {"ShardId", "StreamName"}, "AWS/KinesisAnalytics": {"Application", "Flow", "Id"}, "AWS/KinesisVideo": {},
fix: modifying AWS Kafka dimension names to correct ones (#<I>)
grafana_grafana
train
go
82f85fedd04a876d5b56095d4523e732d3180e13
diff --git a/django_afip/admin.py b/django_afip/admin.py index <HASH>..<HASH> 100644 --- a/django_afip/admin.py +++ b/django_afip/admin.py @@ -99,6 +99,7 @@ class ReceiptAdmin(admin.ModelAdmin): ) return + queryset = queryset.filter(batch__isnull=False) models.ReceiptBatch.objects.create(queryset) create_batch.short_description = _('Create receipt batch')
Don't change the batch of a receipt when mass-editing
WhyNotHugo_django-afip
train
py
5fb30979c1b81236c7ab67e499befe65d027d9e3
diff --git a/src/xterm.js b/src/xterm.js index <HASH>..<HASH> 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -1118,6 +1118,11 @@ Terminal.prototype.refresh = function(start, end) { } }; +/** + * Queues linkification for the specified rows. + * @param {number} start The row to start from (between 0 and this.rows - 1). + * @param {number} end The row to end at (between start and this.rows - 1). + */ Terminal.prototype.queueLinkification = function(start, end) { if (this.linkifier) { for (let i = start; i <= end; i++) {
Add jsdoc back, was lost in merge
xtermjs_xterm.js
train
js
602cc540a04c101a5b9833603a90da55f413aa92
diff --git a/includes/version.php b/includes/version.php index <HASH>..<HASH> 100644 --- a/includes/version.php +++ b/includes/version.php @@ -3,7 +3,7 @@ * YOURLS version * */ -define( 'YOURLS_VERSION', '1.7.1' ); +define( 'YOURLS_VERSION', '1.7.2' ); /** * YOURLS DB version. Increments when changes are made to the DB schema, to trigger a DB update
Prepare potential next bugfix release Next dot release stuff should get committed in their own branch
YOURLS_YOURLS
train
php
505efccbcd1865d60fed9870ecf9351054a99242
diff --git a/src/components/slider/index.js b/src/components/slider/index.js index <HASH>..<HASH> 100644 --- a/src/components/slider/index.js +++ b/src/components/slider/index.js @@ -121,6 +121,8 @@ export default class Slider extends PureBaseComponent { this.initialThumbSize = THUMB_SIZE; this.checkProps(props); + + this.createPanResponderConfig(); } checkProps(props) { @@ -132,7 +134,7 @@ export default class Slider extends PureBaseComponent { } } - UNSAFE_componentWillMount() { + createPanResponderConfig() { this._panResponder = PanResponder.create({ onMoveShouldSetPanResponder: this.handleMoveShouldSetPanResponder, onPanResponderGrant: this.handlePanResponderGrant,
moving componentWillMount code to c'tor (#<I>)
wix_react-native-ui-lib
train
js
f1e01e12bfc0b9855e924a9275ef545abc916d84
diff --git a/karyon2-admin/src/main/java/netflix/adminresources/AdminResourcesContainer.java b/karyon2-admin/src/main/java/netflix/adminresources/AdminResourcesContainer.java index <HASH>..<HASH> 100644 --- a/karyon2-admin/src/main/java/netflix/adminresources/AdminResourcesContainer.java +++ b/karyon2-admin/src/main/java/netflix/adminresources/AdminResourcesContainer.java @@ -99,6 +99,16 @@ public class AdminResourcesContainer { private AtomicBoolean alreadyInited = new AtomicBoolean(false); private int serverPort; // actual server listen port (apart from what's in Config) + @Inject + public AdminResourcesContainer() {} + + public AdminResourcesContainer(Injector appInjector, AdminContainerConfig adminContainerConfig, + AdminPageRegistry adminPageRegistry) { + this.appInjector = appInjector; + this.adminContainerConfig = adminContainerConfig; + this.adminPageRegistry = adminPageRegistry; + } + /** * Starts the container and hence the embedded jetty server. *
create constructor for AdminResourcesContainer for use outside of guice
Netflix_karyon
train
java
093b46582dbe578c665485975539d4c91586f7b7
diff --git a/instaLooter.py b/instaLooter.py index <HASH>..<HASH> 100644 --- a/instaLooter.py +++ b/instaLooter.py @@ -32,7 +32,7 @@ try: import lxml PARSER = 'lxml' except ImportError: - PARSER = 'html' + PARSER = 'html.parser' class InstaDownloader(threading.Thread):
Fix parser naming for BeautifulSoup
althonos_InstaLooter
train
py
c100e40715c623cbc56012ca957a4b2676870830
diff --git a/clientv3/client.go b/clientv3/client.go index <HASH>..<HASH> 100644 --- a/clientv3/client.go +++ b/clientv3/client.go @@ -86,6 +86,7 @@ func NewFromConfigFile(path string) (*Client, error) { // Close shuts down the client's etcd connections. func (c *Client) Close() error { c.cancel() + c.Watcher.Close() return toErr(c.ctx, c.conn.Close()) } diff --git a/clientv3/watch.go b/clientv3/watch.go index <HASH>..<HASH> 100644 --- a/clientv3/watch.go +++ b/clientv3/watch.go @@ -396,15 +396,17 @@ func (w *watchGrpcStream) run() { for _, ws := range w.substreams { if _, ok := closing[ws]; !ok { close(ws.recvc) + closing[ws] = struct{}{} } } for _, ws := range w.resuming { if _, ok := closing[ws]; ws != nil && !ok { close(ws.recvc) + closing[ws] = struct{}{} } } w.joinSubstreams() - for toClose := len(w.substreams) + len(w.resuming); toClose > 0; toClose-- { + for range closing { w.closeSubstream(<-w.closingc) }
clientv3: only receive from closing streams in Watcher close Was overcounting the number of expected closing messages; the resuming list may have nil entries. Also the full client wasn't closing the watcher client, only canceling its context, so client closes weren't joining with the watcher shutdown. Fixes #<I>
etcd-io_etcd
train
go,go
cafbd89e43f99d6a5939c1be0f563687d102ef27
diff --git a/lib/bud/collections.rb b/lib/bud/collections.rb index <HASH>..<HASH> 100644 --- a/lib/bud/collections.rb +++ b/lib/bud/collections.rb @@ -490,7 +490,6 @@ module Bud end end - require 'ruby-debug'; debugger if finals.length == 0 and agg_in.length > 0 if block_given? finals.map{|r| yield r} else
remove stray debugging statement
bloom-lang_bud
train
rb
d761aeaec1c0b6021c34c296b7d01ac42748315d
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -5,8 +5,6 @@ try: from setuptools import setup, Command, find_packages except ImportError: from distutils.core import setup -import pip -from pip.req import parse_requirements class PyTest(Command):
removed unused imports from setup.py
Aplopio_django_rip
train
py
c6f292c0d8637b39cf28fe2f81c1e30ced7c6d8b
diff --git a/tests/plugins/test_flatpak_create_oci.py b/tests/plugins/test_flatpak_create_oci.py index <HASH>..<HASH> 100644 --- a/tests/plugins/test_flatpak_create_oci.py +++ b/tests/plugins/test_flatpak_create_oci.py @@ -474,7 +474,8 @@ COMMAND_PATTERNS = [ (['flatpak', 'build-bundle', '@repo', '--oci', '@filename', '@name', '@branch'], MockFlatpak.build_bundle), - (['flatpak', 'build-export', '@repo', '@directory', '@branch'], + # For build-export, we assume the latest flatpak version for flatpak_module_tools compatibility + (['flatpak', 'build-export', '@repo', '@directory', '@branch', '--disable-sandbox'], MockFlatpak.build_export), (['flatpak', 'build-finish', '--command', '@command'] + FLATPAK_APP_FINISH_ARGS + ['@directory'],
Comply with latest Flatpak changes flatpak-module-tools can now handle disabling Flatpak sandboxing when checking icons, which is needed to run atomic-reactor in a container for Flatpak >= <I>. For that, we assume Flatpak >= <I> if flatpak is mocked.
projectatomic_atomic-reactor
train
py
a8d0143974471b17ba0283bb97a14692b33896d4
diff --git a/json_span.go b/json_span.go index <HASH>..<HASH> 100644 --- a/json_span.go +++ b/json_span.go @@ -124,7 +124,8 @@ func newW3CForeignParent(trCtx w3ctrace.Context) *ForeignParent { // Span represents the OpenTracing span document to be sent to the agent type Span struct { - TraceID int64 `json:"t"` + TraceID int64 `json:"-"` + TraceID128 string `json:"t"` ParentID int64 `json:"p,omitempty"` SpanID int64 `json:"s"` Timestamp uint64 `json:"ts"` @@ -145,6 +146,7 @@ func newSpan(span *spanS) Span { data := RegisteredSpanType(span.Operation).ExtractData(span) sp := Span{ TraceID: span.context.TraceID, + TraceID128: FormatLongID(span.context.TraceIDHi, span.context.TraceID), ParentID: span.context.ParentID, SpanID: span.context.SpanID, Timestamp: uint64(span.Start.UnixNano()) / uint64(time.Millisecond),
Send <I>-bit trace IDs to the agent
instana_go-sensor
train
go
a0a941539e6d908b98acf941e0e1cf475b7e5a29
diff --git a/lib/app.js b/lib/app.js index <HASH>..<HASH> 100644 --- a/lib/app.js +++ b/lib/app.js @@ -189,6 +189,7 @@ if (require.main === module) { config.load(argv._[0]) .then((cfg) => { exports.log(`Loaded configuration file: ${argv._[0]}`); + process.chdir(config.basePath); return cfg; }) .then((cfg) => {
chdir to the directory containing the config file on startup fixed #<I>
SockDrawer_SockBot
train
js
cc8b32eb8be9d9de40bd397a9be029731ffb57b8
diff --git a/system/Model.php b/system/Model.php index <HASH>..<HASH> 100644 --- a/system/Model.php +++ b/system/Model.php @@ -1129,7 +1129,7 @@ class Model * * @return array|null */ - public function paginate(int $perPage = null, string $group = 'default', int $page = 0) + public function paginate(int $perPage = null, string $group = 'default', int $page = 0, int $segment = 0) { $pager = \Config\Services::pager(null, null, false); $page = $page >= 1 ? $page : $pager->getCurrentPage($group); @@ -1138,7 +1138,7 @@ class Model // Store it in the Pager library so it can be // paginated in the views. - $this->pager = $pager->store($group, $page, $perPage, $total); + $this->pager = $pager->store($group, $page, $perPage, $total,$segment); $perPage = $this->pager->getPerPage($group); $offset = ($page - 1) * $perPage;
add $segment option in pager call by Model.php add the $segment option when the Pager library is call by the model paginate function
codeigniter4_CodeIgniter4
train
php
ba853a6b91b1c8615a95118a8858fc5677b4d0a7
diff --git a/Kwf_js/EyeCandy/Lightbox/Lightbox.js b/Kwf_js/EyeCandy/Lightbox/Lightbox.js index <HASH>..<HASH> 100644 --- a/Kwf_js/EyeCandy/Lightbox/Lightbox.js +++ b/Kwf_js/EyeCandy/Lightbox/Lightbox.js @@ -417,7 +417,7 @@ Lightbox.prototype = { var closeLightbox = (function() { //didn't change yet, wait a bit longer if (previousEntries == historyState.entries) { - closeLightbox.defer(10, this); + setTimeout(closeLightbox.bind(this), 10); return; } //check if there is still a lightbox open @@ -425,13 +425,13 @@ Lightbox.prototype = { if (historyState.currentState.lightbox) { previousEntries = historyState.entries; history.back(); - closeLightbox.defer(1, this); + setTimeout(closeLightbox.bind(this), 1); } else { //last entry in history that had lightbox open onlyCloseOnPopstate = false; } }); - closeLightbox.defer(1, this); + setTimeout(closeLightbox.bind(this), 1); } else { delete historyState.currentState.lightbox; historyState.replaceState(document.title, this.closeHref);
change the defer() to setTimeout() defer() is a ext function, but ext is not longer in koala-frontend. Instead of defer() we use simple setTimeout() now.
koala-framework_koala-framework
train
js
b9602fc6dbb72ece9f81a474f5ba8b2a529eb7f2
diff --git a/slither/tools/upgradeability/compare_function_ids.py b/slither/tools/upgradeability/compare_function_ids.py index <HASH>..<HASH> 100644 --- a/slither/tools/upgradeability/compare_function_ids.py +++ b/slither/tools/upgradeability/compare_function_ids.py @@ -12,7 +12,8 @@ logger = logging.getLogger("Slither-check-upgradeability") def get_signatures(c): functions = c.functions - functions = [f.full_name for f in functions if f.visibility in ['public', 'external'] and not f.is_constructor] + functions = [f.full_name for f in functions if f.visibility in ['public', 'external'] and + not f.is_constructor and not f.is_fallback] variables = c.state_variables variables = [variable.name+ '()' for variable in variables if variable.visibility in ['public']]
upgradeability check: remove FP in case of fallback function collision (fix #<I>)
crytic_slither
train
py
8718cf1675c358bba7299b8b2e785c410a6c3ca8
diff --git a/kafka_consumer/check.py b/kafka_consumer/check.py index <HASH>..<HASH> 100644 --- a/kafka_consumer/check.py +++ b/kafka_consumer/check.py @@ -30,7 +30,7 @@ DEFAULT_KAFKA_TIMEOUT = 5 DEFAULT_ZK_TIMEOUT = 5 DEFAULT_KAFKA_RETRIES = 3 -CONTEXT_UPPER_BOUND = 100 +CONTEXT_UPPER_BOUND = 200 class BadKafkaConsumerConfiguration(Exception):
[kafka_consumer] bumping up context limit upper bound.
DataDog_integrations-core
train
py
d6526753eee2d7cc16c8c5bb6477e5eac642fc38
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -77,10 +77,6 @@ DynamoDBDOWN.prototype._open = function (options, cb) { } } -DynamoDBDOWN.prototype._close = function (cb) { - cb() -} - DynamoDBDOWN.prototype._put = function (key, value, options, cb) { const params = { TableName: this.encodedTableName,
refactor: use abstract implementation of `_close`
KlausTrainer_dynamodbdown
train
js
a79920c2b106001a1f4dc5c35679fd34ed73b3b3
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -137,7 +137,8 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' +# html_theme = 'default' +html_theme = 'alabaster' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the
changed to alabaster theme for a while
tomnor_channelpack
train
py
5cd593a5ec0dd2c09538894dcd16850a044358a4
diff --git a/lib/server.js b/lib/server.js index <HASH>..<HASH> 100644 --- a/lib/server.js +++ b/lib/server.js @@ -303,7 +303,7 @@ function Server(options) { log.trace('%s shutdown', c.ldap.id); }); c.addListener('error', function (err) { - log.warn('%s unexpected connection error', c.ldap.id, err); + log.error('%s unexpected connection error', c.ldap.id, err); c.destroy(); }); c.addListener('close', function (had_err) { @@ -377,7 +377,7 @@ function Server(options) { } if (err) { - log.trace('%s sending error: %s', req.logId, err.stack || err); + log.error('%s sending error: %s', req.logId, err.stack || err); sendError(err); return after(); }
Log errors with error log level instead of trace.
joyent_node-ldapjs
train
js
d4249a07c07dc7e54e25a4413731b3f55eb618c2
diff --git a/core/server/services/members/api.js b/core/server/services/members/api.js index <HASH>..<HASH> 100644 --- a/core/server/services/members/api.js +++ b/core/server/services/members/api.js @@ -74,11 +74,14 @@ function getStripePaymentConfig() { return null; } + const webhookHandlerUrl = new URL('/members/webhooks/stripe', siteUrl); + return { publicKey: stripePaymentProcessor.config.public_token, secretKey: stripePaymentProcessor.config.secret_token, checkoutSuccessUrl: siteUrl, checkoutCancelUrl: siteUrl, + webhookHandlerUrl: webhookHandlerUrl.href, product: stripePaymentProcessor.config.product, plans: stripePaymentProcessor.config.plans, appInfo: { diff --git a/core/server/web/site/app.js b/core/server/web/site/app.js index <HASH>..<HASH> 100644 --- a/core/server/web/site/app.js +++ b/core/server/web/site/app.js @@ -155,6 +155,7 @@ module.exports = function setupSiteApp(options = {}) { res.end(err.message); } }); + siteApp.post('/members/webhooks/stripe', membersService.api.middleware.handleStripeWebhook); siteApp.use(async function (req, res, next) { if (!labsService.isSet('members')) { req.member = null;
Wired up the members webhook handler endpoint no-issue
TryGhost_Ghost
train
js,js
40beda7287059c1785ee6c2026fadb61fb39774e
diff --git a/out_response.js b/out_response.js index <HASH>..<HASH> 100644 --- a/out_response.js +++ b/out_response.js @@ -27,6 +27,7 @@ var inherits = require('util').inherits; var errors = require('./errors'); var States = require('./reqres_states'); +/*eslint max-statements: [2, 40]*/ function TChannelOutResponse(id, options) { options = options || {}; var self = this;
linting: [out_response] comply with max-statements rule
uber_tchannel-node
train
js
a7a8af7870d2933acaf9ce40b74091606efba325
diff --git a/src/components/core/core.js b/src/components/core/core.js index <HASH>..<HASH> 100644 --- a/src/components/core/core.js +++ b/src/components/core/core.js @@ -218,11 +218,9 @@ class Core extends UIObject { this.$el.append(style) this.$el.append(this.mediaControl.render().el) - this.$el.ready(() => { - this.options.width = this.options.width || this.$el.width() - this.options.height = this.options.height || this.$el.height() - this.updateSize() - }) + this.options.width = this.options.width || this.$el.width() + this.options.height = this.options.height || this.$el.height() + this.updateSize() return this }
core: remove ready call to run update size imediatelly
clappr_clappr
train
js
f5219ff2daff94a798b084fb75fd1da2d6ea6c73
diff --git a/src/tile_source.js b/src/tile_source.js index <HASH>..<HASH> 100644 --- a/src/tile_source.js +++ b/src/tile_source.js @@ -216,9 +216,9 @@ export class MapboxFormatTileSource extends NetworkTileSource { this.VectorTile = require('vector-tile').VectorTile; // Mapbox vector tile lib, forked to add GeoJSON output } - parseTile (tile) { + parseTile (tile, response) { // Convert Mapbox vector tile to GeoJSON - var data = new Uint8Array(tile.xhr.response); + var data = new Uint8Array(response); var buffer = new this.Protobuf(data); tile.data = new this.VectorTile(buffer); tile.layers = tile.data.toGeoJSON();
fix Mapbox tile source to work with XHR wrapper
tangrams_tangram
train
js
24a17b90716f2be90490a641ef8ac21e25182865
diff --git a/msgpackstream/backend/pyc/stream.py b/msgpackstream/backend/pyc/stream.py index <HASH>..<HASH> 100644 --- a/msgpackstream/backend/pyc/stream.py +++ b/msgpackstream/backend/pyc/stream.py @@ -132,7 +132,7 @@ class UnpackerIterator(object): -def unpack(instream, buffersize=4000, parsers=[]): +def unpack(instream, buffersize=5000, parsers=[]): '''`` Creates an iterator instance for the unpacker :param instream: diff --git a/msgpackstream/backend/python/stream.py b/msgpackstream/backend/python/stream.py index <HASH>..<HASH> 100644 --- a/msgpackstream/backend/python/stream.py +++ b/msgpackstream/backend/python/stream.py @@ -496,7 +496,7 @@ class StreamUnpacker(): -def unpack(instream, buffersize=4000, parsers=[]): +def unpack(instream, buffersize=5000, parsers=[]): ''' Creates an iterator instance for the unpacker :param instream:
increased default buffersize to <I>
salimm_msgpack-pystream
train
py,py
307f47e23a061bc5669633c25b762d4b17351b06
diff --git a/lib/kafka/consumer.rb b/lib/kafka/consumer.rb index <HASH>..<HASH> 100644 --- a/lib/kafka/consumer.rb +++ b/lib/kafka/consumer.rb @@ -400,8 +400,10 @@ module Kafka operation.execute rescue NoPartitionsToFetchFrom - @logger.warn "There are no partitions to fetch from, sleeping for #{max_wait_time}s" - sleep max_wait_time + backoff = max_wait_time > 0 ? max_wait_time : 1 + + @logger.warn "There are no partitions to fetch from, sleeping for #{backoff}s" + sleep backoff retry rescue OffsetOutOfRange => e
Guard against max_wait_time being zero
zendesk_ruby-kafka
train
rb
35781ecba9d1980f81e7a6cbead1791541aed575
diff --git a/streamfield_tools/blocks/struct_block.py b/streamfield_tools/blocks/struct_block.py index <HASH>..<HASH> 100644 --- a/streamfield_tools/blocks/struct_block.py +++ b/streamfield_tools/blocks/struct_block.py @@ -77,12 +77,12 @@ class MultiRenditionStructBlock(StructBlock): rendition = self._rendition_set_config.get( value['render_as'] ) + context = self.get_context(value) + context['self'] = value + context['image_rendition'] = rendition.image_rendition or 'original' + context['addl_classes'] = value['addl_classes'] return rendition.template.render( - { - 'self': value, - 'image_rendition': rendition.image_rendition or 'original', - 'addl_classes': value['addl_classes'] - } + context ) def to_python(self, value): @@ -123,11 +123,8 @@ class RenditionAwareStructBlock(RenditionMixIn, StructBlock): except AttributeError: template = self.meta.template - return render_to_string( - template, - { - 'self': value, - 'image_rendition': self.rendition.image_rendition - or 'original' - } - ) + + context = self.get_context(value) + context['self'] = value + context['image_rendition'] = rendition.image_rendition or 'original' + return render_to_string(template, context)
added context to struct block rendering so 'get_context' works for subclasses
WGBH_wagtail-streamfieldtools
train
py
927e5b24b6d1891e2f29c401a00efadcbaffb110
diff --git a/tests/test_write_readback.py b/tests/test_write_readback.py index <HASH>..<HASH> 100755 --- a/tests/test_write_readback.py +++ b/tests/test_write_readback.py @@ -89,8 +89,9 @@ class TestWriteReadbackCpythonMatlab(unittest.TestCase): self.assertEqual(a, b) def assert_equal_numpy(self, a, b): - self.assertTrue(type(a) == type(b) and a.dtype == b.dtype - and a.shape == b.shape and np.all(a == b)) + self.assertTrue(type(a) == type(b) and a.dtype == b.dtype \ + and a.shape == b.shape and np.all((a == b) \ + | (np.isnan(a) & np.isnan(b)))) def test_None(self): data = None
Fixed issue in test where NaN's were causing equality tests to fail.
frejanordsiek_hdf5storage
train
py
46d54ba3f7cc7cce1bf6acfb29893099ce2b7ee2
diff --git a/controller/frontend/src/Controller/Frontend/Basket/Default.php b/controller/frontend/src/Controller/Frontend/Basket/Default.php index <HASH>..<HASH> 100644 --- a/controller/frontend/src/Controller/Frontend/Basket/Default.php +++ b/controller/frontend/src/Controller/Frontend/Basket/Default.php @@ -245,8 +245,8 @@ class Controller_Frontend_Basket_Default if( empty( $prices ) ) { - $productItem = $productManager->getItem( $product->getProductId(), array( 'price' ) ); - $prices = $productItem->getRefItems( 'price', 'default' ); + $parentItem = $productManager->getItem( $product->getProductId(), array( 'price' ) ); + $prices = $parentItem->getRefItems( 'price', 'default' ); } $priceManager = MShop_Factory::createManager( $context, 'price' );
Fixes stock level check for selection product variants
Arcavias_arcavias-core
train
php
a061a3504b434ea78601ebc02a045514d2b2e2ac
diff --git a/Command/AtoumCommand.php b/Command/AtoumCommand.php index <HASH>..<HASH> 100644 --- a/Command/AtoumCommand.php +++ b/Command/AtoumCommand.php @@ -80,7 +80,7 @@ EOF } foreach ($directories as $directory) { - $runner->addTestAllDirectory($directory); + $runner->getRunner()->addTestsFromDirectory($directory); } }
Fix use of deprecated addTestAllDirectory in AtoumCommand
atoum_AtoumBundle
train
php
1ab4b1fa1a63c53e243badca01a918660a75c632
diff --git a/tests/integ/test_basic.py b/tests/integ/test_basic.py index <HASH>..<HASH> 100644 --- a/tests/integ/test_basic.py +++ b/tests/integ/test_basic.py @@ -56,7 +56,7 @@ def test_stream_creation(engine): assert "arn" in StreamCreation.Meta.stream -def test_model_overlap(session, engine): +def test_model_overlap(dynamodb, engine): """Two models backed by the same table, with different indexes""" class FirstOverlap(BaseModel): class Meta: @@ -100,8 +100,7 @@ def test_model_overlap(session, engine): # the test framework to allow parallel runs "TableName": FirstOverlap.Meta.table_name } - client = session.client("dynamodb") - client.create_table(**combined_table) + dynamodb.create_table(**combined_table) # Now, both of these binds should see the particular subset of indexes/attribute names that they care about engine.bind(FirstOverlap)
renamed client fixture in integ test
numberoverzero_bloop
train
py
1dd4616dfe8c4e57358295c824fdfe798e26cd9a
diff --git a/lib/data_mapper/relationship.rb b/lib/data_mapper/relationship.rb index <HASH>..<HASH> 100644 --- a/lib/data_mapper/relationship.rb +++ b/lib/data_mapper/relationship.rb @@ -124,9 +124,7 @@ module DataMapper @options = options.to_hash @source_model = source_model - @target_model = target_model || options.fetch(:model) - @source_key = Array(options[:source_key] || default_source_key).freeze - @target_key = Array(options[:target_key] || default_target_key).freeze + @target_model = target_model @through = options[:through] @via = options[:via] @@ -134,6 +132,8 @@ module DataMapper @min = options.fetch(:min, 1) @max = options.fetch(:max, 1) + + initialize_keys end def finalize(mapper_registry) @@ -157,6 +157,11 @@ module DataMapper DEFAULT_SOURCE_KEY = [ :id ].freeze DEFAULT_TARGET_KEY = [].freeze + def initialize_keys + @source_key = Array(options[:source_key] || default_source_key).freeze + @target_key = Array(options[:target_key] || default_target_key).freeze + end + # Returns default name of the source key # # @return [Symbol,nil]
Simplify Relationship#initialize
rom-rb_rom
train
rb
31bb47f8aca98795126149359b7aaeb54b0bce1e
diff --git a/solvebio/cli/ipython.py b/solvebio/cli/ipython.py index <HASH>..<HASH> 100644 --- a/solvebio/cli/ipython.py +++ b/solvebio/cli/ipython.py @@ -8,6 +8,7 @@ def launch_ipython_shell(args): # pylint: disable=unused-argument except ImportError: print("The SolveBio Python shell requires IPython.\n" "To install, type: 'pip install ipython'") + return False try: # see if we're already inside IPython
make sure to return after the ipython cli fails to import ipython
solvebio_solvebio-python
train
py
ce4e0a475dc9e32d3d09e0151440a0de16491901
diff --git a/test/tools/javac/nio/compileTest/CompileTest.java b/test/tools/javac/nio/compileTest/CompileTest.java index <HASH>..<HASH> 100644 --- a/test/tools/javac/nio/compileTest/CompileTest.java +++ b/test/tools/javac/nio/compileTest/CompileTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ * @test * @bug 6906175 6915476 6915497 7006564 * @summary Path-based JavaFileManager - * @compile -g HelloPathWorld.java + * @compile -g CompileTest.java HelloPathWorld.java * @run main CompileTest */
<I>: tools/javac/nio/CompileTest failing in nightly test Reviewed-by: mcimadamore
wmdietl_jsr308-langtools
train
java
746fc331231026a221166254e33ea459b9d923c7
diff --git a/spec/video/where_spec.rb b/spec/video/where_spec.rb index <HASH>..<HASH> 100644 --- a/spec/video/where_spec.rb +++ b/spec/video/where_spec.rb @@ -27,7 +27,7 @@ describe 'Yt::Video.where', :server do end it 'makes as many HTTP requests as the number of videos divided by 50', requests: 2 do - Yt::Video.where(id: video_ids).map &:id + Yt::Video.where(id: video_ids.drop(1)).map &:id end it 'makes as many HTTP requests as the number of videos divided by 50 to calculate the size', requests: 2 do
Fix failing test To count the correct number of requests, don't reuse exactly the same request as the other test.
Fullscreen_yt-core
train
rb
f0b92d1c467983e3a13eb2ba6342ddfc06d90f52
diff --git a/src/main/java/com/dlsc/preferencesfx/view/CategoryPresenter.java b/src/main/java/com/dlsc/preferencesfx/view/CategoryPresenter.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/dlsc/preferencesfx/view/CategoryPresenter.java +++ b/src/main/java/com/dlsc/preferencesfx/view/CategoryPresenter.java @@ -32,11 +32,24 @@ public class CategoryPresenter implements Presenter { */ @Override public void initializeViewParts() { + initializeTranslation(); initializeForm(categoryView.form); categoryView.initializeFormRenderer(); } /** + * Sets up a binding of the TranslationService on the model, so that this Category's title gets + * translated properly according to the TranslationService used. + */ + private void initializeTranslation() { + model.translationServiceProperty().addListener((observable, oldValue, newValue) -> { + categoryModel.translate(); + // listen for i18n changes in the TranslationService for this Category + newValue.addListener(() -> categoryModel.translate()); + }); + } + + /** * Fills the {@link Form} with {@link Group} and {@link Setting} of this {@link Category}. * * @param form the form to be initialized
applied changes from i<I>n branch
dlemmermann_PreferencesFX
train
java
363df28dc6aa990247d99852e1f73095acbd4cf5
diff --git a/javascript/webdriver/stacktrace.js b/javascript/webdriver/stacktrace.js index <HASH>..<HASH> 100644 --- a/javascript/webdriver/stacktrace.js +++ b/javascript/webdriver/stacktrace.js @@ -562,11 +562,14 @@ webdriver.stacktrace.parseLongFirefoxFrame_ = function(frameStr) { * V8 prepends the string representation of an error to its stack trace. * This function trims the string so that the stack trace can be parsed * consistently with the other JS engines. - * @param {!(Error|goog.testing.JsUnitException)} error The error. + * @param {(Error|goog.testing.JsUnitException)} error The error. * @return {string} The stack trace string. * @private */ webdriver.stacktrace.getStack_ = function(error) { + if (!error) { + return ''; + } var stack = error.stack || error.stackTrace || ''; var errorStr = error + '\n'; if (goog.string.startsWith(stack, errorStr)) {
Loosen input type to webdriver.stacktrace.getStack_ to account for an rare condition in FF <I>+ where the Error() constructor returns undefined (not sure what causes it, just know it happens)
SeleniumHQ_selenium
train
js
b2cd79a2c54abc552356788e3c496ff582f8f9f9
diff --git a/pymux/main.py b/pymux/main.py index <HASH>..<HASH> 100644 --- a/pymux/main.py +++ b/pymux/main.py @@ -13,7 +13,6 @@ from prompt_toolkit.interface import CommandLineInterface from prompt_toolkit.key_binding.vi_state import InputMode, ViState from prompt_toolkit.layout.screen import Size from prompt_toolkit.terminal.vt100_output import Vt100_Output, _get_size -from prompt_toolkit.utils import Callback from .arrangement import Arrangement, Pane, Window from .commands.commands import handle_command, call_command_handler @@ -390,6 +389,12 @@ class Pymux(object): input=input, eventloop=self.eventloop) + # Set render postpone time. (.1 instead of 0). + # This small change ensures that if for a split second a process + # outputs a lot of information, we don't give the highest priority to + # rendering output. (Nobody reads that fast in real-time.) + cli.max_render_postpone_time = .1 # Second. + # Hide message when a key has been pressed. def key_pressed(): self.get_client_state(cli).message = None
Set render postpone time to <I> (This improves the performance.)
prompt-toolkit_pymux
train
py
f4cce8c509439cc2a587d92b5039a6b880146108
diff --git a/biz/webui/cgi-bin/util.js b/biz/webui/cgi-bin/util.js index <HASH>..<HASH> 100644 --- a/biz/webui/cgi-bin/util.js +++ b/biz/webui/cgi-bin/util.js @@ -16,6 +16,10 @@ exports.getClientId = function() { }; exports.getServerInfo = function(req) { + var baseDir; + if (!config.networkMode && !config.pluginsMode) { + baseDir = config.baseDirHash; + } var info = { pid: PID, pInfo: proc, @@ -30,7 +34,7 @@ exports.getServerInfo = function(req) { rulesMode: config.rulesMode, strictMode: config.strict, multiEnv: config.multiEnv, - baseDir: config.baseDirHash, + baseDir: baseDir, username: config.username, nodeVersion: process.version, latestVersion: properties.getLatestVersion('latestVersion'),
refactor: hide baseDir in network or plugins mode
avwo_whistle
train
js
a9839d06592ca9a36cd7d906113044d3734f588f
diff --git a/vendor/Devvoh/Fluid/Bootstrap.php b/vendor/Devvoh/Fluid/Bootstrap.php index <HASH>..<HASH> 100644 --- a/vendor/Devvoh/Fluid/Bootstrap.php +++ b/vendor/Devvoh/Fluid/Bootstrap.php @@ -51,9 +51,15 @@ spl_autoload_register(function ($class) { */ spl_autoload_register(function ($class) { if (strpos($class, '_model') !== false) { + // Remove _model from the end in the most concrete way possible (str_replace might remove too many, + // and rtrim sometimes removed too much as well). $classParts = explode('_', $class); - $modelName = $classParts[0]; - $modelType = $classParts[1]; + $lastPart = count($classParts) - 1; + if ($classParts[$lastPart] == 'model') { + unset($classParts[$lastPart]); + } + $modelName = implode('_', $classParts); + foreach (\Devvoh\Fluid\App::getModules() as $module) { $path = $module['path'] . DS . 'model' . DS . $modelName . '.php'; if (is_file($path)) {
Fixed entity/model autoloader so it can load under_scored models properly.
devvoh_parable
train
php
c7d6058510ac693fc7a1603fa23dc178265240d8
diff --git a/service/cloudhsm/examples_test.go b/service/cloudhsm/examples_test.go index <HASH>..<HASH> 100644 --- a/service/cloudhsm/examples_test.go +++ b/service/cloudhsm/examples_test.go @@ -21,7 +21,7 @@ func ExampleCloudHSM_AddTagsToResource() { params := &cloudhsm.AddTagsToResourceInput{ ResourceArn: aws.String("String"), // Required TagList: []*cloudhsm.Tag{ // Required - { // Required + &cloudhsm.Tag{ // Required Key: aws.String("TagKey"), // Required Value: aws.String("TagValue"), // Required },
cloudhsm: Update client to latest
aws_aws-sdk-go
train
go
11bc1726d373811a4ce643eed4fdf93b2d95a04c
diff --git a/spec/unit/type_spec.rb b/spec/unit/type_spec.rb index <HASH>..<HASH> 100755 --- a/spec/unit/type_spec.rb +++ b/spec/unit/type_spec.rb @@ -1,9 +1,10 @@ #! /usr/bin/env ruby require 'spec_helper' - +require 'puppet_spec/compiler' describe Puppet::Type, :unless => Puppet.features.microsoft_windows? do include PuppetSpec::Files + include PuppetSpec::Compiler it "should be Comparable" do a = Puppet::Type.type(:notify).new(:name => "a") @@ -131,6 +132,26 @@ describe Puppet::Type, :unless => Puppet.features.microsoft_windows? do Puppet::Type.type(:mount).new(:name => "foo").version.should == 0 end + it "reports the correct path even after path is used during setup of the type" do + Puppet::Type.newtype(:testing) do + newparam(:name) do + isnamevar + validate do |value| + path # forces the computation of the path + end + end + end + + ral = compile_to_ral(<<-MANIFEST) + class something { + testing { something: } + } + include something + MANIFEST + + ral.resource("Testing[something]").path.should == "/Stage[main]/Something/Testing[something]" + end + context "resource attributes" do let(:resource) { resource = Puppet::Type.type(:mount).new(:name => "foo")
(#<I>) Add a spec test to reproduce the failure
puppetlabs_puppet
train
rb
165a7502f8c8429c770e469f91c1889c7f5bda71
diff --git a/user/view.php b/user/view.php index <HASH>..<HASH> 100644 --- a/user/view.php +++ b/user/view.php @@ -230,7 +230,7 @@ ' height="16" width="16" /></a>'); } if ($user->yahoo && !isset($hiddenfields['yahooid'])) { - print_row(get_string('yahooid').':', '<a href="http://edit.yahoo.com/config/send_webmesg?.target='.s($user->yahoo).'&amp;.src=pg">'.s($user->yahoo).'</a>'); + print_row(get_string('yahooid').':', '<a href="http://edit.yahoo.com/config/send_webmesg?.target='.urlencode($user->yahoo).'&amp;.src=pg">'.s($user->yahoo)." <img border=0 src=\"http://opi.yahoo.com/online?u=".urlencode($user->yahoo)."&m=g&t=0\" width=\"12\" height=\"12\" alt=\"\"></a>"); } if ($user->aim && !isset($hiddenfields['aimid'])) { print_row(get_string('aimid').':', '<a href="aim:goim?screenname='.s($user->aim).'">'.s($user->aim).'</a>');
Bug #<I> - add Yahoo online status to user profile; merged from MOODLE_<I>_STABLE
moodle_moodle
train
php
3707c5d7a9cd46cf80194bad76291276deddc007
diff --git a/support/test-runner/app.js b/support/test-runner/app.js index <HASH>..<HASH> 100644 --- a/support/test-runner/app.js +++ b/support/test-runner/app.js @@ -6,7 +6,8 @@ var express = require('express') , stylus = require('stylus') , sio = require('socket.io') - , path = require('path'); + , path = require('path') + , fs = require('fs'); /** * App. @@ -54,8 +55,25 @@ app.listen(3000, function () { * Socket.IO server (single process only) */ -var io = sio.listen(app) - , nicknames = {}; +var io = sio.listen(app); + +// override handler to simplify development +function handler (req, res) { + fs.readFile(__dirname + '/../../dist/socket.io.js', 'utf8', function (err, b) { + if (err) { + res.writeHead(404); + res.end('Error'); + return; + } + + res.writeHead(200, { 'Content-Type': 'application/javascript' }); + res.end(b); + }); +}; + +io.configure(function () { + io.set('browser client handler', handler); +}); io.sockets.on('connection', function (socket) {
Added custom client serving to serve the local repository.
tsjing_socket.io-client
train
js
41df204d37716c2efa5d83bf957f74c56a075467
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -76,10 +76,6 @@ Parsing:: """ VERSION = get_version() -DOWNLOAD_URL = ( - 'https://github.com/downloads/andialbrecht/sqlparse/' - 'sqlparse-%s.tar.gz' % VERSION -) kwargs = {} @@ -94,7 +90,6 @@ setup( description='Non-validating SQL parser', author='Andi Albrecht', author_email='albrecht.andi@gmail.com', - download_url=DOWNLOAD_URL, long_description=LONG_DESCRIPTION, license='BSD', url='https://github.com/andialbrecht/sqlparse',
Remove download url from setup (fixes issue<I>). Downloads on github are disabled since December <I>.
andialbrecht_sqlparse
train
py
c0fab40bb4c934fada5821c9952e9113274f70d2
diff --git a/netsnmpagent.py b/netsnmpagent.py index <HASH>..<HASH> 100644 --- a/netsnmpagent.py +++ b/netsnmpagent.py @@ -136,7 +136,7 @@ class netsnmpAgent(object): # Let libsnmpagent parse the OID if libnsa.read_objid( oidstr, - ctypes.cast(ctypes.byref(oid), ctypes.POINTER(ctypes.c_ulong)), + ctypes.cast(ctypes.byref(oid), c_oid_p), ctypes.byref(oid_len) ) == 0: raise netsnmpAgentException("read_objid({0}) failed!".format(oidstr))
Of course one should use existing data types first...
pief_python-netsnmpagent
train
py
809b78a55d640dffa7c98928f23ec39f29fd43b0
diff --git a/driver/src/main/java/org/kaazing/k3po/driver/internal/ext/tls/bootstrap/TlsClientChannelSink.java b/driver/src/main/java/org/kaazing/k3po/driver/internal/ext/tls/bootstrap/TlsClientChannelSink.java index <HASH>..<HASH> 100644 --- a/driver/src/main/java/org/kaazing/k3po/driver/internal/ext/tls/bootstrap/TlsClientChannelSink.java +++ b/driver/src/main/java/org/kaazing/k3po/driver/internal/ext/tls/bootstrap/TlsClientChannelSink.java @@ -318,13 +318,18 @@ public class TlsClientChannelSink extends AbstractChannelSink { @Override public void operationComplete(ChannelFuture future) throws Exception { if (tlsClientChannel.setWriteClosed()) { - shutdownOutputOrClose(transport); fireChannelDisconnected(tlsClientChannel); fireChannelUnbound(tlsClientChannel); fireChannelClosed(tlsClientChannel); } } }); + tlsHandler.getSSLEngineInboundCloseFuture().addListener(new ChannelFutureListener() { + @Override + public void operationComplete(ChannelFuture future) throws Exception { + shutdownOutputOrClose(transport); + } + }); chainFutures(tlsCloseFuture, tlsFuture); } }
Tls closes underlying connection on TLS handshake close
k3po_k3po
train
java
939170f4a482e4c970a8680cf01f00da5d0c2a5e
diff --git a/src/main/resources/js/report/report.js b/src/main/resources/js/report/report.js index <HASH>..<HASH> 100644 --- a/src/main/resources/js/report/report.js +++ b/src/main/resources/js/report/report.js @@ -239,12 +239,12 @@ function adjustImageAreaSize() { var maxWidth = $("#right_container").width(); var maxHeight; if (srcInfoShown) { - maxHeight = $("#right_container").height() - $("#outer_script_table_container").height() - 20; + maxHeight = $("#right_container").height() - $("#outer_script_table_container").height() - 40; } else { - maxHeight = $("#right_container").height() - 20; + maxHeight = $("#right_container").height() - 40; } if (maxHeight <= 0) { - maxHeight = 20; + maxHeight = 40; } var areaSize = calcCaptureAreaSize(width, height, maxWidth, maxHeight); // need to change also li elements width to reflect width change immediately
Don't overlap between report image and table
SahaginOrg_sahagin-java
train
js