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 |
|---|---|---|---|---|---|
163c0c2385da9766bf35350e116c7b55d738bc28 | diff --git a/theme/standardxhtml/docstyles.php b/theme/standardxhtml/docstyles.php
index <HASH>..<HASH> 100644
--- a/theme/standardxhtml/docstyles.php
+++ b/theme/standardxhtml/docstyles.php
@@ -18,25 +18,29 @@
body {
background-color:#FFFFFF;
}
+p, a {
+ font-size:small;
+}
h1, h2, h3 {
+ padding-left:0px;
background-color:transparent;
color:#000000;
}
h1 {
- font-size: 2em;
- margin: .67em 0;
+ font-size:1.7em;
+ margin:0.5em 0 0;
}
h2 {
- font-size: 1.5em;
- margin: .75em 0;
+ font-size:1.4em;
+ margin:0.5em 0 0;
}
h3 {
- font-size: 1.17em;
- margin: .83em 0;
+ font-size:1.2em;
+ margin:0.5em 0 0;
}
@@ -87,6 +91,7 @@ ul {
border: thin dashed #999999;
background-color: #FBFBFB;
margin: auto;
+ margin-top: 0.5em;
padding: 30px;
height: auto;
width: auto; | Added docstyle.php for the changed german docs.
Within the docs a JS loads the theme CSS if opend within Moodle. Within docstyles.php the standard doc styles can be overwritten. | moodle_moodle | train | php |
bc762e835801e0ade2d2d7af929eb34878cc51f6 | diff --git a/pulsar/daemon.py b/pulsar/daemon.py
index <HASH>..<HASH> 100644
--- a/pulsar/daemon.py
+++ b/pulsar/daemon.py
@@ -80,23 +80,6 @@ def load_pulsar_app(
return pulsar_app
-def __setup_logging(ini_path):
- raw_config = configparser.ConfigParser()
- raw_config.read([ini_path])
- # https://github.com/mozilla-services/chaussette/pull/32/files
- if raw_config.has_section('loggers'):
- config_file = os.path.abspath(ini_path)
- fileConfig(
- config_file,
- dict(__file__=config_file, here=os.path.dirname(config_file))
- )
-
-
-def __app_config(ini_path, app_name):
- config = ConfigLoader(ini_path).app_context(app_name).config()
- return config
-
-
def app_loop(args):
try:
config_builder = PulsarConfigBuilder(args) | Remove seemingly unused code in pulsar.daemon. | galaxyproject_pulsar | train | py |
71c638bc27bc319ffd5a243f2885633395434625 | diff --git a/src/components/Widgets/MarkdownPreview.js b/src/components/Widgets/MarkdownPreview.js
index <HASH>..<HASH> 100644
--- a/src/components/Widgets/MarkdownPreview.js
+++ b/src/components/Widgets/MarkdownPreview.js
@@ -2,6 +2,15 @@ import React, { PropTypes } from 'react';
import { getSyntaxes } from './richText';
import MarkitupReactRenderer from './MarkitupReactRenderer';
+const schema = {
+ 'mediaproxy': ({ token }) => (
+ <img
+ src={token.getIn(['data', 'src'])}
+ alt={token.getIn(['data', 'alt'])}
+ />
+ )
+};
+
const MarkdownPreview = ({ value }) => {
if (value == null) {
return null;
@@ -12,6 +21,7 @@ const MarkdownPreview = ({ value }) => {
<MarkitupReactRenderer
value={value}
syntax={markdown}
+ schema={schema}
/>
);
}; | Integrated MD Preview component with mediaproxy | netlify_netlify-cms | train | js |
ae8a3dd125036d30ae6754978d2b90dba8634c35 | diff --git a/src/Repository/Mapping/PathMappingCollection.php b/src/Repository/Mapping/PathMappingCollection.php
index <HASH>..<HASH> 100644
--- a/src/Repository/Mapping/PathMappingCollection.php
+++ b/src/Repository/Mapping/PathMappingCollection.php
@@ -140,7 +140,7 @@ class PathMappingCollection
*/
public function listByPackageName($packageName)
{
- if ($this->primaryKeysSorted === true) {
+ if ($this->primaryKeysSorted) {
$this->lazySortPrimaryKeys();
}
@@ -170,7 +170,7 @@ class PathMappingCollection
*/
public function getRepositoryPaths()
{
- if ($this->primaryKeysSorted === true) {
+ if ($this->primaryKeysSorted) {
$this->lazySortPrimaryKeys();
}
@@ -185,7 +185,7 @@ class PathMappingCollection
*/
public function toArray()
{
- if ($this->primaryKeysSorted === true) {
+ if ($this->primaryKeysSorted) {
$this->lazySortPrimaryKeys();
} | Use non-explicit tests. | puli_manager | train | php |
6859a7d21516d35df324c5457aa8891f3cdcbb4d | diff --git a/fabric8-forge-rest-client/src/test/java/io/fabric8/forge/rest/client/CreateQuickstartProjectKT.java b/fabric8-forge-rest-client/src/test/java/io/fabric8/forge/rest/client/CreateQuickstartProjectKT.java
index <HASH>..<HASH> 100644
--- a/fabric8-forge-rest-client/src/test/java/io/fabric8/forge/rest/client/CreateQuickstartProjectKT.java
+++ b/fabric8-forge-rest-client/src/test/java/io/fabric8/forge/rest/client/CreateQuickstartProjectKT.java
@@ -110,7 +110,7 @@ public class CreateQuickstartProjectKT extends ForgeTestSupport {
LOG.info("Command names: " + commandNames);
}
- @Test
+ @Ignore
public void testQuickstartArchetypeProject() throws Exception {
String projectName = generateProjectName("qs"); | disable failing test; we can't yet use the archetype wizard in the test hardness | fabric8io_fabric8-forge | train | java |
bf28f2821a1043a1157ee6fa80a2589d4f16bd68 | diff --git a/presto-main/src/main/java/com/facebook/presto/operator/TopNOperator.java b/presto-main/src/main/java/com/facebook/presto/operator/TopNOperator.java
index <HASH>..<HASH> 100644
--- a/presto-main/src/main/java/com/facebook/presto/operator/TopNOperator.java
+++ b/presto-main/src/main/java/com/facebook/presto/operator/TopNOperator.java
@@ -13,6 +13,7 @@
*/
package com.facebook.presto.operator;
+import com.facebook.presto.ExceededMemoryLimitException;
import com.facebook.presto.spi.Page;
import com.facebook.presto.spi.PageBuilder;
import com.facebook.presto.spi.block.Block;
@@ -212,10 +213,13 @@ public class TopNOperator
}
// Only partial aggregation can flush early. Also, check that we are not flushing tiny bits at a time
- checkState(finishing || partial, "Task exceeded max memory size of %s", memoryManager.getMaxMemorySize());
-
- outputIterator = topNBuilder.build();
- topNBuilder = null;
+ if (finishing || partial) {
+ outputIterator = topNBuilder.build();
+ topNBuilder = null;
+ }
+ else {
+ throw new ExceededMemoryLimitException(memoryManager.getMaxMemorySize());
+ }
}
pageBuilder.reset(); | Throw proper exception when memory size exceeded in TopN | prestodb_presto | train | java |
382b48d69f545c9bac1973baaf2b16801a8f5259 | diff --git a/app/models/notice.rb b/app/models/notice.rb
index <HASH>..<HASH> 100644
--- a/app/models/notice.rb
+++ b/app/models/notice.rb
@@ -38,6 +38,7 @@ class Notice < ActiveRecord::Base
validates_length_of :request_type, :maximum => 255
before_validation :set_default_notice_level
+ before_validation :trim_text
before_save :add_to_all_users
scope :readable, lambda { |user| joins(:users).where('users.id' => user) }
@@ -72,4 +73,8 @@ class Notice < ActiveRecord::Base
def set_default_notice_level
self.level ||= TYPES.first
end
+
+ def trim_text
+ self.text = "#{self.text[0, 1020]} ..." if self.text.size > 1024
+ end
end | Truncate Notice text to max <I> characters.
When some exception with long message (eg PGError value too long) was raised,
Notice was not created and it was impossible to find out in Katello UI what
happened. | Katello_katello | train | rb |
f0ca071973f645f43bca980efb4455daf1f79f65 | diff --git a/scripts/server_importer.rb b/scripts/server_importer.rb
index <HASH>..<HASH> 100644
--- a/scripts/server_importer.rb
+++ b/scripts/server_importer.rb
@@ -30,6 +30,7 @@ require 'right_agent'
require 'right_agent/scripts/usage'
require 'right_agent/scripts/common_parser'
require 'right_http_connection'
+require File.normalize_path(File.join(File.dirname(__FILE__), '..', 'lib', 'instance'))
module RightScale | fixed server_importer to load instance_state from right_link/lib/instance | rightscale_right_link | train | rb |
7157afc5377d8d61711c4a12c0bc3e9c5f37113b | diff --git a/src/ca/eandb/util/progress/ProgressState.java b/src/ca/eandb/util/progress/ProgressState.java
index <HASH>..<HASH> 100644
--- a/src/ca/eandb/util/progress/ProgressState.java
+++ b/src/ca/eandb/util/progress/ProgressState.java
@@ -141,6 +141,13 @@ public class ProgressState implements ProgressMonitor {
return status;
}
+ /**
+ * Tells the task that this progress is monitoring that it should abort.
+ */
+ public void setCancelPending() {
+ cancelPending = true;
+ }
+
/* (non-Javadoc)
* @see ca.eandb.util.progress.ProgressMonitor#isCancelPending()
*/ | Added method to set the cancel pending flag. | bwkimmel_java-util | train | java |
60e01b083316ca98372deef06aa43a55c29b9377 | diff --git a/java/com/facebook/soloader/SoLoader.java b/java/com/facebook/soloader/SoLoader.java
index <HASH>..<HASH> 100644
--- a/java/com/facebook/soloader/SoLoader.java
+++ b/java/com/facebook/soloader/SoLoader.java
@@ -319,6 +319,10 @@ public class SoLoader {
}
}
+ public static Set<String> getLoadedLibrariesNames() {
+ return sLoadedLibraries;
+ }
+
/* package */ static File unpackLibraryBySoName(String soName) throws IOException {
for (int i = 0; i < sSoSources.length; ++i) {
File unpacked = sSoSources[i].unpackLibrary(soName); | Page out native libs on background
Summary:
Once in background, discard from page cache native libs.
We probably shouldn't do that for all libs, but let's try doing that behind QE and see what happens.
Reviewed By: dcolascione
Differential Revision: D<I>
fbshipit-source-id: <I>df9db5f<I>d<I>a<I>a0b7f<I>fdb<I>d7a<I>bd2 | facebook_SoLoader | train | java |
b4ed427b79475da248a136744a4e5d1828fbdc85 | diff --git a/client/state/happychat/user/reducer.js b/client/state/happychat/user/reducer.js
index <HASH>..<HASH> 100644
--- a/client/state/happychat/user/reducer.js
+++ b/client/state/happychat/user/reducer.js
@@ -12,7 +12,7 @@ import { combineReducers, createReducer } from 'state/utils';
import {
geoLocationSchema,
isEligibleSchema,
- isPresalesPrecancellationEligibleSchema,
+ isPresalesPrecancellationEligible as isPresalesPrecancellationEligibleSchema,
} from './schema';
/** | Fix: Invalid import from Happychat schema (#<I>)
This import was a typo and so it was `undefined`
Once we turned off compiling to CommonJS webpack was able to identify
and complain about this. This patch fixes the import. | Automattic_wp-calypso | train | js |
59b811ac5bf6ea64da8e9343fed28676001b9015 | diff --git a/superset/reports/api.py b/superset/reports/api.py
index <HASH>..<HASH> 100644
--- a/superset/reports/api.py
+++ b/superset/reports/api.py
@@ -211,7 +211,7 @@ class ReportScheduleRestApi(BaseSupersetModelRestApi):
"dashboard": "dashboard_title",
"chart": "slice_name",
"database": "database_name",
- "owners": RelatedFieldFilter("first_name", FilterRelatedOwners),
+ "created_by": RelatedFieldFilter("first_name", FilterRelatedOwners),
}
apispec_parameter_schemas = {
diff --git a/tests/integration_tests/reports/api_tests.py b/tests/integration_tests/reports/api_tests.py
index <HASH>..<HASH> 100644
--- a/tests/integration_tests/reports/api_tests.py
+++ b/tests/integration_tests/reports/api_tests.py
@@ -432,7 +432,7 @@ class TestReportSchedulesApi(SupersetTestCase):
ReportSchedule Api: Test get releated report schedule
"""
self.login(username="admin")
- related_columns = ["owners", "chart", "dashboard", "database"]
+ related_columns = ["created_by", "chart", "dashboard", "database"]
for related_column in related_columns:
uri = f"api/v1/report/related/{related_column}"
rv = self.client.get(uri) | fix: report list search by created_by (#<I>) | apache_incubator-superset | train | py,py |
e28eceaf0105c3bbfd2a1bfb7680f88352793584 | diff --git a/bcbio/pipeline/genome.py b/bcbio/pipeline/genome.py
index <HASH>..<HASH> 100644
--- a/bcbio/pipeline/genome.py
+++ b/bcbio/pipeline/genome.py
@@ -46,7 +46,7 @@ def _ensure_annotations(resources, data):
out_dir = utils.safe_makedir(os.path.join(tz.get_in(["dirs", "work"], data),
"inputs", "data", "annotations"))
transcript_gff = tz.get_in(["rnaseq", "transcripts"], resources)
- if transcript_gff:
+ if transcript_gff and utils.file_exists(transcript_gff):
resources["rnaseq"]["gene_bed"] = gtf.gtf_to_bed(transcript_gff, out_dir)
return resources | Skip transcript BED creation if genome lacks a transcript GFF file | bcbio_bcbio-nextgen | train | py |
233c9a7b49e11fe6d35e09e58ee1879bb801dc74 | diff --git a/spec/comments_spec.rb b/spec/comments_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/comments_spec.rb
+++ b/spec/comments_spec.rb
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
-describe "Ticketmaster::Provider::Kanbanpad::Comment" do
+describe TicketMaster::Provider::Kanbanpad::Comment do
before(:all) do
headers = {'Authorization' => 'Basic YWJjQGcuY29tOmllODIzZDYzanM='}
wheaders = headers.merge('Accept' => 'application/json')
diff --git a/spec/tickets_spec.rb b/spec/tickets_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/tickets_spec.rb
+++ b/spec/tickets_spec.rb
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
-describe "Ticketmaster::Provider::Kanbanpad::Ticket" do
+describe TicketMaster::Provider::Kanbanpad::Ticket do
before(:all) do
headers = {'Authorization' => 'Basic YWJjQGcuY29tOmllODIzZDYzanM='}
wheaders = headers.merge('Accept' => 'application/json') | added top level definition for tickets and comments specs | hybridgroup_taskmapper-kanbanpad | train | rb,rb |
cd074a9dc2fbacfe80912a7f4d0895a502750c19 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -39,7 +39,6 @@ setup_params = dict(
tests_require=[
'pytest',
],
- license='MIT',
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers", | Remove license field, deprecated in favor of Trove Classifier. | pytest-dev_pytest-runner | train | py |
7884ec0163a7d0fdeab9e90259ea5be3575405ed | diff --git a/tests/Factory/AdapterFactoryTest.php b/tests/Factory/AdapterFactoryTest.php
index <HASH>..<HASH> 100644
--- a/tests/Factory/AdapterFactoryTest.php
+++ b/tests/Factory/AdapterFactoryTest.php
@@ -182,8 +182,8 @@ class AdapterFactoryTest extends \PHPUnit_Framework_TestCase
);
$this->setExpectedException(
- 'LogicException',
- 'Adapter-Factory callback should return a Gush\Adapter\Adapter instance, got "stdClass"'
+ 'LogicException',
+ 'Adapter-Factory callback should return a Gush\Adapter\Adapter instance, got "stdClass"'
);
$this->adapterFactory->createAdapter('test', [], $config); | fixing more indentation problems 6_^ | gushphp_gush | train | php |
22958fbad06ae04bce695f84709d47057d7d6832 | diff --git a/flink-core/src/main/java/org/apache/flink/api/common/restartstrategy/RestartStrategies.java b/flink-core/src/main/java/org/apache/flink/api/common/restartstrategy/RestartStrategies.java
index <HASH>..<HASH> 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/restartstrategy/RestartStrategies.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/restartstrategy/RestartStrategies.java
@@ -141,7 +141,7 @@ public class RestartStrategies {
@Override
public String getDescription() {
- return "Restart with fixed delay (" + delayBetweenAttemptsInterval + " ms). #"
+ return "Restart with fixed delay (" + delayBetweenAttemptsInterval + "). #"
+ restartAttempts + " restart attempts.";
}
} | [hotfix] Fix duplicate "ms" time unit in RestartStrategy.
For example: "Restart with fixed delay (<I> ms ms)."
-> org.apache.flink.api.common.time.Time already prints the time unit.
This closes #<I>. | apache_flink | train | java |
56e5908f921a46ad62fbf6053c476eb27182a8b9 | diff --git a/js/pubsub.js b/js/pubsub.js
index <HASH>..<HASH> 100644
--- a/js/pubsub.js
+++ b/js/pubsub.js
@@ -30,7 +30,7 @@ export class PubSub {
}
// Add the listener to queue
- var index = this.topics[topic].push(listener) -1;
+ const index = this.topics[topic].push(listener) - 1;
// Provide handle back for removal of topic
return {
@@ -62,11 +62,11 @@ export class PubSub {
* @param {Function} listener The callback executed on topic publication
*/
once(topic, listener) {
- let subscription;
- subscription = this.subscribe(topic, () => {
+ const subscription = this.subscribe(topic, () => {
subscription.remove();
listener.apply(this, arguments);
});
+ return subscription;
}
/**
@@ -93,8 +93,8 @@ export class PubSub {
delete this.topics[topic];
}
}
-};
+}
-export var pubsub = new PubSub();
+export const pubsub = new PubSub();
export default pubsub; | Allow to unsubscribe from `once` | opendatateam_udata | train | js |
2c327dcec8c7213c785ef230ed9aefa964f708d9 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -14,13 +14,13 @@ requirements = [
'six>=1.10.0',
'psutil>=5.2.2',
'watchdog>=0.8.3',
- 'GitPython>=2.1.8',
+ 'GitPython>=1.0.0',
'shortuuid>=0.5.0',
'nvidia-ml-py3>=7.352.0',
'flask-cors>=3.0.3',
'flask-graphql>=1.4.0',
'graphene>=2.0.0',
- 'python-dateutil>=2.7.2'
+ 'python-dateutil>=2.6.1'
]
test_requirements = [ | Lower requirments for pypy | wandb_client | train | py |
53a25b41d1538728aaab57682cd1d09e42f72a66 | diff --git a/lib/mongomodel/version.rb b/lib/mongomodel/version.rb
index <HASH>..<HASH> 100644
--- a/lib/mongomodel/version.rb
+++ b/lib/mongomodel/version.rb
@@ -1,3 +1,3 @@
module MongoModel
- VERSION = "0.4.9"
+ VERSION = "0.5.0"
end | Increment version to <I> | spohlenz_mongomodel | train | rb |
6634cbdbcf5a12d78cbe7997272651566f0e0585 | diff --git a/openpnm/utils/_misc.py b/openpnm/utils/_misc.py
index <HASH>..<HASH> 100644
--- a/openpnm/utils/_misc.py
+++ b/openpnm/utils/_misc.py
@@ -84,8 +84,8 @@ class PrintableList(list):
lines.append(horizontal_rule)
return "\n".join(lines)
- def __repr__(self):
- return self.__str__()
+ # def __repr__(self):
+ # return self.__str__()
class PrintableDict(OrderedDict):
@@ -117,8 +117,8 @@ class PrintableDict(OrderedDict):
self._key = "Key"
super().__init__(*args, **kwargs)
- def __repr__(self):
- return self.__str__()
+ # def __repr__(self):
+ # return self.__str__()
def __str__(self):
header = "―" * 78 | removign repr = str from printable list and dict | PMEAL_OpenPNM | train | py |
b21347a1f6edbc83d99992ea2b67f6a8780561a9 | diff --git a/sample/src/com/manuelpeinado/multichoiceadapter/demo/arrayadaptersample/MyArrayAdapter.java b/sample/src/com/manuelpeinado/multichoiceadapter/demo/arrayadaptersample/MyArrayAdapter.java
index <HASH>..<HASH> 100644
--- a/sample/src/com/manuelpeinado/multichoiceadapter/demo/arrayadaptersample/MyArrayAdapter.java
+++ b/sample/src/com/manuelpeinado/multichoiceadapter/demo/arrayadaptersample/MyArrayAdapter.java
@@ -40,7 +40,6 @@ public class MyArrayAdapter extends MultiChoiceArrayAdapter<String> {
public MyArrayAdapter(Bundle savedInstanceState, Context context, ArrayList<String> items) {
super(savedInstanceState, context, R.layout.mca__simple_list_item_checkable_1, android.R.id.text1, items);
- setItemClickInActionModePolicy(ItemClickInActionModePolicy.OPEN);
}
@Override | removed 'none' itemclick policy from arrayadapter sample | ManuelPeinado_MultiChoiceAdapter | train | java |
d65816922e838b3c53425a2cf4e3ec38f7113733 | diff --git a/packages/@vuepress/plugin-active-header-links/mixin.js b/packages/@vuepress/plugin-active-header-links/mixin.js
index <HASH>..<HASH> 100644
--- a/packages/@vuepress/plugin-active-header-links/mixin.js
+++ b/packages/@vuepress/plugin-active-header-links/mixin.js
@@ -68,8 +68,12 @@ export default {
methods: {
onScroll: throttle(function () {
+ const anchors = getAnchors()
+ if (anchors.length === 0) {
+ return
+ }
this.$lastAnchor = this.$currentAnchor
- this.$currentAnchor = calculateCurrentAnchor(getAnchors())
+ this.$currentAnchor = calculateCurrentAnchor(anchors)
if (!this.$lastAnchor || this.$lastAnchor.hash !== this.$currentAnchor.hash) {
this.$vuepress.$emit('AnchorHashChange', this.$currentAnchor)
} | fix($active-header-links): unexpected error when anchors were empty | vuejs_vuepress | train | js |
45489d0daa2978a0257c4aa2db47909df646ac4c | diff --git a/server/src/main/java/org/jboss/as/server/deployment/Phase.java b/server/src/main/java/org/jboss/as/server/deployment/Phase.java
index <HASH>..<HASH> 100644
--- a/server/src/main/java/org/jboss/as/server/deployment/Phase.java
+++ b/server/src/main/java/org/jboss/as/server/deployment/Phase.java
@@ -588,4 +588,5 @@ public enum Phase {
public static final int CLEANUP_EE = 0x0200;
public static final int CLEANUP_EJB = 0x0300;
public static final int CLEANUP_ANNOTATION_INDEX = 0x0400;
+ public static final int CLEANUP_BATCH = 0x0500;
} | [WFLY-<I>] Add cleanup phase for the batch-jberet subsystem. | wildfly_wildfly-core | train | java |
f704bc9a4b8ac64c588421ef51360fbf6a938a78 | diff --git a/src/Pug/Engine/PugJsEngine.php b/src/Pug/Engine/PugJsEngine.php
index <HASH>..<HASH> 100644
--- a/src/Pug/Engine/PugJsEngine.php
+++ b/src/Pug/Engine/PugJsEngine.php
@@ -169,6 +169,7 @@ class PugJsEngine extends Keywords
$filename = null;
}
+ $vars = $this->mergeWithSharedVariables($vars);
$workDirectory = empty($this->getDefaultOption('cache_dir'))
? sys_get_temp_dir()
: $this->getOption('cache_dir'); | #<I> Enable shared variables with pugjs engine | pug-php_pug | train | php |
c46b0dbcf7c4483680b275c3bdeef99f5c564017 | diff --git a/salt/modules/lxc.py b/salt/modules/lxc.py
index <HASH>..<HASH> 100644
--- a/salt/modules/lxc.py
+++ b/salt/modules/lxc.py
@@ -1215,7 +1215,7 @@ def run_cmd(name, cmd, no_start=False, preserve_state=True,
return res['retcode']
-def cp(name, src, dest, saltenv='base'):
+def cp(name, src, dest):
'''
Copy a file or directory from the host into a container | Remove `saltenv` from keyword arguments. Fixes #<I>
Don't define `saltenv` as a keyword argument if it's not going to be
used. | saltstack_salt | train | py |
0ef8a8d26f263358923042fd0d457c7907dc74d6 | diff --git a/andes/core/model.py b/andes/core/model.py
index <HASH>..<HASH> 100644
--- a/andes/core/model.py
+++ b/andes/core/model.py
@@ -239,9 +239,12 @@ class ModelData:
idx = kwargs['idx']
self.uid[idx] = self.n
self.n += 1
- if kwargs.get("name") is None:
+ if "name" in self.params and kwargs.get("name") is None:
kwargs["name"] = idx
+ if "idx" not in self.params:
+ kwargs.pop("idx")
+
for name, instance in self.params.items():
value = kwargs.pop(name, None)
instance.add(value) | Handle edge cases where a model does not have `idx` or `name`. | cuihantao_andes | train | py |
29bbd25bf7091129b0acc6c2d8dfe96080fb2ab0 | diff --git a/bika/lims/browser/worksheet.py b/bika/lims/browser/worksheet.py
index <HASH>..<HASH> 100644
--- a/bika/lims/browser/worksheet.py
+++ b/bika/lims/browser/worksheet.py
@@ -405,7 +405,12 @@ class ManageResultsView(BrowserView):
if analysis_uid:
analysis = tool.lookupObject(analysis_uid)
attachmentid = self.context.generateUniqueId('Attachment')
- client = analysis.aq_parent.aq_parent
+ # client refers to Client in case of Analysis, and to
+ # parent Worksheet in case of DuplicateAnalysis
+ if analysis.aq_parent.portal_type == 'AnalysisRequest':
+ client = analysis.aq_parent.aq_parent
+ else:
+ client = analysis.aq_parent
client.invokeFactory("Attachment",
id = attachmentid)
attachment = client._getOb(attachmentid) | DuplicateAnalysis attachments go in parent Worksheet object | senaite_senaite.core | train | py |
281ae35e755b44452bd5db395cd10ba0867756f4 | diff --git a/minimal.js b/minimal.js
index <HASH>..<HASH> 100644
--- a/minimal.js
+++ b/minimal.js
@@ -14,7 +14,7 @@ var rebox = require('./util').rebox
function unbox(data, unboxers) {
if(data && isString(data.value.content)) {
for(var i = 0;i < unboxers.length;i++) {
- var plaintext = unboxers[i](data.value.content)
+ var plaintext = unboxers[i](data.value.content, data.value)
if(plaintext) {
data.value.cyphertext = data.value.content
data.value.content = plaintext
@@ -52,15 +52,16 @@ function isString (s) {
module.exports = function (dirname, keys, opts) {
var hmac_key = opts && opts.caps && opts.caps.sign
+
var main_unboxer = function(content) { return _unbox(content, keys); }
+ var unboxers = [ main_unboxer ]
var codec = {
- unboxers: [ main_unboxer ],
encode: function (obj) {
return JSON.stringify(obj, null, 2)
},
decode: function (str) {
- return unbox(JSON.parse(str.toString()), this.unboxers)
+ return unbox(JSON.parse(str.toString()), unboxers)
},
buffer: false,
type: 'ssb'
@@ -177,3 +178,5 @@ module.exports = function (dirname, keys, opts) {
return db
}
+
+ | move unboxers off codec object, and also pass the whole object (since it will be needed for private-groups) | ssbc_ssb-db | train | js |
c772a1e0b6e945fb90e8f95e45a7af966c1f5635 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -51,6 +51,9 @@ module.exports = class ViewportTheme {
this.options = defaultOptions;
this.options = this.extendOptions(options);
+ // let's remove trailing slash, from Confluence base URL, if there is one
+ this.options.target.confluenceBaseUrl = this.options.target.confluenceBaseUrl.replace(/\/$/, '');
+
this.log(`${this.getUserAnnotation()} Changing theme ${gutil.colors.bold.yellow(this.options.themeName)} at ${gutil.colors.bold.green(this.options.target.confluenceBaseUrl)}`);
} | Fixing issue with trailing slash on Confluence Base URL. | K15t_gulp-viewport | train | js |
3f1111222cdd678c234f8b8b1037c3264c538507 | diff --git a/src/server.js b/src/server.js
index <HASH>..<HASH> 100644
--- a/src/server.js
+++ b/src/server.js
@@ -22,7 +22,9 @@ app.use(helmet.ieNoOpen())
app.disable('x-powered-by')
app.use((req, res, next) => {
- res.setHeader('Access-Control-Allow-Origin', req.protocol + '://' + process.env.UPPY_ENDPOINT)
+ var protocol = req.headers.origin.startsWith('https') ? 'https' : 'http'
+
+ res.setHeader('Access-Control-Allow-Origin', protocol + '://' + process.env.UPPY_ENDPOINT)
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE')
res.setHeader('Access-Control-Allow-Headers', 'Authorization, Origin, Content-Type, Accept')
res.setHeader('Access-Control-Allow-Credentials', true) | fix: cors protocol from origin header | transloadit_uppy-server | train | js |
6f6aa32a73b03db1def1272c5ecb93272220f419 | diff --git a/src/ConfigLoader.php b/src/ConfigLoader.php
index <HASH>..<HASH> 100644
--- a/src/ConfigLoader.php
+++ b/src/ConfigLoader.php
@@ -55,6 +55,15 @@ class ConfigLoader implements DIContainerIncludeInterface
$this->config = [];
}
+ public function attachConfigDir(ConfigDir $dir, $level = null)
+ {
+ if (null !== $level) {
+ $dir->setLevel($level);
+ }
+ $this->configDirs[$dir->getLevel()][$dir->getPath()] = $dir;
+ $this->levels[$level] = $level;
+ }
+
public function getLevels()
{
ksort($this->levels); | Attach created object of config dir to config loader. | mrdatamapper_akademiano-config | train | php |
6f9e77bc2c54ca6bc928592645c48317a74981f5 | diff --git a/pyrogram/session/session.py b/pyrogram/session/session.py
index <HASH>..<HASH> 100644
--- a/pyrogram/session/session.py
+++ b/pyrogram/session/session.py
@@ -208,7 +208,9 @@ class Session:
MsgId.set_server_time(msg.msg_id / (2 ** 32))
if msg.seq_no % 2 != 0:
- if msg.msg_id not in self.pending_acks:
+ if msg.msg_id in self.pending_acks:
+ continue
+ else:
self.pending_acks.add(msg.msg_id)
if isinstance(msg.body, (raw.types.MsgDetailedInfo, raw.types.MsgNewDetailedInfo)): | Do not handle messages with a pending ack | pyrogram_pyrogram | train | py |
1336d2e80153e7ab97587a7b8687490e514e696c | diff --git a/src/helpers.php b/src/helpers.php
index <HASH>..<HASH> 100644
--- a/src/helpers.php
+++ b/src/helpers.php
@@ -3,7 +3,7 @@
use Illuminate\Support\Facades\App;
use libphonenumber\PhoneNumberFormat;
-if (! function_exists('phone_format')) {
+if (! function_exists('phone')) {
/**
* Get the PhoneNumberUtil or format a phone number for display.
* | wrong function name check
the name of the function used in existance check was wrong | Propaganistas_Laravel-Phone | train | php |
4c890fb64f3320e8aa033d160c3bb42cf99776d6 | diff --git a/core/component.go b/core/component.go
index <HASH>..<HASH> 100644
--- a/core/component.go
+++ b/core/component.go
@@ -333,7 +333,7 @@ func (c *Component) ServerOptions() []grpc.ServerOption {
logCtx = logCtx.WithField("Duration", time.Now().Sub(t))
if err != nil {
err := errors.FromGRPCError(err)
- logCtx.WithField("error", err.Error()).WithField("err-type", fmt.Sprintf("%T", err)).WithField("err-err-type", fmt.Sprintf("%T", err.Error())).Warn("Could not handle Request")
+ logCtx.WithField("error", err.Error()).Warn("Could not handle Request")
} else {
logCtx.Info("Handled request")
} | Don't need to log err type | TheThingsNetwork_ttn | train | go |
3fb5650641e5d88ff6e645641177740252c6f06e | diff --git a/sidebar-left.php b/sidebar-left.php
index <HASH>..<HASH> 100644
--- a/sidebar-left.php
+++ b/sidebar-left.php
@@ -14,9 +14,9 @@ $sidebar_pos = get_theme_mod( 'understrap_sidebar_position' );
?>
<?php if ( 'both' === $sidebar_pos ): ?>
-<div class="col-md-3 widget-area" id="'left-sidebar'" role="complementary">
+<div class="col-md-3 widget-area" id="left-sidebar" role="complementary">
<?php else: ?>
-<div class="col-md-4 widget-area" id="'left-sidebar'" role="complementary">
+<div class="col-md-4 widget-area" id="left-sidebar" role="complementary">
<?php endif; ?>
<?php dynamic_sidebar( 'left-sidebar' ); ?> | Sidebar left: remove single quotes in the id attribute | understrap_understrap | train | php |
3ffeab4f6317ee1003e0d46137c5a0482e58262d | diff --git a/openquake/calculators/hazard/scenario/core.py b/openquake/calculators/hazard/scenario/core.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/hazard/scenario/core.py
+++ b/openquake/calculators/hazard/scenario/core.py
@@ -211,6 +211,12 @@ class ScenarioHazardCalculator(haz_general.BaseHazardCalculatorNext):
# If no site model file was specified, reference parameters are used
# for all sites.
self.initialize_site_model()
+
+ # Once the site model is init'd, create and cache the site collection;
+ # this is done by simply accessing the `site_collection` property,
+ # which does the caching.
+ self.hc.site_collection
+
self.progress['total'] = self.hc.number_of_ground_motion_fields
# Store a record in the output table. | calcs/hazard/scenario/core:
Scenario calculator now caches the site collection during pre-execute. | gem_oq-engine | train | py |
4d9292a8bbcec459e0318aca43f7cd83e9ef0376 | diff --git a/tests/test_transliterate.py b/tests/test_transliterate.py
index <HASH>..<HASH> 100644
--- a/tests/test_transliterate.py
+++ b/tests/test_transliterate.py
@@ -147,8 +147,14 @@ class TestTransliteratePackage(unittest.TestCase):
self.assertIsNotNone(xsampa_list("คน"))
def test_transliterate_iso11940(self):
- self.assertEqual(transliterate("เชียงใหม่", engine="iso_11940"), "echīyngıh̄m̀")
- self.assertEqual(transliterate("ภาษาไทย", engine="iso_11940"), "p̣hās̛̄āịthy")
+ self.assertEqual(
+ transliterate("เชียงใหม่", engine="iso_11940"),
+ "echīyngıh̄m̀"
+ )
+ self.assertEqual(
+ transliterate("ภาษาไทย", engine="iso_11940"),
+ "p̣hās̛̄āịthy"
+ )
def test_pronunciate(self):
self.assertEqual(pronunciate(""), "") | Update test_transliterate.py | PyThaiNLP_pythainlp | train | py |
01b79c279ae0abd034d5e8803ba2ce3c392f42da | diff --git a/python_modules/dagster/dagster/core/definitions/resource.py b/python_modules/dagster/dagster/core/definitions/resource.py
index <HASH>..<HASH> 100644
--- a/python_modules/dagster/dagster/core/definitions/resource.py
+++ b/python_modules/dagster/dagster/core/definitions/resource.py
@@ -21,13 +21,3 @@ class ResourceDefinition(object):
config_field=Field(String),
description=description,
)
-
-
-# for next version
-# def resource(config_field=None, description=None):
-# def _wrap(func):
-# return ResourceDefinition(
-# resource_fn=func, config_field=config_field, description=description
-# )
-
-# return _wrap | Missed doc cleanup (#<I>) | dagster-io_dagster | train | py |
e7453f3c77bc0d600d925951391ba266fc85b24f | diff --git a/porespy/tools/__funcs__.py b/porespy/tools/__funcs__.py
index <HASH>..<HASH> 100644
--- a/porespy/tools/__funcs__.py
+++ b/porespy/tools/__funcs__.py
@@ -1152,6 +1152,11 @@ def size_to_seq(size):
right=True)
vals = -(vals - vals.max() - 1)*~solid
vals = make_contiguous(vals)
+
+ # Possibly simpler way?
+ # vals = (-(sizes - sizes.max())).astype(int) + 1
+ # vals[vals > sizes.max()] = 0
+
return vals | added commented code snippet from different branch | PMEAL_porespy | train | py |
5ef3c831b387086a2269bf390b18cbe90b92d3b1 | diff --git a/mvc/src/main/java/com/github/czyzby/autumn/mvc/component/ui/processor/ViewStageAnnotationProcessor.java b/mvc/src/main/java/com/github/czyzby/autumn/mvc/component/ui/processor/ViewStageAnnotationProcessor.java
index <HASH>..<HASH> 100644
--- a/mvc/src/main/java/com/github/czyzby/autumn/mvc/component/ui/processor/ViewStageAnnotationProcessor.java
+++ b/mvc/src/main/java/com/github/czyzby/autumn/mvc/component/ui/processor/ViewStageAnnotationProcessor.java
@@ -35,7 +35,8 @@ public class ViewStageAnnotationProcessor extends AbstractAnnotationProcessor<Vi
throw new GdxRuntimeException("Only Scene2D stages can be annotated with @ViewStage. Found type:"
+ field.getType() + " in field: " + field + " of component: " + component + ".");
}
- final Class<?> controllerClass = field.getDeclaringClass();
+// final Class<?> controllerClass = field.getDeclaringClass();
+ final Class<?> controllerClass = component.getClass();
if (!registerField(field, interfaceService.getController(controllerClass))) {
// If view controller not found, trying out dialog controllers:
if (!registerField(field, interfaceService.getDialogController(controllerClass))) { | ViewStage annotation can be defined in superclass now | czyzby_gdx-lml | train | java |
40fedc3c7adcd5052cffde3a1770b51302301942 | diff --git a/lib/celluloid/supervision_group.rb b/lib/celluloid/supervision_group.rb
index <HASH>..<HASH> 100644
--- a/lib/celluloid/supervision_group.rb
+++ b/lib/celluloid/supervision_group.rb
@@ -87,6 +87,11 @@ module Celluloid
def actors
@members.map(&:actor)
end
+
+ def [](actor_name)
+ @registry[actor_name]
+ end
+
finalizer :finalize | Add ability to access actors by name
actors being supervised can now be accessed by name similar to how the global registry
Use the internal registry instead of the actor list to | celluloid_celluloid | train | rb |
c0e380d7b1dde7fadc5b91608747a102feb06483 | diff --git a/lib/expander.js b/lib/expander.js
index <HASH>..<HASH> 100644
--- a/lib/expander.js
+++ b/lib/expander.js
@@ -74,13 +74,19 @@ function expandSubjects(mapping, mappingKey) {
function expandSourcesInMapping(mapping, mappingKey) {
replaceAll('sources', mapping);
- if (mapping.sources && Array.isArray(mapping.sources)) {
- for (let i = 0; i < mapping.sources.length; i++) {
- const source = mapping.sources[i];
+ if (mapping.sources) {
+ if (Array.isArray(mapping.sources)) {
+ for (let i = 0; i < mapping.sources.length; i++) {
+ const source = mapping.sources[i];
- if (Array.isArray(source)) {
- mapping.sources[i] = convertArraySourceInObject(source);
+ if (Array.isArray(source)) {
+ mapping.sources[i] = convertArraySourceInObject(source);
+ }
}
+ } else if (typeof mapping.sources === "string") {
+ mapping.sources = [mapping.sources];
+ } else {
+ logger.warn(`mapping ${mappingKey}: no (valid) source is defined.`);
}
} else {
logger.warn(`mapping ${mappingKey}: no source is defined.`); | allow sources to have string to referring to source | RMLio_yarrrml-parser | train | js |
72a6221bad3ec6597a0f46398e76ff67dea533c1 | diff --git a/lib/node-gyp.js b/lib/node-gyp.js
index <HASH>..<HASH> 100644
--- a/lib/node-gyp.js
+++ b/lib/node-gyp.js
@@ -54,7 +54,7 @@ var proto = Gyp.prototype
* Export the contents of the package.json.
*/
-proto.package = JSON.parse(fs.readFileSync(path.resolve(__dirname, '..', 'package.json'), 'utf8'))
+proto.package = require('../package')
proto.configDefs = {
help: Boolean // everywhere | Use node's require json support for the package.
Forgot about this. Reminded in: <URL> | CodeJockey_node-ninja | train | js |
e04bbe99e316c0cd1aafeec2cc27dda02a4905e7 | diff --git a/spec/internal/db/schema.rb b/spec/internal/db/schema.rb
index <HASH>..<HASH> 100644
--- a/spec/internal/db/schema.rb
+++ b/spec/internal/db/schema.rb
@@ -1,6 +1,7 @@
ActiveRecord::Schema.define do
enable_extension "plpgsql"
enable_extension "uuid-ossp"
+ enable_extension "pgcrypto"
create_lookup_tables :cities, :states, :postal_codes, :streets, :countries | Enabling the pgcrypto in the db to allow generating uuids | companygardener_lookup_by | train | rb |
3191ec70cd3034aba2730f71f972deb39a08fd19 | diff --git a/spec/kamel/overlay_spec.rb b/spec/kamel/overlay_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/kamel/overlay_spec.rb
+++ b/spec/kamel/overlay_spec.rb
@@ -9,7 +9,7 @@ require 'rexml/document'
require 'rexml/element'
describe Kamel::Overlay, '#to_kml' do
- setup do
+ before(:each) do
@overlay = Kamel::Overlay.new('test')
@overlay.placemark!(:name => 'placemark-1', :location => {:lat => 1, :lng => 2}, :description => 'Place 1', :icon => 'icon-1.png')
@overlay.placemark!(:name => 'placemark-2', :location => "3,4", :description => 'Place 2', :icon => 'icon-1.png') | setup -> before for latest rspec | xaviershay_kamel | train | rb |
54ae9dfd0047484529dd7b4239f0a3eff4c86b44 | diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/ServiceProvider.php
+++ b/src/ServiceProvider.php
@@ -13,6 +13,13 @@ use Illuminate\Support\Facades\Blade;
class ServiceProvider extends BaseServiceProvider
{
/**
+ * Package name
+ *
+ * @const string
+ */
+ const PACKAGE_NAME = 'activemenu';
+
+ /**
* Indicates if loading of the provider is deferred
*
* @var bool
@@ -57,7 +64,7 @@ class ServiceProvider extends BaseServiceProvider
protected function mergeConfig()
{
$this->mergeConfigFrom(
- $this->packagePath('config/config.php'), 'activemenu'
+ $this->packagePath('config/config.php'), self::PACKAGE_NAME
);
}
@@ -69,7 +76,7 @@ class ServiceProvider extends BaseServiceProvider
protected function publishConfig()
{
$this->publishes([
- $this->packagePath('config/config.php') => config_path('activemenu.php')
+ $this->packagePath('config/config.php') => config_path(self::PACKAGE_NAME . '.php')
], 'config');
} | Add PACKAGE_NAME constant | juy_ActiveMenu | train | php |
a5c72572e977fce4ddfe466c686a3be92afc197e | diff --git a/picopt.py b/picopt.py
index <HASH>..<HASH> 100755
--- a/picopt.py
+++ b/picopt.py
@@ -17,11 +17,15 @@ import traceback
import dateutil.parser
import time
-import Image
-import ImageFile
import rarfile
-
-__version__ = '0.11.2'
+try:
+ from PIL import Image
+ from PIL import ImageFile
+except ImportError:
+ import Image
+ import ImageFile
+
+__version__ = '0.11.3'
PROGRAM_NAME = 'picopt' | try to import from PIL namespace first before Image | ajslater_picopt | train | py |
9d3e81b6c24e4167e5c67d2a387d06d12b8ac67b | diff --git a/playback/keystone.py b/playback/keystone.py
index <HASH>..<HASH> 100644
--- a/playback/keystone.py
+++ b/playback/keystone.py
@@ -29,6 +29,10 @@ class Keystone(common.Common):
sudo("apt-get update")
sudo("apt-get install keystone apache2 libapache2-mod-wsgi memcached python-memcache -y")
+ if self._release() == 'xenial':
+ sudo('systemctl stop keystone')
+ sudo('update-rc.d keystone disable')
+
# Configure /etc/keysone/keystone.conf
with open('tmp_keystone_conf_'+env.host_string,'w') as f:
f.write(conf_keystone_conf) | Keysonte must be stopped in xenial | jiasir_playback | train | py |
db2418081141727391b653a19899bbca5c7de4f7 | diff --git a/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractSequence.java b/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractSequence.java
index <HASH>..<HASH> 100644
--- a/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractSequence.java
+++ b/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractSequence.java
@@ -325,15 +325,14 @@ public abstract class AbstractSequence<C extends Compound> implements Sequence<C
}
/**
- *
- * @return
+ * @return the list of {@link AbstractReference}
*/
public List<AbstractReference> getReferences() {
return references;
}
/**
- *
+ * Set the list of {@link AbstractReference}
* @param references
*/
public void setReferences(List<AbstractReference> references) { | Added Javadoc into AbstractSequence. | biojava_biojava | train | java |
5aa58ca5fcafe59bee94edb1aac993c1547237db | diff --git a/tests/FunctionTest.php b/tests/FunctionTest.php
index <HASH>..<HASH> 100644
--- a/tests/FunctionTest.php
+++ b/tests/FunctionTest.php
@@ -34,7 +34,9 @@ class FunctionTest extends PHPUnit_Framework_TestCase
$this->client->listIndexes();
}
$end = $this->microtime_float();
- $this->assertGreaterThan(($end - $end_init) / 3, $end_init - $init);
+ $timeInit = ($end_init - $init);
+ $timeAfter = ($end - $end_init) / 10;
+ $this->assertGreaterThan(2.0, $timeInit / $timeAfter);
}
public function testConstructAPIKey() | Fix KeepAlive test (quesry after the first one should be at least 2 times faster) | algolia_algoliasearch-client-php | train | php |
809c2ae9d69f7eb53e4002aa04557aeebe5cc5b1 | diff --git a/spec/image_file_spec.rb b/spec/image_file_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/image_file_spec.rb
+++ b/spec/image_file_spec.rb
@@ -3,7 +3,10 @@ require "spec_helper"
describe ImageFile do
describe ".new" do
- it "should return an instance of a "
+ it "should require a single argument"
+ it "should return an ImageFile object"
+ it "should raise an error if filepath is not valid"
+ it "should raise an error if filepath does not represent a valid image file"
end
#TODO: handle files other than pngs!!!!
@@ -13,6 +16,24 @@ describe ImageFile do
before(:all) do
@img_rocket = ImageFile.new 'spec/samples/16px_rocket.png'
@img_bomb = ImageFile.new 'spec/samples/64px_bomb.png'
+ @img_gif = nil
+ @img_jpg = nil
+ @img_svg = nil
+ end
+
+ describe "#filetype" do
+ it "should return image/png for PNG files" do
+ @img_rocket.filetype.should eq('image/png')
+ end
+ it "should return image/gif for GIF files" do
+ @img_gif.filetype.should eq('image/gif')
+ end
+ it "should return image/jpeg for JPG files" do
+ @img_jpg.filetype.should eq('image/jpeg')
+ end
+ it "should return image/svg+xml for SVG files" do
+ @img_svg.filetype.should eq('image/svg+xml')
+ end
end
describe "#as_img_tag" do | stubbing out some failing tests for next | mroth_cssquirt | train | rb |
ce220981cacf0df9b265d107227e93afbefa1cf9 | diff --git a/public/javascripts/wymeditor/jquery.refinery.wymeditor.js b/public/javascripts/wymeditor/jquery.refinery.wymeditor.js
index <HASH>..<HASH> 100755
--- a/public/javascripts/wymeditor/jquery.refinery.wymeditor.js
+++ b/public/javascripts/wymeditor/jquery.refinery.wymeditor.js
@@ -1615,6 +1615,9 @@ WYMeditor.INIT_DIALOG = function(wym, selected, isIframe) {
var dialogType = dialog.find('#wym_dialog_type').val();
var replaceable = wym._selected_image ? $(wym._selected_image) : $(wym._doc.body).find('#replace_me_with_' + wym._current_unique_stamp);
+ // focus first textarea or input type text element
+ dialog.find('input[text], textarea').first().focus();
+
dialog.find(".close_dialog").click(function(e){
wym.close_dialog(e, true);
}); | Focus first textarea or input type text element inside a dialog when the dialog is opened. Fixes (mostly) issue <I> (<URL>) | refinery_refinerycms | train | js |
646202f6721b5adad419789e50aef0331bb4a9e1 | diff --git a/lib/ui/src/components/nav/explorer.js b/lib/ui/src/components/nav/explorer.js
index <HASH>..<HASH> 100644
--- a/lib/ui/src/components/nav/explorer.js
+++ b/lib/ui/src/components/nav/explorer.js
@@ -25,6 +25,12 @@ const LeafLink = React.memo(({ href, children, ...rest }) => (
</Router.Location>
));
+LeafLink.propTypes = {
+ href: PropTypes.string.isRequired,
+ children: PropTypes.node.isRequired,
+};
+
+// eslint-disable-next-line react/no-multi-comp
const StoriesPanel = React.memo(props => <Explorer allowClick {...props} Link={LeafLink} />);
StoriesPanel.propTypes = {
stories: PropTypes.shape({}).isRequired, | Missed this in linting | storybooks_storybook | train | js |
4a84d2ec29cf205ca97d6cfa21e47c0923487f0b | diff --git a/src/main/java/de/dynamicfiles/projects/gradle/plugins/javafx/JavaFXGradlePluginExtension.java b/src/main/java/de/dynamicfiles/projects/gradle/plugins/javafx/JavaFXGradlePluginExtension.java
index <HASH>..<HASH> 100644
--- a/src/main/java/de/dynamicfiles/projects/gradle/plugins/javafx/JavaFXGradlePluginExtension.java
+++ b/src/main/java/de/dynamicfiles/projects/gradle/plugins/javafx/JavaFXGradlePluginExtension.java
@@ -58,6 +58,7 @@ public class JavaFXGradlePluginExtension {
private Map<String, String> bundleArguments = null;
private String appName = null;
private String additionalAppResources = null;
+ private String additionalBundlerResources = null;
private List<Map<String, Object>> secondaryLaunchers = null;
private List<Map<String, Object>> fileAssociations = null;
private boolean skipNativeLauncherWorkaround124 = false;
@@ -305,6 +306,14 @@ public class JavaFXGradlePluginExtension {
this.additionalAppResources = additionalAppResources;
}
+ public String getAdditionalBundlerResources() {
+ return additionalBundlerResources;
+ }
+
+ public void setAdditionalBundlerResources(String additionalBundlerResources) {
+ this.additionalBundlerResources = additionalBundlerResources;
+ }
+
public List<Map<String, Object>> getSecondaryLaunchers() {
return secondaryLaunchers;
} | add new upcoming `additionalBundlerResources`-property | FibreFoX_javafx-gradle-plugin | train | java |
29a2e021d00156c36994962d04994b37dc63ac38 | diff --git a/src/controllers/Admin/PagesAdminController.php b/src/controllers/Admin/PagesAdminController.php
index <HASH>..<HASH> 100644
--- a/src/controllers/Admin/PagesAdminController.php
+++ b/src/controllers/Admin/PagesAdminController.php
@@ -445,6 +445,11 @@ class PagesAdminController extends BaseController {
return Redirect::to(Coanda::adminUrl('pages/browse-add-location/' . $page_id . '/' . $version_number));
}
+ if (Input::has('add_custom_block'))
+ {
+ return Redirect::to(Coanda::adminUrl('layout/page-custom-region-block/' . $page_id . '/' . $version_number . '/' . Input::get('add_custom_block')));
+ }
+
if (Input::has('save_exit') && Input::get('save_exit') == 'true')
{
return Redirect::to(Coanda::adminUrl('pages/view/' . $page_id)); | Allow the add custom block redirect to happen if the exception is thrown. | CoandaCMS_coanda-core | train | php |
44f2f33ed646101626ffbd909897b84c66a9d87e | diff --git a/src/Event/ConsoleEvent.php b/src/Event/ConsoleEvent.php
index <HASH>..<HASH> 100644
--- a/src/Event/ConsoleEvent.php
+++ b/src/Event/ConsoleEvent.php
@@ -136,13 +136,15 @@ abstract class ConsoleEvent extends Event
* @param float $executionTime
*
* @return ConsoleEvent
+ *
+ * @throws \InvalidArgumentException
*/
public static function createFromConsoleEvent(BaseConsoleEvent $e, $startTime = null, $executionTime = null)
{
if (static::support($e)) {
return new static($e, $startTime, $executionTime);
} else {
- throw \InvalidArgumentException('Invalid envent type.');
+ throw \InvalidArgumentException('Invalid event type.');
}
} | Mod: correct a typo and improve doc comment | M6Web_StatsdBundle | train | php |
90a0eae390832b7763a508f73ed891ec3e117b38 | diff --git a/lib/mongoid/associations/has_one_related.rb b/lib/mongoid/associations/has_one_related.rb
index <HASH>..<HASH> 100644
--- a/lib/mongoid/associations/has_one_related.rb
+++ b/lib/mongoid/associations/has_one_related.rb
@@ -2,6 +2,7 @@
module Mongoid #:nodoc:
module Associations #:nodoc:
class HasOneRelated #:nodoc:
+ include Proxy
delegate :==, :nil?, :to => :document
attr_reader :klass, :document
diff --git a/spec/unit/mongoid/associations/has_one_related_spec.rb b/spec/unit/mongoid/associations/has_one_related_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/mongoid/associations/has_one_related_spec.rb
+++ b/spec/unit/mongoid/associations/has_one_related_spec.rb
@@ -55,6 +55,21 @@ describe Mongoid::Associations::HasOneRelated do
end
+ describe "#id" do
+
+ before do
+ @parent = stub(:id => "5", :class => Person)
+ @game = Game.new
+ Game.expects(:first).returns(@game)
+ @association = Mongoid::Associations::HasOneRelated.new(@parent, options)
+ end
+
+ it "delegates to the proxied document" do
+ @association.id.should == @game.id
+ end
+
+ end
+
describe ".initialize" do
before do | Has one related needs to undef methods from proxy | mongodb_mongoid | train | rb,rb |
e8de0b463271257356b6de72636253774a9affb0 | diff --git a/tests/unit/mixins/frost-list-core-mixin-test.js b/tests/unit/mixins/frost-list-core-mixin-test.js
index <HASH>..<HASH> 100644
--- a/tests/unit/mixins/frost-list-core-mixin-test.js
+++ b/tests/unit/mixins/frost-list-core-mixin-test.js
@@ -38,6 +38,13 @@ describe('FrostListCoreMixin', function () {
).to.be.ok
})
+ it('sets up "_listItems" as a computed alias to listConfig.items', function () {
+ expect(
+ subject.get('_listItems'),
+ '_listItems is setup'
+ ).to.eql(testItems)
+ })
+
it('filteredItems computed property is correctly set', function () {
expect(
subject.get('filteredItems'), | added test for init code in frost-list-core-mixin | ciena-frost_ember-frost-list | train | js |
4d31ec1b8f8fe82c17a52036b7483a8d7569db9e | diff --git a/version.go b/version.go
index <HASH>..<HASH> 100644
--- a/version.go
+++ b/version.go
@@ -4,7 +4,7 @@ package ipfs
var CurrentCommit string
// CurrentVersionNumber is the current application's version literal
-const CurrentVersionNumber = "0.9.0-rc1"
+const CurrentVersionNumber = "0.9.0-rc2"
const ApiVersion = "/go-ipfs/" + CurrentVersionNumber + "/" | Release <I>-rc2 | ipfs_go-ipfs | train | go |
5c765600b64987e3170b94daddf376b9882bfe05 | diff --git a/lib/client/api.js b/lib/client/api.js
index <HASH>..<HASH> 100644
--- a/lib/client/api.js
+++ b/lib/client/api.js
@@ -18,8 +18,8 @@ var BASE_URL = 'http://localhost:3001/copay/api';
var WALLET_CRITICAL_DATA = ['xPrivKey', 'm', 'publicKeyRing'];
function _createProposalOpts(opts, signingKey) {
- var msg = opts.toAddress + '|' + opts.amount + '|' + opts.message;
- opts.proposalSignature = WalletUtils.signMessage(msg, signingKey);
+ var hash = WalletUtils.getProposalHash(opts.toAddress, opts.amount, opts.message);
+ opts.proposalSignature = WalletUtils.signMessage(hash, signingKey);
return opts;
}; | use getProposalHash in client | bitpay_bitcore-wallet-service | train | js |
dc8f9c545010f99d4e9bf53883e3b446b39b445f | diff --git a/bin/download_torrent.rb b/bin/download_torrent.rb
index <HASH>..<HASH> 100755
--- a/bin/download_torrent.rb
+++ b/bin/download_torrent.rb
@@ -71,7 +71,8 @@ LogManager.setLevel "blockstate", :info
LogManager.setLevel "piecemanager", :info
LogManager.setLevel "peerholder", :debug
LogManager.setLevel "util", :debug
-LogManager.setLevel "peermsg_serializer", :debug
+LogManager.setLevel "peermsg_serializer", :info
+
FileUtils.mkdir baseDirectory if ! File.exists?(baseDirectory) | Changed logging level of peermsg_serializer | jeffwilliams_quartz-torrent | train | rb |
0ae3050e9e1217d3b0e04c6213d643661783b403 | diff --git a/control/HTTPRequest.php b/control/HTTPRequest.php
index <HASH>..<HASH> 100644
--- a/control/HTTPRequest.php
+++ b/control/HTTPRequest.php
@@ -449,6 +449,9 @@ class SS_HTTPRequest implements ArrayAccess {
$shiftCount = sizeof($patternParts);
}
+ // Filter out any "empty" matching parts - either from an initial / or a trailing /
+ $patternParts = array_values(array_filter($patternParts));
+
$arguments = array();
foreach($patternParts as $i => $part) {
$part = trim($part); | FIX Allow Director::$rules like //$Action
In <I>, doing $Action => SomeController would redirect all action requests
to that default controller. In <I>, you need to do //$Action => SomeController
but it didnt work - those initial slashes broke matching | silverstripe_silverstripe-framework | train | php |
6989fe90cd78f6923dab9182f5b50f61b64b8126 | diff --git a/pysparkling/sql/dataframe.py b/pysparkling/sql/dataframe.py
index <HASH>..<HASH> 100644
--- a/pysparkling/sql/dataframe.py
+++ b/pysparkling/sql/dataframe.py
@@ -803,6 +803,9 @@ class DataFrame(object):
>>> df.orderBy(["age", "name"], ascending=[0, 1]).collect()
[Row(age=5, name='Bob'), Row(age=2, name='Alice')]
"""
+ if len(cols) == 1 and isinstance(cols[0], list):
+ cols = cols[0]
+
exprs = [parse(col) for col in cols]
sorting_cols = self._sort_cols(exprs, kwargs)
sorted_jdf = self._jdf.sort(sorting_cols)
@@ -817,8 +820,6 @@ class DataFrame(object):
"""
if not cols:
raise ValueError("should sort by at least one column")
- if len(cols) == 1 and isinstance(cols[0], list):
- cols = cols[0]
ascending = kwargs.pop('ascending', True)
if isinstance(ascending, (bool, int)): | Fix sorting based on a list of expressions | svenkreiss_pysparkling | train | py |
cd9ac8db9d398b1bd608b7f1af5c0e332eebdc40 | diff --git a/salt/modules/rh_ip.py b/salt/modules/rh_ip.py
index <HASH>..<HASH> 100644
--- a/salt/modules/rh_ip.py
+++ b/salt/modules/rh_ip.py
@@ -1262,7 +1262,10 @@ def apply_network_settings(**settings):
)
res = True
else:
- res = __salt__["service.restart"]("network")
+ if __grains__["osmajorrelease"] >= 8:
+ res = __salt__["service.restart"]("NetworkManager")
+ else:
+ res = __salt__["service.restart"]("network")
return hostname_res and res | Add grains majorrelease check to fix #<I>
Fixed network module compatibility with newest RedHat family major release version (8). | saltstack_salt | train | py |
07afb17ccd1c1f9941edb6394953de3e54b255b9 | diff --git a/src/Header/Consumer/CommentConsumer.php b/src/Header/Consumer/CommentConsumer.php
index <HASH>..<HASH> 100644
--- a/src/Header/Consumer/CommentConsumer.php
+++ b/src/Header/Consumer/CommentConsumer.php
@@ -83,8 +83,9 @@ class CommentConsumer extends GenericConsumer
* nested, its implementation must advance past its own 'end' token.
*
* @param Iterator $tokens
+ * @param bool $isStartToken
*/
- protected function advanceToNextToken(Iterator $tokens)
+ protected function advanceToNextToken(Iterator $tokens, $isStartToken)
{
$tokens->next();
} | Fix CommentConsumer's overloaded method signature
advanceToNextToken was not compatible with AbstractConsumer's
signature. | zbateson_mail-mime-parser | train | php |
2da93147fbd78eed9e4977f3d8066aa035d3b73d | diff --git a/cdm/src/main/java/ucar/nc2/dt/RadialDatasetSweep.java b/cdm/src/main/java/ucar/nc2/dt/RadialDatasetSweep.java
index <HASH>..<HASH> 100644
--- a/cdm/src/main/java/ucar/nc2/dt/RadialDatasetSweep.java
+++ b/cdm/src/main/java/ucar/nc2/dt/RadialDatasetSweep.java
@@ -20,6 +20,7 @@
package ucar.nc2.dt;
import ucar.nc2.VariableSimpleIF;
+import ucar.nc2.Variable;
import java.io.IOException;
import java.util.Date;
@@ -132,6 +133,9 @@ public interface RadialDatasetSweep extends ucar.nc2.dt.TypedDataset {
*/
public RadialDatasetSweep.Type getType();
+
+ public Variable getsweepVar();
+
/**
* @return the number of radials for this Sweep
*/ | level2 high res. variable offset and scale | Unidata_thredds | train | java |
a1c07f80b5bf3fa44fe5c49e11a0d72498d4d0a1 | diff --git a/driver-core/src/test/functional/com/mongodb/connection/SingleServerClusterTest.java b/driver-core/src/test/functional/com/mongodb/connection/SingleServerClusterTest.java
index <HASH>..<HASH> 100644
--- a/driver-core/src/test/functional/com/mongodb/connection/SingleServerClusterTest.java
+++ b/driver-core/src/test/functional/com/mongodb/connection/SingleServerClusterTest.java
@@ -115,7 +115,7 @@ public class SingleServerClusterTest {
Connection connection = cluster.getServer(secondary).getConnection();
// when
- BsonDocument result = connection.command(getDefaultDatabaseName(), new BsonDocument("find", new BsonString(collectionName)),
+ BsonDocument result = connection.command(getDefaultDatabaseName(), new BsonDocument("count", new BsonString(collectionName)),
new NoOpFieldNameValidator(), ReadPreference.primary(), new BsonDocumentCodec(), NoOpSessionContext.INSTANCE);
// then | JAVA-<I>: Change functional test in SingleServerClusterTest so that it can execute on all supported server versions | mongodb_mongo-java-driver | train | java |
3e7e89baa57f1ca8cebf92cf70802a278f9d5cf1 | diff --git a/spec/uia/patterns/selection_spec.rb b/spec/uia/patterns/selection_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/uia/patterns/selection_spec.rb
+++ b/spec/uia/patterns/selection_spec.rb
@@ -23,7 +23,7 @@ describe Uia::Patterns::Selection do
Given(:tree_view) { main.find(id: 'treeView').as :selection }
When { tree_view.selection_items.first.as(:expand_collapse).expand }
- Then { tree_view.selection_items.count == 4 }
+ Then { tree_view.selection_items.map(&:name) == ['Parent One', 'Child 1', 'Child 2', 'Parent Two'] }
end
end
end | assert values rather than count in selection_spec | northwoodspd_uia | train | rb |
dbf06ee875ae9529a499ef70f1b11147467d1c14 | diff --git a/spec/evendoors_spec.rb b/spec/evendoors_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/evendoors_spec.rb
+++ b/spec/evendoors_spec.rb
@@ -195,6 +195,18 @@ describe EvenDoors do
p.door.should eql 'door'
p.action.should eql 'action'
#
+ p.set_dst! 'action', ''
+ p.split_dst!
+ p.room.should eql nil
+ p.door.should eql nil
+ p.action.should eql 'action'
+ #
+ p.set_dst! 'action'
+ p.split_dst!
+ p.room.should eql nil
+ p.door.should eql nil
+ p.action.should eql 'action'
+ #
p.clear_dsts!
p.add_dsts 'door?action,?action'
p.split_dst! | specs: complete Particle#set_dst! coverage | jeremyz_edoors-ruby | train | rb |
97a912a8ca2d82433104a5e77b5ee0adabe75939 | diff --git a/ncbi_genome_download/core.py b/ncbi_genome_download/core.py
index <HASH>..<HASH> 100644
--- a/ncbi_genome_download/core.py
+++ b/ncbi_genome_download/core.py
@@ -35,9 +35,12 @@ def get_summary(section, domain, uri):
def parse_summary(summary):
'''Parse the summary file from TSV format to a csv DictReader'''
+ # skip the leading 2 comment characters in the header to get nicer names
comment = summary.read(2)
if comment != '# ':
+ # Huh, unexpected header, just go back to whereever we were before
idx = summary.tell()
summary.seek(max(0, idx - 2))
+
reader = csv.DictReader(summary, dialect='excel-tab')
return reader | core: add explanatory comments to parse_summary | kblin_ncbi-genome-download | train | py |
34c0817143affcbacf851997ebb8baa3cc651be2 | diff --git a/bika/lims/browser/__init__.py b/bika/lims/browser/__init__.py
index <HASH>..<HASH> 100644
--- a/bika/lims/browser/__init__.py
+++ b/bika/lims/browser/__init__.py
@@ -93,8 +93,11 @@ def ulocalized_time(time, long_format=None, time_only=None, context=None,
time_str = _ut(time, long_format, time_only, context,
'bika', request)
except:
+ err_msg = traceback.format_exc() + '\n'
+ logger.error(
+ err_msg +
+ "Error converting '{}' time to string.".format(time))
time_str = ''
-
return time_str | Getter the error in a better way. | senaite_senaite.core | train | py |
492a6dc7b0c89f4639958e4a8f842551ab2cb6d6 | diff --git a/src/org/jgroups/client/StompConnection.java b/src/org/jgroups/client/StompConnection.java
index <HASH>..<HASH> 100644
--- a/src/org/jgroups/client/StompConnection.java
+++ b/src/org/jgroups/client/StompConnection.java
@@ -382,6 +382,11 @@ public class StompConnection implements Runnable {
System.out.println("<< INFO: " + information);
}
});
+
+ if(!conn.isConnected()) {
+ conn.setupConnection();
+ }
+
conn.connect();
while(conn.isConnected()) { | connecting the connection before starting the runner | belaban_JGroups | train | java |
51ce16eaad9a9f9725ffb80855d94783ca100042 | diff --git a/bokeh/plotting.py b/bokeh/plotting.py
index <HASH>..<HASH> 100644
--- a/bokeh/plotting.py
+++ b/bokeh/plotting.py
@@ -22,6 +22,9 @@ from .resources import Resources
from .session import Cloud, DEFAULT_SERVER_URL, Session
from .utils import decode_utf8, publish_display_data
+# extra imports -- just thigns to add to 'from plotting import *'
+from bokeh.objects import ColumnDataSource
+
_default_document = Document()
_default_session = None | restore "unused" import
was made available with "from bokeh.plotting import *" | bokeh_bokeh | train | py |
cf33c5b47f04df8f6cd3bd5c6e1fc43497a212e0 | diff --git a/src/main/java/com/taskadapter/redmineapi/bean/TimeEntryActivity.java b/src/main/java/com/taskadapter/redmineapi/bean/TimeEntryActivity.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/taskadapter/redmineapi/bean/TimeEntryActivity.java
+++ b/src/main/java/com/taskadapter/redmineapi/bean/TimeEntryActivity.java
@@ -3,7 +3,7 @@ package com.taskadapter.redmineapi.bean;
public class TimeEntryActivity {
/**
- * @param id database Id
+ * database Id
*/
private final Integer id; | fixed javadoc for a field | taskadapter_redmine-java-api | train | java |
1e9d27f80dcff120c991ce957217a9c3407b28cf | diff --git a/lib/assets/index.js b/lib/assets/index.js
index <HASH>..<HASH> 100644
--- a/lib/assets/index.js
+++ b/lib/assets/index.js
@@ -21,6 +21,7 @@ exports.typeByContentType = {};
if (prototype.alternativeExtensions) {
prototype.alternativeExtensions.forEach(function (alternativeExtension) {
exports.typeByExtension[alternativeExtension] = assetType;
+ exports.typeByExtension['.' + alternativeExtension] = assetType;
});
}
}); | assets.typeByExtensions: Also install path.extname-compatible keys for the alternative extensions. | assetgraph_assetgraph | train | js |
b3557c5775272b055b8098e3949ae5d3aa706aee | diff --git a/src/DataTablesEditor.php b/src/DataTablesEditor.php
index <HASH>..<HASH> 100644
--- a/src/DataTablesEditor.php
+++ b/src/DataTablesEditor.php
@@ -26,6 +26,13 @@ abstract class DataTablesEditor
protected $model = null;
/**
+ * Indicates if all mass assignment is enabled on model.
+ *
+ * @var bool
+ */
+ protected $unguarded = false;
+
+ /**
* Process dataTables editor action request.
*
* @param Request $request
@@ -112,6 +119,8 @@ abstract class DataTablesEditor
$this->model = new $this->model;
}
+ $this->model->unguard($this->unguarded);
+
return $this->model;
}
@@ -385,6 +394,19 @@ abstract class DataTablesEditor
}
/**
+ * Set model unguard state.
+ *
+ * @param bool $state
+ * @return $this
+ */
+ public function unguard($state = true)
+ {
+ $this->unguarded = $state;
+
+ return $this;
+ }
+
+ /**
* Display dataTables editor validation errors.
*
* @param Validator $validator | Add property to allow mass assignment on model. | yajra_laravel-datatables-editor | train | php |
b96e6cafb6bfa6d24d470cf78a42a5bed86e4464 | diff --git a/backends/graphite.js b/backends/graphite.js
index <HASH>..<HASH> 100644
--- a/backends/graphite.js
+++ b/backends/graphite.js
@@ -112,6 +112,13 @@ var flush_stats = function graphite_flush(ts, metrics) {
sum = cumulativeValues[count-1];
mean = sum / count;
+ var sumOfDiffs = 0;
+ for (var i = 1; i < count; i++) {
+ sumOfDiffs += (values[i] - mean) * (values[i] - mean);
+ }
+ var stddev = Math.sqrt(sumOfDiffs / count);
+
+ message += 'stats.timers.' + key + '.std ' + stddev + ' ' + ts + "\n";
message += 'stats.timers.' + key + '.upper ' + max + ' ' + ts + "\n";
message += 'stats.timers.' + key + '.lower ' + min + ' ' + ts + "\n";
message += 'stats.timers.' + key + '.count ' + count + ' ' + ts + "\n"; | Add standard deviation to timers stats | statsd_statsd | train | js |
1a29a8f6c92a23655f3cc8e8470f6469aaef3152 | diff --git a/src/lib/modules/blockchain_process/simulator.js b/src/lib/modules/blockchain_process/simulator.js
index <HASH>..<HASH> 100644
--- a/src/lib/modules/blockchain_process/simulator.js
+++ b/src/lib/modules/blockchain_process/simulator.js
@@ -75,7 +75,8 @@ class Simulator {
const programName = 'ganache-cli';
const program = ganache;
console.log(`running: ${programName} ${cmds.join(' ')}`);
- shelljs.exec(`${program} ${cmds.join(' ')}`, {async : true});
+
+ shelljs.exec(`node ${program} ${cmds.join(' ')}`, {async : true});
if(useProxy){
let ipcObject = new Ipc({ipcRole: 'client'}); | fix(simulator): adds `node` to sim command to comply with Windows | embark-framework_embark | train | js |
1cdd7788f64fd05b9b7a55ab71cc679073bb5264 | diff --git a/abilian/web/action.py b/abilian/web/action.py
index <HASH>..<HASH> 100644
--- a/abilian/web/action.py
+++ b/abilian/web/action.py
@@ -153,7 +153,7 @@ class Action(object):
endpoint = self.endpoint
if endpoint:
- return url_for(*endpoint[0], **endpoint[1])
+ return url_for(endpoint[0], **endpoint[1])
return self._url | fix bad call to url_for | abilian_abilian-core | train | py |
68e89ffb793149f6ddb967473fd65f8f93d72556 | diff --git a/src/utils/generate-javascript.js b/src/utils/generate-javascript.js
index <HASH>..<HASH> 100644
--- a/src/utils/generate-javascript.js
+++ b/src/utils/generate-javascript.js
@@ -1,4 +1,3 @@
-import {parse as customParser} from 'recast/parsers/typescript'
import {print} from 'recast'
/**
* Generate the javascript from an ast source
@@ -9,9 +8,6 @@ import {print} from 'recast'
export default function generateJavascript(ast, options) {
return print(ast, {
...options,
- parser: {
- parse: customParser
- },
tabWidth: 2,
wrapColumn: 0,
quote: 'single' | removed custom parser in the printer options | riot_compiler | train | js |
50609ca9ab1030191c14eb7af8be5d37d2709aef | diff --git a/python/tests/sbp/client/test_handler.py b/python/tests/sbp/client/test_handler.py
index <HASH>..<HASH> 100644
--- a/python/tests/sbp/client/test_handler.py
+++ b/python/tests/sbp/client/test_handler.py
@@ -10,6 +10,7 @@
import io
import itertools
+import time
import threading
from sbp.client.handler import *
@@ -69,6 +70,7 @@ def until(p, limit=1000):
for i in itertools.count():
if p():
break
+ time.sleep(0)
assert i < limit
def test_listener_thread_ok(): | Add a sleep(0) to give the other thread some more run time. | swift-nav_libsbp | train | py |
ce1944a80ba5360f5235b527c7eeab11270032e5 | diff --git a/handler_rotating_file_test.go b/handler_rotating_file_test.go
index <HASH>..<HASH> 100644
--- a/handler_rotating_file_test.go
+++ b/handler_rotating_file_test.go
@@ -73,3 +73,25 @@ func TestRotatingFileHandler_AppendWithoutBackup(t *testing.T) {
require.Equal(t, totalSize, uint64(fileInfo.Size()))
removeFile(t, testFileName)
}
+
+func BenchmarkRotatingFileHandler(b *testing.B) {
+ b.StopTimer()
+ defer Shutdown()
+ if FileExists(testFileName) {
+ os.Remove(testFileName)
+ }
+ rotateMaxBytes := uint64(1024 * 1024 * 1024 * 1) // 1G
+ backupCount := uint32(0)
+ handler, err := NewRotatingFileHandler(
+ testFileName, os.O_APPEND, rotateMaxBytes, backupCount)
+ if err != nil {
+ panic("fail to get handler")
+ }
+ logger := GetLogger("rfileBen")
+ logger.AddHandler(handler)
+ message := strings.Repeat("abcdefghij", 10)
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ logger.Errorf(message)
+ }
+} | add benchmark test for rotating file handler | hhkbp2_go-logging | train | go |
42c7c6d0b80a2e85eb1247746193c76d0d4b03ae | diff --git a/dev/com.ibm.ws.kernel.boot_fat/fat/src/com/ibm/ws/kernel/boot/ServerClasspathTest.java b/dev/com.ibm.ws.kernel.boot_fat/fat/src/com/ibm/ws/kernel/boot/ServerClasspathTest.java
index <HASH>..<HASH> 100644
--- a/dev/com.ibm.ws.kernel.boot_fat/fat/src/com/ibm/ws/kernel/boot/ServerClasspathTest.java
+++ b/dev/com.ibm.ws.kernel.boot_fat/fat/src/com/ibm/ws/kernel/boot/ServerClasspathTest.java
@@ -11,6 +11,7 @@
package com.ibm.ws.kernel.boot;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import java.util.Iterator;
import java.util.List;
@@ -62,6 +63,11 @@ public class ServerClasspathTest {
@Test
public void testJvmAppClasspath() throws Exception {
+
+ // Ensure the application has loaded before starting the test case
+ assertNotNull("The application checkJvmAppClasspath did not appear to have started.",
+ server.waitForStringInLog("CWWKZ0001I.* checkJvmAppClasspath"));
+
//TODO: check logs for any packages that are not in the expected packages list
StringBuilder unexpectedPackages = new StringBuilder();
List<String> pkgsOnCP = server.findStringsInLogs("AppLoader can load: .*", server.getConsoleLogFile()); | Issue #<I> : Add app started check to ServerClasspathTest | OpenLiberty_open-liberty | train | java |
9cb7402158745d8c4f7aacb4efbe64574dbf4e19 | diff --git a/lib/rules/rules.js b/lib/rules/rules.js
index <HASH>..<HASH> 100644
--- a/lib/rules/rules.js
+++ b/lib/rules/rules.js
@@ -1179,6 +1179,8 @@ proto.parse = function(text, root) {
if (inlineValues) {
this._values = extend({}, this._orgValues, inlineValues);
inlineValues = null;
+ } else {
+ this._values = this._orgValues;
}
}; | feat: support for setting mutil inline value in Rules | avwo_whistle | train | js |
2ac1d7d847434c2672f2e5a60876ce50888c261f | diff --git a/apitools/base/py/base_api.py b/apitools/base/py/base_api.py
index <HASH>..<HASH> 100644
--- a/apitools/base/py/base_api.py
+++ b/apitools/base/py/base_api.py
@@ -419,7 +419,7 @@ class BaseApiClient(object):
try:
message = encoding.JsonToMessage(response_type, data)
except (exceptions.InvalidDataFromServerError,
- messages.ValidationError) as e:
+ messages.ValidationError, ValueError) as e:
raise exceptions.InvalidDataFromServerError(
'Error decoding response "%s" as type %s: %s' % (
data, response_type.__name__, e)) | Convert ValueError to InvalidDataFromServerError in BaseApiClient.DeserializeMessage
Currently, the ValueErrors raised by json.loads are not handled by DeserializeMessage, meaning that we're losing the text of the source message in error logs when the JSON is malformed. | google_apitools | train | py |
4c461edb61f8658c7d0ad1c58c1551490b319651 | diff --git a/umsgpack.py b/umsgpack.py
index <HASH>..<HASH> 100644
--- a/umsgpack.py
+++ b/umsgpack.py
@@ -123,6 +123,13 @@ class Ext:
s += ")"
return s
+ def __hash__(self):
+ """
+ Provide a hash of this Ext object.
+ """
+ return hash((self.type, self.data))
+
+
class InvalidString(bytes):
"""Subclass of bytes to hold invalid UTF-8 strings."""
pass | implement hash special method in Ext class
allowing Ext objects to be used as map keys. | vsergeev_u-msgpack-python | train | py |
7e41a7360fdd900e7e08b46b70bd2fd0155729c4 | diff --git a/webpush/urls.py b/webpush/urls.py
index <HASH>..<HASH> 100644
--- a/webpush/urls.py
+++ b/webpush/urls.py
@@ -8,7 +8,7 @@ from . import views
# When we last restarted the server; used for cache control headers and
# invalidating the server side cache on server restart
-last_modified_date = timezone.now()
+last_modified_date = timezone.now().strftime("%Y-%m-%d_%H:%M:%S")
urlpatterns = [
path('jsi18n/', | Memcached don't accept space in key (#<I>)
If used with memcached caching jsi<I>n page will generate "InvalidCacheKey" error. | safwanrahman_django-webpush | train | py |
83d0080343a576708e9596e382a0ced58518c2bb | diff --git a/lib/push.js b/lib/push.js
index <HASH>..<HASH> 100644
--- a/lib/push.js
+++ b/lib/push.js
@@ -1,6 +1,6 @@
// Require Packages
-const get = require('lodash.get');
-const set = require('lodash.set');
+const get = require('lodash/get');
+const set = require('lodash/set');
module.exports = function(db, params, options) {
@@ -49,4 +49,4 @@ module.exports = function(db, params, options) {
return newData
}
-}
\ No newline at end of file
+} | feat: switch to lodash singular package | TrueXPixels_quick.db | train | js |
c247271f345e92e868a09662bc24efcbdff982b5 | diff --git a/src/Subscribo/Support/Arr.php b/src/Subscribo/Support/Arr.php
index <HASH>..<HASH> 100644
--- a/src/Subscribo/Support/Arr.php
+++ b/src/Subscribo/Support/Arr.php
@@ -56,4 +56,17 @@ class Arr extends \Illuminate\Support\Arr {
}
return $result;
}
+
+ public static function withoutKeyCaseInsensitively($needle, array $haystack)
+ {
+ $result = array();
+ $modifiedNeedle = strtolower($needle);
+ foreach ($haystack as $key => $value) {
+ $modifiedKey = strtolower($key);
+ if ($modifiedKey != $modifiedNeedle) {
+ $result[$key] = $value;
+ }
+ }
+ return $result;
+ }
} | Subscribo Support Package - Class Arr adding method withoutKeyCaseInsensitively() | Subscribo_support | train | php |
4b45c1f98c433f2edceaef063d0bf3e93917fc32 | diff --git a/server.go b/server.go
index <HASH>..<HASH> 100644
--- a/server.go
+++ b/server.go
@@ -614,7 +614,11 @@ func (s *server) loop() {
// until the event is actually processed before returning.
func (s *server) send(value interface{}) (interface{}, error) {
event := &ev{target: value, c: make(chan error, 1)}
- s.c <- event
+ select {
+ case s.c <- event:
+ case <-s.stopped:
+ return nil, StopError
+ }
select {
case <-s.stopped:
return nil, StopError
@@ -637,7 +641,10 @@ func (s *server) sendAsync(value interface{}) {
s.routineGroup.Add(1)
go func() {
defer s.routineGroup.Done()
- s.c <- event
+ select {
+ case s.c <- event:
+ case <-s.stopped:
+ }
}()
} | chore(server): avoid blocking on event send | influxdata_influxdb | train | go |
2499087e2e9c5a3349b9652a5adbb7a1fcf91b34 | diff --git a/fastly/condition.go b/fastly/condition.go
index <HASH>..<HASH> 100644
--- a/fastly/condition.go
+++ b/fastly/condition.go
@@ -4,6 +4,7 @@ import (
"fmt"
"net/url"
"sort"
+ "time"
)
// Condition represents a condition response from the Fastly API.
@@ -11,11 +12,14 @@ type Condition struct {
ServiceID string `mapstructure:"service_id"`
Version int `mapstructure:"version"`
- Name string `mapstructure:"name"`
- Comment string `mapstructure:"comment"`
- Statement string `mapstructure:"statement"`
- Type string `mapstructure:"type"`
- Priority int `mapstructure:"priority"`
+ Name string `mapstructure:"name"`
+ Comment string `mapstructure:"comment"`
+ Statement string `mapstructure:"statement"`
+ Type string `mapstructure:"type"`
+ Priority int `mapstructure:"priority"`
+ CreatedAt *time.Time `mapstructure:"created_at"`
+ UpdatedAt *time.Time `mapstructure:"updated_at"`
+ DeletedAt *time.Time `mapstructure:"deleted_at"`
}
// conditionsByName is a sortable list of conditions. | feat(condition): add timestamp fields to response object
Add support for created_at, updated_at, and deleted_at fields. | sethvargo_go-fastly | train | go |
44810cacc648757da2fdbd05ddc72997c075f11f | diff --git a/lib/jsdom.js b/lib/jsdom.js
index <HASH>..<HASH> 100644
--- a/lib/jsdom.js
+++ b/lib/jsdom.js
@@ -97,7 +97,7 @@ exports.applyDocumentFeatures = function(doc, features) {
}
};
-exports.jQueryify = function (window /* path [optional], callback */) {
+exports.jQueryify = exports.jsdom.jQueryify = function (window /* path [optional], callback */) {
if (!window || !window.document) { return; } | made the external facing jQueryify method sit on exports.jsdom so it's easier to access | jsdom_jsdom | train | js |
7fe7dc2d2ce7774288f9ee4b4cd0bc292324a70a | diff --git a/src/input/pointer.js b/src/input/pointer.js
index <HASH>..<HASH> 100644
--- a/src/input/pointer.js
+++ b/src/input/pointer.js
@@ -199,6 +199,9 @@
// translate to local coordinates
me.input.globalToLocal(clientX, clientY, this.pos);
+ // true if not originally a pointer event
+ this.isNormalized = !me.device.pointerEvent || (me.device.pointerEvent && !(event instanceof window.PointerEvent));
+
if (event.type === "wheel") {
this.deltaMode = 1;
this.deltaX = event.deltaX; | isNormalized flag to know is the originating event is a PointerEvent | melonjs_melonJS | train | js |
20922a1cf1c2901f5fe76aa974d17a2618be2115 | diff --git a/src/java/com/threerings/media/tile/TileMultiFrameImage.java b/src/java/com/threerings/media/tile/TileMultiFrameImage.java
index <HASH>..<HASH> 100644
--- a/src/java/com/threerings/media/tile/TileMultiFrameImage.java
+++ b/src/java/com/threerings/media/tile/TileMultiFrameImage.java
@@ -39,6 +39,7 @@ public class TileMultiFrameImage implements MultiFrameImage
public TileMultiFrameImage (TileSet source)
{
_source = source;
+ _tileCount = _source.getTileCount();
}
/**
@@ -53,7 +54,7 @@ public class TileMultiFrameImage implements MultiFrameImage
// documentation inherited from interface
public int getFrameCount ()
{
- return _source.getTileCount();
+ return _tileCount;
}
// documentation inherited from interface
@@ -81,4 +82,7 @@ public class TileMultiFrameImage implements MultiFrameImage
}
protected TileSet _source;
+
+ /** The number of tiles in the source image. */
+ protected int _tileCount;
} | Rather than getting the tile count from the raw image each time (as TileSet.getTileCount does for certain tilesets), keep a copy of the number of tiles we're counting.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@<I> ed5b<I>cb-e<I>-<I>-a<I>-f6a<I>f<I>b<I> | threerings_nenya | train | java |
0d00235b6e473f51cf835f8cd627c4ef9675f67b | diff --git a/packages/core/spec/share/asciidoctor-spec.js b/packages/core/spec/share/asciidoctor-spec.js
index <HASH>..<HASH> 100644
--- a/packages/core/spec/share/asciidoctor-spec.js
+++ b/packages/core/spec/share/asciidoctor-spec.js
@@ -356,7 +356,13 @@ doc.convert() // <3>
const blocks = doc.getBlocks()
expect(blocks.length).to.equal(2)
// preamble
- expect(blocks[0].getLineNumber()).to.be.undefined()
+ if (testOptions.coreVersion.gte('2.0.11')) {
+ expect(blocks[0].getLineNumber()).to.equal(3)
+ } else {
+ // before 2.0.11, the source location was not available on a preamble block
+ // https://github.com/asciidoctor/asciidoctor/issues/3799
+ expect(blocks[0].getLineNumber()).to.be.undefined()
+ }
expect(blocks[0].getBlocks().length).to.equal(1)
expect(blocks[0].getBlocks()[0].getLineNumber()).to.equal(3)
// first section | ✅ source_location is now available on preamble block when sourcemap is enabled (#<I>) | asciidoctor_asciidoctor.js | train | js |
12c2dd8106475e6dc37f54afa2664c8edcf60837 | diff --git a/src/geolocation/component.js b/src/geolocation/component.js
index <HASH>..<HASH> 100644
--- a/src/geolocation/component.js
+++ b/src/geolocation/component.js
@@ -329,7 +329,7 @@ Controller.prototype.setPosition_ = function () {
if (this.follow_) {
this.viewChangedByMe_ = true;
- if (this.options.zoom !== undefined) {
+ if (this.options.zoom || this.options.zoom === 0) {
view.setCenter(position);
view.setZoom(this.options.zoom);
} else if (accuracy instanceof Polygon) { | If zoom is undefined or null condition | camptocamp_ngeo | train | js |
3e83f6899a516430ee7e394737614f349a6df160 | diff --git a/lib/etl.rb b/lib/etl.rb
index <HASH>..<HASH> 100644
--- a/lib/etl.rb
+++ b/lib/etl.rb
@@ -49,6 +49,17 @@ else
require 'csv'
end
+# patch for https://github.com/activewarehouse/activewarehouse-etl/issues/24
+# allow components to require optional gems
+class Object
+ def optional_require(feature)
+ begin
+ require feature
+ rescue LoadError
+ end
+ end
+end
+
$:.unshift(File.dirname(__FILE__))
require 'etl/core_ext' | Implement optional_require to allow to attempt loading of gems. | activewarehouse_activewarehouse-etl | train | rb |
0ca6e3d92a41d34c4958ef430fbac6e6bb98cedd | diff --git a/Vps/Benchmark.php b/Vps/Benchmark.php
index <HASH>..<HASH> 100644
--- a/Vps/Benchmark.php
+++ b/Vps/Benchmark.php
@@ -227,6 +227,19 @@ class Vps_Benchmark
final public static function shutDown()
{
+ if (function_exists('xhprof_disable') && file_exists('/www/public/niko/xhprof')) {
+ //TODO irgendwie intelligenter aktivieren/deaktivieren
+ $xhprof_data = xhprof_disable();
+ if ($xhprof_data) {
+ $XHPROF_ROOT = '/www/public/niko/xhprof';
+ include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_lib.php";
+ include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_runs.php";
+ $xhprof_runs = new XHProfRuns_Default();
+ $run_id = $xhprof_runs->save_run($xhprof_data, "xhprof_benchmark");
+ echo "http://xhprof.niko.vivid/xhprof_html/index.php?run=$run_id&source=xhprof_benchmark";
+ }
+ }
+
if (!self::$_logEnabled) return;
static $wasCalled = false; | xhprof moeglich - disable in shutdown rein | koala-framework_koala-framework | train | php |
abe0f0d8072081457b6adca8f187c384c19e5b84 | diff --git a/cdm/src/main/java/ucar/nc2/ft/point/standard/plug/Madis.java b/cdm/src/main/java/ucar/nc2/ft/point/standard/plug/Madis.java
index <HASH>..<HASH> 100644
--- a/cdm/src/main/java/ucar/nc2/ft/point/standard/plug/Madis.java
+++ b/cdm/src/main/java/ucar/nc2/ft/point/standard/plug/Madis.java
@@ -167,7 +167,7 @@ public class Madis extends TableConfigurerImpl {
obs.stnDesc = vn.stnDesc;
obs.lat = vn.lat;
obs.lon = vn.lon;
- obs.elev = vn.elev;
+ obs.stnAlt = vn.elev;
stnTable.addChild(obs);
@@ -234,7 +234,10 @@ public class Madis extends TableConfigurerImpl {
vn.stnId = val;
}
- vn.elev = "altitude";
+ if (null != ds.findVariable("altitude"))
+ vn.elev = "altitude";
+ else if (null != ds.findVariable("elevation"))
+ vn.elev = "elevation";
return vn;
} | MADIS/AWIPS station profile improvements to plugin | Unidata_thredds | train | java |
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.