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
db298da922ce58061953566f7496adb7083ff24e
diff --git a/great_expectations/datasource/pandas_source.py b/great_expectations/datasource/pandas_source.py index <HASH>..<HASH> 100644 --- a/great_expectations/datasource/pandas_source.py +++ b/great_expectations/datasource/pandas_source.py @@ -2,7 +2,8 @@ import time import hashlib import logging -from builtins import str +# from builtins import str +from six import string_types import pandas as pd @@ -188,7 +189,7 @@ class PandasDatasource(Datasource): "df": args[0] }) batch_kwargs = PandasDatasourceMemoryBatchKwargs(**kwargs) - elif isinstance(args[0], str): + elif isinstance(args[0], string_types): kwargs.update({ "path": args[0], }) @@ -198,7 +199,7 @@ class PandasDatasource(Datasource): "one is supported. Please provide named arguments to build_batch_kwargs.") else: # Only kwargs were specified - if "path" in kwargs and isinstance(kwargs["path"], str): + if "path" in kwargs and isinstance(kwargs["path"], string_types): batch_kwargs = PathBatchKwargs(**kwargs) elif "df" in kwargs and isinstance(kwargs["df"], (pd.DataFrame, pd.Series)): batch_kwargs = PandasDatasourceMemoryBatchKwargs(**kwargs)
Switch from str to string_types.
great-expectations_great_expectations
train
py
4fd3abe884032e17d386624678c5e56fe015ee3c
diff --git a/src/livestreamer/plugin/plugin.py b/src/livestreamer/plugin/plugin.py index <HASH>..<HASH> 100644 --- a/src/livestreamer/plugin/plugin.py +++ b/src/livestreamer/plugin/plugin.py @@ -244,8 +244,12 @@ class Plugin(object): if name in streams: name = "{0}_alt".format(name) - num_alts = len(list(filter(lambda n: name in n, streams.keys()))) - if num_alts >= 1: + num_alts = len(list(filter(lambda n: n.startswith(name), streams.keys()))) + + # We shouldn't need more than 2 alt streams + if num_alts >= 2: + continue + elif num_alts > 0: name = "{0}{1}".format(name, num_alts + 1) # Validate stream name and discard the stream if it's bad.
plugin: Limit amount of alt streams.
streamlink_streamlink
train
py
c15108ce063f6396a6e93a54e973b858d0280d41
diff --git a/actionpack/lib/action_view/helpers/asset_paths.rb b/actionpack/lib/action_view/helpers/asset_paths.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_view/helpers/asset_paths.rb +++ b/actionpack/lib/action_view/helpers/asset_paths.rb @@ -18,7 +18,7 @@ module ActionView # asset host, if configured, with the correct request protocol. def compute_public_path(source, dir, ext = nil, include_host = true) source = source.to_s - return source if is_uri?(source) || is_scheme_relative_uri?(source) + return source if is_uri?(source) source = rewrite_extension(source, dir, ext) if ext source = "/#{dir}/#{source}" unless source[0] == ?/ @@ -33,14 +33,7 @@ module ActionView end def is_uri?(path) - path =~ %r{^[-a-z]+://|^cid:} - end - - # A URI relative to a base URI's scheme? - # See http://labs.apache.org/webarch/uri/rfc/rfc3986.html#relative-normal - # "//g" => "http://g" - def is_scheme_relative_uri?(path) - path =~ %r{^//} + path =~ %r{^[-a-z]+://|^cid:|^//} end private
moving check fo scheme-relative URI into is_uri?
rails_rails
train
rb
62ad6d930cf0f2b792151cb169ccedcd9ced81dd
diff --git a/gitwrapperlib/gitwrapperlib.py b/gitwrapperlib/gitwrapperlib.py index <HASH>..<HASH> 100755 --- a/gitwrapperlib/gitwrapperlib.py +++ b/gitwrapperlib/gitwrapperlib.py @@ -81,7 +81,7 @@ class Git: self._logger = logging.getLogger(logger_name) self._git = self._get_command() if not tty_out: - self._git.bake(_tty_out=False) + self._git = self._git.bake(_tty_out=False) @staticmethod def _get_command():
fix for tty in lambda contexts
costastf_gitwrapperlib
train
py
4b4f50851fbf11cd5113e469c62554655df014d2
diff --git a/assets/__pm.js b/assets/__pm.js index <HASH>..<HASH> 100644 --- a/assets/__pm.js +++ b/assets/__pm.js @@ -36,9 +36,10 @@ event.preventDefault(); } else { var legend = closest(event.target, function(e) { return e.id === '__pm__commit__changes_legend'; }, 2); - var parentElement = legend.parentElement; - if (parentElement) { - var classList = parentElement.classList; + if (legend) { + legend.focus(); + var detailsElement = legend.parentElement; + var classList = detailsElement.classList; if (classList.contains('open')) { classList.remove('open'); DOM.querySelector('#__pm__commit__message').focus(); @@ -153,9 +154,9 @@ return builder; }, {}); - if (event) { + if (event && DOM.activeElement) { var focus = request.createElement('focus'); - focus.textContent = document.activeElement.id; + focus.textContent = DOM.activeElement.id; message.appendChild(focus); } for(name in elements) {
Fixes focus --- "BLBA-<I>": Description: "" Developer: Sprint Estimate: "5" Status: Done
jadencarver_superconductor
train
js
66e60357dc1c03153d35668c5b966b7f7a41e43d
diff --git a/pkg/middleware/auth_proxy.go b/pkg/middleware/auth_proxy.go index <HASH>..<HASH> 100644 --- a/pkg/middleware/auth_proxy.go +++ b/pkg/middleware/auth_proxy.go @@ -60,8 +60,10 @@ func getCreateUserCommandForProxyAuth(headerVal string) *m.CreateUserCommand { cmd := m.CreateUserCommand{} if setting.AuthProxyHeaderProperty == "username" { cmd.Login = headerVal + cmd.Email = headerVal } else if setting.AuthProxyHeaderProperty == "email" { cmd.Email = headerVal + cmd.Login = headerVal } else { panic("Auth proxy header property invalid") }
Set email when creating user from auth_proxy header, Fixes #<I>
grafana_grafana
train
go
3412c4122b56fcb1e4023f0dd62829ac99414ffa
diff --git a/lib/vines/stream/http/request.rb b/lib/vines/stream/http/request.rb index <HASH>..<HASH> 100644 --- a/lib/vines/stream/http/request.rb +++ b/lib/vines/stream/http/request.rb @@ -11,13 +11,14 @@ module Vines IF_MODIFIED = 'If-Modified-Since'.freeze TEXT_PLAIN = 'text/plain'.freeze CONTENT_TYPES = { - 'html' => 'text/html; charset="utf-8"', - 'js' => 'application/javascript; charset="utf-8"', - 'css' => 'text/css', - 'png' => 'image/png', - 'jpg' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'gif' => 'image/gif' + 'html' => 'text/html; charset="utf-8"', + 'js' => 'application/javascript; charset="utf-8"', + 'css' => 'text/css', + 'png' => 'image/png', + 'jpg' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'gif' => 'image/gif', + 'manifest' => 'text/cache-manifest' }.freeze attr_reader :stream, :body, :headers, :method, :path, :url, :query
Serve offline application cache manifest files as text/cache-manifest MIME type.
negativecode_vines
train
rb
3af2eb450179bf4d355a76e2593d67adc2b1aee1
diff --git a/test/test_api.js b/test/test_api.js index <HASH>..<HASH> 100644 --- a/test/test_api.js +++ b/test/test_api.js @@ -745,16 +745,27 @@ describe('Zetta Api', function() { request(getHttpServer(app)) .put(url) .type('json') - .send({ foo: 1, bar: 2, value: 3 }) + .send({ bar: 2, value: 3 }) .expect(getBody(function(res, body) { assert.equal(res.statusCode, 200); - assert.equal(body.properties.foo, 1); assert.equal(body.properties.bar, 2); assert.equal(body.properties.value, 3); })) .end(done); }); + it('should not overwrite monitor properties using PUT', function(done) { + request(getHttpServer(app)) + .put(url) + .type('json') + .send({ foo: 1 }) + .expect(getBody(function(res, body) { + assert.equal(res.statusCode, 200); + assert.equal(body.properties.foo, 0); + })) + .end(done); + }); + it('should return a 404 when updating a non-existent device', function(done) { request(getHttpServer(app)) .put(url + '1234567890')
Adding test to ensure that monitor properties cannot be overwritten via API.
zettajs_zetta
train
js
e3e90c69e46d12de85fd884986d64a176fcc02af
diff --git a/lib/generic-bar.js b/lib/generic-bar.js index <HASH>..<HASH> 100755 --- a/lib/generic-bar.js +++ b/lib/generic-bar.js @@ -119,6 +119,9 @@ module.exports = class GenericBar extends _EventEmitter{ // store start time for duration+eta calculation this.startTime = Date.now(); + // reset stop time for 're-start' scenario (used for duration calculation) + this.stopTime = null; + // reset string line buffer (redraw detection) this.lastDrawnString = ''; @@ -138,7 +141,7 @@ module.exports = class GenericBar extends _EventEmitter{ this.isActive = false; // store stop timestamp to get total duration - this.stopTime = new Date(); + this.stopTime = Date.now(); // stop event this.emit('stop', this.total, this.value);
patch duration calculation for (Single)Bar 're-start' scenario (#<I>) In my use-case I am periodically stopping and re-starting the SingleBar to track the overall progress of my application. Thus, I found out that the duration calculation is not working properly and so I provide here an easy fix (plus a minor data type correction). Note: I have not tested this with MultiBar mode.
AndiDittrich_Node.CLI-Progress
train
js
8301e719e41dcadffaf31b7cc595e9ab18e2c3c6
diff --git a/lib/signore/signature.rb b/lib/signore/signature.rb index <HASH>..<HASH> 100644 --- a/lib/signore/signature.rb +++ b/lib/signore/signature.rb @@ -7,6 +7,7 @@ module Signore each_pair { |key, value| self[key] = nil if value and value.empty? } end + undef text if defined?(:text) def text self[:text] or '' end
Signature: address ‘method redefined’ warning
chastell_signore
train
rb
9c7d8b33cb38d382d1e5d9b9856a6acf4956389f
diff --git a/lib/bowline/desktop/window.rb b/lib/bowline/desktop/window.rb index <HASH>..<HASH> 100644 --- a/lib/bowline/desktop/window.rb +++ b/lib/bowline/desktop/window.rb @@ -38,6 +38,10 @@ module Bowline # Enable user input to the window. ## + # :singleton-method: enable_developer + # Enable developer menu. + + ## # :singleton-method: chome=(bool) # Enable/disable window's chrome, # i.e. the buttons & frame @@ -91,6 +95,10 @@ module Bowline # Raise this window above all other ones. ## + # :singleton-method: refresh + # Refresh window. + + ## # :singleton-method: show # Show this window. By default, windows are hidden. @@ -155,7 +163,7 @@ module Bowline ## # :singleton-method: show_inspector(console = false) - # Show WebInspector + # Show WebInspector. end class MainWindow #:nodoc:
Document new bowline-desktop methods
maccman_bowline
train
rb
e42e5ca862413ec3c13ba6e4f9d262fd971a5feb
diff --git a/lib/pronto/phpcs.rb b/lib/pronto/phpcs.rb index <HASH>..<HASH> 100644 --- a/lib/pronto/phpcs.rb +++ b/lib/pronto/phpcs.rb @@ -1,5 +1,6 @@ require 'pronto' require 'shellwords' +require 'json' module Pronto class Phpcs < Runner @@ -35,10 +36,14 @@ module Pronto escaped_standard = Shellwords.escape(@standard) escaped_path = Shellwords.escape(path) - JSON.parse(`#{escaped_executable} --report=json --standard=#{escaped_standard} #{escaped_path}`) - .fetch('files', {}) - .fetch(path, {}) - .fetch('messages', []) + begin + JSON.parse(`#{escaped_executable} --report=json --standard=#{escaped_standard} #{escaped_path}`) + .fetch('files', {}) + .fetch(path, {}) + .fetch('messages', []) + rescue JSON::ParserError + [] + end end def new_message(offence, line)
Return empty array of violations if we were unable to parse JSON
ellisv_pronto-phpcs
train
rb
c66a48cecfff1273dfa46a539fd1d334ab0da38e
diff --git a/examples/gltf/gltf-build.js b/examples/gltf/gltf-build.js index <HASH>..<HASH> 100644 --- a/examples/gltf/gltf-build.js +++ b/examples/gltf/gltf-build.js @@ -312,6 +312,13 @@ function handleMaterial (material, gltf, ctx, renderer) { materialCmp.set({ emissiveColorMap: tex }) } + if (material.extensions && material.extensions.KHR_materials_unlit) { + materialCmp.set({ + roughness: null, + metallic: null + }) + } + return materialCmp }
Add support for KHR_materials_unlit extensions (set roughness/metallic to null)
pex-gl_pex-renderer
train
js
3a182da066d504b16840298f27f2ff8476220acb
diff --git a/lib/migration.js b/lib/migration.js index <HASH>..<HASH> 100644 --- a/lib/migration.js +++ b/lib/migration.js @@ -13,6 +13,7 @@ var comb = require("comb"), isUndefined = comb.isUndefined, fs = require("fs"), path = require("path"), + baseName = path.basename, asyncArray = comb.async.array; @@ -396,7 +397,11 @@ var TimestampMigrator = define(Migrator, { return asyncArray(this._super(arguments)).sort(function (f1, f2) { var ret = this.getMigrationVersionFromFile(f1) - this.getMigrationVersionFromFile(f2); if (ret === 0) { - ret = f1 > f1 ? 1 : f1 < f2 ? -1 : 0; + var b1 = baseName(f1, ".js").split("."), + b2 = baseName(f2, ".js").split("."); + b1 = b1[b1.length - 1]; + b2 = b2[b2.length - 1]; + ret = b1 > b1 ? 1 : b1 < b2 ? -1 : 0; } return ret; }.bind(this));
fix 2 for sorting migration issue fix
C2FO_patio
train
js
7c9863ccb0bf8e7db593acb5c2f5f16fc85a36ba
diff --git a/terraform/context_apply_test.go b/terraform/context_apply_test.go index <HASH>..<HASH> 100644 --- a/terraform/context_apply_test.go +++ b/terraform/context_apply_test.go @@ -1740,6 +1740,7 @@ func TestContext2Apply_cancel(t *testing.T) { if ctx.sh.Stopped() { break } + time.Sleep(10 * time.Millisecond) } }
fix another hot lop in tests Found another test spinlock. Slow it down to prevent it from blocking the runtime scheduler.
hashicorp_terraform
train
go
2088c6ab3309ed387477b1de1858d8bc33d3dc2e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -21,11 +21,12 @@ setup(name='BAC0', 'BAC0.core.devices', 'BAC0.scripts', 'BAC0.tasks', - 'BAC0.bokeh' + 'BAC0.bokeh', + 'BAC0.sql' ], install_requires=[ 'pandas', - 'xlwings', + 'bacpypes', 'bokeh', ], dependency_links=[
This address the issue #<I> as xlwings is not a requirement but a nice to have. Pip should not try to install it automatically. A message will appear if not installed at startup anyway for Windows and MacOS users.
ChristianTremblay_BAC0
train
py
78870cd08bb15bebdbd362de7c285e2210cf20b1
diff --git a/peek_plugin_base/__init__.py b/peek_plugin_base/__init__.py index <HASH>..<HASH> 100644 --- a/peek_plugin_base/__init__.py +++ b/peek_plugin_base/__init__.py @@ -1,4 +1,4 @@ __project__ = 'Synerty Peek' __copyright__ = '2016, Synerty' __author__ = 'Synerty' -__version__ = '0.0.30' \ No newline at end of file +__version__ = '0.0.31' \ No newline at end of file diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ from setuptools import find_packages pip_package_name = "peek-plugin-base" py_package_name = "peek_plugin_base" -package_version = '0.0.30' +package_version = '0.0.31' egg_info = "%s.egg-info" % pip_package_name if os.path.isdir(egg_info):
Updated to version <I>
Synerty_peek-plugin-base
train
py,py
3c7c037f72f0551c01bbd8352e9398bc040e403d
diff --git a/codemod/base.py b/codemod/base.py index <HASH>..<HASH> 100755 --- a/codemod/base.py +++ b/codemod/base.py @@ -188,7 +188,8 @@ def multiline_regex_suggestor(regex, substitution=None, ignore_case=False): end_line_number=end_row + 1, new_lines=new_lines ) - pos = match.start() + 1 + delta = 1 if new_lines is None else min(1, len(new_lines)) + pos = match.start() + delta return suggestor
Don't advance position if substitution is zero-length Fixes #<I>. Manually tested example in that issue.
facebook_codemod
train
py
c35c2855800013f939b5de4844d16b62ad43f0e3
diff --git a/system/src/Grav/Framework/Flex/FlexIndex.php b/system/src/Grav/Framework/Flex/FlexIndex.php index <HASH>..<HASH> 100644 --- a/system/src/Grav/Framework/Flex/FlexIndex.php +++ b/system/src/Grav/Framework/Flex/FlexIndex.php @@ -261,7 +261,7 @@ class FlexIndex extends ObjectIndex implements FlexCollectionInterface, FlexInde if (!empty($cachedMethods[$name])) { // TODO: We can optimize this by removing key field from the key and creating collection with proper key. - $key = $this->getType(true) . '.' . sha1($name . '.' . json_encode($arguments) . $this->getCacheKey(), $this->getKeyField()); + $key = $this->getType(true) . '.' . sha1($name . '.' . json_encode($arguments) . $this->getCacheKey(). $this->getKeyField()); $cache = $this->_flexDirectory->getCache('object');
Fixed a bug in flex index caching
getgrav_grav
train
php
0c385ec1e1705c9e33a5b27b41b0cbaa893a32a9
diff --git a/src/api/neovim.js b/src/api/neovim.js index <HASH>..<HASH> 100644 --- a/src/api/neovim.js +++ b/src/api/neovim.js @@ -22,15 +22,26 @@ const createChainableApi = (name, requestPromise, chainCallPromise) => { return this[`${name}Proxy`]; } + const TYPE = TYPES[name]; + this[`${name}Promise`] = requestPromise(); + // TODO: Optimize this + // Define properties on the promise for devtools + Object.getOwnPropertyNames(TYPE.prototype).forEach(key => { + Object.defineProperty(this[`${name}Promise`], key, { + enumerable: true, + writable: true, + configurable: true, + }); + }); + const proxyHandler = { get: (target, prop) => { // XXX which takes priority? // Check if property is property of an API object (Window, Buffer, Tabpage, etc) // If it is, then we return a promise of results of the call on that API object // i.e. await this.buffer.name will return a promise of buffer name - const TYPE = TYPES[name]; const isOnPrototype = Object.prototype.hasOwnProperty.call( TYPE.prototype,
Define properties on returned promise for devtools
neovim_node-client
train
js
42e8dc264a5bbcc2e27be729d37a14a625036280
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ setup( author_email='colin.duquesnoy@gmail.com', description='Python/Qt Code Editor widget', long_description=readme(), - install_requires=['pygments<2.0', 'pyqode.qt', 'future'], + install_requires=['pygments==1.6', 'pyqode.qt', 'future'], entry_points={ 'console_scripts': [ 'pyqode-console = pyqode.core.tools.console:main'
Fix it to <I> (their <I>rc1 seems to confuse pip)
pyQode_pyqode.core
train
py
e7323cd322c6b3bf2aafb3ecf901ae2e334b8f98
diff --git a/rake-tasks/ruby.rb b/rake-tasks/ruby.rb index <HASH>..<HASH> 100644 --- a/rake-tasks/ruby.rb +++ b/rake-tasks/ruby.rb @@ -76,6 +76,8 @@ begin s.require_paths = [] + s.files += FileList['COPYING'] + # Common s.require_paths << 'common/src/rb/lib' s.files += FileList['common/src/rb/**/*']
JariBakken: Include the COPYING file in the ruby gem r<I>
SeleniumHQ_selenium
train
rb
ab1a33c6444582ec02b9a568e1116e9e53d51b58
diff --git a/kernel/class/copy.php b/kernel/class/copy.php index <HASH>..<HASH> 100644 --- a/kernel/class/copy.php +++ b/kernel/class/copy.php @@ -36,7 +36,7 @@ if ( !$class ) $classCopy = clone $class; $classCopy->initializeCopy( $class ); -$classCopy->setAttribute( 'version', 1 ); +$classCopy->setAttribute( 'version', eZContentClass::VERSION_STATUS_MODIFIED ); $classCopy->store(); $mainGroupID = false; @@ -69,7 +69,7 @@ foreach ( array_keys( $classAttributes ) as $classAttributeKey ) } $classAttributeCopy->setAttribute( 'contentclass_id', $classCopy->attribute( 'id' ) ); - $classAttributeCopy->setAttribute( 'version', 1 ); + $classAttributeCopy->setAttribute( 'version', eZContentClass::VERSION_STATUS_MODIFIED ); $classAttributeCopy->store(); $classAttributeCopies[] =& $classAttributeCopy; unset( $classAttributeCopy );
- Fixed: Adjusted class copy's state change of classes, to be picked up by updated method in eZContentClass git-svn-id: file:///home/patrick.allaert/svn-git/ezp-repo/ezpublish/trunk@<I> a<I>eee8c-daba-<I>-acae-fa<I>f<I>
ezsystems_ezpublish-legacy
train
php
e94be54776f8421105f1daaf3b496539ae4611ca
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from setuptools import setup, find_packages -with open('../README.rst') as f: +with open('README.rst') as f: readme = f.read() with open('LICENSE') as f:
Ok, I think the path upheaval is done now
twitter_cdk
train
py
e7a2d643fbc64746cfc960d08ace8e49ea7de493
diff --git a/restygwt/src/main/java/org/fusesource/restygwt/client/Method.java b/restygwt/src/main/java/org/fusesource/restygwt/client/Method.java index <HASH>..<HASH> 100755 --- a/restygwt/src/main/java/org/fusesource/restygwt/client/Method.java +++ b/restygwt/src/main/java/org/fusesource/restygwt/client/Method.java @@ -119,7 +119,9 @@ public class Method { } private void doSetTimeout() { - if (Defaults.getRequestTimeout() > -1) { + // Use default timeout only if it was not already set through the @Options(timeout =) annotation. + // See https://github.com/resty-gwt/resty-gwt/issues/206 + if (builder.getTimeoutMillis() == 0 && Defaults.getRequestTimeout() > -1) { builder.setTimeoutMillis(Defaults.getRequestTimeout()); } }
Use default timeout only if it was not already set through the @Options(timeout =) annotation.
resty-gwt_resty-gwt
train
java
705b664bfc3cb44e83684f18b59bfd0e4be8ce22
diff --git a/lib/flor/pcore/_ref.rb b/lib/flor/pcore/_ref.rb index <HASH>..<HASH> 100644 --- a/lib/flor/pcore/_ref.rb +++ b/lib/flor/pcore/_ref.rb @@ -18,7 +18,9 @@ class Flor::Pro::Ref < Flor::Procedure if tree[0] == '_rep' pa elsif pa.size == 2 && pa[1] == 'ret' && pa[0].match(/\Af(ld|ield)?\z/) - node_payload_ret + parent ? + parent_node_procedure.node_payload_ret : + node_payload_ret else lookup_value(pa) end
Returns the f.ret as found at the parent level ``` [ 0 1 ]; merge [ 'a' ] [ <I> <I> 4 ] f.ret # => [ 0 1 4 ] # and not # [ <I> <I> 4 ] ```
floraison_flor
train
rb
cec35b01243df7073ea8f782dd5d4c32fb07874d
diff --git a/src/Rebing/GraphQL/GraphQL.php b/src/Rebing/GraphQL/GraphQL.php index <HASH>..<HASH> 100644 --- a/src/Rebing/GraphQL/GraphQL.php +++ b/src/Rebing/GraphQL/GraphQL.php @@ -95,12 +95,12 @@ class GraphQL /** * @param string $query - * @param array $params + * @param array|null $params * @param array $opts Additional options, like 'schema', 'context' or 'operationName' * - * @return mixed + * @return array */ - public function query($query, $params = [], $opts = []) + public function query(string $query, ?array $params = [], array $opts = []): array { return $this->queryAndReturnResult($query, $params, $opts)->toArray(); }
Add types to \Rebing\GraphQL\GraphQL::query
rebing_graphql-laravel
train
php
b82e9ed8ed69a96f9ea498c686438e16b725ddbc
diff --git a/lib/marathon/app.rb b/lib/marathon/app.rb index <HASH>..<HASH> 100644 --- a/lib/marathon/app.rb +++ b/lib/marathon/app.rb @@ -3,7 +3,8 @@ class Marathon::App < Marathon::Base ACCESSORS = %w[ id args cmd cpus disk env executor instances mem ports requirePorts - storeUris tasksHealthy tasksUnhealthy tasksRunning tasksStaged upgradeStrategy uris user version ] + storeUris tasksHealthy tasksUnhealthy tasksRunning tasksStaged upgradeStrategy + uris user version labels ] DEFAULTS = { :env => {}, diff --git a/spec/marathon/app_spec.rb b/spec/marathon/app_spec.rb index <HASH>..<HASH> 100644 --- a/spec/marathon/app_spec.rb +++ b/spec/marathon/app_spec.rb @@ -72,6 +72,16 @@ describe Marathon::App do end end + describe '#labels' do + subject { described_class.new({ 'id' => '/ubuntu2', 'labels' => { 'env'=>'abc','xyz'=>'123'}}) } + + it 'has labels' do + expect(subject.labels).to be_instance_of(Hash) + puts subject.labels + expect(subject.labels).to have_key(:env) + end + end + describe '#constraints' do subject { described_class.new({ 'id' => '/ubuntu2', 'healthChecks' => [{ 'path' => '/ping' }] }) }
Add support for labels closes #<I>
otto-de_marathon-api
train
rb,rb
5609b23b609ef3b699c7fcaeb6275c45d56453a2
diff --git a/lib/google-jwt-certs.js b/lib/google-jwt-certs.js index <HASH>..<HASH> 100644 --- a/lib/google-jwt-certs.js +++ b/lib/google-jwt-certs.js @@ -45,8 +45,10 @@ function reloadCertificates() { reloadCertificates(); // every five minutes check if it's already been a day since last reload -// because when developing, if the computer sleeps, interval timers may pause -setInterval(reloadCertificates, 5 * 60 * 1000); +// because when developing, if the computer sleeps, interval timers may pause. +// unref() makes sure this setInterval doesn't prevent node from +// exiting when everything else is done +setInterval(reloadCertificates, 5 * 60 * 1000).unref(); module.exports = { /* for a given key ID (kid),
don't prevent node from stopping
jacekkopecky_node-simple-google-openid
train
js
c4ebdd6878a298d095638c8bf0007e0b0aaac49f
diff --git a/src/renderer/viz/expressions/Animation.js b/src/renderer/viz/expressions/Animation.js index <HASH>..<HASH> 100644 --- a/src/renderer/viz/expressions/Animation.js +++ b/src/renderer/viz/expressions/Animation.js @@ -68,13 +68,11 @@ let waitingForOthers = new Set(); export class Animation extends BaseExpression { constructor(input, duration = 10, fade = new Fade()) { duration = implicitCast(duration); - let originalInput = input; + input = implicitCast(input); + const originalInput = input; - if (input.valueOf() instanceof Property) { + if (input.isA(Property)) { input = linear(input, globalMin(input), globalMax(input)); - } else { - input = implicitCast(input); - originalInput = input; } checkLooseType('animation', 'input', 0, 'number', input);
Change to use isA in Animation input
CartoDB_carto-vl
train
js
158ebbe121201fabdbc0421b8277e46eaaf03bfb
diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py index <HASH>..<HASH> 100644 --- a/salt/modules/yumpkg.py +++ b/salt/modules/yumpkg.py @@ -703,7 +703,7 @@ def list_repo_pkgs(*args, **kwargs): version_list.add(pkg.version) if _no_repository_packages(): - cmd_prefix = ['yum', '--quiet', 'list'] + cmd_prefix = ['yum', '--quiet', 'list', '--showduplicates'] for pkg_src in ('installed', 'available'): # Check installed packages first out = __salt__['cmd.run_all'](
yumpkg.list_repo_pkgs show duplicates allways It was not the case for Yum version < <I>
saltstack_salt
train
py
726b69537891fa2b062fb80974313b6c8fc5214b
diff --git a/test/times.js b/test/times.js index <HASH>..<HASH> 100644 --- a/test/times.js +++ b/test/times.js @@ -18,11 +18,18 @@ describe('times', function() { it('iterates n times with delayed', function() { let order = []; - const p = async.times(5, delayedTask(1, successTask), order); + const p = async.times( + 5, + (index, order) => new Promise(resolve => setTimeout(_ => { + order.push(index); + resolve(index); + }, (5 - index) * 25)), + order + ); return Promise.all([ p.should.eventually.deep.equal([0, 1, 2, 3, 4]), - p.then(() => order.should.deep.equal([0, 1, 2, 3, 4])) + p.then(() => order.should.deep.equal([4, 3, 2, 1, 0])) ]); });
Update times delayed test to reverse the order
jgornick_asyncp
train
js
e2a4aef74548301a4e065a33b366708646843bac
diff --git a/lib/rake/thread_history_display.rb b/lib/rake/thread_history_display.rb index <HASH>..<HASH> 100644 --- a/lib/rake/thread_history_display.rb +++ b/lib/rake/thread_history_display.rb @@ -16,7 +16,7 @@ module Rake def show puts "Job History:" stats.each do |stat| - stat[:data] ||= [] + stat[:data] ||= {} rename(stat, :thread, threads) rename(stat[:data], :item_id, items) rename(stat[:data], :new_thread, threads)
Fixed small bug in ThreadHistoryDisplay where it made a default :data value that should be a Hash.
ruby_rake
train
rb
44dfdc7f6cb18327df103727fe09ea3c12cb9f24
diff --git a/internal/service/keyspaces/table_test.go b/internal/service/keyspaces/table_test.go index <HASH>..<HASH> 100644 --- a/internal/service/keyspaces/table_test.go +++ b/internal/service/keyspaces/table_test.go @@ -282,7 +282,8 @@ func TestAccKeyspacesTable_update(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "schema_definition.#", "1"), resource.TestCheckResourceAttr(resourceName, "table_name", rName2), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), - resource.TestCheckResourceAttr(resourceName, "ttl.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ttl.#", "1"), + resource.TestCheckResourceAttr(resourceName, "ttl.0.status", "ENABLED"), ), }, }, @@ -606,6 +607,10 @@ resource "aws_keyspaces_table" "test" { point_in_time_recovery { status = "DISABLED" } + + ttl { + status = "ENABLED" + } } `, rName1, rName2) }
r/aws_keyspaces_table: After 'ttl' is enabled, you can't disable it for the table.
terraform-providers_terraform-provider-aws
train
go
ccefd585005acc326d3739aacecb22c42a295384
diff --git a/pycoin/tx/dump.py b/pycoin/tx/dump.py index <HASH>..<HASH> 100644 --- a/pycoin/tx/dump.py +++ b/pycoin/tx/dump.py @@ -83,13 +83,7 @@ def dump_disassembly(tx, tx_in_idx, disassembler): def dump_signatures(tx, tx_in, tx_out, idx, network, traceback_f, disassembly_level): sc = tx.SolutionChecker(tx) - signatures = [] - for opcode in BitcoinScriptTools.opcode_list(tx_in.script): - if not opcode.startswith("OP_"): - try: - signatures.append(parse_signature_blob(h2b(opcode[1:-1]))) - except UnexpectedDER: - pass + signatures = [parse_signature_blob(blob) for blob, sig_hash in network.extras.extract_signatures(tx, idx)] if signatures: sig_types_identical = ( tuple(zip(*signatures))[1].count(signatures[0][1]) == len(signatures))
Use extract_signatures in disassembly.
richardkiss_pycoin
train
py
418a2cf4f690a71a33861c8498d0e088f43f4329
diff --git a/src/WatchingStrategies/RouterEventManager.php b/src/WatchingStrategies/RouterEventManager.php index <HASH>..<HASH> 100644 --- a/src/WatchingStrategies/RouterEventManager.php +++ b/src/WatchingStrategies/RouterEventManager.php @@ -43,7 +43,7 @@ class RouterEventManager * * @return RouterEventManager */ - public function init($routeInfo): RouterEventManager + public function init(array $routeInfo): RouterEventManager { $this->routeInfo = $routeInfo; diff --git a/src/WatchingStrategies/ViewEventManager.php b/src/WatchingStrategies/ViewEventManager.php index <HASH>..<HASH> 100644 --- a/src/WatchingStrategies/ViewEventManager.php +++ b/src/WatchingStrategies/ViewEventManager.php @@ -21,12 +21,12 @@ class ViewEventManager } /** - * @param $listner + * @param $listener */ - public function startGuarding(callable $listner) + public function startGuarding(callable $listener) { foreach ($this->views as $view) { - view()->creator($view, $this->wrapForIgnorance($listner)); + view()->creator($view, $this->wrapForIgnorance($listener)); } }
Added "type hints" and "return types"
imanghafoori1_laravel-heyman
train
php,php
9a46ae4741f205d983a19ee4ee495852c0c6a6d6
diff --git a/Kwf/Model/Abstract.php b/Kwf/Model/Abstract.php index <HASH>..<HASH> 100644 --- a/Kwf/Model/Abstract.php +++ b/Kwf/Model/Abstract.php @@ -1185,9 +1185,15 @@ abstract class Kwf_Model_Abstract implements Kwf_Model_Interface return; } $ret[$model->getFactoryId()] = $model; - foreach ($model->getDependentModels() as $m) { - self::_findAllInstancesProcessModel($ret, $m); + + if ($model instanceof Kwf_Model_Proxy) { + self::_findAllInstancesProcessModel($ret, $model->getProxyModel()); + } else if ($model instanceof Kwf_Model_Union) { + foreach ($model->getUnionModels() as $subModel) { + self::_findAllInstancesProcessModel($ret, $subModel); + } } + foreach ($model->getDependentModels() as $m) { self::_findAllInstancesProcessModel($ret, $m); }
Fix bug with Kwf_Model_Abstract::findAllInstances() it did not return proxied model or models connected through unionModel
koala-framework_koala-framework
train
php
da47d2aecafe77e4571e07644fdc174c9602807c
diff --git a/src/providers/subdb.js b/src/providers/subdb.js index <HASH>..<HASH> 100644 --- a/src/providers/subdb.js +++ b/src/providers/subdb.js @@ -12,7 +12,7 @@ const SUBDB_API_URL = 'http://api.thesubdb.com' * @returns {Promise<string>} the subtitles, formatted as .srt */ async function getSubtitles (file) { - const digest = await computeHash(file) + const digest = await hash(file) return getSubtitlesByHash(digest) } @@ -45,7 +45,7 @@ async function getSubtitlesByHash (hash) { * @returns {Promise<string>} a hex string representing the MD5 digest of the * first 64kB and the last 64kB of the given file */ -async function computeHash (file) { +async function hash (file) { const filesize = await fileUtil.getFileSize(file) const chunkSize = 64 * 1024
refactor: rename function
BeLi4L_subz-hero
train
js
39edbd022f7a2bb45cee2f038e8fb9a4941c410a
diff --git a/lib/setup.php b/lib/setup.php index <HASH>..<HASH> 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -219,6 +219,11 @@ init_performance_info(); // Put $OUTPUT in place, so errors can be displayed. $OUTPUT = new bootstrap_renderer(); +if (false) { + // this is a funny trick to make Eclipse believe that $OUTPUT contains + // aninstance of core_renderer which in turn fixes autocompletion ;-) + $OUTPUT = new core_renderer(null, null); +} // set handler for uncaught exceptions - equivalent to print_error() call set_exception_handler('default_exception_handler');
MDL-<I> Eclipse autocompletion works again
moodle_moodle
train
php
cbbfdafc7bd35195c59a2f86a9de24b2ea0c5939
diff --git a/LibraryRateMe/src/com/androidsx/rateme/DialogRateMe.java b/LibraryRateMe/src/com/androidsx/rateme/DialogRateMe.java index <HASH>..<HASH> 100644 --- a/LibraryRateMe/src/com/androidsx/rateme/DialogRateMe.java +++ b/LibraryRateMe/src/com/androidsx/rateme/DialogRateMe.java @@ -28,10 +28,10 @@ public class DialogRateMe extends DialogFragment { private Button rateMe; private Button noThanks; - public static DialogRateMe newInstance(String appName) { + public static DialogRateMe newInstance(String packageName) { DialogRateMe dialogo = new DialogRateMe(); Bundle args = new Bundle(); - args.putString(EXTRA_PACKAGE_NAME, appName); + args.putString(EXTRA_PACKAGE_NAME, packageName); dialogo.setArguments(args); return dialogo; }
Renamed appName into packageName
androidsx_rate-me
train
java
bfd28477507629359c778559a90b21614f00417d
diff --git a/pkg/endpoint/endpoint.go b/pkg/endpoint/endpoint.go index <HASH>..<HASH> 100644 --- a/pkg/endpoint/endpoint.go +++ b/pkg/endpoint/endpoint.go @@ -476,7 +476,7 @@ func (e *Endpoint) GetModelRLocked() *models.Endpoint { statusLog = statusLog[:1] } - return &models.Endpoint{ + mdl := &models.Endpoint{ ID: int64(e.ID), Configuration: e.Opts.GetModel(), ContainerID: e.DockerID, @@ -507,6 +507,15 @@ func (e *Endpoint) GetModelRLocked() *models.Endpoint { }, Controllers: e.controllers.GetStatusModel(), } + + // Sort these slices since they come out in random orders. This allows + // reflect.DeepEqual to succeed. + sort.StringSlice(mdl.Labels.Custom).Sort() + sort.StringSlice(mdl.Labels.Disabled).Sort() + sort.StringSlice(mdl.Labels.OrchestrationIdentity).Sort() + sort.StringSlice(mdl.Labels.OrchestrationInfo).Sort() + sort.Slice(mdl.Controllers, func(i, j int) bool { return mdl.Controllers[i].Name < mdl.Controllers[j].Name }) + return mdl } // GetHealthModel returns the endpoint's health object.
endpoint: Sort slices in models.Endpoint Consecutive calls to Endpoint.GetModel return slices with different orders. By sorting them we simplify reflect.DeepCopy comparisions of this type.
cilium_cilium
train
go
76dde53d04158c7ad17d8fa021b7d13f076f8973
diff --git a/lib/gir_ffi/class_base.rb b/lib/gir_ffi/class_base.rb index <HASH>..<HASH> 100644 --- a/lib/gir_ffi/class_base.rb +++ b/lib/gir_ffi/class_base.rb @@ -73,7 +73,7 @@ module GirFFI def self.direct_wrap ptr return nil if !ptr || ptr.null? obj = allocate - obj.instance_variable_set :@struct, self::Struct.new(ptr) + obj.__send__ :store_pointer, ptr obj end @@ -99,5 +99,11 @@ module GirFFI def self.constructor_wrap ptr direct_wrap ptr end + + private + + def store_pointer ptr + @struct = self.class::Struct.new(ptr) + end end end
Implement private ClassBase#store_pointer method
mvz_gir_ffi
train
rb
607d0108a1cca25850911972715f092644ca66d2
diff --git a/chatterbot/conversation/session.py b/chatterbot/conversation/session.py index <HASH>..<HASH> 100644 --- a/chatterbot/conversation/session.py +++ b/chatterbot/conversation/session.py @@ -47,3 +47,11 @@ class ConversationSessionManager(object): session_id = str(session_id) if session_id in self.sessions: self.sessions[session_id].conversation.append(conversance) + + def get_default(self): + import warnings + warnings.warn("get_default is deprecated. Use 'get' instead.", DeprecationWarning) + + def update_default(self, conversance): + import warnings + warnings.warn("update_default is deprecated. Use 'update' instead.", DeprecationWarning)
Add deprecation warnings to session manager
gunthercox_ChatterBot
train
py
6352a16cf64695739386e6487167e60a2bebda3b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -16,6 +16,7 @@ setup(name='pyroma', "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: Implementation :: PyPy", ], keywords='pypi quality testing', author='Lennart Regebro',
Tested that it runs under PyPy.
regebro_pyroma
train
py
93b5633d2159a77d15dd1e394053751a67009e92
diff --git a/Classes/TYPO3/Surf/Command/SurfCommandController.php b/Classes/TYPO3/Surf/Command/SurfCommandController.php index <HASH>..<HASH> 100644 --- a/Classes/TYPO3/Surf/Command/SurfCommandController.php +++ b/Classes/TYPO3/Surf/Command/SurfCommandController.php @@ -103,6 +103,8 @@ class SurfCommandController extends \TYPO3\Flow\Cli\CommandController { public function describeCommand($deploymentName, $configurationPath = NULL) { $deployment = $this->deploymentService->getDeployment($deploymentName, $configurationPath); + $deployment->initialize(); + $this->outputLine('<em> Deployment <b>' . $deployment->getName() . ' </b></em>'); $this->outputLine(); $this->outputLine('<u>Workflow</u>: ' . $deployment->getWorkflow()->getName() . PHP_EOL);
[BUGFIX] Call initialize() on Deployment in surf:describe command If no workflow is configured explicitly by the deployment configuration a SimpleWorkflow will be registered by default in the initialize() method. This change calls that method before accessing the workflow. Change-Id: I4c<I>f<I>ba<I>db<I>a1da8ac<I>b5b<I>af
TYPO3_Surf
train
php
9a696cec988f7cbaf35f98b4e1ad72a70d9e0b95
diff --git a/webdriver_test_tools/project/initialize.py b/webdriver_test_tools/project/initialize.py index <HASH>..<HASH> 100755 --- a/webdriver_test_tools/project/initialize.py +++ b/webdriver_test_tools/project/initialize.py @@ -143,23 +143,6 @@ def create_config_files(target_path, context): create_file_from_template(template_path, target_path, template_file, context) -# TODO: remove -def create_template_files(target_path, context): - """Creates test package template directory and template files - - :param target_path: The path to the test package directory - :param context: Jinja context used to render template - """ - target_path = create_directory(os.path.abspath(target_path), 'templates') - template_path = templates.templates.get_path() - template_files = [ - 'page_object.py', - 'test_case.py', - ] - for template_file in template_files: - create_file_from_template(template_path, target_path, template_file, context) - - # Helper functions def create_init(target_path): @@ -248,7 +231,6 @@ def initialize(target_path, package_name, project_title, gitignore_files=True, r create_output_directories(package_path, gitignore_files) create_tests_init(package_path, context) create_config_files(package_path, context) - create_template_files(package_path, context) def main():
project.initialize no longer creates project templates/ Not necessary since the 'new' command will handle this
connordelacruz_webdriver-test-tools
train
py
f2cb44608a3134330d41282674b87ca96ddea8f5
diff --git a/src/PHPUnit_Retriable_TestCase.php b/src/PHPUnit_Retriable_TestCase.php index <HASH>..<HASH> 100644 --- a/src/PHPUnit_Retriable_TestCase.php +++ b/src/PHPUnit_Retriable_TestCase.php @@ -10,7 +10,7 @@ * examples. * * @author Art <a.molcanovas@gmail.com> - * @see https://github.com/Alorel/phpunit-auto-rerun/#configuration + * @see https://github.com/Alorel/phpunit-auto-rerun/#configuration */ class PHPUnit_Retriable_TestCase extends PHPUnit_Framework_TestCase {
will this stop your whining, PHPdoc reflection?
Alorel_phpunit-auto-rerun
train
php
79116c35e8efee2342838f11bf75638cbad4cad6
diff --git a/sigal/gallery.py b/sigal/gallery.py index <HASH>..<HASH> 100644 --- a/sigal/gallery.py +++ b/sigal/gallery.py @@ -96,7 +96,7 @@ class PathsDb(object): } # get information for each directory - for path, dirnames, filenames in os.walk(self.basepath): + for path, dirnames, filenames in os.walk(self.basepath, followlinks=True): relpath = os.path.relpath(path, self.basepath) # sort images and sub-albums by name
Include symlinked directories in PathsDB
saimn_sigal
train
py
752651eefa50e0c92ccacc6e6a9ec0d0021f9137
diff --git a/modules/wyil/src/wyil/checks/VerificationTransformer.java b/modules/wyil/src/wyil/checks/VerificationTransformer.java index <HASH>..<HASH> 100644 --- a/modules/wyil/src/wyil/checks/VerificationTransformer.java +++ b/modules/wyil/src/wyil/checks/VerificationTransformer.java @@ -265,7 +265,8 @@ public class VerificationTransformer { int fn = Fn(branch.automaton(),operands); branch.write(code.target, fn); - if (postcondition != null) { + if (postcondition != null) { + operands = Arrays.copyOf(operands, operands.length); operands[0] = branch.read(code.target); int constraint = transformExternalBlock(postcondition, operands, branch);
WYIL: bug fix for generating uninterpreted functions.
Whiley_WhileyCompiler
train
java
6c793ee4d5c3ebe2dd3485b2334d3364cfd9ff32
diff --git a/uni_form/helpers.py b/uni_form/helpers.py index <HASH>..<HASH> 100644 --- a/uni_form/helpers.py +++ b/uni_form/helpers.py @@ -106,6 +106,7 @@ def render_field(field, form, template="uni_form/field.html", labelclass=None): raise Exception("Could not resolve form field '%s'." % field) else: field_instance = None + logging.warning("Could not resolve form field '%s'." % field, exc_info=sys.exc_info()) if not hasattr(form, 'rendered_fields'): form.rendered_fields = [] @@ -114,6 +115,8 @@ def render_field(field, form, template="uni_form/field.html", labelclass=None): else: if not FAIL_SILENTLY: raise Exception("A field should only be rendered once: %s" % field) + else: + logging.warning("A field should only be rendered once: %s" % field, exc_info=sys.exc_info()) if field_instance is None: html = '' @@ -202,6 +205,7 @@ class MultiField(object): if not FAIL_SILENTLY: raise Exception("Could not resolve form field '%s'." % field) else: + logging.warning("Could not resolve form field '%s'." % field, exc_info=sys.exc_info()) continue bound_field = BoundField(form, field_instance, field)
Adding logging warnings for when FAIL_SILENTLY is enabled and occurs
django-crispy-forms_django-crispy-forms
train
py
14cbdbf99439f9235eac9033ed0c4fa9a90e839a
diff --git a/lib/src/test/java/eu/hinsch/spring/boot/actuator/logview/LogViewEndpointTest.java b/lib/src/test/java/eu/hinsch/spring/boot/actuator/logview/LogViewEndpointTest.java index <HASH>..<HASH> 100644 --- a/lib/src/test/java/eu/hinsch/spring/boot/actuator/logview/LogViewEndpointTest.java +++ b/lib/src/test/java/eu/hinsch/spring/boot/actuator/logview/LogViewEndpointTest.java @@ -209,6 +209,11 @@ public class LogViewEndpointTest { } @Test + public void shouldReturnNullEndpointType() { + assertThat(logViewEndpoint.getEndpointType(), is(nullValue())); + } + + @Test public void shouldNotAllowToListFileOutsideRoot() throws IOException { // given expectedException.expect(IllegalArgumentException.class);
Missing test case for endpoint type
lukashinsch_spring-boot-actuator-logview
train
java
663cb8e5e41662e0e9f891ca284a7bbb213321ef
diff --git a/validate.min.js b/validate.min.js index <HASH>..<HASH> 100644 --- a/validate.min.js +++ b/validate.min.js @@ -1,4 +1,4 @@ -// validate.js 0.0.1 +// validate.js 0.1.0 // https://github.com/wrapp/validate.js // (c) 2013 Wrapp // validate.js may be freely distributed under the MIT license.
Fix the version in the minifed source
ansman_validate.js
train
js
0cfd4560321c9fff2bfdb695556f7d0cf3355758
diff --git a/src/sap.m/src/sap/m/ActionSheet.js b/src/sap.m/src/sap/m/ActionSheet.js index <HASH>..<HASH> 100644 --- a/src/sap.m/src/sap/m/ActionSheet.js +++ b/src/sap.m/src/sap/m/ActionSheet.js @@ -278,12 +278,14 @@ sap.ui.define(['jquery.sap.global', './Dialog', './Popover', './library', 'sap/u this._parent.oPopup.setModal(true); //doesn't need to react on content change because content is always 100% this._parent._registerResizeHandler = this._parent._deregisterResizeHandler = function() {}; - this._parent._setDimensions = function(){ + this._parent._setDimensions = function() { + sap.m.Dialog.prototype._setDimensions.apply(this); var $this = this.$(), $content = this.$("cont"); //CSS reset $this.css({ "width": "100%", + "max-width": "", "max-height": "100%", "left": "0px", "right": "",
[INTERNAL] sap.m.ActionSheet: adapt the dimension calc after dialog's improvement Change-Id: I9c<I>a7cef<I>ce0bf1e<I>d<I>ed2a<I>ee<I>c6b
SAP_openui5
train
js
d6ebd1047c01ef8bd9d226674e32e998fef20ec0
diff --git a/syncutil/invariant_mutex.go b/syncutil/invariant_mutex.go index <HASH>..<HASH> 100644 --- a/syncutil/invariant_mutex.go +++ b/syncutil/invariant_mutex.go @@ -103,11 +103,18 @@ func (i *InvariantMutex) checkIfEnabled() { // by the mutex should hold (e.g. just after acquiring the lock). The function // should crash if an invariant is violated. It should not have side effects, // as there are no guarantees that it will run. +// +// The invariants must hold at the time that NewInvariantMutex is called. func NewInvariantMutex(check func()) InvariantMutex { if check == nil { panic("check must be non-nil.") } + // Check now, if enabled. + if *fCheckInvariants { + check() + } + return InvariantMutex{ check: check, }
Check invariants when creating the mutex, too.
jacobsa_gcloud
train
go
c6404e85b84fd2edf2e4ecfbb7afbb8c9370f523
diff --git a/js/test/test.js b/js/test/test.js index <HASH>..<HASH> 100644 --- a/js/test/test.js +++ b/js/test/test.js @@ -580,15 +580,15 @@ let testNonce = async (exchange, symbol) => { else if (exchange.hasFetchOrders || exchange.has.fetchOrders) await exchange.fetchOrders (symbol); else + exchange.nonce = nonce; return; exchange.nonce = nonce; } catch (e) { + exchange.nonce = nonce; if (e instanceof ccxt.AuthenticationError) { log.green ('AuthenticationError test passed') - exchange.nonce = nonce; return; } else { - exchange.nonce = nonce; throw e; } }
tests: proper nonce recovery after tests
ccxt_ccxt
train
js
bf819f1f722d9940d4b9b96a15786fe315c284d2
diff --git a/src/util.js b/src/util.js index <HASH>..<HASH> 100644 --- a/src/util.js +++ b/src/util.js @@ -51,43 +51,6 @@ var util = { return target; }, - asyncEach (array, callback) { - return this.asyncMap(array, callback). - then(function () { return array; }); - }, - - asyncMap (array, callback) { - var pending = Promise.defer(); - var n = array.length, i = 0; - var results = [], errors = []; - - function oneDone() { - i++; - if (i === n) { - pending.resolve(results, errors); - } - } - - array.forEach(function (item, index) { - var result; - try { - result = callback(item); - } catch(exc) { - oneDone(); - errors[index] = exc; - } - if (typeof(result) === 'object' && typeof(result.then) === 'function') { - result.then(function (res) { results[index] = res; oneDone(); }, - function (error) { errors[index] = error; oneDone(); }); - } else { - oneDone(); - results[index] = result; - } - }); - - return pending.promise; - }, - containingFolder (path) { if (path === '') { return '/';
Remove obsolete utils These functions are not used anymore it seems. If they're used in a legacy module, the code has to be moved to a new utility module.
remotestorage_remotestorage.js
train
js
85e11c3bef4953ad16109d4b3fce8e58348acc41
diff --git a/dist/pelias-leaflet-geocoder.js b/dist/pelias-leaflet-geocoder.js index <HASH>..<HASH> 100644 --- a/dist/pelias-leaflet-geocoder.js +++ b/dist/pelias-leaflet-geocoder.js @@ -635,15 +635,19 @@ } }, this) .on(this._results, 'mouseover', function (e) { - if (map.scrollWheelZoom.enabled() && map.options.scrollWheelZoom) { + // Prevent scrolling over results list from zooming the map, if enabled + this._scrollWheelZoomEnabled = map.scrollWheelZoom.enabled(); + if (this._scrollWheelZoomEnabled) { map.scrollWheelZoom.disable(); } - }) + }, this) .on(this._results, 'mouseout', function (e) { - if (!map.scrollWheelZoom.enabled() && map.options.scrollWheelZoom) { + // Re-enable scroll wheel zoom (if previously enabled) after + // leaving the results box + if (this._scrollWheelZoomEnabled) { map.scrollWheelZoom.enable(); } - }); + }, this); // Recalculate width of the input bar when window resizes if (this.options.fullWidth) {
Fix results list enabling scrollWheelZoom when it has been disabled
pelias_leaflet-plugin
train
js
ea911841b67fba6143604b313b6a1b2b77c78c7e
diff --git a/lib/request.js b/lib/request.js index <HASH>..<HASH> 100644 --- a/lib/request.js +++ b/lib/request.js @@ -93,9 +93,10 @@ Request.prototype.performRequest = function performRequest(cachedResponse) { } defaultRequestOptions = { - auth: this.options.auth || ':' + this.options.token, - method: this.options.method || 'GET', - headers: headers + auth: this.options.auth || ':' + this.options.token, + method: this.options.method || 'GET', + rejectUnauthorized: this.options.rejectUnauthorized, + headers: headers }; requestOptions = this.getRequestOptions(defaultRequestOptions);
allow disabling ssl verification
heroku_node-heroku-client
train
js
cb9ce1e791abac7fcb2eb784bf54affbb26a00ae
diff --git a/npm_scripts/release.js b/npm_scripts/release.js index <HASH>..<HASH> 100644 --- a/npm_scripts/release.js +++ b/npm_scripts/release.js @@ -67,6 +67,6 @@ stdin.question(`Next version (current is ${currentVersion})? `, (nextVersion) => // Go back from whence you came exec(`git checkout ${branchName}`); -}); + stdin.close(); -stdin.close(); +});
chore: Fix closing of stdin.
Pearson-Higher-Ed_compounds
train
js
99f2183435ad0067dcb6acb1f67de3379dec457e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ if __name__ == "__main__": author_email='joe.mcross@gmail.com', url='http://declare.readthedocs.org/', license='MIT', - keywords='meta metaclass declarative orm', + keywords='meta metaclass declarative', platforms='any', include_package_data=True, py_modules=['declare'],
Drop orm keyword from setup.py
numberoverzero_declare
train
py
d32491eddbaeee2fa4bc0db3b39285287aca2835
diff --git a/backtrader/strategy.py b/backtrader/strategy.py index <HASH>..<HASH> 100644 --- a/backtrader/strategy.py +++ b/backtrader/strategy.py @@ -299,12 +299,12 @@ class Strategy(with_metaclass(MetaStrategy, StrategyBase)): def _start(self): self._periodset() - # change operators to stage 2 - self._stage2() - for analyzer in itertools.chain(self.analyzers, self._slave_analyzers): analyzer._start() + # change operators to stage 2 + self._stage2() + self.start() def start(self):
Allow declaration of indicators in analyzers during start by delaying switch to stage 2
backtrader_backtrader
train
py
fb498189d7d8b8a0bf19c215368265dadb443a99
diff --git a/lib/sprockets/es6.rb b/lib/sprockets/es6.rb index <HASH>..<HASH> 100644 --- a/lib/sprockets/es6.rb +++ b/lib/sprockets/es6.rb @@ -84,8 +84,17 @@ module Sprockets end append_path Babel::Transpiler.source_path - register_mime_type 'text/ecmascript-6', extensions: ['.es6'], charset: :unicode - register_transformer 'text/ecmascript-6', 'application/javascript', ES6 - register_preprocessor 'text/ecmascript-6', DirectiveProcessor - register_engine '.es6', ES6 + + if respond_to?(:register_transformer) + register_mime_type 'text/ecmascript-6', extensions: ['.es6'], charset: :unicode + register_transformer 'text/ecmascript-6', 'application/javascript', ES6 + register_preprocessor 'text/ecmascript-6', DirectiveProcessor + end + + if respond_to?(:register_engine) + args = ['.es6', ES6] + args << { mime_type: 'text/ecmascript-6', silence_deprecation: true } if Sprockets::VERSION.start_with?("3") + register_engine(*args) + end + end
Fix Sprockets deprecation warning with v3 support No need to use `register_engine` method as we specify all the the others for Sprockets v4 support. But since gem still allows Sprockets 3 we need to support it and use the `register_engine` method. This follows the [Sprockets upgrade guidelines](<URL>) although I'm unaware if other changes are necessary. I'm able to contribute more with some help/advice.
TannerRogalsky_sprockets-es6
train
rb
62bd3ec5bee433d309df757cb5140acba5576ea9
diff --git a/pkg/keystore/keystore.go b/pkg/keystore/keystore.go index <HASH>..<HASH> 100644 --- a/pkg/keystore/keystore.go +++ b/pkg/keystore/keystore.go @@ -139,7 +139,7 @@ func storeTrustedKey(dir string, r io.Reader) (string, error) { if err != nil { return "", err } - if err := os.MkdirAll(dir, 0700); err != nil { + if err := os.MkdirAll(dir, 0755); err != nil { return "", err } entityList, err := openpgp.ReadArmoredKeyRing(bytes.NewReader(pubkeyBytes))
pkg: keystore: default to <I> for keystore There is nothing private about our collection of public keys. Make it world-readable by default. This makes it possible to fetch containers as non-root users.
rkt_rkt
train
go
3bf7ec06a3c0320abda5be587a3ba1772ec1e21f
diff --git a/src/matches.js b/src/matches.js index <HASH>..<HASH> 100644 --- a/src/matches.js +++ b/src/matches.js @@ -1,7 +1,18 @@ function displayName({type}, fragment) { const {displayName, name} = type; + + if ((displayName || name) === fragment) + return true; - return ((displayName || name) == fragment); + // This is a hack for browsers that don't have Function.name (Internet Explorer). + if (typeof name === "undefined") { + const funcString = type.toString(); + const match = funcString.match(/function\s([^(]{1,})\(/); + + return (match && match[1] === fragment); + } + + return false; } function className(object, fragment) {
Fixed an issue with browsers that don't support Function.name. - This is a fallback when searching via component name. It first looks for the displayName. - Dammit Internet Explorer.
lewie9021_react-shallow-query
train
js
bad7aa856cdf19c6cb8f131a4a915069806dc511
diff --git a/lib/ecm/cms/version.rb b/lib/ecm/cms/version.rb index <HASH>..<HASH> 100644 --- a/lib/ecm/cms/version.rb +++ b/lib/ecm/cms/version.rb @@ -1,5 +1,5 @@ module Ecm module Cms - VERSION = '4.0.0' + VERSION = '4.0.1' end end
Bumped version to <I>
robotex82_ecm_cms2
train
rb
34c86be479e67f6df44355de8e0a8e40df428a13
diff --git a/tests/Jobby/BackgroundJobTest.php b/tests/Jobby/BackgroundJobTest.php index <HASH>..<HASH> 100644 --- a/tests/Jobby/BackgroundJobTest.php +++ b/tests/Jobby/BackgroundJobTest.php @@ -29,18 +29,18 @@ class BackgroundJobTest extends \PHPUnit_Framework_TestCase /** * */ - public function setUp() + protected function setUp() { $this->logFile = __DIR__ . "/_files/BackgroundJobTest.log"; - @unlink($this->logFile); + !file_exists($this->logFile) || unlink($this->logFile); } /** * */ - public function tearDown() + protected function tearDown() { - @unlink($this->logFile); + !file_exists($this->logFile) || unlink($this->logFile); } /**
Do not suppress warning if an existing testlog-file was not deleted.
jobbyphp_jobby
train
php
87770c35d853940c0966fdc90388d627bde03d5b
diff --git a/lib/shorturl.rb b/lib/shorturl.rb index <HASH>..<HASH> 100644 --- a/lib/shorturl.rb +++ b/lib/shorturl.rb @@ -83,12 +83,6 @@ class ShortURL # parameters set so that when +instance+.call is invoked, the # shortened URL is returned. @@services = { - :rubyurl => Service.new("rubyurl.com") { |s| - s.action = "/rubyurl/remote" - s.field = "website_url" - s.block = lambda { |body| URI.extract(body).grep(/rubyurl/)[0] } - }, - :tinyurl => Service.new("tinyurl.com") { |s| s.action = "/api-create.php" s.method = :get @@ -257,9 +251,9 @@ class ShortURL # * <tt>:orz</tt> # # call-seq: - # ShortURL.shorten("http://mypage.com") => Uses RubyURL - # ShortURL.shorten("http://mypage.com", :tinyurl) - def self.shorten(url, service = :rubyurl) + # ShortURL.shorten("http://mypage.com") => Uses TinyURL + # ShortURL.shorten("http://mypage.com", :bitly) + def self.shorten(url, service = :tinyurl) if valid_services.include? service @@services[service].call(url) else
rubyurl.com is no more.
robbyrussell_shorturl
train
rb
69b416145ec63d0c96ebc8e41edef007c1552cbc
diff --git a/server/monitor.go b/server/monitor.go index <HASH>..<HASH> 100644 --- a/server/monitor.go +++ b/server/monitor.go @@ -41,13 +41,7 @@ func (w *grpcWatcher) stop() { } func (w *grpcWatcher) watchingEventTypes() []watcherEventType { - types := make([]watcherEventType, 0, 4) - for _, t := range []watcherEventType{WATCHER_EVENT_UPDATE_MSG, WATCHER_EVENT_POST_POLICY_UPDATE_MSG, WATCHER_EVENT_BESTPATH_CHANGE, WATCHER_EVENT_STATE_CHANGE} { - if len(w.reqs[t]) > 0 { - types = append(types, t) - } - } - return types + return []watcherEventType{WATCHER_EVENT_UPDATE_MSG, WATCHER_EVENT_POST_POLICY_UPDATE_MSG, WATCHER_EVENT_BESTPATH_CHANGE, WATCHER_EVENT_STATE_CHANGE} } func (w *grpcWatcher) loop() error {
server: fix aca6fd6ad<I>b4cb<I>bff3c<I>fca8ca<I>d regression Fix the bug introduced by the following commit: commit aca6fd6ad<I>b4cb<I>bff3c<I>fca8ca<I>d
osrg_gobgp
train
go
3d748363f71189cb902e7dad61ffaa3e9e90e256
diff --git a/pkg/client/config.go b/pkg/client/config.go index <HASH>..<HASH> 100644 --- a/pkg/client/config.go +++ b/pkg/client/config.go @@ -90,6 +90,13 @@ func blobServerOrDie() string { func (c *Client) SetupAuth() error { configOnce.Do(parseConfig) + if flagServer != nil && *flagServer != "" { + // If using an explicit blobserver, don't use auth + // configured from the config file, so we don't send + // our password to a friend's blobserver. + c.authMode = auth.None{} + return nil + } return c.SetupAuthFromConfig(config) }
pkg/client: don't use config file auth when using an explicit server Change-Id: I<I>e<I>adf4fed<I>deb3ec5a2ee<I>f4fc3a<I>fe
perkeep_perkeep
train
go
1b56f31076674d4290a3a5d0f1510c67598bf390
diff --git a/uritemplates.go b/uritemplates.go index <HASH>..<HASH> 100644 --- a/uritemplates.go +++ b/uritemplates.go @@ -201,7 +201,7 @@ func (self *templatePart) expand(values map[string]interface{}) string { func (self *templatePart) expandName(name string, empty bool) (result string) { if self.named { - result = escape(name, self.allowReserved) + result = name if empty { result += self.ifemp } else {
Don't escape query parameter names. With this commit, all specification and extended tests pass.
jtacoma_uritemplates
train
go
92a2fdef34fd2915e00e60faef7333ef315b5d6f
diff --git a/src/Application.php b/src/Application.php index <HASH>..<HASH> 100644 --- a/src/Application.php +++ b/src/Application.php @@ -103,9 +103,6 @@ class Application // Disable technical issues emails. define('WP_DISABLE_FATAL_ERROR_HANDLER', env('WP_DISABLE_FATAL_ERROR_HANDLER', false)); - // Set the cache constant for plugins such as WP Super Cache and W3 Total Cache. - define('WP_CACHE', env('WP_CACHE', true)); - // Set the absolute path to the WordPress directory. if (!defined('ABSPATH')) { define('ABSPATH', sprintf('%s/%s/', $this->getPublicPath(), env('WP_DIR', 'wordpress')));
Remove WP_CACHE environment variable (#<I>)
wordplate_framework
train
php
700a1f4ca139f81ecfb3b1a836d9ec411b7d9bec
diff --git a/lib/yao/plugins/default_client_generator.rb b/lib/yao/plugins/default_client_generator.rb index <HASH>..<HASH> 100644 --- a/lib/yao/plugins/default_client_generator.rb +++ b/lib/yao/plugins/default_client_generator.rb @@ -19,7 +19,6 @@ module Yao::Plugins f.response :json, content_type: /\bjson$/ if Yao.config.debug - f.response :logger f.response :os_dumper end diff --git a/test/yao/test_client.rb b/test/yao/test_client.rb index <HASH>..<HASH> 100644 --- a/test/yao/test_client.rb +++ b/test/yao/test_client.rb @@ -48,7 +48,6 @@ class TestClient < Test::Unit::TestCase Faraday::Request::ReadOnly, Faraday::Response::OSErrorDetector, FaradayMiddleware::ParseJson, - Faraday::Response::Logger, Faraday::Response::OSDumper ] assert { cli.builder.handlers == handlers }
use only os_dumper
yaocloud_yao
train
rb,rb
a3d276a07155f579cbe63ccbfd5bd9467ee84f45
diff --git a/lib/server.js b/lib/server.js index <HASH>..<HASH> 100644 --- a/lib/server.js +++ b/lib/server.js @@ -48,7 +48,7 @@ var Server = function (server, path, services, wsdl, options) { //handle only the required URL path for express server server.route(path).all(function (req, res, next) { if (typeof self.authorizeConnection === 'function') { - if (!self.authorizeConnection(req)) { + if (!self.authorizeConnection(req, res)) { res.end(); return; } @@ -60,7 +60,7 @@ var Server = function (server, path, services, wsdl, options) { server.removeAllListeners('request'); server.addListener('request', function (req, res) { if (typeof self.authorizeConnection === 'function') { - if (!self.authorizeConnection(req)) { + if (!self.authorizeConnection(req, res)) { res.end(); return; }
Update server.js Change signature of authorizeConnection to allow changing response parameters, for example, setting status code <I> (Unauthorized)
vpulim_node-soap
train
js
514ebf71e2b996ec54cc2c4cc0a1b2c6d6fb02d7
diff --git a/go/teams/chain.go b/go/teams/chain.go index <HASH>..<HASH> 100644 --- a/go/teams/chain.go +++ b/go/teams/chain.go @@ -1496,9 +1496,6 @@ func (t *TeamSigChainPlayer) addInnerLink( if err != nil { return res, err } - if !team.Implicit { - return res, NewExplicitTeamOperationError("KBFS settings") - } res.newState = prevState.DeepCopy() res.newState.informKBFSSettings(*team.KBFS)
Allow KBFSSettings links on unimplicit teams too (#<I>)
keybase_client
train
go
6bc2958d66936d6d18e561e97de5cb29f4d42a14
diff --git a/concrete/elements/page_types/form/base.php b/concrete/elements/page_types/form/base.php index <HASH>..<HASH> 100644 --- a/concrete/elements/page_types/form/base.php +++ b/concrete/elements/page_types/form/base.php @@ -111,8 +111,8 @@ if (isset($pagetype) && is_object($pagetype)) { <script type="text/javascript"> $(function() { - $('#ptPageTemplateID').removeClass('form-control').selectize({ - plugins: ['remove_button'] + $('#ptPageTemplateID').removeClass('form-control').selectpicker({ + width: '100%' }); $('input[name=ptPublishTargetTypeID]').on('click', function() {
replaced Selectize with bootstrap-select in concrete\elements\page_types\form\base.php (impacts allowed page templates choice when setting page types in dashboard)
concrete5_concrete5
train
php
07ed292d0ddcfaed1fe1bc13ce5a46e9bd57aa5e
diff --git a/lib/chain.js b/lib/chain.js index <HASH>..<HASH> 100644 --- a/lib/chain.js +++ b/lib/chain.js @@ -36,7 +36,7 @@ define(["require", "./store", "deepjs/deep"], }; var proto = { - range: function(arg1, arg2, query, options) { + range: function(start, end, query, options) { var self = this; var func = function(s, e) { var doIt = function(store) { @@ -46,7 +46,7 @@ define(["require", "./store", "deepjs/deep"], return deep.errors.MethodNotAllowed("provided store doesn't have RANGE. aborting RANGE !"); if (method._deep_ocm_) method = method(); - return deep.when(method.call(store, arg1, arg2, query, options)) + return deep.when(method.call(store, start, end, query, options)) .done(function(success) { if (success._deep_range_) self._state.nodes = [deep.nodes.root(success.results)];
clean arg name in chained range
deepjs_deep-restful
train
js
16802efeba0b018c3c22738523fbb7662fe3b035
diff --git a/src/kundera-rethinkdb/src/test/java/com/impetus/client/rethink/query/RethinkQueryTest.java b/src/kundera-rethinkdb/src/test/java/com/impetus/client/rethink/query/RethinkQueryTest.java index <HASH>..<HASH> 100644 --- a/src/kundera-rethinkdb/src/test/java/com/impetus/client/rethink/query/RethinkQueryTest.java +++ b/src/kundera-rethinkdb/src/test/java/com/impetus/client/rethink/query/RethinkQueryTest.java @@ -91,6 +91,16 @@ public class RethinkQueryTest Assert.assertEquals(5, results.size()); assertResults(results, T, T, T, T, T); + query = em.createQuery("Select p.personName,p.age from Person p where p.personId = '103'"); + results = query.getResultList(); + Assert.assertEquals(1, results.size()); + Person p = results.get(0); + Assert.assertNotNull(p); + Assert.assertEquals("pg", p.getPersonName()); + Assert.assertEquals(new Long(30), p.getAge()); + Assert.assertNull(p.getPersonId()); + Assert.assertNull(p.getSalary()); + query = em.createQuery("Select p from Person p where p.personId = '103'"); results = query.getResultList(); Assert.assertEquals(1, results.size());
#<I>, added test case
Impetus_Kundera
train
java
56cd89fa471217effed894ec0c8c6a99048dac9d
diff --git a/lib/util.js b/lib/util.js index <HASH>..<HASH> 100644 --- a/lib/util.js +++ b/lib/util.js @@ -122,7 +122,9 @@ _.mixin(/** @lends util */ { var key; for (key in source) { - source.hasOwnProperty(key) && !_.isUndefined(source[key]) && (target[key] = source[key]); + if (source.hasOwnProperty(key) && !_.isUndefined(source[key])) { + target[key] = source[key]; + } } return target; @@ -184,6 +186,14 @@ _.mixin(/** @lends util */ { result[i] = ASCII_SOURCE[(Math.random() * ASCII_SOURCE_LENGTH) | 0]; } return result.join(EMPTY); + }, + + pluck: function () { + for (var i = 0, ii = arguments.length; i < ii; i++) { + if (!_.isEmpty(arguments[i])) { + return arguments[i]; + } + } } });
Added utility function (internal) to select the first non-empty value from a set of values. Also, modifies one function to use if-block for for-in filter instead of expression syntax (simply to avoid eslint warning)
postmanlabs_postman-collection
train
js
15221ec79de21fe9d272460a60550f8c660cb4b3
diff --git a/client/src/app.js b/client/src/app.js index <HASH>..<HASH> 100644 --- a/client/src/app.js +++ b/client/src/app.js @@ -135,13 +135,22 @@ _kiwi.global = { }); // Add the networks getters/setters - obj.get = function() { - var network = getNetwork(); + obj.get = function(name) { + var network, restricted_keys; + + network = getNetwork(); if (!network) { return; } - return network.get.apply(network, arguments); + restricted_keys = [ + 'password' + ]; + if (restricted_keys.indexOf(name) > -1) { + return undefined; + } + + return network.get(name); }; obj.set = function() {
Restrict some network info to plugins
prawnsalad_KiwiIRC
train
js
107711d3a50b207349520bfa52038522210a336e
diff --git a/lib/watir-webdriver/html/spec_extractor.rb b/lib/watir-webdriver/html/spec_extractor.rb index <HASH>..<HASH> 100644 --- a/lib/watir-webdriver/html/spec_extractor.rb +++ b/lib/watir-webdriver/html/spec_extractor.rb @@ -38,6 +38,10 @@ module Watir sorter.print end + def fetch_interface(interface) + @interfaces_by_name[interface] or raise "#{interface} not found in IDL" + end + private def download_and_parse @@ -55,6 +59,7 @@ module Watir end def extract_interface_map + # http://www.whatwg.org/specs/web-apps/current-work/#elements-1 table = @doc.search("//h3[@id='elements-1']/following-sibling::table[1]").first table or raise "could not find elements-1 table" @@ -93,10 +98,6 @@ module Watir end end - def fetch_interface(interface) - @interfaces_by_name[interface] or raise "#{interface} not found in IDL" - end - def parse_idl(str) result = idl_parser.parse(str) @@ -113,7 +114,7 @@ module Watir end def sorter - @idl_sroter ||= IDLSorter.new(@interfaces) + @idl_sorter ||= IDLSorter.new(@interfaces) end end # SpecExtractor
Expose SpecExtractor#fetch_interface
watir_watir
train
rb
5c890ce88db56cf0064d64058d8c39c837f3f7ce
diff --git a/src/MetaModels/DcGeneral/Events/Table/RenderSettings/Subscriber.php b/src/MetaModels/DcGeneral/Events/Table/RenderSettings/Subscriber.php index <HASH>..<HASH> 100644 --- a/src/MetaModels/DcGeneral/Events/Table/RenderSettings/Subscriber.php +++ b/src/MetaModels/DcGeneral/Events/Table/RenderSettings/Subscriber.php @@ -268,7 +268,7 @@ class Subscriber extends BaseSubscriber public function buildJumpToWidget(BuildWidgetEvent $event) { if (($event->getEnvironment()->getDataDefinition()->getName() !== 'tl_metamodel_rendersettings') - || ($event->getProperty() !== 'jumpTo')) { + || ($event->getProperty()->getName() !== 'jumpTo')) { return; }
Fix missing filteroptions in rendersettings
MetaModels_core
train
php
948402112b77dd216c356d16eefae13cd67b8f83
diff --git a/cordova-lib/src/PluginInfo.js b/cordova-lib/src/PluginInfo.js index <HASH>..<HASH> 100644 --- a/cordova-lib/src/PluginInfo.js +++ b/cordova-lib/src/PluginInfo.js @@ -270,10 +270,15 @@ function loadPluginsDir(dirname) { var plugins = []; subdirs.forEach(function (subdir) { var d = path.join(dirname, subdir); - if (!fs.existsSync(path.join(d, 'plugin.xml'))) + if (!fs.existsSync(path.join(d, 'plugin.xml'))) { return; // continue - var p = new PluginInfo(d); - plugins.push(p); + } + try { + var p = new PluginInfo(d); + plugins.push(p); + } catch (e) { + // ignore errors while parsing so we can continue with searching + } }); return plugins; }
CB-<I> - cordova plugin add --searchpath does not recurse through subfolders when a plugin.xml is malformed in one of them
apache_cordova-lib
train
js
c4413693b9665009abdb6147473ce081ac626e2d
diff --git a/lib/MetaTemplate/Template.php b/lib/MetaTemplate/Template.php index <HASH>..<HASH> 100644 --- a/lib/MetaTemplate/Template.php +++ b/lib/MetaTemplate/Template.php @@ -32,13 +32,13 @@ class Template /** * Creates a engine instance for the given template path * - * @param string $template + * @param string $source * @param array $options Engine Options to pass to the constructor * @return \MetaTemplate\Template\Base */ - static function create($template, $options = array()) + static function create($source, $options = array(), $callback = null) { - return static::getEngines()->create($template, $options); + return static::getEngines()->create($source, $options, $callback); } /** diff --git a/lib/MetaTemplate/Util/EngineRegistry.php b/lib/MetaTemplate/Util/EngineRegistry.php index <HASH>..<HASH> 100644 --- a/lib/MetaTemplate/Util/EngineRegistry.php +++ b/lib/MetaTemplate/Util/EngineRegistry.php @@ -42,12 +42,12 @@ class EngineRegistry return $this; } - function create($path, $options = array()) + function create($source, $options = null, $callback = null) { - $extension = pathinfo($path, PATHINFO_EXTENSION); + $extension = pathinfo($source, PATHINFO_EXTENSION); $class = $this->get($extension); - return new $class($path, $options = array()); + return new $class($source, $options, $callback); } function get($extension)
Adapted factory methods to new template constructor.
CHH_meta-template
train
php,php
3a73b16a33b10bb52dfd3c92f5c6329cbf6ba35d
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import setuptools setuptools.setup( name="Schemer", - version="0.2.6", + version="0.2.7", author="Tom Leach", author_email="tom@gc.io", description="Powerful schema-based validation of Python dicts",
Bumping version to <I>
gamechanger_schemer
train
py
d50ad4f865c8f2eb7570f284573ab239372be2df
diff --git a/graftm/create.py b/graftm/create.py index <HASH>..<HASH> 100644 --- a/graftm/create.py +++ b/graftm/create.py @@ -830,7 +830,7 @@ in the final GraftM package. If you are sure these sequences are correct, turn o tf) tf.flush() cmd = "graftM graft --forward %s --graftm_package %s --output_directory %s" %( - sequences, output_gpkg_path, graftM_graft_test_dir_name) + tf.name, output_gpkg_path, graftM_graft_test_dir_name) extern.run(cmd)
create: Actually use '<I> sequences' file when testing (#<I>)
geronimp_graftM
train
py
2b213cea26683f89ec72c0f288584ce8f37536f6
diff --git a/AntiSpoof_i18n.php b/AntiSpoof_i18n.php index <HASH>..<HASH> 100644 --- a/AntiSpoof_i18n.php +++ b/AntiSpoof_i18n.php @@ -44,6 +44,14 @@ $wgAntiSpoofMessages['fi'] = array( $wgAntiSpoofMessages['fr'] = array( 'antispoof-name-conflict' => 'Le nom « $1 » ressemble trop au compte existant « $2 ». Veuillez choisir un autre nom.', 'antispoof-name-illegal' => 'Le nom « $1 » n’est pas autorisé pour empêcher de confondre ou d’utiliser le nom « $2 ». Veuillez choisir un autre nom.', + 'antispoof-badtype' => 'Mauvais type de données', + 'antispoof-empty' => 'Chaîne vide', + 'antispoof-blacklisted' => 'Contient un caractère interdit', + 'antispoof-combining' => 'Commence avec une marque combinée', + 'antispoof-unassigned' => 'Contient un caractère non assigné ou obsolète', + 'antispoof-noletters' => 'Ne contient aucune lettre', + 'antispoof-mixedscripts' => 'Contient plusieurs scripts incompatibles', + 'antispoof-tooshort' => 'Nom canonique trop court', ); $wgAntiSpoofMessages['he'] = array( 'antispoof-name-conflict' => 'שם המשתמש "$1" שבחרתם דומה מדי לשם המשתמש הקיים "$2". אנא בחרו שם משתמש אחר.',
* (bug <I>) Update French messages patches by Rémi Kaupp
wikimedia_mediawiki-extensions-AntiSpoof
train
php
161460418e1b656f17ba2c0fd0da85d1024263fd
diff --git a/lib/pdf/reader/filter/run_length.rb b/lib/pdf/reader/filter/run_length.rb index <HASH>..<HASH> 100644 --- a/lib/pdf/reader/filter/run_length.rb +++ b/lib/pdf/reader/filter/run_length.rb @@ -15,11 +15,7 @@ class PDF::Reader # :nodoc: out = "" while pos < data.length - if data.respond_to?(:getbyte) - length = data.getbyte(pos) - else - length = data[pos] - end + length = data.getbyte(pos) pos += 1 case
all supported VMs support String#getbyte
yob_pdf-reader
train
rb
d13d8a4b2be94d12412e424cf2e7c18a7f99fe59
diff --git a/core/components/descriptors/src/main/java/org/mobicents/slee/container/component/validator/SbbComponentValidator.java b/core/components/descriptors/src/main/java/org/mobicents/slee/container/component/validator/SbbComponentValidator.java index <HASH>..<HASH> 100644 --- a/core/components/descriptors/src/main/java/org/mobicents/slee/container/component/validator/SbbComponentValidator.java +++ b/core/components/descriptors/src/main/java/org/mobicents/slee/container/component/validator/SbbComponentValidator.java @@ -111,6 +111,10 @@ public class SbbComponentValidator implements Validator { concreteMethods = ClassUtils.getConcreteMethodsFromClass(this.component.getAbstractSbbClass()); superClassesConcreteMethods = ClassUtils.getConcreteMethodsFromSuperClasses(this.component.getAbstractSbbClass()); + //NOTE: wont this hide method exceptions or visibility change? + superClassesAbstractMethod.keySet().removeAll(abstractMehotds.keySet()); + superClassesConcreteMethods.keySet().removeAll(concreteMethods.keySet()); + if (!validateAbstractClassConstraints(concreteMethods, superClassesConcreteMethods)) { valid = false; }
bug fixes: - remove double declarations of methods tests/activities/activitycontext/Test<I>Test.xml tests/activities/activitycontext/Test<I>Test.xml tests/activities/activitycontextinterface/Test<I>Test.xml tests/activities/nullactivity/Test<I>Test.xml git-svn-id: <URL>
RestComm_jain-slee
train
java
7fef11c5463b2d05cd13f3ca8d9a8fa6cdd9a291
diff --git a/tests/test_items/test_basics.py b/tests/test_items/test_basics.py index <HASH>..<HASH> 100644 --- a/tests/test_items/test_basics.py +++ b/tests/test_items/test_basics.py @@ -13,7 +13,7 @@ from exchangelib.extended_properties import ExternId from exchangelib.fields import TextField, BodyField, FieldPath, CultureField, IdField, ChoiceField, AttachmentField,\ BooleanField from exchangelib.indexed_properties import SingleFieldIndexedElement, MultiFieldIndexedElement -from exchangelib.items import CalendarItem, Contact, Task, DistributionList, BaseItem +from exchangelib.items import CalendarItem, Contact, Task, DistributionList, BaseItem, Item from exchangelib.properties import Mailbox, Attendee from exchangelib.queryset import Q from exchangelib.util import value_to_xml_text @@ -340,6 +340,10 @@ class CommonItemTest(BaseItemTest): continue if issubclass(f.value_cls, SingleFieldIndexedElement): continue + # This test is exceptionally slow. Only test list fields that are not also found on the base Item class + if self.ITEM_CLASS != Item: + if f.name in Item.FIELDS: + continue fields.append(f) if not fields: self.skipTest('No matching list fields on this model')
Skip testing fields that were already tested on the generic item
ecederstrand_exchangelib
train
py
251f3f4503ccc16caf83cf70ea68f17f6dc273f0
diff --git a/teamcity/flake8_plugin.py b/teamcity/flake8_plugin.py index <HASH>..<HASH> 100644 --- a/teamcity/flake8_plugin.py +++ b/teamcity/flake8_plugin.py @@ -1,6 +1,6 @@ try: - from flake8.formatting import base + from flake8.formatting import base # noqa except ImportError: - from flake8_v2_plugin import * + from flake8_v2_plugin import * # noqa else: - from flake8_v3_plugin import * + from flake8_v3_plugin import * # noqa
Fix flake8 errors in flake8_plugin.py by adding `#noqa` comments.
JetBrains_teamcity-messages
train
py
ea07e834aa271b28d0568512aeb6503f084307f4
diff --git a/src/main/java/uk/co/real_logic/agrona/collections/IntHashSet.java b/src/main/java/uk/co/real_logic/agrona/collections/IntHashSet.java index <HASH>..<HASH> 100644 --- a/src/main/java/uk/co/real_logic/agrona/collections/IntHashSet.java +++ b/src/main/java/uk/co/real_logic/agrona/collections/IntHashSet.java @@ -537,7 +537,7 @@ public final class IntHashSet implements Set<Integer> for (final int value : values) { - total += (31 * value); + total += value; } return total;
[Java] revert multiply hash code by a prime.
real-logic_agrona
train
java
87da80d28410b02162016d0fc258848c78e4b4b7
diff --git a/palm/framework/www/phonegap.js b/palm/framework/www/phonegap.js index <HASH>..<HASH> 100644 --- a/palm/framework/www/phonegap.js +++ b/palm/framework/www/phonegap.js @@ -697,18 +697,21 @@ function Sms() { * @param {PositionOptions} options The options for accessing the GPS location such as timeout and accuracy. */ Sms.prototype.send = function(number, message, successCallback, errorCallback, options) { - this.service = new Mojo.Service.Request('palm://com.palm.applicationManager', { - method:'launch', - parameters:{ - id:"com.palm.app.messaging", - params: { - composeAddress: number, - messageText: message - }, - onSuccess: function() {debug.log("success")}, - onFailure: function() {debug.log("failure")} - } - }); + try { + this.service = new Mojo.Service.Request('palm://com.palm.applicationManager', { + method:'launch', + parameters:{ + id:"com.palm.app.messaging", + params: { + composeAddress: number, + messageText: message + } + } + }); + successCallback(); + } catch (ex) { + errorCallback({ name: "SMSerror", message: ex.name + ": " + ex.message }); + } } if (typeof navigator.sms == "undefined") navigator.sms = new Sms();
skeleton app should have latest phonegap.js
apache_cordova-ios
train
js
66f9d57deaf15f6cb0b91ef92735bdd0c6343a78
diff --git a/libsubmit/version.py b/libsubmit/version.py index <HASH>..<HASH> 100644 --- a/libsubmit/version.py +++ b/libsubmit/version.py @@ -1,4 +1,4 @@ ''' Set module version <Major>.<Minor>.<maintenance>[-alpha/beta/..] ''' -VERSION = '0.3.2a0' +VERSION = '0.3.2'
Bumping version <I>a0 to <I> following cleared tests
Parsl_libsubmit
train
py
d398de431b5b1df64eeb9641df81eb29702c664e
diff --git a/code/administrator/components/com_activities/databases/rows/activity.php b/code/administrator/components/com_activities/databases/rows/activity.php index <HASH>..<HASH> 100644 --- a/code/administrator/components/com_activities/databases/rows/activity.php +++ b/code/administrator/components/com_activities/databases/rows/activity.php @@ -32,6 +32,27 @@ class ComActivitiesDatabaseRowActivity extends KDatabaseRowDefault return false; } + if (!$this->status) { + // Attempt to provide a default status. + switch ($this->action) { + case 'add': + $status = KDatabase::STATUS_CREATED; + break; + case 'edit': + $status = KDatabase::STATUS_UPDATED; + break; + case 'delete': + $status = KDatabase::STATUS_DELETED; + break; + default: + $status = null; + } + + if ($status) { + $this->status = $status; + } + } + return parent::save(); } } \ No newline at end of file
The row status now gets automatically added on some actions. re #<I>
joomlatools_joomlatools-framework
train
php
4d5974929145223195ce54369b06bea8e3c9e95f
diff --git a/app/jobs/indexer.rb b/app/jobs/indexer.rb index <HASH>..<HASH> 100644 --- a/app/jobs/indexer.rb +++ b/app/jobs/indexer.rb @@ -23,7 +23,7 @@ class Indexer # do all processing _before_ we upload anything to S3, so we lower the chances of orphaned files RubygemFs.instance.store(gem_path, gem_contents) - RubygemFs.instance.store(spec_path,spec_contents) + RubygemFs.instance.store(spec_path, spec_contents) Fastly.purge(path: gem_path) Fastly.purge(path: spec_path) diff --git a/test/integration/push_test.rb b/test/integration/push_test.rb index <HASH>..<HASH> 100644 --- a/test/integration/push_test.rb +++ b/test/integration/push_test.rb @@ -94,7 +94,7 @@ class PushTest < ActionDispatch::IntegrationTest test "push errors don't save files" do build_gem "sandworm", "1.0.0" do |spec| - spec.instance_variable_set :@authors, 'string' + spec.instance_variable_set :@authors, "string" end assert_nil Rubygem.find_by(name: "sandworm") push_gem "sandworm-1.0.0.gem"
Fix lint failures that made it to master
rubygems_rubygems.org
train
rb,rb
af85914ae3958e4efdc2927a3a121e362c900c77
diff --git a/src/actions/gesture.js b/src/actions/gesture.js index <HASH>..<HASH> 100644 --- a/src/actions/gesture.js +++ b/src/actions/gesture.js @@ -122,10 +122,10 @@ Interactable.prototype.gesturable = function (options) { return this.options.gesture; }; -signals.on('interactevent-delta', function (arg) { +signals.on('interactevent-gesture', function (arg) { if (arg.action !== 'gesture') { return; } - const { interaction, iEvent, starting, ending, deltaSource } = {arg}; + const { interaction, iEvent, starting, ending, deltaSource } = arg; const pointers = interaction.pointers; iEvent.touches = [pointers[0], pointers[1]];
actions/gesture: fix interactevent-gesture signal
taye_interact.js
train
js
f42f32792cecf39fb2d5e1c3d9c3de1e049e7eab
diff --git a/app/assets/javascripts/resources.js b/app/assets/javascripts/resources.js index <HASH>..<HASH> 100644 --- a/app/assets/javascripts/resources.js +++ b/app/assets/javascripts/resources.js @@ -70,7 +70,6 @@ angular.module('cortex.resources', [ per_page: per_page, total: total }; - debugger } // Call original callback
Removing a stray debugger reference.
cortex-cms_cortex
train
js
b368f959dcc64321f9d69a0b4c392c63e243ff3a
diff --git a/xdoctest/__main__.py b/xdoctest/__main__.py index <HASH>..<HASH> 100644 --- a/xdoctest/__main__.py +++ b/xdoctest/__main__.py @@ -147,7 +147,7 @@ def main(): run_summary = xdoctest.doctest_module(modname, argv=[command], style=style, verbose=config['verbose'], config=config, durations=durations) - n_failed = run_summary['n_failed'] + n_failed = run_summary.get('n_failed', 0) if n_failed > 0: sys.exit(1) else:
Default n_failed to 0
Erotemic_xdoctest
train
py
abaa7ea1ce101b4f7c2577dd16c1ec073bd55b97
diff --git a/puz.py b/puz.py index <HASH>..<HASH> 100644 --- a/puz.py +++ b/puz.py @@ -5,7 +5,7 @@ import string import struct import sys -PY3 = sys.version_info[0] == 3 +PY3 = sys.version_info[0] >= 3 if PY3: str = str
Let's assume these changes will make it through to Python 4
alexdej_puzpy
train
py
19df4f7b1265405e4f2c6ae8705af5ceae7796d4
diff --git a/packages/react/src/components/Switch/Switch.js b/packages/react/src/components/Switch/Switch.js index <HASH>..<HASH> 100644 --- a/packages/react/src/components/Switch/Switch.js +++ b/packages/react/src/components/Switch/Switch.js @@ -56,7 +56,9 @@ const Switch = React.forwardRef(function Switch(props, tabRef) { aria-selected={selected} {...other} {...commonProps}> - <span className={`${prefix}--content-switcher__label`}>{text}</span> + <span className={`${prefix}--content-switcher__label`} title={text}> + {text} + </span> </button> ); });
fix(ContentSwitcher): enable title by default (#<I>)
carbon-design-system_carbon-components
train
js