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 |
|---|---|---|---|---|---|
872650cbaad3040049705b84e529562e30e495d7 | diff --git a/python/regress.py b/python/regress.py
index <HASH>..<HASH> 100644
--- a/python/regress.py
+++ b/python/regress.py
@@ -123,6 +123,7 @@ def getTuning(y,model) :
y = y/sum(y)
mu = dot(model.s,y)
sigma = dot(y,(model.s-mu)**2)
+ return (mu,sigma)
def getNorm(y,model) :
b = getRegression(y,model) | Added returns for gaussian fit | thunder-project_thunder | train | py |
8e5049f3c41c62a603213dc4561fed39d759a852 | diff --git a/src/Router/Strategy/TreeStrategy.php b/src/Router/Strategy/TreeStrategy.php
index <HASH>..<HASH> 100644
--- a/src/Router/Strategy/TreeStrategy.php
+++ b/src/Router/Strategy/TreeStrategy.php
@@ -56,11 +56,11 @@ class TreeStrategy implements ResolverInterface
$params[$key] = $matches[$index][0];
}
- if ($remaining instanceof RouteInterface) {
- return $remaining;
+ if (is_array($remaining)) {
+ return $this->match($remaining, $parts, $params);
}
- return $this->match($remaining, $parts, $params);
+ return $remaining;
}
}
}
@@ -81,7 +81,7 @@ class TreeStrategy implements ResolverInterface
}
$matched = preg_match(self::PARAM_REGEX, $segment, $matches);
if ($matched) {
- $params[] = trim($matches['name']);
+ $params[] = $matches['name'];
$path = "{$path}/(" . (!empty($matches['pattern']) ? $matches['pattern'] : '[^/]+') . ')';
$patterns[$path] = $params;
} | minor handling improvements in `TreeStrategy` | phOnion_framework | train | php |
fd5df5a6db65a69830de70e08a6c7924ae3517d4 | diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb
index <HASH>..<HASH> 100644
--- a/lib/sinatra/base.rb
+++ b/lib/sinatra/base.rb
@@ -878,23 +878,22 @@ module Sinatra
# Condition for matching user agent. Parameter should be Regexp.
# Will set params[:agent].
def user_agent(pattern)
- condition {
+ condition do
if request.user_agent =~ pattern
@params[:agent] = $~[1..-1]
true
else
false
end
- }
+ end
end
alias_method :agent, :user_agent
# Condition for matching mimetypes. Accepts file extensions.
def provides(*types)
- types = [types] unless types.kind_of? Array
- types.map!{|t| mime_type(t)}
+ types.map! { |t| mime_type(t) }
- condition {
+ condition do
matching_types = (request.accept & types)
unless matching_types.empty?
response.headers['Content-Type'] = matching_types.first
@@ -902,7 +901,7 @@ module Sinatra
else
false
end
- }
+ end
end
public | Remove uneccessary line from provieds, use do ... end for multiline conditions. | sinatra_sinatra | train | rb |
47730cffebda9d9c529c5b834b70b71aaa71af5c | diff --git a/framework/core/src/Core/Formatter/Formatter.php b/framework/core/src/Core/Formatter/Formatter.php
index <HASH>..<HASH> 100644
--- a/framework/core/src/Core/Formatter/Formatter.php
+++ b/framework/core/src/Core/Formatter/Formatter.php
@@ -22,12 +22,14 @@ class Formatter
$configurator = new Configurator;
$configurator->rootRules->enableAutoLineBreaks();
+ $configurator->Escaper;
$configurator->Autoemail;
$configurator->Autolink;
$configurator->tags->onDuplicate('replace');
event(new FormatterConfigurator($configurator));
+
return $configurator;
} | Add Escaper plugin so that formatting can be escaped | flarum_core | train | php |
249bda280eff18bf799fe645995690ff47fd39f2 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -114,7 +114,7 @@ function flatten(object, parent, parentKey, isFirst, skipNextFlat) {
_.each(object.properties, function(p) {
var newParent = object;
var resetSkip = true;
- if (!skipNextFlat && (p.key.type === 'Literal' || p.key.type === 'Identifier') && (p.value.type === 'ObjectExpression' || (p.value.type === 'CallExpression' && ((p.value.callee && p.value.callee.name === '_extends') || (p.value.callee.property && p.value.callee.property.name)))) && parent) {
+ if (!skipNextFlat && (p.key.type === 'Literal' || p.key.type === 'Identifier') && (p.value.type === 'ObjectExpression' || (p.value.type === 'CallExpression' && ((p.value.callee && p.value.callee.name === '_extends') || (p.value.callee.property && p.value.callee.property.name === '_extends')))) && parent) {
var flatResults = flat(p, parent, parentKey, p.key.type === 'Identifier', object, isFirst);
if (flatResults === true) {
redoParent = true; | correct ident of _extend | marudor_inline-css-loader | train | js |
9e3f6994179c2918b956806ad8bbd25b578380e8 | diff --git a/tests/unit/single.js b/tests/unit/single.js
index <HASH>..<HASH> 100644
--- a/tests/unit/single.js
+++ b/tests/unit/single.js
@@ -2,6 +2,30 @@
var DomUtil = require('../dom-util');
+exports.testDontOpenAfterClear = DomUtil.createDomTest(
+ ['single', 'dropdown', 'templates'],
+ function(test, $input, $) {
+ $input.select3({
+ allowClear: true,
+ data: { id: 1, text: 'Amsterdam' },
+ items: [
+ { id: 1, text: 'Amsterdam' },
+ { id: 2, text: 'Antwerp' },
+ { id: 3, text: 'Athens' }
+ ]
+ });
+
+ test.equal($input.select3('value'), 1);
+
+ $input.find('.select3-single-selected-item-remove').click();
+
+ test.equal($input.select3('data'), null);
+ test.equal($input.select3('value'), null);
+
+ test.equal($('.select3-dropdown').length, 0);
+ }
+);
+
exports.testInitialData = DomUtil.createDomTest(
['single', 'templates'],
function(test, $input) { | Merge test-case from mobile branch. | arendjr_selectivity | train | js |
3249d1f5b9560d46c1449e04fd3ceebbd3c32f10 | diff --git a/tests/test_eos.py b/tests/test_eos.py
index <HASH>..<HASH> 100644
--- a/tests/test_eos.py
+++ b/tests/test_eos.py
@@ -141,8 +141,8 @@ def test_eos_connector_execute_exception(mock_eapi):
@mock.patch('pylib.aeon.eos.connector.pyeapi.connect')
def test_eos_connector_execute(mock_eapi):
- def mock_execute(*args):
- return {'result': list(args)[0]}
+ def mock_execute(commands, encoding='json', **kwargs):
+ return {'result': commands}
mock_eapi.return_value.execute.side_effect = mock_execute
target = '1.1.1.1' | update eos_connector_execute test to accept kwargs. | Apstra_aeon-venos | train | py |
8025d1515503f485e4d5e1faa111577748ca49a6 | diff --git a/request-strategy/order.go b/request-strategy/order.go
index <HASH>..<HASH> 100644
--- a/request-strategy/order.go
+++ b/request-strategy/order.go
@@ -88,7 +88,7 @@ func GetRequestablePieces(input Input, pro *PieceRequestOrder, f func(ih metainf
pieceLength := t.PieceLength()
if storageLeft != nil {
if *storageLeft < pieceLength {
- return true
+ return false
}
*storageLeft -= pieceLength
} | Stop iterating pieces when storage is exhausted | anacrolix_torrent | train | go |
0184584c3e6a66c533fce5e470192a2466c5af9a | diff --git a/lib/URL.php b/lib/URL.php
index <HASH>..<HASH> 100644
--- a/lib/URL.php
+++ b/lib/URL.php
@@ -124,6 +124,11 @@ http://mysite:123/install/dir/my/page.html
if(!is_array($argument))$argument=array($argument=>$value);
return $this->setArguments($argument);
}
+ /** Get value of an argument */
+ function get($argument){
+ return $this->arguments[$argument];
+ }
+
/** Set arguments to specified array */
function setArguments($arguments=array()){
// add additional arguments | After properties are set, you should be able to access them too | atk4_atk4 | train | php |
5f93730481c2be7550a338ba33d8f8b5e6225933 | diff --git a/src/config.js b/src/config.js
index <HASH>..<HASH> 100644
--- a/src/config.js
+++ b/src/config.js
@@ -13,7 +13,7 @@ const defaultConfig = {
fieldsBagName: 'fields',
classes: false,
classNames: null,
- events: 'input|blur',
+ events: 'input',
inject: true,
fastExit: true,
aria: true,
diff --git a/tests/unit/config.js b/tests/unit/config.js
index <HASH>..<HASH> 100644
--- a/tests/unit/config.js
+++ b/tests/unit/config.js
@@ -11,7 +11,7 @@ test('it stores the default config', () => {
fieldsBagName: 'fields',
classes: false,
classNames: null,
- events: 'input|blur',
+ events: 'input',
inject: true,
fastExit: true,
aria: true, | breaking: change default event to input only | baianat_vee-validate | train | js,js |
21b929ee374668e5bd0181f1a908350c9b68f74a | diff --git a/app/ui/components/Button.js b/app/ui/components/Button.js
index <HASH>..<HASH> 100644
--- a/app/ui/components/Button.js
+++ b/app/ui/components/Button.js
@@ -16,7 +16,7 @@ const Button = props => (
Button.propTypes = {
disabled: PropTypes.bool,
- onClick: PropTypes.func
+ onClick: PropTypes.func.isRequired
}
export default Button
\ No newline at end of file
diff --git a/app/ui/components/app.js b/app/ui/components/app.js
index <HASH>..<HASH> 100644
--- a/app/ui/components/app.js
+++ b/app/ui/components/app.js
@@ -4,9 +4,10 @@ import styles from './app.css'
import Connection from './Connection'
import Button from './Button'
-const running = false;
+
export default function App () {
+ const running = false
return (
<div className={styles.run_wrapper}>
<header className={styles.menu}> | add isRequired to button propTypes, removed ; , dummy vars inside render as per review | Opentrons_opentrons | train | js,js |
b98a316cd38b6dc695ebe9097b41cb2c55334663 | diff --git a/src/Models/BaseElement.php b/src/Models/BaseElement.php
index <HASH>..<HASH> 100644
--- a/src/Models/BaseElement.php
+++ b/src/Models/BaseElement.php
@@ -519,11 +519,13 @@ class BaseElement extends DataObject implements CMSPreviewable
return $this->controller;
}
- if (!class_exists(self::$controller_class)) {
- throw new Exception('Could not find controller class ' . self::$controller_class . ' as defined in ' . self::class);
+ $controllerClass = self::config()->controller_class;
+
+ if (!class_exists($controllerClass)) {
+ throw new Exception('Could not find controller class ' . $controllerClass . ' as defined in ' . static::class);
}
- $this->controller = Injector::inst()->create(self::$controller_class, $this);
+ $this->controller = Injector::inst()->create($controllerClass, $this);
$this->controller->doInit();
return $this->controller;
} | made sure controller uses config so it picks up late static binding | dnadesign_silverstripe-elemental | train | php |
9eac71305fc45ef3416825b004349041e9c13a52 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -82,11 +82,13 @@
function registerInput(){
options.searchInput.addEventListener('keyup', function(e){
- emptyResultsContainer();
var key = e.which
- var query = e.target.value
- if( isWhitelistedKey(key) && isValidQuery(query) ) {
- render( repository.search(query) );
+ if( isWhitelistedKey(key) ) {
+ emptyResultsContainer();
+ var query = e.target.value
+ if( isValidQuery(query) ) {
+ render( repository.search(query) );
+ }
}
})
} | fix disappearing results (#<I>) | christian-fei_Simple-Jekyll-Search | train | js |
d367035571f41b285b5019ec21f9f0d7c2fd67e4 | diff --git a/lib/builderator/config/attributes.rb b/lib/builderator/config/attributes.rb
index <HASH>..<HASH> 100644
--- a/lib/builderator/config/attributes.rb
+++ b/lib/builderator/config/attributes.rb
@@ -25,7 +25,7 @@ module Builderator
unless arg.empty?
@attributes[attribute_name].set(*arg.flatten)
- @attributes[attribute_name].set(*arg) if options[:dimension] == :broad
+ @attributes[attribute_name].set(*arg) if options[:flatten] == false
end
@attributes[attribute_name]
end
diff --git a/lib/builderator/config/file.rb b/lib/builderator/config/file.rb
index <HASH>..<HASH> 100644
--- a/lib/builderator/config/file.rb
+++ b/lib/builderator/config/file.rb
@@ -266,7 +266,7 @@ module Builderator
attribute :tagging_role
end
- attribute :post_processors, :type => :list, :dimension => :broad
+ attribute :post_processors, :type => :list, :flatten => false
end
## | Renamed :dimension option to :flatten to make it a bit more descriptive. | rapid7_builderator | train | rb,rb |
5447d8f038373d2fe96be60a8f1898a1935531cf | diff --git a/group/autogroup_form.php b/group/autogroup_form.php
index <HASH>..<HASH> 100644
--- a/group/autogroup_form.php
+++ b/group/autogroup_form.php
@@ -115,7 +115,7 @@ class autogroup_form extends moodleform {
}
// check grouping name duplicates
- if ($data['grouping'] == '-1') {
+ if ( isset($data['grouping']) && $data['grouping'] == '-1') {
$name = trim(stripslashes($data['groupingname']));
if (empty($name)) {
$errors['groupingname'] = get_string('required'); | MDL-<I> - fix warning when groupings not enabled
merged from MOODLE_<I>_STABLE | moodle_moodle | train | php |
8de776aa367485114af35167924dc9e6ca3c82df | diff --git a/miflora/__init__.py b/miflora/__init__.py
index <HASH>..<HASH> 100644
--- a/miflora/__init__.py
+++ b/miflora/__init__.py
@@ -10,6 +10,6 @@ if sys.version_info <= (3, 6):
sys.version_info.major, sys.version_info.minor, sys.executable
)
)
-from ._version import __version__
+from ._version import __version__ # pylint: wrong-import-position
__all__ = ["__version__"] | add pylint: wrong-import-position to version import | open-homeautomation_miflora | train | py |
fa871895c36701442b9569181e37a276a81fa29d | diff --git a/lib/core.js b/lib/core.js
index <HASH>..<HASH> 100644
--- a/lib/core.js
+++ b/lib/core.js
@@ -272,7 +272,7 @@ Raja.prototype.headers = function(havingHeaders) {
var headers = havingHeaders.headers;
var hasGet = !!havingHeaders.get;
if (!headers && !hasGet) headers = havingHeaders;
- ['Content-Type', 'Vary', 'ETag', 'Accept', 'X-Grant', 'X-Right', 'X-Author', 'X-Raja'].forEach(function(name) {
+ ['Content-Type', 'Vary', 'ETag', 'Accept', 'X-Grant', 'X-Right', 'X-Author', 'X-Raja', 'X-Variant'].forEach(function(name) {
var val = hasGet && havingHeaders.get(name) || headers && (headers[name] || headers[name.toLowerCase()]);
if (val) obj[name] = val;
}); | X-Variant is a needed header | kapouer_raja | train | js |
785b73c59a1aecc1e4d236162e982a4287c8f834 | diff --git a/tests/test_vuln20007.py b/tests/test_vuln20007.py
index <HASH>..<HASH> 100644
--- a/tests/test_vuln20007.py
+++ b/tests/test_vuln20007.py
@@ -73,6 +73,7 @@ def Vuln20007TrapPrevent(client):
class TestVuln20007(KeepKeyTest):
def test_vuln(self):
+ self.requires_firmware("6.4.1")
PREVHASH_1 = unhexlify("b6973acd5876ba8b050ae2d4c7d8b5c710ee4879af938be3c2c61a262f1730e0")
PREVHASH_2 = unhexlify("3a3322e60f2f4c55394fe05dddacafd6e55ff6d40859fd98d64adefc8c169ac8") | fw version requirement for vuln-<I> | keepkey_python-keepkey | train | py |
0cae70beb420babd7f1ea6246595ba272c336a84 | diff --git a/app.py b/app.py
index <HASH>..<HASH> 100644
--- a/app.py
+++ b/app.py
@@ -21,7 +21,7 @@ logfilepath = os.path.join(os.path.dirname(os.path.abspath(__file__)),
loglevels = [logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, logging.CRITICAL]
loglevel = loglevels[config.getint('User Preferences', 'loglevel')]
-logging.basicConfig( filename=logfilepath, level=loglevel )
+logging.basicConfig( filename=logfilepath, format='%(asctime)s %(message)s', level=loglevel )
# config.get( 'Mechanical Turk Info', 'aws_secret_access_key' ) | Logging now inludes timestamp. | NYUCCL_psiTurk | train | py |
e88504df1ce20b56e036b007cd06ddabf0bf71db | diff --git a/src/Controller/SearchTrait.php b/src/Controller/SearchTrait.php
index <HASH>..<HASH> 100644
--- a/src/Controller/SearchTrait.php
+++ b/src/Controller/SearchTrait.php
@@ -57,7 +57,7 @@ trait SearchTrait
$table = $this->loadModel();
$search = new Search($table, $this->Auth->user());
- if (!$searchTable->isSearchable($model) && !$this->Auth->user('is_superuser')) {
+ if (!$searchTable->isSearchable($model) && !$this->Auth->user('is_admin')) {
throw new BadRequestException('You cannot search in ' . implode(' - ', pluginSplit($model)) . '.');
} | Improved condtion to detect an admin user - task #<I> | QoboLtd_cakephp-search | train | php |
a34bd6f63db015d934e456f11cf556b2c1e5f0cb | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -31,10 +31,6 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
-from os import path
-
-import vcversioner
-
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
@@ -66,9 +62,7 @@ author = "Josh Holbrook"
# built documents.
#
# The short X.Y version.
-version = vcversioner.find_version(
- root=path.dirname(path.dirname(path.abspath(__file__)))
-).version
+version = "3.8.1"
# The full version, including alpha/beta/rc tags.
release = version
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,7 @@ with open(README_rst, "r") as f:
setup(
name="pyee",
- version="8.2.0",
+ version="8.2.1",
packages=find_packages(),
include_package_data=True,
description="A port of node.js's EventEmitter to python.", | Remove vcversioner dependency from docs | jfhbrook_pyee | train | py,py |
6b74f4251db6df33134225132ffc7dcc3f6d7b4e | diff --git a/lib/qbo_api/raise_http_exception.rb b/lib/qbo_api/raise_http_exception.rb
index <HASH>..<HASH> 100644
--- a/lib/qbo_api/raise_http_exception.rb
+++ b/lib/qbo_api/raise_http_exception.rb
@@ -52,13 +52,14 @@ module FaradayMiddleware
def parse_json(body)
res = ::JSON.parse(body)
- r = res['Fault']['Error']
- r.collect do |e|
+ fault = res['Fault'] || res['fault']
+ errors = fault['Error'] || fault['error']
+ errors.collect do |error|
{
- fault_type: res['Fault']['type'],
- error_code: e['code'],
- error_message: e['Message'],
- error_detail: e['Detail']
+ fault_type: fault['type'],
+ error_code: error['code'],
+ error_message: error['Message'] || error['message'],
+ error_detail: error['Detail'] || error['detail']
}
end
end | Add support for JSON error responses with all lowercase keys. | minimul_qbo_api | train | rb |
afb25cef94df6dfcf6455200cd5baa7862b90f3c | diff --git a/spec/lib/session_spec.rb b/spec/lib/session_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/session_spec.rb
+++ b/spec/lib/session_spec.rb
@@ -165,7 +165,7 @@ RSpec.describe Authie::Session do
original_time = session_model.expires_at
Timecop.freeze(original_time + 10.hours) { session.touch }
session.session.reload
- expect(session.expires_at).to eq original_time
+ expect(session.expires_at.to_i).to eq original_time.to_i
end
it 'does not set the expiry time' do
@@ -195,7 +195,7 @@ RSpec.describe Authie::Session do
time = session_model.created_at
Timecop.freeze(time) { session.touch }
session.session.reload
- expect(session.expires_at).to eq time + Authie.config.persistent_session_length
+ expect(session.expires_at.to_i).to eq (time + Authie.config.persistent_session_length).to_i
end
it 'updates the cookie' do | test: avoid timing precision issues in tests | adamcooke_authie | train | rb |
f924d4cc5e41bd9dbe49127fd8e40c35762dcc83 | diff --git a/indy_node/test/auth_rule/helper.py b/indy_node/test/auth_rule/helper.py
index <HASH>..<HASH> 100644
--- a/indy_node/test/auth_rule/helper.py
+++ b/indy_node/test/auth_rule/helper.py
@@ -127,5 +127,3 @@ def generate_key(auth_action=ADD_PREFIX, auth_type=NYM,
if old_value:
key[OLD_VALUE] = old_value
return key
-
- | INDY-<I>: Refactoring | hyperledger_indy-node | train | py |
e9029758ea4d7129dc01c63adec76be80ce75102 | diff --git a/geminipy/__init__.py b/geminipy/__init__.py
index <HASH>..<HASH> 100644
--- a/geminipy/__init__.py
+++ b/geminipy/__init__.py
@@ -47,6 +47,12 @@ class Geminipy(object):
return requests.get(url)
+ def pubticker(self, symbol='btcusd'):
+ """Send a request for latest ticker info, return the response"""
+ url = self.base_url + '/v1/pubticker/' + symbol
+
+ return requests.get(url)
+
def book(self, symbol='btcusd', limit_bids=0, limit_asks=0):
"""
Send a request to get the public order book, return the response. | added function for the public endpoint pubticker | geminipy_geminipy | train | py |
c5daba6a1fda21573620852b9041d3a922a07e70 | diff --git a/js/reveal.js b/js/reveal.js
index <HASH>..<HASH> 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -1859,6 +1859,9 @@
// Re-create the slide backgrounds
createBackgrounds();
+ // Write the current hash to the URL
+ writeURL();
+
sortAllFragments();
updateControls();
@@ -2641,7 +2644,7 @@
if( typeof delay === 'number' ) {
writeURLTimeout = setTimeout( writeURL, delay );
}
- else {
+ else if( currentSlide ) {
var url = '/';
// Attempt to create a named link based on the slide's ID
@@ -2652,7 +2655,7 @@
}
// If the current slide has an ID, use that as a named link
- if( currentSlide && typeof id === 'string' && id.length ) {
+ if( typeof id === 'string' && id.length ) {
url = '/' + id;
}
// Otherwise use the /h/v index | write current hash when history is toggled on #<I> | hakimel_reveal.js | train | js |
b333890b3632e641b104a4ee97e43e97652c8328 | diff --git a/test/magneto.test.js b/test/magneto.test.js
index <HASH>..<HASH> 100644
--- a/test/magneto.test.js
+++ b/test/magneto.test.js
@@ -71,12 +71,20 @@ describe('Magneto @func', function(){
'WriteCapacityUnits': 5
}
}, function(err, data){
- debug('Create returned', err, data);
- callback(err);
+ if(err){
+ return callback(err);
+ }
+ assert(data.TableDescription.CreationDateTime, 'should have a creation date');
+ assert.equal(data.TableDescription.ItemCount, 0, 'should be empty');
+ assert.equal(data.TableDescription.ProvisionedThroughput.ReadCapacityUnits, 5);
+ assert.equal(data.TableDescription.ProvisionedThroughput.WriteCapacityUnits, 5);
+ assert.equal(data.TableDescription.TableStatus, 'ACTIVE');
+ callback();
});
}
], done);
});
+
}); | Starting to get the hang of it.. | imlucas_node-magneto | train | js |
f28255f7a11539eaab08e049651df80dc3d375b3 | diff --git a/Form/PropelTypeGuesser.php b/Form/PropelTypeGuesser.php
index <HASH>..<HASH> 100644
--- a/Form/PropelTypeGuesser.php
+++ b/Form/PropelTypeGuesser.php
@@ -79,7 +79,14 @@ class PropelTypeGuesser implements FormTypeGuesserInterface
case \PropelColumnTypes::BIGINT:
case \PropelColumnTypes::NUMERIC:
return new TypeGuess('integer', array(), Guess::MEDIUM_CONFIDENCE);
+ case \PropelColumnTypes::ENUM:
case \PropelColumnTypes::CHAR:
+ if ($column->getValueSet()) {
+ //check if this is mysql enum
+ $choices = $column->getValueSet();
+ $labels = array_map('ucfirst', $choices);
+ return new TypeGuess('choice', array('choices' => array_combine($choices, $labels)), Guess::MEDIUM_CONFIDENCE);
+ }
case \PropelColumnTypes::VARCHAR:
return new TypeGuess('text', array(), Guess::MEDIUM_CONFIDENCE);
case \PropelColumnTypes::LONGVARCHAR: | added support for propel enum types in PropelTypeGuesser | symfony_propel1-bridge | train | php |
09c1e9ab36f66ba8f8e796dceab2dec98a0677f1 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -324,7 +324,7 @@ mssql = [
'pymssql~=2.1,>=2.1.5',
]
mysql = [
- 'mysql-connector-python>=8.0.11, <=8.0.18',
+ 'mysql-connector-python>=8.0.11, <=8.0.22',
'mysqlclient>=1.3.6,<1.4',
]
odbc = [ | upgrade mysql-connector-python to <I> (#<I>) | apache_airflow | train | py |
9ac82e3f3a4429f2866ce6adea9e3706fde840ae | diff --git a/lib/ashton/shader.rb b/lib/ashton/shader.rb
index <HASH>..<HASH> 100644
--- a/lib/ashton/shader.rb
+++ b/lib/ashton/shader.rb
@@ -201,7 +201,7 @@ module Ashton
size = value.size
raise ArgumentError, "Empty array not supported for uniform data" if size.zero?
- raise ArgumentError, "Only support uniforms up to 4 elements" if size > 4
+ # raise ArgumentError, "Only support uniforms up to 4 elements" if size > 4
case value[0]
when Float
@@ -218,6 +218,9 @@ module Ashton
GL.send "glUniform#{size}f", location, *value.map(&:to_f)
end
+ when Gosu::Color
+ GL.send "glUniform4fv", location, value.map(&:to_opengl).flatten
+
else
raise ArgumentError, "Uniform data type not supported for element of type: #{value[0].class}"
end | Support for vec4 array uniforms | gosu_ashton | train | rb |
4eb07f957cadc209f2c2c009d47bfaa6f03df6ac | diff --git a/src/main/java/view/reporting/ReportingDialog.java b/src/main/java/view/reporting/ReportingDialog.java
index <HASH>..<HASH> 100644
--- a/src/main/java/view/reporting/ReportingDialog.java
+++ b/src/main/java/view/reporting/ReportingDialog.java
@@ -344,7 +344,7 @@ public class ReportingDialog {
// upload the screenshot to aws
Platform.runLater(() -> ReportingDialogUploadProgress.getStatusLabel().setText(bundle.getString("uploadingScreenshot")));
- String awsFileName = Common.getAppName() + "/screenshots/" + FOKLogger.getLogFileName();
+ String awsFileName = Common.getAppName() + "/screenshots/screenshot" + Common.getLaunchTimeStamp() + ".png";
gitHubIssue.setScreenshotLocation(awsFileName);
// upload the logs to s3 | Fixed bad filename of the screenshot on aws | vatbub_common | train | java |
ddaff15dfc0c2fc51fc27a33f55a54b2b726d59d | diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php
index <HASH>..<HASH> 100644
--- a/lib/db/upgrade.php
+++ b/lib/db/upgrade.php
@@ -1718,7 +1718,6 @@ function xmldb_main_upgrade($oldversion=0) {
}
}
*/
- //need to change this when we merge with HEAD
if ($result && $oldversion < 2007081000) {
require_once($CFG->dirroot . '/question/upgrade.php');
$result = $result && question_upgrade_context_etc(); | removing TODO type comment that was already done. | moodle_moodle | train | php |
0d90a860d6ee9d21504b1c32845a0ac7e26ade98 | diff --git a/test/test.js b/test/test.js
index <HASH>..<HASH> 100644
--- a/test/test.js
+++ b/test/test.js
@@ -3,7 +3,7 @@
var rollup = require("rollup").rollup;
rollup({
- entry : "./test/specimens/entry.js",
+ input : "./test/specimens/entry.js",
plugins : [
require("../index.js")({
@@ -13,4 +13,9 @@ rollup({
})
.then((bundle) => {
bundle.generate({ format : "es" });
+})
+.catch((error) => {
+ console.error(error.toString());
+
+ process.exitCode = 1;
}); | test: gracefully fail, update rollup usage | tivac_rollup-plugin-sizes | train | js |
c0f925a2e0cc8d86f667e5538e8d42a6e4147cae | diff --git a/object/src/main/java/com/orientechnologies/orient/object/enhancement/OObjectEntitySerializer.java b/object/src/main/java/com/orientechnologies/orient/object/enhancement/OObjectEntitySerializer.java
index <HASH>..<HASH> 100755
--- a/object/src/main/java/com/orientechnologies/orient/object/enhancement/OObjectEntitySerializer.java
+++ b/object/src/main/java/com/orientechnologies/orient/object/enhancement/OObjectEntitySerializer.java
@@ -292,7 +292,7 @@ public class OObjectEntitySerializer {
public static List<String> getCascadeDeleteFields(String iClassName) {
if (iClassName == null || iClassName.isEmpty())
return null;
- for (Class<?> iClass : cascadeDeleteFields.keySet()) {
+ for (Class<?> iClass : classes) {
if (iClass.getSimpleName().equals(iClassName))
return getCascadeDeleteFields(iClass);
} | fixed problem with cascade delete in orientdb-object.
the method getCascadeDeleteFields(String iClassName) is
looking after entries of fields to delete by classname, in the mao
cascadeDeleteFields and ignores cases with superclasses.
Now the method looks after the registered class with the name iClassName
and returns the result of getCascadeDeleteFields(Class<?> iClass) which
handles superclasses
Issue: #<I> | orientechnologies_orientdb | train | java |
b4ab2027f7698d9147d2591cb7b77c4816dceacb | diff --git a/lib/librarian.rb b/lib/librarian.rb
index <HASH>..<HASH> 100644
--- a/lib/librarian.rb
+++ b/lib/librarian.rb
@@ -42,8 +42,12 @@ module Librarian
Specfile.new(self, specfile_path)
end
+ def lockfile_name
+ "#{specfile_name}.lock"
+ end
+
def lockfile_path
- Pathname.new("#{specfile_path}.lock")
+ project_path.join(lockfile_name)
end
def lockfile
@@ -104,6 +108,10 @@ module Librarian
ui.info { "Could not resolve the dependencies." }
else
lockfile_text = lockfile.save(manifests)
+ debug { "Bouncing #{lockfile_name}" }
+ unless lockfile.save(lockfile.load(lockfile_text)) == lockfile_text
+ raise Exception, "Cannot bounce #{lockfile_name}!"
+ end
lockfile_path.open('wb') { |f| f.write(lockfile_text) }
end
end | Bounce (compare compile to compile-parse-compile) the lockfile when resolving. | applicationsonline_librarian | train | rb |
6c797f7f53add67e2ac50eb09b885fe99306ae1f | diff --git a/app/controller/federated_rails/auth_controller.rb b/app/controller/federated_rails/auth_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controller/federated_rails/auth_controller.rb
+++ b/app/controller/federated_rails/auth_controller.rb
@@ -4,12 +4,13 @@ class FederatedRails::AuthController < ApplicationController
skip_before_filter :ensure_valid_subject
def login
+ login_url = "#{Rails.application.config.federation.ssoendpoint}?target=#{url_for(:controller => 'auth', :action => 'federation_login')}"
if Rails.application.config.federation.automatelogin
- redirect_to "#{Rails.application.config.federation.ssoendpoint}?target=#{url_for(:controller => 'auth', :action => 'federation_login')}"
+ redirect_to login_url
return
end
- @spsession_url = "#{Rails.application.config.federation.ssoendpoint}?target=#{url_for(:controller => 'auth', :action => 'federation_login')}"
+ @spsession_url = login_url
end
def logout | extracted duplicated URL definition - DRY | ausaccessfed_federatedrails | train | rb |
7a24f6770edb18841be075fa1bd07838708fac6a | diff --git a/packages/material-ui/src/SwipeableDrawer/SwipeableDrawer.js b/packages/material-ui/src/SwipeableDrawer/SwipeableDrawer.js
index <HASH>..<HASH> 100644
--- a/packages/material-ui/src/SwipeableDrawer/SwipeableDrawer.js
+++ b/packages/material-ui/src/SwipeableDrawer/SwipeableDrawer.js
@@ -504,11 +504,6 @@ const SwipeableDrawer = React.forwardRef(function SwipeableDrawer(props, ref) {
backdropRef.current = ReactDOM.findDOMNode(instance);
}, []);
- const handlePaperRef = React.useCallback(instance => {
- // #StrictMode ready
- paperRef.current = ReactDOM.findDOMNode(instance);
- }, []);
-
return (
<React.Fragment>
<Drawer
@@ -527,7 +522,7 @@ const SwipeableDrawer = React.forwardRef(function SwipeableDrawer(props, ref) {
pointerEvents: variant === 'temporary' && !open ? 'none' : '',
...PaperProps.style,
},
- ref: handlePaperRef,
+ ref: paperRef,
}}
anchor={anchor}
transitionDuration={calculatedDurationRef.current || transitionDuration} | [SwipeableDrawer] Improve Preact support (#<I>) | mui-org_material-ui | train | js |
6205fd00486570bb76b74af4a7c0314996b4dd33 | diff --git a/openid/consumer/consumer.py b/openid/consumer/consumer.py
index <HASH>..<HASH> 100644
--- a/openid/consumer/consumer.py
+++ b/openid/consumer/consumer.py
@@ -125,13 +125,7 @@ USING THIS LIBRARY
is entered in that field and the form is submitted, it should make
a request to the your site which includes that OpenID URL.
- When your site receives that request, it should create an
- C{L{openid.consumer.consumer.OpenIDConsumer}} instance, and call
- C{L{beginAuth<OpenIDConsumer.beginAuth>}} on it. If
- C{L{beginAuth<OpenIDConsumer.beginAuth>}} completes successfully,
- it will return an C{L{OpenIDAuthRequest}}. Otherwise it will
- provide some useful information for giving the user an error
- message.
+ XXX: Something about discovery
Now that you have the C{L{OpenIDAuthRequest}} object, you need to
preserve the value in its C{L{token<OpenIDAuthRequest.token>}} | [project @ Placeholder for discovery] | openid_python-openid | train | py |
cc28f638d3df546747425ada490a8bf19e8d253f | diff --git a/pygsp/graphs.py b/pygsp/graphs.py
index <HASH>..<HASH> 100644
--- a/pygsp/graphs.py
+++ b/pygsp/graphs.py
@@ -4,6 +4,7 @@ r"""
Module documentation.
"""
+from copy import deepcopy
import numpy as np
import scipy as sp
@@ -55,13 +56,33 @@ class Graph(object):
pass
def copy_graph_attr(self, gtype, Gn):
- pass
+ r"""
+ TODO write doc
+ """
+ return deepcopy(self)
def separate_graph(self):
- pass
+ r"""
+ TODO write func & doc
+ """
+ raise NotImplementedError("Not implemented yet")
def subgraph(self, c):
- pass
+ r"""
+ TODO better doc
+ This function create a subgraph from G, keeping only the node(s) in c
+ """
+
+ sub_G = self
+ sub_G.W = [c,c]
+ try:
+ sub_G.N = len(c)
+ except TypeError:
+ sub_G.N = 1
+
+ sub_G.gtype = "sub-" + self.gtype
+
+ return sub_G
# Need M | Added funcs for graphs | epfl-lts2_pygsp | train | py |
021c8f566a815ef25d834c2d8c2ba8c4cfc25626 | diff --git a/aeron-cluster/src/main/java/io/aeron/cluster/SequencerAgent.java b/aeron-cluster/src/main/java/io/aeron/cluster/SequencerAgent.java
index <HASH>..<HASH> 100644
--- a/aeron-cluster/src/main/java/io/aeron/cluster/SequencerAgent.java
+++ b/aeron-cluster/src/main/java/io/aeron/cluster/SequencerAgent.java
@@ -803,6 +803,7 @@ class SequencerAgent implements Agent
final ClusterSession session = sessionSupplier.newClusterSession(
clusterSessionId, responseStreamId, responseChannel);
session.lastActivity(timestamp, correlationId);
+ session.state(OPEN);
sessionByIdMap.put(clusterSessionId, session);
}
@@ -815,7 +816,7 @@ class SequencerAgent implements Agent
{
cachedEpochClock.update(timestamp);
messageIndex.incrementOrdered();
- sessionByIdMap.remove(clusterSessionId);
+ sessionByIdMap.remove(clusterSessionId).close();
}
void onReplayServiceAction(final long timestamp, final ServiceAction action) | [Java] Set cluster session state on replay. | real-logic_aeron | train | java |
ad4ac9e11608f0f5224c2c12c59f19b090b021ba | diff --git a/Configuration/TCA/tt_address.php b/Configuration/TCA/tt_address.php
index <HASH>..<HASH> 100755
--- a/Configuration/TCA/tt_address.php
+++ b/Configuration/TCA/tt_address.php
@@ -128,14 +128,14 @@ return [
],
'sys_language_uid' => [
'exclude' => true,
- 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.language',
+ 'label' => $generalLanguageFilePrefix . 'locallang_general.xlf:LGL.language',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'special' => 'languages',
'items' => [
[
- 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages',
+ $generalLanguageFilePrefix . 'locallang_general.xlf:LGL.allLanguages',
-1,
'flags-multiple'
], | Fix TCA locallang for field sys_language_uid
Use TYPO3 version switch for field names locallang of field sys_language_uid.
#<I> | FriendsOfTYPO3_tt_address | train | php |
d5ab01a7dde353ffbceea7fa78a63603bb690e73 | diff --git a/lib/cocoaseeds/core.rb b/lib/cocoaseeds/core.rb
index <HASH>..<HASH> 100644
--- a/lib/cocoaseeds/core.rb
+++ b/lib/cocoaseeds/core.rb
@@ -38,7 +38,14 @@ module Seed
end
else
puts "Installing #{name} (#{tag})".green
- `git clone #{url} -b #{tag} #{dir} 2>&1`
+ output = `git clone #{url} -b #{tag} #{dir} 2>&1`
+ if output.include?("not found")
+ if output.include?("repository")
+ puts "[!] #{name}: Couldn't find the repository.".red
+ elsif output.include?("upstream")
+ puts "[!] #{name}: Couldn't find the tag `#{tag}`.".red
+ end
+ end
end
if not options.nil? | Show error messages when failed to git clone. | devxoul_CocoaSeeds | train | rb |
91e6e2dcc701e9dbf2e7730585666124c19a04e2 | diff --git a/src/SlackDriver.php b/src/SlackDriver.php
index <HASH>..<HASH> 100644
--- a/src/SlackDriver.php
+++ b/src/SlackDriver.php
@@ -185,6 +185,7 @@ class SlackDriver extends HttpDriver implements VerifiesService
if ($button['type'] === 'select') {
return $button;
}
+
return array_merge([
'name' => $button['name'],
'text' => $button['text'],
@@ -322,10 +323,10 @@ class SlackDriver extends HttpDriver implements VerifiesService
* the text and append the question.
*/
if ($message instanceof Question) {
- if (!isset($parameters['text'])) {
+ if (! isset($parameters['text'])) {
$parameters['text'] = '';
}
- if (!isset($parameters['attachments'])) {
+ if (! isset($parameters['attachments'])) {
$parameters['attachments'] = json_encode([$this->convertQuestion($message)]);
}
} elseif ($message instanceof OutgoingMessage) { | Apply fixes from StyleCI (#<I>) | botman_driver-slack | train | php |
b6eb4ab9f3fb7385e3dfee6e14f5563b284a713a | diff --git a/src/Token.php b/src/Token.php
index <HASH>..<HASH> 100644
--- a/src/Token.php
+++ b/src/Token.php
@@ -42,7 +42,7 @@ class Token
{
$this->driver = $driver;
if (!($this->driver instanceof CacheInterface) === true) {
- throw new \Exception("This class Require instance Of Dframe\Session", 1);
+ throw new \Exception("This class Require instance Of Psr\SimpleCache\CacheInterface", 1);
}
$token = $this->driver->get('token'); | Resolved #<I>, Wrong description Token class | dframe_dframe | train | php |
fca277e194ced12d09f754d24d31e772489884ae | diff --git a/jsonresults.go b/jsonresults.go
index <HASH>..<HASH> 100644
--- a/jsonresults.go
+++ b/jsonresults.go
@@ -151,6 +151,7 @@ type GetPeerInfoResult struct {
SubVer string `json:"subver"`
Inbound bool `json:"inbound"`
StartingHeight int32 `json:"startingheight"`
+ CurrentHeight int32 `json:"currentheight,omitempty"`
BanScore int32 `json:"banscore,omitempty"`
SyncNode bool `json:"syncnode"`
} | Extend getpeerinfo result with current block height.
* This adds support for displaying the progress of dynamically
updating the current height of connected peers. | btcsuite_btcd | train | go |
f2c90d45822562aaa9e418c9069a70aaa2b88005 | diff --git a/lib/transactions.js b/lib/transactions.js
index <HASH>..<HASH> 100644
--- a/lib/transactions.js
+++ b/lib/transactions.js
@@ -165,7 +165,15 @@ var generateOutputTransactions = function(poolRecipient, recipients, rpcData){
util.varIntBuffer(poolRecipient.length),
poolRecipient
]));
-
+
+ if (rpcData.default_witness_commitment !== undefined){
+ witness_commitment = new Buffer(rpcData.default_witness_commitment, 'hex');
+ txOutputBuffers.unshift(Buffer.concat([
+ util.packInt64LE(0),
+ util.varIntBuffer(witness_commitment.length),
+ witness_commitment
+ ]));
+ }
return Buffer.concat([
util.varIntBuffer(txOutputBuffers.length), | segwit support
Add commitment to coinbase transaction | zone117x_node-stratum-pool | train | js |
f9f34558e21aa793b863c54e3a422435b0bcc4d4 | diff --git a/src/main/java/org/lastaflute/di/core/expression/engine/JavaScriptExpressionEngine.java b/src/main/java/org/lastaflute/di/core/expression/engine/JavaScriptExpressionEngine.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/lastaflute/di/core/expression/engine/JavaScriptExpressionEngine.java
+++ b/src/main/java/org/lastaflute/di/core/expression/engine/JavaScriptExpressionEngine.java
@@ -225,7 +225,9 @@ public class JavaScriptExpressionEngine implements ExpressionEngine {
public void initializeManagedEngine() {
// called by SingletonLaContainerFactory as sub thread
// want to initialize static resources in internal world of engine
- logger.debug("#fw_debug ...Initializing framework-managed script engine for Di xml.");
+ if (isInternalDebug()) {
+ logger.debug("#fw_debug ...Initializing framework-managed script engine for Di xml.");
+ }
final ScriptEngineManager scriptEngineManager = prepareScriptEngineManager();
final String specifiedName = getDiXmlScriptManagedEngineName();
if (specifiedName != null) { | just fix: add "if (isInternalDebug()) {" | lastaflute_lasta-di | train | java |
72b572ab997daa09877521ea68fe8c9829f4f0b1 | diff --git a/src/Nautik/Nautik.php b/src/Nautik/Nautik.php
index <HASH>..<HASH> 100644
--- a/src/Nautik/Nautik.php
+++ b/src/Nautik/Nautik.php
@@ -293,8 +293,11 @@ class Nautik implements \Symfony\Component\HttpKernel\HttpKernelInterface {
* will be added to the returned array.
*/
public function performAction($controller, $action) {
+ // Replace namespace with directory separator
+ $controllerFile = str_replace("\\", DIRECTORY_SEPARATOR, $controller);
+
// Check if controller exists
- if ( false == is_file( $controllerLocation = APP . 'Controllers/' . $controller . '.php' ) )
+ if ( false == is_file( $controllerLocation = APP . 'Controllers/' . $controllerFile . '.php' ) )
throw new ControllerNotFoundException();
// Include and init the controller | Allow controllers to be group in subdirectories | gglnx_nautik | train | php |
8efaa357b08bebbb97f5e1063faf30428d458084 | diff --git a/livetests.py b/livetests.py
index <HASH>..<HASH> 100755
--- a/livetests.py
+++ b/livetests.py
@@ -51,7 +51,9 @@ def _initialize(api):
api.get("/changes/")
-@pytest.fixture(scope="module", params=["2.16.22", "3.0.13", "3.1.8", "3.2.3"])
+@pytest.fixture(
+ scope="module", params=["2.16.22", "3.0.13", "3.1.8", "3.2.3", "3.3.0-rc1"]
+)
def gerrit_api(request):
"""Create a Gerrit container for the given version and return an API."""
with GerritContainer(request.param) as gerrit: | Add <I>-rc1 to the livetests versions under test
As the previous <I>-rc0 version had an issue with its docker image. | dpursehouse_pygerrit2 | train | py |
7c7d7acbd74b19acd1fa77856ba7f25049b7fbdb | diff --git a/codebase/form_connector.php b/codebase/form_connector.php
index <HASH>..<HASH> 100644
--- a/codebase/form_connector.php
+++ b/codebase/form_connector.php
@@ -14,7 +14,7 @@ class FormDataItem extends DataItem{
if ($this->skip) return "";
$str="";
for ($i = 0; $i < count($this->config->data); $i++) {
- $str .= "<".$this->config->data[$i]['db_name']."><![CDATA[".$this->data[$this->config->data[$i]['db_name']]."]]></".$this->config->data[$i]['db_name'].">";
+ $str .= "<".$this->config->data[$i]['name']."><![CDATA[".$this->data[$this->config->data[$i]['name']]."]]></".$this->config->data[$i]['name'].">";
}
return $str;
} | [fix] incorrect processing of aliases during data generation for the form component | DHTMLX_connector-php | train | php |
5071469a2e4bece9f9f76aa6442a98b64aa0767f | diff --git a/src/Providers/RouteServiceProvider.php b/src/Providers/RouteServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/Providers/RouteServiceProvider.php
+++ b/src/Providers/RouteServiceProvider.php
@@ -35,9 +35,10 @@ class RouteServiceProvider extends ServiceProvider
private function mapPublicRoutes(Router $router)
{
$attributes = [
- 'as' => 'public::blog.',
- 'prefix' => 'blog',
- 'namespace' => 'Arcanesoft\\Blog\\Http\\Controllers\\Front',
+ 'as' => 'public::blog.',
+ 'prefix' => 'blog',
+ 'middleware' => 'web',
+ 'namespace' => 'Arcanesoft\\Blog\\Http\\Controllers\\Front',
];
$router->group($attributes, function (Router $router) { | Fixing the public routes (web middleware) | ARCANESOFT_Blog | train | php |
5b13b4f5cc75d8f2b461c99c7612394477ff6ec9 | diff --git a/tests/test_proof.py b/tests/test_proof.py
index <HASH>..<HASH> 100644
--- a/tests/test_proof.py
+++ b/tests/test_proof.py
@@ -31,3 +31,18 @@ def test_get_from_proof_empty():
proof = []
with pytest.raises(BadTrieProof):
HexaryTrie.get_from_proof(state_root, key, proof)
+
+
+def test_get_from_proof_node_less_than_32bytes():
+ t = HexaryTrie(db={})
+ t[b'some key'] = b'some value'
+ assert HexaryTrie.get_from_proof(t.root_hash, b'some key', [t.root_node]) == b'some value'
+
+ t[b'some key2'] = b'some value2'
+
+ proof = [
+ t.root_node,
+ [b'', b'', b'', [b'2', b'some value2'], b'', b'', b'',
+ b'', b'', b'', b'', b'', b'', b'', b'', b'', b'some value']
+ ]
+ assert HexaryTrie.get_from_proof(t.root_hash, b'some key2', proof) == b'some value2' | Add a test for proof of nodes less than <I> bytes. | ethereum_py-trie | train | py |
0912673206dcc68b10464369ab5a04306ae9f1ea | diff --git a/salt/pillar/__init__.py b/salt/pillar/__init__.py
index <HASH>..<HASH> 100644
--- a/salt/pillar/__init__.py
+++ b/salt/pillar/__init__.py
@@ -497,13 +497,9 @@ class Pillar(object):
else:
saltenvs.add(self.opts['pillarenv'])
else:
- for saltenv in self._get_envs():
- if self.opts.get('pillar_source_merging_strategy', None) == "none":
- if self.saltenv and saltenv != self.saltenv:
- continue
- if not self.saltenv and not saltenv == 'base':
- continue
- saltenvs.add(saltenv)
+ saltenvs = self._get_envs()
+ if self.opts.get('pillar_source_merging_strategy', None) == "none":
+ saltenvs &= set([self.saltenv or 'base'])
for saltenv in saltenvs:
top = self.client.cache_file(self.opts['state_top'], saltenv) | Simplify saltenv calculation in Pillar.get_tops
Pillar._get_envs returns a set of existing pillar environments. Instead
of iterating over all environments and check condition for each
environment, do the if conditions first and reduce the set based on the
conditions. | saltstack_salt | train | py |
e9b61084b56a306dff7a6ee059c9bdd5dfb4acaf | diff --git a/mesh_tensorflow/transformer/main.py b/mesh_tensorflow/transformer/main.py
index <HASH>..<HASH> 100644
--- a/mesh_tensorflow/transformer/main.py
+++ b/mesh_tensorflow/transformer/main.py
@@ -31,6 +31,8 @@ from __future__ import division
from __future__ import print_function
import importlib
+import os
+import sys
from mesh_tensorflow.transformer import utils
import tensorflow as tf
@@ -74,6 +76,10 @@ def main(_):
for module in FLAGS.module_import:
importlib.import_module(module)
+ tf.io.gfile.makedirs(FLAGS.model_dir)
+ with tf.io.gfile.GFile(os.path.join(FLAGS.model_dir, "command"), "w") as f:
+ f.write(" ".join(sys.argv))
+
utils.parse_gin_defaults_and_flags()
utils.run(
tpu_job_name=FLAGS.tpu_job_name, | Write out launch command.
PiperOrigin-RevId: <I> | tensorflow_mesh | train | py |
3d734c22cf5aee6f46ed0e2f904655593dd456b9 | diff --git a/lib/server/server.js b/lib/server/server.js
index <HASH>..<HASH> 100644
--- a/lib/server/server.js
+++ b/lib/server/server.js
@@ -18,11 +18,13 @@ function *parseOptions(options) {
if (port !== options.port) {
logger.info('port: %d was occupied, changed port: %d', options.port, port);
options.port = port;
+ process.env.MACACA_SERVER_PORT = port;
+ return options;
}
}
function *bootstrap(options) {
- yield parseOptions(options);
+ options = yield parseOptions(options);
var webdriver = new Webdriver(options); | fix port change and set env | macacajs_macaca-cli | train | js |
248e858dbd91d424455338b67f749132b1784b6a | diff --git a/lib/graphql/schema.rb b/lib/graphql/schema.rb
index <HASH>..<HASH> 100644
--- a/lib/graphql/schema.rb
+++ b/lib/graphql/schema.rb
@@ -654,7 +654,7 @@ module GraphQL
:static_validator, :introspection_system,
:query_analyzers, :middleware, :tracers, :instrumenters,
:query_execution_strategy, :mutation_execution_strategy, :subscription_execution_strategy,
- :validate, :multiplex_analyzers, :lazy?, :lazy_method_name,
+ :validate, :multiplex_analyzers, :lazy?, :lazy_method_name, :after_lazy,
# Configuration
:max_complexity=, :max_depth=,
:metadata, | Also support after_lazy on class schemas | rmosolgo_graphql-ruby | train | rb |
ffe9397e6626c8c5559284adb1e5dd2f050283ac | diff --git a/smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java b/smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java
index <HASH>..<HASH> 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java
@@ -266,7 +266,9 @@ public abstract class SASLMechanism implements Comparable<SASLMechanism> {
}
public final int compareTo(SASLMechanism other) {
- return getPriority() - other.getPriority();
+ // Switch to Integer.compare(int, int) once Smack is on Android 19 or higher.
+ Integer ourPriority = new Integer(getPriority());
+ return ourPriority.compareTo(other.getPriority());
}
/** | Fix SASLMechanism.compareTo(SASLMechanism)
Thanks to Aleksander Melnichnikov for pointing this out. | igniterealtime_Smack | train | java |
0f9fd55fc9ea38a2424aee3c05a5a4ddd01732c8 | diff --git a/doc/conf.py b/doc/conf.py
index <HASH>..<HASH> 100755
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -21,7 +21,11 @@ intersphinx_mapping = {
"python": ("http://python.readthedocs.io/en/latest/", None),
}
-version = release = stan.__version__
+try:
+ version = release = stan.__version__
+except AttributeError:
+ # install the package to make `stan.__version__` available
+ version = release = "unknown-dev"
################################################################################
# theme configuration | docs: set version correctly in development
Give sphinx a package version during development.
Previously sphinx would try to retrieve `stan.__version__`.
This is not available when the package is not installed.
(We use `importlib.metadata.version`)
Fixes exception which occurs when running `script/check`
during development. | stan-dev_pystan | train | py |
838c3ceb3ffcf7ab0cce34dcffea219adc2aeee8 | diff --git a/build/webpack.prod.config.js b/build/webpack.prod.config.js
index <HASH>..<HASH> 100644
--- a/build/webpack.prod.config.js
+++ b/build/webpack.prod.config.js
@@ -39,7 +39,7 @@ module.exports = merge(baseWebpackConfig, {
rules: [
{
test: /\.[jt]s$/,
- loaders: ['babel-loader', 'ts-loader', 'eslint-loader'],
+ loaders: ['babel-loader', 'ts-loader'],
exclude: /node_modules/
},
{ | chore(build): don't use eslint-loader in production | vuetifyjs_vuetify | train | js |
0af6b3b23631eb6e4aef02b06e8845e32f823adf | diff --git a/java/server/test/org/openqa/grid/common/RegistrationRequestTest.java b/java/server/test/org/openqa/grid/common/RegistrationRequestTest.java
index <HASH>..<HASH> 100644
--- a/java/server/test/org/openqa/grid/common/RegistrationRequestTest.java
+++ b/java/server/test/org/openqa/grid/common/RegistrationRequestTest.java
@@ -268,7 +268,8 @@ public class RegistrationRequestTest {
assertNotNull(req.getConfiguration().capabilities);
// should have the default capabilities
// fixUpCapabilities should have been internally called
- assertEquals(3, req.getConfiguration().capabilities.size());
+ // this check should be improved, size depends on the current platform
+ // assertEquals(3, req.getConfiguration().capabilities.size());
for (MutableCapabilities capabilities : req.getConfiguration().capabilities) {
assertNotNull(capabilities.getPlatform());
assertNotNull(capabilities.getCapability("seleniumProtocol")); | Temporarily disabling a check, later it should be made platform-independent. | SeleniumHQ_selenium | train | java |
4f9f70329385face60965b3ced39c590fcb53b60 | diff --git a/lib/info.rb b/lib/info.rb
index <HASH>..<HASH> 100644
--- a/lib/info.rb
+++ b/lib/info.rb
@@ -1,5 +1,5 @@
module MultiRepo
NAME = "git-multirepo"
- VERSION = "1.0.0.beta3"
+ VERSION = "1.0.0.beta4"
DESCRIPTION = "Track multiple Git repositories side-by-side."
end
\ No newline at end of file | Bumped version to <I>.beta4. | fortinmike_git-multirepo | train | rb |
c367c51526b78ce496c4179712673c033020c6e2 | diff --git a/pnc_cli/keycloak_config.py b/pnc_cli/keycloak_config.py
index <HASH>..<HASH> 100644
--- a/pnc_cli/keycloak_config.py
+++ b/pnc_cli/keycloak_config.py
@@ -8,6 +8,14 @@ class KeycloakConfig():
self.parse_realm(config)
self.parse_url(config)
+ def __getstate__(self):
+ # things that need to be pickled here
+ pass
+
+ def __setstate__(self):
+ # how to restore pickling here
+ pass
+
def parse_url(self, config):
try:
url = config.get('PNC', 'keycloakUrl') | add pickling skeletons to keycloak_config.py (may not be needed) | project-ncl_pnc-cli | train | py |
cec8eb68611c7424fa8dd233646b6bc1675e8be3 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -398,7 +398,11 @@ function mkdir(dirname, options = {}) {
assert.equal(typeof dirname, 'string', 'expected dirname to be a string');
const opts = Object.assign({ cwd: process.cwd(), fs }, options);
const segs = path.relative(opts.cwd, dirname).split(path.sep);
- const make = dir => fs.mkdirSync(dir, mode(opts));
+ const make = dir => {
+ if (!fs.existsSync(dir)) {
+ fs.mkdirSync(dir, mode(opts));
+ }
+ }
for (let i = 0; i <= segs.length; i++) {
try {
make((dirname = path.join(opts.cwd, ...segs.slice(0, i)))); | fix: use existsSync instead on relying on mkdirSync throwing error (windows throws EPERM on 'C:\') | jonschlinkert_data-store | train | js |
1f4da7416feeb1d0e1c1174031c59654e633ac89 | diff --git a/commands/connect.go b/commands/connect.go
index <HASH>..<HASH> 100644
--- a/commands/connect.go
+++ b/commands/connect.go
@@ -108,6 +108,10 @@ func connectNodes(tb testbed.BasicTestbed, from, to []int, timeout time.Duration
var results []Result
for _, f := range from {
for _, t := range to {
+ if f == t {
+ continue
+ }
+
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel() | don't connect to self with connect command | ipfs_iptb | train | go |
d87a147987d528f9986900c4f267fd5e14a2671b | diff --git a/app/models/kt_environment.rb b/app/models/kt_environment.rb
index <HASH>..<HASH> 100644
--- a/app/models/kt_environment.rb
+++ b/app/models/kt_environment.rb
@@ -64,7 +64,7 @@ class KTEnvironment < ActiveRecord::Base
:join_table => "environment_priors", :association_foreign_key => :environment_id, :readonly => true}
has_many :system_templates, :class_name => "SystemTemplate", :foreign_key => :environment_id
- has_many :environment_products, :class_name => "EnvironmentProduct", :dependent => :destroy, :uniq=>true
+ has_many :environment_products, :class_name => "EnvironmentProduct", :foreign_key => "environment_id", :dependent => :destroy, :uniq=>true
has_many :products, :through => :environment_products
has_many :systems, :inverse_of => :environment, :foreign_key => :environment_id | Updated the environment model to do a proper list products call | Katello_katello | train | rb |
86eb39da2574ffd205848b81ab59c166245b00f8 | diff --git a/topydo/ui/columns/ConsoleWidget.py b/topydo/ui/columns/ConsoleWidget.py
index <HASH>..<HASH> 100644
--- a/topydo/ui/columns/ConsoleWidget.py
+++ b/topydo/ui/columns/ConsoleWidget.py
@@ -66,7 +66,9 @@ def topydostringToMarkup(p_string):
# markup
if color_at_start and isinstance(p_string.metadata, Todo):
priority = p_string.metadata.priority()
- markup = ('pri_' + priority, markup)
+
+ if priority:
+ markup = ('pri_' + priority, markup)
return markup | Show items without priority in console
When topydo is run with colors, items without priority get an invalid
markup added. Only add markup when an item has actually a priority.
Bug found and fixed by @mruwek | bram85_topydo | train | py |
a43bd14b6979e866f35c661ed0956e12bde43835 | diff --git a/tests/Webfactory/Doctrine/ORMTestInfrastructure/ORMInfrastructureTest.php b/tests/Webfactory/Doctrine/ORMTestInfrastructure/ORMInfrastructureTest.php
index <HASH>..<HASH> 100644
--- a/tests/Webfactory/Doctrine/ORMTestInfrastructure/ORMInfrastructureTest.php
+++ b/tests/Webfactory/Doctrine/ORMTestInfrastructure/ORMInfrastructureTest.php
@@ -258,4 +258,27 @@ class ORMInfrastructureTest extends \PHPUnit_Framework_TestCase
$infrastructure->getEntityManager()->persist($entityWithDependency);
$infrastructure->getEntityManager()->flush();
}
+
+ /**
+ * Checks if the automatic dependency setup can cope with reference cycles,
+ * for example if an entity references itself.
+ */
+ public function testAutomaticDependencyDetectionCanHandleCycles()
+ {
+
+ }
+
+ /**
+ * Checks if the automatic dependency setup can cope with chained references.
+ *
+ * Example:
+ *
+ * A -> B -> C
+ *
+ * A references B, B references C. A is not directly related to C.
+ */
+ public function testAutomaticDependencyDetectionCanHandleChainedRelations()
+ {
+
+ }
} | added test stubs (#4) | webfactory_doctrine-orm-test-infrastructure | train | php |
9f9a0938b9eac0f0dc6face5f9d831a8465acb0c | diff --git a/mail/mail.go b/mail/mail.go
index <HASH>..<HASH> 100644
--- a/mail/mail.go
+++ b/mail/mail.go
@@ -1,2 +1,4 @@
// Package mail implements reading and writing mail messages.
+//
+// RFC 5322 defines the Internet Message Format.
package mail
diff --git a/message.go b/message.go
index <HASH>..<HASH> 100644
--- a/message.go
+++ b/message.go
@@ -1,2 +1,5 @@
-// Package message implements the Internet Message Format.
+// Package message implements reading and writing multipurpose messages.
+//
+// RFC 2045, RFC 2046 and RFC 2047 defines MIME, and RFC 2183 defines the
+// Content-Disposition header field.
package message | Adds references to RFCs in docs | emersion_go-message | train | go,go |
31843278712089287403183030192e640e827293 | diff --git a/src/js/constants.js b/src/js/constants.js
index <HASH>..<HASH> 100644
--- a/src/js/constants.js
+++ b/src/js/constants.js
@@ -63,5 +63,5 @@ export const REGEXP_TAG_NAME = /^img|canvas$/i;
// Misc
// Inspired by the default width and height of a canvas element.
-export const MIN_CONTAINER_WIDTH = 300;
-export const MIN_CONTAINER_HEIGHT = 150;
+export const MIN_CONTAINER_WIDTH = 200;
+export const MIN_CONTAINER_HEIGHT = 100; | fix: revert the min container width and height | fengyuanchen_cropperjs | train | js |
da98a208429dc66ffca33b28f46531f0ed520aeb | diff --git a/src/AudioPlayer.js b/src/AudioPlayer.js
index <HASH>..<HASH> 100644
--- a/src/AudioPlayer.js
+++ b/src/AudioPlayer.js
@@ -573,7 +573,7 @@ class AudioPlayer extends Component {
}
isSeekUnavailable () {
- return Boolean(!this.audio || !this.audio.src);
+ return Boolean(this.state.activeTrackIndex < 0);
}
getControlProps (controlIndex) { | isSeekUnavailable() based on state. | benwiley4000_cassette | train | js |
b0228d94beeeb331f6ac58b289eba4982a42c5d4 | diff --git a/pkg/beam/unix.go b/pkg/beam/unix.go
index <HASH>..<HASH> 100644
--- a/pkg/beam/unix.go
+++ b/pkg/beam/unix.go
@@ -148,6 +148,14 @@ func sendUnix(conn *net.UnixConn, data []byte, fds ...int) error {
}
func extractFds(oob []byte) (fds []int) {
+ // Grab forklock to make sure no forks accidentally inherit the new
+ // fds before they are made CLOEXEC
+ // There is a slight race condition between ReadMsgUnix returns and
+ // when we grap the lock, so this is not perfect. Unfortunately
+ // There is no way to pass MSG_CMSG_CLOEXEC to recvmsg() nor any
+ // way to implement non-blocking i/o in go, so this is hard to fix.
+ syscall.ForkLock.Lock()
+ defer syscall.ForkLock.Unlock()
scms, err := syscall.ParseSocketControlMessage(oob)
if err != nil {
return
@@ -158,6 +166,10 @@ func extractFds(oob []byte) (fds []int) {
continue
}
fds = append(fds, gotFds...)
+
+ for _, fd := range fds {
+ syscall.CloseOnExec(fd)
+ }
}
return
} | beam: Make extracted Fds CloseOnExec
Grab forklock to make sure no forks accidentally inherit the new fds
before they are made CLOEXEC There is a slight race condition between
ReadMsgUnix returns and when we grap the lock, so this is not
perfect. Unfortunately There is no way to pass MSG_CMSG_CLOEXEC to
recvmsg() nor any way to implement non-blocking i/o in go, so this is
hard to fix.
Docker-DCO-<I>- | moby_moby | train | go |
32b187d14ab49c4d698ac58a997c0107463bab79 | diff --git a/google/gax/__init__.py b/google/gax/__init__.py
index <HASH>..<HASH> 100644
--- a/google/gax/__init__.py
+++ b/google/gax/__init__.py
@@ -153,8 +153,9 @@ class CallOptions(object):
>>> # change an api call's timeout
>>> o1 = CallOptions(timeout=30) # make the timeout 30 seconds
>>>
- >>> # disable page streaming on an api call that normally supports it
- >>> o2 = CallOptions(page_streaming=False)
+ >>> # set page streaming to be per-page on a call where it is
+ >>> # normally per-resource
+ >>> o2 = CallOptions(page_token=INITIAL_PAGE)
>>>
>>> # disable retrying on an api call that normally retries
>>> o3 = CallOptions(retry=None) | Fix CallOptions snippet
Previously, it refered to an outdated implementation of page
streaming. | googleapis_gax-python | train | py |
a779687b4485efba081b6e17360c66ad8542479a | diff --git a/src/main/java/io/reactivex/disposables/Disposables.java b/src/main/java/io/reactivex/disposables/Disposables.java
index <HASH>..<HASH> 100644
--- a/src/main/java/io/reactivex/disposables/Disposables.java
+++ b/src/main/java/io/reactivex/disposables/Disposables.java
@@ -66,9 +66,9 @@ public final class Disposables {
}
/**
- * Construct a Disposable by wrapping a Runnable that is
- * executed exactly once when the Disposable is disposed.
- * @param future the Runnable to wrap
+ * Construct a Disposable by wrapping a Future that is
+ * cancelled exactly once when the Disposable is disposed.
+ * @param future the Future to wrap
* @param allowInterrupt if true, the future cancel happens via Future.cancel(true)
* @return the new Disposable instance
*/ | 2.x: Fixed Javadoc for Disposables.fromFuture (#<I>)
* Fixed Javadoc for Disposables.fromFuture
* Missed a runnable | ReactiveX_RxJava | train | java |
846e072809af44dfd904666d96d77c6471d11fc1 | diff --git a/spec/lib/sprite_builder_spec.rb b/spec/lib/sprite_builder_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/sprite_builder_spec.rb
+++ b/spec/lib/sprite_builder_spec.rb
@@ -28,6 +28,25 @@ describe Svgeez::SpriteBuilder do
end
end
+ context '#destination_file_name' do
+ # TODO
+ it 'should return a string when @destination quacks like a folder.' do
+ sprite_builder = Svgeez::SpriteBuilder.new({
+ 'destination' => './foo'
+ })
+
+ expect(sprite_builder.destination_file_name).to eq('svgeez.svg')
+ end
+
+ it 'should return a string when @destination quacks like a file.' do
+ sprite_builder = Svgeez::SpriteBuilder.new({
+ 'destination' => './foo/bar.svg'
+ })
+
+ expect(sprite_builder.destination_file_name).to eq('bar.svg')
+ end
+ end
+
context '#destination_file_path' do
it 'should return a path when @destination is not specified.' do
sprite_builder = Svgeez::SpriteBuilder.new({}) | Add destination_file_name spec. | jgarber623_svgeez | train | rb |
3a57a2ce022a57970d519031c2b6d184e7587b68 | diff --git a/islandora.api.php b/islandora.api.php
index <HASH>..<HASH> 100644
--- a/islandora.api.php
+++ b/islandora.api.php
@@ -427,17 +427,21 @@ function hook_islandora_undeletable_datastreams(array $models) {
* - do_function: An associate array including:
* - 'function': The callback function to be called.
* - 'args': An array of arguments to pass to the callback function.
+ * - 'file': A file to include (relative to the module's path, including
+ * the file's extension).
* - undo_function: An associate array including:
* - 'function': The callback function to be called to reverse the
* executed action in the ingest steps.
* - 'args': An array of arguments to pass to the callback function.
+ * - 'file': A file to include (relative to the module's path, including
+ * the file's extension).
* Shared parameters between both types:
* - weight: The "weight" of this step--heavier(/"larger") values sink to the
* end of the process while smaller(/"lighter") values are executed first.
* Both types may optionally include:
* - module: A module from which we want to load an include.
* "Form" type may optionally include:
- * - file: A file to include (relative to the module's path, including the
+ * - 'file': A file to include (relative to the module's path, including the
* file's extension).
*/
function hook_islandora_ingest_steps(array $form_state) { | added ability to specify file for ingest callbacks | Islandora-CLAW_islandora | train | php |
23867e38f5b5f8bfd3e9f327a42f2b9d60b73c32 | diff --git a/execution-modes/appsensor-kafka-server/src/main/java/org/owasp/appsensor/kafka/KafkaRequestHandler.java b/execution-modes/appsensor-kafka-server/src/main/java/org/owasp/appsensor/kafka/KafkaRequestHandler.java
index <HASH>..<HASH> 100644
--- a/execution-modes/appsensor-kafka-server/src/main/java/org/owasp/appsensor/kafka/KafkaRequestHandler.java
+++ b/execution-modes/appsensor-kafka-server/src/main/java/org/owasp/appsensor/kafka/KafkaRequestHandler.java
@@ -314,7 +314,7 @@ public class KafkaRequestHandler implements RequestHandler, KafkaConstants, Resp
logger.info("Starting EventManager kafka consumer .. ");
- logger.info("Connecting to zookepper: " + config.getConsumerZookeeperConnect());
+ logger.info("Connecting to zookeeper: " + config.getConsumerZookeeperConnect());
logger.info("Connecting with group id: " + config.getConsumerGroupId());
logger.info("Connecting with client id: " + config.getClientApplicationName());
logger.info("Connecting to topic: " + topic); | Correct zookeeper spelling in log message
Correct spelling of zookeeper term within ListenerThread constructor log
message. | jtmelton_appsensor | train | java |
6b12de4c31e5401ae0b7bd3283092f68b99bb45a | diff --git a/h2o-core/src/main/java/water/AutoBuffer.java b/h2o-core/src/main/java/water/AutoBuffer.java
index <HASH>..<HASH> 100644
--- a/h2o-core/src/main/java/water/AutoBuffer.java
+++ b/h2o-core/src/main/java/water/AutoBuffer.java
@@ -641,7 +641,7 @@ public /* final */ class AutoBuffer {
int oldpos = _bb.position();
_bb = ByteBuffer.wrap(MemoryManager.arrayCopyOfRange(ary,0,newLen),oldpos,newLen-oldpos)
.order(ByteOrder.nativeOrder());
- } else {
+ } else if (_bb.capacity() != BBP_BIG._size) { //avoid expanding existing BBP items
int oldPos = _bb.position();
_bb.flip();
_bb = BBP_BIG.make().put(_bb); | Fixes a bug that allowed big buffers to be constantly reallocated when it wasn't needed. This saves memory and time. | h2oai_h2o-3 | train | java |
3f0ef2b43e0f8ae49057f959fa13ff0838a8b474 | diff --git a/build/docker/zap-baseline.py b/build/docker/zap-baseline.py
index <HASH>..<HASH> 100755
--- a/build/docker/zap-baseline.py
+++ b/build/docker/zap-baseline.py
@@ -366,7 +366,7 @@ def main(argv):
print ('Total of ' + str(len(zap.core.urls)) + ' URLs')
# Retrieve the alerts using paging in case there are lots of them
st = 0
- pg = 100
+ pg = 5000
alert_dict = {}
alerts = zap.core.alerts(start=st, count=pg)
while len(alerts) > 0: | Increase page size when accessing alerts
It turns out that the paging is not implemented very efficiently, and
choosing too small a page size can take a very long time. | zaproxy_zaproxy | train | py |
3279332d439782303cdea354e3a27a9f929f0354 | diff --git a/bin/run-tests.js b/bin/run-tests.js
index <HASH>..<HASH> 100755
--- a/bin/run-tests.js
+++ b/bin/run-tests.js
@@ -164,7 +164,7 @@ function runInBrowser(url, retries, resolve, reject) {
console.log(chalk.red('Browser crashed with exit code ' + code));
if (retries > 1) {
- console.log(chalk.yellow('Retrying... ¯_(ツ)_/¯'));
+ console.log(chalk.yellow('Retrying... ¯\\_(ツ)_/¯'));
runInBrowser(url, retries - 1, resolve, reject);
} else {
console.log(chalk.red('Giving up! (╯°□°)╯︵ ┻━┻')); | [BUGFIX beta] Fix missing limb
The shrug emoticon went from having a broken arm (improperly escaped) to no arm during the [prettifying](<URL>) process. | emberjs_ember.js | train | js |
4fed4ca14e9a755066a1f3df287464601f4b866f | diff --git a/lxd/network/driver_common.go b/lxd/network/driver_common.go
index <HASH>..<HASH> 100644
--- a/lxd/network/driver_common.go
+++ b/lxd/network/driver_common.go
@@ -46,6 +46,12 @@ type forwardPortMap struct {
target forwardTarget
}
+type loadBalancerPortMap struct {
+ listenPorts []uint64
+ protocol string
+ targets []forwardTarget
+}
+
// subnetUsageType indicates the type of use for a subnet.
type subnetUsageType uint | lxd/network/driver/common: Adds loadBalancerPortMap type | lxc_lxd | train | go |
90e60fb67e06ba194f0caaf134a395991a534f83 | diff --git a/src/main/java/water/exec/AST.java b/src/main/java/water/exec/AST.java
index <HASH>..<HASH> 100644
--- a/src/main/java/water/exec/AST.java
+++ b/src/main/java/water/exec/AST.java
@@ -570,8 +570,12 @@ class ASTAssign extends AST {
for (int i = 0; i < cs.length; i++) {
int cidx = (int) cs[i] - 1; // Convert 1-based to 0-based
Vec rv = env.addRef(rvecs[rvecs.length == 1 ? 0 : i]);
- if (cidx == ary.numCols())
+ if (cidx == ary.numCols()) {
+ env.subRef(rv);
+ rv = ary.anyVec().align(rv);
+ env.addRef(rv);
ary.add("C" + String.valueOf(cidx + 1), rv); // New column name created with 1-based index
+ }
else {
if (!(rv.group().equals(ary.anyVec().group())) && rv.length() == ary.anyVec().length()) {
env.subRef(rv); | align a new column with the data frame's VG | h2oai_h2o-2 | train | java |
49b3e49079914922a43592d85a6ae538d81f5bd5 | diff --git a/lib/techs/deps.js.js b/lib/techs/deps.js.js
index <HASH>..<HASH> 100644
--- a/lib/techs/deps.js.js
+++ b/lib/techs/deps.js.js
@@ -22,7 +22,7 @@ exports.Tech = INHERIT(Tech, {
res = deps.parse(decl.blocks || decl.deps);
return deps.expand(this).then(function() {
- return deps.buildDeps(res.ol);
+ return { deps: deps.buildDeps(res.ol) };
});
}, | Return correct object from `transformBuildDecl()` of `deps.js` tech | bem-archive_bem-tools | train | js |
e5048121741084846229bce919b82022ba001ff9 | diff --git a/glue/ligolw/param.py b/glue/ligolw/param.py
index <HASH>..<HASH> 100644
--- a/glue/ligolw/param.py
+++ b/glue/ligolw/param.py
@@ -202,7 +202,7 @@ class Param(ligolw.Param):
if c.tagName not in self.validchildren:
raise ElementError, "invalid child %s for %s" % (c.tagName, self.tagName)
c.write(file, indent + ligolw.Indent)
- if self.pcdata:
+ if self.pcdata is not None:
# we have to strip quote characters from string
# formats (see comment above)
file.write(indent + ligolw.Indent) | fix write() method when pcdata evaluates to False | gwastro_pycbc-glue | train | py |
f50fbab11f69aa537bf27054409a992f69dd1132 | diff --git a/test/test_fake_web.rb b/test/test_fake_web.rb
index <HASH>..<HASH> 100644
--- a/test/test_fake_web.rb
+++ b/test/test_fake_web.rb
@@ -48,9 +48,9 @@ class TestFakeWeb < Test::Unit::TestCase
end
end
- def test_register_uri_without_domain_name
+ def test_register_uri_with_invalid_uri
assert_raises URI::InvalidURIError do
- FakeWeb.register_uri(:get, 'test_example2.txt', :body => fixture_path("test_example.txt"))
+ FakeWeb.register_uri(:get, '#~invalid~#', :body => fixture_path("test_example.txt"))
end
end | Tests: fix URI to really be invalid for Ruby <I>
As of Ruby <I>, URI supports parsing domain names that use the new
generic top-level domains (gTLDs), such as .info, .tech, etc. Although
.txt is not an active TLD, URI no longer concerns itself with this
problem and now only raises a URI::InvalidURIError when a domain name is
syntactically invalid. So this test only worked on older Rubies. | chrisk_fakeweb | train | rb |
9781dcaac7b53bb6287ccf5a7bd4f37f840a211e | diff --git a/scripts/generateJSParserDemo.php b/scripts/generateJSParserDemo.php
index <HASH>..<HASH> 100644
--- a/scripts/generateJSParserDemo.php
+++ b/scripts/generateJSParserDemo.php
@@ -111,7 +111,7 @@ This parser/renderer used on this page page has been generated via [url=https://
<div id="preview"><pre></pre></div>
- <script type="text/javascript"><?php echo $jsParser ?>
+ <script type="text/javascript"><?php echo $jsParser; ?>
var text,
xml,
@@ -242,7 +242,7 @@ This parser/renderer used on this page page has been generated via [url=https://
{
refreshLog();
}
- }, 50);
+ }, 20);
</script>
</body>
</html><?php | TextFormatter: bumped the maximum refresh rate to <I>fps in JSParserDemo | s9e_TextFormatter | train | php |
83d78896dd67620a80e6d0f472b114830ddb4195 | diff --git a/aikif/lib/cls_filelist.py b/aikif/lib/cls_filelist.py
index <HASH>..<HASH> 100644
--- a/aikif/lib/cls_filelist.py
+++ b/aikif/lib/cls_filelist.py
@@ -175,8 +175,9 @@ class FileList(object):
"""
op_folder = os.path.dirname(opFile)
- if not os.path.exists(op_folder):
- os.makedirs(op_folder)
+ if op_folder is not None: # short filename passed
+ if not os.path.exists(op_folder):
+ os.makedirs(op_folder)
with open(opFile,'w') as fout: | save_filelist doesnt try to makedirs if short filename passed without folder | acutesoftware_AIKIF | train | py |
5811fa8096b86559336de1ef44173cddb480b4d2 | diff --git a/src/test/java/net/openhft/performance/tests/network/SimpleServerAndClientTest.java b/src/test/java/net/openhft/performance/tests/network/SimpleServerAndClientTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/net/openhft/performance/tests/network/SimpleServerAndClientTest.java
+++ b/src/test/java/net/openhft/performance/tests/network/SimpleServerAndClientTest.java
@@ -77,7 +77,7 @@ public class SimpleServerAndClientTest {
@NotNull
private TcpChannelHub createClient(EventGroup eg, String desc) {
- return new TcpChannelHub(null, eg, WireType.TEXT, "", uri(desc), false, null, HandlerPriority.MONITOR);
+ return new TcpChannelHub(null, eg, WireType.TEXT, "", uri(desc), false, null, HandlerPriority.TIMER);
}
private void createServer(String desc, EventGroup eg) throws IOException { | Use the TIMER for heartbeats instead of the REPLICATION thread and remove some duplicate methods. | OpenHFT_Chronicle-Network | train | java |
45a7f9054d654ae0bbea12f323676beab3a77d1b | diff --git a/public/js/views/image_upload/crop.js b/public/js/views/image_upload/crop.js
index <HASH>..<HASH> 100644
--- a/public/js/views/image_upload/crop.js
+++ b/public/js/views/image_upload/crop.js
@@ -91,7 +91,8 @@ define(function (require) {
onSelect: this.select,
onRelease: this.select,
aspectRatio: this.ratio,
- setSelect: selection
+ setSelect: selection,
+ keySupport: false // Stop the page scroll from jumping: http://cl.ly/0e1e1615262h
// Store a reference to jcrop and call the ready function
}, function() { | Fixes weird scroll jump issue with second cropper instance | BKWLD_decoy | train | js |
695a8b81272e0d798763715f27386e9d78fae215 | diff --git a/presto-parser/src/main/java/com/facebook/presto/sql/tree/Node.java b/presto-parser/src/main/java/com/facebook/presto/sql/tree/Node.java
index <HASH>..<HASH> 100644
--- a/presto-parser/src/main/java/com/facebook/presto/sql/tree/Node.java
+++ b/presto-parser/src/main/java/com/facebook/presto/sql/tree/Node.java
@@ -15,13 +15,15 @@ package com.facebook.presto.sql.tree;
import java.util.Optional;
+import static java.util.Objects.requireNonNull;
+
public abstract class Node
{
private Optional<NodeLocation> location;
public Node(Optional<NodeLocation> location)
{
- this.location = location;
+ this.location = requireNonNull(location, "location is null");
}
public <R, C> R accept(AstVisitor<R, C> visitor, C context) | Require non-null node location | prestodb_presto | train | java |
973e2c09c08d7cb26e30381ac4a8388bddf611ad | diff --git a/tests/test-rest-posts-controller.php b/tests/test-rest-posts-controller.php
index <HASH>..<HASH> 100644
--- a/tests/test-rest-posts-controller.php
+++ b/tests/test-rest-posts-controller.php
@@ -408,10 +408,10 @@ class WP_Test_REST_Posts_Controller extends WP_Test_REST_Post_Type_Controller_Te
$this->assertNotEmpty( $cat_link );
$this->assertNull( $format_link );
- $tags_url = add_query_arg( 'post_id', $this->post_id, rest_url( '/wp/v2/tags' ) );
+ $tags_url = add_query_arg( 'post', $this->post_id, rest_url( '/wp/v2/tags' ) );
$this->assertEquals( $tags_url, $tag_link['href'] );
- $category_url = add_query_arg( 'post_id', $this->post_id, rest_url( '/wp/v2/categories' ) );
+ $category_url = add_query_arg( 'post', $this->post_id, rest_url( '/wp/v2/categories' ) );
$this->assertEquals( $category_url, $cat_link['href'] );
$meta_links = $links['https://api.w.org/meta']; | Use correct param to fix failing test | WP-API_WP-API | train | php |
6623d2bd96c84be8b03e304e807793887216cb1f | diff --git a/spectator-reg-atlas/src/main/java/com/netflix/spectator/atlas/AtlasRegistry.java b/spectator-reg-atlas/src/main/java/com/netflix/spectator/atlas/AtlasRegistry.java
index <HASH>..<HASH> 100644
--- a/spectator-reg-atlas/src/main/java/com/netflix/spectator/atlas/AtlasRegistry.java
+++ b/spectator-reg-atlas/src/main/java/com/netflix/spectator/atlas/AtlasRegistry.java
@@ -347,10 +347,6 @@ public final class AtlasRegistry extends AbstractRegistry implements AutoCloseab
// registry is for public consumption to get consolidated values for the publish step
// rather than the step for the meters which is needed here.
super.measurements().forEach(m -> {
- if ("jvm.gc.pause".equals(m.id().name())) {
- logger.trace("received measurement for time: {}: {}", t, m);
- }
-
// Update the map for data to go to the Atlas storage layer
Consolidator consolidator = atlasMeasurements.get(m.id());
if (consolidator == null) { | remove temporary trace logging (#<I>)
Logging for that specific metric name is not all that
useful for general cases. | Netflix_spectator | train | java |
8908a4869b22ff84f3b90c525a92ad2f27018fb8 | diff --git a/emma2/util/pystallone_test.py b/emma2/util/pystallone_test.py
index <HASH>..<HASH> 100644
--- a/emma2/util/pystallone_test.py
+++ b/emma2/util/pystallone_test.py
@@ -5,7 +5,7 @@ Created on 22.01.2014
'''
import unittest
-import pystallone as st
+import emma2.util.pystallone as st
import numpy as np
class TestPyStallone(unittest.TestCase): | [pystallone_test] import module under test by absolute path to avoid double initialization. | markovmodel_PyEMMA | train | py |
0e664350fba5d0cca071d9b5ed234f3853fffa1b | diff --git a/src/ClientInterface.php b/src/ClientInterface.php
index <HASH>..<HASH> 100644
--- a/src/ClientInterface.php
+++ b/src/ClientInterface.php
@@ -87,6 +87,17 @@ interface ClientInterface extends HasEmitterInterface
public function patch($url = null, array $options = []);
/**
+ * Send a POST request
+ *
+ * @param string|array|Url $url URL or URI template
+ * @param array $options Array of request options to apply.
+ *
+ * @return ResponseInterface
+ * @throws RequestException When an error is encountered
+ */
+ public function post($url = null, array $options = []);
+
+ /**
* Send an OPTIONS request
*
* @param string|array|Url $url URL or URI template | Adding missing method to ClientInterface | guzzle_guzzle | train | php |
4edbf537e1ae6ab32e8e3eae0dd62ab34b3318c8 | diff --git a/src/Provider/RestProvider.php b/src/Provider/RestProvider.php
index <HASH>..<HASH> 100644
--- a/src/Provider/RestProvider.php
+++ b/src/Provider/RestProvider.php
@@ -72,9 +72,11 @@ class RestProvider implements ServiceProviderInterface
$dispatcher->addSubscriber($app['alchemy_rest.paginate_request_listener'], -1);
$dispatcher->addSubscriber($app['alchemy_rest.sort_request_listener'], -1);
$dispatcher->addSubscriber($app['alchemy_rest.date_request_listener'], -1);
+ $dispatcher->addSubscriber($app['alchemy_rest.transform_success_result_listener']);
$dispatcher->addSubscriber($app['alchemy_rest.transform_request_accepted_listener']);
$dispatcher->addSubscriber($app['alchemy_rest.transform_response_listener']);
$dispatcher->addSubscriber($app['alchemy_rest.transform_resource_created_listener']);
+ $dispatcher->addSubscriber($app['alchemy_rest.transform_bad_request_listener']);
$dispatcher->addSubscriber($app['alchemy_rest.encode_response_listener']);
return $dispatcher; | Add Missing listener for Controller results. | alchemy-fr_rest-bundle | train | php |
469f305ab23f0fde1de7689183289c591074344b | diff --git a/lib/halite/gem.rb b/lib/halite/gem.rb
index <HASH>..<HASH> 100644
--- a/lib/halite/gem.rb
+++ b/lib/halite/gem.rb
@@ -35,6 +35,8 @@ module Halite
def initialize(name, version=nil)
# Allow passing a Dependency by just grabbing its spec.
name = dependency_to_spec(name) if name.is_a?(::Gem::Dependency)
+ # Stubs don't load enough data for us, grab the real spec. RIP IOPS.
+ name = name.to_spec if name.is_a?(::Gem::StubSpecification)
if name.is_a?(::Gem::Specification)
raise Error.new("Cannot pass version when using an explicit specficiation") if version
@spec = name | Try to resolve issues loading from StubSpecifications. | poise_halite | train | rb |
05bcc4fe58ff96aaa5175ebc5338844488fdc740 | diff --git a/lib/Cake/Network/Email/SmtpTransport.php b/lib/Cake/Network/Email/SmtpTransport.php
index <HASH>..<HASH> 100644
--- a/lib/Cake/Network/Email/SmtpTransport.php
+++ b/lib/Cake/Network/Email/SmtpTransport.php
@@ -171,7 +171,7 @@ class SmtpTransport extends AbstractTransport {
$lines = $this->_cakeEmail->message();
$messages = array();
foreach ($lines as $line) {
- if ((! empty($line)) && ($line[0] === '.')) {
+ if ((!empty($line)) && ($line[0] === '.')) {
$messages[] = '.' . $line;
} else {
$messages[] = $line; | Delete a space between ! and empty | cakephp_cakephp | train | php |
d489f971f9764b58ee3e639455a02246ef46cf8d | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -24,11 +24,11 @@ with open('README.rst') as readme_file:
readme = readme_file.read()
requirements = [
- 'requests>=2.18.4,<3.0',
+ 'requests>=2.18.1,<3.0',
'PyNaCl>=1.1.2,<2.0',
'pymacaroons>=0.12.0,<1.0',
'six>=1.11.0,<2.0',
- 'protobuf>=3.4.0,<4.0',
+ 'protobuf>=3.0.0,<4.0',
'pyRFC3339>=1.0,<2.0',
'pytz>=2017.2,<2018.0'
] | Lowering the protobuf and requests deps. | go-macaroon-bakery_py-macaroon-bakery | train | py |
631e05c7acf953136613db0f0edc39e86a79e8e7 | diff --git a/MatchState.php b/MatchState.php
index <HASH>..<HASH> 100644
--- a/MatchState.php
+++ b/MatchState.php
@@ -72,7 +72,7 @@ class MatchState
public function getMatchReference($key, $type)
{
- return isset($this->matchReferences[$type][$key]) ? $this->matchReferences[$type][$key] : null;
+ return isset($this->matchReferences[$type][$key]) ? $this->matchReferences[$type][$key] : '';
}
public function getMatchReferences($type) | changed it to return an empty string again instead of null | giftcards_ModRewrite | train | php |
9dc6c0605a190f4aed55b498683cf6094d069856 | diff --git a/OrientDB/OrientDBCommandAbstract.php b/OrientDB/OrientDBCommandAbstract.php
index <HASH>..<HASH> 100644
--- a/OrientDB/OrientDBCommandAbstract.php
+++ b/OrientDB/OrientDBCommandAbstract.php
@@ -224,7 +224,7 @@ abstract class OrientDBCommandAbstract
$this->debugCommand('record_clusterId');
$record->clusterId = $this->readShort();
$this->debugCommand('record_position');
- $record->recordId = $this->readLong();
+ $record->recordPos = $this->readLong();
$this->debugCommand('record_version');
$record->version = $this->readInt();
$this->debugCommand('record_content'); | Added tests for dictionaryPut #0. Forget to commit this change. | AntonTerekhov_OrientDB-PHP | train | php |
761322280d15bdf1772d3fd5052058ddd84d2f89 | diff --git a/app/models/user.rb b/app/models/user.rb
index <HASH>..<HASH> 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -57,7 +57,7 @@ class User
end
def valid_password_confirmation
- unless password == password_confirmation
+ if password != password_confirmation
errors.add(:password, :confirmation, attribute: User.human_attribute_name(:password_confirmation))
end
end | Use `if` instead of `unless` for readability | fluent_fluentd-ui | train | rb |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.