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
db9ef0f94435a81811e4a8ce0f686abecc695c7d
diff --git a/src/select/__test__/Select.test.js b/src/select/__test__/Select.test.js index <HASH>..<HASH> 100644 --- a/src/select/__test__/Select.test.js +++ b/src/select/__test__/Select.test.js @@ -45,7 +45,7 @@ describe('<Select>', () => { }); it('Test onChange func', () => { - const select = wrapper.find('.w-select').at(0).find('.w-input').at(0); + const select = wrapper.find('.w-select').at(0).find('input').at(0); select.simulate('change'); expect(wrapperState.value).toBe(7); });
test(Select): Update test case.
uiwjs_uiw
train
js
f865fce50ad93453ff2b1ef7ef14bd0eb172d0aa
diff --git a/src/Guard.php b/src/Guard.php index <HASH>..<HASH> 100644 --- a/src/Guard.php +++ b/src/Guard.php @@ -119,7 +119,7 @@ class Guard implements MiddlewareInterface } /** - * @param null|array|ArrayAccess + * @param null|array|ArrayAccess $storage * * @return self *
fix docblock for setStorage method
slimphp_Slim-Csrf
train
php
92483256016854f1392552448b9d9aa1731a9545
diff --git a/py3status/modules/rt.py b/py3status/modules/rt.py index <HASH>..<HASH> 100644 --- a/py3status/modules/rt.py +++ b/py3status/modules/rt.py @@ -21,9 +21,9 @@ Color options: color_degraded: Exceeded threshold_warning Requires: - PyMySQL: https://pypi.python.org/pypi/PyMySQL + PyMySQL: https://pypi.org/project/PyMySQL/ or - MySQL-python: http://pypi.python.org/pypi/MySQL-python + MySQL-python: https://pypi.org/project/MySQL-python/ It features thresholds to colorize the output and forces a low timeout to limit the impact of a server connectivity problem on your i3bar freshness.
rt: replace http with secure https
ultrabug_py3status
train
py
b2c5f23bdd47353656c8c6de1e69872ad9f59bdf
diff --git a/rotunicode/utils.py b/rotunicode/utils.py index <HASH>..<HASH> 100644 --- a/rotunicode/utils.py +++ b/rotunicode/utils.py @@ -2,6 +2,16 @@ from __future__ import unicode_literals from os.path import splitext +import codecs + +from rotunicode import RotUnicode + + +def register_codec(): + try: + codecs.lookup('rotunicode') + except LookupError: + codecs.register(RotUnicode.search_function) def ruencode(string, extension=False): @@ -24,6 +34,7 @@ def ruencode(string, extension=False): :rtype: `unicode` """ + register_codec() if extension: file_name = string file_ext = '' @@ -46,4 +57,5 @@ def rudecode(string): :rtype: `unicode` """ + register_codec() return string.decode('rotunicode')
automatically register codec to make shorthand methods easier to import
box_rotunicode
train
py
d8212f2c79fcd62c0fbc5cbfeaed0e8c600c6184
diff --git a/storage/tests/system.py b/storage/tests/system.py index <HASH>..<HASH> 100644 --- a/storage/tests/system.py +++ b/storage/tests/system.py @@ -51,15 +51,11 @@ retry_bad_copy = RetryErrors(exceptions.BadRequest, error_predicate=_bad_copy) def _empty_bucket(bucket): - """Empty a bucket of all existing blobs. - - This accounts (partially) for the eventual consistency of the - list blobs API call. - """ - for blob in bucket.list_blobs(): + """Empty a bucket of all existing blobs (including multiple versions).""" + for blob in bucket.list_blobs(versions=True): try: blob.delete() - except exceptions.NotFound: # eventual consistency + except exceptions.NotFound: pass @@ -87,6 +83,7 @@ def setUpModule(): def tearDownModule(): errors = (exceptions.Conflict, exceptions.TooManyRequests) retry = RetryErrors(errors, max_tries=9) + retry(_empty_bucket)(Config.TEST_BUCKET) retry(Config.TEST_BUCKET.delete)(force=True)
storage: fix failing system tests (#<I>) * Add additional object deletion * Add versions to list_blobs during deletion * Fix retry call to empty bucket
googleapis_google-cloud-python
train
py
d0afbe3178349af190b6bc1f414a2f0cd0aad953
diff --git a/lib/endpoint/pathsToRegexp.js b/lib/endpoint/pathsToRegexp.js index <HASH>..<HASH> 100755 --- a/lib/endpoint/pathsToRegexp.js +++ b/lib/endpoint/pathsToRegexp.js @@ -15,10 +15,10 @@ function pathsToRegexp(regexpAndParams, paths) { return path.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); } //A regexp path: ":paramName" - //For the moment, this only match "[^/*]" + //For the moment, this only match "[^/]+" var name = path.substr(1); paramNames.push(name); - return "([^\\/]*)"; + return "([^\\/]+)"; }) .join("\\/");
Fix: variable path (:xxx) should contain at least one character
farvilain_silence-router
train
js
3fc85b1956d2d96b0829cbf7c79e39dafb67fb80
diff --git a/opal/core/enumerable.rb b/opal/core/enumerable.rb index <HASH>..<HASH> 100644 --- a/opal/core/enumerable.rb +++ b/opal/core/enumerable.rb @@ -754,6 +754,10 @@ module Enumerable return $breaker; } + if (value === nil) { + #{raise ArgumentError, "comparison failed"}; + } + if (value < 0) { result = param; } @@ -768,7 +772,7 @@ module Enumerable return; } - if (#{`param` <=> `result`} < 0) { + if (#{Opal.compare(`param`, `result`)} < 0) { result = param; } }; diff --git a/spec/filters/bugs/enumerable.rb b/spec/filters/bugs/enumerable.rb index <HASH>..<HASH> 100644 --- a/spec/filters/bugs/enumerable.rb +++ b/spec/filters/bugs/enumerable.rb @@ -15,9 +15,6 @@ opal_filter "Enumerable" do fails "Enumerable#member? returns true if any element == argument for numbers" fails "Enumerable#member? gathers whole arrays as elements when each yields multiple" - fails "Enumerable#min raises an ArgumentError for incomparable elements" - fails "Enumerable#min gathers whole arrays as elements when each yields multiple" - fails "Enumerable#reduce returns nil when fails(legacy rubycon)" fails "Enumerable#reduce without inject arguments(legacy rubycon)"
Enumerable#min raises when it can't compare elements
opal_opal
train
rb,rb
e9b47dde02dbdd1aed2dc48cc905ab2742550c8c
diff --git a/views/GridLayout.js b/views/GridLayout.js index <HASH>..<HASH> 100644 --- a/views/GridLayout.js +++ b/views/GridLayout.js @@ -29,9 +29,18 @@ GridLayout.prototype._sequenceFrom = function _sequenceFrom(views) { var x = w * (i % cols); var y = h * ((i / cols) | 0); + var sizeMode = view.node.getSizeMode(); + if (sizeMode[0] !== Size.ABSOLUTE || + sizeMode[1] !== Size.ABSOLUTE) { + view._gridSizeFlag = true; + view.node + .setSizeMode(Size.ABSOLUTE, Size.ABSOLUTE); + } + + if (view._gridSizeFlag) + view.node.setAbsoluteSize(w, h); + view.node - .setSizeMode(Size.ABSOLUTE, Size.ABSOLUTE) - .setAbsoluteSize(w, h) .setMountPoint(0, 0) .setPosition(x, y); }
Fixed GridLayout items to use their own size when those are already absoluted sized
panarch_famous-mig
train
js
ca28d197a7baa2a72bf4eb27d4afa7a339e563e3
diff --git a/lib/trax/model/mixins/sort_scopes.rb b/lib/trax/model/mixins/sort_scopes.rb index <HASH>..<HASH> 100644 --- a/lib/trax/model/mixins/sort_scopes.rb +++ b/lib/trax/model/mixins/sort_scopes.rb @@ -40,6 +40,7 @@ module Trax def define_order_by_scope_for_field(field_name, as:field_name, class_name:self.name, prefix:'sort_by', with:nil, **options) klass = class_name.is_a?(String) ? class_name.constantize : class_name + return unless klass.table_exists? column_type = klass.column_types[field_name.to_s].type case column_type
return unless table_exists? to fix eager loading issue with CI environments
jasonayre_trax_model
train
rb
565bdc5d833b234816e9f47285b1de3992e17362
diff --git a/import.js b/import.js index <HASH>..<HASH> 100644 --- a/import.js +++ b/import.js @@ -95,10 +95,8 @@ var types = [ 'venue-us-me', 'venue-us-wa', 'venue-us-ga', - 'venue-us-tx', 'venue-us-sc', 'venue-us-sd', - 'venue-us-ut', 'venue-us-vt', 'venue-us-nj', 'venue-us-wv',
Remove Texas and Utah They don't have bundles yet. @thisisaaronland why you messin with Texas?
pelias_whosonfirst
train
js
f414821a20a5d9fa206dea81ad23b14f45151496
diff --git a/fritzconnection/core/fritzconnection.py b/fritzconnection/core/fritzconnection.py index <HASH>..<HASH> 100644 --- a/fritzconnection/core/fritzconnection.py +++ b/fritzconnection/core/fritzconnection.py @@ -289,3 +289,8 @@ class FritzConnection: """ self.call_action("WANIPConn1", "ForceTermination") + def reboot(self): + """ + Reboot the system. + """ + self.call_action("DeviceConfig1", "Reboot")
new reboot method for FritzConnection class
kbr_fritzconnection
train
py
fcfa8c912909e81827d17a7c107d40656f22c337
diff --git a/src/BoomCMS/Core/Controllers/CMS/People/Person/SavePerson.php b/src/BoomCMS/Core/Controllers/CMS/People/Person/SavePerson.php index <HASH>..<HASH> 100644 --- a/src/BoomCMS/Core/Controllers/CMS/People/Person/SavePerson.php +++ b/src/BoomCMS/Core/Controllers/CMS/People/Person/SavePerson.php @@ -14,7 +14,7 @@ class SavePerson extends BasePerson 'email' => $this->request->input('email'), 'name' => $this->request->input('name'), ], - $this->request->input('groups'), + $this->request->input('groups')? : [], $this->auth, $this->personProvider, $this->groupProvider
Fixed creating a person with no groups
boomcms_boom-core
train
php
8cf82b7a111094325ca1a599a8bbd711cd687c4c
diff --git a/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php b/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php +++ b/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php @@ -22,6 +22,14 @@ class FormatterStyleTest extends \PHPUnit_Framework_TestCase $this->assertEquals("foo<>bar", $formatter->format('foo<>bar')); } + public function testLGCharEscaping() + { + $formatter = new OutputFormatter(true); + $this->assertEquals("foo<bar", $formatter->format('foo\\<bar')); + $this->assertEquals("<info>some info</info>", $formatter->format('\\<info>some info\\</info>')); + $this->assertEquals("\\<info>some info\\</info>", OutputFormatter::escape('<info>some info</info>')); + } + public function testBundledStyles() { $formatter = new OutputFormatter(true);
[Console] Added '<' escaping tests.
symfony_symfony
train
php
9122ca1880b93247aea7816695ffcb10c00564c4
diff --git a/spyderlib/plugins/editor.py b/spyderlib/plugins/editor.py index <HASH>..<HASH> 100644 --- a/spyderlib/plugins/editor.py +++ b/spyderlib/plugins/editor.py @@ -883,6 +883,7 @@ class Editor(SpyderPluginWidget): for other_editorstack in self.editorstacks: if other_editorstack is not editorstack: other_editorstack.set_todo_results(index, results) + self.update_todo_actions() def refresh_eol_mode(self, os_name): os_name = unicode(os_name)
Editor: todo list was not updated after loading file
spyder-ide_spyder
train
py
7275829dae42dd09aa642b7db7302446401c708b
diff --git a/lib/svtplay_dl/fetcher/hls.py b/lib/svtplay_dl/fetcher/hls.py index <HASH>..<HASH> 100644 --- a/lib/svtplay_dl/fetcher/hls.py +++ b/lib/svtplay_dl/fetcher/hls.py @@ -109,7 +109,7 @@ class HLS(VideoRetriever): return "hls" def download(self): - self.output_extention = "tls" + self.output_extention = "ts" if self.segments: if self.audio: self._download(self.audio, file_name=(copy.copy(self.output), "audio.ts"))
hls.download: the extension should be ts not tls
spaam_svtplay-dl
train
py
2dadf74134f4f5e6a5a97474336545e527243f78
diff --git a/src/controls/geocoder.js b/src/controls/geocoder.js index <HASH>..<HASH> 100644 --- a/src/controls/geocoder.js +++ b/src/controls/geocoder.js @@ -93,7 +93,7 @@ export default class Geocoder { this.fire('loading'); const geocodingOptions = this.options - const exclude = ['placeholder', 'zoom', 'flyTo', 'accessToken']; + const exclude = ['placeholder', 'zoom', 'flyTo', 'accessToken', 'api']; const options = Object.keys(this.options).filter(function(key) { return exclude.indexOf(key) === -1; }).map(function(key) {
Exclude options.api from query params (#<I>)
mapbox_mapbox-gl-directions
train
js
f4ac42f681163d293e38e16e0264c20613f7f3ec
diff --git a/openid/server/trustroot.py b/openid/server/trustroot.py index <HASH>..<HASH> 100644 --- a/openid/server/trustroot.py +++ b/openid/server/trustroot.py @@ -233,9 +233,6 @@ class TrustRoot(object): @rtype: C{NoneType} or C{L{TrustRoot}} """ - if not isinstance(trust_root, (str, unicode)): - return None - url_parts = _parseURL(trust_root) if url_parts is None: return None
[project @ server.trustroot.TrustRoot.parse: don't return None if other types are passed in.] If code is passing in funny values for this, I don't want silent failure.
openid_python-openid
train
py
c1d8c162da52dde7a8acef01bd607423198897a9
diff --git a/integration/single/test_basic_function.py b/integration/single/test_basic_function.py index <HASH>..<HASH> 100644 --- a/integration/single/test_basic_function.py +++ b/integration/single/test_basic_function.py @@ -1,6 +1,7 @@ from unittest.case import skipIf -from integration.config.service_names import KMS, XRAY, ARM, CODE_DEPLOY +from integration.config.service_names import KMS, XRAY, ARM, CODE_DEPLOY, HTTP_API + from integration.helpers.resource import current_region_does_not_support from parameterized import parameterized from integration.helpers.base_test import BaseTest @@ -35,6 +36,7 @@ class TestBasicFunction(BaseTest): "single/function_alias_with_http_api_events", ] ) + @skipIf(current_region_does_not_support([HTTP_API]), "HTTP API is not supported in this testing region") def test_function_with_http_api_events(self, file_name): self.create_and_verify_stack(file_name)
chore: FOSS add skip tests (#<I>)
awslabs_serverless-application-model
train
py
61d90773d7c97ce0ea61920f0f2330d09df4c5d2
diff --git a/lib/active_decorator/railtie.rb b/lib/active_decorator/railtie.rb index <HASH>..<HASH> 100644 --- a/lib/active_decorator/railtie.rb +++ b/lib/active_decorator/railtie.rb @@ -29,8 +29,6 @@ module ActiveDecorator require 'active_decorator/monkey/action_controller/base/rescue_from' ::ActionController::API.send :prepend, ActiveDecorator::Monkey::ActionController::Base - - ::ActionController::API.send :include, ActiveDecorator::ViewContext::Filter end end end
Don't expect the API to have a view_context fixes #<I> finally
amatsuda_active_decorator
train
rb
15a9e9291e90d5f46b43dcbd020f7e451261fa63
diff --git a/tests/_util.py b/tests/_util.py index <HASH>..<HASH> 100644 --- a/tests/_util.py +++ b/tests/_util.py @@ -11,10 +11,12 @@ import os import shutil import tempfile +import gutenberg.acquire.metadata +import gutenberg.acquire.text + class MockTextMixin(object): def setUp(self): - import gutenberg.acquire.text self.mock_text_cache = tempfile.mkdtemp() gutenberg.acquire.text._TEXT_CACHE = self.mock_text_cache @@ -30,7 +32,6 @@ class MockMetadataMixin(object): raise NotImplementedError def setUp(self): - import gutenberg.acquire.metadata self.mock_metadata_cache = _mock_metadata_cache(self.sample_data()) gutenberg.acquire.metadata._METADATA_CACHE = self.mock_metadata_cache
No-op: move all imports to top of file
c-w_gutenberg
train
py
416daa0d11d6146e00131cf668998656186aef6a
diff --git a/git/refs/symbolic.py b/git/refs/symbolic.py index <HASH>..<HASH> 100644 --- a/git/refs/symbolic.py +++ b/git/refs/symbolic.py @@ -574,7 +574,7 @@ class SymbolicReference(object): # walk loose refs # Currently we do not follow links for root, dirs, files in os.walk(join_path_native(repo.git_dir, common_path)): - if 'refs/' not in root: # skip non-refs subfolders + if 'refs' not in root.split(os.sep): # skip non-refs subfolders refs_id = [d for d in dirs if d == 'refs'] if refs_id: dirs[0:] = ['refs']
fix(refs): don't assume linux path separator Instead, work with os.sep. Fixes #<I>
gitpython-developers_GitPython
train
py
eb08f2274e30a087d3bac6a9dd639f3ffd90ead9
diff --git a/raft/progress.go b/raft/progress.go index <HASH>..<HASH> 100644 --- a/raft/progress.go +++ b/raft/progress.go @@ -75,7 +75,6 @@ type Progress struct { func (pr *Progress) resetState(state ProgressStateType) { pr.Paused = false - pr.RecentActive = false pr.PendingSnapshot = 0 pr.State = state pr.ins.reset()
raft: do not change RecentActive when resetState for progress
etcd-io_etcd
train
go
657461c3bbdd0a4035adf2f2119e3fbd8ddfdf5a
diff --git a/dbt/tracking.py b/dbt/tracking.py index <HASH>..<HASH> 100644 --- a/dbt/tracking.py +++ b/dbt/tracking.py @@ -1,6 +1,6 @@ from dbt import version as dbt_version -from snowplow_tracker import Subject, Tracker, AsyncEmitter, logger as sp_logger +from snowplow_tracker import Subject, Tracker, Emitter, logger as sp_logger from snowplow_tracker import SelfDescribingJson, disable_contracts disable_contracts() @@ -24,7 +24,7 @@ INVOCATION_SPEC = "https://raw.githubusercontent.com/analyst-collective/dbt/mast PLATFORM_SPEC = "https://raw.githubusercontent.com/analyst-collective/dbt/master/events/schemas/com.fishtownanalytics/platform_context.json" RUN_MODEL_SPEC = "https://raw.githubusercontent.com/analyst-collective/dbt/master/events/schemas/com.fishtownanalytics/run_model_context.json" -emitter = AsyncEmitter(COLLECTOR_URL, protocol=COLLECTOR_PROTOCOL, buffer_size=1) +emitter = Emitter(COLLECTOR_URL, protocol=COLLECTOR_PROTOCOL, buffer_size=1) tracker = Tracker(emitter, namespace="cf", app_id="dbt") def __write_user():
don't use async emitter
fishtown-analytics_dbt
train
py
e1c7235741f9a9ec0d2922ac7755ec5b74bad3c5
diff --git a/config/webpack/test.js b/config/webpack/test.js index <HASH>..<HASH> 100644 --- a/config/webpack/test.js +++ b/config/webpack/test.js @@ -7,7 +7,7 @@ export default { { test: /\.js$/, exclude: /node_modules/, - loader: 'babel-loader?stage=0&optional[]=runtime' + loader: 'babel-loader?stage=0&optional[]=runtime&loose=true' } ] }, diff --git a/tasks/react-components.js b/tasks/react-components.js index <HASH>..<HASH> 100644 --- a/tasks/react-components.js +++ b/tasks/react-components.js @@ -17,7 +17,7 @@ const buildFolder = 'dist/react'; gulp.task('react-build-src', function() { return gulp.src('src/pivotal-ui-react/**/*.js') .pipe(plugins.plumber()) - .pipe(plugins.babel({stage: 0, optional: ['runtime']})) + .pipe(plugins.babel({stage: 0, optional: ['runtime'], loose: true})) .pipe(plugins.header(COPYRIGHT)) .pipe(gulp.dest(buildFolder)); });
chore(babel): Uses loose setting for babel translation [Finishes #<I>]
pivotal-cf_pivotal-ui
train
js,js
d7563d592422d297d8fe838f360b0416da143cfb
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -44,7 +44,7 @@ class CustomInstall(install): batfilename = 'pygubu-designer.bat' batpath = os.path.join(self.install_scripts, batfilename) with open(batpath, 'w') as batfile: - content = "{0} -m pygubudesigner".format(sys.executable) + content = '"{0}" -m pygubudesigner'.format(sys.executable) batfile.write(content)
Fix Windows batch file It crashes in paths with spaces like `c:\program files\python <I>\python.exe -m pygubudesigner` returning `c:\program is not recognized as an internal or external command, operable program or batch file`. Putting the path between quotes solves this.
alejandroautalan_pygubu
train
py
9c064d03807600e7931c347517b8fd3500906816
diff --git a/lib/db/access.php b/lib/db/access.php index <HASH>..<HASH> 100644 --- a/lib/db/access.php +++ b/lib/db/access.php @@ -500,7 +500,7 @@ $capabilities = array( 'moodle/user:delete' => array( - 'riskbitmask' => RISK_PERSONAL, RISK_DATALOSS, + 'riskbitmask' => RISK_PERSONAL | RISK_DATALOSS, 'captype' => 'write', 'contextlevel' => CONTEXT_SYSTEM, diff --git a/version.php b/version.php index <HASH>..<HASH> 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2017082400.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2017082400.01; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes.
MDL-<I> access: Fix definition of risks for user:delete.
moodle_moodle
train
php,php
cb1638366839cb6c6117a1a47a041f42bff30482
diff --git a/src/manager/componentsManager.py b/src/manager/componentsManager.py index <HASH>..<HASH> 100644 --- a/src/manager/componentsManager.py +++ b/src/manager/componentsManager.py @@ -883,10 +883,11 @@ class Manager(object): LOGGER.debug("> Current Component: '{0}'.".format(component)) if os.path.isfile(os.path.join(profile.path, profile.module) + ".py") or os.path.isdir(os.path.join(profile.path, profile.module)): - not profile.path in sys.path and sys.path.append(profile.path) + path = profile.path elif os.path.basename(profile.path) == profile.module: path = os.path.join(profile.path, "..") - not path in sys.path and sys.path.append(path) + not path in sys.path and sys.path.append(path) + profile.import_ = __import__(profile.module) object_ = profile.object_ in profile.import_.__dict__ and getattr(profile.import_, profile.object_) or None if object_ and inspect.isclass(object_):
Refactor "Manager" class "instantiateComponent" method in "componentsManager" module.
KelSolaar_Manager
train
py
c8a5c6a4e02f36cad5e8fd5e97652ce32a3340ac
diff --git a/lib/filelib.php b/lib/filelib.php index <HASH>..<HASH> 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -637,9 +637,18 @@ function send_temp_file_finished($path) { * @param bool $forcedownload If true (default false), forces download of file rather than view in browser/plugin * @param string $mimetype Include to specify the MIME type; leave blank to have it guess the type from $filename */ -function send_file($path, $filename, $lifetime=86400 , $filter=0, $pathisstring=false, $forcedownload=false, $mimetype='') { +function send_file($path, $filename, $lifetime = 'default' , $filter=0, $pathisstring=false, $forcedownload=false, $mimetype='') { global $CFG, $COURSE, $SESSION; + // MDL-11789, apply $CFG->filelifetime here + if ($lifetime === 'default') { + if (!empty($CFG->filelifetime)) { + $filetime = $CFG->filelifetime; + } else { + $filetime = 86400; + } + } + session_write_close(); // unlock session during fileserving // Use given MIME type if specified, otherwise guess it using mimeinfo.
MDL-<I>, apply $CFG->filelifetime in send_file function.
moodle_moodle
train
php
26ffb584647d23830b4dd356f3b3183028656c4f
diff --git a/span_context.go b/span_context.go index <HASH>..<HASH> 100644 --- a/span_context.go +++ b/span_context.go @@ -74,7 +74,14 @@ func NewSpanContext(parent SpanContext) SpanContext { } if parent.TraceIDHi == 0 && parent.TraceID == 0 && parent.SpanID == 0 { - return NewRootSpanContext() + c := NewRootSpanContext() + + // preserve the W3C trace context even if it was not used + if !parent.W3CContext.IsZero() { + c.W3CContext = parent.W3CContext + } + + return c } c := parent.Clone() @@ -107,10 +114,16 @@ func NewSpanContext(parent SpanContext) SpanContext { } func restoreFromW3CTraceContext(trCtx w3ctrace.Context) SpanContext { - if trCtx.IsZero() || sensor.options.disableW3CTraceCorrelation { + if trCtx.IsZero() { return SpanContext{} } + if sensor.options.disableW3CTraceCorrelation { + return SpanContext{ + W3CContext: trCtx, + } + } + parent := trCtx.Parent() traceIDHi, traceIDLo, err := ParseLongID(parent.TraceID)
Ensure W3C trace propagation even if the correlation is disabled
instana_go-sensor
train
go
7411d64ca426cebe424211d14d43341b11b9a575
diff --git a/yt_array.py b/yt_array.py index <HASH>..<HASH> 100644 --- a/yt_array.py +++ b/yt_array.py @@ -634,6 +634,33 @@ class YTArray(np.ndarray): """ return self.in_units(units, equivalence=equivalence, **kwargs) + def to_value(self, units, equivalence=None, **kwargs): + """ + Creates a copy of this array with the data in the supplied + units, and returns it without units. Output is therefore a + bare NumPy array. + + Optionally, an equivalence can be specified to convert to an + equivalent quantity which is not in the same dimensions. All + additional keyword arguments are passed to the equivalency if + necessary. + + Parameters + ---------- + units : Unit object or string + The units you want to get a new quantity in. + equivalence : string, optional + The equivalence you wish to use. To see which + equivalencies are supported for this unitful + quantity, try the :meth:`list_equivalencies` + method. Default: None + + Returns + ------- + NumPy array + """ + return self.in_units(units, equivalence=equivalence, **kwargs).value + def in_base(self, unit_system="cgs"): """ Creates a copy of this array with the data in the specified unit system,
Add to_value method to return quantities without units
yt-project_unyt
train
py
3bef8f77d286ce1bc55406f3d3c98919ff7368ad
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -12,7 +12,7 @@ var from = require('from2') var each = require('stream-each') var uint64be = require('uint64be') var unixify = require('unixify') -var path = require('path') +var path = require('path').posix var messages = require('./lib/messages') var stat = require('./lib/stat') var cursor = require('./lib/cursor')
Fix readdir / on windows (#<I>)
mafintosh_hyperdrive
train
js
3ce46e39be16ad178f33d8dea6b1de4458fc08a4
diff --git a/identify/identify.py b/identify/identify.py index <HASH>..<HASH> 100644 --- a/identify/identify.py +++ b/identify/identify.py @@ -3,7 +3,6 @@ from __future__ import absolute_import from __future__ import unicode_literals import os.path -import re import shlex import string @@ -12,7 +11,6 @@ from identify import interpreters printable = frozenset(string.printable) -WS_RE = re.compile(r'\s+') DIRECTORY = 'directory' SYMLINK = 'symlink' @@ -129,7 +127,7 @@ def _shebang_split(line): except ValueError: # failing that, we'll do a more "traditional" shebang parsing which # just involves splitting by whitespace - return WS_RE.split(line) + return line.split() def parse_shebang(bytesio):
No need to use regular expressions to split by whitespace
chriskuehl_identify
train
py
85f0c50bb48d18727d26c1972f4722c7965175d8
diff --git a/import_export/results.py b/import_export/results.py index <HASH>..<HASH> 100644 --- a/import_export/results.py +++ b/import_export/results.py @@ -53,7 +53,7 @@ class Result(object): def append_failed_row(self, row, error): row_values = [v for (k, v) in row.items()] - row_values.append(error.error.message) + row_values.append(str(error.error)) self.failed_dataset.append(row_values) def increment_row_result_total(self, row_result):
Error in converting exceptions to strings Unless I'm misunderstanding something, the `Exception` class' `message` attribute has been removed in python <I>/<I> (at least according to <URL>`. This caused an error for me when when a `ValueError` was caught during a dry run with `collect_failed_rows=True`. I'm running Python <I>.
django-import-export_django-import-export
train
py
76eecf69abf3e682ad8612ef91d5fc818f7d07fa
diff --git a/src/Console/ApplyMigrationCommand.php b/src/Console/ApplyMigrationCommand.php index <HASH>..<HASH> 100644 --- a/src/Console/ApplyMigrationCommand.php +++ b/src/Console/ApplyMigrationCommand.php @@ -20,7 +20,7 @@ class ApplyMigrationCommand extends AbstractCommand /** * @var string */ - protected $signature = 'search:migrations:migrate {config : The path to the index configuration file}'; + protected $signature = 'elastic:migrations:migrate {config : The path to the index configuration file}'; /** * The console command description. diff --git a/src/Console/CreateMigrationCommand.php b/src/Console/CreateMigrationCommand.php index <HASH>..<HASH> 100644 --- a/src/Console/CreateMigrationCommand.php +++ b/src/Console/CreateMigrationCommand.php @@ -19,7 +19,7 @@ class CreateMigrationCommand extends Command /** * @var string */ - protected $signature = 'search:migrations:create {config : The path to the index configuration file}'; + protected $signature = 'elastic:migrations:create {config : The path to the index configuration file}'; /** * The console command description.
Use the correct command signature namespace in migration commands
digiaonline_lumen-elasticsearch
train
php,php
9fbdbfaf9eb72f29f2244919051b9d7c533ebf17
diff --git a/core/src/main/java/fi/iki/elonen/NanoHTTPD.java b/core/src/main/java/fi/iki/elonen/NanoHTTPD.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/fi/iki/elonen/NanoHTTPD.java +++ b/core/src/main/java/fi/iki/elonen/NanoHTTPD.java @@ -833,7 +833,7 @@ public abstract class NanoHTTPD { StringBuilder postLineBuffer = new StringBuilder(); char pbuf[] = new char[512]; int read = in.read(pbuf); - while (read >= 0 && !postLine.endsWith("\r\n")) { + while (read >= 0) { postLine = String.valueOf(pbuf, 0, read); postLineBuffer.append(postLine); read = in.read(pbuf);
Fix potential truncating of POST body. Closes #<I>
NanoHttpd_nanohttpd
train
java
350c893ead29397fc59b0ceceb2bb1025c6b6c35
diff --git a/src/structures/GuildMember.js b/src/structures/GuildMember.js index <HASH>..<HASH> 100644 --- a/src/structures/GuildMember.js +++ b/src/structures/GuildMember.js @@ -316,6 +316,17 @@ class GuildMember { return this.client.rest.methods.banGuildMember(this.guild, this, deleteDays); } + /** + * When concatenated with a string, this automatically concatenates the User's mention instead of the Member object. + * @returns {string} + * @example + * // logs: Hello from <@123456789>! + * console.log(`Hello from ${member}!`); + */ + toString() { + return `<@${this.user.id}>`; + } + // These are here only for documentation purposes - they are implemented by TextBasedChannel sendMessage() { return; } sendTTSMessage() { return; }
Add GuildMember.toString
discordjs_discord.js
train
js
e77e21a4a2684893fe2e5de22677ff6a3a8006c3
diff --git a/Slim/Slim.php b/Slim/Slim.php index <HASH>..<HASH> 100644 --- a/Slim/Slim.php +++ b/Slim/Slim.php @@ -910,41 +910,6 @@ class Slim } /******************************************************************************** - * Flash Messages - *******************************************************************************/ - - /** - * DEPRECATED - * Set flash message for subsequent request - * @param string $key - * @param mixed $value - */ - public function flash($key, $value) - { - $this->flash->next($key, $value); - } - - /** - * DEPRECATED - * Set flash message for current request - * @param string $key - * @param mixed $value - */ - public function flashNow($key, $value) - { - $this->flash->now($key, $value); - } - - /** - * DEPRECATED - * Keep flash messages from previous request for subsequent request - */ - public function flashKeep() - { - $this->flash->keep(); - } - - /******************************************************************************** * Hooks *******************************************************************************/
Remove obsolete flash methods from \Slim\Slim
slimphp_Slim
train
php
9fc800a37af532b5fb7101252b23e7d977855d53
diff --git a/more_itertools/more.py b/more_itertools/more.py index <HASH>..<HASH> 100644 --- a/more_itertools/more.py +++ b/more_itertools/more.py @@ -803,7 +803,7 @@ def interleave_longest(*iterables): """ i = chain.from_iterable(zip_longest(*iterables, fillvalue=_marker)) - return filter(lambda x: x is not _marker, i) + return (x for x in i if x is not _marker) def collapse(iterable, base_type=None, levels=None):
Use genexp instead of filter (for PyPy)
erikrose_more-itertools
train
py
118ae70ba873423775aeb74f303da41d97aba6e6
diff --git a/lib/waterline/query/finders/basic.js b/lib/waterline/query/finders/basic.js index <HASH>..<HASH> 100644 --- a/lib/waterline/query/finders/basic.js +++ b/lib/waterline/query/finders/basic.js @@ -52,7 +52,7 @@ module.exports = { // Normalize criteria // criteria = normalize.criteria(criteria); - criteria = normalizeCriteria(criteria); + criteria = normalizeCriteria(criteria, this.identity, this.waterline); // Return Deferred or pass to adapter if (typeof cb !== 'function') { diff --git a/lib/waterline/utils/normalize-criteria.js b/lib/waterline/utils/normalize-criteria.js index <HASH>..<HASH> 100644 --- a/lib/waterline/utils/normalize-criteria.js +++ b/lib/waterline/utils/normalize-criteria.js @@ -40,7 +40,12 @@ var getModel = require('./get-model'); * * -- * - * @param {Ref} criteria [The original criteria (i.e. from a "stage 1 query")] + * @param {Ref} criteria + * The original criteria (i.e. from a "stage 1 query"). + * > WARNING: + * > IN SOME CASES (BUT NOT ALL!), THE PROVIDED CRITERIA WILL + * > UNDERGO DESTRUCTIVE, IN-PLACE CHANGES JUST BY PASSING IT + * > IN TO THIS UTILITY. * * @param {String?} modelIdentity * The identity of the model this criteria is referring to (e.g. "pet" or "user")
Update findOne to call normalizeCriteria properly (it really should be switched to using forgePhaseTwoQuery(), but will come back to that). This commit also adds a loud warning comment in the fireworks atop normalizeCriteria() to make it clear that the provided criteria may be (but not necessarily _will_ be) mutated in-place.
balderdashy_waterline
train
js,js
db87a1410196c98480cd207f4d8f010d67813a69
diff --git a/tinytag/__init__.py b/tinytag/__init__.py index <HASH>..<HASH> 100644 --- a/tinytag/__init__.py +++ b/tinytag/__init__.py @@ -4,7 +4,7 @@ from .tinytag import TinyTag, TinyTagException, ID3, Ogg, Wave, Flac import sys -__version__ = '0.15.0' +__version__ = '0.15.2' if __name__ == '__main__': print(TinyTag.get(sys.argv[1])) \ No newline at end of file
bumped version to <I>
devsnd_tinytag
train
py
0db5eed14d19b9439050222fec401bfa87fc78a8
diff --git a/is-master.js b/is-master.js index <HASH>..<HASH> 100644 --- a/is-master.js +++ b/is-master.js @@ -73,7 +73,13 @@ im.prototype.mongooseInit = function() { } }); - this.imModel = mongoose.model(this.collection, imSchema); + // ensure we aren't attempting to redefine a collection that already exists + if(mongoose.models.hasOwnProperty(this.collection)){ + this.imModel = mongoose.model(this.collection); + }else{ + this.imModel = mongoose.model(this.collection, imSchema); + } + this.worker = new this.imModel({ hostname: this.hostname, pid: this.pid,
Adding some logic to handle pre-existing models
mattpker_node-is-master
train
js
c74772aa44fd1c7d22ba63318c1e46243e8de405
diff --git a/lib/specinfra/command/windows.rb b/lib/specinfra/command/windows.rb index <HASH>..<HASH> 100644 --- a/lib/specinfra/command/windows.rb +++ b/lib/specinfra/command/windows.rb @@ -203,13 +203,18 @@ module SpecInfra end end - def check_windows_feature_enabled(name) - - Backend::PowerShell::Command.new do - using 'list_windows_features.ps1' - exec "@(ListWindowsFeatures | Where-Object {($_.name -eq '#{name}') -and ($_.State -eq 'enabled')}).count -gt 0" - end + def check_windows_feature_enabled(name,provider) + if provider.nil? + cmd = "@(ListWindowsFeatures -feature #{name}).count -gt 0" + else + cmd = "@(ListWindowsFeatures -feature #{name} -provider #{provider}).count -gt 0" + end + + Backend::PowerShell::Command.new do + using 'list_windows_features.ps1' + exec cmd + end end private
take into account function calls with/without provider
mizzy_specinfra
train
rb
915e1489adb11d0a13f57de11531d94c13ca3ea1
diff --git a/config/application.rb b/config/application.rb index <HASH>..<HASH> 100644 --- a/config/application.rb +++ b/config/application.rb @@ -111,11 +111,6 @@ class Application < Rails::Application extension_loader.load_extensions extension_loader.load_extension_initalizers - - Dir["#{TRUSTY_CMS_ROOT}/config/initializers/**/*.rb"].sort.each do |initializer| - load(initializer) - end - extension_loader.activate_extensions # also calls initialize_views #config.add_controller_paths(extension_loader.paths(:controller)) #config.add_eager_load_paths(extension_loader.paths(:eager_load))
This seems to be loading initializers twice Which the config stuff doesn't like very much :( I've tried trusty_blank without this, and it seems to be working okay...
pgharts_trusty-cms
train
rb
0f05ca476b2f4eed5308dae4f06fa15cf8c371b6
diff --git a/coconut/root.py b/coconut/root.py index <HASH>..<HASH> 100644 --- a/coconut/root.py +++ b/coconut/root.py @@ -23,10 +23,10 @@ import sys as _coconut_sys # VERSION: # ----------------------------------------------------------------------------------------------------------------------- -VERSION = "1.3.1" -VERSION_NAME = "Dead Parrot" +VERSION = "1.4.0" +VERSION_NAME = "Ernest Scribbler" # False for release, int >= 1 for develop -DEVELOP = 29 +DEVELOP = False # ----------------------------------------------------------------------------------------------------------------------- # CONSTANTS:
Set version to <I> [Ernest Scribbler]
evhub_coconut
train
py
ac5c807ffb1a99ed319031f4ff83c01cc71995c6
diff --git a/src/Sitemap.php b/src/Sitemap.php index <HASH>..<HASH> 100644 --- a/src/Sitemap.php +++ b/src/Sitemap.php @@ -57,7 +57,7 @@ class Sitemap implements Responsable { sort($this->tags); - $tags = collect($this->tags)->unique('url'); + $tags = collect($this->tags)->unique('url')->filter(); return view('laravel-sitemap::sitemap') ->with(compact('tags'))
Update Sitemap.php (#<I>) For some reason there are empty tags in the array, which results in the error: Call to a member function getType() on null The ->filter() method makes sure there are never empty tags in the view.
spatie_laravel-sitemap
train
php
915cf0a004b09d567acdda81b39ce21123412826
diff --git a/revision_store.py b/revision_store.py index <HASH>..<HASH> 100644 --- a/revision_store.py +++ b/revision_store.py @@ -306,7 +306,7 @@ class AbstractRevisionStore(object): if len(parents): validator, new_inv = self.repo.add_inventory_by_delta(parents[0], inv_delta, revision_id, parents, basis_inv=basis_inv, - propagate_caches=True) + propagate_caches=False) else: new_inv = basis_inv.create_by_apply_delta(inv_delta, revision_id) validator = self.repo.add_inventory(revision_id, new_inv, parents)
back out cache propagation until more reliable
jelmer_python-fastimport
train
py
f6cf630c02661161eeccf292531a020f2818955e
diff --git a/test/integration/test.alchemy_vision.js b/test/integration/test.alchemy_vision.js index <HASH>..<HASH> 100644 --- a/test/integration/test.alchemy_vision.js +++ b/test/integration/test.alchemy_vision.js @@ -8,11 +8,11 @@ var authHelper = require('./auth_helper.js'); var auth = authHelper.auth; var describe = authHelper.describe; // this runs describe.skip if there is no auth.js file :) -var TWENTY_SECONDS = 20000; +var TWO_MINUTES = 2*60*10000; var TWO_SECONDS = 2000; describe('alchemy_vision_integration', function() { - this.timeout(TWENTY_SECONDS); + this.timeout(TWO_MINUTES); this.slow(TWO_SECONDS); // this controls when the tests get a colored warning for taking too long this.retries(1);
bumping time allowed for alchemy vision tests, since <I> seconds doesn't seem to be sufficient in some cases
watson-developer-cloud_node-sdk
train
js
018bfb261391caff947fc66768c08a40a395f043
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( name='budoc', version='0.1', url='http://github.com/zeaphoo/budoc/', - download_url='http://github.com/zeaphoo/cocopot/budoc/0.1', + download_url='http://github.com/zeaphoo/budoc/tarball/0.1', license='BSD', author='zeaphoo', author_email='zeaphoo@gmail.com', @@ -28,7 +28,7 @@ setup( 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Intended Audience :: Developers', - 'License :: OSI Approved :: BSD License', + 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3',
change setup config for release <I>
zeaphoo_budoc
train
py
c284adc37368718ed9181b79e8e6679d1ae78c90
diff --git a/src/FileContainer.php b/src/FileContainer.php index <HASH>..<HASH> 100644 --- a/src/FileContainer.php +++ b/src/FileContainer.php @@ -140,6 +140,14 @@ class FileContainer implements \Serializable } /** + * @return boolean + */ + protected function isNewFile() + { + return $this->isNewFile; + } + + /** * @return Api */ private function getApi() @@ -150,12 +158,4 @@ class FileContainer implements \Serializable return $this->api; } - - /** - * @return boolean - */ - protected function isNewFile() - { - return $this->isNewFile; - } }
Order FileContainer methods by visibility
kgilden_php-digidoc
train
php
4e4c0574cdd3689d22e2e7d03521cb82179e0909
diff --git a/airflow/www/views.py b/airflow/www/views.py index <HASH>..<HASH> 100644 --- a/airflow/www/views.py +++ b/airflow/www/views.py @@ -5318,6 +5318,31 @@ class CustomUserDBModelView(MultiResourceUserMixin, UserDBModelView): class CustomUserLDAPModelView(MultiResourceUserMixin, UserLDAPModelView): """Customize permission names for FAB's builtin UserLDAPModelView.""" + _class_permission_name = permissions.RESOURCE_USER + + class_permission_name_mapping = { + 'userinfoedit': permissions.RESOURCE_MY_PROFILE, + 'userinfo': permissions.RESOURCE_MY_PROFILE, + } + + method_permission_name = { + 'add': 'create', + 'userinfo': 'read', + 'download': 'read', + 'show': 'read', + 'list': 'read', + 'edit': 'edit', + 'userinfoedit': 'edit', + 'delete': 'delete', + } + + base_permissions = [ + permissions.ACTION_CAN_CREATE, + permissions.ACTION_CAN_READ, + permissions.ACTION_CAN_EDIT, + permissions.ACTION_CAN_DELETE, + ] + class CustomUserOAuthModelView(MultiResourceUserMixin, UserOAuthModelView): """Customize permission names for FAB's builtin UserOAuthModelView."""
Add possibility to create users in LDAP mode (#<I>) * Add possibility to create users in LDAP mode
apache_airflow
train
py
befe9fc58f7b6de34043bfe9adc11b0cd1e10c8c
diff --git a/src/main/java/codearea/skin/MyListView.java b/src/main/java/codearea/skin/MyListView.java index <HASH>..<HASH> 100644 --- a/src/main/java/codearea/skin/MyListView.java +++ b/src/main/java/codearea/skin/MyListView.java @@ -87,7 +87,7 @@ class MyListView<T> extends ListView<T> { * (for measurement purposes) and shall not be stored. */ public ListCell<T> getCell(int index) { - return withFlow(flow -> flow.getCell(index), null); + return withFlow(flow -> flow.getCell(index), (ListCell<T>) null); } private static <C extends IndexedCell<?>> void showAsFirst(VirtualFlow<C> flow, int index) {
Help Eclipse JDT with type inference.
FXMisc_RichTextFX
train
java
ce2d5b9be176a4d4540d5a342e080f7bf3476695
diff --git a/Resources/public/js/tool/calendar.js b/Resources/public/js/tool/calendar.js index <HASH>..<HASH> 100644 --- a/Resources/public/js/tool/calendar.js +++ b/Resources/public/js/tool/calendar.js @@ -115,7 +115,7 @@ monthNames: [t('january'), t('february'), t('march'), t('april'), t('may'), t('june'), t('july'), t('august'), t('september'), t('october'), t('november'), t('december')], monthNamesShort: [t('jan'), t('feb'), t('mar'), t('apr'), t('may'), t('ju'), t('jul'), - t('aug'), t('sept'), t('nov'), t('dec')], + t('aug'), t('sept'), t('oct'), t('nov'), t('dec')], dayNames: [ t('sunday'),t('monday'), t('tuesday'), t('wednesday'), t('thursday'), t('friday'), t('saturday')], dayNamesShort: [ t('sun'), t('mon'), t('tue'), t('wed'), t('thu'), t('fri'), t('sat')], editable: true,
Fixing calendar short months short name.
claroline_CoreBundle
train
js
6258cd0da6d9551bf5d6896909bbe94664ea3925
diff --git a/lib/nexpose/device.rb b/lib/nexpose/device.rb index <HASH>..<HASH> 100644 --- a/lib/nexpose/device.rb +++ b/lib/nexpose/device.rb @@ -208,7 +208,7 @@ module Nexpose # object. def self.parse_json(json) new do - @id = json['id'].to_i + @id = json['assetID'].to_i @ip = json['ipAddress'] @host_name = json['hostName'] @os = json['operatingSystem']
#<I>: Fixed parsing of completed asset response to use correct asset ID
rapid7_nexpose-client
train
rb
bedc236045660fc3cef1d6c0c24f04d0ddb4a81d
diff --git a/tests/support/helpers.py b/tests/support/helpers.py index <HASH>..<HASH> 100644 --- a/tests/support/helpers.py +++ b/tests/support/helpers.py @@ -209,7 +209,10 @@ def flaky(caller=None, condition=True): return caller(cls) except Exception as exc: if attempt >= 3: - raise exc + if six.PY2: + raise + else: + raise exc backoff_time = attempt ** 2 log.info( 'Found Exception. Waiting %s seconds to retry.',
Handling in flaky when maximum number of attempts raised and the exception should be raised. Different approaches depending on Py2 vs Py3.
saltstack_salt
train
py
e479bc27d9e8de7a9a7827490b7a4496576c19ef
diff --git a/hive/src/main/java/org/elasticsearch/hadoop/hive/HiveFieldExtractor.java b/hive/src/main/java/org/elasticsearch/hadoop/hive/HiveFieldExtractor.java index <HASH>..<HASH> 100644 --- a/hive/src/main/java/org/elasticsearch/hadoop/hive/HiveFieldExtractor.java +++ b/hive/src/main/java/org/elasticsearch/hadoop/hive/HiveFieldExtractor.java @@ -65,7 +65,7 @@ public class HiveFieldExtractor extends ConstantFieldExtractor { // replace column name with _colX (which is what Hive uses during serialization) fieldName = columnNames.get(getFieldName().toLowerCase(Locale.ENGLISH)); - if (!StringUtils.hasText(fieldName)) { + if (!settings.getInputAsJson() && !StringUtils.hasText(fieldName)) { throw new EsHadoopIllegalArgumentException( String.format( "Cannot find field [%s] in mapping %s ; maybe a value was specified without '<','>' or there is a typo?",
[HIVE] Validate field extraction Double check JSON input (which has a different schema) Relates #<I>
elastic_elasticsearch-hadoop
train
java
c6f1626cb5ddbd249e49bc9963b9e0ed723b2b0a
diff --git a/Classes/Lib/Searchphrase.php b/Classes/Lib/Searchphrase.php index <HASH>..<HASH> 100644 --- a/Classes/Lib/Searchphrase.php +++ b/Classes/Lib/Searchphrase.php @@ -33,7 +33,7 @@ class Searchphrase /** * @var Pluginbase */ - protected $pObj; + public $pObj; /** * initializes this object
feat: make pluginbase accessible in searchphrase hooks
teaminmedias-pluswerk_ke_search
train
php
fbcf105de49a01dc693f0a69e25e6a5af537f7dd
diff --git a/config/projects/chef-windows.rb b/config/projects/chef-windows.rb index <HASH>..<HASH> 100644 --- a/config/projects/chef-windows.rb +++ b/config/projects/chef-windows.rb @@ -36,13 +36,10 @@ end package_name "chef-client" -override :chef, version: "lcg/ffi-yajl-gem" -override :ohai, version: "lcg/ffi-yajl-gem" override :rubygems, version: "1.8.29" dependency "preparation" dependency "ffi-yajl" -dependency "ohai" dependency "chef-windows" resources_path File.join(files_path, "chef") diff --git a/config/projects/chef.rb b/config/projects/chef.rb index <HASH>..<HASH> 100644 --- a/config/projects/chef.rb +++ b/config/projects/chef.rb @@ -34,12 +34,9 @@ install_path "/opt/chef" resources_path File.join(files_path, "chef") mac_pkg_identifier "com.getchef.pkg.chef" -override :chef, version: "lcg/ffi-yajl-gem" -override :ohai, version: "lcg/ffi-yajl-gem" override :rubygems, version: "1.8.29" dependency "preparation" dependency "ffi-yajl" -dependency "ohai" dependency "chef" dependency "version-manifest"
ffi-yajl merged to master in chef+ohai now
chef_chef
train
rb,rb
ac4fe97919cf2a25bfa5018fc45d120ff490d558
diff --git a/src/js/floats.js b/src/js/floats.js index <HASH>..<HASH> 100644 --- a/src/js/floats.js +++ b/src/js/floats.js @@ -98,7 +98,7 @@ ch.floats = function () { } // Classname with component type and extra classes from conf.classes - container.push(" class=\"ch-" + that.type + (ch.utils.hasOwn(conf, "classes") ? " " + conf.classes : "") + "\""); + container.push(" class=\"ch-hide ch-" + that.type + (ch.utils.hasOwn(conf, "classes") ? " " + conf.classes : "") + "\""); // Z-index container.push(" style=\"z-index:" + (ch.utils.zIndex += 1) + ";");
#<I> Floats: The first time that it shows, effects don't work.
mercadolibre_chico
train
js
16d199e72d095e6d51f439a0cf76152f7c8e74ce
diff --git a/test/e2e/nightwatch.conf.js b/test/e2e/nightwatch.conf.js index <HASH>..<HASH> 100644 --- a/test/e2e/nightwatch.conf.js +++ b/test/e2e/nightwatch.conf.js @@ -1,7 +1,5 @@ require('@babel/register'); -console.log('port', process.env.PORT); - // http://nightwatchjs.org/getingstarted#settings-file module.exports = { src_folders: ['test/e2e/specs'], @@ -20,13 +18,17 @@ module.exports = { cli_args: { 'webdriver.chrome.driver': require('chromedriver').path, }, + request_timeout_options: { + timeout: 30000, + retry_attempts: 2, + }, }, test_settings: { default: { selenium_port: 4444, selenium_host: 'localhost', - silent: true, + silent: false, globals: { devServerURL: `http://localhost:${process.env.PORT}` || 3000, },
test(nightwatch.config.js): add to config, turn on verbose logging
rei_rei-cedar
train
js
73c8ce727eaedc8148068d36fbb792d992dbcc13
diff --git a/sdu_bkjws/__init__.py b/sdu_bkjws/__init__.py index <HASH>..<HASH> 100644 --- a/sdu_bkjws/__init__.py +++ b/sdu_bkjws/__init__.py @@ -115,3 +115,18 @@ class SduBkjws(object): return self._raw_past_score else: raise Exception(response, 'unexpected error please create a issue on GitHub') + + @_keep_live + def get_past_score(self): + """ + :type: list + :return: + """ + + response = self.get_raw_past_score() + score_list = response['object']['aaData'] + # parsed_list = [] + # for obj in score_list: + # parsed_list.append({}) + # print(score_list[1:3]) + return score_list
feat(past score): new api to get past score get_past_score()->list of score dicts
Trim21_sdu_bkjws
train
py
e14c3c438dea612fa7b1d3f0a494028d6860e3e7
diff --git a/tool/sdg/src/main/java/org/openscience/cdk/layout/AtomPlacer.java b/tool/sdg/src/main/java/org/openscience/cdk/layout/AtomPlacer.java index <HASH>..<HASH> 100644 --- a/tool/sdg/src/main/java/org/openscience/cdk/layout/AtomPlacer.java +++ b/tool/sdg/src/main/java/org/openscience/cdk/layout/AtomPlacer.java @@ -896,6 +896,10 @@ public class AtomPlacer { //path += ac.getAtom(f).getSymbol(); degreeSum += superAC.getConnectedBondsCount(ac.getAtom(f)); + + Integer implH = ac.getAtom(f).getImplicitHydrogenCount(); + if (implH != null) + degreeSum += implH; } //System.out.println(path + ": " + degreeSum); return degreeSum;
Include hydrogens when counting degree. In practice this means carboxylic groups are always placed with the carbonyl pointing up or down when at the end of a chain.
cdk_cdk
train
java
f391eceef89729ab45b433c6666b922d6b14280c
diff --git a/public/javascripts/activation_key.js b/public/javascripts/activation_key.js index <HASH>..<HASH> 100644 --- a/public/javascripts/activation_key.js +++ b/public/javascripts/activation_key.js @@ -45,6 +45,21 @@ $(document).ready(function() { }); } }); + + $('#update_subscriptions').live('submit', function(e) { + e.preventDefault(); + var button = $(this).find('input[type|="submit"]'); + button.attr("disabled","disabled"); + $(this).ajaxSubmit({ + success: function(data) { + button.removeAttr('disabled'); + notices.checkNotices(); + }, error: function(e) { + button.removeAttr('disabled'); + notices.checkNotices(); + }}); + }); + }); var activation_key = (function() {
ajax call to update akey subscriptions
Katello_katello
train
js
2de61f517c2a84e66f1d3872b7a5bc5d84516a59
diff --git a/dallinger/deployment.py b/dallinger/deployment.py index <HASH>..<HASH> 100644 --- a/dallinger/deployment.py +++ b/dallinger/deployment.py @@ -406,7 +406,12 @@ class DebugDeployment(HerokuLocalDeployment): dashboard_url = self.with_proxy_port("{}/dashboard/".format(base_url)) self.display_dashboard_access_details(dashboard_url) if not self.no_browsers: - self.open_dashboard(dashboard_url) + self.async_open_dashboard(dashboard_url) + + # A little delay here ensures that the experiment window always opens + # after the dashboard window. + time.sleep(0.1) + self.heroku = heroku self.out.log( "Monitoring the Heroku Local server for recruitment or completion..." @@ -443,6 +448,11 @@ class DebugDeployment(HerokuLocalDeployment): ) ) + def async_open_dashboard(self, url): + threading.Thread( + target=self.open_dashboard, name="Open dashboard", kwargs={"url": url} + ).start() + def open_dashboard(self, url): config = get_config() self.out.log("Opening dashboard")
Open dashboard window asynchronously (#<I>) Modified `dallinger debug` to open the dashboard asynchronously.
Dallinger_Dallinger
train
py
6c05fe874ebda09b6a17239c43849c0efe7c84c4
diff --git a/tests/Integration/Database/EloquentRelationshipsTest.php b/tests/Integration/Database/EloquentRelationshipsTest.php index <HASH>..<HASH> 100644 --- a/tests/Integration/Database/EloquentRelationshipsTest.php +++ b/tests/Integration/Database/EloquentRelationshipsTest.php @@ -124,15 +124,13 @@ class CustomPost extends Post protected function newBelongsToMany(Builder $query, Model $parent, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKey, $relationName = null - ) - { + ) { return new CustomBelongsToMany($query, $parent, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKey, $relationName); } protected function newHasManyThrough(Builder $query, Model $farParent, Model $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey - ) - { + ) { return new CustomHasManyThrough($query, $farParent, $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey); } }
HasManyThrough override
laravel_framework
train
php
8d0d63d246c1a2ee404eac402648b6dbc7bbeb15
diff --git a/tests/Formatter/PostalFormatterTest.php b/tests/Formatter/PostalFormatterTest.php index <HASH>..<HASH> 100644 --- a/tests/Formatter/PostalFormatterTest.php +++ b/tests/Formatter/PostalFormatterTest.php @@ -5,7 +5,6 @@ namespace CommerceGuys\Addressing\Tests\Formatter; use CommerceGuys\Addressing\Model\Address; use CommerceGuys\Addressing\Formatter\PostalFormatter; use CommerceGuys\Addressing\Provider\DataProvider; -use CommerceGuys\Addressing\Provider\DataProviderInterface; /** * @coversDefaultClass \CommerceGuys\Addressing\Formatter\PostalFormatter @@ -15,7 +14,7 @@ class PostalFormatterTest extends \PHPUnit_Framework_TestCase /** * The data provider. * - * @var DataProviderInterface + * @var DataProvider */ protected $dataProvider;
Clean up docblock in PostalFormatterTest, remove unneeded use statement.
commerceguys_addressing
train
php
ef13f199d20b655abb043b031b321c2f9180e3fa
diff --git a/lib/sensu/client.rb b/lib/sensu/client.rb index <HASH>..<HASH> 100644 --- a/lib/sensu/client.rb +++ b/lib/sensu/client.rb @@ -68,17 +68,21 @@ module Sensu end end + def find_attribute_with_default(configTree, path, default) + pathElement = path.shift() + attribute = configTree[pathElement] + if attribute.is_a?(Hash) and path.length > 0 + find_attribute_with_default(attribute, path, default) + else + attribute.nil? ? default : attribute + end + end + def substitute_command_tokens(check) unmatched_tokens = Array.new - substituted = check[:command].gsub(/:::([^:]*?):::/) do + substituted = check[:command].gsub(/:::([^:].*?):::/) do token, default = $1.to_s.split('|', -1) - matched = token.split('.').inject(@settings[:client]) do |client, attribute| - if client[attribute].nil? - default.nil? ? break : default - else - client[attribute] - end - end + matched = find_attribute_with_default(@settings[:client], token.split('.'), default) if matched.nil? unmatched_tokens << token end
proposed fix for issue <URL>
sensu_sensu
train
rb
5897898fd031db0e3ab68294e02f58acc6acf5d8
diff --git a/packages/cli/lib/lib/output-hooks.js b/packages/cli/lib/lib/output-hooks.js index <HASH>..<HASH> 100644 --- a/packages/cli/lib/lib/output-hooks.js +++ b/packages/cli/lib/lib/output-hooks.js @@ -3,11 +3,19 @@ const HOOKS = [ test: /^total precache size /i, handler: text => `\n \u001b[32m${text}\u001b[39m`, }, + { + test: /DeprecationWarning/, + handler: () => false + } ]; function wrap(stream, handler) { let write = stream.write; - stream.write = text => write.call(stream, handler(text)); + stream.write = text => { + const transformed = handler(text); + if (transformed === false) return; + return write.call(stream, transformed); + }; return () => { stream.write = write; };
Silence DeprecationWarning (#<I>) A DeprecationWarning message from some plugin (not sure which) breaks our nice progress meter and looks bad. This turns it off.
developit_preact-cli
train
js
a3956e7be36cabc75fef0b35e060ef6718cfb47a
diff --git a/src/test/java/com/cloudbees/jenkins/support/SupportActionTest.java b/src/test/java/com/cloudbees/jenkins/support/SupportActionTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/cloudbees/jenkins/support/SupportActionTest.java +++ b/src/test/java/com/cloudbees/jenkins/support/SupportActionTest.java @@ -102,7 +102,7 @@ public class SupportActionTest { HtmlPage p = wc.goTo(root.getUrlName()); HtmlForm form = p.getFormByName("bundle-contents"); - HtmlButton submit = (HtmlButton) form.getHtmlElementsByTagName("button").get(0); + HtmlButton submit = (HtmlButton) form.getElementsByTagName("button").get(0); Page zip = submit.click(); File zipFile = File.createTempFile("test", "zip"); IOUtils.copy(zip.getWebResponse().getContentAsStream(), Files.newOutputStream(zipFile.toPath()));
[JENKINS-<I>] Fix removed API usage in test The method was renamed.
jenkinsci_support-core-plugin
train
java
688d773e930ae556fbd06927f15f48ed50093fc2
diff --git a/widget_tweaks/templatetags/widget_tweaks.py b/widget_tweaks/templatetags/widget_tweaks.py index <HASH>..<HASH> 100644 --- a/widget_tweaks/templatetags/widget_tweaks.py +++ b/widget_tweaks/templatetags/widget_tweaks.py @@ -181,7 +181,10 @@ class FieldAttributeNode(Node): bounded_field = append_attr(bounded_field, 'class:%s' % context['WIDGET_REQUIRED_CLASS']) for k, v in self.set_attrs: - bounded_field = set_attr(bounded_field, '%s:%s' % (k,v.resolve(context))) + if k == 'type': + bounded_field.field.widget.input_type = v.resolve(context) + else: + bounded_field = set_attr(bounded_field, '%s:%s' % (k,v.resolve(context))) for k, v in self.append_attrs: bounded_field = append_attr(bounded_field, '%s:%s' % (k,v.resolve(context))) return bounded_field
Fix #<I>: Just tested in Django <I>
jazzband_django-widget-tweaks
train
py
72697dcd1158adb3aeb266015d8f7a368324fb4b
diff --git a/core/src/main/java/com/orientechnologies/orient/core/db/document/ODatabaseDocumentTx.java b/core/src/main/java/com/orientechnologies/orient/core/db/document/ODatabaseDocumentTx.java index <HASH>..<HASH> 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/db/document/ODatabaseDocumentTx.java +++ b/core/src/main/java/com/orientechnologies/orient/core/db/document/ODatabaseDocumentTx.java @@ -496,8 +496,26 @@ public class ODatabaseDocumentTx extends OListenerManger<ODatabaseListener> impl listener.onCreate(this); } catch (Throwable ignore) { } - } catch (Exception e) { + // REMOVE THE (PARTIAL) DATABASE + try { + drop(); + } catch (Exception ex) { + // IGNORE IT + } + + // DELETE THE STORAGE TOO + try { + if (storage == null) + storage = Orient.instance().loadStorage(url); + storage.delete(); + } catch (Exception ex) { + // IGNORE IT + } + + status = STATUS.CLOSED; + owner.set(null); + throw OException.wrapException(new ODatabaseException("Cannot create database '" + getName() + "'"), e); } return (DB) this;
Core: if the database cannot be created because an exception, now even if partially created, it's drop
orientechnologies_orientdb
train
java
d9019ed529b17018193e740983a850b2e48e2b13
diff --git a/ga4gh/frontend.py b/ga4gh/frontend.py index <HASH>..<HASH> 100644 --- a/ga4gh/frontend.py +++ b/ga4gh/frontend.py @@ -28,6 +28,8 @@ import ga4gh.datamodel as datamodel import ga4gh.protocol as protocol import ga4gh.exceptions as exceptions import ga4gh.datarepo as datarepo +import logging +from logging import StreamHandler MIMETYPE = "application/json" @@ -188,6 +190,9 @@ def configure(configFile=None, baseConfig="ProductionConfig", TODO Document this critical function! What does it do? What does it assume? """ + file_handler = StreamHandler() + file_handler.setLevel(logging.WARNING) + app.logger.addHandler(file_handler) configStr = 'ga4gh.serverconfig:{0}'.format(baseConfig) app.config.from_object(configStr) if os.environ.get('GA4GH_CONFIGURATION') is not None: @@ -340,7 +345,7 @@ def handleException(exception): Handles an exception that occurs somewhere in the process of handling a request. """ - if app.config['DEBUG']: + with app.test_request_context(): app.log_exception(exception) serverException = exception if not isinstance(exception, exceptions.BaseServerException):
added logger to output exception information when flask debugger is off
ga4gh_ga4gh-server
train
py
c7831322dec2ec7b1a1c0f13facd7d65306f2ccc
diff --git a/lib/Packager/lib/process-assets-stream/process-assets-stream.js b/lib/Packager/lib/process-assets-stream/process-assets-stream.js index <HASH>..<HASH> 100644 --- a/lib/Packager/lib/process-assets-stream/process-assets-stream.js +++ b/lib/Packager/lib/process-assets-stream/process-assets-stream.js @@ -147,11 +147,13 @@ proto.resolveBundleAssets = function (bundle) { return entry.assets && entry.assets.length; }).forEach(function (entry) { entry.assets.forEach(function (file) { + var out = outfileSource(file, entry, opts, true); + out = out.replace(/\.\.\//g, ''); assets.push({ source: file, outfile: path.join( opts.outDir, - outfileSource(file, entry, opts, true) + out ), copy: true, mtime: entry.mtime[file]
ENYO-<I>: Asset deployment encounters incorrect destination locations with absolute paths
enyojs_enyo-dev
train
js
27cf9bff4d2a34c7a86519705edb051346ef9f69
diff --git a/tests/test-timber-site.php b/tests/test-timber-site.php index <HASH>..<HASH> 100644 --- a/tests/test-timber-site.php +++ b/tests/test-timber-site.php @@ -9,6 +9,12 @@ class TestTimberSite extends Timber_UnitTestCase { $this->assertEquals( $content_subdir.'/themes/twentyfifteen', $site->theme->path ); } + function testLanguageAttributes() { + $site = new TimberSite(); + $lang = $site->language_attributes(); + $this->assertEquals('lang="en-US"', $lang); + } + function testChildParentThemeLocation() { TestTimberLoader::_setupChildTheme(); $content_subdir = Timber\URLHelper::get_content_subdir();
Test to cover Site::language_attributes();
timber_timber
train
php
57dcc99d065bff70c136944669ef0c8620837cb6
diff --git a/lib/simple_form/action_view_extensions/form_helper.rb b/lib/simple_form/action_view_extensions/form_helper.rb index <HASH>..<HASH> 100644 --- a/lib/simple_form/action_view_extensions/form_helper.rb +++ b/lib/simple_form/action_view_extensions/form_helper.rb @@ -60,7 +60,7 @@ module SimpleForm elsif record.is_a?(String) || record.is_a?(Symbol) as || record else - record = record.last if record.is_a?(Array) + record = record.last if record.respond_to?(:last) action = record.respond_to?(:persisted?) && record.persisted? ? :edit : :new as ? "#{action}_#{as}" : dom_class(record, action) end
let's check for responding to :last method instead of checking class
plataformatec_simple_form
train
rb
8a5d163deb6ba72461e47685880da8c00ab9fba0
diff --git a/ast.go b/ast.go index <HASH>..<HASH> 100644 --- a/ast.go +++ b/ast.go @@ -1117,10 +1117,15 @@ func (s *SelectStatement) validateAggregates(tr targetRequirement) error { return fmt.Errorf("invalid number of arguments for %s, expected at least %d, got %d", c.Name, exp, got) } if len(c.Args) > 1 { - _, ok := c.Args[len(c.Args)-1].(*NumberLiteral) + callLimit, ok := c.Args[len(c.Args)-1].(*NumberLiteral) if !ok { return fmt.Errorf("expected integer as last argument in %s(), found %s", c.Name, c.Args[len(c.Args)-1]) } + // Check if they asked for a limit smaller than what they passed into the call + if int64(callLimit.Val) > int64(s.Limit) && s.Limit != 0 { + return fmt.Errorf("limit (%d) in %s function can not be larger than the LIMIT (%d) in the select statement", int64(callLimit.Val), c.Name, int64(s.Limit)) + } + for _, v := range c.Args[:len(c.Args)-1] { if _, ok := v.(*VarRef); !ok { return fmt.Errorf("only fields or tags are allowed in %s(), found %s", c.Name, v)
wire up advanced top sorting/slicing
influxdata_influxql
train
go
1ee592a7f41cbe277470f001e4e117082636c601
diff --git a/packages/material-ui/src/index.js b/packages/material-ui/src/index.js index <HASH>..<HASH> 100644 --- a/packages/material-ui/src/index.js +++ b/packages/material-ui/src/index.js @@ -3,6 +3,7 @@ import * as colors from './colors'; export { colors }; export { createMuiTheme, + createStyles, makeStyles, MuiThemeProvider, styled,
[core] Fix createStyles not being defined (#<I>)
mui-org_material-ui
train
js
f210f44d4a9e9a76d138278de86db9a14f0f9501
diff --git a/lib/generators/para/admin_user/admin_user_generator.rb b/lib/generators/para/admin_user/admin_user_generator.rb index <HASH>..<HASH> 100644 --- a/lib/generators/para/admin_user/admin_user_generator.rb +++ b/lib/generators/para/admin_user/admin_user_generator.rb @@ -6,7 +6,8 @@ module Para say 'Creating default admin...' email = ask('Email [admin@example.com] : ').presence || 'admin@example.com' - password = ask('Password [password] : ').presence || 'password' + password = ask('Password [password] : ', echo: false).presence || 'password' + print "\n" # echo: false doesn't print a newline so we manually add it AdminUser.create! email: email, password: password
do not echo on password typing in para:admin_user rake task
para-cms_para
train
rb
ca33e8487e60759615c7e9bf46b1d4e4d65d56d8
diff --git a/tests/Unit/Suites/Context/Website/ConfigurableUrlToWebsiteMapTest.php b/tests/Unit/Suites/Context/Website/ConfigurableUrlToWebsiteMapTest.php index <HASH>..<HASH> 100644 --- a/tests/Unit/Suites/Context/Website/ConfigurableUrlToWebsiteMapTest.php +++ b/tests/Unit/Suites/Context/Website/ConfigurableUrlToWebsiteMapTest.php @@ -109,7 +109,7 @@ class ConfigurableUrlToWebsiteMapTest extends TestCase $this->assertSame('foo', $websiteMap->getRequestPathWithoutWebsitePrefix('http://example.com/foo')); } - public function testRturnsTheRequestPathWithoutUrlPrefixWithoutQueryArguments() + public function testReturnsTheRequestPathWithoutUrlPrefixWithoutQueryArguments() { $testMap = 'http://example.com/aa/=foo|http://example.com/=bar'; $this->stubConfigReader->method('get')->with(ConfigurableUrlToWebsiteMap::CONFIG_KEY)->willReturn($testMap);
Issue #<I>: Fix typo in test method name
lizards-and-pumpkins_catalog
train
php
0076b729e44d769a090a7431bccfbe5f83d38339
diff --git a/dddp/accounts/ddp.py b/dddp/accounts/ddp.py index <HASH>..<HASH> 100644 --- a/dddp/accounts/ddp.py +++ b/dddp/accounts/ddp.py @@ -442,10 +442,10 @@ class Auth(APIMixin): ) @api_endpoint('resetPassword') - def reset_password(self, params): + def reset_password(self, token, new_password): """Reset password using a token received in email then logs user in.""" - user, _ = self.validated_user_and_session(params['token']) - user.set_password(params['newPassword']) + user, _ = self.validated_user_and_session(token) + user.set_password(new_password) user.save() auth.login(this.request, user) self.update_subs(user.pk)
fix incorrect params in reset_password
jazzband_django-ddp
train
py
3593791222aa2d8a29a1a0733cc257c269b481ac
diff --git a/Str.php b/Str.php index <HASH>..<HASH> 100644 --- a/Str.php +++ b/Str.php @@ -2,7 +2,6 @@ namespace Illuminate\Support; -use Illuminate\Support\Arr; use Illuminate\Support\Traits\Macroable; use League\CommonMark\GithubFlavoredMarkdownConverter; use Ramsey\Uuid\Codec\TimestampFirstCombCodec;
Apply fixes from StyleCI (#<I>)
illuminate_support
train
php
2aadcce034c272c49b881bda9d3bc9f18cf908e1
diff --git a/lib/manamana.rb b/lib/manamana.rb index <HASH>..<HASH> 100644 --- a/lib/manamana.rb +++ b/lib/manamana.rb @@ -1,3 +1,6 @@ -require "manamana/version" -require "manamana/rdsl/parser" -require "manamana/tdsl/parser" \ No newline at end of file +require 'manamana/version' +require 'manamana/rdsl/parser' +require 'manamana/tdsl/parser' +require 'manamana/steps' +require 'manamana/compiler' +require 'manamana/runner' \ No newline at end of file
Update manamana main rb
ManaManaFramework_manamana
train
rb
5e109398b58a471006924cac2c5b9fa868353e9e
diff --git a/molgenis-omx-protocolviewer/src/main/java/org/molgenis/omx/plugins/ProtocolViewerController.java b/molgenis-omx-protocolviewer/src/main/java/org/molgenis/omx/plugins/ProtocolViewerController.java index <HASH>..<HASH> 100644 --- a/molgenis-omx-protocolviewer/src/main/java/org/molgenis/omx/plugins/ProtocolViewerController.java +++ b/molgenis-omx-protocolviewer/src/main/java/org/molgenis/omx/plugins/ProtocolViewerController.java @@ -580,7 +580,12 @@ public class ProtocolViewerController extends PluginModel<Entity> { this.id = feature.getId(); this.name = feature.getName(); - this.i18nDescription = new Gson().fromJson(feature.getDescription(), new TypeToken<Map<String, String>>() + String description = feature.getDescription(); + if (description != null && (!description.startsWith("{") || !description.endsWith("}"))) + { + description = " {\"en\":\"" + description + "\"}"; + } + this.i18nDescription = new Gson().fromJson(description, new TypeToken<Map<String, String>>() { }.getType()); this.dataType = feature.getDataType();
fixed the Json in the description field in ObservableFeature
molgenis_molgenis
train
java
5ced565a4787f40b9aa445f4f60ee9da4f7231d4
diff --git a/nodeshot/core/nodes/admin.py b/nodeshot/core/nodes/admin.py index <HASH>..<HASH> 100755 --- a/nodeshot/core/nodes/admin.py +++ b/nodeshot/core/nodes/admin.py @@ -32,7 +32,7 @@ class ImageInline(BaseStackedInline): classes = ('grp-collapse grp-open', ) -NODE_FILTERS = ['is_published', 'status', 'access_level', 'added'] +NODE_FILTERS = ['is_published', 'status', 'access_level', 'added', 'updated'] NODE_LIST_DISPLAY = ['name', 'user', 'status', 'access_level', 'is_published', 'added', 'updated'] NODE_FIELDS_LOOKEDUP = [ 'user__id', 'user__username',
filter by updated date in node admin
ninuxorg_nodeshot
train
py
abad32a82789a7643a341f886de5e0ba51826114
diff --git a/cruddy/calculatedvalue.py b/cruddy/calculatedvalue.py index <HASH>..<HASH> 100644 --- a/cruddy/calculatedvalue.py +++ b/cruddy/calculatedvalue.py @@ -16,6 +16,8 @@ import re import uuid import time +from botocore.vendored.six import string_types + class CalculatedValue(object): @@ -24,7 +26,7 @@ class CalculatedValue(object): @classmethod def check(cls, token): - if isinstance(token, str): + if isinstance(token, string_types): match = cls.token_re.match(token) if match: operation = match.group('operation')
Fix check for string type to use six string_types
Min-ops_cruddy
train
py
301b5206bd4c9eed84a2b844a88b11dba13947da
diff --git a/lib/beaker-pe/version.rb b/lib/beaker-pe/version.rb index <HASH>..<HASH> 100644 --- a/lib/beaker-pe/version.rb +++ b/lib/beaker-pe/version.rb @@ -3,7 +3,7 @@ module Beaker module PE module Version - STRING = '1.39.0' + STRING = '1.40.0' end end
(GEM) update beaker-pe version to <I>
puppetlabs_beaker-pe
train
rb
e1b793302b39c2b1f09125f08529228e644dda99
diff --git a/libraries/lithium/data/model/RecordSet.php b/libraries/lithium/data/model/RecordSet.php index <HASH>..<HASH> 100644 --- a/libraries/lithium/data/model/RecordSet.php +++ b/libraries/lithium/data/model/RecordSet.php @@ -254,7 +254,7 @@ class RecordSet extends \lithium\util\Collection { return $result; } - public function __desctruct() { + public function __destruct() { $this->_close(); }
Fixing typo in `RecordSet` re: ticket #6. Thanks 'oh4real'.
UnionOfRAD_framework
train
php
9e4f826166609392ca2a4c64069eb28632ae215d
diff --git a/neutronclient/tests/unit/test_cli20.py b/neutronclient/tests/unit/test_cli20.py index <HASH>..<HASH> 100644 --- a/neutronclient/tests/unit/test_cli20.py +++ b/neutronclient/tests/unit/test_cli20.py @@ -182,9 +182,6 @@ class CLITestV20Base(base.BaseTestCase): cmd_resource=None, parent_id=None): return name_or_id - def _get_attr_metadata(self): - return self.metadata - def setUp(self, plurals=None): """Prepare the test environment.""" super(CLITestV20Base, self).setUp() @@ -202,9 +199,6 @@ class CLITestV20Base(base.BaseTestCase): self.useFixture(fixtures.MonkeyPatch( 'neutronclient.neutron.v2_0.find_resourceid_by_id', self._find_resourceid)) - self.useFixture(fixtures.MonkeyPatch( - 'neutronclient.v2_0.client.Client.get_attr_metadata', - self._get_attr_metadata)) self.client = client.Client(token=TOKEN, endpoint_url=self.endurl) self.client.format = self.format
tests: removed mocking for Client.get_attr_metadata The method is not present since XML support removal: I<I>b0fdd<I>a<I>d5ff<I>a<I>e<I>df5b1 Change-Id: Iaa<I>a1e9bd<I>b<I>ed6f4f5a4d1da<I>aac<I>d<I> Related-Bug: #<I>
rackerlabs_rackspace-python-neutronclient
train
py
0d9ece981e9234ed3e708c506a8ac9cc6d7bf846
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,7 @@ module.exports = function(source) { this.cacheable(true); var callback = this.async(); - var config = loaderUtils.getOptions(this); + var config = loaderUtils.getOptions(this) || {}; // This piece of code exists in order to support webpack 1.x.x top level configurations. // In webpack 2 this options does not exists anymore.
Support missing configs (#1) (#<I>) * Support missing configs (#1) * Support missing configs `loaderUtils.getOptions(this)` will return `null` if no parseable structure is found. We don't currently `null` check this when reading `useConfig`. I have added a default empty object as a fallback for this scenario. * Patch version @<I> * Reset semver
rpominov_svgo-loader
train
js
04cc9363b348a64e6c212478a7c8209e97e5e540
diff --git a/gui/test_riabdock.py b/gui/test_riabdock.py index <HASH>..<HASH> 100644 --- a/gui/test_riabdock.py +++ b/gui/test_riabdock.py @@ -648,7 +648,7 @@ class RiabDockTest(unittest.TestCase): #Terdampak (x 1000): 2366 assert '2366' in myResult, myMessage - def Xtest_issue45(self): + def test_issue45(self): """Points near the edge of a raster hazard layer are interpolated OK""" clearmyDock() @@ -685,9 +685,9 @@ class RiabDockTest(unittest.TestCase): myMessage = 'Got unexpected state: %s' % str(myDict) assert myDict == expectDict, myMessage - # This is the where nosetest hangs when running the + # This is the where nosetest sometims hangs when running the # guitest suite (Issue #103) - # The QTest.mouseClick call never returns. + # The QTest.mouseClick call never returns when run with nosetest, but OK when run normally. QTest.mouseClick(myButton, QtCore.Qt.LeftButton) myResult = DOCK.wvResults.page().currentFrame().toPlainText()
Re-enabled test_issue<I> that used to hang (issue #<I>). It works now. Why?
inasafe_inasafe
train
py
34ecea07bc008de67d5ade34c223995f90d38131
diff --git a/lib/vagrant/machine_index/remote.rb b/lib/vagrant/machine_index/remote.rb index <HASH>..<HASH> 100644 --- a/lib/vagrant/machine_index/remote.rb +++ b/lib/vagrant/machine_index/remote.rb @@ -7,8 +7,8 @@ module Vagrant name: machine.name, local_data_path: machine.project.local_data_path, provider: machine.provider_name, - full_state: machine.state, - state: machine.state.id, + full_state: machine.machine_state, + state: machine.machine_state.id, vagrantfile_name: machine.project.vagrantfile_name, vagrantfile_path: machine.project.vagrantfile_path, }) @@ -86,7 +86,7 @@ module Vagrant def each(reload=true, &block) if reload client.all.each do |m| - @machines[m.uuid] = m + @machines[m.id] = m end end
Fix method calls when building entry and setting ID
hashicorp_vagrant
train
rb
a810497d640efc21471687c6f2cdf56dc3fa3b19
diff --git a/streams/streams.go b/streams/streams.go index <HASH>..<HASH> 100644 --- a/streams/streams.go +++ b/streams/streams.go @@ -46,10 +46,10 @@ import ( // Subreddits returns a stream of new posts from the requested subreddits. This // stream monitors the combination listing of all subreddits using Reddit's "+" // feature e.g. /r/golang+rust. This will consume one interval of the handle per -// call, so it is best to gather all the subreddits needed and make invoke this +// call, so it is best to gather all the subreddits needed and invoke this // function once. // -// Be aware that these posts are unlikely to have comments. If you are +// Be aware that these posts are new and will not have comments. If you are // interested in comment trees, save their permalinks and fetch them later. func Subreddits( scanner reddit.Scanner, @@ -69,11 +69,11 @@ func Subreddits( // subreddits. This stream monitors the combination listing of all subreddits // using Reddit's "+" feature e.g. /r/golang+rust. This will consume one // interval of the handle per call, so it is best to gather all the subreddits -// needed and make invoke this function once. +// needed and invoke this function once. // -// Be aware that these comments will not have reply trees. If you are interested -// in comment trees, save the permalinks of their parent posts and fetch them -// later.. +// Be aware that these comments are new, and will not have reply trees. If you +// are interested in comment trees, save the permalinks of their parent posts +// and fetch them later once they may have had activity. func SubredditComments( scanner reddit.Scanner, kill <-chan bool,
Fix comment docs on post and comment streams.
turnage_graw
train
go
44d842d7252ff74e92a6e8baf1b04215373de996
diff --git a/html-lint.js b/html-lint.js index <HASH>..<HASH> 100644 --- a/html-lint.js +++ b/html-lint.js @@ -791,7 +791,7 @@ jQuery: '1.7.2', jQueryUI: '1.8.18', - Modernizr: '2.6', + Modernizr: '2.6.1', MooTools: '1.4.5', YUI: '3.5.1' };
check for latest version of Modernizr
curtisj44_HTML-Lint
train
js
8c454cfdf08efbadd8ec27cae1913289c71d244b
diff --git a/lib/bless/parser.js b/lib/bless/parser.js index <HASH>..<HASH> 100644 --- a/lib/bless/parser.js +++ b/lib/bless/parser.js @@ -26,6 +26,10 @@ bless.Parser = function Parser(env) { var selectors = str.match(/[^,\{\}]*(,|\{[^\{\}]*\}\s*)/g); if(!selectors) { + files.push({ + filename: output, + content: str + }); callback(error, files); return; }
Correctly writing output file even if source file contains no selectors in order for cleaup to work properly.
BlessCSS_bless
train
js
6dbc2c78e5ef78c49a29ab1e3dc2f5f77d0c3d6e
diff --git a/i3pystatus/cpu_usage.py b/i3pystatus/cpu_usage.py index <HASH>..<HASH> 100644 --- a/i3pystatus/cpu_usage.py +++ b/i3pystatus/cpu_usage.py @@ -40,7 +40,6 @@ class CpuUsage(IntervalModule): def init(self): self.prev_total = defaultdict(int) self.prev_busy = defaultdict(int) - self.interval = 1 self.formatter = Formatter() def get_cpu_timings(self):
remove the module specific and hard coded interval in cpu_usage
enkore_i3pystatus
train
py
cf3d3786020073d3583c9eebff06baabc62fa8ec
diff --git a/lib/puppet/provider/service/launchd.rb b/lib/puppet/provider/service/launchd.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/provider/service/launchd.rb +++ b/lib/puppet/provider/service/launchd.rb @@ -51,8 +51,6 @@ Puppet::Type.type(:service).provide :launchd, :parent => :base do "/System/Library/LaunchDaemons"] Launchd_Overrides = "/var/db/launchd.db/com.apple.launchd/overrides.plist" - @product_version = Facter.value(:macosx_productversion_major) ? Facter.value(:macosx_productversion_major) : (sw_vers "-productVersion") - fail("#{@product_version} is not supported by the launchd provider") if %w{10.0 10.1 10.2 10.3}.include?(@product_version) # Caching is enabled through the following three methods. Self.prefetch will # call self.instances to create an instance for each service. Self.flush will @@ -133,6 +131,7 @@ Puppet::Type.type(:service).provide :launchd, :parent => :base do # it is 10.6 or greater. This allows us to implement different plist # behavior for versions >= 10.6 def has_macosx_plist_overrides? + @product_version = self.class.get_macosx_version_major return true unless /^10\.[0-5]/.match(@product_version) return false end
Change method used to get Fact Value A previous commit had me change the way we get the value of the macosx_productversion_major fact. This commmit changes the method to use the self.get_macosx_version_major method.
puppetlabs_puppet
train
rb
64690bc0d74f394bcbfe82ce2509a61877cb1f28
diff --git a/backbone.statemachine.js b/backbone.statemachine.js index <HASH>..<HASH> 100644 --- a/backbone.statemachine.js +++ b/backbone.statemachine.js @@ -34,6 +34,8 @@ Backbone.StateMachine = (function(Backbone, _){ // Declares a new transition on the state machine. transition: function(leaveState, event, data) { data = _.clone(data); + if (!(this._states.hasOwnProperty(leaveState))) + this.state(leaveState, {}); if (!(this._states.hasOwnProperty(data.enterState))) this.state(data.enterState, {}); if (!(this._transitions.hasOwnProperty(leaveState)))
fixed small bug when leaveState is not declared
sebpiq_backbone.statemachine
train
js
e6cd4d35eb7a09d3bfcbc441dc720d54f36f6af5
diff --git a/library/Drakojn/Io/Mapper/Map.php b/library/Drakojn/Io/Mapper/Map.php index <HASH>..<HASH> 100644 --- a/library/Drakojn/Io/Mapper/Map.php +++ b/library/Drakojn/Io/Mapper/Map.php @@ -1,6 +1,9 @@ <?php namespace Drakojn\Io\Mapper; +use InvalidArgumentException; +use ReflectionObject; + class Map { protected $localName; @@ -90,16 +93,16 @@ class Map * Extract values from a given object * @param object $object * @return array - * @throws \InvalidArgumentException + * @throws InvalidArgumentException */ public function getData($object) { if(!$this->validateObject($object)){ - throw new \InvalidArgumentException( + throw new InvalidArgumentException( "Given object isn\'t instance of {$this->localName}" ); } - $reflection = new \ReflectionObject($object); + $reflection = new ReflectionObject($object); $data = []; foreach(array_keys($this->properties) as $localProperty){ $property = $reflection->getProperty($localProperty); @@ -116,6 +119,6 @@ class Map */ public function validateObject($object) { - return is_a($object, $this->localName); + return ($object instanceof $this->localName); } }
Import namespaces on top of file - Use of `instanceof` operator instead `is_a()`
drakojn_io
train
php
c98b00c3024fde404af1d7772fc7cec62ec04c83
diff --git a/pkg/services/alerting/notifier.go b/pkg/services/alerting/notifier.go index <HASH>..<HASH> 100644 --- a/pkg/services/alerting/notifier.go +++ b/pkg/services/alerting/notifier.go @@ -3,6 +3,7 @@ package alerting import ( "errors" "fmt" + "time" "github.com/grafana/grafana/pkg/bus" "github.com/grafana/grafana/pkg/components/imguploader" @@ -126,7 +127,7 @@ func (n *notificationService) uploadImage(context *EvalContext) (err error) { renderOpts := rendering.Opts{ Width: 1000, Height: 500, - Timeout: alertTimeout / 2, + Timeout: time.Duration(float64(alertTimeout) * 0.9), OrgId: context.Rule.OrgId, OrgRole: m.ROLE_ADMIN, ConcurrentLimit: setting.AlertingRenderLimit,
allow <I> percent of alertTimeout for rendering to complete vs <I> percent
grafana_grafana
train
go
985190d7f75339573038c6aee26ad819fc04d274
diff --git a/src/Rocketeer/RocketeerServiceProvider.php b/src/Rocketeer/RocketeerServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/Rocketeer/RocketeerServiceProvider.php +++ b/src/Rocketeer/RocketeerServiceProvider.php @@ -133,7 +133,7 @@ class RocketeerServiceProvider extends ServiceProvider public function bindUserCommands() { // Custom tasks - $tasks = $this->app['config']->get('rocketeer::tasks.custom'); + $tasks = (array) $this->app['config']->get('rocketeer::tasks.custom'); foreach ($tasks as &$task) { $task = $this->app['rocketeer.tasks']->buildTask($task); $command = 'deploy.'.$task->getSlug();
Fix case where no user commands are defined
rocketeers_rocketeer
train
php
39d352131f06e18bc452977d11b198db7ee3eeaf
diff --git a/instabot/utils.py b/instabot/utils.py index <HASH>..<HASH> 100644 --- a/instabot/utils.py +++ b/instabot/utils.py @@ -25,6 +25,9 @@ class file(object): for i in self.list: yield next(iter(i)) + def __len__(self): + return len(self.list) + def append(self, item, allow_duplicates=False): if self.verbose: msg = "Adding '{}' to `{}`.".format(item, self.fname)
Add __len__ into file class
instagrambot_instabot
train
py