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
|
---|---|---|---|---|---|
ad3c53abfdf813de01eeaf7021e001194cb3cbe8 | diff --git a/app/assets/javascripts/sidebar.js b/app/assets/javascripts/sidebar.js
index <HASH>..<HASH> 100644
--- a/app/assets/javascripts/sidebar.js
+++ b/app/assets/javascripts/sidebar.js
@@ -28,16 +28,6 @@ var bind_sortable = function() {
helper: "clone",
revert: "invalid"
});
- $('.fake_button').on('ajax:beforeSend', function(e, xhr, settings) {
-
- console.log('BS befr');
- settings.data = $(this).parents('.active').find('input').serializeArray();
- console.log('BS after');
- });
- $('.fake_button').on('ajax:after', function(e, xhr, settings) {
- console.log('after');
- });
-
}
$(document).ready(function() {
bind_sortable(); | Remove fake_button stuff from js | publify_publify | train | js |
83f0d513ab2b01fa947a655a24005609ead1a05a | diff --git a/lib/cmd/handshake/client-capabilities.js b/lib/cmd/handshake/client-capabilities.js
index <HASH>..<HASH> 100644
--- a/lib/cmd/handshake/client-capabilities.js
+++ b/lib/cmd/handshake/client-capabilities.js
@@ -48,7 +48,7 @@ module.exports.init = function (opts, info) {
capabilities |= Capabilities.DEPRECATE_EOF;
}
- if (opts.database) {
+ if (opts.database && info.serverCapabilities & Capabilities.CONNECT_WITH_DB) {
capabilities |= Capabilities.CONNECT_WITH_DB;
} | [misc] ensure that connecting to database only if server has capability | MariaDB_mariadb-connector-nodejs | train | js |
06368dc82ba6ed7afb766806d890dd1dc8a448e7 | diff --git a/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDialog.java b/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDialog.java
index <HASH>..<HASH> 100755
--- a/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDialog.java
+++ b/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDialog.java
@@ -3,6 +3,7 @@ package com.github.bordertech.wcomponents;
import com.github.bordertech.wcomponents.util.I18nUtilities;
import java.io.Serializable;
import java.text.MessageFormat;
+import java.util.List;
/**
* <p>
@@ -320,6 +321,11 @@ public class WDialog extends AbstractWComponent implements Container, AjaxTarget
return super.getIndexOfChild(childComponent);
}
+ @Override
+ public List<WComponent> getChildren() {
+ return super.getChildren();
+ }
+
/**
* @return a String representation of this component, for debugging purposes.
*/ | Add getChildren() to Container API | BorderTech_wcomponents | train | java |
a1562878ba52c1ac1a654b8da779df224bc2464a | diff --git a/merge.go b/merge.go
index <HASH>..<HASH> 100644
--- a/merge.go
+++ b/merge.go
@@ -271,11 +271,6 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co
}
default:
mustSet := (isEmptyValue(dst) || overwrite) && (!isEmptyValue(src) || overwriteWithEmptySrc)
- v := fmt.Sprintf("%v", src)
- if v == "TestIssue106" {
- fmt.Println(mustSet)
- fmt.Println(dst.CanSet())
- }
if mustSet {
if dst.CanSet() {
dst.Set(src) | fixed issue #<I> by removing unused old test code | imdario_mergo | train | go |
1df660c2d2a9396d5e00a522befae431317b6fd9 | diff --git a/lib/oar/scripting.rb b/lib/oar/scripting.rb
index <HASH>..<HASH> 100644
--- a/lib/oar/scripting.rb
+++ b/lib/oar/scripting.rb
@@ -51,6 +51,10 @@ module OAR
Script.job
end # def:: job
+ def oarstat
+ Script.oarstat
+ end # def:: oarstat
+
end # module:: Scripting
end # module:: OAR
diff --git a/lib/oar/scripting/script.rb b/lib/oar/scripting/script.rb
index <HASH>..<HASH> 100644
--- a/lib/oar/scripting/script.rb
+++ b/lib/oar/scripting/script.rb
@@ -57,6 +57,10 @@ class OAR::Scripting::Script
@@steps
end # def:: self.steps
+ def self.oarstat
+ @@oarstat ||= JSON.parse(%x[oarstat -f -j @@job[:id] -J])[@@job[:id]]
+ end # def:: self.oarstat
+
def self.execute
@@steps.sort! { |a,b| a[:order] <=> b[:order] }
@@steps.each do |step| | Add oarstat method executed only one time and only if necessary | pmorillon_oar-scripting | train | rb,rb |
1ec3eb86891eaf221f51a5a99e5b7bf64d365242 | diff --git a/eZ/Publish/Core/Base/Exceptions/UnauthorizedException.php b/eZ/Publish/Core/Base/Exceptions/UnauthorizedException.php
index <HASH>..<HASH> 100644
--- a/eZ/Publish/Core/Base/Exceptions/UnauthorizedException.php
+++ b/eZ/Publish/Core/Base/Exceptions/UnauthorizedException.php
@@ -39,7 +39,7 @@ class UnauthorizedException extends APIUnauthorizedException implements Httpable
$this->setParameters(['%module%' => $module, '%function%' => $function]);
if ($properties) {
- $this->setMessageTemplate("User does not have access to '%function%' '%module%' with: %with%'");
+ $this->setMessageTemplate("User does not have access to '%function%' '%module%' with: %with%");
$with = [];
foreach ($properties as $name => $value) {
$with[] = "{$name} '{$value}'"; | EZP-<I>: Fixed typo in UnauthorizedException message (#<I>) | ezsystems_ezpublish-kernel | train | php |
93a53d7df9b97c4de0f1331db3c955f03de0b22d | diff --git a/jsont.js b/jsont.js
index <HASH>..<HASH> 100644
--- a/jsont.js
+++ b/jsont.js
@@ -50,6 +50,9 @@ function transform(obj,rules) {
elements[i] = elements[i].replaceAll('[*]','['+o+']'); //specify the current index
elements[i] = elements[i].replaceAll('self','');
elements[i] = jpath.fetchFromObject(obj,elements[i]);
+ if (Array.isArray(elements[i])) {
+ elements[i] = elements[i].join(''); // avoid commas being output
+ }
}
obj[newObjName] = elements.join('');
if (!isArray) continue; | Avoid commas being output when arrays concatenated | Mermade_jgeXml | train | js |
599c939bf2a9209607810f7215951b7886c67a4f | diff --git a/bakery/tasks.py b/bakery/tasks.py
index <HASH>..<HASH> 100644
--- a/bakery/tasks.py
+++ b/bakery/tasks.py
@@ -325,14 +325,10 @@ def process_project(project, log):
:param project: :class:`~bakery.models.Project` instance
:param log: :class:`~bakery.utils.RedisFd` as log
"""
- # login — user login
- # project_id - database project_id
-
- copy_and_rename_ufos_process(project, log)
-
- # autoprocess is set after setup is completed once
+ # setup is set after 'bake' button is first pressed
if project.config['local'].get('setup', None):
log.write('Bake Begins!\n', prefix = 'Header: ')
+ copy_and_rename_ufos_process(project, log)
generate_fonts_process(project, log)
ttfautohint_process(project, log)
ttx_process(project, log) | Move copy_and_rename_ufos_process() inside bake process in process_project() | googlefonts_fontbakery | train | py |
997c31cd19e08706ff17486bed2a4e398d192757 | diff --git a/airflow/providers/exasol/hooks/exasol.py b/airflow/providers/exasol/hooks/exasol.py
index <HASH>..<HASH> 100644
--- a/airflow/providers/exasol/hooks/exasol.py
+++ b/airflow/providers/exasol/hooks/exasol.py
@@ -19,6 +19,7 @@
from contextlib import closing
from typing import Any, Dict, List, Optional, Tuple, Union
+import pandas as pd
import pyexasol
from pyexasol import ExaConnection
@@ -63,7 +64,9 @@ class ExasolHook(DbApiHook):
conn = pyexasol.connect(**conn_args)
return conn
- def get_pandas_df(self, sql: Union[str, list], parameters: Optional[dict] = None, **kwargs) -> None:
+ def get_pandas_df(
+ self, sql: Union[str, list], parameters: Optional[dict] = None, **kwargs
+ ) -> pd.DataFrame:
"""
Executes the sql and returns a pandas dataframe
@@ -76,7 +79,8 @@ class ExasolHook(DbApiHook):
:type kwargs: dict
"""
with closing(self.get_conn()) as conn:
- conn.export_to_pandas(sql, query_params=parameters, **kwargs)
+ df = conn.export_to_pandas(sql, query_params=parameters, **kwargs)
+ return df
def get_records(
self, sql: Union[str, list], parameters: Optional[dict] = None | ExasolHook get_pandas_df does not return pandas dataframe but None (#<I>)
closes #<I>
ExasolHook get_pandas_df does not return pandas dataframe but None | apache_airflow | train | py |
8383ef1b630eae9f6d383334df94301cf0831aaa | diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/executor/FetchFromIndexStep.java b/core/src/main/java/com/orientechnologies/orient/core/sql/executor/FetchFromIndexStep.java
index <HASH>..<HASH> 100755
--- a/core/src/main/java/com/orientechnologies/orient/core/sql/executor/FetchFromIndexStep.java
+++ b/core/src/main/java/com/orientechnologies/orient/core/sql/executor/FetchFromIndexStep.java
@@ -72,13 +72,14 @@ public class FetchFromIndexStep extends AbstractExecutionStep {
}
long begin = profilingEnabled ? System.nanoTime() : 0;
try {
- Map.Entry<Object, OIdentifiable> currentEntry = nextEntry;
+ Object key = nextEntry.getKey();
+ OIdentifiable value = nextEntry.getValue();
fetchNextEntry();
localCount++;
OResultInternal result = new OResultInternal();
- result.setProperty("key", currentEntry.getKey());
- result.setProperty("rid", currentEntry.getValue());
+ result.setProperty("key", key);
+ result.setProperty("rid", value);
ctx.setVariable("$current", result);
return result;
} finally { | Fix wrong key results on SELECT FROM index:x | orientechnologies_orientdb | train | java |
3bf2b957c39019f36be70587194fbc1e5441c7f4 | diff --git a/tests/class-hyphenator-test.php b/tests/class-hyphenator-test.php
index <HASH>..<HASH> 100644
--- a/tests/class-hyphenator-test.php
+++ b/tests/class-hyphenator-test.php
@@ -355,7 +355,6 @@ class Hyphenator_Test extends Testcase {
* @uses PHP_Typography\Text_Parser\Token
* @uses PHP_Typography\Strings::functions
* @uses PHP_Typography\Strings::mb_str_split
- * @uses \mb_convert_encoding
*/
public function test_hyphenate_wrong_encoding() {
$this->h->set_language( 'de' );
@@ -457,8 +456,6 @@ class Hyphenator_Test extends Testcase {
* @covers ::hyphenate_word
* @covers ::lookup_word_pattern
*
- * @uses ReflectionClass
- * @uses ReflectionProperty
* @uses PHP_Typography\Hyphenator\Trie_Node
* @uses PHP_Typography\Text_Parser\Token
* @uses PHP_Typography\Strings::functions
@@ -502,7 +499,6 @@ class Hyphenator_Test extends Testcase {
* @covers ::convert_hyphenation_exception_to_pattern
*
* @uses PHP_Typography\Strings::functions
- * @uses \mb_convert_encoding
*/
public function test_convert_hyphenation_exception_to_pattern_unknown_encoding() {
$h = $this->h; | Tests: Remove invalid @uses annotations (for PHP-internal constructs) | mundschenk-at_php-typography | train | php |
81769000ebec44577a66446789adae76c53587b4 | diff --git a/src/main/java/org/jboss/pressgang/ccms/filter/builder/TopicFilterQueryBuilder.java b/src/main/java/org/jboss/pressgang/ccms/filter/builder/TopicFilterQueryBuilder.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jboss/pressgang/ccms/filter/builder/TopicFilterQueryBuilder.java
+++ b/src/main/java/org/jboss/pressgang/ccms/filter/builder/TopicFilterQueryBuilder.java
@@ -38,7 +38,10 @@ public class TopicFilterQueryBuilder extends BaseTopicFilterQueryBuilder<Topic>
final String[] components = fieldStringValue.split(":");
if (components.length == 2) {
try {
- addExistsCondition(getMatchingMinHash(Integer.parseInt(components[0]), Float.parseFloat(components[1])));
+ final Subquery<Topic> subQuery = getMatchingMinHash(Integer.parseInt(components[0]), Float.parseFloat(components[1]));
+ if (subQuery != null) {
+ addExistsCondition(subQuery);
+ }
} catch (final NumberFormatException ex) {
} | Added the ability to search for an equal min hash | pressgang-ccms_PressGangCCMSQuery | train | java |
a86b44b1cafcb56bc8eb85e16ce344c12a90a56b | diff --git a/repository/googledocs/repository.class.php b/repository/googledocs/repository.class.php
index <HASH>..<HASH> 100644
--- a/repository/googledocs/repository.class.php
+++ b/repository/googledocs/repository.class.php
@@ -122,6 +122,8 @@ class repository_googledocs extends repository {
return $dir.$file;
}
-
+ public function supported_filetypes() {
+ return array('document');
+ }
}
//Icon from: http://www.iconspedia.com/icon/google-2706.html | "REPOSITORY, GDOCS/MDL-<I>, tell filepicker gdocs support documents only" | moodle_moodle | train | php |
69958073e277f6789d089f930148fc9c0229fb34 | diff --git a/src/Validator/InputValidator.php b/src/Validator/InputValidator.php
index <HASH>..<HASH> 100644
--- a/src/Validator/InputValidator.php
+++ b/src/Validator/InputValidator.php
@@ -244,7 +244,7 @@ class InputValidator
];
foreach ($type->getFields() as $fieldName => $inputField) {
- $mapping['properties'][$fieldName] = $inputField->config['validation'];
+ $mapping['properties'][$fieldName] = $inputField->config['validation'] ?? [];
}
return $this->buildValidationTree(new ValidationNode($type, null, $parent, $this->resolverArgs), $mapping, $value); | Fix bug in validator
Fix the bug described in #<I> | overblog_GraphQLBundle | train | php |
946a7be1a5c321c1bedf3a6ca1a532a7fe3f1229 | diff --git a/lib/event_sourcery/event_store/event_sink.rb b/lib/event_sourcery/event_store/event_sink.rb
index <HASH>..<HASH> 100644
--- a/lib/event_sourcery/event_store/event_sink.rb
+++ b/lib/event_sourcery/event_store/event_sink.rb
@@ -1,3 +1,5 @@
+require 'forwardable'
+
module EventSourcery
module EventStore
class EventSink
diff --git a/spec/support/event_helpers.rb b/spec/support/event_helpers.rb
index <HASH>..<HASH> 100644
--- a/spec/support/event_helpers.rb
+++ b/spec/support/event_helpers.rb
@@ -1,3 +1,5 @@
+require 'securerandom'
+
module EventHelpers
def new_event(aggregate_id: SecureRandom.uuid, type: 'test_event', body: {}, id: nil, version: 1, created_at: nil, uuid: SecureRandom.uuid)
EventSourcery::Event.new(id: id, | Add explicit requires
The test suite won't pass on my machine without these requires. | envato_event_sourcery | train | rb,rb |
7da4fb67e0af6c97cd6c5a93a855525a42d64e12 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -144,6 +144,21 @@ function redisStore(args) {
return value !== null && value !== undefined;
};
+ self.getClient = function(cb) {
+ connect(function (err, conn) {
+ if (err) {
+ return cb && cb(err);
+ }
+ cb(null, {
+ client: conn,
+ done: function(done) {
+ pool.release(conn);
+ if (done && typeof done === 'function') done();
+ }
+ });
+ });
+ };
+
return self;
} | adds 'getClient' method which provides access to the native redis client | dial-once_node-cache-manager-redis | train | js |
b5493ce7f76452e0bdfa992444f039d9deaad0dc | diff --git a/lib/components/connector.js b/lib/components/connector.js
index <HASH>..<HASH> 100644
--- a/lib/components/connector.js
+++ b/lib/components/connector.js
@@ -218,7 +218,7 @@ var bindEvents = function(self, socket) {
socket.on('message', function(msg) {
var dmsg = msg;
if(self.decode) {
- dmsg = self.decode(msg);
+ dmsg = self.decode.call(self, msg, session);
} else if(self.connector.decode) {
dmsg = self.connector.decode(msg);
} | modify custom decoder to be able to do more work. | NetEase_pomelo | train | js |
5ffa946160fdf2545a77fe137d5222629dd907ab | diff --git a/pipenv/cli/command.py b/pipenv/cli/command.py
index <HASH>..<HASH> 100644
--- a/pipenv/cli/command.py
+++ b/pipenv/cli/command.py
@@ -313,9 +313,11 @@ def lock(
"""Generates Pipfile.lock."""
from ..core import ensure_project, do_init, do_lock
# Ensure that virtualenv is available.
+ # Note that we don't pass clear on to ensure_project as it is also
+ # handled in do_lock
ensure_project(
three=state.three, python=state.python, pypi_mirror=state.pypi_mirror,
- warn=(not state.quiet), site_packages=state.site_packages, clear=state.clear
+ warn=(not state.quiet), site_packages=state.site_packages,
)
if state.installstate.requirementstxt:
do_init( | Don't pass clear along to ensure_project during lock | pypa_pipenv | train | py |
83a7d7202fbf8c0e21067b0ed89c1239fb7ab3c8 | diff --git a/phy/io/kwik/model.py b/phy/io/kwik/model.py
index <HASH>..<HASH> 100644
--- a/phy/io/kwik/model.py
+++ b/phy/io/kwik/model.py
@@ -392,6 +392,15 @@ class KwikModel(BaseModel):
params = {}
for attr in self._kwik.attrs(path):
params[attr] = self._kwik.read_attr(path, attr)
+ # Make sure all params are there.
+ default_params = {}
+ settings = _load_default_settings()
+ default_params.update(settings['traces'])
+ default_params.update(settings['spikedetekt'])
+ default_params.update(settings['klustakwik2'])
+ for name, default_value in default_params.items():
+ if name not in params:
+ params[name] = default_value
self._metadata = params
def _load_probe(self): | Fixing metadata bug in Kwik model. | kwikteam_phy | train | py |
b5df3f2ec3096fea0ceb7e7c4b1aa395aa947334 | diff --git a/lib/asset-resolver.js b/lib/asset-resolver.js
index <HASH>..<HASH> 100644
--- a/lib/asset-resolver.js
+++ b/lib/asset-resolver.js
@@ -12,12 +12,12 @@ function AssetResolver(options) {
Object.freeze(this);
}
-AssetResolver.prototype.resolvePath = function (to) {
- return resolvePath(to, this.options);
+AssetResolver.prototype.resolvePath = function (to, callback) {
+ return resolvePath(to, this.options, callback);
};
-AssetResolver.prototype.resolveUrl = function (to) {
- return resolveUrl(to, this.options);
+AssetResolver.prototype.resolveUrl = function (to, callback) {
+ return resolveUrl(to, this.options, callback);
};
module.exports = AssetResolver; | Pass callbacks to AssetResolver.prototype methods | borodean_assets | train | js |
85f9f0c0163cc282c9c399fc44594eba581cd3e8 | diff --git a/Swat/SwatHtmlHeadEntrySetDisplayer.php b/Swat/SwatHtmlHeadEntrySetDisplayer.php
index <HASH>..<HASH> 100644
--- a/Swat/SwatHtmlHeadEntrySetDisplayer.php
+++ b/Swat/SwatHtmlHeadEntrySetDisplayer.php
@@ -319,14 +319,13 @@ class SwatHtmlHeadEntrySetDisplayer extends SwatObject
protected function getTypeOrder()
{
return array(
- 'SwatStyleSheetHtmlHeadEntry' => 0,
- 'SwatLessStyleSheetHtmlHeadEntry' => 1,
- 'SwatLinkHtmlHeadEntry' => 2,
- 'SwatConditionalJavaScriptHtmlHeadEntry' => 3,
- 'SwatInlineJavaScriptHtmlHeadEntry' => 4,
- 'SwatJavaScriptHtmlHeadEntry' => 5,
- 'SwatCommentHtmlHeadEntry' => 6,
- '__unknown__' => 7,
+ 'SwatStyleSheetHtmlHeadEntry' => 0,
+ 'SwatLessStyleSheetHtmlHeadEntry' => 1,
+ 'SwatLinkHtmlHeadEntry' => 2,
+ 'SwatInlineJavaScriptHtmlHeadEntry' => 3,
+ 'SwatJavaScriptHtmlHeadEntry' => 4,
+ 'SwatCommentHtmlHeadEntry' => 5,
+ '__unknown__' => 6,
);
} | Remove unused type from sort order. | silverorange_swat | train | php |
e8bd1d6891bc71641639af54e1abedcae06de731 | diff --git a/go/vt/worker/fake_pool_connection_test.go b/go/vt/worker/fake_pool_connection_test.go
index <HASH>..<HASH> 100644
--- a/go/vt/worker/fake_pool_connection_test.go
+++ b/go/vt/worker/fake_pool_connection_test.go
@@ -76,7 +76,11 @@ func (f *FakePoolConnection) addExpectedExecuteFetchAtIndex(index int, entry Exp
f.expectedExecuteFetch = append(f.expectedExecuteFetch, entry)
} else {
// Grow the slice by one element.
- f.expectedExecuteFetch = f.expectedExecuteFetch[0 : len(f.expectedExecuteFetch)+1]
+ if cap(f.expectedExecuteFetch) == len(f.expectedExecuteFetch) {
+ f.expectedExecuteFetch = append(f.expectedExecuteFetch, make([]ExpectedExecuteFetch, 1)...)
+ } else {
+ f.expectedExecuteFetch = f.expectedExecuteFetch[0 : len(f.expectedExecuteFetch)+1]
+ }
// Use copy to move the upper part of the slice out of the way and open a hole.
copy(f.expectedExecuteFetch[index+1:], f.expectedExecuteFetch[index:])
// Store the new value. | worker: FakePoolConnection: Fix bug where the capacity of the slice was not big enough to insert an element in the middle. | vitessio_vitess | train | go |
794ac3fae345b0ee1dbdc2b969798bc9d0699077 | diff --git a/synergy/supervisor/synergy_supervisor.py b/synergy/supervisor/synergy_supervisor.py
index <HASH>..<HASH> 100644
--- a/synergy/supervisor/synergy_supervisor.py
+++ b/synergy/supervisor/synergy_supervisor.py
@@ -9,7 +9,6 @@ from psutil import TimeoutExpired
from launch import get_python, PROJECT_ROOT, PROCESS_STARTER
from synergy.conf import settings
-from synergy.db.model import box_configuration
from synergy.db.dao.box_configuration_dao import BoxConfigurationDao, QUERY_PROCESSES_FOR_BOX_ID
from synergy.supervisor.supervisor_constants import TRIGGER_INTERVAL
from synergy.supervisor.supervisor_configurator import get_box_id
@@ -119,7 +118,7 @@ class Supervisor(SynergyProcess):
process_name = args[0]
try:
box_config = self.bc_dao.get_one([self.box_id, process_name])
- if box_config.state == box_configuration.STATE_OFF:
+ if not box_config.is_on:
if box_config.pid is not None:
self._kill_process(box_config)
return | - addressing start-time issues | mushkevych_scheduler | train | py |
895b1de069363dbbacb210aabcdbf206b98e946c | diff --git a/test/test_cql_parser.rb b/test/test_cql_parser.rb
index <HASH>..<HASH> 100644
--- a/test/test_cql_parser.rb
+++ b/test/test_cql_parser.rb
@@ -7,6 +7,7 @@ class TestCqlParser < Test::Unit::TestCase
lines = IO.readlines( File.dirname(__FILE__) + '/fixtures/sample_queries.txt' )
lines.each do |line|
next if /^\s*#/ =~ line
+ next if /^(\s|\n)*$/ =~ line
begin
tree = parser.parse( line )
puts "in=#{line} out=#{tree.to_cql}" if tree | skip newlines in file of sample CQL. Still can't parse all of em though. | jrochkind_cql-ruby | train | rb |
ba19fb99beec98a79fa2432ad0b2dc874d229dd1 | diff --git a/advanced_filters/tests/test_admin.py b/advanced_filters/tests/test_admin.py
index <HASH>..<HASH> 100644
--- a/advanced_filters/tests/test_admin.py
+++ b/advanced_filters/tests/test_admin.py
@@ -8,6 +8,7 @@ from tests import factories
class ChageFormAdminTest(TestCase):
+ """ Test the AdvancedFilter admin change page """
def setUp(self):
self.user = factories.SalesRep()
assert self.client.login(username='user', password='test')
@@ -55,6 +56,7 @@ class ChageFormAdminTest(TestCase):
class AdvancedFilterCreationTest(TestCase):
+ """ Test creation of AdvancedFilter in target model changelist """
form_data = {'form-TOTAL_FORMS': 1, 'form-INITIAL_FORMS': 0,
'action': 'advanced_filters'}
good_data = {'title': 'Test title', 'form-0-field': 'language',
@@ -129,6 +131,7 @@ class AdvancedFilterCreationTest(TestCase):
class AdvancedFilterUsageTest(TestCase):
+ """ Test filter visibility and actual filtering of a changelist """
def setUp(self):
self.user = factories.SalesRep()
assert self.client.login(username='user', password='test') | tests(admin): add some docstrings to TestCase classes | modlinltd_django-advanced-filters | train | py |
e58571229778a37441798fb472717b55f126d9b5 | diff --git a/GPG/Driver/Php.php b/GPG/Driver/Php.php
index <HASH>..<HASH> 100644
--- a/GPG/Driver/Php.php
+++ b/GPG/Driver/Php.php
@@ -1368,15 +1368,7 @@ class Crypt_GPG_Driver_Php extends Crypt_GPG
$this->_closePipe($pipe_number);
}
- $termination_status = proc_close($this->_process);
-
- // proc_close returns a termination status, not exit code
- if (($termination_status & 0x7f) == 0) { // WIFEXITED
- $exit_code = ($termination_status & 0xff) >> 8; // WEXITSTATUS
- } else {
- $exit_code = -1;
- }
-
+ $exit_code = proc_close($this->_process);
if ($exit_code != 0) {
$this->_debug('Subprocess returned an unexpected exit code: ' .
$exit_code); | After examining PHP CVS, this does seem to return an exit code afterall.
git-svn-id: <URL> | pear_Crypt_GPG | train | php |
72ec8c990a9a08946414c2bafaa169f67baa7d8b | diff --git a/lxd/cluster/events.go b/lxd/cluster/events.go
index <HASH>..<HASH> 100644
--- a/lxd/cluster/events.go
+++ b/lxd/cluster/events.go
@@ -370,7 +370,7 @@ func EventsUpdateListeners(endpoints *endpoints.Endpoints, cluster *db.Cluster,
}
if len(members) > 1 && len(keepListeners) <= 0 {
- logger.Error("No active cluster event listener clients")
+ logger.Error("No active cluster event listener clients", log.Ctx{"local": localAddress})
}
} | lxd/cluster/events: log No active cluster event listeners | lxc_lxd | train | go |
a1c63a29120ee91faadcfb06c739cfaf02c170b1 | diff --git a/admin/javascript/LeftAndMain.js b/admin/javascript/LeftAndMain.js
index <HASH>..<HASH> 100644
--- a/admin/javascript/LeftAndMain.js
+++ b/admin/javascript/LeftAndMain.js
@@ -212,9 +212,9 @@
newContentEl
.removeClass(layoutClasses.join(' '))
- .addClass(origLayoutClasses.join(' '))
- .attr('style', origStyle)
- .css('visibility', 'hidden');
+ .addClass(origLayoutClasses.join(' '));
+ if(origStyle) newContentEl.attr('style', origStyle)
+ newContentEl.css('visibility', 'hidden');
// Allow injection of inline styles, as they're not allowed in the document body.
// Not handling this through jQuery.ondemand to avoid parsing the DOM twice. | MINOR Only setting style attributes in LeftAndMain panel handling if it was previously set | silverstripe_silverstripe-framework | train | js |
1876a09a92d71595a3c5e8ebef84834b95d0de50 | diff --git a/src/Administration/Resources/administration/src/module/sw-product-stream/component/sw-product-stream-filter/index.js b/src/Administration/Resources/administration/src/module/sw-product-stream/component/sw-product-stream-filter/index.js
index <HASH>..<HASH> 100644
--- a/src/Administration/Resources/administration/src/module/sw-product-stream/component/sw-product-stream-filter/index.js
+++ b/src/Administration/Resources/administration/src/module/sw-product-stream/component/sw-product-stream-filter/index.js
@@ -66,6 +66,9 @@ Component.extend('sw-product-stream-filter', 'sw-condition-base', {
case 'object':
case 'number':
if (field.entity) {
+ this.operatorCriteria = CriteriaFactory.multi('OR',
+ CriteriaFactory.equals('type', 'equals'),
+ CriteriaFactory.equals('type', 'equalsAny'));
break;
}
this.operatorCriteria = CriteriaFactory.multi('OR', | NEXT-<I> - range filter component | shopware_platform | train | js |
c57359e3882b644ced691fce89c80ed4f28f3dc8 | diff --git a/bin/joblint.js b/bin/joblint.js
index <HASH>..<HASH> 100755
--- a/bin/joblint.js
+++ b/bin/joblint.js
@@ -62,7 +62,11 @@ function runCommandOnFile (fileName) {
}
function runCommandOnStdIn () {
- captureStdIn(handleInputSuccess);
+ if (isTty(process.stdin)) {
+ handleInputFailure('Input stream not detected');
+ } else {
+ captureStdIn(handleInputSuccess);
+ }
}
function handleInputFailure (msg) {
@@ -85,3 +89,7 @@ function captureStdIn (done) {
done(data);
});
}
+
+function isTty (stream) {
+ return true === stream.isTTY;
+} | Detect possible empty input stream
Using `process.stdin.isTTY`, detect whether streaming input is even
possible. If the process is a TTY, then nothing has been piped into the
command. If the process is not a TTY, then it is *possible*, but not
definite, that input is being streamed. | rowanmanning_joblint | train | js |
2678ebd52b4deccce137e3c7914125647bd72218 | diff --git a/nfc/handover/server.py b/nfc/handover/server.py
index <HASH>..<HASH> 100644
--- a/nfc/handover/server.py
+++ b/nfc/handover/server.py
@@ -70,8 +70,8 @@ class HandoverServer(Thread):
break # message complete
except nfc.ndef.LengthError:
continue # need more data
- else:
- return # connection closed
+ else: return # connection closed
+ else: return # connection closed
log.debug("<<< {0!r}".format(request_data))
response = handover_server._process_request(request) | handle connection closed also if llcp.poll() returns false | nfcpy_nfcpy | train | py |
3f9ff88ebd7392d1f5d4248d0d484e8eb0cbce82 | diff --git a/wandb/run_manager.py b/wandb/run_manager.py
index <HASH>..<HASH> 100644
--- a/wandb/run_manager.py
+++ b/wandb/run_manager.py
@@ -518,8 +518,9 @@ class RunManager(object):
os.path.join(self._watch_dir, os.path.normpath('*'))]
# Ignore hidden files/folders and output.log because we stream it specially
file_event_handler._ignore_patterns = [
- '*/.*',
'*.tmp',
+ os.path.join(self._run.dir, ".*"),
+ os.path.join(self._run.dir, "*/.*"),
os.path.join(self._run.dir, OUTPUT_FNAME)
]
for glob in self._api.settings("ignore_globs"): | Dont ignore files with within a hidden directory | wandb_client | train | py |
1bd6f68f8314de26c8225980ace1e6c390d0916c | diff --git a/spec/octokit/client/contents_spec.rb b/spec/octokit/client/contents_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/octokit/client/contents_spec.rb
+++ b/spec/octokit/client/contents_spec.rb
@@ -1,4 +1,5 @@
require 'helper'
+require 'tempfile'
describe Octokit::Client::Contents do | Adding require to spec to fix JRuby and Rubinius
The spec appears to fail currently in JRuby and Rubinius because of this missing require. | octokit_octokit.rb | train | rb |
56b5d16a4d81769557fc8aeb59421badca03f41a | diff --git a/course/mod.php b/course/mod.php
index <HASH>..<HASH> 100644
--- a/course/mod.php
+++ b/course/mod.php
@@ -645,7 +645,7 @@
$defaultformat = FORMAT_MOODLE;
}
- $icon = "<img align=\"middle\" height=\"16\" width=\"16\" src=\"$CFG->modpixpath/$module->name/icon.gif\" alt=\"\" /> ";
+ $icon = '<img align="middle" height="16" width="16" src="'.$CFG->modpixpath.'/'.$module->name.'/icon.gif" alt="" style="vertical-align: middle;" /> ';
print_heading_with_help($pageheading, "mods", $module->name, $icon);
print_simple_box_start('center', '', '', 5, 'generalbox', $module->name); | Fixed alignment of module icon so it looks correct also in Firefox. | moodle_moodle | train | php |
a8e18b6bf798f0b7a2f25159e2c12f1be7dae79f | diff --git a/lib/configs/recommended.js b/lib/configs/recommended.js
index <HASH>..<HASH> 100644
--- a/lib/configs/recommended.js
+++ b/lib/configs/recommended.js
@@ -8,7 +8,7 @@ module.exports = {
'block-spacing': [2, 'always'],
'brace-style': [2, '1tbs', {'allowSingleLine': true}],
'camelcase': [2, {'properties': 'always'}],
- 'comma-dangle': [2, 'only-multiline'],
+ 'comma-dangle': [2, 'never'],
'eol-last': 2,
'eqeqeq': [2, 'smart'],
'func-style': [2, 'declaration'], | Change comma dangle rule to never
Aligns closer to Prettier default configuration. | github_eslint-plugin-github | train | js |
f1ae5865e6c694f938cab1bbadff4c4a996791f8 | diff --git a/src/models/Server.php b/src/models/Server.php
index <HASH>..<HASH> 100644
--- a/src/models/Server.php
+++ b/src/models/Server.php
@@ -248,6 +248,21 @@ class Server extends \hipanel\base\Model
return $this->hasMany(Binding::class, ['device_id' => 'id'])->indexBy('type');
}
+ public function getMonitoringSettings()
+ {
+ return $this->hasOne(MonitoringSettings::class, ['id' => 'id']);
+ }
+
+ public function getHardwareSettings()
+ {
+ return $this->hasOne(HardwareSettings::class, ['id' => 'id']);
+ }
+
+ public function getSoftwareSettings()
+ {
+ return $this->hasOne(SoftwareSettings::class, ['id' => 'id']);
+ }
+
public function getBinding($type)
{
if (!isset($this->bindings[$type])) { | Added related to Server for Monitoring, Hardware, Software settings | hiqdev_hipanel-module-server | train | php |
8fbba76346ad867cf503934b4cf619d2fe8b1847 | diff --git a/system/Database/SQLSRV/Connection.php b/system/Database/SQLSRV/Connection.php
index <HASH>..<HASH> 100755
--- a/system/Database/SQLSRV/Connection.php
+++ b/system/Database/SQLSRV/Connection.php
@@ -129,12 +129,11 @@ class Connection extends BaseConnection
unset($connection['UID'], $connection['PWD']);
}
+ sqlsrv_configure('WarningsReturnAsErrors', 0);
$this->connID = sqlsrv_connect($this->hostname, $connection);
if ($this->connID !== false)
{
- sqlsrv_configure('WarningsReturnAsErrors', 0);
-
// Determine how identifiers are escaped
$query = $this->query('SELECT CASE WHEN (@@OPTIONS | 256) = @@OPTIONS THEN 1 ELSE 0 END AS qi');
$query = $query->getResultObject(); | Set WarningsReturnAsErrors = 0 before connection (#<I>)
* Set WarningsReturnAsErrors = 0 before connection
If there is a warning establishing the connection, it will treat it as an error and Codeigniter will throw an exception. It should be configured prior the first sql command.
* Removed extra whitespace | codeigniter4_CodeIgniter4 | train | php |
ee9d635163747aac5e7a8290d75c2c3f108b9e3b | diff --git a/contribs/gmf/src/directives/mobilenav.js b/contribs/gmf/src/directives/mobilenav.js
index <HASH>..<HASH> 100644
--- a/contribs/gmf/src/directives/mobilenav.js
+++ b/contribs/gmf/src/directives/mobilenav.js
@@ -144,7 +144,19 @@ gmf.mobileNavDirective = function() {
// one is properly deactivated. This prevents weird animation
// effects.
window.setTimeout(function() {
- nav.addClass('active');
+ // fix for safari: the following 3 lines force that the position
+ // of the newly inserted element is calculated.
+ // see http://stackoverflow.com/a/3485654/119937
+ nav.css('display', 'none');
+ nav.offset();
+ nav.css('display', '');
+
+ window.setTimeout(function() {
+ // fix: calling `position()` makes sure that the animation
+ // is always run
+ nav.position();
+ nav.addClass('active');
+ }, 0);
}, 0);
} | Fix menu animation on Safari
In a sidebar, when clicking on a link in the main menu (e.g. "Background"),
the title bar turned white during the animation on Safari.
The problem is that the newly inserted element did not have the right position
after insertion on Safari. The "fix" forces Safari to calculate the position. | camptocamp_ngeo | train | js |
eb17604561daf5198ccaecbdca244184f6198a67 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -9,10 +9,10 @@ from distutils.core import setup
setup(name='kkbox_developer_sdk',
description='KKBOX Open API Developer SDK for Python',
author='KKBOX',
- author_email='[email protected]',
- version='1.0.6',
+ author_email='[email protected]',
+ version='1.0.7',
url='https://github.com/KKBOX/OpenAPI-Python',
- download_url='https://github.com/KKBOX/OpenAPI-Python/tarball/v1.0.6',
+ download_url='https://github.com/KKBOX/OpenAPI-Python/tarball/v1.0.7',
packages=['kkbox_developer_sdk'],
package_dir={'kkbox_developer_sdk': 'kkbox_developer_sdk'},
keywords=['KKBOX', 'Open', 'API', 'OpenAPI']) | Bumps version to <I>. | KKBOX_OpenAPI-Python | train | py |
1d67e09479602cdce60ce2a1e8a6c5cc13b0c07c | diff --git a/src/main/java/com/couchbase/lite/support/Version.java b/src/main/java/com/couchbase/lite/support/Version.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/couchbase/lite/support/Version.java
+++ b/src/main/java/com/couchbase/lite/support/Version.java
@@ -5,8 +5,8 @@ import com.couchbase.lite.util.Log;
public class Version {
public static final String VERSION;
- private static final String VERSION_NAME="${VERSION_NAME}"; // replaced during build process
- private static final String VERSION_CODE="${VERSION_CODE}"; // replaced during build process
+ private static final String VERSION_NAME="%VERSION_NAME%"; // replaced during build process
+ private static final String VERSION_CODE="%VERSION_CODE%"; // replaced during build process
static {
int versCode = getVersionCode();
@@ -18,14 +18,14 @@ public class Version {
}
public static String getVersionName() {
- if (VERSION_NAME == "${VERSION_NAME}") {
+ if (VERSION_NAME.contains("VERSION_NAME")) {
return "devbuild";
}
return VERSION_NAME;
}
public static int getVersionCode() {
- if (VERSION_CODE == "${VERSION_CODE}") {
+ if (VERSION_CODE.contains("VERSION_CODE")) {
return 0;
}
@@ -46,4 +46,4 @@ public class Version {
public static String getVersion() {
return VERSION;
}
-}
+}
\ No newline at end of file | - merge Version.java from release/<I> branch | couchbase_couchbase-lite-java-core | train | java |
a384ced165f71818a03e76971d289e38a5b6bcd3 | diff --git a/db/sql/mapper.php b/db/sql/mapper.php
index <HASH>..<HASH> 100644
--- a/db/sql/mapper.php
+++ b/db/sql/mapper.php
@@ -287,8 +287,6 @@ class Mapper extends \DB\Cursor {
$val=$this->db->value(
$this->fields[$field]['pdo_type'],$val);
}
- elseif (array_key_exists($field,$this->adhoc))
- $this->adhoc[$field]['value']=$val;
unset($val);
}
$out[]=$this->factory($row); | Bug fix: Query generates wrong adhoc field value | bcosca_fatfree-core | train | php |
50ab5e557d088f0f41ad87375c97a89d768e8f58 | diff --git a/lib/bootstrap.js b/lib/bootstrap.js
index <HASH>..<HASH> 100644
--- a/lib/bootstrap.js
+++ b/lib/bootstrap.js
@@ -9,7 +9,7 @@ function emit(event) {
}
phantom.onError = function bootstrapOnError(msg, trace) {
- emit('error', msg);
+ emit('error', msg, trace);
phantom.exit(1);
}; | Also emit trace when crashing in onError | SpookyJS_SpookyJS | train | js |
83e351d0bc9e855167ffa012db4c750145f3791c | diff --git a/blockstore/lib/nameset/__init__.py b/blockstore/lib/nameset/__init__.py
index <HASH>..<HASH> 100644
--- a/blockstore/lib/nameset/__init__.py
+++ b/blockstore/lib/nameset/__init__.py
@@ -50,5 +50,7 @@ import virtualchain_hooks
from .namedb import BlockstoreDB, get_namespace_from_name, price_name, \
get_name_from_fq_name, price_namespace
+
+# this module is suitable to be a virtualchain state engine implementation
from .virtualchain_hooks import get_virtual_chain_name, get_virtual_chain_version, get_first_block_id, get_opcodes, \
get_op_processing_order, get_magic_bytes, get_db_state, db_parse, db_check, db_commit, db_save | clarify nameset's role in the virtualchain state engine | blockstack_blockstack-core | train | py |
23eb63befcc3c51bd845ac995e5a228d6a174138 | diff --git a/frontend/pyqt5/harvester.py b/frontend/pyqt5/harvester.py
index <HASH>..<HASH> 100644
--- a/frontend/pyqt5/harvester.py
+++ b/frontend/pyqt5/harvester.py
@@ -324,6 +324,7 @@ class Harvester(QMainWindow):
#
button_update.add_observer(self._widget_device_list)
+ button_update.add_observer(button_connect)
#
button_connect.add_observer(button_select_file)
@@ -467,7 +468,8 @@ class ActionConnect(Action):
#
enable = False
if self.parent().cti_files:
- if self.parent().harvester_core.connecting_device is None:
+ if self.parent().harvester_core.device_info_list and \
+ self.parent().harvester_core.connecting_device is None:
enable = True
self.setEnabled(enable) | Disable the Connect button if no camera is connected | genicam_harvesters | train | py |
568e62e5b9b448fe7d4aba1a161e1a43f800304c | diff --git a/test/fake_app.rb b/test/fake_app.rb
index <HASH>..<HASH> 100644
--- a/test/fake_app.rb
+++ b/test/fake_app.rb
@@ -2,7 +2,6 @@
ENV['DB'] ||= 'sqlite3'
require 'active_record/railtie'
-load 'active_record/railties/databases.rake'
module DatabaseRewinderTestApp
Application = Class.new(Rails::Application) do
@@ -14,6 +13,8 @@ module DatabaseRewinderTestApp
end.initialize!
end
+load 'active_record/railties/databases.rake'
+
require 'active_record/base'
ActiveRecord::Tasks::DatabaseTasks.root ||= Rails.root
ActiveRecord::Tasks::DatabaseTasks.drop_current ENV['DB'] | Rails 6 expects the Rails::Application to be defined before loading database.rake | amatsuda_database_rewinder | train | rb |
e2829d276f8346e25bf22052f5bb7151d112d22a | diff --git a/lib/ronin/ui/cli/commands/help.rb b/lib/ronin/ui/cli/commands/help.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/ui/cli/commands/help.rb
+++ b/lib/ronin/ui/cli/commands/help.rb
@@ -56,12 +56,14 @@ module Ronin
#
def execute
if command?
- unless CLI.commands.include?(command)
- print_error "Unknown command: #{command.dump}"
+ name = command.gsub(/^ronin-/,'')
+
+ unless CLI.commands.include?(name)
+ print_error "Unknown command: #{@command.dump}"
exit -1
end
- man_page = "ronin-#{command.tr(':','-')}.1"
+ man_page = "ronin-#{name.tr(':','-')}.1"
Installation.paths.each do |path|
man_path = File.join(path,'man',man_page)
@@ -71,7 +73,7 @@ module Ronin
end
end
- print_error "No man-page for the command: #{@command}"
+ print_error "No man-page for the command: #{@command.dump}"
exit -1
end | Strip any leading "ronin-" prefix for command names. | ronin-ruby_ronin | train | rb |
b17807d11f424f9f93aab996faca8b1107bf1a33 | diff --git a/lib/thinking_sphinx/active_record/sql_builder.rb b/lib/thinking_sphinx/active_record/sql_builder.rb
index <HASH>..<HASH> 100644
--- a/lib/thinking_sphinx/active_record/sql_builder.rb
+++ b/lib/thinking_sphinx/active_record/sql_builder.rb
@@ -116,14 +116,6 @@ module ThinkingSphinx
condition
end
- def presenters_to_group(presenters)
- presenters.collect(&:to_group)
- end
-
- def presenters_to_select(presenters)
- presenters.collect(&:to_select)
- end
-
def groupings
groupings = source.groupings
if model.column_names.include?(model.inheritance_column)
diff --git a/lib/thinking_sphinx/active_record/sql_builder/statement.rb b/lib/thinking_sphinx/active_record/sql_builder/statement.rb
index <HASH>..<HASH> 100644
--- a/lib/thinking_sphinx/active_record/sql_builder/statement.rb
+++ b/lib/thinking_sphinx/active_record/sql_builder/statement.rb
@@ -55,6 +55,14 @@ module ThinkingSphinx
scope_by_order
end
+ def presenters_to_group(presenters)
+ presenters.collect(&:to_group)
+ end
+
+ def presenters_to_select(presenters)
+ presenters.collect(&:to_select)
+ end
+
def scope_by_select
self.scope = scope.select(pre_select + select_clause)
end | presenters_to_* are only needed by the statement.
One less reason for a touch of method_missing magic. | pat_thinking-sphinx | train | rb,rb |
e44919f26ab693f84655d01240797aa234a9fbb7 | diff --git a/app/models/bag_type.rb b/app/models/bag_type.rb
index <HASH>..<HASH> 100644
--- a/app/models/bag_type.rb
+++ b/app/models/bag_type.rb
@@ -1,2 +1,3 @@
class BagType < ActiveRecord::Base
+ validates :description, presence: true
end | Added validation for 'description' for bag type. | airslie_renalware-core | train | rb |
45ea0439277aa7e4004812981d37d1c9a94fd574 | diff --git a/gatt.go b/gatt.go
index <HASH>..<HASH> 100644
--- a/gatt.go
+++ b/gatt.go
@@ -50,7 +50,7 @@ func Stop() error {
if defaultDevice == nil {
return ErrDefaultDevice
}
- return nil
+ return defaultDevice.Stop()
}
// AdvertiseNameAndServices advertises device name, and specified service UUIDs.
diff --git a/linux/device.go b/linux/device.go
index <HASH>..<HASH> 100644
--- a/linux/device.go
+++ b/linux/device.go
@@ -83,7 +83,7 @@ func (d *Device) SetServices(svcs []*ble.Service) error {
// Stop stops gatt server.
func (d *Device) Stop() error {
- return d.HCI.Close()
+ return d.HCI.Stop()
}
// AdvertiseNameAndServices advertises device name, and specified service UUIDs. | Fix Stop() call of device
Stop did nothing before, now it call the Stop() of the hci device | currantlabs_ble | train | go,go |
ea8ffd8b6a90de761653fcf41c1196e83887b5bd | diff --git a/src/ol/geom/multilinestring.js b/src/ol/geom/multilinestring.js
index <HASH>..<HASH> 100644
--- a/src/ol/geom/multilinestring.js
+++ b/src/ol/geom/multilinestring.js
@@ -311,7 +311,7 @@ ol.geom.MultiLineString.prototype.setFlatCoordinates =
* @param {Array.<ol.geom.LineString>} lineStrings LineStrings.
*/
ol.geom.MultiLineString.prototype.setLineStrings = function(lineStrings) {
- var layout = ol.geom.GeometryLayout.XY;
+ var layout = this.getLayout();
var flatCoordinates = [];
var ends = [];
var i, ii; | Issue #<I>: Prefer current layout as default on MultiLineString.setLineStrings() | openlayers_openlayers | train | js |
89ac300b6e5c4f572e0162fe7c8f543ea8b8ce1e | diff --git a/src/Context/DBManager.php b/src/Context/DBManager.php
index <HASH>..<HASH> 100644
--- a/src/Context/DBManager.php
+++ b/src/Context/DBManager.php
@@ -60,7 +60,7 @@ class DBManager implements Interfaces\DBManagerInterface
if (! $this->connection) {
list($dns, $username, $password) = $this->getConnectionDetails();
- $this->connection = new PDO($dns, $username, $password);
+ $this->connection = new \PDO($dns, $username, $password);
}
return $this->connection;
diff --git a/tests/Unit/Context/DBManagerTest.php b/tests/Unit/Context/DBManagerTest.php
index <HASH>..<HASH> 100644
--- a/tests/Unit/Context/DBManagerTest.php
+++ b/tests/Unit/Context/DBManagerTest.php
@@ -54,13 +54,6 @@ class DBManagerTest extends TestHelper
$this->assertEquals($value, $result);
}
- public function testGetConnection()
- {
- $this->testObject->setConnection(null);
-
- $result = $this->testObject->getConnection();
- }
-
public function testGetPrimaryKeyForTableReturnNothing()
{
$database = 'my_app'; | PDO class cannot be overriden | forceedge01_behat-sql-extension | train | php,php |
ddc863b98a771f8baf2c8e44b2deca6b2b1623f0 | diff --git a/apostrophe.js b/apostrophe.js
index <HASH>..<HASH> 100644
--- a/apostrophe.js
+++ b/apostrophe.js
@@ -5371,7 +5371,7 @@ function Apos() {
if (!_.contains(self.slideshowTypes, item.type)) {
return callback(null);
}
- if (!item.items) {
+ if (item.ids) {
// Already migrated
return callback(null);
} | Use a safer test for whether slideshows have already been migrated | apostrophecms_apostrophe | train | js |
575e27f31ef694b3cb404c7d862524c19a4b7473 | diff --git a/calendar/lib.php b/calendar/lib.php
index <HASH>..<HASH> 100644
--- a/calendar/lib.php
+++ b/calendar/lib.php
@@ -2953,11 +2953,12 @@ function calendar_add_icalendar_event($event, $courseid, $subscriptionid, $timez
$description = '';
} else {
$description = $event->properties['DESCRIPTION'][0]->value;
+ $description = clean_param($description, PARAM_NOTAGS);
$description = str_replace('\n', '<br />', $description);
$description = str_replace('\\', '', $description);
$description = preg_replace('/\s+/', ' ', $description);
}
- $eventrecord->description = clean_param($description, PARAM_NOTAGS);
+ $eventrecord->description = $description;
// Probably a repeating event with RRULE etc. TODO: skip for now.
if (empty($event->properties['DTSTART'][0]->value)) { | MDL-<I> calendar: Carry over line breaks on imports
Thanks to Matthias Schwabe for the patch suggestion | moodle_moodle | train | php |
460efaed32b6352a53a4cad98f1b1615cec13236 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -61,7 +61,7 @@ YandexBrowser.prototype = {
name: 'Yandex',
DEFAULT_CMD: {
- linux: 'google-yandex', //TODO (rachel.satoyama): fix linux
+ linux: 'yandex-browser',
darwin: '/Applications/Yandex.app/Contents/MacOS/Yandex',
win32: getYandexExe('YandexBrowser')
}, | resolves #2: correct path to linux browser | Fox-n-Rabbit_karma-yandex-launcher | train | js |
dbf31304c99d8b33ee43e0248cd2159a9fdebc12 | diff --git a/lib/project/pro_motion/data_table.rb b/lib/project/pro_motion/data_table.rb
index <HASH>..<HASH> 100644
--- a/lib/project/pro_motion/data_table.rb
+++ b/lib/project/pro_motion/data_table.rb
@@ -58,7 +58,7 @@ module ProMotion
data_with_scope = data_model.send(data_scope)
end
- if data_with_scope.sort_descriptors.empty?
+ if data_with_scope.sort_descriptors.empty
# Try to be smart about how we sort things if a sort descriptor doesn't exist
attributes = data_model.send(:attribute_names)
sort_attribute = nil
@@ -67,7 +67,10 @@ module ProMotion
end
if sort_attribute
- mp "The `#{data_model}` model scope `#{data_scope}` needs a sort descriptor. Add sort_by(:property) to your scope. Currently sorting by :#{sort_attribute}.", force_color: :yellow
+
+ unless data_scope == :all
+ mp "The `#{data_model}` model scope `#{data_scope}` needs a sort descriptor. Add sort_by(:property) to your scope. Currently sorting by :#{sort_attribute}.", force_color: :yellow
+ end
data_model.send(data_scope).sort_by(sort_attribute)
else
# This is where the application says goodbye and dies in a fiery crash. | Removed warning on :all scope in DataTable | infinitered_redpotion | train | rb |
b1551325e04bd39c7791d1f7673946ba8fd2c8ee | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -200,7 +200,7 @@ def get_extension_modules():
setup(name = 'turbodbc',
- version = '2.4.1',
+ version = '2.5.0',
description = 'turbodbc is a Python DB API 2.0 compatible ODBC driver',
include_package_data = True,
url = 'https://github.com/blue-yonder/turbodbc', | Bumped version number to <I> | blue-yonder_turbodbc | train | py |
3762ecd1d5d16d91d2976ef2dbdcea86fb5f0dba | diff --git a/gridsome/app/components/Link.js b/gridsome/app/components/Link.js
index <HASH>..<HASH> 100644
--- a/gridsome/app/components/Link.js
+++ b/gridsome/app/components/Link.js
@@ -69,6 +69,7 @@ export default {
attrs,
directives,
domProps: {
+ ...data.domProps,
__gLink__: true
}
}, children) | fix(g-link): add support for v-html (#<I>) | gridsome_gridsome | train | js |
820e2fcc3965af32c893301f1c896e59b7f619d5 | diff --git a/personalcapital/personalcapital.py b/personalcapital/personalcapital.py
index <HASH>..<HASH> 100644
--- a/personalcapital/personalcapital.py
+++ b/personalcapital/personalcapital.py
@@ -44,19 +44,19 @@ class PersonalCapital(object):
raise Exception()
def authenticate_password(self, password):
- self.__authenticate_password(password)
+ return self.__authenticate_password(password)
def two_factor_authenticate(self, mode, code):
if mode == TwoFactorVerificationModeEnum.SMS:
- self.__authenticate_sms(code)
+ return self.__authenticate_sms(code)
elif mode == TwoFactorVerificationModeEnum.EMAIL:
- self.__authenticate_email(code)
+ return self.__authenticate_email(code)
def two_factor_challenge(self, mode):
if mode == TwoFactorVerificationModeEnum.SMS:
- self.__challenge_sms()
+ return self.__challenge_sms()
elif mode == TwoFactorVerificationModeEnum.EMAIL:
- self.__challenge_email()
+ return self.__challenge_email()
def fetch(self, endpoint, data = None):
""" | Return request responses from auth methods for debugging | haochi_personalcapital | train | py |
e38a1501c98f774fd32500450e0e6eda7c317ae0 | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -40,11 +40,7 @@ RSpec.configure do |config|
FakeWeb.allow_net_connect = true
FakeWeb.clean_registry
- VCR::HttpStubbingAdapters::Faraday.reset!
- VCR::HttpStubbingAdapters::Excon.reset!
- VCR::HttpStubbingAdapters::WebMock.reset!
- VCR::HttpStubbingAdapters::FakeWeb.reset!
- VCR::HttpStubbingAdapters::Typhoeus.reset!
+ VCR::HttpStubbingAdapters::Common.adapters.each(&:reset!)
end
config.after(:each) do | Cleanup how we reset the stubbing adapters for the specs. | vcr_vcr | train | rb |
c4eeb30137ac0192a499e32ad0aff40d9399b68c | diff --git a/lib/moodlelib.php b/lib/moodlelib.php
index <HASH>..<HASH> 100644
--- a/lib/moodlelib.php
+++ b/lib/moodlelib.php
@@ -3777,7 +3777,7 @@ function reset_password_and_mail($user) {
$a->sitename = $site->fullname;
$a->username = $user->username;
$a->newpassword = $newpassword;
- $a->link = $CFG->wwwroot .'/login/change_password.php';
+ $a->link = $CFG->httpswwwroot .'/login/change_password.php';
$a->signoff = fullname($from, true).' ('. $from->email .')';
$message = get_string('newpasswordtext', '', $a);
@@ -3840,7 +3840,7 @@ function send_password_change_confirmation_email($user) {
$data->firstname = $user->firstname;
$data->sitename = $site->fullname;
- $data->link = $CFG->wwwroot .'/login/forgot_password.php?p='. $user->secret .'&s='. $user->username;
+ $data->link = $CFG->httpswwwroot .'/login/forgot_password.php?p='. $user->secret .'&s='. $user->username;
$data->admin = fullname($from).' ('. $from->email .')';
$message = get_string('emailpasswordconfirmation', '', $data); | Added HTTPSPAGEREQUIRED support to some mail functions.
Merged from MOODLE_<I>_STABLE | moodle_moodle | train | php |
9cf2f636e19af661237b89ecff4745c03464f952 | diff --git a/src/pikepdf/objects.py b/src/pikepdf/objects.py
index <HASH>..<HASH> 100644
--- a/src/pikepdf/objects.py
+++ b/src/pikepdf/objects.py
@@ -25,6 +25,14 @@ from . import _qpdf
from ._qpdf import Object, ObjectType, Operator
+# By default pikepdf.Object will identify itself as pikepdf._qpdf.Object
+# Here we change the module to discourage people from using that internal name
+# Instead it will become pikepdf.objects.Object
+Object.__module__ = __name__
+ObjectType.__module__ = __name__
+Operator.__module__ = __name__
+
+
# type(Object) is the metaclass that pybind11 defines; we wish to extend that
class _ObjectMeta(type(Object)):
"""Supports instance checking""" | Suppress 'pikepdf._qpdf' strings when exploring some objects | pikepdf_pikepdf | train | py |
ac00f32e0d9d6bad8ebd6b36f75b00b2f3a5f78d | diff --git a/test/support/helper.js b/test/support/helper.js
index <HASH>..<HASH> 100644
--- a/test/support/helper.js
+++ b/test/support/helper.js
@@ -82,10 +82,12 @@ exports.compareToFile = function(value, originalFile, resultFile) {
exports.parseXML = function(xml, callback) {
var parser = sax.parser(true);
+ var i = 0;
var tree = [ {} ];
parser.onopentag = function(node) {
if (!(node.name in tree[0])) tree[0][node.name] = [];
+ node.attributes.__order__ = i++;
tree[0][node.name].push(node.attributes);
tree.unshift(node.attributes);
}; | Cheap addition of node order. Fixes #<I> | mapbox_carto | train | js |
f315c94e8c258d2288250ff7f65393350c70d558 | diff --git a/app/controllers/api/activation_keys_controller.rb b/app/controllers/api/activation_keys_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/api/activation_keys_controller.rb
+++ b/app/controllers/api/activation_keys_controller.rb
@@ -89,7 +89,10 @@ class Api::ActivationKeysController < Api::ApiController
param :environment_id, :identifier, :allow_nil => true
end
def update
- @activation_key.update_attributes!(params[:activation_key])
+ attrs = params[:activation_key].clone
+ attrs[:content_view_id] = nil if attrs.try(:[], :content_view_id) == false
+ @activation_key.update_attributes!(attrs)
+
render :json => ActivationKey.find(@activation_key.id)
end | <I> - Created a way to remove views from keys | Katello_katello | train | rb |
01038c897b0ab3c95924f524a7c1093f5951d8f7 | diff --git a/src/Element/BoxSizer.php b/src/Element/BoxSizer.php
index <HASH>..<HASH> 100644
--- a/src/Element/BoxSizer.php
+++ b/src/Element/BoxSizer.php
@@ -40,29 +40,14 @@ class BoxSizer implements ElementInterface
{
switch ($key) {
case 'orientation':
- $this->attributes[$key] = $this->assert(
- $value == 'horizontal',
- wxHORIZONTAL,
+ $this->attributes[$key] =
+ $value == 'horizontal' ?
+ wxHORIZONTAL :
wxVERTICAL
- );
+ ;
default:
$this->attributes[$key] = $value;
break;
}
}
-
- /**
- * Assert a value/expression is true
- *
- * @param boolean $assertion
- * @param boolean $true
- * @param boolean $false
- * @return boolean
- */
- protected function assert($assertion, $true = true, $false = false)
- {
- if ($assertion) return $true;
-
- return $false;
- }
}
\ No newline at end of file | Remove pointless assert method. Closes #6 | encorephp_wxwidgets | train | php |
6e81f764f6d8c40820032cd3cc3f0c88959d8769 | diff --git a/lib/solargraph/api_map.rb b/lib/solargraph/api_map.rb
index <HASH>..<HASH> 100755
--- a/lib/solargraph/api_map.rb
+++ b/lib/solargraph/api_map.rb
@@ -340,11 +340,10 @@ module Solargraph
# @param scope [Symbol] :instance or :class
# @return [Array<Solargraph::Pin::Base>]
def get_method_stack fqns, name, scope: :instance
- # @todo Caches don't work on this query
- # cached = cache.get_method_stack(fqns, name, scope)
- # return cached.clone unless cached.nil?
+ cached = cache.get_method_stack(fqns, name, scope)
+ return cached unless cached.nil?
result = get_methods(fqns, scope: scope, visibility: [:private, :protected, :public]).select{|p| p.name == name}
- # cache.set_method_stack(fqns, name, scope, result)
+ cache.set_method_stack(fqns, name, scope, result)
result
end | ApiMap caches method stacks. | castwide_solargraph | train | rb |
eddf3f75271a51bf4a0f9416209efe6c68e60eb9 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -65,7 +65,7 @@ def is_requirement(line):
README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
-VERSION = '2.1.2'
+VERSION = '2.1.3'
if sys.argv[-1] == 'tag':
print("Tagging the version on github:") | chore: Bump patch version number to <I> after requirements upgrade. | edx_xblock-utils | train | py |
15ad8c4c0a5decd799d4228036659b02e257bc4d | diff --git a/library/src/test/java/com/evernote/android/job/DailyJobTest.java b/library/src/test/java/com/evernote/android/job/DailyJobTest.java
index <HASH>..<HASH> 100644
--- a/library/src/test/java/com/evernote/android/job/DailyJobTest.java
+++ b/library/src/test/java/com/evernote/android/job/DailyJobTest.java
@@ -143,4 +143,15 @@ public class DailyJobTest extends BaseJobManagerTest {
assertThat(request.getExtras().getLong(DailyJob.EXTRA_END_MS, -1)).isEqualTo(1L);
assertThat(request.getExtras().size()).isEqualTo(3);
}
+
+ @Test
+ public void verifyDailyJobIsNotExact() {
+ long time = 1L;
+
+ int jobId = DailyJob.schedule(DummyJobs.createBuilder(DummyJobs.SuccessJob.class), time, time);
+ JobRequest request = manager().getJobRequest(jobId);
+
+ assertThat(request).isNotNull();
+ assertThat(request.isExact()).isFalse();
+ }
} | Add a test that verifies that daily jobs aren't exact | evernote_android-job | train | java |
0e5a909fca0535989321179d1350104ac57ebdc7 | diff --git a/wrappers/java/src/main/java/org/hyperledger/indy/sdk/pool/Pool.java b/wrappers/java/src/main/java/org/hyperledger/indy/sdk/pool/Pool.java
index <HASH>..<HASH> 100644
--- a/wrappers/java/src/main/java/org/hyperledger/indy/sdk/pool/Pool.java
+++ b/wrappers/java/src/main/java/org/hyperledger/indy/sdk/pool/Pool.java
@@ -141,7 +141,7 @@ public class Pool extends SovrinJava.API {
}
};
- int result = LibSovrin.api.sovrin_refresh_pool_ledger(
+ int result = LibSovrin.api.sovrin_close_pool_ledger(
FIXED_COMMAND_HANDLE,
handle,
callback); | Pool.closePoolLedger method did not use correct C-callable sdk function. | hyperledger_indy-sdk | train | java |
f9183adfe24c3f1d87f3c5ce0008afc3e7de3a7e | diff --git a/opal/clearwater/application.rb b/opal/clearwater/application.rb
index <HASH>..<HASH> 100644
--- a/opal/clearwater/application.rb
+++ b/opal/clearwater/application.rb
@@ -24,6 +24,12 @@ module Clearwater
router.application = self
component.router = router if component
+ if `#@component.type === 'Thunk' && typeof #@component.render === 'function'`
+ warn "Application root component (#{@component}) points to a cached " +
+ "component. Cached components must not be persistent components, " +
+ "such as application roots or routing targets."
+ end
+
@document.on 'visibilitychange' do
if @render_on_visibility_change
@render_on_visibility_change = false
diff --git a/opal/clearwater/router/route.rb b/opal/clearwater/router/route.rb
index <HASH>..<HASH> 100644
--- a/opal/clearwater/router/route.rb
+++ b/opal/clearwater/router/route.rb
@@ -9,6 +9,12 @@ module Clearwater
@key = options.fetch(:key)
@target = options.fetch(:target)
@parent = options.fetch(:parent)
+
+ if `#@target.type === 'Thunk' && typeof #@target.render === 'function'`
+ warn "Route '#{key}' points to a cached component. Cached " +
+ "components must not be persistent components, such as " +
+ "application roots or routing targets."
+ end
end
def route *args, &block | Warn when trying to cache persistent components | clearwater-rb_clearwater | train | rb,rb |
e5be7dd17ac514c66eacc8f09a2d3d73ba578879 | diff --git a/jsonapi/models.py b/jsonapi/models.py
index <HASH>..<HASH> 100644
--- a/jsonapi/models.py
+++ b/jsonapi/models.py
@@ -1 +0,0 @@
-# lint_ignore=C0110 | move lint options to pylama.ini from files | pavlov99_jsonapi | train | py |
5a4ca37a52371d62ca524a2274f4ae1f4115a55f | diff --git a/lib/podio/models/file_attachment.rb b/lib/podio/models/file_attachment.rb
index <HASH>..<HASH> 100644
--- a/lib/podio/models/file_attachment.rb
+++ b/lib/podio/models/file_attachment.rb
@@ -36,6 +36,10 @@ class Podio::FileAttachment < ActivePodio::Base
'file'
end
+ def raw_data
+ Podio.connection.get(self.link).body
+ end
+
class << self
# Accepts an open file stream along with a file name and uploads the file to Podio
# @see https://developers.podio.com/doc/files/upload-file-1004361 | Add method for getting raw file data from a file object | podio_podio-rb | train | rb |
1f358d94eb99227304dfcd8cf8eaa8f4d63596b9 | diff --git a/leaflet-search.js b/leaflet-search.js
index <HASH>..<HASH> 100644
--- a/leaflet-search.js
+++ b/leaflet-search.js
@@ -499,6 +499,13 @@ L.Control.Search = L.Control.extend({
if ((sel = this._input.selection) && sel.empty) {
sel.empty();
}
+ else if (sel = this._input.createTextRange()) {
+ sel.collapse(true);
+ var end = this._input.value.length;
+ sel.moveStart('character', end);
+ sel.moveEnd('character', end);
+ sel.select();
+ }
else {
if (this._input.getSelection) {
this._input.getSelection().removeAllRanges(); | Deselecting of text in hideAutoType now works in IE8. | stefanocudini_leaflet-search | train | js |
5213a00a3a397347f2063ef6751861f31ed9b7a2 | diff --git a/PHPCI/Model/Build/GithubBuild.php b/PHPCI/Model/Build/GithubBuild.php
index <HASH>..<HASH> 100644
--- a/PHPCI/Model/Build/GithubBuild.php
+++ b/PHPCI/Model/Build/GithubBuild.php
@@ -78,6 +78,7 @@ class GithubBuild extends RemoteGitBuild
$http->setHeaders($headers);
$res = $http->request('POST', $url, json_encode($params));
+ var_dump($res);
} | Adding some github debug stuff | dancryer_PHPCI | train | php |
9387f070e4970d54cd6959d1a0940ecce089e069 | diff --git a/src/Panda/Http/Request.php b/src/Panda/Http/Request.php
index <HASH>..<HASH> 100644
--- a/src/Panda/Http/Request.php
+++ b/src/Panda/Http/Request.php
@@ -34,6 +34,7 @@ class Request extends SymfonyRequest
* information we gan get.
*
* @return Request
+ * @throws \LogicException
*/
public static function capture()
{
@@ -48,6 +49,7 @@ class Request extends SymfonyRequest
* @param SymfonyRequest $request
*
* @return Request
+ * @throws \LogicException
*/
public static function createRequest(SymfonyRequest $request)
{ | Add @throw tags in Request docblocks | PandaPlatform_framework | train | php |
b1eb93b31e5a6745d5881023b695ffd1c98c9d9c | diff --git a/test/integration/features/step_definitions/view-steps.js b/test/integration/features/step_definitions/view-steps.js
index <HASH>..<HASH> 100644
--- a/test/integration/features/step_definitions/view-steps.js
+++ b/test/integration/features/step_definitions/view-steps.js
@@ -246,7 +246,7 @@ this.Then(/^я не увижу элемент "([^"]*)" с текстом "([^"]
actText = element.findAllChildrenByType('Label')[0].getDisplayValue();
}
- if(actText != elementText){
+ if(actText.trim() != elementText){
next();
}else{
next(new Error(elementName + ' was found!'));
@@ -285,7 +285,7 @@ this.Then(/^я увижу элемент "([^"]*)" с текстом "([^"]*)"$/
actText = element.findAllChildrenByType('Label')[0].getDisplayValue();
}
- chai.assert.equal(actText, elementText);
+ chai.assert.equal(actText.trim(), elementText);
next();
}catch(err){
next(err); | add trim function for text into step definition (integration tests) | InfinniPlatform_InfinniUI | train | js |
e9ec56fff117203eab723c0245e75e0f756dc5d3 | diff --git a/compiler/prelude.go b/compiler/prelude.go
index <HASH>..<HASH> 100644
--- a/compiler/prelude.go
+++ b/compiler/prelude.go
@@ -490,6 +490,25 @@ var go$structType = function(fields) {
this[fields[i][0]] = arguments[i];
}
});
+ // collect methods for anonymous fields
+ var i, j;
+ for (i = 0; i < fields.length; i++) {
+ var field = fields[i];
+ if (field[1] === "") {
+ var methods = field[3].methods;
+ for (j = 0; j < methods.length; j++) {
+ var m = methods[j].slice(0, 6).concat([i]);
+ typ.methods.push(m);
+ typ.Ptr.methods.push(m);
+ }
+ if (field[3].kind === "Struct") {
+ var methods = field[3].Ptr.methods;
+ for (j = 0; j < methods.length; j++) {
+ typ.Ptr.methods.push(methods[j].slice(0, 6).concat([i]));
+ }
+ }
+ }
+ }
typ.init(fields);
go$structTypes[string] = typ;
} | collect methods for anonymous fields of anonymous structs | gopherjs_gopherjs | train | go |
8cfbdcfcd4173b77ac8434e8c1cb984926f4fc49 | diff --git a/helpers/ha.py b/helpers/ha.py
index <HASH>..<HASH> 100644
--- a/helpers/ha.py
+++ b/helpers/ha.py
@@ -74,7 +74,7 @@ class Ha:
self.state_handler.follow_the_leader(self.fetch_current_leader())
return "no action. i am a secondary and i am following a leader"
else:
- if not self.state_handler.is_running():
+ if not self.state_handler.is_running(): # XXX is_running == is_healthy
self.state_handler.start()
return "postgresql was stopped. starting again."
return "no action. not healthy enough to do anything." | Track list of already existing physical replication slots
Drop replication slot when it was removed from etcd.
Execute pg_create_physical_replication_slot only when something new appeared in etcd. | zalando_patroni | train | py |
a2875b2cd8fc4aafdce1e16901e09d89b77df590 | diff --git a/src/components/App.js b/src/components/App.js
index <HASH>..<HASH> 100644
--- a/src/components/App.js
+++ b/src/components/App.js
@@ -40,7 +40,11 @@ const SelectAnimation = ({ value, onAnimate }) => (
justifyContent: "center"
})}
>
- <select onChange={onAnimate} value={value} {...css({ marginRight: "10" })}>
+ <select
+ value={value}
+ onChange={onAnimate}
+ {...css({ width: "100", height: "25" })}
+ >
{Object.keys(animations).map(a => (
<option key={`animation-${a}`}>{a}</option>
))} | refactor the style of the <select> component | cyan33_react-animation-wrapper | train | js |
f8e8044ed42626d0e06ea8c6075c1d743d2180c7 | diff --git a/src/Database/Dialect/SqlserverDialectTrait.php b/src/Database/Dialect/SqlserverDialectTrait.php
index <HASH>..<HASH> 100644
--- a/src/Database/Dialect/SqlserverDialectTrait.php
+++ b/src/Database/Dialect/SqlserverDialectTrait.php
@@ -99,9 +99,9 @@ trait SqlserverDialectTrait
protected function _pagingSubquery($original, $limit, $offset)
{
$field = '_cake_paging_._cake_page_rownum_';
+ $order = $original->clause('order') ?: new OrderByExpression('(SELECT NULL)');
$query = clone $original;
- $order = $query->clause('order') ?: new OrderByExpression('NULL');
$query->select([
'_cake_page_rownum_' => new UnaryExpression('ROW_NUMBER() OVER', $order)
])->limit(null) | Fix incorrect default order by clause.
Instead of NULL, the ORDER BY for SQLServer needs to be a select
statement. For compatibility with SQLServer<I> this statement needs to
be wrapped in parentheses as well.
No new tests were added as a number of tests are currently failing, but
we didn't know because AppVeyor is failing due to incorrect dependencies
being installed.
Refs #<I> | cakephp_cakephp | train | php |
d15cb0718248818ea7179055e61c1aad05ddce31 | diff --git a/fabric-client/events/consumer/consumer.go b/fabric-client/events/consumer/consumer.go
index <HASH>..<HASH> 100644
--- a/fabric-client/events/consumer/consumer.go
+++ b/fabric-client/events/consumer/consumer.go
@@ -240,7 +240,7 @@ func (ec *eventsClient) Start() error {
serverClient := ehpb.NewEventsClient(conn)
ec.stream, err = serverClient.Chat(context.Background())
if err != nil {
- return fmt.Errorf("Could not create client conn to %s", ec.peerAddress)
+ return fmt.Errorf("Could not create client conn to %s (%v)", ec.peerAddress, err)
}
if err = ec.register(ies); err != nil { | [FAB-<I>]return detailed event hub connection error
suggest we return more detailed connection error message when
connecting with event hub
Change-Id: I0d7c<I>f<I>bf9a8fc<I>ea<I>e<I>e<I> | hyperledger_fabric-sdk-go | train | go |
85412f78cf73f84e826d2b9772e47ad05a01e5ac | diff --git a/wkhtmltopdf/utils.py b/wkhtmltopdf/utils.py
index <HASH>..<HASH> 100644
--- a/wkhtmltopdf/utils.py
+++ b/wkhtmltopdf/utils.py
@@ -297,13 +297,14 @@ def make_absolute_paths(content):
if not x['root'].endswith('/'):
x['root'] += '/'
- occur_pattern = '''["|']({0}.*?)["|']'''
+ occur_pattern = '''(["|']{0}.*?["|'])'''
occurences = re.findall(occur_pattern.format(x['url']), content)
occurences = list(set(occurences)) # Remove dups
for occur in occurences:
- content = content.replace(occur,
+ content = content.replace(occur, '"%s"' % (
pathname2fileurl(x['root']) +
- occur[len(x['url']):])
+ occur[1 + len(x['url']): -1]))
+
return content | capture quotes in URL rewrite regular expression, fixes #<I> | incuna_django-wkhtmltopdf | train | py |
f177aa4316efb8b9383fc8ead303786745590421 | diff --git a/openquake/commands/compare.py b/openquake/commands/compare.py
index <HASH>..<HASH> 100644
--- a/openquake/commands/compare.py
+++ b/openquake/commands/compare.py
@@ -112,10 +112,10 @@ class Comparator(object):
what += '?imt=' + imt
aw = extractor.get(what)
arrays = numpy.zeros((len(self.extractors), len(sids), 1))
- arrays[0] = getattr(aw, imt)[sids]
+ arrays[0, :, 0] = getattr(aw, imt)[sids]
extractor.close()
for e, extractor in enumerate(self.extractors[1:], 1):
- arrays[e] = getattr(extractor.get(what), imt)[sids]
+ arrays[e, :, 0] = getattr(extractor.get(what), imt)[sids]
extractor.close()
return arrays # shape (C, N, 1) | Fixed compare avg_gmf [ci skip] | gem_oq-engine | train | py |
a71743bf45edda2d7b6290b66c2b0ed2e96c6e56 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -7,8 +7,8 @@ setup(
name='proso-apps',
version=version,
description='General library for applications in PROSO projects',
- author='Jan Papousek',
- author_email='[email protected]',
+ author='Jan Papousek, Vit Stanislav',
+ author_email='[email protected], [email protected]',
namespace_packages = ['proso', 'proso.django'],
include_package_data = True,
packages=[
@@ -31,6 +31,7 @@ setup(
install_requires=[
'Django>=1.6,<1.7',
'django-debug-toolbar>=1.1',
+ 'django-flatblocks>=0.8',
'django-ipware>=0.0.8',
'django-lazysignup>=0.12.2',
'django-social-auth>=0.7.28', | update setup.py according to proso_client | adaptive-learning_proso-apps | train | py |
f6466f940bef4404b5309b7ab10cb39a65a8c274 | diff --git a/DynamicActiveQuery.php b/DynamicActiveQuery.php
index <HASH>..<HASH> 100644
--- a/DynamicActiveQuery.php
+++ b/DynamicActiveQuery.php
@@ -130,7 +130,7 @@ class DynamicActiveQuery extends \yii\db\ActiveQuery
$type
= "binary$l|char$l|date|datetime$l|decimal$l|double$l|int(eger)?"
. "|signed(?: inte(eger)?)?|time$l|unsigned(?: inte(eger)?)?";
- $pattern = "{ < ($start $cont* (?: \\. $cont+)*) (?: \\| ($type))? > }ux";
+ $pattern = "{ \\{ ($start $cont* (?: \\. $cont+)*) (?: \\| ($type))? \\} }ux";
$i = 0;
$sql = preg_replace_callback($pattern, $callback, $sql); | changed dyn-col syntax for better sql compat | tom--_yii2-dynamic-ar | train | php |
8bc6f5e19764516c1e997578ea04b08e77d182df | diff --git a/includes/session.php b/includes/session.php
index <HASH>..<HASH> 100644
--- a/includes/session.php
+++ b/includes/session.php
@@ -470,6 +470,8 @@ if (!defined('WT_THEME_DIR')) {
if (!$THEME_DIR && isset($_SESSION['theme_dir']) && in_array($_SESSION['theme_dir'], get_theme_names())) {
$THEME_DIR=$_SESSION['theme_dir'];
}
+ } else {
+ $THEME_DIR='';
}
if (!$THEME_DIR) {
// User cannot choose (or has not chosen) a theme. | Fix undefined $THEME_DIR where not $ALLOW_USER_THEMES | fisharebest_webtrees | train | php |
a6a5870a5036b9897b9e3fb4d0df2a6ddfff3ec8 | diff --git a/app/controllers/alchemy/admin/dashboard_controller.rb b/app/controllers/alchemy/admin/dashboard_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/alchemy/admin/dashboard_controller.rb
+++ b/app/controllers/alchemy/admin/dashboard_controller.rb
@@ -42,7 +42,6 @@ module Alchemy
# Get alchemy versions from rubygems or github, if rubygems failes.
def get_alchemy_versions
# first we try rubygems.org
- logger.info "\nquery rubygems\n"
response = query_rubygems
if response.code == "200"
alchemy_versions = JSON.parse(response.body)
@@ -50,7 +49,6 @@ module Alchemy
else
# rubygems.org not available?
# then we try github
- logger.info "\nquery github\n"
response = query_github
if response.code == "200"
alchemy_tags = JSON.parse(response.body) | Removes logging from update checker. | AlchemyCMS_alchemy_cms | train | rb |
ed4f69689385308196f0867efce31863bd3932ab | diff --git a/src/jwplayer.hlsjs.js b/src/jwplayer.hlsjs.js
index <HASH>..<HASH> 100644
--- a/src/jwplayer.hlsjs.js
+++ b/src/jwplayer.hlsjs.js
@@ -468,6 +468,8 @@ function HlsProv(id){
// XXX pavelki: hack to remove pending segments
delete hls.bufferController.segments;
this.attached = false;
+ // XXX yurij: remove when detachMedia->bufferring issue fixed
+ this.setState('paused');
return video;
};
this.setState = function(state){ | revert of zeetv/resume_waiting_ms fix due to invalid stats issue | hola_jwplayer-hlsjs | train | js |
5c237a3dafa8f2fa6079d3bf493fc249b50d9a3f | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -46,14 +46,14 @@ class setup_tests_runner(command):
setup(
name='pyclustering',
packages=find_packages(),
- version='0.9.3.1',
+ version='0.10.0',
description='pyclustring is a python data mining library',
long_description=load_readme(),
url='https://github.com/annoviko/pyclustering',
project_urls={
'Homepage': 'https://pyclustering.github.io/',
'Repository': 'https://github.com/annoviko/pyclustering',
- 'Documentation': 'https://pyclustering.github.io/docs/0.9.3/html/index.html',
+ 'Documentation': 'https://pyclustering.github.io/docs/0.10.0/html/index.html',
'Bug Tracker': 'https://github.com/annoviko/pyclustering/issues'
},
license='GNU Public License', | [.][Release] Update version <I>. | annoviko_pyclustering | train | py |
1cfbbd3a693308658043455479892019e97490e3 | diff --git a/salt/ssh/__init__.py b/salt/ssh/__init__.py
index <HASH>..<HASH> 100644
--- a/salt/ssh/__init__.py
+++ b/salt/ssh/__init__.py
@@ -180,7 +180,12 @@ class Single(multiprocessing.Process):
ret = self.shell.exec_cmd(cmd)
if ret.startswith('deploy'):
self.deploy()
- return json.loads(self.cmd(self.arg_str))
+ return json.loads(
+ # XXX: Remove the next pylint declaration when pylint 0.29
+ # comes out. More information:
+ # http://hustoknow.blogspot.pt/2013/06/pylint.html
+ self.cmd(self.arg_str) # pylint: disable=E1121
+ )
try:
data = json.loads(ret)
return {self.id: data['local']} | Work around pylint bug of wrongly reporting too many arguments.
More info on <URL> | saltstack_salt | train | py |
a6a0f675f44825976facd402030c6b45d66f9310 | diff --git a/lib/flipper/adapters/dalli.rb b/lib/flipper/adapters/dalli.rb
index <HASH>..<HASH> 100644
--- a/lib/flipper/adapters/dalli.rb
+++ b/lib/flipper/adapters/dalli.rb
@@ -92,7 +92,7 @@ module Flipper
private
def key_for(feature)
- feature
+ feature.to_s
end
end
end | Get explicit about key used for dalli
Deep in dalli, it was doing feature.to_s so now we just do this in flipper in case dalli ever stops doing that. | jnunemaker_flipper | train | rb |
17a6bc74d558467c626b3369a21a70015c38502f | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -61,9 +61,14 @@ module.exports = function hook (modules, options, onrequire) {
}
}
- if (hook.cache[filename]) return exports // abort if module have already been processed
- hook.cache[filename] = exports
+ // only call onrequire the first time a module is loaded
+ if (!hook.cache.hasOwnProperty(filename)) {
+ // ensure that the cache entry is assigned a value before calling
+ // onrequire, in case calling onrequire requires the same module.
+ hook.cache[filename] = exports
+ hook.cache[filename] = onrequire(exports, name, basedir)
+ }
- return onrequire(exports, name, basedir)
+ return hook.cache[filename]
}
}
diff --git a/test/test.js b/test/test.js
index <HASH>..<HASH> 100644
--- a/test/test.js
+++ b/test/test.js
@@ -93,6 +93,19 @@ test('cache', function (t) {
t.end()
})
+test('replacement value', function (t) {
+ var replacement = {}
+
+ hook(['url'], function (exports, name, basedir) {
+ return replacement
+ })
+
+ t.deepEqual(require('url'), replacement)
+ t.deepEqual(require('url'), replacement)
+
+ t.end()
+})
+
test('circular', function (t) {
t.plan(2) | Make cache value replaceable (#2) | elastic_require-in-the-middle | train | js,js |
becf1153403db51b36633689a30b55dd9a34c8ad | diff --git a/tests/test_templatetags.py b/tests/test_templatetags.py
index <HASH>..<HASH> 100644
--- a/tests/test_templatetags.py
+++ b/tests/test_templatetags.py
@@ -10,6 +10,7 @@ Tests for `django-sheets` models module.
import os
import httpretty
+from io import open
from django import template
from django.test import SimpleTestCase | use io.open in tests for py<I> compat | georgewhewell_django-sheets | train | py |
d4695fa6449359ea5228b55aee991b72a104f142 | diff --git a/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/SortClauseHandler.php b/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/SortClauseHandler.php
index <HASH>..<HASH> 100644
--- a/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/SortClauseHandler.php
+++ b/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/SortClauseHandler.php
@@ -65,7 +65,9 @@ abstract class SortClauseHandler
* @param int $number
* @return void
*/
- abstract public function applyJoin( ezcQuerySelect $query, SortClause $sortClause, $number );
+ public function applyJoin( ezcQuerySelect $query, SortClause $sortClause, $number )
+ {
+ }
/**
* Returns the quoted sort column name | Changed: unabstracting applyJoin() by default: no additional join | ezsystems_ezpublish-kernel | train | php |
493e5c693f360b377fe3f3d646c3ae5fea442840 | diff --git a/src/Strava/API/Service/REST.php b/src/Strava/API/Service/REST.php
index <HASH>..<HASH> 100644
--- a/src/Strava/API/Service/REST.php
+++ b/src/Strava/API/Service/REST.php
@@ -64,7 +64,6 @@ class REST implements ServiceInterface
{
// Workaround for export methods getRouteAsGPX, getRouteAsTCX:
if (is_string($response)) {
- // @phpstan-ignore-next-line
return $response;
} | fix phpstan errors caused by type hint changes | basvandorst_StravaPHP | train | php |
7bb90a7d3cb009cde70ae979c1cdfb8e55550385 | diff --git a/src/android/AudioInputReceiver.java b/src/android/AudioInputReceiver.java
index <HASH>..<HASH> 100644
--- a/src/android/AudioInputReceiver.java
+++ b/src/android/AudioInputReceiver.java
@@ -141,6 +141,7 @@ public class AudioInputReceiver extends Thread {
int numReadBytes = 0;
byte audioBuffer[] = new byte[readBufferSize];
synchronized(this) {
+ URI finalUrl = fileUrl; // even if the member changes, we use what we were originally given
recorder.startRecording();
try
@@ -165,7 +166,7 @@ public class AudioInputReceiver extends Thread {
}
} // loop
os.close();
- File wav = new File(fileUrl);
+ File wav = new File(finalUrl);
addWavHeader(audioFile, wav);
audioFile.delete();
message = handler.obtainMessage();
@@ -189,7 +190,7 @@ public class AudioInputReceiver extends Thread {
recorder.release();
recorder = null;
- }
+ } // syncrhonized
} // recording to fileUrl
} | Android: Ensure the file URL used for recording is the URL given by the event when recording finishes. | edimuj_cordova-plugin-audioinput | train | java |
3d1b6c1035f006292a8631c5423c44089da9ad03 | diff --git a/tools/run_tests/python_utils/jobset.py b/tools/run_tests/python_utils/jobset.py
index <HASH>..<HASH> 100755
--- a/tools/run_tests/python_utils/jobset.py
+++ b/tools/run_tests/python_utils/jobset.py
@@ -302,6 +302,7 @@ class Job(object):
self._retries += 1
self.result.num_failures += 1
self.result.retries = self._timeout_retries + self._retries
+ # NOTE: job is restarted regardless of jobset's max_time setting
self.start()
else:
self._state = _FAILURE
@@ -344,6 +345,7 @@ class Job(object):
if self._spec.kill_handler:
self._spec.kill_handler(self)
self._process.terminate()
+ # NOTE: job is restarted regardless of jobset's max_time setting
self.start()
else:
message('TIMEOUT', '%s [pid=%d, time=%.1fsec]' % (self._spec.shortname, self._process.pid, elapsed), stdout(), do_newline=True) | explain retries and jobset.max_time setting | grpc_grpc | train | py |
9cf81077c62154e08640d17a9ee63eb64d7b6be7 | diff --git a/fastai/vision/widgets.py b/fastai/vision/widgets.py
index <HASH>..<HASH> 100644
--- a/fastai/vision/widgets.py
+++ b/fastai/vision/widgets.py
@@ -37,7 +37,7 @@ def _update_children(
# Cell
def carousel(
- children:(list,tuple)=(), # `Box` objects to display in a carousel
+ children:tuple=(), # `Box` objects to display in a carousel
**layout
) -> Box: # An `ipywidget`'s carousel
"A horizontally scrolling carousel" | Update fastai/vision/widgets.py
Updated carusel function docment | fastai_fastai | train | py |
7f0f73a793444195cf8d873258fec3cafb70eec8 | diff --git a/proto/qan/qan.go b/proto/qan/qan.go
index <HASH>..<HASH> 100644
--- a/proto/qan/qan.go
+++ b/proto/qan/qan.go
@@ -63,6 +63,7 @@ type QueryLog struct {
Start_ts time.Time
Query_count float32
Query_time_sum float32
+ Query_time_avg float32
}
type QueryRank struct { | Added Query_time_avg to extand sparkline | percona_pmm | train | go |
bd768ad8e03e999c3f169f346321824726300fc0 | diff --git a/common/config/main.php b/common/config/main.php
index <HASH>..<HASH> 100644
--- a/common/config/main.php
+++ b/common/config/main.php
@@ -1,7 +1,7 @@
<?php
$config = [
'name' => 'Feehi CMS',
- 'version' => '0.1.2',
+ 'version' => '0.1.3',
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
'aliases' => [
'@bower' => '@vendor/bower-asset', | udpate version to <I> | liufee_cms-core | train | php |
fb4ee9c7e5da783d84d3a633297830ceac58ee48 | diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -890,7 +890,7 @@ module ActiveRecord #:nodoc:
end
def find_sti_class(type_name)
- if type_name.blank? || !columns_hash.include?(inheritance_column)
+ if type_name.nil? || !columns_hash.include?(inheritance_column)
self
else
begin | type_name is never a blank string, so use faster .nil? call | rails_rails | train | rb |
Subsets and Splits