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
|
---|---|---|---|---|---|
b0165aba92b73f6cda57dc1829c7a7fd88d0225f
|
diff --git a/bcbio/cwl/create.py b/bcbio/cwl/create.py
index <HASH>..<HASH> 100644
--- a/bcbio/cwl/create.py
+++ b/bcbio/cwl/create.py
@@ -532,7 +532,11 @@ def _avoid_duplicate_arrays(types):
items |= set(t["items"])
else:
items.add(t["items"])
- arrays = [{"type": "array", "items": sorted(list(items))}]
+ if len(items) == 1:
+ items = items.pop()
+ else:
+ items = sorted(list(items))
+ arrays = [{"type": "array", "items": items}]
return others + arrays
def _samplejson_to_inputs(svals):
|
CWL: avoid single element items for arrays
|
bcbio_bcbio-nextgen
|
train
|
py
|
3e57db8399b10cdad474631602abb40abb243855
|
diff --git a/lib/down/net_http.rb b/lib/down/net_http.rb
index <HASH>..<HASH> 100644
--- a/lib/down/net_http.rb
+++ b/lib/down/net_http.rb
@@ -143,6 +143,8 @@ module Down
http.open_timeout = options[:open_timeout] if options.key?(:open_timeout)
request_headers = options.select { |key, value| key.is_a?(String) }
+ request_headers["Accept-Encoding"] = "" # otherwise FiberError can be raised
+
get = Net::HTTP::Get.new(uri.request_uri, request_headers)
get.basic_auth(uri.user, uri.password) if uri.user || uri.password
|
Fix FiberErrors on chunked & gzipped responses
Net::HTTP causes FiberError exceptions when response is both gzipped and
chunked. Since it would be really hard to reimplement Down::ChunkedIO
without fibers, we rather avoid accepting gzipped responses altogether.
|
janko_down
|
train
|
rb
|
0592edfb320ccaba1ac5478560dab5f5dbdccdd9
|
diff --git a/file_util.py b/file_util.py
index <HASH>..<HASH> 100644
--- a/file_util.py
+++ b/file_util.py
@@ -36,6 +36,13 @@ def _copy_file_contents (src, dst, buffer_size=16*1024):
raise DistutilsFileError, \
"could not open '%s': %s" % (src, errstr)
+ if os.path.exists(dst):
+ try:
+ os.unlink(dst)
+ except os.error, (errno, errstr):
+ raise DistutilsFileError, \
+ "could not delete '%s': %s" % (dst, errstr)
+
try:
fdst = open(dst, 'wb')
except os.error, (errno, errstr):
|
[Bug #<I>; may also fix bug #<I>] Fix flakiness when old
installations are present, by always unlinking the destination file
before copying to it. Without the unlink(), the copied file remains
owned by its previous UID, causing the subsequent chmod() to fail.
Bugfix candidate, though it may cause changes on platforms where
file ownership behaves differently.
|
pypa_setuptools
|
train
|
py
|
e9e04cb41b1b574be2cb53d5017b5cf7e86a89bc
|
diff --git a/src/Select.js b/src/Select.js
index <HASH>..<HASH> 100644
--- a/src/Select.js
+++ b/src/Select.js
@@ -1787,7 +1787,7 @@ export default class Select extends Component<Props, State> {
renderLiveRegion() {
if (!this.state.isFocused) return null;
return (
- <A11yText aria-live="assertive">
+ <A11yText aria-live="polite">
<p id="aria-selection-event"> {this.state.ariaLiveSelection}</p>
<p id="aria-context"> {this.constructAriaLiveMessage()}</p>
</A11yText>
|
Issue #<I>: change aria-live assertive to polite
The aria-live assertive block the field label from being read, causing it to not be accessible. Changing the aria-live property to polite will allow the label to still be read
|
JedWatson_react-select
|
train
|
js
|
e20788a95945a4d48d4003f4ad6ed45996c6310c
|
diff --git a/clients/web/src/views/widgets/HierarchyWidget.js b/clients/web/src/views/widgets/HierarchyWidget.js
index <HASH>..<HASH> 100644
--- a/clients/web/src/views/widgets/HierarchyWidget.js
+++ b/clients/web/src/views/widgets/HierarchyWidget.js
@@ -906,7 +906,7 @@ var HierarchyWidget = View.extend({
form.append($('<input/>').attr({type: 'text', name: key, value: value}));
});
// $(form).submit() will *not* work w/ Firefox (http://stackoverflow.com/q/7117084/250457)
- $(form).appendTo('body').submit();
+ $(form).appendTo('body').submit().remove();
},
editAccess: function () {
|
Remove temporary form after submitting
This commit fixes a problem in the web client where a text input appears
at the bottom of the page after checking items and selecting "Download
checked resources".
To avoid long query strings in GET requests--in case a large number of
files are checked--this download mechanism creates and submits a
temporary form. For compatibility with Firefox, the form must be in the
DOM for submission to work.
This commit removes the temporary form from the DOM after it's
submitted.
|
girder_girder
|
train
|
js
|
033c22d6568b6834656832dfc51b2b69bb76cb66
|
diff --git a/app/models/artefact.rb b/app/models/artefact.rb
index <HASH>..<HASH> 100644
--- a/app/models/artefact.rb
+++ b/app/models/artefact.rb
@@ -79,15 +79,43 @@ class Artefact
"custom-application" => ["custom-application"], # In this case the owning_app is overriden. eg calendars, licencefinder
"travel-advice-publisher" => ["travel-advice"],
"specialist-publisher" => ["specialist-document"],
- "whitehall" => ["case_study",
+ "whitehall" => ["announcement",
+ "authored_article",
+ "case_study",
"consultation",
+ "corporate_report",
+ "correspondence",
"detailed_guide",
- "news_article",
- "speech",
+ "document_collection",
+ "draft_text",
+ "fatality_notice",
+ "foi_release",
+ "form",
+ "government_response",
+ "guidance",
+ "impact_assessment",
+ "independent_report",
+ "international_treaty",
+ "map",
+ "national_statistics",
+ "news_story",
+ "oral_statement",
"policy",
+ "policy_paper",
+ "press_release",
+ "promotional",
"publication",
+ "research",
+ "speaking_notes",
"statistical_data_set",
- "worldwide_priority"]
+ "statistics",
+ "statutory_guidance",
+ "supporting_page",
+ "transcript",
+ "transparency",
+ "world_location_news_article",
+ "worldwide_priority",
+ "written_statement"]
}.freeze
FORMATS = FORMATS_BY_DEFAULT_OWNING_APP.values.flatten
|
Add additional Whitehall format types
This extends the list of formats from Whitehall, to include publication,
speech and news story sub-types, so that we can register all the
Whitehall editions with Panopticon.
|
alphagov_govuk_content_models
|
train
|
rb
|
ddc7a2dd4d1a8a644bb76d110168c710995f89d8
|
diff --git a/models/issue_mail.go b/models/issue_mail.go
index <HASH>..<HASH> 100644
--- a/models/issue_mail.go
+++ b/models/issue_mail.go
@@ -125,7 +125,7 @@ func mailIssueCommentToParticipants(issue *Issue, doer *User, mentions []string)
if err != nil {
return fmt.Errorf("GetUserByID [%d]: %v", watchers[i].UserID, err)
}
- if to.IsOrganization() {
+ if to.IsOrganization() || !to.IsActive {
continue
}
|
models/issue_mail: don't send email to non-active users (#<I>)
Fixes #<I>
|
gogs_gogs
|
train
|
go
|
bfa14db065e78915cc046eb0c3f644a2ee05e1f2
|
diff --git a/lib/appsignal/version.rb b/lib/appsignal/version.rb
index <HASH>..<HASH> 100644
--- a/lib/appsignal/version.rb
+++ b/lib/appsignal/version.rb
@@ -1,5 +1,5 @@
require "yaml"
module Appsignal
- VERSION = "2.3.3.beta.1".freeze
+ VERSION = "2.3.3".freeze
end
|
Bump to <I> [ci skip]
|
appsignal_appsignal-ruby
|
train
|
rb
|
832e903f26accf48554b5eaff510392b92cca125
|
diff --git a/tests/test_sqs/test_sqs.py b/tests/test_sqs/test_sqs.py
index <HASH>..<HASH> 100644
--- a/tests/test_sqs/test_sqs.py
+++ b/tests/test_sqs/test_sqs.py
@@ -92,6 +92,21 @@ def test_send_message():
messages[1].get_body().should.equal(body_two)
+@mock_sqs
+def test_send_message_with_xml_characters():
+ conn = boto.connect_sqs('the_key', 'the_secret')
+ queue = conn.create_queue("test-queue", visibility_timeout=60)
+ queue.set_message_class(RawMessage)
+
+ body_one = '< & >'
+
+ queue.write(queue.new_message(body_one))
+
+ messages = conn.receive_message(queue, number_messages=1)
+
+ messages[0].get_body().should.equal(body_one)
+
+
@requires_boto_gte("2.28")
@mock_sqs
def test_send_message_with_attributes():
|
test sqs with xml characters
|
spulec_moto
|
train
|
py
|
1bfc70df31a9bcfc9f86ee51347ede515cc659ad
|
diff --git a/producer/cloudwatchlogs.go b/producer/cloudwatchlogs.go
index <HASH>..<HASH> 100644
--- a/producer/cloudwatchlogs.go
+++ b/producer/cloudwatchlogs.go
@@ -115,7 +115,7 @@ func (prod *CloudwatchLogs) upload(msg *core.Message) {
func (prod *CloudwatchLogs) Produce(workers *sync.WaitGroup) {
defer prod.WorkerDone()
prod.AddMainWorker(workers)
- prod.setServices()
+ prod.service = cloudwatchlogs.New(session.New(prod.config))
if err := prod.create(); err != nil {
prod.Logger.Errorf("could not create group:%q stream:%q error was: %s", prod.group, prod.stream, err)
} else {
@@ -183,13 +183,3 @@ func (prod *CloudwatchLogs) createStream() error {
}
return err
}
-
-func (prod *CloudwatchLogs) setServices() {
- sess, err := session.NewSessionWithOptions(session.Options{
- SharedConfigState: session.SharedConfigEnable,
- })
- if err != nil {
- prod.Logger.Error(err)
- }
- prod.service = cloudwatchlogs.New(sess)
-}
|
Use dafault sdk credentials providers chain
|
trivago_gollum
|
train
|
go
|
a4526a7b459ac5db47f27f0f9c5b18899eff42bd
|
diff --git a/lib/winrm/winrm_service.rb b/lib/winrm/winrm_service.rb
index <HASH>..<HASH> 100644
--- a/lib/winrm/winrm_service.rb
+++ b/lib/winrm/winrm_service.rb
@@ -195,13 +195,12 @@ module WinRM
# Run a Powershell script that resides on the local box.
- # @param [String] script_file The string representing the path to a Powershell script or the the file contents themselves
+ # @param [IO] script_file an IO reference for reading the Powershell script or the actual file contents
# @return [Hash] :stdout and :stderr
def run_powershell_script(script_file)
- # if a path was passed read the contents of the file in
- if script_file =~ /^\/|.\:[\\\/]/
- script = File.read(script_file)
- end
+ # if an IO object is passed read it..otherwise
+ # assume the contents of the file were passed
+ script = script_file.kind_of?(IO) ? script_file.read : script_file
script = script.chars.to_a.join("\x00").chomp
if(defined?(script.encode))
|
run_powershell_script now accepts an IO object vs a path
|
WinRb_WinRM
|
train
|
rb
|
a3ccd7b698090d074e9132dbe246562e84b60279
|
diff --git a/Animations.js b/Animations.js
index <HASH>..<HASH> 100644
--- a/Animations.js
+++ b/Animations.js
@@ -4,13 +4,8 @@ import buildStyleInterpolator from 'react-native/Libraries/Utilities/buildStyleI
var NoTransition = {
opacity: {
- from: 1,
- to: 1,
- min: 1,
- max: 1,
- type: 'linear',
- extrapolate: false,
- round: 100,
+ value: 1.0,
+ type: 'constant',
},
};
@@ -145,4 +140,4 @@ const Animations = {
}
}
-export default Animations;
\ No newline at end of file
+export default Animations;
|
NoTransition scene config causes blank scenes
The NoTransition scene config produces an interpolator function with a
divide by zero, which can cause scenes to have opacity=NaN when
directionAdjustedProgress is set to 1.
This bad value is interpreted on Simulator as opacity=1 (bug does not
appear) but on my device it shows up as opacity=0 (scene shows briefly and
then disappears).
The 'constant' type seems more appropriate here.
|
aksonov_react-native-router-flux
|
train
|
js
|
6e056fd99ba976569b7d6fa7821066752ecac16e
|
diff --git a/spec/configuration_spec.rb b/spec/configuration_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/configuration_spec.rb
+++ b/spec/configuration_spec.rb
@@ -42,6 +42,19 @@ describe Configuration do
dest.path.should == '/srv/project'
end
+ it "should parse 'dest' Arrays of URIs" do
+ config = Configuration.new(:dest => %w[
+ ssh://[email protected]/var/www/project1
+ ssh://[email protected]/var/www/project1
+ ssh://[email protected]/var/www/project1
+ ])
+ dest = config.dest
+
+ dest[0].host.should == 'dev1.example.com'
+ dest[1].host.should == 'dev2.example.com'
+ dest[2].host.should == 'dev3.example.com'
+ end
+
it "should default the 'debug' option to false" do
config = Configuration.new
|
Added a spec for parsing multiple destinations.
|
postmodern_deployml
|
train
|
rb
|
3be89386fc9995dfd7a7f42a0fefc10e152f6a5c
|
diff --git a/eZ/Publish/Core/Persistence/Legacy/Handler.php b/eZ/Publish/Core/Persistence/Legacy/Handler.php
index <HASH>..<HASH> 100644
--- a/eZ/Publish/Core/Persistence/Legacy/Handler.php
+++ b/eZ/Publish/Core/Persistence/Legacy/Handler.php
@@ -64,14 +64,14 @@ class Handler implements HandlerInterface
/**
* Storage registry
*
- * @var Content\StorageRegistry
+ * @var \eZ\Publish\Core\Persistence\Legacy\Content\StorageRegistry
*/
protected $storageRegistry;
/**
* Storage registry
*
- * @var Content\StorageHandler
+ * @var \eZ\Publish\Core\Persistence\Legacy\Content\StorageHandler
*/
protected $storageHandler;
@@ -92,7 +92,7 @@ class Handler implements HandlerInterface
/**
* Content type handler
*
- * @var Content\Type\Handler
+ * @var \eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler
*/
protected $contentTypeHandler;
@@ -134,14 +134,14 @@ class Handler implements HandlerInterface
/**
* User handler
*
- * @var User\Handler
+ * @var \eZ\Publish\Core\Persistence\Legacy\User\Handler
*/
protected $userHandler;
/**
* Section handler
*
- * @var mixed
+ * @var \eZ\Publish\Core\Persistence\Legacy\Content\Section\Handler
*/
protected $sectionHandler;
|
Fixed: properties' PHPDoc type
|
ezsystems_ezpublish-kernel
|
train
|
php
|
bb7ee25c860d8203ea26fedff234d5ae5436e010
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -64,7 +64,7 @@ setup(
"pytest>=4.6.2",
"pytest-cov>=2.7.1",
"Sphinx>=2.2.1",
- "sphinx-autobuild>=0.7.1",
+ "sphinx-autobuild>=0.7.1 ; python_version>='3.6'",
"sphinx-rtd-theme>=0.4.3",
]
},
|
Fix Travis build failing for Python<I> due to dev dependency error
The 'tox' command fails while trying to install 'watchdog' package <I>
(which is Python <I>+ only). Weird thing is that pip should be able to
use 'watchdog' <I>.x as it always did, but for some unknown reason it
does not work.
|
Delgan_loguru
|
train
|
py
|
0acab11d58bfd17bcabc673dd44a2318559373f1
|
diff --git a/pystache/template_spec.py b/pystache/template_spec.py
index <HASH>..<HASH> 100644
--- a/pystache/template_spec.py
+++ b/pystache/template_spec.py
@@ -1,7 +1,7 @@
# coding: utf-8
"""
-This module supports specifying custom template information per view.
+This module supports customized (or special/specified) template loading.
"""
@@ -13,21 +13,24 @@ from .locator import Locator
from .renderer import Renderer
+# TODO: finish the class docstring.
class TemplateSpec(object):
"""
- A mixin for specifying custom template information.
+ A mixin or interface for specifying custom template information.
- Subclass this class only if template customizations are needed.
+ The "spec" in TemplateSpec can be taken to mean that the template
+ information is either "specified" or "special."
- The following attributes allow one to customize/override template
- information on a per View basis. A None value means to use default
- behavior and perform no customization. All attributes are initially
- set to None.
+ A view should subclass this class only if customized template loading
+ is needed. The following attributes allow one to customize/override
+ template information on a per view basis. A None value means to use
+ default behavior for that value and perform no customization. All
+ attributes are initialized to None.
Attributes:
- template: the template to use, as a unicode string.
+ template: the template as a string.
template_rel_path: the path to the template file, relative to the
directory containing the module defining the class.
|
Updates to template_spec docstrings.
|
defunkt_pystache
|
train
|
py
|
c55d21fcf2686b138f51dc541078cbf6a615ebff
|
diff --git a/src/requirementslib/__init__.py b/src/requirementslib/__init__.py
index <HASH>..<HASH> 100644
--- a/src/requirementslib/__init__.py
+++ b/src/requirementslib/__init__.py
@@ -1,5 +1,5 @@
# -*- coding=utf-8 -*-
-__version__ = '1.3.0'
+__version__ = '1.3.1.dev0'
import logging
import warnings
|
Prebump to <I>.dev0
|
sarugaku_requirementslib
|
train
|
py
|
030b6fc5a05afdc8a2fa2dd7eec251d9fa2e7cb3
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -502,12 +502,7 @@ people.People = function(options, callback) {
// Copy only what we deem appropriate to the object that goes
// over the wire
- var snippet = {};
- _.each(schemaSubset, function(field) {
- // TODO: one of the many places we can get rid of this dumb distinction in
- // storage location by type in the 0.5 series
- snippet[field.name] = _snippet[field.name];
- });
+ var snippet = _.pick(_snippet, schemaSubset);
if (req.method === 'POST') {
var set = {};
var user;
|
don't reinvent _.pick, just use it
|
apostrophecms-legacy_apostrophe-people
|
train
|
js
|
990a3c4d2b6175ffc8dc7bb4ad1053f1ac07a69b
|
diff --git a/openquake/commands/plot.py b/openquake/commands/plot.py
index <HASH>..<HASH> 100644
--- a/openquake/commands/plot.py
+++ b/openquake/commands/plot.py
@@ -274,9 +274,9 @@ def make_figure_rupture_info(extractors, what):
info = ex.get(what)
fig, ax = plt.subplots()
ax.grid(True)
- sitecol = ex.get('sitecol')
- bmap = basemap('cyl', sitecol)
- bmap.plot(sitecol['lon'], sitecol['lat'], '+')
+ # sitecol = ex.get('sitecol')
+ # bmap = basemap('cyl', sitecol)
+ # bmap.plot(sitecol['lon'], sitecol['lat'], '+')
n = 0
tot = 0
for rec in info:
|
Removed basemap in plot rupture_info
|
gem_oq-engine
|
train
|
py
|
b7f791b9fd347656a8089ba6bfab35cf760751b3
|
diff --git a/lib/controllers.js b/lib/controllers.js
index <HASH>..<HASH> 100644
--- a/lib/controllers.js
+++ b/lib/controllers.js
@@ -44,6 +44,19 @@ contollers.click = function *(elementId) {
});
};
+contollers.swipe = function *(startX, startY, endX, endY, duration) {
+ return yield this.send({
+ cmd: 'swipe',
+ args: {
+ startX: startX,
+ startY: startY,
+ endX: endX,
+ endY: endY,
+ duration: duration
+ }
+ });
+};
+
contollers.tap = function *(elementId) {
return yield this.send({
cmd: 'click',
|
add swipe (#<I>)
|
macacajs_macaca-android
|
train
|
js
|
cb6363c2524b76e0aa261bcc5eb21c2b1bf51059
|
diff --git a/history.js b/history.js
index <HASH>..<HASH> 100644
--- a/history.js
+++ b/history.js
@@ -693,6 +693,9 @@
if ( relative != basepath && (new RegExp( "^" + basepath + "$", "i" )).test( path ) ) {
windowLocation.href = relative;
}
+ if ((new RegExp( "^" + basepath + "$", "i" )).test( path + '/' )){
+ windowLocation.href = basepath;
+ }else
if ( !(new RegExp( "^" + basepath, "i" )).test( path ) ) {
windowLocation.href = path.replace(/^\//, basepath ) + search;
}
|
Redirect to basepath if pathname+'/' == basepath
|
devote_HTML5-History-API
|
train
|
js
|
91d1fce0b648e0099c3cfbdb069ebfe4d5e440ac
|
diff --git a/keepkeylib/eth/ethereum_tokens.py b/keepkeylib/eth/ethereum_tokens.py
index <HASH>..<HASH> 100644
--- a/keepkeylib/eth/ethereum_tokens.py
+++ b/keepkeylib/eth/ethereum_tokens.py
@@ -15,15 +15,21 @@ class ETHTokenTable(object):
def add_tokens(self, network):
net_name = network['symbol'].lower()
- filename = HERE + '/ethereum-lists/dist/tokens/%s/tokens-%s.json' % (net_name, net_name)
- if not os.path.isfile(filename):
+ dirname = HERE + '/ethereum-lists/src/tokens/%s' % (net_name, )
+
+ if not os.path.exists(dirname):
return
- with open(filename, 'r') as f:
- tokens = json.load(f)
+ for filename in os.listdir(dirname):
+ fullpath = os.path.join(dirname, filename)
+
+ if not os.path.isfile(fullpath):
+ return
+
+ with open(fullpath, 'r') as f:
+ token = json.load(f)
- for token in tokens:
self.tokens.append(ETHToken(token, network))
def build(self):
|
Grab the token table from src, instead of dist
That way we don't have to deal with merge conflicts in the dist dir.
|
keepkey_python-keepkey
|
train
|
py
|
3d734f9f2232624a9b4aae33350316dc664cdd04
|
diff --git a/lib/client/asset.js b/lib/client/asset.js
index <HASH>..<HASH> 100644
--- a/lib/client/asset.js
+++ b/lib/client/asset.js
@@ -109,6 +109,7 @@ wrapCode = function(code, path, pathPrefix, options) {
for(i in options.brosefyExcludePaths) {
if (options.brosefyExcludePaths.hasOwnProperty(i)) {
if ( path.split( options.brosefyExcludePaths[i] )[0] === "" ) {
+ console.log(i, options.brosefyExcludePaths[i], path);
return code;
}
}
diff --git a/lib/client/index.js b/lib/client/index.js
index <HASH>..<HASH> 100644
--- a/lib/client/index.js
+++ b/lib/client/index.js
@@ -90,7 +90,11 @@ module.exports = function(ss, router) {
_results1 = [];
for (x in v) {
y = v[x];
- options[k] = {};
+
+ if (!options[k]) {
+ options[k]= {};
+ }
+
_results1.push(options[k][x] = y);
}
return _results1;
|
Added check for option key existing for client modularization option
|
socketstream_socketstream
|
train
|
js,js
|
214c27fa8b05773c63d7c9ba5b5693f6069888ec
|
diff --git a/lib/helpers.js b/lib/helpers.js
index <HASH>..<HASH> 100644
--- a/lib/helpers.js
+++ b/lib/helpers.js
@@ -592,7 +592,7 @@ module.exports.prepAccountData = function(formData, callback) {
throw new Error('prepAccountData must be provided with a callback argument.');
}
- var coreFields = ['username', 'email', 'password', 'givenName', 'middleName', 'surname', 'status'];
+ var coreFields = ['username', 'email', 'password', 'passwordConfirm', 'givenName', 'middleName', 'surname', 'status'];
formData.customData = {};
async.forEachOf(formData, function(value, key, cb) {
|
Blocking passwordConfirm from being included in customData.
|
stormpath_express-stormpath
|
train
|
js
|
a4191fc6e724a6a6081ea866992b175f10e62cb3
|
diff --git a/ah_bootstrap.py b/ah_bootstrap.py
index <HASH>..<HASH> 100644
--- a/ah_bootstrap.py
+++ b/ah_bootstrap.py
@@ -526,15 +526,18 @@ class _Bootstrapper(object):
# https://github.com/pypa/setuptools/issues/1273
try:
- if DEBUG:
+
+ context = _verbose if DEBUG else _silence
+ with context():
dist = _Distribution(attrs=attrs)
- dist.parse_config_files(ignore_option_errors=True)
- dist.fetch_build_eggs(req)
- else:
- with _silence():
- dist = _Distribution(attrs=attrs)
+ try:
dist.parse_config_files(ignore_option_errors=True)
dist.fetch_build_eggs(req)
+ except TypeError:
+ # On older versions of setuptools, ignore_option_errors
+ # doesn't exist, and the above two lines are not needed
+ # so we can just continue
+ pass
# If the setup_requires succeeded it will have added the new dist to
# the main working_set
@@ -871,6 +874,10 @@ class _DummyFile(object):
@contextlib.contextmanager
+def _verbose():
+ yield
+
[email protected]
def _silence():
"""A context manager that silences sys.stdout and sys.stderr."""
|
Fix compatibility with older versions of setuptools
|
astropy_astropy-helpers
|
train
|
py
|
40356e8c1de346e12b376eb6d6617467641a5522
|
diff --git a/doge/core.py b/doge/core.py
index <HASH>..<HASH> 100755
--- a/doge/core.py
+++ b/doge/core.py
@@ -463,6 +463,17 @@ def setup_arguments():
action='store_true'
)
+ parser.add_argument(
+ '-mh', '--max-height',
+ help='such max height',
+ type=int,
+ )
+
+ parser.add_argument(
+ '-mw', '--max-width',
+ help='such max width',
+ type=int,
+ )
return parser
@@ -472,6 +483,10 @@ def main():
parser = setup_arguments()
ns = parser.parse_args()
+ if ns.max_height:
+ tty.height = ns.max_height
+ if ns.max_width:
+ tty.width = ns.max_width
try:
shibe = Doge(tty, ns)
|
wow add much arguments to restrict width and height. Such contribution
|
thiderman_doge
|
train
|
py
|
164d225c22ac8780e083da891a9792b3f99e46c9
|
diff --git a/src/DataGrid/DataGrid.php b/src/DataGrid/DataGrid.php
index <HASH>..<HASH> 100644
--- a/src/DataGrid/DataGrid.php
+++ b/src/DataGrid/DataGrid.php
@@ -122,6 +122,14 @@ class DataGrid extends DataSet
$cell = new Cell($column->name);
$value = str_replace('"', '""',str_replace(PHP_EOL, '', strip_tags($this->getCellValue($column, $tablerow, $sanitize))));
+
+ // Excel for Mac is pretty stupid, and will break a cell containing \r, such as user input typed on a
+ // old Mac.
+ // On the other hand, PHP will not deal with the issue for use, see for instance:
+ // http://stackoverflow.com/questions/12498337/php-preg-replace-replacing-line-break
+ // We need to normalize \r and \r\n into \n, otherwise the CSV will break on Macs
+ $value = preg_replace('/\r\n|\n\r|\n|\r/', "\n", $value);
+
$cell->value($value);
$row->add($cell);
}
|
Fix CSV \r on Macs
Excel for Mac is pretty stupid, and will break a cell containing \r, such as user input typed on a
old Mac.
On the other hand, PHP will not deal with the issue for use, see for instance:
<URL>
|
zofe_rapyd-laravel
|
train
|
php
|
ef1f639e7883849088dd04621a447668f1ecd4a2
|
diff --git a/core/src/main/java/com/orientechnologies/orient/core/index/OIndexRemote.java b/core/src/main/java/com/orientechnologies/orient/core/index/OIndexRemote.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/orientechnologies/orient/core/index/OIndexRemote.java
+++ b/core/src/main/java/com/orientechnologies/orient/core/index/OIndexRemote.java
@@ -63,7 +63,7 @@ public abstract class OIndexRemote<T> implements OIndex<T> {
private final static String QUERY_REMOVE = "delete from index:%s where key = %s";
private final static String QUERY_REMOVE2 = "delete from index:%s where key = %s and rid = %s";
private final static String QUERY_REMOVE3 = "delete from index:%s where rid = ?";
- private final static String QUERY_CONTAINS = "select count(*) as size from index:%s where key = ?";
+ private final static String QUERY_CONTAINS = "select count(*) as size from index:%s where key = ?";
private final static String QUERY_SIZE = "select count(*) as size from index:%s";
private final static String QUERY_KEYS = "select key from index:%s";
private final static String QUERY_REBUILD = "rebuild index %s";
|
Fixed issue <I> by Salvo Picci
|
orientechnologies_orientdb
|
train
|
java
|
d20f8e66ebba921d9994049686afd19dd0ece070
|
diff --git a/albumentations/augmentations/functional.py b/albumentations/augmentations/functional.py
index <HASH>..<HASH> 100644
--- a/albumentations/augmentations/functional.py
+++ b/albumentations/augmentations/functional.py
@@ -72,7 +72,7 @@ def center_crop(img, crop_height, crop_width):
y2 = y1 + crop_height
x1 = (width - crop_width) // 2
x2 = x1 + crop_width
- img = img[y1:y2, x1:x2, :]
+ img = img[y1:y2, x1:x2]
return img
|
Bugfix in CenterCrop. Now works with masks
|
albu_albumentations
|
train
|
py
|
9ae8449b4540493573228f70924cc1d98e113c36
|
diff --git a/pycbc/events/stat.py b/pycbc/events/stat.py
index <HASH>..<HASH> 100644
--- a/pycbc/events/stat.py
+++ b/pycbc/events/stat.py
@@ -132,6 +132,22 @@ class NewSNRStatistic(Stat):
"""
return (s0**2. + s1**2.) ** 0.5
+ def coinc_multiifo(self, s, slide, step,
+ ): # pylint:disable=unused-argument
+ """Calculate the coincident detection statistic.
+ Parameters
+ ----------
+ s: dictionary keyed by ifo of single detector ranking
+ statistics
+ slide: (unused in this statistic)
+ step: (unused in this statistic)
+ Returns
+ -------
+ numpy.ndarray
+ Array of coincident ranking statistic values
+ """
+ return (sum([s[i]**2 for i in s]))**0.5
+
class NewSNRSGStatistic(NewSNRStatistic):
|
Adding coinc_multiifo function to NewSNR statistic (#<I>)
* Adding coinc_multiifo function to NewSNR statistic, for any number of detectors
* climate
* Switched to dictionary instead of list
* Reducing the function to one line.
|
gwastro_pycbc
|
train
|
py
|
2b3cb470981e0c51e1a2c92bdbd3569dc23049d6
|
diff --git a/lib/enum_help/simple_form.rb b/lib/enum_help/simple_form.rb
index <HASH>..<HASH> 100644
--- a/lib/enum_help/simple_form.rb
+++ b/lib/enum_help/simple_form.rb
@@ -18,7 +18,9 @@ module EnumHelp
def is_enum_attributes?( attribute_name )
- object.class.defined_enums.key?(attribute_name) && attribute_name.pluralize != "references"
+ object.class.respond_to?(:defined_enums) &&
+ object.class.defined_enums.key?(attribute_name) &&
+ attribute_name.pluralize != "references"
end
|
fix regression on simple_form forms without AR objects
|
zmbacker_enum_help
|
train
|
rb
|
542eba25994436c47c0a0e446b2a93feeb01432f
|
diff --git a/actions/class.RdfController.php b/actions/class.RdfController.php
index <HASH>..<HASH> 100644
--- a/actions/class.RdfController.php
+++ b/actions/class.RdfController.php
@@ -491,18 +491,10 @@ abstract class tao_actions_RdfController extends tao_actions_CommonModule {
common_Utils::isUri($this->getRequestParameter('destinationClassUri'))) {
$instance = $this->getCurrentInstance();
- $clazz = $this->getCurrentClass();
$destinationClass = new core_kernel_classes_Class($this->getRequestParameter('destinationClassUri'));
if ($this->hasWriteAccess($destinationClass->getUri())) {
- $copy = $this->getClassService()->cloneInstance($instance, $clazz);
- if($clazz->getUri() != $destinationClass->getUri()){
- $status = $this->getClassService()->changeClass($copy, $destinationClass);
- if(!$status){
- $this->getClassService->deleteResource($copy);
- $copy = null;
- }
- }
+ $copy = $this->getClassService()->cloneInstance($instance, $destinationClass);
if(!is_null($copy)){
return $this->returnJson([
|
clone into the destination class
|
oat-sa_tao-core
|
train
|
php
|
fb8151aca46a28c22f034de83cd08313d93ce06d
|
diff --git a/codebase/strategy.php b/codebase/strategy.php
index <HASH>..<HASH> 100644
--- a/codebase/strategy.php
+++ b/codebase/strategy.php
@@ -245,7 +245,7 @@ class MultitableTreeRenderStrategy extends TreeRenderStrategy {
private $level = 0;
private $max_level = null;
- protected $sep = ",";
+ protected $sep = "-@level@-";
public function __construct($conn) {
parent::__construct($conn);
|
[fix] separators for multi-table tree
|
DHTMLX_connector-php
|
train
|
php
|
44dcc2b75036249f48c9ee196c4c0a0f0c48c3ae
|
diff --git a/wal_e/worker/swift/swift_worker.py b/wal_e/worker/swift/swift_worker.py
index <HASH>..<HASH> 100644
--- a/wal_e/worker/swift/swift_worker.py
+++ b/wal_e/worker/swift/swift_worker.py
@@ -62,7 +62,7 @@ class BackupFetcher(object):
msg='beginning partition download',
detail=('The partition being downloaded is {0}.'
.format(partition_name)),
- hint='The absolute S3 key is {0}.'.format(part_abs_name))
+ hint='The absolute Swift object name is {0}.'.format(part_abs_name))
url = 'swift://{ctr}/{path}'.format(ctr=self.layout.store_name(),
path=part_abs_name)
|
Corrected an inaccurate log message that resulted from a copy-paste.
|
wal-e_wal-e
|
train
|
py
|
d93da992d73df59fecf7575b220bb17c4e3a4aea
|
diff --git a/src/GitHub_Updater/Base.php b/src/GitHub_Updater/Base.php
index <HASH>..<HASH> 100644
--- a/src/GitHub_Updater/Base.php
+++ b/src/GitHub_Updater/Base.php
@@ -826,9 +826,9 @@ class Base {
$local_files = null;
if ( is_dir( $this->$type->local_path ) ) {
- $local_files = scandir( $this->$type->local_path, SCANDIR_SORT_NONE );
+ $local_files = scandir( $this->$type->local_path, 0 );
} elseif ( is_dir( $this->$type->local_path_extended ) ) {
- $local_files = scandir( $this->$type->local_path_extended, SCANDIR_SORT_NONE );
+ $local_files = scandir( $this->$type->local_path_extended, 0 );
}
$changes = array_intersect( (array) $local_files, $changelogs );
|
Make PHP <I> compatible
Constants not introduced until PHP <I>
|
afragen_github-updater
|
train
|
php
|
33ac259d66c90e96489d0512ac762f969458f5bd
|
diff --git a/src/components/autocomplete/js/highlightController.js b/src/components/autocomplete/js/highlightController.js
index <HASH>..<HASH> 100644
--- a/src/components/autocomplete/js/highlightController.js
+++ b/src/components/autocomplete/js/highlightController.js
@@ -4,7 +4,7 @@ angular
function MdHighlightCtrl ($scope, $element, $interpolate) {
var term = $element.attr('md-highlight-text'),
- text = $interpolate($element.text())($scope),
+ text = $interpolate($element.html())($scope),
flags = $element.attr('md-highlight-flags') || '',
watcher = $scope.$watch(term, function (term) {
var regex = getRegExp(term, flags),
|
fix(autocomplete): pulls in text content as HTML to prevent it from being un-escaped
|
angular_material
|
train
|
js
|
50250615c14a3ef1878a9578ac5e2a3c9b59eb19
|
diff --git a/html/meta.html.php b/html/meta.html.php
index <HASH>..<HASH> 100644
--- a/html/meta.html.php
+++ b/html/meta.html.php
@@ -91,6 +91,7 @@ function jtpl_meta_html_html($tpl, $method, $param=null, $params=array())
break;
case 'generator':
$gJCoord->response->addMetaGenerator($param);
+ break;
case 'jquery':
$gJCoord->response->addJSLink($gJConfig->urlengine['jqueryPath'].'jquery.js');
break;
@@ -115,4 +116,4 @@ function jtpl_meta_html_html($tpl, $method, $param=null, $params=array())
}
break;
}
-}
\ No newline at end of file
+}
|
Fixed a few code style problems, possible break bugs and undefined variables.
Conflicts:
lib/jelix-scripts/commands/resetfilesrights.cmd.php
lib/jelix/core/jApp.class.php
lib/jelix/plugins/auth/ldap/ldap.auth.php
lib/jelix/plugins/tpl/html/meta.html.php
|
jelix_castor
|
train
|
php
|
66a07278ba7ecb207be6e7af783cdff331aa2831
|
diff --git a/media/boom/js/boom.core.js b/media/boom/js/boom.core.js
index <HASH>..<HASH> 100755
--- a/media/boom/js/boom.core.js
+++ b/media/boom/js/boom.core.js
@@ -67,6 +67,12 @@ $.extend({
var user_menu = {
"Profile" : function(){
+ $.boom.dialog.open({
+ url: '/cms/account/profile',
+ open: function() {
+
+ }
+ });
},
"Logout" : function(){
top.location = '/cms/logout';
diff --git a/views/boom/editor/toolbar.php b/views/boom/editor/toolbar.php
index <HASH>..<HASH> 100755
--- a/views/boom/editor/toolbar.php
+++ b/views/boom/editor/toolbar.php
@@ -9,7 +9,7 @@
<?=__('Menu')?>
</button>
<span id="boom-page-user-menu">
- <button id="b-page-user" class="ui-button boom-button" data-icon="ui-icon-boom-person">
+ <button id="boom-page-user" class="ui-button boom-button" data-icon="ui-icon-boom-person">
<?=__('Profile')?>
</button>
</span>
|
Added click event for the profile button
|
boomcms_boom-core
|
train
|
js,php
|
66163e7f967fdcd81d838beab735568f109f9c3c
|
diff --git a/src/sap.ui.integration/test/sap/ui/integration/demokit/cardExplorer/webapp/controller/ExploreSamples.controller.js b/src/sap.ui.integration/test/sap/ui/integration/demokit/cardExplorer/webapp/controller/ExploreSamples.controller.js
index <HASH>..<HASH> 100644
--- a/src/sap.ui.integration/test/sap/ui/integration/demokit/cardExplorer/webapp/controller/ExploreSamples.controller.js
+++ b/src/sap.ui.integration/test/sap/ui/integration/demokit/cardExplorer/webapp/controller/ExploreSamples.controller.js
@@ -89,7 +89,11 @@ sap.ui.define([
this._sEditSource = "codeEditor";
}
var oCardEditor = this.byId("cardEditor");
+
+ // in the OPA tests in IE sometimes this is null
+ if (oCardEditor) {
oCardEditor.setJson(sValue);
+ }
this._sEditSource = null;
|
[INTERNAL] CardExplorer: OPA tests are fixed
Change-Id: I<I>cdd4f<I>b8f<I>bbbb<I>f<I>
BCP: <I>
|
SAP_openui5
|
train
|
js
|
edcf5a1107f33638bf9afa006f9469f4d16f02ac
|
diff --git a/Standard/PluginManager/PluginManager.php b/Standard/PluginManager/PluginManager.php
index <HASH>..<HASH> 100644
--- a/Standard/PluginManager/PluginManager.php
+++ b/Standard/PluginManager/PluginManager.php
@@ -101,7 +101,8 @@ class PluginManager extends \ManiaLive\PluginHandler\Plugin
function onPluginLoaded($pluginId)
{
- $this->connection->chatSendServerMessage('$0A0plugin '.$pluginId.' has been successfully loaded', array_keys($this->connectedAdmins));
+ if($this->connectedAdmins)
+ $this->connection->chatSendServerMessage('$0A0plugin '.$pluginId.' has been successfully loaded', array_keys($this->connectedAdmins));
$plugin = Manager::GetPlugin($pluginId);
if($plugin)
$plugin->setIsLoaded(true);
@@ -112,7 +113,8 @@ class PluginManager extends \ManiaLive\PluginHandler\Plugin
function onPluginUnloaded($pluginId)
{
- $this->connection->chatSendServerMessage('$0A0plugin '.$pluginId.' has been successfully unloaded', array_keys($this->connectedAdmins));
+ if($this->connectedAdmins)
+ $this->connection->chatSendServerMessage('$0A0plugin '.$pluginId.' has been successfully unloaded', array_keys($this->connectedAdmins));
$plugin = Manager::GetPlugin($pluginId);
if($plugin)
$plugin->setIsLoaded(false);
|
New features: use of dedicated Echo to communicate with and between server controllers
Fixed PluginManager when sending messages to admins (but there isn't any admin)
git-svn-id: <URL>
|
maniaplanet_manialive-plugins
|
train
|
php
|
d3cdb3441c8044e96b1606ddb2fd2c4f27946c42
|
diff --git a/DependencyInjection/eZDemoExtension.php b/DependencyInjection/eZDemoExtension.php
index <HASH>..<HASH> 100644
--- a/DependencyInjection/eZDemoExtension.php
+++ b/DependencyInjection/eZDemoExtension.php
@@ -56,7 +56,11 @@ class eZDemoExtension extends Extension implements PrependExtensionInterface
array(
'ezpage' => array(
'layouts' => $container->getParameter( 'ezdemo.ezpage.layouts' ),
- 'blocks' => $container->getParameter( 'ezdemo.ezpage.blocks' )
+ 'blocks' => $container->getParameter( 'ezdemo.ezpage.blocks' ),
+ // by default, all layouts and blocks are enabled when
+ // DemoBundle is enabled
+ 'enabledLayouts' => array_keys( $container->getParameter( 'ezdemo.ezpage.layouts' ) ),
+ 'enabledBlocks' => array_keys( $container->getParameter( 'ezdemo.ezpage.blocks' ) )
)
)
);
|
Blocks and layouts provided by the demo bundle are enabled by default
|
ezsystems_DemoBundle
|
train
|
php
|
eb6ecf54faffabbc5e234cee976c78e5e5d52570
|
diff --git a/src/endpoint.js b/src/endpoint.js
index <HASH>..<HASH> 100644
--- a/src/endpoint.js
+++ b/src/endpoint.js
@@ -497,7 +497,7 @@ module.exports = class AbstractEndpoint {
}
// Merge the parsed query parts out of the url
- query = { ...query, ...parsedQuery }
+ query = Object.assign(query, parsedQuery)
// Build the url with the finished query
query = qs.stringify(query, true).replace(/%2C/g, ',')
|
Don't use ES6 object spread (Edge support)
|
queicherius_gw2api-client
|
train
|
js
|
7b7e8f73fef91ddeea04223d230dc25cf530c7e4
|
diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php
index <HASH>..<HASH> 100644
--- a/DependencyInjection/Configuration.php
+++ b/DependencyInjection/Configuration.php
@@ -35,7 +35,7 @@ class Configuration extends AbstractResourceConfiguration
->children()
->booleanNode('enabled')->defaultTrue()->end()
->variableNode('class')->defaultValue('DoS\ResourceBundle\Form\Factory')->end()
- ->variableNode('pattern')->defaultValue('/(sylius|fos|core)/')->end()
+ ->variableNode('pattern')->defaultValue('/(sylius|fos|core)_/')->end()
->variableNode('replacement')->defaultValue('dos_')->end()
->end()
->end()
|
missing _ form factory prefix pattern.
|
liverbool_dos-resource-bundle
|
train
|
php
|
b01a60a0cdb17c697de15419843f021b3b3e0881
|
diff --git a/lib/maruku/input/parse_doc.rb b/lib/maruku/input/parse_doc.rb
index <HASH>..<HASH> 100644
--- a/lib/maruku/input/parse_doc.rb
+++ b/lib/maruku/input/parse_doc.rb
@@ -191,8 +191,8 @@ Disabled by default because of security concerns.
parsed = parse_blocks ? parse_text_as_markdown(s) : parse_span(s)
# restore leading and trailing spaces
- padding =/\A(\s*).*?(\s*)\z/.match(s)
- parsed = [padding[1]] + parsed + [padding[2]]
+ padding = /\A(\s*).*?(\s*)\z/.match(s)
+ parsed = [padding[1]] + parsed + [padding[2]] if padding
el = md_el(:dummy, parsed)
#Nokogiri collapses consecutive Text nodes, so replace it by a dummy element
|
Sometimes that regexp doesn't match
|
bhollis_maruku
|
train
|
rb
|
13c875d634ce5994b3e188e889846ba9ee8e6f39
|
diff --git a/asn1crypto/core.py b/asn1crypto/core.py
index <HASH>..<HASH> 100644
--- a/asn1crypto/core.py
+++ b/asn1crypto/core.py
@@ -297,7 +297,30 @@ class Asn1Value(object):
A unicode string
"""
- return '<%s %s %s>' % (type_name(self), id(self), repr(self.dump()))
+ if py2:
+ return '<%s %s b%s>' % (type_name(self), id(self), repr(self.dump()))
+ else:
+ return '<%s %s %s>' % (type_name(self), id(self), repr(self.dump()))
+
+ def __bytes__(self):
+ """
+ A fall-back method for print() in Python 2
+
+ :return:
+ A byte string of the output of repr()
+ """
+
+ return self.__repr__().encode('utf-8')
+
+ def __unicode__(self):
+ """
+ A fall-back method for print() in Python 3
+
+ :return:
+ A unicode string of the output of repr()
+ """
+
+ return self.__repr__()
def _new_instance(self):
"""
|
Improve usability by providing default __bytes__() and __unicode__() methods for all core classes
|
wbond_asn1crypto
|
train
|
py
|
5a6d64a97fc5bd8bd3b78f857efe494bec91e253
|
diff --git a/src/config/packages.php b/src/config/packages.php
index <HASH>..<HASH> 100644
--- a/src/config/packages.php
+++ b/src/config/packages.php
@@ -83,8 +83,8 @@ return [
'providers' => ['Spatie\Menu\Laravel\MenuServiceProvider::class'],
'aliases' => [
'Menu' => 'Spatie\Menu\Laravel\MenuFacade::class',
- 'Link' => 'Spatie\Menu\Link::class',
- 'Html' => 'Spatie\Menu\Html::class'
+ 'Link' => 'Spatie\Menu\Laravel\Link::class',
+ 'Html' => 'Spatie\Menu\Laravel\Html::class'
]
],
@@ -93,8 +93,8 @@ return [
'providers' => ['Spatie\Menu\Laravel\MenuServiceProvider::class'],
'aliases' => [
'Menu' => 'Spatie\Menu\Laravel\MenuFacade::class',
- 'Link' => 'Spatie\Menu\Link::class',
- 'Html' => 'Spatie\Menu\Html::class'
+ 'Link' => 'Spatie\Menu\Laravel\Link::class',
+ 'Html' => 'Spatie\Menu\Laravel\Html::class'
]
],
|
Alias for laravel-menu packages changed
|
acacha_llum
|
train
|
php
|
80674987c6f822de3af45911fda10e31853517ca
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -1,14 +1,29 @@
var h = require('hyperscript')
-module.exports = function (onFile) {
-
+function select (ready) {
return h('input', {type: 'file', onchange: function (ev) {
var file = ev.target.files[0]
- var reader = new FileReader()
+ ready(new FileReader(), file)
+ }})
+
+}
+
+module.exports = function (onFile) {
+ return select(function (reader) {
reader.onload = function () {
onFile(new Buffer(reader.result))
}
reader.readAsArrayBuffer(file)
- }})
+ })
+}
+module.exports.asDataURL = function (onFile) {
+ return select(function (reader, file) {
+ reader.onload = function () {
+ onFile(reader.result)
+ }
+ reader.readAsDataURL(file)
+ })
}
+
+
|
support reading as buffer (default) or as dataurl
|
hyperhype_hyperfile
|
train
|
js
|
ffa7c5743e913c5eb7ec8e0648aeecb22c043e44
|
diff --git a/src/main/java/com/adamlewis/guice/persist/jooq/JooqPersistService.java b/src/main/java/com/adamlewis/guice/persist/jooq/JooqPersistService.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/adamlewis/guice/persist/jooq/JooqPersistService.java
+++ b/src/main/java/com/adamlewis/guice/persist/jooq/JooqPersistService.java
@@ -17,6 +17,8 @@
package com.adamlewis.guice.persist.jooq;
import javax.sql.DataSource;
+
+import java.sql.Connection;
import java.sql.SQLException;
import com.google.inject.Inject;
@@ -91,10 +93,8 @@ class JooqPersistService implements Provider<DSLContext>, UnitOfWork, PersistSer
try {
logger.debug("Getting JDBC connection");
DataSource dataSource = jdbcSource.get();
- if (dataSource == null) {
- throw new RuntimeException("Datasource not available from provider");
- }
- conn = new DefaultConnectionProvider(dataSource.getConnection());
+ Connection jdbcConn = dataSource.getConnection();
+ conn = new DefaultConnectionProvider(jdbcConn);
} catch (SQLException e) {
throw new RuntimeException(e);
}
|
Removed explicit DataSource null check in favor of explicit dereference
|
supercargo_guice-persist-jooq
|
train
|
java
|
e714ec12b882e1e112b1f175818a316152d73ca5
|
diff --git a/transport/src/main/java/io/netty/channel/socket/nio/NioClientSocketPipelineSink.java b/transport/src/main/java/io/netty/channel/socket/nio/NioClientSocketPipelineSink.java
index <HASH>..<HASH> 100644
--- a/transport/src/main/java/io/netty/channel/socket/nio/NioClientSocketPipelineSink.java
+++ b/transport/src/main/java/io/netty/channel/socket/nio/NioClientSocketPipelineSink.java
@@ -366,7 +366,13 @@ class NioClientSocketPipelineSink extends AbstractChannelSink {
ConnectException cause = null;
for (SelectionKey k: keys) {
if (!k.isValid()) {
- close(k);
+ // Comment the close call again as it gave us major problems with ClosedChannelExceptions.
+ //
+ // See:
+ // * https://github.com/netty/netty/issues/142
+ // * https://github.com/netty/netty/issues/138
+ //
+ //close(k);
continue;
}
|
Remove close(..) call which gave us troubles with
ClosedChannelException. See #<I> and #<I>
|
netty_netty
|
train
|
java
|
f8435e70f5271e0a254cae15aa1eaf4ebcd3e48f
|
diff --git a/spec/reporter_spec.rb b/spec/reporter_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/reporter_spec.rb
+++ b/spec/reporter_spec.rb
@@ -40,7 +40,7 @@ module RailsAutoscaleAgent
registration: {
dyno: 'web.0',
pid: Process.pid,
- ruby_version: '2.3.1',
+ ruby_version: RUBY_VERSION,
rails_version: '5.0.fake',
gem_version: '0.3.0',
}
|
Specs should not depend on ruby version
|
adamlogic_rails_autoscale_agent
|
train
|
rb
|
550ae9d81c6f3b4067ebeb82114cafdb35089fbe
|
diff --git a/tests/Thujohn/Twitter/TwitterTest.php b/tests/Thujohn/Twitter/TwitterTest.php
index <HASH>..<HASH> 100644
--- a/tests/Thujohn/Twitter/TwitterTest.php
+++ b/tests/Thujohn/Twitter/TwitterTest.php
@@ -24,6 +24,13 @@ class TwitterTest extends \PHPUnit_Framework_TestCase
return $twitter;
}
+ public function paramTest($endpoint, $testedMethod, $params)
+ {
+ $twitter = $this->getTwitterExpecting($endpoint, $params);
+
+ $twitter->$testedMethod($params);
+ }
+
public function testGetUsersWithScreenName()
{
$twitter = $this->getTwitterExpecting('users/show', array(
|
add method for testing reducing repetition in twitter test
|
thujohn_twitter
|
train
|
php
|
aeedc19b5a1897835bef9a798d22903c7d46c183
|
diff --git a/classes/Command.js b/classes/Command.js
index <HASH>..<HASH> 100644
--- a/classes/Command.js
+++ b/classes/Command.js
@@ -1,7 +1,21 @@
+/**
+ * Command classes are bound to the player.
+ */
Command = new Class({
execute: function() {
+ },
+
+ /**
+ * This method will be run before calling execute. If this method fails,
+ * the game will act as if the command does not exist.
+ *
+ * This will enable us to easily create administrator and class-specific
+ * commands.
+ */
+ can_execute: function() {
+ return true;
}
});
diff --git a/classes/Living.js b/classes/Living.js
index <HASH>..<HASH> 100644
--- a/classes/Living.js
+++ b/classes/Living.js
@@ -259,7 +259,9 @@ Living = new Class({
return this.force('look');
} else if (com){
params = params.join(' ');
- out = com.execute.bind(this).pass(params,com)();
+ if (com.can_execute.bind(this)) {
+ out = com.execute.bind(this).pass(params,com)();
+ }
}
//The commands either have to return before this point or have
|
Added a can_execute method to determine whether or not a specific command is within a living character's scope.
|
Yuffster_discord-engine
|
train
|
js,js
|
663bb2ab105453d0fcdd7c50faf18a26acf25b03
|
diff --git a/core/src/main/java/io/undertow/server/protocol/http/HttpContinue.java b/core/src/main/java/io/undertow/server/protocol/http/HttpContinue.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/io/undertow/server/protocol/http/HttpContinue.java
+++ b/core/src/main/java/io/undertow/server/protocol/http/HttpContinue.java
@@ -74,6 +74,9 @@ public class HttpContinue {
if (!COMPATIBLE_PROTOCOLS.contains(exchange.getProtocol()) || exchange.isResponseStarted() || !exchange.getConnection().isContinueResponseSupported() || exchange.getAttachment(ALREADY_SENT) != null) {
return false;
}
+ if(exchange.getRequestContentLength() == 0) {
+ return false;
+ }
if (exchange.getConnection() instanceof HttpServerConnection) {
if (((HttpServerConnection) exchange.getConnection()).getExtraBytes() != null) {
//we have already received some of the request body
|
UNDERTOW-<I> A <I>-continue response is still sent even if the content length is known to be zero
|
undertow-io_undertow
|
train
|
java
|
c66a6450c6b8a36d0a9036ffee4034c5f63f91b4
|
diff --git a/lib/comm/receiver.js b/lib/comm/receiver.js
index <HASH>..<HASH> 100644
--- a/lib/comm/receiver.js
+++ b/lib/comm/receiver.js
@@ -10,8 +10,7 @@ class Receiver {
try {
this.handleMessage(this.parseMessage(event.data));
} catch (e) {
- console.log(e.message);
- console.log('Message received:', event.data);
+ return;
}
});
}
|
feat(receiver): remove console log
|
emartech_emarsys-integration-client-js
|
train
|
js
|
29a655fe884f963a48529e0a7cf7a92fad71c6df
|
diff --git a/lib/irt/commands/edit.rb b/lib/irt/commands/edit.rb
index <HASH>..<HASH> 100644
--- a/lib/irt/commands/edit.rb
+++ b/lib/irt/commands/edit.rb
@@ -4,30 +4,32 @@ module IRT
def copy_lines
ensure_session
+ ensure_cli
copy_to_clipboard :print_lines
end
alias_method :cl, :copy_lines
def copy_all_lines
ensure_session
+ ensure_cli
copy_to_clipboard :print_all_lines
end
alias_method :cll, :copy_all_lines
- %w[vi nano edit].each do |n|
- eval <<-EOE, binding, __FILE__, __LINE__+1
- def #{n}(*args)
- ensure_session
- run_editor(:#{n}, *args)
- end
- EOE
- eval <<-EOE, binding, __FILE__, __LINE__+1
- def c#{n}(*args)
- ensure_session
- copy_lines
- #{n} *args
- end
- EOE
+ [:vi, :nano, :edit].each do |n|
+
+ define_method(n) do |*args|
+ ensure_session
+ run_editor(n, *args)
+ end
+
+ define_method(:"c#{n}") do |*args|
+ ensure_session
+ ensure_cli
+ copy_lines
+ send n, *args
+ end
+
end
alias_method :nn, :nano
alias_method :ed, :edit
|
little refactory of editing methods
|
ddnexus_irt
|
train
|
rb
|
c69e9bc1acf510597b0fc1e1f2531273165d994a
|
diff --git a/list/lister.go b/list/lister.go
index <HASH>..<HASH> 100644
--- a/list/lister.go
+++ b/list/lister.go
@@ -119,6 +119,7 @@ func traversable(ref types.ManagedObjectReference) bool {
// It doesn't matter from the perspective of the lister.
case "HostSystem":
case "VirtualApp":
+ case "StoragePod":
default:
return false
}
|
Allow StoragePod type to be traversed
This means `govc ls` can list the datastores that are part of a
datastore cluster (which is also called a StoragePod)
|
vmware_govmomi
|
train
|
go
|
0a6d951feb06527f9fd773aa5a181843e1b052f3
|
diff --git a/peewee_async.py b/peewee_async.py
index <HASH>..<HASH> 100644
--- a/peewee_async.py
+++ b/peewee_async.py
@@ -28,7 +28,7 @@ IntegrityErrors = (peewee.IntegrityError,)
try:
import aiopg
import psycopg2
- IntegrityErrors += (psycopg2.errors.UniqueViolation,)
+ IntegrityErrors += (psycopg2.IntegrityError,)
except ImportError:
aiopg = None
psycopg2 = None
|
Update peewee_async.py (#<I>)
Fix: use newer IntegrityError from psycopg2 instead of older UniqueViolation
|
05bit_peewee-async
|
train
|
py
|
c893d8c742829c868cf2b8b22d5524907d630142
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -51,6 +51,8 @@ kimi.prototype = {
set: function(state) {
+ var setToTarget = this.targetState === state;
+
this.currentState = state;
this.currentTime = 0;
this.targetState = null;
@@ -58,6 +60,15 @@ kimi.prototype = {
this.engine.stop();
sendUpdate.call(this);
+
+ if(setToTarget && this.onComplete) {
+ this.onComplete(
+ this.states[ states ],
+ state
+ );
+ }
+
+ this.onComplete = null;
},
go: function(to, onComplete) {
|
Made it so that onComplete from a go gets called if you set to the target state
|
mikkoh_kimi
|
train
|
js
|
b935f8ae4e7378dc684090e02ca300142e63426f
|
diff --git a/Classes/Controller/StandardController.php b/Classes/Controller/StandardController.php
index <HASH>..<HASH> 100644
--- a/Classes/Controller/StandardController.php
+++ b/Classes/Controller/StandardController.php
@@ -26,7 +26,7 @@ namespace TYPO3\Faker\Controller;
*
* @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
*/
-class StandardController extends \TYPO3\FLOW3\MVC\Controller\ActionController {
+class StandardController extends \TYPO3\FLOW3\Mvc\Controller\ActionController {
/**
* Generate and assign some fake data.
|
[TASK] Apply migration TYPO3.FLOW3-<I>
This commit contains the result of applying migration
TYPO3.FLOW3-<I>.
to this package.
Change-Id: I<I>b6e<I>a6f<I>f<I>fe<I>af<I>e<I>cea<I>c
Migration: TYPO3.FLOW3-<I>
|
kdambekalns_faker
|
train
|
php
|
23b31b0b924b6d5a6e6b1aa5ffa23d8ba8221e10
|
diff --git a/h2o-core/src/main/java/hex/Model.java b/h2o-core/src/main/java/hex/Model.java
index <HASH>..<HASH> 100755
--- a/h2o-core/src/main/java/hex/Model.java
+++ b/h2o-core/src/main/java/hex/Model.java
@@ -2583,6 +2583,7 @@ public abstract class Model<M extends Model<M,P,O>, P extends Model.Parameters,
ss.getStreamWriter().writeTo(os);
os.close();
genmodel = MojoModel.load(filename, true);
+ checkSerializable((MojoModel) genmodel);
features = MemoryManager.malloc8d(genmodel._names.length);
} catch (IOException e1) {
e1.printStackTrace();
@@ -2787,6 +2788,16 @@ public abstract class Model<M extends Model<M,P,O>, P extends Model.Parameters,
}
}
+ private static void checkSerializable(MojoModel mojoModel) {
+ try (ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ ObjectOutput out = new ObjectOutputStream(bos)) {
+ out.writeObject(mojoModel);
+ out.flush();
+ } catch (IOException e) {
+ throw new RuntimeException("MOJO cannot be serialized", e);
+ }
+ }
+
static <T extends Lockable<T>> int deleteAll(Key<T>[] keys) {
int c = 0;
for (Key k : keys) {
|
Add check to testJavaScoring that MOJO is actually Serializable
|
h2oai_h2o-3
|
train
|
java
|
217ba50d150c1ee85b8b7dcb8fbedd93ed5ebd60
|
diff --git a/git/repo/base.py b/git/repo/base.py
index <HASH>..<HASH> 100644
--- a/git/repo/base.py
+++ b/git/repo/base.py
@@ -422,7 +422,7 @@ class Repo(object):
def create_head(self, path: PathLike, commit: str = 'HEAD',
force: bool = False, logmsg: Optional[str] = None
- ) -> 'SymbolicReference':
+ ) -> Head:
"""Create a new head within the repository.
For more documentation, please see the Head.create method.
|
Fix typing of Head.create_head
|
gitpython-developers_GitPython
|
train
|
py
|
377b4d0b2ef393935105f20b5919f292bf4cdb74
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -48,13 +48,13 @@ setuptools.setup(
python_requires='>=3.6',
install_requires=[
'Flask>=1.0.0,<3.0',
- 'typeguard',
+ 'typeguard==2.12.1',
'typing;python_version<"3.5"',
'typing_extensions;python_version<"3.8"',
'typing_inspect==0.7.1',
],
setup_requires=['pytest-runner'],
- tests_require=['mock', 'coverage', 'pytest', 'pytest-cov', 'pytest-sugar', 'typeguard'],
+ tests_require=['mock', 'coverage', 'pytest', 'pytest-cov', 'pytest-xdist', 'pytest-sugar', 'typeguard'],
classifiers=[
'Environment :: Web Environment',
'Intended Audience :: Developers',
|
Version <I>
* Add support to Flask <I>.x (#<I>)
* Upgrade Flask version and dependencies versions
* Restructure requirements files
|
cenobites_flask-jsonrpc
|
train
|
py
|
505372a864a5d4ce209e4b67ff83f14579bb8755
|
diff --git a/src/Sulu/Bundle/ContentBundle/Resources/public/js/components/content/components/form/main.js b/src/Sulu/Bundle/ContentBundle/Resources/public/js/components/content/components/form/main.js
index <HASH>..<HASH> 100644
--- a/src/Sulu/Bundle/ContentBundle/Resources/public/js/components/content/components/form/main.js
+++ b/src/Sulu/Bundle/ContentBundle/Resources/public/js/components/content/components/form/main.js
@@ -90,6 +90,7 @@ define([], function() {
this.sandbox.on('sulu.edit-toolbar.back', function() {
this.sandbox.emit('sulu.content.contents.list');
}, this);
+
},
initData: function() {
@@ -125,6 +126,10 @@ define([], function() {
this.sandbox.dom.on(this.formId, 'keyup', function() {
this.setHeaderBar(false);
}.bind(this), "input,textarea");
+
+ this.sandbox.on('husky.ckeditor.changed', function(){
+ this.setHeaderBar(false);
+ }.bind(this));
}
};
|
added listener for ckeditor change
|
sulu_sulu
|
train
|
js
|
17f6fe8adf081f6a4f1dcf286a11b6ce45b39796
|
diff --git a/src/main/java/org/primefaces/component/chips/ChipsRenderer.java b/src/main/java/org/primefaces/component/chips/ChipsRenderer.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/primefaces/component/chips/ChipsRenderer.java
+++ b/src/main/java/org/primefaces/component/chips/ChipsRenderer.java
@@ -54,6 +54,10 @@ public class ChipsRenderer extends InputRenderer {
submittedValues = LangUtils.concat(submittedValues, new String[]{inputValue});
}
+ if (submittedValues.length > chips.getMax()) {
+ return;
+ }
+
if (submittedValues.length > 0) {
chips.setSubmittedValue(submittedValues);
}
|
fix #<I> - chips: lack of user input validation (max)
|
primefaces_primefaces
|
train
|
java
|
d2a439b001b99be805714b562a6df4f1dfb406b8
|
diff --git a/spec/integrations/allocation_spec.rb b/spec/integrations/allocation_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/integrations/allocation_spec.rb
+++ b/spec/integrations/allocation_spec.rb
@@ -47,10 +47,8 @@ describe 'Allocations and garbage collection' do
16
elsif RUBY_VERSION < '2.5.0'
15
- elsif RUBY_VERSION < '2.6.0'
- 14
else
- 13
+ 14
end
end
diff --git a/spec/matchers/make_allocations_matcher.rb b/spec/matchers/make_allocations_matcher.rb
index <HASH>..<HASH> 100644
--- a/spec/matchers/make_allocations_matcher.rb
+++ b/spec/matchers/make_allocations_matcher.rb
@@ -9,10 +9,10 @@ RSpec::Matchers.define :make_allocations do |expected|
end
@allocations = stats.allocations.to_a.size
- @allocations == expected
+ @allocations <= expected
end
failure_message do |_|
- "expected that block would make #{expected} allocations but made #{@allocations}"
+ "expected that block would make at most #{expected} allocations but made #{@allocations}"
end
end
|
Change the make_allocations RSpec matcher more future-proof
Instead of asserting allocation count equality, the matcher now makes
sure the number of actual allocations does not exceed the number of
expected allocations. This makes the matcher more resilient against
changes in future Ruby versions.
|
DataDog_dogstatsd-ruby
|
train
|
rb,rb
|
526cf9b2b38d2f3675e34e473f2cef38e1e0565b
|
diff --git a/examples/sftp-server/main.go b/examples/sftp-server/main.go
index <HASH>..<HASH> 100644
--- a/examples/sftp-server/main.go
+++ b/examples/sftp-server/main.go
@@ -118,10 +118,20 @@ func main() {
}
}(requests)
+ serverOptions := []sftp.ServerOption{
+ sftp.WithDebug(debugStream),
+ }
+
+ if readOnly {
+ serverOptions = append(serverOptions, sftp.ReadOnly())
+ fmt.Fprintf(debugStream, "Read-only server\n")
+ } else {
+ fmt.Fprintf(debugStream, "Read write server\n")
+ }
+
server, err := sftp.NewServer(
channel,
- sftp.WithDebug(debugStream),
- sftp.ReadOnly(),
+ serverOptions...,
)
if err != nil {
log.Fatal(err)
|
make example server respect readOnly flag (#<I>)
|
pkg_sftp
|
train
|
go
|
eb2fe63661c6d4102b5c00612bfdb1d7d822879b
|
diff --git a/lib/endpoints/class-wp-rest-controller.php b/lib/endpoints/class-wp-rest-controller.php
index <HASH>..<HASH> 100755
--- a/lib/endpoints/class-wp-rest-controller.php
+++ b/lib/endpoints/class-wp-rest-controller.php
@@ -254,7 +254,6 @@ abstract class WP_REST_Controller {
'type' => 'string',
);
$schema = $this->get_item_schema();
- $contexts = array();
if ( empty( $schema['properties'] ) ) {
return array_merge( $param_details, $args );
}
|
Remove unused `$contexts` variable definition
The variable is defined again two lines down, before it is used.
|
WP-API_WP-API
|
train
|
php
|
c748f036225f824e542cc196a0b9a4cec0b86af3
|
diff --git a/src/axelitus/Base/Float.php b/src/axelitus/Base/Float.php
index <HASH>..<HASH> 100644
--- a/src/axelitus/Base/Float.php
+++ b/src/axelitus/Base/Float.php
@@ -270,7 +270,7 @@ class Float
$rand = $min + (((mt_rand() - 1) / mt_getrandmax()) * abs($max - $min));
// Round if needed
- $rand = (!is_null($round) && Int::is($round) && $round > 0) ? round($rand, $round) : $rand;
+ (!is_null($round) && Int::is($round) && $round > 0) && ($rand = round($rand, $round));
// unseed (random reseed) random generator
mt_srand();
|
Refactoring: Compressed the code a little bit.
|
axelitus_php-base
|
train
|
php
|
fd197e22d94c0541093313ca8a087beb00703fda
|
diff --git a/sitetools/sites.py b/sitetools/sites.py
index <HASH>..<HASH> 100644
--- a/sitetools/sites.py
+++ b/sitetools/sites.py
@@ -69,7 +69,9 @@ log = logging.getLogger(__name__)
# TODO: Derive this for more platforms.
-site_package_postfix = os.path.join('lib', 'python%d.%d' % sys.version_info[:2], 'site-packages')
+lib_postfix = os.path.join('lib', 'python%d.%d' % sys.version_info[:2])
+site_postfix = os.path.join(lib_postfix, 'site.py')
+site_package_postfix = os.path.join(lib_postfix, 'site-packages')
platform_spec = '%s-%s' % (get_platform(), sys.version[:3])
@@ -95,7 +97,10 @@ class Site(object):
prefix = os.path.abspath(self.path)
while prefix and prefix != '/':
prefix = os.path.dirname(prefix)
- if os.path.exists(os.path.join(prefix, site_package_postfix)):
+ if (
+ os.path.exists(os.path.join(prefix, site_package_postfix)) or
+ os.path.exists(os.path.join(prefix, site_postfix))
+ ):
self.is_venv = True
self.prefix = prefix
break
|
Also check for site.py, as Python actually does
|
mikeboers_sitetools
|
train
|
py
|
53c55543a6589bd906d2c28c683f8f182b33d2fa
|
diff --git a/s3file/forms.py b/s3file/forms.py
index <HASH>..<HASH> 100644
--- a/s3file/forms.py
+++ b/s3file/forms.py
@@ -1,3 +1,4 @@
+import base64
import logging
import pathlib
import uuid
@@ -68,7 +69,9 @@ class S3FileInputMixin:
def upload_folder(self):
return str(pathlib.PurePosixPath(
self.upload_path,
- uuid.uuid4().hex,
+ base64.urlsafe_b64encode(
+ uuid.uuid4().bytes
+ ).decode('utf-8').rstrip('=\n'),
)) # S3 uses POSIX paths
class Media:
diff --git a/tests/test_forms.py b/tests/test_forms.py
index <HASH>..<HASH> 100644
--- a/tests/test_forms.py
+++ b/tests/test_forms.py
@@ -168,4 +168,4 @@ class TestS3FileInput:
def test_upload_folder(self):
assert ClearableFileInput().upload_folder.startswith('tmp/s3file/')
- assert len(ClearableFileInput().upload_folder) == 43
+ assert len(ClearableFileInput().upload_folder) == 33
|
Switch to shorter base<I> coded UUID in S3 key
|
codingjoe_django-s3file
|
train
|
py,py
|
5241c3faba37cbda1a4923728f5ca0035816d39b
|
diff --git a/core-bundle/src/Resources/contao/config/config.php b/core-bundle/src/Resources/contao/config/config.php
index <HASH>..<HASH> 100644
--- a/core-bundle/src/Resources/contao/config/config.php
+++ b/core-bundle/src/Resources/contao/config/config.php
@@ -457,7 +457,7 @@ $GLOBALS['TL_ASSETS'] = array
'TABLESORTER' => '2.0.5',
'MOOTOOLS' => '1.4.5',
'COLORPICKER' => '1.3',
- 'DATEPICKER' => '2.0.0',
+ 'DATEPICKER' => '2.2.0',
'MEDIABOX' => '1.4.6',
'SIMPLEMODAL' => '1.2',
'SLIMBOX' => '1.8'
|
[Core] Update the back end date picker to version <I>
|
contao_contao
|
train
|
php
|
86ee7c4c78847cd48dd03376cd45119aa5d196ae
|
diff --git a/lib/active_scaffold/attribute_params.rb b/lib/active_scaffold/attribute_params.rb
index <HASH>..<HASH> 100644
--- a/lib/active_scaffold/attribute_params.rb
+++ b/lib/active_scaffold/attribute_params.rb
@@ -148,7 +148,8 @@ module ActiveScaffold
def find_or_create_for_params(params, parent_column, parent_record)
current = parent_record.send(parent_column.name)
klass = parent_column.association.klass
- return nil if parent_column.show_blank_record and attributes_hash_is_empty?(params, klass)
+ debugger
+ return nil if parent_column.show_blank_record?(current) and attributes_hash_is_empty?(params, klass)
if params.has_key? :id
# modifying the current object of a singular association
|
Fix skip checking record is empty when show_blank_record is disabled
|
activescaffold_active_scaffold
|
train
|
rb
|
5beb9643f06721feac1d2568198ad050379e28a1
|
diff --git a/instabot/api/api.py b/instabot/api/api.py
index <HASH>..<HASH> 100644
--- a/instabot/api/api.py
+++ b/instabot/api/api.py
@@ -456,6 +456,7 @@ class API(object):
headers=None,
extra_sig=None,
):
+ self.set_proxy() # Only happens if `self.proxy`
if not self.is_logged_in and not login:
msg = "Not logged in!"
self.logger.critical(msg)
|
Bugfix set_proxy after each send_request, not only for login
|
instagrambot_instabot
|
train
|
py
|
b76ac2f865bae2e2ca87302935f5d9a458f1401f
|
diff --git a/src/Symfony/Component/Console/Helper/ProgressHelper.php b/src/Symfony/Component/Console/Helper/ProgressHelper.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/Console/Helper/ProgressHelper.php
+++ b/src/Symfony/Component/Console/Helper/ProgressHelper.php
@@ -227,18 +227,7 @@ class ProgressHelper extends Helper
*/
public function advance($step = 1, $redraw = false)
{
- if (null === $this->startTime) {
- throw new \LogicException('You must start the progress bar before calling advance().');
- }
-
- if (0 === $this->current) {
- $redraw = true;
- }
-
- $this->current += $step;
- if ($redraw || 0 === $this->current % $this->redrawFreq) {
- $this->display();
- }
+ $this->setCurrent($this->current + $step, $redraw);
}
/**
|
[Console] simplified code (refs #<I>)
|
symfony_symfony
|
train
|
php
|
726eccc19a25bdfc0b363075a57a0bf75596edf8
|
diff --git a/src/theme.js b/src/theme.js
index <HASH>..<HASH> 100644
--- a/src/theme.js
+++ b/src/theme.js
@@ -83,9 +83,10 @@ JSONEditor.AbstractTheme = Class.extend({
getMultiCheckboxHolder: function(controls,label,description) {
var el = document.createElement('div');
- label.style.display = 'block';
-
- el.appendChild(label);
+ if(label) {
+ label.style.display = 'block';
+ el.appendChild(label);
+ }
for(var i in controls) {
if(!controls.hasOwnProperty(i)) continue;
|
Fix bug when multiselect is used within table editor. Fixes #<I>
|
jdorn_json-editor
|
train
|
js
|
b98ce9fd0fc67ef25458a55895a713901f9442fa
|
diff --git a/app/models/travel_advice_edition.rb b/app/models/travel_advice_edition.rb
index <HASH>..<HASH> 100644
--- a/app/models/travel_advice_edition.rb
+++ b/app/models/travel_advice_edition.rb
@@ -17,8 +17,6 @@ class TravelAdviceEdition
field :state, type: String, default: "draft"
field :alert_status, type: Array, default: [ ]
field :summary, type: String
- field :image_id, type: String
- field :document_id, type: String
field :change_description, type: String
field :minor_update, type: Boolean, default: false
field :synonyms, type: Array, default: [ ]
|
Don't define the attachment id fields twice
These are now defined by the `attaches` method
|
alphagov_govuk_content_models
|
train
|
rb
|
e064cd859bf62a6fa1dc7595295e47e7a75308c9
|
diff --git a/pymzn/mzn/solvers.py b/pymzn/mzn/solvers.py
index <HASH>..<HASH> 100644
--- a/pymzn/mzn/solvers.py
+++ b/pymzn/mzn/solvers.py
@@ -444,6 +444,8 @@ class Chuffed(Solver):
try:
process = run(args)
out = process.stdout
+ if process.stderr:
+ raise RuntimeError(process.stderr)
except CalledProcessError as err:
log.exception(err.stderr)
raise RuntimeError(err.stderr) from err
@@ -698,8 +700,6 @@ class MIPSolver(Solver):
if mzn_file.endswith('fzn') and output_mode not in ['dzn', 'json']:
raise ValueError('Only dzn or json output available with fzn input.')
else:
- if output_mode != 'item':
- raise ValueError('Only item output available with mzn input.')
mzn = True
args.append('-G')
args.append(self.globals_dir)
@@ -965,11 +965,11 @@ gurobi = Gurobi()
cbc = CBC()
#: Default G12Fd instance.
-g12_fd = G12Fd()
+g12fd = G12Fd()
#: Default G12Lazy instance.
-g12_lazy = G12Lazy()
+g12lazy = G12Lazy()
#: Default G12Lazy instance.
-g12_mip = G12MIP()
+g12mip = G12MIP()
|
solvers: bug fixing in Chuffed and MIPSolver + rename G<I> instances
|
paolodragone_pymzn
|
train
|
py
|
b2fdf9725d4dc67cdd575a2926f6a5e0ed7be5a6
|
diff --git a/tasky/loop.py b/tasky/loop.py
index <HASH>..<HASH> 100644
--- a/tasky/loop.py
+++ b/tasky/loop.py
@@ -58,6 +58,8 @@ class Tasky(object):
self.loop.call_soon(self.start_task, task)
+ return task
+
def execute(self, fn, *args, **kwargs) -> None:
'''Execute an arbitrary function or coroutine on the event loop.'''
|
Inserting a task should return the final task object
|
jreese_tasky
|
train
|
py
|
4d61e09cf1c2d93522cf638928940c0b958d82cd
|
diff --git a/spyder/plugins/configdialog.py b/spyder/plugins/configdialog.py
index <HASH>..<HASH> 100644
--- a/spyder/plugins/configdialog.py
+++ b/spyder/plugins/configdialog.py
@@ -921,7 +921,6 @@ class MainConfigPage(GeneralConfigPage):
interface_layout.addWidget(animated_box)
interface_layout.addWidget(tear_off_box)
interface_layout.addLayout(margins_caret_layout)
- interface_layout.addWidget(high_dpi_scaling_box)
interface_group.setLayout(interface_layout)
# --- Status bar
|
Removed line added by mistake when resolving conflicts
|
spyder-ide_spyder
|
train
|
py
|
bf3f302a249b481044a398af630278aaf11c92d7
|
diff --git a/rb/spec/integration/selenium/webdriver/driver_spec.rb b/rb/spec/integration/selenium/webdriver/driver_spec.rb
index <HASH>..<HASH> 100644
--- a/rb/spec/integration/selenium/webdriver/driver_spec.rb
+++ b/rb/spec/integration/selenium/webdriver/driver_spec.rb
@@ -226,7 +226,7 @@ describe "Driver" do
end
end
- not_compliant_on :browser => [:opera, :iphone, :android] do
+ not_compliant_on :browser => [:opera, :iphone, :android, :phantomjs] do
describe "execute async script" do
before {
driver.manage.timeouts.script_timeout = 0
@@ -238,11 +238,9 @@ describe "Driver" do
result.should == [nil, 123, 'abc', true, false]
end
- not_compliant_on :browser => :phantomjs do
- it "should be able to pass multiple arguments to async scripts" do
- result = driver.execute_async_script "arguments[arguments.length - 1](arguments[0] + arguments[1]);", 1, 2
- result.should == 3
- end
+ it "should be able to pass multiple arguments to async scripts" do
+ result = driver.execute_async_script "arguments[arguments.length - 1](arguments[0] + arguments[1]);", 1, 2
+ result.should == 3
end
it "times out if the callback is not invoked" do
|
JariBakken: Fix one of the phantomjs guards.
r<I>
|
SeleniumHQ_selenium
|
train
|
rb
|
c6342a5f92c00a39567dd422cd7a69c23ae78898
|
diff --git a/aeron-archive/src/main/java/io/aeron/archive/client/AeronArchive.java b/aeron-archive/src/main/java/io/aeron/archive/client/AeronArchive.java
index <HASH>..<HASH> 100644
--- a/aeron-archive/src/main/java/io/aeron/archive/client/AeronArchive.java
+++ b/aeron-archive/src/main/java/io/aeron/archive/client/AeronArchive.java
@@ -3433,7 +3433,11 @@ public final class AeronArchive implements AutoCloseable
throw new ArchiveException("unexpected response: code=" + code);
}
- archiveProxy.keepAlive(controlSessionId, Aeron.NULL_VALUE);
+ if (!archiveProxy.keepAlive(controlSessionId, Aeron.NULL_VALUE))
+ {
+ throw new ArchiveException("failed to send keep alive after archive connect");
+ }
+
aeronArchive = new AeronArchive(ctx, controlResponsePoller, archiveProxy, controlSessionId);
step(5);
|
[Java] Check for successful keep alive send after archive connect.
|
real-logic_aeron
|
train
|
java
|
f011fda72a6e017147e63c653444c271a0fbe45d
|
diff --git a/src/onelogin/saml2/response.py b/src/onelogin/saml2/response.py
index <HASH>..<HASH> 100644
--- a/src/onelogin/saml2/response.py
+++ b/src/onelogin/saml2/response.py
@@ -104,7 +104,7 @@ class OneLogin_Saml2_Response(object):
# Check if the InResponseTo of the Response matchs the ID of the AuthNRequest (requestId) if provided
in_response_to = self.document.get('InResponseTo', None)
- if in_response_to and request_id:
+ if in_response_to is not None and request_id is not None:
if in_response_to != request_id:
raise Exception('The InResponseTo of the Response: %s, does not match the ID of the AuthNRequest sent by the SP: %s' % (in_response_to, request_id))
|
Improved inResponse validation on Responses
|
onelogin_python3-saml
|
train
|
py
|
07f80541522c48d5ec4a0c3acf80473a628974a9
|
diff --git a/jaide/core.py b/jaide/core.py
index <HASH>..<HASH> 100644
--- a/jaide/core.py
+++ b/jaide/core.py
@@ -237,7 +237,7 @@ class Jaide():
# ncclient doesn't support a truly blank commit, so if nothing is
# passed, use 'annotate system' to make a blank commit
if not commands:
- commands = "annotate system"
+ commands = 'annotate system ""'
clean_cmds = []
for cmd in clean_lines(commands):
clean_cmds.append(cmd)
@@ -257,12 +257,12 @@ class Jaide():
synchronize=synchronize)
self.unlock()
if results:
+ if req_format == 'xml':
+ return results
# commit() DOES NOT return a parse-able xml tree, so we
# convert it to an ElementTree xml tree.
results = ET.fromstring(results.tostring)
out = ''
- if req_format == 'xml':
- return results
for i in results.iter():
# the success message is just a tag, so we need to get it
# specifically.
@@ -270,6 +270,8 @@ class Jaide():
out += 'configuration check succeeds\n'
elif i.tag == 'commit-success':
out += 'commit complete\n'
+ elif i.tag == 'ok':
+ out += 'commit complete\n'
# this is for normal output with a tag and inner text, it will
# strip the inner text and add it to the output.
elif i.text is not None:
|
Jaide.commit updates
- Add ‘ok’ as a recognized tag for commit success (SRX devices).
- update no commands commit option to include an empty string in the
“annotate system” command. Prevents errors on certain Junos versions.
|
NetworkAutomation_jaide
|
train
|
py
|
f1e5c11dc6c213b7970787beffc6768e3f8129a9
|
diff --git a/dropwizard-logging/src/main/java/com/codahale/dropwizard/logging/LoggingFactory.java b/dropwizard-logging/src/main/java/com/codahale/dropwizard/logging/LoggingFactory.java
index <HASH>..<HASH> 100644
--- a/dropwizard-logging/src/main/java/com/codahale/dropwizard/logging/LoggingFactory.java
+++ b/dropwizard-logging/src/main/java/com/codahale/dropwizard/logging/LoggingFactory.java
@@ -12,8 +12,7 @@ import com.codahale.metrics.logback.InstrumentedAppender;
import org.slf4j.LoggerFactory;
import org.slf4j.bridge.SLF4JBridgeHandler;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
+import javax.management.*;
import java.lang.management.ManagementFactory;
import java.util.Map;
import java.util.TimeZone;
@@ -83,7 +82,8 @@ public class LoggingFactory {
objectName),
objectName);
}
- } catch (Exception e) {
+ } catch (MalformedObjectNameException | InstanceAlreadyExistsException |
+ NotCompliantMBeanException | MBeanRegistrationException e) {
throw new RuntimeException(e);
}
|
Replace exception catch w/ multi-exeception catch.
|
dropwizard_dropwizard
|
train
|
java
|
321060484a0104c01980bc323a77df4c9b43a558
|
diff --git a/faker/providers/automotive/__init__.py b/faker/providers/automotive/__init__.py
index <HASH>..<HASH> 100644
--- a/faker/providers/automotive/__init__.py
+++ b/faker/providers/automotive/__init__.py
@@ -8,10 +8,9 @@ import re
class Provider(BaseProvider):
license_formats = ()
-
- @classmethod
- def license_plate(cls):
+
+ def license_plate(self):
temp = re.sub(r'\?',
- lambda x: cls.random_element(ascii_uppercase),
- cls.random_element(cls.license_formats))
- return cls.numerify(temp)
+ lambda x: self.random_element(ascii_uppercase),
+ self.random_element(self.license_formats))
+ return self.numerify(temp)
|
per-generator random for automotive
|
joke2k_faker
|
train
|
py
|
01d9020b91b941e20bb303c3e34b673e39d3cd15
|
diff --git a/xdis/magics.py b/xdis/magics.py
index <HASH>..<HASH> 100755
--- a/xdis/magics.py
+++ b/xdis/magics.py
@@ -519,7 +519,6 @@ def py_str2tuple(orig_version):
"""
version = re.sub(r"(pypy|dropbox)$", "", orig_version)
if version in magics:
- magic = magics[version]
m = re.match(r"^(\d)\.(\d+)\.(\d+)", version)
if m:
return (int(m.group(1)), int(m.group(2)), int(m.group(3)))
@@ -545,7 +544,7 @@ def sysinfo2float(version_info=sys.version_info):
For handling Pypy, pyston, jython, etc. and interim versions of
C Python, use sysinfo2magic.
"""
- ver_str = version_tuple_to_str(version_info)
+ vers_str = version_tuple_to_str(version_info)
if version_info[3] != "final":
vers_str += "." + "".join([str(i) for i in version_info[3:]])
|
Wrong wariable name
Is caught by flake8 - need to automate that better...
|
rocky_python-xdis
|
train
|
py
|
1468caaa5a672cf7a24e20a29da82ff2008099a4
|
diff --git a/datasift/client.py b/datasift/client.py
index <HASH>..<HASH> 100644
--- a/datasift/client.py
+++ b/datasift/client.py
@@ -26,6 +26,10 @@ from six.moves.urllib.parse import urlencode
import requests
+# inject pyopenssl
+
+import requests.packages.urllib3.contrib.pyopenssl
+requests.packages.urllib3.contrib.pyopenssl.inject_into_urllib3()
class Client(object):
""" Datasift client class.
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -20,14 +20,15 @@ setup(
url="https://github.com/datasift/datasift-python",
packages=['datasift'],
install_requires=[
- 'requests <3.0.0, >=2.2.0',
+ 'requests <3.0.0, >=2.8.0',
'autobahn <0.10.0, >=0.9.4',
'six <2.0.0, >=1.6.0',
'twisted <16.0.0, >=14.0.0',
'pyopenssl <0.16.0, >=0.15.1',
'python-dateutil <3, >=2.1',
'service_identity >= 14.0.0',
- 'requests-futures >= 0.9.5'
+ 'requests-futures >= 0.9.5',
+ 'ndg-httpsclient >= 0.4.0'
],
tests_require=[
'httmock >=1.1.1, < 2.0.0',
|
bump requests version, inject pyopenssl into requests
|
datasift_datasift-python
|
train
|
py,py
|
58c02b39239ac674814527ddf4827fc03c42d63e
|
diff --git a/plenum/server/node.py b/plenum/server/node.py
index <HASH>..<HASH> 100644
--- a/plenum/server/node.py
+++ b/plenum/server/node.py
@@ -2707,6 +2707,7 @@ class Node(HasActionQueue, Motor, Propagator, MessageProcessor, HasFileStorage,
def _schedule_backup_primary_disconnected(self, inst_id):
if not self.disconnected_primaries:
self._schedule(self.propose_replica_remove, self.config.TolerateBackupPrimaryDisconnection)
+ if inst_id not in self.disconnected_primaries:
self.disconnected_primaries[inst_id] = 0
# TODO: consider moving this to pool manager
|
INDY-<I>: bugfix for _schedule_backup_primary_disconnected()
|
hyperledger_indy-plenum
|
train
|
py
|
c486db2d715fd509b4d2a102337283350c7f1394
|
diff --git a/registry/client/transport/transport.go b/registry/client/transport/transport.go
index <HASH>..<HASH> 100644
--- a/registry/client/transport/transport.go
+++ b/registry/client/transport/transport.go
@@ -6,6 +6,13 @@ import (
"sync"
)
+func identityTransportWrapper(rt http.RoundTripper) http.RoundTripper {
+ return rt
+}
+
+// DefaultTransportWrapper allows a user to wrap every generated transport
+var DefaultTransportWrapper = identityTransportWrapper
+
// RequestModifier represents an object which will do an inplace
// modification of an HTTP request.
type RequestModifier interface {
@@ -31,10 +38,11 @@ func (h headerModifier) ModifyRequest(req *http.Request) error {
// NewTransport creates a new transport which will apply modifiers to
// the request on a RoundTrip call.
func NewTransport(base http.RoundTripper, modifiers ...RequestModifier) http.RoundTripper {
- return &transport{
- Modifiers: modifiers,
- Base: base,
- }
+ return DefaultTransportWrapper(
+ &transport{
+ Modifiers: modifiers,
+ Base: base,
+ })
}
// transport is an http.RoundTripper that makes HTTP requests after
|
make it possible to wrap the client transport in another one
|
docker_distribution
|
train
|
go
|
b7ef1a2a017c597e6c0ce08cd465ea2902ce98f7
|
diff --git a/lib/hbs-helpers.js b/lib/hbs-helpers.js
index <HASH>..<HASH> 100644
--- a/lib/hbs-helpers.js
+++ b/lib/hbs-helpers.js
@@ -69,10 +69,10 @@ module.exports.register = function (handlebars) {
}
if (context.hash.hasOwnProperty('object')) {
- if (typeof context === 'string') {
+ if (typeof context.hash.object === 'string') {
objectData = JSON.parse(context.hash.object);
}
- if (typeof context === 'object') {
+ if (typeof context.hash.object === 'object') {
objectData = context.hash.object;
}
|
fixed a bug with include helper not parsing object variable
|
biotope_biotope-build
|
train
|
js
|
4a3090b01ff7b3f593f9863552a7938e23a04746
|
diff --git a/goble.go b/goble.go
index <HASH>..<HASH> 100644
--- a/goble.go
+++ b/goble.go
@@ -263,6 +263,12 @@ func (ble *BLE) HandleXpcEvent(event xpc.Dict, err error) {
}
case 38, 67: // connect
+ if id == 38 && ble.utsname.Release >= "18." {
+ // this is not a connect (it doesn't have kCBMsgArgDeviceUUID,
+ // but instead has kCBAdvDataDeviceAddress)
+ break
+ }
+
deviceUuid := args.MustGetUUID("kCBMsgArgDeviceUUID")
ble.Emit(Event{Name: "connect", DeviceUUID: deviceUuid})
|
Fix crash with MacOS <I>, where "<I>" is not a connect anymore (or at least it doesn't have the right parameters to be a connect)
|
raff_goble
|
train
|
go
|
bb2c22760cef1fd8f879e434562c46a1593d4f9b
|
diff --git a/spotinst/client.go b/spotinst/client.go
index <HASH>..<HASH> 100644
--- a/spotinst/client.go
+++ b/spotinst/client.go
@@ -18,10 +18,10 @@ type Client struct {
// User agent for client
UserAgent string
- // Spotinst makes a call to an authorization API using your username and
- // password, returning an 'Access Token' and a 'Refresh Token'.
- // Our use case does not require the refresh token, but we should implement
- // for completeness.
+ // Spotinst makes a call to an authorization API using your username and
+ // password, returning an 'Access Token' and a 'Refresh Token'.
+ // Our use case does not require the refresh token, but we should implement
+ // for completeness.
AccessToken string
RefreshToken string
|
fix(client): indent comments
|
spotinst_spotinst-sdk-go
|
train
|
go
|
7aab1b0fda368fd9f395a427f07ded9d443b3d9e
|
diff --git a/hiwenet/hiwenet.py b/hiwenet/hiwenet.py
index <HASH>..<HASH> 100644
--- a/hiwenet/hiwenet.py
+++ b/hiwenet/hiwenet.py
@@ -1,8 +1,7 @@
-import sys
-import os
import argparse
+import os
+import sys
import warnings
-import nibabel
import networkx as nx
import numpy as np
|
Removing nibabel and pyradigm are requirements
|
raamana_hiwenet
|
train
|
py
|
1d0fe0982b762eccdf2ce42ea2687eab895fb0a8
|
diff --git a/lib/tml/version.rb b/lib/tml/version.rb
index <HASH>..<HASH> 100644
--- a/lib/tml/version.rb
+++ b/lib/tml/version.rb
@@ -31,7 +31,7 @@
#++
module Tml
- VERSION = '5.4.1'
+ VERSION = '5.4.2'
def self.full_version
"tml-ruby v#{Tml::VERSION} (Faraday v#{Faraday::VERSION})"
|
Updated version to <I>
|
translationexchange_tml-ruby
|
train
|
rb
|
9ccfaf9ca18415a70c99b92e56b6e7b89f276c58
|
diff --git a/src/models/Entity.php b/src/models/Entity.php
index <HASH>..<HASH> 100644
--- a/src/models/Entity.php
+++ b/src/models/Entity.php
@@ -67,9 +67,15 @@ class Entity extends Eloquent {
{
parent::__construct($attributes);
- if ( ! $this->closure)
+ $tablePrefix = DB::getTablePrefix();
+
+ if ( ! isset($this->closure))
+ {
+ $this->closure = $this->getClosure();
+ }
+ elseif ( ! str_contains($this->closure, $tablePrefix))
{
- $this->closure = $this->getTable().'_closure';
+ $this->closure = $tablePrefix.$this->closure;
}
}
@@ -93,7 +99,9 @@ class Entity extends Eloquent {
*/
public function getClosure()
{
- return $this->closure;
+ if (isset($this->closure)) return $this->closure;
+
+ return DB::geTablePrefix().$this->getTable().'_closure';
}
/**
@@ -1029,7 +1037,7 @@ class Entity extends Eloquent {
$results = DB::select($selectQuery);
array_walk($results, function(&$item){ $item = (array)$item; });
- DB::table($this->closure)->insert($results);
+ DB::table($this->getClosure())->insert($results);
});
}
|
fixed #<I> when database prefix led to wrong closure table name
|
soda-framework_eloquent-closure
|
train
|
php
|
a7a7ec2c3c4bdfcbbfef61a33a75f2f745c6ed00
|
diff --git a/irc/client.py b/irc/client.py
index <HASH>..<HASH> 100644
--- a/irc/client.py
+++ b/irc/client.py
@@ -964,11 +964,11 @@ class Throttler(object):
def reset(self):
self.start = time.time()
- self.calls = itertools.Count()
+ self.calls = itertools.count()
def __call__(self, *args, **kwargs):
# ensure max_rate >= next(self.calls) / (elapsed + must_wait)
- elapsed = time.time() - self.start()
+ elapsed = time.time() - self.start
must_wait = next(self.calls) / self.max_rate - elapsed
time.sleep(max(0, must_wait))
return self.func()
|
Minor fixes for jaraco/irc issue <I>
|
jaraco_irc
|
train
|
py
|
26bc5a71323fdc06b83a670dc67e8ef59cfcaeef
|
diff --git a/core/model/src/main/java/it/unibz/inf/ontop/iq/node/impl/UnionNodeImpl.java b/core/model/src/main/java/it/unibz/inf/ontop/iq/node/impl/UnionNodeImpl.java
index <HASH>..<HASH> 100644
--- a/core/model/src/main/java/it/unibz/inf/ontop/iq/node/impl/UnionNodeImpl.java
+++ b/core/model/src/main/java/it/unibz/inf/ontop/iq/node/impl/UnionNodeImpl.java
@@ -336,10 +336,10 @@ public class UnionNodeImpl extends CompositeQueryNodeImpl implements UnionNode {
ImmutableSet<Variable> unionVariables = getVariables();
for (IQTree child : children) {
- if (!child.getVariables().containsAll(unionVariables)) {
+ if (!child.getVariables().equals(unionVariables)) {
throw new InvalidIntermediateQueryException("This child " + child
- + " does not project all the variables " +
- "required by the UNION node (" + unionVariables + ")\n" + this);
+ + " does not project exactly all the variables " +
+ "of the UNION node (" + unionVariables + ")\n" + this);
}
}
}
|
Union children are now required to project the same variables.
|
ontop_ontop
|
train
|
java
|
167ab2077332d11f27ffb9e93172ded2540f95d5
|
diff --git a/src/Command/CodeCheckerCommand.php b/src/Command/CodeCheckerCommand.php
index <HASH>..<HASH> 100644
--- a/src/Command/CodeCheckerCommand.php
+++ b/src/Command/CodeCheckerCommand.php
@@ -73,15 +73,17 @@ class CodeCheckerCommand extends AbstractPluginCommand
return $this->outputSkip($output);
}
- $sniffer = new \PHP_CodeSniffer();
- $sniffer->setCli(new CodeSnifferCLI([
+ // Must define this before the sniffer due to odd code inclusion resulting in sniffer being included twice.
+ $cli = new CodeSnifferCLI([
'reports' => ['full' => null],
'colors' => true,
'encoding' => 'utf-8',
'showProgress' => true,
'reportWidth' => 120,
- ]));
+ ]);
+ $sniffer = new \PHP_CodeSniffer();
+ $sniffer->setCli($cli);
$sniffer->process($files, $this->standard);
$results = $sniffer->reporting->printReport('full', false, $sniffer->cli->getCommandLineValues(), null, 120);
|
Fix odd code coverage bug
Leads to a double inclusion while
running tests with code coverage.
|
blackboard-open-source_moodle-plugin-ci
|
train
|
php
|
31ce9a8e93fc413b3c046950bf138ce9210c0ea2
|
diff --git a/lib/rmagick_internal.rb b/lib/rmagick_internal.rb
index <HASH>..<HASH> 100644
--- a/lib/rmagick_internal.rb
+++ b/lib/rmagick_internal.rb
@@ -291,7 +291,7 @@ module Magick
# (pop) graphic-context".
def define_clip_path(name)
push('defs')
- push('clip-path', name)
+ push("clip-path \"#{name}\"")
push('graphic-context')
yield
ensure
diff --git a/test/Draw.rb b/test/Draw.rb
index <HASH>..<HASH> 100755
--- a/test/Draw.rb
+++ b/test/Draw.rb
@@ -317,4 +317,25 @@ class DrawUT < Test::Unit::TestCase
assert_instance_of(Magick::Image::DrawOptions, yield_obj)
end
end
+
+ def test_issue_604
+ points = [0, 0, 1, 1, 2, 2]
+
+ pr = Magick::Draw.new
+
+ pr.define_clip_path('example') do
+ pr.polygon(*points)
+ end
+
+ pr.push
+ pr.clip_path('example')
+
+ composite = Magick::Image.new(10, 10)
+ pr.composite(0, 0, 10, 10, composite)
+
+ pr.pop
+
+ canvas = Magick::Image.new(10, 10)
+ pr.draw(canvas)
+ end
end
|
Fixed setting the name of the clip path. (#<I>)
This PR fixes the issue reported in #<I>. The name of the clip-path should be between quotes. Recent version of ImageMagick are more strict about this.
|
rmagick_rmagick
|
train
|
rb,rb
|
7f68d6c82dd4219f15a77f69e54cf6a358a992dc
|
diff --git a/satpy/tests/reader_tests/test_mirs.py b/satpy/tests/reader_tests/test_mirs.py
index <HASH>..<HASH> 100644
--- a/satpy/tests/reader_tests/test_mirs.py
+++ b/satpy/tests/reader_tests/test_mirs.py
@@ -79,7 +79,8 @@ def _get_datasets_with_attributes():
'coordinates': "Longitude Latitude",
'scale_factor': 0.1,
'_FillValue': -999,
- 'valid_range': [0, 1000]})
+ 'valid_range': [0, 1000]},
+ dims=('Scanline', 'Field_of_view'))
sfc_type = xr.DataArray(np.random.randint(0, 4, size=(N_SCANLINE, N_FOV)),
attrs={'description': "type of surface:0-ocean," +
"1-sea ice,2-land,3-snow",
|
Add Scanline/FOV dims to RR
otherwise they are dim_0 and dim_1 and they are not recognized by
the reader. Scanline/FOV are converted to y,x in reader
|
pytroll_satpy
|
train
|
py
|
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.