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
|
|---|---|---|---|---|---|
6449d80998fb1983951a3fce26825b1224469c34
|
diff --git a/src/stylable.js b/src/stylable.js
index <HASH>..<HASH> 100644
--- a/src/stylable.js
+++ b/src/stylable.js
@@ -5,7 +5,18 @@ import hoistStatics from 'hoist-non-react-statics'
import Node from './node'
function getDisplayName (comp) {
- return comp.displayName || comp.name || 'Component'
+ if (typeof comp.getName === 'function') {
+ return comp.getName()
+ }
+ if (typeof comp.tag === 'number') {
+ if (typeof comp.type === 'string') {
+ return comp.type
+ }
+ if (typeof comp.type === 'function') {
+ return comp.displayName || comp.name
+ }
+ }
+ return 'Component'
}
export default function stylable (name) {
|
fix: make getDisplayName to be almost equal to react getElementName
|
vovkasm_react-native-stylable
|
train
|
js
|
235859d75e4d8d6601085a7f8d788f48d163f039
|
diff --git a/src/types.js b/src/types.js
index <HASH>..<HASH> 100644
--- a/src/types.js
+++ b/src/types.js
@@ -19,10 +19,23 @@ export type InnerRef = ElementRef<typeof HTMLElement>;
export type PropsWithInnerRef = {
innerRef: InnerRef,
};
+
export type PropsWithStyles = {
getStyles: (string, any) => {},
};
+export type CommonProps = {
+ clearValue: () => void,
+ getStyles: (string, any) => {},
+ getValue: () => ValueType,
+ hasValue: boolean,
+ isMulti: boolean,
+ options: OptionsType,
+ selectOption: OptionType => void,
+ selectProps: any,
+ setValue: (ValueType, ActionTypes) => void,
+};
+
export type ActionTypes =
| 'select-option'
| 'deselect-option'
|
Adding CommonProps type (needs work to be applied everywhere)
|
JedWatson_react-select
|
train
|
js
|
83729e2fe36a0a629c2a5a52a7e2970287d57036
|
diff --git a/actionpack/lib/action_view/render/layouts.rb b/actionpack/lib/action_view/render/layouts.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_view/render/layouts.rb
+++ b/actionpack/lib/action_view/render/layouts.rb
@@ -65,7 +65,7 @@ module ActionView
if formats.size == 1
_find_layout(layout)
else
- update_details(:formats => self.formats.first){ _find_layout(layout) }
+ update_details(:formats => [self.formats.first]) { _find_layout(layout) }
end
rescue ActionView::MissingTemplate => e
update_details(:formats => nil) do
|
Formats should always be an array.
|
rails_rails
|
train
|
rb
|
5ad851d97495a2a200b7d5e16f9053351e68c4c5
|
diff --git a/src/TooltipFactory.js b/src/TooltipFactory.js
index <HASH>..<HASH> 100644
--- a/src/TooltipFactory.js
+++ b/src/TooltipFactory.js
@@ -341,7 +341,7 @@ var addMutation = function(tooltip) {
};
var addXRefs = function(tooltip, xrefs) {
- if (xrefs) {
+ if (xrefs && (xrefs.length !== 0)) {
var sourceRow = tooltip.table.append('tr')
.attr('class', 'up_pftv_evidence-source');
|
Check xrefs length.
|
ebi-uniprot_ProtVista
|
train
|
js
|
27fc1711da698d5534d1958d78fcca2e23184d1f
|
diff --git a/sos/plugins/libreswan.py b/sos/plugins/libreswan.py
index <HASH>..<HASH> 100644
--- a/sos/plugins/libreswan.py
+++ b/sos/plugins/libreswan.py
@@ -49,7 +49,7 @@ class Libreswan(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
self.add_forbidden_path([
'/etc/ipsec.secrets',
- '/etc/ipsec.secrets.d/*',
+ '/etc/ipsec.secrets.d',
'/etc/ipsec.d/*.db',
'/etc/ipsec.d/*.secrets'
])
|
[libreswan] fix directory blacklist style
Plugins must use 'path/to/exclude' rather than 'path/to/exclude/*'
in order to omit a directory and all its content from the report.
|
sosreport_sos
|
train
|
py
|
5361894bd1232f198c2bd56c4ebe6784ac60b3fb
|
diff --git a/tests/test_arg_parsing.py b/tests/test_arg_parsing.py
index <HASH>..<HASH> 100644
--- a/tests/test_arg_parsing.py
+++ b/tests/test_arg_parsing.py
@@ -18,7 +18,7 @@ from cookiecutter import main
def test_parse_cookiecutter_args():
args = main.parse_cookiecutter_args(['project/'])
assert args.input_dir == 'project/'
- assert args.checkout == None
+ assert args.checkout is None
def test_parse_cookiecutter_args_with_branch():
|
Change comparision to 'is' in order to fix flake8
|
audreyr_cookiecutter
|
train
|
py
|
e1e8cbaa57032de76c2b8511f7f4c571c186880a
|
diff --git a/lib/sup/mode.rb b/lib/sup/mode.rb
index <HASH>..<HASH> 100644
--- a/lib/sup/mode.rb
+++ b/lib/sup/mode.rb
@@ -83,6 +83,7 @@ EOS
### helper functions
def save_to_file fn, talk=true
+ FileUtils.mkdir_p File.dirname(fn)
if File.exist? fn
unless BufferManager.ask_yes_or_no "File \"#{fn}\" exists. Overwrite?"
info "Not overwriting #{fn}"
|
Create directory for saving files if it doesn't exist yet
|
sup-heliotrope_sup
|
train
|
rb
|
b96f176cc1afa11792256815195449a3228a3839
|
diff --git a/lib/toml-rb/dumper.rb b/lib/toml-rb/dumper.rb
index <HASH>..<HASH> 100644
--- a/lib/toml-rb/dumper.rb
+++ b/lib/toml-rb/dumper.rb
@@ -93,12 +93,12 @@ module TomlRB
obj.strftime("%Y-%m-%dT%H:%M:%SZ")
elsif obj.is_a?(Date)
obj.strftime("%Y-%m-%d")
- elsif obj.is_a? Regexp
+ elsif obj.is_a?(Regexp)
obj.inspect.inspect
- elsif obj.is_a? String
+ elsif obj.is_a?(String)
obj.inspect.gsub(/\\(#[$@{])/, '\1')
- elsif obj.is_a? Array
- '[' + obj.map(&method(:to_toml)).join(', ') + ']'
+ elsif obj.is_a?(Array)
+ "[" + obj.map(&method(:to_toml)).join(", ") + "]"
else
obj.inspect
end
|
Fix linter and sytle-inconsistency.
|
emancu_toml-rb
|
train
|
rb
|
310bfcae6166496eeffb5624e2bf887903197921
|
diff --git a/src/Engine/SocketIO.php b/src/Engine/SocketIO.php
index <HASH>..<HASH> 100644
--- a/src/Engine/SocketIO.php
+++ b/src/Engine/SocketIO.php
@@ -81,10 +81,9 @@ abstract class SocketIO implements EngineInterface
*/
protected function getServerInformation()
{
- $server = array_replace($this->url, ['scheme' => 'http',
- 'host' => 'localhost',
- 'path' => 'socket.io',
- 'transport' => static::TRANSPORT_POLLING]);
+ $server = array_replace($this->url, ['scheme' => 'http',
+ 'host' => 'localhost',
+ 'path' => 'socket.io']);
if (!isset($server['port'])) {
$server['port'] = 'https' === $server['scheme'] ? 443 : 80;
@@ -94,6 +93,8 @@ abstract class SocketIO implements EngineInterface
$server['scheme'] = 'ssl';
}
+ $server['transport'] = $this->transport ?: static::TRANSPORT_POLLING;
+
return $server;
}
|
The transport should not be in the url configuration
|
Wisembly_elephant.io
|
train
|
php
|
cf78d13c6d17e8413d08bc1758f385dcc79daf3b
|
diff --git a/Kwc/Form/Component.php b/Kwc/Form/Component.php
index <HASH>..<HASH> 100644
--- a/Kwc/Form/Component.php
+++ b/Kwc/Form/Component.php
@@ -134,7 +134,6 @@ class Kwc_Form_Component extends Kwc_Abstract_Composite_Component
if (!$this->_errors) {
try {
$this->_form->prepareSave(null, $postData);
- $this->_beforeSave($this->_form->getRow());
$isInsert = false;
if (!$this->_form->getRow()->{$this->_form->getModel()->getPrimaryKey()}) {
$isInsert = true;
@@ -142,14 +141,15 @@ class Kwc_Form_Component extends Kwc_Abstract_Composite_Component
} else {
$this->_beforeUpdate($this->_form->getRow());
}
+ $this->_beforeSave($this->_form->getRow());
$this->_form->save(null, $postData);
- $this->_form->afterSave(null, $postData);
- $this->_afterSave($this->_form->getRow());
if ($isInsert) {
$this->_afterInsert($this->_form->getRow());
} else {
$this->_afterUpdate($this->_form->getRow());
}
+ $this->_form->afterSave(null, $postData);
+ $this->_afterSave($this->_form->getRow());
$this->_isSaved = true;
} catch (Exception $e) {
$this->_handleProcessException($e);
|
fixed order of before-/after- save calls in form component
correct is beforeInsert/beforeUpdate - beforeSave - save - afterInsert/afterUpdate - afterSave
|
koala-framework_koala-framework
|
train
|
php
|
a4ec698624cff5180dd50bfe088b686c63f8fa05
|
diff --git a/lib/cli/finder.js b/lib/cli/finder.js
index <HASH>..<HASH> 100644
--- a/lib/cli/finder.js
+++ b/lib/cli/finder.js
@@ -135,7 +135,15 @@ function find(globs, callback) {
}
return globs.some(function (glob) {
- return match(filePath, glob) && stat(filePath).isFile();
+ if (!stat(filePath).isFile()) {
+ return false;
+ }
+
+ if (hasMagic(glob)) {
+ return match(filePath, glob);
+ }
+
+ return given.indexOf(filePath) !== -1;
});
}, filePaths, function (err, files) {
callback(err, failed.concat(files).map(function (file) {
|
Fix non-magic globs from matching all files
For a while, remark(1) included all files nested in directories
if that directory was given on the CLI. For example, if `content`
was given, `content/foo.jpg` was included by mistake. Now, if a glob
does not contain magic (as in, it is a file-path) and represents a
directory, only files with known markdown extensions in it are
included.
Related to <URL>
|
remarkjs_remark
|
train
|
js
|
79549d665e6e37204918d3f880f34ec52a01c321
|
diff --git a/openquake/engine/utils/tasks.py b/openquake/engine/utils/tasks.py
index <HASH>..<HASH> 100644
--- a/openquake/engine/utils/tasks.py
+++ b/openquake/engine/utils/tasks.py
@@ -157,9 +157,9 @@ def oqtask(task_func):
# the revoke functionality can work
EnginePerformanceMonitor.store_task_id(job_id, tsk)
- with (EnginePerformanceMonitor(
- 'total ' + task_func.__name__, job_id, tsk, flush=True),
- logs.handle(job)):
+ with EnginePerformanceMonitor(
+ 'total ' + task_func.__name__, job_id, tsk, flush=True), \
+ logs.handle(job):
try:
# log a warning if too much memory is used
check_mem_usage(SOFT_MEM_LIMIT, HARD_MEM_LIMIT)
|
Removed parens breaking a with statement
Former-commit-id: d<I>f5c<I>e6f<I>fafc<I>efb<I>cf4ded3f
|
gem_oq-engine
|
train
|
py
|
cdbaf33fc17d722fc849c656c3bb97673bd354f3
|
diff --git a/src/nwmatcher.js b/src/nwmatcher.js
index <HASH>..<HASH> 100644
--- a/src/nwmatcher.js
+++ b/src/nwmatcher.js
@@ -69,9 +69,13 @@ NW.Dom = (function(global) {
reIdSelector = /\#([-\w]+)$/,
reWhiteSpace = /[\x20\t\n\r\f]+/g,
+ // match missing R/L context
reLeftContext = /^\s*[>+~]+/,
reRightContext = /[>+~]+\s*$/,
+ // match the document type
+ reDocumentType = / [XHTML]+ /,
+
/*----------------------------- UTILITY METHODS ----------------------------*/
slice = Array.prototype.slice,
|
added regular expression to aid in guessing document type, added missing comment
|
dperini_nwmatcher
|
train
|
js
|
9211b3a3d2133a30e591e2c4ff1b25b6b3ba2ce4
|
diff --git a/dynamic_rest/viewsets.py b/dynamic_rest/viewsets.py
index <HASH>..<HASH> 100644
--- a/dynamic_rest/viewsets.py
+++ b/dynamic_rest/viewsets.py
@@ -519,12 +519,9 @@ class DynamicModelViewSet(WithDynamicViewSetMixin, viewsets.ModelViewSet):
bulk_payload = self._get_bulk_payload(request)
if bulk_payload:
return self._destroy_many(bulk_payload)
- try:
- # check if the request is formatted in such a way that
- # we can get the object
- self.get_object()
- except:
- # if not, assume that it is a poorly formatted bulk request
+ lookup_url_kwarg = self.lookup_url_kwarg or self.lookup_field
+ if lookup_url_kwarg not in kwargs:
+ # assume that it is a poorly formatted bulk request
return Response(status=status.HTTP_405_METHOD_NOT_ALLOWED)
return super(DynamicModelViewSet, self).destroy(
request, *args, **kwargs)
|
Only return <I> on AssertionError (unable to retrieve pk)
|
AltSchool_dynamic-rest
|
train
|
py
|
d305465256be19dfc0163c300821c0913d930189
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@ instructions.
setup(
name="django-prometheus",
- version="0.0.8",
+ version="0.0.9",
author="Uriel Corfa",
author_email="uriel@corfa.fr",
description=(
|
Release <I>
Breaking change: the in-thread exporter is now disabled by default,
and exporting /metrics as a django view is now the "common" way of
doing things.
|
korfuri_django-prometheus
|
train
|
py
|
5b652bcfd8552bba4c7aafefa84be0f0cf90ba21
|
diff --git a/client/consul/sync.go b/client/consul/sync.go
index <HASH>..<HASH> 100644
--- a/client/consul/sync.go
+++ b/client/consul/sync.go
@@ -268,8 +268,8 @@ func (c *ConsulService) deregisterCheck(ID string) error {
return c.client.Agent().CheckDeregister(ID)
}
-// SyncWithConsul triggers periodic syncing of services and checks with Consul
-func (c *ConsulService) SyncWithConsul() {
+// PeriodicSync triggers periodic syncing of services and checks with Consul
+func (c *ConsulService) PeriodicSync() {
sync := time.After(syncInterval)
for {
select {
diff --git a/client/driver/executor/executor.go b/client/driver/executor/executor.go
index <HASH>..<HASH> 100644
--- a/client/driver/executor/executor.go
+++ b/client/driver/executor/executor.go
@@ -359,7 +359,7 @@ func (e *UniversalExecutor) RegisterServices() error {
e.consulService = cs
}
err := e.consulService.SyncTask(e.ctx.Task)
- go e.consulService.SyncWithConsul()
+ go e.consulService.PeriodicSync()
return err
}
|
Renaming the SyncWithConsul method
|
hashicorp_nomad
|
train
|
go,go
|
b262f2cd341fff3553008a4228b45bf808bcce7f
|
diff --git a/javascript/hasoneautocompletefield.js b/javascript/hasoneautocompletefield.js
index <HASH>..<HASH> 100644
--- a/javascript/hasoneautocompletefield.js
+++ b/javascript/hasoneautocompletefield.js
@@ -105,15 +105,15 @@
getCurrentTextElement: function() {
- return this.closest('.field').find('.hasoneautocomplete-currenttext').first();
+ return this.closest('.hasoneautocomplete').find('.hasoneautocomplete-currenttext').first();
},
getIDElement: function() {
- return this.closest('.field').find('.hasoneautocomplete-id').first();
+ return this.closest('.hasoneautocomplete').find('.hasoneautocomplete-id').first();
},
getFieldElement: function() {
- return this.closest('.field');
+ return this.closest('.hasoneautocomplete');
}
});
|
Update JS to account for FieldGroup markup changing between SS versions
|
nathancox_silverstripe-hasoneautocompletefield
|
train
|
js
|
f166b5945a63b3f13288faa4dc378aabef18d43b
|
diff --git a/lib/cancan/controller_additions.rb b/lib/cancan/controller_additions.rb
index <HASH>..<HASH> 100644
--- a/lib/cancan/controller_additions.rb
+++ b/lib/cancan/controller_additions.rb
@@ -151,6 +151,9 @@ module CanCan
# [:+except+]
# Does not apply before filter to given actions.
#
+ # [:+singleton+]
+ # Pass +true+ if this is a singleton resource through a +has_one+ association.
+ #
# [:+parent+]
# True or false depending on if the resource is considered a parent resource. This defaults to +true+ if a resource
# name is given which does not match the controller.
|
Just add singleton to description of authorize_resource
|
ryanb_cancan
|
train
|
rb
|
a407951ee5a8f2cd47d3fad7ff1c0a7552c8d0a5
|
diff --git a/pytodoist/todoist.py b/pytodoist/todoist.py
index <HASH>..<HASH> 100644
--- a/pytodoist/todoist.py
+++ b/pytodoist/todoist.py
@@ -1119,7 +1119,7 @@ class RequestError(Exception):
HTTP_OK = 200
def _fail_if_contains_errors(response):
- """Raise a TodoistError Exception if a given response
+ """Raise a RequestError Exception if a given response
does not denote a successful request.
"""
if _contains_errors(response):
|
Fixed a docstring inconsistency.
|
Garee_pytodoist
|
train
|
py
|
75d4ac6ae930196bbf40e98f73e1a92f0b369c86
|
diff --git a/src/CRUDlex/CRUDControllerProvider.php b/src/CRUDlex/CRUDControllerProvider.php
index <HASH>..<HASH> 100644
--- a/src/CRUDlex/CRUDControllerProvider.php
+++ b/src/CRUDlex/CRUDControllerProvider.php
@@ -205,7 +205,7 @@ class CRUDControllerProvider implements ControllerProviderInterface {
}
$definition = $crudData->getDefinition();
$pageSize = $definition->getPageSize();
- $total = $crudData->countBy($definition->getTable(), array(), array(), false);
+ $total = $crudData->countBy($definition->getTable(), array(), array(), true);
$page = abs(intval($app['request']->get('crudPage', 0)));
$maxPage = intval($total / $pageSize);
if ($total % $pageSize == 0) {
|
don't count soft deleted items in the total amount on the list page
|
philiplb_CRUDlex
|
train
|
php
|
a8dccbc3be9bbbfd25fc6776c9412055e382d998
|
diff --git a/lib/ecm/videos/version.rb b/lib/ecm/videos/version.rb
index <HASH>..<HASH> 100644
--- a/lib/ecm/videos/version.rb
+++ b/lib/ecm/videos/version.rb
@@ -1,5 +1,5 @@
module Ecm
module Videos
- VERSION = '2.0.0'.freeze
+ VERSION = '2.1.0'.freeze
end
end
|
Bumped version to <I>
|
robotex82_ecm_videos
|
train
|
rb
|
9a427513229df7f218ecab8d9e214222302f3531
|
diff --git a/src/Jasny/Router.php b/src/Jasny/Router.php
index <HASH>..<HASH> 100644
--- a/src/Jasny/Router.php
+++ b/src/Jasny/Router.php
@@ -326,7 +326,7 @@ class Router
*/
public function getUrl()
{
- if (!isset($this->url)) $this->url = preg_replace('/\?.*$/', '', $_SERVER['REQUEST_URI']);
+ if (!isset($this->url)) $this->url = urldecode(preg_replace('/\?.*$/', '', $_SERVER['REQUEST_URI']));
return $this->url;
}
|
Decode the URL got from $_SERVER['REQUEST_URI']
|
jasny_router
|
train
|
php
|
d60e2ffe0190f1472f38f8e1152da61c598920e9
|
diff --git a/spyder/widgets/variableexplorer/dataframeeditor.py b/spyder/widgets/variableexplorer/dataframeeditor.py
index <HASH>..<HASH> 100644
--- a/spyder/widgets/variableexplorer/dataframeeditor.py
+++ b/spyder/widgets/variableexplorer/dataframeeditor.py
@@ -45,7 +45,7 @@ COMPLEX_NUMBER_TYPES = (complex, np.complex64, np.complex128)
_bool_false = ['false', '0']
# Default format for data frames with floats
-DEFAULT_FORMAT = '%.3g'
+DEFAULT_FORMAT = '%.6g'
# Limit at which dataframe is considered so large that it is loaded on demand
LARGE_SIZE = 5e5
|
Default float format change
Edited default float format, according to previous change in array editor.
|
spyder-ide_spyder
|
train
|
py
|
55cbcdb8f8e18630061e13f8e358c39341d54d1d
|
diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -17,9 +17,6 @@ export default function serve (options = { contentBase: '' }) {
options.https = options.https || false
mime.default_type = 'text/plain'
- let server
- // Fallback to http protocol if https option is false or SSL cert files do not exist
- const PROTOCOL = (options.https && 'https://') || 'http://'
const requestListener = (request, response) => {
// Remove querystring
const urlPath = decodeURI(request.url.split('?')[0])
@@ -65,6 +62,8 @@ export default function serve (options = { contentBase: '' }) {
})
}
+ // If HTTPS options are available, create an HTTPS server
+ let server
if (options.https) {
server = createHttpsServer(options.https, requestListener).listen(options.port)
} else {
@@ -82,7 +81,7 @@ export default function serve (options = { contentBase: '' }) {
running = true
// Log which url to visit
- const url = `${PROTOCOL + options.host}:${options.port}`
+ const url = (options.https ? 'https' : 'http') + '://' + options.host + ':' + options.port
options.contentBase.forEach(base => {
console.log(green(url) + ' -> ' + resolve(base))
})
|
Cleanup
Refactor single-use `PROTOCOL` variable
Move declaration of `server`
|
thgh_rollup-plugin-serve
|
train
|
js
|
39087184f144dfa83dd4b037d3f99c3435f20fe0
|
diff --git a/faq-bundle/contao/dca/tl_faq.php b/faq-bundle/contao/dca/tl_faq.php
index <HASH>..<HASH> 100644
--- a/faq-bundle/contao/dca/tl_faq.php
+++ b/faq-bundle/contao/dca/tl_faq.php
@@ -368,7 +368,7 @@ class tl_faq extends Backend
if (!strlen($varValue))
{
$autoAlias = true;
- $varValue = standardize($this->restoreBasicEntities($dc->activeRecord->question));
+ $varValue = standardize(String::restoreBasicEntities($dc->activeRecord->question));
}
$objAlias = $this->Database->prepare("SELECT id FROM tl_faq WHERE alias=?")
|
[Faq] Moved `Controller::restoreBasicEntities()` to the `String` class (see #<I>)
|
contao_contao
|
train
|
php
|
14f0943fe8ee63050146b44cb949e4887ee5261f
|
diff --git a/generators/app/templates/api/auth/auth.router.test.js b/generators/app/templates/api/auth/auth.router.test.js
index <HASH>..<HASH> 100644
--- a/generators/app/templates/api/auth/auth.router.test.js
+++ b/generators/app/templates/api/auth/auth.router.test.js
@@ -66,16 +66,6 @@ test.serial('POST /auth 400 (master) - invalid password', async (t) => {
t.true(body.param === 'password')
})
-test.serial('POST /auth 400 (master) - invalid password', async (t) => {
- const { status, body } = await request(app())
- .post('/')
- .query({ access_token: masterKey })
- .auth('a@a.com', '123')
- t.true(status === 400)
- t.true(typeof body === 'object')
- t.true(body.param === 'password')
-})
-
test.serial('POST /auth 401 (master) - user does not exist', async (t) => {
const { status } = await request(app())
.post('/')
|
Remove duplicate test from auth router tests
|
diegohaz_rest
|
train
|
js
|
d8ce91dadfd4360b0e14f30e938f92a595227a87
|
diff --git a/framework/js/onsen.js b/framework/js/onsen.js
index <HASH>..<HASH> 100644
--- a/framework/js/onsen.js
+++ b/framework/js/onsen.js
@@ -549,7 +549,9 @@ limitations under the License.
}
};
- return ons._createPopoverOriginal(page, options);
+ return ons._createPopoverOriginal(page, options).then(function(popover) {
+ return angular.element(popover).data('ons-popover');
+ });
},
/**
|
fix(ons-popover): Changed ons.createPopover() to resolve component view object instead of ons-popover element on angular bindings.
|
OnsenUI_OnsenUI
|
train
|
js
|
1c160f016ce7b1d3802ba1963c7ce536f21da822
|
diff --git a/shakedown/cli/helpers.py b/shakedown/cli/helpers.py
index <HASH>..<HASH> 100644
--- a/shakedown/cli/helpers.py
+++ b/shakedown/cli/helpers.py
@@ -67,6 +67,7 @@ def fchr(char):
return {
'PP': chr(10003),
'FF': chr(10005),
+ 'SK': chr(10073),
'>>': chr(12299)
}.get(char, '')
diff --git a/shakedown/cli/main.py b/shakedown/cli/main.py
index <HASH>..<HASH> 100644
--- a/shakedown/cli/main.py
+++ b/shakedown/cli/main.py
@@ -181,6 +181,8 @@ def cli(**args):
schr = fchr('FF')
elif state == 'pass':
schr = fchr('PP')
+ elif state == 'skip':
+ schr = fchr('SK')
else:
schr = ''
|
adding a pause char for skip
|
dcos_shakedown
|
train
|
py,py
|
46d9ae82539aff0af5c8702e21641cfa8935a114
|
diff --git a/schema.js b/schema.js
index <HASH>..<HASH> 100644
--- a/schema.js
+++ b/schema.js
@@ -25,7 +25,7 @@ class SchemaItem {
// mapping names to either attributes (to add) or null (to remove
// the attribute by that name).
static updateAttrs(attrs) {
- this.prototype.attrs = overlayObj(this.prototype.attrs, attrs)
+ Object.defineProperty(this.prototype, "attrs", {value: overlayObj(this.prototype.attrs, attrs)})
}
// For node types where all attrs have a default value (or which don't
|
Fix the way updateAttrs overwrites the member property
|
ProseMirror_prosemirror-model
|
train
|
js
|
6135bf0cb614a18d0c044161cbe5b08fbf0788fd
|
diff --git a/lib/dm-migrations/adapters/dm-sqlserver-adapter.rb b/lib/dm-migrations/adapters/dm-sqlserver-adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/dm-migrations/adapters/dm-sqlserver-adapter.rb
+++ b/lib/dm-migrations/adapters/dm-sqlserver-adapter.rb
@@ -47,7 +47,7 @@ module DataMapper
# TODO: update dkubb/dm-more/dm-migrations to use schema_name and remove this
- alias db_name schema_name
+ alias_method :db_name, :schema_name
# @api private
def create_table_statement(connection, model, properties)
diff --git a/lib/dm-migrations/sql/table_modifier.rb b/lib/dm-migrations/sql/table_modifier.rb
index <HASH>..<HASH> 100644
--- a/lib/dm-migrations/sql/table_modifier.rb
+++ b/lib/dm-migrations/sql/table_modifier.rb
@@ -28,7 +28,7 @@ module SQL
@statements << "ALTER TABLE #{quoted_table_name} DROP COLUMN #{quote_column_name(name)}"
end
end
- alias drop_columns drop_column
+ alias_method :drop_columns, :drop_column
def rename_column(name, new_name, opts = {})
# raise NotImplemented for SQLite3
|
Changed usage of alias to alias_method
|
datamapper_dm-migrations
|
train
|
rb,rb
|
932bf325530c2cd61789c91213aa42b5fc2d30ea
|
diff --git a/app.py b/app.py
index <HASH>..<HASH> 100644
--- a/app.py
+++ b/app.py
@@ -181,7 +181,6 @@ def get_random_condcount():
filter(or_(Participant.status == 4,
Participant.status == 5,
Participant.beginhit > starttime)).\
- filter(Participant.cond<4).\
all()
counts = Counter()
for cond in range(numconds):
|
Delete line that prevents previous conditions>3 to be counted before drawing new condition
|
NYUCCL_psiTurk
|
train
|
py
|
e8f976f575e0ae0d9b73ebca3e40aa2437d9a358
|
diff --git a/src/Git/CheckedOutRepository.php b/src/Git/CheckedOutRepository.php
index <HASH>..<HASH> 100644
--- a/src/Git/CheckedOutRepository.php
+++ b/src/Git/CheckedOutRepository.php
@@ -17,7 +17,6 @@ final class CheckedOutRepository
public static function fromPath(string $path) : self
{
- Assert::that($path)->directory();
Assert::that($path . '/.git')->directory();
$instance = new self();
$instance->path = $path;
diff --git a/test/unit/Git/CheckedOutRepositoryTest.php b/test/unit/Git/CheckedOutRepositoryTest.php
index <HASH>..<HASH> 100644
--- a/test/unit/Git/CheckedOutRepositoryTest.php
+++ b/test/unit/Git/CheckedOutRepositoryTest.php
@@ -30,6 +30,13 @@ final class CheckedOutRepositoryTest extends TestCase
rmdir($path);
}
+ public function testFromPathRejectsNonGitDirectory() : void
+ {
+ $this->expectException(AssertionFailedException::class);
+
+ CheckedOutRepository::fromPath(__DIR__);
+ }
+
public function testFromPathRejectsNonExistingDirectory() : void
{
$this->expectException(AssertionFailedException::class);
|
Verify that non-git directories are rejected in `CheckedOutRepository`
|
Roave_BackwardCompatibilityCheck
|
train
|
php,php
|
b7469b553d4eade2e84728eed93730d559ca809c
|
diff --git a/tests/dummy/app/controllers/application.js b/tests/dummy/app/controllers/application.js
index <HASH>..<HASH> 100644
--- a/tests/dummy/app/controllers/application.js
+++ b/tests/dummy/app/controllers/application.js
@@ -6,7 +6,7 @@ export default Ember.Controller.extend({
dynamicCurrent: 5,
actions: {
- pageChanged(direction, page, last) {
+ pageChanged: function (direction, page, last) {
console.log(direction, page, last);
}
}
|
Fix dummy for prod build
|
knownasilya_pagination-pager
|
train
|
js
|
c65b24335453ed1809b238bd33e9a8da5ad59964
|
diff --git a/lib/better_errors/error_page.rb b/lib/better_errors/error_page.rb
index <HASH>..<HASH> 100644
--- a/lib/better_errors/error_page.rb
+++ b/lib/better_errors/error_page.rb
@@ -28,6 +28,11 @@ module BetterErrors
def render(template_name = "main")
binding.eval(self.class.template(template_name).src)
+ rescue => e
+ # Fix the backtrace, which doesn't identify the template that failed (within Better Errors).
+ # We don't know the line number, so just injecting the template path has to be enough.
+ e.backtrace.unshift "#{self.class.template_path(template_name)}:0"
+ raise
end
def do_variables(opts)
|
Improve backtrace when a BE template raises error
This is purely for BE development.
|
BetterErrors_better_errors
|
train
|
rb
|
9de360fff88c3b3eb6e1555fe470a473fb23f574
|
diff --git a/djcelery/snapshot.py b/djcelery/snapshot.py
index <HASH>..<HASH> 100644
--- a/djcelery/snapshot.py
+++ b/djcelery/snapshot.py
@@ -33,7 +33,7 @@ debug = logger.debug
def aware_tstamp(secs):
"""Event timestamps uses the local timezone."""
- return maybe_make_aware(datetime.fromtimestamp(secs))
+ return maybe_make_aware(datetime.utcfromtimestamp(secs))
class Camera(Polaroid):
|
Fix snapshot.aware_tstamp by converting from utc timestamp
|
celery_django-celery
|
train
|
py
|
6109df8d36909414a0c82da2447f467371ab63c0
|
diff --git a/src/views/part/_objectParts.php b/src/views/part/_objectParts.php
index <HASH>..<HASH> 100644
--- a/src/views/part/_objectParts.php
+++ b/src/views/part/_objectParts.php
@@ -78,6 +78,7 @@ echo \hipanel\grid\GridView::widget([
[
'label' => Yii::t('hipanel.finance.price', 'Price'),
'attribute' => 'price',
+ 'visible' => Yii::$app->user->can('part.read'),
'value' => static function ($models) {
return implode(', ', array_map(static function ($parts) {
$part = reset($parts);
|
Due to use the `_objectParts` view from other modules, it was necessary to additionally limit visibility
|
hiqdev_hipanel-module-stock
|
train
|
php
|
5f0d07b36bcd34988fd064596a7784aeadea4e09
|
diff --git a/src/transformers/models/big_bird/modeling_big_bird.py b/src/transformers/models/big_bird/modeling_big_bird.py
index <HASH>..<HASH> 100755
--- a/src/transformers/models/big_bird/modeling_big_bird.py
+++ b/src/transformers/models/big_bird/modeling_big_bird.py
@@ -1378,6 +1378,13 @@ class BigBirdAttention(nn.Module):
from_blocked_mask=None,
to_blocked_mask=None,
):
+ # fp16 compatibility
+ if band_mask is not None:
+ band_mask = band_mask.to(hidden_states.dtype)
+ if from_mask is not None:
+ from_mask = from_mask.to(hidden_states.dtype)
+ if to_mask is not None:
+ to_mask = to_mask.to(hidden_states.dtype)
if self.attention_type == "original_full":
self_outputs = self.self(
|
Make BigBird model compatiable to fp<I> dtype. (#<I>)
* Make BigBird model compatiable to fp<I> dtype.
* Use tree_map instead of map
* Reformat the code
* Fix import order
* Convert masks to the correct dtype
* Fix format issue
* Address comments.
|
huggingface_pytorch-pretrained-BERT
|
train
|
py
|
431b947149a838e8cb8acc86e18dfb8cdf43386c
|
diff --git a/cmd/influx_inspect/help/help.go b/cmd/influx_inspect/help/help.go
index <HASH>..<HASH> 100644
--- a/cmd/influx_inspect/help/help.go
+++ b/cmd/influx_inspect/help/help.go
@@ -31,6 +31,7 @@ Usage: influx_inspect [[command] [arguments]]
The commands are:
+ dumptsi dumps low-level details about tsi1 files.
dumptsm dumps low-level details about tsm1 files.
export exports raw data from a shard to line protocol
help display this help message
|
Add dumptsi command to help command.
|
influxdata_influxdb
|
train
|
go
|
f7e8cb31d4fc08307b90654007dc7bff146c7b69
|
diff --git a/bbb.go b/bbb.go
index <HASH>..<HASH> 100644
--- a/bbb.go
+++ b/bbb.go
@@ -238,17 +238,19 @@ func (p *bbbAnalogPin) Close() error {
return nil
}
-// BBBPWMDefaultPolarity represents the default polarity (Positve or 1) for pwm.
-const BBBPWMDefaultPolarity = Positive
+const (
+ // BBBPWMDefaultPolarity represents the default polarity (Positve or 1) for pwm.
+ BBBPWMDefaultPolarity = Positive
-// BBBPWMDefaultDuty represents the default duty (0ns) for pwm.
-const BBBPWMDefaultDuty = 0
+ // BBBPWMDefaultDuty represents the default duty (0ns) for pwm.
+ BBBPWMDefaultDuty = 0
-// BBBPWMDefaultPeriod represents the default period (500000ns) for pwm.
-const BBBPWMDefaultPeriod = 500000
+ // BBBPWMDefaultPeriod represents the default period (500000ns) for pwm.
+ BBBPWMDefaultPeriod = 500000
-// BBBPWMMaxPulseWidth represents the max period (1000000000ns) supported by pwm.
-const BBBPWMMaxPulseWidth = 1000000000
+ // BBBPWMMaxPulseWidth represents the max period (1000000000ns) supported by pwm.
+ BBBPWMMaxPulseWidth = 1000000000
+)
type bbbPWMPin struct {
n string
|
doc: group the bbb constants together
|
kidoman_embd
|
train
|
go
|
5aed0aced14fd29f414bd9e962d6e31ea2e2b175
|
diff --git a/robotium-solo/src/main/java/com/jayway/android/robotium/solo/ScreenshotTaker.java b/robotium-solo/src/main/java/com/jayway/android/robotium/solo/ScreenshotTaker.java
index <HASH>..<HASH> 100644
--- a/robotium-solo/src/main/java/com/jayway/android/robotium/solo/ScreenshotTaker.java
+++ b/robotium-solo/src/main/java/com/jayway/android/robotium/solo/ScreenshotTaker.java
@@ -211,10 +211,12 @@ class ScreenshotTaker {
Bitmap orig = view.getDrawingCache();
Bitmap.Config config = null;
- if(orig != null) {
- config = orig.getConfig();
+ if(orig == null) {
+ return null;
}
+ config = orig.getConfig();
+
if(config == null) {
config = Bitmap.Config.ARGB_8888;
}
|
Bugfix for issue-<I>
|
RobotiumTech_robotium
|
train
|
java
|
e56b55fd045f4e81e9d7ebb6b0f1ea25713ec33a
|
diff --git a/scraper.rb b/scraper.rb
index <HASH>..<HASH> 100644
--- a/scraper.rb
+++ b/scraper.rb
@@ -55,10 +55,20 @@ class Scraper
end
end
+ private
+
+ def self.rules
+ @rules ||= {}
+ end
+
+ def self.inherited(subclass)
+ subclass.rules.update self.rules
+ end
+
# Rule declaration is in Hash or single argument form:
#
- # { '//some/selector' => :name, :with => MyClass }
- # #=> ['//some/selector', :name, MyClass]
+ # { '//some/selector' => :name, :with => delegate }
+ # #=> ['//some/selector', :name, delegate]
#
# :title
# #=> ['title', :title, nil]
@@ -72,14 +82,6 @@ class Scraper
return selector, property, delegate
end
- def self.rules
- @rules ||= {}
- end
-
- def self.inherited(subclass)
- subclass.rules.update self.rules
- end
-
def initialize_plural_accessors
self.class.rules.each do |name, (s, k, plural)|
send("#{name}=", []) if plural
|
declare methods that usually shouldn't be overriden as private
|
mislav_nibbler
|
train
|
rb
|
c632d917214c104f44c5a9fba532d26af4e8866f
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -22,5 +22,5 @@ setup(
setup_requires=['pytest-runner', 'setuptools_scm'],
# put pytest last to workaround this bug
# https://bitbucket.org/pypa/setuptools/issues/196/tests_require-pytest-pytest-cov-breaks
- tests_require=['mock', 'pytest-timeout', 'moto', 'responses', 'scipy', 'pytest'],
+ tests_require=['mock', 'pytest-timeout', 'moto<=1.1.22', 'responses', 'scipy', 'pytest'],
)
|
Pin moto version
This is to circumvent an upstream issue with a required library (aws-xray-sdk) that is
pinned to a version not available on pypi anymore.
|
mozilla_python_moztelemetry
|
train
|
py
|
5584229e3e0090a2cc7a5a4d70100219eca6f584
|
diff --git a/core/src/main/java/hudson/model/TopLevelItemDescriptor.java b/core/src/main/java/hudson/model/TopLevelItemDescriptor.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/hudson/model/TopLevelItemDescriptor.java
+++ b/core/src/main/java/hudson/model/TopLevelItemDescriptor.java
@@ -40,6 +40,7 @@ import org.kohsuke.stapler.jelly.JellyClassTearOff;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import java.io.StringWriter;
+import java.util.logging.Level;
import java.util.logging.Logger;
/**
@@ -157,7 +158,7 @@ public abstract class TopLevelItemDescriptor extends Descriptor<TopLevelItem> {
dsi.invokeScript(Stapler.getCurrentRequest(), Stapler.getCurrentResponse(), s, this, xml);
return sw.toString();
} catch (Exception e) {
- LOGGER.warning(e.getMessage());
+ LOGGER.log(Level.WARNING, null, e);
return "";
}
} else {
|
[JENKINS-<I>] LOGGER.log() instead of LOGGER.warning()
|
jenkinsci_jenkins
|
train
|
java
|
686c983f3e14ebde19d39ff5bdfc9f97fe3faf52
|
diff --git a/security/Member.php b/security/Member.php
index <HASH>..<HASH> 100644
--- a/security/Member.php
+++ b/security/Member.php
@@ -1073,6 +1073,7 @@ class Member extends DataObject {
*/
public function isInGroup($groupID) {
user_error('Member::isInGroup() is deprecated. Please use inGroup() instead.', E_USER_NOTICE);
+ return $this->inGroup($groupID);
}
}
|
Updated Member::isInGroup() to function as well as being deprecated
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@<I> <I>b<I>ca-7a2a-<I>-9d3b-<I>d<I>a<I>a9
|
silverstripe_silverstripe-framework
|
train
|
php
|
bdc324760d754f098e338b1fca8fe4fb4ee03c15
|
diff --git a/telethon/events/newmessage.py b/telethon/events/newmessage.py
index <HASH>..<HASH> 100644
--- a/telethon/events/newmessage.py
+++ b/telethon/events/newmessage.py
@@ -137,12 +137,6 @@ class NewMessage(EventBuilder):
else:
return
- # Make messages sent to ourselves outgoing unless they're forwarded.
- # This makes it consistent with official client's appearance.
- ori = event.message
- if ori.peer_id == types.PeerUser(self_id) and not ori.fwd_from:
- event.message.out = True
-
return event
def filter(self, event):
diff --git a/telethon/tl/custom/message.py b/telethon/tl/custom/message.py
index <HASH>..<HASH> 100644
--- a/telethon/tl/custom/message.py
+++ b/telethon/tl/custom/message.py
@@ -269,6 +269,12 @@ class Message(ChatGetter, SenderGetter, TLObject):
known entities.
"""
self._client = client
+
+ # Make messages sent to ourselves outgoing unless they're forwarded.
+ # This makes it consistent with official client's appearance.
+ if self.peer_id == types.PeerUser(client._self_id) and not self.fwd_from:
+ self.out = True
+
cache = client._entity_cache
self._sender, self._input_sender = utils._get_entity_pair(
|
Move message.out patching in self-chat to Message
May fix #<I>.
|
LonamiWebs_Telethon
|
train
|
py,py
|
c27d954016377bb0500251b7c8ba78895d4d87b7
|
diff --git a/http/query.go b/http/query.go
index <HASH>..<HASH> 100644
--- a/http/query.go
+++ b/http/query.go
@@ -117,7 +117,7 @@ func toSpec(p *ast.Program, now func() time.Time) (*flux.Spec, error) {
return nil, err
}
- if err := itrp.Eval(semProg); err != nil {
+ if err := itrp.Eval(semProg, nil); err != nil {
return nil, err
}
return flux.ToSpec(itrp, itrp.SideEffects()...), nil
|
fix: pass nil importer to Eval
|
influxdata_influxdb
|
train
|
go
|
9b64bea8fa7f169af4ee31bb99052a190c6dc0ec
|
diff --git a/sos/policies/redhat.py b/sos/policies/redhat.py
index <HASH>..<HASH> 100644
--- a/sos/policies/redhat.py
+++ b/sos/policies/redhat.py
@@ -106,7 +106,8 @@ No changes will be made to system configuration.
def check(self):
"""This method checks to see if we are running on RHEL. It returns True
or False."""
- return (os.path.isfile('/etc/redhat-release'))
+ return (os.path.isfile('/etc/redhat-release')
+ and not os.path.isfile('/etc/fedora-release'))
def rhelVersion(self):
try:
@@ -135,7 +136,7 @@ No changes will be made to system configuration.
def getLocalName(self):
return self.rhnUsername() or self.hostName()
-class FedoraPolicy(LinuxPolicy):
+class FedoraPolicy(RedHatPolicy):
distro = "Fedora"
vendor = "the Fedora Project"
|
Fix Fedora policy detection
Make sure that the Fedora policy gets a chance to run by checking
for the absence of /etc/fedora-release in the RHEL policy and
fix the inheritance of FedoraPolicy.
|
sosreport_sos
|
train
|
py
|
25e6896332d28b6a06aaeeef600ee75edc5cab15
|
diff --git a/templates/releaf/installer.rb b/templates/releaf/installer.rb
index <HASH>..<HASH> 100644
--- a/templates/releaf/installer.rb
+++ b/templates/releaf/installer.rb
@@ -90,6 +90,9 @@ if dummy
mysql_password = ask_wizard("Password for MySQL user #{mysql_username}?", '')
gsub_file "config/database.yml", /password:/, "password: #{mysql_password}"
+
+ mysql_database = ask_wizard("MySQL database name (leave blank to use 'releaf_dummy')?", 'releaf_dummy')
+ gsub_file "config/database.yml", /database: dummy_/, "database: #{mysql_database}_"
end
gsub_file 'config/boot.rb', "'../../Gemfile'", "'../../../../Gemfile'"
else
|
Possibility to define dummy database name
|
cubesystems_releaf
|
train
|
rb
|
d60269c70a30bda26abf0bd029100ae3eb185cdc
|
diff --git a/resources/lang/fa-IR/forms.php b/resources/lang/fa-IR/forms.php
index <HASH>..<HASH> 100644
--- a/resources/lang/fa-IR/forms.php
+++ b/resources/lang/fa-IR/forms.php
@@ -168,7 +168,7 @@ return [
'analytics' => [
'analytics_google' => 'Google Analytics code',
'analytics_gosquared' => 'GoSquared Analytics code',
- 'analytics_piwik_url' => 'URL of your Piwik instance (without http(s)://)',
+ 'analytics_piwik_url' => 'URL of your Piwik instance',
'analytics_piwik_siteid' => 'Piwik\'s site id',
],
'localization' => [
@@ -229,6 +229,11 @@ return [
'timezone' => 'Select Timezone',
],
+ 'seo' => [
+ 'title' => 'SEO Title',
+ 'description' => 'SEO Description',
+ ],
+
// Buttons
'add' => 'Add',
'save' => 'Save',
|
New translations forms.php (Persian)
|
CachetHQ_Cachet
|
train
|
php
|
b0c83b721985f648c59cdbe5af473fdb196e0462
|
diff --git a/hyperbahn/service_proxy.js b/hyperbahn/service_proxy.js
index <HASH>..<HASH> 100644
--- a/hyperbahn/service_proxy.js
+++ b/hyperbahn/service_proxy.js
@@ -302,10 +302,12 @@ function removeServicePeer(serviceName, hostPort) {
return;
}
- var peer = svcchan.peers.get(hostPort);
- if (peer) {
- peer.close(noop);
+ var peer = self.channel.peers.get(hostPort);
+ if (!peer) {
+ return;
}
+
+ peer.close(noop);
self.channel.peers.delete(hostPort);
};
|
ServiceDispatchHandler: get peer from root channel in #removeServicePeer
|
uber_tchannel-node
|
train
|
js
|
2295e7de9e854e25594732091a4c96688b0bce6d
|
diff --git a/source/application/components/widgets/oxwarticlebox.php b/source/application/components/widgets/oxwarticlebox.php
index <HASH>..<HASH> 100644
--- a/source/application/components/widgets/oxwarticlebox.php
+++ b/source/application/components/widgets/oxwarticlebox.php
@@ -95,6 +95,10 @@ class oxwArticleBox extends oxWidget
$oArticle->setLinkType( $iLinkType );
}
+ if ( $oRecommList = $this->getActiveRecommList() ) {
+ $oArticle->text = $oRecommList->getArtDescription( $oArticle->getId() );
+ }
+
return $oArticle;
}
@@ -221,6 +225,7 @@ class oxwArticleBox extends oxWidget
*/
public function getShowMainLink()
{
+ dumpVar($this->getViewParameter('showMainLink'));
return (bool) $this->getViewParameter('showMainLink');
}
|
Load article description in article box widget for recommendation list.
|
OXID-eSales_oxideshop_ce
|
train
|
php
|
9bed27b98f3c7c4f0c147756d6df3b66242c458a
|
diff --git a/bigchaindb/version.py b/bigchaindb/version.py
index <HASH>..<HASH> 100644
--- a/bigchaindb/version.py
+++ b/bigchaindb/version.py
@@ -1,2 +1,2 @@
-__version__ = '1.2.0.dev'
-__short_version__ = '1.2.dev'
+__version__ = '1.3.0.dev'
+__short_version__ = '1.3.dev'
|
Updated to <I>.dev in version.py
|
bigchaindb_bigchaindb
|
train
|
py
|
2f1ab45f468caaa4119647f01dd8261885196e30
|
diff --git a/intranet/apps/eighth/serializers.py b/intranet/apps/eighth/serializers.py
index <HASH>..<HASH> 100644
--- a/intranet/apps/eighth/serializers.py
+++ b/intranet/apps/eighth/serializers.py
@@ -143,7 +143,9 @@ class EighthBlockDetailSerializer(serializers.Serializer):
"administrative": scheduled_activity.get_administrative(),
"presign": activity.presign,
"sticky": scheduled_activity.get_sticky(),
+ "finance": "", # TODO: refactor JS to remove this
"title": scheduled_activity.title,
+ "comments": scheduled_activity.comments, # TODO: refactor JS to remove this
"display_text": "",
# TODO: Remove together with other eighth waitlist functionality
"waitlist_count": 0,
|
fix(eighth): add finance and comments field
|
tjcsl_ion
|
train
|
py
|
457afb90c1d18ef006b8089a76f69656fb8a6638
|
diff --git a/app/models/outgoing_message_prototype.rb b/app/models/outgoing_message_prototype.rb
index <HASH>..<HASH> 100644
--- a/app/models/outgoing_message_prototype.rb
+++ b/app/models/outgoing_message_prototype.rb
@@ -163,11 +163,15 @@ class OutgoingMessagePrototype
if @html_body.blank? && attachments.empty?
mail.body = @plain_body
else
- mail.text_part = Mail::Part.new
- mail.text_part.body = @plain_body
- mail.html_part = Mail::Part.new
- mail.html_part.content_type = "text/html; charset=UTF-8"
- mail.html_part.body = @html_body
+ if !@plain_body.blank?
+ mail.text_part = Mail::Part.new
+ mail.text_part.body = @plain_body
+ end
+ if !@html_body.blank?
+ mail.html_part = Mail::Part.new
+ mail.html_part.content_type = "text/html; charset=UTF-8"
+ mail.html_part.body = @html_body
+ end
end
attachments.each do |attachment|
mail.attachments[attachment[:name]] = {
|
don't create empty parts in a multi part email (#<I>)
|
atech_postal
|
train
|
rb
|
fe401bceb80f74fa5b91412a19fd760bce3c98c2
|
diff --git a/test/test_helper.rb b/test/test_helper.rb
index <HASH>..<HASH> 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -9,7 +9,7 @@ class Test::Unit::TestCase
define_method("test_#{name.gsub(/\s+/,'_')}".to_sym, block)
end
- def environment
+ def default_environment
{ "RACK_ENV" => "test",
"JANKY_CONFIG_DIR" => File.dirname(__FILE__),
"JANKY_GITHUB_USER" => "hubot",
@@ -24,6 +24,16 @@ class Test::Unit::TestCase
}
end
+ def environment
+ env = default_environment
+ ENV.each do |key, value|
+ if key =~ /^JANKY_/
+ env[key] = value
+ end
+ end
+ env
+ end
+
def gh_commit(sha1 = "HEAD")
Janky::GitHub::Commit.new(
sha1,
|
allow overriding settings in test environment
|
github_janky
|
train
|
rb
|
038a1e4e3b912170c7a21ea5605c60a95a3ad82f
|
diff --git a/lib/array.js b/lib/array.js
index <HASH>..<HASH> 100644
--- a/lib/array.js
+++ b/lib/array.js
@@ -12,6 +12,13 @@ module.exports.max = function(array)
return Math.max.apply(Math, array);
};
+//Get the min value in an array
+module.exports.min = function(obj)
+{
+ //Return the min value
+ return Math.min.apply(Math, obj);
+};
+
//Return a range of values
module.exports.range = function(start, end, step)
{
|
lib/array.js: added array.min method to get the minimum value in an array
|
jmjuanes_utily
|
train
|
js
|
c4d7a63e8dbfd398e0a152ea8557a26877ae05ef
|
diff --git a/client.go b/client.go
index <HASH>..<HASH> 100644
--- a/client.go
+++ b/client.go
@@ -110,8 +110,9 @@ func NewDockerClientTimeout(daemonUrl string, tlsConfig *tls.Config, timeout tim
u.Scheme = "https"
}
}
+ copiedUrl, _ := url.Parse(u.String())
httpClient := newHttpClient(u, tlsConfig, timeout, rwTimeout)
- longpollClient := newHttpClient(u, tlsConfig, timeout, 0)
+ longpollClient := newHttpClient(copiedUrl, tlsConfig, timeout, 0)
clientApiVersion := kDefaultApiVersion
if len(apiVersion) > 0 && apiVersion[0] != "" {
clientApiVersion = apiVersion[0]
|
fix for newHttpClient is not idempotency
|
mijia_adoc
|
train
|
go
|
fcd1d1f876c80082831af50a0ab6cea8d676c0e9
|
diff --git a/src/resolvers/ClassNameResolver.php b/src/resolvers/ClassNameResolver.php
index <HASH>..<HASH> 100644
--- a/src/resolvers/ClassNameResolver.php
+++ b/src/resolvers/ClassNameResolver.php
@@ -28,7 +28,7 @@ class ClassNameResolver implements DependencyResolverInterface
throw new NotInstantiableException($class);
}
$constructor = $reflectionClass->getConstructor();
- return isset($constructor) ? $this->resolveFunction($constructor) : [];
+ return $constructor === null ? [] : $this->resolveFunction($constructor);
}
private function resolveFunction(\ReflectionFunctionAbstract $reflectionFunction): array
|
Update src/resolvers/ClassNameResolver.php
|
yiisoft_di
|
train
|
php
|
960b9317449f8b5507e05774d4ab7828b1bcee1c
|
diff --git a/conductor/src/main/java/com/bluelinelabs/conductor/Controller.java b/conductor/src/main/java/com/bluelinelabs/conductor/Controller.java
index <HASH>..<HASH> 100755
--- a/conductor/src/main/java/com/bluelinelabs/conductor/Controller.java
+++ b/conductor/src/main/java/com/bluelinelabs/conductor/Controller.java
@@ -10,6 +10,7 @@ import android.os.Bundle;
import android.os.Parcelable;
import android.support.annotation.IdRes;
import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.util.SparseArray;
import android.view.LayoutInflater;
@@ -647,6 +648,14 @@ public abstract class Controller {
return false;
}
+ /**
+ * Returns a bundle for the view's state, which would have been created in {@link #onSaveViewState(View, Bundle)}.
+ */
+ @Nullable
+ public Bundle getViewStateBundle() {
+ return viewState;
+ }
+
final void setNeedsAttach() {
needsAttach = true;
}
|
Added a view state getter, which is needed if view state must be obtained at the time of view creation (ex: for Google Maps)
|
bluelinelabs_Conductor
|
train
|
java
|
48c48ac457d18c16c91e5a8c68f64e36ee72d985
|
diff --git a/src/keymaps/index.js b/src/keymaps/index.js
index <HASH>..<HASH> 100644
--- a/src/keymaps/index.js
+++ b/src/keymaps/index.js
@@ -152,7 +152,7 @@ export default () => {
if (ableTorun || opts.force) {
opts.prevent && canvas.getCanvasView().preventDefault(e);
typeof handler == 'object'
- ? handler.run(editor, 0, opt)
+ ? cmd.runCommand(handler, opt)
: handler(editor, 0, opt);
const args = [id, h.shortcut, e];
em.trigger('keymap:emit', ...args);
|
Execute shortcut commands from the Commands manager. Closes #<I>
|
artf_grapesjs
|
train
|
js
|
5105d2e4e4844bab149f41767a230ea9c15da42f
|
diff --git a/cluster_state_test.go b/cluster_state_test.go
index <HASH>..<HASH> 100644
--- a/cluster_state_test.go
+++ b/cluster_state_test.go
@@ -91,3 +91,15 @@ func TestClusterStateURLs(t *testing.T) {
}
}
}
+
+func TestClusterStateGet(t *testing.T) {
+ client := setupTestClientAndCreateIndex(t) // , SetTraceLog(log.New(os.Stdout, "", 0)))
+
+ state, err := client.ClusterState().Pretty(true).Do(context.TODO())
+ if err != nil {
+ t.Fatal(err)
+ }
+ if want, have := "elasticsearch", state.ClusterName; want != have {
+ t.Fatalf("ClusterName: want %q, have %q", want, have)
+ }
+}
|
Add test for Cluster State API
Trying to find issue mentioned in #<I>.
|
olivere_elastic
|
train
|
go
|
891f7f97e73b522b223c2083666b0e4ae6b484de
|
diff --git a/lib/economic/entity.rb b/lib/economic/entity.rb
index <HASH>..<HASH> 100644
--- a/lib/economic/entity.rb
+++ b/lib/economic/entity.rb
@@ -207,10 +207,6 @@ module Economic
)
end
- def soap_action_name(action)
- Endpoint.new.soap_action_name(self.class, action)
- end
-
def class_name
self.class.to_s.split("::").last
end
|
Remove unused soap_action_name method
This should probably have been removed as part of commit eb<I>e<I>e<I>d8dbcbafeaf<I>e<I>f<I>a1.
|
substancelab_rconomic
|
train
|
rb
|
695bc0bea2a8183f72e71597e56c6fe55bd35350
|
diff --git a/molgenis-data-annotators/src/main/java/org/molgenis/data/annotation/core/resources/impl/tabix/TabixReader.java b/molgenis-data-annotators/src/main/java/org/molgenis/data/annotation/core/resources/impl/tabix/TabixReader.java
index <HASH>..<HASH> 100644
--- a/molgenis-data-annotators/src/main/java/org/molgenis/data/annotation/core/resources/impl/tabix/TabixReader.java
+++ b/molgenis-data-annotators/src/main/java/org/molgenis/data/annotation/core/resources/impl/tabix/TabixReader.java
@@ -41,8 +41,8 @@ import static java.nio.charset.StandardCharsets.UTF_8;
public class TabixReader
{
- public String filename;
- public BlockCompressedInputStream blockCompressedInputStream;
+ private String filename;
+ private BlockCompressedInputStream blockCompressedInputStream;
private int mPreset;
private int mSc;
@@ -53,7 +53,7 @@ public class TabixReader
private String[] mSeq;
private TIndex[] mIndex;
- public HashMap<String, Integer> mChr2tid;
+ private HashMap<String, Integer> mChr2tid;
private static int MAX_BIN = 37450;
private static int TAD_MIN_CHUNK_GAP = 32768;
|
Fix three "Class variable fields should not have public accessibility" vulnerabilities reported by Sonar
|
molgenis_molgenis
|
train
|
java
|
2ca70dc10d67a1b5d899660caf24a7bd201c6544
|
diff --git a/project/library/CM/Session.php b/project/library/CM/Session.php
index <HASH>..<HASH> 100644
--- a/project/library/CM/Session.php
+++ b/project/library/CM/Session.php
@@ -233,7 +233,7 @@ class CM_Session {
}
}
- public static function gc() {
+ public static function deleteExpired() {
CM_Mysql::exec("DELETE FROM TBL_CM_SESSION WHERE `expires` < ?", time());
}
|
t<I>: Rename Session::gc() to deleteExpired()
|
cargomedia_cm
|
train
|
php
|
c4db465402ecffa90065cfe8a66228b7c3426a81
|
diff --git a/Eloquent/Model.php b/Eloquent/Model.php
index <HASH>..<HASH> 100755
--- a/Eloquent/Model.php
+++ b/Eloquent/Model.php
@@ -1125,9 +1125,11 @@ abstract class Model implements ArrayAccess, ArrayableInterface, JsonableInterfa
*/
protected function updateTimestamps()
{
+ $time = $this->freshTimestamp();
+
if ( ! $this->isDirty(static::UPDATED_AT))
{
- $this->setUpdatedAt($time = $this->freshTimestamp());
+ $this->setUpdatedAt($this->freshTimestamp());
}
if ( ! $this->exists and ! $this->isDirty(static::CREATED_AT))
|
Fix timestamp bug in Eloquent models.
|
illuminate_database
|
train
|
php
|
3415ba326a2892b26bfc89307967651e5403f32c
|
diff --git a/src/InfoViz/Native/MutualInformationDiagram/index.js b/src/InfoViz/Native/MutualInformationDiagram/index.js
index <HASH>..<HASH> 100644
--- a/src/InfoViz/Native/MutualInformationDiagram/index.js
+++ b/src/InfoViz/Native/MutualInformationDiagram/index.js
@@ -780,7 +780,7 @@ function informationDiagram(publicAPI, model) {
// mutualInformationData.vmap[d.source.index].autoInfo/mutualInformationData.matrix[d.source.index][d.source.index]);
svg
- .selectAll('g.group path[id^=\'group\']')
+ .selectAll(`g.group path[id^=\'${model.instanceID}-group\']`)
.on('click', (d, i) => {
pmiChordMode.mode = PMI_CHORD_MODE_NONE;
pmiChordMode.srcParam = null;
|
fix(MutualInfoDiagram): Fix a query that missed using instance id to generate element id
|
Kitware_paraviewweb
|
train
|
js
|
19b020dbc72b9aeb5d6e3faca95bb55ce5418bb5
|
diff --git a/src/js/pannellum.js b/src/js/pannellum.js
index <HASH>..<HASH> 100644
--- a/src/js/pannellum.js
+++ b/src/js/pannellum.js
@@ -1784,10 +1784,12 @@ function destroyHotSpots() {
if (hs) {
for (var i = 0; i < hs.length; i++) {
var current = hs[i].div;
- while(current.parentNode != renderContainer) {
- current = current.parentNode;
+ if (current) {
+ while(current.parentNode != renderContainer) {
+ current = current.parentNode;
+ }
+ renderContainer.removeChild(current);
}
- renderContainer.removeChild(current);
delete hs[i].div;
}
}
|
Check to make sure hot spot div exists before deleting it (#<I>).
|
mpetroff_pannellum
|
train
|
js
|
77dbf98f06f6bd99eb3b65abffd8b955fa652f0f
|
diff --git a/functions_defs_crypto_rand.go b/functions_defs_crypto_rand.go
index <HASH>..<HASH> 100644
--- a/functions_defs_crypto_rand.go
+++ b/functions_defs_crypto_rand.go
@@ -10,6 +10,15 @@ import (
)
func loadStandardFunctionsCryptoRand() funcGroup {
+ // TODO:
+ // urlencode/urldecode
+ // rv[`md5`] =
+ // rv[`sha1`] =
+ // rv[`sha256`] =
+ // rv[`sha384`] =
+ // rv[`sha512`] =
+
+
return funcGroup{
Name: `Hashing and Cryptography`,
Description: `These functions provide basic cryptographic and non-cryptographic functions, ` +
|
funcdoc: stubs
|
ghetzel_diecast
|
train
|
go
|
f3843ce527609057ea49f455e5a87afa217a9a57
|
diff --git a/openquake/engine/tests/calculators/hazard/general_test.py b/openquake/engine/tests/calculators/hazard/general_test.py
index <HASH>..<HASH> 100644
--- a/openquake/engine/tests/calculators/hazard/general_test.py
+++ b/openquake/engine/tests/calculators/hazard/general_test.py
@@ -215,7 +215,7 @@ class CalculationLimitsTestCase(unittest.TestCase):
calc = get_calculator_class('hazard', hc.calculation_mode)(job)
input_weight, output_weight = calc.pre_execute()
self.assertEqual(input_weight, 1352.75)
- self.assertEqual(output_weight, 12.1)
+ self.assertAlmostEqual(output_weight, 12.1)
# NB: 12.1 = 121 sites * 2 IMT * 2 rlzs * 5 SES * 50/10000 years
|
Fixed a test broken by the change in the output_weight
|
gem_oq-engine
|
train
|
py
|
5a22e0775677bce917511cef9e01c6a0b329d964
|
diff --git a/test/test-helper/index.js b/test/test-helper/index.js
index <HASH>..<HASH> 100644
--- a/test/test-helper/index.js
+++ b/test/test-helper/index.js
@@ -8,6 +8,8 @@ let { randomBytes } = require("crypto");
let { exec, spawn } = require("./child_process");
+let { COPY_KARMA } = process.env;
+
function generateRandomFilePath () {
return join(
tmpdir(),
@@ -40,7 +42,9 @@ async function createKarmaTest (launcherOptions, testFunction) {
var karmaBinPath = join(npmBinDirectory, "karma");
- return spawn(karmaBinPath, ["start", tmpConfigFile]);
+ return spawn(karmaBinPath, ["start", tmpConfigFile], {
+ stdio: COPY_KARMA === "1" ? "inherit" : "pipe"
+ });
}
function waitToExit (process) {
|
Add support for the COPY_KARMA option
This is actually outputted in error, saying it can be used, but it
couldn't up until now.
|
badeball_karma-jsdom-launcher
|
train
|
js
|
81c6a007c0e3b91625e1cb7620f414030c973ec1
|
diff --git a/src/Http/Controllers/Adminarea/AccountPasswordController.php b/src/Http/Controllers/Adminarea/AccountPasswordController.php
index <HASH>..<HASH> 100644
--- a/src/Http/Controllers/Adminarea/AccountPasswordController.php
+++ b/src/Http/Controllers/Adminarea/AccountPasswordController.php
@@ -31,7 +31,7 @@ class AccountPasswordController extends AuthenticatedController
$currentUser = $request->user($this->getGuard());
// Update profile
- $currentUser->fill(['password' => $request->get('new_password')])->save();
+ $currentUser->fill(['password' => $request->get('new_password')])->forceSave();
return intend([
'back' => true,
|
Force save password regardless of any other fields validation errors
- This action only deal with password change anyway.
|
rinvex_cortex-auth
|
train
|
php
|
b9494daca3d524c6b8f53d1dfd962962893345e3
|
diff --git a/studio/websetup.py b/studio/websetup.py
index <HASH>..<HASH> 100644
--- a/studio/websetup.py
+++ b/studio/websetup.py
@@ -117,14 +117,6 @@ def setup_app(command, conf, vars):
admin.groups.append(admin_gp)
meta.Session.add(admin)
- # Create user enduser
- enduser = model.User()
- enduser.name = 'Enduser'
- enduser.login = 'enduser'
- enduser.password = 'password'
- enduser.groups.append(enduser_gp)
- meta.Session.add(enduser)
-
mfdir = config['mapfiles_dir']
if not os.path.exists(mfdir):
os.makedirs(mfdir, 0755)
|
remove the enduser account created during setup-app
|
camptocamp_Studio
|
train
|
py
|
4fb9e2b23ba36a5d3660238554fc5d8a6186c107
|
diff --git a/jupyterlab_widgets/setup.py b/jupyterlab_widgets/setup.py
index <HASH>..<HASH> 100644
--- a/jupyterlab_widgets/setup.py
+++ b/jupyterlab_widgets/setup.py
@@ -205,7 +205,7 @@ setup_args = dict(
'jupyterlab_widgets/static/jupyterlab_widgets.bundle.js',
'jupyterlab_widgets/static/jupyterlab_widgets.bundle.js.manifest',
'jupyterlab_widgets/static/jupyterlab_widgets.bundle.css'
- ]),
+ ])],
zip_safe=False,
include_package_data = True,
)
@@ -220,7 +220,7 @@ if 'setuptools' in sys.modules:
setuptools_args = {}
install_requires = setuptools_args['install_requires'] = [
- 'notebook>=4.2.0',
+ 'jupyterlab>=0.8.0'
]
extras_require = setuptools_args['extras_require'] = {
|
Fix python package for jlab
|
jupyter-widgets_ipywidgets
|
train
|
py
|
85152679ce910d0993a2902ec00d199b8cc14e4d
|
diff --git a/admin.go b/admin.go
index <HASH>..<HASH> 100644
--- a/admin.go
+++ b/admin.go
@@ -311,13 +311,18 @@ type adminHandler struct {
// ServeHTTP is the external entry point for API requests.
// It will only be called once per request.
func (h adminHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
- Log().Named("admin.api").Info("received request",
+ log := Log().Named("admin.api").With(
zap.String("method", r.Method),
zap.String("host", r.Host),
zap.String("uri", r.RequestURI),
zap.String("remote_addr", r.RemoteAddr),
zap.Reflect("headers", r.Header),
)
+ if r.RequestURI == "/metrics" {
+ log.Debug("received request")
+ } else {
+ log.Info("received request")
+ }
h.serveHTTP(w, r)
}
|
admin: lower log level to Debug for /metrics requests (#<I>)
* admin: lower log level to Debug for /metrics requests
|
mholt_caddy
|
train
|
go
|
76a88bd80e3553e85d0055dbadde1ca6c4638de8
|
diff --git a/lib/ndr_support/version.rb b/lib/ndr_support/version.rb
index <HASH>..<HASH> 100644
--- a/lib/ndr_support/version.rb
+++ b/lib/ndr_support/version.rb
@@ -3,5 +3,5 @@
# This defines the NdrSupport version. If you change it, rebuild and commit the gem.
# Use "rake build" to build the gem, see rake -T for all bundler rake tasks.
module NdrSupport
- VERSION = '5.3.1'
+ VERSION = '5.3.2'
end
|
# bump to <I> with various ruby support fixes
|
PublicHealthEngland_ndr_support
|
train
|
rb
|
76a3368ea1a306bfa936ce886028825860c32a93
|
diff --git a/lib/support/har/index.js b/lib/support/har/index.js
index <HASH>..<HASH> 100644
--- a/lib/support/har/index.js
+++ b/lib/support/har/index.js
@@ -56,6 +56,20 @@ function addTimingsToHAR(harPage, visualMetricsData, timings, cpu) {
// only add first paint if we don't have visual metrics
harPageTimings._firstPaint = timings.firstPaint;
}
+
+ if (timings && timings.largestContentfulPaint) {
+ harPageTimings._largestContentfulPaint =
+ timings.largestContentfulPaint.renderTime;
+ }
+ if (
+ timings &&
+ timings.paintTiming &&
+ timings.paintTiming['first-contentful-paint']
+ ) {
+ harPageTimings._firstContentfulPaint =
+ timings.paintTiming['first-contentful-paint'];
+ }
+
if (timings && timings.pageTimings) {
harPageTimings._domInteractiveTime = timings.pageTimings.domInteractiveTime;
harPageTimings._domContentLoadedTime =
|
Include LCP and FCP in the HAR timings (#<I>)
|
sitespeedio_browsertime
|
train
|
js
|
b74a51c0ec10ec15f571da39710afef566ed5e52
|
diff --git a/findbugs/src/java/edu/umd/cs/findbugs/detect/FindNullDeref.java b/findbugs/src/java/edu/umd/cs/findbugs/detect/FindNullDeref.java
index <HASH>..<HASH> 100644
--- a/findbugs/src/java/edu/umd/cs/findbugs/detect/FindNullDeref.java
+++ b/findbugs/src/java/edu/umd/cs/findbugs/detect/FindNullDeref.java
@@ -1009,7 +1009,7 @@ public class FindNullDeref implements Detector,
if (createdDeadCode)
System.out.println("createdDeadCode");
}
-
+ if (priority > LOW_PRIORITY) return;
BugAnnotation variableAnnotation = null;
try {
// Get the value number
|
if priority not even LOW, don't bother creating bug instance
git-svn-id: <URL>
|
spotbugs_spotbugs
|
train
|
java
|
148e4b6c7889df3e10fa00edd54ec096a47f57a5
|
diff --git a/config_unix.go b/config_unix.go
index <HASH>..<HASH> 100644
--- a/config_unix.go
+++ b/config_unix.go
@@ -1,4 +1,5 @@
// +build darwin freebsd linux netbsd openbsd
+
package peco
import (
|
I think a newline was necessary
|
peco_peco
|
train
|
go
|
20894c99480886ad807bd8c2936941cf5815bbf4
|
diff --git a/runcommands/run.py b/runcommands/run.py
index <HASH>..<HASH> 100644
--- a/runcommands/run.py
+++ b/runcommands/run.py
@@ -40,14 +40,18 @@ class Run(Command):
'(higher precedence than keyword args)'
) = None,
# Special globals (for command line convenience)
- env: arg(help='Will be added to globals') = None,
- version: arg(help='Will be added to globals') = None,
- echo: arg(type=bool, help='Will be added to globals') = None,
+ env: arg(help='env will be added to globals if specified') = None,
+ version: arg(help='version will be added to globals if specified') = None,
+ echo: arg(
+ type=bool,
+ help='echo=True will be added to globals',
+ inverse_help='echo=False will be added to globals'
+ ) = None,
# Environment variables
environ: arg(
type=dict,
help='Additional environment variables; '
- 'added just before commands are run',
+ 'added just before commands are run'
) = None,
# Meta
info: arg(help='Show info and exit') = False,
|
Tweak run command arg help for env, version, and echo
|
wylee_runcommands
|
train
|
py
|
443f9d9c7f10b75e66330c067e38fb0160bee908
|
diff --git a/test/test_helper.rb b/test/test_helper.rb
index <HASH>..<HASH> 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -8,6 +8,7 @@ require "active_support/notifications"
ENV["RACK_ENV"] = "test"
+# for reloadable synonyms
ENV["ES_PATH"] ||= "#{ENV["HOME"]}/elasticsearch/#{ENV["ELASTICSEARCH_VERSION"]}" if ENV["TRAVIS"]
$logger = ActiveSupport::Logger.new(ENV["VERBOSE"] ? STDOUT : nil)
|
Added comment [skip ci]
|
ankane_searchkick
|
train
|
rb
|
08c9693ee87c3e7a09fb3720d3d58870a911cc71
|
diff --git a/lib/closure_tree/model.rb b/lib/closure_tree/model.rb
index <HASH>..<HASH> 100644
--- a/lib/closure_tree/model.rb
+++ b/lib/closure_tree/model.rb
@@ -48,7 +48,7 @@ module ClosureTree
scope :without, lambda { |instance|
if instance.new_record?
- scoped
+ all
else
where(["#{_ct.quoted_table_name}.#{_ct.base_class.primary_key} != ?", instance.id])
end
diff --git a/spec/tag_spec.rb b/spec/tag_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/tag_spec.rb
+++ b/spec/tag_spec.rb
@@ -4,7 +4,7 @@ shared_examples_for "Tag (1)" do
it "has correct accessible_attributes" do
Tag.accessible_attributes.to_a.should =~ %w(parent name)
- end
+ end unless ActiveRecord::VERSION::MAJOR == 4
describe "empty db" do
|
down to <I> failures
|
ClosureTree_closure_tree
|
train
|
rb,rb
|
61c972d75f14f3e5712a6856dd22e742ac071dc6
|
diff --git a/Command/EventSourcingCommandHandlerTrait.php b/Command/EventSourcingCommandHandlerTrait.php
index <HASH>..<HASH> 100644
--- a/Command/EventSourcingCommandHandlerTrait.php
+++ b/Command/EventSourcingCommandHandlerTrait.php
@@ -19,10 +19,6 @@ trait EventSourcingCommandHandlerTrait
$event = $this->getDomainEvent($command);
$handler = $this->getDomainEventHandler($command);
- if (!$handler instanceof DomainEventHandlerInterface) {
- throw new \LogicException(sprintf('Object "%s" is unable to handle domain event "%s". Did you forgot to implement DomainEventHandlerInterface?', \get_class($handler), \get_class($event)));
- }
-
if ($handler->handleEvent($event) && null !== $onHandled) {
$onHandled($handler);
}
|
SA fixes (#<I>)
|
msgphp_domain
|
train
|
php
|
786ed80b2e324b543d1f9e2ccb259fe247e74ed9
|
diff --git a/pingouin/regression.py b/pingouin/regression.py
index <HASH>..<HASH> 100644
--- a/pingouin/regression.py
+++ b/pingouin/regression.py
@@ -627,10 +627,10 @@ def logistic_regression(X, y, coef_only=False, alpha=0.05,
.. caution:: This function is a wrapper around the
:py:class:`sklearn.linear_model.LogisticRegression` class. However,
Pingouin internally disables the L2 regularization and changes the
- default solver in order to get results that are similar to R and
+ default solver to 'newton-cg' to obtain results that are similar to R and
statsmodels.
- The logistic regression assumes that the log-odds (the logarithm of the
+ Logistic regression assumes that the log-odds (the logarithm of the
odds) for the value labeled "1" in the response variable is a linear
combination of the predictor variables. The log-odds are given by the
`logit <https://en.wikipedia.org/wiki/Logit>`_ function,
|
DOCS add how Logistic Regression is modified to match R and statsmodels
The docs didn't say how the scikit-learn default solver was changed. Inquiring minds would have to go to the source code. I added the default solver.
|
raphaelvallat_pingouin
|
train
|
py
|
7d49255926bb8941cbef090abdccffcedbff1e39
|
diff --git a/superset/assets/cypress/integration/explore/control.test.js b/superset/assets/cypress/integration/explore/control.test.js
index <HASH>..<HASH> 100644
--- a/superset/assets/cypress/integration/explore/control.test.js
+++ b/superset/assets/cypress/integration/explore/control.test.js
@@ -61,7 +61,7 @@ describe('AdhocMetrics', () => {
});
});
- it('Clear metric and set custom sql adhoc metric', () => {
+ xit('Clear metric and set custom sql adhoc metric', () => {
const metric = 'SUM(num)/COUNT(DISTINCT name)';
cy.visitChartByName('Num Births Trend');
|
This control test is flaky and affecting travis runs, turning it off for now (#<I>)
|
apache_incubator-superset
|
train
|
js
|
a8391519dba5ac77e61c2c18a74e84cc20a5c16e
|
diff --git a/lib/ezutils/classes/ezextension.php b/lib/ezutils/classes/ezextension.php
index <HASH>..<HASH> 100644
--- a/lib/ezutils/classes/ezextension.php
+++ b/lib/ezutils/classes/ezextension.php
@@ -245,7 +245,7 @@ class eZExtension
$hasExtensions = true;
}
if ( $hasExtensions )
- $siteINI->loadCache();
+ $siteINI->load();
}
/**
|
Switch to using ->load() instead of ->loadCache() directly (should have been protected)
|
ezsystems_ezpublish-legacy
|
train
|
php
|
ee46cd78a97987dcd106442743966a0a2060a216
|
diff --git a/src/main/java/zmq/TcpConnecter.java b/src/main/java/zmq/TcpConnecter.java
index <HASH>..<HASH> 100644
--- a/src/main/java/zmq/TcpConnecter.java
+++ b/src/main/java/zmq/TcpConnecter.java
@@ -235,7 +235,13 @@ public class TcpConnecter extends Own implements IPollEvents {
// resolve address again to take into account other addresses
// besides the failing one (e.g. multiple dns entries).
- address.resolve();
+ try {
+ address.resolve();
+ } catch ( Exception ignored ) {
+ // This will fail if the network goes away and the
+ // address cannot be resolved for some reason. Try
+ // not to fail as the event loop will quit
+ }
socket.event_connect_retried(address.toString(), rc_ivl);
timer_started = true;
@@ -278,7 +284,12 @@ public class TcpConnecter extends Own implements IPollEvents {
Utils.unblock_socket(handle);
// Connect to the remote peer.
- boolean rc = handle.connect(addr.resolved().address());
+ boolean rc = false;
+ try {
+ rc = handle.connect(addr.resolved().address());
+ } catch ( Exception e ) {
+ throw new IOException(e.getMessage(), e);
+ }
return rc;
|
Sometimes hostname resolution will fail. Make sure that, if it does, we don't break the ioloop.
|
zeromq_jeromq
|
train
|
java
|
76add2088b049c035e7f35302e651fd452e44c35
|
diff --git a/components/markdown/code.js b/components/markdown/code.js
index <HASH>..<HASH> 100644
--- a/components/markdown/code.js
+++ b/components/markdown/code.js
@@ -6,7 +6,7 @@ import Code from '../code/code';
const MarkdownCode = ({value, language, inline}) => (
<Code
language={language}
- code={value}
+ code={value || ''}
inline={inline}
/>
);
diff --git a/components/markdown/markdown.test.js b/components/markdown/markdown.test.js
index <HASH>..<HASH> 100644
--- a/components/markdown/markdown.test.js
+++ b/components/markdown/markdown.test.js
@@ -48,4 +48,13 @@ describe('Markdown', () => {
});
wrapper.should.have.descendants(Code);
});
+
+ it('should convert not finished code block to empty ring Code', () => {
+ const wrapper = mountMarkdown({
+ source: `
+ \`\`\`
+ `
+ });
+ wrapper.should.have.descendants(Code);
+ });
});
|
RG-<I> Support empty value for markdown Code to be usable as preview for editor
|
JetBrains_ring-ui
|
train
|
js,js
|
15a2e5d89eddb04b364eeec89fdcf54df86407ef
|
diff --git a/src/main/java/zmq/Mailbox.java b/src/main/java/zmq/Mailbox.java
index <HASH>..<HASH> 100644
--- a/src/main/java/zmq/Mailbox.java
+++ b/src/main/java/zmq/Mailbox.java
@@ -95,6 +95,9 @@ public final class Mailbox implements Closeable
// Receive the signal.
signaler.recv();
+ if (errno.get() == ZError.EINTR) {
+ return null;
+ }
// Switch into active state.
active = true;
|
in zmq.Mailbox, a call to Signaler.recv could set errno to EINTR
This was not checked, cpipe.read will return null, active will be set.
I'm not sure that is a an expected state, and the assert make my tests fails.
|
zeromq_jeromq
|
train
|
java
|
8db62b11b8e88c729e743b7a6377ecae216bfb20
|
diff --git a/spec/feed_spec.rb b/spec/feed_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/feed_spec.rb
+++ b/spec/feed_spec.rb
@@ -17,7 +17,7 @@ describe Stream::Feed do
expect { Stream::Feed.new(nil, "feed-slug", "user_id", "") }.to raise_error Stream::StreamInputData
end
- it "should refuse feed_slug with underscores" do
- expect { Stream::Feed.new(nil, "feed_slug", "user_id", "") }.to raise_error Stream::StreamInputData
+ it "should not refuse feed_slug with underscores" do
+ expect { Stream::Feed.new(nil, "feed_slug", "user_id", "") }.to_not raise_error Stream::StreamInputData
end
end
|
Fix spec for underscore support for feed slugs
|
GetStream_stream-ruby
|
train
|
rb
|
add1b341b6276bdd563ac85f50d9581942b71385
|
diff --git a/src/Presentation/Console/Command/InitCommand.php b/src/Presentation/Console/Command/InitCommand.php
index <HASH>..<HASH> 100644
--- a/src/Presentation/Console/Command/InitCommand.php
+++ b/src/Presentation/Console/Command/InitCommand.php
@@ -42,7 +42,9 @@ class InitCommand extends AbstractCommand implements CommandInterface
protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new Style($input, $output);
- $io->caution('This operation should not be executed in a production environment!');
+ if (getenv('APP_ENV') === 'prod') {
+ $io->caution('This operation should not be executed in a production environment!');
+ }
$relVersion = $input->getArgument('rel_version') ?? null;
|
caution message must be displayed only on prod environment
|
llaville_php-compatinfo-db
|
train
|
php
|
e931edae6dedd6b8288cb21e7e99a2f3484d29dc
|
diff --git a/scripts/multibuild/mb/command.py b/scripts/multibuild/mb/command.py
index <HASH>..<HASH> 100644
--- a/scripts/multibuild/mb/command.py
+++ b/scripts/multibuild/mb/command.py
@@ -19,7 +19,8 @@ def build(testfile, indy_url, delay, vagrant_dir):
with open(testfile) as f:
build_config = yaml.safe_load(f)
- vagrant_dir = mb.vagrant.find_vagrant_dir(vagrant_dir)
+ if vagrant_dir is not None:
+ vagrant_dir = mb.vagrant.find_vagrant_dir(vagrant_dir)
if delay is None:
delay = 0
|
allow script to work without vagrant
|
Commonjava_indy
|
train
|
py
|
55822adfb4a5801abe519aa448a92bd5abaaa78a
|
diff --git a/lib/cmis.js b/lib/cmis.js
index <HASH>..<HASH> 100644
--- a/lib/cmis.js
+++ b/lib/cmis.js
@@ -88,6 +88,17 @@
};
/**
+ * sets character set used for non file fields in posted
+ * multipart/form-data resource
+ * @param {string} characterSet
+ * @return {CmisSession}
+ */
+ session.setCharacterSet = function (characterSet) {
+ _characterSet = characterSet;
+ return session;
+ };
+
+ /**
* Connects to a cmis server and retrieves repositories,
* token or credentils must already be set
*
@@ -1280,6 +1291,7 @@
var _token = null;
var _username = null;
var _password = null;
+ var _characterSet;
var _afterlogin;
var _proxyUrl = null;
@@ -1325,6 +1337,12 @@
var _postMultipart = function(url, options, content, mimeTypeExtension, filename) {
var req = _http('POST', url);
+ if (_characterSet !== undefined && options.length > 0){
+ // IN HTML5, the character set to use for non-file fields can
+ // be specified in a multipart by using a __charset__ field.
+ // https://dev.w3.org/html5/spec-preview/attributes-common-to-form-controls.html#attr-fe-name-charset
+ req.field('_charset_', _characterSet);
+ }
filename = filename || 'undefined';
for (var k in options) {
if (options[k] == 'cmis:name') {
|
Allow to specify the charset used for non-file fields posted int multipart/form-data
If you post a file with properties to update into the same multipart/form-data, you must be able to specify the charset used for your non-file fields to avoid a wrong decoding by the server. The HTML specs specifies the use of a pseudo field '_charset_' to do it (<URL>;)
|
agea_CmisJS
|
train
|
js
|
a9eb6bd8d3d0e114d306a0480ab4d4758e455dab
|
diff --git a/tests/unit-tests/Database/MultiDatabaseTest.php b/tests/unit-tests/Database/MultiDatabaseTest.php
index <HASH>..<HASH> 100644
--- a/tests/unit-tests/Database/MultiDatabaseTest.php
+++ b/tests/unit-tests/Database/MultiDatabaseTest.php
@@ -41,8 +41,9 @@ class MultiDatabaseTest extends Test
$this->website->managed_by_database_connection = 'mysql2';
- $this->assertTrue($this->websites->create($this->website));
+ $this->websites->create($this->website);
+ $this->assertTrue($this->website->exists);
$this->assertEquals('mysql2', $this->website->managed_by_database_connection);
// make sure the Website model still uses the regular system name.
|
assert checking response of method is not valid
|
tenancy_multi-tenant
|
train
|
php
|
e24490fb0c0af91b9d65c20b065cc3bd2e6a9688
|
diff --git a/main.go b/main.go
index <HASH>..<HASH> 100644
--- a/main.go
+++ b/main.go
@@ -114,11 +114,11 @@ func flush(postMetrics [][]DDMetric) {
// // TODO Is this the right type?
// NewPostMetric("veneur.stats.metrics_posted", float32(totalCount+1), "", "counter", *Interval),
// )
- postJSON, _ := json.MarshalIndent(map[string][]DDMetric{
+ postJSON, _ := json.Marshal(map[string][]DDMetric{
"series": finalMetrics,
- }, "", " ")
+ })
- fmt.Println(string(postJSON))
+ log.Println(string(postJSON))
resp, err := http.Post(fmt.Sprintf("%s/api/v1/series?api_key=%s", *APIURL, *Key), "application/json", bytes.NewBuffer(postJSON))
if err != nil {
@@ -131,7 +131,7 @@ func flush(postMetrics [][]DDMetric) {
if err != nil {
log.Printf("Error reading response body: %q", err)
}
- fmt.Printf("Response: %q", body)
+ log.Printf("Response: %q", body)
} else {
log.Println("Nothing to flush.")
}
|
Stop being so printy, don't indent JSON
|
stripe_veneur
|
train
|
go
|
015e38267faf1359906f8ca271515e0cef655b5f
|
diff --git a/test/default-level-test.js b/test/default-level-test.js
index <HASH>..<HASH> 100644
--- a/test/default-level-test.js
+++ b/test/default-level-test.js
@@ -26,25 +26,22 @@ define(['test/test-helpers'], function(testHelpers) {
it("new level is always set", function(log) {
log.setDefaultLevel("trace");
expect(log).toBeAtLevel("trace");
- expect(log.getLevel()).toBe(log.levels.TRACE);
});
it("level is not persisted", function(log) {
log.setDefaultLevel("debug");
expect("debug").not.toBeTheStoredLevel();
- expect(log.getLevel()).toBe(log.levels.DEBUG);
});
});
-
+
describe("If a level is saved", function () {
beforeEach(function () {
testHelpers.setStoredLevel("trace");
});
-
+
it("saved level is not modified", function (log) {
log.setDefaultLevel("debug");
expect(log).toBeAtLevel("trace");
- expect(log.getLevel()).toBe(log.levels.TRACE);
});
});
@@ -57,7 +54,6 @@ define(['test/test-helpers'], function(testHelpers) {
log.setDefaultLevel("debug");
expect(log).toBeAtLevel("debug");
expect("debug").not.toBeTheStoredLevel();
- expect(log.getLevel()).toBe(log.levels.DEBUG);
});
});
});
|
Tests for new things shouldn't be sprinkled
into existing tests
|
pimterry_loglevel
|
train
|
js
|
5c53b57f0a5e518567f71ef92b214eb3aa429313
|
diff --git a/core/interpreter/src/main/java/org/overture/interpreter/assistant/pattern/PPatternAssistantInterpreter.java b/core/interpreter/src/main/java/org/overture/interpreter/assistant/pattern/PPatternAssistantInterpreter.java
index <HASH>..<HASH> 100644
--- a/core/interpreter/src/main/java/org/overture/interpreter/assistant/pattern/PPatternAssistantInterpreter.java
+++ b/core/interpreter/src/main/java/org/overture/interpreter/assistant/pattern/PPatternAssistantInterpreter.java
@@ -28,7 +28,7 @@ public class PPatternAssistantInterpreter extends PPatternAssistantTC
/** A value for getLength meaning "any length" */
public static int ANY = -1;
- public static NameValuePairList getNamedValues(PPattern p, Value expval,
+ public NameValuePairList getNamedValues(PPattern p, Value expval,
Context ctxt) throws AnalysisException
{
List<AIdentifierPattern> ids = af.createPPatternAssistant().findIdentifiers(p);
|
restore and remove static keywords again because of problems in the ide.
|
overturetool_overture
|
train
|
java
|
312342af02cc67dc6877758fb8dad552f37c0eb3
|
diff --git a/autofit/optimize/non_linear/multi_nest.py b/autofit/optimize/non_linear/multi_nest.py
index <HASH>..<HASH> 100644
--- a/autofit/optimize/non_linear/multi_nest.py
+++ b/autofit/optimize/non_linear/multi_nest.py
@@ -142,7 +142,15 @@ class MultiNest(NonLinearOptimizer):
# noinspection PyUnusedLocal
def prior(cube, ndim, nparams):
- return model.physical_vector_from_hypercube_vector(hypercube_vector=cube)
+
+ # NEVER EVER REFACTOR THIS LINE!
+
+ phys_cube = model.physical_vector_from_hypercube_vector(hypercube_vector=cube)
+
+ for i in range(len(phys_cube)):
+ cube[i] = phys_cube[i]
+
+ return cube
fitness_function = MultiNest.Fitness(
self,
|
Fixed major bug with howw the unit cube was converted to a physical cube in multinest
|
rhayes777_PyAutoFit
|
train
|
py
|
da81d1a9ce7a037f7d3f3b43596ac65c34e44aa9
|
diff --git a/src/Storage/Query/SearchWeighter.php b/src/Storage/Query/SearchWeighter.php
index <HASH>..<HASH> 100644
--- a/src/Storage/Query/SearchWeighter.php
+++ b/src/Storage/Query/SearchWeighter.php
@@ -113,11 +113,19 @@ class SearchWeighter
foreach ($this->getContentFields() as $field => $weightings) {
$textualContent = $result->{$field};
+
+ // This is to handle taxonomies that need to be converted from an array
+ // into a string of words.
+ if (is_array($textualContent)) {
+ $textualContent = implode(" ", $textualContent);
+ }
+
$textualContent = strip_tags($textualContent);
$textualContent = preg_replace('/[^\w\s]/', '', $textualContent);
$textualContent = mb_strtolower($textualContent);
$corpus[$field] = $textualContent;
}
+
$dictionary = [];
$count = array();
|
convert taxonomy arrays to a string to perform text search
|
bolt_bolt
|
train
|
php
|
fdc3843887954d488e763dd5c3e4bb61051f7692
|
diff --git a/lib/api_auth.js b/lib/api_auth.js
index <HASH>..<HASH> 100644
--- a/lib/api_auth.js
+++ b/lib/api_auth.js
@@ -145,7 +145,6 @@ api.verifySignature = function(req, sig, account, callback)
var query = (sig.query).split("&").sort().filter(function(x) { return x != "" && x.indexOf(api.signatureHeaderName) != 0 }).join("&");
switch (sig.version) {
case -1:
- if (sig.secret == secret) return callback(sig);
if (!this.bcrypt) this.bcrypt = require('bcrypt');
this.bcrypt.compare(sig.secret, secret, function(err, rc) {
if (!rc) logger.debug("verifySignature:", 'failed', sig, account);
|
revert cleartext pw check
|
vseryakov_backendjs
|
train
|
js
|
11b49ad8cc46d163de356e575057eb236a08020b
|
diff --git a/lib/dynflow/executors/parallel/core.rb b/lib/dynflow/executors/parallel/core.rb
index <HASH>..<HASH> 100644
--- a/lib/dynflow/executors/parallel/core.rb
+++ b/lib/dynflow/executors/parallel/core.rb
@@ -66,6 +66,7 @@ module Dynflow
Terminate.(~any) >-> future do
logger.info 'shutting down Core ...'
@termination_future = future
+ try_to_terminate
end
end
@@ -114,7 +115,7 @@ module Dynflow
def continue_manager(manager, next_work)
if manager.done?
loose_manager_and_set_future manager.execution_plan.id
- terminate! if terminating? && @execution_plan_managers.empty?
+ try_to_terminate
else
feed_pool next_work
end
@@ -146,6 +147,10 @@ module Dynflow
@termination_future.set true
super()
end
+
+ def try_to_terminate
+ terminate! if terminating? && @execution_plan_managers.empty?
+ end
end
end
end
diff --git a/test/executor_test.rb b/test/executor_test.rb
index <HASH>..<HASH> 100644
--- a/test/executor_test.rb
+++ b/test/executor_test.rb
@@ -582,6 +582,11 @@ module Dynflow
$slow_actions_done.must_equal 1
end
+ it 'it terminates when no work' do
+ terminated = world.executor.terminate!
+ terminated.wait
+ end
+
end
end
end
|
Fix termination when no work is being executed
|
Dynflow_dynflow
|
train
|
rb,rb
|
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.