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 |
|---|---|---|---|---|---|
6a04b1f63e0613b322f0654baad9a8bcbe52620f | diff --git a/public/js/editors/keycontrol.js b/public/js/editors/keycontrol.js
index <HASH>..<HASH> 100644
--- a/public/js/editors/keycontrol.js
+++ b/public/js/editors/keycontrol.js
@@ -1,7 +1,7 @@
/*globals objectValue, $, jsbin, $body, $document*/
var keyboardHelpVisible = false;
-var customKeys = objectValue('jsbin.settings.keys') || {};
+var customKeys = objectValue('settings.keys', jsbin) || {};
function enableAltUse() {
if (!jsbin.settings.keys) { | Custom key settings could not be read when anon
We were trying to read the jsbin object of the window object, but since we made the entire thing private a few months ago, this started breaking.
So now I pass in the correct context to the read the object.
Fixes #<I> | jsbin_jsbin | train | js |
012bbc62ccbb8f30aea6049f6bd851c1d0a50a56 | diff --git a/src/variety/country.js b/src/variety/country.js
index <HASH>..<HASH> 100644
--- a/src/variety/country.js
+++ b/src/variety/country.js
@@ -34,6 +34,12 @@ MouseEvent:{
"MouseEvent@moonsun":{
// オーバーライド
inputMB : function(){
+ var border = this.getpos(0.22).getb();
+ if(border.group==='border' && !border.isnull){
+ this.inputpeke();
+ return;
+ }
+
var cell = this.getcell();
if(cell.isnull || cell.qnum===-1){ return;}
var clist = cell.room.clist.filter(function(cell2){ return cell.qnum===cell2.qnum;}); | moonsun: Enable to input cross marks by smartphone or tablet | sabo2_pzprjs | train | js |
30b0d7eca43db06a2fabd8b8d82ac41a743b0f25 | diff --git a/dwave/cloud/solver.py b/dwave/cloud/solver.py
index <HASH>..<HASH> 100644
--- a/dwave/cloud/solver.py
+++ b/dwave/cloud/solver.py
@@ -656,9 +656,14 @@ class StructuredSolver(BaseSolver):
raise RuntimeError("Can't sample from 'bqm' without dimod. "
"Re-install the library with 'bqm' support.")
- ising = bqm.spin
- return self._sample('ising', ising.linear, ising.quadratic, params,
- undirected_biases=True)
+ if bqm.vartype is dimod.SPIN:
+ return self._sample('ising', bqm.linear, bqm.quadratic, params,
+ undirected_biases=True)
+ elif bqm.vartype is dimod.BINARY:
+ return self._sample('qubo', bqm.linear, bqm.quadratic, params,
+ undirected_biases=True)
+ else:
+ raise TypeError("unknown/unsupported vartype")
def _sample(self, type_, linear, quadratic, params, undirected_biases=False):
"""Internal method for `sample_ising`, `sample_qubo` and `sample_bqm`. | Route ising/qubo BQMs in `Solver.sample_bqm` to ising/qubo QMIs
Fix #<I>. | dwavesystems_dwave-cloud-client | train | py |
7c9936dfb8933fda1c378ee2111f55e56745b302 | diff --git a/lib/coral_core/plugin/action.rb b/lib/coral_core/plugin/action.rb
index <HASH>..<HASH> 100644
--- a/lib/coral_core/plugin/action.rb
+++ b/lib/coral_core/plugin/action.rb
@@ -44,15 +44,15 @@ class Action < Base
args = array(delete(:args, []))
@codes = Codes.new
+
+ self.usage = usage
if get(:settings, nil)
set(:processed, true)
else
set(:settings, {})
parse_base(args)
- end
-
- self.usage = usage
+ end
end
#-----------------------------------------------------------------------------
@@ -89,7 +89,7 @@ class Action < Base
def help
return @parser.help if @parser
- ''
+ usage
end
#-----------------------------------------------------------------------------
@@ -125,7 +125,7 @@ class Action < Base
logger.debug("Parse successful: #{export.inspect}")
elsif @parser.options[:help] && ! quiet?
- puts I18n.t('coral.core.exec.help.usage') + ': ' + @parser.help + "\n"
+ puts I18n.t('coral.core.exec.help.usage') + ': ' + help + "\n"
else
if @parser.options[:help] | Fixing usage issue in the base action plugin class. | coralnexus_corl | train | rb |
ceba5cb0051889ba0b3a957704989a0d469934c1 | diff --git a/src/main/java/net/openhft/chronicle/network/WireTcpHandler.java b/src/main/java/net/openhft/chronicle/network/WireTcpHandler.java
index <HASH>..<HASH> 100755
--- a/src/main/java/net/openhft/chronicle/network/WireTcpHandler.java
+++ b/src/main/java/net/openhft/chronicle/network/WireTcpHandler.java
@@ -77,7 +77,7 @@ public abstract class WireTcpHandler implements TcpHandler {
private boolean read(@NotNull Bytes in, @NotNull Bytes out, @NotNull SessionDetailsProvider sessionDetails) {
final long header = in.readInt(in.readPosition());
long length = Wires.lengthOf(header);
- assert length >= 0 && length < 1 << 22 : "in=" + in + ", hex=" + in.toHexString();
+ assert length >= 0 && length < 1 << 23 : "in=" + in + ", hex=" + in.toHexString();
// we don't return on meta data of zero bytes as this is a system message
if (length == 0 && Wires.isData(header)) {
@@ -122,8 +122,6 @@ public abstract class WireTcpHandler implements TcpHandler {
LOG.error("", e);
} finally {
in.readLimit(limit);
- // TODO remove this !!
- Thread.yield();
try {
in.readPosition(end);
} catch (Exception e) { | CHENT-<I> Performance uniting as a part of testing a buffered overflow. | OpenHFT_Chronicle-Network | train | java |
50e76e77822e1212f5111686389e53a2000a900f | diff --git a/lib/xcodeproj/plist.rb b/lib/xcodeproj/plist.rb
index <HASH>..<HASH> 100644
--- a/lib/xcodeproj/plist.rb
+++ b/lib/xcodeproj/plist.rb
@@ -60,10 +60,7 @@ module Xcodeproj
# The path of the file.
#
def self.file_in_conflict?(path)
- file = File.open(path, 'r')
- file.each_line.any? { |l| l.match(/^(<|=|>){7}/) }
- ensure
- file.close
+ File.read(path).match(/^(<|=|>){7}/)
end
end
end | [Plist] Simplify merge conflict detection | CocoaPods_Xcodeproj | train | rb |
ad69cdd32464188960b7d1edba6b040b11269486 | diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb b/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb
index <HASH>..<HASH> 100644
--- a/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb
@@ -68,7 +68,7 @@ end
# We're overcoming a problem where Homebrew updating Git on MacOS throws a symlink error
# We remove git completely to allow homebrew to update Git.
-execute 'Remove native Git client' do
+execute "Remove native Git client" do
"brew list --full-name | grep '^git@' | xargs -r brew uninstall --ignore-dependencies"
end | Updated the recipe to remove Git completely before updating it. | chef_chef | train | rb |
75f8ce3a05a39d251cf627951917439f102a4199 | diff --git a/tasks/init.js b/tasks/init.js
index <HASH>..<HASH> 100644
--- a/tasks/init.js
+++ b/tasks/init.js
@@ -458,7 +458,11 @@ module.exports = function(grunt) {
// Fail task if errors were logged.
if (grunt.task.current.errorCount) { taskDone(false); }
// Otherwise, print a success message.
- grunt.log.writeln().writeln('Initialized from template "' + name + '".');
+ grunt.log.subhead('Initialized from template "' + name + '".');
+ // Show any template-specific notes.
+ if (initTemplate.after) {
+ grunt.log.writelns(initTemplate.after);
+ }
// All done!
taskDone();
}].concat(args)); | Templates may now export an "after" property to display a message… after. | gruntjs_grunt-init | train | js |
b92af52a3327584a50200dcc33d2bf3066ffe254 | diff --git a/lib/RouterMixin.js b/lib/RouterMixin.js
index <HASH>..<HASH> 100644
--- a/lib/RouterMixin.js
+++ b/lib/RouterMixin.js
@@ -153,10 +153,10 @@ function getInitialPath(component) {
if (!path && detect.canUseDOM) {
url = urllite(window.location.href);
- if (!component.props.useHistory && url.hash) {
- path = urllite(url.hash.slice(2)).pathname;
- } else {
+ if (component.props.useHistory) {
path = url.pathname;
+ } else if (url.hash) {
+ path = urllite(url.hash.slice(2)).pathname;
}
} | fix getInitialPath to get correct path while hash is null | larrymyers_react-mini-router | train | js |
8b827f5f3ebb42dd84dd96b5bc1e082232ef6299 | diff --git a/languages_substitution.go b/languages_substitution.go
index <HASH>..<HASH> 100644
--- a/languages_substitution.go
+++ b/languages_substitution.go
@@ -21,6 +21,6 @@ var plSub = map[rune]string{
}
var esSub = map[rune]string{
- '&': "i",
- '@': "na",
+ '&': "y",
+ '@': "en",
} | Fix sad error with spanish substitution. | gosimple_slug | train | go |
79184ad53f6727bd203828cff0a7c722165a6258 | diff --git a/app/decorators/socializer/person_decorator.rb b/app/decorators/socializer/person_decorator.rb
index <HASH>..<HASH> 100644
--- a/app/decorators/socializer/person_decorator.rb
+++ b/app/decorators/socializer/person_decorator.rb
@@ -21,20 +21,23 @@ module Socializer
html = []
html << toolbar_links(list[0..2])
+ html << toolbar_dropdown(list[3..(list.size)])
- html << helpers.content_tag(:li, class: 'dropdown') do
+ html.join.html_safe
+ end
+
+ private
+
+ def toolbar_dropdown(list)
+ helpers.content_tag(:li, class: 'dropdown') do
dropdown_link +
helpers.content_tag(:ul, class: 'dropdown-menu') do
- toolbar_links(list[3..(list.size)])
+ toolbar_links(list)
end
end
-
- html.join.html_safe
end
- private
-
def dropdown_link
icon = helpers.content_tag(:span, nil, class: 'fa fa-angle-down fa-fw')
helpers.link_to('#', class: 'dropdown-toggle', data: { toggle: 'dropdown' }) do | further reduce complexity of the toolbar_stream_links method
move the drop down code to the toolbar_dropdown method | socializer_socializer | train | rb |
23694116de6e672ca8fb582f2c259e437e09e0b8 | diff --git a/staticjinja/staticjinja.py b/staticjinja/staticjinja.py
index <HASH>..<HASH> 100755
--- a/staticjinja/staticjinja.py
+++ b/staticjinja/staticjinja.py
@@ -26,13 +26,7 @@ def _has_argument(func):
:param func:
The function to be tested for existence of an argument.
"""
- if hasattr(inspect, 'signature'):
- # New way in python 3.3
- sig = inspect.signature(func)
- return bool(sig.parameters)
- else:
- # Old way
- return bool(inspect.getargspec(func).args)
+ return bool(inspect.signature(func).parameters)
class Site(object): | Update use of deprecated `inspect.getargspec()`
The newer version, `inspect.signature()`, has been around since
python <I>, and we don't support versions before <I>. | Ceasar_staticjinja | train | py |
1f844b63238a87e2e0fdd405916c6f7aa6807062 | diff --git a/php-binance-api.php b/php-binance-api.php
index <HASH>..<HASH> 100644
--- a/php-binance-api.php
+++ b/php-binance-api.php
@@ -128,5 +128,4 @@ class Binance {
return $prices;
}
}
-
// https://www.binance.com/restapipub.html | Added Kline/Candlestick data
Visit binance.com | jaggedsoft_php-binance-api | train | php |
94ce1958878345bacbfb853f067146b3d7bc626b | diff --git a/spec/commands/auth_spec.rb b/spec/commands/auth_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/commands/auth_spec.rb
+++ b/spec/commands/auth_spec.rb
@@ -5,8 +5,10 @@ module Heroku::Command
before do
@cli = prepare_command(Auth)
@sandbox = "#{Dir.tmpdir}/cli_spec_#{Process.pid}"
- File.open(@sandbox, "w") { |f| f.write "user\npass\n" }
- @cli.stub!(:credentials_file).and_return(@sandbox)
+ FileUtils.mkdir_p(@sandbox)
+ @credentials_file = "#{@sandbox}/credentials"
+ File.open(@credentials_file, "w") { |f| f.write "user\npass\n" }
+ @cli.stub!(:credentials_file).and_return(@credentials_file)
@cli.stub!(:running_on_a_mac?).and_return(false)
end
@@ -35,7 +37,7 @@ module Heroku::Command
@cli.stub!(:credentials).and_return(['one', 'two'])
@cli.should_receive(:set_credentials_permissions)
@cli.write_credentials
- File.read(@sandbox).should == "one\ntwo\n"
+ File.read(@credentials_file).should == "one\ntwo\n"
end
it "sets ~/.heroku/credentials to be readable only by the user" do | cannot change permissions on /tmp | heroku_legacy-cli | train | rb |
a0052b8f190f38bcdd24e4bf794c3ad6d2fd1b41 | diff --git a/integration/container/nat_test.go b/integration/container/nat_test.go
index <HASH>..<HASH> 100644
--- a/integration/container/nat_test.go
+++ b/integration/container/nat_test.go
@@ -59,6 +59,8 @@ func TestNetworkLocalhostTCPNat(t *testing.T) {
func TestNetworkLoopbackNat(t *testing.T) {
skip.If(t, testEnv.IsRemoteDaemon())
+ defer setupTest(t)()
+
msg := "it works"
startServerContainer(t, msg, 8080) | Add the missing call to setupTest to TestNetworkLoopbackNat test function, to avoid leaving behind test containers | moby_moby | train | go |
43df873ae3b73218f7c7e980da0ce3535d370b33 | diff --git a/arctic/store/_ndarray_store.py b/arctic/store/_ndarray_store.py
index <HASH>..<HASH> 100644
--- a/arctic/store/_ndarray_store.py
+++ b/arctic/store/_ndarray_store.py
@@ -191,6 +191,9 @@ class NdarrayStore(object):
data = b''.join(segments)
+ # free up memory from initial copy of data
+ del segments
+
# Check that the correct number of segments has been returned
if segment_count is not None and i + 1 != segment_count:
raise OperationFailure("Incorrect number of segments returned for {}:{}. Expected: {}, but got {}. {}".format( | attempt to reduce memory peak when deserialising data | manahl_arctic | train | py |
43e08d4143049d6bc4189c3387af1ee5b2347442 | diff --git a/pyrogram/__init__.py b/pyrogram/__init__.py
index <HASH>..<HASH> 100644
--- a/pyrogram/__init__.py
+++ b/pyrogram/__init__.py
@@ -16,7 +16,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
-__version__ = "2.0.9"
+__version__ = "2.0.10"
__license__ = "GNU Lesser General Public License v3.0 (LGPL-3.0)"
__copyright__ = "Copyright (C) 2017-present Dan <https://github.com/delivrance>" | Update Pyrogram to <I> | pyrogram_pyrogram | train | py |
f26ae7d10f9b890a9ac5de70f0be4a9cf9149233 | diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -62,13 +62,17 @@ module ActionDispatch
raise ActionController::RoutingError, e.message, e.backtrace if default_controller
end
- private
+ protected
+
+ attr_reader :controller_class_names
def controller_reference(controller_param)
- const_name = @controller_class_names[controller_param] ||= "#{controller_param.camelize}Controller"
+ const_name = controller_class_names[controller_param] ||= "#{controller_param.camelize}Controller"
ActiveSupport::Dependencies.constantize(const_name)
end
+ private
+
def dispatch(controller, action, req)
controller.action(action).call(req.env)
end | Move `controller_reference` and `controller_class_names` to protected
scope so that they are available to subclasses. | rails_rails | train | rb |
7bcf4405f53f87acbcdd83b5a1b2f742b15741de | diff --git a/Command/CacheCommand.php b/Command/CacheCommand.php
index <HASH>..<HASH> 100644
--- a/Command/CacheCommand.php
+++ b/Command/CacheCommand.php
@@ -59,7 +59,7 @@ class CacheCommand extends Command
$output->writeln( sprintf( 'Clearing the Aimeos cache for site <info>%1$s</info>', $siteItem->getCode() ) );
- \Aimeos\MAdmin\Cache\Manager\Factory::createManager( $lcontext )->getCache()->flush();
+ \Aimeos\MAdmin\Cache\Manager\Factory::createManager( $lcontext )->getCache()->clear();
}
}
} | Adapt to PSR-<I> changes | aimeos_aimeos-symfony | train | php |
72711bf588967c38cca1d07c002d0ef0a3743e69 | diff --git a/lib/pulsar/db.js b/lib/pulsar/db.js
index <HASH>..<HASH> 100644
--- a/lib/pulsar/db.js
+++ b/lib/pulsar/db.js
@@ -73,7 +73,7 @@ module.exports = (function() {
this.collection
.find({}, {"sort": [['data.timestamp', 'desc']]})
.skip(currentPage * pageSize)
- .limit(pageSize)
+ .limit(pageSize || 0)
.toArray(function(err, resultList) {
if (!err) {
resultList = _.map(resultList, function(result) { | Fix error due to mongodb client upgrade | cargomedia_pulsar-rest-api | train | js |
8d15b3b960f2f506e5befcec98ae41f4080b5e8d | diff --git a/packages/neos-ui-editors/src/Editors/Image/index.js b/packages/neos-ui-editors/src/Editors/Image/index.js
index <HASH>..<HASH> 100644
--- a/packages/neos-ui-editors/src/Editors/Image/index.js
+++ b/packages/neos-ui-editors/src/Editors/Image/index.js
@@ -171,11 +171,17 @@ export default class ImageEditor extends Component {
}
handleMediaSelected = assetIdentifier => {
- const {commit} = this.props;
+ const {commit, value} = this.props;
const newAsset = {
__identity: assetIdentifier
};
+ // Same image selected as before?
+ if (value && value.__identity === assetIdentifier) {
+ this.handleCloseSecondaryScreen();
+ return;
+ }
+
this.setState({
image: null,
isAssetLoading: true | BUGFIX: Same image cannot be selected twice (#<I>) | neos_neos-ui | train | js |
7581c7db0a7f2669fd4840bdfa240238dd3d9606 | diff --git a/cachalot/monkey_patch.py b/cachalot/monkey_patch.py
index <HASH>..<HASH> 100644
--- a/cachalot/monkey_patch.py
+++ b/cachalot/monkey_patch.py
@@ -42,10 +42,15 @@ def _get_result_or_execute_query(execute_query_func, cache,
new_table_cache_keys = set(table_cache_keys)
new_table_cache_keys.difference_update(data)
- if not new_table_cache_keys and cache_key in data:
- timestamp, result = data.pop(cache_key)
- if timestamp >= max(data.values()):
- return result
+ if not new_table_cache_keys:
+ try:
+ timestamp, result = data.pop(cache_key)
+ if timestamp >= max(data.values()):
+ return result
+ except (KeyError, TypeError, ValueError):
+ # In case `cache_key` is not in `data` or contains bad data,
+ # we simply run the query and cache again the results.
+ pass
result = execute_query_func()
if result.__class__ not in ITERABLES and isinstance(result, Iterable): | Handles cases where cache values were tampered with. | noripyt_django-cachalot | train | py |
6338f6841f9d3d2f10b586012ffd9817b03817ed | diff --git a/goose/article.py b/goose/article.py
index <HASH>..<HASH> 100644
--- a/goose/article.py
+++ b/goose/article.py
@@ -26,7 +26,7 @@ class Article(object):
def __init__(self):
# title of the article
- self.title = None
+ self.title = u""
# stores the lovely, pure text from the article,
# stripped of html, formatting, etc... | #<I> - title is empty string by default | goose3_goose3 | train | py |
b67f53d7075058405111af3661122818c9d22e9c | diff --git a/spring-dbunit-core/src/main/java/com/excilys/ebi/spring/dbunit/config/DataSetConfiguration.java b/spring-dbunit-core/src/main/java/com/excilys/ebi/spring/dbunit/config/DataSetConfiguration.java
index <HASH>..<HASH> 100644
--- a/spring-dbunit-core/src/main/java/com/excilys/ebi/spring/dbunit/config/DataSetConfiguration.java
+++ b/spring-dbunit-core/src/main/java/com/excilys/ebi/spring/dbunit/config/DataSetConfiguration.java
@@ -162,7 +162,8 @@ public class DataSetConfiguration implements DatabaseConnectionConfigurer {
public Builder withSchema(String schema) {
schema = schema.trim();
- dataSetConfiguration.schema = schema.isEmpty() ? null : schema;
+ if (!schema.isEmpty())
+ dataSetConfiguration.schema = schema;
return this;
} | Properly fixing #<I> | e-biz_spring-dbunit | train | java |
748995e5f07550359fc193540aba8b75b4d68bea | diff --git a/codenerix/static/codenerix/js/codenerix.js b/codenerix/static/codenerix/js/codenerix.js
index <HASH>..<HASH> 100644
--- a/codenerix/static/codenerix/js/codenerix.js
+++ b/codenerix/static/codenerix/js/codenerix.js
@@ -51,7 +51,7 @@ var codenerix_libraries = [
'ngQuill',
'cfp.hotkeys',
];
-var codenerix_debug = true;
+var codenerix_debug = false;
// Add the remove method to the Array structure
Array.prototype.remove = function(from, to) {
@@ -1838,6 +1838,11 @@ function codenerix_builder(libraries, routes) {
}
});
}
+
+ if (codenerix_debug == true) {
+ console.info("Router: if the path of the URL doesn't exists, AngularJS will now warn you in anyway, the state will stay with a blank page");
+ }
+
// Add factory
module.factory("ListMemory",function(){return {};}); | New message, debugger is off | codenerix_django-codenerix | train | js |
d24a906edfb95821c8778cebf617104f948cdb56 | diff --git a/perceval/backends/pipermail.py b/perceval/backends/pipermail.py
index <HASH>..<HASH> 100644
--- a/perceval/backends/pipermail.py
+++ b/perceval/backends/pipermail.py
@@ -65,7 +65,7 @@ class Pipermail(MBox):
:param tag: label used to mark the data
:param cache: cache object to store raw data
"""
- version = '0.4.0'
+ version = '0.4.1'
def __init__(self, url, dirpath, tag=None, cache=None):
origin = url
@@ -302,12 +302,12 @@ class PipermailList(MailingList):
return dt
def _download_archive(self, url, filepath):
- r = requests.get(url)
+ r = requests.get(url, stream=True)
r.raise_for_status()
try:
with open(filepath, 'wb') as fd:
- fd.write(r.content)
+ fd.write(r.raw.read())
except OSError as e:
logger.warning("Ignoring %s archive due to: %s", url, str(e))
return False | [pipermail] Fix error storing decompressed mbox files
By default, requests library decompresses gzip-encoded
responses, but in some cases is only able to decompress
some parts due to encoding issues or to mixed contents.
This patch fixes this problem storing the orinal/raw data
(compressed or decompressed) into the mbox file to process
it in the next phase using the decoder of the MBox class.
Backend version bumped to '<I>'. | chaoss_grimoirelab-perceval | train | py |
f6bf200e551e5b4e4c744e6bd145c24ab060c858 | diff --git a/app/lib/katello/http_resource.rb b/app/lib/katello/http_resource.rb
index <HASH>..<HASH> 100644
--- a/app/lib/katello/http_resource.rb
+++ b/app/lib/katello/http_resource.rb
@@ -76,7 +76,7 @@ module Katello
else v
end
end
- logger.debug "Body: #{payload_to_print.to_json}"
+ logger.debug "Body: #{filter_sensitive_data(payload_to_print.to_json)}"
rescue
logger.debug "Unable to print debug information"
end | Refs #<I> - also filter debug info | Katello_katello | train | rb |
e0b1c048094499136d96ead54bcb1ed55fa9573d | diff --git a/packages/@uppy/core/src/index.js b/packages/@uppy/core/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/@uppy/core/src/index.js
+++ b/packages/@uppy/core/src/index.js
@@ -36,6 +36,8 @@ class Uppy {
#storeUnsubscribe
+ #emitter = ee()
+
/**
* Instantiate Uppy
*
@@ -178,12 +180,6 @@ class Uppy {
this.retryUpload = this.retryUpload.bind(this)
this.upload = this.upload.bind(this)
- this.emitter = ee()
- this.on = this.on.bind(this)
- this.off = this.off.bind(this)
- this.once = this.emitter.once.bind(this.emitter)
- this.emit = this.emitter.emit.bind(this.emitter)
-
this.preProcessors = []
this.uploaders = []
this.postProcessors = []
@@ -222,13 +218,22 @@ class Uppy {
this.#addListeners()
}
+ emit (event, ...args) {
+ this.#emitter.emit(event, ...args)
+ }
+
on (event, callback) {
- this.emitter.on(event, callback)
+ this.#emitter.on(event, callback)
+ return this
+ }
+
+ once (event, callback) {
+ this.#emitter.once(event, callback)
return this
}
off (event, callback) {
- this.emitter.off(event, callback)
+ this.#emitter.off(event, callback)
return this
} | @uppy/core: move event emitter to private properties (#<I>) | transloadit_uppy | train | js |
0138a9d4c609a0324c7e32dbdbe17e983ea42af0 | diff --git a/src/wavesurfer.js b/src/wavesurfer.js
index <HASH>..<HASH> 100644
--- a/src/wavesurfer.js
+++ b/src/wavesurfer.js
@@ -87,20 +87,38 @@ var WaveSurfer = {
mark: function(options) {
options = options || {};
+ var self = this;
var timings = this.timings(0);
+ var id = options.id || '_m' + this.marks++;
var marker = {
- width: options.width,
- color: options.color,
+ id: id,
percentage: timings[0] / timings[1],
- position: timings[0]
+ position: timings[0],
+
+ update: function(options) {
+ options = options || {};
+
+ this.color = options.color;
+ this.width = options.width;
+
+ if (self.backend.paused) {
+ self.drawer.redraw();
+ if (options.center) {
+ self.drawer.recenter(this.percentage);
+ }
+ }
+
+ return this;
+ }
};
- var id = options.id || '_m' + this.marks++;
+ return this.drawer.markers[id] = marker.update(options);
+ },
- this.drawer.markers[id] = marker;
- if (this.backend.paused) this.drawer.redraw();
- return marker;
+ clearMarks: function() {
+ this.drawer.markers = {};
+ this.marks = 0;
},
timings: function(offset) { | Add method to clear markers and add an update method to markers. | katspaugh_wavesurfer.js | train | js |
00e0759142eb6a5fa9609cee0f9825b2efffbc05 | diff --git a/accounts/views.py b/accounts/views.py
index <HASH>..<HASH> 100644
--- a/accounts/views.py
+++ b/accounts/views.py
@@ -119,12 +119,15 @@ class UserAdd(CreateView): # GroupRequiredMixin
template_name = 'accounts/deployuser_create.html'
def form_valid(self, form):
+ # Save form
response = super(UserAdd, self).form_valid(form)
# Send a password recover email
- form = PasswordResetForm({'email': form.cleaned_data['email']})
- form.save(email_template_name='accounts/welcome_email.html')
+ email_form = PasswordResetForm({'email': form.cleaned_data['email']})
+ email_form.is_valid()
+ email_form.save(email_template_name='accounts/welcome_email.html')
+ # send response
return response | Updated the user add view to send a welcome email when a user is created. | fabric-bolt_fabric-bolt | train | py |
b47391d001c85f5bf934e0e7234e0ab44b604cfb | diff --git a/bootstrap.php b/bootstrap.php
index <HASH>..<HASH> 100644
--- a/bootstrap.php
+++ b/bootstrap.php
@@ -25,6 +25,8 @@ if (file_exists($applicationPath = __DIR__.'/../../../bootstrap/app.php')) { //
if ($app instanceof \Illuminate\Contracts\Foundation\Application) {
$app->make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap();
+} elseif ($app instanceof \Laravel\Lumen\Application) {
+ $app->boot();
}
$app->make('config')->set('larastan.mixins', require __DIR__.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'mixins.php'); | fix: some internal errors with the lumen framework | nunomaduro_larastan | train | php |
a29921d5b6f2cbe28423e42b43d7e84f3c36e598 | diff --git a/app/templates/src/app.js b/app/templates/src/app.js
index <HASH>..<HASH> 100644
--- a/app/templates/src/app.js
+++ b/app/templates/src/app.js
@@ -3,6 +3,7 @@ import route from 'can-route';
import 'can-route-pushstate';
const AppViewModel = DefineMap.extend({
+ route: "string",
message: {
value: 'Hello World!',
serialize: false | Include `route` in the appviewmodel
This is because it will be connected to can.route, which always sets the
route property. | donejs_generator-donejs | train | js |
ab45195265d73abb5082fe6b5ecbbe78d46a9623 | diff --git a/pypump/pypump.py b/pypump/pypump.py
index <HASH>..<HASH> 100644
--- a/pypump/pypump.py
+++ b/pypump/pypump.py
@@ -71,7 +71,7 @@ class PyPump(object):
logginglevel = getattr(logging, loglevel.upper(), None)
if logginglevel is None:
raise PyPumpException("Unknown loglevel {0!r}".format(loglevel))
- logging.basicConfig(level=logginglevel)
+ _log.setLevel(logginglevel)
openid.OpenID.pypump = self # pypump uses PyPump.requester. | Don't override settings on the root logger | xray7224_PyPump | train | py |
b92511693ef6471d9201b308674d4c744df06ddd | diff --git a/src/invalid-aware-types.spec.js b/src/invalid-aware-types.spec.js
index <HASH>..<HASH> 100644
--- a/src/invalid-aware-types.spec.js
+++ b/src/invalid-aware-types.spec.js
@@ -39,5 +39,6 @@ describe('Null/Empty/Invalid Values Representation', () => {
expect(dmData[1][0]).to.eql(DataModel.InvalidAwareTypes.NULL);
expect(dmData[1][2] instanceof DataModel.InvalidAwareTypes).to.be.true;
expect(dmData[1][2]).to.eql(DataModel.InvalidAwareTypes.NULL);
+ expect(dmData[1][2].value()).to.eql('null');
});
}); | #<I>: Added test case | chartshq_datamodel | train | js |
ce2d84d1f89bccff7916a6bde9d1cf6b52a3684b | diff --git a/lib/ios-deploy.js b/lib/ios-deploy.js
index <HASH>..<HASH> 100644
--- a/lib/ios-deploy.js
+++ b/lib/ios-deploy.js
@@ -51,7 +51,7 @@ class IOSDeploy {
try {
await appInstalledNotification;
} catch (e) {
- log.warn(`Couldn't get the application installed notification with ${APPLICATION_INSTALLED_NOTIFICATION}ms but we will continue`);
+ log.warn(`Couldn't get the application installed notification with ${APPLICATION_NOTIFICATION_TIMEOUT}ms but we will continue`);
}
} finally {
installationService.close();
@@ -79,7 +79,7 @@ class IOSDeploy {
try {
await B.all(promises).timeout(APPLICATION_PUSH_TIMEOUT);
} catch (e) {
- throw new Error(`Couldn't push all the files within the timeout ${APPLICATION_INSTALLED_NOTIFICATION}ms`);
+ throw new Error(`Couldn't push all the files within the timeout ${APPLICATION_PUSH_TIMEOUT}ms`);
}
log.debug(`Pushed the app files successfully after ${new Date() - start}ms`);
return bundlePathOnPhone; | fix: print the timeout ms instead of the wrong vars | appium_appium-xcuitest-driver | train | js |
595dfa67764a525bcff864e1ddc513496f1376df | diff --git a/microcosm_postgres/temporary/copy.py b/microcosm_postgres/temporary/copy.py
index <HASH>..<HASH> 100644
--- a/microcosm_postgres/temporary/copy.py
+++ b/microcosm_postgres/temporary/copy.py
@@ -4,6 +4,34 @@ Copy a table.
"""
from sqlalchemy import Table
+from microcosm_postgres.types import Serial
+
+
+def copy_column(column, schema):
+ """
+ Safely create a copy of a column.
+
+ """
+ return column.copy(schema=schema)
+
+
+def should_copy(column):
+ """
+ Determine if a column should be copied.
+
+ """
+ if not isinstance(column.type, Serial):
+ return True
+
+ if column.nullable:
+ return True
+
+ if not column.server_default:
+ return True
+
+ # do not create temporary serial values; they will be defaulted on upsert/insert
+ return False
+
def copy_table(from_table, name):
"""
@@ -20,8 +48,9 @@ def copy_table(from_table, name):
schema = metadata.schema
columns = [
- column.copy(schema=schema)
+ copy_column(column, schema)
for column in from_table.columns
+ if should_copy(column)
]
return Table( | Handle serial values on temporary table creation
Do not copy serial columns because they will be generated automatically
if and only they are omitted from the insert().select_from(). | globality-corp_microcosm-postgres | train | py |
f1310dbe3771b4cb964197a20e6f31e2740bd7bc | diff --git a/pex/testing.py b/pex/testing.py
index <HASH>..<HASH> 100644
--- a/pex/testing.py
+++ b/pex/testing.py
@@ -79,9 +79,6 @@ PROJECT_CONTENT = {
package_data={'my_package': ['package_data/*.dat']},
)
'''),
- 'MANIFEST.in': dedent('''
- include setup.py
- '''),
'scripts/hello_world': '#!/usr/bin/env python\nprint("hello world!")\n',
'scripts/shell_script': '#!/usr/bin/env bash\necho hello world\n',
'my_package/__init__.py': 0, | Remove crutch from pex.testing that was pasting over Packager bug. | pantsbuild_pex | train | py |
7c1932d325762e3fef9a4d29cc2a6703175cb560 | diff --git a/src/Base32.php b/src/Base32.php
index <HASH>..<HASH> 100644
--- a/src/Base32.php
+++ b/src/Base32.php
@@ -27,6 +27,10 @@
namespace SKleeschulte;
+use \InvalidArgumentException;
+use \RuntimeException;
+use \UnexpectedValueException;
+
/**
* Base32 encoding and decoding class.
* | Added use statements for exceptions. | skleeschulte_php-base32 | train | php |
83640a26404722f7c3882687ceb6dbadd5a40aa8 | diff --git a/src/client/voice/dispatcher/StreamDispatcher.js b/src/client/voice/dispatcher/StreamDispatcher.js
index <HASH>..<HASH> 100644
--- a/src/client/voice/dispatcher/StreamDispatcher.js
+++ b/src/client/voice/dispatcher/StreamDispatcher.js
@@ -199,10 +199,10 @@ class StreamDispatcher extends Writable {
const next = FRAME_LENGTH + (this.count * FRAME_LENGTH) - (Date.now() - this.startTime - this.pausedTime);
setTimeout(done.bind(this), next);
}
- if (this._sdata.sequence >= (2 ** 16) - 1) this._sdata.sequence = -1;
- if (this._sdata.timestamp >= (2 ** 32) - TIMESTAMP_INC) this._sdata.timestamp = -TIMESTAMP_INC;
this._sdata.sequence++;
this._sdata.timestamp += TIMESTAMP_INC;
+ if (this._sdata.sequence >= 2 ** 16) this._sdata.sequence = 0;
+ if (this._sdata.timestamp >= 2 ** 32) this._sdata.timestamp = 0;
this.count++;
} | refactor: tidier overflow checking in StreamDispatcher | discordjs_discord.js | train | js |
d915d82a42a479168b62b8bdbfd13a8622b29f90 | diff --git a/lib/application.js b/lib/application.js
index <HASH>..<HASH> 100644
--- a/lib/application.js
+++ b/lib/application.js
@@ -18,7 +18,7 @@ var Application = function (client) {
return client.makeRequest({
path : "applications",
method : "GET",
- body : params
+ qs : params
})
.then(function (response) {
return response.body; | Change body to qs in params | Bandwidth_node-bandwidth | train | js |
baf3d68e6f9b3dd76fccbc43cb01005e42eb5df1 | diff --git a/dataType.js b/dataType.js
index <HASH>..<HASH> 100644
--- a/dataType.js
+++ b/dataType.js
@@ -33,7 +33,7 @@ function Data(buffer,offset){
b = this.getUint8();
ret |= ((b & 127) << shift);
}
- return ret*shift;
+ return ret*sign;
};
this.getUint16 = function(){
var out = this.data.getUint16(this.offset,true);
@@ -56,4 +56,4 @@ function Data(buffer,offset){
return out;
};
}
-module.exports = Data;
\ No newline at end of file
+module.exports = Data; | Fix varint() for several bytes values
Completely untested, but there was an obvious error. | calvinmetcalf_fileGDB.js | train | js |
1dc835a961372760d32577fbf4586e6a7a4d9081 | diff --git a/lib/ronin/version.rb b/lib/ronin/version.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/version.rb
+++ b/lib/ronin/version.rb
@@ -19,5 +19,5 @@
module Ronin
# Ronin version
- VERSION = '1.1.0'
+ VERSION = '1.2.0'
end | Version bump to <I>. | ronin-ruby_ronin | train | rb |
046196b4c7d2b247899eb687a73a1aca8d233991 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -124,8 +124,8 @@ def get_version_info():
vinfo = _version_helper.generate_git_version_info()
except:
vinfo = vdummy()
- vinfo.version = '1.16.1'
- vinfo.release = 'True'
+ vinfo.version = '1.16.dev2'
+ vinfo.release = 'False'
with open('pycbc/version.py', 'w') as f:
f.write("# coding: utf-8\n") | Set back to development (#<I>) | gwastro_pycbc | train | py |
e7e15e62869e6df474c58f59aecf1165edbac616 | diff --git a/digitalocean/Droplet.py b/digitalocean/Droplet.py
index <HASH>..<HASH> 100644
--- a/digitalocean/Droplet.py
+++ b/digitalocean/Droplet.py
@@ -307,4 +307,11 @@ class Droplet(BaseAPI):
snapshot.id = id
snapshot.token = self.token
snapshots.append(snapshot)
- return snapshots
\ No newline at end of file
+ return snapshots
+
+ def get_kernel_available(self):
+ """
+ Get a list of kernels available
+ """
+ data = self.get_data("droplets/%s/kernels/" % self.id)
+ return data[u'kernels'] | Created a method to download the list of kernels available. | koalalorenzo_python-digitalocean | train | py |
a4e9ca8025ae2549b9f5f5e328a776e5936bbf63 | diff --git a/src/sync.js b/src/sync.js
index <HASH>..<HASH> 100644
--- a/src/sync.js
+++ b/src/sync.js
@@ -116,7 +116,7 @@ function handleError(m, key, error) {
// TODO: this should be configurable for each sync
if (key !== "sso") {
- const stopError = new Error("An error occurred when fetching data.");
+ const stopError = new Error(`An error occurred when fetching data. (key: ${key})`);
stopError.code = "sync";
stopError.origin = error;
result = l.stop(result, stopError); | Adding `key` to the error "An error occurred when fetching data" (#<I>) | auth0_lock | train | js |
678ad095a1286ab240e066cc2fa2fe09852c9798 | diff --git a/lib/collection/property.js b/lib/collection/property.js
index <HASH>..<HASH> 100644
--- a/lib/collection/property.js
+++ b/lib/collection/property.js
@@ -61,16 +61,21 @@ _.inherit((
*
* @type {String}
*/
- name: src.name,
+ name: src.name
+ });
+
+ if (definition && _.has(definition, 'disabled')) {
/**
* This (optional) flag denotes whether this property is disabled or not. Usually, this is helpful when a
* property is part of a {@link PropertyList}. For example, in a PropertyList of {@link Header}s, the ones
* that are disabled can be filtered out and not processed.
* @type {Boolean}
* @optional
+ *
+ * @memberOf Property.prototype
*/
- disabled: (definition && _.has(definition, 'disabled')) ? !!definition.disabled : undefined
- });
+ this.disabled = Boolean(definition.disabled);
+ }
// @todo: this is not a good way to create id if duplication check is required. decide.
// If this property is marked to require an ID, we generate one if not found. | Made the `disabled` key of properties be added only when one is provided in construction definition. Prevents object clutter | postmanlabs_postman-collection | train | js |
66139be8bbdd91af3dedd272bd17288ded06607f | diff --git a/parsl/monitoring/monitoring.py b/parsl/monitoring/monitoring.py
index <HASH>..<HASH> 100644
--- a/parsl/monitoring/monitoring.py
+++ b/parsl/monitoring/monitoring.py
@@ -261,7 +261,7 @@ class MonitoringHub(RepresentationMixin):
if isinstance(comm_q_result, str):
self.logger.error(f"MonitoringRouter sent an error message: {comm_q_result}")
- raise RuntimeError("MonitoringRouter failed to start: {comm_q_result}")
+ raise RuntimeError(f"MonitoringRouter failed to start: {comm_q_result}")
udp_dish_port, ic_port = comm_q_result | Add missing f for an f-string (#<I>) | Parsl_parsl | train | py |
18bacccb043045e089128af1814a6022530762e7 | diff --git a/lib/config.js b/lib/config.js
index <HASH>..<HASH> 100644
--- a/lib/config.js
+++ b/lib/config.js
@@ -873,7 +873,9 @@ exports.extend = function (newConf) {
});
if (config.headless) {
- config.noGlobalPlugins = true;
+ if (!config.pluginsMode) {
+ config.noGlobalPlugins = true;
+ }
config.pluginsOnlyMode = true;
config.disableWebUI = true;
delete config.rulesOnlyMode; | feat: allow global plugins in headless mode | avwo_whistle | train | js |
c287f86d0c0c8b0219dc6c8cabdbd384eb3db3cb | diff --git a/openquake/calculators/base.py b/openquake/calculators/base.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/base.py
+++ b/openquake/calculators/base.py
@@ -344,6 +344,7 @@ class HazardCalculator(BaseCalculator):
config.distribution.oq_distribute in ('no', 'futures') or
config.directory.shared_dir)
if self.oqparam.hazard_calculation_id and read_access:
+ self.datastore.parent.close() # make sure it is closed
return self.datastore.parent
def assoc_assets_sites(self, sitecol):
@@ -702,9 +703,9 @@ class RiskCalculator(HazardCalculator):
else: # gmf
getter = riskinput.GmfDataGetter(
dstore, sids, self.R, eids)
- # if dstore is self.datastore:
- # read the hazard data in the controller node
- getter.init() # READING ALWAYS UNTIL I DISCOVER THE BUG!
+ if dstore is self.datastore:
+ # read the hazard data in the controller node
+ getter.init()
ri = riskinput.RiskInput(getter, reduced_assets, reduced_eps)
if ri.weight > 0:
riskinputs.append(ri) | Made sure the parent is closed so it can be read from the workers [demos] [skip hazardlib]
Former-commit-id: <I>a2d<I>a9e<I>ba2dba<I>d<I>f<I> | gem_oq-engine | train | py |
d9289de1c4f5d4c5ec9beca39b0ef72e9bdf942a | diff --git a/app/config/bootstrap/g11n.php b/app/config/bootstrap/g11n.php
index <HASH>..<HASH> 100644
--- a/app/config/bootstrap/g11n.php
+++ b/app/config/bootstrap/g11n.php
@@ -75,7 +75,7 @@ Catalog::config(array(
'adapter' => 'Php',
'path' => LITHIUM_LIBRARY_PATH . '/lithium/g11n/resources/php'
)
-));
+) + Catalog::config());
/**
* Integration with `Inflector`. | Merge `Catalog` configurations with ones setup by i.e. plugins. | UnionOfRAD_framework | train | php |
65ec3f8c2fbf6d57dc274a6c20bbfd67568879a7 | diff --git a/src/Storage/Field/Type/TemplateFieldsType.php b/src/Storage/Field/Type/TemplateFieldsType.php
index <HASH>..<HASH> 100644
--- a/src/Storage/Field/Type/TemplateFieldsType.php
+++ b/src/Storage/Field/Type/TemplateFieldsType.php
@@ -52,8 +52,7 @@ class TemplateFieldsType extends FieldTypeBase
$key = $this->mapping['fieldname'];
$metadata = $this->buildMetadata($entity);
- $type = (string)$entity->getContenttype();
- $builder = $this->em->getEntityBuilder($type);
+ $builder = $this->em->getEntityBuilder(get_class($entity));
$builder->setClassMetadata($metadata);
$templatefieldsEntity = $builder->createFromDatabaseValues($value); | use the class, not the alias to fetch | bolt_bolt | train | php |
d52f8e7d4a346886790d0e6b75abd96be11a97b8 | diff --git a/spec/models/agent_spec.rb b/spec/models/agent_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/models/agent_spec.rb
+++ b/spec/models/agent_spec.rb
@@ -25,6 +25,12 @@ describe Agent do
do_not_allow(Agents::WebsiteAgent).async_check
Agent.run_schedule("blah")
end
+
+ it "will not run the 'never' schedule" do
+ agents(:bob_weather_agent).update_attribute 'schedule', 'never'
+ do_not_allow(Agents::WebsiteAgent).async_check
+ Agent.run_schedule("never")
+ end
end
describe "credential" do | add spec about "never" schedule | huginn_huginn | train | rb |
6ba75b2f5ead0b9c89540b8da78a64f3f45ce848 | diff --git a/code/libraries/koowa/libraries/dispatcher/http.php b/code/libraries/koowa/libraries/dispatcher/http.php
index <HASH>..<HASH> 100644
--- a/code/libraries/koowa/libraries/dispatcher/http.php
+++ b/code/libraries/koowa/libraries/dispatcher/http.php
@@ -35,12 +35,12 @@ class KDispatcherHttp extends KDispatcherAbstract implements KObjectMultiton
$this->_limit = $config->limit;
//Authenticate none safe requests
- $this->addCommandHandler('before.post' , '_authenticateRequest');
- $this->addCommandHandler('before.put' , '_authenticateRequest');
- $this->addCommandHandler('before.delete', '_authenticateRequest');
+ $this->addCommandCallback('before.post' , '_authenticateRequest');
+ $this->addCommandCallback('before.put' , '_authenticateRequest');
+ $this->addCommandCallback('before.delete', '_authenticateRequest');
//Sign GET request with a cookie token
- $this->addCommandHandler('after.get' , '_signResponse');
+ $this->addCommandCallback('after.get' , '_signResponse');
}
/** | re #<I> : Renamed command handler to command callback | joomlatools_joomlatools-framework | train | php |
19b45c6cbf1aa4efd7abbe9b3d6f5808b94d9e51 | diff --git a/app/controllers/sortable_controller.rb b/app/controllers/sortable_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/sortable_controller.rb
+++ b/app/controllers/sortable_controller.rb
@@ -12,6 +12,8 @@ class SortableController < ApplicationController
def reorder
ActiveRecord::Base.transaction do
params['rails_sortable'].each_with_index do |token, new_sort|
+ next unless token.present?
+
model = find_model(token)
current_sort = model.read_attribute(model.class.sort_attribute)
model.update_sort!(new_sort) if current_sort != new_sort | Handle sometimes missing token
Was getting vertification problems due to a blank entry coming in - so monkeypatched like this to fix | itmammoth_rails_sortable | train | rb |
4332ffc7a73d88bce3b9aa1020369b340a543738 | diff --git a/src/lib/config.js b/src/lib/config.js
index <HASH>..<HASH> 100644
--- a/src/lib/config.js
+++ b/src/lib/config.js
@@ -91,9 +91,7 @@ class Config {
// some weird shell scripts are valid yaml files parsed as string
assert.equal(typeof(config), 'object', 'CONFIG: it doesn\'t look like a valid config file');
- assert(self.storage, 'CONFIG: storage path not defined');
-
- // sanity check for strategic config properties
+ // sanity check for strategic config properties
strategicConfigProps.forEach(function(x) {
if (self[x] == null) self[x] = {};
assert(Utils.isObject(self[x]), `CONFIG: bad "${x}" value (object expected)`);
diff --git a/src/lib/local-storage.js b/src/lib/local-storage.js
index <HASH>..<HASH> 100644
--- a/src/lib/local-storage.js
+++ b/src/lib/local-storage.js
@@ -842,6 +842,7 @@ class LocalStorage implements IStorage {
const Storage = this._loadStorePlugin();
if (_.isNil(Storage)) {
+ assert(this.config.storage, 'CONFIG: storage path not defined');
return new LocalDatabase(this.config, logger);
} else {
return Storage; | fix: allow do not include storage if uses a storage plugin | verdaccio_verdaccio | train | js,js |
951a9de035e0597c2a29a062d92d7aaf366a4b62 | diff --git a/src/exp.js b/src/exp.js
index <HASH>..<HASH> 100755
--- a/src/exp.js
+++ b/src/exp.js
@@ -11,6 +11,7 @@ import url from 'url';
import program, { Command } from 'commander';
import {
+ Analytics,
Config,
Logger,
NotificationCode,
@@ -68,6 +69,8 @@ Command.prototype.asyncActionProjectDir = function(asyncFn) {
async function runAsync() {
try {
+ Analytics.setSegmentInstance('vGu92cdmVaggGA26s3lBX6Y5fILm8SQ7');
+ Analytics.setVersionName(require('../package.json').version);
_registerLogs();
if (process.env.SERVER_URL) { | Add segment to exp
fbshipit-source-id: <I>b2bbe | expo_exp | train | js |
28b65f98e605f31452ed353b3127f0b752c7b99d | diff --git a/upload/install/language/english.php b/upload/install/language/english.php
index <HASH>..<HASH> 100644
--- a/upload/install/language/english.php
+++ b/upload/install/language/english.php
@@ -108,7 +108,7 @@ $_['error_score'] = 'A score between 0 and 100 is accepted';
$_['error_db_hostname'] = 'Hostname required!';
$_['error_db_username'] = 'Username required!';
$_['error_db_database'] = 'Database Name required!';
-$_['error_db_prefix'] = 'DB Prefix can only contain lowercase characters in the a-z range, 0-9 and ""!';
+$_['error_db_prefix'] = 'DB Prefix can only contain lowercase characters in the a-z range, 0-9 and underscores';
$_['error_db_connect'] = 'Error: Could not connect to the database please make sure the database server, username and password is correct!';
$_['error_username'] = 'Username required!';
$_['error_password'] = 'Password required!'; | Slight change to language string for install. | opencart_opencart | train | php |
df97141635169ee0da600f0c66d4f06a14965ed3 | diff --git a/yasha.py b/yasha.py
index <HASH>..<HASH> 100644
--- a/yasha.py
+++ b/yasha.py
@@ -168,9 +168,6 @@ def cli(template, variables, extensions, output, no_variables, no_extensions, mm
varpath = find_variables(template.name, sum(filext, []))
variables = click.open_file(varpath, "rb") if varpath else None
- if variables and not no_variables:
- vardict = parse_variables(variables, extdict["variable_parsers"])
-
if mm:
if mt:
deps = mt + ": "
@@ -182,7 +179,10 @@ def cli(template, variables, extensions, output, no_variables, no_extensions, mm
if extensions:
deps += os.path.relpath(extensions.name)
click.echo(deps)
- exit(0)
+ return
+
+ if variables and not no_variables:
+ vardict = parse_variables(variables, extdict["variable_parsers"])
jinja = load_jinja(t_dirname, extdict)
t = jinja.get_template(t_basename) | No need to parse variables if only Make dependencies are required | kblomqvist_yasha | train | py |
1208122418a843694fe8efa842c03c844812d5d4 | diff --git a/src/main/java/com/helger/commons/xml/schema/IHasSchema.java b/src/main/java/com/helger/commons/xml/schema/IHasSchema.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/helger/commons/xml/schema/IHasSchema.java
+++ b/src/main/java/com/helger/commons/xml/schema/IHasSchema.java
@@ -17,11 +17,12 @@
package com.helger.commons.xml.schema;
import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import javax.xml.validation.Schema;
/**
* A simple interface, indicating that an item has a Schema object.
- *
+ *
* @author Philip Helger
*/
public interface IHasSchema
@@ -31,4 +32,13 @@ public interface IHasSchema
*/
@Nonnull
Schema getSchema ();
+
+ /**
+ * @param aClassLoader
+ * The class loader to be used. May be <code>null</code> indicating
+ * that the default class loader should be used.
+ * @return The non-<code>null</code> Schema object
+ */
+ @Nonnull
+ Schema getSchema (@Nullable ClassLoader aClassLoader);
} | Added special version with ClassLoader | phax_ph-commons | train | java |
74c70fbacfe448168e587f3705d968479a5ef94e | diff --git a/sendyLibrary.php b/sendyLibrary.php
index <HASH>..<HASH> 100644
--- a/sendyLibrary.php
+++ b/sendyLibrary.php
@@ -4,19 +4,24 @@
*/
class SendyLibrary
{
- private $installation_url = 'http://updates.mydomain.com';
- private $api_key = 'yourapiKEYHERE';
+ private $installation_url;
+ private $api_key;
private $list_id;
- function __construct($list_id)
+ function __construct(array $config)
{
//error checking
+ $list_id = @$config['list_id'];
+ $installation_url = @$config['installation_url'];
+ $api_key = @$config['api_key'];
+
if (!isset($list_id)) {throw new Exception("Required config parameter [list_id] is not set", 1);}
- if (!isset($this->installation_url)) {throw new Exception("Required config parameter [installation_url] is not set", 1);}
- if (!isset($this->api_key)) {throw new Exception("Required config parameter [api_key] is not set", 1);}
+ if (!isset($installation_url)) {throw new Exception("Required config parameter [installation_url] is not set", 1);}
+ if (!isset($api_key)) {throw new Exception("Required config parameter [api_key] is not set", 1);}
$this->list_id = $list_id;
-
+ $this->installation_url = $installation_url;
+ $this->api_key = $api_key;
}
public function subscribe(array $values) { | Updating the constructor to accept configs for other variables | JacobBennett_SendyPHP | train | php |
17176b7d2315eaf425847501aecbe4eb995502fc | diff --git a/src/Illuminate/Foundation/Testing/DatabaseTransactions.php b/src/Illuminate/Foundation/Testing/DatabaseTransactions.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Foundation/Testing/DatabaseTransactions.php
+++ b/src/Illuminate/Foundation/Testing/DatabaseTransactions.php
@@ -19,7 +19,10 @@ trait DatabaseTransactions
$this->beforeApplicationDestroyed(function () use ($database) {
foreach ($this->connectionsToTransact() as $name) {
- $database->connection($name)->rollBack();
+ $connection = $database->connection($name);
+
+ $connection->rollBack();
+ $connection->disconnect();
}
});
} | Terminate user defined database connections after rollback during testing while using the DatabaseTransactions trait. (#<I>) | laravel_framework | train | php |
1dd4f03412099bfc6dd6df2854e6a00b3c4f7500 | diff --git a/src/extensibility/Package.js b/src/extensibility/Package.js
index <HASH>..<HASH> 100644
--- a/src/extensibility/Package.js
+++ b/src/extensibility/Package.js
@@ -248,7 +248,7 @@ define(function (require, exports, module) {
// Download the bits (using Node since brackets-shell doesn't support binary file IO)
var r = extensionManager.downloadFile(downloadId, urlInfo.url);
r.done(function (result) {
- d.resolve({ localPath: result, filenameHint: urlInfo.filenameHint });
+ d.resolve({ localPath: FileUtils.convertWindowsPathToUnixPath(result), filenameHint: urlInfo.filenameHint });
}).fail(function (err) {
d.reject(err);
}); | Fix #<I>. Bracketize Win paths returned by node. | adobe_brackets | train | js |
2a892581ae25ded134913eb9ae1f449230632767 | diff --git a/object/assign-deep.js b/object/assign-deep.js
index <HASH>..<HASH> 100644
--- a/object/assign-deep.js
+++ b/object/assign-deep.js
@@ -8,15 +8,24 @@ var includes = require("../array/#/contains")
var isArray = Array.isArray, slice = Array.prototype.slice;
+var assignObject = function (target, source) {
+ // eslint-disable-next-line no-use-before-define
+ objForEach(source, function (value, key) { target[key] = deepAssign(target[key], value); });
+};
+
+var assignArray = function (target, source) {
+ source.forEach(function (item) { if (!includes.call(target, item)) target.push(item); });
+};
+
var deepAssign = function (target, source) {
if (isPlainObject(target)) {
if (!isPlainObject(source)) return source;
- objForEach(source, function (value, key) { target[key] = deepAssign(target[key], value); });
+ assignObject(target, source);
return target;
}
if (isArray(target)) {
if (!isArray(source)) return source;
- source.forEach(function (item) { if (!includes.call(target, item)) target.push(item); });
+ assignArray(target, source);
return target;
}
return source; | refactor: seclude assign logic | medikoo_es5-ext | train | js |
508b76d94f20b5e7488251dd22915dd0ad7845c4 | diff --git a/lib/setup.php b/lib/setup.php
index <HASH>..<HASH> 100644
--- a/lib/setup.php
+++ b/lib/setup.php
@@ -225,15 +225,17 @@ global $HTTPSPAGEREQUIRED;
* If $SITE global from {@link get_site()} is set then SITEID to $SITE->id, otherwise set to 1.
*/
define('SITEID', $SITE->id);
+ /// And the 'default' course
+ $COURSE = clone($SITE); // For now. This will usually get reset later in require_login() etc.
} else {
/**
* @ignore
*/
define('SITEID', 1);
- define('COURSEID', 1);
+ /// And the 'default' course
+ $COURSE = new object; // no site created yet
+ $COURSE->id = 1;
}
-/// And the 'default' course
- $COURSE = clone($SITE); // For now. This will usually get reset later in require_login() etc.
/// Set a default enrolment configuration (see bug 1598) | fixed warning from clone($SITE) during site setup; merged from MOODLE_<I>_STABLE | moodle_moodle | train | php |
eba8aec742828eea0f6bcf8247eb0a920c875bb2 | diff --git a/libraries/lithium/tests/cases/console/command/create/TestTest.php b/libraries/lithium/tests/cases/console/command/create/TestTest.php
index <HASH>..<HASH> 100644
--- a/libraries/lithium/tests/cases/console/command/create/TestTest.php
+++ b/libraries/lithium/tests/cases/console/command/create/TestTest.php
@@ -27,6 +27,7 @@ class TestTest extends \lithium\test\Unit {
}
public function setUp() {
+ Libraries::cache(false);
$this->classes = array('response' => '\lithium\tests\mocks\console\MockResponse');
$this->_backup['cwd'] = getcwd();
$this->_backup['_SERVER'] = $_SERVER; | `\console\command\create\Test` test: clearing Libraries cache | UnionOfRAD_framework | train | php |
d633dc9cc6ba8e73187da8520c9436835dc1a081 | diff --git a/test/distro/distroSpec.js b/test/distro/distroSpec.js
index <HASH>..<HASH> 100644
--- a/test/distro/distroSpec.js
+++ b/test/distro/distroSpec.js
@@ -1,9 +1,10 @@
describe('distro', function() {
it('should expose CJS bundle', function() {
- const BpmnJSBpmnlint = require('../..');
+ const BpmnJSBpmnlint = require('../../dist/index.js');
expect(BpmnJSBpmnlint).to.exist;
+ expect(BpmnJSBpmnlint.__init__).to.exist;
});
@@ -11,6 +12,7 @@ describe('distro', function() {
const BpmnJSBpmnlint = require('../../dist/bpmn-js-bpmnlint.umd.js');
expect(BpmnJSBpmnlint).to.exist;
+ expect(BpmnJSBpmnlint.__init__).to.exist;
});
}); | test: verify CJS and UMD exports | bpmn-io_bpmn-js-bpmnlint | train | js |
893be528e64833e37b58644efb0a120df16359ff | diff --git a/src/fields.js b/src/fields.js
index <HASH>..<HASH> 100644
--- a/src/fields.js
+++ b/src/fields.js
@@ -1,7 +1,13 @@
const Field = class Field {
- constructor(toModelName, relatedName) {
- this.toModelName = toModelName;
- this.relatedName = relatedName;
+ constructor(...args) {
+ if (args.length === 1 && typeof args[0] === 'object') {
+ const opts = args[0];
+ this.toModelName = opts.to;
+ this.relatedName = opts.relatedName;
+ } else {
+ this.toModelName = args[0];
+ this.relatedName = args[1];
+ }
}
}; | Accept options object to field declarations in a backwards-compatible manner | redux-orm_redux-orm | train | js |
582660b3f297cb31a7fd7102b8db47d1c19e0e2a | diff --git a/lib/IntercomError.js b/lib/IntercomError.js
index <HASH>..<HASH> 100644
--- a/lib/IntercomError.js
+++ b/lib/IntercomError.js
@@ -26,10 +26,11 @@ util.inherits(AbstractError, Error);
*
* @api private
*/
-function IntercomError(message) {
+function IntercomError(message, errors) {
AbstractError.apply(this, arguments);
this.name = 'IntercomError';
this.message = message;
+ this.errors = data.errors;
}
/**
diff --git a/lib/intercom.io.js b/lib/intercom.io.js
index <HASH>..<HASH> 100644
--- a/lib/intercom.io.js
+++ b/lib/intercom.io.js
@@ -135,10 +135,12 @@ Intercom.prototype.request = function(method, path, parameters, cb) {
parsed = JSON.parse(data);
if (parsed && (parsed.error || parsed.errors)) {
- err = new IntercomError(data);
+ var errorCodes = '"' + parsed.errors.map(function (error) {
+ return error.code;
+ }).join('", "') + '"';
// Reject the promise
- return deferred.reject(err);
+ return deferred.reject(new IntercomError(errorCodes + ' error(s) from Intercom', parsed.errors));
}
} catch (exception) {
// Reject the promise | Store the error details in IntercomError | tarunc_intercom.io | train | js,js |
689bd9fb26987a5c285b5cf2e6e8a97ec836f4b5 | diff --git a/ledger/__metadata__.py b/ledger/__metadata__.py
index <HASH>..<HASH> 100644
--- a/ledger/__metadata__.py
+++ b/ledger/__metadata__.py
@@ -1,7 +1,7 @@
"""
Ledger package metadata
"""
-__version_info__ = (0, 0, 12)
+__version_info__ = (0, 0, 13)
__version__ = '{}.{}.{}'.format(*__version_info__)
__author__ = "Evernym, Inc."
__license__ = "Apache 2.0" | [#<I>] incremented version number | hyperledger-archives_indy-ledger | train | py |
80a64120ab0fdaa7769548fa5e7d30745c24c378 | diff --git a/lib/rules/require-strict-equality-operators.js b/lib/rules/require-strict-equality-operators.js
index <HASH>..<HASH> 100644
--- a/lib/rules/require-strict-equality-operators.js
+++ b/lib/rules/require-strict-equality-operators.js
@@ -13,9 +13,7 @@ module.exports.prototype =
, lint: function (file, errors) {
- file.iterateTokensByFilter(function (token) {
- return token.type === 'code' && token.requiresBlock
- }, function (token) {
+ file.iterateTokensByType([ 'if', 'else-if' ], function (token) {
var regex = /([!=]=)(.)/
, match = token.val.match(regex)
, operator | Refactor `requireStrictEqualityOperators` to handle new token structure | pugjs_pug-lint | train | js |
8edff51592efb004ddaa3bcf5a1b0f85be79d648 | diff --git a/chai-immutable.js b/chai-immutable.js
index <HASH>..<HASH> 100644
--- a/chai-immutable.js
+++ b/chai-immutable.js
@@ -1,6 +1,6 @@
-(function () {
- 'use strict';
+'use strict';
+(function () {
if (typeof require === 'function' &&
typeof exports === 'object' &&
typeof module === 'object') { | Make sure strictness is applied everywhere in the plugin | astorije_chai-immutable | train | js |
c40ded0c12f4642b13123ba0e5d7170676ab850d | diff --git a/server/export.js b/server/export.js
index <HASH>..<HASH> 100644
--- a/server/export.js
+++ b/server/export.js
@@ -35,6 +35,15 @@ export default async function (dir, options) {
join(outDir, '_next', buildStats['app.js'].hash, 'app.js')
)
+ // Copy static directory
+ if (existsSync(join(dir, 'static'))) {
+ log(' copying "static" directory')
+ await cp(
+ join(dir, 'static'),
+ join(outDir, 'static')
+ )
+ }
+
await copyPages(nextDir, outDir, buildId)
// Get the exportPathMap from the `next.config.js` | Copy the static directory for static file serving. | zeit_next.js | train | js |
077c628734fe9d9bbab16b0072ffb292852b42f8 | diff --git a/lib/Drivers/DML/sqlite.js b/lib/Drivers/DML/sqlite.js
index <HASH>..<HASH> 100644
--- a/lib/Drivers/DML/sqlite.js
+++ b/lib/Drivers/DML/sqlite.js
@@ -12,7 +12,7 @@ function Driver(config, connection, opts) {
this.db = connection;
} else {
// on Windows, paths have a drive letter which is parsed by
- // url.parse() has the hostname. If host is defined, assume
+ // url.parse() as the hostname. If host is defined, assume
// it's the drive letter and add ":"
this.db = new sqlite3.Database(((config.host ? config.host + ":" : "") + (config.pathname || "")) || ':memory:');
} | Fixes typo in sqlite3 driver | dresende_node-orm2 | train | js |
afb6d2dcb1e304ac4add67ba72b9cb60c054c4d7 | diff --git a/lib/metamorpher/drivers/ruby.rb b/lib/metamorpher/drivers/ruby.rb
index <HASH>..<HASH> 100644
--- a/lib/metamorpher/drivers/ruby.rb
+++ b/lib/metamorpher/drivers/ruby.rb
@@ -59,7 +59,7 @@ module Metamorpher
# omitting a necessary keyword. Note that these are the symbols produced
# by Parser which are not necessarily the same as Ruby keywords (e.g.,
# Parser sometimes produces a :zsuper node for a program of the form "super")
- @keywords ||= %i(nil false true self array)
+ @keywords ||= %i(nil false true self array hash)
end
def ast_for(literal)
diff --git a/spec/unit/drivers/ruby_spec.rb b/spec/unit/drivers/ruby_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/drivers/ruby_spec.rb
+++ b/spec/unit/drivers/ruby_spec.rb
@@ -87,7 +87,7 @@ module Metamorpher
end
end
- { "[]" => :array }.each do |ruby_literal, type|
+ { "[]" => :array, "{}" => :hash }.each do |ruby_literal, type|
describe "for a program containing the '#{ruby_literal}' Ruby literal" do
let(:source) { "a = #{ruby_literal}" }
let(:metamorpher_literal) { builder.lvasgn(:a, type) } | Fix bug in unparsing Ruby code with {} literal. | ruby-mutiny_metamorpher | train | rb,rb |
2545ddd3dd6cdc46a3aef340cd26cf23460a4708 | diff --git a/js/src/files.js b/js/src/files.js
index <HASH>..<HASH> 100644
--- a/js/src/files.js
+++ b/js/src/files.js
@@ -559,7 +559,7 @@ module.exports = (common) => {
})
})
- it('exports a chunk of a file', (done) => {
+ it('exports a chunk of a file', function (done) {
if (withGo) { this.skip() }
const offset = 1
@@ -589,7 +589,7 @@ module.exports = (common) => {
}))
})
- it('exports a chunk of a file in a ReadableStream', (done) => {
+ it('exports a chunk of a file in a ReadableStream', function (done) {
if (withGo) { this.skip() }
const offset = 1
@@ -625,7 +625,7 @@ module.exports = (common) => {
)
})
- it('exports a chunk of a file in a PullStream', (done) => {
+ it('exports a chunk of a file in a PullStream', function (done) {
if (withGo) { this.skip() }
const offset = 1 | fix: this.skip needs to be under a function declaration | ipfs_interface-js-ipfs-core | train | js |
f75aaf14123e407d8370c956c7305217625a3a3d | diff --git a/client/extjs/src/panel/attribute/ItemUi.js b/client/extjs/src/panel/attribute/ItemUi.js
index <HASH>..<HASH> 100644
--- a/client/extjs/src/panel/attribute/ItemUi.js
+++ b/client/extjs/src/panel/attribute/ItemUi.js
@@ -89,7 +89,7 @@ MShop.panel.attribute.ItemUi = Ext.extend(MShop.panel.AbstractItemUi, {
allowBlank : false,
emptyText : _('Attribute code (required)')
}, {
- xtype : 'textarea',
+ xtype : 'textfield',
fieldLabel : _('Label'),
name : 'attribute.label',
allowBlank : false, | Changes attribute label from text area to text field | Arcavias_arcavias-core | train | js |
6e86d12fc76e2bc34622c95dc0853f00c0a70c7d | diff --git a/lib/action_controller/parameters.rb b/lib/action_controller/parameters.rb
index <HASH>..<HASH> 100644
--- a/lib/action_controller/parameters.rb
+++ b/lib/action_controller/parameters.rb
@@ -1,7 +1,7 @@
require 'active_support/core_ext/hash/indifferent_access'
module ActionController
- class ParameterMissing < RuntimeError
+ class ParameterMissing < IndexError
end
class Parameters < ActiveSupport::HashWithIndifferentAccess | use IndexError to be closer to hash fetch | rails_strong_parameters | train | rb |
90117f01359b32affbddd5bb649ca468ea2af30c | diff --git a/lib/endpoints/class-wp-rest-comments-controller.php b/lib/endpoints/class-wp-rest-comments-controller.php
index <HASH>..<HASH> 100755
--- a/lib/endpoints/class-wp-rest-comments-controller.php
+++ b/lib/endpoints/class-wp-rest-comments-controller.php
@@ -360,11 +360,11 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
$error_code = $prepared_comment['comment_approved']->get_error_code();
$error_message = $prepared_comment['comment_approved']->get_error_message();
- if ( $error_code === 'comment_duplicate' ) {
+ if ( 'comment_duplicate' === $error_code ) {
return new WP_Error( $error_code, $error_message, array( 'status' => 409 ) );
}
- if ( $error_code === 'comment_flood' ) {
+ if ( 'comment_flood' === $error_code ) {
return new WP_Error( $error_code, $error_message, array( 'status' => 400 ) );
} | Use Yoda Condition checks, you must | WP-API_WP-API | train | php |
476013cbede26aa4bfe5c0ec373bd80b306e4540 | diff --git a/lib/chef/knife/core/ui.rb b/lib/chef/knife/core/ui.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/knife/core/ui.rb
+++ b/lib/chef/knife/core/ui.rb
@@ -172,7 +172,7 @@ class Chef
tf.sync = true
tf.puts output
tf.close
- raise "Please set EDITOR environment variable. See https://docs.chef.io/knife_using.html for details." unless system("#{config[:editor]} #{tf.path}")
+ raise "Please set EDITOR environment variable. See https://docs.chef.io/knife_setup.html for details." unless system("#{config[:editor]} #{tf.path}")
output = IO.read(tf.path)
end
diff --git a/lib/chef/knife/edit.rb b/lib/chef/knife/edit.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/knife/edit.rb
+++ b/lib/chef/knife/edit.rb
@@ -58,7 +58,7 @@ class Chef
# Let the user edit the temporary file
if !system("#{config[:editor]} #{file.path}")
- raise "Please set EDITOR environment variable. See https://docs.chef.io/knife_using.html for details."
+ raise "Please set EDITOR environment variable. See https://docs.chef.io/knife_setup.html for details."
end
result_text = IO.read(file.path) | Update the knife editor error message to point to the correct document
I updated the structure of the knife documentation a while back and we have a dedicated doc for setting up knife now. | chef_chef | train | rb,rb |
6ce3468eec61d5d8c760eb8bfdd8a14c75f3703d | diff --git a/src/unicode-decomposition.js b/src/unicode-decomposition.js
index <HASH>..<HASH> 100644
--- a/src/unicode-decomposition.js
+++ b/src/unicode-decomposition.js
@@ -37,6 +37,11 @@ const MAP_CONVERSION = {
'—': '-',
'―': '-',
/**
+ * @internal Normalizations (MELINDA-4172, MELINDA-4175)
+ **/
+ 'Ⓒ': '©',
+ 'Ⓟ': '℗',
+ /**
* @internal Precompose å, ä, ö, Å, Ä and Ö
**/
å: 'å',
@@ -52,6 +57,9 @@ const MAP_CONVERSION = {
à: 'à',
â: 'â',
ã: 'ã',
+ ć: 'ć',
+ č: 'č',
+ ç: 'ç',
é: 'é',
è: 'è',
ê: 'ê',
@@ -68,6 +76,7 @@ const MAP_CONVERSION = {
ô: 'ô',
õ: 'õ',
ś: 'ś',
+ š: 'š',
ú: 'ú',
ù: 'ù',
û: 'û',
@@ -78,6 +87,7 @@ const MAP_CONVERSION = {
ŷ: 'ŷ',
ỹ: 'ỹ',
ÿ: 'ÿ',
+ ž: 'ž',
Á: 'Á',
À: 'À',
Â: 'Â', | Normalize Ⓒ and Ⓟ. Decompose c-cedilla and few other consonants. | NatLibFi_marc-record-validators-melinda | train | js |
862f7b1a3f9920bf3816d1e851182eceea5fc6b9 | diff --git a/data/__init__.py b/data/__init__.py
index <HASH>..<HASH> 100644
--- a/data/__init__.py
+++ b/data/__init__.py
@@ -1,3 +1,5 @@
+__version__ = '0.2.dev1'
+
from six import text_type, PY2 | Added __version__ string. | mbr_data | train | py |
d809f273b11a8c09416cb6d0032f4fa1d220dfd9 | diff --git a/dciclient/v1/tests/shell_commands/utils.py b/dciclient/v1/tests/shell_commands/utils.py
index <HASH>..<HASH> 100644
--- a/dciclient/v1/tests/shell_commands/utils.py
+++ b/dciclient/v1/tests/shell_commands/utils.py
@@ -121,6 +121,29 @@ def provision(db_conn):
team_admin_id = db_insert(models.TEAMS, name='admin')
team_user_id = db_insert(models.TEAMS, name='user')
+ # Create the three mandatory roles
+ super_admin_role = {
+ 'name': 'Super Admin',
+ 'label': 'SUPER_ADMIN',
+ 'description': 'Admin of the platform',
+ }
+
+ admin_role = {
+ 'name': 'Admin',
+ 'label': 'ADMIN',
+ 'description': 'Admin of a team',
+ }
+
+ user_role = {
+ 'name': 'User',
+ 'label': 'USER',
+ 'description': 'Regular User',
+ }
+
+ db_insert(models.ROLES, **admin_role)
+ db_insert(models.ROLES, **user_role)
+ db_insert(models.ROLES, **super_admin_role)
+
# Create users
db_insert(models.USERS, name='user', role='user', password=user_pw_hash,
team_id=team_user_id) | Roles: Create mandatory role in the dataset
This commit aims to create the mandatory roles in the dataset used to
run the test suite.
Change-Id: I<I>a<I>ad1d<I>fdaba<I>c<I>d<I>db<I>e<I>a5d | redhat-cip_python-dciclient | train | py |
bfea7555fb4596cac2791f2855bde5ebb69f086d | diff --git a/src/etc/roles/literal/regionRole.js b/src/etc/roles/literal/regionRole.js
index <HASH>..<HASH> 100644
--- a/src/etc/roles/literal/regionRole.js
+++ b/src/etc/roles/literal/regionRole.js
@@ -11,6 +11,7 @@ const regionRole: ARIARoleDefinition = {
],
props: {},
relatedConcepts: [
+ // frame tag on html5 is deprecated
{
module: 'HTML',
concept: {
@@ -18,6 +19,12 @@ const regionRole: ARIARoleDefinition = {
},
},
{
+ module: 'HTML',
+ concept: {
+ name: 'section',
+ },
+ },
+ {
concept: {
name: 'Device Independence Glossart perceivable unit',
},
@@ -42,4 +49,4 @@ const regionRole: ARIARoleDefinition = {
],
};
-export default regionRole;
\ No newline at end of file
+export default regionRole; | frame tag is deprecated in html5, should add support to section tag | A11yance_aria-query | train | js |
0ef6ef8742c0dc4e98753d04852aa13ac654793e | diff --git a/config/sentry.php b/config/sentry.php
index <HASH>..<HASH> 100644
--- a/config/sentry.php
+++ b/config/sentry.php
@@ -36,6 +36,7 @@ return array(
'users_groups' => 'users_groups',
'users_metadata' => 'users_metadata',
'users_suspended' => 'users_suspended',
+ 'rules' => 'rules',
),
/*
@@ -151,6 +152,15 @@ return array(
'superuser' => 'superuser',
/**
+ * Source of defined rules
+ * Possible choices: file / database.
+ * If file is chosen it reads the rules from config/sentry.php's permissions->rules array
+ * If database is chosen it reads the rules from the rules table defined in the table array
+ *
+ */
+ 'rules_source' => 'file';
+
+ /**
* The permission rules file
* Must return an array with a 'rules' key.
*/
@@ -172,6 +182,8 @@ return array(
),
/**
+ * !Ignored if database is selected instead of file!
+ *
* setup rules for permissions
* These are resources that will require access permissions.
* Rules are assigned to groups or specific users in the | Modified the configurations, now supports rules stored in the database | cartalyst_sentry | train | php |
08787b7b2ba696e8865a5a52c41dc7a43b34faf6 | diff --git a/eulfedora/server.py b/eulfedora/server.py
index <HASH>..<HASH> 100644
--- a/eulfedora/server.py
+++ b/eulfedora/server.py
@@ -124,6 +124,7 @@ class Repository(object):
default_object_type = DigitalObject
"Default type to use for methods that return fedora objects - :class:`DigitalObject`"
+ default_pidspace = None
search_fields = ['pid', 'label', 'state', 'ownerId', 'cDate', 'mDate',
'dcmDate', 'title', 'creator', 'subject', 'description', 'publisher', | define a default pidspace of None for server, to simplify passing default pidspace to DigitalObject | emory-libraries_eulfedora | train | py |
89459d808c2d0b651b729758d4f61a587567ce8a | diff --git a/platform/html5/html.js b/platform/html5/html.js
index <HASH>..<HASH> 100644
--- a/platform/html5/html.js
+++ b/platform/html5/html.js
@@ -68,6 +68,8 @@ StyleCache.prototype.classify = function(rules) {
}
var _modernizrCache = {}
+if (navigator.userAgent.toLowerCase().indexOf('webkit') >= 0)
+ _modernizrCache['appearance'] = '-webkit-appearance'
var getPrefixedName = function(name) {
var prefixedName = _modernizrCache[name] | Hack for unstandard '-webkit-appearance' property. | pureqml_qmlcore | train | js |
66e7b4343eec8668c37cf4b4f30ee4f740c233a1 | diff --git a/spec/helpers/canonical_rails/tag_helper_spec.rb b/spec/helpers/canonical_rails/tag_helper_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/helpers/canonical_rails/tag_helper_spec.rb
+++ b/spec/helpers/canonical_rails/tag_helper_spec.rb
@@ -4,7 +4,7 @@ describe CanonicalRails::TagHelper do
before(:each) do
controller.request.host = 'www.alternative-domain.com'
- controller.request.path = 'our_resources'
+ controller.request.path = '/our_resources'
end
after(:each) do | spec: path should include a leading slash | jumph4x_canonical-rails | train | rb |
44d5ec57857777f7b57bb78a22f972ba980a6223 | diff --git a/src/Template/Pats/Pats.php b/src/Template/Pats/Pats.php
index <HASH>..<HASH> 100644
--- a/src/Template/Pats/Pats.php
+++ b/src/Template/Pats/Pats.php
@@ -73,7 +73,7 @@ EOT;
*/
public static function addPats(array $pats)
{
- self::$pats = $pats + self::$pats;
+ self::$pats = $pats + self::getPats();
}
/**
@@ -85,11 +85,12 @@ EOT;
*/
public static function get($name)
{
- if (!isset(self::$pats[$name])) {
+ $pats = self::getPats();
+ if (!isset($pats[$name])) {
throw new \InvalidArgumentException(sprintf('Pat named "%s" doesn\'t exist', $name));
}
- return self::$pats[$name];
+ return $pats[$name];
}
/**
@@ -97,6 +98,8 @@ EOT;
*/
public static function getRandomPatName()
{
- return self::$pats[array_rand(array_keys(self::$pats))];
+ $pats = self::getPats();
+
+ return array_rand($pats);
}
} | Fixes at `Pats` | gushphp_gush | train | php |
877445946482763f060a34d0430a867d5977caf2 | diff --git a/src/com/joml/Matrix4f.java b/src/com/joml/Matrix4f.java
index <HASH>..<HASH> 100644
--- a/src/com/joml/Matrix4f.java
+++ b/src/com/joml/Matrix4f.java
@@ -1545,9 +1545,9 @@ public class Matrix4f implements Serializable, Externalizable {
float h = (float)Math.tan(Math.toRadians(fovy) * 0.5f) * zNear;
float w = h * aspect;
float fl = -w;
- float fr = fl + 2.0f * w;
+ float fr = +w;
float fb = -h;
- float ft = fb + 2.0f * h;
+ float ft = +h;
return frustum(fl, fr, fb, ft, zNear, zFar);
} | Simpler computation of perspective frustum | JOML-CI_JOML | train | java |
03a3361e11ee9feda01ce16a5132c738fc0cafbb | diff --git a/flurs/tests/test_evaluator.py b/flurs/tests/test_evaluator.py
index <HASH>..<HASH> 100644
--- a/flurs/tests/test_evaluator.py
+++ b/flurs/tests/test_evaluator.py
@@ -12,7 +12,7 @@ class EvaluatorTestCase(TestCase):
def setUp(self):
recommender = Popular()
recommender.init_recommender()
- self.evaluator = Evaluator(recommender, repeat=False)
+ self.evaluator = Evaluator(recommender=recommender, repeat=False)
self.samples = [Event(User(0), Item(0), 1),
Event(User(0), Item(1), 1), | Explicitly pass `recommender` to Evaluator | takuti_flurs | train | py |
ea00ab9919040c378394b96301c9988566fb249d | diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizer.java
index <HASH>..<HASH> 100644
--- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizer.java
+++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizer.java
@@ -186,7 +186,13 @@ public class TomcatWebServerFactoryCustomizer
// The internal proxies default to a white list of "safe" internal IP
// addresses
valve.setInternalProxies(tomcatProperties.getInternalProxies());
- valve.setHostHeader(tomcatProperties.getHostHeader());
+ try {
+ valve.setHostHeader(tomcatProperties.getHostHeader());
+ }
+ catch (NoSuchMethodError ex) {
+ // Avoid failure with war deployments to Tomcat 8.5 before 8.5.44 and
+ // Tomcat 9 before 9.0.23
+ }
valve.setPortHeader(tomcatProperties.getPortHeader());
valve.setProtocolHeaderHttpsValue(tomcatProperties.getProtocolHeaderHttpsValue());
// ... so it's safe to add this valve by default. | Protect against NoSuchMethodError when deploying to old Tomcats
Fixes gh-<I> | spring-projects_spring-boot | train | java |
c15d3dac99805af05a387464345c1719996051da | diff --git a/main.go b/main.go
index <HASH>..<HASH> 100644
--- a/main.go
+++ b/main.go
@@ -36,6 +36,7 @@ func (d *Daemon) RunClient() (err error) {
}
func (d *Daemon) Run() (err error) {
+ G.Daemon = true
if err = d.ConfigRpcServer(); err != nil {
return
} | say we're a daemon | keybase_client | train | go |
def6c16f9939b8e39e3ab69854321ffc6430c094 | diff --git a/libkbfs/config_local.go b/libkbfs/config_local.go
index <HASH>..<HASH> 100644
--- a/libkbfs/config_local.go
+++ b/libkbfs/config_local.go
@@ -1221,6 +1221,10 @@ func (c *ConfigLocal) Shutdown(ctx context.Context) error {
if dbc != nil {
dbc.Shutdown(ctx)
}
+ dmc := c.DiskMDCache()
+ if dmc != nil {
+ dmc.Shutdown(ctx)
+ }
kbfsServ := c.kbfsService
if kbfsServ != nil {
kbfsServ.Shutdown()
diff --git a/libkbfs/disk_md_cache.go b/libkbfs/disk_md_cache.go
index <HASH>..<HASH> 100644
--- a/libkbfs/disk_md_cache.go
+++ b/libkbfs/disk_md_cache.go
@@ -470,6 +470,7 @@ func (cache *DiskMDCacheLocal) Shutdown(ctx context.Context) {
select {
case <-cache.shutdownCh:
cache.log.CWarningf(ctx, "Shutdown called more than once")
+ return
default:
}
close(cache.shutdownCh) | config_local: shutdown disk md cache
Otherwise each singleop git operation will leave one open. | keybase_client | train | go,go |
e8bdf8384a55de3389f7279068cd7fcedbd5526d | diff --git a/lib/kaminari/helpers/action_view_extension.rb b/lib/kaminari/helpers/action_view_extension.rb
index <HASH>..<HASH> 100644
--- a/lib/kaminari/helpers/action_view_extension.rb
+++ b/lib/kaminari/helpers/action_view_extension.rb
@@ -86,16 +86,10 @@ module Kaminari
# <%= page_entries_info @posts, :entry_name => 'item' %>
# #-> Displaying items 6 - 10 of 26 in total
def page_entries_info(collection, options = {})
- if collection.empty?
- entry_name = 'entry'
- else
- class_name = collection.first.class.name
- entry_name = class_name.include?("::")? class_name.split("::").last : class_name
- entry_name = entry_name.underscore.sub('_', ' ')
- end
+ entry_name = 'entry'
+ entry_name = collection.first.class.model_name.human.downcase unless collection.empty?
entry_name = options[:entry_name] unless options[:entry_name].nil?
entry_name = entry_name.pluralize unless collection.total_count == 1
- output = ""
if collection.num_pages < 2
output = t("helpers.page_entries_info.one_page.display_entries", { :count => collection.total_count, :entry_name => entry_name })
else | Following tip from @rtlong. =D | kaminari_kaminari | train | rb |
520ee4f454dd09396f3e0356c7cab34a79233247 | diff --git a/tests/changelog.py b/tests/changelog.py
index <HASH>..<HASH> 100644
--- a/tests/changelog.py
+++ b/tests/changelog.py
@@ -184,13 +184,24 @@ class releases(Spec):
assert self.b not in one_0_1
assert self.b2 in one_0_1
assert self.b3 in one_0_1
- # 1.1.1 includes all 3
+ # 1.1.1 includes all 3 (i.e. the explicitness of 1.0.1 didn't affect
+ # the 1.1 line bucket.)
assert self.b in one_1_1
assert self.b2 in one_1_1
assert self.b3 in one_1_1
- # Also ensure it affected 'unreleased' (both should be empty)
- assert len(rendered[-1]['entries']) == 0
- assert len(rendered[-2]['entries']) == 0
+
+ def explicit_minor_releases_dont_clear_entire_unreleased_minor(self):
+ f1 = _issue('feature', '1')
+ f2 = _issue('feature', '2')
+ changelog = _release_list('1.2', '1.1', f1, f2)
+ # Ensure that 1.1 specifies feature 2
+ changelog[0][1].append("2")
+ rendered = construct_releases(changelog, _app())
+ # 1.1 should have feature 2 only
+ assert f2 in rendered[1]['entries']
+ assert f1 not in rendered[1]['entries']
+ # 1.2 should still get/see feature 1
+ assert f1 in rendered[2]['entries']
def _obj2name(obj): | Shuffle out unreleased stuff into its own test | bitprophet_releases | train | py |
f54f52a79d82cbefe3137364830e7e37a2b0878c | diff --git a/galpy/orbit_src/integrateFullOrbit.py b/galpy/orbit_src/integrateFullOrbit.py
index <HASH>..<HASH> 100644
--- a/galpy/orbit_src/integrateFullOrbit.py
+++ b/galpy/orbit_src/integrateFullOrbit.py
@@ -123,7 +123,10 @@ def _parse_pot(pot,potforactions=False):
pot_args.extend([p._amp,p._a])
elif isinstance(p,potential.SCFPotential):
pot_type.append(24)
- pot_args.extend([p._amp,p._NN[None,:,:]*p._Acos, p._NN[None,:,:]*p._Asin, p._a])
+ pot_args.extend([p._amp, p._a])
+ pot_args.extend(p._Acos.shape)
+ pot_args.extend(p._Acos.flatten(order='C'))
+ pot_args.extend(p._Asin.flatten(order='C'))
pot_type= nu.array(pot_type,dtype=nu.int32,order='C')
pot_args= nu.array(pot_args,dtype=nu.float64,order='C')
return (npot,pot_type,pot_args) | Removed the NN multiplication from the SCFPotential case. Also added the shape of Acos and Asin, and flattened them. | jobovy_galpy | train | py |
294d90fe8dcde195a443b7cf90d4b715c867dcaf | diff --git a/ara/cli/playbook.py b/ara/cli/playbook.py
index <HASH>..<HASH> 100644
--- a/ara/cli/playbook.py
+++ b/ara/cli/playbook.py
@@ -430,6 +430,12 @@ class PlaybookMetrics(Lister):
help=("List playbooks matching the provided name (full or partial)"),
)
parser.add_argument(
+ "--controller",
+ metavar="<controller>",
+ default=None,
+ help=("List playbooks that ran from the provided controller (full or partial)"),
+ )
+ parser.add_argument(
"--path",
metavar="<path>",
default=None,
@@ -486,6 +492,9 @@ class PlaybookMetrics(Lister):
if args.name is not None:
query["name"] = args.name
+ if args.controller is not None:
+ query["controller"] = args.controller
+
if args.path is not None:
query["path"] = args.path | cli: add missing controller arg to playbook metrics
This provides the ability to get playbook metrics for a specific
controller.
Change-Id: I<I>abfc1bf6ef5e0ceb<I>da4f9a<I>a<I>ab | ansible-community_ara | train | py |
1d313bdd19bdf2e7544e293fb7dbfc29a847dc5d | diff --git a/lib/github-auth.js b/lib/github-auth.js
index <HASH>..<HASH> 100644
--- a/lib/github-auth.js
+++ b/lib/github-auth.js
@@ -120,10 +120,14 @@ function setRoutes(server) {
// - Ensure tokens have been propagated to all servers
// - Debug GitHub badge failures
//
- // The admin can authenticate with HTTP Basic Auth, with the shields secret
- // in the username and an empty/any password.
+ // The admin can authenticate with HTTP Basic Auth, with an empty/any
+ // username and the shields secret in the password and an empty/any
+ // password.
+ //
+ // e.g.
+ // curl -u ':very-very-secret' 'https://example.com/$github-auth/tokens'
server.ajax.on('github-auth/tokens', (json, end, ask) => {
- if (! constEq(ask.username, serverSecrets.shieldsSecret)) {
+ if (! constEq(ask.password, serverSecrets.shieldsSecret)) {
// An unknown entity tries to connect. Let the connection linger for a minute.
return setTimeout(function() { end('Invalid secret.'); }, 10000);
} | Github admin endpoint: use basic auth password instead of username (#<I>) | badges_shields | train | js |
e4b9e63e90c18eaf689c4734b3c6a8c2651d14e5 | diff --git a/builtin/providers/aws/resource_aws_iam_user_login_profile_test.go b/builtin/providers/aws/resource_aws_iam_user_login_profile_test.go
index <HASH>..<HASH> 100644
--- a/builtin/providers/aws/resource_aws_iam_user_login_profile_test.go
+++ b/builtin/providers/aws/resource_aws_iam_user_login_profile_test.go
@@ -90,7 +90,7 @@ func TestAccAWSUserLoginProfile_notAKey(t *testing.T) {
{
// We own this account but it doesn't have any key associated with it
Config: testAccAWSUserLoginProfileConfig(username, "/", "lolimnotakey"),
- ExpectError: regexp.MustCompile(`Error encrypting password`),
+ ExpectError: regexp.MustCompile(`Error encrypting Password`),
},
},
}) | provider/aws: Update regex to pass test | hashicorp_terraform | train | go |
88831d524666c154048e6888dff27ad8b7445d43 | diff --git a/salt/modules/nix.py b/salt/modules/nix.py
index <HASH>..<HASH> 100644
--- a/salt/modules/nix.py
+++ b/salt/modules/nix.py
@@ -35,7 +35,7 @@ def __virtual__():
This only works if we have access to nix-env
'''
nixhome = os.path.join(os.path.expanduser('~{0}'.format(__opts__['user'])), '.nix-profile/bin/')
- if salt.utils.which(os.path.join(nixhome, 'nix-env')) and salt.utils.which(os.path.join(nixhome, 'nix-store')):
+ if salt.utils.which(os.path.join(nixhome, 'nix-env')) and salt.utils.which(os.path.join(nixhome, 'nix-collect-garbage')):
return True
else:
return (False, "The `nix` binaries required cannot be found or are not installed. (`nix-store` and `nix-env`)") | nix: Check for nix-collect-garbage
I changed this from nix-store to nix-collect-garbage as the
nix.collect_garbage function used to use `nix-store --gc`, but now just
uses nix-collect-garbage. | saltstack_salt | train | py |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.