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
|
---|---|---|---|---|---|
349510c470def04d9774eb47d64414bf6f175262 | diff --git a/src/Modus/FrontController/Http.php b/src/Modus/FrontController/Http.php
index <HASH>..<HASH> 100644
--- a/src/Modus/FrontController/Http.php
+++ b/src/Modus/FrontController/Http.php
@@ -44,20 +44,11 @@ class Http {
}
protected function _configureAutoloaders() {
- return;
$config = $this->_config;
- if($config['composer']['use_composer']) {
- require_once $config['composer']['composer_autoloader'];
- }
-
$autoloaders = $config['autoloaders'];
- if(count($autoloaders) > 0) {
- require_once 'Modus/Autoloader/Base.php';
- }
foreach($autoloaders as $file => $class) {
- require_once($file);
new $class();
}
}
@@ -149,6 +140,7 @@ class Http {
protected function _setupConfig($config) {
$this->_config = $config;
foreach($config['directories'] as $directory) {
+ var_dump($directory);
if(realpath($directory)) {
set_include_path(get_include_path() . ":$directory");
} | Initiate autoloaders correctly so that they correctly handle. Also, figure out what path is being echoed. | modusphp_framework | train | php |
a469536b420455a8f264a4061f7c298ae5f86d6f | diff --git a/client/lib/media/list-store.js b/client/lib/media/list-store.js
index <HASH>..<HASH> 100644
--- a/client/lib/media/list-store.js
+++ b/client/lib/media/list-store.js
@@ -134,7 +134,7 @@ MediaListStore.isItemMatchingQuery = function( siteId, item ) {
matches = true;
- if ( query.search ) {
+ if ( query.search && ! query.source ) {
// WP_Query tests a post's title and content when performing a search.
// Since we're testing binary data, we match the title only.
// | Don’t filter external media searches by filename
External media searches occur across data other than the filename. For example, Google Photos analyzes the content of the photo and matches on that.
This allows the API endpoint to determine if an item matches | Automattic_wp-calypso | train | js |
e58998e0eb01a4821fc42b5d35773af6c81e349f | diff --git a/lib/ooor/connection_handler.rb b/lib/ooor/connection_handler.rb
index <HASH>..<HASH> 100644
--- a/lib/ooor/connection_handler.rb
+++ b/lib/ooor/connection_handler.rb
@@ -1,9 +1,10 @@
+require 'active_support/core_ext/hash/indifferent_access'
require 'ooor/connection'
module Ooor
class ConnectionHandler
def connection_spec(config)
- config.slice(:url, :user_id, :password, :database, :scope_prefix)
+ HashWithIndifferentAccess.new(config.slice(:url, :user_id, :password, :database, :scope_prefix))
end
# meant to be overriden for Omniauth, Devise... | fixed a bug with connection_spec and connections not being properly reused | akretion_ooor | train | rb |
ea2230a5819c63c3467404690feca0c57c090d9c | diff --git a/wallace/command_line.py b/wallace/command_line.py
index <HASH>..<HASH> 100755
--- a/wallace/command_line.py
+++ b/wallace/command_line.py
@@ -105,7 +105,7 @@ def setup_experiment(debug=True, verbose=False, app=None):
# Check that the version of Wallace specified in the config file is the one
# that we are currently running.
wallace_version = config.get('Experiment Configuration', 'wallace_version')
- this_version = pkg_resources.require("wallace")[0].version
+ this_version = pkg_resources.require("wallace-platform")[0].version
if wallace_version != this_version:
raise AssertionError(
"You are using Wallace v" + this_version + ", " | Use correct package name (#<I>) | berkeley-cocosci_Wallace | train | py |
b447eb73afc88d96993b5e2413af776a702d0f8f | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -85,7 +85,7 @@ var _startListening = function($done) {
if (err || WWW._handle) // _handle means server is already listening
return $done(err);
- WWW.listen(CONF.port_www, function(err) {
+ WWW.listen(CONF.port_www, CONF.hostname_www, function(err) {
if (!err) {
var msg = 'Admin UI on port ' + CONF.port_www
__running.listen = true | Teach deetoo to read hostname from config | Rafflecopter_deetoo | train | js |
4e97ce3cd4b060a241872c736fbfa7797380bfb3 | diff --git a/emma2/msm/estimation/__init__.py b/emma2/msm/estimation/__init__.py
index <HASH>..<HASH> 100644
--- a/emma2/msm/estimation/__init__.py
+++ b/emma2/msm/estimation/__init__.py
@@ -22,7 +22,7 @@ Connectivity
connected_sets - Find connected subsets
largest_connected_set - Find largest connected set
- connected_count_matrix - Count matrix on largest connected set
+ largest_connected_submatrix - Count matrix on largest connected set
is_connected - Test count matrix connectivity
Estimation | [doc] adopted method refactoring: connected_count_matrix -> largest_connected_submatrix | markovmodel_PyEMMA | train | py |
4bf10ff31b296fd246eac77b0b63f8e11d30bacb | diff --git a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb
index <HASH>..<HASH> 100644
--- a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb
+++ b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb
@@ -45,7 +45,7 @@ class Autotest::MerbRspec < Autotest
# Any change to global_helpers will result in all view and controller
# tests being run
add_mapping %r%^app/helpers/global_helpers\.rb% do
- files_matching %r%^spec/(views|controllers)/.*_spec\.rb$%
+ files_matching %r%^spec/(views|controllers|helpers)/.*_spec\.rb$%
end
# Any change to a helper will cause its spec to be run | changes to the global_helpers should run every helper spec too | wycats_merb | train | rb |
d7d9173b5eb70a38be03db9d93e8272d32efd736 | diff --git a/appliance/redis/cmd/flynn-redis/main_test.go b/appliance/redis/cmd/flynn-redis/main_test.go
index <HASH>..<HASH> 100644
--- a/appliance/redis/cmd/flynn-redis/main_test.go
+++ b/appliance/redis/cmd/flynn-redis/main_test.go
@@ -41,6 +41,9 @@ func TestMain_Discoverd(t *testing.T) {
return hb, nil
}
+ // set a password
+ m.Process.Password = "test"
+
// Execute program.
if err := m.Run(); err != nil {
t.Fatal(err) | appliance/redis: Set a password in TestMain_Discoverd
CI runs an old version of Redis which seems to handle empty passwords
differently than newer versions (e.g. the version used in vagrant) | flynn_flynn | train | go |
e7691327e5ddaa4ac9ebbd9c3f2c22915c5db26a | diff --git a/examples/basic_usage.py b/examples/basic_usage.py
index <HASH>..<HASH> 100755
--- a/examples/basic_usage.py
+++ b/examples/basic_usage.py
@@ -10,7 +10,6 @@ def run(unihan_options={}):
if not c.unihan.is_bootstrapped: # download and install Unihan to db
c.unihan.bootstrap(unihan_options)
- c.sql.reflect_db()
query = c.unihan.lookup_char('好')
glyph = query.first() | Remove extraneous db reflection | cihai_cihai | train | py |
4db262132a50a4ced7818af450da57cb2863ccf6 | diff --git a/lib/chef/provider/package/zypper.rb b/lib/chef/provider/package/zypper.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/provider/package/zypper.rb
+++ b/lib/chef/provider/package/zypper.rb
@@ -70,10 +70,6 @@ class Chef
end
def candidate_version
- @candidate_version ||= package_name_array.each_with_index.map { |pkg, i| available_version(i) }
- end
-
- def candidate_version
if source_files_exist?
unless uri_scheme?(new_resource.source) || ::File.exist?(new_resource.source)
@package_source_exists = false | Removed unused/repeated candidate version | chef_chef | train | rb |
45b142cc4eeef002c83a967b7c121ca532d6a506 | diff --git a/src/org/jcodings/EncodingDB.java b/src/org/jcodings/EncodingDB.java
index <HASH>..<HASH> 100644
--- a/src/org/jcodings/EncodingDB.java
+++ b/src/org/jcodings/EncodingDB.java
@@ -177,10 +177,15 @@ public class EncodingDB {
public static void set_base(String name, String original) {
}
+ public static Entry dummy(byte[] bytes) {
+ if (encodings.get(bytes) != null) throw new InternalException(ErrorMessages.ERR_ENCODING_ALREADY_REGISTERED, new String(bytes));
+ Entry entry = new Entry(bytes);
+ encodings.putDirect(bytes, entry);
+ return entry;
+ }
+
public static void dummy(String name) {
- byte[]bytes = name.getBytes();
- if (encodings.get(bytes) != null) throw new InternalException(ErrorMessages.ERR_ENCODING_ALREADY_REGISTERED, name);
- encodings.putDirect(bytes, new Entry(bytes));
+ dummy(name.getBytes());
}
static { | Add easier way to instantiate dummy encodings. | jruby_jcodings | train | java |
405d76115d0deb8d5c4bfb1bfdd803485a4cc82c | diff --git a/lib/sequent/core/tenant_event_store.rb b/lib/sequent/core/tenant_event_store.rb
index <HASH>..<HASH> 100644
--- a/lib/sequent/core/tenant_event_store.rb
+++ b/lib/sequent/core/tenant_event_store.rb
@@ -8,11 +8,14 @@ module Sequent
def replay_events_for(organization_id)
replay_events do
@event_record_class.connection.select_all(%Q{
-SELECT event_type, event_json
- FROM #{quote_table_name @event_record_class.table_name}
- WHERE organization_id = #{quote organization_id}
- AND event_type <> #{quote @snapshot_event_class.name}
- ORDER BY id
+SELECT events.event_type, events.event_json
+ FROM #{quote_table_name @event_record_class.table_name} aggregates
+ JOIN #{quote_table_name @event_record_class.table_name} events ON aggregates.aggregate_id = events.aggregate_id
+ WHERE aggregates.organization_id = #{quote organization_id}
+ AND aggregates.sequence_number = 1
+ AND aggregates.event_type <> #{quote @snapshot_event_class.name}
+ AND events.event_type <> #{quote @snapshot_event_class.name}
+ ORDER BY events.id
})
end
end | Fix replaying events for organization
Include all events for all aggregates associated with the
organization (do not skip events that do not have `organization_id`
set). | zilverline_sequent | train | rb |
136343eb7416c3ff19911440c09d1dde60651959 | diff --git a/web3/types.py b/web3/types.py
index <HASH>..<HASH> 100644
--- a/web3/types.py
+++ b/web3/types.py
@@ -161,7 +161,7 @@ TxData = TypedDict("TxData", {
"gasPrice": Wei,
"hash": HexBytes,
"input": HexStr,
- "nonce": int,
+ "nonce": Nonce,
"r": HexBytes,
"s": HexBytes,
"to": ChecksumAddress,
@@ -191,7 +191,7 @@ GasPriceStrategy = Callable[["Web3", TxParams], Wei]
# syntax b/c "from" keyword not allowed w/ class construction
TxReceipt = TypedDict("TxReceipt", {
"blockHash": HexBytes,
- "blockNumber": int,
+ "blockNumber": BlockNumber,
"contractAddress": Optional[ChecksumAddress],
"cumulativeGasUsed": int,
"gasUsed": Wei,
@@ -222,7 +222,7 @@ class MerkleProof(TypedDict):
accountProof: Sequence[HexStr]
balance: int
codeHash: HexBytes
- nonce: int
+ nonce: Nonce
storageHash: HexBytes
storageProof: Sequence[StorageProof] | Some fixes to type definitions (#<I>) | ethereum_web3.py | train | py |
77301637cb5ea607454c8dcc2f6be3d7481650e0 | diff --git a/lib/queryko/filterer.rb b/lib/queryko/filterer.rb
index <HASH>..<HASH> 100644
--- a/lib/queryko/filterer.rb
+++ b/lib/queryko/filterer.rb
@@ -1,11 +1,21 @@
module Queryko
module Filterer
+ # def filter_by_filters
+ # fields.each do |field, filter|
+ # if field == 'limit' || field == 'page'
+ # paginate(filter, )
+ # end
+ # self.relation = filter.first.call(relation, params[field], self) if params[field]
+ # end
+ # end
+
def filter_by_filters
fields.each do |field, filter|
- if field == 'limit' || field == 'page'
- paginate(filter, )
+ paginate(filter) if ['limit', 'page'].include?(field.to_s)
+
+ filter.each do |f|
+ self.relation = f.call(relation, params[field], self) if params[field]
end
- self.relation = filter.first.call(relation, params[field], self) if params[field]
end
end | apply multiple filter instead of getting the first filter | neume_queryko | train | rb |
3cd91e81627f8b60e20d8e029a0bc5e532b5597f | diff --git a/src/transformers/integrations.py b/src/transformers/integrations.py
index <HASH>..<HASH> 100644
--- a/src/transformers/integrations.py
+++ b/src/transformers/integrations.py
@@ -54,7 +54,7 @@ from .trainer_utils import PREFIX_CHECKPOINT_DIR, BestRun, EvaluationStrategy #
# Integration functions:
def is_wandb_available():
- if os.getenv("WANDB_DISABLED"):
+ if os.getenv("WANDB_DISABLED", "").upper() in ENV_VARS_TRUE_VALUES:
return False
return importlib.util.find_spec("wandb") is not None | Fix WAND_DISABLED test (#<I>)
* Fix WAND_DISABLED test
* Remove duplicate import
* Make a test that actually works...
* Fix style | huggingface_pytorch-pretrained-BERT | train | py |
20f6fbb3f38237ba82a51a9e6e7720aba0c00974 | diff --git a/slackclient/_channel.py b/slackclient/_channel.py
index <HASH>..<HASH> 100644
--- a/slackclient/_channel.py
+++ b/slackclient/_channel.py
@@ -6,7 +6,7 @@ class Channel(object):
self.members = members
def __eq__(self, compare_str):
- if self.name == compare_str or self.id == compare_str:
+ if self.name == compare_str or self.name == "#" + compare_str or self.id == compare_str:
return True
else:
return False | allow channels to be found with leading # | slackapi_python-slackclient | train | py |
2498a640392494a3d393e14c0b66c9f7f2c51f58 | diff --git a/lib/bibtex/entry/rdf_converter.rb b/lib/bibtex/entry/rdf_converter.rb
index <HASH>..<HASH> 100644
--- a/lib/bibtex/entry/rdf_converter.rb
+++ b/lib/bibtex/entry/rdf_converter.rb
@@ -449,10 +449,8 @@ class BibTeX::Entry::RDFConverter
if bibtex.type == :unpublished
graph << [entry, RDF::DC.created, date]
- graph << [entry, bibo[:created], date]
else
graph << [entry, RDF::DC.issued, date]
- graph << [entry, bibo[:issued], date]
end
end | Remove bibo:created and bibo:issued from #year
They do not exist. (Links to Dublin Core) | inukshuk_bibtex-ruby | train | rb |
1f32ed868b07ff592e3638fff8460eb501e4e3a2 | diff --git a/src/main/java/org/fxmisc/flowless/VirtualizedScrollPane.java b/src/main/java/org/fxmisc/flowless/VirtualizedScrollPane.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/fxmisc/flowless/VirtualizedScrollPane.java
+++ b/src/main/java/org/fxmisc/flowless/VirtualizedScrollPane.java
@@ -324,7 +324,7 @@ public class VirtualizedScrollPane<V extends Node & Virtualized> extends Region
pos,
content.getLayoutBounds().getWidth(),
content.totalWidthEstimateProperty().getValue());
- content.estimatedScrollXProperty().setValue(offset);
+ content.estimatedScrollXProperty().setValue((double) Math.round(offset));
}
private void setVPosition(double pos) {
@@ -332,7 +332,9 @@ public class VirtualizedScrollPane<V extends Node & Virtualized> extends Region
pos,
content.getLayoutBounds().getHeight(),
content.totalHeightEstimateProperty().getValue());
- content.estimatedScrollYProperty().setValue(offset);
+ // offset needs rounding otherwise thin lines appear between cells,
+ // usually only visible when cells have dark backgrounds/borders.
+ content.estimatedScrollYProperty().setValue((double) Math.round(offset));
}
private static void setupUnitIncrement(ScrollBar bar) { | Fix thin lines between cells 2 (#<I>) | FXMisc_Flowless | train | java |
94a5c3356277a1c268b94f56231b009c0fb7ef6f | diff --git a/app/drivers/prottable/info.py b/app/drivers/prottable/info.py
index <HASH>..<HASH> 100644
--- a/app/drivers/prottable/info.py
+++ b/app/drivers/prottable/info.py
@@ -10,9 +10,11 @@ class AddProteinInfoDriver(ProttableAddData):
super().__init__(**kwargs)
self.headertypes = ['proteindata']
self.poolnames = [kwargs.get('setname')]
+ self.genecentric = kwargs.get('genecentric', False)
def set_feature_generator(self):
self.features = preparation.add_protein_data(self.in_proteins,
self.lookup,
self.headerfields,
+ self.genecentric
) | Genecentric also for prottable add info | glormph_msstitch | train | py |
672b8fb8871fdb5fd28713ec4d20b990b148589d | diff --git a/httputil/httputil.go b/httputil/httputil.go
index <HASH>..<HASH> 100644
--- a/httputil/httputil.go
+++ b/httputil/httputil.go
@@ -1,5 +1,6 @@
/*
Copyright 2011 Google Inc.
+Modifications Copyright (c) 2014 Simon Zimmermann
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -65,7 +66,7 @@ func ReturnJSON(rw http.ResponseWriter, data interface{}) {
}
func ReturnJSONCode(rw http.ResponseWriter, code int, data interface{}) {
- rw.Header().Set("Content-Type", "text/javascript")
+ rw.Header().Set("Content-Type", "application/json")
js, err := json.MarshalIndent(data, "", " ")
if err != nil {
BadRequestError(rw, fmt.Sprintf("JSON serialization error: %v", err)) | util: use application/json instead of text/javascript for JSON response | insmo_util | train | go |
ae9acac5feb2220bc04503c80c143525f48c3c45 | diff --git a/jaraco/windows/api/clipboard.py b/jaraco/windows/api/clipboard.py
index <HASH>..<HASH> 100644
--- a/jaraco/windows/api/clipboard.py
+++ b/jaraco/windows/api/clipboard.py
@@ -45,3 +45,9 @@ GetClipboardData.restype = ctypes.wintypes.HANDLE
SetClipboardData = ctypes.windll.user32.SetClipboardData
SetClipboardData.argtypes = ctypes.wintypes.UINT, ctypes.wintypes.HANDLE
SetClipboardData.restype = ctypes.wintypes.HANDLE
+
+OpenClipboard = ctypes.windll.user32.OpenClipboard
+OpenClipboard.argtypes = ctypes.wintypes.HANDLE,
+OpenClipboard.restype = ctypes.wintypes.BOOL
+
+ctypes.windll.user32.CloseClipboard.restype = ctypes.wintypes.BOOL | Add type declarations for clipboard operations. | jaraco_jaraco.windows | train | py |
dc7eb397b349641209f34f346c858f6758692beb | diff --git a/test/util/database.js b/test/util/database.js
index <HASH>..<HASH> 100644
--- a/test/util/database.js
+++ b/test/util/database.js
@@ -9,7 +9,7 @@ var _nsv;
var refreshDb = function(done) {
disposableSeraph({
- version: '2.3.1',
+ version: '3.0.3',
edition: 'community',
port: TEST_INSTANCE_PORT
}, | bump neo4j version in tests | brikteknologier_seraph | train | js |
f0fc515eac953b83bcee24089c649f61cf7bc5f5 | diff --git a/lib/anycable/rails/railtie.rb b/lib/anycable/rails/railtie.rb
index <HASH>..<HASH> 100644
--- a/lib/anycable/rails/railtie.rb
+++ b/lib/anycable/rails/railtie.rb
@@ -70,7 +70,7 @@ module AnyCable
# Since Rails 6.1
if respond_to?(:server)
server do
- next unless AnyCable.config.embedded?
+ next unless AnyCable.config.embedded? && AnyCable::Rails.enabled?
require "anycable/cli"
AnyCable::CLI.embed! | fix: only run embedded server if AnyCable is enabled | anycable_anycable-rails | train | rb |
b3112a4349ca5dc6179ba795874ec36e23a2163b | diff --git a/core/client/routes/reset.js b/core/client/routes/reset.js
index <HASH>..<HASH> 100644
--- a/core/client/routes/reset.js
+++ b/core/client/routes/reset.js
@@ -3,6 +3,12 @@ import loadingIndicator from 'ghost/mixins/loading-indicator';
var ResetRoute = Ember.Route.extend(styleBody, loadingIndicator, {
classNames: ['ghost-reset'],
+ beforeModel: function () {
+ if (this.get('session').isAuthenticated) {
+ this.notifications.showWarn('You can\'t reset your password while you\'re signed in.', true);
+ this.transitionTo(SimpleAuth.Configuration.routeAfterAuthentication);
+ }
+ },
setupController: function (controller, params) {
controller.token = params.token;
}
diff --git a/core/client/routes/signup.js b/core/client/routes/signup.js
index <HASH>..<HASH> 100644
--- a/core/client/routes/signup.js
+++ b/core/client/routes/signup.js
@@ -5,6 +5,7 @@ var SignupRoute = Ember.Route.extend(styleBody, loadingIndicator, {
classNames: ['ghost-signup'],
beforeModel: function () {
if (this.get('session').isAuthenticated) {
+ this.notifications.showWarn('You need to sign out to register as a new user.', true);
this.transitionTo(SimpleAuth.Configuration.routeAfterAuthentication);
}
}, | Reset/Signin while signed in
no issue
- added redirect and notification to reset route
- added notification to signup route | TryGhost_Ghost | train | js,js |
cef712469aa7cec71cffb65dc8da7886c5e0f29e | diff --git a/lib/jitsu/commands/databases.js b/lib/jitsu/commands/databases.js
index <HASH>..<HASH> 100644
--- a/lib/jitsu/commands/databases.js
+++ b/lib/jitsu/commands/databases.js
@@ -199,7 +199,8 @@ databases.list = function (username, callback) {
// Allows arbitrary amount of arguments to deploy
//
if(arguments.length) {
- callback = utile.args(arguments).callback;
+ var args = utile.args(arguments);
+ callback = args.callback;
username = args[0] || null;
} | [api][minor] added args variable to conform to other argument currying formats | nodejitsu_jitsu | train | js |
08c5770d669bf272cb55fe4edc7367038de64a8e | diff --git a/spec/shared/evaluator_behavior.rb b/spec/shared/evaluator_behavior.rb
index <HASH>..<HASH> 100644
--- a/spec/shared/evaluator_behavior.rb
+++ b/spec/shared/evaluator_behavior.rb
@@ -40,6 +40,9 @@ shared_examples_for 'predicate evaluator' do
expect(evaluation.output).to be(true)
evaluation = object.inverse.evaluation(valid_input)
+
+ expect(evaluation.success?).to be(true)
+ expect(evaluation.output).to be(false)
end
end | Add more expectations to predicate inverse shared behavior | mbj_morpher | train | rb |
ea3df5f0432eb25c393a3bfd3279cd46a8458269 | diff --git a/fastlane/lib/fastlane/actions/prompt.rb b/fastlane/lib/fastlane/actions/prompt.rb
index <HASH>..<HASH> 100644
--- a/fastlane/lib/fastlane/actions/prompt.rb
+++ b/fastlane/lib/fastlane/actions/prompt.rb
@@ -18,7 +18,11 @@ module Fastlane
user_input = STDIN.gets(end_tag).chomp.gsub(end_tag, "").strip
else
# Standard one line input
- user_input = STDIN.gets.chomp.strip while (user_input || "").length == 0
+ if params[:secure_text]
+ user_input = STDIN.noecho(&:gets).chomp while (user_input || "").length == 0
+ else
+ user_input = STDIN.gets.chomp.strip while (user_input || "").length == 0
+ end
end
return user_input
@@ -52,6 +56,10 @@ module Fastlane
description: "Is that a boolean question (yes/no)? This will add (y/n) at the end",
default_value: false,
is_string: false),
+ FastlaneCore::ConfigItem.new(key: :secure_text,
+ description: "Is that a secure text (yes/no)?",
+ default_value: false,
+ is_string: false),
FastlaneCore::ConfigItem.new(key: :multi_line_end_keyword,
description: "Enable multi-line inputs by providing an end text (e.g. 'END') which will stop the user input",
optional: true, | added secure text input option (#<I>)
* added secure text input option
* Update prompt.rb | fastlane_fastlane | train | rb |
8b46b1b5c0b065495be0bf518ebf2c7296cf7ac6 | diff --git a/ford/output.py b/ford/output.py
index <HASH>..<HASH> 100644
--- a/ford/output.py
+++ b/ford/output.py
@@ -249,14 +249,12 @@ class Documentation(object):
shutil.copy(src.path, os.path.join(out_dir, "src", src.name))
if "mathjax_config" in self.data:
- os.mkdir(os.path.join(out_dir, "js", "MathJax-config"))
+ mathjax_path = os.mkdir(os.path.join(out_dir, "js", "MathJax-config"))
+ if not os.path.join(mathjax_config)
+ os.mkdir(mathjax_config)
shutil.copy(
self.data["mathjax_config"],
- os.path.join(
- out_dir,
- "js",
- "MathJax-config",
- os.path.basename(self.data["mathjax_config"]),
+ os.path.join(mathjax_config, os.path.basename(self.data["mathjax_config"]),
),
)
# By doing this we omit a duplication of data. | Don't fail when MathJax-config dir already exists
Only create the directory MathJax-config when it doesn't exist yet. Avoids a crash with FileExistsError, which I don't see why it should be fatal. | Fortran-FOSS-Programmers_ford | train | py |
f8c34933fdb86a08729c62b880eb5b6aa9527ecd | diff --git a/pkg/minikube/reason/known_issues.go b/pkg/minikube/reason/known_issues.go
index <HASH>..<HASH> 100644
--- a/pkg/minikube/reason/known_issues.go
+++ b/pkg/minikube/reason/known_issues.go
@@ -335,7 +335,7 @@ var providerIssues = []match{
ID: "PR_HYPERKIT_VMNET_FRAMEWORK",
ExitCode: ExProviderError,
Advice: `Hyperkit networking is broken. Try disabling Internet Sharing: System Preference > Sharing > Internet Sharing.
-Also you could try to upgrade to the latest "hyperkit" version and/or Docker for Desktop. You may choose an alternate --driver`,
+Alternatively, you can try upgrading to the latest hyperkit version, or using an alternate driver.`,
Issues: []int{6028, 5594},
},
Regexp: re(`error from vmnet.framework: -1`), | Update pkg/minikube/reason/known_issues.go | kubernetes_minikube | train | go |
83b84d9a6fd1f1adad632e0578110c6b191fb8a5 | diff --git a/php/class-template-hierarchy.php b/php/class-template-hierarchy.php
index <HASH>..<HASH> 100644
--- a/php/class-template-hierarchy.php
+++ b/php/class-template-hierarchy.php
@@ -15,6 +15,7 @@ class Template_Hierarchy {
'attachment',
'single',
'page',
+ 'singular',
'category',
'tag',
'author',
@@ -107,7 +108,7 @@ class Template_Hierarchy {
case 'page':
$page_id = get_queried_object_id();
- $template = get_page_template_slug();
+// $template = get_page_template_slug();
$pagename = get_query_var( 'pagename' );
if ( ! $pagename && $page_id ) {
@@ -129,6 +130,10 @@ class Template_Hierarchy {
$templates[] = 'page.twig';
break;
+ case 'singular':
+ $templates = [ 'singular.twig' ];
+ break;
+
case 'category':
case 'tag':
$term = get_queried_object();
@@ -187,4 +192,4 @@ class Template_Hierarchy {
return locate_template( $templates );
}
-}
\ No newline at end of file
+} | Added singular template to hierarchy.
Fixes #3 | Rarst_meadow | train | php |
d6164952798f2e6a9170d6d2e193370c468a6782 | diff --git a/lib/linters/comment.js b/lib/linters/comment.js
index <HASH>..<HASH> 100644
--- a/lib/linters/comment.js
+++ b/lib/linters/comment.js
@@ -3,18 +3,11 @@
module.exports = {
name: 'comment',
nodeTypes: ['multilineComment'],
-
- // if we put this here, the specs don't need to copy/paste
- // the error messages. pain saver.
- // also makes it obvious where in the file the actual message is kept
- // this may fail if a linter has multiple messages, in which case we
- // can make this an object
message: 'There shouldn\'t be any multi-line comments.',
lint: function commentLinter (config, node) {
var regexp;
- // let the linter handle custom bits of its config
if (config.allowed) {
regexp = new RegExp(config.allowed);
} | Remove old comments in comment linter | lesshint_lesshint | train | js |
14429678ad06b62dd93c1d2694b78188b9b2cfd7 | diff --git a/symphony/lib/toolkit/include.install.php b/symphony/lib/toolkit/include.install.php
index <HASH>..<HASH> 100644
--- a/symphony/lib/toolkit/include.install.php
+++ b/symphony/lib/toolkit/include.install.php
@@ -658,7 +658,7 @@
}
$htaccess = '
-### Symphony 2.1.x ###
+### Symphony 2.2.x ###
Options +FollowSymlinks -Indexes
<IfModule mod_rewrite.c>
diff --git a/update.php b/update.php
index <HASH>..<HASH> 100644
--- a/update.php
+++ b/update.php
@@ -172,7 +172,7 @@
}
$htaccess = '
-### Symphony 2.0.x ###
+### Symphony 2.2.x ###
Options +FollowSymlinks -Indexes
<IfModule mod_rewrite.c> | Correcting Symphony version number to be used in .htaccess file. | symphonycms_symphony-2 | train | php,php |
69468ce39595f51dbcf58938b4ad164f8f27ec88 | diff --git a/problems/11-dist-tag-removal.js b/problems/11-dist-tag-removal.js
index <HASH>..<HASH> 100644
--- a/problems/11-dist-tag-removal.js
+++ b/problems/11-dist-tag-removal.js
@@ -26,8 +26,8 @@ Run `npm help dist-tag` to learn more about the command.
}
//exports.solution = function () {/*
-//npm dist-tags add [email protected] latest
-//npm dist-tags rm test old
+//npm dist-tag add [email protected] latest
+//npm dist-tag rm test old
//*/}.toString().split('\n').slice(1,-1).join('\n')
exports.verify = function (args, cb) {
@@ -63,7 +63,7 @@ exports.verify = function (args, cb) {
console.log('Oops! Your "latest" tag still points at the most recent\n' +
'release, %s.\n' +
'Point that somewhere else, and re-run `how-to-npm verify`\n'+
- 'Use `npm help dist-tags` to learn more about how to do it.',
+ 'Use `npm help dist-tag` to learn more about how to do it.',
mostRecentVersion)
return cb(false)
} | remove typo in dist-tag suggestion | workshopper_how-to-npm | train | js |
72b05dba6de7f0dc65c030ea3a8ddbbdf0e9fe50 | diff --git a/Db.php b/Db.php
index <HASH>..<HASH> 100644
--- a/Db.php
+++ b/Db.php
@@ -111,7 +111,8 @@ class Db extends DbOps
if ($hard) {
$sql = '>DELETE FROM ' . $table . ' WHERE `id` =';
} else {
- $sql = '>UPDATE ' . $table . ' SET `delete_date` = NOW() WHERE `id` =';
+ $deleteDate = (self::$_env->get('casing') == 'snake' ? 'delete_date' : 'deleteDate');
+ $sql = '>UPDATE ' . $table . ' SET `' . $deleteDate . '` = NOW() WHERE `id` =';
}
if (self::$_env->get('assumes_uuid')) {
$sql .= 'UNHEX({{id}})'; | Add camel-casing to delete function | sroehrl_neoan3-db | train | php |
cd1a73dde65229cbc236f07a913baf66f0b3d1fb | diff --git a/features/support/env.js b/features/support/env.js
index <HASH>..<HASH> 100644
--- a/features/support/env.js
+++ b/features/support/env.js
@@ -31,7 +31,7 @@ module.exports = function () {
this.DEFAULT_ENVIRONMENT = Object.assign({STXXLCFG: stxxl_config}, process.env);
this.DEFAULT_PROFILE = 'bicycle';
this.DEFAULT_INPUT_FORMAT = 'osm';
- this.DEFAULT_LOAD_METHOD = this.PLATFORM_WINDOWS ? 'directly' : 'datastore';
+ this.DEFAULT_LOAD_METHOD = 'datastore';
this.DEFAULT_ORIGIN = [1,1];
this.OSM_USER = 'osrm';
this.OSM_GENERATOR = 'osrm-test'; | revert 'directly' method on win<I> | Project-OSRM_osrm-backend | train | js |
446cc1c1f4356cfe9dfa2e49f039e4ec6077db1b | diff --git a/presto-main/src/test/java/com/facebook/presto/spiller/TestGenericPartitioningSpiller.java b/presto-main/src/test/java/com/facebook/presto/spiller/TestGenericPartitioningSpiller.java
index <HASH>..<HASH> 100644
--- a/presto-main/src/test/java/com/facebook/presto/spiller/TestGenericPartitioningSpiller.java
+++ b/presto-main/src/test/java/com/facebook/presto/spiller/TestGenericPartitioningSpiller.java
@@ -74,6 +74,7 @@ public class TestGenericPartitioningSpiller
FeaturesConfig featuresConfig = new FeaturesConfig();
featuresConfig.setSpillerSpillPaths(tempDirectory.toString());
featuresConfig.setSpillerThreads(8);
+ featuresConfig.setSpillMaxUsedSpaceThreshold(1.0);
singleStreamSpillerFactory = new FileSingleStreamSpillerFactory(blockEncodingSerde, new SpillerStats(), featuresConfig);
factory = new GenericPartitioningSpillerFactory(singleStreamSpillerFactory);
} | Allow spill tests to run when disk space is low | prestodb_presto | train | java |
e70690ba301330b0a769d2e8bbc0a1c2dc419290 | diff --git a/Tests/Functional/Service/HistoryManagerTest.php b/Tests/Functional/Service/HistoryManagerTest.php
index <HASH>..<HASH> 100644
--- a/Tests/Functional/Service/HistoryManagerTest.php
+++ b/Tests/Functional/Service/HistoryManagerTest.php
@@ -15,6 +15,7 @@ use ONGR\ElasticsearchBundle\Test\AbstractElasticsearchTestCase;
use ONGR\TranslationsBundle\Document\History;
use ONGR\TranslationsBundle\Document\Message;
use ONGR\TranslationsBundle\Service\HistoryManager;
+use Symfony\Component\HttpFoundation\Request;
class HistoryManagerTest extends AbstractElasticsearchTestCase
{
@@ -104,4 +105,12 @@ class HistoryManagerTest extends AbstractElasticsearchTestCase
$this->getManager()->commit();
$this->assertEquals(3, count($this->manager->get($translation)['en']));
}
+
+ public function testAddHistoryProcess()
+ {
+ $request = new Request([], [], [], [], [], [], json_encode(['messages' => ['en' => 'something']]));
+ $translationManager = $this->getContainer()->get('ongr_translations.translation_manager');
+ $translationManager->update('foo', $request);
+ $this->assertEquals(3, count($this->manager->get($translationManager->get('foo'))['en']));
+ }
} | wrote a test for message addition to history | ongr-io_TranslationsBundle | train | php |
397771363c45feffea44768e8eb9ae2b93b44d50 | diff --git a/test.py b/test.py
index <HASH>..<HASH> 100644
--- a/test.py
+++ b/test.py
@@ -38,7 +38,7 @@ class TestKafka(unittest.TestCase):
Test that no errors are thrown, and it doesn't hang when you send a message
"""
producer = HerokuKafkaProducer(**kafka_params)
- #producer.send(TOPIC1, b"some message")
+ producer.send(TOPIC1, b"some message")
producer.flush() # Force event send
producer.close() | Removed comment on producer.send | HubbleHQ_heroku-kafka | train | py |
6bbfd2b535727fbf9b09afd51f171c6b57dc109c | diff --git a/tasks/build.gulp.js b/tasks/build.gulp.js
index <HASH>..<HASH> 100644
--- a/tasks/build.gulp.js
+++ b/tasks/build.gulp.js
@@ -36,7 +36,7 @@ module.exports = function (gulp) {
projectRoot = process.cwd();
gulp.task('inject', function (callback) {
- sequence('inject-bower', 'inject-styles', 'inject-partials', 'modernizr', 'inject-js', callback);
+ sequence('config', 'inject-bower', 'inject-styles', 'inject-partials', 'modernizr', 'inject-js', callback);
});
gulp.task('inject-bower', ['bower-download'], function () {
@@ -133,7 +133,7 @@ module.exports = function (gulp) {
.pipe(size());
});
- gulp.task('build', ['config', 'version', 'inject', 'images', 'fonts', 'resources', 'lib', 'lint-js'], function (callback) {
+ gulp.task('build', ['version', 'inject', 'images', 'fonts', 'resources', 'lib', 'lint-js'], function (callback) {
callback();
}); | Moving config task to inject task, to run it in same sequence as other tasks that use inject | Nykredit_gript | train | js |
308c948552fa091ff97c5d97a965a7740fc4d4f3 | diff --git a/Repository/ResourceQueryBuilder.php b/Repository/ResourceQueryBuilder.php
index <HASH>..<HASH> 100644
--- a/Repository/ResourceQueryBuilder.php
+++ b/Repository/ResourceQueryBuilder.php
@@ -162,7 +162,7 @@ class ResourceQueryBuilder
$eol = PHP_EOL;
$clause = "{$eol}({$eol}";
- for ($i = 0; $i < $count; ++$i) {
+ foreach ($roles as $i => $role) {
$role = $roles[$i] instanceof RoleInterface ? $roles[$i]->getRole() : $roles[$i];
$clause .= $i > 0 ? ' OR ' : ' ';
$clause .= "rightRole.name = :role_{$i}{$eol}"; | [CoreBundle] Fixing the whereRoleIn method. | claroline_Distribution | train | php |
379bc38c1b08b727a2709634140f9d73ade21fca | diff --git a/tests/EasyDBTest.php b/tests/EasyDBTest.php
index <HASH>..<HASH> 100644
--- a/tests/EasyDBTest.php
+++ b/tests/EasyDBTest.php
@@ -39,6 +39,8 @@ abstract class EasyDBTest
*/
public function GoodFactoryCreateArgumentProvider()
{
+ switch (getenv('DB')) {
+ case false:
return [
[
'sqlite::memory:',
@@ -48,6 +50,13 @@ abstract class EasyDBTest
'sqlite'
],
];
+ break;
+ }
+ $this->markTestIncomplete(
+ 'Could not determine appropriate arguments for ' .
+ Factory::class .
+ '::create() from getenv()'
+ );
}
/** | mark test as incomplete if we cannot determine appropriate arguments for ParagonIE\EasyDB\Factory::create() via getenv() | paragonie_easydb | train | php |
6095e776ea579bb3ef8c9aa38ec9802fb22d3d44 | diff --git a/tests/ProxyManagerTest/Functional/FatalPreventionFunctionalTest.php b/tests/ProxyManagerTest/Functional/FatalPreventionFunctionalTest.php
index <HASH>..<HASH> 100644
--- a/tests/ProxyManagerTest/Functional/FatalPreventionFunctionalTest.php
+++ b/tests/ProxyManagerTest/Functional/FatalPreventionFunctionalTest.php
@@ -48,8 +48,9 @@ echo 'SUCCESS: ' . %s;
PHP;
/**
- * Verifies that proxies generated from different factories will retain their specific implementation
- * and won't conflict
+ * Verifies that lazy loading ghost will work with all given classes
+ *
+ * @param string $className a valid (existing/autoloadable) class name
*
* @dataProvider getTestedClasses
*/ | Minor docblock fixes/clarifications | Ocramius_ProxyManager | train | php |
f4d99fb5a5765b1895c2654081e92fc267021e2f | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -12,6 +12,8 @@ on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
year = datetime.datetime.now().strftime("%Y")
+sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir))
+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.testapp.settings")
django.setup() | Add git root to python path for read the docs | Thermondo_viewflow-extensions | train | py |
e8f6a2a92f8525f1ab44307d84f4340bd73350ba | diff --git a/malcolm/modules/builtin/controllers/managercontroller.py b/malcolm/modules/builtin/controllers/managercontroller.py
index <HASH>..<HASH> 100644
--- a/malcolm/modules/builtin/controllers/managercontroller.py
+++ b/malcolm/modules/builtin/controllers/managercontroller.py
@@ -468,11 +468,12 @@ class ManagerController(StatefulController):
names.sort()
if os.path.isdir(self.template_designs):
for f in sorted(os.listdir(self.template_designs)):
- assert f.startswith("template_"), \
- "Template design %s/%s should start with 'template_'" % (
- self.template_designs, f)
- if f not in names:
- names.append(f)
+ assert f.startswith("template_") and f.endswith(".json"), \
+ "Template design %s/%s should start with 'template_' " \
+ "and end with .json" % (self.template_designs, f)
+ t_name = f.split(".json")[0]
+ if t_name not in names:
+ names.append(t_name)
self.design.meta.set_choices(names)
def _validated_config_filename(self, name): | Don't put .json in template design names | dls-controls_pymalcolm | train | py |
778d42044738a29c40d9e9c717847548b1f8686b | diff --git a/widgets/map/src/main/javascript/map.js b/widgets/map/src/main/javascript/map.js
index <HASH>..<HASH> 100644
--- a/widgets/map/src/main/javascript/map.js
+++ b/widgets/map/src/main/javascript/map.js
@@ -232,6 +232,10 @@ $(function () {
colorScale = d3.scale.linear().domain([min, max]).range(['#FFFF00', '#FF0000']);
}
+ //change multiple for radius formula based on range of data
+ var maxCount = maxValue(data, sizeByField);
+ var multiple = 17/log10(maxCount);
+
_.each(data, function (element) {
var point = new OpenLayers.Geometry.Point(element[lonField], element[latField]);
point.transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913"));
@@ -240,7 +244,7 @@ $(function () {
//possible values for radius are 3-20, this formula ensures that all radii are in that range
var radius = 3;
if(element[sizeByField] > 1) {
- radius = (2.54*log10(element[sizeByField])) + 3;
+ radius = (multiple*log10(element[sizeByField])) + 3;
}
//if colorby is utilized, change default color | NEON-<I> points layer is now sized based on range of data | NextCenturyCorporation_neon | train | js |
53de5541e585c13a25f42b9c4d88030c4405346e | diff --git a/src/input/input.js b/src/input/input.js
index <HASH>..<HASH> 100644
--- a/src/input/input.js
+++ b/src/input/input.js
@@ -524,6 +524,7 @@
'RIGHT' : 39,
'DOWN' : 40,
'ENTER' : 13,
+ 'TAB' : 9,
'SHIFT' : 16,
'CTRL' : 17,
'ALT' : 18, | added in tab key to the input bindings | melonjs_melonJS | train | js |
e5e4e17c4c33cca72c560e7f133a946dbc07d647 | diff --git a/lib/eventhub/heartbeat.rb b/lib/eventhub/heartbeat.rb
index <HASH>..<HASH> 100644
--- a/lib/eventhub/heartbeat.rb
+++ b/lib/eventhub/heartbeat.rb
@@ -36,7 +36,7 @@ module EventHub
heartbeat_cycle_in_ms: processor.heartbeat_cycle_in_s * 1000,
served_queues: [processor.listener_queues],
host: Socket.gethostname,
- ip_addresses: ip_addresses,
+ addresses: addresses,
messages: {
total: statistics.messages_total,
successful: statistics.messages_successful,
@@ -51,7 +51,7 @@ module EventHub
private
- def ip_addresses
+ def addresses
interfaces = Socket.getifaddrs.select do |interface|
!interface.addr.ipv4_loopback? && !interface.addr.ipv6_loopback?
end | fix: "ip_adresses" has to be "addresses" | thomis_eventhub-processor | train | rb |
53a16e1795a21fe3437456e89b3e827466e93bab | diff --git a/test/router.test.js b/test/router.test.js
index <HASH>..<HASH> 100644
--- a/test/router.test.js
+++ b/test/router.test.js
@@ -240,5 +240,6 @@ module.exports = {
app.match.get('/user/5/edit').should.have.length(2);
app.match.get('/').should.have.be.empty;
app.match.all('/user/123').should.have.length(3);
+ app.match('/user/123').should.have.length(3);
}
}; | Added app.match() as app.match.all() | expressjs_express | train | js |
e5fc2a16bf38cd493fc9ec8bd12cd0aa70bd823e | diff --git a/lib/hanami/router.rb b/lib/hanami/router.rb
index <HASH>..<HASH> 100644
--- a/lib/hanami/router.rb
+++ b/lib/hanami/router.rb
@@ -803,7 +803,9 @@ module Hanami
if inspect?
@inspector.add_route(
- Route.new(http_method: http_method, path: path, to: to, as: as, constraints: constraints, blk: blk)
+ Route.new(
+ http_method: http_method, path: path, to: to || endpoint, as: as, constraints: constraints, blk: blk
+ )
)
end
end
diff --git a/spec/unit/hanami/router/routing.rb b/spec/unit/hanami/router/routing.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/hanami/router/routing.rb
+++ b/spec/unit/hanami/router/routing.rb
@@ -14,5 +14,17 @@ RSpec.describe Hanami::Router do
expect(router.inspector.call).to include("home#index")
end
+
+ it "uses resolved block value to generate the route" do
+ inspector = Hanami::Router::Inspector.new
+
+ router = Hanami::Router.new(inspector: inspector) do
+ get "/" do
+ "Block"
+ end
+ end
+
+ expect(router.inspector.call).to include("(block)")
+ end
end
end | Fix block not given to the route when no `to` option (#<I>) | hanami_router | train | rb,rb |
1acd179d1355a4fa91a7d06d2d6547fb8a620f6a | diff --git a/actions/class.TestImport.php b/actions/class.TestImport.php
index <HASH>..<HASH> 100755
--- a/actions/class.TestImport.php
+++ b/actions/class.TestImport.php
@@ -36,7 +36,7 @@ class taoTests_actions_TestImport extends tao_actions_Import
* overwrite the parent index to add the requiresRight for Tests
*
* @requiresRight id WRITE
- * @see tao_actions_Import::index()
+ * @requiresRight classUri WRITE
*/
public function index()
{
diff --git a/actions/class.Tests.php b/actions/class.Tests.php
index <HASH>..<HASH> 100755
--- a/actions/class.Tests.php
+++ b/actions/class.Tests.php
@@ -215,15 +215,6 @@ class taoTests_actions_Tests extends tao_actions_SaSModule
/**
* overwrite the parent moveAllInstances to add the requiresRight only in Items
- * @see tao_actions_TaoModule::moveResource()
- * @requiresRight classUri WRITE
- */
- public function moveResource()
- {
- return parent::moveResource();
- }
- /**
- * overwrite the parent moveAllInstances to add the requiresRight only in Items
* @see tao_actions_TaoModule::moveAll()
* @requiresRight ids WRITE
*/ | fix: fix permissions to view buttons | oat-sa_extension-tao-test | train | php,php |
1c2414e526844a7196b75bec5f71d76c02eceecc | diff --git a/lib/codemirror.js b/lib/codemirror.js
index <HASH>..<HASH> 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -243,11 +243,15 @@ var CodeMirror = (function() {
},
getTokenAt: function(mode, state, ch) {
var txt = this.text, stream = new StringStream(txt);
- while (stream.pos <= ch && !stream.eol()) {
+ while (stream.pos < ch && !stream.eol()) {
stream.start = stream.pos;
var style = mode.token(stream, state);
}
- return {start: stream.start, end: stream.pos, string: stream.current(), className: style || null};
+ return {start: stream.start,
+ end: stream.pos,
+ string: stream.current(),
+ className: style || null,
+ state: state};
},
indentation: function() {return countIndentation(this.text);},
getHTML: function(sfrom, sto, includePre) { | revise getTokenAt to return token *before* the given pos
it now also returns the parser state at that position | codemirror_CodeMirror | train | js |
deeb58644a8c10375ef74c1263af3902ccc1e417 | diff --git a/lib/Predis/Protocols/Text/TextProtocol.php b/lib/Predis/Protocols/Text/TextProtocol.php
index <HASH>..<HASH> 100644
--- a/lib/Predis/Protocols/Text/TextProtocol.php
+++ b/lib/Predis/Protocols/Text/TextProtocol.php
@@ -79,11 +79,10 @@ class TextProtocol implements IProtocolProcessor {
return (int) $payload;
case '-': // error
- $errorMessage = substr($payload, 4);
if ($this->_throwErrors) {
- throw new ServerException($errorMessage);
+ throw new ServerException($payload);
}
- return new ResponseError($errorMessage);
+ return new ResponseError($payload);
default:
Helpers::onCommunicationException(new ProtocolException( | Fix missing change that should have been part of commit cc<I>c. | imcj_predis | train | php |
988eda3155ee89bf94ea330c7b6a03ce3810164f | diff --git a/server/src/test/java/org/cloudfoundry/identity/uaa/web/CookieBasedCsrfTokenRepositoryTests.java b/server/src/test/java/org/cloudfoundry/identity/uaa/web/CookieBasedCsrfTokenRepositoryTests.java
index <HASH>..<HASH> 100644
--- a/server/src/test/java/org/cloudfoundry/identity/uaa/web/CookieBasedCsrfTokenRepositoryTests.java
+++ b/server/src/test/java/org/cloudfoundry/identity/uaa/web/CookieBasedCsrfTokenRepositoryTests.java
@@ -138,6 +138,7 @@ public class CookieBasedCsrfTokenRepositoryTests {
CookieBasedCsrfTokenRepository repo = new CookieBasedCsrfTokenRepository();
repo.setSecure(isSecure);
MockHttpServletRequest request = new MockHttpServletRequest();
+ request.setProtocol("http");
MockHttpServletResponse response = new MockHttpServletResponse();
CsrfToken token = repo.generateToken(request);
repo.saveToken(token, request, response); | refactor: make protocol default explicit | cloudfoundry_uaa | train | java |
b208ee9d675f9bfaeb0612ff9113f5f1d20cf07e | diff --git a/aeron-cluster/src/main/java/io/aeron/cluster/ClusterTool.java b/aeron-cluster/src/main/java/io/aeron/cluster/ClusterTool.java
index <HASH>..<HASH> 100644
--- a/aeron-cluster/src/main/java/io/aeron/cluster/ClusterTool.java
+++ b/aeron-cluster/src/main/java/io/aeron/cluster/ClusterTool.java
@@ -71,7 +71,14 @@ import static org.agrona.SystemUtil.getDurationInNanos;
*/
public class ClusterTool
{
+ /**
+ * Timeout in nanoseconds for the tool to wait while trying to perform an operation.
+ */
public static final String AERON_CLUSTER_TOOL_TIMEOUT_PROP_NAME = "aeron.cluster.tool.timeout";
+
+ /**
+ * Delay in nanoseconds to be applied to an operation such as when the new cluster backup query will occur.
+ */
public static final String AERON_CLUSTER_TOOL_DELAY_PROP_NAME = "aeron.cluster.tool.delay";
private static final long TIMEOUT_MS = | [Java] Javadoc for ClusterTool. | real-logic_aeron | train | java |
d93960c0caa13494355830007222adfe2feade92 | diff --git a/weld/src/main/java/org/jboss/as/weld/deployment/processors/WeldPortableExtensionProcessor.java b/weld/src/main/java/org/jboss/as/weld/deployment/processors/WeldPortableExtensionProcessor.java
index <HASH>..<HASH> 100644
--- a/weld/src/main/java/org/jboss/as/weld/deployment/processors/WeldPortableExtensionProcessor.java
+++ b/weld/src/main/java/org/jboss/as/weld/deployment/processors/WeldPortableExtensionProcessor.java
@@ -121,6 +121,8 @@ public class WeldPortableExtensionProcessor implements DeploymentUnitProcessor {
throw WeldMessages.MESSAGES.extensionDoesNotImplementExtension(serviceClassName, e);
} catch (Exception e) {
WeldLogger.DEPLOYMENT_LOGGER.couldNotLoadPortableExceptionClass(serviceClassName, e);
+ } catch (LinkageError e) {
+ WeldLogger.DEPLOYMENT_LOGGER.couldNotLoadPortableExceptionClass(serviceClassName, e);
}
return null;
} | WFLY-<I> Portable extensions that fail to load will prevent a deployment from completing | wildfly_wildfly | train | java |
ba480681387b4313e6e04458cecbaae4ea669282 | diff --git a/hey.go b/hey.go
index <HASH>..<HASH> 100644
--- a/hey.go
+++ b/hey.go
@@ -19,6 +19,7 @@ import (
"flag"
"fmt"
"io/ioutil"
+ "math"
"net/http"
gourl "net/url"
"os"
@@ -26,10 +27,9 @@ import (
"regexp"
"runtime"
"strings"
+ "time"
"github.com/rakyll/hey/requester"
- "math"
- "time"
)
const ( | Reorganize the imports in hey.go to be more go-style compliant (#<I>) | rakyll_hey | train | go |
b4e45e3d38e9e4ec721783e81280609e6dafdd3b | diff --git a/GiftedFormManager.js b/GiftedFormManager.js
index <HASH>..<HASH> 100644
--- a/GiftedFormManager.js
+++ b/GiftedFormManager.js
@@ -51,6 +51,13 @@ function doValidateOne(k = '', value = undefined, validators = {}) {
}
}
+ // Validator ONLY accepts string arguments.
+ if (clonedArgs[0] === null || clonedArgs[0] === undefined) {
+ clonedArgs[0] = '';
+ } else {
+ clonedArgs[0] = String(clonedArgs[0]);
+ }
+
isValid = validatorjs[validate[i].validator].apply(null, clonedArgs);
result.push({ | Make sure arguments to validator are ALWAYS strings
Fixes #<I>. | FaridSafi_react-native-gifted-form | train | js |
8e9a3ab12a78c518fac6dd917878fc3fc4f55b2a | diff --git a/lib/danger/commands/init.rb b/lib/danger/commands/init.rb
index <HASH>..<HASH> 100644
--- a/lib/danger/commands/init.rb
+++ b/lib/danger/commands/init.rb
@@ -93,7 +93,7 @@ module Danger
ui.pause 1
if considered_an_oss_repo?
- ui.say "#{@bot_name} does not need privilidged access to your repo or org. This is because Danger will only"
+ ui.say "#{@bot_name} does not need privileged access to your repo or org. This is because Danger will only"
ui.say "be writing comments, and you do not need special access for that."
else
ui.say "#{@bot_name} will need access to your repo. Simply because the code is not available for the public" | Fixes typo in init.rb #trivial (#<I>)
`s/privilidged/privileged/` | danger_danger | train | rb |
2a3f475ff5abb510e9abe1af31a5a83b2066d86f | diff --git a/bridge/whatsapp/whatsapp.go b/bridge/whatsapp/whatsapp.go
index <HASH>..<HASH> 100644
--- a/bridge/whatsapp/whatsapp.go
+++ b/bridge/whatsapp/whatsapp.go
@@ -293,7 +293,11 @@ func (b *Bwhatsapp) Send(msg config.Message) (string, error) {
if msg.ID != "" {
b.Log.Debugf("updating message with id %s", msg.ID)
- msg.Text += " (edited)"
+ if b.GetString("editsuffix") != "" {
+ msg.Text += b.GetString("EditSuffix")
+ } else {
+ msg.Text += " (edited)"
+ }
}
// Handle Upload a file | Make EditSuffix option actually work (whatsapp). Fixes #<I> (#<I>)
To keep it backwards compatible we keep the "(edited)" message when no
editsuffix is configured. | 42wim_matterbridge | train | go |
fd710a4d97ea227edd998948e97895163aed7a5b | diff --git a/core-bundle/contao/dca/tl_style.php b/core-bundle/contao/dca/tl_style.php
index <HASH>..<HASH> 100644
--- a/core-bundle/contao/dca/tl_style.php
+++ b/core-bundle/contao/dca/tl_style.php
@@ -53,8 +53,7 @@ $GLOBALS['TL_DCA']['tl_style'] = array
'keys' => array
(
'id' => 'primary',
- 'pid' => 'index',
- 'selector' => 'index'
+ 'pid' => 'index'
)
)
), | [Core] Remove the index from the `tl_style.selector` field (see #<I>) | contao_contao | train | php |
9cc9b3767645e35f92efbb6b2b36b6223901e09a | diff --git a/fundamentals/__version__.py b/fundamentals/__version__.py
index <HASH>..<HASH> 100644
--- a/fundamentals/__version__.py
+++ b/fundamentals/__version__.py
@@ -1 +1 @@
-__version__ = '1.6.2'
+__version__ = '1.6.3' | small update to hidden yaml warnings | thespacedoctor_fundamentals | train | py |
92b3a4f8f4d9f75ba5c384aa6961af2152ccb72b | diff --git a/discord/client.py b/discord/client.py
index <HASH>..<HASH> 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -165,7 +165,7 @@ class Client:
- All member related events will be disabled.
- :func:`on_member_update`
- :func:`on_member_join`
- - :func:`on_member_leave`
+ - :func:`on_member_remove`
- Typing events will be disabled (:func:`on_typing_start`).
- If ``fetch_offline_members`` is set to ``False`` then the user cache will not exist. | on_member_leave => on_member_remove | Rapptz_discord.py | train | py |
9908b4d23fc158bd879abbb19068c155705ead01 | diff --git a/views/js/runner/proxy/qtiServiceProxy.js b/views/js/runner/proxy/qtiServiceProxy.js
index <HASH>..<HASH> 100644
--- a/views/js/runner/proxy/qtiServiceProxy.js
+++ b/views/js/runner/proxy/qtiServiceProxy.js
@@ -43,21 +43,17 @@ define([
data: params,
async: true,
dataType: 'json'
- }).then(
- // success
- function(data) {
- if (data && data.success) {
- resolve(data);
- } else {
- reject(false);
- }
- },
-
- // error
- function(jqXHR) {
- reject(jqXHR);
+ })
+ .done(function(data) {
+ if (data && data.success) {
+ resolve(data);
+ } else {
+ reject(false);
}
- );
+ })
+ .fail(function(jqXHR) {
+ reject(jqXHR);
+ });
});
} | TestRunner: use done/fail instead of then while using jQuery Deffered | oat-sa_extension-tao-testqti | train | js |
a3f85ab606502297177844a5d8a4a7e43e7a6ef2 | diff --git a/synapse/cores/lmdb.py b/synapse/cores/lmdb.py
index <HASH>..<HASH> 100644
--- a/synapse/cores/lmdb.py
+++ b/synapse/cores/lmdb.py
@@ -20,6 +20,7 @@ import synapse.lib.threads as s_threads
import lmdb
import xxhash
+import msgpack
logger = logging.getLogger(__name__)
@@ -121,7 +122,7 @@ def _encIden(iden):
# Try to memoize most of the prop names we get
@s_compat.lru_cache(maxsize=1024)
def _encProp(prop):
- return s_common.msgenpack(prop)
+ return msgpack.dumps(prop, encoding='utf-8')
# The precompiled struct parser for native size_t
_SIZET_ST = struct.Struct('@Q' if sys.maxsize > 2**32 else '@L') | Change how lmdb does propEnc encoding - drops the use of use_bin_type (which we do in msgenpack). This provides a consistent encoding for prop values across unicode/str types in python 2. Does not appear to have impact on existing cores for Python3. | vertexproject_synapse | train | py |
43098c505e77db8cbba63311eec80b40ed7b34d0 | diff --git a/nupic/algorithms/anomaly_likelihood.py b/nupic/algorithms/anomaly_likelihood.py
index <HASH>..<HASH> 100644
--- a/nupic/algorithms/anomaly_likelihood.py
+++ b/nupic/algorithms/anomaly_likelihood.py
@@ -152,6 +152,12 @@ class AnomalyLikelihood(object):
def _calcSkipRecords(numIngested, windowSize, learningPeriod):
"""Return the value of skipRecords for passing to estimateAnomalyLikelihoods
+ If `windowSize` is very large (bigger than the amount of data) then this
+ could just return `learningPeriod`. But when some values have fallen out of
+ the historical sliding window of anomaly records, then we have to take those
+ into account as well so we return the `learningPeriod` minus the number
+ shifted out.
+
:param int numIngested: number of data points that have been added to the
sliding window of historical data points.
:param int windowSize: size of sliding window of historical data points. | Updated docstring in AnomalyLikelihood._calcSkipRecords() per Scott's code review feedback. | numenta_nupic | train | py |
84bb1cba26c58a322c40886d4f3e57444d4d5a29 | diff --git a/pkg/minikube/constants/constants.go b/pkg/minikube/constants/constants.go
index <HASH>..<HASH> 100644
--- a/pkg/minikube/constants/constants.go
+++ b/pkg/minikube/constants/constants.go
@@ -54,6 +54,8 @@ var SupportedVMDrivers = [...]string{
"kvm",
"xhyve",
"hyperv",
+ "hyperkit",
+ "kvm2",
}
var DefaultMinipath = filepath.Join(homedir.HomeDir(), ".minikube") | config: make hyperkit and kvm2 available as supported drivers | kubernetes_minikube | train | go |
9c16fe6f3c80c8fec1d24223e7b0cfd408b69957 | diff --git a/flake8_mypy.py b/flake8_mypy.py
index <HASH>..<HASH> 100644
--- a/flake8_mypy.py
+++ b/flake8_mypy.py
@@ -184,14 +184,22 @@ class MypyChecker:
# unexpected clashes with other .py and .pyi files in the same original
# directory.
with TemporaryDirectory(prefix='flake8mypy_') as d:
- with NamedTemporaryFile(
- 'w', encoding='utf8', prefix='tmpmypy_', suffix='.py', dir=d
- ) as f:
- self.filename = f.name
+ file = NamedTemporaryFile(
+ 'w',
+ encoding='utf8',
+ prefix='tmpmypy_',
+ suffix='.py',
+ dir=d,
+ delete=False,
+ )
+ try:
+ self.filename = file.name
for line in self.lines:
- f.write(line)
- f.flush()
+ file.write(line)
+ file.close()
yield from self._run()
+ finally:
+ os.remove(file.name)
def _run(self) -> Iterator[_Flake8Error]:
mypy_cmdline = self.build_mypy_cmdline(self.filename, self.options.mypy_config) | Make temp file creation Windows compatible
On Windows the temp file must be closed, otherwise mypy can't open it again.
Unfortunately, we then loose the nice to read `with` sugar and obviously
must call `os.remove` manually. | ambv_flake8-mypy | train | py |
2b3f064deae59b3409409bac4a4cbefbdabf0f66 | diff --git a/agent/features/support/hooks.rb b/agent/features/support/hooks.rb
index <HASH>..<HASH> 100644
--- a/agent/features/support/hooks.rb
+++ b/agent/features/support/hooks.rb
@@ -27,3 +27,7 @@ Before("@stderr") do
@stderr = StringIO.new
eval("$stderr = @stderr")
end
+
+After("@stdout") do
+ eval("$stdout = REAL_STDOUT")
+end | not sure if we need these hooks | chetan_bixby-agent | train | rb |
70a94848065d52175b62706b840cb43e748a1a76 | diff --git a/godet.go b/godet.go
index <HASH>..<HASH> 100644
--- a/godet.go
+++ b/godet.go
@@ -246,13 +246,22 @@ func (remote *RemoteDebugger) socket() (ws *websocket.Conn) {
}
// Close the RemoteDebugger connection.
-func (remote *RemoteDebugger) Close() error {
- close(remote.closed)
- err := remote.ws.Close()
+func (remote *RemoteDebugger) Close() (err error) {
+ remote.Lock()
+ ws := remote.ws
+ remote.ws = nil
+ remote.Unlock()
+
+ if ws != nil { // already closed
+ close(remote.closed)
+ err = ws.Close()
+ }
+
if remote.verbose {
httpclient.StopLogging()
}
- return err
+
+ return
}
type wsMessage struct { | Tweaking Close() so that it support multiple closes | raff_godet | train | go |
8dc481a4fb013d7074df2206fb049cf00c3be12e | diff --git a/classes/Divergence/Controllers/RequestHandler.php b/classes/Divergence/Controllers/RequestHandler.php
index <HASH>..<HASH> 100644
--- a/classes/Divergence/Controllers/RequestHandler.php
+++ b/classes/Divergence/Controllers/RequestHandler.php
@@ -14,6 +14,8 @@ abstract class RequestHandler
protected static $_path;
protected static $_parameters;
protected static $_options = array();
+
+ public static $pathStack;
public static $templateDirectory;
@@ -22,13 +24,13 @@ abstract class RequestHandler
protected static function setPath($path = null)
{
- if(!Site::$pathStack)
+ if(!static::$pathStack)
{
$requestURI = parse_url($_SERVER['REQUEST_URI']);
- Site::$pathStack = Site::$requestPath = explode('/', ltrim($requestURI['path'], '/'));
+ static::$pathStack = static::$requestPath = explode('/', ltrim($requestURI['path'], '/'));
}
- static::$_path = isset($path) ? $path : Site::$pathStack;
+ static::$_path = isset($path) ? $path : static::$pathStack;
}
protected static function setOptions($options) | Set $pathStack storage to RequestHandler instead of the no longer existant Site class | Divergence_framework | train | php |
c807f73640b8d7ddb6f6cee2c74973741cfd39a4 | diff --git a/lib/discordrb/data.rb b/lib/discordrb/data.rb
index <HASH>..<HASH> 100644
--- a/lib/discordrb/data.rb
+++ b/lib/discordrb/data.rb
@@ -1280,7 +1280,7 @@ module Discordrb
@bitrate = data['bitrate']
@user_limit = data['user_limit']
@position = data['position']
- @nsfw = data['nsfw']
+ @nsfw = data['nsfw'] || false
if private?
@recipients = [] | default Channel#nsfw to false on initialization
This is an optional field that may or may not be present. Particularly
in GUILD_CREATE events for older guilds, it may be absent, and so channels
would have a `nil` nsfw property. Since it could not have been set to
`true`, we can default this to `false`. | meew0_discordrb | train | rb |
65d7ffa74f6c7c814d28bcdede0a0ac56a29f109 | diff --git a/framework/yii/web/View.php b/framework/yii/web/View.php
index <HASH>..<HASH> 100644
--- a/framework/yii/web/View.php
+++ b/framework/yii/web/View.php
@@ -15,6 +15,7 @@ use yii\web\AssetBundle;
use yii\widgets\Block;
use yii\widgets\ContentDecorator;
use yii\widgets\FragmentCache;
+use yii\base\InvalidConfigException;
/**
* View represents a view object in the MVC pattern. | Fixed View refactoring test breakage | yiisoft_yii2-debug | train | php |
26179ff2e4208d7e981679dcac55822027634b17 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -23,7 +23,7 @@ setup_args = dict(
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Scientific/Engineering :: Bio-Informatics',
],
- packages=['biofrills'],
+ packages=['biofrills', 'biofrills.stats'],
#scripts=glob(join(DIR, 'scripts', '*'))
) | setup.py: include biofrills.stats sub-package | etal_biofrills | train | py |
f0781afdad9da6ed34ebf55e1808d03b1cbeb6f6 | diff --git a/support/tail.js b/support/tail.js
index <HASH>..<HASH> 100644
--- a/support/tail.js
+++ b/support/tail.js
@@ -70,7 +70,6 @@ window.mocha = require('mocha');
;(function(){
var suite = new mocha.Suite('', new mocha.Context)
, utils = mocha.utils
- , Reporter = mocha.reporters.HTML
$(function(){
$('code').each(function(){
@@ -124,9 +123,10 @@ window.mocha = require('mocha');
* Run mocha, returning the Runner.
*/
- mocha.run = function(){
+ mocha.run = function(Reporter){
suite.emit('run');
var runner = new mocha.Runner(suite);
+ Reporter = Reporter || mocha.reporters.HTML;
var reporter = new Reporter(runner);
var query = parse(window.location.search || "");
if (query.grep) runner.grep(new RegExp(query.grep)); | Added reporter to `mocha.run()` as argument | mochajs_mocha | train | js |
966f80ad2f18e1ea700e53ac00c0f6e2c6b84332 | diff --git a/lib/CORL/machine/physical.rb b/lib/CORL/machine/physical.rb
index <HASH>..<HASH> 100644
--- a/lib/CORL/machine/physical.rb
+++ b/lib/CORL/machine/physical.rb
@@ -34,7 +34,7 @@ class Physical < CORL.plugin_class(:machine)
#---
def hostname
- fact(:hostname)
+ fact(:fqdn)
end
#--- | Updating the physical machine provider to use the fqdn fact instead of hostname since it is more complete. | coralnexus_corl | train | rb |
b7ec30c25c169de7a567507884399b1b7027555a | diff --git a/vagrant.py b/vagrant.py
index <HASH>..<HASH> 100644
--- a/vagrant.py
+++ b/vagrant.py
@@ -29,6 +29,7 @@ Dependencies:
'''
import os
+import re
import subprocess
import sys
@@ -172,12 +173,15 @@ class Vagrant(object):
output = self._run_vagrant_command('status', vm_name)
# sys.stderr.write('status {}: {}\n'.format(vm_name, output))
statuses = {}
- state = 1 # parsing state variable.
- # The format of output is expected to be a "Current VM states:" line
+ # The format of output is expected to be a
+ # - "Current VM states:" line (vagrant 1)
+ # - "Current machine states" line (vagrant 1.1)
# followed by a blank line, followed by one or more status lines,
# followed by a blank line.
+ state = 1
for line in output.splitlines():
- if state == 1 and line.strip().startswith('Current VM states:'):
+
+ if state == 1 and re.search('^Current (VM|machine) states:', line.strip()):
state = 2
elif state == 2 and not line.strip():
state = 3 | Add support for vagrant <I>? at least for vagrant status output .. | todddeluca_python-vagrant | train | py |
c1e3914fd646e1bb12f5afdd719c326397c125ca | diff --git a/statik.go b/statik.go
index <HASH>..<HASH> 100644
--- a/statik.go
+++ b/statik.go
@@ -31,9 +31,7 @@ import (
"time"
)
-const (
- nameSourceFile = "statik.go"
-)
+const nameSourceFile = "statik.go"
var namePackage string
@@ -46,7 +44,7 @@ var (
flagTags = flag.String("tags", "", "Write build constraint tags")
flagPkg = flag.String("p", "statik", "Name of the generated package")
flagPkgCmt = flag.String("c", "Package statik contains static assets.", "The package comment. An empty value disables this comment.\n")
- flagInclude = flag.String("include", "*.*", "The patterns of files to be included (by comma separated).\n")
+ flagInclude = flag.String("include", "*.*", "The patterns of files to be included (by comma separated).\n")
)
// mtimeDate holds the arbitrary mtime that we assign to files when | Minor readability improvement and gofmt | rakyll_statik | train | go |
19049c54ad15abcfc16e889c900bf0052260f2af | diff --git a/hikaricp-common/src/main/java/com/zaxxer/hikari/HikariJNDIFactory.java b/hikaricp-common/src/main/java/com/zaxxer/hikari/HikariJNDIFactory.java
index <HASH>..<HASH> 100644
--- a/hikaricp-common/src/main/java/com/zaxxer/hikari/HikariJNDIFactory.java
+++ b/hikaricp-common/src/main/java/com/zaxxer/hikari/HikariJNDIFactory.java
@@ -30,7 +30,6 @@ import javax.naming.Reference;
import javax.naming.spi.ObjectFactory;
import javax.sql.DataSource;
-import com.zaxxer.hikari.metrics.CodaHaleShim;
import com.zaxxer.hikari.util.PropertyBeanSetter;
/**
@@ -40,11 +39,6 @@ import com.zaxxer.hikari.util.PropertyBeanSetter;
*/
public class HikariJNDIFactory implements ObjectFactory
{
- static
- {
- CodaHaleShim.initialize();
- }
-
@Override
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception
{ | Fix #<I> no need to initialize the CodaHaleShim in the JNDI factory | brettwooldridge_HikariCP | train | java |
5055a3e3d365fa7ee4dd2193ca7124e7cda4681d | diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php
index <HASH>..<HASH> 100644
--- a/mod/assignment/lib.php
+++ b/mod/assignment/lib.php
@@ -1072,7 +1072,8 @@ class assignment_base {
global $USER;
- if (!$feedback = data_submitted()) { // No incoming data?
+ //disable referer check because submission form has GET parameters in action URL!
+ if (!$feedback = data_submitted('nomatch')) { // No incoming data?
return false;
} | fixed grading when secure forms on bug #<I>; merged from MOODLE_<I>_STABLE | moodle_moodle | train | php |
8a12e57f5a735d0d5704e050a4dc05119e2187fb | diff --git a/sacredboard/app/config/routes.py b/sacredboard/app/config/routes.py
index <HASH>..<HASH> 100644
--- a/sacredboard/app/config/routes.py
+++ b/sacredboard/app/config/routes.py
@@ -5,7 +5,7 @@ from pathlib import Path
from flask import Blueprint
from flask import current_app
from flask import render_template
-from flask import request, Response, redirect
+from flask import request, Response, redirect, url_for
from ..process import process
import sacredboard.app.process.process as proc
@@ -13,8 +13,8 @@ routes = Blueprint("routes", __name__)
@routes.route("/")
-def hello_world():
- return "Hello world"
+def index():
+ return redirect(url_for("routes.show_runs"))
@routes.route("/runs")
diff --git a/sacredboard/webapp.py b/sacredboard/webapp.py
index <HASH>..<HASH> 100644
--- a/sacredboard/webapp.py
+++ b/sacredboard/webapp.py
@@ -24,6 +24,7 @@ def run(debug, m):
routes.setup_routes(app)
app.config["data"].connect()
print("Starting sacredboard on port 5000")
+ print("Try to navigate to http://127.0.0.1:5000")
if debug:
app.run(host="0.0.0.0", debug=True)
else: | Add redirect from / to /runs | chovanecm_sacredboard | train | py,py |
9e7ac64aef84ca60a2f1347ed53fdeb216f1b83e | diff --git a/ips_vagrant/commands/cmd_new.py b/ips_vagrant/commands/cmd_new.py
index <HASH>..<HASH> 100644
--- a/ips_vagrant/commands/cmd_new.py
+++ b/ips_vagrant/commands/cmd_new.py
@@ -205,5 +205,5 @@ def cli(ctx, name, dname, license_key, force, enable, ssl, spdy, gzip, cache, in
for filename in dirnames:
os.chmod(os.path.join(dirname, filename), 0o777)
- shutil.move(os.path.join(site.root, 'conf_global.dist.php'), os.path.join(site.root, 'conf_global.php'))
- os.chmod(os.path.join(site.root, 'conf_global.php'), 0o777)
+ shutil.move(os.path.join(site.root, 'conf_global.dist.php'), os.path.join(site.root, 'conf_global.php'))
+ os.chmod(os.path.join(site.root, 'conf_global.php'), 0o777) | (Bugfix) move shutil out of for loop | FujiMakoto_IPS-Vagrant | train | py |
fa7b80afc9566376aafa7cdc8c5ea34bc104f2ee | diff --git a/swifter/swifter_tests.py b/swifter/swifter_tests.py
index <HASH>..<HASH> 100644
--- a/swifter/swifter_tests.py
+++ b/swifter/swifter_tests.py
@@ -1,3 +1,4 @@
+import sys
import unittest
import subprocess
import time
@@ -147,7 +148,7 @@ class TestSwifter(unittest.TestCase):
def test_stdout_redirected(self):
print_messages = subprocess.check_output(
[
- "python",
+ sys.executable,
"-c",
"import pandas as pd; import numpy as np; import swifter; "
+ "df = pd.DataFrame({'x': np.random.normal(size=4)}); " | Use the current python executable in tests
Currently it is hard-coded to use the default python executable rather than the one you are currently using to run swifter. The default python may not have swifter installed for it. | jmcarpenter2_swifter | train | py |
571cfb0d66d859710cc6e2c8d53aaa7f676da1da | diff --git a/sklearn_porter/utils/Environment.py b/sklearn_porter/utils/Environment.py
index <HASH>..<HASH> 100644
--- a/sklearn_porter/utils/Environment.py
+++ b/sklearn_porter/utils/Environment.py
@@ -4,9 +4,9 @@ import os
import sys
try:
- from shutil import which
+ from shutil import which as _which
except ImportError:
- def which(cmd, mode=os.F_OK | os.X_OK, path=None):
+ def _which(cmd, mode=os.F_OK | os.X_OK, path=None):
"""Given a command, mode, and a PATH string, return the path which
conforms to the given mode on the PATH, or None if there is no such
file.
@@ -93,7 +93,7 @@ class Environment(object):
"""Check whether the application <name> is installed."""
if check_win:
Environment.check_windows()
- return which(str(name)) is not None
+ return _which(str(name)) is not None
@staticmethod
def has_apps(names, check_win=True): | release/<I>: Make 'which' private | nok_sklearn-porter | train | py |
866cfb5ace784b0f73b9a65bb1e138661050c074 | diff --git a/lib/branch_io_cli/commands/report_command.rb b/lib/branch_io_cli/commands/report_command.rb
index <HASH>..<HASH> 100644
--- a/lib/branch_io_cli/commands/report_command.rb
+++ b/lib/branch_io_cli/commands/report_command.rb
@@ -43,7 +43,7 @@ module BranchIOCLI
cmd = "xcodebuild"
cmd = "#{cmd} -scheme #{config_helper.scheme}" if config_helper.scheme
cmd = "#{cmd} -workspace #{config_helper.workspace_path}" if config_helper.workspace_path
- cmd = "#{cmd} -project #{config_helper.xcodeproj_path}" if config_helper.xcodeproj_path
+ cmd = "#{cmd} -project #{config_helper.xcodeproj_path}" if config_helper.xcodeproj_path && !config_helper.workspace_path
cmd = "#{cmd} -target #{config_helper.target}" if config_helper.target
cmd = "#{cmd} -configuration #{config_helper.configuration}" if config_helper.configuration
cmd
@@ -76,6 +76,7 @@ module BranchIOCLI
info_plist = CFPropertyList.native_types raw_info_plist.value
return info_plist["CFBundleVersion"]
end
+ # TODO: Detect if the Branch SDK source is included in the project.
nil
end | Do not pass -project to xcodebuild if -workspace is present | BranchMetrics_branch_io_cli | train | rb |
99cf846cc18ed06a67605098d882d585210b4833 | diff --git a/djedi/plugins/img.py b/djedi/plugins/img.py
index <HASH>..<HASH> 100644
--- a/djedi/plugins/img.py
+++ b/djedi/plugins/img.py
@@ -1,6 +1,5 @@
import json
import six
-from PIL import Image
from django.utils.html import escape
from django.core.files.uploadedfile import InMemoryUploadedFile
from django import forms
@@ -75,6 +74,7 @@ class ImagePluginBase(FormsBasePlugin):
return {'filename': None, 'url': None}
def save(self, data):
+ from PIL import Image
width = int(data.get('width') or 0)
height = int(data.get('height') or 0) | Move PIL Image import back into save method to avoid import errors | 5monkeys_djedi-cms | train | py |
f7396d387aa9c1b83859b079dfaa1c7749ff1269 | diff --git a/app/decorators/wallaby/resource_decorator.rb b/app/decorators/wallaby/resource_decorator.rb
index <HASH>..<HASH> 100644
--- a/app/decorators/wallaby/resource_decorator.rb
+++ b/app/decorators/wallaby/resource_decorator.rb
@@ -1,10 +1,4 @@
class Wallaby::ResourceDecorator
- def self.inherited(subclass)
- [ '', 'index_', 'show_', 'form_' ].each do |prefix|
- subclass.send "#{ prefix }field_names"
- end
- end
-
class << self
def model_class
if self < Wallaby::ResourceDecorator
@@ -38,6 +32,13 @@ class Wallaby::ResourceDecorator
def initialize resource
@resource = resource
@model_decorator = self.class.model_decorator model_class
+
+ if self.class < Wallaby::ResourceDecorator
+ [ '', 'index_', 'show_', 'form_' ].each do |prefix|
+ send "#{ prefix }field_names"
+ send "#{ prefix }fields"
+ end
+ end
end
def method_missing method_id, *args | don't use inherited, move the setup into initialize constructor for resource decorator | reinteractive_wallaby | train | rb |
a9250a5aac439a72f71c248de07f042674fb2076 | diff --git a/src/com/google/javascript/jscomp/DefaultPassConfig.java b/src/com/google/javascript/jscomp/DefaultPassConfig.java
index <HASH>..<HASH> 100644
--- a/src/com/google/javascript/jscomp/DefaultPassConfig.java
+++ b/src/com/google/javascript/jscomp/DefaultPassConfig.java
@@ -190,6 +190,8 @@ public class DefaultPassConfig extends PassConfig {
protected List<PassFactory> getChecks() {
List<PassFactory> checks = Lists.newArrayList();
+ checks.add(createEmptyPass("beforeStandardChecks"));
+
if (options.closurePass) {
checks.add(closureGoogScopeAliases);
} | Move some passes into the compiler.
R=mwr,wwen,rrhett
DELTA=<I> (<I> added, <I> deleted, 4 changed)
Revision created by MOE tool push_codebase.
MOE_MIGRATION=<I>
git-svn-id: <URL> | google_closure-compiler | train | java |
fc5c4c538e97d028bdd1c79dc0e553f99e46f21a | diff --git a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPConnectionService.java b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPConnectionService.java
index <HASH>..<HASH> 100644
--- a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPConnectionService.java
+++ b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPConnectionService.java
@@ -156,14 +156,12 @@ public class LDAPConnectionService {
// Disconnect if an error occurs during bind
catch (LdapException e) {
logger.debug("Unable to bind to LDAP server.", e);
+ disconnect(ldapConnection);
throw new GuacamoleInvalidCredentialsException(
"Unable to bind to the LDAP server.",
CredentialsInfo.USERNAME_PASSWORD);
}
- finally {
- disconnect(ldapConnection);
- }
-
+
return ldapConnection;
} | GUACAMOLE-<I>: Don't close the connection after bind. | glyptodon_guacamole-client | train | java |
37ad97c2d4957bbe25671d0e4ef92688ff3a6176 | diff --git a/app/models/socializer/person.rb b/app/models/socializer/person.rb
index <HASH>..<HASH> 100644
--- a/app/models/socializer/person.rb
+++ b/app/models/socializer/person.rb
@@ -51,6 +51,7 @@ module Socializer
delegate :circles, to: :activity_object, allow_nil: true
delegate :comments, to: :activity_object, allow_nil: true
+ delegate :contacts, to: :activity_object, allow_nil: true
delegate :groups, to: :activity_object, allow_nil: true
delegate :notes, to: :activity_object, allow_nil: true
delegate :memberships, to: :activity_object, allow_nil: true
@@ -103,13 +104,6 @@ module Socializer
@notifications ||= activity_object.notifications.newest_first
end
- # Collection of contacts for the user
- #
- # @return [Array] Returns a collection of contacts
- def contacts
- circles.flat_map(&:contacts).uniq
- end
-
def contact_of
@contact_of ||= Circle.joins(:ties).merge(Tie.by_contact_id(guid)).map(&:author).uniq
end | delegate contacts to the activity_object | socializer_socializer | train | rb |
d103dfde913d4942b7746fe9a28670a6133426d0 | diff --git a/scan/route_params.go b/scan/route_params.go
index <HASH>..<HASH> 100644
--- a/scan/route_params.go
+++ b/scan/route_params.go
@@ -4,6 +4,7 @@ import (
"github.com/go-openapi/spec"
"strconv"
"strings"
+ "errors"
)
const (
@@ -99,6 +100,10 @@ func (s *setOpParams) Parse(lines []string) error {
key := strings.ToLower(strings.TrimSpace(kv[0]))
value := strings.TrimSpace(kv[1])
+ if current == nil {
+ return errors.New("invalid route/operation schema provided")
+ }
+
switch key {
case ParamDescriptionKey:
current.Description = value | fixed "runtime error: invalid memory address or nil pointer dereference" when invalid signature for route provided | go-swagger_go-swagger | train | go |
cf24f4ea4f3d28d293d8e4a216f23d14bef52f15 | diff --git a/transactions/services/daemonservice.py b/transactions/services/daemonservice.py
index <HASH>..<HASH> 100644
--- a/transactions/services/daemonservice.py
+++ b/transactions/services/daemonservice.py
@@ -139,5 +139,5 @@ class RegtestDaemonService(BitcoinDaemonService):
def make_request(self, method, params=[]):
response = super(RegtestDaemonService, self).make_request(method, params)
if method == 'sendrawtransaction':
- super(RegtestDaemonService, self).make_request("setgenerate", [True, 1])
+ super(RegtestDaemonService, self).make_request("generate", [1])
return response | Changed the command to generate new blocks for bitcoind > <I> | ascribe_transactions | train | py |
873ae4b57ac6db0c2a2e4717f8a79e4c26ef1cb3 | diff --git a/salt/states/file.py b/salt/states/file.py
index <HASH>..<HASH> 100644
--- a/salt/states/file.py
+++ b/salt/states/file.py
@@ -4489,7 +4489,10 @@ def append(name,
text = _validate_str_list(text)
with salt.utils.fopen(name, 'rb') as fp_:
- slines = fp_.read().splitlines()
+ slines = fp_.read()
+ if six.PY3:
+ slines = slines.decode(__salt_system_encoding__)
+ slines = slines.splitlines()
append_lines = []
try:
@@ -4537,7 +4540,10 @@ def append(name,
ret['comment'] = 'File {0} is in correct state'.format(name)
with salt.utils.fopen(name, 'rb') as fp_:
- nlines = fp_.read().splitlines()
+ nlines = fp_.read()
+ if six.PY3:
+ nlines = nlines.decode(__salt_system_encoding__)
+ nlines = nlines.splitlines()
if slines != nlines:
if not salt.utils.istextfile(name): | Under Py3, decode what's read, from bytes to strings | saltstack_salt | train | py |
ab48b5a97596c00d657622cf78e973fcb7017043 | diff --git a/modeltranslation/management/commands/update_translation_fields.py b/modeltranslation/management/commands/update_translation_fields.py
index <HASH>..<HASH> 100644
--- a/modeltranslation/management/commands/update_translation_fields.py
+++ b/modeltranslation/management/commands/update_translation_fields.py
@@ -12,7 +12,7 @@ class Command(NoArgsCommand):
'translated application using the value of the original field.')
def handle(self, **options):
- verbosity = options['verbosity']
+ verbosity = int(options['verbosity'])
if verbosity > 0:
self.stdout.write("Using default language: %s\n" % DEFAULT_LANGUAGE)
for model, trans_opts in translator._registry.items(): | Fixed verbosity switch, which is used as an int but was not coerced. | deschler_django-modeltranslation | train | py |
0630339e766d55907cf26c715ddb0abafdee4576 | diff --git a/sllurp/llrp_proto.py b/sllurp/llrp_proto.py
index <HASH>..<HASH> 100644
--- a/sllurp/llrp_proto.py
+++ b/sllurp/llrp_proto.py
@@ -778,8 +778,9 @@ def decode_ReaderEventNotification(data):
msg['ReaderEventNotificationData'] = ret
# Check the end of the message
- if len(body) > 0:
- raise LLRPError('junk at end of message: ' + bin2dump(body))
+ if len(body):
+ logger.debug('Unprocessed bytes in READER_EVENT_NOTIFICATION: %s',
+ hexlify(body))
return msg | don't freak out about extra event notification data | ransford_sllurp | train | py |
b11e9544ea5e578ee6bce127d84817bc715ba098 | diff --git a/processing/src/main/java/io/druid/query/groupby/epinephelinae/Groupers.java b/processing/src/main/java/io/druid/query/groupby/epinephelinae/Groupers.java
index <HASH>..<HASH> 100644
--- a/processing/src/main/java/io/druid/query/groupby/epinephelinae/Groupers.java
+++ b/processing/src/main/java/io/druid/query/groupby/epinephelinae/Groupers.java
@@ -46,7 +46,9 @@ public class Groupers
public static int hash(final Object obj)
{
// Mask off the high bit so we can use that to determine if a bucket is used or not.
- return obj.hashCode() & 0x7fffffff;
+ // Also apply the same XOR transformation that j.u.HashMap applies, to improve distribution.
+ final int code = obj.hashCode();
+ return (code ^ (code >>> 16)) & 0x7fffffff;
}
public static <KeyType extends Comparable<KeyType>> Iterator<Grouper.Entry<KeyType>> mergeIterators( | GroupBy v2: Improve hash code distribution. (#<I>)
Without this transformation, distribution of hash % X is poor in general.
It is catastrophically poor when X is a multiple of <I> (many slots would
be empty). | apache_incubator-druid | train | java |
509df542641162e55707e654e876924681e1a310 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -825,7 +825,7 @@ Dat.prototype.createDiffStream = function (headA, headB, opts) {
obj.key = key.slice(i + 1)
obj.dataset = key.slice(0, i)
}
- obj.value = valueEncoding.decode(obj.value)
+ if (Buffer.isBuffer(obj.value)) obj.value = valueEncoding.decode(obj.value)
}
var fork = -1 | only decode buffers. fixes #<I> | maxogden_dat-core | train | js |
bec486ddd5ae3a6e0bf256f0c28e55449ddce793 | diff --git a/lib/jsi/util.rb b/lib/jsi/util.rb
index <HASH>..<HASH> 100644
--- a/lib/jsi/util.rb
+++ b/lib/jsi/util.rb
@@ -79,6 +79,7 @@ module JSI
end
module_function :ycomb
end
+ public
extend Util
module FingerprintHash | fix Util methods not being public on JSI module | notEthan_jsi | train | rb |
de72fe244089868ac95a78f9aed0631df88fd400 | diff --git a/src/transporters/tcp.js b/src/transporters/tcp.js
index <HASH>..<HASH> 100644
--- a/src/transporters/tcp.js
+++ b/src/transporters/tcp.js
@@ -178,6 +178,7 @@ class TcpTransporter extends Transporter {
*/
startTimers() {
this.gossipTimer = setInterval(() => this.sendGossipRequest(), Math.max(this.opts.gossipPeriod, 1) * 1000);
+ this.gossipTimer.unref();
}
/**
diff --git a/src/transporters/tcp/udp-broadcaster.js b/src/transporters/tcp/udp-broadcaster.js
index <HASH>..<HASH> 100644
--- a/src/transporters/tcp/udp-broadcaster.js
+++ b/src/transporters/tcp/udp-broadcaster.js
@@ -159,6 +159,8 @@ class UdpServer extends EventEmitter {
}, (this.opts.multicastPeriod || 5) * 1000);
+ this.discoverTimer.unref();
+
this.logger.info("UDP discovery started.");
}
} | unref tcp timers | moleculerjs_moleculer | train | js,js |
322ceddd86d131471655b9003df425c29bcd3460 | diff --git a/pandas/core/series.py b/pandas/core/series.py
index <HASH>..<HASH> 100644
--- a/pandas/core/series.py
+++ b/pandas/core/series.py
@@ -1320,11 +1320,11 @@ copy : boolean, default False
argsorted = argsorted[::-1]
if na_last:
- n = sum(good)
+ n = good.sum()
sortedIdx[:n] = idx[good][argsorted]
sortedIdx[n:] = idx[bad]
else:
- n = sum(bad)
+ n = bad.sum()
sortedIdx[n:] = idx[good][argsorted]
sortedIdx[:n] = idx[bad] | BUG: don't use __builtin__.sum in Series.order, address GH #<I> | pandas-dev_pandas | train | py |
50226569da2b121ee3012a7cbe266df3c185212c | diff --git a/course/mod.php b/course/mod.php
index <HASH>..<HASH> 100644
--- a/course/mod.php
+++ b/course/mod.php
@@ -695,7 +695,7 @@
$defaultformat = FORMAT_MOODLE;
}
- $icon = '<img align="middle" height="16" width="16" src="'.$CFG->modpixpath.'/'.$module->name.'/icon.gif" alt="" style="vertical-align: middle;" /> ';
+ $icon = '<img height="16" width="16" src="'.$CFG->modpixpath.'/'.$module->name.'/icon.gif" alt="" style="vertical-align:middle;" /> ';
print_heading_with_help($pageheading, "mods", $module->name, $icon);
print_simple_box_start('center', '', '', 5, 'generalbox', $module->name); | Removed align attribute. Related to MDL-<I>. | moodle_moodle | train | php |
Subsets and Splits