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
55b91a667b67d33dcf4da42656ef99cd4cbe41a9
diff --git a/lib/gcli/types.js b/lib/gcli/types.js index <HASH>..<HASH> 100644 --- a/lib/gcli/types.js +++ b/lib/gcli/types.js @@ -542,10 +542,7 @@ NumberType.prototype.decrement = function(value) { if (this.min == null) { return newValue; } - if (newValue < this.min) { - return this.min; - } - return newValue; + return this._boundsCheck(newValue); }; NumberType.prototype.increment = function(value) { @@ -555,10 +552,22 @@ NumberType.prototype.increment = function(value) { if (this.max == null) { return newValue; } - if (newValue > this.max) { + return this._boundsCheck(newValue); +}; + +/** + * Return the input value so long as it is within the max/min bounds. If it is + * lower than the minimum, return the minimum. If it is bigger than the maximum + * then return the maximum. + */ +NumberType.prototype._boundsCheck = function(value) { + if (value < this.min) { + return this.min; + } + if (value > this.max) { return this.max; } - return newValue; + return value; }; NumberType.prototype.name = 'number';
make increment/decrement for numbers bounds check in both directions
joewalker_gcli
train
js
393a91a766a8dbf7682ec41b4ffabe6392eabbb4
diff --git a/tests/test_cli.py b/tests/test_cli.py index <HASH>..<HASH> 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -52,9 +52,18 @@ def test_no_flask_imports(run_command): assert 'Blueprint, Config, Flask,' not in result.output def test_additional_context(run_command): - result = run_command(config={'KONCH_CONTEXT': {'foo': 42, 'bar': 24}}) + result = run_command( + config={ + 'KONCH_CONTEXT': { + 'foo': 'foo-value', + 'bar': 'bar-value' + } + }, + input='bar' + ) assert 'Additional variables (see KONCH_CONTEXT):' in result.output assert 'bar, foo' in result.output + assert '>>> \'bar-value\'' in result.output def test_flask_shell_context_processors(run_command): result = run_command(
improve test for KONCH_CONTEXT by additionally checking variable value
sloria_flask-konch
train
py
2b8c679a3d78996b4fb08f3125ed4787fc779ee2
diff --git a/spacy/cli/package.py b/spacy/cli/package.py index <HASH>..<HASH> 100644 --- a/spacy/cli/package.py +++ b/spacy/cli/package.py @@ -18,7 +18,7 @@ def package_cli( output_dir: Path = Arg(..., help="Output parent directory", exists=True, file_okay=False), code_paths: str = Opt("", "--code", "-c", help="Comma-separated paths to Python file with additional code (registered functions) to be included in the package"), meta_path: Optional[Path] = Opt(None, "--meta-path", "--meta", "-m", help="Path to meta.json", exists=True, dir_okay=False), - create_meta: bool = Opt(False, "--create-meta", "-c", "-C", help="Create meta.json, even if one exists"), + create_meta: bool = Opt(False, "--create-meta", "-C", help="Create meta.json, even if one exists"), name: Optional[str] = Opt(None, "--name", "-n", help="Package name to override meta"), version: Optional[str] = Opt(None, "--version", "-v", help="Package version to override meta"), build: str = Opt("sdist", "--build", "-b", help="Comma-separated formats to build: sdist and/or wheel, or none."),
Fix duplicate spacy package CLI opts (#<I>) Use `-c` for `--code` and not additionally for `--create-meta`, in line with the docs.
explosion_spaCy
train
py
272e716d82d7a9257ab7982dd7143615ff57a982
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ if __name__ == '__main__': 'the Cole-Cole model', author='Maximilian Weigand', author_email='[email protected]', - url='http://www.geo.uni-bonn.de/~mweigand', + url='https://github.com/m-weigand/sip_models', # find_packages() somehow does not work under Win7 when creating a # msi # installer # packages=find_packages(),
update homepage to github url
m-weigand_sip_models
train
py
5a070ce9fe3091095be709b644eeac3125b8924f
diff --git a/packages/swagger2openapi/index.js b/packages/swagger2openapi/index.js index <HASH>..<HASH> 100644 --- a/packages/swagger2openapi/index.js +++ b/packages/swagger2openapi/index.js @@ -56,6 +56,7 @@ function throwOrWarn(message, container, options) { } function fixUpSubSchema(schema,parent,options) { + if (schema.nullable) options.patches++; if (schema.discriminator && typeof schema.discriminator === 'string') { schema.discriminator = { propertyName: schema.discriminator }; }
fix(s2o): existing nullable counts as a patch
Mermade_oas-kit
train
js
9519f81de400fd0be4dbec25671a67477d41c1a7
diff --git a/tcconfig/_converter.py b/tcconfig/_converter.py index <HASH>..<HASH> 100644 --- a/tcconfig/_converter.py +++ b/tcconfig/_converter.py @@ -33,7 +33,7 @@ class Humanreadable(object): ByteUnit(regexp=re.compile("^gbps$", re.IGNORECASE), factor=3), ByteUnit(regexp=re.compile("^p$", re.IGNORECASE), factor=5), ] - __RE_NUMBER = re.compile("^[0-9\.]+") + __RE_NUMBER = re.compile("^[\-\+]?[0-9\.]+") def __init__(self, readable_size, kilo_size=1024): """
Accept sign characters as a part of input
thombashi_tcconfig
train
py
ed4984a15b2b5bb62a113c3622bcf5c870e52311
diff --git a/salt/utils/gitfs.py b/salt/utils/gitfs.py index <HASH>..<HASH> 100644 --- a/salt/utils/gitfs.py +++ b/salt/utils/gitfs.py @@ -778,7 +778,16 @@ class Pygit2(GitProvider): else: # Repo cachedir exists, try to attach try: - self.repo = pygit2.Repository(self.cachedir) + try: + self.repo = pygit2.Repository(self.cachedir) + except pygit2.GitError as exc: + # https://github.com/libgit2/pygit2/issues/339 + # https://github.com/libgit2/libgit2/issues/2122 + if "Error stat'ing config file" not in str(exc): + raise + home = pwd.getpwnam(salt.utils.get_user).pw_dir + pygit2.settings.search_path[pygit2.GIT_CONFIG_LEVEL_GLOBAL] = home + self.repo = pygit2.Repository(self.cachedir) except KeyError: log.error(_INVALID_REPO.format(self.cachedir, self.url)) return new
Take into account a pygit2 bug
saltstack_salt
train
py
c47cd087978c6d160cd583552e206ac522ac280b
diff --git a/sumy/evaluation/__main__.py b/sumy/evaluation/__main__.py index <HASH>..<HASH> 100644 --- a/sumy/evaluation/__main__.py +++ b/sumy/evaluation/__main__.py @@ -83,7 +83,7 @@ def build_lsa(parser, language): return summarizer -dtext-rank build_text_rank(parser, language): +def build_text_rank(parser, language): summarizer = TextRankSummarizer(Stemmer(language)) summarizer.stop_words = get_stop_words(language)
Fixed syntax error - I think nobody use this :)
miso-belica_sumy
train
py
757d2cb6a499fee2f31055812647f81f10915016
diff --git a/nipap-www/nipapwww/public/nipap.js b/nipap-www/nipapwww/public/nipap.js index <HASH>..<HASH> 100644 --- a/nipap-www/nipapwww/public/nipap.js +++ b/nipap-www/nipapwww/public/nipap.js @@ -692,9 +692,10 @@ function showPrefix(prefix, reference, offset) { if (prefix.comment == null || prefix.comment == '') { prefix_comment.html("&nbsp;"); } else { - prefix_comment.prop('uib-tooltip', prefix.comment) - prefix_comment.prop('uib-tooltip-placement', 'bottom') prefix_comment.html('<img src="/images/comments-16.png">'); + prefix_comment.children().attr('uib-tooltip', prefix.comment); + prefix_comment.replaceWith(ng_compile(prefix_comment)(ng_scope)); + ng_scope.$apply(); } // Add prefix description
www: Fixed comment popup in prefix list Fixed the comment tooltip popup in the prefix list. Chose to add the tooltip to the image instead of the div as I saw some strange behaviour when having it added to the div (a line break was inserted after the comment image when the tooltip popped up, moving the description one row down). Removed the explicit placement as 'bottom' is set as global default in app.js.
SpriteLink_NIPAP
train
js
70548c1c267b6a7aedb7ca92d02e756c783f778a
diff --git a/tests/integration/test_metrics.py b/tests/integration/test_metrics.py index <HASH>..<HASH> 100644 --- a/tests/integration/test_metrics.py +++ b/tests/integration/test_metrics.py @@ -1,7 +1,6 @@ from datetime import datetime, timedelta, timezone import json import signal -from time import sleep import pytest import requests @@ -9,7 +8,7 @@ import requests from .test_envelope import generate_transaction_item TEST_CONFIG = { - "aggregator": {"bucket_interval": 1, "initial_delay": 0, "debounce_delay": 0,} + "aggregator": {"bucket_interval": 1, "initial_delay": 0, "debounce_delay": 0} } @@ -24,7 +23,7 @@ def _session_payload(timestamp: datetime, started: datetime): "duration": 1947.49, "status": "exited", "errors": 0, - "attrs": {"release": "[email protected]", "environment": "production",}, + "attrs": {"release": "[email protected]", "environment": "production"}, } @@ -301,7 +300,7 @@ def test_session_metrics_non_processing( ) -def test_metrics_extracted_only_once( +def test_session_metrics_extracted_only_once( mini_sentry, relay, relay_with_processing, metrics_consumer ): """
test(integration-metrics): Explicitly mention session metrics integration test (#<I>) - Rename session integration test to explicitly say it's about sessions. Now that there also are integration tests on transaction metrics, I think it's worth the effort to clarify whether it's about sessions. - Remove unused `sleep` import. - Remove extra commas to keep the linter happy.
getsentry_semaphore
train
py
58b5e74713e005e3eb460c354a1514c63a486cd0
diff --git a/parser/file.go b/parser/file.go index <HASH>..<HASH> 100644 --- a/parser/file.go +++ b/parser/file.go @@ -274,6 +274,22 @@ func (f *File) GetMapFlat() map[string]string { return ret } +// GetAllFlat retrieves all sections and keys in the order they are in the +// file, as set of name, values. +func (f *File) GetAllFlat() []string { + var ret []string + for _, section := range f.sections { + name := section.Name() + if section.name != "" { + name = fmt.Sprintf("%s%s", name, DefaultNameKeySeparator) + } + for _, key := range section.keys { + ret = append(ret, fmt.Sprintf("%s%s", name, key), f.ValueManipFunc(section.GetRaw(key))) + } + } + return ret +} + // RenameSectionRaw renames a Section in File using raw (unmanipulated) names. func (f *File) RenameSectionRaw(name, value string) { s := f.GetSection(name)
Adding GetMapFlat method to File
knq_ini
train
go
2c08c15d9229c04f73310de8d0ceffa7a4a2c672
diff --git a/lib/searchkick.rb b/lib/searchkick.rb index <HASH>..<HASH> 100644 --- a/lib/searchkick.rb +++ b/lib/searchkick.rb @@ -2,6 +2,7 @@ require "active_support" require "active_support/core_ext/hash/deep_merge" require "active_support/core_ext/module/attr_internal" +require "active_support/core_ext/module/delegation" require "active_support/notifications" require "hashie" diff --git a/lib/searchkick/relation.rb b/lib/searchkick/relation.rb index <HASH>..<HASH> 100644 --- a/lib/searchkick/relation.rb +++ b/lib/searchkick/relation.rb @@ -1,5 +1,3 @@ -require "active_support/core_ext/module/delegation" - module Searchkick class Relation # note: modifying body directly is not supported
Moved require [skip ci]
ankane_searchkick
train
rb,rb
8ed2025618d1829a2ef3aa9bcd1b7d24d507ec54
diff --git a/Generator/FormBuilder.php b/Generator/FormBuilder.php index <HASH>..<HASH> 100644 --- a/Generator/FormBuilder.php +++ b/Generator/FormBuilder.php @@ -26,6 +26,11 @@ class FormBuilder extends PHPMethod { $function_code[] = $this->component_data['declaration'] . ' {'; + // The function name for a form builder is not fixed: normal forms use + // form() but entity form handlers use buildForm(). + $function_code[] = " £{$this->name} = parent::form(£form, £form_state);"; + $function_code[] = ''; + foreach ($children_contents as $child_item) { $content = $child_item['content'];
Fixed form builders with dynamic form elements not calling the parent.
drupal-code-builder_drupal-code-builder
train
php
f7b078f1ad7517d193f3b47ecdce4d094df611ac
diff --git a/thinc/tests/integration/test_basic_tagger.py b/thinc/tests/integration/test_basic_tagger.py index <HASH>..<HASH> 100644 --- a/thinc/tests/integration/test_basic_tagger.py +++ b/thinc/tests/integration/test_basic_tagger.py @@ -66,6 +66,7 @@ def create_model(request): return request.param [email protected] @pytest.mark.parametrize(('depth', 'width', 'vector_width', 'nb_epoch'), [(2, 32, 16, 5)]) def test_small_end_to_end(depth, width, vector_width, nb_epoch, diff --git a/thinc/tests/integration/test_mnist.py b/thinc/tests/integration/test_mnist.py index <HASH>..<HASH> 100644 --- a/thinc/tests/integration/test_mnist.py +++ b/thinc/tests/integration/test_mnist.py @@ -68,6 +68,7 @@ def create_model(request): return request.param [email protected] @pytest.mark.parametrize(('depth', 'width', 'nb_epoch'), [(2, 8, 5)]) def test_small_end_to_end(depth, width, nb_epoch, create_model,
Mark tagger and MNIST tests as slow
explosion_thinc
train
py,py
21c1f0dcec1201d8ec40d06d0d4eaeee2ab94f07
diff --git a/lib/filterSeries.js b/lib/filterSeries.js index <HASH>..<HASH> 100644 --- a/lib/filterSeries.js +++ b/lib/filterSeries.js @@ -14,9 +14,6 @@ class FilterSeriesArray extends AigleSeriesArray { } _callResolve(value, index) { - if (this._promise._resolved !== 0) { - return; - } this._result[index] = value ? this._array[index] : INTERNAL; if (--this._rest === 0) { this._promise._resolve(compactArray(this._result)); @@ -34,9 +31,6 @@ class FilterSeriesObject extends AigleSeriesObject { } _callResolve(value, index) { - if (this._promise._resolved !== 0) { - return; - } this._result[index] = value ? this._object[this._keys[index]] : INTERNAL; if (--this._rest === 0) { this._promise._resolve(compactArray(this._result));
refactor(filterSeries): remove unnecessary if statement
suguru03_aigle
train
js
2e3518bb858af3d56e2d1fb72289d2f7084aa077
diff --git a/tests/harness.js b/tests/harness.js index <HASH>..<HASH> 100644 --- a/tests/harness.js +++ b/tests/harness.js @@ -1,15 +1,21 @@ -/* (c) Copyright 2017–2018 Robert Grimm */ +/* (c) Copyright 2018 Robert Grimm */ -import { dirname } from 'path'; -import { URL } from 'url'; +import { basename, isAbsolute } from 'path'; +import tap from 'tap'; -export { default } from 'tap'; +const main = process.mainModule && process.mainModule.filename; -// ESLint does not parse the dynamic import form yet. Hence we wrap it for now. -export function dynaload(name) { - return import(name); +export default function test(path, callback) { + const name = isAbsolute(path) ? `@grr/${basename(path, '.js')}` : path; + + // If caller is main module, run tests. Otherwise, return thunk. + if( main === path ) { + return tap.test(name, callback); + } else { + return () => tap.test(name, callback); + } } -// VSCode, in turn, does not parse `import.meta` yet. Also there is only one -// test directory, hence we determine the test directory once. -export const testdir = dirname(new URL(import.meta.url).pathname); +export function load(id) { + return import(id); +}
tests: rewrite harness module to delay tests when loaded as any module But to still execute right away when loaded as the main module.
apparebit_js-junction
train
js
c052a47b4cb6b29b7bf9915875080af7f9873f25
diff --git a/lib/puppet/type/zone.rb b/lib/puppet/type/zone.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/type/zone.rb +++ b/lib/puppet/type/zone.rb @@ -148,9 +148,17 @@ autorequire that directory." newproperty(:ip, :parent => Puppet::Property::List) do require 'ipaddr' - desc "The IP address of the zone. IP addresses must be specified - with the interface, separated by a colon, e.g.: bge0:192.168.0.1. - For multiple interfaces, specify them in an array." + desc "The IP address of the zone. IP addresses **must** be specified + with an interface, and may optionally be specified with a default router + (sometimes called a defrouter). The interface, IP address, and default + router should be separated by colons to form a complete IP address string. + For example: `bge0:192.168.178.200` would be a valid IP address string + without a default router, and `bge0:192.168.178.200:192.168.178.1` adds a + default router to it. + + For zones with multiple interfaces, the value of this attribute should be + an array of IP address strings (each of which must include an interface + and may include a default router)." # The default action of list should is to lst.join(' '). By specifying # @should, we ensure the should remains an array. If we override should, we
Maint: (#<I>) Update docs for ip property of Zone type (allows defrouters since <I>) Per Redmine <I>, the Zone type has allowed specifying default routers as part of the IP string since at least <I> -- see Redmine <I> for deets. This commit updates the doc string to show how to do that.
puppetlabs_puppet
train
rb
5245ba8098a6b5927a781743bedf1445897aad45
diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index <HASH>..<HASH> 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -109,7 +109,7 @@ methods: { connect() { this.pusher = new Pusher(this.app.key, { - wsHost: this.app.host.length === 0 ? window.location.hostname : this.app.host, + wsHost: this.app.host === null ? window.location.hostname : this.app.host, wsPort: this.port, disableStats: true, authEndpoint: '/{{ request()->path() }}/auth',
Do not test the length of the host value, check if it is null
beyondcode_laravel-websockets
train
php
1370b1605cfc14202cff40d2ff04bb5fbf858636
diff --git a/test/tests/interfaceTest.js b/test/tests/interfaceTest.js index <HASH>..<HASH> 100644 --- a/test/tests/interfaceTest.js +++ b/test/tests/interfaceTest.js @@ -291,7 +291,7 @@ describe('Test interface', function() { }); describe('FontName', function () { describe('Open fontname list and select some element', function () { - it('Should apply this font to current selection elements', function() { + it('Should apply this font to current selection elements', function() { var editor = new Jodit(appendTestArea(), { toolbarAdaptive: false }); @@ -310,9 +310,14 @@ describe('Test interface', function() { expect(openFontnameList()).to.be.not.null; - Array.from(openFontnameList().childNodes).forEach(function (font, index) { + Array.from(openFontnameList().childNodes).forEach(async function (font, index) { font = openFontnameList().childNodes[index]; simulateEvent('mousedown', 0, font); + + await new Promise((resolve) => { + setTimeout(resolve, 1000); + }); + var fontFamily = font.querySelector('span[style]').getAttribute('style').replace(/"/g, "'"); expect(sortAtrtibutes(editor.value)).to.be.equal(sortAtrtibutes('<p><span style="' + fontFamily + '">test</span></p>'));
Fixed test to es<I> - need refuck all tests
xdan_jodit
train
js
b364ea36850b28e54045e07ca1c762afcc0b9eff
diff --git a/lib/librarian/version.rb b/lib/librarian/version.rb index <HASH>..<HASH> 100644 --- a/lib/librarian/version.rb +++ b/lib/librarian/version.rb @@ -1,3 +1,3 @@ module Librarian - VERSION = "0.0.9" + VERSION = "0.0.10" end
Bump the version to <I>.
applicationsonline_librarian
train
rb
8423429e664ab28aa98b6b52f7195057c60655b3
diff --git a/src/Logging/Mocks/HasManyHandlers.php b/src/Logging/Mocks/HasManyHandlers.php index <HASH>..<HASH> 100644 --- a/src/Logging/Mocks/HasManyHandlers.php +++ b/src/Logging/Mocks/HasManyHandlers.php @@ -17,6 +17,22 @@ trait HasManyHandlers public $default = null; /** + * Check if logger can load many handlers + * + * @param Logger $log + * @return Logger + */ + private function withHandlers(Logger $log) : Logger + { + $channels = Config::has('logging.with_handlers') ? Config::get('logging.with_handlers') : []; + + if (is_array($channels)) + return $this->attachHandlers($log, $channels); + + return $log; + } + + /** * Load other handlers * * @param Logger $log
feat: Check if logger can load many handlers
modulusphp_hibernate
train
php
b1bd462917c03d140cfcff0ac5c5b3294819668e
diff --git a/handlers/intlekt/edition/visualisation.py b/handlers/intlekt/edition/visualisation.py index <HASH>..<HASH> 100644 --- a/handlers/intlekt/edition/visualisation.py +++ b/handlers/intlekt/edition/visualisation.py @@ -17,7 +17,7 @@ def sample_usls(n, language='EN'): def recent_usls(n, language='EN'): return [] -def usl_to_json(usl, language='EN'): +def usl_to_json(usl): u = _usl(usl["usl"]) def _walk(u, start=True): if isinstance(u, Term): @@ -25,7 +25,8 @@ def usl_to_json(usl, language='EN'): 'type': u.__class__.__name__.lower(), 'script': str(u.script), 'singular_sequences': [str(s) for s in u.script.singular_sequences], - 'title': TermsConnector().get_term(u.script)['TAGS'][language] + 'title': {'en':TermsConnector().get_term(u.script)['TAGS']['EN'], + 'fr':TermsConnector().get_term(u.script)['TAGS']['FR']} } if start and len(u.children) == 1: return _walk(u.children[0])
send usl descriptor in all languages
IEMLdev_ieml
train
py
a6acbdbbbb9abf9522d998706b4d610c2b4cb51c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ setup_params = dict( ], ), install_requires=[ - "irc>=2.0.3,<3.0dev", + "irc>=3.0<4.0dev", "popquotes>=1.3", "excuses>=1.1.2", "pyyaml",
Update dependency on irc lib
yougov_pmxbot
train
py
90de381cdb594d55478b412818213fd9996ab88b
diff --git a/chunks.go b/chunks.go index <HASH>..<HASH> 100644 --- a/chunks.go +++ b/chunks.go @@ -171,12 +171,7 @@ func (w *chunkWriter) finalizeTail() error { return err } - if err := tf.Close(); err != nil { - return err - } - - // close dir file (if not windows platform will fail on rename) - return w.dirFile.Close() + return tf.Close() } func (w *chunkWriter) cut() error { @@ -282,7 +277,12 @@ func (w *chunkWriter) seq() int { } func (w *chunkWriter) Close() error { - return w.finalizeTail() + if err := w.finalizeTail(); err != nil { + return err + } + + // close dir file (if not windows platform will fail on rename) + return w.dirFile.Close() } // ChunkReader provides reading access of serialized time series data.
fix bugs on platform windows to pass all test case
prometheus_prometheus
train
go
ff8a0629e8b24346c6fd9ebf9fbc39cd1a4b3ab7
diff --git a/src/Input/Input.js b/src/Input/Input.js index <HASH>..<HASH> 100644 --- a/src/Input/Input.js +++ b/src/Input/Input.js @@ -198,8 +198,8 @@ type ProvidedProps = { export type Props = { /** * This property helps users to fill forms faster, especially on mobile devices. - * The name can be confusion, it's more like an autofill. - * You can learn about it with that article + * The name can be confusing, it's more like an autofill. + * You can learn more about it in this article * https://developers.google.com/web/updates/2015/06/checkout-faster-with-autofill */ autoComplete?: string,
Fix grammar in documentation (#<I>) confusion -> confusing You can learn about it with this article -> You can learn more about it in this article
mui-org_material-ui
train
js
774e4aefe5c449b6f074e14d32e7c6a7d77ead43
diff --git a/shared/flex.go b/shared/flex.go index <HASH>..<HASH> 100644 --- a/shared/flex.go +++ b/shared/flex.go @@ -3,7 +3,7 @@ */ package shared -var Version = "2.0.0.rc7" +var Version = "2.0.0.rc8" var UserAgent = "LXD " + Version /*
Release LXD <I>.rc8
lxc_lxd
train
go
a3bb3599b44aa24d6144dd580f269901c626d8d5
diff --git a/lib/proj4.rb b/lib/proj4.rb index <HASH>..<HASH> 100644 --- a/lib/proj4.rb +++ b/lib/proj4.rb @@ -5,7 +5,7 @@ end require 'proj4_ruby' -# Ruby bindings for the Proj.4 cartographic projection library (http://proj.maptools.org). +# Ruby bindings for the Proj.4 cartographic projection library (http://trac.osgeo.org/proj/). module Proj4 # Base class for all Proj.4 exceptions. Subclasses with the name <errorname>Error are available for each exception. @@ -58,7 +58,7 @@ module Proj4 # = Creating a new projection object # # Projection objects are created through the new method as usual. Depending on the kind of projection, many - # different parameters are needed. Please consult the documentation of the Proj.4 C library at http://proj.maptools.org + # different parameters are needed. Please consult the documentation of the Proj.4 C library at http://trac.osgeo.org/proj/ # for details. # # There are several ways of specifying the parameters: @@ -466,7 +466,7 @@ module Proj4 # # This class is deprecated and it will disappear in a later version of this # library. Use Proj4::Point instead (or any other class supporting x, y read and - # write accessor method. + # write accessor method.) class UV attr_accessor :x, :y
Changed proj<I> website url
cfis_proj4rb
train
rb
81e16dad6c151611d0c1e5fd7927378d58e6344a
diff --git a/activerecord/test/support/config.rb b/activerecord/test/support/config.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/support/config.rb +++ b/activerecord/test/support/config.rb @@ -1,5 +1,5 @@ require "yaml" -require "erubis" +require "erb" require "fileutils" require "pathname" @@ -20,7 +20,7 @@ module ARTest FileUtils.cp TEST_ROOT + "/config.example.yml", config_file end - erb = Erubis::Eruby.new(config_file.read) + erb = ERB.new(config_file.read) expand_config(YAML.parse(erb.result(binding)).transform) end
Erubis is not actually used in AR
rails_rails
train
rb
4c89519af0ff207f0c77c3836ea6b89a2d40f18d
diff --git a/src/CollapsibleItem.js b/src/CollapsibleItem.js index <HASH>..<HASH> 100644 --- a/src/CollapsibleItem.js +++ b/src/CollapsibleItem.js @@ -1,4 +1,5 @@ import React, { Component, PropTypes } from 'react'; +import ReactDOM from 'react-dom'; import cx from 'classnames'; import Icon from './Icon'; @@ -14,6 +15,14 @@ class CollapsibleItem extends Component { this.renderIcon = this.renderIcon.bind(this); } + componentDidUpdate () { + const { scroll, expanded } = this.props; + + if (expanded) { + ReactDOM.findDOMNode(this).scrollIntoView({ behavior: scroll }); + } + } + render () { const { node, @@ -92,7 +101,11 @@ CollapsibleItem.propTypes = { * The node type of the header * @default a */ - node: PropTypes.node + node: PropTypes.node, + /** + * The scroll behavior for scrollIntoView + */ + scroll: PropTypes.oneOf(['auto', 'instant', 'smooth']) }; CollapsibleItem.defaultProps = {
Implement auto scrolling on expand (#<I>)
react-materialize_react-materialize
train
js
0847ae6cdf5f75410b5d9018e75372b84abac69a
diff --git a/container_opts.go b/container_opts.go index <HASH>..<HASH> 100644 --- a/container_opts.go +++ b/container_opts.go @@ -150,18 +150,21 @@ func setSnapshotterIfEmpty(c *containers.Container) { // integration. // // Make sure to register the type of `extension` in the typeurl package via -// `typeurl.Register` otherwise the type data will be inferred, including how -// to encode and decode the object. +// `typeurl.Register` or container creation may fail. func WithContainerExtension(name string, extension interface{}) NewContainerOpts { return func(ctx context.Context, client *Client, c *containers.Container) error { + if name == "" { + return errors.Wrapf(errdefs.ErrInvalidArgument, "extension key must not be zero-length") + } + any, err := typeurl.MarshalAny(extension) if err != nil { - return err + if errors.Cause(err) == typeurl.ErrNotFound { + return errors.Wrapf(err, "extension %q is not registered with the typeurl package, see `typeurl.Register`", name) + } + return errors.Wrap(err, "error marshalling extension") } - if name == "" { - return errors.Wrapf(errdefs.ErrInvalidArgument, "extension key must not be zero-length") - } if c.Extensions == nil { c.Extensions = make(map[string]types.Any) }
Improve error message for `WithContainerExtension` The previous error messages are not very descriptive in how to fix the issue, especially since they come from container create and not when calling `WithContainerExtensions`.
containerd_containerd
train
go
13637d96da4740d8d915927203d930b705d774ed
diff --git a/satpy/tests/writer_tests/test_ninjotiff.py b/satpy/tests/writer_tests/test_ninjotiff.py index <HASH>..<HASH> 100644 --- a/satpy/tests/writer_tests/test_ninjotiff.py +++ b/satpy/tests/writer_tests/test_ninjotiff.py @@ -112,6 +112,8 @@ class TestNinjoTIFFWriter(unittest.TestCase): np.testing.assert_array_almost_equal(ds_in + 273.15, ds_out) assert ds_in.attrs != ds_out.attrs assert ds_out.attrs["units"] == out_unit + # test that keys aren't lost + assert ds_out.attrs.keys() - {"units"} == ds_in.attrs.keys() def test_convert_units_other(self): """Test that other unit conversions are not implemented."""
Test that keys aren't lost Test that no keys are lost from attributes when converting units.
pytroll_satpy
train
py
3fb31f651da4514862192c9278f7c80b4fe7edab
diff --git a/java/src/main/java/org/msgpack/template/builder/BeansTemplateBuilder.java b/java/src/main/java/org/msgpack/template/builder/BeansTemplateBuilder.java index <HASH>..<HASH> 100644 --- a/java/src/main/java/org/msgpack/template/builder/BeansTemplateBuilder.java +++ b/java/src/main/java/org/msgpack/template/builder/BeansTemplateBuilder.java @@ -153,7 +153,7 @@ public class BeansTemplateBuilder extends CustomTemplateBuilder{ } pk.packNil(); } else { - pk.pack(obj); + e.pack(obj, pk); } }
scala: fixed bug within reflection-based beans template builder
msgpack_msgpack-ruby
train
java
4f0b5f7b32ce72fe2fd1ef39279210ce608b6fc1
diff --git a/lib/credentials_manager/appfile_config.rb b/lib/credentials_manager/appfile_config.rb index <HASH>..<HASH> 100644 --- a/lib/credentials_manager/appfile_config.rb +++ b/lib/credentials_manager/appfile_config.rb @@ -25,6 +25,13 @@ module CredentialsManager Dir.chdir(File.expand_path('..', path)) do eval(File.read(full_path)) end + + # If necessary override per lane configuration + blocks[ENV["FASTLANE_LANE_NAME"].to_sym].call if blocks[ENV["FASTLANE_LANE_NAME"].to_sym] + end + + def blocks + @blocks ||= {} end def data @@ -55,13 +62,14 @@ module CredentialsManager # Override Appfile configuration for a specific lane. # - # lane_name - String containing name for a lane. + # lane_name - Symbol representing a lane name. # block - Block to execute to override configuration values. # - # Discussion If received lane name does not match the lane name available as environment variable, this method - # does nothing. + # Discussion If received lane name does not match the lane name available as environment variable, no changes will + # be applied. def for_lane(lane_name, &block) - block.call if lane_name.to_s == ENV["FASTLANE_LANE_NAME"] # If necessary, override the specified configurations. + raise "Configuration for lane '#{lane_name}' was defined multiple times!".red if blocks[lane_name] + blocks[lane_name] = block end end end \ No newline at end of file
Made Appfile per lane configuration parsing more robust Improved Appfile parsing such that any `for_lane` block could be specified everywhere in the Appfile.
fastlane_fastlane
train
rb
fb29076aa8b6c5537504f7ea075ad34da30b25b4
diff --git a/examples/init.php b/examples/init.php index <HASH>..<HASH> 100644 --- a/examples/init.php +++ b/examples/init.php @@ -13,7 +13,7 @@ $traceFunc = function($type, $data) { /* set up connection options */ $connectionOptions = array( ConnectionOptions::OPTION_ENDPOINT => 'tcp://localhost:8529', // endpoint to connect to - ConnectionOptions::OPTION_CONNECTION => 'Close', // can use either 'Close' (one-time connections) or 'Keep-Alive' (re-used connections) + ConnectionOptions::OPTION_CONNECTION => 'Keep-Alive', // can use either 'Close' (one-time connections) or 'Keep-Alive' (re-used connections) ConnectionOptions::OPTION_AUTH_TYPE => 'Basic', // use basic authorization /* ConnectionOptions::OPTION_AUTH_USER => '', // user for basic authorization
set example connection type to 'Keep-Alive' instead of 'Close'
arangodb_arangodb-php
train
php
ca466e695a6a40a4296f6402e189665fca3a1edb
diff --git a/lib/active_scaffold/finder.rb b/lib/active_scaffold/finder.rb index <HASH>..<HASH> 100644 --- a/lib/active_scaffold/finder.rb +++ b/lib/active_scaffold/finder.rb @@ -160,6 +160,9 @@ module ActiveScaffold end format += ' %z' if parts[:offset].present? && format !~ /%z/i end + if !parts[:year] && !parts[:month] && !parts[:mday] + value = "#{Date.today.strftime(format.gsub(/%[HI].*/, ''))} #{value}" + end value = translate_days_and_months(value, format) if I18n.locale != :en time = DateTime.strptime(value, format) rescue nil if time
parse datetime defaults to today when date is missing
activescaffold_active_scaffold
train
rb
4831034c0be47fd0979ce43b186173bcb6b2011d
diff --git a/redis/client.py b/redis/client.py index <HASH>..<HASH> 100755 --- a/redis/client.py +++ b/redis/client.py @@ -950,6 +950,7 @@ class Redis(RedisModuleCommands, CoreCommands, SentinelCommands): "ssl_ca_certs": ssl_ca_certs, "ssl_check_hostname": ssl_check_hostname, "ssl_password": ssl_password, + "ssl_ca_path": ssl_ca_path, } ) connection_pool = ConnectionPool(**kwargs)
Allow ssl_ca_path with rediss:// urls (#<I>)
andymccurdy_redis-py
train
py
08e21dafb4ac6730db3a6b5bf515aea0cab5de25
diff --git a/h2o-perf/bench/py/h2oPerf/Runner.py b/h2o-perf/bench/py/h2oPerf/Runner.py index <HASH>..<HASH> 100644 --- a/h2o-perf/bench/py/h2oPerf/Runner.py +++ b/h2o-perf/bench/py/h2oPerf/Runner.py @@ -136,6 +136,7 @@ class PerfRunner: test.test_run.row["contamination_message"] = contamination[1] test.test_run.update(True) self.stop_sys_profiling(ssh_ch) + ssh_ch = None PerfUtils.stop_cloud(self, test.remote_hosts) self.cloud.pop(0) self.perfdb.this_test_run_id += 1 @@ -168,7 +169,7 @@ class PerfRunner: return ssh def stop_sys_profiling(self, ssh): - #ch.exec_command('exit') + ssh.exec_command('exit') ssh.close() def __get_instance_type__(self):
fix timeout issue by not closing the ssh session
h2oai_h2o-2
train
py
56f8bfc5416778805cc342532ff65490e87b250e
diff --git a/examples/upload.rb b/examples/upload.rb index <HASH>..<HASH> 100644 --- a/examples/upload.rb +++ b/examples/upload.rb @@ -6,7 +6,7 @@ require 'flickraw' API_KEY='' SHARED_SECRET='' ACCESS_TOKEN='' -ACCESS _SECRET='' +ACCESS_SECRET='' PHOTO_PATH='photo.jpg' FlickRaw.api_key = API_KEY
Update examples/upload.rb
hanklords_flickraw
train
rb
9bde8a22e1e027b8f856770c167a2d9f0204f845
diff --git a/server/server.go b/server/server.go index <HASH>..<HASH> 100644 --- a/server/server.go +++ b/server/server.go @@ -438,7 +438,7 @@ func RunServerWithOpts(stanOpts *Options, natsOpts *server.Options) *StanServer s.store.Close() } // Issue the original panic now that the store is closed. - panic(r.(error)) + panic(r) } }()
Fix recover when starting server When propagating the recovered error, do not assume we are dealing with an error, it could be a string.
nats-io_nats-streaming-server
train
go
8a113305ecd4f3479466a3599e57ca7e066eb28f
diff --git a/src/main/java/com/github/davidmoten/rx2/internal/flowable/FlowableStringSplitSimple.java b/src/main/java/com/github/davidmoten/rx2/internal/flowable/FlowableStringSplitSimple.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/davidmoten/rx2/internal/flowable/FlowableStringSplitSimple.java +++ b/src/main/java/com/github/davidmoten/rx2/internal/flowable/FlowableStringSplitSimple.java @@ -152,7 +152,7 @@ public final class FlowableStringSplitSimple extends Flowable<String> { } } if (e > 0) { - r = BackpressureHelper.produced(this, e); + BackpressureHelper.produced(this, e); } missed = wip.addAndGet(-missed); if (missed == 0) {
minor simplification in FlowableStringSplitSimple
davidmoten_rxjava2-extras
train
java
63b9e9261fe2ed8527b9957d1f519a52e66807f9
diff --git a/libraries/botbuilder-dialogs/botbuilder/dialogs/choices/channel.py b/libraries/botbuilder-dialogs/botbuilder/dialogs/choices/channel.py index <HASH>..<HASH> 100644 --- a/libraries/botbuilder-dialogs/botbuilder/dialogs/choices/channel.py +++ b/libraries/botbuilder-dialogs/botbuilder/dialogs/choices/channel.py @@ -61,6 +61,7 @@ class Channel: Channels.ms_teams: 3, Channels.line: 99, Channels.slack: 100, + Channels.telegram: 100, Channels.emulator: 100, Channels.direct_line: 100, Channels.webchat: 100,
[PORT] Update channel.py to make it clear that Telegram supports card actions (#<I>) Port of <URL>
Microsoft_botbuilder-python
train
py
17c47df0f69e6f6a93767cee307d3791165b4821
diff --git a/lib/aptly/version.rb b/lib/aptly/version.rb index <HASH>..<HASH> 100644 --- a/lib/aptly/version.rb +++ b/lib/aptly/version.rb @@ -1,4 +1,4 @@ # Aptly API module Aptly - VERSION = '0.6.0'.freeze + VERSION = '0.6.1'.freeze end
version bump to <I> for bugfix release
KDEJewellers_aptly-api
train
rb
4aa2f3e986e858a36a5774062d7b13caaa6e881e
diff --git a/bika/lims/browser/fields/aranalysesfield.py b/bika/lims/browser/fields/aranalysesfield.py index <HASH>..<HASH> 100644 --- a/bika/lims/browser/fields/aranalysesfield.py +++ b/bika/lims/browser/fields/aranalysesfield.py @@ -195,11 +195,15 @@ class ARAnalysesField(ObjectField): # Unset the partition reference part = analysis.getSamplePartition() - an_uid = api.get_uid(analysis) - part_ans = part.getAnalyses() or [] - part_ans = filter(lambda an: api.get_uid(an) != an_uid, part_ans) - # Unset the Partition-to-Analysis reference - part.setAnalyses(part_ans) + if part: + # From this partition, remove the reference to the current + # analysis that is going to be removed to prevent inconsistent + # states (Sample Partitions referencing to Analyses that do not + # exist anymore + an_uid = api.get_uid(analysis) + part_ans = part.getAnalyses() or [] + part_ans = filter(lambda an: api.get_uid(an) != an_uid, part_ans) + part.setAnalyses(part_ans) # Unset the Analysis-to-Partition reference analysis.setSamplePartition(None) delete_ids.append(analysis.getId())
Check if the analysis has a partition assigned before removing refs (#<I>) At this point, might happen the analysis to be removed does not have does not have a partition assigned already, precisely because of the inherent recursive behavior caused by lines L<I> + L<I>. Even though, this is temporary and will only happen during the process of assigning/unassigning analyses here inside this set func.
senaite_senaite.core
train
py
520cfeb5345f4230a1611b9b1c7708c2b1d8353e
diff --git a/modules/selenium/src/main/java/org/testcontainers/containers/BrowserWebDriverContainer.java b/modules/selenium/src/main/java/org/testcontainers/containers/BrowserWebDriverContainer.java index <HASH>..<HASH> 100644 --- a/modules/selenium/src/main/java/org/testcontainers/containers/BrowserWebDriverContainer.java +++ b/modules/selenium/src/main/java/org/testcontainers/containers/BrowserWebDriverContainer.java @@ -166,6 +166,13 @@ public class BrowserWebDriverContainer<SELF extends BrowserWebDriverContainer<SE } } + // Hack for new selenium-chrome image that contains Chrome 92. + // If not disabled, container startup will fail in most cases and consume excessive amounts of CPU. + if (capabilities instanceof ChromeOptions) { + ChromeOptions options = (ChromeOptions) this.capabilities; + options.addArguments("--disable-gpu"); + } + if (recordingMode != VncRecordingMode.SKIP) { if (vncRecordingDirectory == null) {
Disable Chrome's GPU support in `BrowserWebDriverContainer` (#<I>) * Trigger selenium build on CI * Try again to trigger build * Apply potential fix by disabling GPU * Also --disable-dev-shm-usage * Alwas add disable-gpu flag * Smaller check for hack * Smaller check for hack
testcontainers_testcontainers-java
train
java
2ae9cb604ab98657071ee23c50576c012fdc53ab
diff --git a/lib/fastlane/actions_list.rb b/lib/fastlane/actions_list.rb index <HASH>..<HASH> 100644 --- a/lib/fastlane/actions_list.rb +++ b/lib/fastlane/actions_list.rb @@ -11,8 +11,13 @@ module Fastlane all_actions do |action, name| output = [] rows << [name.yellow] - if action.description - rows.last << action.description + + if action < Action + if action.description + rows.last << action.description + end + else + Helper.log.error "Please update your action file #{name} to be a subclass of `Action` by adding ` < Action` after your class name.".red end end
Added support for old Action format with output how to update class
fastlane_fastlane
train
rb
1b07083e935974df020c89e02017d2b52e183489
diff --git a/api/src/main/java/org/jboss/shrinkwrap/api/importer/ZipImporter.java b/api/src/main/java/org/jboss/shrinkwrap/api/importer/ZipImporter.java index <HASH>..<HASH> 100644 --- a/api/src/main/java/org/jboss/shrinkwrap/api/importer/ZipImporter.java +++ b/api/src/main/java/org/jboss/shrinkwrap/api/importer/ZipImporter.java @@ -40,7 +40,7 @@ public interface ZipImporter extends Specializer * @return Archive of the imported Zip * @throws ArchiveImporterException if IOException during import */ - public ZipImporter importZip(ZipInputStream stream) throws ArchiveImporterException; + ZipImporter importZip(ZipInputStream stream) throws ArchiveImporterException; /** * Imports provided {@link ZipInputStream} as a {@link Archive}. @@ -49,5 +49,5 @@ public interface ZipImporter extends Specializer * @return Archive of the imported Zip * @throws ArchiveImporterException if IOException during import */ - public ZipImporter importZip(ZipFile file) throws ArchiveImporterException; + ZipImporter importZip(ZipFile file) throws ArchiveImporterException; }
SHRINKWRAP-7 Removed public keyword from interface
shrinkwrap_shrinkwrap
train
java
b2cac3a2a3dbc2bf0206f9fcdd8bc7ccc95a9486
diff --git a/flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java b/flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java index <HASH>..<HASH> 100644 --- a/flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java +++ b/flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java @@ -493,7 +493,7 @@ public abstract class FileSystem { * * @param f * given path - * @return the statuses of the files/directories in the given patch + * @return the statuses of the files/directories in the given path * @throws IOException */ public abstract FileStatus[] listStatus(Path f) throws IOException;
[hotfix] [Javadoc] Fix typo in Javadoc for class FileSystem This closes #<I>.
apache_flink
train
java
74652c2bbff5cac534433678b98f6e2e24c92cea
diff --git a/examples/utils_example.py b/examples/utils_example.py index <HASH>..<HASH> 100644 --- a/examples/utils_example.py +++ b/examples/utils_example.py @@ -25,8 +25,10 @@ fn_output = sys.argv[3] ### Read images and annotation ### ################################## img = cv2.imread(fn_im) -labels = relabel_sequential(cv2.imread(fn_anno, 0))[0].flatten() -M = 21 # 21 Classes to match the C++ example +labels, _, _ = relabel_sequential(cv2.imread(fn_anno, 0)) + +# Compute the number of classes in the label image +M = len(set(labels.flat)) ########################### ### Setup the CRF model ###
Utils example computes number of labels. Fixes #<I> continuation.
lucasb-eyer_pydensecrf
train
py
67fb816506895fed3b1586450e96ffbb4597d75f
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -471,6 +471,9 @@ function $extend(obj, cn, db, options) { } return $sequence(tx, factory); }, + queue: function (factory) { + return this.sequence(factory); + }, ctx: txDB.ctx }; $extend(tx, null, txDB, options); // extending for an existing connection;
added method queue to transactions as alias to sequence.
vitaly-t_pg-promise
train
js
0bafff47367768f6f755402ffa4320980248cfd0
diff --git a/test/dummy/config/environments/test.rb b/test/dummy/config/environments/test.rb index <HASH>..<HASH> 100644 --- a/test/dummy/config/environments/test.rb +++ b/test/dummy/config/environments/test.rb @@ -12,10 +12,10 @@ Dummy::Application.configure do config.static_cache_control = "public, max-age=3600" # Don't fallback to assets pipeline if a precompiled asset is missed - config.assets.compile = false + #config.assets.compile = false # Generate digests for assets URLs - config.assets.digest = true + #config.assets.digest = true # Log error messages when you accidentally call methods on nil config.whiny_nils = true
Compile assets in test env
NCSU-Libraries_lentil
train
rb
19c284d06330f1c4e4fd05a207d3b5a5f25a0b3e
diff --git a/source/reduceBy.js b/source/reduceBy.js index <HASH>..<HASH> 100644 --- a/source/reduceBy.js +++ b/source/reduceBy.js @@ -30,7 +30,7 @@ import _xreduceBy from './internal/_xreduceBy'; * @example * * const groupNames = (acc, student) => acc.concat(student.name) - * const toGrade = (student, score = student.score) => + * const toGrade = ({score}) => * score < 65 ? 'F' : * score < 70 ? 'D' : * score < 80 ? 'C' :
Using destructuring rather than default param
ramda_ramda
train
js
f18fb19b242e38c6e875c53b5991be69c0bd48a2
diff --git a/config.sample.php b/config.sample.php index <HASH>..<HASH> 100644 --- a/config.sample.php +++ b/config.sample.php @@ -1,5 +1,7 @@ <?php +use Phergie\Irc\Bot\React\Connection; + return array( // Plugins to include for all connections, where any connection-specific @@ -9,19 +11,15 @@ return array( 'plugins' => array( - 'plugin-key' => array( - - // ... - - ), + // 'plugin-key' => new \Vendor\Plugin\PluginName(array( + // /* configuration goes here */ + // )), ), 'connections' => array( - // One array for each connection here - - array( + new Connection(array( // Required settings @@ -51,7 +49,7 @@ return array( // ... ), - ), + )), )
Updated config.sample.php to use objects for connections and plugins
phergie_phergie-irc-bot-react
train
php
21c43348d6b2d50580ea6e8898ba138a4d4f3762
diff --git a/tests/BreadcrumbTest.php b/tests/BreadcrumbTest.php index <HASH>..<HASH> 100644 --- a/tests/BreadcrumbTest.php +++ b/tests/BreadcrumbTest.php @@ -2,6 +2,8 @@ class BreadcrumbTest extends PHPUnit_Framework_TestCase { + + /** @var \Noherczeg\Breadcrumb\Breadcrumb */ private $bread = null; /**
added type hint for better IDE support
noherczeg_breadcrumb
train
php
679d4d1039edcabd11ed154918418e6f85c9a37b
diff --git a/js/ui/SelectionView.js b/js/ui/SelectionView.js index <HASH>..<HASH> 100644 --- a/js/ui/SelectionView.js +++ b/js/ui/SelectionView.js @@ -9,6 +9,7 @@ define( selectedItem: null, needsSelection: false, items: [], + keyPath: null, forceSelectable: true, allowDeselection: false },
added keyPath to defaults of SelectionView
rappid_rAppid.js
train
js
335fefc4bb4f3391e6009e06b670dca6cfb5c381
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -58,6 +58,22 @@ NanoIterator.prototype._next = function (cb) { cb(new Error('_next is not implemented')) } +if (typeof Symbol !== 'undefined' && Symbol.asyncIterator) { + NanoIterator.prototype[Symbol.asyncIterator] = function () { + var self = this + return {next: nextPromise} + + function nextPromise () { + return new Promise(function (resolve, reject) { + self.next(function (err, val) { + if (err) return reject(err) + resolve({value: val, done: val === null}) + }) + }) + } + } +} + function noop () {} function openDone (self, err) {
support async iterators when avail (#2)
mafintosh_nanoiterator
train
js
9ede0af051a34374af75f6a3bcaedc61cac90fb6
diff --git a/lib/crc32.js b/lib/crc32.js index <HASH>..<HASH> 100644 --- a/lib/crc32.js +++ b/lib/crc32.js @@ -1,3 +1,5 @@ +'use strict' + var stream = require( 'stream' ) /**
fix(lib): Node v4 block-scoped declarations
jhermsmeier_node-cyclic-32
train
js
73457947fb442fc54e2b33ad22ba2d4746aca79a
diff --git a/nodejs/node_send.js b/nodejs/node_send.js index <HASH>..<HASH> 100644 --- a/nodejs/node_send.js +++ b/nodejs/node_send.js @@ -6,20 +6,20 @@ var api = new reachmail({token: 'YoUrSeCr3tTokenG03sH3rE'}); //The following builds the content of the message var body={ - FromAddress: '[email protected]', + FromAddress: '[email protected]', Recipients: [ { - Address: '[email protected]' + Address: '[email protected]' }, { - Address: '[email protected]' + Address: '[email protected]' } ], Headers: { Subject: 'Test Subject Goes Here' , - From: 'ReachMail Billing <[email protected]>', + From: 'From Name <[email protected]>', 'X-Company': 'Company Name', - 'X-Location': 'Chicago' + 'X-Location': 'Your Location Header' }, BodyText: 'this is the text version of the ES API test', BodyHtml: 'this is the <a href=\"http://www.google.com\">HTML</a> version of the ES API test',
updated addrs Removed email addresses from example.
ReachmailInc_WebAPISamples
train
js
c56a9807d4bb95e0e7280476e8f4607bc62b1e4f
diff --git a/extensions-core/kafka-indexing-service/src/main/java/io/druid/indexing/kafka/supervisor/KafkaSupervisor.java b/extensions-core/kafka-indexing-service/src/main/java/io/druid/indexing/kafka/supervisor/KafkaSupervisor.java index <HASH>..<HASH> 100644 --- a/extensions-core/kafka-indexing-service/src/main/java/io/druid/indexing/kafka/supervisor/KafkaSupervisor.java +++ b/extensions-core/kafka-indexing-service/src/main/java/io/druid/indexing/kafka/supervisor/KafkaSupervisor.java @@ -2117,7 +2117,7 @@ public class KafkaSupervisor implements Supervisor && latestOffsetsFromKafka.get(e.getKey()) != null && e.getValue() != null ? latestOffsetsFromKafka.get(e.getKey()) - e.getValue() - : null + : Integer.MIN_VALUE ) ); }
prevent npe on mismatch between number of kafka partitions and task count (#<I>)
apache_incubator-druid
train
java
b9371a6ca4b756c4b4266a08336e80f715b66ad3
diff --git a/src/fx.js b/src/fx.js index <HASH>..<HASH> 100644 --- a/src/fx.js +++ b/src/fx.js @@ -222,6 +222,7 @@ jQuery.extend({ }, timers: [], + timerId: null, fx: function( elem, options, prop ){ this.options = options; @@ -276,16 +277,18 @@ jQuery.fx.prototype = { jQuery.timers.push(t); - if ( jQuery.timers.length == 1 ) { - var timer = setInterval(function(){ + if ( jQuery.timerId == null ) { + jQuery.timerId = setInterval(function(){ var timers = jQuery.timers; for ( var i = 0; i < timers.length; i++ ) if ( !timers[i]() ) timers.splice(i--, 1); - if ( !timers.length ) - clearInterval( timer ); + if ( !timers.length ) { + clearInterval( jQuery.timerId ); + jQuery.timerId = null; + } }, 13); } },
Fix #<I> bug where extra setInterval()s can be called during animation.
jquery_jquery
train
js
2dda905c1b59b91fb6f14eab54ca4dda3e89bb1f
diff --git a/address.js b/address.js index <HASH>..<HASH> 100644 --- a/address.js +++ b/address.js @@ -11,6 +11,13 @@ var qchar = /([^a-zA-Z0-9!#\$\%\&\x27\*\+\x2D\/=\?\^_`{\|}~.])/; function Address (user, host) { + if (typeof user == 'object' && user.original) { + // Assume reconstructing from JSON parse + for (var k in user) { + this[k] = user[k]; + } + return this; + } var match = /^<(.*)>$/.exec(user); if (match) { this.original = user; diff --git a/outbound.js b/outbound.js index <HASH>..<HASH> 100644 --- a/outbound.js +++ b/outbound.js @@ -917,9 +917,9 @@ HMailItem.prototype.try_deliver_host = function (mx) { var command = mx.using_lmtp ? 'connectlmtp' : 'connect'; var response = []; - var recipients = this.todo.rcpt_to.map(function (a) { return new Address (a.original) }); + var recipients = this.todo.rcpt_to.map(function (a) { return new Address (a) }); - var mail_from = new Address (this.todo.mail_from.original); + var mail_from = new Address (this.todo.mail_from); var data_marker = 0; var last_recip = null;
Reconstruct Address objects without parsing
haraka_Haraka
train
js,js
ca385510f0d2ba56902b0d171dcbe5ba9d086eee
diff --git a/src/Symfony/Component/Cache/Traits/MemcachedTrait.php b/src/Symfony/Component/Cache/Traits/MemcachedTrait.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Cache/Traits/MemcachedTrait.php +++ b/src/Symfony/Component/Cache/Traits/MemcachedTrait.php @@ -73,11 +73,11 @@ trait MemcachedTrait } elseif (!is_array($servers)) { throw new InvalidArgumentException(sprintf('MemcachedAdapter::createClient() expects array or string as first argument, %s given.', gettype($servers))); } + if (!static::isSupported()) { + throw new CacheException('Memcached >= 2.2.0 is required'); + } set_error_handler(function ($type, $msg, $file, $line) { throw new \ErrorException($msg, 0, $type, $file, $line); }); try { - if (!static::isSupported()) { - throw new trigger_error('Memcached >= 2.2.0 is required'); - } $options += static::$defaultClientOptions; $client = new \Memcached($options['persistent_id']); $username = $options['username'];
[Cache] Fix trigger_error
symfony_symfony
train
php
7fccc89460789b5aa227ffc212a09f308a35dec1
diff --git a/lib/terror.js b/lib/terror.js index <HASH>..<HASH> 100644 --- a/lib/terror.js +++ b/lib/terror.js @@ -110,13 +110,8 @@ Terror.extendCodes = function(codes) { Object.keys(codes).forEach(function(code) { if (_has(ctor.CODES, code)) { - throw new Error([ - 'Terror codes collision detected in the ', - ctor.prototype.name, - '.extendCodes call for code "', - code, - '"' - ].join('')); + throw new Error('Terror codes collision detected in the ' + + ctor.prototype.name + '.extendCodes call for code "' + code + '"'); } ctor.CODES[code] = code;
replace strings array join with direct strings concat
nodules_terror
train
js
4016e382b8ee40aecf24f5344eb27c91841049a9
diff --git a/lib/arjdbc/sqlite3/adapter.rb b/lib/arjdbc/sqlite3/adapter.rb index <HASH>..<HASH> 100644 --- a/lib/arjdbc/sqlite3/adapter.rb +++ b/lib/arjdbc/sqlite3/adapter.rb @@ -148,12 +148,6 @@ module ArJdbc sqlite_version >= '3.8.0' end - - # @override - def supports_count_distinct? - true - end - # @override def supports_autoincrement? true
Remove unused supports_count_distinct?
jruby_activerecord-jdbc-adapter
train
rb
f8e5288954700e0eed87b3e08e12fb6dcce52368
diff --git a/commonjs.js b/commonjs.js index <HASH>..<HASH> 100644 --- a/commonjs.js +++ b/commonjs.js @@ -24,7 +24,7 @@ this.aliases = {}; }; - CommonJSServer.__prototype__ = function() { + CommonJSServer.Prototype = function() { var REQ_STMT = /^require\s*\([^(]*?\)/; function _prepareSource(source, nodes) { @@ -155,7 +155,7 @@ } }; }; - CommonJSServer.prototype = new CommonJSServer.__prototype__(); + CommonJSServer.prototype = new CommonJSServer.Prototype(); module.exports = CommonJSServer;
rename: __prototype__ => Prototype
substance_application
train
js
2f632330d2aa89dc435f6271f62c1770588d9641
diff --git a/src/jquery.fancytree.edit.js b/src/jquery.fancytree.edit.js index <HASH>..<HASH> 100644 --- a/src/jquery.fancytree.edit.js +++ b/src/jquery.fancytree.edit.js @@ -117,6 +117,7 @@ $.ui.fancytree._FancytreeNodeClass.prototype.editStart = function(){ node.editEnd(true, event); return false; // so we don't start editmode on Mac } + event.stopPropagation(); }).blur(function(event){ return node.editEnd(true, event); });
Update jquery.fancytree.edit.js While node is in edit mode, typing the "Del" key during edit will cause the row to be deleted by the tree. This edit swallows keydown events inside the input control and does not allow them to propagate to parent elements.
mar10_fancytree
train
js
4cf683101c36426dc975f4db4d7f01d9c071f31a
diff --git a/integration/integration_suite_test.go b/integration/integration_suite_test.go index <HASH>..<HASH> 100644 --- a/integration/integration_suite_test.go +++ b/integration/integration_suite_test.go @@ -19,7 +19,7 @@ var tmpDir string var pathToGinkgo string func TestIntegration(t *testing.T) { - SetDefaultEventuallyTimeout(10 * time.Second) + SetDefaultEventuallyTimeout(15 * time.Second) RegisterFailHandler(Fail) RunSpecs(t, "Integration Suite") }
bump integration test timeout for travis
onsi_ginkgo
train
go
411f84ace750f584dc494a32c9369cefc180ce35
diff --git a/lxd/storage_zfs.go b/lxd/storage_zfs.go index <HASH>..<HASH> 100644 --- a/lxd/storage_zfs.go +++ b/lxd/storage_zfs.go @@ -5,6 +5,7 @@ import ( "os" "os/exec" "strings" + "time" "github.com/gorilla/websocket" @@ -664,11 +665,21 @@ func (s *storageZfs) zfsDestroy(path string) error { } } - output, err := exec.Command( - "zfs", - "destroy", - "-r", - fmt.Sprintf("%s/%s", s.zfsPool, path)).CombinedOutput() + // Due to open fds or kernel refs, this may fail for a bit, give it 5s + var output []byte + for i := 0; i < 10; i++ { + output, err = exec.Command( + "zfs", + "destroy", + "-r", + fmt.Sprintf("%s/%s", s.zfsPool, path)).CombinedOutput() + + if err == nil { + break + } + time.Sleep(500 * time.Millisecond) + } + if err != nil { s.log.Error("zfs destroy failed", log.Ctx{"output": string(output)}) return err
Workaround zfs lock on destroy
lxc_lxd
train
go
8b094d37be3cee955da29302f3d7bea700cfb17b
diff --git a/pylint/test/functional/unsubscriptable_value.py b/pylint/test/functional/unsubscriptable_value.py index <HASH>..<HASH> 100644 --- a/pylint/test/functional/unsubscriptable_value.py +++ b/pylint/test/functional/unsubscriptable_value.py @@ -82,3 +82,9 @@ def test(*args, **kwargs): test()[0] test[0] # [unsubscriptable-object] + +# deque +from collections import deque +deq = deque(maxlen=10) +deq.append(42) +deq[0]
Add test for deques to `unsubscriptable-object` functional tests
PyCQA_pylint
train
py
079528e66e5e95d9eee4d4c702360464afc9e7fb
diff --git a/src/main/java/org/jboss/pressgang/ccms/model/TranslatedTopicData.java b/src/main/java/org/jboss/pressgang/ccms/model/TranslatedTopicData.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jboss/pressgang/ccms/model/TranslatedTopicData.java +++ b/src/main/java/org/jboss/pressgang/ccms/model/TranslatedTopicData.java @@ -314,4 +314,16 @@ public class TranslatedTopicData extends AuditedEntity implements java.io.Serial return false; } + + @Transient + public void addTranslatedTopicString(final TranslatedTopicString translatedTopicString) { + getTranslatedTopicStrings().add(translatedTopicString); + translatedTopicString.setTranslatedTopicData(this); + } + + @Transient + public void removeTranslatedTopicString(final TranslatedTopicString translatedTopicString) { + getTranslatedTopicStrings().remove(translatedTopicString); + translatedTopicString.setTranslatedTopicData(null); + } }
Added helper methods for adding and removing TranslatedTopicStrings
pressgang-ccms_PressGangCCMSModel
train
java
581ddafd7df12e71d6675534eeaa8077bccfaed9
diff --git a/src/Analyzers/HeaderAnalyzer.php b/src/Analyzers/HeaderAnalyzer.php index <HASH>..<HASH> 100644 --- a/src/Analyzers/HeaderAnalyzer.php +++ b/src/Analyzers/HeaderAnalyzer.php @@ -94,7 +94,7 @@ class HeaderAnalyzer extends Analyzer // TODO what are these? // Something is up here because we do `+=46` just below which makes for `+=58` anyway. // For some reason PHP runs out of memory if I do it differently… - if ($version->subVersion >= 12.49) { + if ($version->subVersion >= 12.50) { $this->position += 12; }
Fix crash on HD <I> records.
goto-bus-stop_recanalyst
train
php
a20060c7a5b58f430e8d23eb0b5d3c1cf76519e0
diff --git a/maintenance/BatchAntiSpoofClass.php b/maintenance/BatchAntiSpoofClass.php index <HASH>..<HASH> 100644 --- a/maintenance/BatchAntiSpoofClass.php +++ b/maintenance/BatchAntiSpoofClass.php @@ -40,6 +40,10 @@ class BatchAntiSpoof extends Maintenance { return new SpoofUser( $name ); } + protected function waitForSlaves() { + wfWaitForSlaves(); + } + /** * Do the actual work. All child classes will need to implement this */ @@ -63,7 +67,7 @@ class BatchAntiSpoof extends Maintenance { if ( $n % $batchSize == 0 ) { $this->batchRecord( $items ); $items = array(); - wfWaitForSlaves(); + $this->waitForSlaves(); } }
Allow subclasses of BatchAntiSpoof to override the wfWaitForSlaves() call So they can wait for a different database or cluster. Change-Id: I1e<I>af4d<I>e4a<I>cf7ba<I>aeb2ac<I>d9dd
wikimedia_mediawiki-extensions-AntiSpoof
train
php
3b0a25a21dfdaec9dfd837fe79af5cd9329b4d17
diff --git a/lib/opal/sprockets/processor.rb b/lib/opal/sprockets/processor.rb index <HASH>..<HASH> 100644 --- a/lib/opal/sprockets/processor.rb +++ b/lib/opal/sprockets/processor.rb @@ -12,15 +12,11 @@ module Opal # available to any sprockets based server. Processor will then get passed any # ruby source file to build. class Processor < TiltTemplate - class << self - attr_accessor :source_map_enabled - end - # DEPRECATED: # Support legacy accessors to default options, now moved to Opal::Config Opal::Config.default_config.keys.each do |config_option| - define_method(config_option) { Opal::Config.config[config_option] } - define_method("#{config_option}=") { |value| Opal::Config.config[config_option] = value } + define_singleton_method(config_option) { Opal::Config.config[config_option] } + define_singleton_method("#{config_option}=") { |value| Opal::Config.config[config_option] = value } end def evaluate(context, locals, &block)
Opal config proxies are not instance methods
opal_opal
train
rb
ffe03c2b9aa6f9c18d5621798f87e9c383e6bdb5
diff --git a/src/sad_spirit/pg_wrapper/types/PointList.php b/src/sad_spirit/pg_wrapper/types/PointList.php index <HASH>..<HASH> 100644 --- a/src/sad_spirit/pg_wrapper/types/PointList.php +++ b/src/sad_spirit/pg_wrapper/types/PointList.php @@ -87,6 +87,7 @@ abstract class PointList implements \ArrayAccess, \Countable, \IteratorAggregate /** * {@inheritDoc} + * @return \ArrayIterator<int, Point> */ public function getIterator(): \ArrayIterator {
Document types for \ArrayIterator, phpstan complains otherwise
sad-spirit_pg-wrapper
train
php
88b370f5c8242e295524cd1fc7b5a8af9c71346d
diff --git a/django_cron/tests.py b/django_cron/tests.py index <HASH>..<HASH> 100644 --- a/django_cron/tests.py +++ b/django_cron/tests.py @@ -3,7 +3,8 @@ from time import sleep from datetime import timedelta from django import db -from django.test import TestCase as BaseTestCase + +from django.test import TransactionTestCase from django.core.management import call_command from django.test.utils import override_settings from django.test.client import Client @@ -33,7 +34,7 @@ class OutBuffer(object): return self._str_cache -class TestCase(BaseTestCase): +class TestCase(TransactionTestCase): success_cron = 'test_crons.TestSucessCronJob' error_cron = 'test_crons.TestErrorCronJob'
use TransactionTestCase in tests
Tivix_django-cron
train
py
75f10c5ceb1cce52103db631c22cf0be0082201a
diff --git a/salt/modules/reg.py b/salt/modules/reg.py index <HASH>..<HASH> 100644 --- a/salt/modules/reg.py +++ b/salt/modules/reg.py @@ -598,7 +598,7 @@ def set_value(hive, local_key = _mbcs_to_unicode(key) local_vname = _mbcs_to_unicode(vname) local_vtype = _mbcs_to_unicode(vtype) - local_vdata = _mbcs_to_unicode_wrap(vdata, vtype) + local_vdata = _mbcs_to_unicode_wrap(vdata, local_vtype) except TypeError as exc: # pylint: disable=E0602 log.error(exc, exc_info=True) return False
Fixed instance of unicode/str comparison and made it unicode/unicode
saltstack_salt
train
py
656d26a91aeadafd69f128bd8629db5420eb19f7
diff --git a/steam/base.py b/steam/base.py index <HASH>..<HASH> 100644 --- a/steam/base.py +++ b/steam/base.py @@ -116,12 +116,12 @@ class http_request(object): else: try: req = urllib2.urlopen(urllib2.Request(self._url, headers = head), timeout = self._timeout) + status_code = req.code + body = req.read() except urllib2.URLError: raise HttpError("Server connection failed") except timeout: raise HttpTimeout("Server took too long to respond") - status_code = req.code - body = req.read() lm = req.headers.get("last-modified")
Catch HTTP errors in read and not just connection
Lagg_steamodd
train
py
2fa8aea27987db2669a37b776e39342433282b87
diff --git a/lib/filestorage/stored_file.php b/lib/filestorage/stored_file.php index <HASH>..<HASH> 100644 --- a/lib/filestorage/stored_file.php +++ b/lib/filestorage/stored_file.php @@ -196,12 +196,19 @@ class stored_file { } /** - * Delete file reference + * Unlink the stored file from the referenced file * + * This methods destroys the link to the record in files_reference table. This effectively + * turns the stored file from being an alias to a plain copy. However, the caller has + * to make sure that the actual file's content has beed synced prior to calling this method. */ public function delete_reference() { global $DB; + if (!$this->is_external_file()) { + throw new coding_exception('An attempt to unlink a non-reference file.'); + } + // Remove repository info. $this->repository = null;
MDL-<I> Throw coding exception when trying to unlink a non-reference file
moodle_moodle
train
php
0697aaa7f11e64258934300e4c5f305c8101230b
diff --git a/lib/Gen.php b/lib/Gen.php index <HASH>..<HASH> 100644 --- a/lib/Gen.php +++ b/lib/Gen.php @@ -67,6 +67,14 @@ class Gen { public function build($src, $destination) { + $data = []; + + if (file_exists($src . '/global.php')) { + $data = (array) include $src . '/global.php'; + } else { + $data = []; + } + require dirname(__FILE__) . '/../vendor/autoload.php'; if (!is_dir($destination)) { @@ -90,9 +98,7 @@ class Gen { $phpFile = $entry['path'] . '/' . $this->replaceExtension($entry['file'], 'php'); if (file_exists($phpFile)) { - $data = (array) include $phpFile; - } else { - $data = []; + $data = array_merge($data, (array) include $phpFile); } if (!is_dir($path)) {
Added the ability to iject data from a global.php file.
trq_Gen
train
php
94a67a546ab6f3ec266e296839b85a4163756b05
diff --git a/test/system/bootcode-dependencies.test.js b/test/system/bootcode-dependencies.test.js index <HASH>..<HASH> 100644 --- a/test/system/bootcode-dependencies.test.js +++ b/test/system/bootcode-dependencies.test.js @@ -19,7 +19,6 @@ describe('bootcode dependencies', function () { it('should not change', function () { expect(currentDependencies).to.be.eql([ - '8fold-marked', 'array-uniq', 'assert', 'assertion-error', @@ -72,6 +71,7 @@ describe('bootcode dependencies', function () { 'lodash.reject', 'lodash.some', 'lodash3', + 'marked', 'mime-db', 'mime-format', 'mime-types',
Update bootcode dependencies test for 8fold-marked to marked update
postmanlabs_postman-sandbox
train
js
3d5649eaa2cfc0f86cba8adf0b4b8d2a8cb311e1
diff --git a/klab/bio/ligand.py b/klab/bio/ligand.py index <HASH>..<HASH> 100644 --- a/klab/bio/ligand.py +++ b/klab/bio/ligand.py @@ -537,9 +537,22 @@ class LigandMap(object): return lm + @staticmethod + def from_code_map(ligand_code_map): + lm = LigandMap() + for k, v in ligand_code_map.iteritems(): + lm.add_code_mapping(k, v) + return lm + + def add(self, from_pdb_code, from_pdb_residue_id, to_pdb_code, to_pdb_residue_id, strict = True): assert(from_pdb_residue_id not in self.mapping) self.mapping[from_pdb_residue_id] = LigandMap._MapPoint(from_pdb_code, from_pdb_residue_id, to_pdb_code, to_pdb_residue_id, strict = strict) + self.add_code_mapping(from_pdb_code, to_pdb_code) + + + def add_code_mapping(self, from_pdb_code, to_pdb_code): + '''Add a code mapping without a given instance.''' # Consistency check - make sure that we always map the same code e.g. 'LIG' to the same code e.g. 'GTP' if from_pdb_code in self.code_map:
Allowing the LigandMap object to function without instances to map.
Kortemme-Lab_klab
train
py
0829b2ec8d03afd33f3f7bad27271979ac122689
diff --git a/polyaxon_cli/cli/run.py b/polyaxon_cli/cli/run.py index <HASH>..<HASH> 100644 --- a/polyaxon_cli/cli/run.py +++ b/polyaxon_cli/cli/run.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function -import os import sys import click diff --git a/polyaxon_cli/main.py b/polyaxon_cli/main.py index <HASH>..<HASH> 100644 --- a/polyaxon_cli/main.py +++ b/polyaxon_cli/main.py @@ -67,7 +67,7 @@ def cli(context, verbose, offline): context.obj["offline"] = offline if offline: os.environ['POLYAXON_IS_OFFLINE'] = 'true' - settings.IS_OFFLINE = 'true' + settings.IS_OFFLINE = True if not (context.invoked_subcommand in non_check_cmds or offline): check_cli_version()
IS_OFFLINE is boolean, lint fix
polyaxon_polyaxon
train
py,py
d10cc32d6bbc756ed73e3e3fa3bbcf6c6f3c64d7
diff --git a/lib/travis/task.rb b/lib/travis/task.rb index <HASH>..<HASH> 100644 --- a/lib/travis/task.rb +++ b/lib/travis/task.rb @@ -15,7 +15,7 @@ module Travis extend Exceptions::Handling def run(queue, *args) - Travis::Async.run(self, :perform, { queue: queue, use: run_local? ? :threaded : :sidekiq }, *args) + Travis::Async.run(self, :perform, { queue: queue, use: run_local? ? :inline : :sidekiq }, *args) end def run_local?
use the :inline strategy for running tasks locally
travis-ci_travis-core
train
rb
fa485dd23b46539f7bfc5c1cdb9536d28b3d883a
diff --git a/lib/cfndsl/Metadata.rb b/lib/cfndsl/Metadata.rb index <HASH>..<HASH> 100644 --- a/lib/cfndsl/Metadata.rb +++ b/lib/cfndsl/Metadata.rb @@ -5,6 +5,18 @@ module CfnDsl class MetadataDefinition < JSONable ## # Handles Metadata objects + def initialize(value) + @value = value; + end + + def value + return @value + end + + def to_json(*a) + @value.to_json(*a) + end + end end
Added some internal implementation to the Metadata class so that it actually works for something.
cfndsl_cfndsl
train
rb
c4ece95110e42e6cde6f5a94dbf4ae12665772e6
diff --git a/treeherder/perf/email.py b/treeherder/perf/email.py index <HASH>..<HASH> 100644 --- a/treeherder/perf/email.py +++ b/treeherder/perf/email.py @@ -158,14 +158,14 @@ class BackfillNotificationWriter(EmailWriter): # For performance data cycling class DeletionReportContent: DESCRIPTION = """Perfherder removes performance data that is older than one year and in some cases even sooner, leaving behind performance signatures that aren't associated to any data point. These as well need to be removed. - > __Here's a summary of recently deleted performance signatures:__ - --- - """ +> __Here's a summary of recently deleted performance signatures:__ +--- +""" TABLE_HEADERS = """ - | Repository | Framework | Platform | Suite | Application | - | :---: | :---: | :---: | :---: | :---: | - """ +| Repository | Framework | Platform | Suite | Application | +| :---: | :---: | :---: | :---: | :---: | +""" def __init__(self): self._raw_content = None
Bug <I> - Fix email with summary of signatures (#<I>)
mozilla_treeherder
train
py
a191208e39ee311480f5dc1f4abd500ad7145a2c
diff --git a/lib/ref/safe_monitor.rb b/lib/ref/safe_monitor.rb index <HASH>..<HASH> 100644 --- a/lib/ref/safe_monitor.rb +++ b/lib/ref/safe_monitor.rb @@ -33,7 +33,7 @@ module Ref @count -= 1 if @count == 0 @owner = nil - @mutex.unlock rescue puts "current #{Thread.current.object_id}; owner #{@owner}" + @mutex.unlock end end end diff --git a/lib/ref/weak_reference/pure_ruby.rb b/lib/ref/weak_reference/pure_ruby.rb index <HASH>..<HASH> 100644 --- a/lib/ref/weak_reference/pure_ruby.rb +++ b/lib/ref/weak_reference/pure_ruby.rb @@ -75,7 +75,17 @@ module Ref # Get the reference object. If the object has already been garbage collected, # then this method will return nil. def object #:nodoc: - @reference_pointer.object + if @reference_pointer + obj = @reference_pointer.object + unless obj + @@lock.synchronize do + @@weak_references.delete(object_id) + @reference_pointer.cleanup + @reference_pointer = nil + end + end + obj + end end end end
clear object on ref when it is no longer found
ruby-concurrency_ref
train
rb,rb
470c5f8a7df9a4e51823db598785e83147af1259
diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb index <HASH>..<HASH> 100644 --- a/lib/sinatra/base.rb +++ b/lib/sinatra/base.rb @@ -1381,7 +1381,7 @@ module Sinatra end else def self.force_encoding(data, *) data end - end + end reset!
removes indentation warning under <I> /home/slmn/.bundler/ruby/<I>/sinatra-<I>d<I>a9/lib/sinatra/base.rb:<I>: warning: mismatched indentations at 'end' with 'if' at <I>
sinatra_sinatra
train
rb
2cd6d99ccf3ac7ae8398d8296429161bf7061ae2
diff --git a/ghttp/test_server.go b/ghttp/test_server.go index <HASH>..<HASH> 100644 --- a/ghttp/test_server.go +++ b/ghttp/test_server.go @@ -138,6 +138,13 @@ func NewServer() *Server { return s } +// NewUnstartedServer return a new, unstarted, `*ghttp.Server`. Useful for specifying a custom listener on `server.HTTPTestServer`. +func NewUnstartedServer() *Server { + s := new() + s.HTTPTestServer = httptest.NewUnstartedServer(s) + return s +} + // NewTLSServer returns a new `*ghttp.Server` that wraps an `httptest` TLS server. The server is started automatically. func NewTLSServer() *Server { s := new() @@ -165,6 +172,11 @@ type Server struct { calls int } +//Start() starts an unstarted ghttp server. It is a catastrophic error to call Start more than once (thanks, httptest). +func (s *Server) Start() { + s.HTTPTestServer.Start() +} + //URL() returns a url that will hit the server func (s *Server) URL() string { return s.HTTPTestServer.URL
Add ability to build an unstarted ghttp server
onsi_gomega
train
go
058bd683bba6ed73c6959bb2caeb423a3bc6288d
diff --git a/src/main/java/com/github/mthizo247/cloud/netflix/zuul/web/socket/ProxyWebSocketHandler.java b/src/main/java/com/github/mthizo247/cloud/netflix/zuul/web/socket/ProxyWebSocketHandler.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/mthizo247/cloud/netflix/zuul/web/socket/ProxyWebSocketHandler.java +++ b/src/main/java/com/github/mthizo247/cloud/netflix/zuul/web/socket/ProxyWebSocketHandler.java @@ -115,7 +115,7 @@ public class ProxyWebSocketHandler extends WebSocketHandlerDecorator { @Override public void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus) throws Exception { - //disconnectFromProxiedTarget(session); + disconnectFromProxiedTarget(session); super.afterConnectionClosed(session, closeStatus); }
close server session after user agent session has been closed
mthizo247_spring-cloud-netflix-zuul-websocket
train
java
aaacaec1c4a9581da84a4c15182780aa2c3d0805
diff --git a/pysolr.py b/pysolr.py index <HASH>..<HASH> 100644 --- a/pysolr.py +++ b/pysolr.py @@ -155,12 +155,13 @@ class SolrError(Exception): pass class Results(object): - def __init__(self, docs, hits, highlighting=None, facets=None, spellcheck=None): + def __init__(self, docs, hits, highlighting=None, facets=None, spellcheck=None, stats=None): self.docs = docs self.hits = hits self.highlighting = highlighting or {} self.facets = facets or {} self.spellcheck = spellcheck or {} + self.stats = stats or {} def __len__(self): return len(self.docs) @@ -340,6 +341,9 @@ class Solr(object): if result.get('spellcheck'): result_kwargs['spellcheck'] = result['spellcheck'] + if result.get('stats'): + result_kwargs['stats'] = result['stats'] + return Results(result['response']['docs'], result['response']['numFound'], **result_kwargs) def more_like_this(self, q, mltfl, **kwargs):
Added support for the Stats component. Thanks to thomas.j.lee for the original patch.
django-haystack_pysolr
train
py
dbf384b88bf3a383e4cb04a510a810d8ea265218
diff --git a/test/cases/relations_test_sqlserver.rb b/test/cases/relations_test_sqlserver.rb index <HASH>..<HASH> 100644 --- a/test/cases/relations_test_sqlserver.rb +++ b/test/cases/relations_test_sqlserver.rb @@ -3,7 +3,10 @@ require 'models/post' class RelationTest < ActiveRecord::TestCase - COERCED_TESTS = [:test_merging_reorders_bind_params] + COERCED_TESTS = [ + :test_merging_reorders_bind_params, + :test_to_sql_on_eager_join + ] # Until that patch is made to rails we are preventing this test from running in this gem. include SqlserverCoercedTest fixtures :posts @@ -24,4 +27,12 @@ class RelationTest < ActiveRecord::TestCase merged = left.merge(right) assert_equal post, merged.first end -end \ No newline at end of file + + def test_coerced_to_sql_on_eager_join + expected = assert_sql { + Post.eager_load(:last_comment).order('comments.id DESC').to_a + }.first + actual = Post.eager_load(:last_comment).order('comments.id DESC').to_sql + assert_equal expected.include?(actual), true + end +end
The test test_to_sql_on_eager_join was seeing slightly different result in that the SQL was embedded in a call to sp_executesql, which seems ok to me
rails-sqlserver_activerecord-sqlserver-adapter
train
rb
93e9a7f9c12c4391f48c5a564173dcf688bd7aa5
diff --git a/tldap/backend/transaction.py b/tldap/backend/transaction.py index <HASH>..<HASH> 100644 --- a/tldap/backend/transaction.py +++ b/tldap/backend/transaction.py @@ -66,6 +66,9 @@ class _MatchMixin(ldaptor.entryhelpers.MatchMixin): def get(self, key, default): return self._attributes.get(key, default) + def __getitem__(self, key): + return self._attributes.get(key) + def __contains__(self, item): return item in self._attributes
Add another required function to filter class.
Karaage-Cluster_python-tldap
train
py
0ae6f0c79731fd774ee02e7c76b16640df5e4593
diff --git a/pyknow/engine.py b/pyknow/engine.py index <HASH>..<HASH> 100644 --- a/pyknow/engine.py +++ b/pyknow/engine.py @@ -74,7 +74,13 @@ class KnowledgeEngine: """ self._parent = parent - def declare(self, *facts, persistent=False): + def declare_from_fact(self, *facts): + """ + Declare from inside a fact, that is a non-persistent fact. + """ + self.declare(*facts, persistent=True) + + def declare(self, *facts, persistent=True): """ Declare a Fact in the KE. @@ -96,7 +102,6 @@ class KnowledgeEngine: raise TypeError("Cant use types T, C, V declaring a fact") idx = self._facts.declare(fact) ids.append(idx) - self.strategy.update_agenda(self.agenda, self.get_activations()) if persistent: self._fixed_facts.extend(facts) @@ -197,3 +202,4 @@ class KnowledgeEngine: self._facts = FactList() self.declare(InitialFact()) self.load_initial_facts() + self.strategy.update_agenda(self.agenda, self.get_activations())
Updating agenda only on reset, persistent facts by default
buguroo_pyknow
train
py
1eca13f99be71baa7687306b8c72abd16a265aae
diff --git a/pymatgen/core/surface.py b/pymatgen/core/surface.py index <HASH>..<HASH> 100644 --- a/pymatgen/core/surface.py +++ b/pymatgen/core/surface.py @@ -873,7 +873,7 @@ class SlabGenerator(object): return slab -def get_recp_symmetry_operation(structure, symprec=0.001): +def get_recp_symmetry_operation(structure, symprec=0.01): """ Find the symmetric operations of the reciprocal lattice, to be used for hkl transformations diff --git a/pymatgen/io/tests/test_cif.py b/pymatgen/io/tests/test_cif.py index <HASH>..<HASH> 100644 --- a/pymatgen/io/tests/test_cif.py +++ b/pymatgen/io/tests/test_cif.py @@ -352,7 +352,7 @@ loop_ def test_CifWriter(self): filepath = os.path.join(test_dir, 'POSCAR') poscar = Poscar.from_file(filepath) - writer = CifWriter(poscar.structure, symprec=0.001) + writer = CifWriter(poscar.structure, symprec=0.01) ans = """# generated using pymatgen data_FePO4 _symmetry_space_group_name_H-M Pnma
More increases of symprec.
materialsproject_pymatgen
train
py,py
0afa7549e272985a06cfc6ed89b1e3de3de46115
diff --git a/test/boxen_runner_test.rb b/test/boxen_runner_test.rb index <HASH>..<HASH> 100644 --- a/test/boxen_runner_test.rb +++ b/test/boxen_runner_test.rb @@ -156,7 +156,22 @@ class BoxenRunnerTest < Boxen::Test runner = Boxen::Runner.new(@config, flags) runner.process + assert_equal project, Facter.value(fact) + + + project = 'other_project' + flags = Boxen::Flags.new('--debug', project) + runner = Boxen::Runner.new(@config, flags) + runner.process assert_equal project, Facter.value(fact) + + + projects = %w[my cool projects] + flags = Boxen::Flags.new('--noop', *projects) + + runner = Boxen::Runner.new(@config, flags) + runner.process + assert_equal projects.join(','), Facter.value(fact) end end
Multiple CLI projects, also using flags What do I know about Facter? This test fails because once the fact is set, it's set. Maybe I could do something with weights in the code, but that seems silly. Probably should instead be testing this differently.
boxen_boxen
train
rb
b533ed2a22b8e17356bcd6ef2f0e276400f7a959
diff --git a/src/helpers/d3.axisWithLabelPicker.js b/src/helpers/d3.axisWithLabelPicker.js index <HASH>..<HASH> 100644 --- a/src/helpers/d3.axisWithLabelPicker.js +++ b/src/helpers/d3.axisWithLabelPicker.js @@ -337,7 +337,7 @@ export default function axisSmart(_orient) { .pivot(null) .repositionLabels(null); } - if (options.scaleType == "ordinal") return axis.tickValues(null); + if (options.scaleType == "ordinal") return axis; if (options.logBase == null) options.logBase = DEFAULT_LOGBASE; if (options.stops == null) options.stops = [1, 2, 5, 3, 7, 4, 6, 8, 9];
fix for ordinal scales (#<I>)
vizabi_vizabi
train
js
e506b7615ec6fc37388f0a06dbbbfb3c18b36764
diff --git a/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java b/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java index <HASH>..<HASH> 100644 --- a/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java +++ b/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java @@ -378,6 +378,15 @@ implements ShutdownListener { throw scre; } p.retrieved(); + + // Check for AJAX + String x_req_with = httpRequest.getHeader("X-Requested-With"); + if ((x_req_with != null)) { + if (x_req_with.equals("XMLHttpRequest")) { + wbRequest.setIdentityContext(true); + } + } + ReplayRenderer renderer = getReplay().getRenderer(wbRequest, closest, resource);
FEATURE: Check for X-Requested-With: XMLHttpRequest and force identity replay if an ajax request is detected to avoid messing up json
iipc_openwayback
train
java
48c02b4d1fd5c70e1f6db7ab1d89c9d0cef852bb
diff --git a/tests/swarming/nupic/swarming/swarming_test.py b/tests/swarming/nupic/swarming/swarming_test.py index <HASH>..<HASH> 100755 --- a/tests/swarming/nupic/swarming/swarming_test.py +++ b/tests/swarming/nupic/swarming/swarming_test.py @@ -37,10 +37,11 @@ import time import math import uuid import tempfile +from pkg_resources import resource_filename from optparse import OptionParser -from nupic import NUPIC_ROOT + from nupic.database.ClientJobsDAO import ClientJobsDAO from nupic.support import configuration, initLogging from nupic.support.unittesthelpers.testcasebase import (unittest, @@ -256,8 +257,8 @@ class ExperimentTestBaseClass(HelperTestCaseBase): # Form the stream definition if dataPath is None: - dataPath = os.path.join(NUPIC_ROOT, '..', 'examples', 'prediction', - 'data', 'extra', 'qa', "hotgym", "qa_hotgym.csv") + dataPath = resource_filename("nupic.data", "extra/qa/hotgym/qa_hotgym.csv") + streamDef = dict( version = 1, info = "TestHypersearch",
Update swarming_test.py
numenta_nupic
train
py
b350424d0aeb371601d4d798b4379365bd078fb7
diff --git a/bbq/lib/bbq/test_user.rb b/bbq/lib/bbq/test_user.rb index <HASH>..<HASH> 100644 --- a/bbq/lib/bbq/test_user.rb +++ b/bbq/lib/bbq/test_user.rb @@ -9,7 +9,7 @@ module Bbq include ActionDispatch::Routing::UrlFor include Rails.application.routes.url_helpers - include ActionDispatch::Routing::RouteSet::MountedHelpers + include ActionDispatch::Routing::RouteSet::MountedHelpers unless Rails.version < "3.1" include Capybara::DSL attr_reader :options
make sure we use isolated engine helpers for <I>.x
drugpl_bbq
train
rb
da48f4168d5939d2e1f3484d0a5b88ad193ad2e6
diff --git a/core-bundle/src/Resources/contao/dca/tl_page.php b/core-bundle/src/Resources/contao/dca/tl_page.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/dca/tl_page.php +++ b/core-bundle/src/Resources/contao/dca/tl_page.php @@ -1218,6 +1218,13 @@ class tl_page extends Backend foreach (array_keys($GLOBALS['TL_PTY']) as $pty) { + // Root pages are allowed on the first level only (see #6360) + if ($pty == 'root' && $dc->activeRecord && $dc->activeRecord->pid > 0) + { + continue; + } + + // Allow the currently selected option and anything the user has access to if ($pty == $dc->value || $this->User->hasAccess($pty, 'alpty')) { $arrOptions[] = $pty;
[Core] Do not allow to create website root pages outside the root level (see #<I>)
contao_contao
train
php
9f649592a5558dec89a1c59193bb466e25991736
diff --git a/post-setup.py b/post-setup.py index <HASH>..<HASH> 100644 --- a/post-setup.py +++ b/post-setup.py @@ -3,4 +3,4 @@ import os from sovrin_common.setup_util import Setup BASE_DIR = os.path.join(os.path.expanduser("~"), ".sovrin") -Setup(BASE_DIR).setupTxns() \ No newline at end of file +Setup(BASE_DIR).setupNode() \ No newline at end of file diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -49,6 +49,7 @@ if not os.path.exists(CONFIG_FILE): "example\n" f.write(msg) + def post_install(): subprocess.run(['python post-setup.py'], shell=True)
changes to copy required data files based on which package is being installed
hyperledger_indy-node
train
py,py