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
|
---|---|---|---|---|---|
fd64f1af5ad651edf4e99fc0922d6e97ff175a50 | diff --git a/migrations/20150223121338_notices_table.php b/migrations/20150223121338_notices_table.php
index <HASH>..<HASH> 100644
--- a/migrations/20150223121338_notices_table.php
+++ b/migrations/20150223121338_notices_table.php
@@ -19,8 +19,8 @@ class NoticesTable extends AbstractMigration
->addColumn('text', 'integer')
->addColumn('start_time', 'datetime')
->addColumn('end_time', 'datetime')
- ->addColumn('hidden', 'boolean')
- ->addColumn('frontpage', 'boolean')
+ ->addColumn('hidden', 'boolean', array('null' => false, 'default' => 0))
+ ->addColumn('frontpage', 'boolean', array('null' => false, 'default' => 1))
->addColumn('sort_order', 'integer')
->create(); | Improve migration for notices to include default value | FelixOnline_BaseApp | train | php |
7b2ec23e128741641b19aeca6d149f667a12e648 | diff --git a/jutil/bank_const_se.py b/jutil/bank_const_se.py
index <HASH>..<HASH> 100644
--- a/jutil/bank_const_se.py
+++ b/jutil/bank_const_se.py
@@ -45,6 +45,6 @@ SE_BANK_CLEARING_LIST = ( # 46
('Skandiabanken AB', '9150', '9169', 7),
('Sparbanken Syd', '9570', '9579', 8),
('Swedbank', '7000', '7999', 7),
- ('Swedbank', '8000', '8999', 10),
+ ('Swedbank', '8000', '8999', 8),
('Ålandsbanken Abp', '2300', '2399', 7),
) | reduced Swedbank account number length requirement | kajala_django-jutil | train | py |
feb0385e279fb879d7dcb317830c6aa0c66bf56e | diff --git a/lib/beaker-pe/version.rb b/lib/beaker-pe/version.rb
index <HASH>..<HASH> 100644
--- a/lib/beaker-pe/version.rb
+++ b/lib/beaker-pe/version.rb
@@ -3,7 +3,7 @@ module Beaker
module PE
module Version
- STRING = '1.32.0'
+ STRING = '1.33.0'
end
end | (GEM) update beaker-pe version to <I> | puppetlabs_beaker-pe | train | rb |
55121429ee4dbd26eb2ce1a597af1a6c3c8042cd | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -70,18 +70,23 @@ load.read = function read(filename, options) {
};
load.validateOptions = function validateOptions(options) {
+ /* istanbul ignore if */
if (typeof options !== 'object') {
throw new TypeError('options must be an object');
}
+ /* istanbul ignore if */
if (typeof options.lex !== 'function') {
throw new TypeError('options.lex must be a function');
}
+ /* istanbul ignore if */
if (typeof options.parse !== 'function') {
throw new TypeError('options.parse must be a function');
}
+ /* istanbul ignore if */
if (options.resolve && typeof options.resolve !== 'function') {
throw new TypeError('options.resolve must be a function');
}
+ /* istanbul ignore if */
if (options.read && typeof options.read !== 'function') {
throw new TypeError('options.read must be a function');
} | Ignore branches in validateOptions in coverage report | pugjs_pug-load | train | js |
5e41afdc8b754910600f1de57459f95a33b19cfe | diff --git a/webpack.config.js b/webpack.config.js
index <HASH>..<HASH> 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -40,7 +40,7 @@ module.exports = {
filename: "./index.html",
}),
-// Replacement for deprecated extract-text-webpack-plugin
+ // Replacement for deprecated extract-text-webpack-plugin
// https://github.com/webpack-contrib/mini-css-extract-plugin
new MiniCssExtractPlugin({
filename: '[name].css', | Update webpack.config.js
Fix comment indentation. | attivio_suit | train | js |
3c9b62645feb01cd0fa3b386ba49fdbb6f43a32e | diff --git a/code/SpamProtectorManager.php b/code/SpamProtectorManager.php
index <HASH>..<HASH> 100644
--- a/code/SpamProtectorManager.php
+++ b/code/SpamProtectorManager.php
@@ -46,7 +46,10 @@ class SpamProtectorManager {
user_error("Spam Protector class '$protectorClass' does not exist. Please define a valid Spam Protector", E_USER_WARNING);
}
- $protector = new $protectorClass();
+ if(!is_object($protector)) {
+ $protector = new $protectorClass();
+ }
+
try {
$check = $protector->updateForm($form, $before, $fieldsToSpamServiceMapping);
} catch (Exception $e) { | BUGFIX If $protector is not an object, create it | silverstripe_silverstripe-spamprotection | train | php |
8a3671bdbc71dcb7102f2d0c9f0de48aa016c502 | diff --git a/Kwf_js/Binding/AbstractPanel.js b/Kwf_js/Binding/AbstractPanel.js
index <HASH>..<HASH> 100644
--- a/Kwf_js/Binding/AbstractPanel.js
+++ b/Kwf_js/Binding/AbstractPanel.js
@@ -106,7 +106,7 @@ Ext.extend(Kwf.Binding.AbstractPanel, Ext.Panel,
}
this._loadBinding(b);
}, this);
- } else {
+ } else if (this.activeId != 0) {
this.bindings.each(function(b) {
b.item.disable();
}, this); | fix masking form after clicking add button bug | koala-framework_koala-framework | train | js |
83915808d04b2c873b341f107a0547023fc4d064 | diff --git a/lib/cinch/bot.rb b/lib/cinch/bot.rb
index <HASH>..<HASH> 100644
--- a/lib/cinch/bot.rb
+++ b/lib/cinch/bot.rb
@@ -101,7 +101,7 @@ module Cinch
# @yield Expects a block containing method definitions
# @return [void]
def helpers(&b)
- Callback.class_eval(&b)
+ @callback.instance_eval(&b)
end
# Since Cinch uses threads, all handlers can be run | define helpers on the callback instance specific to the bot | cinchrb_cinch | train | rb |
f044a6bd71cd9c30175f4153413ff45f0cccec4b | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -28,6 +28,11 @@ setup(
'Programming Language :: Python :: 3.6',
],
install_requires=['requests>=2.5'],
- tests_require=['responses'],
+ extras_require={
+ 'test': ['responses'],
+ },
+ # A better way to specify test requirements
+ # see https://github.com/pypa/pip/issues/1197#issuecomment-228939212
+ tests_require=['castle[test]'],
test_suite='castle.test.all'
) | a better way to specify test requirements
main benefit is that it makes them installable by running `pip install -e .[test]`
see <URL> | castle_castle-python | train | py |
316333d40aee04958eae2e1798094887cf3577f1 | diff --git a/graphitesend/__init__.py b/graphitesend/__init__.py
index <HASH>..<HASH> 100644
--- a/graphitesend/__init__.py
+++ b/graphitesend/__init__.py
@@ -1 +1 @@
-from graphitesend import * # noqa
+from .graphitesend import * # noqa | fix: Init can use relative imports (#<I>)
Using a relative import solves a discrepancy between Python <I> and
<I>. For some reason, <I> brings all the module objects down to the
expected `graphitesend.*` level using an absolute import, while <I>
leaves the objects at the `graphitesend.graphitesend.*` level. The
relative import will bring everything down to `graphitesend.*` for
<I> and <I>. | daniellawrence_graphitesend | train | py |
3396f343a1464a6f5a0541cb88e0abd591d88a89 | diff --git a/trunk/JLanguageTool/src/java/org/languagetool/AnalyzedTokenReadings.java b/trunk/JLanguageTool/src/java/org/languagetool/AnalyzedTokenReadings.java
index <HASH>..<HASH> 100644
--- a/trunk/JLanguageTool/src/java/org/languagetool/AnalyzedTokenReadings.java
+++ b/trunk/JLanguageTool/src/java/org/languagetool/AnalyzedTokenReadings.java
@@ -258,14 +258,8 @@ public class AnalyzedTokenReadings {
*/
public void setParaEnd() {
if (!isParaEnd()) {
- final AnalyzedToken paragraphEnd;
- if (anTokReadings.length == 0) {
- // workaround for ArraysOutOfBounds (bug #3537500) until the real reason is found:
- paragraphEnd = new AnalyzedToken(getToken(), JLanguageTool.PARAGRAPH_END_TAGNAME, null);
- } else {
- paragraphEnd = new AnalyzedToken(getToken(),
- JLanguageTool.PARAGRAPH_END_TAGNAME, getAnalyzedToken(0).getLemma());
- }
+ final AnalyzedToken paragraphEnd = new AnalyzedToken(getToken(),
+ JLanguageTool.PARAGRAPH_END_TAGNAME, getAnalyzedToken(0).getLemma());
addReading(paragraphEnd);
}
} | undo yesterday's workaround, as Marcin writes: "I think the main reason was that in <I> a disambiguation rule might exist that removed the only reading of the token. At the same time, it had to preserve settings such as "is a paragraph end", hence, the exception. It should be fixed already." | languagetool-org_languagetool | train | java |
61462377526a7b04369c62d683c1abb0ca4b1dee | diff --git a/rmsd/calculate_rmsd.py b/rmsd/calculate_rmsd.py
index <HASH>..<HASH> 100755
--- a/rmsd/calculate_rmsd.py
+++ b/rmsd/calculate_rmsd.py
@@ -14,7 +14,7 @@ https://github.com/charnley/rmsd
"""
-__version__ = '1.2.6'
+__version__ = '1.2.7'
import copy
import numpy as np
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -3,8 +3,7 @@
import setuptools
import os
-# import rmsd for version
-import rmsd
+__version__ = '1.2.7'
# Find the absolute path
here = os.path.abspath(os.path.dirname(__file__))
@@ -16,7 +15,7 @@ with open(os.path.join(here, 'README.rst')) as f:
short_description = 'Calculate root-mean-square deviation (RMSD), using Kabsch or Quaternion algorithm for rotation, between two Cartesian coordinates in .xyz or .pdb format, resulting in the minimal RMSD.'
setuptools.setup(name='rmsd',
- version=rmsd.__version__,
+ version=__version__,
maintainer='Jimmy Kromann',
maintainer_email='[email protected]',
description=short_description, | moved __version__ to setup file | charnley_rmsd | train | py,py |
fcaff746e3f9cba81b065c09885abd34f0f29b83 | diff --git a/tweepy/models.py b/tweepy/models.py
index <HASH>..<HASH> 100644
--- a/tweepy/models.py
+++ b/tweepy/models.py
@@ -47,7 +47,8 @@ class Status(Model):
status = cls(api)
for k, v in json.items():
if k == 'user':
- user = User.parse(api, v)
+ user_model = getattr(api.parser.model_factory, 'user')
+ user = user_model.parse(api, v)
setattr(status, 'author', user)
setattr(status, 'user', user) # DEPRECIATED
elif k == 'created_at': | Fixed default status parser to use user model from the model factory. This enables use of one's own user models. | tweepy_tweepy | train | py |
19987411b581ad5e742326984a9fcc2c8e0a4706 | diff --git a/bosh_cli_plugin_aws/lib/bosh_cli_plugin_aws/ec2.rb b/bosh_cli_plugin_aws/lib/bosh_cli_plugin_aws/ec2.rb
index <HASH>..<HASH> 100644
--- a/bosh_cli_plugin_aws/lib/bosh_cli_plugin_aws/ec2.rb
+++ b/bosh_cli_plugin_aws/lib/bosh_cli_plugin_aws/ec2.rb
@@ -203,7 +203,13 @@ module Bosh
end
def terminatable_instances
- aws_ec2.instances.reject { |i| i.api_termination_disabled? || i.status.to_s == "terminated" }
+ aws_ec2.instances.reject do |i|
+ begin
+ i.api_termination_disabled? || i.status.to_s == "terminated"
+ rescue AWS::Core::Resource::NotFound
+ # ignoring instances which disappear while we are going through them
+ end
+ end
end
def releasable_elastic_ips | ignoring instances which disappear while we are going through them | cloudfoundry_bosh | train | rb |
e9b4ad5c29d584ae7e857b85115126cd16b3ac0c | diff --git a/ezp/Base/Model.php b/ezp/Base/Model.php
index <HASH>..<HASH> 100644
--- a/ezp/Base/Model.php
+++ b/ezp/Base/Model.php
@@ -236,7 +236,8 @@ abstract class Model implements Observable, ModelInterface
*/
public function __isset( $property )
{
- return isset( $this->readWriteProperties[$property] ) || isset( $this->dynamicProperties[$property] );
+ return ( isset( $this->readWriteProperties[$property] ) && isset( $this->properties->$property ) )
+ || ( isset( $this->dynamicProperties[$property] ) && isset( $this->$property ) );
}
/** | Change: Model->__isset() to actually check if property is set as well (so it returns false if value is null) | ezsystems_ezpublish-kernel | train | php |
d6ac3374f32449a7e2077a2aacf8544b8abc1305 | diff --git a/openquake/server/tests/tests.py b/openquake/server/tests/tests.py
index <HASH>..<HASH> 100644
--- a/openquake/server/tests/tests.py
+++ b/openquake/server/tests/tests.py
@@ -31,14 +31,13 @@ import unittest
import tempfile
import numpy
from django.test import Client
-from openquake.baselib.general import writetmp, _get_free_port
+from openquake.baselib.general import writetmp
from openquake.engine.export import core
from openquake.server.db import actions
from openquake.server.dbserver import db, get_status
class EngineServerTestCase(unittest.TestCase):
- hostport = 'localhost:%d' % _get_free_port()
datadir = os.path.join(os.path.dirname(__file__), 'data')
# general utilities | Removed hostport [skip CI] | gem_oq-engine | train | py |
60baf63418d2983cec1249d33939d5ecab75baf2 | diff --git a/src/frontend/org/voltdb/sysprocs/SnapshotRestore.java b/src/frontend/org/voltdb/sysprocs/SnapshotRestore.java
index <HASH>..<HASH> 100644
--- a/src/frontend/org/voltdb/sysprocs/SnapshotRestore.java
+++ b/src/frontend/org/voltdb/sysprocs/SnapshotRestore.java
@@ -1115,7 +1115,7 @@ public class SnapshotRestore extends VoltSystemProcedure
final ZooKeeper zk = VoltDB.instance().getHostMessenger().getZK();
HOST_LOG.info("Requesting truncation snapshot to make data loaded by snapshot restore durable.");
zk.create(
- VoltZK.truncation_snapshot_path,
+ VoltZK.request_truncation_snapshot,
null,
Ids.OPEN_ACL_UNSAFE,
CreateMode.PERSISTENT, | ENG-<I>: Oops, wrong ZK path for requesting truncation snapshot. | VoltDB_voltdb | train | java |
4d819311b5e51909e382dba692120475c6942166 | diff --git a/lib/simple_form/inputs/boolean_input.rb b/lib/simple_form/inputs/boolean_input.rb
index <HASH>..<HASH> 100644
--- a/lib/simple_form/inputs/boolean_input.rb
+++ b/lib/simple_form/inputs/boolean_input.rb
@@ -54,8 +54,8 @@ module SimpleForm
end
def inline_label
- inline_label = options[:inline_label]
- inline_label == true ? label_text : inline_label
+ inline_option = options[:inline_label]
+ inline_option == true ? label_text : inline_option
end
# Booleans are not required by default because in most of the cases | Rename variable, better not use the same name as the method :bomb: [ci skip] | plataformatec_simple_form | train | rb |
0283e40a1594ac7f4ef969d48a85a80db55526ff | diff --git a/mpd.py b/mpd.py
index <HASH>..<HASH> 100644
--- a/mpd.py
+++ b/mpd.py
@@ -389,7 +389,8 @@ class MPDClient():
sock = socket.socket(af, socktype, proto)
sock.connect(sa)
return sock
- except socket.error as err:
+ except socket.error as e:
+ err = e
if sock is not None:
sock.close()
if err is not None: | mpd.py fix shadowed variable in _connect_tcp()
In python3 named except blocks, will not longer overwrite local
variable. Instead the variable is not accessable after the try-except
statement -> NameError. | Mic92_python-mpd2 | train | py |
30423d3d6d9180c6a0bcd510eb23614246ee6166 | diff --git a/src/Exception/ConnectionException.php b/src/Exception/ConnectionException.php
index <HASH>..<HASH> 100644
--- a/src/Exception/ConnectionException.php
+++ b/src/Exception/ConnectionException.php
@@ -35,7 +35,11 @@ class ConnectionException extends StompException
$this->connectionInfo = $connection;
$host = ($previous ? $previous->getHostname() : null) ?: $this->getHostname();
- parent::__construct(sprintf('%s (Host: %s)', $info, $host), 0, $previous);
+
+ if ($host) {
+ $info = sprintf('%s (Host: %s)', $info, $host);
+ }
+ parent::__construct($info, 0, $previous);
} | Prevent exception-messages with empty "Host" identifier (#<I>) | stomp-php_stomp-php | train | php |
a5799fd8671e5a1c2922dcc434c886fc370b46c1 | diff --git a/oauthlib/oauth1/rfc5849/endpoints/access_token.py b/oauthlib/oauth1/rfc5849/endpoints/access_token.py
index <HASH>..<HASH> 100644
--- a/oauthlib/oauth1/rfc5849/endpoints/access_token.py
+++ b/oauthlib/oauth1/rfc5849/endpoints/access_token.py
@@ -141,7 +141,7 @@ class AccessTokenEndpoint(BaseEndpoint):
if not self.request_validator.validate_timestamp_and_nonce(
request.client_key, request.timestamp, request.nonce, request,
- access_token=request.resource_owner_key):
+ request_token=request.resource_owner_key):
return False, request
# The server SHOULD return a 401 (Unauthorized) status code when | Changed access_token.py - validate_access_token_request passes the resource owner key as an access token, which doesn't yet exist, instead of a request token | oauthlib_oauthlib | train | py |
43b66ec99b3b801cdd4640861d9b2468c5f9cc73 | diff --git a/python/herald/beans.py b/python/herald/beans.py
index <HASH>..<HASH> 100644
--- a/python/herald/beans.py
+++ b/python/herald/beans.py
@@ -205,6 +205,14 @@ class Peer(object):
"""
return access_id in self.__accesses
+ def has_accesses(self):
+ """
+ Checks if the peer has any access
+
+ :return: True if the peer has at least one access
+ """
+ return bool(self.__accesses)
+
def set_access(self, access_id, data):
"""
Sets the description associated to an access ID.
diff --git a/python/herald/directory.py b/python/herald/directory.py
index <HASH>..<HASH> 100644
--- a/python/herald/directory.py
+++ b/python/herald/directory.py
@@ -205,6 +205,10 @@ class HeraldDirectory(object):
_logger.exception("Error notifying a transport directory: %s",
ex)
+ if not peer.has_accesses():
+ # Peer has no more access, unregister it
+ self.unregister(peer.uid)
+
def dump(self):
"""
Dumps the content of the local directory in a dictionary | Unregister a peer when it doesn't have any access left | cohorte_cohorte-herald | train | py,py |
f030b1f9020deacd55cf900eb35d855918b20d5b | diff --git a/lib/flapjack/transports/beanstalkd.rb b/lib/flapjack/transports/beanstalkd.rb
index <HASH>..<HASH> 100644
--- a/lib/flapjack/transports/beanstalkd.rb
+++ b/lib/flapjack/transports/beanstalkd.rb
@@ -1,6 +1,8 @@
#!/usr/bin/env ruby
+$: << File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
require 'beanstalk-client'
+require 'flapjack/transports/result'
module Flapjack
module Transport | setup loadpath so there's less typing | flapjack_flapjack | train | rb |
b52527efb84cbb84c5a0ea5f25537b0a2ff8ca57 | diff --git a/angr/storage/memory_mixins/paged_memory/paged_memory_mixin.py b/angr/storage/memory_mixins/paged_memory/paged_memory_mixin.py
index <HASH>..<HASH> 100644
--- a/angr/storage/memory_mixins/paged_memory/paged_memory_mixin.py
+++ b/angr/storage/memory_mixins/paged_memory/paged_memory_mixin.py
@@ -268,7 +268,7 @@ class PagedMemoryMixin(MemoryMixin):
page = self._initialize_default_page(pageno, permissions=permissions, **kwargs)
self._pages[pageno] = page
if init_zero:
- page.store(0, None, size=self.page_size, endness='Iend_BE', **kwargs)
+ page.store(0, None, size=self.page_size, endness='Iend_BE', page_addr=pageno*self.page_size, **kwargs)
def _unmap_page(self, pageno, **kwargs):
try: | page_addr needs to be passed everywhere. | angr_angr | train | py |
400133b19a59f7569509cbf2d0453529e2bf0c7f | diff --git a/Embed/Adapters/Adapter.php b/Embed/Adapters/Adapter.php
index <HASH>..<HASH> 100644
--- a/Embed/Adapters/Adapter.php
+++ b/Embed/Adapters/Adapter.php
@@ -218,7 +218,7 @@ abstract class Adapter
if ($this->options['getBiggerImage']) {
$image = $this->getBiggerImage(FastImage::getImagesSize($this->images));
- if ($image) {
+ if ($image && ($image['width'] >= $this->options['minImageWidth']) && ($image['height'] >= $this->options['minImageHeight'])) {
$this->imageWidth = $image['width'];
$this->imageHeight = $image['height']; | getBiggerImage checks also the minImageWith and minImageHeight | oscarotero_Embed | train | php |
30de6a67b079386712c8f61fd3e3a85f21676036 | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -121,6 +121,7 @@ module.exports = function (grunt) {
connect: {
server: {
options: {
+ hostname: '*',
port: 8000
}
} | GruntFile: made Connect accept all hostnames for VM testing | ExactTarget_fuelux | train | js |
974ea3e3cbfda32419e3437f8852c7f42ad8bb45 | diff --git a/version/version.go b/version/version.go
index <HASH>..<HASH> 100644
--- a/version/version.go
+++ b/version/version.go
@@ -6,9 +6,9 @@ const (
// VersionMajor is for an API incompatible changes
VersionMajor = 5
// VersionMinor is for functionality in a backwards-compatible manner
- VersionMinor = 15
+ VersionMinor = 16
// VersionPatch is for backwards-compatible bug fixes
- VersionPatch = 1
+ VersionPatch = 0
// VersionDev indicates development branch. Releases will be empty string.
VersionDev = "-dev" | bump main branch to <I>-dev
Since we now have a release-<I> branch, the <I>.x series will be cut
from there. | containers_image | train | go |
1a88a9ca0e8aad6f96e86b0b8fa618d41758531c | diff --git a/claripy/vsa/strided_interval.py b/claripy/vsa/strided_interval.py
index <HASH>..<HASH> 100644
--- a/claripy/vsa/strided_interval.py
+++ b/claripy/vsa/strided_interval.py
@@ -1046,8 +1046,13 @@ class StridedInterval(BackendObject):
@property
@reversed_processor
def max(self):
+ """
+ Treat this StridedInterval as a set of unsigned numbers, and return the greatest one
+ :return: the greatest number in this StridedInterval when evaluated as unsigned, or None if empty
+ """
if not self.is_empty:
- return self.upper_bound
+ splitted = self._ssplit()
+ return splitted[0].upper_bound
else:
# It is empty!
return None
@@ -1055,15 +1060,20 @@ class StridedInterval(BackendObject):
@property
@reversed_processor
def min(self):
+ """
+ Treat this StridedInterval as a set of unsigned numbers, and return the smallest one
+ :return: the smallest number in this StridedInterval when evaluated as unsigned, or None if empty
+ """
if not self.is_empty:
- return self.lower_bound
+ splitted = self._ssplit()
+ return splitted[-1].lower_bound
else:
# It is empty
return None
@property
def unique(self):
- return self.min is not None and self.min == self.max
+ return self.lower_bound is not None and self.lower_bound == self.upper_bound
def _min_bits(self):
v = self._upper_bound | Redefine max and min for StridedInterval | angr_claripy | train | py |
829102ef71b8cfe7e16532a13b0ed665b6253f21 | diff --git a/src/yajra/Oci8/Oci8Connection.php b/src/yajra/Oci8/Oci8Connection.php
index <HASH>..<HASH> 100644
--- a/src/yajra/Oci8/Oci8Connection.php
+++ b/src/yajra/Oci8/Oci8Connection.php
@@ -32,16 +32,6 @@ class Oci8Connection extends Connection {
}
/**
- * Get the schema grammar used by the connection.
- *
- * @return \yajra\Oci8\Schema\Grammars\OracleGrammar
- */
- public function getSchemaGrammar()
- {
- return $this->getDefaultSchemaGrammar();
- }
-
- /**
* Get the default post processor instance.
*
* @return \yajra\Oci8\Query\Processors\OracleProcessor | remove getSchemaGrammar and just inherit from parent class | yajra_laravel-oci8 | train | php |
08614f8f618924a4ffe9b7c78a0ad3cbaf900004 | diff --git a/src/FileUpload/Util.php b/src/FileUpload/Util.php
index <HASH>..<HASH> 100644
--- a/src/FileUpload/Util.php
+++ b/src/FileUpload/Util.php
@@ -39,7 +39,7 @@ class Util {
* @param integer $int
* @return float
*/
- public function fixIntegerOverflow($int) {
+ public static function fixIntegerOverflow($int) {
if ($int < 0) {
$int += 2.0 * (PHP_INT_MAX + 1);
}
@@ -47,4 +47,4 @@ class Util {
return $int;
}
-}
\ No newline at end of file
+} | Update Util.php
Added missing static keyword. | Gargron_fileupload | train | php |
d09d64c81462974435ae6a3b5f516e4ebfa951f1 | diff --git a/src/test/java/stormpot/FailurePrinterTestRule.java b/src/test/java/stormpot/FailurePrinterTestRule.java
index <HASH>..<HASH> 100644
--- a/src/test/java/stormpot/FailurePrinterTestRule.java
+++ b/src/test/java/stormpot/FailurePrinterTestRule.java
@@ -8,6 +8,11 @@ import org.junit.runners.model.Statement;
* A TestRule that ensures that any failing tests have their stack-trace
* printed to stderr.
*
+ * This is useful for when the tests are running on a build-server, and you'd
+ * like the details of any failure to be printed to the build-log. A nice thing
+ * if the build system does not make the build artifacts with the test failures
+ * available.
+ *
* @author cvh
*/
public class FailurePrinterTestRule implements TestRule { | elaborated on the purpose of the FailurePrinterTestRule. | chrisvest_stormpot | train | java |
8c822c9952acf35cba9411683fb92c51542131a3 | diff --git a/src/FrameReflower/Table.php b/src/FrameReflower/Table.php
index <HASH>..<HASH> 100644
--- a/src/FrameReflower/Table.php
+++ b/src/FrameReflower/Table.php
@@ -343,11 +343,6 @@ class Table extends AbstractFrameReflower
}
}
- if ($max_height !== "none" && $max_height !== "auto" && (float)$min_height > (float)$max_height) {
- // Swap 'em
- list($max_height, $min_height) = [$min_height, $max_height];
- }
-
if ($max_height !== "none" && $max_height !== "auto" && $height > (float)$max_height) {
$height = $max_height;
} | Remove one more instance of min/max swapping | dompdf_dompdf | train | php |
fda29ece3eb4b663ed9f85e7104ec0fb1435cf3a | diff --git a/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/server/ServerConverter.java b/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/server/ServerConverter.java
index <HASH>..<HASH> 100644
--- a/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/server/ServerConverter.java
+++ b/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/server/ServerConverter.java
@@ -214,9 +214,7 @@ public class ServerConverter {
}
}
- if (config.getTimeToLive() != null) {
- config.setTimeToLive(config.getTimeToLive());
- }
+ config.setTimeToLive(config.getTimeToLive());
if (config.isManagedOS()) {
request.managedOS(config.isManagedOS(), true); | #<I> Design API for clone/import server operations. Sonar warning fix | CenturyLinkCloud_clc-java-sdk | train | java |
d1f85e02138fed89626dcf28748bbcd5888906c6 | diff --git a/sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/communication/jdbc/connection/BackendConnection.java b/sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/communication/jdbc/connection/BackendConnection.java
index <HASH>..<HASH> 100644
--- a/sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/communication/jdbc/connection/BackendConnection.java
+++ b/sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/communication/jdbc/connection/BackendConnection.java
@@ -246,7 +246,7 @@ public final class BackendConnection implements AutoCloseable {
MasterVisitedManager.clear();
exceptions.addAll(closeResultSets());
exceptions.addAll(closeStatements());
- if (!stateHandler.isInTransaction() || forceClose) {
+ if (!stateHandler.isInTransaction() || forceClose || TransactionType.BASE == transactionType) {
exceptions.addAll(releaseConnections(forceClose));
}
stateHandler.doNotifyIfNecessary(); | release cached transaction for BASE transaction type in proxy (#<I>) | apache_incubator-shardingsphere | train | java |
a8c310c25326da7ace71bcb14264f52fbcd84a59 | diff --git a/lib/pagelib.php b/lib/pagelib.php
index <HASH>..<HASH> 100644
--- a/lib/pagelib.php
+++ b/lib/pagelib.php
@@ -483,10 +483,15 @@ class moodle_page {
}
/**
- * @return string a description of this page (context, page-type and sub-page.
+ * @return string a description of this page. Normally displayed in the footer in
+ * developer debug mode.
*/
public function debug_summary() {
- $summary = 'Context ' . print_context_name($this->context) . ' (context id ' . $this->context->id . '). ';
+ $summary = '';
+ $summary .= 'General type: ' . $this->generaltype . '. ';
+ if (!during_initial_install()) {
+ $summary .= 'Context ' . print_context_name($this->context) . ' (context id ' . $this->context->id . '). ';
+ }
$summary .= 'Page type ' . $this->pagetype . '. ';
if ($this->subpage) {
'Sub-page ' . $this->subpage . '. '; | Fix new install with developer debug on.
Can't print context name in the page footer before DB tables exist!
Also, show page generaltype in the footer. | moodle_moodle | train | php |
a127198a4b1f46f6b9bf07449fb0bf33319c71dd | diff --git a/lib/utils.js b/lib/utils.js
index <HASH>..<HASH> 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -4,7 +4,7 @@ var _ = require("lodash");
var devIp = require("dev-ip")();
var Immutable = require("immutable");
var portScanner = require("portscanner");
-var filePath = require("path");
+var path = require("path");
var UAParser = require("ua-parser-js");
var parser = new UAParser();
@@ -225,7 +225,7 @@ var utils = {
*/
willCauseReload: function (needles, haystack) {
return needles.some(function (needle) {
- return !_.contains(haystack, filePath.extname(needle).replace(".", ""));
+ return !_.contains(haystack, path.extname(needle).replace(".", ""));
});
},
isList: Immutable.List.isList, | fix(utils): rename the confusing variable name
`filePath` is used in L<I> - L<I>.
And other files are using `path` as a variable name of path module. | BrowserSync_browser-sync | train | js |
06b8def87d3fc4f113e72791dee594b667b75c89 | 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,5 +1,4 @@
-ACTIVERECORD_GEM_VERSION = ENV['ACTIVERECORD_GEM_VERSION'] || '~> 3.2.0'
if RUBY_VERSION >= '1.9'
require 'simplecov'
@@ -11,8 +10,6 @@ if RUBY_VERSION >= '1.9'
end
require 'rubygems'
-gem 'activerecord', ACTIVERECORD_GEM_VERSION
-
require 'active_record'
require 'logger'
require 'minitest/autorun' | Leave the gem versioning to the Gemfile. | dark-panda_activerecord-postgresql-extensions | train | rb |
3dffefd82b2e895ca2e934e3dc636c6bb523c9c8 | diff --git a/lib/manager/npm/post-update/index.js b/lib/manager/npm/post-update/index.js
index <HASH>..<HASH> 100644
--- a/lib/manager/npm/post-update/index.js
+++ b/lib/manager/npm/post-update/index.js
@@ -338,7 +338,7 @@ async function getAdditionalFiles(config, packageFiles) {
config.parentBranch
);
if (res.lockFile !== existingContent) {
- logger.debug('package-lock.json needs updating');
+ logger.debug(`${lockFile} needs updating`);
updatedLockFiles.push({
name: lockFile,
contents: res.lockFile,
diff --git a/lib/manager/npm/post-update/npm.js b/lib/manager/npm/post-update/npm.js
index <HASH>..<HASH> 100644
--- a/lib/manager/npm/post-update/npm.js
+++ b/lib/manager/npm/post-update/npm.js
@@ -52,8 +52,8 @@ async function generateLockFile(tmpDir, env, filename) {
}
}
}
- logger.debug(`Using npm: ${cmd}`);
cmd = `${cmd} --version && ${cmd} install --package-lock-only --no-audit`;
+ logger.debug(`Using npm: ${cmd}`);
// TODO: Switch to native util.promisify once using only node 8
({ stdout, stderr } = await exec(cmd, {
cwd: tmpDir, | logs: fix npm lockfile debug filename and command | renovatebot_renovate | train | js,js |
053eacd43b04191151a00bcb47b9e9eaa6dc3727 | diff --git a/lib/chef/encrypted_attribute/cache_lru.rb b/lib/chef/encrypted_attribute/cache_lru.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/encrypted_attribute/cache_lru.rb
+++ b/lib/chef/encrypted_attribute/cache_lru.rb
@@ -37,7 +37,7 @@ class Chef
:default => 1024,
:callbacks => begin
{ 'should not be lower that zero' => lambda { |x| x >= 0 } }
- end,
+ end
)
pop_tail unless arg.nil?
@max_size | CacheLru: deleted a coma before parenthesis | zuazo_chef-encrypted-attributes | train | rb |
db32763af34921aecca64e699c1eef26311a4e0f | diff --git a/src/Creatable.js b/src/Creatable.js
index <HASH>..<HASH> 100644
--- a/src/Creatable.js
+++ b/src/Creatable.js
@@ -133,7 +133,7 @@ class CreatableSelect extends React.Component {
if (
focusedOption &&
focusedOption === this._createPlaceholderOption &&
- shouldKeyDownEventCreateNewOption({ keyCode: event.keyCode })
+ shouldKeyDownEventCreateNewOption(event)
) {
this.createNewOption(); | Pass the entire event to shouldKeyDownEventCreateNewOption; (#<I>)
Necessary for things like `KeyboardEvent.shiftKey` | JedWatson_react-select | train | js |
0441a81bbefc105ed3330bd2fcb9825e7abf59c9 | diff --git a/wordfreq_builder/wordfreq_builder/ninja.py b/wordfreq_builder/wordfreq_builder/ninja.py
index <HASH>..<HASH> 100644
--- a/wordfreq_builder/wordfreq_builder/ninja.py
+++ b/wordfreq_builder/wordfreq_builder/ninja.py
@@ -280,7 +280,7 @@ def combine_lists(languages):
output_file = wordlist_filename('combined', language)
add_dep(lines, 'merge', input_files, output_file,
extra='wordfreq_builder/word_counts.py',
- params={'cutoff': 0})
+ params={'cutoff': 2})
output_cBpack = wordlist_filename(
'combined-dist', language, 'msgpack.gz') | We can put the cutoff back now
I took it out when a step in the English SUBTLEX process was outputting
frequencies instead of counts, but I've fixed that now.
Former-commit-id: 5c7a7ea<I>e<I>eb<I>e<I>e8c<I>e<I>d<I> | LuminosoInsight_wordfreq | train | py |
15c63e869b7abfad167433a5f754b4b39b6d4ba2 | diff --git a/saltapi/netapi/rest_cherrypy/app.py b/saltapi/netapi/rest_cherrypy/app.py
index <HASH>..<HASH> 100644
--- a/saltapi/netapi/rest_cherrypy/app.py
+++ b/saltapi/netapi/rest_cherrypy/app.py
@@ -40,8 +40,10 @@ A REST API for Salt
This is useful for bootstrapping a single-page JavaScript app.
app_path : ``/app``
The URL prefix to use for serving the HTML file specifed in the ``app``
- setting. Any path information after the specified path is ignored; this
- is useful for apps that utilize the HTML5 history API.
+ setting. This should be a simple name containing no slashes.
+
+ Any path information after the specified path is ignored; this is
+ useful for apps that utilize the HTML5 history API.
Example production configuration block:
@@ -946,7 +948,7 @@ class API(object):
setattr(self, url, cls())
if 'app' in self.apiopts:
- setattr(self, self.apiopts.get('app_path', 'app'), App())
+ setattr(self, self.apiopts.get('app_path', 'app').lstrip('/'), App())
def get_conf(self):
''' | Added fix for app_path settings that start with a slash
The CherryPy dispatcher we're using routes URLs by mapping attributes on
an object to the URL path. In other words, the attribute on the object
should not start with a slash. | saltstack_salt | train | py |
a3494bf94e0b279930cd5bc768d8f0531caf6a24 | diff --git a/app/src/Bolt/Configuration/ResourceManager.php b/app/src/Bolt/Configuration/ResourceManager.php
index <HASH>..<HASH> 100644
--- a/app/src/Bolt/Configuration/ResourceManager.php
+++ b/app/src/Bolt/Configuration/ResourceManager.php
@@ -44,7 +44,7 @@ class ResourceManager
* Classloader instance will use introspection to find root path
* String will be treated as an existing directory.
*/
- public function __construct(ClassLoader $loader, Request $request = null, $verifier = null)
+ public function __construct($loader, Request $request = null, $verifier = null)
{
if ($loader instanceof ClassLoader) { | this must have got overwritten in the merge | bolt_bolt | train | php |
1de75bda4bd4c98ca50bcdbcf5e94b388bf9a044 | diff --git a/tensor2tensor/bin/t2t_decoder.py b/tensor2tensor/bin/t2t_decoder.py
index <HASH>..<HASH> 100644
--- a/tensor2tensor/bin/t2t_decoder.py
+++ b/tensor2tensor/bin/t2t_decoder.py
@@ -134,11 +134,9 @@ def score_file(filename):
ckpt = ckpts.model_checkpoint_path
saver.restore(sess, ckpt)
# Run on each line.
- results = []
- lines = []
with tf.gfile.Open(filename) as f:
- text = f.read()
- lines = [l.strip() for l in text.split("\n")]
+ lines = f.readlines()
+ results = []
for line in lines:
tab_split = line.split("\t")
if len(tab_split) > 2: | fix scoring crash on empty targets.
PiperOrigin-RevId: <I> | tensorflow_tensor2tensor | train | py |
60d73df08f1d2819dbe0c0c4d34a38ad46e3c8dc | diff --git a/alignak/objects/timeperiod.py b/alignak/objects/timeperiod.py
index <HASH>..<HASH> 100644
--- a/alignak/objects/timeperiod.py
+++ b/alignak/objects/timeperiod.py
@@ -238,7 +238,7 @@ class Timeperiod(Item):
:return: time is valid or not
:rtype: bool
"""
- if self.has('exclude'):
+ if hasattr(self, 'exclude'):
for daterange in self.exclude:
if daterange.is_time_valid(t):
return False
@@ -898,7 +898,7 @@ class Timeperiod(Item):
:return: None
"""
new_exclude = []
- if self.has('exclude') and self.exclude != []:
+ if hasattr(self, 'exclude') and self.exclude != []:
logger.debug("[timeentry::%s] have excluded %s", self.get_name(), self.exclude)
excluded_tps = self.exclude
# print "I will exclude from:", excluded_tps | Clean: remove deprecated (known-) usages of Timeperiod.has() method | Alignak-monitoring_alignak | train | py |
38158451103be572d6e81e971797938df7bd22ea | diff --git a/railties/lib/rails/generators/named_base.rb b/railties/lib/rails/generators/named_base.rb
index <HASH>..<HASH> 100644
--- a/railties/lib/rails/generators/named_base.rb
+++ b/railties/lib/rails/generators/named_base.rb
@@ -221,7 +221,7 @@ module Rails
#
def self.check_class_collision(options = {}) # :doc:
define_method :check_class_collision do
- name = if respond_to?(:controller_class_name) # for ScaffoldBase
+ name = if respond_to?(:controller_class_name) # for ResourceHelpers
controller_class_name
else
class_name | Fix comment in `check_class_collision` [ci skip]
`ScaffoldBase` was changed to `ResourceHelpers` by 0efedf2. | rails_rails | train | rb |
4ad2c4e56a0602e22bb66d40324845ce351a8ea6 | diff --git a/pescador.py b/pescador.py
index <HASH>..<HASH> 100644
--- a/pescador.py
+++ b/pescador.py
@@ -108,7 +108,7 @@ def _buffer_data(data):
return np.asarray(data)
-def stream_buffer(stream, buffer_size, max_iter=None):
+def buffer_stream(stream, buffer_size, max_iter=None):
'''Buffer a stream into chunks of data.
:parameters:
@@ -359,7 +359,7 @@ class StreamLearner(sklearn.base.BaseEstimator):
'''
# Re-initialize the model, if necessary?
- for batch in stream_buffer(stream, self.batch_size, self.max_steps):
+ for batch in buffer_stream(stream, self.batch_size, self.max_steps):
self.__partial_fit(batch, **kwargs)
return self
diff --git a/tests.py b/tests.py
index <HASH>..<HASH> 100644
--- a/tests.py
+++ b/tests.py
@@ -1,11 +1,11 @@
import pescador
-def test_stream_buffer():
- stream = pescador.stream_buffer(range(3), 2, 1)
+def test_buffer_stream():
+ stream = pescador.buffer_stream(range(3), 2, 1)
for exp, act in zip([[0, 1]], stream):
assert exp == act
- stream = pescador.stream_buffer(range(3), 2, 2)
+ stream = pescador.buffer_stream(range(3), 2, 2)
for exp, act in zip([[0, 1], [2]], stream):
assert exp == act | Renamed 'stream_buffer' to imperative 'buffer_stream'; updated accordingly. | pescadores_pescador | train | py,py |
366f2098cde685ab5c91dbd4d215012eaaa08116 | diff --git a/cmd/dashboard/main.go b/cmd/dashboard/main.go
index <HASH>..<HASH> 100644
--- a/cmd/dashboard/main.go
+++ b/cmd/dashboard/main.go
@@ -122,6 +122,8 @@ Options:
}
defer s.Close()
+ s.StartDaemonRoutines()
+
log.Infof("create topom with config\n%s\n", config)
go func() { | Fix, call StartDaemonRoutines after topom's creation | CodisLabs_codis | train | go |
2e6fcf2a54361f4a175612245fddcfc8f3f06523 | diff --git a/redash_client.py b/redash_client.py
index <HASH>..<HASH> 100644
--- a/redash_client.py
+++ b/redash_client.py
@@ -87,6 +87,12 @@ class RedashClient(object):
return dash.json()["id"]
+ def publish_dashboard(self, dash_id):
+ requests.post(
+ self.BASE_URL + "/dashboards/" + str(dash_id) + "?api_key=" + self.api_key,
+ data = json.dumps({"is_draft": False})
+ )
+
def append_viz_to_dash(self, dash_id, viz_id, viz_width):
requests.post(
self.BASE_URL + "/widgets?api_key=" + self.api_key,
@@ -98,4 +104,3 @@ class RedashClient(object):
"text":""
}),
).json()
- | Add a publish_dashboard() function. | mozilla_redash_client | train | py |
d0d2e1d5f57fad91c7385d59bcc112c8b856299c | diff --git a/go/vt/vtgate/vtgate_test.go b/go/vt/vtgate/vtgate_test.go
index <HASH>..<HASH> 100644
--- a/go/vt/vtgate/vtgate_test.go
+++ b/go/vt/vtgate/vtgate_test.go
@@ -1325,7 +1325,7 @@ func TestVTGateMessageStreamRetry(t *testing.T) {
// which should make vtgate wait for 1s (5s/5) and retry.
start := time.Now()
<-ch
- duration := time.Since(start)
+ duration := time.Since(start).Round(time.Second)
if duration < 1*time.Second || duration > 2*time.Second {
t.Errorf("Retry duration should be around 1 second: %v", duration)
} | vtgate_test: round duration before checking | vitessio_vitess | train | go |
c74e196e3c0454d3377d5a4496e21056df7db767 | diff --git a/src/Psalm/Codebase.php b/src/Psalm/Codebase.php
index <HASH>..<HASH> 100644
--- a/src/Psalm/Codebase.php
+++ b/src/Psalm/Codebase.php
@@ -1201,9 +1201,9 @@ class Codebase
$method_storage = $this->methods->getStorage($declaring_method_id);
$completion_item = new \LanguageServerProtocol\CompletionItem(
- (string)$method_storage,
+ $method_storage->cased_name,
\LanguageServerProtocol\CompletionItemKind::METHOD,
- null,
+ (string)$method_storage,
null,
(string)$method_storage->visibility,
$method_storage->cased_name,
@@ -1223,9 +1223,9 @@ class Codebase
);
$completion_item = new \LanguageServerProtocol\CompletionItem(
- $property_storage->getInfo() . ' $' . $property_name,
+ '$' . $property_name,
\LanguageServerProtocol\CompletionItemKind::PROPERTY,
- null,
+ $property_storage->getInfo(),
null,
(string)$property_storage->visibility,
$property_name, | Improve autocompletion by using CompletionItem::$detail for type info (#<I>) | vimeo_psalm | train | php |
9eff4ed15ebc51d544c08a096e22263db7ab4de1 | diff --git a/lib/models.js b/lib/models.js
index <HASH>..<HASH> 100644
--- a/lib/models.js
+++ b/lib/models.js
@@ -1207,9 +1207,12 @@ class ConstraintHistoryItem {
}
toJSON() {
+ const constraintWithPath = Object.assign(this.constraint.toJSON(), {
+ path: this.constraint.path ? this.constraint.path.map(p=>p.fqn) : undefined
+ });
return {
- constraint: this.constraint.toJSON(),
- source: this.source.fqn
+ constraint: constraintWithPath,
+ source: this.source.fqn,
};
}
} | Added path information to constraint history constraints | standardhealth_shr-models | train | js |
8a870376bb9712b8fa111e1908802084836f68f2 | diff --git a/dygraph.js b/dygraph.js
index <HASH>..<HASH> 100644
--- a/dygraph.js
+++ b/dygraph.js
@@ -355,6 +355,10 @@ Dygraph.prototype.__init__ = function(div, file, attrs) {
attrs = Dygraph.mapLegacyOptions_(attrs);
+ if (typeof(div) == 'string') {
+ div = document.getElementById(div);
+ }
+
if (!div) {
Dygraph.error("Constructing dygraph with a non-existent div!");
return; | When div is of type string, replace it with a document element. | danvk_dygraphs | train | js |
3ca911bd784c4bfc1b504252e4e1d069ac7a387f | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -7,7 +7,7 @@ module.exports = {
included: function(app) {
this._super.included(app);
- app.import(app.bowerDirectory + '/raven-js/dist/raven.min.js');
+ app.import(app.bowerDirectory + '/raven-js/dist/raven.js');
},
contentFor: function(type, config) { | Import the non-minified version of raven-js | ember-cli-sentry_ember-cli-sentry | train | js |
8d9f71c46e8cb471ab9e83ccf5595badb810706c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -46,6 +46,9 @@ class build_py_with_cffi_marker(build_py):
install_requires = [
'alembic', # XXX I need Alembic, but not Mako or MarkupSafe.
'cffi >= 0.4.2',
+ # Requiring this version to get rid of lextab/yacctab
+ # files dumped in random places
+ 'pycparser >= 2.9.1',
'pyxdg',
'SQLAlchemy',
'contextlib2', | add a version requirement on pycparser to fix stray files | g2p_bedup | train | py |
34c4bd75741baf9880c0536aae8caab9032e1980 | diff --git a/bulk.go b/bulk.go
index <HASH>..<HASH> 100644
--- a/bulk.go
+++ b/bulk.go
@@ -240,7 +240,7 @@ func handleDML(args []string) {
externalId = args[1]
objectType = args[2]
file := args[3]
- if argLength == 5 {
+ if argLength == 5 || argLength == 6 {
setConcurrencyModeOrFileFormat(args[4])
if argLength == 6 {
setConcurrencyModeOrFileFormat(args[5])
@@ -250,7 +250,7 @@ func handleDML(args []string) {
} else {
objectType = args[1]
file := args[2]
- if argLength == 4 {
+ if argLength == 4 || argLength == 5 {
setConcurrencyModeOrFileFormat(args[3])
if argLength == 5 {
setConcurrencyModeOrFileFormat(args[4]) | Fix where conditionals would not get hit | ForceCLI_force | train | go |
3153bcba8eada0a0ba763eafe52af751f865aa5f | diff --git a/lib/danger/request_sources/bitbucket_server.rb b/lib/danger/request_sources/bitbucket_server.rb
index <HASH>..<HASH> 100644
--- a/lib/danger/request_sources/bitbucket_server.rb
+++ b/lib/danger/request_sources/bitbucket_server.rb
@@ -47,8 +47,8 @@ module Danger
end
def setup_danger_branches
- base_commit = self.pr_json[:toRef][:latestCommit]
- head_commit = self.pr_json[:fromRef][:latestCommit]
+ base_commit = self.pr_json[:toRef][:latestChangeset]
+ head_commit = self.pr_json[:fromRef][:latestChangeset]
# Next, we want to ensure that we have a version of the current branch at a known location
scm.ensure_commitish_exists! base_commit | Update the JSON parsing as per current stash response | danger_danger | train | rb |
727718e90dfc3d21b6c387005956e4f2183ab63a | diff --git a/salt/fileserver/hgfs.py b/salt/fileserver/hgfs.py
index <HASH>..<HASH> 100644
--- a/salt/fileserver/hgfs.py
+++ b/salt/fileserver/hgfs.py
@@ -324,7 +324,7 @@ def update():
log.error(
'Exception {0} caught while updating hgfs remote {1}'
.format(exc, repo['uri']),
- exc_info=log.isEnabledFor(logging.DEBUG)
+ exc_info_on_loglevel=logging.DEBUG
)
else:
newtip = repo['repo'].tip() | Use `exc_info_on_loglevel` instead of `exc_info` | saltstack_salt | train | py |
f5f5c6cda79485d132316279605ce3bbfedcd515 | diff --git a/web/app/mu-plugins/bedrock-autoloader.php b/web/app/mu-plugins/bedrock-autoloader.php
index <HASH>..<HASH> 100644
--- a/web/app/mu-plugins/bedrock-autoloader.php
+++ b/web/app/mu-plugins/bedrock-autoloader.php
@@ -95,7 +95,7 @@ class Autoloader {
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
self::$auto_plugins = get_plugins(self::$relative_path);
- self::$mu_plugins = get_mu_plugins(self::$relative_path);
+ self::$mu_plugins = get_mu_plugins();
$plugins = array_diff_key(self::$auto_plugins, self::$mu_plugins);
$rebuild = !is_array(self::$cache['plugins']);
self::$activated = ($rebuild) ? $plugins : array_diff_key($plugins, self::$cache['plugins']); | Remove argument from call to get_mu_plugins() | roots_bedrock | train | php |
29b10c6bd819e08ed16ef8e948875f4f22e2e838 | diff --git a/tryp/lazy_list.py b/tryp/lazy_list.py
index <HASH>..<HASH> 100644
--- a/tryp/lazy_list.py
+++ b/tryp/lazy_list.py
@@ -107,6 +107,10 @@ class LazyList(Generic[A], Implicits, implicits=True):
def foreach(self, f):
self.drain.foreach(f)
+ @fetch
+ def min_length(self, index):
+ return self._strict.length >= index
+
class LazyListFunctor(Functor): | LazyList.min_length
checks whether the list is at least the given number of elements large
without consuming all elements from the iterator | tek_amino | train | py |
c3182bd589868c027f298b84286c77321b6f9694 | diff --git a/command/command_test.go b/command/command_test.go
index <HASH>..<HASH> 100644
--- a/command/command_test.go
+++ b/command/command_test.go
@@ -466,9 +466,11 @@ func testStateOutput(t *testing.T, path string, expected string) {
func testProvider() *terraform.MockProvider {
p := new(terraform.MockProvider)
- p.PlanResourceChangeResponse = providers.PlanResourceChangeResponse{
- PlannedState: cty.EmptyObjectVal,
+ p.PlanResourceChangeFn = func(req providers.PlanResourceChangeRequest) (resp providers.PlanResourceChangeResponse) {
+ resp.PlannedState = req.ProposedNewState
+ return resp
}
+
p.ReadResourceFn = func(req providers.ReadResourceRequest) providers.ReadResourceResponse {
return providers.ReadResourceResponse{
NewState: req.PriorState, | mock provider needs to return a valid response | hashicorp_terraform | train | go |
1ee37c37432fbbd6bd0382ca09972979a56d7dec | diff --git a/openpnm/geometry/StickAndBall2D.py b/openpnm/geometry/StickAndBall2D.py
index <HASH>..<HASH> 100644
--- a/openpnm/geometry/StickAndBall2D.py
+++ b/openpnm/geometry/StickAndBall2D.py
@@ -231,6 +231,6 @@ class StickAndBall2D(GenericGeometry):
throat_endpoints='throat.endpoints',
throat_length='throat.length')
self.add_model(propname='throat.hydraulic_size_factors',
- model=mods.geometry.hydraulic_size_factors.cones_and_cylinders)
+ model=mods.geometry.hydraulic_size_factors.circles_and_rectangles)
self.add_model(propname='throat.diffusive_size_factors',
- model=mods.geometry.diffusive_size_factors.cones_and_cylinders)
+ model=mods.geometry.diffusive_size_factors.circles_and_rectangles) | Calling circle and rectangle size factors in StickAndBall2D now | PMEAL_OpenPNM | train | py |
f93278688be05ef20c685fe17cf8f10ab11d840a | diff --git a/lib/fog/aws/requests/storage/get_bucket_location.rb b/lib/fog/aws/requests/storage/get_bucket_location.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/aws/requests/storage/get_bucket_location.rb
+++ b/lib/fog/aws/requests/storage/get_bucket_location.rb
@@ -22,7 +22,8 @@ module Fog
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::Storage::AWS::GetBucketLocation.new,
- :query => {'location' => nil}
+ :query => {'location' => nil},
+ :path_style => true
})
end
end
diff --git a/lib/fog/aws/storage.rb b/lib/fog/aws/storage.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/aws/storage.rb
+++ b/lib/fog/aws/storage.rb
@@ -439,12 +439,6 @@ module Fog
@port = options[:port] || DEFAULT_SCHEME_PORT[@scheme]
end
- # no pathstyle given and signature version 4
- if options[:path_style].nil? && @signature_version == 4
- Fog::Logger.warning("fog: setting path_style to true for signature_version 4")
- @path_style = true
- end
-
setup_credentials(options)
end | issue #<I>, set path_style for get_bucket_location only, remove larger scope | fog_fog | train | rb,rb |
22fa50065083d5b4dc770ee71b706ce4e773b9c5 | diff --git a/lib/emailvision/api.rb b/lib/emailvision/api.rb
index <HASH>..<HASH> 100644
--- a/lib/emailvision/api.rb
+++ b/lib/emailvision/api.rb
@@ -95,13 +95,7 @@ module Emailvision
else
raise e
end
- rescue Errno::ECONNRESET => e
- if((retries -= 1) >= 0)
- retry
- else
- raise e
- end
- rescue Timeout::Error => e
+ rescue Errno::ECONNRESET, Timeout::Error => e
if((retries -= 1) >= 0)
retry
else | [API] Tiny refactor | basgys_emailvision | train | rb |
35a71d200a3b1f4272e27870761d0496b9a09ffc | diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -361,7 +361,8 @@ gulp.task('test:clientruntime:javaauthandroid', shell.task(basePathOrThrow() + '
gulp.task('test:clientruntime', function (cb) {
runSequence('test:clientruntime:node', 'test:clientruntime:nodeazure',
'test:clientruntime:ruby', 'test:clientruntime:rubyazure',
- 'test:clientruntime:java', 'test:clientruntime:javaazure', cb);
+ 'test:clientruntime:java', 'test:clientruntime:javaazure',
+ 'test:clientruntime:javaauthjdk', 'test:clientruntime:javaauthandroid', cb);
});
gulp.task('test:node', shell.task('npm test', {cwd: './AutoRest/Generators/NodeJS/NodeJS.Tests/', verbosity: 3})); | Add authentication lib build to gulp | Azure_autorest-clientruntime-for-java | train | js |
599bc2a1b10081c7aed22753e44f1aaa113f0398 | diff --git a/lib/danger/ci_source/azure_pipelines.rb b/lib/danger/ci_source/azure_pipelines.rb
index <HASH>..<HASH> 100644
--- a/lib/danger/ci_source/azure_pipelines.rb
+++ b/lib/danger/ci_source/azure_pipelines.rb
@@ -19,7 +19,7 @@ module Danger
#
class AzurePipelines < CI
def self.validates_as_ci?(env)
- env.key? "AGENT_ID"
+ env.key?("AGENT_ID") && env["BUILD_REPOSITORY_PROVIDER"] != "TfsGit"
end
def self.validates_as_pr?(env) | Fix run with Azure Pipelines as CI Source and Azure Repos Git as Request Source | danger_danger | train | rb |
1fcd267a76dbc6699e5d34c136245abec30bfd7c | diff --git a/packages/Php/src/Rector/Each/ListEachRector.php b/packages/Php/src/Rector/Each/ListEachRector.php
index <HASH>..<HASH> 100644
--- a/packages/Php/src/Rector/Each/ListEachRector.php
+++ b/packages/Php/src/Rector/Each/ListEachRector.php
@@ -21,7 +21,7 @@ final class ListEachRector extends AbstractRector
public function getDefinition(): RectorDefinition
{
return new RectorDefinition(
- 'each() function is deprecated.',
+ 'each() function is deprecated, use key() and current() instead',
[
new CodeSample(
<<<'CODE_SAMPLE' | updated description of ListEachRector | rectorphp_rector | train | php |
011f0fc6cd5770001e0b18f413a705a24c760456 | diff --git a/dispatcher/behavior/schedulable.php b/dispatcher/behavior/schedulable.php
index <HASH>..<HASH> 100644
--- a/dispatcher/behavior/schedulable.php
+++ b/dispatcher/behavior/schedulable.php
@@ -102,8 +102,6 @@ class ComSchedulerDispatcherBehaviorSchedulable extends KControllerBehaviorAbstr
if ($view instanceof KViewHtml && is_callable($condition) && $condition($context))
{
- $this->syncTasks();
-
// Create URL and encode using encodeURIComponent standards
$url = $this->getObject('request')->getUrl()->setQuery(array('scheduler' => 1, 'format' => 'json'), true);
$url = strtr(rawurlencode($url), array('%21'=>'!', '%2A'=>'*', '%27'=>"'", '%28'=>'(', '%29'=>')')); | Only sync tasks on asynchronous calls | joomlatools_joomlatools-framework | train | php |
428faad25f974d753b9b1f538effc7f73b859648 | diff --git a/lib/parfait/layout.rb b/lib/parfait/layout.rb
index <HASH>..<HASH> 100644
--- a/lib/parfait/layout.rb
+++ b/lib/parfait/layout.rb
@@ -66,7 +66,7 @@ module Parfait
end
def instance_length
- self.get_length / 2
+ (self.get_length / 2).to_i # to_i for opal
end
alias :super_index :index_of
@@ -80,7 +80,7 @@ module Parfait
has = super_index(name)
return nil unless has
raise "internal error #{name}:#{has}" if has < 1
- 1 + has / 2
+ (1 + has / 2).to_i # to_i for opal
end
def inspect | opal fix for indexes | ruby-x_rubyx | train | rb |
62d2bfbc0927ba7fdacebb4c8e7c1735efb9a1aa | diff --git a/lib/bson.rb b/lib/bson.rb
index <HASH>..<HASH> 100755
--- a/lib/bson.rb
+++ b/lib/bson.rb
@@ -86,7 +86,12 @@ else
end
require 'active_support'
-require 'active_support/hash_with_indifferent_access'
+begin
+ require 'active_support/hash_with_indifferent_access'
+rescue LoadError
+ # For ActiveSupport 2
+ require 'active_support/core_ext/hash/indifferent_access'
+end
require 'bson/types/binary'
require 'bson/types/code' | Fixed compatibility issue with ActiveSupport 2 | mongodb_mongo-ruby-driver | train | rb |
14e25e3117c8da9197b1218630652617484d9200 | diff --git a/js/_1btcxe.js b/js/_1btcxe.js
index <HASH>..<HASH> 100644
--- a/js/_1btcxe.js
+++ b/js/_1btcxe.js
@@ -17,7 +17,6 @@ module.exports = class _1btcxe extends Exchange {
'comment': 'Crypto Capital API',
'has': {
'CORS': true,
- 'fetchTickers': true,
'withdraw': true,
},
'timeframes': {
@@ -240,7 +239,9 @@ module.exports = class _1btcxe extends Exchange {
}
async request (path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
+ console.log('DEBUG: 1btcxe: request: about to fetch')
let response = await this.fetch2 (path, api, method, params, headers, body);
+ console.log('DEBUG: 1btcxe: request: fetched')
if ('errors' in response) {
let errors = [];
for (let e = 0; e < response['errors'].length; e++) { | 1btcxe, getbtc: fetchTickers not supported, removed from metainfo | ccxt_ccxt | train | js |
3fc0a36ac839e2a9acc85c09c1de9a04d9f9bb1f | diff --git a/Tests/Functional/TcaDataGenerator/GeneratorTest.php b/Tests/Functional/TcaDataGenerator/GeneratorTest.php
index <HASH>..<HASH> 100644
--- a/Tests/Functional/TcaDataGenerator/GeneratorTest.php
+++ b/Tests/Functional/TcaDataGenerator/GeneratorTest.php
@@ -15,9 +15,7 @@ namespace TYPO3\CMS\Styleguide\Tests\Functional\TcaDataGenerator;
* The TYPO3 project - inspiring people to share!
*/
-use TYPO3\CMS\Core\Core\ApplicationContext;
use TYPO3\CMS\Core\Core\Bootstrap;
-use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Styleguide\TcaDataGenerator\Generator;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; | [BUGFIX] Unused use in functional tests | TYPO3_styleguide | train | php |
a208e8d3806d12c962c2317b050433bec201583e | diff --git a/router/pump.go b/router/pump.go
index <HASH>..<HASH> 100644
--- a/router/pump.go
+++ b/router/pump.go
@@ -195,6 +195,7 @@ func (p *LogsPump) pumpLogs(event *docker.APIEvents, backlog bool, inactivityTim
return
}
+ var tail = getopt("TAIL", "all")
var sinceTime time.Time
if backlog {
sinceTime = time.Unix(0, 0)
@@ -215,7 +216,7 @@ func (p *LogsPump) pumpLogs(event *docker.APIEvents, backlog bool, inactivityTim
p.update(event)
go func() {
for {
- debug("pump.pumpLogs():", id, "started, tail:", getopt("TAIL", "all"))
+ debug("pump.pumpLogs():", id, "started, tail:", tail)
err := p.client.Logs(docker.LogsOptions{
Container: id,
OutputStream: outwr,
@@ -223,7 +224,7 @@ func (p *LogsPump) pumpLogs(event *docker.APIEvents, backlog bool, inactivityTim
Stdout: true,
Stderr: true,
Follow: true,
- Tail: getopt("TAIL", "all"),
+ Tail: tail,
Since: sinceTime.Unix(),
InactivityTimeout: inactivityTimeout,
RawTerminal: allowTTY, | review comment - single call to get tail envvar | gliderlabs_logspout | train | go |
ac050010e0b8e9c4b430dd496665863246f05c43 | diff --git a/pkg/cmd/server/start/start_kube_controller_manager.go b/pkg/cmd/server/start/start_kube_controller_manager.go
index <HASH>..<HASH> 100644
--- a/pkg/cmd/server/start/start_kube_controller_manager.go
+++ b/pkg/cmd/server/start/start_kube_controller_manager.go
@@ -169,6 +169,11 @@ func newKubeControllerManager(kubeconfigFile, saPrivateKeyFile, saRootCAFile, po
// virtual resource
componentconfig.GroupResource{Group: "project.openshift.io", Resource: "projects"},
+ // virtual and unwatchable resource, surfaced via rbac.authorization.k8s.io objects
+ componentconfig.GroupResource{Group: "authorization.openshift.io", Resource: "clusterroles"},
+ componentconfig.GroupResource{Group: "authorization.openshift.io", Resource: "clusterrolebindings"},
+ componentconfig.GroupResource{Group: "authorization.openshift.io", Resource: "roles"},
+ componentconfig.GroupResource{Group: "authorization.openshift.io", Resource: "rolebindings"},
// these resources contain security information in their names, and we don't need to track them
componentconfig.GroupResource{Group: "oauth.openshift.io", Resource: "oauthaccesstokens"},
componentconfig.GroupResource{Group: "oauth.openshift.io", Resource: "oauthauthorizetokens"}, | interesting: ignore authorization.openshift.io role/binding objects for GC | openshift_origin | train | go |
d7028e6c2e309d2acd295b5f5688eddd3c2e1bff | diff --git a/Tests/Api/StatementsApiClientTest.php b/Tests/Api/StatementsApiClientTest.php
index <HASH>..<HASH> 100644
--- a/Tests/Api/StatementsApiClientTest.php
+++ b/Tests/Api/StatementsApiClientTest.php
@@ -71,6 +71,24 @@ class StatementsApiClientTest extends ApiClientTest
$this->assertEquals($statement, $this->client->storeStatement($statement));
}
+ public function testStoreStatementWithIdEnsureThatTheIdIsNotOverwritten()
+ {
+ $statementId = '12345678-1234-5678-1234-567812345678';
+ $statement = $this->createStatement();
+ $statement->setId($statementId);
+ $this->validateStoreApiCall(
+ 'put',
+ 'statements',
+ array('statementId' => $statementId),
+ 204,
+ '',
+ $statement
+ );
+ $storedStatement = $this->client->storeStatement($statement);
+
+ $this->assertEquals($statementId, $storedStatement->getId());
+ }
+
public function testStoreStatements()
{
$statementId1 = '12345678-1234-5678-1234-567812345678'; | add a test case to ensure that a statement's id is not overwritten when it is stored in a learning record store (for #1) | php-xapi_client | train | php |
954214c1847012334377cd5770a27787f9de8cea | diff --git a/user.go b/user.go
index <HASH>..<HASH> 100644
--- a/user.go
+++ b/user.go
@@ -1,5 +1,11 @@
package goth
+import "encoding/gob"
+
+func init() {
+ gob.Register(User{})
+}
+
// User contains the information common amongst most OAuth and OAuth2 providers.
// All of the "raw" datafrom the provider can be found in the `RawData` field.
type User struct { | regiser goth.User with the gob package | markbates_goth | train | go |
9e28ea912e0f1944a571283d131b665ff293d8d9 | diff --git a/lib/strainer/command.rb b/lib/strainer/command.rb
index <HASH>..<HASH> 100644
--- a/lib/strainer/command.rb
+++ b/lib/strainer/command.rb
@@ -68,15 +68,18 @@ module Strainer
# when the block is finished.
#
# @yield The block to execute inside the sandbox
+ # @return [Boolean]
+ # `true` if the command exited successfully, `false` otherwise
def inside_sandbox(&block)
Strainer.ui.debug "Changing working directory to '#{Strainer.sandbox_path}'"
original_pwd = ENV['PWD']
ENV['PWD'] = Strainer.sandbox_path.to_s
- Dir.chdir(Strainer.sandbox_path, &block)
+ success = Dir.chdir(Strainer.sandbox_path, &block)
ENV['PWD'] = original_pwd
Strainer.ui.debug "Restored working directory to '#{original_pwd}'"
+ success
end
# Have this command output text, prefixing with its output with the | Fix for sandbox block not returning exit status | customink_strainer | train | rb |
0b5a6d48aa16efb1448a57e49873ec62576111bb | diff --git a/bcbio/variation/varscan.py b/bcbio/variation/varscan.py
index <HASH>..<HASH> 100644
--- a/bcbio/variation/varscan.py
+++ b/bcbio/variation/varscan.py
@@ -126,10 +126,9 @@ def _varscan_paired(align_bams, ref_file, items, target_regions, out_file):
" --output-vcf --min-coverage 5 --p-value 0.98 "
"--strand-filter 1 ")
# add minimum AF
- if "--min-var-freq" not in varscan_cmd:
- min_af = float(utils.get_in(paired.tumor_config, ("algorithm",
- "min_allele_fraction"), 10)) / 100.0
- varscan_cmd += "--min-var-freq {min_af} "
+ min_af = float(utils.get_in(paired.tumor_config, ("algorithm",
+ "min_allele_fraction"), 10)) / 100.0
+ varscan_cmd += "--min-var-freq {min_af} "
do.run(varscan_cmd.format(**locals()), "Varscan", None, None)
to_combine = [] | Remove a pointless check, we set varscan_cmd right above it. | bcbio_bcbio-nextgen | train | py |
73668afd2e89c1b3d6b4f7241446cb9a5bb21f6e | diff --git a/lib/modules/swarm/index.js b/lib/modules/swarm/index.js
index <HASH>..<HASH> 100644
--- a/lib/modules/swarm/index.js
+++ b/lib/modules/swarm/index.js
@@ -9,7 +9,6 @@ const constants = require('../../constants.json');
class Swarm {
constructor(embark, _options) {
- const self = this;
this.logger = embark.logger;
this.events = embark.events;
this.buildDir = embark.config.buildDir;
@@ -99,6 +98,7 @@ class Swarm {
storageConfig: self.storageConfig,
webServerConfig: self.webServerConfig,
corsParts: self.embark.config.corsParts,
+ blockchainConfig: self.blockchainConfig,
embark: self.embark
});
self.logger.trace(`Storage module: Launching swarm process...`); | fix missing blockchainConfig pass to StorageLauncher in swarm index | embark-framework_embark | train | js |
6f9ab7539f04bc2a74a969466860f7d0091aa71a | diff --git a/source/php/Search.php b/source/php/Search.php
index <HASH>..<HASH> 100644
--- a/source/php/Search.php
+++ b/source/php/Search.php
@@ -77,7 +77,7 @@ class Search
//Only add if not empty
if (!empty($rendered)) {
- $attributes['modules'] = substr($rendered, 0, 10000);
+ $attributes['modules'] = substr($rendered, 0, 7000);
}
return $attributes; | Limit modules to take up max <I> letters.
Due to a limitation in algolia. | helsingborg-stad_Modularity | train | php |
075465452e316b97c722e3ae7159c6f538e263fa | diff --git a/synapse/tests/test_axon.py b/synapse/tests/test_axon.py
index <HASH>..<HASH> 100644
--- a/synapse/tests/test_axon.py
+++ b/synapse/tests/test_axon.py
@@ -343,6 +343,8 @@ class AxonHostTest(SynTest):
self.eq(len(host2.cloneaxons), 2)
# Fini the proxy objects
+ axonc1.fini()
+ axonc2.fini()
axon0.fini()
axon1.fini()
axon2.fini() | Fini extra proxy handlers. | vertexproject_synapse | train | py |
09e6b0b38d7b2f617319d426c613b142afc24190 | diff --git a/demo/asset_section.js b/demo/asset_section.js
index <HASH>..<HASH> 100644
--- a/demo/asset_section.js
+++ b/demo/asset_section.js
@@ -196,6 +196,8 @@ shakaDemo.load = function() {
// Update control state in case autoplay is disabled.
shakaDemo.controls_.loadComplete();
+ shakaDemo.hashShouldChange_();
+
// Disallow casting of offline content.
var isOffline = asset.manifestUri.indexOf('offline:') == 0;
shakaDemo.controls_.allowCast(!isOffline); | Update the hash after a new asset is loaded
Otherwise, we continue to show the first loaded asset in the URL bar,
even after changing to another asset.
Change-Id: I<I>b<I>fbec<I>ba<I>bb<I>f9f<I>f<I>df<I> | google_shaka-player | train | js |
2dfd26af54abecb2319010a92c6e8c83e4bfa884 | diff --git a/lib/waterline/query/dql.js b/lib/waterline/query/dql.js
index <HASH>..<HASH> 100644
--- a/lib/waterline/query/dql.js
+++ b/lib/waterline/query/dql.js
@@ -173,6 +173,13 @@ module.exports = {
return new Deferred(this, this.update, options, newValues);
}
+ // Check if options is something other than an object
+ // this allows you to pass in an id to update:
+ // ex: model.update(id, cb);
+ if(_.isString(options) || _.isNumber(options)) {
+ options = { id: options };
+ }
+
var usage = utils.capitalize(this.identity) + '.update(criteria, newValues, callback)';
if(!newValues) return usageError('No updated values specified!', usage, cb); | allow an id to be passed into the update method instead of criteria | balderdashy_waterline | train | js |
dcb0f61f9fc43aa925f9daf900bbcafd3c83dd1e | diff --git a/lib/webcomment.py b/lib/webcomment.py
index <HASH>..<HASH> 100644
--- a/lib/webcomment.py
+++ b/lib/webcomment.py
@@ -310,7 +310,7 @@ Comment: comment_id = %(cmt_id)s
%(cmt_body)s
---end body---
-Please go to the Comments Admin Panel %(comment_admin_link)s to delete this message if necessary. A warning will be sent to the user in question.''' % \
+Please go to the WebComment Admin interface %(comment_admin_link)s to delete this message if necessary. A warning will be sent to the user in question.''' % \
{ 'cfg-report_max' : CFG_WEBCOMMENT_NB_REPORTS_BEFORE_SEND_EMAIL_TO_ADMIN,
'nickname' : nickname,
'user_email' : user_email,
@@ -327,7 +327,7 @@ Please go to the Comments Admin Panel %(comment_admin_link)s to delete this mess
'review_stuff' : CFG_WEBCOMMENT_ALLOW_REVIEWS and \
"star score\t\t= %s\n\t\t\treview title\t\t= %s" % (cmt_star, cmt_title) or "",
'cmt_body' : cmt_body,
- 'comment_admin_link' : "http://%s/admin/webcomment/" % weburl,
+ 'comment_admin_link' : weburl + "/admin/webcomment/",
'user_admin_link' : "user_admin_link" #! FIXME
} | Fixed link to the WebComment Admin interface in the abuse report
emails. | inveniosoftware-attic_invenio-comments | train | py |
8958a3364d8810a8daafece80da077fe49aa834c | diff --git a/src/Illuminate/Http/Request.php b/src/Illuminate/Http/Request.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Http/Request.php
+++ b/src/Illuminate/Http/Request.php
@@ -121,7 +121,7 @@ class Request extends SymfonyRequest {
{
foreach (func_get_args() as $pattern)
{
- if (str_is($pattern, $this->path()))
+ if (str_is(urldecode($pattern), urldecode($this->path())))
{
return true;
} | Support languages like Hebrew
Without urldecode() the compare look like this:
$pattern = 'אודות'
$this->path = '%d7%<I>%d7%<I>%d7%<I>%d7%<I>%d7%aa'
So it will always fail.
With urldecode it look like this:
$pattern = 'אודות'
$this->path = 'אודות'
As it should :) | laravel_framework | train | php |
d9d0446d45287092b76ea6cf4c8a4fa8e93983d6 | diff --git a/commands/cli/helptext.go b/commands/cli/helptext.go
index <HASH>..<HASH> 100644
--- a/commands/cli/helptext.go
+++ b/commands/cli/helptext.go
@@ -78,7 +78,6 @@ const longHelpFormat = `USAGE
{{.Indent}}{{template "usage" .}}
{{if .Synopsis}}SYNOPSIS
-
{{.Synopsis}}
{{end}}{{if .Arguments}}ARGUMENTS | Remove new line after synopsis section
As synopsis is only one line long it is overkill
License: MIT | ipfs_go-ipfs | train | go |
da1d4adc64a16c2dd3859b7fbdf311dcb18e770f | diff --git a/test_winazure.py b/test_winazure.py
index <HASH>..<HASH> 100644
--- a/test_winazure.py
+++ b/test_winazure.py
@@ -9,7 +9,9 @@ from mock import (
from unittest import TestCase
from winazure import (
+ DATETIME_PATTERN,
delete_unused_disks,
+ is_old_deployment,
list_services,
main,
ServiceManagementService,
@@ -80,3 +82,17 @@ class WinAzureTestCase(TestCase):
services = list_services(sms, 'juju-deploy-*', verbose=False)
ls_mock.assert_called_once_with()
self.assertEqual([hs2], services)
+
+ def test_is_old_deployment(self):
+ now = datetime.utcnow()
+ ago = timedelta(hours=2)
+ d1 = Mock()
+ d1.created_time = (now - timedelta(hours=3)).strftime(DATETIME_PATTERN)
+ self.assertTrue(
+ is_old_deployment([d1], now, ago, verbose=False))
+ d2 = Mock()
+ d2.created_time = (now - timedelta(hours=1)).strftime(DATETIME_PATTERN)
+ self.assertFalse(
+ is_old_deployment([d2], now, ago, verbose=False))
+ self.assertTrue(
+ is_old_deployment([d1, d2], now, ago, verbose=False)) | Added test for is_old_deployment(). | juju_juju | train | py |
02b69149376edfd5a70569ecfac1772a8e4daabf | diff --git a/test/sanitize_attrs.js b/test/sanitize_attrs.js
index <HASH>..<HASH> 100644
--- a/test/sanitize_attrs.js
+++ b/test/sanitize_attrs.js
@@ -61,6 +61,32 @@ describe( 'Sanitize attrs:', function () {
}); // === end desc
});
+ // ****************************************************************
+ // ****************** END of Sanitize Attrs ***********************
+ // ****************************************************************
+
+ describe( '.opt(func)', function () {
+ it( 'returns a function where null returns null', function () {
+ assert.equal(E.opt(E.string)(null), null);
+ });
+
+ it( 'returns a function where undefined returns null', function () {
+ assert.equal(E.opt(E.string)(undefined), null);
+ });
+
+ it( 'returns a function that passes false to underlying function', function () {
+ assert.equal(E.opt(E.string)(false).constructor, Error);
+ });
+
+ it( 'returns a function that passes any Number to underlying function', function () {
+ assert.equal(E.opt(E.string)(1).constructor, Error);
+ });
+
+ it( 'returns a function that passes any String to underlying function', function () {
+ assert.equal(E.opt(E.string)("a"), "a");
+ });
+ }); // === end desc
+
}); // === end desc | Added: tests for .opt | da99_www_app | train | js |
bd2ce6ecf35735701c09b3956ad685c590659808 | diff --git a/lib/namespace.js b/lib/namespace.js
index <HASH>..<HASH> 100644
--- a/lib/namespace.js
+++ b/lib/namespace.js
@@ -118,6 +118,8 @@ SocketNamespace.prototype.setFlags = function () {
*/
SocketNamespace.prototype.packet = function (packet) {
+ packet.endpoint = this.name;
+
var store = this.store
, log = this.log
, volatile = this.flags.volatile | Fixed propagation of packets through `SocketNamespace`. | socketio_socket.io | train | js |
f7655506c89cdd133529ef2cbb883ca1c2d6b462 | diff --git a/lib/plugin.js b/lib/plugin.js
index <HASH>..<HASH> 100644
--- a/lib/plugin.js
+++ b/lib/plugin.js
@@ -202,7 +202,7 @@ function runtimePrologue(t, state) {
return prologue;
}
-makeTemplate("program-wrapper", "$runtime$.async($arg$, 0, 1)(function(err) { if (err) throw err; })");
+makeTemplate("program-wrapper", "$runtime$.async($arg$, 0, 1).call(this, function(err) { if (err) throw err; })");
function asyncProgramWrapper(t, state, node, scope) {
var wrapper = t.functionExpression(t.identifier(scope.generateUid('')), [], // | Sage/streamlinejs#<I> - fixed this at global scope for non-strict mode | Sage_babel-plugin-streamline | train | js |
594428c86d25e5f74547d4d574a0303273a9d60b | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -24,13 +24,13 @@ function range(a, b, str) {
while (i < str.length && i >= 0 && ! result) {
if (i == ai) {
begs.push(i);
- ai = str.indexOf(a, i + a.length);
+ ai = str.indexOf(a, i + 1);
} else if (begs.length == 1) {
result = [ begs.pop(), bi ];
} else {
left = begs.pop();
right = bi;
- bi = str.indexOf(b, i + b.length);
+ bi = str.indexOf(b, i + 1);
}
i = ai < bi && ai >= 0 ? ai : bi; | Fixed repeated chars in needle issue according to original implementation | juliangruber_balanced-match | train | js |
7b7a572f9b4cc6131479fec9688bfb86a88cac61 | diff --git a/sanic/mixins/routes.py b/sanic/mixins/routes.py
index <HASH>..<HASH> 100644
--- a/sanic/mixins/routes.py
+++ b/sanic/mixins/routes.py
@@ -781,6 +781,7 @@ class RouteMixin:
path={file_or_directory}, "
f"relative_url={__file_uri__}"
)
+ raise
def _register_static(
self,
diff --git a/tests/test_static.py b/tests/test_static.py
index <HASH>..<HASH> 100644
--- a/tests/test_static.py
+++ b/tests/test_static.py
@@ -461,6 +461,22 @@ def test_nested_dir(app, static_file_directory):
assert response.text == "foo\n"
+def test_handle_is_a_directory_error(app, static_file_directory):
+ error_text = "Is a directory. Access denied"
+ app.static("/static", static_file_directory)
+
+ @app.exception(Exception)
+ async def handleStaticDirError(request, exception):
+ if isinstance(exception, IsADirectoryError):
+ return text(error_text, status=403)
+ raise exception
+
+ request, response = app.test_client.get("/static/")
+
+ assert response.status == 403
+ assert response.text == error_text
+
+
def test_stack_trace_on_not_found(app, static_file_directory, caplog):
app.static("/static", static_file_directory) | raise exception for `_static_request_handler` unknown exception; add test with custom error (#<I>) | huge-success_sanic | train | py,py |
8911f7c1bf7e4fa74e2e9edccf45589e549f427c | diff --git a/fusesoc/provider/git.py b/fusesoc/provider/git.py
index <HASH>..<HASH> 100644
--- a/fusesoc/provider/git.py
+++ b/fusesoc/provider/git.py
@@ -37,7 +37,7 @@ class Git(Provider):
# TODO : Sanitize URL
repo = self.config.get("repo")
logger.info("Checking out " + repo + " to " + local_dir)
- args = ["clone", "-q", repo, local_dir]
+ args = ["clone", "-q", "--depth", "1", repo, local_dir]
Launcher("git", args).run()
if version:
args = ["-C", local_dir, "checkout", "-q", version] | Use shallow clones in git provider
This should save time and bandwidth in many cases. If someone
needs the full repo, they should be adding the repo as a library
instead of using the git provider | olofk_fusesoc | train | py |
b1231553295009d2c3313aade51e259807205ace | diff --git a/core/interpreter/src/main/java/org/overture/interpreter/runtime/state/SClassDefinitionRuntime.java b/core/interpreter/src/main/java/org/overture/interpreter/runtime/state/SClassDefinitionRuntime.java
index <HASH>..<HASH> 100644
--- a/core/interpreter/src/main/java/org/overture/interpreter/runtime/state/SClassDefinitionRuntime.java
+++ b/core/interpreter/src/main/java/org/overture/interpreter/runtime/state/SClassDefinitionRuntime.java
@@ -22,7 +22,7 @@ public class SClassDefinitionRuntime implements IRuntimeState {
public boolean staticValuesInit = false;
/** A delegate Java object for any native methods. */
- private Delegate delegate = null;
+ protected Delegate delegate = null;
public SClassDefinitionRuntime(SClassDefinition def)
{ | changed visibility of delegate for extension by compass | overturetool_overture | train | java |
5acaab909fb85e3e1d20f11333e28965a3b8e1c6 | diff --git a/cellbase-core/src/main/java/org/opencb/cellbase/core/api/VariantDBAdaptor.java b/cellbase-core/src/main/java/org/opencb/cellbase/core/api/VariantDBAdaptor.java
index <HASH>..<HASH> 100644
--- a/cellbase-core/src/main/java/org/opencb/cellbase/core/api/VariantDBAdaptor.java
+++ b/cellbase-core/src/main/java/org/opencb/cellbase/core/api/VariantDBAdaptor.java
@@ -78,7 +78,8 @@ public interface VariantDBAdaptor<T> extends FeatureDBAdaptor<T> {
QueryResult startsWith(String id, QueryOptions options);
default QueryResult<T> getByVariant(Variant variant, QueryOptions options) {
- Query query = new Query(QueryParams.REGION.key(), variant.getChromosome() + ":" + variant.getStart() + "-" + variant.getStart())
+ Query query = new Query(QueryParams.CHROMOSOME.key(), variant.getChromosome())
+ .append(QueryParams.START.key(), variant.getStart())
.append(QueryParams.REFERENCE.key(), variant.getReference())
.append(QueryParams.ALTERNATE.key(), variant.getAlternate());
return get(query, options); | develop: getByVariant does no longer create a REGION query but a chromosome, start, ref, alt query | opencb_cellbase | train | java |
35ed52119a6ef92addd4b960a343e0580753f65e | diff --git a/lib/components/services/audit/index.js b/lib/components/services/audit/index.js
index <HASH>..<HASH> 100644
--- a/lib/components/services/audit/index.js
+++ b/lib/components/services/audit/index.js
@@ -18,8 +18,8 @@ class AuditService {
const promises = Object.keys(this.pgScripts).map(script => {
const filename = path.parse(this.pgScripts[script].filename).name
- this.auditFunctions.push(filename.substring(filename.indexOf('-') + 1))
if (filename.split('-')[0] === 'audit') {
+ this.auditFunctions.push(filename.substring(filename.indexOf('-') + 1))
return this.client.runFile(this.pgScripts[script].filePath)
}
}) | only append the function if it's an audit function | wmfs_tymly-pg-plugin | train | js |
42674a11ebecaec2c10fed5963e7393739be9b37 | diff --git a/lib/websearchadminlib.py b/lib/websearchadminlib.py
index <HASH>..<HASH> 100644
--- a/lib/websearchadminlib.py
+++ b/lib/websearchadminlib.py
@@ -3505,6 +3505,7 @@ def get_detailed_page_tabs_counts(recID):
num_reviews = 0 #num of reviews
tabs_counts = {'Citations' : 0,
'References' : -1,
+ 'Discussions' : 0,
'Comments' : 0,
'Reviews' : 0
}
@@ -3527,7 +3528,9 @@ def get_detailed_page_tabs_counts(recID):
num_reviews = get_nb_reviews(recID, count_deleted=False)
if num_comments:
tabs_counts['Comments'] = num_comments
+ tabs_counts['Discussions'] += num_comments
if num_reviews:
tabs_counts['Reviews'] = num_reviews
+ tabs_counts['Discussions'] += num_reviews
return tabs_counts | WebSearch: discussions compatibility fix
* Reverts counter of discussions for legacy app. (closes #<I>) | inveniosoftware_invenio-records | train | py |
3447a242a15327a5d1e6d715e94d1ac3525f3d14 | diff --git a/src/Horntell/Request.php b/src/Horntell/Request.php
index <HASH>..<HASH> 100644
--- a/src/Horntell/Request.php
+++ b/src/Horntell/Request.php
@@ -14,7 +14,10 @@ class Request {
'base_url' => App::$base,
'defaults' => [
'auth' => [App::$key, App::$secret],
- 'headers' => ['Accept' => 'application/vnd.horntell.' . App::$version . '+json']
+ 'headers' => [
+ 'Accept' => 'application/vnd.horntell.' . App::$version . '+json',
+ 'Content-Type' => 'application/json'
+ ]
]
]);
}
@@ -23,7 +26,7 @@ class Request {
{
try
{
- $request = $this->client->createRequest($method, $endpoint, ['body' => $data]);
+ $request = $this->client->createRequest($method, $endpoint, ['body' => json_encode($data)]);
return $this->client->send($request);
}
catch(GuzzleRequestException $e) | sending json data in request body | horntell_php-sdk | train | php |
da57bcaebe4492a72e6d426bc2cfa7aa778df630 | diff --git a/src/Template/Directive/GoCallDirective.php b/src/Template/Directive/GoCallDirective.php
index <HASH>..<HASH> 100644
--- a/src/Template/Directive/GoCallDirective.php
+++ b/src/Template/Directive/GoCallDirective.php
@@ -45,6 +45,7 @@
$callName = $matches[1];
$params = $matches[2];
+ $params = $execBag->expressionEvaluator->yaml($params, $scope);
return ($this->callback)($callName, $params);
} | Added link element to empty tag list | dermatthes_html-template | train | php |
de1ccecd7e29cc7c1ddfc95c844377579ed2ce43 | diff --git a/mod/scorm/datamodels/scormlib.php b/mod/scorm/datamodels/scormlib.php
index <HASH>..<HASH> 100644
--- a/mod/scorm/datamodels/scormlib.php
+++ b/mod/scorm/datamodels/scormlib.php
@@ -612,7 +612,7 @@ function scorm_parse_scorm($scorm, $manifest) {
if (empty($scoes->version)) {
$scoes->version = 'SCORM_1.2';
}
- $DB->set_field('scorm','version',$scoes->version, array('id'=>$scormid));
+ $DB->set_field('scorm','version',$scoes->version, array('id'=>$scorm->id));
$scorm->version = $scoes->version;
} | SCORM MDL-<I> - undefined var - refactored function no longer uses scormid, but uses full scorm object. | moodle_moodle | train | php |
Subsets and Splits