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
|
---|---|---|---|---|---|
e9f683e06cb8351d0a2883eb8e49a4856c36779a | diff --git a/quarkc/_metadata.py b/quarkc/_metadata.py
index <HASH>..<HASH> 100644
--- a/quarkc/_metadata.py
+++ b/quarkc/_metadata.py
@@ -19,7 +19,7 @@ __all__ = [
"__license__", "__copyright__",
]
-__title__ = 'datawire-quark'
+__title__ = 'datawire-quarkdev'
__version__ = '0.6.74'
__summary__ = "Quark: an IDL for high level (micro)service interfaces" | Changed version to datawire-quarkdev, <I> (doc 1). [ci skip] | datawire_quark | train | py |
324680ac3401891c98b6db98c1fe62bfee8f9007 | diff --git a/ui/src/data_explorer/components/FieldList.js b/ui/src/data_explorer/components/FieldList.js
index <HASH>..<HASH> 100644
--- a/ui/src/data_explorer/components/FieldList.js
+++ b/ui/src/data_explorer/components/FieldList.js
@@ -74,17 +74,15 @@ const FieldList = React.createClass({
return (
<div className="query-builder--column">
- <div className="query-builder--heading">Fields</div>
- {
- hasAggregates ?
- <div className="qeditor--list-header">
- <div className="group-by-time">
- <p>Group by Time</p>
- <GroupByTimeDropdown isOpen={!hasGroupByTime} selected={query.groupBy.time} onChooseGroupByTime={this.handleGroupByTime} />
- </div>
+ <div className="query-builder--heading">
+ <span>Fields</span>
+ {hasAggregates ?
+ <div className="group-by-time">
+ <p>Group by Time</p>
+ <GroupByTimeDropdown isOpen={!hasGroupByTime} selected={query.groupBy.time} onChooseGroupByTime={this.handleGroupByTime} />
</div>
- : null
- }
+ : null}
+ </div>
{this.renderList()}
</div>
) | Update appearance of group by time in field list heading | influxdata_influxdb | train | js |
86b1c8fc2849e8f65f473286a3b2d09f4b76eaf7 | diff --git a/filesystem/Folder.php b/filesystem/Folder.php
index <HASH>..<HASH> 100644
--- a/filesystem/Folder.php
+++ b/filesystem/Folder.php
@@ -165,6 +165,7 @@ class Folder extends File {
// Check allowed extensions, unless admin users are allowed to bypass these exclusions
if($checkExtensions
+ && !is_dir($baseDir . $actualChild)
&& ($extension = self::get_file_extension($actualChild))
&& !in_array(strtolower($extension), $allowedExtensions)
) { | FIX file sync removes folders with dot in name
Prevent file extension validation being applied to folders during sync (fixes #<I>) | silverstripe_silverstripe-framework | train | php |
f6424fe87f5e5136a6282b846cd461eb6122c494 | diff --git a/themes/perun/perun/disco-tpl.php b/themes/perun/perun/disco-tpl.php
index <HASH>..<HASH> 100644
--- a/themes/perun/perun/disco-tpl.php
+++ b/themes/perun/perun/disco-tpl.php
@@ -58,7 +58,7 @@ if ($this->isAddInstitutionApp()) {
$this->data['header'] = $this->t('{perun:disco:header}');
if ($displaySpName && !empty($spName)) {
- $this->data['header'] .= ' ' . $this->t('{perun:disco:header_display_service}') . ' ' . $spName;
+ $this->data['header'] .= ' ' . $this->t('{perun:disco:header_display_service}') . ' <i>' . $spName . '</i>';
}
} | refactor: 💡 Display SP name in italics | CESNET_perun-simplesamlphp-module | train | php |
9b6106fed0ccb8eb6a3051b6de7c2b14e331a09f | diff --git a/lib/draper/view_context.rb b/lib/draper/view_context.rb
index <HASH>..<HASH> 100644
--- a/lib/draper/view_context.rb
+++ b/lib/draper/view_context.rb
@@ -91,7 +91,7 @@ module Draper
# @deprecated Use {controller=} instead.
def self.current_controller=(controller)
- ActiveSupport::Deprecation.warn("Draper::ViewContext.current_controller= is deprecated (use controller instead)", caller)
+ ActiveSupport::Deprecation.warn("Draper::ViewContext.current_controller= is deprecated (use controller= instead)", caller)
self.controller = controller
end | Fix warning message from `controller` to `controller=` (#<I>) | drapergem_draper | train | rb |
300e3f5e90475053a6e44f5cb45db9221565908f | diff --git a/googleanalytics/columns.py b/googleanalytics/columns.py
index <HASH>..<HASH> 100644
--- a/googleanalytics/columns.py
+++ b/googleanalytics/columns.py
@@ -221,7 +221,7 @@ class ColumnList(addressable.List):
def __init__(self, columns, **options):
options['items'] = columns
options['name'] = self.COLUMN_TYPE.__class__.__name__
- options['indices'] = ('id', 'name', 'slug')
+ options['indices'] = ('name', 'id', 'slug', 'pyslug')
options['insensitive'] = True
super(ColumnList, self).__init__(**options) | Add pyslug index to addressable lists for columns. | debrouwere_google-analytics | train | py |
be8d9acef5f4838164a1690fc1e92f92ead383a4 | diff --git a/Plugin.php b/Plugin.php
index <HASH>..<HASH> 100644
--- a/Plugin.php
+++ b/Plugin.php
@@ -109,7 +109,7 @@ class Plugin extends PluginBase
'config' => [
'label' => 'Builder',
'icon' => 'icon-wrench',
- 'description' => 'Set your plugins namespace and author name.',
+ 'description' => 'Set your author name and namespace for plugin creation.',
'class' => 'RainLab\Builder\Models\Settings',
'permissions' => ['rainlab.builder.manage_plugins'],
'order' => 600 | Improve Settings menu item description (#<I>)
This change ensures the description is clear and is relevant as to what it does. | rainlab_builder-plugin | train | php |
725abfaf15637faae7bf1820fd2537fa4198d4b1 | diff --git a/ng-FitText.js b/ng-FitText.js
index <HASH>..<HASH> 100644
--- a/ng-FitText.js
+++ b/ng-FitText.js
@@ -56,6 +56,8 @@
},10);
})();
+ scope.$watch(attrs.ngModel, function() { scope.resizer() });
+
config.debounce == true
? angular.element(window).bind('resize', _debounce( function(){ scope.$apply( scope.resizer )}, config.delay ))
: angular.element(window).bind('resize', function(){ scope.$apply( scope.resizer )}); | Added watch for ng-model | patrickmarabeas_ng-FitText.js | train | js |
0536ad31ce577e96290975ff07773378aa31c395 | diff --git a/code/form/WidgetAreaEditor.php b/code/form/WidgetAreaEditor.php
index <HASH>..<HASH> 100644
--- a/code/form/WidgetAreaEditor.php
+++ b/code/form/WidgetAreaEditor.php
@@ -42,10 +42,13 @@ class WidgetAreaEditor extends FormField {
foreach($this->widgetClasses as $widgetClass) {
$classes = ClassInfo::subclassesFor($widgetClass);
- if(count($classes) > 1) {
- array_shift($classes);
+ if (isset($classes['Widget'])) {
+ unset($classes['Widget']);
+ }
+ else if (isset($classes[0]) && $classes[0] == 'Widget') {
+ unset($classes[0]);
}
-
+
foreach($classes as $class) {
$widgets->push(singleton($class));
} | FIX: Ensure available widgets list is consistent between versions (#<I>) | silverstripe_silverstripe-widgets | train | php |
d70660673fc4f56b2a31d761e50fa6ed0cb38942 | diff --git a/suds/__init__.py b/suds/__init__.py
index <HASH>..<HASH> 100644
--- a/suds/__init__.py
+++ b/suds/__init__.py
@@ -31,7 +31,7 @@ import socket
__version__ = '0.3.7'
-properties = dict(version=__version__, build="(beta) R564-20090901")
+properties = dict(version=__version__, build="(beta) R567-20091009")
#
# Exceptions
diff --git a/suds/wsdl.py b/suds/wsdl.py
index <HASH>..<HASH> 100644
--- a/suds/wsdl.py
+++ b/suds/wsdl.py
@@ -664,7 +664,9 @@ class Binding(NamedObject):
def resolve(self, definitions):
"""
- Resolve named references to other WSDL objects.
+ Resolve named references to other WSDL objects. This includes
+ cross-linking information (from) the portType (to) the I{soap}
+ protocol information on the binding for each operation.
@param definitions: A definitions object.
@type definitions: L{Definitions}
""" | update epydocs and bump beta release information. | ovnicraft_suds2 | train | py,py |
afe4b7bd9e67500b5b053da2d2dd1750505f5e7f | diff --git a/markovify/text.py b/markovify/text.py
index <HASH>..<HASH> 100644
--- a/markovify/text.py
+++ b/markovify/text.py
@@ -33,6 +33,11 @@ class Text(object):
reject_reg: If well_formed is True, this can be provided to override the
standard rejection pattern.
"""
+
+ self.well_formed = well_formed
+ if well_formed and reject_reg != '':
+ self.reject_pat = re.compile(reject_reg)
+
can_make_sentences = parsed_sentences is not None or input_text is not None
self.retain_original = retain_original and can_make_sentences
self.state_size = state_size
@@ -48,10 +53,6 @@ class Text(object):
parsed = parsed_sentences or self.generate_corpus(input_text)
self.chain = chain or Chain(parsed, state_size)
- self.well_formed = well_formed
- if well_formed and reject_reg != '':
- self.reject_pat = re.compile(reject_reg)
-
def to_dict(self):
"""
Returns the underlying data as a Python dict. | fix order of argument checks to avoid errors | jsvine_markovify | train | py |
22a11bd625c7b6640e55d9b3be9efc9f5d76d77d | diff --git a/pyes/utils.py b/pyes/utils.py
index <HASH>..<HASH> 100644
--- a/pyes/utils.py
+++ b/pyes/utils.py
@@ -133,8 +133,7 @@ class ResultSet(object):
del hl[key]
def __getattr__(self, name):
- if name in self._results:
- return self._results[name]
+ return self._results['hits'][name]
def keys_to_string(data):
""" | Clean and simple fix for access to attributes of the _results['hits'][name] - the lookup was pointing just at the top level dict, and thus not returning a value for max_score, and causing tests/utils.py to fail in test_TermQuery | aparo_pyes | train | py |
6157cebcc99c012a1bd5f9358d8b4e026e4b65a3 | diff --git a/webagg/test/testutils.py b/webagg/test/testutils.py
index <HASH>..<HASH> 100644
--- a/webagg/test/testutils.py
+++ b/webagg/test/testutils.py
@@ -42,11 +42,20 @@ class BaseTestClass(object):
# ============================================================================
+PUBSUBS = []
+
+class FakeStrictRedisSharedPubSub(FakeStrictRedis):
+ def __init__(self, *args, **kwargs):
+ super(FakeStrictRedisSharedPubSub, self).__init__(*args, **kwargs)
+ self._pubsubs = PUBSUBS
+
+
+# ============================================================================
class FakeRedisTests(object):
@classmethod
def setup_class(cls):
super(FakeRedisTests, cls).setup_class()
- cls.redismock = patch('redis.StrictRedis', FakeStrictRedis)
+ cls.redismock = patch('redis.StrictRedis', FakeStrictRedisSharedPubSub)
cls.redismock.start()
@staticmethod | testutils: when mock patching FakeStrictRedis, use a subclass with a shared pubsub (to match real redis) | webrecorder_pywb | train | py |
78b1ee5421d24ce1bbb35c9d9d3dff2977efcb38 | diff --git a/aeron-mediadriver/src/main/java/uk/co/real_logic/aeron/mediadriver/DriverPublication.java b/aeron-mediadriver/src/main/java/uk/co/real_logic/aeron/mediadriver/DriverPublication.java
index <HASH>..<HASH> 100644
--- a/aeron-mediadriver/src/main/java/uk/co/real_logic/aeron/mediadriver/DriverPublication.java
+++ b/aeron-mediadriver/src/main/java/uk/co/real_logic/aeron/mediadriver/DriverPublication.java
@@ -211,19 +211,17 @@ public class DriverPublication
*/
public int cleanDirtyBuffer()
{
- int workCount = 0;
-
for (final LogBuffer logBuffer : scanners)
{
if (logBuffer.status() == NEEDS_CLEANING && logBuffer.compareAndSetStatus(NEEDS_CLEANING, IN_CLEANING))
{
logBuffer.clean();
- workCount = 1;
- break;
+
+ return 1;
}
}
- return workCount;
+ return 0;
}
private ByteBuffer duplicateLogBuffer(final RawLog log) | [Java:] Small code simplification. | real-logic_aeron | train | java |
203c8b74e4ce1e43bbc2fbcf7153d4438468287b | diff --git a/src/entity/sprite.js b/src/entity/sprite.js
index <HASH>..<HASH> 100644
--- a/src/entity/sprite.js
+++ b/src/entity/sprite.js
@@ -167,8 +167,8 @@
// call the parent constructor
this.parent(new me.Vector2d(x, y),
- spritewidth || image.width,
- spriteheight || image.height);
+ ~~spritewidth || image.width,
+ ~~spriteheight || image.height);
// cache image reference
this.image = image; | Fixed an issue where int value are set as String in the JSON map | melonjs_melonJS | train | js |
318ad32c8fcd522a7d63d657314ba20f48170db3 | diff --git a/lib/bolt/version.rb b/lib/bolt/version.rb
index <HASH>..<HASH> 100644
--- a/lib/bolt/version.rb
+++ b/lib/bolt/version.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
module Bolt
- VERSION = '2.32.0'
+ VERSION = '2.33.0'
end | (GEM) update bolt version to <I> | puppetlabs_bolt | train | rb |
c07d903ccf86039fd6e0e91df0b604ad68e919a6 | diff --git a/scapy/layers/http.py b/scapy/layers/http.py
index <HASH>..<HASH> 100644
--- a/scapy/layers/http.py
+++ b/scapy/layers/http.py
@@ -616,7 +616,7 @@ def http_request(host, path="/", port=80, timeout=3,
}
http_headers.update(headers)
req = HTTP() / HTTPRequest(**http_headers)
- tcp_client = TCP_client.tcplink(HTTP, host, 80)
+ tcp_client = TCP_client.tcplink(HTTP, host, port)
ans = None
try:
ans = tcp_client.sr1(req, timeout=timeout, verbose=verbose) | Port <I> is hard-coded in the tcp_client
Seems to be overlooked when trying to create an http packet on a non-default port. | secdev_scapy | train | py |
2ea4ddd9922a7d58ab9670ac1709bc60af88f615 | diff --git a/src/util/config-changes.js b/src/util/config-changes.js
index <HASH>..<HASH> 100644
--- a/src/util/config-changes.js
+++ b/src/util/config-changes.js
@@ -354,9 +354,15 @@ module.exports = {
// this xml child is new, graft it (only if config file exists)
// config file may be in a place not exactly specified in the target
var filepath = resolveConfigFilePath(project_dir, platform, file);
+
if (fs.existsSync(filepath)) {
+
// look at ext and do proper config change based on file type
- if (path.extname(filepath) == '.xml') {
+ var ext = path.extname(filepath);
+ // Windows8 uses an appxmanifest, and wp8 will likely use
+ // the same in a future release
+ // TODO: consider proper xml file detection, via <?xml version='1.0' encoding='utf-8'?>
+ if (ext == '.xml' || ext == '.appxmanifest') {
var xml_to_graft = [et.XML(xml_child)];
// TODO: could parse the filepath once per unique target instead of on every change
var doc = xml_helpers.parseElementtreeSync(filepath); | support windows8 config-file which uses an xml file with a .appxmanifest extension | apache_cordova-plugman | train | js |
a4165d2a063abb63a58e34c8b894acaef9c66266 | diff --git a/dist/exceptionless.node.js b/dist/exceptionless.node.js
index <HASH>..<HASH> 100644
--- a/dist/exceptionless.node.js
+++ b/dist/exceptionless.node.js
@@ -769,7 +769,7 @@ var Configuration = (function () {
};
Object.defineProperty(Configuration.prototype, "userAgent", {
get: function () {
- return 'exceptionless-js/1.3.1';
+ return 'exceptionless-node/1.3.1';
},
enumerable: true,
configurable: true
diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -79,7 +79,7 @@ gulp.task('exceptionless.node', ['typescript.node'], function () {
gulp.src(files)
.pipe(sourcemaps.init({ loadMaps: true }))
- .pipe(replace('exceptionless-js/1.0.0.0', 'exceptionless-js/' + pkg.version))
+ .pipe(replace('exceptionless-js/1.0.0.0', 'exceptionless-node/' + pkg.version))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist'));
}); | Updated gulpfile for node UserAgent | exceptionless_Exceptionless.JavaScript | train | js,js |
0f56df3dae2fd2b0ff33e53107d643d30d6fd81b | diff --git a/source/php/Display.php b/source/php/Display.php
index <HASH>..<HASH> 100644
--- a/source/php/Display.php
+++ b/source/php/Display.php
@@ -177,7 +177,9 @@ class Display
public function isModularitySidebarActive($sidebar)
{
$template = \Modularity\Helper\Post::getPostTemplate();
- $template = \Modularity\Helper\Wp::findCoreTemplates([$template, 'archive']);
+ if (!file_exists($template)) {
+ $template = \Modularity\Helper\Wp::findCoreTemplates([$template, 'archive']);
+ }
$options = get_option('modularity-options');
if (is_home()) {
@@ -200,7 +202,6 @@ class Display
*/
public function outputModule($module, $args = array(), $moduleSettings = array(), $echo = true)
{
-
if (!isset($args['id'])) {
$args['id'] = 'no-id';
} | When checking if modularity sidebar is active, if the supplied template is a existing path use it. | helsingborg-stad_Modularity | train | php |
65cbcb2f73d89459a9cae5dc9b083be8f07eabae | diff --git a/docs/dgeni-package/services/tsParser/getExportDocType.js b/docs/dgeni-package/services/tsParser/getExportDocType.js
index <HASH>..<HASH> 100644
--- a/docs/dgeni-package/services/tsParser/getExportDocType.js
+++ b/docs/dgeni-package/services/tsParser/getExportDocType.js
@@ -1,6 +1,6 @@
var ts = require('typescript');
-module.exports = function getExportDocType() {
+module.exports = function getExportDocType(log) {
return function(symbol) {
if(symbol.flags & ts.SymbolFlags.FunctionScopedVariable) { | chore(doc-gen): ensure `log` is injected into `getExportDocType`
See #<I> | angular_angular | train | js |
c84c4509af141cf168335cfddaf9adbfd1037452 | diff --git a/spec/patron_spec_helper.rb b/spec/patron_spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/patron_spec_helper.rb
+++ b/spec/patron_spec_helper.rb
@@ -4,14 +4,13 @@ module PatronSpecHelper
def http_request(method, uri, options = {}, &block)
uri = Addressable::URI.heuristic_parse(uri)
sess = Patron::Session.new
- sess.base_url = "#{uri.omit(:userinfo, :query).normalize.to_s}".gsub(/\/$/,"")
-
+ sess.base_url = "#{uri.omit(:userinfo, :path, :query).normalize.to_s}".gsub(/\/$/,"")
sess.username = uri.user
sess.password = uri.password
sess.connect_timeout = 10
sess.timeout = 10
-
+
response = sess.request(method, "#{uri.path}#{uri.query ? '?' : ''}#{uri.query}", options[:headers] || {}, {
:data => options[:body]
}) | Fixed patron spec helper to generate correct request string without double path | bblimke_webmock | train | rb |
9a40e94d64606ce73cc0eed2e4af2b1bcb9cfc68 | diff --git a/dusty/constants.py b/dusty/constants.py
index <HASH>..<HASH> 100644
--- a/dusty/constants.py
+++ b/dusty/constants.py
@@ -28,7 +28,7 @@ NGINX_MAX_FILE_SIZE = "500M"
VM_PERSIST_DIR = '/persist'
VM_REPOS_DIR = os.path.join(VM_PERSIST_DIR, 'repos')
-LOCAL_BACKUP_DIR = '{}/backup{}'.format(CONFIG_DIR, VM_PERSIST_DIR)
+LOCAL_BACKUP_DIR = os.path.join(CONFIG_DIR, 'backup', VM_PERSIST_DIR.strip('/'))
VM_CP_DIR = '/cp'
CONTAINER_CP_DIR = '/cp' | use a os.path.join with a strip | gamechanger_dusty | train | py |
db176bfe384b819cd37bba84b06daad92428b306 | diff --git a/src/api.js b/src/api.js
index <HASH>..<HASH> 100644
--- a/src/api.js
+++ b/src/api.js
@@ -59,7 +59,7 @@ export const doClaimAllGas = (net, fromWif) => {
const claims = response.data['claims']
const totalClaim = response.data['total_claim']
const txData = claimTransaction(claims, account.publicKeyEncoded, account.address, totalClaim)
- const sign = signatureData(txData, account.privatekey)
+ const sign = signatureData(txData, account.privateKey)
const txRawData = addContract(txData, sign, account.publicKeyEncoded)
return queryRPC(net, 'sendrawtransaction', [txRawData], 2)
})
diff --git a/tests/index.js b/tests/index.js
index <HASH>..<HASH> 100644
--- a/tests/index.js
+++ b/tests/index.js
@@ -35,7 +35,7 @@ describe('Wallet', function () {
const testNet = Neon.getAPIEndpoint('TestNet')
// TODO: this works, but will not work repeatedly for obvious reasons :)
- it('should claim ANC', (done) => {
+ it.skip('should claim GAS', (done) => {
Neon.doClaimAllGas(Neon.MAINNET, testKeys.c.wif).then((response) => {
console.log(response)
done() | rename 'should claim ANC' to 'should claim GAS' | CityOfZion_neon-js | train | js,js |
f1b07f5add5f9eedd5d331a2e39af148421466da | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -147,6 +147,7 @@ we.hooks.on('bootstrap', [
next();
})
}, function instantiateModels(we, next) {
+ // step to define all models with sequelize
we.log.verbose('instantiateModels step');
we.hooks.trigger('we:models:before:instance', we, function (err) {
if (err) return next(err);
@@ -155,6 +156,7 @@ we.hooks.on('bootstrap', [
for ( var modelName in we.db.modelsConfigs) {
haveAlias = we.router.alias.modelHaveUrlAlias(we.db.modelsConfigs[modelName]);
+ // set alias field before define
if (haveAlias) {
// add url alias virtual field
we.db.modelsConfigs[modelName].definition.urlPath = {
@@ -184,6 +186,12 @@ we.hooks.on('bootstrap', [
}
};
+ // set
+ we.db.modelsConfigs[modelName].definition.metadata = {
+ type: we.db.Sequelize.VIRTUAL,
+ formFieldType: null
+ };
+
// define the model
we.db.models[modelName] = we.db.define(
modelName, | add metadata field in all records to set related meta data | wejs_we-core | train | js |
68fbc2a8e65dc646f6289c72c365ec76af50d663 | diff --git a/lib/chef/provisioning/aws_driver/driver.rb b/lib/chef/provisioning/aws_driver/driver.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/provisioning/aws_driver/driver.rb
+++ b/lib/chef/provisioning/aws_driver/driver.rb
@@ -901,7 +901,7 @@ EOD
end
def iam
- @iam ||= ::Aws::IAM.new(config: aws_config)
+ @iam ||= ::Aws::IAM::Client.new(aws_config)
end
def rds
@@ -942,7 +942,7 @@ EOD
def account_id
begin
# We've got an AWS account root credential or an IAM admin with access rights
- current_user = iam.client.get_user
+ current_user = iam.get_user
arn = current_user[:user][:arn]
rescue ::Aws::IAM::Errors::AccessDenied => e
# If we don't have access, the error message still tells us our account ID and user ... | Update code to pass aws_vpc_peering_connection_spec | chef_chef-provisioning-aws | train | rb |
19ed709b09e7d942dadb285150a7b41225a2236f | diff --git a/actionpack/lib/action_controller/http_authentication.rb b/actionpack/lib/action_controller/http_authentication.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_controller/http_authentication.rb
+++ b/actionpack/lib/action_controller/http_authentication.rb
@@ -86,10 +86,10 @@ module ActionController
end
def authenticate(controller, &login_procedure)
- if authorization(controller.request)
- login_procedure.call(*user_name_and_password(controller.request))
- else
+ if authorization(controller.request).blank?
false
+ else
+ login_procedure.call(*user_name_and_password(controller.request))
end
end
@@ -118,4 +118,4 @@ module ActionController
end
end
end
-end
\ No newline at end of file
+end | don't assume the http authorization header will be nil, since some configurations will pass it through as an empty string
git-svn-id: <URL> | rails_rails | train | rb |
d381ee92fd5699bf670e7b00c90029027796c3b1 | diff --git a/backbone.js b/backbone.js
index <HASH>..<HASH> 100644
--- a/backbone.js
+++ b/backbone.js
@@ -649,6 +649,8 @@
for (i = 0, l = models.length; i < l; i++) {
model = models[i] = this.get(models[i]);
if (!model) continue;
+ delete this._byId[model.id];
+ delete this._byId[model.cid];
index = this.indexOf(model);
this.models.splice(index, 1);
this.length--;
@@ -924,8 +926,6 @@
// Internal method to sever a model's ties to a collection.
_removeReference: function(model, options) {
- delete this._byId[model.id];
- delete this._byId[model.cid];
if (this === model.collection) delete model.collection;
model.off('all', this._onModelEvent, this);
}, | Move delete back to model.remove
Reverts part of #<I> to prevent unexpected
behavior in collection/model remove events. | jashkenas_backbone | train | js |
2618fe47fb508265a39bb4f3880ed92ae9d98944 | diff --git a/Test/Case/Controller/CommonAppControllerTest.php b/Test/Case/Controller/CommonAppControllerTest.php
index <HASH>..<HASH> 100644
--- a/Test/Case/Controller/CommonAppControllerTest.php
+++ b/Test/Case/Controller/CommonAppControllerTest.php
@@ -278,6 +278,14 @@ class CommonAppControllerTest extends CommonTestCase {
public function testLog() {
$stream = CakeLog::stream('error');
+ if (!$stream) {
+ CakeLog::config('error', array(
+ 'engine' => 'FileLog',
+ 'types' => array('warning', 'error', 'critical', 'alert', 'emergency'),
+ 'file' => 'error',
+ ));
+ $stream = CakeLog::stream('error');
+ }
$engine = get_class($stream);
$config = array_merge($stream->config(), compact('engine')); | Fix cases when app has no 'error' log configured. | gourmet_common | train | php |
63d0730784b941d624bdc9ab391e7e7c23fdacfa | diff --git a/framework/core/js/src/forum/components/PostStreamScrubber.js b/framework/core/js/src/forum/components/PostStreamScrubber.js
index <HASH>..<HASH> 100644
--- a/framework/core/js/src/forum/components/PostStreamScrubber.js
+++ b/framework/core/js/src/forum/components/PostStreamScrubber.js
@@ -140,7 +140,7 @@ export default class PostStreamScrubber extends Component {
setTimeout(() => this.scrollListener.start());
- this.stream.loadPromise.then(() => this.updateScrubberValues({ animate: true, forceHeightChange: true }));
+ this.stream.loadPromise.then(() => this.updateScrubberValues({ animate: false, forceHeightChange: true }));
}
onremove() { | Don't animate the initial Scrubber placement | flarum_core | train | js |
f475912dc8541a1df70ce540d4fd3805ca644352 | diff --git a/cartoframes/data/dataset/registry/dataframe_dataset.py b/cartoframes/data/dataset/registry/dataframe_dataset.py
index <HASH>..<HASH> 100644
--- a/cartoframes/data/dataset/registry/dataframe_dataset.py
+++ b/cartoframes/data/dataset/registry/dataframe_dataset.py
@@ -72,6 +72,8 @@ class DataFrameDataset(BaseDataset):
def get_column_names(self, exclude=None):
"""Get column names"""
columns = list(self.dataframe.columns)
+ if self.dataframe.index.name is not None and self.dataframe.index.name not in columns:
+ columns.append(self.dataframe.index.name)
if exclude and isinstance(exclude, list):
columns = list(set(columns) - set(exclude)) | Fix dataframe column names to include index
Take into account a named index may or may not be a column also | CartoDB_cartoframes | train | py |
24bb32791f783f6d9e952b288728674a92a54a4a | diff --git a/src/DbDeployOnComposerUpdate.php b/src/DbDeployOnComposerUpdate.php
index <HASH>..<HASH> 100644
--- a/src/DbDeployOnComposerUpdate.php
+++ b/src/DbDeployOnComposerUpdate.php
@@ -55,6 +55,7 @@ class DbDeployOnComposerUpdate
}
else {
self::execDbDeploy();
+ sleep(2);
}
}
@@ -134,4 +135,4 @@ class DbDeployOnComposerUpdate
return $module;
}
-}
\ No newline at end of file
+} | added workaround on mysql too many connection | melisplatform_melis-dbdeploy | train | php |
486fe71c6ee3fbc4bbebf348832e88880b8a5bae | diff --git a/tests/extmod/btree_gc.py b/tests/extmod/btree_gc.py
index <HASH>..<HASH> 100644
--- a/tests/extmod/btree_gc.py
+++ b/tests/extmod/btree_gc.py
@@ -21,3 +21,6 @@ for i in range(N):
db[b"thekey" + str(i)] = b"thelongvalue" + str(i)
print(db[b"thekey" + str(i)])
gc.collect()
+
+# Reclaim memory allocated by the db object.
+db.close() | tests/extmod/btree_gc.py: Close the database to avoid a memory leak. | micropython_micropython | train | py |
dc409a3578ab9632fc5c45afbf4ac3fe3d1fea42 | diff --git a/src/main/java/org/cactoos/text/EndsWith.java b/src/main/java/org/cactoos/text/EndsWith.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/cactoos/text/EndsWith.java
+++ b/src/main/java/org/cactoos/text/EndsWith.java
@@ -48,15 +48,6 @@ public final class EndsWith implements Scalar<Boolean> {
* @param origin The origin
* @param suffix The suffix
*/
- public EndsWith(final String origin, final String suffix) {
- this(new TextOf(origin), suffix);
- }
-
- /**
- * Ctor.
- * @param origin The origin
- * @param suffix The suffix
- */
public EndsWith(final Text origin, final String suffix) {
this(origin, new TextOf(suffix));
} | (#<I>) Remove unused ctor | yegor256_cactoos | train | java |
496bb3cb89e9ede3c253269394f141c90a4ccd8d | diff --git a/src/JWage/APNS/Safari/PackageGenerator.php b/src/JWage/APNS/Safari/PackageGenerator.php
index <HASH>..<HASH> 100644
--- a/src/JWage/APNS/Safari/PackageGenerator.php
+++ b/src/JWage/APNS/Safari/PackageGenerator.php
@@ -4,7 +4,6 @@ namespace JWage\APNS\Safari;
use ErrorException;
use JWage\APNS\Certificate;
-use RuntimeException;
use ZipArchive;
class PackageGenerator
@@ -139,6 +138,10 @@ class PackageGenerator
return new ZipArchive();
}
+ /**
+ * @param string $packageDir
+ * @param string $userId
+ */
protected function createPackage($packageDir, $userId)
{
return new Package($packageDir, $userId);
diff --git a/src/JWage/APNS/SocketClient.php b/src/JWage/APNS/SocketClient.php
index <HASH>..<HASH> 100644
--- a/src/JWage/APNS/SocketClient.php
+++ b/src/JWage/APNS/SocketClient.php
@@ -63,7 +63,7 @@ class SocketClient
* Writes a binary message to apns.
*
* @param string $binaryMessage
- * @return integer|false Returns the number of bytes written, or FALSE on error.
+ * @return integer Returns the number of bytes written, or FALSE on error.
*/
public function write($binaryMessage)
{ | Scrutinizer Auto-Fixes
This patch was automatically generated as part of the following inspection:
<URL> | jwage_php-apns | train | php,php |
762e668de11b31ddca397803b8cdbe2855d6e52b | diff --git a/alchemist/db/operations/sql.py b/alchemist/db/operations/sql.py
index <HASH>..<HASH> 100644
--- a/alchemist/db/operations/sql.py
+++ b/alchemist/db/operations/sql.py
@@ -3,7 +3,6 @@ from __future__ import unicode_literals, absolute_import, division
from ... import utils
from .. import metadata, engine
from .utils import HighlightStream
-from alembic.util import obfuscate_url_pw
from sqlalchemy_utils import create_mock_engine
import sys
@@ -13,7 +12,7 @@ def op(expression, tables=None, test=None, primary=None, secondary=None,
offline=False, verbose=False):
if verbose:
- url = obfuscate_url_pw(engine['default'].url)
+ url = repr(engine['default'].url)
utils.print_('*', primary, 'default', url)
# Offline preparation cannot commit to the database and should always | Use native sqlalchemy password hiding. | concordusapps_alchemist | train | py |
71ca761550049685ed1a50aeefcd5fb20daabfe0 | diff --git a/dingo/grid/mv_grid/solvers/local_search.py b/dingo/grid/mv_grid/solvers/local_search.py
index <HASH>..<HASH> 100644
--- a/dingo/grid/mv_grid/solvers/local_search.py
+++ b/dingo/grid/mv_grid/solvers/local_search.py
@@ -99,6 +99,13 @@ class LocalSearchSolver(BaseSolver):
(for a more detailed description of the matter see http://floating-point-gui.de or
https://docs.python.org/3.5/tutorial/floatingpoint.html)
+ Notes:
+ Since Or-Opt is an intra-route operator, it has not to be checked if route can allocate (Route's method
+ can_allocate()) nodes during relocation regarding max. peak load/current because the line/cable type is the
+ same along the entire route. However, node order within a route has an impact on the voltage stability
+ so the check would be actually required. Due to large line capacity (load factor of lines/cables ~60 %)
+ the voltage stability issues are neglected.
+
(Inner) Loop variables:
s: length (count of consecutive nodes) of the chain that is moved. Values: 3..1
i: node that precedes the chain before moving (position in the route `tour`, not node name) | edit docstring of or-opt operator | openego_ding0 | train | py |
765ca28711b76bfc17e86f2d91af703c820bbe65 | diff --git a/peer/peer.go b/peer/peer.go
index <HASH>..<HASH> 100644
--- a/peer/peer.go
+++ b/peer/peer.go
@@ -1227,8 +1227,9 @@ func (p *Peer) maybeAddDeadline(pendingResponses map[string]time.Time, msgCmd st
pendingResponses[wire.CmdInv] = deadline
case wire.CmdGetData:
- // Expects a block, tx, or notfound message.
+ // Expects a block, merkleblock, tx, or notfound message.
pendingResponses[wire.CmdBlock] = deadline
+ pendingResponses[wire.CmdMerkleBlock] = deadline
pendingResponses[wire.CmdTx] = deadline
pendingResponses[wire.CmdNotFound] = deadline
@@ -1285,10 +1286,13 @@ out:
switch msgCmd := msg.message.Command(); msgCmd {
case wire.CmdBlock:
fallthrough
+ case wire.CmdMerkleBlock:
+ fallthrough
case wire.CmdTx:
fallthrough
case wire.CmdNotFound:
delete(pendingResponses, wire.CmdBlock)
+ delete(pendingResponses, wire.CmdMerkleBlock)
delete(pendingResponses, wire.CmdTx)
delete(pendingResponses, wire.CmdNotFound) | Add MerkleBlock deadline to CmdGetData | btcsuite_btcd | train | go |
d76a69cbe0bc65c4e50edc9931a39dc5c2c89e8d | diff --git a/worker/buildbot_worker/pb.py b/worker/buildbot_worker/pb.py
index <HASH>..<HASH> 100644
--- a/worker/buildbot_worker/pb.py
+++ b/worker/buildbot_worker/pb.py
@@ -192,7 +192,8 @@ class Worker(WorkerBase, service.MultiService):
credentials.UsernamePassword(name, passwd), client=self.bot)
if conndescr is None:
conndescr = 'tcp:host={}:port={}'.format(
- buildmaster_host, port) # TODO escaping for buildmaster_host
+ buildmaster_host.replace(':', r'\:'), # escape ipv6 addresses
+ port)
endpoint = clientFromString(reactor, conndescr)
pb_service = ClientService(endpoint, bf,
retryPolicy=backoffPolicy(initialDelay=0)) | Escape IPv6 addresses when building conndescr for endpoints | buildbot_buildbot | train | py |
6c0b99ea2b4be963b42c1062b2f33880ba30b6d3 | diff --git a/ptpython/completer.py b/ptpython/completer.py
index <HASH>..<HASH> 100644
--- a/ptpython/completer.py
+++ b/ptpython/completer.py
@@ -154,6 +154,12 @@ class PythonCompleter(Completer):
# In jedi.api.helpers.py: 144, in get_stack_at_position
# raise SystemError("This really shouldn't happen. There's a bug in Jedi.")
pass
+ except NotImplementedError:
+ # See: https://github.com/jonathanslenders/ptpython/issues/223
+ pass
+ except Exception:
+ # Supress all other Jedi exceptions.
+ pass
else:
for c in completions:
yield Completion(c.name_with_symbols, len(c.complete) - len(c.name_with_symbols), | Suppress all unknown Jedi errors. | prompt-toolkit_ptpython | train | py |
b1e0f6ff097fcb3caa3de617ec26a016dd52df8b | diff --git a/src/jquery.jcarousel.js b/src/jquery.jcarousel.js
index <HASH>..<HASH> 100644
--- a/src/jquery.jcarousel.js
+++ b/src/jquery.jcarousel.js
@@ -493,6 +493,10 @@
return this._fullyvisible;
},
hasNext: function() {
+ if (false === this._trigger('hasnext')) {
+ return true;
+ }
+
var wrap = this.option('wrap'),
end = this.items().size() - 1;
@@ -502,6 +506,10 @@
(this.tail && !this.inTail)) ? true : false;
},
hasPrev: function() {
+ if (false === this._trigger('hasprev')) {
+ return true;
+ }
+
var wrap = this.option('wrap');
return this.items().size() > 0 && | Add event triggering to hasPrev/hasNext | jsor_jcarousel | train | js |
795eeb0b091c604704ea3d6e8b9c8fbb0d2817d8 | diff --git a/src/Inflector/InflectorAggregate.php b/src/Inflector/InflectorAggregate.php
index <HASH>..<HASH> 100644
--- a/src/Inflector/InflectorAggregate.php
+++ b/src/Inflector/InflectorAggregate.php
@@ -10,7 +10,7 @@ class InflectorAggregate implements InflectorAggregateInterface
use ContainerAwareTrait;
/**
- * @var \League\Container\Inflector[]
+ * @var \League\Container\Inflector\Inflector[]
*/
protected $inflectors = []; | Fix type of InflectorAggregate::inflectors | thephpleague_container | train | php |
92b564f494c51e9bb9dcfd5aed5f35697bef23fb | diff --git a/lib/datalib.php b/lib/datalib.php
index <HASH>..<HASH> 100644
--- a/lib/datalib.php
+++ b/lib/datalib.php
@@ -1734,7 +1734,7 @@ function category_parent_visible($parent = 0) {
*/
function xmldb_debug($message, $object) {
- error_log($message);
+ debugging($message, DEBUG_DEVELOPER);
}
/** | Change xmldb debugging to use the central debugging() function. | moodle_moodle | train | php |
e8e09e55f71a3dd7efd3e79ef009ff10fc19cb42 | diff --git a/buildfox.py b/buildfox.py
index <HASH>..<HASH> 100644
--- a/buildfox.py
+++ b/buildfox.py
@@ -42,10 +42,10 @@ filter toolset:msvc
rspfile = $out.rsp
rspfile_content = $in
- auto *.obj: cxx r".*\.(cpp|cxx|c)$"
- auto *.exe: link r".*\.(obj|lib)$"
- auto *.dll: link_dll r".*\.(obj|lib)$"
- auto *.lib: lib r".*\.(obj|lib)$"
+ auto r"(?i).*\.obj": cxx r"(?i).*\.(cpp|cxx|cc|c\+\+|c)$"
+ auto r"(?i).*\.exe": link r"(?i).*\.(obj|lib)$"
+ auto r"(?i).*\.dll": link_dll r"(?i).*\.(obj|lib)$"
+ auto r"(?i).*\.lib": lib r"(?i).*\.(obj|lib)$"
# MSVC flags
# more info here https://msdn.microsoft.com/en-us/library/19z1t1wy.aspx | support for cc and c++ extensions
ignore case in auto rules | beardsvibe_buildfox | train | py |
f8a8b08b21e5affe513bc4b3aaa9c3325ee10726 | diff --git a/rollup.config.js b/rollup.config.js
index <HASH>..<HASH> 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -1,14 +1,14 @@
import babel from 'rollup-plugin-babel'
import cleanup from 'rollup-plugin-cleanup'
import filesize from 'rollup-plugin-filesize'
-import { uglify } from 'rollup-plugin-uglify'
+import { terser } from 'rollup-plugin-terser'
export default [
{
input: './src/index.js',
plugins: [
babel(),
- uglify(),
+ terser(),
filesize()
],
output: { | replace uglify-js with terser | dhershman1_kyanite | train | js |
ac3f42eacc99067d3b7d4a0b79d82f40a86f5e57 | diff --git a/core.js b/core.js
index <HASH>..<HASH> 100644
--- a/core.js
+++ b/core.js
@@ -3231,12 +3231,16 @@ core.watchLogs = function(options, callback)
if (err4 || !nread) return next();
var lines = buffer.slice(0, nread).toString().split("\n");
- for (var i in lines) {
+ for (var i = 0; i < lines.length; i++) {
// Skip global ignore list first
if (ignore && ignore.test(lines[i])) continue;
// Match both global or local filters
if (log.match && log.match.test(lines[i]) || (match && match.test(lines[i]))) {
errors += lines[i] + "\n";
+ // Add all subsequent lines starting with a space or tab, those are continuations of the error or stack traces
+ while (i < lines.length && (lines[i + 1][0] == ' ' || lines[i + 1][0] == '\t')) {
+ errors += lines[++i] + "\n";
+ }
}
}
// Separator between log files | added continuation lines to logwatcher for stack traces | vseryakov_backendjs | train | js |
1f9bd923c0675bc34e3e549d0528c7abc074421c | diff --git a/smartcard/pcsc/PCSCPart10.py b/smartcard/pcsc/PCSCPart10.py
index <HASH>..<HASH> 100644
--- a/smartcard/pcsc/PCSCPart10.py
+++ b/smartcard/pcsc/PCSCPart10.py
@@ -247,13 +247,14 @@ def parseTlvProperties(response):
return d
+
if __name__ == '__main__':
"""Small sample illustrating the use of PCSCPart10."""
from smartcard.pcsc.PCSCReader import PCSCReader
cc = PCSCReader.readers()[0].createConnection()
cc.connect(mode=SCARD_SHARE_DIRECT)
- #print(cc.control(CM_IOCTL_GET_FEATURE_REQUEST))
+ # print(cc.control(CM_IOCTL_GET_FEATURE_REQUEST))
features = getFeatureRequest(cc)
print(features)
@@ -269,4 +270,3 @@ if __name__ == '__main__':
properties = getTlvProperties(cc)
for k, v in list(properties.items()):
print(" %s: %s" % (k, v))
- | Fix pycodestyle warnings
smartcard/pcsc/PCSCPart<I>.py:<I>:1: E<I> expected 2 blank lines after class or function definition, found 1
smartcard/pcsc/PCSCPart<I>.py:<I>:5: E<I> block comment should start with '# '
smartcard/pcsc/PCSCPart<I>.py:<I>:1: W<I> blank line at end of file | LudovicRousseau_pyscard | train | py |
def90a0a72012590fccd9a8bc0e247242f09b795 | diff --git a/setuptools/tests/test_integration.py b/setuptools/tests/test_integration.py
index <HASH>..<HASH> 100644
--- a/setuptools/tests/test_integration.py
+++ b/setuptools/tests/test_integration.py
@@ -72,14 +72,17 @@ def test_stevedore(install_context):
_install_one('stevedore', install_context,
'stevedore', 'extension.py')
[email protected]
def test_virtualenvwrapper(install_context):
_install_one('virtualenvwrapper', install_context,
'virtualenvwrapper', 'hook_loader.py')
[email protected]
def test_pbr(install_context):
_install_one('pbr', install_context,
'pbr', 'core.py')
[email protected]
def test_python_novaclient(install_context):
_install_one('python-novaclient', install_context,
'novaclient', 'base.py') | Mark failing tests as xfail | pypa_setuptools | train | py |
b0d4f48d855d2273ca441c986c0cafd48ce412fd | diff --git a/h2o-algos/src/test/java/hex/deeplearning/DeepLearningCheckpointReporting.java b/h2o-algos/src/test/java/hex/deeplearning/DeepLearningCheckpointReporting.java
index <HASH>..<HASH> 100755
--- a/h2o-algos/src/test/java/hex/deeplearning/DeepLearningCheckpointReporting.java
+++ b/h2o-algos/src/test/java/hex/deeplearning/DeepLearningCheckpointReporting.java
@@ -110,7 +110,7 @@ public class DeepLearningCheckpointReporting extends TestUtil {
durationBefore = durationBefore.substring(0, durationBefore.length()-4);
String durationAfter = (String)table.get((int)(p._epochs+1),1);
durationAfter = durationAfter.substring(0, durationAfter.length()-4);
- Assert.assertTrue("Duration must be smooth", Double.parseDouble(durationAfter) - Double.parseDouble(durationBefore) < sleepTime);
+ Assert.assertTrue("Duration must be smooth", Double.parseDouble(durationAfter) - Double.parseDouble(durationBefore) < sleepTime+1);
// Check that time stamp does see the sleep
String timeStampBefore = (String)table.get((int)(p._epochs),0); | Make DL Checkpoint JUnit less sensitive to Jenkins server overload. | h2oai_h2o-3 | train | java |
cdbb40af062810a95afe81dee7e912f63fdbfa02 | diff --git a/src/Leevel/Encryption/Encryption.php b/src/Leevel/Encryption/Encryption.php
index <HASH>..<HASH> 100644
--- a/src/Leevel/Encryption/Encryption.php
+++ b/src/Leevel/Encryption/Encryption.php
@@ -39,28 +39,28 @@ class Encryption implements IEncryption
*
* @var string
*/
- protected $key;
+ protected string $key;
/**
* openssl 加密解密算法.
*
* @var string
*/
- protected $cipher;
+ protected string $cipher;
/**
* 安全 RSA 私钥.
*
* @var string
*/
- protected $rsaPrivate;
+ protected ?string $rsaPrivate;
/**
* 安全 RSA 公钥.
*
* @var string
*/
- protected $rsaPublic;
+ protected ?string $rsaPublic;
/**
* 构造函数. | refactor(encryption): php<I> changes for encryption | hunzhiwange_framework | train | php |
0856b491340059ddcc73edd7b6800c700f654096 | diff --git a/sark/data.py b/sark/data.py
index <HASH>..<HASH> 100644
--- a/sark/data.py
+++ b/sark/data.py
@@ -2,7 +2,6 @@ from collections import namedtuple
import idc
import idaapi
-import os
import shutil
import itertools
import struct
@@ -130,12 +129,6 @@ def apply_patches(patched_path=None):
for patch in patches.itervalues():
output.seek(patch.fpos)
- curr_byte = ord(output.read(1))
- if curr_byte != patch.original:
- raise exceptions.SarkExpectedPatchedByte("Expected {:02X} in {} but found {:0x2X} while patching {}".
- format(patch.original, patch.fpos, curr_byte, to_patch))
-
- output.seek(-1, os.SEEK_CUR)
bin_patch = bytearray((patch.patched,))
output.write(bin_patch) | * relaxed patch validations in order to allow more than one patch | tmr232_Sark | train | py |
5738a7395467c97e2a592a439275a8bfd7411d76 | diff --git a/test/binary-test.js b/test/binary-test.js
index <HASH>..<HASH> 100644
--- a/test/binary-test.js
+++ b/test/binary-test.js
@@ -90,12 +90,12 @@ vows.describe('enhance css binary').addBatch({
assert.equal(stdout, version + '\n');
}
}),
- 'simple embed': pipelinedContext('-o /tmp/test1.css', {
+ 'simple embed': pipelinedContext('-o /tmp/test.css', {
'should give empty output': function(error, stdout) {
assert.isEmpty(stdout);
},
'should create valid files': function() {
- checkFiles('test1', { noEmbed: false, pregzip: false });
+ checkFiles('test', { noEmbed: false, pregzip: false });
},
teardown: cleanup(1)
}), | Fixed race condition in tests due to same file naming. | jakubpawlowicz_enhance-css | train | js |
e57efa84824cc4d9ce187c45c43c7df38b4245a1 | diff --git a/rules/subproc.go b/rules/subproc.go
index <HASH>..<HASH> 100644
--- a/rules/subproc.go
+++ b/rules/subproc.go
@@ -55,6 +55,10 @@ func (r *subprocess) Match(n ast.Node, c *gosec.Context) (*gosec.Issue, error) {
// .. indeed it is a variable then processing is different than a normal
// field assignment
if variable {
+ // skip the check when the declaration is not available
+ if ident.Obj == nil {
+ continue
+ }
switch ident.Obj.Decl.(type) {
case *ast.AssignStmt:
_, assignment := ident.Obj.Decl.(*ast.AssignStmt) | Fix a panic in suproc rule when the declaration of the variable is not available in the AST (#<I>) | securego_gosec | train | go |
42ce89e104482c3ddd477708d24f80f027ed6222 | diff --git a/lib/restclient/utils.rb b/lib/restclient/utils.rb
index <HASH>..<HASH> 100644
--- a/lib/restclient/utils.rb
+++ b/lib/restclient/utils.rb
@@ -157,7 +157,7 @@ module RestClient
end
return object.map { |k, v|
- k = CGI.escape(k.to_s)
+ k = escape(k.to_s)
encode_query_string(v, parent_key ? "#{parent_key}[#{k}]" : k)
}.join('&')
@@ -173,11 +173,22 @@ module RestClient
parent_key.to_s
else
- "#{parent_key}=#{CGI.escape(object.to_s)}"
+ "#{parent_key}=#{escape(object.to_s)}"
end
end
- # TODO: figure out whether escape should be CGI.escape or
- # URI.encode_www_form_component
+ # Encode string for safe transport by URI or form encoding. This uses a CGI
+ # style escape, which transforms ` ` into `+` and various special
+ # characters into percent encoded forms.
+ #
+ # This calls URI.encode_www_form_component for the implementation. The only
+ # difference between this and CGI.escape is that it does not escape `*`.
+ # http://stackoverflow.com/questions/25085992/
+ #
+ # @see URI.encode_www_form_component
+ #
+ def self.escape(string)
+ URI.encode_www_form_component(string)
+ end
end
end | Use escaping from URI, not CGI.
Use URI.encode_www_form_component instead of CGI.escape. They are almost
identical except that CGI.escape additionally escapes `*`. | rest-client_rest-client | train | rb |
a3981300f06702e0312897a05f78fe18501d2192 | diff --git a/webview/gtk.py b/webview/gtk.py
index <HASH>..<HASH> 100644
--- a/webview/gtk.py
+++ b/webview/gtk.py
@@ -227,16 +227,21 @@ def load_html(content, base_uri):
def create_file_dialog(dialog_type, directory, allow_multiple, save_filename):
file_name_semaphore = threading.Semaphore(0)
- file_name = []
+ file_names = []
def _create():
- file_name.append(BrowserView.instance.create_file_dialog(dialog_type, directory, allow_multiple, save_filename))
+ result = BrowserView.instance.create_file_dialog(dialog_type, directory, allow_multiple, save_filename)
+ if result is None:
+ file_names.append(None)
+ else:
+ file_names.append(tuple(result))
+
file_name_semaphore.release()
glib.idle_add(_create)
file_name_semaphore.acquire()
- return file_name[0]
+ return file_names[0]
def evaluate_js(script): | [GTK] Return a tuple instead of list in create_file_dialog | r0x0r_pywebview | train | py |
a627e8c61e43ec1bf01f3fb899cbde99340874c4 | 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
@@ -1,6 +1,8 @@
ENV['RACK_ENV'] ||= 'test'
require 'simplecov'
-SimpleCov.start
+SimpleCov.start do
+ add_filter 'spec/'
+end
require 'coveralls'
Coveralls.wear!
require 'rack/test' | test(coverage): fix coverage by removing spec/ from the count | squareteam_yodatra | train | rb |
603dcf4e1968f78a54beb553fa223269b0906de3 | diff --git a/glue/ligolw/dbtables.py b/glue/ligolw/dbtables.py
index <HASH>..<HASH> 100644
--- a/glue/ligolw/dbtables.py
+++ b/glue/ligolw/dbtables.py
@@ -865,16 +865,12 @@ class DBTable(table.Table):
table and replaces them with auto-incrementing integers.
This method is intended for internal use only.
"""
- if self.next_id is not None:
- if isinstance(row, lsctables.SnglInspiral):
- if not hasattr(self, '_counter'):
- self._counter = itertools.count(0)
- new_id = lsctables.SnglInspiralID(self._counter.next())
- setattr(row, self.next_id.column_name, new_id)
- # assign (and record) a new ID before inserting the
- # row to avoid collisions with existing rows
- setattr(row, self.next_id.column_name, idmap_get_new(self.connection, getattr(row, self.next_id.column_name), self))
- self._append(row)
+ if isinstance(row, lsctables.SnglInspiral):
+ if not hasattr(self, '_counter'):
+ self._counter = itertools.count(0)
+ new_id = lsctables.SnglInspiralID(self._counter.next())
+ setattr(row, self.next_id.column_name, new_id)
+ self._remapping_append(row)
append = _append | Small cleanup of the fix_event_id remapping function. | gwastro_pycbc-glue | train | py |
276a5d89060aa7ff60ba01919e9aad00c41d902d | diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/APIGroupExtensionAdapter.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/APIGroupExtensionAdapter.java
index <HASH>..<HASH> 100644
--- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/APIGroupExtensionAdapter.java
+++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/APIGroupExtensionAdapter.java
@@ -25,6 +25,10 @@ public abstract class APIGroupExtensionAdapter<T> implements ExtensionAdapter<T>
@Override
public Boolean isAdaptable(Client client) {
+ //TODO: This is currently broken, so we can't trust root paths
+ return true;
+
+ /*
RootPaths rootPaths = client.rootPaths();
if (rootPaths != null) {
List<String> paths = rootPaths.getPaths();
@@ -37,6 +41,7 @@ public abstract class APIGroupExtensionAdapter<T> implements ExtensionAdapter<T>
}
}
return false;
+ */
}
@Override | Temporarily disable root path check for /apis as its broken on openshift. | fabric8io_kubernetes-client | train | java |
f6ccdb578d6170130988f64c2cfc91bb5eb22be9 | diff --git a/BAC0/core/devices/mixins/read_mixin.py b/BAC0/core/devices/mixins/read_mixin.py
index <HASH>..<HASH> 100644
--- a/BAC0/core/devices/mixins/read_mixin.py
+++ b/BAC0/core/devices/mixins/read_mixin.py
@@ -292,10 +292,10 @@ class ReadPropertyMultiple():
point_description = point_infos[2]
elif len(point_infos) == 5:
- point_units_state = (point_infos[2], point_infos[3])
- try:
- point_description = point_infos[4]
- except IndexError:
+ point_units_state = (point_infos[2], point_infos[3])
+ point_description = point_infos[4]
+
+ if point_description is None:
point_description = ""
elif len(point_infos) == 2:
diff --git a/BAC0/core/io/Read.py b/BAC0/core/io/Read.py
index <HASH>..<HASH> 100644
--- a/BAC0/core/io/Read.py
+++ b/BAC0/core/io/Read.py
@@ -233,6 +233,7 @@ class ReadProperty():
if readResult.propertyAccessError is not None:
self._log.debug(
" ! " + str(readResult.propertyAccessError))
+ values.append(None)
else:
# here is the value
propertyValue = readResult.propertyValue | Add unknown property error handling
There was a problem when polling a point which had no
description.
In that case, bacpypes returns an unknownProperty
and BAC0 was skipping the value. Skipping the value
would lead to BAC0 taking the name of the next point
as the description of the current one when putting
points in batches. From this point, all following
points would be wrong. | ChristianTremblay_BAC0 | train | py,py |
78afc584a1a3f5850f845943f23b233bf1898b81 | diff --git a/src/Forms/MemberProfileValidator.php b/src/Forms/MemberProfileValidator.php
index <HASH>..<HASH> 100644
--- a/src/Forms/MemberProfileValidator.php
+++ b/src/Forms/MemberProfileValidator.php
@@ -120,8 +120,10 @@ class MemberProfileValidator extends RequiredFields
if (!$results->isValid()) {
$valid = false;
- foreach ($results->messageList() as $key => $value) {
- $this->validationError('Password', $value, 'required');
+ foreach ($results->getMessages() as $value) {
+ if (isset($value['message'])) {
+ $this->validationError('Password', $value['message'], 'required');
+ }
}
}
} | Update on password validation (#<I>)
* Update on password validation
Update on password validation when password is too short.
* Added isset to avoid error. | symbiote_silverstripe-memberprofiles | train | php |
7ed3849739d2a2ce821b0574621d9c4eaa48b435 | diff --git a/src/feat/web/webserver.py b/src/feat/web/webserver.py
index <HASH>..<HASH> 100644
--- a/src/feat/web/webserver.py
+++ b/src/feat/web/webserver.py
@@ -1168,6 +1168,14 @@ class Server(log.LogProxy, log.Logger):
return None
+ elif isinstance(exception, http.NotFoundError):
+
+ if response.can_update_headers:
+ response.set_status(http.Status.NOT_FOUND)
+ response.set_mime_type('text/plain')
+ response.write("Page not found")
+ return None
+
elif isinstance(exception, http.HTTPError):
if response.can_update_headers: | Webserver fails gracefully for NotFoundError (this is expected) | f3at_feat | train | py |
2ceb791f06f68a47724435267c30feb2ccbb91fa | diff --git a/src/Charcoal/Admin/Property/Input/DateTimePickerInput.php b/src/Charcoal/Admin/Property/Input/DateTimePickerInput.php
index <HASH>..<HASH> 100644
--- a/src/Charcoal/Admin/Property/Input/DateTimePickerInput.php
+++ b/src/Charcoal/Admin/Property/Input/DateTimePickerInput.php
@@ -105,12 +105,16 @@ class DateTimePickerInput extends AbstractPropertyInput
*/
public function defaultPickerOptions()
{
- $date = new \DateTime($this->inputVal());
+ $date = null;
+
+ if ($this->inputVal() !== '') {
+ $date = new \DateTime($this->inputVal());
+ }
return [
// 'allowInputToggle' => true,
'format' => self::DEFAULT_JS_FORMAT,
- 'defaultDate' => $date->format(\DateTime::ISO8601)
+ 'defaultDate' => $date ? $date->format(\DateTime::ISO8601) : null
];
} | Fix default date generating "now" when trying to cast empty input val to Datetime
Amends : <I> | locomotivemtl_charcoal-admin | train | php |
8b9cf328821ab94fbaab013b1fe171cba1141ca1 | diff --git a/lib/scaptimony/arf_reports_helper.rb b/lib/scaptimony/arf_reports_helper.rb
index <HASH>..<HASH> 100644
--- a/lib/scaptimony/arf_reports_helper.rb
+++ b/lib/scaptimony/arf_reports_helper.rb
@@ -10,5 +10,8 @@
module Scaptimony
module ArfReportsHelper
+ def self.create_arf(params, arf_bzip)
+ raise NotImplementedError
+ end
end
end | arf_create function should store arf report to scaptimony database | OpenSCAP_scaptimony | train | rb |
5c17c47b51f80173c60691652620cd39ab9e0cfa | diff --git a/testsuite/test_wbemconnection_mock.py b/testsuite/test_wbemconnection_mock.py
index <HASH>..<HASH> 100644
--- a/testsuite/test_wbemconnection_mock.py
+++ b/testsuite/test_wbemconnection_mock.py
@@ -1392,7 +1392,7 @@ class TestRepoMethods(object):
)
l.uninstall()
- def test_compile_err(self, conn):
+ def test_compile_err(self, conn, capsys):
# pylint: disable=no-self-use
"""
Test compile that has an error
@@ -1407,6 +1407,9 @@ class TestRepoMethods(object):
with pytest.raises(MOFParseError):
conn.compile_mof_str(q1)
+ captured_out = capsys.readouterr()[0]
+ assert "Scope(associations)" in captured_out
+
class TestClassOperations(object):
""" | Avoided output of MOF compile error in mock tests | pywbem_pywbem | train | py |
b9ebb12fea0d9cd3204d1308ece8eedbe9d4ec71 | diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -34,6 +34,12 @@ gulp.task('images', function() {
.pipe(gulp.dest('public/resources/images'));
});
+
+gulp.task('build-exports', function() {
+ return gulp.src(['exports/*.js','exports/*.d.ts'])
+ .pipe(gulp.dest('./'));
+});
+
//Cleaning previous gulp tasks from project
gulp.task('clean', function() {
return del(['public/resources/images/','public/resources/primereact.css','public/resources/primereact.min.css']); | Add new gulp task for exports | primefaces_primereact | train | js |
e822b9562949c7df1301f577ae5588724833e50f | diff --git a/src/Cilex/Provider/MonologServiceProvider.php b/src/Cilex/Provider/MonologServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/Cilex/Provider/MonologServiceProvider.php
+++ b/src/Cilex/Provider/MonologServiceProvider.php
@@ -61,10 +61,5 @@ class MonologServiceProvider implements ServiceProviderInterface
{
$app['autoloader']->registerNamespace('Monolog', $app['monolog.class_path']);
}
-
- $app->error(function (\Exception $e) use ($app)
- {
- $app['monolog']->addError($e->getMessage());
- });
}
}
\ No newline at end of file | Removing error invocation of Application object | Cilex_Cilex | train | php |
493194729ea52da9f22516b3a622453bac818118 | diff --git a/src/graph/node/node.js b/src/graph/node/node.js
index <HASH>..<HASH> 100644
--- a/src/graph/node/node.js
+++ b/src/graph/node/node.js
@@ -1516,7 +1516,7 @@ node.addRelatedValues = function (n, values, isNegative) {
var dataRel = data[0].rel;
var value = {
- "id": graph.generateId(),
+ "id": dataModel.generateId(),
"parent": n,
"attributes": dataValue,
"type": node.NodeTypes.VALUE,
@@ -1656,7 +1656,7 @@ node.expandNode = function (clickedNode) {
ny = clickedNode.y + (100 * Math.sin((angleDeg * (Math.PI / 180)) - parentAngle));
var n = {
- "id": graph.generateId(),
+ "id": dataModel.generateId(),
"parent": clickedNode,
"attributes": d,
"type": node.NodeTypes.VALUE,
@@ -1670,7 +1670,7 @@ node.expandNode = function (clickedNode) {
dataModel.nodes.push(n);
dataModel.links.push(
{
- id: "l" + graph.generateId(),
+ id: "l" + dataModel.generateId(),
source: clickedNode,
target: n,
type: graph.link.LinkTypes.VALUE | extract nodes and links data model in a separated module | Nhogs_popoto | train | js |
22dabd14c384c44384b79d461c08e1ae76c70768 | diff --git a/spec/celluloid/links_spec.rb b/spec/celluloid/links_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/celluloid/links_spec.rb
+++ b/spec/celluloid/links_spec.rb
@@ -52,12 +52,4 @@ describe Celluloid::Links do
first_actor.mailbox.should == ["only first actor", "both actors"]
second_actor.mailbox.should == ["both actors"]
end
-
- it 'is inspectable' do
- subject.inspect.should == "#<Celluloid::Links[]>"
- subject << first_actor
- subject.inspect.should == "#<Celluloid::Links[#<struct mailbox=[]>]>"
- subject << second_actor
- subject.inspect.should == "#<Celluloid::Links[#<struct mailbox=[]>,#<struct mailbox=[]>]>"
- end
end
\ No newline at end of file | Remove links inspect spec that fails on JRuby | celluloid_celluloid | train | rb |
90e3cc5d56ffd7eb272348ebaec359452d2d13e8 | diff --git a/py/selenium/webdriver/common/options.py b/py/selenium/webdriver/common/options.py
index <HASH>..<HASH> 100644
--- a/py/selenium/webdriver/common/options.py
+++ b/py/selenium/webdriver/common/options.py
@@ -27,6 +27,7 @@ class BaseOptions(object):
"""
def __init__(self):
+ super(BaseOptions, self).__init__()
self._caps = self.default_capabilities
self.set_capability("pageLoadStrategy", "normal")
@@ -40,12 +41,13 @@ class BaseOptions(object):
@abstractmethod
def to_capabilities(self):
- return
+ """Convert options into capabilities dictionary."""
@property
@abstractmethod
def default_capabilities(self):
- return {}
+ """Return minimal capabilities necessary as a dictionary."""
+
class ArgOptions(BaseOptions):
@@ -75,3 +77,7 @@ class ArgOptions(BaseOptions):
def to_capabilities(self):
return self._caps
+
+ @property
+ def default_capabilities(self):
+ return {} | Fix abstract method in options class (#<I>) | SeleniumHQ_selenium | train | py |
505c7d7015588237876fa11337be22c5a957ac1d | diff --git a/src/consumer/__tests__/instrumentationEvents.spec.js b/src/consumer/__tests__/instrumentationEvents.spec.js
index <HASH>..<HASH> 100644
--- a/src/consumer/__tests__/instrumentationEvents.spec.js
+++ b/src/consumer/__tests__/instrumentationEvents.spec.js
@@ -390,6 +390,19 @@ describe('Consumer > Instrumentation Events', () => {
.catch(e => e),
])
+ // add more concurrent requests to make we increate the requests
+ // on the queue
+ await Promise.all([
+ consumer.describeGroup(),
+ consumer.describeGroup(),
+ consumer.describeGroup(),
+ consumer.describeGroup(),
+ consumer2.describeGroup(),
+ consumer2.describeGroup(),
+ consumer2.describeGroup(),
+ consumer2.describeGroup(),
+ ])
+
await consumer2.disconnect()
expect(requestListener).toHaveBeenCalledWith({ | Improve consumer queue size instrumentation event test | tulios_kafkajs | train | js |
f4f8676dfc3727142f76058ba975eec16da58e4c | diff --git a/src/core/DeCaptchaAbstract.php b/src/core/DeCaptchaAbstract.php
index <HASH>..<HASH> 100644
--- a/src/core/DeCaptchaAbstract.php
+++ b/src/core/DeCaptchaAbstract.php
@@ -107,7 +107,7 @@ abstract class DeCaptchaAbstract implements DeCaptchaInterface
* Узнаём путь до файла
* Если передана ссылка, то скачиваем и кладём во временную директорию
*
- * @param $fileName
+ * @param string $fileName
* @return string
* @throws Exception
*/ | Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on <URL> | jumper423_decaptcha | train | php |
f55a976b7b951c6eefcae65ca4f66ef37d94f19c | diff --git a/falafel/console/custom_logging.py b/falafel/console/custom_logging.py
index <HASH>..<HASH> 100644
--- a/falafel/console/custom_logging.py
+++ b/falafel/console/custom_logging.py
@@ -1,4 +1,5 @@
import os
+import getpass
import logging
import logging.config
@@ -41,7 +42,12 @@ class ContextFilter(logging.Filter):
attributes the the log record
"""
def filter(self, record):
- record.username = os.environ['USER']
+ # use username if available
+ try:
+ record.username = getpass.getuser()
+ except Exception:
+ record.username = ''
+
return True | Use getpass module to get current username
The change is done for compatibllity across platforms.
It seems $USER enrvionment variable is not set everywhere. | RedHatInsights_insights-core | train | py |
27cc9c93c0ba9b7bfa1c0babd70c434c4304f5d7 | diff --git a/openquake/calculators/views.py b/openquake/calculators/views.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/views.py
+++ b/openquake/calculators/views.py
@@ -782,8 +782,7 @@ def view_extreme_gmvs(token, dstore):
err = binning_error(gmvs, eids)
if err > .05:
msg += ('Your results are expected to have a large dependency '
- 'from ses_seed (or the rupture seed in scenarios): %d%%'
- % (err * 100))
+ 'from the rupture seed: %d%%' % (err * 100))
if imt0.startswith(('PGA', 'SA(')):
gmpe = GmpeExtractor(dstore)
df = pandas.DataFrame({'gmv_0': gmvs, 'sid': sids}, eids) | Better logging [ci skip] | gem_oq-engine | train | py |
a9f2473fe49fdc7ee1c6051ee94e784bab128805 | diff --git a/lib/ib/project.rb b/lib/ib/project.rb
index <HASH>..<HASH> 100644
--- a/lib/ib/project.rb
+++ b/lib/ib/project.rb
@@ -1,10 +1,11 @@
class IB::Project
- def write app_path = "./app", resources_path = "./resources"
+ def write app_path = "./app", resources_path = "./resources", pods_headers = "./vendor/Pods/Headers"
project = Xcodeproj::Project.new
target = project.targets.new_static_library(:ios, 'design')
resources = project.groups.new('path' => resources_path, 'name' => 'Resources')
support = project.groups.new('name' => 'Support Files')
+ pods = project.groups.new('name' => 'Pods')
IB::Generator.new.write(app_path, "ui.xcodeproj")
support.files.new 'path' => "ui.xcodeproj/stubs.h"
@@ -13,6 +14,10 @@ class IB::Project
resources.files.new('path' => file)
end
+ Dir.glob("#{pods_headers}/**/*.h") do |file|
+ pods.files.new('path' => file)
+ end
+
project.save_as("ui.xcodeproj")
end
end
\ No newline at end of file | Close #3. Include all pods headers in Pods group. | rubymotion_ib | train | rb |
b753fc943219ac658a8cd6f4f245dcb5c565f550 | diff --git a/src/main/java/zmq/Poller.java b/src/main/java/zmq/Poller.java
index <HASH>..<HASH> 100644
--- a/src/main/java/zmq/Poller.java
+++ b/src/main/java/zmq/Poller.java
@@ -167,6 +167,7 @@ public class Poller extends PollerBase implements Runnable
public void start()
{
worker = new Thread(this, name);
+ worker.setDaemon(true);
worker.start();
} | Set daemon flag on poller threads. | zeromq_jeromq | train | java |
e2877b91af39c3bed35778d17342f2e873489031 | diff --git a/Classes/IndexQueue/RecordMonitor.php b/Classes/IndexQueue/RecordMonitor.php
index <HASH>..<HASH> 100644
--- a/Classes/IndexQueue/RecordMonitor.php
+++ b/Classes/IndexQueue/RecordMonitor.php
@@ -142,7 +142,7 @@ class Tx_Solr_IndexQueue_RecordMonitor {
// moving pages in LIVE workspace
$this->solrConfiguration = Tx_Solr_Util::getSolrConfigurationFromPageId($uid);
$record = $this->getRecord('pages', $uid);
- if (!empty($record)) {
+ if (!empty($record) && $this->isEnabledRecord($table, $record)) {
$this->indexQueue->updateItem('pages', $uid);
} else {
// check if the item should be removed from the index because it no longer matches the conditions
@@ -216,7 +216,9 @@ class Tx_Solr_IndexQueue_RecordMonitor {
}
}
- $this->indexQueue->updateItem($recordTable, $recordUid);
+ if ($this->isEnabledRecord($recordTable, $record)) {
+ $this->indexQueue->updateItem($recordTable, $recordUid);
+ }
if ($recordTable == 'pages') {
$this->updateCanonicalPages($recordUid); | [BUGFIX] RecordMonitor should not add items that aren't enabled | TYPO3-Solr_ext-solr | train | php |
483d8919d0b16927db431d3780239323e1a71291 | diff --git a/src/Drupal/Driver/DrushDriver.php b/src/Drupal/Driver/DrushDriver.php
index <HASH>..<HASH> 100644
--- a/src/Drupal/Driver/DrushDriver.php
+++ b/src/Drupal/Driver/DrushDriver.php
@@ -285,7 +285,9 @@ class DrushDriver extends BaseDriver {
*/
public function drush($command, array $arguments = array(), array $options = array()) {
$arguments = implode(' ', $arguments);
- $options['nocolor'] = '';
+
+ // Disable colored output from drush
+ $options['nocolor'] = TRUE;
$string_options = $this->parseArguments($options);
$alias = isset($this->alias) ? "@{$this->alias}" : '--root=' . $this->root;
@@ -293,7 +295,7 @@ class DrushDriver extends BaseDriver {
// Add any global arguments.
$global = $this->getArguments();
- $process = new Process("{$this->binary} {$alias} {$global} {$command} {$string_options} {$arguments}");
+ $process = new Process("{$this->binary} {$alias} {$string_options} {$global} {$command} {$arguments}");
$process->setTimeout(3600);
$process->run(); | Fix drush nocolor option
Also reorder options and arguments - put global options after the hardcoded options (nocolor in this case), so global options can take precedence. | jhedstrom_DrupalDriver | train | php |
12287e65655f8185f627eff10f6ea4d24955e027 | diff --git a/synergy/system/repeat_timer.py b/synergy/system/repeat_timer.py
index <HASH>..<HASH> 100644
--- a/synergy/system/repeat_timer.py
+++ b/synergy/system/repeat_timer.py
@@ -40,16 +40,21 @@ class RepeatTimer(threading.Thread):
self.__timer.join()
def cancel(self):
+ """ stops the timer. call_back function is not called """
self.event.clear()
if self.__timer is not None:
self.__timer.cancel()
def trigger(self):
+ """ calls the call_back function. interrupts the timer to start a new countdown """
self.call_back(*self.args, **self.kwargs)
if self.__timer is not None:
self.__timer.cancel()
def change_interval(self, value):
+ """ :param value: <tick> interval in seconds
+ current countdown is not interrupted
+ new interval will be applied after the trigger execution """
self.interval_new = value
def next_run_in(self, utc_now=None): | - adding docklets to the repeat timer | mushkevych_scheduler | train | py |
bd87b4729ca3ebf38bd043f95fd4f12a2d79b5a4 | diff --git a/tests/spec_test.py b/tests/spec_test.py
index <HASH>..<HASH> 100644
--- a/tests/spec_test.py
+++ b/tests/spec_test.py
@@ -507,7 +507,7 @@ def test_load_etcd(simple_spec, key):
]
etcd_result = Mock(dir=True)
- etcd_result.__iter__ = Mock(return_value=iter(children))
+ etcd_result.children = children
client = Mock(spec=yapconf.etcd_client.Client)
client.read = Mock(return_value=etcd_result)
simple_spec.add_source('etcd', 'etcd', client=client)
diff --git a/yapconf/sources.py b/yapconf/sources.py
index <HASH>..<HASH> 100644
--- a/yapconf/sources.py
+++ b/yapconf/sources.py
@@ -346,7 +346,7 @@ class EtcdConfigSource(ConfigSource):
)
data = {}
- for child in result:
+ for child in result.children:
keys = self._extract_keys(child.key)
self._add_value(data, keys, child.value) | Fixed bug with loading from etcd. | loganasherjones_yapconf | train | py,py |
cede95ee3ddfc8f257cdf6363319b2379d6e6977 | diff --git a/src/VCR/Util/HttpClient.php b/src/VCR/Util/HttpClient.php
index <HASH>..<HASH> 100644
--- a/src/VCR/Util/HttpClient.php
+++ b/src/VCR/Util/HttpClient.php
@@ -22,6 +22,9 @@ class HttpClient
public function send(Request $request)
{
$ch = curl_init($request->getUrl());
+
+ Assertion::isResource($ch, "Could not init curl with URL '{$request->getUrl()}'");
+
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $request->getMethod());
curl_setopt($ch, CURLOPT_HTTPHEADER, HttpUtil::formatHeadersForCurl($request->getHeaders()));
if (!is_null($request->getBody())) { | Asserting that curl_init did succeed | php-vcr_php-vcr | train | php |
c2a1d554376b2136479d77b7420ae5b3d891a638 | diff --git a/src/main/java/org/nnsoft/trudeau/api/InMemoryPath.java b/src/main/java/org/nnsoft/trudeau/api/InMemoryPath.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/nnsoft/trudeau/api/InMemoryPath.java
+++ b/src/main/java/org/nnsoft/trudeau/api/InMemoryPath.java
@@ -37,7 +37,7 @@ import java.util.Objects;
* @param <V> the Graph vertices type
* @param <E> the Graph edges type
*/
-final class InMemoryPath<V, E>
+public class InMemoryPath<V, E>
implements Path<V, E>
{ | changed InMemoryPath visibility | trudeau_api | train | java |
88bf7b3152404051cf1060a74d2003c6a1e3ba48 | diff --git a/plowshare/plowshare.py b/plowshare/plowshare.py
index <HASH>..<HASH> 100644
--- a/plowshare/plowshare.py
+++ b/plowshare/plowshare.py
@@ -6,7 +6,7 @@ import os
# We don't need to spawn new processes for this.
import multiprocessing.dummy
-import hosts
+from . import hosts
class Plowshare(object): | Use explicit relative import for hosts
Implicit relative imports were removed from Python 3.
See <URL> | StorjOld_plowshare-wrapper | train | py |
538f2900e5bd850a18b74c3e50a280982e94b06f | diff --git a/src/main/java/noraui/data/gherkin/InputGherkinDataProvider.java b/src/main/java/noraui/data/gherkin/InputGherkinDataProvider.java
index <HASH>..<HASH> 100644
--- a/src/main/java/noraui/data/gherkin/InputGherkinDataProvider.java
+++ b/src/main/java/noraui/data/gherkin/InputGherkinDataProvider.java
@@ -88,7 +88,7 @@ public class InputGherkinDataProvider extends CommonDataProvider implements Data
if (lineContent.length < 3) {
throw new TechnicalException(Messages.getMessage(TechnicalException.TECHNICAL_EXPECTED_AT_LEAST_AN_ID_COLUMN_IN_EXAMPLES));
}
- return Arrays.copyOfRange(lineContent, 2, (readResult) ? lineContent.length + 1 : lineContent.length);
+ return Arrays.copyOfRange(lineContent, 2, readResult ? lineContent.length : lineContent.length - 1);
}
return null;
} | fixed issue on read line (gherkin provider), il readResult=true this method read all columns and return all without result | NoraUi_NoraUi | train | java |
6e5389ff498d49a8af8062bc56345e430c7c421d | diff --git a/twilio/rest/resources.py b/twilio/rest/resources.py
index <HASH>..<HASH> 100644
--- a/twilio/rest/resources.py
+++ b/twilio/rest/resources.py
@@ -115,10 +115,10 @@ def make_request(method, url,
See the requests documentation for explanation of all these parameters
- Currently timeout, allow_redirects, proxies, files, and cookies
- are all ignored
+ Currently proxies, files, and cookies are all ignored
"""
- http = httplib2.Http()
+ http = httplib2.Http(timeout=timeout)
+ http.follow_redirects = allow_redirects
if auth is not None:
http.add_credentials(auth[0], auth[1]) | Honour timeout and redirect control. Closes Issue #<I> | twilio_twilio-python | train | py |
f8e4a414b9c2ab08ffda7e0edfc9100fc869a9ce | diff --git a/kernel/classes/datatypes/ezuser/ezuser.php b/kernel/classes/datatypes/ezuser/ezuser.php
index <HASH>..<HASH> 100644
--- a/kernel/classes/datatypes/ezuser/ezuser.php
+++ b/kernel/classes/datatypes/ezuser/ezuser.php
@@ -833,6 +833,9 @@ WHERE user_id = '" . $userID . "' AND
$http =& eZHTTPTool::instance();
$GLOBALS["eZUserGlobalInstance_$userID"] =& $user;
+ // Set/overwrite the global user, this will be accessed from
+ // instance() when there is no ID passed to the function.
+ $GLOBALS["eZUserGlobalInstance_"] =& $user;
$http->setSessionVariable( 'eZUserLoggedInID', $userID );
eZSessionRegenerate();
$user->cleanup(); | #- Fixed a problem where the eZUserGlobalInstance_ entry would contain the
# anonymous user after a login. This occured when using WebDAV.
git-svn-id: file:///home/patrick.allaert/svn-git/ezp-repo/ezpublish/trunk@<I> a<I>eee8c-daba-<I>-acae-fa<I>f<I> | ezsystems_ezpublish-legacy | train | php |
f80273e61f5ecbca0f725ea51053888a36553036 | diff --git a/dallinger/experiment_server/gunicorn.py b/dallinger/experiment_server/gunicorn.py
index <HASH>..<HASH> 100644
--- a/dallinger/experiment_server/gunicorn.py
+++ b/dallinger/experiment_server/gunicorn.py
@@ -60,7 +60,7 @@ class StandaloneServer(Application):
config = get_config()
workers = config.get("threads")
if workers == "auto":
- workers = str(multiprocessing.cpu_count() + 1)
+ workers = str(round(multiprocessing.cpu_count() * 1.5) + 1)
host = config.get("host")
mode = config.get("mode") | Try setting a slightly higher default worker count. | Dallinger_Dallinger | train | py |
120268fce0af10803b530c70a8e3b749e3a2aa2c | diff --git a/lib/metamorpher/rule.rb b/lib/metamorpher/rule.rb
index <HASH>..<HASH> 100644
--- a/lib/metamorpher/rule.rb
+++ b/lib/metamorpher/rule.rb
@@ -23,7 +23,7 @@ module Metamorpher
current = waiting.pop
unless discovered.include?(current)
discovered << current
- waiting.concat(current.children)
+ waiting.concat(current.children) if current.respond_to?(:children)
end
result = pattern.match(current)
return result if result.matches? | Fix bug in depth-first search that would cause an exception when hitting the first leaf node. | ruby-mutiny_metamorpher | train | rb |
dabc065f9a350f0fa118d6a30e1fd36857639ddb | diff --git a/lib/pbxFile.js b/lib/pbxFile.js
index <HASH>..<HASH> 100644
--- a/lib/pbxFile.js
+++ b/lib/pbxFile.js
@@ -81,8 +81,15 @@ function detectType(filePath) {
return type;
}
+function defaultExtension(fileRef) {
+ var extension = EXTENSION_BY_PRODUCTTYPE[fileRef.explicitFileType];
+ if (!extension) {
+ return;
+ }
+ return extension;
+}
// dunno | pbxFile: Added defaultExtension() method for detecting extensions for build products. | apache_cordova-node-xcode | train | js |
0274cc010b21cbae8786246678c2ac3b2a619d08 | diff --git a/angular-inview.js b/angular-inview.js
index <HASH>..<HASH> 100644
--- a/angular-inview.js
+++ b/angular-inview.js
@@ -84,8 +84,10 @@ function inViewDirective ($parse) {
// Execute in-view callback
var inViewExpression = $parse(attrs.inView);
var dispose = inviewInfoSignal.subscribe(function (info) {
- inViewExpression(scope, {
- '$inview': info.inView
+ scope.$applyAsync(function () {
+ inViewExpression(scope, {
+ '$inview': info.inView
+ });
});
}); | Applying changes to the scope after in-view callback call | thenikso_angular-inview | train | js |
84af896eb4bdf2373656e0df6b01728381fb25b3 | diff --git a/src/com/aoindustries/dbc/meta/Catalog.java b/src/com/aoindustries/dbc/meta/Catalog.java
index <HASH>..<HASH> 100644
--- a/src/com/aoindustries/dbc/meta/Catalog.java
+++ b/src/com/aoindustries/dbc/meta/Catalog.java
@@ -77,7 +77,12 @@ public class Catalog {
try (ResultSet results = metaData.getMetaData().getSchemas()) {
ResultSetMetaData resultsMeta = results.getMetaData();
while(results.next()) {
- System.err.println("DEBUG: Catalog: getSchemas(): resultsMeta.getColumnCount()=" + resultsMeta.getColumnCount());
+ int colCount = resultsMeta.getColumnCount();
+ System.err.println("DEBUG: Catalog: getSchemas(): colCount=" + colCount);
+ for(int i=1; i<=colCount; i++) {
+ resultsMeta.getColumnName(i);
+ System.err.println("DEBUG: Catalog: getSchemas(): resultsMeta.getColumnName("+i+")=" + resultsMeta.getColumnName(i));
+ }
System.err.println("DEBUG: Catalog: getSchemas(): results.getString(\"TABLE_CATALOG\")=" + results.getString("TABLE_CATALOG"));
if(
resultsMeta.getColumnCount()==1 // PostgreSQL only returns one column | Trying to isolate NoRowException on database sync. | aoindustries_ao-dbc | train | java |
ccd7e8bcda8b8510bc0abf77acef063083ee014a | diff --git a/src/main/java/de/hshannover/f4/trust/ifmapj/metadata/Metadata.java b/src/main/java/de/hshannover/f4/trust/ifmapj/metadata/Metadata.java
index <HASH>..<HASH> 100644
--- a/src/main/java/de/hshannover/f4/trust/ifmapj/metadata/Metadata.java
+++ b/src/main/java/de/hshannover/f4/trust/ifmapj/metadata/Metadata.java
@@ -68,7 +68,7 @@ public interface Metadata {
* If this metadata object has no publish timestamp fraction or
* the extraction fails, 0.0 is returned.
*
- * @return the publish timestamp fraction or null
+ * @return the publish timestamp fraction
*/
public double getPublishTimestampFraction(); | timestamp-fraction: fix error in javadoc | trustathsh_ifmapj | train | java |
c251052b7a27c27b2b596fde103c5ab8a88ad706 | diff --git a/falafel/tests/test_api_generator.py b/falafel/tests/test_api_generator.py
index <HASH>..<HASH> 100644
--- a/falafel/tests/test_api_generator.py
+++ b/falafel/tests/test_api_generator.py
@@ -1,17 +1,16 @@
-import re
import unittest
-import pytest
-
from tools import generate_api_config
+
class TestAPIGen(unittest.TestCase):
@classmethod
def setUpClass(cls):
+ from falafel.mappers import *
pass
def setUp(self):
- self.latest = generate_api_config.APIConfigGenerator().serialize_data_spec()
+ self.latest = generate_api_config.APIConfigGenerator(plugin_package="falafel").serialize_data_spec()
def tearDown(self):
self.latest = None | Ensure all mappers are registered before running uploader.json test | RedHatInsights_insights-core | train | py |
993eba303f5b9f0f1a07c6615597e5d1c2f208f0 | diff --git a/src/Everon/Router.php b/src/Everon/Router.php
index <HASH>..<HASH> 100644
--- a/src/Everon/Router.php
+++ b/src/Everon/Router.php
@@ -43,6 +43,10 @@ class Router implements Interfaces\Router
$DefaultItem = null;
$Item = null;
+ if ($this->getConfig()->getItems() === null) {
+ throw new Exception\RouteNotDefined('No routes defined');
+ }
+
foreach ($this->getConfig()->getItems() as $RouteItem) {
/**
* @var ItemRouter $RouteItem | added check if any routes are defined at all | oliwierptak_Everon1 | train | php |
7802ba6ebfbc78ac465c136663139edfac402ef5 | diff --git a/nailgun/entities.py b/nailgun/entities.py
index <HASH>..<HASH> 100644
--- a/nailgun/entities.py
+++ b/nailgun/entities.py
@@ -24,8 +24,10 @@ workings of entity classes.
import random
from datetime import datetime
from sys import version_info
+
from fauxfactory import gen_alphanumeric
from packaging.version import Version
+
from nailgun import client, entity_fields, signals
from nailgun.entity_mixins import (
Entity,
@@ -5298,7 +5300,8 @@ class System(
return super(System, self).read(entity, attrs, ignore)
-class TemplateCombination(Entity):
+class TemplateCombination(Entity, EntityReadMixin, EntityDeleteMixin,
+ EntityUpdateMixin):
"""A representation of a Template Combination entity."""
def __init__(self, server_config=None, **kwargs):
@@ -5311,11 +5314,8 @@ class TemplateCombination(Entity):
'hostgroup': entity_fields.OneToOneField(HostGroup),
}
self._meta = {
- 'api_path': (
- 'api/v2/config_templates/:config_template_id/'
- 'template_combinations'
- ),
- 'server_modes': ('sat'),
+ 'api_path': 'api/v2/template_combinations',
+ 'server_modes': 'sat',
}
super(TemplateCombination, self).__init__(server_config, **kwargs) | api fixed and methods GET and DELETED added for TemplateCombination
fixes #<I> | SatelliteQE_nailgun | train | py |
30755e9c46965584389398bf47f7e50ce8e02da9 | diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/Record/Hydrator/MetadataHydrator.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/Record/Hydrator/MetadataHydrator.php
index <HASH>..<HASH> 100644
--- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/Record/Hydrator/MetadataHydrator.php
+++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/Record/Hydrator/MetadataHydrator.php
@@ -121,6 +121,9 @@ SQL;
private function sanitizeValue($value, $type)
{
switch ($type) {
+ case FieldMapping::TYPE_STRING:
+ return str_replace("\0", "", $value);
+
case FieldMapping::TYPE_DATE:
return $this->helper->sanitizeDate($value); | PHRAS-<I>-FIX-searchengine:index -p (#<I>)
* FIX searchengine:index -p populate
* delete character nul of the metadata value | alchemy-fr_Phraseanet | train | php |
0a4016658966311d176982a02a8584414c6de1e0 | diff --git a/lib/ngoverrides.js b/lib/ngoverrides.js
index <HASH>..<HASH> 100644
--- a/lib/ngoverrides.js
+++ b/lib/ngoverrides.js
@@ -13,7 +13,9 @@ function registerModule(context) {
// depend on it but it makes no sense to run server-defined routes *on* the server.
context.module('sdr', []);
- var module = context.module('angularjs-server', ['ng']);
+ // we depend on ngRoute here to be sure that, even if the application has provided the "real"
+ // ngRoute module, we'll always register after it and get to override $route.
+ var module = context.module('angularjs-server', ['ng', 'ngRoute']);
var angular = context.getAngular();
module.factory( | Add ngRoute to the server's dependency list.
In practice we override whatever it provides anyway, but declaring the
dependency ensures that it'll get evaluated before us and so our
overridden versions will win. We provide an empty ngRoute module so the
app doesn't need to provide it if it doesn't want to. | saymedia_angularjs-server | train | js |
baef705e1ee5b6d3906843188441f61261c00f11 | diff --git a/Neos.Flow/Classes/Core/Bootstrap.php b/Neos.Flow/Classes/Core/Bootstrap.php
index <HASH>..<HASH> 100644
--- a/Neos.Flow/Classes/Core/Bootstrap.php
+++ b/Neos.Flow/Classes/Core/Bootstrap.php
@@ -548,7 +548,7 @@ class Bootstrap
}
define('FLOW_ONLY_COMPOSER_LOADER', $onlyUseComposerAutoLoaderForPackageClasses);
- define('FLOW_VERSION_BRANCH', 'dev-master');
+ define('FLOW_VERSION_BRANCH', '7.1');
define('FLOW_APPLICATION_CONTEXT', (string)$this->context);
} | TASK: Fix FLOW_VERSION_BRANCH constant | neos_flow-development-collection | train | php |
64754b8200ed8a6c0015d299043958237b24de04 | diff --git a/modules/es/views/es.SurfaceView.js b/modules/es/views/es.SurfaceView.js
index <HASH>..<HASH> 100644
--- a/modules/es/views/es.SurfaceView.js
+++ b/modules/es/views/es.SurfaceView.js
@@ -23,7 +23,7 @@ es.SurfaceView = function( $container, model ) {
this.$ = $container
.addClass( 'es-surfaceView' )
.append( this.documentView.$ );
- this.$input = $( '<textarea class="es-surfaceView-textarea" />' )
+ this.$input = $( '<textarea class="es-surfaceView-textarea" autocapitalize="off" />' )
.appendTo( 'body' );
this.$cursor = $( '<div class="es-surfaceView-cursor"></div>' )
.appendTo( 'body' ); | Added autocapitalize="off" attribute to text area input so IOS doesn't capitalize everything. | wikimedia_parsoid | train | js |
9ac1e906b00047806c3f373124087f51319c8a57 | diff --git a/lib/codemirror.js b/lib/codemirror.js
index <HASH>..<HASH> 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -1413,13 +1413,17 @@ var CodeMirror = (function() {
return {x: off.left + local.x, y: off.top + local.y, yBot: off.top + local.yBot};
}
- var cachedHeight, cachedFor;
+ var cachedHeight, cachedFor, measureText = "<pre>";
+ for (var i = 0; i < 49; ++i) measureText += "x<br>";
+ measureText += "x</pre>";
function textHeight() {
var offsetHeight = lineDiv.offsetHeight;
if (offsetHeight == cachedFor) return cachedHeight;
cachedFor = offsetHeight;
- measure.innerHTML = "<pre>x<br>x<br>x<br>x<br>x<br>x<br>x<br>x<br>x<br>x</pre>";
- return (cachedHeight = measure.firstChild.offsetHeight / 10 || 1);
+ measure.innerHTML = measureText;
+ cachedHeight = measure.firstChild.offsetHeight / 50 || 1;
+ measure.innerHTML = "";
+ return cachedHeight;
}
var cachedWidth, cachedFor = 0;
function charWidth() { | Sample <I> instead of <I> lines to get more accurate fractional line height | codemirror_CodeMirror | train | js |
84c78b9f5f3dad58f92161069e6482f7267ffdb6 | diff --git a/src/Illuminate/Foundation/Exceptions/Handler.php b/src/Illuminate/Foundation/Exceptions/Handler.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Foundation/Exceptions/Handler.php
+++ b/src/Illuminate/Foundation/Exceptions/Handler.php
@@ -191,7 +191,7 @@ class Handler implements ExceptionHandlerContract
* @param string $class
* @return $this
*/
- protected function ignore(string $class)
+ public function ignore(string $class)
{
$this->dontReport[] = $class; | Change exception's handler ignore method to public (#<I>) | laravel_framework | train | php |
Subsets and Splits