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 |
|---|---|---|---|---|---|
de5aff655d85d15133c9275361716dd1b5177cb5 | diff --git a/salt/state.py b/salt/state.py
index <HASH>..<HASH> 100644
--- a/salt/state.py
+++ b/salt/state.py
@@ -636,7 +636,7 @@ class State(object):
elif data['fun'] == 'symlink':
if 'bin' in data['name']:
self.module_refresh()
- elif data['state'] == 'pkg':
+ elif data['state'] in ('pkg', 'ports'):
self.module_refresh()
def verify_ret(self, ret): | Reload modules when a ports state installs packages
Since ports states modify the package database, the pkg database should
be reloaded when a port is installed. | saltstack_salt | train | py |
0f9dde314aa58379a5750925a8fcdc407f0df179 | diff --git a/src/CurrencyLoader.php b/src/CurrencyLoader.php
index <HASH>..<HASH> 100644
--- a/src/CurrencyLoader.php
+++ b/src/CurrencyLoader.php
@@ -35,6 +35,12 @@ class CurrencyLoader
}
}
- return static::$currencies[$list];
+ $currencies = array_filter(array_unique(static::$currencies[$list]), function ($item) {
+ return is_string($item);
+ });
+
+ sort($currencies);
+
+ return array_combine($currencies, $currencies);
}
} | Filter, sort, and check currencies uniqueness and fix returned array keys | rinvex_countries | train | php |
0b3198d600d261eb00021bcad1669faffe02aadf | diff --git a/reactfx/src/main/java/org/reactfx/EventStream.java b/reactfx/src/main/java/org/reactfx/EventStream.java
index <HASH>..<HASH> 100644
--- a/reactfx/src/main/java/org/reactfx/EventStream.java
+++ b/reactfx/src/main/java/org/reactfx/EventStream.java
@@ -1159,10 +1159,9 @@ public interface EventStream<T> extends Observable<Consumer<? super T>> {
* );
* }
* </pre>
- * Returns B. The first time A emits an event, B emits the result of
- * applying the reduction function: reduction(unit, mostRecent_A_EventEmitted).
- * For every event emitted after that, B emits the result of applying the
- * reduction function on those events.
+ * Returns B. When A emits an event, B emits the result of
+ * applying the reduction function on those events. When A emits its first
+ * event, B supplies Unit as the 'lastStored_A_Event'.
* <pre>
* Time --->
* A :-"Cake"--"Sugar"--"Oil"--"French Toast"---"Cookie"-----> | Clarified javadoc wording in `accumulate(U unit, BiFunction reduction)` | TomasMikula_ReactFX | train | java |
94ef9a5e976a39e884d44a26a54509b34d820a28 | diff --git a/tests/library/IBAN/Generation/IBANGeneratorTest.php b/tests/library/IBAN/Generation/IBANGeneratorTest.php
index <HASH>..<HASH> 100644
--- a/tests/library/IBAN/Generation/IBANGeneratorTest.php
+++ b/tests/library/IBAN/Generation/IBANGeneratorTest.php
@@ -56,6 +56,11 @@ class IBANGeneratorTest extends \PHPUnit_Framework_TestCase
$this->assertIban('MT84MALT011000012345MTLCAST001S', IBANGenerator::MT('MALT' . '01100', '0012345MTLCAST001S'));
}
+ public function testGenerateIbanAT()
+ {
+ $this->asserIban('AT131490022010010999', IBANGenerator::AT('14900', '22010010999'));
+ }
+
/**
* @expectedException Exception
*/ | added an iban generation rule test for austria | jschaedl_Iban | train | php |
d99c41011748ed7a6ac5b0ecf2f02b95d5441563 | diff --git a/tests/TestCase/ORM/QueryTest.php b/tests/TestCase/ORM/QueryTest.php
index <HASH>..<HASH> 100644
--- a/tests/TestCase/ORM/QueryTest.php
+++ b/tests/TestCase/ORM/QueryTest.php
@@ -3477,22 +3477,16 @@ class QueryTest extends TestCase
],
];
$this->assertEquals($expected, $results->toList());
- $table->deleteAll([]);
- $newArticle = $table->newEntity([
- 'title' => 'Fourth Article',
- 'body' => 'Fourth Article Body',
- 'published' => 'N',
- ]);
- $table->save($newArticle);
$results = $table
->find()
->disableHydration()
->contain('Authors')
->leftJoinWith('Authors')
+ ->where(['Articles.author_id is' => null])
->all();
$expected = [
[
- 'id' => 5,
+ 'id' => 4,
'author_id' => null,
'title' => 'Fourth Article',
'body' => 'Fourth Article Body', | Change test case removing second insert replacing by a where clause on the second assert | cakephp_cakephp | train | php |
072b49c33e8556e5822010b3e041a8173d8354f7 | diff --git a/src/Api/ReadableInterface.php b/src/Api/ReadableInterface.php
index <HASH>..<HASH> 100644
--- a/src/Api/ReadableInterface.php
+++ b/src/Api/ReadableInterface.php
@@ -26,7 +26,7 @@ interface ReadableInterface {
* @todo Document this parameter.
*
* @return array
- * An array of records.
+ * An associative array representing the desired record.
*/
public function show($id, $depth, $extensions);
diff --git a/src/Api/SearchableInterface.php b/src/Api/SearchableInterface.php
index <HASH>..<HASH> 100644
--- a/src/Api/SearchableInterface.php
+++ b/src/Api/SearchableInterface.php
@@ -2,7 +2,7 @@
/**
* @file
- * Contains \Eloqua\Api\SearchableInterface.php
+ * Contains \Eloqua\Api\SearchableInterface
*/
namespace Eloqua\Api; | Minor updates to interface documentation. [ci skip] | tableau-mkt_elomentary | train | php,php |
dde1d3462f8914a0200de41294d8ec6561185eae | diff --git a/src/Symfony/Component/Intl/Intl.php b/src/Symfony/Component/Intl/Intl.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/Intl/Intl.php
+++ b/src/Symfony/Component/Intl/Intl.php
@@ -245,7 +245,9 @@ class Intl
public static function getIcuVersion()
{
if (false === self::$icuVersion) {
- if (defined('INTL_ICU_VERSION')) {
+ if (!self::isExtensionLoaded()) {
+ self::$icuVersion = self::getIcuStubVersion();
+ } elseif (defined('INTL_ICU_VERSION')) {
self::$icuVersion = INTL_ICU_VERSION;
} else {
try { | [Intl] Changed Intl::getIcuVersion() to return the stub version if the intl extension is not loaded | symfony_symfony | train | php |
5e7cd3322b04f1dd207829b70546bc7ffdd63363 | diff --git a/python/pyspark/ml/util.py b/python/pyspark/ml/util.py
index <HASH>..<HASH> 100644
--- a/python/pyspark/ml/util.py
+++ b/python/pyspark/ml/util.py
@@ -17,6 +17,7 @@
import sys
import uuid
+import warnings
if sys.version > '3':
basestring = str | [SPARK-<I>][ML][PYTHON] Import warnings in pyspark.ml.util
## What changes were proposed in this pull request?
Add missing `warnings` import.
## How was this patch tested?
Manual tests. | apache_spark | train | py |
2bd140300eb0aa63b78a930463ca4c81fa2546bb | diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index <HASH>..<HASH> 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -1678,7 +1678,14 @@ def _replace_zip_directory_cache_data(normalized_path):
# documented anywhere and could in theory change with new Python releases)
# for no significant benefit.
for p in to_update:
- old_entry = cache.pop(p)
+ # N.B. pypy uses a custom zipimport._zip_directory_cache implementation
+ # class that does not support the complete dict interface, e.g. it does
+ # not support the dict.pop() method. For more detailed information see
+ # the following links:
+ # https://bitbucket.org/pypa/setuptools/issue/202/more-robust-zipimporter-cache-invalidation#comment-10495960
+ # https://bitbucket.org/pypy/pypy/src/dd07756a34a41f674c0cacfbc8ae1d4cc9ea2ae4/pypy/module/zipimport/interp_zipimport.py#cl-99
+ old_entry = cache[p]
+ del cache[p]
zipimport.zipimporter(p)
old_entry.clear()
old_entry.update(cache[p]) | fix clearing zipimport._zip_directory_cache on pypy
pypy uses a custom zipimport._zip_directory_cache implementation class that
does not support the complete dict interface, e.g. it does not support the
dict.pop() method.
For more detailed information see the following links:
<URL> | pypa_setuptools | train | py |
58d643ba9f6613ce0c428bb686b06dd344bb54d4 | diff --git a/Framework/Request.php b/Framework/Request.php
index <HASH>..<HASH> 100644
--- a/Framework/Request.php
+++ b/Framework/Request.php
@@ -54,6 +54,11 @@ public function __construct($config, $t) {
$seconds = empty($_GET["FakeSlow"])
? 2 : $_GET["FakeSlow"];
+ if($_GET["FakeSlow"] == 0) {
+ unset($_GET["FakeSlow"]);
+ $seconds = 0;
+ }
+
if(isset($_GET["FakeSlow"])) {
$_SESSION["FakeSlow"] = $_GET["FakeSlow"];
} | Allow removal of fakeslow with FakeSlow=0 | PhpGt_WebEngine | train | php |
e69ba7ce764fa1db566cada06c7b502c802344cc | diff --git a/src/hdnode.js b/src/hdnode.js
index <HASH>..<HASH> 100644
--- a/src/hdnode.js
+++ b/src/hdnode.js
@@ -31,6 +31,7 @@ function HDNode(K, chainCode, network) {
network = network || networks.bitcoin
assert(Buffer.isBuffer(chainCode), 'Expected Buffer, got ' + chainCode)
+ assert.equal(chainCode.length, 32, 'Expected chainCode length of 32, got ' + chainCode.length)
assert(network.bip32, 'Unknown BIP32 constants for network')
this.chainCode = chainCode
diff --git a/test/hdnode.js b/test/hdnode.js
index <HASH>..<HASH> 100644
--- a/test/hdnode.js
+++ b/test/hdnode.js
@@ -49,7 +49,13 @@ describe('HDNode', function() {
assert.equal(hd.network, networks.testnet)
})
- it('throws an exception when an unknown network is given', function() {
+ it('throws when an invalid length chain code is given', function() {
+ assert.throws(function() {
+ new HDNode(d, chainCode.slice(0, 20), networks.testnet)
+ }, /Expected chainCode length of 32, got 20/)
+ })
+
+ it('throws when an unknown network is given', function() {
assert.throws(function() {
new HDNode(d, chainCode, {})
}, /Unknown BIP32 constants for network/) | HDNode: assert chain code length | BitGo_bitgo-utxo-lib | train | js,js |
81cc4cba14e559dac47b691c9e661a741da375ac | diff --git a/SoftLayer/CLI/modules/metadata.py b/SoftLayer/CLI/modules/metadata.py
index <HASH>..<HASH> 100644
--- a/SoftLayer/CLI/modules/metadata.py
+++ b/SoftLayer/CLI/modules/metadata.py
@@ -193,7 +193,6 @@ usage: sl metadata network (<public> | <private>) [options]
Get details about the public or private network
"""
- """ details about either the public or private network """
action = 'network'
@staticmethod | Removes lingering refactor comment | softlayer_softlayer-python | train | py |
7f9c68fc28969fc4557896f90202f3453d8bd799 | diff --git a/fibers.js b/fibers.js
index <HASH>..<HASH> 100644
--- a/fibers.js
+++ b/fibers.js
@@ -86,13 +86,23 @@ function setupAsyncHacks(Fiber) {
}
function logUsingFibers(fibersMethod) {
- const { ENABLE_LOG_USE_FIBERS } = process.env;
+ const logUseFibersLevel = +(process.env.ENABLE_LOG_USE_FIBERS || 0);
- if (!ENABLE_LOG_USE_FIBERS) return;
+ if (!logUseFibersLevel) return;
- console.warn(`[FIBERS_LOG] Using ${fibersMethod}.`);
- if (ENABLE_LOG_USE_FIBERS > 1) {
- console.trace();
+ if (logUseFibersLevel === 1) {
+ console.warn(`[FIBERS_LOG] Using ${fibersMethod}.`);
+ return;
+ }
+
+ const { LOG_USE_FIBERS_INCLUDE_IN_PATH } = process.env;
+ const stackFromError = new Error("[FIBERS_LOG]").stack;
+
+ if (
+ !LOG_USE_FIBERS_INCLUDE_IN_PATH ||
+ stackFromError.includes(LOG_USE_FIBERS_INCLUDE_IN_PATH)
+ ) {
+ console.warn(stackFromError);
}
} | Enable log stack when includes string passed by environment variable LOG_USE_FIBERS_INCLUDE_IN_PATH | laverdet_node-fibers | train | js |
81a2a6c429e08554f2cba9719aaeaf5be0753e45 | diff --git a/examples/with-semantic-ui/pages/_document.js b/examples/with-semantic-ui/pages/_document.js
index <HASH>..<HASH> 100644
--- a/examples/with-semantic-ui/pages/_document.js
+++ b/examples/with-semantic-ui/pages/_document.js
@@ -4,9 +4,7 @@ export default class MyDocument extends Document {
render () {
return (
<html>
- <Head>
- <link rel='stylesheet' href='/_next/static/style.css' />
- </Head>
+ <Head />
<body>
<Main />
<NextScript /> | Removing link ref style.css (#<I>)
This link ref is no more necessary to include in the Head Section. It cause error <I> in the console: <URL> | zeit_next.js | train | js |
818cd1b45bd3863799b25005da68b6a8a0cd1373 | diff --git a/tests/functional/test_requests.py b/tests/functional/test_requests.py
index <HASH>..<HASH> 100644
--- a/tests/functional/test_requests.py
+++ b/tests/functional/test_requests.py
@@ -273,6 +273,7 @@ def test_httpretty_ignores_querystrings_from_registered_uri(now):
expect(HTTPretty.last_request.path).to.equal('/?id=123')
+@skip('TODO: fix me')
@httprettified
@within(five=microseconds)
def test_streaming_responses(now): | comment failing test temporarily to test github actions | gabrielfalcao_HTTPretty | train | py |
0a20dbe0c9ae82913af82030b5cc542a837a0edf | diff --git a/seaglass/trunk/seaglass/src/main/java/com/seaglass/component/SeaGlassBorder.java b/seaglass/trunk/seaglass/src/main/java/com/seaglass/component/SeaGlassBorder.java
index <HASH>..<HASH> 100644
--- a/seaglass/trunk/seaglass/src/main/java/com/seaglass/component/SeaGlassBorder.java
+++ b/seaglass/trunk/seaglass/src/main/java/com/seaglass/component/SeaGlassBorder.java
@@ -44,7 +44,7 @@ import sun.swing.plaf.synth.SynthUI;
*
* Based on SynthBorder by Scott Violet.
*
- * @see javax.swing.play.synth.SynthBorder
+ * @see javax.swing.plaf.synth.SynthBorder
*/
public class SeaGlassBorder extends AbstractBorder implements UIResource {
private SynthUI ui; | Fixed spelling of package in @see. | khuxtable_seaglass | train | java |
b9f5aa3743e3347d37b81ffbdba935334144e22c | diff --git a/random_name/random_name.py b/random_name/random_name.py
index <HASH>..<HASH> 100644
--- a/random_name/random_name.py
+++ b/random_name/random_name.py
@@ -53,7 +53,7 @@ class random_name(object):
"""Generate a random name from an arbitary set of files"""
- def __init__(self, namefiles=None, max_frequencies=None, nameformat='{given} {surname}', **kwargs):
+ def __init__(self, nameformat='{given} {surname}', namefiles=None, max_frequencies=None, **kwargs):
self.namefiles = namefiles or NAMEFILES
if self.namefiles == NAMEFILES:
@@ -131,5 +131,5 @@ class random_name(object):
if __name__ == '__main__':
# In the absence of tests, as least make sure specifying arguments doesn't break anything:
- rn = random_name(NAMEFILES, MAX_FREQUENCIES, '{given} {surname}', csv_args={'delimiter': ','})
+ rn = random_name('{given} {surname}', NAMEFILES, MAX_FREQUENCIES, csv_args={'delimiter': ','})
print rn.generate() | Make 1st arg name_format | fitnr_censusname | train | py |
905b39e007b2686333e81cc5ec8a8758ccfca0e1 | diff --git a/build.js b/build.js
index <HASH>..<HASH> 100755
--- a/build.js
+++ b/build.js
@@ -144,6 +144,8 @@ function ghp() {
// temporary - put index.html back to normal
fs.renameSync('./docs/index-temp.html', './docs/index.html');
wrench.copyDirSyncRecursive('./sdk/docs', '../gh-pages/sdk/docs');
+ //delete the /src on gh-pages, we don't need it.
+ wrench.rmdirSyncRecursive('../gh-pages/src');
console.log('COMPLETE');
processOptionQueue(); | updated build to delete /gh-pages/src after dirSync | OpenF2_F2 | train | js |
12d198bd3f9c3eb9d6aa2beaeec35e38b5d8d56d | diff --git a/src/invariant.js b/src/invariant.js
index <HASH>..<HASH> 100644
--- a/src/invariant.js
+++ b/src/invariant.js
@@ -5,22 +5,17 @@
* @param {boolean} condition
* @param {string} message
*/
-const NODE_ENV = process.env.NODE_ENV
-let invariant = function() {}
-
-if (NODE_ENV !== 'production') {
- invariant = function(condition, message) {
- if (message === undefined) {
- throw new Error('invariant requires an error message argument')
- }
+function invariant(condition, message) {
+ if (message === undefined) {
+ throw new Error('invariant requires an error message argument')
+ }
- let error
+ let error
- if (!condition) {
- error = new Error(message)
- error.name = 'Invariant Violation'
- throw error
- }
+ if (!condition) {
+ error = new Error(message)
+ error.name = 'Invariant Violation'
+ throw error
}
} | refactor: remove node env branch | chikara-chan_invincible | train | js |
2b2be540aba5b7a2bcfb9a98e8cb7873b1cc560d | diff --git a/src/main/java/water/fvec/Vec.java b/src/main/java/water/fvec/Vec.java
index <HASH>..<HASH> 100644
--- a/src/main/java/water/fvec/Vec.java
+++ b/src/main/java/water/fvec/Vec.java
@@ -192,8 +192,14 @@ public class Vec extends Iced {
if( _naCnt >= 0 ) return this;
Vec vthis = DKV.get(_key).get();
if( vthis._naCnt==-2 ) throw new IllegalArgumentException("Cannot ask for roll-up stats while the vector is being actively written.");
- if( vthis._naCnt>= 0 ) return vthis;
-
+ if( vthis._naCnt>= 0 ) { // KV store has a better answer
+ _min = vthis._min; _max = vthis._max;
+ _mean = vthis._mean; _sigma = vthis._sigma;
+ _size = vthis._size; _isInt = vthis._isInt;
+ _naCnt= vthis._naCnt; // Volatile write last to announce all stats ready
+ return this;
+ }
+ // Compute the hard way
final RollupStats rs = new RollupStats().doAll(this);
setRollupStats(rs);
// Now do this remotely also | Vec gathers rollups into self | h2oai_h2o-2 | train | java |
abc176dbb1b151ed8962ddd6613283811467b784 | diff --git a/plugins/org.eclipse.xtext/src/org/eclipse/xtext/parser/antlr/AbstractAntlrParser.java b/plugins/org.eclipse.xtext/src/org/eclipse/xtext/parser/antlr/AbstractAntlrParser.java
index <HASH>..<HASH> 100644
--- a/plugins/org.eclipse.xtext/src/org/eclipse/xtext/parser/antlr/AbstractAntlrParser.java
+++ b/plugins/org.eclipse.xtext/src/org/eclipse/xtext/parser/antlr/AbstractAntlrParser.java
@@ -99,9 +99,10 @@ public abstract class AbstractAntlrParser extends Parser {
}
private EObject getGrammarElement(String grammarElementID) {
- URI resolved = new ClassloaderClasspathUriResolver().resolve(getClass().getClassLoader(), URI
- .createURI(grammarElementID));
- return grammar.eResource().getResourceSet().getEObject(resolved, true);
+ URI uri = URI
+ .createURI(grammarElementID);
+// URI resolved = new ClassloaderClasspathUriResolver().resolve(getClass().getClassLoader(), uri);
+ return grammar.eResource().getResourceSet().getEObject(uri, true);
}
private Map<Integer, String> antlrTypeToLexerName = null; | removed explicite usage of classpathuri resolver. The grammar is loaded via XtextResourceSetImpl, which contains and uses the ClassPathURIResolver. | eclipse_xtext-core | train | java |
1611ee74cc4e8bb28d7add42175932119562bdc0 | diff --git a/core/src/main/java/org/infinispan/persistence/file/SingleFileStore.java b/core/src/main/java/org/infinispan/persistence/file/SingleFileStore.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/infinispan/persistence/file/SingleFileStore.java
+++ b/core/src/main/java/org/infinispan/persistence/file/SingleFileStore.java
@@ -97,10 +97,10 @@ public class SingleFileStore implements AdvancedLoadWriteStore {
File f = new File(location + File.separator + ctx.getCache().getName() + ".dat");
if (!f.exists()) {
- File dir = f.getParentFile();
- if (!dir.exists() && !dir.mkdirs()) {
- throw log.directoryCannotBeCreated(dir.getAbsolutePath());
- }
+ File dir = f.getParentFile();
+ if (!dir.mkdirs() && !dir.exists()) {
+ throw log.directoryCannotBeCreated(dir.getAbsolutePath());
+ }
}
file = new RandomAccessFile(f, "rw").getChannel(); | ISPN-<I> SingleFileStore.start() often fails on File.mkdirs() during concurrent cache startup
File.mkdirs() can fail if multiple concurrent threads attempt to create the same directory | infinispan_infinispan | train | java |
ce7026157658adfcde87de930ccfe4af7a391d79 | diff --git a/cumulusci/utils.py b/cumulusci/utils.py
index <HASH>..<HASH> 100644
--- a/cumulusci/utils.py
+++ b/cumulusci/utils.py
@@ -521,7 +521,7 @@ def get_cci_upgrade_command():
def convert_to_snake_case(content):
- s1 = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", content)
+ s1 = re.sub("([^_])([A-Z][a-z]+)", r"\1_\2", content)
return re.sub("([a-z0-9])([A-Z])", r"\1_\2", s1).lower() | Don't add underscores where there are some already | SFDO-Tooling_CumulusCI | train | py |
70dae192e31e71b7e5d72b8c967396f20d526fc0 | diff --git a/timeside/server/management/commands/timeside-create-boilerplate.py b/timeside/server/management/commands/timeside-create-boilerplate.py
index <HASH>..<HASH> 100644
--- a/timeside/server/management/commands/timeside-create-boilerplate.py
+++ b/timeside/server/management/commands/timeside-create-boilerplate.py
@@ -132,7 +132,12 @@ class Command(BaseCommand):
providers = timeside.core.provider.providers(timeside.core.api.IProvider)
for prov in providers:
- provider, c = Provider.objects.get_or_create(pid=prov.id())
+ provider, c = Provider.objects.get_or_create(
+ pid=prov.id(),
+ source_access=prov.ressource_access(),
+ description=prov.description(),
+ name=prov.name()
+ )
# ---------- Experience All ----------
experience, c = Experience.objects.get_or_create(title='All') | [server] add source_access and description to providers while startin timeside server app in boilerplate #<I> | Parisson_TimeSide | train | py |
86075d522dcf71ba003d15233b5ddb418a4025a1 | diff --git a/bblfsh/launcher.py b/bblfsh/launcher.py
index <HASH>..<HASH> 100644
--- a/bblfsh/launcher.py
+++ b/bblfsh/launcher.py
@@ -20,13 +20,13 @@ def ensure_bblfsh_is_running():
)
log.warning(
"Launched the Babelfish server (name bblfsh, id %s).\nStop it "
- "with: docker rm -f bblfsh\n", container.id)
+ "with: docker rm -f bblfsh", container.id)
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
result = -1
while result != 0:
time.sleep(0.1)
result = sock.connect_ex(("0.0.0.0", 9432))
- log.warning("Babelfish server is up and running.\n")
+ log.warning("Babelfish server is up and running.")
return False
finally:
client.api.close() | Remove redundant \n in logs | bblfsh_client-python | train | py |
fe9f85659f337938c77a09e9eca81f46c161a82d | diff --git a/tests/TestCase/Http/Cookie/CookieCollectionTest.php b/tests/TestCase/Http/Cookie/CookieCollectionTest.php
index <HASH>..<HASH> 100644
--- a/tests/TestCase/Http/Cookie/CookieCollectionTest.php
+++ b/tests/TestCase/Http/Cookie/CookieCollectionTest.php
@@ -408,7 +408,7 @@ class CookieCollectionTest extends TestCase
->add(new Cookie('expired', 'ex', new DateTime('-2 seconds'), '/', 'example.com'));
$request = new ClientRequest('http://example.com/api');
$request = $collection->addToRequest($request, ['b' => 'B']);
- $this->assertSame('api=A; b=B', $request->getHeaderLine('Cookie'));
+ $this->assertSame('b=B; api=A', $request->getHeaderLine('Cookie'));
$request = new ClientRequest('http://example.com/api');
$request = $collection->addToRequest($request, ['api' => 'custom']); | Update CookieCollectionTest.php | cakephp_cakephp | train | php |
d1d5c67d5ddd6d3503b83ad9a7b30d6ef0c9485d | diff --git a/spec/unit/converters/convert_file_spec.rb b/spec/unit/converters/convert_file_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/converters/convert_file_spec.rb
+++ b/spec/unit/converters/convert_file_spec.rb
@@ -7,8 +7,9 @@ RSpec.describe TTY::Prompt::Question, 'convert file' do
prompt.input << "test.txt"
prompt.input.rewind
+ allow(::File).to receive(:dirname).and_return('.')
+ allow(::File).to receive(:join).and_return("test\.txt")
allow(::File).to receive(:open).with(/test\.txt/).and_return(file)
- expect(::File).to receive(:open).with(/test\.txt/)
answer = prompt.ask("Which file to open?", convert: :file) | Change to stub all dependent constants | piotrmurach_tty-prompt | train | rb |
4ec3d3e5b38187f5dde8cc1e05bb96ba70148898 | diff --git a/src/wyjc/io/ClassFileBuilder.java b/src/wyjc/io/ClassFileBuilder.java
index <HASH>..<HASH> 100755
--- a/src/wyjc/io/ClassFileBuilder.java
+++ b/src/wyjc/io/ClassFileBuilder.java
@@ -554,6 +554,7 @@ public class ClassFileBuilder {
String name = "constant$" + id;
JvmType type = convertType(constant.type());
bytecodes.add(new Bytecode.GetField(owner, name, type, Bytecode.STATIC));
+ addIncRefs(constant.type(),bytecodes);
}
} | Bug fix for constants and reference counting. | Whiley_WhileyCompiler | train | java |
d639bf62a7a4804d95278bfac8cabed16a5ee7a8 | diff --git a/widgets/assets/FxsAssets.php b/widgets/assets/FxsAssets.php
index <HASH>..<HASH> 100755
--- a/widgets/assets/FxsAssets.php
+++ b/widgets/assets/FxsAssets.php
@@ -26,7 +26,7 @@ class FxsAssets extends \yii\web\AssetBundle {
// Define dependent Asset Loaders
public $depends = [
- 'yii\web\JqueryAsset'
+ 'cmsgears\core\common\assets\Jquery'
];
// Protected --------------
@@ -72,3 +72,4 @@ class FxsAssets extends \yii\web\AssetBundle {
// FxsAssets -----------------------------
}
+ | Updated jquery asset. | foxslider_cmg-plugin | train | php |
8d0779c20a51bf3a9af604ed893182ba408ef5ab | diff --git a/lib/js-yaml/dumper.js b/lib/js-yaml/dumper.js
index <HASH>..<HASH> 100644
--- a/lib/js-yaml/dumper.js
+++ b/lib/js-yaml/dumper.js
@@ -226,9 +226,12 @@ function writeScalar(state, object, level) {
spaceWrap = (CHAR_SPACE === first ||
CHAR_SPACE === object.charCodeAt(object.length - 1));
- // A string starting with - or ? may be introducing a magic yaml thing.
- // Err on the side of caution and never treat these as simple scalars.
- if (CHAR_MINUS === first || CHAR_QUESTION === first) {
+ // Simplified check for restricted first characters
+ // http://www.yaml.org/spec/1.2/spec.html#ns-plain-first%28c%29
+ if (CHAR_MINUS === first ||
+ CHAR_QUESTION === first ||
+ CHAR_COMMERCIAL_AT === first ||
+ CHAR_GRAVE_ACCENT === first) {
simple = false;
}
@@ -485,9 +488,7 @@ function simpleChar(character) {
CHAR_SINGLE_QUOTE !== character &&
CHAR_DOUBLE_QUOTE !== character &&
CHAR_PERCENT !== character &&
- CHAR_COMMERCIAL_AT !== character &&
CHAR_COLON !== character &&
- CHAR_GRAVE_ACCENT !== character &&
!ESCAPE_SEQUENCES[character] &&
!needsHexEscape(character);
} | Dumper: allow use of reserved chars in middle of plain scalars | nodeca_js-yaml | train | js |
21b833636fef1698b3bf80252a1e2bd89de4dcb4 | diff --git a/pgmagick/api.py b/pgmagick/api.py
index <HASH>..<HASH> 100644
--- a/pgmagick/api.py
+++ b/pgmagick/api.py
@@ -713,7 +713,7 @@ class Image(object):
if filter_type:
filter_type = getattr(pgmagick.FilterTypes,
"%sFilter" % filter_type.title())
- pgmagick.Image.filterType(self, filter_type)
+ pgmagick.Image.filterType(self.img, filter_type)
geometry = pgmagick.Geometry(size)
self.img.scale(geometry) | fixed: unable to filterType in pgmagick.api.Image.scale() | hhatto_pgmagick | train | py |
7cb2f7cfd50aacf6e6dcf44ae3fbff53d6b8727a | diff --git a/src/button.js b/src/button.js
index <HASH>..<HASH> 100644
--- a/src/button.js
+++ b/src/button.js
@@ -55,7 +55,7 @@ $.ButtonState = {
/**
* @class Button
* @classdesc Manages events, hover states for individual buttons, tool-tips, as well
- * as fading the bottons out when the user has not interacted with them
+ * as fading the buttons out when the user has not interacted with them
* for a specified period.
*
* @memberof OpenSeadragon
diff --git a/src/openseadragon.js b/src/openseadragon.js
index <HASH>..<HASH> 100644
--- a/src/openseadragon.js
+++ b/src/openseadragon.js
@@ -148,7 +148,7 @@
* @property {OpenSeadragon.NavImages} [navImages]
* An object with a property for each button or other built-in navigation
* control, eg the current 'zoomIn', 'zoomOut', 'home', and 'fullpage'.
- * Each of those in turn provides an image path for each state of the botton
+ * Each of those in turn provides an image path for each state of the button
* or navigation control, eg 'REST', 'GROUP', 'HOVER', 'PRESS'. Finally the
* image paths, by default assume there is a folder on the servers root path
* called '/images', eg '/images/zoomin_rest.png'. If you need to adjust | Updated Doclets
Botton fixes :) | openseadragon_openseadragon | train | js,js |
4421b184b72d95636d3769d4bea47d030ec7c466 | diff --git a/spec/authy/onetouch_spec.rb b/spec/authy/onetouch_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/authy/onetouch_spec.rb
+++ b/spec/authy/onetouch_spec.rb
@@ -28,6 +28,33 @@ describe Authy::OneTouch do
expect(response).to be_kind_of(Authy::Response)
expect(response).to be_ok
end
+
+ it 'requires message as mandatory' do
+ response = Authy::OneTouch.send_approval_request(
+ id: @user.id,
+ details: {
+ 'Bank account' => '23527922',
+ 'Amount' => '10 BTC',
+ },
+ hidden_details: {
+ 'IP Address' => '192.168.0.3'
+ }
+ )
+
+ expect(response).to be_kind_of(Authy::Response)
+ expect(response).to_not be_ok
+ expect(response.message).to eq 'message cannot be blank'
+ end
+
+ it 'does not require other fields as mandatory' do
+ response = Authy::OneTouch.send_approval_request(
+ id: @user.id,
+ message: 'Test message'
+ )
+
+ expect(response).to be_kind_of(Authy::Response)
+ expect(response).to be_ok
+ end
end
describe '.approval_request_status' do | Added more tests for onetouch. | twilio_authy-ruby | train | rb |
448a0ad27109c717a1c42ab72dec50e158d309e5 | diff --git a/Backend/AMQPBackend.php b/Backend/AMQPBackend.php
index <HASH>..<HASH> 100644
--- a/Backend/AMQPBackend.php
+++ b/Backend/AMQPBackend.php
@@ -37,6 +37,9 @@ class AMQPBackend implements BackendInterface
*/
protected $queue;
+ /**
+ * @deprecated since version 2.4 and will be removed in 3.0.
+ */
protected $connection;
/** | connection in AMQPBackend is deprecated | sonata-project_SonataNotificationBundle | train | php |
105f4a05df546821a7bcd75a7d91adc882012c90 | diff --git a/digitalocean/Droplet.py b/digitalocean/Droplet.py
index <HASH>..<HASH> 100644
--- a/digitalocean/Droplet.py
+++ b/digitalocean/Droplet.py
@@ -269,9 +269,14 @@ class Droplet(BaseAPI):
elif type(ssh_key) in [str, unicode]:
key = SSHKey()
key.token = self.token
- key.public_key = ssh_key
- key.name = "SSH Key %s" % self.name
- key.create()
+ results = key.load_by_pub_key(ssh_key)
+
+ if results == None:
+ key.public_key = ssh_key
+ key.name = "SSH Key %s" % self.name
+ key.create()
+ else:
+ key = results
ssh_keys_id.append(key.id)
else: | Using the method to load the public key. In this way we avoid the error when creating a droplet with a ssh key already saved on DigitalOcean but given in string format. | koalalorenzo_python-digitalocean | train | py |
6f46f4bf0ffc6540cb7e09d55ba2968a232b6f73 | diff --git a/btb/tuning/acquisition/numpyargsort.py b/btb/tuning/acquisition/numpyargsort.py
index <HASH>..<HASH> 100644
--- a/btb/tuning/acquisition/numpyargsort.py
+++ b/btb/tuning/acquisition/numpyargsort.py
@@ -11,5 +11,6 @@ class NumpyArgSortFunction(BaseAcquisitionFunction):
def _acquire(self, candidates, num_candidates=1):
scores = candidates if len(candidates.shape) == 1 else candidates[:, 0]
- sorted_scores = list(reversed(np.argsort(scores)))
+ sorted_scores = np.argsort(scores)
+ sorted_scores = list(reversed(sorted_scores)) if self.maximize else list(sorted_scores)
return sorted_scores[:num_candidates] | Update sort depending on maximize or minimze. | HDI-Project_BTB | train | py |
57dab2b446d49c22179bbf8e3e6ae24868891997 | diff --git a/lib/generators/npush/toheroku_generator.rb b/lib/generators/npush/toheroku_generator.rb
index <HASH>..<HASH> 100644
--- a/lib/generators/npush/toheroku_generator.rb
+++ b/lib/generators/npush/toheroku_generator.rb
@@ -35,7 +35,7 @@ module Npush
end
end
- append_file 'app/assets/javascripts/application.js', '//= require socket.io.min.js'
+ prepend_file 'app/assets/javascripts/application.js', '//= require socket.io.min.js'
end
end
end | Prepend requires instead of appending them + add semicolon at the end of client js initializer | skycocker_npush-rails | train | rb |
fe288902fa1e915fee0bf95a1eabe02f0c1d70c8 | diff --git a/src/extensions/scratch3_ev3/index.js b/src/extensions/scratch3_ev3/index.js
index <HASH>..<HASH> 100644
--- a/src/extensions/scratch3_ev3/index.js
+++ b/src/extensions/scratch3_ev3/index.js
@@ -231,14 +231,10 @@ class EV3Motor {
}
/**
- * @return {int} - this motor's current position, in the range [0,360].
+ * @return {int} - this motor's current position, in the range [-inf,inf].
*/
get position () {
- let value = this._position;
- value = value % 360;
- value = value < 0 ? value * -1 : value;
-
- return value;
+ return this._position;
}
/**
@@ -1156,8 +1152,12 @@ class Scratch3Ev3Blocks {
}
const motor = this._peripheral.motor(port);
+ let position = 0;
+ if (motor) {
+ position = MathUtil.wrapClamp(motor.position, 0, 360);
+ }
- return motor ? motor.position : 0;
+ return position;
}
whenButtonPressed (args) { | Fixing #<I>: EV3 motor position reporter gets inverted. | LLK_scratch-vm | train | js |
940c3374b556d5bad13fb8a4d679ef95e7d9cc75 | diff --git a/pybooru/api_danbooru.py b/pybooru/api_danbooru.py
index <HASH>..<HASH> 100644
--- a/pybooru/api_danbooru.py
+++ b/pybooru/api_danbooru.py
@@ -359,3 +359,12 @@ class DanbooruApi(object):
'dmail[body]': body
}
return self._get('dmails.json', params, 'POST', auth=True)
+
+ def dmail_delete(self, dmail_id):
+ """Delete a dmail. You can only delete dmails you own (Requires login).
+
+ Parameters:
+ dmail_id: REQUIRED where dmail_id is the dmail id.
+ """
+ return self._get('dmails/{0}.json'.format(dmail_id), method='DELETE',
+ auth=True) | Danbooru: implement dmail_delete() | LuqueDaniel_pybooru | train | py |
295635d479241943771ca008e530726e2ee950d6 | diff --git a/src/GrumPHP/Task/Php7cc.php b/src/GrumPHP/Task/Php7cc.php
index <HASH>..<HASH> 100644
--- a/src/GrumPHP/Task/Php7cc.php
+++ b/src/GrumPHP/Task/Php7cc.php
@@ -28,7 +28,7 @@ class Php7cc extends AbstractExternalTask
{
$resolver = new OptionsResolver();
$resolver->setDefaults(array(
- 'exclude' => array('vendor'),
+ 'exclude' => array(),
'level' => null,
'triggered_by' => array('php')
)); | Remove the vendor directory from the default exclude directories. | phpro_grumphp | train | php |
cf86c581dda019c1fac75a239060f2abf8cce36e | diff --git a/src/RuntimeServiceProvider.php b/src/RuntimeServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/RuntimeServiceProvider.php
+++ b/src/RuntimeServiceProvider.php
@@ -88,10 +88,15 @@ class RuntimeServiceProvider extends ServiceProvider
Propel::setServiceContainer($serviceContainer);
- $input = new ArgvInput();
+ $command = false;
+
+ if (\App::runningInConsole()) {
+ $input = new ArgvInput();
+ $command = $input->getFirstArgument();
+ }
// skip auth driver adding if running as CLI to avoid auth model not found
- if ('propel:model:build' !== $input->getFirstArgument() && 'propel' === \Config::get('auth.driver')) {
+ if ('propel:model:build' !== $command && 'propel' === \Config::get('auth.driver')) {
$query_name = \Config::get('auth.user_query', false); | Fixed #3, hope that finally. Previous commit fixed partially | propelorm_PropelLaravel | train | php |
43c7623e016b1d8f0fee654ccb26335cedb4c86e | diff --git a/request_logger.go b/request_logger.go
index <HASH>..<HASH> 100644
--- a/request_logger.go
+++ b/request_logger.go
@@ -19,9 +19,15 @@ var RequestLogger = RequestLoggerFunc
// code of the response.
func RequestLoggerFunc(h Handler) Handler {
return func(c Context) error {
+ var irid interface{}
+ if irid = c.Session().Get("requestor_id"); irid == nil {
+ irid = randx.String(10)
+ c.Session().Set("requestor_id", irid)
+ c.Session().Save()
+ }
now := time.Now()
c.LogFields(logrus.Fields{
- "request_id": randx.String(10),
+ "request_id": irid.(string) + "-" + randx.String(10),
"method": c.Request().Method,
"path": c.Request().URL.String(),
}) | improved the "stickiness" of the request_id in logs | gobuffalo_buffalo | train | go |
a0b81423b1c02b15624257300f4a91c5dbd26333 | diff --git a/pyinfra/api/facts.py b/pyinfra/api/facts.py
index <HASH>..<HASH> 100644
--- a/pyinfra/api/facts.py
+++ b/pyinfra/api/facts.py
@@ -173,7 +173,7 @@ def get_facts(state, name, args=None, ensure_hosts=None, apply_failed_hosts=True
with FACT_LOCK:
# Add any hosts we must have, whether considered in the inventory or not
# (these hosts might be outside the --limit or current op limit_hosts).
- hosts = set(state.inventory)
+ hosts = set(state.inventory.iter_active_hosts())
if ensure_hosts:
hosts.update(ensure_hosts) | Only consider active hosts when collecting facts. | Fizzadar_pyinfra | train | py |
75e60ecaf6cefa712d54f9af88b6f23fcd1230ca | diff --git a/packages/node-pico-engine-core/src/signalEventInFiber.js b/packages/node-pico-engine-core/src/signalEventInFiber.js
index <HASH>..<HASH> 100644
--- a/packages/node-pico-engine-core/src/signalEventInFiber.js
+++ b/packages/node-pico-engine-core/src/signalEventInFiber.js
@@ -42,6 +42,9 @@ module.exports = function(ctx, pico_id){
if(_.has(r, "directive")){
r.directives = r.directive;
delete r.directive;
+ }else{
+ //we always want to return a directives array even if it's empty
+ r.directives = [];
}
return r; | {directives: []} | Picolab_pico-engine | train | js |
a281fad5022f7126f0b2eb8d394596a8a2cf3219 | diff --git a/AlphaTwirl/Binning.py b/AlphaTwirl/Binning.py
index <HASH>..<HASH> 100755
--- a/AlphaTwirl/Binning.py
+++ b/AlphaTwirl/Binning.py
@@ -65,6 +65,9 @@ class Round(object):
return [self.__call__(v) for v in val]
except TypeError:
pass
+ return float(self._callImpDecimal(val))
+
+ def _callImpDecimal(self, val):
val = decimal.Decimal(str(val))
ret = (val + self.shift)/self.width
@@ -74,7 +77,7 @@ class Round(object):
ret = ret*self.width - self.shift
if self.lowedge: ret = ret - self.halfWidth
- return float(ret)
+ return ret
##____________________________________________________________________________||
class Echo(object): | split Round.__call__() into two methods | alphatwirl_alphatwirl | train | py |
dc3aa624f224b00f7db1f1b45679463bc375850c | diff --git a/js/data/RestDataSource.js b/js/data/RestDataSource.js
index <HASH>..<HASH> 100644
--- a/js/data/RestDataSource.js
+++ b/js/data/RestDataSource.js
@@ -725,7 +725,7 @@ define(["js/data/DataSource", "js/data/Model", "underscore", "flow", "JSON", "js
type: method,
queryParameter: params
}, function (err, xhr) {
- if (!err && (xhr.status == 200 || xhr.status == 304)) {
+ if (!err && (xhr.status == 200 || xhr.status == 304 || xhr.status == 202)) {
callback(null, model);
} else {
// TODO: better error handling | added status <I> for successful deletion | rappid_rAppid.js | train | js |
56dc260b99b7d0587aadc16da3ef0ef890617adb | diff --git a/classes/debug_bar.php b/classes/debug_bar.php
index <HASH>..<HASH> 100644
--- a/classes/debug_bar.php
+++ b/classes/debug_bar.php
@@ -49,4 +49,8 @@ class Debug_Bar {
<?php
}
+ public function Debug_Bar() {
+ Debug_Bar::__construct();
+ }
+
}
diff --git a/classes/debug_bar_panel.php b/classes/debug_bar_panel.php
index <HASH>..<HASH> 100644
--- a/classes/debug_bar_panel.php
+++ b/classes/debug_bar_panel.php
@@ -62,4 +62,8 @@ abstract class Debug_Bar_Panel {
return $classes;
}
+ public function Debug_Bar_Panel( $title = '' ) {
+ Debug_Bar_Panel::__construct( $title );
+ }
+
} | Add PHP4-style constructors to the Debug Bar classes to avoid fatals with Debug Bar add-ons which are explicitly using them. Fixes #<I>. | johnbillion_query-monitor | train | php,php |
0fd3a3817fb21c7c3f266475792d510089644305 | diff --git a/vendor/plugins/authentication/app/controllers/users_controller.rb b/vendor/plugins/authentication/app/controllers/users_controller.rb
index <HASH>..<HASH> 100644
--- a/vendor/plugins/authentication/app/controllers/users_controller.rb
+++ b/vendor/plugins/authentication/app/controllers/users_controller.rb
@@ -52,8 +52,8 @@ class UsersController < ApplicationController
def forgot
if request.post?
if (user = User.find_by_email(params[:user][:email])).present?
- flash[:notice] = "An email has been sent to #{user.email} with a link to reset your password."
user.deliver_password_reset_instructions!(request)
+ flash[:notice] = "An email has been sent to #{user.email} with a link to reset your password."
redirect_back_or_default forgot_url
else
flash[:notice] = "Sorry, #{params[:user][:email]} isn't associated with any accounts. Are you sure you typed the correct email address?" | Flash should only be set after the mailer action succeeds. | refinery_refinerycms | train | rb |
db2202517d102e8b9746b3d34ac92f109d35a9c6 | diff --git a/lib/hubspot/engagement.rb b/lib/hubspot/engagement.rb
index <HASH>..<HASH> 100644
--- a/lib/hubspot/engagement.rb
+++ b/lib/hubspot/engagement.rb
@@ -92,9 +92,10 @@ module Hubspot
# @return [Hubspot::Engagement] self
def update!(params)
data = {
- engagement: engagement,
- associations: associations,
- metadata: metadata
+ engagement: params[:engagement] || engagement,
+ associations: params[:associations] || associations,
+ attachments: params[:attachments] || attachments,
+ metadata: params[:metadata] || metadata
}
Hubspot::Connection.put_json(ENGAGEMENT_PATH, params: { engagement_id: id }, body: data) | Params in engagement update! wasn't being used and engagement was always
updated with old values. Fixed to allow params to override. | adimichele_hubspot-ruby | train | rb |
8b27e0d771838449148cd901e5f1e1c5dd15f9de | diff --git a/source/rafcon/utils/installation.py b/source/rafcon/utils/installation.py
index <HASH>..<HASH> 100644
--- a/source/rafcon/utils/installation.py
+++ b/source/rafcon/utils/installation.py
@@ -78,7 +78,7 @@ def install_fonts(restart=False):
if font_installed:
logger.info("Running font detection ...")
if not update_font_cache(user_otf_fonts_folder):
- logger.warn("Could not run font detection. RAFCON might not find the correct fonts.")
+ logger.warn("Could not run font detection using 'fc-cache'. RAFCON might not find the correct fonts.")
if restart:
python = sys.executable
environ = dict(**os.environ) | docs(installation): update log output when trying to find fonts | DLR-RM_RAFCON | train | py |
1fbe2648d9d0dfe6192b2b600165e8030e3011e6 | diff --git a/source/php/Module.php b/source/php/Module.php
index <HASH>..<HASH> 100644
--- a/source/php/Module.php
+++ b/source/php/Module.php
@@ -403,8 +403,12 @@ class Module
}
global $post;
-
$module = $this;
+
+ if (is_null($post)) {
+ return;
+ }
+
$usage = $module->getModuleUsage($post->ID);
add_meta_box('modularity-usage', 'Module usage', function () use ($module, $usage) { | Fixes issue when $post was null | helsingborg-stad_Modularity | train | php |
c86dab9d55af7afdf0aee250dd67b676c99541ff | diff --git a/app/code/local/Edge/Base/Helper/Image.php b/app/code/local/Edge/Base/Helper/Image.php
index <HASH>..<HASH> 100644
--- a/app/code/local/Edge/Base/Helper/Image.php
+++ b/app/code/local/Edge/Base/Helper/Image.php
@@ -17,8 +17,13 @@ class Edge_Base_Helper_Image extends Mage_Core_Helper_Abstract
public function getImage($file)
{
- if (!file_exists(Mage::getBaseDir('media') . DS . $file)) {
+ $imageDirPath = Mage::getBaseDir('media') . DS . $file;
+ if (!file_exists($imageDirPath)) {
Mage::helper('core/file_storage')->processStorageFile($file);
+
+ if (Mage::getIsDeveloperMode() && !file_exists($imageDirPath)) {
+ $this->_scheduleModify = false;
+ }
}
if ($this->_scheduleModify) { | Avoid "File does not exists." Errors | outeredge_magento-base-module | train | php |
a5c873688a8c08de6d9a7f478583e522dc5e991d | diff --git a/src/Franzose/ClosureTable/Contracts/EntityInterface.php b/src/Franzose/ClosureTable/Contracts/EntityInterface.php
index <HASH>..<HASH> 100644
--- a/src/Franzose/ClosureTable/Contracts/EntityInterface.php
+++ b/src/Franzose/ClosureTable/Contracts/EntityInterface.php
@@ -10,6 +10,20 @@ interface EntityInterface {
const POSITION = 'position';
/**
+ * Indicates whether the model has children.
+ *
+ * @return bool
+ */
+ public function isParent();
+
+ /**
+ * Indicates whether the model has no ancestors.
+ *
+ * @return bool
+ */
+ public function isRoot();
+
+ /**
* @param EntityInterface $ancestor
* @param int $position
* @return EntityInterface | added new methods to EntityInterface | soda-framework_eloquent-closure | train | php |
da0382a435d3df6c4ee1669d9635268c3419a4e1 | diff --git a/server.js b/server.js
index <HASH>..<HASH> 100644
--- a/server.js
+++ b/server.js
@@ -219,7 +219,12 @@ Server.prototype.onUdpRequest = function (msg, rinfo) {
response.connectionId = params.connectionId
var buf = makeUdpPacket(response)
- self.udp.send(buf, 0, buf.length, rinfo.port, rinfo.address)
+
+ try {
+ self.udp.send(buf, 0, buf.length, rinfo.port, rinfo.address)
+ } catch (err) {
+ self.emit('warning', err)
+ }
if (params.action === common.ACTIONS.ANNOUNCE) {
self.emit(common.EVENT_NAMES[params.event], params.addr) | handle udp send errors
fixes #<I>
"Port should be > 0 and < <I>" | webtorrent_bittorrent-tracker | train | js |
51bb035bed55b5c13b19adcd9f70966fbcd01124 | diff --git a/lib/sassc-rails.rb b/lib/sassc-rails.rb
index <HASH>..<HASH> 100644
--- a/lib/sassc-rails.rb
+++ b/lib/sassc-rails.rb
@@ -1,6 +1,6 @@
begin
require "sass-rails"
- Sass::Rails.send(:remove_const, :Railtie)
+ Rails::Railtie.subclasses.delete Sass::Rails::Railtie
rescue LoadError
end | Prevent sass-rails railtie from running, fixes #6 | sass_sassc-rails | train | rb |
e4e5c40127a2dde1873d7f538ca325d796d1c160 | diff --git a/src/components/player.js b/src/components/player.js
index <HASH>..<HASH> 100644
--- a/src/components/player.js
+++ b/src/components/player.js
@@ -144,6 +144,14 @@ export default class Player extends BaseObject {
}
}
+ /**
+ * Determine if the player is ready.
+ * @return {boolean} true if the player is ready. ie PLAYER_READY event has fired
+ */
+ isReady() {
+ return !!this.ready
+ }
+
addEventListeners() {
if (!this.core.isReady()) {
this.listenToOnce(this.core, Events.CORE_READY, this.onReady)
@@ -168,6 +176,7 @@ export default class Player extends BaseObject {
}
onReady() {
+ this.ready = true
this.trigger(Events.PLAYER_READY)
} | Added player.isReady()
So that user can check after creating the player if they missed the
PLAYER_READY event. | clappr_clappr | train | js |
0dc576f26bce7757836334488220950fe6c3edd6 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -28,8 +28,8 @@ Cal.prototype.query = function (opts, cb) {
var cursors = []
var lt = opts.lt, gt = opts.gt
- if (lt !== undefined && tostr(lt) !== '[object Date]') lt = new Date(lt)
- if (gt !== undefined && tostr(gt) !== '[object Date]') gt = new Date(gt)
+ if (lt !== undefined && tostr(lt) !== '[object Date]') lt = newDate(lt)
+ if (gt !== undefined && tostr(gt) !== '[object Date]') gt = newDate(gt)
var gtstr = gt && strftime('%F', gt)
var ltstr = lt && strftime('%F', lt)
@@ -167,3 +167,8 @@ Cal.prototype.remove = function (id, cb) {
function noop () {}
function tostr (x) { return Object.prototype.toString.call(x) }
+
+function newDate (str) {
+ if (/\b\d+:\d+(:\d+)?\b/.test(str)) return new Date(str)
+ else return new Date(str + ' 00:00:00')
+} | fix issue with new Date constructor in ranges | substack_calendar-db | train | js |
ccb6b7f75d564efc018f4ebf33005593989f3bca | diff --git a/test/Event/Events/EventCreatedTest.php b/test/Event/Events/EventCreatedTest.php
index <HASH>..<HASH> 100644
--- a/test/Event/Events/EventCreatedTest.php
+++ b/test/Event/Events/EventCreatedTest.php
@@ -175,7 +175,7 @@ class EventCreatedTest extends \PHPUnit_Framework_TestCase
'label' => 'bar',
'domain' => 'eventtype'
),
- 'publication_date' => '2016-08-01T00:00:00+02:00'
+ 'publication_date' => '2016-08-01T00:00:00+0000'
],
new EventCreated(
'test 456',
@@ -196,7 +196,7 @@ class EventCreatedTest extends \PHPUnit_Framework_TestCase
new DateTime(
new Date(
new Year(2016),
- Month::fromNative('AUGUST'),
+ Month::fromNative('August'),
new MonthDay(1)
),
new Time( | III-<I>: Fixed EventCreatedTest. | cultuurnet_udb3-php | train | php |
8e043ee004355e77d67f7c8fb3c12f181b8481c3 | diff --git a/src/umbra/engine.py b/src/umbra/engine.py
index <HASH>..<HASH> 100644
--- a/src/umbra/engine.py
+++ b/src/umbra/engine.py
@@ -295,6 +295,9 @@ class Umbra(foundations.ui.common.QWidgetFactory(uiFile=RuntimeGlobals.uiFile)):
LOGGER.debug("> Initializing '{0}()' class.".format(self.__class__.__name__))
+ # --- Running pre initialisation method. ---
+ hasattr(self, "onPreInitialisation") and self.onPreInitialisation()
+
super(Umbra, self).__init__(parent, *args, **kwargs)
# Engine binding to global variable.
@@ -454,6 +457,9 @@ Exception raised: {1}".format(component, error)), self.__class__.__name__)
self.restoreStartupLayout()
+ # --- Running post initialisation method. ---
+ hasattr(self, "onPostInitialisation") and self.onPostInitialisation()
+
#******************************************************************************************************************
#*** Attributes properties.
#****************************************************************************************************************** | Add support for pre / post initialisation methods in "umbra.engine" module. | KelSolaar_Umbra | train | py |
c9f54e620e70fceca7e170cc9d4f8b6c5ddb01d6 | diff --git a/lib/random_forest/numerical_predicate.rb b/lib/random_forest/numerical_predicate.rb
index <HASH>..<HASH> 100644
--- a/lib/random_forest/numerical_predicate.rb
+++ b/lib/random_forest/numerical_predicate.rb
@@ -2,17 +2,18 @@ class NumericalPredicate
GREATER_THAN = 'greaterThan'
LESS_OR_EQUAL = 'lessOrEqual'
+ EQUAL = 'equal'
attr_reader :field
def initialize(attributes)
@field = attributes['field'].value.to_sym
- @value = Float(attributes['value'].value)
@operator = attributes['operator'].value
+ @value = @operator == EQUAL ? attributes['value'].value : Float(attributes['value'].value)
end
def true?(features)
- curr_value = Float(features[@field])
+ curr_value = @operator == EQUAL ? features[@field] : Float(features[@field])
return curr_value > @value if @operator == GREATER_THAN
curr_value < @value if @operator == LESS_OR_EQUAL
end | allow numerical predicate to check strings for equality | asafschers_scoruby | train | rb |
9b4ec029f661ecde17af08d1e4e38851e57d7a58 | diff --git a/railties/lib/rails/generators/testing/assertions.rb b/railties/lib/rails/generators/testing/assertions.rb
index <HASH>..<HASH> 100644
--- a/railties/lib/rails/generators/testing/assertions.rb
+++ b/railties/lib/rails/generators/testing/assertions.rb
@@ -1,5 +1,3 @@
-require 'shellwords'
-
module Rails
module Generators
module Testing | remove unused require
`shellwords` is no longer needed from #<I>. | rails_rails | train | rb |
210b728b1e5ed72d608c337ae353c9af08fb0c1c | diff --git a/Controller/Adminhtml/Post/Save.php b/Controller/Adminhtml/Post/Save.php
index <HASH>..<HASH> 100644
--- a/Controller/Adminhtml/Post/Save.php
+++ b/Controller/Adminhtml/Post/Save.php
@@ -50,6 +50,11 @@ class Save extends Post
return $resultRedirect->setPath('*/*/');
}
$model->addData($data);
+
+ if(!$data['is_short_content']) {
+ $model->setShortContent('');
+ }
+
try {
if ($this->getRequest()->getParam('isAjax')) {
return $this->handlePreviewRequest($model); | Fix: issue with short content present after saving post with disabled excerpt | mirasvit_module-blog | train | php |
20a076f3ea56d25768f6b42f0c224b09549c8d9f | diff --git a/push/src/main/java/org/jboss/aerogear/unifiedpush/message/sender/APNsPushNotificationSender.java b/push/src/main/java/org/jboss/aerogear/unifiedpush/message/sender/APNsPushNotificationSender.java
index <HASH>..<HASH> 100644
--- a/push/src/main/java/org/jboss/aerogear/unifiedpush/message/sender/APNsPushNotificationSender.java
+++ b/push/src/main/java/org/jboss/aerogear/unifiedpush/message/sender/APNsPushNotificationSender.java
@@ -159,7 +159,8 @@ public class APNsPushNotificationSender implements PushNotificationSender {
builder.withDelegate(new ApnsDelegateAdapter() {
@Override
public void messageSent(ApnsNotification message, boolean resent) {
- logger.fine("Sending APNs message: " + message.getDeviceToken());
+ // Invoked for EVERY devicetoken:
+ logger.finest("Sending APNs message: " + message.getDeviceToken());
}
@Override | using finest for every token sent over to APNs | aerogear_aerogear-unifiedpush-server | train | java |
b020d402d92a7040b89c702812f939dff003b013 | diff --git a/Kwf/Test/SeleniumTestCase.php b/Kwf/Test/SeleniumTestCase.php
index <HASH>..<HASH> 100644
--- a/Kwf/Test/SeleniumTestCase.php
+++ b/Kwf/Test/SeleniumTestCase.php
@@ -41,6 +41,13 @@ class Kwf_Test_SeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase
if (!$cfg = Kwf_Registry::get('testServerConfig')) {
throw new Kwf_Exception("testServerConfig not set");
}
+
+ Kwf_Util_Apc::callClearCacheByCli(array('type'=>'user'));
+ Kwf_Cache::factory('Core', 'Memcached', array(
+ 'lifetime'=>null,
+ 'automatic_cleaning_factor' => false,
+ 'automatic_serialization'=>true))->clean();
+
$d = $this->_domain;
if (!$d) {
$domain = $cfg->server->domain; | clear cache before running selenium test
fixes tests | koala-framework_koala-framework | train | php |
4805680f900757553a16b7eddc96ab413e4f91eb | diff --git a/src/main/java/net/bootsfaces/component/inputText/InputTextRenderer.java b/src/main/java/net/bootsfaces/component/inputText/InputTextRenderer.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/bootsfaces/component/inputText/InputTextRenderer.java
+++ b/src/main/java/net/bootsfaces/component/inputText/InputTextRenderer.java
@@ -71,11 +71,11 @@ public class InputTextRenderer extends CoreRenderer {
String clientId = inputText.getClientId(context);
String name = inputText.getName();
-// if (realAttributeName != null) {
-// name = realAttributeName;
-// }
-// else
- if (null == name) {
+ if (realEventSourceName == null) {
+ realEventSourceName = "input_" + clientId;
+ }
+
+ if (null == name) {
name = "input_" + clientId;
}
String submittedValue = (String) context.getExternalContext().getRequestParameterMap().get(name); | #<I> fixed the AJAX engine (regression caused by #<I>) | TheCoder4eu_BootsFaces-OSP | train | java |
2aca62624ac4bacc35d3935722811cfa1f8b645a | diff --git a/JSAT/test/jsat/datatransform/kernel/KernelPCATest.java b/JSAT/test/jsat/datatransform/kernel/KernelPCATest.java
index <HASH>..<HASH> 100644
--- a/JSAT/test/jsat/datatransform/kernel/KernelPCATest.java
+++ b/JSAT/test/jsat/datatransform/kernel/KernelPCATest.java
@@ -115,8 +115,8 @@ public class KernelPCATest
DataModelPipeline instance = new DataModelPipeline((Classifier)new DCDs(), new KernelPCA.KernelPCATransformFactory(new RBFKernel(0.5), 20, 100, Nystrom.SamplingMethod.KMEANS));
- ClassificationDataSet t1 = FixedProblems.getInnerOuterCircle(500, new XORWOW());
- ClassificationDataSet t2 = FixedProblems.getInnerOuterCircle(500, new XORWOW(), 2.0, 10.0);
+ ClassificationDataSet t1 = FixedProblems.getCircles(500, 0.0, new XORWOW(), 1.0, 4.0);
+ ClassificationDataSet t2 = FixedProblems.getCircles(500, 0.0, new XORWOW(), 2.0, 10.0);
instance = instance.clone(); | Made KernelPCA test more stable by removing noise from test set | EdwardRaff_JSAT | train | java |
a6db9eff54ab44b81164cf7cc795dc57290ba157 | diff --git a/sos/report/plugins/block.py b/sos/report/plugins/block.py
index <HASH>..<HASH> 100644
--- a/sos/report/plugins/block.py
+++ b/sos/report/plugins/block.py
@@ -34,6 +34,7 @@ class Block(Plugin, IndependentPlugin):
"ls -lanR /dev",
"ls -lanR /sys/block",
"lsblk -O -P",
+ "losetup -a",
])
# legacy location for non-/run distributions
@@ -46,6 +47,7 @@ class Block(Plugin, IndependentPlugin):
"/sys/block/sd*/device/timeout",
"/sys/block/hd*/device/timeout",
"/sys/block/sd*/device/state",
+ "/sys/block/loop*/loop/",
])
cmds = [ | Addd information about loop devices
This patch captures information from loop devices
via 'losetup -a' and the content of
/sys/block/loopN/loop/ directory. | sosreport_sos | train | py |
97b741675b5f7bb75dca216cdb60c4da0c35a5cc | diff --git a/spyder/widgets/variableexplorer/collectionseditor.py b/spyder/widgets/variableexplorer/collectionseditor.py
index <HASH>..<HASH> 100644
--- a/spyder/widgets/variableexplorer/collectionseditor.py
+++ b/spyder/widgets/variableexplorer/collectionseditor.py
@@ -143,7 +143,10 @@ class ReadOnlyCollectionsModel(QAbstractTableModel):
if not self.names:
self.header0 = _("Key")
else:
- self.keys = [k for k in dir(data) if not k.startswith('__')]
+ keys = [k for k in dir(data) if not k.startswith('__')]
+ if not keys:
+ keys = dir(data)
+ self.keys = keys
self._data = data = self.showndata = ProxyObject(data)
if not self.names:
self.header0 = _("Attribute") | Variable Explorer: Show object attrs if all of them are hidden | spyder-ide_spyder | train | py |
3baa80582f6ac3ff7dcb71a4286b4ce3e392f6ef | diff --git a/zengine/lib/cache.py b/zengine/lib/cache.py
index <HASH>..<HASH> 100644
--- a/zengine/lib/cache.py
+++ b/zengine/lib/cache.py
@@ -288,7 +288,7 @@ class Session(object):
def items(self):
return ((k[len(self.key) + 1:], self._j_load(cache.get(k))) for k in self._keys())
- def destroy(self):
+ def delete(self):
"""
Removes all contents attached to this session object.
If sessid is empty, all sessions will be cleaned up. | rref #<I> ref GH-<I>
CHANGE Renamed "destroy" method of Session object to "delete" | zetaops_zengine | train | py |
433b81964fd2169d19623abf0fe38a294c28dc63 | diff --git a/littlechef/runner.py b/littlechef/runner.py
index <HASH>..<HASH> 100644
--- a/littlechef/runner.py
+++ b/littlechef/runner.py
@@ -255,6 +255,7 @@ def _readconfig():
# We expect an ssh_config file here,
# and/or a user, (password/keyfile) pair
+ env.ssh_config = None
try:
ssh_config = config.get('userinfo', 'ssh-config')
except ConfigParser.NoSectionError:
@@ -275,8 +276,6 @@ def _readconfig():
except Exception:
msg = "Couldn't parse the ssh-config file '{0}'".format(ssh_config)
abort(msg)
- else:
- env.ssh_config = None
try:
env.user = config.get('userinfo', 'user')
@@ -311,4 +310,4 @@ if littlechef.COOKING:
_readconfig()
else:
# runner module has been imported
- pass
+ env.ssh_config = None | As a library, initialize env.ssh_config = None so that credentials doesn't fail | tobami_littlechef | train | py |
fda5f6ae5661405abfda932976915a533e9ec8d8 | diff --git a/server/php/UploadHandler.php b/server/php/UploadHandler.php
index <HASH>..<HASH> 100755
--- a/server/php/UploadHandler.php
+++ b/server/php/UploadHandler.php
@@ -138,7 +138,8 @@ class UploadHandler
// Automatically rotate images based on EXIF meta data:
'auto_orient' => true
),
- // You can add an array. The key is the name of the version (example: 'medium'), the array contains the options to apply.
+ // You can add an array. The key is the name of the version (example: 'medium').
+ // the array contains the options to apply.
/*
'medium' => array(
'max_width' => 200, | Update UploadHandler.php
- example renamed to 'medium', different width/height than thumbnail | blueimp_jQuery-File-Upload | train | php |
cc6b6f44d449b095478454975a3b3526a0fb553d | diff --git a/test/test_helper.rb b/test/test_helper.rb
index <HASH>..<HASH> 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -1,7 +1,7 @@
require 'simplecov'
require 'minitest/rg'
-SimpleCov.minimum_coverage_by_file 80
+SimpleCov.minimum_coverage_by_file 100
SimpleCov.start do
add_filter '/test/'
end | Increase test coverage requirement from <I>% to <I>% | robwierzbowski_jekyll-picture-tag | train | rb |
e4848144e41cc9a62a79e571f4ddbe60bd5dca8c | diff --git a/config/protractor-ci.conf.js b/config/protractor-ci.conf.js
index <HASH>..<HASH> 100644
--- a/config/protractor-ci.conf.js
+++ b/config/protractor-ci.conf.js
@@ -1,4 +1,5 @@
exports.config = {
+ baseUrl: 'http://abs.danmind.ru/#!',
sauceUser: SAUCE_USERNAME,
sauceKey: SAUCE_ACCESS_KEY,
specs: ['../build/src/**/*.protractor.js', '../build/src/**/*.e2e.js'], | changed baseUrl for CI tests | danmindru_angular-boilerplate-study | train | js |
01d6787a9d8af4ee03ad2a4a26db177dd5f26872 | diff --git a/mvc/attribute/$manager.js b/mvc/attribute/$manager.js
index <HASH>..<HASH> 100644
--- a/mvc/attribute/$manager.js
+++ b/mvc/attribute/$manager.js
@@ -48,7 +48,7 @@ attributeManager.prototype = {
utils.each(require('./httpMethod'), function(name) { self.register(name, this); });
// internal used attribute:
// name contains brackets that will never valid for attribute name
- this.register('(paramModelAttribute)', require('./$paramModel.js'));
+ this._inner.set('(paramModel)', require('./$paramModel.js'));
},
resolve: function(attrName, attrSett) { | use _inner to do internal register to avoid the unvalid attribute name | jszoo_cat-mvc | train | js |
0e577ab2a1d158fbb8e57a127ffab5f740dff81b | diff --git a/lib/query/Query.js b/lib/query/Query.js
index <HASH>..<HASH> 100644
--- a/lib/query/Query.js
+++ b/lib/query/Query.js
@@ -45,6 +45,8 @@ Query.prototype.constructor = Query;
Query.prototype.generate = function(options, values) {
const ctx = {};
+ if (this.pool && this.pool.config)
+ Object.assign(ctx, this.pool.config);
if (options)
Object.assign(ctx, options);
ctx.values = values || {}; | [+] generate() will use pool config as default | sqbjs_sqb | train | js |
5bb67e0065a47015399478395404524174ca4d49 | diff --git a/anyconfig/mergeabledict.py b/anyconfig/mergeabledict.py
index <HASH>..<HASH> 100644
--- a/anyconfig/mergeabledict.py
+++ b/anyconfig/mergeabledict.py
@@ -538,6 +538,9 @@ def create_from(obj=None, ac_ordered=False,
if ac_merge not in MERGE_STRATEGIES:
raise ValueError("Wrong merge strategy: %r" % ac_merge)
+ if getattr(options, "ac_namedtuple", False):
+ ac_ordered = True # To keep the order of items.
+
cls = _get_mdict_class(ac_merge=ac_merge, ac_ordered=ac_ordered)
if obj is None:
return cls() | fix: keep order of items if ac_namedtuple in .mergeabledict.create_from | ssato_python-anyconfig | train | py |
5c801518e4a167819f1c7498bd150b0af8465517 | diff --git a/chempy/util/_expr.py b/chempy/util/_expr.py
index <HASH>..<HASH> 100644
--- a/chempy/util/_expr.py
+++ b/chempy/util/_expr.py
@@ -605,7 +605,7 @@ def create_Piecewise(parameter_name, nan_fallback=False):
return Expr.from_callback(_pw, parameter_keys=(parameter_name,))
-def create_Poly(parameter_name, reciprocal=False, shift=None, name=None):
+def create_Poly(parameter_name, reciprocal=False, shift=None, name=None, transform_x=lambda x, backend: x):
"""
Examples
--------
@@ -636,6 +636,9 @@ def create_Poly(parameter_name, reciprocal=False, shift=None, name=None):
coeffs = args[1:]
x_shift = args[0]
x0 = x - x_shift
+
+ x = transform_x(x, backend=backend)
+
cur = 1
res = None
for coeff in coeffs: | Non-public API: add transform_x to create_Poly | bjodah_chempy | train | py |
c7edd733b426d102177b1b03c5f1d059e0bcf624 | diff --git a/core/Menu/MenuReporting.php b/core/Menu/MenuReporting.php
index <HASH>..<HASH> 100644
--- a/core/Menu/MenuReporting.php
+++ b/core/Menu/MenuReporting.php
@@ -69,7 +69,9 @@ class MenuReporting extends MenuAbstract
Piwik::postEvent('Menu.Reporting.addItems', array());
foreach (Report::getAllReports() as $report) {
- $report->configureReportingMenu($this);
+ if ($report->isEnabled()) {
+ $report->configureReportingMenu($this);
+ }
}
foreach ($this->getAvailableMenus() as $menu) {
diff --git a/core/WidgetsList.php b/core/WidgetsList.php
index <HASH>..<HASH> 100644
--- a/core/WidgetsList.php
+++ b/core/WidgetsList.php
@@ -85,7 +85,9 @@ class WidgetsList extends Singleton
$widgetsList = self::getInstance();
foreach (Report::getAllReports() as $report) {
- $report->configureWidget($widgetsList);
+ if ($report->isEnabled()) {
+ $report->configureWidget($widgetsList);
+ }
}
foreach ($widgets as $widget) { | add report to widgetslist or menu only if enabled, should fix some tests | matomo-org_matomo | train | php,php |
165c323c26b04df6f5ae34366ebdbae540036409 | diff --git a/dhooks/client.py b/dhooks/client.py
index <HASH>..<HASH> 100644
--- a/dhooks/client.py
+++ b/dhooks/client.py
@@ -116,9 +116,8 @@ class Webhook:
""" # noqa: W605
- REGEX = r'^(https://)?discordapp.com/api/webhooks/' \
- r'(?P<id>[0-9]+)/(?P<token>[A-Za-z0-9\.\-\_]+)/?$'
- # TODO: if the token exceeds 68, the url's still deemed valid
+ URL_REGEX = r'^(https://)?discordapp.com/api/webhooks/' \
+ r'(?P<id>[0-9]+)/(?P<token>[A-Za-z0-9\.\-\_]+)/?$'
ENDPOINT = 'https://discordapp.com/api/webhooks/{id}/{token}'
CDN = r'https://cdn.discordapp.com/avatars/' \
r'{0.id}/{0.default_avatar}.{1}?size={2}'
@@ -479,7 +478,7 @@ class Webhook:
if not self.url:
self.url = self.ENDPOINT.format(id=self.id, token=self.token)
else:
- match = re.match(self.REGEX, self.url)
+ match = re.match(self.URL_REGEX, self.url)
if match is None:
raise ValueError('Invalid webhook URL provided.') | Renamed REGEX -> URL_REGEX for Webhook; removed a TODO | kyb3r_dhooks | train | py |
b587147962eaff8229e8ff54f07df93a42fa317f | diff --git a/app/models/marty/enum.rb b/app/models/marty/enum.rb
index <HASH>..<HASH> 100644
--- a/app/models/marty/enum.rb
+++ b/app/models/marty/enum.rb
@@ -6,14 +6,9 @@ module Marty::Enum
res = @LOOKUP_CACHE[index] ||= find_by_name(index)
- return res if res
+ raise "no such #{self.name}: '#{index}'" unless res
- raise "no such #{self.name}: '#{index}'"
- end
-
- def to_s
- # FIXME: hacky since not all enums have name
- self.name
+ res
end
def clear_lookup_cache! | removed bogus to_s function. | arman000_marty | train | rb |
875c06b1a2caa532d50ff2d88964118722cbd976 | diff --git a/lib/running.js b/lib/running.js
index <HASH>..<HASH> 100644
--- a/lib/running.js
+++ b/lib/running.js
@@ -171,7 +171,25 @@ exports.run = function(list, args, cb) {
// finish so assume we can exit with the number of 'problems'
if (typeof cb == 'undefined') {
cb = function (problems) {
- process.exit(problems);
+ // we only want to exit once we know everything has been written to stdout,
+ // otherwise sometimes not all the output from tests will have been written.
+ // So we write an empty string to stdout and then make sure it is done before
+ // exiting
+
+ var written = process.stdout.write('');
+ if (written) {
+ exit();
+ }
+ else {
+ process.stdout.on('drain', function drained() {
+ process.stdout.removeListener('drain', drained);
+ exit();
+ });
+ }
+
+ function exit() {
+ process.exit(problems);
+ }
}
}
runner(list, options, cb); | Fix bug where sometimes console output would stop randomly with '%' | bentomas_node-async-testing | train | js |
0f0e5d931330fa33dcb84b8145570ea423b61227 | diff --git a/local_repository.go b/local_repository.go
index <HASH>..<HASH> 100644
--- a/local_repository.go
+++ b/local_repository.go
@@ -130,7 +130,7 @@ func (repo *LocalRepository) VCS() *VCSBackend {
return nil
}
-var vcsDirs = []string{".git", ".hg"}
+var vcsDirs = []string{".git", ".svn", ".hg"}
func walkLocalRepositories(callback func(*LocalRepository)) {
for _, root := range localRepositoryRoots() { | Enable to work ghq list and ghq look on Subversion repository. | motemen_ghq | train | go |
91dc426b81cfe7906d063a34d7ee7e7e4dd671f2 | diff --git a/lib/AppInstance.class.php b/lib/AppInstance.class.php
index <HASH>..<HASH> 100644
--- a/lib/AppInstance.class.php
+++ b/lib/AppInstance.class.php
@@ -146,4 +146,3 @@ class AppInstance
return $r;
}
}
-class FastCGI_AppInstance extends AppInstance {}
diff --git a/lib/WebSocketRoute.class.php b/lib/WebSocketRoute.class.php
index <HASH>..<HASH> 100644
--- a/lib/WebSocketRoute.class.php
+++ b/lib/WebSocketRoute.class.php
@@ -10,14 +10,16 @@
class WebSocketRoute
{
public $client; // Remote client
+ public $appInstance;
/* @method __construct
@description Called when client connected.
@param object Remote client (WebSocketSession).
@return void
*/
- public function __construct($client)
+ public function __construct($client,$appInstance = NULL)
{
$this->client = $client;
+ if ($appInstance) {$this->appInstance = $appInstance;}
}
/* @method onHandshake
@description Called when the connection is handshaked. | Removed unused class FastCGI_AppInstance. Minor improvements in WebSocketRoute.class.php | kakserpom_phpdaemon | train | php,php |
d7213e10d7508dcea53100df4d0d90563c5724e8 | diff --git a/lib/neo4j/active_node/query/query_proxy_link.rb b/lib/neo4j/active_node/query/query_proxy_link.rb
index <HASH>..<HASH> 100644
--- a/lib/neo4j/active_node/query/query_proxy_link.rb
+++ b/lib/neo4j/active_node/query/query_proxy_link.rb
@@ -115,7 +115,11 @@ module Neo4j
end
def converted_key(model, key)
- (model && key.to_sym == :id) ? model.id_property_name : key
+ if key.to_sym == :id
+ model ? model.id_property_name : :uuid
+ else
+ key
+ end
end
def converted_value(model, key, value) | Probably a better way to approach it | neo4jrb_neo4j | train | rb |
033119e9b8f1b56f19b897f89d35c2b4d975556f | diff --git a/telethon/network/mtproto_sender.py b/telethon/network/mtproto_sender.py
index <HASH>..<HASH> 100644
--- a/telethon/network/mtproto_sender.py
+++ b/telethon/network/mtproto_sender.py
@@ -39,7 +39,7 @@ class MtProtoSender:
self._logger = logging.getLogger(__name__)
# Message IDs that need confirmation
- self._need_confirmation = []
+ self._need_confirmation = set()
# Requests (as msg_id: Message) sent waiting to be received
self._pending_receive = {}
@@ -74,7 +74,7 @@ class MtProtoSender:
# Pack everything in the same container if we need to send AckRequests
if self._need_confirmation:
messages.append(
- TLMessage(self.session, MsgsAck(self._need_confirmation))
+ TLMessage(self.session, MsgsAck(list(self._need_confirmation)))
)
self._need_confirmation.clear()
@@ -183,7 +183,7 @@ class MtProtoSender:
)
return False
- self._need_confirmation.append(msg_id)
+ self._need_confirmation.add(msg_id)
code = reader.read_int(signed=False)
reader.seek(-4) | Make MtProtoSender._need_confirmation a set
This will avoid adding duplicated items to it | LonamiWebs_Telethon | train | py |
3ed7683a357fe29416ef03ff1e720001341b6b9c | diff --git a/test/TwitchApi/Resources/UsersTest.php b/test/TwitchApi/Resources/UsersTest.php
index <HASH>..<HASH> 100644
--- a/test/TwitchApi/Resources/UsersTest.php
+++ b/test/TwitchApi/Resources/UsersTest.php
@@ -7,10 +7,10 @@ namespace TwitchApi\Tests\Resources;
use GuzzleHttp\Handler\MockHandler;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Psr7\Response;
+use PHPUnit\Framework\TestCase;
use TwitchApi\HelixGuzzleClient;
use TwitchApi\RequestGenerator;
use TwitchApi\Resources\UsersApi;
-use PHPUnit\Framework\TestCase;
class UsersTest extends TestCase
{ | Updated Tests to Resolve CS Issue | nicklaw5_twitch-api-php | train | php |
ef6f3e0a18e7dc803835e4de5c61382b03bc5a28 | diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go
index <HASH>..<HASH> 100644
--- a/test/e2e/e2e_test.go
+++ b/test/e2e/e2e_test.go
@@ -22,6 +22,12 @@ import (
"os"
"testing"
+ // Never, ever remove the line with "/ginkgo". Without it,
+ // the ginkgo test runner will not detect that this
+ // directory contains a Ginkgo test suite.
+ // See https://github.com/kubernetes/kubernetes/issues/74827
+ // "github.com/onsi/ginkgo"
+
"k8s.io/kubernetes/test/e2e/framework"
"k8s.io/kubernetes/test/e2e/framework/testfiles"
"k8s.io/kubernetes/test/e2e/framework/viperconfig" | test/e2e: fix `ginkgo ./test/e2e`
When running ginkgo directly against the source code of the test suite
instead of using some pre-compiled e2e.test binary, ginkgo no longer
recognized that it runs a Ginkgo testsuite, which broke "-focus" and
"-p".
By re-inserting the magic strings that ginkgo looks for into a
comment, we can restore the desired behavior without affecting the
code.
Fixes: #<I> | kubernetes_kubernetes | train | go |
20536d7ddd29e0a3fd0fa03bbecc862f127d9c42 | diff --git a/includes/functions-deprecated.php b/includes/functions-deprecated.php
index <HASH>..<HASH> 100644
--- a/includes/functions-deprecated.php
+++ b/includes/functions-deprecated.php
@@ -28,17 +28,6 @@ function yourls_get_duplicate_keywords( $longurl ) {
}
/**
- * Check if we'll need interface display function (ie not API or redirection)
- *
- */
-function yourls_has_interface() {
- yourls_deprecated_function( __FUNCTION__, '1.7' );
- if( yourls_is_API() or yourls_is_GO() )
- return false;
- return true;
-}
-
-/**
* Make sure a integer is safe
*
* Note: this function is dumb and dumbly named since it does not intval(). DO NOT USE.
diff --git a/includes/functions.php b/includes/functions.php
index <HASH>..<HASH> 100644
--- a/includes/functions.php
+++ b/includes/functions.php
@@ -1695,6 +1695,16 @@ function yourls_statlink( $keyword = '' ) {
}
/**
+ * Check if we'll need interface display function (ie not API or redirection)
+ *
+ */
+function yourls_has_interface() {
+ if( yourls_is_API() or yourls_is_GO() )
+ return false;
+ return true;
+}
+
+/**
* Check if we're in API mode. Returns bool
*
*/ | Undeprecate: yourls_has_interface() is used in the future | YOURLS_YOURLS | train | php,php |
a38b41b84652d925deb6d94e9f42494cd90ddf68 | diff --git a/pygsp/tests/test_graphs.py b/pygsp/tests/test_graphs.py
index <HASH>..<HASH> 100644
--- a/pygsp/tests/test_graphs.py
+++ b/pygsp/tests/test_graphs.py
@@ -764,7 +764,7 @@ class TestImportExport(unittest.TestCase):
graph = graphs.BarabasiAlbert(N=100, seed=42)
rng = np.random.default_rng(42)
signal1 = rng.normal(0, 1, graph.N)
- signal2 = rng.integers(0, 1, graph.N)
+ signal2 = rng.integers(0, 10, graph.N)
graph.set_signal(signal1, "signal1")
graph.set_signal(signal2, "signal2")
graph_nx = graph.to_networkx()
@@ -780,7 +780,7 @@ class TestImportExport(unittest.TestCase):
g = graphs.Logo()
rng = np.random.default_rng(42)
s = rng.normal(0, 1, size=g.N)
- s2 = rng.integers(0, 1, size=g.N)
+ s2 = rng.integers(0, 10, size=g.N)
g.set_signal(s, "signal1")
g.set_signal(s2, "signal2")
g_gt = g.to_graphtool() | tests: fix import/export integer signals | epfl-lts2_pygsp | train | py |
db50ba9508b1f80238e38b331b1ef15e91c58754 | diff --git a/Model/Api/CreateOrder.php b/Model/Api/CreateOrder.php
index <HASH>..<HASH> 100644
--- a/Model/Api/CreateOrder.php
+++ b/Model/Api/CreateOrder.php
@@ -54,6 +54,7 @@ class CreateOrder implements CreateOrderInterface
const E_BOLT_DISCOUNT_CANNOT_APPLY = 2001006;
const E_BOLT_DISCOUNT_CODE_DOES_NOT_EXIST = 2001007;
const E_BOLT_SHIPPING_EXPIRED = 2001008;
+ const E_BOLT_REJECTED_ORDER = 2001010;
/**
* @var HookHelper
@@ -210,6 +211,14 @@ class CreateOrder implements CreateOrderInterface
$createdOrder = $this->orderHelper->processNewOrder($quote, $transaction);
}
+ if($createdOrder->isCanceled()){
+ throw new BoltException(
+ __('Order has been canceled due to the previously declined payment',
+ null,
+ self::E_BOLT_REJECTED_ORDER
+ ));
+ }
+
$this->sendResponse(200, [
'status' => 'success',
'message' => 'Order create was successful', | Do not allow checkout after Declined Payment card (#<I>)
* allow rejected -> completed transition when cards change
* transition change reverted
* Declined payment - throw on canceled order
* Declined payment - message update | BoltApp_bolt-magento2 | train | php |
ae30818ba528ad453478eccf4a7a8b8f30888d7c | diff --git a/plexapi/config.py b/plexapi/config.py
index <HASH>..<HASH> 100644
--- a/plexapi/config.py
+++ b/plexapi/config.py
@@ -62,4 +62,5 @@ def reset_base_headers():
'X-Plex-Device-Name': plexapi.X_PLEX_DEVICE_NAME,
'X-Plex-Client-Identifier': plexapi.X_PLEX_IDENTIFIER,
'X-Plex-Sync-Version': '2',
+ 'X-Plex-Features': 'external-media',
} | Enable external media in responses, e.g. Tidal (#<I>) | pkkid_python-plexapi | train | py |
3bdbb673c3622a4a520bfd57caf7acfc6d53bc4e | diff --git a/gem/lib/frank-cucumber/version.rb b/gem/lib/frank-cucumber/version.rb
index <HASH>..<HASH> 100644
--- a/gem/lib/frank-cucumber/version.rb
+++ b/gem/lib/frank-cucumber/version.rb
@@ -1,5 +1,5 @@
module Frank
module Cucumber
- VERSION = "1.1.4.pre1"
+ VERSION = "1.1.5"
end
end | very non-sem-ver update from <I>.pre to <I> | moredip_Frank | train | rb |
91c86c7e26c40ff3e422adcdd88d1649dd9dbc9b | diff --git a/daemon/cluster/filters.go b/daemon/cluster/filters.go
index <HASH>..<HASH> 100644
--- a/daemon/cluster/filters.go
+++ b/daemon/cluster/filters.go
@@ -53,6 +53,10 @@ func newListTasksFilters(filter filters.Args, transformFunc func(filters.Args) e
"service": true,
"node": true,
"desired-state": true,
+ // UpToDate is not meant to be exposed to users. It's for
+ // internal use in checking create/update progress. Therefore,
+ // we prefix it with a '_'.
+ "_up-to-date": true,
}
if err := filter.Validate(accepted); err != nil {
return nil, err
@@ -68,6 +72,7 @@ func newListTasksFilters(filter filters.Args, transformFunc func(filters.Args) e
Labels: runconfigopts.ConvertKVStringsToMap(filter.Get("label")),
ServiceIDs: filter.Get("service"),
NodeIDs: filter.Get("node"),
+ UpToDate: len(filter.Get("_up-to-date")) != 0,
}
for _, s := range filter.Get("desired-state") { | Add support for UpToDate filter, for internal use | moby_moby | train | go |
c3a5557140bc0a3365c15ee59d95d90419314baf | diff --git a/instaloader.py b/instaloader.py
index <HASH>..<HASH> 100755
--- a/instaloader.py
+++ b/instaloader.py
@@ -21,6 +21,7 @@ from typing import Any, Callable, Dict, List, Optional, Tuple
import requests
import requests.utils
+import urllib3
# To get version from setup.py for instaloader --version
@@ -164,7 +165,7 @@ class Instaloader:
shutil.copyfileobj(resp.raw, file)
else:
raise ConnectionException("Request returned HTTP error code {}.".format(resp.status_code))
- except (ConnectionResetError, ConnectionException) as err:
+ except (urllib3.exceptions.HTTPError, requests.exceptions.RequestException, ConnectionException) as err:
print("URL: " + url + "\n" + err, file=sys.stderr)
if tries <= 1:
raise err | Additionally catch HTTPError and RequestException
Concerns issue #<I>. | instaloader_instaloader | train | py |
986657967e3e96ce5b95e77ba5c36b00e23b4bb4 | diff --git a/docs/examples/Runner.php b/docs/examples/Runner.php
index <HASH>..<HASH> 100644
--- a/docs/examples/Runner.php
+++ b/docs/examples/Runner.php
@@ -4,12 +4,14 @@ declare(strict_types = 1);
namespace Apha\Examples;
/* @var $loader \Composer\Autoload\ClassLoader */
+use Doctrine\Common\Annotations\AnnotationRegistry;
+
$loader = require_once __DIR__ . '/../../vendor/autoload.php';
$loader->addPsr4("Apha\\Examples\\", __DIR__ . "/");
-\Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace(
- 'JMS\Serializer\Annotation', __DIR__ . '/../../vendor/jms/serializer/src'
-);
+AnnotationRegistry::registerLoader(function (string $className) use ($loader) {
+ return $loader->loadClass($className);
+});
abstract class Runner
{ | Use regular autoloader for loading annotations. | martyn82_apha | train | php |
af6a294bde2ba519c9f51e1cd334144bd7a559c0 | diff --git a/packages/xod-fs/src/unpack.js b/packages/xod-fs/src/unpack.js
index <HASH>..<HASH> 100644
--- a/packages/xod-fs/src/unpack.js
+++ b/packages/xod-fs/src/unpack.js
@@ -4,19 +4,13 @@ import * as XP from 'xod-project';
import { IMPL_FILENAMES } from './loadLibs';
-// "-- Awesome name --" -> "awesome-name"
-export const fsSafeName = R.compose(
- R.replace(/-$/g, ''),
- R.replace(/^-/g, ''),
- R.replace(/(-)\1+/g, '-'),
- R.replace(/[^a-z0-9]/gi, '-'),
- R.toLower
-);
+export const fsSafeName = XP.toIdentifier;
const getLibNames = R.compose(
- R.reject(R.equals('xod/built-in')), // TODO: hardcoded magic name
R.uniq,
- R.map(R.pipe(XP.getPatchPath, XP.getLibraryName)),
+ R.map(XP.getLibraryName),
+ R.reject(XP.isPathBuiltIn),
+ R.map(XP.getPatchPath),
XP.listLibraryPatches
); | refactor(xod-fs): reuse some functions from xod-project | xodio_xod | train | js |
c9f13e0db35e9855450287726a6827f1ee1802c5 | diff --git a/lib/blueprinter/extractors/auto_extractor.rb b/lib/blueprinter/extractors/auto_extractor.rb
index <HASH>..<HASH> 100644
--- a/lib/blueprinter/extractors/auto_extractor.rb
+++ b/lib/blueprinter/extractors/auto_extractor.rb
@@ -1,4 +1,5 @@
module Blueprinter
+ # @api private
class AutoExtractor < Extractor
def initialize
@hash_extractor = HashExtractor.new | Add private tag to AutoExtractor | procore_blueprinter | train | rb |
d07c75ccc139d8b55b782e5e7719f802a61f044a | diff --git a/KairosProject/ApiLoader/Loader/AbstractApiLoader.php b/KairosProject/ApiLoader/Loader/AbstractApiLoader.php
index <HASH>..<HASH> 100644
--- a/KairosProject/ApiLoader/Loader/AbstractApiLoader.php
+++ b/KairosProject/ApiLoader/Loader/AbstractApiLoader.php
@@ -104,7 +104,7 @@ abstract class AbstractApiLoader implements ApiLoaderInterface
*
* @var boolean
*/
- private const NO_ITEM_EXCEPTION = true;
+ protected const NO_ITEM_EXCEPTION = true;
/**
* Logger. | #<I> set default no item exception configuration as protected constant | kairosProject_ApiLoader | train | php |
465083169e33d35375aaa35ae9ea23e98be56527 | diff --git a/can-observe.js b/can-observe.js
index <HASH>..<HASH> 100644
--- a/can-observe.js
+++ b/can-observe.js
@@ -24,7 +24,7 @@ var observe = function(obj){
target[key] = observe(value);
}
if (key !== "_cid" && has.call(target, key)) {
- Observation.add(target, key);
+ Observation.add(target, key.toString());
}
return target[key];
}, | Pass Observation.add() a string event rather than a symbol | canjs_can-observe | train | js |
a6f9e33d87b25cfd34b3651999d44f99ebac18b9 | diff --git a/firecloud/fiss.py b/firecloud/fiss.py
index <HASH>..<HASH> 100644
--- a/firecloud/fiss.py
+++ b/firecloud/fiss.py
@@ -1995,12 +1995,13 @@ def main(argv=None):
subp.set_defaults(func=health)
subp = subparsers.add_parser('attr_get',
- description='Retrieve values of attribute(s) from given entity',
+ description='Retrieve attribute values from an entity identified by '\
+ 'name and type. If either name or type are omitted then workspace '\
+ 'attributes will be returned.',
parents=[workspace_parent, attr_parent])
# etype_parent not used for attr_get, because entity type is optional
etype_help = 'Entity type to retrieve annotations from. '
- etype_help += 'If omitted, workspace attributes will be retrieved'
etype_choices=['participant', 'participant_set', 'sample', 'sample_set',
'pair', 'pair_set' ]
subp.add_argument('-t', '--entity-type', choices=etype_choices, | clarify how attr_get works, as a partial response to issue #<I> | broadinstitute_fiss | train | py |
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.