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
|
---|---|---|---|---|---|
9d86bf2e0583e6265d2952dfb8cb8a2c8281068b | diff --git a/distutils/tests/test_install.py b/distutils/tests/test_install.py
index <HASH>..<HASH> 100644
--- a/distutils/tests/test_install.py
+++ b/distutils/tests/test_install.py
@@ -56,9 +56,7 @@ class InstallTestCase(support.TempdirManager,
expected = os.path.normpath(expected)
self.assertEqual(got, expected)
- impl_name = sys.implementation.name
- if impl_name == "cpython":
- impl_name = "python"
+ impl_name = sys.implementation.name.replace("cpython", "python")
libdir = os.path.join(destination, "lib", impl_name)
check_path(cmd.install_lib, libdir)
_platlibdir = getattr(sys, "platlibdir", "lib") | Refactor as simple replace. If a full string substitution proves to be necessary, let's create a mapping. | pypa_setuptools | train | py |
655643543640d9dab738f53ad8c33edc69a90971 | diff --git a/packages/react-admin/src/mui/button/SaveButton.js b/packages/react-admin/src/mui/button/SaveButton.js
index <HASH>..<HASH> 100644
--- a/packages/react-admin/src/mui/button/SaveButton.js
+++ b/packages/react-admin/src/mui/button/SaveButton.js
@@ -81,7 +81,7 @@ export class SaveButton extends Component {
) : (
<ContentSave className={classes.iconPaddingStyle} />
)}
- {label && translate(label)}
+ {label && translate(label, { _: label })}
</Button>
);
} | Fix missing key warning in SaveButton | marmelab_react-admin | train | js |
0596346dbc0b73c4e81eac80ecba9bed44d30dab | diff --git a/lib/dependencies/HarmonyExportImportedSpecifierDependency.js b/lib/dependencies/HarmonyExportImportedSpecifierDependency.js
index <HASH>..<HASH> 100644
--- a/lib/dependencies/HarmonyExportImportedSpecifierDependency.js
+++ b/lib/dependencies/HarmonyExportImportedSpecifierDependency.js
@@ -195,7 +195,7 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
}
getReference() {
- const mode = this.getMode();
+ const mode = this.getMode(false);
switch (mode.type) {
case "missing":
@@ -427,7 +427,7 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
}
getContent(dep) {
- const mode = dep.getMode();
+ const mode = dep.getMode(false);
const module = dep.originModule;
const importedModule = dep.module;
const importVar = dep.getImportVar(); | Always pass first argument of 'getMode' | webpack_webpack | train | js |
c40f74c5b5ffc81dd2ebcfdd24153a7a4506919c | diff --git a/test/test_asset.rb b/test/test_asset.rb
index <HASH>..<HASH> 100644
--- a/test/test_asset.rb
+++ b/test/test_asset.rb
@@ -5,6 +5,11 @@ module AssetTests
define_method("test #{name.inspect}", &block)
end
+ test "pathname" do
+ assert_kind_of Pathname, @asset.pathname
+ assert @asset.pathname.exist?
+ end
+
test "content type" do
assert_equal "application/javascript", @asset.content_type
end | Assets should have a pathname | rails_sprockets | train | rb |
49a3bd561b71d4e965408dadbc9e2f2ded22577e | diff --git a/werkzeug/script.py b/werkzeug/script.py
index <HASH>..<HASH> 100644
--- a/werkzeug/script.py
+++ b/werkzeug/script.py
@@ -194,7 +194,7 @@ def find_actions(namespace, action_prefix):
def print_usage(actions):
"""Print the usage information. (Help screen)"""
- actions = actions.items()
+ actions = sorted(iteritems(actions))
actions.sort()
print('usage: %s <action> [<options>]' % basename(sys.argv[0]))
print(' %s --help' % basename(sys.argv[0])) | Fix script print_usage for python3
AttributeError: 'dict_items' object has no attribute 'sort' | pallets_werkzeug | train | py |
86271396fbe3874b643a7327dc3fe974fcec684e | diff --git a/lib/rly/yacc.rb b/lib/rly/yacc.rb
index <HASH>..<HASH> 100644
--- a/lib/rly/yacc.rb
+++ b/lib/rly/yacc.rb
@@ -212,9 +212,9 @@ module Rly
errok = @errok
token = @lex.next
restart = @restart
- errtoken.lex = @lex if errtoken
+ #errtoken.lexer = @lex if errtoken
- tok = self.class.error_handler.call(errtoken)
+ tok = self.instance_exec(errtoken, &self.class.error_handler)
if @errorok
# User must have done some kind of panic
@@ -361,6 +361,10 @@ module Rly
3
end
+ def on_error(lambda)
+ @error_handler = lambda
+ end
+
def parsed_rules
return @parsed_rules if @parsed_rules | Finally added error handler to Yacc
It accepts a lambda, as it is supposed to return a token.
We will see if lambdas are actually cool, as I might
rewrite other parts of API with them. | farcaller_rly | train | rb |
79b96960f8746f3b20cbd285612601d2325429fe | diff --git a/grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsControllerClass.java b/grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsControllerClass.java
index <HASH>..<HASH> 100644
--- a/grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsControllerClass.java
+++ b/grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsControllerClass.java
@@ -96,22 +96,7 @@ public class DefaultGrailsControllerClass extends AbstractInjectableGrailsClass
controllerPath = uri + SLASH;
-
- //Todo refactor using another way to detect resolve strategy
- String resolveStrategy = (String)ConfigurationHolder.getConfig().get(RESOLVE_ACTION_KEY);
-
- //Method Strategy only
- if(resolveStrategy != null && resolveStrategy.equalsIgnoreCase(RESOLVE_METHOD)){
- methodStrategy(actionNames);
- }
- //Closure Strategy only
- else if(resolveStrategy != null && resolveStrategy.equalsIgnoreCase(RESOLVE_CLOSURE)){
- closureStrategy(actionNames);
- }
- //Mixed Strategy : Method first, Closure then
- else{
- mixedStrategy(actionNames);
- }
+ mixedStrategy(actionNames);
configureDefaultActionIfSet();
configureURIsForCurrentState(); | always use mixed mode method actions, removed code that uses configuration | grails_grails-core | train | java |
5ccf5e0840317b9ae31bf6ce090960c5ab9b03b4 | diff --git a/holoviews/core/dimension.py b/holoviews/core/dimension.py
index <HASH>..<HASH> 100644
--- a/holoviews/core/dimension.py
+++ b/holoviews/core/dimension.py
@@ -108,6 +108,9 @@ class Dimension(param.Parameterized):
"%s" % self.name)
return value
+ def __repr__(self):
+ return self.script_repr()
+
def pprint_value_string(self, value):
""" | Improved repr of Dimension using script_repr | pyviz_holoviews | train | py |
aaf1b2d911feeaae17a6627ae911e25cffe5d701 | diff --git a/test_app/config/application.rb b/test_app/config/application.rb
index <HASH>..<HASH> 100644
--- a/test_app/config/application.rb
+++ b/test_app/config/application.rb
@@ -4,6 +4,7 @@ require File.expand_path('../boot', __FILE__)
# require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
+require "action_view/railtie"
# require "active_resource/railtie"
require "sprockets/railtie"
require "rails/test_unit/railtie" | Add require "action_view/railtie" | activeadmin_activeadmin-mongoid | train | rb |
c2c5c465dbfd73c44d07f6e8e77697bb337812b6 | diff --git a/pycoin/symbols/xlt.py b/pycoin/symbols/xlt.py
index <HASH>..<HASH> 100644
--- a/pycoin/symbols/xlt.py
+++ b/pycoin/symbols/xlt.py
@@ -3,5 +3,5 @@ from pycoin.networks.bitcoinish import create_bitcoinish_network
network = create_bitcoinish_network(
network_name="Litecoin", symbol="XLT", subnet_name="testnet",
- wif_prefix_hex="ef", sec_prefix="XLTSEC:", address_prefix_hex="6f", pay_to_script_prefix_hex="c4",
+ wif_prefix_hex="ef", sec_prefix="XLTSEC:", address_prefix_hex="6f", pay_to_script_prefix_hex="3a",
bip32_prv_prefix_hex="0436ef7d", bip32_pub_prefix_hex="0436f6e1", bech32_hrp="tltc") | Support Q addresses for Litecoin testnet | richardkiss_pycoin | train | py |
286388b1c70408978712fd2c9f4754cfb2914882 | diff --git a/eZ/Publish/Core/REST/Server/index.php b/eZ/Publish/Core/REST/Server/index.php
index <HASH>..<HASH> 100644
--- a/eZ/Publish/Core/REST/Server/index.php
+++ b/eZ/Publish/Core/REST/Server/index.php
@@ -15,7 +15,7 @@ use eZ\Publish\Core\REST\Common;
use Qafoo\RMF;
-require __DIR__ . '/../bootstrap.php';
+require __DIR__ . '/../../../../../bootstrap.php';
/*
* This is a very simple session handling for the repository, which allows the | Fix path to bootstrap.php in REST\Server\index.php | ezsystems_ezpublish-kernel | train | php |
8e4608252e6726b890cebab886a26e8e6304accf | diff --git a/config/software/chefdk.rb b/config/software/chefdk.rb
index <HASH>..<HASH> 100644
--- a/config/software/chefdk.rb
+++ b/config/software/chefdk.rb
@@ -63,7 +63,7 @@ build do
'rubocop' => '0.31.0',
'knife-spork' => '1.5.0',
'winrm-transport' => '1.0.2',
- 'knife-windows' => '0.8.5',
+ 'knife-windows' => '1.0.0.rc.1',
# Strainer build is hosed on windows
# 'strainer' => '0.15.0',
}.each do |name, version| | Move to knife-windows <I>.rc<I> (for nightlies and the next RC) | chef_chef | train | rb |
d4ae039a8514fb1c894e42f4cc5f0af9fea8a72c | diff --git a/astroid/scoped_nodes.py b/astroid/scoped_nodes.py
index <HASH>..<HASH> 100644
--- a/astroid/scoped_nodes.py
+++ b/astroid/scoped_nodes.py
@@ -1594,13 +1594,17 @@ class FunctionDef(mixins.MultiLineBlockMixin, node_classes.Statement, Lambda):
self.args.vararg is not None):
metaclass = next(caller.args[0].infer(context))
if isinstance(metaclass, ClassDef):
- c = ClassDef('temporary_class', None)
- c.hide = True
- c.parent = self
- class_bases = [next(b.infer(context)) for b in caller.args[1:]]
- c.bases = [base for base in class_bases if base != util.Uninferable]
- c._metaclass = metaclass
- yield c
+ class_bases = [next(arg.infer(context)) for arg in caller.args[1:]]
+ new_class = ClassDef(name='temporary_class')
+ new_class.hide = True
+ new_class.parent = self
+ new_class.postinit(
+ bases=[base for base in class_bases if base != util.Uninferable],
+ body=[],
+ decorators=[],
+ metaclass=metaclass,
+ )
+ yield new_class
return
returns = self._get_return_nodes_skip_functions() | Switch to using postinit() for the metaclass hack | PyCQA_astroid | train | py |
54911bbb66bc64a701b5409f2a99eb77ae89937f | diff --git a/src/Core_Command.php b/src/Core_Command.php
index <HASH>..<HASH> 100644
--- a/src/Core_Command.php
+++ b/src/Core_Command.php
@@ -414,7 +414,7 @@ class Core_Command extends WP_CLI_Command {
* For those using WordPress with Apache, remember to update the `.htaccess`
* file with the appropriate multisite rewrite rules.
*
- * [Review the multisite documentation](https://codex.wordpress.org/Create_A_Network)
+ * [Review the multisite documentation](https://wordpress.org/support/article/create-a-network/)
* for more details about how multisite works.
*
* ## OPTIONS | Update the link in the docblock of "core multisite-convert" command | wp-cli_core-command | train | php |
a0d5a0dacad690ba03bc15824bde14b1a7cdf42a | diff --git a/lib/arel/visitors/sql_server.rb b/lib/arel/visitors/sql_server.rb
index <HASH>..<HASH> 100644
--- a/lib/arel/visitors/sql_server.rb
+++ b/lib/arel/visitors/sql_server.rb
@@ -102,11 +102,22 @@ module Arel
if ArJdbc::AR42
def visit_Arel_Nodes_Bin o, a
- visit o.expr, a; a << ' ' << ArJdbc::MSSQL.cs_equality_operator
+ expr = o.expr; visit expr, a
+ if expr.val.is_a? Numeric
+ a
+ else
+ a << " #{::ArJdbc::MSSQL.cs_equality_operator} "
+ end
end
else
def visit_Arel_Nodes_Bin o, a = nil
- "#{do_visit o.expr, a} #{ArJdbc::MSSQL.cs_equality_operator}"
+ expr = o.expr; sql = do_visit expr, a
+ if expr.respond_to?(:val) && expr.val.is_a?(Numeric)
+ sql
+ else
+ sql << " #{::ArJdbc::MSSQL.cs_equality_operator} "
+ sql
+ end
end
end | [mssql] do not compare numeric values with cs equality operator | jruby_activerecord-jdbc-adapter | train | rb |
259a59cf0263c2c6890719bf61b4582df1e4760f | diff --git a/lib/beetle/redis_configuration_http_server.rb b/lib/beetle/redis_configuration_http_server.rb
index <HASH>..<HASH> 100644
--- a/lib/beetle/redis_configuration_http_server.rb
+++ b/lib/beetle/redis_configuration_http_server.rb
@@ -44,7 +44,6 @@ module Beetle
def server_status(response, type)
response.status = 200
- config_server.redis.refresh
status = config_server.status
response.content =
case type | don't interfere with the regular redis refreshing | xing_beetle | train | rb |
de21a72fee411a799818d34a0ca00dc1b91cfee7 | diff --git a/go/vt/tabletserver/query_executor.go b/go/vt/tabletserver/query_executor.go
index <HASH>..<HASH> 100644
--- a/go/vt/tabletserver/query_executor.go
+++ b/go/vt/tabletserver/query_executor.go
@@ -230,6 +230,12 @@ func (qre *QueryExecutor) checkPermissions() error {
qre.qe.tableaclExemptCount.Add(1)
return nil
}
+
+ // empty table name, do not need a table ACL check.
+ if qre.plan.TableName == "" {
+ return nil
+ }
+
if qre.plan.Authorized == nil {
return NewTabletError(ErrFail, vtrpc.ErrorCode_PERMISSION_DENIED, "table acl error: nil acl")
} | stop table ACL check for query without a table name.
Vitess supports non table queries like "set flag=true"; therefore, table
ACL should be ignored for these queries. | vitessio_vitess | train | go |
2faca8a26207e316f21cadb9222ed640b7e76c16 | diff --git a/blob/html/input.js b/blob/html/input.js
index <HASH>..<HASH> 100644
--- a/blob/html/input.js
+++ b/blob/html/input.js
@@ -31,7 +31,8 @@ module.exports = {
getFileData(file, function(fileData) {
var orientation = getOrientation(fileData)
- if (opts.removeExif)
+ if ((typeof opts.removeExif == 'function' && opts.removeExif()) ||
+ opts.removeExif)
fileData = removeExif(fileData, orientation)
// handle exif orientation data and resize | removeExif can be an observable | ssbc_patchcore | train | js |
f3d7bd1f4d15ecab1e362cf654322861b89a07a5 | diff --git a/includes/managers/class-fs-cache-manager.php b/includes/managers/class-fs-cache-manager.php
index <HASH>..<HASH> 100755
--- a/includes/managers/class-fs-cache-manager.php
+++ b/includes/managers/class-fs-cache-manager.php
@@ -37,7 +37,7 @@
$this->_logger->entrance();
$this->_logger->log( 'id = ' . $id );
- $this->_options = FS_Option_Manager::get_manager( $id, true );
+ $this->_options = FS_Option_Manager::get_manager( $id, true, true );
}
/** | [multisite] [cache-manager] Adjusted the cache manager options to use the MS network storage. | Freemius_wordpress-sdk | train | php |
7387c3249144e9b60af444205664ec35fcf54d2a | diff --git a/__tests__/clockSkew.js b/__tests__/clockSkew.js
index <HASH>..<HASH> 100644
--- a/__tests__/clockSkew.js
+++ b/__tests__/clockSkew.js
@@ -19,7 +19,7 @@ describe('Clock skew', () => {
createDirectLine: options => {
const workingDirectLine = window.WebChat.createDirectLine(options);
const activityBroker = window.createProduceConsumeBroker();
- const activityObservers = [];
+ let activityObservers = [];
const activitySubscription = workingDirectLine.activity$.subscribe({
complete() { | fixed a reasignment of a const variable in __tests__/clockSkew.js (#<I>) | Microsoft_BotFramework-WebChat | train | js |
0e3f18f1db46a861eca5e60ddd673a8ef5e11456 | diff --git a/src/python/twitter/pants/tasks/binary_utils.py b/src/python/twitter/pants/tasks/binary_utils.py
index <HASH>..<HASH> 100644
--- a/src/python/twitter/pants/tasks/binary_utils.py
+++ b/src/python/twitter/pants/tasks/binary_utils.py
@@ -43,6 +43,7 @@ _PATH_BY_ID = {
('darwin', '9'): [ 'mac', '10.5' ],
('darwin', '10'): [ 'mac', '10.6' ],
('darwin', '11'): [ 'mac', '10.7' ],
+ ('darwin', '12'): [ 'mac', '10.8' ],
} | Support for thrift in Mountain Lion.
(sapling split of 5d<I>a<I>bbc8b<I>c<I>e<I>c3e2f<I>) | pantsbuild_pants | train | py |
3321970e633027d7c9c2b2edc0d46570f0d6f8cd | diff --git a/salt/master.py b/salt/master.py
index <HASH>..<HASH> 100644
--- a/salt/master.py
+++ b/salt/master.py
@@ -390,12 +390,12 @@ class AESFuncs(object):
if not self.opts['external_nodes']:
return {}
if not salt.utils.which(self.opts['external_nodes']):
- log.error(('Specified external nodes controller {0} is not'
+ log.error(('Specified external nodes controller {0} is not'
' available, please verify that it is installed'
'').format(self.opts['external_nodes']))
return {}
cmd = '{0} {1}'.format(self.opts['external_nodes'], load['id'])
- ndata = yaml.safe_loads(
+ ndata = yaml.safe_load(
subprocess.Popen(
cmd,
shell=True,
@@ -406,7 +406,7 @@ class AESFuncs(object):
env = ndata['environment']
else:
env = 'base'
-
+
if 'classes' in ndata:
if isinstance(ndata['classes'], dict):
ret[env] = ndata['classes'].keys() | Fix a tyop: s/safe_loads/safe_load/ | saltstack_salt | train | py |
ffeab9e2a5c3d27b852622c8f1877a5312bdca3f | diff --git a/gears/processors.py b/gears/processors.py
index <HASH>..<HASH> 100644
--- a/gears/processors.py
+++ b/gears/processors.py
@@ -81,10 +81,14 @@ class DirectivesMixin(object):
directive_linenos.append(lineno)
if not has_require_self:
body.append(self_body.strip())
+ header = self.strip_header(header, directive_linenos)
+ return header, '\n\n'.join(body).strip()
+
+ def strip_header(self, header, linenos):
header = header.splitlines()
- for lineno in reversed(directive_linenos):
+ for lineno in reversed(linenos):
del header[lineno]
- return '\n'.join(header).strip(), '\n\n'.join(body).strip()
+ return '\n'.join(header).strip()
def parse_directives(self, header):
for lineno, line in enumerate(header.splitlines()): | Remove directives from header using separate method | gears_django-gears | train | py |
da3c2162fa25bec220d3a5f6825ce0a413cefc00 | diff --git a/lib/starscope/db.rb b/lib/starscope/db.rb
index <HASH>..<HASH> 100644
--- a/lib/starscope/db.rb
+++ b/lib/starscope/db.rb
@@ -210,10 +210,7 @@ END
records.each do |record|
key = record[:name][-1].to_s
index = line.index(key)
- while index
- toks[index] = record
- index = line.index(key, index + 1)
- end
+ toks[index] = record unless index.nil?
end
next if toks.empty? | cscope: only match one occurrence per token
For lines like
go("gogogo")
we would export four function calls (one per "go") even though the extractor
correctly only reported the one. | eapache_starscope | train | rb |
f34e645800c48589c96805b64c7ab67a2c5f2f33 | diff --git a/lib/nrser/log.rb b/lib/nrser/log.rb
index <HASH>..<HASH> 100644
--- a/lib/nrser/log.rb
+++ b/lib/nrser/log.rb
@@ -696,6 +696,9 @@ module NRSER::Log
old_appender = @appender
@appender = case dest
+ when false
+ # Used to remove the appender and set {.appender} to `nil`.
+ nil
when SemanticLogger::Subscriber, Hash
# Can be handled directly
SemanticLogger.add_appender dest | Allow passing `dest: false` to log setup to remove the appender | nrser_nrser.rb | train | rb |
7594741dd9590337adc4e1b95a9e2f27ab89ea93 | diff --git a/lib/python/vdm/server/HTTPListener.py b/lib/python/vdm/server/HTTPListener.py
index <HASH>..<HASH> 100644
--- a/lib/python/vdm/server/HTTPListener.py
+++ b/lib/python/vdm/server/HTTPListener.py
@@ -1439,7 +1439,7 @@ class DatabaseAPI(MethodView):
# Create new deployment
app_root = os.path.dirname(os.path.abspath(__file__))
- with open(app_root +"/deployment.json") as json_file:
+ with open(os.path.join(app_root, "deployment.json")) as json_file:
deployment = json.load(json_file)
deployment['databaseid'] = database_id
@@ -1697,6 +1697,7 @@ class deploymentUserAPI(MethodView):
DEPLOYMENT_USERS.remove(current_user[0])
return jsonify({'status': 1, 'statusstring': "User Deleted"})
+
class StartDatabaseAPI(MethodView):
"""Class to handle request to start servers on all nodes of a database."""
@@ -1853,6 +1854,7 @@ class VdmConfiguration(MethodView):
return jsonify({'deployment': response.status_code})
+
class DatabaseDeploymentAPI(MethodView):
"""
Class related to the vdm configuration | VDM-<I> Modified code to use os.path.join to join file path. | VoltDB_voltdb | train | py |
0b0cd1c786982061d1db7500b2b637980ca7c7e3 | diff --git a/javascript/webdriver/atoms/element.js b/javascript/webdriver/atoms/element.js
index <HASH>..<HASH> 100644
--- a/javascript/webdriver/atoms/element.js
+++ b/javascript/webdriver/atoms/element.js
@@ -213,21 +213,21 @@ webdriver.atoms.element.type = function(element, keys, opt_keyboard) {
throw Error('Unsupported WebDriver key: \\u' +
key.charCodeAt(0).toString(16));
}
+ } else {
+ // Handle common aliases.
+ switch (key) {
+ case '\n':
+ current.push(bot.Keyboard.Keys.ENTER);
+ break;
+ case '\t':
+ current.push(bot.Keyboard.Keys.TAB);
+ break;
+ case '\b':
+ current.push(bot.Keyboard.Keys.BACKSPACE);
+ break;
+ }
+ current.push(key);
}
-
- // Handle common aliases.
- switch (key) {
- case '\n':
- current.push(bot.Keyboard.Keys.ENTER);
- break;
- case '\t':
- current.push(bot.Keyboard.Keys.TAB);
- break;
- case '\b':
- current.push(bot.Keyboard.Keys.BACKSPACE);
- break;
- }
- current.push(key);
});
}); | JasonLeyba: Properly use an else-block or we'll attempt to type a non-printable character.
r<I> | SeleniumHQ_selenium | train | js |
96ca653e5f5d39cb9f5541fef1e3f8f5bff9f860 | diff --git a/master/buildbot/test/unit/test_schedulers_trysched.py b/master/buildbot/test/unit/test_schedulers_trysched.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/test/unit/test_schedulers_trysched.py
+++ b/master/buildbot/test/unit/test_schedulers_trysched.py
@@ -569,6 +569,19 @@ class Try_Jobdir(scheduler.SchedulerMixin, unittest.TestCase):
d.addCallback(check)
return d
+ def test_handleJobFile_with_invalid_try_properties(self):
+ d = self.call_handleJobFile(
+ lambda f: self.makeSampleParsedJob(properties=['foo', 'bar']))
+
+ def callback(_):
+ self.fail("shouldn't succeed")
+
+ def errorback(f):
+ f.trap(AttributeError)
+ pass # A-OK
+ d.addCallbacks(callback, errorback)
+ return d
+
class Try_Userpass_Perspective(scheduler.SchedulerMixin, unittest.TestCase): | Add test to confirm that non-dict try properties raises AttributeError. | buildbot_buildbot | train | py |
98739b8eed71cd500a64d0a7fa2b8b7ac77eef86 | diff --git a/drivers/src/main/java/de/uniulm/omi/cloudiator/sword/drivers/openstack/strategy/OpenstackCreateVirtualMachineStrategy.java b/drivers/src/main/java/de/uniulm/omi/cloudiator/sword/drivers/openstack/strategy/OpenstackCreateVirtualMachineStrategy.java
index <HASH>..<HASH> 100644
--- a/drivers/src/main/java/de/uniulm/omi/cloudiator/sword/drivers/openstack/strategy/OpenstackCreateVirtualMachineStrategy.java
+++ b/drivers/src/main/java/de/uniulm/omi/cloudiator/sword/drivers/openstack/strategy/OpenstackCreateVirtualMachineStrategy.java
@@ -36,9 +36,9 @@ import static com.google.common.base.Preconditions.checkState;
* Create virtual machine strategy for Openstack.
* <p/>
* Uses the extension points of {@link JCloudsCreateVirtualMachineStrategy} to
- * support availability zones.
+ * support availability zones and hosts.
* <p/>
- * For this purpose it modifies the virtual machine template by setting the region of the availability zone
+ * For this purpose it modifies the virtual machine template by setting the region of the availability zone/host
* so that jclouds validation does not fail.
* <p/>
* Afterwards it modifies the template options object and manually sets the availability zone there. | Implemented support for openstack hosts when starting virtual machines | cloudiator_sword | train | java |
4826c1e259508a82ebeacdb67cf1455dd23482c7 | diff --git a/gnosis/eth/ethereum_network.py b/gnosis/eth/ethereum_network.py
index <HASH>..<HASH> 100644
--- a/gnosis/eth/ethereum_network.py
+++ b/gnosis/eth/ethereum_network.py
@@ -109,6 +109,7 @@ class EthereumNetwork(Enum):
WAN_TESTNET = 999
KLAY_BAOBAB = 1001
NEW_TESTNET = 1007
+ EURUS_MAINNET = 1008
EVC_EVRICE = 1010
NEW = 1012
SAKURA = 1022
@@ -124,6 +125,7 @@ class EthereumNetwork(Enum):
MOON_MOONSHADOW = 1288
GANACHE = 1337
CATECHAIN = 1618
+ EURUS_TESTNET = 1984
EGEM = 1987
EDG = 2021
EDG_BERESHEET = 2022 | Added Eurus mainnet and testnet network ID. | gnosis_gnosis-py | train | py |
458456a70d4ba8e9af17400162c67e75642a467f | diff --git a/src/react/createComponent.js b/src/react/createComponent.js
index <HASH>..<HASH> 100644
--- a/src/react/createComponent.js
+++ b/src/react/createComponent.js
@@ -1,13 +1,23 @@
//@flow
import * as React from 'react'
-import type {Store} from 'effector'
+import {type Store, is, invariant, createStoreObject} from 'effector'
import {createStoreConsumer} from './createStoreConsumer'
export function createComponent<Props: {}, State>(
- store: Store<State>,
+ shape: Store<State>,
renderProp: (props: Props, state: State) => React.Node,
): React.ComponentType<Props> {
+ let store
+ if (is.store(shape)) {
+ store = shape
+ } else {
+ invariant(
+ typeof shape === 'object' && shape !== null,
+ 'shape should be store or object with stores',
+ )
+ store = createStoreObject(shape)
+ }
const Consumer = createStoreConsumer(store)
return class RenderComponent extends React.Component<Props> {
renderProp = (state: State) => renderProp(this.props, state) | allow to use object with stores in createComponent | zerobias_effector | train | js |
ac038bf53c8caea7a142b0d10e1b1fe90705a328 | diff --git a/sos/report/plugins/vhostmd.py b/sos/report/plugins/vhostmd.py
index <HASH>..<HASH> 100644
--- a/sos/report/plugins/vhostmd.py
+++ b/sos/report/plugins/vhostmd.py
@@ -20,7 +20,7 @@ class vhostmd(Plugin, RedHatPlugin):
packages = ['virt-what']
def setup(self):
- vw = self.exec_cmd("virt-what")['output'].splitlines()
+ vw = self.collect_cmd_output("virt-what")['output'].splitlines()
if not vw:
return | [vhostmd] Capture the output of vhostmd
Currently we only use the output of vhostmd temporarily
to check if the machine is a vm or not. With this
patch we also capture its output.
Resolves: #<I> | sosreport_sos | train | py |
43df4640eb816671424e5927a50ecb4226354966 | diff --git a/modelx/__init__.py b/modelx/__init__.py
index <HASH>..<HASH> 100644
--- a/modelx/__init__.py
+++ b/modelx/__init__.py
@@ -20,7 +20,7 @@ Attributes:
"""
-VERSION = (0, 13, 0)
+VERSION = (0, 13, 1)
__version__ = ".".join([str(x) for x in VERSION])
from modelx.core.api import * # must come after __version__ assignment.
try: | DIST: Release <I> | fumitoh_modelx | train | py |
7e3fd9025b187d0984e124e04a56a8e74ceed5fb | diff --git a/lib/sidekiq_unique_jobs/version.rb b/lib/sidekiq_unique_jobs/version.rb
index <HASH>..<HASH> 100644
--- a/lib/sidekiq_unique_jobs/version.rb
+++ b/lib/sidekiq_unique_jobs/version.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
module SidekiqUniqueJobs
- VERSION = '6.0.0.rc6'
+ VERSION = '6.0.0.rc7'
end | Bump to <I>.rc7 | mhenrixon_sidekiq-unique-jobs | train | rb |
522e36dd9e9d80405e48439514c46208b46ebd99 | diff --git a/test/test_framework.go b/test/test_framework.go
index <HASH>..<HASH> 100644
--- a/test/test_framework.go
+++ b/test/test_framework.go
@@ -525,18 +525,7 @@ func TrySuite(t *testing.T, f func(t *T), times int) {
tee.attempt++
time.Sleep(200 * time.Millisecond)
}
- if tee.failed {
- if t.Failed() {
- done <- true
- return
- }
- if len(tee.format) > 0 {
- t.Fatalf(tee.format, tee.values...)
- } else {
- t.Fatal(tee.values...)
- }
- done <- true
- }
+ done <- true
}()
for {
select {
@@ -560,6 +549,16 @@ func TrySuite(t *testing.T, f func(t *T), times int) {
t.Fatalf("%v:%v, %v (failed after %v)", fname, line, caller, time.Since(actualStart))
return
case <-done:
+ if tee.failed {
+ if t.Failed() {
+ return
+ }
+ if len(tee.format) > 0 {
+ t.Fatalf(tee.format, tee.values...)
+ } else {
+ t.Fatal(tee.values...)
+ }
+ }
return
}
} | Fixing tests timing out at 3 minutes even when they return with error quickly (#<I>) | micro_micro | train | go |
784773e3b12ce89b5e70039668a0aed8cf04ac97 | diff --git a/client/ristretto.js b/client/ristretto.js
index <HASH>..<HASH> 100644
--- a/client/ristretto.js
+++ b/client/ristretto.js
@@ -6,10 +6,13 @@
} else {
var reload_stylesheets = function(first_time) {
var links = document.getElementsByTagName("link");
+ var link, char;
for(var i = 0; i < links.length; i++) {
- var link = links[i];
+ link = links[i];
+ char = '?';
if(link.rel === "stylesheet") {
- link.href += (first_time === true) ? ("?"+(new Date()).getTime()) : "?";
+ char = (link.href.indexOf('?')>-1) ? '&' : '?';
+ link.href += (first_time === true) ? (char+(new Date()).getTime()) : char;
}
}
}; | Fixed: Ristretto wasnt able to reload stylsheets with query in url. | ViliamKopecky_Ristretto | train | js |
b8114265e6c8b280a4f45abe1104231be978fdf8 | diff --git a/lib/idb/version.rb b/lib/idb/version.rb
index <HASH>..<HASH> 100644
--- a/lib/idb/version.rb
+++ b/lib/idb/version.rb
@@ -1,3 +1,3 @@
module Idb
- VERSION = "1.3.2"
+ VERSION = "2.1.0"
end | Bumping version to be consistent with github | dmayer_idb | train | rb |
2d2af50284709cfe81a84899f4c37c00b7cd528a | diff --git a/go/vt/mysqlctl/split.go b/go/vt/mysqlctl/split.go
index <HASH>..<HASH> 100644
--- a/go/vt/mysqlctl/split.go
+++ b/go/vt/mysqlctl/split.go
@@ -905,8 +905,8 @@ func buildQueryList(destinationDbName, query string, writeBinLogs bool) []string
queries := make([]string, 0, 4)
if !writeBinLogs {
queries = append(queries, "SET sql_log_bin = OFF")
+ queries = append(queries, "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED")
}
- queries = append(queries, "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED")
queries = append(queries, "USE `"+destinationDbName+"`")
queries = append(queries, query)
return queries | Multirestore: can only set TRANSACTION ISOLATION LEVEL read only
when not writing to bin logs. | vitessio_vitess | train | go |
6329b3d19f1f90769ac7d4dd65b45024f76a0f94 | diff --git a/src/main/java/de/cinovo/cloudconductor/api/interfaces/IHost.java b/src/main/java/de/cinovo/cloudconductor/api/interfaces/IHost.java
index <HASH>..<HASH> 100644
--- a/src/main/java/de/cinovo/cloudconductor/api/interfaces/IHost.java
+++ b/src/main/java/de/cinovo/cloudconductor/api/interfaces/IHost.java
@@ -63,4 +63,13 @@ public interface IHost {
@Path("/changeservicestate")
@RolesAllowed({"EDIT_HOST"})
void setServiceState(ChangeServiceState changeServiceState);
+
+ /**
+ * @param hostUuid the host uuid
+ * @param newTemplate the new template of the host
+ */
+ @GET
+ @Path("/{host}/changetemplate/{template}")
+ @RolesAllowed({"EDIT_HOST"})
+ void moveHost(@PathParam("host")String hostUuid, @PathParam("template")String newTemplate);
} | adds support for movement of hosts to other templates | cinovo_cloudconductor-api | train | java |
cdb72c85b4ba724cfae2a39d9fd5add33c9bd74d | diff --git a/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/ServerModule.java b/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/ServerModule.java
index <HASH>..<HASH> 100644
--- a/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/ServerModule.java
+++ b/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/ServerModule.java
@@ -34,7 +34,7 @@ public class ServerModule extends Module {
}
private ServerServiceSupplier serverServiceSupplier(Map<Class, BeanFactory> registry) {
- return (ServerServiceSupplier) () -> (ServerService) registry.get(ServerService.class).getBean(registry);
+ return () -> (ServerService) registry.get(ServerService.class).getBean(registry);
}
} | Refactor Dependency Injection #<I> | CenturyLinkCloud_clc-java-sdk | train | java |
e0a5396ad8a7055cd0aca544990c4793c2b96e05 | diff --git a/lib/sensu/server.rb b/lib/sensu/server.rb
index <HASH>..<HASH> 100644
--- a/lib/sensu/server.rb
+++ b/lib/sensu/server.rb
@@ -508,6 +508,9 @@ module Sensu
result[:check][:output].is_a?(String) &&
result[:check][:status].is_a?(Integer)
else
+ @logger.warn('invalid result', {
+ :result => result
+ })
false
end
end
@@ -523,10 +526,6 @@ module Sensu
})
if valid_result?(result)
process_result(result)
- else
- @logger.warn('invalid result', {
- :result => result
- })
end
EM::next_tick do
header.ack | [payloads] moved invalid result log line to valid_result?() | sensu_sensu | train | rb |
460528cf942b412fb0078de9c7deca2e6bd966ff | diff --git a/pysecure/adapters/ssha.py b/pysecure/adapters/ssha.py
index <HASH>..<HASH> 100644
--- a/pysecure/adapters/ssha.py
+++ b/pysecure/adapters/ssha.py
@@ -373,7 +373,7 @@ def ssh_threads_set_callbacks(cb):
raise SshError("Could not set callbacks.")
def ssh_set_blocking(ssh_session, blocking):
- c_ssh_set_blocking(c_void_p(ssh_session), c_long(blocking))
+ c_ssh_set_blocking(c_void_p(ssh_session), c_int(blocking))
class SshSystem(object): | fix: invalid second argument type to ssh_set_blocking | dsoprea_PySecure | train | py |
a143d04331e35b5b89a1cda73e3550c997f269ec | diff --git a/indra/tests/test_bel.py b/indra/tests/test_bel.py
index <HASH>..<HASH> 100644
--- a/indra/tests/test_bel.py
+++ b/indra/tests/test_bel.py
@@ -30,7 +30,8 @@ def test_bel_ndex_query():
@attr('webservice')
def test_pybel_neighborhood_query():
- bp = bel.process_pybel_neighborhood(['NFKB1'])
+ corpus = path_this + '/../../data/small_corpus.bel'
+ bp = bel.process_pybel_neighborhood(['TP63'], corpus)
assert bp.statements
assert_pmids(bp.statements)
unicode_strs(bp.statements) | Switch to small corpus in BEL test | sorgerlab_indra | train | py |
0cc37a622cd659e8f02eaf4a4967bfaf3c264a30 | diff --git a/tests/utils/helpers.py b/tests/utils/helpers.py
index <HASH>..<HASH> 100644
--- a/tests/utils/helpers.py
+++ b/tests/utils/helpers.py
@@ -62,6 +62,7 @@ MAX_WAIT_LOOPS = 10
#: Wraps mock.patch() to make mocksignature=True by default.
patch = functools.partial(mock_module.patch, mocksignature=True)
+
def _patched_mocksignature(func, mock=None, skipfirst=False):
"""
Fixes arguments order and support of staticmethods in mock.mocksignature.
@@ -77,10 +78,16 @@ def _patched_mocksignature(func, mock=None, skipfirst=False):
checker = eval("lambda %s: None" % signature)
mock_module._copy_func_details(func, checker)
+
def funcopy(*args, **kwargs):
checker(*args, **kwargs)
return mock(*args, **kwargs)
- mock_module._setup_func(funcopy, mock)
+
+ if not hasattr(mock_module, '_setup_func'):
+ # compatibility with mock < 0.8
+ funcopy.mock = mock
+ else:
+ mock_module._setup_func(funcopy, mock)
if static:
funcopy = staticmethod(funcopy)
return funcopy | fixed pep8 blanklines violation and added support of mock < <I> | gem_oq-engine | train | py |
05cfce856b9cfd326022ea7e91de6a70a4432af7 | diff --git a/app/models/renalware/transplants/registration.rb b/app/models/renalware/transplants/registration.rb
index <HASH>..<HASH> 100644
--- a/app/models/renalware/transplants/registration.rb
+++ b/app/models/renalware/transplants/registration.rb
@@ -9,6 +9,9 @@ module Renalware
belongs_to :patient
has_many :statuses, class_name: "RegistrationStatus", foreign_key: "registration_id"
+ has_one :current_status, -> { where(terminated_on: nil) },
+ class_name: "RegistrationStatus", foreign_key: "registration_id"
+
has_paper_trail class_name: "Renalware::Transplants::RegistrationVersion"
has_document class_name: "RegistrationDocument"
@@ -19,10 +22,6 @@ module Renalware
BasePolicy
end
- def current_status
- statuses.find_by(terminated_on: nil)
- end
-
# @section services
#
def add_status!(params) | Add current_status association to Registration | airslie_renalware-core | train | rb |
87e9ad5e87acaaa3440b6d67579dd1e58df6e98e | diff --git a/lib/win32/certstore/mixin/assertions.rb b/lib/win32/certstore/mixin/assertions.rb
index <HASH>..<HASH> 100644
--- a/lib/win32/certstore/mixin/assertions.rb
+++ b/lib/win32/certstore/mixin/assertions.rb
@@ -82,7 +82,7 @@ module Win32
# ROOT -> Root certificates.
# SPC -> Software Publisher Certificate.
def valid_store_name
- %w{MY CA ROOT AUTHROOT DISALLOWED SPC TRUST TRUSTEDPEOPLE TRUSTEDPUBLISHER CLIENTAUTHISSUER TRUSTEDDEVICES SMARTCARDROOT WEBHOSTING REMOTE\ DESKTOP}
+ ["MY", "CA", "ROOT", "AUTHROOT", "DISALLOWED", "SPC", "TRUST", "TRUSTEDPEOPLE", "TRUSTEDPUBLISHER", "CLIENTAUTHISSUER", "TRUSTEDDEVICES", "SMARTCARDROOT", "WEBHOSTING", "REMOTE DESKTOP"]
end
end
end | Resolve rubocop offences | chef_win32-certstore | train | rb |
226fe3bf38c2f592f0b71e3904685bbb86320ebc | diff --git a/lib/couchrest/model/views.rb b/lib/couchrest/model/views.rb
index <HASH>..<HASH> 100644
--- a/lib/couchrest/model/views.rb
+++ b/lib/couchrest/model/views.rb
@@ -92,6 +92,7 @@ module CouchRest
# Dispatches to any named view.
def view(name, query={}, &block)
+ query = query.dup # Modifications made on copy!
db = query.delete(:database) || database
refresh_design_doc(db)
query[:raw] = true if query[:reduce]
diff --git a/spec/couchrest/view_spec.rb b/spec/couchrest/view_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/couchrest/view_spec.rb
+++ b/spec/couchrest/view_spec.rb
@@ -13,7 +13,22 @@ describe "Model views" do
property :professor
view_by :title
end
-
+
+
+ describe "ClassMethods" do
+ # NOTE! Add more unit tests!
+
+ describe "#view" do
+
+ it "should not alter original query" do
+ options = { :database => DB }
+ view = Article.view('by_date', options)
+ options[:database].should_not be_nil
+ end
+
+ end
+ end
+
describe "a model with simple views and a default param" do
before(:all) do
Article.all.map{|a| a.destroy(true)} | Fixing view deleting database option bug | couchrest_couchrest_model | train | rb,rb |
9a53c62cce4ff296d33fc89b6824c093b7be4f40 | diff --git a/andes/plot.py b/andes/plot.py
index <HASH>..<HASH> 100644
--- a/andes/plot.py
+++ b/andes/plot.py
@@ -770,7 +770,7 @@ class TDSData:
return fig, axes
- def panoview(self, mdl, *, ncols=3, vars=None, idx=None, a=None, figsize=None, **kwargs):
+ def panoview(self, mdl, vars, *, ncols=3, idx=None, a=None, figsize=None, **kwargs):
"""
Panoramic view of variables of a given model instance.
@@ -783,10 +783,10 @@ class TDSData:
----------
mdl : ModelBase
Model instance
- ncol : int
- Number of columns
var : list of str
A list of variable names to display
+ ncol : int
+ Number of columns
idx : list
A list of device idx-es for showing
a : list of int | Let `panoview` take `vars` as the positional argument after model. | cuihantao_andes | train | py |
278a32ba9155b87ba11e18f22c4c5a584db31ac5 | diff --git a/Lib/fontbakery/profiles/googlefonts_conditions.py b/Lib/fontbakery/profiles/googlefonts_conditions.py
index <HASH>..<HASH> 100644
--- a/Lib/fontbakery/profiles/googlefonts_conditions.py
+++ b/Lib/fontbakery/profiles/googlefonts_conditions.py
@@ -164,6 +164,12 @@ def registered_vendor_ids():
CACHED = resource_filename('fontbakery',
'data/fontbakery-microsoft-vendorlist.cache')
content = open(CACHED, encoding='utf-8').read()
+ # Strip all <A> HTML tags from the raw HTML. The current page contains a
+ # closing </A> for which no opening <A> is present, which causes
+ # beautifulsoup to silently stop processing that section from the error
+ # onwards. We're not using the href's anyway.
+ content = re.sub("<a[^>]*>", "", content)
+ content = re.sub("</a>", "", content)
soup = BeautifulSoup(content, 'html.parser')
IDs = [chr(c + ord('a')) for c in range(ord('z') - ord('a') + 1)] | Workaround for beautifulsoup processing partial malformed sections | googlefonts_fontbakery | train | py |
e68d4975fad0edd9e46808b055436e82e635f0c4 | diff --git a/pyvips/vimage.py b/pyvips/vimage.py
index <HASH>..<HASH> 100644
--- a/pyvips/vimage.py
+++ b/pyvips/vimage.py
@@ -126,7 +126,7 @@ def _deprecated(note):
return _dep
-# Rules for the mapping betweeen numpy typestrings and libvips formats
+# Rules for the mapping between numpy typestrings and libvips formats
# b1: bool. Above u1 so that rev. map is uchar->u1
TYPESTR_TO_FORMAT = {'|b1': 'uchar',
'|u1': 'uchar', | docs: fix simple typo, betweeen -> between (#<I>)
There is a small typo in pyvips/vimage.py.
Should read `between` rather than `betweeen`. | libvips_pyvips | train | py |
4b044bd0741342c43c36e508d98aae1f2c761405 | diff --git a/HTSeq/__init__.py b/HTSeq/__init__.py
index <HASH>..<HASH> 100644
--- a/HTSeq/__init__.py
+++ b/HTSeq/__init__.py
@@ -809,6 +809,13 @@ class BAM_Reader( object ):
yield SAM_Alignment.from_pysam_AlignedRead( pa, sf )
self.record_no += 1
+ def fetch( self, reference = None, start = None, end = None, region = None ):
+ sf = pysam.Samfile(self.filename, "rb")
+ self.record_no = 0
+ for pa in sf.fetch( reference, start, end, region ):
+ yield SAM_Alignment.from_pysam_AlignedRead( pa, sf )
+ self.record_no += 1
+
def get_line_number_string( self ):
if self.record_no == -1:
return "unopened file %s" % ( self.filename ) | Added BAM_Reader.fetch capability to get regions directly, interface is identical to pysam.Samfile.fetch. | simon-anders_htseq | train | py |
98de2652c48b7ede5c84171b6792a46c3a3ff07d | diff --git a/worker/uniter/operation/runhook.go b/worker/uniter/operation/runhook.go
index <HASH>..<HASH> 100644
--- a/worker/uniter/operation/runhook.go
+++ b/worker/uniter/operation/runhook.go
@@ -249,19 +249,20 @@ func (rh *runHook) Commit(state State) (*State, error) {
Step: Pending,
}
- hi := &hook.Info{Kind: hooks.ConfigChanged}
switch rh.info.Kind {
case hooks.ConfigChanged:
- if state.Started {
- break
+ if !state.Started {
+ change = stateChange{
+ Kind: RunHook,
+ Step: Queued,
+ Hook: &hook.Info{Kind: hooks.Start},
+ }
}
- hi.Kind = hooks.Start
- fallthrough
case hooks.UpgradeCharm:
change = stateChange{
Kind: RunHook,
Step: Queued,
- Hook: hi,
+ Hook: &hook.Info{Kind: hooks.ConfigChanged},
}
case hooks.PreSeriesUpgrade:
message := createUpgradeSeriesStatusMessage(rh.name, rh.hookFound) | Simplify runhook commit logic
This is a drive-by fix which should make the code easier to understand
as opposed to the previous version which relied on "fallthrough"
statements to tweak the stateChange object in just the right places. | juju_juju | train | go |
203f487d9b468cac4ab84c05e4fded64eeb6b6fe | diff --git a/play-maven-plugin/src/main/java/com/google/code/play/AbstractArchivingMojo.java b/play-maven-plugin/src/main/java/com/google/code/play/AbstractArchivingMojo.java
index <HASH>..<HASH> 100644
--- a/play-maven-plugin/src/main/java/com/google/code/play/AbstractArchivingMojo.java
+++ b/play-maven-plugin/src/main/java/com/google/code/play/AbstractArchivingMojo.java
@@ -79,6 +79,7 @@ public abstract class AbstractArchivingMojo
if ( !skip )
{
+ getLog().debug( "Expanding '" + destFile.getAbsolutePath() + "'" );
switch ( entry.getType() )
{
case ArchiveEntry.DIRECTORY: | Add debug info about every expanded file/directory. | play1-maven-plugin_play1-maven-plugin | train | java |
b2087d194b164cabe6022500b9a9335168d7bbf8 | diff --git a/packages/radio/src/react/button.js b/packages/radio/src/react/button.js
index <HASH>..<HASH> 100644
--- a/packages/radio/src/react/button.js
+++ b/packages/radio/src/react/button.js
@@ -5,7 +5,6 @@ import { defaultName as themeDefaultName } from '@pluralsight/ps-design-system-t
import * as propsUtil from '@pluralsight/ps-design-system-util/props'
import css from '../css'
-import * as vars from '../vars'
const radioButtonHtmlPropsWhitelist = [
'type',
diff --git a/packages/radio/src/react/group.js b/packages/radio/src/react/group.js
index <HASH>..<HASH> 100644
--- a/packages/radio/src/react/group.js
+++ b/packages/radio/src/react/group.js
@@ -3,7 +3,6 @@ import PropTypes from 'prop-types'
import React from 'react'
import css from '../css'
-import * as vars from '../vars'
const styles = {
buttonContainer: _ => glamor.css(css['.psds-radio-group__button-container']), | fix(radio): fix build error | pluralsight_design-system | train | js,js |
2a844287ef231f008edf15032fa6bed5d62c089d | diff --git a/Neos.Flow/Tests/Unit/Reflection/ClassSchemaTest.php b/Neos.Flow/Tests/Unit/Reflection/ClassSchemaTest.php
index <HASH>..<HASH> 100644
--- a/Neos.Flow/Tests/Unit/Reflection/ClassSchemaTest.php
+++ b/Neos.Flow/Tests/Unit/Reflection/ClassSchemaTest.php
@@ -263,7 +263,7 @@ class ClassSchemaTest extends UnitTestCase
$classSchema->addProperty('a', '?string');
$classSchema->addProperty('b', 'integer|null');
$classSchema->addProperty('c', 'null|array');
- $classSchema->addProperty('d', 'array|string');
+ $classSchema->addProperty('d', 'string');
self::assertTrue($classSchema->getProperty('a')['nullable']);
self::assertTrue($classSchema->getProperty('b')['nullable']); | TASK: Fix ClassSchemaTest for missing union types | neos_flow-development-collection | train | php |
0fefe1e73fd767efb2eccba9bb436fe7b59b50c1 | diff --git a/lib/helper/closurecompiler.js b/lib/helper/closurecompiler.js
index <HASH>..<HASH> 100644
--- a/lib/helper/closurecompiler.js
+++ b/lib/helper/closurecompiler.js
@@ -0,0 +1,13 @@
+/*
+ * grunt-require
+ * https://github.com/asciidisco/grunt-requirejs
+ *
+ * Copyright (c) 2012 asciidisco
+ * Licensed under the MIT license.
+ */
+
+exports.init = function(grunt) {
+ 'use strict';
+ var exports = {};
+ return exports;
+}; | Boilerplate code for closure compiler helper | asciidisco_grunt-requirejs | train | js |
13385e40f606d7adcb1141410366a72e8411e748 | diff --git a/datajoint/base_relation.py b/datajoint/base_relation.py
index <HASH>..<HASH> 100644
--- a/datajoint/base_relation.py
+++ b/datajoint/base_relation.py
@@ -143,7 +143,7 @@ class BaseRelation(RelationalOperand):
if isinstance(rows, RelationalOperand):
# INSERT FROM SELECT - build alternate field-narrowing query (only) when needed
- if ignore_extra_fields and False in [name in self.heading.names for name in rows.heading.names]:
+ if ignore_extra_fields and not all(name in self.heading.names for name in rows.heading.names):
query = 'INSERT{ignore} INTO {table} ({fields}) SELECT {fields} FROM ({select}) as `__alias`'.format(
ignore=" IGNORE" if ignore_errors or skip_duplicates else "",
table=self.full_table_name, | datajoint/base_relation.py: improve insert-from-select field-narrowing-required determinant | datajoint_datajoint-python | train | py |
7a3058cd34fa1243f425100be8c735ddde29a8a4 | diff --git a/pyqode/core/modes/code_completion.py b/pyqode/core/modes/code_completion.py
index <HASH>..<HASH> 100644
--- a/pyqode/core/modes/code_completion.py
+++ b/pyqode/core/modes/code_completion.py
@@ -49,8 +49,17 @@ class SubsequenceSortFilterProxyModel(QtCore.QSortFilterProxyModel):
mr = re.match(pattern, tr)
if mr and ir == -2:
ir = mr.start() + (len(self.sort_patterns) - i) * 10
- if il != -2 and ir != -1:
+ if il != -1 and ir != -2:
break
+ else:
+ if prefix in tl and prefix in tr:
+ return tl.index(prefix) < tr.index(prefix)
+ elif len(prefix):
+ return tl.index(prefix[0]) < tr.index(prefix[0])
+ elif prefix in tl:
+ return False
+ else:
+ return True
return il > ir
def set_prefix(self, prefix): | Fix funky sorting of subsequences | pyQode_pyqode.core | train | py |
be11dd15def9a76fddf82e952bd140973a3ff104 | diff --git a/ella/newman/media/js/newman.js b/ella/newman/media/js/newman.js
index <HASH>..<HASH> 100644
--- a/ella/newman/media/js/newman.js
+++ b/ella/newman/media/js/newman.js
@@ -1090,6 +1090,12 @@ $( function() {
overload_default_submit();
//// End of ajax forms
+ // Packing and unpacking filter list. To be removed when filters are reimplemented.
+ $('#filters :header').live('click', function(evt) {
+ if (evt.which != 1) return true; // just interested in left button
+ $(this).next(':first').filter('ul').slideToggle('slow');
+ });
+
// Re-initialization of third party libraries
/*
$(document).bind('content_added', function() { | Re-introduced the erroneously deleted code for packing and unpacking filters. | ella_ella | train | js |
4ad5d02ef82b6628b85887cca2ddb08ffdbc5c3b | diff --git a/check_api/src/main/java/com/google/errorprone/BaseErrorProneJavaCompiler.java b/check_api/src/main/java/com/google/errorprone/BaseErrorProneJavaCompiler.java
index <HASH>..<HASH> 100644
--- a/check_api/src/main/java/com/google/errorprone/BaseErrorProneJavaCompiler.java
+++ b/check_api/src/main/java/com/google/errorprone/BaseErrorProneJavaCompiler.java
@@ -220,12 +220,14 @@ public class BaseErrorProneJavaCompiler implements JavaCompiler {
.customRefactorer()
.or(
() -> {
- ScannerSupplier toUse = ErrorPronePlugins.loadPlugins(scannerSupplier, context);
+ ScannerSupplier toUse =
+ ErrorPronePlugins.loadPlugins(scannerSupplier, context)
+ .applyOverrides(epOptions);
Set<String> namedCheckers = epOptions.patchingOptions().namedCheckers();
if (!namedCheckers.isEmpty()) {
toUse = toUse.filter(bci -> namedCheckers.contains(bci.canonicalName()));
}
- return ErrorProneScannerTransformer.create(toUse.applyOverrides(epOptions).get());
+ return ErrorProneScannerTransformer.create(toUse.get());
})
.get(); | Fix situation where -Xep:CheckName:WARN -XepPatchChecks:OtherCheck causes
refactorings to trigger for both OtherCheck and CheckName.
RELNOTES: n/a
-------------
Created by MOE: <URL> | google_error-prone | train | java |
c509110ca21d7b375fe08aa12de573059ce56877 | diff --git a/src/LoaderInterface.php b/src/LoaderInterface.php
index <HASH>..<HASH> 100644
--- a/src/LoaderInterface.php
+++ b/src/LoaderInterface.php
@@ -9,7 +9,7 @@
namespace Xidea\User;
-use Xidea\Component\Base\Loader\ModelLoaderInterface;
+use Xidea\Base\Model\LoaderInterface as ModelLoaderInterface;
/**
* @author Artur Pszczółka <[email protected]> | Updated with changes in the base component | XideaPL_user | train | php |
524b1b3f2928f4d967c74c6bc8f472bf088390f1 | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -105,16 +105,15 @@ end
module IncludeAndInherit
def it_can_include_and_inherit(*klasses, &block)
- it_includes_in_and_inherits_from_a_custom_base(*klasses, &block)
+ it_includes_lazy_record_base_module(*klasses, &block)
it_inherits_directly_from_lazy_record_base(*klasses, &block)
end
- def it_includes_in_and_inherits_from_a_custom_base(*klasses, &block)
+ def it_includes_lazy_record_base_module(*klasses, &block)
context "included in custom Base class" do
- eval("CustomBase = Class.new")
- CustomBase.include(LazyRecord::BaseModule)
klasses.each do |klass|
- eval("::#{klass} = Class.new(CustomBase)")
+ eval("::#{klass} = Class.new")
+ eval("::#{klass}.include(LazyRecord::BaseModule)")
end
module_eval(&block)
end | change specs to test class that includes base_module | msimonborg_lazy_record | train | rb |
b6d8e82f234328a81b68fe822597a0181476cf4e | diff --git a/test/bench.js b/test/bench.js
index <HASH>..<HASH> 100644
--- a/test/bench.js
+++ b/test/bench.js
@@ -4,8 +4,11 @@ var FlumeLog = require('../')
var codec = require('flumecodec')
var toCompat = require('../compat')
+var file = '/tmp/bench-flumelog-raf.log'
+try { require('fs').unlinkSync(file) } catch (_) {}
+
require('bench-flumelog')(function () {
- var log = FlumeLog('/tmp/bench-flumelog-raf_' + Date.now(), {
+ var log = FlumeLog(file, {
block: 1024*64,
// codec: codec.json
})
@@ -26,3 +29,4 @@ require('bench-flumelog')(function () {
+ | delete the file before running benchmark, so we do not run out of diskspace | dominictarr_flumelog-aligned-offset | train | js |
2a3e27ca69eadad1da76b7fbd4cdf557b708093f | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -38,6 +38,11 @@ function gitInit({
run('git config mergetool.keepBackup false', {
cwd
});
+
+ // ignore any global .gitignore that will mess with us
+ run('git config --local core.excludesfile false', {
+ cwd
+ });
}
function commit({ | ignore any global .gitignore that will mess with us | kellyselden_git-fixtures | train | js |
2dc8845d4e2e1987782d002e6c5abafd965776f5 | diff --git a/pydisque/client.py b/pydisque/client.py
index <HASH>..<HASH> 100644
--- a/pydisque/client.py
+++ b/pydisque/client.py
@@ -147,7 +147,7 @@ class Client(object):
raise
def _grouper(self, iterable, n, fillvalue=None):
- """Collect data into fixed-length chunks or blocks"""
+ """Collect data into fixed-length chunks or blocks."""
args = [iter(iterable)] * n
return izip_longest(fillvalue=fillvalue, *args)
@@ -206,6 +206,7 @@ class Client(object):
if async:
command += ['ASYNC']
+ # TODO: we need to handle "-PAUSE" messages more appropriately
logger.debug("sending job - %s", command)
job_id = self.execute_command(*command)
logger.debug("sent job - %s", command)
@@ -312,8 +313,8 @@ class Client(object):
if return_dict:
grouped = self._grouper(rtn, 2)
- rtn = dict( (a,b) for a,b in grouped)
-
+ rtn = dict((a, b) for a, b in grouped)
+
return rtn
def qpeek(self, queue_name, count):
@@ -378,7 +379,7 @@ class Client(object):
if return_dict:
grouped = self._grouper(rtn, 2)
- rtn = dict( (a,b) for a,b in grouped)
+ rtn = dict((a, b) for a, b in grouped)
return rtn | Cleaning up before writing the new feature. | ybrs_pydisque | train | py |
a378cffdeae86509533584e668f46463de2864a5 | diff --git a/tests/InjectorTest.php b/tests/InjectorTest.php
index <HASH>..<HASH> 100644
--- a/tests/InjectorTest.php
+++ b/tests/InjectorTest.php
@@ -19,7 +19,7 @@ class InjectorTest extends TestCase
{
return [
['prod-app', 0, 0],
- ['app', 1, 2]
+ ['app', 2, 3]
];
} | fix CountOfNewProvider | bearsunday_BEAR.Package | train | php |
eac4e8e2510485c452af3614ddb8042ceec1fc34 | diff --git a/src/manipulation.js b/src/manipulation.js
index <HASH>..<HASH> 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -620,11 +620,6 @@ jQuery.extend({
// Fix #12392 for WebKit and IE > 9
tmp.textContent = "";
- // Fix #12392 for oldIE
- while ( tmp.firstChild ) {
- tmp.removeChild( tmp.firstChild );
- }
-
// Remember the top-level container for proper cleanup
tmp = container.lastChild;
} | Remove removal of container children through removeChild method | jquery_jquery | train | js |
bd11cd7979914f55b62bc074c6414121a742f144 | diff --git a/src/annotation/annotations/requires.js b/src/annotation/annotations/requires.js
index <HASH>..<HASH> 100644
--- a/src/annotation/annotations/requires.js
+++ b/src/annotation/annotations/requires.js
@@ -70,11 +70,11 @@ module.exports = {
item.requires.toJSON = utils.mapArray.bind(null, item.requires, function(item){
var obj = {
- external : item.external
+ type : item.type,
+ name : item.name,
+ external : item.external,
};
if ( item.external ){
- obj.type = item.type;
- obj.name = item.name;
obj.url = item.url;
} else {
obj.description = item.description; | Always type and name in JSON representation | SassDoc_sassdoc | train | js |
c2401684b98218535099b795a9f1adb3f456fdc1 | diff --git a/app/Controllers/AdminAccessController.php b/app/Controllers/AdminAccessController.php
index <HASH>..<HASH> 100644
--- a/app/Controllers/AdminAccessController.php
+++ b/app/Controllers/AdminAccessController.php
@@ -145,9 +145,14 @@ class AdminAccessController extends AdminBaseController
*/
public function logout()
{
+ // Unset authenticated session
$security = $this->container->accessHandler;
$security->endAuthenticatedSession();
+ // Unset CSRF Token
+ $csrfGuard = $this->container->csrfGuard;
+ $csrfGuard->unsetToken();
+
return $this->redirect('home');
}
}
diff --git a/app/Library/Handlers/CsrfGuard.php b/app/Library/Handlers/CsrfGuard.php
index <HASH>..<HASH> 100644
--- a/app/Library/Handlers/CsrfGuard.php
+++ b/app/Library/Handlers/CsrfGuard.php
@@ -108,6 +108,18 @@ class CsrfGuard
}
/**
+ * Unset Token
+ *
+ * Remove token key and value from session
+ * @param void
+ * @return void
+ */
+ public function unsetToken()
+ {
+ $this->session->unsetData($this->csrfTokenName);
+ }
+
+ /**
* Validate Token
*
* Uses hash_equals() to compare saved token ($this->csrfTokenValue) with provided token | Unset CSRF token when logging out. | PitonCMS_Engine | train | php,php |
6470743683b0127d88c2b7ae6e1a6cac890eae83 | diff --git a/go-serial-test/go-serial-test.go b/go-serial-test/go-serial-test.go
index <HASH>..<HASH> 100644
--- a/go-serial-test/go-serial-test.go
+++ b/go-serial-test/go-serial-test.go
@@ -11,7 +11,7 @@ import (
"io"
"os"
- "github.com/cbrake/go-serial/serial"
+ "github.com/jacobsa/go-serial/serial"
)
func usage() { | switch to github.com/jacobsa import | jacobsa_go-serial | train | go |
46547d22a8321fdfcb2f0dbdb69c56d0505113b5 | diff --git a/src/Router.php b/src/Router.php
index <HASH>..<HASH> 100644
--- a/src/Router.php
+++ b/src/Router.php
@@ -57,6 +57,11 @@ class Router extends Container
return $match;
}
+ public function applyAutoFilter(Match $match)
+ {
+ return call_user_func($this->autoFilter, $match);
+ }
+
public function resolveFilter($name)
{
if (isset($this->filters[$name]))
@@ -127,7 +132,7 @@ class Router extends Container
}
elseif ($this->autoFilter)
{
- return call_user_func($this->autoFilter, $match);
+ return $this->applyAutoFilter($match);
}
}
} | allow the autofilter to be called externally | fuelphp_routing | train | php |
17fcd06780d1aff9dc5029f48fca5682aa753c37 | diff --git a/src/ui/controls/progress/progress.view.js b/src/ui/controls/progress/progress.view.js
index <HASH>..<HASH> 100644
--- a/src/ui/controls/progress/progress.view.js
+++ b/src/ui/controls/progress/progress.view.js
@@ -44,8 +44,8 @@ export default class ProgressView {
this.$node
.append(this.$input)
- .append(this.$played)
- .append(this.$buffered);
+ .append(this.$buffered)
+ .append(this.$played);
this._bindCallbacks();
this._bindEvents(); | Small change in DOM structure for ProgressControl View | wix_playable | train | js |
a8b17c725c2727548aadf58d196dd9fb0496fd9a | diff --git a/packages/origin.js/test/contract-service.test.js b/packages/origin.js/test/contract-service.test.js
index <HASH>..<HASH> 100644
--- a/packages/origin.js/test/contract-service.test.js
+++ b/packages/origin.js/test/contract-service.test.js
@@ -1,6 +1,7 @@
import { expect } from "chai"
import ContractService from "../src/contract-service"
import { ipfsHashes } from "./fixtures"
+import Web3 from 'web3'
const methodNames = [
"submitListing",
@@ -12,7 +13,9 @@ describe("ContractService", () => {
let contractService
beforeEach(() => {
- contractService = new ContractService()
+ let provider = new Web3.providers.HttpProvider('http://localhost:9545')
+ let web3 = new Web3(provider)
+ contractService = new ContractService({ web3 })
})
methodNames.forEach(methodName => { | Use our web3 rather than the browser's web3 for contract service tests | OriginProtocol_origin-js | train | js |
238d6ef567ffdcceb20fcc12ca69980a9f551f35 | diff --git a/python/src/nnabla/utils/converter/setup.py b/python/src/nnabla/utils/converter/setup.py
index <HASH>..<HASH> 100644
--- a/python/src/nnabla/utils/converter/setup.py
+++ b/python/src/nnabla/utils/converter/setup.py
@@ -35,7 +35,7 @@ if __name__ == '__main__':
install_requires = [
'ply',
- 'tensorflow',
+ 'tensorflow==2.5.1',
'onnx_tf',
'tf2onnx==1.7.2',
'tensorflow-addons', | limit tensorflow version to <I> | sony_nnabla | train | py |
d86e7ae3a05fa2888d1b9d83bd682771f53cea7a | diff --git a/internal/validate/spec.go b/internal/validate/spec.go
index <HASH>..<HASH> 100644
--- a/internal/validate/spec.go
+++ b/internal/validate/spec.go
@@ -21,10 +21,10 @@ import (
"regexp"
"strings"
+ "github.com/go-openapi/analysis"
"github.com/go-openapi/jsonpointer"
"github.com/go-openapi/loads"
"github.com/go-openapi/spec"
- "github.com/go-swagger/go-swagger/analysis"
"github.com/go-swagger/go-swagger/errors"
"github.com/go-swagger/go-swagger/strfmt"
)
diff --git a/internal/validate/spec_test.go b/internal/validate/spec_test.go
index <HASH>..<HASH> 100644
--- a/internal/validate/spec_test.go
+++ b/internal/validate/spec_test.go
@@ -18,10 +18,10 @@ import (
"path/filepath"
"testing"
+ "github.com/go-openapi/analysis"
"github.com/go-openapi/loads"
"github.com/go-openapi/loads/fmts"
"github.com/go-openapi/spec"
- "github.com/go-swagger/go-swagger/analysis"
"github.com/go-swagger/go-swagger/internal/testing/petstore"
"github.com/go-swagger/go-swagger/strfmt"
"github.com/stretchr/testify/assert" | moves loads and analysis into their own packages | go-openapi_validate | train | go,go |
b5e51ff39a78dd7286c4f6e8c884de2f015f3b5e | diff --git a/lib/graphql.rb b/lib/graphql.rb
index <HASH>..<HASH> 100644
--- a/lib/graphql.rb
+++ b/lib/graphql.rb
@@ -55,31 +55,6 @@ module GraphQL
def self.scan_with_ragel(graphql_string)
GraphQL::Language::Lexer.tokenize(graphql_string)
end
-
- # Support Ruby 2.2 by implementing `-"str"`. If we drop 2.2 support, we can remove this backport.
- if !String.method_defined?(:-@)
- module StringDedupBackport
- refine String do
- def -@
- if frozen?
- self
- else
- self.dup.freeze
- end
- end
- end
- end
- end
-
- if !String.method_defined?(:match?)
- module StringMatchBackport
- refine String do
- def match?(pattern)
- self =~ pattern
- end
- end
- end
- end
end
# Order matters for these: | refactor: remove unsupported String refinements | rmosolgo_graphql-ruby | train | rb |
9da25c0e9cea5ab9701f285c38a098914ad58d4f | diff --git a/core/src/main/java/com/orientechnologies/common/jnr/ONative.java b/core/src/main/java/com/orientechnologies/common/jnr/ONative.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/orientechnologies/common/jnr/ONative.java
+++ b/core/src/main/java/com/orientechnologies/common/jnr/ONative.java
@@ -38,7 +38,7 @@ import java.util.concurrent.locks.ReentrantLock;
public class ONative {
private static volatile OCLibrary C_LIBRARY;
- private static final String DEFAULT_MEMORY_CGROUP_PATH = "/sys/fs/memory";
+ private static final String DEFAULT_MEMORY_CGROUP_PATH = "/sys/fs/cgroup/memory";
private static volatile ONative instance = null;
private static final Lock initLock = new ReentrantLock();
@@ -475,7 +475,7 @@ public class ONative {
continue;
}
- final String fsType = fsParts[0];
+ final String fsType = fsParts[2];
//all cgroup controllers have "cgroup" as file system type
if (fsType.equals("cgroup")) {
//get mounting path of cgroup
@@ -570,4 +570,4 @@ public class ONative {
this.insideContainer = insideContainer;
}
}
-}
\ No newline at end of file
+} | Fixes detection of memory cgroups
Fixes incorrect detection of memory cgroups on modern Linux distributions. | orientechnologies_orientdb | train | java |
63d090752f0f6db83f396128e593f5ca355f2b3b | diff --git a/lib/Field.php b/lib/Field.php
index <HASH>..<HASH> 100644
--- a/lib/Field.php
+++ b/lib/Field.php
@@ -188,7 +188,7 @@ class Field extends AbstractModel
*/
function required($t = UNDEFINED)
{
- throw $this->exception('required() is obsolete, use mandatory()');
+ return $this->mandatory($t);
}
/** | revert decision to obsolete 'required' | atk4_atk4 | train | php |
45d7271a0290597003e14ec8aa90b273dff3fa83 | diff --git a/src/CommandHandling/ResqueCommandBus.php b/src/CommandHandling/ResqueCommandBus.php
index <HASH>..<HASH> 100644
--- a/src/CommandHandling/ResqueCommandBus.php
+++ b/src/CommandHandling/ResqueCommandBus.php
@@ -117,6 +117,7 @@ class ResqueCommandBus extends CommandBusDecoratorBase implements ContextAwareIn
*/
public function deferredDispatch($jobId, $command)
{
+ $exception = NULL;
$currentCommandLogger = null;
if ($this->logger) {
$jobMetadata = array(
@@ -138,15 +139,18 @@ class ResqueCommandBus extends CommandBusDecoratorBase implements ContextAwareIn
try {
parent::dispatch($command);
- $this->setContext(null);
- }
- catch (\Exception $e) {
- $this->setContext(null);
- throw $e;
+ } catch (\Exception $e) {
+ $exception = $e;
}
+ $this->setContext(null);
+
if ($currentCommandLogger) {
$currentCommandLogger->info('job_finished');
}
+
+ if ($exception) {
+ throw $exception;
+ }
}
} | iii-<I>: Ensure job_finished is logged as well when an exception occurs in command handling | cultuurnet_udb3-php | train | php |
7cfcd406a9af2846548ac78743bb47c6ff5bf534 | diff --git a/gosu-core/src/main/java/gw/internal/gosu/parser/JavaFieldPropertyInfo.java b/gosu-core/src/main/java/gw/internal/gosu/parser/JavaFieldPropertyInfo.java
index <HASH>..<HASH> 100644
--- a/gosu-core/src/main/java/gw/internal/gosu/parser/JavaFieldPropertyInfo.java
+++ b/gosu-core/src/main/java/gw/internal/gosu/parser/JavaFieldPropertyInfo.java
@@ -61,6 +61,7 @@ public class JavaFieldPropertyInfo extends JavaBaseFeatureInfo implements IJavaF
if (type == null) {
throw new IllegalArgumentException("Feature type cannot be null");
}
+ type = TypeLord.replaceRawGenericTypesWithDefaultParameterizedTypes( type );
_type = type;
_field = field;
if (_field instanceof FieldJavaClassField) { | IDE-<I>. Put back prior fix | gosu-lang_gosu-lang | train | java |
aaeeff387ec4cfa16a65de36e60df36a3ba4854f | diff --git a/models/queued_task.php b/models/queued_task.php
index <HASH>..<HASH> 100644
--- a/models/queued_task.php
+++ b/models/queued_task.php
@@ -26,12 +26,13 @@ class QueuedTask extends AppModel {
* @param string $reference any array
* @return bool success
*/
- public function createJob($jobName, $data, $notBefore = null, $group = null) {
+ public function createJob($jobName, $data, $notBefore = null, $group = null, $reference = null) {
$data = array(
'jobtype' => $jobName,
'data' => serialize($data),
'group' => $group,
+ 'reference' => $reference,
);
if ($notBefore != null) {
$data['notbefore'] = date('Y-m-d H:i:s', strtotime($notBefore)); | Forgot to include to facilitate identifying the tasks, a reference field has been added to the queued_tasks table which is now the 5th parameter of the QueuedTask::createJob() method | dereuromark_cakephp-queue | train | php |
558bd6a27b952c16631f994c76ab79c5fdf29661 | diff --git a/lib/determine-basal/determine-basal.js b/lib/determine-basal/determine-basal.js
index <HASH>..<HASH> 100644
--- a/lib/determine-basal/determine-basal.js
+++ b/lib/determine-basal/determine-basal.js
@@ -494,7 +494,9 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
// calculate a long enough zero temp to eventually correct back up to target
var smbTarget = target_bg;
- var worstCaseInsulinReq = (smbTarget - naive_eventualBG) / sens + insulinReq/3;
+ //var worstCaseInsulinReq = (smbTarget - naive_eventualBG) / sens + insulinReq/3;
+ // only zero-temp for insulin already delivered, to help with intermittent pump comms
+ var worstCaseInsulinReq = (smbTarget - naive_eventualBG) / sens;
var durationReq = round(60*worstCaseInsulinReq / profile.current_basal);
if (durationReq < 0) {
durationReq = 0; | only zero-temp for insulin already delivered, to help with intermittent pump comms | openaps_oref0 | train | js |
85f76cde1606ae7ba434cbb64ec7fd174d10f93d | diff --git a/lib/better_receive/base.rb b/lib/better_receive/base.rb
index <HASH>..<HASH> 100644
--- a/lib/better_receive/base.rb
+++ b/lib/better_receive/base.rb
@@ -11,7 +11,7 @@ module BetterReceive
attr_reader :subject
def subject_is_any_instance?
- subject.is_a?(RSpec::Mocks::AnyInstance::Recorder)
+ defined?(RSpec::Mocks::AnyInstance) && subject.is_a?(RSpec::Mocks::AnyInstance::Recorder)
end
def respond_to(selector)
diff --git a/lib/better_receive/version.rb b/lib/better_receive/version.rb
index <HASH>..<HASH> 100644
--- a/lib/better_receive/version.rb
+++ b/lib/better_receive/version.rb
@@ -1,3 +1,3 @@
module BetterReceive
- BETTER_VERSION = "0.4.0"
+ BETTER_VERSION = "0.4.1"
end | Check that RSpec has .any_instance | se3000_better_receive | train | rb,rb |
686f85515f64aa5cffd44a392d9c2ea0b8b0d51f | diff --git a/activerecord/test/cases/serialized_attribute_test.rb b/activerecord/test/cases/serialized_attribute_test.rb
index <HASH>..<HASH> 100644
--- a/activerecord/test/cases/serialized_attribute_test.rb
+++ b/activerecord/test/cases/serialized_attribute_test.rb
@@ -22,7 +22,7 @@ class SerializedAttributeTest < ActiveRecord::TestCase
end
def test_serialize_does_not_eagerly_load_columns
- Topic.reset_column_information
+ reset_column_information_of(Topic)
assert_no_queries do
Topic.serialize(:content)
end
@@ -377,7 +377,8 @@ class SerializedAttributeTest < ActiveRecord::TestCase
topic.update group: "1"
model.serialize :group, JSON
- model.reset_column_information
+
+ reset_column_information_of(model)
# This isn't strictly necessary for the test, but a little bit of
# knowledge of internals allows us to make failures far more likely.
@@ -397,4 +398,12 @@ class SerializedAttributeTest < ActiveRecord::TestCase
# raw string ("1"), or raise an exception.
assert_equal [1] * threads.size, threads.map(&:value)
end
+
+ private
+
+ def reset_column_information_of(topic_class)
+ topic_class.reset_column_information
+ # reset original topic to undefine attribute methods
+ ::Topic.reset_column_information
+ end
end | Reset column info on original Topic in serialized attr test
Call .reset_column_information on ::Topic in serialized attribute
test so that attribute methods are safely undefined for all topics. | rails_rails | train | rb |
c8774cd7f55e21db2cf9107d8aab4c0b782de505 | diff --git a/sprd/model/processor/BasketItemProcessor.js b/sprd/model/processor/BasketItemProcessor.js
index <HASH>..<HASH> 100644
--- a/sprd/model/processor/BasketItemProcessor.js
+++ b/sprd/model/processor/BasketItemProcessor.js
@@ -23,6 +23,13 @@ define(['sprd/model/processor/DefaultProcessor', 'sprd/model/Shop', 'sprd/model/
}
elementPayload["size"]["name"] = prop.value;
}
+ if (prop.key === "appearanceLabel") {
+ if (!elementPayload["appearance"]) {
+ elementPayload["appearance"] = {};
+ }
+ elementPayload["appearance"]["name"] = prop.value;
+ }
+
}
var shop = this.$dataSource.createEntity(Shop, payload.shop.id); | DEV-<I> - Implement bulk size selection | spreadshirt_rAppid.js-sprd | train | js |
579b3e3e1978af40a545485cef666a3cb2a22e6a | diff --git a/src/jquery.peity.js b/src/jquery.peity.js
index <HASH>..<HASH> 100644
--- a/src/jquery.peity.js
+++ b/src/jquery.peity.js
@@ -4,7 +4,7 @@
// http://benpickles.github.com/peity/
//
// Released under MIT license.
-(function($) {
+(function($, document) {
$.fn.peity = function(type, options) {
if (document.createElement("canvas").getContext) {
this.each(function() {
@@ -154,4 +154,4 @@
}
}
);
-})(jQuery);
+})(jQuery, document); | Pass `document` to function to squeeze the minified version a little more. | benpickles_peity | train | js |
9457d7302e9e26bfb5fc207344182babe2abe235 | diff --git a/lib/site-inspector.rb b/lib/site-inspector.rb
index <HASH>..<HASH> 100644
--- a/lib/site-inspector.rb
+++ b/lib/site-inspector.rb
@@ -1,7 +1,5 @@
-
-# needed for HTTP analysis
require 'open-uri'
-require "addressable/uri"
+require 'addressable/uri'
require 'public_suffix'
require 'typhoeus'
diff --git a/lib/site-inspector/endpoint.rb b/lib/site-inspector/endpoint.rb
index <HASH>..<HASH> 100644
--- a/lib/site-inspector/endpoint.rb
+++ b/lib/site-inspector/endpoint.rb
@@ -51,9 +51,14 @@ class SiteInspector
@response ||= request
end
- # Does the endpoint return a response code between 200 and 300?
+ # Does the server return any response? (including 50x)
+ def response?
+ !!response
+ end
+
+ # Does the endpoint return a 2xx or 3xx response code?
def up?
- response && response_code.start_with?("2")
+ response && response_code.start_with?("2") || response_code.start_with?("3")
end
def down? | up should include <I>x | benbalter_site-inspector | train | rb,rb |
f9e1f9dc1445c0717de6f5e3a19fea6d9d1d7672 | diff --git a/src/loadNamespaces.js b/src/loadNamespaces.js
index <HASH>..<HASH> 100644
--- a/src/loadNamespaces.js
+++ b/src/loadNamespaces.js
@@ -1,6 +1,5 @@
-// shim object entries
-if (!Object.entries)
- Object.entries = function( obj ){
+const objectEntries = Object.entries ||
+ function( obj ){
var ownProps = Object.keys( obj ),
i = ownProps.length,
resArray = new Array(i); // preallocate the Array
@@ -14,7 +13,7 @@ if (!Object.entries)
function eachComponents(components, iterator) {
for (let i = 0, l = components.length; i < l; i++) { // eslint-disable-line id-length
if (typeof components[i] === 'object') {
- for (const [key, value] of Object.entries(components[i])) {
+ for (const [key, value] of objectEntries(components[i])) {
iterator(value, i, key);
}
} else { | Don't polyfill Object.entries globally
Patching `Object.entries` affects other code beyond this library, which
ideally should not happen. With this patch the polyfill is still used
when necessary but the global environment is not unexpectedly changed by
including react-i<I>next :) | i18next_react-i18next | train | js |
c5b2936d2315b79f718a1b1c0f7f1f4e34fc3984 | diff --git a/src/utils/I18nManager.spec.js b/src/utils/I18nManager.spec.js
index <HASH>..<HASH> 100644
--- a/src/utils/I18nManager.spec.js
+++ b/src/utils/I18nManager.spec.js
@@ -98,6 +98,9 @@ describe('I18nManager', () => {
assert.equal('10,000.00', i18n.formatDecimalNumber(10000));
assert.equal(10000, i18n.parseDecimalNumber('10,000.00'));
+
+ assert.strictEqual(i18n.formatDecimalNumber(123456789.12), '123,456,789.12');
+ assert.strictEqual(i18n.formatDecimalNumber(55454545.12), '55,454,545.12');
});
it('should formatted message', () => { | (CMMN-<I>) Added tests for formatDecimalNumber method. | OpusCapita_i18n | train | js |
4d888448bb6baf7ebbf25ccc74a3cb242eb97d8a | diff --git a/src/Filesystem/DefaultFilesystem.php b/src/Filesystem/DefaultFilesystem.php
index <HASH>..<HASH> 100644
--- a/src/Filesystem/DefaultFilesystem.php
+++ b/src/Filesystem/DefaultFilesystem.php
@@ -96,8 +96,15 @@ class DefaultFilesystem implements Filesystem
touch($targetFile);
$stream = $this->filesystem->disk($media->disk)->readStream($sourceFile);
- file_put_contents($targetFile, stream_get_contents($stream), FILE_APPEND);
+
+ $targetFileStream = fopen($targetFile, 'a');
+ while (!feof($stream)) {
+ $chunk = fread($stream, 1024);
+ fwrite($targetFileStream, $chunk);
+ }
+
fclose($stream);
+ fclose($targetFileStream);
return $targetFile;
} | copy via streams (#<I>)
this prevents allowed memory exhausted while copying big files | spatie_laravel-medialibrary | train | php |
dc1b0ee2e1ec1f49e4b0d660b1b117c4d0b628e8 | diff --git a/build/webpack.dev.js b/build/webpack.dev.js
index <HASH>..<HASH> 100644
--- a/build/webpack.dev.js
+++ b/build/webpack.dev.js
@@ -13,16 +13,11 @@ module.exports = {
publicPath: '/',
chunkFilename: 'async_[name].js'
},
- stats: {
- modules: false,
- children: false
- },
devServer: {
open: true,
progress: true,
host: '0.0.0.0',
- stats: 'errors-only',
- clientLogLevel: 'warning'
+ stats: 'errors-only'
},
resolve: {
extensions: ['.js', '.ts', '.tsx', '.vue', '.less']
@@ -70,7 +65,6 @@ module.exports = {
},
plugins: [
new VueLoaderPlugin(),
- // new ProgressBarPlugin(),
new HtmlWebpackPlugin({
chunks: ['vant-docs'],
template: 'docs/site/desktop/index.html', | [Build] update webpack.dev.js | youzan_vant | train | js |
4e9fe8ed22985c69a127ed7718bee51bb61a8cb8 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -46,7 +46,8 @@ setup(
include_package_data=True,
package_data={
'estnltk': ['corpora/arvutustehnika_ja_andmetootlus/*.xml', 'corpora/*.json', 'java/res/*.*'],
- 'estnltk.tests': ['test_morph/*.csv', 'test_taggers/test_dict_taggers/*.csv'],
+ 'estnltk.taggers': ['standard_taggers/*.csv'],
+ 'estnltk.tests': ['test_morph/*.csv', 'test_taggers/test_dict_taggers/*.csv', 'test_taggers/test_standard_taggers/*.json'],
'estnltk.vabamorf': ['dct/*.dct'],
'estnltk.estner': ['gazetteer/*', 'models/py2_default/*', 'models/py3_default/*'],
'estnltk.wordnet': ['*.cnf', 'data/*.txt', 'data/*.soi', 'data/*.cnf', 'data/scripts/*.py'], | Updated setup.py: added more resource files to installable package data | estnltk_estnltk | train | py |
1abb77fa6abdc04a2ea2064da9d02c5507d339ae | diff --git a/LiSE/LiSE/character.py b/LiSE/LiSE/character.py
index <HASH>..<HASH> 100644
--- a/LiSE/LiSE/character.py
+++ b/LiSE/LiSE/character.py
@@ -82,7 +82,6 @@ class AbstractCharacter(object):
pred = getatt('preportal')
adj = succ = edge = getatt('portal')
- graph = getatt('stat')
def do(self, func, *args, **kwargs):
"""Apply the function to myself, and return myself. | Unshadow the .graph attribute
I need that attribute. Gorm graphs keep all their stats there.
It can't be an alias. | LogicalDash_LiSE | train | py |
1728a8852c90a83982a4c5b05bf9e397cbd783c8 | diff --git a/spec/graphql/enum_type_spec.rb b/spec/graphql/enum_type_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/graphql/enum_type_spec.rb
+++ b/spec/graphql/enum_type_spec.rb
@@ -113,9 +113,13 @@ describe GraphQL::EnumType do
describe "validates enum value name uniqueness" do
it "raises an exception when adding a duplicate enum value name" do
- assert_raises "Enum value names must be unique. Value `COW` already exists on Enum `DairyAnimalEnum`." do
+ expected_message = "Enum value names must be unique. Value `COW` already exists on Enum `DairyAnimalEnum`."
+
+ exception = assert_raises do
enum.add_value(GraphQL::EnumType::EnumValue.define(name: "COW"))
end
+
+ assert_equal(expected_message, expected_message)
end
end
end | assert_raises doesnt take expected message as argument | rmosolgo_graphql-ruby | train | rb |
42f479d34d6e5d051948f747cd322315df1e1f7e | diff --git a/source/transform-for-format.js b/source/transform-for-format.js
index <HASH>..<HASH> 100644
--- a/source/transform-for-format.js
+++ b/source/transform-for-format.js
@@ -22,20 +22,28 @@ module.exports = function(format, opt) {
return function(argument) {
var blanks = {};
var path = opt['--blanks'];
+ var options = {};
+ if ('--title' in opt) {
+ options.title = opt['--title'];
+ }
if (path) {
blanks = JSON.parse(require('fs').readFileSync(path).toString());
}
- return html(argument, blanks) + '\n';
+ return html(argument, blanks, options) + '\n';
};
} else if (format === 'html5') {
var html = require('commonform-html');
return function(argument) {
var blanks = {};
var path = opt['--blanks'];
+ var options = {html5: true};
+ if ('--title' in opt) {
+ options.title = opt['--title'];
+ }
if (path) {
blanks = JSON.parse(require('fs').readFileSync(path).toString());
}
- return html(argument, blanks, {html5: true}) + '\n';
+ return html(argument, blanks, options) + '\n';
};
} else if (format === 'latex') {
var latex = require('commonform-latex'); | Pass title as option to HTML renderers | commonform_commonform-cli | train | js |
74fb9b7c4f5a1252e255071615bd514ddc927fd7 | diff --git a/www/email_composer.js b/www/email_composer.js
index <HASH>..<HASH> 100644
--- a/www/email_composer.js
+++ b/www/email_composer.js
@@ -27,7 +27,8 @@ var exec = require('cordova/exec'),
*/
exports.aliases = {
gmail: isAndroid ? 'com.google.android.gm' : 'googlegmail://co',
- outlook: isAndroid ? 'com.microsoft.office.outlook' : 'ms-outlook://compose'
+ outlook: isAndroid ? 'com.microsoft.office.outlook' : 'ms-outlook://compose',
+ hub: isAndroid ? 'com.blackberry.hub' : undefined
};
/** | Add alias for blackberry hub mail client | katzer_cordova-plugin-email-composer | train | js |
5f09a6c4f6a1d7d6e849aeae3f159d949ec72756 | diff --git a/main.go b/main.go
index <HASH>..<HASH> 100644
--- a/main.go
+++ b/main.go
@@ -64,7 +64,7 @@ func main() {
client.AddMetric(envelope)
case <-done:
postMetrics(client)
- break
+ return
}
}
} | return instead of breaking out of select in main.go
- break would break out of the select statement and not the for loop | cloudfoundry-attic_datadog-firehose-nozzle | train | go |
3ee78c56b778842ddd52d9f4afa7aabf40a9e4cd | diff --git a/webpack.config.js b/webpack.config.js
index <HASH>..<HASH> 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -136,5 +136,8 @@ module.exports = (env) => {
'numeral': 'numeral',
'__': '__',
},
+ watchOptions: {
+ ignored: ['**/.*.sw[po]'],
+ },
};
}; | webpack.config - add watchOptions to ignore vim swapfiles | ManageIQ_ui-components | train | js |
adc115b70981291f935bcab7ad8d873b77ffa3c7 | diff --git a/generators/generator-constants.js b/generators/generator-constants.js
index <HASH>..<HASH> 100644
--- a/generators/generator-constants.js
+++ b/generators/generator-constants.js
@@ -85,7 +85,7 @@ const DOCKER_GRAFANA = 'grafana/grafana:7.1.5';
const DOCKER_JENKINS = 'jenkins/jenkins:lts';
const DOCKER_SWAGGER_EDITOR = 'swaggerapi/swagger-editor:latest';
const DOCKER_COMPOSE_FORMAT_VERSION = '2';
-const DOCKER_PROMETHEUS_OPERATOR = 'quay.io/coreos/prometheus-operator:v0.41.0';
+const DOCKER_PROMETHEUS_OPERATOR = 'quay.io/coreos/prometheus-operator:v0.41.1';
const DOCKER_GRAFANA_WATCHER = 'quay.io/coreos/grafana-watcher:v0.0.8';
// Kubernetes versions | Update quay.io/coreos/prometheus-operator docker image version to <I> | jhipster_generator-jhipster | train | js |
7d2661b8153220157b6e47eb6d89b030b2c1718d | diff --git a/sos/plugins/systemd.py b/sos/plugins/systemd.py
index <HASH>..<HASH> 100644
--- a/sos/plugins/systemd.py
+++ b/sos/plugins/systemd.py
@@ -70,5 +70,6 @@ class Systemd(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"/etc/modules-load.d/*.conf",
"/etc/yum/protected.d/systemd.conf"
])
+ self.add_forbidden_path('/dev/null')
# vim: set et ts=4 sw=4 : | [systemd] avoid collecting /dev/null
Avoid "collecting" /dev/null as part of the systemd plugin.
In my testing that was the only plugin that brought it in.
Creating these character devices makes it harder to manage
(delete) extracted sosreports without more permissions.
This supersedes #<I> which removed the ability to "collect"
char devices. As we only have one example today, let's just
exclude that.
Resolves: #<I> | sosreport_sos | train | py |
Subsets and Splits