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
69c9164845f729ac44b46ae1abd87c814c8245ac
diff --git a/spec/unit/screen_spec.rb b/spec/unit/screen_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/screen_spec.rb +++ b/spec/unit/screen_spec.rb @@ -110,14 +110,14 @@ RSpec.describe TTY::Screen do $stdout, $stdin, $stderr = *originals end - it "reads terminal size", unless: TTY::Screen.windows? do + it "reads terminal size", unless: TTY::Screen.windows? || TTY::Screen.jruby? do replace_streams do expect(screen.size_from_ioctl).to eq([51, 211]) end end it "skips reading on jruby", if: TTY::Screen.jruby? do - expect(screen.size_from_ioctl).to eq(false) + expect(screen.size_from_ioctl).to eq(nil) end end
Change tests to work on jruby
piotrmurach_tty-screen
train
rb
4d62abe844a912743b8ea59f40abc8949f460497
diff --git a/tests/WebService.tests.js b/tests/WebService.tests.js index <HASH>..<HASH> 100644 --- a/tests/WebService.tests.js +++ b/tests/WebService.tests.js @@ -53,6 +53,31 @@ jstest.run({ webservice.close(next); } ]).on("complete", test.complete); + }, + + "Parse a route and return a param from the URL": function (test) { + test.async(5000); + + /* A R R A N G E */ + var webservice = new WebService() + , options = createOptions("/echo/this"); + + webservice.get("/echo/:value", function (req, res) { + return res.end(req.params.value + "\n"); + }); + + test.steps([ + function arrange(next) { + webservice.listen(options.port, next); + }, + function act(next) { + assert.request.expect200(options, "this\n", next); + }, + function cleanup(next) { + webservice.close(next); + } + ]).on("complete", test.complete); } + });
Create a test for the Route implementation
Crafity_crafity-http
train
js
889ffcae887238c00cecaea4f83296a074d068ea
diff --git a/request.go b/request.go index <HASH>..<HASH> 100644 --- a/request.go +++ b/request.go @@ -503,7 +503,7 @@ func filelist(h FileLister, r *Request, pkt requestPacket) responsePacket { return statusFromError(pkt.id(), err) } - var nameAttrs []sshFxpNameAttr + nameAttrs := make([]*sshFxpNameAttr, 0, len(finfo)) for _, fi := range finfo { nameAttrs = append(nameAttrs, &sshFxpNameAttr{
fix the type, and we can pre-allocate the whole slice
pkg_sftp
train
go
bb061c211b4254c0108b7bd91e0c40efb462e223
diff --git a/src/actions/SmartUpdateAction.php b/src/actions/SmartUpdateAction.php index <HASH>..<HASH> 100644 --- a/src/actions/SmartUpdateAction.php +++ b/src/actions/SmartUpdateAction.php @@ -38,11 +38,12 @@ class SmartUpdateAction extends SwitchAction ], 'error' => [ 'class' => 'hipanel\actions\RenderAction', - 'params' => [ - 'models' => function ($action) { - return $action->collection->models; - }, - ], + 'params' => function ($action) { + return [ + 'models' => $action->collection->models, + 'model' => $action->collection->first + ]; + } ], ], 'POST pjax' => [
SmartUpdateAction - added model to POST error render params
hiqdev_hipanel-core
train
php
d1c8e47351a68984103819d206412729149555a2
diff --git a/src/js/components/Accordion.js b/src/js/components/Accordion.js index <HASH>..<HASH> 100644 --- a/src/js/components/Accordion.js +++ b/src/js/components/Accordion.js @@ -17,7 +17,8 @@ export default class Accordion extends Component { this._onPanelChange = this._onPanelChange.bind(this); let active; - if (Number.isInteger(this.props.active)) { + // active in state should always be an array + if (typeof this.props.active === 'number') { active = [this.props.active]; } else { active = this.props.active || [];
Fixed issue #<I> - Number.isInteger is not supported in IE<I>. (#<I>) * Fixed issue #<I> - Number.isInteger is not supported in IE<I>. * Fixed issue #<I> - Number.isInteger is not supported in IE<I>.
grommet_grommet
train
js
e9c8e950e87775dcbf01f1994db34ec628210a9a
diff --git a/doc/source/conf.py b/doc/source/conf.py index <HASH>..<HASH> 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -46,9 +46,9 @@ copyright = u'2009, Wijnand Modderman-Lenstra' # built documents. # # The short X.Y version. -version = '1.1' +version = '2.0' # The full version, including alpha/beta/rc tags. -release = '1.1.3' +release = '1.99.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from distutils.core import setup setup(name='ipcalc', - version='1.1.3', + version='1.99.0', description='IP subnet calculator', long_description=''' About
Version <I>, preparing for a 2.x release with full Python 3 compatibility
tehmaze_ipcalc
train
py,py
4e41312fdf7fe613199543c038577695516a6cf1
diff --git a/platform-tests/src/test/java/org/eclipse/deeplearning4j/integration/testcases/dl4j/misc/CharacterIterator.java b/platform-tests/src/test/java/org/eclipse/deeplearning4j/integration/testcases/dl4j/misc/CharacterIterator.java index <HASH>..<HASH> 100644 --- a/platform-tests/src/test/java/org/eclipse/deeplearning4j/integration/testcases/dl4j/misc/CharacterIterator.java +++ b/platform-tests/src/test/java/org/eclipse/deeplearning4j/integration/testcases/dl4j/misc/CharacterIterator.java @@ -285,7 +285,7 @@ public class CharacterIterator implements DataSetIterator { //The Complete Works of William Shakespeare //5.3MB file in UTF-8 Encoding, ~5.4 million characters //https://www.gutenberg.org/ebooks/100 - String url = "https://s3.amazonaws.com/dl4j-distribution/pg100.txt"; + String url = "https://raw.githubusercontent.com/KonduitAI/dl4j-test-resources/master/src/main/resources/word2vec/shakespeare.txt"; String tempDir = System.getProperty("java.io.tmpdir"); String fileLocation = tempDir + "/Shakespeare.txt"; //Storage location from downloaded file File f = new File(fileLocation);
Word2vec google new update (#<I>) * Update ArrayCacheMemoryMgr.java * Log warning for invalid ops. Alows for more flexibility when importing models. * Add back fix for LSTM nullpointer * Fix debug logging for cache * Update ArrayCacheMemoryMgr.java * Update CharacterIterator.java
deeplearning4j_deeplearning4j
train
java
d94f43fdcaea3e05c16e44487b4fe81ce4f243b9
diff --git a/lib/celluloid/io/reactor.rb b/lib/celluloid/io/reactor.rb index <HASH>..<HASH> 100644 --- a/lib/celluloid/io/reactor.rb +++ b/lib/celluloid/io/reactor.rb @@ -49,7 +49,7 @@ module Celluloid # have woken up. However, in some cases, the monitor is already # invalid, e.g. in the case that we are terminating. We catch this # case explicitly. - monitor.close + monitor.close unless monitor.closed? end end
Only close Selector it not already closed Refer issue: <URL>
celluloid_celluloid-io
train
rb
e2d2c0201b2b724be5898b366b947310b0556ebb
diff --git a/includes/functions.php b/includes/functions.php index <HASH>..<HASH> 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1223,7 +1223,7 @@ function yourls_get_duplicate_keywords( $longurl ) { yourls_deprecated_function( __FUNCTION__, 1.7, 'yourls_get_longurl_keywords' ); if( !yourls_allow_duplicate_longurls() ) return NULL; - return yourls_apply_filter( 'get_duplicate_keywords', yourls_get_keywords ( $longurl ), $longurl ); + return yourls_apply_filter( 'get_duplicate_keywords', yourls_get_longurl_keywords ( $longurl ), $longurl ); } /** @@ -1241,7 +1241,7 @@ function yourls_get_longurl_keywords( $longurl, $sort = 'none', $order = 'ASC' ) $query .= " ORDER BY '".$sort."'"; if ( in_array( $order, array('ASC','DESC') ) ) $query .= " ".$order; } - return $ydb->get_col( $query ); + return yourls_apply_filter( 'yourls_get_longurl_keywords', $ydb->get_col( $query ), $longurl ); } /**
Added filter to yourls_get_longurl_keywords. Fixed typo.
YOURLS_YOURLS
train
php
43b5af450eb5993d92a1378546a2bac8938c3b29
diff --git a/Pager.php b/Pager.php index <HASH>..<HASH> 100644 --- a/Pager.php +++ b/Pager.php @@ -67,6 +67,14 @@ class Tsukiyo_Pager $this->params = $names; return $this; } + public function setHtmlFirst($htmlFirst){ + $this->htmlFirst = $htmlFirst; + return $this; + } + public function setHtmlLast($htmlLast){ + $this->htmlLast = $htmlLast; + return $this; + } public function getHtml() { $last = (int)($this->count / $this->pageCount);
add setter of link html at pager.
nishimura_laiz-db
train
php
37d5879d1798b54ef7b468cc2e23b0ea780f9339
diff --git a/packages/ember-views/lib/views/view.js b/packages/ember-views/lib/views/view.js index <HASH>..<HASH> 100644 --- a/packages/ember-views/lib/views/view.js +++ b/packages/ember-views/lib/views/view.js @@ -990,7 +990,7 @@ Ember.View = Ember.Object.extend(Ember.Evented, } this.buffer = buffer; - this.transitionTo('inBuffer'); + this.transitionTo('inBuffer', false); this.lengthBeforeRender = getPath(this, '_childViews.length');
Transition to inBuffer when you have a buffer Don't transition children into inBuffer when a parent goes into inBuffer. Children will go into inBuffer when they have a buffer. This allows information about childViews to still change without triggering unnecessary rerenders.
emberjs_ember.js
train
js
c71907ab5b46ac9d70e4254668831d742413e626
diff --git a/Framework/Autoloader.php b/Framework/Autoloader.php index <HASH>..<HASH> 100644 --- a/Framework/Autoloader.php +++ b/Framework/Autoloader.php @@ -1,4 +1,4 @@ -<?php function __autoload($className) { +<?php spl_autoload_register(function($className) { /** * Utility classes are small and uncommon code libraries. Typically, a utility * class does not complete a whole task on its own, otherwise it would be classed @@ -9,7 +9,8 @@ * objects, and new features can be introduced. */ -if(array_key_exists($className, ClassDependencies::$list)) { +if(class_exists("ClassDependencies") +&& array_key_exists($className, ClassDependencies::$list)) { $relPath = ClassDependencies::$list[$className]; require_once(GTROOT . "/Class/$relPath"); return; @@ -46,4 +47,4 @@ foreach ($classDirArray as $classDir) { } } -}# \ No newline at end of file +});# \ No newline at end of file
Made a safety check for class being loaded when in test environment
PhpGt_WebEngine
train
php
4f95e4d1db7bebe62aca1b757a54370b2546a33f
diff --git a/pylint/lint/pylinter.py b/pylint/lint/pylinter.py index <HASH>..<HASH> 100644 --- a/pylint/lint/pylinter.py +++ b/pylint/lint/pylinter.py @@ -294,11 +294,11 @@ class PyLinter( "metavar": "<python_expression>", "group": "Reports", "level": 1, - "default": "10.0 - ((float(5 * error + warning + refactor + " + "default": "0 if fatal else 10.0 - ((float(5 * error + warning + refactor + " "convention) / statement) * 10)", "help": "Python expression which should return a score less " - "than or equal to 10. You have access to the variables " - "'error', 'warning', 'refactor', and 'convention' which " + "than or equal to 10. You have access to the variables 'fatal', " + "'error', 'warning', 'refactor', 'convention', and 'info' which " "contain the number of messages in each category, as well as " "'statement' which is the total number of statements " "analyzed. This score is used by the global "
Update default evaluation formula to match that in default pylintrc (#<I>)
PyCQA_pylint
train
py
7efe5b40d670eef6fc06864d31b014e58c3fb80a
diff --git a/src/Circlical/PoEditor/Block.php b/src/Circlical/PoEditor/Block.php index <HASH>..<HASH> 100644 --- a/src/Circlical/PoEditor/Block.php +++ b/src/Circlical/PoEditor/Block.php @@ -219,6 +219,31 @@ class Block $this->msgstr_plural = $msgstr_plural; } + + /** + * @return array + */ + public function getPluralForm( $key ) + { + return $this->msgstr_plural[$key] ?: ""; + } + + /** + * Sets a particular plural message key + * @param int $key The plural form being set + * @param string|array $plural The plural string + */ + public function setPluralForm( $key, $plural ) + { + if( !is_array( $plural ) ) + $plural = [ $plural ]; + + if( !$this->msgstr_plural ) + $this->msgstr_plural = []; + + $this->msgstr_plural[$key] = $plural; + } + /** * @return array */
Added a means to directly set plural forms
Saeven_circlical-po-editor
train
php
cc38e26d06f40009d537ad4fdfdf999cb32c5897
diff --git a/src/client/main.js b/src/client/main.js index <HASH>..<HASH> 100644 --- a/src/client/main.js +++ b/src/client/main.js @@ -21,6 +21,7 @@ import Routes from './routes'; const httpLink = createHttpLink({ uri: '/graphql' }); const middlewareLink = setContext(() => { const authJWT = cookie.get('authJWT'); + if (!authJWT) { return undefined; } return { headers: { Authorization: `Bearer ${authJWT}`, diff --git a/src/server/ssr.js b/src/server/ssr.js index <HASH>..<HASH> 100644 --- a/src/server/ssr.js +++ b/src/server/ssr.js @@ -53,7 +53,7 @@ export default (options, Doc = Document) => { const processRoute = async (ctx, next) => { const httpLink = createHttpLink({ uri: `${process.env.HOST || ctx.request.origin}/graphql` }); const middlewareLink = setContext(() => { - if (!ctx.cookie || !ctx.cookie.authJWT) { return {}; } + if (!ctx.cookie || !ctx.cookie.authJWT) { return undefined; } return { headers: {
Empty cookies were preventing the defaultRole from being used
storyforj_fervor
train
js,js
e1f144bbfad3bc44695335d48165b6d2e6c7fb1d
diff --git a/lxd/db/instances_test.go b/lxd/db/instances_test.go index <HASH>..<HASH> 100644 --- a/lxd/db/instances_test.go +++ b/lxd/db/instances_test.go @@ -199,7 +199,7 @@ func TestInstanceList(t *testing.T) { return err } - err = cluster.CreateProfileDevice(ctx, tx.Tx(), id, profileDevices["root"]) + err = cluster.CreateProfileDevices(ctx, tx.Tx(), id, profileDevices) if err != nil { return err } diff --git a/lxd/profiles.go b/lxd/profiles.go index <HASH>..<HASH> 100644 --- a/lxd/profiles.go +++ b/lxd/profiles.go @@ -302,12 +302,9 @@ func profilesPost(d *Daemon, r *http.Request) response.Response { return err } - for _, device := range devices { - err = dbCluster.CreateProfileDevice(ctx, tx.Tx(), id, device) - if err != nil { - return err - } - + err = dbCluster.CreateProfileDevices(ctx, tx.Tx(), id, devices) + if err != nil { + return err } return err
lxd/profiles: Update usage of CreateProfileDevices
lxc_lxd
train
go,go
07e5bb1d9b4d789bac4ee74f94a9a68c40eadfb0
diff --git a/src/Domain/ValueObject/UniqueIdentifier.php b/src/Domain/ValueObject/UniqueIdentifier.php index <HASH>..<HASH> 100644 --- a/src/Domain/ValueObject/UniqueIdentifier.php +++ b/src/Domain/ValueObject/UniqueIdentifier.php @@ -25,8 +25,8 @@ final class UniqueIdentifier public static function createRandom(): self { - if (function_exists('uuid_create') && defined('UUID_TYPE_RANDOM')) { - return new self((string) uuid_create(UUID_TYPE_RANDOM)); + if (function_exists('random_bytes')) { + return new self(bin2hex(random_bytes(16))); } return new self(uniqid());
Switch from uuid_create() to random_bytes() (#<I>) uuid_create() is not a PHP core function, but random_bytes() is and has been since PHP <I>. Therefore a more sensible way to generate a UUID is the one-liner bin2hex(random_bytes(<I>)). This code switches function_exists() check from uuid_create() to random_bytes()
markuspoerschke_iCal
train
php
735d55da4c07b4497aae71e99e4143d11f4642aa
diff --git a/src/SoapRequestsGenerator.php b/src/SoapRequestsGenerator.php index <HASH>..<HASH> 100644 --- a/src/SoapRequestsGenerator.php +++ b/src/SoapRequestsGenerator.php @@ -698,6 +698,10 @@ class SoapRequestsGenerator { case 'double': /* No special handling for these types */ break; + case 'endpointaccesstype': + $xmlType = 'EndpointAccessType'; + $xmlTypeNS = 'http://schemas.microsoft.com/xrm/2014/Contracts'; + break; default: /* If we're using Default, Warn user that the XML handling is not defined */ trigger_error( 'No Create/Update handling implemented for type ' . $xmlType . ' used by field ' . $parameter["key"], E_USER_WARNING );
Added handling for EndpointAccessType
AlexaCRM_php-crm-toolkit
train
php
6024fe4761c319be6a1286cb06bbb5d0023bfcb0
diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/AtomicMethodCallAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/AtomicMethodCallAnalyzer.php index <HASH>..<HASH> 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/AtomicMethodCallAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/AtomicMethodCallAnalyzer.php @@ -516,9 +516,9 @@ class AtomicMethodCallAnalyzer extends CallAnalyzer || !isset($class_storage->pseudo_methods[$method_name_lc]) ) { if ($is_interface) { - $result->non_existent_interface_method_ids[] = $intersection_method_id ?: $method_id; + $result->non_existent_interface_method_ids[] = $intersection_method_id ?: $cased_method_id; } else { - $result->non_existent_class_method_ids[] = $intersection_method_id ?: $method_id; + $result->non_existent_class_method_ids[] = $intersection_method_id ?: $cased_method_id; } }
use original case in error messages when reporting undefined methods (#<I>)
vimeo_psalm
train
php
d1e387cb525c28156ae21b6e24fec64eb1f0f079
diff --git a/src/Models/BlockSelectOption.php b/src/Models/BlockSelectOption.php index <HASH>..<HASH> 100644 --- a/src/Models/BlockSelectOption.php +++ b/src/Models/BlockSelectOption.php @@ -47,4 +47,15 @@ Class BlockSelectOption extends Eloquent } } + public static function getOptionsArray($blockName) + { + $optionsArray = []; + $blockId = Block::preload($blockName)->id; + $options = self::where('block_id', '=', $blockId)->get(); + foreach ($options as $option) { + $optionsArray[$option->value] = $option->option; + } + return $optionsArray; + } + } \ No newline at end of file
add func to return select options by block name
Web-Feet_coasterframework
train
php
b0af919804f9566424c121d7bcd02ab514e8d6d0
diff --git a/src/Test/EntityManagerMockFactoryTrait.php b/src/Test/EntityManagerMockFactoryTrait.php index <HASH>..<HASH> 100644 --- a/src/Test/EntityManagerMockFactoryTrait.php +++ b/src/Test/EntityManagerMockFactoryTrait.php @@ -59,6 +59,4 @@ trait EntityManagerMockFactoryTrait return $em; } - - abstract protected function createMock($originalClassName): MockObject; }
Remove createMock abstract method (#<I>)
sonata-project_sonata-doctrine-extensions
train
php
eee0d6ce8d7a6196ef587be295621c3e4c901c9d
diff --git a/packages/next-server/server/config.js b/packages/next-server/server/config.js index <HASH>..<HASH> 100644 --- a/packages/next-server/server/config.js +++ b/packages/next-server/server/config.js @@ -23,7 +23,11 @@ const defaultConfig = { }, experimental: { amp: false, - cpus: Number(process.env.CIRCLE_NODE_TOTAL) || (os.cpus() || { length: 1 }).length + cpus: Math.max( + 1, + (Number(process.env.CIRCLE_NODE_TOTAL) || + (os.cpus() || { length: 1 }).length) - 1 + ) } }
Default to the previous CPU calculation (#<I>)
zeit_next.js
train
js
3e7cdbb8b5f951307d89dc8b1d310d933a739100
diff --git a/lib/Reader.js b/lib/Reader.js index <HASH>..<HASH> 100644 --- a/lib/Reader.js +++ b/lib/Reader.js @@ -249,7 +249,6 @@ Reader.prototype._maybeDestroy = function () { }; Reader.prototype._moveOffset = function(relativeOffset) { - var oldOffset = this._offset; - this._setOffset(oldOffset + relativeOffset); - return oldOffset; + this._setOffset(this._offset + relativeOffset); + return this._offset - relativeOffset; };
performance: avoid tmpvar in moveOffset
felixge_node-buffy
train
js
c4cc9ef5cbf88064e1fd5dfbb39052374a7dce74
diff --git a/linkage.rb b/linkage.rb index <HASH>..<HASH> 100644 --- a/linkage.rb +++ b/linkage.rb @@ -1,3 +1,17 @@ +# The goal of linkages is to have attributes which are +# periodically re-evaluated. Basically, to turn this: +# +# loop { ugen.gain = abs(sin.last); play 1.sample } +# +# into this: +# +# ugen.gain = Linkage.new(sin, :last) +# loop { play 10.seconds } +# +# The way I do this now (check for Linkage in the +# attribute read method) is really slow. Gotta be +# a better way. + module Ruck class Linkage
Added description of Linkage inefficiency
alltom_ruck
train
rb
d39791489ce78d16e0238f60c429f0be08f4a994
diff --git a/setuptools/build_meta.py b/setuptools/build_meta.py index <HASH>..<HASH> 100644 --- a/setuptools/build_meta.py +++ b/setuptools/build_meta.py @@ -171,11 +171,9 @@ def build_sdist(sdist_directory, config_settings=None): config_settings = _fix_config(config_settings) sdist_directory = os.path.abspath(sdist_directory) sys.argv = sys.argv[:1] + ['sdist'] + \ - config_settings["--global-option"] + config_settings["--global-option"] + \ + ["--dist-dir", sdist_directory] _run_setup() - if sdist_directory != 'dist': - shutil.rmtree(sdist_directory) - shutil.copytree('dist', sdist_directory) sdists = [f for f in os.listdir(sdist_directory) if f.endswith('.tar.gz')]
build_meta sdist directory delegate to --dist-dir
pypa_setuptools
train
py
7ba641a37e0a1bb82001834e5d823e18058d43da
diff --git a/apptentive-android-sdk/src/com/apptentive/android/sdk/GlobalInfo.java b/apptentive-android-sdk/src/com/apptentive/android/sdk/GlobalInfo.java index <HASH>..<HASH> 100644 --- a/apptentive-android-sdk/src/com/apptentive/android/sdk/GlobalInfo.java +++ b/apptentive-android-sdk/src/com/apptentive/android/sdk/GlobalInfo.java @@ -11,7 +11,7 @@ package com.apptentive.android.sdk; */ public class GlobalInfo { // Don't ever use "1.0". I prematurely incremented to 1.0, so we should skip over it. - public static final String APPTENTIVE_API_VERSION = "0.6.4"; + public static final String APPTENTIVE_API_VERSION = "0.6.5"; public static boolean initialized = false; public static boolean isAppDebuggable = false;
Bump SDK version to <I>
apptentive_apptentive-android
train
java
926a127908897f95f4a905352eb7a4d7b9281f97
diff --git a/puzzle/plugins/gemini_plugin.py b/puzzle/plugins/gemini_plugin.py index <HASH>..<HASH> 100644 --- a/puzzle/plugins/gemini_plugin.py +++ b/puzzle/plugins/gemini_plugin.py @@ -221,7 +221,7 @@ class GeminiPlugin(Plugin): def variants(self, case_id, skip=0, count=30, gene_list=None, - thousand_g=None): + frequency=None, cadd=None): """Return count variants for a case. case_id : A gemini db @@ -238,11 +238,20 @@ class GeminiPlugin(Plugin): gemini_query = "SELECT * from variants" + any_query = False #This would be the fastest solution but it seems like we loose all variants #that are missing a frequency... - if thousand_g: - gemini_query += " WHERE (aaf_1kg_all < {0} or aaf_1kg_all is"\ + if frequency: + gemini_query += " WHERE (max_aaf_all < {0} or max_aaf_all is"\ " Null)".format(thousand_g) + any_query = True + + if cadd: + if any_filter: + gemini_query += " AND (cadd_scaled > {0})".format(cadd) + else: + gemini_query += " WHERE (cadd_scaled > {0})".format(cadd) + any_filter = True filtered_variants = self._variants( gemini_db=case_id,
Added cadd filter to gemini plugin
robinandeer_puzzle
train
py
f21c221cb4d2ca4e813f2c717712b1a7e8b5fcf7
diff --git a/indra/sources/indra_db_rest/util.py b/indra/sources/indra_db_rest/util.py index <HASH>..<HASH> 100644 --- a/indra/sources/indra_db_rest/util.py +++ b/indra/sources/indra_db_rest/util.py @@ -64,6 +64,7 @@ def make_db_rest_request(meth, end_point, query_str, data=None, params=None, method_func = getattr(requests, meth.lower()) while tries > 0: tries -= 1 + timeout = timeout if timeout else None resp = method_func(url_path, headers=headers, data=json_data, params=params, timeout=timeout) if resp.status_code == 200:
Handle 0 timeouts more gracefully when passed along.
sorgerlab_indra
train
py
f62b770b23dd709a1728f9ff00d1d399d73f7fa0
diff --git a/lib/audited/auditor.rb b/lib/audited/auditor.rb index <HASH>..<HASH> 100644 --- a/lib/audited/auditor.rb +++ b/lib/audited/auditor.rb @@ -62,9 +62,10 @@ module Audited has_many :audits, -> { order(version: :asc) }, as: :auditable, class_name: Audited.audit_class.name Audited.audit_class.audited_class_names << to_s - after_create :audit_create if !options[:on] || (options[:on] && options[:on].include?(:create)) - before_update :audit_update if !options[:on] || (options[:on] && options[:on].include?(:update)) - before_destroy :audit_destroy if !options[:on] || (options[:on] && options[:on].include?(:destroy)) + on = Array(options[:on]) + after_create :audit_create if on.empty? || on.include?(:create) + before_update :audit_update if on.empty? || on.include?(:update) + before_destroy :audit_destroy if on.empty? || on.include?(:destroy) # Define and set after_audit and around_audit callbacks. This might be useful if you want # to notify a party after the audit has been created or if you want to access the newly-created
Normalise singular arguments for `on` option It's idiomatic to normalise scalar arguments and I noticed this is the case for the `except` option so I modified the handling of the `on` option to suit. This means we can: ```ruby class SomethingAudited < ActiveRecord::Base audit on: :create # would previously have required # audit on: [:create] end ``` A small change but it adds some consistency and is less 'surprising' perhaps.
collectiveidea_audited
train
rb
6aa90356137259e41261e84e1227f023734809d3
diff --git a/app/models/effective/effective_datatable/state.rb b/app/models/effective/effective_datatable/state.rb index <HASH>..<HASH> 100644 --- a/app/models/effective/effective_datatable/state.rb +++ b/app/models/effective/effective_datatable/state.rb @@ -126,14 +126,17 @@ module Effective def load_columns! state[:length] ||= EffectiveDatatables.default_length - if order_index.present? - state[:order_name] = columns.keys[order_index] - raise "invalid order index #{order_index}" unless columns.keys[order_index] - else - state[:order_name] ||= columns.find { |name, opts| opts[:sort] }.first - raise "order column :#{order_name} must exist as a col or val" unless columns[order_name] - state[:order_index] = columns[order_name][:index] + if columns.present? + if order_index.present? + state[:order_name] = columns.keys[order_index] + raise "invalid order index #{order_index}" unless columns.keys[order_index] + else + state[:order_name] ||= columns.find { |name, opts| opts[:sort] }.first + raise "order column :#{order_name} must exist as a col or val" unless columns[order_name] + + state[:order_index] = columns[order_name][:index] + end end # Set default order direction
support no datatable datatables better
code-and-effect_effective_datatables
train
rb
88d313b787e0720b87c200ac6423f6cc661c6b37
diff --git a/bcbio/graph/graph.py b/bcbio/graph/graph.py index <HASH>..<HASH> 100644 --- a/bcbio/graph/graph.py +++ b/bcbio/graph/graph.py @@ -277,8 +277,7 @@ def resource_usage(bcbio_log, rawdir, verbose): collectl_path, time_frame.start, time_frame.end) if len(data) == 0: -# continue - raise ValueError("No data present in collectl file %s", collectl_path) + raise ValueError("No data present in collectl file %s, mismatch in timestamps between raw collectl and log file?", collectl_path) host = re.sub(r'-\d{8}-\d{6}\.raw\.gz$', '', collectl_file) hardware_info[host] = hardware
Give a hint on the exception itself
bcbio_bcbio-nextgen
train
py
9b52dee1d41ae3b8258c2b0f449626398b694505
diff --git a/centinel/primitives/dnslib.py b/centinel/primitives/dnslib.py index <HASH>..<HASH> 100644 --- a/centinel/primitives/dnslib.py +++ b/centinel/primitives/dnslib.py @@ -96,6 +96,7 @@ class DNSQuery(): thread_wait_timeout = 200 for nameserver in self.nameservers: for domain in self.domains: + wait_time = 0 while threading.active_count() > self.max_threads: time.sleep(1) wait_time += 1
fixed a small bug in DNS primitive
iclab_centinel
train
py
9820983ba3aa6bbb50dfc59a68c13c7bbce0fce3
diff --git a/lib/mailboxer/concerns/configurable_mailer.rb b/lib/mailboxer/concerns/configurable_mailer.rb index <HASH>..<HASH> 100644 --- a/lib/mailboxer/concerns/configurable_mailer.rb +++ b/lib/mailboxer/concerns/configurable_mailer.rb @@ -5,9 +5,9 @@ module Concerns def get_mailer return @mailer if @mailer - klass = self.class.to_s.sub(/^Mailboxer::/, '') + klass = self.class.name.demodulize method = "#{klass.downcase}_mailer".to_sym - @mailer = Mailboxer.send(method) || "#{self.class}Mailer".constantize + @mailer = Mailboxer.send(method) || "#{self.class}Mailer".constantize end end
more railsish way (less likely to lead to bugs)
mailboxer_mailboxer
train
rb
5d6949993f012b99f8cf0125c36ec5e4ee32f445
diff --git a/Processor.php b/Processor.php index <HASH>..<HASH> 100644 --- a/Processor.php +++ b/Processor.php @@ -2142,7 +2142,8 @@ class Processor (false === property_exists($node, RdfConstants::RDF_REST)) || (count($node->{RdfConstants::RDF_FIRST}) !== 1) || (count($node->{RdfConstants::RDF_REST}) !== 1) || - (false === isset($node->{RdfConstants::RDF_REST}[0]->{'@id'}))) { + (false === isset($node->{RdfConstants::RDF_REST}[0]->{'@id'})) || + (true === in_array($id, $eliminatedNodes))) { $list = null; break; }
Detect cycles in lists when converting from RDF
lanthaler_JsonLD
train
php
61d77591ce3d0d1f881002560e56e99b42c9eb6a
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -13,9 +13,10 @@ function ExclFS(lowerLayer) function canUse(path, uid) { - var pathUid = filesInUse[path] + var file = filesInUse[path] + if(!file) return true - return pathUid === uid || pathUid === undefined + return file.uid === uid } @@ -68,7 +69,15 @@ function ExclFS(lowerLayer) { if(error) return callback(error) - filesInUse[path] = context().uid + var file = filesInUse[path] + if(!file) + filesInUse[path] = file = + { + counter: 0 + uid: context().uid + } + + file.counter++ callback(null, fd) }) @@ -97,7 +106,10 @@ function ExclFS(lowerLayer) { if(error) return callback(error) - delete filesInUse[path] + var file = filesInUse[path] + file.counter-- + if(!file.counter) + delete filesInUse[path] callback() })
Allow a user open a file several times
piranna_ExclFS
train
js
ba7f51ecbe2ee4139878d4231efb7717b82521e9
diff --git a/packages/editor/src/index.js b/packages/editor/src/index.js index <HASH>..<HASH> 100644 --- a/packages/editor/src/index.js +++ b/packages/editor/src/index.js @@ -226,6 +226,10 @@ class CodeMirrorEditor extends React.Component< this.cm.focus(); } } + + if (prevProps.language !== this.props.language) { + this.cm.setOption("mode", this.props.language); + } } componentWillReceiveProps(nextProps: CodeMirrorEditorProps) {
ensure Δ in language prop modifies codemirror mode (#<I>)
nteract_nteract
train
js
b8618e4df9ecdde0d073eb8110b7d19a76a9d04b
diff --git a/rinoh/paragraph.py b/rinoh/paragraph.py index <HASH>..<HASH> 100644 --- a/rinoh/paragraph.py +++ b/rinoh/paragraph.py @@ -409,13 +409,15 @@ class GlyphsSpan(list): self.span = span self.filled_tabs = {} self.word_to_glyphs = word_to_glyphs - self.number_of_spaces = 0 self.space = word_to_glyphs(' ')[0] def append_space(self): - self.number_of_spaces += 1 self.append(self.space) + @property + def number_of_spaces(self): + return self.count(self.space) + def _fill_tabs(self): for index, glyph_and_width in enumerate(super().__iter__()): if index in self.filled_tabs: @@ -553,7 +555,6 @@ class Line(list): last_span = self[-1] while last_span and last_span[-1] is last_span.space: last_span.pop() - last_span.number_of_spaces -= 1 self._cursor -= last_span.space.width if last_span or (force and len(self) == 1): break
Avoid need to manually update the space count
brechtm_rinohtype
train
py
85caaa8603cf45e8f5bfea31c29fadf6ab097faf
diff --git a/astropixie-widgets/astropixie_widgets/visual.py b/astropixie-widgets/astropixie_widgets/visual.py index <HASH>..<HASH> 100644 --- a/astropixie-widgets/astropixie_widgets/visual.py +++ b/astropixie-widgets/astropixie_widgets/visual.py @@ -545,11 +545,6 @@ class SHRD(): step=0.2) self.luminosity_range_slider.on_change('value', self._update_slider_range) - # Setup the data source, which will initially be empty - # (or more specifically, whatever IDs are in self.selection_ids) - self._filter_cluster_data() - self.source = ColumnDataSource(data=self.filtered_data, name='hr') - # Setup the figure and tools. self.pf = figure(y_axis_type='log', y_axis_label=yaxis_label,
[EPO-<I>] Clean up some copy pasta. Forgot to take these lines out when moved below.
lsst-epo_vela
train
py
ee840d3691bf19b167e561a8644e84c4aa7b5be9
diff --git a/lib/mactag/tag/rails/gem.rb b/lib/mactag/tag/rails/gem.rb index <HASH>..<HASH> 100644 --- a/lib/mactag/tag/rails/gem.rb +++ b/lib/mactag/tag/rails/gem.rb @@ -0,0 +1,15 @@ +module Mactag + module Tag + module Rails + class Gem + + include Mactag::Tag::Rails + + def files + [] + end + + end + end + end +end
Added empty class in rails gem.
rejeep_mactag
train
rb
7043031ee415c8fa1785d804383c6e31fba1f0ad
diff --git a/LibEventLoop.php b/LibEventLoop.php index <HASH>..<HASH> 100644 --- a/LibEventLoop.php +++ b/LibEventLoop.php @@ -161,7 +161,7 @@ class LibEventLoop implements LoopInterface throw new \InvalidArgumentException('The callback must be a callable object.'); } - while($resource = $this->timersGc->dequeue()){ + foreach ($this->timersGc as $resource) { event_free($resource); } @@ -182,8 +182,7 @@ class LibEventLoop implements LoopInterface if ($timer->periodic === true) { event_add($timer->resource, $timer->interval); - } - else { + } else { $this->cancelTimer($timer->signature); } }
Fix timersGc iteration in LibEventLoop
reactphp_event-loop
train
php
7c2dba8fe0e3fed262e98e73939fd8128b601b82
diff --git a/select2.js b/select2.js index <HASH>..<HASH> 100755 --- a/select2.js +++ b/select2.js @@ -692,7 +692,7 @@ result=results[i]; selectable=id(result) !== undefined; - compound=("children" in result) && result.children.length > 0; + compound=result.children && result.children.length > 0; node=$("<li></li>"); node.addClass("select2-results-dept-"+depth);
safer check for result.children `("children" in result) && result.children.length` fails if children is explicitly null.
select2_select2
train
js
b017ad438f5082c9428e9b698346108cd0b28a55
diff --git a/classylss/tests/test_cosmology.py b/classylss/tests/test_cosmology.py index <HASH>..<HASH> 100644 --- a/classylss/tests/test_cosmology.py +++ b/classylss/tests/test_cosmology.py @@ -31,6 +31,12 @@ def test_cosmology_a_max(): c = Cosmology(gauge='synchronous', a_max=2.0) print(c.parameter_file) assert c.a_max == 2.0 + t = c.Om(-0.1) + t = c.efunc(-0.1) + t = c.scale_independent_growth_factor(-0.1) + + #FIXME: transfer doesn't work because thermal dynamics doesn't go beyond z=0. + #t = c.get_transfer(z=-0.1) def test_cosmology_transfer(): c = Cosmology()
add a few 'runable' test cases for z < 0.
nickhand_classylss
train
py
ca8e6b028736a14b3ebc1aadb6db87152f1bb4a4
diff --git a/users.go b/users.go index <HASH>..<HASH> 100644 --- a/users.go +++ b/users.go @@ -117,6 +117,7 @@ type User struct { IsUltraRestricted bool `json:"is_ultra_restricted"` IsStranger bool `json:"is_stranger"` IsAppUser bool `json:"is_app_user"` + IsInvitedUser bool `json:"is_invited_user"` Has2FA bool `json:"has_2fa"` HasFiles bool `json:"has_files"` Presence string `json:"presence"`
added is_invited_user flag in user struct
nlopes_slack
train
go
892fb8d573f4e03aabc53100df0473a24ace8516
diff --git a/commands.go b/commands.go index <HASH>..<HASH> 100644 --- a/commands.go +++ b/commands.go @@ -275,7 +275,7 @@ func (c *cmdable) Ping() *StatusCmd { func (c *cmdable) Wait(numSlaves int, timeout time.Duration) *IntCmd { - cmd := NewIntCmd("wait", numSlaves, int(timeout/time.Second)) + cmd := NewIntCmd("wait", numSlaves, int(timeout/time.Millisecond)) c.process(cmd) return cmd } diff --git a/commands_test.go b/commands_test.go index <HASH>..<HASH> 100644 --- a/commands_test.go +++ b/commands_test.go @@ -52,9 +52,11 @@ var _ = Describe("Commands", func() { It("should Wait", func() { // assume testing on single redis instance - wait := client.Wait(0, time.Minute) + start := time.Now() + wait := client.Wait(1, time.Second) Expect(wait.Err()).NotTo(HaveOccurred()) Expect(wait.Val()).To(Equal(int64(0))) + Expect(time.Now()).To(BeTemporally("~", start.Add(time.Second), 800*time.Millisecond)) }) It("should Select", func() {
the timeout of WAIT command is in milliseconds.
go-redis_redis
train
go,go
a505abb3ade3bb091570e07938a1a7d6f06bed23
diff --git a/resource_vsphere_virtual_machine.go b/resource_vsphere_virtual_machine.go index <HASH>..<HASH> 100644 --- a/resource_vsphere_virtual_machine.go +++ b/resource_vsphere_virtual_machine.go @@ -583,7 +583,6 @@ func resourceVSphereVirtualMachineCreate(d *schema.ResourceData, meta interface{ } func resourceVSphereVirtualMachineRead(d *schema.ResourceData, meta interface{}) error { - log.Printf("[DEBUG] reading virtual machine: %#v", d) client := meta.(*govmomi.Client) dc, err := getDatacenter(client, d.Get("datacenter").(string)) @@ -641,6 +640,16 @@ func resourceVSphereVirtualMachineRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Invalid network interfaces to set: %#v", networkInterfaces) } + ip, err := vm.WaitForIP(context.TODO()) + if err != nil { + return err + } + log.Printf("[DEBUG] ip address: %v", ip) + d.SetConnInfo(map[string]string{ + "type": "ssh", + "host": ip, + }) + var rootDatastore string for _, v := range mvm.Datastore { var md mo.Datastore
provider/vsphere: Fix missing ssh connection info (#<I>)
terraform-providers_terraform-provider-vsphere
train
go
8039f1d77a4c570b7bef4862b8dd2bb121f7fdd8
diff --git a/account/models.py b/account/models.py index <HASH>..<HASH> 100644 --- a/account/models.py +++ b/account/models.py @@ -102,6 +102,11 @@ def user_post_save(sender, **kwargs): We only run on user creation to avoid having to check for existence on each call to User.save. """ + + # Disable post_save during manage.py loaddata + if kwargs.get('raw', False): + return False + user, created = kwargs["instance"], kwargs["created"] disabled = getattr(user, "_disable_account_creation", not settings.ACCOUNT_CREATE_ON_SAVE) if created and not disabled:
On post_save handler, disable treatment when raw=True (useful for manage.py loaddata)
pinax_django-user-accounts
train
py
30d878b22eb597babf436ea09945ce5b299593c1
diff --git a/core/src/main/java/org/acegisecurity/userdetails/ldap/LdapUserDetailsImpl.java b/core/src/main/java/org/acegisecurity/userdetails/ldap/LdapUserDetailsImpl.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/acegisecurity/userdetails/ldap/LdapUserDetailsImpl.java +++ b/core/src/main/java/org/acegisecurity/userdetails/ldap/LdapUserDetailsImpl.java @@ -113,7 +113,7 @@ public class LdapUserDetailsImpl implements LdapUserDetails { instance.credentialsNonExpired = copyMe.isCredentialsNonExpired(); instance.accountNonLocked = copyMe.isAccountNonLocked(); instance.controls = copyMe.getControls(); - mutableAuthorities = Arrays.asList(copyMe.getAuthorities()); + mutableAuthorities = new ArrayList(Arrays.asList(copyMe.getAuthorities())); } public Essence setDn(String dn) {
Change essence class to use a new ArrayList for the authorities (list from Arrays.asList() doesn't support add method).
spring-projects_spring-security
train
java
eb69534bb6ce6c70c21e8b33f6050546d49a2c87
diff --git a/websocket_server/websocket_server.py b/websocket_server/websocket_server.py index <HASH>..<HASH> 100644 --- a/websocket_server/websocket_server.py +++ b/websocket_server/websocket_server.py @@ -233,11 +233,11 @@ class WebSocketHandler(StreamRequestHandler): payload_length = struct.unpack(">Q", self.rfile.read(8))[0] masks = self.read_bytes(4) - decoded = "" - for char in self.read_bytes(payload_length): - char ^= masks[len(decoded) % 4] - decoded += chr(char) - opcode_handler(self, decoded) + message_bytes = bytearray() + for message_byte in self.read_bytes(payload_length): + message_byte ^= masks[len(message_bytes) % 4] + message_bytes.append(message_byte) + opcode_handler(self, message_bytes.decode('utf8')) def send_message(self, message): self.send_text(message)
fix:read_next_message() when recv chinese we can't decode message form payload byte by byte. some payload like Chinese word encode by utf-8 need 3 bytes to indicate one char. so, collect all bytes from payload and decode them at one time may be better.
Pithikos_python-websocket-server
train
py
0429ce812357b64ba7b4a54eb55b8e3b7482494b
diff --git a/gui/component.py b/gui/component.py index <HASH>..<HASH> 100644 --- a/gui/component.py +++ b/gui/component.py @@ -482,17 +482,6 @@ class DesignerMixin(object): def _set_designer(self, func): if DEBUG: print "binding designer handler...", func, self._meta.name if func: - # remove all binded events: - self.wx_obj.Unbind(wx.EVT_MOTION) - self.wx_obj.Unbind(wx.EVT_LEFT_DOWN) - self.wx_obj.Unbind(wx.EVT_LEFT_UP) - self.wx_obj.Unbind(wx.EVT_LEFT_DCLICK) - self.wx_obj.Unbind(wx.EVT_RIGHT_DOWN) - self.wx_obj.Unbind(wx.EVT_RIGHT_UP) - self.wx_obj.Unbind(wx.EVT_RIGHT_DCLICK) - self.wx_obj.Unbind(wx.EVT_MOUSE_EVENTS) - self.wx_obj.Unbind(wx.EVT_ENTER_WINDOW) - self.wx_obj.Unbind(wx.EVT_LEAVE_WINDOW) # connect the mouse event handler of the designer: self.wx_obj.Bind(wx.EVT_MOUSE_EVENTS, func) # link menu selection (click) to the designer
removed unbinding in design mode (after all, seems to not have any effect)
reingart_gui2py
train
py
013154d359570d591f9315b10c738616d9cddb49
diff --git a/loqusdb/build_models/profile_variant.py b/loqusdb/build_models/profile_variant.py index <HASH>..<HASH> 100644 --- a/loqusdb/build_models/profile_variant.py +++ b/loqusdb/build_models/profile_variant.py @@ -1,5 +1,4 @@ import logging -import json from loqusdb.models import ProfileVariant from .variant import get_variant_id @@ -8,22 +7,18 @@ LOG = logging.getLogger(__name__) def get_maf(variant): """ - if ID CAF exists in INFO column, return the allele frequency for - the alt allele. The CAF INFO tag from dbSNP is a Comma delimited list of - allele frequencies based on 1000Genomes. + Gets the MAF (minor allele frequency) tag from the info field for the + variant. Args: variant (cyvcf2.Variant) Returns: - maf (float): Minor allele frequency + maf (float): Minor allele frequency """ - if not variant.INFO.get('CAF'): - return None - maf_list = json.loads(variant.INFO.get('CAF')) - return maf_list[1] + return variant.INFO.get('MAF') def build_profile_variant(variant):
Change from CAF to MAF tag when looking for MAF in vcf file
moonso_loqusdb
train
py
23220321d1c937a69b7c2a51766ce8940724e7bf
diff --git a/src/event/event.js b/src/event/event.js index <HASH>..<HASH> 100644 --- a/src/event/event.js +++ b/src/event/event.js @@ -91,7 +91,8 @@ jQuery.event = { this.triggered = true; element[ type ](); } - } + } else if ( jQuery.isFunction( element[ type ] ) ) + element[ type ](); }, handle: function(event) {
You had to have an event bound in order to trigger an event - which is not necessarily the case.
jquery_jquery
train
js
76cfc18ff79833c2a3abb7d423da866074d1f2a9
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -76,6 +76,7 @@ function TeamFortress2(steam) { this.emit('disconnectedFromGC', TeamFortress2.GCGoodbyeReason.NO_SESSION); } + this._isInTF2 = false; this.haveGCSession = false; };
Fix GC reconnect failing after app restart
DoctorMcKay_node-tf2
train
js
5ac2e48544e2c90ff6d444a77a6aef854efbf77f
diff --git a/fermipy/jobs/scatter_gather.py b/fermipy/jobs/scatter_gather.py index <HASH>..<HASH> 100644 --- a/fermipy/jobs/scatter_gather.py +++ b/fermipy/jobs/scatter_gather.py @@ -345,6 +345,8 @@ class ScatterGather(Link): while running: if first: first = False + elif self.args['dry_run']: + break else: print ("Sleeping %.0f seconds between status checks" % self.args['job_check_sleep']) @@ -361,7 +363,7 @@ class ScatterGather(Link): self.print_update() if self._job_archive is not None: - self._job_archive.write() + self._job_archive.write_table_file() if failed: self.print_update()
Don't sleep in dry_run of ScatterGather
fermiPy_fermipy
train
py
69636dfe09eaf99633c797660e846aad18954357
diff --git a/boyle/nifti/read.py b/boyle/nifti/read.py index <HASH>..<HASH> 100644 --- a/boyle/nifti/read.py +++ b/boyle/nifti/read.py @@ -157,12 +157,6 @@ def niftilist_to_array(img_filelist, outdtype=None): List of absolute file paths to nifti files. All nifti files must have the same shape. - smoothmm: int - Integer indicating the size of the FWHM Gaussian smoothing kernel you - would like for smoothing the volume before flattening it. - Need FSL and nipype. - See smooth_volume() source code. - outdtype: dtype Type of the elements of the array, if not set will obtain the dtype from the first nifti file.
fix: nifti/read: fix doctoring
Neurita_boyle
train
py
9d3f10b9c97ca89b1a04b1027f84c0b886d79bb3
diff --git a/p2p/transport/tcp/tcp.go b/p2p/transport/tcp/tcp.go index <HASH>..<HASH> 100644 --- a/p2p/transport/tcp/tcp.go +++ b/p2p/transport/tcp/tcp.go @@ -6,6 +6,7 @@ import ( "net" "os" "runtime" + "syscall" "time" "github.com/libp2p/go-libp2p-core/network" @@ -45,7 +46,7 @@ func tryKeepAlive(conn net.Conn, keepAlive bool) { // // But there's nothing we can do about invalid arguments, so we'll drop this to a // debug. - if errors.Is(err, os.ErrInvalid) { + if errors.Is(err, os.ErrInvalid) || errors.Is(err, syscall.EINVAL) { log.Debugw("failed to enable TCP keepalive", "error", err) } else { log.Errorw("failed to enable TCP keepalive", "error", err)
fix: drop raw EINVAL (from keepalives) errors as well (#<I>) It _looks_ like the standard library doesn't always wrap this error. fixes #<I>
libp2p_go-libp2p
train
go
62d894d236c23601bf331d981d423e52b84abc59
diff --git a/doc/conf.py b/doc/conf.py index <HASH>..<HASH> 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -28,8 +28,8 @@ MOCK_MODULES = ['numpy', 'scipy', 'pandas', 'skimage', 'netCDF4', 'basemap', 'ma "pygrib", "mpl_toolkits", "mpl_toolkits.axes_grid", "mpl_toolkits.basemap", "mpl_toolkits.basemap.pyproj", "sklearn", 'skimage.morphology', "scipy.ndimage", "matplotlib.pyplot", "scipy.stats", "scipy.signal", "skimage.measure", "skimage.segmentation", "scipy.interpolate", "skimage.draw", - "mpl_toolkits.axes_grid.inset_locator", "glue", "sklearn.linear_model", "glue.viewers.custom.qt", "glue.core", - "glue.config"] + "mpl_toolkits.axes_grid1.inset_locator", "glue", "sklearn.linear_model", "glue.viewers.custom.qt", "glue.core", + "glue.config", "sklearn.decomposition", "sklearn.model_selection", "arrow"] sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
Added mock modules to conf to fix autodoc generation.
djgagne_hagelslag
train
py
584d70165cf177bca9d07c87e9fdc073e61bbbcd
diff --git a/shell/scheduler.php b/shell/scheduler.php index <HASH>..<HASH> 100644 --- a/shell/scheduler.php +++ b/shell/scheduler.php @@ -368,6 +368,11 @@ class Aoe_Scheduler_Shell_Scheduler extends Mage_Shell_Abstract { return "--mode (always|default) [--exclude <comma separated list of groups>] [--include <comma separated list of groups>]"; } + + protected function _applyPhpVariables() + { + // Disable this feature as cron jobs should run with CLI settings only + } } $shell = new Aoe_Scheduler_Shell_Scheduler();
Update the schduler script to not read in htaccess Fixes #<I>
AOEpeople_Aoe_Scheduler
train
php
579b62d0dfe81cd13af1823304477ce5b33a07aa
diff --git a/src/resources/js/directives.js b/src/resources/js/directives.js index <HASH>..<HASH> 100644 --- a/src/resources/js/directives.js +++ b/src/resources/js/directives.js @@ -389,7 +389,7 @@ link: function(scope) { $timeout(function(){ scope.$watch(function() { return scope.model }, function(n, o) { - if (n === undefined && o === undefined) { + if (n == undefined || n == null || n == '') { if (jQuery.isNumeric(scope.initvalue)) { scope.initvalue = typeCastValue(scope.initvalue); }
added docks, fixed issue with type validation
luyadev_luya-module-admin
train
js
80074f95fe05842658c6d07a351fad4210c0ca82
diff --git a/EventListener/KernelEventListener.php b/EventListener/KernelEventListener.php index <HASH>..<HASH> 100644 --- a/EventListener/KernelEventListener.php +++ b/EventListener/KernelEventListener.php @@ -89,7 +89,7 @@ class KernelEventListener { * @return Request Returns the request. */ public function getRequest() { - return self::$request; + return static::$request; } /**
Replace self:: by static::
webeweb_bootstrap-bundle
train
php
b1cc057306af8dad08cd233f64126eb7ee13361a
diff --git a/sh.py b/sh.py index <HASH>..<HASH> 100644 --- a/sh.py +++ b/sh.py @@ -49,7 +49,7 @@ import time as _time from contextlib import contextmanager from locale import getpreferredencoding -DEFAULT_ENCODING = getpreferredencoding() or "utf-8" +DEFAULT_ENCODING = getpreferredencoding() or "UTF-8" if IS_PY3:
preferred encodings are all caps
amoffat_sh
train
py
ea18e642976cf188b0ed67a85c3838743696a000
diff --git a/src/wavesurfer.js b/src/wavesurfer.js index <HASH>..<HASH> 100755 --- a/src/wavesurfer.js +++ b/src/wavesurfer.js @@ -1449,6 +1449,7 @@ export default class WaveSurfer extends util.Observer { this.stop(); this.backend.disconnectSource(); } + this.isReady = false; this.cancelAjax(); this.clearTmpEvents(); this.drawer.progress(0);
Set isReady attribute to false on empty (#<I>) The isReady attribute is set to false at the creation of a wavesurfer. It it set to true when a song is loaded but it is never set to false when emptying the wavesufer. As a result, after the first song is loaded, isReady return true even if the wavesurfer is empty.
katspaugh_wavesurfer.js
train
js
7e8aaa3ab340b1c56a6ea3068b68ca8e517acb9e
diff --git a/autofit/mapper/prior/prior.py b/autofit/mapper/prior/prior.py index <HASH>..<HASH> 100644 --- a/autofit/mapper/prior/prior.py +++ b/autofit/mapper/prior/prior.py @@ -39,7 +39,7 @@ class UniformPrior(Prior): scale=(upper_limit - lower_limit) ) ): - pass + __identifier_fields__ = ("lower_limit", "upper_limit") UniformPrior.__class_path__ = cls return UniformPrior( diff --git a/test_autofit/database/identifier/test_identifiers.py b/test_autofit/database/identifier/test_identifiers.py index <HASH>..<HASH> 100644 --- a/test_autofit/database/identifier/test_identifiers.py +++ b/test_autofit/database/identifier/test_identifiers.py @@ -234,8 +234,6 @@ def test_unique_tag(): def test_prior(): identifier = af.UniformPrior().identifier - one = Identifier(af.UniformPrior()) - two = Identifier(af.UniformPrior()) assert identifier == af.UniformPrior().identifier assert identifier != af.UniformPrior( lower_limit=0.5
persuaded identifiers to work
rhayes777_PyAutoFit
train
py,py
81916110271203e50b7bb9d7b78ecf95e2dd7d59
diff --git a/src/main/java/eu/hansolo/medusa/skins/TileSparklineSkin.java b/src/main/java/eu/hansolo/medusa/skins/TileSparklineSkin.java index <HASH>..<HASH> 100644 --- a/src/main/java/eu/hansolo/medusa/skins/TileSparklineSkin.java +++ b/src/main/java/eu/hansolo/medusa/skins/TileSparklineSkin.java @@ -219,9 +219,11 @@ public class TileSparklineSkin extends SkinBase<Gauge> implements Skin<Gauge> { Helper.enableNode(titleText, !getSkinnable().getTitle().isEmpty()); Helper.enableNode(valueText, getSkinnable().isValueVisible()); Helper.enableNode(unitText, !getSkinnable().getUnit().isEmpty()); + Helper.enableNode(subTitleText, !getSkinnable().getSubTitle().isEmpty()); Helper.enableNode(averageLine, getSkinnable().isAverageVisible()); Helper.enableNode(averageText, getSkinnable().isAverageVisible()); Helper.enableNode(stdDeviationArea, getSkinnable().isAverageVisible()); + redraw(); } else if ("SECTION".equals(EVENT_TYPE)) { } else if ("ALERT".equals(EVENT_TYPE)) {
Fixed problem with updating the subtitle text in TileSparklineSkin
HanSolo_Medusa
train
java
b65ddd8e64d10d59577e638cb65494bc6b5532c5
diff --git a/src/BaseClipboard.php b/src/BaseClipboard.php index <HASH>..<HASH> 100644 --- a/src/BaseClipboard.php +++ b/src/BaseClipboard.php @@ -78,9 +78,9 @@ abstract class BaseClipboard implements Contracts\Clipboard */ public function getRolesLookup(Model $authority) { - $roles = $authority->roles()->pluck( + $roles = $authority->roles()->get([ 'name', Models::role()->getQualifiedKeyName() - ); + ])->pluck('name', Models::role()->getKeyName()); // In Laravel 5.1, "pluck" returns an Eloquent collection, // so we call "toBase" on it. In 5.2, "pluck" returns a
Support Laravel <I>
JosephSilber_bouncer
train
php
247e6db916264177916f7bcbea2f10d35c20ff1b
diff --git a/symbols/builtin.py b/symbols/builtin.py index <HASH>..<HASH> 100644 --- a/symbols/builtin.py +++ b/symbols/builtin.py @@ -12,14 +12,10 @@ from symbol_ import Symbol from number import SymbolNUMBER from string_ import SymbolSTRING -from typecast import SymbolTYPECAST from type_ import SymbolTYPE -from type_ import SymbolBASICTYPE from api.check import is_number from api.check import is_string -from api.constants import TYPE_SIZES -from api.constants import TYPE class SymbolBUILTIN(Symbol):
Clean Up: Removed unused imports
boriel_zxbasic
train
py
11561aeb54b25e34957d5950ee05ac01d669f3c7
diff --git a/admin/code/ModelAdmin.php b/admin/code/ModelAdmin.php index <HASH>..<HASH> 100644 --- a/admin/code/ModelAdmin.php +++ b/admin/code/ModelAdmin.php @@ -226,7 +226,15 @@ abstract class ModelAdmin extends LeftAndMain { public function getList() { $context = $this->getSearchContext(); - $params = $this->request->requestVar('q'); + $params = $this->getRequest()->requestVar('q'); + + if(is_array($params)) { + $trimRecursive = function($v) use(&$trimRecursive) { + return is_array($v) ? array_map($trimRecursive, $v) : trim($v); + }; + $params = $trimRecursive($params); + } + $list = $context->getResults($params); $this->extend('updateList', $list);
Do not hang on nested parameters in search context Backport of 0b5a<I> for <I> that does not add a new API, as required by #<I> to be semver compatible.
silverstripe_silverstripe-framework
train
php
480d18b718d704aa2ca3849fefa8a26ff39f38ad
diff --git a/lib/Thelia/Core/Template/Loop/OrderProduct.php b/lib/Thelia/Core/Template/Loop/OrderProduct.php index <HASH>..<HASH> 100644 --- a/lib/Thelia/Core/Template/Loop/OrderProduct.php +++ b/lib/Thelia/Core/Template/Loop/OrderProduct.php @@ -144,6 +144,7 @@ class OrderProduct extends BaseLoop implements PropelSearchLoopInterface ->set("TAX_RULE_DESCRIPTION", $orderProduct->getTaxRuledescription()) ->set("PARENT", $orderProduct->getParent()) ->set("EAN_CODE", $orderProduct->getEanCode()) + ->set("CART_ITEM_ID", $orderProduct->getCartItemId()) ; $this->addOutputFields($loopResultRow, $orderProduct);
Added CART_ITEM_ID output variable
thelia_core
train
php
39f4b67f1cb0bd9367a7e281134de5af5421a10a
diff --git a/src/main/java/com/github/greengerong/PreRenderSEOFilter.java b/src/main/java/com/github/greengerong/PreRenderSEOFilter.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/greengerong/PreRenderSEOFilter.java +++ b/src/main/java/com/github/greengerong/PreRenderSEOFilter.java @@ -256,13 +256,13 @@ public class PreRenderSEOFilter implements Filter { final List<String> whiteList = getWhitelist(); if (whiteList != null && !isInWhiteList(url, whiteList)) { - log.trace("Request is whitelisted; intercept: yes"); - return true; + log.trace("Whitelist is enabled, but this request is not listed; intercept: no"); + return false; } final List<String> blacklist = getBlacklist(); if (blacklist != null && isInBlackList(url, referer, blacklist)) { - log.trace("Request is blacklisted; intercept: no"); + log.trace("Blacklist is enabled, and this request is listed; intercept: no"); return false; }
fixed the semantics and logging for whitelists and blacklists
greengerong_prerender-java
train
java
503f27b27825088939290aee5b4aa70a529c08be
diff --git a/lib/instrumental/agent.rb b/lib/instrumental/agent.rb index <HASH>..<HASH> 100644 --- a/lib/instrumental/agent.rb +++ b/lib/instrumental/agent.rb @@ -366,6 +366,8 @@ module Instrumental end def start_connection_worker + # NOTE: We need a mutex around both `running?` and thread creation, + # otherwise we could create two threads. @start_worker_mutex.synchronize do return if running? return unless enabled?
Added note about thread creation mutex.
Instrumental_instrumental_agent-ruby
train
rb
57af85cead0f4ea0fdef6be63034571ac647a3a0
diff --git a/lib/mqtt/proxy.rb b/lib/mqtt/proxy.rb index <HASH>..<HASH> 100644 --- a/lib/mqtt/proxy.rb +++ b/lib/mqtt/proxy.rb @@ -4,7 +4,6 @@ class MQTT::Proxy attr_reader :local_port attr_reader :broker_host attr_reader :broker_port - attr_reader :listen_queue attr_reader :select_timeout attr_reader :logger
Removed unused instance variable from proxy.rb
njh_ruby-mqtt
train
rb
181a1d47b4a05e918f4d6f89a7397de16f10cbe9
diff --git a/drivers/generic/generic.go b/drivers/generic/generic.go index <HASH>..<HASH> 100644 --- a/drivers/generic/generic.go +++ b/drivers/generic/generic.go @@ -171,8 +171,5 @@ func (d *Driver) Restart() error { } func (d *Driver) Kill() error { - log.Debug("Killing...") - - _, err := drivers.RunSSHCommandFromDriver(d, "sudo shutdown -P now") - return err + return errors.New("generic driver does not support kill") }
The generic driver shouldn't support kill since stop is not supported
docker_machine
train
go
aca88bfb990a8c30f419d3f4ca8284fd9e371f34
diff --git a/view/attachments/tmpl/manage.html.php b/view/attachments/tmpl/manage.html.php index <HASH>..<HASH> 100644 --- a/view/attachments/tmpl/manage.html.php +++ b/view/attachments/tmpl/manage.html.php @@ -67,7 +67,7 @@ $callback = isset($query['callback']) ? $query['callback'] : null; { var that = this; - $(object.object.element).find('button').click(function() + $(object.object.element).find('span').click(function() { var attachment = object.object.name; that.select(attachment);
re #<I> Button is now a span.
joomlatools_joomlatools-framework
train
php
d2e0ee70ad790999e61f4d4e31341062146cbcbf
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -11,9 +11,26 @@ export function AggregateError(message: string, innerError?: Error, skipIfAlread return innerError; } - if (innerError.stack) { - message += `\n------------------------------------------------\ninner error: ${innerError.stack}`; + const separator = '\n------------------------------------------------\n'; + + message += `${separator}Inner Error:\n`; + + if (typeof(innerError) === 'string' ) { + message += `Message: ${innerError}`; + } else { + if (innerError.message) { + message += `Message: ${innerError.message}`; + } else { + message += `Unknown Inner Error Type. Displaying Inner Error as JSON:\n ${JSON.stringify(innerError, null, ' ')}`; + } + + if (innerError.stack) { + message += `\nInner Error Stack:\n${innerError.stack}`; + message += '\nEnd Inner Error Stack'; + } } + + message += separator; } let e = new Error(message);
fix(AggregateError): better surface inner error information
aurelia_pal
train
js
da76e7d79b93bc3a116d57b32ef87857ff87b2e9
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -19,10 +19,10 @@ module.exports = { function build( data ) { data.parts.push( '<head>' + - '<script src="/plugins/' + sinonPath.split( path.sep ).join( '/' ) + '"></script>' + + '<script src="' + path.join( '/plugins', sinonPath ).split( path.sep ).join( '/' ) + '"></script>' + // IE8- need additional care to make timers and XHR work. '<!--[if lte IE 8]>' + - '<script src="/plugins/' + sinonIEPath.split( path.sep ).join( '/' ) + '"></script>' + + '<script src="' + path.join( '/plugins', sinonIEPath ).split( path.sep ).join( '/' ) + '"></script>' + '<![endif]-->' + '</head>' );
Fixed the case when URL might contain two slashes after plugins directory.
benderjs_benderjs-sinon
train
js
f597407876420ba30f0c84691bdb54c0560e01c1
diff --git a/ttorrent-client/src/main/java/com/turn/ttorrent/client/peer/SharingPeer.java b/ttorrent-client/src/main/java/com/turn/ttorrent/client/peer/SharingPeer.java index <HASH>..<HASH> 100644 --- a/ttorrent-client/src/main/java/com/turn/ttorrent/client/peer/SharingPeer.java +++ b/ttorrent-client/src/main/java/com/turn/ttorrent/client/peer/SharingPeer.java @@ -595,6 +595,7 @@ public class SharingPeer extends Peer implements MessageListener, PeerInformatio this.download.add(piece.getBlock().capacity()); try { + boolean isPieceDownloaded = false; synchronized (p) { // Remove the corresponding request from the request queue to // make room for next block requests. @@ -614,9 +615,12 @@ public class SharingPeer extends Peer implements MessageListener, PeerInformatio // we should validate the piece. if (getRemainingRequestedPieces(p) == 0) { this.firePieceCompleted(p); - this.firePeerReady(); + isPieceDownloaded = true; } } + if (isPieceDownloaded) { + firePeerReady(); + } } catch (IOException ioe) { logger.error(ioe.getMessage(), ioe); this.fireIOException(new IOException(
move fire peer ready callback outside sync on piece for better performance
mpetazzoni_ttorrent
train
java
5b2d89c88f5feadbf50aad1575f987a5fdcc09db
diff --git a/spec/models/booking_spec.rb b/spec/models/booking_spec.rb index <HASH>..<HASH> 100644 --- a/spec/models/booking_spec.rb +++ b/spec/models/booking_spec.rb @@ -162,7 +162,7 @@ describe Booking do it 'should include accounts only once' do FactoryGirl.create(:booking, debit_account: debit_account, credit_account: cash_account) - FactoryGirl.create(:booking, debit_account: cash_account, debit_account: debit_account) + FactoryGirl.create(:booking, debit_account: cash_account, credit_account: debit_account) expect(Booking.accounts.count).to eq(2) end end @@ -188,7 +188,7 @@ describe Booking do it 'should include accounts only once' do FactoryGirl.create(:booking, debit_account: debit_account, credit_account: cash_account) - FactoryGirl.create(:booking, debit_account: cash_account, debit_account: debit_account) + FactoryGirl.create(:booking, debit_account: cash_account, credit_account: debit_account) expect(Booking.accounts.count).to eq(2) end end
test(models): fix parameters to factory call in model spec We passed twice the same parameter in a factory call. The spec itself was proper though. This patch fixes the factory calls.
huerlisi_has_accounts
train
rb
e5c6c9bdf8b2fe665f6b13d8d624030735f9a964
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/Session.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/Session.java index <HASH>..<HASH> 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/packet/Session.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/Session.java @@ -37,8 +37,6 @@ public class Session extends SimpleIQ { public static final String ELEMENT = "session"; public static final String NAMESPACE = "urn:ietf:params:xml:ns:xmpp-session"; - private static final String SESSION = '<' + ELEMENT + " xmlns='" + NAMESPACE + "'/>"; - public Session() { super(ELEMENT, NAMESPACE); setType(IQ.Type.set);
Remove unused private field in Session
igniterealtime_Smack
train
java
49491e428f1230294d3460c6597f56049c7bd1e3
diff --git a/includes/session.php b/includes/session.php index <HASH>..<HASH> 100644 --- a/includes/session.php +++ b/includes/session.php @@ -31,7 +31,7 @@ if (!defined('WT_SCRIPT_NAME')) { // Identify ourself define('WT_WEBTREES', 'webtrees'); -define('WT_VERSION', '1.4.2'); +define('WT_VERSION', '1.5.0'); define('WT_VERSION_RELEASE', 'svn'); // “svn”, “beta”, “rc1”, “”, etc. define('WT_VERSION_TEXT', trim(WT_VERSION.' '.WT_VERSION_RELEASE));
The next release will be <I>
fisharebest_webtrees
train
php
9cd24ffab509cd0200f2de570d427cacaf1571df
diff --git a/api_test.go b/api_test.go index <HASH>..<HASH> 100644 --- a/api_test.go +++ b/api_test.go @@ -68,6 +68,7 @@ var ( /* Only needed at C level */ "virCopyLastError", "virFreeError", + "virGetLastError", "virGetLastErrorMessage", "virGetLastErrorCode", "virGetLastErrorDomain", diff --git a/error.go b/error.go index <HASH>..<HASH> 100644 --- a/error.go +++ b/error.go @@ -594,26 +594,6 @@ func makeError(err *C.virError) Error { return ret } -func GetLastError() Error { - err := C.virGetLastError() - if err == nil { - return Error{ - Code: ERR_OK, - Domain: FROM_NONE, - Message: "Missing error", - Level: ERR_NONE, - } - } - virErr := Error{ - Code: ErrorNumber(err.code), - Domain: ErrorDomain(err.domain), - Message: C.GoString(err.message), - Level: ErrorLevel(err.level), - } - C.virResetError(err) - return virErr -} - func GetNotImplementedError(apiname string) Error { return Error{ Code: ERR_NO_SUPPORT,
error: remove GetLastError() function The virGetLastError() function fetches the last reported error from a thread local variable. Goroutines may be arbitrarily switched between OS threads between the libvirt API call and the virGetLastError() call. Thus this API is impossible to use safely and must be removed. All the Go APIs return an error object directly so nothing should need the GetLastError() binding anyway.
libvirt_libvirt-go
train
go,go
dc14cbae07531fdc7f118c16f263cf107bded668
diff --git a/src/Mover.php b/src/Mover.php index <HASH>..<HASH> 100644 --- a/src/Mover.php +++ b/src/Mover.php @@ -91,7 +91,7 @@ class Mover } foreach( $this->movedPackages as $movedPackage ) { - $packageDir = $this->workingDir . '/vendor/' . $movedPackage; + $packageDir = '/vendor/' . $movedPackage; $this->filesystem->deleteDir($packageDir); } }
Deleting directories needs to happen on a relative path
coenjacobs_mozart
train
php
8762ad66d2fec5e0095de11617708fb126a7727d
diff --git a/raiden/tests/utils/blockchain.py b/raiden/tests/utils/blockchain.py index <HASH>..<HASH> 100644 --- a/raiden/tests/utils/blockchain.py +++ b/raiden/tests/utils/blockchain.py @@ -82,7 +82,6 @@ def geth_to_cmd(node, datadir, verbosity): # dont use the '--dev' flag cmd.extend([ '--nodiscover', - '--ipcdisable', '--rpc', '--rpcapi', 'eth,net,web3', '--rpcaddr', '0.0.0.0',
Enable ipc for geth tests
raiden-network_raiden
train
py
ca02c737d001b0acf203a0855404115f8eef5a90
diff --git a/lib/controller/MockController.js b/lib/controller/MockController.js index <HASH>..<HASH> 100644 --- a/lib/controller/MockController.js +++ b/lib/controller/MockController.js @@ -28,6 +28,7 @@ function _fetch(opt) { method: opt.method || 'GET', form: opt.data || {}, headers: opt.headers || {}, + gzip: true, }, function (error, res, data) { if (error) { @@ -122,6 +123,7 @@ MockController.prototype = extend(MockController.prototype, { this.forIn(response.headers, function (key, value) { res.setHeader(key, value); }); + res.removeHeader('content-encoding'); res.statusCode = response.statusCode; res.send(data); log.log('tunnel data from "' + tunnelUrl + '" to "' + req.url + '"');
[feature] decompress gzip responses from tunneled server
smollweide_node-mock-server
train
js
a2ecd6b67696367e88cbf9418ec8be89c98f3dfe
diff --git a/clientv3/integration/dial_test.go b/clientv3/integration/dial_test.go index <HASH>..<HASH> 100644 --- a/clientv3/integration/dial_test.go +++ b/clientv3/integration/dial_test.go @@ -79,20 +79,15 @@ func TestDialTLSNoConfig(t *testing.T) { DialTimeout: time.Second, DialOptions: []grpc.DialOption{grpc.WithBlock()}, }) - if err != nil { - t.Fatal(err) - } - defer c.Close() - - // TODO: this should not be required when we set grpc.WithBlock() - if c != nil { - ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second) - _, err = c.KV.Get(ctx, "/") - cancel() - } + defer func() { + if c != nil { + c.Close() + } + }() if !isClientTimeout(err) { t.Fatalf("expected dial timeout error, got %v", err) } + } // TestDialSetEndpointsBeforeFail ensures SetEndpoints can replace unavailable
clientv3: Simplify TestDialTLSNoConfig now that dial with grpc.WithBlock correctly results in a client timeout error
etcd-io_etcd
train
go
4daf5a43f87c111d286e436c7e94343da252c754
diff --git a/vendor/github.com/hashicorp/nomad/api/event_sink.go b/vendor/github.com/hashicorp/nomad/api/event_sink.go index <HASH>..<HASH> 100644 --- a/vendor/github.com/hashicorp/nomad/api/event_sink.go +++ b/vendor/github.com/hashicorp/nomad/api/event_sink.go @@ -52,6 +52,6 @@ func (e *EventSinks) Register(eventSink *EventSink, w *WriteOptions) (*WriteMeta return wm, nil } -func (e *EventSinks) Deregister(name string, w *WriteOptions) (*WriteMeta, error) { - return e.client.delete("/v1/event/sink/"+name, nil, w) +func (e *EventSinks) Deregister(id string, w *WriteOptions) (*WriteMeta, error) { + return e.client.delete("/v1/event/sink/"+id, nil, w) }
make sync to update event stream api (#<I>)
hashicorp_nomad
train
go
ec1e04cafc08e49993f7755593b979af99b79733
diff --git a/lib/core/sdam/monitoring.js b/lib/core/sdam/monitoring.js index <HASH>..<HASH> 100644 --- a/lib/core/sdam/monitoring.js +++ b/lib/core/sdam/monitoring.js @@ -4,8 +4,8 @@ const ServerDescription = require('./server_description').ServerDescription; const calculateDurationInMs = require('../utils').calculateDurationInMs; // pulled from `Server` implementation -const STATE_DISCONNECTED = 'disconnected'; -const STATE_DISCONNECTING = 'disconnecting'; +const STATE_CLOSED = 'closed'; +const STATE_CLOSING = 'closing'; /** * Published when server description changes, but does NOT include changes to the RTT. @@ -180,7 +180,7 @@ function monitorServer(server, options) { // emit an event indicating that our description has changed server.emit('descriptionReceived', new ServerDescription(server.description.address, isMaster)); - if (server.s.state === STATE_DISCONNECTED || server.s.state === STATE_DISCONNECTING) { + if (server.s.state === STATE_CLOSED || server.s.state === STATE_CLOSING) { return; }
fix(monitoring): incorrect states used to determine rescheduling
mongodb_node-mongodb-native
train
js
38804285424e439575fcae05b04dc6ebad3060f1
diff --git a/logging/logging.go b/logging/logging.go index <HASH>..<HASH> 100644 --- a/logging/logging.go +++ b/logging/logging.go @@ -3,8 +3,10 @@ package logging import ( + "bufio" "fmt" "io" + "net" "net/http" "strings" "time" @@ -118,4 +120,12 @@ func (w *responseWrapper) WriteHeader(status int) { w.w.WriteHeader(status) } +func (w *responseWrapper) Hijack() (net.Conn, *bufio.ReadWriter, error) { + if hijacker, ok := w.w.(http.Hijacker); ok { + return hijacker.Hijack() + } else { + panic("http-handlers: ResponseWriter does not implement http.Hijacker") + } +} + type clock func() time.Time
Make logging responseWrapper proxy Hijack() This allows wrapped responseWriters to be used with websockets.
codahale_http-handlers
train
go
6f7488fb59668a6132821a8f86e13b8dd7389594
diff --git a/config.js b/config.js index <HASH>..<HASH> 100644 --- a/config.js +++ b/config.js @@ -42,8 +42,8 @@ var config = { }, testnet: { provider: 'insight', - //url: 'https://test-insight.bitpay.com:443', - url: 'http://localhost:3001', + url: 'https://test-insight.bitpay.com:443', + // url: 'http://localhost:3001', // Multiple servers (in priority order) // url: ['http://a.b.c', 'https://test-insight.bitpay.com:443'], },
default to public insight server on testnet
bitpay_bitcore-wallet-service
train
js
4bdf86fbcacfda42ae9c6170d59d049208ad7064
diff --git a/stats/cloud/api.go b/stats/cloud/api.go index <HASH>..<HASH> 100644 --- a/stats/cloud/api.go +++ b/stats/cloud/api.go @@ -159,14 +159,13 @@ func (c *Client) TestFinished(referenceID string, thresholds ThresholdResult, ta url := fmt.Sprintf("%s/tests/%s", c.baseURL, referenceID) status := 0 - if tained { status = 1 } data := struct { - Status int `json:"status"` - Thresholds ThresholdResult `json:"thresholds"` + ResultStatus int `json:"result_status"` + Thresholds ThresholdResult `json:"thresholds"` }{ status, thresholds,
Cloud: request data property `status` becomes `result_status`
loadimpact_k6
train
go
80cbe3674456c59da992a0393084accebf4faf9d
diff --git a/interface/transport.js b/interface/transport.js index <HASH>..<HASH> 100644 --- a/interface/transport.js +++ b/interface/transport.js @@ -13,13 +13,19 @@ fdom.apis.set("transport", { * by the transport provider to send/receive signalling messages * to the other side of the P2P connection for setup. * - * @constructor + * @method setup * @param {String} name - give this connection a name for logging * @param {Proxy} channel - signalling channel * @return nothing. **/ - 'constructor': { - value: ["string", "proxy"] + 'setup': { + type: "method", + value: ["string", "proxy"], + ret: [], + err: { + "errcode": "string", + "message": "string" + } }, /**
keep setup method so that promise can be waited for. Resolution for #1
freedomjs_freedom
train
js
1c78b70932db9608787f7c568caecf259b8d29e3
diff --git a/pyamg/vis/vis.py b/pyamg/vis/vis.py index <HASH>..<HASH> 100644 --- a/pyamg/vis/vis.py +++ b/pyamg/vis/vis.py @@ -185,9 +185,13 @@ def coarse_grid_vis(fid, Vert, E2V, Agg, mesh_type, A=None, plot_type='primal'): # if plot_type == 'primal': Agg = csr_matrix(Agg) + + if E2V.max() >= Agg.shape[0]: + # remove elements with dirichlet BCs + E2V = E2V[E2V.max(axis=1) < Agg.shape[0]] # Find elements with all vertices in same aggregate - if len(Agg.indices)!=Agg.shape[0]: + if len(Agg.indices) != Agg.shape[0]: # account for 0 rows. mark them as solitary aggregates full_aggs = array(Agg.sum(axis=1),dtype=int).ravel() full_aggs[full_aggs==1] = Agg.indices
made aggregation work for problems with Dirichlet BCs
pyamg_pyamg
train
py
29cbb530ab3f3b95d6e646d4e4c0adc5465cdfc6
diff --git a/azurerm/resource_arm_public_ip.go b/azurerm/resource_arm_public_ip.go index <HASH>..<HASH> 100644 --- a/azurerm/resource_arm_public_ip.go +++ b/azurerm/resource_arm_public_ip.go @@ -225,7 +225,7 @@ func validatePublicIpDomainNameLabel(v interface{}, k string) (ws []string, erro value := v.(string) if !regexp.MustCompile(`^[a-z0-9-]+$`).MatchString(value) { errors = append(errors, fmt.Errorf( - "only alphanumeric characters and hyphens allowed in %q: %q", + "only lowercase alphanumeric characters and hyphens allowed in %q: %q", k, value)) }
Clarify the error message the public IP domain name label As per the regex, only lowercase characters are allowed.
terraform-providers_terraform-provider-azurerm
train
go
8480d91f2718eb7351c12f5a6417abb37a096bdb
diff --git a/test/specs/header.spec.js b/test/specs/header.spec.js index <HASH>..<HASH> 100644 --- a/test/specs/header.spec.js +++ b/test/specs/header.spec.js @@ -328,8 +328,6 @@ describe('Header', function() { protocolVersion: 0x37, }; - debugger; - var datagram = new DebugHeader(options); expect(datagram.compareTo(new DebugHeader(options))).to.equal(0);
- Removed orphaned debugger statement
danielwippermann_resol-vbus
train
js
9c7cdf6723ea11d056465550b9cf0af3757c3ece
diff --git a/test/test_persistence.py b/test/test_persistence.py index <HASH>..<HASH> 100644 --- a/test/test_persistence.py +++ b/test/test_persistence.py @@ -44,7 +44,7 @@ class DatabaseTestCase(unittest.TestCase): class TableTestCase(unittest.TestCase): def setUp(self): - self.db = connect(url='sqlite:///:memory:') + self.db = connect('sqlite:///:memory:') self.tbl = self.db['weather'] for row in TEST_DATA: self.tbl.insert(row)
No needs for positional args.
pudo_dataset
train
py
f9db48d2eb64249ffa3dd7b4373ab277b68d5b6a
diff --git a/aeron-archiver/src/main/java/io/aeron/archiver/Catalog.java b/aeron-archiver/src/main/java/io/aeron/archiver/Catalog.java index <HASH>..<HASH> 100644 --- a/aeron-archiver/src/main/java/io/aeron/archiver/Catalog.java +++ b/aeron-archiver/src/main/java/io/aeron/archiver/Catalog.java @@ -64,8 +64,8 @@ class Catalog implements AutoCloseable private final UnsafeBuffer unsafeBuffer; private final MappedByteBuffer mappedByteBuffer; + private final int fileSyncLevel; private long nextRecordingId = 0; - private int fileSyncLevel; Catalog(final File archiveDir, final FileChannel archiveDirChannel, final int fileSyncLevel) {
[Java] fileSyncLevel should be a final field.
real-logic_aeron
train
java
cdea9e8b1540721f7038792187dc9c487bf4ceeb
diff --git a/tests/unit/test_policies.py b/tests/unit/test_policies.py index <HASH>..<HASH> 100644 --- a/tests/unit/test_policies.py +++ b/tests/unit/test_policies.py @@ -351,7 +351,7 @@ class TokenAwarePolicyTest(unittest.TestCase): self.assertEqual(policy.distance(remote_host), HostDistance.IGNORED) # dc2 isn't registered in the policy's live_hosts dict - policy.child_policy.used_hosts_per_remote_dc = 1 + policy._child_policy.used_hosts_per_remote_dc = 1 self.assertEqual(policy.distance(remote_host), HostDistance.IGNORED) # make sure the policy has both dcs registered
Update policy unit test for attribute rename
datastax_python-driver
train
py
c6bff4484afbe5595a78eeb3cf266458bfe54350
diff --git a/python/nano/src/bigdl/nano/automl/utils/proxy.py b/python/nano/src/bigdl/nano/automl/utils/proxy.py index <HASH>..<HASH> 100644 --- a/python/nano/src/bigdl/nano/automl/utils/proxy.py +++ b/python/nano/src/bigdl/nano/automl/utils/proxy.py @@ -21,7 +21,8 @@ from bigdl.nano.utils.log4Error import invalidInputError def proxy_method(cls, name): # This unbound method will be pulled from the superclass. invalidInputError(hasattr(cls, name), - "cls should have name attribute") + f"%s should have %s attribute" % + (str(cls.__name__), name)) proxyed = getattr(cls, name) @functools.wraps(proxyed) @@ -32,5 +33,6 @@ def proxy_method(cls, name): def proxy_methods(cls): for name in cls.PROXYED_METHODS: - setattr(cls, name, proxy_method(cls, name)) + if hasattr(cls, name): + setattr(cls, name, proxy_method(cls, name)) return cls
fix proxy for tf version compatibility (#<I>)
intel-analytics_BigDL
train
py
6620dd3a3266f02d008c9a17318b83fb4516ba87
diff --git a/bokeh/server/session.py b/bokeh/server/session.py index <HASH>..<HASH> 100644 --- a/bokeh/server/session.py +++ b/bokeh/server/session.py @@ -72,7 +72,7 @@ class ServerSession(object): # other and their final states will differ. for connection in self._subscribed_connections: if may_suppress and connection is self._current_patch_connection: - log.debug("Not sending notification back to client %r for a change it requested", connection) + pass #log.debug("Not sending notification back to client %r for a change it requested", connection) else: connection.send_patch_document(event)
Don't log every time we don't send a client back its patch
bokeh_bokeh
train
py
b1885a337f513280a075c7d36a7a2590045ecf7b
diff --git a/AdvancedHTMLParser/Tags.py b/AdvancedHTMLParser/Tags.py index <HASH>..<HASH> 100644 --- a/AdvancedHTMLParser/Tags.py +++ b/AdvancedHTMLParser/Tags.py @@ -247,6 +247,17 @@ class AdvancedTag(object): return ret + def getAllNodes(self): + ''' + getAllNodes - Returns this node, all children, and all their children and so on till the end + + @return TagCollection<AdvancedTag> + ''' + ret = TagCollection([self]) + ret += self.getAllChildNodes() + + return ret + def getPeers(self): ''' getPeers - Get elements who share a parent with this element @@ -790,7 +801,7 @@ class AdvancedTag(object): if canFilterTags is False: raise NotImplementedError('filter methods requires QueryableList installed, it is not. Either install QueryableList, or try the less-robust "find" method, or the getElement* methods.') - allNodes = self.getAllChildNodes() + [self] + allNodes = self.getAllNodes() filterableNodes = FilterableTagCollection(allNodes) @@ -817,7 +828,7 @@ class AdvancedTag(object): if canFilterTags is False: raise NotImplementedError('filter methods requires QueryableList installed, it is not. Either install QueryableList, or try the less-robust "find" method, or the getElement* methods.') - allNodes = self.getAllNodes() + [self] + allNodes = self.getAllNodes() filterableNodes = FilterableTagCollection(allNodes)
Add 'getAllNodes' function to AdvancedTag, which returns same as getAllChildNodes, but also includes the current node.
kata198_AdvancedHTMLParser
train
py
d46f516660268b60c9d9442bf3ee33fd147b6774
diff --git a/tests/negative/regression/filesystem.go b/tests/negative/regression/filesystem.go index <HASH>..<HASH> 100644 --- a/tests/negative/regression/filesystem.go +++ b/tests/negative/regression/filesystem.go @@ -31,7 +31,7 @@ func VFATIgnoresWipeFilesystem() types.Test { out := in mntDevices := []types.MntDevice{ { - Label: "EFI-SYSTEM", + Label: "OEM", Substitution: "$DEVICE", }, } @@ -43,7 +43,7 @@ func VFATIgnoresWipeFilesystem() types.Test { "device": "$DEVICE", "format": "vfat", "wipeFilesystem": false - }}], + }}] } }`
tests/negative/regression/filesystem: use OEM partition The test was failing since the partition chosen to use for the test was already vfat. Update to use a non-vfat partition so the logic intended to be flexed is actually being used.
coreos_ignition
train
go
aad66c06673e4943277f4b73be872d570c5c29a8
diff --git a/python_modules/dagster/dagster/core/storage/file_cache.py b/python_modules/dagster/dagster/core/storage/file_cache.py index <HASH>..<HASH> 100644 --- a/python_modules/dagster/dagster/core/storage/file_cache.py +++ b/python_modules/dagster/dagster/core/storage/file_cache.py @@ -7,6 +7,7 @@ import dagster._check as check from dagster.config import Field from dagster.core.definitions import resource from dagster.utils import mkdir_p +from dagster.utils.backcompat import deprecation_warning from .file_manager import LocalFileHandle @@ -15,6 +16,10 @@ class FileCache(ABC): def __init__(self, overwrite): # Overwrite is currently only a signal to callers to not overwrite. # These classes currently do not enforce any semantics around that + deprecation_warning( + "Support for file cache", + "0.15.0", + ) self.overwrite = check.bool_param(overwrite, "overwrite") @abstractmethod
chore: mark FileCache for deprecation in <I> (#<I>)
dagster-io_dagster
train
py