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
93965f431fd8c06faebe776ca1f6336abaccefb2
diff --git a/src/Barryvdh/Cors/CorsListener.php b/src/Barryvdh/Cors/CorsListener.php index <HASH>..<HASH> 100644 --- a/src/Barryvdh/Cors/CorsListener.php +++ b/src/Barryvdh/Cors/CorsListener.php @@ -35,8 +35,6 @@ class CorsListener protected $app; protected $paths; protected $defaults; - protected $options; - protected $runAfter = false; public function __construct(Application $app, array $paths, array $defaults = array())
Remove $this->options To prevent confusion.
barryvdh_laravel-cors
train
php
c899388124f9745b361436523db91127fab15497
diff --git a/main/boofcv-feature/src/main/java/boofcv/factory/shape/FactoryShapeDetector.java b/main/boofcv-feature/src/main/java/boofcv/factory/shape/FactoryShapeDetector.java index <HASH>..<HASH> 100644 --- a/main/boofcv-feature/src/main/java/boofcv/factory/shape/FactoryShapeDetector.java +++ b/main/boofcv-feature/src/main/java/boofcv/factory/shape/FactoryShapeDetector.java @@ -104,11 +104,11 @@ public class FactoryShapeDetector { { config.checkValidity(); -// PointsToPolyline contourToPolygon = -// FactoryPointsToPolyline.splitMerge(config.contourToPoly); - PointsToPolyline contourToPolygon = - FactoryPointsToPolyline.featuresSplitMerge(null); + FactoryPointsToPolyline.splitMerge(config.contourToPoly); + +// PointsToPolyline contourToPolygon = +// FactoryPointsToPolyline.featuresSplitMerge(null); return new DetectPolygonFromContour<>( config.minimumSides, config.maximumSides, contourToPolygon,
unbreaking factory that was using experimental code
lessthanoptimal_BoofCV
train
java
7ecc3af5f73a6c4b7d35071fb3d11c8463ee2110
diff --git a/js/bitmax.js b/js/bitmax.js index <HASH>..<HASH> 100644 --- a/js/bitmax.js +++ b/js/bitmax.js @@ -337,7 +337,7 @@ module.exports = class bitmax extends Exchange { await this.loadMarkets (); const market = this.market (symbol); const request = { - 'symbol': market['symbol'], + 'symbol': market['id'], }; if (limit !== undefined) { request['n'] = limit; // default = maximum = 100 @@ -429,7 +429,7 @@ module.exports = class bitmax extends Exchange { await this.loadMarkets (); const market = this.market (symbol); const request = { - 'symbol': market['symbol'], + 'symbol': market['id'], }; const response = await this.publicGetTicker24hr (this.extend (request, params)); return this.parseTicker (response, market); @@ -473,7 +473,7 @@ module.exports = class bitmax extends Exchange { await this.loadMarkets (); const market = this.market (symbol); const request = { - 'symbol': market['symbol'], + 'symbol': market['id'], 'interval': this.timeframes[timeframe], }; // if since and limit are not specified
bitmax public api market ids fixup
ccxt_ccxt
train
js
25dce591443d0e3b4f023289f5c4bb68b93b8e03
diff --git a/spec/unit/veritas/algebra/extension/insert_spec.rb b/spec/unit/veritas/algebra/extension/insert_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/veritas/algebra/extension/insert_spec.rb +++ b/spec/unit/veritas/algebra/extension/insert_spec.rb @@ -11,7 +11,7 @@ describe Algebra::Extension, '#insert' do let(:extension_attr) { Attribute::Integer.new(:test) } let(:header) { [ [ :id, Integer ] ] } - context 'when other relation is a matching extension' do + context 'when other relation has matching extensions' do let(:other) do Relation.new(header, [ [ 2 ] ].each).extend do |context| context.add(:test, 1) @@ -40,7 +40,7 @@ describe Algebra::Extension, '#insert' do end context 'when other relation is not an extension' do - let(:other) { Relation.new(header, [ [ 2 ] ].each) } + let(:other) { Relation.new(header, [ [ 2 ] ].each) } specify { expect { subject }.to raise_error(ExtensionMismatchError, 'other relation must have matching extensions to be inserted') } end
Fix formatting and example description in spec
dkubb_axiom
train
rb
c38420f879be8c4dd1aaeb7e36208b0495f9a84d
diff --git a/integration_tests/blockstack_integration_tests/scenarios/rest_register.py b/integration_tests/blockstack_integration_tests/scenarios/rest_register.py index <HASH>..<HASH> 100644 --- a/integration_tests/blockstack_integration_tests/scenarios/rest_register.py +++ b/integration_tests/blockstack_integration_tests/scenarios/rest_register.py @@ -144,7 +144,7 @@ def scenario( wallets, **kw ): return False # wait for the preorder to get confirmed - for i in xrange(0, 6): + for i in xrange(0, 4): testlib.next_block( **kw ) # wait for register to go through @@ -159,7 +159,7 @@ def scenario( wallets, **kw ): if not res: return False - for i in xrange(0, 6): + for i in xrange(0, 4): testlib.next_block( **kw ) print 'Wait for update to be submitted' @@ -173,7 +173,7 @@ def scenario( wallets, **kw ): if not res: return False - for i in xrange(0, 12): + for i in xrange(0, 4): testlib.next_block( **kw ) print 'Wait for update to be confirmed'
wait <I> confs, not <I>
blockstack_blockstack-core
train
py
d9f13fe09e4adc52bdf64533f8d4b0cdceaf2956
diff --git a/template/app/view/examples/Inline.js b/template/app/view/examples/Inline.js index <HASH>..<HASH> 100644 --- a/template/app/view/examples/Inline.js +++ b/template/app/view/examples/Inline.js @@ -72,6 +72,7 @@ Ext.define('Docs.view.examples.Inline', { cmpName: 'code', value: this.value, listeners: { + init: this.updateHeight, change: this.updateHeight, scope: this } diff --git a/template/app/view/examples/InlineEditor.js b/template/app/view/examples/InlineEditor.js index <HASH>..<HASH> 100644 --- a/template/app/view/examples/InlineEditor.js +++ b/template/app/view/examples/InlineEditor.js @@ -11,6 +11,11 @@ Ext.define('Docs.view.examples.InlineEditor', { this.addEvents( /** * @event + * Fired after CodeMirror initialized. + */ + "init", + /** + * @event * Fired when CodeMirror onChange is called. */ "change" @@ -29,6 +34,7 @@ Ext.define('Docs.view.examples.InlineEditor', { this.fireEvent("change"); }, this) }); + this.fireEvent("init"); } },
Another fix for CodeMirror initial height. The hight now gets set to the right size the first time the editor is activated.
senchalabs_jsduck
train
js,js
d1f15c67c9ca150681dd683611a0a492d537028a
diff --git a/basic/basic_host.go b/basic/basic_host.go index <HASH>..<HASH> 100644 --- a/basic/basic_host.go +++ b/basic/basic_host.go @@ -207,7 +207,17 @@ func (h *BasicHost) preferredProtocol(p peer.ID, pids []protocol.ID) protocol.ID prefs, ok := h.protoPrefs[p] if !ok { - return "" + supported, err := h.Peerstore().GetProtocols(p) + if err != nil { + log.Warningf("error getting protocol for peer %s: %s", p, err) + return "" + } + + prefs = make(map[protocol.ID]struct{}) + for _, proto := range supported { + prefs[protocol.ID(proto)] = struct{}{} + } + h.protoPrefs[p] = prefs } for _, pid := range pids {
host: pre-seed preferred protocols with info from identify
libp2p_go-libp2p-host
train
go
8186181e55bc5464cda86b87ef280fda05d2e8b7
diff --git a/Grid/Column/SelectColumn.php b/Grid/Column/SelectColumn.php index <HASH>..<HASH> 100644 --- a/Grid/Column/SelectColumn.php +++ b/Grid/Column/SelectColumn.php @@ -39,6 +39,13 @@ class SelectColumn extends Column { return array(new Filter(self::OPERATOR_EQ, $this->data)); } + + public function setValues(array $values) + { + $this->values = $values; + + return $this; + } public function getValues() {
Update Grid/Column/SelectColumn.php
APY_APYDataGridBundle
train
php
91d70326de922b15083df7c3b0d8567b67c2486e
diff --git a/asn1crypto/x509.py b/asn1crypto/x509.py index <HASH>..<HASH> 100644 --- a/asn1crypto/x509.py +++ b/asn1crypto/x509.py @@ -20,6 +20,7 @@ Other type classes are defined that help compose the types listed above. from __future__ import unicode_literals, division, absolute_import, print_function +import hashlib from collections import OrderedDict from .core import ( @@ -168,6 +169,9 @@ class Name(Choice): ('', RDNSequence), ] + _sha1 = None + _sha256 = None + @property def native(self): if self.contents is None: @@ -184,6 +188,28 @@ class Name(Choice): self._native[type_val_type] = type_val['value'] return self._native + @property + def sha1(self): + """ + :return: + The SHA1 hash of the DER-encoded bytes of this name + """ + + if self._sha1 is None: + self._sha1 = hashlib.sha1(self.dump()).digest() + return self._sha1 + + @property + def sha256(self): + """ + :return: + The SHA-256 hash of the DER-encoded bytes of this name + """ + + if self._sha256 is None: + self._sha256 = hashlib.sha256(self.dump()).digest() + return self._sha256 + class AnotherName(Sequence): _fields = [
Added .sha1 and .sha<I> to x<I>.Name class
wbond_asn1crypto
train
py
e7e8cb2449e2667d751f796d59f16252ae93408b
diff --git a/api.go b/api.go index <HASH>..<HASH> 100644 --- a/api.go +++ b/api.go @@ -39,16 +39,17 @@ func Request(method string, url string, opts Options) (*Response, error) { } contentType := opts.ContentType + accept := opts.Accept + if accept == "" { + accept = "application/json" + } body = nil if opts.ReqBody != nil { if contentType == "" { contentType = "application/json" } - if accept == "" { - accept = "application/json" - } if contentType == "application/json" { bodyText, err := json.Marshal(opts.ReqBody) @@ -74,9 +75,7 @@ func Request(method string, url string, opts Options) (*Response, error) { req.Header.Add("Content-Type", contentType) } - if accept != "" { - req.Header.Add("Accept", accept) - } + req.Header.Add("Accept", accept) if opts.ContentLength > 0 { req.ContentLength = opts.ContentLength
Accept headers are applicable to all requests
racker_perigee
train
go
be268174ab62eebff5f9db5e03382f27a31100f4
diff --git a/landslide/themes/default/js/slides.js b/landslide/themes/default/js/slides.js index <HASH>..<HASH> 100644 --- a/landslide/themes/default/js/slides.js +++ b/landslide/themes/default/js/slides.js @@ -129,7 +129,7 @@ function main() { }; var showNotes = function() { - var notes = document.querySelectorAll('.notes'); + var notes = getSlideEl(currentSlideNo).getElementsByClassName('notes'); for (var i = 0, len = notes.length; i < len; i++) { notes[i].style.display = (notesOn) ? 'none':'block'; }
notes are now only displayed for the current slide
adamzap_landslide
train
js
7a70501f1ba892a30f0a16cc6d4ab26b336fd10e
diff --git a/law/__init__.py b/law/__init__.py index <HASH>..<HASH> 100644 --- a/law/__init__.py +++ b/law/__init__.py @@ -13,7 +13,7 @@ __credits__ = ["Marcel Rieger"] __contact__ = "https://github.com/riga/law" __license__ = "MIT" __status__ = "Development" -__version__ = "0.0.12" +__version__ = "0.0.13" __all__ = [ "Task", "WrapperTask", "SandboxTask", diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -40,10 +40,13 @@ class install(_install): def run(self): _install.run(self) - with open(os.path.join(this_dir, "law", "cli", "law")) as f: - content = f.read() - with open(law.util.which("law"), "w") as f: - f.write(content) + try: + with open(os.path.join(this_dir, "law", "cli", "law")) as f: + content = f.read() + with open(law.util.which("law"), "w") as f: + f.write(content) + except: + pass setup(
Fix setup, version <I>.
riga_law
train
py,py
fc92395fb67c9149d1ddf194499369ace5d4ef54
diff --git a/src/main/java/com/yammer/dropwizard/authenticator/LdapAuthenticator.java b/src/main/java/com/yammer/dropwizard/authenticator/LdapAuthenticator.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/yammer/dropwizard/authenticator/LdapAuthenticator.java +++ b/src/main/java/com/yammer/dropwizard/authenticator/LdapAuthenticator.java @@ -40,7 +40,7 @@ public class LdapAuthenticator { final String sanitizedUsername = sanitizeUsername(basicCredentials.getUsername()); final Hashtable<String, String> env = contextConfiguration(); env.put(Context.SECURITY_PRINCIPAL, String.format(configuration.getSecurityPrincipal(), sanitizedUsername)); - env.put(Context.SECURITY_CREDENTIALS, sanitizedUsername); + env.put(Context.SECURITY_CREDENTIALS, basicCredentials.getPassword()); try { new InitialDirContext(env).close();
should be giving the user's password.
yammer_dropwizard-auth-ldap
train
java
9f58036269e839f9dff3458324714aeb3d190ada
diff --git a/app/code/community/Aoe/Scheduler/Helper/Data.php b/app/code/community/Aoe/Scheduler/Helper/Data.php index <HASH>..<HASH> 100755 --- a/app/code/community/Aoe/Scheduler/Helper/Data.php +++ b/app/code/community/Aoe/Scheduler/Helper/Data.php @@ -198,7 +198,7 @@ class Aoe_Scheduler_Helper_Data extends Mage_Core_Helper_Abstract $cache[$key] = true; $jobFactory = Mage::getModel('aoe_scheduler/job_factory'); /* @var $jobFactory Aoe_Scheduler_Model_Job_Factory */ $job = $jobFactory->loadByCode($jobCode); /* @var $job Aoe_Scheduler_Model_Job_Abstract */ - $groups = $this->trimExplode(',', $job->getGroups()); + $groups = $this->trimExplode(',', $job->getGroups(), true); if (count($include) > 0) { $cache[$key] = (count(array_intersect($groups, $include)) > 0); }
Trim the groups array to remove an empty group
AOEpeople_Aoe_Scheduler
train
php
73f7ea226c89c8505c78cb808954a85f3234f29d
diff --git a/installation-bundle/src/InstallTool.php b/installation-bundle/src/InstallTool.php index <HASH>..<HASH> 100644 --- a/installation-bundle/src/InstallTool.php +++ b/installation-bundle/src/InstallTool.php @@ -374,7 +374,7 @@ class InstallTool } /** - * Logs an exception in the error.log file. + * Logs an exception in the prod.log file. * * @param \Exception $e The exception */ @@ -389,7 +389,7 @@ class InstallTool $e->getTraceAsString() ), 3, - $this->rootDir . '/logs/error.log' + $this->rootDir . '/logs/prod.log' ); } }
[Installation] Log into the app/logs/prod.log file.
contao_contao
train
php
a422f8074811e76f89e18051b4d52feb9671fabd
diff --git a/src/sendErrorToSlack.js b/src/sendErrorToSlack.js index <HASH>..<HASH> 100644 --- a/src/sendErrorToSlack.js +++ b/src/sendErrorToSlack.js @@ -2,7 +2,8 @@ import Slack from 'slack-node' import { extend, isEmpty } from 'lodash' function getRemoteAddress (req) { - return req.ip || + return req.headers['x-forwarded-for'] || + req.ip || req._remoteAddress || (req.connection && req.connection.remoteAddress) || undefined
feat: add req.headers['x-forwarded-for'] support
chunkai1312_express-error-slack
train
js
4a0ecdfc21b709c1f5c612bda3eb4916aa18191e
diff --git a/src/assets/js/main.js b/src/assets/js/main.js index <HASH>..<HASH> 100644 --- a/src/assets/js/main.js +++ b/src/assets/js/main.js @@ -56,8 +56,20 @@ class JSR { values: [50, 120], }); } + + addEventListener (event, callback) { + const eventNames = { + 'update': 'core/value:update' + }; + + this.modules.eventizer.register(eventNames[event], callback); + } } -new JSR('#range-1', { +const jsr = new JSR('#range-1', { log: 'info' +}); + +jsr.addEventListener('update', (slider, value) => { + console.log(value); }); \ No newline at end of file
Create public API for registering events (+ test)
soanvig_jsr
train
js
58744a7fe0bfcc8681aebb291db15feb6fb736c2
diff --git a/datatableview/utils.py b/datatableview/utils.py index <HASH>..<HASH> 100644 --- a/datatableview/utils.py +++ b/datatableview/utils.py @@ -48,6 +48,16 @@ class DatatableStructure(StrAndUnicode): 'url': self.url, 'column_info': self.get_column_info(), }) + def __iter__(self): + """ + Yields the column information suitable for rendering HTML. + + Each time is returned as a 2-tuple in the form ("Column Name", "data-attribute='asdf'"), + + """ + + for column_info in self.get_column_info(): + yield column_info def get_column_info(self): """
Added iterator access to DatatableStructure Makes the job of custom table rendering in the template easier. Iterator yields back the (name, html_attributes) pairs.
pivotal-energy-solutions_django-datatable-view
train
py
cdf7c1f4dc23523cd03244392291cb76c2dc4037
diff --git a/bika/lims/jsonapi/read.py b/bika/lims/jsonapi/read.py index <HASH>..<HASH> 100644 --- a/bika/lims/jsonapi/read.py +++ b/bika/lims/jsonapi/read.py @@ -14,6 +14,7 @@ def ar_analysis_values(obj): workflow = getToolByName(obj, 'portal_workflow') analyses = obj.getAnalyses(cancellation_state='active') for proxy in analyses: + analysis = proxy.getObject() if proxy.review_state == 'retracted': continue # things that are manually inserted into the analysis. @@ -22,7 +23,7 @@ def ar_analysis_values(obj): ret.append({ "Uncertainty": analysis.getService().getUncertainty(), "Method": method.Title() if method else '', - "specification": analysis.specification, + "specification": analysis.specification if hasattr(analysis, "specification") else {}, }) # Place all proxy attributes into the result. for index in proxy.indexes(): @@ -35,7 +36,6 @@ def ar_analysis_values(obj): continue ret[-1][index] = val # Then schema field values - analysis = proxy.getObject() schema = analysis.Schema() for field in schema.fields(): accessor = field.getAccessor(analysis)
Handle old database records in transition to new arspecs
senaite_senaite.core
train
py
990637d2578f89c8a407cda0c40d9600eb32f219
diff --git a/succss.js b/succss.js index <HASH>..<HASH> 100644 --- a/succss.js +++ b/succss.js @@ -195,6 +195,15 @@ function Succss() { } }); + casperInstance.on('run.complete', function(data) { + if (SuccssCount.failures) { + casper.test.error('Tests failed with ' + SuccssCount.failures + ' errors.'); + } + else { + self.echo('[SUCCSS] All captures (' + SuccssCount.planned + ') tests pass!', 'GREEN_BAR'); + } + }); + self.add = function() { var command = function(capture) { @@ -249,12 +258,6 @@ function Succss() { if (!options.checkDir && !SuccssCount.remaining) { fs.removeTree(checkDir); } - if (SuccssCount.failures) { - casper.test.error('Tests failed with ' + SuccssCount.failures + ' errors.'); - } - else { - self.echo('[SUCCSS] All captures (' + SuccssCount.planned + ') tests pass!', 'GREEN_BAR'); - } } } }
Using the run.complete event to print the final message
B2F_Succss
train
js
acd59e14905588adf276814119a3f36fcf61922e
diff --git a/src/main/java/com/hubspot/jinjava/util/EagerExpressionResolver.java b/src/main/java/com/hubspot/jinjava/util/EagerExpressionResolver.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/hubspot/jinjava/util/EagerExpressionResolver.java +++ b/src/main/java/com/hubspot/jinjava/util/EagerExpressionResolver.java @@ -223,12 +223,7 @@ public class EagerExpressionResolver { if (depth > maxDepth) { return false; } - boolean isResolvable = - val == null || - RESOLVABLE_CLASSES - .stream() - .anyMatch(clazz -> clazz.isAssignableFrom(val.getClass())); - if (isResolvable) { + if (val == null) { return true; } if (val instanceof Collection || val instanceof Map) { @@ -254,7 +249,9 @@ public class EagerExpressionResolver { return (Arrays.stream((Object[]) val)).filter(Objects::nonNull) .allMatch(item -> isResolvableObjectRec(item, depth + 1, maxDepth, maxSize)); } - return false; + return RESOLVABLE_CLASSES + .stream() + .anyMatch(clazz -> clazz.isAssignableFrom(val.getClass())); } public static class EagerExpressionResult {
Check if object is a Map or Collection before checking if it's PyishSerializable
HubSpot_jinjava
train
java
a83894b8b34fd1da0bf3e86ad8da8512cc8058f7
diff --git a/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/rocksdb/RocksDBCache.java b/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/rocksdb/RocksDBCache.java index <HASH>..<HASH> 100644 --- a/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/rocksdb/RocksDBCache.java +++ b/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/rocksdb/RocksDBCache.java @@ -274,7 +274,6 @@ class RocksDBCache implements Cache { .setMaxBackgroundFlushes(INTERNAL_ROCKSDB_PARALLELISM / 2) .setMaxBackgroundJobs(INTERNAL_ROCKSDB_PARALLELISM) .setCompactionStyle(CompactionStyle.LEVEL) - .optimizeLevelStyleCompaction() .setMaxBackgroundCompactions(INTERNAL_ROCKSDB_PARALLELISM) .setLevelCompactionDynamicLevelBytes(true);
Issue <I>: Remove RocksDB option that induces link conflicts in Windows. (#<I>) Removed RocksDB option that induces link conflicts in Windows.
pravega_pravega
train
java
8808437a8223b93cbd47d53d96e082b70bd143b7
diff --git a/lib/Device.js b/lib/Device.js index <HASH>..<HASH> 100644 --- a/lib/Device.js +++ b/lib/Device.js @@ -79,9 +79,23 @@ Device.prototype._privatePlayMedia = function (resource, seconds, callback) { var media if (typeof resource === 'string') { - media = { - contentId: resource, - contentType: 'video/mp4' + if (media.includes('.mp4')) { + media = { + contentId: resource, + contentType: 'video/mp4' + } + } + if (media.includes('jpg') || media.includes('jpeg')) { + media = { + contentId: resource, + contentType: 'image/jpeg' + } + } + if (media.includes('png')) { + media = { + contentId: resource, + contentType: 'image/png' + } } } else { media = {
Added jpeg, jpg, png support
alxhotel_chromecast-api
train
js
abe1728f1d1446b68f4f7a959564439ce8123259
diff --git a/pkg/docker/config/config.go b/pkg/docker/config/config.go index <HASH>..<HASH> 100644 --- a/pkg/docker/config/config.go +++ b/pkg/docker/config/config.go @@ -667,6 +667,7 @@ func findCredentialsInFile(key, registry, path string, legacyFormat bool) (types // This intentionally uses "registry", not "key"; we don't support namespaced // credentials in helpers. if ch, exists := auths.CredHelpers[registry]; exists { + logrus.Debugf("Looking up in credential helper %s based on credHelpers entry in %s", ch, path) return getAuthFromCredHelper(ch, registry) } @@ -703,6 +704,9 @@ func findCredentialsInFile(key, registry, path string, legacyFormat bool) (types } } + // Only log this if we found nothing; getCredentialsWithHomeDir logs the + // source of found data. + logrus.Debugf("No credentials matching %s found in %s", key, path) return types.DockerAuthConfig{}, nil }
Log every credential path we consult ... to make it easier for users to diagnose situations where no credentials are found.
containers_image
train
go
52b2964dba0792ca6f3815c6800d994aabbe14da
diff --git a/lib/decent_exposure/expose.rb b/lib/decent_exposure/expose.rb index <HASH>..<HASH> 100644 --- a/lib/decent_exposure/expose.rb +++ b/lib/decent_exposure/expose.rb @@ -37,6 +37,13 @@ module DecentExposure end def expose(name, options={:default_exposure => _default_exposure}, &block) + if ActionController::Base.instance_methods.include?(name.to_sym) + Kernel.warn "[WARNING] You are exposing the `#{name}` method, " \ + "which overrides an existing ActionController method of the same name. " \ + "Consider a different exposure name\n" \ + "#{caller.first}" + end + config = options[:config] || :default options = _decent_configurations[config].merge(options) diff --git a/spec/fixtures/controllers.rb b/spec/fixtures/controllers.rb index <HASH>..<HASH> 100644 --- a/spec/fixtures/controllers.rb +++ b/spec/fixtures/controllers.rb @@ -73,6 +73,8 @@ class BirdController < ActionController::Base expose(:albatrosses) expose(:parrot) + expose(:logger) { "" } + expose(:custom, :strategy => CustomStrategy) expose(:albert, :model => :parrot)
Warn when overriding an existing method This closes #<I>
hashrocket_decent_exposure
train
rb,rb
5ac85b203e45f044846e4abfc9dc5e4f16a27478
diff --git a/presto-main/src/main/java/com/facebook/presto/server/HttpRemoteTask.java b/presto-main/src/main/java/com/facebook/presto/server/HttpRemoteTask.java index <HASH>..<HASH> 100644 --- a/presto-main/src/main/java/com/facebook/presto/server/HttpRemoteTask.java +++ b/presto-main/src/main/java/com/facebook/presto/server/HttpRemoteTask.java @@ -98,13 +98,15 @@ public class HttpRemoteTask } })); + ExecutionStats stats = new ExecutionStats(); + stats.addSplits(splits.size()); taskInfo.set(new TaskInfo(queryId, stageId, taskId, TaskState.PLANNED, location, bufferStates, - new ExecutionStats(), + stats, ImmutableList.<FailureInfo>of())); }
Record number of split for a task even before it is scheduled
prestodb_presto
train
java
6a885fbf5ed8e51eabda737a17a02a34449edc60
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -91,8 +91,12 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -#html_theme = 'default' -html_theme = 'nature' +import os +on_rtd = os.environ.get('READTHEDOCS', None) == 'True' +if on_rtd: + html_theme = 'default' +else: + html_theme = 'nature' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the
Changed default theme for Read the Docs
pokerregion_poker
train
py
46f07d71a7b7fa887459f1df054c41b5a8dfe480
diff --git a/lib/sbsm/admin_server.rb b/lib/sbsm/admin_server.rb index <HASH>..<HASH> 100644 --- a/lib/sbsm/admin_server.rb +++ b/lib/sbsm/admin_server.rb @@ -37,8 +37,8 @@ require 'sbsm/session_store' module SBSM # AdminClass must be tied to an Rack app class AdminServer - def initialize(app:) - @session = SBSM::SessionStore.new(app: app) + def initialize(app:, multi_threaded: false) + @session = SBSM::SessionStore.new(app: app, multi_threaded: multi_threaded) @admin_threads = ThreadGroup.new end def _admin(src, result, priority=0)
Admin server is now multi_threaded by default
zdavatz_sbsm
train
rb
ee8c30c3ae8af168acb9243c70e2ab8416515a72
diff --git a/lib/renderer.js b/lib/renderer.js index <HASH>..<HASH> 100644 --- a/lib/renderer.js +++ b/lib/renderer.js @@ -166,6 +166,8 @@ if (config.hasOwnProperty("svgomg-enabled")) { this._useSVGOMG = !!config["svgomg-enabled"]; + } else { + this._useSVGOMG = true; } }
Enable svgOMG by default
adobe-photoshop_generator-assets
train
js
2e65f6dc235bcff27ba05e2b9c8daa99e20f4b49
diff --git a/migrations/m160511_085953_init.php b/migrations/m160511_085953_init.php index <HASH>..<HASH> 100644 --- a/migrations/m160511_085953_init.php +++ b/migrations/m160511_085953_init.php @@ -1,8 +1,10 @@ <?php use yii\db\Migration; -use yii\db\Schema; +/** + * Class m160511_085953_init + */ class m160511_085953_init extends Migration { public function up()
remove use the Schema class from migration
yii2mod_yii2-cashier
train
php
799ec6e5ce2ca7b1485efcd951bcd43804d46510
diff --git a/app/models/qdm/basetypes/data_element.rb b/app/models/qdm/basetypes/data_element.rb index <HASH>..<HASH> 100644 --- a/app/models/qdm/basetypes/data_element.rb +++ b/app/models/qdm/basetypes/data_element.rb @@ -51,8 +51,6 @@ module QDM # Get the object as it was stored in the database, and instantiate # this custom class from it. # - # The array elements in demongoize are the same 5 elements used in mongoize, i.e. - # [ low, high ]. def demongoize(object) return nil unless object object = object.symbolize_keys
Remove a comment that was no longer accurate
projecttacoma_cqm-models
train
rb
c9a54ac40490e770a55e5b8ca2932a2ba55d8008
diff --git a/gems/cache/lib/datamapper/model.rb b/gems/cache/lib/datamapper/model.rb index <HASH>..<HASH> 100644 --- a/gems/cache/lib/datamapper/model.rb +++ b/gems/cache/lib/datamapper/model.rb @@ -70,6 +70,7 @@ module Infinispan end def auto_migrate! + destroy configure_index end diff --git a/gems/cache/spec/dm-infinispan-adapter_spec.rb b/gems/cache/spec/dm-infinispan-adapter_spec.rb index <HASH>..<HASH> 100644 --- a/gems/cache/spec/dm-infinispan-adapter_spec.rb +++ b/gems/cache/spec/dm-infinispan-adapter_spec.rb @@ -33,6 +33,7 @@ describe DataMapper::Adapters::InfinispanAdapter do end DataMapper.finalize + Heffalump.auto_migrate! end after :all do @@ -58,8 +59,6 @@ describe DataMapper::Adapters::InfinispanAdapter do describe '#read' do before :all do @heffalump = Heffalump.create(:color => 'brownish hue') - #just going to borrow this, so I can check the return values - @query = Heffalump.all.query end it 'should not raise any errors' do
Remove some debug. Add call to destroy in auto_migrate
torquebox_torquebox
train
rb,rb
69ed61dd039d57927e2302ec3f0bb219099db361
diff --git a/Buffer.js b/Buffer.js index <HASH>..<HASH> 100644 --- a/Buffer.js +++ b/Buffer.js @@ -162,7 +162,7 @@ Buffer.prototype.bufferData = function(sizeOrData){ } if(this._preserveData){ - if(this._data.length = sizeOrData.length){ + if(this._data !== null && this._data.length == sizeOrData.length){ this._data.set(sizeOrData); } else { @@ -186,7 +186,15 @@ Buffer.prototype.bufferData = function(sizeOrData){ * @param {Uint8Array|Uint16Array|Uint32Array|Float32Array} data - The new data that will be copied into the data store */ Buffer.prototype.bufferSubData = function(offset,data){ - this._ctx.getGL().bufferSubData(this._target,offset,data); + var gl = this._ctx.getGL(); + gl.bufferSubData(this._target,offset,data); + + if(this._preserveData && data != this._data){ + offset = offset / this._data.BYTES_PER_ELEMENT; + for(var i = 0, l = this._data.length; offset < l; ++i, offset+=1){ + this._data[offset] = data[i]; + } + } }; /**
Buffer bufferSubData added data copy to preserved data
pex-gl_pex-context
train
js
31cd525a52f5973d476f5d93c55c6dd2e99c8f28
diff --git a/core/src/main/java/hudson/model/Actionable.java b/core/src/main/java/hudson/model/Actionable.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/model/Actionable.java +++ b/core/src/main/java/hudson/model/Actionable.java @@ -38,13 +38,9 @@ public abstract class Actionable extends AbstractModelObject { } public <T extends Action> T getAction(Class<T> type) { - for (Action a : getActions()) { - if (type.isInstance(a)) { - @SuppressWarnings("unchecked") // type.cast() not available in JDK 1.4; XXX doesn't retro* emulate it? - T _a = (T) a; - return _a; - } - } + for (Action a : getActions()) + if (type.isInstance(a)) + return type.cast(a); return null; }
retroweaver didn't support Class.cast() but retrotranslator does. git-svn-id: <URL>
jenkinsci_jenkins
train
java
1f82664e65aaae0d2e81cc03ee4f2d873a541209
diff --git a/lib/httparty.rb b/lib/httparty.rb index <HASH>..<HASH> 100644 --- a/lib/httparty.rb +++ b/lib/httparty.rb @@ -5,7 +5,7 @@ require 'uri' require 'zlib' require 'crack' -dir = Pathname(__FILE__).dirname.expand_path +dir = Pathname(__FILE__).dirname.expand_path.to_s require dir + 'httparty/module_inheritable_attributes' require dir + 'httparty/cookie_hash'
Fixes problem with latest RubyGems - can't convert Pathname to String
jnunemaker_httparty
train
rb
3f3f71e910f6e54760aba3c0a644dcc5db450ae1
diff --git a/seaglass/trunk/seaglass/src/main/java/com/seaglass/component/SeaGlassBorder.java b/seaglass/trunk/seaglass/src/main/java/com/seaglass/component/SeaGlassBorder.java index <HASH>..<HASH> 100644 --- a/seaglass/trunk/seaglass/src/main/java/com/seaglass/component/SeaGlassBorder.java +++ b/seaglass/trunk/seaglass/src/main/java/com/seaglass/component/SeaGlassBorder.java @@ -64,7 +64,7 @@ public class SeaGlassBorder extends AbstractBorder implements UIResource { SeaGlassContext context = (SeaGlassContext) ui.getContext(jc); SeaGlassStyle style = (SeaGlassStyle) context.getStyle(); if (style == null) { - assert false : "SeaGlassBorder is being used outside after the UI " + "has been uninstalled"; + assert false : "SeaGlassBorder is being used outside after the UI has been uninstalled"; return; } ui.paintBorder(context, g, x, y, width, height);
Simplified a wrapped string.
khuxtable_seaglass
train
java
11ab8beb5f13a3aa21c7fcee45bfcbf173f1947f
diff --git a/LiSE/character.py b/LiSE/character.py index <HASH>..<HASH> 100644 --- a/LiSE/character.py +++ b/LiSE/character.py @@ -1558,6 +1558,22 @@ class CharStatCache(MutableMapping): dekeycache(self, self._keycache, k) +class TravelReqList(FunList): + def __init__(self, character): + self.character = character + super().__init__(character.engine, character.engine.db) + + @property + def funcstore(self): + return self.engine.function + + def _loadlist(self): + return self.db.travel_reqs(self.character.name) + + def _savelist(self, l): + self.db.set_travel_reqs(self.character.name, l) + + class Character(DiGraph, RuleFollower): """A graph that follows game rules and has a containment hierarchy. @@ -1609,14 +1625,7 @@ class Character(DiGraph, RuleFollower): self.pred = self.preportal self.avatar = CharacterAvatarGraphMapping(self) self.sense = CharacterSenseMapping(self) - self.travel_reqs = FunList( - self.engine, - self.engine.prereq, - 'travel_reqs', - ['character'], - [name], - 'reqs' - ) + self.travel_reqs = TravelReqList(self) self.stat = CharStatCache(self) if engine.caching: self._avatar_cache = ac = {}
TravelReqList subclass of FunList
LogicalDash_LiSE
train
py
fb774c5ad47704df3470159d34f339805b1ca5ac
diff --git a/setup-bundler.js b/setup-bundler.js index <HASH>..<HASH> 100644 --- a/setup-bundler.js +++ b/setup-bundler.js @@ -17,7 +17,7 @@ function setupBundler(cwd, entryPoints, flags, ready) { return resolve('browserify', {basedir: process.cwd()}, onlocalbrowserify) } - setupWatchify(localDir, entryPoints, flags, ready) + setupWatchify(path.dirname(localDir), entryPoints, flags, ready) } function onlocalbrowserify(err, localDir) { @@ -25,7 +25,7 @@ function setupBundler(cwd, entryPoints, flags, ready) { return findGlobals(onglobals) } - setupBrowserify(localDir, entryPoints, flags, ready) + setupBrowserify(path.dirname(localDir), entryPoints, flags, ready) } function onglobals(err, dirs) {
the various setups take directories only
chrisdickinson_beefy
train
js
ee0fdcc95b1c01488213ea349d04f88d6d4b8754
diff --git a/cdm/src/test/java/ucar/nc2/TestAll.java b/cdm/src/test/java/ucar/nc2/TestAll.java index <HASH>..<HASH> 100644 --- a/cdm/src/test/java/ucar/nc2/TestAll.java +++ b/cdm/src/test/java/ucar/nc2/TestAll.java @@ -71,6 +71,18 @@ public class TestAll { public static String temporaryDataDir = "./target/test/tmp/"; + // Make sure the temp data dir is created. + static { + File tmpDataDir = new File( temporaryDataDir); + if ( ! tmpDataDir.exists() ) + { + if ( ! tmpDataDir.mkdirs() ) + { + System.out.println( "**Could not create temporary data dir <" + tmpDataDir.getAbsolutePath() + ">." ); + } + } + } + public static junit.framework.Test suite ( ) { RandomAccessFile.setDebugLeaks( true);
Add existence check and possible creation of temporary data directory.
Unidata_thredds
train
java
a45d179f220414bdbc71ce26bf82f946339b3c5e
diff --git a/source/rafcon/core/execution/execution_engine.py b/source/rafcon/core/execution/execution_engine.py index <HASH>..<HASH> 100644 --- a/source/rafcon/core/execution/execution_engine.py +++ b/source/rafcon/core/execution/execution_engine.py @@ -224,6 +224,7 @@ class ExecutionEngine(Observable): self.state_machine_running = True self.__running_state_machine.join() self.__set_execution_mode_to_finished() + self.state_machine_manager.active_state_machine_id = None plugins.run_on_state_machine_execution_finished() # self.__set_execution_mode_to_stopped() self.state_machine_running = False
fix(execution engine): set active_sm_id to None after execution
DLR-RM_RAFCON
train
py
e890dc8884006ba3b12e9abd43a82c792cd4f0b1
diff --git a/Classes/Hooks/TceMain/ClearCacheHook.php b/Classes/Hooks/TceMain/ClearCacheHook.php index <HASH>..<HASH> 100644 --- a/Classes/Hooks/TceMain/ClearCacheHook.php +++ b/Classes/Hooks/TceMain/ClearCacheHook.php @@ -45,7 +45,7 @@ class ClearCacheHook switch ($params['cacheCmd']) { case 'all': GeneralUtility::rmdir( - PATH_site . 'typo3temp/bootstrappackage', + PATH_site . 'typo3temp/assets/bootstrappackage', true ); break;
[BUGFIX] Correct hook to clear less caches
benjaminkott_bootstrap_package
train
php
da1357c6632edfbbc257953f119b79129299a2a5
diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index <HASH>..<HASH> 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -18,6 +18,7 @@ use Composer\Json\JsonFile; use Composer\Package\BasePackage; use Composer\Package\CompletePackageInterface; use Composer\Package\Link; +use Composer\Package\AliasPackage; use Composer\Package\PackageInterface; use Composer\Package\Version\VersionParser; use Composer\Package\Version\VersionSelector; @@ -365,6 +366,9 @@ EOT || !is_object($packages[$type][$package->getName()]) || version_compare($packages[$type][$package->getName()]->getVersion(), $package->getVersion(), '<') ) { + while ($package instanceof AliasPackage) { + $package = $package->getAliasOf(); + } if (!$packageFilterRegex || preg_match($packageFilterRegex, $package->getName())) { if (!$packageListFilter || in_array($package->getName(), $packageListFilter, true)) { $packages[$type][$package->getName()] = $package;
Avoid showing alias versions in show command, show the original version
composer_composer
train
php
8f680f496a72de6657b6808fa91792258f67a26a
diff --git a/yoke/templates.py b/yoke/templates.py index <HASH>..<HASH> 100644 --- a/yoke/templates.py +++ b/yoke/templates.py @@ -38,7 +38,7 @@ RESPONSE_CODES = [ 505, ] DEFAULT_RESPONSES = { - '^{rc}'.format(rc=resp_code): { + '^{rc}:.*'.format(rc=resp_code): { 'responseTemplates': { 'application/json': ( APPLICATION_JSON_RESPONSE_FMT % dict(rc=resp_code)
Fix regex matching issue with response templates
rackerlabs_yoke
train
py
f9dcb845abd99a74a32618926cfacd06435cc899
diff --git a/lxd/images.go b/lxd/images.go index <HASH>..<HASH> 100644 --- a/lxd/images.go +++ b/lxd/images.go @@ -938,6 +938,14 @@ func autoUpdateImage(d *Daemon, op *operation, id int, info *api.Image) error { continue } + if info.Cached { + err = db.ImageLastAccessInit(d.db, hash) + if err != nil { + logger.Error("Error moving aliases", log.Ctx{"err": err, "fp": hash}) + continue + } + } + err = db.ImageLastAccessUpdate(d.db, hash, info.LastUsedAt) if err != nil { logger.Error("Error setting last use date", log.Ctx{"err": err, "fp": hash})
lxd/images: Carry old "cached" value on refresh Closes #<I>
lxc_lxd
train
go
174974caf29d08c656578906c970a8522a3e176e
diff --git a/go/vt/sqlparser/parse_test.go b/go/vt/sqlparser/parse_test.go index <HASH>..<HASH> 100644 --- a/go/vt/sqlparser/parse_test.go +++ b/go/vt/sqlparser/parse_test.go @@ -49,7 +49,7 @@ var ( output: "create table x (\n\te enum('red', 'yellow') collate 'utf8_bin' null\n)", }, { input: "create table 3t2 (c1 bigint not null, c2 text, primary key(c1))", - output: "create table 3t2 (\n\tc1 bigint not null,\n\tc2 text,\n\tprimary key (c1)\n)", + output: "create table `3t2` (\n\tc1 bigint not null,\n\tc2 text,\n\tprimary key (c1)\n)", }, { input: "select 1 from t1 where exists (select 1) = TRUE", output: "select 1 from t1 where exists (select 1 from dual) = true", @@ -3496,9 +3496,6 @@ var ( input: "select : from t", output: "syntax error at position 9 near ':'", }, { - input: "select 0xH from t", - output: "syntax error at position 10 near '0x'", - }, { input: "select x'78 from t", output: "syntax error at position 12 near '78'", }, {
test: fix test expectations and remove an incorrect test
vitessio_vitess
train
go
a99de094219d83183c307f97235f93e0b4a1654a
diff --git a/kernel/classes/workflowtypes/event/ezmultiplexer/ezmultiplexertype.php b/kernel/classes/workflowtypes/event/ezmultiplexer/ezmultiplexertype.php index <HASH>..<HASH> 100644 --- a/kernel/classes/workflowtypes/event/ezmultiplexer/ezmultiplexertype.php +++ b/kernel/classes/workflowtypes/event/ezmultiplexer/ezmultiplexertype.php @@ -318,7 +318,12 @@ class eZMultiplexerType extends eZWorkflowEventType $childProcess->removeThis(); return eZWorkflowType::STATUS_ACCEPTED; } - else if ( $childStatus == eZWorkflow::STATUS_CANCELLED || $childStatus == eZWorkflow::STATUS_FAILED ) + else if ( $childStatus == eZWorkflow::STATUS_CANCELLED ) + { + $childProcess->removeThis(); + return eZWorkflowType::STATUS_WORKFLOW_CANCELLED; + } + else if ( $childStatus == eZWorkflow::STATUS_FAILED ) { $childProcess->removeThis(); return eZWorkflowType::STATUS_REJECTED;
Fixed #<I>: workflow cancelled when reediting the draft of a previously rejected content
ezsystems_ezpublish-legacy
train
php
0e1978e9589b06cd7bb658d8cbf1fd0639bcaa63
diff --git a/lib/features/modeling/cmd/AppendShapeHandler.js b/lib/features/modeling/cmd/AppendShapeHandler.js index <HASH>..<HASH> 100644 --- a/lib/features/modeling/cmd/AppendShapeHandler.js +++ b/lib/features/modeling/cmd/AppendShapeHandler.js @@ -26,7 +26,7 @@ AppendShapeHandler.prototype.execute = function(context) { var parent = context.parent || source.parent; var position = context.position || { - x: source.x + source.width + 200, + x: source.x + source.width + 100, y: source.y + source.height / 2 };
chore(features/modeling): adjust default append distance
bpmn-io_diagram-js
train
js
2cf147cc4b87e197b3b645505574f8147d38a597
diff --git a/flask_sslify.py b/flask_sslify.py index <HASH>..<HASH> 100644 --- a/flask_sslify.py +++ b/flask_sslify.py @@ -14,7 +14,7 @@ class SSLify(object): self.permanent = permanent if app is not None: - self.init_app(self.app) + self.init_app(app) def init_app(self, app): """Configures the configured Flask app to enforce SSL."""
Fix breaking error in init, probably a bad merge
kennethreitz_flask-sslify
train
py
55e4ec9fee220cdaf07dc9824e2f5ec24be8a3c5
diff --git a/src/setup.py b/src/setup.py index <HASH>..<HASH> 100644 --- a/src/setup.py +++ b/src/setup.py @@ -22,10 +22,10 @@ setup( description='Moment Expansion Approximation method implementation with simulation and inference packages', long_description=open('README.txt').read(), install_requires=[ - "numpy>=1.8.0", - "sympy>=0.7.2", - "matplotlib>=1.1.1", - "scipy>=0.13.2", + "numpy>=1.6.1", + "sympy>=0.7.1", + "matplotlib>=1.1.0", + "scipy>=0.10.0", "Assimulo==trunk" ], ) \ No newline at end of file
lowered the requirements to mimick EPD
theosysbio_means
train
py
58726fc1f0f243778d912479717ffa0a6f9265f3
diff --git a/lib/winrm/wsmv/command_output_processor.rb b/lib/winrm/wsmv/command_output_processor.rb index <HASH>..<HASH> 100644 --- a/lib/winrm/wsmv/command_output_processor.rb +++ b/lib/winrm/wsmv/command_output_processor.rb @@ -52,7 +52,7 @@ module WinRM out_message = command_output_message(shell_id, command_id) until command_done?(resp_doc) logger.debug("[WinRM] Waiting for output for command id: #{command_id}") - resp_doc = send_get_output_message(out_message) + resp_doc = send_get_output_message(out_message.build) logger.debug("[WinRM] Processing output for command id: #{command_id}") read_streams(resp_doc) do |stream| handled_out = handle_stream(stream, output) @@ -79,7 +79,7 @@ module WinRM shell_id: shell_id, command_id: command_id }.merge(@out_opts) - WinRM::WSMV::CommandOutput.new(@connection_opts, cmd_out_opts).build + WinRM::WSMV::CommandOutput.new(@connection_opts, cmd_out_opts) end def send_get_output_message(message)
need to rebuild response output message or else we will get the same message on every call
WinRb_WinRM
train
rb
0f97ce042635ba7829fbd1071bde4f0bcc55c978
diff --git a/src/main/java/nonapi/io/github/classgraph/fastzipfilereader/LogicalZipFile.java b/src/main/java/nonapi/io/github/classgraph/fastzipfilereader/LogicalZipFile.java index <HASH>..<HASH> 100644 --- a/src/main/java/nonapi/io/github/classgraph/fastzipfilereader/LogicalZipFile.java +++ b/src/main/java/nonapi/io/github/classgraph/fastzipfilereader/LogicalZipFile.java @@ -169,7 +169,7 @@ public class LogicalZipFile extends ZipFileSlice implements AutoCloseable { buf.write(b); isLineEnd = false; } - if (isLineEnd && curr < len && b != (byte) ' ') { + if (isLineEnd && curr < len && manifest[curr] != (byte) ' ') { // Value ends if line break is not followed by a space break; }
Fix manifest value parsing again (
classgraph_classgraph
train
java
511ad186ce7b2c25ee6dc09973063c7d6649eeed
diff --git a/src/Mailgun/Model/Message/ShowResponse.php b/src/Mailgun/Model/Message/ShowResponse.php index <HASH>..<HASH> 100644 --- a/src/Mailgun/Model/Message/ShowResponse.php +++ b/src/Mailgun/Model/Message/ShowResponse.php @@ -150,6 +150,12 @@ class ShowResponse implements ApiResponse if (isset($data['body-mime'])) { $response->setBodyMime($data['body-mime']); } + if (isset($data['attachments'])) { + $response->setAttachments($data['attachments']); + } + if (isset($data['content-id-map'])) { + $response->setContentIdMap($data['content-id-map']); + } return $response; } @@ -339,6 +345,14 @@ class ShowResponse implements ApiResponse } /** + * @param array $attachments + */ + private function setAttachments($attachments) + { + $this->attachments = $attachments; + } + + /** * @return string */ public function getMessageUrl() @@ -363,6 +377,14 @@ class ShowResponse implements ApiResponse } /** + * @param string $contentIdMap + */ + public function setContentIdMap($contentIdMap) + { + $this->contentIdMap = $contentIdMap; + } + + /** * @return array */ public function getMessageHeaders()
Adding attachments and content id map (#<I>)
mailgun_mailgun-php
train
php
4ef8abc634f156c087c6417bcd5498e81834e207
diff --git a/icekit_events/models.py b/icekit_events/models.py index <HASH>..<HASH> 100644 --- a/icekit_events/models.py +++ b/icekit_events/models.py @@ -466,6 +466,11 @@ class EventBase(PolymorphicModel, AbstractBaseModel, ICEkitContentsMixin, pass try: + del self.own_occurrences + except AttributeError: + pass + + try: del self.upcoming_occurrence_list except AttributeError: pass
Also invalidate new own_occurrences cached value
ic-labs_django-icekit
train
py
844cdeeb5c86c265ec50c17de74c68dd436edbf2
diff --git a/test/common/scenario_common.py b/test/common/scenario_common.py index <HASH>..<HASH> 100644 --- a/test/common/scenario_common.py +++ b/test/common/scenario_common.py @@ -53,4 +53,4 @@ def get_workload_ports(parsed_opts, namespace, processes): http_port = process.http_port, rdb_port = 28015 + process.port_offset, table_name = namespace.name, - db_name = "test_database") + db_name = "test")
fixing python test broken in the process of fixing javascript tests
rethinkdb_rethinkdb
train
py
3d5c982c6f2f2469152048d110a25844d1069e5d
diff --git a/Classes/Hooks/DrawItem.php b/Classes/Hooks/DrawItem.php index <HASH>..<HASH> 100644 --- a/Classes/Hooks/DrawItem.php +++ b/Classes/Hooks/DrawItem.php @@ -156,7 +156,7 @@ class DrawItem implements PageLayoutViewDrawItemHookInterface, SingletonInterfac } } $gridType = $row['tx_gridelements_backend_layout'] ? ' data-gridtype="' . $row['tx_gridelements_backend_layout'] . '"' : ''; - $headerContent = '<div id="ce' . $row['uid'] . '" class="t3-ctype-identifier " data-ctype="' . $row['CType'] . '"' . $gridType . '>' . $headerContent . '</div>'; + $headerContent = '<div id="element-tt_content-' . $row['uid'] . '" class="t3-ctype-identifier " data-ctype="' . $row['CType'] . '"' . $gridType . '>' . $headerContent . '</div>'; } /**
[BUGFIX] Assign correct ID to children of grid containers Change-Id: I7dbf<I>e5f<I>d<I>ea<I>bef5e<I>dd<I>cdae Resolves: #<I> Releases: master, <I> Reviewed-on: <URL>
TYPO3-extensions_gridelements
train
php
660c3a392a9686d67c8ae22b7b4a13c93548350d
diff --git a/LiSE/LiSE/alchemy.py b/LiSE/LiSE/alchemy.py index <HASH>..<HASH> 100644 --- a/LiSE/LiSE/alchemy.py +++ b/LiSE/LiSE/alchemy.py @@ -190,8 +190,7 @@ def tables_for_meta(meta): 'branch', TEXT, primary_key=True, default='trunk' ), Column('tick', Integer, primary_key=True, default=0), - Column('function', TEXT), - Column('active', Boolean, default=True), + Column('function', TEXT, nullable=True), ForeignKeyConstraint(['character'], ['graphs.graph']) )
Remove 'active' column of senses Set the function to null instead.
LogicalDash_LiSE
train
py
62f12508b0213052e6fa642c14fd4b5f7e4c9ec7
diff --git a/lib/ui_bibz/ui/core/glyph.rb b/lib/ui_bibz/ui/core/glyph.rb index <HASH>..<HASH> 100644 --- a/lib/ui_bibz/ui/core/glyph.rb +++ b/lib/ui_bibz/ui/core/glyph.rb @@ -79,7 +79,16 @@ module UiBibz::Ui::Core end def size - @options[:size] + case @options[:size] + when :xs + 1 + when :md + 3 + when :lg + 5 + else + @options[:size] + end end def stack diff --git a/lib/ui_bibz/ui/core/stars.rb b/lib/ui_bibz/ui/core/stars.rb index <HASH>..<HASH> 100644 --- a/lib/ui_bibz/ui/core/stars.rb +++ b/lib/ui_bibz/ui/core/stars.rb @@ -71,7 +71,10 @@ module UiBibz::Ui::Core end def glyph_opts - { state: @options[:state] } unless @options[:state].nil? + opts = {} + opts = opts.merge({ state: @options[:state] }) unless @options[:state].nil? + opts = opts.merge({ size: @options[:size] }) unless @options[:size].nil? + opts end def star_name star
add size xs, md and lg
thooams_Ui-Bibz
train
rb,rb
8b05690361eeb6872596004411f6d85b5ab3539e
diff --git a/annis-service/src/main/java/annis/dao/QueryDaoImpl.java b/annis-service/src/main/java/annis/dao/QueryDaoImpl.java index <HASH>..<HASH> 100644 --- a/annis-service/src/main/java/annis/dao/QueryDaoImpl.java +++ b/annis-service/src/main/java/annis/dao/QueryDaoImpl.java @@ -445,10 +445,10 @@ public class QueryDaoImpl extends AbstractDao implements QueryDao { wk.reset(); } } catch (ClosedWatchServiceException ex) { - break; + return; } catch (InterruptedException | IOException ex) { log.error("Error when reading graphANNIS logfile", ex); - break; + return; } } }).start();
Make sure the thread call function returns on error
korpling_ANNIS
train
java
a49f6f2c299c47ea9f2e86718d7a84c3ad14887f
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 @@ -4,25 +4,25 @@ require 'vcr' Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require File.expand_path(f) } -VCR.config do |c| +VCR.configure do |c| c.cassette_library_dir = '.cassettes' c.stub_with :webmock end RSpec.configure do |config| config.include HarvestedHelpers - + config.before(:suite) do WebMock.allow_net_connect! cassette("clean") do HarvestedHelpers.clean_remote end end - + config.before(:each) do WebMock.allow_net_connect! end - + def cassette(*args) if ENV['CACHE'] == "false" if args.last.is_a?(Hash) @@ -33,7 +33,7 @@ RSpec.configure do |config| args << {:record => :all} end end - + VCR.use_cassette(*args) do yield end
Fixes deprecated VCR call
zmoazeni_harvested
train
rb
17c07bf9fb7369c4030a42feeba70c72ce38a9bb
diff --git a/tests/test_custom_extensions_in_hooks.py b/tests/test_custom_extensions_in_hooks.py index <HASH>..<HASH> 100644 --- a/tests/test_custom_extensions_in_hooks.py +++ b/tests/test_custom_extensions_in_hooks.py @@ -18,7 +18,7 @@ from cookiecutter import main ) def template(request): """Fixture. Allows to split pre and post hooks test directories.""" - return 'tests/test-extensions/' + request.param + return f"tests/test-extensions/{request.param}" @pytest.fixture(autouse=True)
Replace strings methods with f-string (tests)
audreyr_cookiecutter
train
py
6f9b92eedb5088a86c7bfdaaeb1e3753500ef6d5
diff --git a/tasks/application_generator.rb b/tasks/application_generator.rb index <HASH>..<HASH> 100644 --- a/tasks/application_generator.rb +++ b/tasks/application_generator.rb @@ -9,11 +9,6 @@ module ActiveAdmin end def generate - require 'rails/version' - - base_dir = rails_env == 'test' ? 'spec/rails' : '.test-rails-apps' - app_dir = "#{base_dir}/rails-#{Rails::VERSION::STRING}" - unless !parallel || parallel_tests_setup? puts "parallel_tests is not set up. (Re)building #{app_dir} App. Please wait." system("rm -Rf #{app_dir}") @@ -47,9 +42,19 @@ module ActiveAdmin private + def base_dir + @base_dir ||= rails_env == 'test' ? 'spec/rails' : '.test-rails-apps' + end + + def app_dir + @app_dir ||= begin + require 'rails/version' + "#{base_dir}/rails-#{Rails::VERSION::STRING}" + end + end + def parallel_tests_setup? - require 'rails/version' - database_config = File.join "spec", "rails", "rails-#{Rails::VERSION::STRING}", "config", "database.yml" + database_config = File.join app_dir, "config", "database.yml" File.exist?(database_config) && File.read(database_config).include?("TEST_ENV_NUMBER") end end
Move app_dir to a method And reuse it in another place.
activeadmin_activeadmin
train
rb
f711b2c3e8380988baa8e700836b2f3a77decbc2
diff --git a/lib/node_modules/@stdlib/namespace/aliases/lib/main.js b/lib/node_modules/@stdlib/namespace/aliases/lib/main.js index <HASH>..<HASH> 100644 --- a/lib/node_modules/@stdlib/namespace/aliases/lib/main.js +++ b/lib/node_modules/@stdlib/namespace/aliases/lib/main.js @@ -74,6 +74,7 @@ function aliases( namespace ) { var pkgs; var out; var i; + var p; if ( arguments.length === 0 ) { return ALIASES.slice(); } @@ -83,8 +84,9 @@ function aliases( namespace ) { pkgs = resolvePackages(); out = []; for ( i = 0; i < pkgs.length; i++ ) { - if ( startsWith( pkgs[i][0], namespace ) ) { - out.push( pkgs[i][1] ); + p = pkgs[ i ]; + if ( p[ 0 ] && startsWith( p[ 0 ], namespace ) ) { + out.push( p[1] ); } } return out;
Skip over aliases not having corresponding packages
stdlib-js_stdlib
train
js
04c154ad297200ceafbbbd02b0b8898624a8a20e
diff --git a/cookiemonster/common/decorators/__init__.py b/cookiemonster/common/decorators/__init__.py index <HASH>..<HASH> 100644 --- a/cookiemonster/common/decorators/__init__.py +++ b/cookiemonster/common/decorators/__init__.py @@ -1,3 +1 @@ -# GPLv3 or later -# Copyright (c) 2016 Genome Research Limited from cookiemonster.common.decorators.gotta_catchem_all import too_big_to_fail, MaxAttemptsExhausted diff --git a/cookiemonster/tests/common/decorators/__init__.py b/cookiemonster/tests/common/decorators/__init__.py index <HASH>..<HASH> 100644 --- a/cookiemonster/tests/common/decorators/__init__.py +++ b/cookiemonster/tests/common/decorators/__init__.py @@ -1,2 +0,0 @@ -# GPLv3 or later -# Copyright (c) 2016 Genome Research Limited
Removed copyright from `__init__.py`s with sed These aren't really worth marking as copyrightable Resolves #<I>
wtsi-hgi_python-common
train
py,py
7ec3649d0fbbc9be9a40f0746737251c801a9a56
diff --git a/lib/lumberg/whm/args.rb b/lib/lumberg/whm/args.rb index <HASH>..<HASH> 100644 --- a/lib/lumberg/whm/args.rb +++ b/lib/lumberg/whm/args.rb @@ -34,9 +34,13 @@ module Lumberg def booleans!(hash, *params) params.each do |param| if param.is_a?(Array) - raise WhmArgumentError.new("Boolean parameter must be \"1\" or \"0\": #{param.first}") unless hash[param.first].to_s.match(/(1|0)/) + if hash.include?(param.first) && !hash[param.first].to_s.match(/(1|0)/) + raise WhmArgumentError.new("Boolean parameter must be \"1\" or \"0\": #{param.first}") + end else - raise WhmArgumentError.new("Boolean parameter must be \"1\" or \"0\": #{param}") unless hash[param].to_s.match(/(1|0)/) + if hash.include?(param) && !hash[param].to_s.match(/(1|0)/) + raise WhmArgumentError.new("Boolean parameter must be \"1\" or \"0\": #{param}") + end end end end
Only raise if they key is actually included
pressednet_lumberg
train
rb
e191ec3189a19ab33a57bd2b95c02ac33644f5f6
diff --git a/server/HttpServer.js b/server/HttpServer.js index <HASH>..<HASH> 100644 --- a/server/HttpServer.js +++ b/server/HttpServer.js @@ -21,14 +21,23 @@ HttpServer.prototype.setupRouter = function() { var host = this.appId + '.stamplayapp.com'; this.app.all(/^(\/api\/.*)/, function(req, res){ req.headers.host = host; + _addSdkHeader.call(_this, req); _this.proxy.web(req, res, { target: 'http://'+host }); }); + this.app.all(/^(\/auth\/.*)/, function(req, res){ req.headers.host = host; + _addSdkHeader.call(_this, req); _this.proxy.web(req, res, { target: 'http://'+host }); }); }; +var _addSdkHeader = function(req) { + if(req.headers['stamplay-app']){ + req.headers['stamplay-app'] = this.appId; + }; +} + HttpServer.prototype.start = function() { var _this = this;
If present rewrite stamplay-app
Stamplay_stamplay-cli
train
js
f2b4ec8458969cd43e3bcec09240e7ea1ad58e6d
diff --git a/salt/transport/zeromq.py b/salt/transport/zeromq.py index <HASH>..<HASH> 100644 --- a/salt/transport/zeromq.py +++ b/salt/transport/zeromq.py @@ -211,8 +211,6 @@ class AsyncZeroMQReqChannel(salt.transport.client.ReqChannel): ''' if hasattr(self, 'message_client'): self.message_client.destroy() - else: - log.debug('No message_client attr for AsyncZeroMQReqChannel found. Not destroying sockets.') @property def master_uri(self):
Don't log debug messages during close This can hit race conditions where we might not have a fully functional logger.
saltstack_salt
train
py
ffada723afd8e5833ab3217193ac257c0dce9395
diff --git a/unixtimestampfield/fields.py b/unixtimestampfield/fields.py index <HASH>..<HASH> 100644 --- a/unixtimestampfield/fields.py +++ b/unixtimestampfield/fields.py @@ -67,7 +67,6 @@ from django.conf import settings from django.forms import fields import six -from django.utils.translation import ugettext_lazy as _ from .submiddleware import field_value_middleware @@ -214,7 +213,7 @@ class UnixTimeStampField(TimestampPatchMixin, Field): """ empty_strings_allowed = False - description = _("Unix POSIX timestamp") + description = "Unix POSIX timestamp" def __init__(self, verbose_name=None, name=None, auto_now=False, auto_now_add=False, round_to=6, use_numeric=False, **kwargs): @@ -384,7 +383,7 @@ class OrdinalField(OrdinalPatchMixin, UnixTimeStampField): """ empty_strings_allowed = False - description = _("Ordinal timestamp") + description = "Ordinal timestamp" def __init__(self, verbose_name=None, name=None, auto_now=False, auto_now_add=False, use_numeric=False, **kwargs):
fields.py: adapt removed features in Django <I> (#7) Ref: <URL>
myyang_django-unixtimestampfield
train
py
3f765fcda96ccd4877c8bde2caf19c67f655ad27
diff --git a/lib/parker/screenshot.rb b/lib/parker/screenshot.rb index <HASH>..<HASH> 100644 --- a/lib/parker/screenshot.rb +++ b/lib/parker/screenshot.rb @@ -10,9 +10,15 @@ module Parker @path = path name_pattern = /(\d{4})(\d{2})(\d{2})(\d+).+(\.[a-z]{3})/ - parts = File.basename(@path).match(name_pattern) + base_name = File.basename(@path) - @filename = parts.to_a[1..-2].join('-') << parts[-1] + parts = base_name.match(name_pattern) + + @filename = if parts + parts.to_a[1..-2].join('-') << parts[-1] + else + base_name + end end end end
Use the file basename if we don't match the pattern
waferbaby_parker
train
rb
02d8ce3e402b34f838d3f449f048163b75b724e4
diff --git a/chef-config/lib/chef-config/config.rb b/chef-config/lib/chef-config/config.rb index <HASH>..<HASH> 100644 --- a/chef-config/lib/chef-config/config.rb +++ b/chef-config/lib/chef-config/config.rb @@ -703,6 +703,9 @@ module ChefConfig # Use atomic updates (i.e. move operation) while updating contents # of the files resources. When set to false copy operation is # used to update files. + # + # NOTE: CHANGING THIS SETTING MAY CAUSE CORRUPTION, DATA LOSS AND + # INSTABILITY. default :file_atomic_update, true # There are 3 possible values for this configuration setting.
this is a really, really bad setting to tweak people are actually doing this in order to work around issues with writing /etc/hosts in docker containers. they should seriously stop doing it and fix this problem in the cookbooks.
chef_chef
train
rb
0a6dbacca2dee556c33e6bebcc0c19107d9ecf8a
diff --git a/apio/util.py b/apio/util.py index <HASH>..<HASH> 100644 --- a/apio/util.py +++ b/apio/util.py @@ -163,23 +163,7 @@ def unicoder(mystring): if isinstance(mystring, str): return mystring - if isinstance(mystring, str): - return decoder(mystring) - - return str(decoder(mystring)) - - -# W0703: Catching too general exception Exception (broad-except) -# pylint: disable=W0703 -def decoder(mystring): - """DOC: TODO""" - - if UTF: - try: - return mystring.decode("utf-8") - except Exception: - return mystring.decode(codepage) - return mystring.decode(codepage) + return str(mystring) # pylint: disable=E1120
decoder function removed (no longer needed)
FPGAwars_apio
train
py
2651ef0885c850a1498d54eb5ac606ea2b758b3f
diff --git a/lxd/containers.go b/lxd/containers.go index <HASH>..<HASH> 100644 --- a/lxd/containers.go +++ b/lxd/containers.go @@ -726,7 +726,7 @@ func containerPost(d *Daemon, r *http.Request) Response { return BadRequest(fmt.Errorf("renaming of running container not allowed")) } - _, err := dbCreateContainer(d, body.Name, cTypeRegular, c.config, c.profiles, false) + _, err := dbCreateContainer(d, body.Name, cTypeRegular, c.config, c.profiles, c.ephemeral) if err != nil { return SmartError(err) } @@ -1505,7 +1505,7 @@ func containerSnapshotsPost(d *Daemon, r *http.Request) Response { /* Create the db info */ //cId, err := dbCreateContainer(d, snapshotName, cTypeSnapshot) - _, err := dbCreateContainer(d, fullName, cTypeSnapshot, c.config, c.profiles, false) + _, err := dbCreateContainer(d, fullName, cTypeSnapshot, c.config, c.profiles, c.ephemeral) /* Create the directory and rootfs, set perms */ /* Copy the rootfs */
Pass the current ephemeral value on rename/update
lxc_lxd
train
go
943d23908a8d5b9d873267191bc985f04a61d280
diff --git a/fuel/config_parser.py b/fuel/config_parser.py index <HASH>..<HASH> 100644 --- a/fuel/config_parser.py +++ b/fuel/config_parser.py @@ -141,6 +141,7 @@ config = Configuration() # Define configuration options config.add_config('data_path', type_=str, env_var='FUEL_DATA_PATH') +config.add_config('default_seed', type_=int, default=1) config.add_config('floatX', type_=str, default='float64') config.load_yaml()
Add global seed config, needed for schemes
mila-iqia_fuel
train
py
1a76e55c1e2673a44d934ffb2d5bdc85f9add501
diff --git a/lib/lifx/network_context.rb b/lib/lifx/network_context.rb index <HASH>..<HASH> 100644 --- a/lib/lifx/network_context.rb +++ b/lib/lifx/network_context.rb @@ -95,7 +95,7 @@ module LIFX time = light && light.time end - delay = messages.count * (1 / 5.0) + 0.25 + delay = (messages.count + 1) * (1.0 / message_rate) at_time = ((time.to_f + delay) * 1_000_000_000).to_i messages.each do |m| m.at_time = at_time @@ -165,7 +165,7 @@ module LIFX @message_rate = lights.all? do |light| m = light.mesh_firmware(fetch: false) m && m >= '1.2' - end ? 50 : 5 + end ? 20 : 5 gateway_connections.each do |connection| connection.set_message_rate(@message_rate) end
Decrease message rate for <I> to <I>, and use in sync
LIFX_lifx-gem
train
rb
22cdf78dfd42d76306950cfef83558e46a89551f
diff --git a/src/JsonSchema/Uri/Retrievers/AbstractRetriever.php b/src/JsonSchema/Uri/Retrievers/AbstractRetriever.php index <HASH>..<HASH> 100644 --- a/src/JsonSchema/Uri/Retrievers/AbstractRetriever.php +++ b/src/JsonSchema/Uri/Retrievers/AbstractRetriever.php @@ -17,13 +17,7 @@ abstract class AbstractRetriever implements UriRetrieverInterface * @var string */ protected $contentType; - - /** - * {@inheritDoc} - * @see \JsonSchema\Uri\Retrievers\UriRetrieverInterface::retrieve() - */ - public abstract function retrieve($uri); - + /** * {@inheritDoc} * @see \JsonSchema\Uri\Retrievers\UriRetrieverInterface::getContentType() @@ -32,4 +26,4 @@ abstract class AbstractRetriever implements UriRetrieverInterface { return $this->contentType; } -} \ No newline at end of file +}
remove abstract declaration of 'retrieve' which duplicated interface declaration
justinrainbow_json-schema
train
php
97c5baddc192fc62a47ba6a3b7e3482c4b70bc12
diff --git a/Vps/Model/Data/Abstract.php b/Vps/Model/Data/Abstract.php index <HASH>..<HASH> 100644 --- a/Vps/Model/Data/Abstract.php +++ b/Vps/Model/Data/Abstract.php @@ -60,7 +60,8 @@ abstract class Vps_Model_Data_Abstract extends Vps_Model_Abstract } else { $select = $where; } - return $this->_selectDataKeys($select, $this->getData()); + $data = $this->getData(); + return $this->_selectDataKeys($select, $data); } public function update(Vps_Model_Row_Interface $row, $rowData)
only variables should be used as reference, fixed in _selectDataKeys from Vps_Model_Data_Abstract
koala-framework_koala-framework
train
php
4fcad1f4938ad3c2e466023d3e0e166ea6b68a84
diff --git a/zcl/json/structure.go b/zcl/json/structure.go index <HASH>..<HASH> 100644 --- a/zcl/json/structure.go +++ b/zcl/json/structure.go @@ -128,6 +128,9 @@ func (b *body) PartialContent(schema *zcl.BodySchema) (*zcl.BodyContent, zcl.Bod func (b *body) JustAttributes() (map[string]*zcl.Attribute, zcl.Diagnostics) { attrs := make(map[string]*zcl.Attribute) for name, jsonAttr := range b.obj.Attrs { + if _, hidden := b.hiddenAttrs[name]; hidden { + continue + } attrs[name] = &zcl.Attribute{ Name: name, Expr: &expression{src: jsonAttr.Value},
json: Respect hiddenAttrs in JustAttributes Previously it was leaking out hidden attributes.
hashicorp_hcl
train
go
1686a5e41848d65e03af92cff90ce8e2bb700332
diff --git a/src/toil/jobStores/aws/jobStore.py b/src/toil/jobStores/aws/jobStore.py index <HASH>..<HASH> 100644 --- a/src/toil/jobStores/aws/jobStore.py +++ b/src/toil/jobStores/aws/jobStore.py @@ -71,7 +71,7 @@ def copyKeyMultipart(srcKey, dstBucketName, dstKeyName, headers=None): totalSize = srcKey.size # initiate copy - upload = s3.get_bucket(dstBucketName).initiate_multipart_upload(dstKeyName) + upload = s3.get_bucket(dstBucketName).initiate_multipart_upload(dstKeyName, headers=headers) try: start = 0 partIndex = itertools.count()
Resolved a bug in multipart upload (resolves #<I>) that didnt pass encryption headers for multipart uploads.
DataBiosphere_toil
train
py
87f55d371846a1e3ad831633be9036988a41007a
diff --git a/holoviews/core/options.py b/holoviews/core/options.py index <HASH>..<HASH> 100644 --- a/holoviews/core/options.py +++ b/holoviews/core/options.py @@ -416,10 +416,8 @@ class Channel(param.Parameterized): Given a map of Overlays, apply all applicable channel reductions. """ - if not issubclass(holomap.type, CompositeOverlay): - return holomap # No potential channel reductions - elif cls.definitions == []: + if cls.definitions == []: return holomap # Collapse channel operations
Removed unnecessary optimization in Channel.collapse
pyviz_holoviews
train
py
d15702dc0614b064697bcca11394e14a1f0b384b
diff --git a/resource_aws_route_table.go b/resource_aws_route_table.go index <HASH>..<HASH> 100644 --- a/resource_aws_route_table.go +++ b/resource_aws_route_table.go @@ -110,7 +110,7 @@ func resourceAwsRouteTableCreate(d *schema.ResourceData, meta interface{}) error Pending: []string{"pending"}, Target: []string{"ready"}, Refresh: resourceAwsRouteTableStateRefreshFunc(conn, d.Id()), - Timeout: 1 * time.Minute, + Timeout: 2 * time.Minute, } if _, err := stateConf.WaitForState(); err != nil { return fmt.Errorf( @@ -387,7 +387,7 @@ func resourceAwsRouteTableDelete(d *schema.ResourceData, meta interface{}) error Pending: []string{"ready"}, Target: []string{}, Refresh: resourceAwsRouteTableStateRefreshFunc(conn, d.Id()), - Timeout: 1 * time.Minute, + Timeout: 2 * time.Minute, } if _, err := stateConf.WaitForState(); err != nil { return fmt.Errorf(
provider/aws: Increase route_table timeouts (#<I>)
terraform-providers_terraform-provider-aws
train
go
c48a3a56332351cf1efa643aa2d2ed2346341877
diff --git a/app/controllers/storytime/dashboard/sites_controller.rb b/app/controllers/storytime/dashboard/sites_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/storytime/dashboard/sites_controller.rb +++ b/app/controllers/storytime/dashboard/sites_controller.rb @@ -58,7 +58,7 @@ module Storytime # Only allow a trusted parameter "white list" through. def site_params - params.require(:site).permit(:title, :post_slug_style, :ga_tracking_id, :root_post_id, :custom_domain, :subscription_email_from, :layout, :disqus_forum_shortname) + params.require(:site).permit(:title, :post_slug_style, :ga_tracking_id, :root_post_id, :custom_domain, :subscription_email_from, :layout, :disqus_forum_shortname, :discourse_name) end end
Add discourse name to permitted params
CultivateLabs_storytime
train
rb
b4a37745bf9bbaa0e8f04350e95428751cfbc0e3
diff --git a/test/test_runner.rb b/test/test_runner.rb index <HASH>..<HASH> 100644 --- a/test/test_runner.rb +++ b/test/test_runner.rb @@ -97,7 +97,9 @@ class PulpMiniTestRunner set_vcr_config(mode) - if test_name + if test_name && File.exists?(test_name) + require test_name + elsif test_name require "./test/#{test_name}_test.rb" else Dir["./test/#{suite}/*_test.rb"].each {|file| require file }
allowing running of single test by filename
Katello_runcible
train
rb
2ef9ab1fb3452a45567a322762c938012bef63eb
diff --git a/packages/webapi/routes/v1/all.js b/packages/webapi/routes/v1/all.js index <HASH>..<HASH> 100644 --- a/packages/webapi/routes/v1/all.js +++ b/packages/webapi/routes/v1/all.js @@ -28,7 +28,7 @@ router.get('/v1/all/:btag/:platform', async (ctx) => { return await ctx.throw(400, 'Invalid platform'); } - const getAll = await owapi.getAllStats(ctx.params.btag, ctx.path.platform).catch((err) => { + const getAll = await owapi.getAllStats(ctx.params.btag, ctx.params.platform).catch((err) => { if (err === 'PLAYER_NOT_EXIST') { return ctx.throw(400, 'Player do not exist.'); } else if (err === 'ACCOUNT_PRIVATE') {
Fix private profile on /all issue
haskaalo_overwatch-api
train
js
eca9ee90bf64b14c6a8eacdb4197825790ab7825
diff --git a/tests/test_helpers.py b/tests/test_helpers.py index <HASH>..<HASH> 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -0,0 +1,33 @@ +""" + Tests for the NURBS-Python package + Released under The MIT License. See LICENSE file for details. + Copyright (c) 2018 Onur Rauf Bingol + + Tests geomdl.helpers module. +""" + +from geomdl import helpers + +GEOMDL_DELTA = 10e-8 + +def test_basis_function_one(): + degree = 2 + knot_vector = [0, 0, 0, 1, 2, 3, 4, 4, 5, 5, 5] + knot = 5. / 2. + span = 3 + + to_check = helpers.basis_function_one(degree, knot_vector, span, knot) + result = 0.75 + + assert to_check == result + +def test_basis_function_ders_one(): + degree = 2 + knot_vector = [0, 0, 0, 1, 2, 3, 4, 4, 5, 5, 5] + knot = 5. / 2. + span = 4 + + to_check = helpers.basis_function_ders_one(degree, knot_vector, 4, knot, 2) + result = [0.125, 0.5, 1.0] + + assert to_check == result
Add tests for A<I> and A<I>
orbingol_NURBS-Python
train
py
2dd2c19df5d465d4e7038eb1dbdb277ed052b53e
diff --git a/test/test-app/manual/Screenshot/js/index.js b/test/test-app/manual/Screenshot/js/index.js index <HASH>..<HASH> 100644 --- a/test/test-app/manual/Screenshot/js/index.js +++ b/test/test-app/manual/Screenshot/js/index.js @@ -17,16 +17,19 @@ * under the License. */ - function takeScreenshot() { - // configure options - var options = {dest:'data:', mime:'image/png'}; - // perform screenshot - var screenshot = blackberry.screenshot.execute(options); - // check result - if(screenshot.substr(0,5)=="data:") { - document.getElementById("myimage").src = screenshot; - } - else { - alert(screenshot); - } - } +function takeScreenshot() { + // configure options + var options = {dest:'data:', mime:'image/png'}; + function handler(screenshot, response) { + // check result + if(screenshot.substr(0,5)=="data:") { + document.getElementById("myimage").src = screenshot; + } + else { + alert(screenshot); + } + } + // perform screenshot + + blackberry.screenshot.execute(options, handler, handler); +}
Fix screenshot test to use current async api...
blackberry_cordova-blackberry-plugins
train
js
e7524d6a20063b2e30173bd6e095a1b18b887727
diff --git a/openquake/commonlib/parallel.py b/openquake/commonlib/parallel.py index <HASH>..<HASH> 100644 --- a/openquake/commonlib/parallel.py +++ b/openquake/commonlib/parallel.py @@ -317,7 +317,6 @@ class TaskManager(object): Progress report is built-in. """ executor = executor - progress = staticmethod(logging.info) task_ids = [] @classmethod @@ -383,6 +382,15 @@ class TaskManager(object): client = ipp.Client() self.__class__.executor = client.executor() + def progress(self, *args): + """ + Log in INFO mode regular tasks and in DEBUG private tasks + """ + if self.name.startswith('_'): + logging.debug(*args) + else: + logging.info(*args) + def submit(self, *args): """ Submit a function with the given arguments to the process pool
Small fix to the TaskManager.progress
gem_oq-engine
train
py
03fd96e1fa4a235354233c88344a7ecb06231a60
diff --git a/bin/fontbakery-fix-gasp.py b/bin/fontbakery-fix-gasp.py index <HASH>..<HASH> 100755 --- a/bin/fontbakery-fix-gasp.py +++ b/bin/fontbakery-fix-gasp.py @@ -36,7 +36,12 @@ class GaspFixer(): table.gaspRange[65535] = value self.saveit = True except: - print('ER: {}: no table gasp'.format(self.fontpath)) + print(('ER: {}: no table gasp... ' + 'Creating new table. ').format(self.path)) + table = ttLib.newTable('gasp') + table.gaspRange = {65535: value} + self.font['gasp'] = table + self.saveit = True def show(self): try: @@ -65,6 +70,8 @@ def main(): for path in args.ttf_font: if args.set is not None: GaspFixer(path).fix(args.set) + elif args.autofix: + GaspFixer(path).fix() else: GaspFixer(path).show()
fix-gasp.py: Create gasp table if it does not exist
googlefonts_fontbakery
train
py
ef7b6eb33f2c6a6d939d1b92a4ce2b7a90205753
diff --git a/JSAT/src/jsat/regression/OrdinaryKriging.java b/JSAT/src/jsat/regression/OrdinaryKriging.java index <HASH>..<HASH> 100644 --- a/JSAT/src/jsat/regression/OrdinaryKriging.java +++ b/JSAT/src/jsat/regression/OrdinaryKriging.java @@ -7,7 +7,6 @@ import java.util.concurrent.ExecutorService; import java.util.logging.Level; import java.util.logging.Logger; import jsat.classifiers.DataPoint; -import jsat.clustering.KMeans; import static jsat.linear.DenseVector.toDenseVec; import jsat.linear.*; import jsat.parameters.*; @@ -203,7 +202,7 @@ public class OrdinaryKriging implements Regressor, Parameterized } catch (InterruptedException ex) { - Logger.getLogger(KMeans.class.getName()).log(Level.SEVERE, null, ex); + Logger.getLogger(OrdinaryKriging.class.getName()).log(Level.SEVERE, null, ex); } }
removed weird import and class reference to logger that should not have been. git-svn-id: <URL>
EdwardRaff_JSAT
train
java
4429e047d6dcd1d141a2747d206e3a13c3a9a923
diff --git a/pyqode/core/widgets/tab_bar.py b/pyqode/core/widgets/tab_bar.py index <HASH>..<HASH> 100644 --- a/pyqode/core/widgets/tab_bar.py +++ b/pyqode/core/widgets/tab_bar.py @@ -25,4 +25,5 @@ class TabBar(QtWidgets.QTabBar): self.parentWidget().tabCloseRequested.emit, tab) def mouseDoubleClickEvent(self, event): - self.double_clicked.emit() + if event.button() == QtCore.Qt.LeftButton: + self.double_clicked.emit()
Don't emit double_click for buttons other the LeftButton
pyQode_pyqode.core
train
py
bc2845ee085b63e01234473065cf58351aa052dc
diff --git a/plugin/pkg/scheduler/scheduler.go b/plugin/pkg/scheduler/scheduler.go index <HASH>..<HASH> 100644 --- a/plugin/pkg/scheduler/scheduler.go +++ b/plugin/pkg/scheduler/scheduler.go @@ -184,6 +184,9 @@ func (sched *Scheduler) schedule(pod *v1.Pod) (string, error) { return host, err } +// preempt tries to create room for a pod that has failed to schedule, by preempting lower priority pods if possible. +// If it succeeds, it adds the name of the node where preemption has happened to the pod annotations. +// It returns the node name and an error if any. func (sched *Scheduler) preempt(preemptor *v1.Pod, scheduleErr error) (string, error) { if !utilfeature.DefaultFeatureGate.Enabled(features.PodPriority) { glog.V(3).Infof("Pod priority feature is not enabled. No preemption is performed.")
Add explain for preempt sunction.
kubernetes_kubernetes
train
go
92a73c8dfe4f84094bf892988797a616ef9d83f0
diff --git a/tests/test_advanced.py b/tests/test_advanced.py index <HASH>..<HASH> 100644 --- a/tests/test_advanced.py +++ b/tests/test_advanced.py @@ -9,6 +9,5 @@ def test_nested(): def test_code_with_tricky_content(): assert md('<code>></code>') == "`>`" assert md('<code>/home/</code><b>username</b>') == "`/home/`**username**" - # convert_br() adds trailing spaces (why?); ignore them by using 2 tests, - assert md('<code>Line1<br />Line2</code>').startswith("`Line1") - assert md('<code>Line1<br />Line2</code>').endswith("\nLine2`") + assert md('First line <code>blah blah<br />blah blah</code> second line') \ + == "First line `blah blah \nblah blah` second line"
Correct test_code_with_tricky_content() Result of previous test didn't check for the trailing ' ' that convert_br() adds: This is needed to ensure that the resulting markdown not only has \n for the <br> but also renders it as a newline.
matthewwithanm_python-markdownify
train
py
02ea07cf1af4e4f1a5b8d8569543461fa667919c
diff --git a/lib/alias.js b/lib/alias.js index <HASH>..<HASH> 100644 --- a/lib/alias.js +++ b/lib/alias.js @@ -15,18 +15,10 @@ export default class Alias extends Now { throw err; } - return this.retry(async (bail, attempt) => { - const res = await this._fetch(`/now/deployments/${target.uid}/aliases`); - const body = await res.json(); - return body.aliases; - }); + return this.listAliases(target.uid); + } else { + return this.listAliases(); } - - return this.retry(async (bail, attempt) => { - const res = await this._fetch('/now/aliases'); - const body = await res.json(); - return body.aliases; - }); } async rm (_alias) {
alias: move listing aliases and retrying to `index`
zeit_now-cli
train
js
476f8b5793855c220410f7e245800f8eb9e584e6
diff --git a/src/main/java/org/threeten/extra/chrono/InternationalFixedChronology.java b/src/main/java/org/threeten/extra/chrono/InternationalFixedChronology.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/threeten/extra/chrono/InternationalFixedChronology.java +++ b/src/main/java/org/threeten/extra/chrono/InternationalFixedChronology.java @@ -141,7 +141,7 @@ public final class InternationalFixedChronology extends AbstractChronology imple /** * Range of day of month. */ - static final ValueRange DAY_OF_MONTH_RANGE = ValueRange.of(-1, 0, -1, DAYS_IN_MONTH); + static final ValueRange DAY_OF_MONTH_RANGE = ValueRange.of(1, DAYS_IN_MONTH + 1); /** * Range of week of year. */ @@ -161,7 +161,7 @@ public final class InternationalFixedChronology extends AbstractChronology imple /** * Range of month of year. */ - static final ValueRange MONTH_OF_YEAR_RANGE = ValueRange.of(-1, 0, MONTHS_IN_YEAR, MONTHS_IN_YEAR); + static final ValueRange MONTH_OF_YEAR_RANGE = ValueRange.of(1, MONTHS_IN_YEAR); /** * Range of eras. */
Months range from 1 - <I>, i.e. Year Day is in month <I> and Leap Day is in month 6.
ThreeTen_threeten-extra
train
java
45f7216010dbe74cf39f1013c67a2dceb146df2b
diff --git a/lib/glimpse/views/view.rb b/lib/glimpse/views/view.rb index <HASH>..<HASH> 100644 --- a/lib/glimpse/views/view.rb +++ b/lib/glimpse/views/view.rb @@ -3,6 +3,8 @@ module Glimpse class View def initialize(options = {}) @options = options + + setup_subscribers end def enabled? @@ -26,6 +28,12 @@ module Glimpse yield name, start, finish, id, payload end end + + private + + def setup_subscribers + # pass + end end end end
Conform to a single setup subscribers method
peek_peek
train
rb
656ed9bdd38189eacf361966edf82fe32e3aca15
diff --git a/lib/knife-solo/bootstraps.rb b/lib/knife-solo/bootstraps.rb index <HASH>..<HASH> 100644 --- a/lib/knife-solo/bootstraps.rb +++ b/lib/knife-solo/bootstraps.rb @@ -66,7 +66,7 @@ module KnifeSolo end def omnibus_install - url = (true && prepare.config[:omnibus_url]) || "http://opscode.com/chef/install.sh" + url = prepare.config[:omnibus_url] || "http://opscode.com/chef/install.sh" file = File.basename(url) run_command(http_client_get_url(url, file)) # `release_version` within install.sh will be installed if
Fixed "true &&" syntax that wasn't supposed to be committed...
matschaffer_knife-solo
train
rb
2b4d42c2d24c09819ac7fdeea29d3f89d17d7fff
diff --git a/dreamssh/exceptions.py b/dreamssh/exceptions.py index <HASH>..<HASH> 100644 --- a/dreamssh/exceptions.py +++ b/dreamssh/exceptions.py @@ -10,7 +10,7 @@ class Error(Exception): class MissingSSHServerKeysError(Error): """ - SSH server keys not found. Generate them with ./bin/make-keys.sh. + SSH server keys not found. Generate them with 'twistd dreamssh keygen' """
Now that the bin dir has been removed (as well as the last script), reference right way to generate keys (using the twisted plugin).
oubiwann_carapace
train
py
c95796d981035eeb8e118aa9c15265752af232a3
diff --git a/handler/src/main/java/io/netty/handler/ssl/SslHandler.java b/handler/src/main/java/io/netty/handler/ssl/SslHandler.java index <HASH>..<HASH> 100644 --- a/handler/src/main/java/io/netty/handler/ssl/SslHandler.java +++ b/handler/src/main/java/io/netty/handler/ssl/SslHandler.java @@ -599,7 +599,7 @@ public class SslHandler public void channelInactive(ChannelHandlerContext ctx) throws Exception { // Make sure the handshake future is notified when a connection has // been closed during handshake. - setHandshakeFailure(null); + setHandshakeFailure(new ClosedChannelException()); try { inboundBufferUpdated(ctx); @@ -921,7 +921,7 @@ public class SslHandler // is managing. engine.closeOutbound(); - final boolean disconnected = cause == null || cause instanceof ClosedChannelException; + final boolean disconnected = cause instanceof ClosedChannelException; try { engine.closeInbound(); } catch (SSLException e) {
[#<I>] Make sure the handshake future is failed with a ClosedChannelException on channelInactive
netty_netty
train
java
a82cb2bc9114d4c4386b3cdbc3570328f0f7abae
diff --git a/lib/tabletastic/table_builder.rb b/lib/tabletastic/table_builder.rb index <HASH>..<HASH> 100644 --- a/lib/tabletastic/table_builder.rb +++ b/lib/tabletastic/table_builder.rb @@ -31,7 +31,7 @@ module Tabletastic @table_fields = args.empty? ? active_record_fields : args.collect {|f| TableField.new(f.to_sym)} end action_cells(options[:actions], options[:action_prefix]) - [head, body].join("").html_safe + ["\n", head, "\n", body, "\n"].join("").html_safe end # individually specify a column, which will build up the header, @@ -77,11 +77,11 @@ module Tabletastic def body content_tag(:tbody) do - @collection.inject("") do |rows, record| + @collection.inject("\n") do |rows, record| rowclass = @template.cycle("odd","even") rows += @template.content_tag_for(:tr, record, :class => rowclass) do cells_for_row(record) - end + end + "\n" end end end
Adding some newlines to make generated table source html a bit more legible
jgdavey_tabletastic
train
rb
b93ec69c0cb1c3dd7248a113f7a1981188d3b5c7
diff --git a/Model/Connector/Product.php b/Model/Connector/Product.php index <HASH>..<HASH> 100755 --- a/Model/Connector/Product.php +++ b/Model/Connector/Product.php @@ -330,7 +330,8 @@ class Product 'statusFactory', 'storeManager', 'urlFinder', - 'stringUtils' + 'stringUtils', + 'stockStateInterface' ]) ); }
Merged PR <I>: Exclude stockStateInterface Exclude stockStateInterface from synced object properties. Related work items: #<I>
dotmailer_dotmailer-magento2-extension
train
php
b47667d8af5d011d942b2792e48701be52b08d39
diff --git a/ghost/admin/app/components/gh-dropdown-button.js b/ghost/admin/app/components/gh-dropdown-button.js index <HASH>..<HASH> 100644 --- a/ghost/admin/app/components/gh-dropdown-button.js +++ b/ghost/admin/app/components/gh-dropdown-button.js @@ -24,6 +24,8 @@ export default class GhDropdownButton extends Component.extend(DropdownMixin) { // Notify dropdown service this dropdown should be toggled click() { + super.click(...arguments); + this.dropdown.toggleDropdown(this.dropdownName, this); if (this.tagName === 'a') { diff --git a/ghost/admin/app/components/gh-dropdown.js b/ghost/admin/app/components/gh-dropdown.js index <HASH>..<HASH> 100644 --- a/ghost/admin/app/components/gh-dropdown.js +++ b/ghost/admin/app/components/gh-dropdown.js @@ -91,6 +91,8 @@ export default class GhDropdown extends Component.extend(DropdownMixin) { } click() { + super.click(...arguments); + if (this.closeOnClick) { return this.close(); }
Fixed <GhDropdown> not opening refs <URL>` calls for click handlers in the `<GhDropdown>` and `<GhDropdownButton>` components were lost, meaning the event propagation was not cancelled by the DropdownMixin's `click()` handler resulting in the click-to-open being immediately undone by the body click-to-close
TryGhost_Ghost
train
js,js
effca2f94381373f9707e5c967c4cf6c7f327276
diff --git a/claripy/balancer.py b/claripy/balancer.py index <HASH>..<HASH> 100644 --- a/claripy/balancer.py +++ b/claripy/balancer.py @@ -527,8 +527,8 @@ class Balancer(object): right_min = self._min(truism.args[1], signed=not is_unsigned) right_max = self._max(truism.args[1], signed=not is_unsigned) - bound_max = right_max if is_equal else (right_max-1) - bound_min = right_min if is_equal else (right_min-1) + bound_max = right_max if is_equal else (right_max-1 if is_lt else right_max+1) + bound_min = right_min if is_equal else (right_min-1 if is_lt else right_min+1) if is_lt and bound_max < int_min: # if the bound max is negative and we're unsigned less than, we're fucked
Balancer: fix a bug of bounds calculation in _handle_comparison()
angr_claripy
train
py